DeepSeek Harness Plugin

Anciwiz/dsh-multi-quota

Stars ★ 0 Downloads (30d) 838 Category Usage & Billing Added 2026-12-01 npm dsh-multi-quota

Floating quota capsule for OpenCode Go, ChatGPT Plus and Gemini AI Pro with reset countdowns and 1% manual calibration. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-multi-quota

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

dsh plugin --profile web add github:Anciwiz/dsh-multi-quota

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

A floating quota dashboard for DeepSeek Harness: one collapsible capsule in the top-right corner, showing what is left in OpenCode Go, ChatGPT Plus and Gemini AI Pro at the same time, plus when each window resets.

Local and read-only. Credentials never leave the Host process; nothing is logged, written to disk, or sent back to the page.

中文 · English · Implementation notes

UI preview

Where the numbers come from

Subscription 5-hour window Weekly / monthly Source Freshness
OpenCode Go live live official /inference/go/v1/usage endpoint, called from the Host process 60 s
ChatGPT Plus snapshot weekly snapshot server rate_limits embedded in local Codex session logs only while Codex is active
Gemini AI Pro official CLI official CLI Antigravity CLI agy -p "/usage", two pools kept apart 10 min cache

Gemini falls back in three steps: official CLI → Antigravity IDE snapshot → manual calibration. If both machine sources are past their reset time, the window says "待确认 / unconfirmed" instead of pretending to know.

What you get

  • Collapsed capsule: three status dots, one percentage per subscription, and the shortest countdown to a reset.
  • Expanded panel: one card per subscription, one row per window, with a progress bar, remaining percentage and reset time.
  • Source badges: 官方 (OpenCode API), 官方 CLI / IDE 缓存 (Gemini), Codex 采样 (ChatGPT) — you always know how fresh a number is.
  • Thresholds: green above 40 %, amber 20–40 %, red below 20 % or rate-limited.
  • Manual calibration with 1 %-precision sliders; manual values win over stale automatic ones.
  • Polling every 60 s; the card's refresh button forces a re-read but is protected by a 15 s cooldown so it cannot hammer the CLI.

Install

Through a plugin index (Plugins → Discover → Add index source):

https://raw.githubusercontent.com/Anciwiz/dsh-multi-quota/main/market/index.json

or from npm / git / a local checkout:

Plugins → Add plugin → dsh-multi-quota
Plugins → Add plugin → git+https://github.com/Anciwiz/dsh-multi-quota.git#v1.9.6
Plugins → Add plugin → local directory (this repository)

If the panel does not show up after installing, hard-refresh the page with Ctrl+Shift+R so the new client bundle is loaded.

Configuration

Setting Meaning
OPENCODE_GO_API_KEY OpenCode Go key; falls back to ~/.dsh/.credentials.yaml
AGY_CLI_PATH Antigravity CLI path; otherwise ~/.dsh/quota-monitor.json → ~/.local/bin/agy → ~/bin/agy → %LOCALAPPDATA%\agy\bin\agy.exe → PATH
~/.dsh/quota-monitor.json optional, { "agyPath": "C:\\path\\to\\agy.exe" }

agy must be logged in once interactively, otherwise /usage returns nothing and the plugin stays on the IDE snapshot.

Routes

Route Cache Content
GET /quota-monitor/usage 60 s OpenCode Go 5 h / week / month
GET /quota-monitor/codex 20 s ChatGPT Plus windows + sample time
GET /quota-monitor/gemini 30 s Gemini pools from the IDE snapshot
GET /quota-monitor/gemini-cli 10 min Gemini pools from the official CLI
GET /quota-monitor/activity 20 s last activity of each desktop client

HEAD answers 204 without loading anything; other methods get 405. Add ?force=1 or x-quota-force: 1 to bypass the cache (still rate-limited by the cooldown). Cached windows past their resetsAt are marked stale and excluded from the "lowest value" and "rate-limited" aggregation.

Privacy

Everything is parsed inside the Host process. No token, cookie, account name or e-mail is ever logged, rendered or returned; the Gemini state.vscdb envelope does contain the account name and e-mail next to the quota fields, and only the quota fields are decoded. Requests only go to the official usage endpoint and the local CLI, and the routes listen on loopback only.

Limitations

  • Windows-first; macOS/Linux lookup paths exist but are untested.
  • The ChatGPT card reads the Codex quota snapshot — this machine has no standalone ChatGPT desktop app, so the number only moves while Codex is used.
  • One agy call takes ~5 s and starts a local language server, hence the 10-minute cache.
  • Percentages are subscription-window usage, not billing amounts.

Development

npm test                                # 29 tests, no real subscription or CLI needed
npm run check:release -- --registry     # source / index / npm version consistency

Requires engines.dsh >= 0.2.2-rc.5; the Host needs Node 20+ (node:sqlite is used internally, which the DSH runtime provides).

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.