DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

Token Stats — DeepSeek Harness 插件(DSH Plugin)
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins
T

dsh-token-stats

Token Stats

DSH 插件:按模型/日期/会话统计 token 使用量和成本,支持历史回填以及 CSV/JSON 导出

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

npx -y @deepseek-ai/dsh plugin --profile web add github:1841220388zzzcccxxx-star/dsh-token-stats#9ce80889dc7bd3abc528ceec6eba34201c4a75c3
README兼容性版本
Token Stats dashboard

兼容性与来源证明

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

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

版本

1.0.0stable
2026/8/22

相关插件

正在加载相关插件…

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

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Usage Stats@ychris12138/dsh-usage-statsdsh Web GUI 的令牌使用热力图、提供商余额和订阅配额Codex Connectdsh-codex-connect用于 DeepSeek Harness 的 ChatGPT OAuth 和 Codex 模型。Ui Usage Billing@kenz1117/dsh-ui-usage-billingDeepSeek Harness 的用量计费仪表板:侧边栏成本指标和完整的仪表板模态窗口,依据当前多提供商目录定价,并汇总会话日志中的实际用量。Codex Subscriptiondsh-codex-subscription通过 OAuth 在 DeepSeek Harness 中使用 ChatGPT 和 Codex 订阅,支持配额管理、安全重置、网页搜索、图像和快速模式

README

dsh-token-stats

Token usage & cost statistics plugin for DeepSeek Harness (DSH).

Tracks token consumption per model, per date, and per session with cost estimation in USD / CNY, served as a native page under Settings → 📊 Token Stats. Installed as an external DSH plugin, it loads automatically at DSH startup — no manual activation needed.

中文说明

Features

  • 📊 Native settings page (dark/light aware, follows DSH theme tokens, i18n zh/en)
  • 📈 Daily / weekly / monthly trends with an SVG line chart (zero dependencies)
  • 💰 Cost estimation (USD & CNY) from a built-in pricing table for DeepSeek, GPT, Claude, Gemini, Qwen…
  • 🔁 History backfill: scans all persisted session logs at startup, so stats survive restarts
  • ⚡ Fast: batched session-title reads with an in-memory cache (TTL 5 min), single-pass summaries, memoized pricing
  • 📤 CSV / JSON export, filterable by model and session

Screenshot

Token Stats dashboard

Installation

The plugin is installed as an external DSH profile dependency.

  1. Clone / copy this repository to a local folder, e.g. D:\dev\dsh-token-stats

  2. In your DSH profile manifest (~/.dsh/profiles/web/package.json):

    {
      "dependencies": {
        "dsh-token-stats": "file:D:/dev/dsh-token-stats"
      },
      "dsh": {
        "profile": {
          "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-token-stats"]
        }
      }
    }
    
  3. cd ~/.dsh/profiles/web && pnpm install

  4. Restart DSH web. Open Settings → 📊 Token Stats.

cordis.patch.yml declares the bundle-layer mount point so the plugin auto-loads at startup.

How it works

  • Authoritative data = DSH persisted session logs: assistant/message events carry real usage (input / output / cache-read / cache-write / reasoning tokens), request/header events carry provider/model.
  • A one-shot backfill at startup (sessionQuery) rebuilds the in-memory aggregation index from all history (bounded concurrency).
  • llm/stream usage chunks are captured for live (display-only) in-flight totals.
  • When an adapter reports no usage, tokenMeter.estimateMessage is used and the record is flagged estimated.

HTTP API (/token-stats/api)

opdescription
summarytoday / week / month / total aggregates
querytime series (day/week/month) + per-model / per-session aggregates; filters: model, sessionId, from, to
modelsbuilt-in pricing table (USD per 1M tokens) + USD→CNY rate
sessionssession list (id + title)
exportCSV / JSON dump (format=csv|json, optional model / sessionId)

Development

node --check index.js      # server half
node --check client.js     # browser half
node test-plugin.js        # standalone mock tests: correctness + performance benchmarks
.\sync-deploy.ps1          # re-sync sources into the DSH profile (then restart DSH web)

Performance

Measured on the author's machine (14 sessions / ~10k records):

endpointbeforeafter
sessions~1700 ms (N serial readTitle calls)~12 ms (one batched readTitleSnapshots + cache)
summary~110 ms (4× full-array filters)<1 ms (single pass)
query~10 ms~18 ms at 10k records (memoized cost)

License

MIT © 2026 quansheng