Repository navigation
Commit 6ac2030
committed
feat(opencode_go_usage): new plugin for OpenCode Go subscription quota
OpenCode Go (opencode.ai/zen/go/v1) ships no public usage endpoint —
anomalyco/opencode#10448 and #18648 are still open upstream. The
plugin works around that with two modes:
1. Sentinel mode (preferred): when ``quota_sentinel_url`` is set the
plugin queries ``/v1/providers/opencode_go`` and lets a shared
quota-sentinel instance handle workspace_id + auth_cookie centrally.
Registers itself with the sentinel using the user-supplied creds
the first time it polls (idempotent — the sentinel deduplicates
instances that present the same fingerprint).
2. Direct mode: when no sentinel URL is given the plugin scrapes
https://opencode.ai/workspace/<workspace_id>/go itself, parsing the
SolidJS SSR hydration payload for rollingUsage / weeklyUsage /
monthlyUsage. Regex patterns ported from slkiser/opencode-quota.
The UI mirrors cerebras_usage / crof_status: three rolling windows
(rolling_5h, weekly, monthly) with a colour-graded utilisation bar,
compact and rotate display modes, and a manual-refresh button press.
Auth cookie is treated as a password-class secret in the manifest so
it doesn't leak into config exports.1 parent 4604b88 commit 6ac2030
3 files changed
Lines changed: 548 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
Loading
0 commit comments