@openhands/agent-canvas 1.5.1 → 1.6.1

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 (720) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-DqF_OEZB.js → Trans-52HCczKK.js} +1 -1
  4. package/build/assets/{acp-providers-DerAmTyY.js → acp-providers-xACMK9ZP.js} +1 -1
  5. package/build/assets/{active-backend-context-B8rMv0X9.js → active-backend-context-Cd1qcZsb.js} +1 -1
  6. package/build/assets/{add-backend-modal-CxC7BNEc.js → add-backend-modal-5chsfln3.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-BJb8YXR1.js → agent-profiles-settings-BWK4H3kR.js} +1 -1
  8. package/build/assets/agent-server-compatibility-DMY0CihN.js +1 -0
  9. package/build/assets/agent-server-conversation-service.api-CI5-xmIX.js +41 -0
  10. package/build/assets/agent-settings-CMd8-O4f.js +2 -0
  11. package/build/assets/agent-settings-CdrhQJXX.js +1 -0
  12. package/build/assets/{alert-banner-Dh51WURQ.js → alert-banner-CLfWuIAX.js} +1 -1
  13. package/build/assets/api-key-entry-screen-Cc3aC7DZ.js +1 -0
  14. package/build/assets/app-settings-B-DQcBoB.js +1 -0
  15. package/build/assets/{automation-detail-CZsu2CoM.js → automation-detail-BgxBIpyK.js} +2 -2
  16. package/build/assets/automation-export-Dbur8OHa.js +2 -0
  17. package/build/assets/automations-list-BWfjizlp.js +1 -0
  18. package/build/assets/{back-nav-button-DVknCcSP.js → back-nav-button-CaKvsD1E.js} +1 -1
  19. package/build/assets/backend-form-modal-YcfpuBZo.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-BSfN0AZA.js → backend-synced-settings-badge-BellMmgC.js} +1 -1
  21. package/build/assets/{base-modal-CIF_785P.js → base-modal-Cw7enAHz.js} +1 -1
  22. package/build/assets/{brand-button-B1izLAdR.js → brand-button-BulEFHr3.js} +1 -1
  23. package/build/assets/{browser-DKaeq_sT.js → browser-DfVgUREb.js} +2 -2
  24. package/build/assets/browser-store-CBqI3tNR.js +1 -0
  25. package/build/assets/{browser-tab-qb_ftCxW.js → browser-tab-CmIKQB7S.js} +1 -1
  26. package/build/assets/chat-send-button-BchSSwuD.js +1 -0
  27. package/build/assets/circle-check-BXbQ5nEH.js +1 -0
  28. package/build/assets/{circle-plus-check-toggle-DoFIjVE0.js → circle-plus-check-toggle-BhpPjkh9.js} +1 -1
  29. package/build/assets/client-source-DAUgyJsi.js +1 -0
  30. package/build/assets/cloud-funnel-analytics-B5OeWh4y.js +1 -0
  31. package/build/assets/{color-themes-CHizm1xF.js → color-themes-QKMSVfDU.js} +1 -1
  32. package/build/assets/{combobox-caret-CxZpqoSR.js → combobox-caret-kNZtp53R.js} +1 -1
  33. package/build/assets/{command-menu-oTvKDU3Y.js → command-menu-tUsn23zy.js} +1 -1
  34. package/build/assets/{command-store-D8J5LMW1.js → command-store-B0hrIWMN.js} +1 -1
  35. package/build/assets/{condenser-settings-BGlWn93P.js → condenser-settings-BBizzfIH.js} +1 -1
  36. package/build/assets/{confirmation-modal-DGBWM2Ls.js → confirmation-modal-108xng7X.js} +1 -1
  37. package/build/assets/{context-menu-list-item-6psNyl7X.js → context-menu-list-item-BbKfFuN1.js} +1 -1
  38. package/build/assets/conversation-CTzSrLMq.js +1 -0
  39. package/build/assets/conversation-CgcXNb-Z.js +90 -0
  40. package/build/assets/conversation-panel-bscjGQda.js +1 -0
  41. package/build/assets/{conversation-service.api-_f9GlIEi.js → conversation-service.api-DbBvscJA.js} +1 -1
  42. package/build/assets/conversation-state-store-C5GagZHT.js +1 -0
  43. package/build/assets/{conversation-store-LptbOvKa.js → conversation-store-CyVqoa0d.js} +1 -1
  44. package/build/assets/{conversation-tab-empty-state-CNUmIms2.js → conversation-tab-empty-state-2KYlk5Bh.js} +1 -1
  45. package/build/assets/{copy-to-clipboard-button-CFzH_NOX.js → copy-to-clipboard-button-C54YRPMg.js} +1 -1
  46. package/build/assets/declaration-_yumYLEx.js +1 -0
  47. package/build/assets/{device-verify-WBSjJBLH.js → device-verify-D6FW_KZq.js} +1 -1
  48. package/build/assets/{dropdown-classes-D3wMJlXT.js → dropdown-classes-9uONlOg1.js} +1 -1
  49. package/build/assets/{ellipsis-button-CbNnHlIq.js → ellipsis-button-CoaUrKmQ.js} +1 -1
  50. package/build/assets/{entry.client-DNlPGxsu.js → entry.client-BJSVzw7V.js} +2 -2
  51. package/build/assets/{enum-filter-dropdown-JLYv1t8L.js → enum-filter-dropdown-qQzyjk_q.js} +1 -1
  52. package/build/assets/{environment-switch-overlay-B1PFO8P8.js → environment-switch-overlay-XRWCClLu.js} +1 -1
  53. package/build/assets/extensions-hub-DUp9sWQY.js +1 -0
  54. package/build/assets/extensions-navigation-DmkftjAx.js +1 -0
  55. package/build/assets/file-tUAzhmJ3.js +1 -0
  56. package/build/assets/files-tab-GV5hwiIM.js +1 -0
  57. package/build/assets/files-tab-store-DehyITNC.js +1 -0
  58. package/build/assets/{form-control-classes-CbdN5aO3.js → form-control-classes-BPUnoYyg.js} +1 -1
  59. package/build/assets/git-provider-icon-DDkru3b_.js +1 -0
  60. package/build/assets/highlighted-source-view-CYkPZUxr.js +1 -0
  61. package/build/assets/home-C53WekZ2.js +1 -0
  62. package/build/assets/home-EAwq8ah2.js +1 -0
  63. package/build/assets/index-home-kBdZGKtu.js +1 -0
  64. package/build/assets/install-server-modal-DYk4VP3-.js +1 -0
  65. package/build/assets/{launch-CAGavYl-.js → launch-CIecOy_y.js} +1 -1
  66. package/build/assets/lesson-plan-BSEUwflx.js +4 -0
  67. package/build/assets/llm-not-configured-banner-C8uv1PHT.js +27 -0
  68. package/build/assets/llm-settings-0Bb97NCk.js +1 -0
  69. package/build/assets/llm-settings-D4toJ90k.js +1 -0
  70. package/build/assets/{llm-subscription-service-Casyzgn1.js → llm-subscription-service-BPRw3u3H.js} +1 -1
  71. package/build/assets/{loading-spinner-BcdnT0mN.js → loading-spinner-BCInDEXB.js} +1 -1
  72. package/build/assets/manage-backends-modal-Bon32JYr.js +1 -0
  73. package/build/assets/manifest-ec000ae3.js +1 -0
  74. package/build/assets/markdown-renderer-BlaJOAI2.js +2 -0
  75. package/build/assets/mcp-CFIpOkn2.js +9 -0
  76. package/build/assets/messages-eRPeR4pW.js +40 -0
  77. package/build/assets/{modal-body-Cc2zp0xb.js → modal-body-Bg9UCeoV.js} +1 -1
  78. package/build/assets/{modal-classes-3qT9Ap7Q.js → modal-classes-H1KbJkeC.js} +1 -1
  79. package/build/assets/{modal-close-button-BcIBUdSq.js → modal-close-button-BMLYvo0C.js} +1 -1
  80. package/build/assets/{model-selector-DJrMrFAr.js → model-selector-BqX2RvEr.js} +1 -1
  81. package/build/assets/{navigation-link-D8hfwvxI.js → navigation-link-DoJzTCEz.js} +1 -1
  82. package/build/assets/onboarding-3KO4qE6R.js +1 -0
  83. package/build/assets/onboarding-modal-D4vqkJeT.js +1 -0
  84. package/build/assets/{organization-service.api-vrRNwOma.js → organization-service.api-CvfQugOt.js} +1 -1
  85. package/build/assets/{path-utils-PNfCKQDV.js → path-utils-DRgexxnX.js} +1 -1
  86. package/build/assets/{plan-components-BdZXPyZU.js → plan-components-qkMiGs_-.js} +1 -1
  87. package/build/assets/{planner-tab-ByOw1he8.js → planner-tab-ZrjiirRr.js} +1 -1
  88. package/build/assets/{plugins-management-service-B75jyC56.js → plugins-management-service-9qT-r_37.js} +1 -1
  89. package/build/assets/plus-CzE1b-wl.js +1 -0
  90. package/build/assets/{profiles-service.api-BQTklD5D.js → profiles-service.api-CRVlrQpT.js} +1 -1
  91. package/build/assets/{providers-DfTB2gPd.js → providers-C2DFGBrf.js} +1 -1
  92. package/build/assets/{proxy-B3tCGf0X.js → proxy-DnnDqkwn.js} +1 -1
  93. package/build/assets/puzzle-IHQnD54C.js +1 -0
  94. package/build/assets/recommended-automations-launcher-B97vgHuN.js +58 -0
  95. package/build/assets/refresh-cw-DxbAs3SK.js +1 -0
  96. package/build/assets/root-BbONavTg.css +1 -0
  97. package/build/assets/root-D01rpqZU.js +2 -0
  98. package/build/assets/root-layout-BiHbCIkS.js +2 -0
  99. package/build/assets/{runtime-waiting-state-CnyVhX4T.js → runtime-waiting-state-CbUV9txX.js} +1 -1
  100. package/build/assets/{schema-field-CUwk4wrQ.js → schema-field-B9-9Ta9u.js} +1 -1
  101. package/build/assets/sdk-section-page-DG1s25Pr.js +1 -0
  102. package/build/assets/{sdk-settings-schema-CLR01YIK.js → sdk-settings-schema-B42JFr5Y.js} +1 -1
  103. package/build/assets/{secrets-service-CvyPWJhg.js → secrets-service-DvyS6-mV.js} +1 -1
  104. package/build/assets/secrets-settings-CeSq6cQw.js +1 -0
  105. package/build/assets/{segmented-toggle-kzwZkLaj.js → segmented-toggle-DRVJBNy0.js} +1 -1
  106. package/build/assets/settings-Dzo0dJKM.js +1 -0
  107. package/build/assets/{settings-mQUckT0g.js → settings-HcwfqMjJ.js} +1 -1
  108. package/build/assets/{settings-dropdown-input-Dhx9ErGd.js → settings-dropdown-input-B6RL_mt0.js} +1 -1
  109. package/build/assets/settings-index-uAKHyijw.js +1 -0
  110. package/build/assets/{settings-input-BsgQWS5R.js → settings-input-ZoaAPNQh.js} +1 -1
  111. package/build/assets/{settings-list-classes-DSJJX99U.js → settings-list-classes-Dr8LgITi.js} +1 -1
  112. package/build/assets/settings-modal-BVX2G_IT.js +1 -0
  113. package/build/assets/{settings-service.api-DXk5TdeJ.js → settings-service.api-BY7ncxIz.js} +1 -1
  114. package/build/assets/{settings-switch-Bes8dIlV.js → settings-switch-DUlGnP0B.js} +1 -1
  115. package/build/assets/{settings-utils-DzCVfiR3.js → settings-utils-kWEEvcdv.js} +1 -1
  116. package/build/assets/shared-conversation-CV4Rtdz2.js +1 -0
  117. package/build/assets/{sidebar-layout-Bm7pa3Vk.js → sidebar-layout-BhGooCga.js} +1 -1
  118. package/build/assets/sidebar-mobile-menu-toggle-BntOJphE.js +1 -0
  119. package/build/assets/{sidebar-nav-link-CHqyFXwV.js → sidebar-nav-link-DkA1XWV8.js} +1 -1
  120. package/build/assets/{sidebar-store-uiUXBU1N.js → sidebar-store-CF3b12-m.js} +1 -1
  121. package/build/assets/{skill-card-pill-row-BPYKQ3IN.js → skill-card-pill-row-_gWe1Tws.js} +1 -1
  122. package/build/assets/skill-icon-badge-C-zbaXbD.js +1 -0
  123. package/build/assets/skills-plugins-BwoXKtrR.js +1 -0
  124. package/build/assets/skills-settings-Crq-fZSt.js +2 -0
  125. package/build/assets/{styled-tooltip-B14i_Uac.js → styled-tooltip-CdnCJ67u.js} +1 -1
  126. package/build/assets/syntax-highlighter-CZK2ab-O.js +1 -0
  127. package/build/assets/{task-list-tab-DyfgG4MC.js → task-list-tab-CONOO9iI.js} +1 -1
  128. package/build/assets/telemetry-CC32dJYW.js +2 -0
  129. package/build/assets/{terminal-DRXt2Lr4.js → terminal-CTkDpIU-.js} +1 -1
  130. package/build/assets/{toggle-switch-DX_k418f.js → toggle-switch-yVIzmJLM.js} +1 -1
  131. package/build/assets/{typography-CzfoD9DY.js → typography-BBVEW0un.js} +1 -1
  132. package/build/assets/{use-acp-credential-form-Bm8qXdlc.js → use-acp-credential-form-CIsp8hJe.js} +1 -1
  133. package/build/assets/use-activate-agent-profile-BfcTTJJG.js +1 -0
  134. package/build/assets/{use-active-agent-profile-hI-x-UBa.js → use-active-agent-profile-CCeFtmk9.js} +1 -1
  135. package/build/assets/{use-active-conversation-2qeez40F.js → use-active-conversation-Badxj8w4.js} +1 -1
  136. package/build/assets/{use-agent-profiles-0pr5bLS7.js → use-agent-profiles-BSWVN6hH.js} +1 -1
  137. package/build/assets/{use-agent-state-C6peDXUm.js → use-agent-state-BzRrhoPd.js} +1 -1
  138. package/build/assets/use-backends-health-BsZikyFW.js +1 -0
  139. package/build/assets/{use-can-manage-org-profiles-Ck_bsNbH.js → use-can-manage-org-profiles-Do6mYf6P.js} +1 -1
  140. package/build/assets/{use-cloud-current-user-id-DUCSxNjY.js → use-cloud-current-user-id-Cx3B_0-w.js} +1 -1
  141. package/build/assets/use-config-D9zUVw5b.js +1 -0
  142. package/build/assets/{use-create-conversation-r1JHfKO5.js → use-create-conversation-vvl0kvu7.js} +1 -1
  143. package/build/assets/{use-create-secret-Cf2N11d2.js → use-create-secret-CB7Dvd4s.js} +1 -1
  144. package/build/assets/use-event-store-BlpSUF7N.js +4 -0
  145. package/build/assets/{use-handle-plan-click-CsAW3FlH.js → use-handle-plan-click-DDZkew9p.js} +1 -1
  146. package/build/assets/use-is-creating-conversation-fxSzN778.js +1 -0
  147. package/build/assets/{use-launch-skill-in-chat-DJWEfVc5.js → use-launch-skill-in-chat-D6_n1fs3.js} +1 -1
  148. package/build/assets/use-llm-profiles-CNQm7HYS.js +1 -0
  149. package/build/assets/use-plugins-marketplace-CloojomS.js +1 -0
  150. package/build/assets/use-runtime-is-ready-Bx_4cfar.js +1 -0
  151. package/build/assets/{use-save-agent-profile-RqUGqTv6.js → use-save-agent-profile-Bj7N-1jS.js} +1 -1
  152. package/build/assets/{use-save-settings-Chvzeu2s.js → use-save-settings-BMsb2wk_.js} +1 -1
  153. package/build/assets/use-settings-B9XEmh7i.js +1 -0
  154. package/build/assets/use-settings-nav-items-BGfBS0yL.js +16 -0
  155. package/build/assets/{use-skills-xrVoKYrF.js → use-skills-CSRbvPle.js} +1 -1
  156. package/build/assets/{use-task-list-CfisapBW.js → use-task-list-CTIVLrQA.js} +1 -1
  157. package/build/assets/use-tracking-DjdCssvp.js +1 -0
  158. package/build/assets/{use-user-conversation-CnE4zhOA.js → use-user-conversation-BCpFn-Ei.js} +1 -1
  159. package/build/assets/{useTranslation-Cbf5AGg_.js → useTranslation-CHm_6BRr.js} +1 -1
  160. package/build/assets/{utils-DB9LsAzA.js → utils-CrRpzbM2.js} +1 -1
  161. package/build/assets/vendor-markdown-DzO4uO_0.js +37 -0
  162. package/build/assets/{vendor~browser-wXQ-WZEC.js → vendor~browser-Byfuq5J-.js} +1 -1
  163. package/build/assets/{vendor~browser-tab-CsMb-pta.js → vendor~browser-tab-BLk3qxhw.js} +1 -1
  164. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-DTJ_cjR5.js} +2 -2
  165. package/build/assets/{vendor~files-tab-B-5fBohe.js → vendor~files-tab-XmnauIZI.js} +1 -1
  166. package/build/assets/{vendor~launch-_Km3J77E.js → vendor~launch-DeC8QhXQ.js} +1 -1
  167. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DDmLzCzm.js} +1 -1
  168. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-YrfJYTQw.js +1 -0
  169. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-DoaS51iW.js} +123 -3
  170. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-DEYwoy8u.js} +1 -1
  171. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-DZHLw5Sr.js +1 -0
  172. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-UJ4BNDJP.js} +1 -1
  173. package/build/assets/{verification-settings-CfkrXoSa.js → verification-settings-uwOfc16F.js} +1 -1
  174. package/build/index.html +4 -4
  175. package/build/locales/ar/openhands.json +38 -4
  176. package/build/locales/ca/openhands.json +38 -4
  177. package/build/locales/de/openhands.json +38 -4
  178. package/build/locales/en/openhands.json +38 -4
  179. package/build/locales/es/openhands.json +38 -4
  180. package/build/locales/fr/openhands.json +38 -4
  181. package/build/locales/it/openhands.json +38 -4
  182. package/build/locales/ja/openhands.json +38 -4
  183. package/build/locales/ko-KR/openhands.json +38 -4
  184. package/build/locales/no/openhands.json +38 -4
  185. package/build/locales/pt/openhands.json +38 -4
  186. package/build/locales/tr/openhands.json +38 -4
  187. package/build/locales/uk/openhands.json +38 -4
  188. package/build/locales/zh-CN/openhands.json +38 -4
  189. package/build/locales/zh-TW/openhands.json +38 -4
  190. package/config/defaults.json +7 -3
  191. package/dist/api/agent-canvas-updates.cjs +2 -0
  192. package/dist/api/agent-canvas-updates.cjs.map +1 -0
  193. package/dist/api/agent-canvas-updates.d.ts +7 -0
  194. package/dist/api/agent-canvas-updates.js +19 -0
  195. package/dist/api/agent-canvas-updates.js.map +1 -0
  196. package/dist/api/agent-server-adapter.cjs +1 -1
  197. package/dist/api/agent-server-adapter.cjs.map +1 -1
  198. package/dist/api/agent-server-adapter.d.ts +3 -0
  199. package/dist/api/agent-server-adapter.js +1 -0
  200. package/dist/api/agent-server-adapter.js.map +1 -1
  201. package/dist/api/agent-server-compatibility.cjs +1 -1
  202. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  203. package/dist/api/agent-server-compatibility.d.ts +5 -0
  204. package/dist/api/agent-server-compatibility.js +24 -15
  205. package/dist/api/agent-server-compatibility.js.map +1 -1
  206. package/dist/api/agent-server-config.cjs +1 -1
  207. package/dist/api/agent-server-config.cjs.map +1 -1
  208. package/dist/api/agent-server-config.js +11 -8
  209. package/dist/api/agent-server-config.js.map +1 -1
  210. package/dist/api/automation-service/automation-service.api.cjs +2 -0
  211. package/dist/api/automation-service/automation-service.api.cjs.map +1 -0
  212. package/dist/api/automation-service/automation-service.api.d.ts +3 -0
  213. package/dist/api/automation-service/automation-service.api.js +283 -0
  214. package/dist/api/automation-service/automation-service.api.js.map +1 -0
  215. package/dist/api/client-source.cjs +1 -1
  216. package/dist/api/client-source.cjs.map +1 -1
  217. package/dist/api/client-source.d.ts +3 -0
  218. package/dist/api/client-source.js +4 -4
  219. package/dist/api/client-source.js.map +1 -1
  220. package/dist/api/cloud/settings-service.api.cjs.map +1 -1
  221. package/dist/api/cloud/settings-service.api.js.map +1 -1
  222. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  223. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  224. package/dist/api/conversation-service/agent-server-conversation-service.api.js +111 -109
  225. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  226. package/dist/api/mcp-health/mcp-health-store.cjs +2 -0
  227. package/dist/api/mcp-health/mcp-health-store.cjs.map +1 -0
  228. package/dist/api/mcp-health/mcp-health-store.d.ts +22 -0
  229. package/dist/api/mcp-health/mcp-health-store.js +45 -0
  230. package/dist/api/mcp-health/mcp-health-store.js.map +1 -0
  231. package/dist/api/mcp-health/probe-mcp-server-health.cjs +2 -0
  232. package/dist/api/mcp-health/probe-mcp-server-health.cjs.map +1 -0
  233. package/dist/api/mcp-health/probe-mcp-server-health.d.ts +31 -0
  234. package/dist/api/mcp-health/probe-mcp-server-health.js +57 -0
  235. package/dist/api/mcp-health/probe-mcp-server-health.js.map +1 -0
  236. package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
  237. package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
  238. package/dist/api/mcp-service/mcp-service.api.js +66 -46
  239. package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
  240. package/dist/api/plugins-management-service.cjs.map +1 -1
  241. package/dist/api/plugins-management-service.d.ts +6 -1
  242. package/dist/api/plugins-management-service.js.map +1 -1
  243. package/dist/api/plugins-service.d.ts +30 -2
  244. package/dist/api/secrets-service.cjs +1 -1
  245. package/dist/api/secrets-service.cjs.map +1 -1
  246. package/dist/api/secrets-service.d.ts +6 -6
  247. package/dist/api/secrets-service.js +8 -3
  248. package/dist/api/secrets-service.js.map +1 -1
  249. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  250. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  251. package/dist/api/settings-service/settings-service.api.d.ts +1 -1
  252. package/dist/api/settings-service/settings-service.api.js +1 -0
  253. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  254. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.cjs +1 -1
  255. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.js +5 -5
  256. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  257. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  258. package/dist/components/features/backends/backend-form-modal.d.ts +4 -1
  259. package/dist/components/features/backends/backend-form-modal.js +15 -16
  260. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  261. package/dist/components/features/backends/backend-selector.cjs +1 -1
  262. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  263. package/dist/components/features/backends/backend-selector.js +103 -102
  264. package/dist/components/features/backends/backend-selector.js.map +1 -1
  265. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  266. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  267. package/dist/components/features/backends/manage-backends-modal.js +85 -73
  268. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  269. package/dist/components/features/chat/chat-interface.cjs +2 -2
  270. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  271. package/dist/components/features/chat/chat-interface.js +131 -129
  272. package/dist/components/features/chat/chat-interface.js.map +1 -1
  273. package/dist/components/features/chat/confirmation-mode-enabled.cjs +1 -1
  274. package/dist/components/features/chat/confirmation-mode-enabled.js +4 -4
  275. package/dist/components/features/chat/skill-install-restart-banner.cjs +2 -0
  276. package/dist/components/features/chat/skill-install-restart-banner.cjs.map +1 -0
  277. package/dist/components/features/chat/skill-install-restart-banner.d.ts +11 -0
  278. package/dist/components/features/chat/skill-install-restart-banner.js +63 -0
  279. package/dist/components/features/chat/skill-install-restart-banner.js.map +1 -0
  280. package/dist/components/features/conversation/right-panel-toggle.cjs +1 -1
  281. package/dist/components/features/conversation/right-panel-toggle.cjs.map +1 -1
  282. package/dist/components/features/conversation/right-panel-toggle.js +1 -1
  283. package/dist/components/features/conversation/right-panel-toggle.js.map +1 -1
  284. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  285. package/dist/components/features/conversation-panel/conversation-panel.js +10 -10
  286. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  287. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  288. package/dist/components/features/mcp-page/custom-server-editor.js +78 -77
  289. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  290. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  291. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  292. package/dist/components/features/mcp-page/install-server-modal.d.ts +4 -1
  293. package/dist/components/features/mcp-page/install-server-modal.js +135 -136
  294. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  295. package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
  296. package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
  297. package/dist/components/features/mcp-page/installed-server-card.js +40 -34
  298. package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
  299. package/dist/components/features/mcp-page/mcp-server-health.cjs +2 -0
  300. package/dist/components/features/mcp-page/mcp-server-health.cjs.map +1 -0
  301. package/dist/components/features/mcp-page/mcp-server-health.d.ts +18 -0
  302. package/dist/components/features/mcp-page/mcp-server-health.js +117 -0
  303. package/dist/components/features/mcp-page/mcp-server-health.js.map +1 -0
  304. package/dist/components/features/plugins/build-plugins-view-model.d.ts +10 -1
  305. package/dist/components/features/plugins/plugin-files-section.d.ts +13 -0
  306. package/dist/components/features/settings/agent-canvas-update-card.cjs +2 -0
  307. package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -0
  308. package/dist/components/features/settings/agent-canvas-update-card.d.ts +7 -0
  309. package/dist/components/features/settings/agent-canvas-update-card.js +170 -0
  310. package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -0
  311. package/dist/components/features/settings/integrations-settings-link.cjs +2 -0
  312. package/dist/components/features/settings/integrations-settings-link.cjs.map +1 -0
  313. package/dist/components/features/settings/integrations-settings-link.d.ts +5 -0
  314. package/dist/components/features/settings/integrations-settings-link.js +41 -0
  315. package/dist/components/features/settings/integrations-settings-link.js.map +1 -0
  316. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  317. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -1
  318. package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
  319. package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
  320. package/dist/components/features/settings/settings-desktop-sidebar.js +31 -21
  321. package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
  322. package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
  323. package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
  324. package/dist/components/features/settings/settings-mobile-drawer.js +40 -30
  325. package/dist/components/features/settings/settings-mobile-drawer.js.map +1 -1
  326. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  327. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  328. package/dist/components/features/skills/extensions-navigation.js +54 -33
  329. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  330. package/dist/config/defaults.cjs +1 -1
  331. package/dist/config/defaults.cjs.map +1 -1
  332. package/dist/config/defaults.js +7 -3
  333. package/dist/config/defaults.js.map +1 -1
  334. package/dist/constants/acp-providers.cjs.map +1 -1
  335. package/dist/constants/acp-providers.js.map +1 -1
  336. package/dist/contexts/conversation-websocket-context.cjs +2 -2
  337. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  338. package/dist/contexts/conversation-websocket-context.js +169 -166
  339. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  340. package/dist/hooks/mutation/use-delete-llm-profile.cjs +1 -1
  341. package/dist/hooks/mutation/use-delete-llm-profile.js +1 -0
  342. package/dist/hooks/mutation/use-delete-mcp-server.cjs +1 -1
  343. package/dist/hooks/mutation/use-delete-mcp-server.cjs.map +1 -1
  344. package/dist/hooks/mutation/use-delete-mcp-server.js +8 -6
  345. package/dist/hooks/mutation/use-delete-mcp-server.js.map +1 -1
  346. package/dist/hooks/mutation/use-rename-llm-profile.cjs +1 -1
  347. package/dist/hooks/mutation/use-rename-llm-profile.js +1 -0
  348. package/dist/hooks/mutation/use-save-settings.cjs +1 -1
  349. package/dist/hooks/mutation/use-save-settings.js +3 -3
  350. package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
  351. package/dist/hooks/mutation/use-update-mcp-server.cjs.map +1 -1
  352. package/dist/hooks/mutation/use-update-mcp-server.js +11 -9
  353. package/dist/hooks/mutation/use-update-mcp-server.js.map +1 -1
  354. package/dist/hooks/query/query-keys.cjs +1 -1
  355. package/dist/hooks/query/query-keys.cjs.map +1 -1
  356. package/dist/hooks/query/query-keys.d.ts +4 -0
  357. package/dist/hooks/query/query-keys.js +2 -2
  358. package/dist/hooks/query/query-keys.js.map +1 -1
  359. package/dist/hooks/query/use-automation-sdk-version.cjs +2 -0
  360. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -0
  361. package/dist/hooks/query/use-automation-sdk-version.d.ts +3 -0
  362. package/dist/hooks/query/use-automation-sdk-version.js +63 -0
  363. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -0
  364. package/dist/hooks/query/use-latest-agent-canvas-version.cjs +2 -0
  365. package/dist/hooks/query/use-latest-agent-canvas-version.cjs.map +1 -0
  366. package/dist/hooks/query/use-latest-agent-canvas-version.d.ts +10 -0
  367. package/dist/hooks/query/use-latest-agent-canvas-version.js +19 -0
  368. package/dist/hooks/query/use-latest-agent-canvas-version.js.map +1 -0
  369. package/dist/hooks/query/use-plugin-file-content.d.ts +7 -0
  370. package/dist/hooks/query/use-resolved-workspaces.cjs +1 -1
  371. package/dist/hooks/query/use-resolved-workspaces.cjs.map +1 -1
  372. package/dist/hooks/query/use-resolved-workspaces.js +25 -26
  373. package/dist/hooks/query/use-resolved-workspaces.js.map +1 -1
  374. package/dist/hooks/query/use-search-subdirs.cjs +1 -1
  375. package/dist/hooks/query/use-search-subdirs.cjs.map +1 -1
  376. package/dist/hooks/query/use-search-subdirs.d.ts +5 -0
  377. package/dist/hooks/query/use-search-subdirs.js +16 -4
  378. package/dist/hooks/query/use-search-subdirs.js.map +1 -1
  379. package/dist/hooks/query/use-task-polling.cjs +1 -1
  380. package/dist/hooks/query/use-task-polling.cjs.map +1 -1
  381. package/dist/hooks/query/use-task-polling.d.ts +19 -3
  382. package/dist/hooks/query/use-task-polling.js +36 -35
  383. package/dist/hooks/query/use-task-polling.js.map +1 -1
  384. package/dist/hooks/use-device-flow.cjs +1 -1
  385. package/dist/hooks/use-device-flow.js +6 -6
  386. package/dist/hooks/use-llm-configured.cjs +1 -1
  387. package/dist/hooks/use-llm-configured.js +3 -3
  388. package/dist/hooks/use-mcp-server-health.cjs +2 -0
  389. package/dist/hooks/use-mcp-server-health.cjs.map +1 -0
  390. package/dist/hooks/use-mcp-server-health.d.ts +11 -0
  391. package/dist/hooks/use-mcp-server-health.js +18 -0
  392. package/dist/hooks/use-mcp-server-health.js.map +1 -0
  393. package/dist/hooks/use-skill-installs.cjs +2 -0
  394. package/dist/hooks/use-skill-installs.cjs.map +1 -0
  395. package/dist/hooks/use-skill-installs.d.ts +10 -0
  396. package/dist/hooks/use-skill-installs.js +21 -0
  397. package/dist/hooks/use-skill-installs.js.map +1 -0
  398. package/dist/hooks/use-tracking.cjs +1 -1
  399. package/dist/hooks/use-tracking.cjs.map +1 -1
  400. package/dist/hooks/use-tracking.d.ts +3 -3
  401. package/dist/hooks/use-tracking.js +67 -52
  402. package/dist/hooks/use-tracking.js.map +1 -1
  403. package/dist/i18n/declaration.cjs +1 -1
  404. package/dist/i18n/declaration.cjs.map +1 -1
  405. package/dist/i18n/declaration.d.ts +35 -1
  406. package/dist/i18n/declaration.js +1 -1
  407. package/dist/i18n/declaration.js.map +1 -1
  408. package/dist/i18n/translation.cjs +3 -3
  409. package/dist/i18n/translation.cjs.map +1 -1
  410. package/dist/i18n/translation.js +623 -45
  411. package/dist/i18n/translation.js.map +1 -1
  412. package/dist/index.cjs +1 -1
  413. package/dist/index.js +1 -2
  414. package/dist/lib/index.cjs +1 -1
  415. package/dist/lib/index.d.ts +0 -1
  416. package/dist/lib/index.js +0 -1
  417. package/dist/locales/ar/openhands.json +38 -4
  418. package/dist/locales/ca/openhands.json +38 -4
  419. package/dist/locales/de/openhands.json +38 -4
  420. package/dist/locales/en/openhands.json +38 -4
  421. package/dist/locales/es/openhands.json +38 -4
  422. package/dist/locales/fr/openhands.json +38 -4
  423. package/dist/locales/it/openhands.json +38 -4
  424. package/dist/locales/ja/openhands.json +38 -4
  425. package/dist/locales/ko-KR/openhands.json +38 -4
  426. package/dist/locales/no/openhands.json +38 -4
  427. package/dist/locales/pt/openhands.json +38 -4
  428. package/dist/locales/tr/openhands.json +38 -4
  429. package/dist/locales/uk/openhands.json +38 -4
  430. package/dist/locales/zh-CN/openhands.json +38 -4
  431. package/dist/locales/zh-TW/openhands.json +38 -4
  432. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.cjs +2 -0
  433. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.cjs.map +1 -0
  434. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.js +44 -0
  435. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian-rovo.js.map +1 -0
  436. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
  437. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
  438. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +13 -0
  439. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
  440. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +1 -1
  441. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -1
  442. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +21 -1
  443. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -1
  444. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs +1 -1
  445. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -1
  446. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js +1 -1
  447. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -1
  448. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs +1 -1
  449. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.cjs.map +1 -1
  450. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js +13 -0
  451. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-outlook.js.map +1 -1
  452. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs +1 -1
  453. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.cjs.map +1 -1
  454. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js +13 -0
  455. package/dist/node_modules/@openhands/extensions/integrations/catalog/microsoft-teams.js.map +1 -1
  456. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +1 -1
  457. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -1
  458. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +13 -0
  459. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
  460. package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs +1 -1
  461. package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.cjs.map +1 -1
  462. package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js +13 -0
  463. package/dist/node_modules/@openhands/extensions/integrations/catalog/onedrive.js.map +1 -1
  464. package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs +1 -1
  465. package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.cjs.map +1 -1
  466. package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js +13 -0
  467. package/dist/node_modules/@openhands/extensions/integrations/catalog/sharepoint.js.map +1 -1
  468. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +1 -1
  469. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -1
  470. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +16 -2
  471. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -1
  472. package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.cjs +2 -0
  473. package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.cjs.map +1 -0
  474. package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.js +46 -0
  475. package/dist/node_modules/@openhands/extensions/integrations/catalog/vanta.js.map +1 -0
  476. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  477. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  478. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +74 -70
  479. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  480. package/dist/node_modules/@openhands/extensions/skills/index.cjs +123 -3
  481. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  482. package/dist/node_modules/@openhands/extensions/skills/index.js +7 -1
  483. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  484. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +2 -0
  485. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +1 -0
  486. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +9 -0
  487. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +1 -0
  488. package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs +2 -0
  489. package/dist/node_modules/lucide-react/dist/esm/icons/info.cjs.map +1 -0
  490. package/dist/node_modules/lucide-react/dist/esm/icons/info.js +21 -0
  491. package/dist/node_modules/lucide-react/dist/esm/icons/info.js.map +1 -0
  492. package/dist/package.cjs +1 -1
  493. package/dist/package.cjs.map +1 -1
  494. package/dist/package.js +10 -3
  495. package/dist/package.js.map +1 -1
  496. package/dist/routes/app-settings.cjs +1 -1
  497. package/dist/routes/app-settings.cjs.map +1 -1
  498. package/dist/routes/app-settings.js +113 -67
  499. package/dist/routes/app-settings.js.map +1 -1
  500. package/dist/routes/conversation.cjs +1 -1
  501. package/dist/routes/conversation.cjs.map +1 -1
  502. package/dist/routes/conversation.js +1 -1
  503. package/dist/routes/conversation.js.map +1 -1
  504. package/dist/routes/mcp.cjs +1 -1
  505. package/dist/routes/mcp.cjs.map +1 -1
  506. package/dist/routes/mcp.js +1 -0
  507. package/dist/routes/mcp.js.map +1 -1
  508. package/dist/services/cloud-funnel-analytics.cjs +1 -1
  509. package/dist/services/cloud-funnel-analytics.cjs.map +1 -1
  510. package/dist/services/cloud-funnel-analytics.d.ts +2 -2
  511. package/dist/services/cloud-funnel-analytics.js +18 -16
  512. package/dist/services/cloud-funnel-analytics.js.map +1 -1
  513. package/dist/services/settings.cjs +1 -1
  514. package/dist/services/settings.cjs.map +1 -1
  515. package/dist/services/settings.js +1 -0
  516. package/dist/services/settings.js.map +1 -1
  517. package/dist/services/telemetry-context.cjs +2 -0
  518. package/dist/services/telemetry-context.cjs.map +1 -0
  519. package/dist/services/telemetry-context.d.ts +17 -0
  520. package/dist/services/telemetry-context.js +27 -0
  521. package/dist/services/telemetry-context.js.map +1 -0
  522. package/dist/services/telemetry.cjs +1 -1
  523. package/dist/services/telemetry.cjs.map +1 -1
  524. package/dist/services/telemetry.d.ts +7 -5
  525. package/dist/services/telemetry.js +132 -123
  526. package/dist/services/telemetry.js.map +1 -1
  527. package/dist/stores/skill-install-banner-store.cjs +2 -0
  528. package/dist/stores/skill-install-banner-store.cjs.map +1 -0
  529. package/dist/stores/skill-install-banner-store.d.ts +32 -0
  530. package/dist/stores/skill-install-banner-store.js +14 -0
  531. package/dist/stores/skill-install-banner-store.js.map +1 -0
  532. package/dist/stores/use-event-store.cjs +1 -1
  533. package/dist/stores/use-event-store.cjs.map +1 -1
  534. package/dist/stores/use-event-store.js +35 -35
  535. package/dist/stores/use-event-store.js.map +1 -1
  536. package/dist/types/mcp-health.cjs +2 -0
  537. package/dist/types/mcp-health.cjs.map +1 -0
  538. package/dist/types/mcp-health.d.ts +21 -0
  539. package/dist/types/mcp-health.js +6 -0
  540. package/dist/types/mcp-health.js.map +1 -0
  541. package/dist/types/settings.d.ts +1 -0
  542. package/dist/utils/handle-event-for-ui.cjs +1 -1
  543. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  544. package/dist/utils/handle-event-for-ui.d.ts +5 -0
  545. package/dist/utils/handle-event-for-ui.js +71 -57
  546. package/dist/utils/handle-event-for-ui.js.map +1 -1
  547. package/dist/utils/mcp-credential-validation.cjs +1 -1
  548. package/dist/utils/mcp-credential-validation.cjs.map +1 -1
  549. package/dist/utils/mcp-credential-validation.js +32 -16
  550. package/dist/utils/mcp-credential-validation.js.map +1 -1
  551. package/dist/utils/mcp-server-health-key.cjs +2 -0
  552. package/dist/utils/mcp-server-health-key.cjs.map +1 -0
  553. package/dist/utils/mcp-server-health-key.d.ts +16 -0
  554. package/dist/utils/mcp-server-health-key.js +23 -0
  555. package/dist/utils/mcp-server-health-key.js.map +1 -0
  556. package/dist/utils/mcp-test-error-message.cjs +2 -0
  557. package/dist/utils/mcp-test-error-message.cjs.map +1 -0
  558. package/dist/utils/mcp-test-error-message.d.ts +8 -0
  559. package/dist/utils/mcp-test-error-message.js +14 -0
  560. package/dist/utils/mcp-test-error-message.js.map +1 -0
  561. package/dist/utils/redact-mcp-secrets.cjs +2 -0
  562. package/dist/utils/redact-mcp-secrets.cjs.map +1 -0
  563. package/dist/utils/redact-mcp-secrets.d.ts +13 -0
  564. package/dist/utils/redact-mcp-secrets.js +57 -0
  565. package/dist/utils/redact-mcp-secrets.js.map +1 -0
  566. package/dist/utils/settings-utils.cjs.map +1 -1
  567. package/dist/utils/settings-utils.js.map +1 -1
  568. package/dist/utils/skill-install-events.cjs +3 -0
  569. package/dist/utils/skill-install-events.cjs.map +1 -0
  570. package/dist/utils/skill-install-events.d.ts +16 -0
  571. package/dist/utils/skill-install-events.js +26 -0
  572. package/dist/utils/skill-install-events.js.map +1 -0
  573. package/dist/utils/title-llm-profile.cjs +2 -0
  574. package/dist/utils/title-llm-profile.cjs.map +1 -0
  575. package/dist/utils/title-llm-profile.d.ts +2 -0
  576. package/dist/utils/title-llm-profile.js +11 -0
  577. package/dist/utils/title-llm-profile.js.map +1 -0
  578. package/package.json +10 -3
  579. package/scripts/check-sdk-version-sync.mjs +6 -6
  580. package/scripts/check-translation-completeness.cjs +2 -0
  581. package/scripts/dev-process-utils.mjs +62 -1
  582. package/scripts/dev-safe.mjs +2 -2
  583. package/scripts/dev-static.mjs +5 -3
  584. package/scripts/dev-with-automation.mjs +98 -14
  585. package/scripts/download-node.mjs +382 -0
  586. package/scripts/download-uv.mjs +204 -0
  587. package/scripts/logger.mjs +64 -35
  588. package/build/assets/agent-server-compatibility-BWN-EIQn.js +0 -1
  589. package/build/assets/agent-server-conversation-service.api-DSPIkMwJ.js +0 -41
  590. package/build/assets/agent-settings-CgCnqaAA.js +0 -2
  591. package/build/assets/agent-settings-DDkSavD7.js +0 -1
  592. package/build/assets/api-key-entry-screen-iZc7n8AI.js +0 -1
  593. package/build/assets/app-settings-B5zyipxJ.js +0 -1
  594. package/build/assets/automation-export-BwRX6H32.js +0 -2
  595. package/build/assets/automations-list-lHAVzMoA.js +0 -1
  596. package/build/assets/backend-form-modal-RGcu909r.js +0 -1
  597. package/build/assets/browser-store-BI6uklCG.js +0 -1
  598. package/build/assets/chat-send-button-BZHG2hAW.js +0 -1
  599. package/build/assets/client-source-BZK8vRs2.js +0 -1
  600. package/build/assets/cloud-funnel-analytics-Zcv57hfT.js +0 -1
  601. package/build/assets/conversation-BoCYx8n2.js +0 -89
  602. package/build/assets/conversation-DgHqMjnY.js +0 -1
  603. package/build/assets/conversation-panel-78Rxh_-I.js +0 -1
  604. package/build/assets/conversation-state-store-B2Bp32XI.js +0 -1
  605. package/build/assets/declaration-BGsHjPEW.js +0 -1
  606. package/build/assets/extensions-hub-CCbLA7IM.js +0 -1
  607. package/build/assets/extensions-navigation-CPNjMNvR.js +0 -1
  608. package/build/assets/files-tab-store-DJsPxYdg.js +0 -1
  609. package/build/assets/files-tab-y4K7EXBO.js +0 -1
  610. package/build/assets/git-provider-icon-ITvsH4Ko.js +0 -1
  611. package/build/assets/home-BwbeOWwU.js +0 -1
  612. package/build/assets/home-DKPGQ5P3.js +0 -1
  613. package/build/assets/index-home-Bko2Itv5.js +0 -1
  614. package/build/assets/install-server-modal-Qk1gwyI8.js +0 -1
  615. package/build/assets/lesson-plan-DMCPdtrf.js +0 -4
  616. package/build/assets/llm-not-configured-banner-C1ktyb3C.js +0 -27
  617. package/build/assets/llm-settings-BBsZFi9l.js +0 -1
  618. package/build/assets/llm-settings-DFkJQr_w.js +0 -1
  619. package/build/assets/manage-backends-modal-CKQ46rvw.js +0 -1
  620. package/build/assets/manifest-03478bbf.js +0 -1
  621. package/build/assets/markdown-renderer-B4V2OMFP.js +0 -2
  622. package/build/assets/mcp-BapoJsDc.js +0 -9
  623. package/build/assets/messages-CUBFMY5o.js +0 -40
  624. package/build/assets/objectWithoutPropertiesLoose-BgYIAs2y.js +0 -1
  625. package/build/assets/onboarding-6NMkdNxV.js +0 -1
  626. package/build/assets/onboarding-modal-Q4AnpIdg.js +0 -1
  627. package/build/assets/recommended-automations-launcher-Bj7PuHY1.js +0 -58
  628. package/build/assets/refresh-cw-B9B7-vsy.js +0 -1
  629. package/build/assets/root-CDnuTToz.js +0 -2
  630. package/build/assets/root-CYWeTrWE.css +0 -1
  631. package/build/assets/root-layout-DfYVlcRG.js +0 -2
  632. package/build/assets/sdk-section-page-DLLNrYjI.js +0 -1
  633. package/build/assets/secrets-settings-CHy72A5C.js +0 -1
  634. package/build/assets/settings-B9S8UVQr.js +0 -1
  635. package/build/assets/settings-index-BKDl2CQ-.js +0 -1
  636. package/build/assets/settings-modal-DeK11CyT.js +0 -1
  637. package/build/assets/shared-conversation-9atDzTR4.js +0 -1
  638. package/build/assets/sidebar-mobile-menu-toggle-giMMZctn.js +0 -1
  639. package/build/assets/skills-plugins-Tropusio.js +0 -1
  640. package/build/assets/skills-settings-BvzBBCWk.js +0 -2
  641. package/build/assets/telemetry-C5JMEfqB.js +0 -2
  642. package/build/assets/use-activate-agent-profile-DlykqEfN.js +0 -1
  643. package/build/assets/use-backends-health-CLHPitJM.js +0 -1
  644. package/build/assets/use-config-B5r8erYt.js +0 -1
  645. package/build/assets/use-event-store-Bbaz51GR.js +0 -4
  646. package/build/assets/use-llm-profiles-Dr5__SlZ.js +0 -1
  647. package/build/assets/use-plugins-marketplace-BplU65ae.js +0 -1
  648. package/build/assets/use-runtime-is-ready-vCFOcLFa.js +0 -1
  649. package/build/assets/use-settings-CyxSlyTQ.js +0 -1
  650. package/build/assets/use-settings-nav-items-zEkSO_Bf.js +0 -16
  651. package/build/assets/use-tracking-D2Qg5Lpd.js +0 -1
  652. package/build/assets/useMutationState-OnAsCLA_.js +0 -1
  653. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD7v71DM.js +0 -2
  654. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BT05Osu4.js +0 -28
  655. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-COhHANvV.js +0 -2
  656. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DgzWSMRc.js +0 -2
  657. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DqZatR3B.js +0 -7
  658. package/build/assets/vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-FghQ3Z1a.js +0 -1
  659. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js +0 -1
  660. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js +0 -1
  661. package/dist/components/features/analytics/telemetry-consent-banner.cjs +0 -2
  662. package/dist/components/features/analytics/telemetry-consent-banner.cjs.map +0 -1
  663. package/dist/components/features/analytics/telemetry-consent-banner.d.ts +0 -29
  664. package/dist/components/features/analytics/telemetry-consent-banner.js +0 -59
  665. package/dist/components/features/analytics/telemetry-consent-banner.js.map +0 -1
  666. /package/build/assets/{__vite-browser-external-BQUj0sYu.js → __vite-browser-external-CKHVBTNC.js} +0 -0
  667. /package/build/assets/{agent-server-ui-style-scope-qhnhZHBV.js → agent-server-ui-style-scope-BvSa9on7.js} +0 -0
  668. /package/build/assets/{automation-LZB0MjdV.js → automation-BGiPmxFR.js} +0 -0
  669. /package/build/assets/{canvas-ui-COgjltGz.js → canvas-ui-CC4EJo-H.js} +0 -0
  670. /package/build/assets/{checkmark-h7udgXMM.js → checkmark-ygQB1AtV.js} +0 -0
  671. /package/build/assets/{close-DLFb5kfv.js → close-BjSA0HWT.js} +0 -0
  672. /package/build/assets/{code-tag-DYlAhEQY.js → code-tag-D9aPPbOe.js} +0 -0
  673. /package/build/assets/{common-CxbUL3nR.js → common-CCuqQy_S.js} +0 -0
  674. /package/build/assets/{conversation-local-storage-F6zVMM--.js → conversation-local-storage-BDjWPg0Z.js} +0 -0
  675. /package/build/assets/{copy-BLmGeJcd.js → copy-Dce7sOvS.js} +0 -0
  676. /package/build/assets/{copy-D1YGjP-C.js → copy-iPJAncAj.js} +0 -0
  677. /package/build/assets/{dist-CodhvuAP.js → dist-D9PhjOaq.js} +0 -0
  678. /package/build/assets/{environment-switch-store-DkjlKWzN.js → environment-switch-store-DHfcz4M4.js} +0 -0
  679. /package/build/assets/{extension-module-card-classes-9V3J9J_b.js → extension-module-card-classes-BpebKiN6.js} +0 -0
  680. /package/build/assets/{external-link-lhdITPqq.js → external-link-CpPMXxrV.js} +0 -0
  681. /package/build/assets/{folder-Bk311brm.js → folder-BabbYnbF.js} +0 -0
  682. /package/build/assets/{format-time-delta-DhDbkD7V.js → format-time-delta-BkAmJEPT.js} +0 -0
  683. /package/build/assets/{get-language-from-path-DBqBsCWH.js → get-language-from-path-CPNnuVhI.js} +0 -0
  684. /package/build/assets/{git-status-mapper-DnL9OC8_.js → git-status-mapper-BIXK0AAG.js} +0 -0
  685. /package/build/assets/{iconBase-Dz51Zn5x.js → iconBase-Ch-fOe8B.js} +0 -0
  686. /package/build/assets/{link-external-CaBmUEs_.js → link-external-DfKQroKX.js} +0 -0
  687. /package/build/assets/{list-todo-CAtvkzcy.js → list-todo-6J6zc8oS.js} +0 -0
  688. /package/build/assets/{llm-subscription-DtsX5Lhg.js → llm-subscription-Bvu8BLXc.js} +0 -0
  689. /package/build/assets/{loader-circle-CsAsfLIs.js → loader-circle-DGsqG5qw.js} +0 -0
  690. /package/build/assets/{map-provider-BbIb12oh.js → map-provider-BSvXvVR0.js} +0 -0
  691. /package/build/assets/{middleware-DYHYNAnP.js → middleware-_izt7V6U.js} +0 -0
  692. /package/build/assets/{modal-backdrop-zVwfOJZr.js → modal-backdrop-B7H42xHG.js} +0 -0
  693. /package/build/assets/{navigation-context-DPs2G0X8.js → navigation-context-cvyvI1WA.js} +0 -0
  694. /package/build/assets/{openhands-logo-bcNw5bkY.js → openhands-logo-pEw0nKFP.js} +0 -0
  695. /package/build/assets/{pencil-CWhApFIT.js → pencil-DmSqWUA3.js} +0 -0
  696. /package/build/assets/{react-DPDgL6du.js → react-MKQOkha9.js} +0 -0
  697. /package/build/assets/{search-BgOCR7_c.js → search-B5D5EuSn.js} +0 -0
  698. /package/build/assets/{search-dIQ09UY2.js → search-vnYL5jwV.js} +0 -0
  699. /package/build/assets/{settings-gear-MXCyZW0x.js → settings-gear-BOwF59Bs.js} +0 -0
  700. /package/build/assets/{settings-section-header-context-COMOIaxV.js → settings-section-header-context-CGgHZXrf.js} +0 -0
  701. /package/build/assets/{skills-EqzxYBvT.js → skills-arUOHLcS.js} +0 -0
  702. /package/build/assets/{square-chevron-right-DE-JN-2Z.js → square-chevron-right-EizCGtgq.js} +0 -0
  703. /package/build/assets/{switch-skeleton-DqQwalyu.js → switch-skeleton-BjPRx1QD.js} +0 -0
  704. /package/build/assets/{terminal-Cgf___rK.js → terminal-a57bHgZs.js} +0 -0
  705. /package/build/assets/{trash-2-BU6BlW4i.js → trash-2-CF3hilrY.js} +0 -0
  706. /package/build/assets/{u-check-circle-BqoIxNz_.js → u-check-circle-WGqHdtfO.js} +0 -0
  707. /package/build/assets/{u-check-circle-half-MsShT8Ec.js → u-check-circle-half-LiwZkuFe.js} +0 -0
  708. /package/build/assets/{u-edit-DL5LgKon.js → u-edit-BwHepAPi.js} +0 -0
  709. /package/build/assets/{use-breakpoint-BP3lqLMx.js → use-breakpoint-B-O0lQ84.js} +0 -0
  710. /package/build/assets/{use-click-outside-element-D9BYdANT.js → use-click-outside-element-DLQIMQrz.js} +0 -0
  711. /package/build/assets/{use-is-authed-BezEyfeh.js → use-is-authed-BSeo4coy.js} +0 -0
  712. /package/build/assets/{use-onboarding-completion-C_Swglzp.js → use-onboarding-completion-C0hPNGpw.js} +0 -0
  713. /package/build/assets/{v4-DbCkTSoU.js → v4-q4yWTlMz.js} +0 -0
  714. /package/build/assets/{vendor~browser-By2MVv_N.js → vendor~browser-UwB1jbAZ.js} +0 -0
  715. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-CxfzCmkN.js → vendor~conversation-panel~conversation~alert-banner-DHDkknt5.js} +0 -0
  716. /package/build/assets/{vendor~index-home~home~conversation-panel~conversation-ChmYLVgz.js → vendor~index-home~home~conversation-panel~conversation-Bff9cq5J.js} +0 -0
  717. /package/build/assets/{vendor~module-D5a_AClf.js → vendor~module-D4DeFV4J.js} +0 -0
  718. /package/build/assets/{vendor~terminal-CnKZILnC.js → vendor~terminal-B7Eiak0-.js} +0 -0
  719. /package/build/assets/{x-ZE4iplpF.js → x-DQB_00VJ.js} +0 -0
  720. /package/build/assets/{x-mark-Batp6gXa.js → x-mark-B32XuEwS.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"agent-server-conversation-service.api.cjs","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDir,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n initialUserMsg?: string,\n conversationInstructions?: string,\n plugins?: PluginSpec[],\n metadata?: ConversationMetadata | null,\n workingDirOverride?: string,\n workspaceMode?: WorkspaceMode,\n parentConversationId?: string,\n agentType?: \"default\" | \"plan\",\n sandboxId?: string,\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string,\n agentProfileKind?: AgentKind,\n ): Promise<AppConversationStartTask> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n };\n return createCloudAppConversation(request);\n }\n\n const settings = await SettingsService.getSettings();\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n const workingDir = await resolveAbsoluteAgentServerPath(\n workingDirOverride ?? buildConversationWorkingDir(conversationId),\n );\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).createConversation<DirectConversationInfo>(payload);\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n const active = getActiveBackend().backend;\n\n type RawRuntime = DirectConversationInfo & {\n stats?: RuntimeConversationInfo[\"stats\"];\n };\n\n // Cloud mode: route through the cloud-proxy to the runtime sandbox at\n // the conversation's runtime URL — same pattern as getVSCodeUrl. Local\n // mode forwards conversationUrl so the host explicitly resolves to the\n // conversation's runtime instead of falling back to the active backend.\n const response =\n active.kind === \"cloud\" && conversationUrl\n ? await callCloudProxy<RawRuntime>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}`,\n authMode: \"session-api-key\",\n sessionApiKey,\n })\n : await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<RawRuntime>(conversationId);\n const data = requireDirectConversationInfo(response);\n const stats = isRecord(response) ? response.stats : null;\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: isRecord(stats) ? stats : { usage_to_metrics: {} },\n };\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Only valid once an ACP session exists (after the first message); the\n * agent-server returns 409 before then — the home/no-session default is\n * persisted via Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":"gtCAuEA,IAAM,EAAiC,2BACjC,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,EAAsC,CAGzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EAAa,EAAwB,CAC5C,OAAO,OAAO,GAAU,SAAW,EAAQ,EAG7C,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EACP,EACA,EACA,EACQ,CACR,IAAM,EAAQ,EAAK,IAAa,EAAK,GACrC,OAAO,OAAO,GAAU,UAAY,EAAM,MAAM,CAC5C,EACA,EAGN,SAAS,EACP,EACgE,CAGhE,OAFK,EAAS,EAAM,CAEb,CACL,cAAe,EAAa,EAAM,cAAc,CAChD,kBAAmB,EAAa,EAAM,kBAAkB,CACxD,kBAAmB,EAAa,EAAM,kBAAkB,CACxD,mBAAoB,EAAa,EAAM,mBAAmB,CAC1D,eAAgB,EAAa,EAAM,eAAe,CAClD,eAAgB,EAAa,EAAM,eAAe,CACnD,CAT4B,KAY/B,SAAS,EAAiB,EAAwC,CAGhE,OAFK,EAAS,EAAM,CAEb,CACL,iBAAkB,EAAa,EAAM,iBAAiB,CACtD,oBAAqB,EAAa,EAAM,oBAAoB,CAC5D,wBAAyB,EAAoB,EAAM,wBAAwB,CAC5E,CAN4B,KAS/B,SAAS,EAAe,EAAiD,CACvE,GAAI,CAAC,EAAS,EAAM,CAAE,OAAO,KAC7B,IAAM,EAAM,EAAS,EAAM,IAAI,CAC3B,CAAE,MAAO,EAAa,EAAM,IAAI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AAQ,OAAO,MAAQ,GACpE,GAAI,CAAC,EAAO,MAAU,MAAM,YAAY,EAAY,iBAAiB,CACrE,MAAM,EAAA,4BAA4B,CAAE,IAAK,EAAQ,OAAQ,CAAC,CAC1D,MAAM,EAAmB,UAAU,EAAgB,CACjD,GAAG,EAAQ,OACX,QAGA,OAAQ,GAER,SAAU,WAAW,EAAY,GAAG,EAAA,SAAQ,GAC7C,CAAc,CAcjB,aAAa,eACX,EACA,EACe,CACf,GAAM,CAAE,WAAY,EAAA,kBAAkB,CACtC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,QAAO,CAChB,CAAC,CACF,OAGF,MAAM,IAAI,EAAA,mBAAmB,EAAA,6BAA6B,CAAC,CAAC,eAC1D,EACA,EACD"}
