dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek API account balance as a floating bottom-right badge in the DeepSeek Harness web UI (dynamic Cordis plugin)
A dynamic Cordis plugin for DeepSeek Harness: a floating badge at the bottom-right of the Web UI showing your DeepSeek API account balance, refreshed periodically.
一个用于 DeepSeek Harness 的动态 Cordis 插件:在 Web 界面右下角悬浮展示你的 DeepSeek API 账户余额,并定时刷新。
在 DeepSeek Harness 的 Web 界面(浏览器页面)右下角显示一个余额徽章,查询的是 DeepSeek API Get User Balance 接口。它由 Host 与 Client 两个半边组成:
https://api.deepseek.com/user/balance。出于安全考虑,它通过本机子进程直接执行 curl(argv 数组形式,无 shell 注入;不可用时回退到 shell 服务),因此 API Key 始终留在 Host 进程内存中,不会发送给浏览器、不写入磁盘。shell.overlay 槽注册一个右下角悬浮卡片:未配置时提示输入 sk-… Key;配置后胶囊直接显示总余额,展开卡片可见赠送余额 / 充值余额 / 账户可用状态与更新时间,支持「立即刷新」与「清除 Key」,并每 60 秒自动刷新。这是一个动态 Cordis 插件,通过会话内工具装载,无需改任何部署配置、无需重启:
cordis_define):
code.host = src/host.js 中的函数体code.client = src/client.js 中的函数体dsbal(Host 会自动分配最终 ID)pluginId/packageId 执行 cordis_run 激活,并在 Web 界面批准 Client 授权。sk-…)→「保存并查询」。也可以把
src/host.js/src/client.js交给任何带动态 Cordis 插件能力的助手,要求它原样装载这两个函数体。
Authorization: Bearer <key>,密钥通过受控子进程(argv)传递,不经过 shell 字符串拼接。configured / balances / isAvailable / error / at 等展示字段。subprocess/shell 或子进程 TLS 被沙箱拦截),卡片会显示错误信息,不会静默失败。curl -sS -f https://api.deepseek.com/user/balance -H "Authorization: Bearer <YOUR_KEY>"
返回示例(展示字段:币种、总余额、赠送余额、充值余额):
{
"is_available": true,
"balance_infos": [
{
"currency": "CNY",
"total_balance": "110.00",
"granted_balance": "10.00",
"topped_up_balance": "100.00"
}
]
}
dsh-deepseek-balance/
├── plugin.json # 插件清单:名称、用途、入口、安装提示
├── src/
│ ├── host.js # Host 半边函数体(直接粘贴到 code.host)
│ └── client.js # Client 半边函数体(直接粘贴到 code.client)
├── docs/
│ └── ARCHITECTURE.md # 实现说明与选型
├── package.json
├── LICENSE # MIT
└── README.md
MIT © 2026 dsh-deepseek-balance contributors
A floating badge at the bottom-right of the DeepSeek Harness Web UI that shows your DeepSeek API account balance, powered by the official Get User Balance endpoint. The plugin has two halves:
https://api.deepseek.com/user/balance by spawning local curl through a subprocess (argv array — no shell injection; falls back to the shell service). The API key never leaves Host memory, is never sent to the browser and is never written to disk.shell.overlay slot: before configuration it asks for a sk-… key; afterwards the pill shows the total balance directly, and the expanded card shows granted / topped-up balances, availability and last-update time, with a manual refresh and a “clear key” action. It auto-refreshes every 60 seconds.This is a dynamic Cordis plugin, loaded through the in-session tooling — no deployment config changes, no restart:
cordis_define):
code.host = the function body in src/host.jscode.client = the function body in src/client.jsdsbal for a new Plugin (the Host allocates the final ID)cordis_run the returned pluginId/packageId and approve the Client authorization in the Web UI.sk-…) → “Save & query”.Alternatively hand
src/host.js/src/client.jsto any assistant with dynamic Cordis plugin capability and ask it to load those two function bodies verbatim.
Authorization: Bearer <key>; the secret is passed via a controlled subprocess argv, never through shell string interpolation.configured / balances / isAvailable / error / at).subprocess/shell, or child-process TLS blocked by a sandbox), the card shows the error instead of silently failing.curl -sS -f https://api.deepseek.com/user/balance -H "Authorization: Bearer <YOUR_KEY>"
dsh-deepseek-balance/
├── plugin.json # manifest: name, purpose, entrypoints, install hint
├── src/
│ ├── host.js # Host function body (paste into code.host)
│ └── client.js # Client function body (paste into code.client)
├── docs/
│ └── ARCHITECTURE.md # design notes and trade-offs
├── package.json
├── LICENSE # MIT
└── README.md
MIT © 2026 dsh-deepseek-balance contributors