pythonshiyi/dsh-plugin-tokenmeter ↗★ 1
dsh-plugin-tokenmeter
词元消耗显示:DeepSeek Harness 网页端每条助手回复的实时词元用量(输入/输出/缓存/会话累计)| Per-message token usage chips for DeepSeek Harness web UI (input/output/cache/session total)
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-plugin-tokenmeter
English | 中文
DeepSeek Harness 网页端词元消耗显示插件 —— 在每条已完成的助手回复下方,实时显示本轮消耗的输入/输出词元、缓存命中率与会话累计。
功能特性
-
每条**已完成的助手轮次(turn)**底部显示词元消耗徽标:
↑1.2k ↓3.4k ·缓存62% 累计 12.3k -
↑ 输入 / ↓ 输出:整轮所有步骤(含工具调用步骤——每步都会重发完整上下文并单独计费)的计费合计
-
缓存命中率:缓存读取 ÷ 计费输入,缓存命中越高成本越低
-
会话累计:来自 Harness 的
tokenUsage投影——基于整个持久化日志、随事件实时更新、不重复计数 -
悬停明细:缓存读取/写入、思考词元(输出的子集,不重复累加)、步骤数
-
纯客户端实现:数据直接来自会话快照,无 Host 往返,消息完成即动态出现/更新
-
样式使用主题变量,自动适配明暗主题
环境要求
- DeepSeek Harness web 版(
dsh --profile web) - 标准 web 插件列表(会话/对话 UI)
安装
方式一:npm(发布后可用)
cd ~/.dsh/profiles
npm install dsh-plugin-tokenmeter
方式二:本地目录或 Git 仓库
cd ~/.dsh/profiles
npm install /path/to/dsh-plugin-tokenmeter
# 或:npm install https://github.com/pythonshiyi/dsh-plugin-tokenmeter
然后注册到你的 profile 补丁,例如 ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: plugin-tokenmeter
name: 'dsh-plugin-tokenmeter'
重启应用(dsh --profile web)并刷新页面即可生效。
卸载
从 cordis.patch.yml 删除该行,或直接禁用:
- id: plugin-tokenmeter
name: 'dsh-plugin-tokenmeter'
disabled: true
重启并刷新。
工作原理
| 环节 | 说明 |
|---|---|
| 槽位 | conversation.chat.assistant-actions(增量列表槽,,) |