rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:vaspike/dsh-usage-stat
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
Token usage statistics for DeepSeek Harness. Adds a Usage Stat panel to the left sidebar — the same global-panel mechanism as Plugins.


--dsw-alias-* semantic tokens only, so light/dark and user-registered custom themes apply unchanged.From the plugin market, or manually: Plugins → Add plugin and enter dsh-usage-stat (npm) or a local checkout directory. Requires DeepSeek Harness 0.2.x.
The host folds committed session events into a per-day, per-session, per-(provider, model) ledger:
| Kind | Source event | Notes |
|---|---|---|
| Steps | step/end |
Attributed to the step's assistant-message route |
| Retries | llm/retry-started |
An attempt actually dispatched after a failed request |
| Compactions | compaction/summary |
With its provider-reported usage |
| Aux | session/title-llm-request |
Title generation and other auxiliary calls |
Token buckets use the disjoint TokenUsage accounting:
assistant/message.Reasoning tokens appear only for routes whose API reports them explicitly (e.g. DeepSeek reasoner); a zero means "not reported", not "no reasoning". Cache-write tokens appear only for APIs that report cache creation explicitly (e.g. Anthropic); implicit-prefix-cache providers report reads only.
Every contributing event is appended to a JSONL ledger keyed by (sessionId, seq) with explicit history-coverage markers. Restarts replay it, and stored history is backfilled through sessionPersistence/sessionQuery without double-counting; gaps left by transient read failures heal on the next run. The ledger lives at $DSH_PROFILE_DIR/usage-stat/ledger.jsonl (or ~/.dsh/usage-stat/ledger.jsonl), overridable via the row's dataFile config.
Deleting a provider or model never loses history: routes are recorded as strings at request time, and removed routes stay filterable.
An llm/stream waterfall listener adds real-time coverage for purpose-tagged auxiliary calls (title-call usage, failed compaction attempts, other declared purposes). Loop requests pass through untouched. The browser panel reads one authenticated route, /usage-stat/api/snapshot, and refreshes every 30 s.
node tests/usage-stat.test.mjs # fold, ledger, waterfall, client helpers
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。