@openhands/agent-canvas 1.0.0-alpha.7 → 1.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (691) hide show
  1. package/README.md +9 -18
  2. package/bin/agent-canvas.mjs +27 -1
  3. package/build/assets/{QueryClientProvider-DITRCGAK.js → QueryClientProvider-B7kl84Kj.js} +1 -1
  4. package/build/assets/{Trans-D43bd3yR.js → Trans-1j65oy9O.js} +1 -1
  5. package/build/assets/{acp-providers-SCPK1BIU.js → acp-providers-DauuOsW9.js} +1 -1
  6. package/build/assets/{acp-route-guard-IWlFmS6x.js → acp-route-guard-CQTmeJwM.js} +1 -1
  7. package/build/assets/{active-backend-context-CkP3ZEJs.js → active-backend-context-TVbjnvmP.js} +1 -1
  8. package/build/assets/add-backend-modal-KMmPQNZU.js +1 -0
  9. package/build/assets/{agent-server-client-options-8OJSXbm8.js → agent-server-client-options-DT2GP6VJ.js} +1 -1
  10. package/build/assets/{agent-server-compatibility-DvKtnXHw.js → agent-server-compatibility-2aOx5iWd.js} +1 -1
  11. package/build/assets/{agent-server-conversation-service.api-BdEre_71.js → agent-server-conversation-service.api-DSl9G5UR.js} +3 -3
  12. package/build/assets/{agent-settings-DdisD2Xx.js → agent-settings-B247S9G3.js} +2 -2
  13. package/build/assets/{alert-banner-CvTYN73l.js → alert-banner-BWoqueRw.js} +1 -1
  14. package/build/assets/{analytics-consent-form-modal-BKgT9i2w.js → analytics-consent-form-modal-C7sXfxRh.js} +1 -1
  15. package/build/assets/{app-settings-DcYXtxGP.js → app-settings-BVeSaty9.js} +1 -1
  16. package/build/assets/{automation-detail-D7GEU0vR.js → automation-detail-g5-RZ0da.js} +1 -1
  17. package/build/assets/{automations-list-CkVNsgzm.js → automations-list-DHoq_0MM.js} +1 -1
  18. package/build/assets/{backend-form-modal-KudhWUX8.js → backend-form-modal-K6IMCr3p.js} +1 -1
  19. package/build/assets/{backend-synced-settings-badge-BFy2HylT.js → backend-synced-settings-badge-nAfiUWvM.js} +1 -1
  20. package/build/assets/{base-modal-B4HvlFHE.js → base-modal-CQRvRHu1.js} +1 -1
  21. package/build/assets/{brand-button-8fVVei4i.js → brand-button-C2nEKopC.js} +1 -1
  22. package/build/assets/{browser-vYpdU3CR.js → browser-DKG63inJ.js} +1 -1
  23. package/build/assets/{browser-tab-DTM6RyoV.js → browser-tab-B_BuTvrO.js} +1 -1
  24. package/build/assets/{checkmark-BcvXE9bf.js → checkmark-BJJrZUF8.js} +1 -1
  25. package/build/assets/{chevron-left-small-BqSkXTeq.js → chevron-left-small-CSh-sE9L.js} +1 -1
  26. package/build/assets/{circle-plus-check-toggle-DRvuu-RD.js → circle-plus-check-toggle-qs8Va1cC.js} +1 -1
  27. package/build/assets/{clock-DfoVUZVq.js → clock-ZR4Kn-_Y.js} +1 -1
  28. package/build/assets/{close-SnIy2eLD.js → close-BdmyeRqS.js} +1 -1
  29. package/build/assets/{combobox-caret-BMsz5mQX.js → combobox-caret-B53O9Hsq.js} +1 -1
  30. package/build/assets/{condenser-settings-DduLQcpV.js → condenser-settings-A35V3yng.js} +1 -1
  31. package/build/assets/{confirmation-modal-B-DOYMUH.js → confirmation-modal-C9-La0h3.js} +1 -1
  32. package/build/assets/{context-menu-list-item-DzjPB8aC.js → context-menu-list-item-Buu9nc0q.js} +1 -1
  33. package/build/assets/conversation-BD5WemJI.js +19 -0
  34. package/build/assets/conversation-C47K62n8.js +1 -0
  35. package/build/assets/conversation-panel-Dn-S56Gk.js +1 -0
  36. package/build/assets/{conversation-service.api-YTGTw0pz.js → conversation-service.api-C8pYCyV6.js} +1 -1
  37. package/build/assets/{conversation-tab-empty-state-BtFDbyTe.js → conversation-tab-empty-state-D8dNvo-V.js} +1 -1
  38. package/build/assets/{conversation-websocket-context-DulnrIHh.js → conversation-websocket-context-Ywrxd_9p.js} +1 -1
  39. package/build/assets/{copy-BxgbrjDT.js → copy-C7Ti2d8C.js} +1 -1
  40. package/build/assets/{custom-toast-handlers-BYxhSr3t.js → custom-toast-handlers-BOc3qeQ7.js} +1 -1
  41. package/build/assets/declaration-D378OjpZ.js +1 -0
  42. package/build/assets/{device-verify-CTbXX9CQ.js → device-verify-CMusn8nX.js} +1 -1
  43. package/build/assets/edit-automation-modal-Dnjxbjn7.js +1 -0
  44. package/build/assets/{ellipsis-button-BoU2-xlG.js → ellipsis-button-ugUATsNo.js} +1 -1
  45. package/build/assets/{entry.client-DU7-q4ZU.js → entry.client-D9uR9Blz.js} +2 -2
  46. package/build/assets/{enum-filter-dropdown-BJt-NplD.js → enum-filter-dropdown-1vpOGySB.js} +1 -1
  47. package/build/assets/{environment-switch-overlay-DQ1n6Iu6.js → environment-switch-overlay-CTCTQikP.js} +1 -1
  48. package/build/assets/{extensions-hub-BW1FAKFJ.js → extensions-hub-BSUseHVF.js} +1 -1
  49. package/build/assets/{extensions-navigation-CbPMhSML.js → extensions-navigation-CT1kc1u_.js} +1 -1
  50. package/build/assets/{files-tab-CbJ4s7Ik.js → files-tab-B3A1NDlZ.js} +1 -1
  51. package/build/assets/{folder-CerIk8uG.js → folder-0WSMImNX.js} +1 -1
  52. package/build/assets/git-control-bar-branch-button-CcIpmyfM.js +27 -0
  53. package/build/assets/{git-provider-icon-D8RE4unY.js → git-provider-icon-DYE9n7fs.js} +1 -1
  54. package/build/assets/{home-DR11ejqB.js → home-dIzxi5Dd.js} +1 -1
  55. package/build/assets/{i18n-DkYgs32x.js → i18n-DjAGhTis.js} +1 -1
  56. package/build/assets/install-server-modal-z5VaHeXd.js +1 -0
  57. package/build/assets/{launch-DKCU9uJH.js → launch-hZ0ifhcV.js} +1 -1
  58. package/build/assets/{lesson-plan-CmkRbe6Z.js → lesson-plan-DRYG5SLI.js} +1 -1
  59. package/build/assets/{link-external-CvxB0BmI.js → link-external-Df8J52xI.js} +1 -1
  60. package/build/assets/{llm-client-BpIfxETv.js → llm-client-ChQzg4wX.js} +1 -1
  61. package/build/assets/llm-settings-2036m7Wt.js +1 -0
  62. package/build/assets/{llm-settings-BOJC4vD-.js → llm-settings-CcHqGOYL.js} +1 -1
  63. package/build/assets/{loading-spinner-91b5FiMQ.js → loading-spinner-C04FGh14.js} +1 -1
  64. package/build/assets/{manage-backends-modal-DqpzcxdI.js → manage-backends-modal-rYeyGx7j.js} +1 -1
  65. package/build/assets/{manage-workspaces-modal-eG6XgAvw.js → manage-workspaces-modal-C5EuW8m1.js} +1 -1
  66. package/build/assets/manifest-97e839da.js +1 -0
  67. package/build/assets/{markdown-renderer-wZnLDbA1.js → markdown-renderer-CEX4Becj.js} +1 -1
  68. package/build/assets/mcp-C06YssEI.js +9 -0
  69. package/build/assets/messages-T2ewVkbp.js +36 -0
  70. package/build/assets/{modal-backdrop-B04pVYAD.js → modal-backdrop-DTYGVmOR.js} +1 -1
  71. package/build/assets/{modal-body-CgUoFQA1.js → modal-body-YElmM1dV.js} +1 -1
  72. package/build/assets/{modal-close-button-SM_WXzDY.js → modal-close-button-C_GpQt9F.js} +1 -1
  73. package/build/assets/{model-selector-7id-Uirf.js → model-selector-DeMmw-Xa.js} +1 -1
  74. package/build/assets/{navigation-context-BFjstyH6.js → navigation-context-DeIPtGPp.js} +1 -1
  75. package/build/assets/{navigation-link-DFQ7YcWq.js → navigation-link-C9JD4PYD.js} +1 -1
  76. package/build/assets/{openhands-logo-DkDp75rC.js → openhands-logo-CI5Fhn1W.js} +1 -1
  77. package/build/assets/{option-service.api-DN0ZcGjw.js → option-service.api-DsI1UW7N.js} +1 -1
  78. package/build/assets/{organization-service.api-Ct2dZF8M.js → organization-service.api-COwMPFg5.js} +1 -1
  79. package/build/assets/{path-utils-D1ZtqFC7.js → path-utils-CqJboYxo.js} +1 -1
  80. package/build/assets/{plan-components-gOm-daR3.js → plan-components-DEjMuDDG.js} +1 -1
  81. package/build/assets/{planner-tab-yubfN-6U.js → planner-tab-BrntFmb1.js} +1 -1
  82. package/build/assets/{profiles-client-D4twHRVf.js → profiles-client-BGkKEV9j.js} +1 -1
  83. package/build/assets/{providers-C2T07PM3.js → providers-DXvCAN_u.js} +1 -1
  84. package/build/assets/{proxy-BMZyC45G.js → proxy-CurRmrqf.js} +1 -1
  85. package/build/assets/{query-client-config-CiK0GJJO.js → query-client-config-Ba7qAAoO.js} +1 -1
  86. package/build/assets/recommended-automations-launcher-BI9NhG8Y.js +52 -0
  87. package/build/assets/root-BS1Td78t.js +2 -0
  88. package/build/assets/root-DHeCXo9N.css +1 -0
  89. package/build/assets/{root-layout-B4QioBS6.js → root-layout-BLjAEgle.js} +2 -2
  90. package/build/assets/{sdk-section-page-03k88tIR.js → sdk-section-page-CJW0G04-.js} +1 -1
  91. package/build/assets/{sdk-settings-schema-BY8dOy3a.js → sdk-settings-schema-QBYH-ONX.js} +1 -1
  92. package/build/assets/{search-BCAF9EDS.js → search-Cq_cFrDt.js} +1 -1
  93. package/build/assets/{secrets-service-Z3qtRb_G.js → secrets-service-Bwd5DeUs.js} +1 -1
  94. package/build/assets/{secrets-settings-BnlByuMZ.js → secrets-settings-MLXqOtX2.js} +1 -1
  95. package/build/assets/{server-client-CG1zHqph.js → server-client-C3mC8Hl3.js} +1 -1
  96. package/build/assets/{settings-DyzGLF_d.js → settings-D7E2U5tK.js} +1 -1
  97. package/build/assets/{settings-client-CkXDJwIY.js → settings-client-CwjfwoiB.js} +1 -1
  98. package/build/assets/{settings-dropdown-input-CAQWQgx-.js → settings-dropdown-input-VwAXNrOb.js} +1 -1
  99. package/build/assets/{settings-gear-D4ZkEDGb.js → settings-gear-BJwWR1ej.js} +1 -1
  100. package/build/assets/{settings-index-KtTw49xL.js → settings-index-J-3BNR0W.js} +1 -1
  101. package/build/assets/{settings-input-BWCZt9g2.js → settings-input-DBywAnA7.js} +1 -1
  102. package/build/assets/{settings-list-classes-xMleGkTC.js → settings-list-classes-BOS092DR.js} +1 -1
  103. package/build/assets/{settings-modal-Cv2YWSUY.js → settings-modal-B8vgWDTe.js} +1 -1
  104. package/build/assets/{settings-section-header-context-1wfkgjZZ.js → settings-section-header-context-32x6WTyL.js} +1 -1
  105. package/build/assets/settings-service.api-FvJGK45W.js +1 -0
  106. package/build/assets/{settings-switch-CGap2LtG.js → settings-switch-DTKmHC8F.js} +1 -1
  107. package/build/assets/{settings-utils-BBozxqqi.js → settings-utils-BsvSU3OM.js} +1 -1
  108. package/build/assets/{shared-conversation-DQlzwdpo.js → shared-conversation-a0QV8o99.js} +1 -1
  109. package/build/assets/{sidebar-mobile-menu-toggle-DXplko7u.js → sidebar-mobile-menu-toggle-DTUNI1WQ.js} +1 -1
  110. package/build/assets/{sidebar-nav-link-B4h8naZ7.js → sidebar-nav-link-CnWoZcwc.js} +1 -1
  111. package/build/assets/{skill-card-pill-row-D0oTWx-a.js → skill-card-pill-row-tZ599jli.js} +1 -1
  112. package/build/assets/{skills-BN8atjgW.js → skills-ZyAO5dyK.js} +1 -1
  113. package/build/assets/{skills-plugins-BTnp7QcQ.js → skills-plugins-BSRz041I.js} +1 -1
  114. package/build/assets/{skills-settings-CbOQvzkR.js → skills-settings-DOnMn9q1.js} +2 -2
  115. package/build/assets/{status-DDL-ipIP.js → status-CsatcFbK.js} +1 -1
  116. package/build/assets/{styled-tooltip-Awq4HMw3.js → styled-tooltip-CS3mB_1X.js} +1 -1
  117. package/build/assets/{switch-skeleton-Bv21RGWd.js → switch-skeleton-C-CfhYYV.js} +1 -1
  118. package/build/assets/{task-list-tab-B45ktzHM.js → task-list-tab-Day9nhRT.js} +1 -1
  119. package/build/assets/{terminal-DGuR4559.js → terminal-LNa-iU5c.js} +1 -1
  120. package/build/assets/{terminal-D5pzR9Ru.js → terminal-ro4SNjUU.js} +1 -1
  121. package/build/assets/{toggle-switch-gj6T-wsU.js → toggle-switch-k-IZCDbt.js} +1 -1
  122. package/build/assets/{typography-BbaUAC4V.js → typography-vVUMoNUg.js} +1 -1
  123. package/build/assets/{u-check-circle-DHGiAi-w.js → u-check-circle-DplbarS5.js} +1 -1
  124. package/build/assets/{u-check-circle-half-BPcWtWwv.js → u-check-circle-half-yDuiSZHC.js} +1 -1
  125. package/build/assets/{u-circuit-B_nK9hOu.js → u-circuit-C9tYkpeK.js} +1 -1
  126. package/build/assets/{u-edit-BPFJBd34.js → u-edit-KAUlufD8.js} +1 -1
  127. package/build/assets/{use-active-conversation-Bu5J9iLy.js → use-active-conversation-D15D9GgR.js} +1 -1
  128. package/build/assets/{use-agent-settings-schema-BbtOsR7P.js → use-agent-settings-schema-Bvp5UzV8.js} +1 -1
  129. package/build/assets/{use-agent-state-DN9Nc5pP.js → use-agent-state-DE5dlEXJ.js} +1 -1
  130. package/build/assets/{use-cloud-current-user-id-B_rMUiu8.js → use-cloud-current-user-id-DWVar4st.js} +1 -1
  131. package/build/assets/{use-config-Bcz2JL2t.js → use-config-BSu_53GL.js} +1 -1
  132. package/build/assets/{use-conversation-id-BOaaZahn.js → use-conversation-id-DajhCn2A.js} +1 -1
  133. package/build/assets/{use-create-conversation-BWFA_FId.js → use-create-conversation-DW7AGgLA.js} +1 -1
  134. package/build/assets/{use-handle-plan-click-CgrCGmT1.js → use-handle-plan-click-DpgEQDAV.js} +1 -1
  135. package/build/assets/use-is-authed-hXC8vxgT.js +1 -0
  136. package/build/assets/{use-is-creating-conversation-DhoM7UAB.js → use-is-creating-conversation-DhDeeWfA.js} +1 -1
  137. package/build/assets/{use-launch-skill-in-chat-DOyQsXFO.js → use-launch-skill-in-chat-DVGPFrbI.js} +1 -1
  138. package/build/assets/{use-llm-profiles-CAIzHJDX.js → use-llm-profiles-D3-KXwQ0.js} +1 -1
  139. package/build/assets/use-runtime-is-ready-XFbT16BD.js +1 -0
  140. package/build/assets/{use-save-settings-5m3w89Ph.js → use-save-settings-CEEKSTWG.js} +1 -1
  141. package/build/assets/{use-settings-DzG0C3vO.js → use-settings-DQ7Oo1Hj.js} +1 -1
  142. package/build/assets/{use-settings-nav-items-BIsKeX52.js → use-settings-nav-items-YmrXrjn9.js} +2 -2
  143. package/build/assets/{use-skills-Cn-78xP1.js → use-skills-Xe0vjPMt.js} +1 -1
  144. package/build/assets/{use-unified-vscode-url-C5iI-Z5A.js → use-unified-vscode-url-BOsIOd-b.js} +1 -1
  145. package/build/assets/use-user-conversation-Mc0mQgkl.js +1 -0
  146. package/build/assets/{useMutation-CRJwk4cR.js → useMutation-B4OUESdw.js} +1 -1
  147. package/build/assets/{useTranslation-01pF7z10.js → useTranslation-CpIcQBq6.js} +1 -1
  148. package/build/assets/{utils-Czcl6buL.js → utils-D-HX7JCe.js} +1 -1
  149. package/build/assets/{vendor~conversation-panel~conversation-CbjvWBSu.js → vendor~conversation-panel~conversation-BlCIz9XQ.js} +1 -1
  150. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CofhIDpd.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ds9quNZ9.js} +1 -1
  151. package/build/assets/vendor~home~mcp~automations-list-C5PoHCy6.js +1 -0
  152. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-BQPOygpY.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CGlZoBKa.js} +1 -1
  153. package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CyYIBiBk.js → vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-DE11mPxp.js} +1 -1
  154. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CuGq_cxH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-8b8V5bfO.js} +1 -1
  155. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CFpDeb9o.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-Dy7L6fMG.js} +1 -1
  156. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-C1p8-pMr.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-D40EXhZx.js} +1 -1
  157. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-CHrEOFl6.js +48 -0
  158. package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js} +1 -1
  159. package/build/assets/{verification-settings-DbziMp4K.js → verification-settings-BtlTiHP8.js} +1 -1
  160. package/build/assets/{vscode-tab-BVhQR2rt.js → vscode-tab-C0ShhiSU.js} +1 -1
  161. package/build/assets/{waiting-for-runtime-message-JotSOBdC.js → waiting-for-runtime-message-DWPl_Yby.js} +1 -1
  162. package/build/assets/{x-mark-CZ57VvRX.js → x-mark-CWI0f9yI.js} +1 -1
  163. package/build/favicon.svg +1 -0
  164. package/build/index.html +4 -4
  165. package/build/locales/ar/openhands.json +8 -0
  166. package/build/locales/ca/openhands.json +8 -0
  167. package/build/locales/de/openhands.json +8 -0
  168. package/build/locales/en/openhands.json +8 -0
  169. package/build/locales/es/openhands.json +8 -0
  170. package/build/locales/fr/openhands.json +8 -0
  171. package/build/locales/it/openhands.json +8 -0
  172. package/build/locales/ja/openhands.json +8 -0
  173. package/build/locales/ko-KR/openhands.json +8 -0
  174. package/build/locales/no/openhands.json +8 -0
  175. package/build/locales/pt/openhands.json +8 -0
  176. package/build/locales/tr/openhands.json +8 -0
  177. package/build/locales/uk/openhands.json +8 -0
  178. package/build/locales/zh-CN/openhands.json +8 -0
  179. package/build/locales/zh-TW/openhands.json +8 -0
  180. package/config/defaults.json +1 -1
  181. package/dist/api/agent-server-config.cjs +1 -1
  182. package/dist/api/agent-server-config.cjs.map +1 -1
  183. package/dist/api/agent-server-config.d.ts +1 -1
  184. package/dist/api/agent-server-config.js +1 -1
  185. package/dist/api/agent-server-config.js.map +1 -1
  186. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  187. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  188. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +12 -0
  189. package/dist/api/conversation-service/agent-server-conversation-service.api.js +4 -0
  190. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  191. package/dist/api/mcp-service/mcp-service.api.cjs +2 -0
  192. package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -0
  193. package/dist/api/mcp-service/mcp-service.api.d.ts +6 -0
  194. package/dist/api/mcp-service/mcp-service.api.js +36 -0
  195. package/dist/api/mcp-service/mcp-service.api.js.map +1 -0
  196. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  197. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  198. package/dist/api/settings-service/settings-service.api.d.ts +1 -0
  199. package/dist/api/settings-service/settings-service.api.js +59 -41
  200. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  201. package/dist/components/features/automations/detail/activity-log-item.d.ts +1 -1
  202. package/dist/components/features/automations/recommended-automations-launcher.d.ts +1 -1
  203. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  204. package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
  205. package/dist/components/features/chat/change-agent-button.js +65 -59
  206. package/dist/components/features/chat/change-agent-button.js.map +1 -1
  207. package/dist/components/features/chat/chat-interface.cjs +2 -2
  208. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  209. package/dist/components/features/chat/chat-interface.js +15 -14
  210. package/dist/components/features/chat/chat-interface.js.map +1 -1
  211. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  212. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  213. package/dist/components/features/chat/components/chat-input-actions.js +127 -149
  214. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  215. package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
  216. package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
  217. package/dist/components/features/chat/components/chat-input-model.d.ts +10 -0
  218. package/dist/components/features/chat/components/chat-input-model.js +95 -60
  219. package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
  220. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  221. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  222. package/dist/components/features/chat/git-control-bar.js +60 -59
  223. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  224. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  225. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  226. package/dist/components/features/conversation/conversation-name-with-status.js +2 -2
  227. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  228. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  229. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  230. package/dist/components/features/conversation/conversation-name.js +3 -3
  231. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  232. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  233. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  234. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +1 -1
  235. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  236. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  237. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  238. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +16 -16
  239. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  240. package/dist/components/features/mcp-logo-badge.cjs +1 -1
  241. package/dist/components/features/mcp-logo-badge.cjs.map +1 -1
  242. package/dist/components/features/mcp-logo-badge.d.ts +2 -2
  243. package/dist/components/features/mcp-logo-badge.js +1 -1
  244. package/dist/components/features/mcp-logo-badge.js.map +1 -1
  245. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  246. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  247. package/dist/components/features/mcp-page/custom-server-editor.js +64 -41
  248. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  249. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  250. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  251. package/dist/components/features/mcp-page/install-server-modal.d.ts +1 -1
  252. package/dist/components/features/mcp-page/install-server-modal.js +126 -102
  253. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  254. package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
  255. package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
  256. package/dist/components/features/mcp-page/installed-server-card.js +1 -1
  257. package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
  258. package/dist/components/features/mcp-page/marketplace-card.cjs +1 -1
  259. package/dist/components/features/mcp-page/marketplace-card.cjs.map +1 -1
  260. package/dist/components/features/mcp-page/marketplace-card.d.ts +1 -1
  261. package/dist/components/features/mcp-page/marketplace-card.js +27 -25
  262. package/dist/components/features/mcp-page/marketplace-card.js.map +1 -1
  263. package/dist/components/features/mcp-page/marketplace-section.cjs +1 -1
  264. package/dist/components/features/mcp-page/marketplace-section.cjs.map +1 -1
  265. package/dist/components/features/mcp-page/marketplace-section.d.ts +1 -1
  266. package/dist/components/features/mcp-page/marketplace-section.js +1 -1
  267. package/dist/components/features/mcp-page/marketplace-section.js.map +1 -1
  268. package/dist/components/features/mcp-page/mcp-logo-stack-badge.d.ts +2 -2
  269. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +7 -7
  270. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
  271. package/dist/components/features/settings/mcp-settings/mcp-server-form.d.ts +8 -12
  272. package/dist/components/features/settings/mcp-settings/mcp-server-form.js +114 -87
  273. package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
  274. package/dist/context/scroll-context.cjs +1 -1
  275. package/dist/context/scroll-context.cjs.map +1 -1
  276. package/dist/context/scroll-context.d.ts +1 -0
  277. package/dist/context/scroll-context.js +4 -1
  278. package/dist/context/scroll-context.js.map +1 -1
  279. package/dist/favicon.svg +1 -0
  280. package/dist/hooks/mutation/use-switch-acp-model.cjs +2 -0
  281. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -0
  282. package/dist/hooks/mutation/use-switch-acp-model.d.ts +23 -0
  283. package/dist/hooks/mutation/use-switch-acp-model.js +26 -0
  284. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -0
  285. package/dist/hooks/mutation/use-test-mcp-server.cjs +2 -0
  286. package/dist/hooks/mutation/use-test-mcp-server.cjs.map +1 -0
  287. package/dist/hooks/mutation/use-test-mcp-server.d.ts +2 -0
  288. package/dist/hooks/mutation/use-test-mcp-server.js +10 -0
  289. package/dist/hooks/mutation/use-test-mcp-server.js.map +1 -0
  290. package/dist/hooks/query/use-automation-detail.d.ts +3 -2
  291. package/dist/hooks/use-acp-model-context.cjs.map +1 -1
  292. package/dist/hooks/use-acp-model-context.d.ts +3 -4
  293. package/dist/hooks/use-acp-model-context.js.map +1 -1
  294. package/dist/hooks/use-chat-input-model-state.cjs +2 -0
  295. package/dist/hooks/use-chat-input-model-state.cjs.map +1 -0
  296. package/dist/hooks/use-chat-input-model-state.d.ts +12 -0
  297. package/dist/hooks/use-chat-input-model-state.js +29 -0
  298. package/dist/hooks/use-chat-input-model-state.js.map +1 -0
  299. package/dist/i18n/declaration.cjs +1 -1
  300. package/dist/i18n/declaration.cjs.map +1 -1
  301. package/dist/i18n/declaration.d.ts +8 -0
  302. package/dist/i18n/declaration.js +1 -1
  303. package/dist/i18n/declaration.js.map +1 -1
  304. package/dist/i18n/translation.cjs +2 -2
  305. package/dist/i18n/translation.cjs.map +1 -1
  306. package/dist/i18n/translation.js +136 -0
  307. package/dist/i18n/translation.js.map +1 -1
  308. package/dist/locales/ar/openhands.json +8 -0
  309. package/dist/locales/ca/openhands.json +8 -0
  310. package/dist/locales/de/openhands.json +8 -0
  311. package/dist/locales/en/openhands.json +8 -0
  312. package/dist/locales/es/openhands.json +8 -0
  313. package/dist/locales/fr/openhands.json +8 -0
  314. package/dist/locales/it/openhands.json +8 -0
  315. package/dist/locales/ja/openhands.json +8 -0
  316. package/dist/locales/ko-KR/openhands.json +8 -0
  317. package/dist/locales/no/openhands.json +8 -0
  318. package/dist/locales/pt/openhands.json +8 -0
  319. package/dist/locales/tr/openhands.json +8 -0
  320. package/dist/locales/uk/openhands.json +8 -0
  321. package/dist/locales/zh-CN/openhands.json +8 -0
  322. package/dist/locales/zh-TW/openhands.json +8 -0
  323. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs +2 -0
  324. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs.map +1 -0
  325. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js +37 -0
  326. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js.map +1 -0
  327. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs +2 -0
  328. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs.map +1 -0
  329. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js +36 -0
  330. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js.map +1 -0
  331. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.cjs +1 -1
  332. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -0
  333. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.js +15 -5
  334. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -0
  335. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs +2 -0
  336. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs.map +1 -0
  337. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js +36 -0
  338. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js.map +1 -0
  339. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs +2 -0
  340. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs.map +1 -0
  341. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js +31 -0
  342. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js.map +1 -0
  343. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs +2 -0
  344. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs.map +1 -0
  345. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js +52 -0
  346. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js.map +1 -0
  347. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.cjs +1 -1
  348. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.cjs.map +1 -0
  349. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.js +15 -5
  350. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.js.map +1 -0
  351. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs +2 -0
  352. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs.map +1 -0
  353. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-browser-rendering.js +15 -5
  354. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.js.map +1 -0
  355. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.cjs +1 -1
  356. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.cjs.map +1 -0
  357. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.js +15 -5
  358. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.js.map +1 -0
  359. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.cjs +1 -1
  360. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.cjs.map +1 -0
  361. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.js +15 -5
  362. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.js.map +1 -0
  363. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs +2 -0
  364. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs.map +1 -0
  365. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-observability.js +15 -5
  366. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.js.map +1 -0
  367. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.cjs +1 -1
  368. package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.cjs.map +1 -0
  369. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.js +15 -5
  370. package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.js.map +1 -0
  371. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs +2 -0
  372. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs.map +1 -0
  373. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js +36 -0
  374. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js.map +1 -0
  375. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.cjs +1 -1
  376. package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.cjs.map +1 -0
  377. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.js +13 -6
  378. package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.js.map +1 -0
  379. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs +2 -0
  380. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs.map +1 -0
  381. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js +36 -0
  382. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js.map +1 -0
  383. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.cjs +1 -1
  384. package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.cjs.map +1 -0
  385. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.js +13 -6
  386. package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.js.map +1 -0
  387. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs +2 -0
  388. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs.map +1 -0
  389. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js +40 -0
  390. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js.map +1 -0
  391. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs +2 -0
  392. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs.map +1 -0
  393. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js +39 -0
  394. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js.map +1 -0
  395. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs +2 -0
  396. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs.map +1 -0
  397. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js +36 -0
  398. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js.map +1 -0
  399. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs +2 -0
  400. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs.map +1 -0
  401. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js +40 -0
  402. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js.map +1 -0
  403. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +2 -0
  404. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -0
  405. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +47 -0
  406. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -0
  407. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.cjs +1 -1
  408. package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.cjs.map +1 -0
  409. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.js +15 -5
  410. package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.js.map +1 -0
  411. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs +2 -0
  412. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs.map +1 -0
  413. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js +36 -0
  414. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js.map +1 -0
  415. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.cjs +1 -1
  416. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -0
  417. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.js +15 -5
  418. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -0
  419. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs +2 -0
  420. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs.map +1 -0
  421. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/memory.js +13 -6
  422. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.js.map +1 -0
  423. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs +2 -0
  424. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs.map +1 -0
  425. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js +36 -0
  426. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js.map +1 -0
  427. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs +2 -0
  428. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs.map +1 -0
  429. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js +40 -0
  430. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js.map +1 -0
  431. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +2 -0
  432. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -0
  433. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +39 -0
  434. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -0
  435. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs +2 -0
  436. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs.map +1 -0
  437. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js +38 -0
  438. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js.map +1 -0
  439. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs +2 -0
  440. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs.map +1 -0
  441. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/paypal.js +15 -5
  442. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.js.map +1 -0
  443. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs +2 -0
  444. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs.map +1 -0
  445. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/playwright.js +13 -6
  446. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.js.map +1 -0
  447. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs +2 -0
  448. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs.map +1 -0
  449. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js +43 -0
  450. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js.map +1 -0
  451. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs +2 -0
  452. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs.map +1 -0
  453. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js +41 -0
  454. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js.map +1 -0
  455. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs +2 -0
  456. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs.map +1 -0
  457. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sentry.js +15 -5
  458. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.js.map +1 -0
  459. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs +2 -0
  460. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs.map +1 -0
  461. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sequential-thinking.js +13 -6
  462. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.js.map +1 -0
  463. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +2 -0
  464. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -0
  465. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +45 -0
  466. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -0
  467. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs +2 -0
  468. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs.map +1 -0
  469. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/stripe.js +15 -5
  470. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.js.map +1 -0
  471. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs +2 -0
  472. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs.map +1 -0
  473. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js +37 -0
  474. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js.map +1 -0
  475. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/tavily.cjs +1 -1
  476. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.cjs.map +1 -0
  477. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js +39 -0
  478. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js.map +1 -0
  479. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs +2 -0
  480. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs.map +1 -0
  481. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/time.js +13 -6
  482. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.js.map +1 -0
  483. package/dist/node_modules/@openhands/extensions/integrations/index.cjs +2 -0
  484. package/dist/node_modules/@openhands/extensions/integrations/index.cjs.map +1 -0
  485. package/dist/node_modules/@openhands/extensions/integrations/index.js +175 -0
  486. package/dist/node_modules/@openhands/extensions/integrations/index.js.map +1 -0
  487. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.cjs +1 -1
  488. package/dist/node_modules/@openhands/extensions/integrations/logos.cjs.map +1 -0
  489. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.js +2 -2
  490. package/dist/node_modules/@openhands/extensions/integrations/logos.js.map +1 -0
  491. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs +2 -0
  492. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs.map +1 -0
  493. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js +548 -0
  494. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js.map +1 -0
  495. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs +2 -0
  496. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs.map +1 -0
  497. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js +482 -0
  498. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js.map +1 -0
  499. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  500. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  501. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +3 -0
  502. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  503. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs +2 -0
  504. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs.map +1 -0
  505. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js +22 -0
  506. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js.map +1 -0
  507. package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
  508. package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -0
  509. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  510. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  511. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +3 -0
  512. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  513. package/dist/package.cjs +1 -1
  514. package/dist/package.cjs.map +1 -1
  515. package/dist/package.js +6 -4
  516. package/dist/package.js.map +1 -1
  517. package/dist/routes/mcp.cjs +1 -1
  518. package/dist/routes/mcp.cjs.map +1 -1
  519. package/dist/routes/mcp.js +1 -1
  520. package/dist/routes/mcp.js.map +1 -1
  521. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  522. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  523. package/dist/utils/mcp-marketplace-utils.d.ts +21 -1
  524. package/dist/utils/mcp-marketplace-utils.js +23 -13
  525. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  526. package/dist/utils/settings-utils.cjs.map +1 -1
  527. package/dist/utils/settings-utils.js.map +1 -1
  528. package/package.json +6 -4
  529. package/scripts/check-sdk-version-sync.mjs +6 -6
  530. package/scripts/dev-safe.mjs +25 -7
  531. package/scripts/dev-with-automation.mjs +6 -1
  532. package/tools/canvas_ui_tool.py +129 -0
  533. package/build/assets/add-backend-modal-CqjNjGqY.js +0 -1
  534. package/build/assets/conversation-COZAKz_K.js +0 -1
  535. package/build/assets/conversation-DWcvnmds.js +0 -19
  536. package/build/assets/conversation-panel-CZDStT0b.js +0 -1
  537. package/build/assets/declaration-C9nuq2Dj.js +0 -1
  538. package/build/assets/edit-automation-modal-C3bFxS2f.js +0 -1
  539. package/build/assets/git-control-bar-branch-button-Bm6rzSpo.js +0 -27
  540. package/build/assets/install-server-modal-VB5hOBpW.js +0 -1
  541. package/build/assets/llm-settings-CIdxmimN.js +0 -1
  542. package/build/assets/manifest-f041e61a.js +0 -1
  543. package/build/assets/mcp-BdfyCW1l.js +0 -9
  544. package/build/assets/messages-v-q35ObG.js +0 -36
  545. package/build/assets/recommended-automations-launcher-Cx7svuGE.js +0 -52
  546. package/build/assets/root-D2PVd51i.js +0 -2
  547. package/build/assets/root-DEotKI6b.css +0 -1
  548. package/build/assets/settings-service.api-Z6x0l0GU.js +0 -1
  549. package/build/assets/use-is-authed-BFoh8Ogh.js +0 -1
  550. package/build/assets/use-runtime-is-ready-BQWLEyqa.js +0 -1
  551. package/build/assets/use-user-conversation-BCYpbPT1.js +0 -1
  552. package/build/assets/vendor~home~mcp~automations-list-DRfWZRnF.js +0 -1
  553. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js +0 -48
  554. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs +0 -2
  555. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs.map +0 -1
  556. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js +0 -30
  557. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js.map +0 -1
  558. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs +0 -2
  559. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs.map +0 -1
  560. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js +0 -29
  561. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js.map +0 -1
  562. package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.cjs.map +0 -1
  563. package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.js.map +0 -1
  564. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs +0 -2
  565. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs.map +0 -1
  566. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js +0 -29
  567. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js.map +0 -1
  568. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs +0 -2
  569. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs.map +0 -1
  570. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js +0 -24
  571. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js.map +0 -1
  572. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs +0 -2
  573. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs.map +0 -1
  574. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js +0 -45
  575. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js.map +0 -1
  576. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.cjs.map +0 -1
  577. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.js.map +0 -1
  578. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs +0 -2
  579. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs.map +0 -1
  580. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.js.map +0 -1
  581. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.cjs.map +0 -1
  582. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.js.map +0 -1
  583. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.cjs.map +0 -1
  584. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.js.map +0 -1
  585. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs +0 -2
  586. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs.map +0 -1
  587. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.js.map +0 -1
  588. package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.cjs.map +0 -1
  589. package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.js.map +0 -1
  590. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs +0 -2
  591. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs.map +0 -1
  592. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js +0 -29
  593. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js.map +0 -1
  594. package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.cjs.map +0 -1
  595. package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.js.map +0 -1
  596. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs +0 -2
  597. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs.map +0 -1
  598. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js +0 -29
  599. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js.map +0 -1
  600. package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.cjs.map +0 -1
  601. package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.js.map +0 -1
  602. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs +0 -2
  603. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs.map +0 -1
  604. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js +0 -33
  605. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js.map +0 -1
  606. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs +0 -2
  607. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs.map +0 -1
  608. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js +0 -32
  609. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js.map +0 -1
  610. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs +0 -2
  611. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs.map +0 -1
  612. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js +0 -29
  613. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js.map +0 -1
  614. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs +0 -2
  615. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs.map +0 -1
  616. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js +0 -33
  617. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js.map +0 -1
  618. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs +0 -2
  619. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs.map +0 -1
  620. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js +0 -40
  621. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js.map +0 -1
  622. package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.cjs.map +0 -1
  623. package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.js.map +0 -1
  624. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs +0 -2
  625. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs.map +0 -1
  626. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js +0 -29
  627. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js.map +0 -1
  628. package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.cjs.map +0 -1
  629. package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.js.map +0 -1
  630. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs +0 -2
  631. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs.map +0 -1
  632. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.js.map +0 -1
  633. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs +0 -2
  634. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs.map +0 -1
  635. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js +0 -29
  636. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js.map +0 -1
  637. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs +0 -2
  638. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs.map +0 -1
  639. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js +0 -33
  640. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js.map +0 -1
  641. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs +0 -2
  642. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs.map +0 -1
  643. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js +0 -32
  644. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js.map +0 -1
  645. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs +0 -2
  646. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs.map +0 -1
  647. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js +0 -31
  648. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js.map +0 -1
  649. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs +0 -2
  650. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs.map +0 -1
  651. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.js.map +0 -1
  652. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs +0 -2
  653. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs.map +0 -1
  654. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.js.map +0 -1
  655. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs +0 -2
  656. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs.map +0 -1
  657. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js +0 -36
  658. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js.map +0 -1
  659. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs +0 -2
  660. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs.map +0 -1
  661. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js +0 -34
  662. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js.map +0 -1
  663. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs +0 -2
  664. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs.map +0 -1
  665. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.js.map +0 -1
  666. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs +0 -2
  667. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs.map +0 -1
  668. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.js.map +0 -1
  669. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs +0 -2
  670. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs.map +0 -1
  671. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js +0 -38
  672. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js.map +0 -1
  673. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs +0 -2
  674. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs.map +0 -1
  675. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.js.map +0 -1
  676. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs +0 -2
  677. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs.map +0 -1
  678. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js +0 -30
  679. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js.map +0 -1
  680. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.cjs.map +0 -1
  681. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js +0 -32
  682. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js.map +0 -1
  683. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs +0 -2
  684. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs.map +0 -1
  685. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.js.map +0 -1
  686. package/dist/node_modules/@openhands/extensions/mcps/index.cjs +0 -2
  687. package/dist/node_modules/@openhands/extensions/mcps/index.cjs.map +0 -1
  688. package/dist/node_modules/@openhands/extensions/mcps/index.js +0 -87
  689. package/dist/node_modules/@openhands/extensions/mcps/index.js.map +0 -1
  690. package/dist/node_modules/@openhands/extensions/mcps/logos.cjs.map +0 -1
  691. package/dist/node_modules/@openhands/extensions/mcps/logos.js.map +0 -1
