dsh-plugin-balance-badge

usagetested: passnpmMIT

Always-visible account topped-up balance pill in the sidebar header, refreshed automatically and showing the same number as Settings → Account.

下载量 / Downloads
994
依赖体积 / node_modules
0.03 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

Install

dsh plugin --profile web add dsh-plugin-balance-badge

Sandbox test results

StageResult
1 install✓
2 list✓
3 mount✓
4 boot—

Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).

README

dsh-plugin-balance-badge

![DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)

![npm](https://www.npmjs.com/package/dsh-plugin-balance-badge)

![license](LICENSE)

![Listed in the Awesome DSH Plugin catalog](https://awesome-dsh-plugin.com/p/reg4916/dsh-plugin-balance-badge/)

Always-visible DeepSeek account balance for DeepSeek Harness. A small pill in

the top-left window strip of the sidebar shows the same Topped-up balance as

Settings → Account, and keeps itself up to date.

⬤ ⬤ ⬤        ⌄
   ●  ██ $16.59        ← the balance pill (macOS window strip)
   🐋 deepseek HARNESS
   ⊕ Новая сессия

Features

  • Same number as Settings → Account — reads the DeepSeek account Remote, not a

separate/provider-specific API.

  • Refreshes itself: on load, every 60 s while the page is visible, immediately when

the window regains focus, and immediately when the stored account credential changes

(sign-in, sign-out, grant rotation). Click the pill to refresh on demand.

  • Backs off when the network does: a failed read retries after 15 s, then 30 s, 60 s and

at most 120 s, so an outage is not polled at the normal cadence. One success resets it.

  • Freshness you can see: the tooltip reads Updated 11:34 PM (5 min ago) and keeps the

relative part current without spending a request.

  • Honest states: … while loading, -- when signed out / unavailable, and the last

known amount plus a "stale" hint when a refresh fails — never a fake zero.

  • Bonus balance is shown separately in the tooltip (only when positive), exactly like

Settings → Account; it is never added to the topped-up amount.

  • Localized (en / ru / zh) and styled with Harness theme tokens, so it follows the

active theme and language.

  • Accessible by default: the amount is a polite live region, so it is announced when it

changes; the pill keeps a focus ring and a descriptive aria-label.

  • Pure presentation: no tools, no config, no Host service of its own.

Requirements

  • DeepSeek Harness 0.2.x with the DeepSeek account feature available

(the same feature that renders Settings → Account).

  • On the macOS desktop build the pill sits in the window strip; on Web/Windows/Linux

shells it is placed beside the Settings row at the sidebar foot instead.

Install

From npm (prebuilt, recommended)

dsh plugin --profile <profile> add dsh-plugin-balance-badge

An npm install is prebuilt: no repo download, no allowBuilds approval, and a

download figure on the storefront. Use the GitHub spec below only to pin a

commit that is not published yet.

From the GUI (Desktop and Web)

Settings → Plugins → Add plugin, then paste one of:

dsh-plugin-balance-badge
github:reg4916/dsh-plugin-balance-badge
github:reg4916/dsh-plugin-balance-badge#v1.0.2

The Desktop app owns its profile, so this (or an agent using the plugin_manager

tool) is the supported path there.

With an agent (plugin_manager tool)

Ask the agent to run install_bundle with the target

dsh-plugin-balance-badge (or the GitHub spec

github:reg4916/dsh-plugin-balance-badge). It installs the package, selects the

bundle, and applies it through the profile's HMR when available.

From the CLI (non-managed profiles)

dsh plugin --profile <profile> add dsh-plugin-balance-badge

Manual (development)

git clone https://github.com/reg4916/dsh-plugin-balance-badge.git
# in your profile package.json: "dsh-plugin-balance-badge": "link:/abs/path/to/clone"
# and append "dsh-plugin-balance-badge" to "dsh.profile.bundles"
ln -s /abs/path/to/clone <profile>/node_modules/dsh-plugin-balance-badge

Restart the app once if the profile's HMR is not running; afterwards client-plugin

edits are picked up by the running page.

Uninstall

Remove the dependency entry and the bundle name from the profile package.json,

remove node_modules/dsh-plugin-balance-badge (and the lockfile importer entry if

you edited it by hand), then restart the app.

How it works

Piece · Detail

Data · ctx.remote.account.getState() (local credential read) → ctx.remote.account.getBalance({ version, locale, timezoneOffsetSeconds }) only while signed in

Host chain · accountController → deepseekAccount → Platform GET /api/v0/users/get_user_summary (normal_wallets / bonus_wallets)

Placement (macOS) · frame slot shell.overlay, entry balance-badge, fixed at the window strip next to the traffic lights

Placement (other) · sidebar.footer.action, beside Settings (rail-aware)

Rendering · plain React from the page module table; no @deepseek-ai/* import

Refresh · one shared poller per plugin (single-flight, 15 s floor, stale results dropped, paused while hidden, 15→120 s backoff while reads fail)

The module is a browser artifact for the Harness module table

(window.__ModuleLoader__.load({ id, factory })) plus an empty Host row

(index.js = export function apply() {}).

Development

node test/contract.test.mjs     # loads client.js with a stubbed page and asserts
                                # registration, live data flow, formatting and states

Publishing

npm login          # once per machine
npm publish        # unscoped name, publishes as public 1.x

publish.yml also publishes from GitHub Actions with npm provenance and needs

the repository secret NPM_TOKEN (an npm automation token); run it from

Actions → publish → Run workflow. Keep the package repository field

pointing at this repo — the registry links npm packages to entries that way.

.
├── package.json         # dsh.bundle.p

…(truncated)

Rendered from the README published on npm. Formatted only, not edited.

Versions

Published on npm::4,最后更新 2026-10-29

Links

GitHub · Homepage · npm

Same category