opencode-quota-gui 1.3.0 → 1.3.2

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 (238) hide show
  1. package/README.md +34 -20
  2. package/dist/bin/opencode-quota-gui.js +0 -0
  3. package/dist/contracts/build-identity.js +1 -1
  4. package/dist/contracts/card-order.d.ts +2 -0
  5. package/dist/contracts/card-order.js +2 -2
  6. package/dist/contracts/card-visibility.d.ts +2 -1
  7. package/dist/contracts/card-visibility.js +2 -1
  8. package/dist/contracts/dashboard.d.ts +95 -6
  9. package/dist/contracts/dashboard.js +10 -0
  10. package/dist/contracts/dto-guards.d.ts +4 -0
  11. package/dist/contracts/dto-guards.js +31 -7
  12. package/dist/contracts/guards.js +3 -1
  13. package/dist/contracts/identity.d.ts +37 -5
  14. package/dist/contracts/identity.js +43 -0
  15. package/dist/contracts/openai-quota.d.ts +3 -0
  16. package/dist/contracts/openai-quota.js +3 -0
  17. package/dist/contracts/provider-auto-resume.d.ts +9 -0
  18. package/dist/contracts/provider-auto-resume.js +24 -0
  19. package/dist/contracts/provider-failure.d.ts +22 -0
  20. package/dist/contracts/provider-failure.js +25 -1
  21. package/dist/contracts/row-order.d.ts +13 -0
  22. package/dist/contracts/row-order.js +34 -0
  23. package/dist/contracts/row-visibility.d.ts +53 -0
  24. package/dist/contracts/row-visibility.js +130 -0
  25. package/dist/data/modelsdev-pricing.min.json +1 -1
  26. package/dist/data/modelsdev-temporal.min.json +60 -634
  27. package/dist/gui/aggregation.d.ts +29 -1
  28. package/dist/gui/aggregation.js +157 -4
  29. package/dist/gui/analytics-bridge.d.ts +8 -9
  30. package/dist/gui/analytics-bridge.js +197 -54
  31. package/dist/gui/analytics-engine.d.ts +7 -15
  32. package/dist/gui/analytics-engine.js +246 -106
  33. package/dist/gui/analytics-model.d.ts +7 -0
  34. package/dist/gui/analytics-model.js +75 -9
  35. package/dist/gui/analytics-pricing-upkeep.d.ts +21 -0
  36. package/dist/gui/analytics-pricing-upkeep.js +23 -0
  37. package/dist/gui/analytics-protocol.d.ts +17 -7
  38. package/dist/gui/analytics-protocol.js +1 -0
  39. package/dist/gui/analytics-service.d.ts +10 -0
  40. package/dist/gui/analytics-service.js +30 -9
  41. package/dist/gui/analytics-state.d.ts +30 -5
  42. package/dist/gui/analytics-state.js +46 -7
  43. package/dist/gui/analytics-worker-runtime.d.ts +5 -0
  44. package/dist/gui/analytics-worker-runtime.js +9 -1
  45. package/dist/gui/analytics-worker.js +11 -0
  46. package/dist/gui/config.d.ts +3 -3
  47. package/dist/gui/config.js +77 -7
  48. package/dist/gui/identity.d.ts +6 -20
  49. package/dist/gui/identity.js +6 -54
  50. package/dist/gui/lifecycle.d.ts +5 -3
  51. package/dist/gui/lifecycle.js +3 -3
  52. package/dist/gui/primary-quota-windows.js +67 -44
  53. package/dist/gui/provider-cards.d.ts +20 -8
  54. package/dist/gui/provider-cards.js +42 -55
  55. package/dist/gui/quota-notification-detector.d.ts +29 -6
  56. package/dist/gui/quota-notification-detector.js +136 -47
  57. package/dist/gui/quota-notification-observer.d.ts +3 -4
  58. package/dist/gui/quota-notification-observer.js +73 -20
  59. package/dist/gui/quota-observation.d.ts +4 -0
  60. package/dist/gui/quota-observation.js +18 -0
  61. package/dist/gui/rpc.d.ts +2 -0
  62. package/dist/gui/rpc.js +14 -3
  63. package/dist/gui/server.js +17 -3
  64. package/dist/gui/snapshot-service.d.ts +3 -15
  65. package/dist/gui/snapshot-service.js +281 -23
  66. package/dist/gui/sources.js +179 -64
  67. package/dist/gui/temporal-status.d.ts +3 -2
  68. package/dist/gui/temporal-status.js +10 -6
  69. package/dist/gui-experimental.cjs +230 -225
  70. package/dist/lib/accounting-format.d.ts +8 -0
  71. package/dist/lib/accounting-format.js +20 -2
  72. package/dist/lib/alibaba-coding-plan-cli.d.ts +79 -0
  73. package/dist/lib/alibaba-coding-plan-cli.js +539 -0
  74. package/dist/lib/anthropic-api-auth.d.ts +7 -0
  75. package/dist/lib/anthropic-api-auth.js +27 -0
  76. package/dist/lib/anthropic-api-rate-limits.d.ts +47 -0
  77. package/dist/lib/anthropic-api-rate-limits.js +92 -0
  78. package/dist/lib/anthropic-auth.d.ts +2 -3
  79. package/dist/lib/anthropic-auth.js +2 -3
  80. package/dist/lib/anthropic-oauth-throttle.d.ts +76 -0
  81. package/dist/lib/anthropic-oauth-throttle.js +379 -0
  82. package/dist/lib/anthropic.d.ts +68 -14
  83. package/dist/lib/anthropic.js +1016 -363
  84. package/dist/lib/api-key-retry-after.d.ts +7 -0
  85. package/dist/lib/api-key-retry-after.js +62 -0
  86. package/dist/lib/atomic-json.d.ts +2 -0
  87. package/dist/lib/atomic-json.js +1 -0
  88. package/dist/lib/cache-observer-ingestion.d.ts +90 -0
  89. package/dist/lib/cache-observer-ingestion.js +1008 -0
  90. package/dist/lib/cache-observer.d.ts +141 -0
  91. package/dist/lib/cache-observer.js +323 -0
  92. package/dist/lib/canonical-config-lock.d.ts +9 -0
  93. package/dist/lib/canonical-config-lock.js +36 -0
  94. package/dist/lib/chutes.js +62 -51
  95. package/dist/lib/claude-agent-transcript-ttl.d.ts +48 -0
  96. package/dist/lib/claude-agent-transcript-ttl.js +154 -0
  97. package/dist/lib/claude-agent-ttl-tracker.d.ts +21 -0
  98. package/dist/lib/claude-agent-ttl-tracker.js +152 -0
  99. package/dist/lib/cli-show.d.ts +5 -0
  100. package/dist/lib/cli-show.js +21 -8
  101. package/dist/lib/cli-status.js +3 -6
  102. package/dist/lib/config-write-target.d.ts +1 -1
  103. package/dist/lib/config-write-target.js +5 -2
  104. package/dist/lib/config.d.ts +2 -1
  105. package/dist/lib/config.js +257 -4
  106. package/dist/lib/copilot.js +171 -86
  107. package/dist/lib/dashboard-visibility.d.ts +5 -0
  108. package/dist/lib/dashboard-visibility.js +11 -10
  109. package/dist/lib/dashboard-web-policy.d.ts +4 -4
  110. package/dist/lib/dashboard-web-policy.js +2 -2
  111. package/dist/lib/deepseek.js +25 -13
  112. package/dist/lib/display-sanitize.js +2 -0
  113. package/dist/lib/entries.d.ts +33 -1
  114. package/dist/lib/entries.js +6 -0
  115. package/dist/lib/glm-coding-plan.js +98 -74
  116. package/dist/lib/google-agy.js +90 -12
  117. package/dist/lib/google-gemini-cli.js +84 -11
  118. package/dist/lib/grouped-entry-normalization.js +1 -1
  119. package/dist/lib/http.d.ts +4 -0
  120. package/dist/lib/http.js +16 -2
  121. package/dist/lib/init-installer.js +5 -3
  122. package/dist/lib/kilo.js +37 -18
  123. package/dist/lib/kimi.js +35 -18
  124. package/dist/lib/maintainer-announcements.js +2 -2
  125. package/dist/lib/mimo.d.ts +2 -0
  126. package/dist/lib/mimo.js +36 -0
  127. package/dist/lib/modelsdev-pricing.d.ts +74 -2
  128. package/dist/lib/modelsdev-pricing.js +457 -63
  129. package/dist/lib/modelsdev-temporal.d.ts +6 -0
  130. package/dist/lib/modelsdev-temporal.js +16 -2
  131. package/dist/lib/nanogpt.d.ts +1 -0
  132. package/dist/lib/nanogpt.js +26 -3
  133. package/dist/lib/ollama-cloud.d.ts +1 -1
  134. package/dist/lib/ollama-cloud.js +48 -35
  135. package/dist/lib/openai.js +84 -38
  136. package/dist/lib/opencode-auth-sqlite.d.ts +2 -2
  137. package/dist/lib/opencode-auth-sqlite.js +2 -2
  138. package/dist/lib/opencode-config-editor.d.ts +1 -0
  139. package/dist/lib/opencode-config-editor.js +6 -1
  140. package/dist/lib/opencode-config-providers.js +2 -2
  141. package/dist/lib/opencode-go.js +29 -2
  142. package/dist/lib/opencode-storage.d.ts +20 -0
  143. package/dist/lib/opencode-storage.js +89 -2
  144. package/dist/lib/opencode-version-core.d.ts +30 -0
  145. package/dist/lib/opencode-version-core.js +59 -0
  146. package/dist/lib/opencode-version.d.ts +2 -22
  147. package/dist/lib/opencode-version.js +4 -48
  148. package/dist/lib/opencode-warming-refresh.d.ts +19 -0
  149. package/dist/lib/opencode-warming-refresh.js +95 -0
  150. package/dist/lib/opencode-zen.d.ts +3 -0
  151. package/dist/lib/opencode-zen.js +71 -5
  152. package/dist/lib/provider-add.js +5 -2
  153. package/dist/lib/provider-metadata.d.ts +11 -3
  154. package/dist/lib/provider-metadata.js +20 -2
  155. package/dist/lib/provider-registration.d.ts +358 -9
  156. package/dist/lib/provider-registration.js +423 -30
  157. package/dist/lib/quota-auto-resume.d.ts +74 -0
  158. package/dist/lib/quota-auto-resume.js +539 -0
  159. package/dist/lib/quota-command-format.js +23 -10
  160. package/dist/lib/quota-exhaustion-projection.d.ts +11 -0
  161. package/dist/lib/quota-exhaustion-projection.js +25 -0
  162. package/dist/lib/quota-identity.d.ts +64 -0
  163. package/dist/lib/quota-identity.js +111 -0
  164. package/dist/lib/quota-providers-remote.d.ts +2 -1
  165. package/dist/lib/quota-providers-remote.js +59 -3
  166. package/dist/lib/quota-providers.d.ts +1 -1
  167. package/dist/lib/quota-providers.js +14 -37
  168. package/dist/lib/quota-render-data.d.ts +6 -0
  169. package/dist/lib/quota-render-data.js +45 -19
  170. package/dist/lib/quota-reset-notifications.js +11 -155
  171. package/dist/lib/quota-retry-wait.d.ts +106 -5
  172. package/dist/lib/quota-retry-wait.js +301 -34
  173. package/dist/lib/quota-runtime-context.js +1 -0
  174. package/dist/lib/quota-state-codec.d.ts +2 -0
  175. package/dist/lib/quota-state-codec.js +31 -2
  176. package/dist/lib/quota-state.d.ts +8 -2
  177. package/dist/lib/quota-state.js +253 -47
  178. package/dist/lib/quota-stats.d.ts +26 -0
  179. package/dist/lib/quota-stats.js +40 -1
  180. package/dist/lib/quota-status.js +3 -51
  181. package/dist/lib/quota-surface-data.js +18 -3
  182. package/dist/lib/quota-telemetry.js +2 -2
  183. package/dist/lib/resolved-auth-identity.d.ts +19 -0
  184. package/dist/lib/resolved-auth-identity.js +44 -0
  185. package/dist/lib/scoped-update.d.ts +1 -1
  186. package/dist/lib/state-file-lock.d.ts +26 -0
  187. package/dist/lib/state-file-lock.js +205 -0
  188. package/dist/lib/synthetic.js +65 -54
  189. package/dist/lib/toast-format-grouped.js +7 -4
  190. package/dist/lib/tui-compact-format.js +29 -16
  191. package/dist/lib/types.d.ts +51 -1
  192. package/dist/lib/types.js +17 -1
  193. package/dist/lib/xai.js +48 -22
  194. package/dist/plugin.js +328 -14
  195. package/dist/provider-logos/NOTICE.md +1 -1
  196. package/dist/provider-logos/OPENCODE-NOTICE.md +4 -3
  197. package/dist/providers/alibaba-coding-plan.js +125 -104
  198. package/dist/providers/alibaba-token-plan.js +9 -5
  199. package/dist/providers/anthropic.d.ts +16 -3
  200. package/dist/providers/anthropic.js +172 -220
  201. package/dist/providers/cache-policies.d.ts +11 -4
  202. package/dist/providers/cache-policies.js +19 -13
  203. package/dist/providers/chutes.js +2 -0
  204. package/dist/providers/claude-agent.d.ts +19 -0
  205. package/dist/providers/claude-agent.js +215 -0
  206. package/dist/providers/copilot.js +7 -4
  207. package/dist/providers/glm-coding-plan-provider.d.ts +1 -0
  208. package/dist/providers/glm-coding-plan-provider.js +30 -23
  209. package/dist/providers/google-account-format.js +1 -0
  210. package/dist/providers/google-agy.d.ts +6 -5
  211. package/dist/providers/google-agy.js +43 -15
  212. package/dist/providers/google-gemini-cli.js +1 -0
  213. package/dist/providers/kilo.js +1 -0
  214. package/dist/providers/kimi-code.js +2 -0
  215. package/dist/providers/mimo.js +1 -0
  216. package/dist/providers/nanogpt.js +1 -0
  217. package/dist/providers/ollama-cloud.js +10 -0
  218. package/dist/providers/openai.js +24 -23
  219. package/dist/providers/opencode-go.js +10 -6
  220. package/dist/providers/opencode-zen.js +3 -1
  221. package/dist/providers/openrouter.js +1 -0
  222. package/dist/providers/quota-providers.js +16 -5
  223. package/dist/providers/registry.js +2 -0
  224. package/dist/providers/result-helpers.d.ts +6 -2
  225. package/dist/providers/result-helpers.js +7 -1
  226. package/dist/providers/synthetic.js +4 -0
  227. package/dist/providers/xai.js +9 -8
  228. package/dist/rpc.d.ts +129 -8
  229. package/dist/rpc.js +219 -14
  230. package/dist/ui/assets/{index-cDd9jUVY.css → index-6_g1FHs-.css} +1 -1
  231. package/dist/ui/assets/index-sZnGUuML.js +10 -0
  232. package/dist/ui/assets/{popover-BGkgv9s0.js → popover-C4ZLYe9E.js} +1 -1
  233. package/dist/ui/assets/providers/claude-agent.svg +3 -0
  234. package/dist/ui/index.html +2 -2
  235. package/package.json +45 -46
  236. package/dist/lib/alibaba-coding-plan-local-quota.d.ts +0 -47
  237. package/dist/lib/alibaba-coding-plan-local-quota.js +0 -146
  238. package/dist/ui/assets/index-DLHeXYff.js +0 -9
