deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
English | 中文
A Host + Web Client composition plugin for deepseek-harness
(dsh): queries the DeepSeek Open Platform account balance and estimates the
current session's spend. Installable via dsh plugin add.



GET https://api.deepseek.com/user/balance
using the harness's own DEEPSEEK_API_KEY credential (the key travels only
over a bounded node subprocess's stdin — never in command lines, logs, or UI).余额 ¥x | 会话 ≈¥y, click to refresh;
hover (500 ms) shows a detail tooltip below the button, horizontally
centered and viewport-clamped.auto follows the host UI / 中文 / English),
and an editable price table (off-peak / peak per model).
Changes persist in the settings document across restarts.deepseek_balance returns balance + the calling session's
estimated spend./dsh-balance auto-refresh off); while
off, no queries are issued.commands Remote namespace).Standard (bundle install, recommended):
dsh plugin --profile web add @lemcae/dsh-balance
The installer adds the package to the web profile's dependencies and bundle
list; after restarting dsh web, the loader applies the in-package
cordis.patch.yml automatically. Verify:
余额 ¥x | 会话 ≈¥y chip appears in the header with
a hover detail tooltip;deepseek_balance tool.Manual install (same mechanism, bypassing the installer): edit
$DSH_HOME/profiles/web/package.json — add "@lemcae/dsh-balance": "<latest version>" (as on npm) to dependencies and "@lemcae/dsh-balance" to the
dsh.profile.bundles array — then run pnpm install in that directory and
restart.
Peer dependencies are the official @deepseek-ai/* packages (^0.1.0-rc.5
line, covering rc.5 and rc.6; @deepseek-ai/cordis ^4.0.1) plus react,
provided by the host.
余额 ¥x | 会话 ≈¥y; click to refresh; hover for details
(breakdown, model, 更新于, refresh cadence / pause note)./dsh-balance [refresh | interval <毫秒> | prices <JSON> | language <auto|zh-CN|en> | auto-refresh <on|off>].deepseek_balance (no arguments).Settings namespace dsh-balance:
| Field | Default | Meaning |
|---|---|---|
autoRefresh |
true |
Enable/disable the auto-refresh timer (/dsh-balance auto-refresh on\|off) |
refreshIntervalMs |
30000 |
Active auto-refresh interval (5 000–600 000 ms) |
language |
auto |
Plugin UI language:auto (follow host UI), zh-CN, or en |
prices |
see source | { models: { deepseek-v4-flash, deepseek-v4-pro, default } }, each model { offPeak, peak } rates in CNY per 1M tokens |
Prices are picked by Beijing hour: peak for 9:00–12:00 and 14:00–18:00,
offPeak otherwise.
default entry (v4-flash rates).command/run + command/done events; pause-downshifting reduces this.PAUSED_REFRESH_MS (5 min); a new conversation resumes the active cadence
at the next probe, so recovery can lag by up to that interval.The tool schema deepseek_balance (zero parameters) plus its description,
which states it queries the official balance endpoint with the harness
credential and returns the session spend estimate.
Zero direct tokens; the tool result is data-dependent (payload with balance, consumption, prices, idle state).
Prefix-stable: tool name, description, and schema are constant; the result varies per call, which does not invalidate prefix reuse.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。