dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
在底部 Dock 添加模型思考 token 统计信息的轻量化插件。
English | 中文
A lightweight thinking/reasoning token statistics plugin for DeepSeek Harness (DSH). Displays whole-session thinking token totals and ratios right in the composer dock, with official frosted-glass detail popovers and turn-by-turn model breakdowns.


Always visible in the status line below the message input box:
💭 37.2K · 70.7% · 4 / 6 turns
Clicking the dock readout opens the overview panel, fully styled according to DSH official popover design and frosted-glass vibrancy:
? explaining the formula.Click "Detailed turn statistics" in the overview to open the per-turn table (newest turns first):
~ and highlighted in business accent).deepseek-official/deepseek-reasoner), tracking retries and model switches accurately.Not all model providers report reasoning tokens via API usage metadata. To ensure accurate and meaningful statistics in every environment, the plugin employs a transparent hybrid strategy:
| Provider Response | Method | Display |
|---|---|---|
| Reports reasoning tokens | Uses exact provider count | Stated exactly; marked as Reported |
| Provides reasoning text only | Multi-script density estimation | Prefixed with ~ (e.g. ~5.1K); marked as Estimated |
| Provides neither | Counted as non-thinking | Collapsed by default in the turn list |
Estimating tokens using a flat 4 characters/token English heuristic undercounts dense scripts by 2–4×. This plugin segments text by script family:
| Script | Characters / Token | Rationale |
|---|---|---|
| CJK (Chinese, Japanese kana, Korean Hangul, fullwidth) | 1 | Measured tokenizers range ~0.6–1.7 tokens/char (DeepSeek/Qwen tokenizers sit at 0.6–0.8). 1 char/token is conservative and avoids overestimating. |
| Cyrillic, Greek, Arabic, Hebrew, Indic, Thai, etc. | 2.5 | Typically measured at 2–3 characters per token. |
| Latin, digits, punctuation, whitespace | 4 | Standard empirical benchmark for English and Western prose. |
All estimated numbers are explicitly prefixed with ~ and never misrepresented as exact provider telemetry.
assistant/message settlements.<root>/session_projcache/sessions/<id>.json), requiring only a few KB per session.useProjection("thinkingStats"). No message parsing, no background API requests, and no localStorage caching.stat-dialog.module.css specs, incorporating var(--dsw-menu-backdrop-filter) (40px blur) and var(--dsw-radius-lg) corner radius.Open the Market in DSH Desktop or Web GUI, search for dsh-thinking-token-stat, and click Install.
Run in your terminal:
dsh plugin add dsh-thinking-token-stat
Or install the latest development branch from GitHub:
dsh plugin add github:Six6stRINgs/dsh-thinking-token-stat
After installation, refresh your browser or desktop window (Ctrl+R). The indicator appears automatically once the model begins thinking.
The plugin consists of two self-contained modules:
lib/index.js: Host half; registers the thinkingStats session projection and fold logic.lib/client.js: Client half; injects the readout, popover, and table into the composer dock slot.Run tests:
npm test
(Executes test/projection.mjs for host fold semantics and test/harness.mjs for client UI rendering and degradation paths).