@@ -1,5 +1,5 @@
1
- import { type CanonicalQuotaProviderId, type QuotaProviderAuthentication, type QuotaProviderAuthFallback, type QuotaProviderAutoSetup, type QuotaProviderQuotaSource } from "./provider-registration.js";
2
- export type { CanonicalQuotaProviderId, QuotaProviderAuthentication, QuotaProviderAuthFallback, QuotaProviderAutoSetup, QuotaProviderQuotaSource, } from "./provider-registration.js";
1
+ import { type CanonicalQuotaProviderId, type QuotaProviderAuthentication, type QuotaProviderAuthFallback, type QuotaProviderAutoResumeBinding, type QuotaProviderAutoSetup, type QuotaProviderOptionalVisibilityRow, type QuotaProviderQuotaSource } from "./provider-registration.js";
2
+ export type { CanonicalQuotaProviderId, QuotaProviderAuthentication, QuotaProviderAuthFallback, QuotaProviderAutoResumeBinding, QuotaProviderAutoSetup, QuotaProviderQuotaSource, } from "./provider-registration.js";
3
3
  export interface QuotaProviderShape {
4
4
  id: CanonicalQuotaProviderId;
5
5
  recommendedReplacementId?: CanonicalQuotaProviderId;
@@ -7,6 +7,8 @@ export interface QuotaProviderShape {
7
7
  authentication: QuotaProviderAuthentication;
8
8
  authFallbacks?: QuotaProviderAuthFallback[];
9
9
  quota: QuotaProviderQuotaSource;
10
+ autoResume?: QuotaProviderAutoResumeBinding;
11
+ optionalVisibilityRows?: readonly QuotaProviderOptionalVisibilityRow[];
10
12
  quickSetupAnchor?: string;
11
13
  notes?: string;
12
14
  }
@@ -24,7 +26,13 @@ export declare const QUOTA_PROVIDER_ID_SYNONYMS: Readonly<Record<string, string>
24
26
  export declare const QUOTA_PROVIDER_RUNTIME_IDS: QuotaProviderRuntimeIds;
25
27
  export declare const QUOTA_PROVIDER_SHAPES: readonly QuotaProviderShape[];
26
28
  export declare function normalizeQuotaProviderId(id: string): string;
27
- export declare function getQuotaProviderShape(id: string): QuotaProviderShape | undefined;
29
+ export declare function getQuotaProviderRegistration(id: string): QuotaProviderShape | undefined;
30
+ /** Display labels for providers that can supply one exact auto-resume binding kind. */
31
+ export declare function getAutoResumeProviderLabelsForBinding(binding: QuotaProviderAutoResumeBinding): readonly string[];
32
+ /** Display labels for every provider that can supply auto-resume evidence. */
33
+ export declare function getSupportedAutoResumeProviderLabels(): readonly string[];
34
+ /** Display labels for providers that can never supply auto-resume evidence. */
35
+ export declare function getUnsupportedAutoResumeProviderLabels(): readonly string[];
28
36
  export declare function getQuotaProviderDisplayLabel(id: string): string;
29
37
  export declare function getQuotaProviderRuntimeIds(id: string): readonly string[];
30
38
  export declare function getQuotaProviderIdsForRuntimeId(id: string): readonly CanonicalQuotaProviderId[];
@@ -63,18 +63,36 @@ export function normalizeQuotaProviderId(id) {
63
63
  const normalized = id.trim().toLowerCase();
64
64
  return QUOTA_PROVIDER_ID_SYNONYMS[normalized] ?? normalized;
65
65
  }
66
- export function getQuotaProviderShape(id) {
66
+ export function getQuotaProviderRegistration(id) {
67
67
  const normalized = normalizeQuotaProviderId(id);
68
68
  return isCanonicalQuotaProviderId(normalized)
69
69
  ? QUOTA_PROVIDER_CATALOG[normalized].shape
70
70
  : undefined;
71
71
  }
72
+ function autoResumeProviderLabels(predicate) {
73
+ return catalogKeys()
74
+ .filter((id) => id !== "quota-providers")
75
+ .filter((id) => predicate(QUOTA_PROVIDER_CATALOG[id].shape.autoResume))
76
+ .map((id) => QUOTA_PROVIDER_CATALOG[id].label);
77
+ }
78
+ /** Display labels for providers that can supply one exact auto-resume binding kind. */
79
+ export function getAutoResumeProviderLabelsForBinding(binding) {
80
+ return autoResumeProviderLabels((candidate) => candidate === binding);
81
+ }
82
+ /** Display labels for every provider that can supply auto-resume evidence. */
83
+ export function getSupportedAutoResumeProviderLabels() {
84
+ return autoResumeProviderLabels((binding) => binding !== undefined);
85
+ }
86
+ /** Display labels for providers that can never supply auto-resume evidence. */
87
+ export function getUnsupportedAutoResumeProviderLabels() {
88
+ return autoResumeProviderLabels((binding) => binding === undefined);
89
+ }
72
90
  export function getQuotaProviderDisplayLabel(id) {
73
91
  const normalized = normalizeQuotaProviderId(id);
74
92
  return QUOTA_PROVIDER_LABELS[normalized] ?? id;
75
93
  }
76
94
  export function getQuotaProviderRuntimeIds(id) {
77
- const shape = getQuotaProviderShape(id);
95
+ const shape = getQuotaProviderRegistration(id);
78
96
  if (!shape) {
79
97
  return [];
80
98
  }
@@ -1,13 +1,42 @@
1
- export type QuotaProviderAutoSetup = "yes" | "usually" | "manual_env_config" | "needs_quick_setup";
2
- export type QuotaProviderAuthentication = "opencode_auth_oauth_token" | "opencode_auth_api_key" | "companion_auth_oauth_token" | "local_cli_auth" | "github_oauth_or_pat" | "external_api_key" | "state_only";
1
+ type QuotaProviderOptionalVisibilityRowResultType = "quota" | "rate_limit" | "usage" | "spend" | "budget" | "balance" | "status";
2
+ /** The render shape the live row uses, so the declared eye shares its row id. */
3
+ type QuotaProviderOptionalVisibilityRowKind = "percent" | "value" | "quantity" | "boolean";
4
+ /**
5
+ * One persistent Settings eye for an optional field a provider emits only when
6
+ * the provider reports it. The primary row id is the declared field id and
7
+ * stays stable when the provider renders the field in another shape; each
8
+ * alternate shape is an alias of the same control.
9
+ */
10
+ export interface QuotaProviderOptionalVisibilityRow {
11
+ rowKey: string;
12
+ resultType: QuotaProviderOptionalVisibilityRowResultType;
13
+ /** Defaults to `value` for rows whose runtime shape is a formatted value. */
14
+ kind?: QuotaProviderOptionalVisibilityRowKind;
15
+ /** Other render shapes this field can emit when its primary value is absent. */
16
+ alternateShapes?: readonly {
17
+ resultType: QuotaProviderOptionalVisibilityRowResultType;
18
+ kind?: QuotaProviderOptionalVisibilityRowKind;
19
+ }[];
20
+ label: string;
21
+ info: string;
22
+ }
23
+ export type QuotaProviderAutoSetup = "yes" | "usually" | "manual_env_config" | "needs_quick_setup" | "unavailable";
24
+ export type QuotaProviderAuthentication = "opencode_auth_oauth_token" | "opencode_auth_api_key" | "companion_auth_oauth_token" | "local_cli_auth" | "github_oauth_or_pat" | "external_api_key" | "state_only" | "unavailable";
3
25
  export type QuotaProviderAuthFallback = "env_api_key" | "global_opencode_config";
4
- export type QuotaProviderQuotaSource = "remote_api" | "local_estimation" | "local_runtime_accounting" | "local_cli_report";
26
+ export type QuotaProviderQuotaSource = "remote_api" | "local_estimation" | "local_runtime_accounting" | "local_cli_report" | "unavailable";
27
+ export type QuotaProviderAutoResumeBinding = "account" | "single-source" | "account-or-single-source";
5
28
  export interface QuotaProviderShapeSource {
6
29
  recommendedReplacementId?: string;
7
30
  autoSetup: QuotaProviderAutoSetup;
8
31
  authentication: QuotaProviderAuthentication;
9
32
  authFallbacks?: readonly QuotaProviderAuthFallback[];
10
33
  quota: QuotaProviderQuotaSource;
34
+ /**
35
+ * Auto-resume evidence this provider can supply. Absent means it never qualifies: no primary
36
+ * reset window, no verifiable identity, or both.
37
+ */
38
+ autoResume?: QuotaProviderAutoResumeBinding;
39
+ optionalVisibilityRows?: readonly QuotaProviderOptionalVisibilityRow[];
11
40
  quickSetupAnchor?: string;
12
41
  notes?: string;
13
42
  }
@@ -24,12 +53,76 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
24
53
  readonly id: "anthropic";
25
54
  readonly label: "Anthropic";
26
55
  readonly runtimeIds: readonly ["anthropic"];
27
- readonly synonyms: readonly ["claude", "claude-code"];
56
+ readonly synonyms: readonly [];
57
+ readonly shape: {
58
+ readonly autoSetup: "usually";
59
+ readonly authentication: "opencode_auth_api_key";
60
+ readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
61
+ readonly quota: "remote_api";
62
+ readonly optionalVisibilityRows: readonly [{
63
+ readonly rowKey: "rate_limit:requests";
64
+ readonly resultType: "rate_limit";
65
+ readonly label: "Requests";
66
+ readonly info: "Passive per-minute request rate limit observed on API-key traffic.";
67
+ }, {
68
+ readonly rowKey: "rate_limit:tokens";
69
+ readonly resultType: "rate_limit";
70
+ readonly label: "Tokens";
71
+ readonly info: "Passive per-minute token rate limit observed on API-key traffic.";
72
+ }, {
73
+ readonly rowKey: "rate_limit:inputTokens";
74
+ readonly resultType: "rate_limit";
75
+ readonly label: "Input tokens";
76
+ readonly info: "Passive per-minute input-token rate limit observed on API-key traffic.";
77
+ }, {
78
+ readonly rowKey: "rate_limit:outputTokens";
79
+ readonly resultType: "rate_limit";
80
+ readonly label: "Output tokens";
81
+ readonly info: "Passive per-minute output-token rate limit observed on API-key traffic.";
82
+ }];
83
+ readonly notes: "Passive per-minute rate-limit headers from real API-key requests; no spend or balance";
84
+ };
85
+ }, {
86
+ readonly id: "claude-agent";
87
+ readonly label: "Claude Agent";
88
+ readonly runtimeIds: readonly ["claude-agent", "claude-code"];
89
+ readonly synonyms: readonly ["claude-code", "claude"];
28
90
  readonly shape: {
29
91
  readonly autoSetup: "needs_quick_setup";
30
92
  readonly authentication: "local_cli_auth";
31
93
  readonly quota: "local_cli_report";
32
- readonly quickSetupAnchor: "anthropic-claude";
94
+ readonly autoResume: "single-source";
95
+ readonly quickSetupAnchor: "claude-agent";
96
+ readonly optionalVisibilityRows: readonly [{
97
+ readonly rowKey: "window:five_hour";
98
+ readonly resultType: "quota";
99
+ readonly kind: "percent";
100
+ readonly label: "5h";
101
+ readonly info: "Claude Agent 5-hour subscription window.";
102
+ }, {
103
+ readonly rowKey: "window:week";
104
+ readonly resultType: "quota";
105
+ readonly kind: "percent";
106
+ readonly label: "Weekly";
107
+ readonly info: "Claude Agent weekly subscription window.";
108
+ }, {
109
+ readonly rowKey: "window:month";
110
+ readonly resultType: "quota";
111
+ readonly kind: "percent";
112
+ readonly label: "Monthly credits";
113
+ readonly info: "Claude Agent monthly usage credits, when the plan reports them.";
114
+ }, {
115
+ readonly rowKey: "named:Fable weekly";
116
+ readonly resultType: "quota";
117
+ readonly kind: "percent";
118
+ readonly label: "Fable";
119
+ readonly info: "Claude Agent Fable weekly window, when the plan reports it.";
120
+ }, {
121
+ readonly rowKey: "claude-agent:resets";
122
+ readonly resultType: "status";
123
+ readonly label: "Resets";
124
+ readonly info: "Shown only when Claude Agent reports one or more available saved resets.";
125
+ }];
33
126
  };
34
127
  }, {
35
128
  readonly id: "copilot";
@@ -40,6 +133,28 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
40
133
  readonly autoSetup: "usually";
41
134
  readonly authentication: "github_oauth_or_pat";
42
135
  readonly quota: "remote_api";
136
+ readonly autoResume: "account";
137
+ readonly optionalVisibilityRows: readonly [{
138
+ readonly rowKey: "window:month";
139
+ readonly resultType: "quota";
140
+ readonly kind: "percent";
141
+ readonly alternateShapes: readonly [{
142
+ readonly resultType: "quota";
143
+ readonly kind: "value";
144
+ }];
145
+ readonly label: "Monthly quota";
146
+ readonly info: "Copilot premium-request or AI-credit quota for the current month.";
147
+ }, {
148
+ readonly rowKey: "named:additional_usage";
149
+ readonly resultType: "budget";
150
+ readonly kind: "percent";
151
+ readonly alternateShapes: readonly [{
152
+ readonly resultType: "budget";
153
+ readonly kind: "value";
154
+ }];
155
+ readonly label: "Additional usage";
156
+ readonly info: "Copilot additional-usage budget, when billing reports spend against it.";
157
+ }];
43
158
  readonly notes: "OAuth for personal flow; PAT for managed billing";
44
159
  };
45
160
  }, {
@@ -51,6 +166,42 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
51
166
  readonly autoSetup: "yes";
52
167
  readonly authentication: "opencode_auth_oauth_token";
53
168
  readonly quota: "remote_api";
169
+ readonly autoResume: "account";
170
+ readonly optionalVisibilityRows: readonly [{
171
+ readonly rowKey: "window:five_hour";
172
+ readonly resultType: "rate_limit";
173
+ readonly kind: "percent";
174
+ readonly label: "5h";
175
+ readonly info: "OpenAI 5-hour rate-limit window, when the account reports it.";
176
+ }, {
177
+ readonly rowKey: "window:week";
178
+ readonly resultType: "rate_limit";
179
+ readonly kind: "percent";
180
+ readonly label: "Weekly";
181
+ readonly info: "OpenAI weekly rate-limit window, when the account reports it.";
182
+ }, {
183
+ readonly rowKey: "window:month";
184
+ readonly resultType: "rate_limit";
185
+ readonly kind: "percent";
186
+ readonly label: "Monthly";
187
+ readonly info: "OpenAI monthly rate-limit window, when the account reports it.";
188
+ }, {
189
+ readonly rowKey: "window:code_review";
190
+ readonly resultType: "rate_limit";
191
+ readonly kind: "percent";
192
+ readonly label: "Code Review";
193
+ readonly info: "OpenAI Code Review rate-limit window, when the account reports it.";
194
+ }, {
195
+ readonly rowKey: "openai:resets";
196
+ readonly resultType: "status";
197
+ readonly label: "Resets";
198
+ readonly info: "Shown only when OpenAI reports one or more available banked resets.";
199
+ }, {
200
+ readonly rowKey: "openai:credits";
201
+ readonly resultType: "balance";
202
+ readonly label: "Credits";
203
+ readonly info: "Shown only when OpenAI reports a positive credit balance or unlimited credits.";
204
+ }];
54
205
  };
55
206
  }, {
56
207
  readonly id: "openrouter";
@@ -73,6 +224,19 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
73
224
  readonly authentication: "opencode_auth_api_key";
74
225
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
75
226
  readonly quota: "remote_api";
227
+ readonly optionalVisibilityRows: readonly [{
228
+ readonly rowKey: "component:remaining_credits";
229
+ readonly resultType: "quota";
230
+ readonly kind: "percent";
231
+ readonly label: "Remaining credits";
232
+ readonly info: "Kilo Pass credit balance, when an active pass reports a total.";
233
+ }, {
234
+ readonly rowKey: "component:total_balance";
235
+ readonly resultType: "balance";
236
+ readonly kind: "quantity";
237
+ readonly label: "Balance";
238
+ readonly info: "Kilo Gateway prepaid balance, when no active Pass is present.";
239
+ }];
76
240
  readonly notes: "Queries Kilo Pass state first, then falls back to the documented personal Gateway balance when no active subscription exists";
77
241
  };
