Introduction¶
DeepSeek Harness (DSH) displays token count, cache hit rate, and context usage in the stats line of the conversation editor by default. For scenarios requiring continuous billing, checking the current account balance in real time helps avoid interruptions mid-conversation due to insufficient balance. dsh-account-balance-chip adds a balance indicator to DSH, placing it at the end of the stats line with a visual style consistent with existing metrics.
Plugin Overview¶
dsh-account-balance-chip is a community-maintained client plugin, maintained by frib3iro. It requires no build steps and contains no Host-side code, injecting the balance indicator into the conversation editor’s stats line through a single client module and a Cordis patch. The plugin is not affiliated with DeepSeek and does not share code with any other balance-related plugins.
Core Features¶
- Balance Display: Shows the current account balance at the end of the conversation editor’s stats line, formatted consistently with the “Settings → Account” page (e.g.,
$3.62,$1,234.50,<$0.01). - Position & Style: Positioned after the context percentage, using the same font, font size, and color as adjacent metrics.
- Hover Tooltip: Displays the recharged balance and the gifted balance on mouse hover.
- Quick Top-Up: Clicking the balance indicator opens the platform’s top-up page, consistent with the “Top Up” button in “Settings → Account.”
- Auto-Refresh: Refreshes at most once per minute while mounted, and immediately when the window regains focus (with a minimum interval of 15 seconds between two reads).
Installation & Activation¶
The plugin requires DeepSeek Harness 0.2.2-rc.5 or later (desktop or web) and a connected DeepSeek account.
- Download the repository: On the GitHub repository page, click Code → Download ZIP and extract the archive.
- In DSH, open Settings → Plugins, click Add Plugin, and select the extracted folder.
- In the plugin list, ensure the “Saldo da conta” (Account Balance) entry is enabled. If the indicator does not appear, simply refresh the window.
To uninstall: Remove the dsh-account-balance-chip plugin package from Settings → Plugins.
How It Works¶
The plugin is a client-side package: it contains a package.json with a dsh configuration, a Cordis patch file, and a client module. The Host side is empty; no build is required.
- The plugin registers in the
conversation.composer.dockslot, using the flexorderproperty to place the indicator after the context meter. - Balance data is fetched from
ctx.remote.account.getBalance(...), the same API used by the “Settings → Account” page. - The process communicating with the platform is the Host, which authenticates using account credentials. The browser never sees the token directly, and the plugin neither reads nor stores API keys.
- Balance is not persisted to disk; each mounted indicator shares a single read; no requests are made when no indicator is on screen.
State & Limitations¶
- Polling, not push: Balance changes appear within approximately 1 minute, or immediately when the window regains focus.
- Single wallet: Prefers to display the USD balance; falls back to the first wallet if USD is unavailable. The account page lists all wallets.
- Depends on DSH account plugin: Requires the
remote.accountplugin to be mounted; otherwise the indicator remains inactive. - Delayed updates: Balance updates only after a single turn’s billing is completed, potentially a few seconds after the response ends.
- Top-up page: The top-up action opens in the default browser; the built-in “Settings → Account” window on desktop is not exposed to plugins.
Troubleshooting¶
- Indicator not appearing: Verify that “Saldo da conta” is enabled in Settings → Plugins, then refresh the UI. On DSH Desktop for Windows, there is no “Refresh” menu option and
Ctrl+R/F5do not work: press F12 to open DevTools, executelocation.reload()in the console, or click “Try reloading this page” on the plugin warning page. loaded without registering "dsh-account-balance-chip" via __ModuleLoader__.load: The Host still holds a stale in-memory copy (common after renaming or reinstalling the same version). Performing a single save onclient.js(triggering a file modification) will cause the Host to re-publish, then refresh the page.Saldo —displayed in gray: A read failure occurred (account not connected or platform unavailable). The indicator will recover on the next successful read.
Ecosystem & Source¶
DSH follows a “everything is a plugin” philosophy, extending its functionality through plugins. This plugin is community-maintained and not affiliated with DeepSeek or High-Flyer. All features and behavior are subject to the documentation in the GitHub repository.
- Directory page: https://www.skillhub.cn/plugins/frib3iro/dsh-account-balance-chip
- Repository: https://github.com/frib3iro/dsh-account-balance-chip