cartethyia 2.7.2 → 2.7.4
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/.env.example +2 -0
- package/dist/dashboard/assets/{BannedPage-XaUmiBrC.js → BannedPage-ChG5svFb.js} +1 -1
- package/dist/dashboard/assets/BannedPage-ChG5svFb.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-BIcWQun7.js +1 -0
- package/dist/dashboard/assets/CliToolDetailPage-BIcWQun7.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-Bf2VelDe.js +1 -0
- package/dist/dashboard/assets/CliToolsPage-Bf2VelDe.js.gz +0 -0
- package/dist/dashboard/assets/{CombosPage-CXGS_Ct-.js → CombosPage-DCgm5g6g.js} +1 -1
- package/dist/dashboard/assets/CombosPage-DCgm5g6g.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-a8mD0QF1.js +1 -0
- package/dist/dashboard/assets/ConsoleLogPage-a8mD0QF1.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-ggeMSjte.js +1 -0
- package/dist/dashboard/assets/CustomizationPage-ggeMSjte.js.gz +0 -0
- package/dist/dashboard/assets/{HealthEventsModal-BKtAPYVF.js → HealthEventsModal-DzSWzE_j.js} +1 -1
- package/dist/dashboard/assets/HealthEventsModal-DzSWzE_j.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-BdmRLnq2.js → LoginPage-U6AKaJcF.js} +1 -1
- package/dist/dashboard/assets/LoginPage-U6AKaJcF.js.gz +0 -0
- package/dist/dashboard/assets/{ModelPicker-BH8Tehdi.js → ModelPicker-BMS2t8BA.js} +1 -1
- package/dist/dashboard/assets/ModelPicker-BMS2t8BA.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-D2D4IiHl.js +1 -0
- package/dist/dashboard/assets/OverviewPage-D2D4IiHl.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-CrNf7j_X.js +5 -0
- package/dist/dashboard/assets/ProviderDetailPage-CrNf7j_X.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-BSDbquc1.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-BSDbquc1.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-lsrx7NYg.js +9 -0
- package/dist/dashboard/assets/ProxyPage-lsrx7NYg.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-L0skzML8.js +1 -0
- package/dist/dashboard/assets/QuotaPage-L0skzML8.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-CmAbjRHW.js +1 -0
- package/dist/dashboard/assets/SettingsPage-CmAbjRHW.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-f0DE1h0-.js +1 -0
- package/dist/dashboard/assets/SetupPage-f0DE1h0-.js.gz +0 -0
- package/dist/dashboard/assets/{SortableList-Dqf4zpS-.js → SortableList-ClzpwyET.js} +1 -1
- package/dist/dashboard/assets/SortableList-ClzpwyET.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-Byj2lAEm.js → StudioPage-Cq5tW7hW.js} +3 -3
- package/dist/dashboard/assets/StudioPage-Cq5tW7hW.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-Dfc9rWQn.js +56 -0
- package/dist/dashboard/assets/UsagePage-Dfc9rWQn.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-C38iXoO4.js +1 -0
- package/dist/dashboard/assets/api-keys-C38iXoO4.js.gz +0 -0
- package/dist/dashboard/assets/app-a159k0ub.css +2 -0
- package/dist/dashboard/assets/app-a159k0ub.css.gz +0 -0
- package/dist/dashboard/assets/arrow-up-59ms1iiT.js +1 -0
- package/dist/dashboard/assets/arrow-up-59ms1iiT.js.gz +0 -0
- package/dist/dashboard/assets/assert-DbRA8EG2.js +15 -0
- package/dist/dashboard/assets/assert-DbRA8EG2.js.gz +0 -0
- package/dist/dashboard/assets/{badge-DC2L43Mj.js → badge-D9CS6dZk.js} +1 -1
- package/dist/dashboard/assets/badge-D9CS6dZk.js.gz +0 -0
- package/dist/dashboard/assets/{banner-BBVcb0J3.js → banner-DympBNq4.js} +1 -1
- package/dist/dashboard/assets/banner-DympBNq4.js.gz +0 -0
- package/dist/dashboard/assets/{card-Cca1XC6G.js → card-ibRWU_uT.js} +1 -1
- package/dist/dashboard/assets/card-ibRWU_uT.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-63qBGaRw.js +1 -0
- package/dist/dashboard/assets/cli-tools-63qBGaRw.js.gz +0 -0
- package/dist/dashboard/assets/{clipboard-button-DUzEbynq.js → clipboard-button-DJm-9pz7.js} +1 -1
- package/dist/dashboard/assets/clipboard-button-DJm-9pz7.js.gz +0 -0
- package/dist/dashboard/assets/{dialog-DFvWhwTa.js → dialog-8fiE6tec.js} +1 -1
- package/dist/dashboard/assets/dialog-8fiE6tec.js.gz +0 -0
- package/dist/dashboard/assets/drawer-CqGYeOrd.js +1 -0
- package/dist/dashboard/assets/drawer-CqGYeOrd.js.gz +0 -0
- package/dist/dashboard/assets/{entry-Bqy8RFvM.js → entry-BSAsYsmV.js} +1 -1
- package/dist/dashboard/assets/entry-BSAsYsmV.js.gz +0 -0
- package/dist/dashboard/assets/entry-CiIQULZD.js +4 -0
- package/dist/dashboard/assets/entry-CiIQULZD.js.gz +0 -0
- package/dist/dashboard/assets/entry-Daz0lJ-W.js +1 -0
- package/dist/dashboard/assets/entry-Daz0lJ-W.js.gz +0 -0
- package/dist/dashboard/assets/{concurrency-BDF0ok7y.js → fingerprint-pattern-BWuHtbW4.js} +1 -1
- package/dist/dashboard/assets/fingerprint-pattern-BWuHtbW4.js.gz +0 -0
- package/dist/dashboard/assets/{formatters-CWWZ-uCZ.js → formatters-D-MTJxMr.js} +1 -1
- package/dist/dashboard/assets/formatters-D-MTJxMr.js.gz +0 -0
- package/dist/dashboard/assets/{github-badge-C9e8Ts7e.js → github-badge-CPK47xQx.js} +1 -1
- package/dist/dashboard/assets/github-badge-CPK47xQx.js.gz +0 -0
- package/dist/dashboard/assets/{index-DFVFrnWW.js → index-DBNPOfhV.js} +2 -2
- package/dist/dashboard/assets/index-DBNPOfhV.js.gz +0 -0
- package/dist/dashboard/assets/{inline-BFUcvllj.js → inline-BT0zntEr.js} +1 -1
- package/dist/dashboard/assets/inline-BT0zntEr.js.gz +0 -0
- package/dist/dashboard/assets/{input-C_ILAvBb.js → input-Da2ZViWg.js} +1 -1
- package/dist/dashboard/assets/input-Da2ZViWg.js.gz +0 -0
- package/dist/dashboard/assets/{layout-CBIyT6Rt.js → layout-BXNeLw6M.js} +1 -1
- package/dist/dashboard/assets/layout-BXNeLw6M.js.gz +0 -0
- package/dist/dashboard/assets/{list-row-ebJ_-Nsb.js → list-row-BycOrrIV.js} +1 -1
- package/dist/dashboard/assets/list-row-BycOrrIV.js.gz +0 -0
- package/dist/dashboard/assets/live-DCQNZpF7.js +1 -0
- package/dist/dashboard/assets/live-DCQNZpF7.js.gz +0 -0
- package/dist/dashboard/assets/minimize-2-BTmMTK4o.js +1 -0
- package/dist/dashboard/assets/minimize-2-BTmMTK4o.js.gz +0 -0
- package/dist/dashboard/assets/{mutation-sMD965oO.js → mutation-Rr0TIvcj.js} +1 -1
- package/dist/dashboard/assets/mutation-Rr0TIvcj.js.gz +0 -0
- package/dist/dashboard/assets/network-9Yj2ZyLo.js +1 -0
- package/dist/dashboard/assets/network-9Yj2ZyLo.js.gz +0 -0
- package/dist/dashboard/assets/{numbers-BO9dKaFr.js → numbers-CEagj6ZZ.js} +2 -2
- package/dist/dashboard/assets/numbers-CEagj6ZZ.js.gz +0 -0
- package/dist/dashboard/assets/{query-keys-CfL_Zdoh.js → query-keys-BloKtaXJ.js} +1 -1
- package/dist/dashboard/assets/query-keys-BloKtaXJ.js.gz +0 -0
- package/dist/dashboard/assets/quota-Caw7wqci.js +1 -0
- package/dist/dashboard/assets/quota-Caw7wqci.js.gz +0 -0
- package/dist/dashboard/assets/routing-CO9zCUus.js +1 -0
- package/dist/dashboard/assets/routing-CO9zCUus.js.gz +0 -0
- package/dist/dashboard/assets/{select-DBNVLdUu.js → select-BIYIBkMU.js} +2 -2
- package/dist/dashboard/assets/select-BIYIBkMU.js.gz +0 -0
- package/dist/dashboard/assets/settings-2-Ds9DQp0t.js +1 -0
- package/dist/dashboard/assets/settings-2-Ds9DQp0t.js.gz +0 -0
- package/dist/dashboard/assets/settings-jS3-PNSA.js +1 -0
- package/dist/dashboard/assets/settings-jS3-PNSA.js.gz +0 -0
- package/dist/dashboard/assets/{stack-EMrOMt4I.js → stack-DfgnFDWY.js} +1 -1
- package/dist/dashboard/assets/stack-DfgnFDWY.js.gz +0 -0
- package/dist/dashboard/assets/{state-CWoo7ty5.js → state-CkfdYWel.js} +1 -1
- package/dist/dashboard/assets/state-CkfdYWel.js.gz +0 -0
- package/dist/dashboard/assets/{switch-CCjT6IkF.js → switch-SYm237HG.js} +1 -1
- package/dist/dashboard/assets/switch-SYm237HG.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-DjkLHUcE.js → useMutation-BQqCRNIi.js} +1 -1
- package/dist/dashboard/assets/useMutation-BQqCRNIi.js.gz +0 -0
- package/dist/dashboard/index.html +3 -2
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +118 -115
- package/migrations/full-postgres/0026_add_qoder_native_identity.sql +20 -0
- package/migrations/full-postgres/0027_qoder_identity_genuine_seed.sql +21 -0
- package/migrations/full-postgres/0028_add_family_template_key_telemetry.sql +40 -0
- package/migrations/full-postgres/0029_null_share_child_policy_columns.sql +38 -0
- package/migrations/full-postgres/0030_add_api_key_max_children.sql +10 -0
- package/migrations/full-postgres/0031_tenant_system_prompts.sql +16 -0
- package/migrations/full-postgres/0032_add_provider_pool_accounts.sql +53 -0
- package/migrations/full-postgres/0033_add_api_key_ban.sql +9 -0
- package/migrations/full-postgres/0034_add_api_key_ban_until.sql +7 -0
- package/migrations/full-postgres/0035_align_pool_account_status_enum.sql +21 -0
- package/migrations/lite-sqlite3/0026_add_qoder_native_identity.sql +15 -0
- package/migrations/lite-sqlite3/0027_qoder_identity_genuine_seed.sql +21 -0
- package/migrations/lite-sqlite3/0028_add_family_template_key_telemetry.sql +40 -0
- package/migrations/lite-sqlite3/0029_null_share_child_policy_columns.sql +38 -0
- package/migrations/lite-sqlite3/0030_add_api_key_max_children.sql +10 -0
- package/migrations/lite-sqlite3/0031_tenant_system_prompts.sql +10 -0
- package/migrations/lite-sqlite3/0032_add_provider_pool_accounts.sql +44 -0
- package/migrations/lite-sqlite3/0033_add_api_key_ban.sql +8 -0
- package/migrations/lite-sqlite3/0034_add_api_key_ban_until.sql +5 -0
- package/migrations/lite-sqlite3/0035_align_pool_account_status_enum.sql +6 -0
- package/package.json +2 -1
- package/src/boot/app.ts +9 -8
- package/src/config/network.ts +7 -3
- package/src/console/api-keys/bucket-spend.ts +7 -7
- package/src/console/api-keys/contracts.ts +475 -410
- package/src/console/api-keys/routes.ts +211 -23
- package/src/console/audit/routes.ts +3 -3
- package/src/console/auth/account-reset.ts +4 -4
- package/src/console/auth/session.ts +3 -3
- package/src/console/backup/contracts.ts +2 -0
- package/src/console/backup/export-endpoint.ts +14 -17
- package/src/console/backup/routes.ts +43 -11
- package/src/console/backup/service.ts +11 -6
- package/src/console/backup/store.ts +384 -88
- package/src/console/cli-tools/routes.ts +3 -3
- package/src/console/console-router-guards.ts +2 -2
- package/src/console/console-router.ts +4 -4
- package/src/console/dashboard-assets.ts +16 -1
- package/src/console/data-management/routes.ts +3 -3
- package/src/console/domain-registration.ts +4 -2
- package/src/console/observability/contracts.ts +4 -0
- package/src/console/observability/live.ts +3 -3
- package/src/console/observability/logs.ts +3 -3
- package/src/console/observability/performance.ts +3 -3
- package/src/console/observability/routes.ts +3 -3
- package/src/console/observability/store.ts +16 -16
- package/src/console/providers/catalog/contracts.ts +43 -22
- package/src/console/providers/catalog/provider-operations.ts +17 -2
- package/src/console/providers/catalog/routes.ts +3 -3
- package/src/console/providers/catalog/store-helpers.ts +349 -326
- package/src/console/providers/catalog/store.ts +1523 -1292
- package/src/console/providers/detail/routes.ts +3 -3
- package/src/console/providers/oauth/routes.ts +3 -3
- package/src/console/quota/account-quota-tenant.ts +34 -2
- package/src/console/quota/account-quota.ts +4 -1
- package/src/console/quota/account-test-egress.ts +4 -4
- package/src/console/quota/native-identity.ts +189 -0
- package/src/console/remote-support/contracts.ts +12 -6
- package/src/console/remote-support/service.ts +2 -2
- package/src/console/routing/model/routes.ts +3 -3
- package/src/console/routing/pools/contracts.ts +11 -8
- package/src/console/routing/pools/operations.ts +14 -7
- package/src/console/routing/pools/probe-verdict.ts +8 -3
- package/src/console/routing/pools/relay-deploy.ts +9 -9
- package/src/console/routing/pools/routes.ts +3 -3
- package/src/console/routing/pools/store.ts +21 -1
- package/src/console/settings/routes.ts +3 -3
- package/src/console/share/share-router.ts +51 -18
- package/src/console/share/share-stats.ts +158 -49
- package/src/console/share/share-usage.ts +24 -7
- package/src/console/shared/read-through-cache.ts +38 -2
- package/src/console/system-prompt/contracts.ts +102 -0
- package/src/console/system-prompt/routes.ts +165 -0
- package/src/console/updates/routes.ts +7 -4
- package/src/main.ts +11 -0
- package/src/network/outbound-fetch.ts +75 -4
- package/src/network/pool/resolver.ts +39 -39
- package/src/network/pool-cooldown-store.ts +71 -16
- package/src/network/pool-health-machine.ts +21 -1
- package/src/network/rate-limit-verdict.ts +68 -0
- package/src/network/ssrf.ts +4 -4
- package/src/observability/event-query.ts +437 -22
- package/src/observability/telemetry-status.ts +1 -1
- package/src/persistence/db-pg.ts +42 -0
- package/src/persistence/db-sqlite.ts +7 -2
- package/src/persistence/readiness.ts +18 -6
- package/src/persistence/schema.ts +162 -1
- package/src/persistence/stores/api-key-store.ts +849 -581
- package/src/persistence/stores/share-store.ts +65 -13
- package/src/persistence/stores/telemetry-store.ts +58 -2
- package/src/persistence/system-prompt-store.ts +104 -0
- package/src/protocol/codecs.ts +6 -6
- package/src/protocol/gateway-error.ts +6 -3
- package/src/protocol/image-generation.ts +2 -2
- package/src/protocol/reasoning.ts +65 -1
- package/src/protocol/request/chat.ts +1 -0
- package/src/protocol/response/chat.ts +2 -2
- package/src/protocol/response/codex.ts +1 -1
- package/src/protocol/response/gemini.ts +1 -1
- package/src/protocol/response/messages.ts +5 -5
- package/src/protocol/response/responses.ts +2 -2
- package/src/protocol/sse-decoder.ts +14 -3
- package/src/protocol/translation/capabilities.ts +2 -2
- package/src/protocol/upstream/send-claude-messages.ts +3 -3
- package/src/providers/adapters/base-adapter.ts +1 -1
- package/src/providers/adapters/compatible-adapter.ts +2 -2
- package/src/providers/authentication/oauth-refresh-service.ts +2 -2
- package/src/providers/configured-provider.ts +1 -1
- package/src/providers/discovery/probe-phases.ts +2 -2
- package/src/providers/discovery/probing-service.ts +12 -12
- package/src/providers/integrations/agentrouter/agentrouter.ts +2 -3
- package/src/providers/integrations/alibabacp/alibabacp.ts +2 -2
- package/src/providers/integrations/anthropic.ts +4 -11
- package/src/providers/integrations/antigravity/antigravity.ts +33 -47
- package/src/providers/integrations/buddy/buddy-catalog-shared.ts +1 -1
- package/src/providers/integrations/buddy/buddy-chat-shared.ts +30 -2
- package/src/providers/integrations/buddy/buddy-discovery-shared.ts +37 -6
- package/src/providers/integrations/buddy/buddy-identity.ts +22 -1
- package/src/providers/integrations/buddy/buddy-media.ts +21 -17
- package/src/providers/integrations/buddy/codebuddy/provider.ts +6 -2
- package/src/providers/integrations/buddy/workbuddy/provider.ts +6 -2
- package/src/providers/integrations/claude/claude-betas.ts +1 -1
- package/src/providers/integrations/claude/claude-credentials.ts +1 -1
- package/src/providers/integrations/claude/claude-slow-lane-retry.ts +1 -1
- package/src/providers/integrations/claude/claude.ts +3 -10
- package/src/providers/integrations/cline/cline.ts +8 -1
- package/src/providers/integrations/cloudflareai/cloudflareai.ts +4 -7
- package/src/providers/integrations/codex/codex-errors.ts +1 -1
- package/src/providers/integrations/codex/codex.ts +14 -15
- package/src/providers/integrations/commandcode/commandcode.ts +4 -4
- package/src/providers/integrations/commandcode/quota.ts +5 -1
- package/src/providers/integrations/cursor/cursor-http2.ts +11 -11
- package/src/providers/integrations/cursor/cursor.ts +15 -15
- package/src/providers/integrations/factory/factory.ts +4 -4
- package/src/providers/integrations/gemini.ts +11 -11
- package/src/providers/integrations/github/github.ts +26 -7
- package/src/providers/integrations/grok/grok.ts +2 -6
- package/src/providers/integrations/hermes.ts +5 -1
- package/src/providers/integrations/inferhub.ts +4 -11
- package/src/providers/integrations/kilo/kilo.ts +4 -0
- package/src/providers/integrations/kimi/kimi.ts +4 -11
- package/src/providers/integrations/kiro/kiro.ts +10 -10
- package/src/providers/integrations/muse/muse.ts +6 -9
- package/src/providers/integrations/openrouter/provider.ts +4 -0
- package/src/providers/integrations/perplexity.ts +2 -2
- package/src/providers/integrations/qoder/qoder-catalog.ts +47 -9
- package/src/providers/integrations/qoder/qoder-checkin.ts +242 -51
- package/src/providers/integrations/qoder/qoder-native-identity-store.ts +157 -0
- package/src/providers/integrations/qoder/qoder-oauth.ts +12 -3
- package/src/providers/integrations/qoder/qoder-realm.ts +15 -0
- package/src/providers/integrations/qoder/qoder-umid.ts +287 -0
- package/src/providers/integrations/qoder/qoder-virtual.ts +2 -2
- package/src/providers/integrations/qoder/qoder.ts +192 -24
- package/src/providers/integrations/tokenharbor.ts +2 -2
- package/src/providers/integrations/trae/trae.ts +6 -9
- package/src/providers/integrations/zcode/oauth.ts +1 -1
- package/src/providers/operations/account-error-classification.ts +6 -8
- package/src/providers/operations/account-health-service.ts +14 -16
- package/src/providers/operations/client-versions.ts +37 -22
- package/src/providers/operations/provider-catalog-service.ts +4 -4
- package/src/providers/operations/provider-credential-service.ts +16 -4
- package/src/providers/operations/upstream-deadline.ts +3 -3
- package/src/providers/provider-contracts.ts +55 -3
- package/src/providers/provider-credential-resolver.ts +1 -1
- package/src/providers/provider-registry.ts +4 -4
- package/src/providers/quota/quota-contracts.ts +24 -10
- package/src/providers/quota/refresh.ts +2 -2
- package/src/providers/search/search-provider.ts +5 -5
- package/src/security/abuse.ts +4 -4
- package/src/security/access-control.ts +19 -0
- package/src/security/admission/reasons.ts +17 -17
- package/src/security/api-key-auth.ts +18 -5
- package/src/shared/coerce.ts +19 -0
- package/src/transport/dispatch/attempt-finalize.ts +4 -3
- package/src/transport/dispatch/attempt-loop.ts +10 -7
- package/src/transport/dispatch/empty-stream.ts +6 -6
- package/src/transport/dispatch/generation.ts +9 -9
- package/src/transport/dispatch/leases.ts +8 -8
- package/src/transport/dispatch/proxy-request.ts +38 -9
- package/src/transport/dispatch/responses-compact.ts +11 -11
- package/src/transport/dispatch/retry-policy.ts +4 -67
- package/src/transport/dispatch/stream-bridge.ts +1 -1
- package/src/transport/dispatch/streaming/finalize.ts +9 -8
- package/src/transport/dispatch/streaming/stream.ts +16 -1
- package/src/transport/dispatch/systemone.ts +8 -8
- package/src/transport/dispatch/token-count.ts +9 -9
- package/src/transport/dispatch/upstream.ts +10 -0
- package/src/transport/dispatch/websearch.ts +6 -6
- package/src/transport/drain-endpoint.ts +2 -2
- package/src/transport/failure-policy.ts +13 -6
- package/src/transport/guards/auth-guard.ts +6 -5
- package/src/transport/guards/body-policy.ts +4 -4
- package/src/transport/guards/error-lifecycle.ts +18 -3
- package/src/transport/guards/guard-errors.ts +7 -3
- package/src/transport/guards/headroom-guard.ts +1 -1
- package/src/transport/guards/pipeline.ts +6 -6
- package/src/transport/guards/readiness-guard.ts +16 -2
- package/src/transport/guards/request-context.ts +3 -3
- package/src/transport/request/preparer.ts +37 -21
- package/src/transport/request/state.ts +4 -7
- package/src/transport/request/system-prompt-injection.ts +89 -0
- package/src/transport/request/tenant-preferences.ts +43 -0
- package/src/transport/routing/admission.ts +13 -3
- package/src/transport/routing/route-catalog.ts +104 -2
- package/src/transport/routing/route-model.ts +60 -7
- package/src/transport/routing/router.ts +306 -256
- package/src/transport/shutdown-notice.ts +19 -7
- package/src/transport/surface/completion.ts +1 -1
- package/src/transport/surface/messages/encode.ts +1 -1
- package/src/workers/daily-checkin.ts +2 -0
- package/dist/dashboard/assets/BannedPage-XaUmiBrC.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-CqD7QiLM.js +0 -1
- package/dist/dashboard/assets/CliToolDetailPage-CqD7QiLM.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-0XUo4UMn.js +0 -1
- package/dist/dashboard/assets/CliToolsPage-0XUo4UMn.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-CXGS_Ct-.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-DGnGNYnM.js +0 -1
- package/dist/dashboard/assets/ConsoleLogPage-DGnGNYnM.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-DAG5J9EY.js +0 -1
- package/dist/dashboard/assets/CustomizationPage-DAG5J9EY.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-BKtAPYVF.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-BdmRLnq2.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-BH8Tehdi.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-CqMxibJB.js +0 -1
- package/dist/dashboard/assets/OverviewPage-CqMxibJB.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-CqMh2NRX.js +0 -4
- package/dist/dashboard/assets/ProviderDetailPage-CqMh2NRX.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-B9uWu4Nz.js +0 -1
- package/dist/dashboard/assets/ProvidersPage-B9uWu4Nz.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-BoWOhpDO.js +0 -9
- package/dist/dashboard/assets/ProxyPage-BoWOhpDO.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-7P2n--Fv.js +0 -1
- package/dist/dashboard/assets/QuotaPage-7P2n--Fv.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-CxZ1fTkN.js +0 -1
- package/dist/dashboard/assets/SettingsPage-CxZ1fTkN.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-Co12Zzaw.js +0 -1
- package/dist/dashboard/assets/SetupPage-Co12Zzaw.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-Dqf4zpS-.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-Byj2lAEm.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-CTkLAuRc.js +0 -56
- package/dist/dashboard/assets/UsagePage-CTkLAuRc.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-CUi6UXsR.js +0 -1
- package/dist/dashboard/assets/api-keys-CUi6UXsR.js.gz +0 -0
- package/dist/dashboard/assets/app-KvsUJUMF.css +0 -2
- package/dist/dashboard/assets/app-KvsUJUMF.css.gz +0 -0
- package/dist/dashboard/assets/assert-67xXH5rf.js +0 -1
- package/dist/dashboard/assets/assert-67xXH5rf.js.gz +0 -0
- package/dist/dashboard/assets/badge-DC2L43Mj.js.gz +0 -0
- package/dist/dashboard/assets/banner-BBVcb0J3.js.gz +0 -0
- package/dist/dashboard/assets/card-Cca1XC6G.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-KvsWa1Jl.js +0 -1
- package/dist/dashboard/assets/cli-tools-KvsWa1Jl.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-DUzEbynq.js.gz +0 -0
- package/dist/dashboard/assets/concurrency-BDF0ok7y.js.gz +0 -0
- package/dist/dashboard/assets/dialog-DFvWhwTa.js.gz +0 -0
- package/dist/dashboard/assets/drawer-CFM2sMX1.js +0 -1
- package/dist/dashboard/assets/drawer-CFM2sMX1.js.gz +0 -0
- package/dist/dashboard/assets/entry-Bqy8RFvM.js.gz +0 -0
- package/dist/dashboard/assets/entry-ClCMCWWQ.js +0 -4
- package/dist/dashboard/assets/entry-ClCMCWWQ.js.gz +0 -0
- package/dist/dashboard/assets/entry-_xHo5x6r.js +0 -1
- package/dist/dashboard/assets/entry-_xHo5x6r.js.gz +0 -0
- package/dist/dashboard/assets/formatters-CWWZ-uCZ.js.gz +0 -0
- package/dist/dashboard/assets/github-badge-C9e8Ts7e.js.gz +0 -0
- package/dist/dashboard/assets/index-DFVFrnWW.js.gz +0 -0
- package/dist/dashboard/assets/inline-BFUcvllj.js.gz +0 -0
- package/dist/dashboard/assets/input-C_ILAvBb.js.gz +0 -0
- package/dist/dashboard/assets/layout-CBIyT6Rt.js.gz +0 -0
- package/dist/dashboard/assets/list-row-ebJ_-Nsb.js.gz +0 -0
- package/dist/dashboard/assets/live-D0mm--ME.js +0 -1
- package/dist/dashboard/assets/live-D0mm--ME.js.gz +0 -0
- package/dist/dashboard/assets/minimize-2-D-MN8W8a.js +0 -1
- package/dist/dashboard/assets/minimize-2-D-MN8W8a.js.gz +0 -0
- package/dist/dashboard/assets/mutation-sMD965oO.js.gz +0 -0
- package/dist/dashboard/assets/numbers-BO9dKaFr.js.gz +0 -0
- package/dist/dashboard/assets/query-keys-CfL_Zdoh.js.gz +0 -0
- package/dist/dashboard/assets/quota-DZGyp0N5.js +0 -1
- package/dist/dashboard/assets/quota-DZGyp0N5.js.gz +0 -0
- package/dist/dashboard/assets/routing-BnIpi1IJ.js +0 -1
- package/dist/dashboard/assets/routing-BnIpi1IJ.js.gz +0 -0
- package/dist/dashboard/assets/select-DBNVLdUu.js.gz +0 -0
- package/dist/dashboard/assets/settings-BAFhDgX8.js +0 -1
- package/dist/dashboard/assets/settings-BAFhDgX8.js.gz +0 -0
- package/dist/dashboard/assets/stack-EMrOMt4I.js.gz +0 -0
- package/dist/dashboard/assets/state-CWoo7ty5.js.gz +0 -0
- package/dist/dashboard/assets/switch-CCjT6IkF.js.gz +0 -0
- package/dist/dashboard/assets/useMutation-DjkLHUcE.js.gz +0 -0
- /package/dist/dashboard/assets/{app-BaWd0puM.js → app-BayTTy01.js} +0 -0
- /package/dist/dashboard/assets/{app-BaWd0puM.js.gz → app-BayTTy01.js.gz} +0 -0
|
@@ -1,120 +1,123 @@
|
|
|
1
1
|
{
|
|
2
|
-
"count":
|
|
2
|
+
"count": 118,
|
|
3
3
|
"assets": [
|
|
4
|
-
"assets
|
|
5
|
-
"assets
|
|
6
|
-
"assets
|
|
7
|
-
"assets
|
|
8
|
-
"assets
|
|
9
|
-
"assets
|
|
10
|
-
"assets
|
|
11
|
-
"assets
|
|
12
|
-
"assets
|
|
13
|
-
"assets
|
|
14
|
-
"assets
|
|
15
|
-
"assets
|
|
16
|
-
"assets
|
|
17
|
-
"assets
|
|
18
|
-
"assets
|
|
19
|
-
"assets
|
|
20
|
-
"assets
|
|
21
|
-
"assets
|
|
22
|
-
"assets
|
|
23
|
-
"assets
|
|
24
|
-
"assets
|
|
25
|
-
"assets
|
|
26
|
-
"assets
|
|
27
|
-
"assets
|
|
28
|
-
"assets
|
|
29
|
-
"assets
|
|
30
|
-
"assets
|
|
31
|
-
"assets
|
|
32
|
-
"assets
|
|
33
|
-
"assets
|
|
34
|
-
"assets
|
|
35
|
-
"assets
|
|
36
|
-
"assets
|
|
37
|
-
"assets
|
|
38
|
-
"assets
|
|
39
|
-
"assets
|
|
40
|
-
"assets
|
|
41
|
-
"assets
|
|
42
|
-
"assets
|
|
43
|
-
"assets
|
|
44
|
-
"assets
|
|
45
|
-
"assets
|
|
46
|
-
"assets
|
|
47
|
-
"assets
|
|
48
|
-
"assets
|
|
49
|
-
"assets
|
|
50
|
-
"assets
|
|
51
|
-
"assets
|
|
52
|
-
"assets
|
|
53
|
-
"assets
|
|
54
|
-
"assets
|
|
55
|
-
"assets
|
|
56
|
-
"assets
|
|
57
|
-
"assets
|
|
58
|
-
"assets
|
|
59
|
-
"assets
|
|
60
|
-
"assets
|
|
61
|
-
"assets
|
|
62
|
-
"assets
|
|
63
|
-
"assets
|
|
64
|
-
"assets
|
|
65
|
-
"assets
|
|
66
|
-
"assets
|
|
67
|
-
"assets
|
|
68
|
-
"assets
|
|
69
|
-
"assets
|
|
70
|
-
"assets
|
|
71
|
-
"assets
|
|
72
|
-
"assets
|
|
73
|
-
"assets
|
|
74
|
-
"assets
|
|
75
|
-
"assets
|
|
76
|
-
"assets
|
|
77
|
-
"assets
|
|
78
|
-
"assets
|
|
79
|
-
"assets
|
|
80
|
-
"assets
|
|
81
|
-
"assets
|
|
82
|
-
"assets
|
|
83
|
-
"assets
|
|
84
|
-
"assets
|
|
85
|
-
"assets
|
|
86
|
-
"assets
|
|
87
|
-
"assets
|
|
88
|
-
"assets
|
|
89
|
-
"assets
|
|
90
|
-
"assets
|
|
91
|
-
"assets
|
|
92
|
-
"assets
|
|
93
|
-
"assets
|
|
94
|
-
"assets
|
|
95
|
-
"assets
|
|
96
|
-
"assets
|
|
97
|
-
"assets
|
|
98
|
-
"assets
|
|
99
|
-
"assets
|
|
100
|
-
"assets
|
|
101
|
-
"assets
|
|
102
|
-
"assets
|
|
103
|
-
"assets
|
|
104
|
-
"assets
|
|
105
|
-
"assets
|
|
106
|
-
"assets
|
|
107
|
-
"assets
|
|
108
|
-
"assets
|
|
109
|
-
"assets
|
|
110
|
-
"assets
|
|
111
|
-
"assets
|
|
112
|
-
"assets
|
|
113
|
-
"assets
|
|
114
|
-
"assets
|
|
115
|
-
"assets
|
|
116
|
-
"assets
|
|
117
|
-
"assets
|
|
4
|
+
"assets/AccountCooldown-Bjo92Qat.js",
|
|
5
|
+
"assets/BannedPage-ChG5svFb.js",
|
|
6
|
+
"assets/CliToolDetailPage-BIcWQun7.js",
|
|
7
|
+
"assets/CliToolsPage-Bf2VelDe.js",
|
|
8
|
+
"assets/CombosPage-DCgm5g6g.js",
|
|
9
|
+
"assets/ConsoleLogPage-a8mD0QF1.js",
|
|
10
|
+
"assets/CustomizationPage-ggeMSjte.js",
|
|
11
|
+
"assets/HealthEventsModal-DzSWzE_j.js",
|
|
12
|
+
"assets/LoginPage-U6AKaJcF.js",
|
|
13
|
+
"assets/ModelPicker-BMS2t8BA.js",
|
|
14
|
+
"assets/OverviewPage-D2D4IiHl.js",
|
|
15
|
+
"assets/ProviderDetailPage-CrNf7j_X.js",
|
|
16
|
+
"assets/ProviderIcon-FB6yS4v1.js",
|
|
17
|
+
"assets/ProvidersPage-BSDbquc1.js",
|
|
18
|
+
"assets/ProxyPage-lsrx7NYg.js",
|
|
19
|
+
"assets/QuotaPage-L0skzML8.js",
|
|
20
|
+
"assets/SettingsPage-CmAbjRHW.js",
|
|
21
|
+
"assets/SetupPage-f0DE1h0-.js",
|
|
22
|
+
"assets/SortableList-ClzpwyET.js",
|
|
23
|
+
"assets/StudioPage-Cq5tW7hW.js",
|
|
24
|
+
"assets/ToolIcon-K1ckcDKg.js",
|
|
25
|
+
"assets/UsagePage-Dfc9rWQn.js",
|
|
26
|
+
"assets/api-keys-C38iXoO4.js",
|
|
27
|
+
"assets/app-BayTTy01.js",
|
|
28
|
+
"assets/app-a159k0ub.css",
|
|
29
|
+
"assets/arrow-left-CpBxkoxI.js",
|
|
30
|
+
"assets/arrow-right-Dl5yKnp8.js",
|
|
31
|
+
"assets/arrow-up-59ms1iiT.js",
|
|
32
|
+
"assets/assert-DbRA8EG2.js",
|
|
33
|
+
"assets/backup-file-gdKIlg8U.js",
|
|
34
|
+
"assets/badge-D9CS6dZk.js",
|
|
35
|
+
"assets/banner-DympBNq4.js",
|
|
36
|
+
"assets/brain-Cwed_72z.js",
|
|
37
|
+
"assets/card-ibRWU_uT.js",
|
|
38
|
+
"assets/chevron-right-BXIy5l3h.js",
|
|
39
|
+
"assets/circle-alert-CntYHV5v.js",
|
|
40
|
+
"assets/circle-check-BU3v_mFW.js",
|
|
41
|
+
"assets/cli-tools-63qBGaRw.js",
|
|
42
|
+
"assets/clipboard-button-DJm-9pz7.js",
|
|
43
|
+
"assets/database-Dz9N3zGd.js",
|
|
44
|
+
"assets/dialog-8fiE6tec.js",
|
|
45
|
+
"assets/dialog-actions-B1axpEg7.js",
|
|
46
|
+
"assets/download-dRFo5_Wu.js",
|
|
47
|
+
"assets/drawer-CqGYeOrd.js",
|
|
48
|
+
"assets/entry-BSAsYsmV.js",
|
|
49
|
+
"assets/entry-CiIQULZD.js",
|
|
50
|
+
"assets/entry-Daz0lJ-W.js",
|
|
51
|
+
"assets/eye-C_hawfH4.js",
|
|
52
|
+
"assets/eye-off-Bk5g2luF.js",
|
|
53
|
+
"assets/fingerprint-pattern-BWuHtbW4.js",
|
|
54
|
+
"assets/formatters-D-MTJxMr.js",
|
|
55
|
+
"assets/gauge-BbIMy7MB.js",
|
|
56
|
+
"assets/github-badge-CPK47xQx.js",
|
|
57
|
+
"assets/image-BPaouViG.js",
|
|
58
|
+
"assets/index-DBNPOfhV.js",
|
|
59
|
+
"assets/inline-BT0zntEr.js",
|
|
60
|
+
"assets/input-Da2ZViWg.js",
|
|
61
|
+
"assets/jsx-runtime-CXUMngI_.js",
|
|
62
|
+
"assets/key-round-UkavsGxp.js",
|
|
63
|
+
"assets/layers-2-glBbjl.js",
|
|
64
|
+
"assets/layout-BXNeLw6M.js",
|
|
65
|
+
"assets/list-row-BycOrrIV.js",
|
|
66
|
+
"assets/live-DCQNZpF7.js",
|
|
67
|
+
"assets/log-in-BmRjy60c.js",
|
|
68
|
+
"assets/message-circle-CCxGwRvv.js",
|
|
69
|
+
"assets/minimize-2-BTmMTK4o.js",
|
|
70
|
+
"assets/mutation-Rr0TIvcj.js",
|
|
71
|
+
"assets/network-9Yj2ZyLo.js",
|
|
72
|
+
"assets/numbers-CEagj6ZZ.js",
|
|
73
|
+
"assets/pencil-768ysRAr.js",
|
|
74
|
+
"assets/plus-DIdX_g-x.js",
|
|
75
|
+
"assets/power-off-Yjw9GMJh.js",
|
|
76
|
+
"assets/privacy-mode-GM8bej85.js",
|
|
77
|
+
"assets/providers/agentrouter.svg",
|
|
78
|
+
"assets/providers/aihubmix.svg",
|
|
79
|
+
"assets/providers/alibaba-coding-plan.svg",
|
|
80
|
+
"assets/providers/alibaba.svg",
|
|
81
|
+
"assets/providers/antigravity.svg",
|
|
82
|
+
"assets/providers/bai.svg",
|
|
83
|
+
"assets/providers/blackbox.svg",
|
|
84
|
+
"assets/providers/claude-code.svg",
|
|
85
|
+
"assets/providers/exa.svg",
|
|
86
|
+
"assets/providers/gmi-cloud.svg",
|
|
87
|
+
"assets/providers/inception.svg",
|
|
88
|
+
"assets/providers/inferhub.svg",
|
|
89
|
+
"assets/providers/muse.svg",
|
|
90
|
+
"assets/providers/nous-research.svg",
|
|
91
|
+
"assets/providers/openai-light.svg",
|
|
92
|
+
"assets/providers/parallel.svg",
|
|
93
|
+
"assets/providers/tokenharbor.svg",
|
|
94
|
+
"assets/providers/zai-coding-plan.svg",
|
|
95
|
+
"assets/query-keys-BloKtaXJ.js",
|
|
96
|
+
"assets/quota-Caw7wqci.js",
|
|
97
|
+
"assets/refresh-cw-BqJFk4sU.js",
|
|
98
|
+
"assets/rotate-ccw-CufcqITi.js",
|
|
99
|
+
"assets/route-CNSNj9Zm.js",
|
|
100
|
+
"assets/routing-CO9zCUus.js",
|
|
101
|
+
"assets/scaling-nWE4Cx8f.js",
|
|
102
|
+
"assets/search-JOKus9rb.js",
|
|
103
|
+
"assets/select-BIYIBkMU.js",
|
|
104
|
+
"assets/settings-2-Ds9DQp0t.js",
|
|
105
|
+
"assets/settings-jS3-PNSA.js",
|
|
106
|
+
"assets/shield-check-DVS0Foqh.js",
|
|
107
|
+
"assets/stack-DfgnFDWY.js",
|
|
108
|
+
"assets/state-CkfdYWel.js",
|
|
109
|
+
"assets/stream-retry-5QnVuSSo.js",
|
|
110
|
+
"assets/switch-SYm237HG.js",
|
|
111
|
+
"assets/terminal-0_IjPWTk.js",
|
|
112
|
+
"assets/tokens-COzario9.js",
|
|
113
|
+
"assets/trash-Cppn5c3R.js",
|
|
114
|
+
"assets/use-clipboard-B0Sy03fE.js",
|
|
115
|
+
"assets/use-modal-focus-By7oJoGd.js",
|
|
116
|
+
"assets/use-reduced-motion-C4B0R6Sz.js",
|
|
117
|
+
"assets/use-timeout-BwcBBRrT.js",
|
|
118
|
+
"assets/useMutation-BQqCRNIi.js",
|
|
119
|
+
"assets/wrench-B6E1oEuY.js",
|
|
120
|
+
"assets/zap-C4EeVW4q.js",
|
|
118
121
|
"index.html"
|
|
119
122
|
]
|
|
120
123
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Qoder native machine identity (UMID) bound to one account.
|
|
2
|
+
--
|
|
3
|
+
-- The daily 100-credit check-in campaign appears only when the request
|
|
4
|
+
-- carries a genuine, non-VM device identity. That identity is a
|
|
5
|
+
-- deterministic function of a seed file (`~/.config/.locale_cfg`): the
|
|
6
|
+
-- `runtime-info` bridge derives machineToken/machineType/machineCode from the
|
|
7
|
+
-- seed. Each account gets its own minted seed, so it looks like its own
|
|
8
|
+
-- device to the server.
|
|
9
|
+
--
|
|
10
|
+
-- The identity is not a credential (it travels in plaintext `cosy-machine*`
|
|
11
|
+
-- headers), so it lives unsealed as a JSON object. The partial unique index
|
|
12
|
+
-- on the extracted `machineToken` enforces "one device per account" at the
|
|
13
|
+
-- database level: two accounts sharing a token would claim as the same
|
|
14
|
+
-- device and the second would lose the grant for the day.
|
|
15
|
+
ALTER TABLE "provider_accounts"
|
|
16
|
+
ADD COLUMN "native_identity" jsonb;
|
|
17
|
+
|
|
18
|
+
CREATE UNIQUE INDEX "provider_accounts_native_identity_token_uidx"
|
|
19
|
+
ON "provider_accounts" ((native_identity ->> 'machineToken'))
|
|
20
|
+
WHERE native_identity IS NOT NULL;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Qoder native identity: genuine SG identity + per-account seed replay.
|
|
2
|
+
--
|
|
3
|
+
-- Research (2026-10-30, see
|
|
4
|
+
-- documentation/archive/research/Qoder-03-umid-and-identity-findings.md)
|
|
5
|
+
-- established that machine identity does not gate the daily-credit campaign.
|
|
6
|
+
-- The seed is retained for deterministic replay of a native identity on
|
|
7
|
+
-- surfaces that may require one; it is not required for campaign eligibility.
|
|
8
|
+
--
|
|
9
|
+
-- Migration 0026 already added `native_identity` (the token triple + optional
|
|
10
|
+
-- seed) with a partial unique index on the extracted machineToken — the
|
|
11
|
+
-- "one device per account" invariant. This migration does not change that
|
|
12
|
+
-- schema; it only documents the contract change on the same column:
|
|
13
|
+
--
|
|
14
|
+
-- `seed` makes a native identity replay-capable (the token can be
|
|
15
|
+
-- re-derived from the seed, never the reverse). Rows minted by the
|
|
16
|
+
-- generated path may have `seed = ""`; that affects native replay only,
|
|
17
|
+
-- not the daily campaign claim.
|
|
18
|
+
--
|
|
19
|
+
-- No DDL is needed: the JSON shape already carries everything. Kept as an
|
|
20
|
+
-- empty migration so the migration numbering records the policy change.
|
|
21
|
+
SELECT 1;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
-- Denormalizes the share-template family onto every telemetry event.
|
|
2
|
+
--
|
|
3
|
+
-- The share page's family rollup used to scope by an `EXISTS` against
|
|
4
|
+
-- `api_keys` (the template plus every child it issued). That made history
|
|
5
|
+
-- depend on the key row surviving: revoking/removing a key silently dropped
|
|
6
|
+
-- its events out of the family totals. This column pins the template on the
|
|
7
|
+
-- event at write time, so usage outlives the key.
|
|
8
|
+
--
|
|
9
|
+
-- Backfill is idempotent: it only fills NULL rows (the column is new, so
|
|
10
|
+
-- every existing row is NULL) and never overwrites a value. Events whose key
|
|
11
|
+
-- was already hard-deleted before this migration cannot be attributed and stay
|
|
12
|
+
-- NULL; the soft-delete change shipped alongside this prevents future loss.
|
|
13
|
+
|
|
14
|
+
ALTER TABLE "telemetry_events" ADD COLUMN IF NOT EXISTS "family_template_key_id" uuid;
|
|
15
|
+
|
|
16
|
+
CREATE INDEX IF NOT EXISTS "telemetry_events_tenant_family_created_id_idx"
|
|
17
|
+
ON "telemetry_events" ("tenant_id", "family_template_key_id", "created_at" DESC, "id" DESC);
|
|
18
|
+
|
|
19
|
+
ALTER TABLE "telemetry_usage_totals" ADD COLUMN IF NOT EXISTS "family_template_key_id" uuid;
|
|
20
|
+
|
|
21
|
+
CREATE INDEX IF NOT EXISTS "telemetry_usage_totals_tenant_family_idx"
|
|
22
|
+
ON "telemetry_usage_totals" ("tenant_id", "family_template_key_id");
|
|
23
|
+
|
|
24
|
+
UPDATE "telemetry_events" AS e
|
|
25
|
+
SET "family_template_key_id" = (
|
|
26
|
+
SELECT COALESCE(k."parent_key_id", k."id")
|
|
27
|
+
FROM "api_keys" k
|
|
28
|
+
WHERE k."id" = e."api_key_id"
|
|
29
|
+
)
|
|
30
|
+
WHERE e."family_template_key_id" IS NULL AND e."api_key_id" IS NOT NULL;
|
|
31
|
+
|
|
32
|
+
UPDATE "telemetry_usage_totals" AS t
|
|
33
|
+
SET "family_template_key_id" = (
|
|
34
|
+
SELECT COALESCE(k."parent_key_id", k."id")
|
|
35
|
+
FROM "api_keys" k
|
|
36
|
+
WHERE k."id" = t."entity_id"
|
|
37
|
+
)
|
|
38
|
+
WHERE t."family_template_key_id" IS NULL
|
|
39
|
+
AND t."identity_type" = 'api_key'
|
|
40
|
+
AND t."entity_id" IS NOT NULL;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
-- One-time row-data optimization for share children.
|
|
2
|
+
--
|
|
3
|
+
-- Every minted share child used to copy the template's policy columns
|
|
4
|
+
-- (notes, limits, model_list, denylist, …). Auth never reads those from the
|
|
5
|
+
-- child — it resolves `policy = parent ?? row` — so the copies were pure
|
|
6
|
+
-- write-amplification. This UPDATE nulls the 11 nullable policy columns on
|
|
7
|
+
-- every child (`parent_key_id IS NOT NULL`). `scopes` stays (NOT NULL, and
|
|
8
|
+
-- required by backup restore); `model_access_mode` stays (NOT NULL default
|
|
9
|
+
-- 'whitelist'). Schema shape is unchanged — no DROP COLUMN — so backup/
|
|
10
|
+
-- restore remains compatible both directions.
|
|
11
|
+
--
|
|
12
|
+
-- Idempotent: the OR-of-IS-NOT-NULL predicate matches nothing on a re-run,
|
|
13
|
+
-- and the migration ledger skips the file after the first apply.
|
|
14
|
+
--
|
|
15
|
+
-- Keep in sync with `normalizeShareChildPolicy` in
|
|
16
|
+
-- `src/console/backup/store.ts` (post-restore re-applies the same null-out
|
|
17
|
+
-- for a tenant, because restore does not re-run numbered migrations).
|
|
18
|
+
|
|
19
|
+
UPDATE "api_keys"
|
|
20
|
+
SET "notes_title" = NULL,
|
|
21
|
+
"notes_subtitle" = NULL,
|
|
22
|
+
"notes_body" = NULL,
|
|
23
|
+
"requests_per_minute" = NULL,
|
|
24
|
+
"daily_token_limit" = NULL,
|
|
25
|
+
"monthly_token_limit" = NULL,
|
|
26
|
+
"lifetime_token_budget" = NULL,
|
|
27
|
+
"max_concurrent_requests" = NULL,
|
|
28
|
+
"model_prefix" = NULL,
|
|
29
|
+
"model_list" = NULL,
|
|
30
|
+
"client_router_denylist" = NULL
|
|
31
|
+
WHERE "parent_key_id" IS NOT NULL
|
|
32
|
+
AND ( "notes_title" IS NOT NULL OR "notes_subtitle" IS NOT NULL
|
|
33
|
+
OR "notes_body" IS NOT NULL OR "requests_per_minute" IS NOT NULL
|
|
34
|
+
OR "daily_token_limit" IS NOT NULL OR "monthly_token_limit" IS NOT NULL
|
|
35
|
+
OR "lifetime_token_budget" IS NOT NULL
|
|
36
|
+
OR "max_concurrent_requests" IS NOT NULL OR "model_prefix" IS NOT NULL
|
|
37
|
+
OR "model_list" IS NOT NULL
|
|
38
|
+
OR "client_router_denylist" IS NOT NULL );
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Add a share-template child slot cap.
|
|
2
|
+
--
|
|
3
|
+
-- Share enrollment links are public, and an attacker minting child rows is
|
|
4
|
+
-- only bounded by the per-IP dedupe, which IP rotation (CDN edges, cloud
|
|
5
|
+
-- egress, residential proxies) defeats. `max_children` lets an operator cap
|
|
6
|
+
-- how many concurrently-active child keys a template may mint; NULL keeps the
|
|
7
|
+
-- legacy unlimited behavior. Enforced at mint time (not a database
|
|
8
|
+
-- constraint) so the error path is a clean 429/409.
|
|
9
|
+
|
|
10
|
+
ALTER TABLE "api_keys" ADD COLUMN "max_children" integer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Tenant-scoped system prompt injection (append/override).
|
|
2
|
+
--
|
|
3
|
+
-- Resolution is most-specific-wins: model > provider > global. A provider
|
|
4
|
+
-- either follows the tenant's global prompt (`providers` entry
|
|
5
|
+
-- followGlobal = true, its own setting is ignored) or carries a custom one.
|
|
6
|
+
-- Text is capped at 5 MB per scope in the console route; the dispatch-path
|
|
7
|
+
-- reader is revision-keyed cached, so a mutation converges within the
|
|
8
|
+
-- settings-revision bump. `global` NULL means never configured — distinct
|
|
9
|
+
-- from an explicit `{"enabled": false}` row.
|
|
10
|
+
CREATE TABLE IF NOT EXISTS "tenant_system_prompts" (
|
|
11
|
+
"tenant_id" uuid PRIMARY KEY REFERENCES "tenants" ("id") ON DELETE CASCADE,
|
|
12
|
+
"global" jsonb,
|
|
13
|
+
"providers" jsonb NOT NULL DEFAULT '{}',
|
|
14
|
+
"models" jsonb NOT NULL DEFAULT '{}',
|
|
15
|
+
"updated_at" timestamptz NOT NULL DEFAULT now()
|
|
16
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
-- Pool-as-account routing entities for ip-scoped, credential-less providers.
|
|
2
|
+
--
|
|
3
|
+
-- For providers whose rate limit follows the egress address (OpenCode Free),
|
|
4
|
+
-- the pool is the resource that runs out — but it was invisible to account-level
|
|
5
|
+
-- health and routing because the provider owns no `provider_accounts` rows.
|
|
6
|
+
-- This table materializes one row per (pool × ip-scoped provider), carrying the
|
|
7
|
+
-- same health state machine (`status`, `cooldown_until`, …) so a spent egress
|
|
8
|
+
-- is excluded from routing plans exactly like a cooling account, and shows in
|
|
9
|
+
-- the provider's Accounts card with a "Pool" badge.
|
|
10
|
+
--
|
|
11
|
+
-- The row is an account-equivalent, not an account: it resolves no credential,
|
|
12
|
+
-- is skipped by quota-refresh and identity sweeps (they filter on real
|
|
13
|
+
-- credential kinds), and is owned by its pool — deleting the pool cascades the
|
|
14
|
+
-- row. Rows are backfilled here for every existing pool × ip-scoped provider so
|
|
15
|
+
-- no operator action is needed to adopt the feature.
|
|
16
|
+
CREATE TABLE IF NOT EXISTS "provider_pool_accounts" (
|
|
17
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
18
|
+
"tenant_id" uuid NOT NULL REFERENCES "tenants" ("id") ON DELETE CASCADE,
|
|
19
|
+
"network_pool_id" uuid NOT NULL REFERENCES "network_pools" ("id") ON DELETE CASCADE,
|
|
20
|
+
"provider_id" text NOT NULL,
|
|
21
|
+
"label" text NOT NULL,
|
|
22
|
+
"status" text NOT NULL DEFAULT 'active'
|
|
23
|
+
CHECK ("status" IN ('active', 'cooldown', 'disabled')),
|
|
24
|
+
"consecutive_failures" integer NOT NULL DEFAULT 0,
|
|
25
|
+
"last_success_at" timestamptz,
|
|
26
|
+
"last_error" text,
|
|
27
|
+
"last_error_category" text,
|
|
28
|
+
"last_error_at" timestamptz,
|
|
29
|
+
"cooldown_until" timestamptz,
|
|
30
|
+
"last_recovered_at" timestamptz,
|
|
31
|
+
"created_at" timestamptz NOT NULL DEFAULT now(),
|
|
32
|
+
"updated_at" timestamptz NOT NULL DEFAULT now(),
|
|
33
|
+
CONSTRAINT provider_pool_accounts_pool_provider_uidx
|
|
34
|
+
UNIQUE ("network_pool_id", "provider_id", "tenant_id")
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
CREATE INDEX IF NOT EXISTS provider_pool_accounts_tenant_status_idx
|
|
38
|
+
ON "provider_pool_accounts" ("tenant_id", "status");
|
|
39
|
+
CREATE INDEX IF NOT EXISTS provider_pool_accounts_provider_status_idx
|
|
40
|
+
ON "provider_pool_accounts" ("provider_id", "status");
|
|
41
|
+
|
|
42
|
+
-- Backfill: every existing pool × ip-scoped provider gets its row. The
|
|
43
|
+
-- ip-scoped set is OpenCode Free today; the provider id is spelled here so the
|
|
44
|
+
-- rule stays a data fact, not a code constant.
|
|
45
|
+
INSERT INTO "provider_pool_accounts"
|
|
46
|
+
("tenant_id", "network_pool_id", "provider_id", "label")
|
|
47
|
+
SELECT
|
|
48
|
+
p."tenant_id",
|
|
49
|
+
p."id",
|
|
50
|
+
'opencode',
|
|
51
|
+
'Pool ' || left(p."id"::text, 8)
|
|
52
|
+
FROM "network_pools" p
|
|
53
|
+
ON CONFLICT ("network_pool_id", "provider_id", "tenant_id") DO NOTHING;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- API-key ban state.
|
|
2
|
+
--
|
|
3
|
+
-- A ban is distinct from revoke (terminal, tombstone-like) and disable
|
|
4
|
+
-- (operator toggle, reversible): it records *why* a key was banned
|
|
5
|
+
-- (`ban_reason`) for the console's "See reason" modal. Unban clears both
|
|
6
|
+
-- columns entirely — no tombstone, no leftover metadata.
|
|
7
|
+
ALTER TABLE "api_keys"
|
|
8
|
+
ADD COLUMN "banned_at" timestamptz,
|
|
9
|
+
ADD COLUMN "ban_reason" text;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
-- API-key ban expiry.
|
|
2
|
+
--
|
|
3
|
+
-- A ban may now carry an optional `banned_until`: a timed ban lifts on its
|
|
4
|
+
-- own (auth checks `banned_at` against `banned_until`), while `null` keeps the
|
|
5
|
+
-- earlier permanent-ban behavior. Unban clears all three ban columns.
|
|
6
|
+
ALTER TABLE "api_keys"
|
|
7
|
+
ADD COLUMN "banned_until" timestamptz;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Align `provider_pool_accounts.status` with the shared `health_status` enum.
|
|
2
|
+
--
|
|
3
|
+
-- The table was created with a `text` column plus an inline CHECK (migration
|
|
4
|
+
-- 0032), while every other health-state column uses the `health_status` enum.
|
|
5
|
+
-- The Drizzle schema declares the enum, so the drift checker reported the text
|
|
6
|
+
-- column and its CHECK as "produced by migrations but not in schema". This
|
|
7
|
+
-- migration rewrites the column to the enum: same allowed values, one
|
|
8
|
+
-- canonical type.
|
|
9
|
+
--
|
|
10
|
+
-- The inline CHECK from 0032 must be dropped first: PostgreSQL rewrites
|
|
11
|
+
-- CHECK expressions during an ALTER TYPE, and the old `status IN ('active',
|
|
12
|
+
-- ...)` expression compares the new enum column against text literals, which
|
|
13
|
+
-- has no operator once the column becomes the enum.
|
|
14
|
+
|
|
15
|
+
ALTER TABLE "provider_pool_accounts" DROP CONSTRAINT "provider_pool_accounts_status_check";
|
|
16
|
+
|
|
17
|
+
ALTER TABLE "provider_pool_accounts"
|
|
18
|
+
ALTER COLUMN "status" DROP DEFAULT,
|
|
19
|
+
ALTER COLUMN "status" SET DATA TYPE "public"."health_status"
|
|
20
|
+
USING "status"::"public"."health_status",
|
|
21
|
+
ALTER COLUMN "status" SET DEFAULT 'active';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Qoder native machine identity (UMID) bound to one account.
|
|
2
|
+
--
|
|
3
|
+
-- SQLite mirror of `full-postgres/0026_add_qoder_native_identity.sql`:
|
|
4
|
+
-- the column is `text` (the SQLite representation of jsonb) and the unique
|
|
5
|
+
-- index extracts the `machineToken` the same way the application reads it.
|
|
6
|
+
--
|
|
7
|
+
-- The partial unique index enforces "one device per account" at the database
|
|
8
|
+
-- level. SQLite supports expression indexes (3.38+); a bound identity is a
|
|
9
|
+
-- non-null JSON object whose `$.machineToken` is the device key.
|
|
10
|
+
ALTER TABLE "provider_accounts"
|
|
11
|
+
ADD COLUMN "native_identity" text;
|
|
12
|
+
|
|
13
|
+
CREATE UNIQUE INDEX "provider_accounts_native_identity_token_uidx"
|
|
14
|
+
ON "provider_accounts" (json_extract(native_identity, '$.machineToken'))
|
|
15
|
+
WHERE native_identity IS NOT NULL;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Qoder native identity: genuine SG identity + per-account seed replay.
|
|
2
|
+
--
|
|
3
|
+
-- Research (2026-10-30, see
|
|
4
|
+
-- documentation/archive/research/Qoder-03-umid-and-identity-findings.md)
|
|
5
|
+
-- established that machine identity does not gate the daily-credit campaign.
|
|
6
|
+
-- The seed is retained for deterministic replay of a native identity on
|
|
7
|
+
-- surfaces that may require one; it is not required for campaign eligibility.
|
|
8
|
+
--
|
|
9
|
+
-- Migration 0026 already added `native_identity` (the token triple + optional
|
|
10
|
+
-- seed) with a partial unique index on the extracted machineToken — the
|
|
11
|
+
-- "one device per account" invariant. This migration does not change that
|
|
12
|
+
-- schema; it only documents the contract change on the same column:
|
|
13
|
+
--
|
|
14
|
+
-- `seed` makes a native identity replay-capable (the token can be
|
|
15
|
+
-- re-derived from the seed, never the reverse). Rows minted by the
|
|
16
|
+
-- generated path may have `seed = ""`; that affects native replay only,
|
|
17
|
+
-- not the daily campaign claim.
|
|
18
|
+
--
|
|
19
|
+
-- No DDL is needed: the JSON shape already carries everything. Kept as an
|
|
20
|
+
-- empty migration so the migration numbering records the policy change.
|
|
21
|
+
SELECT 1;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
-- Denormalizes the share-template family onto every telemetry event.
|
|
2
|
+
--
|
|
3
|
+
-- The share page's family rollup used to scope by an `EXISTS` against
|
|
4
|
+
-- `api_keys` (the template plus every child it issued). That made history
|
|
5
|
+
-- depend on the key row surviving: revoking/removing a key silently dropped
|
|
6
|
+
-- its events out of the family totals. This column pins the template on the
|
|
7
|
+
-- event at write time, so usage outlives the key.
|
|
8
|
+
--
|
|
9
|
+
-- Backfill is idempotent: it only fills NULL rows (the column is new, so
|
|
10
|
+
-- every existing row is NULL) and never overwrites a value. Events whose key
|
|
11
|
+
-- was already hard-deleted before this migration cannot be attributed and stay
|
|
12
|
+
-- NULL; the soft-delete change shipped alongside this prevents future loss.
|
|
13
|
+
|
|
14
|
+
ALTER TABLE "telemetry_events" ADD COLUMN "family_template_key_id" text;
|
|
15
|
+
|
|
16
|
+
CREATE INDEX IF NOT EXISTS "telemetry_events_tenant_family_created_id_idx"
|
|
17
|
+
ON "telemetry_events" ("tenant_id", "family_template_key_id", "created_at" DESC, "id" DESC);
|
|
18
|
+
|
|
19
|
+
ALTER TABLE "telemetry_usage_totals" ADD COLUMN "family_template_key_id" text;
|
|
20
|
+
|
|
21
|
+
CREATE INDEX IF NOT EXISTS "telemetry_usage_totals_tenant_family_idx"
|
|
22
|
+
ON "telemetry_usage_totals" ("tenant_id", "family_template_key_id");
|
|
23
|
+
|
|
24
|
+
UPDATE "telemetry_events" AS e
|
|
25
|
+
SET "family_template_key_id" = (
|
|
26
|
+
SELECT COALESCE(k."parent_key_id", k."id")
|
|
27
|
+
FROM "api_keys" k
|
|
28
|
+
WHERE k."id" = e."api_key_id"
|
|
29
|
+
)
|
|
30
|
+
WHERE e."family_template_key_id" IS NULL AND e."api_key_id" IS NOT NULL;
|
|
31
|
+
|
|
32
|
+
UPDATE "telemetry_usage_totals" AS t
|
|
33
|
+
SET "family_template_key_id" = (
|
|
34
|
+
SELECT COALESCE(k."parent_key_id", k."id")
|
|
35
|
+
FROM "api_keys" k
|
|
36
|
+
WHERE k."id" = t."entity_id"
|
|
37
|
+
)
|
|
38
|
+
WHERE t."family_template_key_id" IS NULL
|
|
39
|
+
AND t."identity_type" = 'api_key'
|
|
40
|
+
AND t."entity_id" IS NOT NULL;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
-- One-time row-data optimization for share children.
|
|
2
|
+
--
|
|
3
|
+
-- Every minted share child used to copy the template's policy columns
|
|
4
|
+
-- (notes, limits, model_list, denylist, …). Auth never reads those from the
|
|
5
|
+
-- child — it resolves `policy = parent ?? row` — so the copies were pure
|
|
6
|
+
-- write-amplification. This UPDATE nulls the 11 nullable policy columns on
|
|
7
|
+
-- every child (`parent_key_id IS NOT NULL`). `scopes` stays (NOT NULL, and
|
|
8
|
+
-- required by backup restore); `model_access_mode` stays (NOT NULL default
|
|
9
|
+
-- 'whitelist'). Schema shape is unchanged — no DROP COLUMN — so backup/
|
|
10
|
+
-- restore remains compatible both directions.
|
|
11
|
+
--
|
|
12
|
+
-- Idempotent: the OR-of-IS-NOT-NULL predicate matches nothing on a re-run,
|
|
13
|
+
-- and the migration ledger skips the file after the first apply.
|
|
14
|
+
--
|
|
15
|
+
-- Keep in sync with `normalizeShareChildPolicy` in
|
|
16
|
+
-- `src/console/backup/store.ts` (post-restore re-applies the same null-out
|
|
17
|
+
-- for a tenant, because restore does not re-run numbered migrations).
|
|
18
|
+
|
|
19
|
+
UPDATE "api_keys"
|
|
20
|
+
SET "notes_title" = NULL,
|
|
21
|
+
"notes_subtitle" = NULL,
|
|
22
|
+
"notes_body" = NULL,
|
|
23
|
+
"requests_per_minute" = NULL,
|
|
24
|
+
"daily_token_limit" = NULL,
|
|
25
|
+
"monthly_token_limit" = NULL,
|
|
26
|
+
"lifetime_token_budget" = NULL,
|
|
27
|
+
"max_concurrent_requests" = NULL,
|
|
28
|
+
"model_prefix" = NULL,
|
|
29
|
+
"model_list" = NULL,
|
|
30
|
+
"client_router_denylist" = NULL
|
|
31
|
+
WHERE "parent_key_id" IS NOT NULL
|
|
32
|
+
AND ( "notes_title" IS NOT NULL OR "notes_subtitle" IS NOT NULL
|
|
33
|
+
OR "notes_body" IS NOT NULL OR "requests_per_minute" IS NOT NULL
|
|
34
|
+
OR "daily_token_limit" IS NOT NULL OR "monthly_token_limit" IS NOT NULL
|
|
35
|
+
OR "lifetime_token_budget" IS NOT NULL
|
|
36
|
+
OR "max_concurrent_requests" IS NOT NULL OR "model_prefix" IS NOT NULL
|
|
37
|
+
OR "model_list" IS NOT NULL
|
|
38
|
+
OR "client_router_denylist" IS NOT NULL );
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Add a share-template child slot cap.
|
|
2
|
+
--
|
|
3
|
+
-- Share enrollment links are public, and an attacker minting child rows is
|
|
4
|
+
-- only bounded by the per-IP dedupe, which IP rotation (CDN edges, cloud
|
|
5
|
+
-- egress, residential proxies) defeats. `max_children` lets an operator cap
|
|
6
|
+
-- how many concurrently-active child keys a template may mint; NULL keeps the
|
|
7
|
+
-- legacy unlimited behavior. Enforced at mint time (not a database
|
|
8
|
+
-- constraint) so the error path is a clean 429/409.
|
|
9
|
+
|
|
10
|
+
ALTER TABLE "api_keys" ADD COLUMN "max_children" integer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Tenant-scoped system prompt injection (append/override).
|
|
2
|
+
--
|
|
3
|
+
-- Mirror of the Postgres migration; see that file for rationale.
|
|
4
|
+
CREATE TABLE IF NOT EXISTS "tenant_system_prompts" (
|
|
5
|
+
"tenant_id" TEXT PRIMARY KEY REFERENCES "tenants" ("id") ON DELETE CASCADE,
|
|
6
|
+
"global" TEXT,
|
|
7
|
+
"providers" TEXT NOT NULL DEFAULT '{}',
|
|
8
|
+
"models" TEXT NOT NULL DEFAULT '{}',
|
|
9
|
+
"updated_at" TEXT NOT NULL DEFAULT (datetime('now'))
|
|
10
|
+
);
|