bowenliang123/dsh-context
bowenliang123/dsh-contextDSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
A cost & usage crystal ball for the DeepSeek Harness web GUI — balance, real-time rate, peak/off-peak billing, and a 🔮 next-message cost forecast, all timezone-aware.
中文说明见 README_CN.md。
tok/sRequires the DeepSeek Harness web profile (@deepseek-ai/dsh).
# Option 1 (recommended): npm package
dsh plugin --profile web add dsh-cost-crystal
# Option 2: from GitHub
dsh plugin --profile web add "github:xxvk/dsh-cost-crystal"
# Option 3: local development
dsh plugin --profile web add /path/to/dsh-cost-crystal
Then restart dsh web and hard-refresh the browser. The package declares dsh.bundle, so dsh plugin mounts it into the profile's bundle layer automatically — no manual config.
01:00–04:00 and 06:00–10:00 UTC.dsh-cost-crystal buckets usage per model automatically from session logs, so mixed DeepSeek + vision-language (VL) usage shows side by side on the card. When more than one model is present, a summary line (deepseek 12.5M · ¥36.6 qwen3-vl 1.2M · ¥3.2) appears, and the ▼ button next to the source label cycles through your configured models.
To use a VL model (e.g. Alibaba qwen3-vl-flash), configure it as a DSH provider — for example via the dsh-vision-router plugin (provider vision-http, model aliyun/qwen3-vl-flash, DASHSCOPE_API_KEY in ~/.dsh/.credentials.yaml). dsh-cost-crystal needs no extra config: it reads whatever models the session log records.
See ROADMAP.md and TODO.md.
npm install # only typescript devDependency
npm run build # generate injected-script templates + tsc → lib/
npm test # build + all tests + line rules (TDD gate)
npm run build:profile # generate local hot-reload profile plugin (dev)
Architecture: Host logic (src/index.ts / src/pricing.ts / src/usage.ts) is TypeScript; injected scripts are plain-JS sources (src/scripts/card.inline.js + card-fmt.inline.js + card-render.inline.js) escaped into generated src/card-script.ts by scripts/build-scripts.mjs (generated files: never hand-edit).
Every code change must pass to be "done":
npm test # = tsc build + node --test (all tests) + check-lines
node:test, zero runtime deps; CI (.github/workflows/test.yml) runs on push/PRsrc/test ideal ≤200 / hard cap 300; generated lib/ exempt. See CONTRIBUTING.md