@arandevcode/opencode-quota-extended 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-es.md +70 -3
- package/README.md +70 -3
- package/bin/quota.mjs +6 -7
- package/dist/lib/opencode-go-config.d.ts +19 -0
- package/dist/lib/opencode-go-config.d.ts.map +1 -1
- package/dist/lib/opencode-go-config.js +124 -40
- package/dist/lib/opencode-go-config.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +19 -3
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/opencode-go.d.ts +8 -0
- package/dist/providers/opencode-go.d.ts.map +1 -1
- package/dist/providers/opencode-go.js +77 -70
- package/dist/providers/opencode-go.js.map +1 -1
- package/dist/providers/registry.d.ts +4 -0
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +39 -8
- package/dist/providers/registry.js.map +1 -1
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.tsx +14 -7
- package/dist/ui/SidebarPanel.d.ts.map +1 -1
- package/dist/ui/SidebarPanel.tsx +13 -2
- package/dist/ui/cards.tsx +28 -19
- package/dist/ui/progress-bar.d.ts +1 -1
- package/dist/ui/progress-bar.d.ts.map +1 -1
- package/dist/ui/progress-bar.js +1 -1
- package/dist/ui/progress-bar.js.map +1 -1
- package/package.json +5 -2
- package/dist/config/index.html +0 -26
- package/dist/index.html +0 -29
- package/dist/lib/index.html +0 -46
- package/dist/providers/index.html +0 -34
- package/dist/ui/index.html +0 -24
package/README-es.md
CHANGED
|
@@ -21,10 +21,16 @@ Inspirado por [`@slkiser/opencode-quota`](https://github.com/slkiser/opencode-qu
|
|
|
21
21
|
<p align="center">🐟 <em>“Quien quiera peces que se moje el culo”</em> <sub>— para mi padre, que me enseñó a arremangarme y hacer que las cosas pasen</sub>
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="https://buymeacoffee.com/arandevcode"><strong>☕ Invítame un café</strong></a>
|
|
26
|
+
<br>
|
|
27
|
+
<sub><a href="https://github.com/sponsors/arandevcode">❤️ Sponsor en GitHub</a></sub>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
24
30
|
## Instalación
|
|
25
31
|
|
|
26
32
|
```sh
|
|
27
|
-
opencode plugin @arandevcode/opencode-quota-extended
|
|
33
|
+
opencode plugin --global --force @arandevcode/opencode-quota-extended
|
|
28
34
|
```
|
|
29
35
|
|
|
30
36
|
O instala desde GitHub para seguir el desarrollo más reciente:
|
|
@@ -38,6 +44,44 @@ O instala desde GitHub para seguir el desarrollo más reciente:
|
|
|
38
44
|
}
|
|
39
45
|
```
|
|
40
46
|
|
|
47
|
+
## Desinstalación
|
|
48
|
+
|
|
49
|
+
Cuatro pasos, en orden:
|
|
50
|
+
|
|
51
|
+
1. Quita la entrada del plugin en la config de OpenCode (`~/.config/opencode/opencode.json`):
|
|
52
|
+
|
|
53
|
+
```jsonc
|
|
54
|
+
// borra las líneas de @arandevcode/opencode-quota-extended dentro de "plugin": []
|
|
55
|
+
{
|
|
56
|
+
"plugin": [
|
|
57
|
+
"@arandevcode/opencode-quota-extended", // ← eliminar
|
|
58
|
+
"@arandevcode/opencode-quota-extended/tui", // ← eliminar
|
|
59
|
+
"@arandevcode/opencode-quota-extended/server" // ← eliminar
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. Borra la sidecar de config opcional y el archivo de credenciales de OpenCode Go (solo si los creaste):
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
rm -f ~/.config/opencode/opencode-quota-extended.json
|
|
68
|
+
rm -rf ~/.config/opencode/opencode-quota
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. (Opcional) Borra el binario CLI global si lo instalaste:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npm rm -g @arandevcode/opencode-quota-extended
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
4. (Opcional) Borra cualquier clon local del repo que hayas usado para seguir el desarrollo:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
rm -rf ./opencode-quota-extended
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Reinicia OpenCode y el panel de Quota desaparecerá. **Nota:** el plugin **no** toca `~/.local/share/opencode/auth.json` — tus tokens de auth nunca se modifican.
|
|
84
|
+
|
|
41
85
|
## CLI
|
|
42
86
|
|
|
43
87
|
Visualiza la cuota desde la terminal sin abrir el TUI:
|
|
@@ -55,7 +99,7 @@ npm run quota # desde el directorio del repo
|
|
|
55
99
|
<sub><em>-cli example-</em></sub>
|
|
56
100
|
</p>
|
|
57
101
|
|
|
58
|
-
Colores de semáforo: verde (ok), naranja (advertencia), rojo (error).
|
|
102
|
+
Colores de semáforo: verde (ok), naranja (advertencia), rojo (error). Todos los colores vienen del tema activo de OpenCode — se adaptan automáticamente a la paleta del usuario.
|
|
59
103
|
|
|
60
104
|
## Configuración
|
|
61
105
|
|
|
@@ -79,7 +123,7 @@ Registra un plugin TUI que renderiza un panel `sidebar_content` en la posición
|
|
|
79
123
|
| **GitHub Copilot** | Solicitudes Premium (ventana única) | `auth.json` → entrada `github-copilot` |
|
|
80
124
|
| **OpenCode Go** | 5h, Semanal, Mensual | Archivo de configuración o vars de entorno |
|
|
81
125
|
|
|
82
|
-
Colores de semáforo: ≥50%
|
|
126
|
+
Colores de semáforo: ≥50% `theme.success` (verde), 25-49% `theme.warning` (naranja), <25% `theme.error` (rojo).
|
|
83
127
|
|
|
84
128
|
### Autenticación
|
|
85
129
|
|
|
@@ -101,6 +145,15 @@ Crea `~/.config/opencode/opencode-quota/opencode-go.json`:
|
|
|
101
145
|
| `workspaceId` | ID de tu workspace en OpenCode | Entra en [opencode.ai/go](https://opencode.ai/go). La URL es `https://opencode.ai/workspace/wrk_XXX/go` — copia la parte `wrk_XXX`. |
|
|
102
146
|
| `authCookie` | Cookie de sesión para autenticación | Abre DevTools (F12) → Application → Cookies → `opencode.ai` → busca la cookie `auth` (empieza con `Fe26.2...`). O ejecuta en la consola: `document.cookie.match(/(?:^\|;\s*)auth=([^;]+)/)?.[1]` |
|
|
103
147
|
|
|
148
|
+
**Múltiples workspaces/cuentas:** cualquier archivo `opencode-go-<sufijo>.json` en el mismo directorio añade una sección extra `Opencode GO (<sufijo>)` (p. ej. `opencode-go-work.json` → **Opencode GO (work)**). El `opencode-go.json` base siempre se muestra como **OpenCode Go**.
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
# p. ej. un segundo workspace
|
|
152
|
+
cp ~/.config/opencode/opencode-quota/opencode-go.json \
|
|
153
|
+
~/.config/opencode/opencode-quota/opencode-go-work.json
|
|
154
|
+
# luego edita workspaceId/authCookie dentro de opencode-go-work.json
|
|
155
|
+
```
|
|
156
|
+
|
|
104
157
|
**Setup automatizado** (recomendado):
|
|
105
158
|
```sh
|
|
106
159
|
npm run setup
|
|
@@ -128,6 +181,20 @@ npm test # vitest
|
|
|
128
181
|
npm run typecheck # type-check sin emitir
|
|
129
182
|
```
|
|
130
183
|
|
|
184
|
+
### Patrones TUI y tema
|
|
185
|
+
|
|
186
|
+
Los colores se obtienen en vivo de `api.theme.current`. El mapeo de semáforo respeta el tema:
|
|
187
|
+
|
|
188
|
+
| Restante | Color (clave de tema) | Hex por defecto (AMOLED) |
|
|
189
|
+
|---|---|---|
|
|
190
|
+
| ≥50% | `theme.success` (verde) | `#00ff88` |
|
|
191
|
+
| 25-49% | `theme.warning` (naranja) | `#ffea00` |
|
|
192
|
+
| <25% | `theme.error` (rojo) | `#ff1744` |
|
|
193
|
+
|
|
194
|
+
La barra de progreso sigue el patrón gauge de `opentui-theme-colors`: un `<text>` por celda, `bg={themeColor}` en las celdas llenas y `bg={theme.backgroundElement}` en las vacías, con la etiqueta de porcentaje en primer plano con contraste correcto (`backgroundPanel` en lleno, `textMuted` en vacío). Es el mismo patrón que la barra de contexto en `@arandevcode/opencode-stats`.
|
|
195
|
+
|
|
196
|
+
La barra de ratio antigua con `flexGrow` y los hex hardcodeados (`#6b8e23`, `#ffa500`, `#ff6b6b`) ya no existen.
|
|
197
|
+
|
|
131
198
|
### Estructura del proyecto
|
|
132
199
|
|
|
133
200
|
```
|
package/README.md
CHANGED
|
@@ -22,10 +22,16 @@ Heavily inspired by [`@slkiser/opencode-quota`](https://github.com/slkiser/openc
|
|
|
22
22
|
<em>“If you want fish, get your ass wet”</em> <sub>— for my father, who taught me to roll up my sleeves and get it done</sub>
|
|
23
23
|
</p>
|
|
24
24
|
|
|
25
|
+
<p align="center">
|
|
26
|
+
<a href="https://buymeacoffee.com/arandevcode"><strong>☕ Buy me a coffee</strong></a>
|
|
27
|
+
<br>
|
|
28
|
+
<sub><a href="https://github.com/sponsors/arandevcode">❤️ Sponsor on GitHub</a></sub>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
25
31
|
## Install
|
|
26
32
|
|
|
27
33
|
```sh
|
|
28
|
-
opencode plugin @arandevcode/opencode-quota-extended
|
|
34
|
+
opencode plugin --global --force @arandevcode/opencode-quota-extended
|
|
29
35
|
```
|
|
30
36
|
|
|
31
37
|
Or install from GitHub source to follow latest development:
|
|
@@ -39,6 +45,44 @@ Or install from GitHub source to follow latest development:
|
|
|
39
45
|
}
|
|
40
46
|
```
|
|
41
47
|
|
|
48
|
+
## Uninstall
|
|
49
|
+
|
|
50
|
+
Four steps, in order:
|
|
51
|
+
|
|
52
|
+
1. Remove the plugin entry from your OpenCode config (`~/.config/opencode/opencode.json`):
|
|
53
|
+
|
|
54
|
+
```jsonc
|
|
55
|
+
// delete the @arandevcode/opencode-quota-extended lines inside "plugin": []
|
|
56
|
+
{
|
|
57
|
+
"plugin": [
|
|
58
|
+
"@arandevcode/opencode-quota-extended", // ← remove
|
|
59
|
+
"@arandevcode/opencode-quota-extended/tui", // ← remove
|
|
60
|
+
"@arandevcode/opencode-quota-extended/server" // ← remove
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. Delete the optional sidecar config and OpenCode Go credential file (only if you created them):
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
rm -f ~/.config/opencode/opencode-quota-extended.json
|
|
69
|
+
rm -rf ~/.config/opencode/opencode-quota
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
3. (Optional) Remove the global CLI binary if you installed it:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm rm -g @arandevcode/opencode-quota-extended
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
4. (Optional) Remove any local source clone you may have used to follow development:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
rm -rf ./opencode-quota-extended
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Restart OpenCode and the Quota panel will be gone. **Note:** the plugin does **not** store or touch `~/.local/share/opencode/auth.json` — your auth tokens are never modified.
|
|
85
|
+
|
|
42
86
|
## CLI
|
|
43
87
|
|
|
44
88
|
View quota from the terminal without opening the TUI:
|
|
@@ -56,7 +100,7 @@ npm run quota # from the repo directory
|
|
|
56
100
|
<sub><em>-cli example-</em></sub>
|
|
57
101
|
</p>
|
|
58
102
|
|
|
59
|
-
Traffic-light colors: green (ok), orange (warning), red (error).
|
|
103
|
+
Traffic-light colors: green (ok), orange (warning), red (error). All colors come from the active OpenCode theme — they adapt to the user's palette automatically.
|
|
60
104
|
|
|
61
105
|
## Configuration
|
|
62
106
|
|
|
@@ -80,7 +124,7 @@ Registers a TUI plugin that renders a `sidebar_content` panel at order 145, show
|
|
|
80
124
|
| **GitHub Copilot** | Premium requests (single window) | `auth.json` → `github-copilot` entry |
|
|
81
125
|
| **OpenCode Go** | 5h, Weekly, Monthly | Config file or env vars |
|
|
82
126
|
|
|
83
|
-
Traffic-light colors: ≥50%
|
|
127
|
+
Traffic-light colors: ≥50% `theme.success` (green), 25-49% `theme.warning` (orange), <25% `theme.error` (red).
|
|
84
128
|
|
|
85
129
|
### Authentication
|
|
86
130
|
|
|
@@ -102,6 +146,15 @@ Create `~/.config/opencode/opencode-quota/opencode-go.json`:
|
|
|
102
146
|
| `workspaceId` | Your OpenCode workspace ID | Log in at [opencode.ai/go](https://opencode.ai/go). The URL is `https://opencode.ai/workspace/wrk_XXX/go` — copy the `wrk_XXX` part. |
|
|
103
147
|
| `authCookie` | Session cookie for auth | Open DevTools (F12) → Application → Cookies → `opencode.ai` → find the `auth` cookie (starts with `Fe26.2...`). Or run this in the console: `document.cookie.match(/(?:^\|;\s*)auth=([^;]+)/)?.[1]` |
|
|
104
148
|
|
|
149
|
+
**Multiple workspaces/accounts:** any `opencode-go-<suffix>.json` file in the same directory adds an extra `Opencode GO (<suffix>)` section (e.g. `opencode-go-work.json` → **Opencode GO (work)**). The base `opencode-go.json` always renders as **OpenCode Go**.
|
|
150
|
+
|
|
151
|
+
```sh
|
|
152
|
+
# e.g. a second workspace
|
|
153
|
+
cp ~/.config/opencode/opencode-quota/opencode-go.json \
|
|
154
|
+
~/.config/opencode/opencode-quota/opencode-go-work.json
|
|
155
|
+
# then edit workspaceId/authCookie inside opencode-go-work.json
|
|
156
|
+
```
|
|
157
|
+
|
|
105
158
|
**Automated setup** (recommended):
|
|
106
159
|
```sh
|
|
107
160
|
npm run setup
|
|
@@ -129,6 +182,20 @@ npm test # vitest
|
|
|
129
182
|
npm run typecheck # type-check without emitting
|
|
130
183
|
```
|
|
131
184
|
|
|
185
|
+
### TUI Patterns & Theme
|
|
186
|
+
|
|
187
|
+
Colors are sourced live from `api.theme.current`. The traffic-light mapping is theme-aware:
|
|
188
|
+
|
|
189
|
+
| Remaining | Color (theme key) | Hex default (AMOLED) |
|
|
190
|
+
|---|---|---|
|
|
191
|
+
| ≥50% | `theme.success` (green) | `#00ff88` |
|
|
192
|
+
| 25-49% | `theme.warning` (orange) | `#ffea00` |
|
|
193
|
+
| <25% | `theme.error` (red) | `#ff1744` |
|
|
194
|
+
|
|
195
|
+
The progress bar follows the `opentui-theme-colors` gauge pattern: one `<text>` per cell, `bg={themeColor}` on filled cells and `bg={theme.backgroundElement}` on empty cells, with the percent label rendered in the foreground with proper contrast (`backgroundPanel` on filled, `textMuted` on empty). This is the same pattern as the context progress bar in `@arandevcode/opencode-stats`.
|
|
196
|
+
|
|
197
|
+
The old `flexGrow` ratio bar and the hardcoded hex values (`#6b8e23`, `#ffa500`, `#ff6b6b`) are gone.
|
|
198
|
+
|
|
132
199
|
### Project structure
|
|
133
200
|
|
|
134
201
|
```
|
package/bin/quota.mjs
CHANGED
|
@@ -10,9 +10,9 @@ import { formatResetCombined } from "../dist/lib/reset-format.js";
|
|
|
10
10
|
const INDENT = 4;
|
|
11
11
|
|
|
12
12
|
const COLORS = {
|
|
13
|
-
ok: "\x1b[
|
|
14
|
-
warning: "\x1b[
|
|
15
|
-
error: "\x1b[
|
|
13
|
+
ok: "\x1b[32m",
|
|
14
|
+
warning: "\x1b[33m",
|
|
15
|
+
error: "\x1b[31m",
|
|
16
16
|
};
|
|
17
17
|
const RESET = "\x1b[0m";
|
|
18
18
|
const BOLD = "\x1b[1m";
|
|
@@ -88,10 +88,9 @@ async function main() {
|
|
|
88
88
|
const labelStr = windowLabel(win);
|
|
89
89
|
console.log(" ".repeat(INDENT) + padRight(labelStr, resetStyle));
|
|
90
90
|
console.log(" ".repeat(INDENT) + color + bar.filled + bar.empty + RESET);
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
console.log(" ".repeat(INDENT + pad) + combined + color + leftStr + RESET);
|
|
91
|
+
const leftStr = `${color}${pct}% left${RESET}`;
|
|
92
|
+
const rightStr = `${DIM}${usedPct(pct)}${RESET}`;
|
|
93
|
+
console.log(" ".repeat(INDENT) + padRight(leftStr, rightStr));
|
|
95
94
|
}
|
|
96
95
|
console.log();
|
|
97
96
|
}
|
|
@@ -17,6 +17,25 @@ export type OpenCodeGoConfigResolution = {
|
|
|
17
17
|
} | {
|
|
18
18
|
state: "none";
|
|
19
19
|
};
|
|
20
|
+
/** A named OpenCode Go instance backed by an opencode-go-<suffix>.json file. */
|
|
21
|
+
export interface OpenCodeGoInstance {
|
|
22
|
+
/** Stable id, e.g. "opencode-go-work". */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Display label, e.g. "Opencode GO (work)". */
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/** Resolve the default OpenCode Go config (env vars, then opencode-go.json). */
|
|
20
28
|
export declare function resolveOpenCodeGoConfig(): Promise<OpenCodeGoConfigResolution>;
|
|
29
|
+
/** Resolve the config for a specific instance id. */
|
|
30
|
+
export declare function resolveOpenCodeGoInstance(id: string): Promise<OpenCodeGoConfigResolution>;
|
|
31
|
+
/**
|
|
32
|
+
* Discover additional OpenCode Go instances from opencode-go-<suffix>.json
|
|
33
|
+
* files present in the sidecar directory. Returns stable, deduplicated
|
|
34
|
+
* instance descriptors (first directory with a matching file wins).
|
|
35
|
+
*/
|
|
36
|
+
export declare function discoverOpenCodeGoInstances(): Promise<OpenCodeGoInstance[]>;
|
|
21
37
|
export declare function resolveOpenCodeGoConfigCached(): Promise<OpenCodeGoConfigResolution>;
|
|
38
|
+
export declare function resolveOpenCodeGoInstanceCached(id: string): Promise<OpenCodeGoConfigResolution>;
|
|
39
|
+
/** Clear all cached OpenCode Go config resolutions (used by tests). */
|
|
40
|
+
export declare function clearOpenCodeGoConfigCache(): void;
|
|
22
41
|
//# sourceMappingURL=opencode-go-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-go-config.d.ts","sourceRoot":"","sources":["../../src/lib/opencode-go-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencode-go-config.d.ts","sourceRoot":"","sources":["../../src/lib/opencode-go-config.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,gBAAgB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,0BAA0B,GAClC;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACjE;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAA;CAAE,GAC9E;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtB,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;CACf;AAoGD,gFAAgF;AAChF,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAInF;AAED,qDAAqD;AACrD,wBAAsB,yBAAyB,CAC7C,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,0BAA0B,CAAC,CAErC;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwBjF;AAKD,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAMzF;AAOD,wBAAsB,+BAA+B,CACnD,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,0BAA0B,CAAC,CAOrC;AAED,uEAAuE;AACvE,wBAAgB,0BAA0B,IAAI,IAAI,CAGjD"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { readFile } from "fs/promises";
|
|
1
|
+
import { readFile, readdir } from "fs/promises";
|
|
2
2
|
import { homedir } from "os";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { xdgConfig } from "xdg-basedir";
|
|
5
5
|
const SIDECAR_DIR = "opencode-quota";
|
|
6
|
-
const
|
|
6
|
+
const DEFAULT_FILE = "opencode-go.json";
|
|
7
|
+
const EXTRA_PREFIX = "opencode-go-";
|
|
8
|
+
const EXTRA_LABEL_PREFIX = "Opencode GO";
|
|
9
|
+
const DEFAULT_ID = "opencode-go";
|
|
10
|
+
const DEFAULT_LABEL = "OpenCode Go";
|
|
7
11
|
function getConfigDirCandidates() {
|
|
8
12
|
const dirs = [];
|
|
9
13
|
if (process.env.OPENCODE_CONFIG_DIR) {
|
|
@@ -16,8 +20,21 @@ function getConfigDirCandidates() {
|
|
|
16
20
|
dirs.push(join(homedir(), ".config", "opencode"));
|
|
17
21
|
return Array.from(new Set(dirs));
|
|
18
22
|
}
|
|
19
|
-
function
|
|
20
|
-
return getConfigDirCandidates().map((d) => join(d, SIDECAR_DIR
|
|
23
|
+
function getSidecarDirCandidates() {
|
|
24
|
+
return getConfigDirCandidates().map((d) => join(d, SIDECAR_DIR));
|
|
25
|
+
}
|
|
26
|
+
function getDefaultCandidatePaths() {
|
|
27
|
+
return getSidecarDirCandidates().map((d) => join(d, DEFAULT_FILE));
|
|
28
|
+
}
|
|
29
|
+
function getInstanceCandidatePaths(id) {
|
|
30
|
+
if (id === DEFAULT_ID)
|
|
31
|
+
return getDefaultCandidatePaths();
|
|
32
|
+
if (!id.startsWith(EXTRA_PREFIX))
|
|
33
|
+
return [];
|
|
34
|
+
const suffix = id.slice(EXTRA_PREFIX.length);
|
|
35
|
+
if (!suffix)
|
|
36
|
+
return [];
|
|
37
|
+
return getSidecarDirCandidates().map((d) => join(d, `${EXTRA_PREFIX}${suffix}.json`));
|
|
21
38
|
}
|
|
22
39
|
function fromEnv() {
|
|
23
40
|
const workspaceId = process.env.OPENCODE_GO_WORKSPACE_ID?.trim();
|
|
@@ -33,51 +50,103 @@ function fromEnv() {
|
|
|
33
50
|
missing: workspaceId ? "authCookie" : "workspaceId",
|
|
34
51
|
};
|
|
35
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Read a single sidecar file and parse it into a resolution.
|
|
55
|
+
* Returns null when the file does not exist.
|
|
56
|
+
*/
|
|
57
|
+
async function readFileResolution(path) {
|
|
58
|
+
let raw;
|
|
59
|
+
try {
|
|
60
|
+
raw = await readFile(path, "utf8");
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err.code === "ENOENT")
|
|
64
|
+
return null;
|
|
65
|
+
return {
|
|
66
|
+
state: "invalid",
|
|
67
|
+
source: path,
|
|
68
|
+
error: err instanceof Error ? err.message : String(err),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
let parsed;
|
|
72
|
+
try {
|
|
73
|
+
parsed = JSON.parse(raw);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
return {
|
|
77
|
+
state: "invalid",
|
|
78
|
+
source: path,
|
|
79
|
+
error: err instanceof Error ? err.message : String(err),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
83
|
+
return { state: "invalid", source: path, error: "Config must be a JSON object" };
|
|
84
|
+
}
|
|
85
|
+
const obj = parsed;
|
|
86
|
+
const workspaceId = typeof obj.workspaceId === "string" ? obj.workspaceId.trim() : "";
|
|
87
|
+
const authCookie = typeof obj.authCookie === "string" ? obj.authCookie.trim() : "";
|
|
88
|
+
if (workspaceId && authCookie) {
|
|
89
|
+
return { state: "configured", config: { workspaceId, authCookie }, source: path };
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
state: "incomplete",
|
|
93
|
+
source: path,
|
|
94
|
+
missing: workspaceId ? "authCookie" : "workspaceId",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async function resolveFromPaths(paths) {
|
|
98
|
+
for (const path of paths) {
|
|
99
|
+
const resolution = await readFileResolution(path);
|
|
100
|
+
if (resolution === null)
|
|
101
|
+
continue;
|
|
102
|
+
return resolution;
|
|
103
|
+
}
|
|
104
|
+
return { state: "none" };
|
|
105
|
+
}
|
|
106
|
+
/** Resolve the default OpenCode Go config (env vars, then opencode-go.json). */
|
|
36
107
|
export async function resolveOpenCodeGoConfig() {
|
|
37
108
|
const envResult = fromEnv();
|
|
38
109
|
if (envResult.state !== "none")
|
|
39
110
|
return envResult;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
111
|
+
return resolveFromPaths(getDefaultCandidatePaths());
|
|
112
|
+
}
|
|
113
|
+
/** Resolve the config for a specific instance id. */
|
|
114
|
+
export async function resolveOpenCodeGoInstance(id) {
|
|
115
|
+
return resolveFromPaths(getInstanceCandidatePaths(id));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Discover additional OpenCode Go instances from opencode-go-<suffix>.json
|
|
119
|
+
* files present in the sidecar directory. Returns stable, deduplicated
|
|
120
|
+
* instance descriptors (first directory with a matching file wins).
|
|
121
|
+
*/
|
|
122
|
+
export async function discoverOpenCodeGoInstances() {
|
|
123
|
+
const seen = new Set();
|
|
124
|
+
const instances = [];
|
|
125
|
+
for (const dir of getSidecarDirCandidates()) {
|
|
126
|
+
let entries;
|
|
55
127
|
try {
|
|
56
|
-
|
|
128
|
+
entries = await readdir(dir);
|
|
57
129
|
}
|
|
58
|
-
catch
|
|
59
|
-
|
|
60
|
-
state: "invalid",
|
|
61
|
-
source: path,
|
|
62
|
-
error: err instanceof Error ? err.message : String(err),
|
|
63
|
-
};
|
|
130
|
+
catch {
|
|
131
|
+
continue;
|
|
64
132
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
133
|
+
entries.sort();
|
|
134
|
+
for (const name of entries) {
|
|
135
|
+
if (!name.startsWith(EXTRA_PREFIX))
|
|
136
|
+
continue;
|
|
137
|
+
if (!name.endsWith(".json"))
|
|
138
|
+
continue;
|
|
139
|
+
const suffix = name.slice(EXTRA_PREFIX.length, -".json".length);
|
|
140
|
+
if (!suffix || seen.has(suffix))
|
|
141
|
+
continue;
|
|
142
|
+
seen.add(suffix);
|
|
143
|
+
instances.push({
|
|
144
|
+
id: `${EXTRA_PREFIX}${suffix}`,
|
|
145
|
+
label: `${EXTRA_LABEL_PREFIX} (${suffix})`,
|
|
146
|
+
});
|
|
73
147
|
}
|
|
74
|
-
return {
|
|
75
|
-
state: "incomplete",
|
|
76
|
-
source: path,
|
|
77
|
-
missing: workspaceId ? "authCookie" : "workspaceId",
|
|
78
|
-
};
|
|
79
148
|
}
|
|
80
|
-
return
|
|
149
|
+
return instances;
|
|
81
150
|
}
|
|
82
151
|
let cached = null;
|
|
83
152
|
const CACHE_MAX_AGE_MS = 30_000;
|
|
@@ -89,4 +158,19 @@ export async function resolveOpenCodeGoConfigCached() {
|
|
|
89
158
|
cached = { at: now, value };
|
|
90
159
|
return value;
|
|
91
160
|
}
|
|
161
|
+
const instanceCache = new Map();
|
|
162
|
+
export async function resolveOpenCodeGoInstanceCached(id) {
|
|
163
|
+
const now = Date.now();
|
|
164
|
+
const hit = instanceCache.get(id);
|
|
165
|
+
if (hit && now - hit.at < CACHE_MAX_AGE_MS)
|
|
166
|
+
return hit.value;
|
|
167
|
+
const value = await resolveOpenCodeGoInstance(id);
|
|
168
|
+
instanceCache.set(id, { at: now, value });
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
/** Clear all cached OpenCode Go config resolutions (used by tests). */
|
|
172
|
+
export function clearOpenCodeGoConfigCache() {
|
|
173
|
+
cached = null;
|
|
174
|
+
instanceCache.clear();
|
|
175
|
+
}
|
|
92
176
|
//# sourceMappingURL=opencode-go-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-go-config.js","sourceRoot":"","sources":["../../src/lib/opencode-go-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE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AG,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,GAAG,EAG1B,CAAC;AAEJ,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,EAAU;IAEV,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,CAAC,EAAE,GAAG,gBAAgB;QAAE,OAAO,GAAG,CAAC,KAAK,CAAC;IAC7D,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,0BAA0B;IACxC,MAAM,GAAG,IAAI,CAAC;IACd,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA+E3C,eAAO,MAAM,cAAc,EAAE,QAiG5B,CAAC"}
|
package/dist/providers/openai.js
CHANGED
|
@@ -41,6 +41,20 @@ function windowResetIso(win) {
|
|
|
41
41
|
}
|
|
42
42
|
return undefined;
|
|
43
43
|
}
|
|
44
|
+
function windowLabel(win, fallback) {
|
|
45
|
+
if (!win)
|
|
46
|
+
return fallback;
|
|
47
|
+
const seconds = win.limit_window_seconds;
|
|
48
|
+
if (typeof seconds !== "number")
|
|
49
|
+
return fallback;
|
|
50
|
+
if (seconds === 18_000)
|
|
51
|
+
return "5h";
|
|
52
|
+
if (seconds === 604_800)
|
|
53
|
+
return "Weekly";
|
|
54
|
+
if (seconds >= 2_592_000 && seconds <= 2_678_400)
|
|
55
|
+
return "Monthly";
|
|
56
|
+
return fallback;
|
|
57
|
+
}
|
|
44
58
|
function windowFromData(id, label, win) {
|
|
45
59
|
if (!win)
|
|
46
60
|
return null;
|
|
@@ -119,13 +133,15 @@ export const openaiProvider = {
|
|
|
119
133
|
const rateLimit = (data.rate_limit ?? null);
|
|
120
134
|
const codeReview = (data.code_review_rate_limit ?? null);
|
|
121
135
|
const windows = [];
|
|
122
|
-
const
|
|
136
|
+
const primaryWindowData = rateLimit?.primary_window;
|
|
137
|
+
const primary = windowFromData("5h", windowLabel(primaryWindowData, "5h"), primaryWindowData);
|
|
123
138
|
if (primary)
|
|
124
139
|
windows.push(primary);
|
|
125
|
-
const
|
|
140
|
+
const secondaryWindowData = rateLimit?.secondary_window;
|
|
141
|
+
const secondary = windowFromData("weekly", windowLabel(secondaryWindowData, "Weekly"), secondaryWindowData);
|
|
126
142
|
if (secondary)
|
|
127
143
|
windows.push(secondary);
|
|
128
|
-
const codeReviewPrimary = windowFromData("code-review", "Code Review", codeReview?.primary_window);
|
|
144
|
+
const codeReviewPrimary = windowFromData("code-review", windowLabel(codeReview?.primary_window, "Code Review"), codeReview?.primary_window);
|
|
129
145
|
if (codeReviewPrimary)
|
|
130
146
|
windows.push(codeReviewPrimary);
|
|
131
147
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO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AC,CAAC;YACvC,MAAM,iBAAiB,GAAG,cAAc,CAAC,aAAa,EAAE,WAAW,CAAC,UAAU,EAAE,cAAqD,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,cAAqD,CAAC,CAAC;YAC1N,IAAI,iBAAiB;gBAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YAEvD,OAAO;gBACL,EAAE,EAAE,QAAQ;gBACZ,KAAK;gBACL,MAAM,EAAE,IAAI;gBACZ,OAAO;gBACP,SAAS;aACV,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,EAAE,EAAE,QAAQ;gBACZ,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;gBAC5B,OAAO,EAAE,EAAE;gBACX,SAAS;aACV,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC"}
|
|
@@ -5,8 +5,16 @@
|
|
|
5
5
|
* Requires a workspace ID and auth cookie (either via env vars
|
|
6
6
|
* OPENCODE_GO_WORKSPACE_ID / OPENCODE_GO_AUTH_COOKIE, or a sidecar file at
|
|
7
7
|
* ~/.config/opencode/opencode-quota/opencode-go.json).
|
|
8
|
+
* Additional instances can be configured via opencode-go-<suffix>.json files,
|
|
9
|
+
* each rendered as its own "Opencode Go <suffix>" section.
|
|
8
10
|
* Returns up to 3 windows: 5h (rolling), Weekly, Monthly.
|
|
9
11
|
*/
|
|
10
12
|
import type { Provider } from "./types.js";
|
|
13
|
+
/** Options to create a named OpenCode Go provider instance. */
|
|
14
|
+
export interface OpenCodeGoProviderOptions {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createOpenCodeGoProvider(opts: OpenCodeGoProviderOptions): Provider;
|
|
11
19
|
export declare const opencodeGoProvider: Provider;
|
|
12
20
|
//# sourceMappingURL=opencode-go.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-go.d.ts","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"opencode-go.d.ts","sourceRoot":"","sources":["../../src/providers/opencode-go.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAC;AAyC5D,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,yBAAyB,GAAG,QAAQ,CAgFlF;AAED,eAAO,MAAM,kBAAkB,EAAE,QAG/B,CAAC"}
|