@slkiser/opencode-quota 4.0.1 → 4.2.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 (358) hide show
  1. package/README.md +94 -28
  2. package/dist/bin/opencode-quota.d.ts.map +1 -1
  3. package/dist/bin/opencode-quota.js +8 -0
  4. package/dist/bin/opencode-quota.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/lib/anthropic.d.ts.map +1 -1
  8. package/dist/lib/anthropic.js +78 -72
  9. package/dist/lib/anthropic.js.map +1 -1
  10. package/dist/lib/api-key-resolver.d.ts +73 -22
  11. package/dist/lib/api-key-resolver.d.ts.map +1 -1
  12. package/dist/lib/api-key-resolver.js +116 -39
  13. package/dist/lib/api-key-resolver.js.map +1 -1
  14. package/dist/lib/atomic-json.d.ts +3 -1
  15. package/dist/lib/atomic-json.d.ts.map +1 -1
  16. package/dist/lib/atomic-json.js +23 -9
  17. package/dist/lib/atomic-json.js.map +1 -1
  18. package/dist/lib/chutes-config.d.ts.map +1 -1
  19. package/dist/lib/chutes-config.js +2 -4
  20. package/dist/lib/chutes-config.js.map +1 -1
  21. package/dist/lib/chutes.d.ts.map +1 -1
  22. package/dist/lib/chutes.js +28 -23
  23. package/dist/lib/chutes.js.map +1 -1
  24. package/dist/lib/cli-show.d.ts +9 -0
  25. package/dist/lib/cli-show.d.ts.map +1 -1
  26. package/dist/lib/cli-show.js +34 -5
  27. package/dist/lib/cli-show.js.map +1 -1
  28. package/dist/lib/cli-status.d.ts +8 -0
  29. package/dist/lib/cli-status.d.ts.map +1 -0
  30. package/dist/lib/cli-status.js +125 -0
  31. package/dist/lib/cli-status.js.map +1 -0
  32. package/dist/lib/config.d.ts +1 -1
  33. package/dist/lib/config.d.ts.map +1 -1
  34. package/dist/lib/config.js +47 -12
  35. package/dist/lib/config.js.map +1 -1
  36. package/dist/lib/copilot.d.ts +11 -5
  37. package/dist/lib/copilot.d.ts.map +1 -1
  38. package/dist/lib/copilot.js +378 -79
  39. package/dist/lib/copilot.js.map +1 -1
  40. package/dist/lib/deepseek-auth.d.ts.map +1 -1
  41. package/dist/lib/deepseek-auth.js +3 -7
  42. package/dist/lib/deepseek-auth.js.map +1 -1
  43. package/dist/lib/deepseek.d.ts.map +1 -1
  44. package/dist/lib/deepseek.js +22 -17
  45. package/dist/lib/deepseek.js.map +1 -1
  46. package/dist/lib/display-sanitize.d.ts.map +1 -1
  47. package/dist/lib/display-sanitize.js +8 -0
  48. package/dist/lib/display-sanitize.js.map +1 -1
  49. package/dist/lib/entries.d.ts +14 -0
  50. package/dist/lib/entries.d.ts.map +1 -1
  51. package/dist/lib/entries.js.map +1 -1
  52. package/dist/lib/format-utils.d.ts +7 -0
  53. package/dist/lib/format-utils.d.ts.map +1 -1
  54. package/dist/lib/format-utils.js +18 -0
  55. package/dist/lib/format-utils.js.map +1 -1
  56. package/dist/lib/format.d.ts +1 -0
  57. package/dist/lib/format.d.ts.map +1 -1
  58. package/dist/lib/format.js +22 -7
  59. package/dist/lib/format.js.map +1 -1
  60. package/dist/lib/glm-coding-plan.d.ts +18 -0
  61. package/dist/lib/glm-coding-plan.d.ts.map +1 -0
  62. package/dist/lib/glm-coding-plan.js +68 -0
  63. package/dist/lib/glm-coding-plan.js.map +1 -0
  64. package/dist/lib/google-agy-companion.d.ts +4 -25
  65. package/dist/lib/google-agy-companion.d.ts.map +1 -1
  66. package/dist/lib/google-agy-companion.js +47 -272
  67. package/dist/lib/google-agy-companion.js.map +1 -1
  68. package/dist/lib/google-agy.d.ts.map +1 -1
  69. package/dist/lib/google-agy.js +204 -111
  70. package/dist/lib/google-agy.js.map +1 -1
  71. package/dist/lib/google-antigravity-companion.d.ts +4 -25
  72. package/dist/lib/google-antigravity-companion.d.ts.map +1 -1
  73. package/dist/lib/google-antigravity-companion.js +44 -283
  74. package/dist/lib/google-antigravity-companion.js.map +1 -1
  75. package/dist/lib/google-companion-credentials.d.ts +70 -0
  76. package/dist/lib/google-companion-credentials.d.ts.map +1 -0
  77. package/dist/lib/google-companion-credentials.js +265 -0
  78. package/dist/lib/google-companion-credentials.js.map +1 -0
  79. package/dist/lib/google-gemini-cli-companion.d.ts +4 -25
  80. package/dist/lib/google-gemini-cli-companion.d.ts.map +1 -1
  81. package/dist/lib/google-gemini-cli-companion.js +47 -258
  82. package/dist/lib/google-gemini-cli-companion.js.map +1 -1
  83. package/dist/lib/google-gemini-cli.d.ts.map +1 -1
  84. package/dist/lib/google-gemini-cli.js +55 -61
  85. package/dist/lib/google-gemini-cli.js.map +1 -1
  86. package/dist/lib/google-token-cache.d.ts.map +1 -1
  87. package/dist/lib/google-token-cache.js +87 -34
  88. package/dist/lib/google-token-cache.js.map +1 -1
  89. package/dist/lib/google.d.ts.map +1 -1
  90. package/dist/lib/google.js +80 -84
  91. package/dist/lib/google.js.map +1 -1
  92. package/dist/lib/grouped-entry-normalization.d.ts.map +1 -1
  93. package/dist/lib/grouped-entry-normalization.js +7 -1
  94. package/dist/lib/grouped-entry-normalization.js.map +1 -1
  95. package/dist/lib/http.d.ts +12 -7
  96. package/dist/lib/http.d.ts.map +1 -1
  97. package/dist/lib/http.js +28 -15
  98. package/dist/lib/http.js.map +1 -1
  99. package/dist/lib/init-installer.d.ts +2 -1
  100. package/dist/lib/init-installer.d.ts.map +1 -1
  101. package/dist/lib/init-installer.js +29 -2
  102. package/dist/lib/init-installer.js.map +1 -1
  103. package/dist/lib/kimi-auth.d.ts +3 -26
  104. package/dist/lib/kimi-auth.d.ts.map +1 -1
  105. package/dist/lib/kimi-auth.js +24 -91
  106. package/dist/lib/kimi-auth.js.map +1 -1
  107. package/dist/lib/kimi.d.ts.map +1 -1
  108. package/dist/lib/kimi.js +20 -15
  109. package/dist/lib/kimi.js.map +1 -1
  110. package/dist/lib/maintainer-announcements.d.ts.map +1 -1
  111. package/dist/lib/maintainer-announcements.js +5 -0
  112. package/dist/lib/maintainer-announcements.js.map +1 -1
  113. package/dist/lib/map-with-concurrency.d.ts +2 -0
  114. package/dist/lib/map-with-concurrency.d.ts.map +1 -0
  115. package/dist/lib/map-with-concurrency.js +17 -0
  116. package/dist/lib/map-with-concurrency.js.map +1 -0
  117. package/dist/lib/mimo-config.d.ts +29 -0
  118. package/dist/lib/mimo-config.d.ts.map +1 -0
  119. package/dist/lib/mimo-config.js +147 -0
  120. package/dist/lib/mimo-config.js.map +1 -0
  121. package/dist/lib/mimo.d.ts +35 -0
  122. package/dist/lib/mimo.d.ts.map +1 -0
  123. package/dist/lib/mimo.js +236 -0
  124. package/dist/lib/mimo.js.map +1 -0
  125. package/dist/lib/modelsdev-pricing.d.ts.map +1 -1
  126. package/dist/lib/modelsdev-pricing.js +39 -27
  127. package/dist/lib/modelsdev-pricing.js.map +1 -1
  128. package/dist/lib/nanogpt-config.d.ts.map +1 -1
  129. package/dist/lib/nanogpt-config.js +2 -4
  130. package/dist/lib/nanogpt-config.js.map +1 -1
  131. package/dist/lib/nanogpt.d.ts.map +1 -1
  132. package/dist/lib/nanogpt.js +40 -30
  133. package/dist/lib/nanogpt.js.map +1 -1
  134. package/dist/lib/ollama-cloud.d.ts +1 -1
  135. package/dist/lib/ollama-cloud.d.ts.map +1 -1
  136. package/dist/lib/ollama-cloud.js +73 -68
  137. package/dist/lib/ollama-cloud.js.map +1 -1
  138. package/dist/lib/openai.d.ts.map +1 -1
  139. package/dist/lib/openai.js +53 -48
  140. package/dist/lib/openai.js.map +1 -1
  141. package/dist/lib/opencode-config-providers.d.ts.map +1 -1
  142. package/dist/lib/opencode-config-providers.js +13 -16
  143. package/dist/lib/opencode-config-providers.js.map +1 -1
  144. package/dist/lib/opencode-config-read.d.ts +23 -0
  145. package/dist/lib/opencode-config-read.d.ts.map +1 -0
  146. package/dist/lib/opencode-config-read.js +30 -0
  147. package/dist/lib/opencode-config-read.js.map +1 -0
  148. package/dist/lib/opencode-go.d.ts.map +1 -1
  149. package/dist/lib/opencode-go.js +44 -39
  150. package/dist/lib/opencode-go.js.map +1 -1
  151. package/dist/lib/opencode-zen-config.d.ts +34 -0
  152. package/dist/lib/opencode-zen-config.d.ts.map +1 -0
  153. package/dist/lib/opencode-zen-config.js +103 -0
  154. package/dist/lib/opencode-zen-config.js.map +1 -0
  155. package/dist/lib/opencode-zen.d.ts +27 -0
  156. package/dist/lib/opencode-zen.d.ts.map +1 -0
  157. package/dist/lib/opencode-zen.js +143 -0
  158. package/dist/lib/opencode-zen.js.map +1 -0
  159. package/dist/lib/openrouter.d.ts +13 -0
  160. package/dist/lib/openrouter.d.ts.map +1 -0
  161. package/dist/lib/openrouter.js +41 -0
  162. package/dist/lib/openrouter.js.map +1 -0
  163. package/dist/lib/provider-add-command.d.ts.map +1 -1
  164. package/dist/lib/provider-add-command.js +4 -12
  165. package/dist/lib/provider-add-command.js.map +1 -1
  166. package/dist/lib/provider-add-json-v1-questionnaire.d.ts +32 -0
  167. package/dist/lib/provider-add-json-v1-questionnaire.d.ts.map +1 -0
  168. package/dist/lib/provider-add-json-v1-questionnaire.js +336 -0
  169. package/dist/lib/provider-add-json-v1-questionnaire.js.map +1 -0
  170. package/dist/lib/provider-availability.d.ts +2 -2
  171. package/dist/lib/provider-availability.d.ts.map +1 -1
  172. package/dist/lib/provider-availability.js +2 -3
  173. package/dist/lib/provider-availability.js.map +1 -1
  174. package/dist/lib/provider-metadata.d.ts +300 -1
  175. package/dist/lib/provider-metadata.d.ts.map +1 -1
  176. package/dist/lib/provider-metadata.js +332 -227
  177. package/dist/lib/provider-metadata.js.map +1 -1
  178. package/dist/lib/quota-command-format.d.ts.map +1 -1
  179. package/dist/lib/quota-command-format.js +12 -16
  180. package/dist/lib/quota-command-format.js.map +1 -1
  181. package/dist/lib/quota-dialog-commands.d.ts +59 -2
  182. package/dist/lib/quota-dialog-commands.d.ts.map +1 -1
  183. package/dist/lib/quota-dialog-commands.js +73 -39
  184. package/dist/lib/quota-dialog-commands.js.map +1 -1
  185. package/dist/lib/quota-entry-display.d.ts +2 -0
  186. package/dist/lib/quota-entry-display.d.ts.map +1 -1
  187. package/dist/lib/quota-entry-display.js +27 -13
  188. package/dist/lib/quota-entry-display.js.map +1 -1
  189. package/dist/lib/quota-providers-remote.d.ts +0 -1
  190. package/dist/lib/quota-providers-remote.d.ts.map +1 -1
  191. package/dist/lib/quota-providers-remote.js +3 -16
  192. package/dist/lib/quota-providers-remote.js.map +1 -1
  193. package/dist/lib/quota-render-data.d.ts +4 -0
  194. package/dist/lib/quota-render-data.d.ts.map +1 -1
  195. package/dist/lib/quota-render-data.js +118 -127
  196. package/dist/lib/quota-render-data.js.map +1 -1
  197. package/dist/lib/quota-runtime-context.d.ts +9 -1
  198. package/dist/lib/quota-runtime-context.d.ts.map +1 -1
  199. package/dist/lib/quota-runtime-context.js +5 -0
  200. package/dist/lib/quota-runtime-context.js.map +1 -1
  201. package/dist/lib/quota-state.d.ts.map +1 -1
  202. package/dist/lib/quota-state.js +25 -1
  203. package/dist/lib/quota-state.js.map +1 -1
  204. package/dist/lib/quota-stats.d.ts +1 -0
  205. package/dist/lib/quota-stats.d.ts.map +1 -1
  206. package/dist/lib/quota-stats.js +14 -4
  207. package/dist/lib/quota-stats.js.map +1 -1
  208. package/dist/lib/quota-status.d.ts +7 -17
  209. package/dist/lib/quota-status.d.ts.map +1 -1
  210. package/dist/lib/quota-status.js +123 -948
  211. package/dist/lib/quota-status.js.map +1 -1
  212. package/dist/lib/runtime-provider-ids.d.ts +4 -0
  213. package/dist/lib/runtime-provider-ids.d.ts.map +1 -0
  214. package/dist/lib/runtime-provider-ids.js +10 -0
  215. package/dist/lib/runtime-provider-ids.js.map +1 -0
  216. package/dist/lib/session-tokens.d.ts +2 -0
  217. package/dist/lib/session-tokens.d.ts.map +1 -1
  218. package/dist/lib/session-tokens.js +4 -2
  219. package/dist/lib/session-tokens.js.map +1 -1
  220. package/dist/lib/synthetic-config.d.ts.map +1 -1
  221. package/dist/lib/synthetic-config.js +2 -4
  222. package/dist/lib/synthetic-config.js.map +1 -1
  223. package/dist/lib/synthetic.d.ts.map +1 -1
  224. package/dist/lib/synthetic.js +37 -32
  225. package/dist/lib/synthetic.js.map +1 -1
  226. package/dist/lib/toast-format-grouped.d.ts +1 -0
  227. package/dist/lib/toast-format-grouped.d.ts.map +1 -1
  228. package/dist/lib/toast-format-grouped.js +33 -29
  229. package/dist/lib/toast-format-grouped.js.map +1 -1
  230. package/dist/lib/tui-refresh-lifecycle.d.ts +17 -0
  231. package/dist/lib/tui-refresh-lifecycle.d.ts.map +1 -0
  232. package/dist/lib/tui-refresh-lifecycle.js +83 -0
  233. package/dist/lib/tui-refresh-lifecycle.js.map +1 -0
  234. package/dist/lib/tui-runtime.d.ts +0 -5
  235. package/dist/lib/tui-runtime.d.ts.map +1 -1
  236. package/dist/lib/tui-runtime.js +1 -6
  237. package/dist/lib/tui-runtime.js.map +1 -1
  238. package/dist/lib/tui-sidebar-format.d.ts +1 -1
  239. package/dist/lib/tui-sidebar-format.d.ts.map +1 -1
  240. package/dist/lib/tui-sidebar-format.js +1 -0
  241. package/dist/lib/tui-sidebar-format.js.map +1 -1
  242. package/dist/lib/types.d.ts +72 -8
  243. package/dist/lib/types.d.ts.map +1 -1
  244. package/dist/lib/types.js +2 -0
  245. package/dist/lib/types.js.map +1 -1
  246. package/dist/lib/xai.d.ts +39 -0
  247. package/dist/lib/xai.d.ts.map +1 -0
  248. package/dist/lib/xai.js +153 -0
  249. package/dist/lib/xai.js.map +1 -0
  250. package/dist/lib/zai-auth.d.ts +3 -26
  251. package/dist/lib/zai-auth.d.ts.map +1 -1
  252. package/dist/lib/zai-auth.js +24 -94
  253. package/dist/lib/zai-auth.js.map +1 -1
  254. package/dist/lib/zai.d.ts +1 -8
  255. package/dist/lib/zai.d.ts.map +1 -1
  256. package/dist/lib/zai.js +11 -91
  257. package/dist/lib/zai.js.map +1 -1
  258. package/dist/lib/zhipu-auth.d.ts +3 -26
  259. package/dist/lib/zhipu-auth.d.ts.map +1 -1
  260. package/dist/lib/zhipu-auth.js +24 -94
  261. package/dist/lib/zhipu-auth.js.map +1 -1
  262. package/dist/lib/zhipu.d.ts +1 -8
  263. package/dist/lib/zhipu.d.ts.map +1 -1
  264. package/dist/lib/zhipu.js +10 -84
  265. package/dist/lib/zhipu.js.map +1 -1
  266. package/dist/plugin.d.ts.map +1 -1
  267. package/dist/plugin.js +20 -145
  268. package/dist/plugin.js.map +1 -1
  269. package/dist/providers/alibaba-coding-plan.d.ts.map +1 -1
  270. package/dist/providers/alibaba-coding-plan.js +33 -6
  271. package/dist/providers/alibaba-coding-plan.js.map +1 -1
  272. package/dist/providers/anthropic.d.ts.map +1 -1
  273. package/dist/providers/anthropic.js +35 -7
  274. package/dist/providers/anthropic.js.map +1 -1
  275. package/dist/providers/chutes.d.ts.map +1 -1
  276. package/dist/providers/chutes.js +10 -3
  277. package/dist/providers/chutes.js.map +1 -1
  278. package/dist/providers/copilot.d.ts.map +1 -1
  279. package/dist/providers/copilot.js +102 -31
  280. package/dist/providers/copilot.js.map +1 -1
  281. package/dist/providers/cursor.d.ts.map +1 -1
  282. package/dist/providers/cursor.js +34 -6
  283. package/dist/providers/cursor.js.map +1 -1
  284. package/dist/providers/deepseek.d.ts.map +1 -1
  285. package/dist/providers/deepseek.js +10 -3
  286. package/dist/providers/deepseek.js.map +1 -1
  287. package/dist/providers/glm-coding-plan-provider.d.ts +44 -0
  288. package/dist/providers/glm-coding-plan-provider.d.ts.map +1 -0
  289. package/dist/providers/glm-coding-plan-provider.js +62 -0
  290. package/dist/providers/glm-coding-plan-provider.js.map +1 -0
  291. package/dist/providers/google-agy.d.ts.map +1 -1
  292. package/dist/providers/google-agy.js +83 -42
  293. package/dist/providers/google-agy.js.map +1 -1
  294. package/dist/providers/google-antigravity.d.ts.map +1 -1
  295. package/dist/providers/google-antigravity.js +31 -6
  296. package/dist/providers/google-antigravity.js.map +1 -1
  297. package/dist/providers/google-gemini-cli.d.ts.map +1 -1
  298. package/dist/providers/google-gemini-cli.js +24 -6
  299. package/dist/providers/google-gemini-cli.js.map +1 -1
  300. package/dist/providers/kimi-code.d.ts.map +1 -1
  301. package/dist/providers/kimi-code.js +27 -8
  302. package/dist/providers/kimi-code.js.map +1 -1
  303. package/dist/providers/mimo.d.ts +3 -0
  304. package/dist/providers/mimo.d.ts.map +1 -0
  305. package/dist/providers/mimo.js +127 -0
  306. package/dist/providers/mimo.js.map +1 -0
  307. package/dist/providers/minimax-coding-plan.d.ts.map +1 -1
  308. package/dist/providers/minimax-coding-plan.js +68 -32
  309. package/dist/providers/minimax-coding-plan.js.map +1 -1
  310. package/dist/providers/nanogpt.d.ts.map +1 -1
  311. package/dist/providers/nanogpt.js +41 -4
  312. package/dist/providers/nanogpt.js.map +1 -1
  313. package/dist/providers/openai.d.ts.map +1 -1
  314. package/dist/providers/openai.js +20 -3
  315. package/dist/providers/openai.js.map +1 -1
  316. package/dist/providers/opencode-go.d.ts.map +1 -1
  317. package/dist/providers/opencode-go.js +33 -15
  318. package/dist/providers/opencode-go.js.map +1 -1
  319. package/dist/providers/opencode-zen.d.ts +3 -0
  320. package/dist/providers/opencode-zen.d.ts.map +1 -0
  321. package/dist/providers/opencode-zen.js +99 -0
  322. package/dist/providers/opencode-zen.js.map +1 -0
  323. package/dist/providers/openrouter.d.ts +6 -0
  324. package/dist/providers/openrouter.d.ts.map +1 -0
  325. package/dist/providers/openrouter.js +25 -0
  326. package/dist/providers/openrouter.js.map +1 -0
  327. package/dist/providers/quota-providers.d.ts.map +1 -1
  328. package/dist/providers/quota-providers.js +3 -3
  329. package/dist/providers/quota-providers.js.map +1 -1
  330. package/dist/providers/qwen-code.d.ts.map +1 -1
  331. package/dist/providers/qwen-code.js +19 -5
  332. package/dist/providers/qwen-code.js.map +1 -1
  333. package/dist/providers/registry.d.ts.map +1 -1
  334. package/dist/providers/registry.js +8 -0
  335. package/dist/providers/registry.js.map +1 -1
  336. package/dist/providers/result-helpers.d.ts +29 -1
  337. package/dist/providers/result-helpers.d.ts.map +1 -1
  338. package/dist/providers/result-helpers.js +69 -0
  339. package/dist/providers/result-helpers.js.map +1 -1
  340. package/dist/providers/synthetic.d.ts.map +1 -1
  341. package/dist/providers/synthetic.js +10 -3
  342. package/dist/providers/synthetic.js.map +1 -1
  343. package/dist/providers/xai.d.ts +6 -0
  344. package/dist/providers/xai.d.ts.map +1 -0
  345. package/dist/providers/xai.js +51 -0
  346. package/dist/providers/xai.js.map +1 -0
  347. package/dist/providers/zai.d.ts +1 -7
  348. package/dist/providers/zai.d.ts.map +1 -1
  349. package/dist/providers/zai.js +11 -46
  350. package/dist/providers/zai.js.map +1 -1
  351. package/dist/providers/zhipu.d.ts +1 -7
  352. package/dist/providers/zhipu.d.ts.map +1 -1
  353. package/dist/providers/zhipu.js +11 -46
  354. package/dist/providers/zhipu.js.map +1 -1
  355. package/dist/tui.d.ts.map +1 -1
  356. package/dist/tui.js +47 -136
  357. package/dist/tui.tsx +62 -179
  358. package/package.json +1 -1
