opencode-quota-gui 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +245 -2
- package/dist/bin/opencode-quota-gui.d.ts +4 -0
- package/dist/bin/opencode-quota-gui.d.ts.map +1 -0
- package/dist/bin/opencode-quota-gui.js +75 -0
- package/dist/bin/opencode-quota-gui.js.map +1 -0
- package/dist/contracts/build-identity.d.ts +8 -0
- package/dist/contracts/build-identity.d.ts.map +1 -0
- package/dist/contracts/build-identity.js +1 -0
- package/dist/contracts/dashboard.d.ts +358 -0
- package/dist/contracts/dashboard.d.ts.map +1 -0
- package/dist/contracts/dashboard.js +3 -0
- package/dist/contracts/dashboard.js.map +1 -0
- package/dist/contracts/guards.d.ts +14 -0
- package/dist/contracts/guards.d.ts.map +1 -0
- package/dist/contracts/guards.js +56 -0
- package/dist/contracts/guards.js.map +1 -0
- package/dist/contracts/identity.d.ts +41 -0
- package/dist/contracts/identity.d.ts.map +1 -0
- package/dist/contracts/identity.js +27 -0
- package/dist/contracts/identity.js.map +1 -0
- package/dist/contracts/openai-quota.d.ts +34 -0
- package/dist/contracts/openai-quota.d.ts.map +1 -0
- package/dist/contracts/openai-quota.js +19 -0
- package/dist/contracts/openai-quota.js.map +1 -0
- package/dist/contracts/ranges.d.ts +48 -0
- package/dist/contracts/ranges.d.ts.map +1 -0
- package/dist/contracts/ranges.js +84 -0
- package/dist/contracts/ranges.js.map +1 -0
- package/dist/contracts/settings.d.ts +4 -0
- package/dist/contracts/settings.d.ts.map +1 -0
- package/dist/contracts/settings.js +14 -0
- package/dist/contracts/settings.js.map +1 -0
- package/dist/contracts/time-zone.d.ts +33 -0
- package/dist/contracts/time-zone.d.ts.map +1 -0
- package/dist/contracts/time-zone.js +217 -0
- package/dist/contracts/time-zone.js.map +1 -0
- package/dist/data/modelsdev-pricing.min.json +1064 -0
- package/dist/gui/aggregation.d.ts +55 -0
- package/dist/gui/aggregation.d.ts.map +1 -0
- package/dist/gui/aggregation.js +792 -0
- package/dist/gui/aggregation.js.map +1 -0
- package/dist/gui/analytics-bridge.d.ts +50 -0
- package/dist/gui/analytics-bridge.d.ts.map +1 -0
- package/dist/gui/analytics-bridge.js +382 -0
- package/dist/gui/analytics-bridge.js.map +1 -0
- package/dist/gui/analytics-engine.d.ts +61 -0
- package/dist/gui/analytics-engine.d.ts.map +1 -0
- package/dist/gui/analytics-engine.js +2381 -0
- package/dist/gui/analytics-engine.js.map +1 -0
- package/dist/gui/analytics-indexes.d.ts +34 -0
- package/dist/gui/analytics-indexes.d.ts.map +1 -0
- package/dist/gui/analytics-indexes.js +142 -0
- package/dist/gui/analytics-indexes.js.map +1 -0
- package/dist/gui/analytics-model.d.ts +48 -0
- package/dist/gui/analytics-model.d.ts.map +1 -0
- package/dist/gui/analytics-model.js +824 -0
- package/dist/gui/analytics-model.js.map +1 -0
- package/dist/gui/analytics-protocol.d.ts +102 -0
- package/dist/gui/analytics-protocol.d.ts.map +1 -0
- package/dist/gui/analytics-protocol.js +11 -0
- package/dist/gui/analytics-protocol.js.map +1 -0
- package/dist/gui/analytics-reader.d.ts +14 -0
- package/dist/gui/analytics-reader.d.ts.map +1 -0
- package/dist/gui/analytics-reader.js +15 -0
- package/dist/gui/analytics-reader.js.map +1 -0
- package/dist/gui/analytics-service.d.ts +49 -0
- package/dist/gui/analytics-service.d.ts.map +1 -0
- package/dist/gui/analytics-service.js +187 -0
- package/dist/gui/analytics-service.js.map +1 -0
- package/dist/gui/analytics-state.d.ts +183 -0
- package/dist/gui/analytics-state.d.ts.map +1 -0
- package/dist/gui/analytics-state.js +692 -0
- package/dist/gui/analytics-state.js.map +1 -0
- package/dist/gui/analytics-worker-runtime.d.ts +11 -0
- package/dist/gui/analytics-worker-runtime.d.ts.map +1 -0
- package/dist/gui/analytics-worker-runtime.js +98 -0
- package/dist/gui/analytics-worker-runtime.js.map +1 -0
- package/dist/gui/analytics-worker.d.ts +2 -0
- package/dist/gui/analytics-worker.d.ts.map +1 -0
- package/dist/gui/analytics-worker.js +64 -0
- package/dist/gui/analytics-worker.js.map +1 -0
- package/dist/gui/config.d.ts +53 -0
- package/dist/gui/config.d.ts.map +1 -0
- package/dist/gui/config.js +679 -0
- package/dist/gui/config.js.map +1 -0
- package/dist/gui/identity.d.ts +23 -0
- package/dist/gui/identity.d.ts.map +1 -0
- package/dist/gui/identity.js +57 -0
- package/dist/gui/identity.js.map +1 -0
- package/dist/gui/lifecycle.d.ts +82 -0
- package/dist/gui/lifecycle.d.ts.map +1 -0
- package/dist/gui/lifecycle.js +402 -0
- package/dist/gui/lifecycle.js.map +1 -0
- package/dist/gui/log.d.ts +23 -0
- package/dist/gui/log.d.ts.map +1 -0
- package/dist/gui/log.js +37 -0
- package/dist/gui/log.js.map +1 -0
- package/dist/gui/provider-cards.d.ts +58 -0
- package/dist/gui/provider-cards.d.ts.map +1 -0
- package/dist/gui/provider-cards.js +413 -0
- package/dist/gui/provider-cards.js.map +1 -0
- package/dist/gui/server.d.ts +60 -0
- package/dist/gui/server.d.ts.map +1 -0
- package/dist/gui/server.js +815 -0
- package/dist/gui/server.js.map +1 -0
- package/dist/gui/settings-file-opener.d.ts +34 -0
- package/dist/gui/settings-file-opener.d.ts.map +1 -0
- package/dist/gui/settings-file-opener.js +110 -0
- package/dist/gui/settings-file-opener.js.map +1 -0
- package/dist/gui/snapshot-service.d.ts +128 -0
- package/dist/gui/snapshot-service.d.ts.map +1 -0
- package/dist/gui/snapshot-service.js +591 -0
- package/dist/gui/snapshot-service.js.map +1 -0
- package/dist/gui/sources.d.ts +94 -0
- package/dist/gui/sources.d.ts.map +1 -0
- package/dist/gui/sources.js +404 -0
- package/dist/gui/sources.js.map +1 -0
- package/dist/gui/sse.d.ts +32 -0
- package/dist/gui/sse.d.ts.map +1 -0
- package/dist/gui/sse.js +100 -0
- package/dist/gui/sse.js.map +1 -0
- package/dist/gui/time-zone.d.ts +10 -0
- package/dist/gui/time-zone.d.ts.map +1 -0
- package/dist/gui/time-zone.js +21 -0
- package/dist/gui/time-zone.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/accounting-format.d.ts +54 -0
- package/dist/lib/accounting-format.d.ts.map +1 -0
- package/dist/lib/accounting-format.js +271 -0
- package/dist/lib/accounting-format.js.map +1 -0
- package/dist/lib/alibaba-auth.d.ts +46 -0
- package/dist/lib/alibaba-auth.d.ts.map +1 -0
- package/dist/lib/alibaba-auth.js +193 -0
- package/dist/lib/alibaba-auth.js.map +1 -0
- package/dist/lib/alibaba-coding-plan-local-quota.d.ts +47 -0
- package/dist/lib/alibaba-coding-plan-local-quota.d.ts.map +1 -0
- package/dist/lib/alibaba-coding-plan-local-quota.js +146 -0
- package/dist/lib/alibaba-coding-plan-local-quota.js.map +1 -0
- package/dist/lib/alibaba-token-plan.d.ts +91 -0
- package/dist/lib/alibaba-token-plan.d.ts.map +1 -0
- package/dist/lib/alibaba-token-plan.js +527 -0
- package/dist/lib/alibaba-token-plan.js.map +1 -0
- package/dist/lib/anthropic-auth.d.ts +29 -0
- package/dist/lib/anthropic-auth.d.ts.map +1 -0
- package/dist/lib/anthropic-auth.js +37 -0
- package/dist/lib/anthropic-auth.js.map +1 -0
- package/dist/lib/anthropic.d.ts +104 -0
- package/dist/lib/anthropic.d.ts.map +1 -0
- package/dist/lib/anthropic.js +1134 -0
- package/dist/lib/anthropic.js.map +1 -0
- package/dist/lib/api-key-resolver.d.ts +227 -0
- package/dist/lib/api-key-resolver.d.ts.map +1 -0
- package/dist/lib/api-key-resolver.js +336 -0
- package/dist/lib/api-key-resolver.js.map +1 -0
- package/dist/lib/atomic-json.d.ts +11 -0
- package/dist/lib/atomic-json.d.ts.map +1 -0
- package/dist/lib/atomic-json.js +64 -0
- package/dist/lib/atomic-json.js.map +1 -0
- package/dist/lib/chutes-config.d.ts +15 -0
- package/dist/lib/chutes-config.d.ts.map +1 -0
- package/dist/lib/chutes-config.js +28 -0
- package/dist/lib/chutes-config.js.map +1 -0
- package/dist/lib/chutes.d.ts +12 -0
- package/dist/lib/chutes.d.ts.map +1 -0
- package/dist/lib/chutes.js +60 -0
- package/dist/lib/chutes.js.map +1 -0
- package/dist/lib/cli-reports.d.ts +30 -0
- package/dist/lib/cli-reports.d.ts.map +1 -0
- package/dist/lib/cli-reports.js +172 -0
- package/dist/lib/cli-reports.js.map +1 -0
- package/dist/lib/cli-show.d.ts +30 -0
- package/dist/lib/cli-show.d.ts.map +1 -0
- package/dist/lib/cli-show.js +213 -0
- package/dist/lib/cli-show.js.map +1 -0
- package/dist/lib/cli-status.d.ts +8 -0
- package/dist/lib/cli-status.d.ts.map +1 -0
- package/dist/lib/cli-status.js +98 -0
- package/dist/lib/cli-status.js.map +1 -0
- package/dist/lib/command-parsing.d.ts +43 -0
- package/dist/lib/command-parsing.d.ts.map +1 -0
- package/dist/lib/command-parsing.js +103 -0
- package/dist/lib/command-parsing.js.map +1 -0
- package/dist/lib/config-file-utils.d.ts +46 -0
- package/dist/lib/config-file-utils.d.ts.map +1 -0
- package/dist/lib/config-file-utils.js +194 -0
- package/dist/lib/config-file-utils.js.map +1 -0
- package/dist/lib/config-write-target.d.ts +28 -0
- package/dist/lib/config-write-target.d.ts.map +1 -0
- package/dist/lib/config-write-target.js +159 -0
- package/dist/lib/config-write-target.js.map +1 -0
- package/dist/lib/config.d.ts +119 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +1327 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/copilot.d.ts +78 -0
- package/dist/lib/copilot.d.ts.map +1 -0
- package/dist/lib/copilot.js +1111 -0
- package/dist/lib/copilot.js.map +1 -0
- package/dist/lib/cursor-detection.d.ts +18 -0
- package/dist/lib/cursor-detection.d.ts.map +1 -0
- package/dist/lib/cursor-detection.js +189 -0
- package/dist/lib/cursor-detection.js.map +1 -0
- package/dist/lib/cursor-pricing.d.ts +34 -0
- package/dist/lib/cursor-pricing.d.ts.map +1 -0
- package/dist/lib/cursor-pricing.js +235 -0
- package/dist/lib/cursor-pricing.js.map +1 -0
- package/dist/lib/cursor-usage.d.ts +33 -0
- package/dist/lib/cursor-usage.d.ts.map +1 -0
- package/dist/lib/cursor-usage.js +109 -0
- package/dist/lib/cursor-usage.js.map +1 -0
- package/dist/lib/deepseek-auth.d.ts +15 -0
- package/dist/lib/deepseek-auth.d.ts.map +1 -0
- package/dist/lib/deepseek-auth.js +28 -0
- package/dist/lib/deepseek-auth.js.map +1 -0
- package/dist/lib/deepseek.d.ts +40 -0
- package/dist/lib/deepseek.d.ts.map +1 -0
- package/dist/lib/deepseek.js +118 -0
- package/dist/lib/deepseek.js.map +1 -0
- package/dist/lib/display-sanitize.d.ts +20 -0
- package/dist/lib/display-sanitize.d.ts.map +1 -0
- package/dist/lib/display-sanitize.js +178 -0
- package/dist/lib/display-sanitize.js.map +1 -0
- package/dist/lib/entries.d.ts +365 -0
- package/dist/lib/entries.d.ts.map +1 -0
- package/dist/lib/entries.js +69 -0
- package/dist/lib/entries.js.map +1 -0
- package/dist/lib/env-template.d.ts +26 -0
- package/dist/lib/env-template.d.ts.map +1 -0
- package/dist/lib/env-template.js +36 -0
- package/dist/lib/env-template.js.map +1 -0
- package/dist/lib/format-utils.d.ts +89 -0
- package/dist/lib/format-utils.d.ts.map +1 -0
- package/dist/lib/format-utils.js +206 -0
- package/dist/lib/format-utils.js.map +1 -0
- package/dist/lib/format.d.ts +25 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +300 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/glm-coding-plan.d.ts +19 -0
- package/dist/lib/glm-coding-plan.d.ts.map +1 -0
- package/dist/lib/glm-coding-plan.js +81 -0
- package/dist/lib/glm-coding-plan.js.map +1 -0
- package/dist/lib/google-agy-companion.d.ts +8 -0
- package/dist/lib/google-agy-companion.d.ts.map +1 -0
- package/dist/lib/google-agy-companion.js +64 -0
- package/dist/lib/google-agy-companion.js.map +1 -0
- package/dist/lib/google-agy.d.ts +48 -0
- package/dist/lib/google-agy.d.ts.map +1 -0
- package/dist/lib/google-agy.js +572 -0
- package/dist/lib/google-agy.js.map +1 -0
- package/dist/lib/google-companion-credentials.d.ts +70 -0
- package/dist/lib/google-companion-credentials.d.ts.map +1 -0
- package/dist/lib/google-companion-credentials.js +315 -0
- package/dist/lib/google-companion-credentials.js.map +1 -0
- package/dist/lib/google-gemini-cli-companion.d.ts +8 -0
- package/dist/lib/google-gemini-cli-companion.d.ts.map +1 -0
- package/dist/lib/google-gemini-cli-companion.js +64 -0
- package/dist/lib/google-gemini-cli-companion.js.map +1 -0
- package/dist/lib/google-gemini-cli.d.ts +47 -0
- package/dist/lib/google-gemini-cli.d.ts.map +1 -0
- package/dist/lib/google-gemini-cli.js +481 -0
- package/dist/lib/google-gemini-cli.js.map +1 -0
- package/dist/lib/google-token-cache.d.ts +27 -0
- package/dist/lib/google-token-cache.d.ts.map +1 -0
- package/dist/lib/google-token-cache.js +52 -0
- package/dist/lib/google-token-cache.js.map +1 -0
- package/dist/lib/grouped-entry-normalization.d.ts +12 -0
- package/dist/lib/grouped-entry-normalization.d.ts.map +1 -0
- package/dist/lib/grouped-entry-normalization.js +124 -0
- package/dist/lib/grouped-entry-normalization.js.map +1 -0
- package/dist/lib/grouped-header-format.d.ts +5 -0
- package/dist/lib/grouped-header-format.d.ts.map +1 -0
- package/dist/lib/grouped-header-format.js +16 -0
- package/dist/lib/grouped-header-format.js.map +1 -0
- package/dist/lib/gui-config-target.d.ts +12 -0
- package/dist/lib/gui-config-target.d.ts.map +1 -0
- package/dist/lib/gui-config-target.js +88 -0
- package/dist/lib/gui-config-target.js.map +1 -0
- package/dist/lib/home-dir-display.d.ts +10 -0
- package/dist/lib/home-dir-display.d.ts.map +1 -0
- package/dist/lib/home-dir-display.js +108 -0
- package/dist/lib/home-dir-display.js.map +1 -0
- package/dist/lib/http.d.ts +19 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +47 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/init-installer.d.ts +146 -0
- package/dist/lib/init-installer.d.ts.map +1 -0
- package/dist/lib/init-installer.js +1056 -0
- package/dist/lib/init-installer.js.map +1 -0
- package/dist/lib/jsonc.d.ts +17 -0
- package/dist/lib/jsonc.d.ts.map +1 -0
- package/dist/lib/jsonc.js +23 -0
- package/dist/lib/jsonc.js.map +1 -0
- package/dist/lib/kilo-config.d.ts +15 -0
- package/dist/lib/kilo-config.d.ts.map +1 -0
- package/dist/lib/kilo-config.js +27 -0
- package/dist/lib/kilo-config.js.map +1 -0
- package/dist/lib/kilo.d.ts +32 -0
- package/dist/lib/kilo.d.ts.map +1 -0
- package/dist/lib/kilo.js +265 -0
- package/dist/lib/kilo.js.map +1 -0
- package/dist/lib/kimi-auth.d.ts +49 -0
- package/dist/lib/kimi-auth.d.ts.map +1 -0
- package/dist/lib/kimi-auth.js +82 -0
- package/dist/lib/kimi-auth.js.map +1 -0
- package/dist/lib/kimi-endpoints.d.ts +10 -0
- package/dist/lib/kimi-endpoints.d.ts.map +1 -0
- package/dist/lib/kimi-endpoints.js +18 -0
- package/dist/lib/kimi-endpoints.js.map +1 -0
- package/dist/lib/kimi.d.ts +26 -0
- package/dist/lib/kimi.d.ts.map +1 -0
- package/dist/lib/kimi.js +230 -0
- package/dist/lib/kimi.js.map +1 -0
- package/dist/lib/maintainer-announcements.d.ts +46 -0
- package/dist/lib/maintainer-announcements.d.ts.map +1 -0
- package/dist/lib/maintainer-announcements.js +155 -0
- package/dist/lib/maintainer-announcements.js.map +1 -0
- package/dist/lib/map-with-concurrency.d.ts +2 -0
- package/dist/lib/map-with-concurrency.d.ts.map +1 -0
- package/dist/lib/map-with-concurrency.js +17 -0
- package/dist/lib/map-with-concurrency.js.map +1 -0
- package/dist/lib/markdown-table.d.ts +51 -0
- package/dist/lib/markdown-table.d.ts.map +1 -0
- package/dist/lib/markdown-table.js +179 -0
- package/dist/lib/markdown-table.js.map +1 -0
- package/dist/lib/mimo-config.d.ts +29 -0
- package/dist/lib/mimo-config.d.ts.map +1 -0
- package/dist/lib/mimo-config.js +146 -0
- package/dist/lib/mimo-config.js.map +1 -0
- package/dist/lib/mimo.d.ts +35 -0
- package/dist/lib/mimo.d.ts.map +1 -0
- package/dist/lib/mimo.js +236 -0
- package/dist/lib/mimo.js.map +1 -0
- package/dist/lib/minimax-auth.d.ts +62 -0
- package/dist/lib/minimax-auth.d.ts.map +1 -0
- package/dist/lib/minimax-auth.js +206 -0
- package/dist/lib/minimax-auth.js.map +1 -0
- package/dist/lib/minimax-endpoints.d.ts +10 -0
- package/dist/lib/minimax-endpoints.d.ts.map +1 -0
- package/dist/lib/minimax-endpoints.js +19 -0
- package/dist/lib/minimax-endpoints.js.map +1 -0
- package/dist/lib/modelsdev-pricing.d.ts +93 -0
- package/dist/lib/modelsdev-pricing.d.ts.map +1 -0
- package/dist/lib/modelsdev-pricing.js +674 -0
- package/dist/lib/modelsdev-pricing.js.map +1 -0
- package/dist/lib/nanogpt-config.d.ts +15 -0
- package/dist/lib/nanogpt-config.d.ts.map +1 -0
- package/dist/lib/nanogpt-config.js +31 -0
- package/dist/lib/nanogpt-config.js.map +1 -0
- package/dist/lib/nanogpt.d.ts +48 -0
- package/dist/lib/nanogpt.d.ts.map +1 -0
- package/dist/lib/nanogpt.js +251 -0
- package/dist/lib/nanogpt.js.map +1 -0
- package/dist/lib/ollama-cloud-config.d.ts +15 -0
- package/dist/lib/ollama-cloud-config.d.ts.map +1 -0
- package/dist/lib/ollama-cloud-config.js +27 -0
- package/dist/lib/ollama-cloud-config.js.map +1 -0
- package/dist/lib/ollama-cloud.d.ts +14 -0
- package/dist/lib/ollama-cloud.d.ts.map +1 -0
- package/dist/lib/ollama-cloud.js +186 -0
- package/dist/lib/ollama-cloud.js.map +1 -0
- package/dist/lib/openai.d.ts +68 -0
- package/dist/lib/openai.d.ts.map +1 -0
- package/dist/lib/openai.js +394 -0
- package/dist/lib/openai.js.map +1 -0
- package/dist/lib/opencode-auth-sqlite.d.ts +17 -0
- package/dist/lib/opencode-auth-sqlite.d.ts.map +1 -0
- package/dist/lib/opencode-auth-sqlite.js +105 -0
- package/dist/lib/opencode-auth-sqlite.js.map +1 -0
- package/dist/lib/opencode-auth.d.ts +146 -0
- package/dist/lib/opencode-auth.d.ts.map +1 -0
- package/dist/lib/opencode-auth.js +465 -0
- package/dist/lib/opencode-auth.js.map +1 -0
- package/dist/lib/opencode-config-editor.d.ts +62 -0
- package/dist/lib/opencode-config-editor.d.ts.map +1 -0
- package/dist/lib/opencode-config-editor.js +387 -0
- package/dist/lib/opencode-config-editor.js.map +1 -0
- package/dist/lib/opencode-config-providers.d.ts +24 -0
- package/dist/lib/opencode-config-providers.d.ts.map +1 -0
- package/dist/lib/opencode-config-providers.js +144 -0
- package/dist/lib/opencode-config-providers.js.map +1 -0
- package/dist/lib/opencode-config-read.d.ts +23 -0
- package/dist/lib/opencode-config-read.d.ts.map +1 -0
- package/dist/lib/opencode-config-read.js +30 -0
- package/dist/lib/opencode-config-read.js.map +1 -0
- package/dist/lib/opencode-console-auth.d.ts +47 -0
- package/dist/lib/opencode-console-auth.d.ts.map +1 -0
- package/dist/lib/opencode-console-auth.js +63 -0
- package/dist/lib/opencode-console-auth.js.map +1 -0
- package/dist/lib/opencode-db-path.d.ts +9 -0
- package/dist/lib/opencode-db-path.d.ts.map +1 -0
- package/dist/lib/opencode-db-path.js +16 -0
- package/dist/lib/opencode-db-path.js.map +1 -0
- package/dist/lib/opencode-go-auth.d.ts +16 -0
- package/dist/lib/opencode-go-auth.d.ts.map +1 -0
- package/dist/lib/opencode-go-auth.js +42 -0
- package/dist/lib/opencode-go-auth.js.map +1 -0
- package/dist/lib/opencode-go.d.ts +17 -0
- package/dist/lib/opencode-go.d.ts.map +1 -0
- package/dist/lib/opencode-go.js +278 -0
- package/dist/lib/opencode-go.js.map +1 -0
- package/dist/lib/opencode-runtime-paths.d.ts +17 -0
- package/dist/lib/opencode-runtime-paths.d.ts.map +1 -0
- package/dist/lib/opencode-runtime-paths.js +24 -0
- package/dist/lib/opencode-runtime-paths.js.map +1 -0
- package/dist/lib/opencode-sqlite.d.ts +11 -0
- package/dist/lib/opencode-sqlite.d.ts.map +1 -0
- package/dist/lib/opencode-sqlite.js +88 -0
- package/dist/lib/opencode-sqlite.js.map +1 -0
- package/dist/lib/opencode-storage.d.ts +306 -0
- package/dist/lib/opencode-storage.d.ts.map +1 -0
- package/dist/lib/opencode-storage.js +1269 -0
- package/dist/lib/opencode-storage.js.map +1 -0
- package/dist/lib/opencode-version.d.ts +6 -0
- package/dist/lib/opencode-version.d.ts.map +1 -0
- package/dist/lib/opencode-version.js +26 -0
- package/dist/lib/opencode-version.js.map +1 -0
- package/dist/lib/opencode-zen.d.ts +55 -0
- package/dist/lib/opencode-zen.d.ts.map +1 -0
- package/dist/lib/opencode-zen.js +348 -0
- package/dist/lib/opencode-zen.js.map +1 -0
- package/dist/lib/openrouter.d.ts +16 -0
- package/dist/lib/openrouter.d.ts.map +1 -0
- package/dist/lib/openrouter.js +50 -0
- package/dist/lib/openrouter.js.map +1 -0
- package/dist/lib/private-state-paths.d.ts +10 -0
- package/dist/lib/private-state-paths.d.ts.map +1 -0
- package/dist/lib/private-state-paths.js +28 -0
- package/dist/lib/private-state-paths.js.map +1 -0
- package/dist/lib/provider-add-command.d.ts +35 -0
- package/dist/lib/provider-add-command.d.ts.map +1 -0
- package/dist/lib/provider-add-command.js +204 -0
- package/dist/lib/provider-add-command.js.map +1 -0
- package/dist/lib/provider-add-json-v1-questionnaire.d.ts +32 -0
- package/dist/lib/provider-add-json-v1-questionnaire.d.ts.map +1 -0
- package/dist/lib/provider-add-json-v1-questionnaire.js +336 -0
- package/dist/lib/provider-add-json-v1-questionnaire.js.map +1 -0
- package/dist/lib/provider-add.d.ts +21 -0
- package/dist/lib/provider-add.d.ts.map +1 -0
- package/dist/lib/provider-add.js +219 -0
- package/dist/lib/provider-add.js.map +1 -0
- package/dist/lib/provider-availability.d.ts +13 -0
- package/dist/lib/provider-availability.d.ts.map +1 -0
- package/dist/lib/provider-availability.js +20 -0
- package/dist/lib/provider-availability.js.map +1 -0
- package/dist/lib/provider-metadata.d.ts +32 -0
- package/dist/lib/provider-metadata.d.ts.map +1 -0
- package/dist/lib/provider-metadata.js +90 -0
- package/dist/lib/provider-metadata.js.map +1 -0
- package/dist/lib/provider-model-matching.d.ts +12 -0
- package/dist/lib/provider-model-matching.d.ts.map +1 -0
- package/dist/lib/provider-model-matching.js +23 -0
- package/dist/lib/provider-model-matching.js.map +1 -0
- package/dist/lib/provider-registration.d.ts +321 -0
- package/dist/lib/provider-registration.d.ts.map +1 -0
- package/dist/lib/provider-registration.js +335 -0
- package/dist/lib/provider-registration.js.map +1 -0
- package/dist/lib/quota-accounting-projection.d.ts +9 -0
- package/dist/lib/quota-accounting-projection.d.ts.map +1 -0
- package/dist/lib/quota-accounting-projection.js +254 -0
- package/dist/lib/quota-accounting-projection.js.map +1 -0
- package/dist/lib/quota-columns.d.ts +38 -0
- package/dist/lib/quota-columns.d.ts.map +1 -0
- package/dist/lib/quota-columns.js +129 -0
- package/dist/lib/quota-columns.js.map +1 -0
- package/dist/lib/quota-command-format.d.ts +34 -0
- package/dist/lib/quota-command-format.d.ts.map +1 -0
- package/dist/lib/quota-command-format.js +240 -0
- package/dist/lib/quota-command-format.js.map +1 -0
- package/dist/lib/quota-dialog-command-specs.d.ts +63 -0
- package/dist/lib/quota-dialog-command-specs.d.ts.map +1 -0
- package/dist/lib/quota-dialog-command-specs.js +145 -0
- package/dist/lib/quota-dialog-command-specs.js.map +1 -0
- package/dist/lib/quota-dialog-commands.d.ts +75 -0
- package/dist/lib/quota-dialog-commands.d.ts.map +1 -0
- package/dist/lib/quota-dialog-commands.js +586 -0
- package/dist/lib/quota-dialog-commands.js.map +1 -0
- package/dist/lib/quota-entry-display.d.ts +7 -0
- package/dist/lib/quota-entry-display.d.ts.map +1 -0
- package/dist/lib/quota-entry-display.js +59 -0
- package/dist/lib/quota-entry-display.js.map +1 -0
- package/dist/lib/quota-exhaustion-projection.d.ts +11 -0
- package/dist/lib/quota-exhaustion-projection.d.ts.map +1 -0
- package/dist/lib/quota-exhaustion-projection.js +105 -0
- package/dist/lib/quota-exhaustion-projection.js.map +1 -0
- package/dist/lib/quota-export-types.d.ts +96 -0
- package/dist/lib/quota-export-types.d.ts.map +1 -0
- package/dist/lib/quota-export-types.js +2 -0
- package/dist/lib/quota-export-types.js.map +1 -0
- package/dist/lib/quota-export.d.ts +44 -0
- package/dist/lib/quota-export.d.ts.map +1 -0
- package/dist/lib/quota-export.js +221 -0
- package/dist/lib/quota-export.js.map +1 -0
- package/dist/lib/quota-format-style.d.ts +21 -0
- package/dist/lib/quota-format-style.d.ts.map +1 -0
- package/dist/lib/quota-format-style.js +38 -0
- package/dist/lib/quota-format-style.js.map +1 -0
- package/dist/lib/quota-providers-local.d.ts +55 -0
- package/dist/lib/quota-providers-local.d.ts.map +1 -0
- package/dist/lib/quota-providers-local.js +327 -0
- package/dist/lib/quota-providers-local.js.map +1 -0
- package/dist/lib/quota-providers-remote.d.ts +27 -0
- package/dist/lib/quota-providers-remote.d.ts.map +1 -0
- package/dist/lib/quota-providers-remote.js +678 -0
- package/dist/lib/quota-providers-remote.js.map +1 -0
- package/dist/lib/quota-providers.d.ts +158 -0
- package/dist/lib/quota-providers.d.ts.map +1 -0
- package/dist/lib/quota-providers.js +1160 -0
- package/dist/lib/quota-providers.js.map +1 -0
- package/dist/lib/quota-render-data.d.ts +135 -0
- package/dist/lib/quota-render-data.d.ts.map +1 -0
- package/dist/lib/quota-render-data.js +462 -0
- package/dist/lib/quota-render-data.js.map +1 -0
- package/dist/lib/quota-report-message.d.ts +22 -0
- package/dist/lib/quota-report-message.d.ts.map +1 -0
- package/dist/lib/quota-report-message.js +36 -0
- package/dist/lib/quota-report-message.js.map +1 -0
- package/dist/lib/quota-reset-notifications.d.ts +20 -0
- package/dist/lib/quota-reset-notifications.d.ts.map +1 -0
- package/dist/lib/quota-reset-notifications.js +331 -0
- package/dist/lib/quota-reset-notifications.js.map +1 -0
- package/dist/lib/quota-retry-wait.d.ts +36 -0
- package/dist/lib/quota-retry-wait.d.ts.map +1 -0
- package/dist/lib/quota-retry-wait.js +67 -0
- package/dist/lib/quota-retry-wait.js.map +1 -0
- package/dist/lib/quota-runtime-context.d.ts +56 -0
- package/dist/lib/quota-runtime-context.d.ts.map +1 -0
- package/dist/lib/quota-runtime-context.js +113 -0
- package/dist/lib/quota-runtime-context.js.map +1 -0
- package/dist/lib/quota-state-codec.d.ts +16 -0
- package/dist/lib/quota-state-codec.d.ts.map +1 -0
- package/dist/lib/quota-state-codec.js +475 -0
- package/dist/lib/quota-state-codec.js.map +1 -0
- package/dist/lib/quota-state.d.ts +28 -0
- package/dist/lib/quota-state.d.ts.map +1 -0
- package/dist/lib/quota-state.js +473 -0
- package/dist/lib/quota-state.js.map +1 -0
- package/dist/lib/quota-stats-format.d.ts +29 -0
- package/dist/lib/quota-stats-format.d.ts.map +1 -0
- package/dist/lib/quota-stats-format.js +459 -0
- package/dist/lib/quota-stats-format.js.map +1 -0
- package/dist/lib/quota-stats.d.ts +174 -0
- package/dist/lib/quota-stats.d.ts.map +1 -0
- package/dist/lib/quota-stats.js +713 -0
- package/dist/lib/quota-stats.js.map +1 -0
- package/dist/lib/quota-status.d.ts +58 -0
- package/dist/lib/quota-status.d.ts.map +1 -0
- package/dist/lib/quota-status.js +865 -0
- package/dist/lib/quota-status.js.map +1 -0
- package/dist/lib/quota-surface-data.d.ts +21 -0
- package/dist/lib/quota-surface-data.d.ts.map +1 -0
- package/dist/lib/quota-surface-data.js +361 -0
- package/dist/lib/quota-surface-data.js.map +1 -0
- package/dist/lib/quota-telemetry.d.ts +45 -0
- package/dist/lib/quota-telemetry.d.ts.map +1 -0
- package/dist/lib/quota-telemetry.js +304 -0
- package/dist/lib/quota-telemetry.js.map +1 -0
- package/dist/lib/report-document.d.ts +90 -0
- package/dist/lib/report-document.d.ts.map +1 -0
- package/dist/lib/report-document.js +190 -0
- package/dist/lib/report-document.js.map +1 -0
- package/dist/lib/resolved-auth-identity.d.ts +36 -0
- package/dist/lib/resolved-auth-identity.d.ts.map +1 -0
- package/dist/lib/resolved-auth-identity.js +192 -0
- package/dist/lib/resolved-auth-identity.js.map +1 -0
- package/dist/lib/runtime-provider-ids.d.ts +4 -0
- package/dist/lib/runtime-provider-ids.d.ts.map +1 -0
- package/dist/lib/runtime-provider-ids.js +10 -0
- package/dist/lib/runtime-provider-ids.js.map +1 -0
- package/dist/lib/scoped-update-migration.d.ts +103 -0
- package/dist/lib/scoped-update-migration.d.ts.map +1 -0
- package/dist/lib/scoped-update-migration.js +348 -0
- package/dist/lib/scoped-update-migration.js.map +1 -0
- package/dist/lib/scoped-update.d.ts +78 -0
- package/dist/lib/scoped-update.d.ts.map +1 -0
- package/dist/lib/scoped-update.js +640 -0
- package/dist/lib/scoped-update.js.map +1 -0
- package/dist/lib/session-tokens-format.d.ts +36 -0
- package/dist/lib/session-tokens-format.d.ts.map +1 -0
- package/dist/lib/session-tokens-format.js +111 -0
- package/dist/lib/session-tokens-format.js.map +1 -0
- package/dist/lib/session-tokens.d.ts +27 -0
- package/dist/lib/session-tokens.d.ts.map +1 -0
- package/dist/lib/session-tokens.js +55 -0
- package/dist/lib/session-tokens.js.map +1 -0
- package/dist/lib/synthetic-config.d.ts +15 -0
- package/dist/lib/synthetic-config.d.ts.map +1 -0
- package/dist/lib/synthetic-config.js +28 -0
- package/dist/lib/synthetic-config.js.map +1 -0
- package/dist/lib/synthetic.d.ts +12 -0
- package/dist/lib/synthetic.d.ts.map +1 -0
- package/dist/lib/synthetic.js +173 -0
- package/dist/lib/synthetic.js.map +1 -0
- package/dist/lib/toast-format-grouped.d.ts +25 -0
- package/dist/lib/toast-format-grouped.d.ts.map +1 -0
- package/dist/lib/toast-format-grouped.js +296 -0
- package/dist/lib/toast-format-grouped.js.map +1 -0
- package/dist/lib/token-buckets.d.ts +24 -0
- package/dist/lib/token-buckets.d.ts.map +1 -0
- package/dist/lib/token-buckets.js +28 -0
- package/dist/lib/token-buckets.js.map +1 -0
- package/dist/lib/token-cost.d.ts +10 -0
- package/dist/lib/token-cost.d.ts.map +1 -0
- package/dist/lib/token-cost.js +16 -0
- package/dist/lib/token-cost.js.map +1 -0
- package/dist/lib/tui-compact-format.d.ts +10 -0
- package/dist/lib/tui-compact-format.d.ts.map +1 -0
- package/dist/lib/tui-compact-format.js +460 -0
- package/dist/lib/tui-compact-format.js.map +1 -0
- package/dist/lib/tui-panel-state.d.ts +15 -0
- package/dist/lib/tui-panel-state.d.ts.map +1 -0
- package/dist/lib/tui-panel-state.js +2 -0
- package/dist/lib/tui-panel-state.js.map +1 -0
- package/dist/lib/tui-prompt-bar-format.d.ts +25 -0
- package/dist/lib/tui-prompt-bar-format.d.ts.map +1 -0
- package/dist/lib/tui-prompt-bar-format.js +206 -0
- package/dist/lib/tui-prompt-bar-format.js.map +1 -0
- package/dist/lib/tui-sidebar-format.d.ts +13 -0
- package/dist/lib/tui-sidebar-format.d.ts.map +1 -0
- package/dist/lib/tui-sidebar-format.js +34 -0
- package/dist/lib/tui-sidebar-format.js.map +1 -0
- package/dist/lib/types.d.ts +724 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +83 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/usage-ownership.d.ts +47 -0
- package/dist/lib/usage-ownership.d.ts.map +1 -0
- package/dist/lib/usage-ownership.js +98 -0
- package/dist/lib/usage-ownership.js.map +1 -0
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +33 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/lib/xai.d.ts +52 -0
- package/dist/lib/xai.d.ts.map +1 -0
- package/dist/lib/xai.js +253 -0
- package/dist/lib/xai.js.map +1 -0
- package/dist/lib/zai-auth.d.ts +15 -0
- package/dist/lib/zai-auth.d.ts.map +1 -0
- package/dist/lib/zai-auth.js +37 -0
- package/dist/lib/zai-auth.js.map +1 -0
- package/dist/lib/zai.d.ts +5 -0
- package/dist/lib/zai.d.ts.map +1 -0
- package/dist/lib/zai.js +14 -0
- package/dist/lib/zai.js.map +1 -0
- package/dist/lib/zhipu-auth.d.ts +15 -0
- package/dist/lib/zhipu-auth.d.ts.map +1 -0
- package/dist/lib/zhipu-auth.js +42 -0
- package/dist/lib/zhipu-auth.js.map +1 -0
- package/dist/lib/zhipu.d.ts +5 -0
- package/dist/lib/zhipu.d.ts.map +1 -0
- package/dist/lib/zhipu.js +13 -0
- package/dist/lib/zhipu.js.map +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +95 -0
- package/dist/plugin.js.map +1 -0
- package/dist/providers/accounting-decimal.d.ts +2 -0
- package/dist/providers/accounting-decimal.d.ts.map +1 -0
- package/dist/providers/accounting-decimal.js +23 -0
- package/dist/providers/accounting-decimal.js.map +1 -0
- package/dist/providers/alibaba-coding-plan.d.ts +3 -0
- package/dist/providers/alibaba-coding-plan.d.ts.map +1 -0
- package/dist/providers/alibaba-coding-plan.js +122 -0
- package/dist/providers/alibaba-coding-plan.js.map +1 -0
- package/dist/providers/alibaba-token-plan.d.ts +3 -0
- package/dist/providers/alibaba-token-plan.d.ts.map +1 -0
- package/dist/providers/alibaba-token-plan.js +90 -0
- package/dist/providers/alibaba-token-plan.js.map +1 -0
- package/dist/providers/anthropic.d.ts +9 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +236 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/cache-policies.d.ts +61 -0
- package/dist/providers/cache-policies.d.ts.map +1 -0
- package/dist/providers/cache-policies.js +210 -0
- package/dist/providers/cache-policies.js.map +1 -0
- package/dist/providers/chutes.d.ts +6 -0
- package/dist/providers/chutes.d.ts.map +1 -0
- package/dist/providers/chutes.js +50 -0
- package/dist/providers/chutes.js.map +1 -0
- package/dist/providers/copilot.d.ts +9 -0
- package/dist/providers/copilot.d.ts.map +1 -0
- package/dist/providers/copilot.js +323 -0
- package/dist/providers/copilot.js.map +1 -0
- package/dist/providers/cursor.d.ts +3 -0
- package/dist/providers/cursor.d.ts.map +1 -0
- package/dist/providers/cursor.js +182 -0
- package/dist/providers/cursor.js.map +1 -0
- package/dist/providers/deepseek.d.ts +9 -0
- package/dist/providers/deepseek.d.ts.map +1 -0
- package/dist/providers/deepseek.js +111 -0
- package/dist/providers/deepseek.js.map +1 -0
- package/dist/providers/glm-coding-plan-provider.d.ts +56 -0
- package/dist/providers/glm-coding-plan-provider.d.ts.map +1 -0
- package/dist/providers/glm-coding-plan-provider.js +146 -0
- package/dist/providers/glm-coding-plan-provider.js.map +1 -0
- package/dist/providers/google-account-format.d.ts +7 -0
- package/dist/providers/google-account-format.d.ts.map +1 -0
- package/dist/providers/google-account-format.js +52 -0
- package/dist/providers/google-account-format.js.map +1 -0
- package/dist/providers/google-agy.d.ts +17 -0
- package/dist/providers/google-agy.d.ts.map +1 -0
- package/dist/providers/google-agy.js +256 -0
- package/dist/providers/google-agy.js.map +1 -0
- package/dist/providers/google-gemini-cli.d.ts +17 -0
- package/dist/providers/google-gemini-cli.d.ts.map +1 -0
- package/dist/providers/google-gemini-cli.js +228 -0
- package/dist/providers/google-gemini-cli.js.map +1 -0
- package/dist/providers/kilo.d.ts +6 -0
- package/dist/providers/kilo.d.ts.map +1 -0
- package/dist/providers/kilo.js +145 -0
- package/dist/providers/kilo.js.map +1 -0
- package/dist/providers/kimi-code.d.ts +4 -0
- package/dist/providers/kimi-code.d.ts.map +1 -0
- package/dist/providers/kimi-code.js +175 -0
- package/dist/providers/kimi-code.js.map +1 -0
- package/dist/providers/mimo.d.ts +3 -0
- package/dist/providers/mimo.d.ts.map +1 -0
- package/dist/providers/mimo.js +149 -0
- package/dist/providers/mimo.js.map +1 -0
- package/dist/providers/minimax-coding-plan.d.ts +26 -0
- package/dist/providers/minimax-coding-plan.d.ts.map +1 -0
- package/dist/providers/minimax-coding-plan.js +391 -0
- package/dist/providers/minimax-coding-plan.js.map +1 -0
- package/dist/providers/nanogpt.d.ts +6 -0
- package/dist/providers/nanogpt.d.ts.map +1 -0
- package/dist/providers/nanogpt.js +160 -0
- package/dist/providers/nanogpt.js.map +1 -0
- package/dist/providers/ollama-cloud.d.ts +9 -0
- package/dist/providers/ollama-cloud.d.ts.map +1 -0
- package/dist/providers/ollama-cloud.js +129 -0
- package/dist/providers/ollama-cloud.js.map +1 -0
- package/dist/providers/openai.d.ts +6 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +313 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/opencode-go.d.ts +4 -0
- package/dist/providers/opencode-go.d.ts.map +1 -0
- package/dist/providers/opencode-go.js +294 -0
- package/dist/providers/opencode-go.js.map +1 -0
- package/dist/providers/opencode-zen.d.ts +3 -0
- package/dist/providers/opencode-zen.d.ts.map +1 -0
- package/dist/providers/opencode-zen.js +221 -0
- package/dist/providers/opencode-zen.js.map +1 -0
- package/dist/providers/openrouter.d.ts +6 -0
- package/dist/providers/openrouter.d.ts.map +1 -0
- package/dist/providers/openrouter.js +32 -0
- package/dist/providers/openrouter.js.map +1 -0
- package/dist/providers/quota-providers.d.ts +6 -0
- package/dist/providers/quota-providers.d.ts.map +1 -0
- package/dist/providers/quota-providers.js +287 -0
- package/dist/providers/quota-providers.js.map +1 -0
- package/dist/providers/registry.d.ts +9 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +71 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/result-helpers.d.ts +61 -0
- package/dist/providers/result-helpers.d.ts.map +1 -0
- package/dist/providers/result-helpers.js +117 -0
- package/dist/providers/result-helpers.js.map +1 -0
- package/dist/providers/synthetic.d.ts +6 -0
- package/dist/providers/synthetic.d.ts.map +1 -0
- package/dist/providers/synthetic.js +79 -0
- package/dist/providers/synthetic.js.map +1 -0
- package/dist/providers/xai.d.ts +6 -0
- package/dist/providers/xai.d.ts.map +1 -0
- package/dist/providers/xai.js +122 -0
- package/dist/providers/xai.js.map +1 -0
- package/dist/providers/zai.d.ts +2 -0
- package/dist/providers/zai.d.ts.map +1 -0
- package/dist/providers/zai.js +24 -0
- package/dist/providers/zai.js.map +1 -0
- package/dist/providers/zhipu.d.ts +2 -0
- package/dist/providers/zhipu.d.ts.map +1 -0
- package/dist/providers/zhipu.js +21 -0
- package/dist/providers/zhipu.js.map +1 -0
- package/dist/rpc.d.ts +72 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +77 -0
- package/dist/rpc.js.map +1 -0
- package/dist/ui/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/ui/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/ui/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/ui/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/ui/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/ui/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/ui/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/ui/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/ui/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/ui/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/ui/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/ui/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/ui/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/ui/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/ui/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/ui/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/ui/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/ui/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/ui/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/ui/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/ui/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/ui/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/ui/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/ui/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/ui/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/ui/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/ui/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/ui/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/ui/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/ui/assets/index-BvKGj9wc.js +8 -0
- package/dist/ui/assets/index-wlxynmbV.css +1 -0
- package/dist/ui/index.html +13 -0
- package/package.json +123 -3
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
import { stat } from "fs/promises";
|
|
2
|
+
import { homedir } from "os";
|
|
3
|
+
import { getProviders } from "../providers/registry.js";
|
|
4
|
+
import { interpretAccountingRow } from "./accounting-format.js";
|
|
5
|
+
import { QUOTA_TOAST_SETTING_SOURCE_KEYS, } from "./config.js";
|
|
6
|
+
import { sanitizeQuotaProviderResult, sanitizeSingleLineDisplayText } from "./display-sanitize.js";
|
|
7
|
+
import { replaceHomeDirWithTilde, replaceHomeDirWithTildeInDocument } from "./home-dir-display.js";
|
|
8
|
+
import { getPricingRefreshPolicy, getPricingSnapshotHealth, getPricingSnapshotMeta, getPricingSnapshotSource, getProviderModelCount, getRuntimePricingRefreshStatePath, getRuntimePricingSnapshotPath, listProviders, readPricingRefreshState, hasProvider as snapshotHasProvider, } from "./modelsdev-pricing.js";
|
|
9
|
+
import { getCredentialSourceDiagnostics } from "./opencode-auth.js";
|
|
10
|
+
import { getOpenCodeDbPath } from "./opencode-db-path.js";
|
|
11
|
+
import { getOpencodeRuntimeDirs } from "./opencode-runtime-paths.js";
|
|
12
|
+
import { getOpenCodeDbStats } from "./opencode-storage.js";
|
|
13
|
+
import { getQuotaProviderDisplayLabel } from "./provider-metadata.js";
|
|
14
|
+
import { isMaintainedQuotaProviderTuning } from "./quota-providers.js";
|
|
15
|
+
import { aggregateUsage } from "./quota-stats.js";
|
|
16
|
+
import { commandHeading, renderPlainTextReport, } from "./report-document.js";
|
|
17
|
+
import { totalTokenBuckets } from "./token-buckets.js";
|
|
18
|
+
import { getPackageVersion } from "./version.js";
|
|
19
|
+
async function pathExists(path) {
|
|
20
|
+
try {
|
|
21
|
+
await stat(path);
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function fmtInt(n) {
|
|
29
|
+
return Math.trunc(n).toLocaleString("en-US");
|
|
30
|
+
}
|
|
31
|
+
const STATUS_SAMPLE_LIMIT = 5;
|
|
32
|
+
const STATUS_LIVE_ENTRY_LIMIT = 2;
|
|
33
|
+
const STATUS_LIVE_ERROR_LIMIT = 2;
|
|
34
|
+
const STATUS_LIVE_ROW_MAX_LENGTH = 120;
|
|
35
|
+
const OPENCODE_GO_STATUS_DETAIL_KEYS = new Set([
|
|
36
|
+
"auth_state",
|
|
37
|
+
"auth_source",
|
|
38
|
+
"auth_checked_paths",
|
|
39
|
+
"credential_database_paths",
|
|
40
|
+
"auth_error",
|
|
41
|
+
"selected_windows",
|
|
42
|
+
"rolling_usage",
|
|
43
|
+
"weekly_usage",
|
|
44
|
+
"monthly_usage",
|
|
45
|
+
"live_fetch_error",
|
|
46
|
+
"opencode_go_state",
|
|
47
|
+
"go_source",
|
|
48
|
+
"console_error",
|
|
49
|
+
"console_auth_state",
|
|
50
|
+
"console_server",
|
|
51
|
+
]);
|
|
52
|
+
function joinOrNone(values) {
|
|
53
|
+
return values.length > 0 ? values.join(" | ") : "(none)";
|
|
54
|
+
}
|
|
55
|
+
function formatSettingSources(sources) {
|
|
56
|
+
if (!sources)
|
|
57
|
+
return "(none)";
|
|
58
|
+
const parts = QUOTA_TOAST_SETTING_SOURCE_KEYS.filter((key) => typeof sources[key] === "string" && sources[key].length > 0).map((key) => `${key}<=${sources[key]}`);
|
|
59
|
+
return parts.length > 0 ? parts.join(" | ") : "(none)";
|
|
60
|
+
}
|
|
61
|
+
function getConfigPrecedenceLabel(configSource) {
|
|
62
|
+
switch (configSource) {
|
|
63
|
+
case "files":
|
|
64
|
+
return "global defaults -> workspace overrides";
|
|
65
|
+
case "sdk":
|
|
66
|
+
return "sdk fallback (no file-backed config)";
|
|
67
|
+
case "defaults":
|
|
68
|
+
return "built-in defaults only";
|
|
69
|
+
default:
|
|
70
|
+
return configSource;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function createKvSection(id, title, rows) {
|
|
74
|
+
return {
|
|
75
|
+
id,
|
|
76
|
+
title,
|
|
77
|
+
blocks: [{ kind: "kv", rows }],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function createLinesSection(id, title, lines) {
|
|
81
|
+
return {
|
|
82
|
+
id,
|
|
83
|
+
title,
|
|
84
|
+
blocks: [{ kind: "lines", lines }],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function normalizeLiveProbeText(value) {
|
|
88
|
+
return sanitizeSingleLineDisplayText(value).replace(/:+$/u, "").toLowerCase();
|
|
89
|
+
}
|
|
90
|
+
function isRedundantLiveProbeDescriptor(providerId, value) {
|
|
91
|
+
if (!value)
|
|
92
|
+
return true;
|
|
93
|
+
const normalized = normalizeLiveProbeText(value);
|
|
94
|
+
if (!normalized)
|
|
95
|
+
return true;
|
|
96
|
+
return (normalized === normalizeLiveProbeText(providerId) ||
|
|
97
|
+
normalized === normalizeLiveProbeText(getQuotaProviderDisplayLabel(providerId)));
|
|
98
|
+
}
|
|
99
|
+
function findProviderLiveProbe(providerId, probes) {
|
|
100
|
+
return probes?.find((probe) => probe.providerId === providerId);
|
|
101
|
+
}
|
|
102
|
+
function getProviderStatusDetails(providerId, probes) {
|
|
103
|
+
const probe = findProviderLiveProbe(providerId, probes);
|
|
104
|
+
return probe ? sanitizeQuotaProviderResult(probe.result).statusDetails : undefined;
|
|
105
|
+
}
|
|
106
|
+
function appendProviderStatusDetailRows(rows, providerId, probes, keys) {
|
|
107
|
+
for (const detail of getProviderStatusDetails(providerId, probes) ?? []) {
|
|
108
|
+
if (!keys || keys.has(detail.key)) {
|
|
109
|
+
rows.push({ key: detail.key, value: detail.value });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function findProviderStatusDetail(providerId, key, probes) {
|
|
114
|
+
return getProviderStatusDetails(providerId, probes)?.find((detail) => detail.key === key)?.value;
|
|
115
|
+
}
|
|
116
|
+
function getLiveProbeState(probe) {
|
|
117
|
+
if (!probe)
|
|
118
|
+
return "unavailable";
|
|
119
|
+
if (probe.result.entries.length > 0 && probe.result.errors.length > 0)
|
|
120
|
+
return "partial";
|
|
121
|
+
if (probe.result.entries.length > 0)
|
|
122
|
+
return "success";
|
|
123
|
+
if (probe.result.errors.length > 0)
|
|
124
|
+
return "error";
|
|
125
|
+
return "no_data";
|
|
126
|
+
}
|
|
127
|
+
function appendProviderCompactLiveProbeRows(rows, providerId, probes, availability, homeDir) {
|
|
128
|
+
const provider = availability.find((item) => item.id === providerId);
|
|
129
|
+
if (!provider?.enabled || !provider.available)
|
|
130
|
+
return;
|
|
131
|
+
appendCompactLiveProbeRows(rows, providerId, findProviderLiveProbe(providerId, probes), homeDir);
|
|
132
|
+
}
|
|
133
|
+
function createCompactLiveProbeOnlySection(params) {
|
|
134
|
+
const provider = params.availability.find((item) => item.id === params.providerId);
|
|
135
|
+
if (!provider?.enabled || !provider.available)
|
|
136
|
+
return null;
|
|
137
|
+
const probe = findProviderLiveProbe(params.providerId, params.probes);
|
|
138
|
+
if (!probe) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
const rows = [];
|
|
142
|
+
appendCompactLiveProbeRows(rows, params.providerId, probe, params.homeDir);
|
|
143
|
+
return createKvSection(params.id, params.title, rows);
|
|
144
|
+
}
|
|
145
|
+
function createProviderStatusSection(params) {
|
|
146
|
+
const rows = [];
|
|
147
|
+
if (params.includeDetails !== false) {
|
|
148
|
+
appendProviderStatusDetailRows(rows, params.providerId, params.probes, params.detailKeys);
|
|
149
|
+
}
|
|
150
|
+
appendProviderCompactLiveProbeRows(rows, params.providerId, params.probes, params.availability, params.homeDir);
|
|
151
|
+
return createKvSection(params.id, params.title, rows);
|
|
152
|
+
}
|
|
153
|
+
function getCompactLiveProbeDescriptor(providerId, entry, semanticLabel) {
|
|
154
|
+
if (entry.semantic) {
|
|
155
|
+
return sanitizeSingleLineDisplayText(semanticLabel);
|
|
156
|
+
}
|
|
157
|
+
const candidates = [entry.label, entry.name, entry.group];
|
|
158
|
+
for (const candidate of candidates) {
|
|
159
|
+
if (typeof candidate !== "string")
|
|
160
|
+
continue;
|
|
161
|
+
const cleaned = sanitizeSingleLineDisplayText(candidate);
|
|
162
|
+
if (!cleaned || isRedundantLiveProbeDescriptor(providerId, cleaned)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
return cleaned;
|
|
166
|
+
}
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* One live probe row, cut to its length limit. The home dir becomes "~" before the cut, so a
|
|
171
|
+
* cut inside a home path cannot leave part of the user name (e.g. "/Users/ali").
|
|
172
|
+
*/
|
|
173
|
+
function shortenLiveRowText(text, homeDir) {
|
|
174
|
+
return replaceHomeDirWithTilde(sanitizeSingleLineDisplayText(text), homeDir).slice(0, STATUS_LIVE_ROW_MAX_LENGTH);
|
|
175
|
+
}
|
|
176
|
+
function formatCompactLiveProbeEntry(providerId, entry, homeDir) {
|
|
177
|
+
const interpretation = interpretAccountingRow(entry, { booleanWording: "semantic" });
|
|
178
|
+
const parts = [];
|
|
179
|
+
const descriptor = getCompactLiveProbeDescriptor(providerId, entry, interpretation.label);
|
|
180
|
+
if (descriptor) {
|
|
181
|
+
parts.push(descriptor);
|
|
182
|
+
}
|
|
183
|
+
if (interpretation.display.kind === "value") {
|
|
184
|
+
const value = interpretation.display.entryKind === "value"
|
|
185
|
+
? sanitizeSingleLineDisplayText(interpretation.display.text)
|
|
186
|
+
: interpretation.display.text;
|
|
187
|
+
parts.push(`value=${value}`);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
if (entry.right) {
|
|
191
|
+
parts.push(sanitizeSingleLineDisplayText(entry.right));
|
|
192
|
+
}
|
|
193
|
+
const percentRemaining = Number.isFinite(interpretation.display.percentRemaining)
|
|
194
|
+
? Math.max(0, Math.min(100, Math.round(interpretation.display.percentRemaining)))
|
|
195
|
+
: 0;
|
|
196
|
+
parts.push(`percent_remaining=${percentRemaining}`);
|
|
197
|
+
}
|
|
198
|
+
if (entry.resetTimeIso) {
|
|
199
|
+
parts.push(`reset_at=${sanitizeSingleLineDisplayText(entry.resetTimeIso)}`);
|
|
200
|
+
}
|
|
201
|
+
return shortenLiveRowText(parts.join(" "), homeDir);
|
|
202
|
+
}
|
|
203
|
+
function formatCompactLiveProbeError(providerId, error, homeDir) {
|
|
204
|
+
const label = isRedundantLiveProbeDescriptor(providerId, error.label)
|
|
205
|
+
? ""
|
|
206
|
+
: sanitizeSingleLineDisplayText(error.label);
|
|
207
|
+
const message = sanitizeSingleLineDisplayText(error.message);
|
|
208
|
+
return shortenLiveRowText(label ? `${label}: ${message}` : message, homeDir);
|
|
209
|
+
}
|
|
210
|
+
function getQuotaProviderCredentialCategory(source) {
|
|
211
|
+
switch (source) {
|
|
212
|
+
case "explicit_env":
|
|
213
|
+
return "environment";
|
|
214
|
+
case "global_opencode_json":
|
|
215
|
+
case "global_opencode_jsonc":
|
|
216
|
+
return "trusted_global_config";
|
|
217
|
+
case "opencode_db":
|
|
218
|
+
return "opencode_db";
|
|
219
|
+
default:
|
|
220
|
+
return "none";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function createQuotaProvidersSection(params) {
|
|
224
|
+
if (params.definitions.length === 0)
|
|
225
|
+
return null;
|
|
226
|
+
const diagnostics = findProviderLiveProbe("quota-providers", params.probes)?.result.diagnostics ?? [];
|
|
227
|
+
const diagnosticsBySource = new Map(diagnostics.map((diagnostic) => [diagnostic.sourceId, diagnostic]));
|
|
228
|
+
const rows = [];
|
|
229
|
+
for (const definition of params.definitions) {
|
|
230
|
+
const diagnostic = diagnosticsBySource.get(definition.id);
|
|
231
|
+
const coverage = definition.modelIds ? definition.modelIds.join(",") : "all_models";
|
|
232
|
+
if (definition.mode === "local-estimate" && isMaintainedQuotaProviderTuning(definition)) {
|
|
233
|
+
const probe = findProviderLiveProbe(definition.id, params.probes);
|
|
234
|
+
const statePath = findProviderStatusDetail(definition.id, "local_state_path", params.probes);
|
|
235
|
+
const stateExists = findProviderStatusDetail(definition.id, "local_state_exists", params.probes);
|
|
236
|
+
const stateHealth = findProviderStatusDetail(definition.id, "local_state_health", params.probes);
|
|
237
|
+
const stateVersion = findProviderStatusDetail(definition.id, "local_state_version", params.probes);
|
|
238
|
+
const stateLastUpdate = findProviderStatusDetail(definition.id, "local_state_last_update", params.probes);
|
|
239
|
+
rows.push({
|
|
240
|
+
key: `provider_${definition.id}`,
|
|
241
|
+
value: [
|
|
242
|
+
`provider_id=${definition.providerId}`,
|
|
243
|
+
"mode=local-estimate",
|
|
244
|
+
`coverage=${coverage}`,
|
|
245
|
+
`outcome=${getLiveProbeState(probe)}`,
|
|
246
|
+
`limits=${definition.windows.map((window) => `${window.id}:${window.requestLimit}`).join(",")}`,
|
|
247
|
+
`state_path=${statePath ?? "(none)"}`,
|
|
248
|
+
`state_exists=${stateExists ?? "false"}`,
|
|
249
|
+
`state_health=${stateHealth ?? "missing"}`,
|
|
250
|
+
`state_version=${stateVersion ?? "(none)"}`,
|
|
251
|
+
`state_last_update=${stateLastUpdate ?? "(none)"}`,
|
|
252
|
+
]
|
|
253
|
+
.map((part) => sanitizeSingleLineDisplayText(part))
|
|
254
|
+
.join(" "),
|
|
255
|
+
});
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (definition.mode === "local-estimate") {
|
|
259
|
+
const stateHealth = diagnostic?.stateHealth ?? "missing";
|
|
260
|
+
rows.push({
|
|
261
|
+
key: `provider_${definition.id}`,
|
|
262
|
+
value: [
|
|
263
|
+
`provider_id=${definition.providerId}`,
|
|
264
|
+
"mode=local-estimate",
|
|
265
|
+
`coverage=${coverage}`,
|
|
266
|
+
`outcome=${diagnostic?.outcome ?? "unavailable"}`,
|
|
267
|
+
`state_path=${diagnostic?.statePath ?? "(none)"}`,
|
|
268
|
+
`state_exists=${diagnostic?.statePath && stateHealth !== "missing" ? "true" : "false"}`,
|
|
269
|
+
`state_health=${stateHealth}`,
|
|
270
|
+
`state_version=${diagnostic?.stateVersion ?? "(none)"}`,
|
|
271
|
+
`state_last_update=${diagnostic?.stateLastUpdatedAt == null ? "(none)" : new Date(diagnostic.stateLastUpdatedAt).toISOString()}`,
|
|
272
|
+
]
|
|
273
|
+
.map((part) => sanitizeSingleLineDisplayText(part))
|
|
274
|
+
.join(" "),
|
|
275
|
+
});
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
const checkedPaths = diagnostic
|
|
279
|
+
? [...new Set([...diagnostic.checkedPaths, ...diagnostic.credentialDatabasePaths])]
|
|
280
|
+
: [];
|
|
281
|
+
rows.push({
|
|
282
|
+
key: `provider_${definition.id}`,
|
|
283
|
+
value: [
|
|
284
|
+
`provider_id=${definition.providerId}`,
|
|
285
|
+
"mode=remote-api",
|
|
286
|
+
`format=${definition.format}`,
|
|
287
|
+
`coverage=${coverage}`,
|
|
288
|
+
`outcome=${diagnostic?.outcome ?? "unavailable"}`,
|
|
289
|
+
`credential_category=${getQuotaProviderCredentialCategory(diagnostic?.credentialSource ?? null)}`,
|
|
290
|
+
`env_name=${definition.apiKeyEnv ?? "(none)"}`,
|
|
291
|
+
`checked_paths=${checkedPaths.length > 0 ? checkedPaths.join(" | ") : "(none)"}`,
|
|
292
|
+
]
|
|
293
|
+
.map((part) => sanitizeSingleLineDisplayText(part))
|
|
294
|
+
.join(" "),
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return createKvSection("quota_providers", "quota_providers:", rows);
|
|
298
|
+
}
|
|
299
|
+
function appendCompactLiveProbeRows(rows, providerId, probe, homeDir) {
|
|
300
|
+
if (!probe)
|
|
301
|
+
return;
|
|
302
|
+
const result = sanitizeQuotaProviderResult(probe.result);
|
|
303
|
+
const entryCount = Math.min(result.entries.length, STATUS_LIVE_ENTRY_LIMIT);
|
|
304
|
+
const errorCount = Math.min(result.errors.length, STATUS_LIVE_ERROR_LIMIT);
|
|
305
|
+
const state = result.entries.length > 0 && result.errors.length > 0
|
|
306
|
+
? "partial"
|
|
307
|
+
: result.entries.length > 0
|
|
308
|
+
? "success"
|
|
309
|
+
: result.errors.length > 0
|
|
310
|
+
? "error"
|
|
311
|
+
: "no_data";
|
|
312
|
+
rows.push({ key: "live_probe", value: state });
|
|
313
|
+
for (let index = 0; index < entryCount; index += 1) {
|
|
314
|
+
rows.push({
|
|
315
|
+
key: `live_entry_${index + 1}`,
|
|
316
|
+
value: formatCompactLiveProbeEntry(providerId, result.entries[index], homeDir),
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
for (let index = 0; index < errorCount; index += 1) {
|
|
320
|
+
rows.push({
|
|
321
|
+
key: `live_error_${index + 1}`,
|
|
322
|
+
value: formatCompactLiveProbeError(providerId, result.errors[index], homeDir),
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
const suppressedCount = Math.max(0, result.entries.length - entryCount) +
|
|
326
|
+
Math.max(0, result.errors.length - errorCount);
|
|
327
|
+
if (suppressedCount > 0) {
|
|
328
|
+
rows.push({
|
|
329
|
+
key: "live_more",
|
|
330
|
+
value: `+${suppressedCount} additional rows suppressed`,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function computePricingCoverageFromAgg(agg) {
|
|
335
|
+
const byProvider = new Map();
|
|
336
|
+
let pricedKeysSeen = 0;
|
|
337
|
+
let mappedMissingKeysSeen = 0;
|
|
338
|
+
let unpricedKeysSeen = 0;
|
|
339
|
+
// Priced keys seen in history
|
|
340
|
+
for (const row of agg.byModel) {
|
|
341
|
+
const p = row.key.provider;
|
|
342
|
+
const existing = byProvider.get(p) ?? {
|
|
343
|
+
pricedKeysSeen: 0,
|
|
344
|
+
mappedMissingKeysSeen: 0,
|
|
345
|
+
unpricedKeysSeen: 0,
|
|
346
|
+
};
|
|
347
|
+
existing.pricedKeysSeen += 1;
|
|
348
|
+
byProvider.set(p, existing);
|
|
349
|
+
pricedKeysSeen += 1;
|
|
350
|
+
}
|
|
351
|
+
// Keys that mapped to an official provider/model but were missing pricing
|
|
352
|
+
for (const row of agg.unknown) {
|
|
353
|
+
const p = row.key.mappedProvider;
|
|
354
|
+
if (!p || !row.key.mappedModel)
|
|
355
|
+
continue;
|
|
356
|
+
const existing = byProvider.get(p) ?? {
|
|
357
|
+
pricedKeysSeen: 0,
|
|
358
|
+
mappedMissingKeysSeen: 0,
|
|
359
|
+
unpricedKeysSeen: 0,
|
|
360
|
+
};
|
|
361
|
+
existing.mappedMissingKeysSeen += 1;
|
|
362
|
+
byProvider.set(p, existing);
|
|
363
|
+
mappedMissingKeysSeen += 1;
|
|
364
|
+
}
|
|
365
|
+
// Mapped keys that we explicitly consider unpriced
|
|
366
|
+
for (const row of agg.unpriced) {
|
|
367
|
+
const p = row.key.mappedProvider;
|
|
368
|
+
const existing = byProvider.get(p) ?? {
|
|
369
|
+
pricedKeysSeen: 0,
|
|
370
|
+
mappedMissingKeysSeen: 0,
|
|
371
|
+
unpricedKeysSeen: 0,
|
|
372
|
+
};
|
|
373
|
+
existing.unpricedKeysSeen += 1;
|
|
374
|
+
byProvider.set(p, existing);
|
|
375
|
+
unpricedKeysSeen += 1;
|
|
376
|
+
}
|
|
377
|
+
return { byProvider, totals: { pricedKeysSeen, mappedMissingKeysSeen, unpricedKeysSeen } };
|
|
378
|
+
}
|
|
379
|
+
function supportedProviderPricingRow(params) {
|
|
380
|
+
const id = params.id;
|
|
381
|
+
if (id === "synthetic") {
|
|
382
|
+
return {
|
|
383
|
+
id,
|
|
384
|
+
pricing: "no",
|
|
385
|
+
notes: "subscription request quota (not token-priced)",
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
if (id === "alibaba-coding-plan") {
|
|
389
|
+
return {
|
|
390
|
+
id,
|
|
391
|
+
pricing: "no",
|
|
392
|
+
notes: "local request-count estimate (tiered rolling windows, no token pricing API)",
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
if (id === "alibaba-token-plan") {
|
|
396
|
+
return {
|
|
397
|
+
id,
|
|
398
|
+
pricing: "no",
|
|
399
|
+
notes: "official Alibaba Cloud CLI Personal Token Plan quota (not token-priced)",
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
if (id === "cursor") {
|
|
403
|
+
return {
|
|
404
|
+
id,
|
|
405
|
+
pricing: "partial",
|
|
406
|
+
notes: "API-pool models map to official pricing; Auto/Composer use bundled static Cursor rates",
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
if (id === "nanogpt") {
|
|
410
|
+
return {
|
|
411
|
+
id,
|
|
412
|
+
pricing: "no",
|
|
413
|
+
notes: "subscription request quota + account balance (not token-priced)",
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
if (id === "deepseek") {
|
|
417
|
+
return {
|
|
418
|
+
id,
|
|
419
|
+
pricing: "no",
|
|
420
|
+
notes: "account balance only (not token-priced)",
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
if (id === "opencode-go") {
|
|
424
|
+
return {
|
|
425
|
+
id,
|
|
426
|
+
pricing: "no",
|
|
427
|
+
notes: "subscription percentage quota from the OpenCode Go usage API (not token-priced)",
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
if (id === "xiaomi") {
|
|
431
|
+
return {
|
|
432
|
+
id,
|
|
433
|
+
pricing: "no",
|
|
434
|
+
notes: "dashboard monthly token quota and balances; per-key costs unsupported",
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
if (id === "kimi-code-plan-global" ||
|
|
438
|
+
id === "kimi-code-plan-cn" ||
|
|
439
|
+
id === "kimi-for-coding" ||
|
|
440
|
+
id === "kimi-code" ||
|
|
441
|
+
id === "kimi") {
|
|
442
|
+
return {
|
|
443
|
+
id,
|
|
444
|
+
pricing: "no",
|
|
445
|
+
notes: "request quota via Kimi Code API (not token-priced)",
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
// Providers that correspond directly to models.dev providers.
|
|
449
|
+
if (params.snapshotProviders.includes(id)) {
|
|
450
|
+
return { id, pricing: "yes", notes: "models.dev snapshot provider" };
|
|
451
|
+
}
|
|
452
|
+
// Connector to snapshot provider; treat as priced if snapshot has OpenAI pricing.
|
|
453
|
+
// Copilot is an OpenCode provider but token costs still map into official model pricing.
|
|
454
|
+
if (id === "copilot") {
|
|
455
|
+
return snapshotHasProvider("openai")
|
|
456
|
+
? { id, pricing: "yes", notes: "connector (priced via models.dev openai)" }
|
|
457
|
+
: { id, pricing: "partial", notes: "connector (pricing snapshot missing openai)" };
|
|
458
|
+
}
|
|
459
|
+
if (id === "google-gemini-cli") {
|
|
460
|
+
return snapshotHasProvider("google")
|
|
461
|
+
? { id, pricing: "yes", notes: "connector (priced via models.dev google)" }
|
|
462
|
+
: { id, pricing: "partial", notes: "connector (pricing snapshot missing google)" };
|
|
463
|
+
}
|
|
464
|
+
// Connector providers: pricing exists when model IDs can be mapped into snapshot pricing keys.
|
|
465
|
+
// Use local history as the source of truth.
|
|
466
|
+
const hasAnyUsage = params.agg.bySourceProvider.some((p) => p.providerID === id);
|
|
467
|
+
const hasAnyUnknown = params.agg.unknown.some((u) => u.key.sourceProviderID === id);
|
|
468
|
+
// Note: agg.byModel is already mapped to official pricing keys, not source provider IDs.
|
|
469
|
+
// So for connector providers we infer pricing availability based on whether we saw usage at all
|
|
470
|
+
// and whether it was mappable.
|
|
471
|
+
if (!hasAnyUsage && !hasAnyUnknown) {
|
|
472
|
+
return { id, pricing: "no", notes: "no local usage observed" };
|
|
473
|
+
}
|
|
474
|
+
if (hasAnyUnknown) {
|
|
475
|
+
return {
|
|
476
|
+
id,
|
|
477
|
+
pricing: "partial",
|
|
478
|
+
notes: "some models not in snapshot (see unpriced_models / unknown_pricing)",
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
return {
|
|
482
|
+
id,
|
|
483
|
+
pricing: "yes",
|
|
484
|
+
notes: "model IDs map into snapshot pricing",
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
export async function buildQuotaStatusReport(params) {
|
|
488
|
+
return renderPlainTextReport(await buildQuotaStatusReportDocument(params));
|
|
489
|
+
}
|
|
490
|
+
export async function buildQuotaStatusReportDocument(params) {
|
|
491
|
+
const homeDir = params.homeDir ?? homedir();
|
|
492
|
+
const version = await getPackageVersion();
|
|
493
|
+
const v = version ?? "unknown";
|
|
494
|
+
const modelDisplay = params.currentModel
|
|
495
|
+
? params.currentModel
|
|
496
|
+
: params.sessionModelLookup === "not_found"
|
|
497
|
+
? "(error: session.get returned no modelID)"
|
|
498
|
+
: params.sessionModelLookup === "no_session"
|
|
499
|
+
? "(no session available)"
|
|
500
|
+
: "(unknown)";
|
|
501
|
+
const sections = [];
|
|
502
|
+
// === toast diagnostics ===
|
|
503
|
+
const toastLines = [
|
|
504
|
+
`- configSource: ${params.configSource}`,
|
|
505
|
+
`- configPaths: ${joinOrNone(params.configPaths)}`,
|
|
506
|
+
`- precedence: ${getConfigPrecedenceLabel(params.configSource)}`,
|
|
507
|
+
`- global_config_paths: ${joinOrNone(params.globalConfigPaths ?? [])}`,
|
|
508
|
+
`- workspace_config_paths: ${joinOrNone(params.workspaceConfigPaths ?? [])}`,
|
|
509
|
+
`- setting_sources: ${formatSettingSources(params.settingSources)}`,
|
|
510
|
+
`- enabledProviders: ${params.enabledProviders === "auto" ? "(auto)" : params.enabledProviders.length ? params.enabledProviders.join(",") : "(none)"}`,
|
|
511
|
+
`- onlyCurrentModel: ${params.onlyCurrentModel ? "true" : "false"}`,
|
|
512
|
+
`- currentModel: ${modelDisplay}`,
|
|
513
|
+
];
|
|
514
|
+
if (params.configIssues?.length) {
|
|
515
|
+
toastLines.push("- config_errors:");
|
|
516
|
+
for (const issue of params.configIssues) {
|
|
517
|
+
toastLines.push(` - ${sanitizeSingleLineDisplayText(issue.path)} ${sanitizeSingleLineDisplayText(issue.key)}: ${sanitizeSingleLineDisplayText(issue.message)}`);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (params.runtimeRoots) {
|
|
521
|
+
toastLines.push(`- workspace_root: ${params.runtimeRoots.workspaceRoot}`);
|
|
522
|
+
toastLines.push(`- config_root: ${params.runtimeRoots.configRoot}`);
|
|
523
|
+
}
|
|
524
|
+
toastLines.push("- providers:");
|
|
525
|
+
for (const p of params.providerAvailability) {
|
|
526
|
+
const bits = [];
|
|
527
|
+
bits.push(p.enabled ? "enabled" : "disabled");
|
|
528
|
+
bits.push(p.available ? "available" : "unavailable");
|
|
529
|
+
if (p.matchesCurrentModel !== undefined) {
|
|
530
|
+
bits.push(`matchesCurrentModel=${p.matchesCurrentModel ? "yes" : "no"}`);
|
|
531
|
+
}
|
|
532
|
+
toastLines.push(` - ${p.id}: ${bits.join(" ")}`);
|
|
533
|
+
}
|
|
534
|
+
sections.push(createLinesSection("toast", "toast:", toastLines));
|
|
535
|
+
const quotaProvidersSection = createQuotaProvidersSection({
|
|
536
|
+
definitions: params.quotaProviders ?? [],
|
|
537
|
+
probes: params.providerLiveProbes,
|
|
538
|
+
});
|
|
539
|
+
if (quotaProvidersSection) {
|
|
540
|
+
sections.push(quotaProvidersSection);
|
|
541
|
+
}
|
|
542
|
+
if (params.maintainerAnnouncements) {
|
|
543
|
+
const announcements = params.maintainerAnnouncements;
|
|
544
|
+
const summary = announcements.summary;
|
|
545
|
+
sections.push(createLinesSection("maintainer_announcements", "maintainer_announcements:", [
|
|
546
|
+
`- enabled: ${announcements.config.enabled ? "true" : "false"}`,
|
|
547
|
+
`- home: ${announcements.config.home ? "true" : "false"}`,
|
|
548
|
+
`- home_frequency: ${announcements.config.homeFrequency}`,
|
|
549
|
+
`- source: ${summary.source}`,
|
|
550
|
+
`- network: ${summary.network ? "true" : "false"}`,
|
|
551
|
+
`- active: ${summary.activeCount}`,
|
|
552
|
+
`- future: ${summary.futureCount}`,
|
|
553
|
+
`- expired: ${summary.expiredCount}`,
|
|
554
|
+
]));
|
|
555
|
+
}
|
|
556
|
+
// === paths ===
|
|
557
|
+
const pathsRows = [];
|
|
558
|
+
const runtime = getOpencodeRuntimeDirs();
|
|
559
|
+
pathsRows.push({
|
|
560
|
+
key: "opencode_dirs",
|
|
561
|
+
value: `data=${runtime.dataDir} config=${runtime.configDir} cache=${runtime.cacheDir} state=${runtime.stateDir}`,
|
|
562
|
+
});
|
|
563
|
+
const dbPath = getOpenCodeDbPath();
|
|
564
|
+
pathsRows.push({
|
|
565
|
+
key: "opencode.db",
|
|
566
|
+
value: `path=${dbPath} present=${(await pathExists(dbPath)) ? "true" : "false"} (session and token history)`,
|
|
567
|
+
});
|
|
568
|
+
appendProviderStatusDetailRows(pathsRows, "alibaba-coding-plan", params.providerLiveProbes, new Set([
|
|
569
|
+
"alibaba auth configured",
|
|
570
|
+
"alibaba_api_key_source",
|
|
571
|
+
"alibaba_api_key_checked_paths",
|
|
572
|
+
"alibaba_api_key_credential_database_paths",
|
|
573
|
+
"alibaba_coding_plan",
|
|
574
|
+
"alibaba_auth_error",
|
|
575
|
+
]));
|
|
576
|
+
sections.push(createKvSection("paths", "paths:", pathsRows));
|
|
577
|
+
// === credential_source ===
|
|
578
|
+
const credentialSource = getCredentialSourceDiagnostics();
|
|
579
|
+
sections.push(createKvSection("credential_source", "credential_source:", [
|
|
580
|
+
{
|
|
581
|
+
key: "source",
|
|
582
|
+
value: credentialSource.state === "bound" ? credentialSource.kind : "unbound",
|
|
583
|
+
},
|
|
584
|
+
{ key: "list_error", value: credentialSource.lastListError?.detail ?? "(none)" },
|
|
585
|
+
{
|
|
586
|
+
key: "failures",
|
|
587
|
+
value: joinOrNone(credentialSource.failures.map((failure) => [failure.integrationId, failure.label, failure.category, failure.detail]
|
|
588
|
+
.map((part) => sanitizeSingleLineDisplayText(part))
|
|
589
|
+
.join(":"))),
|
|
590
|
+
},
|
|
591
|
+
]));
|
|
592
|
+
for (const [id, providerId] of [
|
|
593
|
+
["openai", "openai"],
|
|
594
|
+
["anthropic", "anthropic"],
|
|
595
|
+
]) {
|
|
596
|
+
sections.push(createProviderStatusSection({
|
|
597
|
+
id,
|
|
598
|
+
title: `${id}:`,
|
|
599
|
+
providerId,
|
|
600
|
+
probes: params.providerLiveProbes,
|
|
601
|
+
availability: params.providerAvailability,
|
|
602
|
+
homeDir,
|
|
603
|
+
}));
|
|
604
|
+
}
|
|
605
|
+
// === cursor ===
|
|
606
|
+
const cursorRows = [];
|
|
607
|
+
appendProviderStatusDetailRows(cursorRows, "cursor", params.providerLiveProbes);
|
|
608
|
+
appendProviderStatusDetailRows(cursorRows, "alibaba-coding-plan", params.providerLiveProbes, new Set(["alibaba coding plan local quota", "alibaba coding plan error"]));
|
|
609
|
+
appendProviderCompactLiveProbeRows(cursorRows, "cursor", params.providerLiveProbes, params.providerAvailability, homeDir);
|
|
610
|
+
sections.push(createKvSection("cursor", "cursor:", cursorRows));
|
|
611
|
+
const alibabaCodingPlanLiveProbeSection = createCompactLiveProbeOnlySection({
|
|
612
|
+
id: "alibaba_coding_plan",
|
|
613
|
+
title: "alibaba_coding_plan:",
|
|
614
|
+
providerId: "alibaba-coding-plan",
|
|
615
|
+
probes: params.providerLiveProbes,
|
|
616
|
+
availability: params.providerAvailability,
|
|
617
|
+
homeDir,
|
|
618
|
+
});
|
|
619
|
+
if (alibabaCodingPlanLiveProbeSection) {
|
|
620
|
+
sections.push(alibabaCodingPlanLiveProbeSection);
|
|
621
|
+
}
|
|
622
|
+
const alibabaTokenPlanLiveProbeSection = createCompactLiveProbeOnlySection({
|
|
623
|
+
id: "alibaba_token_plan",
|
|
624
|
+
title: "alibaba_token_plan:",
|
|
625
|
+
providerId: "alibaba-token-plan",
|
|
626
|
+
probes: params.providerLiveProbes,
|
|
627
|
+
availability: params.providerAvailability,
|
|
628
|
+
homeDir,
|
|
629
|
+
});
|
|
630
|
+
if (alibabaTokenPlanLiveProbeSection) {
|
|
631
|
+
sections.push(alibabaTokenPlanLiveProbeSection);
|
|
632
|
+
}
|
|
633
|
+
for (const section of [
|
|
634
|
+
{ id: "minimax", title: "minimax:", providerId: "minimax-coding-plan" },
|
|
635
|
+
{
|
|
636
|
+
id: "minimax_china",
|
|
637
|
+
title: "minimax_china:",
|
|
638
|
+
providerId: "minimax-china-coding-plan",
|
|
639
|
+
},
|
|
640
|
+
{ id: "kimi", title: "kimi:", providerId: "kimi-code-plan-global" },
|
|
641
|
+
{ id: "kimi_cn", title: "kimi_cn:", providerId: "kimi-code-plan-cn" },
|
|
642
|
+
{
|
|
643
|
+
id: "opencode_go",
|
|
644
|
+
title: "opencode_go:",
|
|
645
|
+
providerId: "opencode-go",
|
|
646
|
+
detailKeys: OPENCODE_GO_STATUS_DETAIL_KEYS,
|
|
647
|
+
},
|
|
648
|
+
{ id: "opencode_zen", title: "opencode_zen:", providerId: "opencode" },
|
|
649
|
+
{ id: "xiaomi", title: "xiaomi:", providerId: "xiaomi" },
|
|
650
|
+
{ id: "zai", title: "zai:", providerId: "zai" },
|
|
651
|
+
{ id: "zhipu", title: "zhipu:", providerId: "zhipu" },
|
|
652
|
+
{ id: "synthetic", title: "synthetic:", providerId: "synthetic" },
|
|
653
|
+
{ id: "chutes", title: "chutes:", providerId: "chutes" },
|
|
654
|
+
{ id: "deepseek", title: "deepseek:", providerId: "deepseek" },
|
|
655
|
+
{ id: "xai", title: "xai:", providerId: "xai", includeDetails: false },
|
|
656
|
+
{ id: "nanogpt", title: "nanogpt:", providerId: "nanogpt" },
|
|
657
|
+
{ id: "openrouter", title: "openrouter:", providerId: "openrouter" },
|
|
658
|
+
{
|
|
659
|
+
id: "copilot_quota_auth",
|
|
660
|
+
title: "copilot_quota_auth:",
|
|
661
|
+
providerId: "copilot",
|
|
662
|
+
},
|
|
663
|
+
]) {
|
|
664
|
+
sections.push(createProviderStatusSection({
|
|
665
|
+
...section,
|
|
666
|
+
probes: params.providerLiveProbes,
|
|
667
|
+
availability: params.providerAvailability,
|
|
668
|
+
homeDir,
|
|
669
|
+
}));
|
|
670
|
+
}
|
|
671
|
+
if (findProviderLiveProbe("kilo", params.providerLiveProbes)) {
|
|
672
|
+
sections.push(createProviderStatusSection({
|
|
673
|
+
id: "kilo",
|
|
674
|
+
title: "kilo:",
|
|
675
|
+
providerId: "kilo",
|
|
676
|
+
probes: params.providerLiveProbes,
|
|
677
|
+
availability: params.providerAvailability,
|
|
678
|
+
homeDir,
|
|
679
|
+
}));
|
|
680
|
+
}
|
|
681
|
+
for (const [id, providerId] of [
|
|
682
|
+
["google_gemini_cli", "google-gemini-cli"],
|
|
683
|
+
["google_agy", "google-agy"],
|
|
684
|
+
]) {
|
|
685
|
+
sections.push(createProviderStatusSection({
|
|
686
|
+
id,
|
|
687
|
+
title: `${id}:`,
|
|
688
|
+
providerId,
|
|
689
|
+
probes: params.providerLiveProbes,
|
|
690
|
+
availability: params.providerAvailability,
|
|
691
|
+
homeDir,
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
// === session token errors ===
|
|
695
|
+
if (params.sessionTokenError) {
|
|
696
|
+
const sessionTokenErrorRows = [
|
|
697
|
+
{ key: "session_id", value: params.sessionTokenError.sessionID },
|
|
698
|
+
{ key: "error", value: params.sessionTokenError.error },
|
|
699
|
+
];
|
|
700
|
+
if (params.sessionTokenError.checkedPath) {
|
|
701
|
+
sessionTokenErrorRows.push({
|
|
702
|
+
key: "checked_path",
|
|
703
|
+
value: params.sessionTokenError.checkedPath,
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
sections.push(createKvSection("session_tokens_error", "session_tokens_error:", sessionTokenErrorRows));
|
|
707
|
+
}
|
|
708
|
+
// === storage scan ===
|
|
709
|
+
const dbStats = await getOpenCodeDbStats();
|
|
710
|
+
sections.push(createKvSection("storage", "storage:", [
|
|
711
|
+
{ key: "sessions_in_db", value: fmtInt(dbStats.sessionCount) },
|
|
712
|
+
{ key: "messages_in_db", value: fmtInt(dbStats.messageCount) },
|
|
713
|
+
{ key: "assistant_messages_in_db", value: fmtInt(dbStats.assistantMessageCount) },
|
|
714
|
+
]));
|
|
715
|
+
// === pricing snapshot ===
|
|
716
|
+
const agg = await aggregateUsage({});
|
|
717
|
+
const meta = getPricingSnapshotMeta();
|
|
718
|
+
const providers = listProviders();
|
|
719
|
+
const coverage = computePricingCoverageFromAgg(agg);
|
|
720
|
+
const refreshPolicy = getPricingRefreshPolicy();
|
|
721
|
+
const autoRefreshDays = Math.round(refreshPolicy.maxAgeMs / (24 * 60 * 60 * 1000));
|
|
722
|
+
const health = getPricingSnapshotHealth({
|
|
723
|
+
maxAgeMs: refreshPolicy.maxAgeMs,
|
|
724
|
+
});
|
|
725
|
+
const snapshotSource = getPricingSnapshotSource();
|
|
726
|
+
const runtimeSnapshotPath = getRuntimePricingSnapshotPath();
|
|
727
|
+
const refreshStatePath = getRuntimePricingRefreshStatePath();
|
|
728
|
+
const pricingRefreshState = await readPricingRefreshState();
|
|
729
|
+
const pricingRows = [
|
|
730
|
+
{
|
|
731
|
+
key: "pricing",
|
|
732
|
+
value: `source=${meta.source} active_source=${snapshotSource} generated_at=${new Date(meta.generatedAt).toISOString()} units=${meta.units}`,
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
key: "selection",
|
|
736
|
+
value: `configured=${params.pricingSnapshotSource} active=${snapshotSource}`,
|
|
737
|
+
},
|
|
738
|
+
];
|
|
739
|
+
if (params.pricingSnapshotSource === "bundled") {
|
|
740
|
+
pricingRows.push({
|
|
741
|
+
key: "selection_note",
|
|
742
|
+
value: "bundled config pins the packaged snapshot and ignores runtime refresh for active pricing",
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
else if (params.pricingSnapshotSource === "runtime" && snapshotSource !== "runtime") {
|
|
746
|
+
pricingRows.push({
|
|
747
|
+
key: "selection_note",
|
|
748
|
+
value: "runtime config requested the local runtime snapshot, but bundled fallback is active because no valid runtime snapshot is available",
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
pricingRows.push({
|
|
752
|
+
key: "runtime_paths",
|
|
753
|
+
value: `snapshot=${runtimeSnapshotPath} refresh_state=${refreshStatePath}`,
|
|
754
|
+
});
|
|
755
|
+
pricingRows.push({
|
|
756
|
+
key: "staleness",
|
|
757
|
+
value: `age_ms=${fmtInt(health.ageMs)} max_age_ms=${fmtInt(health.maxAgeMs)} stale=${health.stale ? "true" : "false"}`,
|
|
758
|
+
});
|
|
759
|
+
pricingRows.push({
|
|
760
|
+
key: "refresh_policy",
|
|
761
|
+
value: `auto_refresh_days=${fmtInt(autoRefreshDays)}`,
|
|
762
|
+
});
|
|
763
|
+
if (pricingRefreshState) {
|
|
764
|
+
pricingRows.push({
|
|
765
|
+
key: "refresh",
|
|
766
|
+
value: `last_attempt_at=${pricingRefreshState.lastAttemptAt ? new Date(pricingRefreshState.lastAttemptAt).toISOString() : "(none)"} last_success_at=${pricingRefreshState.lastSuccessAt ? new Date(pricingRefreshState.lastSuccessAt).toISOString() : "(none)"} last_failure_at=${pricingRefreshState.lastFailureAt ? new Date(pricingRefreshState.lastFailureAt).toISOString() : "(none)"} last_result=${pricingRefreshState.lastResult ?? "(none)"}`,
|
|
767
|
+
});
|
|
768
|
+
if (pricingRefreshState.lastError) {
|
|
769
|
+
pricingRows.push({ key: "refresh_error", value: pricingRefreshState.lastError });
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
else {
|
|
773
|
+
pricingRows.push({ key: "refresh", value: "(no runtime refresh state yet)" });
|
|
774
|
+
}
|
|
775
|
+
pricingRows.push({ key: "providers", value: providers.join(",") });
|
|
776
|
+
pricingRows.push({
|
|
777
|
+
key: "coverage_seen",
|
|
778
|
+
value: `priced_keys=${fmtInt(coverage.totals.pricedKeysSeen)} mapped_but_missing=${fmtInt(coverage.totals.mappedMissingKeysSeen)} unpriced_keys=${fmtInt(coverage.totals.unpricedKeysSeen)}`,
|
|
779
|
+
});
|
|
780
|
+
for (const p of providers) {
|
|
781
|
+
const c = coverage.byProvider.get(p) ?? {
|
|
782
|
+
pricedKeysSeen: 0,
|
|
783
|
+
mappedMissingKeysSeen: 0,
|
|
784
|
+
unpricedKeysSeen: 0,
|
|
785
|
+
};
|
|
786
|
+
pricingRows.push({
|
|
787
|
+
key: p,
|
|
788
|
+
value: `models=${fmtInt(getProviderModelCount(p))} priced_models_seen=${fmtInt(c.pricedKeysSeen)} mapped_but_missing_models_seen=${fmtInt(c.mappedMissingKeysSeen)} unpriced_models_seen=${fmtInt(c.unpricedKeysSeen)}`,
|
|
789
|
+
indent: 1,
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
sections.push(createKvSection("pricing_snapshot", "pricing_snapshot:", pricingRows));
|
|
793
|
+
// === supported providers pricing ===
|
|
794
|
+
const supported = getProviders().map((p) => p.id);
|
|
795
|
+
const supportedRows = supported.map((id) => {
|
|
796
|
+
const row = supportedProviderPricingRow({ id, agg, snapshotProviders: providers });
|
|
797
|
+
return {
|
|
798
|
+
key: row.id,
|
|
799
|
+
value: `pricing=${row.pricing} (${row.notes})`,
|
|
800
|
+
};
|
|
801
|
+
});
|
|
802
|
+
sections.push(createKvSection("supported_providers_pricing", "supported_providers_pricing:", supportedRows));
|
|
803
|
+
// === unpriced models ===
|
|
804
|
+
const unpricedRows = [];
|
|
805
|
+
if (agg.unpriced.length === 0) {
|
|
806
|
+
unpricedRows.push({ key: "none" });
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
unpricedRows.push({
|
|
810
|
+
key: "keys",
|
|
811
|
+
value: `${fmtInt(agg.unpriced.length)} tokens_total=${fmtInt(totalTokenBuckets(agg.totals.unpriced))}`,
|
|
812
|
+
});
|
|
813
|
+
for (const row of agg.unpriced.slice(0, STATUS_SAMPLE_LIMIT)) {
|
|
814
|
+
const src = `${row.key.sourceProviderID}/${row.key.sourceModelID}`;
|
|
815
|
+
const mapped = `${row.key.mappedProvider}/${row.key.mappedModel}`;
|
|
816
|
+
unpricedRows.push({
|
|
817
|
+
key: src,
|
|
818
|
+
value: `mapped=${mapped} tokens=${fmtInt(totalTokenBuckets(row.tokens))} msgs=${fmtInt(row.messageCount)} reason=${row.key.reason}`,
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
if (agg.unpriced.length > STATUS_SAMPLE_LIMIT) {
|
|
822
|
+
unpricedRows.push({ key: `… (${fmtInt(agg.unpriced.length - STATUS_SAMPLE_LIMIT)} more)` });
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
sections.push(createKvSection("unpriced_models", "unpriced_models:", unpricedRows));
|
|
826
|
+
// === unknown pricing ===
|
|
827
|
+
const unknownRows = [];
|
|
828
|
+
if (agg.unknown.length === 0) {
|
|
829
|
+
unknownRows.push({ key: "none" });
|
|
830
|
+
}
|
|
831
|
+
else {
|
|
832
|
+
unknownRows.push({
|
|
833
|
+
key: "keys",
|
|
834
|
+
value: `${fmtInt(agg.unknown.length)} tokens_total=${fmtInt(totalTokenBuckets(agg.totals.unknown))}`,
|
|
835
|
+
});
|
|
836
|
+
for (const row of agg.unknown.slice(0, STATUS_SAMPLE_LIMIT)) {
|
|
837
|
+
const src = `${row.key.sourceProviderID}/${row.key.sourceModelID}`;
|
|
838
|
+
const mappedBase = row.key.mappedProvider && row.key.mappedModel
|
|
839
|
+
? `${row.key.mappedProvider}/${row.key.mappedModel}`
|
|
840
|
+
: "(none)";
|
|
841
|
+
const candidates = row.key.providerCandidates && row.key.providerCandidates.length > 0
|
|
842
|
+
? ` candidates=${row.key.providerCandidates.join(",")}`
|
|
843
|
+
: "";
|
|
844
|
+
unknownRows.push({
|
|
845
|
+
key: src,
|
|
846
|
+
value: `mapped=${mappedBase}${candidates} tokens=${fmtInt(totalTokenBuckets(row.tokens))} msgs=${fmtInt(row.messageCount)}`,
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
if (agg.unknown.length > STATUS_SAMPLE_LIMIT) {
|
|
850
|
+
unknownRows.push({ key: `… (${fmtInt(agg.unknown.length - STATUS_SAMPLE_LIMIT)} more)` });
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
sections.push(createKvSection("unknown_pricing", "unknown_pricing:", unknownRows));
|
|
854
|
+
// Users paste this report into public issues: show the home dir as "~" in every path
|
|
855
|
+
// so it does not reveal their computer's user name.
|
|
856
|
+
return replaceHomeDirWithTildeInDocument({
|
|
857
|
+
heading: commandHeading({
|
|
858
|
+
title: `Quota Status (opencode-quota-gui v${v}) (/quota_status)`,
|
|
859
|
+
detail: `opencode-quota-gui v${v}`,
|
|
860
|
+
generatedAtMs: params.generatedAtMs,
|
|
861
|
+
}),
|
|
862
|
+
sections,
|
|
863
|
+
}, homeDir);
|
|
864
|
+
}
|
|
865
|
+
//# sourceMappingURL=quota-status.js.map
|