deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
A tiny token-usage & account-balance monitor for DeepSeek Harness (DSH), rendered right inside the web UI.
tokbal shows you live LLM token consumption and your DeepSeek account balance without leaving the conversation:
⚡ 1.2k · ¥23.45; click it to force a balance refresh.↑input ↓output 💾cache 🧠reasoning tokens, cumulative totals, and the current balance, refreshed every 3 seconds.Two halves, both tiny:
| Half | File | What it does |
|---|---|---|
| Host | lib/index.js |
Subscribes to llm/stream events and accumulates usage chunks (input / output / cache-read / reasoning tokens) per session and globally; queries the official DeepSeek balance endpoint from the host process; exposes two same-origin JSON routes. |
| Client | lib/client.js |
A handwritten browser bundle served as-is by client-modules; polls /tokbal/state and renders the badge + stats row into sidebar/composer slots. |
The API key never leaves the host process, and the only outbound call is to your configured DeepSeek API base URL.
DEEPSEEK_API_KEY (override via settings llm-deepseek.apiKeyEnv)https://api.deepseek.com (override via settings llm-deepseek.baseURL)# from the repo root
.\scripts\install.ps1
The script copies the plugin into your profile's local plugins and registers it in
%USERPROFILE%\.dsh\profiles\web\cordis.patch.yml (skipped if already registered).
Copy this package into the profile's local plugins:
Copy-Item -Recurse . "$env:USERPROFILE\.dsh\profiles\node_modules\@local\tokbal"
Register it in %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml:
- insert:
- id: tokbal
name: '@local/tokbal'
Reload the web UI (hard refresh). That's it — no build step.
Out of the box the badge renders in the sidebar footer actions area (works on a stock shell).
To move it right above the settings gear (the footer's settings zone), apply the tiny shell patch:
.\scripts\patch-sidebar.ps1 -AppRoot "C:\Path\To\DeepSeek Harness"
The plugin auto-detects the environment:
sidebar.footer.settings, directly above the gear.sidebar.footer.action, so it still shows on stock builds.Note: the patch edits the vendored
dsh-client-ui-sidebarbundle inside the app'sresources/host/node_modulesand adds a new list slot next to the settings area. It is overwritten when the app updates — re-run the script after an update. Seepatches/for details.
⚡ 1.2k · ¥23.45. Hover for a full tooltip (this run's totals + balance + click hint); click to refresh the balance immediately.↑input ↓output 💾cache 🧠reasoning · cumulative total · balance, polling every 3 s.| Method | Path | Description |
|---|---|---|
GET |
/tokbal/state |
Snapshot: global totals, per-session breakdown, balance |
POST |
/tokbal/refresh |
Force a balance refresh, returns the snapshot |
lib/index.js Host half — usage counting, balance, JSON routes
lib/client.js Client half — handwritten browser bundle (no build step)
scripts/install.ps1 Copy into profile + register in cordis.patch.yml
scripts/patch-sidebar.ps1 Apply the optional sidebar settings-zone patch
patches/ The sidebar patch (diff + notes)
client-modules — edit lib/client.js, refresh the page.type: module) loaded by the host runtime.MIT © dsh-token-balance contributors
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。