cartethyia 2.7.8 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +3 -3
- package/README.md +29 -59
- package/dist/dashboard/assets/BannedPage-Cc0vKpMG.js +1 -0
- package/dist/dashboard/assets/BannedPage-Cc0vKpMG.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolDetailPage-BRWKPQPf.js → CliToolDetailPage-Bqj2aa1T.js} +1 -1
- package/dist/dashboard/assets/CliToolDetailPage-Bqj2aa1T.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-BP-Y5iHN.js → CliToolsPage-CXsaOAO2.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-CXsaOAO2.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-BeLpJ4ma.js +1 -0
- package/dist/dashboard/assets/CombosPage-BeLpJ4ma.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-DnV0uZ3m.js +1 -0
- package/dist/dashboard/assets/ConsoleLogPage-DnV0uZ3m.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-CBxAjo63.js +1 -0
- package/dist/dashboard/assets/CustomizationPage-CBxAjo63.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-B5yEE0k6.js +1 -0
- package/dist/dashboard/assets/HealthEventsModal-B5yEE0k6.js.gz +0 -0
- package/dist/dashboard/assets/{InjectSystemPromptPanel-Cv-2Ol_K.js → InjectSystemPromptPanel-BWFLECmz.js} +2 -2
- package/dist/dashboard/assets/InjectSystemPromptPanel-BWFLECmz.js.gz +0 -0
- package/dist/dashboard/assets/{LoginPage-bKfz_b1K.js → LoginPage-CgoPc5B9.js} +1 -1
- package/dist/dashboard/assets/LoginPage-CgoPc5B9.js.gz +0 -0
- package/dist/dashboard/assets/{ModelPicker-B-WQxx_H.js → ModelPicker-D9bFQern.js} +1 -1
- package/dist/dashboard/assets/ModelPicker-D9bFQern.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-B_p4tL8k.js +1 -0
- package/dist/dashboard/assets/OverviewPage-B_p4tL8k.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-rs5E2rxv.js +8 -0
- package/dist/dashboard/assets/ProviderDetailPage-rs5E2rxv.js.gz +0 -0
- package/dist/dashboard/assets/ProviderIcon-D_0PiZtg.js +1 -0
- package/dist/dashboard/assets/ProviderIcon-D_0PiZtg.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-CLI2bJTK.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-CLI2bJTK.js.gz +0 -0
- package/dist/dashboard/assets/{ProxyPage-emlTuxz6.js → ProxyPage-BwNC_-Cx.js} +1 -1
- package/dist/dashboard/assets/ProxyPage-BwNC_-Cx.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-DA-a1iSN.js +1 -0
- package/dist/dashboard/assets/QuotaPage-DA-a1iSN.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-CctTga2C.js +1 -0
- package/dist/dashboard/assets/SettingsPage-CctTga2C.js.gz +0 -0
- package/dist/dashboard/assets/{SetupPage-CUZrKs9r.js → SetupPage-febLU4r1.js} +1 -1
- package/dist/dashboard/assets/SetupPage-febLU4r1.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-jWmUdDpy.js → StudioPage-M6fvR5Wz.js} +1 -1
- package/dist/dashboard/assets/StudioPage-M6fvR5Wz.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-nyeuRqz9.js +56 -0
- package/dist/dashboard/assets/UsagePage-nyeuRqz9.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-BFOlvrJC.js +1 -0
- package/dist/dashboard/assets/api-keys-BFOlvrJC.js.gz +0 -0
- package/dist/dashboard/assets/app-Dx2QgsNj.css +2 -0
- package/dist/dashboard/assets/app-Dx2QgsNj.css.gz +0 -0
- package/dist/dashboard/assets/{assert-CidQVoNo.js → assert-CqTLw5e7.js} +1 -1
- package/dist/dashboard/assets/assert-CqTLw5e7.js.gz +0 -0
- package/dist/dashboard/assets/{badge-DyI_mJfi.js → badge-C83EqLB0.js} +1 -1
- package/dist/dashboard/assets/badge-C83EqLB0.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-D1xn7pIe.js} +1 -1
- package/dist/dashboard/assets/banner-D1xn7pIe.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-DU3Lq5Lm.js} +1 -1
- package/dist/dashboard/assets/card-DU3Lq5Lm.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-Dw1U_drK.js +1 -0
- package/dist/dashboard/assets/cli-tools-Dw1U_drK.js.gz +0 -0
- package/dist/dashboard/assets/{clipboard-button-ByjCk0o9.js → clipboard-button-CEL5Sg_J.js} +1 -1
- package/dist/dashboard/assets/clipboard-button-CEL5Sg_J.js.gz +0 -0
- package/dist/dashboard/assets/{dialog-BZhOlfz-.js → dialog-BjFR5UHy.js} +1 -1
- package/dist/dashboard/assets/dialog-BjFR5UHy.js.gz +0 -0
- package/dist/dashboard/assets/{drawer-BADqIRYP.js → drawer-HvBW0AjI.js} +1 -1
- package/dist/dashboard/assets/drawer-HvBW0AjI.js.gz +0 -0
- package/dist/dashboard/assets/entry-BSu3gFlt.js +4 -0
- package/dist/dashboard/assets/entry-BSu3gFlt.js.gz +0 -0
- package/dist/dashboard/assets/{entry-COaC-irN.js → entry-CECVELyy.js} +1 -1
- package/dist/dashboard/assets/entry-CECVELyy.js.gz +0 -0
- package/dist/dashboard/assets/entry-DYYofQ7W.js +1 -0
- package/dist/dashboard/assets/entry-DYYofQ7W.js.gz +0 -0
- package/dist/dashboard/assets/{formatters-DcHJyRiu.js → formatters-DLW4i8zK.js} +1 -1
- package/dist/dashboard/assets/formatters-DLW4i8zK.js.gz +0 -0
- package/dist/dashboard/assets/{index-CgKmFngv.js → index-1-fCqe64.js} +2 -2
- package/dist/dashboard/assets/index-1-fCqe64.js.gz +0 -0
- package/dist/dashboard/assets/{inline-B2BirKry.js → inline-DGvU2oLK.js} +1 -1
- package/dist/dashboard/assets/inline-DGvU2oLK.js.gz +0 -0
- package/dist/dashboard/assets/{input-D-qV9dKY.js → input-iNnO1X2K.js} +1 -1
- package/dist/dashboard/assets/input-iNnO1X2K.js.gz +0 -0
- package/dist/dashboard/assets/{layout-B7tVWhtV.js → layout-0q8UGypb.js} +1 -1
- package/dist/dashboard/assets/layout-0q8UGypb.js.gz +0 -0
- package/dist/dashboard/assets/{list-row-CtkGE3bF.js → list-row-C0w2bQjJ.js} +1 -1
- package/dist/dashboard/assets/list-row-C0w2bQjJ.js.gz +0 -0
- package/dist/dashboard/assets/{live-DGizF06-.js → live-M5aJ_xCa.js} +1 -1
- package/dist/dashboard/assets/live-M5aJ_xCa.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-BKeQGT3K.js} +1 -1
- package/dist/dashboard/assets/network-BKeQGT3K.js.gz +0 -0
- package/dist/dashboard/assets/{numbers-BnAd22a_.js → numbers-CivAk3da.js} +1 -1
- package/dist/dashboard/assets/numbers-CivAk3da.js.gz +0 -0
- package/dist/dashboard/assets/{pagination-BAywyMzS.js → pagination-CpzvI5ep.js} +1 -1
- package/dist/dashboard/assets/pagination-CpzvI5ep.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/providers/zro.svg +3 -0
- package/dist/dashboard/assets/providers/zro.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/quota-DiPD6UKH.js +1 -0
- package/dist/dashboard/assets/quota-DiPD6UKH.js.gz +0 -0
- package/dist/dashboard/assets/routing-BFQX2VBc.js +1 -0
- package/dist/dashboard/assets/routing-BFQX2VBc.js.gz +0 -0
- package/dist/dashboard/assets/{select-BCOcv8WK.js → select-CXbck0jG.js} +2 -2
- package/dist/dashboard/assets/select-CXbck0jG.js.gz +0 -0
- package/dist/dashboard/assets/settings-C_XvMHh9.js +1 -0
- package/dist/dashboard/assets/settings-C_XvMHh9.js.gz +0 -0
- package/dist/dashboard/assets/{stack-ByKt3Q1g.js → stack-DggRiCxE.js} +1 -1
- package/dist/dashboard/assets/stack-DggRiCxE.js.gz +0 -0
- package/dist/dashboard/assets/{state-DXbGTx7N.js → state-ClFzfbYp.js} +1 -1
- package/dist/dashboard/assets/state-ClFzfbYp.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-CTIFxKqS.js} +1 -1
- package/dist/dashboard/assets/switch-CTIFxKqS.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-CbCP4w1o.js → useMutation-BClG3yWj.js} +1 -1
- package/dist/dashboard/assets/useMutation-BClG3yWj.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 +59 -56
- 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/full-postgres/0046_add_accounts_quota_plan_fetched_at.sql +7 -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/migrations/lite-sqlite3/0046_add_accounts_quota_plan_fetched_at.sql +4 -0
- package/package.json +1 -1
- package/src/boot/app.ts +10 -13
- package/src/boot/dependencies.ts +12 -4
- package/src/boot/flush.ts +20 -0
- package/src/boot/lifecycle.ts +7 -5
- package/src/config/cooldowns.ts +1 -1
- package/src/config/routing.ts +26 -0
- package/src/config/spec-metadata.ts +72 -0
- package/src/config/spec.ts +20 -6
- package/src/console/api-keys/contracts.ts +12 -1
- package/src/console/api-keys/routes.ts +50 -31
- package/src/console/auth/account-reset.ts +7 -9
- package/src/console/backup/contracts.ts +4 -0
- package/src/console/backup/export-endpoint.ts +7 -5
- package/src/console/cli-tools/service.ts +6 -12
- package/src/console/console-router-guards.ts +23 -16
- package/src/console/console-router.ts +7 -0
- package/src/console/dashboard-assets.ts +5 -5
- package/src/console/domain-registration.ts +27 -2
- package/src/console/inferhub/normalize.ts +24 -28
- package/src/console/inferhub/types.ts +3 -0
- package/src/console/ip-bans/routes.ts +93 -0
- package/src/console/observability/store.ts +0 -53
- package/src/console/providers/catalog/catalog-projections.ts +5 -2
- package/src/console/providers/catalog/contracts.ts +123 -0
- package/src/console/providers/catalog/discover-constants.ts +6 -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 +65 -4
- package/src/console/providers/catalog/store-helpers.ts +30 -1
- package/src/console/providers/catalog/store.ts +249 -4
- package/src/console/quota/account-quota-global.ts +97 -19
- package/src/console/quota/account-quota-shared.ts +49 -0
- package/src/console/quota/account-quota-tenant.ts +6 -18
- package/src/console/quota/native-identity.ts +2 -0
- package/src/console/quota/quota-view.ts +19 -3
- package/src/console/routing/pools/operations.ts +31 -46
- package/src/console/settings/contracts.ts +18 -0
- package/src/console/settings/store.ts +32 -0
- package/src/console/shared/errors.ts +33 -6
- package/src/console/system-prompt/contracts.ts +0 -1
- package/src/main.ts +3 -3
- package/src/network/pool/byte-accounting.ts +3 -2
- package/src/network/pool/selector.ts +182 -39
- package/src/network/pool-cooldown-store.ts +89 -14
- package/src/network/pool-health.ts +49 -61
- package/src/network/rate-limit-verdict.ts +1 -1
- package/src/network/ssrf.ts +6 -6
- package/src/observability/event-log.ts +7 -361
- package/src/observability/event-query.ts +18 -4
- package/src/observability/performance-metrics.ts +9 -0
- package/src/observability/runtime-metrics.ts +14 -9
- package/src/observability/telemetry-buffer.ts +15 -25
- package/src/observability/telemetry-reconciliation.ts +9 -37
- package/src/observability/telemetry-row.ts +125 -0
- package/src/persistence/db-mode.ts +4 -1
- package/src/persistence/dialect.ts +30 -0
- package/src/persistence/migrate.ts +6 -3
- package/src/persistence/schema.ts +28 -2
- package/src/persistence/ttl-cache.ts +20 -2
- package/src/protocol/codecs.ts +1 -1
- package/src/protocol/dsml.ts +35 -87
- package/src/protocol/gateway-error.ts +1 -0
- package/src/protocol/markup-stream-parser.ts +195 -0
- package/src/protocol/reasoning-text.ts +19 -0
- package/src/protocol/reasoning.ts +1 -1
- package/src/protocol/request/chat.ts +14 -14
- package/src/protocol/request/gemini.ts +8 -2
- package/src/protocol/request/messages.ts +4 -5
- package/src/protocol/response/chat.ts +12 -20
- package/src/protocol/response/gemini.ts +6 -1
- package/src/protocol/response/omp-tool-call-markup.ts +43 -86
- package/src/protocol/response/responses.ts +18 -2
- package/src/protocol/sse-decoder.ts +25 -8
- package/src/protocol/stop-reason.ts +23 -1
- package/src/protocol/stream-error-frames.ts +13 -3
- package/src/protocol/think-split.ts +112 -0
- package/src/protocol/translation/dialect/qwen.ts +26 -58
- 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 +78 -17
- package/src/providers/authentication/oauth-client.ts +1 -1
- package/src/providers/authentication/oauth-device-flow.ts +98 -8
- package/src/providers/authentication/oauth-refresh-service.ts +153 -59
- package/src/providers/configured-provider.ts +148 -0
- package/src/providers/default-registry.ts +117 -27
- package/src/providers/discovery/discovery-types.ts +12 -0
- package/src/providers/discovery/probe-phases.ts +74 -33
- package/src/providers/discovery/probing-service.ts +293 -165
- package/src/providers/integrations/alibabacp/alibabacp-models.ts +1 -2
- package/src/providers/integrations/{dashscope-models.ts → alibabacp/dashscope-models.ts} +2 -2
- package/src/providers/integrations/antigravity/antigravity-protocol.ts +121 -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 +191 -35
- 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 +89 -6
- 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 +6 -43
- package/src/providers/integrations/buddy/codebuddy/cn-catalog.ts +2 -1
- package/src/providers/integrations/buddy/codebuddy/cn-provider.ts +23 -1
- package/src/providers/integrations/buddy/codebuddy/provider.ts +6 -2
- package/src/providers/integrations/buddy/codebuddy/shared.ts +38 -27
- package/src/providers/integrations/claude/claude-quota.ts +14 -17
- package/src/providers/integrations/cline/cline.ts +2 -2
- package/src/providers/integrations/commandcode/quota.ts +22 -28
- package/src/providers/integrations/cursor/cursor-auth.ts +0 -8
- package/src/providers/integrations/cursor/cursor-catalog.ts +2 -0
- package/src/providers/integrations/cursor/cursor-exec.ts +745 -0
- package/src/providers/integrations/cursor/cursor-http2.ts +2 -0
- package/src/providers/integrations/cursor/cursor-request.ts +35 -20
- package/src/providers/integrations/cursor/cursor-shared.ts +26 -5
- package/src/providers/integrations/cursor/cursor.ts +139 -70
- package/src/providers/integrations/cursor/protocol/messages.ts +22 -29
- package/src/providers/integrations/cursor/protocol/protobuf-schema.ts +37 -0
- 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 +558 -0
- package/src/providers/integrations/devin/protocol/framing.ts +124 -0
- package/src/providers/integrations/factory/factory-oauth.ts +17 -44
- package/src/providers/integrations/factory/factory.ts +2 -2
- package/src/providers/integrations/freebuff/assets/official-system-manager.txt +88 -0
- package/src/providers/integrations/freebuff/assets/official-system-worker.txt +57 -0
- package/src/providers/integrations/freebuff/assets/official-tools.json +1070 -0
- package/src/providers/integrations/freebuff/freebuff-catalog.ts +120 -0
- package/src/providers/integrations/freebuff/freebuff-constants.ts +1233 -0
- package/src/providers/integrations/freebuff/freebuff-discovery.ts +108 -0
- package/src/providers/integrations/freebuff/freebuff-oauth.ts +240 -0
- package/src/providers/integrations/freebuff/freebuff-quota.ts +260 -0
- package/src/providers/integrations/freebuff/freebuff-virtual.ts +89 -0
- package/src/providers/integrations/freebuff/freebuff.ts +682 -0
- 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/grok/grok-oauth.ts +48 -45
- package/src/providers/integrations/grok/grok-ratelimit-store.ts +10 -17
- package/src/providers/integrations/grok/grok-turn-index.ts +11 -16
- package/src/providers/integrations/hermes/hermes-oauth.ts +94 -0
- package/src/providers/integrations/{hermes.ts → hermes/hermes.ts} +13 -21
- package/src/providers/integrations/hermes/index.ts +2 -0
- package/src/providers/integrations/kiro/kiro-catalog.ts +17 -1
- package/src/providers/integrations/kiro/kiro-discovery.ts +10 -12
- package/src/providers/integrations/kiro/kiro-quota.ts +8 -4
- package/src/providers/integrations/kiro/kiro.ts +15 -19
- package/src/providers/integrations/ollamacloud/index.ts +2 -0
- package/src/providers/integrations/{ollamacloud-models.ts → ollamacloud/models.ts} +2 -2
- package/src/providers/integrations/{ollamacloud-quota.ts → ollamacloud/quota.ts} +3 -3
- package/src/providers/integrations/opencode/fingerprint.ts +1 -1
- package/src/providers/integrations/opencode/opencode-go-quota.ts +2 -8
- package/src/providers/integrations/perch/perch-catalog.ts +105 -0
- package/src/providers/integrations/perch/perch-credential.ts +25 -0
- package/src/providers/integrations/perch/perch-oauth.ts +170 -0
- package/src/providers/integrations/perch/perch-protocol.ts +208 -0
- package/src/providers/integrations/perch/perch-quota.ts +123 -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 +305 -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 +19 -60
- package/src/providers/integrations/qoder/qoder-adapter.ts +90 -40
- package/src/providers/integrations/qoder/qoder-auth.ts +101 -29
- package/src/providers/integrations/qoder/qoder-cache.ts +32 -0
- package/src/providers/integrations/qoder/qoder-catalog.ts +26 -6
- package/src/providers/integrations/qoder/qoder-chat.ts +7 -21
- package/src/providers/integrations/qoder/qoder-checkin.ts +6 -6
- package/src/providers/integrations/qoder/qoder-grpc.ts +210 -7
- package/src/providers/integrations/qoder/qoder-ide.ts +5 -108
- 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 -7
- 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 +12 -11
- package/src/providers/integrations/trae/trae-quota.ts +96 -36
- package/src/providers/integrations/trae/trae-realm.ts +74 -15
- package/src/providers/integrations/trae/trae.ts +99 -26
- package/src/providers/integrations/zcode-start-plan/provider.ts +226 -23
- package/src/providers/integrations/zcode-start-plan/quota.ts +19 -2
- package/src/providers/integrations/zro/zro.ts +204 -0
- package/src/providers/operations/account-error-classification.ts +235 -278
- package/src/providers/operations/account-health-service.ts +273 -26
- package/src/providers/operations/account-refresh-status.ts +269 -0
- package/src/providers/operations/account-tier.ts +66 -0
- package/src/providers/operations/client-version-resolver.ts +1 -1
- package/src/providers/operations/client-versions.ts +42 -150
- package/src/providers/operations/cooldown-rules.ts +56 -0
- package/src/providers/operations/{model-catalog-cache.ts → provider-caches.ts} +68 -16
- package/src/providers/operations/provider-catalog-seeder.ts +4 -0
- package/src/providers/operations/provider-catalog-service.ts +1 -1
- package/src/providers/operations/provider-credential-service.ts +102 -32
- package/src/providers/operations/provider-rules/github.ts +48 -0
- package/src/providers/operations/provider-rules/grok.ts +33 -0
- package/src/providers/operations/provider-rules/inception.ts +49 -0
- package/src/providers/operations/provider-rules/index.ts +32 -0
- package/src/providers/operations/provider-rules/perch.ts +37 -0
- package/src/providers/operations/provider-rules/qoder.ts +70 -0
- package/src/providers/operations/provider-rules/trae.ts +81 -0
- package/src/providers/provider-contracts.ts +33 -2
- package/src/providers/{provider-credential-resolver.ts → provider-credentials.ts} +40 -3
- package/src/providers/provider-metadata.ts +99 -14
- package/src/providers/provider-model-definition.ts +36 -0
- package/src/providers/provider-probe.ts +15 -1
- package/src/providers/provider-registry.ts +42 -33
- package/src/providers/quota/quota-limit-windows.ts +16 -5
- package/src/providers/quota/quota-support.ts +1 -1
- package/src/providers/quota/quota-window-parser.ts +90 -18
- package/src/providers/quota/refresh.ts +96 -18
- package/src/security/abuse.ts +71 -0
- package/src/security/api-key-auth-cache.ts +1 -1
- package/src/security/api-key-auth.ts +6 -2
- package/src/transport/dispatch/attempt-finalize.ts +14 -13
- package/src/transport/dispatch/attempt-loop.ts +71 -17
- package/src/transport/dispatch/generation.ts +2 -8
- package/src/transport/dispatch/native-shared.ts +25 -0
- package/src/transport/dispatch/proxy-request.ts +9 -46
- package/src/transport/dispatch/responses-compact.ts +2 -8
- package/src/transport/dispatch/streaming/finalize.ts +9 -6
- package/src/transport/dispatch/streaming/stream.ts +9 -36
- package/src/transport/dispatch/systemone.ts +2 -8
- package/src/transport/dispatch/token-count.ts +2 -6
- package/src/transport/dispatch/upstream.ts +67 -1
- package/src/transport/drain-endpoint.ts +31 -4
- package/src/transport/failure-policy.ts +129 -37
- package/src/transport/guards/body-policy.ts +7 -1
- package/src/transport/guards/error-lifecycle.ts +13 -1
- package/src/transport/guards/request-context.ts +22 -14
- package/src/transport/request/preparer.ts +81 -71
- package/src/transport/routing/bounded-lru.ts +14 -0
- package/src/transport/routing/drain-reserve.ts +129 -0
- package/src/transport/routing/plan-gate.ts +7 -1
- package/src/transport/routing/round-robin.ts +60 -0
- package/src/transport/routing/route-catalog.ts +123 -111
- package/src/transport/routing/route-model.ts +51 -9
- package/src/transport/routing/router.ts +418 -33
- package/src/transport/surface/adapters.ts +11 -2
- package/src/transport/surface/chat/adapter.ts +2 -2
- package/src/transport/surface/chat/encode.ts +47 -4
- package/src/transport/surface/chat/parse.ts +2 -12
- package/src/transport/surface/completion.ts +44 -33
- package/src/transport/surface/content-parts.ts +21 -0
- package/src/transport/surface/messages/adapter.ts +9 -2
- package/src/transport/surface/messages/encode.ts +11 -3
- package/src/transport/surface/messages/parse.ts +2 -1
- package/src/transport/surface/messages/stream.ts +33 -17
- package/src/transport/surface/responses/encode.ts +34 -6
- package/src/transport/surface/responses/parse.ts +3 -11
- 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 +0 -1
- 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.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/quota-DJ1QlAOq.js +0 -1
- package/dist/dashboard/assets/quota-DJ1QlAOq.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/bundled-discovery-providers.ts +0 -98
- package/src/providers/configured-openai-providers.ts +0 -120
- 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/src/providers/operations/model-discovery-cache.ts +0 -34
- package/src/providers/operations/probe-fetch.ts +0 -15
- package/src/providers/operations/provider-version-cache.ts +0 -30
- package/src/providers/provider-capabilities.ts +0 -33
- package/src/providers/provider-credential-envelope.ts +0 -43
- /package/dist/dashboard/assets/{app-CTxoqyYB.js → app-DIXLjojg.js} +0 -0
- /package/dist/dashboard/assets/{app-CTxoqyYB.js.gz → app-DIXLjojg.js.gz} +0 -0
|
@@ -1,328 +1,328 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated from `vendor/qoder-proto/chat.proto` (Qoder desktop client v1.1.81,
|
|
3
|
-
* `qoder-worker-runtime.mjs`). Do not edit by hand — regenerate from the
|
|
4
|
-
* proto file via `scripts/
|
|
5
|
-
*/
|
|
6
|
-
export const CHAT_PROTO_SOURCE = `syntax = "proto3";
|
|
7
|
-
|
|
8
|
-
package model.chat;
|
|
9
|
-
|
|
10
|
-
import "google/protobuf/struct.proto";
|
|
11
|
-
import "google/protobuf/wrappers.proto";
|
|
12
|
-
|
|
13
|
-
option java_multiple_files = true;
|
|
14
|
-
option java_package = "com.qoder.grpc.model.chat";
|
|
15
|
-
option java_outer_classname = "ChatProto";
|
|
16
|
-
|
|
17
|
-
// Reasoning effort level for model reasoning
|
|
18
|
-
enum ReasoningEffort {
|
|
19
|
-
REASONING_EFFORT_UNSPECIFIED = 0;
|
|
20
|
-
REASONING_EFFORT_NONE = 1;
|
|
21
|
-
REASONING_EFFORT_LOW = 2;
|
|
22
|
-
REASONING_EFFORT_MEDIUM = 3;
|
|
23
|
-
REASONING_EFFORT_HIGH = 4;
|
|
24
|
-
REASONING_EFFORT_XHIGH = 5;
|
|
25
|
-
REASONING_EFFORT_MAX = 6;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ─── Request messages ────────────────────────────────────────────────────────
|
|
29
|
-
|
|
30
|
-
// Chat completion request matching OpenAI-compatible API
|
|
31
|
-
message ChatCompletionRequest {
|
|
32
|
-
string model = 1;
|
|
33
|
-
repeated ChatMessage messages = 2;
|
|
34
|
-
google.protobuf.DoubleValue temperature = 3;
|
|
35
|
-
google.protobuf.DoubleValue top_p = 4;
|
|
36
|
-
google.protobuf.Int32Value max_tokens = 5;
|
|
37
|
-
bool stream = 6;
|
|
38
|
-
repeated string stop = 7;
|
|
39
|
-
google.protobuf.DoubleValue presence_penalty = 8;
|
|
40
|
-
google.protobuf.DoubleValue frequency_penalty = 9;
|
|
41
|
-
google.protobuf.Int32Value n = 10;
|
|
42
|
-
google.protobuf.StringValue user = 11;
|
|
43
|
-
google.protobuf.Int32Value seed = 12;
|
|
44
|
-
Reasoning reasoning = 13;
|
|
45
|
-
google.protobuf.BoolValue parallel_tool_calls = 14;
|
|
46
|
-
map<string, double> logit_bias = 15;
|
|
47
|
-
repeated Tool tools = 16;
|
|
48
|
-
google.protobuf.Value tool_choice = 17;
|
|
49
|
-
ResponseFormat response_format = 18;
|
|
50
|
-
repeated string modalities = 19;
|
|
51
|
-
StreamOptions stream_options = 20;
|
|
52
|
-
map<string, ChatPatchList> patches = 21;
|
|
53
|
-
ChatMetadata metadata = 22;
|
|
54
|
-
google.protobuf.Struct extras = 23;
|
|
55
|
-
CustomModelConfig custom_model = 24;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Wrapper for repeated ChatPatch (used in patches map value)
|
|
59
|
-
message ChatPatchList {
|
|
60
|
-
repeated ChatPatch patches = 1;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Chat message in the conversation (request side)
|
|
64
|
-
message ChatMessage {
|
|
65
|
-
string cache_id = 1;
|
|
66
|
-
string role = 2;
|
|
67
|
-
// content can be plain text or a list of multimodal content parts
|
|
68
|
-
oneof content_type {
|
|
69
|
-
string text_content = 3;
|
|
70
|
-
ContentPartList parts_content = 12;
|
|
71
|
-
}
|
|
72
|
-
google.protobuf.StringValue name = 4;
|
|
73
|
-
repeated ToolCall tool_calls = 5;
|
|
74
|
-
google.protobuf.StringValue tool_call_id = 6;
|
|
75
|
-
google.protobuf.StringValue tool_call_call_id = 7;
|
|
76
|
-
google.protobuf.StringValue reasoning_content = 8;
|
|
77
|
-
ReasoningItem reasoning_item = 9;
|
|
78
|
-
google.protobuf.Struct extends = 10;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Wrapper for repeated ContentPart
|
|
82
|
-
message ContentPartList {
|
|
83
|
-
repeated ContentPart parts = 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Content part for multimodal messages
|
|
87
|
-
message ContentPart {
|
|
88
|
-
string type = 1;
|
|
89
|
-
google.protobuf.StringValue text = 2;
|
|
90
|
-
ImageUrl image_url = 3;
|
|
91
|
-
InputAudio input_audio = 4;
|
|
92
|
-
CacheControl cache_control = 5;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Cache control configuration for content parts
|
|
96
|
-
message CacheControl {
|
|
97
|
-
string type = 1;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Image URL in message content
|
|
101
|
-
message ImageUrl {
|
|
102
|
-
string url = 1;
|
|
103
|
-
google.protobuf.StringValue detail = 2;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Audio input in message content
|
|
107
|
-
message InputAudio {
|
|
108
|
-
string data = 1;
|
|
109
|
-
string format = 2;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Reasoning item for model series (e.g. gpt-5)
|
|
113
|
-
message ReasoningItem {
|
|
114
|
-
string id = 1;
|
|
115
|
-
google.protobuf.StringValue encrypted_content = 2;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Streaming options
|
|
119
|
-
message StreamOptions {
|
|
120
|
-
google.protobuf.BoolValue include_usage = 1;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Tool available for the model to call
|
|
124
|
-
message Tool {
|
|
125
|
-
string cache_id = 1;
|
|
126
|
-
string type = 2;
|
|
127
|
-
Function function = 3;
|
|
128
|
-
Advisor advisor = 4;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Function definition
|
|
132
|
-
message Function {
|
|
133
|
-
string name = 1;
|
|
134
|
-
google.protobuf.StringValue description = 2;
|
|
135
|
-
google.protobuf.Struct parameters = 3;
|
|
136
|
-
google.protobuf.BoolValue strict = 4;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Advisor definition
|
|
140
|
-
message Advisor {
|
|
141
|
-
string name = 1;
|
|
142
|
-
string model = 2;
|
|
143
|
-
int32 max_uses = 3;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Tool call made by the assistant
|
|
147
|
-
message ToolCall {
|
|
148
|
-
google.protobuf.StringValue id = 1;
|
|
149
|
-
google.protobuf.StringValue call_id = 2;
|
|
150
|
-
google.protobuf.StringValue type = 3;
|
|
151
|
-
FunctionCall function = 4;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// Function call details
|
|
155
|
-
message FunctionCall {
|
|
156
|
-
string name = 1;
|
|
157
|
-
google.protobuf.Value arguments = 2;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Reasoning configuration
|
|
161
|
-
message Reasoning {
|
|
162
|
-
ReasoningEffort effort = 1;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Response format specification
|
|
166
|
-
message ResponseFormat {
|
|
167
|
-
string type = 1;
|
|
168
|
-
JsonSchema json_schema = 2;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// JSON schema for structured outputs
|
|
172
|
-
message JsonSchema {
|
|
173
|
-
string name = 1;
|
|
174
|
-
google.protobuf.StringValue description = 2;
|
|
175
|
-
google.protobuf.Struct schema = 3;
|
|
176
|
-
google.protobuf.BoolValue strict = 4;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Metadata attached to the chat request
|
|
180
|
-
message ChatMetadata {
|
|
181
|
-
WorkspaceMetadata workspace = 1;
|
|
182
|
-
BusinessMetadata business = 2;
|
|
183
|
-
ContextMetadata context = 3;
|
|
184
|
-
UserMetadata user = 4;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Workspace metadata
|
|
188
|
-
message WorkspaceMetadata {
|
|
189
|
-
int32 file_count = 1;
|
|
190
|
-
repeated string languages = 2;
|
|
191
|
-
string codebase_status = 3;
|
|
192
|
-
string codebase_soft_status = 4;
|
|
193
|
-
string codebase_external_id = 5;
|
|
194
|
-
string data_policy = 6;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Business metadata
|
|
198
|
-
message BusinessMetadata {
|
|
199
|
-
string id = 1;
|
|
200
|
-
string name = 2;
|
|
201
|
-
int64 begin_at = 3;
|
|
202
|
-
string product = 4;
|
|
203
|
-
string version = 5;
|
|
204
|
-
string type = 6;
|
|
205
|
-
string stage = 7;
|
|
206
|
-
string sub_task = 8;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// Context metadata for request tracing and client identification
|
|
210
|
-
message ContextMetadata {
|
|
211
|
-
string request_id = 1;
|
|
212
|
-
string session_id = 2;
|
|
213
|
-
string task_id = 3;
|
|
214
|
-
string request_set_id = 4;
|
|
215
|
-
string machine_id = 5;
|
|
216
|
-
string client_type = 6;
|
|
217
|
-
string source_session_id = 7;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// User metadata
|
|
221
|
-
message UserMetadata {
|
|
222
|
-
string user_id = 1;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Custom model configuration (bring-your-own-key)
|
|
226
|
-
message CustomModelConfig {
|
|
227
|
-
string name = 1;
|
|
228
|
-
string url = 2;
|
|
229
|
-
string style = 3;
|
|
230
|
-
string provider = 4;
|
|
231
|
-
string type = 5;
|
|
232
|
-
string model = 6;
|
|
233
|
-
google.protobuf.Struct parameters = 7;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// Patch to apply to the chat request
|
|
237
|
-
message ChatPatch {
|
|
238
|
-
string cache_id = 1;
|
|
239
|
-
string action = 2;
|
|
240
|
-
google.protobuf.Int32Value position = 3;
|
|
241
|
-
google.protobuf.StringValue content = 4;
|
|
242
|
-
google.protobuf.StringValue name = 5;
|
|
243
|
-
google.protobuf.StringValue rename_to = 6;
|
|
244
|
-
google.protobuf.StringValue description = 7;
|
|
245
|
-
google.protobuf.Struct parameters = 8;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// ─── Response messages ───────────────────────────────────────────────────────
|
|
249
|
-
|
|
250
|
-
// Shared response chat message type (used in both streaming delta and
|
|
251
|
-
// non-streaming message fields)
|
|
252
|
-
message ResponseChatMessage {
|
|
253
|
-
string role = 1;
|
|
254
|
-
string content = 2;
|
|
255
|
-
string reasoning_content = 3;
|
|
256
|
-
repeated google.protobuf.Struct tool_calls = 4;
|
|
257
|
-
google.protobuf.Value reasoning_item = 5;
|
|
258
|
-
google.protobuf.Struct extends = 6;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// Single choice in the non-streaming response
|
|
262
|
-
message NonStreamChoice {
|
|
263
|
-
int32 index = 1;
|
|
264
|
-
ResponseChatMessage message = 2;
|
|
265
|
-
string finish_reason = 3;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Chat completion response (non-streaming)
|
|
269
|
-
message ChatCompletionResponse {
|
|
270
|
-
int64 code = 1;
|
|
271
|
-
string id = 2;
|
|
272
|
-
string object = 3;
|
|
273
|
-
int64 created = 4;
|
|
274
|
-
string model = 5;
|
|
275
|
-
repeated NonStreamChoice choices = 6;
|
|
276
|
-
Usage usage = 7;
|
|
277
|
-
google.protobuf.Struct extras = 8;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// Single choice in the streaming chunk
|
|
281
|
-
message StreamChoice {
|
|
282
|
-
int32 index = 1;
|
|
283
|
-
ResponseChatMessage delta = 2;
|
|
284
|
-
string finish_reason = 3;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// Streaming response chunk
|
|
288
|
-
message ChatCompletionChunk {
|
|
289
|
-
int64 code = 1;
|
|
290
|
-
string id = 2;
|
|
291
|
-
string object = 3;
|
|
292
|
-
int64 created = 4;
|
|
293
|
-
string model = 5;
|
|
294
|
-
repeated StreamChoice choices = 6;
|
|
295
|
-
Usage usage = 7;
|
|
296
|
-
google.protobuf.Struct extras = 8;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Token usage statistics
|
|
300
|
-
message Usage {
|
|
301
|
-
int32 prompt_tokens = 1;
|
|
302
|
-
int32 completion_tokens = 2;
|
|
303
|
-
int32 total_tokens = 3;
|
|
304
|
-
PromptTokensDetails prompt_tokens_details = 4;
|
|
305
|
-
CompletionTokensDetails completion_tokens_details = 5;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// Prompt token details
|
|
309
|
-
message PromptTokensDetails {
|
|
310
|
-
int32 cached_tokens = 1;
|
|
311
|
-
int32 cacheable_tokens = 2;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Completion token details
|
|
315
|
-
message CompletionTokensDetails {
|
|
316
|
-
int32 reasoning_tokens = 1;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// ─── Service definition ──────────────────────────────────────────────────────
|
|
320
|
-
|
|
321
|
-
service ChatService {
|
|
322
|
-
// Unary non-streaming chat completion
|
|
323
|
-
rpc ChatCompletion(ChatCompletionRequest) returns (ChatCompletionResponse);
|
|
324
|
-
|
|
325
|
-
// Server-streaming chat completion; each message is one SSE chunk
|
|
326
|
-
rpc ChatCompletionStream(ChatCompletionRequest) returns (stream ChatCompletionChunk);
|
|
327
|
-
}
|
|
328
|
-
`;
|
|
1
|
+
/**
|
|
2
|
+
* Generated from `vendor/qoder-proto/chat.proto` (Qoder desktop client v1.1.81,
|
|
3
|
+
* `qoder-worker-runtime.mjs`). Do not edit by hand — regenerate from the
|
|
4
|
+
* proto file via `scripts/provider-probing/qoder/dev/gen-chat-proto.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export const CHAT_PROTO_SOURCE = `syntax = "proto3";
|
|
7
|
+
|
|
8
|
+
package model.chat;
|
|
9
|
+
|
|
10
|
+
import "google/protobuf/struct.proto";
|
|
11
|
+
import "google/protobuf/wrappers.proto";
|
|
12
|
+
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option java_package = "com.qoder.grpc.model.chat";
|
|
15
|
+
option java_outer_classname = "ChatProto";
|
|
16
|
+
|
|
17
|
+
// Reasoning effort level for model reasoning
|
|
18
|
+
enum ReasoningEffort {
|
|
19
|
+
REASONING_EFFORT_UNSPECIFIED = 0;
|
|
20
|
+
REASONING_EFFORT_NONE = 1;
|
|
21
|
+
REASONING_EFFORT_LOW = 2;
|
|
22
|
+
REASONING_EFFORT_MEDIUM = 3;
|
|
23
|
+
REASONING_EFFORT_HIGH = 4;
|
|
24
|
+
REASONING_EFFORT_XHIGH = 5;
|
|
25
|
+
REASONING_EFFORT_MAX = 6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ─── Request messages ────────────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
// Chat completion request matching OpenAI-compatible API
|
|
31
|
+
message ChatCompletionRequest {
|
|
32
|
+
string model = 1;
|
|
33
|
+
repeated ChatMessage messages = 2;
|
|
34
|
+
google.protobuf.DoubleValue temperature = 3;
|
|
35
|
+
google.protobuf.DoubleValue top_p = 4;
|
|
36
|
+
google.protobuf.Int32Value max_tokens = 5;
|
|
37
|
+
bool stream = 6;
|
|
38
|
+
repeated string stop = 7;
|
|
39
|
+
google.protobuf.DoubleValue presence_penalty = 8;
|
|
40
|
+
google.protobuf.DoubleValue frequency_penalty = 9;
|
|
41
|
+
google.protobuf.Int32Value n = 10;
|
|
42
|
+
google.protobuf.StringValue user = 11;
|
|
43
|
+
google.protobuf.Int32Value seed = 12;
|
|
44
|
+
Reasoning reasoning = 13;
|
|
45
|
+
google.protobuf.BoolValue parallel_tool_calls = 14;
|
|
46
|
+
map<string, double> logit_bias = 15;
|
|
47
|
+
repeated Tool tools = 16;
|
|
48
|
+
google.protobuf.Value tool_choice = 17;
|
|
49
|
+
ResponseFormat response_format = 18;
|
|
50
|
+
repeated string modalities = 19;
|
|
51
|
+
StreamOptions stream_options = 20;
|
|
52
|
+
map<string, ChatPatchList> patches = 21;
|
|
53
|
+
ChatMetadata metadata = 22;
|
|
54
|
+
google.protobuf.Struct extras = 23;
|
|
55
|
+
CustomModelConfig custom_model = 24;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Wrapper for repeated ChatPatch (used in patches map value)
|
|
59
|
+
message ChatPatchList {
|
|
60
|
+
repeated ChatPatch patches = 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Chat message in the conversation (request side)
|
|
64
|
+
message ChatMessage {
|
|
65
|
+
string cache_id = 1;
|
|
66
|
+
string role = 2;
|
|
67
|
+
// content can be plain text or a list of multimodal content parts
|
|
68
|
+
oneof content_type {
|
|
69
|
+
string text_content = 3;
|
|
70
|
+
ContentPartList parts_content = 12;
|
|
71
|
+
}
|
|
72
|
+
google.protobuf.StringValue name = 4;
|
|
73
|
+
repeated ToolCall tool_calls = 5;
|
|
74
|
+
google.protobuf.StringValue tool_call_id = 6;
|
|
75
|
+
google.protobuf.StringValue tool_call_call_id = 7;
|
|
76
|
+
google.protobuf.StringValue reasoning_content = 8;
|
|
77
|
+
ReasoningItem reasoning_item = 9;
|
|
78
|
+
google.protobuf.Struct extends = 10;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Wrapper for repeated ContentPart
|
|
82
|
+
message ContentPartList {
|
|
83
|
+
repeated ContentPart parts = 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Content part for multimodal messages
|
|
87
|
+
message ContentPart {
|
|
88
|
+
string type = 1;
|
|
89
|
+
google.protobuf.StringValue text = 2;
|
|
90
|
+
ImageUrl image_url = 3;
|
|
91
|
+
InputAudio input_audio = 4;
|
|
92
|
+
CacheControl cache_control = 5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Cache control configuration for content parts
|
|
96
|
+
message CacheControl {
|
|
97
|
+
string type = 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Image URL in message content
|
|
101
|
+
message ImageUrl {
|
|
102
|
+
string url = 1;
|
|
103
|
+
google.protobuf.StringValue detail = 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Audio input in message content
|
|
107
|
+
message InputAudio {
|
|
108
|
+
string data = 1;
|
|
109
|
+
string format = 2;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Reasoning item for model series (e.g. gpt-5)
|
|
113
|
+
message ReasoningItem {
|
|
114
|
+
string id = 1;
|
|
115
|
+
google.protobuf.StringValue encrypted_content = 2;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Streaming options
|
|
119
|
+
message StreamOptions {
|
|
120
|
+
google.protobuf.BoolValue include_usage = 1;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Tool available for the model to call
|
|
124
|
+
message Tool {
|
|
125
|
+
string cache_id = 1;
|
|
126
|
+
string type = 2;
|
|
127
|
+
Function function = 3;
|
|
128
|
+
Advisor advisor = 4;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Function definition
|
|
132
|
+
message Function {
|
|
133
|
+
string name = 1;
|
|
134
|
+
google.protobuf.StringValue description = 2;
|
|
135
|
+
google.protobuf.Struct parameters = 3;
|
|
136
|
+
google.protobuf.BoolValue strict = 4;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Advisor definition
|
|
140
|
+
message Advisor {
|
|
141
|
+
string name = 1;
|
|
142
|
+
string model = 2;
|
|
143
|
+
int32 max_uses = 3;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Tool call made by the assistant
|
|
147
|
+
message ToolCall {
|
|
148
|
+
google.protobuf.StringValue id = 1;
|
|
149
|
+
google.protobuf.StringValue call_id = 2;
|
|
150
|
+
google.protobuf.StringValue type = 3;
|
|
151
|
+
FunctionCall function = 4;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Function call details
|
|
155
|
+
message FunctionCall {
|
|
156
|
+
string name = 1;
|
|
157
|
+
google.protobuf.Value arguments = 2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Reasoning configuration
|
|
161
|
+
message Reasoning {
|
|
162
|
+
ReasoningEffort effort = 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Response format specification
|
|
166
|
+
message ResponseFormat {
|
|
167
|
+
string type = 1;
|
|
168
|
+
JsonSchema json_schema = 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// JSON schema for structured outputs
|
|
172
|
+
message JsonSchema {
|
|
173
|
+
string name = 1;
|
|
174
|
+
google.protobuf.StringValue description = 2;
|
|
175
|
+
google.protobuf.Struct schema = 3;
|
|
176
|
+
google.protobuf.BoolValue strict = 4;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Metadata attached to the chat request
|
|
180
|
+
message ChatMetadata {
|
|
181
|
+
WorkspaceMetadata workspace = 1;
|
|
182
|
+
BusinessMetadata business = 2;
|
|
183
|
+
ContextMetadata context = 3;
|
|
184
|
+
UserMetadata user = 4;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Workspace metadata
|
|
188
|
+
message WorkspaceMetadata {
|
|
189
|
+
int32 file_count = 1;
|
|
190
|
+
repeated string languages = 2;
|
|
191
|
+
string codebase_status = 3;
|
|
192
|
+
string codebase_soft_status = 4;
|
|
193
|
+
string codebase_external_id = 5;
|
|
194
|
+
string data_policy = 6;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Business metadata
|
|
198
|
+
message BusinessMetadata {
|
|
199
|
+
string id = 1;
|
|
200
|
+
string name = 2;
|
|
201
|
+
int64 begin_at = 3;
|
|
202
|
+
string product = 4;
|
|
203
|
+
string version = 5;
|
|
204
|
+
string type = 6;
|
|
205
|
+
string stage = 7;
|
|
206
|
+
string sub_task = 8;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Context metadata for request tracing and client identification
|
|
210
|
+
message ContextMetadata {
|
|
211
|
+
string request_id = 1;
|
|
212
|
+
string session_id = 2;
|
|
213
|
+
string task_id = 3;
|
|
214
|
+
string request_set_id = 4;
|
|
215
|
+
string machine_id = 5;
|
|
216
|
+
string client_type = 6;
|
|
217
|
+
string source_session_id = 7;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// User metadata
|
|
221
|
+
message UserMetadata {
|
|
222
|
+
string user_id = 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Custom model configuration (bring-your-own-key)
|
|
226
|
+
message CustomModelConfig {
|
|
227
|
+
string name = 1;
|
|
228
|
+
string url = 2;
|
|
229
|
+
string style = 3;
|
|
230
|
+
string provider = 4;
|
|
231
|
+
string type = 5;
|
|
232
|
+
string model = 6;
|
|
233
|
+
google.protobuf.Struct parameters = 7;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Patch to apply to the chat request
|
|
237
|
+
message ChatPatch {
|
|
238
|
+
string cache_id = 1;
|
|
239
|
+
string action = 2;
|
|
240
|
+
google.protobuf.Int32Value position = 3;
|
|
241
|
+
google.protobuf.StringValue content = 4;
|
|
242
|
+
google.protobuf.StringValue name = 5;
|
|
243
|
+
google.protobuf.StringValue rename_to = 6;
|
|
244
|
+
google.protobuf.StringValue description = 7;
|
|
245
|
+
google.protobuf.Struct parameters = 8;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// ─── Response messages ───────────────────────────────────────────────────────
|
|
249
|
+
|
|
250
|
+
// Shared response chat message type (used in both streaming delta and
|
|
251
|
+
// non-streaming message fields)
|
|
252
|
+
message ResponseChatMessage {
|
|
253
|
+
string role = 1;
|
|
254
|
+
string content = 2;
|
|
255
|
+
string reasoning_content = 3;
|
|
256
|
+
repeated google.protobuf.Struct tool_calls = 4;
|
|
257
|
+
google.protobuf.Value reasoning_item = 5;
|
|
258
|
+
google.protobuf.Struct extends = 6;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Single choice in the non-streaming response
|
|
262
|
+
message NonStreamChoice {
|
|
263
|
+
int32 index = 1;
|
|
264
|
+
ResponseChatMessage message = 2;
|
|
265
|
+
string finish_reason = 3;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Chat completion response (non-streaming)
|
|
269
|
+
message ChatCompletionResponse {
|
|
270
|
+
int64 code = 1;
|
|
271
|
+
string id = 2;
|
|
272
|
+
string object = 3;
|
|
273
|
+
int64 created = 4;
|
|
274
|
+
string model = 5;
|
|
275
|
+
repeated NonStreamChoice choices = 6;
|
|
276
|
+
Usage usage = 7;
|
|
277
|
+
google.protobuf.Struct extras = 8;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Single choice in the streaming chunk
|
|
281
|
+
message StreamChoice {
|
|
282
|
+
int32 index = 1;
|
|
283
|
+
ResponseChatMessage delta = 2;
|
|
284
|
+
string finish_reason = 3;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Streaming response chunk
|
|
288
|
+
message ChatCompletionChunk {
|
|
289
|
+
int64 code = 1;
|
|
290
|
+
string id = 2;
|
|
291
|
+
string object = 3;
|
|
292
|
+
int64 created = 4;
|
|
293
|
+
string model = 5;
|
|
294
|
+
repeated StreamChoice choices = 6;
|
|
295
|
+
Usage usage = 7;
|
|
296
|
+
google.protobuf.Struct extras = 8;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// Token usage statistics
|
|
300
|
+
message Usage {
|
|
301
|
+
int32 prompt_tokens = 1;
|
|
302
|
+
int32 completion_tokens = 2;
|
|
303
|
+
int32 total_tokens = 3;
|
|
304
|
+
PromptTokensDetails prompt_tokens_details = 4;
|
|
305
|
+
CompletionTokensDetails completion_tokens_details = 5;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Prompt token details
|
|
309
|
+
message PromptTokensDetails {
|
|
310
|
+
int32 cached_tokens = 1;
|
|
311
|
+
int32 cacheable_tokens = 2;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Completion token details
|
|
315
|
+
message CompletionTokensDetails {
|
|
316
|
+
int32 reasoning_tokens = 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// ─── Service definition ──────────────────────────────────────────────────────
|
|
320
|
+
|
|
321
|
+
service ChatService {
|
|
322
|
+
// Unary non-streaming chat completion
|
|
323
|
+
rpc ChatCompletion(ChatCompletionRequest) returns (ChatCompletionResponse);
|
|
324
|
+
|
|
325
|
+
// Server-streaming chat completion; each message is one SSE chunk
|
|
326
|
+
rpc ChatCompletionStream(ChatCompletionRequest) returns (stream ChatCompletionChunk);
|
|
327
|
+
}
|
|
328
|
+
`;
|