78
242
  }, {
@@ -95,10 +259,11 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
95
259
  readonly synonyms: readonly ["alibaba"];
96
260
  readonly liveLocalUsage: true;
97
261
  readonly shape: {
98
- readonly autoSetup: "yes";
99
- readonly authentication: "opencode_auth_api_key";
100
- readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
101
- readonly quota: "local_estimation";
262
+ readonly autoSetup: "needs_quick_setup";
263
+ readonly authentication: "local_cli_auth";
264
+ readonly quota: "local_cli_report";
265
+ readonly optionalVisibilityRows: readonly QuotaProviderOptionalVisibilityRow[];
266
+ readonly quickSetupAnchor: "alibaba-coding-plan";
102
267
  };
103
268
  }, {
104
269
  readonly id: "alibaba-token-plan";
@@ -109,6 +274,7 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
109
274
  readonly autoSetup: "needs_quick_setup";
110
275
  readonly authentication: "local_cli_auth";
111
276
  readonly quota: "local_cli_report";
277
+ readonly optionalVisibilityRows: readonly QuotaProviderOptionalVisibilityRow[];
112
278
  readonly quickSetupAnchor: "alibaba-personal-token-plan";
113
279
  };
114
280
  }, {
@@ -121,6 +287,20 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
121
287
  readonly authentication: "opencode_auth_api_key";
122
288
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
123
289
  readonly quota: "remote_api";
290
+ readonly autoResume: "single-source";
291
+ readonly optionalVisibilityRows: readonly [{
292
+ readonly rowKey: "window:five_hour";
293
+ readonly resultType: "quota";
294
+ readonly kind: "percent";
295
+ readonly label: "5h";
296
+ readonly info: "Synthetic 5-hour window, when the API reports it.";
297
+ }, {
298
+ readonly rowKey: "window:week";
299
+ readonly resultType: "quota";
300
+ readonly kind: "percent";
301
+ readonly label: "Weekly";
302
+ readonly info: "Synthetic weekly window, when the API reports it.";
303
+ }];
124
304
  };
