DeepSeek Harness plugin

dsh_token_usage

Local 30-day token usage heatmap for DeepSeek Harness: sidebar action above Settings, popup from session JSONL.

Jump to install

Source facts

Repository
xbyzzZ/dsh_token_usage
Latest update
Aug 20, 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/xbyzzZ/dsh_token_usage
Plugin: dsh_token_usage
Author: xbyzzZ

Check the source files

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

File explorer3 files
README.mdSource · read only

dsh-token-usage

面向 DeepSeek Harness 的本地用量看板插件。

它只读 $DSH_HOME/sessions(默认 ~/.dsh/sessions)里的 session.jsonl.zstd,按最近 30 天汇总 provider 回报的 token usage,并在 Web 侧栏 设置上方 放一个入口。点击后打开用量弹窗:热力图 + 按模型表。

这是独立 bundle 插件,不改 DSH 源码,不替换整条侧栏,不引入 SQLite。

官方插件规范:

界面

![用量弹窗:30 天热力图和按模型统计](image/Snipaste_2026-08-20_11-27-54.png)

  • 入口:sidebar.footer.action,在设置按钮上方
  • 弹窗:最近 30 天热力图、新产生 / 有用量的天 / 会话
  • 热力图:浅色白到蓝,暗色黑到蓝;没有用量为白 / 黑
  • 模型表:provider + 模型名、步数、输入、输出、缓存读、缓存写、推理
  • 空数据:还没有带 usage 的会话
  • 失败:读不了本地 JSONL,可再扫一次

数字口径

只统计会话日志里的 assistant/message.usage(同 turn/step 后写覆盖前写)。

  • 新产生 = inputTokens + outputTokens + cacheWriteTokens
  • 缓存读、推理单独列表,不并进热力图主数字
  • 没有 usage 的旧会话不按字数估算

安装

进入这个插件目录后执行:

dsh plugin --profile web add .

也可以传绝对路径:

dsh plugin --profile web add /path/to/dsh_dashbord

这会:

1. 在 $DSH_HOME/profiles/web 用 pnpm 装上 dsh-token-usage 2. 把它追加进 package.jsondsh.profile.bundles

装完重启 DSH。左下角设置上方会出现「用量」。

如果 dsh plugin addpnpm v11.12.0 is a broken release,那是 profile 的 packageManager 钉死了坏版本,把 $DSH_HOME/profiles/web/package.json 里的 pin 改成 pnpm@11.22.0(或更新的可用版本)后再跑同一条命令。这和插件包无关。

插件自带 cordis.patch.yml。若要覆盖配置,记得 整段重写 config

- insert:
    - id: dsh-token-usage
      name: dsh-token-usage
      config:
        days: 30
        maxFiles: 4000
        maxFileBytes: 33554432

开发

node --test test/*.test.js

Host 在没有 connection 的 headless profile 里不会注册 RPC;Web profile 会通过 /token-usagesummary 接口取数。