cartethyia 2.7.8 → 2.7.9
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 +0 -1
- package/README.md +29 -59
- package/dist/dashboard/assets/BannedPage-BxoG1MrL.js +1 -0
- package/dist/dashboard/assets/BannedPage-BxoG1MrL.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-BRWKPQPf.js → CliToolDetailPage-ixwgKk53.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-ixwgKk53.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-BP-Y5iHN.js → CliToolsPage-BmttNV3U.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-BmttNV3U.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-BE3qwwfC.js +1 -0
- package/dist/dashboard/assets/CombosPage-BE3qwwfC.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-CRZdmMIX.js +1 -0
- package/dist/dashboard/assets/ConsoleLogPage-CRZdmMIX.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-Dv_FJ6Er.js +1 -0
- package/dist/dashboard/assets/CustomizationPage-Dv_FJ6Er.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-CoVrw2sM.js +1 -0
- package/dist/dashboard/assets/HealthEventsModal-CoVrw2sM.js.gz +0 -0
- package/dist/dashboard/assets/{InjectSystemPromptPanel-Cv-2Ol_K.js → InjectSystemPromptPanel-BOoO8rpz.js} +2 -2
- package/dist/dashboard/assets/InjectSystemPromptPanel-BOoO8rpz.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-bKfz_b1K.js → LoginPage-ChJuNNVN.js} +1 -1
- package/dist/dashboard/assets/LoginPage-ChJuNNVN.js.gz +0 -0
- package/dist/dashboard/assets/{ModelPicker-B-WQxx_H.js → ModelPicker-BZAJtPg1.js} +1 -1
- package/dist/dashboard/assets/ModelPicker-BZAJtPg1.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-BE40s3u5.js +1 -0
- package/dist/dashboard/assets/OverviewPage-BE40s3u5.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-sfLoQtPV.js +8 -0
- package/dist/dashboard/assets/ProviderDetailPage-sfLoQtPV.js.gz +0 -0
- package/dist/dashboard/assets/ProviderIcon-CQ6bPUf_.js +1 -0
- package/dist/dashboard/assets/ProviderIcon-CQ6bPUf_.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-DcepmPWo.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-DcepmPWo.js.gz +0 -0
- package/dist/dashboard/assets/{ProxyPage-emlTuxz6.js → ProxyPage-BJ87Pp0U.js} +1 -1
- package/dist/dashboard/assets/ProxyPage-BJ87Pp0U.js.gz +0 -0
- package/dist/dashboard/assets/{QuotaPage-CMJKNYWb.js → QuotaPage-gkSyRAKa.js} +1 -1
- package/dist/dashboard/assets/QuotaPage-gkSyRAKa.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-C5HPWqEv.js +1 -0
- package/dist/dashboard/assets/SettingsPage-C5HPWqEv.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-CUZrKs9r.js → SetupPage-CFNcATJJ.js} +1 -1
- package/dist/dashboard/assets/SetupPage-CFNcATJJ.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-jWmUdDpy.js → StudioPage-YoD4tY5l.js} +1 -1
- package/dist/dashboard/assets/StudioPage-YoD4tY5l.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-DxjaAhb_.js +56 -0
- package/dist/dashboard/assets/UsagePage-DxjaAhb_.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-BTlkq_Uk.js +1 -0
- package/dist/dashboard/assets/api-keys-BTlkq_Uk.js.gz +0 -0
- package/dist/dashboard/assets/app-BX2nnKqs.css +2 -0
- package/dist/dashboard/assets/app-BX2nnKqs.css.gz +0 -0
- package/dist/dashboard/assets/assert-CndthXFQ.js +1 -0
- package/dist/dashboard/assets/assert-CndthXFQ.js.gz +0 -0
- package/dist/dashboard/assets/{badge-DyI_mJfi.js → badge-DdbT_7Am.js} +1 -1
- package/dist/dashboard/assets/badge-DdbT_7Am.js.gz +0 -0
- package/dist/dashboard/assets/ban-durations-B58FyRxC.js +1 -0
- package/dist/dashboard/assets/ban-durations-B58FyRxC.js.gz +0 -0
- package/dist/dashboard/assets/{banner-B-yXtCqb.js → banner-CsGN-nbm.js} +1 -1
- package/dist/dashboard/assets/banner-CsGN-nbm.js.gz +0 -0
- package/dist/dashboard/assets/brand/bansos_page.webp +0 -0
- package/dist/dashboard/assets/brand/denia_bansos.webp +0 -0
- package/dist/dashboard/assets/brand/favicon.webp +0 -0
- package/dist/dashboard/assets/brand/login_register.webp +0 -0
- package/dist/dashboard/assets/brand/login_register_initial.webp +0 -0
- package/dist/dashboard/assets/brand/og_bansos.webp +0 -0
- package/dist/dashboard/assets/brand/og_image.webp +0 -0
- package/dist/dashboard/assets/brand/sidebar_ico.webp +0 -0
- package/dist/dashboard/assets/{card-_HwAEqFF.js → card-mgZ_TLLZ.js} +1 -1
- package/dist/dashboard/assets/card-mgZ_TLLZ.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-A1-v8-03.js +1 -0
- package/dist/dashboard/assets/cli-tools-A1-v8-03.js.gz +0 -0
- package/dist/dashboard/assets/{clipboard-button-ByjCk0o9.js → clipboard-button-CJ4Zty89.js} +1 -1
- package/dist/dashboard/assets/clipboard-button-CJ4Zty89.js.gz +0 -0
- package/dist/dashboard/assets/{dialog-BZhOlfz-.js → dialog-B5L2jPQ_.js} +1 -1
- package/dist/dashboard/assets/dialog-B5L2jPQ_.js.gz +0 -0
- package/dist/dashboard/assets/{drawer-BADqIRYP.js → drawer-DkjUouAj.js} +1 -1
- package/dist/dashboard/assets/drawer-DkjUouAj.js.gz +0 -0
- package/dist/dashboard/assets/{entry-COaC-irN.js → entry-B-LVLV6o.js} +1 -1
- package/dist/dashboard/assets/entry-B-LVLV6o.js.gz +0 -0
- package/dist/dashboard/assets/entry-CAhdYl3B.js +1 -0
- package/dist/dashboard/assets/entry-CAhdYl3B.js.gz +0 -0
- package/dist/dashboard/assets/entry-D2xD0Tmd.js +4 -0
- package/dist/dashboard/assets/entry-D2xD0Tmd.js.gz +0 -0
- package/dist/dashboard/assets/{formatters-DcHJyRiu.js → formatters-CrsdLVsn.js} +1 -1
- package/dist/dashboard/assets/formatters-CrsdLVsn.js.gz +0 -0
- package/dist/dashboard/assets/{index-CgKmFngv.js → index-BU64Lqvp.js} +2 -2
- package/dist/dashboard/assets/index-BU64Lqvp.js.gz +0 -0
- package/dist/dashboard/assets/{inline-B2BirKry.js → inline-B2aDLyyg.js} +1 -1
- package/dist/dashboard/assets/inline-B2aDLyyg.js.gz +0 -0
- package/dist/dashboard/assets/{input-D-qV9dKY.js → input-BCVkdR9d.js} +1 -1
- package/dist/dashboard/assets/input-BCVkdR9d.js.gz +0 -0
- package/dist/dashboard/assets/{layout-B7tVWhtV.js → layout-DNcAdMK-.js} +1 -1
- package/dist/dashboard/assets/layout-DNcAdMK-.js.gz +0 -0
- package/dist/dashboard/assets/{list-row-CtkGE3bF.js → list-row-DgrIH0hw.js} +1 -1
- package/dist/dashboard/assets/list-row-DgrIH0hw.js.gz +0 -0
- package/dist/dashboard/assets/{live-DGizF06-.js → live-Cae01iu8.js} +1 -1
- package/dist/dashboard/assets/live-Cae01iu8.js.gz +0 -0
- package/dist/dashboard/assets/{mutation-GU7XdEjz.js → mutation-BQ0ccH_A.js} +1 -1
- package/dist/dashboard/assets/mutation-BQ0ccH_A.js.gz +0 -0
- package/dist/dashboard/assets/{network-C9UE-bOr.js → network-CRib7H_2.js} +1 -1
- package/dist/dashboard/assets/network-CRib7H_2.js.gz +0 -0
- package/dist/dashboard/assets/{numbers-BnAd22a_.js → numbers-BKQE8Xpz.js} +1 -1
- package/dist/dashboard/assets/numbers-BKQE8Xpz.js.gz +0 -0
- package/dist/dashboard/assets/{pagination-BAywyMzS.js → pagination-ecPvG_8g.js} +1 -1
- package/dist/dashboard/assets/pagination-ecPvG_8g.js.gz +0 -0
- package/dist/dashboard/assets/providers/devin.svg +9 -0
- package/dist/dashboard/assets/providers/devin.svg.gz +0 -0
- package/dist/dashboard/assets/providers/windsurf.svg +10 -0
- package/dist/dashboard/assets/providers/windsurf.svg.gz +0 -0
- package/dist/dashboard/assets/{query-keys-YSoQOUh6.js → query-keys-IKLh0YFd.js} +1 -1
- package/dist/dashboard/assets/query-keys-IKLh0YFd.js.gz +0 -0
- package/dist/dashboard/assets/routing-Ckm1UXuC.js +1 -0
- package/dist/dashboard/assets/routing-Ckm1UXuC.js.gz +0 -0
- package/dist/dashboard/assets/{select-BCOcv8WK.js → select-ChoFWyKz.js} +1 -1
- package/dist/dashboard/assets/select-ChoFWyKz.js.gz +0 -0
- package/dist/dashboard/assets/settings-CKjFPlKW.js +1 -0
- package/dist/dashboard/assets/settings-CKjFPlKW.js.gz +0 -0
- package/dist/dashboard/assets/{stack-ByKt3Q1g.js → stack-DWCwU3fh.js} +1 -1
- package/dist/dashboard/assets/stack-DWCwU3fh.js.gz +0 -0
- package/dist/dashboard/assets/{state-DXbGTx7N.js → state-Cg3VL5J_.js} +1 -1
- package/dist/dashboard/assets/state-Cg3VL5J_.js.gz +0 -0
- package/dist/dashboard/assets/story/25817331.webp +0 -0
- package/dist/dashboard/assets/story/Shorekeeper.webp +0 -0
- package/dist/dashboard/assets/story/cartethyia-god.webp +0 -0
- package/dist/dashboard/assets/story/fleurdelys_plus.webp +0 -0
- package/dist/dashboard/assets/story/jinhsi-blossom.webp +0 -0
- package/dist/dashboard/assets/story/phrolova-a.webp +0 -0
- package/dist/dashboard/assets/story/requestdeniawokkjpg.webp +0 -0
- package/dist/dashboard/assets/story/wuthering-waves-hiyuki-aemeath-hiyuki-rover.webp +0 -0
- package/dist/dashboard/assets/{switch-ZeTsW623.js → switch-Db70BMix.js} +1 -1
- package/dist/dashboard/assets/switch-Db70BMix.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-CbCP4w1o.js → useMutation-BqdE0LuM.js} +1 -1
- package/dist/dashboard/assets/useMutation-BqdE0LuM.js.gz +0 -0
- package/dist/dashboard/console-backgrounds.webp +0 -0
- package/dist/dashboard/console-backgrounds_initial.webp +0 -0
- package/dist/dashboard/donation/qris-risun-marke.webp +0 -0
- package/dist/dashboard/index.html +3 -3
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +57 -55
- package/migrations/full-postgres/0044_add_models_warning_metadata.sql +10 -0
- package/migrations/full-postgres/0045_migrate_workbuddy_to_codebuddy.sql +156 -0
- package/migrations/lite-sqlite3/0044_add_models_warning_metadata.sql +11 -0
- package/migrations/lite-sqlite3/0045_migrate_workbuddy_to_codebuddy.sql +156 -0
- package/package.json +1 -1
- package/src/boot/dependencies.ts +11 -3
- package/src/config/cooldowns.ts +1 -1
- package/src/config/spec.ts +0 -6
- package/src/console/api-keys/routes.ts +11 -4
- package/src/console/console-router.ts +7 -0
- package/src/console/dashboard-assets.ts +5 -5
- package/src/console/domain-registration.ts +27 -0
- package/src/console/ip-bans/routes.ts +99 -0
- package/src/console/providers/catalog/catalog-projections.ts +5 -2
- package/src/console/providers/catalog/contracts.ts +123 -0
- package/src/console/providers/catalog/model-operations.ts +122 -10
- package/src/console/providers/catalog/provider-operations.ts +116 -8
- package/src/console/providers/catalog/public-model-store.ts +0 -0
- package/src/console/providers/catalog/routes.ts +64 -4
- package/src/console/providers/catalog/store-helpers.ts +30 -1
- package/src/console/providers/catalog/store.ts +243 -3
- package/src/console/quota/account-quota-global.ts +89 -1
- package/src/console/quota/native-identity.ts +2 -0
- package/src/console/settings/contracts.ts +18 -0
- package/src/console/settings/store.ts +32 -0
- package/src/console/system-prompt/contracts.ts +0 -1
- package/src/main.ts +1 -0
- package/src/observability/event-query.ts +18 -4
- package/src/persistence/dialect.ts +12 -0
- package/src/persistence/schema.ts +20 -2
- package/src/protocol/dsml.ts +1 -1
- package/src/protocol/gateway-error.ts +1 -0
- package/src/protocol/reasoning.ts +1 -1
- package/src/protocol/request/chat.ts +4 -4
- package/src/protocol/request/messages.ts +1 -1
- package/src/protocol/response/gemini.ts +6 -1
- package/src/protocol/sse-decoder.ts +25 -8
- package/src/protocol/stream-error-frames.ts +13 -3
- package/src/protocol/translation/quirks.ts +1 -1
- package/src/protocol/translation/tool-repair.ts +2 -2
- package/src/protocol/upstream/send-claude-messages.ts +15 -4
- package/src/protocol/upstream-parsing.ts +1 -1
- package/src/providers/adapters/compatible-adapter.ts +7 -5
- package/src/providers/authentication/oauth-refresh-service.ts +149 -36
- package/src/providers/default-registry.ts +68 -3
- package/src/providers/discovery/discovery-types.ts +12 -0
- package/src/providers/discovery/probe-phases.ts +61 -30
- package/src/providers/discovery/probing-service.ts +279 -164
- package/src/providers/integrations/antigravity/antigravity-protocol.ts +117 -2
- package/src/providers/integrations/antigravity/antigravity.ts +13 -2
- package/src/providers/integrations/buddy/buddy-catalog-shared.ts +72 -34
- package/src/providers/integrations/buddy/buddy-chat-shared.ts +18 -18
- package/src/providers/integrations/buddy/buddy-checkin.ts +17 -39
- package/src/providers/integrations/buddy/buddy-conversation-headers.ts +2 -2
- package/src/providers/integrations/buddy/buddy-discovery-shared.ts +5 -5
- package/src/providers/integrations/buddy/buddy-identity.ts +70 -0
- package/src/providers/integrations/buddy/buddy-media.ts +4 -5
- package/src/providers/integrations/buddy/buddy-oauth-shared.ts +2 -2
- package/src/providers/integrations/buddy/buddy-quota-shared.ts +1 -1
- package/src/providers/integrations/buddy/buddy-usage-shared.ts +1 -3
- package/src/providers/integrations/buddy/capabilities.ts +4 -41
- package/src/providers/integrations/buddy/codebuddy/cn-catalog.ts +2 -1
- package/src/providers/integrations/buddy/codebuddy/cn-provider.ts +20 -1
- package/src/providers/integrations/buddy/codebuddy/provider.ts +2 -2
- package/src/providers/integrations/buddy/codebuddy/shared.ts +6 -10
- package/src/providers/integrations/cursor/cursor-catalog.ts +2 -0
- package/src/providers/integrations/cursor/cursor-exec.ts +738 -0
- package/src/providers/integrations/cursor/cursor-http2.ts +2 -0
- package/src/providers/integrations/cursor/cursor-request.ts +9 -8
- package/src/providers/integrations/cursor/cursor-shared.ts +19 -1
- package/src/providers/integrations/cursor/cursor.ts +50 -30
- package/src/providers/integrations/cursor/protocol/tool-canonical.ts +26 -100
- package/src/providers/integrations/devin/devin-auth.ts +353 -0
- package/src/providers/integrations/devin/devin-catalog.ts +207 -0
- package/src/providers/integrations/devin/devin-http.ts +91 -0
- package/src/providers/integrations/devin/devin-quota.ts +214 -0
- package/src/providers/integrations/devin/devin-shared.ts +111 -0
- package/src/providers/integrations/devin/devin.ts +539 -0
- package/src/providers/integrations/devin/protocol/devin-proto.ts +584 -0
- package/src/providers/integrations/devin/protocol/framing.ts +124 -0
- package/src/providers/integrations/factory/factory.ts +2 -2
- package/src/providers/integrations/freepi/freepi-catalog.ts +60 -0
- package/src/providers/integrations/freepi/freepi-discovery.ts +82 -0
- package/src/providers/integrations/freepi/freepi-headers.ts +21 -0
- package/src/providers/integrations/freepi/freepi-oauth.ts +142 -0
- package/src/providers/integrations/freepi/freepi-protocol.ts +242 -0
- package/src/providers/integrations/freepi/freepi-quota.ts +126 -0
- package/src/providers/integrations/freepi/freepi-realm.ts +35 -0
- package/src/providers/integrations/freepi/freepi.ts +292 -0
- package/src/providers/integrations/gemini.ts +2 -2
- package/src/providers/integrations/hermes/hermes-oauth.ts +94 -0
- package/src/providers/integrations/hermes.ts +4 -12
- package/src/providers/integrations/opencode/fingerprint.ts +1 -1
- package/src/providers/integrations/perch/perch-catalog.ts +105 -0
- package/src/providers/integrations/perch/perch-oauth.ts +170 -0
- package/src/providers/integrations/perch/perch-protocol.ts +211 -0
- package/src/providers/integrations/perch/perch-quota.ts +137 -0
- package/src/providers/integrations/perch/perch-realm.ts +82 -0
- package/src/providers/integrations/perch/perch-system-prompt.ts +13 -0
- package/src/providers/integrations/perch/perch.ts +315 -0
- package/src/providers/integrations/perch/saffron-system-prompt.txt +8 -0
- package/src/providers/integrations/qoder/chat-proto.ts +328 -328
- package/src/providers/integrations/qoder/claim-qoder-credits.ts +1 -1
- package/src/providers/integrations/qoder/qoder-adapter.ts +89 -28
- package/src/providers/integrations/qoder/qoder-cache.ts +32 -0
- package/src/providers/integrations/qoder/qoder-catalog.ts +6 -1
- package/src/providers/integrations/qoder/qoder-checkin.ts +2 -2
- package/src/providers/integrations/qoder/qoder-grpc.ts +210 -6
- package/src/providers/integrations/qoder/qoder-ide.ts +5 -1
- package/src/providers/integrations/qoder/qoder-identity-cache.ts +184 -0
- package/src/providers/integrations/qoder/qoder-native-identity-store.ts +83 -18
- package/src/providers/integrations/qoder/qoder-realm.ts +9 -6
- package/src/providers/integrations/qoder/qoder-umid.ts +109 -342
- package/src/providers/integrations/qoder/qoder-virtual.ts +33 -1
- package/src/providers/integrations/qoder/qoder.ts +3 -6
- package/src/providers/integrations/trae/trae-catalog.ts +9 -14
- package/src/providers/integrations/trae/trae-headers.ts +36 -11
- package/src/providers/integrations/trae/trae-oauth.ts +14 -17
- package/src/providers/integrations/trae/trae-protocol.ts +3 -6
- package/src/providers/integrations/trae/trae-quota.ts +103 -21
- package/src/providers/integrations/trae/trae-realm.ts +36 -15
- package/src/providers/integrations/trae/trae.ts +97 -7
- package/src/providers/operations/account-error-classification.ts +66 -1
- package/src/providers/operations/account-health-service.ts +192 -26
- package/src/providers/operations/account-refresh-status.ts +284 -0
- package/src/providers/operations/account-tier.ts +67 -0
- package/src/providers/operations/client-versions.ts +37 -99
- package/src/providers/operations/cooldown-rules.ts +61 -0
- package/src/providers/operations/provider-catalog-seeder.ts +4 -0
- package/src/providers/provider-contracts.ts +29 -0
- package/src/providers/provider-metadata.ts +59 -4
- package/src/providers/provider-model-definition.ts +36 -0
- package/src/providers/quota/refresh.ts +21 -0
- package/src/security/abuse.ts +71 -0
- package/src/transport/dispatch/proxy-request.ts +1 -0
- package/src/transport/dispatch/streaming/stream.ts +1 -0
- package/src/transport/dispatch/upstream.ts +4 -1
- package/src/transport/failure-policy.ts +113 -7
- package/src/transport/routing/router.ts +25 -1
- package/src/transport/surface/messages/adapter.ts +2 -1
- package/src/transport/surface/responses/encode.ts +12 -1
- package/src/workers/daily-checkin.ts +1 -1
- package/src/workers/quota-refresh-sweep.ts +1 -1
- package/src/workers/scheduler.ts +22 -4
- package/dist/dashboard/assets/BannedPage-DeIbIiBU.js +0 -1
- package/dist/dashboard/assets/BannedPage-DeIbIiBU.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-BRWKPQPf.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-BP-Y5iHN.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-B7JHozVa.js +0 -1
- package/dist/dashboard/assets/CombosPage-B7JHozVa.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-GX7iGGcu.js +0 -1
- package/dist/dashboard/assets/ConsoleLogPage-GX7iGGcu.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-HVonbGEa.js +0 -1
- package/dist/dashboard/assets/CustomizationPage-HVonbGEa.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-xaut4OJ9.js +0 -1
- package/dist/dashboard/assets/HealthEventsModal-xaut4OJ9.js.gz +0 -0
- package/dist/dashboard/assets/InjectSystemPromptPanel-Cv-2Ol_K.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-bKfz_b1K.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-B-WQxx_H.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-Z9pJZFo8.js +0 -1
- package/dist/dashboard/assets/OverviewPage-Z9pJZFo8.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-CMeDBxR1.js +0 -7
- package/dist/dashboard/assets/ProviderDetailPage-CMeDBxR1.js.gz +0 -0
- package/dist/dashboard/assets/ProviderIcon-jjqXJDA3.js +0 -1
- package/dist/dashboard/assets/ProviderIcon-jjqXJDA3.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-BXPdOpG4.js +0 -1
- package/dist/dashboard/assets/ProvidersPage-BXPdOpG4.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-emlTuxz6.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-CMJKNYWb.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-BSy7EwGo.js +0 -1
- package/dist/dashboard/assets/SettingsPage-BSy7EwGo.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-CUZrKs9r.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-jWmUdDpy.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-5F9tGVGG.js +0 -56
- package/dist/dashboard/assets/UsagePage-5F9tGVGG.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-KvX83mRe.js +0 -1
- package/dist/dashboard/assets/api-keys-KvX83mRe.js.gz +0 -0
- package/dist/dashboard/assets/app-BEsU8hKs.css +0 -2
- package/dist/dashboard/assets/app-BEsU8hKs.css.gz +0 -0
- package/dist/dashboard/assets/assert-CidQVoNo.js +0 -1
- package/dist/dashboard/assets/assert-CidQVoNo.js.gz +0 -0
- package/dist/dashboard/assets/badge-DyI_mJfi.js.gz +0 -0
- package/dist/dashboard/assets/banner-B-yXtCqb.js.gz +0 -0
- package/dist/dashboard/assets/brand/bansos_page.png +0 -0
- package/dist/dashboard/assets/brand/denia_bansos.jpg +0 -0
- package/dist/dashboard/assets/brand/favicon.jpg +0 -0
- package/dist/dashboard/assets/brand/login_register.jpg +0 -0
- package/dist/dashboard/assets/brand/login_register_initial.jpg +0 -0
- package/dist/dashboard/assets/brand/og_bansos.jpg +0 -0
- package/dist/dashboard/assets/brand/og_image.jpg +0 -0
- package/dist/dashboard/assets/brand/sidebar_ico.jpg +0 -0
- package/dist/dashboard/assets/card-_HwAEqFF.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-Bwv5-zGZ.js +0 -1
- package/dist/dashboard/assets/cli-tools-Bwv5-zGZ.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-ByjCk0o9.js.gz +0 -0
- package/dist/dashboard/assets/dialog-BZhOlfz-.js.gz +0 -0
- package/dist/dashboard/assets/drawer-BADqIRYP.js.gz +0 -0
- package/dist/dashboard/assets/entry-COaC-irN.js.gz +0 -0
- package/dist/dashboard/assets/entry-Ca7LSCet.js +0 -4
- package/dist/dashboard/assets/entry-Ca7LSCet.js.gz +0 -0
- package/dist/dashboard/assets/entry-PDd27uCd.js +0 -1
- package/dist/dashboard/assets/entry-PDd27uCd.js.gz +0 -0
- package/dist/dashboard/assets/formatters-DcHJyRiu.js.gz +0 -0
- package/dist/dashboard/assets/index-CgKmFngv.js.gz +0 -0
- package/dist/dashboard/assets/inline-B2BirKry.js.gz +0 -0
- package/dist/dashboard/assets/input-D-qV9dKY.js.gz +0 -0
- package/dist/dashboard/assets/layout-B7tVWhtV.js.gz +0 -0
- package/dist/dashboard/assets/list-row-CtkGE3bF.js.gz +0 -0
- package/dist/dashboard/assets/live-DGizF06-.js.gz +0 -0
- package/dist/dashboard/assets/minimize-2-BTmMTK4o.js +0 -1
- package/dist/dashboard/assets/minimize-2-BTmMTK4o.js.gz +0 -0
- package/dist/dashboard/assets/mutation-GU7XdEjz.js.gz +0 -0
- package/dist/dashboard/assets/network-C9UE-bOr.js.gz +0 -0
- package/dist/dashboard/assets/numbers-BnAd22a_.js.gz +0 -0
- package/dist/dashboard/assets/pagination-BAywyMzS.js.gz +0 -0
- package/dist/dashboard/assets/query-keys-YSoQOUh6.js.gz +0 -0
- package/dist/dashboard/assets/routing-fnCsxgNO.js +0 -1
- package/dist/dashboard/assets/routing-fnCsxgNO.js.gz +0 -0
- package/dist/dashboard/assets/select-BCOcv8WK.js.gz +0 -0
- package/dist/dashboard/assets/settings-BxslsErn.js +0 -1
- package/dist/dashboard/assets/settings-BxslsErn.js.gz +0 -0
- package/dist/dashboard/assets/stack-ByKt3Q1g.js.gz +0 -0
- package/dist/dashboard/assets/state-DXbGTx7N.js.gz +0 -0
- package/dist/dashboard/assets/switch-ZeTsW623.js.gz +0 -0
- package/dist/dashboard/assets/useMutation-CbCP4w1o.js.gz +0 -0
- package/dist/dashboard/console-backgrounds.jpg +0 -0
- package/dist/dashboard/console-backgrounds_initial.jpg +0 -0
- package/dist/dashboard/donation/qris-risun-marke.png +0 -0
- package/src/providers/integrations/buddy/turing-device-token.ts +0 -262
- package/src/providers/integrations/buddy/workbuddy/cn-oauth.ts +0 -30
- package/src/providers/integrations/buddy/workbuddy/cn-provider.ts +0 -58
- package/src/providers/integrations/buddy/workbuddy/oauth.ts +0 -31
- package/src/providers/integrations/buddy/workbuddy/provider.ts +0 -209
- package/src/providers/integrations/buddy/workbuddy/quota.ts +0 -161
- package/src/providers/integrations/buddy/workbuddy/shared.ts +0 -285
- /package/dist/dashboard/assets/{app-CTxoqyYB.js → app-B7kIWFm5.js} +0 -0
- /package/dist/dashboard/assets/{app-CTxoqyYB.js.gz → app-B7kIWFm5.js.gz} +0 -0
|
@@ -267,6 +267,85 @@ export function normalizeAntigravityToolSchema(schema: unknown): unknown {
|
|
|
267
267
|
return schema;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Flattens JSON-Schema constructs the Antigravity upstream rejects.
|
|
272
|
+
*
|
|
273
|
+
* Verified live (2026-11-05): the Claude-route upstream validates tool
|
|
274
|
+
* schemas as strict JSON Schema draft 2020-12 and refuses every `anyOf` /
|
|
275
|
+
* `oneOf` / multi-type `type: [...]` declaration — even a degenerate
|
|
276
|
+
* `anyOf` of two identical string schemas, and even at the root. The Gemini
|
|
277
|
+
* builder's sanitizer keeps those constructs (Gemini itself accepts them), so
|
|
278
|
+
* a tool that declares a union (e.g. OMP's `task` tool's `model` field)
|
|
279
|
+
* ships an invalid schema and the upstream 400s the whole request with
|
|
280
|
+
* `tools.N.custom.input_schema: JSON schema is invalid`.
|
|
281
|
+
*
|
|
282
|
+
* The rewrite replaces `anyOf`/`oneOf` with the single most permissive
|
|
283
|
+
* alternative's type (string when a choice is a string, otherwise any
|
|
284
|
+
* surviving type), and a multi-type `type: [...]` with its first entry —
|
|
285
|
+
* the most permissive shape a strict single-type validator can express.
|
|
286
|
+
* Recurses through `properties` and `items`.
|
|
287
|
+
*/
|
|
288
|
+
export function flattenAntigravitySchema(schema: unknown): unknown {
|
|
289
|
+
if (!isRecord(schema)) return schema;
|
|
290
|
+
const out: Record<string, unknown> = {};
|
|
291
|
+
for (const [key, child] of Object.entries(schema)) {
|
|
292
|
+
if (key === "anyOf" || key === "oneOf") {
|
|
293
|
+
if (!Array.isArray(child)) continue;
|
|
294
|
+
const chosen = child.map((entry) => flattenAntigravitySchema(entry)).find(isRecord);
|
|
295
|
+
if (chosen === undefined) continue;
|
|
296
|
+
if (typeof chosen["type"] === "string") out["type"] = chosen["type"];
|
|
297
|
+
for (const [nestedKey, nestedValue] of Object.entries(chosen)) {
|
|
298
|
+
if (nestedKey === "type") continue;
|
|
299
|
+
out[nestedKey] = nestedValue;
|
|
300
|
+
}
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (key === "type" && Array.isArray(child)) {
|
|
304
|
+
const first = child.find((entry): entry is string => typeof entry === "string");
|
|
305
|
+
if (first !== undefined) out["type"] = first;
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
if (key === "properties" && isRecord(child)) {
|
|
309
|
+
out["properties"] = Object.fromEntries(
|
|
310
|
+
Object.entries(child).map(([name, entry]) => [name, flattenAntigravitySchema(entry)]),
|
|
311
|
+
);
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (key === "items" && Array.isArray(child)) {
|
|
315
|
+
out["items"] = child.map((entry) => flattenAntigravitySchema(entry));
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
if (key === "items" && isRecord(child)) {
|
|
319
|
+
out["items"] = flattenAntigravitySchema(child);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
out[key] = child;
|
|
323
|
+
}
|
|
324
|
+
return out;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Applies both tool-schema normalizations (unwrap `parametersJsonSchema`,
|
|
329
|
+
* flatten rejected union constructs) and reports whether anything changed.
|
|
330
|
+
*
|
|
331
|
+
* When flattening is a no-op, the *original* reference is returned so the
|
|
332
|
+
* request-level helper can detect an unchanged request without a deep compare.
|
|
333
|
+
*/
|
|
334
|
+
export function normalizeAntigravityToolSchemaForWire(schema: unknown): {
|
|
335
|
+
readonly schema: unknown;
|
|
336
|
+
readonly changed: boolean;
|
|
337
|
+
} {
|
|
338
|
+
const unwrapped = normalizeAntigravityToolSchema(schema);
|
|
339
|
+
const flattened = flattenAntigravitySchema(unwrapped);
|
|
340
|
+
const unwrapChanged = unwrapped !== schema;
|
|
341
|
+
const flattenChanged =
|
|
342
|
+
flattened !== unwrapped && JSON.stringify(flattened) !== JSON.stringify(unwrapped);
|
|
343
|
+
return {
|
|
344
|
+
schema: flattenChanged ? flattened : unwrapped,
|
|
345
|
+
changed: unwrapChanged || flattenChanged,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
270
349
|
/**
|
|
271
350
|
* Normalizes every declared tool's schema on a canonical request, returning a
|
|
272
351
|
* shallow copy of the request when anything changed and the original object
|
|
@@ -286,14 +365,50 @@ export function normalizeAntigravityToolSchemas(request: CanonicalRequest): Cano
|
|
|
286
365
|
if (tools === undefined || tools.length === 0) return request;
|
|
287
366
|
let changed = false;
|
|
288
367
|
const normalized = tools.map((tool) => {
|
|
289
|
-
const schema =
|
|
290
|
-
if (
|
|
368
|
+
const { schema, changed: schemaChanged } = normalizeAntigravityToolSchemaForWire(tool.jsonSchema);
|
|
369
|
+
if (!schemaChanged) return tool;
|
|
291
370
|
changed = true;
|
|
292
371
|
return { ...tool, jsonSchema: schema };
|
|
293
372
|
});
|
|
294
373
|
return changed ? { ...request, tools: normalized } : request;
|
|
295
374
|
}
|
|
296
375
|
|
|
376
|
+
/**
|
|
377
|
+
* Drops replayed reasoning blocks that carry no signature on a Claude route.
|
|
378
|
+
*
|
|
379
|
+
* The Claude-route upstream requires every `thinking` block in a replayed
|
|
380
|
+
* assistant turn to carry a `signature`; an unsigned block is rejected with
|
|
381
|
+
* `400 messages.N.content.0.thinking.signature: Field required`. Chat-surface
|
|
382
|
+
* clients (e.g. OMP) replay reasoning as a bare `reasoning_content` string
|
|
383
|
+
* that has no signature — there is nothing to forward, and sending it as an
|
|
384
|
+
* unsigned `thought` part guarantees the 400.
|
|
385
|
+
*
|
|
386
|
+
* The reference client solves this with a `drop-unsigned-thinking` compat flag
|
|
387
|
+
* on `google-antigravity` (donor `anthropic.kdl:743-748`): a thinking block
|
|
388
|
+
* without a signature is simply not replayed. This mirrors that behavior —
|
|
389
|
+
* reasoning with a real signature still replays; reasoning without one is
|
|
390
|
+
* dropped so the upstream never sees an unsigned `thinking` part.
|
|
391
|
+
*/
|
|
392
|
+
export function dropAntigravityUnsignedReasoning(
|
|
393
|
+
request: CanonicalRequest,
|
|
394
|
+
isClaudeRoute: boolean,
|
|
395
|
+
): CanonicalRequest {
|
|
396
|
+
if (!isClaudeRoute) return request;
|
|
397
|
+
const messages = request.messages;
|
|
398
|
+
let changed = false;
|
|
399
|
+
const next = messages.map((message) => {
|
|
400
|
+
if (message.role !== "assistant") return message;
|
|
401
|
+
const content = message.content.filter((part) => {
|
|
402
|
+
if (part.kind !== "reasoning") return true;
|
|
403
|
+
if (part.signature !== undefined) return true;
|
|
404
|
+
changed = true;
|
|
405
|
+
return false;
|
|
406
|
+
});
|
|
407
|
+
return changed ? { ...message, content } : message;
|
|
408
|
+
});
|
|
409
|
+
return changed ? { ...request, messages: next } : request;
|
|
410
|
+
}
|
|
411
|
+
|
|
297
412
|
// Last-good-endpoint stickiness
|
|
298
413
|
|
|
299
414
|
/**
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
antigravityWireModelId,
|
|
43
43
|
applySkipThoughtSignatureBypass,
|
|
44
|
+
dropAntigravityUnsignedReasoning,
|
|
44
45
|
getAntigravityModelWireProfile,
|
|
45
46
|
getAntigravityUserAgent,
|
|
46
47
|
loadAntigravityProject,
|
|
@@ -334,6 +335,7 @@ class AntigravityAdapter implements ProviderAdapter {
|
|
|
334
335
|
kind: "reasoning",
|
|
335
336
|
payload: null,
|
|
336
337
|
summary: output.thought,
|
|
338
|
+
...(output.thoughtSignature ? { signature: output.thoughtSignature } : {}),
|
|
337
339
|
},
|
|
338
340
|
} as CanonicalEvent;
|
|
339
341
|
}
|
|
@@ -448,6 +450,7 @@ class AntigravityAdapter implements ProviderAdapter {
|
|
|
448
450
|
kind: "reasoning",
|
|
449
451
|
payload: null,
|
|
450
452
|
summary: output.thought,
|
|
453
|
+
...(output.thoughtSignature ? { signature: output.thoughtSignature } : {}),
|
|
451
454
|
},
|
|
452
455
|
} as CanonicalEvent;
|
|
453
456
|
}
|
|
@@ -912,7 +915,16 @@ export function buildAntigravityEnvelope(
|
|
|
912
915
|
// for that key and would drop both the wrapper and the schema inside it —
|
|
913
916
|
// the tool would ship as `{"type":"object"}` with every property gone.
|
|
914
917
|
// Rewriting after the payload is built leaves nothing to recover.
|
|
915
|
-
|
|
918
|
+
//
|
|
919
|
+
// Claude routes also drop replayed reasoning without a signature (donor
|
|
920
|
+
// `drop-unsigned-thinking`): upstream rejects an unsigned `thinking` part
|
|
921
|
+
// with 400 `messages.N.content.0.thinking.signature: Field required`.
|
|
922
|
+
const isClaudeRoute = logicalModelId.toLowerCase().includes("claude");
|
|
923
|
+
const geminiPayload = buildGeminiPayload(
|
|
924
|
+
normalizeAntigravityToolSchemas(
|
|
925
|
+
dropAntigravityUnsignedReasoning(request, isClaudeRoute),
|
|
926
|
+
),
|
|
927
|
+
);
|
|
916
928
|
const profile = getAntigravityModelWireProfile(wireModelId);
|
|
917
929
|
|
|
918
930
|
const generationConfig = isRecord(geminiPayload["generationConfig"])
|
|
@@ -946,7 +958,6 @@ export function buildAntigravityEnvelope(
|
|
|
946
958
|
const existingContents = Array.isArray(geminiPayload["contents"])
|
|
947
959
|
? (geminiPayload["contents"] as Record<string, unknown>[])
|
|
948
960
|
: [];
|
|
949
|
-
const isClaudeRoute = logicalModelId.toLowerCase().includes("claude");
|
|
950
961
|
// Forced choice on Gemini routes: the backend drops `toolConfig` here, so a
|
|
951
962
|
// canonical `tool_choice=required` with no declared change is restated as a
|
|
952
963
|
// trailing user directive (reference behavior). Claude routes implement
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
* declarations.
|
|
9
9
|
*
|
|
10
10
|
* Only the row shape and the builder are shared. Identity headers are not:
|
|
11
|
-
* `codebuddyHeaders`
|
|
12
|
-
* (`X-Product`/`X-IDE-Type`/`X-Domain` versus
|
|
13
|
-
*
|
|
14
|
-
* with their own provider.
|
|
11
|
+
* `codebuddyHeaders` sends genuinely different bytes per realm
|
|
12
|
+
* (`X-Product`/`X-IDE-Type`/`X-Domain` versus the CN CLI profile), and those
|
|
13
|
+
* stay with the provider.
|
|
15
14
|
*/
|
|
16
15
|
import { GatewayError } from "../../../protocol/gateway-error";
|
|
17
16
|
import { defineModel } from "../../provider-model-definition";
|
|
@@ -42,7 +41,8 @@ export const BUDDY_INTL_EFFORTS: Readonly<Record<string, readonly string[]>> = {
|
|
|
42
41
|
"glm-5.2": ["high", "xhigh"],
|
|
43
42
|
"glm-5.3": ["low", "high", "max"],
|
|
44
43
|
hy3: ["low", "high"],
|
|
45
|
-
|
|
44
|
+
hy4: ["high"],
|
|
45
|
+
hy4free: ["high"],
|
|
46
46
|
};
|
|
47
47
|
export const BUDDY_CN_EFFORTS: Readonly<Record<string, readonly string[]>> = {
|
|
48
48
|
"deepseek-v4-flash": ["low", "high", "max"],
|
|
@@ -53,7 +53,8 @@ export const BUDDY_CN_EFFORTS: Readonly<Record<string, readonly string[]>> = {
|
|
|
53
53
|
"glm-5.3": ["low", "high", "max"],
|
|
54
54
|
"glm-5.3-flash": ["low", "high", "max"],
|
|
55
55
|
hy3: ["low", "high"],
|
|
56
|
-
|
|
56
|
+
hy4: ["high"],
|
|
57
|
+
hy4free: ["high"],
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
/** The image-generation ids the international buddy providers serve. */
|
|
@@ -75,9 +76,9 @@ const BUDDY_IMAGE_MODEL_IDS: readonly { id: string; endpoint: string; ctx: numbe
|
|
|
75
76
|
* `seedance-2.5` is the text-to-video model the buddy facade exposes. It is a
|
|
76
77
|
* distinct service kind (`videoGeneration`), not a chat or image row, so it is
|
|
77
78
|
* built by {@link makeBuddyVideoModels} and reached through
|
|
78
|
-
* `/videos/generations` (relative to each variant's own base
|
|
79
|
-
*
|
|
80
|
-
*
|
|
79
|
+
* `/videos/generations` (relative to each variant's own base) rather than a
|
|
80
|
+
* chat wire. CodeBuddy CN is deliberately absent — it publishes a different
|
|
81
|
+
* roster.
|
|
81
82
|
*/
|
|
82
83
|
const BUDDY_VIDEO_MODEL_IDS: readonly { id: string; endpoint: string; ctx: number; out: number }[] = [
|
|
83
84
|
{ id: "seedance-2.5", endpoint: "/videos/generations", ctx: 1_000_000, out: 128_000 },
|
|
@@ -103,16 +104,15 @@ export const BUDDY_IMAGE_MODEL_ID_SET: ReadonlySet<string> = new Set(
|
|
|
103
104
|
* The CN realm's image-generation ids.
|
|
104
105
|
*
|
|
105
106
|
* Separate from {@link BUDDY_IMAGE_MODEL_IDS} because the realms do not share
|
|
106
|
-
* a roster: `hunyuan-image-alpha`
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* `hunyuan-image-alpha-edit` carries `image-to-image` and is deliberately NOT
|
|
112
|
-
* here: it is not in the CLI roster, so it is not a routable generation model.
|
|
107
|
+
* a roster: `hunyuan-image-alpha` (text-to-image) and
|
|
108
|
+
* `hunyuan-image-alpha-edit` (image-to-image) are published by the CN
|
|
109
|
+
* `/v3/config` only, and the intl image ids are not served there. Sharing one
|
|
110
|
+
* list would either leak CN-only ids onto the international catalogs or force
|
|
111
|
+
* a realm check into every consumer.
|
|
113
112
|
*/
|
|
114
113
|
const BUDDY_CN_IMAGE_MODEL_IDS: readonly { id: string; ctx: number; out: number }[] = [
|
|
115
114
|
{ id: "hunyuan-image-alpha", ctx: 1_000_000, out: 64_000 },
|
|
115
|
+
{ id: "hunyuan-image-alpha-edit", ctx: 1_000_000, out: 64_000 },
|
|
116
116
|
];
|
|
117
117
|
|
|
118
118
|
/** The CN analogue of {@link BUDDY_IMAGE_MODEL_ID_SET}. */
|
|
@@ -145,10 +145,54 @@ export function makeBuddyCnImageModels(
|
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
* The CN realm's video-generation ids.
|
|
150
|
+
*
|
|
151
|
+
* `kling-video-v3` (text-to-video + image-to-video) and
|
|
152
|
+
* `minimax-video-h3` (text-to-video) are published by the CN `/v3/config`,
|
|
153
|
+
* sharing the async task surface the intl video rows use.
|
|
154
|
+
*/
|
|
155
|
+
const BUDDY_CN_VIDEO_MODEL_IDS: readonly { id: string; ctx: number; out: number }[] = [
|
|
156
|
+
{ id: "kling-video-v3", ctx: 1_000_000, out: 128_000 },
|
|
157
|
+
{ id: "minimax-video-h3", ctx: 1_000_000, out: 128_000 },
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
/** The CN analogue of {@link BUDDY_VIDEO_MODEL_ID_SET}. */
|
|
161
|
+
export const BUDDY_CN_VIDEO_MODEL_ID_SET: ReadonlySet<string> = new Set(
|
|
162
|
+
BUDDY_CN_VIDEO_MODEL_IDS.map((entry) => entry.id),
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Builds the CN video-generation rows for one buddy CN provider.
|
|
167
|
+
*
|
|
168
|
+
* Same shape as {@link makeBuddyVideoModels}, scoped to the CN roster: a video
|
|
169
|
+
* row produces `["video"]` on the `videoGeneration` surface and is reached
|
|
170
|
+
* through the native video route, not a chat wire.
|
|
171
|
+
*/
|
|
172
|
+
export function makeBuddyCnVideoModels(
|
|
173
|
+
providerId: string,
|
|
174
|
+
endpoint: string,
|
|
175
|
+
): readonly ModelDefinition[] {
|
|
176
|
+
return BUDDY_CN_VIDEO_MODEL_IDS.map((entry) =>
|
|
177
|
+
defineModel({
|
|
178
|
+
id: entry.id,
|
|
179
|
+
providerId,
|
|
180
|
+
serviceKind: "videoGeneration",
|
|
181
|
+
wireFamily: "chat",
|
|
182
|
+
endpoint,
|
|
183
|
+
ctx: entry.ctx,
|
|
184
|
+
out: entry.out,
|
|
185
|
+
vision: true,
|
|
186
|
+
output: ["video"],
|
|
187
|
+
toolCall: false,
|
|
188
|
+
}),
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
148
192
|
/**
|
|
149
193
|
* Ids the buddy facade refuses on a free plan.
|
|
150
194
|
*
|
|
151
|
-
* The international CodeBuddy
|
|
195
|
+
* The international CodeBuddy catalog shares this roster and
|
|
152
196
|
* the same Pro-tier model classification.
|
|
153
197
|
*
|
|
154
198
|
* Nothing in the console directory predicts it. `credits` does not — `kimi-k3`
|
|
@@ -186,12 +230,12 @@ export const BUDDY_PRO_ONLY_MODEL_IDS: ReadonlySet<string> = new Set([
|
|
|
186
230
|
/**
|
|
187
231
|
* Builds the image-generation rows for one buddy provider.
|
|
188
232
|
*
|
|
189
|
-
* Shared rather than copied per provider: cb
|
|
233
|
+
* Shared rather than copied per provider: cb serves the same image
|
|
190
234
|
* models from the same facade, so the roster and the declared capabilities are
|
|
191
235
|
* one decision instead of two that drift. CodeBuddy CN is deliberately absent —
|
|
192
236
|
* it publishes a different roster.
|
|
193
237
|
*
|
|
194
|
-
* `endpoint` is explicit because the
|
|
238
|
+
* `endpoint` is explicit because the realms disagree about the path their
|
|
195
239
|
* base URL expects, and a bare `defineModel` would infer the generic default
|
|
196
240
|
* and produce a URL the upstream rejects.
|
|
197
241
|
*/
|
|
@@ -260,12 +304,9 @@ export const BUDDY_VIDEO_MODEL_ID_SET: ReadonlySet<string> = new Set(
|
|
|
260
304
|
* Builds one buddy catalog row.
|
|
261
305
|
*
|
|
262
306
|
* `endpoint` is explicit rather than left to the generic `/chat/completions`
|
|
263
|
-
* default because the
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* `https://www.workbuddy.ai/chat/completions`, which that upstream answers
|
|
267
|
-
* with a 405 HTML page. Callers pass the endpoint their base URL actually
|
|
268
|
-
* serves, and `undefined` for the default.
|
|
307
|
+
* default because the family's CN base URL differs from the intl one; callers
|
|
308
|
+
* pass the endpoint their base URL actually serves, and `undefined` for the
|
|
309
|
+
* default.
|
|
269
310
|
*/
|
|
270
311
|
export function makeBuddyModel(
|
|
271
312
|
entry: BuddyRawEntry,
|
|
@@ -297,14 +338,11 @@ export function makeBuddyModel(
|
|
|
297
338
|
}
|
|
298
339
|
|
|
299
340
|
/**
|
|
300
|
-
* The shared model roster for the
|
|
341
|
+
* The shared model roster for the international buddy site.
|
|
301
342
|
*
|
|
302
|
-
* CodeBuddy intl
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
* single source of truth, and each provider maps it with its own endpoint
|
|
306
|
-
* (`workbuddy.ts` needs the explicit `/v2/chat/completions`, `codebuddy.ts`
|
|
307
|
-
* takes the family default) — the endpoint is the only thing that differs.
|
|
343
|
+
* CodeBuddy intl serves the model set from the same console directory shape, so
|
|
344
|
+
* the catalog is one hand-written list as the single source of truth, mapped
|
|
345
|
+
* with the provider's own endpoint (`codebuddy.ts` takes the family default).
|
|
308
346
|
*
|
|
309
347
|
* CodeBuddy CN is deliberately NOT on this list: its console publishes a
|
|
310
348
|
* different roster (its own `glm-5v-turbo` / `kimi-k3-1` ids and CN-specific
|
|
@@ -349,8 +387,8 @@ export const BUDDY_SHARED_RAW: readonly BuddyRawEntry[] = [
|
|
|
349
387
|
["grok-4.6", "Grok 4.6", true, true, 500_000, 500_000],
|
|
350
388
|
["grok-4.7", "Grok 4.7", true, true, 500_000, 128_000],
|
|
351
389
|
["hy3", "Hy3", true, true, 192_000, 64_000, true],
|
|
352
|
-
["hy4
|
|
353
|
-
["
|
|
390
|
+
["hy4", "Hy4", true, true, 1_000_000, 64_000, true],
|
|
391
|
+
["hy4free", "Hy4 Free", true, true, 1_000_000, 64_000, true],
|
|
354
392
|
["kimi-k2.5", "Kimi K2.5", true, false, 164_000, 262_144],
|
|
355
393
|
["kimi-k2.6", "Kimi K2.6", true, false, 256_000, 262_144],
|
|
356
394
|
["kimi-k2.7", "Kimi K2.7", true, false, 256_000, 65_536],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Chat-wire payload and message normalization shared by the Tencent "buddy"
|
|
3
|
-
* family providers — CodeBuddy International (`cb`)
|
|
4
|
-
*
|
|
3
|
+
* family providers — CodeBuddy International (`cb`) and CodeBuddy CN (`cbcn`).
|
|
4
|
+
* Both speak the same upstream contract for this part of
|
|
5
5
|
* the payload, so the rules live here once instead of being copied per
|
|
6
6
|
* variant:
|
|
7
7
|
*
|
|
@@ -332,10 +332,10 @@ function buddyTemplatePattern(text: string): RegExp {
|
|
|
332
332
|
return new RegExp(`(?<!\\w)${buddyTemplateSource(text)}(?!\\w)`, "i");
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
// DeepSeek Harness (DSH) role identities. DSH is the harness behind
|
|
336
|
-
// a history that still carries its self-description reads to the
|
|
337
|
-
// foreign channel, so the hardened client rewrites it back to
|
|
338
|
-
// identity rather than forwarding a competing one.
|
|
335
|
+
// DeepSeek Harness (DSH) role identities. DSH is the harness behind the buddy
|
|
336
|
+
// family; a history that still carries its self-description reads to the
|
|
337
|
+
// upstream as a foreign channel, so the hardened client rewrites it back to
|
|
338
|
+
// the CodeBuddy identity rather than forwarding a competing one.
|
|
339
339
|
const DSH_CODING_PATTERN = new RegExp(
|
|
340
340
|
`(?<!\\w)${buddyTemplateSource("You are a coding agent powered by the")}` +
|
|
341
341
|
`[\\s${BUDDY_ZWSP}]+([^\\r\\n]{1,200}?)[\\s${BUDDY_ZWSP}]+` +
|
|
@@ -350,17 +350,17 @@ const DSH_DIRECT_PATTERN = buddyTemplatePattern("You are DeepSeek Harness");
|
|
|
350
350
|
const DSH_WEB_GUI_PATTERN = buddyTemplatePattern("DeepSeek Harness Web GUI");
|
|
351
351
|
|
|
352
352
|
/** The identity DSH role prompts are rewritten to; neutral and minimal. */
|
|
353
|
-
const
|
|
353
|
+
const DSH_CODEBUDDY_IDENTITY = "You are a helpful assistant";
|
|
354
354
|
|
|
355
355
|
/**
|
|
356
356
|
* Rewrites DeepSeek Harness role identities in one message's text back to the
|
|
357
|
-
*
|
|
357
|
+
* CodeBuddy identity. Port of the donor gateway's always-on
|
|
358
358
|
* `desensitize_channel_body`, scoped to text the wire actually carries.
|
|
359
359
|
*
|
|
360
360
|
* This normalizes a replayed history (or a surviving system turn) that still
|
|
361
|
-
* claims the DSH harness, so a
|
|
361
|
+
* claims the DSH harness, so a buddy request never advertises a competing
|
|
362
362
|
* channel identity upstream. The coding persona keeps the model it named:
|
|
363
|
-
* "You are a coding agent powered by the X model" becomes the
|
|
363
|
+
* "You are a coding agent powered by the X model" becomes the CodeBuddy
|
|
364
364
|
* identity plus "powered by the X model".
|
|
365
365
|
*/
|
|
366
366
|
export function scrubBuddyChannelIdentityText(text: string): string {
|
|
@@ -368,13 +368,13 @@ export function scrubBuddyChannelIdentityText(text: string): string {
|
|
|
368
368
|
const withCodingPersona = text.replace(
|
|
369
369
|
DSH_CODING_PATTERN,
|
|
370
370
|
(_match, model: string) =>
|
|
371
|
-
`${
|
|
371
|
+
`${DSH_CODEBUDDY_IDENTITY}. This conversation is powered by the ${model.trim()} model`,
|
|
372
372
|
);
|
|
373
373
|
return withCodingPersona
|
|
374
|
-
.replace(DSH_CHANNEL_IDENTITY_PATTERN,
|
|
375
|
-
.replace(DSH_MINIMAL_PATTERN,
|
|
376
|
-
.replace(DSH_DIRECT_PATTERN,
|
|
377
|
-
.replace(DSH_WEB_GUI_PATTERN, "
|
|
374
|
+
.replace(DSH_CHANNEL_IDENTITY_PATTERN, DSH_CODEBUDDY_IDENTITY)
|
|
375
|
+
.replace(DSH_MINIMAL_PATTERN, DSH_CODEBUDDY_IDENTITY)
|
|
376
|
+
.replace(DSH_DIRECT_PATTERN, DSH_CODEBUDDY_IDENTITY)
|
|
377
|
+
.replace(DSH_WEB_GUI_PATTERN, "CodeBuddy Web GUI");
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
function scrubBuddyMessageText(message: Record<string, unknown>, field: string): void {
|
|
@@ -504,8 +504,8 @@ export function buddyPrePayloadCommon(
|
|
|
504
504
|
cleanupBuddyOrphanToolPairs(arr);
|
|
505
505
|
coalesceConsecutiveAssistantMessages(arr);
|
|
506
506
|
// Normalize a replayed harness history before the blocked-code rewrite
|
|
507
|
-
// below: DSH role identities are replaced with the
|
|
508
|
-
// a
|
|
507
|
+
// below: DSH role identities are replaced with the CodeBuddy identity, so
|
|
508
|
+
// a buddy-family request never forwards a competing channel identity.
|
|
509
509
|
scrubBuddyChannelIdentity(arr);
|
|
510
510
|
// After every merge: a quoted `11128` in any surviving text blocks the
|
|
511
511
|
// whole request, and the merges above are what produce the final text.
|
|
@@ -1138,7 +1138,7 @@ export interface BuddyMessageFinalizeOptions {
|
|
|
1138
1138
|
* The single authoritative buddy message-shape pipeline. Every variant runs
|
|
1139
1139
|
* the same sequence — coalesce, drop empty turns, guarantee the leading system
|
|
1140
1140
|
* turn, omit content on tool_calls-only assistant turns, then auto-cache — so
|
|
1141
|
-
* the wire shape cannot drift between CodeBuddy intl
|
|
1141
|
+
* the wire shape cannot drift between CodeBuddy intl and CN.
|
|
1142
1142
|
*/
|
|
1143
1143
|
export function finalizeBuddyMessages(
|
|
1144
1144
|
messages: Array<Record<string, unknown>>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { asCoercedNumber as sharedAsNumber, asRecord as sharedAsRecord } from "../../../shared/coerce";
|
|
2
2
|
|
|
3
|
-
// Buddy-family daily check-in (daily login credit claim), shared by
|
|
4
|
-
// variants (`cb`, `cbcn
|
|
3
|
+
// Buddy-family daily check-in (daily login credit claim), shared by both
|
|
4
|
+
// variants (`cb`, `cbcn`): same Tencent billing facade, same
|
|
5
5
|
// status/claim contract — only the endpoint base and identity headers differ
|
|
6
6
|
// per variant, and those already live in each provider's own modules.
|
|
7
7
|
//
|
|
@@ -22,15 +22,8 @@ import { asCoercedNumber as sharedAsNumber, asRecord as sharedAsRecord } from ".
|
|
|
22
22
|
|
|
23
23
|
import { providerBaseUrl } from "../../provider-metadata";
|
|
24
24
|
import { sleep } from "../../../shared/sleep";
|
|
25
|
-
import { WORKBUDDY_DOMAIN } from "./workbuddy/shared";
|
|
26
25
|
import { BUDDY_PROVIDER_IDS } from "../../provider-metadata";
|
|
27
26
|
import { QODER_CHECKIN_PROVIDER_IDS } from "../qoder/qoder-checkin";
|
|
28
|
-
import {
|
|
29
|
-
buildWorkBuddyUserAgent,
|
|
30
|
-
getWorkBuddyClientVersion,
|
|
31
|
-
getWorkBuddyCnClientVersion,
|
|
32
|
-
getWorkBuddyCliVersion,
|
|
33
|
-
} from "../../operations/client-versions";
|
|
34
27
|
import { buildCodeBuddyUserAgent } from "../../operations/client-versions";
|
|
35
28
|
import { codebuddyDomain, type CodeBuddyVariant } from "./codebuddy/shared";
|
|
36
29
|
/** Providers whose billing facade exposes the daily check-in routes. */
|
|
@@ -186,8 +179,8 @@ export function buildActivityReportEvent(args: {
|
|
|
186
179
|
* chat send. A single event did not move the growth tasks; four events per
|
|
187
180
|
* batch, sent twice with a pause between the rounds, is what does. The pause
|
|
188
181
|
* is what keeps the two rounds from landing as one burst. Both numbers apply
|
|
189
|
-
* to every buddy variant — the request is built the same way for `cb
|
|
190
|
-
* `cbcn`,
|
|
182
|
+
* to every buddy variant — the request is built the same way for `cb` and
|
|
183
|
+
* `cbcn`, so neither can drift back to a single shot.
|
|
191
184
|
*/
|
|
192
185
|
export const ACTIVITY_REPORT_EVENTS_PER_BATCH = 4;
|
|
193
186
|
export const ACTIVITY_REPORT_ROUNDS = 2;
|
|
@@ -196,8 +189,8 @@ export const ACTIVITY_REPORT_ROUND_DELAY_MS = 1_500;
|
|
|
196
189
|
/**
|
|
197
190
|
* Sends the growth-activity report (`POST {base}/v2/report`, the versioned
|
|
198
191
|
* billing-meter path joined the same way as the status/claim routes:
|
|
199
|
-
* `VERSION_SEGMENT` supplies
|
|
200
|
-
*
|
|
192
|
+
* `VERSION_SEGMENT` supplies nothing for `cb`/`cbcn`, which already end in
|
|
193
|
+
* `/v2`).
|
|
201
194
|
*
|
|
202
195
|
* Two rounds of four events, paused between rounds. Each event carries its
|
|
203
196
|
* own conversation and request id: the facade drops a repeated id as a
|
|
@@ -290,13 +283,10 @@ const CLAIM_RETRY_DELAYS_MS = [1_000, 2_000] as const;
|
|
|
290
283
|
/**
|
|
291
284
|
* Check-in paths are joined onto the provider's manifest base URL, which does
|
|
292
285
|
* NOT carry a consistent version segment: `cb`/`cbcn` already end in `/v2`,
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* gateways cannot drift apart.
|
|
286
|
+
* so no segment is prepended. This map keeps the join aligned with each
|
|
287
|
+
* provider's own quota collector, so the gateways cannot drift apart.
|
|
296
288
|
*/
|
|
297
289
|
const VERSION_SEGMENT: Readonly<Record<string, string>> = {
|
|
298
|
-
workbuddy: "/v2",
|
|
299
|
-
workbuddycn: "/v2",
|
|
300
290
|
cb: "",
|
|
301
291
|
cbcn: "",
|
|
302
292
|
};
|
|
@@ -311,10 +301,9 @@ function claimUrl(providerId: string): string {
|
|
|
311
301
|
|
|
312
302
|
/**
|
|
313
303
|
* Per-provider billing headers. The Buddy gateways share the Tencent billing
|
|
314
|
-
* facade but each risk-gates on its own client identity:
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* the chat surface does.
|
|
304
|
+
* facade but each risk-gates on its own client identity: CodeBuddy intl
|
|
305
|
+
* wants the `IDE` identity, and CN wants `CLI` (plus its own `X-Domain`).
|
|
306
|
+
* Sending the wrong one trips a 403 the same way the chat surface does.
|
|
318
307
|
*/
|
|
319
308
|
async function checkinHeaders(providerId: string): Promise<Record<string, string>> {
|
|
320
309
|
const common = {
|
|
@@ -324,24 +313,13 @@ async function checkinHeaders(providerId: string): Promise<Record<string, string
|
|
|
324
313
|
"Content-Type": "application/json",
|
|
325
314
|
Accept: "application/json",
|
|
326
315
|
};
|
|
327
|
-
|
|
328
|
-
const variant: CodeBuddyVariant = providerId === "cb" ? "IDE" : "CLI";
|
|
329
|
-
return {
|
|
330
|
-
...common,
|
|
331
|
-
"User-Agent": buildCodeBuddyUserAgent(variant),
|
|
332
|
-
"X-IDE-Type": variant,
|
|
333
|
-
"X-IDE-Name": variant,
|
|
334
|
-
"X-Domain": codebuddyDomain(variant),
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
const clientVersion = providerId === "workbuddycn"
|
|
338
|
-
? getWorkBuddyCnClientVersion()
|
|
339
|
-
: getWorkBuddyClientVersion();
|
|
316
|
+
const variant: CodeBuddyVariant = providerId === "cb" ? "IDE" : "CLI";
|
|
340
317
|
return {
|
|
341
318
|
...common,
|
|
342
|
-
"User-Agent":
|
|
343
|
-
"X-
|
|
344
|
-
"
|
|
319
|
+
"User-Agent": buildCodeBuddyUserAgent(variant),
|
|
320
|
+
"X-IDE-Type": variant,
|
|
321
|
+
"X-IDE-Name": variant,
|
|
322
|
+
"X-Domain": codebuddyDomain(variant),
|
|
345
323
|
};
|
|
346
324
|
}
|
|
347
325
|
|
|
@@ -392,7 +370,7 @@ function envelopeCode(payload: unknown): number | null {
|
|
|
392
370
|
}
|
|
393
371
|
|
|
394
372
|
/**
|
|
395
|
-
* Unwraps the check-in payload.
|
|
373
|
+
* Unwraps the check-in payload. The gateway returns a flat `{ code, data }`,
|
|
396
374
|
* while the CodeBuddy billing facade nests Tencent's `data.Response.Data`
|
|
397
375
|
* (the same double wrap its quota endpoint uses), so both shapes resolve.
|
|
398
376
|
*/
|
|
@@ -62,9 +62,9 @@ export interface BuddyConversationIds {
|
|
|
62
62
|
* Wire format for the two message-scoped ids (`x-conversation-message-id`,
|
|
63
63
|
* `x-request-id`).
|
|
64
64
|
*
|
|
65
|
-
* The reference emits these as dashed UUIDs on the
|
|
65
|
+
* The reference emits these as dashed UUIDs on the desktop product
|
|
66
66
|
* and as 32-hex on CLI traffic (`build_attempt_headers` converts only the
|
|
67
|
-
* message/request ids, and only for the
|
|
67
|
+
* message/request ids, and only for the desktop profiles). The turn
|
|
68
68
|
* aggregation key (`x-conversation-request-id` / `x-root-request-id`) and the
|
|
69
69
|
* B3/W3C trace ids stay hex in both styles, because B3's spec accepts only
|
|
70
70
|
* hex. Default `"hex"`.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { asNumber as sharedAsNumber, asRecord } from "../../../shared/coerce";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Model discovery for the buddy family (CodeBuddy intl / CN
|
|
4
|
+
* Model discovery for the buddy family (CodeBuddy intl / CN).
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
* difference is load-bearing: the international
|
|
6
|
+
* The two sites are protocol-isomorphic but NOT path-isomorphic, and the
|
|
7
|
+
* difference is load-bearing: the international site answers
|
|
8
8
|
* `/v2/enterprises/personal/models`, while the CN site answers
|
|
9
9
|
* `/console/enterprises/personal/models`. Probing the CN path on an
|
|
10
10
|
* international host returns HTTP 500 from the edge (APISIX) rather than 404 —
|
|
@@ -34,8 +34,8 @@ import { buddyAccountUid } from "./buddy-oauth-shared";
|
|
|
34
34
|
export const BUDDY_CN_MODELS_PATH = "/console/enterprises/personal/models" as const;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Console directory path on the international
|
|
38
|
-
*
|
|
37
|
+
* Console directory path on the international site (`codebuddy.ai`). The CN
|
|
38
|
+
* path above answers 500 on these hosts.
|
|
39
39
|
*/
|
|
40
40
|
export const BUDDY_INTL_MODELS_PATH = "/v2/enterprises/personal/models" as const;
|
|
41
41
|
|