DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

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

@local/token-breakdown-stats

Token Breakdown Stats

会话令牌使用量汇总子代理:替换 composer-dock 的统计胶囊,使底部总量涵盖主代理及其调用的所有子代理;点击打开的对话框会按用量分类、子代理和模型明细列出使用情况。

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

npx -y @deepseek-ai/dsh plugin --profile web add github:Minggle/dsh-token-breakdown-stats#d30a54cb2f914d2d996974199f5731922f8609a4
README兼容性版本

兼容性与来源证明

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

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

版本

1.0.0stable
2026/10/15

相关插件

正在加载相关插件…

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

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Client Ui Model Capabilities@linxin666/dsh-client-ui-model-capabilities为自定义 pi-ai 提供商声明每个模型的能力(图像输入和推理力度),可直接在 Models 设置卡片中编辑;写入官方 llm-pi-ai 设置命名空间,不更改 DSH 源代码。Cost Meterdsh-cost-meterDeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(13 家,含 OpenDesign 工作区查询、含小米 MiMo Token Plan 控制台 Cookie 查询、SCNet Token Plan 本地 Credits 计量与火山方舟 Volcano Ark Coding Plan AK/SK 签名查询)、自定义 Provider

README

dsh-token-breakdown-stats

English | 中文

A dsh plugin (dsh-plugin topic) that replaces the composer-dock statistics pill so a session's token total covers the main agent plus every subagent it called, with a click-open breakdown by billing bucket, by subagent, and by model.

Summary

The composer-dock statistics pill in a dsh session reports only the main agent's token usage. When that agent delegates to subagents, every token the subagents spend is invisible in the session footer.

This plugin replaces that pill so the footer reports the session total — main agent plus every subagent it called — and its click-open dialog itemizes the usage by billing bucket, by subagent, and by model.

What changes

shipped pillthis plugin
Pill labelmain-agent total + cache hitsession total (main + subagents) + cache hit + subagent count
Dialogfour billing bucketsbuckets, main/subagent split, subagent aggregate, per-model rows
Time/activity pillturns, steps, speed, timingsunchanged (reproduced)

Subagents are reported as an aggregate everywhere: the pill shows how many there were, and the dialog folds them into one block (count, how many are still running, share of the session, and the summed buckets). No per-subagent rows — a session can spawn dozens, and the per-child detail already lives in the subagent catalog in the session header.

The dialog shows:

  • 总用量 — the four disjoint billing buckets (uncached input, cache read, cache write, output) plus cache hit, over the whole session tree.
  • 主 Agent — the provider/model routes observed in the loaded turns, and that session's own buckets.
  • 子 Agent(N) — one aggregate block: how many were discovered, how many are still running, their share of the session total, and the folded buckets.
  • 按模型 — per provider/model totals folded from the loaded turns.
  • A friendly note when the session has not called any subagent yet.

How it works

The plugin registers the same dock cell the shipped ui-chat row uses — conversation.composer.dock, id stats, order 0 — so it replaces the built-in pill rather than adding a second one. A list slot rejects a second registration that reuses an id at the same priority, so this row passes priority: -1, strictly below the shipped row's 0 (lowest renders).

Every figure rides durable projections, so paging and compaction cannot change them:

  • tokenUsage — the four disjoint provider billing buckets per session.
  • subagentCatalog — direct children of a session, in parent event order, with mode and optional label.
  • SessionSummary.projectionValues — the same projections plus the subagent identity (label) and timing, addressed by session id.
  • ChatSnapshot.nodes.values() — the keyed store of every materialized Chat Node. turn-tail rows deliberately make no contribution to legacy.nodes, so this is the only place the per-turn routes (provider/model) can be read from; the legacy slice still feeds the step-count fold.

The compact / detailed preference is read from the same ui-chat config scope the shipped pill uses; compact keeps the plain speed and cache-hit readings without dialogs.

Known limitations

  • Per-subagent model attribution is unavailable. The client-side tokenUsage projection carries only the four buckets — no route — so a subagent's row shows its total, not its model. Model attribution covers the main session's loaded turns.
  • Descendants are a best-effort walk. subagentCatalog is the direct children of a session; grandchildren appear only once their own catalog has been loaded (the same rule the shipped subagent catalog follows). Nothing is invented for unloaded levels.
  • Model attribution covers loaded turns. turn-tail rows exist only for closed turns inside the loaded window, so on a long, paged session the model row and the by-model section can lag the durable totals. In this version the chat target's assistant nodes carry no providerMetadata, so there is no second source to fall back on — the row shows the session's models only once at least one closed turn is loaded.
  • Compact mode keeps the shipped behavior (speed and cache hit only).

Install

The bundle is a plain directory — no build step is required, because client.js is committed. Install it into a profile from a local clone:

git clone https://github.com/Minggle/dsh-token-breakdown-stats.git

Then, in a dsh session, install the bundle with plugin_manager:

plugin_manager  action: install_bundle
               target: <absolute path to the cloned directory>

The inserted row id is token-breakdown-stats. Restart the app (or let the live patch reload apply it) and the pill in the composer dock is replaced.

To rebuild client.js from src/ after editing the sources:

node build.mjs

Verify

node src/smoke.test.cjs

The smoke test loads the built client.js through a mocked window.__ModuleLoader__ and a minimal React runtime, then asserts the rollup math, the pill label, the dialog sections, Escape dismissal, compact mode, and locale parity.

Files

  • index.js — Host half (no Host row is needed).
  • client.js — generated browser artifact (do not edit).
  • src/entry.js — slot registration and mode hook.
  • src/stats-pills.js — the two pills and the breakdown dialog.
  • src/token-aggregator.cjs — pure aggregation and route folding.
  • src/smoke.test.cjs — Node smoke test.
  • locale/{en,zh}.json — dictionaries (single source of truth).
  • icon.svg — original artwork.
  • build.mjs — inlines src/ into client.js.

Requirements

  • DeepSeek Harness >= 0.2.0-rc.2 (the plugin reads ChatSnapshot.nodes, SessionSummary.projectionValues, and the conversation.composer.dock slot's list-cell priority rule).
  • A desktop or web profile; the Web GUI renders the pill.

Install incident (2026-10-15)

An early build of this plugin made the desktop app fail web boot with 1 entry did not activate: @deepseek-ai/dsh-client-ui-chat: failed. The bundle was removed and the profile restored from the backup the app itself wrote (cordis.patch.yml.bak-*), so no user data was lost.

The root causes are recorded here because both are easy to reintroduce:

  1. A list slot rejects a same-id, same-priority registration. The shipped ui-chat row occupies conversation.composer.dock id stats at priority 0; a replacement must pass a strictly lower priority (this plugin uses -1). The slot's register throws already has an entry with id "stats" at priority 0 … register at a different priority to shadow it (lowest renders), and because the plugin's inject callback runs inside the dock owner's fiber, the failure is reported against that owner rather than the plugin.
  2. A restricted Client context throws on an undeclared service. Reading ctx.configForms without declaring configForms in the entry's inject raises cannot get property "configForms" without inject. The plugin now declares only ['slots', 'locale'] and reads everything else defensively.

Two smoke-test mocks reproduce both failure modes so a regression fails the test instead of a boot: the context throws on undeclared service access, and the slot service rejects a duplicate cell at the same priority.

License

MIT