1
+ {"version":3,"file":"agent-server-conversation-service.api.cjs","names":[],"sources":["../../../src/api/conversation-service/agent-server-conversation-service.api.ts"],"sourcesContent":["import {\n ConversationSortOrder,\n type ForkConversationRequest,\n type LLMConfig,\n} from \"@openhands/typescript-client\";\nimport {\n ConversationClient,\n FileClient,\n ProfilesClient,\n VSCodeClient,\n} from \"@openhands/typescript-client/clients\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { AgentKind, Provider } from \"#/types/settings\";\nimport type { ConversationRuntimeContext } from \"#/api/conversation-file-upload.api\";\nimport { buildHttpBaseUrl } from \"#/utils/websocket-url\";\nimport {\n buildConversationWorkingDir,\n getAgentServerWorkingDir,\n} from \"../agent-server-config\";\nimport { resolveAbsoluteAgentServerPath } from \"../agent-server-home\";\nimport {\n getActiveBackend,\n getEffectiveLocalBackend,\n} from \"../backend-registry/active-store\";\nimport { callCloudProxy } from \"../cloud/proxy\";\nimport ProfilesService from \"../profiles-service/profiles-service.api\";\nimport {\n batchGetCloudConversations,\n createCloudAppConversation,\n deleteCloudConversation,\n downloadCloudConversation,\n getCloudAppConversationStartTask,\n readCloudConversationFile,\n searchCloudConversations,\n updateCloudConversationPublicFlag,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n emptyHooksResponse,\n getDefaultConversationTitle,\n toAppConversation,\n toConversationPage,\n} from \"../agent-server-adapter\";\nimport { GetVSCodeUrlResponse } from \"../open-hands.types\";\nimport {\n getAgentServerClientOptions,\n NoBackendAvailableError,\n} from \"../agent-server-client-options\";\nimport SettingsService from \"../settings-service/settings-service.api\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport { resolveTitleLlmProfile } from \"#/utils/title-llm-profile\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n SendMessageRequest,\n SendMessageResponse,\n} from \"./agent-server-conversation-service.types\";\n\nconst DEFAULT_CONVERSATION_TIMESTAMP = \"1970-01-01T00:00:00.000Z\";\n// Creating the first conversation right after a cold agent-server boot (fresh\n// machine or the packaged desktop app, where uvx may still be warming caches)\n// can exceed the client's 60s default timeout.\nconst CREATE_CONVERSATION_TIMEOUT_MS = 5 * 60 * 1000;\nconst INVALID_CONVERSATION_RESPONSE_MESSAGE =\n \"Unable to load conversations because the selected agent server returned \" +\n \"data this UI does not understand. Check the backend URL/session key and \" +\n \"update the agent server if needed.\";\nfunction invalidConversationResponse(): Error {\n return new Error(INVALID_CONVERSATION_RESPONSE_MESSAGE);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction numberOrNull(value: unknown): number | null {\n return typeof value === \"number\" ? value : null;\n}\n\nfunction numberOrZero(value: unknown): number {\n return typeof value === \"number\" ? value : 0;\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nfunction readTimestamp(\n item: Record<string, unknown>,\n snakeKey: \"created_at\" | \"updated_at\",\n camelKey: \"createdAt\" | \"updatedAt\",\n): string {\n const value = item[snakeKey] ?? item[camelKey];\n return typeof value === \"string\" && value.trim()\n ? value\n : DEFAULT_CONVERSATION_TIMESTAMP;\n}\n\nfunction normalizeTokenUsage(\n value: unknown,\n): NonNullable<MetricsSnapshot[\"accumulated_token_usage\"]> | null {\n if (!isRecord(value)) return null;\n\n return {\n prompt_tokens: numberOrZero(value.prompt_tokens),\n completion_tokens: numberOrZero(value.completion_tokens),\n cache_read_tokens: numberOrZero(value.cache_read_tokens),\n cache_write_tokens: numberOrZero(value.cache_write_tokens),\n context_window: numberOrZero(value.context_window),\n per_turn_token: numberOrZero(value.per_turn_token),\n };\n}\n\nfunction normalizeMetrics(value: unknown): MetricsSnapshot | null {\n if (!isRecord(value)) return null;\n\n return {\n accumulated_cost: numberOrNull(value.accumulated_cost),\n max_budget_per_task: numberOrNull(value.max_budget_per_task),\n accumulated_token_usage: normalizeTokenUsage(value.accumulated_token_usage),\n };\n}\n\nfunction normalizeAgent(value: unknown): DirectConversationInfo[\"agent\"] {\n if (!isRecord(value)) return null;\n const llm = isRecord(value.llm)\n ? { model: stringOrNull(value.llm.model) }\n : null;\n // ``kind`` is the SDK's pydantic discriminator (``\"Agent\"`` vs ``\"ACPAgent\"``);\n // ``toAppConversation`` reads it to derive ``agent_kind``. ``acp_server`` is\n // the ACP provider identity (``ACPAgent.acp_server``, SDK #3692) — required so\n // the adapter can source the chip + in-conversation model list from the agent\n // when the ``acpserver`` tag is absent (a profile launch doesn't stamp it,\n // #1571). ``acp_model`` is the Canvas-configured model — preserved so the chip\n // can fall back to it when the SDK runtime model fields aren't populated.\n // Preserving these makes the wire path agree with the unit-test path that\n // builds ``DirectConversationInfo`` directly\n // (e.g. ``__tests__/api/agent-server-adapter.test.ts``).\n return {\n kind: stringOrNull(value.kind),\n acp_server: stringOrNull(value.acp_server),\n acp_model: stringOrNull(value.acp_model),\n llm,\n };\n}\n\nfunction normalizeWorkspace(\n value: unknown,\n): DirectConversationInfo[\"workspace\"] {\n if (!isRecord(value)) return null;\n return { working_dir: stringOrNull(value.working_dir) };\n}\n\n/**\n * Accept the agent-server's ``tags: Record[str, str]`` payload defensively:\n * the wire shape is guaranteed by the server-side validator (keys\n * ``^[a-z0-9]+$``, string values), but a non-conforming response (older\n * server, raw API write, future schema drift) must never crash the parser\n * — Canvas only consumes ``acpserver`` and falls back to a generic chip\n * for anything it doesn't recognize. Drop entries whose value isn't a\n * plain string; return ``null`` when the wire field is absent or not an\n * object so consumers can use ``info.tags?.[KEY] ?? null`` uniformly.\n */\nfunction normalizeTags(value: unknown): Record<string, string> | null {\n if (!isRecord(value)) return null;\n const tags: Record<string, string> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (typeof entry === \"string\") {\n tags[key] = entry;\n }\n }\n return tags;\n}\n\nfunction normalizeLaunchedAgentProfile(\n value: unknown,\n): DirectConversationInfo[\"launched_agent_profile\"] {\n if (!isRecord(value)) return null;\n const { agent_profile_id: agentProfileId, revision } = value;\n if (typeof agentProfileId !== \"string\" || typeof revision !== \"number\") {\n return null;\n }\n return { agent_profile_id: agentProfileId, revision };\n}\n\nfunction normalizeAbsolutePath(path: string): string | null {\n if (!path.startsWith(\"/\")) return null;\n\n const segments: string[] = [];\n for (const segment of path.split(\"/\")) {\n if (segment && segment !== \".\") {\n if (segment === \"..\") {\n if (!segments.length) return null;\n segments.pop();\n } else {\n segments.push(segment);\n }\n }\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction requirePathInsideDirectory(path: string, directory: string): string {\n const normalizedPath = normalizeAbsolutePath(path);\n const normalizedDirectory = normalizeAbsolutePath(directory);\n\n if (\n !normalizedPath ||\n !normalizedDirectory ||\n (normalizedPath !== normalizedDirectory &&\n !normalizedPath.startsWith(`${normalizedDirectory}/`))\n ) {\n throw new Error(\"Conversation file path must stay inside the workspace\");\n }\n\n return normalizedPath;\n}\n\nfunction requireDirectConversationInfo(item: unknown): DirectConversationInfo {\n if (!isRecord(item) || typeof item.id !== \"string\" || !item.id.trim()) {\n throw invalidConversationResponse();\n }\n\n return {\n id: item.id.trim(),\n title: stringOrNull(item.title),\n created_at: readTimestamp(item, \"created_at\", \"createdAt\"),\n updated_at: readTimestamp(item, \"updated_at\", \"updatedAt\"),\n execution_status: stringOrNull(item.execution_status),\n sandbox_status: stringOrNull(item.sandbox_status),\n metrics: normalizeMetrics(item.metrics),\n agent: normalizeAgent(item.agent),\n workspace: normalizeWorkspace(item.workspace),\n tags: normalizeTags(item.tags),\n launched_agent_profile: normalizeLaunchedAgentProfile(\n item.launched_agent_profile,\n ),\n // SDK-runtime ACP model fields (populated when the agent-server supports\n // ``ConversationInfo.current_model_*``). Consumed by the conversation\n // adapter to drive the per-card chip's model text. Older agent-servers\n // omit these — adapter handles ``undefined`` / ``null`` gracefully.\n current_model_id: stringOrNull(item.current_model_id),\n current_model_name: stringOrNull(item.current_model_name),\n };\n}\n\nfunction requireDirectConversationItems(\n items: unknown,\n): DirectConversationInfo[] {\n if (!Array.isArray(items)) {\n throw invalidConversationResponse();\n }\n return items.map(requireDirectConversationInfo);\n}\n\nfunction requireConversationSearchPage(page: unknown): {\n items: DirectConversationInfo[];\n next_page_id: string | null;\n} {\n if (Array.isArray(page)) {\n return {\n items: requireDirectConversationItems(page),\n next_page_id: null,\n };\n }\n\n if (!isRecord(page)) {\n throw invalidConversationResponse();\n }\n\n return {\n items: requireDirectConversationItems(page.items),\n next_page_id:\n typeof page.next_page_id === \"string\" ? page.next_page_id : null,\n };\n}\n\nconst RUNTIME_STATUSES = new Set<string>([\n \"idle\",\n \"running\",\n \"paused\",\n \"waiting_for_confirmation\",\n \"finished\",\n \"error\",\n \"stuck\",\n]);\n\nfunction toRuntimeStatus(\n status: DirectConversationInfo[\"execution_status\"],\n): RuntimeConversationInfo[\"status\"] {\n const nextStatus = status ?? \"idle\";\n return (\n RUNTIME_STATUSES.has(nextStatus) ? nextStatus : \"idle\"\n ) as RuntimeConversationInfo[\"status\"];\n}\n\nfunction requireAppConversation(\n conversation: AppConversation | null | undefined,\n conversationId: string,\n): AppConversation {\n if (!conversation) {\n throw new Error(`Conversation ${conversationId} was not found`);\n }\n return conversation;\n}\n\nclass AgentServerConversationService {\n static async sendMessage(\n conversationId: string,\n message: SendMessageRequest,\n runtime?: ConversationRuntimeContext | null,\n ): Promise<SendMessageResponse> {\n const active = getActiveBackend().backend;\n let conversationUrl = runtime?.conversationUrl ?? null;\n let sessionApiKey = runtime?.sessionApiKey ?? null;\n\n if (active.kind === \"cloud\") {\n if (!conversationUrl || !sessionApiKey) {\n const [conversation] = await batchGetCloudConversations([\n conversationId,\n ]);\n conversationUrl = conversation?.conversation_url?.trim() ?? null;\n sessionApiKey = conversation?.session_api_key?.trim() ?? null;\n }\n\n if (!conversationUrl || !sessionApiKey) {\n throw new Error(\n \"Conversation sandbox is still starting. Wait for it to finish, then try again.\",\n );\n }\n\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/events`,\n body: { ...message, run: true },\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n\n return message;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).sendEvent(conversationId, message, {\n run: true,\n });\n\n return message;\n }\n\n static async createConversation(\n initialUserMsg?: string,\n conversationInstructions?: string,\n plugins?: PluginSpec[],\n metadata?: ConversationMetadata | null,\n workingDirOverride?: string,\n workspaceMode?: WorkspaceMode,\n parentConversationId?: string,\n agentType?: \"default\" | \"plan\",\n sandboxId?: string,\n // Launch from a saved AgentProfile (resolved server-side) instead of the\n // current encrypted agent_settings (#3727). Supported on both local and the\n // cloud app-server (OpenHands #15060): local threads it through the\n // encrypted-settings builder; cloud sends it as a flat request field.\n agentProfileId?: string,\n agentProfileKind?: AgentKind,\n ): Promise<AppConversationStartTask> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud path mirrors OpenHands' frontend: build a flat\n // AppConversationStartRequest, POST /api/v1/app-conversations\n // (returns a WORKING task), and let the conversation route's\n // useTaskPolling drive it to READY. NO encrypted-settings\n // round-trip — the cloud backend holds secrets server-side.\n // When launching from a profile, send `agent_profile_id`; the backend\n // resolves it to agent_settings server-side.\n const request: AppConversationStartRequest = {\n initial_message: initialUserMsg\n ? {\n role: \"user\",\n content: [{ type: \"text\", text: initialUserMsg }],\n }\n : null,\n title: conversationInstructions ?? null,\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n plugins: plugins ?? null,\n parent_conversation_id: parentConversationId ?? null,\n agent_type: agentType,\n sandbox_id: sandboxId ?? null,\n agent_profile_id: agentProfileId ?? null,\n };\n return createCloudAppConversation(request);\n }\n\n const [settings, profiles] = await Promise.all([\n SettingsService.getSettings(),\n ProfilesService.listProfiles().catch(() => undefined),\n ]);\n const titleLlmProfile = resolveTitleLlmProfile(\n settings.title_llm_profile,\n profiles,\n );\n const conversationId = uuidv4();\n // @spec WUP-001 — Send an absolute working_dir to the agent-server.\n // The default is `workspace/project/<hex>` (relative); without\n // resolving it here, `/api/file/upload` later prepends `/` and writes\n // to `/workspace/...` (read-only on macOS and fresh containers). When\n // the user picks an explicit workspace, `workingDirOverride` is\n // already absolute (it comes from `search_subdirs`).\n const workingDir = await resolveAbsoluteAgentServerPath(\n workingDirOverride ?? buildConversationWorkingDir(conversationId),\n );\n const resolvedWorkspaceMode =\n workspaceMode ?? (workingDirOverride ? \"local_repo\" : \"new_worktree\");\n\n // Use encrypted settings to avoid exposing secrets in the browser\n const payload = await buildStartConversationRequestWithEncryptedSettings({\n settings,\n query: initialUserMsg,\n conversationInstructions,\n plugins,\n conversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>(payload);\n const localBackend = getEffectiveLocalBackend();\n if (!localBackend) throw new NoBackendAvailableError();\n\n if (metadata?.selected_repository || workingDirOverride) {\n // The agent-server runtime has no concept of selected repo/branch/\n // workspace, so persist the home-page selection client-side.\n // `toAppConversation` reads the repo/branch fields back to hydrate\n // the chat-page badges; `useHasAttachedSource` reads\n // `selected_workspace` to default the Files tab to Diff mode when\n // the user explicitly attached a local workspace.\n setStoredConversationMetadata(data.id, {\n selected_repository: metadata?.selected_repository ?? null,\n selected_branch: metadata?.selected_branch ?? null,\n git_provider: metadata?.git_provider ?? null,\n selected_workspace: workingDirOverride ?? null,\n workspace_mode: resolvedWorkspaceMode,\n });\n }\n\n return {\n id: data.id,\n created_by_user_id: null,\n status: \"READY\",\n detail: null,\n app_conversation_id: data.id,\n agent_server_url: localBackend.host,\n request: {\n initial_message: payload.initial_message as\n | AppConversationStartRequest[\"initial_message\"]\n | undefined,\n plugins: plugins ?? null,\n },\n created_at: data.created_at,\n updated_at: data.updated_at,\n };\n }\n\n static async getStartTask(\n taskId: string,\n ): Promise<AppConversationStartTask | null> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return getCloudAppConversationStartTask(taskId);\n }\n // Local agent-server creates conversations synchronously — every\n // local \"task\" is already READY when createConversation returns, so\n // there's nothing to poll for.\n return null;\n }\n\n static async getVSCodeUrl(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<GetVSCodeUrlResponse> {\n // Local-only path. Cloud conversations read the VSCode URL straight\n // from the cloud-computed `sandbox.exposed_urls` (see\n // `useUnifiedVSCodeUrl` + `useCloudSandbox`); the runtime's own\n // `/api/vscode/url` only knows its internal `localhost:8001`, which\n // the user's browser can't reach.\n const workspaceDir =\n await this.resolveConversationWorkingDir(conversationId);\n // Local mode: the typescript-client targets the local agent-server\n // directly via the conversationUrl override.\n const vscodeUrl = await new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getUrl({\n baseUrl:\n typeof window !== \"undefined\" ? window.location.origin : undefined,\n workspaceDir,\n });\n\n return { vscode_url: vscodeUrl };\n }\n\n static async resolveConversationWorkingDir(\n conversationId: string,\n ): Promise<string> {\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return conversation?.workspace?.working_dir ?? getAgentServerWorkingDir();\n }\n\n static async batchGetAppConversations(\n ids: string[],\n ): Promise<(AppConversation | null)[]> {\n if (ids.length === 0) return [];\n\n if (getActiveBackend().backend.kind === \"cloud\") {\n return batchGetCloudConversations(ids);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).getConversations<DirectConversationInfo>(ids);\n\n return requireDirectConversationItems(data).map((item) =>\n toAppConversation(item),\n );\n }\n\n static async updateConversationPublicFlag(\n conversationId: string,\n isPublic: boolean,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind !== \"cloud\") {\n throw new Error(\"Public sharing requires a cloud backend.\");\n }\n return updateCloudConversationPublicFlag(conversationId, isPublic);\n }\n\n static async updateConversationRepository(\n conversationId: string,\n repository: string | null,\n branch?: string | null,\n gitProvider?: string | null,\n ): Promise<AppConversation> {\n if (repository) {\n const existing = getStoredConversationMetadata(conversationId);\n setStoredConversationMetadata(conversationId, {\n ...(existing ?? {}),\n selected_repository: repository,\n selected_branch: branch ?? null,\n git_provider: (gitProvider as Provider | null | undefined) ?? null,\n });\n } else {\n removeStoredConversationMetadata(conversationId);\n }\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n static async readConversationFile(\n conversationId: string,\n filePath?: string,\n ): Promise<string> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n // Cloud exposes a per-conversation file endpoint; the sandbox\n // working dir is fixed (`/workspace/project`), so PLAN.md lives at\n // a known absolute path. Mirrors OpenHands' readConversationFile.\n const path = requirePathInsideDirectory(\n filePath ?? \"/workspace/project/.agents_tmp/PLAN.md\",\n \"/workspace/project\",\n );\n return readCloudConversationFile(conversationId, path);\n }\n\n const workingDir = await this.resolveConversationWorkingDir(conversationId);\n const path = requirePathInsideDirectory(\n filePath ?? `${workingDir}/.agents_tmp/PLAN.md`,\n workingDir,\n );\n return new FileClient(getAgentServerClientOptions()).downloadTextFile(path);\n }\n\n static async downloadConversation(conversationId: string): Promise<Blob> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return downloadCloudConversation(conversationId);\n }\n\n return new FileClient(getAgentServerClientOptions()).downloadTrajectory(\n conversationId,\n );\n }\n\n static async getHooks(conversationId: string): Promise<GetHooksResponse> {\n if (!conversationId) {\n return emptyHooksResponse();\n }\n return emptyHooksResponse();\n }\n\n static async getRuntimeConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<RuntimeConversationInfo> {\n const active = getActiveBackend().backend;\n\n type RawRuntime = DirectConversationInfo & {\n stats?: RuntimeConversationInfo[\"stats\"];\n };\n\n // Cloud mode: route through the cloud-proxy to the runtime sandbox at\n // the conversation's runtime URL — same pattern as getVSCodeUrl. Local\n // mode forwards conversationUrl so the host explicitly resolves to the\n // conversation's runtime instead of falling back to the active backend.\n const response =\n active.kind === \"cloud\" && conversationUrl\n ? await callCloudProxy<RawRuntime>({\n backend: active,\n method: \"GET\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}`,\n authMode: \"session-api-key\",\n sessionApiKey,\n })\n : await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<RawRuntime>(conversationId);\n const data = requireDirectConversationInfo(response);\n const stats = isRecord(response) ? response.stats : null;\n\n return {\n id: data.id,\n title: data.title?.trim()\n ? data.title\n : getDefaultConversationTitle(data.id),\n metrics: normalizeMetrics(data.metrics),\n created_at: data.created_at,\n updated_at: data.updated_at,\n status: toRuntimeStatus(data.execution_status),\n stats: isRecord(stats) ? stats : { usage_to_metrics: {} },\n };\n }\n\n static async searchConversations(\n limit: number = 20,\n pageId?: string,\n ): Promise<AppConversationPage> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return searchCloudConversations(limit, pageId);\n }\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).searchConversations({\n limit,\n page_id: pageId,\n sort_order: ConversationSortOrder.UPDATED_AT_DESC,\n });\n\n return toConversationPage(requireConversationSearchPage(data));\n }\n\n static async deleteConversation(conversationId: string): Promise<void> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n await deleteCloudConversation(conversationId);\n } else {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).deleteConversation(conversationId);\n }\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n title,\n });\n const [conversation] = await this.batchGetAppConversations([\n conversationId,\n ]);\n return requireAppConversation(conversation, conversationId);\n }\n\n /**\n * Forks a conversation, copying event history up to and including\n * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for\n * `from_event_id` (older backends copy the whole conversation).\n */\n static async forkConversation(\n sourceConversationId: string,\n fromEventId: string,\n title?: string,\n ): Promise<DirectConversationInfo> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\n \"Branching a conversation isn't supported on the cloud backend yet.\",\n );\n }\n\n // `from_event_id` is accepted by `/fork` but not yet typed in\n // ForkConversationRequest (through client 1.32.0); the client forwards the\n // body verbatim, so cast to carry it. A title also suppresses the backend\n // auto-title, so the \"(branch)\" marker sticks.\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).forkConversation<DirectConversationInfo>(sourceConversationId, {\n from_event_id: fromEventId,\n ...(title ? { title } : {}),\n } as ForkConversationRequest & { from_event_id: string });\n\n // Carry over the source's client-side metadata (repo/branch/workspace/\n // profile/plugins) so the fork hydrates its chat-page badges the same way.\n const sourceMetadata = getStoredConversationMetadata(sourceConversationId);\n if (sourceMetadata) {\n setStoredConversationMetadata(data.id, sourceMetadata);\n }\n\n return data;\n }\n\n /**\n * Returns an event's `parent_id` (the fork point for branching *before* it),\n * or undefined at the root. Uses the single-event endpoint because the events\n * *search* API omits `parent_id`.\n */\n static async getEventParentId(\n conversationId: string,\n eventId: string,\n ): Promise<string | undefined> {\n const event = (await new ConversationClient(\n getAgentServerClientOptions(),\n ).getEvent(conversationId, eventId)) as { parent_id?: string | null };\n return event.parent_id ?? undefined;\n }\n\n /**\n * Switches the LLM profile for the running conversation when one is open\n * (POST /switch_profile — per-conversation swap, doesn't change the user's\n * default profile). When called without a conversationId (home page),\n * falls back to POST /activate so the next conversation created picks up\n * the chosen profile.\n *\n * The per-conversation endpoint accepts only the profile name, so the UI does\n * not need to fetch or forward profile secrets. That keeps switching working\n * even when the agent server has no OH_SECRET_KEY for encrypted secret export.\n *\n * Cloud backends route to the app-server's per-conversation\n * `/switch_profile`, which owns the profiles and resolves the swap\n * server-side (base_url/api_key fixups, usage_id derivation, then the\n * agent-server's switch_llm) — so the client only forwards the profile name,\n * mirroring {@link switchAcpModel}.\n */\n static async switchProfile(\n conversationId: string | null,\n profileName: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n\n if (backend.kind === \"cloud\") {\n // No conversation (home page): activate globally so the next\n // conversation starts with it. ProfilesService routes to the cloud\n // activate endpoint.\n if (!conversationId) {\n await ProfilesService.activateProfile(profileName);\n return;\n }\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_profile`,\n body: { profile_name: profileName },\n });\n return;\n }\n\n if (!conversationId) {\n await new ProfilesClient(getAgentServerClientOptions()).activateProfile(\n profileName,\n );\n return;\n }\n\n const clientOptions = getAgentServerClientOptions();\n const conversationClient = new ConversationClient(clientOptions);\n const profile = await new ProfilesClient(clientOptions).getProfile(\n profileName,\n { exposeSecrets: \"encrypted\" },\n );\n const model =\n typeof profile.config.model === \"string\" ? profile.config.model : \"\";\n if (!model) throw new Error(`Profile '${profileName}' has no model.`);\n await assertSubscriptionAuthReady({ llm: profile.config });\n await conversationClient.switchLLM(conversationId, {\n ...profile.config,\n model,\n // Keep streaming on after a switch (parity with conversation start);\n // the profile config would otherwise default it to stream=False.\n stream: true,\n // Avoid stale first-write-wins entries in the backend LLM registry.\n usage_id: `profile:${profileName}:${uuidv4()}`,\n } as LLMConfig);\n }\n\n /**\n * Switches the model of a running ACP conversation in place (POST\n * /switch_acp_model — the ACP analog of {@link switchProfile}'s /switch_profile).\n * The agent-server calls the ACP wrapper's ``session/set_model`` on the live\n * session, preserving context. Mirrors {@link switchProfile}'s\n * local-backend-only guard and per-conversation ConversationClient call.\n *\n * Only valid once an ACP session exists (after the first message); the\n * agent-server returns 409 before then — the home/no-session default is\n * persisted via Settings instead (see ``use-switch-acp-model``).\n */\n static async switchAcpModel(\n conversationId: string,\n model: string,\n ): Promise<void> {\n const { backend } = getActiveBackend();\n if (backend.kind === \"cloud\") {\n await callCloudProxy({\n backend,\n method: \"POST\",\n path: `/api/v1/app-conversations/${conversationId}/switch_acp_model`,\n body: { model },\n });\n return;\n }\n\n await new ConversationClient(getAgentServerClientOptions()).switchAcpModel(\n conversationId,\n model,\n );\n }\n}\n\nexport default AgentServerConversationService;\n"],"mappings":"+vCAwEA,IAAM,EAAiC,2BAIjC,EAAiC,IAAS,IAC1C,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,EAAsC,CAGzD,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,EAAM,CAG7E,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,KAG7C,SAAS,EAAa,EAAwB,CAC5C,OAAO,OAAO,GAAU,SAAW,EAAQ,EAG7C,SAAS,EAAa,EAA+B,CACn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B,CACtC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,QAAO,CAChB,CAAC,CACF,OAGF,MAAM,IAAI,EAAA,mBAAmB,EAAA,6BAA6B,CAAC,CAAC,eAC1D,EACA,EACD"}
@@ -11,78 +11,79 @@ import d from "../../node_modules/uuid/dist/v4.js";
11
11
  import { callCloudProxy as f } from "../cloud/proxy.js";