@@ -1,257 +1,362 @@
1
- export const QUOTA_PROVIDER_LABELS = {
2
- anthropic: "Anthropic",
3
- openai: "OpenAI",
4
- copilot: "Copilot",
5
- "google-antigravity": "Google",
6
- "google-gemini-cli": "Gemini CLI",
7
- "google-agy": "Google AGY",
8
- synthetic: "Synthetic",
9
- chutes: "Chutes",
10
- cursor: "Cursor",
11
- "qwen-code": "Qwen",
12
- "alibaba-coding-plan": "Alibaba Coding Plan",
13
- zai: "Z.ai",
14
- zhipu: "Zhipu",
15
- nanogpt: "NanoGPT",
16
- "minimax-coding-plan": "MiniMax Coding Plan",
17
- "minimax-china-coding-plan": "MiniMax Coding Plan (CN)",
18
- "minimax-cn-coding-plan": "MiniMax Coding Plan (CN)",
19
- "kimi-for-coding": "Kimi Code",
20
- "kimi-code": "Kimi Code",
21
- deepseek: "DeepSeek",
22
- "opencode-go": "OpenCode Go",
23
- "ollama-cloud": "Ollama Cloud",
24
- "quota-providers": "Quota providers",
25
- };
26
- export const QUOTA_PROVIDER_ID_SYNONYMS = {
27
- "github-copilot": "copilot",
28
- "copilot-chat": "copilot",
29
- "github-copilot-chat": "copilot",
30
- "cursor-acp": "cursor",
31
- "open-cursor": "cursor",
32
- "@rama_nigg/open-cursor": "cursor",
33
- claude: "anthropic",
34
- "claude-code": "anthropic",
35
- qwen: "qwen-code",
36
- alibaba: "alibaba-coding-plan",
37
- "nano-gpt": "nanogpt",
38
- minimax: "minimax-coding-plan",
39
- "minimax-cn": "minimax-china-coding-plan",
40
- "minimax-china": "minimax-china-coding-plan",
41
- "minimax-cn-coding-plan": "minimax-china-coding-plan",
42
- kimi: "kimi-for-coding",
43
- "kimi-for-code": "kimi-for-coding",
44
- "kimi-code": "kimi-for-coding",
45
- "deep-seek": "deepseek",
46
- "opencode-go-subscription": "opencode-go",
47
- "gemini-cli": "google-gemini-cli",
48
- "google-gemini": "google-gemini-cli",
49
- "opencode-gemini-auth": "google-gemini-cli",
50
- gemini: "google-gemini-cli",
51
- "opencode-agy-auth": "google-agy",
52
- "google-agy-auth": "google-agy",
53
- "glm-coding-plan": "zhipu",
54
- "zhipu-coding-plan": "zhipu",
55
- "zhipuai-coding-plan": "zhipu",
56
- };
57
- export const QUOTA_PROVIDER_RUNTIME_IDS = {
58
- anthropic: ["anthropic"],
59
- copilot: ["copilot", "github-copilot", "copilot-chat", "github-copilot-chat"],
60
- openai: ["openai", "chatgpt", "codex"],
61
- cursor: ["cursor", "cursor-acp"],
62
- "qwen-code": ["qwen-code"],
63
- "alibaba-coding-plan": ["alibaba-coding-plan"],
64
- synthetic: ["synthetic"],
65
- chutes: ["chutes", "chutes-ai"],
66
- "google-antigravity": ["google-antigravity", "google", "antigravity"],
67
- "google-gemini-cli": [
68
- "google-gemini-cli",
69
- "gemini-cli",
70
- "gemini",
71
- "opencode-gemini-auth",
72
- "google",
73
- ],
74
- "google-agy": ["google-agy", "opencode-agy-auth", "google-agy-auth"],
75
- zai: ["zai", "glm", "zai-coding-plan"],
76
- zhipu: ["zhipu", "glm-coding-plan", "zhipu-coding-plan", "zhipuai-coding-plan"],
77
- nanogpt: ["nanogpt", "nano-gpt"],
78
- "minimax-coding-plan": ["minimax-coding-plan", "minimax"],
79
- "minimax-china-coding-plan": [
80
- "minimax-china-coding-plan",
81
- "minimax-cn-coding-plan",
82
- "minimax-cn",
83
- "minimax-china",
84
- ],
85
- "kimi-for-coding": ["kimi-for-coding", "kimi", "kimi-code"],
86
- deepseek: ["deepseek"],
87
- "opencode-go": ["opencode-go"],
88
- "ollama-cloud": ["ollama-cloud"],
89
- "quota-providers": [],
90
- };
91
- const LIVE_LOCAL_USAGE_PROVIDER_ID_SET = new Set([
92
- "qwen-code",
93
- "alibaba-coding-plan",
94
- "cursor",
95
- ]);
96
- export const QUOTA_PROVIDER_SHAPES = [
97
- {
98
- id: "anthropic",
99
- autoSetup: "needs_quick_setup",
100
- authentication: "local_cli_auth",
101
- quota: "local_cli_report",
102
- quickSetupAnchor: "anthropic-claude",
1
+ const PROVIDER_CATALOG_SOURCE = {
2
+ anthropic: {
3
+ label: "Anthropic",
4
+ runtimeIds: ["anthropic"],
5
+ synonyms: ["claude", "claude-code"],
6
+ shape: {
7
+ autoSetup: "needs_quick_setup",
8
+ authentication: "local_cli_auth",
9
+ quota: "local_cli_report",
10
+ quickSetupAnchor: "anthropic-claude",
11
+ },
12
+ },
13
+ copilot: {
14
+ label: "Copilot",
15
+ runtimeIds: ["copilot", "github-copilot", "copilot-chat", "github-copilot-chat"],
16
+ synonyms: ["github-copilot", "copilot-chat", "github-copilot-chat"],
17
+ shape: {
18
+ autoSetup: "usually",
19
+ authentication: "github_oauth_or_pat",
20
+ quota: "remote_api",
21
+ notes: "OAuth for personal flow; PAT for managed billing",
22
+ },
23
+ },
24
+ openai: {
25
+ label: "OpenAI",
26
+ runtimeIds: ["openai", "chatgpt", "codex"],
27
+ synonyms: [],
28
+ shape: {
29
+ autoSetup: "yes",
30
+ authentication: "opencode_auth_oauth_token",
31
+ quota: "remote_api",
32
+ },
33
+ },
34
+ openrouter: {
35
+ label: "OpenRouter",
36
+ runtimeIds: ["openrouter"],
37
+ synonyms: [],
38
+ shape: {
39
+ autoSetup: "yes",
40
+ authentication: "opencode_auth_api_key",
41
+ authFallbacks: ["env_api_key", "global_opencode_config"],
42
+ quota: "remote_api",
43
+ },
44
+ },
45
+ cursor: {
46
+ label: "Cursor",
47
+ runtimeIds: ["cursor", "cursor-acp"],
48
+ synonyms: ["cursor-acp", "open-cursor", "@rama_nigg/open-cursor"],
49
+ liveLocalUsage: true,
50
+ shape: {
51
+ autoSetup: "needs_quick_setup",
52
+ authentication: "companion_auth_oauth_token",
53
+ quota: "local_runtime_accounting",
54
+ quickSetupAnchor: "cursor",
55
+ notes: "companion runtime/plugin integration plus local usage accounting",
56
+ },
103
57
  },
104
- {
105
- id: "copilot",
106
- autoSetup: "usually",
107
- authentication: "github_oauth_or_pat",
108
- quota: "remote_api",
109
- notes: "OAuth for personal flow; PAT for managed billing",
58
+ "qwen-code": {
59
+ label: "Qwen",
60
+ runtimeIds: ["qwen-code"],
61
+ synonyms: ["qwen"],
62
+ liveLocalUsage: true,
63
+ shape: {
64
+ autoSetup: "needs_quick_setup",
65
+ authentication: "companion_auth_oauth_token",
66
+ quota: "local_estimation",
67
+ quickSetupAnchor: "qwen-code",
68
+ },
110
69
  },
111
- {
112
- id: "openai",
113
- autoSetup: "yes",
114
- authentication: "opencode_auth_oauth_token",
115
- quota: "remote_api",
70
+ "alibaba-coding-plan": {
71
+ label: "Alibaba Coding Plan",
72
+ runtimeIds: ["alibaba-coding-plan"],
73
+ synonyms: ["alibaba"],
74
+ liveLocalUsage: true,
75
+ shape: {
76
+ autoSetup: "yes",
77
+ authentication: "opencode_auth_api_key",
78
+ authFallbacks: ["env_api_key", "global_opencode_config"],
79
+ quota: "local_estimation",
80
+ },
116
81
  },
117
- {
118
- id: "cursor",
119
- autoSetup: "needs_quick_setup",
120
- authentication: "companion_auth_oauth_token",
121
- quota: "local_runtime_accounting",
122
- quickSetupAnchor: "cursor",
123
- notes: "companion runtime/plugin integration plus local usage accounting",
82
+ synthetic: {
83
+ label: "Synthetic",
84
+ runtimeIds: ["synthetic"],
85
+ synonyms: [],
86
+ shape: {
87
+ autoSetup: "yes",
88
+ authentication: "opencode_auth_api_key",
89
+ authFallbacks: ["env_api_key", "global_opencode_config"],
90
+ quota: "remote_api",
91
+ },
124
92
  },
125
- {
126
- id: "qwen-code",
127
- autoSetup: "needs_quick_setup",
128
- authentication: "companion_auth_oauth_token",
129
- quota: "local_estimation",
130
- quickSetupAnchor: "qwen-code",
93
+ chutes: {
94
+ label: "Chutes",
95
+ runtimeIds: ["chutes", "chutes-ai"],
96
+ synonyms: [],
97
+ shape: {
98
+ autoSetup: "usually",
99
+ authentication: "opencode_auth_api_key",
100
+ authFallbacks: ["env_api_key", "global_opencode_config"],
101
+ quota: "remote_api",
102
+ },
131
103
  },
132
- {
133
- id: "alibaba-coding-plan",
134
- autoSetup: "yes",
135
- authentication: "opencode_auth_api_key",
136
- authFallbacks: ["env_api_key", "global_opencode_config"],
137
- quota: "local_estimation",
104
+ "google-antigravity": {
105
+ label: "Google",
106
+ runtimeIds: ["google-antigravity", "google", "antigravity"],
107
+ synonyms: [],
108
+ shape: {
109
+ autoSetup: "needs_quick_setup",
110
+ authentication: "companion_auth_oauth_token",
111
+ quota: "remote_api",
112
+ quickSetupAnchor: "google-antigravity",
113
+ },
138
114
  },
139
- {
140
- id: "synthetic",
141
- autoSetup: "yes",
142
- authentication: "opencode_auth_api_key",
143
- authFallbacks: ["env_api_key", "global_opencode_config"],
144
- quota: "remote_api",
115
+ "google-gemini-cli": {
116
+ label: "Gemini CLI",
117
+ runtimeIds: ["google-gemini-cli", "gemini-cli", "gemini", "opencode-gemini-auth", "google"],
118
+ synonyms: ["gemini-cli", "google-gemini", "opencode-gemini-auth", "gemini"],
119
+ shape: {
120
+ lifecycle: "deprecated",
121
+ recommendedReplacementId: "google-agy",
122
+ autoSetup: "needs_quick_setup",
123
+ authentication: "companion_auth_oauth_token",
124
+ quota: "remote_api",
125
+ quickSetupAnchor: "gemini-cli",
126
+ },
145
127
  },
146
- {
147
- id: "chutes",
148
- autoSetup: "usually",
149
- authentication: "opencode_auth_api_key",
150
- authFallbacks: ["env_api_key", "global_opencode_config"],
151
- quota: "remote_api",
128
+ "google-agy": {
129
+ label: "Google AGY",
130
+ runtimeIds: ["google-agy", "opencode-agy-auth", "google-agy-auth"],
131
+ synonyms: ["opencode-agy-auth", "google-agy-auth"],
132
+ shape: {
133
+ autoSetup: "needs_quick_setup",
134
+ authentication: "companion_auth_oauth_token",
135
+ quota: "remote_api",
136
+ quickSetupAnchor: "google-agy-quick-setup",
137
+ },
152
138
  },
153
- {
154
- id: "google-antigravity",
155
- autoSetup: "needs_quick_setup",
156
- authentication: "companion_auth_oauth_token",
157
- quota: "remote_api",
158
- quickSetupAnchor: "google-antigravity",
139
+ zai: {
140
+ label: "Z.ai",
141
+ runtimeIds: ["zai", "glm", "zai-coding-plan"],
142
+ synonyms: [],
143
+ shape: {
144
+ autoSetup: "yes",
145
+ authentication: "opencode_auth_api_key",
146
+ authFallbacks: ["env_api_key", "global_opencode_config"],
147
+ quota: "remote_api",
148
+ },
159
149
  },
160
- {
161
- id: "google-gemini-cli",
162
- autoSetup: "needs_quick_setup",
163
- authentication: "companion_auth_oauth_token",
164
- quota: "remote_api",
165
- quickSetupAnchor: "gemini-cli",
150
+ zhipu: {
151
+ label: "Zhipu",
152
+ runtimeIds: ["zhipu", "glm-coding-plan", "zhipu-coding-plan", "zhipuai-coding-plan"],
153
+ synonyms: ["glm-coding-plan", "zhipu-coding-plan", "zhipuai-coding-plan"],
154
+ shape: {
155
+ autoSetup: "yes",
156
+ authentication: "opencode_auth_api_key",
157
+ authFallbacks: ["env_api_key", "global_opencode_config"],
158
+ quota: "remote_api",
159
+ },
166
160
  },
167
- {
168
- id: "google-agy",
169
- autoSetup: "needs_quick_setup",
170
- authentication: "companion_auth_oauth_token",
171
- quota: "remote_api",
172
- quickSetupAnchor: "google-agy-quick-setup",
161
+ nanogpt: {
162
+ label: "NanoGPT",
163
+ runtimeIds: ["nanogpt", "nano-gpt"],
164
+ synonyms: ["nano-gpt"],
165
+ shape: {
166
+ autoSetup: "usually",
167
+ authentication: "opencode_auth_api_key",
168
+ authFallbacks: ["env_api_key", "global_opencode_config"],
169
+ quota: "remote_api",
170
+ },
173
171
  },
174
- {
175
- id: "zai",
176
- autoSetup: "yes",
177
- authentication: "opencode_auth_api_key",
178
- authFallbacks: ["env_api_key", "global_opencode_config"],
179
- quota: "remote_api",
172
+ "minimax-coding-plan": {
173
+ label: "MiniMax Coding Plan",
174
+ runtimeIds: ["minimax-coding-plan", "minimax"],
175
+ synonyms: ["minimax"],
176
+ shape: {
177
+ autoSetup: "yes",
178
+ authentication: "opencode_auth_api_key",
179
+ authFallbacks: ["env_api_key", "global_opencode_config"],
180
+ quota: "remote_api",
181
+ },
180
182
  },
181
- {
182
- id: "zhipu",
183
- autoSetup: "yes",
184
- authentication: "opencode_auth_api_key",
185
- authFallbacks: ["env_api_key", "global_opencode_config"],
186
- quota: "remote_api",
183
+ "minimax-china-coding-plan": {
184
+ label: "MiniMax Coding Plan (CN)",
185
+ labelAliases: ["minimax-cn-coding-plan"],
186
+ runtimeIds: [
187
+ "minimax-china-coding-plan",
188
+ "minimax-cn-coding-plan",
189
+ "minimax-cn",
190
+ "minimax-china",
191
+ ],
192
+ synonyms: ["minimax-cn", "minimax-china", "minimax-cn-coding-plan"],
193
+ shape: {
194
+ autoSetup: "yes",
195
+ authentication: "opencode_auth_api_key",
196
+ authFallbacks: ["env_api_key", "global_opencode_config"],
197
+ quota: "remote_api",
198
+ },
187
199
  },
188
- {
189
- id: "nanogpt",
190
- autoSetup: "usually",
191
- authentication: "opencode_auth_api_key",
192
- authFallbacks: ["env_api_key", "global_opencode_config"],
193
- quota: "remote_api",
200
+ "kimi-for-coding": {
201
+ label: "Kimi Code",
202
+ labelAliases: ["kimi-code"],
203
+ runtimeIds: ["kimi-for-coding", "kimi", "kimi-code"],
204
+ synonyms: ["kimi", "kimi-for-code", "kimi-code"],
205
+ shape: {
206
+ autoSetup: "yes",
207
+ authentication: "opencode_auth_api_key",
208
+ authFallbacks: ["env_api_key", "global_opencode_config"],
209
+ quota: "remote_api",
210
+ },
194
211
  },
195
- {
196
- id: "minimax-coding-plan",
197
- autoSetup: "yes",
198
- authentication: "opencode_auth_api_key",
199
- authFallbacks: ["env_api_key", "global_opencode_config"],
200
- quota: "remote_api",
212
+ deepseek: {
213
+ label: "DeepSeek",
214
+ runtimeIds: ["deepseek"],
215
+ synonyms: ["deep-seek"],
216
+ shape: {
217
+ autoSetup: "yes",
218
+ authentication: "opencode_auth_api_key",
219
+ authFallbacks: ["env_api_key", "global_opencode_config"],
220
+ quota: "remote_api",
221
+ },
201
222
  },
202
- {
203
- id: "minimax-china-coding-plan",
204
- autoSetup: "yes",
205
- authentication: "opencode_auth_api_key",
206
- authFallbacks: ["env_api_key", "global_opencode_config"],
207
- quota: "remote_api",
223
+ xai: {
224
+ label: "xAI",
225
+ runtimeIds: ["xai"],
226
+ synonyms: [],
227
+ shape: {
228
+ autoSetup: "yes",
229
+ authentication: "opencode_auth_oauth_token",
230
+ quota: "remote_api",
231
+ notes: "SuperGrok OAuth via OpenCode /connect; shared weekly credit meter",
232
+ },
208
233
  },
209
- {
210
- id: "kimi-for-coding",
211
- autoSetup: "yes",
212
- authentication: "opencode_auth_api_key",
213
- authFallbacks: ["env_api_key", "global_opencode_config"],
214
- quota: "remote_api",
234
+ xiaomi: {
235
+ label: "Xiaomi MiMo",
236
+ runtimeIds: [
237
+ "xiaomi",
238
+ "xiaomi-token-plan-cn",
239
+ "xiaomi-token-plan-ams",
240
+ "xiaomi-token-plan-sgp",
241
+ ],
242
+ synonyms: ["xiaomi-token-plan-cn", "xiaomi-token-plan-ams", "xiaomi-token-plan-sgp"],
243
+ shape: {
244
+ autoSetup: "needs_quick_setup",
245
+ authentication: "state_only",
246
+ quota: "remote_api",
247
+ quickSetupAnchor: "xiaomi-mimo",
248
+ notes: "Reads the Xiaomi MiMo dashboard with a filtered trusted cookie",
249
+ },
215
250
  },
216
- {
217
- id: "deepseek",
218
- autoSetup: "yes",
219
- authentication: "opencode_auth_api_key",
220
- authFallbacks: ["env_api_key", "global_opencode_config"],
221
- quota: "remote_api",
251
+ "opencode-go": {
252
+ label: "OpenCode Go",
253
+ runtimeIds: ["opencode-go"],
254
+ synonyms: ["opencode-go-subscription"],
255
+ shape: {
256
+ autoSetup: "needs_quick_setup",
257
+ authentication: "state_only",
258
+ quota: "remote_api",
259
+ quickSetupAnchor: "opencode-go",
260
+ notes: "Scrapes the OpenCode Go dashboard; requires workspaceId and authCookie",
261
+ },
222
262
  },
223
- {
224
- id: "opencode-go",
225
- autoSetup: "needs_quick_setup",
226
- authentication: "state_only",
227
- quota: "remote_api",
228
- quickSetupAnchor: "opencode-go",
229
- notes: "Scrapes the OpenCode Go dashboard; requires workspaceId and authCookie",
263
+ opencode: {
264
+ label: "OpenCode Zen",
265
+ runtimeIds: ["opencode", "opencode-zen"],
266
+ synonyms: ["opencode-zen"],
267
+ shape: {
268
+ autoSetup: "needs_quick_setup",
269
+ authentication: "state_only",
270
+ quota: "remote_api",
271
+ quickSetupAnchor: "opencode-zen",
272
+ notes: "Scrapes the OpenCode Zen billing page; requires workspaceId and authCookie",
273
+ },
230
274
  },
231
- {
232
- id: "ollama-cloud",
233
- autoSetup: "manual_env_config",
234
- authentication: "state_only",
235
- quota: "remote_api",
236
- notes: "Scrapes the Ollama Cloud settings page; requires __Secure-session cookie via OLLAMA_USAGE_COOKIE env or ollama-usage config",
275
+ "ollama-cloud": {
276
+ label: "Ollama Cloud",
277
+ runtimeIds: ["ollama-cloud"],
278
+ synonyms: [],
279
+ shape: {
280
+ autoSetup: "manual_env_config",
281
+ authentication: "state_only",
282
+ quota: "remote_api",
283
+ notes: "Scrapes the Ollama Cloud settings page; requires __Secure-session cookie via OLLAMA_USAGE_COOKIE env or ollama-usage config",
284
+ },
237
285
  },
238
- {
239
- id: "quota-providers",
240
- autoSetup: "manual_env_config",
241
- authentication: "external_api_key",
242
- authFallbacks: ["env_api_key", "global_opencode_config"],
243
- quota: "remote_api",
244
- notes: "Aggregates exact user-configured accounting sources",
286
+ "quota-providers": {
287
+ label: "Quota providers",
288
+ runtimeIds: [],
289
+ synonyms: [],
290
+ shape: {
291
+ autoSetup: "manual_env_config",
292
+ authentication: "external_api_key",
293
+ authFallbacks: ["env_api_key", "global_opencode_config"],
294
+ quota: "remote_api",
295
+ notes: "Aggregates exact user-configured accounting sources",
296
+ },
245
297
  },
246
- ];
247
- const QUOTA_PROVIDER_SHAPES_BY_ID = Object.fromEntries(QUOTA_PROVIDER_SHAPES.map((shape) => [shape.id, shape]));
298
+ };
299
+ function catalogKeys() {
300
+ return Object.keys(PROVIDER_CATALOG_SOURCE);
301
+ }
302
+ function isCanonicalQuotaProviderId(value) {
303
+ return value in PROVIDER_CATALOG_SOURCE;
304
+ }
305
+ function buildProviderShape(id, source) {
306
+ const { recommendedReplacementId, authFallbacks, ...shape } = source.shape;
307
+ let replacementId;
308
+ if (recommendedReplacementId) {
309
+ if (!isCanonicalQuotaProviderId(recommendedReplacementId)) {
310
+ throw new Error(`Unknown quota provider replacement: ${recommendedReplacementId}`);
311
+ }
312
+ replacementId = recommendedReplacementId;
313
+ }
314
+ return {
315
+ id,
316
+ ...shape,
317
+ ...(replacementId ? { recommendedReplacementId: replacementId } : {}),
318
+ ...(authFallbacks ? { authFallbacks: [...authFallbacks] } : {}),
319
+ };
320
+ }
321
+ function completeCatalogRecord(entries) {
322
+ const record = {};
323
+ for (const [id, value] of entries)
324
+ record[id] = value;
325
+ return record;
326
+ }
327
+ export const QUOTA_PROVIDER_CATALOG = completeCatalogRecord(catalogKeys().map((id) => {
328
+ const source = PROVIDER_CATALOG_SOURCE[id];
329
+ return [
330
+ id,
331
+ {
332
+ label: source.label,
333
+ labelAliases: [...("labelAliases" in source ? source.labelAliases : [])],
334
+ runtimeIds: [...source.runtimeIds],
335
+ synonyms: [...source.synonyms],
336
+ shape: buildProviderShape(id, source),
337
+ },
338
+ ];
339
+ }));
340
+ export const QUOTA_PROVIDER_LABELS = Object.fromEntries(catalogKeys().flatMap((id) => {
341
+ const entry = QUOTA_PROVIDER_CATALOG[id];
342
+ return [[id, entry.label], ...entry.labelAliases.map((alias) => [alias, entry.label])];
343
+ }));
344
+ export const QUOTA_PROVIDER_ID_SYNONYMS = Object.fromEntries(catalogKeys().flatMap((id) => QUOTA_PROVIDER_CATALOG[id].synonyms.map((synonym) => [synonym, id])));
345
+ export const QUOTA_PROVIDER_RUNTIME_IDS = completeCatalogRecord(catalogKeys().map((id) => [id, QUOTA_PROVIDER_CATALOG[id].runtimeIds]));
346
+ export const QUOTA_PROVIDER_SHAPES = catalogKeys().map((id) => QUOTA_PROVIDER_CATALOG[id].shape);
347
+ const LIVE_LOCAL_USAGE_PROVIDER_ID_SET = new Set(catalogKeys().filter((id) => {
348
+ const source = PROVIDER_CATALOG_SOURCE[id];
349
+ return "liveLocalUsage" in source && source.liveLocalUsage === true;
350
+ }));
248
351
  export function normalizeQuotaProviderId(id) {
249
352
  const normalized = id.trim().toLowerCase();
250
353
  return QUOTA_PROVIDER_ID_SYNONYMS[normalized] ?? normalized;
251
354
  }
252
355
  export function getQuotaProviderShape(id) {
253
356
  const normalized = normalizeQuotaProviderId(id);
254
- return QUOTA_PROVIDER_SHAPES_BY_ID[normalized];
357
+ return isCanonicalQuotaProviderId(normalized)
358
+ ? QUOTA_PROVIDER_CATALOG[normalized].shape
359
+ : undefined;
255
360
  }
256
361
  export function getQuotaProviderDisplayLabel(id) {
257
362
  const normalized = normalizeQuotaProviderId(id);