opencode-quota-gui 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +243 -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/card-order.d.ts +25 -0
- package/dist/contracts/card-order.d.ts.map +1 -0
- package/dist/contracts/card-order.js +50 -0
- package/dist/contracts/card-order.js.map +1 -0
- package/dist/contracts/dashboard.d.ts +368 -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 +56 -0
- package/dist/gui/config.d.ts.map +1 -0
- package/dist/gui/config.js +701 -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 +55 -0
- package/dist/gui/provider-cards.d.ts.map +1 -0
- package/dist/gui/provider-cards.js +417 -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 +99 -0
- package/dist/gui/sources.d.ts.map +1 -0
- package/dist/gui/sources.js +410 -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 +1352 -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/dashboard-visibility.d.ts +13 -0
- package/dist/lib/dashboard-visibility.d.ts.map +1 -0
- package/dist/lib/dashboard-visibility.js +51 -0
- package/dist/lib/dashboard-visibility.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 +367 -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 +96 -0
- package/dist/lib/opencode-console-auth.d.ts.map +1 -0
- package/dist/lib/opencode-console-auth.js +213 -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 +284 -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 +60 -0
- package/dist/lib/openrouter.d.ts.map +1 -0
- package/dist/lib/openrouter.js +215 -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 +757 -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 +479 -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 +738 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +85 -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 +67 -0
- package/dist/providers/cache-policies.d.ts.map +1 -0
- package/dist/providers/cache-policies.js +263 -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 +409 -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 +288 -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 +94 -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-CPEiQt-C.js +8 -0
- package/dist/ui/assets/index-D3-Yn_WA.css +1 -0
- package/dist/ui/index.html +13 -0
- package/package.json +123 -3
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compact, versioned analytics snapshot persistence (schema v3).
|
|
3
|
+
*
|
|
4
|
+
* The worker owns the large in-memory analytics index. Persistence keeps one
|
|
5
|
+
* compact fingerprint contribution dictionary (referenced by numeric index),
|
|
6
|
+
* occurrence membership (message/session identity + revision watermark), the
|
|
7
|
+
* stable source identity, the coverage extent/frontier, the trusted source
|
|
8
|
+
* cursor and rare-repair wall time. The compact index excludes raw message
|
|
9
|
+
* JSON, assistant agent strings, compaction markers, and duplicate raw rows. A separate
|
|
10
|
+
* local presentation sidecar may carry bounded Home/Project/Session DTO detail
|
|
11
|
+
* (including the DTO's agent fields and compaction markers).
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync } from "node:fs";
|
|
14
|
+
import { mkdir, open, readFile, rename, stat, unlink } from "node:fs/promises";
|
|
15
|
+
import { dirname, join } from "node:path";
|
|
16
|
+
import { isRangeKey } from "../contracts/ranges.js";
|
|
17
|
+
import { getOpencodeRuntimeDirs } from "../lib/opencode-runtime-paths.js";
|
|
18
|
+
import { rawAssistantRowFingerprint, } from "../lib/opencode-storage.js";
|
|
19
|
+
export const ANALYTICS_SNAPSHOT_VERSION = 3;
|
|
20
|
+
export const ANALYTICS_SNAPSHOT_SCHEMA = "ocq-analytics-state";
|
|
21
|
+
/**
|
|
22
|
+
* In-memory newest session DTOs retained. The serialized sidecar can keep
|
|
23
|
+
* fewer because its byte budget is a disk cap, not a heap bound.
|
|
24
|
+
*/
|
|
25
|
+
export const ANALYTICS_PRESENTATION_SESSION_LIMIT = 8;
|
|
26
|
+
export function rowKey(sessionID, messageID) {
|
|
27
|
+
return `${sessionID}\u0000${messageID}`;
|
|
28
|
+
}
|
|
29
|
+
export function fingerprintOf(row) {
|
|
30
|
+
return rawAssistantRowFingerprint(row);
|
|
31
|
+
}
|
|
32
|
+
export function compactFingerprintOf(row) {
|
|
33
|
+
return [
|
|
34
|
+
row.createdAtMs,
|
|
35
|
+
row.completedAtMs,
|
|
36
|
+
row.providerID ?? null,
|
|
37
|
+
row.modelID ?? null,
|
|
38
|
+
row.tokens.input,
|
|
39
|
+
row.tokens.output,
|
|
40
|
+
row.tokens.reasoning,
|
|
41
|
+
row.tokens.cacheRead,
|
|
42
|
+
row.tokens.cacheWrite,
|
|
43
|
+
row.cost ?? null,
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
export function rowFromFingerprint(fingerprint, occurrence) {
|
|
47
|
+
const row = {
|
|
48
|
+
sessionID: occurrence.sessionID,
|
|
49
|
+
messageID: occurrence.messageID,
|
|
50
|
+
createdAtMs: fingerprint[0],
|
|
51
|
+
completedAtMs: fingerprint[1],
|
|
52
|
+
tokens: {
|
|
53
|
+
input: fingerprint[4],
|
|
54
|
+
output: fingerprint[5],
|
|
55
|
+
reasoning: fingerprint[6],
|
|
56
|
+
cacheRead: fingerprint[7],
|
|
57
|
+
cacheWrite: fingerprint[8],
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
if (fingerprint[2] !== null)
|
|
61
|
+
row.providerID = fingerprint[2];
|
|
62
|
+
if (fingerprint[3] !== null)
|
|
63
|
+
row.modelID = fingerprint[3];
|
|
64
|
+
if (fingerprint[9] !== null)
|
|
65
|
+
row.cost = fingerprint[9];
|
|
66
|
+
if (occurrence.agent !== undefined)
|
|
67
|
+
row.agent = occurrence.agent;
|
|
68
|
+
return row;
|
|
69
|
+
}
|
|
70
|
+
export function encodeAnalyticsState(state, savedAtMs) {
|
|
71
|
+
const occurrences = [];
|
|
72
|
+
for (const occurrence of state.occurrences.values()) {
|
|
73
|
+
occurrences.push([
|
|
74
|
+
occurrence.fingerprintIndex,
|
|
75
|
+
occurrence.sessionID,
|
|
76
|
+
occurrence.messageID,
|
|
77
|
+
occurrence.updatedAtMs,
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
const sessions = Object.values(state.sessions)
|
|
81
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
82
|
+
.map((session) => [
|
|
83
|
+
session.id,
|
|
84
|
+
session.title ?? null,
|
|
85
|
+
session.parentID ?? null,
|
|
86
|
+
session.projectID ?? null,
|
|
87
|
+
session.directory ?? null,
|
|
88
|
+
session.time?.created ?? null,
|
|
89
|
+
session.time?.updated ?? null,
|
|
90
|
+
session.agent ?? null,
|
|
91
|
+
]);
|
|
92
|
+
const projects = Object.values(state.projects)
|
|
93
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))
|
|
94
|
+
.map((project) => [
|
|
95
|
+
project.id,
|
|
96
|
+
project.name ?? null,
|
|
97
|
+
[...project.directories],
|
|
98
|
+
[...project.worktrees],
|
|
99
|
+
]);
|
|
100
|
+
return {
|
|
101
|
+
version: ANALYTICS_SNAPSHOT_VERSION,
|
|
102
|
+
schema: ANALYTICS_SNAPSHOT_SCHEMA,
|
|
103
|
+
savedAtMs,
|
|
104
|
+
frontierAtMs: state.frontierAtMs,
|
|
105
|
+
sourceCursorAtMs: state.sourceCursorAtMs ?? null,
|
|
106
|
+
lastFullRepairAtMs: state.lastFullRepairAtMs ?? null,
|
|
107
|
+
sourceIdentity: state.sourceIdentity ? identityToTuple(state.sourceIdentity) : null,
|
|
108
|
+
extent: state.extent === undefined
|
|
109
|
+
? null
|
|
110
|
+
: { sinceMs: state.extent.sinceMs ?? null, untilMs: state.extent.untilMs },
|
|
111
|
+
fingerprints: state.fingerprints,
|
|
112
|
+
occurrences,
|
|
113
|
+
sessions,
|
|
114
|
+
projects,
|
|
115
|
+
// The warm presentation cache lives in its own small sidecar so the big
|
|
116
|
+
// index can load lazily after the first useful view.
|
|
117
|
+
presentation: null,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function identityToTuple(identity) {
|
|
121
|
+
return [
|
|
122
|
+
identity.dbPath,
|
|
123
|
+
identity.exists,
|
|
124
|
+
identity.status,
|
|
125
|
+
identity.realPath ?? null,
|
|
126
|
+
identity.device ?? null,
|
|
127
|
+
identity.inode ?? null,
|
|
128
|
+
identity.birthtimeMs ?? null,
|
|
129
|
+
identity.schemaToken ?? null,
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
function identityFromTuple(tuple) {
|
|
133
|
+
const identity = {
|
|
134
|
+
dbPath: tuple[0],
|
|
135
|
+
exists: tuple[1],
|
|
136
|
+
status: tuple[2],
|
|
137
|
+
};
|
|
138
|
+
if (tuple[3] !== null)
|
|
139
|
+
identity.realPath = tuple[3];
|
|
140
|
+
if (tuple[4] !== null)
|
|
141
|
+
identity.device = tuple[4];
|
|
142
|
+
if (tuple[5] !== null)
|
|
143
|
+
identity.inode = tuple[5];
|
|
144
|
+
if (tuple[6] !== null)
|
|
145
|
+
identity.birthtimeMs = tuple[6];
|
|
146
|
+
if (tuple[7] !== null)
|
|
147
|
+
identity.schemaToken = tuple[7];
|
|
148
|
+
return identity;
|
|
149
|
+
}
|
|
150
|
+
function isFiniteNumber(value) {
|
|
151
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
152
|
+
}
|
|
153
|
+
function isStringOrNull(value) {
|
|
154
|
+
return value === null || typeof value === "string";
|
|
155
|
+
}
|
|
156
|
+
function isStringArray(value) {
|
|
157
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
158
|
+
}
|
|
159
|
+
function isCompactFingerprint(value) {
|
|
160
|
+
if (!Array.isArray(value) || value.length !== 10)
|
|
161
|
+
return false;
|
|
162
|
+
if (!isFiniteNumber(value[0]) || !isFiniteNumber(value[1]))
|
|
163
|
+
return false;
|
|
164
|
+
if (!isStringOrNull(value[2]) || !isStringOrNull(value[3]))
|
|
165
|
+
return false;
|
|
166
|
+
for (let index = 4; index <= 8; index += 1) {
|
|
167
|
+
if (!isFiniteNumber(value[index]))
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
return value[9] === null || isFiniteNumber(value[9]);
|
|
171
|
+
}
|
|
172
|
+
function isOccurrenceTuple(value, fingerprintCount) {
|
|
173
|
+
if (!Array.isArray(value) || value.length !== 4)
|
|
174
|
+
return false;
|
|
175
|
+
if (!Number.isInteger(value[0]) || value[0] < 0 || value[0] >= fingerprintCount)
|
|
176
|
+
return false;
|
|
177
|
+
return (typeof value[1] === "string" &&
|
|
178
|
+
value[1].length > 0 &&
|
|
179
|
+
typeof value[2] === "string" &&
|
|
180
|
+
value[2].length > 0 &&
|
|
181
|
+
(value[3] === null || isFiniteNumber(value[3])));
|
|
182
|
+
}
|
|
183
|
+
function isCompactSession(value) {
|
|
184
|
+
if (!Array.isArray(value) || (value.length !== 7 && value.length !== 8))
|
|
185
|
+
return false;
|
|
186
|
+
if (value.length === 8 && !isStringOrNull(value[7]))
|
|
187
|
+
return false;
|
|
188
|
+
if (typeof value[0] !== "string" || value[0].length === 0)
|
|
189
|
+
return false;
|
|
190
|
+
if (!isStringOrNull(value[1]) || !isStringOrNull(value[2]))
|
|
191
|
+
return false;
|
|
192
|
+
if (!isStringOrNull(value[3]) || !isStringOrNull(value[4]))
|
|
193
|
+
return false;
|
|
194
|
+
return ((value[5] === null || isFiniteNumber(value[5])) &&
|
|
195
|
+
(value[6] === null || isFiniteNumber(value[6])));
|
|
196
|
+
}
|
|
197
|
+
function isCompactProject(value) {
|
|
198
|
+
if (!Array.isArray(value) || value.length !== 4)
|
|
199
|
+
return false;
|
|
200
|
+
return (typeof value[0] === "string" &&
|
|
201
|
+
value[0].length > 0 &&
|
|
202
|
+
isStringOrNull(value[1]) &&
|
|
203
|
+
isStringArray(value[2]) &&
|
|
204
|
+
isStringArray(value[3]));
|
|
205
|
+
}
|
|
206
|
+
function isSourceIdentityTuple(value) {
|
|
207
|
+
if (!Array.isArray(value) || value.length !== 8)
|
|
208
|
+
return false;
|
|
209
|
+
if (typeof value[0] !== "string" || typeof value[1] !== "boolean")
|
|
210
|
+
return false;
|
|
211
|
+
if (value[2] !== "ok" && value[2] !== "missing" && value[2] !== "unreadable")
|
|
212
|
+
return false;
|
|
213
|
+
for (let index = 3; index <= 5; index += 1) {
|
|
214
|
+
if (!isStringOrNull(value[index]))
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
if (value[6] !== null && !isFiniteNumber(value[6]))
|
|
218
|
+
return false;
|
|
219
|
+
return isStringOrNull(value[7]);
|
|
220
|
+
}
|
|
221
|
+
function isPresentation(value) {
|
|
222
|
+
if (value === null || value === undefined)
|
|
223
|
+
return true;
|
|
224
|
+
if (typeof value !== "object")
|
|
225
|
+
return false;
|
|
226
|
+
const record = value;
|
|
227
|
+
const home = record.home;
|
|
228
|
+
if (home !== null && typeof home !== "object")
|
|
229
|
+
return false;
|
|
230
|
+
if (home) {
|
|
231
|
+
for (const [range, snapshot] of Object.entries(home)) {
|
|
232
|
+
if (!isRangeKey(range))
|
|
233
|
+
return false;
|
|
234
|
+
if (typeof snapshot !== "object" || snapshot === null)
|
|
235
|
+
return false;
|
|
236
|
+
const candidate = snapshot;
|
|
237
|
+
if (!Array.isArray(candidate.projects))
|
|
238
|
+
return false;
|
|
239
|
+
if (typeof candidate.usage !== "object" || candidate.usage === null)
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const project = record.project;
|
|
244
|
+
if (!Array.isArray(project))
|
|
245
|
+
return false;
|
|
246
|
+
for (const entry of project) {
|
|
247
|
+
if (!Array.isArray(entry) || entry.length !== 3)
|
|
248
|
+
return false;
|
|
249
|
+
if (typeof entry[0] !== "string" || !isRangeKey(entry[1]))
|
|
250
|
+
return false;
|
|
251
|
+
if (typeof entry[2] !== "object" || entry[2] === null)
|
|
252
|
+
return false;
|
|
253
|
+
const snapshot = entry[2];
|
|
254
|
+
if (!Array.isArray(snapshot.roots))
|
|
255
|
+
return false;
|
|
256
|
+
if (typeof snapshot.usage !== "object" || snapshot.usage === null)
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
/** Parse and validate a persisted snapshot; any mismatch returns `undefined`. */
|
|
262
|
+
export function decodeAnalyticsState(value) {
|
|
263
|
+
if (typeof value !== "object" || value === null)
|
|
264
|
+
return undefined;
|
|
265
|
+
const record = value;
|
|
266
|
+
if (record.version !== ANALYTICS_SNAPSHOT_VERSION)
|
|
267
|
+
return undefined;
|
|
268
|
+
if (record.schema !== ANALYTICS_SNAPSHOT_SCHEMA)
|
|
269
|
+
return undefined;
|
|
270
|
+
if (!isFiniteNumber(record.frontierAtMs))
|
|
271
|
+
return undefined;
|
|
272
|
+
if (!isFiniteNumber(record.savedAtMs))
|
|
273
|
+
return undefined;
|
|
274
|
+
// Additive fields. A missing value is the safe legacy state: it forces a full
|
|
275
|
+
// source baseline instead of guessing a cursor from wall/cached timestamps.
|
|
276
|
+
const cursorValue = record.sourceCursorAtMs;
|
|
277
|
+
if (cursorValue !== undefined && cursorValue !== null && !isFiniteNumber(cursorValue)) {
|
|
278
|
+
return undefined;
|
|
279
|
+
}
|
|
280
|
+
const repairValue = record.lastFullRepairAtMs;
|
|
281
|
+
if (repairValue !== undefined && repairValue !== null && !isFiniteNumber(repairValue)) {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
const identityValue = record.sourceIdentity;
|
|
285
|
+
if (identityValue !== null &&
|
|
286
|
+
identityValue !== undefined &&
|
|
287
|
+
!isSourceIdentityTuple(identityValue)) {
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
const coverageValue = record.extent;
|
|
291
|
+
let extent;
|
|
292
|
+
if (coverageValue !== null && coverageValue !== undefined) {
|
|
293
|
+
if (typeof coverageValue !== "object" || coverageValue === null)
|
|
294
|
+
return undefined;
|
|
295
|
+
const coverageRecord = coverageValue;
|
|
296
|
+
const sinceMs = coverageRecord.sinceMs;
|
|
297
|
+
const untilMs = coverageRecord.untilMs;
|
|
298
|
+
if (!isFiniteNumber(untilMs))
|
|
299
|
+
return undefined;
|
|
300
|
+
if (sinceMs !== null && !isFiniteNumber(sinceMs))
|
|
301
|
+
return undefined;
|
|
302
|
+
if (typeof sinceMs === "number" && sinceMs > untilMs)
|
|
303
|
+
return undefined;
|
|
304
|
+
extent = sinceMs === null ? { untilMs } : { sinceMs, untilMs };
|
|
305
|
+
}
|
|
306
|
+
const sessionsValue = record.sessions;
|
|
307
|
+
const projectsValue = record.projects;
|
|
308
|
+
const fingerprintsValue = record.fingerprints;
|
|
309
|
+
const occurrencesValue = record.occurrences;
|
|
310
|
+
if (!Array.isArray(sessionsValue) || !sessionsValue.every(isCompactSession))
|
|
311
|
+
return undefined;
|
|
312
|
+
if (!Array.isArray(projectsValue) || !projectsValue.every(isCompactProject))
|
|
313
|
+
return undefined;
|
|
314
|
+
if (!Array.isArray(fingerprintsValue) || !fingerprintsValue.every(isCompactFingerprint)) {
|
|
315
|
+
return undefined;
|
|
316
|
+
}
|
|
317
|
+
if (!Array.isArray(occurrencesValue) ||
|
|
318
|
+
!occurrencesValue.every((entry) => isOccurrenceTuple(entry, fingerprintsValue.length))) {
|
|
319
|
+
return undefined;
|
|
320
|
+
}
|
|
321
|
+
if (!isPresentation(record.presentation))
|
|
322
|
+
return undefined;
|
|
323
|
+
const sessions = {};
|
|
324
|
+
for (const session of sessionsValue) {
|
|
325
|
+
const info = { id: session[0] };
|
|
326
|
+
if (session[1] !== null)
|
|
327
|
+
info.title = session[1];
|
|
328
|
+
if (session[2] !== null)
|
|
329
|
+
info.parentID = session[2];
|
|
330
|
+
if (session[3] !== null)
|
|
331
|
+
info.projectID = session[3];
|
|
332
|
+
if (session[4] !== null)
|
|
333
|
+
info.directory = session[4];
|
|
334
|
+
if (typeof session[7] === "string")
|
|
335
|
+
info.agent = session[7];
|
|
336
|
+
if (session[5] !== null || session[6] !== null) {
|
|
337
|
+
info.time = {
|
|
338
|
+
...(session[5] === null ? {} : { created: session[5] }),
|
|
339
|
+
...(session[6] === null ? {} : { updated: session[6] }),
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
sessions[info.id] = info;
|
|
343
|
+
}
|
|
344
|
+
const projects = {};
|
|
345
|
+
for (const project of projectsValue) {
|
|
346
|
+
const info = {
|
|
347
|
+
id: project[0],
|
|
348
|
+
directories: [...project[2]],
|
|
349
|
+
worktrees: [...project[3]],
|
|
350
|
+
};
|
|
351
|
+
if (project[1] !== null)
|
|
352
|
+
info.name = project[1];
|
|
353
|
+
projects[info.id] = info;
|
|
354
|
+
}
|
|
355
|
+
const fingerprints = fingerprintsValue;
|
|
356
|
+
const fingerprintIndex = new Map();
|
|
357
|
+
for (let index = 0; index < fingerprints.length; index += 1) {
|
|
358
|
+
const fingerprint = fingerprints[index];
|
|
359
|
+
if (!fingerprint)
|
|
360
|
+
return undefined;
|
|
361
|
+
const key = rawAssistantRowFingerprint(rowFromFingerprint(fingerprint, { sessionID: "decoded", messageID: "decoded" }));
|
|
362
|
+
fingerprintIndex.set(key, index);
|
|
363
|
+
}
|
|
364
|
+
const occurrences = new Map();
|
|
365
|
+
for (const tuple of occurrencesValue) {
|
|
366
|
+
const key = tuple[2];
|
|
367
|
+
if (occurrences.has(key))
|
|
368
|
+
return undefined;
|
|
369
|
+
occurrences.set(key, {
|
|
370
|
+
fingerprintIndex: tuple[0],
|
|
371
|
+
sessionID: tuple[1],
|
|
372
|
+
messageID: tuple[2],
|
|
373
|
+
updatedAtMs: tuple[3],
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
const persistedPresentation = record.presentation;
|
|
377
|
+
return {
|
|
378
|
+
sessions,
|
|
379
|
+
projects,
|
|
380
|
+
fingerprints,
|
|
381
|
+
fingerprintIndex,
|
|
382
|
+
occurrences,
|
|
383
|
+
...(extent ? { extent } : {}),
|
|
384
|
+
...(identityValue === null || identityValue === undefined
|
|
385
|
+
? {}
|
|
386
|
+
: { sourceIdentity: identityFromTuple(identityValue) }),
|
|
387
|
+
frontierAtMs: record.frontierAtMs,
|
|
388
|
+
savedAtMs: record.savedAtMs,
|
|
389
|
+
...(typeof cursorValue === "number" ? { sourceCursorAtMs: cursorValue } : {}),
|
|
390
|
+
...(typeof repairValue === "number" ? { lastFullRepairAtMs: repairValue } : {}),
|
|
391
|
+
...(persistedPresentation
|
|
392
|
+
? {
|
|
393
|
+
presentation: {
|
|
394
|
+
home: persistedPresentation.home,
|
|
395
|
+
project: persistedPresentation.project.map(([projectId, range, snapshot]) => [projectId, range, snapshot]),
|
|
396
|
+
// Session DTOs are sidecar-only; never restore them from the
|
|
397
|
+
// compact index even if a legacy file happens to contain them.
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
: {}),
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
export function defaultAnalyticsSnapshotPath() {
|
|
404
|
+
return join(getOpencodeRuntimeDirs().stateDir, "opencode-quota-gui", "analytics-v3.json");
|
|
405
|
+
}
|
|
406
|
+
export function defaultAnalyticsPresentationPath(snapshotPath) {
|
|
407
|
+
return `${snapshotPath}.presentation.json`;
|
|
408
|
+
}
|
|
409
|
+
export function encodeAnalyticsPresentation(state, savedAtMs) {
|
|
410
|
+
const session = (state.presentation?.session ?? [])
|
|
411
|
+
.slice(-ANALYTICS_PRESENTATION_SESSION_LIMIT)
|
|
412
|
+
.map(([sessionId, snapshot]) => [sessionId, snapshot]);
|
|
413
|
+
return {
|
|
414
|
+
version: ANALYTICS_SNAPSHOT_VERSION,
|
|
415
|
+
savedAtMs,
|
|
416
|
+
frontierAtMs: state.frontierAtMs,
|
|
417
|
+
sourceIdentity: state.sourceIdentity ? identityToTuple(state.sourceIdentity) : null,
|
|
418
|
+
coverage: state.extent
|
|
419
|
+
? { sinceMs: state.extent.sinceMs ?? null, untilMs: state.extent.untilMs }
|
|
420
|
+
: null,
|
|
421
|
+
presentation: state.presentation
|
|
422
|
+
? {
|
|
423
|
+
home: state.presentation.home,
|
|
424
|
+
project: state.presentation.project.map(([projectId, range, snapshot]) => [projectId, range, snapshot]),
|
|
425
|
+
...(session.length > 0 ? { session } : {}),
|
|
426
|
+
}
|
|
427
|
+
: null,
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function isSessionSnapshot(value, sessionId) {
|
|
431
|
+
if (typeof value !== "object" || value === null)
|
|
432
|
+
return false;
|
|
433
|
+
const record = value;
|
|
434
|
+
if (record.focusSessionId !== sessionId)
|
|
435
|
+
return false;
|
|
436
|
+
if (typeof record.projectId !== "string" || typeof record.projectName !== "string")
|
|
437
|
+
return false;
|
|
438
|
+
if (!Array.isArray(record.breadcrumbs) ||
|
|
439
|
+
!Array.isArray(record.nodes) ||
|
|
440
|
+
!Array.isArray(record.steps) ||
|
|
441
|
+
!Array.isArray(record.compactionMarkers)) {
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
if (typeof record.ownSummary !== "object" || record.ownSummary === null)
|
|
445
|
+
return false;
|
|
446
|
+
if (typeof record.treeTotals !== "object" || record.treeTotals === null)
|
|
447
|
+
return false;
|
|
448
|
+
return typeof record.stepSemantics === "string";
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Legacy absence means empty. All present entries are validated before the
|
|
452
|
+
* newest `ANALYTICS_PRESENTATION_SESSION_LIMIT` are retained; a malformed or
|
|
453
|
+
* duplicate entry anywhere rejects the sidecar rather than trusting a
|
|
454
|
+
* partially decoded cache.
|
|
455
|
+
*/
|
|
456
|
+
function decodePresentationSessions(value) {
|
|
457
|
+
if (value === undefined || value === null)
|
|
458
|
+
return [];
|
|
459
|
+
if (!Array.isArray(value))
|
|
460
|
+
return undefined;
|
|
461
|
+
const entries = [];
|
|
462
|
+
const seen = new Set();
|
|
463
|
+
for (const entry of value) {
|
|
464
|
+
if (!Array.isArray(entry) || entry.length !== 2)
|
|
465
|
+
return undefined;
|
|
466
|
+
const sessionId = entry[0];
|
|
467
|
+
if (typeof sessionId !== "string" || sessionId.length === 0)
|
|
468
|
+
return undefined;
|
|
469
|
+
if (seen.has(sessionId))
|
|
470
|
+
return undefined;
|
|
471
|
+
if (!isSessionSnapshot(entry[1], sessionId))
|
|
472
|
+
return undefined;
|
|
473
|
+
seen.add(sessionId);
|
|
474
|
+
entries.push([sessionId, entry[1]]);
|
|
475
|
+
}
|
|
476
|
+
return entries.slice(-ANALYTICS_PRESENTATION_SESSION_LIMIT);
|
|
477
|
+
}
|
|
478
|
+
export function decodeAnalyticsPresentation(value) {
|
|
479
|
+
if (typeof value !== "object" || value === null)
|
|
480
|
+
return undefined;
|
|
481
|
+
const record = value;
|
|
482
|
+
if (record.version !== ANALYTICS_SNAPSHOT_VERSION)
|
|
483
|
+
return undefined;
|
|
484
|
+
if (!isFiniteNumber(record.savedAtMs))
|
|
485
|
+
return undefined;
|
|
486
|
+
const identityValue = record.sourceIdentity;
|
|
487
|
+
// Absent/null token is a readable legacy sidecar but cannot be verified.
|
|
488
|
+
if (identityValue !== undefined &&
|
|
489
|
+
identityValue !== null &&
|
|
490
|
+
!isSourceIdentityTuple(identityValue)) {
|
|
491
|
+
return undefined;
|
|
492
|
+
}
|
|
493
|
+
if (!isPresentation(record.presentation))
|
|
494
|
+
return undefined;
|
|
495
|
+
const presentation = record.presentation;
|
|
496
|
+
if (!presentation)
|
|
497
|
+
return undefined;
|
|
498
|
+
const session = decodePresentationSessions(presentation.session);
|
|
499
|
+
if (session === undefined)
|
|
500
|
+
return undefined;
|
|
501
|
+
const frontierValue = record.frontierAtMs;
|
|
502
|
+
if (frontierValue !== undefined && frontierValue !== null && !isFiniteNumber(frontierValue)) {
|
|
503
|
+
return undefined;
|
|
504
|
+
}
|
|
505
|
+
const coverageValue = record.coverage;
|
|
506
|
+
let coverage;
|
|
507
|
+
if (coverageValue !== undefined && coverageValue !== null) {
|
|
508
|
+
if (typeof coverageValue !== "object")
|
|
509
|
+
return undefined;
|
|
510
|
+
const coverageRecord = coverageValue;
|
|
511
|
+
const sinceMs = coverageRecord.sinceMs;
|
|
512
|
+
const untilMs = coverageRecord.untilMs;
|
|
513
|
+
if (!isFiniteNumber(untilMs))
|
|
514
|
+
return undefined;
|
|
515
|
+
if (sinceMs !== null && !isFiniteNumber(sinceMs))
|
|
516
|
+
return undefined;
|
|
517
|
+
if (typeof sinceMs === "number" && sinceMs > untilMs)
|
|
518
|
+
return undefined;
|
|
519
|
+
coverage = sinceMs === null ? { untilMs } : { sinceMs, untilMs };
|
|
520
|
+
}
|
|
521
|
+
return {
|
|
522
|
+
home: presentation.home,
|
|
523
|
+
project: presentation.project.map(([projectId, range, snapshot]) => [projectId, range, snapshot]),
|
|
524
|
+
session,
|
|
525
|
+
...(coverage ? { coverage } : {}),
|
|
526
|
+
savedAtMs: record.savedAtMs,
|
|
527
|
+
...(typeof frontierValue === "number" ? { frontierAtMs: frontierValue } : {}),
|
|
528
|
+
sourceIdentity: identityValue === undefined || identityValue === null
|
|
529
|
+
? undefined
|
|
530
|
+
: identityFromTuple(identityValue),
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
const PRESENTATION_SIDECAR_SUFFIX = ".presentation.json";
|
|
534
|
+
const PRESENTATION_MAX_SIDECAR_BYTES = 4 * 1024 * 1024;
|
|
535
|
+
function compactSnapshotPathForPresentationPath(path) {
|
|
536
|
+
if (!path.endsWith(PRESENTATION_SIDECAR_SUFFIX))
|
|
537
|
+
return undefined;
|
|
538
|
+
const snapshotPath = path.slice(0, -PRESENTATION_SIDECAR_SUFFIX.length);
|
|
539
|
+
return snapshotPath.length > 0 ? snapshotPath : undefined;
|
|
540
|
+
}
|
|
541
|
+
function byteLength(value) {
|
|
542
|
+
return Buffer.byteLength(value, "utf8");
|
|
543
|
+
}
|
|
544
|
+
function withoutPresentationSessions(payload) {
|
|
545
|
+
const candidate = JSON.parse(payload);
|
|
546
|
+
if (candidate.presentation)
|
|
547
|
+
delete candidate.presentation.session;
|
|
548
|
+
return JSON.stringify(candidate);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Evict LRU-oldest session DTOs until the sidecar fits the compact snapshot
|
|
552
|
+
* budget. Home/project are never dropped: if they alone exceed the budget the
|
|
553
|
+
* fitted payload is still written, but sessions cannot add growth.
|
|
554
|
+
*/
|
|
555
|
+
function fitPresentationSessions(payload, budget) {
|
|
556
|
+
if (byteLength(payload) <= budget)
|
|
557
|
+
return payload;
|
|
558
|
+
const candidate = JSON.parse(payload);
|
|
559
|
+
const session = candidate.presentation?.session;
|
|
560
|
+
if (!session || session.length === 0)
|
|
561
|
+
return payload;
|
|
562
|
+
let fitted = payload;
|
|
563
|
+
while (session.length > 0 && byteLength(fitted) > budget) {
|
|
564
|
+
session.shift();
|
|
565
|
+
fitted = JSON.stringify(candidate);
|
|
566
|
+
}
|
|
567
|
+
return fitted;
|
|
568
|
+
}
|
|
569
|
+
/** Atomically replace the small warm presentation sidecar. */
|
|
570
|
+
export async function saveAnalyticsPresentation(path, state, savedAtMs, hooks = {}) {
|
|
571
|
+
let payload;
|
|
572
|
+
try {
|
|
573
|
+
// Capture the generation before the first await so queued writes cannot
|
|
574
|
+
// encode a newer state under an older generation's completion.
|
|
575
|
+
payload = JSON.stringify(encodeAnalyticsPresentation(state, savedAtMs));
|
|
576
|
+
}
|
|
577
|
+
catch {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
try {
|
|
581
|
+
const compactSnapshotPath = compactSnapshotPathForPresentationPath(path);
|
|
582
|
+
if (compactSnapshotPath === undefined) {
|
|
583
|
+
payload = withoutPresentationSessions(payload);
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
let budget;
|
|
587
|
+
try {
|
|
588
|
+
const compact = await stat(compactSnapshotPath);
|
|
589
|
+
if (compact.isFile()) {
|
|
590
|
+
budget = Math.min(PRESENTATION_MAX_SIDECAR_BYTES, compact.size);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
catch {
|
|
594
|
+
// No known compact snapshot: keep home/project, omit sessions rather
|
|
595
|
+
// than serializing the compact state into this sidecar.
|
|
596
|
+
}
|
|
597
|
+
payload =
|
|
598
|
+
budget === undefined
|
|
599
|
+
? withoutPresentationSessions(payload)
|
|
600
|
+
: fitPresentationSessions(payload, budget);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
catch {
|
|
604
|
+
return false;
|
|
605
|
+
}
|
|
606
|
+
const temporary = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
607
|
+
try {
|
|
608
|
+
await mkdir(dirname(path), { recursive: true });
|
|
609
|
+
const handle = await open(temporary, "w");
|
|
610
|
+
try {
|
|
611
|
+
await handle.writeFile(payload, "utf8");
|
|
612
|
+
await handle.sync();
|
|
613
|
+
}
|
|
614
|
+
finally {
|
|
615
|
+
await handle.close();
|
|
616
|
+
}
|
|
617
|
+
if (hooks.beforeRename)
|
|
618
|
+
await hooks.beforeRename();
|
|
619
|
+
await rename(temporary, path);
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
622
|
+
catch {
|
|
623
|
+
try {
|
|
624
|
+
if (existsSync(temporary))
|
|
625
|
+
await unlink(temporary);
|
|
626
|
+
}
|
|
627
|
+
catch {
|
|
628
|
+
// Best effort: a stale temp file never becomes the live sidecar.
|
|
629
|
+
}
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
export async function loadAnalyticsPresentation(path) {
|
|
634
|
+
try {
|
|
635
|
+
if (!existsSync(path))
|
|
636
|
+
return undefined;
|
|
637
|
+
const text = await readFile(path, "utf8");
|
|
638
|
+
return decodeAnalyticsPresentation(JSON.parse(text));
|
|
639
|
+
}
|
|
640
|
+
catch {
|
|
641
|
+
return undefined;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
/** Atomically replace the snapshot; a crash leaves the previous file intact. */
|
|
645
|
+
export async function saveAnalyticsSnapshot(path, state, savedAtMs, hooks = {}) {
|
|
646
|
+
let payload;
|
|
647
|
+
try {
|
|
648
|
+
payload = JSON.stringify(encodeAnalyticsState(state, savedAtMs));
|
|
649
|
+
}
|
|
650
|
+
catch {
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
const temporary = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
654
|
+
try {
|
|
655
|
+
await mkdir(dirname(path), { recursive: true });
|
|
656
|
+
const handle = await open(temporary, "w");
|
|
657
|
+
try {
|
|
658
|
+
await handle.writeFile(payload, "utf8");
|
|
659
|
+
await handle.sync();
|
|
660
|
+
}
|
|
661
|
+
finally {
|
|
662
|
+
await handle.close();
|
|
663
|
+
}
|
|
664
|
+
if (hooks.beforeRename)
|
|
665
|
+
await hooks.beforeRename();
|
|
666
|
+
await rename(temporary, path);
|
|
667
|
+
return true;
|
|
668
|
+
}
|
|
669
|
+
catch {
|
|
670
|
+
try {
|
|
671
|
+
if (existsSync(temporary))
|
|
672
|
+
await unlink(temporary);
|
|
673
|
+
}
|
|
674
|
+
catch {
|
|
675
|
+
// Best effort: a stale temp file never becomes the live snapshot.
|
|
676
|
+
}
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
/** Load a snapshot; missing, corrupt, or unsupported files are ignored. */
|
|
681
|
+
export async function loadAnalyticsSnapshot(path) {
|
|
682
|
+
try {
|
|
683
|
+
if (!existsSync(path))
|
|
684
|
+
return undefined;
|
|
685
|
+
const text = await readFile(path, "utf8");
|
|
686
|
+
return decodeAnalyticsState(JSON.parse(text));
|
|
687
|
+
}
|
|
688
|
+
catch {
|
|
689
|
+
return undefined;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
//# sourceMappingURL=analytics-state.js.map
|