rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:octisfall/dsh-account-balance
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Your DeepSeek account balance, and what your sessions spent, right under the composer in DeepSeek Harness.
The widget sits in the composer dock, beside the context meter:
dsh-oh-my-claude is installed, a Claude row joins the same three periods, totalled across every one of its sessions on this machine — not only the one open right now, which is all dsh-oh-my-claude's own cost line shows.dsh-oh-my-claude (claude-code, or a second configured instance's claude-code-<suffix>) shows the Claude $spent / $dailyLimit trigger instead of the DeepSeek balance; any other session shows the DeepSeek balance instead. Both show together only while the picker's choice for that session cannot be read.Balance — with a reason when the account is signed out, the wallet read fails, or the usage route is unavailable.Through the Plugins settings page — Settings → Plugins → Add — or through the CLI's plugin command, which forwards to pnpm inside the profile directory:
dsh plugin --profile <profile> add github:octisfall/dsh-account-balance
The package declares a Cordis bundle patch and a web Client entry, so it appears in the profile's plugin list and starts rendering after the page loads.
Two halves in one package, as DSH bundles expect:
| Half | File | Role |
|---|---|---|
| Host | index.js |
Registers one read-only route, GET /plugin/account-balance/usage. It folds every recent session log through ctx.sessionQuery, attributes each assistant/message to the model in force, prices the step, folds in dsh-oh-my-claude's own turns.json ledger when present, and caches the answer for 60 seconds. |
| Client | client.js |
Registers a conversation.composer.dock entry. Reads the wallet through the account Remote namespace (getBalance) and the Platform usage link through getState, and fetches the Host route when the panel opens. |
Everything the Client shows comes through the Harness itself: no separate server, no polling of Platform. Copy goes through the Client locale service (English and Chinese), colors through --dsw-alias-* theme tokens, so the widget follows the app theme and language.
The session log stores tokens, not invoices. The panel therefore shows an estimate: token counters from your local sessions multiplied by the rates in prices.json.
deepseek-flash and deepseek-v4-pro from https://api-docs.deepseek.com/quick_start/pricing, in USD per million tokens.01:00–04:00 and 06:00–10:00 UTC, Monday–Friday) bill at the peak rate and everything else at half, decided per step from the event time. Chinese public holidays are not tracked, so a holiday step is priced as an ordinary weekday.— for money, and its period total stays unpriced rather than silently understating it.Edit prices.json to correct a rate; the next read of the panel picks it up. The authoritative numbers always live in the Platform usage page the panel links to.
The Claude row is different: dsh-oh-my-claude already prices each turn in USD at the time it runs (Claude's CLI reports its own total_cost_usd), so this plugin only sums what is already in ~/.local/state/dsh-oh-my-claude/turns.json — no price table of its own, and no re-pricing. A turn the CLI routed to a non-Anthropic model (via set) is skipped, same as dsh-oh-my-claude's own cost line skips it. The Claude cost folds into the period total only when the DeepSeek price table's currency is also USD; otherwise the row still shows on its own, in USD, just not summed into a CNY (or other currency) total.
~/.local/state/dsh-oh-my-claude/turns.json, the same local, per-turn cost ledger dsh-oh-my-claude already keeps for its own cost line. Nothing is uploaded, and the file is absent entirely when that plugin is not installed, so the row simply does not appear./api bridge, so it carries no browser-session authentication: keep the server bound to loopback, which is the DSH default. It exposes aggregate token counts and costs only — never prompts, messages, file paths, or credentials.Built and verified against DeepSeek Harness 0.2.1-rc.5. It depends on conversation.composer.dock, the account Remote namespace, sessionQuery, and webServer; a Harness release that renames any of them will need a matching change here.
The plugin is a plain npm package with dsh.bundle.patch and dsh.client; there is no build step, and index.js and client.js are the shipped artifacts.
index.js or client.js, then let the profile recompose (or reload it) so the new module generation is imported.prices.json without touching code; the next read of the panel picks the new rates up.curl http://127.0.0.1:<port>/plugin/account-balance/usage.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。