@openhands/agent-canvas 1.0.0-beta.6 → 1.0.0-beta.8

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 (802) hide show
  1. package/README.md +24 -7
  2. package/README.windows.md +27 -0
  3. package/bin/agent-canvas.mjs +26 -3
  4. package/build/assets/{QueryClientProvider-CkGuhXg-.js → QueryClientProvider-Cnr-Yl3j.js} +1 -1
  5. package/build/assets/{Trans-Cvm_-SMi.js → Trans-4jmk54WC.js} +1 -1
  6. package/build/assets/acp-providers-BAX8OU5C.js +1 -0
  7. package/build/assets/{acp-route-guard-B2yoBZ_4.js → acp-route-guard-HPk6TV-L.js} +1 -1
  8. package/build/assets/active-backend-context-BSPE-W72.js +1 -0
  9. package/build/assets/add-backend-modal-mXKmfMI2.js +1 -0
  10. package/build/assets/agent-server-client-options-9agOSarV.js +1 -0
  11. package/build/assets/agent-server-compatibility-B7QStIcH.js +1 -0
  12. package/build/assets/agent-server-conversation-service.api-B9TUYJon.js +5 -0
  13. package/build/assets/{agent-settings-CnGSCmK8.js → agent-settings-g3F623RJ.js} +1 -1
  14. package/build/assets/{alert-banner-DtzAX654.js → alert-banner-DFnn_lC6.js} +1 -1
  15. package/build/assets/{analytics-consent-form-modal-CHZ3I37v.js → analytics-consent-form-modal-BQCNeNVt.js} +1 -1
  16. package/build/assets/api-key-entry-screen-myuWMqzW.js +1 -0
  17. package/build/assets/{app-settings-Db9ITeJH.js → app-settings-CCcX8ZEH.js} +1 -1
  18. package/build/assets/automation-detail-BDHLHSJd.js +1 -0
  19. package/build/assets/automations-list-CiNtQhq_.js +1 -0
  20. package/build/assets/back-nav-button-7dQJ2k3O.js +1 -0
  21. package/build/assets/backend-form-modal-D3bDMO3C.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-Dc6c7GT4.js → backend-synced-settings-badge-BkW5evM0.js} +1 -1
  23. package/build/assets/base-modal-C2oy2EBG.js +1 -0
  24. package/build/assets/brand-button-DJ_S16rO.js +1 -0
  25. package/build/assets/{browser-D810xUYt.js → browser-CGM-k-sH.js} +2 -2
  26. package/build/assets/browser-store-DAsixKdU.js +1 -0
  27. package/build/assets/{browser-tab-B-aIqXRl.js → browser-tab-dvSPdvkm.js} +1 -1
  28. package/build/assets/{checkmark-DL7acQA7.js → checkmark-Dus0b6jt.js} +1 -1
  29. package/build/assets/{chevron-left-small-CVWf8TI6.js → chevron-left-small-_uvG7RVM.js} +1 -1
  30. package/build/assets/{circle-plus-check-toggle-P7ZZToV4.js → circle-plus-check-toggle-DKS8MAVV.js} +1 -1
  31. package/build/assets/{close-B5LROHR3.js → close-BU5iTc66.js} +1 -1
  32. package/build/assets/code-tag-BzyqOtPD.js +1 -0
  33. package/build/assets/combobox-caret-BJC7XJsz.js +1 -0
  34. package/build/assets/{command-store-DFN_17p1.js → command-store-CE1weJy8.js} +1 -1
  35. package/build/assets/{condenser-settings-wnEKhBof.js → condenser-settings-DCTulgLO.js} +1 -1
  36. package/build/assets/{confirmation-modal-Dau3w_sa.js → confirmation-modal-B5Ca6qFE.js} +1 -1
  37. package/build/assets/context-menu-list-item-7tAcm2c3.js +1 -0
  38. package/build/assets/conversation-BKhikfYl.js +1 -0
  39. package/build/assets/conversation-DTn8jN8L.js +19 -0
  40. package/build/assets/conversation-panel-DfHR42mG.js +1 -0
  41. package/build/assets/conversation-service.api-B6CkzaKD.js +1 -0
  42. package/build/assets/conversation-state-store-D-w0uurj.js +1 -0
  43. package/build/assets/conversation-store-CC-isCnP.js +1 -0
  44. package/build/assets/{conversation-tab-empty-state-DyssnnWa.js → conversation-tab-empty-state-CStQLPVW.js} +1 -1
  45. package/build/assets/conversation-websocket-context-DShEuLjh.js +3 -0
  46. package/build/assets/{copy-DYgmUdIw.js → copy-Chg-sFu3.js} +1 -1
  47. package/build/assets/{custom-toast-handlers-C-SZFmto.js → custom-toast-handlers-ufGJ6_Rc.js} +1 -1
  48. package/build/assets/declaration-CR6HMp29.js +1 -0
  49. package/build/assets/{device-verify-DqDlphsG.js → device-verify-C6mj28zv.js} +1 -1
  50. package/build/assets/dist-DNeWJ2bh.js +1 -0
  51. package/build/assets/dropdown-classes-BsVmxlNG.js +1 -0
  52. package/build/assets/edit-automation-modal-DamwL0s0.js +1 -0
  53. package/build/assets/ellipsis-button-Vh5MvRZa.js +1 -0
  54. package/build/assets/entry.client-Cn71WM8q.js +2 -0
  55. package/build/assets/enum-filter-dropdown-5JeF2RLb.js +1 -0
  56. package/build/assets/{environment-switch-overlay-XL8yCGP6.js → environment-switch-overlay-Tf_BIfeR.js} +1 -1
  57. package/build/assets/extensions-hub-CUEmfvGy.js +1 -0
  58. package/build/assets/{extensions-navigation-BYR8Giqq.js → extensions-navigation-VQ-3umJ7.js} +1 -1
  59. package/build/assets/file-BTY6Gyy9.js +1 -0
  60. package/build/assets/files-tab-C47fQEeL.js +1 -0
  61. package/build/assets/files-tab-store-m0ARqX_E.js +1 -0
  62. package/build/assets/{folder-ZZJVGgd7.js → folder-D1T2W1cj.js} +1 -1
  63. package/build/assets/git-control-bar-branch-button-BT0aWH-o.js +27 -0
  64. package/build/assets/git-provider-icon-Pi-Cxpgv.js +1 -0
  65. package/build/assets/globe-Bzj_0oXT.js +1 -0
  66. package/build/assets/home-C3k6sFvB.js +1 -0
  67. package/build/assets/{i18n-CTohRuoO.js → i18n-DET2iOyh.js} +1 -1
  68. package/build/assets/install-server-modal-6fuq-TU6.js +1 -0
  69. package/build/assets/launch-DGghLfGx.js +1 -0
  70. package/build/assets/{lesson-plan-dH5Bj0pN.js → lesson-plan-duSsqWVs.js} +1 -1
  71. package/build/assets/link-external-DGxVm4Ps.js +1 -0
  72. package/build/assets/{llm-client-DaH1TuyR.js → llm-client-BqyLKgUN.js} +1 -1
  73. package/build/assets/llm-settings-BKraGtOu.js +1 -0
  74. package/build/assets/llm-settings-DRQTgOF1.js +1 -0
  75. package/build/assets/{loading-spinner-BPtYORNK.js → loading-spinner-5GT9q1xy.js} +1 -1
  76. package/build/assets/manage-backends-modal-CRMwyU0t.js +1 -0
  77. package/build/assets/manage-workspaces-modal-BYmGD1W7.js +1 -0
  78. package/build/assets/manifest-99b06a11.js +1 -0
  79. package/build/assets/{markdown-renderer-DMzf2i4x.js → markdown-renderer-B3IAVfv4.js} +1 -1
  80. package/build/assets/mcp-CfDRAmPn.js +9 -0
  81. package/build/assets/messages-Ba1vaw6t.js +36 -0
  82. package/build/assets/{modal-backdrop-BAbgYsqB.js → modal-backdrop-RfNCrSpK.js} +1 -1
  83. package/build/assets/{modal-body-BI6Ru2Qr.js → modal-body-aoa2fx5W.js} +1 -1
  84. package/build/assets/modal-classes-6YqcqA6y.js +1 -0
  85. package/build/assets/{modal-close-button-t1Gh3qmL.js → modal-close-button-CtWOUMmw.js} +1 -1
  86. package/build/assets/{model-selector-SM9IUz-q.js → model-selector-DcztJSxT.js} +1 -1
  87. package/build/assets/{navigation-context-D0YWpT8d.js → navigation-context-BdKYH32C.js} +1 -1
  88. package/build/assets/{navigation-link-Cn7KP3c5.js → navigation-link-U4vY9i_C.js} +1 -1
  89. package/build/assets/{openhands-logo-CnrF6LKb.js → openhands-logo-CCo0wJZX.js} +1 -1
  90. package/build/assets/{option-service.api-KvY_mZMY.js → option-service.api-CGNANEcT.js} +1 -1
  91. package/build/assets/{organization-service.api-DzYTHTYC.js → organization-service.api-BeuMC9QL.js} +1 -1
  92. package/build/assets/{path-utils-C3bQf6lJ.js → path-utils-z12iCrQO.js} +1 -1
  93. package/build/assets/{plan-components-atxXCF0R.js → plan-components-CRDMQzsS.js} +1 -1
  94. package/build/assets/{planner-tab-BlrCpv-7.js → planner-tab-Dte6Vzza.js} +1 -1
  95. package/build/assets/{profiles-client-D6IkTJof.js → profiles-client-BrqNmaDV.js} +1 -1
  96. package/build/assets/{providers-Bx6EfrzZ.js → providers-eUyo6pgr.js} +1 -1
  97. package/build/assets/proxy-BqDMnUY-.js +1 -0
  98. package/build/assets/{query-client-config-B7u9asM0.js → query-client-config-CRnGSujB.js} +1 -1
  99. package/build/assets/{recommended-automations-launcher-CgV8FyPK.js → recommended-automations-launcher-D5ADbXao.js} +3 -3
  100. package/build/assets/{root-dNntxffj.js → root-BmhaEJJ8.js} +2 -2
  101. package/build/assets/root-Z2VHU4R3.css +1 -0
  102. package/build/assets/root-layout-CNggm0d8.js +2 -0
  103. package/build/assets/{sdk-section-page-DOIKvwSL.js → sdk-section-page-CRCRY3PG.js} +1 -1
  104. package/build/assets/{sdk-settings-schema-DsUf9wu1.js → sdk-settings-schema-CLmJ9sho.js} +1 -1
  105. package/build/assets/{search-27Owlc3A.js → search-SuJctqNJ.js} +1 -1
  106. package/build/assets/secrets-service-B9AFn9OE.js +1 -0
  107. package/build/assets/secrets-settings-0UrKMS60.js +1 -0
  108. package/build/assets/{server-client-DyAQ3NZ_.js → server-client-DYv_GHPl.js} +1 -1
  109. package/build/assets/{settings-BYkVX7vW.js → settings-6t6LGW04.js} +1 -1
  110. package/build/assets/{settings-dropdown-input-BJYvGdg-.js → settings-dropdown-input-BtoovFre.js} +1 -1
  111. package/build/assets/{settings-gear-C77PgE_O.js → settings-gear-Dd8K2_8B.js} +1 -1
  112. package/build/assets/settings-index-CR6Ou73o.js +1 -0
  113. package/build/assets/{settings-input-Bn7F5C75.js → settings-input-CehsXnb3.js} +1 -1
  114. package/build/assets/settings-list-classes-E3v_f6QG.js +1 -0
  115. package/build/assets/settings-modal-T_Yk1Zfo.js +1 -0
  116. package/build/assets/{settings-section-header-context-BgZe5YkE.js → settings-section-header-context-DewwJ0-F.js} +1 -1
  117. package/build/assets/settings-service.api-DwtyDeGh.js +1 -0
  118. package/build/assets/{settings-switch-BeIKrWms.js → settings-switch-BiBuS3xa.js} +1 -1
  119. package/build/assets/{settings-utils-B6Nl07io.js → settings-utils-DY04tWG1.js} +1 -1
  120. package/build/assets/{shared-conversation-AMyqXvpk.js → shared-conversation-BzccsVej.js} +1 -1
  121. package/build/assets/sidebar-mobile-menu-toggle-DGlRg6jG.js +1 -0
  122. package/build/assets/{sidebar-nav-link-BGjiJq-4.js → sidebar-nav-link-dgVb8Fpy.js} +1 -1
  123. package/build/assets/{sidebar-store-Uy3v0AOV.js → sidebar-store-DnQAJAE5.js} +1 -1
  124. package/build/assets/{skill-card-pill-row-DF1axQCG.js → skill-card-pill-row-BW9qvhoK.js} +1 -1
  125. package/build/assets/{skills-ChIKZPK4.js → skills-0GRKX5Xj.js} +1 -1
  126. package/build/assets/{skills-plugins-CcI_19lM.js → skills-plugins-DctDrZ8Y.js} +1 -1
  127. package/build/assets/skills-settings-rvxImDj_.js +2 -0
  128. package/build/assets/{styled-tooltip-CBzrri6o.js → styled-tooltip-hdfMXPQC.js} +1 -1
  129. package/build/assets/{switch-skeleton-DnC9wLp7.js → switch-skeleton-DSKqSx2A.js} +1 -1
  130. package/build/assets/{task-list-tab-DUJn1sgz.js → task-list-tab-DT6_zfUs.js} +1 -1
  131. package/build/assets/{terminal-RmuaSdhJ.js → terminal-CPYWdo4j.js} +1 -1
  132. package/build/assets/{terminal-DgQk1Ay6.js → terminal-KldRPIRT.js} +2 -2
  133. package/build/assets/{toggle-switch-Pvyp2RAN.js → toggle-switch-T2v6sJ6l.js} +1 -1
  134. package/build/assets/{typography-gpuWmrQO.js → typography-BDgnT7Yp.js} +1 -1
  135. package/build/assets/{u-check-circle-IUIfACQQ.js → u-check-circle-DOauqQKb.js} +1 -1
  136. package/build/assets/{u-check-circle-half-C1YxB6py.js → u-check-circle-half-steSK_JB.js} +1 -1
  137. package/build/assets/{u-circuit-BmVikJHu.js → u-circuit-x3ExjBbU.js} +1 -1
  138. package/build/assets/{u-edit-CFvXHqZk.js → u-edit-BbrptMCa.js} +1 -1
  139. package/build/assets/{use-active-conversation-BEFNwnFk.js → use-active-conversation-sPgfSkql.js} +1 -1
  140. package/build/assets/use-agent-settings-schema-B66kGIi_.js +1 -0
  141. package/build/assets/{use-agent-state-Bkrd1FZq.js → use-agent-state-Dp3pD1h3.js} +1 -1
  142. package/build/assets/{use-cloud-current-user-id-CvkXFnTT.js → use-cloud-current-user-id-ClKFPjFz.js} +1 -1
  143. package/build/assets/{use-config-Co1O8-Ey.js → use-config-C9pvb0Sm.js} +1 -1
  144. package/build/assets/{use-create-conversation-CEgXpkfH.js → use-create-conversation-B-lwTnfE.js} +1 -1
  145. package/build/assets/{use-event-store-BT_gV3ut.js → use-event-store-BomO7ywK.js} +1 -1
  146. package/build/assets/{use-get-secrets-DuhdIA59.js → use-get-secrets-oyC7PFRz.js} +1 -1
  147. package/build/assets/{use-handle-plan-click-Ckkm5eIY.js → use-handle-plan-click-DP6Rs-YP.js} +1 -1
  148. package/build/assets/use-is-authed-dw2026rR.js +1 -0
  149. package/build/assets/{use-is-creating-conversation-BZ5hB_Bg.js → use-is-creating-conversation-DX2qSlfL.js} +1 -1
  150. package/build/assets/{use-launch-skill-in-chat-fNN_xGZG.js → use-launch-skill-in-chat-sQNEOLGD.js} +1 -1
  151. package/build/assets/use-llm-profiles-Bh5JqZUZ.js +1 -0
  152. package/build/assets/use-runtime-is-ready-BakOUVU-.js +1 -0
  153. package/build/assets/{use-save-settings-VUrj_QNG.js → use-save-settings-uXXkqvD7.js} +1 -1
  154. package/build/assets/use-settings-DeO7nvpM.js +1 -0
  155. package/build/assets/{use-settings-nav-items-1ZvovKSr.js → use-settings-nav-items-BGMFn25b.js} +1 -1
  156. package/build/assets/{use-skills-DAMLFjKU.js → use-skills-DWIK3l3a.js} +1 -1
  157. package/build/assets/{use-task-list-CLJbuJgM.js → use-task-list-CsT10CBb.js} +1 -1
  158. package/build/assets/{use-unified-vscode-url-DdSRw-6P.js → use-unified-vscode-url-DXPtB317.js} +1 -1
  159. package/build/assets/use-user-conversation-DJen4YIP.js +1 -0
  160. package/build/assets/{useMutation-DqrumCWD.js → useMutation-GSSKKebK.js} +1 -1
  161. package/build/assets/{useTranslation-DCOdSSMl.js → useTranslation-B6voJV4y.js} +1 -1
  162. package/build/assets/utils-DCVfKFRt.js +1 -0
  163. package/build/assets/{vendor~browser-BNjNhjFU.js → vendor~browser-BrOJLj3y.js} +1 -1
  164. package/build/assets/vendor~conversation-panel~conversation-C9o-K1hW.js +1 -0
  165. package/build/assets/vendor~conversation-panel~conversation~index-RXYdJYxU.js +1 -0
  166. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js} +1 -1
  167. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DpAdkv8m.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-6ByzelMS.js} +1 -1
  168. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B92czPCF.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BED5W_c4.js} +1 -1
  169. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-By5W2oHN.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CCbqAFiI.js} +1 -1
  170. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BbFOrAjI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CG96FCly.js} +1 -1
  171. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-smY2r837.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-E4d6IEfI.js} +1 -1
  172. package/build/assets/{vendor~home~mcp~automations-list-Cs-TO3fK.js → vendor~home~mcp~automations-list-CZSK-lT2.js} +1 -1
  173. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-Z3nsiNNq.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js} +1 -1
  174. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-DbfELDJu.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js} +2 -2
  175. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js → vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js} +1 -1
  176. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js +1 -0
  177. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js +9 -0
  178. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BkQGKpye.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js} +1 -1
  179. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-Bbs7UJ5U.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js} +2 -2
  180. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-DTwbEEcX.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js} +1 -1
  181. package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-CDXvdvb2.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js} +1 -1
  182. package/build/assets/{verification-settings-CsbvQcYS.js → verification-settings-C_zHuDx9.js} +1 -1
  183. package/build/assets/{vscode-tab-DjNArCgY.js → vscode-tab-DH9x7xXS.js} +1 -1
  184. package/build/assets/{waiting-for-runtime-message-CntjExbU.js → waiting-for-runtime-message-CdK3btDZ.js} +1 -1
  185. package/build/assets/{x-mark-CrpjscNc.js → x-mark-BrkSPIiT.js} +1 -1
  186. package/build/index.html +4 -4
  187. package/build/locales/ar/openhands.json +20 -2
  188. package/build/locales/ca/openhands.json +20 -2
  189. package/build/locales/de/openhands.json +20 -2
  190. package/build/locales/en/openhands.json +20 -2
  191. package/build/locales/es/openhands.json +20 -2
  192. package/build/locales/fr/openhands.json +20 -2
  193. package/build/locales/it/openhands.json +20 -2
  194. package/build/locales/ja/openhands.json +20 -2
  195. package/build/locales/ko-KR/openhands.json +20 -2
  196. package/build/locales/no/openhands.json +20 -2
  197. package/build/locales/pt/openhands.json +20 -2
  198. package/build/locales/tr/openhands.json +20 -2
  199. package/build/locales/uk/openhands.json +20 -2
  200. package/build/locales/zh-CN/openhands.json +20 -2
  201. package/build/locales/zh-TW/openhands.json +20 -2
  202. package/dist/api/acp-service/acp-service.api.d.ts +18 -0
  203. package/dist/api/agent-server-adapter.cjs +3 -3
  204. package/dist/api/agent-server-adapter.cjs.map +1 -1
  205. package/dist/api/agent-server-adapter.js +54 -55
  206. package/dist/api/agent-server-adapter.js.map +1 -1
  207. package/dist/api/agent-server-client-options.cjs +1 -1
  208. package/dist/api/agent-server-client-options.cjs.map +1 -1
  209. package/dist/api/agent-server-client-options.d.ts +4 -0
  210. package/dist/api/agent-server-client-options.js +18 -12
  211. package/dist/api/agent-server-client-options.js.map +1 -1
  212. package/dist/api/agent-server-compatibility.cjs +1 -1
  213. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  214. package/dist/api/agent-server-compatibility.d.ts +1 -1
  215. package/dist/api/agent-server-compatibility.js +30 -25
  216. package/dist/api/agent-server-compatibility.js.map +1 -1
  217. package/dist/api/agent-server-config.cjs +1 -1
  218. package/dist/api/agent-server-config.cjs.map +1 -1
  219. package/dist/api/agent-server-config.d.ts +15 -48
  220. package/dist/api/agent-server-config.js +25 -69
  221. package/dist/api/agent-server-config.js.map +1 -1
  222. package/dist/api/backend-registry/active-store.cjs +1 -1
  223. package/dist/api/backend-registry/active-store.cjs.map +1 -1
  224. package/dist/api/backend-registry/active-store.d.ts +11 -5
  225. package/dist/api/backend-registry/active-store.js +36 -27
  226. package/dist/api/backend-registry/active-store.js.map +1 -1
  227. package/dist/api/backend-registry/auth.cjs +1 -1
  228. package/dist/api/backend-registry/auth.cjs.map +1 -1
  229. package/dist/api/backend-registry/auth.js +3 -9
  230. package/dist/api/backend-registry/auth.js.map +1 -1
  231. package/dist/api/backend-registry/default-backend.cjs +1 -1
  232. package/dist/api/backend-registry/default-backend.cjs.map +1 -1
  233. package/dist/api/backend-registry/default-backend.d.ts +9 -16
  234. package/dist/api/backend-registry/default-backend.js +5 -4
  235. package/dist/api/backend-registry/default-backend.js.map +1 -1
  236. package/dist/api/backend-registry/storage.cjs +1 -1
  237. package/dist/api/backend-registry/storage.cjs.map +1 -1
  238. package/dist/api/backend-registry/storage.js +67 -34
  239. package/dist/api/backend-registry/storage.js.map +1 -1
  240. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  241. package/dist/api/cloud/conversation-service.api.d.ts +8 -13
  242. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  243. package/dist/api/cloud/organization-service.api.cjs.map +1 -1
  244. package/dist/api/cloud/organization-service.api.d.ts +1 -2
  245. package/dist/api/cloud/organization-service.api.js.map +1 -1
  246. package/dist/api/cloud/proxy.cjs +1 -1
  247. package/dist/api/cloud/proxy.cjs.map +1 -1
  248. package/dist/api/cloud/proxy.d.ts +6 -6
  249. package/dist/api/cloud/proxy.js +33 -24
  250. package/dist/api/cloud/proxy.js.map +1 -1
  251. package/dist/api/cloud/sandbox-service.api.cjs.map +1 -1
  252. package/dist/api/cloud/sandbox-service.api.d.ts +3 -3
  253. package/dist/api/cloud/sandbox-service.api.js.map +1 -1
  254. package/dist/api/cloud/secrets-service.api.cjs.map +1 -1
  255. package/dist/api/cloud/secrets-service.api.d.ts +3 -4
  256. package/dist/api/cloud/secrets-service.api.js.map +1 -1
  257. package/dist/api/cloud/settings-service.api.cjs +1 -1
  258. package/dist/api/cloud/settings-service.api.cjs.map +1 -1
  259. package/dist/api/cloud/settings-service.api.js +5 -1
  260. package/dist/api/cloud/settings-service.api.js.map +1 -1
  261. package/dist/api/cloud/skills-service.api.cjs.map +1 -1
  262. package/dist/api/cloud/skills-service.api.d.ts +5 -5
  263. package/dist/api/cloud/skills-service.api.js.map +1 -1
  264. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  265. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  266. package/dist/api/conversation-service/agent-server-conversation-service.api.js +115 -108
  267. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  268. package/dist/api/device-flow-client.cjs +1 -1
  269. package/dist/api/device-flow-client.cjs.map +1 -1
  270. package/dist/api/device-flow-client.d.ts +3 -5
  271. package/dist/api/device-flow-client.js +55 -66
  272. package/dist/api/device-flow-client.js.map +1 -1
  273. package/dist/api/event-service/event-service.api.cjs +1 -1
  274. package/dist/api/event-service/event-service.api.cjs.map +1 -1
  275. package/dist/api/event-service/event-service.api.d.ts +3 -3
  276. package/dist/api/event-service/event-service.api.js +17 -17
  277. package/dist/api/event-service/event-service.api.js.map +1 -1
  278. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  279. package/dist/api/git-service/agent-server-git-service.api.js +11 -11
  280. package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
  281. package/dist/api/runtime-service/agent-server-runtime-service.js +6 -6
  282. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.cjs +2 -2
  283. package/dist/components/conversation-events/chat/event-content-helpers/get-action-content.js +10 -10
  284. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.cjs.map +1 -1
  285. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.d.ts +5 -5
  286. package/dist/components/conversation-events/chat/event-content-helpers/get-observation-result.js.map +1 -1
  287. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  288. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  289. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +1 -1
  290. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  291. package/dist/components/features/automations/automation-action-button-classes.d.ts +2 -2
  292. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  293. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  294. package/dist/components/features/backends/backend-form-modal.d.ts +1 -0
  295. package/dist/components/features/backends/backend-form-modal.js +203 -140
  296. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  297. package/dist/components/features/backends/backend-selector.cjs +1 -1
  298. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  299. package/dist/components/features/backends/backend-selector.js +117 -105
  300. package/dist/components/features/backends/backend-selector.js.map +1 -1
  301. package/dist/components/features/backends/backend-status-dot.cjs +1 -1
  302. package/dist/components/features/backends/backend-status-dot.cjs.map +1 -1
  303. package/dist/components/features/backends/backend-status-dot.d.ts +1 -1
  304. package/dist/components/features/backends/backend-status-dot.js +1 -1
  305. package/dist/components/features/backends/backend-status-dot.js.map +1 -1
  306. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  307. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  308. package/dist/components/features/backends/manage-backends-modal.js +81 -70
  309. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  310. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  311. package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
  312. package/dist/components/features/chat/change-agent-button.js +59 -57
  313. package/dist/components/features/chat/change-agent-button.js.map +1 -1
  314. package/dist/components/features/chat/change-agent-context-menu.cjs +1 -1
  315. package/dist/components/features/chat/change-agent-context-menu.cjs.map +1 -1
  316. package/dist/components/features/chat/change-agent-context-menu.d.ts +3 -1
  317. package/dist/components/features/chat/change-agent-context-menu.js +30 -25
  318. package/dist/components/features/chat/change-agent-context-menu.js.map +1 -1
  319. package/dist/components/features/chat/chat-add-file-button.cjs +1 -1
  320. package/dist/components/features/chat/chat-add-file-button.cjs.map +1 -1
  321. package/dist/components/features/chat/chat-add-file-button.js +39 -38
  322. package/dist/components/features/chat/chat-add-file-button.js.map +1 -1
  323. package/dist/components/features/chat/chat-message.cjs +1 -1
  324. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  325. package/dist/components/features/chat/chat-message.d.ts +2 -1
  326. package/dist/components/features/chat/chat-message.js +185 -57
  327. package/dist/components/features/chat/chat-message.js.map +1 -1
  328. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  329. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  330. package/dist/components/features/chat/components/chat-input-actions.js +113 -113
  331. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  332. package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
  333. package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
  334. package/dist/components/features/chat/components/chat-input-model.js +52 -51
  335. package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
  336. package/dist/components/features/chat/components/slash-command-menu.cjs +2 -2
  337. package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
  338. package/dist/components/features/chat/components/slash-command-menu.js +38 -34
  339. package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
  340. package/dist/components/features/chat/git-control-bar-pr-button.cjs +1 -1
  341. package/dist/components/features/chat/git-control-bar-pr-button.cjs.map +1 -1
  342. package/dist/components/features/chat/git-control-bar-pr-button.js +16 -15
  343. package/dist/components/features/chat/git-control-bar-pr-button.js.map +1 -1
  344. package/dist/components/features/chat/git-control-bar-pull-button.cjs +1 -1
  345. package/dist/components/features/chat/git-control-bar-pull-button.cjs.map +1 -1
  346. package/dist/components/features/chat/git-control-bar-pull-button.js +16 -15
  347. package/dist/components/features/chat/git-control-bar-pull-button.js.map +1 -1
  348. package/dist/components/features/chat/git-control-bar-push-button.cjs +1 -1
  349. package/dist/components/features/chat/git-control-bar-push-button.cjs.map +1 -1
  350. package/dist/components/features/chat/git-control-bar-push-button.js +16 -15
  351. package/dist/components/features/chat/git-control-bar-push-button.js.map +1 -1
  352. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  353. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  354. package/dist/components/features/chat/git-control-bar.js +63 -62
  355. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  356. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  357. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  358. package/dist/components/features/chat/pending-user-messages.js +27 -23
  359. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  360. package/dist/components/features/chat/switch-profile-button.cjs +1 -1
  361. package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
  362. package/dist/components/features/chat/switch-profile-button.js +26 -25
  363. package/dist/components/features/chat/switch-profile-button.js.map +1 -1
  364. package/dist/components/features/chat/switch-profile-context-menu.cjs +1 -1
  365. package/dist/components/features/chat/switch-profile-context-menu.cjs.map +1 -1
  366. package/dist/components/features/chat/switch-profile-context-menu.js +77 -67
  367. package/dist/components/features/chat/switch-profile-context-menu.js.map +1 -1
  368. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs +1 -1
  369. package/dist/components/features/context-menu/context-menu-icon-text-with-description.cjs.map +1 -1
  370. package/dist/components/features/context-menu/context-menu-icon-text-with-description.d.ts +2 -1
  371. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js +3 -2
  372. package/dist/components/features/context-menu/context-menu-icon-text-with-description.js.map +1 -1
  373. package/dist/components/features/context-menu/context-menu-icon-text.cjs +1 -1
  374. package/dist/components/features/context-menu/context-menu-icon-text.cjs.map +1 -1
  375. package/dist/components/features/context-menu/context-menu-icon-text.d.ts +2 -1
  376. package/dist/components/features/context-menu/context-menu-icon-text.js +20 -10
  377. package/dist/components/features/context-menu/context-menu-icon-text.js.map +1 -1
  378. package/dist/components/features/context-menu/context-menu-list-item.cjs +1 -1
  379. package/dist/components/features/context-menu/context-menu-list-item.cjs.map +1 -1
  380. package/dist/components/features/context-menu/context-menu-list-item.js +10 -9
  381. package/dist/components/features/context-menu/context-menu-list-item.js.map +1 -1
  382. package/dist/components/features/controls/agent-status.cjs +1 -1
  383. package/dist/components/features/controls/agent-status.js +12 -12
  384. package/dist/components/features/controls/git-tools-submenu.cjs +1 -1
  385. package/dist/components/features/controls/git-tools-submenu.cjs.map +1 -1
  386. package/dist/components/features/controls/git-tools-submenu.js +1 -1
  387. package/dist/components/features/controls/git-tools-submenu.js.map +1 -1
  388. package/dist/components/features/controls/macros-submenu.cjs +1 -1
  389. package/dist/components/features/controls/macros-submenu.cjs.map +1 -1
  390. package/dist/components/features/controls/macros-submenu.js +1 -1
  391. package/dist/components/features/controls/macros-submenu.js.map +1 -1
  392. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs +1 -1
  393. package/dist/components/features/controls/server-status-context-menu-icon-text.cjs.map +1 -1
  394. package/dist/components/features/controls/server-status-context-menu-icon-text.js +14 -15
  395. package/dist/components/features/controls/server-status-context-menu-icon-text.js.map +1 -1
  396. package/dist/components/features/controls/server-status-context-menu.cjs +1 -1
  397. package/dist/components/features/controls/server-status-context-menu.js +4 -4
  398. package/dist/components/features/controls/server-status.cjs +1 -1
  399. package/dist/components/features/controls/server-status.js +7 -7
  400. package/dist/components/features/controls/tools-context-menu-icon-text.cjs +1 -1
  401. package/dist/components/features/controls/tools-context-menu-icon-text.cjs.map +1 -1
  402. package/dist/components/features/controls/tools-context-menu-icon-text.js +16 -16
  403. package/dist/components/features/controls/tools-context-menu-icon-text.js.map +1 -1
  404. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs +1 -1
  405. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.cjs.map +1 -1
  406. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js +11 -11
  407. package/dist/components/features/conversation/conversation-name-context-menu-icon-text.js.map +1 -1
  408. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  409. package/dist/components/features/conversation/conversation-name-with-status.js +11 -11
  410. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  411. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  412. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +60 -47
  413. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  414. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs +1 -1
  415. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.cjs.map +1 -1
  416. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js +86 -82
  417. package/dist/components/features/conversation-panel/cloud-new-conversation-menu.js.map +1 -1
  418. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  419. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +4 -4
  420. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
  421. package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +9 -9
  422. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
  423. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
  424. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +93 -93
  425. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
  426. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  427. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  428. package/dist/components/features/conversation-panel/conversation-panel.js +177 -177
  429. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  430. package/dist/components/features/conversation-panel/ellipsis-button.cjs +1 -1
  431. package/dist/components/features/conversation-panel/ellipsis-button.cjs.map +1 -1
  432. package/dist/components/features/conversation-panel/ellipsis-button.js +13 -13
  433. package/dist/components/features/conversation-panel/ellipsis-button.js.map +1 -1
  434. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs +1 -1
  435. package/dist/components/features/conversation-panel/local-new-conversation-menu.cjs.map +1 -1
  436. package/dist/components/features/conversation-panel/local-new-conversation-menu.js +57 -53
  437. package/dist/components/features/conversation-panel/local-new-conversation-menu.js.map +1 -1
  438. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs +1 -1
  439. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.cjs.map +1 -1
  440. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js +3 -2
  441. package/dist/components/features/conversation-panel/new-conversation-dropdown-styles.js.map +1 -1
  442. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs +1 -1
  443. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.cjs.map +1 -1
  444. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js +11 -8
  445. package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.js.map +1 -1
  446. package/dist/components/features/conversation-panel/system-message-modal/tab-content.cjs.map +1 -1
  447. package/dist/components/features/conversation-panel/system-message-modal/tab-content.d.ts +2 -5
  448. package/dist/components/features/conversation-panel/system-message-modal/tab-content.js.map +1 -1
  449. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  450. package/dist/components/features/files-tab/file-content-viewer.cjs.map +1 -1
  451. package/dist/components/features/files-tab/file-content-viewer.js +45 -42
  452. package/dist/components/features/files-tab/file-content-viewer.js.map +1 -1
  453. package/dist/components/features/home/llm-not-configured-banner.d.ts +11 -0
  454. package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
  455. package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
  456. package/dist/components/features/home/shared/dropdown-item.js +20 -16
  457. package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
  458. package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
  459. package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
  460. package/dist/components/features/home/shared/generic-dropdown-menu.js +23 -22
  461. package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
  462. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs +1 -1
  463. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.cjs.map +1 -1
  464. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js +103 -102
  465. package/dist/components/features/home/workspace-dropdown/folder-browser-modal.js.map +1 -1
  466. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs +1 -1
  467. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.cjs.map +1 -1
  468. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js +68 -67
  469. package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.js.map +1 -1
  470. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  471. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  472. package/dist/components/features/mcp-page/custom-server-editor.js +62 -60
  473. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  474. package/dist/components/features/mcp-page/index.cjs +1 -1
  475. package/dist/components/features/mcp-page/index.d.ts +1 -0
  476. package/dist/components/features/mcp-page/index.js +1 -0
  477. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  478. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  479. package/dist/components/features/mcp-page/install-server-modal.js +141 -121
  480. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  481. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs +2 -0
  482. package/dist/components/features/mcp-page/save-as-secret-toggle.cjs.map +1 -0
  483. package/dist/components/features/mcp-page/save-as-secret-toggle.d.ts +7 -0
  484. package/dist/components/features/mcp-page/save-as-secret-toggle.js +50 -0
  485. package/dist/components/features/mcp-page/save-as-secret-toggle.js.map +1 -0
  486. package/dist/components/features/onboarding/onboarding-modal.d.ts +2 -2
  487. package/dist/components/features/onboarding/steps/check-backend-step.d.ts +1 -1
  488. package/dist/components/features/onboarding/steps/choose-agent-step.d.ts +2 -1
  489. package/dist/components/features/onboarding/steps/setup-acp-secrets-step.d.ts +19 -10
  490. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  491. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.d.ts +5 -0
  492. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -0
  493. package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
  494. package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
  495. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  496. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  497. package/dist/components/features/skills/extensions-navigation.js +1 -1
  498. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  499. package/dist/components/shared/buttons/back-nav-button.cjs +2 -0
  500. package/dist/components/shared/buttons/back-nav-button.cjs.map +1 -0
  501. package/dist/components/shared/buttons/back-nav-button.d.ts +17 -0
  502. package/dist/components/shared/buttons/back-nav-button.js +33 -0
  503. package/dist/components/shared/buttons/back-nav-button.js.map +1 -0
  504. package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
  505. package/dist/components/shared/buttons/conversation-confirmation-buttons.js +5 -5
  506. package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
  507. package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
  508. package/dist/components/shared/filters/enum-filter-dropdown.js +32 -31
  509. package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
  510. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs +1 -1
  511. package/dist/components/shared/modals/confirmation-modals/base-modal.cjs.map +1 -1
  512. package/dist/components/shared/modals/confirmation-modals/base-modal.js +14 -13
  513. package/dist/components/shared/modals/confirmation-modals/base-modal.js.map +1 -1
  514. package/dist/components/shared/modals/settings/settings-modal.cjs +1 -1
  515. package/dist/components/shared/modals/settings/settings-modal.cjs.map +1 -1
  516. package/dist/components/shared/modals/settings/settings-modal.js +17 -16
  517. package/dist/components/shared/modals/settings/settings-modal.js.map +1 -1
  518. package/dist/components/shared/text-shimmer.cjs +2 -0
  519. package/dist/components/shared/text-shimmer.cjs.map +1 -0
  520. package/dist/components/shared/text-shimmer.d.ts +11 -0
  521. package/dist/components/shared/text-shimmer.js +43 -0
  522. package/dist/components/shared/text-shimmer.js.map +1 -0
  523. package/dist/constants/acp-providers.cjs +1 -1
  524. package/dist/constants/acp-providers.cjs.map +1 -1
  525. package/dist/constants/acp-providers.d.ts +16 -3
  526. package/dist/constants/acp-providers.js +0 -1
  527. package/dist/constants/acp-providers.js.map +1 -1
  528. package/dist/contexts/active-backend-context.cjs +1 -1
  529. package/dist/contexts/active-backend-context.cjs.map +1 -1
  530. package/dist/contexts/active-backend-context.js +32 -32
  531. package/dist/contexts/active-backend-context.js.map +1 -1
  532. package/dist/hooks/chat/use-chat-input-logic.cjs +1 -1
  533. package/dist/hooks/chat/use-chat-input-logic.cjs.map +1 -1
  534. package/dist/hooks/chat/use-chat-input-logic.js +13 -6
  535. package/dist/hooks/chat/use-chat-input-logic.js.map +1 -1
  536. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs +2 -0
  537. package/dist/hooks/mutation/use-save-fields-as-secrets.cjs.map +1 -0
  538. package/dist/hooks/mutation/use-save-fields-as-secrets.d.ts +9 -0
  539. package/dist/hooks/mutation/use-save-fields-as-secrets.js +24 -0
  540. package/dist/hooks/mutation/use-save-fields-as-secrets.js.map +1 -0
  541. package/dist/hooks/mutation/use-unified-start-conversation.cjs +1 -1
  542. package/dist/hooks/mutation/use-unified-start-conversation.js +8 -8
  543. package/dist/hooks/mutation/use-unified-stop-conversation.cjs +1 -1
  544. package/dist/hooks/mutation/use-unified-stop-conversation.js +15 -15
  545. package/dist/hooks/query/use-acp-auth-status.d.ts +36 -0
  546. package/dist/hooks/query/use-agent-settings-schema.cjs +1 -1
  547. package/dist/hooks/query/use-agent-settings-schema.cjs.map +1 -1
  548. package/dist/hooks/query/use-agent-settings-schema.js +26 -16
  549. package/dist/hooks/query/use-agent-settings-schema.js.map +1 -1
  550. package/dist/hooks/query/use-backends-health.cjs +1 -1
  551. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  552. package/dist/hooks/query/use-backends-health.d.ts +2 -0
  553. package/dist/hooks/query/use-backends-health.js +31 -21
  554. package/dist/hooks/query/use-backends-health.js.map +1 -1
  555. package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
  556. package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
  557. package/dist/hooks/query/use-paginated-conversations.js +15 -14
  558. package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
  559. package/dist/hooks/query/use-settings.cjs +1 -1
  560. package/dist/hooks/query/use-settings.cjs.map +1 -1
  561. package/dist/hooks/query/use-settings.js +65 -52
  562. package/dist/hooks/query/use-settings.js.map +1 -1
  563. package/dist/hooks/query/use-user-conversation.cjs +1 -1
  564. package/dist/hooks/query/use-user-conversation.cjs.map +1 -1
  565. package/dist/hooks/query/use-user-conversation.js +20 -11
  566. package/dist/hooks/query/use-user-conversation.js.map +1 -1
  567. package/dist/hooks/use-agent-state.cjs +1 -1
  568. package/dist/hooks/use-agent-state.js +13 -13
  569. package/dist/hooks/use-conversation-name-context-menu.cjs +1 -1
  570. package/dist/hooks/use-conversation-name-context-menu.js +10 -10
  571. package/dist/hooks/use-conversation-name-context-menu.js.map +1 -1
  572. package/dist/hooks/use-llm-configured.d.ts +25 -0
  573. package/dist/hooks/use-runtime-is-ready.cjs +1 -1
  574. package/dist/hooks/use-runtime-is-ready.js +5 -5
  575. package/dist/i18n/declaration.cjs +1 -1
  576. package/dist/i18n/declaration.cjs.map +1 -1
  577. package/dist/i18n/declaration.d.ts +19 -1
  578. package/dist/i18n/declaration.js +1 -1
  579. package/dist/i18n/declaration.js.map +1 -1
  580. package/dist/i18n/translation.cjs +3 -3
  581. package/dist/i18n/translation.cjs.map +1 -1
  582. package/dist/i18n/translation.js +321 -15
  583. package/dist/i18n/translation.js.map +1 -1
  584. package/dist/icons/stop-circle.cjs +1 -1
  585. package/dist/icons/stop-circle.cjs.map +1 -1
  586. package/dist/icons/stop-circle.js +7 -10
  587. package/dist/icons/stop-circle.js.map +1 -1
  588. package/dist/locales/ar/openhands.json +20 -2
  589. package/dist/locales/ca/openhands.json +20 -2
  590. package/dist/locales/de/openhands.json +20 -2
  591. package/dist/locales/en/openhands.json +20 -2
  592. package/dist/locales/es/openhands.json +20 -2
  593. package/dist/locales/fr/openhands.json +20 -2
  594. package/dist/locales/it/openhands.json +20 -2
  595. package/dist/locales/ja/openhands.json +20 -2
  596. package/dist/locales/ko-KR/openhands.json +20 -2
  597. package/dist/locales/no/openhands.json +20 -2
  598. package/dist/locales/pt/openhands.json +20 -2
  599. package/dist/locales/tr/openhands.json +20 -2
  600. package/dist/locales/uk/openhands.json +20 -2
  601. package/dist/locales/zh-CN/openhands.json +20 -2
  602. package/dist/locales/zh-TW/openhands.json +20 -2
  603. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs +2 -0
  604. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.cjs.map +1 -0
  605. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +15 -0
  606. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js.map +1 -0
  607. package/dist/package.cjs +1 -1
  608. package/dist/package.cjs.map +1 -1
  609. package/dist/package.js +1 -1
  610. package/dist/package.js.map +1 -1
  611. package/dist/routes/conversation.cjs +1 -1
  612. package/dist/routes/conversation.cjs.map +1 -1
  613. package/dist/routes/conversation.js +1 -1
  614. package/dist/routes/conversation.js.map +1 -1
  615. package/dist/routes/llm-settings.cjs +1 -1
  616. package/dist/routes/llm-settings.cjs.map +1 -1
  617. package/dist/routes/llm-settings.js +55 -54
  618. package/dist/routes/llm-settings.js.map +1 -1
  619. package/dist/routes/secrets-settings.cjs +1 -1
  620. package/dist/routes/secrets-settings.cjs.map +1 -1
  621. package/dist/routes/secrets-settings.js +19 -27
  622. package/dist/routes/secrets-settings.js.map +1 -1
  623. package/dist/stores/conversation-store.cjs +1 -1
  624. package/dist/stores/conversation-store.cjs.map +1 -1
  625. package/dist/stores/conversation-store.d.ts +4 -0
  626. package/dist/stores/conversation-store.js +6 -0
  627. package/dist/stores/conversation-store.js.map +1 -1
  628. package/dist/types/agent-server/core/events/acp-tool-call-event.d.ts +6 -4
  629. package/dist/types/agent-server/core/events/system-event.d.ts +5 -0
  630. package/dist/types/automation.d.ts +15 -0
  631. package/dist/types/settings.d.ts +3 -1
  632. package/dist/ui/combobox-caret.cjs +1 -1
  633. package/dist/ui/combobox-caret.cjs.map +1 -1
  634. package/dist/ui/combobox-caret.d.ts +1 -1
  635. package/dist/ui/combobox-caret.js +9 -8
  636. package/dist/ui/combobox-caret.js.map +1 -1
  637. package/dist/ui/context-menu.cjs +1 -1
  638. package/dist/ui/context-menu.cjs.map +1 -1
  639. package/dist/ui/context-menu.js +9 -8
  640. package/dist/ui/context-menu.js.map +1 -1
  641. package/dist/ui/dropdown/dropdown-menu.cjs +1 -1
  642. package/dist/ui/dropdown/dropdown-menu.cjs.map +1 -1
  643. package/dist/ui/dropdown/dropdown-menu.js +21 -17
  644. package/dist/ui/dropdown/dropdown-menu.js.map +1 -1
  645. package/dist/ui/dropdown/dropdown.cjs +1 -1
  646. package/dist/ui/dropdown/dropdown.cjs.map +1 -1
  647. package/dist/ui/dropdown/dropdown.js +2 -2
  648. package/dist/ui/dropdown/dropdown.js.map +1 -1
  649. package/dist/utils/automation-schedule.d.ts +1 -0
  650. package/dist/utils/dropdown-classes.cjs +2 -0
  651. package/dist/utils/dropdown-classes.cjs.map +1 -0
  652. package/dist/utils/dropdown-classes.d.ts +32 -0
  653. package/dist/utils/dropdown-classes.js +8 -0
  654. package/dist/utils/dropdown-classes.js.map +1 -0
  655. package/dist/utils/form-control-classes.cjs +1 -1
  656. package/dist/utils/form-control-classes.cjs.map +1 -1
  657. package/dist/utils/form-control-classes.d.ts +18 -2
  658. package/dist/utils/form-control-classes.js +4 -3
  659. package/dist/utils/form-control-classes.js.map +1 -1
  660. package/dist/utils/git-control-bar-classes.cjs +2 -0
  661. package/dist/utils/git-control-bar-classes.cjs.map +1 -0
  662. package/dist/utils/git-control-bar-classes.d.ts +4 -0
  663. package/dist/utils/git-control-bar-classes.js +14 -0
  664. package/dist/utils/git-control-bar-classes.js.map +1 -0
  665. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  666. package/dist/utils/handle-event-for-ui.d.ts +6 -3
  667. package/dist/utils/handle-event-for-ui.js.map +1 -1
  668. package/dist/utils/mobile-top-bar-icon-button-classes.cjs +1 -1
  669. package/dist/utils/mobile-top-bar-icon-button-classes.cjs.map +1 -1
  670. package/dist/utils/mobile-top-bar-icon-button-classes.js +3 -3
  671. package/dist/utils/mobile-top-bar-icon-button-classes.js.map +1 -1
  672. package/dist/utils/modal-classes.cjs +2 -0
  673. package/dist/utils/modal-classes.cjs.map +1 -0
  674. package/dist/utils/modal-classes.d.ts +8 -0
  675. package/dist/utils/modal-classes.js +7 -0
  676. package/dist/utils/modal-classes.js.map +1 -0
  677. package/dist/utils/openhands-llm.cjs +2 -0
  678. package/dist/utils/openhands-llm.cjs.map +1 -0
  679. package/dist/utils/openhands-llm.d.ts +2 -0
  680. package/dist/utils/openhands-llm.js +9 -0
  681. package/dist/utils/openhands-llm.js.map +1 -0
  682. package/dist/utils/redact-custom-secrets.cjs +2 -0
  683. package/dist/utils/redact-custom-secrets.cjs.map +1 -0
  684. package/dist/utils/redact-custom-secrets.d.ts +6 -0
  685. package/dist/utils/redact-custom-secrets.js +10 -0
  686. package/dist/utils/redact-custom-secrets.js.map +1 -0
  687. package/dist/utils/status.cjs +1 -1
  688. package/dist/utils/status.cjs.map +1 -1
  689. package/dist/utils/status.d.ts +2 -1
  690. package/dist/utils/status.js +9 -8
  691. package/dist/utils/status.js.map +1 -1
  692. package/dist/utils/system-message-adapter.cjs +1 -1
  693. package/dist/utils/system-message-adapter.cjs.map +1 -1
  694. package/dist/utils/system-message-adapter.js +10 -7
  695. package/dist/utils/system-message-adapter.js.map +1 -1
  696. package/dist/utils/utils.cjs +1 -1
  697. package/dist/utils/utils.cjs.map +1 -1
  698. package/dist/utils/utils.d.ts +2 -1
  699. package/dist/utils/utils.js +21 -20
  700. package/dist/utils/utils.js.map +1 -1
  701. package/package.json +1 -1
  702. package/scripts/dev-safe.mjs +3 -1
  703. package/scripts/dev-static.mjs +2 -2
  704. package/scripts/dev-with-automation.mjs +283 -108
  705. package/scripts/static-build.mjs +20 -19
  706. package/scripts/static-server.mjs +65 -6
  707. package/build/assets/acp-providers-CbiRekh9.js +0 -1
  708. package/build/assets/active-backend-context-cCM1vYYZ.js +0 -1
  709. package/build/assets/add-backend-modal-DIUQzMPa.js +0 -1
  710. package/build/assets/agent-server-client-options-Bc5ZorQZ.js +0 -1
  711. package/build/assets/agent-server-compatibility-BlkUsrX2.js +0 -1
  712. package/build/assets/agent-server-conversation-service.api-C2V5SlHu.js +0 -5
  713. package/build/assets/api-key-entry-screen-B2gynaCp.js +0 -1
  714. package/build/assets/automation-detail-DJvbVSYK.js +0 -1
  715. package/build/assets/automations-list-6FDbI5dc.js +0 -1
  716. package/build/assets/backend-form-modal-Dnk33xA_.js +0 -1
  717. package/build/assets/base-modal-_dYTw1ri.js +0 -1
  718. package/build/assets/brand-button-Br7f0kZJ.js +0 -1
  719. package/build/assets/browser-store-Couc4S5D.js +0 -1
  720. package/build/assets/clock-BRjCgHTc.js +0 -1
  721. package/build/assets/combobox-caret-to1O8irE.js +0 -1
  722. package/build/assets/context-menu-list-item-CWNFpuiC.js +0 -1
  723. package/build/assets/conversation-DVrKU0oz.js +0 -19
  724. package/build/assets/conversation-Dlys-D5A.js +0 -1
  725. package/build/assets/conversation-panel-iF09WjZ4.js +0 -1
  726. package/build/assets/conversation-service.api-CCfztilW.js +0 -1
  727. package/build/assets/conversation-state-store-u5jepov0.js +0 -1
  728. package/build/assets/conversation-store-Z5iMCRpc.js +0 -1
  729. package/build/assets/conversation-websocket-context-DhJhqUna.js +0 -3
  730. package/build/assets/declaration-BNMqORFE.js +0 -1
  731. package/build/assets/dist-BxBP7tFD.js +0 -1
  732. package/build/assets/edit-automation-modal-BGzR3nfZ.js +0 -1
  733. package/build/assets/ellipsis-button-ZyLMPURn.js +0 -1
  734. package/build/assets/entry.client-1VMHpktY.js +0 -2
  735. package/build/assets/enum-filter-dropdown-CEgCdu4A.js +0 -1
  736. package/build/assets/extensions-hub-C651jsVh.js +0 -1
  737. package/build/assets/files-tab-R5z0lLdY.js +0 -1
  738. package/build/assets/files-tab-store-CDyVTXNT.js +0 -1
  739. package/build/assets/git-control-bar-branch-button-COdRAYHb.js +0 -27
  740. package/build/assets/git-provider-icon-BzLbc0yC.js +0 -1
  741. package/build/assets/home-e-egNUXZ.js +0 -1
  742. package/build/assets/install-server-modal-DHlbgqVH.js +0 -1
  743. package/build/assets/launch-CshDse3e.js +0 -1
  744. package/build/assets/link-external-D2POYx4c.js +0 -1
  745. package/build/assets/llm-settings-Bql-vydt.js +0 -1
  746. package/build/assets/llm-settings-C_tal6Ds.js +0 -1
  747. package/build/assets/manage-backends-modal-l7RkKfwX.js +0 -1
  748. package/build/assets/manage-workspaces-modal-DhKF_8z3.js +0 -1
  749. package/build/assets/manifest-3bf30d69.js +0 -1
  750. package/build/assets/mcp-ByeBfdfU.js +0 -9
  751. package/build/assets/messages-D0rWot7s.js +0 -36
  752. package/build/assets/proxy-CxydCnis.js +0 -1
  753. package/build/assets/root-DHeCXo9N.css +0 -1
  754. package/build/assets/root-layout-Czo9Ma6Q.js +0 -2
  755. package/build/assets/secrets-service-BsnKFc2x.js +0 -1
  756. package/build/assets/secrets-settings-Bz_UohPJ.js +0 -1
  757. package/build/assets/settings-client-C73C7IgV.js +0 -1
  758. package/build/assets/settings-index-Dz0BmdJD.js +0 -1
  759. package/build/assets/settings-list-classes-Bf80tWtc.js +0 -1
  760. package/build/assets/settings-modal-Brzgh5Yw.js +0 -1
  761. package/build/assets/settings-service.api-CZ3uWx4v.js +0 -1
  762. package/build/assets/sidebar-mobile-menu-toggle-Do_aA9Zm.js +0 -1
  763. package/build/assets/skills-settings-DlA5hlXw.js +0 -2
  764. package/build/assets/status-hp6M6E7E.js +0 -1
  765. package/build/assets/use-agent-settings-schema-33Un7UF2.js +0 -1
  766. package/build/assets/use-is-authed-BggE5wPj.js +0 -1
  767. package/build/assets/use-llm-profiles-DDOol3gK.js +0 -1
  768. package/build/assets/use-runtime-is-ready-B7EF4BKU.js +0 -1
  769. package/build/assets/use-settings-DQIZmIov.js +0 -1
  770. package/build/assets/use-user-conversation-C6hrMMtn.js +0 -1
  771. package/build/assets/utils-i18rdUj2.js +0 -1
  772. package/build/assets/vendor~conversation-panel~conversation-a9SyrrhV.js +0 -1
  773. package/build/assets/vendor~conversation-panel~conversation~index-C23ZXO4R.js +0 -1
  774. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-BebWhFNT.js +0 -1
  775. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DzIXV3Ui.js +0 -9
  776. /package/build/assets/{automation-IdgZq6ZK.js → automation-XDPAjiZi.js} +0 -0
  777. /package/build/assets/{color-themes-DSaoIL6A.js → color-themes-B9pm9c-R.js} +0 -0
  778. /package/build/assets/{common-DR1t-EeP.js → common-DqjLSBOt.js} +0 -0
  779. /package/build/assets/{conversation-local-storage-UYl-SX-r.js → conversation-local-storage-YmOVXxxW.js} +0 -0
  780. /package/build/assets/{dist-C6t0EXL7.js → dist-C3NfioQC.js} +0 -0
  781. /package/build/assets/{environment-switch-store-C4ulFJKp.js → environment-switch-store-CiurvTtK.js} +0 -0
  782. /package/build/assets/{health-store-BDC2rM-X.js → health-store-B5f0S2FY.js} +0 -0
  783. /package/build/assets/{map-provider-COBVzZYo.js → map-provider-BJ_8KZKU.js} +0 -0
  784. /package/build/assets/{middleware-BC9EwbB9.js → middleware-CfatjPYZ.js} +0 -0
  785. /package/build/assets/{objectWithoutPropertiesLoose-Du6eBn-V.js → objectWithoutPropertiesLoose-DSQKyRhw.js} +0 -0
  786. /package/build/assets/{react-Do0CT17Y.js → react-Dy05vyj5.js} +0 -0
  787. /package/build/assets/{sdk-settings-field-metadata-CBPmeqYa.js → sdk-settings-field-metadata-DQiaIBie.js} +0 -0
  788. /package/build/assets/{settings-D_H-qsRm.js → settings-DGY6n4J2.js} +0 -0
  789. /package/build/assets/{settings-like-page-layout-classes-I0BDBEoq.js → settings-like-page-layout-classes-D7YjdTd0.js} +0 -0
  790. /package/build/assets/{use-breakpoint-DbJ6FkQ-.js → use-breakpoint-DF_RiQ6s.js} +0 -0
  791. /package/build/assets/{use-click-outside-element-DffgWWoZ.js → use-click-outside-element-DhxCUyWl.js} +0 -0
  792. /package/build/assets/{v4-CNn21NXa.js → v4-khGvL7i2.js} +0 -0
  793. /package/build/assets/{vendor~browser-DDiZgqD3.js → vendor~browser-DisFGEp9.js} +0 -0
  794. /package/build/assets/{vendor~browser-tab-BgwV1mxF.js → vendor~browser-tab-BxhTtM9_.js} +0 -0
  795. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-DbvX3OcM.js → vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js} +0 -0
  796. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js} +0 -0
  797. /package/build/assets/{vendor~files-tab-BGKayPiK.js → vendor~files-tab-BtkpAiMX.js} +0 -0
  798. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BW6261Sb.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CyZ-3lDQ.js} +0 -0
  799. /package/build/assets/{vendor~home~mcp~automations-list-DoPfwaXj.js → vendor~home~mcp~automations-list-BgV86Sti.js} +0 -0
  800. /package/build/assets/{vendor~launch-vdeRTWFu.js → vendor~launch-BXgl67Re.js} +0 -0
  801. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-D9P8e98a.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js} +0 -0
  802. /package/build/assets/{vendor~terminal-DUrOWGFE.js → vendor~terminal-DZaJIY8A.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"organization-service.api.cjs","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Routed through the bundled agent-server's `/api/cloud-proxy` to avoid\n * cross-origin browser calls.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{ orgId: string; userId: string }> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{ org_id: string; user_id: string }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n };\n}\n"],"mappings":"qLAeA,SAAS,EACP,EACqB,CACrB,MAAO,CACL,MAAO,GAAM,OAAS,EAAE,CACxB,aAAc,GAAM,gBAAkB,KACvC,CAGH,SAAS,EAAe,EAA4B,CAClD,GAAI,EAAS,OAAO,EACpB,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MACR,6EACD,CAEH,OAAO,EAWT,eAAsB,EACpB,EAC8B,CAO9B,OAAO,EAAgB,MALJ,EAAA,eAA2C,CAC5D,QAFa,EAAe,EAEnB,CACT,OAAQ,MACR,KAAM,qBACP,CAAC,CAC0B,CAc9B,eAAsB,EACpB,EACyD,CACzD,IAAM,EAAS,EAAe,EAAQ,CACtC,GAAI,CAMF,MAAO,CAAE,OAAO,MALG,EAAA,eAAoC,CACrD,QAAS,EACT,OAAQ,MACR,KAAM,oBACP,CAAC,GACoB,QAAU,KAAM,YAAa,GAAO,OACnD,EAAG,CACV,GAAI,EAAA,QAAM,aAAa,EAAE,EAAI,EAAE,UAAU,SAAW,IAClD,MAAO,CAAE,MAAO,KAAM,YAAa,GAAM,CAE3C,MAAM,GAWV,eAAsB,EACpB,EACA,EAC4C,CAE5C,IAAM,EAAO,MAAM,EAAA,eAAoD,CACrE,QAFa,EAAe,EAEnB,CACT,OAAQ,MACR,KAAM,sBAAsB,mBAAmB,EAAM,CAAC,KACvD,CAAC,CACF,MAAO,CACL,MAAO,GAAM,QAAU,EACvB,OAAQ,GAAM,SAAW,GAC1B"}
