DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

Plugin Token Usage — DeepSeek Harness 插件(DSH Plugin)
← Plugins
P

dsh-plugin-token-usage

Plugin Token Usage

用于 QwenPaw 风格跨会话令牌使用统计的 DSH 插件(/usage 命令 + Web GUI 面板)

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

npx -y @deepseek-ai/dsh plugin --profile web add github:lovedheart/dsh-plugin-token-usage#3b7d121d7ffc908355acfe1ca167547535ac1f55
README兼容性版本

兼容性与来源证明

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

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

版本

0.2.0stable
2026/8/20

相关插件

正在加载相关插件…

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

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

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

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

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

相关插件

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

Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编码计划配额,并提供实时令牌使用记录,同时在侧边栏条目中显示当前会话提供商今日的使用量Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Usage Stats@ychris12138/dsh-usage-statsdsh Web GUI 的令牌使用热力图、提供商余额和订阅配额Codex Connectdsh-codex-connect用于 DeepSeek Harness 的 ChatGPT OAuth 和 Codex 模型。

README

dsh-plugin-token-usage

QwenPaw-style cross-session token usage statistics for DSH.

The plugin aggregates the provider-reported token usage of every model call across all persisted sessions (including subagent sessions) into (date, provider, model) buckets and serves them through a single /usage command.

  • Zero runtime dependencies — only the Cordis ctx API and Node 22's built-in node:zlib (zstd) are used.
  • Durable source of truth — it reads the session logs under ~/.dsh/sessions, so it works on history that predates the plugin and needs no separate bookkeeping at write time.
  • No double counting — a committed assistant/message.usage wins; a step that never produced a message (failure) falls back to its last streaming usage chunk, flushed at turn/end. A persisted per-file watermark ({hiSeq, framesIngested}) makes the incremental scan idempotent across restarts and crash-recovery re-encodes.

Command

/usage                 # last 30 days (configurable defaultDays)
/usage 7d              # last 7 days
/usage 7d qwen3.8      # last 7 days, model filter (substring on provider/model)
/usage qwen3.6         # default range, model filter

Example output:

📊 Token Usage  2026-07-17 → 2026-08-16

Total: 906.9M tokens · 4954 calls
  input 473.3M · output 3.4M · cache read 430.1M

By model:
  sglang/Qwen3.8-27B  —  719.4M tokens · 3320 calls
      in 337.7M · out 2.8M · cacheR 378.9M
  sglang/Qwen3.6-27B  —  187.4M tokens · 1634 calls
      in 135.6M · out 669900 · cacheR 51.2M

By day:
  2026-08-13  42.6M tokens · 481 calls
  2026-08-14  195.7M tokens · 1587 calls
  2026-08-15  380.5M tokens · 1513 calls
  2026-08-16  288.1M tokens · 1373 calls

Token units: 1.2M for >= 1,000,000 (million), 1.5B for >= 1,000,000,000 (billion), plain integer below (one decimal, trailing .0 dropped).

Config

keydefaultdescription
defaultDays30lookback window for a bare /usage.
backfillIntervalSec30seconds between incremental backfill passes (keeps the state file warm).
sessionsRoot~/.dsh/sessionsDSH session-log root (empty = auto from DSH_HOME).
stateFile~/.dsh/token-usage.jsonaggregated state + watermark.
flushDelayMs5000debounce for the state write.
enableCommandtrueregister /usage.
verbosefalselog backfill progress.

Mounting

The plugin is an out-of-tree module mounted through a profile patch (same pattern as the telegram / thinking-mode plugins). Add an insert row to ~/.dsh/profiles/web/cordis.patch.yml:

- insert:
    - id: token-usage
      name: '/home/lovedheart/Documents/dsh-plugin-token-usage/lib/index.js'
      config:
        defaultDays: 30
        backfillIntervalSec: 30
        enableCommand: true
        verbose: true

commands is an optional dependency (consumed via an optional child fiber), so the plugin also loads in command-less assemblies — it just stores without registering the interactive command.

Layout

  • src/frames.js — zstd frame scanner (mirrors DSH's scanZstdFrames).
  • src/store.js — bucket aggregation, dedup, persistence, summarize.
  • src/backfill.js — incremental session-log walk + listSessionFiles.
  • src/render.js — fmtTokens, renderUsageReport, parseUsageArgs.
  • src/index.js — plugin entry (name/inject/Config/apply).
  • lib/ — build output (npm run prepare copies src/*.js).
  • test/ — node --test unit + harness tests.

Development

npm install        # installs the cordis peer for the harness test
npm test           # node --test test/*.test.mjs
npm run prepare    # sync lib/ from src/