bowenliang123/dsh-context
bowenliang123/dsh-contextDSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
交易终端风格的 DeepSeek Harness 计费插件:侧边栏余额与今日消费、按步骤人民币费用表、官方价自动同步(含峰谷)、跨会话与按天汇总、工具级费用归属与成本预测。
A little "bookkeeper" for DeepSeek Harness (dsh): your balance, today's spending, and how much each model step costs — all crystal clear, no more guessing.
When using DeepSeek, don't you often wonder:
Install suanzhang and the answers are right in front of you:
| You care about | suanzhang gives you |
|---|---|
| Remaining balance | Always visible in the sidebar, auto-refreshed |
| Today's spend | Right there in the sidebar too |
| Cost per step in RMB | Per-step cost table in the "算账" tab |
| Where the money went | Visualized by model, by tool, by day |
| How much more to chat | Cost forecast: avg per step × steps |
A clean trading-terminal style (think Bloomberg):
当前余额:¥xx.xx,今天用了:¥xx.xx — click it to jump straight into the 算账 tab.Sidebar balance & today's spend · 算账 tab quote bar + cost table · Analysis bars + cost forecast
dsh web runs).pnpm add https://github.com/CZ1900/suanzhang-dsh.git
Then edit cordis.patch.yml under your Harness profile, adding at the top:
- insert:
- id: suanzhang
name: suanzhang-dsh
Restart dsh web and refresh — you'll see the balance in the sidebar and the "算账" tab in the session header.
Copy the folder into your Harness profile's node_modules:
# inside the DSH profile directory (e.g. ~/.dsh/profiles/web):
cp -r /path/to/suanzhang-dsh node_modules/
Then add the same two insert lines to cordis.patch.yml and restart.
| Action | Where data goes | Uploaded? |
|---|---|---|
| Balance check | GET https://api.deepseek.com/user/balance (with your Key) | Only to DeepSeek official |
| Official pricing | https://api-docs.deepseek.com public page | No auth, read-only |
| Cost/summary calculation | Reads your local session logs | Never leaves your machine |
| Display / sort / charts | Local browser computation | Never leaves your machine |
Q: Does the plugin itself consume tokens? A: Zero. It never calls any model — pure local computation plus two free HTTP requests. The tokens you actually spend are from chatting in dsh, unrelated to this plugin.
Q: Will prices go stale? A: No. Official pricing auto-syncs; when DeepSeek adjusts prices the plugin follows automatically. If fetching ever fails, it falls back to built-in prices so nothing breaks.
Q: Which models are supported? A: DeepSeek V4-Flash / V4-Pro (including peak/off-peak pricing), plus deepseek-chat / deepseek-reasoner. Other models show as "未计价" (not priced).
lib/index.js (Host: balance/pricing/summary/today RPCs), lib/client.js (browser UI).lib/index.js): API key ref defaults to DEEPSEEK_API_KEY, baseURL defaults to https://api.deepseek.com, peak hours 9:00–14:00, low-balance threshold ¥20.60000 (ms) in lib/client.js.MIT — use it, fork it, credit it.