cartethyia 2.4.6 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -13
- package/dist/dashboard/assets/BannedPage-ChqnTRpZ.js +1 -0
- package/dist/dashboard/assets/BannedPage-ChqnTRpZ.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-Bcy150Jo.js → CliToolDetailPage-Bb9CNuoh.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-Bb9CNuoh.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-DyNXefph.js → CliToolsPage-BXUaRCQQ.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-BXUaRCQQ.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-CisNZOUt.js +1 -0
- package/dist/dashboard/assets/CombosPage-CisNZOUt.js.gz +0 -0
- package/dist/dashboard/assets/{ConsoleLogPage-CATpAEOz.js → ConsoleLogPage-BOpI_LOH.js} +1 -1
- package/dist/dashboard/assets/ConsoleLogPage-BOpI_LOH.js.gz +0 -0
- package/dist/dashboard/assets/{CustomizationPage-D6jEU7nL.js → CustomizationPage-DAkdvJ4k.js} +1 -1
- package/dist/dashboard/assets/CustomizationPage-DAkdvJ4k.js.gz +0 -0
- package/dist/dashboard/assets/{HealthEventsModal-CZkpn0a7.js → HealthEventsModal-DeT-VXHd.js} +1 -1
- package/dist/dashboard/assets/HealthEventsModal-DeT-VXHd.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-BJlMVN4U.js → LoginPage-CytxSeGP.js} +1 -1
- package/dist/dashboard/assets/LoginPage-CytxSeGP.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-CU7S1wJs.js +1 -0
- package/dist/dashboard/assets/OverviewPage-CU7S1wJs.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-DLm2baot.js +3 -0
- package/dist/dashboard/assets/ProviderDetailPage-DLm2baot.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-DOXfuzfL.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-DOXfuzfL.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-wvk0ciQN.js +7 -0
- package/dist/dashboard/assets/ProxyPage-wvk0ciQN.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-Cn_fcUHE.js +1 -0
- package/dist/dashboard/assets/QuotaPage-Cn_fcUHE.js.gz +0 -0
- package/dist/dashboard/assets/{SettingsPage-BHW4Zt06.js → SettingsPage-8-eVadhc.js} +1 -1
- package/dist/dashboard/assets/SettingsPage-8-eVadhc.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-VOYC_lIa.js → SetupPage-uEIXPyGO.js} +1 -1
- package/dist/dashboard/assets/SetupPage-uEIXPyGO.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-DCY0TPTZ.js +1 -0
- package/dist/dashboard/assets/SortableList-DCY0TPTZ.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-BNIDLiU6.js → StudioPage-DqK5E26W.js} +4 -4
- package/dist/dashboard/assets/StudioPage-DqK5E26W.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-38JfiZ0H.js +56 -0
- package/dist/dashboard/assets/UsagePage-38JfiZ0H.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--yj84zk3.js +4 -0
- package/dist/dashboard/assets/entry--yj84zk3.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/{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-CcD1eSJ6.js} +2 -2
- package/dist/dashboard/assets/index-CcD1eSJ6.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-XPJ-dIw3.js +41 -0
- package/dist/dashboard/assets/select-XPJ-dIw3.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/tray.ts +47 -8
- 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
|
@@ -89,10 +89,23 @@ export function buddyConversationHeaders(
|
|
|
89
89
|
"x-b3-spanid": messageId.slice(0, 16),
|
|
90
90
|
"x-b3-sampled": "1",
|
|
91
91
|
};
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
// Always sent, invented when the caller gave none.
|
|
93
|
+
//
|
|
94
|
+
// This used to be omitted unless the client supplied one. That was wrong:
|
|
95
|
+
// `x-conversation-id` is mandatory, and a chat request without it is refused
|
|
96
|
+
// with `400 · 11-128 "request illegal"` — an error that names neither the
|
|
97
|
+
// header nor the channel, and which reads like a block rather than a missing
|
|
98
|
+
// field. Isolated against the live API by removing one header at a time:
|
|
99
|
+
// only `x-conversation-id`, `x-conversation-request-id` and
|
|
100
|
+
// `x-conversation-message-id` are required; the B3/W3C trace set, the
|
|
101
|
+
// stainless set, the agent block and the IDE block are all optional.
|
|
102
|
+
//
|
|
103
|
+
// Inventing one when the caller has none is still the right default: the id
|
|
104
|
+
// is per-dispatch here, so a caller with no session is not claiming a session
|
|
105
|
+
// it never had — and withholding the header only guarantees a refusal.
|
|
106
|
+
headers["x-conversation-id"] =
|
|
107
|
+
ids.conversationId !== undefined && ids.conversationId.trim().length > 0
|
|
108
|
+
? ids.conversationId.trim()
|
|
109
|
+
: newMessageId();
|
|
97
110
|
return headers;
|
|
98
111
|
}
|
|
@@ -106,6 +106,10 @@ export const CODEBUDDY_CN_RAW: readonly BuddyRawEntry[] = [
|
|
|
106
106
|
["glm-5.3-flash", "GLM 5.3 Flash", true, true, 1_000_000, 131_072],
|
|
107
107
|
["glm-5v-turbo", "GLM 5v Turbo", true, true, 200_000, 131_072],
|
|
108
108
|
["minimax-m3", "MiniMax M3", true, true, 512_000, 512_000],
|
|
109
|
+
// 1M context, reasoning always on (upstream states both); vision inherited
|
|
110
|
+
// from the M3 row, which is the same family.
|
|
111
|
+
["minimax-m3.1-flash", "MiniMax M3.1 Flash", true, true, 1_000_000, 512_000],
|
|
112
|
+
["mimo-v2.6-pro", "MiMo V2.6 Pro", true, true, 1_000_000, 512_000],
|
|
109
113
|
["kimi-k2.8-preview", "Kimi K2.8 Preview", true, true, 1_048_576, 65_536],
|
|
110
114
|
["kimi-k2.7", "Kimi K2.7", true, true, 256_000, 65_536],
|
|
111
115
|
["kimi-k2.6", "Kimi K2.6", true, true, 256_000, 262_144],
|
|
@@ -1,175 +1,180 @@
|
|
|
1
|
-
// CodeBuddy International adapter — exact provider contract.
|
|
2
|
-
// Canonical provider ID: cb
|
|
3
|
-
// Base (manifest-owned CODEBUDDY_BASE_URL) → Chat: base + /chat/completions
|
|
4
|
-
// Auth: Authorization Bearer for both api_key and oauth
|
|
5
|
-
// Stream: force stream=true upstream, factory reaggregates for non-stream callers
|
|
6
|
-
// Headers: per-provider CodeBuddy headers with fresh correlation IDs per dispatch
|
|
7
|
-
// Payload: leading CodeBuddy system prompt + typed user content, reasoning_summary auto only when reasoning_effort
|
|
8
|
-
|
|
9
|
-
import { BuddyMediaAdapter } from "../buddy-media";
|
|
10
|
-
import type { ProviderDispatchContext, ProviderDispatchTarget, ProviderAdapter } from "../../../provider-contracts";
|
|
11
|
-
import type { ModelDefinition } from "../../../provider-model-definition";
|
|
12
|
-
import type { DiscoveryInput } from "../../../discovery/discovery-types";
|
|
13
|
-
import { GatewayError } from "../../../../protocol/gateway-error";
|
|
14
|
-
import type { CanonicalRequest } from "../../../../protocol/canonical-model";
|
|
15
|
-
import { providerBaseUrl } from "../../../provider-metadata";
|
|
16
|
-
import {
|
|
17
|
-
codebuddyAdapterConfig,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
// -
|
|
44
|
-
// -
|
|
45
|
-
// -
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
...
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
...(input.
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
1
|
+
// CodeBuddy International adapter — exact provider contract.
|
|
2
|
+
// Canonical provider ID: cb
|
|
3
|
+
// Base (manifest-owned CODEBUDDY_BASE_URL) → Chat: base + /chat/completions
|
|
4
|
+
// Auth: Authorization Bearer for both api_key and oauth
|
|
5
|
+
// Stream: force stream=true upstream, factory reaggregates for non-stream callers
|
|
6
|
+
// Headers: per-provider CodeBuddy headers with fresh correlation IDs per dispatch
|
|
7
|
+
// Payload: leading CodeBuddy system prompt + typed user content, reasoning_summary auto only when reasoning_effort
|
|
8
|
+
|
|
9
|
+
import { BuddyMediaAdapter } from "../buddy-media";
|
|
10
|
+
import type { ProviderDispatchContext, ProviderDispatchTarget, ProviderAdapter } from "../../../provider-contracts";
|
|
11
|
+
import type { ModelDefinition } from "../../../provider-model-definition";
|
|
12
|
+
import type { DiscoveryInput } from "../../../discovery/discovery-types";
|
|
13
|
+
import { GatewayError } from "../../../../protocol/gateway-error";
|
|
14
|
+
import type { CanonicalRequest } from "../../../../protocol/canonical-model";
|
|
15
|
+
import { providerBaseUrl } from "../../../provider-metadata";
|
|
16
|
+
import {
|
|
17
|
+
codebuddyAdapterConfig,
|
|
18
|
+
codebuddyHeaders,
|
|
19
|
+
} from "./shared";
|
|
20
|
+
import {
|
|
21
|
+
BUDDY_SHARED_RAW,
|
|
22
|
+
BUDDY_IMAGE_MODEL_ID_SET,
|
|
23
|
+
BUDDY_VIDEO_MODEL_ID_SET,
|
|
24
|
+
makeBuddyModel,
|
|
25
|
+
makeBuddyImageModels,
|
|
26
|
+
makeBuddyVideoModels,
|
|
27
|
+
type BuddyRawEntry,
|
|
28
|
+
} from "../buddy-catalog-shared";
|
|
29
|
+
import { BUDDY_INTL_MODELS_PATH, fetchBuddyDirectoryModels } from "../buddy-discovery-shared";
|
|
30
|
+
import {
|
|
31
|
+
applyBuddySystemPrompt,
|
|
32
|
+
buddyPrePayloadCommon,
|
|
33
|
+
normalizeBuddyToolNames,
|
|
34
|
+
} from "../buddy-chat-shared";
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// Constants — public contract
|
|
38
|
+
export const CODEBUDDY_PROVIDER_ID = "cb" as const;
|
|
39
|
+
export const CODEBUDDY_BASE_URL = providerBaseUrl("cb");
|
|
40
|
+
// Upstream model translation — preserve provider mapping
|
|
41
|
+
|
|
42
|
+
// Payload hook — provider intl semantics
|
|
43
|
+
// - force stream=true
|
|
44
|
+
// - reasoning_summary auto only when reasoning_effort requested
|
|
45
|
+
// - upstreamId translation
|
|
46
|
+
// - leading CodeBuddy system prompt + typed user content normalization
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Leading system turn for this variant.
|
|
50
|
+
*
|
|
51
|
+
* The upstream validates that the wire *opens* with a `system` turn (code
|
|
52
|
+
* `11128`) but does not check its text — the CN variant installs a plain
|
|
53
|
+
* engineering-assistant sentence in the same slot and the gateway accepts it.
|
|
54
|
+
* So this text is a product choice rather than a wire contract, and the
|
|
55
|
+
* previous vendor-branded line ("You are CodeBuddy Code.") made every request
|
|
56
|
+
* claim an identity the caller never chose, while also discarding whatever
|
|
57
|
+
* system prompt the caller actually sent.
|
|
58
|
+
*
|
|
59
|
+
* The prompt is therefore a neutral assistant identity with an explicit
|
|
60
|
+
* persona: pragmatic, direct, and honest — no sycophancy, no hedging, no
|
|
61
|
+
* invented certainty.
|
|
62
|
+
*/
|
|
63
|
+
export const CODEBUDDY_SYSTEM_PROMPT =
|
|
64
|
+
"You are a pragmatic and direct software engineering assistant. " +
|
|
65
|
+
"Be honest and truthful: state what you know, say plainly when you are unsure " +
|
|
66
|
+
"or do not know, and never claim to have done something you have not done. " +
|
|
67
|
+
"Prefer concrete answers over filler, and say so when a request is ambiguous " +
|
|
68
|
+
"instead of guessing silently.";
|
|
69
|
+
|
|
70
|
+
function codeBuddyIntlPrePayload(
|
|
71
|
+
payload: Record<string, unknown>,
|
|
72
|
+
request: CanonicalRequest,
|
|
73
|
+
candidate: ProviderDispatchTarget,
|
|
74
|
+
context?: ProviderDispatchContext,
|
|
75
|
+
): void {
|
|
76
|
+
// International ladder: DeepSeek Flash and friends serve only `high`.
|
|
77
|
+
buddyPrePayloadCommon(payload, request, "intl", context);
|
|
78
|
+
const rawModel = payload["model"];
|
|
79
|
+
const source =
|
|
80
|
+
typeof rawModel === "string" && rawModel.length > 0
|
|
81
|
+
? rawModel
|
|
82
|
+
: candidate.model_id;
|
|
83
|
+
if (!source) throw new GatewayError("invalid_request", 400, "CodeBuddy model is required");
|
|
84
|
+
const messages = payload["messages"];
|
|
85
|
+
if (Array.isArray(messages)) {
|
|
86
|
+
applyBuddySystemPrompt(messages as Array<Record<string, unknown>>, CODEBUDDY_SYSTEM_PROMPT);
|
|
87
|
+
}
|
|
88
|
+
normalizeBuddyToolNames(payload);
|
|
89
|
+
void request;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Model catalog — shared CodeBuddy / WorkBuddy international roster
|
|
93
|
+
|
|
94
|
+
const CODEBUDDY_INTL_RAW: readonly BuddyRawEntry[] = BUDDY_SHARED_RAW;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* CodeBuddy's image generation rows.
|
|
98
|
+
*
|
|
99
|
+
* These ids also sit on the shared chat roster as ordinary `llm` rows, which is
|
|
100
|
+
* why they were unreachable as image models: nothing downstream could tell a
|
|
101
|
+
* chat model from one that returns an image, so `mediaGeneration` was false for
|
|
102
|
+
* every catalog row. The roster and the declared capabilities come from
|
|
103
|
+
* {@link makeBuddyImageModels} so cb and WorkBuddy cannot drift.
|
|
104
|
+
*/
|
|
105
|
+
export const CODEBUDDY_IMAGE_MODELS: readonly ModelDefinition[] = makeBuddyImageModels(
|
|
106
|
+
"cb",
|
|
107
|
+
"/images/generations",
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* CodeBuddy's video-generation rows (`seedance-2.5`).
|
|
112
|
+
*
|
|
113
|
+
* Reached through `/videos/generations` on the `/v2` base, so the endpoint is
|
|
114
|
+
* the upstream video path rather than a chat-completions path.
|
|
115
|
+
*/
|
|
116
|
+
export const CODEBUDDY_VIDEO_MODELS: readonly ModelDefinition[] = makeBuddyVideoModels(
|
|
117
|
+
"cb",
|
|
118
|
+
"/videos/generations",
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The full cb catalog the registry loads: chat roster plus image and video rows.
|
|
123
|
+
*
|
|
124
|
+
* The image and video ids are filtered out of the chat pass so one id never
|
|
125
|
+
* appears under two service kinds. Exported as a single list so
|
|
126
|
+
* `default-registry.ts` keeps one import for this provider.
|
|
127
|
+
*/
|
|
128
|
+
export const CODEBUDDY_MODELS: readonly ModelDefinition[] = [
|
|
129
|
+
...CODEBUDDY_INTL_RAW.filter(
|
|
130
|
+
(entry) => !BUDDY_IMAGE_MODEL_ID_SET.has(entry[0]) && !BUDDY_VIDEO_MODEL_ID_SET.has(entry[0]),
|
|
131
|
+
).map((entry) => makeBuddyModel(entry, "cb")),
|
|
132
|
+
...CODEBUDDY_IMAGE_MODELS,
|
|
133
|
+
...CODEBUDDY_VIDEO_MODELS,
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Reads the CodeBuddy intl console directory.
|
|
138
|
+
*
|
|
139
|
+
* The static `CODEBUDDY_MODELS` above stays the fallback — this console is
|
|
140
|
+
* documented to answer 500 intermittently — while discovery carries the
|
|
141
|
+
* upstream's own limits and capability flags.
|
|
142
|
+
*/
|
|
143
|
+
export async function discoverCodeBuddyModels(
|
|
144
|
+
input: DiscoveryInput,
|
|
145
|
+
): Promise<readonly ModelDefinition[] | null> {
|
|
146
|
+
return fetchBuddyDirectoryModels({
|
|
147
|
+
siteUrl: CODEBUDDY_BASE_URL,
|
|
148
|
+
providerId: CODEBUDDY_PROVIDER_ID,
|
|
149
|
+
credential: input.credential,
|
|
150
|
+
modelsPath: BUDDY_INTL_MODELS_PATH,
|
|
151
|
+
endpoint: undefined,
|
|
152
|
+
...(input.signal ? { signal: input.signal } : {}),
|
|
153
|
+
...(input.fetcher ? { fetcher: input.fetcher } : {}),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Public factory — uses OpenAI-compatible factory but forces provider semantics
|
|
158
|
+
// Supports both api_key and oauth via Authorization Bearer (factory handles both)
|
|
159
|
+
|
|
160
|
+
export function createCodeBuddyAdapter(fetchImpl?: typeof fetch): ProviderAdapter {
|
|
161
|
+
return new BuddyMediaAdapter(
|
|
162
|
+
codebuddyAdapterConfig({
|
|
163
|
+
providerId: CODEBUDDY_PROVIDER_ID,
|
|
164
|
+
baseUrl: CODEBUDDY_BASE_URL,
|
|
165
|
+
variant: "IDE",
|
|
166
|
+
cliIdentity: true,
|
|
167
|
+
prePayload: codeBuddyIntlPrePayload,
|
|
168
|
+
...(fetchImpl ? { fetchImpl } : {}),
|
|
169
|
+
}),
|
|
170
|
+
{
|
|
171
|
+
variant: "IDE",
|
|
172
|
+
// BuddyMediaConfig has no `cliIdentity`; the CLI identity is selected by
|
|
173
|
+
// supplying the builder that takes it.
|
|
174
|
+
buildHeaders: (context, request) => codebuddyHeaders("IDE", context, request, true),
|
|
175
|
+
systemPrompt: CODEBUDDY_SYSTEM_PROMPT,
|
|
176
|
+
baseUrl: CODEBUDDY_BASE_URL,
|
|
177
|
+
imageGenerationPath: "/images/generations",
|
|
178
|
+
},
|
|
179
|
+
);
|
|
180
|
+
}
|
|
@@ -41,10 +41,11 @@ export async function codebuddyHeaders(
|
|
|
41
41
|
});
|
|
42
42
|
if (resolveBuddyIdentity(context, cliIdentity) === "cli") {
|
|
43
43
|
return {
|
|
44
|
-
// The
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
44
|
+
// The CLI sends `Accept: application/json` and no device token. The
|
|
45
|
+
// browser-shaped pair (`X-Requested-With`, `x-codebuddy-request`) stays
|
|
46
|
+
// off this branch: a request carrying both halves is a hybrid no real
|
|
47
|
+
// client produces, and that is a fidelity choice, not a requirement —
|
|
48
|
+
// the live API answers either way.
|
|
48
49
|
accept: "application/json",
|
|
49
50
|
"User-Agent": `CLI/${getCodeBuddyVersion()} CodeBuddy/${getCodeBuddyVersion()}`,
|
|
50
51
|
"X-Product": "SaaS",
|
|
@@ -52,6 +53,11 @@ export async function codebuddyHeaders(
|
|
|
52
53
|
"X-IDE-Name": "CLI",
|
|
53
54
|
"X-IDE-Version": getCodeBuddyVersion(),
|
|
54
55
|
"X-Domain": codebuddyDomain(variant),
|
|
56
|
+
// The conversation purpose the reference client states. Not required —
|
|
57
|
+
// verified against the live API that a request succeeds without it — but
|
|
58
|
+
// it is part of the client's real request, and matching the client is the
|
|
59
|
+
// defence against a channel check tightening later.
|
|
60
|
+
"X-Agent-Purpose": "conversation",
|
|
55
61
|
...conversation,
|
|
56
62
|
...buddyCliTraceHeaders(conversation),
|
|
57
63
|
...buddyCliHeaders({ userId: buddyUserId(context) }),
|
|
@@ -70,9 +76,12 @@ export async function codebuddyHeaders(
|
|
|
70
76
|
"X-Domain": codebuddyDomain(variant),
|
|
71
77
|
"x-requested-with": "XMLHttpRequest",
|
|
72
78
|
"x-codebuddy-request": "1",
|
|
79
|
+
// Same value the CLI branch sends, for the same reason: part of the
|
|
80
|
+
// client's real request, harmless when the channel check does not read it.
|
|
81
|
+
"X-Agent-Purpose": "conversation",
|
|
73
82
|
// Same family WorkBuddy sends: the upstream's channel check reads the
|
|
74
|
-
// turn-level aggregation key, and a chat request without it is refused
|
|
75
|
-
//
|
|
83
|
+
// turn-level aggregation key, and a chat request without it is refused for a
|
|
84
|
+
// missing conversation id.
|
|
76
85
|
...conversation,
|
|
77
86
|
...(deviceToken === undefined ? {} : { "X-Device-Token": deviceToken }),
|
|
78
87
|
};
|