返回插件市场

dsh-token-usage

监控与用量

hashdiana/dsh-token-usage

用更清晰的芯片栏和显示完整明细的详情面板替换默认的令牌使用量栏。

  • deepseek
  • deepseek-ai
  • deepseek-chat
  • deepseek-harness
  • deepseek-v4
  • deepseek-v4-pro
  • dsh-plugin
  • dsh-plugins
GitHub Stars
2GitHub
浏览量
3DSH Plugin Hub
Forks
0GitHub
开放问题
0GitHub Issues
Manifest 版本
0.1.0dsh-token-usage
最近推送
2026年8月17日GitHub
许可证
MITTypeScript
插件类型
Host + Client同时运行于 Host 与 Web Client

验证与兼容性

这里展示目录实际采集到的证据;未声明的信息会明确标为未知。

静态检查通过
01精确来源: github · dsh-token-usage@0.1.002验证时间: 2026年8月24日03验证版本: 0.1.0-rc.7
当前版本兼容性
已在当前目录版本验证
声明的 Harness 范围
未声明
声明的平台
未声明
适用 Profile
web
构建授权
未知
权限声明
未声明
外部服务
未声明
遥测声明
未知
未发现已知风险标记

这不是安全背书;安装前仍应查看源码、权限和配置。

查看证据与判定范围

验证仅覆盖标出的来源、版本和 Harness 环境,不代表未来版本仍然兼容。

  • github:hashdiana/dsh-token-usage#4c6262830a5420012d6dc793ee46067b86904780
  • 插件通过清单与静态结构检查,尚未完成运行时加载检查。

README

查看源文件

dsh-token-usage

A clearer, prettier token-usage bar for the DeepSeek Harness web UI.

GitHub stars License: MIT DSH Plugin

🌐 中文 · English

The shipped DeepSeek Harness web UI squeezes token usage into one cramped line of text under the composer. dsh-token-usage replaces it with a glanceable chip bar plus a details panel with the full breakdown — and it follows your theme, light or dark.

🎯 Token usage shouldn't have to be decoded — it should be readable at a glance.

Screenshots

Highlights

  • Context at a glance — a thin occupancy bar that turns green → amber → red as you fill the context window.
  • Input, output, and cache, separated — billed input splits into cache-read / cache-write / uncached, with the cache-hit rate shown up front.
  • Speed where you need it — decode throughput (tok/s) and average first-token latency (TTFT) right on the bar.
  • A details panel on click — context composition (system / tools / messages), a stacked input split, and session turn / step / model / tool time.
  • Natural edge fades — the panel's top and bottom edges fade and blur while there's more to scroll, and vanish at the ends.
  • Theme-adaptive and bilingual — styled only with --dsw-* tokens (light/dark), shipped in Chinese and English.

What it shows

The bar under the composer shows these chips, left to right:

ChipMeaning
ContextUsed / window tokens, with a color-coded occupancy bar
InputTotal billed input (cache read + cache write + uncached)
OutputProvider-reported output tokens
Hit rateCache-read share of billed input
tok/sDecode throughput over usage-reporting steps
TTFTAverage first-token latency

Clicking the bar opens a panel with context occupancy + composition, the input-split stack, throughput / TTFT, and session counts. The whole line hides itself when there is no data yet.

Install

From GitHub (recommended):

npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hashdiana/dsh-token-usage

From a local checkout:

npx -p @deepseek-ai/dsh dsh plugin --profile web add <path-to-this-repo>

Then restart the profile:

dsh web

The Git path ships the built lib/ (see Build & develop), so no build script runs at install time.

Uninstall / Disable

Temporarily disable without uninstalling — add to $DSH_HOME/profiles/web/cordis.patch.yml:

- id: dsh-token-usage
  disabled: true

Restart dsh web; the default stats line returns. Remove those lines to re-enable.

Build & develop

pnpm install
pnpm typecheck   # tsc -b
pnpm build       # tsc -b + tsdown → lib/index.js (host) + lib/client.js (browser)
pnpm test        # vitest: folds, locale parity, jsdom render, slot registration/dispose

The client bundle is emitted as window.__ModuleLoader__.load({ id, factory }); CSS Modules are hashed by lightningcss and injected as a <style data-plugin="dsh-token-usage"> tag. Commit lib/ — Git installs consume the built output, not src/.

How it works

  • Pure client plugin — the host half is an empty apply(); the browser half ships via exports["./client"].
  • Slot — registers into conversation.composer.dock (cell id: "stats", priority: -1), shadowing the shipped text line; the registration is withdrawn with the plugin fiber.
  • Data — reads the durable projections tokenUsage, contextPressure, contextBreakdown, and sessionStats; a window fold serves only as the no-projection fallback.
  • Locale — owns the tokenUsage namespace, Chinese and English.

License

MIT

评论

0
最新优先