dshbase

插件目录 / Developer / dsh_hud_plugin

dsh_hud_plugin

未验证 lauytgary

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
语言
2026-08-23最近推送
跨平台平台

功能简介

DSH Head up display panel

我们的评价
未验证 — 尚未实测

DSH Head up display panel 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

English · 简体中文

dsh-stats-hud

A sci-fi HUD for DeepSeek Harness: the session's stats become game-style level bars in a vertical column fixed to the far right edge of the web UI — without touching the original stats line.

screenshot

Changelog

2026-08-24 — Peak / off-peak windows updated

  • CLOCK badge now follows the official DeepSeek API peak-valley pricing: peak = Mon–Fri Beijing 09:00-12:00 / 14:00-18:00 (i.e. Mon–Fri 01:00-04:00 / 06:00-10:00 UTC); weekends are always OFF-PEAK (previously weekends inside those windows were wrongly shown as PEAK).
  • Refactored the check into the pure isDsApiPeak(date) helper (weekday resolved on the Beijing calendar, so it is correct in any timezone) and exposed it via the test-only __test export.
  • Added 3 unit-test groups covering window edges, weekends and the Beijing/UTC day boundary (9 tests total, all green).
  • Docs synced (this README, README-CN.md and the Tuning section).

Instruments (all-English, LLM terminology)

Instrument Data Full scale Past full scale
CLOCK badge Local time (24h) + DS API PEAK / DS API OFF PEAK rate Peak = Mon–Fri Beijing 09:00-12:00 / 14:00-18:00 (i.e. Mon–Fri 01:00-04:00 / 06:00-10:00 UTC); weekends and all other hours are OFF-PEAK (half price) PEAK orange tint, OFF-PEAK green tint
STEPS / TURN rolling rows Steps / turns as odometer drums (like the CONTEXT rows) Drums spin up on mount, roll on change
LLM / TOOLS dual bar Two columns (labels over values), bar segments = raw LLM:TOOLS time ratio No cap — 2:1 time means 2:1 bar
THROUGHPUT gauge tokens/s (throughput), centered title, combined centered readout (146 tok/s) Redline auto-scales 200→300→400… (arc ticks follow)
CONTEXT USAGE bar Context-window usage % with 3 segments: Sys Prompt (gray) / Tools (blue) / Messages (purple) by token ratio 0-100% ≥80% whole bar turns solid red; hover shows the three token counts
CACHE HIT bar Cache-hit % 0-100% <50% red, <80% yellow, ≥80% green
CONTEXT rolling counter Three odometer rows: CACHE HIT (green) / CACHE MISSED (orange) / OUTPUT (pink) Drums spin up from 0 on mount; digits roll up on increase (carry 9→0), down on decrease

While the agent is running the whole panel breathes and bars pulse.

Hovering the CONTEXT USAGE bar pops up a tooltip with the token breakdown:

hover tooltip

Responsive layout

The HUD adapts to the free space right of the chat column (measured live with a ResizeObserver, so sidebar drags, the details drawer and window resizes all count):

Tier Condition Shows
full Window ≥ 800px and free space ≥ 180px Everything
mini Window ≥ 800px and free space < 180px Clock (short PEAK/OFF PEAK badge) + compact rolling rows (Step/Turn/HIT/MISS/OUT)
hidden Window < 800px Nothing (element stays mounted, display:none)

The window width is a hard floor: below 800px the panel hides even with room to spare, and only the measured space decides full vs mini (the full panel needs 164px + 12px margin). mini may slightly overlap the chat on narrow windows — safe because the panel is click-through. If the chat column can't be measured, the panel falls back to full.

The mini tier in a narrow window:

mini tier

Requirements

  • DeepSeek Harness dsh (tested on 0.1.0-rc.6, macOS)
  • pnpm (for plugin management)

Install

# from a local checkout
dsh plugin --profile web add /path/to/dsh-stats-hud

