DeepSeek Harness plugin

dsh-usage-stats-triple3h

DeepSeek Harness Web 插件:侧边栏「使用统计」按钮 + zcode 风格用量页(按天/按模型的 tokens、会话、消息、活跃热力图)。

Jump to install

Source facts

Repository
Triple3h/dsh-usage-stats
Latest update
Aug 19, 2026
Category
Memory
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Triple3h/dsh-usage-stats
Plugin: dsh-usage-stats-triple3h
Author: Triple3h

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-usage-stats

DeepSeek Harness Web 插件:在侧边栏设置行上方加一个「使用统计」按钮, 点击铺开一整页 zcode 风格的用量统计面板。

面板内容

  • 时间范围切换:最近 7 天 / 最近 30 天
  • 六张指标卡:tokens 用量、会话数量、消息数量、活跃天数、当前连续天数、最常用模型(含占比)
  • 活跃热力图:30 个整周、按非零分位数分 5 档
  • 按天 Token 趋势:按模型堆叠柱(前六模型 + 其他)+ 图例
  • 模型用量:环形图 + 明细列表(占比、tokens)
  • 右下「刷新」;Esc / 右上 × 关闭

数字读法同 zcode 页:10.1亿 / 6178.2万

结构

文件职责
hostlib/index.jssessionPersistence 缝,扫会话日志折叠成按天/按模型汇总(内存索引,启动全量+60s 增量);回环只读接口 GET /api/usage-stats/usage?days=N
clientsrc/client.jslib/client.jssidebar.footer.action 槽注册按钮;react-dom portal 铺整页;手写 SVG/DOM 图表,无第三方依赖

事件解析语义与 TokenLedger 一致(usage chunk 与 assistant/message 双收、同 (turn,step) 样本替换、消息数挂事件),但不做中转站归因,只按模型维度聚合。

开发

npm install
npm run build        # esbuild 语法校验 src/client.js → lib/client.js
npm test             # node test/smoke.mjs 两半核心契约冒烟
npm run link-profile # 接入 ~/.dsh/profiles/web,然后手动重启 dsh web

验证

重启 dsh web 后:侧边栏设置上方出现「使用统计」行;DevTools console 有 [usage-stats] bundle script executing / factory materializing 两行。 面板 404/报错时先看 host 日志有没有 usage-stats: serving /api/usage-stats/usage