12
12
  import { ConversationSortOrder as p } from "../../node_modules/@openhands/typescript-client/dist/models/conversation.js";
13
13
  import "../../node_modules/@openhands/typescript-client/dist/index.js";
14
- import { resolveAbsoluteAgentServerPath as ee } from "../agent-server-home.js";
15
- import m from "../profiles-service/profiles-service.api.js";
16
- import { getStoredConversationMetadata as h, removeStoredConversationMetadata as g, setStoredConversationMetadata as _ } from "../conversation-metadata-store.js";
17
- import { batchGetCloudConversations as v, createCloudAppConversation as y, deleteCloudConversation as b, downloadCloudConversation as x, getCloudAppConversationStartTask as S, readCloudConversationFile as C, searchCloudConversations as w, updateCloudConversationPublicFlag as T } from "../cloud/conversation-service.api.js";
18
- import E from "../settings-service/settings-service.api.js";
14
+ import { resolveAbsoluteAgentServerPath as m } from "../agent-server-home.js";
15
+ import h from "../profiles-service/profiles-service.api.js";
16
+ import { getStoredConversationMetadata as g, removeStoredConversationMetadata as _, setStoredConversationMetadata as v } from "../conversation-metadata-store.js";
17
+ import { batchGetCloudConversations as y, createCloudAppConversation as b, deleteCloudConversation as x, downloadCloudConversation as S, getCloudAppConversationStartTask as C, readCloudConversationFile as w, searchCloudConversations as T, updateCloudConversationPublicFlag as E } from "../cloud/conversation-service.api.js";
18
+ import ee from "../settings-service/settings-service.api.js";
19
19
  import { assertSubscriptionAuthReady as D, buildStartConversationRequestWithEncryptedSettings as O, emptyHooksResponse as k, getDefaultConversationTitle as A, toAppConversation as j, toConversationPage as M } from "../agent-server-adapter.js";
