DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-balance-chip

H

dsh-balance-chip

Manifest valid

A DSH (DeepSeek Harness) client plugin: live account balance plus the current DeepSeek billing window (peak / off-peak) in the sidebar footer.

UI (client)hasBundlePatch

dsh-balance-chip

Two rows in the DSH sidebar footer: your live account balance, and the current DeepSeek billing window (peak / off-peak) with the clock time that window ends.

中文说明 · Agent install guide · MIT License

┌─ sidebar footer ─────────────────┐
│  Balance                  ¥12.34 │  ← balance row
│  Off-peak          ends 09:00    │  ← billing-window row
│  🟣 account                      │  ← built-in account entry
└──────────────────────────────────┘

The balance row sits directly above the avatar / account row, the billing row right under it. Both register in the sidebar.footer.action list slot, so nothing in the built-in UI is replaced or wrapped.

Why not inside the avatar row: that row is settings.trigger, a single slot already owned by dsh-client-ui-settings-general. sidebar.footer.action is the nearest free list slot in the same bottom-left block.

What it shows

BalanceLive wallet total from the same account Remote that Settings → Account uses. Bonus wallets are appended as +¥0.50; amounts truncate to cents with thousands separators; sub-cent amounts show <¥0.01. A failed read keeps the last number instead of blanking the row.
Billing windowPeak (amber) or Off-peak (green), plus when it ends — 12:00, tomorrow 09:00, Mon 09:00, Mar 3 09:00.
HoverThree short lines: state + countdown, the reason (peak windows / weekend / statutory holiday), then the pricing note and what a click does.
ClickBalance row opens your usage page (URL comes from the account state stream). Billing row opens the official pricing page.
Collapsed sidebarBalance shows only the amount; billing shows only Peak / Idle.

Every state renders something visible — loading …, signed out, no wallet, read failure — so "the plugin did not load" and "the plugin loaded but has no data" never look the same.

Billing windows

The billing row mirrors DeepSeek's published rule, in Beijing time (UTC+8):

  • Peak: Monday–Friday, 09:00–12:00 and 14:00–18:00, excluding Chinese statutory holidays.
  • Off-peak: everything else — 12:00–14:00, after 18:00, weekends, and holidays all day.
  • Off-peak pricing is half of peak.

Sources: Model & Pricing (EN) · 模型 & 价格 (中文) · 2026 holiday dates from 国务院办公厅关于 2026 年部分节假日安排的通知 (国办发明电〔2025〕7号). Pricing and windows can change — the official page is authoritative.

The judgement is pure local arithmetic (Date.now() plus the rule above), computed entirely in Beijing wall-clock time, so the result does not depend on the machine's time zone. On a machine outside UTC+8, the row prefixes Beijing and the hover adds the local equivalent.

The statutory holiday table is compiled in (lib/client.js, HOLIDAY_TABLE) and currently covers 2026. Weekends moved to working days still count as weekends, so no separate adjustment table is needed. For a year the table does not cover yet, the plugin falls back to weekday-only rules and says so in the hover.

Install

Requirements: DSH 0.2.x, and Python 3 for the installer. Node.js is optional — only the offline tests need it.

Let an agent do it

Hand the repository, or the release zip, to your assistant and point it at AGENT-INSTALL.md. That guide covers environment checks, offline verification, installation, activation, reporting back, troubleshooting, rollback, and a no-Python manual path.

By hand

python3 install.py          # macOS / Linux
python install.py           # Windows

