DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

Token Usage — DeepSeek Harness 插件(DSH Plugin)
← Plugins

@kelearns/dsh-token-usage

Token Usage

dsh Web GUI 的令牌使用热力图。通过 DSH 的公共持久化服务读取会话历史记录,并通过官方插件机制挂载。

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

npx -y @deepseek-ai/dsh plugin --profile web add @kelearns/dsh-token-usage@0.2.0
README兼容性版本
Daily token usage heatmap, dark theme, EnglishWeekly viewCumulative view
Light theme, English
Dark theme, Chinese

兼容性与来源证明

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

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

版本

0.2.0stable
2026/9/30

相关插件

正在加载相关插件…

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

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

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

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

认领这个 Plugin →
报告问题
DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录

相关插件

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

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 Codex Subscriptiondsh-codex-subscription通过 OAuth 在 DeepSeek Harness 中使用 ChatGPT 和 Codex 订阅,支持配额管理、安全重置、网页搜索、图像和快速模式Commandcode Provider@mars-sea/dsh-commandcode-provider适用于 Command Code 的非官方 DeepSeek Harness LLM 提供商插件,移植自 pi-commandcode-provider(MIT)。注册“commandcode”提供商路由,并在 Models 页面添加卡片和实时模型目录。Connect Workbuddydsh-connect-workbuddy把本机登录的 WorkBuddy 模型接入 DeepSeek Harness,并提供只读的积分概览与模型管理。

README

English | 简体中文

@kelearns/dsh-token-usage

Token usage heatmap for the DeepSeek Harness (dsh) web GUI — a GitHub-style contribution graph for daily / weekly / cumulative token consumption, with a summary bubble, hover details, and activity insights. Mounted through the official dsh plugin mechanism (dsh plugin add) — no dsh source changes. Targets the DSH 0.2.0-rc.2 API surface.

A "Token Activity" entry appears in the settings sidebar.

Screenshots

Daily heatmap — dark theme, English (12-month window)

Daily token usage heatmap, dark theme, English

Three views — dark theme, English

DailyWeeklyCumulative
Daily viewWeekly viewCumulative view

Light theme & Chinese UI

Light (English)深色主题(简体中文)
Light theme, EnglishDark theme, Chinese

Features

  • Summary bubble — one rounded container with 5 statistics divided by vertical rules: total / peak-day / longest session / current streak / longest streak;
  • Three views — Daily (per-day color levels), Weekly (per-week stacked cells: week total ÷ (max week / 7) cells, deepest color), Cumulative (per-window cumulative staircase: first active week starts at 1 cell, earlier weeks stay blank, and each week's count rises by at most 1 up to 7; the latest week may remain below 7);
  • Window switch — last 3 / 6 / 12 months (default 12); fixed 12px cells, 12-month view scrolls horizontally and auto-scrolls to the latest week;
  • Hover details — hovering a cell shows that day's total, that week's total, or the cumulative total through that day (localized zh/en);
  • Activity insights — most used model / reasoning effort / tool, peak hour, averages per active day / month, most active weekday, most active day; activity rankings count recorded calls, not tokens; sorted by label length, two equal columns with a continuous center divider;
  • i18n — zh / en, registered through DSH's locale service;
  • Themes — light & dark palettes, follows the dsh application theme;
  • Auto refresh — the page refreshes every 60 seconds; the host checks session revisions every 5 minutes by default;
  • Storage independent — reads logical session events through DSH's public SessionPersistence service, not JSONL files;
  • Cross-platform — works wherever the DSH web GUI runs; no direct filesystem or compression access.

Install (official mechanism)

Requires pnpm on PATH:

npm install -g pnpm

From npm (recommended):

dsh plugin --profile web add @kelearns/dsh-token-usage

Listed in awesome-dsh-plugin curated registry; also searchable as token-usage in the Plugin Market tab of dsh settings (dsh-market).

Local development install (run from this repository's root — link:. resolves to the current directory):

dsh plugin --profile web add link:.

Remove:

dsh plugin --profile web remove @kelearns/dsh-token-usage

The installer reads cordis.patch.yml (the dsh.bundle.patch manifest field) and applies the plugin row automatically — no manual patch editing. Restart dsh web to activate.

Manual equivalent (no CLI)

  1. Put the package into the profile node_modules: $DSH_HOME/profiles/web/node_modules/@kelearns/dsh-token-usage;
  2. Append this block to $DSH_HOME/profiles/web/cordis.patch.yml (idempotent):
- insert:
    - id: dsh-token-usage
      name: '@kelearns/dsh-token-usage'
  1. Restart dsh web.

Data source

The plugin uses ctx.sessionPersistence.list() and read-only session handles. DSH selects and migrates the current logical session format before exposing events, so the plugin does not depend on filenames, compression, or the configured persistence backend.

Successful model calls contribute assistant/message.data.usage; failed or retried calls contribute the latest usage chunk in assistant/attempt.data.stream. Compaction model calls contribute compaction/summary.data.usage when present; released assistant/chunk usage events are also understood. Embedded stream timestamps are used when available, with the settlement event time as fallback. Total tokens are input + output + cache-read + cache-write tokens; DSH reports these four counts as disjoint fields, while reasoning tokens are an output subset. Insights also read request/header and tool/call; their averages use days and months with reported usage.

Per-session folds are cached by DSH's opaque persistence revision. A scan re-reads only changed sessions. To bound work, it scans at most the 20,000 most recently created sessions and reports when older sessions were omitted.

The cumulative heatmap maps weekly totals within the selected 3 / 6 / 12-month window to one shared staircase: the first active week's exact cumulative value is the 1-cell baseline and the latest week's value is the 7-cell target, with each week's increase limited to one cell. The latest week can therefore remain below 7. Hover details still show the exact all-history cumulative token total through the hovered date.

Routes (same-origin)

MethodPathDescription
GET/dsh-token-usage/statsFull statistics: { totals, stats, insights, today, days:[{d,i,o,c,w,a}], scan }
POST/dsh-token-usage/refreshForce cache invalidation and rescan
GET/dsh-token-usage/statusCache / last scan state

Configuration

- insert:
    - id: dsh-token-usage
      name: '@kelearns/dsh-token-usage'
      config:
        refreshIntervalMinutes: 5   # background rescan interval (default 5)

Tests

node test/mock.test.mjs                                   # synthetic full pipeline
node test/layout-algo.mjs                                  # layout algorithm matrix

Known limitations

  • Sessions with no reported usage contribute no token counts; unreadable sessions are counted in scan.errors;
  • Days are attributed in the host process's local timezone; weeks start on Monday;
  • DSH's SessionPersistence.list() is unpaginated; this plugin caps each scan at the 20,000 most recently created sessions and shows a warning when it does;
  • The plugin requires the sessionPersistence service to be mounted in the Web profile.

License

MIT