cartethyia 2.4.6 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/README.md +45 -13
  2. package/dist/dashboard/assets/BannedPage-9igfctfZ.js +1 -0
  3. package/dist/dashboard/assets/BannedPage-9igfctfZ.js.gz +0 -0
  4. package/dist/dashboard/assets/{CliToolDetailPage-Bcy150Jo.js → CliToolDetailPage-ZRr2K2sF.js} +1 -1
  5. package/dist/dashboard/assets/CliToolDetailPage-ZRr2K2sF.js.gz +0 -0
  6. package/dist/dashboard/assets/{CliToolsPage-DyNXefph.js → CliToolsPage-D3xqZbN-.js} +1 -1
  7. package/dist/dashboard/assets/CliToolsPage-D3xqZbN-.js.gz +0 -0
  8. package/dist/dashboard/assets/CombosPage-CVnQPBBz.js +1 -0
  9. package/dist/dashboard/assets/CombosPage-CVnQPBBz.js.gz +0 -0
  10. package/dist/dashboard/assets/{ConsoleLogPage-CATpAEOz.js → ConsoleLogPage-u6W1UXSc.js} +1 -1
  11. package/dist/dashboard/assets/ConsoleLogPage-u6W1UXSc.js.gz +0 -0
  12. package/dist/dashboard/assets/{CustomizationPage-D6jEU7nL.js → CustomizationPage-CTTpCb25.js} +1 -1
  13. package/dist/dashboard/assets/CustomizationPage-CTTpCb25.js.gz +0 -0
  14. package/dist/dashboard/assets/{HealthEventsModal-CZkpn0a7.js → HealthEventsModal-C5XpWlvy.js} +1 -1
  15. package/dist/dashboard/assets/HealthEventsModal-C5XpWlvy.js.gz +0 -0
  16. package/dist/dashboard/assets/{LoginPage-BJlMVN4U.js → LoginPage-DHoB3Agn.js} +1 -1
  17. package/dist/dashboard/assets/LoginPage-DHoB3Agn.js.gz +0 -0
  18. package/dist/dashboard/assets/{ModelPicker-Br3CXEau.js → ModelPicker-oQ-SDXp8.js} +1 -1
  19. package/dist/dashboard/assets/ModelPicker-oQ-SDXp8.js.gz +0 -0
  20. package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js +1 -0
  21. package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js.gz +0 -0
  22. package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js +3 -0
  23. package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js.gz +0 -0
  24. package/dist/dashboard/assets/ProviderIcon-CmfzxpVM.js +1 -0
  25. package/dist/dashboard/assets/ProviderIcon-CmfzxpVM.js.gz +0 -0
  26. package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js +1 -0
  27. package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js.gz +0 -0
  28. package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js +7 -0
  29. package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js.gz +0 -0
  30. package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js +1 -0
  31. package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js.gz +0 -0
  32. package/dist/dashboard/assets/{SettingsPage-BHW4Zt06.js → SettingsPage-CvjZxHE4.js} +1 -1
  33. package/dist/dashboard/assets/SettingsPage-CvjZxHE4.js.gz +0 -0
  34. package/dist/dashboard/assets/{SetupPage-VOYC_lIa.js → SetupPage-D3nza7LH.js} +1 -1
  35. package/dist/dashboard/assets/SetupPage-D3nza7LH.js.gz +0 -0
  36. package/dist/dashboard/assets/SortableList-Dtt12WT1.js +1 -0
  37. package/dist/dashboard/assets/SortableList-Dtt12WT1.js.gz +0 -0
  38. package/dist/dashboard/assets/{StudioPage-BNIDLiU6.js → StudioPage-CbK3hXvU.js} +4 -4
  39. package/dist/dashboard/assets/StudioPage-CbK3hXvU.js.gz +0 -0
  40. package/dist/dashboard/assets/UsagePage-BQlWbWg2.js +56 -0
  41. package/dist/dashboard/assets/UsagePage-BQlWbWg2.js.gz +0 -0
  42. package/dist/dashboard/assets/{api-keys-BETfaMYZ.js → api-keys-BmDbsior.js} +1 -1
  43. package/dist/dashboard/assets/api-keys-BmDbsior.js.gz +0 -0
  44. package/dist/dashboard/assets/app-BbpSarVV.css +2 -0
  45. package/dist/dashboard/assets/app-BbpSarVV.css.gz +0 -0
  46. package/dist/dashboard/assets/assert-BHfaei-X.js +1 -0
  47. package/dist/dashboard/assets/assert-BHfaei-X.js.gz +0 -0
  48. package/dist/dashboard/assets/{badge-BTyGk_DL.js → badge-DpXT4Ixt.js} +1 -1
  49. package/dist/dashboard/assets/badge-DpXT4Ixt.js.gz +0 -0
  50. package/dist/dashboard/assets/{banner-bujTWYM4.js → banner-CSAAWLJv.js} +1 -1
  51. package/dist/dashboard/assets/banner-CSAAWLJv.js.gz +0 -0
  52. package/dist/dashboard/assets/{card-B0Bnx5CA.js → card-DEhRXXw4.js} +1 -1
  53. package/dist/dashboard/assets/card-DEhRXXw4.js.gz +0 -0
  54. package/dist/dashboard/assets/{cli-tools-DE2ug812.js → cli-tools-B0wBq-RL.js} +1 -1
  55. package/dist/dashboard/assets/cli-tools-B0wBq-RL.js.gz +0 -0
  56. package/dist/dashboard/assets/{clipboard-button-R_rArH8S.js → clipboard-button-DOo6EU8O.js} +1 -1
  57. package/dist/dashboard/assets/clipboard-button-DOo6EU8O.js.gz +0 -0
  58. package/dist/dashboard/assets/{dialog-BWIP_EvW.js → dialog-BvQeBMfP.js} +1 -1
  59. package/dist/dashboard/assets/dialog-BvQeBMfP.js.gz +0 -0
  60. package/dist/dashboard/assets/{drawer-BKcgVugF.js → drawer-CMwPXwQB.js} +1 -1
  61. package/dist/dashboard/assets/drawer-CMwPXwQB.js.gz +0 -0
  62. package/dist/dashboard/assets/{entry-CcWkGR4a.js → entry-D4O2229X.js} +1 -1
  63. package/dist/dashboard/assets/{entry-CcWkGR4a.js.gz → entry-D4O2229X.js.gz} +0 -0
  64. package/dist/dashboard/assets/{entry-kTiTFrvh.js → entry-DKvr5Q9K.js} +1 -1
  65. package/dist/dashboard/assets/entry-DKvr5Q9K.js.gz +0 -0
  66. package/dist/dashboard/assets/entry-FQCejoDY.js +4 -0
  67. package/dist/dashboard/assets/entry-FQCejoDY.js.gz +0 -0
  68. package/dist/dashboard/assets/{github-badge-Booc5mNe.js → github-badge-zliLvBwr.js} +1 -1
  69. package/dist/dashboard/assets/github-badge-zliLvBwr.js.gz +0 -0
  70. package/dist/dashboard/assets/{index-D70pChfn.js → index-CXm3FIyt.js} +2 -2
  71. package/dist/dashboard/assets/index-CXm3FIyt.js.gz +0 -0
  72. package/dist/dashboard/assets/{inline-D1TCqM2D.js → inline-D1IlZZ8H.js} +1 -1
  73. package/dist/dashboard/assets/inline-D1IlZZ8H.js.gz +0 -0
  74. package/dist/dashboard/assets/{input-B9oyU93y.js → input-BpVZdrbc.js} +1 -1
  75. package/dist/dashboard/assets/input-BpVZdrbc.js.gz +0 -0
  76. package/dist/dashboard/assets/{layout-BArzXirQ.js → layout-BioLW7gN.js} +1 -1
  77. package/dist/dashboard/assets/layout-BioLW7gN.js.gz +0 -0
  78. package/dist/dashboard/assets/{list-row-BVZzaoHF.js → list-row-CwVcGAIc.js} +1 -1
  79. package/dist/dashboard/assets/list-row-CwVcGAIc.js.gz +0 -0
  80. package/dist/dashboard/assets/{live-EmuIayqp.js → live-yfEJFF9T.js} +1 -1
  81. package/dist/dashboard/assets/live-yfEJFF9T.js.gz +0 -0
  82. package/dist/dashboard/assets/{model-bans-CSPQ9xB0.js → model-bans-CT-TxSNX.js} +1 -1
  83. package/dist/dashboard/assets/model-bans-CT-TxSNX.js.gz +0 -0
  84. package/dist/dashboard/assets/providers/cursor.webp +0 -0
  85. package/dist/dashboard/assets/providers/trae.webp +0 -0
  86. package/dist/dashboard/assets/{routing-BExgxxBU.js → routing-Cs6jl49L.js} +1 -1
  87. package/dist/dashboard/assets/routing-Cs6jl49L.js.gz +0 -0
  88. package/dist/dashboard/assets/select-C0Rer3gF.js +41 -0
  89. package/dist/dashboard/assets/select-C0Rer3gF.js.gz +0 -0
  90. package/dist/dashboard/assets/settings-CfcTcOyU.js +1 -0
  91. package/dist/dashboard/assets/settings-CfcTcOyU.js.gz +0 -0
  92. package/dist/dashboard/assets/{stack-Ca5HxI5i.js → stack-C9_uUjaA.js} +1 -1
  93. package/dist/dashboard/assets/stack-C9_uUjaA.js.gz +0 -0
  94. package/dist/dashboard/assets/{state-CzUPfLXo.js → state-DA0B95UQ.js} +1 -1
  95. package/dist/dashboard/assets/state-DA0B95UQ.js.gz +0 -0
  96. package/dist/dashboard/assets/{switch-DOUIky_i.js → switch-Cittxy-x.js} +1 -1
  97. package/dist/dashboard/assets/switch-Cittxy-x.js.gz +0 -0
  98. package/dist/dashboard/assets/{toast-C76WrMhc.js → toast-CNt_jzO4.js} +1 -1
  99. package/dist/dashboard/assets/toast-CNt_jzO4.js.gz +0 -0
  100. package/dist/dashboard/assets/{useMutation-D87FZwH0.js → useMutation-BQKMcJ1H.js} +1 -1
  101. package/dist/dashboard/assets/useMutation-BQKMcJ1H.js.gz +0 -0
  102. package/dist/dashboard/index.html +1 -1
  103. package/dist/dashboard/index.html.gz +0 -0
  104. package/dist/dashboard/precompressed-assets.json +51 -52
  105. package/migrations/full-postgres/0015_add_payload_stages.sql +18 -0
  106. package/migrations/full-postgres/0016_add_share_link_slug.sql +20 -0
  107. package/migrations/full-postgres/0017_add_models_pro_only.sql +18 -0
  108. package/migrations/full-postgres/0018_add_accounts_quota_plan.sql +18 -0
  109. package/migrations/full-postgres/0019_add_models_free_tier.sql +15 -0
  110. package/migrations/lite-sqlite3/0015_add_payload_stages.sql +18 -0
  111. package/migrations/lite-sqlite3/0016_add_share_link_slug.sql +20 -0
  112. package/migrations/lite-sqlite3/0017_add_models_pro_only.sql +18 -0
  113. package/migrations/lite-sqlite3/0018_add_accounts_quota_plan.sql +18 -0
  114. package/migrations/lite-sqlite3/0019_add_models_free_tier.sql +15 -0
  115. package/package.json +3 -2
  116. package/scripts/cli/command/console-menu.ts +30 -11
  117. package/scripts/cli/command/start.ts +77 -13
  118. package/scripts/cli/command/update.ts +1 -1
  119. package/scripts/cli/gateway/instance-lock.ts +105 -0
  120. package/scripts/cli/gateway/spawn.ts +173 -101
  121. package/scripts/cli/ui/background.ts +110 -49
  122. package/src/boot/app.ts +20 -6
  123. package/src/boot/dependencies.ts +19 -0
  124. package/src/boot/elysia-typebox-bridge.ts +37 -0
  125. package/src/boot/lifecycle.ts +2 -0
  126. package/src/config/cooldowns.ts +138 -138
  127. package/src/config/providers.ts +5 -5
  128. package/src/config/runtime.ts +19 -3
  129. package/src/config/spec.ts +9 -0
  130. package/src/console/api-keys/contracts.ts +414 -391
  131. package/src/console/api-keys/routes.ts +880 -870
  132. package/src/console/auth/account-reset-store.ts +14 -0
  133. package/src/console/auth/account-reset.ts +3 -2
  134. package/src/console/auth/setup-service.ts +6 -3
  135. package/src/console/domain-registration.ts +9 -2
  136. package/src/console/observability/contracts.ts +475 -455
  137. package/src/console/observability/store.ts +1015 -952
  138. package/src/console/providers/catalog/contracts.ts +31 -0
  139. package/src/console/providers/catalog/provider-operations.ts +8 -0
  140. package/src/console/providers/catalog/store.ts +1532 -1525
  141. package/src/console/providers/oauth/callback-listener.ts +18 -3
  142. package/src/console/providers/oauth/routes.ts +38 -15
  143. package/src/console/quota/refresh.ts +19 -0
  144. package/src/console/updates/routes.ts +162 -4
  145. package/src/main.ts +3 -0
  146. package/src/network/http2-bidi.ts +85 -0
  147. package/src/network/outbound-fetch.ts +1 -26
  148. package/src/network/pool/agent.ts +478 -460
  149. package/src/network/pool/resolver.ts +1104 -544
  150. package/src/network/pool-health-machine.ts +12 -5
  151. package/src/observability/payload-capture.ts +344 -324
  152. package/src/persistence/db-pg.ts +9 -3
  153. package/src/persistence/db-sqlite.ts +497 -495
  154. package/src/persistence/health-event-flush.ts +137 -0
  155. package/src/persistence/migrate.ts +181 -129
  156. package/src/persistence/schema.ts +1360 -1295
  157. package/src/persistence/settings-revision.ts +25 -0
  158. package/src/persistence/shared-cache.ts +217 -0
  159. package/src/persistence/stores/share-store.ts +556 -528
  160. package/src/persistence/usage-flush.ts +61 -1
  161. package/src/protocol/canonical-model.ts +23 -1
  162. package/src/protocol/response/chat.ts +143 -10
  163. package/src/protocol/response/omp-tool-call-markup.ts +221 -0
  164. package/src/providers/default-registry.ts +173 -1
  165. package/src/providers/discovery/openai-model-discovery.ts +39 -3
  166. package/src/providers/discovery/openrouter-free-roster.ts +98 -0
  167. package/src/providers/discovery/probing-service.ts +1022 -1001
  168. package/src/providers/integrations/buddy/buddy-catalog-shared.ts +39 -0
  169. package/src/providers/integrations/buddy/buddy-chat-shared.ts +913 -914
  170. package/src/providers/integrations/buddy/buddy-conversation-headers.ts +18 -5
  171. package/src/providers/integrations/buddy/codebuddy/cn-provider.ts +4 -0
  172. package/src/providers/integrations/buddy/codebuddy/provider.ts +180 -175
  173. package/src/providers/integrations/buddy/codebuddy/shared.ts +15 -6
  174. package/src/providers/integrations/buddy/workbuddy/provider.ts +206 -204
  175. package/src/providers/integrations/buddy/workbuddy/shared.ts +3 -3
  176. package/src/providers/integrations/claude/claude.ts +606 -582
  177. package/src/providers/integrations/cline/cline-quota.ts +18 -16
  178. package/src/providers/integrations/cline/cline.ts +539 -468
  179. package/src/providers/integrations/commandcode/commandcode.ts +675 -541
  180. package/src/providers/integrations/commandcode/discovery.ts +116 -0
  181. package/src/providers/integrations/commandcode/quota.ts +160 -0
  182. package/src/providers/integrations/cursor/cursor-auth.ts +418 -0
  183. package/src/providers/integrations/cursor/cursor-catalog.ts +368 -0
  184. package/src/providers/integrations/cursor/cursor-http2.ts +300 -0
  185. package/src/providers/integrations/cursor/cursor-identity.ts +92 -0
  186. package/src/providers/integrations/cursor/cursor-request.ts +471 -0
  187. package/src/providers/integrations/cursor/cursor-session-manager.ts +281 -0
  188. package/src/providers/integrations/cursor/cursor-shared.ts +108 -0
  189. package/src/providers/integrations/cursor/cursor.ts +960 -0
  190. package/src/providers/integrations/cursor/protocol/framing.ts +129 -0
  191. package/src/providers/integrations/cursor/protocol/messages.ts +2355 -0
  192. package/src/providers/integrations/cursor/protocol/struct.ts +305 -0
  193. package/src/providers/integrations/github/github.ts +4 -4
  194. package/src/providers/integrations/hermes.ts +79 -8
  195. package/src/providers/integrations/kilo/kilo-discovery.ts +10 -1
  196. package/src/providers/integrations/kilo/kilo.ts +153 -146
  197. package/src/providers/integrations/opencode/provider.ts +532 -538
  198. package/src/providers/integrations/openrouter/provider.ts +139 -281
  199. package/src/providers/integrations/qoder/qoder-catalog.ts +450 -0
  200. package/src/providers/integrations/qoder/qoder-oauth.ts +310 -257
  201. package/src/providers/integrations/qoder/qoder-realm.ts +106 -0
  202. package/src/providers/integrations/qoder/qoder-virtual.ts +77 -0
  203. package/src/providers/integrations/qoder/qoder.ts +865 -730
  204. package/src/providers/integrations/trae/trae-catalog.ts +190 -0
  205. package/src/providers/integrations/trae/trae-headers.ts +149 -0
  206. package/src/providers/integrations/trae/trae-oauth.ts +773 -0
  207. package/src/providers/integrations/trae/trae-protocol.ts +400 -0
  208. package/src/providers/integrations/trae/trae-realm.ts +220 -0
  209. package/src/providers/integrations/trae/trae.ts +458 -0
  210. package/src/providers/operations/account-health-service.ts +107 -10
  211. package/src/providers/operations/client-versions.ts +133 -6
  212. package/src/providers/operations/provider-catalog-seeder.ts +95 -86
  213. package/src/providers/operations/provider-credential-service.ts +46 -7
  214. package/src/providers/provider-contracts.ts +76 -0
  215. package/src/providers/provider-metadata.ts +78 -6
  216. package/src/providers/provider-model-definition.ts +373 -349
  217. package/src/security/api-key-auth.ts +126 -8
  218. package/src/transport/contracts.ts +3 -0
  219. package/src/transport/dispatch/attempt-finalize.ts +32 -1
  220. package/src/transport/dispatch/attempt-loop.ts +530 -515
  221. package/src/transport/dispatch/generation.ts +88 -21
  222. package/src/transport/dispatch/leases.ts +99 -2
  223. package/src/transport/dispatch/proxy-request.ts +60 -3
  224. package/src/transport/dispatch/streaming/finalize.ts +16 -1
  225. package/src/transport/dispatch/streaming/stream.ts +22 -2
  226. package/src/transport/dispatch/upstream.ts +19 -1
  227. package/src/transport/guards/auth-guard.ts +26 -1
  228. package/src/transport/guards/body-policy.ts +5 -4
  229. package/src/transport/request/preparer.ts +103 -0
  230. package/src/transport/request/state.ts +14 -0
  231. package/src/transport/routing/plan-gate.ts +45 -0
  232. package/src/transport/routing/route-catalog.ts +799 -777
  233. package/src/transport/routing/route-model.ts +52 -1
  234. package/src/transport/routing/router.ts +51 -0
  235. package/dist/dashboard/assets/BannedPage-QhvbJB9o.js +0 -1
  236. package/dist/dashboard/assets/BannedPage-QhvbJB9o.js.gz +0 -0
  237. package/dist/dashboard/assets/CliToolDetailPage-Bcy150Jo.js.gz +0 -0
  238. package/dist/dashboard/assets/CliToolsPage-DyNXefph.js.gz +0 -0
  239. package/dist/dashboard/assets/CombosPage-Cak0ljnO.js +0 -1
  240. package/dist/dashboard/assets/CombosPage-Cak0ljnO.js.gz +0 -0
  241. package/dist/dashboard/assets/ConsoleLogPage-CATpAEOz.js.gz +0 -0
  242. package/dist/dashboard/assets/CustomizationPage-D6jEU7nL.js.gz +0 -0
  243. package/dist/dashboard/assets/HealthEventsModal-CZkpn0a7.js.gz +0 -0
  244. package/dist/dashboard/assets/LoginPage-BJlMVN4U.js.gz +0 -0
  245. package/dist/dashboard/assets/ModelPicker-Br3CXEau.js.gz +0 -0
  246. package/dist/dashboard/assets/OverviewPage-CQxXbo2g.js +0 -1
  247. package/dist/dashboard/assets/OverviewPage-CQxXbo2g.js.gz +0 -0
  248. package/dist/dashboard/assets/ProviderDetailPage--0RBNh99.js +0 -3
  249. package/dist/dashboard/assets/ProviderDetailPage--0RBNh99.js.gz +0 -0
  250. package/dist/dashboard/assets/ProviderIcon-paOCq8I0.js +0 -1
  251. package/dist/dashboard/assets/ProviderIcon-paOCq8I0.js.gz +0 -0
  252. package/dist/dashboard/assets/ProvidersPage-1M-C3mbu.js +0 -1
  253. package/dist/dashboard/assets/ProvidersPage-1M-C3mbu.js.gz +0 -0
  254. package/dist/dashboard/assets/ProxyPage-CXiumA53.js +0 -7
  255. package/dist/dashboard/assets/ProxyPage-CXiumA53.js.gz +0 -0
  256. package/dist/dashboard/assets/QuotaPage-BGDIfIYP.js +0 -1
  257. package/dist/dashboard/assets/QuotaPage-BGDIfIYP.js.gz +0 -0
  258. package/dist/dashboard/assets/SettingsPage-BHW4Zt06.js.gz +0 -0
  259. package/dist/dashboard/assets/SetupPage-VOYC_lIa.js.gz +0 -0
  260. package/dist/dashboard/assets/SortableList-DpOTnGuH.js +0 -1
  261. package/dist/dashboard/assets/SortableList-DpOTnGuH.js.gz +0 -0
  262. package/dist/dashboard/assets/StudioPage-BNIDLiU6.js.gz +0 -0
  263. package/dist/dashboard/assets/UsagePage-BAFaSDQV.js +0 -56
  264. package/dist/dashboard/assets/UsagePage-BAFaSDQV.js.gz +0 -0
  265. package/dist/dashboard/assets/api-keys-BETfaMYZ.js.gz +0 -0
  266. package/dist/dashboard/assets/app-BLCvGdzb.css +0 -2
  267. package/dist/dashboard/assets/app-BLCvGdzb.css.gz +0 -0
  268. package/dist/dashboard/assets/assert-7J6_LVD3.js +0 -1
  269. package/dist/dashboard/assets/assert-7J6_LVD3.js.gz +0 -0
  270. package/dist/dashboard/assets/badge-BTyGk_DL.js.gz +0 -0
  271. package/dist/dashboard/assets/banner-bujTWYM4.js.gz +0 -0
  272. package/dist/dashboard/assets/card-B0Bnx5CA.js.gz +0 -0
  273. package/dist/dashboard/assets/cli-tools-DE2ug812.js.gz +0 -0
  274. package/dist/dashboard/assets/clipboard-button-R_rArH8S.js.gz +0 -0
  275. package/dist/dashboard/assets/dialog-BWIP_EvW.js.gz +0 -0
  276. package/dist/dashboard/assets/drawer-BKcgVugF.js.gz +0 -0
  277. package/dist/dashboard/assets/entry-7dpgvpJ3.js +0 -4
  278. package/dist/dashboard/assets/entry-7dpgvpJ3.js.gz +0 -0
  279. package/dist/dashboard/assets/entry-kTiTFrvh.js.gz +0 -0
  280. package/dist/dashboard/assets/github-badge-Booc5mNe.js.gz +0 -0
  281. package/dist/dashboard/assets/index-D70pChfn.js.gz +0 -0
  282. package/dist/dashboard/assets/inline-D1TCqM2D.js.gz +0 -0
  283. package/dist/dashboard/assets/input-B9oyU93y.js.gz +0 -0
  284. package/dist/dashboard/assets/layout-BArzXirQ.js.gz +0 -0
  285. package/dist/dashboard/assets/list-row-BVZzaoHF.js.gz +0 -0
  286. package/dist/dashboard/assets/live-EmuIayqp.js.gz +0 -0
  287. package/dist/dashboard/assets/model-bans-CSPQ9xB0.js.gz +0 -0
  288. package/dist/dashboard/assets/routing-BExgxxBU.js.gz +0 -0
  289. package/dist/dashboard/assets/select-C9mMoEpJ.js +0 -41
  290. package/dist/dashboard/assets/select-C9mMoEpJ.js.gz +0 -0
  291. package/dist/dashboard/assets/settings-C4_Gn_wq.js +0 -1
  292. package/dist/dashboard/assets/settings-C4_Gn_wq.js.gz +0 -0
  293. package/dist/dashboard/assets/sliders-horizontal-ClG7dBeJ.js +0 -1
  294. package/dist/dashboard/assets/sliders-horizontal-ClG7dBeJ.js.gz +0 -0
  295. package/dist/dashboard/assets/stack-Ca5HxI5i.js.gz +0 -0
  296. package/dist/dashboard/assets/state-CzUPfLXo.js.gz +0 -0
  297. package/dist/dashboard/assets/switch-DOUIky_i.js.gz +0 -0
  298. package/dist/dashboard/assets/toast-C76WrMhc.js.gz +0 -0
  299. package/dist/dashboard/assets/useMutation-D87FZwH0.js.gz +0 -0
  300. package/src/network/tls/bun-client-hello.ts +0 -112
  301. /package/dist/dashboard/assets/{app-Cjq7nrwu.js → app-C-Y4oZT0.js} +0 -0
  302. /package/dist/dashboard/assets/{app-Cjq7nrwu.js.gz → app-C-Y4oZT0.js.gz} +0 -0