125
305
  }, {
126
306
  readonly id: "chutes";
@@ -132,6 +312,14 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
132
312
  readonly authentication: "opencode_auth_api_key";
133
313
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
134
314
  readonly quota: "remote_api";
315
+ readonly autoResume: "single-source";
316
+ readonly optionalVisibilityRows: readonly [{
317
+ readonly rowKey: "window:day";
318
+ readonly resultType: "quota";
319
+ readonly kind: "percent";
320
+ readonly label: "Daily";
321
+ readonly info: "Chutes daily quota window.";
322
+ }];
135
323
  };
136
324
  }, {
137
325
  readonly id: "google-gemini-cli";
@@ -166,6 +354,14 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
166
354
  readonly authentication: "opencode_auth_api_key";
167
355
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
168
356
  readonly quota: "remote_api";
357
+ readonly autoResume: "account-or-single-source";
358
+ readonly optionalVisibilityRows: {
359
+ rowKey: string;
360
+ resultType: "quota";
361
+ kind: "percent";
362
+ label: string;
363
+ info: string;
364
+ }[];
169
365
  };
170
366
  }, {
171
367
  readonly id: "zhipu";
@@ -177,6 +373,14 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
177
373
  readonly authentication: "opencode_auth_api_key";
178
374
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
179
375
  readonly quota: "remote_api";
376
+ readonly autoResume: "account-or-single-source";
377
+ readonly optionalVisibilityRows: {
378
+ rowKey: string;
379
+ resultType: "quota";
380
+ kind: "percent";
381
+ label: string;
382
+ info: string;
383
+ }[];
180
384
  };
