rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:PrasenKakade21/dsh-opencode-go-usage
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DeepSeek Harness plugin: a composer-dock pill for sessions running on the OpenCode Go provider, and a dialog behind it showing your real plan usage — the same 5-hour, weekly and monthly meters the OpenCode Console renders.
dsh plugin --profile <name> add github:prasenkakade21/dsh-opencode-go-usage
The desktop application manages its own profile, so there use the Plugins page's Add flow instead of the CLI. After it loads, click the pill and Connect to approve the device code.
▮▮▮ 3.17% / $0.08 ← account month, then this session's cost
3.17% — your monthly Go meter, read from the Console (two decimals).$0.08 — this session's token cost at OpenCode Go prices.Clicking it opens the account dialog:
┌──────────────────────────────────────────┐
│ ▮ OpenCode Go $0.08 │
│ ──────────────────────────────────────── │
│ This session · 0.08% of the monthly limit │
│ ──────────────────────────────────────── │
│ 5-hour 2.10% resets in 3h 12m │
│ ▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
│ Week 6.34% resets in 4d 0h │
│ ▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
│ Month 3.17% resets in 26d 4h │
│ ▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │
│ ──────────────────────────────────────── │
│ go plan · renews 26d 4h [Sign out] │
└──────────────────────────────────────────┘
The first line is this session as one sentence — its share of the model's monthly allowance, with no dollars and no model name. (The dollars stay in the title and the footer.) The three account windows follow it, and the dialog ends with an Edit display in Plugins button that jumps straight to the settings.
The Display switches live in exactly one place: this plugin's page in Settings → Plugins → OpenCode Go Usage, beside the bundle's own configuration — one click from the Plugins list, like the built-ins. They are round on/off switches for the bottom bar — Monthly percentage, Session cost, Usage ring, 5-hour percentage and Weekly percentage — stored in the browser and broadcast to every open view, so flipping one repaints the pill immediately with no reload. Turning everything off leaves the pill as its glyph alone, keeping the dialog reachable.
| Number | Source |
|---|---|
| 5-hour / weekly / monthly meters | GET https://opencode.ai/console/api/go/status — the Console's own Go subscription meters |
| This session's cost | the tokenUsage + modelSelection Session projections, priced by the book in client.js |
The Console keeps usage behind a sign-in, so the Host half runs a device-code flow: the dialog
shows a short code, you approve it in the browser, and the session is stored at
$DSH_HOME/opencode-go-usage/state.json with 0600 permissions. Tokens never reach the page — the
browser only receives percentages and reset times. Access tokens refresh silently two minutes before
they expire.
The route (/api/opencode-go-usage/...) is a plain node:http handler registered on a longer prefix
than the connection carrier's /api, so it is answered directly rather than through the fetch
bridge. It exposes no token, only the normalized meters.
PRICES in client.js.| File | Role |
|---|---|
index.js |
Host half: device sign-in, token refresh, Console status, the /api route |
client.js |
Client half: the dock pill, the dialog, the Plugins-page Display section, the session pricing, locale, styles |
cordis.patch.yml |
Inserts the opencode-go-usage Host row |
locale/en.json, locale/zh.json |
Plugin Manager title/description |
icon.svg |
Original icon |
The device-code flow, the Console URLs and the refresh shape are adapted from
dsh-opencodego-status by Assidefok (MIT).
The bundle row accepts one setting:
- id: opencode-go-usage
name: '@local/opencode-go-usage'
config:
refreshSeconds: 60 # 15 – 3600; how long one Console reading is reused
node test/smoke.mjs runs both halves headlessly: the Console payload normalization, the
device-flow helpers, the session pricing and peak windows, the rendered pill and dialog in connected,
not-connected and host-down states, and the route's 404 answer.
Host code is ESM-cached at app start, so a change to index.js needs an app restart; client.js is
served from this directory and reloads with the page.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。