DeepSeek Harness Plugin Hub

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

探索

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

社区

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

相关链接

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

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

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

dsh-usage-plugin

Usage Plugin

DeepSeek Harness 原生侧边栏使用情况面板:官方余额 + 来自会话日志的令牌使用历史

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

npx -y @deepseek-ai/dsh plugin --profile web add dsh-usage-plugin@0.1.4
README兼容性版本

兼容性与来源证明

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

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

版本

0.1.4stable
2026/9/22
0.1.3stable
2026/9/15
0.1.2stable
2026/9/14
查看其余 2 个版本收起版本
0.1.1stable
2026/8/26
0.1.0stable
2026/8/25

相关插件

正在加载相关插件…

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

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

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

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

认领这个 Plugin →
报告问题

相关插件

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

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundle扩展推理的实验性机器翻译Whale Widgetdsh-whale-widgetDSH Web 界面右下角的 DeepSeek 余额小鲸鱼挂件:余额/今日已用/峰谷定价、自定义泡泡点击序列(文本/余额/今日/峰谷/图片/随机语句与并列加权选择)、逐行样式与字体、悬浮快捷编辑、音效与每轮消耗、自定义角色/动图/音效、吸附与翻转自定义Our Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — 在 dsh 里装上这个插件即可,无需登录、注册或填 API Key,就能使用包括 DeepSeek V4.1 Flash、Kimi K3 在内的前沿模型,桌面端另有 EAC 协付渠道;2.0 起接入 LobsterAI、Qoder、TRAE、Cline、Loomy、Raccoon、MiniMax、ZCode、Gemini 十个账号渠道(原有匿名免费通道保留)(登录、账号池、积分领取、本地 OpenAI 网关与局域网转发、数据看板与运行日志),六页毛玻璃界面统一呈现。Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片

README

dsh-usage-plugin

A native sidebar usage panel for DeepSeek Harness Web: shows your official DeepSeek balance and token usage history (today / last 7 days) right in the sidebar, with no separate process and no cross-origin calls.

A trigger button appears at the bottom of the left sidebar, above Settings — full-width with a label when the sidebar is expanded, a compact icon when collapsed. Click it to open the panel: live balance, today's input / output / cache tokens, and a 7-day trend computed from your own session logs.

Features

  • Official balance — live query of api.deepseek.com/user/balance using the API key DSH already has (DEEPSEEK_API_KEY from your credentials), never stored in the browser.
  • Token usage history — reads your $DSH_HOME/sessions logs and aggregates input / output / cache tokens per day (today, totals, daily average, cache hit rate).
  • Sidebar integration — registers a sidebar.footer.action trigger and a shell.overlay modal; layout follows the DSH design tokens (light/dark themes included).
  • Zero footprint — no daemon, no config, no database; data comes from the same DSH installation you already run.

Requirements

RequirementVersion
DeepSeek Harness>= 0.1.0-rc.7 (verified on 0.1.5-rc.2)
Node.js>= 20
pnpm>= 10 (for dsh plugin installation)
API keyan existing DEEPSEEK_API_KEY credential (the one DSH already uses)

Installation

From anywhere, run:

dsh plugin --profile web add dsh-usage-plugin

That's it — the package declares a dsh.bundle patch, so dsh plugin automatically mounts it into the profile layer stack. Then:

  1. Restart dsh web (stop and start the process). The loader tree is composed once at boot, so a plugin installed into a running server is not picked up until then.
  2. Hard refresh the browser (Cmd/Ctrl+Shift+R).
  3. Look for the usage icon at the bottom of the left sidebar.

Verifying the install

GET /api/dsh-usage/balance and GET /api/dsh-usage/stats?days=N sit behind the same process-token fence as the rest of DSH's /api (dsh >= 0.1.5), so a bare curl gets 401 unauthorized. Use the browser page, or pass the token that dsh web prints at startup:

# dsh web: http://127.0.0.1:3080/?token=XXXXXXXX
node scripts/verify-install.mjs 3080 XXXXXXXX

The verifier ships with the package, so an npm install can run it from ~/.dsh/profiles/web/node_modules/dsh-usage-plugin.

Alternatives

  • From GitHub: dsh plugin --profile web add github:lurejewel/dsh-usage-plugin
  • From a release tarball: dsh plugin --profile web add https://github.com/lurejewel/dsh-usage-plugin/archive/refs/tags/v0.1.4.tar.gz
  • From a local checkout (development): run the same command from inside this repo. Quote the path: dsh plugin forwards its arguments to pnpm through a shell without quoting them, so an unquoted path containing spaces is split into several package specs — D:\Software\DeepSeek Harness\dsh-usage-plugin becomes link:D:/Software/DeepSeek plus a phantom Harness\dsh-usage-plugin dependency, and the plugin is dropped from dsh.profile.bundles:
dsh plugin --profile web add '"D:\Software\DeepSeek Harness\dsh-usage-plugin"'

scripts/install-local.ps1 does exactly this.

  • Manual mount on older setups: add the row below to ~/.dsh/profiles/web/cordis.patch.yml, then restart:
- insert:
    - id: dsh-usage-plugin
      name: dsh-usage-plugin

Uninstall

dsh plugin --profile web remove dsh-usage-plugin

Then restart dsh web.

How it works

One package, two halves, mounted as a normal Cordis plugin:

lib/index.js          Host half: same-origin HTTP routes on the DSH web server
lib/client.js         Browser half: __ModuleLoader__ bundle served to the web GUI
lib/usage-history.js  Session-log reader (zstd frame scan + per-step dedup + daily aggregation)
  • GET /api/dsh-usage/balance — live official balance (server-side call, key never leaves the server).
  • GET /api/dsh-usage/stats?days=N&fresh=1 — balance + usage history; N defaults to 7, clamped to 1–90. fresh=1 bypasses the short result cache (the panel's refresh button sends it).

Implementation notes worth knowing:

  • The session scan runs in a worker thread (usage-service.js), never on the server's event loop. It reads and inflates every artifact — seconds of synchronous work on a large history — and running that inline stalls the entire harness web server. That is not merely slow: anything that health-checks the server over HTTP reads the stall as "server down". (dsh-remote's bridge watchdog probes http://127.0.0.1:3080/ with a 2s timeout and kills the tunnel when it fails, so an inline scan visibly kills and restarts the remote bridge on every panel click.) Results are cached for 15s and concurrent requests share one scan.
  • DSH session logs (session.<generation>.jsonl.zstd) are multiple concatenated zstd frames (one frame per persistence batch); the reader scans frame-by-frame instead of assuming a single frame. One damaged frame costs only its own rows.
  • Session artifacts are versioned format generations — session.jsonl.zstd is the released v0 root, session.vN.jsonl.zstd a later one, and DSH always writes and reads the highest generation present in a session directory. The reader therefore selects the highest canonical generation per session (never the plain v0 file alone, and never more than one file per session): a lower generation stops at that session's migration point, while reading two of them would double-count.
  • assistant/message and assistant/chunk events report the same usage numbers for the same (turn, step); the reader de-duplicates by (turn, step) so totals are not double-counted.
  • The API key is resolved through DSH's credentials service — the same source the DeepSeek provider uses. Nothing is stored in the browser; all calls are same-origin.
  • Both routes inherit DSH's browser-trust fence, and on dsh >= 0.1.5 the client bundle is delivered as part of the shell's single combined /plugins/??… request rather than per-package URLs. Neither changes the browser half: it runs inside the authenticated page.

Privacy & security

  • The balance call goes from your server to api.deepseek.com; the API key never enters the browser.
  • The panel only reads your own session logs under $DSH_HOME/sessions.
  • No telemetry, no third-party network calls.

Development

npm test                       # unit tests (frame scan / generation pick / dedup /
                               #   worker service / cache / non-blocking scan)
npm run test:client-boot       # boot the real client bundle in Node against mock slots
npm run test:standalone        # in-process E2E: real cordis + real API + real logs
                              #   (needs a local DSH install with @deepseek-ai packages
                              #    reachable at $DSH_HOME/profiles/node_modules, a
                              #    DEEPSEEK_API_KEY credential, and session logs)
npm run verify -- 3080 <token> # post-restart check against a running dsh web

lib/ is the shipped artifact and doubles as readable source (plain ESM, documented).

Windows helper scripts (optional)

  • scripts/install-local.ps1 — one-click local install as a link: to this repo (quotes the path for the dsh plugin shell hop).
  • scripts/restart-web.ps1 — restart dsh web, read the tokenized URL from the server log, then run the verification.
  • scripts/verify-install.mjs — post-restart check: token exchange, stats/balance routes, materialized client row, combined bundle contents. On dsh >= 0.1.5 it needs <port> <token>.

The two .ps1 helpers live in the git checkout only; verify-install.mjs is published in the npm package as well.

Changelog

0.1.4

  • The session scan now runs in a worker thread (with a 15 s result cache and de-duplication of concurrent scans), so the panel no longer blocks the harness event loop. Previously every panel open stalled the whole web server for seconds — long enough that dsh-remote's 2 s bridge watchdog declared the harness offline and restarted the remote tunnel on each click.
  • /api/dsh-usage/stats?fresh=1 bypasses the cache; the panel's refresh button sends it, while simply reopening the panel reuses a recent scan.
  • Balance and usage history are now fetched in parallel.

0.1.3

  • Read the highest session format generation (session.vN.jsonl.zstd), not only the released v0 root. A migrated session's v0 file stops at its migration point, so today's usage read as 0 and history under-counted by roughly 11%.
  • A damaged zstd frame now costs only its own rows instead of the whole session's history.

0.1.2

  • Adapt to dsh 0.1.5: process-token fence, combined client-bundle request, install paths containing spaces.
  • Route registrations are wrapped in ctx.effect, so unload/reload removes them instead of leaving zombie handlers.

0.1.1

  • Restore the /api/dsh-usage/stats client request (the path had been over-renamed).
  • Full-width footer trigger while the sidebar is expanded.

0.1.0

  • First release: official balance + token usage history in the sidebar.

License

MIT