1
+ {"version":3,"file":"organization-service.api.cjs","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{ orgId: string; userId: string }> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{ org_id: string; user_id: string }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n };\n}\n"],"mappings":"qLAeA,SAAS,EACP,EACqB,CACrB,MAAO,CACL,MAAO,GAAM,OAAS,EAAE,CACxB,aAAc,GAAM,gBAAkB,KACvC,CAGH,SAAS,EAAe,EAA4B,CAClD,GAAI,EAAS,OAAO,EACpB,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MACR,6EACD,CAEH,OAAO,EAUT,eAAsB,EACpB,EAC8B,CAO9B,OAAO,EAAgB,MALJ,EAAA,eAA2C,CAC5D,QAFa,EAAe,EAEnB,CACT,OAAQ,MACR,KAAM,qBACP,CAAC,CAC0B,CAc9B,eAAsB,EACpB,EACyD,CACzD,IAAM,EAAS,EAAe,EAAQ,CACtC,GAAI,CAMF,MAAO,CAAE,OAAO,MALG,EAAA,eAAoC,CACrD,QAAS,EACT,OAAQ,MACR,KAAM,oBACP,CAAC,GACoB,QAAU,KAAM,YAAa,GAAO,OACnD,EAAG,CACV,GAAI,EAAA,QAAM,aAAa,EAAE,EAAI,EAAE,UAAU,SAAW,IAClD,MAAO,CAAE,MAAO,KAAM,YAAa,GAAM,CAE3C,MAAM,GAWV,eAAsB,EACpB,EACA,EAC4C,CAE5C,IAAM,EAAO,MAAM,EAAA,eAAoD,CACrE,QAFa,EAAe,EAEnB,CACT,OAAQ,MACR,KAAM,sBAAsB,mBAAmB,EAAM,CAAC,KACvD,CAAC,CACF,MAAO,CACL,MAAO,GAAM,QAAU,EACvB,OAAQ,GAAM,SAAW,GAC1B"}
@@ -9,8 +9,7 @@ interface OrganizationsResult {
9
9
  * cloud backend; pass `backend` explicitly to fetch for an inactive cloud
10
10
  * (used by the selector to flatten all cloud rows).
11
11
  *
12
- * Routed through the bundled agent-server's `/api/cloud-proxy` to avoid
13
- * cross-origin browser calls.
12
+ * Calls the cloud API directly with the backend's bearer token.
14
13
  */
15
14
  export declare function getCloudOrganizations(backend?: Backend): Promise<OrganizationsResult>;
16
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"organization-service.api.js","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Routed through the bundled agent-server's `/api/cloud-proxy` to avoid\n * cross-origin browser calls.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{ orgId: string; userId: string }> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{ org_id: string; user_id: string }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n };\n}\n"],"mappings":";;;;AAeA,SAAS,EACP,GACqB;AACrB,QAAO;EACL,OAAO,GAAM,SAAS,EAAE;EACxB,cAAc,GAAM,kBAAkB;EACvC;;AAGH,SAAS,EAAe,GAA4B;AAClD,KAAI,EAAS,QAAO;CACpB,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MACR,6EACD;AAEH,QAAO;;AAWT,eAAsB,EACpB,GAC8B;AAO9B,QAAO,EAAgB,MALJ,EAA2C;EAC5D,SAFa,EAAe,EAEnB;EACT,QAAQ;EACR,MAAM;EACP,CAAC,CAC0B;;AAc9B,eAAsB,EACpB,GACyD;CACzD,IAAM,IAAS,EAAe,EAAQ;AACtC,KAAI;AAMF,SAAO;GAAE,QAAO,MALG,EAAoC;IACrD,SAAS;IACT,QAAQ;IACR,MAAM;IACP,CAAC,GACoB,UAAU;GAAM,aAAa;GAAO;UACnD,GAAG;AACV,MAAI,EAAM,aAAa,EAAE,IAAI,EAAE,UAAU,WAAW,IAClD,QAAO;GAAE,OAAO;GAAM,aAAa;GAAM;AAE3C,QAAM;;;AAWV,eAAsB,EACpB,GACA,GAC4C;CAE5C,IAAM,IAAO,MAAM,EAAoD;EACrE,SAFa,EAAe,EAEnB;EACT,QAAQ;EACR,MAAM,sBAAsB,mBAAmB,EAAM,CAAC;EACvD,CAAC;AACF,QAAO;EACL,OAAO,GAAM,UAAU;EACvB,QAAQ,GAAM,WAAW;EAC1B"}
1
+ {"version":3,"file":"organization-service.api.js","names":[],"sources":["../../../src/api/cloud/organization-service.api.ts"],"sourcesContent":["import axios from \"axios\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type {\n CloudApiKeyMetadata,\n CloudOrganization,\n CloudOrganizationsResponse,\n} from \"./types\";\n\ninterface OrganizationsResult {\n items: CloudOrganization[];\n currentOrgId: string | null;\n}\n\nfunction normalizeResult(\n data: CloudOrganizationsResponse | undefined | null,\n): OrganizationsResult {\n return {\n items: data?.items ?? [],\n currentOrgId: data?.current_org_id ?? null,\n };\n}\n\nfunction resolveBackend(backend?: Backend): Backend {\n if (backend) return backend;\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\n \"Cloud organization calls require a cloud backend. Active backend is local.\",\n );\n }\n return active;\n}\n\n/**\n * Fetch the org list for a cloud backend. With no argument, uses the active\n * cloud backend; pass `backend` explicitly to fetch for an inactive cloud\n * (used by the selector to flatten all cloud rows).\n *\n * Calls the cloud API directly with the backend's bearer token.\n */\nexport async function getCloudOrganizations(\n backend?: Backend,\n): Promise<OrganizationsResult> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<CloudOrganizationsResponse>({\n backend: target,\n method: \"GET\",\n path: \"/api/organizations\",\n });\n return normalizeResult(data);\n}\n\n/**\n * Fetch metadata for the API key used to authenticate this cloud backend.\n * The returned `orgId` is the single org the key is authorized to act on\n * (the cloud contract: one key → one org).\n *\n * Legacy keys minted before per-key org binding existed cause the upstream\n * to return HTTP 400 — we surface that as `isLegacyKey: true` with a null\n * `orgId` so the caller can fall back to the unfiltered behavior. Other\n * statuses (401 revoked, 5xx outage) propagate so React Query can mark\n * the query as failed and the selector can render the no-org-known row.\n */\nexport async function getCurrentCloudApiKey(\n backend?: Backend,\n): Promise<{ orgId: string | null; isLegacyKey: boolean }> {\n const target = resolveBackend(backend);\n try {\n const data = await callCloudProxy<CloudApiKeyMetadata>({\n backend: target,\n method: \"GET\",\n path: \"/api/keys/current\",\n });\n return { orgId: data?.org_id ?? null, isLegacyKey: false };\n } catch (e) {\n if (axios.isAxiosError(e) && e.response?.status === 400) {\n return { orgId: null, isLegacyKey: true };\n }\n throw e;\n }\n}\n\n/**\n * Fetch `GET /api/organizations/{orgId}/me`. Identifies the calling user as\n * a member of `orgId`. The GUI uses `me.org_id === me.user_id` to decide\n * whether `orgId` is the user's personal workspace — that's the cloud\n * contract (the auto-generated personal-workspace org has the same id as\n * the user).\n */\nexport async function getCloudOrganizationMe(\n orgId: string,\n backend?: Backend,\n): Promise<{ orgId: string; userId: string }> {\n const target = resolveBackend(backend);\n const data = await callCloudProxy<{ org_id: string; user_id: string }>({\n backend: target,\n method: \"GET\",\n path: `/api/organizations/${encodeURIComponent(orgId)}/me`,\n });\n return {\n orgId: data?.org_id ?? orgId,\n userId: data?.user_id ?? \"\",\n };\n}\n"],"mappings":";;;;AAeA,SAAS,EACP,GACqB;AACrB,QAAO;EACL,OAAO,GAAM,SAAS,EAAE;EACxB,cAAc,GAAM,kBAAkB;EACvC;;AAGH,SAAS,EAAe,GAA4B;AAClD,KAAI,EAAS,QAAO;CACpB,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MACR,6EACD;AAEH,QAAO;;AAUT,eAAsB,EACpB,GAC8B;AAO9B,QAAO,EAAgB,MALJ,EAA2C;EAC5D,SAFa,EAAe,EAEnB;EACT,QAAQ;EACR,MAAM;EACP,CAAC,CAC0B;;AAc9B,eAAsB,EACpB,GACyD;CACzD,IAAM,IAAS,EAAe,EAAQ;AACtC,KAAI;AAMF,SAAO;GAAE,QAAO,MALG,EAAoC;IACrD,SAAS;IACT,QAAQ;IACR,MAAM;IACP,CAAC,GACoB,UAAU;GAAM,aAAa;GAAO;UACnD,GAAG;AACV,MAAI,EAAM,aAAa,EAAE,IAAI,EAAE,UAAU,WAAW,IAClD,QAAO;GAAE,OAAO;GAAM,aAAa;GAAM;AAE3C,QAAM;;;AAWV,eAAsB,EACpB,GACA,GAC4C;CAE5C,IAAM,IAAO,MAAM,EAAoD;EACrE,SAFa,EAAe,EAEnB;EACT,QAAQ;EACR,MAAM,sBAAsB,mBAAmB,EAAM,CAAC;EACvD,CAAC;AACF,QAAO;EACL,OAAO,GAAM,UAAU;EACvB,QAAQ,GAAM,WAAW;EAC1B"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/axios/lib/axios.cjs`),r=require(`../backend-registry/auth.cjs`);function i(e){let t=e.authMode??`bearer`;return t===`bearer`?r.buildAuthHeaders(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function a(a){let o=t.getEffectiveLocalBackend(),s={...r.buildAuthHeaders(o),...e.getAgentServerHeaders()},c=t.getActiveBackend(),l=c.backend.id===a.backend.id&&c.orgId?{"X-Org-Id":c.orgId}:{},u={...i(a),...l,...a.headers??{}},d=a.hostOverride??a.backend.host;return(await n.default.post(`${o.host.replace(/\/+$/,``)}/api/cloud-proxy`,{host:d,method:a.method,path:a.path,headers:u,body:a.body??null,...a.timeoutSeconds?{timeout_seconds:a.timeoutSeconds}:{}},{headers:s,timeout:3e4,...a.responseType?{responseType:a.responseType}:{}})).data}exports.callCloudProxy=a;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/axios/lib/axios.cjs`),r=require(`../agent-server-client-options.cjs`),i=require(`../backend-registry/auth.cjs`);function a(e){let t=e.authMode??`bearer`;return t===`bearer`?i.buildAuthHeaders(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function o(i){let o=t.getActiveBackend(),s=o.backend.id===i.backend.id&&o.orgId?{"X-Org-Id":o.orgId}:{},c={...a(i),...s,...i.headers??{}},l=i.hostOverride??i.backend.host;if(!i.hostOverride)return(await n.default.request({url:`${l.replace(/\/+$/,``)}${i.path}`,method:i.method,headers:c,...i.body===void 0?{}:{data:i.body},timeout:(i.timeoutSeconds??30)*1e3,...i.responseType?{responseType:i.responseType}:{}})).data;let u=e.getAgentServerBaseUrl();if(!u)throw new r.NoBackendAvailableError;let d=e.getAgentServerHeaders();return(await n.default.post(`${u.replace(/\/+$/,``)}/api/cloud-proxy`,{host:l,method:i.method,path:i.path,headers:c,body:i.body??null,...i.timeoutSeconds?{timeout_seconds:i.timeoutSeconds}:{}},{headers:d,timeout:3e4,...i.responseType?{responseType:i.responseType}:{}})).data}exports.callCloudProxy=o;
2
2
  //# sourceMappingURL=proxy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.cjs","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { getAgentServerHeaders } from \"../agent-server-config\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * POST a cloud-proxy envelope to the local agent-server. The local server\n * forwards the request to the upstream host server-side, which sidesteps\n * the cross-origin restrictions that would block a direct browser → cloud\n * or browser runtime-sandbox call.\n *\n * Auth headers (bearer or session-api-key) are attached server-side; they\n * never cross an origin boundary in the browser.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n const local = getEffectiveLocalBackend();\n const localAuthHeaders = {\n ...buildAuthHeaders(local),\n ...getAgentServerHeaders(),\n };\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n // Talk directly to the local agent-server, bypassing the global\n // local agent-server client configuration (which would otherwise read host + auth\n // from the active backend wrong for this call: we need the local\n // backend's host and session key explicitly, not the active one).\n const response = await axios.post<TResponse>(\n `${local.host.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":"8OAoDA,SAAS,EACP,EACwB,CACxB,IAAM,EAAO,EAAI,UAAY,SAK7B,OAJI,IAAS,SAAiB,EAAA,iBAAiB,EAAI,QAAQ,CACvD,IAAS,mBACJ,EAAI,cAAgB,CAAE,oBAAqB,EAAI,cAAe,CAAG,EAAE,CAc9E,eAAsB,EACpB,EACoB,CACpB,IAAM,EAAQ,EAAA,0BAA0B,CAClC,EAAmB,CACvB,GAAG,EAAA,iBAAiB,EAAM,CAC1B,GAAG,EAAA,uBAAuB,CAC3B,CAQK,EAAS,EAAA,kBAAkB,CAC3B,EACJ,EAAO,QAAQ,KAAO,EAAI,QAAQ,IAAM,EAAO,MAC3C,CAAE,WAAY,EAAO,MAAO,CAC5B,EAAE,CACF,EAAkB,CACtB,GAAG,EAAyB,EAAI,CAChC,GAAG,EACH,GAAI,EAAI,SAAW,EAAE,CACtB,CACK,EAAe,EAAI,cAAgB,EAAI,QAAQ,KAuBrD,OAAO,MAjBgB,EAAA,QAAM,KAC3B,GAAG,EAAM,KAAK,QAAQ,OAAQ,GAAG,CAAC,kBAClC,CACE,KAAM,EACN,OAAQ,EAAI,OACZ,KAAM,EAAI,KACV,QAAS,EACT,KAAM,EAAI,MAAQ,KAClB,GAAI,EAAI,eAAiB,CAAE,gBAAiB,EAAI,eAAgB,CAAG,EAAE,CACtE,CACD,CACE,QAAS,EACT,QAAS,IACT,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CACF,EAEe"}
1
+ {"version":3,"file":"proxy.cjs","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass\n * `hostOverride`, and those still go through `/api/cloud-proxy` because the\n * per-conversation runtime hosts are not the configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Runtime auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":"8RAqDA,SAAS,EACP,EACwB,CACxB,IAAM,EAAO,EAAI,UAAY,SAK7B,OAJI,IAAS,SAAiB,EAAA,iBAAiB,EAAI,QAAQ,CACvD,IAAS,mBACJ,EAAI,cAAgB,CAAE,oBAAqB,EAAI,cAAe,CAAG,EAAE,CAc9E,eAAsB,EACpB,EACoB,CAQpB,IAAM,EAAS,EAAA,kBAAkB,CAC3B,EACJ,EAAO,QAAQ,KAAO,EAAI,QAAQ,IAAM,EAAO,MAC3C,CAAE,WAAY,EAAO,MAAO,CAC5B,EAAE,CACF,EAAkB,CACtB,GAAG,EAAyB,EAAI,CAChC,GAAG,EACH,GAAI,EAAI,SAAW,EAAE,CACtB,CACK,EAAe,EAAI,cAAgB,EAAI,QAAQ,KAErD,GAAI,CAAC,EAAI,aAUP,OAAO,MATgB,EAAA,QAAM,QAAmB,CAC9C,IAAK,GAAG,EAAa,QAAQ,OAAQ,GAAG,GAAG,EAAI,OAC/C,OAAQ,EAAI,OACZ,QAAS,EACT,GAAI,EAAI,OAAS,IAAA,GAAiC,EAAE,CAAvB,CAAE,KAAM,EAAI,KAAM,CAC/C,SAAU,EAAI,gBAAkB,IAAM,IACtC,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CAAC,EAEc,KAGlB,IAAM,EAAe,EAAA,uBAAuB,CAC5C,GAAI,CAAC,EAAc,MAAM,IAAI,EAAA,wBAC7B,IAAM,EAAmB,EAAA,uBAAuB,CAuBhD,OAAO,MAjBgB,EAAA,QAAM,KAC3B,GAAG,EAAa,QAAQ,OAAQ,GAAG,CAAC,kBACpC,CACE,KAAM,EACN,OAAQ,EAAI,OACZ,KAAM,EAAI,KACV,QAAS,EACT,KAAM,EAAI,MAAQ,KAClB,GAAI,EAAI,eAAiB,CAAE,gBAAiB,EAAI,eAAgB,CAAG,EAAE,CACtE,CACD,CACE,QAAS,EACT,QAAS,IACT,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CACF,EAEe"}
@@ -42,13 +42,13 @@ interface CloudProxyRequest {
42
42
  responseType?: "blob";
43
43
  }
44
44
  /**
45
- * POST a cloud-proxy envelope to the local agent-server. The local server
46
- * forwards the request to the upstream host server-side, which sidesteps
47
- * the cross-origin restrictions that would block a direct browser → cloud
48
- * or browser runtime-sandbox call.
45
+ * Send a cloud request. App-host calls (`backend.host`) go directly to the
46
+ * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass
47
+ * `hostOverride`, and those still go through `/api/cloud-proxy` because the
48
+ * per-conversation runtime hosts are not the configured cloud app origin.
49
49
  *
50
- * Auth headers (bearer or session-api-key) are attached server-side; they
51
- * never cross an origin boundary in the browser.
50
+ * App-host auth headers are sent directly to the cloud host. Runtime auth
51
+ * headers are carried in the proxy envelope and attached server-side.
52
52
  */
53
53
  export declare function callCloudProxy<TResponse = unknown>(req: CloudProxyRequest): Promise<TResponse>;
54
54
  export {};
@@ -1,35 +1,44 @@
1
- import { getAgentServerHeaders as e } from "../agent-server-config.js";
2
- import { getActiveBackend as t, getEffectiveLocalBackend as n } from "../backend-registry/active-store.js";
1
+ import { getAgentServerBaseUrl as e, getAgentServerHeaders as t } from "../agent-server-config.js";
2
+ import { getActiveBackend as n } from "../backend-registry/active-store.js";
3
3
  import r from "../../node_modules/axios/lib/axios.js";
4
- import { buildAuthHeaders as i } from "../backend-registry/auth.js";
4
+ import { NoBackendAvailableError as i } from "../agent-server-client-options.js";
5
+ import { buildAuthHeaders as a } from "../backend-registry/auth.js";
5
6
  //#region src/api/cloud/proxy.ts
6
- function a(e) {
7
+ function o(e) {
7
8
  let t = e.authMode ?? "bearer";
8
- return t === "bearer" ? i(e.backend) : t === "session-api-key" && e.sessionApiKey ? { "X-Session-API-Key": e.sessionApiKey } : {};
9
+ return t === "bearer" ? a(e.backend) : t === "session-api-key" && e.sessionApiKey ? { "X-Session-API-Key": e.sessionApiKey } : {};
9
10
  }
10
- async function o(o) {
11
- let s = n(), c = {
12
- ...i(s),
13
- ...e()
14
- }, l = t(), u = l.backend.id === o.backend.id && l.orgId ? { "X-Org-Id": l.orgId } : {}, d = {
15
- ...a(o),
16
- ...u,
17
- ...o.headers ?? {}
18
- }, f = o.hostOverride ?? o.backend.host;
19
- return (await r.post(`${s.host.replace(/\/+$/, "")}/api/cloud-proxy`, {
20
- host: f,
21
- method: o.method,
22
- path: o.path,
23
- headers: d,
24
- body: o.body ?? null,
25
- ...o.timeoutSeconds ? { timeout_seconds: o.timeoutSeconds } : {}
11
+ async function s(a) {
12
+ let s = n(), c = s.backend.id === a.backend.id && s.orgId ? { "X-Org-Id": s.orgId } : {}, l = {
13
+ ...o(a),
14
+ ...c,
15
+ ...a.headers ?? {}
16
+ }, u = a.hostOverride ?? a.backend.host;
17
+ if (!a.hostOverride) return (await r.request({
18
+ url: `${u.replace(/\/+$/, "")}${a.path}`,
19
+ method: a.method,
20
+ headers: l,
21
+ ...a.body === void 0 ? {} : { data: a.body },
22
+ timeout: (a.timeoutSeconds ?? 30) * 1e3,
23
+ ...a.responseType ? { responseType: a.responseType } : {}
24
+ })).data;
25
+ let d = e();
26
+ if (!d) throw new i();
27
+ let f = t();
28
+ return (await r.post(`${d.replace(/\/+$/, "")}/api/cloud-proxy`, {
29
+ host: u,
30
+ method: a.method,
31
+ path: a.path,
32
+ headers: l,
33
+ body: a.body ?? null,
34
+ ...a.timeoutSeconds ? { timeout_seconds: a.timeoutSeconds } : {}
26
35
  }, {
27
- headers: c,
36
+ headers: f,
28
37
  timeout: 3e4,
29
- ...o.responseType ? { responseType: o.responseType } : {}
38
+ ...a.responseType ? { responseType: a.responseType } : {}
30
39
  })).data;
31
40
  }
32
41
  //#endregion
33
- export { o as callCloudProxy };
42
+ export { s as callCloudProxy };
34
43
 
35
44
  //# sourceMappingURL=proxy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.js","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { getAgentServerHeaders } from \"../agent-server-config\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * POST a cloud-proxy envelope to the local agent-server. The local server\n * forwards the request to the upstream host server-side, which sidesteps\n * the cross-origin restrictions that would block a direct browser → cloud\n * or browser runtime-sandbox call.\n *\n * Auth headers (bearer or session-api-key) are attached server-side; they\n * never cross an origin boundary in the browser.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n const local = getEffectiveLocalBackend();\n const localAuthHeaders = {\n ...buildAuthHeaders(local),\n ...getAgentServerHeaders(),\n };\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n // Talk directly to the local agent-server, bypassing the global\n // local agent-server client configuration (which would otherwise read host + auth\n // from the active backend wrong for this call: we need the local\n // backend's host and session key explicitly, not the active one).\n const response = await axios.post<TResponse>(\n `${local.host.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":";;;;;AAoDA,SAAS,EACP,GACwB;CACxB,IAAM,IAAO,EAAI,YAAY;AAK7B,QAJI,MAAS,WAAiB,EAAiB,EAAI,QAAQ,GACvD,MAAS,qBACJ,EAAI,gBAAgB,EAAE,qBAAqB,EAAI,eAAe,GAAG,EAAE;;AAc9E,eAAsB,EACpB,GACoB;CACpB,IAAM,IAAQ,GAA0B,EAClC,IAAmB;EACvB,GAAG,EAAiB,EAAM;EAC1B,GAAG,GAAuB;EAC3B,EAQK,IAAS,GAAkB,EAC3B,IACJ,EAAO,QAAQ,OAAO,EAAI,QAAQ,MAAM,EAAO,QAC3C,EAAE,YAAY,EAAO,OAAO,GAC5B,EAAE,EACF,IAAkB;EACtB,GAAG,EAAyB,EAAI;EAChC,GAAG;EACH,GAAI,EAAI,WAAW,EAAE;EACtB,EACK,IAAe,EAAI,gBAAgB,EAAI,QAAQ;AAuBrD,SAAO,MAjBgB,EAAM,KAC3B,GAAG,EAAM,KAAK,QAAQ,QAAQ,GAAG,CAAC,mBAClC;EACE,MAAM;EACN,QAAQ,EAAI;EACZ,MAAM,EAAI;EACV,SAAS;EACT,MAAM,EAAI,QAAQ;EAClB,GAAI,EAAI,iBAAiB,EAAE,iBAAiB,EAAI,gBAAgB,GAAG,EAAE;EACtE,EACD;EACE,SAAS;EACT,SAAS;EACT,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CACF,EAEe"}
1
+ {"version":3,"file":"proxy.js","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass\n * `hostOverride`, and those still go through `/api/cloud-proxy` because the\n * per-conversation runtime hosts are not the configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Runtime auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":";;;;;;AAqDA,SAAS,EACP,GACwB;CACxB,IAAM,IAAO,EAAI,YAAY;AAK7B,QAJI,MAAS,WAAiB,EAAiB,EAAI,QAAQ,GACvD,MAAS,qBACJ,EAAI,gBAAgB,EAAE,qBAAqB,EAAI,eAAe,GAAG,EAAE;;AAc9E,eAAsB,EACpB,GACoB;CAQpB,IAAM,IAAS,GAAkB,EAC3B,IACJ,EAAO,QAAQ,OAAO,EAAI,QAAQ,MAAM,EAAO,QAC3C,EAAE,YAAY,EAAO,OAAO,GAC5B,EAAE,EACF,IAAkB;EACtB,GAAG,EAAyB,EAAI;EAChC,GAAG;EACH,GAAI,EAAI,WAAW,EAAE;EACtB,EACK,IAAe,EAAI,gBAAgB,EAAI,QAAQ;AAErD,KAAI,CAAC,EAAI,aAUP,SAAO,MATgB,EAAM,QAAmB;EAC9C,KAAK,GAAG,EAAa,QAAQ,QAAQ,GAAG,GAAG,EAAI;EAC/C,QAAQ,EAAI;EACZ,SAAS;EACT,GAAI,EAAI,SAAS,KAAA,IAAiC,EAAE,GAAvB,EAAE,MAAM,EAAI,MAAM;EAC/C,UAAU,EAAI,kBAAkB,MAAM;EACtC,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CAAC,EAEc;CAGlB,IAAM,IAAe,GAAuB;AAC5C,KAAI,CAAC,EAAc,OAAM,IAAI,GAAyB;CACtD,IAAM,IAAmB,GAAuB;AAuBhD,SAAO,MAjBgB,EAAM,KAC3B,GAAG,EAAa,QAAQ,QAAQ,GAAG,CAAC,mBACpC;EACE,MAAM;EACN,QAAQ,EAAI;EACZ,MAAM,EAAI;EACV,SAAS;EACT,MAAM,EAAI,QAAQ;EAClB,GAAI,EAAI,iBAAiB,EAAE,iBAAiB,EAAI,gBAAgB,GAAG,EAAE;EACtE,EACD;EACE,SAAS;EACT,SAAS;EACT,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CACF,EAEe"}
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-service.api.cjs","names":[],"sources":["../../../src/api/cloud/sandbox-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type { V1SandboxInfo } from \"./sandbox-service.types\";\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud sandboxes call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Batch-fetch cloud sandboxes by id. Mirrors OpenHands'\n * `SandboxService.batchGetSandboxes` routes through the bundled\n * agent-server's cloud proxy and hits `GET /api/v1/sandboxes?id=...` on\n * the cloud backend, returning each `SandboxInfo` (or null if not found).\n *\n * The returned `SandboxInfo.exposed_urls` carry the cloud-computed,\n * publicly-reachable URLs for the sandbox's services (VSCODE,\n * AGENT_SERVER, WORKER_*) — the GUI reads them directly instead of\n * asking the runtime for `/api/vscode/url`, which only knows its\n * internal localhost address.\n */\nexport async function batchGetCloudSandboxes(\n ids: string[],\n): Promise<(V1SandboxInfo | null)[]> {\n if (ids.length === 0) return [];\n const backend = getActiveCloudBackend();\n const params = new URLSearchParams();\n for (const id of ids) params.append(\"id\", id);\n const data = await callCloudProxy<(V1SandboxInfo | null)[]>({\n backend,\n method: \"GET\",\n path: `/api/v1/sandboxes?${params.toString()}`,\n });\n return data ?? [];\n}\n"],"mappings":"iIAKA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,iDAAiD,CAEnE,OAAO,EAeT,eAAsB,EACpB,EACmC,CACnC,GAAI,EAAI,SAAW,EAAG,MAAO,EAAE,CAC/B,IAAM,EAAU,GAAuB,CACjC,EAAS,IAAI,gBACnB,IAAK,IAAM,KAAM,EAAK,EAAO,OAAO,KAAM,EAAG,CAM7C,OAAO,MALY,EAAA,eAAyC,CAC1D,UACA,OAAQ,MACR,KAAM,qBAAqB,EAAO,UAAU,GAC7C,CAAC,EACa,EAAE"}
1
+ {"version":3,"file":"sandbox-service.api.cjs","names":[],"sources":["../../../src/api/cloud/sandbox-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type { V1SandboxInfo } from \"./sandbox-service.types\";\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud sandboxes call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Batch-fetch cloud sandboxes by id. Mirrors OpenHands'\n * `SandboxService.batchGetSandboxes` by calling\n * `GET /api/v1/sandboxes?id=...` on the cloud backend, returning each\n * `SandboxInfo` (or null if not found).\n *\n * The returned `SandboxInfo.exposed_urls` carry the cloud-computed,\n * publicly-reachable URLs for the sandbox's services (VSCODE,\n * AGENT_SERVER, WORKER_*) — the GUI reads them directly instead of\n * asking the runtime for `/api/vscode/url`, which only knows its\n * internal localhost address.\n */\nexport async function batchGetCloudSandboxes(\n ids: string[],\n): Promise<(V1SandboxInfo | null)[]> {\n if (ids.length === 0) return [];\n const backend = getActiveCloudBackend();\n const params = new URLSearchParams();\n for (const id of ids) params.append(\"id\", id);\n const data = await callCloudProxy<(V1SandboxInfo | null)[]>({\n backend,\n method: \"GET\",\n path: `/api/v1/sandboxes?${params.toString()}`,\n });\n return data ?? [];\n}\n"],"mappings":"iIAKA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,iDAAiD,CAEnE,OAAO,EAeT,eAAsB,EACpB,EACmC,CACnC,GAAI,EAAI,SAAW,EAAG,MAAO,EAAE,CAC/B,IAAM,EAAU,GAAuB,CACjC,EAAS,IAAI,gBACnB,IAAK,IAAM,KAAM,EAAK,EAAO,OAAO,KAAM,EAAG,CAM7C,OAAO,MALY,EAAA,eAAyC,CAC1D,UACA,OAAQ,MACR,KAAM,qBAAqB,EAAO,UAAU,GAC7C,CAAC,EACa,EAAE"}
@@ -1,9 +1,9 @@
1
1
  import type { V1SandboxInfo } from "./sandbox-service.types";
2
2
  /**
3
3
  * Batch-fetch cloud sandboxes by id. Mirrors OpenHands'
4
- * `SandboxService.batchGetSandboxes` routes through the bundled
5
- * agent-server's cloud proxy and hits `GET /api/v1/sandboxes?id=...` on
6
- * the cloud backend, returning each `SandboxInfo` (or null if not found).
4
+ * `SandboxService.batchGetSandboxes` by calling
5
+ * `GET /api/v1/sandboxes?id=...` on the cloud backend, returning each
6
+ * `SandboxInfo` (or null if not found).
7
7
  *
8
8
  * The returned `SandboxInfo.exposed_urls` carry the cloud-computed,
9
9
  * publicly-reachable URLs for the sandbox's services (VSCODE,
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-service.api.js","names":[],"sources":["../../../src/api/cloud/sandbox-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type { V1SandboxInfo } from \"./sandbox-service.types\";\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud sandboxes call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Batch-fetch cloud sandboxes by id. Mirrors OpenHands'\n * `SandboxService.batchGetSandboxes` routes through the bundled\n * agent-server's cloud proxy and hits `GET /api/v1/sandboxes?id=...` on\n * the cloud backend, returning each `SandboxInfo` (or null if not found).\n *\n * The returned `SandboxInfo.exposed_urls` carry the cloud-computed,\n * publicly-reachable URLs for the sandbox's services (VSCODE,\n * AGENT_SERVER, WORKER_*) — the GUI reads them directly instead of\n * asking the runtime for `/api/vscode/url`, which only knows its\n * internal localhost address.\n */\nexport async function batchGetCloudSandboxes(\n ids: string[],\n): Promise<(V1SandboxInfo | null)[]> {\n if (ids.length === 0) return [];\n const backend = getActiveCloudBackend();\n const params = new URLSearchParams();\n for (const id of ids) params.append(\"id\", id);\n const data = await callCloudProxy<(V1SandboxInfo | null)[]>({\n backend,\n method: \"GET\",\n path: `/api/v1/sandboxes?${params.toString()}`,\n });\n return data ?? [];\n}\n"],"mappings":";;;AAKA,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,iDAAiD;AAEnE,QAAO;;AAeT,eAAsB,EACpB,GACmC;AACnC,KAAI,EAAI,WAAW,EAAG,QAAO,EAAE;CAC/B,IAAM,IAAU,GAAuB,EACjC,IAAS,IAAI,iBAAiB;AACpC,MAAK,IAAM,KAAM,EAAK,GAAO,OAAO,MAAM,EAAG;AAM7C,QAAO,MALY,EAAyC;EAC1D;EACA,QAAQ;EACR,MAAM,qBAAqB,EAAO,UAAU;EAC7C,CAAC,IACa,EAAE"}
1
+ {"version":3,"file":"sandbox-service.api.js","names":[],"sources":["../../../src/api/cloud/sandbox-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\nimport type { V1SandboxInfo } from \"./sandbox-service.types\";\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud sandboxes call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Batch-fetch cloud sandboxes by id. Mirrors OpenHands'\n * `SandboxService.batchGetSandboxes` by calling\n * `GET /api/v1/sandboxes?id=...` on the cloud backend, returning each\n * `SandboxInfo` (or null if not found).\n *\n * The returned `SandboxInfo.exposed_urls` carry the cloud-computed,\n * publicly-reachable URLs for the sandbox's services (VSCODE,\n * AGENT_SERVER, WORKER_*) — the GUI reads them directly instead of\n * asking the runtime for `/api/vscode/url`, which only knows its\n * internal localhost address.\n */\nexport async function batchGetCloudSandboxes(\n ids: string[],\n): Promise<(V1SandboxInfo | null)[]> {\n if (ids.length === 0) return [];\n const backend = getActiveCloudBackend();\n const params = new URLSearchParams();\n for (const id of ids) params.append(\"id\", id);\n const data = await callCloudProxy<(V1SandboxInfo | null)[]>({\n backend,\n method: \"GET\",\n path: `/api/v1/sandboxes?${params.toString()}`,\n });\n return data ?? [];\n}\n"],"mappings":";;;AAKA,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,iDAAiD;AAEnE,QAAO;;AAeT,eAAsB,EACpB,GACmC;AACnC,KAAI,EAAI,WAAW,EAAG,QAAO,EAAE;CAC/B,IAAM,IAAU,GAAuB,EACjC,IAAS,IAAI,iBAAiB;AACpC,MAAK,IAAM,KAAM,EAAK,GAAO,OAAO,MAAM,EAAG;AAM7C,QAAO,MALY,EAAyC;EAC1D;EACA,QAAQ;EACR,MAAM,qBAAqB,EAAO,UAAU;EAC7C,CAAC,IACa,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"secrets-service.api.cjs","names":[],"sources":["../../../src/api/cloud/secrets-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport type { CustomSecretWithoutValue } from \"../secrets-service.types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSecretsPage {\n items: CustomSecretWithoutValue[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud secrets call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Walk every page of the cloud `/api/v1/secrets/search` endpoint via the\n * bundled `/api/cloud-proxy` and return the merged list. The cloud shape\n * (name + description) matches `CustomSecretWithoutValue`, so items pass\n * through unchanged.\n */\nexport async function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]> {\n const backend = getActiveCloudBackend();\n\n const secrets: CustomSecretWithoutValue[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSecretsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/secrets/search?${query.toString()}`,\n });\n\n secrets.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return secrets;\n}\n\nexport async function createCloudSecret(\n name: string,\n value: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/secrets\",\n body: { name, value, description },\n });\n}\n\n/**\n * Rename and/or redescribe an existing cloud secret. The cloud `PUT` endpoint\n * does not accept a value field — it only updates name + description — which\n * matches what `useUpdateSecret` actually sends from the secret-edit form.\n */\nexport async function updateCloudSecret(\n secretToEdit: string,\n name: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"PUT\",\n path: `/api/v1/secrets/${encodeURIComponent(secretToEdit)}`,\n body: { name, description },\n });\n}\n\nexport async function deleteCloudSecret(name: string): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"DELETE\",\n path: `/api/v1/secrets/${encodeURIComponent(name)}`,\n });\n}\n"],"mappings":"iIAUA,IAAM,EAAa,IAEnB,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,+CAA+C,CAEjE,OAAO,EAST,eAAsB,GAAyD,CAC7E,IAAM,EAAU,GAAuB,CAEjC,EAAsC,EAAE,CAC1C,EAAwB,KAE5B,EAAG,CACD,IAAM,EAAQ,IAAI,gBAAgB,CAAE,MAAO,OAAO,EAAW,CAAE,CAAC,CAC5D,GAAQ,EAAM,IAAI,UAAW,EAAO,CAExC,IAAM,EAAO,MAAM,EAAA,eAAiC,CAClD,UACA,OAAQ,MACR,KAAM,0BAA0B,EAAM,UAAU,GACjD,CAAC,CAEF,EAAQ,KAAK,GAAI,EAAK,OAAS,EAAE,CAAE,CACnC,EAAS,EAAK,mBACP,GAET,OAAO,EAGT,eAAsB,EACpB,EACA,EACA,EACe,CAEf,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,OACR,KAAM,kBACN,KAAM,CAAE,OAAM,QAAO,cAAa,CACnC,CAAC,CAQJ,eAAsB,EACpB,EACA,EACA,EACe,CAEf,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,mBAAmB,mBAAmB,EAAa,GACzD,KAAM,CAAE,OAAM,cAAa,CAC5B,CAAC,CAGJ,eAAsB,EAAkB,EAA6B,CAEnE,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,SACR,KAAM,mBAAmB,mBAAmB,EAAK,GAClD,CAAC"}
1
+ {"version":3,"file":"secrets-service.api.cjs","names":[],"sources":["../../../src/api/cloud/secrets-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport type { CustomSecretWithoutValue } from \"../secrets-service.types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSecretsPage {\n items: CustomSecretWithoutValue[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud secrets call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Walk every page of the cloud `/api/v1/secrets/search` endpoint and return\n * the merged list. The cloud shape (name + description) matches\n * `CustomSecretWithoutValue`, so items pass through unchanged.\n */\nexport async function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]> {\n const backend = getActiveCloudBackend();\n\n const secrets: CustomSecretWithoutValue[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSecretsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/secrets/search?${query.toString()}`,\n });\n\n secrets.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return secrets;\n}\n\nexport async function createCloudSecret(\n name: string,\n value: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/secrets\",\n body: { name, value, description },\n });\n}\n\n/**\n * Rename and/or redescribe an existing cloud secret. The cloud `PUT` endpoint\n * does not accept a value field — it only updates name + description — which\n * matches what `useUpdateSecret` actually sends from the secret-edit form.\n */\nexport async function updateCloudSecret(\n secretToEdit: string,\n name: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"PUT\",\n path: `/api/v1/secrets/${encodeURIComponent(secretToEdit)}`,\n body: { name, description },\n });\n}\n\nexport async function deleteCloudSecret(name: string): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"DELETE\",\n path: `/api/v1/secrets/${encodeURIComponent(name)}`,\n });\n}\n"],"mappings":"iIAUA,IAAM,EAAa,IAEnB,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,+CAA+C,CAEjE,OAAO,EAQT,eAAsB,GAAyD,CAC7E,IAAM,EAAU,GAAuB,CAEjC,EAAsC,EAAE,CAC1C,EAAwB,KAE5B,EAAG,CACD,IAAM,EAAQ,IAAI,gBAAgB,CAAE,MAAO,OAAO,EAAW,CAAE,CAAC,CAC5D,GAAQ,EAAM,IAAI,UAAW,EAAO,CAExC,IAAM,EAAO,MAAM,EAAA,eAAiC,CAClD,UACA,OAAQ,MACR,KAAM,0BAA0B,EAAM,UAAU,GACjD,CAAC,CAEF,EAAQ,KAAK,GAAI,EAAK,OAAS,EAAE,CAAE,CACnC,EAAS,EAAK,mBACP,GAET,OAAO,EAGT,eAAsB,EACpB,EACA,EACA,EACe,CAEf,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,OACR,KAAM,kBACN,KAAM,CAAE,OAAM,QAAO,cAAa,CACnC,CAAC,CAQJ,eAAsB,EACpB,EACA,EACA,EACe,CAEf,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,mBAAmB,mBAAmB,EAAa,GACzD,KAAM,CAAE,OAAM,cAAa,CAC5B,CAAC,CAGJ,eAAsB,EAAkB,EAA6B,CAEnE,MAAM,EAAA,eAAwB,CAC5B,QAFc,GAEd,CACA,OAAQ,SACR,KAAM,mBAAmB,mBAAmB,EAAK,GAClD,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import type { CustomSecretWithoutValue } from "../secrets-service.types";
2
2
  /**
3
- * Walk every page of the cloud `/api/v1/secrets/search` endpoint via the
4
- * bundled `/api/cloud-proxy` and return the merged list. The cloud shape
5
- * (name + description) matches `CustomSecretWithoutValue`, so items pass
6
- * through unchanged.
3
+ * Walk every page of the cloud `/api/v1/secrets/search` endpoint and return
4
+ * the merged list. The cloud shape (name + description) matches
5
+ * `CustomSecretWithoutValue`, so items pass through unchanged.
7
6
  */
8
7
  export declare function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]>;
9
8
  export declare function createCloudSecret(name: string, value: string, description?: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"secrets-service.api.js","names":[],"sources":["../../../src/api/cloud/secrets-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport type { CustomSecretWithoutValue } from \"../secrets-service.types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSecretsPage {\n items: CustomSecretWithoutValue[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud secrets call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Walk every page of the cloud `/api/v1/secrets/search` endpoint via the\n * bundled `/api/cloud-proxy` and return the merged list. The cloud shape\n * (name + description) matches `CustomSecretWithoutValue`, so items pass\n * through unchanged.\n */\nexport async function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]> {\n const backend = getActiveCloudBackend();\n\n const secrets: CustomSecretWithoutValue[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSecretsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/secrets/search?${query.toString()}`,\n });\n\n secrets.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return secrets;\n}\n\nexport async function createCloudSecret(\n name: string,\n value: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/secrets\",\n body: { name, value, description },\n });\n}\n\n/**\n * Rename and/or redescribe an existing cloud secret. The cloud `PUT` endpoint\n * does not accept a value field — it only updates name + description — which\n * matches what `useUpdateSecret` actually sends from the secret-edit form.\n */\nexport async function updateCloudSecret(\n secretToEdit: string,\n name: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"PUT\",\n path: `/api/v1/secrets/${encodeURIComponent(secretToEdit)}`,\n body: { name, description },\n });\n}\n\nexport async function deleteCloudSecret(name: string): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"DELETE\",\n path: `/api/v1/secrets/${encodeURIComponent(name)}`,\n });\n}\n"],"mappings":";;;AAUA,IAAM,IAAa;AAEnB,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,+CAA+C;AAEjE,QAAO;;AAST,eAAsB,IAAyD;CAC7E,IAAM,IAAU,GAAuB,EAEjC,IAAsC,EAAE,EAC1C,IAAwB;AAE5B,IAAG;EACD,IAAM,IAAQ,IAAI,gBAAgB,EAAE,OAAO,OAAO,EAAW,EAAE,CAAC;AAChE,EAAI,KAAQ,EAAM,IAAI,WAAW,EAAO;EAExC,IAAM,IAAO,MAAM,EAAiC;GAClD;GACA,QAAQ;GACR,MAAM,0BAA0B,EAAM,UAAU;GACjD,CAAC;AAGF,EADA,EAAQ,KAAK,GAAI,EAAK,SAAS,EAAE,CAAE,EACnC,IAAS,EAAK;UACP;AAET,QAAO;;AAGT,eAAsB,EACpB,GACA,GACA,GACe;AAEf,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACN,MAAM;GAAE;GAAM;GAAO;GAAa;EACnC,CAAC;;AAQJ,eAAsB,EACpB,GACA,GACA,GACe;AAEf,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM,mBAAmB,mBAAmB,EAAa;EACzD,MAAM;GAAE;GAAM;GAAa;EAC5B,CAAC;;AAGJ,eAAsB,EAAkB,GAA6B;AAEnE,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM,mBAAmB,mBAAmB,EAAK;EAClD,CAAC"}
1
+ {"version":3,"file":"secrets-service.api.js","names":[],"sources":["../../../src/api/cloud/secrets-service.api.ts"],"sourcesContent":["import { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport type { CustomSecretWithoutValue } from \"../secrets-service.types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSecretsPage {\n items: CustomSecretWithoutValue[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud secrets call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Walk every page of the cloud `/api/v1/secrets/search` endpoint and return\n * the merged list. The cloud shape (name + description) matches\n * `CustomSecretWithoutValue`, so items pass through unchanged.\n */\nexport async function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]> {\n const backend = getActiveCloudBackend();\n\n const secrets: CustomSecretWithoutValue[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSecretsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/secrets/search?${query.toString()}`,\n });\n\n secrets.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return secrets;\n}\n\nexport async function createCloudSecret(\n name: string,\n value: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/secrets\",\n body: { name, value, description },\n });\n}\n\n/**\n * Rename and/or redescribe an existing cloud secret. The cloud `PUT` endpoint\n * does not accept a value field — it only updates name + description — which\n * matches what `useUpdateSecret` actually sends from the secret-edit form.\n */\nexport async function updateCloudSecret(\n secretToEdit: string,\n name: string,\n description?: string,\n): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"PUT\",\n path: `/api/v1/secrets/${encodeURIComponent(secretToEdit)}`,\n body: { name, description },\n });\n}\n\nexport async function deleteCloudSecret(name: string): Promise<void> {\n const backend = getActiveCloudBackend();\n await callCloudProxy<unknown>({\n backend,\n method: \"DELETE\",\n path: `/api/v1/secrets/${encodeURIComponent(name)}`,\n });\n}\n"],"mappings":";;;AAUA,IAAM,IAAa;AAEnB,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,+CAA+C;AAEjE,QAAO;;AAQT,eAAsB,IAAyD;CAC7E,IAAM,IAAU,GAAuB,EAEjC,IAAsC,EAAE,EAC1C,IAAwB;AAE5B,IAAG;EACD,IAAM,IAAQ,IAAI,gBAAgB,EAAE,OAAO,OAAO,EAAW,EAAE,CAAC;AAChE,EAAI,KAAQ,EAAM,IAAI,WAAW,EAAO;EAExC,IAAM,IAAO,MAAM,EAAiC;GAClD;GACA,QAAQ;GACR,MAAM,0BAA0B,EAAM,UAAU;GACjD,CAAC;AAGF,EADA,EAAQ,KAAK,GAAI,EAAK,SAAS,EAAE,CAAE,EACnC,IAAS,EAAK;UACP;AAET,QAAO;;AAGT,eAAsB,EACpB,GACA,GACA,GACe;AAEf,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACN,MAAM;GAAE;GAAM;GAAO;GAAa;EACnC,CAAC;;AAQJ,eAAsB,EACpB,GACA,GACA,GACe;AAEf,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM,mBAAmB,mBAAmB,EAAa;EACzD,MAAM;GAAE;GAAM;GAAa;EAC5B,CAAC;;AAGJ,eAAsB,EAAkB,GAA6B;AAEnE,OAAM,EAAwB;EAC5B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM,mBAAmB,mBAAmB,EAAK;EAClD,CAAC"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);function n(){let t=e.getActiveBackend().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function r(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),t}function i(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function a(){let e=await t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:r(e),conversation_settings:i(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function o(e){let r=n(),i={};if(e.agent_settings_diff&&Object.keys(e.agent_settings_diff).length>0&&(i.agent_settings_diff=e.agent_settings_diff),e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(i.conversation_settings_diff=e.conversation_settings_diff),e.disabled_skills!==void 0&&(i.disabled_skills=e.disabled_skills),e.app_preferences)for(let[t,n]of Object.entries(e.app_preferences))i[t]=n;await t.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/settings`,body:i})}async function s(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function c(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}exports.fetchCloudConversationSettingsSchema=c,exports.fetchCloudSettings=a,exports.fetchCloudSettingsSchema=s,exports.saveCloudSettings=o;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`./proxy.cjs`);function n(){let t=e.getActiveBackend().backend;if(t.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return t}function r(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),t}function i(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function a(){let e=await t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:r(e),conversation_settings:i(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function o(e){let r=n(),i={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(i.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(i.conversation_settings_diff=e.conversation_settings_diff),e.disabled_skills!==void 0&&(i.disabled_skills=e.disabled_skills),e.app_preferences)for(let[t,n]of Object.entries(e.app_preferences))i[t]=n;await t.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/settings`,body:i})}async function s(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function c(){return t.callCloudProxy({backend:n(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}exports.fetchCloudConversationSettingsSchema=c,exports.fetchCloudSettings=a,exports.fetchCloudSettingsSchema=s,exports.saveCloudSettings=o;
2
2
  //# sourceMappingURL=settings-service.api.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings-service.api.cjs","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type MCPConfig,\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type StoredAppPreferences } from \"../app-preferences-store\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: MCPConfig;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n app_preferences?: StoredAppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (\n diff.agent_settings_diff &&\n Object.keys(diff.agent_settings_diff).length > 0\n ) {\n body.agent_settings_diff = diff.agent_settings_diff;\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Use !== undefined so re-enabling every skill (empty array) round-trips.\n if (diff.disabled_skills !== undefined) {\n body.disabled_skills = diff.disabled_skills;\n }\n // Flat top-level app-preference fields (language, git_user_name, …).\n // The cloud POST /api/v1/settings stores these directly; see\n // `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n body[key] = value;\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":"iIAyDA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,gDAAgD,CAElE,OAAO,EAQT,SAAS,EACP,EAC+B,CAC/B,GAAI,EAAK,gBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,OAAS,EACnE,OAAO,EAAK,eAEd,IAAM,EAAuC,EAAE,CACzC,EAAqC,EAAE,CACzC,OAAO,EAAK,WAAc,WAAU,EAAI,MAAQ,EAAK,WACrD,OAAO,EAAK,cAAiB,WAAU,EAAI,SAAW,EAAK,cAC3D,OAAO,EAAK,aAAgB,WAAU,EAAI,QAAU,EAAK,aACzD,OAAO,KAAK,EAAI,CAAC,OAAS,IAAG,EAAM,IAAM,GAE7C,IAAM,EAA2C,EAAE,CAUnD,OATI,OAAO,EAAK,0BAA6B,YAC3C,EAAU,QAAU,EAAK,0BAEvB,OAAO,EAAK,oBAAuB,WACrC,EAAU,SAAW,EAAK,oBAExB,OAAO,KAAK,EAAU,CAAC,OAAS,IAAG,EAAM,UAAY,GAErD,OAAO,EAAK,OAAU,WAAU,EAAM,MAAQ,EAAK,OAChD,EAGT,SAAS,EACP,EAC+B,CAC/B,GACE,EAAK,uBACL,OAAO,KAAK,EAAK,sBAAsB,CAAC,OAAS,EAEjD,OAAO,EAAK,sBAEd,IAAM,EAAqC,EAAE,CAa7C,OAZI,OAAO,EAAK,mBAAsB,YACpC,EAAI,kBAAoB,EAAK,oBAG7B,OAAO,EAAK,mBAAsB,UAClC,EAAK,oBAAsB,QAE3B,EAAI,kBAAoB,EAAK,mBAE3B,OAAO,EAAK,gBAAmB,WACjC,EAAI,eAAiB,EAAK,gBAErB,EAYT,eAAsB,GAAiD,CAErE,IAAM,EAAO,MAAM,EAAA,eAAsC,CACvD,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,mBACP,CAAC,CAEF,MAAO,CACL,GAAG,EACH,eAAgB,EAAoB,EAAK,CACzC,sBAAuB,EAA2B,EAAK,CACvD,gBAAiB,CAAC,CAAC,EAAK,gBACxB,mBAAoB,CAAC,CAAC,EAAK,mBAC3B,oBAAqB,EAAK,oBAC3B,CAGH,eAAsB,EAAkB,EAKtB,CAChB,IAAM,EAAU,GAAuB,CACjC,EAAgC,EAAE,CAqBxC,GAnBE,EAAK,qBACL,OAAO,KAAK,EAAK,oBAAoB,CAAC,OAAS,IAE/C,EAAK,oBAAsB,EAAK,qBAGhC,EAAK,4BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,OAAS,IAEtD,EAAK,2BAA6B,EAAK,4BAGrC,EAAK,kBAAoB,IAAA,KAC3B,EAAK,gBAAkB,EAAK,iBAM1B,EAAK,gBACP,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,EAAK,GAAO,EAGhB,MAAM,EAAA,eAAwB,CAC5B,UACA,OAAQ,OACR,KAAM,mBACN,OACD,CAAC,CAGJ,eAAsB,GAA6C,CAEjE,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,gCACP,CAAC,CAGJ,eAAsB,GAAyD,CAE7E,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,uCACP,CAAC"}
1
+ {"version":3,"file":"settings-service.api.cjs","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type MCPConfig,\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type StoredAppPreferences } from \"../app-preferences-store\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: MCPConfig;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n app_preferences?: StoredAppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Use !== undefined so re-enabling every skill (empty array) round-trips.\n if (diff.disabled_skills !== undefined) {\n body.disabled_skills = diff.disabled_skills;\n }\n // Flat top-level app-preference fields (language, git_user_name, …).\n // The cloud POST /api/v1/settings stores these directly; see\n // `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n body[key] = value;\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":"iIAyDA,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,gDAAgD,CAElE,OAAO,EAQT,SAAS,EACP,EAC+B,CAC/B,GAAI,EAAK,gBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,OAAS,EACnE,OAAO,EAAK,eAEd,IAAM,EAAuC,EAAE,CACzC,EAAqC,EAAE,CACzC,OAAO,EAAK,WAAc,WAAU,EAAI,MAAQ,EAAK,WACrD,OAAO,EAAK,cAAiB,WAAU,EAAI,SAAW,EAAK,cAC3D,OAAO,EAAK,aAAgB,WAAU,EAAI,QAAU,EAAK,aACzD,OAAO,KAAK,EAAI,CAAC,OAAS,IAAG,EAAM,IAAM,GAE7C,IAAM,EAA2C,EAAE,CAUnD,OATI,OAAO,EAAK,0BAA6B,YAC3C,EAAU,QAAU,EAAK,0BAEvB,OAAO,EAAK,oBAAuB,WACrC,EAAU,SAAW,EAAK,oBAExB,OAAO,KAAK,EAAU,CAAC,OAAS,IAAG,EAAM,UAAY,GAErD,OAAO,EAAK,OAAU,WAAU,EAAM,MAAQ,EAAK,OAChD,EAGT,SAAS,EACP,EAC+B,CAC/B,GACE,EAAK,uBACL,OAAO,KAAK,EAAK,sBAAsB,CAAC,OAAS,EAEjD,OAAO,EAAK,sBAEd,IAAM,EAAqC,EAAE,CAa7C,OAZI,OAAO,EAAK,mBAAsB,YACpC,EAAI,kBAAoB,EAAK,oBAG7B,OAAO,EAAK,mBAAsB,UAClC,EAAK,oBAAsB,QAE3B,EAAI,kBAAoB,EAAK,mBAE3B,OAAO,EAAK,gBAAmB,WACjC,EAAI,eAAiB,EAAK,gBAErB,EAYT,eAAsB,GAAiD,CAErE,IAAM,EAAO,MAAM,EAAA,eAAsC,CACvD,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,mBACP,CAAC,CAEF,MAAO,CACL,GAAG,EACH,eAAgB,EAAoB,EAAK,CACzC,sBAAuB,EAA2B,EAAK,CACvD,gBAAiB,CAAC,CAAC,EAAK,gBACxB,mBAAoB,CAAC,CAAC,EAAK,mBAC3B,oBAAqB,EAAK,oBAC3B,CAGH,eAAsB,EAAkB,EAKtB,CAChB,IAAM,EAAU,GAAuB,CACjC,EAAgC,EAAE,CACxC,GAAI,EAAK,oBAAqB,CAC5B,IAAM,EAA2C,CAC/C,GAAG,EAAK,oBACT,CAMG,EAAU,gBAAkB,MAC9B,OAAO,EAAU,cAEf,OAAO,KAAK,EAAU,CAAC,OAAS,IAClC,EAAK,oBAAsB,GAiB/B,GAbE,EAAK,4BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,OAAS,IAEtD,EAAK,2BAA6B,EAAK,4BAGrC,EAAK,kBAAoB,IAAA,KAC3B,EAAK,gBAAkB,EAAK,iBAM1B,EAAK,gBACP,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,EAAK,GAAO,EAGhB,MAAM,EAAA,eAAwB,CAC5B,UACA,OAAQ,OACR,KAAM,mBACN,OACD,CAAC,CAGJ,eAAsB,GAA6C,CAEjE,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,gCACP,CAAC,CAGJ,eAAsB,GAAyD,CAE7E,OAAO,EAAA,eAAwB,CAC7B,QAFc,GAEd,CACA,OAAQ,MACR,KAAM,uCACP,CAAC"}
@@ -35,7 +35,11 @@ async function a() {
35
35
  }
36
36
  async function o(e) {
37
37
  let r = n(), i = {};
38
- if (e.agent_settings_diff && Object.keys(e.agent_settings_diff).length > 0 && (i.agent_settings_diff = e.agent_settings_diff), e.conversation_settings_diff && Object.keys(e.conversation_settings_diff).length > 0 && (i.conversation_settings_diff = e.conversation_settings_diff), e.disabled_skills !== void 0 && (i.disabled_skills = e.disabled_skills), e.app_preferences) for (let [t, n] of Object.entries(e.app_preferences)) i[t] = n;
38
+ if (e.agent_settings_diff) {
39
+ let t = { ...e.agent_settings_diff };
40
+ t.agent_context === null && delete t.agent_context, Object.keys(t).length > 0 && (i.agent_settings_diff = t);
41
+ }
42
+ if (e.conversation_settings_diff && Object.keys(e.conversation_settings_diff).length > 0 && (i.conversation_settings_diff = e.conversation_settings_diff), e.disabled_skills !== void 0 && (i.disabled_skills = e.disabled_skills), e.app_preferences) for (let [t, n] of Object.entries(e.app_preferences)) i[t] = n;
39
43
  await t({
40
44
  backend: r,
41
45
  method: "POST",
@@ -1 +1 @@
1
- {"version":3,"file":"settings-service.api.js","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type MCPConfig,\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type StoredAppPreferences } from \"../app-preferences-store\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: MCPConfig;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n app_preferences?: StoredAppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (\n diff.agent_settings_diff &&\n Object.keys(diff.agent_settings_diff).length > 0\n ) {\n body.agent_settings_diff = diff.agent_settings_diff;\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Use !== undefined so re-enabling every skill (empty array) round-trips.\n if (diff.disabled_skills !== undefined) {\n body.disabled_skills = diff.disabled_skills;\n }\n // Flat top-level app-preference fields (language, git_user_name, …).\n // The cloud POST /api/v1/settings stores these directly; see\n // `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n body[key] = value;\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":";;;AAyDA,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,gDAAgD;AAElE,QAAO;;AAQT,SAAS,EACP,GAC+B;AAC/B,KAAI,EAAK,kBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,SAAS,EACnE,QAAO,EAAK;CAEd,IAAM,IAAuC,EAAE,EACzC,IAAqC,EAAE;AAI7C,CAHI,OAAO,EAAK,aAAc,aAAU,EAAI,QAAQ,EAAK,YACrD,OAAO,EAAK,gBAAiB,aAAU,EAAI,WAAW,EAAK,eAC3D,OAAO,EAAK,eAAgB,aAAU,EAAI,UAAU,EAAK,cACzD,OAAO,KAAK,EAAI,CAAC,SAAS,MAAG,EAAM,MAAM;CAE7C,IAAM,IAA2C,EAAE;AAUnD,QATI,OAAO,EAAK,4BAA6B,cAC3C,EAAU,UAAU,EAAK,2BAEvB,OAAO,EAAK,sBAAuB,aACrC,EAAU,WAAW,EAAK,qBAExB,OAAO,KAAK,EAAU,CAAC,SAAS,MAAG,EAAM,YAAY,IAErD,OAAO,EAAK,SAAU,aAAU,EAAM,QAAQ,EAAK,QAChD;;AAGT,SAAS,EACP,GAC+B;AAC/B,KACE,EAAK,yBACL,OAAO,KAAK,EAAK,sBAAsB,CAAC,SAAS,EAEjD,QAAO,EAAK;CAEd,IAAM,IAAqC,EAAE;AAa7C,QAZI,OAAO,EAAK,qBAAsB,cACpC,EAAI,oBAAoB,EAAK,qBAG7B,OAAO,EAAK,qBAAsB,YAClC,EAAK,sBAAsB,UAE3B,EAAI,oBAAoB,EAAK,oBAE3B,OAAO,EAAK,kBAAmB,aACjC,EAAI,iBAAiB,EAAK,iBAErB;;AAYT,eAAsB,IAAiD;CAErE,IAAM,IAAO,MAAM,EAAsC;EACvD,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;AAEF,QAAO;EACL,GAAG;EACH,gBAAgB,EAAoB,EAAK;EACzC,uBAAuB,EAA2B,EAAK;EACvD,iBAAiB,CAAC,CAAC,EAAK;EACxB,oBAAoB,CAAC,CAAC,EAAK;EAC3B,qBAAqB,EAAK;EAC3B;;AAGH,eAAsB,EAAkB,GAKtB;CAChB,IAAM,IAAU,GAAuB,EACjC,IAAgC,EAAE;AAqBxC,KAnBE,EAAK,uBACL,OAAO,KAAK,EAAK,oBAAoB,CAAC,SAAS,MAE/C,EAAK,sBAAsB,EAAK,sBAGhC,EAAK,8BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,SAAS,MAEtD,EAAK,6BAA6B,EAAK,6BAGrC,EAAK,oBAAoB,KAAA,MAC3B,EAAK,kBAAkB,EAAK,kBAM1B,EAAK,gBACP,MAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,GAAK,KAAO;AAGhB,OAAM,EAAwB;EAC5B;EACA,QAAQ;EACR,MAAM;EACN;EACD,CAAC;;AAGJ,eAAsB,IAA6C;AAEjE,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,IAAyD;AAE7E,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC"}
1
+ {"version":3,"file":"settings-service.api.js","names":[],"sources":["../../../src/api/cloud/settings-service.api.ts"],"sourcesContent":["import {\n type MCPConfig,\n type Provider,\n type Settings,\n type SettingsValue,\n} from \"#/types/settings\";\nimport { type StoredAppPreferences } from \"../app-preferences-store\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\n/**\n * The cloud Settings response is mostly flat — top-level fields like\n * `llm_model`, `provider_tokens_set`, etc., rather than the nested\n * `{ agent_settings, conversation_settings }` shape the local agent-server\n * uses. We deliberately do NOT remap cloud fields into the local shape:\n * the GUI's `Settings` type already supports both layouts (it has flat\n * fields AND nested `agent_settings`/`conversation_settings`), and\n * cloud-aware hooks like `useUserProviders` read directly from the flat\n * `provider_tokens_set` field. So the cloud response is passed through as\n * a `Partial<Settings>`, with a small derivation step to also populate\n * the nested fields the local-mode settings UI consumes.\n */\ntype CloudSettingsResponse = {\n llm_model?: string;\n llm_base_url?: string;\n llm_api_key?: string | null;\n llm_api_key_set?: boolean;\n search_api_key_set?: boolean;\n agent?: string;\n confirmation_mode?: boolean;\n security_analyzer?: string | null;\n max_iterations?: number | null;\n enable_default_condenser?: boolean;\n condenser_max_size?: number | null;\n enable_proactive_conversation_starters?: boolean;\n enable_solvability_analysis?: boolean;\n enable_sound_notifications?: boolean;\n language?: string;\n email?: string;\n email_verified?: boolean;\n git_user_name?: string;\n git_user_email?: string;\n user_consents_to_analytics?: boolean | null;\n is_new_user?: boolean;\n remote_runtime_resource_factor?: number | null;\n max_budget_per_task?: number | null;\n provider_tokens_set?: Partial<Record<Provider, string | null>>;\n mcp_config?: MCPConfig;\n disabled_skills?: string[];\n agent_settings?: Record<string, SettingsValue> | null;\n conversation_settings?: Record<string, SettingsValue> | null;\n agent_settings_schema?: unknown;\n conversation_settings_schema?: unknown;\n [key: string]: unknown;\n};\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud settings call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Build the nested `agent_settings` block from the cloud's flat fields.\n * Used so the local-mode settings page (which renders against the nested\n * shape) shows the right values when the active backend is cloud.\n */\nfunction deriveAgentSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (flat.agent_settings && Object.keys(flat.agent_settings).length > 0) {\n return flat.agent_settings;\n }\n const agent: Record<string, SettingsValue> = {};\n const llm: Record<string, SettingsValue> = {};\n if (typeof flat.llm_model === \"string\") llm.model = flat.llm_model;\n if (typeof flat.llm_base_url === \"string\") llm.base_url = flat.llm_base_url;\n if (typeof flat.llm_api_key === \"string\") llm.api_key = flat.llm_api_key;\n if (Object.keys(llm).length > 0) agent.llm = llm;\n\n const condenser: Record<string, SettingsValue> = {};\n if (typeof flat.enable_default_condenser === \"boolean\") {\n condenser.enabled = flat.enable_default_condenser;\n }\n if (typeof flat.condenser_max_size === \"number\") {\n condenser.max_size = flat.condenser_max_size;\n }\n if (Object.keys(condenser).length > 0) agent.condenser = condenser;\n\n if (typeof flat.agent === \"string\") agent.agent = flat.agent;\n return agent;\n}\n\nfunction deriveConversationSettings(\n flat: CloudSettingsResponse,\n): Record<string, SettingsValue> {\n if (\n flat.conversation_settings &&\n Object.keys(flat.conversation_settings).length > 0\n ) {\n return flat.conversation_settings;\n }\n const out: Record<string, SettingsValue> = {};\n if (typeof flat.confirmation_mode === \"boolean\") {\n out.confirmation_mode = flat.confirmation_mode;\n }\n if (\n typeof flat.security_analyzer === \"string\" ||\n flat.security_analyzer === null\n ) {\n out.security_analyzer = flat.security_analyzer;\n }\n if (typeof flat.max_iterations === \"number\") {\n out.max_iterations = flat.max_iterations;\n }\n return out;\n}\n\n/**\n * Fetch the cloud settings and return them as a `Partial<Settings>`.\n *\n * Top-level fields like `provider_tokens_set` are preserved unchanged so\n * the existing `useUserProviders` → `useAppInstallations` →\n * `useGitRepositories` chain (which reads `settings.provider_tokens_set`)\n * fires correctly in cloud mode. Nested `agent_settings` /\n * `conversation_settings` are derived for the settings page.\n */\nexport async function fetchCloudSettings(): Promise<Partial<Settings>> {\n const backend = getActiveCloudBackend();\n const flat = await callCloudProxy<CloudSettingsResponse>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings\",\n });\n\n return {\n ...flat,\n agent_settings: deriveAgentSettings(flat),\n conversation_settings: deriveConversationSettings(flat),\n llm_api_key_set: !!flat.llm_api_key_set,\n search_api_key_set: !!flat.search_api_key_set,\n provider_tokens_set: flat.provider_tokens_set,\n } as Partial<Settings>;\n}\n\nexport async function saveCloudSettings(diff: {\n agent_settings_diff?: Record<string, SettingsValue>;\n conversation_settings_diff?: Record<string, SettingsValue>;\n disabled_skills?: string[];\n app_preferences?: StoredAppPreferences;\n}): Promise<void> {\n const backend = getActiveCloudBackend();\n const body: Record<string, unknown> = {};\n if (diff.agent_settings_diff) {\n const agentDiff: Record<string, SettingsValue> = {\n ...diff.agent_settings_diff,\n };\n // The cloud validates agent settings against the SDK's\n // OpenHandsAgentSettings, whose `agent_context` is a required\n // AgentContext (not Optional). A literal `agent_context: null` fails\n // backend validation, so drop it and let the backend keep/default it.\n // See OpenHands/agent-canvas#981.\n if (agentDiff.agent_context === null) {\n delete agentDiff.agent_context;\n }\n if (Object.keys(agentDiff).length > 0) {\n body.agent_settings_diff = agentDiff;\n }\n }\n if (\n diff.conversation_settings_diff &&\n Object.keys(diff.conversation_settings_diff).length > 0\n ) {\n body.conversation_settings_diff = diff.conversation_settings_diff;\n }\n // Use !== undefined so re-enabling every skill (empty array) round-trips.\n if (diff.disabled_skills !== undefined) {\n body.disabled_skills = diff.disabled_skills;\n }\n // Flat top-level app-preference fields (language, git_user_name, …).\n // The cloud POST /api/v1/settings stores these directly; see\n // `CloudSettingsResponse` and the MSW handler in\n // `src/mocks/settings-handlers.ts` for the accepted shape.\n if (diff.app_preferences) {\n for (const [key, value] of Object.entries(diff.app_preferences)) {\n body[key] = value;\n }\n }\n await callCloudProxy<unknown>({\n backend,\n method: \"POST\",\n path: \"/api/v1/settings\",\n body,\n });\n}\n\nexport async function fetchCloudSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/agent-schema\",\n });\n}\n\nexport async function fetchCloudConversationSettingsSchema(): Promise<unknown> {\n const backend = getActiveCloudBackend();\n return callCloudProxy<unknown>({\n backend,\n method: \"GET\",\n path: \"/api/v1/settings/conversation-schema\",\n });\n}\n"],"mappings":";;;AAyDA,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,gDAAgD;AAElE,QAAO;;AAQT,SAAS,EACP,GAC+B;AAC/B,KAAI,EAAK,kBAAkB,OAAO,KAAK,EAAK,eAAe,CAAC,SAAS,EACnE,QAAO,EAAK;CAEd,IAAM,IAAuC,EAAE,EACzC,IAAqC,EAAE;AAI7C,CAHI,OAAO,EAAK,aAAc,aAAU,EAAI,QAAQ,EAAK,YACrD,OAAO,EAAK,gBAAiB,aAAU,EAAI,WAAW,EAAK,eAC3D,OAAO,EAAK,eAAgB,aAAU,EAAI,UAAU,EAAK,cACzD,OAAO,KAAK,EAAI,CAAC,SAAS,MAAG,EAAM,MAAM;CAE7C,IAAM,IAA2C,EAAE;AAUnD,QATI,OAAO,EAAK,4BAA6B,cAC3C,EAAU,UAAU,EAAK,2BAEvB,OAAO,EAAK,sBAAuB,aACrC,EAAU,WAAW,EAAK,qBAExB,OAAO,KAAK,EAAU,CAAC,SAAS,MAAG,EAAM,YAAY,IAErD,OAAO,EAAK,SAAU,aAAU,EAAM,QAAQ,EAAK,QAChD;;AAGT,SAAS,EACP,GAC+B;AAC/B,KACE,EAAK,yBACL,OAAO,KAAK,EAAK,sBAAsB,CAAC,SAAS,EAEjD,QAAO,EAAK;CAEd,IAAM,IAAqC,EAAE;AAa7C,QAZI,OAAO,EAAK,qBAAsB,cACpC,EAAI,oBAAoB,EAAK,qBAG7B,OAAO,EAAK,qBAAsB,YAClC,EAAK,sBAAsB,UAE3B,EAAI,oBAAoB,EAAK,oBAE3B,OAAO,EAAK,kBAAmB,aACjC,EAAI,iBAAiB,EAAK,iBAErB;;AAYT,eAAsB,IAAiD;CAErE,IAAM,IAAO,MAAM,EAAsC;EACvD,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;AAEF,QAAO;EACL,GAAG;EACH,gBAAgB,EAAoB,EAAK;EACzC,uBAAuB,EAA2B,EAAK;EACvD,iBAAiB,CAAC,CAAC,EAAK;EACxB,oBAAoB,CAAC,CAAC,EAAK;EAC3B,qBAAqB,EAAK;EAC3B;;AAGH,eAAsB,EAAkB,GAKtB;CAChB,IAAM,IAAU,GAAuB,EACjC,IAAgC,EAAE;AACxC,KAAI,EAAK,qBAAqB;EAC5B,IAAM,IAA2C,EAC/C,GAAG,EAAK,qBACT;AASD,EAHI,EAAU,kBAAkB,QAC9B,OAAO,EAAU,eAEf,OAAO,KAAK,EAAU,CAAC,SAAS,MAClC,EAAK,sBAAsB;;AAiB/B,KAbE,EAAK,8BACL,OAAO,KAAK,EAAK,2BAA2B,CAAC,SAAS,MAEtD,EAAK,6BAA6B,EAAK,6BAGrC,EAAK,oBAAoB,KAAA,MAC3B,EAAK,kBAAkB,EAAK,kBAM1B,EAAK,gBACP,MAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,EAAK,gBAAgB,CAC7D,GAAK,KAAO;AAGhB,OAAM,EAAwB;EAC5B;EACA,QAAQ;EACR,MAAM;EACN;EACD,CAAC;;AAGJ,eAAsB,IAA6C;AAEjE,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC;;AAGJ,eAAsB,IAAyD;AAE7E,QAAO,EAAwB;EAC7B,SAFc,GAEd;EACA,QAAQ;EACR,MAAM;EACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"skills-service.api.cjs","names":[],"sources":["../../../src/api/cloud/skills-service.api.ts"],"sourcesContent":["import type { SkillInfo } from \"#/types/settings\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSkillsPage {\n items: SkillInfo[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud skills call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Fetch the full list of skills from the cloud backend via the bundled\n * /api/cloud-proxy. The cloud endpoint is paginated (page_id cursor); we\n * walk all pages so the settings UI gets a complete list in one call. The\n * cloud SkillInfo shape (name/type/source/triggers) matches the GUI's\n * SkillInfo type, so items are passed through unchanged.\n */\nexport async function fetchCloudSkills(): Promise<SkillInfo[]> {\n const backend = getActiveCloudBackend();\n\n const skills: SkillInfo[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSkillsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/skills/search?${query.toString()}`,\n });\n\n skills.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return skills;\n}\n"],"mappings":"iIAUA,IAAM,EAAa,IAEnB,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,8CAA8C,CAEhE,OAAO,EAUT,eAAsB,GAAyC,CAC7D,IAAM,EAAU,GAAuB,CAEjC,EAAsB,EAAE,CAC1B,EAAwB,KAE5B,EAAG,CACD,IAAM,EAAQ,IAAI,gBAAgB,CAAE,MAAO,OAAO,EAAW,CAAE,CAAC,CAC5D,GAAQ,EAAM,IAAI,UAAW,EAAO,CAExC,IAAM,EAAO,MAAM,EAAA,eAAgC,CACjD,UACA,OAAQ,MACR,KAAM,yBAAyB,EAAM,UAAU,GAChD,CAAC,CAEF,EAAO,KAAK,GAAI,EAAK,OAAS,EAAE,CAAE,CAClC,EAAS,EAAK,mBACP,GAET,OAAO"}
1
+ {"version":3,"file":"skills-service.api.cjs","names":[],"sources":["../../../src/api/cloud/skills-service.api.ts"],"sourcesContent":["import type { SkillInfo } from \"#/types/settings\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSkillsPage {\n items: SkillInfo[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud skills call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Fetch the full list of skills from the cloud backend. The cloud endpoint is\n * paginated (page_id cursor); we walk all pages so the settings UI gets a\n * complete list in one call. The cloud SkillInfo shape\n * (name/type/source/triggers) matches the GUI's SkillInfo type, so items are\n * passed through unchanged.\n */\nexport async function fetchCloudSkills(): Promise<SkillInfo[]> {\n const backend = getActiveCloudBackend();\n\n const skills: SkillInfo[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSkillsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/skills/search?${query.toString()}`,\n });\n\n skills.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return skills;\n}\n"],"mappings":"iIAUA,IAAM,EAAa,IAEnB,SAAS,GAAiC,CACxC,IAAM,EAAS,EAAA,kBAAkB,CAAC,QAClC,GAAI,EAAO,OAAS,QAClB,MAAU,MAAM,8CAA8C,CAEhE,OAAO,EAUT,eAAsB,GAAyC,CAC7D,IAAM,EAAU,GAAuB,CAEjC,EAAsB,EAAE,CAC1B,EAAwB,KAE5B,EAAG,CACD,IAAM,EAAQ,IAAI,gBAAgB,CAAE,MAAO,OAAO,EAAW,CAAE,CAAC,CAC5D,GAAQ,EAAM,IAAI,UAAW,EAAO,CAExC,IAAM,EAAO,MAAM,EAAA,eAAgC,CACjD,UACA,OAAQ,MACR,KAAM,yBAAyB,EAAM,UAAU,GAChD,CAAC,CAEF,EAAO,KAAK,GAAI,EAAK,OAAS,EAAE,CAAE,CAClC,EAAS,EAAK,mBACP,GAET,OAAO"}
@@ -1,9 +1,9 @@
1
1
  import type { SkillInfo } from "#/types/settings";
2
2
  /**
3
- * Fetch the full list of skills from the cloud backend via the bundled
4
- * /api/cloud-proxy. The cloud endpoint is paginated (page_id cursor); we
5
- * walk all pages so the settings UI gets a complete list in one call. The
6
- * cloud SkillInfo shape (name/type/source/triggers) matches the GUI's
7
- * SkillInfo type, so items are passed through unchanged.
3
+ * Fetch the full list of skills from the cloud backend. The cloud endpoint is
4
+ * paginated (page_id cursor); we walk all pages so the settings UI gets a
5
+ * complete list in one call. The cloud SkillInfo shape
6
+ * (name/type/source/triggers) matches the GUI's SkillInfo type, so items are
7
+ * passed through unchanged.
8
8
  */
9
9
  export declare function fetchCloudSkills(): Promise<SkillInfo[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"skills-service.api.js","names":[],"sources":["../../../src/api/cloud/skills-service.api.ts"],"sourcesContent":["import type { SkillInfo } from \"#/types/settings\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSkillsPage {\n items: SkillInfo[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud skills call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Fetch the full list of skills from the cloud backend via the bundled\n * /api/cloud-proxy. The cloud endpoint is paginated (page_id cursor); we\n * walk all pages so the settings UI gets a complete list in one call. The\n * cloud SkillInfo shape (name/type/source/triggers) matches the GUI's\n * SkillInfo type, so items are passed through unchanged.\n */\nexport async function fetchCloudSkills(): Promise<SkillInfo[]> {\n const backend = getActiveCloudBackend();\n\n const skills: SkillInfo[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSkillsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/skills/search?${query.toString()}`,\n });\n\n skills.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return skills;\n}\n"],"mappings":";;;AAUA,IAAM,IAAa;AAEnB,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,8CAA8C;AAEhE,QAAO;;AAUT,eAAsB,IAAyC;CAC7D,IAAM,IAAU,GAAuB,EAEjC,IAAsB,EAAE,EAC1B,IAAwB;AAE5B,IAAG;EACD,IAAM,IAAQ,IAAI,gBAAgB,EAAE,OAAO,OAAO,EAAW,EAAE,CAAC;AAChE,EAAI,KAAQ,EAAM,IAAI,WAAW,EAAO;EAExC,IAAM,IAAO,MAAM,EAAgC;GACjD;GACA,QAAQ;GACR,MAAM,yBAAyB,EAAM,UAAU;GAChD,CAAC;AAGF,EADA,EAAO,KAAK,GAAI,EAAK,SAAS,EAAE,CAAE,EAClC,IAAS,EAAK;UACP;AAET,QAAO"}
1
+ {"version":3,"file":"skills-service.api.js","names":[],"sources":["../../../src/api/cloud/skills-service.api.ts"],"sourcesContent":["import type { SkillInfo } from \"#/types/settings\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { Backend } from \"../backend-registry/types\";\nimport { callCloudProxy } from \"./proxy\";\n\ninterface CloudSkillsPage {\n items: SkillInfo[];\n next_page_id: string | null;\n}\n\nconst PAGE_LIMIT = 100;\n\nfunction getActiveCloudBackend(): Backend {\n const active = getActiveBackend().backend;\n if (active.kind !== \"cloud\") {\n throw new Error(\"Cloud skills call requires a cloud backend.\");\n }\n return active;\n}\n\n/**\n * Fetch the full list of skills from the cloud backend. The cloud endpoint is\n * paginated (page_id cursor); we walk all pages so the settings UI gets a\n * complete list in one call. The cloud SkillInfo shape\n * (name/type/source/triggers) matches the GUI's SkillInfo type, so items are\n * passed through unchanged.\n */\nexport async function fetchCloudSkills(): Promise<SkillInfo[]> {\n const backend = getActiveCloudBackend();\n\n const skills: SkillInfo[] = [];\n let pageId: string | null = null;\n\n do {\n const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });\n if (pageId) query.set(\"page_id\", pageId);\n\n const page = await callCloudProxy<CloudSkillsPage>({\n backend,\n method: \"GET\",\n path: `/api/v1/skills/search?${query.toString()}`,\n });\n\n skills.push(...(page.items ?? []));\n pageId = page.next_page_id;\n } while (pageId);\n\n return skills;\n}\n"],"mappings":";;;AAUA,IAAM,IAAa;AAEnB,SAAS,IAAiC;CACxC,IAAM,IAAS,GAAkB,CAAC;AAClC,KAAI,EAAO,SAAS,QAClB,OAAU,MAAM,8CAA8C;AAEhE,QAAO;;AAUT,eAAsB,IAAyC;CAC7D,IAAM,IAAU,GAAuB,EAEjC,IAAsB,EAAE,EAC1B,IAAwB;AAE5B,IAAG;EACD,IAAM,IAAQ,IAAI,gBAAgB,EAAE,OAAO,OAAO,EAAW,EAAE,CAAC;AAChE,EAAI,KAAQ,EAAM,IAAI,WAAW,EAAO;EAExC,IAAM,IAAO,MAAM,EAAgC;GACjD;GACA,QAAQ;GACR,MAAM,yBAAyB,EAAM,UAAU;GAChD,CAAC;AAGF,EADA,EAAO,KAAK,GAAI,EAAK,SAAS,EAAE,CAAE,EAClC,IAAS,EAAK;UACP;AAET,QAAO"}
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs`),r=require(`../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`),i=require(`../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs`),a=require(`../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs`),o=require(`../../node_modules/uuid/dist/v4.cjs`),s=require(`../../utils/websocket-url.cjs`),c=require(`../cloud/proxy.cjs`),l=require(`../agent-server-client-options.cjs`),u=require(`../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/index.cjs`);const d=require(`../conversation-metadata-store.cjs`),f=require(`../cloud/conversation-service.api.cjs`),p=require(`../settings-service/settings-service.api.cjs`),m=require(`../agent-server-adapter.cjs`);var h=`1970-01-01T00:00:00.000Z`,g=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function _(){return Error(g)}function v(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function y(e){return typeof e==`number`?e:null}function b(e){return typeof e==`number`?e:0}function x(e){return typeof e==`string`?e:null}function S(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:h}function C(e){return v(e)?{prompt_tokens:b(e.prompt_tokens),completion_tokens:b(e.completion_tokens),cache_read_tokens:b(e.cache_read_tokens),cache_write_tokens:b(e.cache_write_tokens),context_window:b(e.context_window),per_turn_token:b(e.per_turn_token)}:null}function w(e){return v(e)?{accumulated_cost:y(e.accumulated_cost),max_budget_per_task:y(e.max_budget_per_task),accumulated_token_usage:C(e.accumulated_token_usage)}:null}function T(e){if(!v(e))return null;let t=v(e.llm)?{model:x(e.llm.model)}:null;return{kind:x(e.kind),acp_model:x(e.acp_model),llm:t}}function E(e){return v(e)?{working_dir:x(e.working_dir)}:null}function D(e){if(!v(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function O(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function k(e,t){let n=O(e),r=O(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function A(e){if(!v(e)||typeof e.id!=`string`||!e.id.trim())throw _();return{id:e.id.trim(),title:x(e.title),created_at:S(e,`created_at`,`createdAt`),updated_at:S(e,`updated_at`,`updatedAt`),execution_status:x(e.execution_status),sandbox_status:x(e.sandbox_status),metrics:w(e.metrics),agent:T(e.agent),workspace:E(e.workspace),tags:D(e.tags),current_model_id:x(e.current_model_id),current_model_name:x(e.current_model_name)}}function j(e){if(!Array.isArray(e))throw _();return e.map(A)}function M(e){if(Array.isArray(e))return{items:j(e),next_page_id:null};if(!v(e))throw _();return{items:j(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var N=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function P(e){let t=e??`idle`;return N.has(t)?t:`idle`}function F(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var I=class{static async sendMessage(e,r,i){let a=t.getActiveBackend().backend,o=i?.conversationUrl??null,u=i?.sessionApiKey??null;if(a.kind===`cloud`){if(!o||!u){let[t]=await f.batchGetCloudConversations([e]);o=t?.conversation_url?.trim()??null,u=t?.session_api_key?.trim()??null}if(!o||!u)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await c.callCloudProxy({backend:a,method:`POST`,hostOverride:s.buildHttpBaseUrl(o),path:`/api/conversations/${e}/events`,body:{...r,run:!0},authMode:`session-api-key`,sessionApiKey:u}),r}return await new n.ConversationClient(l.getAgentServerClientOptions({conversationUrl:o,sessionApiKey:u})).sendEvent(e,r,{run:!0}),r}static async createConversation(r,i,a,s,c,u,h,g){if(t.getActiveBackend().backend.kind===`cloud`)return f.createCloudAppConversation({initial_message:r?{role:`user`,content:[{type:`text`,text:r}]}:null,title:i??null,selected_repository:s?.selected_repository??null,selected_branch:s?.selected_branch??null,git_provider:s?.git_provider??null,plugins:a??null,parent_conversation_id:u??null,agent_type:h,sandbox_id:g??null});let _=await p.default.getSettings(),v=o.default(),y=await m.buildStartConversationRequestWithEncryptedSettings({settings:_,query:r,conversationInstructions:i,plugins:a,conversationId:v,workingDir:c??e.buildConversationWorkingDir(v)}),b=await new n.ConversationClient(l.getAgentServerClientOptions()).createConversation(y);return(s?.selected_repository||c)&&d.setStoredConversationMetadata(b.id,{selected_repository:s?.selected_repository??null,selected_branch:s?.selected_branch??null,git_provider:s?.git_provider??null,selected_workspace:c??null}),{id:b.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:b.id,agent_server_url:t.getEffectiveLocalBackend().host,request:{initial_message:y.initial_message,plugins:a??null},created_at:b.created_at,updated_at:b.updated_at}}static async getStartTask(e){return t.getActiveBackend().backend.kind===`cloud`?f.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new a.VSCodeClient(l.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(t){let[n]=await this.batchGetAppConversations([t]);return n?.workspace?.working_dir??e.getAgentServerWorkingDir()}static async batchGetAppConversations(e){return e.length===0?[]:t.getActiveBackend().backend.kind===`cloud`?f.batchGetCloudConversations(e):j(await new n.ConversationClient(l.getAgentServerClientOptions()).getConversations(e)).map(e=>m.toAppConversation(e))}static async updateConversationPublicFlag(e,n){if(t.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return f.updateCloudConversationPublicFlag(e,n)}static async updateConversationRepository(e,t,n,r){t?d.setStoredConversationMetadata(e,{...d.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):d.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return F(i,e)}static async readConversationFile(e,n){if(t.getActiveBackend().backend.kind===`cloud`)return f.readCloudConversationFile(e,k(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let i=await this.resolveConversationWorkingDir(e),a=k(n??`${i}/.agents_tmp/PLAN.md`,i);return new r.FileClient(l.getAgentServerClientOptions()).downloadTextFile(a)}static async downloadConversation(e){return t.getActiveBackend().backend.kind===`cloud`?f.downloadCloudConversation(e):new r.FileClient(l.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return m.emptyHooksResponse()}static async getRuntimeConversation(e,r,i){let a=t.getActiveBackend().backend,o=a.kind===`cloud`&&r?await c.callCloudProxy({backend:a,method:`GET`,hostOverride:s.buildHttpBaseUrl(r),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:i}):await new n.ConversationClient(l.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).getConversation(e),u=A(o),d=v(o)?o.stats:null;return{id:u.id,title:u.title?.trim()?u.title:m.getDefaultConversationTitle(u.id),metrics:w(u.metrics),created_at:u.created_at,updated_at:u.updated_at,status:P(u.execution_status),stats:v(d)?d:{usage_to_metrics:{}}}}static async searchConversations(e=20,r){return t.getActiveBackend().backend.kind===`cloud`?f.searchCloudConversations(e,r):m.toConversationPage(M(await new n.ConversationClient(l.getAgentServerClientOptions()).searchConversations({limit:e,page_id:r,sort_order:u.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(e){t.getActiveBackend().backend.kind===`cloud`?await f.deleteCloudConversation(e):await new n.ConversationClient(l.getAgentServerClientOptions()).deleteConversation(e),d.removeStoredConversationMetadata(e)}static async updateConversationTitle(e,t){await new n.ConversationClient(l.getAgentServerClientOptions()).updateConversation(e,{title:t});let[r]=await this.batchGetAppConversations([e]);return F(r,e)}static async switchProfile(e,r){if(t.getActiveBackend().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new i.ProfilesClient(l.getAgentServerClientOptions()).activateProfile(r);return}await new n.ConversationClient(l.getAgentServerClientOptions()).switchProfile(e,r)}static async switchAcpModel(e,r){if(t.getActiveBackend().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new n.ConversationClient(l.getAgentServerClientOptions()).switchAcpModel(e,r)}};exports.default=I;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs`),r=require(`../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs`),i=require(`../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs`),a=require(`../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs`),o=require(`../../node_modules/uuid/dist/v4.cjs`),s=require(`../../utils/websocket-url.cjs`),c=require(`../agent-server-client-options.cjs`),l=require(`../cloud/proxy.cjs`),u=require(`../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs`);require(`../../node_modules/@openhands/typescript-client/dist/index.cjs`);const d=require(`../conversation-metadata-store.cjs`),f=require(`../cloud/conversation-service.api.cjs`),p=require(`../settings-service/settings-service.api.cjs`),m=require(`../agent-server-adapter.cjs`);var h=`1970-01-01T00:00:00.000Z`,g=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function _(){return Error(g)}function v(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function y(e){return typeof e==`number`?e:null}function b(e){return typeof e==`number`?e:0}function x(e){return typeof e==`string`?e:null}function S(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:h}function C(e){return v(e)?{prompt_tokens:b(e.prompt_tokens),completion_tokens:b(e.completion_tokens),cache_read_tokens:b(e.cache_read_tokens),cache_write_tokens:b(e.cache_write_tokens),context_window:b(e.context_window),per_turn_token:b(e.per_turn_token)}:null}function w(e){return v(e)?{accumulated_cost:y(e.accumulated_cost),max_budget_per_task:y(e.max_budget_per_task),accumulated_token_usage:C(e.accumulated_token_usage)}:null}function T(e){if(!v(e))return null;let t=v(e.llm)?{model:x(e.llm.model)}:null;return{kind:x(e.kind),acp_model:x(e.acp_model),llm:t}}function E(e){return v(e)?{working_dir:x(e.working_dir)}:null}function D(e){if(!v(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function O(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function k(e,t){let n=O(e),r=O(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function A(e){if(!v(e)||typeof e.id!=`string`||!e.id.trim())throw _();return{id:e.id.trim(),title:x(e.title),created_at:S(e,`created_at`,`createdAt`),updated_at:S(e,`updated_at`,`updatedAt`),execution_status:x(e.execution_status),sandbox_status:x(e.sandbox_status),metrics:w(e.metrics),agent:T(e.agent),workspace:E(e.workspace),tags:D(e.tags),current_model_id:x(e.current_model_id),current_model_name:x(e.current_model_name)}}function j(e){if(!Array.isArray(e))throw _();return e.map(A)}function M(e){if(Array.isArray(e))return{items:j(e),next_page_id:null};if(!v(e))throw _();return{items:j(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var N=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function P(e){let t=e??`idle`;return N.has(t)?t:`idle`}function F(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var I=class{static async sendMessage(e,r,i){let a=t.getActiveBackend().backend,o=i?.conversationUrl??null,u=i?.sessionApiKey??null;if(a.kind===`cloud`){if(!o||!u){let[t]=await f.batchGetCloudConversations([e]);o=t?.conversation_url?.trim()??null,u=t?.session_api_key?.trim()??null}if(!o||!u)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await l.callCloudProxy({backend:a,method:`POST`,hostOverride:s.buildHttpBaseUrl(o),path:`/api/conversations/${e}/events`,body:{...r,run:!0},authMode:`session-api-key`,sessionApiKey:u}),r}return await new n.ConversationClient(c.getAgentServerClientOptions({conversationUrl:o,sessionApiKey:u})).sendEvent(e,r,{run:!0}),r}static async createConversation(r,i,a,s,l,u,h,g){if(t.getActiveBackend().backend.kind===`cloud`)return f.createCloudAppConversation({initial_message:r?{role:`user`,content:[{type:`text`,text:r}]}:null,title:i??null,selected_repository:s?.selected_repository??null,selected_branch:s?.selected_branch??null,git_provider:s?.git_provider??null,plugins:a??null,parent_conversation_id:u??null,agent_type:h,sandbox_id:g??null});let _=await p.default.getSettings(),v=o.default(),y=await m.buildStartConversationRequestWithEncryptedSettings({settings:_,query:r,conversationInstructions:i,plugins:a,conversationId:v,workingDir:l??e.buildConversationWorkingDir(v)}),b=await new n.ConversationClient(c.getAgentServerClientOptions()).createConversation(y),x=t.getEffectiveLocalBackend();if(!x)throw new c.NoBackendAvailableError;return(s?.selected_repository||l)&&d.setStoredConversationMetadata(b.id,{selected_repository:s?.selected_repository??null,selected_branch:s?.selected_branch??null,git_provider:s?.git_provider??null,selected_workspace:l??null}),{id:b.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:b.id,agent_server_url:x.host,request:{initial_message:y.initial_message,plugins:a??null},created_at:b.created_at,updated_at:b.updated_at}}static async getStartTask(e){return t.getActiveBackend().backend.kind===`cloud`?f.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new a.VSCodeClient(c.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(t){let[n]=await this.batchGetAppConversations([t]);return n?.workspace?.working_dir??e.getAgentServerWorkingDir()}static async batchGetAppConversations(e){return e.length===0?[]:t.getActiveBackend().backend.kind===`cloud`?f.batchGetCloudConversations(e):j(await new n.ConversationClient(c.getAgentServerClientOptions()).getConversations(e)).map(e=>m.toAppConversation(e))}static async updateConversationPublicFlag(e,n){if(t.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return f.updateCloudConversationPublicFlag(e,n)}static async updateConversationRepository(e,t,n,r){t?d.setStoredConversationMetadata(e,{...d.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):d.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return F(i,e)}static async readConversationFile(e,n){if(t.getActiveBackend().backend.kind===`cloud`)return f.readCloudConversationFile(e,k(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let i=await this.resolveConversationWorkingDir(e),a=k(n??`${i}/.agents_tmp/PLAN.md`,i);return new r.FileClient(c.getAgentServerClientOptions()).downloadTextFile(a)}static async downloadConversation(e){return t.getActiveBackend().backend.kind===`cloud`?f.downloadCloudConversation(e):new r.FileClient(c.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return m.emptyHooksResponse()}static async getRuntimeConversation(e,r,i){let a=t.getActiveBackend().backend,o=a.kind===`cloud`&&r?await l.callCloudProxy({backend:a,method:`GET`,hostOverride:s.buildHttpBaseUrl(r),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:i}):await new n.ConversationClient(c.getAgentServerClientOptions({conversationUrl:r,sessionApiKey:i})).getConversation(e),u=A(o),d=v(o)?o.stats:null;return{id:u.id,title:u.title?.trim()?u.title:m.getDefaultConversationTitle(u.id),metrics:w(u.metrics),created_at:u.created_at,updated_at:u.updated_at,status:P(u.execution_status),stats:v(d)?d:{usage_to_metrics:{}}}}static async searchConversations(e=20,r){return t.getActiveBackend().backend.kind===`cloud`?f.searchCloudConversations(e,r):m.toConversationPage(M(await new n.ConversationClient(c.getAgentServerClientOptions()).searchConversations({limit:e,page_id:r,sort_order:u.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(e){t.getActiveBackend().backend.kind===`cloud`?await f.deleteCloudConversation(e):await new n.ConversationClient(c.getAgentServerClientOptions()).deleteConversation(e),d.removeStoredConversationMetadata(e)}static async updateConversationTitle(e,t){await new n.ConversationClient(c.getAgentServerClientOptions()).updateConversation(e,{title:t});let[r]=await this.batchGetAppConversations([e]);return F(r,e)}static async switchProfile(e,r){if(t.getActiveBackend().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new i.ProfilesClient(c.getAgentServerClientOptions()).activateProfile(r);return}let a=c.getAgentServerClientOptions(),s=new n.ConversationClient(a),l=await new i.ProfilesClient(a).getProfile(r,{exposeSecrets:`encrypted`}),u=typeof l.config.model==`string`?l.config.model:``;if(!u)throw Error(`Profile '${r}' has no model.`);await s.switchLLM(e,{...l.config,model:u,usage_id:`profile:${r}:${o.default()}`})}static async switchAcpModel(e,r){if(t.getActiveBackend().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new n.ConversationClient(c.getAgentServerClientOptions()).switchAcpModel(e,r)}};exports.default=I;
2
2
  //# sourceMappingURL=agent-server-conversation-service.api.cjs.map