DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
T

dsh-token-usage-dashboard

Token Usage Dashboard

Codex 风格 Token 用量统计仪表盘:5 统计卡 + 每日/每周热力图 + 洞察 + 模型用量排名(DeepSeek Harness 插件)

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add github:solstice621/dsh-token-usage-dashboard#6b1ff22eff2bae4ab3f3ae27861eb4e1fe204fc2
README兼容性版本
dsh-token-usage-dashboard screenshot

兼容性与来源证明

Token Usage Dashboard 以 dsh-token-usage-dashboard 发布,当前版本为 1.0.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
github
Registry 更新时间
2026/10/22

版本

1.0.1stable
2026/10/22

相关插件

正在加载相关插件…

最新版
1.0.1
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
未提供
文件数
未提供
Surface
web
许可证
MIT
发布源
github
GitHub
★ 3
周下载
0
最近提交
2026/10/30
查看源码 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundle扩展推理的实验性机器翻译Our Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — 在 dsh 里装上这个插件即可,无需登录、注册或填 API Key,就能使用包括 DeepSeek V4.1 Flash、Kimi K3 在内的前沿模型,桌面端另有 EAC 协付渠道;2.0 起接入 LobsterAI、Qoder、TRAE、Cline、Loomy、Raccoon、MiniMax、ZCode、Gemini 十个账号渠道(原有匿名免费通道保留)(登录、账号池、积分领取、本地 OpenAI 网关与局域网转发、数据看板与运行日志),六页毛玻璃界面统一呈现。Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Connect Workbuddydsh-connect-workbuddy把本机登录的 WorkBuddy 模型(国内版与国际版)接入 DeepSeek Harness:每次刷新按上游目录自动读取每个模型的积分倍率,支持逐模型图片输入开关、多账号切换与账号池自动换号,并提供每日签到、卡片与输入框里的胶囊积分读数等只读积分概览。

README

dsh-token-usage-dashboard — Codex-style token usage dashboard

English | 简体中文

A Codex-style token usage dashboard for DeepSeek Harness (dsh) Web UI: 5 stat cards + a GitHub-style activity heatmap (daily / weekly) + insights + per-model usage ranking. The UI follows the DSH language setting: Chinese interface → Chinese dashboard, anything else → English.

dsh-token-usage-dashboard screenshot

✨ Features

  • 5 stat cards: total tokens / peak tokens (single day) / longest chat / current streak / longest streak; auto-shrinking one-line values
  • Heatmap: 53×7 rolling grid (today pinned to the bottom-right corner), hover for Aug 15, 2026: 273k tokens · 34 requests; Daily / Weekly view toggle (weekly = bottom-up 7-cell bars, hover for the week total)
  • Insights: total turns, LLM requests, sessions, active days, cache hit rate, avg tokens & duration per turn
  • Favorite models: provider/model token ranking (Top 5) with ratio bars
  • Data source: session logs (assistant/message usage + request/header model attribution + turn/start/turn/end durations), live incremental updates, persisted snapshot + incremental sync for fast restarts

🏗️ Architecture

The plugin has two runnable forms that share the same aggregation logic:

  • Bundle form (recommended for end users): installed via dsh plugin add; the npm package contains lib/index.js (host half) and lib/client.js (client half). The host half registers GET /api/token-stats and POST /api/token-stats/rescan through connection.fetch, behind the Web UI's Host/Origin and browser-session checks; the client half registers a "Settings → Stats" section and fetches the API.
  • Dynamic-plugin form (for maintainers/iteration): host.js and client.js are pasted into cordis_define for in-session deployment without restarting the profile.

Data flow:

  1. Host subscribes to session/event / session/created and also performs an initial backfill over historical session logs.
  2. It folds assistant/message.usage, request/header model attribution, and turn/start/turn/end durations into in-memory aggregates.
  3. Aggregates are periodically flushed to the host JSON storage unit token_stats (normally <DSH_HOME>/storages/token_stats.json); on restart the snapshot is loaded first, then only new events are incrementally folded. Older Harness versions expose sessionPersistence.readFrom for suffix reads; versions without it use sessionQuery.readSession to read the full log while still folding only new events.
  4. The client polls GET /api/token-stats (2s while scanning, 30s after ready) and renders the dashboard.

An explicit rescan rebuilds from the current logs and replaces all aggregates only after every read succeeds. Repeated or simultaneous rescans do not accumulate history again. Live events received during replay are merged in sequence order. Normal restarts retain statistics for deleted sessions; an explicit rescan removes that history when the logs are gone. A failed rescan preserves the last complete result and reports an error.

