@openhands/agent-canvas 1.7.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-DP5rcauH.js → Trans-Bwpzk1wT.js} +1 -1
  4. package/build/assets/{acp-providers-BHKZvEm5.js → acp-providers-C921BlYB.js} +1 -1
  5. package/build/assets/active-backend-context-BiwzkzDy.js +2 -0
  6. package/build/assets/agent-context-settings-DXNT_dcw.js +1 -0
  7. package/build/assets/agent-profiles-settings-BymJf3EP.js +1 -0
  8. package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +41 -0
  9. package/build/assets/agent-settings-BjgQQe-_.js +1 -0
  10. package/build/assets/{agent-settings-BIOsUglV.js → agent-settings-WzqXk6B4.js} +2 -2
  11. package/build/assets/{alert-banner-C1nzoXBC.js → alert-banner-DR8EVyZM.js} +1 -1
  12. package/build/assets/api-error-message-e16L1kwH.js +1 -0
  13. package/build/assets/api-key-entry-screen-DI0I04O3.js +1 -0
  14. package/build/assets/app-settings-DGistSFV.js +1 -0
  15. package/build/assets/automation-C_eCrGyP.js +1 -0
  16. package/build/assets/automation-detail-DY6x2FW1.js +2 -0
  17. package/build/assets/automation-export-C09f-Lua.js +2 -0
  18. package/build/assets/automation-setup-route-CqKp0717.js +1 -0
  19. package/build/assets/automations-list-CqWJ7qXW.js +1 -0
  20. package/build/assets/{back-nav-button-Be_L157B.js → back-nav-button-D4ngzpSh.js} +1 -1
  21. package/build/assets/backend-form-modal-B8D5hBzK.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-BNpEylNP.js → backend-synced-settings-badge-BnzI8Ysj.js} +1 -1
  23. package/build/assets/{badge-DwgrwohM.js → badge-1Mf1iPcX.js} +1 -1
  24. package/build/assets/{base-modal-CSHhJTSr.js → base-modal-BBuy0WQQ.js} +1 -1
  25. package/build/assets/{brand-button-CQO8oqVo.js → brand-button-DGN6Y9o6.js} +1 -1
  26. package/build/assets/browser-D_ekTlTS.js +6 -0
  27. package/build/assets/{browser-tab-CEApjoEV.js → browser-tab-D4a4Ou_w.js} +1 -1
  28. package/build/assets/{chat-send-button-D4614wUz.js → chat-send-button-CgbcjD97.js} +1 -1
  29. package/build/assets/check-CPLXgluF.js +1 -0
  30. package/build/assets/chevron-down-CP4QHvyc.js +1 -0
  31. package/build/assets/circle-check-Dpy2_xSI.js +1 -0
  32. package/build/assets/{circle-plus-check-toggle-E3Ecb_gg.js → circle-plus-check-toggle-yTAS-nX3.js} +1 -1
  33. package/build/assets/cloud-funnel-analytics-CEOl5Gxr.js +1 -0
  34. package/build/assets/{combobox-caret-C8_eGdp2.js → combobox-caret-Bd2yySnF.js} +1 -1
  35. package/build/assets/command-menu-Bj6X4ckE.js +1 -0
  36. package/build/assets/condenser-settings-EAXQNR2E.js +1 -0
  37. package/build/assets/{confirmation-modal-gZtbojCm.js → confirmation-modal-NCUPr2-O.js} +1 -1
  38. package/build/assets/{context-menu-list-item-BTHGFhIx.js → context-menu-list-item-CrCrYuPF.js} +1 -1
  39. package/build/assets/conversation-BzyIcSwr.js +1 -0
  40. package/build/assets/conversation-CUJ0Vo8g.js +90 -0
  41. package/build/assets/conversation-panel-BzyIcSwr.js +1 -0
  42. package/build/assets/conversation-state-store-F62HvuI1.js +1 -0
  43. package/build/assets/{conversation-tab-empty-state-BCMHkGQk.js → conversation-tab-empty-state-BCZ7rUMH.js} +1 -1
  44. package/build/assets/{copy-B8Y5ufoR.js → copy-DCmZtz6n.js} +1 -1
  45. package/build/assets/{copy-to-clipboard-button-C4l3CMSd.js → copy-to-clipboard-button-D_Lp6-Fl.js} +1 -1
  46. package/build/assets/{device-verify-C_M7Z8xs.js → device-verify-DLmolX8Q.js} +1 -1
  47. package/build/assets/{dropdown-classes-DQlj-MpS.js → dropdown-classes-BB8rzqXL.js} +1 -1
  48. package/build/assets/{entry.client-DETaouwO.js → entry.client-BbIYOsIg.js} +2 -2
  49. package/build/assets/{enum-filter-dropdown-paB-lFSP.js → enum-filter-dropdown-C08-srev.js} +1 -1
  50. package/build/assets/{environment-switch-overlay-D0FgCMqs.js → environment-switch-overlay-BepBBX66.js} +1 -1
  51. package/build/assets/extensions-hub-R3KNv-5V.js +1 -0
  52. package/build/assets/extensions-navigation-CfWFmI1I.js +1 -0
  53. package/build/assets/{external-link-Cnnd6ikC.js → external-link-BdBSg8rk.js} +1 -1
  54. package/build/assets/files-tab-DEq8MbHu.js +1 -0
  55. package/build/assets/{form-control-classes-CSPevi7c.js → form-control-classes-DAfsCJTe.js} +1 -1
  56. package/build/assets/{format-time-delta-DuhE50B-.js → format-time-delta-CxfPJpzC.js} +1 -1
  57. package/build/assets/git-provider-icon-BZqqUPlm.js +1 -0
  58. package/build/assets/git-repo-dropdown-9WKINV6J.js +1 -0
  59. package/build/assets/git-repo-dropdown-DEpOwUez.js +1 -0
  60. package/build/assets/{highlighted-source-view-suUKd5if.js → highlighted-source-view-CX9oIoVT.js} +1 -1
  61. package/build/assets/home-CY0JaxiY.js +1 -0
  62. package/build/assets/home-CaNWlVvB.js +1 -0
  63. package/build/assets/home-store-Ch1ErdBc.js +1 -0
  64. package/build/assets/index-home-CaNWlVvB.js +1 -0
  65. package/build/assets/info-CmWQXtRQ.js +1 -0
  66. package/build/assets/install-server-modal-BWrudmZU.js +1 -0
  67. package/build/assets/{launch-Ccnhte5b.js → launch-B1POpHuP.js} +1 -1
  68. package/build/assets/{list-todo-_BXQzOiB.js → list-todo-DtiL3lTp.js} +1 -1
  69. package/build/assets/llm-not-configured-banner-3tMsM4K6.js +27 -0
  70. package/build/assets/llm-settings-CXo8iPNW.js +1 -0
  71. package/build/assets/llm-settings-D0W8mJDk.js +1 -0
  72. package/build/assets/{llm-subscription-service-W5BprsNA.js → llm-subscription-service-DBJbfd8Z.js} +1 -1
  73. package/build/assets/loader-circle-B4QDBARx.js +1 -0
  74. package/build/assets/{loading-spinner-CcpnCr_d.js → loading-spinner-DfZ_bhV7.js} +1 -1
  75. package/build/assets/manage-backends-modal-CwyWsiag.js +1 -0
  76. package/build/assets/manifest-39f4789d.js +1 -0
  77. package/build/assets/{markdown-renderer-CvOO0YIr.js → markdown-renderer-DgiLLhW6.js} +6 -6
  78. package/build/assets/mcp-DXG9LWrI.js +9 -0
  79. package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +1 -0
  80. package/build/assets/messages-kBjKaAeA.js +40 -0
  81. package/build/assets/{modal-body-DQhiw-AR.js → modal-body-CMsDpalT.js} +1 -1
  82. package/build/assets/{modal-classes-YaEEa5eZ.js → modal-classes-B6PDrxXo.js} +1 -1
  83. package/build/assets/{modal-close-button-turIYn0t.js → modal-close-button-DyxBZaAb.js} +1 -1
  84. package/build/assets/{onboarding-BegDrOKn.js → onboarding-47hh2IHA.js} +1 -1
  85. package/build/assets/onboarding-modal-9BuvvROo.js +1 -0
  86. package/build/assets/organization-service.api-UDy63-oC.js +1 -0
  87. package/build/assets/{pencil-8_lvWDoZ.js → pencil-BjgtZmWp.js} +1 -1
  88. package/build/assets/{planner-tab-w6HT0N_A.js → planner-tab-BWk8885v.js} +1 -1
  89. package/build/assets/plugins-management-service-CjkgF2dd.js +1 -0
  90. package/build/assets/plus-DrKuuvMe.js +1 -0
  91. package/build/assets/profiles-service.api-CukSFLzz.js +1 -0
  92. package/build/assets/providers-CqUWC85T.js +1 -0
  93. package/build/assets/proxy-BBUG3sd2.js +1 -0
  94. package/build/assets/{puzzle-DXWdfaa7.js → puzzle-BoNc6zZ8.js} +1 -1
  95. package/build/assets/recommended-automations-launcher-ejxy1P27.js +1 -0
  96. package/build/assets/{refresh-cw-D7CYLy-d.js → refresh-cw-BrM5ZAZD.js} +1 -1
  97. package/build/assets/root-5S-M8SYa.js +2 -0
  98. package/build/assets/root-DZ39lS5f.css +1 -0
  99. package/build/assets/root-layout-BPqoa0gv.js +3 -0
  100. package/build/assets/schema-field-nImDoY6-.js +1 -0
  101. package/build/assets/{sdk-section-page-BW-i45yr.js → sdk-section-page-BxMrtUNV.js} +1 -1
  102. package/build/assets/search-Dc2qR4O2.js +1 -0
  103. package/build/assets/secrets-service-Dhjh3HhH.js +1 -0
  104. package/build/assets/{secrets-settings-D7U1ErCH.js → secrets-settings-CPdxceT_.js} +1 -1
  105. package/build/assets/segmented-toggle-Do6oyepX.js +1 -0
  106. package/build/assets/settings-BRbnfKEm.js +1 -0
  107. package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-DYCULKpp.js} +1 -1
  108. package/build/assets/{settings-index-COAdxm2Q.js → settings-index-C9o2NBO0.js} +1 -1
  109. package/build/assets/settings-input-B-q2gkVy.js +1 -0
  110. package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-WpQi0q1L.js} +1 -1
  111. package/build/assets/{settings-modal-CFnbQ8_4.js → settings-modal-CEK0AIx6.js} +1 -1
  112. package/build/assets/settings-service.api-CZiPD8__.js +1 -0
  113. package/build/assets/{settings-switch-UNSf8K8I.js → settings-switch-LqKdGxHL.js} +1 -1
  114. package/build/assets/shared-conversation-Bu-dQlgp.js +1 -0
  115. package/build/assets/{sidebar-layout-DXHtbEj1.js → sidebar-layout-oHBGQmLh.js} +1 -1
  116. package/build/assets/{sidebar-mobile-menu-toggle-U78hQRJ1.js → sidebar-mobile-menu-toggle-ND-hgygu.js} +1 -1
  117. package/build/assets/{sidebar-nav-link-pvUivfK2.js → sidebar-nav-link-CrujNA09.js} +1 -1
  118. package/build/assets/{sidebar-store-DwrYKwYr.js → sidebar-store-Bui-WNEr.js} +1 -1
  119. package/build/assets/{skill-card-pill-row-D7XCz5uk.js → skill-card-pill-row-CZBI7OqH.js} +1 -1
  120. package/build/assets/{skill-icon-badge-HqBWZ2Eq.js → skill-icon-badge-BOov_phZ.js} +1 -1
  121. package/build/assets/{skills-plugins-BPhaNpfx.js → skills-plugins-D0PiHWAD.js} +1 -1
  122. package/build/assets/{skills-settings-CcwMtnnJ.js → skills-settings-B43KArIz.js} +2 -2
  123. package/build/assets/{styled-tooltip-DsjDnR_W.js → styled-tooltip-C7grwnOX.js} +1 -1
  124. package/build/assets/{task-list-tab-BmaTwjaS.js → task-list-tab-R3ac6m7O.js} +1 -1
  125. package/build/assets/{terminal-BRcoba5B.js → terminal-yqkNdEAx.js} +1 -1
  126. package/build/assets/{toggle-switch-BptY3XRG.js → toggle-switch-BeSrbgCg.js} +1 -1
  127. package/build/assets/{trash-2-Bq4lHbTB.js → trash-2-wW5TWcdN.js} +1 -1
  128. package/build/assets/{typography-C6fuRTTT.js → typography-iYhzLlHO.js} +1 -1
  129. package/build/assets/{use-acp-credential-form-B0_pZ_uS.js → use-acp-credential-form-DUxbxmbq.js} +1 -1
  130. package/build/assets/use-activate-agent-profile-CDHA52tC.js +1 -0
  131. package/build/assets/use-agent-profiles-TsOdIyw5.js +1 -0
  132. package/build/assets/{use-can-manage-org-profiles-CrG1km7R.js → use-can-manage-org-profiles-Bt1M71u5.js} +1 -1
  133. package/build/assets/use-cloud-current-user-id-DWt7HCgf.js +1 -0
  134. package/build/assets/{use-config-Csy8EAP9.js → use-config-CxlEdf_v.js} +1 -1
  135. package/build/assets/{use-create-conversation-Dsa4nzU9.js → use-create-conversation-nOJ6Um5h.js} +1 -1
  136. package/build/assets/{use-create-secret-BnxuAjDt.js → use-create-secret-Dj5ang9x.js} +1 -1
  137. package/build/assets/use-is-authed-BT7Iud4U.js +1 -0
  138. package/build/assets/{use-is-creating-conversation-CIAcnd8M.js → use-is-creating-conversation-CAggrM75.js} +1 -1
  139. package/build/assets/use-llm-profiles-2Wc2db8u.js +1 -0
  140. package/build/assets/use-onboarding-completion-gxQlcEy2.js +1 -0
  141. package/build/assets/use-plugins-marketplace-CVO7sXYR.js +1 -0
  142. package/build/assets/use-save-agent-profile-D0wC5ExW.js +1 -0
  143. package/build/assets/{use-save-settings-BRh9p_fv.js → use-save-settings-L3aMaDeS.js} +1 -1
  144. package/build/assets/use-settings-8nt3DGxW.js +1 -0
  145. package/build/assets/use-settings-nav-items-DHAAD-zk.js +16 -0
  146. package/build/assets/use-skills-CE6miQ3r.js +1 -0
  147. package/build/assets/use-tracking-BGboadaZ.js +68 -0
  148. package/build/assets/{use-user-conversation-GnGhs_Ob.js → use-user-conversation-BIIpGUgM.js} +1 -1
  149. package/build/assets/useInfiniteQuery-BLRVmVPU.js +1 -0
  150. package/build/assets/{useMutation-DyQXZFEF.js → useMutation-CaSHLnX0.js} +1 -1
  151. package/build/assets/{useQueries-B3T1a7qt.js → useQueries--d_WWAzc.js} +1 -1
  152. package/build/assets/{useQuery-B38jBavx.js → useQuery-DiPh8LRJ.js} +1 -1
  153. package/build/assets/utils-BgGG1znF.js +1 -0
  154. package/build/assets/{vendor~browser-CIoZCqGs.js → vendor~browser-IVYgIgG1.js} +1 -1
  155. package/build/assets/{vendor~entry.client-Di4qO77Y.js → vendor~entry.client-BcYIVQvB.js} +1 -1
  156. package/build/assets/{vendor~entry.client-BfviqoVc.js → vendor~entry.client-CXM9oiAk.js} +1 -1
  157. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js} +2 -2
  158. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js} +1 -1
  159. package/build/assets/{vendor~files-tab-vm3f67Pz.js → vendor~files-tab-C7RmQJwN.js} +1 -1
  160. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-kX4LrGQC.js → vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js} +1 -1
  161. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DpA6fir3.js → vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js} +1 -1
  162. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js +1 -0
  163. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js +1 -0
  164. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js +1 -0
  165. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js} +1 -1
  166. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js} +1 -1
  167. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js} +17 -4
  168. package/build/assets/{verification-settings-CaCzojbc.js → verification-settings-DBsnSXC3.js} +1 -1
  169. package/build/assets/x-omAzpXkl.js +1 -0
  170. package/build/favicon-16x16.png +0 -0
  171. package/build/favicon-32x32.png +0 -0
  172. package/build/favicon.ico +0 -0
  173. package/build/index.html +4 -4
  174. package/build/locales/ar/openhands.json +39 -2
  175. package/build/locales/ca/openhands.json +39 -2
  176. package/build/locales/de/openhands.json +39 -2
  177. package/build/locales/en/openhands.json +40 -3
  178. package/build/locales/es/openhands.json +39 -2
  179. package/build/locales/fr/openhands.json +39 -2
  180. package/build/locales/it/openhands.json +39 -2
  181. package/build/locales/ja/openhands.json +39 -2
  182. package/build/locales/ko-KR/openhands.json +39 -2
  183. package/build/locales/no/openhands.json +39 -2
  184. package/build/locales/pt/openhands.json +39 -2
  185. package/build/locales/tr/openhands.json +39 -2
  186. package/build/locales/uk/openhands.json +39 -2
  187. package/build/locales/zh-CN/openhands.json +39 -2
  188. package/build/locales/zh-TW/openhands.json +39 -2
  189. package/config/defaults.json +4 -4
  190. package/dist/api/agent-server-adapter.cjs +3 -3
  191. package/dist/api/agent-server-adapter.cjs.map +1 -1
  192. package/dist/api/agent-server-adapter.d.ts +46 -6
  193. package/dist/api/agent-server-adapter.js +187 -168
  194. package/dist/api/agent-server-adapter.js.map +1 -1
  195. package/dist/api/agent-server-compatibility.cjs +1 -1
  196. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  197. package/dist/api/agent-server-compatibility.d.ts +4 -0
  198. package/dist/api/agent-server-compatibility.js +41 -38
  199. package/dist/api/agent-server-compatibility.js.map +1 -1
  200. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  201. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  202. package/dist/api/automation-service/automation-service.api.d.ts +20 -0
  203. package/dist/api/automation-service/automation-service.api.js +136 -99
  204. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  205. package/dist/api/backend-registry/storage.cjs +1 -1
  206. package/dist/api/backend-registry/storage.cjs.map +1 -1
  207. package/dist/api/backend-registry/storage.js +1 -1
  208. package/dist/api/backend-registry/storage.js.map +1 -1
  209. package/dist/api/backend-registry/types.d.ts +2 -0
  210. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  211. package/dist/api/cloud/conversation-service.api.js +22 -22
  212. package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
  213. package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
  214. package/dist/api/mcp-service/mcp-service.api.js +19 -19
  215. package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
  216. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  217. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  218. package/dist/api/settings-service/settings-service.api.js +26 -12
  219. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  220. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +2 -0
  221. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -0
  222. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.d.ts +12 -0
  223. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +94 -0
  224. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -0
  225. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  226. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  227. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +31 -90
  228. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  229. package/dist/components/features/automations/recommended-automations-launcher.d.ts +0 -7
  230. package/dist/components/features/automations/recommended-automations-section.d.ts +0 -6
  231. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  232. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  233. package/dist/components/features/backends/backend-form-modal.js +568 -358
  234. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  235. package/dist/components/features/backends/device-flow-auth.cjs +1 -1
  236. package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
  237. package/dist/components/features/backends/device-flow-auth.d.ts +9 -1
  238. package/dist/components/features/backends/device-flow-auth.js +56 -55
  239. package/dist/components/features/backends/device-flow-auth.js.map +1 -1
  240. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  241. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  242. package/dist/components/features/backends/manage-backends-modal.js +1 -1
  243. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  244. package/dist/components/features/chat/chat-interface.cjs +1 -1
  245. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  246. package/dist/components/features/chat/chat-interface.js +105 -105
  247. package/dist/components/features/chat/chat-interface.js.map +1 -1
  248. package/dist/components/features/chat/chat-message.cjs +1 -1
  249. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  250. package/dist/components/features/chat/chat-message.d.ts +2 -1
  251. package/dist/components/features/chat/chat-message.js +59 -49
  252. package/dist/components/features/chat/chat-message.js.map +1 -1
  253. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  254. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  255. package/dist/components/features/chat/pending-user-messages.js +4 -1
  256. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  257. package/dist/components/features/chat/typing-indicator.cjs +1 -1
  258. package/dist/components/features/chat/typing-indicator.cjs.map +1 -1
  259. package/dist/components/features/chat/typing-indicator.d.ts +8 -1
  260. package/dist/components/features/chat/typing-indicator.js +94 -10
  261. package/dist/components/features/chat/typing-indicator.js.map +1 -1
  262. package/dist/components/features/command-menu/command-menu-items.d.ts +5 -1
  263. package/dist/components/features/files-tab/segmented-toggle.cjs +1 -1
  264. package/dist/components/features/files-tab/segmented-toggle.cjs.map +1 -1
  265. package/dist/components/features/files-tab/segmented-toggle.d.ts +2 -0
  266. package/dist/components/features/files-tab/segmented-toggle.js +17 -14
  267. package/dist/components/features/files-tab/segmented-toggle.js.map +1 -1
  268. package/dist/components/features/manifest/manifest-form-field.d.ts +27 -0
  269. package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +11 -0
  270. package/dist/components/features/manifest/manifest-review-step.d.ts +14 -0
  271. package/dist/components/features/manifest/manifest-setup-dialog.d.ts +14 -0
  272. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  273. package/dist/components/features/mcp-page/custom-server-editor.js +16 -16
  274. package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
  275. package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
  276. package/dist/components/features/mcp-page/installed-server-card.d.ts +2 -2
  277. package/dist/components/features/mcp-page/installed-server-card.js +6 -7
  278. package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
  279. package/dist/components/features/mcp-page/installed-servers-section.cjs +1 -1
  280. package/dist/components/features/mcp-page/installed-servers-section.cjs.map +1 -1
  281. package/dist/components/features/mcp-page/installed-servers-section.d.ts +2 -2
  282. package/dist/components/features/mcp-page/installed-servers-section.js +2 -2
  283. package/dist/components/features/mcp-page/installed-servers-section.js.map +1 -1
  284. package/dist/components/features/mcp-page/mcp-server-health.cjs +1 -1
  285. package/dist/components/features/mcp-page/mcp-server-health.js +4 -4
  286. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
  287. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
  288. package/dist/components/features/settings/mcp-settings/mcp-server-form.js +2 -1
  289. package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
  290. package/dist/components/features/settings/settings-input.cjs +1 -1
  291. package/dist/components/features/settings/settings-input.cjs.map +1 -1
  292. package/dist/components/features/settings/settings-input.d.ts +6 -0
  293. package/dist/components/features/settings/settings-input.js +13 -8
  294. package/dist/components/features/settings/settings-input.js.map +1 -1
  295. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  296. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  297. package/dist/components/features/sidebar/sidebar-rail-body.js +124 -123
  298. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  299. package/dist/config/defaults.cjs +1 -1
  300. package/dist/config/defaults.cjs.map +1 -1
  301. package/dist/config/defaults.js +3 -3
  302. package/dist/config/defaults.js.map +1 -1
  303. package/dist/contexts/active-backend-context.cjs +1 -1
  304. package/dist/contexts/active-backend-context.cjs.map +1 -1
  305. package/dist/contexts/active-backend-context.d.ts +3 -2
  306. package/dist/contexts/active-backend-context.js +55 -42
  307. package/dist/contexts/active-backend-context.js.map +1 -1
  308. package/dist/favicon-16x16.png +0 -0
  309. package/dist/favicon-32x32.png +0 -0
  310. package/dist/favicon.ico +0 -0
  311. package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
  312. package/dist/hooks/mutation/use-update-mcp-server.js +5 -5
  313. package/dist/hooks/query/query-keys.cjs.map +1 -1
  314. package/dist/hooks/query/query-keys.d.ts +4 -0
  315. package/dist/hooks/query/query-keys.js.map +1 -1
  316. package/dist/hooks/query/use-cloud-current-user-id.cjs +1 -1
  317. package/dist/hooks/query/use-cloud-current-user-id.cjs.map +1 -1
  318. package/dist/hooks/query/use-cloud-current-user-id.js +7 -5
  319. package/dist/hooks/query/use-cloud-current-user-id.js.map +1 -1
  320. package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
  321. package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
  322. package/dist/hooks/query/use-cloud-organizations.js +5 -1
  323. package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
  324. package/dist/hooks/query/use-manifest-capabilities.d.ts +21 -0
  325. package/dist/hooks/query/use-manifest-prerequisites.d.ts +24 -0
  326. package/dist/hooks/use-can-manage-org-profiles.cjs +1 -1
  327. package/dist/hooks/use-can-manage-org-profiles.cjs.map +1 -1
  328. package/dist/hooks/use-can-manage-org-profiles.js +2 -1
  329. package/dist/hooks/use-can-manage-org-profiles.js.map +1 -1
  330. package/dist/hooks/use-llm-configured.cjs +1 -1
  331. package/dist/hooks/use-llm-configured.cjs.map +1 -1
  332. package/dist/hooks/use-llm-configured.js +2 -1
  333. package/dist/hooks/use-llm-configured.js.map +1 -1
  334. package/dist/hooks/use-manifest-preflight.d.ts +18 -0
  335. package/dist/hooks/use-tracking.cjs +1 -1
  336. package/dist/hooks/use-tracking.cjs.map +1 -1
  337. package/dist/hooks/use-tracking.d.ts +14 -0
  338. package/dist/hooks/use-tracking.js +28 -10
  339. package/dist/hooks/use-tracking.js.map +1 -1
  340. package/dist/i18n/declaration.cjs +1 -1
  341. package/dist/i18n/declaration.cjs.map +1 -1
  342. package/dist/i18n/declaration.d.ts +38 -1
  343. package/dist/i18n/declaration.js +1 -1
  344. package/dist/i18n/declaration.js.map +1 -1
  345. package/dist/i18n/translation.cjs +2 -2
  346. package/dist/i18n/translation.cjs.map +1 -1
  347. package/dist/i18n/translation.js +645 -16
  348. package/dist/i18n/translation.js.map +1 -1
  349. package/dist/icons/external-link.cjs +2 -0
  350. package/dist/icons/external-link.cjs.map +1 -0
  351. package/dist/icons/external-link.js +22 -0
  352. package/dist/icons/external-link.js.map +1 -0
  353. package/dist/icons/server.cjs +2 -0
  354. package/dist/icons/server.cjs.map +1 -0
  355. package/dist/icons/server.js +17 -0
  356. package/dist/icons/server.js.map +1 -0
  357. package/dist/locales/ar/openhands.json +39 -2
  358. package/dist/locales/ca/openhands.json +39 -2
  359. package/dist/locales/de/openhands.json +39 -2
  360. package/dist/locales/en/openhands.json +40 -3
  361. package/dist/locales/es/openhands.json +39 -2
  362. package/dist/locales/fr/openhands.json +39 -2
  363. package/dist/locales/it/openhands.json +39 -2
  364. package/dist/locales/ja/openhands.json +39 -2
  365. package/dist/locales/ko-KR/openhands.json +39 -2
  366. package/dist/locales/no/openhands.json +39 -2
  367. package/dist/locales/pt/openhands.json +39 -2
  368. package/dist/locales/tr/openhands.json +39 -2
  369. package/dist/locales/uk/openhands.json +39 -2
  370. package/dist/locales/zh-CN/openhands.json +39 -2
  371. package/dist/locales/zh-TW/openhands.json +39 -2
  372. package/dist/manifests/automation-interface.cjs +2 -0
  373. package/dist/manifests/automation-interface.cjs.map +1 -0
  374. package/dist/manifests/automation-interface.d.ts +44 -0
  375. package/dist/manifests/automation-interface.js +81 -0
  376. package/dist/manifests/automation-interface.js.map +1 -0
  377. package/dist/manifests/automation-setup.cjs +2 -0
  378. package/dist/manifests/automation-setup.cjs.map +1 -0
  379. package/dist/manifests/automation-setup.d.ts +52 -0
  380. package/dist/manifests/automation-setup.js +8 -0
  381. package/dist/manifests/automation-setup.js.map +1 -0
  382. package/dist/manifests/interface-validation.cjs +2 -0
  383. package/dist/manifests/interface-validation.cjs.map +1 -0
  384. package/dist/manifests/interface-validation.d.ts +27 -0
  385. package/dist/manifests/interface-validation.js +182 -0
  386. package/dist/manifests/interface-validation.js.map +1 -0
  387. package/dist/manifests/manifest-actions.d.ts +15 -0
  388. package/dist/manifests/manifest-capabilities.d.ts +25 -0
  389. package/dist/manifests/manifest-error-map.d.ts +40 -0
  390. package/dist/manifests/manifest-local-validation.d.ts +56 -0
  391. package/dist/manifests/manifest-registry.cjs +2 -0
  392. package/dist/manifests/manifest-registry.cjs.map +1 -0
  393. package/dist/manifests/manifest-registry.d.ts +15 -0
  394. package/dist/manifests/manifest-registry.js +26 -0
  395. package/dist/manifests/manifest-registry.js.map +1 -0
  396. package/dist/manifests/manifest-sources.cjs +2 -0
  397. package/dist/manifests/manifest-sources.cjs.map +1 -0
  398. package/dist/manifests/manifest-sources.d.ts +15 -0
  399. package/dist/manifests/manifest-sources.js +8 -0
  400. package/dist/manifests/manifest-sources.js.map +1 -0
  401. package/dist/manifests/manifest-template.d.ts +18 -0
  402. package/dist/manifests/manifest-validation.cjs +2 -0
  403. package/dist/manifests/manifest-validation.cjs.map +1 -0
  404. package/dist/manifests/manifest-validation.d.ts +30 -0
  405. package/dist/manifests/manifest-validation.js +145 -0
  406. package/dist/manifests/manifest-validation.js.map +1 -0
  407. package/dist/manifests/types.cjs +2 -0
  408. package/dist/manifests/types.cjs.map +1 -0
  409. package/dist/manifests/types.d.ts +227 -0
  410. package/dist/manifests/types.js +6 -0
  411. package/dist/manifests/types.js.map +1 -0
  412. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +9 -0
  413. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -0
  414. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +75 -0
  415. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -0
  416. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +9 -0
  417. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -0
  418. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +78 -0
  419. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -0
  420. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs +17 -0
  421. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs.map +1 -0
  422. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js +89 -0
  423. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js.map +1 -0
  424. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs +10 -0
  425. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs.map +1 -0
  426. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js +17 -0
  427. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js.map +1 -0
  428. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs +9 -0
  429. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs.map +1 -0
  430. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js +15 -0
  431. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js.map +1 -0
  432. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs +9 -0
  433. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs.map +1 -0
  434. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js +18 -0
  435. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js.map +1 -0
  436. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs +9 -0
  437. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs.map +1 -0
  438. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js +14 -0
  439. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js.map +1 -0
  440. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs +9 -0
  441. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs.map +1 -0
  442. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js +14 -0
  443. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js.map +1 -0
  444. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +2 -0
  445. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -0
  446. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +23 -0
  447. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -0
  448. package/dist/node_modules/@openhands/extensions/automations/index.cjs +2 -0
  449. package/dist/node_modules/@openhands/extensions/automations/index.cjs.map +1 -0
  450. package/dist/node_modules/@openhands/extensions/automations/index.js +18 -0
  451. package/dist/node_modules/@openhands/extensions/automations/index.js.map +1 -0
  452. package/dist/node_modules/@openhands/extensions/automations/interface.cjs +2 -0
  453. package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -0
  454. package/dist/node_modules/@openhands/extensions/automations/interface.js +89 -0
  455. package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -0
  456. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  457. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  458. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +3 -3
  459. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  460. package/dist/node_modules/@openhands/extensions/skills/index.cjs +17 -4
  461. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  462. package/dist/node_modules/@openhands/extensions/skills/index.js +5 -5
  463. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  464. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  465. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  466. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +9 -0
  467. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  468. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs +2 -0
  469. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs.map +1 -0
  470. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js +29 -0
  471. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js.map +1 -0
  472. package/dist/package.cjs +1 -1
  473. package/dist/package.cjs.map +1 -1
  474. package/dist/package.js +3 -3
  475. package/dist/package.js.map +1 -1
  476. package/dist/routes/app-settings.cjs +1 -1
  477. package/dist/routes/app-settings.js +5 -5
  478. package/dist/routes/mcp.cjs +1 -1
  479. package/dist/routes/mcp.cjs.map +1 -1
  480. package/dist/routes/mcp.js +73 -82
  481. package/dist/routes/mcp.js.map +1 -1
  482. package/dist/services/telemetry.cjs +1 -1
  483. package/dist/services/telemetry.cjs.map +1 -1
  484. package/dist/services/telemetry.d.ts +8 -0
  485. package/dist/services/telemetry.js +163 -116
  486. package/dist/services/telemetry.js.map +1 -1
  487. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +2 -19
  488. package/dist/types/agent-server/core/events/observation-event.d.ts +2 -18
  489. package/dist/types/automation.d.ts +7 -3
  490. package/dist/types/mcp-server.d.ts +5 -0
  491. package/dist/types/settings.d.ts +3 -0
  492. package/dist/utils/api-error-message.d.ts +6 -2
  493. package/dist/utils/automation-catalog.cjs +2 -0
  494. package/dist/utils/automation-catalog.cjs.map +1 -0
  495. package/dist/utils/automation-catalog.d.ts +28 -0
  496. package/dist/utils/automation-catalog.js +5 -0
  497. package/dist/utils/automation-catalog.js.map +1 -0
  498. package/dist/utils/automation-timeout.d.ts +3 -2
  499. package/dist/utils/mcp-config.cjs +1 -1
  500. package/dist/utils/mcp-config.cjs.map +1 -1
  501. package/dist/utils/mcp-config.d.ts +8 -0
  502. package/dist/utils/mcp-config.js +25 -20
  503. package/dist/utils/mcp-config.js.map +1 -1
  504. package/dist/utils/mcp-installed-servers.cjs +1 -1
  505. package/dist/utils/mcp-installed-servers.cjs.map +1 -1
  506. package/dist/utils/mcp-installed-servers.js +6 -3
  507. package/dist/utils/mcp-installed-servers.js.map +1 -1
  508. package/dist/utils/responder-deployment.d.ts +5 -1
  509. package/dist/utils/transcript-export/index.cjs +5 -5
  510. package/dist/utils/transcript-export/index.js +12 -12
  511. package/package.json +3 -3
  512. package/scripts/check-sdk-version-sync.mjs +6 -6
  513. package/scripts/check-translation-completeness.cjs +1 -0
  514. package/scripts/dev-safe.mjs +17 -12
  515. package/scripts/dev-static.mjs +17 -0
  516. package/scripts/dev-with-automation.mjs +12 -14
  517. package/scripts/ingress.mjs +22 -0
  518. package/scripts/proxy-utils.mjs +157 -2
  519. package/scripts/runtime-services-info.mjs +6 -6
  520. package/scripts/static-build.mjs +0 -7
  521. package/scripts/static-server.mjs +10 -0
  522. package/build/assets/active-backend-context-BlZPzZNU.js +0 -1
  523. package/build/assets/agent-context-settings-CTaN-Iw9.js +0 -1
  524. package/build/assets/agent-profiles-settings-CR4VTqv_.js +0 -1
  525. package/build/assets/agent-server-conversation-service.api-Btmi4q6d.js +0 -41
  526. package/build/assets/agent-settings-KQs-occT.js +0 -1
  527. package/build/assets/api-key-entry-screen-BhR24gkM.js +0 -1
  528. package/build/assets/app-settings-Bs4sY8WP.js +0 -1
  529. package/build/assets/automation-BGP_I1RR.js +0 -1
  530. package/build/assets/automation-detail-CwDnJbYR.js +0 -2
  531. package/build/assets/automation-export-Bu-r-EzL.js +0 -2
  532. package/build/assets/automations-list-CYw7_6FR.js +0 -1
  533. package/build/assets/backend-form-modal-Ce-KRHOJ.js +0 -1
  534. package/build/assets/browser-BUDJnBg4.js +0 -6
  535. package/build/assets/check-BMOG005H.js +0 -1
  536. package/build/assets/chevron-down-CV1zZP_K.js +0 -1
  537. package/build/assets/circle-check-lvN_jFN5.js +0 -1
  538. package/build/assets/client-source-1v-kWLNU.js +0 -1
  539. package/build/assets/cloud-funnel-analytics-CasMM7EO.js +0 -1
  540. package/build/assets/command-menu-N_BriUy8.js +0 -1
  541. package/build/assets/condenser-settings-Czi8cKxV.js +0 -1
  542. package/build/assets/conversation-C25pc2dT.js +0 -1
  543. package/build/assets/conversation-CObLYSJd.js +0 -90
  544. package/build/assets/conversation-panel-C25pc2dT.js +0 -1
  545. package/build/assets/conversation-state-store-DTq4hFoP.js +0 -1
  546. package/build/assets/extensions-hub-BKftOQ-X.js +0 -1
  547. package/build/assets/extensions-navigation-DF24q1H1.js +0 -1
  548. package/build/assets/files-tab-SAiFCnS5.js +0 -1
  549. package/build/assets/git-provider-icon-BREx-yUX.js +0 -1
  550. package/build/assets/home-EPNFgzUh.js +0 -1
  551. package/build/assets/home-sN90Xcxp.js +0 -1
  552. package/build/assets/index-home-EPNFgzUh.js +0 -1
  553. package/build/assets/install-server-modal-BI8yUfmr.js +0 -1
  554. package/build/assets/llm-not-configured-banner-DTWzISnk.js +0 -27
  555. package/build/assets/llm-settings-BXk5_Pac.js +0 -1
  556. package/build/assets/llm-settings-C1vpgWam.js +0 -1
  557. package/build/assets/loader-circle-6zlEYCJw.js +0 -1
  558. package/build/assets/manage-backends-modal-DhflyGTf.js +0 -1
  559. package/build/assets/manifest-8082e879.js +0 -1
  560. package/build/assets/mcp-CxLPda-W.js +0 -9
  561. package/build/assets/messages-DINDkPNK.js +0 -40
  562. package/build/assets/onboarding-modal-DdvE6rzw.js +0 -1
  563. package/build/assets/organization-service.api-CT2OQlLz.js +0 -1
  564. package/build/assets/plugins-management-service-DVkoM3eA.js +0 -1
  565. package/build/assets/plus-vIbGD459.js +0 -1
  566. package/build/assets/profiles-service.api-CBafmAPO.js +0 -1
  567. package/build/assets/providers-9UzRB9mT.js +0 -1
  568. package/build/assets/proxy-C79PCMjo.js +0 -1
  569. package/build/assets/recommended-automations-launcher-BF2mtAKw.js +0 -58
  570. package/build/assets/root-B5JXKp1P.css +0 -1
  571. package/build/assets/root-Sj7W28yE.js +0 -2
  572. package/build/assets/root-layout-DbhKVoc7.js +0 -3
  573. package/build/assets/schema-field-CV6bFnoL.js +0 -1
  574. package/build/assets/search-sKuYKllf.js +0 -1
  575. package/build/assets/secrets-service-BjK-bPN2.js +0 -1
  576. package/build/assets/segmented-toggle-DbbD3Tve.js +0 -1
  577. package/build/assets/settings-Bj5Oo45A.js +0 -1
  578. package/build/assets/settings-input-BjW_zyTN.js +0 -1
  579. package/build/assets/settings-service.api-DryhKdSr.js +0 -1
  580. package/build/assets/shared-conversation-CnMxy7p_.js +0 -1
  581. package/build/assets/telemetry-cmCL3o6Z.js +0 -2
  582. package/build/assets/use-activate-agent-profile-DH33MvVj.js +0 -1
  583. package/build/assets/use-agent-profiles-Dmd_4H8q.js +0 -1
  584. package/build/assets/use-cloud-current-user-id-B6DP3s47.js +0 -1
  585. package/build/assets/use-is-authed-BsS4XwSL.js +0 -1
  586. package/build/assets/use-llm-profiles-BMQoc612.js +0 -1
  587. package/build/assets/use-onboarding-completion-B-2BTS-y.js +0 -1
  588. package/build/assets/use-plugins-marketplace-PBc_XNz_.js +0 -1
  589. package/build/assets/use-save-agent-profile-2Mk9ZX37.js +0 -1
  590. package/build/assets/use-settings-DBI44RnH.js +0 -1
  591. package/build/assets/use-settings-nav-items-Cva28C-c.js +0 -16
  592. package/build/assets/use-skills-RQsCtdzN.js +0 -1
  593. package/build/assets/use-tracking-CN1nIMnY.js +0 -1
  594. package/build/assets/utils-qjs_KuS4.js +0 -1
  595. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js +0 -1
  596. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js +0 -1
  597. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js +0 -1
  598. package/build/assets/x-EjvKGawc.js +0 -1
  599. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js} +0 -0