181
385
  }, {
182
386
  readonly id: "nanogpt";
@@ -188,6 +392,26 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
188
392
  readonly authentication: "opencode_auth_api_key";
189
393
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
190
394
  readonly quota: "remote_api";
395
+ readonly autoResume: "single-source";
396
+ readonly optionalVisibilityRows: readonly [{
397
+ readonly rowKey: "window:day";
398
+ readonly resultType: "quota";
399
+ readonly kind: "percent";
400
+ readonly label: "Daily";
401
+ readonly info: "NanoGPT daily subscription limit, when the plan reports it.";
402
+ }, {
403
+ readonly rowKey: "window:month";
404
+ readonly resultType: "quota";
405
+ readonly kind: "percent";
406
+ readonly label: "Monthly";
407
+ readonly info: "NanoGPT monthly subscription limit, when the plan reports it.";
408
+ }, {
409
+ readonly rowKey: "component:current_balance";
410
+ readonly resultType: "balance";
411
+ readonly kind: "quantity";
412
+ readonly label: "Balance";
413
+ readonly info: "NanoGPT account balance, when the API reports it.";
414
+ }];
191
415
  };
192
416
  }, {
193
417
  readonly id: "minimax-coding-plan";
@@ -199,6 +423,7 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
199
423
  readonly authentication: "opencode_auth_api_key";
200
424
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
201
425
  readonly quota: "remote_api";
426
+ readonly autoResume: "account-or-single-source";
202
427
  };