Both forms use the host's storage / storage.backend.json services for persistence; the JSON backend owns its configured root, atomic writes and directory creation. These services are required for normal Cordis activation (verified on DSH Desktop 0.2.1-rc.2). When the native unit is empty, a readable legacy token-stats/snapshot.json is migrated without modifying the old file. Directly embedded hosts without native storage may still provide fs; its legacy path uses profileContext.home, or an explicit dshHome. Bundle additionally falls back to DSH_HOME / the OS user's .dsh; Dynamic without any known home stays in memory. The dynamic plugin continues to use the authenticated Harness RPC channel.

Enable only one form per host. Bundle and Dynamic share the token_stats storage unit, which permits one active handle at a time.

Tests

Run npm ci && npm test for regression tests covering both host implementations. The optional real-Harness HTTP and native-storage integration tests require Node 24 and a Harness source checkout; see TESTING.md for commands, the pinned contract revision, and coverage limits.

🚀 Install (bundle)

dsh plugin --profile web add github:solstice621/dsh-token-usage-dashboard
dsh --profile web   # restart to apply

Then open Settings → Stats for the full dashboard. Local install: dsh plugin --profile web add file:/path/to/dsh-token-usage-dashboard.

On first open the plugin scans all historical sessions (seconds to a minute), then updates in real time via session/event; the dashboard auto-refreshes every 30s — no manual action needed.

🧑‍💻 Dynamic-plugin deployment (maintainers)

This repo also maintains a dynamic Cordis plugin (toksta-5, deployed in-session via cordis_define, handy for iterating without restarting the profile):

  1. Verify contracts with cordis_inspect_list / cordis_inspect_query (sessionQuery, session/event, session/created, harness, React/host/styles builtins, settings.section, timer, locale);
  2. cordis_define: plugin.kind: "new", idPrefix: "toksta", code.host = host.js, code.client = client.js;
  3. cordis_run (mode=run/update) to activate.

⚠️ The bundle and the dynamic plugin register the same settings section id (token-stats); don't run both at once — stop one before enabling the other.

📁 Files

FileDescription
lib/index.jsBundle host half: folder + backfill + live listeners + GET /api/token-stats (POST /api/token-stats/rescan as fallback)
lib/client.jsBundle client half: window.__ModuleLoader__.load factory, registers "Settings → Stats"
cordis.patch.ymlbundle patch: inserts the id: token-stats plugin row
package.jsonnpm package manifest (dsh.bundle / dsh.client)
host.js / client.jsDynamic-plugin host/client function bodies (paste into cordis_define)
plugin.jsonPlugin metadata & package history (pkg-9 … pkg-27)
plan.md / progress.mdDesign docs & progress log (incl. every bug/fix)
assets/dsh-token-usage-dashboard.pngDashboard screenshot

✅ Acceptance checklist

  • Settings → Stats: 5 equal-width cards, one-line values, aligned labels
  • 53-column heatmap, today at bottom-right, year-month-day hover tips; Daily/Weekly toggle works
  • Month axis aligned to columns; no horizontal scrollbar
  • Insights (7 rows) and Top-5 model ranking with bars correct
  • New conversations show up within 30s
  • Language switch (zh ↔ en) relabels the whole dashboard on the fly

🩺 Troubleshooting

SymptomCause / fix
pnpm not found on PATHdsh plugin needs pnpm: corepack enable pnpm (bundled with Node ≥16.10)
Two "Stats" sections in Settingsbundle + dynamic plugin (toksta-5) both active; stop one
Plain text, no styles at allCSS not injected: dynamic styles is a Client Builtin (styles.insert(css)), not ctx.get('styles'); bundle injects via <style>
Client render crash ctx is not definedctx only exists in apply(ctx); components use the module-level timer bridge (intervalRef = (cb, ms) => ctx.interval(...))
service "timer" is not declaredclient has no timer Service; drop inject: ['timer']
Horizontal scrollbar flashes under the heatmapold month-label nowrap text inflated scrollable overflow; container & month row are overflow:hidden now
console.warn throwsHost builtins only expose console.log/error; use console.error

📐 Known boundaries

  • Only calls whose adapter reports usage are counted (skipped when assistant/message.usage is absent);
  • Model attribution: assistant/message has no model field — usage is attributed to the session's latest request/header provider/model;
  • Current streak counts to yesterday when today has no usage; interrupted (unclosed) turns add no duration;
  • Title-generation calls (session/title-llm-request) are not counted.

🌐 Ecosystem

  • ✅ Listed in dsh-plugin-marketplace: scanner-verified (verified, one-click install pinned to github:solstice621/dsh-token-usage-dashboard#<commit>, auto-refreshed every 2h);
  • 🚀 awesome-deepseek-harness listing PR: #225 docs: add dsh-token-usage-dashboard (UI & Experience, bilingual entry).

📄 License

MIT