rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
Alphazer01214/dsh-usage-dashboard
DeepSeek Harness 侧边栏用量仪表盘插件:跨会话 token / 模型 / 活动统计、按会话明细与可选时间尺度的用量趋势图。 Usage dashboard plugin for DeepSeek Harness web: cross-session token, model, and activity stats with a per-session table and a windowed trend chart.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Alphazer01214/dsh-usage-dashboard
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文

A usage dashboard for DeepSeek Harness web deployments, shipped as a first-class composition plugin (one host half, one trusted browser half). It replaces the sidebar's built-in usage dialog with a durable, deployment-wide usage ledger that fixes the built-in dashboard's four structural problems:
usage_dashboard in the harness storage root),
completely separate from the session logs and their projection caches.tokenUsage / sessionStats projection semantics field-for-field (verified
against the harness folds over randomized event sequences): same-step usage
samples replace instead of adding, fork/subagent seed prefixes are skipped so
an ancestor's history is counted exactly once, and every write is
cross-checked against the live tokenUsage projection with a loud mismatch
log.It also records the models used by subagents (each subagent is its own session, attributed to its parent), and draws the usage trend per day — stacked input/output bars plus a cumulative line, with 7-day / 30-day / all windows.
The earlier releases installed the dashboard as a dynamic Cordis package
per session (via the autoload/ loader). Dynamic browser halves are gated by
the harness's client-code activation policy, so every harness start showed a
Cordis approval dialog for usage-dashboard in every session. This release
mounts the same host ledger and the same sidebar dialog as ordinary
composition rows in the web profile patch: the browser half is part of the
trusted page composition, so no dynamic plugin is defined, nothing is
approved, and no dialog ever appears. The ledger data itself is unchanged
and carries over seamlessly.
A DeepSeek Harness web-profile deployment that mounts storage-domain,
session-persistence, and webServer (the standard web bundle does). The
plugin reads only public services — it changes no harness code.
Build the deployable package (or use a release's prebuilt lib/):
node scripts/build.mjs # emits lib/index.js (host) + lib/client.js (browser bundle)
Copy the package into the profile's packages directory:
cp -r . "$DSH_HOME/profiles/<profile>/packages/dsh-usage-dashboard"
Add the dependency to <profile>/package.json and link it:
"dependencies": { "dsh-usage-dashboard": "file:./packages/dsh-usage-dashboard" }
then run pnpm install in the profile directory.
Append to <profile>/cordis.patch.yml:
# Usage dashboard: durable cross-session ledger (host) + trusted sidebar
# dashboard (browser). No dynamic-plugin approval is involved.
- insert:
- id: usage-dashboard
name: dsh-usage-dashboard
# Keep only the most feature-complete dashboard: disable the shipped
# projection-only footer action (same sidebar cell).
- id: ui-dashboard
disabled: true
Restart the harness. The sidebar now shows a single 用量 action backed by the durable ledger, for every session, with no approval prompts.
sessionId@createdAt and carries the folded
state (per-day and per-model token buckets, turns/steps/timings, newest
billed model) plus a seq watermark. Records only ever advance: writes are
serialized per key and a lower-watermark snapshot can never regress a stored
record.seedLength: fork and
subagent children count exactly what they themselves billed, and the
inherited prefix stays attributed to the ancestor — the totals are the true
billed usage with no double counting anywhere in a fork tree.session/event listeners registered with
{ global: true } (at the host root this is the default view anyway; the
flag keeps the code scope-independent). Activation heals every stored tail,
materializes live cells, and the report additionally backfills any session
the ledger has never seen, so the report is complete even for sessions
created while the plugin was stopped.{ format: 'dsh-usage-dashboard-backup', version: 1, exportedAt, records }. Import validates every record and merges by key: a
record is adopted only when its seq is higher than the stored one, so
repeated imports are idempotent./usage-dashboard/report, /usage-dashboard/export,
and /usage-dashboard/import (same-origin webServer routes registered by the
host half) — the dynamic runner's harness.handle/host.call channel does
not exist for composition rows.src/host.js — the canonical host-half module (ledger, heal/backfill,
report/export/import webServer routes).src/client.js — the canonical browser-half module (sidebar action and
dialog; React is provided by the bundle wrapper).scripts/build.mjs — generates lib/index.js and lib/client.js from the
sources (the browser bundle is a window.__ModuleLoader__.load({ id, factory }) handoff).package.json — the deployable package manifest (dsh.client declares the
web browser half; exports["./client"] points at the bundle).CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness、deepseek-harness-plugin、deepseek-harness-plugins。