deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
Token usage statistics for DeepSeek Harness, shown as a page under Settings → Usage in the web GUI. The plugin rescans persisted session logs and never writes anything back.
简体中文 ·
Hovering a bar or a donut segment shows the exact breakdown:
| Bar tooltip | Donut tooltip | Dark theme |
|---|---|---|
![]() |
![]() |
![]() |
The plugin ships as a bundle: dsh plugin add appends it to the profile's bundle list, and the patch row activates the host half.
# from npm (recommended)
dsh plugin --profile web add dsh-usage-panel
# or from GitHub
dsh plugin --profile web add github:AlfredChaos/dsh-usage-panel
# or from a local checkout
dsh plugin --profile web add ./dsh-usage-panel
Restart dsh --profile web and open Settings → Usage. The npm package ships prebuilt JavaScript under lib/ with no install scripts; GitHub installs need no pnpm build allowance either, because the same files are committed to the repository. To remove it:
dsh plugin --profile web remove dsh-usage-panel
The host half rescans persisted session logs through the read-only sessionQuery service:
request/header and request/context events record the model in use for each step;assistant/message events carry that step's TokenUsage (input, output, cache read, cache write);Forked sessions are deduplicated through header.seedLength. Because nothing is written, statistics survive restarts and cover sessions from before the plugin was installed.
The first scan starts as soon as the plugin loads, so the page usually renders straight from cache. A payload is considered fresh for 10 minutes; older ones are returned immediately with a stale flag (the page shows "updating in background") while a rescan refreshes the cache. A keep-warm timer rescans every 10 minutes, and the refresh button always forces a synchronous scan.
Values adapt to Chinese magnitudes: 亿 (10⁸) and 万 (10⁴), plain numbers otherwise.
| File | Role |
|---|---|
lib/index.js |
Host half (Cordis plugin): session-log scan, aggregation, cached RPC with warm-up |
lib/client.js |
Client half (./client export, __ModuleLoader__ bundle): settings-page UI built with React.createElement and SVG, styled with --dsw-* tokens |
cordis.patch.yml |
Bundle patch: inserts the usage-stats row into the profile composition |
The host serves an overview endpoint through ctx.connection.rpc.handle('/usage-stats', …, { authority: 'loopback' }); the browser calls it via rpc.call('/usage-stats', 'overview', …). Developed against DeepSeek Harness 0.1.0-rc.6.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。