cartethyia 2.4.6 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -13
- package/dist/dashboard/assets/BannedPage-9igfctfZ.js +1 -0
- package/dist/dashboard/assets/BannedPage-9igfctfZ.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-Bcy150Jo.js → CliToolDetailPage-ZRr2K2sF.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-ZRr2K2sF.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-DyNXefph.js → CliToolsPage-D3xqZbN-.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-D3xqZbN-.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-CVnQPBBz.js +1 -0
- package/dist/dashboard/assets/CombosPage-CVnQPBBz.js.gz +0 -0
- package/dist/dashboard/assets/{ConsoleLogPage-CATpAEOz.js → ConsoleLogPage-u6W1UXSc.js} +1 -1
- package/dist/dashboard/assets/ConsoleLogPage-u6W1UXSc.js.gz +0 -0
- package/dist/dashboard/assets/{CustomizationPage-D6jEU7nL.js → CustomizationPage-CTTpCb25.js} +1 -1
- package/dist/dashboard/assets/CustomizationPage-CTTpCb25.js.gz +0 -0
- package/dist/dashboard/assets/{HealthEventsModal-CZkpn0a7.js → HealthEventsModal-C5XpWlvy.js} +1 -1
- package/dist/dashboard/assets/HealthEventsModal-C5XpWlvy.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-BJlMVN4U.js → LoginPage-DHoB3Agn.js} +1 -1
- package/dist/dashboard/assets/LoginPage-DHoB3Agn.js.gz +0 -0
- package/dist/dashboard/assets/{ModelPicker-Br3CXEau.js → ModelPicker-oQ-SDXp8.js} +1 -1
- package/dist/dashboard/assets/ModelPicker-oQ-SDXp8.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js +1 -0
- package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js +3 -0
- package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js.gz +0 -0
- package/dist/dashboard/assets/ProviderIcon-CmfzxpVM.js +1 -0
- package/dist/dashboard/assets/ProviderIcon-CmfzxpVM.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js +7 -0
- package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js +1 -0
- package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js.gz +0 -0
- package/dist/dashboard/assets/{SettingsPage-BHW4Zt06.js → SettingsPage-CvjZxHE4.js} +1 -1
- package/dist/dashboard/assets/SettingsPage-CvjZxHE4.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-VOYC_lIa.js → SetupPage-D3nza7LH.js} +1 -1
- package/dist/dashboard/assets/SetupPage-D3nza7LH.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-Dtt12WT1.js +1 -0
- package/dist/dashboard/assets/SortableList-Dtt12WT1.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-BNIDLiU6.js → StudioPage-CbK3hXvU.js} +4 -4
- package/dist/dashboard/assets/StudioPage-CbK3hXvU.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-BQlWbWg2.js +56 -0
- package/dist/dashboard/assets/UsagePage-BQlWbWg2.js.gz +0 -0
- package/dist/dashboard/assets/{api-keys-BETfaMYZ.js → api-keys-BmDbsior.js} +1 -1
- package/dist/dashboard/assets/api-keys-BmDbsior.js.gz +0 -0
- package/dist/dashboard/assets/app-BbpSarVV.css +2 -0
- package/dist/dashboard/assets/app-BbpSarVV.css.gz +0 -0
- package/dist/dashboard/assets/assert-BHfaei-X.js +1 -0
- package/dist/dashboard/assets/assert-BHfaei-X.js.gz +0 -0
- package/dist/dashboard/assets/{badge-BTyGk_DL.js → badge-DpXT4Ixt.js} +1 -1
- package/dist/dashboard/assets/badge-DpXT4Ixt.js.gz +0 -0
- package/dist/dashboard/assets/{banner-bujTWYM4.js → banner-CSAAWLJv.js} +1 -1
- package/dist/dashboard/assets/banner-CSAAWLJv.js.gz +0 -0
- package/dist/dashboard/assets/{card-B0Bnx5CA.js → card-DEhRXXw4.js} +1 -1
- package/dist/dashboard/assets/card-DEhRXXw4.js.gz +0 -0
- package/dist/dashboard/assets/{cli-tools-DE2ug812.js → cli-tools-B0wBq-RL.js} +1 -1
- package/dist/dashboard/assets/cli-tools-B0wBq-RL.js.gz +0 -0
- package/dist/dashboard/assets/{clipboard-button-R_rArH8S.js → clipboard-button-DOo6EU8O.js} +1 -1
- package/dist/dashboard/assets/clipboard-button-DOo6EU8O.js.gz +0 -0
- package/dist/dashboard/assets/{dialog-BWIP_EvW.js → dialog-BvQeBMfP.js} +1 -1
- package/dist/dashboard/assets/dialog-BvQeBMfP.js.gz +0 -0
- package/dist/dashboard/assets/{drawer-BKcgVugF.js → drawer-CMwPXwQB.js} +1 -1
- package/dist/dashboard/assets/drawer-CMwPXwQB.js.gz +0 -0
- package/dist/dashboard/assets/{entry-CcWkGR4a.js → entry-D4O2229X.js} +1 -1
- package/dist/dashboard/assets/{entry-CcWkGR4a.js.gz → entry-D4O2229X.js.gz} +0 -0
- package/dist/dashboard/assets/{entry-kTiTFrvh.js → entry-DKvr5Q9K.js} +1 -1
- package/dist/dashboard/assets/entry-DKvr5Q9K.js.gz +0 -0
- package/dist/dashboard/assets/entry-FQCejoDY.js +4 -0
- package/dist/dashboard/assets/entry-FQCejoDY.js.gz +0 -0
- package/dist/dashboard/assets/{github-badge-Booc5mNe.js → github-badge-zliLvBwr.js} +1 -1
- package/dist/dashboard/assets/github-badge-zliLvBwr.js.gz +0 -0
- package/dist/dashboard/assets/{index-D70pChfn.js → index-CXm3FIyt.js} +2 -2
- package/dist/dashboard/assets/index-CXm3FIyt.js.gz +0 -0
- package/dist/dashboard/assets/{inline-D1TCqM2D.js → inline-D1IlZZ8H.js} +1 -1
- package/dist/dashboard/assets/inline-D1IlZZ8H.js.gz +0 -0
- package/dist/dashboard/assets/{input-B9oyU93y.js → input-BpVZdrbc.js} +1 -1
- package/dist/dashboard/assets/input-BpVZdrbc.js.gz +0 -0
- package/dist/dashboard/assets/{layout-BArzXirQ.js → layout-BioLW7gN.js} +1 -1
- package/dist/dashboard/assets/layout-BioLW7gN.js.gz +0 -0
- package/dist/dashboard/assets/{list-row-BVZzaoHF.js → list-row-CwVcGAIc.js} +1 -1
- package/dist/dashboard/assets/list-row-CwVcGAIc.js.gz +0 -0
- package/dist/dashboard/assets/{live-EmuIayqp.js → live-yfEJFF9T.js} +1 -1
- package/dist/dashboard/assets/live-yfEJFF9T.js.gz +0 -0
- package/dist/dashboard/assets/{model-bans-CSPQ9xB0.js → model-bans-CT-TxSNX.js} +1 -1
- package/dist/dashboard/assets/model-bans-CT-TxSNX.js.gz +0 -0
- package/dist/dashboard/assets/providers/cursor.webp +0 -0
- package/dist/dashboard/assets/providers/trae.webp +0 -0
- package/dist/dashboard/assets/{routing-BExgxxBU.js → routing-Cs6jl49L.js} +1 -1
- package/dist/dashboard/assets/routing-Cs6jl49L.js.gz +0 -0
- package/dist/dashboard/assets/select-C0Rer3gF.js +41 -0
- package/dist/dashboard/assets/select-C0Rer3gF.js.gz +0 -0
- package/dist/dashboard/assets/settings-CfcTcOyU.js +1 -0
- package/dist/dashboard/assets/settings-CfcTcOyU.js.gz +0 -0
- package/dist/dashboard/assets/{stack-Ca5HxI5i.js → stack-C9_uUjaA.js} +1 -1
- package/dist/dashboard/assets/stack-C9_uUjaA.js.gz +0 -0
- package/dist/dashboard/assets/{state-CzUPfLXo.js → state-DA0B95UQ.js} +1 -1
- package/dist/dashboard/assets/state-DA0B95UQ.js.gz +0 -0
- package/dist/dashboard/assets/{switch-DOUIky_i.js → switch-Cittxy-x.js} +1 -1
- package/dist/dashboard/assets/switch-Cittxy-x.js.gz +0 -0
- package/dist/dashboard/assets/{toast-C76WrMhc.js → toast-CNt_jzO4.js} +1 -1
- package/dist/dashboard/assets/toast-CNt_jzO4.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-D87FZwH0.js → useMutation-BQKMcJ1H.js} +1 -1
- package/dist/dashboard/assets/useMutation-BQKMcJ1H.js.gz +0 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +51 -52
- package/migrations/full-postgres/0015_add_payload_stages.sql +18 -0
- package/migrations/full-postgres/0016_add_share_link_slug.sql +20 -0
- package/migrations/full-postgres/0017_add_models_pro_only.sql +18 -0
- package/migrations/full-postgres/0018_add_accounts_quota_plan.sql +18 -0
- package/migrations/full-postgres/0019_add_models_free_tier.sql +15 -0
- package/migrations/lite-sqlite3/0015_add_payload_stages.sql +18 -0
- package/migrations/lite-sqlite3/0016_add_share_link_slug.sql +20 -0
- package/migrations/lite-sqlite3/0017_add_models_pro_only.sql +18 -0
- package/migrations/lite-sqlite3/0018_add_accounts_quota_plan.sql +18 -0
- package/migrations/lite-sqlite3/0019_add_models_free_tier.sql +15 -0
- package/package.json +3 -2
- package/scripts/cli/command/console-menu.ts +30 -11
- package/scripts/cli/command/start.ts +77 -13
- package/scripts/cli/command/update.ts +1 -1
- package/scripts/cli/gateway/instance-lock.ts +105 -0
- package/scripts/cli/gateway/spawn.ts +173 -101
- package/scripts/cli/ui/background.ts +110 -49
- package/src/boot/app.ts +20 -6
- package/src/boot/dependencies.ts +19 -0
- package/src/boot/elysia-typebox-bridge.ts +37 -0
- package/src/boot/lifecycle.ts +2 -0
- package/src/config/cooldowns.ts +138 -138
- package/src/config/providers.ts +5 -5
- package/src/config/runtime.ts +19 -3
- package/src/config/spec.ts +9 -0
- package/src/console/api-keys/contracts.ts +414 -391
- package/src/console/api-keys/routes.ts +880 -870
- package/src/console/auth/account-reset-store.ts +14 -0
- package/src/console/auth/account-reset.ts +3 -2
- package/src/console/auth/setup-service.ts +6 -3
- package/src/console/domain-registration.ts +9 -2
- package/src/console/observability/contracts.ts +475 -455
- package/src/console/observability/store.ts +1015 -952
- package/src/console/providers/catalog/contracts.ts +31 -0
- package/src/console/providers/catalog/provider-operations.ts +8 -0
- package/src/console/providers/catalog/store.ts +1532 -1525
- package/src/console/providers/oauth/callback-listener.ts +18 -3
- package/src/console/providers/oauth/routes.ts +38 -15
- package/src/console/quota/refresh.ts +19 -0
- package/src/console/updates/routes.ts +162 -4
- package/src/main.ts +3 -0
- package/src/network/http2-bidi.ts +85 -0
- package/src/network/outbound-fetch.ts +1 -26
- package/src/network/pool/agent.ts +478 -460
- package/src/network/pool/resolver.ts +1104 -544
- package/src/network/pool-health-machine.ts +12 -5
- package/src/observability/payload-capture.ts +344 -324
- package/src/persistence/db-pg.ts +9 -3
- package/src/persistence/db-sqlite.ts +497 -495
- package/src/persistence/health-event-flush.ts +137 -0
- package/src/persistence/migrate.ts +181 -129
- package/src/persistence/schema.ts +1360 -1295
- package/src/persistence/settings-revision.ts +25 -0
- package/src/persistence/shared-cache.ts +217 -0
- package/src/persistence/stores/share-store.ts +556 -528
- package/src/persistence/usage-flush.ts +61 -1
- package/src/protocol/canonical-model.ts +23 -1
- package/src/protocol/response/chat.ts +143 -10
- package/src/protocol/response/omp-tool-call-markup.ts +221 -0
- package/src/providers/default-registry.ts +173 -1
- package/src/providers/discovery/openai-model-discovery.ts +39 -3
- package/src/providers/discovery/openrouter-free-roster.ts +98 -0
- package/src/providers/discovery/probing-service.ts +1022 -1001
- package/src/providers/integrations/buddy/buddy-catalog-shared.ts +39 -0
- package/src/providers/integrations/buddy/buddy-chat-shared.ts +913 -914
- package/src/providers/integrations/buddy/buddy-conversation-headers.ts +18 -5
- package/src/providers/integrations/buddy/codebuddy/cn-provider.ts +4 -0
- package/src/providers/integrations/buddy/codebuddy/provider.ts +180 -175
- package/src/providers/integrations/buddy/codebuddy/shared.ts +15 -6
- package/src/providers/integrations/buddy/workbuddy/provider.ts +206 -204
- package/src/providers/integrations/buddy/workbuddy/shared.ts +3 -3
- package/src/providers/integrations/claude/claude.ts +606 -582
- package/src/providers/integrations/cline/cline-quota.ts +18 -16
- package/src/providers/integrations/cline/cline.ts +539 -468
- package/src/providers/integrations/commandcode/commandcode.ts +675 -541
- package/src/providers/integrations/commandcode/discovery.ts +116 -0
- package/src/providers/integrations/commandcode/quota.ts +160 -0
- package/src/providers/integrations/cursor/cursor-auth.ts +418 -0
- package/src/providers/integrations/cursor/cursor-catalog.ts +368 -0
- package/src/providers/integrations/cursor/cursor-http2.ts +300 -0
- package/src/providers/integrations/cursor/cursor-identity.ts +92 -0
- package/src/providers/integrations/cursor/cursor-request.ts +471 -0
- package/src/providers/integrations/cursor/cursor-session-manager.ts +281 -0
- package/src/providers/integrations/cursor/cursor-shared.ts +108 -0
- package/src/providers/integrations/cursor/cursor.ts +960 -0
- package/src/providers/integrations/cursor/protocol/framing.ts +129 -0
- package/src/providers/integrations/cursor/protocol/messages.ts +2355 -0
- package/src/providers/integrations/cursor/protocol/struct.ts +305 -0
- package/src/providers/integrations/github/github.ts +4 -4
- package/src/providers/integrations/hermes.ts +79 -8
- package/src/providers/integrations/kilo/kilo-discovery.ts +10 -1
- package/src/providers/integrations/kilo/kilo.ts +153 -146
- package/src/providers/integrations/opencode/provider.ts +532 -538
- package/src/providers/integrations/openrouter/provider.ts +139 -281
- package/src/providers/integrations/qoder/qoder-catalog.ts +450 -0
- package/src/providers/integrations/qoder/qoder-oauth.ts +310 -257
- package/src/providers/integrations/qoder/qoder-realm.ts +106 -0
- package/src/providers/integrations/qoder/qoder-virtual.ts +77 -0
- package/src/providers/integrations/qoder/qoder.ts +865 -730
- package/src/providers/integrations/trae/trae-catalog.ts +190 -0
- package/src/providers/integrations/trae/trae-headers.ts +149 -0
- package/src/providers/integrations/trae/trae-oauth.ts +773 -0
- package/src/providers/integrations/trae/trae-protocol.ts +400 -0
- package/src/providers/integrations/trae/trae-realm.ts +220 -0
- package/src/providers/integrations/trae/trae.ts +458 -0
- package/src/providers/operations/account-health-service.ts +107 -10
- package/src/providers/operations/client-versions.ts +133 -6
- package/src/providers/operations/provider-catalog-seeder.ts +95 -86
- package/src/providers/operations/provider-credential-service.ts +46 -7
- package/src/providers/provider-contracts.ts +76 -0
- package/src/providers/provider-metadata.ts +78 -6
- package/src/providers/provider-model-definition.ts +373 -349
- package/src/security/api-key-auth.ts +126 -8
- package/src/transport/contracts.ts +3 -0
- package/src/transport/dispatch/attempt-finalize.ts +32 -1
- package/src/transport/dispatch/attempt-loop.ts +530 -515
- package/src/transport/dispatch/generation.ts +88 -21
- package/src/transport/dispatch/leases.ts +99 -2
- package/src/transport/dispatch/proxy-request.ts +60 -3
- package/src/transport/dispatch/streaming/finalize.ts +16 -1
- package/src/transport/dispatch/streaming/stream.ts +22 -2
- package/src/transport/dispatch/upstream.ts +19 -1
- package/src/transport/guards/auth-guard.ts +26 -1
- package/src/transport/guards/body-policy.ts +5 -4
- package/src/transport/request/preparer.ts +103 -0
- package/src/transport/request/state.ts +14 -0
- package/src/transport/routing/plan-gate.ts +45 -0
- package/src/transport/routing/route-catalog.ts +799 -777
- package/src/transport/routing/route-model.ts +52 -1
- package/src/transport/routing/router.ts +51 -0
- package/dist/dashboard/assets/BannedPage-QhvbJB9o.js +0 -1
- package/dist/dashboard/assets/BannedPage-QhvbJB9o.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-Bcy150Jo.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-DyNXefph.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-Cak0ljnO.js +0 -1
- package/dist/dashboard/assets/CombosPage-Cak0ljnO.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-CATpAEOz.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-D6jEU7nL.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-CZkpn0a7.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-BJlMVN4U.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-Br3CXEau.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-CQxXbo2g.js +0 -1
- package/dist/dashboard/assets/OverviewPage-CQxXbo2g.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage--0RBNh99.js +0 -3
- package/dist/dashboard/assets/ProviderDetailPage--0RBNh99.js.gz +0 -0
- package/dist/dashboard/assets/ProviderIcon-paOCq8I0.js +0 -1
- package/dist/dashboard/assets/ProviderIcon-paOCq8I0.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-1M-C3mbu.js +0 -1
- package/dist/dashboard/assets/ProvidersPage-1M-C3mbu.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-CXiumA53.js +0 -7
- package/dist/dashboard/assets/ProxyPage-CXiumA53.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-BGDIfIYP.js +0 -1
- package/dist/dashboard/assets/QuotaPage-BGDIfIYP.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-BHW4Zt06.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-VOYC_lIa.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-DpOTnGuH.js +0 -1
- package/dist/dashboard/assets/SortableList-DpOTnGuH.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-BNIDLiU6.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-BAFaSDQV.js +0 -56
- package/dist/dashboard/assets/UsagePage-BAFaSDQV.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-BETfaMYZ.js.gz +0 -0
- package/dist/dashboard/assets/app-BLCvGdzb.css +0 -2
- package/dist/dashboard/assets/app-BLCvGdzb.css.gz +0 -0
- package/dist/dashboard/assets/assert-7J6_LVD3.js +0 -1
- package/dist/dashboard/assets/assert-7J6_LVD3.js.gz +0 -0
- package/dist/dashboard/assets/badge-BTyGk_DL.js.gz +0 -0
- package/dist/dashboard/assets/banner-bujTWYM4.js.gz +0 -0
- package/dist/dashboard/assets/card-B0Bnx5CA.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-DE2ug812.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-R_rArH8S.js.gz +0 -0
- package/dist/dashboard/assets/dialog-BWIP_EvW.js.gz +0 -0
- package/dist/dashboard/assets/drawer-BKcgVugF.js.gz +0 -0
- package/dist/dashboard/assets/entry-7dpgvpJ3.js +0 -4
- package/dist/dashboard/assets/entry-7dpgvpJ3.js.gz +0 -0
- package/dist/dashboard/assets/entry-kTiTFrvh.js.gz +0 -0
- package/dist/dashboard/assets/github-badge-Booc5mNe.js.gz +0 -0
- package/dist/dashboard/assets/index-D70pChfn.js.gz +0 -0
- package/dist/dashboard/assets/inline-D1TCqM2D.js.gz +0 -0
- package/dist/dashboard/assets/input-B9oyU93y.js.gz +0 -0
- package/dist/dashboard/assets/layout-BArzXirQ.js.gz +0 -0
- package/dist/dashboard/assets/list-row-BVZzaoHF.js.gz +0 -0
- package/dist/dashboard/assets/live-EmuIayqp.js.gz +0 -0
- package/dist/dashboard/assets/model-bans-CSPQ9xB0.js.gz +0 -0
- package/dist/dashboard/assets/routing-BExgxxBU.js.gz +0 -0
- package/dist/dashboard/assets/select-C9mMoEpJ.js +0 -41
- package/dist/dashboard/assets/select-C9mMoEpJ.js.gz +0 -0
- package/dist/dashboard/assets/settings-C4_Gn_wq.js +0 -1
- package/dist/dashboard/assets/settings-C4_Gn_wq.js.gz +0 -0
- package/dist/dashboard/assets/sliders-horizontal-ClG7dBeJ.js +0 -1
- package/dist/dashboard/assets/sliders-horizontal-ClG7dBeJ.js.gz +0 -0
- package/dist/dashboard/assets/stack-Ca5HxI5i.js.gz +0 -0
- package/dist/dashboard/assets/state-CzUPfLXo.js.gz +0 -0
- package/dist/dashboard/assets/switch-DOUIky_i.js.gz +0 -0
- package/dist/dashboard/assets/toast-C76WrMhc.js.gz +0 -0
- package/dist/dashboard/assets/useMutation-D87FZwH0.js.gz +0 -0
- package/src/network/tls/bun-client-hello.ts +0 -112
- /package/dist/dashboard/assets/{app-Cjq7nrwu.js → app-C-Y4oZT0.js} +0 -0
- /package/dist/dashboard/assets/{app-Cjq7nrwu.js.gz → app-C-Y4oZT0.js.gz} +0 -0
package/src/config/cooldowns.ts
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account/pool health cooldown fallback resolvers.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { CONFIG_SPEC, readInt } from "./spec";
|
|
6
|
-
|
|
7
|
-
/** Fallback cooldown for a provider rate limit (default 15m). */
|
|
8
|
-
export function resolveAccountRateLimitCooldownMs(): number {
|
|
9
|
-
return readInt(
|
|
10
|
-
"CARTETHYIA_ACCOUNT_RATE_LIMIT_COOLDOWN_MS",
|
|
11
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_RATE_LIMIT_COOLDOWN_MS,
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Fallback cooldown for provider quota exhaustion when the error states no
|
|
17
|
-
* reset window (default 1h). A provider-specific rule (xAI Grok Build's
|
|
18
|
-
* rolling 24-hour free-tier window) overrides it inside the classifier.
|
|
19
|
-
*/
|
|
20
|
-
export function resolveAccountQuotaCooldownMs(): number {
|
|
21
|
-
return readInt(
|
|
22
|
-
"CARTETHYIA_ACCOUNT_QUOTA_COOLDOWN_MS",
|
|
23
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_QUOTA_COOLDOWN_MS,
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Fallback cooldown for model-capacity overload (default 2m). */
|
|
28
|
-
export function resolveAccountModelCapacityCooldownMs(): number {
|
|
29
|
-
return readInt(
|
|
30
|
-
"CARTETHYIA_ACCOUNT_MODEL_CAPACITY_COOLDOWN_MS",
|
|
31
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_MODEL_CAPACITY_COOLDOWN_MS,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Backoff for a transient 5xx/network fault, recorded as `cooldown` (default 30s). */
|
|
36
|
-
export function resolveAccountTransientCooldownMs(): number {
|
|
37
|
-
return readInt(
|
|
38
|
-
"CARTETHYIA_ACCOUNT_TRANSIENT_COOLDOWN_MS",
|
|
39
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_TRANSIENT_COOLDOWN_MS,
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Backoff for a failure no rule matched, recorded as `cooldown` (default 1m). */
|
|
44
|
-
export function resolveAccountUnclassifiedCooldownMs(): number {
|
|
45
|
-
return readInt(
|
|
46
|
-
"CARTETHYIA_ACCOUNT_UNCLASSIFIED_COOLDOWN_MS",
|
|
47
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_UNCLASSIFIED_COOLDOWN_MS,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Ceiling an escalated fallback cooldown may reach (default 1h).
|
|
53
|
-
*
|
|
54
|
-
* A fallback duration is one the provider never stated, so escalating it is our
|
|
55
|
-
* own estimate. The cap keeps that estimate from outliving a short transient
|
|
56
|
-
* window: an account that recovers on its own must not sit parked for a day
|
|
57
|
-
* because a burst of 5xx happened to arrive while it was already cooling.
|
|
58
|
-
*/
|
|
59
|
-
export function resolveAccountCooldownEscalationMaxMs(): number {
|
|
60
|
-
return readInt(
|
|
61
|
-
"CARTETHYIA_ACCOUNT_COOLDOWN_ESCALATION_MAX_MS",
|
|
62
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_COOLDOWN_ESCALATION_MAX_MS,
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** How long a proxy pool stays `cooldown` after a transport fault (default 2m). */
|
|
67
|
-
export function resolvePoolCooldownMs(): number {
|
|
68
|
-
return readInt("CARTETHYIA_POOL_COOLDOWN_MS", CONFIG_SPEC.CARTETHYIA_POOL_COOLDOWN_MS);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Backoff for an auth rejection that names no revocation (default 5m).
|
|
73
|
-
*
|
|
74
|
-
* A bare `401`/`403` is weak evidence: it covers clock skew, a key rotated
|
|
75
|
-
* upstream a moment ago, an edge cache, and a load balancer that answers before
|
|
76
|
-
* the credential is loaded. None of those is the credential's death, and this
|
|
77
|
-
* outcome used to be `disabled` — the one state no sweep recovers, so the
|
|
78
|
-
* account left rotation until an operator noticed. A cooldown costs the same
|
|
79
|
-
* requests for five minutes and comes back on its own.
|
|
80
|
-
*
|
|
81
|
-
* Only a *named* revocation (`token revoked`, `invalidated oauth token`) still
|
|
82
|
-
* parks the account: the upstream stated the credential itself is dead, there is
|
|
83
|
-
* no expiry to wait out and no refresh to run, so a cooldown would only return
|
|
84
|
-
* it to rotation to fail again. Set this to `0` to restore the old behavior.
|
|
85
|
-
*/
|
|
86
|
-
export function resolveAccountAuthRejectedCooldownMs(): number {
|
|
87
|
-
return readInt(
|
|
88
|
-
"CARTETHYIA_ACCOUNT_AUTH_REJECTED_COOLDOWN_MS",
|
|
89
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_AUTH_REJECTED_COOLDOWN_MS,
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Base backoff for the buddy policy/channel block (
|
|
95
|
-
*
|
|
96
|
-
* Deliberately a *base*, not the 24h flat penalty it replaced. `11140` has two
|
|
97
|
-
* documented causes our classifier cannot separate from the response alone: the
|
|
98
|
-
* user's prompt failed a safety review, **and** sending the wrong desktop
|
|
99
|
-
* `User-Agent` brand (`workbuddy/shared.ts`). A flat 24h meant that after we
|
|
100
|
-
* fixed a header regression every buddy account stayed dead for up to a further
|
|
101
|
-
* day, and one unsafe prompt cost a whole account a day.
|
|
102
|
-
*
|
|
103
|
-
* As a base it escalates through the consecutive-failure ladder instead, which
|
|
104
|
-
* distinguishes the two causes by what they do next: a genuinely blocked account
|
|
105
|
-
* is refused again on its very next request and parks itself within minutes,
|
|
106
|
-
* while a single bad prompt costs five minutes.
|
|
107
|
-
*/
|
|
108
|
-
export function resolveAccountPolicyBlockCooldownMs(): number {
|
|
109
|
-
return readInt(
|
|
110
|
-
"CARTETHYIA_ACCOUNT_POLICY_BLOCK_COOLDOWN_MS",
|
|
111
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_POLICY_BLOCK_COOLDOWN_MS,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* How long an **automatically** disabled account stays out of rotation (default 24h).
|
|
117
|
-
*
|
|
118
|
-
* `disabled` used to be terminal: nothing recovered it, so a credential rejected
|
|
119
|
-
* once — a revoked key, a definitively dead refresh grant — left rotation until an
|
|
120
|
-
* operator noticed and clicked Recover by hand. That is the wrong default for a
|
|
121
|
-
* credential that may come back on its own: keys get re-issued, grants get
|
|
122
|
-
* re-authorized, and an upstream's notion of "invalid" can outrun ours.
|
|
123
|
-
*
|
|
124
|
-
* The deadline is what makes this safe to automate rather than a policy guess. A row
|
|
125
|
-
* this gateway disables **by itself** carries the deadline; a row an **operator**
|
|
126
|
-
* disables keeps `cooldownUntil` null, and the recovery sweep selects only rows whose
|
|
127
|
-
* deadline has elapsed. So an operator's decision still outranks the machine, with no
|
|
128
|
-
* extra column and no way to confuse the two.
|
|
129
|
-
*
|
|
130
|
-
* Long on purpose: the states that reach here are the ones where retrying sooner
|
|
131
|
-
* only reproduces the refusal. Set to `0` to restore the old terminal behavior.
|
|
132
|
-
*/
|
|
133
|
-
export function resolveAccountDisabledRecoveryMs(): number {
|
|
134
|
-
return readInt(
|
|
135
|
-
"CARTETHYIA_ACCOUNT_DISABLED_RECOVERY_MS",
|
|
136
|
-
CONFIG_SPEC.CARTETHYIA_ACCOUNT_DISABLED_RECOVERY_MS,
|
|
137
|
-
);
|
|
138
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Account/pool health cooldown fallback resolvers.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CONFIG_SPEC, readInt } from "./spec";
|
|
6
|
+
|
|
7
|
+
/** Fallback cooldown for a provider rate limit (default 15m). */
|
|
8
|
+
export function resolveAccountRateLimitCooldownMs(): number {
|
|
9
|
+
return readInt(
|
|
10
|
+
"CARTETHYIA_ACCOUNT_RATE_LIMIT_COOLDOWN_MS",
|
|
11
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_RATE_LIMIT_COOLDOWN_MS,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fallback cooldown for provider quota exhaustion when the error states no
|
|
17
|
+
* reset window (default 1h). A provider-specific rule (xAI Grok Build's
|
|
18
|
+
* rolling 24-hour free-tier window) overrides it inside the classifier.
|
|
19
|
+
*/
|
|
20
|
+
export function resolveAccountQuotaCooldownMs(): number {
|
|
21
|
+
return readInt(
|
|
22
|
+
"CARTETHYIA_ACCOUNT_QUOTA_COOLDOWN_MS",
|
|
23
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_QUOTA_COOLDOWN_MS,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Fallback cooldown for model-capacity overload (default 2m). */
|
|
28
|
+
export function resolveAccountModelCapacityCooldownMs(): number {
|
|
29
|
+
return readInt(
|
|
30
|
+
"CARTETHYIA_ACCOUNT_MODEL_CAPACITY_COOLDOWN_MS",
|
|
31
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_MODEL_CAPACITY_COOLDOWN_MS,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Backoff for a transient 5xx/network fault, recorded as `cooldown` (default 30s). */
|
|
36
|
+
export function resolveAccountTransientCooldownMs(): number {
|
|
37
|
+
return readInt(
|
|
38
|
+
"CARTETHYIA_ACCOUNT_TRANSIENT_COOLDOWN_MS",
|
|
39
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_TRANSIENT_COOLDOWN_MS,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Backoff for a failure no rule matched, recorded as `cooldown` (default 1m). */
|
|
44
|
+
export function resolveAccountUnclassifiedCooldownMs(): number {
|
|
45
|
+
return readInt(
|
|
46
|
+
"CARTETHYIA_ACCOUNT_UNCLASSIFIED_COOLDOWN_MS",
|
|
47
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_UNCLASSIFIED_COOLDOWN_MS,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Ceiling an escalated fallback cooldown may reach (default 1h).
|
|
53
|
+
*
|
|
54
|
+
* A fallback duration is one the provider never stated, so escalating it is our
|
|
55
|
+
* own estimate. The cap keeps that estimate from outliving a short transient
|
|
56
|
+
* window: an account that recovers on its own must not sit parked for a day
|
|
57
|
+
* because a burst of 5xx happened to arrive while it was already cooling.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveAccountCooldownEscalationMaxMs(): number {
|
|
60
|
+
return readInt(
|
|
61
|
+
"CARTETHYIA_ACCOUNT_COOLDOWN_ESCALATION_MAX_MS",
|
|
62
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_COOLDOWN_ESCALATION_MAX_MS,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** How long a proxy pool stays `cooldown` after a transport fault (default 2m). */
|
|
67
|
+
export function resolvePoolCooldownMs(): number {
|
|
68
|
+
return readInt("CARTETHYIA_POOL_COOLDOWN_MS", CONFIG_SPEC.CARTETHYIA_POOL_COOLDOWN_MS);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Backoff for an auth rejection that names no revocation (default 5m).
|
|
73
|
+
*
|
|
74
|
+
* A bare `401`/`403` is weak evidence: it covers clock skew, a key rotated
|
|
75
|
+
* upstream a moment ago, an edge cache, and a load balancer that answers before
|
|
76
|
+
* the credential is loaded. None of those is the credential's death, and this
|
|
77
|
+
* outcome used to be `disabled` — the one state no sweep recovers, so the
|
|
78
|
+
* account left rotation until an operator noticed. A cooldown costs the same
|
|
79
|
+
* requests for five minutes and comes back on its own.
|
|
80
|
+
*
|
|
81
|
+
* Only a *named* revocation (`token revoked`, `invalidated oauth token`) still
|
|
82
|
+
* parks the account: the upstream stated the credential itself is dead, there is
|
|
83
|
+
* no expiry to wait out and no refresh to run, so a cooldown would only return
|
|
84
|
+
* it to rotation to fail again. Set this to `0` to restore the old behavior.
|
|
85
|
+
*/
|
|
86
|
+
export function resolveAccountAuthRejectedCooldownMs(): number {
|
|
87
|
+
return readInt(
|
|
88
|
+
"CARTETHYIA_ACCOUNT_AUTH_REJECTED_COOLDOWN_MS",
|
|
89
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_AUTH_REJECTED_COOLDOWN_MS,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Base backoff for the buddy policy/channel block (default 5m).
|
|
95
|
+
*
|
|
96
|
+
* Deliberately a *base*, not the 24h flat penalty it replaced. `11140` has two
|
|
97
|
+
* documented causes our classifier cannot separate from the response alone: the
|
|
98
|
+
* user's prompt failed a safety review, **and** sending the wrong desktop
|
|
99
|
+
* `User-Agent` brand (`workbuddy/shared.ts`). A flat 24h meant that after we
|
|
100
|
+
* fixed a header regression every buddy account stayed dead for up to a further
|
|
101
|
+
* day, and one unsafe prompt cost a whole account a day.
|
|
102
|
+
*
|
|
103
|
+
* As a base it escalates through the consecutive-failure ladder instead, which
|
|
104
|
+
* distinguishes the two causes by what they do next: a genuinely blocked account
|
|
105
|
+
* is refused again on its very next request and parks itself within minutes,
|
|
106
|
+
* while a single bad prompt costs five minutes.
|
|
107
|
+
*/
|
|
108
|
+
export function resolveAccountPolicyBlockCooldownMs(): number {
|
|
109
|
+
return readInt(
|
|
110
|
+
"CARTETHYIA_ACCOUNT_POLICY_BLOCK_COOLDOWN_MS",
|
|
111
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_POLICY_BLOCK_COOLDOWN_MS,
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* How long an **automatically** disabled account stays out of rotation (default 24h).
|
|
117
|
+
*
|
|
118
|
+
* `disabled` used to be terminal: nothing recovered it, so a credential rejected
|
|
119
|
+
* once — a revoked key, a definitively dead refresh grant — left rotation until an
|
|
120
|
+
* operator noticed and clicked Recover by hand. That is the wrong default for a
|
|
121
|
+
* credential that may come back on its own: keys get re-issued, grants get
|
|
122
|
+
* re-authorized, and an upstream's notion of "invalid" can outrun ours.
|
|
123
|
+
*
|
|
124
|
+
* The deadline is what makes this safe to automate rather than a policy guess. A row
|
|
125
|
+
* this gateway disables **by itself** carries the deadline; a row an **operator**
|
|
126
|
+
* disables keeps `cooldownUntil` null, and the recovery sweep selects only rows whose
|
|
127
|
+
* deadline has elapsed. So an operator's decision still outranks the machine, with no
|
|
128
|
+
* extra column and no way to confuse the two.
|
|
129
|
+
*
|
|
130
|
+
* Long on purpose: the states that reach here are the ones where retrying sooner
|
|
131
|
+
* only reproduces the refusal. Set to `0` to restore the old terminal behavior.
|
|
132
|
+
*/
|
|
133
|
+
export function resolveAccountDisabledRecoveryMs(): number {
|
|
134
|
+
return readInt(
|
|
135
|
+
"CARTETHYIA_ACCOUNT_DISABLED_RECOVERY_MS",
|
|
136
|
+
CONFIG_SPEC.CARTETHYIA_ACCOUNT_DISABLED_RECOVERY_MS,
|
|
137
|
+
);
|
|
138
|
+
}
|
package/src/config/providers.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* callback URL builders built on the public origin.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { CONFIG_SPEC, readList, readRequired, readText } from "./spec";
|
|
7
|
+
import { CONFIG_SPEC, readInt, readList, readRequired, readText } from "./spec";
|
|
8
8
|
|
|
9
9
|
/** Reads and normalizes the public OAuth origin. */
|
|
10
10
|
export function requirePublicOrigin(): string {
|
|
@@ -22,14 +22,14 @@ export function oauthCallbackUrl(providerId: string): string {
|
|
|
22
22
|
/**
|
|
23
23
|
* Browser-authorize redirect URI for a provider.
|
|
24
24
|
*
|
|
25
|
-
* Browser OAuth
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Browser OAuth advertises a loopback callback, `http://127.0.0.1:59653/callback`
|
|
26
|
+
* by default — the URI Codex registers with its authorization server, which is
|
|
27
|
+
* why the port is the default rather than a free one. The console callback stays the exchange
|
|
28
28
|
* endpoint: the dashboard dialog pastes the loopback landing URL back and
|
|
29
29
|
* the server exchanges the code against the same loopback URI.
|
|
30
30
|
*/
|
|
31
31
|
export function browserAuthorizeRedirectUri(): string {
|
|
32
|
-
return
|
|
32
|
+
return `http://127.0.0.1:${readInt("CARTETHYIA_OAUTH_CALLBACK_PORT", CONFIG_SPEC.CARTETHYIA_OAUTH_CALLBACK_PORT)}/callback`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
package/src/config/runtime.ts
CHANGED
|
@@ -51,10 +51,26 @@ export function resolveDrainToken(): string | undefined {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Whether Elysia precompiles route handlers at startup (AOT).
|
|
55
|
-
*
|
|
56
|
-
*
|
|
54
|
+
* Whether Elysia precompiles route handlers at startup (AOT).
|
|
55
|
+
*
|
|
56
|
+
* Precompilation takes the eager validator branch, which calls TypeBox's
|
|
57
|
+
* `SchemaCompile(schema)` and then reads `.buildResult.external` off the
|
|
58
|
+
* result. In a source-run process that field is absent — the lazy
|
|
59
|
+
* `require("typebox/schema")` resolves to a namespace that does not carry it —
|
|
60
|
+
* and the process dies at the first schema-bearing route with
|
|
61
|
+
* `undefined is not an object (evaluating 'this.tb.buildResult.external')`.
|
|
62
|
+
* `scripts/binary/aot.ts` avoids this by rewriting the call site and bundling
|
|
63
|
+
* the namespaces statically, so only the built artifact can actually take the
|
|
64
|
+
* eager path.
|
|
65
|
+
*
|
|
66
|
+
* So: precompilation is on for production *builds*, and off for a source run
|
|
67
|
+
* even when `NODE_ENV=production`. A deployment that runs
|
|
68
|
+
* `bun run src/main.ts` must not be pushed onto the eager branch.
|
|
69
|
+
*
|
|
70
|
+
* `CARTETHYIA_SOURCE_RUN` marks a source run explicitly. It is set by
|
|
71
|
+
* `scripts/deploy/*.sh`, which are the only supported way to run from source.
|
|
57
72
|
*/
|
|
58
73
|
export function resolveElysiaPrecompile(): boolean {
|
|
74
|
+
if (process.env.CARTETHYIA_SOURCE_RUN === "1") return false;
|
|
59
75
|
return process.env.NODE_ENV === "production";
|
|
60
76
|
}
|
package/src/config/spec.ts
CHANGED
|
@@ -213,6 +213,15 @@ export const CONFIG_SPEC = {
|
|
|
213
213
|
|
|
214
214
|
// Provider OAuth hosts
|
|
215
215
|
CARTETHYIA_KIMI_OAUTH_HOST: { kind: "text", default: DEFAULT_KIMI_OAUTH_HOST },
|
|
216
|
+
/**
|
|
217
|
+
* Loopback port the browser-OAuth callback listener binds.
|
|
218
|
+
*
|
|
219
|
+
* Configurable because the default is a fixed number and a busy port used to
|
|
220
|
+
* strand the operator: the login could not start and there was no way to move
|
|
221
|
+
* it. Codex's authorization server still expects 59653, so changing this
|
|
222
|
+
* only helps the providers whose redirect URI is not allowlisted upstream.
|
|
223
|
+
*/
|
|
224
|
+
CARTETHYIA_OAUTH_CALLBACK_PORT: { kind: "int", default: 59_653, min: 1_024, max: 65_535 },
|
|
216
225
|
/**
|
|
217
226
|
* Kimi Code quota/billing base. The `/usages` path joins on this, so the
|
|
218
227
|
* default includes the `/v1` segment the bundled provider metadata implies.
|