rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:verneuil/dsh-opencode-go-usage
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek balance and OpenCode Go usage (5-hour / weekly / monthly) merged into one floating pill, with a matching settings page
An unofficial DeepSeek Harness plugin that shows your DeepSeek balance and OpenCode Go usage (Rolling / weekly / monthly) in one floating pill, with click-to-refresh, border-flash feedback, drag-to-snap and a hover popover, plus a full-page settings view of its own.
The pill and the hover popover
OpenCode Go quota amounts + DeepSeek balance display:
Three rings show each window's usage:
Hover popover:
Projected usage chart:
monthly.resetsAt (the same date the official console shows as “Renews …”), so nothing has to be typed in.OCG quota conversion:
-- .Amount currency:
Minimal mode:
Other details: The popover is interactive: moving the pointer from the pill onto the popover keeps it open (a 220 ms grace period covers the gap between the two), clicking the popover behaves exactly like clicking the pill (a manual refresh), and its border flashes in sync with the pill; The popover picks its direction: it opens upwards near the bottom of the window and inwards near the left/right edges, so it is never clipped; Drag to snap: on release the position is recorded against the window edges only (so it no longer drifts when the composer card changes size), with 0.1px precision, and the pill keeps its relative position when the window resizes;
Optional sidebar entry: a "Sidebar entry" switch in settings (off by default). When enabled the plugin gets a sidebar row that opens its settings page as a full page (the very same UI), with the settings-menu mark as its icon;
General
require('react'), provided by the host).Requirements: DeepSeek Harness desktop (the app bundles node / pnpm — nothing else to install). This plugin follows the official DSH plugin conventions: you do not hand-edit the profile's package.json / cordis.patch.yml, and you should not run pnpm inside the profile directory.
In DSH, open the plugin manager → “Install plugin” dialog → paste one of the specs below → install (the dialog drives pnpm and installs one spec at a time):
| Method | Spec to paste |
|---|---|
| Straight from GitHub (recommended) | github:verneuil/dsh-opencode-go-usage |
| From npm | dsh plugin --profile web add @verneuil/dsh-opencode-go-usage |
| Pin a version | github:verneuil/dsh-opencode-go-usage#v3.6.1 (replace with any published tag) |
| Release tarball | https://github.com/verneuil/dsh-opencode-go-usage/releases/download/v3.6.1/dsh-opencode-go-usage-3.5.0.tgz |
| Release URL (always latest) | https://github.com/verneuil/dsh-opencode-go-usage/releases/latest/download/dsh-opencode-go-usage.tgz |
| Offline tgz | file:D:/your/path/dsh-opencode-go-usage-3.5.0.tgz |
The equivalent command line (dsh plugin automatically adds dependencies that declare dsh.bundle to the profile's bundles — no hand-written patch needed):
dsh plugin --profile web add github:verneuil/dsh-opencode-go-usage
Follow the on-screen prompt to reload afterwards (replacing an installed JavaScript module generation requires restarting DSH).
cordis.patch.yml, so it qualifies.Host version gate: the package declares engines.dsh: ">=0.1.7". DSH evaluates it with semver.satisfies(..., { includePrerelease: true }), so every rc / alpha from 0.1.7 on matches — no plugin change is needed for each new host version.
Tested: dsh 0.2.1-rc.3 and dsh 0.2.1-rc.5 (isolated profile cold boot plus a headless-browser smoke, both green).
If the host refuses to load the plugin (narrowed range or a mismatched ledger): grant an exact exemption in the profile's compatibility.json instead of changing the plugin:
{ "@verneuil/dsh-opencode-go-usage@3.5.0": ["0.2.1-rc.5"] }
The file lives at ~/.dsh/profiles/<profile>/compatibility.json (desktop: %DSH_HOME%\profiles\<profile>\compatibility.json).
After a DSH upgrade, if the pill or settings page misbehaves, check the boot log for plugin tree failed to load first, then compare against CHANGELOG.md.
Settings → Plugins → OCG Usage.The settings page has four tabs: Usage data (default) / Floating pill / Colour settings / General settings.
Next to the page title sit the GitHub icon and the current version (e.g. v3.6.1); clicking the icon opens this repository.
Usage data
Auto / ¥ CNY / $ USD; the note beneath shows the current rate, when it was fetched and the refresh result.Model: X (total: Z, used: Y, left: W); the amounts come from the reference model's Go-tier monthly quota × this month's used percentage.Floating pill
DS balance / OCG quota left — which data that left line uses.DS balance / OCG quota left / Projected usage — tick any combination, or none at all (the popover then keeps only the three progress bars); clicking outside the dropdown closes it. Turning the chart off leaves no divider behind.Colour settings
General settings
Shared behaviour
Because the plugin ships its own settings page, the host side calls the official settings.configure({ auto: false }) to switch off the auto-generated form, avoiding two duplicate configuration UIs.
All twelve are rendered illustrations built from the plugin's real stylesheet and the host theme tokens (not machine screenshots). The four settings groups cover every tab: Usage data (quota reference model, amount currency, plan quota, the usage card and the projected usage chart), Floating pill (master switch, size slider, balance and popover data control, minimal mode, ring data mapping with its live preview, position reset), Colour settings (unified colour, normal / warning / danger dots, restore defaults and follow-host, four-state colour preview) and General settings (both keys, sidebar entry, restore defaults, export / import configuration). The states image includes the latest hover popover (projected usage chart included), and the last one shows the full settings page opened from the sidebar entry.
| Pill · light | Pill · dark |
|---|---|
![]() |
![]() |
| Settings · Usage data (light) | Settings · Usage data (dark) |
![]() |
![]() |
| Settings · Floating pill (light) | Settings · Floating pill (dark) |
![]() |
![]() |
| Settings · Colour settings (light) | Settings · Colour settings (dark) |
![]() |
![]() |
| Settings · General settings (light) | Settings · General settings (dark) |
![]() |
![]() |
| Sidebar entry · full settings page (what the sidebar row opens when the entry is enabled) | |
![]() |
States and colour grades (refreshing / success / failure / three grade colours / minimal mode / most compact form / narrowed after hiding the balance)

GET https://opencode.ai/zen/go/v1/usage # OpenCode Go usage
Authorization: Bearer <OpenCode Go API Key>
GET https://api.deepseek.com/user/balance # DeepSeek balance
Authorization: Bearer <DeepSeek API Key>
GET https://opencode.ai/inference/go/v1/models # OpenCode Go model list + Go-tier monthly quota per model (public JSON)
GET https://open.er-api.com/v6/latest/USD # USD/CNY rate (primary, no key)
GET https://api.frankfurter.app/latest?from=USD&to=CNY # USD/CNY rate (backup, no key)
The usage endpoint returns { usage: { rolling, weekly, monthly } }, where each window carries status / percent (used percentage) / resetsAt; the balance endpoint returns balance_infos[] (the CNY entry is preferred). The UI shows Used by default and can be switched to Left in settings; the internal value always stays “used”.
The host half performs the fetching and parsing (neither key ever leaves the host process); the client half only reads the configuration projection the host writes.
The model list and the rate refresh together with everything else: manual refresh (button or pill click) forces a refetch, while auto-refresh reuses the model table for 24 h and the rate for 1 h. If both fail, the plugin falls back to its bundled snapshot (go-data.js, generated 2026-11-17: 32 official models + a rate of 6.679257) and names the failure in the UI. Quota conversion uses the Go-tier monthly quota from that model table.
Key resolution (independent per side, in priority order):
OPENCODE_GO_API_KEY (then OPENCODE_API_KEY) for OpenCode Go, and DEEPSEEK_API_KEY for DeepSeek.| Part | Location | Description |
|---|---|---|
| Bundle manifest | package.json |
dsh.bundle.patch + dsh.client (platform web, immediately) + icon + locale/*.json display metadata |
| Loader patch | cordis.patch.yml |
Inserts one row, id: opencode-go-usage (this row id is also the namespace of the settings form) |
| Host half | index.js |
export const Config (schemastery when available, falling back to an inline Standard Schema) + apply(ctx, config): fetching, parsing, writing back snapshots, auto-refresh |
| Client half | client.js |
A window.__ModuleLoader__ lazy factory; only require('react'); registers into shell.overlay (pill) and settings.section (settings page) |
The settings page covers the common options; the fields below can also be edited directly in this row's patch config.
| Field | Description |
|---|---|
apiKey |
Manual OpenCode Go API key (secret). Leave empty to use the DSH credential store |
deepseekApiKey |
Manual DeepSeek API key (secret). Leave empty to use the DSH credential store |
refreshMinutes |
Auto-refresh interval in minutes (default 5); one round refreshes both balance and usage |
widgetVisible |
Pill visibility switch |
widgetScale |
Pill scale: 1 default (initial value) / 0.9 −10% / 0.8 −20% / 1.15 +15% / 1.3 +30% / 1.5 +50% / 1.75 +75% / 2 +100% |
showBalance |
Whether the pill shows a balance line on its left (default off) |
pillBalanceSource |
Data for that left line: deepseek DS balance (default) / quota OCG quota left |
tipShowBalance, tipShowQuota, tipShowPace |
Whether each popover module is shown — balance, quota, projected usage chart (all default on; turning all off leaves only the three bars) |
sidebarEntry |
Whether the sidebar shows a row for this plugin (off by default; same as the "Sidebar entry" switch) |
ringOuter / ringMiddle / ringInner |
Which window each of the outer / middle / inner rings shows in minimal mode: rolling (5 hours), weekly, monthly (defaults monthly / weekly / rolling) |
colorUnified |
Unified colour: one three-tier set paints both ring and bar progress (on by default); turn it off for two independent sets |
colorFollowHost |
Follow host colours: the normal tier uses the host accent (--dsw-alias-brand-primary) while warning / danger keep their defaults; picking a normal colour turns it off (off by default) |
colorAll / colorAllWarn / colorAllDanger |
Custom colours for the unified set (CSS values: #RRGGBB, rgb(), hsl(); empty = theme green / amber / red) |
colorRing* / colorBar* (with …Warn / …Danger suffixes) |
When colorUnified is off: the three tiers for ring / bar progress (no suffix = normal, Warn = warning, Danger = danger); the bar normal colour also paints the projected chart's real segment |
quotaRefModel |
Reference model id (default deepseek-v4.1-flash; options come from the official model table) |
currencyMode |
Amount currency: auto (default) / cny / usd |
percentMode |
Usage progress basis: used (default) or left |
widgetAnchorX/Y, widgetOffsetX/Y |
Pill anchoring (written by the client while dragging; defaults to the window's bottom-left, 7 px in and 9.2 px up) |
refreshRequest |
Manual-refresh counter (incremented by the client when the pill is clicked) |
refreshTick |
The “refreshing” signal the host bumps before each round (read-only on the client, used for the border feedback) |
minimalMode |
Minimal mode: nested rings (with the rounded balance beside them; default on) |
keyStatus, keyHint, usageError, lastUpdated, usage |
Derived OCG usage snapshots (written by the host, read by the client) |
balanceKeyStatus, balanceKeyHint, balanceError, balance |
Derived DeepSeek balance snapshots (written by the host, read by the client) |
goModels, goModelsAt, goModelsSource, goModelsError |
Derived model-list and quota snapshots (source = live or snapshot) |
fxUsdCny, fxAt, fxRateDate, fxSource, fxError |
Derived USD/CNY rate, its data date and the moment it was fetched |
shell.overlay (replaceRisk: none, a click-through layer whose entries opt into pointer events); registering with its own id means “added next to existing entries”, replacing nothing official.conversation.composer.dock and does not clone official components.--dsw-alias-*): a token rename can at worst degrade the look, never crash the render; there are no hard-coded colours.dsh-client-ui-primitives): those packages change often and plain JS plugins get no type checking, so every control in the pill is hand-written.TypeError that would silently deactivate the whole entry.remote.settings.describe(); writes are committed outside the HMR transaction (avoiding HMR transactions cannot be nested).-- or persist empty values..tgz is built and signed by GitHub Actions, so the Release page shows Verified; verify it yourself with gh attestation verify <file> --repo verneuil/dsh-opencode-go-usage.api.deepseek.com (balance), opencode.ai (usage and the official model table), plus open.er-api.com and api.frankfurter.app (exchange rates, only when the currency mode is "auto").@deepseek-ai/schemastery, which declares the settings schema and its volatile semantics and is installed with the profile so the settings UI behaves identically everywhere.redirect: "error") so credentials cannot be forwarded to another host.usageError).sk-****5590).auto = ¥ in Chinese, $ in English) and never changes a real bill.MIT © 2026 verneuil
Please open an issue for bugs and suggestions; pull requests are welcome. Version history: CHANGELOG.md.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。