20
+ import { resolveTitleLlmProfile as N } from "../../utils/title-llm-profile.js";
20
21
  //#region src/api/conversation-service/agent-server-conversation-service.api.ts
21
- var N = "1970-01-01T00:00:00.000Z", P = "Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.";
22
- function F() {
23
- return Error(P);
22
+ var P = "1970-01-01T00:00:00.000Z", F = 300 * 1e3, I = "Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.";
23
+ function L() {
24
+ return Error(I);
24
25
  }
25
- function I(e) {
26
+ function R(e) {
26
27
  return typeof e == "object" && !!e && !Array.isArray(e);
27
28
  }
28
- function L(e) {
29
+ function z(e) {
29
30
  return typeof e == "number" ? e : null;
30
31
  }
31
- function R(e) {
32
+ function B(e) {
32
33
  return typeof e == "number" ? e : 0;
33
34
  }
34
- function z(e) {
35
+ function V(e) {
35
36
  return typeof e == "string" ? e : null;
36
37
  }
37
- function B(e, t, n) {
38
+ function H(e, t, n) {
38
39
  let r = e[t] ?? e[n];
39
- return typeof r == "string" && r.trim() ? r : N;
40
+ return typeof r == "string" && r.trim() ? r : P;
40
41
  }
41
- function V(e) {
42
- return I(e) ? {
43
- prompt_tokens: R(e.prompt_tokens),
44
- completion_tokens: R(e.completion_tokens),
45
- cache_read_tokens: R(e.cache_read_tokens),
46
- cache_write_tokens: R(e.cache_write_tokens),
47
- context_window: R(e.context_window),
48
- per_turn_token: R(e.per_turn_token)
42
+ function U(e) {
43
+ return R(e) ? {
44
+ prompt_tokens: B(e.prompt_tokens),
45
+ completion_tokens: B(e.completion_tokens),
46
+ cache_read_tokens: B(e.cache_read_tokens),
47
+ cache_write_tokens: B(e.cache_write_tokens),
48
+ context_window: B(e.context_window),
49
+ per_turn_token: B(e.per_turn_token)
49
50
  } : null;
50
51
  }
51
- function H(e) {
52
- return I(e) ? {
53
- accumulated_cost: L(e.accumulated_cost),
54
- max_budget_per_task: L(e.max_budget_per_task),
55
- accumulated_token_usage: V(e.accumulated_token_usage)
52
+ function W(e) {
53
+ return R(e) ? {
54
+ accumulated_cost: z(e.accumulated_cost),
55
+ max_budget_per_task: z(e.max_budget_per_task),
56
+ accumulated_token_usage: U(e.accumulated_token_usage)
56
57
  } : null;
57
58
  }
58
- function U(e) {
59
- if (!I(e)) return null;
60
- let t = I(e.llm) ? { model: z(e.llm.model) } : null;
59
+ function G(e) {
60
+ if (!R(e)) return null;
61
+ let t = R(e.llm) ? { model: V(e.llm.model) } : null;
61
62
  return {
62
- kind: z(e.kind),
63
- acp_server: z(e.acp_server),
64
- acp_model: z(e.acp_model),
63
+ kind: V(e.kind),
64
+ acp_server: V(e.acp_server),
65
+ acp_model: V(e.acp_model),
65
66
  llm: t
66
67
  };
67
68
  }
68
- function W(e) {
69
- return I(e) ? { working_dir: z(e.working_dir) } : null;
69
+ function K(e) {
70
+ return R(e) ? { working_dir: V(e.working_dir) } : null;
70
71
  }
71
- function G(e) {
72
- if (!I(e)) return null;
72
+ function q(e) {
73
+ if (!R(e)) return null;
73
74
  let t = {};
74
75
  for (let [n, r] of Object.entries(e)) typeof r == "string" && (t[n] = r);
75
76
  return t;
76
77
  }
77
- function K(e) {
78
- if (!I(e)) return null;
78
+ function J(e) {
79
+ if (!R(e)) return null;
79
80
  let { agent_profile_id: t, revision: n } = e;
80
81
  return typeof t != "string" || typeof n != "number" ? null : {
81
82
  agent_profile_id: t,
82
83
  revision: n
83
84
  };
84
85
  }
85
- function q(e) {
86
+ function Y(e) {
86
87
  if (!e.startsWith("/")) return null;
87
88
  let t = [];
88
89
  for (let n of e.split("/")) if (n && n !== ".") if (n === "..") {
@@ -91,45 +92,45 @@ function q(e) {
91
92
  } else t.push(n);
92
93
  return `/${t.join("/")}`;
93
94
  }
94
- function J(e, t) {
95
- let n = q(e), r = q(t);
95
+ function X(e, t) {
96
+ let n = Y(e), r = Y(t);
96
97
  if (!n || !r || n !== r && !n.startsWith(`${r}/`)) throw Error("Conversation file path must stay inside the workspace");
97
98
  return n;
98
99
  }
99
- function Y(e) {
100
- if (!I(e) || typeof e.id != "string" || !e.id.trim()) throw F();
100
+ function Z(e) {
101
+ if (!R(e) || typeof e.id != "string" || !e.id.trim()) throw L();
101
102
  return {
102
103
  id: e.id.trim(),
103
- title: z(e.title),
104
- created_at: B(e, "created_at", "createdAt"),
105
- updated_at: B(e, "updated_at", "updatedAt"),
106
- execution_status: z(e.execution_status),
107
- sandbox_status: z(e.sandbox_status),
108
- metrics: H(e.metrics),
109
- agent: U(e.agent),
110
- workspace: W(e.workspace),
111
- tags: G(e.tags),
112
- launched_agent_profile: K(e.launched_agent_profile),
113
- current_model_id: z(e.current_model_id),
114
- current_model_name: z(e.current_model_name)
104
+ title: V(e.title),
105
+ created_at: H(e, "created_at", "createdAt"),
106
+ updated_at: H(e, "updated_at", "updatedAt"),
107
+ execution_status: V(e.execution_status),
108
+ sandbox_status: V(e.sandbox_status),
109
+ metrics: W(e.metrics),
110
+ agent: G(e.agent),
111
+ workspace: K(e.workspace),
112
+ tags: q(e.tags),
113
+ launched_agent_profile: J(e.launched_agent_profile),
114
+ current_model_id: V(e.current_model_id),
115
+ current_model_name: V(e.current_model_name)
115
116
  };
116
117
  }
117
- function X(e) {
118
- if (!Array.isArray(e)) throw F();
119
- return e.map(Y);
118
+ function Q(e) {
119
+ if (!Array.isArray(e)) throw L();
120
+ return e.map(Z);
120
121
  }
121
- function Z(e) {
122
+ function te(e) {
122
123
  if (Array.isArray(e)) return {
123
- items: X(e),
124
+ items: Q(e),
124
125
  next_page_id: null
125
126
  };
126
- if (!I(e)) throw F();
127
+ if (!R(e)) throw L();
127
128
  return {
128
- items: X(e.items),
129
+ items: Q(e.items),
129
130
  next_page_id: typeof e.next_page_id == "string" ? e.next_page_id : null
130
131
  };
131
132
  }
132
- var Q = new Set([
133
+ var ne = new Set([
133
134
  "idle",
134
135
  "running",
135
136
  "paused",
@@ -138,20 +139,20 @@ var Q = new Set([
138
139
  "error",
139
140
  "stuck"
140
141
  ]);
141
- function te(e) {
142
+ function re(e) {
142
143
  let t = e ?? "idle";
143
- return Q.has(t) ? t : "idle";
144
+ return ne.has(t) ? t : "idle";
144
145
  }
145
146
  function $(e, t) {
146
147
  if (!e) throw Error(`Conversation ${t} was not found`);
147
148
  return e;
148
149
  }
149
- var ne = class {
150
+ var ie = class {
150
151
  static async sendMessage(t, n, r) {
151
152
  let a = s().backend, o = r?.conversationUrl ?? null, c = r?.sessionApiKey ?? null;
152
153
  if (a.kind === "cloud") {
153
154
  if (!o || !c) {
154
- let [e] = await v([t]);
155
+ let [e] = await y([t]);
155
156
  o = e?.conversation_url?.trim() ?? null, c = e?.session_api_key?.trim() ?? null;
156
157
  }
157
158
  if (!o || !c) throw Error("Conversation sandbox is still starting. Wait for it to finish, then try again.");
@@ -173,8 +174,8 @@ var ne = class {
173
174
  sessionApiKey: c
174
175
  })).sendEvent(t, n, { run: !0 }), n;
175
176
  }
176
- static async createConversation(t, n, r, i, o, f, p, m, h, g, v) {
177
- if (s().backend.kind === "cloud") return y({
177
+ static async createConversation(t, n, r, i, o, f, p, g, _, y, x) {
178
+ if (s().backend.kind === "cloud") return b({
178
179
  initial_message: t ? {
179
180
  role: "user",
180
181
  content: [{
@@ -188,45 +189,46 @@ var ne = class {
188
189
  git_provider: i?.git_provider ?? null,
189
190
  plugins: r ?? null,
190
191
  parent_conversation_id: p ?? null,
191
- agent_type: m,
192
- sandbox_id: h ?? null,
193
- agent_profile_id: g ?? null
192
+ agent_type: g,
193
+ sandbox_id: _ ?? null,
194
+ agent_profile_id: y ?? null
194
195
  });
195
- let b = await E.getSettings(), x = d(), S = await ee(o ?? a(x)), C = f ?? (o ? "local_repo" : "new_worktree"), w = await O({
196
- settings: b,
196
+ let [S, C] = await Promise.all([ee.getSettings(), h.listProfiles().catch(() => void 0)]), w = N(S.title_llm_profile, C), T = d(), E = await m(o ?? a(T)), D = f ?? (o ? "local_repo" : "new_worktree"), k = await O({
197
+ settings: S,
197
198
  query: t,
198
199
  conversationInstructions: n,
199
200
  plugins: r,
200
- conversationId: x,
201
- workingDir: S,
202
- worktree: C === "new_worktree",
203
- agentProfileId: g,
204
- agentProfileKind: v
205
- }), T = await new e(u()).createConversation(w), D = c();
206
- if (!D) throw new l();
207
- return (i?.selected_repository || o) && _(T.id, {
201
+ conversationId: T,
202
+ workingDir: E,
203
+ worktree: D === "new_worktree",
204
+ agentProfileId: y,
205
+ agentProfileKind: x,
206
+ titleLlmProfile: w
207
+ }), A = await new e(u({ timeout: F })).createConversation(k), j = c();
208
+ if (!j) throw new l();
209
+ return (i?.selected_repository || o) && v(A.id, {
208
210
  selected_repository: i?.selected_repository ?? null,
209
211
  selected_branch: i?.selected_branch ?? null,
210
212
  git_provider: i?.git_provider ?? null,
211
213
  selected_workspace: o ?? null,
212
- workspace_mode: C
214
+ workspace_mode: D
213
215
  }), {
214
- id: T.id,
216
+ id: A.id,
215
217
  created_by_user_id: null,
216
218
  status: "READY",
217
219
  detail: null,
218
- app_conversation_id: T.id,
219
- agent_server_url: D.host,
220
+ app_conversation_id: A.id,
221
+ agent_server_url: j.host,
220
222
  request: {
221
- initial_message: w.initial_message,
223
+ initial_message: k.initial_message,
222
224
  plugins: r ?? null
223
225
  },
224
- created_at: T.created_at,
225
- updated_at: T.updated_at
226
+ created_at: A.created_at,
227
+ updated_at: A.updated_at
226
228
  };
227
229
  }
228
230
  static async getStartTask(e) {
229
- return s().backend.kind === "cloud" ? S(e) : null;
231
+ return s().backend.kind === "cloud" ? C(e) : null;
230
232
  }
231
233
  static async getVSCodeUrl(e, t, n) {
232
234
  let i = await this.resolveConversationWorkingDir(e);
@@ -243,29 +245,29 @@ var ne = class {
243
245
  return t?.workspace?.working_dir ?? o();
244
246
  }
245
247
  static async batchGetAppConversations(t) {
246
- return t.length === 0 ? [] : s().backend.kind === "cloud" ? v(t) : X(await new e(u()).getConversations(t)).map((e) => j(e));
248
+ return t.length === 0 ? [] : s().backend.kind === "cloud" ? y(t) : Q(await new e(u()).getConversations(t)).map((e) => j(e));
247
249
  }
248
250
  static async updateConversationPublicFlag(e, t) {
249
251
  if (s().backend.kind !== "cloud") throw Error("Public sharing requires a cloud backend.");
250
- return T(e, t);
252
+ return E(e, t);
251
253
  }
252
254
  static async updateConversationRepository(e, t, n, r) {
253
- t ? _(e, {
254
- ...h(e) ?? {},
255
+ t ? v(e, {
256
+ ...g(e) ?? {},
255
257
  selected_repository: t,
256
258
  selected_branch: n ?? null,
257
259
  git_provider: r ?? null
258
- }) : g(e);
260
+ }) : _(e);
259
261
  let [i] = await this.batchGetAppConversations([e]);
260
262
  return $(i, e);
261
263
  }
262
264
  static async readConversationFile(e, n) {
263
- if (s().backend.kind === "cloud") return C(e, J(n ?? "/workspace/project/.agents_tmp/PLAN.md", "/workspace/project"));
264
- let r = await this.resolveConversationWorkingDir(e), i = J(n ?? `${r}/.agents_tmp/PLAN.md`, r);
265
+ if (s().backend.kind === "cloud") return w(e, X(n ?? "/workspace/project/.agents_tmp/PLAN.md", "/workspace/project"));
266
+ let r = await this.resolveConversationWorkingDir(e), i = X(n ?? `${r}/.agents_tmp/PLAN.md`, r);
265
267
  return new t(u()).downloadTextFile(i);
266
268
  }
267
269
  static async downloadConversation(e) {
268
- return s().backend.kind === "cloud" ? x(e) : new t(u()).downloadTrajectory(e);
270
+ return s().backend.kind === "cloud" ? S(e) : new t(u()).downloadTrajectory(e);
269
271
  }
270
272
  static async getHooks(e) {
271
273
  return k();
@@ -281,26 +283,26 @@ var ne = class {
281
283
  }) : await new e(u({
282
284
  conversationUrl: n,
283
285
  sessionApiKey: r
284
- })).getConversation(t), c = Y(o), l = I(o) ? o.stats : null;
286
+ })).getConversation(t), c = Z(o), l = R(o) ? o.stats : null;
285
287
  return {
286
288
  id: c.id,
287
289
  title: c.title?.trim() ? c.title : A(c.id),
288
- metrics: H(c.metrics),
290
+ metrics: W(c.metrics),
289
291
  created_at: c.created_at,
290
292
  updated_at: c.updated_at,
291
- status: te(c.execution_status),
292
- stats: I(l) ? l : { usage_to_metrics: {} }
293
+ status: re(c.execution_status),
294
+ stats: R(l) ? l : { usage_to_metrics: {} }
293
295
  };
294
296
  }
295
297
  static async searchConversations(t = 20, n) {
296
- return s().backend.kind === "cloud" ? w(t, n) : M(Z(await new e(u()).searchConversations({
298
+ return s().backend.kind === "cloud" ? T(t, n) : M(te(await new e(u()).searchConversations({
297
299
  limit: t,
298
300
  page_id: n,
299
301
  sort_order: p.UPDATED_AT_DESC
300
302
  })));
301
303
  }
302
304
  static async deleteConversation(t) {
303
- s().backend.kind === "cloud" ? await b(t) : await new e(u()).deleteConversation(t), g(t);
305
+ s().backend.kind === "cloud" ? await x(t) : await new e(u()).deleteConversation(t), _(t);
304
306
  }
305
307
  static async updateConversationTitle(t, n) {
306
308
  await new e(u()).updateConversation(t, { title: n });
@@ -312,8 +314,8 @@ var ne = class {
312
314
  let i = await new e(u()).forkConversation(t, {
313
315
  from_event_id: n,
314
316
  ...r ? { title: r } : {}
315
- }), a = h(t);
316
- return a && _(i.id, a), i;
317
+ }), a = g(t);
318
+ return a && v(i.id, a), i;
317
319
  }
318
320
  static async getEventParentId(t, n) {
319
321
  return (await new e(u()).getEvent(t, n)).parent_id ?? void 0;
@@ -322,7 +324,7 @@ var ne = class {
322
324
  let { backend: i } = s();
323
325
  if (i.kind === "cloud") {
324
326
  if (!t) {
325
- await m.activateProfile(r);
327
+ await h.activateProfile(r);
326
328
  return;
327
329
  }
328
330
  await f({
@@ -361,6 +363,6 @@ var ne = class {
361
363
  }
362
364
  };
363
365
  //#endregion
364
- export { ne as default };
366
+ export { ie as default };
365
367
 
366
368
  //# sourceMappingURL=agent-server-conversation-service.api.js.map