# or straight from GitHub
dsh plugin --profile web add https://github.com/lauytgary/dsh_hud_plugin

Then restart dsh web (loader entries are scanned at boot) and refresh the page. The package is installed as a link: dependency — after editing lib/client.js locally, only a restart is needed, no reinstall.

The plugin then shows up in Settings → Plugins:

dsh-stats-hud in the plugin list

Uninstall

dsh plugin --profile web remove dsh-stats-hud

How it works

  • Registers into the conversation.composer.dock slot (id dsh-stats-hud, order 1) — only to receive the session-scoped hooks (useSession/useProjection); the panel itself is position: fixed, takes no layout space, and the stock stats line stays untouched.
  • Data comes from the same projections the stock UI uses: useProjection("sessionStats"), useProjection("tokenUsage"), useProjection("contextPressure") and useProjection("contextBreakdown") — zero host-side changes.
  • exports.inject = ["slots"] is mandatory: DSH's ctx is a strict proxy, and accessing an undeclared service throws (cannot get property "locale" without inject).
  • The panel is pointer-events: none (click-through); only the CONTEXT USAGE bar re-enables pointer events so its hover tooltip works.

Files

dsh-stats-hud/
├── package.json          # dsh.bundle (patch layer) + dsh.client (browser entry)
├── cordis.patch.yml      # inserts the plugin into loader entries
├── lib/
│   ├── index.js          # host-side no-op (pure browser plugin)
│   └── client.js         # browser bundle: HUD components + slot registration
└── test/
    └── format.test.js    # pure-function unit tests (node:test, zero deps)

lib/client.js is a hand-written loader bundle (window.__ModuleLoader__.load) — no build step needed.

Development & testing

npm test   # pure-function unit tests (node:test, no dependencies; Node ≥ 18)

The tests load lib/client.js in a Node VM with a stubbed loader (no DOM
needed) and exercise the pure helpers — formatTokens, formatDuration,
formatTps, tierOf, billedInputTokens, cacheHitPercent. The test-only
__test export is gated behind the DSH_HUD_TEST env var, so the browser
bundle is unaffected.

Tuning

All constants live in lib/client.js:

  • Labels: the L object (all-English LLM terminology)
  • Peak hours: LocalClock delegates to isDsApiPeak(date), which checks the Beijing (UTC+8) weekday bjDow >= 1 && bjDow <= 5 (Mon-Fri) together with bjMin >= 540 && bjMin < 720 (9-12h) / >= 840 && < 1080 (14-18h), where bjMin/bjDow come from new Date(date.getTime() + 8*3600e3) — weekends are always off-peak
  • MissionRolling: rolling drums for steps/turns (no full scale)
  • ChannelBar: segment ratio = llmMs / (llmMs + toolMs) (no cap)
  • SpeedGauge's redline = 200 (initial; auto-scales in 100 tok/s steps)
  • ContextUsageBar: segment colors and the ≥80% solid-red threshold; the hover tooltip reads systemTokens / toolsTokens / messageTokens from the contextBreakdown projection
  • Rolling counter: DRUM (3× 0-9), DRUM_H = 15 (px per digit), RollingValue's carry/borrow formula and mount spin-up
  • CSS: position:fixed; right:12px; tiers in tierOf(space, width)width < 800hidden (window-width floor), space >= 180full, else mini (measurement failure falls back to full) — plus the .gsh-root.gsh-* rules; @media (prefers-reduced-motion: reduce) disables pulses and transitions

Publishing to npm (optional)

# remove "private": true from package.json, then
npm publish
# users install with:
dsh plugin --profile web add dsh-stats-hud

Contact

Questions, ideas or issues? Open a discussion on GitHub:

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh_hud_plugin」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:lauytgary/dsh_hud_plugin

Headless(CLI)profile:

dsh plugin --profile headless add github:lauytgary/dsh_hud_plugin

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-25
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →