@slkiser/opencode-quota 1.0.0

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.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -0
  3. package/dist/data/modelsdev-pricing.min.json +504 -0
  4. package/dist/index.d.ts +10 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +15 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/lib/cache.d.ts +49 -0
  9. package/dist/lib/cache.d.ts.map +1 -0
  10. package/dist/lib/cache.js +127 -0
  11. package/dist/lib/cache.js.map +1 -0
  12. package/dist/lib/config.d.ts +30 -0
  13. package/dist/lib/config.d.ts.map +1 -0
  14. package/dist/lib/config.js +154 -0
  15. package/dist/lib/config.js.map +1 -0
  16. package/dist/lib/copilot.d.ts +25 -0
  17. package/dist/lib/copilot.d.ts.map +1 -0
  18. package/dist/lib/copilot.js +306 -0
  19. package/dist/lib/copilot.js.map +1 -0
  20. package/dist/lib/entries.d.ts +60 -0
  21. package/dist/lib/entries.d.ts.map +1 -0
  22. package/dist/lib/entries.js +8 -0
  23. package/dist/lib/entries.js.map +1 -0
  24. package/dist/lib/firmware.d.ts +15 -0
  25. package/dist/lib/firmware.d.ts.map +1 -0
  26. package/dist/lib/firmware.js +79 -0
  27. package/dist/lib/firmware.js.map +1 -0
  28. package/dist/lib/format.d.ts +16 -0
  29. package/dist/lib/format.d.ts.map +1 -0
  30. package/dist/lib/format.js +99 -0
  31. package/dist/lib/format.js.map +1 -0
  32. package/dist/lib/google-token-cache.d.ts +30 -0
  33. package/dist/lib/google-token-cache.d.ts.map +1 -0
  34. package/dist/lib/google-token-cache.js +100 -0
  35. package/dist/lib/google-token-cache.js.map +1 -0
  36. package/dist/lib/google.d.ts +43 -0
  37. package/dist/lib/google.d.ts.map +1 -0
  38. package/dist/lib/google.js +399 -0
  39. package/dist/lib/google.js.map +1 -0
  40. package/dist/lib/markdown-table.d.ts +8 -0
  41. package/dist/lib/markdown-table.d.ts.map +1 -0
  42. package/dist/lib/markdown-table.js +56 -0
  43. package/dist/lib/markdown-table.js.map +1 -0
  44. package/dist/lib/modelsdev-pricing.d.ts +23 -0
  45. package/dist/lib/modelsdev-pricing.d.ts.map +1 -0
  46. package/dist/lib/modelsdev-pricing.js +32 -0
  47. package/dist/lib/modelsdev-pricing.js.map +1 -0
  48. package/dist/lib/openai.d.ts +33 -0
  49. package/dist/lib/openai.d.ts.map +1 -0
  50. package/dist/lib/openai.js +162 -0
  51. package/dist/lib/openai.js.map +1 -0
  52. package/dist/lib/opencode-auth.d.ts +11 -0
  53. package/dist/lib/opencode-auth.d.ts.map +1 -0
  54. package/dist/lib/opencode-auth.js +27 -0
  55. package/dist/lib/opencode-auth.js.map +1 -0
  56. package/dist/lib/opencode-storage.d.ts +45 -0
  57. package/dist/lib/opencode-storage.d.ts.map +1 -0
  58. package/dist/lib/opencode-storage.js +120 -0
  59. package/dist/lib/opencode-storage.js.map +1 -0
  60. package/dist/lib/quota-command-format.d.ts +14 -0
  61. package/dist/lib/quota-command-format.d.ts.map +1 -0
  62. package/dist/lib/quota-command-format.js +122 -0
  63. package/dist/lib/quota-command-format.js.map +1 -0
  64. package/dist/lib/quota-stats-format.d.ts +9 -0
  65. package/dist/lib/quota-stats-format.d.ts.map +1 -0
  66. package/dist/lib/quota-stats-format.js +244 -0
  67. package/dist/lib/quota-stats-format.js.map +1 -0
  68. package/dist/lib/quota-stats.d.ts +71 -0
  69. package/dist/lib/quota-stats.d.ts.map +1 -0
  70. package/dist/lib/quota-stats.js +270 -0
  71. package/dist/lib/quota-stats.js.map +1 -0
  72. package/dist/lib/quota-status.d.ts +23 -0
  73. package/dist/lib/quota-status.d.ts.map +1 -0
  74. package/dist/lib/quota-status.js +112 -0
  75. package/dist/lib/quota-status.js.map +1 -0
  76. package/dist/lib/toast-format-grouped.d.ts +25 -0
  77. package/dist/lib/toast-format-grouped.d.ts.map +1 -0
  78. package/dist/lib/toast-format-grouped.js +123 -0
  79. package/dist/lib/toast-format-grouped.js.map +1 -0
  80. package/dist/lib/types.d.ts +218 -0
  81. package/dist/lib/types.d.ts.map +1 -0
  82. package/dist/lib/types.js +39 -0
  83. package/dist/lib/types.js.map +1 -0
  84. package/dist/plugin.d.ts +13 -0
  85. package/dist/plugin.d.ts.map +1 -0
  86. package/dist/plugin.js +633 -0
  87. package/dist/plugin.js.map +1 -0
  88. package/dist/providers/copilot.d.ts +8 -0
  89. package/dist/providers/copilot.d.ts.map +1 -0
  90. package/dist/providers/copilot.js +50 -0
  91. package/dist/providers/copilot.js.map +1 -0
  92. package/dist/providers/firmware.d.ts +6 -0
  93. package/dist/providers/firmware.d.ts.map +1 -0
  94. package/dist/providers/firmware.js +52 -0
  95. package/dist/providers/firmware.js.map +1 -0
  96. package/dist/providers/google-antigravity.d.ts +6 -0
  97. package/dist/providers/google-antigravity.d.ts.map +1 -0
  98. package/dist/providers/google-antigravity.js +77 -0
  99. package/dist/providers/google-antigravity.js.map +1 -0
  100. package/dist/providers/openai.d.ts +6 -0
  101. package/dist/providers/openai.d.ts.map +1 -0
  102. package/dist/providers/openai.js +106 -0
  103. package/dist/providers/openai.js.map +1 -0
  104. package/dist/providers/registry.d.ts +8 -0
  105. package/dist/providers/registry.d.ts.map +1 -0
  106. package/dist/providers/registry.js +14 -0
  107. package/dist/providers/registry.js.map +1 -0
  108. package/package.json +71 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # opencode-quota
2
+
3
+ Quota and token tracking for OpenCode providers via Toasts and Commands with no LLM calls.
4
+
5
+ ## What It Does
6
+
7
+ **Quota Toasts** - See your remaining quota at a glance after each assistant response.
8
+
9
+ ![Image of quota toasts](https://github.com/slkiser/opencode-quota/blob/main/toast.png)
10
+
11
+ **Token Report Commands** - Track token usage and estimated costs across sessions.
12
+
13
+ ![Image of /quota and /quota_daily outputs](https://github.com/slkiser/opencode-quota/blob/main/quota.png)
14
+
15
+ ## Installation
16
+
17
+ Add to your `opencode.json`:
18
+
19
+ ```json
20
+ {
21
+ "plugin": ["@slkiser/opencode-quota"]
22
+ }
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ Enable the providers you use:
28
+
29
+ ```jsonc
30
+ {
31
+ "experimental": {
32
+ "quotaToast": {
33
+ "enabledProviders": ["copilot", "openai", "google-antigravity"],
34
+ },
35
+ },
36
+ }
37
+ ```
38
+
39
+ That's it. Toasts appear automatically after main agent responses.
40
+
41
+ ## Commands
42
+
43
+ | Command | Description |
44
+ | ---------------- | ------------------------------------ |
45
+ | `/quota` | Show current quota (verbose) |
46
+ | `/quota_daily` | Token + cost report (last 24 hours) |
47
+ | `/quota_weekly` | Token + cost report (last 7 days) |
48
+ | `/quota_monthly` | Token + cost report (last 30 days) |
49
+ | `/quota_all` | Token + cost report (all history) |
50
+ | `/quota_status` | Diagnostics (config, paths, pricing) |
51
+
52
+ ## Supported Providers
53
+
54
+ | Provider | Config id | Notes |
55
+ | ------------------ | -------------------- | --------------------------------------------- |
56
+ | GitHub Copilot | `copilot` | Uses OpenCode auth\* |
57
+ | OpenAI (Plus/Pro) | `openai` | Uses OpenCode auth |
58
+ | Firmware AI | `firmware` | Uses OpenCode auth |
59
+ | Google Antigravity | `google-antigravity` | Multi-account via `opencode-antigravity-auth` |
60
+
61
+ ### GitHub Copilot Setup (optional)
62
+
63
+ Copilot works with no extra setup as long as OpenCode already has Copilot configured and logged in.
64
+
65
+ _Optional:_ if Copilot quota does not show up (or you want more reliable quota reporting), you can provide a fine-grained PAT so the plugin can use GitHub's public billing API:
66
+
67
+ 1. Create a fine-grained PAT at GitHub with **Account permissions > Plan > Read**
68
+ 2. Create `~/.config/opencode/copilot-quota-token.json`:
69
+
70
+ ```json
71
+ {
72
+ "token": "github_pat_...",
73
+ "username": "your-username",
74
+ "tier": "pro"
75
+ }
76
+ ```
77
+
78
+ Tier options: `free`, `pro`, `pro+`, `business`, `enterprise`
79
+
80
+ \* The plugin reads Copilot auth from OpenCode. The PAT file is only a fallback for reliability.
81
+
82
+ ## Configuration Reference
83
+
84
+ All options go under `experimental.quotaToast` in `opencode.json`:
85
+
86
+ | Option | Default | Description |
87
+ | ------------------ | ------------ | ------------------------------------------- |
88
+ | `enabled` | `true` | Enable/disable plugin |
89
+ | `enableToast` | `true` | Show popup toasts |
90
+ | `enabledProviders` | `[]` | Provider ids to query |
91
+ | `minIntervalMs` | `300000` | Min ms between fetches (5 min) |
92
+ | `toastDurationMs` | `9000` | Toast display time |
93
+ | `onlyCurrentModel` | `false` | Only show current model's quota |
94
+ | `googleModels` | `["CLAUDE"]` | Google models: `CLAUDE`, `G3PRO`, `G3FLASH` |
95
+ | `debug` | `false` | Show debug info in toasts |
96
+
97
+ ## Troubleshooting
98
+
99
+ Toast not appearing? Run `/quota_status` to check config and provider availability.
100
+
101
+ ## License
102
+
103
+ MIT
@@ -0,0 +1,504 @@
1
+ {
2
+ "_meta": {
3
+ "generatedAt": 1768919388015,
4
+ "providers": [
5
+ "openai",
6
+ "anthropic",
7
+ "google",
8
+ "moonshotai",
9
+ "zai"
10
+ ],
11
+ "source": "https://models.dev/api.json",
12
+ "units": "USD per 1M tokens"
13
+ },
14
+ "providers": {
15
+ "anthropic": {
16
+ "claude-2.0": {
17
+ "input": 8,
18
+ "output": 24
19
+ },
20
+ "claude-2.1": {
21
+ "input": 8,
22
+ "output": 24
23
+ },
24
+ "claude-3-5-haiku-20241022": {
25
+ "cache_read": 0.08,
26
+ "cache_write": 1,
27
+ "input": 0.8,
28
+ "output": 4
29
+ },
30
+ "claude-3-5-sonnet-20241022": {
31
+ "cache_read": 0.3,
32
+ "cache_write": 3.75,
33
+ "input": 3,
34
+ "output": 15
35
+ },
36
+ "claude-3-haiku-20240307": {
37
+ "input": 0.25,
38
+ "output": 1.25
39
+ },
40
+ "claude-3-opus-20240229": {
41
+ "input": 15,
42
+ "output": 75
43
+ },
44
+ "claude-3-sonnet-20240229": {
45
+ "input": 3,
46
+ "output": 15
47
+ },
48
+ "claude-opus-4-0": {
49
+ "cache_read": 0.5,
50
+ "cache_write": 6.25,
51
+ "input": 5,
52
+ "output": 25
53
+ },
54
+ "claude-opus-4-1": {
55
+ "cache_read": 1.5,
56
+ "cache_write": 18.75,
57
+ "input": 15,
58
+ "output": 75
59
+ },
60
+ "claude-opus-4-1-20250805": {
61
+ "cache_read": 1.5,
62
+ "cache_write": 18.75,
63
+ "input": 15,
64
+ "output": 75
65
+ },
66
+ "claude-opus-4-20250514": {
67
+ "cache_read": 0.5,
68
+ "cache_write": 6.25,
69
+ "input": 5,
70
+ "output": 25
71
+ },
72
+ "claude-opus-4-5": {
73
+ "cache_read": 0.5,
74
+ "cache_write": 6.25,
75
+ "input": 5,
76
+ "output": 25
77
+ },
78
+ "claude-opus-4-5-20251101": {
79
+ "cache_read": 0.5,
80
+ "cache_write": 6.25,
81
+ "input": 5,
82
+ "output": 25
83
+ },
84
+ "claude-sonnet-4-0": {
85
+ "cache_read": 0.3,
86
+ "cache_write": 3.75,
87
+ "input": 3,
88
+ "output": 15
89
+ },
90
+ "claude-sonnet-4-20250514": {
91
+ "cache_read": 0.3,
92
+ "cache_write": 3.75,
93
+ "input": 3,
94
+ "output": 15
95
+ },
96
+ "claude-sonnet-4-5": {
97
+ "cache_read": 0.3,
98
+ "cache_write": 3.75,
99
+ "input": 3,
100
+ "output": 15
101
+ },
102
+ "claude-sonnet-4-5-20251101": {
103
+ "cache_read": 0.3,
104
+ "cache_write": 3.75,
105
+ "input": 3,
106
+ "output": 15
107
+ },
108
+ "claude-sonnet-4-7": {
109
+ "cache_read": 0.3,
110
+ "cache_write": 3.75,
111
+ "input": 3,
112
+ "output": 15
113
+ },
114
+ "claude-sonnet-4-7-20251101": {
115
+ "cache_read": 0.3,
116
+ "cache_write": 3.75,
117
+ "input": 3,
118
+ "output": 15
119
+ },
120
+ "claude-sonnet-4-20251001": {
121
+ "cache_read": 0.3,
122
+ "cache_write": 3.75,
123
+ "input": 3,
124
+ "output": 15
125
+ }
126
+ },
127
+ "google": {
128
+ "gemini-1.5-flash": {
129
+ "input": 0.075,
130
+ "output": 0.3
131
+ },
132
+ "gemini-1.5-pro": {
133
+ "input": 1.25,
134
+ "output": 5
135
+ },
136
+ "gemini-2.0-flash": {
137
+ "input": 0.1,
138
+ "output": 0.4
139
+ },
140
+ "gemini-2.0-flash-exp": {
141
+ "input": 0.1,
142
+ "output": 0.4
143
+ },
144
+ "gemini-2.0-flash-lite": {
145
+ "input": 0.075,
146
+ "output": 0.3
147
+ },
148
+ "gemini-2.0-pro-exp": {
149
+ "input": 1.25,
150
+ "output": 5
151
+ },
152
+ "gemini-2.5-flash": {
153
+ "input": 0.15,
154
+ "output": 0.6
155
+ },
156
+ "gemini-2.5-flash-exp": {
157
+ "input": 0.15,
158
+ "output": 0.6
159
+ },
160
+ "gemini-2.5-flash-lite": {
161
+ "input": 0.1,
162
+ "output": 0.4
163
+ },
164
+ "gemini-2.5-pro": {
165
+ "input": 1.25,
166
+ "output": 5
167
+ },
168
+ "gemini-2.5-pro-exp": {
169
+ "input": 1.25,
170
+ "output": 5
171
+ },
172
+ "gemini-2.5-pro-preview": {
173
+ "input": 1.25,
174
+ "output": 5
175
+ },
176
+ "gemini-3-flash-preview": {
177
+ "cache_read": 0.05,
178
+ "input": 0.5,
179
+ "output": 3
180
+ },
181
+ "gemini-3-pro-preview": {
182
+ "cache_read": 0.2,
183
+ "input": 2,
184
+ "output": 12
185
+ },
186
+ "gemini-exp-1114": {
187
+ "input": 1.25,
188
+ "output": 5
189
+ },
190
+ "gemini-exp-1121": {
191
+ "input": 1.25,
192
+ "output": 5
193
+ },
194
+ "gemini-exp-1206": {
195
+ "input": 1.25,
196
+ "output": 5
197
+ },
198
+ "gemini-flash-experimental": {
199
+ "input": 0.15,
200
+ "output": 0.6
201
+ },
202
+ "gemini-pro": {
203
+ "input": 1.25,
204
+ "output": 5
205
+ },
206
+ "gemini-pro-vision": {
207
+ "input": 1.25,
208
+ "output": 5
209
+ },
210
+ "gemini-1.0-pro": {
211
+ "input": 1.25,
212
+ "output": 5
213
+ },
214
+ "gemini-1.0-pro-vision": {
215
+ "input": 1.25,
216
+ "output": 5
217
+ },
218
+ "gemini-1.0-ultra": {
219
+ "input": 7,
220
+ "output": 21
221
+ },
222
+ "gemini-1.0-ultra-vision": {
223
+ "input": 7,
224
+ "output": 21
225
+ },
226
+ "gemini-2.0-flash-thinking-exp": {
227
+ "input": 0.1,
228
+ "output": 0.4
229
+ }
230
+ },
231
+ "moonshotai": {
232
+ "kimi-k2-thinking": {
233
+ "cache_read": 0.15,
234
+ "input": 0.6,
235
+ "output": 2.5
236
+ },
237
+ "kimi-k2-0711-preview": {
238
+ "cache_read": 0.15,
239
+ "input": 0.6,
240
+ "output": 2.5
241
+ },
242
+ "kimi-k2-0905-preview": {
243
+ "cache_read": 0.15,
244
+ "input": 0.6,
245
+ "output": 2.5
246
+ },
247
+ "kimi-k2-thinking-turbo": {
248
+ "cache_read": 0.15,
249
+ "input": 1.15,
250
+ "output": 8
251
+ },
252
+ "kimi-k2-turbo-preview": {
253
+ "cache_read": 0.6,
254
+ "input": 2.4,
255
+ "output": 10
256
+ },
257
+ "kimi-k2-chat": {
258
+ "cache_read": 0.15,
259
+ "input": 0.6,
260
+ "output": 2.5
261
+ },
262
+ "moonshot-v1-auto": {
263
+ "input": 2.5,
264
+ "output": 7.5
265
+ },
266
+ "moonshot-v1-128k": {
267
+ "input": 2.5,
268
+ "output": 7.5
269
+ },
270
+ "moonshot-v1-32k": {
271
+ "input": 2.5,
272
+ "output": 7.5
273
+ }
274
+ },
275
+ "openai": {
276
+ "gpt-4o": {
277
+ "cache_read": 1.25,
278
+ "input": 2.5,
279
+ "output": 10
280
+ },
281
+ "gpt-4o-2024-08-06": {
282
+ "cache_read": 1.25,
283
+ "input": 2.5,
284
+ "output": 10
285
+ },
286
+ "gpt-4o-2024-11-20": {
287
+ "cache_read": 1.25,
288
+ "input": 2.5,
289
+ "output": 10
290
+ },
291
+ "gpt-4o-audio-preview": {
292
+ "cache_read": 1.25,
293
+ "input": 2.5,
294
+ "output": 10
295
+ },
296
+ "gpt-4o-mini": {
297
+ "cache_read": 0.075,
298
+ "input": 0.15,
299
+ "output": 0.6
300
+ },
301
+ "gpt-4o-mini-2024-07-18": {
302
+ "cache_read": 0.075,
303
+ "input": 0.15,
304
+ "output": 0.6
305
+ },
306
+ "gpt-4o-mini-audio-preview": {
307
+ "cache_read": 0.075,
308
+ "input": 0.15,
309
+ "output": 0.6
310
+ },
311
+ "gpt-4o-realtime-preview": {
312
+ "cache_read": 1.25,
313
+ "input": 2.5,
314
+ "output": 10
315
+ },
316
+ "gpt-4o-realtime-preview-2024-10-01": {
317
+ "cache_read": 1.25,
318
+ "input": 2.5,
319
+ "output": 10
320
+ },
321
+ "gpt-4o-realtime-preview-2024-12-17": {
322
+ "cache_read": 1.25,
323
+ "input": 2.5,
324
+ "output": 10
325
+ },
326
+ "gpt-5": {
327
+ "cache_read": 0.13,
328
+ "input": 1.25,
329
+ "output": 10
330
+ },
331
+ "gpt-5-chat-latest": {
332
+ "cache_read": 0.13,
333
+ "input": 1.25,
334
+ "output": 10
335
+ },
336
+ "gpt-5-codex": {
337
+ "cache_read": 0.13,
338
+ "input": 1.25,
339
+ "output": 10
340
+ },
341
+ "gpt-5-mini": {
342
+ "cache_read": 0.025,
343
+ "input": 0.25,
344
+ "output": 2
345
+ },
346
+ "gpt-5-nano": {
347
+ "cache_read": 0.005,
348
+ "input": 0.05,
349
+ "output": 0.4
350
+ },
351
+ "gpt-5-pro": {
352
+ "cache_read": 0.5,
353
+ "input": 5,
354
+ "output": 40
355
+ },
356
+ "gpt-5.1": {
357
+ "cache_read": 0.13,
358
+ "input": 1.25,
359
+ "output": 10
360
+ },
361
+ "gpt-5.1-chat-latest": {
362
+ "cache_read": 0.13,
363
+ "input": 1.25,
364
+ "output": 10
365
+ },
366
+ "gpt-5.1-codex": {
367
+ "cache_read": 0.13,
368
+ "input": 1.25,
369
+ "output": 10
370
+ },
371
+ "gpt-5.1-codex-max": {
372
+ "cache_read": 0.13,
373
+ "input": 1.25,
374
+ "output": 10
375
+ },
376
+ "gpt-5.1-codex-mini": {
377
+ "cache_read": 0.025,
378
+ "input": 0.25,
379
+ "output": 2
380
+ },
381
+ "gpt-5.2": {
382
+ "cache_read": 0.175,
383
+ "input": 1.75,
384
+ "output": 14
385
+ },
386
+ "gpt-5.2-chat-latest": {
387
+ "cache_read": 0.175,
388
+ "input": 1.75,
389
+ "output": 14
390
+ },
391
+ "gpt-5.2-codex": {
392
+ "cache_read": 0.175,
393
+ "input": 1.75,
394
+ "output": 14
395
+ },
396
+ "gpt-5.2-pro": {
397
+ "cache_read": 0.2,
398
+ "input": 2,
399
+ "output": 16
400
+ },
401
+ "o1": {
402
+ "cache_read": 3,
403
+ "input": 15,
404
+ "output": 60
405
+ },
406
+ "o1-mini": {
407
+ "cache_read": 1.5,
408
+ "input": 3,
409
+ "output": 12
410
+ },
411
+ "o1-mini-2024-09-12": {
412
+ "cache_read": 1.5,
413
+ "input": 3,
414
+ "output": 12
415
+ },
416
+ "o1-preview": {
417
+ "cache_read": 3,
418
+ "input": 15,
419
+ "output": 60
420
+ },
421
+ "o1-preview-2024-09-12": {
422
+ "cache_read": 3,
423
+ "input": 15,
424
+ "output": 60
425
+ },
426
+ "o3-mini": {
427
+ "cache_read": 0.25,
428
+ "input": 1,
429
+ "output": 4
430
+ },
431
+ "o3-mini-2025-01-31": {
432
+ "cache_read": 0.25,
433
+ "input": 1,
434
+ "output": 4
435
+ },
436
+ "o4-mini": {
437
+ "cache_read": 0.275,
438
+ "input": 1.1,
439
+ "output": 4.4
440
+ },
441
+ "o4-mini-2025-04-16": {
442
+ "cache_read": 0.275,
443
+ "input": 1.1,
444
+ "output": 4.4
445
+ },
446
+ "text-embedding-3-large": {
447
+ "input": 0.13
448
+ },
449
+ "text-embedding-3-small": {
450
+ "input": 0.02
451
+ },
452
+ "text-embedding-ada-002": {
453
+ "input": 0.1
454
+ },
455
+ "whisper-1": {
456
+ "input": 6
457
+ }
458
+ },
459
+ "zai": {
460
+ "glm-4.5": {
461
+ "cache_read": 0.11,
462
+ "cache_write": 0,
463
+ "input": 0.6,
464
+ "output": 2.2
465
+ },
466
+ "glm-4.5-air": {
467
+ "cache_read": 0.03,
468
+ "cache_write": 0,
469
+ "input": 0.15,
470
+ "output": 0.6
471
+ },
472
+ "glm-4.5-flash": {
473
+ "cache_read": 0.016,
474
+ "cache_write": 0,
475
+ "input": 0.08,
476
+ "output": 0.3
477
+ },
478
+ "glm-4.5v": {
479
+ "cache_read": 0.11,
480
+ "cache_write": 0,
481
+ "input": 0.6,
482
+ "output": 2.2
483
+ },
484
+ "glm-4.6": {
485
+ "cache_read": 0.11,
486
+ "cache_write": 0,
487
+ "input": 0.6,
488
+ "output": 2.2
489
+ },
490
+ "glm-4.6v": {
491
+ "cache_read": 0.11,
492
+ "cache_write": 0,
493
+ "input": 0.6,
494
+ "output": 2.2
495
+ },
496
+ "glm-4.7": {
497
+ "cache_read": 0.11,
498
+ "cache_write": 0,
499
+ "input": 0.6,
500
+ "output": 2.2
501
+ }
502
+ }
503
+ }
504
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * OpenCode Quota Plugin
3
+ *
4
+ * Shows quota status in OpenCode without LLM invocation.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ export { QuotaToastPlugin } from "./plugin.js";
9
+ export type { QuotaToastConfig, GoogleModelId, CopilotQuotaResult, GoogleQuotaResult, GoogleModelQuota, } from "./lib/types.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * OpenCode Quota Plugin
3
+ *
4
+ * Shows quota status in OpenCode without LLM invocation.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ // Main plugin export - ONLY export plugin functions from the main entry point
9
+ // OpenCode's plugin loader iterates over all exports and calls them as functions
10
+ export { QuotaToastPlugin } from "./plugin.js";
11
+ // NOTE: tool exports are part of the plugin runtime contract and are not
12
+ // exported from the package entrypoint.
13
+ // NOTE: DEFAULT_CONFIG is NOT exported here because OpenCode's plugin loader
14
+ // would try to call it as a function. Import from "./lib/types.js" directly if needed.
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8EAA8E;AAC9E,iFAAiF;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAW/C,yEAAyE;AACzE,wCAAwC;AAExC,6EAA6E;AAC7E,uFAAuF"}