@openhands/agent-canvas 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (956) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-CX3Lh9gj.js → acp-providers-DrjNsPOH.js} +1 -1
  4. package/build/assets/active-backend-context-rZiLJRUc.js +2 -0
  5. package/build/assets/{agent-context-settings-DSZlXrLj.js → agent-context-settings-CJUrcBut.js} +1 -1
  6. package/build/assets/agent-profiles-service.api-Biieml2L.js +1 -0
  7. package/build/assets/agent-profiles-settings-x6RvPsq7.js +1 -0
  8. package/build/assets/agent-server-client-options-BikiNwTa.js +1 -0
  9. package/build/assets/agent-server-conversation-service.api-DYFsNHKf.js +88 -0
  10. package/build/assets/agent-settings-BJyovpJ_.js +1 -0
  11. package/build/assets/agent-settings-CpY3zObk.js +2 -0
  12. package/build/assets/{alert-banner-HP6mX-Vr.js → alert-banner-vARz1idS.js} +1 -1
  13. package/build/assets/{api-error-message-B-XdSk3b.js → api-error-message-Ve79qDcN.js} +1 -1
  14. package/build/assets/api-key-entry-screen-CsMuBhoP.js +1 -0
  15. package/build/assets/{app-settings-dbnneVaV.js → app-settings-BaJ7nfHt.js} +1 -1
  16. package/build/assets/automation-detail-CVoGDrKq.js +3 -0
  17. package/build/assets/{automation-export-D3a3of4G.js → automation-export-DxY47m3T.js} +1 -1
  18. package/build/assets/automation-git-sync-CRMP9Bbm.js +1 -0
  19. package/build/assets/automation-setup-route-072beLz1.js +3 -0
  20. package/build/assets/{automation-templates-BRppNh99.js → automation-templates-4C4PM8K7.js} +1 -1
  21. package/build/assets/automations-list-xuqTSQL4.js +1 -0
  22. package/build/assets/{back-nav-button-Cjl_hoxq.js → back-nav-button-B8tH0BEp.js} +1 -1
  23. package/build/assets/backend-form-modal-0aJmWdsa.js +1 -0
  24. package/build/assets/{backend-synced-settings-badge-DPkz30BE.js → backend-synced-settings-badge-B7rKWBir.js} +1 -1
  25. package/build/assets/{badge-BU3S0VtE.js → badge-CcGx2TaV.js} +1 -1
  26. package/build/assets/{base-modal-D_L0oEbG.js → base-modal-DTULovNc.js} +1 -1
  27. package/build/assets/bot-CLMxGFaq.js +1 -0
  28. package/build/assets/{brand-button-BAfk4wGP.js → brand-button-DxPO4Lf8.js} +1 -1
  29. package/build/assets/{browser-DSAo0tz1.js → browser-C-_qBasq.js} +2 -2
  30. package/build/assets/{browser-tab-C9vy56R5.js → browser-tab-DZanIw5m.js} +1 -1
  31. package/build/assets/{canvas-extension-page-dx1gFrfW.js → canvas-extension-page-o_cWgE9B.js} +1 -1
  32. package/build/assets/canvas-extensions-DSgNlCha.js +1 -0
  33. package/build/assets/{canvas-extensions-runtime-2_x5Ezmi.js → canvas-extensions-runtime-DdnkgJXV.js} +1 -1
  34. package/build/assets/{chat-send-button-MUQqCZCS.js → chat-send-button-B3SFSIg5.js} +1 -1
  35. package/build/assets/check-fDEfgSzj.js +1 -0
  36. package/build/assets/chevron-down-CFrWHqu8.js +1 -0
  37. package/build/assets/chevron-right-C5roOrJu.js +1 -0
  38. package/build/assets/circle-check-ClTzJTdb.js +1 -0
  39. package/build/assets/{circle-plus-check-toggle-BO_kFZt3.js → circle-plus-check-toggle-Fr-h-mbL.js} +1 -1
  40. package/build/assets/{cloud-funnel-analytics-CztBCCPp.js → cloud-funnel-analytics-BQanUEEC.js} +1 -1
  41. package/build/assets/{cog-D-MPQW6G.js → cog-VBlRo6iw.js} +1 -1
  42. package/build/assets/command-menu-BT3Ia5Ru.js +1 -0
  43. package/build/assets/commits-tab-2jhtaohl.js +1 -0
  44. package/build/assets/{condenser-settings-DmEOje-7.js → condenser-settings-eVKFMvap.js} +1 -1
  45. package/build/assets/confirmation-modal-gIFHeZt6.js +1 -0
  46. package/build/assets/{context-menu-list-item-I86vKcmM.js → context-menu-list-item-DDROe12Z.js} +1 -1
  47. package/build/assets/conversation-BnjJSFf5.js +93 -0
  48. package/build/assets/conversation-DZ578rOX.js +1 -0
  49. package/build/assets/conversation-panel-DZ578rOX.js +1 -0
  50. package/build/assets/{conversation-state-store-B0ImPLHO.js → conversation-state-store-D1_G_9I-.js} +1 -1
  51. package/build/assets/{conversation-store-Ca3ghXap.js → conversation-store-DVVfkCsk.js} +1 -1
  52. package/build/assets/{conversation-tab-empty-state-FIbh_lc8.js → conversation-tab-empty-state-DKlzAz5c.js} +1 -1
  53. package/build/assets/{copy-to-clipboard-button-Ca8iSkkA.js → copy-to-clipboard-button-B3w0X7WH.js} +1 -1
  54. package/build/assets/{device-verify-Bhn2e_Ye.js → device-verify-BfkCzyFB.js} +1 -1
  55. package/build/assets/{dropdown-classes-Bc1djN0-.js → dropdown-classes-B9kJVDIk.js} +1 -1
  56. package/build/assets/edit-automation-modal-BwhJ39JT.js +1 -0
  57. package/build/assets/empty-state-RZz0OfnY.js +1 -0
  58. package/build/assets/{entry.client-CqyPPjOq.js → entry.client-Ds8LVp-E.js} +2 -2
  59. package/build/assets/enum-filter-dropdown-C4pW0ORd.js +1 -0
  60. package/build/assets/{environment-switch-overlay-BmBRT7gv.js → environment-switch-overlay-P2ZAuzov.js} +1 -1
  61. package/build/assets/{error-state-Body8Ngd.js → error-state-B_5cgNPJ.js} +1 -1
  62. package/build/assets/extensions-hub-DsaUr4ca.js +1 -0
  63. package/build/assets/extensions-navigation-CRMZd-FE.js +1 -0
  64. package/build/assets/external-link-DQtv7eTh.js +1 -0
  65. package/build/assets/files-tab-CCgAcVdc.js +1 -0
  66. package/build/assets/{form-control-classes-Bkh5FGrD.js → form-control-classes-B-z85REi.js} +1 -1
  67. package/build/assets/get-git-path-EHrSDxTM.js +1 -0
  68. package/build/assets/git-repo-dropdown-D2WEQ97X.js +1 -0
  69. package/build/assets/{git-repo-dropdown-4ROKl2cB.js → git-repo-dropdown-DVeCUUXG.js} +1 -1
  70. package/build/assets/{highlighted-source-view-BFRxGT_Q.js → highlighted-source-view-DjHO3SdW.js} +1 -1
  71. package/build/assets/home-BorS_vdS.js +1 -0
  72. package/build/assets/home-aIMbHw5M.js +1 -0
  73. package/build/assets/home-automation-run-tooltip-CpHNFiFl.js +1 -0
  74. package/build/assets/home-store-DyXz0w6d.js +1 -0
  75. package/build/assets/hooks-service-C6dpRtZM.js +1 -0
  76. package/build/assets/index-home-zKFuKK2B.js +1 -0
  77. package/build/assets/info-CTIdjttz.js +1 -0
  78. package/build/assets/install-server-modal-DUiZMc8u.js +1 -0
  79. package/build/assets/kebab-menu-item-content-mm04SBD3.js +1 -0
  80. package/build/assets/{key-BmVyxs-2.js → key-CfXbJa8w.js} +1 -1
  81. package/build/assets/{launch-IrTDEFCs.js → launch-BSIf9KEg.js} +1 -1
  82. package/build/assets/list-filter-CNpqTWVY.js +1 -0
  83. package/build/assets/{list-todo-apgLVjMw.js → list-todo-ByXMdY4W.js} +1 -1
  84. package/build/assets/llm-not-configured-banner-z_QRSeV0.js +27 -0
  85. package/build/assets/llm-settings-B-5AHMiX.js +1 -0
  86. package/build/assets/llm-settings-B3SjHDmA.js +1 -0
  87. package/build/assets/llm-subscription-service-aDNBQ7Gq.js +1 -0
  88. package/build/assets/loader-circle-Dex47vVW.js +1 -0
  89. package/build/assets/{loading-spinner-BY9N3pOe.js → loading-spinner-DfHI77BA.js} +1 -1
  90. package/build/assets/manage-backends-modal-q1NdFisr.js +1 -0
  91. package/build/assets/manifest-8920b615.js +1 -0
  92. package/build/assets/{manifest-subpage-layout-CAOYzrYp.js → manifest-subpage-layout-BQQy5ipR.js} +1 -1
  93. package/build/assets/{map-provider-Cu3Zgumb.js → map-provider-DXvssjw9.js} +1 -1
  94. package/build/assets/markdown-renderer-rivLvYh-.js +8 -0
  95. package/build/assets/{mcp-BTs_SXfZ.js → mcp-CEXDhQWn.js} +1 -1
  96. package/build/assets/{mcp-marketplace-utils-AIBzzHTO.js → mcp-marketplace-utils-Cn_NIMWM.js} +1 -1
  97. package/build/assets/mcp-page-LGYIICMG.js +9 -0
  98. package/build/assets/messages-DUSeANAh.js +41 -0
  99. package/build/assets/{modal-body-BxZjsju9.js → modal-body-DJw4xBki.js} +1 -1
  100. package/build/assets/{modal-classes-C8eycCwG.js → modal-classes-Dg0ngBPO.js} +1 -1
  101. package/build/assets/{modal-close-button-DDzdRvCs.js → modal-close-button-B9j4nasm.js} +1 -1
  102. package/build/assets/{mouse-pointer-click-Co2uyaPA.js → mouse-pointer-click-DEhsSUpu.js} +1 -1
  103. package/build/assets/onboarding-BjFebfs5.js +1 -0
  104. package/build/assets/onboarding-modal-DDTjOpyd.js +1 -0
  105. package/build/assets/organization-service.api-Cyg1Tn03.js +1 -0
  106. package/build/assets/pencil-D5c47kyN.js +1 -0
  107. package/build/assets/pin-C7vMagvf.js +1 -0
  108. package/build/assets/planner-tab-D8f2Y3rn.js +1 -0
  109. package/build/assets/plug-CeaqeF6u.js +1 -0
  110. package/build/assets/plugins-management-service-Bh_pBuf-.js +1 -0
  111. package/build/assets/plus-B3wvU06-.js +1 -0
  112. package/build/assets/profiles-service.api-BbOK0EkF.js +1 -0
  113. package/build/assets/{providers-BhMcY5nv.js → providers-2gIIkz2N.js} +1 -1
  114. package/build/assets/proxy-CBgMd2zf.js +1 -0
  115. package/build/assets/{puzzle-JM_QaRm0.js → puzzle-DdAqbUrb.js} +1 -1
  116. package/build/assets/recommended-automations-launcher-YLAQTp4s.js +1 -0
  117. package/build/assets/refresh-cw-DEQdPCpH.js +1 -0
  118. package/build/assets/root-Bye_XmEL.js +2 -0
  119. package/build/assets/root-Cnwwzgo0.css +1 -0
  120. package/build/assets/root-layout-CSAwxBGM.js +2 -0
  121. package/build/assets/schema-field-CK0xYNbO.js +1 -0
  122. package/build/assets/scroll-fade-state-Dt_fx2kf.js +1 -0
  123. package/build/assets/sdk-section-page-Da73Rs_o.js +1 -0
  124. package/build/assets/secret-form-CB2VwYYg.js +1 -0
  125. package/build/assets/secrets-service-Cr8g8xuv.js +1 -0
  126. package/build/assets/{secrets-settings-B_GpxKW2.js → secrets-settings-Bh0udeKv.js} +1 -1
  127. package/build/assets/settings-DmyIgRxO.js +1 -0
  128. package/build/assets/{settings-dropdown-input-BcwylHs2.js → settings-dropdown-input-DVpyD87C.js} +1 -1
  129. package/build/assets/settings-index-BSJUFmjE.js +1 -0
  130. package/build/assets/{settings-input-Db-1g8Ql.js → settings-input-C0dd8Utu.js} +1 -1
  131. package/build/assets/{settings-list-classes-BzeSZbF2.js → settings-list-classes-Ds4jPBHK.js} +1 -1
  132. package/build/assets/{settings-modal-DfJ3tcJQ.js → settings-modal-yStgEh2o.js} +1 -1
  133. package/build/assets/settings-service.api-9_xdv_mh.js +1 -0
  134. package/build/assets/{settings-switch-CS-dJDmA.js → settings-switch-B78Khmyz.js} +1 -1
  135. package/build/assets/{settings-utils-UYpEdPuD.js → settings-utils-8GIIgOQL.js} +1 -1
  136. package/build/assets/shared-conversation-DM96X4KV.js +1 -0
  137. package/build/assets/shield-check-DO7wa_eu.js +1 -0
  138. package/build/assets/{sidebar-layout-D6fS8-Gl.js → sidebar-layout-EPfWxk11.js} +1 -1
  139. package/build/assets/sidebar-mobile-menu-toggle-D5GR5xT9.js +1 -0
  140. package/build/assets/{sidebar-nav-link-DQQcMf1A.js → sidebar-nav-link-_t4_Ef-9.js} +1 -1
  141. package/build/assets/{sidebar-onboarding-checklist-storage-BBkeI6Bp.js → sidebar-onboarding-checklist-storage-DbDX-Wvj.js} +1 -1
  142. package/build/assets/{sidebar-store-DGqHkVLw.js → sidebar-store-CSDFK0W5.js} +1 -1
  143. package/build/assets/{skill-card-pill-row-B27-xyig.js → skill-card-pill-row-989y15jV.js} +1 -1
  144. package/build/assets/{skill-filter-w__3UCEE.js → skill-filter-BBeZ4JEP.js} +1 -1
  145. package/build/assets/{skill-icon-badge-RQkq8wvl.js → skill-icon-badge-BDhQ-tQ0.js} +1 -1
  146. package/build/assets/skill-scope-Dz3kPH3P.js +1 -0
  147. package/build/assets/skills-plugins-e3CYGdUJ.js +1 -0
  148. package/build/assets/skills-settings-3e-FuHw_.js +1 -0
  149. package/build/assets/styled-tooltip-Pd22BIvr.js +1 -0
  150. package/build/assets/{task-list-tab-C5zcaktH.js → task-list-tab-3Jg8ywch.js} +1 -1
  151. package/build/assets/{terminal-CNElN42a.js → terminal-onXx0_Qz.js} +2 -2
  152. package/build/assets/toggle-switch-lwQtxDcm.js +1 -0
  153. package/build/assets/trash-2-ZhKuTLiz.js +1 -0
  154. package/build/assets/trash-B6OIe4yX.js +1 -0
  155. package/build/assets/triangle-alert-BajLPpQg.js +1 -0
  156. package/build/assets/{typography-v1KN0tzi.js → typography-HLLg_FAn.js} +1 -1
  157. package/build/assets/usage-tab-Cm-9j3UK.js +1 -0
  158. package/build/assets/use-acp-credential-form-BARcvjYE.js +1 -0
  159. package/build/assets/use-activate-agent-profile-BLKML6vQ.js +1 -0
  160. package/build/assets/use-agent-profiles-1P91KSXz.js +1 -0
  161. package/build/assets/{use-automation-health-E6NZi9rb.js → use-automation-health-BZkQNEA8.js} +1 -1
  162. package/build/assets/use-automation-permissions-B_RpvL-s.js +1 -0
  163. package/build/assets/{use-automations-xijQKIl9.js → use-automations-Cg0PDIZr.js} +1 -1
  164. package/build/assets/{use-can-manage-org-profiles-CrJP5262.js → use-can-manage-org-profiles-BbN6KfDr.js} +1 -1
  165. package/build/assets/use-canvas-extensions-CFUpHat6.js +1 -0
  166. package/build/assets/{use-cloud-current-user-id-CDfAHpPX.js → use-cloud-current-user-id-Dk0rjr63.js} +1 -1
  167. package/build/assets/use-config-DpafU_QP.js +1 -0
  168. package/build/assets/use-create-conversation-1YgmAHt-.js +1 -0
  169. package/build/assets/use-create-secret-D8p9ybQj.js +1 -0
  170. package/build/assets/{use-get-secrets-K3jmk-LH.js → use-get-secrets-CQ4b0qK8.js} +1 -1
  171. package/build/assets/use-is-authed-BRPjCRKM.js +1 -0
  172. package/build/assets/{use-launch-skill-in-chat-BYjYihBP.js → use-launch-skill-in-chat-DeYa1tFM.js} +1 -1
  173. package/build/assets/use-llm-configured-DGm8FiRR.js +1 -0
  174. package/build/assets/use-llm-profiles-BTTtpW4z.js +1 -0
  175. package/build/assets/use-manifest-capabilities-AOWGcu0j.js +1 -0
  176. package/build/assets/use-onboarding-completion-CoINurkm.js +1 -0
  177. package/build/assets/use-pinned-home-route-D6krwXjy.js +1 -0
  178. package/build/assets/use-plugins-marketplace-mLsIDhBv.js +1 -0
  179. package/build/assets/use-save-agent-profile-CxyO9YG-.js +1 -0
  180. package/build/assets/{use-save-settings-DYqkKv7T.js → use-save-settings-3U5K9-8x.js} +1 -1
  181. package/build/assets/use-settings-Dn00UISA.js +1 -0
  182. package/build/assets/use-settings-nav-items-vrjxTqcu.js +16 -0
  183. package/build/assets/use-tracking-B9prBsrq.js +3 -0
  184. package/build/assets/{use-user-conversation-B9Gebw_g.js → use-user-conversation-ZWlXtbZb.js} +1 -1
  185. package/build/assets/{useInfiniteQuery-C926xzY4.js → useInfiniteQuery-BzrRqjLg.js} +1 -1
  186. package/build/assets/{useMutation-B-qc391N.js → useMutation-CJuK90oc.js} +1 -1
  187. package/build/assets/{useQueries-DlbhlH9I.js → useQueries-CykmpT-a.js} +1 -1
  188. package/build/assets/{useQuery-BSTgq1rl.js → useQuery-S6j94er1.js} +1 -1
  189. package/build/assets/utils-BOco8mxR.js +1 -0
  190. package/build/assets/{vendor~conversation-panel~conversation-C8Fn4XOf.js → vendor~conversation-panel~conversation-4eJ0tml3.js} +1 -1
  191. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +2 -0
  192. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js +185 -0
  193. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js} +1 -1
  194. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-hWywRBaR.js → vendor~index-home~home~conversation-panel~conversation-CSFLzmTN.js} +1 -1
  195. package/build/assets/vendor~root-layout-n8XCEXG8.js +1 -0
  196. package/build/assets/{vendor~root-layout~conversation-panel~conversation-BMbMgaGu.js → vendor~root-layout~conversation-panel~conversation-3Idg1_U3.js} +1 -1
  197. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BWir3rJs.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js} +1 -1
  198. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-j5MFqfSy.js → vendor~root-layout~index-home~home~conversation-panel~conversation-DgQ564nC.js} +1 -1
  199. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js +1 -0
  200. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~nj1hli3r-DP9wmsjo.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js} +1 -1
  201. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js +1 -0
  202. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-CUmIwQCN.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js} +12 -6
  203. package/build/assets/{verification-settings-gw_q6vkL.js → verification-settings-u2POabjH.js} +1 -1
  204. package/build/assets/{wrench-CUEI1krB.js → wrench-CkgI4rxA.js} +1 -1
  205. package/build/assets/x-By6qCmtY.js +1 -0
  206. package/build/index.html +4 -4
  207. package/build/locales/ar/openhands.json +73 -20
  208. package/build/locales/ca/openhands.json +73 -20
  209. package/build/locales/de/openhands.json +73 -20
  210. package/build/locales/en/openhands.json +73 -20
  211. package/build/locales/es/openhands.json +73 -20
  212. package/build/locales/fr/openhands.json +73 -20
  213. package/build/locales/it/openhands.json +73 -20
  214. package/build/locales/ja/openhands.json +73 -20
  215. package/build/locales/ko-KR/openhands.json +73 -20
  216. package/build/locales/no/openhands.json +73 -20
  217. package/build/locales/pt/openhands.json +73 -20
  218. package/build/locales/tr/openhands.json +73 -20
  219. package/build/locales/uk/openhands.json +73 -20
  220. package/build/locales/zh-CN/openhands.json +73 -20
  221. package/build/locales/zh-TW/openhands.json +73 -20
  222. package/config/defaults.json +3 -3
  223. package/dist/api/agent-server-adapter.cjs +3 -3
  224. package/dist/api/agent-server-adapter.cjs.map +1 -1
  225. package/dist/api/agent-server-adapter.d.ts +72 -12
  226. package/dist/api/agent-server-adapter.js +234 -132
  227. package/dist/api/agent-server-adapter.js.map +1 -1
  228. package/dist/api/agent-server-config.cjs +1 -1
  229. package/dist/api/agent-server-config.cjs.map +1 -1
  230. package/dist/api/agent-server-config.d.ts +6 -0
  231. package/dist/api/agent-server-config.js +6 -3
  232. package/dist/api/agent-server-config.js.map +1 -1
  233. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  234. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  235. package/dist/api/automation-service/automation-service.api.d.ts +2 -2
  236. package/dist/api/automation-service/automation-service.api.js +7 -7
  237. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  238. package/dist/api/cloud/provider-connections-service.api.cjs +2 -0
  239. package/dist/api/cloud/provider-connections-service.api.cjs.map +1 -0
  240. package/dist/api/cloud/provider-connections-service.api.d.ts +5 -0
  241. package/dist/api/cloud/provider-connections-service.api.js +50 -0
  242. package/dist/api/cloud/provider-connections-service.api.js.map +1 -0
  243. package/dist/api/cloud/skills-service.api.cjs +1 -1
  244. package/dist/api/cloud/skills-service.api.cjs.map +1 -1
  245. package/dist/api/cloud/skills-service.api.d.ts +10 -0
  246. package/dist/api/cloud/skills-service.api.js +11 -1
  247. package/dist/api/cloud/skills-service.api.js.map +1 -1
  248. package/dist/api/conversation-metadata-store.cjs +1 -1
  249. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  250. package/dist/api/conversation-metadata-store.d.ts +24 -0
  251. package/dist/api/conversation-metadata-store.js +10 -2
  252. package/dist/api/conversation-metadata-store.js.map +1 -1
  253. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  254. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  255. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +20 -0
  256. package/dist/api/conversation-service/agent-server-conversation-service.api.js +126 -77
  257. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  258. package/dist/api/hooks-service.cjs +2 -0
  259. package/dist/api/hooks-service.cjs.map +1 -0
  260. package/dist/api/hooks-service.d.ts +13 -0
  261. package/dist/api/hooks-service.js +20 -0
  262. package/dist/api/hooks-service.js.map +1 -0
  263. package/dist/api/provider-connections-service/provider-connections-service.api.cjs +1 -1
  264. package/dist/api/provider-connections-service/provider-connections-service.api.cjs.map +1 -1
  265. package/dist/api/provider-connections-service/provider-connections-service.api.js +25 -16
  266. package/dist/api/provider-connections-service/provider-connections-service.api.js.map +1 -1
  267. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  268. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  269. package/dist/api/settings-service/settings-service.api.d.ts +2 -0
  270. package/dist/api/settings-service/settings-service.api.js +18 -10
  271. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  272. package/dist/api/skills-service.cjs +1 -1
  273. package/dist/api/skills-service.cjs.map +1 -1
  274. package/dist/api/skills-service.d.ts +7 -0
  275. package/dist/api/skills-service.js +11 -8
  276. package/dist/api/skills-service.js.map +1 -1
  277. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.cjs +1 -1
  278. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.js +5 -5
  279. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.cjs +1 -1
  280. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.cjs.map +1 -1
  281. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.js +2 -1
  282. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.js.map +1 -1
  283. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  284. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  285. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.d.ts +1 -1
  286. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +28 -28
  287. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  288. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.cjs +1 -1
  289. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.cjs.map +1 -1
  290. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.js +2 -1
  291. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.js.map +1 -1
  292. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs +1 -1
  293. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs.map +1 -1
  294. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.d.ts +1 -1
  295. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js +37 -37
  296. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js.map +1 -1
  297. package/dist/components/conversation-events/chat/event-message.cjs +2 -2
  298. package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
  299. package/dist/components/conversation-events/chat/event-message.js +79 -70
  300. package/dist/components/conversation-events/chat/event-message.js.map +1 -1
  301. package/dist/components/conversation-events/chat/messages.cjs +1 -1
  302. package/dist/components/conversation-events/chat/messages.cjs.map +1 -1
  303. package/dist/components/conversation-events/chat/messages.js +28 -27
  304. package/dist/components/conversation-events/chat/messages.js.map +1 -1
  305. package/dist/components/features/automations/automation-card.cjs +1 -1
  306. package/dist/components/features/automations/automation-card.cjs.map +1 -1
  307. package/dist/components/features/automations/automation-card.js +100 -94
  308. package/dist/components/features/automations/automation-card.js.map +1 -1
  309. package/dist/components/features/automations/automation-list-row.cjs +1 -1
  310. package/dist/components/features/automations/automation-list-row.cjs.map +1 -1
  311. package/dist/components/features/automations/automation-list-row.js +88 -77
  312. package/dist/components/features/automations/automation-list-row.js.map +1 -1
  313. package/dist/components/features/automations/detail/detail-header.d.ts +3 -1
  314. package/dist/components/features/automations/detail/run-status-badge.cjs +1 -1
  315. package/dist/components/features/automations/detail/run-status-badge.cjs.map +1 -1
  316. package/dist/components/features/automations/detail/run-status-badge.d.ts +2 -2
  317. package/dist/components/features/automations/detail/run-status-badge.js +82 -53
  318. package/dist/components/features/automations/detail/run-status-badge.js.map +1 -1
  319. package/dist/components/features/automations/kebab-menu.cjs +1 -1
  320. package/dist/components/features/automations/kebab-menu.cjs.map +1 -1
  321. package/dist/components/features/automations/kebab-menu.js +9 -5
  322. package/dist/components/features/automations/kebab-menu.js.map +1 -1
  323. package/dist/components/features/automations/recommended-automations-launcher.cjs +1 -1
  324. package/dist/components/features/automations/recommended-automations-launcher.cjs.map +1 -1
  325. package/dist/components/features/automations/recommended-automations-launcher.js +12 -12
  326. package/dist/components/features/automations/recommended-automations-launcher.js.map +1 -1
  327. package/dist/components/features/automations/recommended-automations-section.cjs +1 -1
  328. package/dist/components/features/automations/recommended-automations-section.js +9 -9
  329. package/dist/components/features/backends/backend-selector.cjs +1 -1
  330. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  331. package/dist/components/features/backends/backend-selector.js +133 -122
  332. package/dist/components/features/backends/backend-selector.js.map +1 -1
  333. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  334. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  335. package/dist/components/features/backends/manage-backends-modal.js +29 -29
  336. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  337. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  338. package/dist/components/features/chat/change-agent-button.js +4 -4
  339. package/dist/components/features/chat/chat-interface.cjs +2 -2
  340. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  341. package/dist/components/features/chat/chat-interface.js +137 -137
  342. package/dist/components/features/chat/chat-interface.js.map +1 -1
  343. package/dist/components/features/chat/chat-message.cjs +1 -1
  344. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  345. package/dist/components/features/chat/chat-message.d.ts +2 -1
  346. package/dist/components/features/chat/chat-message.js +88 -79
  347. package/dist/components/features/chat/chat-message.js.map +1 -1
  348. package/dist/components/features/chat/components/context-window-meter.cjs +1 -1
  349. package/dist/components/features/chat/components/context-window-meter.js +4 -4
  350. package/dist/components/features/chat/confirmation-mode-enabled.cjs +1 -1
  351. package/dist/components/features/chat/confirmation-mode-enabled.js +4 -4
  352. package/dist/components/features/chat/generic-event-message.cjs +1 -1
  353. package/dist/components/features/chat/generic-event-message.cjs.map +1 -1
  354. package/dist/components/features/chat/generic-event-message.d.ts +2 -1
  355. package/dist/components/features/chat/generic-event-message.js +41 -22
  356. package/dist/components/features/chat/generic-event-message.js.map +1 -1
  357. package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
  358. package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
  359. package/dist/components/features/chat/interactive-chat-box.js +20 -19
  360. package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
  361. package/dist/components/features/conversation/conversation-overview-git-section.cjs +1 -1
  362. package/dist/components/features/conversation/conversation-overview-git-section.js +4 -4
  363. package/dist/components/features/conversation/conversation-overview-skills-panel.cjs +1 -1
  364. package/dist/components/features/conversation/conversation-overview-skills-panel.js +4 -4
  365. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  366. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  367. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +77 -78
  368. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  369. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  370. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  371. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +88 -88
  372. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  373. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.cjs +2 -0
  374. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.cjs.map +1 -0
  375. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.d.ts +21 -0
  376. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.js +239 -0
  377. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.js.map +1 -0
  378. package/dist/components/features/conversation-panel/conversation-active-tag-filters.cjs +2 -0
  379. package/dist/components/features/conversation-panel/conversation-active-tag-filters.cjs.map +1 -0
  380. package/dist/components/features/conversation-panel/conversation-active-tag-filters.d.ts +28 -0
  381. package/dist/components/features/conversation-panel/conversation-active-tag-filters.js +69 -0
  382. package/dist/components/features/conversation-panel/conversation-active-tag-filters.js.map +1 -0
  383. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  384. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  385. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +2 -1
  386. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +19 -18
  387. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  388. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  389. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  390. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +2 -1
  391. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +91 -80
  392. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  393. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
  394. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
  395. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +1 -1
  396. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
  397. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  398. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  399. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +7 -1
  400. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +87 -81
  401. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  402. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +1 -1
  403. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -1
  404. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +2 -1
  405. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +1 -1
  406. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -1
  407. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +1 -1
  408. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -1
  409. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +2 -1
  410. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +2 -1
  411. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -1
  412. package/dist/components/features/conversation-panel/conversation-layouts-menu.cjs +2 -0
  413. package/dist/components/features/conversation-panel/conversation-layouts-menu.cjs.map +1 -0
  414. package/dist/components/features/conversation-panel/conversation-layouts-menu.d.ts +29 -0
  415. package/dist/components/features/conversation-panel/conversation-layouts-menu.js +177 -0
  416. package/dist/components/features/conversation-panel/conversation-layouts-menu.js.map +1 -0
  417. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  418. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  419. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +37 -0
  420. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +85 -45
  421. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  422. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  423. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  424. package/dist/components/features/conversation-panel/conversation-panel.js +296 -290
  425. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  426. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.cjs +2 -0
  427. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.cjs.map +1 -0
  428. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.d.ts +22 -0
  429. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.js +153 -0
  430. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.js.map +1 -0
  431. package/dist/components/features/conversation-panel/hide-older-conversations-row.cjs +2 -0
  432. package/dist/components/features/conversation-panel/hide-older-conversations-row.cjs.map +1 -0
  433. package/dist/components/features/conversation-panel/hide-older-conversations-row.d.ts +6 -0
  434. package/dist/components/features/conversation-panel/hide-older-conversations-row.js +65 -0
  435. package/dist/components/features/conversation-panel/hide-older-conversations-row.js.map +1 -0
  436. package/dist/components/features/conversation-panel/menu-row.cjs +1 -1
  437. package/dist/components/features/conversation-panel/menu-row.cjs.map +1 -1
  438. package/dist/components/features/conversation-panel/menu-row.d.ts +11 -1
  439. package/dist/components/features/conversation-panel/menu-row.js +27 -16
  440. package/dist/components/features/conversation-panel/menu-row.js.map +1 -1
  441. package/dist/components/features/home/featured-automations/automation-health-indicator.cjs +1 -1
  442. package/dist/components/features/home/featured-automations/automation-health-indicator.cjs.map +1 -1
  443. package/dist/components/features/home/featured-automations/automation-health-indicator.js +1 -1
  444. package/dist/components/features/home/featured-automations/automation-health-indicator.js.map +1 -1
  445. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.cjs +1 -1
  446. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.cjs.map +1 -1
  447. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.d.ts +4 -3
  448. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.js +22 -25
  449. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.js.map +1 -1
  450. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.cjs +1 -1
  451. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.cjs.map +1 -1
  452. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.d.ts +1 -1
  453. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.js +15 -15
  454. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.js.map +1 -1
  455. package/dist/components/features/home/featured-automations/automation-run-health.cjs +1 -1
  456. package/dist/components/features/home/featured-automations/automation-run-health.cjs.map +1 -1
  457. package/dist/components/features/home/featured-automations/automation-run-health.d.ts +5 -3
  458. package/dist/components/features/home/featured-automations/automation-run-health.js +30 -23
  459. package/dist/components/features/home/featured-automations/automation-run-health.js.map +1 -1
  460. package/dist/components/features/home/featured-automations/home-automation-activity.d.ts +3 -2
  461. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  462. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  463. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.d.ts +1 -1
  464. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +42 -42
  465. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  466. package/dist/components/features/manifest/manifest-form-field.d.ts +3 -1
  467. package/dist/components/features/manifest/manifest-review-step.d.ts +3 -1
  468. package/dist/components/features/settings/cloud-settings-link.cjs +1 -1
  469. package/dist/components/features/settings/cloud-settings-link.cjs.map +1 -1
  470. package/dist/components/features/settings/cloud-settings-link.js +5 -3
  471. package/dist/components/features/settings/cloud-settings-link.js.map +1 -1
  472. package/dist/components/features/settings/integrations-settings-link.cjs +1 -1
  473. package/dist/components/features/settings/integrations-settings-link.cjs.map +1 -1
  474. package/dist/components/features/settings/integrations-settings-link.d.ts +3 -1
  475. package/dist/components/features/settings/integrations-settings-link.js +20 -17
  476. package/dist/components/features/settings/integrations-settings-link.js.map +1 -1
  477. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  478. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -1
  479. package/dist/components/features/settings/llm-profiles/profiles-body.d.ts +2 -2
  480. package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs +1 -1
  481. package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs.map +1 -1
  482. package/dist/components/features/settings/sdk-settings/sdk-section-page.d.ts +8 -7
  483. package/dist/components/features/settings/sdk-settings/sdk-section-page.js +172 -142
  484. package/dist/components/features/settings/sdk-settings/sdk-section-page.js.map +1 -1
  485. package/dist/components/features/settings/secrets-settings/secret-form.cjs +1 -1
  486. package/dist/components/features/settings/secrets-settings/secret-form.cjs.map +1 -1
  487. package/dist/components/features/settings/secrets-settings/secret-form.js +38 -25
  488. package/dist/components/features/settings/secrets-settings/secret-form.js.map +1 -1
  489. package/dist/components/features/settings/settings-dropdown-input.cjs +1 -1
  490. package/dist/components/features/settings/settings-dropdown-input.js +6 -6
  491. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  492. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  493. package/dist/components/features/sidebar/sidebar-rail-body.d.ts +3 -1
  494. package/dist/components/features/sidebar/sidebar-rail-body.js +156 -139
  495. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  496. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  497. package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
  498. package/dist/components/features/sidebar/sidebar.js +44 -43
  499. package/dist/components/features/sidebar/sidebar.js.map +1 -1
  500. package/dist/components/features/sidebar/use-sidebar-onboarding-checklist.cjs +1 -1
  501. package/dist/components/features/sidebar/use-sidebar-onboarding-checklist.js +3 -3
  502. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  503. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  504. package/dist/components/features/skills/extensions-navigation.js +3 -3
  505. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  506. package/dist/components/shared/buttons/styled-tooltip.cjs +1 -1
  507. package/dist/components/shared/buttons/styled-tooltip.cjs.map +1 -1
  508. package/dist/components/shared/buttons/styled-tooltip.d.ts +2 -1
  509. package/dist/components/shared/buttons/styled-tooltip.js +2 -1
  510. package/dist/components/shared/buttons/styled-tooltip.js.map +1 -1
  511. package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
  512. package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
  513. package/dist/components/shared/filters/enum-filter-dropdown.d.ts +5 -1
  514. package/dist/components/shared/filters/enum-filter-dropdown.js +14 -14
  515. package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
  516. package/dist/components/shared/modals/confirmation-modal.cjs +1 -1
  517. package/dist/components/shared/modals/confirmation-modal.cjs.map +1 -1
  518. package/dist/components/shared/modals/confirmation-modal.d.ts +2 -1
  519. package/dist/components/shared/modals/confirmation-modal.js +8 -8
  520. package/dist/components/shared/modals/confirmation-modal.js.map +1 -1
  521. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  522. package/dist/components/shared/modals/settings/model-selector.js +27 -27
  523. package/dist/config/defaults.cjs +1 -1
  524. package/dist/config/defaults.cjs.map +1 -1
  525. package/dist/config/defaults.js +3 -3
  526. package/dist/config/defaults.js.map +1 -1
  527. package/dist/constants/settings-nav.d.ts +8 -0
  528. package/dist/contexts/conversation-websocket-context.cjs +3 -3
  529. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  530. package/dist/contexts/conversation-websocket-context.d.ts +5 -0
  531. package/dist/contexts/conversation-websocket-context.js +194 -198
  532. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  533. package/dist/contexts/websocket-provider-wrapper.cjs +1 -1
  534. package/dist/contexts/websocket-provider-wrapper.cjs.map +1 -1
  535. package/dist/contexts/websocket-provider-wrapper.js +31 -15
  536. package/dist/contexts/websocket-provider-wrapper.js.map +1 -1
  537. package/dist/hooks/chat/record-model-switch-message.cjs +1 -1
  538. package/dist/hooks/chat/record-model-switch-message.cjs.map +1 -1
  539. package/dist/hooks/chat/record-model-switch-message.d.ts +31 -0
  540. package/dist/hooks/chat/record-model-switch-message.js +25 -12
  541. package/dist/hooks/chat/record-model-switch-message.js.map +1 -1
  542. package/dist/hooks/chat/use-plan-mode-interceptor.cjs +2 -0
  543. package/dist/hooks/chat/use-plan-mode-interceptor.cjs.map +1 -0
  544. package/dist/hooks/chat/use-plan-mode-interceptor.d.ts +16 -0
  545. package/dist/hooks/chat/use-plan-mode-interceptor.js +43 -0
  546. package/dist/hooks/chat/use-plan-mode-interceptor.js.map +1 -0
  547. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  548. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  549. package/dist/hooks/mutation/use-create-conversation.js +5 -1
  550. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  551. package/dist/hooks/mutation/use-read-conversation-file.cjs +1 -1
  552. package/dist/hooks/mutation/use-read-conversation-file.cjs.map +1 -1
  553. package/dist/hooks/mutation/use-read-conversation-file.js +11 -4
  554. package/dist/hooks/mutation/use-read-conversation-file.js.map +1 -1
  555. package/dist/hooks/mutation/use-save-settings.cjs +1 -1
  556. package/dist/hooks/mutation/use-save-settings.js +3 -3
  557. package/dist/hooks/mutation/use-switch-llm-profile.cjs +1 -1
  558. package/dist/hooks/mutation/use-switch-llm-profile.cjs.map +1 -1
  559. package/dist/hooks/mutation/use-switch-llm-profile.js +13 -25
  560. package/dist/hooks/mutation/use-switch-llm-profile.js.map +1 -1
  561. package/dist/hooks/mutation/use-update-conversation-tags.cjs +2 -0
  562. package/dist/hooks/mutation/use-update-conversation-tags.cjs.map +1 -0
  563. package/dist/hooks/mutation/use-update-conversation-tags.d.ts +8 -0
  564. package/dist/hooks/mutation/use-update-conversation-tags.js +45 -0
  565. package/dist/hooks/mutation/use-update-conversation-tags.js.map +1 -0
  566. package/dist/hooks/query/query-keys.cjs +1 -1
  567. package/dist/hooks/query/query-keys.cjs.map +1 -1
  568. package/dist/hooks/query/query-keys.d.ts +6 -0
  569. package/dist/hooks/query/query-keys.js +2 -2
  570. package/dist/hooks/query/query-keys.js.map +1 -1
  571. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  572. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  573. package/dist/hooks/query/use-automation-sdk-version.d.ts +0 -1
  574. package/dist/hooks/query/use-automation-sdk-version.js +30 -55
  575. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  576. package/dist/hooks/query/use-conversation-skills.cjs +1 -1
  577. package/dist/hooks/query/use-conversation-skills.cjs.map +1 -1
  578. package/dist/hooks/query/use-conversation-skills.d.ts +14 -5
  579. package/dist/hooks/query/use-conversation-skills.js +20 -4
  580. package/dist/hooks/query/use-conversation-skills.js.map +1 -1
  581. package/dist/hooks/query/use-provider-connections.cjs +1 -1
  582. package/dist/hooks/query/use-provider-connections.cjs.map +1 -1
  583. package/dist/hooks/query/use-provider-connections.d.ts +6 -3
  584. package/dist/hooks/query/use-provider-connections.js +7 -3
  585. package/dist/hooks/query/use-provider-connections.js.map +1 -1
  586. package/dist/hooks/query/use-sub-conversations.cjs +1 -1
  587. package/dist/hooks/query/use-sub-conversations.cjs.map +1 -1
  588. package/dist/hooks/query/use-sub-conversations.js +16 -16
  589. package/dist/hooks/query/use-sub-conversations.js.map +1 -1
  590. package/dist/hooks/use-acp-model-context.cjs +1 -1
  591. package/dist/hooks/use-acp-model-context.js +3 -3
  592. package/dist/hooks/use-agent-state.cjs +1 -1
  593. package/dist/hooks/use-agent-state.cjs.map +1 -1
  594. package/dist/hooks/use-agent-state.d.ts +17 -1
  595. package/dist/hooks/use-agent-state.js +19 -9
  596. package/dist/hooks/use-agent-state.js.map +1 -1
  597. package/dist/hooks/use-automation-permissions.cjs +2 -0
  598. package/dist/hooks/use-automation-permissions.cjs.map +1 -0
  599. package/dist/hooks/use-automation-permissions.d.ts +43 -0
  600. package/dist/hooks/use-automation-permissions.js +52 -0
  601. package/dist/hooks/use-automation-permissions.js.map +1 -0
  602. package/dist/hooks/use-chat-input-model-state.cjs +1 -1
  603. package/dist/hooks/use-chat-input-model-state.js +3 -3
  604. package/dist/hooks/use-handle-plan-click.cjs +1 -1
  605. package/dist/hooks/use-handle-plan-click.cjs.map +1 -1
  606. package/dist/hooks/use-handle-plan-click.d.ts +3 -1
  607. package/dist/hooks/use-handle-plan-click.js +85 -26
  608. package/dist/hooks/use-handle-plan-click.js.map +1 -1
  609. package/dist/hooks/use-home-automation-actions.cjs +1 -1
  610. package/dist/hooks/use-home-automation-actions.cjs.map +1 -1
  611. package/dist/hooks/use-home-automation-actions.js +1 -0
  612. package/dist/hooks/use-home-automation-actions.js.map +1 -1
  613. package/dist/hooks/use-llm-configured.cjs +1 -1
  614. package/dist/hooks/use-llm-configured.js +3 -3
  615. package/dist/hooks/use-manifest-preflight.d.ts +1 -1
  616. package/dist/hooks/use-unified-websocket-status.cjs +1 -1
  617. package/dist/hooks/use-unified-websocket-status.cjs.map +1 -1
  618. package/dist/hooks/use-unified-websocket-status.d.ts +7 -0
  619. package/dist/hooks/use-unified-websocket-status.js +5 -1
  620. package/dist/hooks/use-unified-websocket-status.js.map +1 -1
  621. package/dist/i18n/declaration.cjs +1 -1
  622. package/dist/i18n/declaration.cjs.map +1 -1
  623. package/dist/i18n/declaration.d.ts +65 -12
  624. package/dist/i18n/declaration.js +1 -1
  625. package/dist/i18n/declaration.js.map +1 -1
  626. package/dist/i18n/translation.cjs +2 -2
  627. package/dist/i18n/translation.cjs.map +1 -1
  628. package/dist/i18n/translation.js +1196 -295
  629. package/dist/i18n/translation.js.map +1 -1
  630. package/dist/locales/ar/openhands.json +73 -20
  631. package/dist/locales/ca/openhands.json +73 -20
  632. package/dist/locales/de/openhands.json +73 -20
  633. package/dist/locales/en/openhands.json +73 -20
  634. package/dist/locales/es/openhands.json +73 -20
  635. package/dist/locales/fr/openhands.json +73 -20
  636. package/dist/locales/it/openhands.json +73 -20
  637. package/dist/locales/ja/openhands.json +73 -20
  638. package/dist/locales/ko-KR/openhands.json +73 -20
  639. package/dist/locales/no/openhands.json +73 -20
  640. package/dist/locales/pt/openhands.json +73 -20
  641. package/dist/locales/tr/openhands.json +73 -20
  642. package/dist/locales/uk/openhands.json +73 -20
  643. package/dist/locales/zh-CN/openhands.json +73 -20
  644. package/dist/locales/zh-TW/openhands.json +73 -20
  645. package/dist/manifests/automation-insights.cjs.map +1 -1
  646. package/dist/manifests/automation-insights.d.ts +10 -2
  647. package/dist/manifests/automation-insights.js.map +1 -1
  648. package/dist/manifests/automation-setup.cjs +1 -1
  649. package/dist/manifests/automation-setup.cjs.map +1 -1
  650. package/dist/manifests/automation-setup.d.ts +9 -16
  651. package/dist/manifests/automation-setup.js +17 -7
  652. package/dist/manifests/automation-setup.js.map +1 -1
  653. package/dist/manifests/manifest-actions.d.ts +1 -1
  654. package/dist/manifests/manifest-capabilities.d.ts +3 -1
  655. package/dist/manifests/manifest-local-validation.cjs +2 -0
  656. package/dist/manifests/manifest-local-validation.cjs.map +1 -0
  657. package/dist/manifests/manifest-local-validation.d.ts +15 -11
  658. package/dist/manifests/manifest-local-validation.js +8 -0
  659. package/dist/manifests/manifest-local-validation.js.map +1 -0
  660. package/dist/manifests/manifest-template.cjs +2 -0
  661. package/dist/manifests/manifest-template.cjs.map +1 -0
  662. package/dist/manifests/manifest-template.d.ts +4 -4
  663. package/dist/manifests/manifest-template.js +12 -0
  664. package/dist/manifests/manifest-template.js.map +1 -0
  665. package/dist/manifests/manifest-validation.cjs +1 -1
  666. package/dist/manifests/manifest-validation.cjs.map +1 -1
  667. package/dist/manifests/manifest-validation.js +106 -28
  668. package/dist/manifests/manifest-validation.js.map +1 -1
  669. package/dist/manifests/types.cjs.map +1 -1
  670. package/dist/manifests/types.d.ts +39 -4
  671. package/dist/manifests/types.js.map +1 -1
  672. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.cjs +8 -0
  673. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.cjs.map +1 -0
  674. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.js +221 -0
  675. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.js.map +1 -0
  676. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -1
  677. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  678. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +1 -1
  679. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  680. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -1
  681. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  682. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +1 -1
  683. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  684. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs +1 -1
  685. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs.map +1 -1
  686. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js +1 -1
  687. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js.map +1 -1
  688. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  689. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  690. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +22 -20
  691. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  692. package/dist/node_modules/@openhands/extensions/automations/interface.cjs +1 -1
  693. package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -1
  694. package/dist/node_modules/@openhands/extensions/automations/interface.js +2 -1
  695. package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -1
  696. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs +1 -1
  697. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs.map +1 -1
  698. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js +24 -5
  699. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js.map +1 -1
  700. package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +1 -1
  701. package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +1 -1
  702. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.cjs +2 -0
  703. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.cjs.map +1 -0
  704. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.js +21 -0
  705. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.js.map +1 -0
  706. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.cjs +2 -0
  707. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.cjs.map +1 -0
  708. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.js +23 -0
  709. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.js.map +1 -0
  710. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.cjs +2 -0
  711. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.cjs.map +1 -0
  712. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js +43 -0
  713. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js.map +1 -0
  714. package/dist/node_modules/lucide-react/dist/esm/icons/tags.cjs +2 -0
  715. package/dist/node_modules/lucide-react/dist/esm/icons/tags.cjs.map +1 -0
  716. package/dist/node_modules/lucide-react/dist/esm/icons/tags.js +22 -0
  717. package/dist/node_modules/lucide-react/dist/esm/icons/tags.js.map +1 -0
  718. package/dist/package.cjs +1 -1
  719. package/dist/package.cjs.map +1 -1
  720. package/dist/package.js +4 -4
  721. package/dist/package.js.map +1 -1
  722. package/dist/routes/agent-settings.d.ts +2 -0
  723. package/dist/routes/app-settings.cjs +1 -1
  724. package/dist/routes/app-settings.js +5 -5
  725. package/dist/routes/llm-settings.cjs +1 -1
  726. package/dist/routes/llm-settings.cjs.map +1 -1
  727. package/dist/routes/llm-settings.d.ts +3 -1
  728. package/dist/routes/llm-settings.js +88 -87
  729. package/dist/routes/llm-settings.js.map +1 -1
  730. package/dist/routes/planner-tab.cjs +1 -1
  731. package/dist/routes/planner-tab.cjs.map +1 -1
  732. package/dist/routes/planner-tab.js +44 -28
  733. package/dist/routes/planner-tab.js.map +1 -1
  734. package/dist/services/telemetry.cjs +1 -1
  735. package/dist/services/telemetry.cjs.map +1 -1
  736. package/dist/services/telemetry.d.ts +5 -0
  737. package/dist/services/telemetry.js +122 -115
  738. package/dist/services/telemetry.js.map +1 -1
  739. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  740. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  741. package/dist/stores/conversation-panel-preferences-store.d.ts +32 -5
  742. package/dist/stores/conversation-panel-preferences-store.js +29 -12
  743. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  744. package/dist/stores/conversation-state-store.cjs +1 -1
  745. package/dist/stores/conversation-state-store.cjs.map +1 -1
  746. package/dist/stores/conversation-state-store.d.ts +9 -3
  747. package/dist/stores/conversation-state-store.js +6 -3
  748. package/dist/stores/conversation-state-store.js.map +1 -1
  749. package/dist/stores/conversation-store.cjs +1 -1
  750. package/dist/stores/conversation-store.cjs.map +1 -1
  751. package/dist/stores/conversation-store.d.ts +2 -0
  752. package/dist/stores/conversation-store.js +3 -0
  753. package/dist/stores/conversation-store.js.map +1 -1
  754. package/dist/stores/model-store.cjs +1 -1
  755. package/dist/stores/model-store.cjs.map +1 -1
  756. package/dist/stores/model-store.d.ts +7 -0
  757. package/dist/stores/model-store.js +4 -0
  758. package/dist/stores/model-store.js.map +1 -1
  759. package/dist/types/automation.cjs.map +1 -1
  760. package/dist/types/automation.d.ts +46 -1
  761. package/dist/types/automation.js.map +1 -1
  762. package/dist/ui/context-menu.d.ts +1 -1
  763. package/dist/ui/toggle-switch.cjs +1 -1
  764. package/dist/ui/toggle-switch.cjs.map +1 -1
  765. package/dist/ui/toggle-switch.d.ts +4 -1
  766. package/dist/ui/toggle-switch.js +4 -3
  767. package/dist/ui/toggle-switch.js.map +1 -1
  768. package/dist/utils/automation-catalog.cjs +1 -1
  769. package/dist/utils/automation-catalog.cjs.map +1 -1
  770. package/dist/utils/automation-catalog.d.ts +12 -1
  771. package/dist/utils/automation-catalog.js +42 -12
  772. package/dist/utils/automation-catalog.js.map +1 -1
  773. package/dist/utils/automation-run-display.cjs +2 -0
  774. package/dist/utils/automation-run-display.cjs.map +1 -0
  775. package/dist/utils/automation-run-display.d.ts +20 -0
  776. package/dist/utils/automation-run-display.js +85 -0
  777. package/dist/utils/automation-run-display.js.map +1 -0
  778. package/dist/utils/automation-schedule.cjs +1 -1
  779. package/dist/utils/automation-schedule.cjs.map +1 -1
  780. package/dist/utils/automation-schedule.d.ts +16 -0
  781. package/dist/utils/automation-schedule.js +2 -0
  782. package/dist/utils/automation-schedule.js.map +1 -1
  783. package/dist/utils/constants.cjs +1 -1
  784. package/dist/utils/constants.cjs.map +1 -1
  785. package/dist/utils/constants.d.ts +4 -0
  786. package/dist/utils/constants.js +23 -3
  787. package/dist/utils/constants.js.map +1 -1
  788. package/dist/utils/format-event-timestamp.cjs +2 -0
  789. package/dist/utils/format-event-timestamp.cjs.map +1 -0
  790. package/dist/utils/format-event-timestamp.d.ts +1 -0
  791. package/dist/utils/format-event-timestamp.js +13 -0
  792. package/dist/utils/format-event-timestamp.js.map +1 -0
  793. package/dist/utils/git-diff-stats.cjs +2 -2
  794. package/dist/utils/git-diff-stats.cjs.map +1 -1
  795. package/dist/utils/git-diff-stats.d.ts +4 -0
  796. package/dist/utils/git-diff-stats.js +12 -2
  797. package/dist/utils/git-diff-stats.js.map +1 -1
  798. package/dist/utils/plan-file.cjs +4 -0
  799. package/dist/utils/plan-file.cjs.map +1 -0
  800. package/dist/utils/plan-file.d.ts +18 -0
  801. package/dist/utils/plan-file.js +58 -0
  802. package/dist/utils/plan-file.js.map +1 -0
  803. package/dist/utils/recommended-automation-rail.cjs +1 -1
  804. package/dist/utils/recommended-automation-rail.cjs.map +1 -1
  805. package/dist/utils/recommended-automation-rail.js +1 -0
  806. package/dist/utils/recommended-automation-rail.js.map +1 -1
  807. package/dist/utils/scroll-fade-state.cjs +1 -1
  808. package/dist/utils/scroll-fade-state.cjs.map +1 -1
  809. package/dist/utils/scroll-fade-state.d.ts +6 -0
  810. package/dist/utils/scroll-fade-state.js +8 -1
  811. package/dist/utils/scroll-fade-state.js.map +1 -1
  812. package/dist/utils/sdk-settings-schema.cjs +1 -1
  813. package/dist/utils/sdk-settings-schema.cjs.map +1 -1
  814. package/dist/utils/sdk-settings-schema.d.ts +1 -0
  815. package/dist/utils/sdk-settings-schema.js +25 -22
  816. package/dist/utils/sdk-settings-schema.js.map +1 -1
  817. package/dist/utils/utils.cjs +1 -1
  818. package/dist/utils/utils.cjs.map +1 -1
  819. package/dist/utils/utils.js +11 -11
  820. package/dist/utils/utils.js.map +1 -1
  821. package/package.json +4 -4
  822. package/scripts/check-sdk-version-sync.mjs +6 -6
  823. package/scripts/dev-safe.mjs +1 -1
  824. package/scripts/dev-with-automation.mjs +1 -1
  825. package/scripts/static-server.mjs +33 -1
  826. package/build/assets/active-backend-context-CrHTlgvN.js +0 -2
  827. package/build/assets/agent-profiles-settings-Dzgb7G9z.js +0 -1
  828. package/build/assets/agent-server-conversation-service.api-tnqNjbpE.js +0 -86
  829. package/build/assets/agent-settings-DLtsqaOs.js +0 -2
  830. package/build/assets/agent-settings-fFvR-XC2.js +0 -1
  831. package/build/assets/api-key-entry-screen-qTzrmJcr.js +0 -1
  832. package/build/assets/automation-detail-BmwlCUAB.js +0 -3
  833. package/build/assets/automation-git-sync-CprN5DcU.js +0 -1
  834. package/build/assets/automation-setup-route-C40kXjMY.js +0 -1
  835. package/build/assets/automations-list-DuNcRawl.js +0 -1
  836. package/build/assets/backend-form-modal-lhGwzXFI.js +0 -1
  837. package/build/assets/bot-dMYHVfYM.js +0 -1
  838. package/build/assets/canvas-extensions-8A-XhpgP.js +0 -1
  839. package/build/assets/check-CS0vmpQQ.js +0 -1
  840. package/build/assets/chevron-down-e1QBpjVy.js +0 -1
  841. package/build/assets/chevron-right-ZG4R5G4Q.js +0 -1
  842. package/build/assets/circle-check-DzWLNsbE.js +0 -1
  843. package/build/assets/command-menu--UIlGL72.js +0 -1
  844. package/build/assets/commits-tab-AnZwLvh-.js +0 -1
  845. package/build/assets/confirmation-modal-Dv1ktp8K.js +0 -1
  846. package/build/assets/conversation-BbGrAO4Z.js +0 -93
  847. package/build/assets/conversation-mYT6NAoj.js +0 -1
  848. package/build/assets/conversation-panel-mYT6NAoj.js +0 -1
  849. package/build/assets/edit-automation-modal-DadGbJ2u.js +0 -1
  850. package/build/assets/empty-state-BoGVDecT.js +0 -1
  851. package/build/assets/enum-filter-dropdown-Bgca129f.js +0 -1
  852. package/build/assets/extensions-hub-CcDqq_vR.js +0 -1
  853. package/build/assets/extensions-navigation-Cr4yzYk4.js +0 -1
  854. package/build/assets/external-link-DKUlnCQV.js +0 -1
  855. package/build/assets/files-tab-D4o2VyE_.js +0 -1
  856. package/build/assets/get-git-path-ChKDVHZp.js +0 -1
  857. package/build/assets/git-repo-dropdown-BkqzkMmM.js +0 -1
  858. package/build/assets/home-ChpSuepX.js +0 -1
  859. package/build/assets/home-DIsB440S.js +0 -1
  860. package/build/assets/home-automation-run-tooltip-BVNDWjAH.js +0 -1
  861. package/build/assets/home-store-CY9Ej0ux.js +0 -1
  862. package/build/assets/index-home-BdlrFIif.js +0 -1
  863. package/build/assets/info-B6RQawoW.js +0 -1
  864. package/build/assets/install-server-modal-Dpy89p4g.js +0 -1
  865. package/build/assets/kebab-menu-item-content-D8hSNGmm.js +0 -1
  866. package/build/assets/list-filter-DsEK7NFC.js +0 -1
  867. package/build/assets/llm-not-configured-banner-CIFABh3K.js +0 -27
  868. package/build/assets/llm-settings-B9juXhIa.js +0 -1
  869. package/build/assets/llm-settings-De1d5dfr.js +0 -1
  870. package/build/assets/llm-subscription-service-BpJ0ouQo.js +0 -1
  871. package/build/assets/loader-circle-CC1au6hc.js +0 -1
  872. package/build/assets/manage-backends-modal-BrPV3oB-.js +0 -1
  873. package/build/assets/manifest-80fb1c29.js +0 -1
  874. package/build/assets/markdown-renderer-BzTlxI8x.js +0 -8
  875. package/build/assets/mcp-page-BEBYqH_K.js +0 -9
  876. package/build/assets/messages-DKV9cRc2.js +0 -41
  877. package/build/assets/onboarding-DV_OXoeP.js +0 -1
  878. package/build/assets/onboarding-modal-rkyBYkeQ.js +0 -1
  879. package/build/assets/organization-service.api-DrYNkEN_.js +0 -1
  880. package/build/assets/pencil-47jAZH_V.js +0 -1
  881. package/build/assets/pin-By41Vl5J.js +0 -1
  882. package/build/assets/planner-tab-C9uZmhme.js +0 -1
  883. package/build/assets/plug-CG5HFcNG.js +0 -1
  884. package/build/assets/plugins-management-service-BMJgC3Ga.js +0 -1
  885. package/build/assets/plus-C7Slq-0I.js +0 -1
  886. package/build/assets/profiles-service.api-ChoKrL0l.js +0 -1
  887. package/build/assets/proxy-9Fe1v5na.js +0 -1
  888. package/build/assets/recommended-automations-launcher-6ABrI9Cy.js +0 -1
  889. package/build/assets/refresh-cw-3q3Frrii.js +0 -1
  890. package/build/assets/root-Dc8YmC9F.js +0 -2
  891. package/build/assets/root-VDaypvK4.css +0 -1
  892. package/build/assets/root-layout-CXkhSPYh.js +0 -2
  893. package/build/assets/schema-field-D-y9-LDb.js +0 -1
  894. package/build/assets/scroll-fade-state-Dw-i4SGq.js +0 -1
  895. package/build/assets/sdk-section-page-BlFiizlG.js +0 -1
  896. package/build/assets/secret-form-BB7the8W.js +0 -1
  897. package/build/assets/secrets-service-ByZVENbp.js +0 -1
  898. package/build/assets/settings-C0EWuBtA.js +0 -1
  899. package/build/assets/settings-index-5w5UW2K3.js +0 -1
  900. package/build/assets/settings-service.api-DJ1r62Zr.js +0 -1
  901. package/build/assets/shared-conversation-CA5ISEDy.js +0 -1
  902. package/build/assets/shield-check-D2aCRd16.js +0 -1
  903. package/build/assets/sidebar-mobile-menu-toggle-C_fb0Jki.js +0 -1
  904. package/build/assets/skill-scope-B42H-XOc.js +0 -1
  905. package/build/assets/skills-plugins-tgF8EiXC.js +0 -1
  906. package/build/assets/skills-settings-BgJ9PaOe.js +0 -1
  907. package/build/assets/styled-tooltip-C4jf5Fv9.js +0 -1
  908. package/build/assets/toggle-switch-ChOLXv2n.js +0 -1
  909. package/build/assets/trash-2-D7K26eDO.js +0 -1
  910. package/build/assets/trash-D-HYiVYM.js +0 -1
  911. package/build/assets/triangle-alert-CtdXWHUI.js +0 -1
  912. package/build/assets/usage-tab-CVDffLPt.js +0 -1
  913. package/build/assets/use-acp-credential-form-XIQmpX6M.js +0 -1
  914. package/build/assets/use-activate-agent-profile-BLfmvDiG.js +0 -1
  915. package/build/assets/use-agent-profiles-Bd9Bvvp1.js +0 -1
  916. package/build/assets/use-canvas-extensions-Bi693ujJ.js +0 -1
  917. package/build/assets/use-config-A9QovgXO.js +0 -1
  918. package/build/assets/use-create-conversation-Dx3l7mFZ.js +0 -1
  919. package/build/assets/use-create-secret-B9cUFWRG.js +0 -1
  920. package/build/assets/use-has-permission-B3C8rQmR.js +0 -1
  921. package/build/assets/use-is-authed-nTBcM7dE.js +0 -1
  922. package/build/assets/use-llm-configured-BV9nZ1_j.js +0 -1
  923. package/build/assets/use-llm-profiles-BO-P4Oyo.js +0 -1
  924. package/build/assets/use-manifest-capabilities-Cw_flwEz.js +0 -1
  925. package/build/assets/use-onboarding-completion-D8U7k4Qb.js +0 -1
  926. package/build/assets/use-pinned-home-route-CckOZrmb.js +0 -1
  927. package/build/assets/use-plugins-marketplace-7i94Zu3Z.js +0 -1
  928. package/build/assets/use-save-agent-profile-BUjSsDXK.js +0 -1
  929. package/build/assets/use-settings-DSXLbvBl.js +0 -1
  930. package/build/assets/use-settings-nav-items-CwRw-CmX.js +0 -16
  931. package/build/assets/use-tracking-D53y3TH9.js +0 -3
  932. package/build/assets/utils-CN5ZfZy1.js +0 -1
  933. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js +0 -186
  934. package/build/assets/vendor~root-layout-C9Ju9DQg.js +0 -1
  935. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-cDuKr-WD.js +0 -1
  936. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js +0 -1
  937. package/build/assets/x-DJdhbdmt.js +0 -1
  938. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +0 -2
  939. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +0 -1
  940. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +0 -35
  941. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +0 -247
  942. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +0 -1
  943. package/dist/hooks/query/use-skills.cjs +0 -2
  944. package/dist/hooks/query/use-skills.cjs.map +0 -1
  945. package/dist/hooks/query/use-skills.d.ts +0 -7
  946. package/dist/hooks/query/use-skills.js +0 -13
  947. package/dist/hooks/query/use-skills.js.map +0 -1
  948. package/dist/hooks/use-has-permission.cjs +0 -2
  949. package/dist/hooks/use-has-permission.cjs.map +0 -1
  950. package/dist/hooks/use-has-permission.d.ts +0 -1
  951. package/dist/hooks/use-has-permission.js +0 -8
  952. package/dist/hooks/use-has-permission.js.map +0 -1
  953. package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs +0 -2
  954. package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs.map +0 -1
  955. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +0 -14
  956. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js.map +0 -1