203
428
  }, {
204
429
  readonly id: "minimax-china-coding-plan";
@@ -211,6 +436,7 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
211
436
  readonly authentication: "opencode_auth_api_key";
212
437
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
213
438
  readonly quota: "remote_api";
439
+ readonly autoResume: "account-or-single-source";
214
440
  };
215
441
  }, {
216
442
  readonly id: "kimi-code-plan-global";
@@ -245,6 +471,31 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
245
471
  readonly authentication: "opencode_auth_api_key";
246
472
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
247
473
  readonly quota: "remote_api";
474
+ readonly optionalVisibilityRows: readonly [{
475
+ readonly rowKey: "component:total_balance";
476
+ readonly resultType: "balance";
477
+ readonly kind: "quantity";
478
+ readonly label: "Total balance";
479
+ readonly info: "DeepSeek total account balance, when the API reports it.";
480
+ }, {
481
+ readonly rowKey: "component:granted_balance";
482
+ readonly resultType: "balance";
483
+ readonly kind: "quantity";
484
+ readonly label: "Granted balance";
485
+ readonly info: "DeepSeek granted balance, when the API reports it.";
486
+ }, {
487
+ readonly rowKey: "component:topped_up_balance";
488
+ readonly resultType: "balance";
489
+ readonly kind: "quantity";
490
+ readonly label: "Topped-up balance";
491
+ readonly info: "DeepSeek topped-up balance, when the API reports it.";
492
+ }, {
493
+ readonly rowKey: "named:Availability";
494
+ readonly resultType: "status";
495
+ readonly kind: "boolean";
496
+ readonly label: "Availability";
497
+ readonly info: "DeepSeek account availability, shown only when no balance is reported.";
498
+ }];
248
499
  };
