DeepSeek Harness Plugin

HaoyueQin/dsh-deepseek-monitor

Stars ★ 2 Downloads (30d) 1,623 Category Usage & Billing Added 2026-08-28 npm dsh-deepseek-monitor

Official DeepSeek platform monitoring inside the provider card: a live balance chip left of the composer model name plus an expandable account-details panel with per-model monthly usage and a daily stacked chart.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-deepseek-monitor

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:HaoyueQin/dsh-deepseek-monitor

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

English | 简体中文

A DeepSeek Harness (dsh) web plugin that ports the balance & usage monitoring of DeepSeekMonitorWindows into dsh — embedded in the "Settings → Models → DeepSeek" provider card, with a live balance item in the composer tool row (left of the model name).

Screenshot: the "Account details" panel expanded inside the DeepSeek provider card (balance card / per-model usage rows / daily stacked chart), plus the balance chip and the "Account details" button next to the row name.

Features

Inline in Settings · Models · DeepSeek

  • "Account details" button: sits left of the built-in Edit button, cloned from the host button styling for pixel parity
  • Balance chip: live balance next to the model name, rendered with the currency's symbol (¥/$/…); turns red below the threshold
  • Expanded panel:
    • Account balance: official GET /user/balance API reusing the key already configured in dsh; today / month-to-date mini metrics (rendered in the account currency, falling back to ¥ without a balance snapshot); low-balance warning
    • Per-model usage rows: one row per model id the platform reports, carrying the official product name (DeepSeek-V4.1-Flash / V4-Flash / V4-Pro / V4-Flash-Vision-Exp), ordered V4.1 Flash → V4 Flash → Pro → Vision; lucide SVG icons (bolt / image / brain), per-model soft accents, progress bar + cache-hit rate + cost, constant row height. Several account-period ids of ONE model (V4.1 Flash's dated id and its live id) fold into a single row, so the numbers reconcile against the platform bill line by line
    • Daily stacked chart: DSM's own palette (hit green / miss orange / response purple), row-keyed buckets (a model id without its own row falls into "other", so a bar always equals that day's total), month navigation, sparse date labels that never collide, custom styled hover cards
    • Platform token setup: two acquisition channels — ① one-click console capture script (paste on the signed-in platform page, token pops up); ② manual paste via DevTools. Verified against the platform API before being stored write-only
    • Settings: composer balance display switch, auto-refresh toggle & interval (≥60s), low-balance alert & threshold, reload / clear cache

Composer tool-row balance item

  • Mounted on the official conversation.input.right slot — rendered left of the model name, before the send button, matching the sibling controls' typography (28px height / 13px font / medium weight)
  • Shown only while the session's latest route's PROVIDER is the built-in official DeepSeek provider (the fixed first entry in Settings → Models; route id deepseek-official) — keyed on the provider, never the model name, so a third-party provider serving a deepseek-*-named model does not light it up; hidden on the session-less hero screen
  • A switch in the "Account details → Settings" card turns this composer display on / off; the composer responds immediately after saving
  • Coloring policy: the currency symbol keeps the neutral gray; the NUMBER turns green above zero (state-success-primary) and red at or below zero (state-error-primary)
  • The chip polls the host cache every 60s and the expanded panel follows the configured interval; actual upstream refreshes are driven by the auto-refresh interval above (≥60s — only the host-side timer ever calls upstream)

Data & security

  • The API key is resolved per operation through the dsh credentials seam — never stored, echoed or logged by this plugin
  • The platform token is written into the credentials seam through our fenced route (write-only); no endpoint returns it
  • Every route lives behind the browser trust fence (loopback / trustedHosts; cross-site refused)
  • The capture script runs locally inside the platform page's own context and sends nothing anywhere
  • Preferences and cache persist in the storage domain deepseek_monitor

Install

dsh plugin --profile <name> add dsh-deepseek-monitor@latest

Published on npm: dsh-deepseek-monitor. Alternatively, download dsh-deepseek-monitor-<version>.tgz from GitHub Releases and mount it via a local profile / injector.

Version compatibility

  • Requires DeepSeek Harness on the 0.1.5, 0.1.6, or 0.2.0 line (declared via dsh.plugin.json engines.dsh; peer range ^0.1.5-alpha.1 || ^0.1.6-alpha.1 || ^0.2.0-rc.1). Per node-semver rules each arm covers its line's pre-releases from the line's first one plus the stable release when it lands (the 0.2.0 arm covers both the 0.2.0 stable and the rc.x builds); those floors deliberately stay at each line's first pre-release (earlier kernels are supported too, so narrowing them buys nothing). The build baseline is pinned to 0.2.0-rc.1 (devDependencies) — compiling against the newest pre-release of the supported kernel lines. The 0.1.7 kernels (alpha.1–rc.2) fall inside the 0.1.6 arm's match window and pass the DSH compatibility gate as well; their kernel deltas are covered by the 0.2.0-rc.1 contract audit.
  • Users on older DeepSeek Harness (0.1.2-rc.x / 0.1.3-alpha.x and earlier): install an earlier release of this plugin (use v0.1.5 for the 0.1.2/0.1.3 kernels, v0.1.4 for even older ones).
  • Model rows do not follow the dsh kernel version: which rows the panel shows is decided solely by the model ids the platform usage endpoint reports. Several account-period ids of one model fold into a single row (V4.1 Flash's dated id merges with deepseek-flash), retired ids are kept out of the row list while their usage still counts toward the month total and the chart, and an unrecognised id becomes its own row as-is — so upgrading dsh never rewrites how your past bills are read.

Development

pnpm install
pnpm typecheck   # tsc --noEmit
pnpm test        # vitest run
pnpm build       # tsc declarations + tsdown (host ESM + dual-channel client bundle)
pnpm watch       # tsdown --watch

Headless GUI verification script: node scripts/probe-gui.mjs

Acknowledgements

The balance / platform-usage backend and the dashboard structure were ported from the author's own HaoyueQin/DeepSeekMonitorWindows (the Windows desktop app); the implementation that port follows continues upstream along that repo's own stated lineage:

Project Relationship License
HaoyueQin/DeepSeekMonitorWindows Direct port source: the TypeScript port base for do_fetch_balance / do_fetch_usage, the token semantics and the dashboard structure MIT
Joyi-code/DeepSeekMonitorWindows Direct upstream of that desktop app (the Windows Tauri 2 rebuild) — where the ported logic ultimately comes from MIT
JayHome137/DeepSeekMonitor Origin of the lineage (macOS menu-bar + WidgetKit), which pioneered DeepSeek balance & usage monitoring MIT
lucide SVG icon library: the panel's model-row icons, plus the plugin-card icon.svg (camera geometry adapted from lucide's cctv; the ISC notice stays inside that file) ISC

Released under MIT; the MIT notices of the projects above are preserved with any distribution.

Activity

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.