The installer scans $DSH_HOME/profiles/* (default ~/.dsh/profiles), copies four files into <profile>/node_modules/dsh-balance-chip/, and appends one insert entry to that profile's cordis.patch.yml. It does not touch the profile's package.json or dsh.profile.bundles, uses no network, and is idempotent.

Useful flags:

python3 install.py --list           # show detected profiles, change nothing
python3 install.py --profile web    # install into one profile (repeatable)
python3 install.py --uninstall      # remove the entry, keep the package
python3 install.py --purge          # also delete the package directory

Then let it take effect: press Ctrl+R / Cmd+R in the window first; if that is not enough, fully quit and reopen DSH (macOS ⌘Q — closing the window does not quit the process).

From a release zip: unzip dsh-balance-chip-<version>.zip, then run the same command inside it.

Configuration

Every field of an entry's config is optional; an invalid value falls back to the default instead of hiding the row.

- insert:
    - id: balance-chip
      name: "dsh-balance-chip"
      config:
        windows: ["09:00-12:00", "14:00-18:00"]   # Beijing time; [[540,720],[840,1080]] also accepted
        weekdays: [1, 2, 3, 4, 5]                 # days treated as working days (0 = Sunday)
        holidays: ["2027-01-01", "2027-02-06"]    # extra dates, union with the built-in table
        ignoreHolidays: false                     # true = ignore holidays entirely
        zoneOffsetMinutes: 480                    # time zone the rule is defined in
        pricingUrl: "https://api-docs.deepseek.com/quick_start/pricing"

How it works

  • Two client rows, one host stub. lib/client.js is the browser half: it renders both rows, reads the balance over the existing account Remote (getBalance for the value, watch for sign-in state and the usage URL) and computes the billing window locally. lib/index.js is the host half — it exists because the loader also imports every package on the host side, and it carries only a load probe.
  • One slot, ordered by order. Balance order: 10, billing order: 20, both in sidebar.footer.action (kind: list, scope: root).
  • Pure function, thin component. periodAt / describeChip are side-effect-free and exported as exports.period; the component only prints their output. The loader reads apply / inject and ignores the extra export.
  • No network, no credentials, no host code. The only outbound action is window.open(url, "_blank", "noopener,noreferrer") on click. The only host-side write is a /tmp load probe wrapped in try/catch.
  • Theme tokens only. Colours come from --dsw-alias-* tokens, so light and dark themes both work.

Compatibility

Developed against DSH 0.2.0-rc.2 with @deepseek-ai/cordis 4.0.4 — the versions that ship with the desktop build it was tested on. The package declares no @deepseek-ai/dsh* peer dependency, so DSH's compatibility gate does not block it; what it needs at runtime is the sidebar.footer.action slot and the slots / locale / remote.account services.

Development

node test-client.cjs .                       # balance row, fake Remote, no browser
node test-peak.cjs .                         # schedule, strings, tooltip layout
TZ=Pacific/Kiritimati node test-peak.cjs .   # same conclusions in another zone

Both suites are offline: a minimal React-hooks runtime, a fake ctx, and a fake account Remote. test-peak.cjs covers window boundaries, overnight and weekend spans, every 2026 holiday block, config fallbacks and tooltip line lengths, and prints a SCHEDULE-FINGERPRINT line that must be identical across time zones.

Version history

VersionDateNotes
1.1.12026-10-15Hover tooltips split into short lines; aria-label now a separate single line
1.1.02026-10-14Added the billing-window row (peak / off-peak, end time, holiday table, config)
1.0.02026-10-14Balance row only

Credits

Built by Ivan Chen and HugePaint.

Not affiliated with DeepSeek. The windows and prices it displays are DeepSeek's; the plugin only reproduces the published rule locally.

License

MIT © 2026 Ivan Chen, HugePaint

Comments

Loading…

Similar plugins

dsh-simple-usage-info

by MarJose123

DeepSeek Harness plugin: your DeepSeek API balance and the current peak/off-peak billing window, below the message input.

Manifest valid

★ 0

MIT

JavaScript

Oct 18, 2026

dsh plugin --profile web add dsh-simple-usage-info

by sunzphy

DeepSeek account wallet balance and the live peak/off-peak billing period, in a fixed status region at the sidebar foot — plus a one-click official top-up link.

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 1

MIT

JavaScript

Sep 26, 2026

dsh plugin --profile web add dsh-sidebar-status

by LucienLL

DeepSeek Harness plugin: peak/off-peak price watch, live account balance with tiered low-balance alerts, and a top-up button for the main web UI

Models & ProvidersManifest valid

★ 0

MIT

JavaScript

Aug 26, 2026

dsh plugin --profile web add dsh-peak-price-panel

by dsh-plugin-lab

DSH plugin: shows your DeepSeek account balance at the bottom of the left sidebar (native UI)

Tools & CapabilitiesManifest valid

★ 3

↓ 547/wk

MIT

TypeScript

Oct 19, 2026

dsh plugin --profile web add dsh-ds-balance

by KamChiHei

DeepSeek Harness (dsh) plugin: token usage accounting and account balance with a live status card in DSH Web

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Aug 22, 2026

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

by btbxbob

DeepSeek Harness side-bar balance badge: show DeepSeek account balance and estimated depletion time (dual-half cordis plugin)

Manifest valid

★ 0

JavaScript

Sep 14, 2026

dsh plugin --profile web add dsh-balance