Introduction¶
In DeepSeek Harness (DSH), when running sessions, tokens are scattered across the usage records of every assistant/message. The platform wallet balance also needs to be checked separately in account settings or the web interface. If you only want to answer “how much this account has used and how much is left,” switching back and forth within the application is time-consuming and prone to inconsistencies with the local session logs. dsh-token-account is maintained by community contributor nanvtin-droid. Classified as a client plugin, it adds a panel to the DSH Web UI sidebar, summarizing usage from local session logs and reading/writing to the same-source DeepSeek platform wallet via the Host side, without exposing credentials to the browser.
Plugin Positioning¶
dsh-token-account (npm package name @local/dsh-token-account, current version 1.1.0, MIT license) is a DSH bundle plugin: containing both Host and Client halves, declared via dsh.bundle.patch. It registers sidebar.panellist#token-account in the sidebar, corresponding to main#token-account in the main area. The Client only calls the same-origin GET /api/token-account/overview to get JSON and does not persist state locally; no residue remains after disabling or uninstalling. See GitHub for the repository and documentation. The community directory page is SkillHub Plugin Entry. The DSH ecosystem adheres to the principle of “everything is a plugin”; SkillHub is an independent community directory with no official affiliation with DeepSeek or Huanfang.
Core Features¶
The panel displays the following content by section (consistent with the README feature table):
| Section | Content |
|---|---|
| Wallet | Platform wallet (top-up + bonus), profile name, platform usage page and recharge links |
| Today | Since the start of the local natural day: cached read, cache miss input, output, and request counts |
| This month | Current local monthly usage and active days |
| Recent | Usage within the selected time window (default approx. 180 days) |
| Daily usage by month | Daily stacked bars (cache read / input / output), month switching, monthly total, active days, daily average, peak day, cache ratio |
| Daily detail | Table for the last 14 days |
| Model breakdown | Token distribution by provider/model within the time window |
Since v1.1.0, input/output and cache/request details under each total quantity take up a separate line, no longer truncated (README screenshots indicate v1.0.0 as the cutoff).
Data Source & Statistics Method¶
Usage comes from local submitted session logs containing assistant/message TokenUsage identical to Harness replay, converted into natural days based on the local timezone. Forked sessions inherit source events but only count events actually generated by that session; prefixes are not double-counted. Results are cached by session persistence revision; when opening the panel again, it is mostly a single list(), rather than replaying the entire log. When facing a large number of sessions for the first time, single-time folding is constrained by a time budget, and the panel will poll until all session folding is complete.
Balance is obtained by the Host calling ctx.deepseekAccount.getBalance and getProfile, consistent with the platform wallet shown in account settings. No credentials are received on the browser side.
Token calculation alignment with adapter fields:
total = input (cache miss) + output + cache read + cache write
inputTokens represents the prompt that did not go through the cache; cacheReadTokens / cacheWriteTokens are displayed separately to avoid the illusion of “total being smaller than cache hits”. Token counts are the values reported by the service provider; the plugin does not perform price estimation.
Installation & Enablement¶
This plugin is installed as a directory bundle. You must first download the repository locally, then point the current profile’s plugin manager to the absolute path.
Get the source code directory (official README example):
git clone https://github.com/nanvtin-droid/dsh-token-account.git
Execute bundle installation in the plugin manager (change the path to your machine’s actual location):
// plugin_manager → install_bundle
{ "target": "C:/path/to/dsh-token-account" }
The manager will complete the package installation, adding @local/dsh-token-account to profile bundles and taking effect immediately. A new icon will appear in the sidebar; if the Web UI is already open, refresh once to load the Client bundle.
Uninstall: Remove @local/dsh-token-account on the Plugins page, or use plugin_manager → remove_bundle.
The plugin runs with the current DSH process permissions. Please review the source code and MIT license yourself before installing to confirm the scope of reading session logs and account services is acceptable.
Typical Usage¶
- After installing the bundle and refreshing the Web UI, open Token Account in the sidebar (or the token-account entry in the README).
- When logged into a DeepSeek account, the top of the panel shows wallet and profile name, with links to jump to the platform usage page or recharge; when not logged in, it shows a login prompt, but local usage statistics remain usable.
- Check Today / This month / Recent cards, then switch months in “Daily usage by month” to observe the stacking chart and cache ratio; look at the last 14 days table and model distribution for detailed checks.
- If the statistics window or scan behavior needs tuning, you can configure optional
configin the bundle row (unknown keys will be ignored), for example:
- id: token-account
config:
scanBudgetMs: 7000 # Time budget for folding new session logs in a single request
maxSessions: 400 # Upper limit for the number of latest sessions participating in statistics
readConcurrency: 3 # Number of sessions read in parallel
accountTtlMs: 30000 # Wallet cache TTL
defaultDays: 120 # Default days window when days is not specified
maxDays: 366 # Hard upper limit for days query
clientVersion: '1.0.0' # x-client-version when requesting the platform
Scenarios & Considerations¶
Suitable for users who work long-term in the DSH Web UI and need to put local session Token trends and the platform wallet in the same view. The following boundaries come from the README and should be kept in mind:
- Usage only includes sessions recorded on this machine, in the local timezone; activity on other devices needs to be viewed on the platform’s native usage page.
- Balance depends on having a logged-in DeepSeek account.
- The plugin does not save its own database; all displayed content is derived from session logs and the account service.
Development and regression can be run in the repository root directory using pure Node (no need to start the DSH process):
node test/host.test.mjs
node test/client.test.mjs
Host side covers daily bucketing, fork deduplication, cache reuse, wallet mapping; Client side covers registration, locale, and full rendering smoke tests.
Conclusion¶
dsh-token-account brings “Token usage in local logs” and “Platform wallet balance” together into one link in the DSH sidebar: the Client only hits the same-origin overview API, and the Host is responsible for folding logs and reading the account. If you are filtering client-side DSH plugins on SkillHub or GitHub, you can enter the documentation from the Directory Page or directly consult the nanvtin-droid/dsh-token-account repository README for the architecture diagram and Chinese documentation section.