rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:echo804/dsh-billing-balance
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A static plugin for DeepSeek Harness that adds an API balance and per-session cost estimate readout to the composer stats line (the row under the input box showing cache-hit rate, tokens, etc.).
DeepSeek Harness 静态插件:在输入框下方的统计栏(显示缓存命中率、token 等那一行)追加 API 余额 与 本会话消耗金额估算。
GET {baseURL}/user/balance with your DEEPSEEK_API_KEY and shows 余额 ¥xxx (currency follows the account).tokenUsage projection (uncached / cache-read / cache-write / output) × DeepSeek's official V4-Flash peak/off-peak CNY pricing, shown as 本会话 ~¥x.xx. This is an estimate, not billing authority.| Half | Mechanism |
|---|---|
Host (index.js) |
Registers a webServer exact route /api/billing-balance; resolves DEEPSEEK_API_KEY via the credentials seam at request time; calls the balance endpoint with the global fetch (real Node environment). The key is never written to files or logs. |
Client (client.js) |
A window.__ModuleLoader__.load bundle registering an entry in the conversation.composer.dock slot (order 1, beside the shipped stats line); reads the tokenUsage projection and fetches the host route same-origin. |
Requires a DeepSeek Harness web profile (the browser GUI). The plugin is static: it must be resolvable as an npm package from your profile and appear as a loader entry. Restart the dsh web process after installing — profile configuration is read at startup.
The plugin package is the plugin/ directory of this repo. Copy it into your profile's hoisted node_modules:
# Windows (PowerShell)
$dest = "$env:USERPROFILE\.dsh\profiles\node_modules\dsh-billing-balance"
Copy-Item -Recurse -Force .\plugin $dest
# macOS / Linux
DEST="$HOME/.dsh/profiles/node_modules/dsh-billing-balance"
cp -R plugin "$DEST"
Or link it if your profile uses pnpm workspaces (pnpm --dir "$HOME/.dsh/profiles" add ./path/to/plugin).
Edit ~/.dsh/profiles/<profile>/cordis.patch.yml (for the default web profile: ~/.dsh/profiles/web/cordis.patch.yml) and append:
- insert:
- id: billing-balance
name: 'dsh-billing-balance'
Optional custom baseURL (e.g. a gateway):
- insert:
- id: billing-balance
name: 'dsh-billing-balance'
config:
baseURL: 'https://your-gateway.example.com'
Optional price overrides (CNY per 1M tokens; defaults to the official V4-Flash rates):
- insert:
- id: billing-balance
name: 'dsh-billing-balance'
config:
prices:
offPeak: { cacheRead: 0.05, cacheWrite: 1.5, input: 1.5, output: 4.5 }
peak: { cacheRead: 0.10, cacheWrite: 3.0, input: 3.0, output: 9.0 }
Stop and restart dsh web (however you normally launch it). After restart:
billing-balance.余额 ¥xxx | 本会话 ~¥x.xx; click it to refresh the balance. During peak hours (Beijing 09–12, 14–18) it additionally shows an orange 峰谷时刻 badge and prices at peak rates.credentials and webServer services (present in the shipped base/web bundles).DEEPSEEK_API_KEY configured via the credentials seam (~/.dsh/.credentials.yaml or env — however your deployment stores it).https://api.deepseek.com by default).This project is not affiliated with or endorsed by DeepSeek. Pricing constants are public reference values and may drift; always treat the displayed cost as an estimate.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。