DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

@zoytown/dsh-token

Token

用于统计整台机器 Token 使用情况的 DeepSeek Harness (dsh) 插件——提供包含总量、贡献热力图、连续使用天数和按模型细分的设置页面。读取每个 dsh 主目录中的会话日志;不估算费用。

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

npx -y @deepseek-ai/dsh plugin --profile web add @zoytown/dsh-token@0.1.3
README兼容性版本

兼容性与来源证明

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

DSH 兼容范围
*
运行环境
web
发布来源
npm
Registry 更新时间
2026/9/21

版本

0.1.3stable
2026/8/17
0.1.2stable
2026/8/17
0.1.1stable
2026/8/17
查看其余 1 个版本收起版本
0.1.0stable
2026/8/17

相关插件

正在加载相关插件…

最新版
0.1.3
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
156 kB
文件数
24
Surface
web
许可证
MIT
发布源
npm
GitHub
★ 1
周下载
84
最近提交
2026/8/18
查看源码 ↗项目主页 ↗
README Badge

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

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

README

@zoytown/dsh-token

English | 中文

@zoytown/dsh-token is a DeepSeek Harness (dsh) plugin that reports your token usage across the whole machine. It folds the session logs of every dsh home — ~/.dsh and each ~/.dsh_desktop/<version> — into a Token page in Settings: headline totals, a GitHub-style contribution heatmap, current and longest streaks, peak hour, and a per-model breakdown of the four disjoint token buckets. It registers no model-facing tool and appends no session event, so mounting it costs the conversation nothing.

The DeepSeek Harness Settings dialog showing the Token page: an Overview / Models switch with All / 30d / 7d range buttons, stat cards reading 2 sessions, 17 messages, 499K total tokens including cache reads, 2 active days, a 2-day current and longest streak, a 0:00 peak hour and deepseek-v4-pro as the most-used model, above a GitHub-style contribution heatmap spanning 2025-08-17 to 2026-08-22

What it shows

  • Sessions, Messages, Total tokens, Active days, current and longest streak, peak hour, and your most-used model
  • A contribution heatmap of the last 53 weeks, or a day strip when a 7-day / 30-day window is selected
  • A Models view splitting each model's usage into input / cache read / cache write / output

Everything is local and read-only: the plugin never writes to a session, never contacts a network service, and answers loopback callers only — the payload lists working directories, which is effectively a list of your projects.

What it deliberately does not show

Cost. The harness stores no price table — @deepseek-ai/dsh-llm-pi-ai hardcodes NO_COST and its own comment states the harness never reads a provider's cost metadata. Any currency figure here would be a local guess dressed up as a fact. Account balance is a separate concern, covered by @zoytown/dsh-billing.

Install

dsh plugin --profile web add @zoytown/dsh-token

Requires Node ^22.19 || >=24 and pnpm on PATH (dsh plugin is a thin pnpm forwarder). Then open Settings → Token.

No global dsh on your PATH? Either form works:

npx -y @deepseek-ai/dsh plugin --profile web add @zoytown/dsh-token   # published CLI
pnpm dsh plugin --profile web add @zoytown/dsh-token                  # from a harness checkout

Pick one and stay with it — both CLIs re-point the <DSH_HOME>/profiles/node_modules symlink farm at their own installation on every boot.

To remove it:

dsh plugin --profile web remove @zoytown/dsh-token

Desktop shells are not supported

This plugin targets dsh web. An Electron shell wrapping the harness may pin bare module resolution to its own bundle, which makes a profile-installed plugin unresolvable — and the plugin tree then fails to load outright rather than degrading, so the app will not start. Do not install this plugin into such a shell's DSH_HOME. You do not need one anyway: sessions recorded under ~/.dsh_desktop/<version>/ are read from dsh web all the same.

Configuration

Set on the dsh-token row in the profile's cordis.patch.yml:

KeyDefaultMeaning
extraSessionRoots[]Extra dsh home directories to scan. Discovery covers ~/.dsh and ~/.dsh_desktop/<version>; a home reached through a $DSH_HOME that is not currently set needs listing here.
includeCompactiontrueCount tokens spent generating compaction summaries — real spend the harness's own tokenUsage projection cannot see. Set false to reconcile 1:1 with it.
refreshIntervalMs30000How often to re-scan for appended sessions.
indexChunkYieldMs16Cooperative yield interval during a scan.

How the numbers are defined

The rules matter more than the code, so they are stated plainly:

  • Total tokens includes cache reads. The four provider buckets are disjoint, so their sum is the real throughput. The Models view splits them, because a total dominated by cache reads should be visible as such.
  • Sessions excludes subagent sessions, but their tokens are counted. A delegated session is not one you opened; its count appears as a subtitle.
  • Messages means human plus non-empty assistant messages — not log records. One step emits hundreds of streaming delta events, so a record count would be two to three orders of magnitude off.
  • A usage report arrives twice per step — once while streaming, once on the final message. Samples are keyed by (turn, step) and replaced, never accumulated, matching the harness's own projection.
  • Days and hours use your local calendar, computed with Intl rather than UTC millisecond arithmetic, and streaks are measured between noon anchors so a daylight-saving transition cannot break one.
  • Retried steps under-count. When a provider request is retried inside a step the log keeps only the final usage report; the failed attempt was billed but its numbers are gone.

Metering coverage, retried steps, sessions still being written, and skipped logs are all disclosed in the page footer rather than silently absorbed.

How it works

A full scan is not viable on the read path: folding ~1,200 sessions / ~319 MB of compressed logs takes about 4 s, and the cost is frame-bound rather than byte-bound, so a faster decompressor does not fix it. So the host half folds once in the background and afterwards reads only the bytes appended since, keyed on (dev, ino, size, mtime). The browser half never sees a log byte — it renders a view model fetched from one loopback JSON route.

Session logs are a container of concatenated, independently decodable zstd frames, which is both why Node's stock zstd APIs cannot read them (they stop at the first frame) and why resuming from a stored byte cursor is sound.

See DESIGN.md for the full architecture and the upstream evidence behind every counting rule.

Development

npm install
npm run typecheck
npm run test
npm run build
npm run test        # re-run: the built-bundle contract test only runs after a build

See AGENTS.md for the working rules.

License

MIT