@@ -31,10 +31,34 @@ export interface ConversationMetadata {
31
31
  * is ambiguous (issue #1082).
32
32
  */
33
33
  active_profile?: string | null;
34
+ /**
35
+ * When `active_profile` was stamped (ISO string). Written by the live
36
+ * WebSocket handler (the observation's server timestamp) and the user
37
+ * `/model` mutation (client clock). The history seed compares the latest
38
+ * SwitchLLM observation's timestamp against this so a reload can repair a
39
+ * missed agent switch without rolling back a newer manual switch — manual
40
+ * `/model` switches go through REST and leave no observation in history.
41
+ * Absent on stamps written before this field existed; treated as older
42
+ * than any observation so the seed can still repair them.
43
+ */
44
+ stamped_at?: string | null;
34
45
  /** Store plugin coordinates only; parameters may contain secrets. */
35
46
  plugins?: PluginSpec[] | null;
47
+ /**
48
+ * Local-only client-managed planning conversation id. Cloud backends expose
49
+ * real sub-conversations through `sub_conversation_ids`; local agent-server
50
+ * backends do not, so Canvas stores the relationship here.
51
+ */
52
+ local_planning_conversation_id?: string | null;
36
53
  }
37
54
  export declare const toPluginCoordinates: (plugin: PluginSpec) => PluginSpec;
38
55
  export declare const getStoredConversationMetadata: (conversationId: string) => ConversationMetadata | null;
39
56
  export declare const setStoredConversationMetadata: (conversationId: string, metadata: ConversationMetadata) => void;
57
+ /**
58
+ * Merge `patch` into a conversation's stored metadata, preserving every
59
+ * existing field — `setStoredConversationMetadata` does a full-object
60
+ * replace, which would otherwise silently drop fields the caller doesn't
61
+ * enumerate (e.g. `plugins`).
62
+ */
63
+ export declare const mergeStoredConversationMetadata: (conversationId: string, patch: Partial<ConversationMetadata>) => void;
40
64
  export declare const removeStoredConversationMetadata: (conversationId: string) => void;
@@ -24,11 +24,19 @@ var e = "openhands-agent-server-conversation-metadata", t = (e) => ({
24
24
  }, i = (e) => n()[e] ?? null, a = (e, t) => {
25
25
  let i = n();
26
26
  i[e] = t, r(i);
27
- }, o = (e) => {
27
+ }, o = (e, t) => {
28
+ a(e, {
29
+ selected_repository: null,
30
+ selected_branch: null,
31
+ git_provider: null,
32
+ ...i(e) ?? {},
33
+ ...t
34
+ });
35
+ }, s = (e) => {
28
36
  let t = n();
29
37
  e in t && (delete t[e], r(t));
30
38
  };
31
39
  //#endregion
32
- export { i as getStoredConversationMetadata, o as removeStoredConversationMetadata, a as setStoredConversationMetadata, t as toPluginCoordinates };
40
+ export { i as getStoredConversationMetadata, o as mergeStoredConversationMetadata, s as removeStoredConversationMetadata, a as setStoredConversationMetadata, t as toPluginCoordinates };
33
41
 
34
42
  //# sourceMappingURL=conversation-metadata-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-metadata-store.js","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\nimport type { PluginSpec } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport type WorkspaceMode = \"local_repo\" | \"new_worktree\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n /**\n * How the conversation should use `selected_workspace`.\n *\n * `local_repo` means the runtime should operate directly in the selected\n * folder, even when it is not a git checkout. `new_worktree` preserves the\n * historical agent-server behavior for conversations that should start in a\n * generated per-conversation worktree.\n */\n workspace_mode?: WorkspaceMode | null;\n /**\n * The LLM profile the conversation was created with (or last switched to).\n * Client-side only. Lets the chat-header switcher show the exact profile\n * name even when several profiles share the same underlying model — the\n * agent-server only round-trips the model string, so matching on it alone\n * is ambiguous (issue #1082).\n */\n active_profile?: string | null;\n /** Store plugin coordinates only; parameters may contain secrets. */\n plugins?: PluginSpec[] | null;\n}\n\nexport const toPluginCoordinates = (plugin: PluginSpec): PluginSpec => ({\n source: plugin.source,\n ref: plugin.ref ?? null,\n repo_path: plugin.repo_path ?? null,\n});\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":";AAGA,IAAM,IAAc,gDAsCP,KAAuB,OAAoC;CACtE,QAAQ,EAAO;CACf,KAAK,EAAO,OAAO;CACnB,WAAW,EAAO,aAAa;AACjC,IAIM,UAAgC;CACpC,IAAI,OAAO,SAAW,KAAa,OAAO,CAAC;CAC3C,IAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,CAAW;EACnD,IAAI,CAAC,GAAK,OAAO,CAAC;EAClB,IAAM,IAAS,KAAK,MAAM,CAAG;EAE7B,OADI,CAAC,KAAU,OAAO,KAAW,WAAiB,CAAC,IAC5C;CACT,QAAQ;EACN,OAAO,CAAC;CACV;AACF,GAEM,KAAY,MAA+B;CAC3C,aAAO,SAAW,MACtB;MAAI,OAAO,KAAK,CAAI,EAAE,WAAW,GAAG;GAClC,OAAO,aAAa,WAAW,CAAW;GAC1C;EACF;EACA,OAAO,aAAa,QAAQ,GAAa,KAAK,UAAU,CAAI,CAAC;CAD7D;AAEF,GAEa,KACX,MACgC,EAAQ,EAAE,MAAmB,MAElD,KACX,GACA,MACS;CACT,IAAM,IAAM,EAAQ;CAEpB,AADA,EAAI,KAAkB,GACtB,EAAS,CAAG;AACd,GAEa,KACX,MACS;CACT,IAAM,IAAM,EAAQ;CACd,KAAkB,MACxB,OAAO,EAAI,IACX,EAAS,CAAG;AACd"}
1
+ {"version":3,"file":"conversation-metadata-store.js","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\nimport type { PluginSpec } from \"#/api/conversation-service/agent-server-conversation-service.types\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport type WorkspaceMode = \"local_repo\" | \"new_worktree\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n /**\n * How the conversation should use `selected_workspace`.\n *\n * `local_repo` means the runtime should operate directly in the selected\n * folder, even when it is not a git checkout. `new_worktree` preserves the\n * historical agent-server behavior for conversations that should start in a\n * generated per-conversation worktree.\n */\n workspace_mode?: WorkspaceMode | null;\n /**\n * The LLM profile the conversation was created with (or last switched to).\n * Client-side only. Lets the chat-header switcher show the exact profile\n * name even when several profiles share the same underlying model — the\n * agent-server only round-trips the model string, so matching on it alone\n * is ambiguous (issue #1082).\n */\n active_profile?: string | null;\n /**\n * When `active_profile` was stamped (ISO string). Written by the live\n * WebSocket handler (the observation's server timestamp) and the user\n * `/model` mutation (client clock). The history seed compares the latest\n * SwitchLLM observation's timestamp against this so a reload can repair a\n * missed agent switch without rolling back a newer manual switch — manual\n * `/model` switches go through REST and leave no observation in history.\n * Absent on stamps written before this field existed; treated as older\n * than any observation so the seed can still repair them.\n */\n stamped_at?: string | null;\n /** Store plugin coordinates only; parameters may contain secrets. */\n plugins?: PluginSpec[] | null;\n /**\n * Local-only client-managed planning conversation id. Cloud backends expose\n * real sub-conversations through `sub_conversation_ids`; local agent-server\n * backends do not, so Canvas stores the relationship here.\n */\n local_planning_conversation_id?: string | null;\n}\n\nexport const toPluginCoordinates = (plugin: PluginSpec): PluginSpec => ({\n source: plugin.source,\n ref: plugin.ref ?? null,\n repo_path: plugin.repo_path ?? null,\n});\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\n/**\n * Merge `patch` into a conversation's stored metadata, preserving every\n * existing field — `setStoredConversationMetadata` does a full-object\n * replace, which would otherwise silently drop fields the caller doesn't\n * enumerate (e.g. `plugins`).\n */\nexport const mergeStoredConversationMetadata = (\n conversationId: string,\n patch: Partial<ConversationMetadata>,\n): void => {\n setStoredConversationMetadata(conversationId, {\n selected_repository: null,\n selected_branch: null,\n git_provider: null,\n ...(getStoredConversationMetadata(conversationId) ?? {}),\n ...patch,\n });\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":";AAGA,IAAM,IAAc,gDAuDP,KAAuB,OAAoC;CACtE,QAAQ,EAAO;CACf,KAAK,EAAO,OAAO;CACnB,WAAW,EAAO,aAAa;AACjC,IAIM,UAAgC;CACpC,IAAI,OAAO,SAAW,KAAa,OAAO,CAAC;CAC3C,IAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,CAAW;EACnD,IAAI,CAAC,GAAK,OAAO,CAAC;EAClB,IAAM,IAAS,KAAK,MAAM,CAAG;EAE7B,OADI,CAAC,KAAU,OAAO,KAAW,WAAiB,CAAC,IAC5C;CACT,QAAQ;EACN,OAAO,CAAC;CACV;AACF,GAEM,KAAY,MAA+B;CAC3C,aAAO,SAAW,MACtB;MAAI,OAAO,KAAK,CAAI,EAAE,WAAW,GAAG;GAClC,OAAO,aAAa,WAAW,CAAW;GAC1C;EACF;EACA,OAAO,aAAa,QAAQ,GAAa,KAAK,UAAU,CAAI,CAAC;CAD7D;AAEF,GAEa,KACX,MACgC,EAAQ,EAAE,MAAmB,MAElD,KACX,GACA,MACS;CACT,IAAM,IAAM,EAAQ;CAEpB,AADA,EAAI,KAAkB,GACtB,EAAS,CAAG;AACd,GAQa,KACX,GACA,MACS;CACT,EAA8B,GAAgB;EAC5C,qBAAqB;EACrB,iBAAiB;EACjB,cAAc;EACd,GAAI,EAA8B,CAAc,KAAK,CAAC;EACtD,GAAG;CACL,CAAC;AACH,GAEa,KACX,MACS;CACT,IAAM,IAAM,EAAQ;CACd,KAAkB,MACxB,OAAO,EAAI,IACX,EAAS,CAAG;AACd"}
@@ -1,2 +1,2 @@
1
- require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs"),t=require("../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs"),n=require("../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs"),r=require("../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const i=require("../../utils/websocket-url.cjs"),a=require("../agent-server-config.cjs"),o=require("../backend-registry/active-store.cjs"),s=require("../agent-server-client-options.cjs"),c=require("../../services/telemetry.cjs"),l=require("../conversation-metadata-store.cjs"),u=require("../cloud/proxy.cjs"),d=require("../cloud/conversation-service.api.cjs"),f=require("../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs");require("../../node_modules/@openhands/typescript-client/dist/index.cjs");const p=require("../../node_modules/uuid/dist/v4.cjs"),m=require("../agent-server-home.cjs"),h=require("../profiles-service/profiles-service.api.cjs"),g=require("../settings-service/settings-service.api.cjs"),_=require("../agent-server-adapter.cjs"),v=require("../../utils/title-llm-profile.cjs");var y=`1970-01-01T00:00:00.000Z`,b=300*1e3,x=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function S(){return Error(x)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function w(e){return typeof e==`number`?e:null}function T(e){return typeof e==`number`?e:0}function E(e){return typeof e==`string`?e:null}function D(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:y}function O(e){return C(e)?{prompt_tokens:T(e.prompt_tokens),completion_tokens:T(e.completion_tokens),cache_read_tokens:T(e.cache_read_tokens),cache_write_tokens:T(e.cache_write_tokens),context_window:T(e.context_window),per_turn_token:T(e.per_turn_token)}:null}function k(e){return C(e)?{accumulated_cost:w(e.accumulated_cost),max_budget_per_task:w(e.max_budget_per_task),accumulated_token_usage:O(e.accumulated_token_usage)}:null}function A(e){return C(e)?e:null}function j(e){if(!C(e))return null;let t=C(e.llm)?{model:E(e.llm.model)}:null;return{kind:E(e.kind),acp_server:E(e.acp_server),acp_model:E(e.acp_model),llm:t}}function M(e){return C(e)?{working_dir:E(e.working_dir)}:null}function N(e){if(!C(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function P(e){if(!C(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function F(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function I(e,t){let n=F(e),r=F(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function L(e){if(!C(e)||typeof e.id!=`string`||!e.id.trim())throw S();return{id:e.id.trim(),title:E(e.title),created_at:D(e,`created_at`,`createdAt`),updated_at:D(e,`updated_at`,`updatedAt`),execution_status:E(e.execution_status),sandbox_status:E(e.sandbox_status),metrics:k(e.metrics),stats:A(e.stats),agent:j(e.agent),workspace:M(e.workspace),tags:N(e.tags),launched_agent_profile:P(e.launched_agent_profile),current_model_id:E(e.current_model_id),current_model_name:E(e.current_model_name)}}function R(e){if(!Array.isArray(e))throw S();return e.map(L)}function z(e){if(Array.isArray(e))return{items:R(e),next_page_id:null};if(!C(e))throw S();return{items:R(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var B=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function V(e){let t=e??`idle`;return B.has(t)?t:`idle`}function H(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var U=class{static async sendMessage(t,n,r){let a=o.getActiveBackend().backend,c=r?.conversationUrl??null,l=r?.sessionApiKey??null;if(a.kind===`cloud`){if(!c||!l){let[e]=await d.batchGetCloudConversations([t]);c=e?.conversation_url?.trim()??null,l=e?.session_api_key?.trim()??null}if(!c||!l)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await u.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(c),path:`/api/conversations/${t}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:l}),n}return await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:c,sessionApiKey:l})).sendEvent(t,n,{run:!0}),n}static async createConversation(t={}){let{initialUserMsg:n,conversationInstructions:r,plugins:i,metadata:u,workingDirOverride:f,workspaceMode:y,parentConversationId:x,agentType:S,sandboxId:C,agentProfileId:w,agentProfileKind:T}=t;if(o.getActiveBackend().backend.kind===`cloud`)return d.createCloudAppConversation({initial_message:n?{role:`user`,content:[{type:`text`,text:n}]}:null,title:r??null,selected_repository:u?.selected_repository??null,selected_branch:u?.selected_branch??null,git_provider:u?.git_provider??null,plugins:i??null,parent_conversation_id:x??null,agent_type:S,sandbox_id:C??null,agent_profile_id:w??null,trigger:`gui`});let[E,D]=await Promise.all([g.default.getSettings(),h.default.listProfiles().catch(()=>void 0)]),O=v.resolveTitleLlmProfile(E.title_llm_profile,D),k=p.default(),A=await m.resolveAbsoluteAgentServerPath(f??a.buildConversationWorkingDirForBackend(k,o.getActiveBackend().backend.host)),j=y??(f?`local_repo`:`new_worktree`),M=await _.buildStartConversationRequestWithEncryptedSettings({settings:E,query:n,conversationInstructions:r,plugins:i,conversationId:k,parentConversationId:x,workingDir:A,worktree:j===`new_worktree`,agentProfileId:w,agentProfileKind:T,titleLlmProfile:O}),N=await c.getTelemetryDistinctId(),P=await new e.ConversationClient(s.getAgentServerClientOptions({timeout:b})).createConversation({...M,...N?{user_id:N}:{}}),F=o.getEffectiveLocalBackend();if(!F)throw new s.NoBackendAvailableError;return(u?.selected_repository||f)&&l.setStoredConversationMetadata(P.id,{selected_repository:u?.selected_repository??null,selected_branch:u?.selected_branch??null,git_provider:u?.git_provider??null,selected_workspace:f??null,workspace_mode:j}),{id:P.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:P.id,agent_server_url:F.host,request:{initial_message:M.initial_message,plugins:i??null},created_at:P.created_at,updated_at:P.updated_at}}static async getStartTask(e){return o.getActiveBackend().backend.kind===`cloud`?d.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async getVSCodeStatus(e,t){return new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:e,sessionApiKey:t})).getStatus()}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??a.getAgentServerWorkingDir()}static async batchGetAppConversations(t){return t.length===0?[]:o.getActiveBackend().backend.kind===`cloud`?d.batchGetCloudConversations(t):R(await new e.ConversationClient(s.getAgentServerClientOptions()).getConversations(t)).map(e=>_.toAppConversation(e))}static async updateConversationPublicFlag(e,t){if(o.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return d.updateCloudConversationPublicFlag(e,t)}static async updateConversationRepository(e,t,n,r){t?l.setStoredConversationMetadata(e,{...l.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):l.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return H(i,e)}static async readConversationFile(e,n){if(o.getActiveBackend().backend.kind===`cloud`)return d.readCloudConversationFile(e,I(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let r=await this.resolveConversationWorkingDir(e),i=I(n??`${r}/.agents_tmp/PLAN.md`,r);return new t.FileClient(s.getAgentServerClientOptions()).downloadTextFile(i)}static async downloadConversation(e){return o.getActiveBackend().backend.kind===`cloud`?d.downloadCloudConversation(e):new t.FileClient(s.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return _.emptyHooksResponse()}static async getRuntimeConversation(t,n,r){let i=L(await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).getConversation(t));return{id:i.id,title:i.title?.trim()?i.title:_.getDefaultConversationTitle(i.id),metrics:k(i.metrics),created_at:i.created_at,updated_at:i.updated_at,status:V(i.execution_status),stats:i.stats??{usage_to_metrics:{}}}}static async condenseConversation(t,n,r){let a=o.getActiveBackend().backend;if(a.kind===`cloud`&&n){await u.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(n),path:`/api/conversations/${t}/condense`,authMode:`session-api-key`,sessionApiKey:r});return}await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).condenseConversation(t)}static async searchConversations(t=20,n){return o.getActiveBackend().backend.kind===`cloud`?d.searchCloudConversations(t,n):_.toConversationPage(z(await new e.ConversationClient(s.getAgentServerClientOptions()).searchConversations({limit:t,page_id:n,sort_order:f.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(t){o.getActiveBackend().backend.kind===`cloud`?await d.deleteCloudConversation(t):await new e.ConversationClient(s.getAgentServerClientOptions()).deleteConversation(t),l.removeStoredConversationMetadata(t)}static async updateConversationTitle(t,n){if(o.getActiveBackend().backend.kind===`cloud`)return d.updateCloudConversationTitle(t,n);await new e.ConversationClient(s.getAgentServerClientOptions()).updateConversation(t,{title:n});let[r]=await this.batchGetAppConversations([t]);return H(r,t)}static async forkConversation(t,n,r){if(o.getActiveBackend().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new e.ConversationClient(s.getAgentServerClientOptions()).forkConversation(t,{from_event_id:n,...r?{title:r}:{}}),a=l.getStoredConversationMetadata(t);return a&&l.setStoredConversationMetadata(i.id,a),i}static async getEventParentId(t,n){return(await new e.ConversationClient(s.getAgentServerClientOptions()).getEvent(t,n)).parent_id??void 0}static async switchProfile(t,r){let{backend:i}=o.getActiveBackend();if(i.kind===`cloud`){if(!t){await h.default.activateProfile(r);return}await u.callCloudProxy({backend:i,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_profile`,body:{profile_name:r}});return}if(!t){await new n.ProfilesClient(s.getAgentServerClientOptions()).activateProfile(r);return}let a=s.getAgentServerClientOptions(),c=new e.ConversationClient(a),l=await new n.ProfilesClient(a).getProfile(r,{exposeSecrets:`encrypted`}),d=typeof l.config.model==`string`?l.config.model:``;if(!d)throw Error(`Profile '${r}' has no model.`);await _.assertSubscriptionAuthReady({llm:l.config}),await c.switchLLM(t,{...l.config,model:d,stream:!0,usage_id:`profile:${r}:${p.default()}`})}static async switchAcpModel(t,n){let{backend:r}=o.getActiveBackend();if(r.kind===`cloud`){await u.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_acp_model`,body:{model:n}});return}await new e.ConversationClient(s.getAgentServerClientOptions()).switchAcpModel(t,n)}};exports.default=U;
1
+ require("../../_virtual/_rolldown/runtime.cjs");const e=require("../../node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs"),t=require("../../node_modules/@openhands/typescript-client/dist/client/file-client.cjs"),n=require("../../node_modules/@openhands/typescript-client/dist/client/profiles-client.cjs"),r=require("../../node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs");require("../../node_modules/@openhands/typescript-client/dist/clients.cjs");const i=require("../../utils/websocket-url.cjs"),a=require("../agent-server-config.cjs"),o=require("../backend-registry/active-store.cjs"),s=require("../agent-server-client-options.cjs"),c=require("../../services/telemetry.cjs"),l=require("../conversation-metadata-store.cjs"),u=require("../cloud/proxy.cjs"),d=require("../cloud/conversation-service.api.cjs"),f=require("../../node_modules/@openhands/typescript-client/dist/models/conversation.cjs");require("../../node_modules/@openhands/typescript-client/dist/index.cjs");const p=require("../../node_modules/uuid/dist/v4.cjs"),m=require("../agent-server-home.cjs"),h=require("../profiles-service/profiles-service.api.cjs"),g=require("../settings-service/settings-service.api.cjs"),_=require("../../utils/plan-file.cjs"),v=require("../agent-server-adapter.cjs"),y=require("../../utils/title-llm-profile.cjs");var b=`1970-01-01T00:00:00.000Z`,x=300*1e3,S=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function C(){return Error(S)}function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function T(e){return typeof e==`number`?e:null}function E(e){return typeof e==`number`?e:0}function D(e){return typeof e==`string`?e:null}function O(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:b}function k(e){return w(e)?{prompt_tokens:E(e.prompt_tokens),completion_tokens:E(e.completion_tokens),cache_read_tokens:E(e.cache_read_tokens),cache_write_tokens:E(e.cache_write_tokens),context_window:E(e.context_window),per_turn_token:E(e.per_turn_token)}:null}function A(e){return w(e)?{accumulated_cost:T(e.accumulated_cost),max_budget_per_task:T(e.max_budget_per_task),accumulated_token_usage:k(e.accumulated_token_usage)}:null}function j(e){return w(e)?e:null}function M(e){if(!w(e))return null;let t=w(e.llm)?{model:D(e.llm.model)}:null;return{kind:D(e.kind),acp_server:D(e.acp_server),acp_model:D(e.acp_model),llm:t}}function N(e){return w(e)?{working_dir:D(e.working_dir)}:null}function P(e){if(!w(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function F(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):null}function I(e){if(!w(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function L(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function R(e,t){let n=L(e),r=L(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function z(e){if(!w(e)||typeof e.id!=`string`||!e.id.trim())throw C();return{id:e.id.trim(),title:D(e.title),created_at:O(e,`created_at`,`createdAt`),updated_at:O(e,`updated_at`,`updatedAt`),execution_status:D(e.execution_status),sandbox_status:D(e.sandbox_status),metrics:A(e.metrics),stats:j(e.stats),agent:M(e.agent),workspace:N(e.workspace),tags:P(e.tags),launched_agent_profile:I(e.launched_agent_profile),sub_conversation_ids:F(e.sub_conversation_ids),current_model_id:D(e.current_model_id),current_model_name:D(e.current_model_name)}}function B(e){if(!Array.isArray(e))throw C();return e.map(z)}function V(e){if(Array.isArray(e))return{items:B(e),next_page_id:null};if(!w(e))throw C();return{items:B(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var H=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function U(e){let t=e??`idle`;return H.has(t)?t:`idle`}function W(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var G=class{static async sendMessage(t,n,r){let a=o.getActiveBackend().backend,c=r?.conversationUrl??null,l=r?.sessionApiKey??null;if(a.kind===`cloud`){if(!c||!l){let[e]=await d.batchGetCloudConversations([t]);c=e?.conversation_url?.trim()??null,l=e?.session_api_key?.trim()??null}if(!c||!l)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await u.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(c),path:`/api/conversations/${t}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:l}),n}return await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:c,sessionApiKey:l})).sendEvent(t,n,{run:!0}),n}static async createConversation(t={}){let{initialUserMsg:n,conversationInstructions:r,plugins:i,metadata:u,workingDirOverride:f,workspaceMode:_,parentConversationId:b,agentType:S,sandboxId:C,agentProfileId:w,agentProfileKind:T}=t;if(o.getActiveBackend().backend.kind===`cloud`)return d.createCloudAppConversation({initial_message:n?{role:`user`,content:[{type:`text`,text:n}]}:null,title:r??null,selected_repository:u?.selected_repository??null,selected_branch:u?.selected_branch??null,git_provider:u?.git_provider??null,plugins:i??null,parent_conversation_id:b??null,agent_type:S,sandbox_id:C??null,agent_profile_id:w??null,trigger:`gui`});let[E,D]=await Promise.all([g.default.getSettings(),h.default.listProfiles().catch(()=>void 0)]),O=y.resolveTitleLlmProfile(E.title_llm_profile,D),k=p.default(),A=o.getActiveBackend().backend.host,j=await m.resolveAbsoluteAgentServerPath(f??a.buildConversationWorkingDirForBackend(k,A)),M=f?j:await m.resolveAbsoluteAgentServerPath(a.getWorkspaceRootForBackend(A)),N=_??(f?`local_repo`:`new_worktree`),P=await v.buildStartConversationRequestWithEncryptedSettings({settings:E,query:n,conversationInstructions:r,plugins:i,conversationId:k,parentConversationId:b,workingDir:j,hooksProjectDir:M,worktree:N===`new_worktree`,agentProfileId:w,agentProfileKind:T,titleLlmProfile:O}),F=await c.getTelemetryDistinctId(),I=await new e.ConversationClient(s.getAgentServerClientOptions({timeout:x})).createConversation({...P,...F?{user_id:F}:{}}),L=o.getEffectiveLocalBackend();if(!L)throw new s.NoBackendAvailableError;return(u?.selected_repository||f)&&l.setStoredConversationMetadata(I.id,{selected_repository:u?.selected_repository??null,selected_branch:u?.selected_branch??null,git_provider:u?.git_provider??null,selected_workspace:f??null,workspace_mode:N}),{id:I.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:I.id,agent_server_url:L.host,request:{initial_message:P.initial_message,plugins:i??null},created_at:I.created_at,updated_at:I.updated_at}}static async createLocalPlanningConversation(t,n){if(o.getActiveBackend().backend.kind===`cloud`)throw Error(`Local planning conversations require a local backend.`);let[r]=await this.batchGetAppConversations([t]),i=await v.buildStartPlanningConversationRequestWithEncryptedSettings({workingDir:r?.workspace?.working_dir??a.getAgentServerWorkingDir(),parentConversationId:t,parentActiveProfileName:r?.agent_kind===`openhands`?r?.active_profile??null:null,parentAgentProfileId:r?.launched_agent_profile?.agent_profile_id??null,initialMessage:n}),c=await new e.ConversationClient(s.getAgentServerClientOptions()).createConversation(i);return l.mergeStoredConversationMetadata(t,{local_planning_conversation_id:c.id}),v.toAppConversation(c)}static async getLocalPlanningConversationIds(e){if(o.getActiveBackend().backend.kind===`cloud`)return[];let t=new Set;try{let[n]=await this.batchGetAppConversations([e]),r=n?.sub_conversation_ids??[];if(r.length>0){let n=await this.batchGetAppConversations(r);for(let r of n)r&&_.isPlannerConversationOf(r,e)&&t.add(r.id)}}catch(t){console.warn(`Failed to read sub-conversations of ${e}`,t)}let n=l.getStoredConversationMetadata(e)?.local_planning_conversation_id;return n&&t.add(n),[...t]}static async getStartTask(e){return o.getActiveBackend().backend.kind===`cloud`?d.getCloudAppConversationStartTask(e):null}static async getVSCodeUrl(e,t,n){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async getVSCodeStatus(e,t){return new r.VSCodeClient(s.getAgentServerClientOptions({conversationUrl:e,sessionApiKey:t})).getStatus()}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??a.getAgentServerWorkingDir()}static async batchGetAppConversations(t){return t.length===0?[]:o.getActiveBackend().backend.kind===`cloud`?d.batchGetCloudConversations(t):B(await new e.ConversationClient(s.getAgentServerClientOptions()).getConversations(t)).map(e=>v.toAppConversation(e))}static async updateConversationPublicFlag(e,t){if(o.getActiveBackend().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return d.updateCloudConversationPublicFlag(e,t)}static async updateConversationRepository(e,t,n,r){t?l.setStoredConversationMetadata(e,{...l.getStoredConversationMetadata(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):l.removeStoredConversationMetadata(e);let[i]=await this.batchGetAppConversations([e]);return W(i,e)}static async readConversationFile(e,n){if(o.getActiveBackend().backend.kind===`cloud`)return d.readCloudConversationFile(e,R(n??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let r=await this.resolveConversationWorkingDir(e),i=R(n??`${r}/.agents_tmp/PLAN.md`,r);return new t.FileClient(s.getAgentServerClientOptions()).downloadTextFile(i)}static async downloadConversation(e){return o.getActiveBackend().backend.kind===`cloud`?d.downloadCloudConversation(e):new t.FileClient(s.getAgentServerClientOptions()).downloadTrajectory(e)}static async getHooks(e){return v.emptyHooksResponse()}static async getRuntimeConversation(t,n,r){let i=z(await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).getConversation(t));return{id:i.id,title:i.title?.trim()?i.title:v.getDefaultConversationTitle(i.id),metrics:A(i.metrics),created_at:i.created_at,updated_at:i.updated_at,status:U(i.execution_status),stats:i.stats??{usage_to_metrics:{}}}}static async condenseConversation(t,n,r){let a=o.getActiveBackend().backend;if(a.kind===`cloud`&&n){await u.callCloudProxy({backend:a,method:`POST`,hostOverride:i.buildHttpBaseUrl(n),path:`/api/conversations/${t}/condense`,authMode:`session-api-key`,sessionApiKey:r});return}await new e.ConversationClient(s.getAgentServerClientOptions({conversationUrl:n,sessionApiKey:r})).condenseConversation(t)}static async searchConversations(t=20,n){return o.getActiveBackend().backend.kind===`cloud`?d.searchCloudConversations(t,n):v.toConversationPage(V(await new e.ConversationClient(s.getAgentServerClientOptions()).searchConversations({limit:t,page_id:n,sort_order:f.ConversationSortOrder.UPDATED_AT_DESC})))}static async deleteConversation(t){if(o.getActiveBackend().backend.kind===`cloud`){await d.deleteCloudConversation(t),l.removeStoredConversationMetadata(t);return}let n=await this.getLocalPlanningConversationIds(t),r=new e.ConversationClient(s.getAgentServerClientOptions());await Promise.all(n.map(async e=>{try{await r.deleteConversation(e)}catch(t){console.warn(`Failed to delete planning conversation ${e}`,t)}l.removeStoredConversationMetadata(e)})),await r.deleteConversation(t),l.removeStoredConversationMetadata(t)}static async updateConversationTitle(t,n){if(o.getActiveBackend().backend.kind===`cloud`)return d.updateCloudConversationTitle(t,n);await new e.ConversationClient(s.getAgentServerClientOptions()).updateConversation(t,{title:n});let[r]=await this.batchGetAppConversations([t]);return W(r,t)}static async updateConversationTags(t,n){await new e.ConversationClient(s.getAgentServerClientOptions()).updateConversation(t,{tags:n});let[r]=await this.batchGetAppConversations([t]);return W(r,t)}static async forkConversation(t,n,r){if(o.getActiveBackend().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new e.ConversationClient(s.getAgentServerClientOptions()).forkConversation(t,{from_event_id:n,...r?{title:r}:{}}),a=l.getStoredConversationMetadata(t);return a&&l.setStoredConversationMetadata(i.id,a),i}static async getEventParentId(t,n){return(await new e.ConversationClient(s.getAgentServerClientOptions()).getEvent(t,n)).parent_id??void 0}static async switchProfile(t,r){let{backend:i}=o.getActiveBackend();if(i.kind===`cloud`){if(!t){await h.default.activateProfile(r);return}await u.callCloudProxy({backend:i,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_profile`,body:{profile_name:r}});return}if(!t){await new n.ProfilesClient(s.getAgentServerClientOptions()).activateProfile(r);return}let a=s.getAgentServerClientOptions(),c=new e.ConversationClient(a),l=await new n.ProfilesClient(a).getProfile(r,{exposeSecrets:`encrypted`}),d=typeof l.config.model==`string`?l.config.model:``;if(!d)throw Error(`Profile '${r}' has no model.`);await v.assertSubscriptionAuthReady({llm:l.config}),await c.switchLLM(t,{...l.config,model:d,stream:!0,usage_id:`profile:${r}:${p.default()}`})}static async switchAcpModel(t,n){let{backend:r}=o.getActiveBackend();if(r.kind===`cloud`){await u.callCloudProxy({backend:r,method:`POST`,path:`/api/v1/app-conversations/${t}/switch_acp_model`,body:{model:n}});return}await new e.ConversationClient(s.getAgentServerClientOptions()).switchAcpModel(t,n)}};exports.default=G;
2
2
  //# sourceMappingURL=agent-server-conversation-service.api.cjs.map
@@ -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 type VSCodeStatusResponse,\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 buildConversationWorkingDirForBackend,\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 updateCloudConversationTitle,\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 { getTelemetryDistinctId } from \"../../services/telemetry\";\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 RuntimeConversationStats,\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\n// Shallow check only (matches the trust level `getRuntimeConversation` used\n// before this field was threaded through `DirectConversationInfo`): the\n// per-usage-id entries are consumed via `combineUsageMetrics`, which already\n// tolerates missing/malformed fields, so there's no need to validate them here.\nfunction normalizeStats(value: unknown): RuntimeConversationStats | null {\n return isRecord(value)\n ? (value as unknown as RuntimeConversationStats)\n : null;\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 stats: normalizeStats(item.stats),\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\n/**\n * Options for {@link AgentServerConversationService.createConversation}.\n */\nexport interface CreateConversationOptions {\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}\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 options: CreateConversationOptions = {},\n ): Promise<AppConversationStartTask> {\n const {\n initialUserMsg,\n conversationInstructions,\n plugins,\n metadata,\n workingDirOverride,\n workspaceMode,\n parentConversationId,\n agentType,\n sandboxId,\n agentProfileId,\n agentProfileKind,\n } = options;\n\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 trigger: \"gui\",\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 //\n // Pick the base working dir per-backend:\n // 1. explicit user workspace pick → use it as-is;\n // 2. no pick, backend that served this frontend → the baked default\n // (honors a launcher-baked absolute `VITE_WORKING_DIR`);\n // 3. no pick, any other backend → the backend-relative default.\n // A baked absolute dir is a path on the host that served this frontend,\n // so it is only valid on that backend. Using it for a different backend\n // (e.g. a remote sandbox) makes the agent-server mkdir an unwritable path\n // and the conversation fails at the first prompt (e.g. `Permission\n // denied: '/Users'`). The relative default is anchored per-backend by\n // `resolveAbsoluteAgentServerPath()` via `/api/file/home`. The gate keys\n // on the active backend's host (not its id): the seeded `default-local`\n // entry is mutable, so a user can edit it to point at a remote host while\n // its id stays `default-local`.\n const baseWorkingDir =\n workingDirOverride ??\n buildConversationWorkingDirForBackend(\n conversationId,\n getActiveBackend().backend.host,\n );\n const workingDir = await resolveAbsoluteAgentServerPath(baseWorkingDir);\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 // The agent-server rejects a parent in a different workspace, so callers\n // launching a child must pass the parent's own `working_dir` as\n // `workingDirOverride` (see `resolveConversationWorkingDir`). Servers\n // older than 1.37.1 ignore the field and create an unlinked conversation.\n parentConversationId,\n workingDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const telemetryDistinctId = await getTelemetryDistinctId();\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>({\n ...payload,\n ...(telemetryDistinctId ? { user_id: telemetryDistinctId } : {}),\n });\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 /**\n * Read the editor's capability state from the agent-server.\n *\n * `/api/vscode/status` answers 200 with `enabled: false` when the\n * deployment set `enable_vscode: false`, which distinguishes \"this\n * deployment offers no editor\" from a transport, auth, or server\n * failure — `/api/vscode/url` answers 503 for the former and so\n * cannot be told apart from the latter.\n */\n static async getVSCodeStatus(\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<VSCodeStatusResponse> {\n return new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getStatus();\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 // Fetch directly from the per-conversation runtime agent-server at conversationUrl.\n const response = await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<DirectConversationInfo>(conversationId);\n const data = requireDirectConversationInfo(response);\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: data.stats ?? { usage_to_metrics: {} },\n };\n }\n\n /**\n * Force condensation (\"compact\") of the conversation history via\n * `POST /api/conversations/{id}/condense`. Routed the same way as\n * {@link sendMessage}: through the cloud proxy at the conversation's own\n * runtime host for cloud backends, directly against that runtime otherwise.\n */\n static async condenseConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<void> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/condense`,\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n return;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).condenseConversation(conversationId);\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 if (getActiveBackend().backend.kind === \"cloud\") {\n return updateCloudConversationTitle(conversationId, title);\n }\n\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 * Works on a created-but-not-yet-run conversation too: the agent-server\n * treats a pre-first-run switch as a persist-only deferral (the model is\n * mirrored into the conversation's stored agent and applied when the session\n * starts). The home/no-conversation default is persisted via the active ACP\n * profile / 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":"yyCA4EA,IAAM,EAAiC,2BAIjC,EAAiC,IAAS,IAC1C,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,CAAqC,CACxD,CAEA,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,IAC7C,CAEA,SAAS,EAAa,EAAwB,CAC5C,OAAO,OAAO,GAAU,SAAW,EAAQ,CAC7C,CAEA,SAAS,EAAa,EAA+B,CACnD,OAAO,OAAO,GAAU,SAAW,EAAQ,IAC7C,CAEA,SAAS,EACP,EACA,EACA,EAC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AA6B,EAAe,iBAClD,KAAM,CAAE,aAAc,CAAY,CACpC,CAAC,EACD,MACF,CAEA,GAAI,CAAC,EAAgB,CACnB,MAAM,IAAI,EAAA,eAAe,EAAA,4BAA4B,CAAC,EAAE,gBACtD,CACF,EACA,MACF,CAEA,IAAM,EAAgB,EAAA,4BAA4B,EAC5C,EAAqB,IAAI,EAAA,mBAAmB,CAAa,EACzD,EAAU,MAAM,IAAI,EAAA,eAAe,CAAa,EAAE,WACtD,EACA,CAAE,cAAe,WAAY,CAC/B,EACM,EACJ,OAAO,EAAQ,OAAO,OAAU,SAAW,EAAQ,OAAO,MAAQ,GACpE,GAAI,CAAC,EAAO,MAAU,MAAM,YAAY,EAAY,gBAAgB,EACpE,MAAM,EAAA,4BAA4B,CAAE,IAAK,EAAQ,MAAO,CAAC,EACzD,MAAM,EAAmB,UAAU,EAAgB,CACjD,GAAG,EAAQ,OACX,QAGA,OAAQ,GAER,SAAU,WAAW,EAAY,GAAG,EAAA,QAAO,GAC7C,CAAc,CAChB,CAeA,aAAa,eACX,EACA,EACe,CACf,GAAM,CAAE,WAAY,EAAA,iBAAiB,EACrC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,OAAM,CAChB,CAAC,EACD,MACF,CAEA,MAAM,IAAI,EAAA,mBAAmB,EAAA,4BAA4B,CAAC,EAAE,eAC1D,EACA,CACF,CACF,CACF"}
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 type VSCodeStatusResponse,\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 buildConversationWorkingDirForBackend,\n getAgentServerWorkingDir,\n getWorkspaceRootForBackend,\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 updateCloudConversationTitle,\n} from \"../cloud/conversation-service.api\";\nimport {\n DirectConversationInfo,\n assertSubscriptionAuthReady,\n buildStartConversationRequestWithEncryptedSettings,\n buildStartPlanningConversationRequestWithEncryptedSettings,\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 { getTelemetryDistinctId } from \"../../services/telemetry\";\nimport {\n ConversationMetadata,\n getStoredConversationMetadata,\n mergeStoredConversationMetadata,\n removeStoredConversationMetadata,\n setStoredConversationMetadata,\n type WorkspaceMode,\n} from \"../conversation-metadata-store\";\nimport { resolveTitleLlmProfile } from \"#/utils/title-llm-profile\";\nimport { isPlannerConversationOf } from \"#/utils/plan-file\";\nimport type {\n GetHooksResponse,\n PluginSpec,\n AppConversation,\n AppConversationPage,\n AppConversationStartRequest,\n AppConversationStartTask,\n MetricsSnapshot,\n RuntimeConversationInfo,\n RuntimeConversationStats,\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\n// Shallow check only (matches the trust level `getRuntimeConversation` used\n// before this field was threaded through `DirectConversationInfo`): the\n// per-usage-id entries are consumed via `combineUsageMetrics`, which already\n// tolerates missing/malformed fields, so there's no need to validate them here.\nfunction normalizeStats(value: unknown): RuntimeConversationStats | null {\n return isRecord(value)\n ? (value as unknown as RuntimeConversationStats)\n : null;\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\n/**\n * ``ConversationInfo.sub_conversation_ids`` — the agent-server derives it from\n * its own catalog of conversations that name this one as parent (SDK #4188),\n * which is what lets Canvas find a conversation's local planner without any\n * browser-local state. Absent on agent-servers older than 1.37.1; parsed\n * defensively so a non-conforming payload degrades to \"no children\" instead of\n * crashing the list.\n */\nfunction normalizeSubConversationIds(value: unknown): string[] | null {\n if (!Array.isArray(value)) return null;\n return value.filter((entry): entry is string => typeof entry === \"string\");\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 stats: normalizeStats(item.stats),\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 sub_conversation_ids: normalizeSubConversationIds(\n item.sub_conversation_ids,\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\n/**\n * Options for {@link AgentServerConversationService.createConversation}.\n */\nexport interface CreateConversationOptions {\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}\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 options: CreateConversationOptions = {},\n ): Promise<AppConversationStartTask> {\n const {\n initialUserMsg,\n conversationInstructions,\n plugins,\n metadata,\n workingDirOverride,\n workspaceMode,\n parentConversationId,\n agentType,\n sandboxId,\n agentProfileId,\n agentProfileKind,\n } = options;\n\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 trigger: \"gui\",\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 //\n // Pick the base working dir per-backend:\n // 1. explicit user workspace pick → use it as-is;\n // 2. no pick, backend that served this frontend → the baked default\n // (honors a launcher-baked absolute `VITE_WORKING_DIR`);\n // 3. no pick, any other backend → the backend-relative default.\n // A baked absolute dir is a path on the host that served this frontend,\n // so it is only valid on that backend. Using it for a different backend\n // (e.g. a remote sandbox) makes the agent-server mkdir an unwritable path\n // and the conversation fails at the first prompt (e.g. `Permission\n // denied: '/Users'`). The relative default is anchored per-backend by\n // `resolveAbsoluteAgentServerPath()` via `/api/file/home`. The gate keys\n // on the active backend's host (not its id): the seeded `default-local`\n // entry is mutable, so a user can edit it to point at a remote host while\n // its id stays `default-local`.\n const backendHost = getActiveBackend().backend.host;\n const baseWorkingDir =\n workingDirOverride ??\n buildConversationWorkingDirForBackend(conversationId, backendHost);\n const workingDir = await resolveAbsoluteAgentServerPath(baseWorkingDir);\n // The agent-server checks `<project_dir>/.openhands/hooks.json` literally,\n // so hooks need the workspace root: the per-conversation subdir below it is\n // created only after this request (#16907). An explicit pick is the root.\n const hooksProjectDir = workingDirOverride\n ? workingDir\n : await resolveAbsoluteAgentServerPath(\n getWorkspaceRootForBackend(backendHost),\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 // The agent-server rejects a parent in a different workspace, so callers\n // launching a child must pass the parent's own `working_dir` as\n // `workingDirOverride` (see `resolveConversationWorkingDir`). Servers\n // older than 1.37.1 ignore the field and create an unlinked conversation.\n parentConversationId,\n workingDir,\n hooksProjectDir,\n worktree: resolvedWorkspaceMode === \"new_worktree\",\n agentProfileId,\n agentProfileKind,\n titleLlmProfile,\n });\n\n const telemetryDistinctId = await getTelemetryDistinctId();\n const data = await new ConversationClient(\n getAgentServerClientOptions({ timeout: CREATE_CONVERSATION_TIMEOUT_MS }),\n ).createConversation<DirectConversationInfo>({\n ...payload,\n ...(telemetryDistinctId ? { user_id: telemetryDistinctId } : {}),\n });\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 createLocalPlanningConversation(\n parentConversationId: string,\n initialMessage?: string,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n throw new Error(\"Local planning conversations require a local backend.\");\n }\n\n const [parent] = await this.batchGetAppConversations([\n parentConversationId,\n ]);\n const workingDir =\n parent?.workspace?.working_dir ?? getAgentServerWorkingDir();\n\n const payload =\n await buildStartPlanningConversationRequestWithEncryptedSettings({\n workingDir,\n parentConversationId,\n // Pin the planner to the parent's own current model. Only meaningful\n // for \"openhands\"-kind parents: an ACP parent's active_profile is a\n // stale launch-time snapshot (/model is a no-op for ACP), not a live\n // value, so treating it as authoritative would pin the planner to\n // the wrong model instead of falling through to global settings.\n parentActiveProfileName:\n parent?.agent_kind === \"openhands\"\n ? (parent?.active_profile ?? null)\n : null,\n // Fallback when active_profile can't be resolved (e.g. an ACP parent).\n parentAgentProfileId:\n parent?.launched_agent_profile?.agent_profile_id ?? null,\n initialMessage,\n });\n\n const data = await new ConversationClient(\n getAgentServerClientOptions(),\n ).createConversation<DirectConversationInfo>(payload);\n\n // Client-side fallback only: agent-servers >= 1.37.1 persist the link via\n // `parent_conversation_id` and hand it back on the parent's\n // `sub_conversation_ids`, which is the source of truth. This hint covers\n // older backends that ignore the field.\n mergeStoredConversationMetadata(parentConversationId, {\n local_planning_conversation_id: data.id,\n });\n\n return toAppConversation(data);\n }\n\n /**\n * Ids of the conversations owned by `parentConversationId` on a local\n * backend — today that means its planner helper, the only child Canvas\n * creates locally.\n *\n * `sub_conversation_ids` is the generic server-derived child list, so each\n * child is kept only if it's tagged `plannerparent` for this parent —\n * otherwise deleting the parent would also delete an unrelated non-planner\n * child (e.g. a delegated sub-agent). The stored metadata hint is merged in\n * for agent-servers older than 1.37.1, which report no children at all.\n */\n static async getLocalPlanningConversationIds(\n parentConversationId: string,\n ): Promise<string[]> {\n if (getActiveBackend().backend.kind === \"cloud\") return [];\n\n const ids = new Set<string>();\n\n try {\n const [parent] = await this.batchGetAppConversations([\n parentConversationId,\n ]);\n const childIds = parent?.sub_conversation_ids ?? [];\n if (childIds.length > 0) {\n const children = await this.batchGetAppConversations(childIds);\n for (const child of children) {\n if (child && isPlannerConversationOf(child, parentConversationId)) {\n ids.add(child.id);\n }\n }\n }\n } catch (error) {\n // The stored hint below still covers the common case, and callers\n // (delete) must not be blocked by a failed lookup.\n console.warn(\n `Failed to read sub-conversations of ${parentConversationId}`,\n error,\n );\n }\n\n const stored =\n getStoredConversationMetadata(\n parentConversationId,\n )?.local_planning_conversation_id;\n if (stored) ids.add(stored);\n\n return [...ids];\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 /**\n * Read the editor's capability state from the agent-server.\n *\n * `/api/vscode/status` answers 200 with `enabled: false` when the\n * deployment set `enable_vscode: false`, which distinguishes \"this\n * deployment offers no editor\" from a transport, auth, or server\n * failure — `/api/vscode/url` answers 503 for the former and so\n * cannot be told apart from the latter.\n */\n static async getVSCodeStatus(\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<VSCodeStatusResponse> {\n return new VSCodeClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getStatus();\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 // Fetch directly from the per-conversation runtime agent-server at conversationUrl.\n const response = await new ConversationClient(\n getAgentServerClientOptions({\n conversationUrl,\n sessionApiKey,\n }),\n ).getConversation<DirectConversationInfo>(conversationId);\n const data = requireDirectConversationInfo(response);\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: data.stats ?? { usage_to_metrics: {} },\n };\n }\n\n /**\n * Force condensation (\"compact\") of the conversation history via\n * `POST /api/conversations/{id}/condense`. Routed the same way as\n * {@link sendMessage}: through the cloud proxy at the conversation's own\n * runtime host for cloud backends, directly against that runtime otherwise.\n */\n static async condenseConversation(\n conversationId: string,\n conversationUrl: string | null | undefined,\n sessionApiKey?: string | null,\n ): Promise<void> {\n const active = getActiveBackend().backend;\n\n if (active.kind === \"cloud\" && conversationUrl) {\n await callCloudProxy({\n backend: active,\n method: \"POST\",\n hostOverride: buildHttpBaseUrl(conversationUrl),\n path: `/api/conversations/${conversationId}/condense`,\n authMode: \"session-api-key\",\n sessionApiKey,\n });\n return;\n }\n\n await new ConversationClient(\n getAgentServerClientOptions({ conversationUrl, sessionApiKey }),\n ).condenseConversation(conversationId);\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 removeStoredConversationMetadata(conversationId);\n return;\n }\n\n // The agent-server orphans children rather than cascading, and the local\n // planner helper is hidden from the conversation list by its\n // `plannerparent` tag — so without this it would survive its parent as an\n // invisible, unreachable conversation (plus its events and state).\n const planningConversationIds =\n await this.getLocalPlanningConversationIds(conversationId);\n\n const client = new ConversationClient(getAgentServerClientOptions());\n await Promise.all(\n planningConversationIds.map(async (planningConversationId) => {\n try {\n await client.deleteConversation(planningConversationId);\n } catch (error) {\n // Already gone (or unreachable): never block deleting the parent the\n // user actually asked to remove.\n console.warn(\n `Failed to delete planning conversation ${planningConversationId}`,\n error,\n );\n }\n removeStoredConversationMetadata(planningConversationId);\n }),\n );\n\n await client.deleteConversation(conversationId);\n removeStoredConversationMetadata(conversationId);\n }\n\n static async updateConversationTitle(\n conversationId: string,\n title: string,\n ): Promise<AppConversation> {\n if (getActiveBackend().backend.kind === \"cloud\") {\n return updateCloudConversationTitle(conversationId, title);\n }\n\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 * Replaces the conversation's complete server-side tag map (the PATCH is\n * replace-all, so callers must merge user edits with any reserved/internal\n * keys before calling). Mirrors `updateConversationTitle`; local\n * agent-server conversations only — Cloud conversations don't carry tags.\n */\n static async updateConversationTags(\n conversationId: string,\n tags: Record<string, string>,\n ): Promise<AppConversation> {\n await new ConversationClient(\n getAgentServerClientOptions(),\n ).updateConversation(conversationId, {\n tags,\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 * Works on a created-but-not-yet-run conversation too: the agent-server\n * treats a pre-first-run switch as a persist-only deferral (the model is\n * mirrored into the conversation's stored agent and applied when the session\n * starts). The home/no-conversation default is persisted via the active ACP\n * profile / 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":"g1CAgFA,IAAM,EAAiC,2BAIjC,EAAiC,IAAS,IAC1C,EACJ,qLAGF,SAAS,GAAqC,CAC5C,OAAW,MAAM,CAAqC,CACxD,CAEA,SAAS,EAAS,EAAkD,CA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AAe,CAAa,EAAE,WACtD,EACA,CAAE,cAAe,WAAY,CAC/B,EACM,EACJ,OAAO,EAAQ,OAAO,OAAU,SAAW,EAAQ,OAAO,MAAQ,GACpE,GAAI,CAAC,EAAO,MAAU,MAAM,YAAY,EAAY,gBAAgB,EACpE,MAAM,EAAA,4BAA4B,CAAE,IAAK,EAAQ,MAAO,CAAC,EACzD,MAAM,EAAmB,UAAU,EAAgB,CACjD,GAAG,EAAQ,OACX,QAGA,OAAQ,GAER,SAAU,WAAW,EAAY,GAAG,EAAA,QAAO,GAC7C,CAAc,CAChB,CAeA,aAAa,eACX,EACA,EACe,CACf,GAAM,CAAE,WAAY,EAAA,iBAAiB,EACrC,GAAI,EAAQ,OAAS,QAAS,CAC5B,MAAM,EAAA,eAAe,CACnB,UACA,OAAQ,OACR,KAAM,6BAA6B,EAAe,mBAClD,KAAM,CAAE,OAAM,CAChB,CAAC,EACD,MACF,CAEA,MAAM,IAAI,EAAA,mBAAmB,EAAA,4BAA4B,CAAC,EAAE,eAC1D,EACA,CACF,CACF,CACF"}
@@ -24,6 +24,19 @@ export interface CreateConversationOptions {
24
24
  declare class AgentServerConversationService {
25
25
  static sendMessage(conversationId: string, message: SendMessageRequest, runtime?: ConversationRuntimeContext | null): Promise<SendMessageResponse>;
26
26
  static createConversation(options?: CreateConversationOptions): Promise<AppConversationStartTask>;
27
+ static createLocalPlanningConversation(parentConversationId: string, initialMessage?: string): Promise<AppConversation>;
28
+ /**
29
+ * Ids of the conversations owned by `parentConversationId` on a local
30
+ * backend — today that means its planner helper, the only child Canvas
31
+ * creates locally.
32
+ *
33
+ * `sub_conversation_ids` is the generic server-derived child list, so each
34
+ * child is kept only if it's tagged `plannerparent` for this parent —
35
+ * otherwise deleting the parent would also delete an unrelated non-planner
36
+ * child (e.g. a delegated sub-agent). The stored metadata hint is merged in
37
+ * for agent-servers older than 1.37.1, which report no children at all.
38
+ */
39
+ static getLocalPlanningConversationIds(parentConversationId: string): Promise<string[]>;
27
40
  static getStartTask(taskId: string): Promise<AppConversationStartTask | null>;
28
41
  static getVSCodeUrl(conversationId: string, conversationUrl: string | null | undefined, sessionApiKey?: string | null): Promise<GetVSCodeUrlResponse>;
29
42
  /**
@@ -54,6 +67,13 @@ declare class AgentServerConversationService {
54
67
  static searchConversations(limit?: number, pageId?: string): Promise<AppConversationPage>;
55
68
  static deleteConversation(conversationId: string): Promise<void>;
56
69
  static updateConversationTitle(conversationId: string, title: string): Promise<AppConversation>;
70
+ /**
71
+ * Replaces the conversation's complete server-side tag map (the PATCH is
72
+ * replace-all, so callers must merge user edits with any reserved/internal
73
+ * keys before calling). Mirrors `updateConversationTitle`; local
74
+ * agent-server conversations only — Cloud conversations don't carry tags.
75
+ */
76
+ static updateConversationTags(conversationId: string, tags: Record<string, string>): Promise<AppConversation>;
57
77
  /**
58
78
  * Forks a conversation, copying event history up to and including
59
79
  * `fromEventId`. Local agent-server only; needs agent-server >= 1.31.0 for