lccc233/dsh-opencode-go-usage ↗★ 0

dsh-opencode-go-usage

OpenCode Go plan usage monitor for DeepSeek Harness: a quota bar under the chat input showing the 5h-rolling, weekly and monthly windows 适合OpenCode Go订阅用户,用于直观监控多窗口滚动额度。

Package
dsh-opencode-go-usage
Compatibility
Unverified
Version
0.1.0
License
MIT
Last updated
Oct 2, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lccc233/dsh-opencode-go-usage

dsh-opencode-go-usage

OpenCode Go plan quota monitor for DeepSeek Harness (DSH) — a Web GUI plugin that puts three threshold-coloured rings right beside the composer's context meter, and expands them into a progress-bar panel on hover.

… [◔ 45%]  [◕ ◕ ◑]
   context   5h-rolling / weekly / monthly
   meter      OpenCode Go quota (this plugin)
Compact (always visible)Detail (hover / focus / click)
Three 14px rings, no text, one per quota window, each filled and coloured by its own used percentage.One 6px progress bar per window with its own description: remaining percentage, reset countdown, sample age and a manual refresh.
  • No model-facing surface: the plugin registers no tool, no system-prompt section and no session event, so it adds zero prompt tokens and does not invalidate the KV cache.
  • The API key never reaches the browser: the host half resolves it through ctx.credentials, calls the upstream endpoint itself, and exposes only the quota numbers on a loopback route.

Data comes from the official quota endpoint GET https://opencode.ai/zen/go/v1/usage with Authorization: Bearer , which answers:

{ "usage": {
    "rolling": { "status": "ok", "percent": 3,  "resetsAt": "2026-10-02T16:18:57.800Z" },
    "weekly":  { "status": "ok", "percent": 1,  "resetsAt": "2026-10-05T00:00:00.000Z" },
    "monthly": { "status": "ok", "percent": 59, "resetsAt": "2026-10-11T12:22:02.000Z" } } }

percent is used percentage; remaining is 100 − percent.


Requirements

  • DSH 0.2.0-rc.2 (the release this plugin was developed and verified against) with the Web GUI profile (@deepseek-ai/dsh-web-app) and the conversation.composer.dock slot, which ships in @deepseek-ai/dsh-client-ui-conversation.
  • An OpenCode Go subscription and its API key, stored where DSH can resolve it — by default under the credential reference OPENCODE_GO_API_KEY (the same reference the llm-pi-ai provider uses). Configure it in Settings → Models, or put it in ~/.dsh/.credentials.yaml, or export it as an environment variable of the same name.
  • Windows, macOS or Linux. Node 22+ for the development checks.

In the compact form each ring is 14px with a 2px stroke and the colour thresholds are /; the desktop profile is the one the Electron application owns, and it is the profile used in the examples.

Installing this plugin is always the same three ingredients:

  1. the package must be resolvable from the profile — ~/.dsh/profiles//node_modules/dsh-opencode-go-usage must exist (a junction/symlink to a checkout, or a real copy);
  2. the profile manifest should record it — a dependencies entry in ~/.dsh/profiles//package.json;
  3. the Loader needs a row — an insert entry in ~/.dsh/profiles//cordis.patch.yml.

Then restart DSH. Config hot-reload only covers rows that are already loaded; a brand-new package enters the Loader graph at boot.

Route A — clone into the plugin directory (recommended)


### Configuration

| Field | Default | Meaning |
| --- | --- | --- |
| `apiKeyEnv` | `OPENCODE_GO_API_KEY` | Credential reference resolved per refresh through `ctx.credentials`; falls back to an environment variable of the same name. |
| `apiKey` | — | Literal key (discouraged: it puts a secret in the patch file). |
| `endpoint` | `https://opencode.ai/zen/go/v1/usage` | Quota endpoint. |
| `refreshMs` | `60000` | Cache lifetime; the browser polls on the same cycle. |
| `timeoutMs` | `10000` | Per-request upstream timeout. |
| `route` | `/opencode-go-usage/snapshot` | Web-server path serving the snapshot. |

# {"plugin":"dsh-opencode-go-usage","version":"0.1.0","route":"/opencode-go-usage/snapshot",

#  "apiKeyEnv":"OPENCODE_GO_API_KEY","endpoint":"https://opencode.ai/zen/go/v1/usage",