@@ -337,7 +337,7 @@ export function validateFrontendDependencies(
337
337
  * edits are picked up without a manual reinstall. The agent-server itself
338
338
  * is rebuilt from local source on each invocation (--reinstall).
339
339
  * - OH_AGENT_SERVER_GIT_REF: Git commit SHA or branch name
340
- * - OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "1.23.1")
340
+ * - OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "1.24.0")
341
341
  *
342
342
  * If none are set, defaults to the released version specified by
343
343
  * DEFAULT_AGENT_SERVER_VERSION. Set OH_AGENT_SERVER_GIT_REF to use a
@@ -606,6 +606,17 @@ function buildConfigFromPorts(ports, cwd, env) {
606
606
  */
607
607
  export function buildAgentServerEnv(config) {
608
608
  return {
609
+ // Force Python to use UTF-8 for all file I/O and streams.
610
+ //
611
+ // On Windows, Python defaults to the system ANSI codepage (e.g. cp1252).
612
+ // The agent-server writes conversation metadata JSON that can contain
613
+ // emoji (e.g. ✅ U+2705) which cp1252 cannot encode, producing:
614
+ // UnicodeEncodeError: 'charmap' codec can't encode character '\u2705'
615
+ // Setting PYTHONUTF8=1 enables Python's UTF-8 mode (PEP 540) for the
616
+ // entire agent-server process, matching the behaviour on Linux/macOS
617
+ // where the locale is already UTF-8.
618
+ // This is a no-op on Linux/macOS where the locale is already UTF-8.
619
+ PYTHONUTF8: "1",
609
620
  TMUX_TMPDIR: config.tmuxTmpDir,
610
621
  OH_CONVERSATIONS_PATH: config.conversationsPath,
611
622
  OH_BASH_EVENTS_DIR: config.bashEventsDir,
@@ -753,17 +764,24 @@ export function buildNpmScriptCommand(
753
764
  env = process.env,
754
765
  nodeExecPath = process.execPath,
755
766
  ) {
756
- if (env.npm_execpath) {
767
+ // On Windows, always use cmd.exe regardless of whether npm_execpath is set.
768
+ // npm_execpath points to a path like
769
+ // "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" which contains
770
+ // spaces. When that path is passed as an argument with shell:true in
771
+ // spawnService, cmd.exe splits on the space and tries to run "C:\Program"
772
+ // as a command, producing "not recognized as an internal or external command".
773
+ // Using "npm" via cmd.exe avoids the problem entirely.
774
+ if (platform === "win32") {
757
775
  return {
758
- command: env.npm_node_execpath || nodeExecPath,
759
- args: [env.npm_execpath, "run", scriptName],
776
+ command: env.ComSpec || "cmd.exe",
777
+ args: ["/d", "/s", "/c", "npm", "run", scriptName],
760
778
  };
761
779
  }
762
780
 
763
- if (platform === "win32") {
781
+ if (env.npm_execpath) {
764
782
  return {
765
- command: env.ComSpec || "cmd.exe",
766
- args: ["/d", "/s", "/c", "npm", "run", scriptName],
783
+ command: env.npm_node_execpath || nodeExecPath,
784
+ args: [env.npm_execpath, "run", scriptName],
767
785
  };
768
786
  }
769
787
 
@@ -330,7 +330,9 @@ async function buildConfig(args, env = process.env) {
330
330
 
331
331
  // Session API key — shared by both agent-server and automation backend.
332
332
  // Both validate it via the `X-Session-API-Key` header.
333
- const stateDir = join(homedir(), ".openhands", "agent-canvas");
333
+ const stateDir =
334
+ env.OH_CANVAS_SAFE_STATE_DIR ||
335
+ join(homedir(), ".openhands", "agent-canvas");
334
336
  const safeConfig = buildSafeDevConfig(projectRoot, {
335
337
  ...env,
336
338
  OH_CANVAS_SAFE_STATE_DIR: stateDir,
@@ -583,6 +585,9 @@ function startAutomationBackend(config) {
583
585
  {
584
586
  cwd: config.stateDir,
585
587
  env: {
588
+ // Force UTF-8 for all Python file I/O (same reason as agent-server;
589
+ // see buildAgentServerEnv in dev-safe.mjs).
590
+ PYTHONUTF8: "1",
586
591
  // The URL the automation backend itself uses to call the
587
592
  // agent-server's REST API (tarball upload + bash dispatch).
588
593
  //
@@ -0,0 +1,129 @@
1
+ """Canvas UI control tool.
2
+
3
+ Shipped with Agent Canvas. Mounted into the agent-server container at
4
+ ``/canvas-tools`` and loaded via ``tool_module_qualnames`` so the agent can
5
+ direct the frontend (navigate to a file, switch tabs, show a preview).
6
+
7
+ The server-side executor is a no-op that returns an acknowledgment. The actual
8
+ UI effect happens client-side: the frontend watches the WebSocket stream for
9
+ ``ActionEvent``s with ``tool_name == "canvas_ui"`` and dispatches the command.
10
+ """
11
+
12
+ from collections.abc import Sequence
13
+ from typing import Literal
14
+
15
+ from pydantic import Field
16
+
17
+ from openhands.sdk import Action, Observation, ToolDefinition
18
+ from openhands.sdk.tool import (
19
+ ToolAnnotations,
20
+ ToolExecutor,
21
+ register_tool,
22
+ )
23
+
24
+
25
+ CanvasCommand = Literal["navigate_to_file", "open_tab", "show_preview"]
26
+ CanvasTab = Literal[
27
+ "files", "browser", "vscode", "terminal", "planner", "tasklist"
28
+ ]
29
+
30
+
31
+ class CanvasUIAction(Action):
32
+ """Direct the Agent Canvas frontend to perform a UI action."""
33
+
34
+ command: CanvasCommand = Field(description="UI command to dispatch.")
35
+ path: str | None = Field(
36
+ default=None,
37
+ description=(
38
+ "Workspace-relative file path. Required for navigate_to_file and "
39
+ "show_preview; ignored otherwise."
40
+ ),
41
+ )
42
+ tab: CanvasTab | None = Field(
43
+ default=None,
44
+ description=(
45
+ "Tab to open. Required for open_tab; ignored otherwise. One of "
46
+ "files, browser, vscode, terminal, planner, tasklist."
47
+ ),
48
+ )
49
+
50
+
51
+ class CanvasUIObservation(Observation):
52
+ """Acknowledgment that the UI command was dispatched to the frontend."""
53
+
54
+
55
+ class CanvasUIExecutor(ToolExecutor[CanvasUIAction, CanvasUIObservation]):
56
+ def __call__(
57
+ self,
58
+ action: CanvasUIAction,
59
+ conversation=None, # noqa: ARG002
60
+ ) -> CanvasUIObservation:
61
+ return CanvasUIObservation.from_text(
62
+ f"UI command '{action.command}' dispatched to the Agent Canvas frontend."
63
+ )
64
+
65
+
66
+ _CANVAS_UI_DESCRIPTION = """The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
67
+
68
+ They will NOT see the files you wrote, the terminal output, or the browser
69
+ unless you call this tool to switch the right-side panel to the relevant
70
+ tab. Call this every time you finish work that produces something the user
71
+ should look at — don't rely on them noticing on their own.
72
+
73
+ When to call (pick the most specific option that matches your last action):
74
+
75
+ * You wrote or modified a single file (ANY language, ANY size — including
76
+ small scripts like a hello-world bash file) →
77
+ command="navigate_to_file", path=<workspace-relative path of that file>
78
+
79
+ * You generated an HTML page, image, SVG, PDF, markdown report, or other
80
+ previewable artifact →
81
+ command="show_preview", path=<that file>
82
+
83
+ * You finished editing multiple files in one logical step →
84
+ command="open_tab", tab="files"
85
+ (The Files tab automatically renders a diff view when the workspace has
86
+ uncommitted git changes, which covers the "highlight changes" case.)
87
+
88
+ * You ran a long-running terminal command, or one whose output the user
89
+ should inspect →
90
+ command="open_tab", tab="terminal"
91
+
92
+ * You browsed to a URL the user should see →
93
+ command="open_tab", tab="browser"
94
+
95
+ Call this BEFORE writing your chat-message summary of the change, so the
96
+ artifact is visible while the user reads what you did. One canvas_ui call
97
+ per logical step is enough — don't repeat it for the same file or tab in
98
+ the same turn."""
99
+
100
+
101
+ class CanvasUITool(ToolDefinition[CanvasUIAction, CanvasUIObservation]):
102
+ """Tool for controlling the Agent Canvas UI from the agent."""
103
+
104
+ @classmethod
105
+ def create(
106
+ cls,
107
+ conv_state=None, # noqa: ARG003
108
+ **params, # noqa: ARG003
109
+ ) -> Sequence["CanvasUITool"]:
110
+ return [
111
+ cls(
112
+ description=_CANVAS_UI_DESCRIPTION,
113
+ action_type=CanvasUIAction,
114
+ observation_type=CanvasUIObservation,
115
+ executor=CanvasUIExecutor(),
116
+ annotations=ToolAnnotations(
117
+ readOnlyHint=True,
118
+ destructiveHint=False,
119
+ idempotentHint=True,
120
+ openWorldHint=False,
121
+ ),
122
+ )
123
+ ]
124
+
125
+
126
+ # Auto-register at import time. The agent-server imports this module via
127
+ # tool_module_qualnames; this call wires the tool into the registry so it can
128
+ # be referenced by name in conversation tool lists.
129
+ register_tool("canvas_ui", CanvasUITool)
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BFRubm34.js";import{o as t}from"./declaration-C9nuq2Dj.js";import{n}from"./backend-form-modal-KudhWUX8.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./conversation-DWcvnmds.js";export{e as default};
@@ -1,19 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-CbJ4s7Ik.js","assets/rolldown-runtime-BFRubm34.js","assets/vendor~files-tab-DtLR-QD9.js","assets/iconBase-C7N9pPOs.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js","assets/agent-server-client-options-8OJSXbm8.js","assets/agent-server-conversation-service.api-BdEre_71.js","assets/preload-helper-CT1Z6Pdu.js","assets/profiles-client-D4twHRVf.js","assets/agent-server-compatibility-DvKtnXHw.js","assets/server-client-CG1zHqph.js","assets/settings-service.api-Z6x0l0GU.js","assets/settings-client-CkXDJwIY.js","assets/proxy-BMZyC45G.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~pfbaerbd-zhv9fooy.js","assets/settings-D5am1n6X.js","assets/acp-providers-SCPK1BIU.js","assets/declaration-C9nuq2Dj.js","assets/common-SMkEaBSr.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~b4cctr4k-B7YVdv1X.js","assets/QueryClientProvider-DITRCGAK.js","assets/useTranslation-01pF7z10.js","assets/context-CEQZwATj.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BP1SKG0F.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CofhIDpd.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BbFOrAjI.js","assets/objectWithoutPropertiesLoose-Du6eBn-V.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B92czPCF.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BW6261Sb.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DpAdkv8m.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-By5W2oHN.js","assets/react-Do0CT17Y.js","assets/conversation-tab-empty-state-BtFDbyTe.js","assets/utils-Czcl6buL.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i9dbt75i-CI82Did1.js","assets/markdown-renderer-wZnLDbA1.js","assets/checkmark-BcvXE9bf.js","assets/copy-BxgbrjDT.js","assets/active-backend-context-CkP3ZEJs.js","assets/health-store-BDC2rM-X.js","assets/use-active-conversation-Bu5J9iLy.js","assets/conversation-service.api-YTGTw0pz.js","assets/use-user-conversation-BCYpbPT1.js","assets/use-conversation-id-BOaaZahn.js","assets/navigation-context-BFjstyH6.js","assets/use-agent-state-DN9Nc5pP.js","assets/conversation-state-store-Bc0slAjL.js","assets/use-runtime-is-ready-BQWLEyqa.js","assets/status-DDL-ipIP.js","assets/chevron-left-small-BqSkXTeq.js","assets/link-external-CvxB0BmI.js","assets/folder-CerIk8uG.js","assets/files-tab-store-CDyVTXNT.js","assets/use-event-store-CQZCcVz-.js","assets/typography-BbaUAC4V.js","assets/dist-DZHSA2e6.js","assets/conversation-local-storage-UYl-SX-r.js","assets/git-status-mapper-BI8FyUVp.js","assets/retrieve-axios-error-message-BY-yIkIq.js","assets/browser-tab-DTM6RyoV.js","assets/vendor~browser-tab-BiVxfjJo.js","assets/browser-store-C3AqxAO7.js","assets/vscode-tab-BVhQR2rt.js","assets/use-unified-vscode-url-C5iI-Z5A.js","assets/vscode-url-helper-jesbpos5.js","assets/waiting-for-runtime-message-JotSOBdC.js","assets/brand-button-8fVVei4i.js","assets/planner-tab-yubfN-6U.js","assets/plan-components-gOm-daR3.js","assets/use-handle-plan-click-CgrCGmT1.js","assets/custom-toast-handlers-BYxhSr3t.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/i18n-DkYgs32x.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js","assets/use-create-conversation-BWFA_FId.js","assets/useMutation-CRJwk4cR.js","assets/mutation-Cz7N4XAo.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-iOsylxCS.js","assets/use-settings-DzG0C3vO.js","assets/query-keys-tAsQcc_9.js","assets/conversation-store-Z5iMCRpc.js","assets/middleware-BC9EwbB9.js","assets/lesson-plan-CmkRbe6Z.js","assets/task-list-tab-B45ktzHM.js","assets/use-task-list-Bs90uF2N.js","assets/u-check-circle-half-BPcWtWwv.js","assets/u-check-circle-DHGiAi-w.js","assets/terminal-D5pzR9Ru.js","assets/vendor~terminal-BUxzHKcC.js","assets/vendor~terminal-T4IDBjWs.css","assets/command-store-DFN_17p1.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,L as i,M as a,k as o}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as s}from"./react-dom-hVBnwgwZ.js";import{t as c}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{c as l,i as u,r as d,s as f}from"./path-utils-D1ZtqFC7.js";import{t as p}from"./useMutation-CRJwk4cR.js";import{o as m,t as h}from"./declaration-C9nuq2Dj.js";import{n as g}from"./QueryClientProvider-DITRCGAK.js";import{t as _}from"./Trans-D43bd3yR.js";import{t as v}from"./useTranslation-01pF7z10.js";import{a as y,c as b,d as x,i as S,l as C,n as w,o as T,r as E,s as D,t as O,u as k}from"./messages-v-q35ObG.js";import{c as A,d as j,f as M,i as N,l as ee,n as te,r as P,s as F,t as ne,u as re}from"./sidebar-mobile-menu-toggle-DXplko7u.js";import{a as I,n as L,o as ie,r as ae,t as oe}from"./custom-toast-handlers-BYxhSr3t.js";import{n as se,r as R,t as ce}from"./vendor~conversation-panel~conversation-CbjvWBSu.js";import{a as le,c as ue,d as z,f as de,l as fe,m as B,n as pe,o as V,s as me,t as he,u as ge}from"./conversation-websocket-context-DulnrIHh.js";import{t as _e}from"./x-JOBEVLW0.js";import{_ as H,b as ve,c as ye,d as be,k as xe,l as Se,m as Ce,o as we,t as U,u as Te,v as Ee,y as De}from"./utils-Czcl6buL.js";import{S as Oe,r as ke}from"./agent-server-client-options-8OJSXbm8.js";import{n as W}from"./active-backend-context-CkP3ZEJs.js";import{n as Ae}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js";import{a as je,i as Me,o as Ne,t as Pe}from"./agent-server-conversation-service.api-BdEre_71.js";import{t as Fe}from"./modal-backdrop-B04pVYAD.js";import{n as Ie}from"./modal-body-CgUoFQA1.js";import{r as Le}from"./base-modal-B4HvlFHE.js";import{d as Re,t as ze}from"./brand-button-8fVVei4i.js";import{t as Be}from"./loading-spinner-91b5FiMQ.js";import{n as Ve}from"./navigation-context-BFjstyH6.js";import{h as He}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CuGq_cxH.js";import{O as Ue}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-CFpDeb9o.js";import{t as We}from"./styled-tooltip-Awq4HMw3.js";import{_ as Ge,h as Ke,m as qe,n as Je,p as Ye,s as Xe}from"./git-provider-icon-D8RE4unY.js";import{t as Ze}from"./react-Do0CT17Y.js";import{n as Qe}from"./middleware-BC9EwbB9.js";import{i as $e,s as et}from"./conversation-local-storage-UYl-SX-r.js";import{t as G}from"./conversation-store-Z5iMCRpc.js";import{t as tt}from"./modal-close-button-SM_WXzDY.js";import{t as nt}from"./common-SMkEaBSr.js";import{t as rt}from"./use-is-authed-BFoh8Ogh.js";import{t as it}from"./use-click-outside-element-835W9pC6.js";import{i as at,n as ot,r as st}from"./status-DDL-ipIP.js";import{r as ct}from"./use-settings-DzG0C3vO.js";import{n as lt,t as ut}from"./use-create-conversation-BWFA_FId.js";import{r as dt}from"./conversation-service.api-YTGTw0pz.js";import{i as ft}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DrXgiSCq.js";import{n as pt,t as K}from"./context-menu-list-item-DzjPB8aC.js";import{i as q,r as mt,t as ht}from"./ellipsis-button-BoU2-xlG.js";import{t as gt}from"./u-edit-BPFJBd34.js";import{t as _t}from"./skills-BN8atjgW.js";import{t as vt}from"./terminal-DGuR4559.js";import{t as yt}from"./use-user-conversation-BCYpbPT1.js";import{t as bt}from"./conversation-state-store-Bc0slAjL.js";import{C as xt,D as St,E as Ct,I as wt,M as Tt,O as Et,P as Dt,S as Ot,T as kt,_ as At,a as jt,b as Mt,d as Nt,f as Pt,g as Ft,h as It,i as Lt,j as Rt,k as zt,m as Bt,n as Vt,p as Ht,r as Ut,t as Wt,v as Gt,w as Kt,x as qt,y as Jt}from"./git-control-bar-branch-button-Bm6rzSpo.js";import{n as Yt,t as J}from"./use-conversation-id-BOaaZahn.js";import{t as Y}from"./use-active-conversation-Bu5J9iLy.js";import{t as X}from"./use-agent-state-DN9Nc5pP.js";import{S as Xt,a as Zt,d as Qt,o as $t,t as Z}from"./use-event-store-CQZCcVz-.js";import{t as en}from"./command-store-DFN_17p1.js";import{r as tn}from"./typography-BbaUAC4V.js";import{t as nn}from"./lesson-plan-CmkRbe6Z.js";import{t as rn}from"./copy-BxgbrjDT.js";import{t as an}from"./use-runtime-is-ready-BQWLEyqa.js";import{r as on}from"./plan-components-gOm-daR3.js";import{t as sn}from"./use-breakpoint-B86yKT9n.js";import{n as cn,t as ln}from"./use-unified-vscode-url-C5iI-Z5A.js";import{t as un}from"./use-task-list-Bs90uF2N.js";import{t as dn}from"./vendor~conversation-panel~conversation~alert-banner-Df7_G0zR.js";var Q=e(t(),1),fn={curAgentState:H.LOADING},pn=Ze(e=>({...fn,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(fn)})),mn=`openhands-last-conversation-by-backend`;function hn(e,t){return t?`${e}::${t}`:e}function gn(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(mn);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function _n(e){if(!(typeof window>`u`))try{window.localStorage.setItem(mn,JSON.stringify(e))}catch{}}function vn(e,t,n){if(!n)return;let r=gn();r[hn(e,t)]=n,_n(r)}function yn(e,t){let n=gn(),r=hn(e,t);r in n&&(delete n[r],_n(n))}var bn=e=>({action:x.CHANGE_AGENT_STATE,args:{agent_state:e}}),xn=e=>`error`in e,Sn=e=>`type`in e&&e.type===`error`,Cn=()=>{let{send:e}=k(),t=Z(e=>e.events);Q.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!($t(n)&&Zt(n))){if(xn(n)){if(n.error_code===401){L(`Session expired.`);return}typeof n.error==`string`?L(n.error):L(n.message);return}Sn(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(bn(H.PAUSED))}},[t.length])},wn=()=>{let{curAgentState:e}=X();return{runtimeActive:!Ee.includes(e)}};function Tn({children:e}){return Cn(),wn(),e}var $=m(),En=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,$.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Dn={entriesByConversation:{}},On=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),kn=Ze()(Qe(e=>({...Dn,addPending:(t,n)=>{let r=Ne();return e(e=>On(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>On(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>On(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>On(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`}));function An({onClick:e}){let{t}=v(`openhands`);return(0,$.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,$.jsx)(En,{className:`w-3.5 h-3.5 fill-success`}),(0,$.jsx)(`span`,{children:t(h.CHAT_INTERFACE$BTW_GOT_IT)})]})}function jn({conversationId:e}){let{t}=v(`openhands`),n=kn(e=>e.entriesByConversation),r=kn(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,$.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,$.jsx)(b,{title:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`opacity-60`,children:t(h.CHAT_INTERFACE$BTW_PREFIX)}),(0,$.jsx)(`span`,{children:n.question}),i&&(0,$.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-[var(--oh-border-input)] border-t-transparent animate-spin`})]}),details:i?t(h.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,$.jsx)(An,{onClick:()=>r(e,n.id)})},n.id)})})}var Mn=`${ve} `,Nn=(e,t)=>{let n=kn(e=>e.addPending),r=kn(e=>e.resolve),i=kn(e=>e.fail);return(0,Q.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(Mn);if(!e||!s){t(a);return}let c=o.slice(ve.length).trim();if(!c)return;let l=n(e,c);d(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])};function Pn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=v(`openhands`),{trackPullButtonClick:a}=lt(),o=n&&t&&r;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(ye())},disabled:!o,className:U(`flex flex-row gap-1 items-center justify-center px-0.5 py-1 rounded-[100px] w-[76px] min-w-[76px]`,o?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer`:`bg-[rgba(71,74,84,0.50)] cursor-not-allowed`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(xt,{width:12,height:12,color:`white`})}),(0,$.jsx)(`div`,{className:`font-normal text-white text-sm leading-5 max-w-[76px] truncate`,title:i(h.COMMON$PULL),children:i(h.COMMON$PULL)})]})}function Fn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=v(`openhands`),{trackPushButtonClick:o}=lt(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(Se(r))},disabled:!s,className:U(`flex flex-row gap-1 items-center justify-center px-2 py-1 rounded-[100px] w-[77px] min-w-[77px]`,s?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer`:`bg-[rgba(71,74,84,0.50)] cursor-not-allowed`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(Kt,{width:12,height:12,color:`white`})}),(0,$.jsx)(`div`,{className:`font-normal text-white text-sm leading-5 max-w-[77px] truncate`,title:a(h.COMMON$PUSH),children:a(h.COMMON$PUSH)})]})}function In({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=v(`openhands`),{trackCreatePrButtonClick:o}=lt(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(we(r))},disabled:!s,className:U(`flex flex-row gap-1 items-center justify-center px-2 py-1 rounded-[100px] w-[126px] min-w-[126px] h-7`,s?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer`:`bg-[rgba(71,74,84,0.50)] cursor-not-allowed`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(Ot,{width:12,height:12,color:`white`})}),(0,$.jsx)(`div`,{className:`font-normal text-white text-sm leading-5 max-w-[126px] truncate`,title:a(h.COMMON$PULL_REQUEST),children:a(h.COMMON$PULL_REQUEST)})]})}function Ln(e){return e.kind===`BashCommand`}function Rn(e){return e.kind===`BashOutput`}function zn(e){return e.kind===`BashError`}function Bn(e,t,n){let r=(0,Q.useRef)(null),i=(0,Q.useRef)([]),a=(0,Q.useRef)([]),o=(0,Q.useRef)(new Map);return(0,Q.useEffect)(()=>{if(!n)return;let s=ke(e,t),c=new WebSocket(s);r.current=c,c.onopen=()=>{for(let{command:e,cwd:t,timeout:n,resolve:r,reject:o}of i.current)a.current.push({resolve:r,reject:o}),c.send(JSON.stringify({command:e,cwd:t,timeout:n}));i.current=[]},c.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Ln(t)){let e=a.current.shift();e&&o.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Rn(t)&&t.command_id){let e=o.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(o.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else zn(t)&&l(`Bash error: ${t.code}: ${t.detail}`)};function l(e){let t=Error(e);for(let{reject:e}of i.current)e(t);i.current=[];for(let e of a.current)e.reject(t);a.current=[];for(let e of o.current.values())e.reject(t);o.current.clear()}return c.onclose=()=>{r.current=null,l(`Bash WebSocket closed`)},c.onerror=()=>{r.current=null,l(`Bash WebSocket error`)},()=>{c.onclose=null,c.onerror=null,c.close(),r.current=null,l(`Bash WebSocket unmounted`)}},[n,e,t]),(0,Q.useCallback)((e,t,n)=>new Promise((o,s)=>{let c=r.current;if(!c||c.readyState===WebSocket.CLOSED||c.readyState===WebSocket.CLOSING){s(Error(`Bash WebSocket not available`));return}c.readyState===WebSocket.CONNECTING?i.current.push({command:e,cwd:t,timeout:n,resolve:o,reject:s}):(a.current.push({resolve:o,reject:s}),c.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Vn={"github.com":`github`,"gitlab.com":`gitlab`,"bitbucket.org":`bitbucket`,"dev.azure.com":`azure_devops`};function Hn(e){return e.replace(/\.git$/,``)}function Un(e){return e?Vn[e.toLowerCase()]??null:null}function Wn(e){let t=e.split(`/`).filter(Boolean),n=t.indexOf(`_git`);return n===-1?t.join(`/`):[...t.slice(0,n),...t.slice(n+1)].join(`/`)}function Gn(e,t,n){let r=Hn(n.replace(/^\/+/,``)),i=Un(t);return{url:e,host:t,repository:(i===`azure_devops`?Wn(r):r)||null,provider:i}}function Kn(e){let t=e?.trim();if(!t)return null;let n=t.match(/^[^@\s]+@([^:\s]+):(.+)$/);if(n){let e=n[1];return Gn(t,e,n[2])}try{let e=new URL(t);return Gn(t,e.hostname||null,e.pathname)}catch{return null}}var qn={repository:null,branch:null,provider:null,remoteUrl:null},Jn=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
3
- `);async function Yn(e,t){let n=await e(Jn,t,10);if(n.exit_code!==0)return qn;let r=n.stdout.indexOf(`
4
- `),i=(r>=0?n.stdout.slice(0,r):n.stdout).trim(),a=(r>=0?n.stdout.slice(r+1):``).trim(),o=a&&a!==`HEAD`?a:null;if(!i&&!o)return qn;let s=Kn(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var Xn=()=>{let{data:e}=Y(),t=an(),{backend:n}=W(),r=n.kind===`local`,i=e?.id,a=e?.conversation_url,o=e?.session_api_key,s=e?.workspace?.working_dir?.trim()||Oe(),l=!!e?.selected_repository,u=!!e?.git_provider,d=!!e?.selected_branch,f=r&&t&&!!i&&(!l||!u||!d),p=Bn(a,o,f),m=(0,Q.useRef)(p);return m.current=p,c({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>Yn((e,t,n)=>m.current(e,t,n),s),enabled:f,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},Zn=()=>{let e=g(),{t}=v(`openhands`);return p({mutationFn:e=>Pe.updateConversationRepository(e.conversationId,e.repository,e.branch,e.gitProvider),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n});let r=e.getQueriesData({queryKey:n});return e.setQueriesData({queryKey:n},e=>e&&{...e,selected_repository:t.repository,selected_branch:t.branch??null,git_provider:t.gitProvider??null}),{previousEntries:r}},onError:(n,r,i)=>{i?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),L(t(h.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{ae(t(h.CONVERSATION$REPOSITORY_UPDATED))},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`local-git-info`,r.conversationId]})}})};function Qn({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,$.jsx)(We,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,$.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function $n({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=v(`openhands`),{providers:a}=Xe(),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{a.length===1&&!o?s(a[0]):a.length>1&&!o&&r&&a.includes(r)&&s(r)},[a,o,r]);let f=(0,Q.useCallback)(e=>{e!==o&&(s(e),l(null),d(null))},[o]),p=(0,Q.useCallback)(e=>{e?(l(e),d(null)):(l(null),d(null))},[]),m=(0,Q.useCallback)(e=>{d(e)},[]),g=()=>{!c||!u||(n(c,u),l(null),d(null),t())},_=()=>{s(null),l(null),d(null),t()};if(!e)return null;let y=c?.git_provider||o||r,b=!!c&&!!u;return(0,$.jsx)(Fe,{onClose:_,children:(0,$.jsxs)(Ie,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,$.jsx)(tt,{onClose:_,testId:`close-open-repository-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(Le,{title:i(h.CONVERSATION$OPEN_REPOSITORY)})}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(h.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,$.jsx)(jt,{providers:a,value:o,placeholder:`Select Provider`,onChange:f})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,$.jsx)(Ut,{provider:y,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,placeholder:`Search repositories...`,className:`w-full`}),(0,$.jsx)(Lt,{repository:c?.full_name||null,provider:y,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,placeholder:`Select branch...`,disabled:!c,className:`w-full`})]})]}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,$.jsx)(ze,{type:`button`,variant:`secondary`,onClick:_,children:i(h.BUTTON$CANCEL)}),(0,$.jsx)(ze,{type:`button`,variant:`primary`,onClick:g,isDisabled:!b,children:i(h.BUTTON$LAUNCH)})]})]})})}function er({onSuggestionsClick:e}){let{t}=v(`openhands`),{conversationId:n}=J(),[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),{addRecentRepository:c}=Je(),l=z(e=>e.enqueuePendingMessage),u=z(e=>e.markPendingMessageError),{backend:d}=W(),f=d.kind===`local`,{providers:p}=Xe(),m=f||p.length>0,{data:g}=Y(),{repositoryInfo:_}=Et(),{data:y}=Xn(),b=Dt(),x=(0,Q.useRef)(b);(0,Q.useEffect)(()=>{x.current=b},[b]);let{send:S}=k(),C=(0,Q.useRef)(S);(0,Q.useEffect)(()=>{C.current=S},[S]);let{mutate:w}=Zn(),{mutate:T,isPending:E}=ut(),D=g?.selected_repository||_?.selectedRepository,O=g?.git_provider||_?.gitProvider,A=g?.selected_branch||_?.selectedBranch,j=D||y?.repository||void 0,M=O||y?.provider,N=A||y?.branch||void 0,ee=(g?.id?je(g.id):null)?.selected_workspace??null,te=ee&&ee.replace(/\/+$/,``).split(`/`).pop()||null,P=!!j&&!!M,F=!!g&&b===`OPEN`;(0,Q.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,Q.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let ne=(e,r)=>{n&&(c(e),w({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(x.current!==`OPEN`){L(t(h.CONVERSATION$CLONE_COMMAND_FAILED_DISCONNECTED));return}let i=e.git_provider.charAt(0).toUpperCase()+e.git_provider.slice(1),a=`Clone ${e.full_name} from ${i} and checkout branch ${r.name}.`,o=n?l({conversationId:n,text:a}):null;Promise.resolve(C.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:`Failed to send message`)})}}))},re=!f||!!j||!!te,I=f&&!P;return re||N||P?(0,$.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,$.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[re?(0,$.jsx)(Vt,{selectedRepository:j,gitProvider:M,workspaceName:te,onClick:()=>i(!0),disabled:!F||I}):null,N?(0,$.jsx)(Wt,{selectedBranch:N,selectedRepository:j,gitProvider:M}):null,P?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Qn,{tooltipMessage:t(h.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(Pn,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,isConversationReady:F})}),(0,$.jsx)(Qn,{tooltipMessage:t(h.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(Fn,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,currentGitProvider:M,isConversationReady:F})}),(0,$.jsx)(Qn,{tooltipMessage:t(h.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!P,children:(0,$.jsx)(In,{onSuggestionsClick:e,hasRepository:P,providerTokensReady:m,currentGitProvider:M,isConversationReady:F})})]}):null]}),(0,$.jsx)($n,{isOpen:r,onClose:()=>i(!1),onLaunch:ne,defaultProvider:M})]}):null}function tr({onSubmit:e,disabled:t=!1}){let{images:n,files:r,imagesMarkedUploadAsFile:i,clearAllFiles:a,subConversationTaskId:o}=G(),{curAgentState:s}=X(),{data:c}=Y(),{conversationId:l}=Yt(),u=l??c?.id??null,{taskStatus:d}=St(o,c?.id||null),{handleUpload:f}=Nt(),p=Pt(u,Nn(u,t=>{let{imagesToEmbed:o,imagesAsFiles:s}=wt(n,i);e(t,o,[...r,...s]),a()}));return(0,$.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,$.jsx)(Ht,{disabled:t||s===H.AWAITING_USER_CONFIRMATION||Ce(d),isNewConversationPending:t,onSubmit:p,onFilesPaste:f}),(0,$.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,$.jsx)(er,{onSuggestionsClick:e=>{p(e)}})})]})}function nr(){let e=Z(e=>e.events),t=Z(e=>e.uiEvents),n=Q.useMemo(()=>t.filter(V),[t]),r=Q.useMemo(()=>e,[e]),i=Q.useMemo(()=>n.length,[n]),a=Q.useMemo(()=>r.some(e=>e.source===`agent`&&!Xt(e)&&!Qt(e)),[r]),o=le(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var rr=e=>`timestamp`in e?e.timestamp:void 0,ir=e=>{let t=!!e&&$e(e),n=t?void 0:e,{data:r}=yt(e??null),{data:i,isFetched:a}=me(n??void 0),o=Z(e=>e.addEvents),[s,c]=Q.useState(!1),[l,u]=Q.useState(!0),d=Q.useRef(!1),f=Q.useRef(!0);return Q.useEffect(()=>{if(d.current=!1,c(!1),t){f.current=!1,u(!1);return}f.current=!0,u(!0)},[e,t]),Q.useEffect(()=>{t||!a||!i||i.hasMore||(f.current=!1,u(!1))},[t,a,i?.hasMore,n]),{isLoading:s,hasMore:l,loadOlder:Q.useCallback(async()=>{if(!e||$e(e)||d.current||!f.current||!r)return;let{events:t}=Z.getState(),n=t[0];if(!n)return;let i=rr(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await fe.searchEvents(e,r?.conversation_url??null,r?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`,timestampLt:i});if(!Array.isArray(t.items))throw Error(`Invalid older-events response: expected page.items to be an array.`);let n=[...t.items].reverse();n.length>0&&o(n),(!t.next_page_id||t.items.length<50)&&(f.current=!1,u(!1))}finally{d.current=!1,c(!1)}},[e,r,r?.conversation_url,r?.session_api_key,o])}};function ar(){return(0,$.jsxs)(`div`,{className:`flex items-center space-x-1.5 rounded-full bg-[var(--oh-surface)] px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:0ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:75ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:150ms]`})]})}function or({suggestion:e,onClick:t}){let{t:n}=v(`openhands`);return(0,$.jsxs)(`button`,{type:`button`,className:`list-none border border-[var(--oh-border)] rounded-[15px] hover:bg-surface-raised hover:border-[var(--oh-interactive-hover)] transition-colors flex-1 flex items-center justify-center cursor-pointer gap-[10px] h-[55px] px-4`,onClick:()=>t(e.value),children:[(0,Q.useMemo)(()=>{switch(e.label){case`INCREASE_TEST_COVERAGE`:return(0,$.jsx)(qt,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,$.jsx)(Mt,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,$.jsx)(Jt,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,$.jsx)(Gt,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,$.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function sr({suggestions:e,onSuggestionClick:t}){return(0,$.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,$.jsx)(or,{suggestion:e,onClick:t},n))})}var cr=h.SUGGESTIONS$HACKER_NEWS,lr=`Please write a bash script which displays the top story on Hacker News. It should show the title, the link, and the number of points.
5
- The script should only use tools that are widely available on unix systems, like curl and grep.`,ur=h.SUGGESTIONS$HELLO_WORLD,dr=`I want to create a Hello World app in Javascript that:
6
- * Displays Hello World in the middle.
7
- * Has a button that when clicked, changes the greeting with a bouncing animation to fun versions of Hello.
8
- * Has a counter for how many times the button has been clicked.
9
- * Has another button that changes the app's background color.`,fr=h.SUGGESTIONS$TODO_APP,pr=`I want to create a VueJS app that allows me to:
10
- * See all the items on my todo list
11
- * add a new item to the list
12
- * mark an item as done
13
- * totally remove an item from the list
14
- * change the text of an item
15
- * set a due date on the item
16
-
17
- This should be a client-only app with no backend. The list should persist in localStorage.`,mr={repo:At,"non-repo":{[cr]:lr,[ur]:dr,[fr]:pr}};function hr({onSuggestionsClick:e}){let{t}=v(`openhands`),{shouldHideSuggestions:n}=G();return(0,$.jsx)(Ue,{children:!n&&(0,$.jsxs)(ce.div,{"data-testid":`chat-suggestions`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:`easeInOut`},className:`pointer-events-auto absolute inset-x-4 bottom-[151px] top-0 flex flex-col items-center justify-center md:inset-x-8`,children:[(0,$.jsx)(`div`,{className:`flex flex-col items-center p-4 rounded-xl w-full`,children:(0,$.jsx)(`span`,{className:`pb-6 text-[32px] font-medium leading-5 text-white`,children:t(h.LANDING$TITLE)})}),(0,$.jsx)(sr,{suggestions:Object.entries(mr.repo).slice(0,4).map(([e,t])=>({label:e,value:t})),onSuggestionClick:e})]})})}var gr={files:[],initialPrompt:null,selectedRepository:null,selectedRepositoryProvider:null,replayJson:null},_r=Ze(e=>({...gr,addFile:t=>e(e=>({files:[...e.files,t]})),removeFile:t=>e(e=>({files:e.files.filter((e,n)=>n!==t)})),clearFiles:()=>e(()=>({files:[]})),setInitialPrompt:t=>e(()=>({initialPrompt:t})),clearInitialPrompt:()=>e(()=>({initialPrompt:null})),setSelectedRepository:t=>e(()=>({selectedRepository:t})),clearSelectedRepository:()=>e(()=>({selectedRepository:null})),setSelectedRepositoryProvider:t=>e(()=>({selectedRepositoryProvider:t})),setReplayJson:t=>e(()=>({replayJson:t})),reset:()=>e(()=>gr)})),vr=e=>(0,$.jsx)(`svg`,{width:12,height:17,viewBox:`0 0 12 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.5304 6.46978L10.4697 7.53044L6.75006 3.81077L6.75006 17.0001H5.25006L5.25006 3.81077L1.53039 7.53044L0.469727 6.46978L6.00006 0.939453L11.5304 6.46978Z`,fill:`currentColor`})});function yr({onClick:e}){return(0,$.jsx)(`button`,{type:`button`,onClick:e,"data-testid":`scroll-to-bottom`,className:`flex items-center justify-center size-8 rounded-full bg-[var(--oh-surface)] text-[var(--oh-muted)] hover:bg-tertiary hover:text-white rotate-180 cursor-pointer transition-colors`,children:(0,$.jsx)(vr,{width:15,height:15})})}var br=[{width:`w-[25%]`,height:`h-4`,align:`justify-end`},{width:`w-[60%]`,height:`h-4`,align:`justify-start`},{width:`w-[45%]`,height:`h-4`,align:`justify-start`},{width:`w-[65%]`,height:`h-20`,align:`justify-start`},{width:`w-[35%]`,height:`h-4`,align:`justify-end`},{width:`w-[50%]`,height:`h-4`,align:`justify-start`},{width:`w-[30%]`,height:`h-4`,align:`justify-end`},{width:`w-[75%]`,height:`h-4`,align:`justify-start`},{width:`w-[55%]`,height:`h-4`,align:`justify-start`}];function xr({width:e,height:t}){return(0,$.jsx)(`div`,{className:U(`rounded-md bg-foreground/5 animate-pulse`,e,t)})}function Sr(){return(0,$.jsx)(`div`,{className:`flex flex-col gap-6 p-4 w-full h-full overflow-hidden`,"data-testid":`chat-messages-skeleton`,"aria-label":`Loading conversation`,children:br.map((e,t)=>(0,$.jsx)(`div`,{className:U(`flex w-full`,e.align),children:(0,$.jsx)(xr,{width:e.width,height:e.height})},t))})}var Cr=220;function wr({message:e,onDismiss:t,onRetry:n}){let{t:r,i18n:i}=v(`openhands`),[a,o]=Q.useState(!1),[s,c]=Q.useState(!1),l=Q.useRef(null),u=i.exists(e,{ns:`openhands`}),d=u?String(r(e)):e,f=d.length>Cr,p=f&&!a;return Q.useLayoutEffect(()=>{let e=l.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){c(!1);return}c(e.getBoundingClientRect().height>t*1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[d,p,a,e]),(0,$.jsxs)(`div`,{className:U(`flex w-full gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,s?`items-start`:`items-center`),"data-testid":`error-message-banner`,children:[(0,$.jsx)(ie,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:xe},"data-testid":`error-message-banner-icon`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{ref:l,className:U(`whitespace-pre-wrap break-words text-sm text-[var(--oh-muted)]`,p&&`line-clamp-3`),"data-testid":`error-message-banner-content`,children:u?(0,$.jsx)(_,{ns:`openhands`,i18nKey:e}):e}),f&&(0,$.jsx)(`button`,{type:`button`,className:`mt-1 cursor-pointer text-xs font-normal text-[var(--oh-foreground)] underline`,onClick:()=>o(e=>!e),"data-testid":`error-message-banner-toggle`,children:r(a?h.COMMON$VIEW_LESS:h.COMMON$VIEW_MORE)})]}),(0,$.jsxs)(`div`,{className:U(`flex shrink-0 gap-1`,s?`self-start`:`items-center`),children:[n&&(0,$.jsx)(`button`,{type:`button`,onClick:n,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`error-message-banner-retry`,children:r(h.CHAT_INTERFACE$MESSAGE_RETRY)}),t&&(0,$.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":r(h.BUTTON$CLOSE),"data-testid":`error-message-banner-dismiss`,children:(0,$.jsx)(_e,{className:`h-4 w-4`,"aria-hidden":!0})})]})]})}function Tr(){let{conversationId:e}=Yt(),t=z(e=>e.pendingMessages),n=z(e=>e.markPendingMessageError),r=z(e=>e.markPendingMessageSending),{send:i}=k(),a=Q.useMemo(()=>e?t.filter(t=>zt(e,t.conversationId)):[],[t,e]),o=Q.useCallback(async e=>{let t=z.getState().pendingMessages.find(t=>t.id===e);if(t){r(e);try{await i(C(t.text,t.imageUrls,t.fileUrls,t.timestamp))}catch(t){n(e,t instanceof Error?t.message:`Failed to send message`)}}},[i,n,r]);return a.length===0?null:(0,$.jsx)($.Fragment,{children:a.map(e=>(0,$.jsx)(E,{type:`user`,message:e.text,pendingStatus:e.status,onRetry:e.status===`error`?()=>o(e.id):void 0,children:e.imageUrls.length>0&&(0,$.jsx)(w,{size:`small`,images:e.imageUrls})},e.id))})}var Er=()=>{let{data:e}=Y();return p({mutationKey:[`unified-upload-files`],mutationFn:async t=>{let{conversationId:n,files:r}=t;return dt(n,r,e)},meta:{disableToast:!0}})},Dr=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 3.25C9.92893 3.25 8.25 4.92893 8.25 7V10H7C6.44772 10 6 10.4477 6 11V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V11C18 10.4477 17.5523 10 17 10H15.75V7C15.75 4.92893 14.0711 3.25 12 3.25ZM14.25 10V7C14.25 5.75736 13.2426 4.75 12 4.75C10.7574 4.75 9.75 5.75736 9.75 7V10H14.25Z`,fill:`currentColor`})});function Or(){let{t:e}=v(`openhands`),{data:t}=ct();return t?.confirmation_mode?(0,$.jsx)(We,{closeDelay:100,content:e(h.COMMON$CONFIRMATION_MODE_ENABLED),tooltipClassName:`bg-white text-black hover:bg-transparent`,children:(0,$.jsx)(`div`,{className:`flex items-center justify-center w-[26px] h-[26px] rounded-lg bg-[var(--oh-surface)]`,children:(0,$.jsx)(Dr,{width:15,height:15})})}):null}var kr=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{d:`M15 12C15 12.7956 14.6839 13.5587 14.1213 14.1213C13.5587 14.6839 12.7956 15 12 15C11.2044 15 10.4413 14.6839 9.87868 14.1213C9.31607 13.5587 9 12.7956 9 12C9 11.2044 9.31607 10.4413 9.87868 9.87868C10.4413 9.31607 11.2044 9 12 9C12.7956 9 13.5587 9.31607 14.1213 9.87868C14.6839 10.4413 15 11.2044 15 12Z`,fill:`currentColor`})});function Ar({status:e,statusColor:t}){return(0,$.jsx)(`div`,{"data-testid":`chat-status-indicator`,className:He(`w-full max-w-full rounded-[100px] p-1 bg-[var(--oh-surface)] flex items-center gap-1`),children:(0,$.jsxs)(Ue,{mode:`wait`,children:[(0,$.jsx)(ce.span,{className:`flex-shrink-0 animate-[pulse_1.2s_ease-in-out_infinite]`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,$.jsx)(kr,{className:`w-4 h-4`,color:t})},`dot-${e}`),(0,$.jsx)(ce.span,{initial:{opacity:0,y:-2},animate:{opacity:1,y:0},exit:{opacity:0,y:2},transition:{duration:.3},className:`pr-1.5 font-normal text-[11px] leading-[16px] normal-case break-words whitespace-normal`,children:e},`text-${e}`)]})})}var jr=()=>{let e=g(),{navigate:t}=Ve(),{t:n}=v(`openhands`),{data:r}=Y();return p({mutationFn:async()=>{if(!r?.id)throw Error(`No active conversation`);let e=await Pe.createConversation(void 0,void 0,void 0,void 0,void 0,void 0,void 0,r.sandbox_id??void 0);if(e.status===`ERROR`)throw Error(e.detail||`Failed to create new conversation`);return{newConversationId:e.app_conversation_id?e.app_conversation_id:`task-${e.id}`,oldConversationId:r.id}},onMutate:()=>{I.loading(n(h.CONVERSATION$CLEARING),{...oe,id:`clear-conversation`})},onSuccess:r=>{I.dismiss(`clear-conversation`),ae(n(h.CONVERSATION$CLEAR_SUCCESS)),t(`/conversations/${r.newConversationId}`),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]})},onError:e=>{I.dismiss(`clear-conversation`);let t=n(h.CONVERSATION$CLEAR_UNKNOWN_ERROR);e instanceof Error?t=e.message:typeof e==`string`&&(t=e),L(n(h.CONVERSATION$CLEAR_FAILED,{error:t}))}})};function Mr(e,t){return e?`github`:t?`replay`:`direct`}function Nr(){let e=Ae(),{setMessageToSend:t}=G(),{errorMessage:n,removeErrorMessage:r,setErrorMessage:i}=de(),{isTask:a,taskStatus:o,taskDetail:s}=Et(),c=a,l=pe(),{send:u}=k(),{renderableEvents:d,allConversationEvents:f,totalEvents:p,hasSubstantiveAgentActions:m,userEventsExist:g}=nr(),_=z(e=>e.enqueuePendingMessage),b=z(e=>e.markPendingMessageError),x=z(e=>e.pendingMessages),{t:S}=v(`openhands`),w=Q.useRef(null),{scrollDomToBottom:E,onChatBodyScroll:A,hitBottom:j,autoScroll:M,setAutoScroll:N,setHitBottom:ee}=on(w),{mutate:te,isPending:P}=jr(),{curAgentState:F}=X(),{handleBuildPlanClick:ne}=y(),{data:re}=Y(),I=re?.sandbox_status??null,ie=I===`MISSING`||I===`ERROR`,ae=F===H.RUNNING||F===H.LOADING;Q.useEffect(()=>{if(ae)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),ne(e),E())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[ae,ne,E]);let{selectedRepository:oe,replayJson:se}=_r(),{conversationId:R}=Yt(),{mutateAsync:ce}=Er(),{isLoading:le,hasMore:ue,loadOlder:fe}=ir(R),B=Q.useRef(null),V=Q.useCallback(e=>{if(c||le||!ue)return;let t=e.scrollTop<=80,n=e.scrollHeight<=e.clientHeight+80;!t&&!n||(B.current={scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},fe().catch(e=>{B.current=null,i(e instanceof Error&&e.message?e.message:S(h.ERROR$GENERIC))}))},[ue,le,c,fe,i,S]),me=Q.useCallback(e=>{e.deltaY<0&&e.currentTarget.scrollTop<=0&&V(e.currentTarget)},[V]),he=Q.useMemo(()=>R?x.some(e=>zt(R,e.conversationId)):!1,[x,R]),_e=f.length>0||he||!l?.isLoadingHistory,ve=!!R,ye=!_e&&!a,xe=ge(e=>R?(e.entriesByConversation[R]?.length??0)>0:!1),Se=async(n,r,i)=>{if(n.trim()===`/new`){if(!R){L(S(h.CONVERSATION$CLEAR_NO_ID));return}if(p===0){L(S(h.CONVERSATION$CLEAR_EMPTY));return}if(P)return;te();return}let a=[...r],o=[...i];p===0?e.capture(`initial_query_submitted`,{entry_point:Mr(oe!==null,se!==null),query_character_length:n.length,replay_json_size:se?.length}):e.capture(`user_message_sent`,{session_message_count:p,current_message_length:n.length});let s=Rt([...a,...o]);if(!s.isValid){L(`Error: ${s.errorMessage}`);return}let c=a.map(e=>Tt(e)),l=await Promise.all(c),d=new Date().toISOString(),{skipped_files:f,uploaded_files:m}=o.length>0?await ce({conversationId:R,files:o}):{skipped_files:[],uploaded_files:[]};f.forEach(e=>L(e.reason));let g=`${S(`CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE`)}: ${m.join(`
18
-
19
- `)}`,v=m.length>0?`${n}\n\n${g}`:n,y=_({conversationId:R,text:n,content:v,imageUrls:l,fileUrls:m,timestamp:d});t(``);try{await u(C(v,l,m,d))}catch(e){b(y,e instanceof Error?e.message:`Failed to send message`)}};Q.useEffect(()=>{if(B.current&&w.current){let{scrollHeight:e,scrollTop:t}=B.current,n=w.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),B.current=null;return}M&&E()},[d.length,he,E]);let Ce=Q.useRef(V);Q.useEffect(()=>{Ce.current=V}),Q.useEffect(()=>{let e=w.current;e&&Ce.current(e)},[d.length,ue]);let we={scrollRef:w,autoScroll:M,setAutoScroll:N,scrollDomToBottom:E,hitBottom:j,setHitBottom:ee,onChatBodyScroll:A},U=F===H.LOADING||F===H.INIT,Ee=F===H.STOPPED,De=F===H.PAUSED,Oe=Te({isPausing:De,isTask:a,taskStatus:o,isStartingStatus:U,isStopStatus:Ee,curAgentState:F}),ke=be({isPausing:De,isTask:a,taskStatus:o,taskDetail:s,isStartingStatus:U,isStopStatus:Ee,curAgentState:F,errorMessage:n,t:S});return(0,$.jsx)(T,{value:we,children:(0,$.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!m&&!he&&!g&&!xe&&!ye&&!c&&p===0&&!ie&&(0,$.jsx)(hr,{onSuggestionsClick:e=>t(e)}),(0,$.jsxs)(`div`,{ref:w,onScroll:e=>{A(e.currentTarget),V(e.currentTarget)},onWheel:me,className:`custom-scrollbar-always flex min-h-0 grow flex-col gap-2 overflow-x-hidden overflow-y-auto px-0 pt-4 pb-8 md:px-4`,children:[ye&&ve&&(0,$.jsx)(Sr,{}),ye&&!ve&&(0,$.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,$.jsx)(Be,{size:`small`})}),le&&(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,$.jsx)(Be,{size:`small`}),(0,$.jsx)(`span`,{children:S(h.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,$.jsx)(D,{conversationId:R,anchorEventId:null}),_e&&d.length>0&&(0,$.jsx)(O,{messages:d,allEvents:f}),(0,$.jsx)(Tr,{})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px]`,children:[(0,$.jsx)(jn,{conversationId:R}),n&&(0,$.jsx)(wr,{message:n,onDismiss:r,onRetry:n===`Unable to connect to server`?()=>l?.reconnect():void 0}),ie?(0,$.jsxs)(`div`,{"data-testid":`archived-conversation-banner`,className:`mx-1 px-4 py-3 rounded-lg bg-[var(--oh-surface)] border border-[var(--oh-border-subtle)]`,children:[(0,$.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:S(I===`ERROR`?h.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:h.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,$.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:S(I===`ERROR`?h.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:h.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,$.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,$.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,$.jsx)(Or,{}),U&&(0,$.jsx)(Ar,{statusColor:Oe,status:ke})]}),j?F===H.RUNNING&&(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(ar,{})}):(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(yr,{onClick:E})})]})}),(0,$.jsx)(tr,{onSubmit:Se,disabled:P})]})]})]})})}function Pr({isRightPanelShown:e}){return(0,$.jsx)(`div`,{className:`flex justify-center w-full h-full`,children:(0,$.jsx)(`div`,{className:`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0 transition-all duration-300 ease-in-out`,children:(0,$.jsx)(Nr,{})})})}function Fr({className:e}){let{t}=v(`openhands`);return(0,$.jsxs)(`div`,{className:U(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,$.jsx)(B,{className:`h-8 w-8 shrink-0 animate-spin text-[var(--oh-text-secondary)]`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`text-base font-normal leading-5 text-[var(--oh-text-secondary)]`,children:t(h.HOME$LOADING)})]})}function Ir({children:e}){return(0,$.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Lr({children:e}){return(0,$.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Rr({children:e}){return(0,$.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}var zr=(0,Q.lazy)(()=>n(()=>import(`./files-tab-CbJ4s7Ik.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60]))),Br=(0,Q.lazy)(()=>n(()=>import(`./browser-tab-DTM6RyoV.js`),__vite__mapDeps([61,1,18,23,24,4,62,3,34,35,36,45,46,63,33]))),Vr=(0,Q.lazy)(()=>n(()=>import(`./vscode-tab-BVhQR2rt.js`),__vite__mapDeps([64,1,18,23,24,4,65,7,8,5,6,9,10,11,12,13,14,15,16,17,19,20,21,22,43,40,41,42,44,45,46,49,35,36,47,48,33,50,66,67,34,68]))),Hr=(0,Q.lazy)(()=>n(()=>import(`./planner-tab-yubfN-6U.js`),__vite__mapDeps([69,1,18,23,24,4,34,35,36,37,29,27,28,30,31,25,3,26,32,38,39,70,68,71,72,73,74,75,76,7,8,5,6,9,10,11,12,13,14,15,16,17,19,77,21,78,22,79,80,81,20,40,41,82,42,43,44,45,46,83,84,33,58,85]))),Ur=(0,Q.lazy)(()=>n(()=>import(`./task-list-tab-B45ktzHM.js`),__vite__mapDeps([86,1,18,23,24,4,34,35,36,87,55,33,88,89,56,57]))),Wr=(0,Q.lazy)(()=>n(()=>import(`./terminal-D5pzR9Ru.js`),__vite__mapDeps([90,1,91,92,18,4,67,23,24,35,36,47,42,43,5,6,7,8,9,10,11,12,13,14,15,16,17,19,44,20,21,22,40,41,45,46,48,33,93]))),Gr={tasklist:{component:Ur},files:{component:zr},browser:{component:Br},vscode:{component:Vr},terminal:{component:Wr},planner:{component:Hr}};function Kr(){let{selectedTab:e,shouldShownAgentLoading:t}=G(),{conversationId:n}=J(),r=(0,Q.useMemo)(()=>Gr[e]??Gr.files,[e]).component;return t?(0,$.jsx)(Fr,{}):(0,$.jsx)(Lr,{children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(Fr,{}),children:(0,$.jsx)(Rr,{children:(0,$.jsx)(Ir,{children:(0,$.jsx)(r,{})},e===`terminal`?`${e}-${n}`:e)})})})}var qr=()=>{let e=g(),t=de(e=>e.removeErrorMessage);return p({mutationKey:[`start-conversation`],mutationFn:async e=>f(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{u(e,r.conversationId)},onSuccess:(n,r)=>{t(),l(e,r.conversationId,nt.RUNNING)}})},Jr=e=>(0,$.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,$.jsx)(`path`,{d:`M9 9H15V15H9V9Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`})]}),Yr=e=>(0,$.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function Xr({icon:e,text:t,onClick:n,testId:r}){return(0,$.jsx)(K,{testId:r,onClick:n,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,$.jsx)(`span`,{className:U(`flex shrink-0 items-center text-[var(--oh-muted)] group-hover:text-[var(--oh-foreground)] group-focus-visible:text-[var(--oh-foreground)] [&_svg]:text-current`,Re),"aria-hidden":!0,children:e})]})})}function Zr({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=X(),{isTask:i,taskStatus:a,taskDetail:o}=Et(),{t:s}=v(`openhands`),{errorMessage:c}=de(),l=r===H.LOADING||r===H.INIT,u=st(t)||at(t),d=Te({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=be({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,$.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,$.jsxs)(`div`,{className:`flex items-center`,children:[(0,$.jsx)(kr,{className:`w-6 h-6 shrink-0`,color:d}),(0,$.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function Qr({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1}){let{t:s}=v(`openhands`),c=it(e),l=ot(r),u=at(r),d=l||u;return(0,$.jsxs)(pt,{ref:c,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:U(`left-2 w-fit min-w-42`,a),children:[(0,$.jsx)(Zr,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),d&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ge,{inset:`menu`}),l&&t&&(0,$.jsx)(Xr,{icon:(0,$.jsx)(Jr,{width:18,height:18}),text:s(h.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),u&&n&&(0,$.jsx)(Xr,{icon:(0,$.jsx)(Yr,{width:18,height:18}),text:s(h.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}var $r=e(s(),1);function ei({isPublic:e,onToggle:t,ariaLabel:n}){return(0,$.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,$.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:U(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,$.jsx)(`span`,{className:U(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function ti({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onDownloadConversation:u,shareUrl:d,position:f=`bottom`,anchorRef:p}){let m=sn(),{t:g}=v(`openhands`),{backend:_}=W(),{data:y}=Y(),b=it(e),x=p?.current??null,[S,C]=Q.useState();Q.useLayoutEffect(()=>{if(!x)return;let e=()=>{let e=x.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};f===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,C(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[x,f]);let w=!!(a||o||s),T=!!i,E=!!(r||n),D=_.kind===`cloud`?h.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:h.COMMON$STOP_CONVERSATION,O=_.kind===`cloud`&&!!c,k=y?.public||!1,j=!!x,M=(0,$.jsxs)(pt,{ref:b,testId:`conversation-name-context-menu`,position:f,alignment:`left`,className:U(m?`right-0 translate-x-[34%] left-auto`:``,j?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,$.jsx)(K,{testId:`rename-button`,onClick:t,children:(0,$.jsx)(q,{icon:(0,$.jsx)(gt,{width:16,height:16}),text:g(h.BUTTON$RENAME)})}),w&&(0,$.jsx)(Ge,{testId:`separator-tools`,inset:`menu`}),o&&(0,$.jsx)(K,{testId:`show-skills-button`,onClick:o,children:(0,$.jsx)(q,{icon:(0,$.jsx)(_t,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:g(h.CONVERSATION$SHOW_SKILLS)})}),s&&(0,$.jsx)(K,{testId:`show-hooks-button`,onClick:s,children:(0,$.jsx)(q,{icon:(0,$.jsx)(kt,{width:16,height:16,"aria-hidden":!0}),text:g(h.CONVERSATION$SHOW_HOOKS)})}),a&&(0,$.jsx)(K,{testId:`show-agent-tools-button`,onClick:a,children:(0,$.jsx)(q,{icon:(0,$.jsx)(qe,{width:16,height:16}),text:g(h.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})}),u&&(0,$.jsx)(K,{testId:`download-trajectory-button`,onClick:u,children:(0,$.jsx)(q,{icon:(0,$.jsx)(A,{width:16,height:16}),text:g(h.BUTTON$EXPORT_CONVERSATION)})}),(T||E)&&(0,$.jsx)(Ge,{testId:`separator-info-control`,inset:`menu`}),i&&(0,$.jsx)(K,{testId:`display-cost-button`,onClick:i,children:(0,$.jsx)(q,{icon:(0,$.jsx)(F,{width:16,height:16}),text:g(h.BUTTON$DISPLAY_COST)})}),O&&c&&(0,$.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,$.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,$.jsx)(se,{size:16})}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:g(h.CONVERSATION$SHARE_PUBLICLY)}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[k&&d&&l&&(0,$.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,$.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(h.BUTTON$COPY_TO_CLIPBOARD),children:(0,$.jsx)(rn,{width:14,height:14})}),(0,$.jsx)(`a`,{"data-testid":`open-share-link-button`,href:d,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(h.BUTTON$OPEN_IN_NEW_TAB),children:(0,$.jsx)(R,{size:14,"aria-hidden":!0})})]}),(0,$.jsx)(ei,{isPublic:k,onToggle:c,ariaLabel:g(h.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,$.jsx)(K,{testId:`stop-button`,onClick:r,children:(0,$.jsx)(q,{icon:(0,$.jsx)(Ye,{width:16,height:16}),text:g(D)})}),n&&(0,$.jsx)(K,{testId:`delete-button`,onClick:n,children:(0,$.jsx)(q,{icon:(0,$.jsx)(mt,{width:16,height:16}),text:g(h.COMMON$DELETE_CONVERSATION)})})]});return j?typeof document>`u`||!S?null:$r.createPortal((0,$.jsx)(`div`,{style:S,children:M}),document.body):M}function ni({onClose:e}){let{t}=v(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(tt,{onClose:e,testId:`close-metrics-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(Le,{title:t(h.CONVERSATION$METRICS_INFO)})})]})}function ri({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden mt-1`,children:(0,$.jsx)(`div`,{className:U(`h-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function ii({currentCost:e,maxBudget:t}){let{t:n}=v(`openhands`),r=e/t*100;return(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(h.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(h.CONVERSATION$USED)})})})}function ai({cost:e,maxBudgetPerTask:t}){let{t:n}=v(`openhands`);return e===null?null:(0,$.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)]`,children:t!==null&&t>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ri,{currentCost:e,maxBudget:t}),(0,$.jsx)(ii,{currentCost:e,maxBudget:t})]}):(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(h.CONVERSATION$NO_BUDGET_LIMIT)})})}function oi({cost:e,maxBudgetPerTask:t}){let{t:n}=v(`openhands`);return e===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex justify-between items-center pb-2`,children:[(0,$.jsx)(`span`,{className:`text-lg font-semibold`,children:n(h.CONVERSATION$TOTAL_COST)}),(0,$.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]}),(0,$.jsx)(ai,{cost:e,maxBudgetPerTask:t})]})}function si({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`}){return(0,$.jsxs)(`div`,{className:`flex justify-between items-center border-b border-[var(--oh-border-subtle)] pb-2`,children:[(0,$.jsx)(`span`,{className:n,children:e}),(0,$.jsx)(`span`,{className:r,children:t})]})}function ci({usage:e}){let{t}=v(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(si,{label:t(h.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(h.CONVERSATION$CACHE_HIT)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(h.CONVERSATION$CACHE_WRITE)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,$.jsx)(si,{label:t(h.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,$.jsx)(si,{label:t(h.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`})]})}function li({perTurnToken:e,contextWindow:t}){let{t:n}=v(`openhands`),r=t>0?e/t*100:0,i=Math.min(100,r);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,$.jsx)(`span`,{className:`font-semibold`,children:n(h.CONVERSATION$CONTEXT_WINDOW)})}),(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full bg-foreground transition-all duration-300`,style:{width:`${i}%`}})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[e.toLocaleString(),` / `,t.toLocaleString(),` (`,r.toFixed(2),`% `,n(h.CONVERSATION$USED),`)`]})})]})}function ui(){let{t:e}=v(`openhands`);return(0,$.jsx)(`div`,{className:`text-center`,children:(0,$.jsx)(`p`,{className:`text-[var(--oh-muted)]`,children:e(h.CONVERSATION$NO_METRICS)})})}function di(e){let{stats:t}=e;if(!t?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let n=0,r=null,i=null;for(let e of Object.values(t.usage_to_metrics))n+=e.accumulated_cost,r===null&&e.max_budget_per_task!==null&&(r=e.max_budget_per_task),e.accumulated_token_usage&&(i=i===null?{...e.accumulated_token_usage}:{prompt_tokens:i.prompt_tokens+e.accumulated_token_usage.prompt_tokens,completion_tokens:i.completion_tokens+e.accumulated_token_usage.completion_tokens,cache_read_tokens:i.cache_read_tokens+e.accumulated_token_usage.cache_read_tokens,cache_write_tokens:i.cache_write_tokens+e.accumulated_token_usage.cache_write_tokens,context_window:Math.max(i.context_window,e.accumulated_token_usage.context_window),per_turn_token:Math.max(i.per_turn_token,e.accumulated_token_usage.per_turn_token)});return{accumulated_cost:n,max_budget_per_task:r,accumulated_token_usage:i}}var fi=(e,t,n,r=!0)=>{let i=c({queryKey:[`conversation-metrics`,e,t,n],queryFn:async()=>{if(!e)throw Error(`Conversation ID is required`);return di(await Pe.getRuntimeConversation(e,t,n))},enabled:r&&!!e&&!!t,staleTime:1e3*30,gcTime:1e3*60*5,refetchInterval:1e3*30,retry:!1});return{data:i.data,isLoading:i.isLoading,error:i.error}};function pi({isOpen:e,onOpenChange:t}){let n=ue(),{data:r}=Y(),i=r?.id,a=r?.conversation_url,o=r?.session_api_key,{data:s}=fi(i,a,o,e),c=(0,Q.useMemo)(()=>s?{cost:s.accumulated_cost,max_budget_per_task:s.max_budget_per_task,usage:s.accumulated_token_usage?{prompt_tokens:s.accumulated_token_usage.prompt_tokens??0,completion_tokens:s.accumulated_token_usage.completion_tokens??0,cache_read_tokens:s.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:s.accumulated_token_usage.cache_write_tokens??0,context_window:s.accumulated_token_usage.context_window??0,per_turn_token:s.accumulated_token_usage.per_turn_token??0}:null}:n,[s,n]);return e?(0,$.jsx)(Fe,{onClose:()=>t(!1),children:(0,$.jsxs)(Ie,{testID:`metrics-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,$.jsx)(ni,{onClose:()=>t(!1)}),(0,$.jsxs)(`div`,{className:`w-full`,children:[(c?.cost!==null||c?.usage!==null)&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(oi,{cost:c?.cost??null,maxBudgetPerTask:c?.max_budget_per_task??null}),c?.usage!==null&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ci,{usage:c.usage}),(0,$.jsx)(li,{perTurnToken:c.usage.per_turn_token,contextWindow:c.usage.context_window})]})]})}),!c?.cost&&!c?.usage&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsx)(ui,{})})]})]})}):null}function mi(){let{t:e}=v(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{mutate:r}=ee(),[i,a]=Q.useState(`view`),[o,s]=Q.useState(!1),c=Q.useRef(null),l=Q.useRef(null),{handleDelete:u,handleStop:d,handleDownloadConversation:f,handleDisplayCost:p,handleShowAgentTools:m,handleShowSkills:g,handleShowHooks:_,handleTogglePublic:y,handleCopyShareLink:b,shareUrl:x,handleConfirmDelete:S,handleConfirmStop:C,metricsModalVisible:w,setMetricsModalVisible:T,systemModalVisible:E,setSystemModalVisible:D,skillsModalVisible:O,setSkillsModalVisible:k,hooksModalVisible:A,setHooksModalVisible:M,confirmDeleteModalVisible:N,setConfirmDeleteModalVisible:te,confirmStopModalVisible:P,setConfirmStopModalVisible:F,systemMessage:ne,shouldShowStop:I,shouldShowDownloadConversation:L,shouldShowDisplayCost:ie,shouldShowAgentTools:oe,shouldShowSkills:se,shouldShowHooks:R}=Ct({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return Q.useEffect(()=>{i===`edit`&&c.current?.focus()},[i]),n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 h-[22px] text-base font-normal text-left pl-0 lg:pl-1`,"data-testid":`conversation-name`,children:[i===`edit`?(0,$.jsx)(`input`,{ref:c,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(c.current?.value&&t){let i=c.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{ae(e(h.CONVERSATION$TITLE_UPDATED))}})}else c.current&&(c.current.value=n?.title??``);a(`view`)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:n.title||``,className:`text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content`}):(0,$.jsx)(`div`,{className:`text-white leading-5 w-fit max-w-fit truncate`,"data-testid":`conversation-name-title`,onDoubleClick:()=>{a(`edit`)},title:n.title||``,children:n.title}),i!==`edit`&&(0,$.jsxs)(`div`,{ref:l,className:`relative flex items-center`,children:[(0,$.jsx)(ht,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)}}),o&&(0,$.jsx)(ti,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:u,onStop:I?d:void 0,onDisplayCost:ie?p:void 0,onShowAgentTools:oe?m:void 0,onShowSkills:se?g:void 0,onShowHooks:R?_:void 0,onTogglePublic:y,onCopyShareLink:b,shareUrl:x,onDownloadConversation:L?f:void 0,position:`bottom`,anchorRef:l})]})]}),(0,$.jsx)(pi,{isOpen:w,onOpenChange:T}),(0,$.jsx)(Ft,{isOpen:E,onClose:()=>D(!1),systemMessage:ne||null}),O&&(0,$.jsx)(It,{onClose:()=>k(!1)}),A&&(0,$.jsx)(Bt,{onClose:()=>M(!1)}),N&&(0,$.jsx)(j,{onConfirm:S,onCancel:()=>te(!1),conversationTitle:n?.title||``}),P&&(0,$.jsx)(re,{onConfirm:C,onCancel:()=>F(!1)})]}):null}function hi({children:e,tooltip:t,ariaLabel:n}){return(0,$.jsx)(We,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,$.jsx)(`span`,{"data-aria-label":n,children:e})})}function gi({className:e}){let{t}=v(`openhands`),n=sn(),r=a(),{conversationId:i}=J(),{isRightPanelShown:o,setHasRightPanelToggled:s,setIsRightPanelShown:c,setSelectedTab:l}=G(),u=()=>{if(n){if(!i)return;s(!0),c(!0);let{selectedTab:e}=G.getState();e||l(`files`),r(`/conversations/${i}/panel`);return}let e=!o;if(s(e),e){let{selectedTab:e}=G.getState();e||l(`files`)}},d=t(n?h.COMMON$SHOW_PANEL:o?h.COMMON$HIDE_PANEL:h.COMMON$SHOW_PANEL),f=n?!1:o;return(0,$.jsx)(hi,{tooltip:d,ariaLabel:d,children:(0,$.jsx)(`button`,{type:`button`,onClick:u,className:U(P,e),"aria-label":d,"aria-pressed":f,"data-testid":`right-panel-toggle`,children:(0,$.jsx)(te,{className:`w-5 h-5 -scale-x-100`})})})}function _i(){let{conversationId:e}=J(),{data:t}=Y(),{curAgentState:n}=X(),{isTask:r,taskStatus:i}=Et(),{mutate:a}=Ke(),{mutate:o}=qr(),{providers:s}=Xe(),c=t?.execution_status??null,l=Te({isPausing:!1,isTask:r,taskStatus:i,isStartingStatus:n===H.LOADING||n===H.INIT,isStopStatus:st(c),curAgentState:n});return(0,$.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center`,children:[(0,$.jsxs)(`div`,{className:`group relative`,children:[(0,$.jsx)(kr,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:l}),(0,$.jsx)(Qr,{onClose:()=>{},onStopServer:ot(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&a({conversationId:e})}:void 0,onStartServer:at(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&o({conversationId:e,providers:s})}:void 0,executionStatus:c,position:`bottom`,className:`opacity-0 invisible pointer-events-none group-hover:opacity-100 group-hover:visible group-hover:pointer-events-auto bottom-full left-0 mt-0 min-h-fit`,isPausing:!1})]}),(0,$.jsx)(mi,{})]}),(0,$.jsx)(gi,{className:`mr-2`})]})}var vi=e=>(0,$.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.4375 9C2.4375 5.37563 5.37563 2.4375 9 2.4375C12.6244 2.4375 15.5625 5.37563 15.5625 9C15.5625 12.6244 12.6244 15.5625 9 15.5625C5.37563 15.5625 2.4375 12.6244 2.4375 9ZM4.13812 6.5625C4.81317 5.21867 6.02897 4.19333 7.49996 3.77204C7.15155 4.17641 6.85182 4.65395 6.60713 5.17892C6.40828 5.60556 6.24263 6.06975 6.11494 6.5625H4.13812ZM3.72196 7.6875C3.61778 8.10783 3.5625 8.54746 3.5625 9C3.5625 9.45254 3.61778 9.89217 3.72196 10.3125H5.89738C5.84161 9.88758 5.8125 9.44852 5.8125 8.99998C5.8125 8.55142 5.84161 8.11239 5.89737 7.6875H3.72196ZM7.0333 7.6875C6.97087 8.10689 6.9375 8.54634 6.9375 8.99998C6.9375 9.45367 6.97087 9.89313 7.0333 10.3125H10.9667C11.0291 9.89311 11.0625 9.45367 11.0625 9.00002C11.0625 8.54637 11.0291 8.1069 10.9667 7.6875H7.0333ZM12.1026 7.6875C12.1584 8.1124 12.1875 8.55145 12.1875 9.00002C12.1875 9.44858 12.1584 9.88762 12.1026 10.3125H14.278C14.3822 9.89217 14.4375 9.45254 14.4375 9C14.4375 8.54746 14.3822 8.10783 14.278 7.6875H12.1026ZM13.8619 6.5625H11.885C11.7574 6.06976 11.5917 5.6056 11.3929 5.17897C11.1482 4.65397 10.8484 4.1764 10.5 3.77203C11.971 4.19331 13.1868 5.21866 13.8619 6.5625ZM10.7171 6.5625H7.28293C7.38007 6.23971 7.49559 5.93571 7.62681 5.65419C7.99835 4.85708 8.48101 4.26914 8.99997 3.92442C9.51895 4.26913 10.0016 4.8571 10.3732 5.65424C10.5044 5.93575 10.6199 6.23973 10.7171 6.5625ZM4.13812 11.4375H6.11496C6.24963 11.9572 6.42655 12.4452 6.64015 12.8909C6.87835 13.3879 7.16685 13.8413 7.50006 14.228C6.02902 13.8067 4.81318 12.7814 4.13812 11.4375ZM10.7171 11.4375H7.28295C7.3869 11.7829 7.51191 12.1068 7.65465 12.4047C8.02305 13.1733 8.49456 13.7398 9.00007 14.0756C9.51902 13.7308 10.0017 13.1429 10.3732 12.3458C10.5044 12.0643 10.6199 11.7603 10.7171 11.4375ZM11.3929 12.8211C11.5917 12.3944 11.7574 11.9303 11.8851 11.4375H13.8619C13.1868 12.7813 11.971 13.8067 10.5 14.228C10.8485 13.8236 11.1482 13.346 11.3929 12.8211Z`,fill:`currentColor`})}),yi=e=>(0,$.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,$.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,$.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]});function bi({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o}){return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{n()},...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:U(`flex items-center gap-2 rounded-md cursor-pointer`,`pl-1.5 pr-2 py-1 lg:py-1.5`,`text-[var(--oh-muted)] bg-transparent`,r&&`bg-[var(--oh-interactive-active)] text-white`,r?`hover:text-white hover:bg-[var(--oh-interactive-hover)]`:`hover:text-white hover:bg-white/5`,r?`focus-within:text-white`:`focus-within:text-[var(--oh-muted)]`,a),children:[(0,$.jsx)(t,{className:U(`w-5 h-5 text-inherit flex-shrink-0`)}),r&&i&&(0,$.jsx)(`span`,{className:`text-sm font-normal whitespace-nowrap`,children:i})]})}function xi(){let{curAgentState:e}=X(),{t}=v(`openhands`),{data:n,refetch:r}=ln(),i=De.includes(e);return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{children:t(h.COMMON$CODE)}),i?null:(0,$.jsx)(ft,{className:`w-3 h-3 text-inherit cursor-pointer`,onClick:async e=>{e.preventDefault(),e.stopPropagation();let t=n?.url;t||=(await r()).data?.url??null,t&&window.open(t,`_blank`,`noopener,noreferrer`)}})]})}var Si=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),Ci=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.jsx)(`path`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})});function wi({isOpen:e,onClose:t,ignoreOutsideClickRef:n}){let r=it(t,n),{t:i}=v(`openhands`),{conversationId:a}=J(),{state:o,setUnpinnedTabs:s,setSelectedTab:c}=et(a),{selectedTab:l,isRightPanelShown:u,setSelectedTab:d}=G(),{navigateToTab:f}=S(),{hasTaskList:p}=un(),{backend:m}=W(),g=[{tab:`planner`,icon:nn,i18nKey:h.COMMON$PLANNER},{tab:`files`,icon:Jt,i18nKey:h.COMMON$FILES},{tab:`vscode`,icon:cn,i18nKey:h.COMMON$CODE},{tab:`terminal`,icon:vt,i18nKey:h.COMMON$TERMINAL},{tab:`browser`,icon:vi,i18nKey:h.COMMON$BROWSER}];p&&g.unshift({tab:`tasklist`,icon:yi,i18nKey:h.COMMON$TASK_LIST});let _=g.filter(({tab:e})=>e!==`vscode`||m.kind===`cloud`);if(!e)return null;let y=e=>{f(e),t()},b=(e,t)=>{if(t.preventDefault(),t.stopPropagation(),o.unpinnedTabs.includes(e))s(o.unpinnedTabs.filter(t=>t!==e));else{let t=[...o.unpinnedTabs,e];if(s(t),l===e&&u){let n=_.find(({tab:n})=>n!==e&&!t.includes(n));n&&(d(n.tab),c(n.tab))}}};return(0,$.jsx)(pt,{ref:r,alignment:`right`,position:`bottom`,className:`z-[9999] mt-2 w-fit`,children:_.map(({tab:e,icon:t,i18nKey:n})=>{let r=!o.unpinnedTabs.includes(e);return(0,$.jsx)(`li`,{className:`list-none`,children:(0,$.jsxs)(`div`,{className:U(`flex h-[30px] w-full min-w-0 items-stretch rounded`,`hover:bg-[var(--oh-interactive-hover)]`),children:[(0,$.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,className:U(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start`,`text-white transition-colors`),onClick:()=>y(e),children:[(0,$.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,$.jsx)(`span`,{className:`text-sm`,children:i(n)})]}),(0,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,className:U(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2`,`text-white transition-colors hover:bg-white/10`),"aria-pressed":r,"aria-label":r?`Unpin tab from bar`:`Pin tab to bar`,onClick:t=>b(e,t),children:r?(0,$.jsx)(Ci,{className:`-mr-[5px] ml-auto h-7 w-7`}):(0,$.jsx)(Si,{className:`ml-auto h-4.5 w-4.5`})})]})},e)})})}function Ti({variant:e=`default`}){let{conversationId:t}=J(),{setSelectedTab:n,planContent:r}=G(),[i,a]=(0,Q.useState)(!1),{state:o}=et(t),{hasTaskList:s}=un(),{backend:c}=W(),{handleBuildPlanClick:l}=y(),{curAgentState:u}=X(),{selectTab:d,isTabActive:f,onTabChange:p,selectedTab:m,isRightPanelShown:g}=S();(0,Q.useEffect)(()=>{n(o.selectedTab)},[n,o.selectedTab]),(0,Q.useEffect)(()=>{g&&(m||p(`files`))},[g,m,p]);let{t:_,i18n:b}=v(`openhands`),x=[{tabValue:`files`,isActive:f(`files`),icon:Jt,onClick:()=>d(`files`),tooltipContent:_(h.COMMON$FILES),tooltipAriaLabel:_(h.COMMON$FILES),label:_(h.COMMON$FILES)},{tabValue:`planner`,isActive:f(`planner`),icon:nn,onClick:()=>d(`planner`),tooltipContent:_(h.COMMON$PLANNER),tooltipAriaLabel:_(h.COMMON$PLANNER),label:_(h.COMMON$PLANNER)},{tabValue:`vscode`,isActive:f(`vscode`),icon:cn,onClick:()=>d(`vscode`),tooltipContent:(0,$.jsx)(xi,{}),tooltipAriaLabel:_(h.COMMON$CODE),label:_(h.COMMON$CODE)},{tabValue:`terminal`,isActive:f(`terminal`),icon:vt,onClick:()=>d(`terminal`),tooltipContent:_(h.COMMON$TERMINAL),tooltipAriaLabel:_(h.COMMON$TERMINAL),label:_(h.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:f(`browser`),icon:vi,onClick:()=>d(`browser`),tooltipContent:_(h.COMMON$BROWSER),tooltipAriaLabel:_(h.COMMON$BROWSER),label:_(h.COMMON$BROWSER)}];s&&x.splice(1,0,{tabValue:`tasklist`,isActive:f(`tasklist`),icon:yi,onClick:()=>d(`tasklist`),tooltipContent:_(h.COMMON$TASK_LIST),tooltipAriaLabel:_(h.COMMON$TASK_LIST),label:_(h.COMMON$TASK_LIST)});let C=x.filter(e=>e.tabValue===`vscode`&&c.kind!==`cloud`?!1:o.unpinnedTabs.includes(e.tabValue)?m===e.tabValue:!0),w=o.unpinnedTabs.join(`,`),T=u===H.RUNNING||u===H.LOADING||!r,E=(0,Q.useRef)(null),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),[A,j]=(0,Q.useState)(C.length);(0,Q.useLayoutEffect)(()=>{let e=E.current,t=D.current,n=O.current;if(!e||!t||!n)return;let r=()=>{let r=t.querySelectorAll(`[data-tab-measure="true"]`),i=r.length,a=e.getBoundingClientRect().width;if(a===0){j(i);return}let o=Array.from(r).map(e=>e.getBoundingClientRect().width);if(o.length!==i||i===0){j(Math.max(0,i));return}let s=n.getBoundingClientRect().width,c=getComputedStyle(e).columnGap||getComputedStyle(e).gap,l=parseFloat(c)||6,u=0;for(let e=i;e>=0;--e){let t=s;for(let n=0;n<e;n+=1)t+=o[n]??0;if(e>0&&(t+=e*l),t<=a+.5){u=e;break}}j(e=>e===u?e:u)};if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(e),()=>i.disconnect()},[w,C.length,s,c.kind,m,g,b.language]);let M=Math.min(A,C.length);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:U(`relative w-full min-w-0`,e===`compact`?`flex h-full min-h-0 items-center py-0 pl-0 pr-1`:`min-h-10 p-1`),children:[(0,$.jsx)(`div`,{ref:D,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:C.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,$.jsx)(hi,{tooltip:r,ariaLabel:i,children:(0,$.jsx)(bi,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:U(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,$.jsx)(`div`,{ref:E,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:(0,$.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:C.slice(0,M).map(({tabValue:e,icon:t,onClick:n,isActive:r,tooltipContent:i,tooltipAriaLabel:a,label:o,className:s},c)=>(0,$.jsx)(hi,{tooltip:i,ariaLabel:a,children:(0,$.jsx)(bi,{tabValue:e,icon:t,onClick:n,isActive:r,label:o,className:U(s,`shrink-0`)})},`${e}-${c}`))}),(0,$.jsxs)(`div`,{ref:O,className:`relative shrink-0`,children:[(0,$.jsx)(ht,{ref:k,onClick:()=>a(!i),ariaLabel:_(h.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?N:void 0}),(0,$.jsx)(wi,{isOpen:i,onClose:()=>a(!1),ignoreOutsideClickRef:k})]})]})})]}),f(`planner`)&&(0,$.jsx)(`div`,{className:U(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,$.jsx)(`button`,{type:`button`,onClick:l,disabled:T,className:U(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,T?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,$.jsxs)(tn.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[_(h.COMMON$BUILD),` ⌘↩`]})})})]})}function Ei({onMouseDown:e,className:t,isDragging:n=!1}){let[r,i]=(0,Q.useState)(!1),a=n||r;return(0,$.jsxs)(`div`,{className:U(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-3 min-w-[12px] -translate-x-1/2 cursor-ew-resize`,onMouseDown:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)}),(0,$.jsx)(`div`,{className:U(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`,a?`bg-white`:`bg-transparent`),"aria-hidden":!0})]})}var Di=200;function Oi({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=dn(r,e),o=(0,Q.useCallback)(e=>Math.max(t,Math.min(n,e)),[t,n]),[s,c]=(0,Q.useState)(()=>o(i)),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useCallback)(e=>{e.preventDefault(),u(!0)},[]),p=(0,Q.useCallback)(e=>{if(!l||!d.current)return;let t=d.current.getBoundingClientRect();c(o((e.clientX-t.left)/t.width*100))},[l,o]),m=(0,Q.useCallback)(()=>{l&&(u(!1),a(s))},[l,s,a]);return(0,Q.useLayoutEffect)(()=>{if(!l)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(Di),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,m),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,m),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[l,p,m]),{leftWidth:s,rightWidth:100-s,isDragging:l,containerRef:d,handleMouseDown:f}}function ki(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function Ai(){let e=sn(),t=sn(767),{isRightPanelShown:n}=G(),{leftWidth:r,rightWidth:i,isDragging:a,containerRef:o,handleMouseDown:s}=Oi({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,$.jsx)(`div`,{className:U(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,$.jsxs)(`div`,{ref:o,className:U(`flex flex-1 overflow-hidden`,e?`flex-col`:`transition-all duration-300 ease-in-out`),style:e?void 0:{transitionProperty:a?`none`:`all`},children:[(0,$.jsxs)(`div`,{className:U(`flex flex-col bg-base overflow-hidden`,e?`flex-1`:`transition-all duration-300 ease-in-out`),style:e?void 0:{width:n?`${r}%`:`100%`,transitionProperty:a?`none`:`all`},children:[(0,$.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:U(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,$.jsx)(ne,{}):null,(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(_i,{})})]}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(Pr,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,$.jsx)(Ei,{onMouseDown:s,isDragging:a}),!e&&(0,$.jsx)(`div`,{className:U(`transition-all duration-300 ease-in-out overflow-hidden`,ki(n)),style:{width:n?`${i}%`:`0%`,transitionProperty:a?`opacity, transform`:`all`},children:(0,$.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,$.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 bg-[var(--oh-surface)] border-l border-[var(--oh-border)] overflow-hidden`,children:[(0,$.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,$.jsx)(Ti,{})}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(Kr,{})})]})})})]})})}function ji({onNavigateBack:e}){let{t}=v(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=G();return Q.useLayoutEffect(()=>(n(!0),r(!0),G.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,$.jsxs)(`div`,{"data-testid":`conversation-mobile-panel-top`,className:`flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-[var(--oh-border)] pl-2.5`,children:[(0,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(h.COMMON$BACK),className:P,children:(0,$.jsx)(M,{size:20,className:N,"aria-hidden":!0,strokeWidth:2})}),(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,$.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex h-full min-h-0 w-full min-w-0 flex-col justify-center`,children:(0,$.jsx)(Ti,{variant:`compact`})})})]}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,$.jsx)(Kr,{})})]})}var Mi=1e3*60*5,Ni=1e3*60*15,Pi=e=>{let t=e||[],n=W();return c({queryKey:[`v1`,`sub-conversations`,t,n.backend.id,n.orgId],queryFn:async()=>t.length===0?[]:Pe.batchGetAppConversations(t),enabled:t.length>0,staleTime:Mi,gcTime:Ni,retry:!1})};function Fi({children:e,conversationId:t}){let{data:n}=Y(),{data:r}=Pi(n?.sub_conversation_ids??[]),i=r?.filter(e=>e!==null);return(0,$.jsx)(he,{conversationId:t,conversationUrl:n?.sandbox_status===`PAUSED`?null:n?.conversation_url,sessionApiKey:n?.session_api_key,subConversationIds:n?.sub_conversation_ids,subConversations:i,children:e})}function Ii(){let{t:e}=v(`openhands`),{conversationId:t}=J(),n=r(`/conversations/:conversationId/panel`),i=Z(e=>e.clearEvents),{isTask:s,taskStatus:c,taskDetail:l}=Et(),u=W(),d=Q.useRef(u.backend.id),f=Q.useRef(u.orgId),p=d.current!==u.backend.id||f.current!==u.orgId,{data:m,isFetched:g}=Y(),{data:_}=rt(),{resetConversationState:y}=G(),b=a(),x=o(),S=en(e=>e.clearTerminal),C=bt(e=>e.reset),w=pn(e=>e.setCurrentAgentState),T=de(e=>e.removeErrorMessage);Q.useEffect(()=>{S(),y(),C(),w(H.LOADING),T(),i()},[t,S,y,C,w,T,i]),Q.useEffect(()=>{if(s&&c===`ERROR`){L(l||e(h.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=x.state?.resumedFromConversationId;b(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[s,c,l,e,b,x.state]),Q.useEffect(()=>{!g||!_||p||m||(yn(u.backend.id,u.orgId),L(e(h.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),b(`/conversations`))},[m,g,_,b,e,p,u.backend.id,u.orgId]),Q.useEffect(()=>{p||t&&(t.startsWith(`task-`)||vn(u.backend.id,u.orgId,t))},[t,p,u.backend.id,u.orgId]);let E=Q.useRef(null);return Q.useEffect(()=>{!g||!m||u.backend.kind===`cloud`&&m.sandbox_status===`PAUSED`&&m.sandbox_id&&E.current!==m.id&&(E.current=m.id,Me(m.sandbox_id).catch(()=>{L(e(h.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[g,m?.id,m?.sandbox_status,m?.sandbox_id,u.backend.kind,e]),(0,$.jsx)(Fi,{conversationId:t,children:(0,$.jsx)(Tn,{children:(0,$.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,$.jsx)(ji,{onNavigateBack:()=>b(`/conversations/${t}`)}):(0,$.jsx)(Ai,{})})})})}function Li(){return(0,$.jsx)(Ii,{})}var Ri=i(Li);export{Ri as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./conversation-DWcvnmds.js";export{e as default};