@@ -1,5 +1,5 @@
1
- require("../_virtual/_rolldown/runtime.cjs");const e=require("../types/agent-server/core/base/common.cjs"),t=require("./agent-server-config.cjs"),n=require("./backend-registry/active-store.cjs"),r=require("./agent-server-client-options.cjs"),i=require("./agent-server-compatibility.cjs"),a=require("../constants/canvas-ui.cjs"),o=require("../node_modules/@openhands/typescript-client/dist/models/acp.cjs");require("../node_modules/@openhands/typescript-client/dist/index.cjs");const s=require("./conversation-metadata-store.cjs"),c=require("../node_modules/@openhands/extensions/skills/index.cjs"),l=require("../services/settings.cjs"),u=require("../constants/acp-providers.cjs"),d=require("./backend-registry/auth.cjs"),f=require("./settings-service/settings-service.api.cjs"),p=require("../constants/llm-subscription.cjs"),m=require("./llm-subscription-service.cjs"),h=require("./canvas-ui-client-tool.cjs");var g=[`terminal`,`file_editor`,`task_tracker`],_=`browser_tool_set`,v=`task_tool_set`;function y(){return!0}function b(){if(typeof window<`u`){let e=window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;if(typeof e==`string`)return e.trim()||null}return null}function x(){let e=b();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function S(){let e=x();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,{frontend:a}=e.services;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
2
- `)}function C(e){let{host:t}=r.getAgentServerClientOptions();return`${t}/api/conversations/${e}`}function w(e){return`Conversation ${e.slice(0,5)}`}function T(n){let i=s.getStoredConversationMetadata(n.id),a=n.agent?.kind===`ACPAgent`,o=a?n.tags?.acpserver??n.agent?.acp_server??null:null;return{id:n.id,created_by_user_id:null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:i?.selected_workspace??null,active_profile:i?.active_profile??null,title:n.title?.trim()?n.title:w(n.id),trigger:null,pr_number:[],agent_kind:a?`acp`:`openhands`,acp_server:o,tags:n.tags??null,launched_agent_profile:n.launched_agent_profile??null,llm_model:a?u.resolveEffectiveAcpModel({runtimeName:n.current_model_name,runtimeId:n.current_model_id,configured:n.agent?.acp_model,sdkLlm:n.agent?.llm?.model}):n.agent?.llm?.model??l.DEFAULT_SETTINGS.llm_model,metrics:n.metrics?{accumulated_cost:n.metrics.accumulated_cost??null,max_budget_per_task:n.metrics.max_budget_per_task??null,accumulated_token_usage:n.metrics.accumulated_token_usage?{prompt_tokens:n.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:n.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:n.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:n.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:n.metrics.accumulated_token_usage.context_window??0,per_turn_token:n.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:n.created_at,updated_at:n.updated_at,execution_status:n.execution_status??e.ExecutionStatus.IDLE,sandbox_status:n.sandbox_status??null,conversation_url:C(n.id),session_api_key:r.getAgentServerClientOptions().apiKey??null,sandbox_id:null,workspace:{working_dir:n.workspace?.working_dir??t.getAgentServerWorkingDir()},public:!1,sub_conversation_ids:[]}}function ee(e){return{items:e.items.map(T),next_page_id:e.next_page_id??null}}var E=`acpserver`,D=new Set([E]);function O(e){return e?Object.entries(e).filter(([e])=>!D.has(e)).sort(([e],[t])=>e.localeCompare(t)):[]}var k=`gAAAAA`,A=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function j(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function M(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function N(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function P(e){return typeof e==`string`?e.startsWith(k):Array.isArray(e)?e.some(P):N(e)?Object.values(e).some(P):!1}function F(e){return N(e)?Object.values(e).some(P):!1}function I(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function L(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function R(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function z(e,t){return e===_?y()&&i.isAgentServerToolAvailable(e):e===v?t.enable_sub_agents===!0&&i.isAgentServerToolAvailable(e):!0}function B(e){let t=new Map;for(let n of g)z(n,e)&&t.set(n,{name:n,params:{}});for(let n of[_,v])z(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>R(e)))for(let r of n)z(r.name,e)&&t.set(r.name,{name:r.name,params:j(r.params)});return Array.from(t.values())}function V(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../types/agent-server/core/base/common.cjs"),t=require("../node_modules/@openhands/typescript-client/dist/client/server-client.cjs");require("../node_modules/@openhands/typescript-client/dist/clients.cjs");const n=require("./agent-server-config.cjs"),r=require("./backend-registry/active-store.cjs"),i=require("./agent-server-client-options.cjs"),a=require("./agent-server-compatibility.cjs"),o=require("../constants/canvas-ui.cjs"),s=require("../node_modules/@openhands/typescript-client/dist/models/acp.cjs");require("../node_modules/@openhands/typescript-client/dist/index.cjs");const c=require("./conversation-metadata-store.cjs"),l=require("../node_modules/@openhands/extensions/skills/index.cjs"),u=require("../services/settings.cjs"),d=require("../constants/acp-providers.cjs"),f=require("./backend-registry/auth.cjs"),p=require("./settings-service/settings-service.api.cjs"),m=require("../constants/llm-subscription.cjs"),h=require("./llm-subscription-service.cjs"),g=require("./canvas-ui-client-tool.cjs");var _=[`terminal`,`file_editor`,`task_tracker`],v=`browser_tool_set`,y=`task_tool_set`;function b(){return!0}function x(e){if(typeof e==`string`){let t=e.trim();if(!t)return null;try{return x(JSON.parse(t))}catch{return null}}if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return!t.services||typeof t.services!=`object`?null:t}async function S(){let e;try{e=i.getAgentServerClientOptions({timeout:3e3})}catch{return null}let n=x(a.getCachedAgentServerInfo({host:e.host})?.runtime_services);if(n)return n;try{return x((await new t.ServerClient(e).getServerInfo()).runtime_services)}catch{return null}}function C(e){let t=x(e);if(!t?.services)return;let n=[];n.push(`<RUNTIME_SERVICES>`),t.mode?n.push(`You are running inside an agent-canvas dev stack started in '${t.mode}' mode.`):n.push(`You are running inside an agent-canvas dev stack.`),n.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:r,ingress:i,automation:a}=t.services,{frontend:o}=t.services;r?.url_from_agent&&n.push(`* Agent Server (you): ${r.url_from_agent}`,` ${r.description??`The agent-server hosting your tool calls.`}`),i?.url_from_agent&&n.push(`* Ingress: ${i.url_from_agent}`,` ${i.description??`Unified entry point for browser-facing traffic.`}`),o?.url_from_agent&&n.push(`* Frontend: ${o.url_from_agent}`,` ${o.description??`Frontend dev server.`}`),a?.url_from_agent?(n.push(`* Automation backend: ${a.url_from_agent}`,` ${a.description??`OpenHands Automations service.`}`),a.docs_url&&n.push(` Docs: ${a.docs_url}`),a.openapi_url&&n.push(` OpenAPI: ${a.openapi_url}`),a.auth_env_var&&n.push(` Auth: header 'X-Session-API-Key: $${a.auth_env_var}'`)):n.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let s=r?.url_from_agent;return n.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),s&&n.push(`In particular, ${s} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),n.push(`</RUNTIME_SERVICES>`),n.join(`
2
+ `)}function w(e){let{host:t}=i.getAgentServerClientOptions();return`${t}/api/conversations/${e}`}function T(e){return`Conversation ${e.slice(0,5)}`}function E(t){let r=c.getStoredConversationMetadata(t.id),a=t.agent?.kind===`ACPAgent`,o=a?t.tags?.acpserver??t.agent?.acp_server??null:null;return{id:t.id,created_by_user_id:null,selected_repository:r?.selected_repository??null,selected_branch:r?.selected_branch??null,git_provider:r?.git_provider??null,selected_workspace:r?.selected_workspace??null,active_profile:r?.active_profile??null,title:t.title?.trim()?t.title:T(t.id),trigger:null,pr_number:[],agent_kind:a?`acp`:`openhands`,acp_server:o,tags:t.tags??null,launched_agent_profile:t.launched_agent_profile??null,llm_model:a?d.resolveEffectiveAcpModel({runtimeName:t.current_model_name,runtimeId:t.current_model_id,configured:t.agent?.acp_model,sdkLlm:t.agent?.llm?.model}):t.agent?.llm?.model??u.DEFAULT_SETTINGS.llm_model,metrics:t.metrics?{accumulated_cost:t.metrics.accumulated_cost??null,max_budget_per_task:t.metrics.max_budget_per_task??null,accumulated_token_usage:t.metrics.accumulated_token_usage?{prompt_tokens:t.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:t.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:t.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:t.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:t.metrics.accumulated_token_usage.context_window??0,per_turn_token:t.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:t.created_at,updated_at:t.updated_at,execution_status:t.execution_status??e.ExecutionStatus.IDLE,sandbox_status:t.sandbox_status??null,conversation_url:w(t.id),session_api_key:i.getAgentServerClientOptions().apiKey??null,sandbox_id:null,workspace:{working_dir:t.workspace?.working_dir??n.getAgentServerWorkingDir()},public:!1,sub_conversation_ids:[]}}function ee(e){return{items:e.items.map(E),next_page_id:e.next_page_id??null}}var D=`acpserver`,O=new Set([D]);function k(e){return e?Object.entries(e).filter(([e])=>!O.has(e)).sort(([e],[t])=>e.localeCompare(t)):[]}var A=`gAAAAA`,j=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function M(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function N(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function P(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function F(e){return typeof e==`string`?e.startsWith(A):Array.isArray(e)?e.some(F):P(e)?Object.values(e).some(F):!1}function I(e){return P(e)?Object.values(e).some(F):!1}function L(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function R(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function z(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function B(e,t){return e===v?b()&&a.isAgentServerToolAvailable(e):e===y?t.enable_sub_agents===!0&&a.isAgentServerToolAvailable(e):!0}function V(e){let t=new Map;for(let n of _)B(n,e)&&t.set(n,{name:n,params:{}});for(let n of[v,y])B(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>z(e)))for(let r of n)B(r.name,e)&&t.set(r.name,{name:r.name,params:M(r.params)});return Array.from(t.values())}function H(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
3
3
 
4
- `)}],run:!0}}function H(){return c.default.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null;return{name:e.name,content:e.content,trigger:t,source:`public`,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function U(e){let t=S(),n=j(e.agent_context),r=[...Array.isArray(n.skills)?n.skills:[],...H()];return{...n,skills:r,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function W(e){return j(e.agent_settings).agent_kind===`acp`}function G(e){let t=j(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function K(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=u.getAcpProvider(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function q(e){let t=j(e.agent_settings),n={agent_kind:`acp`,agent_context:U(t)};for(let e of o.ACP_SETTINGS_KEYS){if(e===`acp_model`||e===`acp_env`)continue;let r=e===`acp_command`?K(t):t[e];r!=null&&(n[e]=r)}let r=j(t.mcp_config);Object.keys(r).length>0&&(n.mcp_config=r);let i=typeof t.acp_server==`string`?t.acp_server:void 0,a=u.resolveEffectiveAcpModel({configured:t.acp_model,providerDefault:u.getAcpPreferredDefaultModel(i)});return a&&(n.acp_model=a),n}function J(e){let t=j(e.agent_settings),n=j(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:l.DEFAULT_SETTINGS.llm_model,n.stream=!0;let r=M(n.api_key);r?n.api_key=r:delete n.api_key;let i=M(n.base_url);i?n.base_url=i:delete n.base_url,p.isSubscriptionLlmConfig(n)?(n.auth_type=p.LLM_AUTH_TYPE_SUBSCRIPTION,n.subscription_vendor=p.OPENAI_SUBSCRIPTION_VENDOR,delete n.api_key,delete n.base_url):(delete n.auth_type,delete n.subscription_vendor);let a=j(t.mcp_config);Object.keys(a).length===0&&delete t.mcp_config,delete t.acp_server;for(let e of o.ACP_SETTINGS_KEYS)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:U(t),tools:B(t)}}function Y(e){return W(e)?q(e):J(e)}function X(e){let{settings:n,query:r,conversationInstructions:i,plugins:a,workingDir:o}=e,s=j(n.conversation_settings),c=V(r,i);return A.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??t.getAgentServerWorkingDir()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Z(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,r=W(t),i=e.agentProfileId?e.agentProfileKind:r?`acp`:`openhands`,o=Y(t),s=r?G(t):void 0,c=X(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),l={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:o},workspace:c.workspace,client_tools:i===`openhands`?[h.CANVAS_UI_CLIENT_TOOL]:[],confirmation_policy:I(c),max_iterations:typeof c.max_iterations==`number`?c.max_iterations:500,stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&s&&(l.tags={[E]:s}),!e.agentProfileId&&e.secretsEncrypted&&(!r||F(o.mcp_config))&&(l.secrets_encrypted=!0),e.conversationId&&(l.conversation_id=e.conversationId);let u=L(c);u&&(l.security_analyzer=u),c.initial_message&&(l.initial_message=c.initial_message),c.plugins&&(l.plugins=c.plugins),c.hook_config&&(l.hook_config=c.hook_config);let f={...c.tool_module_qualnames??{}};if(delete f[a.LEGACY_CANVAS_UI_TOOL_NAME],delete f[a.CANVAS_UI_CLIENT_TOOL_NAME],Object.keys(f).length>0&&(l.tool_module_qualnames=f),c.agent_definitions&&(l.agent_definitions=c.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=n.getEffectiveLocalBackend(),r=t?d.buildAuthHeaders(t):{},i={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(r).length>0&&(e.headers=r),i[t.name]=e}l.secrets=i}return l}var Q=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function $(e){if(p.isSubscriptionLlmConfig(j(e.llm))&&!(await m.default.getOpenAIStatus()).connected)throw Error(Q)}async function te(e){let{SecretsService:t}=await Promise.resolve().then(()=>require("./secrets-service.cjs")),[n,r]=await Promise.all([f.default.getSettingsForConversation(),t.getSecrets()]),{agentSettings:i,conversationSettings:a,secretsEncrypted:o}=n;return e.agentProfileId||await $(i),Z({...e,encryptedAgentSettings:i,encryptedConversationSettings:a,secretsEncrypted:o,customSecrets:r})}function ne(){return{hooks:[]}}exports.assertSubscriptionAuthReady=$,exports.buildStartConversationRequestWithEncryptedSettings=te,exports.emptyHooksResponse=ne,exports.getDefaultConversationTitle=w,exports.getDisplayConversationTags=O,exports.toAppConversation=T,exports.toConversationPage=ee;
4
+ `)}],run:!0}}function U(){return l.default.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null;return{name:e.name,content:e.content,trigger:t,source:`public`,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function W(e,t,n=[]){let r=C(t),i=M(e.agent_context),a=Array.isArray(i.skills)?i.skills:[],o=new Set(n),s=[...a,...U()].filter(e=>typeof e.name!=`string`||!o.has(e.name));return{...i,skills:s,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...r?{system_message_suffix:r}:{}}}function G(e){return M(e.agent_settings).agent_kind===`acp`}function K(e){let t=M(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function q(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=d.getAcpProvider(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function J(e,t){let n=M(e.agent_settings),r={agent_kind:`acp`,agent_context:W(n,t,e.disabled_skills)};for(let e of s.ACP_SETTINGS_KEYS){if(e===`acp_model`||e===`acp_env`)continue;let t=e===`acp_command`?q(n):n[e];t!=null&&(r[e]=t)}let i=M(n.mcp_config);Object.keys(i).length>0&&(r.mcp_config=i);let a=typeof n.acp_server==`string`?n.acp_server:void 0,o=d.resolveEffectiveAcpModel({configured:n.acp_model,providerDefault:d.getAcpPreferredDefaultModel(a)});return o&&(r.acp_model=o),r}function Y(e,t){let n=M(e.agent_settings),r=M(n.llm);r.model=typeof r.model==`string`&&r.model.trim().length>0?r.model:u.DEFAULT_SETTINGS.llm_model,r.stream=!0;let i=N(r.api_key);i?r.api_key=i:delete r.api_key;let a=N(r.base_url);a?r.base_url=a:delete r.base_url,m.isSubscriptionLlmConfig(r)?(r.auth_type=m.LLM_AUTH_TYPE_SUBSCRIPTION,r.subscription_vendor=m.OPENAI_SUBSCRIPTION_VENDOR,delete r.api_key,delete r.base_url):(delete r.auth_type,delete r.subscription_vendor);let o=M(n.mcp_config);Object.keys(o).length===0&&delete n.mcp_config,delete n.acp_server;for(let e of s.ACP_SETTINGS_KEYS)delete n[e];return delete n.acp_env,{...n,llm:r,agent_context:W(n,t,e.disabled_skills),tools:V(n)}}function X(e,t){return G(e)?J(e,t):Y(e,t)}function Z(e){let{settings:t,query:r,conversationInstructions:i,plugins:a,workingDir:o}=e,s=M(t.conversation_settings),c=H(r,i);return j.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??n.getAgentServerWorkingDir()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Q(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=G(t),i=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,a=X(t,e.runtimeServicesInfo),s=n?K(t):void 0,c=Z(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),l={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:a},workspace:c.workspace,client_tools:i===`openhands`?[g.CANVAS_UI_CLIENT_TOOL]:[],confirmation_policy:L(c),max_iterations:typeof c.max_iterations==`number`?c.max_iterations:500,stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&s&&(l.tags={[D]:s}),!e.agentProfileId&&e.secretsEncrypted&&(!n||I(a.mcp_config))&&(l.secrets_encrypted=!0),e.conversationId&&(l.conversation_id=e.conversationId);let u=R(c);u&&(l.security_analyzer=u),c.initial_message&&(l.initial_message=c.initial_message),c.plugins&&(l.plugins=c.plugins),c.hook_config&&(l.hook_config=c.hook_config);let d={...c.tool_module_qualnames??{}};if(delete d[o.LEGACY_CANVAS_UI_TOOL_NAME],delete d[o.CANVAS_UI_CLIENT_TOOL_NAME],Object.keys(d).length>0&&(l.tool_module_qualnames=d),c.agent_definitions&&(l.agent_definitions=c.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=r.getEffectiveLocalBackend(),n=t?f.buildAuthHeaders(t):{},i={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),i[t.name]=e}l.secrets=i}return l}var te=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function $(e){if(m.isSubscriptionLlmConfig(M(e.llm))&&!(await h.default.getOpenAIStatus()).connected)throw Error(te)}async function ne(e){let{SecretsService:t}=await Promise.resolve().then(()=>require("./secrets-service.cjs")),[n,r,i]=await Promise.all([p.default.getSettingsForConversation(),t.getSecrets(),S()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=n;return e.agentProfileId||await $(a),Q({...e,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:r,runtimeServicesInfo:i})}function re(){return{hooks:[]}}exports.assertSubscriptionAuthReady=$,exports.buildStartConversationRequestWithEncryptedSettings=ne,exports.emptyHooksResponse=re,exports.getDefaultConversationTitle=T,exports.getDisplayConversationTags=k,exports.toAppConversation=E,exports.toConversationPage=ee;
5
5
  //# sourceMappingURL=agent-server-adapter.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-server-adapter.cjs","names":[],"sources":["../../src/api/agent-server-adapter.ts"],"sourcesContent":["import { ACP_SETTINGS_KEYS } from \"@openhands/typescript-client\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { AgentKind, Settings, SettingsValue } from \"#/types/settings\";\nimport {\n getAcpPreferredDefaultModel,\n getAcpProvider,\n resolveEffectiveAcpModel,\n} from \"#/constants/acp-providers\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport { isAgentServerToolAvailable } from \"./agent-server-compatibility\";\nimport { getAgentServerWorkingDir } from \"./agent-server-config\";\nimport { getEffectiveLocalBackend } from \"./backend-registry/active-store\";\nimport { buildAuthHeaders } from \"./backend-registry/auth\";\nimport {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n SandboxStatus,\n} from \"./conversation-service/agent-server-conversation-service.types\";\nimport SettingsService from \"./settings-service/settings-service.api\";\nimport { getStoredConversationMetadata } from \"./conversation-metadata-store\";\nimport LLMSubscriptionService from \"./llm-subscription-service\";\nimport {\n LLM_AUTH_TYPE_SUBSCRIPTION,\n OPENAI_SUBSCRIPTION_VENDOR,\n isSubscriptionLlmConfig,\n} from \"#/constants/llm-subscription\";\nimport {\n CANVAS_UI_CLIENT_TOOL,\n CANVAS_UI_CLIENT_TOOL_NAME,\n LEGACY_CANVAS_UI_TOOL_NAME,\n type ClientToolSpec,\n} from \"./canvas-ui-client-tool\";\n\nexport interface DirectConversationInfo {\n id: string;\n title?: string | null;\n created_at: string;\n updated_at: string;\n execution_status?: string | null;\n /** Cloud-only sandbox lifecycle state. Omitted / null for local agent-server conversations. */\n sandbox_status?: string | null;\n metrics?: {\n accumulated_cost?: number | null;\n max_budget_per_task?: number | null;\n accumulated_token_usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n cache_read_tokens?: number;\n cache_write_tokens?: number;\n context_window?: number;\n per_turn_token?: number;\n } | null;\n } | null;\n agent?: {\n /**\n * Pydantic discriminator from the SDK union: ``\"ACPAgent\"`` for ACP CLI\n * subprocesses (model lives on the subprocess via ``acp_model``),\n * ``\"Agent\"`` for direct litellm. Read by {@link toAppConversation}.\n */\n kind?: string | null;\n acp_model?: string | null;\n /**\n * ACP CLI identity (``claude-code`` / ``codex`` / ``gemini-cli``) from the\n * SDK's ``ACPAgent.acp_server`` (#3692). Preferred fallback when the\n * ``acpserver`` tag is absent — e.g. a profile launch doesn't stamp the tag\n * client-side and the server may not repopulate it. Read by {@link toAppConversation}.\n */\n acp_server?: string | null;\n llm?: {\n model?: string | null;\n } | null;\n } | null;\n current_model_id?: string | null;\n current_model_name?: string | null;\n workspace?: {\n working_dir?: string | null;\n } | null;\n /**\n * Arbitrary string-keyed conversation tags surfaced by the agent-server\n * (see ``ConversationInfo.tags``). Canvas only consumes one key today —\n * ``ACP_SERVER_TAG_KEY`` (\"acpserver\") — but the field is typed as a\n * generic record so future readers don't need another wire-shape change.\n * Keys are constrained to ``^[a-z0-9]+$`` by the agent-server validator;\n * values are opaque strings.\n */\n tags?: Record<string, string> | null;\n launched_agent_profile?: {\n agent_profile_id: string;\n revision: number;\n } | null;\n}\n\nconst DEFAULT_TOOL_NAMES = [\"terminal\", \"file_editor\", \"task_tracker\"];\nconst BROWSER_TOOL_SET_NAME = \"browser_tool_set\";\nconst TASK_TOOL_SET_NAME = \"task_tool_set\";\n\nfunction browserToolsEnabled() {\n return import.meta.env.VITE_ENABLE_BROWSER_TOOLS !== \"false\";\n}\n\n/**\n * Shape of the runtime services info (set by the dev launchers in\n * scripts/dev-*.mjs as `VITE_RUNTIME_SERVICES_INFO`, or injected at serve time\n * by `scripts/static-server.mjs` for static builds — see\n * `getRawRuntimeServicesInfo`). All URLs are written from the agent's point of\n * view, not the browser's. The block is rendered into the agent's system prompt\n * via `AgentContext.system_message_suffix` so the agent knows what's\n * reachable from inside its sandbox without having to probe.\n */\ninterface RuntimeServicesInfo {\n mode?: string;\n agent_host_alias?: string;\n services?: {\n agent_server?: { description?: string; url_from_agent?: string };\n ingress?: { description?: string; url_from_agent?: string };\n frontend?: {\n kind?: \"vite\" | \"static\";\n description?: string;\n url_from_agent?: string;\n };\n // `vite` is the legacy key name for the frontend entry, accepted for\n // one release while older dev-stack launchers may still emit it.\n vite?: { description?: string; url_from_agent?: string };\n automation?: {\n description?: string;\n url_from_agent?: string;\n api_prefix?: string;\n docs_url?: string;\n openapi_url?: string;\n auth_env_var?: string;\n };\n };\n}\n\n/**\n * Return the raw runtime-services JSON string, consulting two sources in order\n * (mirrors `getBakedSessionApiKey` in agent-server-config.ts):\n * 1. `VITE_RUNTIME_SERVICES_INFO` — baked into the bundle at build time by\n * the dev launchers (`npm run dev`, dev:static).\n * 2. `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__` — injected into\n * index.html at serve time by `scripts/static-server.mjs\n * --runtime-services-info <json>`. This is the path used by static builds\n * (the Docker image and the published binary), where the env var is empty\n * in the prebuilt bundle. Without it the `<RUNTIME_SERVICES>` block is\n * missing and the agent cannot reach the local automation backend.\n */\nfunction getRawRuntimeServicesInfo(): string | null {\n const envRaw = import.meta.env.VITE_RUNTIME_SERVICES_INFO?.trim();\n if (envRaw) return envRaw;\n\n if (typeof window !== \"undefined\") {\n const injected = (window as unknown as Record<string, unknown>)\n .__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;\n if (typeof injected === \"string\") {\n return injected.trim() || null;\n }\n }\n\n return null;\n}\n\nfunction parseRuntimeServicesInfo(): RuntimeServicesInfo | null {\n const raw = getRawRuntimeServicesInfo();\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw) as RuntimeServicesInfo;\n if (!parsed || typeof parsed !== \"object\") return null;\n return parsed;\n } catch {\n // Malformed JSON: ignore and fall back to no runtime info, rather than\n // tearing down conversation creation over a misconfigured env var or\n // injected value.\n return null;\n }\n}\n\n/**\n * Return the deployment mode from the runtime services info, e.g. \"docker\",\n * \"dev:automation\", etc. Returns `null` when no runtime info is configured.\n */\nexport function getDeploymentMode(): string | null {\n return parseRuntimeServicesInfo()?.mode ?? null;\n}\n\n/**\n * Render the runtime services info into a markdown block suitable for\n * appending to the system prompt via `AgentContext.system_message_suffix`.\n *\n * Returns `undefined` when no runtime info is configured, so callers can\n * safely omit the field on production builds (where the launcher doesn't\n * set `VITE_RUNTIME_SERVICES_INFO`).\n */\nexport function buildRuntimeServicesSystemSuffix(): string | undefined {\n const info = parseRuntimeServicesInfo();\n if (!info?.services) return undefined;\n\n const lines: string[] = [];\n lines.push(\"<RUNTIME_SERVICES>\");\n if (info.mode) {\n lines.push(\n `You are running inside an agent-canvas dev stack started in '${info.mode}' mode.`,\n );\n } else {\n lines.push(\"You are running inside an agent-canvas dev stack.\");\n }\n lines.push(\n \"The following services are reachable from your sandbox. URLs are written\",\n \"from your point of view (i.e., as you should curl/fetch them).\",\n \"\",\n );\n\n const { agent_server, ingress, automation } = info.services;\n const { frontend } = info.services;\n\n if (agent_server?.url_from_agent) {\n lines.push(\n `* Agent Server (you): ${agent_server.url_from_agent}`,\n ` ${agent_server.description ?? \"The agent-server hosting your tool calls.\"}`,\n );\n }\n if (ingress?.url_from_agent) {\n lines.push(\n `* Ingress: ${ingress.url_from_agent}`,\n ` ${ingress.description ?? \"Unified entry point for browser-facing traffic.\"}`,\n );\n }\n if (frontend?.url_from_agent) {\n lines.push(\n `* Frontend: ${frontend.url_from_agent}`,\n ` ${frontend.description ?? \"Frontend dev server.\"}`,\n );\n }\n if (automation?.url_from_agent) {\n lines.push(\n `* Automation backend: ${automation.url_from_agent}`,\n ` ${automation.description ?? \"OpenHands Automations service.\"}`,\n );\n if (automation.docs_url) {\n lines.push(` Docs: ${automation.docs_url}`);\n }\n if (automation.openapi_url) {\n lines.push(` OpenAPI: ${automation.openapi_url}`);\n }\n if (automation.auth_env_var) {\n // X-Session-API-Key is the local convention shared by the agent-server\n // and automation backend (see openhands-automation auth.py).\n lines.push(\n ` Auth: header 'X-Session-API-Key: $${automation.auth_env_var}'`,\n );\n }\n } else {\n lines.push(\n \"* Automation backend: not running in this dev mode (skip /api/automation calls).\",\n );\n }\n\n // Anchor the \"don't guess\" warning to the actual agent-server URL for\n // this stack instead of a hardcoded port. The agent-server listens on\n // different ports across dev modes, and baking the wrong port into the\n // system prompt is exactly the kind of confusion this block is meant to\n // prevent.\n const agentServerUrl = agent_server?.url_from_agent;\n lines.push(\n \"\",\n \"Trust this block over guessing: do not assume any other URLs are running.\",\n );\n if (agentServerUrl) {\n lines.push(\n `In particular, ${agentServerUrl} inside your sandbox is the Agent Server`,\n \"you are running inside of — NOT the automation backend.\",\n );\n }\n lines.push(\"</RUNTIME_SERVICES>\");\n\n return lines.join(\"\\n\");\n}\n\nexport function toConversationUrl(conversationId: string): string {\n // Local-format conversation URL — points at whichever local agent-server\n // is actually serving the conversation (the bundled one when the active\n // selection is cloud).\n const { host } = getAgentServerClientOptions();\n return `${host}/api/conversations/${conversationId}`;\n}\n\n// TODO(i18n): extract \"Conversation\" once we add CONVERSATION$DEFAULT_TITLE\n// with `{{shortId}}` interpolation. Kept as a literal for now to keep the\n// fallback inside this pure adapter rather than fanning out to display sites.\nexport function getDefaultConversationTitle(conversationId: string): string {\n return `Conversation ${conversationId.slice(0, 5)}`;\n}\n\nexport function toAppConversation(\n info: DirectConversationInfo,\n): AppConversation {\n const metadata = getStoredConversationMetadata(info.id);\n // ACPAgent conversations carry a sentinel ``llm`` on older SDKs. Prefer the\n // runtime model fields when available, then the configured ``acp_model`` that\n // Canvas saves for built-in providers. ``agent_kind`` still gates model\n // switching, so surfacing this string is display-only.\n const isAcp = info.agent?.kind === \"ACPAgent\";\n // Only surface ``acp_server`` for ACP conversations even if the wire\n // payload accidentally carries an ``acpserver`` tag on an OpenHands\n // conversation — the chip is identity info for the ACP CLI subprocess,\n // and showing it on a non-ACP conversation would be a lie. Fall back to the\n // agent's own ``acp_server`` (#3692) when the tag is missing — a profile\n // launch doesn't stamp the tag, so tag-only reads would drop the ACP model\n // picker and degrade the chip to a generic \"ACP\" (#1571).\n const acpServer = isAcp\n ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? info.agent?.acp_server ?? null)\n : null;\n return {\n id: info.id,\n created_by_user_id: null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: metadata?.selected_workspace ?? null,\n active_profile: metadata?.active_profile ?? null,\n title: info.title?.trim()\n ? info.title\n : getDefaultConversationTitle(info.id),\n trigger: null,\n pr_number: [],\n agent_kind: isAcp ? \"acp\" : \"openhands\",\n acp_server: acpServer,\n tags: info.tags ?? null,\n launched_agent_profile: info.launched_agent_profile ?? null,\n // Chip path: omit ``providerDefault`` so that when no concrete model\n // resolves, the chip falls back to the provider display name in\n // ConversationCardFooter rather than a registry default the session may\n // not actually be running.\n llm_model: isAcp\n ? resolveEffectiveAcpModel({\n runtimeName: info.current_model_name,\n runtimeId: info.current_model_id,\n configured: info.agent?.acp_model,\n sdkLlm: info.agent?.llm?.model,\n })\n : (info.agent?.llm?.model ?? DEFAULT_SETTINGS.llm_model),\n metrics: info.metrics\n ? {\n accumulated_cost: info.metrics.accumulated_cost ?? null,\n max_budget_per_task: info.metrics.max_budget_per_task ?? null,\n accumulated_token_usage: info.metrics.accumulated_token_usage\n ? {\n prompt_tokens:\n info.metrics.accumulated_token_usage.prompt_tokens ?? 0,\n completion_tokens:\n info.metrics.accumulated_token_usage.completion_tokens ?? 0,\n cache_read_tokens:\n info.metrics.accumulated_token_usage.cache_read_tokens ?? 0,\n cache_write_tokens:\n info.metrics.accumulated_token_usage.cache_write_tokens ?? 0,\n context_window:\n info.metrics.accumulated_token_usage.context_window ?? 0,\n per_turn_token:\n info.metrics.accumulated_token_usage.per_turn_token ?? 0,\n }\n : null,\n }\n : null,\n created_at: info.created_at,\n updated_at: info.updated_at,\n execution_status:\n (info.execution_status as AppConversation[\"execution_status\"]) ??\n ExecutionStatus.IDLE,\n sandbox_status: (info.sandbox_status as SandboxStatus | null) ?? null,\n conversation_url: toConversationUrl(info.id),\n session_api_key: getAgentServerClientOptions().apiKey ?? null,\n sandbox_id: null,\n workspace: {\n working_dir: info.workspace?.working_dir ?? getAgentServerWorkingDir(),\n },\n public: false,\n sub_conversation_ids: [],\n };\n}\n\nexport function toConversationPage(data: {\n items: DirectConversationInfo[];\n next_page_id?: string | null;\n}): AppConversationPage {\n return {\n items: data.items.map(toAppConversation),\n next_page_id: data.next_page_id ?? null,\n };\n}\n\ntype SettingsRecord = Record<string, unknown>;\n\ninterface AgentToolSpec {\n name: string;\n params: SettingsRecord;\n}\n\ntype AgentSettingsPayload = SettingsRecord & {\n llm?: SettingsRecord;\n agent_context: SettingsRecord;\n tools?: AgentToolSpec[];\n};\n\ninterface LocalWorkspacePayload {\n kind: \"LocalWorkspace\";\n working_dir: string;\n}\n\ninterface InitialMessagePayload {\n role: \"user\";\n content: Array<{ type: \"text\"; text: string }>;\n run: true;\n}\n\ntype ConversationSettingsPayload = SettingsRecord & {\n workspace: LocalWorkspacePayload;\n initial_message?: InitialMessagePayload;\n};\n\nexport const ACP_SERVER_TAG_KEY = \"acpserver\";\n\n/**\n * Conversation tag keys Canvas itself stamps/consumes for internal routing.\n * They are already surfaced through dedicated UI (the ACP provider chip), so\n * the generic tag-chip display filters them out.\n */\nexport const RESERVED_CONVERSATION_TAG_KEYS: ReadonlySet<string> = new Set([\n ACP_SERVER_TAG_KEY,\n]);\n\n/**\n * User-facing subset of a conversation's server-side tags: everything except\n * {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries\n * sorted by key so chip order doesn't shuffle between refetches.\n */\nexport function getDisplayConversationTags(\n tags: Record<string, string> | null | undefined,\n): Array<[string, string]> {\n if (!tags) {\n return [];\n }\n return Object.entries(tags)\n .filter(([key]) => !RESERVED_CONVERSATION_TAG_KEYS.has(key))\n .sort(([a], [b]) => a.localeCompare(b));\n}\n\nconst FERNET_TOKEN_PREFIX = \"gAAAAA\";\n\nconst CONVERSATION_SETTINGS_METADATA_KEYS = new Set([\n \"schema_version\",\n \"agent_settings\",\n \"workspace\",\n \"conversation_id\",\n \"initial_message\",\n \"plugins\",\n]);\n\nfunction toRecord(value: unknown): SettingsRecord {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return {};\n }\n\n return structuredClone(value as SettingsRecord);\n}\n\nfunction normalizeSecretString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction hasEncryptedString(value: unknown): boolean {\n if (typeof value === \"string\") {\n return value.startsWith(FERNET_TOKEN_PREFIX);\n }\n if (Array.isArray(value)) {\n return value.some(hasEncryptedString);\n }\n if (isPlainRecord(value)) {\n return Object.values(value).some(hasEncryptedString);\n }\n return false;\n}\n\nfunction hasEncryptedMcpSecrets(mcpConfig: unknown): boolean {\n if (!isPlainRecord(mcpConfig)) {\n return false;\n }\n\n return Object.values(mcpConfig).some(hasEncryptedString);\n}\n\nfunction getConversationConfirmationPolicy(\n conversationSettings: SettingsRecord,\n) {\n if (conversationSettings.confirmation_mode !== true) {\n return { kind: \"NeverConfirm\" };\n }\n\n if (conversationSettings.security_analyzer === \"llm\") {\n return { kind: \"ConfirmRisky\", threshold: \"HIGH\", confirm_unknown: true };\n }\n\n return { kind: \"AlwaysConfirm\" };\n}\n\nfunction getConversationSecurityAnalyzer(conversationSettings: SettingsRecord) {\n switch (conversationSettings.security_analyzer) {\n case \"llm\":\n return { kind: \"LLMSecurityAnalyzer\" };\n case \"pattern\":\n return { kind: \"PatternSecurityAnalyzer\" };\n case \"policy_rail\":\n return { kind: \"PolicyRailSecurityAnalyzer\" };\n default:\n return undefined;\n }\n}\n\nfunction isToolRecord(\n value: unknown,\n): value is { name: string; params?: unknown } {\n return (\n !!value &&\n typeof value === \"object\" &&\n !Array.isArray(value) &&\n typeof (value as { name?: unknown }).name === \"string\"\n );\n}\n\nfunction shouldIncludeTool(name: string, agentSettings: SettingsRecord) {\n if (name === BROWSER_TOOL_SET_NAME) {\n return browserToolsEnabled() && isAgentServerToolAvailable(name);\n }\n\n if (name === TASK_TOOL_SET_NAME) {\n return (\n agentSettings.enable_sub_agents === true &&\n isAgentServerToolAvailable(name)\n );\n }\n\n return true;\n}\n\nfunction getAgentTools(agentSettings: SettingsRecord): AgentToolSpec[] {\n const tools = new Map<string, AgentToolSpec>();\n\n for (const name of DEFAULT_TOOL_NAMES) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n for (const name of [BROWSER_TOOL_SET_NAME, TASK_TOOL_SET_NAME]) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n const configuredTools = agentSettings.tools;\n if (\n Array.isArray(configuredTools) &&\n configuredTools.every((tool) => isToolRecord(tool))\n ) {\n for (const tool of configuredTools) {\n if (shouldIncludeTool(tool.name, agentSettings)) {\n tools.set(tool.name, {\n name: tool.name,\n params: toRecord(tool.params),\n });\n }\n }\n }\n\n return Array.from(tools.values());\n}\n\nfunction buildInitialMessage(\n query?: string,\n conversationInstructions?: string,\n): InitialMessagePayload | null {\n const parts = [query?.trim(), conversationInstructions?.trim()].filter(\n Boolean,\n );\n if (parts.length === 0) {\n return null;\n }\n\n return {\n role: \"user\",\n content: [{ type: \"text\", text: parts.join(\"\\n\\n\") }],\n run: true,\n };\n}\n\n/**\n * Shape of a bundled skill entry passed to the agent-server SDK via\n * `agent_context.skills`. Mirrors the SDK's `Skill` model fields that\n * the server uses for trigger matching, activation, and system-prompt\n * injection.\n */\ninterface BundledSkill {\n name: string;\n content: string;\n trigger: { type: \"keyword\"; keywords: string[] } | null;\n source: string;\n description: string | null;\n is_agentskills_format: true;\n license?: string;\n compatibility?: string;\n}\n\n/**\n * Convert the bundled `SKILLS_CATALOG` entries into the SDK `Skill` JSON\n * shape so the agent-server can perform trigger matching, skill activation,\n * and system-prompt injection without cloning the extensions repo.\n *\n * The SDK discriminates triggers via `{ type: \"keyword\", keywords: [...] }`.\n * Skills with no triggers get `trigger: null` (always-active / on-demand).\n */\nfunction buildBundledSkills(): BundledSkill[] {\n return SKILLS_CATALOG.map((entry) => {\n const trigger: BundledSkill[\"trigger\"] =\n entry.triggers?.length > 0\n ? { type: \"keyword\", keywords: entry.triggers }\n : null;\n\n // Use the absolute path to the skill's SKILL.md so the Python\n // agent-server can resolve bundled resources (scripts/, references/).\n // Falls back to \"public\" in library builds where the path isn't known.\n const source = __EXTENSIONS_SKILLS_DIR__\n ? `${__EXTENSIONS_SKILLS_DIR__}/${entry.name}/SKILL.md`\n : \"public\";\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source,\n description: entry.description ?? null,\n is_agentskills_format: true as const,\n ...(entry.license ? { license: entry.license } : {}),\n ...(entry.compatibility ? { compatibility: entry.compatibility } : {}),\n };\n });\n}\n\nfunction buildAgentContext(agentSettings: SettingsRecord): SettingsRecord {\n const runtimeServicesSuffix = buildRuntimeServicesSystemSuffix();\n const existingContext = toRecord(agentSettings.agent_context);\n\n // Merge bundled public skills with any skills already present in the\n // agent context (e.g. user-defined skills set via the settings API).\n const existingSkills = Array.isArray(existingContext.skills)\n ? (existingContext.skills as SettingsRecord[])\n : [];\n const mergedSkills = [...existingSkills, ...buildBundledSkills()];\n\n return {\n ...existingContext,\n // Public skills are bundled at build time from the @openhands/extensions\n // npm package and passed directly in agent_context.skills. Setting\n // load_public_skills to false tells the agent-server SDK to skip its own\n // extensions-repo clone — the frontend is the sole source of public\n // skills now.\n //\n // Migration: the former VITE_LOAD_PUBLIC_SKILLS env var was removed\n // because bundled skills have no clone latency. Users who previously set\n // VITE_LOAD_PUBLIC_SKILLS=false to avoid clone delays no longer need it.\n skills: mergedSkills,\n load_public_skills: false,\n load_user_skills: true,\n load_project_skills: true,\n ...(runtimeServicesSuffix\n ? { system_message_suffix: runtimeServicesSuffix }\n : {}),\n };\n}\n\nfunction isAcpAgent(settings: Settings): boolean {\n const agentSettings = toRecord(settings.agent_settings);\n return agentSettings.agent_kind === \"acp\";\n}\n\nfunction getAcpServerTag(settings: Settings): string | undefined {\n const agentSettings = toRecord(settings.agent_settings);\n const value = agentSettings.acp_server;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction resolveAcpCommand(agentSettings: SettingsRecord): unknown {\n const cmd = agentSettings.acp_command;\n const isEmpty = Array.isArray(cmd) && cmd.length === 0;\n const noCommand = cmd === undefined;\n if (!isEmpty && !noCommand) {\n return cmd;\n }\n\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const provider = getAcpProvider(serverKey);\n return provider ? [...provider.default_command] : cmd;\n}\n\nfunction buildConfiguredAcpAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(agentSettings),\n };\n\n // TODO(#1019): set ``acp_isolate_data_dir: true`` here for a containerized\n // backend so concurrent same-provider conversations don't race on a shared\n // HOME. The SDK supports it (software-agent-sdk#3492), but the released\n // ``@openhands/typescript-client`` (1.24.3) doesn't surface it on\n // ``ACPAgentSettings`` yet, so sending it risks a validation error on older\n // servers. Cloud grouping isolation is separate (agent-canvas#1016).\n\n for (const key of ACP_SETTINGS_KEYS) {\n // ``acp_model`` is resolved separately below so a saved ``null`` still\n // falls back to the provider's default rather than being dropped.\n if (key === \"acp_model\") continue;\n // ``acp_env`` is deprecated — provider creds now route via ``request.secrets``.\n if (key === \"acp_env\") continue;\n const value =\n key === \"acp_command\"\n ? resolveAcpCommand(agentSettings)\n : agentSettings[key];\n if (value !== undefined && value !== null) {\n payload[key] = value;\n }\n }\n\n // ``mcp_config`` is a shared field (not in ACP_SETTINGS_KEYS): forward it\n // so the ACP subprocess connects to the configured MCP servers at session\n // creation. Only include it when it actually carries servers — an empty or\n // malformed value is dropped rather than sending ``mcp_config: {}``.\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length > 0) {\n payload.mcp_config = mcpConfig;\n }\n\n // Saved settings may carry ``acp_model: null`` (existing users predating\n // the default-model registry, or saved fields the agent-server stripped).\n // Fall back to the *preferred* default (Vertex-safe for Gemini) so the\n // conversation starts with whatever the Settings → Agent UI shows — without\n // that, the form's displayed default would silently not take effect at\n // runtime until the user re-saved the page.\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const effectiveModel = resolveEffectiveAcpModel({\n configured: agentSettings.acp_model as string | null | undefined,\n providerDefault: getAcpPreferredDefaultModel(serverKey),\n });\n if (effectiveModel) {\n payload.acp_model = effectiveModel;\n }\n\n return payload;\n}\n\nfunction buildConfiguredOpenHandsAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const llm = toRecord(agentSettings.llm);\n\n llm.model =\n typeof llm.model === \"string\" && llm.model.trim().length > 0\n ? llm.model\n : DEFAULT_SETTINGS.llm_model;\n\n // Stream assistant tokens (parity with ACP agents). The agent-server only\n // emits StreamingDeltaEvents for SDK LLM agents when an LLM has stream=True.\n llm.stream = true;\n\n const apiKey = normalizeSecretString(llm.api_key);\n if (apiKey) {\n llm.api_key = apiKey;\n } else {\n delete llm.api_key;\n }\n\n const baseUrl = normalizeSecretString(llm.base_url);\n if (baseUrl) {\n llm.base_url = baseUrl;\n } else {\n delete llm.base_url;\n }\n\n if (isSubscriptionLlmConfig(llm)) {\n llm.auth_type = LLM_AUTH_TYPE_SUBSCRIPTION;\n llm.subscription_vendor = OPENAI_SUBSCRIPTION_VENDOR;\n delete llm.api_key;\n delete llm.base_url;\n } else {\n delete llm.auth_type;\n delete llm.subscription_vendor;\n }\n\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length === 0) {\n delete agentSettings.mcp_config;\n }\n\n delete agentSettings.acp_server;\n for (const key of ACP_SETTINGS_KEYS) {\n delete agentSettings[key];\n }\n // ``acp_env`` is no longer a forwarded ACP setting (provider creds ride the\n // Secrets panel), but a legacy value may linger on persisted settings —\n // scrub it so it never leaks onto the OpenHands payload.\n delete agentSettings.acp_env;\n\n return {\n ...agentSettings,\n llm,\n agent_context: buildAgentContext(agentSettings),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings)\n : buildConfiguredOpenHandsAgentSettings(settings);\n}\n\nfunction buildConfiguredConversationSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n workingDir?: string;\n}): ConversationSettingsPayload {\n const { settings, query, conversationInstructions, plugins, workingDir } =\n options;\n const conversationSettings = toRecord(settings.conversation_settings);\n const initialMessage = buildInitialMessage(query, conversationInstructions);\n\n CONVERSATION_SETTINGS_METADATA_KEYS.forEach(\n (key) => delete conversationSettings[key],\n );\n\n const payload: ConversationSettingsPayload = {\n ...conversationSettings,\n workspace: {\n kind: \"LocalWorkspace\",\n working_dir: workingDir ?? getAgentServerWorkingDir(),\n },\n ...(initialMessage ? { initial_message: initialMessage } : {}),\n ...(plugins?.length\n ? {\n plugins: plugins.map((plugin) => ({\n source: plugin.source,\n ...(plugin.ref ? { ref: plugin.ref } : {}),\n ...(plugin.repo_path ? { repo_path: plugin.repo_path } : {}),\n })),\n }\n : {}),\n };\n\n return payload;\n}\n\ninterface LookupSecret {\n kind: \"LookupSecret\";\n url: string;\n headers?: Record<string, string>;\n description?: string;\n}\n\ntype StartConversationPayload = Record<string, unknown> & {\n // Omitted when launching via ``agent_profile_id`` — the two are mutually\n // exclusive agent sources; the server resolves the profile server-side.\n agent_settings?: AgentSettingsPayload;\n agent_profile_id?: string;\n workspace: LocalWorkspacePayload;\n confirmation_policy: SettingsRecord;\n security_analyzer?: SettingsRecord;\n initial_message?: InitialMessagePayload;\n max_iterations: number;\n stuck_detection: true;\n autotitle: true;\n title_llm_profile?: string;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n client_tools: ClientToolSpec[];\n tool_module_qualnames?: Record<string, string>;\n};\n\nexport interface StartConversationOptions {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n encryptedAgentSettings?: Record<string, SettingsValue>;\n encryptedConversationSettings?: Record<string, SettingsValue>;\n secretsEncrypted?: boolean;\n customSecrets?: Array<{ name: string; description?: string }>;\n // When set, the conversation launches from this AgentProfile (resolved\n // server-side) instead of an inline ``agent_settings`` dump (#3727).\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n}\n\nexport function buildStartConversationRequest(\n options: StartConversationOptions,\n): StartConversationPayload {\n const sourceAgentSettings = options.encryptedAgentSettings\n ? { ...options.settings, agent_settings: options.encryptedAgentSettings }\n : options.settings;\n\n const acpMode = isAcpAgent(sourceAgentSettings);\n const launchAgentKind = options.agentProfileId\n ? options.agentProfileKind\n : acpMode\n ? \"acp\"\n : \"openhands\";\n const agentSettings = buildConfiguredAgentSettings(sourceAgentSettings);\n const acpServerTag = acpMode\n ? getAcpServerTag(sourceAgentSettings)\n : undefined;\n\n const sourceConversationOptions = options.encryptedConversationSettings\n ? {\n ...options,\n settings: {\n ...options.settings,\n conversation_settings: options.encryptedConversationSettings,\n },\n }\n : options;\n\n const conversationSettings = buildConfiguredConversationSettings(\n sourceConversationOptions,\n );\n\n const payload: StartConversationPayload = {\n // ``agent_profile_id`` and ``agent_settings`` are mutually exclusive agent\n // sources; the profile path lets the server resolve the profile (#3727).\n //\n // Enrichment boundary: on the profile path the server rebuilds the agent\n // purely from the stored profile fields, so the client-owned enrichments\n // this adapter folds into ``agent_settings`` do NOT apply. The exec toolset\n // (terminal/file_editor/task_tracker) and public-skill loading are the\n // server/SDK's responsibility to restore on the profile path — tracked in\n // software-agent-sdk#3967 (profile resolution must attach the default\n // toolset + public skills, else a profile-launched OpenHands agent has only\n // Finish/Think). The dev ``RUNTIME_SERVICES`` system-message suffix remains\n // agent-settings-only; the Canvas UI tool is a top-level client tool and\n // therefore works on both inline-agent and profile launch paths.\n //\n // Persistent memory is NOT on that boundary: ``load_memory`` is a global\n // user preference, so the agent-server stamps the stored\n // ``agent_settings.agent_context.load_memory`` onto the profile-resolved\n // agent the same way it already applies the global ``mcp_config``. The\n // toggle therefore applies to both launch paths, and the client must not\n // re-send it here (``agent_profile_id`` and ``agent_settings`` are\n // mutually exclusive).\n ...(options.agentProfileId\n ? { agent_profile_id: options.agentProfileId }\n : { agent_settings: agentSettings }),\n workspace: conversationSettings.workspace,\n client_tools:\n launchAgentKind === \"openhands\" ? [CANVAS_UI_CLIENT_TOOL] : [],\n confirmation_policy:\n getConversationConfirmationPolicy(conversationSettings),\n max_iterations:\n typeof conversationSettings.max_iterations === \"number\"\n ? conversationSettings.max_iterations\n : 500,\n stuck_detection: true,\n autotitle: true,\n ...(options.titleLlmProfile\n ? { title_llm_profile: options.titleLlmProfile }\n : {}),\n worktree: options.worktree ?? true,\n };\n\n // A profile launch resolves the ACP server server-side, so don't stamp the\n // tag from current settings (it may not match the launched profile).\n if (!options.agentProfileId && acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server decrypt request secrets at\n // conversation start. Non-ACP conversations need it for encrypted LLM keys.\n // ACP normally carries provider credentials as LookupSecrets, so avoid\n // forcing a cipher on fresh ACP-only backends. The exception is MCP:\n // encrypted settings round-trip mcp_config secrets as Fernet tokens,\n // and ACP forwards mcp_config directly to the subprocess.\n if (\n !options.agentProfileId &&\n options.secretsEncrypted &&\n (!acpMode || hasEncryptedMcpSecrets(agentSettings.mcp_config))\n ) {\n payload.secrets_encrypted = true;\n }\n\n if (options.conversationId) {\n payload.conversation_id = options.conversationId;\n }\n\n const securityAnalyzer =\n getConversationSecurityAnalyzer(conversationSettings);\n if (securityAnalyzer) {\n payload.security_analyzer = securityAnalyzer;\n }\n\n if (conversationSettings.initial_message) {\n payload.initial_message = conversationSettings.initial_message;\n }\n\n if (conversationSettings.plugins) {\n payload.plugins = conversationSettings.plugins;\n }\n\n if (conversationSettings.hook_config) {\n payload.hook_config = conversationSettings.hook_config;\n }\n\n const toolModuleQualnames = {\n ...((conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {}),\n };\n delete toolModuleQualnames[LEGACY_CANVAS_UI_TOOL_NAME];\n delete toolModuleQualnames[CANVAS_UI_CLIENT_TOOL_NAME];\n if (Object.keys(toolModuleQualnames).length > 0) {\n payload.tool_module_qualnames = toolModuleQualnames;\n }\n\n if (conversationSettings.agent_definitions) {\n payload.agent_definitions = conversationSettings.agent_definitions;\n }\n\n // Every saved secret rides as a LookupSecret the agent-server resolves back\n // from its own store at spawn time — ``request.secrets`` is the sole channel,\n // uniform for ACP and non-ACP (agent-canvas#1039). For ACP the resolution\n // runs off the event loop (software-agent-sdk#3510, >=1.25.0), so the loopback\n // fetch can't deadlock.\n if (options.customSecrets && options.customSecrets.length > 0) {\n const backend = getEffectiveLocalBackend();\n const headers = backend ? buildAuthHeaders(backend) : {};\n\n const secrets: Record<string, LookupSecret> = {};\n for (const secret of options.customSecrets) {\n const lookupSecret: LookupSecret = {\n kind: \"LookupSecret\",\n url: `/api/settings/secrets/${encodeURIComponent(secret.name)}`,\n description: secret.description,\n };\n\n if (Object.keys(headers).length > 0) {\n lookupSecret.headers = headers;\n }\n\n secrets[secret.name] = lookupSecret;\n }\n\n payload.secrets = secrets;\n }\n\n return payload;\n}\n\nexport const SUBSCRIPTION_LOGIN_REQUIRED_ERROR =\n \"Connect your ChatGPT subscription before starting a conversation with this LLM profile.\";\n\n/**\n * Throws if a ChatGPT subscription LLM profile is not connected.\n * Called before conversation creation and LLM profile switch only — not on\n * subsequent message sends or conversation resume. The agent-server must handle\n * mid-conversation token expiry gracefully.\n */\nexport async function assertSubscriptionAuthReady(\n agentSettings: Record<string, unknown>,\n): Promise<void> {\n const llm = toRecord(agentSettings.llm);\n if (!isSubscriptionLlmConfig(llm)) return;\n\n const status = await LLMSubscriptionService.getOpenAIStatus();\n if (!status.connected) {\n throw new Error(SUBSCRIPTION_LOGIN_REQUIRED_ERROR);\n }\n}\n\nexport async function buildStartConversationRequestWithEncryptedSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets] = await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n // A profile launch resolves the LLM server-side, so the current-settings\n // subscription check doesn't apply (and can't see the profile's LLM).\n if (!options.agentProfileId) {\n await assertSubscriptionAuthReady(agentSettings);\n }\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"84BAgGA,IAAM,EAAqB,CAAC,WAAY,cAAe,cAAc,EAC/D,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,EACT,CAgDA,SAAS,GAA2C,CAIlD,GAAI,OAAO,OAAW,IAAa,CACjC,IAAM,EAAY,OACf,uCACH,GAAI,OAAO,GAAa,SACtB,OAAO,EAAS,KAAK,GAAK,IAE9B,CAEA,OAAO,IACT,CAEA,SAAS,GAAuD,CAC9D,IAAM,EAAM,EAA0B,EACtC,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACF,IAAM,EAAS,KAAK,MAAM,CAAG,EAE7B,MADI,CAAC,GAAU,OAAO,GAAW,SAAiB,KAC3C,CACT,MAAQ,CAIN,OAAO,IACT,CACF,CAkBA,SAAgB,GAAuD,CACrE,IAAM,EAAO,EAAyB,EACtC,GAAI,CAAC,GAAM,SAAU,OAErB,IAAM,EAAkB,CAAC,EACzB,EAAM,KAAK,oBAAoB,EAC3B,EAAK,KACP,EAAM,KACJ,gEAAgE,EAAK,KAAK,QAC5E,EAEA,EAAM,K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B,CACjC,KAAM,eACN,IAAK,yBAAyB,mBAAmB,EAAO,IAAI,IAC5D,YAAa,EAAO,WACtB,EAEI,OAAO,KAAK,CAAO,EAAE,OAAS,IAChC,EAAa,QAAU,GAGzB,EAAQ,EAAO,MAAQ,CACzB,CAEA,EAAQ,QAAU,CACpB,CAEA,OAAO,CACT,CAEA,IAAa,EACX,0FAQF,eAAsB,EACpB,EACe,CAEV,KAAA,wBADO,EAAS,EAAc,GACN,CAAG,GAG5B,EAAC,MADgB,EAAA,QAAuB,gBAAgB,GAChD,UACV,MAAU,MAAM,CAAiC,CAErD,CAEA,eAAsB,GAAmD,EAWpC,CACnC,GAAM,CAAE,kBAAmB,MAAA,QAAA,QAAA,EAAA,SAAA,QAAM,uBAAA,CAAA,EAE3B,CAAC,EAAgB,GAAiB,MAAM,QAAQ,IAAI,CACxD,EAAA,QAAgB,2BAA2B,EAC3C,EAAe,WAAW,CAC5B,CAAC,EAEK,CAAE,gBAAe,uBAAsB,oBAC3C,EAQF,OAJK,EAAQ,gBACX,MAAM,EAA4B,CAAa,EAG1C,EAA8B,CACnC,GAAG,EACH,uBAAwB,EACxB,8BAA+B,EAC/B,mBACA,eACF,CAAC,CACH,CAEA,SAAgB,IAAuC,CACrD,MAAO,CAAE,MAAO,CAAC,CAAE,CACrB"}
1
+ {"version":3,"file":"agent-server-adapter.cjs","names":[],"sources":["../../src/api/agent-server-adapter.ts"],"sourcesContent":["import { ACP_SETTINGS_KEYS } from \"@openhands/typescript-client\";\nimport { ServerClient } from \"@openhands/typescript-client/clients\";\nimport { SKILLS_CATALOG } from \"@openhands/extensions/skills\";\nimport { DEFAULT_SETTINGS } from \"#/services/settings\";\nimport { ExecutionStatus } from \"#/types/agent-server/core\";\nimport { AgentKind, Settings, SettingsValue } from \"#/types/settings\";\nimport {\n getAcpPreferredDefaultModel,\n getAcpProvider,\n resolveEffectiveAcpModel,\n} from \"#/constants/acp-providers\";\nimport { getAgentServerClientOptions } from \"./agent-server-client-options\";\nimport {\n getCachedAgentServerInfo,\n isAgentServerToolAvailable,\n} from \"./agent-server-compatibility\";\nimport { getAgentServerWorkingDir } from \"./agent-server-config\";\nimport { getEffectiveLocalBackend } from \"./backend-registry/active-store\";\nimport { buildAuthHeaders } from \"./backend-registry/auth\";\nimport {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n SandboxStatus,\n} from \"./conversation-service/agent-server-conversation-service.types\";\nimport SettingsService from \"./settings-service/settings-service.api\";\nimport { getStoredConversationMetadata } from \"./conversation-metadata-store\";\nimport LLMSubscriptionService from \"./llm-subscription-service\";\nimport {\n LLM_AUTH_TYPE_SUBSCRIPTION,\n OPENAI_SUBSCRIPTION_VENDOR,\n isSubscriptionLlmConfig,\n} from \"#/constants/llm-subscription\";\nimport {\n CANVAS_UI_CLIENT_TOOL,\n CANVAS_UI_CLIENT_TOOL_NAME,\n LEGACY_CANVAS_UI_TOOL_NAME,\n type ClientToolSpec,\n} from \"./canvas-ui-client-tool\";\n\nexport interface DirectConversationInfo {\n id: string;\n title?: string | null;\n created_at: string;\n updated_at: string;\n execution_status?: string | null;\n /** Cloud-only sandbox lifecycle state. Omitted / null for local agent-server conversations. */\n sandbox_status?: string | null;\n metrics?: {\n accumulated_cost?: number | null;\n max_budget_per_task?: number | null;\n accumulated_token_usage?: {\n prompt_tokens?: number;\n completion_tokens?: number;\n cache_read_tokens?: number;\n cache_write_tokens?: number;\n context_window?: number;\n per_turn_token?: number;\n } | null;\n } | null;\n agent?: {\n /**\n * Pydantic discriminator from the SDK union: ``\"ACPAgent\"`` for ACP CLI\n * subprocesses (model lives on the subprocess via ``acp_model``),\n * ``\"Agent\"`` for direct litellm. Read by {@link toAppConversation}.\n */\n kind?: string | null;\n acp_model?: string | null;\n /**\n * ACP CLI identity (``claude-code`` / ``codex`` / ``gemini-cli``) from the\n * SDK's ``ACPAgent.acp_server`` (#3692). Preferred fallback when the\n * ``acpserver`` tag is absent — e.g. a profile launch doesn't stamp the tag\n * client-side and the server may not repopulate it. Read by {@link toAppConversation}.\n */\n acp_server?: string | null;\n llm?: {\n model?: string | null;\n } | null;\n } | null;\n current_model_id?: string | null;\n current_model_name?: string | null;\n workspace?: {\n working_dir?: string | null;\n } | null;\n /**\n * Arbitrary string-keyed conversation tags surfaced by the agent-server\n * (see ``ConversationInfo.tags``). Canvas only consumes one key today —\n * ``ACP_SERVER_TAG_KEY`` (\"acpserver\") — but the field is typed as a\n * generic record so future readers don't need another wire-shape change.\n * Keys are constrained to ``^[a-z0-9]+$`` by the agent-server validator;\n * values are opaque strings.\n */\n tags?: Record<string, string> | null;\n launched_agent_profile?: {\n agent_profile_id: string;\n revision: number;\n } | null;\n}\n\nconst DEFAULT_TOOL_NAMES = [\"terminal\", \"file_editor\", \"task_tracker\"];\nconst BROWSER_TOOL_SET_NAME = \"browser_tool_set\";\nconst TASK_TOOL_SET_NAME = \"task_tool_set\";\n\nfunction browserToolsEnabled() {\n return import.meta.env.VITE_ENABLE_BROWSER_TOOLS !== \"false\";\n}\n\n/**\n * Shape of the runtime services info served by Agent Canvas backends in\n * `/server_info.runtime_services`. All URLs are written from the agent's point of\n * view, not the browser's. The block is rendered into the agent's system prompt\n * via `AgentContext.system_message_suffix` so the agent knows what's reachable\n * from inside its sandbox without having to probe.\n */\nexport interface RuntimeServicesInfo {\n mode?: string;\n agent_host_alias?: string;\n services?: {\n agent_server?: { description?: string; url_from_agent?: string };\n ingress?: { description?: string; url_from_agent?: string };\n frontend?: {\n kind?: \"vite\" | \"static\";\n description?: string;\n url_from_agent?: string;\n };\n // `vite` is the legacy key name for the frontend entry, accepted for\n // one release while older dev-stack launchers may still emit it.\n vite?: { description?: string; url_from_agent?: string };\n automation?: {\n description?: string;\n url_from_agent?: string;\n api_prefix?: string;\n docs_url?: string;\n openapi_url?: string;\n auth_env_var?: string;\n };\n };\n}\n\nexport function parseRuntimeServicesInfo(\n value: unknown,\n): RuntimeServicesInfo | null {\n if (typeof value === \"string\") {\n const raw = value.trim();\n if (!raw) return null;\n try {\n return parseRuntimeServicesInfo(JSON.parse(raw));\n } catch {\n return null;\n }\n }\n\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return null;\n }\n\n const parsed = value as RuntimeServicesInfo;\n if (!parsed.services || typeof parsed.services !== \"object\") return null;\n return parsed;\n}\n\nexport async function fetchBackendRuntimeServicesInfo(): Promise<RuntimeServicesInfo | null> {\n let clientOptions: ReturnType<typeof getAgentServerClientOptions>;\n try {\n clientOptions = getAgentServerClientOptions({ timeout: 3000 });\n } catch {\n return null;\n }\n\n const cached = parseRuntimeServicesInfo(\n getCachedAgentServerInfo({ host: clientOptions.host })?.runtime_services,\n );\n if (cached) return cached;\n\n try {\n const serverInfo = await new ServerClient(clientOptions).getServerInfo();\n return parseRuntimeServicesInfo(\n (serverInfo as { runtime_services?: unknown }).runtime_services,\n );\n } catch {\n return null;\n }\n}\n\n/**\n * Return the deployment mode from the runtime services info, e.g. \"docker\",\n * \"dev:automation\", etc. Returns `null` when no runtime info is supplied.\n */\nexport function getDeploymentMode(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | null {\n return runtimeServicesInfo?.mode ?? null;\n}\n\n/**\n * Render the runtime services info into a markdown block suitable for\n * appending to the system prompt via `AgentContext.system_message_suffix`.\n *\n * Returns `undefined` when no runtime info is available, so callers can safely\n * omit the field when the selected backend does not advertise runtime services.\n */\nexport function buildRuntimeServicesSystemSuffix(\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): string | undefined {\n const info = parseRuntimeServicesInfo(runtimeServicesInfo);\n if (!info?.services) return undefined;\n\n const lines: string[] = [];\n lines.push(\"<RUNTIME_SERVICES>\");\n if (info.mode) {\n lines.push(\n `You are running inside an agent-canvas dev stack started in '${info.mode}' mode.`,\n );\n } else {\n lines.push(\"You are running inside an agent-canvas dev stack.\");\n }\n lines.push(\n \"The following services are reachable from your sandbox. URLs are written\",\n \"from your point of view (i.e., as you should curl/fetch them).\",\n \"\",\n );\n\n const { agent_server, ingress, automation } = info.services;\n const { frontend } = info.services;\n\n if (agent_server?.url_from_agent) {\n lines.push(\n `* Agent Server (you): ${agent_server.url_from_agent}`,\n ` ${agent_server.description ?? \"The agent-server hosting your tool calls.\"}`,\n );\n }\n if (ingress?.url_from_agent) {\n lines.push(\n `* Ingress: ${ingress.url_from_agent}`,\n ` ${ingress.description ?? \"Unified entry point for browser-facing traffic.\"}`,\n );\n }\n if (frontend?.url_from_agent) {\n lines.push(\n `* Frontend: ${frontend.url_from_agent}`,\n ` ${frontend.description ?? \"Frontend dev server.\"}`,\n );\n }\n if (automation?.url_from_agent) {\n lines.push(\n `* Automation backend: ${automation.url_from_agent}`,\n ` ${automation.description ?? \"OpenHands Automations service.\"}`,\n );\n if (automation.docs_url) {\n lines.push(` Docs: ${automation.docs_url}`);\n }\n if (automation.openapi_url) {\n lines.push(` OpenAPI: ${automation.openapi_url}`);\n }\n if (automation.auth_env_var) {\n // X-Session-API-Key is the local convention shared by the agent-server\n // and automation backend (see openhands-automation auth.py).\n lines.push(\n ` Auth: header 'X-Session-API-Key: $${automation.auth_env_var}'`,\n );\n }\n } else {\n lines.push(\n \"* Automation backend: not running in this dev mode (skip /api/automation calls).\",\n );\n }\n\n // Anchor the \"don't guess\" warning to the actual agent-server URL for\n // this stack instead of a hardcoded port. The agent-server listens on\n // different ports across dev modes, and baking the wrong port into the\n // system prompt is exactly the kind of confusion this block is meant to\n // prevent.\n const agentServerUrl = agent_server?.url_from_agent;\n lines.push(\n \"\",\n \"Trust this block over guessing: do not assume any other URLs are running.\",\n );\n if (agentServerUrl) {\n lines.push(\n `In particular, ${agentServerUrl} inside your sandbox is the Agent Server`,\n \"you are running inside of — NOT the automation backend.\",\n );\n }\n lines.push(\"</RUNTIME_SERVICES>\");\n\n return lines.join(\"\\n\");\n}\n\nexport function toConversationUrl(conversationId: string): string {\n // Local-format conversation URL — points at whichever local agent-server\n // is actually serving the conversation (the bundled one when the active\n // selection is cloud).\n const { host } = getAgentServerClientOptions();\n return `${host}/api/conversations/${conversationId}`;\n}\n\n// TODO(i18n): extract \"Conversation\" once we add CONVERSATION$DEFAULT_TITLE\n// with `{{shortId}}` interpolation. Kept as a literal for now to keep the\n// fallback inside this pure adapter rather than fanning out to display sites.\nexport function getDefaultConversationTitle(conversationId: string): string {\n return `Conversation ${conversationId.slice(0, 5)}`;\n}\n\nexport function toAppConversation(\n info: DirectConversationInfo,\n): AppConversation {\n const metadata = getStoredConversationMetadata(info.id);\n // ACPAgent conversations carry a sentinel ``llm`` on older SDKs. Prefer the\n // runtime model fields when available, then the configured ``acp_model`` that\n // Canvas saves for built-in providers. ``agent_kind`` still gates model\n // switching, so surfacing this string is display-only.\n const isAcp = info.agent?.kind === \"ACPAgent\";\n // Only surface ``acp_server`` for ACP conversations even if the wire\n // payload accidentally carries an ``acpserver`` tag on an OpenHands\n // conversation — the chip is identity info for the ACP CLI subprocess,\n // and showing it on a non-ACP conversation would be a lie. Fall back to the\n // agent's own ``acp_server`` (#3692) when the tag is missing — a profile\n // launch doesn't stamp the tag, so tag-only reads would drop the ACP model\n // picker and degrade the chip to a generic \"ACP\" (#1571).\n const acpServer = isAcp\n ? (info.tags?.[ACP_SERVER_TAG_KEY] ?? info.agent?.acp_server ?? null)\n : null;\n return {\n id: info.id,\n created_by_user_id: null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: metadata?.selected_workspace ?? null,\n active_profile: metadata?.active_profile ?? null,\n title: info.title?.trim()\n ? info.title\n : getDefaultConversationTitle(info.id),\n trigger: null,\n pr_number: [],\n agent_kind: isAcp ? \"acp\" : \"openhands\",\n acp_server: acpServer,\n tags: info.tags ?? null,\n launched_agent_profile: info.launched_agent_profile ?? null,\n // Chip path: omit ``providerDefault`` so that when no concrete model\n // resolves, the chip falls back to the provider display name in\n // ConversationCardFooter rather than a registry default the session may\n // not actually be running.\n llm_model: isAcp\n ? resolveEffectiveAcpModel({\n runtimeName: info.current_model_name,\n runtimeId: info.current_model_id,\n configured: info.agent?.acp_model,\n sdkLlm: info.agent?.llm?.model,\n })\n : (info.agent?.llm?.model ?? DEFAULT_SETTINGS.llm_model),\n metrics: info.metrics\n ? {\n accumulated_cost: info.metrics.accumulated_cost ?? null,\n max_budget_per_task: info.metrics.max_budget_per_task ?? null,\n accumulated_token_usage: info.metrics.accumulated_token_usage\n ? {\n prompt_tokens:\n info.metrics.accumulated_token_usage.prompt_tokens ?? 0,\n completion_tokens:\n info.metrics.accumulated_token_usage.completion_tokens ?? 0,\n cache_read_tokens:\n info.metrics.accumulated_token_usage.cache_read_tokens ?? 0,\n cache_write_tokens:\n info.metrics.accumulated_token_usage.cache_write_tokens ?? 0,\n context_window:\n info.metrics.accumulated_token_usage.context_window ?? 0,\n per_turn_token:\n info.metrics.accumulated_token_usage.per_turn_token ?? 0,\n }\n : null,\n }\n : null,\n created_at: info.created_at,\n updated_at: info.updated_at,\n execution_status:\n (info.execution_status as AppConversation[\"execution_status\"]) ??\n ExecutionStatus.IDLE,\n sandbox_status: (info.sandbox_status as SandboxStatus | null) ?? null,\n conversation_url: toConversationUrl(info.id),\n session_api_key: getAgentServerClientOptions().apiKey ?? null,\n sandbox_id: null,\n workspace: {\n working_dir: info.workspace?.working_dir ?? getAgentServerWorkingDir(),\n },\n public: false,\n sub_conversation_ids: [],\n };\n}\n\nexport function toConversationPage(data: {\n items: DirectConversationInfo[];\n next_page_id?: string | null;\n}): AppConversationPage {\n return {\n items: data.items.map(toAppConversation),\n next_page_id: data.next_page_id ?? null,\n };\n}\n\ntype SettingsRecord = Record<string, unknown>;\n\ninterface AgentToolSpec {\n name: string;\n params: SettingsRecord;\n}\n\ntype AgentSettingsPayload = SettingsRecord & {\n llm?: SettingsRecord;\n agent_context: SettingsRecord;\n tools?: AgentToolSpec[];\n};\n\ninterface LocalWorkspacePayload {\n kind: \"LocalWorkspace\";\n working_dir: string;\n}\n\ninterface InitialMessagePayload {\n role: \"user\";\n content: Array<{ type: \"text\"; text: string }>;\n run: true;\n}\n\ntype ConversationSettingsPayload = SettingsRecord & {\n workspace: LocalWorkspacePayload;\n initial_message?: InitialMessagePayload;\n};\n\nexport const ACP_SERVER_TAG_KEY = \"acpserver\";\n\n/**\n * Conversation tag keys Canvas itself stamps/consumes for internal routing.\n * They are already surfaced through dedicated UI (the ACP provider chip), so\n * the generic tag-chip display filters them out.\n */\nexport const RESERVED_CONVERSATION_TAG_KEYS: ReadonlySet<string> = new Set([\n ACP_SERVER_TAG_KEY,\n]);\n\n/**\n * User-facing subset of a conversation's server-side tags: everything except\n * {@link RESERVED_CONVERSATION_TAG_KEYS}, as stable ``[key, value]`` entries\n * sorted by key so chip order doesn't shuffle between refetches.\n */\nexport function getDisplayConversationTags(\n tags: Record<string, string> | null | undefined,\n): Array<[string, string]> {\n if (!tags) {\n return [];\n }\n return Object.entries(tags)\n .filter(([key]) => !RESERVED_CONVERSATION_TAG_KEYS.has(key))\n .sort(([a], [b]) => a.localeCompare(b));\n}\n\nconst FERNET_TOKEN_PREFIX = \"gAAAAA\";\n\nconst CONVERSATION_SETTINGS_METADATA_KEYS = new Set([\n \"schema_version\",\n \"agent_settings\",\n \"workspace\",\n \"conversation_id\",\n \"initial_message\",\n \"plugins\",\n]);\n\nfunction toRecord(value: unknown): SettingsRecord {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return {};\n }\n\n return structuredClone(value as SettingsRecord);\n}\n\nfunction normalizeSecretString(value: unknown): string | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction hasEncryptedString(value: unknown): boolean {\n if (typeof value === \"string\") {\n return value.startsWith(FERNET_TOKEN_PREFIX);\n }\n if (Array.isArray(value)) {\n return value.some(hasEncryptedString);\n }\n if (isPlainRecord(value)) {\n return Object.values(value).some(hasEncryptedString);\n }\n return false;\n}\n\nfunction hasEncryptedMcpSecrets(mcpConfig: unknown): boolean {\n if (!isPlainRecord(mcpConfig)) {\n return false;\n }\n\n return Object.values(mcpConfig).some(hasEncryptedString);\n}\n\nfunction getConversationConfirmationPolicy(\n conversationSettings: SettingsRecord,\n) {\n if (conversationSettings.confirmation_mode !== true) {\n return { kind: \"NeverConfirm\" };\n }\n\n if (conversationSettings.security_analyzer === \"llm\") {\n return { kind: \"ConfirmRisky\", threshold: \"HIGH\", confirm_unknown: true };\n }\n\n return { kind: \"AlwaysConfirm\" };\n}\n\nfunction getConversationSecurityAnalyzer(conversationSettings: SettingsRecord) {\n switch (conversationSettings.security_analyzer) {\n case \"llm\":\n return { kind: \"LLMSecurityAnalyzer\" };\n case \"pattern\":\n return { kind: \"PatternSecurityAnalyzer\" };\n case \"policy_rail\":\n return { kind: \"PolicyRailSecurityAnalyzer\" };\n default:\n return undefined;\n }\n}\n\nfunction isToolRecord(\n value: unknown,\n): value is { name: string; params?: unknown } {\n return (\n !!value &&\n typeof value === \"object\" &&\n !Array.isArray(value) &&\n typeof (value as { name?: unknown }).name === \"string\"\n );\n}\n\nfunction shouldIncludeTool(name: string, agentSettings: SettingsRecord) {\n if (name === BROWSER_TOOL_SET_NAME) {\n return browserToolsEnabled() && isAgentServerToolAvailable(name);\n }\n\n if (name === TASK_TOOL_SET_NAME) {\n return (\n agentSettings.enable_sub_agents === true &&\n isAgentServerToolAvailable(name)\n );\n }\n\n return true;\n}\n\nfunction getAgentTools(agentSettings: SettingsRecord): AgentToolSpec[] {\n const tools = new Map<string, AgentToolSpec>();\n\n for (const name of DEFAULT_TOOL_NAMES) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n for (const name of [BROWSER_TOOL_SET_NAME, TASK_TOOL_SET_NAME]) {\n if (shouldIncludeTool(name, agentSettings)) {\n tools.set(name, { name, params: {} });\n }\n }\n\n const configuredTools = agentSettings.tools;\n if (\n Array.isArray(configuredTools) &&\n configuredTools.every((tool) => isToolRecord(tool))\n ) {\n for (const tool of configuredTools) {\n if (shouldIncludeTool(tool.name, agentSettings)) {\n tools.set(tool.name, {\n name: tool.name,\n params: toRecord(tool.params),\n });\n }\n }\n }\n\n return Array.from(tools.values());\n}\n\nfunction buildInitialMessage(\n query?: string,\n conversationInstructions?: string,\n): InitialMessagePayload | null {\n const parts = [query?.trim(), conversationInstructions?.trim()].filter(\n Boolean,\n );\n if (parts.length === 0) {\n return null;\n }\n\n return {\n role: \"user\",\n content: [{ type: \"text\", text: parts.join(\"\\n\\n\") }],\n run: true,\n };\n}\n\n/**\n * Shape of a bundled skill entry passed to the agent-server SDK via\n * `agent_context.skills`. Mirrors the SDK's `Skill` model fields that\n * the server uses for trigger matching, activation, and system-prompt\n * injection.\n */\ninterface BundledSkill {\n name: string;\n content: string;\n trigger: { type: \"keyword\"; keywords: string[] } | null;\n source: string;\n description: string | null;\n is_agentskills_format: true;\n license?: string;\n compatibility?: string;\n}\n\n/**\n * Convert the bundled `SKILLS_CATALOG` entries into the SDK `Skill` JSON\n * shape so the agent-server can perform trigger matching, skill activation,\n * and system-prompt injection without cloning the extensions repo.\n *\n * The SDK discriminates triggers via `{ type: \"keyword\", keywords: [...] }`.\n * Skills with no triggers get `trigger: null` (always-active / on-demand).\n */\nfunction buildBundledSkills(): BundledSkill[] {\n return SKILLS_CATALOG.map((entry) => {\n const trigger: BundledSkill[\"trigger\"] =\n entry.triggers?.length > 0\n ? { type: \"keyword\", keywords: entry.triggers }\n : null;\n\n // Use the absolute path to the skill's SKILL.md so the Python\n // agent-server can resolve bundled resources (scripts/, references/).\n // Falls back to \"public\" in library builds where the path isn't known.\n const source = __EXTENSIONS_SKILLS_DIR__\n ? `${__EXTENSIONS_SKILLS_DIR__}/${entry.name}/SKILL.md`\n : \"public\";\n\n return {\n name: entry.name,\n content: entry.content,\n trigger,\n source,\n description: entry.description ?? null,\n is_agentskills_format: true as const,\n ...(entry.license ? { license: entry.license } : {}),\n ...(entry.compatibility ? { compatibility: entry.compatibility } : {}),\n };\n });\n}\n\nfunction buildAgentContext(\n agentSettings: SettingsRecord,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n disabledSkills: string[] = [],\n): SettingsRecord {\n const runtimeServicesSuffix =\n buildRuntimeServicesSystemSuffix(runtimeServicesInfo);\n const existingContext = toRecord(agentSettings.agent_context);\n\n // Merge bundled public skills with any skills already present in the\n // agent context (e.g. user-defined skills set via the settings API).\n const existingSkills = Array.isArray(existingContext.skills)\n ? (existingContext.skills as SettingsRecord[])\n : [];\n const disabledSkillNames = new Set(disabledSkills);\n const mergedSkills = [...existingSkills, ...buildBundledSkills()].filter(\n (skill) =>\n typeof skill.name !== \"string\" || !disabledSkillNames.has(skill.name),\n );\n\n return {\n ...existingContext,\n // Public skills are bundled at build time from the @openhands/extensions\n // npm package and passed directly in agent_context.skills. Setting\n // load_public_skills to false tells the agent-server SDK to skip its own\n // extensions-repo clone — the frontend is the sole source of public\n // skills now.\n //\n // Migration: the former VITE_LOAD_PUBLIC_SKILLS env var was removed\n // because bundled skills have no clone latency. Users who previously set\n // VITE_LOAD_PUBLIC_SKILLS=false to avoid clone delays no longer need it.\n skills: mergedSkills,\n load_public_skills: false,\n load_user_skills: true,\n load_project_skills: true,\n ...(runtimeServicesSuffix\n ? { system_message_suffix: runtimeServicesSuffix }\n : {}),\n };\n}\n\nfunction isAcpAgent(settings: Settings): boolean {\n const agentSettings = toRecord(settings.agent_settings);\n return agentSettings.agent_kind === \"acp\";\n}\n\nfunction getAcpServerTag(settings: Settings): string | undefined {\n const agentSettings = toRecord(settings.agent_settings);\n const value = agentSettings.acp_server;\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction resolveAcpCommand(agentSettings: SettingsRecord): unknown {\n const cmd = agentSettings.acp_command;\n const isEmpty = Array.isArray(cmd) && cmd.length === 0;\n const noCommand = cmd === undefined;\n if (!isEmpty && !noCommand) {\n return cmd;\n }\n\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const provider = getAcpProvider(serverKey);\n return provider ? [...provider.default_command] : cmd;\n}\n\nfunction buildConfiguredAcpAgentSettings(\n settings: Settings,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const payload: AgentSettingsPayload = {\n agent_kind: \"acp\",\n agent_context: buildAgentContext(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\n };\n\n // TODO(#1019): set ``acp_isolate_data_dir: true`` here for a containerized\n // backend so concurrent same-provider conversations don't race on a shared\n // HOME. The SDK supports it (software-agent-sdk#3492), but the released\n // ``@openhands/typescript-client`` (1.24.3) doesn't surface it on\n // ``ACPAgentSettings`` yet, so sending it risks a validation error on older\n // servers. Cloud grouping isolation is separate (agent-canvas#1016).\n\n for (const key of ACP_SETTINGS_KEYS) {\n // ``acp_model`` is resolved separately below so a saved ``null`` still\n // falls back to the provider's default rather than being dropped.\n if (key === \"acp_model\") continue;\n // ``acp_env`` is deprecated — provider creds now route via ``request.secrets``.\n if (key === \"acp_env\") continue;\n const value =\n key === \"acp_command\"\n ? resolveAcpCommand(agentSettings)\n : agentSettings[key];\n if (value !== undefined && value !== null) {\n payload[key] = value;\n }\n }\n\n // ``mcp_config`` is a shared field (not in ACP_SETTINGS_KEYS): forward it\n // so the ACP subprocess connects to the configured MCP servers at session\n // creation. Only include it when it actually carries servers — an empty or\n // malformed value is dropped rather than sending ``mcp_config: {}``.\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length > 0) {\n payload.mcp_config = mcpConfig;\n }\n\n // Saved settings may carry ``acp_model: null`` (existing users predating\n // the default-model registry, or saved fields the agent-server stripped).\n // Fall back to the *preferred* default (Vertex-safe for Gemini) so the\n // conversation starts with whatever the Settings → Agent UI shows — without\n // that, the form's displayed default would silently not take effect at\n // runtime until the user re-saved the page.\n const serverKey =\n typeof agentSettings.acp_server === \"string\"\n ? agentSettings.acp_server\n : undefined;\n const effectiveModel = resolveEffectiveAcpModel({\n configured: agentSettings.acp_model as string | null | undefined,\n providerDefault: getAcpPreferredDefaultModel(serverKey),\n });\n if (effectiveModel) {\n payload.acp_model = effectiveModel;\n }\n\n return payload;\n}\n\nfunction buildConfiguredOpenHandsAgentSettings(\n settings: Settings,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n const agentSettings = toRecord(settings.agent_settings);\n const llm = toRecord(agentSettings.llm);\n\n llm.model =\n typeof llm.model === \"string\" && llm.model.trim().length > 0\n ? llm.model\n : DEFAULT_SETTINGS.llm_model;\n\n // Stream assistant tokens (parity with ACP agents). The agent-server only\n // emits StreamingDeltaEvents for SDK LLM agents when an LLM has stream=True.\n llm.stream = true;\n\n const apiKey = normalizeSecretString(llm.api_key);\n if (apiKey) {\n llm.api_key = apiKey;\n } else {\n delete llm.api_key;\n }\n\n const baseUrl = normalizeSecretString(llm.base_url);\n if (baseUrl) {\n llm.base_url = baseUrl;\n } else {\n delete llm.base_url;\n }\n\n if (isSubscriptionLlmConfig(llm)) {\n llm.auth_type = LLM_AUTH_TYPE_SUBSCRIPTION;\n llm.subscription_vendor = OPENAI_SUBSCRIPTION_VENDOR;\n delete llm.api_key;\n delete llm.base_url;\n } else {\n delete llm.auth_type;\n delete llm.subscription_vendor;\n }\n\n const mcpConfig = toRecord(agentSettings.mcp_config);\n if (Object.keys(mcpConfig).length === 0) {\n delete agentSettings.mcp_config;\n }\n\n delete agentSettings.acp_server;\n for (const key of ACP_SETTINGS_KEYS) {\n delete agentSettings[key];\n }\n // ``acp_env`` is no longer a forwarded ACP setting (provider creds ride the\n // Secrets panel), but a legacy value may linger on persisted settings —\n // scrub it so it never leaks onto the OpenHands payload.\n delete agentSettings.acp_env;\n\n return {\n ...agentSettings,\n llm,\n agent_context: buildAgentContext(\n agentSettings,\n runtimeServicesInfo,\n settings.disabled_skills,\n ),\n tools: getAgentTools(agentSettings),\n };\n}\n\nfunction buildConfiguredAgentSettings(\n settings: Settings,\n runtimeServicesInfo?: RuntimeServicesInfo | null,\n): AgentSettingsPayload {\n return isAcpAgent(settings)\n ? buildConfiguredAcpAgentSettings(settings, runtimeServicesInfo)\n : buildConfiguredOpenHandsAgentSettings(settings, runtimeServicesInfo);\n}\n\nfunction buildConfiguredConversationSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n workingDir?: string;\n}): ConversationSettingsPayload {\n const { settings, query, conversationInstructions, plugins, workingDir } =\n options;\n const conversationSettings = toRecord(settings.conversation_settings);\n const initialMessage = buildInitialMessage(query, conversationInstructions);\n\n CONVERSATION_SETTINGS_METADATA_KEYS.forEach(\n (key) => delete conversationSettings[key],\n );\n\n const payload: ConversationSettingsPayload = {\n ...conversationSettings,\n workspace: {\n kind: \"LocalWorkspace\",\n working_dir: workingDir ?? getAgentServerWorkingDir(),\n },\n ...(initialMessage ? { initial_message: initialMessage } : {}),\n ...(plugins?.length\n ? {\n plugins: plugins.map((plugin) => ({\n source: plugin.source,\n ...(plugin.ref ? { ref: plugin.ref } : {}),\n ...(plugin.repo_path ? { repo_path: plugin.repo_path } : {}),\n })),\n }\n : {}),\n };\n\n return payload;\n}\n\ninterface LookupSecret {\n kind: \"LookupSecret\";\n url: string;\n headers?: Record<string, string>;\n description?: string;\n}\n\ntype StartConversationPayload = Record<string, unknown> & {\n // Omitted when launching via ``agent_profile_id`` — the two are mutually\n // exclusive agent sources; the server resolves the profile server-side.\n agent_settings?: AgentSettingsPayload;\n agent_profile_id?: string;\n workspace: LocalWorkspacePayload;\n confirmation_policy: SettingsRecord;\n security_analyzer?: SettingsRecord;\n initial_message?: InitialMessagePayload;\n max_iterations: number;\n stuck_detection: true;\n autotitle: true;\n title_llm_profile?: string;\n worktree: boolean;\n secrets_encrypted?: true;\n conversation_id?: string;\n secrets?: Record<string, LookupSecret>;\n tags?: Record<string, string>;\n client_tools: ClientToolSpec[];\n tool_module_qualnames?: Record<string, string>;\n};\n\nexport interface StartConversationOptions {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n encryptedAgentSettings?: Record<string, SettingsValue>;\n encryptedConversationSettings?: Record<string, SettingsValue>;\n secretsEncrypted?: boolean;\n customSecrets?: Array<{ name: string; description?: string }>;\n // When set, the conversation launches from this AgentProfile (resolved\n // server-side) instead of an inline ``agent_settings`` dump (#3727).\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n runtimeServicesInfo?: RuntimeServicesInfo | null;\n}\n\nexport function buildStartConversationRequest(\n options: StartConversationOptions,\n): StartConversationPayload {\n const sourceAgentSettings = options.encryptedAgentSettings\n ? { ...options.settings, agent_settings: options.encryptedAgentSettings }\n : options.settings;\n\n const acpMode = isAcpAgent(sourceAgentSettings);\n const launchAgentKind = options.agentProfileId\n ? options.agentProfileKind\n : acpMode\n ? \"acp\"\n : \"openhands\";\n const agentSettings = buildConfiguredAgentSettings(\n sourceAgentSettings,\n options.runtimeServicesInfo,\n );\n const acpServerTag = acpMode\n ? getAcpServerTag(sourceAgentSettings)\n : undefined;\n\n const sourceConversationOptions = options.encryptedConversationSettings\n ? {\n ...options,\n settings: {\n ...options.settings,\n conversation_settings: options.encryptedConversationSettings,\n },\n }\n : options;\n\n const conversationSettings = buildConfiguredConversationSettings(\n sourceConversationOptions,\n );\n\n const payload: StartConversationPayload = {\n // ``agent_profile_id`` and ``agent_settings`` are mutually exclusive agent\n // sources; the profile path lets the server resolve the profile (#3727).\n //\n // Enrichment boundary: on the profile path the server rebuilds the agent\n // purely from the stored profile fields, so the client-owned enrichments\n // this adapter folds into ``agent_settings`` do NOT apply. The exec toolset\n // (terminal/file_editor/task_tracker) and public-skill loading are the\n // server/SDK's responsibility to restore on the profile path — tracked in\n // software-agent-sdk#3967 (profile resolution must attach the default\n // toolset + public skills, else a profile-launched OpenHands agent has only\n // Finish/Think). The dev ``RUNTIME_SERVICES`` system-message suffix remains\n // agent-settings-only; the Canvas UI tool is a top-level client tool and\n // therefore works on both inline-agent and profile launch paths.\n //\n // Persistent memory is NOT on that boundary: ``load_memory`` is a global\n // user preference, so the agent-server stamps the stored\n // ``agent_settings.agent_context.load_memory`` onto the profile-resolved\n // agent the same way it already applies the global ``mcp_config``. The\n // toggle therefore applies to both launch paths, and the client must not\n // re-send it here (``agent_profile_id`` and ``agent_settings`` are\n // mutually exclusive).\n ...(options.agentProfileId\n ? { agent_profile_id: options.agentProfileId }\n : { agent_settings: agentSettings }),\n workspace: conversationSettings.workspace,\n client_tools:\n launchAgentKind === \"openhands\" ? [CANVAS_UI_CLIENT_TOOL] : [],\n confirmation_policy:\n getConversationConfirmationPolicy(conversationSettings),\n max_iterations:\n typeof conversationSettings.max_iterations === \"number\"\n ? conversationSettings.max_iterations\n : 500,\n stuck_detection: true,\n autotitle: true,\n ...(options.titleLlmProfile\n ? { title_llm_profile: options.titleLlmProfile }\n : {}),\n worktree: options.worktree ?? true,\n };\n\n // A profile launch resolves the ACP server server-side, so don't stamp the\n // tag from current settings (it may not match the launched profile).\n if (!options.agentProfileId && acpServerTag) {\n payload.tags = { [ACP_SERVER_TAG_KEY]: acpServerTag };\n }\n\n // ``secrets_encrypted`` makes the agent-server decrypt request secrets at\n // conversation start. Non-ACP conversations need it for encrypted LLM keys.\n // ACP normally carries provider credentials as LookupSecrets, so avoid\n // forcing a cipher on fresh ACP-only backends. The exception is MCP:\n // encrypted settings round-trip mcp_config secrets as Fernet tokens,\n // and ACP forwards mcp_config directly to the subprocess.\n if (\n !options.agentProfileId &&\n options.secretsEncrypted &&\n (!acpMode || hasEncryptedMcpSecrets(agentSettings.mcp_config))\n ) {\n payload.secrets_encrypted = true;\n }\n\n if (options.conversationId) {\n payload.conversation_id = options.conversationId;\n }\n\n const securityAnalyzer =\n getConversationSecurityAnalyzer(conversationSettings);\n if (securityAnalyzer) {\n payload.security_analyzer = securityAnalyzer;\n }\n\n if (conversationSettings.initial_message) {\n payload.initial_message = conversationSettings.initial_message;\n }\n\n if (conversationSettings.plugins) {\n payload.plugins = conversationSettings.plugins;\n }\n\n if (conversationSettings.hook_config) {\n payload.hook_config = conversationSettings.hook_config;\n }\n\n const toolModuleQualnames = {\n ...((conversationSettings.tool_module_qualnames as\n | Record<string, string>\n | undefined) ?? {}),\n };\n delete toolModuleQualnames[LEGACY_CANVAS_UI_TOOL_NAME];\n delete toolModuleQualnames[CANVAS_UI_CLIENT_TOOL_NAME];\n if (Object.keys(toolModuleQualnames).length > 0) {\n payload.tool_module_qualnames = toolModuleQualnames;\n }\n\n if (conversationSettings.agent_definitions) {\n payload.agent_definitions = conversationSettings.agent_definitions;\n }\n\n // Every saved secret rides as a LookupSecret the agent-server resolves back\n // from its own store at spawn time — ``request.secrets`` is the sole channel,\n // uniform for ACP and non-ACP (agent-canvas#1039). For ACP the resolution\n // runs off the event loop (software-agent-sdk#3510, >=1.25.0), so the loopback\n // fetch can't deadlock.\n if (options.customSecrets && options.customSecrets.length > 0) {\n const backend = getEffectiveLocalBackend();\n const headers = backend ? buildAuthHeaders(backend) : {};\n\n const secrets: Record<string, LookupSecret> = {};\n for (const secret of options.customSecrets) {\n const lookupSecret: LookupSecret = {\n kind: \"LookupSecret\",\n url: `/api/settings/secrets/${encodeURIComponent(secret.name)}`,\n description: secret.description,\n };\n\n if (Object.keys(headers).length > 0) {\n lookupSecret.headers = headers;\n }\n\n secrets[secret.name] = lookupSecret;\n }\n\n payload.secrets = secrets;\n }\n\n return payload;\n}\n\nexport const SUBSCRIPTION_LOGIN_REQUIRED_ERROR =\n \"Connect your ChatGPT subscription before starting a conversation with this LLM profile.\";\n\n/**\n * Throws if a ChatGPT subscription LLM profile is not connected.\n * Called before conversation creation and LLM profile switch only — not on\n * subsequent message sends or conversation resume. The agent-server must handle\n * mid-conversation token expiry gracefully.\n */\nexport async function assertSubscriptionAuthReady(\n agentSettings: Record<string, unknown>,\n): Promise<void> {\n const llm = toRecord(agentSettings.llm);\n if (!isSubscriptionLlmConfig(llm)) return;\n\n const status = await LLMSubscriptionService.getOpenAIStatus();\n if (!status.connected) {\n throw new Error(SUBSCRIPTION_LOGIN_REQUIRED_ERROR);\n }\n}\n\nexport async function buildStartConversationRequestWithEncryptedSettings(options: {\n settings: Settings;\n query?: string;\n conversationInstructions?: string;\n plugins?: PluginSpec[];\n conversationId?: string;\n workingDir?: string;\n worktree?: boolean;\n agentProfileId?: string;\n agentProfileKind?: AgentKind;\n titleLlmProfile?: string;\n}): Promise<Record<string, unknown>> {\n const { SecretsService } = await import(\"./secrets-service\");\n\n const [settingsResult, customSecrets, runtimeServicesInfo] =\n await Promise.all([\n SettingsService.getSettingsForConversation(),\n SecretsService.getSecrets(),\n fetchBackendRuntimeServicesInfo(),\n ]);\n\n const { agentSettings, conversationSettings, secretsEncrypted } =\n settingsResult;\n\n // A profile launch resolves the LLM server-side, so the current-settings\n // subscription check doesn't apply (and can't see the profile's LLM).\n if (!options.agentProfileId) {\n await assertSubscriptionAuthReady(agentSettings);\n }\n\n return buildStartConversationRequest({\n ...options,\n encryptedAgentSettings: agentSettings,\n encryptedConversationSettings: conversationSettings,\n secretsEncrypted,\n customSecrets,\n runtimeServicesInfo,\n });\n}\n\nexport function emptyHooksResponse(): GetHooksResponse {\n return { hooks: [] };\n}\n"],"mappings":"qjCAoGA,IAAM,EAAqB,CAAC,WAAY,cAAe,cAAc,EAC/D,EAAwB,mBACxB,EAAqB,gBAE3B,SAAS,GAAsB,CAC7B,MAAO,EACT,CAkCA,SAAgB,EACd,EAC4B,CAC5B,GAAI,OAAO,GAAU,SAAU,CAC7B,IAAM,EAAM,EAAM,KAAK,EACvB,GAAI,CAAC,EAAK,OAAO,KACjB,GAAI,CACF,OAAO,EAAyB,KAAK,MAAM,CAAG,CAAC,CACjD,MAAQ,CACN,OAAO,IACT,CACF,CAEA,GAAI,CAAC,GAAS,OAAO,GAAU,UAAY,MAA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MAAM,EAAiC,CAErD,CAEA,eAAsB,GAAmD,EAWpC,CACnC,GAAM,CAAE,kBAAmB,MAAA,QAAA,QAAA,EAAA,SAAA,QAAM,uBAAA,CAAA,EAE3B,CAAC,EAAgB,EAAe,GACpC,MAAM,QAAQ,IAAI,CAChB,EAAA,QAAgB,2BAA2B,EAC3C,EAAe,WAAW,EAC1B,EAAgC,CAClC,CAAC,EAEG,CAAE,gBAAe,uBAAsB,oBAC3C,EAQF,OAJK,EAAQ,gBACX,MAAM,EAA4B,CAAa,EAG1C,EAA8B,CACnC,GAAG,EACH,uBAAwB,EACxB,8BAA+B,EAC/B,mBACA,gBACA,qBACF,CAAC,CACH,CAEA,SAAgB,IAAuC,CACrD,MAAO,CAAE,MAAO,CAAC,CAAE,CACrB"}
@@ -59,20 +59,59 @@ export interface DirectConversationInfo {
59
59
  revision: number;
60
60
  } | null;
61
61
  }
62
+ /**
63
+ * Shape of the runtime services info served by Agent Canvas backends in
64
+ * `/server_info.runtime_services`. All URLs are written from the agent's point of
65
+ * view, not the browser's. The block is rendered into the agent's system prompt
66
+ * via `AgentContext.system_message_suffix` so the agent knows what's reachable
67
+ * from inside its sandbox without having to probe.
68
+ */
69
+ export interface RuntimeServicesInfo {
70
+ mode?: string;
71
+ agent_host_alias?: string;
72
+ services?: {
73
+ agent_server?: {
74
+ description?: string;
75
+ url_from_agent?: string;
76
+ };
77
+ ingress?: {
78
+ description?: string;
79
+ url_from_agent?: string;
80
+ };
81
+ frontend?: {
82
+ kind?: "vite" | "static";
83
+ description?: string;
84
+ url_from_agent?: string;
85
+ };
86
+ vite?: {
87
+ description?: string;
88
+ url_from_agent?: string;
89
+ };
90
+ automation?: {
91
+ description?: string;
92
+ url_from_agent?: string;
93
+ api_prefix?: string;
94
+ docs_url?: string;
95
+ openapi_url?: string;
96
+ auth_env_var?: string;
97
+ };
98
+ };
99
+ }
100
+ export declare function parseRuntimeServicesInfo(value: unknown): RuntimeServicesInfo | null;
101
+ export declare function fetchBackendRuntimeServicesInfo(): Promise<RuntimeServicesInfo | null>;
62
102
  /**
63
103
  * Return the deployment mode from the runtime services info, e.g. "docker",
64
- * "dev:automation", etc. Returns `null` when no runtime info is configured.
104
+ * "dev:automation", etc. Returns `null` when no runtime info is supplied.
65
105
  */
66
- export declare function getDeploymentMode(): string | null;
106
+ export declare function getDeploymentMode(runtimeServicesInfo?: RuntimeServicesInfo | null): string | null;
67
107
  /**
68
108
  * Render the runtime services info into a markdown block suitable for
69
109
  * appending to the system prompt via `AgentContext.system_message_suffix`.
70
110
  *
71
- * Returns `undefined` when no runtime info is configured, so callers can
72
- * safely omit the field on production builds (where the launcher doesn't
73
- * set `VITE_RUNTIME_SERVICES_INFO`).
111
+ * Returns `undefined` when no runtime info is available, so callers can safely
112
+ * omit the field when the selected backend does not advertise runtime services.
74
113
  */
75
- export declare function buildRuntimeServicesSystemSuffix(): string | undefined;
114
+ export declare function buildRuntimeServicesSystemSuffix(runtimeServicesInfo?: RuntimeServicesInfo | null): string | undefined;
76
115
  export declare function toConversationUrl(conversationId: string): string;
77
116
  export declare function getDefaultConversationTitle(conversationId: string): string;
78
117
  export declare function toAppConversation(info: DirectConversationInfo): AppConversation;
@@ -158,6 +197,7 @@ export interface StartConversationOptions {
158
197
  agentProfileId?: string;
159
198
  agentProfileKind?: AgentKind;
160
199
  titleLlmProfile?: string;
200
+ runtimeServicesInfo?: RuntimeServicesInfo | null;
161
201
  }
162
202
  export declare function buildStartConversationRequest(options: StartConversationOptions): StartConversationPayload;
163
203
  export declare const SUBSCRIPTION_LOGIN_REQUIRED_ERROR = "Connect your ChatGPT subscription before starting a conversation with this LLM profile.";