249
500
  }, {
250
501
  readonly id: "xai";
@@ -255,6 +506,7 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
255
506
  readonly autoSetup: "yes";
256
507
  readonly authentication: "opencode_auth_oauth_token";
257
508
  readonly quota: "remote_api";
509
+ readonly autoResume: "account";
258
510
  readonly notes: "SuperGrok OAuth via OpenCode /connect; shared weekly credit meter";
259
511
  };
260
512
  }, {
@@ -266,6 +518,31 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
266
518
  readonly autoSetup: "needs_quick_setup";
267
519
  readonly authentication: "state_only";
268
520
  readonly quota: "remote_api";
521
+ readonly optionalVisibilityRows: readonly [{
522
+ readonly rowKey: "window:month";
523
+ readonly resultType: "quota";
524
+ readonly kind: "percent";
525
+ readonly label: "Monthly";
526
+ readonly info: "Xiaomi MiMo monthly plan usage, when the dashboard reports it.";
527
+ }, {
528
+ readonly rowKey: "component:total_balance";
529
+ readonly resultType: "balance";
530
+ readonly kind: "quantity";
531
+ readonly label: "Total balance";
532
+ readonly info: "Xiaomi MiMo total balance, when the dashboard reports it.";
533
+ }, {
534
+ readonly rowKey: "component:cash_balance";
535
+ readonly resultType: "balance";
536
+ readonly kind: "quantity";
537
+ readonly label: "Cash balance";
538
+ readonly info: "Xiaomi MiMo cash balance, when the dashboard reports it.";
539
+ }, {
540
+ readonly rowKey: "component:gift_balance";
541
+ readonly resultType: "balance";
542
+ readonly kind: "quantity";
543
+ readonly label: "Gift balance";
544
+ readonly info: "Xiaomi MiMo gift balance, when the dashboard reports it.";
545
+ }];
269
546
  readonly quickSetupAnchor: "xiaomi-mimo";
270
547
  readonly notes: "Reads the Xiaomi MiMo dashboard with a filtered trusted cookie";
271
548
  };
