@openhands/agent-canvas 1.0.0-alpha.6 → 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 (728) hide show
  1. package/README.md +32 -7
  2. package/bin/agent-canvas.mjs +35 -2
  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-g5-RZ0da.js +1 -0
  17. package/build/assets/automations-list-DHoq_0MM.js +1 -0
  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-Ywrxd_9p.js +3 -0
  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-D9fJfhQA.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-BLjAEgle.js +2 -0
  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-BfZNCsvo.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/backends/backend-selector.cjs +1 -1
  204. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  205. package/dist/components/features/backends/backend-selector.js +95 -95
  206. package/dist/components/features/backends/backend-selector.js.map +1 -1
  207. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  208. package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
  209. package/dist/components/features/chat/change-agent-button.js +65 -59
  210. package/dist/components/features/chat/change-agent-button.js.map +1 -1
  211. package/dist/components/features/chat/chat-interface.cjs +2 -2
  212. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  213. package/dist/components/features/chat/chat-interface.js +15 -14
  214. package/dist/components/features/chat/chat-interface.js.map +1 -1
  215. package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
  216. package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
  217. package/dist/components/features/chat/components/chat-input-actions.js +115 -137
  218. package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
  219. package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
  220. package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
  221. package/dist/components/features/chat/components/chat-input-model.d.ts +10 -0
  222. package/dist/components/features/chat/components/chat-input-model.js +95 -60
  223. package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
  224. package/dist/components/features/chat/components/slash-command-menu.cjs +1 -1
  225. package/dist/components/features/chat/components/slash-command-menu.cjs.map +1 -1
  226. package/dist/components/features/chat/components/slash-command-menu.js +1 -1
  227. package/dist/components/features/chat/components/slash-command-menu.js.map +1 -1
  228. package/dist/components/features/chat/git-control-bar.cjs +1 -1
  229. package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
  230. package/dist/components/features/chat/git-control-bar.js +60 -59
  231. package/dist/components/features/chat/git-control-bar.js.map +1 -1
  232. package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
  233. package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
  234. package/dist/components/features/conversation/conversation-name-with-status.js +2 -2
  235. package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
  236. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  237. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  238. package/dist/components/features/conversation/conversation-name.js +3 -3
  239. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  240. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  241. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  242. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +1 -1
  243. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  244. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  245. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  246. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +16 -16
  247. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  248. package/dist/components/features/mcp-logo-badge.cjs +1 -1
  249. package/dist/components/features/mcp-logo-badge.cjs.map +1 -1
  250. package/dist/components/features/mcp-logo-badge.d.ts +2 -2
  251. package/dist/components/features/mcp-logo-badge.js +1 -1
  252. package/dist/components/features/mcp-logo-badge.js.map +1 -1
  253. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  254. package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
  255. package/dist/components/features/mcp-page/custom-server-editor.js +64 -41
  256. package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
  257. package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
  258. package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
  259. package/dist/components/features/mcp-page/install-server-modal.d.ts +1 -1
  260. package/dist/components/features/mcp-page/install-server-modal.js +126 -102
  261. package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
  262. package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
  263. package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
  264. package/dist/components/features/mcp-page/installed-server-card.js +1 -1
  265. package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
  266. package/dist/components/features/mcp-page/marketplace-card.cjs +1 -1
  267. package/dist/components/features/mcp-page/marketplace-card.cjs.map +1 -1
  268. package/dist/components/features/mcp-page/marketplace-card.d.ts +1 -1
  269. package/dist/components/features/mcp-page/marketplace-card.js +27 -25
  270. package/dist/components/features/mcp-page/marketplace-card.js.map +1 -1
  271. package/dist/components/features/mcp-page/marketplace-section.cjs +1 -1
  272. package/dist/components/features/mcp-page/marketplace-section.cjs.map +1 -1
  273. package/dist/components/features/mcp-page/marketplace-section.d.ts +1 -1
  274. package/dist/components/features/mcp-page/marketplace-section.js +1 -1
  275. package/dist/components/features/mcp-page/marketplace-section.js.map +1 -1
  276. package/dist/components/features/mcp-page/mcp-logo-stack-badge.d.ts +2 -2
  277. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +7 -7
  278. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
  279. package/dist/components/features/settings/mcp-settings/mcp-server-form.d.ts +8 -12
  280. package/dist/components/features/settings/mcp-settings/mcp-server-form.js +114 -87
  281. package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
  282. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  283. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  284. package/dist/components/features/sidebar/sidebar-rail-body.d.ts +1 -2
  285. package/dist/components/features/sidebar/sidebar-rail-body.js +104 -104
  286. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  287. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  288. package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
  289. package/dist/components/features/sidebar/sidebar.js +82 -83
  290. package/dist/components/features/sidebar/sidebar.js.map +1 -1
  291. package/dist/context/scroll-context.cjs +1 -1
  292. package/dist/context/scroll-context.cjs.map +1 -1
  293. package/dist/context/scroll-context.d.ts +1 -0
  294. package/dist/context/scroll-context.js +4 -1
  295. package/dist/context/scroll-context.js.map +1 -1
  296. package/dist/contexts/conversation-websocket-context.cjs +3 -3
  297. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  298. package/dist/contexts/conversation-websocket-context.js +36 -36
  299. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  300. package/dist/favicon.svg +1 -0
  301. package/dist/hooks/mutation/use-switch-acp-model.cjs +2 -0
  302. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -0
  303. package/dist/hooks/mutation/use-switch-acp-model.d.ts +23 -0
  304. package/dist/hooks/mutation/use-switch-acp-model.js +26 -0
  305. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -0
  306. package/dist/hooks/mutation/use-test-mcp-server.cjs +2 -0
  307. package/dist/hooks/mutation/use-test-mcp-server.cjs.map +1 -0
  308. package/dist/hooks/mutation/use-test-mcp-server.d.ts +2 -0
  309. package/dist/hooks/mutation/use-test-mcp-server.js +10 -0
  310. package/dist/hooks/mutation/use-test-mcp-server.js.map +1 -0
  311. package/dist/hooks/query/use-automation-detail.d.ts +3 -2
  312. package/dist/hooks/query/use-local-git-info.cjs +3 -1
  313. package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
  314. package/dist/hooks/query/use-local-git-info.d.ts +2 -2
  315. package/dist/hooks/query/use-local-git-info.js +27 -24
  316. package/dist/hooks/query/use-local-git-info.js.map +1 -1
  317. package/dist/hooks/use-acp-model-context.cjs.map +1 -1
  318. package/dist/hooks/use-acp-model-context.d.ts +3 -4
  319. package/dist/hooks/use-acp-model-context.js.map +1 -1
  320. package/dist/hooks/use-chat-input-model-state.cjs +2 -0
  321. package/dist/hooks/use-chat-input-model-state.cjs.map +1 -0
  322. package/dist/hooks/use-chat-input-model-state.d.ts +12 -0
  323. package/dist/hooks/use-chat-input-model-state.js +29 -0
  324. package/dist/hooks/use-chat-input-model-state.js.map +1 -0
  325. package/dist/i18n/declaration.cjs +1 -1
  326. package/dist/i18n/declaration.cjs.map +1 -1
  327. package/dist/i18n/declaration.d.ts +8 -0
  328. package/dist/i18n/declaration.js +1 -1
  329. package/dist/i18n/declaration.js.map +1 -1
  330. package/dist/i18n/translation.cjs +2 -2
  331. package/dist/i18n/translation.cjs.map +1 -1
  332. package/dist/i18n/translation.js +136 -0
  333. package/dist/i18n/translation.js.map +1 -1
  334. package/dist/locales/ar/openhands.json +8 -0
  335. package/dist/locales/ca/openhands.json +8 -0
  336. package/dist/locales/de/openhands.json +8 -0
  337. package/dist/locales/en/openhands.json +8 -0
  338. package/dist/locales/es/openhands.json +8 -0
  339. package/dist/locales/fr/openhands.json +8 -0
  340. package/dist/locales/it/openhands.json +8 -0
  341. package/dist/locales/ja/openhands.json +8 -0
  342. package/dist/locales/ko-KR/openhands.json +8 -0
  343. package/dist/locales/no/openhands.json +8 -0
  344. package/dist/locales/pt/openhands.json +8 -0
  345. package/dist/locales/tr/openhands.json +8 -0
  346. package/dist/locales/uk/openhands.json +8 -0
  347. package/dist/locales/zh-CN/openhands.json +8 -0
  348. package/dist/locales/zh-TW/openhands.json +8 -0
  349. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs +2 -0
  350. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs.map +1 -0
  351. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js +37 -0
  352. package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js.map +1 -0
  353. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs +2 -0
  354. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs.map +1 -0
  355. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js +36 -0
  356. package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js.map +1 -0
  357. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.cjs +1 -1
  358. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -0
  359. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.js +15 -5
  360. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -0
  361. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs +2 -0
  362. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs.map +1 -0
  363. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js +36 -0
  364. package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js.map +1 -0
  365. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs +2 -0
  366. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs.map +1 -0
  367. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js +31 -0
  368. package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js.map +1 -0
  369. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs +2 -0
  370. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs.map +1 -0
  371. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js +52 -0
  372. package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js.map +1 -0
  373. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.cjs +1 -1
  374. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.cjs.map +1 -0
  375. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.js +15 -5
  376. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.js.map +1 -0
  377. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs +2 -0
  378. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs.map +1 -0
  379. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-browser-rendering.js +15 -5
  380. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.js.map +1 -0
  381. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.cjs +1 -1
  382. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.cjs.map +1 -0
  383. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.js +15 -5
  384. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.js.map +1 -0
  385. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.cjs +1 -1
  386. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.cjs.map +1 -0
  387. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.js +15 -5
  388. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.js.map +1 -0
  389. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs +2 -0
  390. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs.map +1 -0
  391. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-observability.js +15 -5
  392. package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.js.map +1 -0
  393. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.cjs +1 -1
  394. package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.cjs.map +1 -0
  395. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.js +15 -5
  396. package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.js.map +1 -0
  397. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs +2 -0
  398. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs.map +1 -0
  399. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js +36 -0
  400. package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js.map +1 -0
  401. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.cjs +1 -1
  402. package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.cjs.map +1 -0
  403. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.js +13 -6
  404. package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.js.map +1 -0
  405. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs +2 -0
  406. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs.map +1 -0
  407. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js +36 -0
  408. package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js.map +1 -0
  409. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.cjs +1 -1
  410. package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.cjs.map +1 -0
  411. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.js +13 -6
  412. package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.js.map +1 -0
  413. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs +2 -0
  414. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs.map +1 -0
  415. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js +40 -0
  416. package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js.map +1 -0
  417. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs +2 -0
  418. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs.map +1 -0
  419. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js +39 -0
  420. package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js.map +1 -0
  421. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs +2 -0
  422. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs.map +1 -0
  423. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js +36 -0
  424. package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js.map +1 -0
  425. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs +2 -0
  426. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs.map +1 -0
  427. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js +40 -0
  428. package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js.map +1 -0
  429. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +2 -0
  430. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -0
  431. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +47 -0
  432. package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -0
  433. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.cjs +1 -1
  434. package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.cjs.map +1 -0
  435. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.js +15 -5
  436. package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.js.map +1 -0
  437. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs +2 -0
  438. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs.map +1 -0
  439. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js +36 -0
  440. package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js.map +1 -0
  441. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.cjs +1 -1
  442. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -0
  443. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.js +15 -5
  444. package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -0
  445. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs +2 -0
  446. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs.map +1 -0
  447. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/memory.js +13 -6
  448. package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.js.map +1 -0
  449. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs +2 -0
  450. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs.map +1 -0
  451. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js +36 -0
  452. package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js.map +1 -0
  453. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs +2 -0
  454. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs.map +1 -0
  455. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js +40 -0
  456. package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js.map +1 -0
  457. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +2 -0
  458. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -0
  459. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +39 -0
  460. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -0
  461. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs +2 -0
  462. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs.map +1 -0
  463. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js +38 -0
  464. package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js.map +1 -0
  465. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs +2 -0
  466. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs.map +1 -0
  467. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/paypal.js +15 -5
  468. package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.js.map +1 -0
  469. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs +2 -0
  470. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs.map +1 -0
  471. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/playwright.js +13 -6
  472. package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.js.map +1 -0
  473. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs +2 -0
  474. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs.map +1 -0
  475. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js +43 -0
  476. package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js.map +1 -0
  477. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs +2 -0
  478. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs.map +1 -0
  479. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js +41 -0
  480. package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js.map +1 -0
  481. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs +2 -0
  482. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs.map +1 -0
  483. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sentry.js +15 -5
  484. package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.js.map +1 -0
  485. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs +2 -0
  486. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs.map +1 -0
  487. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sequential-thinking.js +13 -6
  488. package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.js.map +1 -0
  489. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +2 -0
  490. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -0
  491. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +45 -0
  492. package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -0
  493. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs +2 -0
  494. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs.map +1 -0
  495. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/stripe.js +15 -5
  496. package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.js.map +1 -0
  497. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs +2 -0
  498. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs.map +1 -0
  499. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js +37 -0
  500. package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js.map +1 -0
  501. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/tavily.cjs +1 -1
  502. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.cjs.map +1 -0
  503. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js +39 -0
  504. package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js.map +1 -0
  505. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs +2 -0
  506. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs.map +1 -0
  507. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/time.js +13 -6
  508. package/dist/node_modules/@openhands/extensions/integrations/catalog/time.js.map +1 -0
  509. package/dist/node_modules/@openhands/extensions/integrations/index.cjs +2 -0
  510. package/dist/node_modules/@openhands/extensions/integrations/index.cjs.map +1 -0
  511. package/dist/node_modules/@openhands/extensions/integrations/index.js +175 -0
  512. package/dist/node_modules/@openhands/extensions/integrations/index.js.map +1 -0
  513. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.cjs +1 -1
  514. package/dist/node_modules/@openhands/extensions/integrations/logos.cjs.map +1 -0
  515. package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.js +2 -2
  516. package/dist/node_modules/@openhands/extensions/integrations/logos.js.map +1 -0
  517. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs +2 -0
  518. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs.map +1 -0
  519. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js +548 -0
  520. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js.map +1 -0
  521. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs +2 -0
  522. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs.map +1 -0
  523. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js +482 -0
  524. package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js.map +1 -0
  525. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  526. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  527. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +3 -0
  528. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  529. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs +2 -0
  530. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs.map +1 -0
  531. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js +22 -0
  532. package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js.map +1 -0
  533. package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
  534. package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -0
  535. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  536. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  537. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +3 -0
  538. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  539. package/dist/package.cjs +1 -1
  540. package/dist/package.cjs.map +1 -1
  541. package/dist/package.js +6 -4
  542. package/dist/package.js.map +1 -1
  543. package/dist/routes/mcp.cjs +1 -1
  544. package/dist/routes/mcp.cjs.map +1 -1
  545. package/dist/routes/mcp.js +1 -1
  546. package/dist/routes/mcp.js.map +1 -1
  547. package/dist/stores/error-message-store.cjs +1 -1
  548. package/dist/stores/error-message-store.cjs.map +1 -1
  549. package/dist/stores/error-message-store.d.ts +10 -1
  550. package/dist/stores/error-message-store.js +16 -3
  551. package/dist/stores/error-message-store.js.map +1 -1
  552. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  553. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  554. package/dist/utils/mcp-marketplace-utils.d.ts +21 -1
  555. package/dist/utils/mcp-marketplace-utils.js +23 -13
  556. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  557. package/dist/utils/settings-utils.cjs.map +1 -1
  558. package/dist/utils/settings-utils.js.map +1 -1
  559. package/package.json +6 -4
  560. package/scripts/check-sdk-version-sync.mjs +6 -6
  561. package/scripts/dev-safe.mjs +25 -7
  562. package/scripts/dev-static.mjs +6 -0
  563. package/scripts/dev-with-automation.mjs +12 -1
  564. package/scripts/static-server.mjs +85 -4
  565. package/tools/canvas_ui_tool.py +129 -0
  566. package/build/assets/add-backend-modal-CqjNjGqY.js +0 -1
  567. package/build/assets/automation-detail-CQrtk33s.js +0 -1
  568. package/build/assets/automations-list-COmogz0S.js +0 -1
  569. package/build/assets/conversation-CeGMBOyB.js +0 -1
  570. package/build/assets/conversation-D8scXOe7.js +0 -17
  571. package/build/assets/conversation-panel-DMz46ji-.js +0 -1
  572. package/build/assets/conversation-websocket-context-B0Gd3yiT.js +0 -3
  573. package/build/assets/declaration-C9nuq2Dj.js +0 -1
  574. package/build/assets/edit-automation-modal-DnTHJrf1.js +0 -1
  575. package/build/assets/git-control-bar-branch-button-DhpPgadK.js +0 -27
  576. package/build/assets/install-server-modal-VB5hOBpW.js +0 -1
  577. package/build/assets/llm-settings-CIdxmimN.js +0 -1
  578. package/build/assets/manifest-6400820c.js +0 -1
  579. package/build/assets/mcp-BdfyCW1l.js +0 -9
  580. package/build/assets/messages-BfaEAG2q.js +0 -36
  581. package/build/assets/recommended-automations-launcher-Cx7svuGE.js +0 -52
  582. package/build/assets/root-6AdVEJBT.js +0 -2
  583. package/build/assets/root-DEotKI6b.css +0 -1
  584. package/build/assets/root-layout-DvYGxAnr.js +0 -2
  585. package/build/assets/settings-service.api-Z6x0l0GU.js +0 -1
  586. package/build/assets/use-is-authed-BFoh8Ogh.js +0 -1
  587. package/build/assets/use-runtime-is-ready-BQWLEyqa.js +0 -1
  588. package/build/assets/use-user-conversation-BCYpbPT1.js +0 -1
  589. package/build/assets/vendor~home~mcp~automations-list-DRfWZRnF.js +0 -1
  590. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js +0 -48
  591. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs +0 -2
  592. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs.map +0 -1
  593. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js +0 -30
  594. package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js.map +0 -1
  595. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs +0 -2
  596. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs.map +0 -1
  597. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js +0 -29
  598. package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js.map +0 -1
  599. package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.cjs.map +0 -1
  600. package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.js.map +0 -1
  601. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs +0 -2
  602. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs.map +0 -1
  603. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js +0 -29
  604. package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js.map +0 -1
  605. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs +0 -2
  606. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs.map +0 -1
  607. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js +0 -24
  608. package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js.map +0 -1
  609. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs +0 -2
  610. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs.map +0 -1
  611. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js +0 -45
  612. package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js.map +0 -1
  613. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.cjs.map +0 -1
  614. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.js.map +0 -1
  615. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs +0 -2
  616. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs.map +0 -1
  617. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.js.map +0 -1
  618. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.cjs.map +0 -1
  619. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.js.map +0 -1
  620. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.cjs.map +0 -1
  621. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.js.map +0 -1
  622. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs +0 -2
  623. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs.map +0 -1
  624. package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.js.map +0 -1
  625. package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.cjs.map +0 -1
  626. package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.js.map +0 -1
  627. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs +0 -2
  628. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs.map +0 -1
  629. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js +0 -29
  630. package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js.map +0 -1
  631. package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.cjs.map +0 -1
  632. package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.js.map +0 -1
  633. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs +0 -2
  634. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs.map +0 -1
  635. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js +0 -29
  636. package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js.map +0 -1
  637. package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.cjs.map +0 -1
  638. package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.js.map +0 -1
  639. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs +0 -2
  640. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs.map +0 -1
  641. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js +0 -33
  642. package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js.map +0 -1
  643. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs +0 -2
  644. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs.map +0 -1
  645. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js +0 -32
  646. package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js.map +0 -1
  647. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs +0 -2
  648. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs.map +0 -1
  649. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js +0 -29
  650. package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js.map +0 -1
  651. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs +0 -2
  652. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs.map +0 -1
  653. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js +0 -33
  654. package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js.map +0 -1
  655. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs +0 -2
  656. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs.map +0 -1
  657. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js +0 -40
  658. package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js.map +0 -1
  659. package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.cjs.map +0 -1
  660. package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.js.map +0 -1
  661. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs +0 -2
  662. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs.map +0 -1
  663. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js +0 -29
  664. package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js.map +0 -1
  665. package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.cjs.map +0 -1
  666. package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.js.map +0 -1
  667. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs +0 -2
  668. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs.map +0 -1
  669. package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.js.map +0 -1
  670. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs +0 -2
  671. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs.map +0 -1
  672. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js +0 -29
  673. package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js.map +0 -1
  674. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs +0 -2
  675. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs.map +0 -1
  676. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js +0 -33
  677. package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js.map +0 -1
  678. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs +0 -2
  679. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs.map +0 -1
  680. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js +0 -32
  681. package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js.map +0 -1
  682. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs +0 -2
  683. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs.map +0 -1
  684. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js +0 -31
  685. package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js.map +0 -1
  686. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs +0 -2
  687. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs.map +0 -1
  688. package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.js.map +0 -1
  689. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs +0 -2
  690. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs.map +0 -1
  691. package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.js.map +0 -1
  692. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs +0 -2
  693. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs.map +0 -1
  694. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js +0 -36
  695. package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js.map +0 -1
  696. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs +0 -2
  697. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs.map +0 -1
  698. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js +0 -34
  699. package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js.map +0 -1
  700. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs +0 -2
  701. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs.map +0 -1
  702. package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.js.map +0 -1
  703. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs +0 -2
  704. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs.map +0 -1
  705. package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.js.map +0 -1
  706. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs +0 -2
  707. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs.map +0 -1
  708. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js +0 -38
  709. package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js.map +0 -1
  710. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs +0 -2
  711. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs.map +0 -1
  712. package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.js.map +0 -1
  713. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs +0 -2
  714. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs.map +0 -1
  715. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js +0 -30
  716. package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js.map +0 -1
  717. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.cjs.map +0 -1
  718. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js +0 -32
  719. package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js.map +0 -1
  720. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs +0 -2
  721. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs.map +0 -1
  722. package/dist/node_modules/@openhands/extensions/mcps/catalog/time.js.map +0 -1
  723. package/dist/node_modules/@openhands/extensions/mcps/index.cjs +0 -2
  724. package/dist/node_modules/@openhands/extensions/mcps/index.cjs.map +0 -1
  725. package/dist/node_modules/@openhands/extensions/mcps/index.js +0 -87
  726. package/dist/node_modules/@openhands/extensions/mcps/index.js.map +0 -1
  727. package/dist/node_modules/@openhands/extensions/mcps/logos.cjs.map +0 -1
  728. package/dist/node_modules/@openhands/extensions/mcps/logos.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./useMutation-B4OUESdw.js";import{o as r,t as i}from"./declaration-D378OjpZ.js";import{n as a}from"./QueryClientProvider-B7kl84Kj.js";import{t as o}from"./useTranslation-CpIcQBq6.js";import{t as s}from"./retrieve-axios-error-message-BY-yIkIq.js";import{n as c,t as l}from"./vendor~home~mcp~automations-list-C5PoHCy6.js";import{r as u}from"./custom-toast-handlers-BOc3qeQ7.js";import{t as d}from"./utils-D-HX7JCe.js";import{t as f}from"./agent-server-client-options-DT2GP6VJ.js";import{l as p}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-CHrEOFl6.js";import{a as m}from"./query-keys-tAsQcc_9.js";import{t as h}from"./modal-backdrop-DTYGVmOR.js";import{t as g}from"./brand-button-C2nEKopC.js";import{t as _}from"./modal-close-button-C_GpQt9F.js";import{t as v}from"./settings-input-DBywAnA7.js";import{t as y}from"./settings-service.api-FvJGK45W.js";import{a as b,i as x,r as S}from"./use-settings-DQ7Oo1Hj.js";function C(e){return[...e.sse_servers.map((e,t)=>({id:`sse-${t}`,type:`sse`,url:typeof e==`string`?e:e.url,api_key:typeof e==`object`?e.api_key:void 0})),...e.stdio_servers.map((e,t)=>({id:`stdio-${t}`,type:`stdio`,name:e.name,command:e.command,args:e.args,env:e.env})),...e.shttp_servers.map((e,t)=>({id:`shttp-${t}`,type:`shttp`,url:typeof e==`string`?e:e.url,api_key:typeof e==`object`?e.api_key:void 0,timeout:typeof e==`object`?e.timeout:void 0}))]}var w=e(t(),1),T=r(),E=e=>{try{return new URL(e)}catch{return null}};function D(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;if(!n||!r)return!1;let i=E(n),a=E(r);return!i||!a?n.replace(/\/+$/,``)===r.replace(/\/+$/,``):i.protocol===a.protocol&&i.host===a.host&&i.pathname.replace(/\/+$/,``)===a.pathname.replace(/\/+$/,``)}function O(e){return(e.connectionOptions.find(t=>t.id===e.defaultConnectionOptionId)??e.connectionOptions[0])?.transport}function k(e){let t=e.connectionOptions.find(e=>e.transport?.kind===`stdio`);return t?.transport?t.transport:O(e)}function A(e,t){if(e.kind===`shttp`){let n=e.url;return n?t.find(e=>e.type===`shttp`&&!!e.url&&D(e.url,n))??null:null}if(e.kind===`sse`){let n=e.url;return n?t.find(e=>e.type===`sse`&&!!e.url&&D(e.url,n))??null:null}return t.find(t=>t.type===`stdio`&&t.name===e.serverName)??null}function j(e,t){return!e.runtimeAvailability||e.runtimeAvailability===`all`?!0:e.runtimeAvailability===t}function M(e){return e.trim().toLowerCase()}function N(e){return e.map((e,t)=>({entry:e,index:t})).sort((e,t)=>(t.entry.popularityRank??0)-(e.entry.popularityRank??0)||e.index-t.index).map(({entry:e})=>e)}function P(e,t){return t.find(t=>t.id===e)}function F(e,t){let n=M(t);return n?[e.name,e.description,e.id,...e.keywords??[]].join(` `).toLowerCase().includes(n):!0}function I(e,t,n){let r=M(n);return r?[e.type,`name`in e?e.name:void 0,`command`in e?e.command:void 0,`args`in e?e.args?.join(` `):void 0,`url`in e?e.url:void 0,t?.name,t?.description,t?.id,...t?.keywords??[]].filter(Boolean).join(` `).toLowerCase().includes(r):!0}function L(e,t){return t.find(t=>{for(let n of t.connectionOptions){let t=n.transport;if(t&&(t.kind===`stdio`&&e.type===`stdio`&&e.name===t.serverName||t.kind===`shttp`&&e.type===`shttp`&&D(e.url,t.url)||t.kind===`sse`&&e.type===`sse`&&D(e.url,t.url)))return!0}return!1})}var R={xs:`h-4 w-4 rounded [&>svg]:h-2.5 [&>svg]:w-2.5`,sm:`h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3`,md:`h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5`};function z({entry:e,size:t=`md`,className:n,fallback:r,testId:i}){return(0,T.jsx)(`span`,{"aria-hidden":`true`,title:e?.name,"data-testid":i,className:d(`inline-flex shrink-0 items-center justify-center overflow-hidden`,`border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,R[t],n),style:{backgroundColor:e?.iconBg??`var(--oh-color-tertiary)`,color:e?.iconColor??`#FFFFFF`},children:e?c[e.id]??r??l:r??l})}function B(){let e=a(),{data:t}=S();return n({mutationFn:async e=>{if(!t)return;let n=x(t.agent_settings?.mcp_config),r={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]};if(e.type===`sse`){let t={url:e.url,...e.api_key&&{api_key:e.api_key}};r.sse_servers.push(t)}else if(e.type===`stdio`){let t={name:e.name,command:e.command,...e.args&&{args:e.args},...e.env&&{env:e.env}};r.stdio_servers.push(t)}else if(e.type===`shttp`){let t={url:e.url,...e.api_key&&{api_key:e.api_key},...e.timeout!==void 0&&{timeout:e.timeout}};r.shttp_servers.push(t)}await y.saveSettings({agent_settings_diff:{mcp_config:b(r)}})},onSuccess:()=>{e.invalidateQueries({queryKey:m.personal()})}})}function V(e){return e.type===`stdio`?{type:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{type:e.type,url:e.url,...e.api_key?{api_key:e.api_key}:{}}}var H=class{static async testServer(e){let{host:t,apiKey:n}=f(),r=new p({host:t,...n?{apiKey:n}:{}});try{return await r.testServer({server:V(e),...e.name?{name:e.name}:{},...e.timeout?{timeout:e.timeout}:{}})}finally{r.close()}}};function U(){return n({mutationFn:e=>H.testServer(e)})}function W(e){let t={},n=k(e);if(!n)return{values:t,errors:{}};if(n.kind===`stdio`){for(let e of n.envFields??[])t[e.key]=``;for(let e of n.argFields??[])t[e.key]=``}else (n.kind===`shttp`||n.kind===`sse`)&&(t.api_key=``);return{values:t,errors:{}}}function G({entry:e,onClose:t,onSuccess:n}){let{t:r}=o(`openhands`),{mutate:a,isPending:c}=B(),{mutate:l,isPending:d}=U(),f=(0,w.useId)(),[p,m]=w.useState(()=>W(e)),[y,b]=w.useState(null),x=d||c,S=(e,t)=>{m(n=>({values:{...n.values,[e]:t},errors:{...n.errors,[e]:null}})),b(null)},C=e=>{switch(e.error_kind){case`timeout`:return r(i.MCP$TEST_ERROR_TIMEOUT);case`connection`:return r(i.MCP$TEST_ERROR_CONNECTION);default:return r(i.MCP$TEST_ERROR_UNKNOWN,{error:e.error})}},E=o=>{l(o,{onSuccess:c=>{if(!c.ok){b(C(c));return}a(o,{onSuccess:()=>{u(r(i.MCP$INSTALL_SUCCESS)),n?.(e),t()},onError:e=>{b(s(e)||r(i.ERROR$GENERIC))}})},onError:e=>{b(s(e)||r(i.ERROR$GENERIC))}})},D=k(e),O=()=>{if(!D||D.kind!==`shttp`&&D.kind!==`sse`)return;let e=p.values.api_key?.trim()??``;if(!D.apiKeyOptional&&!e){m(e=>({...e,errors:{api_key:r(i.MCP$ERROR_FIELD_REQUIRED)}}));return}E({id:`${D.kind}-${f}`,type:D.kind,url:D.url,...e&&{api_key:e}})},A=()=>{if(D?.kind!==`stdio`)return;let e=D,t={};for(let n of e.envFields??[])n.required&&!(p.values[n.key]??``).trim()&&(t[n.key]=r(i.MCP$ERROR_FIELD_REQUIRED));for(let n of e.argFields??[])n.required&&!(p.values[n.key]??``).trim()&&(t[n.key]=r(i.MCP$ERROR_FIELD_REQUIRED));if(Object.values(t).some(Boolean)){m(e=>({...e,errors:t}));return}let n={};for(let t of e.envFields??[]){let e=p.values[t.key]?.trim();e&&(n[t.key]=e)}let a=[];for(let t of e.argFields??[]){let e=p.values[t.key]?.trim();if(e)for(let t of e.split(/\s+/))t&&a.push(t)}E({id:`stdio-${f}`,type:`stdio`,name:e.serverName,command:e.command,args:[...e.args,...a],...Object.keys(n).length>0&&{env:n}})};return(0,T.jsx)(h,{onClose:t,"aria-label":e.name,children:(0,T.jsxs)(`form`,{"data-testid":`mcp-install-modal`,"data-marketplace-id":e.id,onSubmit:e=>(e.preventDefault(),b(null),D?.kind===`shttp`||D?.kind===`sse`?O():A()),className:`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar`,children:[(0,T.jsx)(_,{onClose:t,testId:`mcp-install-modal-close`,disabled:x}),(0,T.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,T.jsx)(z,{entry:e}),(0,T.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,T.jsx)(`h2`,{className:`text-lg font-semibold`,children:e.name}),(0,T.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.description})]})]}),e.installHint&&(0,T.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.installHint}),e.docsUrl&&(0,T.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-xs text-[var(--oh-muted)] hover:text-white hover:underline self-start transition-colors`,children:r(i.MCP$VIEW_DOCS)}),(0,T.jsx)(`div`,{className:`flex flex-col gap-3`,children:(()=>{if(!D)return null;if(D.kind===`shttp`||D.kind===`sse`){let e=D.apiKeyOptional??!1;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(v,{testId:`mcp-install-field-url`,name:`url`,type:`url`,label:r(i.SETTINGS$MCP_URL),value:D.url,onChange:()=>{},isDisabled:!0,className:`w-full`}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(v,{testId:`mcp-install-field-api_key`,name:`api_key`,type:`password`,label:r(i.SETTINGS$MCP_API_KEY),value:p.values.api_key??``,onChange:e=>S(`api_key`,e),placeholder:r(i.SETTINGS$MCP_API_KEY_PLACEHOLDER),showOptionalTag:e,required:!e,className:`w-full`}),p.errors.api_key&&(0,T.jsx)(`p`,{className:`text-xs text-red-500`,children:p.errors.api_key})]})]})}let e=D;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(v,{testId:`mcp-install-field-command-readonly`,name:`command-readonly`,type:`text`,label:r(i.MCP$COMMAND_LABEL),value:`${e.command} ${e.args.join(` `)}`.trim(),onChange:()=>{},isDisabled:!0,className:`w-full`}),(e.envFields??[]).map(e=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(v,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:p.values[e.key]??``,onChange:t=>S(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,T.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:e.helperText}),p.errors[e.key]&&(0,T.jsx)(`p`,{className:`text-xs text-red-500`,children:p.errors[e.key]})]},e.key)),(e.argFields??[]).map(e=>(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(v,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:p.values[e.key]??``,onChange:t=>S(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,T.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:e.helperText}),p.errors[e.key]&&(0,T.jsx)(`p`,{className:`text-xs text-red-500`,children:p.errors[e.key]})]},e.key))]})})()}),y&&(0,T.jsx)(`p`,{"data-testid":`mcp-install-modal-error`,className:`text-sm text-red-500 whitespace-pre-wrap`,children:y}),(0,T.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,T.jsx)(g,{type:`button`,variant:`secondary`,onClick:t,testId:`mcp-install-cancel`,children:r(i.BUTTON$CANCEL)}),(0,T.jsx)(g,{type:`submit`,variant:`primary`,isDisabled:x,testId:`mcp-install-submit`,children:r(d?i.MCP$VERIFYING:c?i.SETTINGS$SAVING:i.MCP$INSTALL_BUTTON)})]})]})})}export{L as a,k as c,I as d,j as f,z as i,N as l,C as m,U as n,A as o,F as p,B as r,O as s,G as t,P as u};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{I as n,L as r,M as i}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as a,t as o}from"./declaration-C9nuq2Dj.js";import{t as s}from"./useTranslation-01pF7z10.js";import{t as c}from"./utils-Czcl6buL.js";import{t as l}from"./modal-backdrop-B04pVYAD.js";import{r as u,t as d}from"./modal-body-CgUoFQA1.js";import{t as f}from"./brand-button-8fVVei4i.js";import{t as p}from"./modal-close-button-SM_WXzDY.js";import{t as m}from"./settings-input-BWCZt9g2.js";import{t as h}from"./use-create-conversation-BWFA_FId.js";import{r as g}from"./typography-BbaUAC4V.js";import{n as _,t as v}from"./vendor~launch-Dg--Ssk6.js";var y=e(t(),1),b=a();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:c}=s(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(o.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(o.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=s(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(o.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6 text-content-2`,children:[a(o.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:c(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(o.LAUNCH$ADDITIONAL_PLUGINS):a(o.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(o.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?o.LAUNCH$STARTING:o.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=s(`openhands`),i={no_plugins:r(o.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(o.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(o.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(o.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(o.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(o.LAUNCH$TRY_AGAIN)})]})]})})}var D=r(function(){let[e]=n(),t=i(),{t:r}=s(`openhands`),a=h(),[c,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,n)=>{l(null);try{t(`/conversations/${(await a.mutateAsync({plugins:e,query:n})).conversation_id}`)}catch{l(r(o.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):c?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:a.isPending,onStartConversation:d,onClose:f})})});export{D as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{I as n,L as r,M as i}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as a,t as o}from"./declaration-D378OjpZ.js";import{t as s}from"./useTranslation-CpIcQBq6.js";import{t as c}from"./utils-D-HX7JCe.js";import{t as l}from"./modal-backdrop-DTYGVmOR.js";import{r as u,t as d}from"./modal-body-YElmM1dV.js";import{t as f}from"./brand-button-C2nEKopC.js";import{t as p}from"./modal-close-button-C_GpQt9F.js";import{t as m}from"./settings-input-DBywAnA7.js";import{t as h}from"./use-create-conversation-DW7AGgLA.js";import{r as g}from"./typography-vVUMoNUg.js";import{n as _,t as v}from"./vendor~launch-Dg--Ssk6.js";var y=e(t(),1),b=a();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:c}=s(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(o.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[c(o.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=s(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(o.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:c(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6 text-content-2`,children:[a(o.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:c(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(o.LAUNCH$ADDITIONAL_PLUGINS):a(o.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(o.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?o.LAUNCH$STARTING:o.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=s(`openhands`),i={no_plugins:r(o.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(o.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(o.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(o.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(o.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(o.LAUNCH$TRY_AGAIN)})]})]})})}var D=r(function(){let[e]=n(),t=i(),{t:r}=s(`openhands`),a=h(),[c,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,n)=>{l(null);try{t(`/conversations/${(await a.mutateAsync({plugins:e,query:n})).conversation_id}`)}catch{l(r(o.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):c?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:a.isPending,onStartConversation:d,onClose:f})})});export{D as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-C9nuq2Dj.js";e();var n=t(),r=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:109,height:109,viewBox:`0 0 109 109`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M40.1979 21.8969L34.7311 17.832L25.2691 30.5574L20.2094 26.784L16.1367 32.2451L26.6653 40.0969L40.1979 21.8969Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M90.8342 35.1983H50.4639V28.3858H90.8342V35.1983Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M90.8342 57.9067H50.4638V51.0942H90.8342V57.9067Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M27.2508 63.5837C32.2674 63.5837 36.3342 59.517 36.3342 54.5004C36.3342 49.4838 32.2674 45.4171 27.2508 45.4171C22.2342 45.4171 18.1675 49.4838 18.1675 54.5004C18.1675 59.517 22.2342 63.5837 27.2508 63.5837ZM27.2508 59.0421C29.7591 59.0421 31.7925 57.0087 31.7925 54.5004C31.7925 51.9921 29.7591 49.9587 27.2508 49.9587C24.7425 49.9587 22.7092 51.9921 22.7092 54.5004C22.7092 57.0087 24.7425 59.0421 27.2508 59.0421Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M36.3342 77.2087C36.3342 82.2253 32.2674 86.2921 27.2508 86.2921C22.2342 86.2921 18.1675 82.2253 18.1675 77.2087C18.1675 72.1922 22.2342 68.1254 27.2508 68.1254C32.2674 68.1254 36.3342 72.1922 36.3342 77.2087ZM31.7925 77.2087C31.7925 79.717 29.7591 81.7504 27.2508 81.7504C24.7425 81.7504 22.7092 79.717 22.7092 77.2087C22.7092 74.7005 24.7425 72.6671 27.2508 72.6671C29.7591 72.6671 31.7925 74.7005 31.7925 77.2087Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M50.4637 80.615H90.834V73.8025H50.4637V80.615Z`,fill:`currentColor`})]});export{r as t};
1
+ import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-D378OjpZ.js";e();var n=t(),r=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:109,height:109,viewBox:`0 0 109 109`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M40.1979 21.8969L34.7311 17.832L25.2691 30.5574L20.2094 26.784L16.1367 32.2451L26.6653 40.0969L40.1979 21.8969Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M90.8342 35.1983H50.4639V28.3858H90.8342V35.1983Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M90.8342 57.9067H50.4638V51.0942H90.8342V57.9067Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M27.2508 63.5837C32.2674 63.5837 36.3342 59.517 36.3342 54.5004C36.3342 49.4838 32.2674 45.4171 27.2508 45.4171C22.2342 45.4171 18.1675 49.4838 18.1675 54.5004C18.1675 59.517 22.2342 63.5837 27.2508 63.5837ZM27.2508 59.0421C29.7591 59.0421 31.7925 57.0087 31.7925 54.5004C31.7925 51.9921 29.7591 49.9587 27.2508 49.9587C24.7425 49.9587 22.7092 51.9921 22.7092 54.5004C22.7092 57.0087 24.7425 59.0421 27.2508 59.0421Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M36.3342 77.2087C36.3342 82.2253 32.2674 86.2921 27.2508 86.2921C22.2342 86.2921 18.1675 82.2253 18.1675 77.2087C18.1675 72.1922 22.2342 68.1254 27.2508 68.1254C32.2674 68.1254 36.3342 72.1922 36.3342 77.2087ZM31.7925 77.2087C31.7925 79.717 29.7591 81.7504 27.2508 81.7504C24.7425 81.7504 22.7092 79.717 22.7092 77.2087C22.7092 74.7005 24.7425 72.6671 27.2508 72.6671C29.7591 72.6671 31.7925 74.7005 31.7925 77.2087Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M50.4637 80.615H90.834V73.8025H50.4637V80.615Z`,fill:`currentColor`})]});export{r as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-C9nuq2Dj.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.565 6.435L16.065 1.935L15 1.5H6L4.5 3V21L6 22.5H19.5L21 21V7.5L20.565 6.435ZM19.5 21H6V3H13.5V9H19.5V21ZM15 7.5V3L19.5 7.5H15Z`,fill:`currentColor`})}),i=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M2.25 1.5H9V3H3V21H21V15H22.5V21.75L21.75 22.5H2.25L1.5 21.75V2.25L2.25 1.5Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M22.5 2.25V12H21V4.0605L10.8645 14.1975L9.80402 13.1355L19.9395 3H12V1.5H21.75L22.5 2.25Z`,fill:`currentColor`})]});export{r as n,i as t};
1
+ import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-D378OjpZ.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.565 6.435L16.065 1.935L15 1.5H6L4.5 3V21L6 22.5H19.5L21 21V7.5L20.565 6.435ZM19.5 21H6V3H13.5V9H19.5V21ZM15 7.5V3L19.5 7.5H15Z`,fill:`currentColor`})}),i=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M2.25 1.5H9V3H3V21H21V15H22.5V21.75L21.75 22.5H2.25L1.5 21.75V2.25L2.25 1.5Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M22.5 2.25V12H21V4.0605L10.8645 14.1975L9.80402 13.1355L19.9395 3H12V1.5H21.75L22.5 2.25Z`,fill:`currentColor`})]});export{r as n,i as t};
@@ -1 +1 @@
1
- import{o as e}from"./agent-server-client-options-8OJSXbm8.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async getProviders(){return(await this.client.get(`/api/llm/providers`)).data.providers}async getModels(e){return(await this.client.get(`/api/llm/models`,{params:e?{provider:e}:void 0})).data.models}async getVerifiedModels(){return(await this.client.get(`/api/llm/models/verified`)).data.models}close(){this.client.close()}};export{t};
1
+ import{o as e}from"./agent-server-client-options-DT2GP6VJ.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async getProviders(){return(await this.client.get(`/api/llm/providers`)).data.providers}async getModels(e){return(await this.client.get(`/api/llm/models`,{params:e?{provider:e}:void 0})).data.models}async getVerifiedModels(){return(await this.client.get(`/api/llm/models/verified`)).data.models}close(){this.client.close()}};export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./llm-settings-CcHqGOYL.js";export{e as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./react-dom-hVBnwgwZ.js";import{t as i}from"./useMutation-CRJwk4cR.js";import{o as a,t as o}from"./declaration-C9nuq2Dj.js";import{n as s}from"./QueryClientProvider-DITRCGAK.js";import{t as c}from"./useTranslation-01pF7z10.js";import{t as l}from"./createLucideIcon-Ddu8jDOQ.js";import{i as u,n as d,r as f,t as p,u as m}from"./settings-list-classes-xMleGkTC.js";import{n as h,r as g}from"./custom-toast-handlers-BYxhSr3t.js";import{t as _}from"./utils-Czcl6buL.js";import{n as v}from"./active-backend-context-CkP3ZEJs.js";import{a as y,n as b}from"./query-keys-tAsQcc_9.js";import{t as x}from"./modal-backdrop-B04pVYAD.js";import{r as S,t as C}from"./modal-body-CgUoFQA1.js";import{r as w}from"./base-modal-B4HvlFHE.js";import{t as T}from"./brand-button-8fVVei4i.js";import{t as E}from"./loading-spinner-91b5FiMQ.js";import{n as D,t as O}from"./model-selector-7id-Uirf.js";import{t as k}from"./settings-input-BWCZt9g2.js";import{t as A}from"./settings-D5am1n6X.js";import{t as j}from"./settings-service.api-Z6x0l0GU.js";import{r as ee}from"./use-settings-DzG0C3vO.js";import{i as te,r as M,t as N}from"./ellipsis-button-BoU2-xlG.js";import{t as P}from"./u-edit-BPFJBd34.js";import{n as F,t as I}from"./use-llm-profiles-CAIzHJDX.js";import{r as ne}from"./typography-BbaUAC4V.js";import{l as L,s as re}from"./sdk-settings-schema-BY8dOy3a.js";import{t as ie}from"./use-agent-settings-schema-BbtOsR7P.js";import{t as ae}from"./sdk-section-page-03k88tIR.js";import{t as oe}from"./u-check-circle-DHGiAi-w.js";import{n as se}from"./settings-section-header-context-1wfkgjZZ.js";var ce=l(`text-cursor`,[[`path`,{d:`M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1`,key:`uvaxm9`}],[`path`,{d:`M7 22h1a4 4 0 0 0 4-4v-1`,key:`11xy8d`}],[`path`,{d:`M7 2h1a4 4 0 0 1 4 4v1`,key:`1uw06m`}]]),R=e(t()),z=a(),B=e=>(0,z.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M9.9509 15.588H10.8349L16.5125 9.91042L15.6285 9.0264L10.3991 14.2681L8.00867 11.8777L7.12465 12.7617L9.9509 15.588Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.8521 3.29895C14.8443 3.42346 16.712 4.41954 18.0816 5.78916C19.7002 7.53231 20.5718 9.64898 20.5718 12.1392C20.5718 14.1314 19.8247 15.999 18.5796 17.6177C17.3345 19.1118 15.5914 20.2324 13.5992 20.6059C11.607 20.9794 9.61486 20.7304 7.87171 19.7343C6.12856 18.7382 4.75895 17.2441 4.01189 15.3765C3.26482 13.5088 3.14031 11.3921 3.76286 9.52447C4.38542 7.53231 5.50601 5.91367 7.24916 4.79308C8.86779 3.67248 10.86 3.17444 12.8521 3.29895ZM13.4747 19.3608C15.0933 18.9873 16.5874 18.1157 17.708 16.7461C18.7041 15.3765 19.3267 13.7578 19.2022 12.0147C19.2022 10.0225 18.4551 8.03035 17.0855 6.66073C15.8404 5.41563 14.3463 4.66857 12.6031 4.54405C10.9845 4.41954 9.24132 4.79308 7.87171 5.78916C6.50209 6.78524 5.50601 8.15486 5.00797 9.89801C4.50993 11.5166 4.50993 13.2598 5.25699 14.8784C6.00405 16.4971 7.12465 17.7422 8.61877 18.6137C10.1129 19.4853 11.856 19.7343 13.4747 19.3608Z`,fill:`currentColor`})]});function V({testId:e,isSet:t}){return(0,z.jsx)(`span`,{"data-testid":e||(t?`set-indicator`:`unset-indicator`),children:(0,z.jsx)(B,{className:_(t?`text-success`:`text-danger`)})})}var H=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function U(e,{isRequired:t=!1}={}){return e===``?!t:H.test(e)}function W(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var G=(0,R.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:r,onKeyDown:i,placeholder:a,isDisabled:s,isOptional:l,isRequired:u=!1},d){let{t:f}=c(`openhands`),p=U(n,{isRequired:u}),m=l?`${f(o.SETTINGS$PROFILE_NAME_LABEL)} (${f(o.COMMON$OPTIONAL)})`:f(o.SETTINGS$PROFILE_NAME_LABEL),h=R.useId(),g=t??`${h}-rule`;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(k,{ref:d,testId:e,label:m,type:`text`,className:`w-full`,value:n,placeholder:a??f(o.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:r,onKeyDown:i,isDisabled:s,ariaDescribedBy:g,ariaInvalid:!p}),(0,z.jsx)(`p`,{id:g,"data-testid":t,className:_(`text-xs`,p?`text-[var(--oh-muted)]`:`text-red-400`),children:f(o.SETTINGS$PROFILE_NAME_RULE)})]})});function K({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:a,initialFocusRef:o}){let s=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!e)return;let t=o?.current??s.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,o]),(0,R.useEffect)(()=>{if(!e||!s.current)return;let t=s.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,z.jsx)(x,{onClose:a,children:(0,z.jsxs)(`div`,{ref:s,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:_(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,S(n),C),children:[(0,z.jsx)(w,{id:`modal-title`,title:t,className:`text-xl font-medium text-white`}),r,(0,z.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function le(){let e=s();return i({mutationFn:({name:e,newName:t})=>F.renameProfile(e,t),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function ue({profile:e,onClose:t}){let{t:n}=c(`openhands`),[r,i]=(0,R.useState)(``),a=le(),s=(0,R.useRef)(null);if((0,R.useEffect)(()=>{i(e?.name??``)},[e?.name]),!e)return null;let l=U(r,{isRequired:!0}),u=r===e.name,d=async()=>{if(!l){h(n(o.SETTINGS$PROFILE_NAME_RULE));return}if(u){t();return}try{await a.mutateAsync({name:e.name,newName:r}),g(n(o.SETTINGS$PROFILE_RENAMED,{name:r})),t()}catch(e){h(e instanceof Error?e.message:n(o.ERROR$GENERIC))}},f=()=>{a.isPending||t()},p=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T,{type:`button`,variant:`tertiary`,onClick:f,isDisabled:a.isPending,children:n(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`rename-profile-submit`,type:`button`,variant:`primary`,onClick:d,isDisabled:a.isPending||!l,children:a.isPending?(0,z.jsx)(E,{size:`small`}):n(o.BUTTON$RENAME)})]});return(0,z.jsx)(K,{isOpen:!0,title:n(o.SETTINGS$PROFILE_RENAME_TITLE),footer:p,onClose:f,initialFocusRef:s,children:(0,z.jsx)(`div`,{"data-testid":`rename-profile-modal`,className:`flex flex-col gap-3`,children:(0,z.jsx)(G,{ref:s,testId:`rename-profile-input`,ruleTestId:`rename-profile-rule`,value:r,onChange:i,isRequired:!0,onKeyDown:e=>{e.key===`Enter`&&!a.isPending&&l&&d()}})})})}function de(){let e=s();return i({mutationFn:e=>F.deleteProfile(e),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function fe({profile:e,onClose:t}){let{t:n}=c(`openhands`),r=de(),i=(0,R.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),g(n(o.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){h(e instanceof Error?e.message:n(o.ERROR$GENERIC))}},s=()=>{r.isPending||t()},l=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T,{ref:i,type:`button`,variant:`tertiary`,onClick:s,isDisabled:r.isPending,children:n(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`delete-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E,{size:`small`}),(0,z.jsx)(`span`,{className:`sr-only`,children:n(o.BUTTON$DELETE)})]}):n(o.BUTTON$DELETE)})]});return(0,z.jsx)(K,{isOpen:!0,title:n(o.SETTINGS$PROFILE_DELETE_TITLE),footer:l,onClose:s,initialFocusRef:i,children:(0,z.jsx)(`p`,{className:`text-sm break-all`,children:n(o.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}var pe=e(r(),1);function q({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:a,disabled:o,testId:s}){return(0,z.jsx)(`button`,{ref:t=>{a.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:o,className:_(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":s,children:(0,z.jsx)(te,{icon:t,text:n})})}function me({onEdit:e,onRename:t,onSetActive:n,onDelete:r,isActive:i,isActivating:a,onClose:s,anchorRef:l}){let{t:u}=c(`openhands`),d=(0,R.useRef)(null),f=(0,R.useRef)([]),p=l?.current??null,[m,h]=(0,R.useState)();(0,R.useLayoutEffect)(()=>{if(!p)return;let e=()=>{let e=p.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[p]),(0,R.useEffect)(()=>{f.current[0]?.focus()},[]),(0,R.useEffect)(()=>{let e=e=>{let t=e.target;d.current&&!d.current.contains(t)&&s()},t=e=>{e.key===`Escape`&&s()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[s]);let g=e=>{e(),s()},v=(0,R.useCallback)((e,t)=>{if(e.key===`Tab`){s();return}let n=f.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;f.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;f.current[r]?.focus()}},[s]),y=i||a,b=!!p,x=(0,z.jsxs)(`div`,{ref:d,className:_(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`profile-actions-menu`,children:[(0,z.jsx)(q,{index:0,icon:(0,z.jsx)(P,{width:16,height:16}),label:u(o.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:f,testId:`profile-edit`}),(0,z.jsx)(q,{index:1,icon:(0,z.jsx)(ce,{"aria-hidden":!0,className:`size-4`,strokeWidth:2}),label:u(o.BUTTON$RENAME),onClick:()=>g(t),onKeyDown:v,menuItemsRef:f,testId:`profile-rename`}),(0,z.jsx)(q,{index:2,icon:(0,z.jsx)(oe,{width:16,height:16}),label:u(o.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:f,disabled:y,testId:`profile-set-active`}),(0,z.jsx)(q,{index:3,icon:(0,z.jsx)(M,{width:16,height:16}),label:u(o.BUTTON$DELETE),onClick:()=>g(r),onKeyDown:v,menuItemsRef:f,testId:`profile-delete`})]});return b?typeof document>`u`||!m?null:pe.createPortal((0,z.jsx)(`div`,{style:m,children:x}),document.body):x}function he({children:e,className:t,...n}){return(0,z.jsx)(`span`,{className:_(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}function ge({profile:e,isActive:t,onActivate:n,onEdit:r,onRename:i,onDelete:a,isActivating:s}){let{t:l}=c(`openhands`),[d,p]=(0,R.useState)(!1),m=(0,R.useRef)(null);return(0,z.jsxs)(`div`,{"data-testid":`profile-row`,className:_(u,`justify-between gap-3`),children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),e.model?(0,z.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:e.model,children:e.model}):null,t&&(0,z.jsx)(he,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`profile-active-badge`,children:l(o.SETTINGS$PROFILE_ACTIVE)})]}),(0,z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,z.jsx)(N,{ref:m,onClick:()=>p(e=>!e),ariaLabel:l(o.SETTINGS$PROFILE_MENU),testId:`profile-menu-trigger`,className:f}),d&&(0,z.jsx)(me,{anchorRef:m,onEdit:()=>r(e),onRename:()=>i(e),onSetActive:()=>n(e.name),onDelete:()=>a(e),isActive:t,isActivating:s,onClose:()=>p(!1)})]})]})}function _e({isLoading:e,loadError:t,profiles:n,active:r,onActivate:i,onEdit:a,onRename:s,onDelete:l,isActivating:u}){let{t:f}=c(`openhands`);return e?(0,z.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,z.jsx)(E,{size:`large`})}):t?(0,z.jsx)(`p`,{className:`text-sm text-red-400`,children:f(o.SETTINGS$PROFILES_LOAD_ERROR)}):n.length===0?(0,z.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)] italic`,children:f(o.SETTINGS$PROFILES_EMPTY)}):(0,z.jsx)(`div`,{className:_(p,d),children:n.map(e=>(0,z.jsx)(ge,{profile:e,isActive:e.name===r,onActivate:i,onEdit:a,onRename:s,onDelete:l,isActivating:u},e.name))})}function J(){let e=s();return i({mutationFn:e=>F.activateProfile(e),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function Y({onAddProfile:e,onEditProfile:t}){let{t:n}=c(`openhands`),{data:r,isLoading:i,error:a}=I(),s=J(),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),p=r?.profiles??[],m=r?.active_profile??null;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,z.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(o.SETTINGS$AVAILABLE_PROFILES)}),e?(0,z.jsx)(T,{testId:`add-llm-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(o.SETTINGS$ADD_LLM_PROFILE)}):null]}),(0,z.jsx)(_e,{isLoading:i,loadError:a??null,profiles:p,active:m,onActivate:async e=>{try{await s.mutateAsync(e),g(n(o.SETTINGS$PROFILE_ACTIVATED,{name:e}))}catch(e){console.error(`Failed to activate profile:`,e),h(n(o.ERROR$GENERIC))}},onEdit:e=>{t?.(e)},onRename:u,onDelete:f,isActivating:s.isPending})]}),(0,z.jsx)(ue,{profile:l,onClose:()=>u(null)}),(0,z.jsx)(fe,{profile:d,onClose:()=>f(null)})]})}function X(){let e=s();return i({mutationFn:({name:e,request:t})=>F.saveProfile(e,t),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function ve(){let{t:e}=c(`openhands`),{setHideSectionHeader:t}=se(),n=X(),{data:r}=I(),[i,a]=(0,R.useState)(`list`),[s,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null),[_,v]=(0,R.useState)(!1);(0,R.useEffect)(()=>(t(i!==`list`),()=>t(!1)),[i,t]);let y=(0,R.useMemo)(()=>new Set(r?.profiles.map(e=>e.name)??[]),[r]),b=(0,R.useMemo)(()=>!(!U(s,{isRequired:!0})||i===`create`&&y.has(s)||i===`edit`&&s!==u?.profile.name&&y.has(s)),[s,i,y,u?.profile.name]),x=(0,R.useCallback)(()=>{l(``),d(null),a(`create`)},[]),S=(0,R.useCallback)(async t=>{try{let e=(await F.getProfile(t.name,`encrypted`)).config??{};d({profile:t,initialValues:{"llm.model":e.model??``,"llm.api_key":e.api_key??``,"llm.base_url":e.base_url??``}}),l(t.name),a(`edit`)}catch(t){console.error(`Failed to fetch profile details:`,t),h(e(o.ERROR$GENERIC))}},[e]),C=(0,R.useCallback)(()=>{a(`list`),d(null),l(``),p(null)},[]),w=(0,R.useCallback)(e=>{if(p(e),i===`create`&&!s){let t=e.values[`llm.model`];if(typeof t==`string`&&t){let e=W(t);y.has(e)||l(e)}}},[i,s,y]),E=(0,R.useCallback)(async()=>{if(!f||!b)return;let t=f.values,a=typeof t[`llm.model`]==`string`?t[`llm.model`]:``,c=typeof t[`llm.api_key`]==`string`?t[`llm.api_key`]:``,l=typeof t[`llm.base_url`]==`string`?t[`llm.base_url`]:``;if(!a){h(e(o.SETTINGS$MODEL_REQUIRED));return}let d=s.trim(),p=u?.profile.name,m=i===`edit`&&p&&p!==d,_=r?.active_profile===p;v(!0);try{m&&await F.renameProfile(p,d);let t={model:a};c?t.api_key=c:i===`edit`&&u?.initialValues[`llm.api_key`]&&(t.api_key=u.initialValues[`llm.api_key`]),l&&(t.base_url=l),await n.mutateAsync({name:d,request:{llm:t,include_secrets:!0}}),m&&_&&await F.activateProfile(d),g(e(i===`create`?o.SETTINGS$PROFILE_CREATED:o.SETTINGS$PROFILE_UPDATED,{name:d})),C()}catch(t){console.error(`Failed to save profile:`,t),h(e(o.ERROR$GENERIC))}finally{v(!1)}},[f,b,s,i,u,r?.active_profile,n,e,C]);if(i===`list`)return(0,z.jsx)(Y,{onAddProfile:x,onEditProfile:S});let D=e(i===`edit`?o.SETTINGS$EDIT_LLM_PROFILE:o.SETTINGS$ADD_LLM_PROFILE),O=i===`edit`&&u?e(o.SETTINGS$PROFILE_LOADED,{name:u.profile.name}):e(o.SETTINGS$PROFILE_SAVE_HINT);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:C,className:`flex items-center gap-2 self-start rounded-lg p-2 text-[var(--oh-muted)] transition-colors hover:bg-tertiary hover:text-white`,"data-testid":`back-to-profiles`,children:[(0,z.jsx)(m,{size:20,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`text-sm leading-5`,children:e(o.BUTTON$BACK)})]}),(0,z.jsx)(ne.H2,{testId:`profile-editor-title`,children:D}),(0,z.jsx)(`p`,{"data-testid":`profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:O})]}),(0,z.jsx)(G,{testId:`profile-name-input`,value:s,onChange:l,isRequired:!0}),(0,z.jsx)($,{embedded:!0,hideSaveButton:!0,initialValueOverrides:i===`edit`&&u?.initialValues?u.initialValues:{"llm.model":``,"llm.api_key":``,"llm.base_url":``},onSaveControlChange:w},i===`edit`?`edit-${u?.profile.name}`:`new-profile`),(0,z.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4 border-t border-[var(--oh-border)]`,children:[(0,z.jsx)(T,{testId:`cancel-profile-btn`,type:`button`,variant:`tertiary`,onClick:C,children:e(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`save-profile-btn`,type:`button`,variant:`primary`,onClick:E,isDisabled:!b||_||!f,"aria-busy":_,children:e(_?o.STATUS$SAVING:o.BUTTON$SAVE)})]})]})}var ye=new Set([`llm.model`,`llm.api_key`,`llm.base_url`]),be=(e,t)=>!e||!t?null:`${e}/${t}`,xe=(e,t)=>e?.sections.flatMap(e=>e.fields).find(e=>e.key===t)?.default??null,Z={openai:new Set([`https://api.openai.com`,`https://api.openai.com/v1`]),openhands:new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`]),litellm_proxy:new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`])},Se=e=>{try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``)||``;return`${t.origin}${n}`}catch{return e.trim().replace(/\/+$/,``)}},Ce=(e,t)=>{let n=Se(t),{provider:r}=D(e);if(r){let e=Z[r];if(e)return e.has(n)}return Object.values(Z).some(e=>e?.has(n))};function Q({testId:e}){let{t}=c(`openhands`);return(0,z.jsx)(L,{testId:e,text:t(o.SETTINGS$OPENHANDS_API_KEY_HELP_TEXT),linkText:t(o.SETTINGS$NAV_API_KEYS),href:`https://app.all-hands.dev/settings/api-keys`,suffix:` ${t(o.SETTINGS$OPENHANDS_API_KEY_HELP_SUFFIX)}`})}function $({scope:e=`personal`,onSaveSuccess:t,initialValueOverrides:n,embedded:r,hideSaveButton:i,onSaveControlChange:a}){let{t:s}=c(`openhands`),{data:l}=ee(e),{data:u}=ie(l?.agent_settings_schema),d=String(A.agent_settings?.llm?.model??``),f=R.useCallback((e,t)=>{let n=re(e,t);if(n!==`basic`)return n;let r=e.llm_model??``,i=e.llm_base_url?.trim()??``;return i.length>0&&!Ce(r,i)?`all`:`basic`},[]);return(0,z.jsx)(ae,{scope:e,sectionKeys:[`llm`],excludeKeys:ye,header:R.useCallback(({values:e,isDisabled:t,view:n,onChange:i})=>{let a=typeof e[`llm.model`]==`string`?e[`llm.model`]:``,c=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,u=a.startsWith(`openhands/`),f=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,p=r?f.length>0:!!l?.llm_api_key_set,m=(e,n)=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{testId:e,label:s(o.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,value:f,placeholder:p?`<hidden>`:``,onChange:e=>i(`llm.api_key`,e),isDisabled:t,startContent:p?(0,z.jsx)(V,{isSet:p}):void 0}),(0,z.jsx)(L,{testId:n,text:s(o.SETTINGS$DONT_KNOW_API_KEY),linkText:s(o.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`})]});return(0,z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n===`basic`?(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-basic`,children:[(0,z.jsx)(O,{currentModel:a||void 0,currentBaseUrl:c||void 0,onChange:(e,t)=>{let n=be(e,t);n&&i(`llm.model`,n)},wrapperClassName:`!flex-col !gap-6`,isDisabled:t}),u?(0,z.jsx)(Q,{testId:`openhands-api-key-help`}):null,m(`llm-api-key-input`,`llm-api-key-help-anchor`)]}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-advanced`,children:[(0,z.jsx)(k,{testId:`llm-custom-model-input`,label:s(o.SETTINGS$CUSTOM_MODEL),type:`text`,className:`w-full`,value:a,placeholder:d,onChange:e=>i(`llm.model`,e),isDisabled:t}),u?(0,z.jsx)(Q,{testId:`openhands-api-key-help-2`}):null,(0,z.jsx)(k,{testId:`base-url-input`,label:s(o.SETTINGS$BASE_URL),type:`text`,className:`w-full`,value:c,placeholder:`https://api.openai.com`,onChange:e=>i(`llm.base_url`,e),isDisabled:t}),m(`llm-api-key-input`,`llm-api-key-help-anchor-advanced`)]})})},[d,r,l?.llm_api_key_set,s]),buildPayload:R.useCallback((e,t)=>{let n=structuredClone(e),r=n.llm??{};return t.view===`basic`&&(r.base_url=xe(u,`llm.base_url`),n.llm=r),{agent_settings_diff:n}},[u]),getInitialView:f,forceShowAdvancedView:!0,allowAllView:!0,onSaveSuccess:t,initialValueOverrides:n,embedded:r,hideSaveButton:i,onSaveControlChange:a,testId:`llm-settings-screen`})}var we=n(function(){let{backend:e}=v();return e.kind===`cloud`?(0,z.jsx)($,{}):(0,z.jsx)(ve,{})});export{W as a,J as i,we as n,X as r,$ as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./react-dom-hVBnwgwZ.js";import{t as i}from"./useMutation-B4OUESdw.js";import{o as a,t as o}from"./declaration-D378OjpZ.js";import{n as s}from"./QueryClientProvider-B7kl84Kj.js";import{t as c}from"./useTranslation-CpIcQBq6.js";import{t as l}from"./createLucideIcon-Ddu8jDOQ.js";import{i as u,n as d,r as f,t as p,u as m}from"./settings-list-classes-BOS092DR.js";import{n as h,r as g}from"./custom-toast-handlers-BOc3qeQ7.js";import{t as _}from"./utils-D-HX7JCe.js";import{n as v}from"./active-backend-context-TVbjnvmP.js";import{a as y,n as b}from"./query-keys-tAsQcc_9.js";import{t as x}from"./modal-backdrop-DTYGVmOR.js";import{r as S,t as C}from"./modal-body-YElmM1dV.js";import{r as w}from"./base-modal-CQRvRHu1.js";import{t as T}from"./brand-button-C2nEKopC.js";import{t as E}from"./loading-spinner-C04FGh14.js";import{n as D,t as O}from"./model-selector-DeMmw-Xa.js";import{t as k}from"./settings-input-DBywAnA7.js";import{t as A}from"./settings-D5am1n6X.js";import{t as j}from"./settings-service.api-FvJGK45W.js";import{r as ee}from"./use-settings-DQ7Oo1Hj.js";import{i as te,r as M,t as N}from"./ellipsis-button-ugUATsNo.js";import{t as P}from"./u-edit-KAUlufD8.js";import{n as F,t as I}from"./use-llm-profiles-D3-KXwQ0.js";import{r as ne}from"./typography-vVUMoNUg.js";import{l as L,s as re}from"./sdk-settings-schema-QBYH-ONX.js";import{t as ie}from"./use-agent-settings-schema-Bvp5UzV8.js";import{t as ae}from"./sdk-section-page-CJW0G04-.js";import{t as oe}from"./u-check-circle-DplbarS5.js";import{n as se}from"./settings-section-header-context-32x6WTyL.js";var ce=l(`text-cursor`,[[`path`,{d:`M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1`,key:`uvaxm9`}],[`path`,{d:`M7 22h1a4 4 0 0 0 4-4v-1`,key:`11xy8d`}],[`path`,{d:`M7 2h1a4 4 0 0 1 4 4v1`,key:`1uw06m`}]]),R=e(t()),z=a(),B=e=>(0,z.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M9.9509 15.588H10.8349L16.5125 9.91042L15.6285 9.0264L10.3991 14.2681L8.00867 11.8777L7.12465 12.7617L9.9509 15.588Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.8521 3.29895C14.8443 3.42346 16.712 4.41954 18.0816 5.78916C19.7002 7.53231 20.5718 9.64898 20.5718 12.1392C20.5718 14.1314 19.8247 15.999 18.5796 17.6177C17.3345 19.1118 15.5914 20.2324 13.5992 20.6059C11.607 20.9794 9.61486 20.7304 7.87171 19.7343C6.12856 18.7382 4.75895 17.2441 4.01189 15.3765C3.26482 13.5088 3.14031 11.3921 3.76286 9.52447C4.38542 7.53231 5.50601 5.91367 7.24916 4.79308C8.86779 3.67248 10.86 3.17444 12.8521 3.29895ZM13.4747 19.3608C15.0933 18.9873 16.5874 18.1157 17.708 16.7461C18.7041 15.3765 19.3267 13.7578 19.2022 12.0147C19.2022 10.0225 18.4551 8.03035 17.0855 6.66073C15.8404 5.41563 14.3463 4.66857 12.6031 4.54405C10.9845 4.41954 9.24132 4.79308 7.87171 5.78916C6.50209 6.78524 5.50601 8.15486 5.00797 9.89801C4.50993 11.5166 4.50993 13.2598 5.25699 14.8784C6.00405 16.4971 7.12465 17.7422 8.61877 18.6137C10.1129 19.4853 11.856 19.7343 13.4747 19.3608Z`,fill:`currentColor`})]});function V({testId:e,isSet:t}){return(0,z.jsx)(`span`,{"data-testid":e||(t?`set-indicator`:`unset-indicator`),children:(0,z.jsx)(B,{className:_(t?`text-success`:`text-danger`)})})}var H=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;function U(e,{isRequired:t=!1}={}){return e===``?!t:H.test(e)}function W(e){let t=e.split(`/`),n=(t[t.length-1]||e).replace(/[^A-Za-z0-9._-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&!/^[A-Za-z0-9]/.test(n)&&(n=`profile-${n}`),n.length>64&&(n=n.substring(0,64).replace(/-+$/,``)),n||`default-profile`}var G=(0,R.forwardRef)(function({testId:e,ruleTestId:t,value:n,onChange:r,onKeyDown:i,placeholder:a,isDisabled:s,isOptional:l,isRequired:u=!1},d){let{t:f}=c(`openhands`),p=U(n,{isRequired:u}),m=l?`${f(o.SETTINGS$PROFILE_NAME_LABEL)} (${f(o.COMMON$OPTIONAL)})`:f(o.SETTINGS$PROFILE_NAME_LABEL),h=R.useId(),g=t??`${h}-rule`;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(k,{ref:d,testId:e,label:m,type:`text`,className:`w-full`,value:n,placeholder:a??f(o.SETTINGS$PROFILE_NAME_PLACEHOLDER),onChange:r,onKeyDown:i,isDisabled:s,ariaDescribedBy:g,ariaInvalid:!p}),(0,z.jsx)(`p`,{id:g,"data-testid":t,className:_(`text-xs`,p?`text-[var(--oh-muted)]`:`text-red-400`),children:f(o.SETTINGS$PROFILE_NAME_RULE)})]})});function K({isOpen:e,title:t,width:n=`md`,children:r,footer:i,onClose:a,initialFocusRef:o}){let s=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!e)return;let t=o?.current??s.current;if(t){let e=setTimeout(()=>{t.focus()},0);return()=>clearTimeout(e)}},[e,o]),(0,R.useEffect)(()=>{if(!e||!s.current)return;let t=s.current,n=e=>{if(e.key!==`Tab`)return;let n=t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`),r=n[0],i=n[n.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),i?.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),r?.focus())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e]),e?(0,z.jsx)(x,{onClose:a,children:(0,z.jsxs)(`div`,{ref:s,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:_(`bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,S(n),C),children:[(0,z.jsx)(w,{id:`modal-title`,title:t,className:`text-xl font-medium text-white`}),r,(0,z.jsx)(`div`,{className:`w-full flex justify-end gap-2 mt-2`,children:i})]})}):null}function le(){let e=s();return i({mutationFn:({name:e,newName:t})=>F.renameProfile(e,t),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function ue({profile:e,onClose:t}){let{t:n}=c(`openhands`),[r,i]=(0,R.useState)(``),a=le(),s=(0,R.useRef)(null);if((0,R.useEffect)(()=>{i(e?.name??``)},[e?.name]),!e)return null;let l=U(r,{isRequired:!0}),u=r===e.name,d=async()=>{if(!l){h(n(o.SETTINGS$PROFILE_NAME_RULE));return}if(u){t();return}try{await a.mutateAsync({name:e.name,newName:r}),g(n(o.SETTINGS$PROFILE_RENAMED,{name:r})),t()}catch(e){h(e instanceof Error?e.message:n(o.ERROR$GENERIC))}},f=()=>{a.isPending||t()},p=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T,{type:`button`,variant:`tertiary`,onClick:f,isDisabled:a.isPending,children:n(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`rename-profile-submit`,type:`button`,variant:`primary`,onClick:d,isDisabled:a.isPending||!l,children:a.isPending?(0,z.jsx)(E,{size:`small`}):n(o.BUTTON$RENAME)})]});return(0,z.jsx)(K,{isOpen:!0,title:n(o.SETTINGS$PROFILE_RENAME_TITLE),footer:p,onClose:f,initialFocusRef:s,children:(0,z.jsx)(`div`,{"data-testid":`rename-profile-modal`,className:`flex flex-col gap-3`,children:(0,z.jsx)(G,{ref:s,testId:`rename-profile-input`,ruleTestId:`rename-profile-rule`,value:r,onChange:i,isRequired:!0,onKeyDown:e=>{e.key===`Enter`&&!a.isPending&&l&&d()}})})})}function de(){let e=s();return i({mutationFn:e=>F.deleteProfile(e),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function fe({profile:e,onClose:t}){let{t:n}=c(`openhands`),r=de(),i=(0,R.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),g(n(o.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){h(e instanceof Error?e.message:n(o.ERROR$GENERIC))}},s=()=>{r.isPending||t()},l=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(T,{ref:i,type:`button`,variant:`tertiary`,onClick:s,isDisabled:r.isPending,children:n(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`delete-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(E,{size:`small`}),(0,z.jsx)(`span`,{className:`sr-only`,children:n(o.BUTTON$DELETE)})]}):n(o.BUTTON$DELETE)})]});return(0,z.jsx)(K,{isOpen:!0,title:n(o.SETTINGS$PROFILE_DELETE_TITLE),footer:l,onClose:s,initialFocusRef:i,children:(0,z.jsx)(`p`,{className:`text-sm break-all`,children:n(o.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}var pe=e(r(),1);function q({index:e,icon:t,label:n,onClick:r,onKeyDown:i,menuItemsRef:a,disabled:o,testId:s}){return(0,z.jsx)(`button`,{ref:t=>{a.current[e]=t},type:`button`,onClick:r,onKeyDown:t=>i(t,e),disabled:o,className:_(`group w-full cursor-pointer rounded px-2 py-2 text-start text-nowrap text-sm font-normal`,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`),role:`menuitem`,"data-testid":s,children:(0,z.jsx)(te,{icon:t,text:n})})}function me({onEdit:e,onRename:t,onSetActive:n,onDelete:r,isActive:i,isActivating:a,onClose:s,anchorRef:l}){let{t:u}=c(`openhands`),d=(0,R.useRef)(null),f=(0,R.useRef)([]),p=l?.current??null,[m,h]=(0,R.useState)();(0,R.useLayoutEffect)(()=>{if(!p)return;let e=()=>{let e=p.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[p]),(0,R.useEffect)(()=>{f.current[0]?.focus()},[]),(0,R.useEffect)(()=>{let e=e=>{let t=e.target;d.current&&!d.current.contains(t)&&s()},t=e=>{e.key===`Escape`&&s()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[s]);let g=e=>{e(),s()},v=(0,R.useCallback)((e,t)=>{if(e.key===`Tab`){s();return}let n=f.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;f.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;f.current[r]?.focus()}},[s]),y=i||a,b=!!p,x=(0,z.jsxs)(`div`,{ref:d,className:_(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`profile-actions-menu`,children:[(0,z.jsx)(q,{index:0,icon:(0,z.jsx)(P,{width:16,height:16}),label:u(o.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:f,testId:`profile-edit`}),(0,z.jsx)(q,{index:1,icon:(0,z.jsx)(ce,{"aria-hidden":!0,className:`size-4`,strokeWidth:2}),label:u(o.BUTTON$RENAME),onClick:()=>g(t),onKeyDown:v,menuItemsRef:f,testId:`profile-rename`}),(0,z.jsx)(q,{index:2,icon:(0,z.jsx)(oe,{width:16,height:16}),label:u(o.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:f,disabled:y,testId:`profile-set-active`}),(0,z.jsx)(q,{index:3,icon:(0,z.jsx)(M,{width:16,height:16}),label:u(o.BUTTON$DELETE),onClick:()=>g(r),onKeyDown:v,menuItemsRef:f,testId:`profile-delete`})]});return b?typeof document>`u`||!m?null:pe.createPortal((0,z.jsx)(`div`,{style:m,children:x}),document.body):x}function he({children:e,className:t,...n}){return(0,z.jsx)(`span`,{className:_(`text-sm leading-4 text-black font-semibold tracking-tighter bg-primary p-1 rounded-full`,t),...n,children:e})}function ge({profile:e,isActive:t,onActivate:n,onEdit:r,onRename:i,onDelete:a,isActivating:s}){let{t:l}=c(`openhands`),[d,p]=(0,R.useState)(!1),m=(0,R.useRef)(null);return(0,z.jsxs)(`div`,{"data-testid":`profile-row`,className:_(u,`justify-between gap-3`),children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),e.model?(0,z.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:e.model,children:e.model}):null,t&&(0,z.jsx)(he,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`profile-active-badge`,children:l(o.SETTINGS$PROFILE_ACTIVE)})]}),(0,z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,z.jsx)(N,{ref:m,onClick:()=>p(e=>!e),ariaLabel:l(o.SETTINGS$PROFILE_MENU),testId:`profile-menu-trigger`,className:f}),d&&(0,z.jsx)(me,{anchorRef:m,onEdit:()=>r(e),onRename:()=>i(e),onSetActive:()=>n(e.name),onDelete:()=>a(e),isActive:t,isActivating:s,onClose:()=>p(!1)})]})]})}function _e({isLoading:e,loadError:t,profiles:n,active:r,onActivate:i,onEdit:a,onRename:s,onDelete:l,isActivating:u}){let{t:f}=c(`openhands`);return e?(0,z.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,z.jsx)(E,{size:`large`})}):t?(0,z.jsx)(`p`,{className:`text-sm text-red-400`,children:f(o.SETTINGS$PROFILES_LOAD_ERROR)}):n.length===0?(0,z.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)] italic`,children:f(o.SETTINGS$PROFILES_EMPTY)}):(0,z.jsx)(`div`,{className:_(p,d),children:n.map(e=>(0,z.jsx)(ge,{profile:e,isActive:e.name===r,onActivate:i,onEdit:a,onRename:s,onDelete:l,isActivating:u},e.name))})}function J(){let e=s();return i({mutationFn:e=>F.activateProfile(e),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function Y({onAddProfile:e,onEditProfile:t}){let{t:n}=c(`openhands`),{data:r,isLoading:i,error:a}=I(),s=J(),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(null),p=r?.profiles??[],m=r?.active_profile??null;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,z.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(o.SETTINGS$AVAILABLE_PROFILES)}),e?(0,z.jsx)(T,{testId:`add-llm-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(o.SETTINGS$ADD_LLM_PROFILE)}):null]}),(0,z.jsx)(_e,{isLoading:i,loadError:a??null,profiles:p,active:m,onActivate:async e=>{try{await s.mutateAsync(e),g(n(o.SETTINGS$PROFILE_ACTIVATED,{name:e}))}catch(e){console.error(`Failed to activate profile:`,e),h(n(o.ERROR$GENERIC))}},onEdit:e=>{t?.(e)},onRename:u,onDelete:f,isActivating:s.isPending})]}),(0,z.jsx)(ue,{profile:l,onClose:()=>u(null)}),(0,z.jsx)(fe,{profile:d,onClose:()=>f(null)})]})}function X(){let e=s();return i({mutationFn:({name:e,request:t})=>F.saveProfile(e,t),onSuccess:async()=>{j.invalidateCache(),await e.invalidateQueries({queryKey:b.all}),await e.invalidateQueries({queryKey:y.personal()})},meta:{disableToast:!0}})}function ve(){let{t:e}=c(`openhands`),{setHideSectionHeader:t}=se(),n=X(),{data:r}=I(),[i,a]=(0,R.useState)(`list`),[s,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(null),[f,p]=(0,R.useState)(null),[_,v]=(0,R.useState)(!1);(0,R.useEffect)(()=>(t(i!==`list`),()=>t(!1)),[i,t]);let y=(0,R.useMemo)(()=>new Set(r?.profiles.map(e=>e.name)??[]),[r]),b=(0,R.useMemo)(()=>!(!U(s,{isRequired:!0})||i===`create`&&y.has(s)||i===`edit`&&s!==u?.profile.name&&y.has(s)),[s,i,y,u?.profile.name]),x=(0,R.useCallback)(()=>{l(``),d(null),a(`create`)},[]),S=(0,R.useCallback)(async t=>{try{let e=(await F.getProfile(t.name,`encrypted`)).config??{};d({profile:t,initialValues:{"llm.model":e.model??``,"llm.api_key":e.api_key??``,"llm.base_url":e.base_url??``}}),l(t.name),a(`edit`)}catch(t){console.error(`Failed to fetch profile details:`,t),h(e(o.ERROR$GENERIC))}},[e]),C=(0,R.useCallback)(()=>{a(`list`),d(null),l(``),p(null)},[]),w=(0,R.useCallback)(e=>{if(p(e),i===`create`&&!s){let t=e.values[`llm.model`];if(typeof t==`string`&&t){let e=W(t);y.has(e)||l(e)}}},[i,s,y]),E=(0,R.useCallback)(async()=>{if(!f||!b)return;let t=f.values,a=typeof t[`llm.model`]==`string`?t[`llm.model`]:``,c=typeof t[`llm.api_key`]==`string`?t[`llm.api_key`]:``,l=typeof t[`llm.base_url`]==`string`?t[`llm.base_url`]:``;if(!a){h(e(o.SETTINGS$MODEL_REQUIRED));return}let d=s.trim(),p=u?.profile.name,m=i===`edit`&&p&&p!==d,_=r?.active_profile===p;v(!0);try{m&&await F.renameProfile(p,d);let t={model:a};c?t.api_key=c:i===`edit`&&u?.initialValues[`llm.api_key`]&&(t.api_key=u.initialValues[`llm.api_key`]),l&&(t.base_url=l),await n.mutateAsync({name:d,request:{llm:t,include_secrets:!0}}),m&&_&&await F.activateProfile(d),g(e(i===`create`?o.SETTINGS$PROFILE_CREATED:o.SETTINGS$PROFILE_UPDATED,{name:d})),C()}catch(t){console.error(`Failed to save profile:`,t),h(e(o.ERROR$GENERIC))}finally{v(!1)}},[f,b,s,i,u,r?.active_profile,n,e,C]);if(i===`list`)return(0,z.jsx)(Y,{onAddProfile:x,onEditProfile:S});let D=e(i===`edit`?o.SETTINGS$EDIT_LLM_PROFILE:o.SETTINGS$ADD_LLM_PROFILE),O=i===`edit`&&u?e(o.SETTINGS$PROFILE_LOADED,{name:u.profile.name}):e(o.SETTINGS$PROFILE_SAVE_HINT);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:C,className:`flex items-center gap-2 self-start rounded-lg p-2 text-[var(--oh-muted)] transition-colors hover:bg-tertiary hover:text-white`,"data-testid":`back-to-profiles`,children:[(0,z.jsx)(m,{size:20,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`text-sm leading-5`,children:e(o.BUTTON$BACK)})]}),(0,z.jsx)(ne.H2,{testId:`profile-editor-title`,children:D}),(0,z.jsx)(`p`,{"data-testid":`profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:O})]}),(0,z.jsx)(G,{testId:`profile-name-input`,value:s,onChange:l,isRequired:!0}),(0,z.jsx)($,{embedded:!0,hideSaveButton:!0,initialValueOverrides:i===`edit`&&u?.initialValues?u.initialValues:{"llm.model":``,"llm.api_key":``,"llm.base_url":``},onSaveControlChange:w},i===`edit`?`edit-${u?.profile.name}`:`new-profile`),(0,z.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4 border-t border-[var(--oh-border)]`,children:[(0,z.jsx)(T,{testId:`cancel-profile-btn`,type:`button`,variant:`tertiary`,onClick:C,children:e(o.BUTTON$CANCEL)}),(0,z.jsx)(T,{testId:`save-profile-btn`,type:`button`,variant:`primary`,onClick:E,isDisabled:!b||_||!f,"aria-busy":_,children:e(_?o.STATUS$SAVING:o.BUTTON$SAVE)})]})]})}var ye=new Set([`llm.model`,`llm.api_key`,`llm.base_url`]),be=(e,t)=>!e||!t?null:`${e}/${t}`,xe=(e,t)=>e?.sections.flatMap(e=>e.fields).find(e=>e.key===t)?.default??null,Z={openai:new Set([`https://api.openai.com`,`https://api.openai.com/v1`]),openhands:new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`]),litellm_proxy:new Set([`https://llm-proxy.app.all-hands.dev`,`https://llm-proxy.app.all-hands.dev/v1`])},Se=e=>{try{let t=new URL(e),n=t.pathname.replace(/\/+$/,``)||``;return`${t.origin}${n}`}catch{return e.trim().replace(/\/+$/,``)}},Ce=(e,t)=>{let n=Se(t),{provider:r}=D(e);if(r){let e=Z[r];if(e)return e.has(n)}return Object.values(Z).some(e=>e?.has(n))};function Q({testId:e}){let{t}=c(`openhands`);return(0,z.jsx)(L,{testId:e,text:t(o.SETTINGS$OPENHANDS_API_KEY_HELP_TEXT),linkText:t(o.SETTINGS$NAV_API_KEYS),href:`https://app.all-hands.dev/settings/api-keys`,suffix:` ${t(o.SETTINGS$OPENHANDS_API_KEY_HELP_SUFFIX)}`})}function $({scope:e=`personal`,onSaveSuccess:t,initialValueOverrides:n,embedded:r,hideSaveButton:i,onSaveControlChange:a}){let{t:s}=c(`openhands`),{data:l}=ee(e),{data:u}=ie(l?.agent_settings_schema),d=String(A.agent_settings?.llm?.model??``),f=R.useCallback((e,t)=>{let n=re(e,t);if(n!==`basic`)return n;let r=e.llm_model??``,i=e.llm_base_url?.trim()??``;return i.length>0&&!Ce(r,i)?`all`:`basic`},[]);return(0,z.jsx)(ae,{scope:e,sectionKeys:[`llm`],excludeKeys:ye,header:R.useCallback(({values:e,isDisabled:t,view:n,onChange:i})=>{let a=typeof e[`llm.model`]==`string`?e[`llm.model`]:``,c=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,u=a.startsWith(`openhands/`),f=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,p=r?f.length>0:!!l?.llm_api_key_set,m=(e,n)=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(k,{testId:e,label:s(o.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,value:f,placeholder:p?`<hidden>`:``,onChange:e=>i(`llm.api_key`,e),isDisabled:t,startContent:p?(0,z.jsx)(V,{isSet:p}):void 0}),(0,z.jsx)(L,{testId:n,text:s(o.SETTINGS$DONT_KNOW_API_KEY),linkText:s(o.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`})]});return(0,z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n===`basic`?(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-basic`,children:[(0,z.jsx)(O,{currentModel:a||void 0,currentBaseUrl:c||void 0,onChange:(e,t)=>{let n=be(e,t);n&&i(`llm.model`,n)},wrapperClassName:`!flex-col !gap-6`,isDisabled:t}),u?(0,z.jsx)(Q,{testId:`openhands-api-key-help`}):null,m(`llm-api-key-input`,`llm-api-key-help-anchor`)]}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,"data-testid":`llm-settings-form-advanced`,children:[(0,z.jsx)(k,{testId:`llm-custom-model-input`,label:s(o.SETTINGS$CUSTOM_MODEL),type:`text`,className:`w-full`,value:a,placeholder:d,onChange:e=>i(`llm.model`,e),isDisabled:t}),u?(0,z.jsx)(Q,{testId:`openhands-api-key-help-2`}):null,(0,z.jsx)(k,{testId:`base-url-input`,label:s(o.SETTINGS$BASE_URL),type:`text`,className:`w-full`,value:c,placeholder:`https://api.openai.com`,onChange:e=>i(`llm.base_url`,e),isDisabled:t}),m(`llm-api-key-input`,`llm-api-key-help-anchor-advanced`)]})})},[d,r,l?.llm_api_key_set,s]),buildPayload:R.useCallback((e,t)=>{let n=structuredClone(e),r=n.llm??{};return t.view===`basic`&&(r.base_url=xe(u,`llm.base_url`),n.llm=r),{agent_settings_diff:n}},[u]),getInitialView:f,forceShowAdvancedView:!0,allowAllView:!0,onSaveSuccess:t,initialValueOverrides:n,embedded:r,hideSaveButton:i,onSaveControlChange:a,testId:`llm-settings-screen`})}var we=n(function(){let{backend:e}=v();return e.kind===`cloud`?(0,z.jsx)($,{}):(0,z.jsx)(ve,{})});export{W as a,J as i,we as n,X as r,$ as t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-C9nuq2Dj.js";import{t as n}from"./utils-Czcl6buL.js";e();var r=t(),i=e=>(0,r.jsx)(`svg`,{width:66,height:66,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,r.jsx)(`path`,{d:`M63 33C63 16.4315 49.5685 3 33 3C16.4315 3 3 16.4315 3 33C3 49.5685 16.4315 63 33 63`,stroke:`currentColor`,strokeWidth:6,strokeLinecap:`round`})});function a({size:e,className:t,innerClassName:a,outerClassName:o}){let s=e===`small`?`w-[25px] h-[25px]`:`w-[50px] h-[50px]`;return(0,r.jsxs)(`div`,{"data-testid":`loading-spinner`,className:n(`relative`,s,t),children:[(0,r.jsx)(`div`,{className:n(`rounded-full border-4 border-[var(--oh-border)] absolute`,s,a)}),(0,r.jsx)(i,{className:n(`absolute animate-spin`,s,o)})]})}export{a as t};
1
+ import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-D378OjpZ.js";import{t as n}from"./utils-D-HX7JCe.js";e();var r=t(),i=e=>(0,r.jsx)(`svg`,{width:66,height:66,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,r.jsx)(`path`,{d:`M63 33C63 16.4315 49.5685 3 33 3C16.4315 3 3 16.4315 3 33C3 49.5685 16.4315 63 33 63`,stroke:`currentColor`,strokeWidth:6,strokeLinecap:`round`})});function a({size:e,className:t,innerClassName:a,outerClassName:o}){let s=e===`small`?`w-[25px] h-[25px]`:`w-[50px] h-[50px]`;return(0,r.jsxs)(`div`,{"data-testid":`loading-spinner`,className:n(`relative`,s,t),children:[(0,r.jsx)(`div`,{className:n(`rounded-full border-4 border-[var(--oh-border)] absolute`,s,a)}),(0,r.jsx)(i,{className:n(`absolute animate-spin`,s,o)})]})}export{a as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{t as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{o as i,t as a}from"./declaration-C9nuq2Dj.js";import{t as o}from"./useTranslation-01pF7z10.js";import{t as s}from"./pencil-Dr0b2jL1.js";import{t as c}from"./plus-DT-M0FA1.js";import{t as l}from"./trash-2-CbVljPko.js";import{t as u}from"./utils-Czcl6buL.js";import{t as d}from"./agent-server-client-options-8OJSXbm8.js";import{r as f}from"./active-backend-context-CkP3ZEJs.js";import{t as p}from"./server-client-CG1zHqph.js";import{t as m}from"./modal-backdrop-B04pVYAD.js";import{r as h,t as g}from"./modal-body-CgUoFQA1.js";import{t as _}from"./brand-button-8fVVei4i.js";import{i as v,n as y,r as b}from"./backend-form-modal-KudhWUX8.js";import{t as x}from"./modal-close-button-SM_WXzDY.js";import{t as S}from"./confirmation-modal-B-DOYMUH.js";var C=t({ManageBackendsModal:()=>k}),w=e(n(),1),T=i(),E=`inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white`;function D({backend:e}){let{t}=o(`openhands`),{data:n}=r({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>(await new p(d({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()).version??null,retry:!1,staleTime:6e4,enabled:e.kind===`local`});return n?(0,T.jsx)(`span`,{className:`inline-flex shrink-0 items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-1.5 py-0.5 text-[10px] font-medium leading-none text-[var(--oh-text-dim)]`,"data-testid":`manage-backends-version-${e.name}`,children:t(a.BACKEND$VERSION_LABEL,{version:n})}):null}function O({backend:e,health:t,onEdit:n,onRemove:r}){let{t:i}=o(`openhands`);return(0,T.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-3`,"data-testid":`manage-backends-row-${e.name}`,children:[(0,T.jsx)(b,{isConnected:t?.isConnected??null}),(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`truncate text-sm text-white`,children:e.name}),(0,T.jsx)(D,{backend:e})]}),(0,T.jsx)(`span`,{className:`truncate text-xs text-[var(--oh-muted)]`,children:e.host})]}),(0,T.jsx)(`span`,{className:`px-2 py-1 rounded-full text-[11px] uppercase tracking-wide text-[var(--oh-text-tertiary)] bg-[var(--oh-surface)] border border-[var(--oh-border)]`,children:e.kind===`cloud`?i(a.BACKEND$KIND_CLOUD):i(a.BACKEND$KIND_LOCAL)}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,T.jsx)(`button`,{type:`button`,onClick:n,"aria-label":i(a.BACKEND$EDIT),"data-testid":`manage-backends-edit-${e.name}`,className:E,children:(0,T.jsx)(s,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,T.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i(a.BACKEND$REMOVE),"data-testid":`manage-backends-remove-${e.name}`,className:E,children:(0,T.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})]})}function k({onClose:e}){let{t}=o(`openhands`),{backends:n,removeBackend:r}=f(),i=v(n,{probeDisabledOnce:!0}),[s,l]=w.useState(null),[d,p]=w.useState(null),[b,C]=w.useState(!1);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(m,{onClose:e,"aria-label":t(a.BACKEND$MANAGE_TITLE),children:(0,T.jsxs)(`div`,{"data-testid":`manage-backends-modal`,className:u(`relative flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-xl`,h(`lg`),g,`max-h-[70vh]`),children:[(0,T.jsx)(x,{onClose:e,testId:`close-manage-backends-modal`}),(0,T.jsx)(`div`,{className:`p-5 pr-12`,children:(0,T.jsx)(`h2`,{className:`text-lg font-semibold`,children:t(a.BACKEND$MANAGE_TITLE)})}),(0,T.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-5`,children:(0,T.jsx)(`div`,{className:`flex-1 overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always`,"data-testid":`manage-backends-list`,children:n.length===0?(0,T.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-[var(--oh-text-secondary)]`,children:t(a.BACKEND$MANAGE_EMPTY)}):(0,T.jsx)(`ul`,{className:`divide-y divide-[var(--oh-border)]`,children:n.map(e=>(0,T.jsx)(O,{backend:e,health:i[e.id],onEdit:()=>p(e),onRemove:()=>l({id:e.id,name:e.name})},e.id))})})}),(0,T.jsxs)(`div`,{className:`flex justify-end gap-2 p-5`,children:[(0,T.jsx)(_,{type:`button`,variant:`secondary`,onClick:()=>C(!0),testId:`manage-backends-add`,startContent:(0,T.jsx)(c,{width:14,height:14}),children:t(a.BACKEND$ADD)}),(0,T.jsx)(_,{type:`button`,variant:`primary`,onClick:e,testId:`manage-backends-done`,children:t(a.HOME$DONE)})]})]})}),b?(0,T.jsx)(y,{mode:`add`,onClose:()=>C(!1)}):null,d?(0,T.jsx)(y,{mode:`edit`,backend:d,onClose:()=>p(null)}):null,s?(0,T.jsx)(S,{text:t(a.BACKEND$REMOVE_CONFIRMATION,{name:s.name}),onConfirm:()=>{s&&(r(s.id),l(null))},onCancel:()=>l(null)}):null]})}export{C as n,k as t};
1
+ import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{t as r}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js";import{o as i,t as a}from"./declaration-D378OjpZ.js";import{t as o}from"./useTranslation-CpIcQBq6.js";import{t as s}from"./pencil-Dr0b2jL1.js";import{t as c}from"./plus-DT-M0FA1.js";import{t as l}from"./trash-2-CbVljPko.js";import{t as u}from"./utils-D-HX7JCe.js";import{t as d}from"./agent-server-client-options-DT2GP6VJ.js";import{r as f}from"./active-backend-context-TVbjnvmP.js";import{t as p}from"./server-client-C3mC8Hl3.js";import{t as m}from"./modal-backdrop-DTYGVmOR.js";import{r as h,t as g}from"./modal-body-YElmM1dV.js";import{t as _}from"./brand-button-C2nEKopC.js";import{i as v,n as y,r as b}from"./backend-form-modal-K6IMCr3p.js";import{t as x}from"./modal-close-button-C_GpQt9F.js";import{t as S}from"./confirmation-modal-C9-La0h3.js";var C=t({ManageBackendsModal:()=>k}),w=e(n(),1),T=i(),E=`inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted transition-colors hover:bg-interactive-hover hover:text-white`;function D({backend:e}){let{t}=o(`openhands`),{data:n}=r({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>(await new p(d({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()).version??null,retry:!1,staleTime:6e4,enabled:e.kind===`local`});return n?(0,T.jsx)(`span`,{className:`inline-flex shrink-0 items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-1.5 py-0.5 text-[10px] font-medium leading-none text-[var(--oh-text-dim)]`,"data-testid":`manage-backends-version-${e.name}`,children:t(a.BACKEND$VERSION_LABEL,{version:n})}):null}function O({backend:e,health:t,onEdit:n,onRemove:r}){let{t:i}=o(`openhands`);return(0,T.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-3`,"data-testid":`manage-backends-row-${e.name}`,children:[(0,T.jsx)(b,{isConnected:t?.isConnected??null}),(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`truncate text-sm text-white`,children:e.name}),(0,T.jsx)(D,{backend:e})]}),(0,T.jsx)(`span`,{className:`truncate text-xs text-[var(--oh-muted)]`,children:e.host})]}),(0,T.jsx)(`span`,{className:`px-2 py-1 rounded-full text-[11px] uppercase tracking-wide text-[var(--oh-text-tertiary)] bg-[var(--oh-surface)] border border-[var(--oh-border)]`,children:e.kind===`cloud`?i(a.BACKEND$KIND_CLOUD):i(a.BACKEND$KIND_LOCAL)}),(0,T.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,T.jsx)(`button`,{type:`button`,onClick:n,"aria-label":i(a.BACKEND$EDIT),"data-testid":`manage-backends-edit-${e.name}`,className:E,children:(0,T.jsx)(s,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,T.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i(a.BACKEND$REMOVE),"data-testid":`manage-backends-remove-${e.name}`,className:E,children:(0,T.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})]})}function k({onClose:e}){let{t}=o(`openhands`),{backends:n,removeBackend:r}=f(),i=v(n,{probeDisabledOnce:!0}),[s,l]=w.useState(null),[d,p]=w.useState(null),[b,C]=w.useState(!1);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(m,{onClose:e,"aria-label":t(a.BACKEND$MANAGE_TITLE),children:(0,T.jsxs)(`div`,{"data-testid":`manage-backends-modal`,className:u(`relative flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-xl`,h(`lg`),g,`max-h-[70vh]`),children:[(0,T.jsx)(x,{onClose:e,testId:`close-manage-backends-modal`}),(0,T.jsx)(`div`,{className:`p-5 pr-12`,children:(0,T.jsx)(`h2`,{className:`text-lg font-semibold`,children:t(a.BACKEND$MANAGE_TITLE)})}),(0,T.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-5`,children:(0,T.jsx)(`div`,{className:`flex-1 overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always`,"data-testid":`manage-backends-list`,children:n.length===0?(0,T.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-[var(--oh-text-secondary)]`,children:t(a.BACKEND$MANAGE_EMPTY)}):(0,T.jsx)(`ul`,{className:`divide-y divide-[var(--oh-border)]`,children:n.map(e=>(0,T.jsx)(O,{backend:e,health:i[e.id],onEdit:()=>p(e),onRemove:()=>l({id:e.id,name:e.name})},e.id))})})}),(0,T.jsxs)(`div`,{className:`flex justify-end gap-2 p-5`,children:[(0,T.jsx)(_,{type:`button`,variant:`secondary`,onClick:()=>C(!0),testId:`manage-backends-add`,startContent:(0,T.jsx)(c,{width:14,height:14}),children:t(a.BACKEND$ADD)}),(0,T.jsx)(_,{type:`button`,variant:`primary`,onClick:e,testId:`manage-backends-done`,children:t(a.HOME$DONE)})]})]})}),b?(0,T.jsx)(y,{mode:`add`,onClose:()=>C(!1)}):null,d?(0,T.jsx)(y,{mode:`edit`,backend:d,onClose:()=>p(null)}):null,s?(0,T.jsx)(S,{text:t(a.BACKEND$REMOVE_CONFIRMATION,{name:s.name}),onConfirm:()=>{s&&(r(s.id),l(null))},onCancel:()=>l(null)}):null]})}export{C as n,k as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-DlKA6SoO.js";import{t as r}from"./useMutation-CRJwk4cR.js";import{i}from"./organization-service.api-Ct2dZF8M.js";import{o as a,t as o}from"./declaration-C9nuq2Dj.js";import{n as s}from"./QueryClientProvider-DITRCGAK.js";import{t as c}from"./useTranslation-01pF7z10.js";import{t as l}from"./utils-Czcl6buL.js";import{t as u}from"./agent-server-client-options-8OJSXbm8.js";import{n as d}from"./active-backend-context-CkP3ZEJs.js";import{a as f,l as p,u as m}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js";import{r as h}from"./query-keys-tAsQcc_9.js";import{t as g}from"./modal-backdrop-B04pVYAD.js";import{r as _,t as v}from"./modal-body-CgUoFQA1.js";import{r as y}from"./base-modal-B4HvlFHE.js";import{t as b}from"./brand-button-8fVVei4i.js";import{t as x}from"./openhands-logo-DkDp75rC.js";import{t as S}from"./confirmation-modal-B-DOYMUH.js";import{t as C}from"./terminal-DGuR4559.js";import{t as w}from"./folder-CerIk8uG.js";import{t as T}from"./chevron-left-small-BqSkXTeq.js";import{t as E}from"./close-SnIy2eLD.js";var D=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,O=`0 0 100 100`,k=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,A=`0 0 12 12`,j=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,M=`0 0 24 24`,N=a(),P=3/2;function F({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,N.jsx)(x,{width:Math.round(t*P),height:t,className:l(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:O,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fill:`currentColor`,d:D})}):e===`codex`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:A,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:k,fill:`currentColor`})}):e===`gemini`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:M,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fill:`currentColor`,d:j})}):(0,N.jsx)(C,{width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function I(){return new f(u())}function L(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var R=class{static async listWorkspaces(){return L(await I().listWorkspaces())}static async addWorkspaces(e){return L(await I().addWorkspaces(e))}static async removeWorkspace(e){await I().deleteWorkspace(e)}static async addWorkspaceParents(e){return L(await I().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await I().deleteWorkspaceParent(e)}};function z(){let e=s();return r({mutationFn:e=>R.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function B(){let e=s();return r({mutationFn:e=>R.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function V(){let e=s();return r({mutationFn:e=>R.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function H(){let e=s();return r({mutationFn:e=>R.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}var U=e(t(),1);function W({enabled:e=!0}={}){return n({queryKey:h.all,queryFn:()=>R.listWorkspaces(),enabled:e,retry:(e,t)=>!m(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function G(){let{data:e,isLoading:t,isError:n,error:r}=W(),a=m(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,U.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,a]),l=i({queries:a?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new p(u()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),d=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,U.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:d,isError:f,error:r}}function K(e,t){return m(e)?t(o.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function q(){return new p(u())}var J=e=>{let t=d();return n({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>q().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Y=()=>{let e=d();return n({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>q().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},X=`/projects`;function Z({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,N.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,N.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,N.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:l(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,N.jsx)(w,{width:14,height:14,className:`shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function Q(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function $(e){return e?.home===`/home/openhands`}function ee({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=c(`openhands`),[a,s]=(0,U.useState)(null),u=d(),{data:f}=Y();(0,U.useEffect)(()=>{e&&f?.home&&a===null&&s($(f)?X:f.home),e||s(null)},[e,f?.home,a]),(0,U.useEffect)(()=>{s(null)},[u.backend.id,u.orgId]);let{data:p,isLoading:m,isError:h,error:x}=J(e?a:null),S=(0,U.useMemo)(()=>{if(!f?.home)return[];let e=[{label:`Home`,path:f.home.replace(/[\\/]+$/,``)||f.home},...f.favorites??[]];return $(f)&&!e.some(e=>e.path===X)&&e.push({label:X,path:X}),e},[f]),C=f?.locations??[];if(!e)return null;let E=p?.items??[],D=a?Q(a):null,O=f?.home===`/home/openhands`&&(f?.favorites?.length??0)===0&&a===f?.home&&!m&&!h&&E.length===0,k=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,N.jsx)(g,{onClose:t,"aria-label":i(o.HOME$ADD_WORKSPACES_TITLE),children:(0,N.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:l(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,_(`xl`),v,`h-[480px]`),children:[(0,N.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,N.jsx)(y,{className:`text-sm font-medium text-white`,title:i(o.HOME$ADD_WORKSPACES_TITLE)})}),(0,N.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,N.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,N.jsx)(Z,{label:i(o.HOME$FAVORITES),entries:S,currentPath:a,onPick:s}),(0,N.jsx)(Z,{label:i(o.HOME$LOCATIONS),entries:C,currentPath:a,onPick:s})]}),(0,N.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,N.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>D&&s(D),disabled:!D,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,N.jsx)(T,{width:16,height:16})}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,N.jsx)(`span`,{children:i(o.HOME$NAME)}),(0,N.jsx)(`span`,{children:i(o.HOME$KIND)})]}),(0,N.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[m&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(o.HOME$LOADING)}),h&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:x?.message??`Failed to load`}),!m&&!h&&E.length===0&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":O?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(O?o.HOME$HOST_HOME_NOT_MOUNTED_HINT:o.HOME$NO_WORKSPACES)}),E.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,N.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(o.HOME$FOLDER)})]})},e.path))]})]})]}),(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,N.jsx)(b,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(o.HOME$CANCEL)}),r&&(0,N.jsx)(b,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-add-all-subdirs`,children:i(o.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,N.jsx)(b,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-use`,children:i(o.HOME$ADD_THIS_DIRECTORY)})]})]})})}function te({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:s}=c(`openhands`),[u,d]=U.useState(null);if(!e)return null;let f=t.filter(e=>!e.parentPath),p=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=p.get(e.parentPath)??[];t.push(e),p.set(e.parentPath,t)});let m=f.length>0||n.length>0;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(g,{onClose:r,"aria-label":s(o.HOME$MANAGE_WORKSPACES),children:(0,N.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:l(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,_(`lg`),v,`max-h-[70vh]`),children:[(0,N.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,N.jsx)(y,{className:`text-sm font-medium text-white`,title:s(o.HOME$MANAGE_WORKSPACES)})}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!m&&(0,N.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(o.HOME$MANAGE_WORKSPACES_EMPTY)}),f.length>0&&(0,N.jsx)(`ul`,{children:f.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,N.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>d({type:`workspace`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(o.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,N.jsx)(E,{width:12,height:12}),(0,N.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,N.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,N.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(o.HOME$WORKSPACE_PARENTS)}),(0,N.jsx)(`ul`,{children:n.map(e=>{let t=p.get(e.path)??[];return(0,N.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,N.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,N.jsxs)(`button`,{type:`button`,onClick:()=>d({type:`parent`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(o.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,N.jsx)(E,{width:12,height:12}),(0,N.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,N.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,N.jsx)(w,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,N.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,N.jsx)(b,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(o.HOME$DONE)})})]})}),u&&(0,N.jsx)(S,{text:u.text,onConfirm:()=>{u&&(u.type===`workspace`?i(u.path):a?.(u.path),d(null))},onCancel:()=>d(null)})]})}export{W as a,B as c,G as i,H as l,ee as n,V as o,K as r,z as s,te as t,F as u};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~kyz9p27j-CyUbhpbm.js";import{t as r}from"./useMutation-B4OUESdw.js";import{i}from"./organization-service.api-COwMPFg5.js";import{o as a,t as o}from"./declaration-D378OjpZ.js";import{n as s}from"./QueryClientProvider-B7kl84Kj.js";import{t as c}from"./useTranslation-CpIcQBq6.js";import{t as l}from"./utils-D-HX7JCe.js";import{t as u}from"./agent-server-client-options-DT2GP6VJ.js";import{n as d}from"./active-backend-context-TVbjnvmP.js";import{a as f,d as p,u as m}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-CHrEOFl6.js";import{r as h}from"./query-keys-tAsQcc_9.js";import{t as g}from"./modal-backdrop-DTYGVmOR.js";import{r as _,t as v}from"./modal-body-YElmM1dV.js";import{r as y}from"./base-modal-CQRvRHu1.js";import{t as b}from"./brand-button-C2nEKopC.js";import{t as x}from"./openhands-logo-CI5Fhn1W.js";import{t as S}from"./confirmation-modal-C9-La0h3.js";import{t as C}from"./terminal-LNa-iU5c.js";import{t as w}from"./folder-0WSMImNX.js";import{t as T}from"./chevron-left-small-CSh-sE9L.js";import{t as E}from"./close-BdmyeRqS.js";var D=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,O=`0 0 100 100`,k=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,A=`0 0 12 12`,j=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,M=`0 0 24 24`,N=a(),P=3/2;function F({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,N.jsx)(x,{width:Math.round(t*P),height:t,className:l(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:O,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fill:`currentColor`,d:D})}):e===`codex`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:A,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:k,fill:`currentColor`})}):e===`gemini`?(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:M,width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,N.jsx)(`path`,{fill:`currentColor`,d:j})}):(0,N.jsx)(C,{width:t,height:t,className:l(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function I(){return new f(u())}function L(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var R=class{static async listWorkspaces(){return L(await I().listWorkspaces())}static async addWorkspaces(e){return L(await I().addWorkspaces(e))}static async removeWorkspace(e){await I().deleteWorkspace(e)}static async addWorkspaceParents(e){return L(await I().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await I().deleteWorkspaceParent(e)}};function z(){let e=s();return r({mutationFn:e=>R.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function B(){let e=s();return r({mutationFn:e=>R.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function V(){let e=s();return r({mutationFn:e=>R.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}function H(){let e=s();return r({mutationFn:e=>R.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:h.all})})}var U=e(t(),1);function W({enabled:e=!0}={}){return n({queryKey:h.all,queryFn:()=>R.listWorkspaces(),enabled:e,retry:(e,t)=>!p(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function G(){let{data:e,isLoading:t,isError:n,error:r}=W(),a=p(r),o=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,U.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,a]),l=i({queries:a?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new m(u()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),d=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,U.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),o.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[o,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),isLoading:d,isError:f,error:r}}function K(e,t){return p(e)?t(o.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function q(){return new m(u())}var J=e=>{let t=d();return n({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>q().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},Y=()=>{let e=d();return n({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>q().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},X=`/projects`;function Z({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,N.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,N.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,N.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:l(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,N.jsx)(w,{width:14,height:14,className:`shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function Q(e){let t=e.replace(/\/+$/,``);if(!t||t===`/`)return null;let n=t.lastIndexOf(`/`);return n<=0?`/`:t.slice(0,n)}function $(e){return e?.home===`/home/openhands`}function ee({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=c(`openhands`),[a,s]=(0,U.useState)(null),u=d(),{data:f}=Y();(0,U.useEffect)(()=>{e&&f?.home&&a===null&&s($(f)?X:f.home),e||s(null)},[e,f?.home,a]),(0,U.useEffect)(()=>{s(null)},[u.backend.id,u.orgId]);let{data:p,isLoading:m,isError:h,error:x}=J(e?a:null),S=(0,U.useMemo)(()=>{if(!f?.home)return[];let e=[{label:`Home`,path:f.home.replace(/[\\/]+$/,``)||f.home},...f.favorites??[]];return $(f)&&!e.some(e=>e.path===X)&&e.push({label:X,path:X}),e},[f]),C=f?.locations??[];if(!e)return null;let E=p?.items??[],D=a?Q(a):null,O=f?.home===`/home/openhands`&&(f?.favorites?.length??0)===0&&a===f?.home&&!m&&!h&&E.length===0,k=e=>{let t=e.replace(/\/+$/,``);if(!t)return`/`;let n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1)||`/`:t};return(0,N.jsx)(g,{onClose:t,"aria-label":i(o.HOME$ADD_WORKSPACES_TITLE),children:(0,N.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:l(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,_(`xl`),v,`h-[480px]`),children:[(0,N.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,N.jsx)(y,{className:`text-sm font-medium text-white`,title:i(o.HOME$ADD_WORKSPACES_TITLE)})}),(0,N.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,N.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,N.jsx)(Z,{label:i(o.HOME$FAVORITES),entries:S,currentPath:a,onPick:s}),(0,N.jsx)(Z,{label:i(o.HOME$LOCATIONS),entries:C,currentPath:a,onPick:s})]}),(0,N.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,N.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>D&&s(D),disabled:!D,"aria-label":`Up`,className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,N.jsx)(T,{width:16,height:16})}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,N.jsx)(`span`,{children:i(o.HOME$NAME)}),(0,N.jsx)(`span`,{children:i(o.HOME$KIND)})]}),(0,N.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[m&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(o.HOME$LOADING)}),h&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:x?.message??`Failed to load`}),!m&&!h&&E.length===0&&(0,N.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":O?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(O?o.HOME$HOST_HOME_NOT_MOUNTED_HINT:o.HOME$NO_WORKSPACES)}),E.map(e=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,N.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(o.HOME$FOLDER)})]})},e.path))]})]})]}),(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,N.jsx)(b,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(o.HOME$CANCEL)}),r&&(0,N.jsx)(b,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-add-all-subdirs`,children:i(o.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,N.jsx)(b,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-use`,children:i(o.HOME$ADD_THIS_DIRECTORY)})]})]})})}function te({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:s}=c(`openhands`),[u,d]=U.useState(null);if(!e)return null;let f=t.filter(e=>!e.parentPath),p=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=p.get(e.parentPath)??[];t.push(e),p.set(e.parentPath,t)});let m=f.length>0||n.length>0;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(g,{onClose:r,"aria-label":s(o.HOME$MANAGE_WORKSPACES),children:(0,N.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:l(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,_(`lg`),v,`max-h-[70vh]`),children:[(0,N.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,N.jsx)(y,{className:`text-sm font-medium text-white`,title:s(o.HOME$MANAGE_WORKSPACES)})}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!m&&(0,N.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(o.HOME$MANAGE_WORKSPACES_EMPTY)}),f.length>0&&(0,N.jsx)(`ul`,{children:f.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,N.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,N.jsxs)(`button`,{type:`button`,onClick:()=>d({type:`workspace`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(o.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,N.jsx)(E,{width:12,height:12}),(0,N.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,N.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,N.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(o.HOME$WORKSPACE_PARENTS)}),(0,N.jsx)(`ul`,{children:n.map(e=>{let t=p.get(e.path)??[];return(0,N.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,N.jsx)(w,{width:16,height:16,className:`shrink-0`}),(0,N.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,N.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,N.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,N.jsxs)(`button`,{type:`button`,onClick:()=>d({type:`parent`,path:e.path,text:s(o.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(o.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,N.jsx)(E,{width:12,height:12}),(0,N.jsx)(`span`,{children:s(o.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,N.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,N.jsx)(w,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,N.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,N.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,N.jsx)(b,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(o.HOME$DONE)})})]})}),u&&(0,N.jsx)(S,{text:u.text,onConfirm:()=>{u&&(u.type===`workspace`?i(u.path):a?.(u.path),d(null))},onCancel:()=>d(null)})]})}export{W as a,B as c,G as i,H as l,ee as n,V as o,K as r,z as s,te as t,F as u};