rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:879745uhjun/dsh-token-usage
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Live and historical token usage for every session in DeepSeek Harness — on one dedicated page.

localStorage); every session also keeps its own
per-day buckets.▲56% or ▼12% — green when the change is good, red when it is not
(more spend or tokens is red, a higher cache hit rate is green, flat is
→0pp). Hovering shows both values: a selected window compares with the
window before it, all time compares the latest 7 days with the 7 before,
and the two “today” cards compare with yesterday.▸ at the left of a session row expands that
session's per-day bars for the selected range (spend when priced, tokens
otherwise) with a N days · tokens · spend total; expanding never opens the
session./session-boxes: a parent box contains
its child boxes' sessions, ungrouped sessions come last, rows carry a
parent / child label, and both CSV exports and the Markdown copy gain a Box
column. A missing route, a 1.5 s timeout, or a malformed payload silently falls
back to workspace grouping.1 sub-sessions · ¥1.22) that expands inline. Grouping can be turned off.~/.dsh/token-usage-cache.json keyed by
artifact size and modification time, so a restart reads no session logs at all
(2.3 s cold → ~7 ms warm). Any changed file falls back to an incremental read.tokenUsage projection: a final assistant settlement replaces the streaming
sample of the same attempt, and a retried attempt is billed separately.0.02 / 1 / 4, Pro
0.15 / 4.5 / 13.5 per million cache-hit / miss / output tokens) with the
Beijing peak window doubling every rate. Spend appears in the summary strip,
as a sortable table column, and as the default history metric.None.
The estimate is a reference figure, not a bill. Override the table by creating
~/.dsh/token-usage-prices.json:
{
"currency": "CNY",
"symbol": "¥",
"peakMultiplier": 2,
"models": [
{ "match": "minimax", "cacheHit": 0.3, "cacheMiss": 3, "output": 9 },
{ "match": "deepseek-v4-pro", "cacheHit": 0.15, "cacheMiss": 4.5, "output": 13.5 }
],
"fallback": { "cacheHit": 0.02, "cacheMiss": 1, "output": 4 },
"holidays": ["2026-10-01", "2026-10-02"]
}
Rates are per million tokens in currency; match is a case-insensitive
substring of the provider model name, longest match first. Every field is
optional — omitted fields keep their built-in value. holidays are the days
that bill at the off-peak rate all day; add each new year's statutory holidays
there.
| File | Role |
|---|---|
index.js |
Host half: incremental Zstandard frame reader over ~/.dsh/sessions, the usage fold, and the read-only /token-usage route. |
client.js |
Browser half: the global panel, summary strip, 7/14/30-day history strip, sortable table, exports, and polling. |
The Host half registers no tool and adds no prompt content; it serves one read-only JSON route. Artifacts are decoded frame by frame, so a poll only reads what the Host appended since the previous one; restarts, truncation, and a half-written final frame each have their own handling.
Data colors come from the --dshc-* palette: :root carries the light set and
body[data-ds-dark-theme] overrides it with the dark one, so charts and the
peak/off-peak split never hardcode a hex value.
ETag hashes each
artifact's byte size and mtime. An external tool that rewrites a log in place
to the same size and restores its original mtime could make a 304 serve stale
content; the normal write path never does this, so no extra fingerprint is
computed.node test/host.test.mjs # host fold, incremental reader, pricing (no third-party deps)
pnpm add -D jsdom react react-dom
node test/page.dom.test.mjs # runs the shipped client.js in jsdom: sorting, search, states
dsh plugin --profile desktop add github:879745uhjun/dsh-token-usage
Reload the Web UI page after installing.
MIT.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。