@@ -279,6 +556,26 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
279
556
  readonly authentication: "opencode_auth_api_key";
280
557
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
281
558
  readonly quota: "remote_api";
559
+ readonly autoResume: "account";
560
+ readonly optionalVisibilityRows: readonly [{
561
+ readonly rowKey: "window:five_hour";
562
+ readonly resultType: "quota";
563
+ readonly kind: "percent";
564
+ readonly label: "5h";
565
+ readonly info: "OpenCode Go rolling 5-hour window.";
566
+ }, {
567
+ readonly rowKey: "window:week";
568
+ readonly resultType: "quota";
569
+ readonly kind: "percent";
570
+ readonly label: "Weekly";
571
+ readonly info: "OpenCode Go weekly window.";
572
+ }, {
573
+ readonly rowKey: "window:month";
574
+ readonly resultType: "quota";
575
+ readonly kind: "percent";
576
+ readonly label: "Monthly";
577
+ readonly info: "OpenCode Go monthly window.";
578
+ }];
282
579
  readonly notes: "Reads the official OpenCode Go usage API through standard Go API-key sources";
283
580
  };
284
581
  }, {
@@ -290,6 +587,32 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
290
587
  readonly autoSetup: "yes";
291
588
  readonly authentication: "opencode_auth_oauth_token";
292
589
  readonly quota: "remote_api";
590
+ readonly autoResume: "account";
591
+ readonly optionalVisibilityRows: readonly [{
592
+ readonly rowKey: "window:month";
593
+ readonly resultType: "budget";
594
+ readonly kind: "percent";
595
+ readonly label: "Monthly budget";
596
+ readonly info: "OpenCode Zen monthly budget usage, when a limit is configured or reported.";
597
+ }, {
598
+ readonly rowKey: "window:month";
599
+ readonly resultType: "spend";
600
+ readonly kind: "quantity";
601
+ readonly label: "Monthly spend";
602
+ readonly info: "OpenCode Zen monthly spend, shown when no budget limit exists.";
603
+ }, {
604
+ readonly rowKey: "component:current_balance";
605
+ readonly resultType: "balance";
606
+ readonly kind: "quantity";
607
+ readonly label: "Balance";
608
+ readonly info: "OpenCode Zen current account balance.";
609
+ }, {
610
+ readonly rowKey: "component:auto_reload";
611
+ readonly resultType: "status";
612
+ readonly kind: "boolean";
613
+ readonly label: "Auto-reload";
614
+ readonly info: "OpenCode Zen auto-reload setting, when the console reports it.";
615
+ }];
293
616
  readonly notes: "Reads the OpenCode Console billing, budget and usage APIs with your OpenCode Console sign-in";
294
617
  };
295
618
  }, {
@@ -302,6 +625,31 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
302
625
  readonly authentication: "opencode_auth_api_key";
303
626
  readonly authFallbacks: readonly ["env_api_key", "global_opencode_config"];
304
627
  readonly quota: "remote_api";
628
+ readonly autoResume: "single-source";
629
+ readonly optionalVisibilityRows: readonly [{
630
+ readonly rowKey: "named:Session";
631
+ readonly resultType: "quota";
632
+ readonly kind: "percent";
633
+ readonly label: "Session";
634
+ readonly info: "Ollama Cloud legacy session limit; its fixed reset window is not documented.";
635
+ }, {
636
+ readonly rowKey: "window:week";
637
+ readonly resultType: "quota";
638
+ readonly kind: "percent";
639
+ readonly label: "Weekly";
640
+ readonly info: "Ollama Cloud legacy weekly limit.";
641
+ }, {
642
+ readonly rowKey: "window:month";
643
+ readonly resultType: "quota";
644
+ readonly kind: "percent";
645
+ readonly label: "Monthly";
646
+ readonly info: "Ollama Cloud included credits remaining in the current plan period.";
647
+ }, {
648
+ readonly rowKey: "component:remaining_credits";
649
+ readonly resultType: "balance";
650
+ readonly label: "Purchased";
651
+ readonly info: "Ollama Cloud purchased credits, when any remain.";
652
+ }];
305
653
  readonly notes: "Queries the Ollama Cloud balance API; reports included credits or session and weekly limits, plus purchased credits";
306
654
  };
307
655
  }, {
@@ -318,4 +666,5 @@ export declare const QUOTA_PROVIDER_REGISTRATION_SOURCE: readonly [{
318
666
  };
319
667
  }];
320
668
  export type CanonicalQuotaProviderId = (typeof QUOTA_PROVIDER_REGISTRATION_SOURCE)[number]["id"];
669
+ export {};
321
670
  //# sourceMappingURL=provider-registration.d.ts.map