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,824 @@
|
|
|
1
|
+
import { sumTokenStack } from "../contracts/guards.js";
|
|
2
|
+
import { planRangeBuckets, rangeBucketUnit, rangeWindow, } from "../contracts/ranges.js";
|
|
3
|
+
import { rawAssistantRowFingerprint, } from "../lib/opencode-storage.js";
|
|
4
|
+
import { priceTokenBuckets } from "../lib/quota-stats.js";
|
|
5
|
+
import { selectForkOwners } from "../lib/usage-ownership.js";
|
|
6
|
+
import { UNKNOWN_PROJECT_ID, UNTITLED_SESSION_TITLE } from "./aggregation.js";
|
|
7
|
+
const HOUR_MS = 3_600_000;
|
|
8
|
+
function createAccumulator() {
|
|
9
|
+
return {
|
|
10
|
+
input: 0,
|
|
11
|
+
cacheRead: 0,
|
|
12
|
+
cacheWrite: 0,
|
|
13
|
+
output: 0,
|
|
14
|
+
reasoning: 0,
|
|
15
|
+
costUsd: 0,
|
|
16
|
+
pricedCount: 0,
|
|
17
|
+
unpricedTokens: 0,
|
|
18
|
+
unknownTokens: 0,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function isZeroTokens(accumulator) {
|
|
22
|
+
return (accumulator.input === 0 &&
|
|
23
|
+
accumulator.cacheRead === 0 &&
|
|
24
|
+
accumulator.cacheWrite === 0 &&
|
|
25
|
+
accumulator.output === 0 &&
|
|
26
|
+
accumulator.reasoning === 0);
|
|
27
|
+
}
|
|
28
|
+
function addStepToAccumulator(accumulator, step) {
|
|
29
|
+
accumulator.input += step.tokens.input;
|
|
30
|
+
accumulator.cacheRead += step.tokens.cacheRead;
|
|
31
|
+
accumulator.cacheWrite += step.tokens.cacheWrite;
|
|
32
|
+
accumulator.output += step.tokens.output;
|
|
33
|
+
accumulator.reasoning += step.tokens.reasoning;
|
|
34
|
+
accumulator.costUsd += step.costUsd;
|
|
35
|
+
if (step.pricedAny)
|
|
36
|
+
accumulator.pricedCount += 1;
|
|
37
|
+
accumulator.unpricedTokens += step.unpricedTokens;
|
|
38
|
+
accumulator.unknownTokens += step.unknownTokens;
|
|
39
|
+
}
|
|
40
|
+
function subtractStepFromAccumulator(accumulator, step) {
|
|
41
|
+
accumulator.input -= step.tokens.input;
|
|
42
|
+
accumulator.cacheRead -= step.tokens.cacheRead;
|
|
43
|
+
accumulator.cacheWrite -= step.tokens.cacheWrite;
|
|
44
|
+
accumulator.output -= step.tokens.output;
|
|
45
|
+
accumulator.reasoning -= step.tokens.reasoning;
|
|
46
|
+
accumulator.costUsd -= step.costUsd;
|
|
47
|
+
if (step.pricedAny)
|
|
48
|
+
accumulator.pricedCount -= 1;
|
|
49
|
+
accumulator.unpricedTokens -= step.unpricedTokens;
|
|
50
|
+
accumulator.unknownTokens -= step.unknownTokens;
|
|
51
|
+
}
|
|
52
|
+
function mergeAccumulator(target, source) {
|
|
53
|
+
target.input += source.input;
|
|
54
|
+
target.cacheRead += source.cacheRead;
|
|
55
|
+
target.cacheWrite += source.cacheWrite;
|
|
56
|
+
target.output += source.output;
|
|
57
|
+
target.reasoning += source.reasoning;
|
|
58
|
+
target.costUsd += source.costUsd;
|
|
59
|
+
target.pricedCount += source.pricedCount;
|
|
60
|
+
target.unpricedTokens += source.unpricedTokens;
|
|
61
|
+
target.unknownTokens += source.unknownTokens;
|
|
62
|
+
}
|
|
63
|
+
function finalize(accumulator) {
|
|
64
|
+
const stack = {
|
|
65
|
+
input: accumulator.input,
|
|
66
|
+
cacheRead: accumulator.cacheRead,
|
|
67
|
+
cacheWrite: accumulator.cacheWrite,
|
|
68
|
+
output: accumulator.output,
|
|
69
|
+
reasoning: accumulator.reasoning,
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
...stack,
|
|
73
|
+
total: sumTokenStack(stack),
|
|
74
|
+
apiEquivalentCostUsd: accumulator.pricedCount > 0 ? accumulator.costUsd : null,
|
|
75
|
+
unpricedTokens: accumulator.unpricedTokens,
|
|
76
|
+
unknownTokens: accumulator.unknownTokens,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function compareIds(a, b) {
|
|
80
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
81
|
+
}
|
|
82
|
+
function sessionCreatedMs(session) {
|
|
83
|
+
const created = session?.time?.created;
|
|
84
|
+
return created !== undefined && Number.isFinite(created) ? created : Number.MAX_SAFE_INTEGER;
|
|
85
|
+
}
|
|
86
|
+
function compareSessions(a, b) {
|
|
87
|
+
const byCreated = sessionCreatedMs(a) - sessionCreatedMs(b);
|
|
88
|
+
if (byCreated !== 0)
|
|
89
|
+
return byCreated;
|
|
90
|
+
return compareIds(a.id, b.id);
|
|
91
|
+
}
|
|
92
|
+
function basenameOf(directory) {
|
|
93
|
+
if (directory === undefined)
|
|
94
|
+
return undefined;
|
|
95
|
+
const trimmed = directory.replace(/[\\/]+$/, "");
|
|
96
|
+
if (!trimmed)
|
|
97
|
+
return undefined;
|
|
98
|
+
const parts = trimmed.split(/[\\/]+/);
|
|
99
|
+
const base = parts[parts.length - 1];
|
|
100
|
+
return base ? base : undefined;
|
|
101
|
+
}
|
|
102
|
+
function sessionTitle(session) {
|
|
103
|
+
const title = session.title?.trim();
|
|
104
|
+
return title ? title : UNTITLED_SESSION_TITLE;
|
|
105
|
+
}
|
|
106
|
+
function projectIdOfSession(session) {
|
|
107
|
+
const projectId = session.projectID?.trim();
|
|
108
|
+
return projectId ? projectId : UNKNOWN_PROJECT_ID;
|
|
109
|
+
}
|
|
110
|
+
function inWindow(timestampMs, window) {
|
|
111
|
+
if (timestampMs === undefined || !Number.isFinite(timestampMs))
|
|
112
|
+
return false;
|
|
113
|
+
if (timestampMs >= window.untilMs)
|
|
114
|
+
return false;
|
|
115
|
+
return window.sinceMs === undefined || timestampMs >= window.sinceMs;
|
|
116
|
+
}
|
|
117
|
+
export function createAnalyticsModel(options = {}) {
|
|
118
|
+
const timeZone = options.timeZone ?? "UTC";
|
|
119
|
+
const pricingCache = new Map();
|
|
120
|
+
const groups = new Map();
|
|
121
|
+
const ownedByFp = new Map();
|
|
122
|
+
const ownedBySession = new Map();
|
|
123
|
+
const hours = new Map();
|
|
124
|
+
/** Lifetime model-dimension rollup (small: one entry per provider/model). */
|
|
125
|
+
const modelLifetime = new Map();
|
|
126
|
+
const latestStepBySession = new Map();
|
|
127
|
+
const earliestStepBySession = new Map();
|
|
128
|
+
let earliestHourMs;
|
|
129
|
+
let sessions = {};
|
|
130
|
+
let projects = {};
|
|
131
|
+
let projectBySession = new Map();
|
|
132
|
+
let sessionsByProject = new Map();
|
|
133
|
+
let childrenByParent = new Map();
|
|
134
|
+
let treesByProject = new Map();
|
|
135
|
+
let earliestStepGlobal;
|
|
136
|
+
let earliestDirty = false;
|
|
137
|
+
function priceRow(row) {
|
|
138
|
+
const total = row.tokens.input +
|
|
139
|
+
row.tokens.output +
|
|
140
|
+
row.tokens.reasoning +
|
|
141
|
+
row.tokens.cacheRead +
|
|
142
|
+
row.tokens.cacheWrite;
|
|
143
|
+
const outcome = priceTokenBuckets({
|
|
144
|
+
providerID: row.providerID,
|
|
145
|
+
modelID: row.modelID,
|
|
146
|
+
tokens: {
|
|
147
|
+
input: row.tokens.input,
|
|
148
|
+
output: row.tokens.output,
|
|
149
|
+
reasoning: row.tokens.reasoning,
|
|
150
|
+
cache_read: row.tokens.cacheRead,
|
|
151
|
+
cache_write: row.tokens.cacheWrite,
|
|
152
|
+
},
|
|
153
|
+
cache: pricingCache,
|
|
154
|
+
});
|
|
155
|
+
if (outcome.status === "priced") {
|
|
156
|
+
return { costUsd: outcome.costUsd, pricedAny: true, unpricedTokens: 0, unknownTokens: 0 };
|
|
157
|
+
}
|
|
158
|
+
if (outcome.status === "unpriced") {
|
|
159
|
+
return { costUsd: 0, pricedAny: false, unpricedTokens: total, unknownTokens: 0 };
|
|
160
|
+
}
|
|
161
|
+
return { costUsd: 0, pricedAny: false, unpricedTokens: 0, unknownTokens: total };
|
|
162
|
+
}
|
|
163
|
+
function bucketFor(startMs) {
|
|
164
|
+
let bucket = hours.get(startMs);
|
|
165
|
+
if (!bucket) {
|
|
166
|
+
bucket = {
|
|
167
|
+
startMs,
|
|
168
|
+
totals: createAccumulator(),
|
|
169
|
+
steps: new Map(),
|
|
170
|
+
};
|
|
171
|
+
hours.set(startMs, bucket);
|
|
172
|
+
}
|
|
173
|
+
return bucket;
|
|
174
|
+
}
|
|
175
|
+
function keyedAccumulator(map, key) {
|
|
176
|
+
let accumulator = map.get(key);
|
|
177
|
+
if (!accumulator) {
|
|
178
|
+
accumulator = createAccumulator();
|
|
179
|
+
map.set(key, accumulator);
|
|
180
|
+
}
|
|
181
|
+
return accumulator;
|
|
182
|
+
}
|
|
183
|
+
function addStep(step) {
|
|
184
|
+
const startMs = Math.floor(step.completedAtMs / HOUR_MS) * HOUR_MS;
|
|
185
|
+
if (earliestHourMs === undefined || startMs < earliestHourMs)
|
|
186
|
+
earliestHourMs = startMs;
|
|
187
|
+
const bucket = bucketFor(startMs);
|
|
188
|
+
addStepToAccumulator(bucket.totals, step);
|
|
189
|
+
addStepToAccumulator(keyedAccumulator(modelLifetime, `${step.providerID ?? ""}|||${step.modelID ?? ""}`), step);
|
|
190
|
+
bucket.steps.set(`${step.sessionID}\u0000${step.messageID}`, step);
|
|
191
|
+
let sessionSteps = ownedBySession.get(step.sessionID);
|
|
192
|
+
if (!sessionSteps) {
|
|
193
|
+
sessionSteps = new Map();
|
|
194
|
+
ownedBySession.set(step.sessionID, sessionSteps);
|
|
195
|
+
}
|
|
196
|
+
sessionSteps.set(step.messageID, step);
|
|
197
|
+
const completed = step.completedAtMs;
|
|
198
|
+
const latest = latestStepBySession.get(step.sessionID);
|
|
199
|
+
if (latest === undefined || completed > latest) {
|
|
200
|
+
latestStepBySession.set(step.sessionID, completed);
|
|
201
|
+
}
|
|
202
|
+
const earliest = earliestStepBySession.get(step.sessionID);
|
|
203
|
+
if (earliest === undefined || completed < earliest) {
|
|
204
|
+
earliestStepBySession.set(step.sessionID, completed);
|
|
205
|
+
earliestDirty = true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function removeStep(step) {
|
|
209
|
+
const startMs = Math.floor(step.completedAtMs / HOUR_MS) * HOUR_MS;
|
|
210
|
+
const bucket = hours.get(startMs);
|
|
211
|
+
if (bucket) {
|
|
212
|
+
subtractStepFromAccumulator(bucket.totals, step);
|
|
213
|
+
const modelKey = `${step.providerID ?? ""}|||${step.modelID ?? ""}`;
|
|
214
|
+
const model = modelLifetime.get(modelKey);
|
|
215
|
+
if (model) {
|
|
216
|
+
subtractStepFromAccumulator(model, step);
|
|
217
|
+
if (isZeroTokens(model))
|
|
218
|
+
modelLifetime.delete(modelKey);
|
|
219
|
+
}
|
|
220
|
+
bucket.steps.delete(`${step.sessionID}\u0000${step.messageID}`);
|
|
221
|
+
if (bucket.steps.size <= 0) {
|
|
222
|
+
hours.delete(startMs);
|
|
223
|
+
if (startMs === earliestHourMs) {
|
|
224
|
+
earliestHourMs = undefined;
|
|
225
|
+
for (const key of hours.keys()) {
|
|
226
|
+
if (earliestHourMs === undefined || key < earliestHourMs)
|
|
227
|
+
earliestHourMs = key;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const sessionSteps = ownedBySession.get(step.sessionID);
|
|
233
|
+
if (sessionSteps) {
|
|
234
|
+
sessionSteps.delete(step.messageID);
|
|
235
|
+
if (sessionSteps.size === 0)
|
|
236
|
+
ownedBySession.delete(step.sessionID);
|
|
237
|
+
const values = [...sessionSteps.values()];
|
|
238
|
+
if (values.length === 0) {
|
|
239
|
+
latestStepBySession.delete(step.sessionID);
|
|
240
|
+
earliestStepBySession.delete(step.sessionID);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
let latest = values[0]?.completedAtMs ?? 0;
|
|
244
|
+
let earliest = latest;
|
|
245
|
+
for (const value of values) {
|
|
246
|
+
if (value.completedAtMs > latest)
|
|
247
|
+
latest = value.completedAtMs;
|
|
248
|
+
if (value.completedAtMs < earliest)
|
|
249
|
+
earliest = value.completedAtMs;
|
|
250
|
+
}
|
|
251
|
+
latestStepBySession.set(step.sessionID, latest);
|
|
252
|
+
earliestStepBySession.set(step.sessionID, earliest);
|
|
253
|
+
}
|
|
254
|
+
earliestDirty = true;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function stepKey(value) {
|
|
258
|
+
return `${value.sessionID}\u0000${value.messageID}`;
|
|
259
|
+
}
|
|
260
|
+
function toOwnedStep(occurrence) {
|
|
261
|
+
const step = {
|
|
262
|
+
sessionID: occurrence.sessionID,
|
|
263
|
+
messageID: occurrence.messageID,
|
|
264
|
+
projectID: projectBySession.get(occurrence.sessionID) ?? UNKNOWN_PROJECT_ID,
|
|
265
|
+
createdAtMs: occurrence.createdAtMs,
|
|
266
|
+
completedAtMs: occurrence.completedAtMs,
|
|
267
|
+
tokens: {
|
|
268
|
+
input: occurrence.input,
|
|
269
|
+
output: occurrence.output,
|
|
270
|
+
reasoning: occurrence.reasoning,
|
|
271
|
+
cacheRead: occurrence.cacheRead,
|
|
272
|
+
cacheWrite: occurrence.cacheWrite,
|
|
273
|
+
},
|
|
274
|
+
costUsd: occurrence.costUsd,
|
|
275
|
+
pricedAny: occurrence.pricedAny,
|
|
276
|
+
unpricedTokens: occurrence.unpricedTokens,
|
|
277
|
+
unknownTokens: occurrence.unknownTokens,
|
|
278
|
+
};
|
|
279
|
+
if (occurrence.providerID !== undefined)
|
|
280
|
+
step.providerID = occurrence.providerID;
|
|
281
|
+
if (occurrence.modelID !== undefined)
|
|
282
|
+
step.modelID = occurrence.modelID;
|
|
283
|
+
if (occurrence.agent !== undefined)
|
|
284
|
+
step.agent = occurrence.agent;
|
|
285
|
+
return step;
|
|
286
|
+
}
|
|
287
|
+
function sameOwnedStep(step, occurrence) {
|
|
288
|
+
return (step.tokens.input === occurrence.input &&
|
|
289
|
+
step.tokens.cacheRead === occurrence.cacheRead &&
|
|
290
|
+
step.tokens.cacheWrite === occurrence.cacheWrite &&
|
|
291
|
+
step.tokens.output === occurrence.output &&
|
|
292
|
+
step.tokens.reasoning === occurrence.reasoning &&
|
|
293
|
+
step.agent === occurrence.agent &&
|
|
294
|
+
step.completedAtMs === occurrence.completedAtMs &&
|
|
295
|
+
step.costUsd === occurrence.costUsd &&
|
|
296
|
+
step.pricedAny === occurrence.pricedAny &&
|
|
297
|
+
step.unpricedTokens === occurrence.unpricedTokens &&
|
|
298
|
+
step.unknownTokens === occurrence.unknownTokens);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Reuse the canonical step object for an unchanged winner. The same object is
|
|
302
|
+
* held by `ownedByFp`, the hour bucket, and the session map; replacing it on
|
|
303
|
+
* every re-upsert would retain a detached copy and let a metadata project move
|
|
304
|
+
* update one copy but not the others.
|
|
305
|
+
*/
|
|
306
|
+
function ownedStepFor(occurrence, previous) {
|
|
307
|
+
const before = previous?.get(stepKey(occurrence));
|
|
308
|
+
if (before === undefined || !sameOwnedStep(before, occurrence)) {
|
|
309
|
+
return toOwnedStep(occurrence);
|
|
310
|
+
}
|
|
311
|
+
const projectID = projectBySession.get(occurrence.sessionID) ?? UNKNOWN_PROJECT_ID;
|
|
312
|
+
if (before.projectID !== projectID) {
|
|
313
|
+
// Defensive: normally setMetadata moved this canonical object already.
|
|
314
|
+
removeStep(before);
|
|
315
|
+
before.projectID = projectID;
|
|
316
|
+
addStep(before);
|
|
317
|
+
}
|
|
318
|
+
return before;
|
|
319
|
+
}
|
|
320
|
+
function recomputeFingerprint(fingerprint) {
|
|
321
|
+
const previous = ownedByFp.get(fingerprint);
|
|
322
|
+
const occurrences = groups.get(fingerprint);
|
|
323
|
+
const next = new Map();
|
|
324
|
+
if (occurrences !== undefined && occurrences.length > 0) {
|
|
325
|
+
if (occurrences.length === 1) {
|
|
326
|
+
// Singleton fast path: one occurrence is always its own owner.
|
|
327
|
+
const occurrence = occurrences[0];
|
|
328
|
+
if (occurrence !== undefined) {
|
|
329
|
+
next.set(stepKey(occurrence), ownedStepFor(occurrence, previous));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
// Choose owners over the compact occurrences first; allocate an
|
|
334
|
+
// OwnedStep only for the winners.
|
|
335
|
+
const candidates = occurrences.map((occurrence) => ({
|
|
336
|
+
item: occurrence,
|
|
337
|
+
sessionID: occurrence.sessionID,
|
|
338
|
+
fingerprint,
|
|
339
|
+
createdAtMs: occurrence.createdAtMs,
|
|
340
|
+
messageID: occurrence.messageID,
|
|
341
|
+
}));
|
|
342
|
+
for (const occurrence of selectForkOwners(candidates)) {
|
|
343
|
+
next.set(stepKey(occurrence), ownedStepFor(occurrence, previous));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (previous !== undefined) {
|
|
348
|
+
for (const [key, step] of previous) {
|
|
349
|
+
if (!next.has(key))
|
|
350
|
+
removeStep(step);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
for (const [key, step] of next) {
|
|
354
|
+
const before = previous?.get(key);
|
|
355
|
+
if (before === undefined) {
|
|
356
|
+
addStep(step);
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (before !== step) {
|
|
360
|
+
removeStep(before);
|
|
361
|
+
addStep(step);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
// Fingerprints with no owned rows must not leave an empty map behind:
|
|
365
|
+
// churn and full removal otherwise retain one map per removed fingerprint.
|
|
366
|
+
if (next.size === 0)
|
|
367
|
+
ownedByFp.delete(fingerprint);
|
|
368
|
+
else
|
|
369
|
+
ownedByFp.set(fingerprint, next);
|
|
370
|
+
}
|
|
371
|
+
function upsertOccurrence(row) {
|
|
372
|
+
const fingerprint = rawAssistantRowFingerprint(row);
|
|
373
|
+
let occurrences = groups.get(fingerprint);
|
|
374
|
+
if (!occurrences) {
|
|
375
|
+
occurrences = [];
|
|
376
|
+
groups.set(fingerprint, occurrences);
|
|
377
|
+
}
|
|
378
|
+
const priced = priceRow(row);
|
|
379
|
+
const occurrence = {
|
|
380
|
+
sessionID: row.sessionID,
|
|
381
|
+
messageID: row.messageID,
|
|
382
|
+
createdAtMs: row.createdAtMs,
|
|
383
|
+
completedAtMs: row.completedAtMs,
|
|
384
|
+
input: row.tokens.input,
|
|
385
|
+
output: row.tokens.output,
|
|
386
|
+
reasoning: row.tokens.reasoning,
|
|
387
|
+
cacheRead: row.tokens.cacheRead,
|
|
388
|
+
cacheWrite: row.tokens.cacheWrite,
|
|
389
|
+
...priced,
|
|
390
|
+
};
|
|
391
|
+
if (row.providerID !== undefined)
|
|
392
|
+
occurrence.providerID = row.providerID;
|
|
393
|
+
if (row.modelID !== undefined)
|
|
394
|
+
occurrence.modelID = row.modelID;
|
|
395
|
+
if (row.agent !== undefined)
|
|
396
|
+
occurrence.agent = row.agent;
|
|
397
|
+
const index = occurrences.findIndex((entry) => entry.messageID === row.messageID);
|
|
398
|
+
if (index >= 0)
|
|
399
|
+
occurrences[index] = occurrence;
|
|
400
|
+
else
|
|
401
|
+
occurrences.push(occurrence);
|
|
402
|
+
}
|
|
403
|
+
function removeOccurrence(row) {
|
|
404
|
+
const fingerprint = rawAssistantRowFingerprint(row);
|
|
405
|
+
const occurrences = groups.get(fingerprint);
|
|
406
|
+
if (!occurrences)
|
|
407
|
+
return;
|
|
408
|
+
const index = occurrences.findIndex((entry) => entry.messageID === row.messageID);
|
|
409
|
+
if (index >= 0)
|
|
410
|
+
occurrences.splice(index, 1);
|
|
411
|
+
if (occurrences.length === 0)
|
|
412
|
+
groups.delete(fingerprint);
|
|
413
|
+
}
|
|
414
|
+
function setMetadata(nextSessions, nextProjects) {
|
|
415
|
+
const previousProjectBySession = projectBySession;
|
|
416
|
+
sessions = nextSessions;
|
|
417
|
+
projects = nextProjects;
|
|
418
|
+
projectBySession = new Map();
|
|
419
|
+
sessionsByProject = new Map();
|
|
420
|
+
childrenByParent = new Map();
|
|
421
|
+
treesByProject = new Map();
|
|
422
|
+
for (const session of Object.values(sessions)) {
|
|
423
|
+
const projectId = projectIdOfSession(session);
|
|
424
|
+
projectBySession.set(session.id, projectId);
|
|
425
|
+
let ids = sessionsByProject.get(projectId);
|
|
426
|
+
if (!ids) {
|
|
427
|
+
ids = [];
|
|
428
|
+
sessionsByProject.set(projectId, ids);
|
|
429
|
+
}
|
|
430
|
+
ids.push(session.id);
|
|
431
|
+
if (session.parentID) {
|
|
432
|
+
let children = childrenByParent.get(session.parentID);
|
|
433
|
+
if (!children) {
|
|
434
|
+
children = [];
|
|
435
|
+
childrenByParent.set(session.parentID, children);
|
|
436
|
+
}
|
|
437
|
+
children.push(session);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
for (const [projectId, ids] of sessionsByProject) {
|
|
441
|
+
ids.sort((a, b) => {
|
|
442
|
+
const left = sessions[a];
|
|
443
|
+
const right = sessions[b];
|
|
444
|
+
if (!left || !right)
|
|
445
|
+
return compareIds(a, b);
|
|
446
|
+
return compareSessions(left, right);
|
|
447
|
+
});
|
|
448
|
+
sessionsByProject.set(projectId, ids);
|
|
449
|
+
}
|
|
450
|
+
for (const children of childrenByParent.values())
|
|
451
|
+
children.sort(compareSessions);
|
|
452
|
+
// A session can move between projects (drift/reset): move its owned steps'
|
|
453
|
+
// rollups without rebuilding groups or re-reading payload.
|
|
454
|
+
for (const [sessionId, previous] of previousProjectBySession) {
|
|
455
|
+
const next = projectBySession.get(sessionId) ?? UNKNOWN_PROJECT_ID;
|
|
456
|
+
if (previous === next)
|
|
457
|
+
continue;
|
|
458
|
+
for (const step of [...(ownedBySession.get(sessionId)?.values() ?? [])]) {
|
|
459
|
+
removeStep(step);
|
|
460
|
+
step.projectID = next;
|
|
461
|
+
addStep(step);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
function treesFor(projectId) {
|
|
466
|
+
const cached = treesByProject.get(projectId);
|
|
467
|
+
if (cached)
|
|
468
|
+
return cached;
|
|
469
|
+
const sessionIds = sessionsByProject.get(projectId) ?? [];
|
|
470
|
+
const idSet = new Set(sessionIds);
|
|
471
|
+
const rootOf = new Map();
|
|
472
|
+
const resolveRoot = (startId) => {
|
|
473
|
+
const path = [];
|
|
474
|
+
const position = new Map();
|
|
475
|
+
let current = startId;
|
|
476
|
+
let root;
|
|
477
|
+
for (;;) {
|
|
478
|
+
const known = rootOf.get(current);
|
|
479
|
+
if (known !== undefined) {
|
|
480
|
+
root = known;
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
const index = position.get(current);
|
|
484
|
+
if (index !== undefined) {
|
|
485
|
+
let smallest = current;
|
|
486
|
+
for (let i = index; i < path.length; i += 1) {
|
|
487
|
+
const member = path[i];
|
|
488
|
+
if (member !== undefined && compareIds(member, smallest) < 0)
|
|
489
|
+
smallest = member;
|
|
490
|
+
}
|
|
491
|
+
root = smallest;
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
position.set(current, path.length);
|
|
495
|
+
path.push(current);
|
|
496
|
+
const parent = sessions[current]?.parentID;
|
|
497
|
+
if (!parent || !idSet.has(parent)) {
|
|
498
|
+
root = current;
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
current = parent;
|
|
502
|
+
}
|
|
503
|
+
for (const id of path)
|
|
504
|
+
rootOf.set(id, root);
|
|
505
|
+
return root;
|
|
506
|
+
};
|
|
507
|
+
for (const id of sessionIds)
|
|
508
|
+
resolveRoot(id);
|
|
509
|
+
const membersByRoot = new Map();
|
|
510
|
+
for (const id of sessionIds) {
|
|
511
|
+
const root = rootOf.get(id);
|
|
512
|
+
if (root === undefined)
|
|
513
|
+
continue;
|
|
514
|
+
let members = membersByRoot.get(root);
|
|
515
|
+
if (!members) {
|
|
516
|
+
members = [];
|
|
517
|
+
membersByRoot.set(root, members);
|
|
518
|
+
}
|
|
519
|
+
members.push(id);
|
|
520
|
+
}
|
|
521
|
+
const trees = [];
|
|
522
|
+
for (const [rootId, memberIds] of membersByRoot) {
|
|
523
|
+
memberIds.sort((a, b) => {
|
|
524
|
+
const left = sessions[a];
|
|
525
|
+
const right = sessions[b];
|
|
526
|
+
if (!left || !right)
|
|
527
|
+
return compareIds(a, b);
|
|
528
|
+
return compareSessions(left, right);
|
|
529
|
+
});
|
|
530
|
+
trees.push({ rootId, memberIds });
|
|
531
|
+
}
|
|
532
|
+
trees.sort((a, b) => compareIds(a.rootId, b.rootId));
|
|
533
|
+
treesByProject.set(projectId, trees);
|
|
534
|
+
return trees;
|
|
535
|
+
}
|
|
536
|
+
function earliestActivity() {
|
|
537
|
+
let earliest;
|
|
538
|
+
const consider = (value) => {
|
|
539
|
+
if (value === undefined || !Number.isFinite(value))
|
|
540
|
+
return;
|
|
541
|
+
if (earliest === undefined || value < earliest)
|
|
542
|
+
earliest = value;
|
|
543
|
+
};
|
|
544
|
+
for (const session of Object.values(sessions)) {
|
|
545
|
+
consider(session.time?.created);
|
|
546
|
+
consider(session.time?.updated);
|
|
547
|
+
}
|
|
548
|
+
if (earliestDirty || earliestStepGlobal === undefined) {
|
|
549
|
+
earliestStepGlobal = undefined;
|
|
550
|
+
for (const value of earliestStepBySession.values()) {
|
|
551
|
+
if (earliestStepGlobal === undefined || value < earliestStepGlobal) {
|
|
552
|
+
earliestStepGlobal = value;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
earliestDirty = false;
|
|
556
|
+
}
|
|
557
|
+
consider(earliestStepGlobal);
|
|
558
|
+
return earliest;
|
|
559
|
+
}
|
|
560
|
+
function accumulateRange(sinceMs, untilMs, options = {}) {
|
|
561
|
+
const totals = createAccumulator();
|
|
562
|
+
const sessionsSet = new Set();
|
|
563
|
+
const collectSessions = options.collectSessions !== false;
|
|
564
|
+
let stepCount = 0;
|
|
565
|
+
if (untilMs <= (sinceMs ?? Number.NEGATIVE_INFINITY)) {
|
|
566
|
+
return { totals, stepCount, sessions: sessionsSet };
|
|
567
|
+
}
|
|
568
|
+
const requestedFirstHour = Math.floor((sinceMs ?? 0) / HOUR_MS) * HOUR_MS;
|
|
569
|
+
const firstHour = earliestHourMs === undefined
|
|
570
|
+
? requestedFirstHour
|
|
571
|
+
: Math.max(requestedFirstHour, earliestHourMs);
|
|
572
|
+
const lastHour = Math.floor((untilMs - 1) / HOUR_MS) * HOUR_MS;
|
|
573
|
+
if (firstHour > lastHour)
|
|
574
|
+
return { totals, stepCount, sessions: sessionsSet };
|
|
575
|
+
const unfiltered = options.projectId === undefined && options.sessionIds === undefined && !collectSessions;
|
|
576
|
+
for (let startMs = firstHour; startMs <= lastHour; startMs += HOUR_MS) {
|
|
577
|
+
const bucket = hours.get(startMs);
|
|
578
|
+
if (!bucket)
|
|
579
|
+
continue;
|
|
580
|
+
const hourEnd = startMs + HOUR_MS;
|
|
581
|
+
const fullyInside = hourEnd <= untilMs && (sinceMs === undefined || startMs >= sinceMs);
|
|
582
|
+
if (fullyInside && unfiltered) {
|
|
583
|
+
mergeAccumulator(totals, bucket.totals);
|
|
584
|
+
stepCount += bucket.steps.size;
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
for (const step of bucket.steps.values()) {
|
|
588
|
+
if (step.completedAtMs < startMs || step.completedAtMs >= hourEnd)
|
|
589
|
+
continue;
|
|
590
|
+
if (sinceMs !== undefined && step.completedAtMs < sinceMs)
|
|
591
|
+
continue;
|
|
592
|
+
if (step.completedAtMs >= untilMs)
|
|
593
|
+
continue;
|
|
594
|
+
if (options.sessionIds && !options.sessionIds.has(step.sessionID))
|
|
595
|
+
continue;
|
|
596
|
+
if (options.projectId !== undefined && step.projectID !== options.projectId)
|
|
597
|
+
continue;
|
|
598
|
+
addStepToAccumulator(totals, step);
|
|
599
|
+
stepCount += 1;
|
|
600
|
+
if (collectSessions)
|
|
601
|
+
sessionsSet.add(step.sessionID);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return { totals, stepCount, sessions: sessionsSet };
|
|
605
|
+
}
|
|
606
|
+
function buildUsage(range, nowMs, options = {}, earliestMs = earliestActivity()) {
|
|
607
|
+
const window = rangeWindow(range, nowMs);
|
|
608
|
+
const boundaries = planRangeBuckets(range, nowMs, earliestMs, { timeZone });
|
|
609
|
+
const buckets = boundaries.map((boundary) => {
|
|
610
|
+
const sum = accumulateRange(boundary.startMs, boundary.endMs, {
|
|
611
|
+
...options,
|
|
612
|
+
collectSessions: false,
|
|
613
|
+
});
|
|
614
|
+
return {
|
|
615
|
+
startMs: boundary.startMs,
|
|
616
|
+
endMs: boundary.endMs,
|
|
617
|
+
tokens: finalize(sum.totals),
|
|
618
|
+
};
|
|
619
|
+
});
|
|
620
|
+
const totals = accumulateRange(window.sinceMs, window.untilMs, options);
|
|
621
|
+
return {
|
|
622
|
+
range,
|
|
623
|
+
window,
|
|
624
|
+
bucketUnit: rangeBucketUnit(range),
|
|
625
|
+
timeZone,
|
|
626
|
+
buckets,
|
|
627
|
+
totals: finalize(totals.totals),
|
|
628
|
+
stepCount: totals.stepCount,
|
|
629
|
+
sessionCount: totals.sessions.size,
|
|
630
|
+
stale: false,
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function latestInWindow(values, window) {
|
|
634
|
+
let latest;
|
|
635
|
+
for (const value of values) {
|
|
636
|
+
if (!inWindow(value, window))
|
|
637
|
+
continue;
|
|
638
|
+
if (latest === undefined || value > latest)
|
|
639
|
+
latest = value;
|
|
640
|
+
}
|
|
641
|
+
return latest;
|
|
642
|
+
}
|
|
643
|
+
function sessionActivityValues(sessionId) {
|
|
644
|
+
const session = sessions[sessionId];
|
|
645
|
+
const values = [];
|
|
646
|
+
if (session?.time?.created !== undefined)
|
|
647
|
+
values.push(session.time.created);
|
|
648
|
+
if (session?.time?.updated !== undefined)
|
|
649
|
+
values.push(session.time.updated);
|
|
650
|
+
const stepLatest = latestStepBySession.get(sessionId);
|
|
651
|
+
if (stepLatest !== undefined)
|
|
652
|
+
values.push(stepLatest);
|
|
653
|
+
return values;
|
|
654
|
+
}
|
|
655
|
+
function projectLatestInWindow(projectId, window) {
|
|
656
|
+
let latest;
|
|
657
|
+
for (const sessionId of sessionsByProject.get(projectId) ?? []) {
|
|
658
|
+
const candidate = latestInWindow(sessionActivityValues(sessionId), window);
|
|
659
|
+
if (candidate !== undefined && (latest === undefined || candidate > latest))
|
|
660
|
+
latest = candidate;
|
|
661
|
+
}
|
|
662
|
+
return latest;
|
|
663
|
+
}
|
|
664
|
+
function treeLatestInWindow(tree, window) {
|
|
665
|
+
let latest;
|
|
666
|
+
for (const sessionId of tree.memberIds) {
|
|
667
|
+
const candidate = latestInWindow(sessionActivityValues(sessionId), window);
|
|
668
|
+
if (candidate !== undefined && (latest === undefined || candidate > latest))
|
|
669
|
+
latest = candidate;
|
|
670
|
+
}
|
|
671
|
+
return latest;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Earliest activity belonging to one project, below `nowMs`. A project
|
|
675
|
+
* lifetime graph starts here — never at the first global activity, which may
|
|
676
|
+
* predate the project by months.
|
|
677
|
+
*/
|
|
678
|
+
function projectEarliestActivity(projectId, nowMs) {
|
|
679
|
+
let earliest;
|
|
680
|
+
const consider = (value) => {
|
|
681
|
+
if (value === undefined || !Number.isFinite(value) || value >= nowMs)
|
|
682
|
+
return;
|
|
683
|
+
if (earliest === undefined || value < earliest)
|
|
684
|
+
earliest = value;
|
|
685
|
+
};
|
|
686
|
+
for (const sessionId of sessionsByProject.get(projectId) ?? []) {
|
|
687
|
+
const session = sessions[sessionId];
|
|
688
|
+
consider(session?.time?.created);
|
|
689
|
+
consider(session?.time?.updated);
|
|
690
|
+
consider(earliestStepBySession.get(sessionId));
|
|
691
|
+
}
|
|
692
|
+
return earliest;
|
|
693
|
+
}
|
|
694
|
+
function projectName(projectId) {
|
|
695
|
+
const info = Object.hasOwn(projects, projectId) ? projects[projectId] : undefined;
|
|
696
|
+
const name = info?.name?.trim();
|
|
697
|
+
if (name)
|
|
698
|
+
return name;
|
|
699
|
+
const directory = info?.directories[0] ?? info?.worktrees[0];
|
|
700
|
+
return basenameOf(directory) ?? "Project";
|
|
701
|
+
}
|
|
702
|
+
function projectIds() {
|
|
703
|
+
const ids = new Set(Object.keys(projects));
|
|
704
|
+
for (const projectId of sessionsByProject.keys())
|
|
705
|
+
ids.add(projectId);
|
|
706
|
+
return [...ids].sort(compareIds);
|
|
707
|
+
}
|
|
708
|
+
function home(range, nowMs) {
|
|
709
|
+
const window = rangeWindow(range, nowMs);
|
|
710
|
+
const usage = buildUsage(range, nowMs);
|
|
711
|
+
const rows = [];
|
|
712
|
+
for (const projectId of projectIds()) {
|
|
713
|
+
const latest = projectLatestInWindow(projectId, window);
|
|
714
|
+
if (range !== "lifetime" && latest === undefined)
|
|
715
|
+
continue;
|
|
716
|
+
const sum = accumulateRange(window.sinceMs, window.untilMs, {
|
|
717
|
+
projectId,
|
|
718
|
+
collectSessions: false,
|
|
719
|
+
});
|
|
720
|
+
const trees = treesFor(projectId);
|
|
721
|
+
const rootSessionCount = range === "lifetime"
|
|
722
|
+
? trees.length
|
|
723
|
+
: trees.filter((tree) => treeLatestInWindow(tree, window) !== undefined).length;
|
|
724
|
+
rows.push({
|
|
725
|
+
projectId,
|
|
726
|
+
name: projectName(projectId),
|
|
727
|
+
tokens: finalize(sum.totals),
|
|
728
|
+
rootSessionCount,
|
|
729
|
+
latestActivityAtMs: latest ?? 0,
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
rows.sort((a, b) => {
|
|
733
|
+
if (a.latestActivityAtMs !== b.latestActivityAtMs) {
|
|
734
|
+
return b.latestActivityAtMs - a.latestActivityAtMs;
|
|
735
|
+
}
|
|
736
|
+
return compareIds(a.projectId, b.projectId);
|
|
737
|
+
});
|
|
738
|
+
return { usage, projects: rows };
|
|
739
|
+
}
|
|
740
|
+
function project(projectId, range, nowMs) {
|
|
741
|
+
const window = rangeWindow(range, nowMs);
|
|
742
|
+
const usage = buildUsage(range, nowMs, { projectId }, projectEarliestActivity(projectId, nowMs));
|
|
743
|
+
const roots = [];
|
|
744
|
+
for (const tree of treesFor(projectId)) {
|
|
745
|
+
const latest = treeLatestInWindow(tree, window);
|
|
746
|
+
if (range !== "lifetime" && latest === undefined)
|
|
747
|
+
continue;
|
|
748
|
+
const sum = accumulateRange(window.sinceMs, window.untilMs, {
|
|
749
|
+
sessionIds: new Set(tree.memberIds),
|
|
750
|
+
collectSessions: false,
|
|
751
|
+
});
|
|
752
|
+
const rootSession = sessions[tree.rootId];
|
|
753
|
+
if (!rootSession)
|
|
754
|
+
continue;
|
|
755
|
+
const row = {
|
|
756
|
+
sessionId: tree.rootId,
|
|
757
|
+
title: sessionTitle(rootSession),
|
|
758
|
+
tokens: finalize(sum.totals),
|
|
759
|
+
latestActivityAtMs: latest ?? 0,
|
|
760
|
+
};
|
|
761
|
+
const worktreeLabel = basenameOf(rootSession.directory);
|
|
762
|
+
if (worktreeLabel)
|
|
763
|
+
row.worktreeLabel = worktreeLabel;
|
|
764
|
+
roots.push(row);
|
|
765
|
+
}
|
|
766
|
+
roots.sort((a, b) => {
|
|
767
|
+
if (a.latestActivityAtMs !== b.latestActivityAtMs) {
|
|
768
|
+
return b.latestActivityAtMs - a.latestActivityAtMs;
|
|
769
|
+
}
|
|
770
|
+
return compareIds(a.sessionId, b.sessionId);
|
|
771
|
+
});
|
|
772
|
+
const totals = accumulateRange(window.sinceMs, window.untilMs, { projectId });
|
|
773
|
+
return {
|
|
774
|
+
projectId,
|
|
775
|
+
name: projectName(projectId),
|
|
776
|
+
range,
|
|
777
|
+
window,
|
|
778
|
+
roots,
|
|
779
|
+
totals: { ...finalize(totals.totals), sessionCount: totals.sessions.size },
|
|
780
|
+
usage,
|
|
781
|
+
stale: false,
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
return {
|
|
785
|
+
setMetadata,
|
|
786
|
+
clear() {
|
|
787
|
+
groups.clear();
|
|
788
|
+
ownedByFp.clear();
|
|
789
|
+
ownedBySession.clear();
|
|
790
|
+
hours.clear();
|
|
791
|
+
modelLifetime.clear();
|
|
792
|
+
latestStepBySession.clear();
|
|
793
|
+
earliestStepBySession.clear();
|
|
794
|
+
earliestHourMs = undefined;
|
|
795
|
+
earliestStepGlobal = undefined;
|
|
796
|
+
earliestDirty = true;
|
|
797
|
+
},
|
|
798
|
+
apply(upserts, removals) {
|
|
799
|
+
const affected = new Set();
|
|
800
|
+
for (const row of removals) {
|
|
801
|
+
affected.add(rawAssistantRowFingerprint(row));
|
|
802
|
+
removeOccurrence(row);
|
|
803
|
+
}
|
|
804
|
+
for (const row of upserts) {
|
|
805
|
+
affected.add(rawAssistantRowFingerprint(row));
|
|
806
|
+
upsertOccurrence(row);
|
|
807
|
+
}
|
|
808
|
+
for (const fingerprint of affected)
|
|
809
|
+
recomputeFingerprint(fingerprint);
|
|
810
|
+
},
|
|
811
|
+
hasSession: (sessionId) => Object.hasOwn(sessions, sessionId),
|
|
812
|
+
hasProject: (projectId) => Object.hasOwn(projects, projectId) || sessionsByProject.has(projectId),
|
|
813
|
+
home,
|
|
814
|
+
project,
|
|
815
|
+
earliestActivityMs: earliestActivity,
|
|
816
|
+
ownedStepCount() {
|
|
817
|
+
let count = 0;
|
|
818
|
+
for (const steps of ownedBySession.values())
|
|
819
|
+
count += steps.size;
|
|
820
|
+
return count;
|
|
821
|
+
},
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
//# sourceMappingURL=analytics-model.js.map
|