@@ -1,204 +1,206 @@
1
- // WorkBuddy international adapter — exact provider contract.
2
- // Canonical provider ID: workbuddy
3
- // Base (manifest-owned) → Chat: base + /v2/chat/completions
4
- // Auth: Authorization Bearer for both api_key and oauth
5
- // Stream: force stream=true upstream, factory reaggregates for non-stream callers
6
- // Headers: official desktop-client identity (WorkBuddy AI brand) with fresh
7
- // correlation IDs + account-stable device headers per dispatch
8
- // Payload: leading WorkBuddy system prompt + typed user content, reasoning_summary
9
- // auto only when reasoning_effort requested
10
-
11
- import { BuddyMediaAdapter } from "../buddy-media";
12
- import { providerBaseUrl } from "../../../provider-metadata";
13
- import { GatewayError } from "../../../../protocol/gateway-error";
14
- import type { CanonicalRequest } from "../../../../protocol/canonical-model";
15
- import type { ProviderAdapter, ProviderDispatchContext, ProviderDispatchTarget } from "../../../provider-contracts";
16
- import type { ModelDefinition } from "../../../provider-model-definition";
17
- import type { DiscoveryInput } from "../../../discovery/discovery-types";
18
- import {
19
- WORKBUDDY_CHAT_PATH,
20
- workbuddyAdapterConfig,
21
- workbuddyHeaders,
22
- } from "./shared";
23
- import {
24
- BUDDY_SHARED_RAW,
25
- BUDDY_IMAGE_MODEL_ID_SET,
26
- BUDDY_VIDEO_MODEL_ID_SET,
27
- makeBuddyModel,
28
- makeBuddyImageModels,
29
- makeBuddyVideoModels,
30
- type BuddyRawEntry,
31
- } from "../buddy-catalog-shared";
32
- import { BUDDY_INTL_MODELS_PATH, fetchBuddyDirectoryModels } from "../buddy-discovery-shared";
33
- import {
34
- applyBuddySystemPrompt,
35
- buddyPrePayloadCommon,
36
- normalizeBuddyToolNames,
37
- } from "../buddy-chat-shared";
38
-
39
- // Constants — public contract
40
- export const WORKBUDDY_PROVIDER_ID = "workbuddy" as const;
41
- export const WORKBUDDY_BASE_URL = providerBaseUrl("workbuddy");
42
-
43
- // Payload hook — provider semantics
44
- // - force stream=true
45
- // - reasoning_summary auto only when reasoning_effort requested
46
- // - leading WorkBuddy system prompt + typed user content normalization
47
-
48
- /**
49
- * Leading system turn for this variant.
50
- *
51
- * The upstream does validate the leading system turn's *text*, not just that
52
- * the wire opens with one: sending caller text in its place answers
53
- * `400 · 11128 "Illegal API invocation from an unapproved channel"` on
54
- * CodeBuddy, which treats that prompt as the calling channel's identity. So
55
- * this prompt is a wire contract, not merely a product choice — see the
56
- * sibling in `codebuddy.ts`. The previous line named the vendor product, which
57
- * made every request claim an identity the caller never chose.
58
- */
59
- export const WORKBUDDY_SYSTEM_PROMPT =
60
- "You are a pragmatic and direct software engineering assistant. " +
61
- "Be honest and truthful: state what you know, say plainly when you are unsure " +
62
- "or do not know, and never claim to have done something you have not done. " +
63
- "Prefer concrete answers over filler, and say so when a request is ambiguous " +
64
- "instead of guessing silently.";
65
-
66
- /**
67
- * Reconstructs generic function declarations when a later tool-history turn
68
- * arrives without the client's current `tools` array. WorkBuddy validates the
69
- * Chat Completions envelope against every historical tool call, so forwarding
70
- * `tool_calls`/`tool` messages without declarations yields model_param_invalid.
71
- */
72
- function restoreHistoricalToolDefinitions(
73
- payload: Record<string, unknown>,
74
- messages: readonly Record<string, unknown>[],
75
- ): void {
76
- const historicalNames = new Set<string>();
77
- for (const message of messages) {
78
- if (message["role"] !== "assistant" || !Array.isArray(message["tool_calls"])) continue;
79
- for (const rawCall of message["tool_calls"]) {
80
- if (!rawCall || typeof rawCall !== "object") continue;
81
- const call = rawCall as Record<string, unknown>;
82
- const functionValue =
83
- call["function"] && typeof call["function"] === "object"
84
- ? (call["function"] as Record<string, unknown>)
85
- : undefined;
86
- const name = functionValue?.["name"];
87
- if (typeof name === "string" && name.trim().length > 0) historicalNames.add(name);
88
- }
89
- }
90
- if (historicalNames.size === 0) return;
91
-
92
- const existing = Array.isArray(payload["tools"])
93
- ? (payload["tools"] as Array<Record<string, unknown>>)
94
- : [];
95
- const definedNames = new Set<string>();
96
- for (const rawTool of existing) {
97
- if (!rawTool || typeof rawTool !== "object") continue;
98
- const tool = rawTool as Record<string, unknown>;
99
- const functionValue =
100
- tool["function"] && typeof tool["function"] === "object"
101
- ? (tool["function"] as Record<string, unknown>)
102
- : tool;
103
- if (typeof functionValue["name"] === "string") definedNames.add(functionValue["name"]);
104
- }
105
- const recovered = [...historicalNames]
106
- .filter((name) => !definedNames.has(name))
107
- .map((name) => ({
108
- type: "function",
109
- function: {
110
- name,
111
- description: "Recovered from historical tool calls.",
112
- parameters: { type: "object", additionalProperties: true },
113
- },
114
- }));
115
- if (recovered.length > 0) payload["tools"] = [...existing, ...recovered];
116
- }
117
-
118
-
119
- export function workbuddyPrePayload(
120
- payload: Record<string, unknown>,
121
- request: CanonicalRequest,
122
- candidate: ProviderDispatchTarget,
123
- context?: ProviderDispatchContext,
124
- ): void {
125
- // International ladder. This hook is shared by `workbuddy` and `workbuddycn`
126
- // (see workbuddy/cn-provider.ts): the CN effort ladders in the reference
127
- // gateways are a CodeBuddy-CN concern, so `workbuddycn` deliberately stays on
128
- // the intl table. Switch to `"cn"` only if a live CN WorkBuddy account proves
129
- // it serves levels the intl table clamps.
130
- buddyPrePayloadCommon(payload, request, "intl", context);
131
- const rawModel = payload["model"];
132
- const source =
133
- typeof rawModel === "string" && rawModel.length > 0 ? rawModel : candidate.model_id;
134
- if (!source) throw new GatewayError("invalid_request", 400, "WorkBuddy model is required");
135
- const messages = payload["messages"];
136
- if (Array.isArray(messages)) {
137
- const normalizedMessages = messages as Array<Record<string, unknown>>;
138
- applyBuddySystemPrompt(normalizedMessages, WORKBUDDY_SYSTEM_PROMPT);
139
- restoreHistoricalToolDefinitions(payload, normalizedMessages);
140
- }
141
- normalizeBuddyToolNames(payload);
142
- void request;
143
- }
144
-
145
- // Model catalog — WorkBuddy international catalog.
146
- // Static seed derived from the reference gateway's model.json (context/output
147
- // limits) plus its global effort table; `reasoning` marks models with a
148
- // declared reasoning-effort scale.
149
- const WORKBUDDY_RAW: readonly BuddyRawEntry[] = BUDDY_SHARED_RAW;
150
-
151
- export function makeWorkBuddyModels(providerId: "workbuddy" | "workbuddycn"): readonly ModelDefinition[] {
152
- return [
153
- ...WORKBUDDY_RAW.filter(
154
- (entry) => !BUDDY_IMAGE_MODEL_ID_SET.has(entry[0]) && !BUDDY_VIDEO_MODEL_ID_SET.has(entry[0]),
155
- ).map((entry) => makeBuddyModel(entry, providerId, WORKBUDDY_CHAT_PATH)),
156
- // WorkBuddy's base URL carries no version segment, so the image rows need the
157
- // same explicit path the chat rows use — the generic default would produce a
158
- // URL this upstream answers with a 405.
159
- ...makeBuddyImageModels(providerId, WORKBUDDY_CHAT_PATH),
160
- ...makeBuddyVideoModels(providerId, "/v2/videos/generations"),
161
- ];
162
- }
163
-
164
- export const WORKBUDDY_MODELS: readonly ModelDefinition[] = makeWorkBuddyModels("workbuddy");
165
-
166
- /**
167
- * Reads WorkBuddy's live console directory.
168
- *
169
- * The static `WORKBUDDY_MODELS` above is the fallback: this is what the "Fetch
170
- * models" action persists, and it carries the upstream's own limits and
171
- * capability flags rather than the seed's snapshot of them.
172
- */
173
- export async function discoverWorkBuddyModels(
174
- input: DiscoveryInput,
175
- ): Promise<readonly ModelDefinition[] | null> {
176
- return fetchBuddyDirectoryModels({
177
- siteUrl: WORKBUDDY_BASE_URL,
178
- providerId: WORKBUDDY_PROVIDER_ID,
179
- credential: input.credential,
180
- modelsPath: BUDDY_INTL_MODELS_PATH,
181
- endpoint: WORKBUDDY_CHAT_PATH,
182
- ...(input.signal ? { signal: input.signal } : {}),
183
- ...(input.fetcher ? { fetcher: input.fetcher } : {}),
184
- });
185
- }
186
-
187
- // Public factory — uses the OpenAI-compatible factory but forces provider semantics.
188
- // Supports both api_key and oauth via Authorization Bearer (factory handles both).
189
- export function createWorkBuddyAdapter(fetchImpl?: typeof fetch): ProviderAdapter {
190
- return new BuddyMediaAdapter(
191
- workbuddyAdapterConfig({
192
- providerId: WORKBUDDY_PROVIDER_ID,
193
- baseUrl: WORKBUDDY_BASE_URL,
194
- prePayload: workbuddyPrePayload,
195
- ...(fetchImpl ? { fetchImpl } : {}),
196
- }),
197
- {
198
- variant: "IDE",
199
- systemPrompt: WORKBUDDY_SYSTEM_PROMPT,
200
- baseUrl: WORKBUDDY_BASE_URL,
201
- buildHeaders: (context, request) => workbuddyHeaders(context, request),
202
- },
203
- );
204
- }
1
+ // WorkBuddy international adapter — exact provider contract.
2
+ // Canonical provider ID: workbuddy
3
+ // Base (manifest-owned) → Chat: base + /v2/chat/completions
4
+ // Auth: Authorization Bearer for both api_key and oauth
5
+ // Stream: force stream=true upstream, factory reaggregates for non-stream callers
6
+ // Headers: official desktop-client identity (WorkBuddy AI brand) with fresh
7
+ // correlation IDs + account-stable device headers per dispatch
8
+ // Payload: leading WorkBuddy system prompt + typed user content, reasoning_summary
9
+ // auto only when reasoning_effort requested
10
+
11
+ import { BuddyMediaAdapter } from "../buddy-media";
12
+ import { providerBaseUrl } from "../../../provider-metadata";
13
+ import { GatewayError } from "../../../../protocol/gateway-error";
14
+ import type { CanonicalRequest } from "../../../../protocol/canonical-model";
15
+ import type { ProviderAdapter, ProviderDispatchContext, ProviderDispatchTarget } from "../../../provider-contracts";
16
+ import type { ModelDefinition } from "../../../provider-model-definition";
17
+ import type { DiscoveryInput } from "../../../discovery/discovery-types";
18
+ import {
19
+ WORKBUDDY_CHAT_PATH,
20
+ WORKBUDDY_DOMAIN,
21
+ workbuddyAdapterConfig,
22
+ workbuddyHeaders,
23
+ } from "./shared";
24
+ import {
25
+ BUDDY_SHARED_RAW,
26
+ BUDDY_IMAGE_MODEL_ID_SET,
27
+ BUDDY_VIDEO_MODEL_ID_SET,
28
+ makeBuddyModel,
29
+ makeBuddyImageModels,
30
+ makeBuddyVideoModels,
31
+ type BuddyRawEntry,
32
+ } from "../buddy-catalog-shared";
33
+ import { BUDDY_INTL_MODELS_PATH, fetchBuddyDirectoryModels } from "../buddy-discovery-shared";
34
+ import {
35
+ applyBuddySystemPrompt,
36
+ buddyPrePayloadCommon,
37
+ normalizeBuddyToolNames,
38
+ } from "../buddy-chat-shared";
39
+
40
+ // Constants — public contract
41
+ export const WORKBUDDY_PROVIDER_ID = "workbuddy" as const;
42
+ export const WORKBUDDY_BASE_URL = providerBaseUrl("workbuddy");
43
+
44
+ // Payload hook — provider semantics
45
+ // - force stream=true
46
+ // - reasoning_summary auto only when reasoning_effort requested
47
+ // - leading WorkBuddy system prompt + typed user content normalization
48
+
49
+ /**
50
+ * Leading system turn for this variant.
51
+ *
52
+ * The upstream does validate the leading system turn's *text*, not just that
53
+ * the wire opens with one: sending caller text in its place answers
54
+ * `400 · 11128 "Illegal API invocation from an unapproved channel"` on
55
+ * CodeBuddy, which treats that prompt as the calling channel's identity. So
56
+ * this prompt is a wire contract, not merely a product choice — see the
57
+ * sibling in `codebuddy.ts`. The previous line named the vendor product, which
58
+ * made every request claim an identity the caller never chose.
59
+ */
60
+ export const WORKBUDDY_SYSTEM_PROMPT =
61
+ "You are a pragmatic and direct software engineering assistant. " +
62
+ "Be honest and truthful: state what you know, say plainly when you are unsure " +
63
+ "or do not know, and never claim to have done something you have not done. " +
64
+ "Prefer concrete answers over filler, and say so when a request is ambiguous " +
65
+ "instead of guessing silently.";
66
+
67
+ /**
68
+ * Reconstructs generic function declarations when a later tool-history turn
69
+ * arrives without the client's current `tools` array. WorkBuddy validates the
70
+ * Chat Completions envelope against every historical tool call, so forwarding
71
+ * `tool_calls`/`tool` messages without declarations yields model_param_invalid.
72
+ */
73
+ function restoreHistoricalToolDefinitions(
74
+ payload: Record<string, unknown>,
75
+ messages: readonly Record<string, unknown>[],
76
+ ): void {
77
+ const historicalNames = new Set<string>();
78
+ for (const message of messages) {
79
+ if (message["role"] !== "assistant" || !Array.isArray(message["tool_calls"])) continue;
80
+ for (const rawCall of message["tool_calls"]) {
81
+ if (!rawCall || typeof rawCall !== "object") continue;
82
+ const call = rawCall as Record<string, unknown>;
83
+ const functionValue =
84
+ call["function"] && typeof call["function"] === "object"
85
+ ? (call["function"] as Record<string, unknown>)
86
+ : undefined;
87
+ const name = functionValue?.["name"];
88
+ if (typeof name === "string" && name.trim().length > 0) historicalNames.add(name);
89
+ }
90
+ }
91
+ if (historicalNames.size === 0) return;
92
+
93
+ const existing = Array.isArray(payload["tools"])
94
+ ? (payload["tools"] as Array<Record<string, unknown>>)
95
+ : [];
96
+ const definedNames = new Set<string>();
97
+ for (const rawTool of existing) {
98
+ if (!rawTool || typeof rawTool !== "object") continue;
99
+ const tool = rawTool as Record<string, unknown>;
100
+ const functionValue =
101
+ tool["function"] && typeof tool["function"] === "object"
102
+ ? (tool["function"] as Record<string, unknown>)
103
+ : tool;
104
+ if (typeof functionValue["name"] === "string") definedNames.add(functionValue["name"]);
105
+ }
106
+ const recovered = [...historicalNames]
107
+ .filter((name) => !definedNames.has(name))
108
+ .map((name) => ({
109
+ type: "function",
110
+ function: {
111
+ name,
112
+ description: "Recovered from historical tool calls.",
113
+ parameters: { type: "object", additionalProperties: true },
114
+ },
115
+ }));
116
+ if (recovered.length > 0) payload["tools"] = [...existing, ...recovered];
117
+ }
118
+
119
+
120
+ export function workbuddyPrePayload(
121
+ payload: Record<string, unknown>,
122
+ request: CanonicalRequest,
123
+ candidate: ProviderDispatchTarget,
124
+ context?: ProviderDispatchContext,
125
+ ): void {
126
+ // International ladder. This hook is shared by `workbuddy` and `workbuddycn`
127
+ // (see workbuddy/cn-provider.ts): the CN effort ladders in the reference
128
+ // gateways are a CodeBuddy-CN concern, so `workbuddycn` deliberately stays on
129
+ // the intl table. Switch to `"cn"` only if a live CN WorkBuddy account proves
130
+ // it serves levels the intl table clamps.
131
+ buddyPrePayloadCommon(payload, request, "intl", context);
132
+ const rawModel = payload["model"];
133
+ const source =
134
+ typeof rawModel === "string" && rawModel.length > 0 ? rawModel : candidate.model_id;
135
+ if (!source) throw new GatewayError("invalid_request", 400, "WorkBuddy model is required");
136
+ const messages = payload["messages"];
137
+ if (Array.isArray(messages)) {
138
+ const normalizedMessages = messages as Array<Record<string, unknown>>;
139
+ applyBuddySystemPrompt(normalizedMessages, WORKBUDDY_SYSTEM_PROMPT);
140
+ restoreHistoricalToolDefinitions(payload, normalizedMessages);
141
+ }
142
+ normalizeBuddyToolNames(payload);
143
+ void request;
144
+ }
145
+
146
+ // Model catalog — WorkBuddy international catalog.
147
+ // Static seed derived from the reference gateway's model.json (context/output
148
+ // limits) plus its global effort table; `reasoning` marks models with a
149
+ // declared reasoning-effort scale.
150
+ const WORKBUDDY_RAW: readonly BuddyRawEntry[] = BUDDY_SHARED_RAW;
151
+
152
+ export function makeWorkBuddyModels(providerId: "workbuddy" | "workbuddycn"): readonly ModelDefinition[] {
153
+ return [
154
+ ...WORKBUDDY_RAW.filter(
155
+ (entry) => !BUDDY_IMAGE_MODEL_ID_SET.has(entry[0]) && !BUDDY_VIDEO_MODEL_ID_SET.has(entry[0]),
156
+ ).map((entry) => makeBuddyModel(entry, providerId, WORKBUDDY_CHAT_PATH)),
157
+ // WorkBuddy's base URL carries no version segment, so the image rows need the
158
+ // same explicit path the chat rows use — the generic default would produce a
159
+ // URL this upstream answers with a 405.
160
+ ...makeBuddyImageModels(providerId, WORKBUDDY_CHAT_PATH),
161
+ ...makeBuddyVideoModels(providerId, "/v2/videos/generations"),
162
+ ];
163
+ }
164
+
165
+ export const WORKBUDDY_MODELS: readonly ModelDefinition[] = makeWorkBuddyModels("workbuddy");
166
+
167
+ /**
168
+ * Reads WorkBuddy's live console directory.
169
+ *
170
+ * The static `WORKBUDDY_MODELS` above is the fallback: this is what the "Fetch
171
+ * models" action persists, and it carries the upstream's own limits and
172
+ * capability flags rather than the seed's snapshot of them.
173
+ */
174
+ export async function discoverWorkBuddyModels(
175
+ input: DiscoveryInput,
176
+ ): Promise<readonly ModelDefinition[] | null> {
177
+ return fetchBuddyDirectoryModels({
178
+ siteUrl: WORKBUDDY_BASE_URL,
179
+ providerId: WORKBUDDY_PROVIDER_ID,
180
+ credential: input.credential,
181
+ modelsPath: BUDDY_INTL_MODELS_PATH,
182
+ endpoint: WORKBUDDY_CHAT_PATH,
183
+ ...(input.signal ? { signal: input.signal } : {}),
184
+ ...(input.fetcher ? { fetcher: input.fetcher } : {}),
185
+ });
186
+ }
187
+
188
+ // Public factory — uses the OpenAI-compatible factory but forces provider semantics.
189
+ // Supports both api_key and oauth via Authorization Bearer (factory handles both).
190
+ export function createWorkBuddyAdapter(fetchImpl?: typeof fetch): ProviderAdapter {
191
+ return new BuddyMediaAdapter(
192
+ workbuddyAdapterConfig({
193
+ providerId: WORKBUDDY_PROVIDER_ID,
194
+ baseUrl: WORKBUDDY_BASE_URL,
195
+ prePayload: workbuddyPrePayload,
196
+ ...(fetchImpl ? { fetchImpl } : {}),
197
+ }),
198
+ {
199
+ variant: "IDE",
200
+ systemPrompt: WORKBUDDY_SYSTEM_PROMPT,
201
+ baseUrl: WORKBUDDY_BASE_URL,
202
+ buildHeaders: (context, request) =>
203
+ workbuddyHeaders(context, request, WORKBUDDY_DOMAIN, undefined, true),
204
+ },
205
+ );
206
+ }
@@ -117,9 +117,9 @@ export async function workbuddyHeaders(
117
117
  "x-no-enterprise-id": "1",
118
118
  };
119
119
  // The conversation/tracing family the upstream's channel check looks for. A
120
- // live request answered `400 · 11-128 "conversation id missing"` while carrying
121
- // only `x-session-id`; the aggregation key below is the one the reference
122
- // marks mandatory.
120
+ // live request carrying only `x-session-id` was refused for a missing
121
+ // conversation id; the aggregation key below is the one the reference marks
122
+ // mandatory.
123
123
  Object.assign(headers, conversation);
124
124
  if (accountId) {
125
125
  headers["x-user-id"] = accountId;