@openhands/agent-canvas 1.0.0-alpha.7 → 1.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -18
- package/bin/agent-canvas.mjs +27 -1
- package/build/assets/{QueryClientProvider-DITRCGAK.js → QueryClientProvider-B7kl84Kj.js} +1 -1
- package/build/assets/{Trans-D43bd3yR.js → Trans-1j65oy9O.js} +1 -1
- package/build/assets/{acp-providers-SCPK1BIU.js → acp-providers-DauuOsW9.js} +1 -1
- package/build/assets/{acp-route-guard-IWlFmS6x.js → acp-route-guard-CQTmeJwM.js} +1 -1
- package/build/assets/{active-backend-context-CkP3ZEJs.js → active-backend-context-TVbjnvmP.js} +1 -1
- package/build/assets/add-backend-modal-KMmPQNZU.js +1 -0
- package/build/assets/{agent-server-client-options-8OJSXbm8.js → agent-server-client-options-DT2GP6VJ.js} +1 -1
- package/build/assets/{agent-server-compatibility-DvKtnXHw.js → agent-server-compatibility-2aOx5iWd.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-BdEre_71.js → agent-server-conversation-service.api-DSl9G5UR.js} +3 -3
- package/build/assets/{agent-settings-DdisD2Xx.js → agent-settings-B247S9G3.js} +2 -2
- package/build/assets/{alert-banner-CvTYN73l.js → alert-banner-BWoqueRw.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-BKgT9i2w.js → analytics-consent-form-modal-C7sXfxRh.js} +1 -1
- package/build/assets/{app-settings-DcYXtxGP.js → app-settings-BVeSaty9.js} +1 -1
- package/build/assets/{automation-detail-D7GEU0vR.js → automation-detail-g5-RZ0da.js} +1 -1
- package/build/assets/{automations-list-CkVNsgzm.js → automations-list-DHoq_0MM.js} +1 -1
- package/build/assets/{backend-form-modal-KudhWUX8.js → backend-form-modal-K6IMCr3p.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BFy2HylT.js → backend-synced-settings-badge-nAfiUWvM.js} +1 -1
- package/build/assets/{base-modal-B4HvlFHE.js → base-modal-CQRvRHu1.js} +1 -1
- package/build/assets/{brand-button-8fVVei4i.js → brand-button-C2nEKopC.js} +1 -1
- package/build/assets/{browser-vYpdU3CR.js → browser-DKG63inJ.js} +1 -1
- package/build/assets/{browser-tab-DTM6RyoV.js → browser-tab-B_BuTvrO.js} +1 -1
- package/build/assets/{checkmark-BcvXE9bf.js → checkmark-BJJrZUF8.js} +1 -1
- package/build/assets/{chevron-left-small-BqSkXTeq.js → chevron-left-small-CSh-sE9L.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-DRvuu-RD.js → circle-plus-check-toggle-qs8Va1cC.js} +1 -1
- package/build/assets/{clock-DfoVUZVq.js → clock-ZR4Kn-_Y.js} +1 -1
- package/build/assets/{close-SnIy2eLD.js → close-BdmyeRqS.js} +1 -1
- package/build/assets/{combobox-caret-BMsz5mQX.js → combobox-caret-B53O9Hsq.js} +1 -1
- package/build/assets/{condenser-settings-DduLQcpV.js → condenser-settings-A35V3yng.js} +1 -1
- package/build/assets/{confirmation-modal-B-DOYMUH.js → confirmation-modal-C9-La0h3.js} +1 -1
- package/build/assets/{context-menu-list-item-DzjPB8aC.js → context-menu-list-item-Buu9nc0q.js} +1 -1
- package/build/assets/conversation-BD5WemJI.js +19 -0
- package/build/assets/conversation-C47K62n8.js +1 -0
- package/build/assets/conversation-panel-Dn-S56Gk.js +1 -0
- package/build/assets/{conversation-service.api-YTGTw0pz.js → conversation-service.api-C8pYCyV6.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-BtFDbyTe.js → conversation-tab-empty-state-D8dNvo-V.js} +1 -1
- package/build/assets/{conversation-websocket-context-DulnrIHh.js → conversation-websocket-context-Ywrxd_9p.js} +1 -1
- package/build/assets/{copy-BxgbrjDT.js → copy-C7Ti2d8C.js} +1 -1
- package/build/assets/{custom-toast-handlers-BYxhSr3t.js → custom-toast-handlers-BOc3qeQ7.js} +1 -1
- package/build/assets/declaration-D378OjpZ.js +1 -0
- package/build/assets/{device-verify-CTbXX9CQ.js → device-verify-CMusn8nX.js} +1 -1
- package/build/assets/edit-automation-modal-Dnjxbjn7.js +1 -0
- package/build/assets/{ellipsis-button-BoU2-xlG.js → ellipsis-button-ugUATsNo.js} +1 -1
- package/build/assets/{entry.client-DU7-q4ZU.js → entry.client-D9uR9Blz.js} +2 -2
- package/build/assets/{enum-filter-dropdown-BJt-NplD.js → enum-filter-dropdown-1vpOGySB.js} +1 -1
- package/build/assets/{environment-switch-overlay-DQ1n6Iu6.js → environment-switch-overlay-CTCTQikP.js} +1 -1
- package/build/assets/{extensions-hub-BW1FAKFJ.js → extensions-hub-BSUseHVF.js} +1 -1
- package/build/assets/{extensions-navigation-CbPMhSML.js → extensions-navigation-CT1kc1u_.js} +1 -1
- package/build/assets/{files-tab-CbJ4s7Ik.js → files-tab-B3A1NDlZ.js} +1 -1
- package/build/assets/{folder-CerIk8uG.js → folder-0WSMImNX.js} +1 -1
- package/build/assets/git-control-bar-branch-button-CcIpmyfM.js +27 -0
- package/build/assets/{git-provider-icon-D8RE4unY.js → git-provider-icon-DYE9n7fs.js} +1 -1
- package/build/assets/{home-DR11ejqB.js → home-dIzxi5Dd.js} +1 -1
- package/build/assets/{i18n-DkYgs32x.js → i18n-DjAGhTis.js} +1 -1
- package/build/assets/install-server-modal-z5VaHeXd.js +1 -0
- package/build/assets/{launch-DKCU9uJH.js → launch-hZ0ifhcV.js} +1 -1
- package/build/assets/{lesson-plan-CmkRbe6Z.js → lesson-plan-DRYG5SLI.js} +1 -1
- package/build/assets/{link-external-CvxB0BmI.js → link-external-Df8J52xI.js} +1 -1
- package/build/assets/{llm-client-BpIfxETv.js → llm-client-ChQzg4wX.js} +1 -1
- package/build/assets/llm-settings-2036m7Wt.js +1 -0
- package/build/assets/{llm-settings-BOJC4vD-.js → llm-settings-CcHqGOYL.js} +1 -1
- package/build/assets/{loading-spinner-91b5FiMQ.js → loading-spinner-C04FGh14.js} +1 -1
- package/build/assets/{manage-backends-modal-DqpzcxdI.js → manage-backends-modal-rYeyGx7j.js} +1 -1
- package/build/assets/{manage-workspaces-modal-eG6XgAvw.js → manage-workspaces-modal-C5EuW8m1.js} +1 -1
- package/build/assets/manifest-97e839da.js +1 -0
- package/build/assets/{markdown-renderer-wZnLDbA1.js → markdown-renderer-CEX4Becj.js} +1 -1
- package/build/assets/mcp-C06YssEI.js +9 -0
- package/build/assets/messages-T2ewVkbp.js +36 -0
- package/build/assets/{modal-backdrop-B04pVYAD.js → modal-backdrop-DTYGVmOR.js} +1 -1
- package/build/assets/{modal-body-CgUoFQA1.js → modal-body-YElmM1dV.js} +1 -1
- package/build/assets/{modal-close-button-SM_WXzDY.js → modal-close-button-C_GpQt9F.js} +1 -1
- package/build/assets/{model-selector-7id-Uirf.js → model-selector-DeMmw-Xa.js} +1 -1
- package/build/assets/{navigation-context-BFjstyH6.js → navigation-context-DeIPtGPp.js} +1 -1
- package/build/assets/{navigation-link-DFQ7YcWq.js → navigation-link-C9JD4PYD.js} +1 -1
- package/build/assets/{openhands-logo-DkDp75rC.js → openhands-logo-CI5Fhn1W.js} +1 -1
- package/build/assets/{option-service.api-DN0ZcGjw.js → option-service.api-DsI1UW7N.js} +1 -1
- package/build/assets/{organization-service.api-Ct2dZF8M.js → organization-service.api-COwMPFg5.js} +1 -1
- package/build/assets/{path-utils-D1ZtqFC7.js → path-utils-CqJboYxo.js} +1 -1
- package/build/assets/{plan-components-gOm-daR3.js → plan-components-DEjMuDDG.js} +1 -1
- package/build/assets/{planner-tab-yubfN-6U.js → planner-tab-BrntFmb1.js} +1 -1
- package/build/assets/{profiles-client-D4twHRVf.js → profiles-client-BGkKEV9j.js} +1 -1
- package/build/assets/{providers-C2T07PM3.js → providers-DXvCAN_u.js} +1 -1
- package/build/assets/{proxy-BMZyC45G.js → proxy-CurRmrqf.js} +1 -1
- package/build/assets/{query-client-config-CiK0GJJO.js → query-client-config-Ba7qAAoO.js} +1 -1
- package/build/assets/recommended-automations-launcher-BI9NhG8Y.js +52 -0
- package/build/assets/root-BS1Td78t.js +2 -0
- package/build/assets/root-DHeCXo9N.css +1 -0
- package/build/assets/{root-layout-B4QioBS6.js → root-layout-BLjAEgle.js} +2 -2
- package/build/assets/{sdk-section-page-03k88tIR.js → sdk-section-page-CJW0G04-.js} +1 -1
- package/build/assets/{sdk-settings-schema-BY8dOy3a.js → sdk-settings-schema-QBYH-ONX.js} +1 -1
- package/build/assets/{search-BCAF9EDS.js → search-Cq_cFrDt.js} +1 -1
- package/build/assets/{secrets-service-Z3qtRb_G.js → secrets-service-Bwd5DeUs.js} +1 -1
- package/build/assets/{secrets-settings-BnlByuMZ.js → secrets-settings-MLXqOtX2.js} +1 -1
- package/build/assets/{server-client-CG1zHqph.js → server-client-C3mC8Hl3.js} +1 -1
- package/build/assets/{settings-DyzGLF_d.js → settings-D7E2U5tK.js} +1 -1
- package/build/assets/{settings-client-CkXDJwIY.js → settings-client-CwjfwoiB.js} +1 -1
- package/build/assets/{settings-dropdown-input-CAQWQgx-.js → settings-dropdown-input-VwAXNrOb.js} +1 -1
- package/build/assets/{settings-gear-D4ZkEDGb.js → settings-gear-BJwWR1ej.js} +1 -1
- package/build/assets/{settings-index-KtTw49xL.js → settings-index-J-3BNR0W.js} +1 -1
- package/build/assets/{settings-input-BWCZt9g2.js → settings-input-DBywAnA7.js} +1 -1
- package/build/assets/{settings-list-classes-xMleGkTC.js → settings-list-classes-BOS092DR.js} +1 -1
- package/build/assets/{settings-modal-Cv2YWSUY.js → settings-modal-B8vgWDTe.js} +1 -1
- package/build/assets/{settings-section-header-context-1wfkgjZZ.js → settings-section-header-context-32x6WTyL.js} +1 -1
- package/build/assets/settings-service.api-FvJGK45W.js +1 -0
- package/build/assets/{settings-switch-CGap2LtG.js → settings-switch-DTKmHC8F.js} +1 -1
- package/build/assets/{settings-utils-BBozxqqi.js → settings-utils-BsvSU3OM.js} +1 -1
- package/build/assets/{shared-conversation-DQlzwdpo.js → shared-conversation-a0QV8o99.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DXplko7u.js → sidebar-mobile-menu-toggle-DTUNI1WQ.js} +1 -1
- package/build/assets/{sidebar-nav-link-B4h8naZ7.js → sidebar-nav-link-CnWoZcwc.js} +1 -1
- package/build/assets/{skill-card-pill-row-D0oTWx-a.js → skill-card-pill-row-tZ599jli.js} +1 -1
- package/build/assets/{skills-BN8atjgW.js → skills-ZyAO5dyK.js} +1 -1
- package/build/assets/{skills-plugins-BTnp7QcQ.js → skills-plugins-BSRz041I.js} +1 -1
- package/build/assets/{skills-settings-CbOQvzkR.js → skills-settings-DOnMn9q1.js} +2 -2
- package/build/assets/{status-DDL-ipIP.js → status-CsatcFbK.js} +1 -1
- package/build/assets/{styled-tooltip-Awq4HMw3.js → styled-tooltip-CS3mB_1X.js} +1 -1
- package/build/assets/{switch-skeleton-Bv21RGWd.js → switch-skeleton-C-CfhYYV.js} +1 -1
- package/build/assets/{task-list-tab-B45ktzHM.js → task-list-tab-Day9nhRT.js} +1 -1
- package/build/assets/{terminal-DGuR4559.js → terminal-LNa-iU5c.js} +1 -1
- package/build/assets/{terminal-D5pzR9Ru.js → terminal-ro4SNjUU.js} +1 -1
- package/build/assets/{toggle-switch-gj6T-wsU.js → toggle-switch-k-IZCDbt.js} +1 -1
- package/build/assets/{typography-BbaUAC4V.js → typography-vVUMoNUg.js} +1 -1
- package/build/assets/{u-check-circle-DHGiAi-w.js → u-check-circle-DplbarS5.js} +1 -1
- package/build/assets/{u-check-circle-half-BPcWtWwv.js → u-check-circle-half-yDuiSZHC.js} +1 -1
- package/build/assets/{u-circuit-B_nK9hOu.js → u-circuit-C9tYkpeK.js} +1 -1
- package/build/assets/{u-edit-BPFJBd34.js → u-edit-KAUlufD8.js} +1 -1
- package/build/assets/{use-active-conversation-Bu5J9iLy.js → use-active-conversation-D15D9GgR.js} +1 -1
- package/build/assets/{use-agent-settings-schema-BbtOsR7P.js → use-agent-settings-schema-Bvp5UzV8.js} +1 -1
- package/build/assets/{use-agent-state-DN9Nc5pP.js → use-agent-state-DE5dlEXJ.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B_rMUiu8.js → use-cloud-current-user-id-DWVar4st.js} +1 -1
- package/build/assets/{use-config-Bcz2JL2t.js → use-config-BSu_53GL.js} +1 -1
- package/build/assets/{use-conversation-id-BOaaZahn.js → use-conversation-id-DajhCn2A.js} +1 -1
- package/build/assets/{use-create-conversation-BWFA_FId.js → use-create-conversation-DW7AGgLA.js} +1 -1
- package/build/assets/{use-handle-plan-click-CgrCGmT1.js → use-handle-plan-click-DpgEQDAV.js} +1 -1
- package/build/assets/use-is-authed-hXC8vxgT.js +1 -0
- package/build/assets/{use-is-creating-conversation-DhoM7UAB.js → use-is-creating-conversation-DhDeeWfA.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-DOyQsXFO.js → use-launch-skill-in-chat-DVGPFrbI.js} +1 -1
- package/build/assets/{use-llm-profiles-CAIzHJDX.js → use-llm-profiles-D3-KXwQ0.js} +1 -1
- package/build/assets/use-runtime-is-ready-XFbT16BD.js +1 -0
- package/build/assets/{use-save-settings-5m3w89Ph.js → use-save-settings-CEEKSTWG.js} +1 -1
- package/build/assets/{use-settings-DzG0C3vO.js → use-settings-DQ7Oo1Hj.js} +1 -1
- package/build/assets/{use-settings-nav-items-BIsKeX52.js → use-settings-nav-items-YmrXrjn9.js} +2 -2
- package/build/assets/{use-skills-Cn-78xP1.js → use-skills-Xe0vjPMt.js} +1 -1
- package/build/assets/{use-unified-vscode-url-C5iI-Z5A.js → use-unified-vscode-url-BOsIOd-b.js} +1 -1
- package/build/assets/use-user-conversation-Mc0mQgkl.js +1 -0
- package/build/assets/{useMutation-CRJwk4cR.js → useMutation-B4OUESdw.js} +1 -1
- package/build/assets/{useTranslation-01pF7z10.js → useTranslation-CpIcQBq6.js} +1 -1
- package/build/assets/{utils-Czcl6buL.js → utils-D-HX7JCe.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation-CbjvWBSu.js → vendor~conversation-panel~conversation-BlCIz9XQ.js} +1 -1
- 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
- package/build/assets/vendor~home~mcp~automations-list-C5PoHCy6.js +1 -0
- 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
- 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
- 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
- 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
- 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
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-CHrEOFl6.js +48 -0
- 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
- package/build/assets/{verification-settings-DbziMp4K.js → verification-settings-BtlTiHP8.js} +1 -1
- package/build/assets/{vscode-tab-BVhQR2rt.js → vscode-tab-C0ShhiSU.js} +1 -1
- package/build/assets/{waiting-for-runtime-message-JotSOBdC.js → waiting-for-runtime-message-DWPl_Yby.js} +1 -1
- package/build/assets/{x-mark-CZ57VvRX.js → x-mark-CWI0f9yI.js} +1 -1
- package/build/favicon.svg +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +8 -0
- package/build/locales/ca/openhands.json +8 -0
- package/build/locales/de/openhands.json +8 -0
- package/build/locales/en/openhands.json +8 -0
- package/build/locales/es/openhands.json +8 -0
- package/build/locales/fr/openhands.json +8 -0
- package/build/locales/it/openhands.json +8 -0
- package/build/locales/ja/openhands.json +8 -0
- package/build/locales/ko-KR/openhands.json +8 -0
- package/build/locales/no/openhands.json +8 -0
- package/build/locales/pt/openhands.json +8 -0
- package/build/locales/tr/openhands.json +8 -0
- package/build/locales/uk/openhands.json +8 -0
- package/build/locales/zh-CN/openhands.json +8 -0
- package/build/locales/zh-TW/openhands.json +8 -0
- package/config/defaults.json +1 -1
- package/dist/api/agent-server-config.cjs +1 -1
- package/dist/api/agent-server-config.cjs.map +1 -1
- package/dist/api/agent-server-config.d.ts +1 -1
- package/dist/api/agent-server-config.js +1 -1
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +12 -0
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +4 -0
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs +2 -0
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -0
- package/dist/api/mcp-service/mcp-service.api.d.ts +6 -0
- package/dist/api/mcp-service/mcp-service.api.js +36 -0
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -0
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.d.ts +1 -0
- package/dist/api/settings-service/settings-service.api.js +59 -41
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/features/automations/detail/activity-log-item.d.ts +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +1 -1
- package/dist/components/features/chat/change-agent-button.cjs +1 -1
- package/dist/components/features/chat/change-agent-button.cjs.map +1 -1
- package/dist/components/features/chat/change-agent-button.js +65 -59
- package/dist/components/features/chat/change-agent-button.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +15 -14
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-actions.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-actions.js +127 -149
- package/dist/components/features/chat/components/chat-input-actions.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-model.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-model.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-model.d.ts +10 -0
- package/dist/components/features/chat/components/chat-input-model.js +95 -60
- package/dist/components/features/chat/components/chat-input-model.js.map +1 -1
- package/dist/components/features/chat/git-control-bar.cjs +1 -1
- package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar.js +60 -59
- package/dist/components/features/chat/git-control-bar.js.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.js +2 -2
- package/dist/components/features/conversation/conversation-name-with-status.js.map +1 -1
- package/dist/components/features/conversation/conversation-name.cjs +1 -1
- package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-name.js +3 -3
- package/dist/components/features/conversation/conversation-name.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +16 -16
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
- package/dist/components/features/mcp-logo-badge.cjs +1 -1
- package/dist/components/features/mcp-logo-badge.cjs.map +1 -1
- package/dist/components/features/mcp-logo-badge.d.ts +2 -2
- package/dist/components/features/mcp-logo-badge.js +1 -1
- package/dist/components/features/mcp-logo-badge.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +64 -41
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.d.ts +1 -1
- package/dist/components/features/mcp-page/install-server-modal.js +126 -102
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.js +1 -1
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/mcp-page/marketplace-card.cjs +1 -1
- package/dist/components/features/mcp-page/marketplace-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/marketplace-card.d.ts +1 -1
- package/dist/components/features/mcp-page/marketplace-card.js +27 -25
- package/dist/components/features/mcp-page/marketplace-card.js.map +1 -1
- package/dist/components/features/mcp-page/marketplace-section.cjs +1 -1
- package/dist/components/features/mcp-page/marketplace-section.cjs.map +1 -1
- package/dist/components/features/mcp-page/marketplace-section.d.ts +1 -1
- package/dist/components/features/mcp-page/marketplace-section.js +1 -1
- package/dist/components/features/mcp-page/marketplace-section.js.map +1 -1
- package/dist/components/features/mcp-page/mcp-logo-stack-badge.d.ts +2 -2
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +7 -7
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.d.ts +8 -12
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js +114 -87
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/context/scroll-context.cjs +1 -1
- package/dist/context/scroll-context.cjs.map +1 -1
- package/dist/context/scroll-context.d.ts +1 -0
- package/dist/context/scroll-context.js +4 -1
- package/dist/context/scroll-context.js.map +1 -1
- package/dist/favicon.svg +1 -0
- package/dist/hooks/mutation/use-switch-acp-model.cjs +2 -0
- package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -0
- package/dist/hooks/mutation/use-switch-acp-model.d.ts +23 -0
- package/dist/hooks/mutation/use-switch-acp-model.js +26 -0
- package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -0
- package/dist/hooks/mutation/use-test-mcp-server.cjs +2 -0
- package/dist/hooks/mutation/use-test-mcp-server.cjs.map +1 -0
- package/dist/hooks/mutation/use-test-mcp-server.d.ts +2 -0
- package/dist/hooks/mutation/use-test-mcp-server.js +10 -0
- package/dist/hooks/mutation/use-test-mcp-server.js.map +1 -0
- package/dist/hooks/query/use-automation-detail.d.ts +3 -2
- package/dist/hooks/use-acp-model-context.cjs.map +1 -1
- package/dist/hooks/use-acp-model-context.d.ts +3 -4
- package/dist/hooks/use-acp-model-context.js.map +1 -1
- package/dist/hooks/use-chat-input-model-state.cjs +2 -0
- package/dist/hooks/use-chat-input-model-state.cjs.map +1 -0
- package/dist/hooks/use-chat-input-model-state.d.ts +12 -0
- package/dist/hooks/use-chat-input-model-state.js +29 -0
- package/dist/hooks/use-chat-input-model-state.js.map +1 -0
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +8 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +136 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +8 -0
- package/dist/locales/ca/openhands.json +8 -0
- package/dist/locales/de/openhands.json +8 -0
- package/dist/locales/en/openhands.json +8 -0
- package/dist/locales/es/openhands.json +8 -0
- package/dist/locales/fr/openhands.json +8 -0
- package/dist/locales/it/openhands.json +8 -0
- package/dist/locales/ja/openhands.json +8 -0
- package/dist/locales/ko-KR/openhands.json +8 -0
- package/dist/locales/no/openhands.json +8 -0
- package/dist/locales/pt/openhands.json +8 -0
- package/dist/locales/tr/openhands.json +8 -0
- package/dist/locales/uk/openhands.json +8 -0
- package/dist/locales/zh-CN/openhands.json +8 -0
- package/dist/locales/zh-TW/openhands.json +8 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js +37 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/airtable.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/apify.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/atlassian.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/brave-search.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js +31 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/browser-mcp.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js +52 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/clickhouse.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-bindings.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-bindings.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-browser-rendering.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-browser-rendering.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-builds.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-builds.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-docs.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-docs.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/cloudflare-observability.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/cloudflare-observability.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/deepwiki.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/deepwiki.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/elevenlabs.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/everything.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/everything.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/exa.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/fetch.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/fetch.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js +40 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/figma.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js +39 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/filesystem.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/firecrawl.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/git.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js +40 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/git.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js +47 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/github.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/huggingface.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/huggingface.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/kagi.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/linear.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/linear.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/memory.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/memory.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js +36 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/mongodb.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js +40 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/neon.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +39 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js +38 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/obsidian.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/paypal.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/paypal.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/playwright.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/playwright.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js +43 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/redis.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js +41 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/resend.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sentry.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sentry.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/sequential-thinking.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/sequential-thinking.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js +45 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/slack.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/stripe.js +15 -5
- package/dist/node_modules/@openhands/extensions/integrations/catalog/stripe.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js +37 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/supabase.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/tavily.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js +39 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/tavily.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/time.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/catalog/time.js +13 -6
- package/dist/node_modules/@openhands/extensions/integrations/catalog/time.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/index.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/index.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/index.js +175 -0
- package/dist/node_modules/@openhands/extensions/integrations/index.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/logos.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/{mcps → integrations}/logos.js +2 -2
- package/dist/node_modules/@openhands/extensions/integrations/logos.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js +548 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-catalog.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js +482 -0
- package/dist/node_modules/@openhands/extensions/integrations/oauth-provider-registration-defaults.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js +22 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/mcp-client.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +3 -0
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +6 -4
- package/dist/package.js.map +1 -1
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js +1 -1
- package/dist/routes/mcp.js.map +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs +1 -1
- package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
- package/dist/utils/mcp-marketplace-utils.d.ts +21 -1
- package/dist/utils/mcp-marketplace-utils.js +23 -13
- package/dist/utils/mcp-marketplace-utils.js.map +1 -1
- package/dist/utils/settings-utils.cjs.map +1 -1
- package/dist/utils/settings-utils.js.map +1 -1
- package/package.json +6 -4
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +25 -7
- package/scripts/dev-with-automation.mjs +6 -1
- package/tools/canvas_ui_tool.py +129 -0
- package/build/assets/add-backend-modal-CqjNjGqY.js +0 -1
- package/build/assets/conversation-COZAKz_K.js +0 -1
- package/build/assets/conversation-DWcvnmds.js +0 -19
- package/build/assets/conversation-panel-CZDStT0b.js +0 -1
- package/build/assets/declaration-C9nuq2Dj.js +0 -1
- package/build/assets/edit-automation-modal-C3bFxS2f.js +0 -1
- package/build/assets/git-control-bar-branch-button-Bm6rzSpo.js +0 -27
- package/build/assets/install-server-modal-VB5hOBpW.js +0 -1
- package/build/assets/llm-settings-CIdxmimN.js +0 -1
- package/build/assets/manifest-f041e61a.js +0 -1
- package/build/assets/mcp-BdfyCW1l.js +0 -9
- package/build/assets/messages-v-q35ObG.js +0 -36
- package/build/assets/recommended-automations-launcher-Cx7svuGE.js +0 -52
- package/build/assets/root-D2PVd51i.js +0 -2
- package/build/assets/root-DEotKI6b.css +0 -1
- package/build/assets/settings-service.api-Z6x0l0GU.js +0 -1
- package/build/assets/use-is-authed-BFoh8Ogh.js +0 -1
- package/build/assets/use-runtime-is-ready-BQWLEyqa.js +0 -1
- package/build/assets/use-user-conversation-BCYpbPT1.js +0 -1
- package/build/assets/vendor~home~mcp~automations-list-DRfWZRnF.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js +0 -48
- package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js +0 -30
- package/dist/node_modules/@openhands/extensions/mcps/catalog/airtable.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/apify.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/atlassian.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/brave-search.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js +0 -24
- package/dist/node_modules/@openhands/extensions/mcps/catalog/browser-mcp.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js +0 -45
- package/dist/node_modules/@openhands/extensions/mcps/catalog/clickhouse.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-bindings.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-browser-rendering.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-builds.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-docs.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/cloudflare-observability.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/deepwiki.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/elevenlabs.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/everything.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/exa.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/fetch.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js +0 -33
- package/dist/node_modules/@openhands/extensions/mcps/catalog/figma.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js +0 -32
- package/dist/node_modules/@openhands/extensions/mcps/catalog/filesystem.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/firecrawl.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/git.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js +0 -33
- package/dist/node_modules/@openhands/extensions/mcps/catalog/git.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/github.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js +0 -40
- package/dist/node_modules/@openhands/extensions/mcps/catalog/github.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/huggingface.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/kagi.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/linear.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/memory.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js +0 -29
- package/dist/node_modules/@openhands/extensions/mcps/catalog/mongodb.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js +0 -33
- package/dist/node_modules/@openhands/extensions/mcps/catalog/neon.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js +0 -32
- package/dist/node_modules/@openhands/extensions/mcps/catalog/notion.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js +0 -31
- package/dist/node_modules/@openhands/extensions/mcps/catalog/obsidian.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/paypal.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/playwright.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js +0 -36
- package/dist/node_modules/@openhands/extensions/mcps/catalog/redis.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js +0 -34
- package/dist/node_modules/@openhands/extensions/mcps/catalog/resend.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sentry.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/sequential-thinking.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js +0 -38
- package/dist/node_modules/@openhands/extensions/mcps/catalog/slack.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/stripe.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js +0 -30
- package/dist/node_modules/@openhands/extensions/mcps/catalog/supabase.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js +0 -32
- package/dist/node_modules/@openhands/extensions/mcps/catalog/tavily.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/catalog/time.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/catalog/time.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/index.cjs +0 -2
- package/dist/node_modules/@openhands/extensions/mcps/index.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/index.js +0 -87
- package/dist/node_modules/@openhands/extensions/mcps/index.js.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/logos.cjs.map +0 -1
- package/dist/node_modules/@openhands/extensions/mcps/logos.js.map +0 -1
|
@@ -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{a as r,d as i,o as a}from"./path-utils-D1ZtqFC7.js";import{t as o}from"./useMutation-CRJwk4cR.js";import{o as s,t as c}from"./declaration-C9nuq2Dj.js";import{n as l}from"./QueryClientProvider-DITRCGAK.js";import{t as u}from"./useTranslation-01pF7z10.js";import{a as d,n as f,t as p}from"./custom-toast-handlers-BYxhSr3t.js";import{g as m,i as ee,t as h}from"./utils-Czcl6buL.js";import{c as g,t as _}from"./agent-server-client-options-8OJSXbm8.js";import{n as v}from"./active-backend-context-CkP3ZEJs.js";import{n as te}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js";import{r as y}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-BJm2mGIp.js";import{t as b}from"./agent-server-conversation-service.api-BdEre_71.js";import{n as ne}from"./navigation-context-BFjstyH6.js";import{t as re}from"./dist-DZHSA2e6.js";import{t as x}from"./proxy-BMZyC45G.js";import{t as S}from"./react-Do0CT17Y.js";import{r as C,t as ie}from"./middleware-BC9EwbB9.js";import{t as w}from"./conversation-local-storage-UYl-SX-r.js";import{t as T}from"./common-SMkEaBSr.js";import{t as E}from"./use-is-authed-BFoh8Ogh.js";import{r as D}from"./use-settings-DzG0C3vO.js";import{o as ae,s as oe,t as O}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BP1SKG0F.js";import{t as se}from"./git-status-mapper-BI8FyUVp.js";var k=s(),A=re(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function j({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,k.jsx)(`div`,{"data-testid":a,role:`separator`,className:h(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,k.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,k.jsx)(`div`,{"data-testid":a,role:`separator`,className:h(A({orientation:e,color:t,size:n,inset:r}),i)})}var M=()=>{let e=l();return o({mutationFn:e=>b.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{w(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},N=()=>{let{t:e}=u(`openhands`),t=l(),{conversationId:n,navigate:i}=ne();return o({mutationKey:[`stop-conversation`],mutationFn:async e=>a(e.conversationId),onMutate:async()=>{let n=d.loading(e(c.TOAST$STOPPING_CONVERSATION),p);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&d.dismiss(i.toastId),f(e(c.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(a,o,s)=>{s?.toastId&&d.dismiss(s.toastId),d.success(e(c.TOAST$CONVERSATION_STOPPED),p),r(t,o.conversationId,{execution_status:T.PAUSED,sandbox_status:`PAUSED`}),n===o.conversationId&&i(`/conversations`)}})},P=e(t()),F=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),I=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),L=e=>(0,k.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,k.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),R=e=>(0,k.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,k.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),z=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),B=()=>{let e=te(),{t}=u(`openhands`);return o({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e.capture(`download_trajectory_button_clicked`),ee(await b.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{f(t(c.CONVERSATION$DOWNLOAD_ERROR))}})},V=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),H=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},U=()=>{let{data:e,isLoading:t}=D();return{providers:P.useMemo(()=>H(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function W(){let e=g().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function G(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function K(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function q(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var J=e=>e,Y=()=>g().backend.kind===`cloud`,X=e=>!e||e===`undefined`||e===`null`,Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},ce={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return X(t)||!Y()?Z:G({provider:J(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return X(e)||!Y()?Z:G({provider:J(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(X(e)||!Y())return Z;let a=n[t];return a?G({provider:J(e),installationId:a,limit:i,pageId:r}):Z}static async getRepositoryBranches(e,t,n=``,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return X(e)||!Y()?ce:K({provider:J(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await b.resolveConversationWorkingDir(e);return(await new y(_({workingDir:t})).gitChanges(t,{ref:`HEAD`})).map(e=>({path:e.path,status:se(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new y(_()).gitDiff(t,{ref:`HEAD`});return{modified:n.modified??``,original:n.original??``}}},le=e=>{let{data:t}=E(),{providers:r}=U(),i=v();return n({queryKey:[`installations`,e,i.backend.id,i.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&r.length>0&&m(e,i.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function ue(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:a}=U(),{data:o}=le(t),s=o?.items,c=v(),l=t?m(t,c.backend.kind):!1,u=i({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function de(e,t,r,i=100){return n({queryKey:[`repositories`,`search`,e,t,i],queryFn:async()=>t?(await $.searchGitRepositories(e,t,i)).items:[],enabled:!!e&&!!t&&!r,staleTime:1e3*60*5,gcTime:1e3*60*15})}function fe(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var pe={recentRepositories:[],lastSelectedProvider:null},me=S()(C((e,t)=>({...pe,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:ie(()=>localStorage)}));function he({gitProvider:e,className:t}){return(0,k.jsxs)(k.Fragment,{children:[e===`github`&&(0,k.jsx)(ae,{size:14,className:t}),e===`gitlab`&&(0,k.jsx)(oe,{size:14,className:t}),e===`bitbucket`&&(0,k.jsx)(O,{size:14,className:t}),e===`bitbucket_data_center`&&(0,k.jsx)(O,{size:14,className:t}),e===`azure_devops`&&(0,k.jsx)(L,{className:h(t,`w-[14px] h-[14px]`)})]})}export{j as _,ue as a,V as c,R as d,L as f,M as g,N as h,de as i,B as l,F as m,me as n,$ as o,I as p,fe as r,U as s,he as t,z 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{a as r,d as i,o as a}from"./path-utils-CqJboYxo.js";import{t as o}from"./useMutation-B4OUESdw.js";import{o as s,t as c}from"./declaration-D378OjpZ.js";import{n as l}from"./QueryClientProvider-B7kl84Kj.js";import{t as u}from"./useTranslation-CpIcQBq6.js";import{a as d,n as f,t as p}from"./custom-toast-handlers-BOc3qeQ7.js";import{g as m,i as ee,t as h}from"./utils-D-HX7JCe.js";import{c as g,t as _}from"./agent-server-client-options-DT2GP6VJ.js";import{n as v}from"./active-backend-context-TVbjnvmP.js";import{n as te}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-VnmIZrq3.js";import{r as y}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-CHrEOFl6.js";import{t as b}from"./agent-server-conversation-service.api-DSl9G5UR.js";import{n as ne}from"./navigation-context-DeIPtGPp.js";import{t as re}from"./dist-DZHSA2e6.js";import{t as x}from"./proxy-CurRmrqf.js";import{t as S}from"./react-Do0CT17Y.js";import{r as C,t as ie}from"./middleware-BC9EwbB9.js";import{t as w}from"./conversation-local-storage-UYl-SX-r.js";import{t as T}from"./common-SMkEaBSr.js";import{t as E}from"./use-is-authed-hXC8vxgT.js";import{r as D}from"./use-settings-DQ7Oo1Hj.js";import{o as ae,s as oe,t as O}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BP1SKG0F.js";import{t as se}from"./git-status-mapper-BI8FyUVp.js";var k=s(),A=re(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function j({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,k.jsx)(`div`,{"data-testid":a,role:`separator`,className:h(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,k.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,k.jsx)(`div`,{"data-testid":a,role:`separator`,className:h(A({orientation:e,color:t,size:n,inset:r}),i)})}var M=()=>{let e=l();return o({mutationFn:e=>b.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{w(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},N=()=>{let{t:e}=u(`openhands`),t=l(),{conversationId:n,navigate:i}=ne();return o({mutationKey:[`stop-conversation`],mutationFn:async e=>a(e.conversationId),onMutate:async()=>{let n=d.loading(e(c.TOAST$STOPPING_CONVERSATION),p);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&d.dismiss(i.toastId),f(e(c.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(a,o,s)=>{s?.toastId&&d.dismiss(s.toastId),d.success(e(c.TOAST$CONVERSATION_STOPPED),p),r(t,o.conversationId,{execution_status:T.PAUSED,sandbox_status:`PAUSED`}),n===o.conversationId&&i(`/conversations`)}})},P=e(t()),F=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),I=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),L=e=>(0,k.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,k.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),R=e=>(0,k.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,k.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),z=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),B=()=>{let e=te(),{t}=u(`openhands`);return o({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e.capture(`download_trajectory_button_clicked`),ee(await b.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{f(t(c.CONVERSATION$DOWNLOAD_ERROR))}})},V=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),H=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},U=()=>{let{data:e,isLoading:t}=D();return{providers:P.useMemo(()=>H(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function W(){let e=g().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function G(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function K(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function q(e){let t=W(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await x({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var J=e=>e,Y=()=>g().backend.kind===`cloud`,X=e=>!e||e===`undefined`||e===`null`,Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},ce={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return X(t)||!Y()?Z:G({provider:J(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return X(e)||!Y()?Z:G({provider:J(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(X(e)||!Y())return Z;let a=n[t];return a?G({provider:J(e),installationId:a,limit:i,pageId:r}):Z}static async getRepositoryBranches(e,t,n=``,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return X(t)||!Y()?Q:q({provider:J(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return X(e)||!Y()?ce:K({provider:J(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await b.resolveConversationWorkingDir(e);return(await new y(_({workingDir:t})).gitChanges(t,{ref:`HEAD`})).map(e=>({path:e.path,status:se(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new y(_()).gitDiff(t,{ref:`HEAD`});return{modified:n.modified??``,original:n.original??``}}},le=e=>{let{data:t}=E(),{providers:r}=U(),i=v();return n({queryKey:[`installations`,e,i.backend.id,i.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&r.length>0&&m(e,i.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function ue(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:a}=U(),{data:o}=le(t),s=o?.items,c=v(),l=t?m(t,c.backend.kind):!1,u=i({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function de(e,t,r,i=100){return n({queryKey:[`repositories`,`search`,e,t,i],queryFn:async()=>t?(await $.searchGitRepositories(e,t,i)).items:[],enabled:!!e&&!!t&&!r,staleTime:1e3*60*5,gcTime:1e3*60*15})}function fe(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var pe={recentRepositories:[],lastSelectedProvider:null},me=S()(C((e,t)=>({...pe,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:ie(()=>localStorage)}));function he({gitProvider:e,className:t}){return(0,k.jsxs)(k.Fragment,{children:[e===`github`&&(0,k.jsx)(ae,{size:14,className:t}),e===`gitlab`&&(0,k.jsx)(oe,{size:14,className:t}),e===`bitbucket`&&(0,k.jsx)(O,{size:14,className:t}),e===`bitbucket_data_center`&&(0,k.jsx)(O,{size:14,className:t}),e===`azure_devops`&&(0,k.jsx)(L,{className:h(t,`w-[14px] h-[14px]`)})]})}export{j as _,ue as a,V as c,R as d,L as f,M as g,N as h,de as i,B as l,F as m,me as n,$ as o,I as p,fe as r,U as s,he as t,z as u};
|
|
@@ -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{o as r,t as i}from"./declaration-C9nuq2Dj.js";import{t as a}from"./use-is-creating-conversation-DhoM7UAB.js";import{t as o}from"./useTranslation-01pF7z10.js";import{t as s}from"./retrieve-axios-error-message-BY-yIkIq.js";import{t as c}from"./createLucideIcon-Ddu8jDOQ.js";import{s as l}from"./vendor~home~conversation-panel~conversation-PK1-gtXU.js";import{n as u}from"./git-branch-DQS2nMK4.js";import{t as d}from"./check-CYxAHs85.js";import{a as f,n as p,r as m,t as h}from"./custom-toast-handlers-BYxhSr3t.js";import{d as g,m as _}from"./conversation-websocket-context-DulnrIHh.js";import{a as v,i as y,r as b,t as x}from"./llm-settings-BOJC4vD-.js";import{t as S}from"./utils-Czcl6buL.js";import{n as C,r as w}from"./active-backend-context-CkP3ZEJs.js";import{t as T}from"./modal-backdrop-B04pVYAD.js";import{n as E,r as D,t as O}from"./modal-body-CgUoFQA1.js";import{r as k}from"./base-modal-B4HvlFHE.js";import{d as A,l as j,n as M,r as N,t as P}from"./brand-button-8fVVei4i.js";import{n as F}from"./navigation-context-BFjstyH6.js";import{t as I}from"./vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js";import{t as L}from"./styled-tooltip-Awq4HMw3.js";import{c as ee,d as R,n as te,s as z}from"./git-provider-icon-D8RE4unY.js";import{i as ne,t as re}from"./backend-form-modal-KudhWUX8.js";import{t as ie}from"./conversation-store-Z5iMCRpc.js";import{t as B}from"./modal-close-button-SM_WXzDY.js";import{i as ae,n as V}from"./acp-providers-SCPK1BIU.js";import{t as H}from"./use-create-conversation-BWFA_FId.js";import{a as U,c as oe,i as se,l as ce,n as le,o as ue,r as W,s as de,t as fe,u as G}from"./manage-workspaces-modal-eG6XgAvw.js";import{t as pe}from"./folder-CerIk8uG.js";import{t as me}from"./use-save-settings-5m3w89Ph.js";import{A as he,F as ge,I as _e,M as ve,N as ye,a as be,c as xe,d as Se,f as Ce,i as we,l as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./git-control-bar-branch-button-Bm6rzSpo.js";import{r as Ne}from"./typography-BbaUAC4V.js";import{t as Pe}from"./recommended-automations-launcher-Cx7svuGE.js";var Fe=c(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ie=c(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),K=e(t(),1);async function q(e){let{imagesToEmbed:t}=_e(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>ve(e)));g.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var J=r();function Le(){let{t:e}=o(`openhands`);return(0,J.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,J.jsx)(Ne.H1,{className:`w-full text-center leading-normal`,children:e(`HOME$LETS_START_BUILDING`)})})}function Re({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:a}=o(`openhands`),s=e===`local`,c=a(s?i.HOME$OPEN_WORKSPACE:i.COMMON$OPEN_REPOSITORY),l=(0,J.jsxs)(`button`,{type:`button`,"data-testid":s?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:S(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,M,j,A,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,J.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:s?(0,J.jsx)(u,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,J.jsx)(R,{width:16,height:16,className:`shrink-0`})}),(0,J.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:c})]});return r?(0,J.jsx)(L,{content:r,placement:`top`,children:(0,J.jsx)(`span`,{className:`inline-flex`,children:l})}):l}function ze({workspaces:e,value:t,placeholder:n,className:r,disabled:a=!1,disabledTooltip:s,showManage:c,onChange:l,onAddClick:u,onManageClick:d}){let{t:f}=o(`openhands`),[p,m]=(0,K.useState)(t?.name??``),h=(0,K.useRef)(null),g=(0,K.useMemo)(()=>{let t=p.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,p]),_=(0,K.useCallback)(e=>{l(e),e&&m(e.name)},[l]),v=(0,K.useCallback)(()=>{_(null),m(``)},[_]),{isOpen:y,getToggleButtonProps:b,getMenuProps:x,getInputProps:C,highlightedIndex:w,getItemProps:T,selectedItem:E,closeMenu:D}=I({items:g,itemToString:e=>e?.name??``,selectedItem:t,onSelectedItemChange:({selectedItem:e})=>{_(e??null)},inputValue:p,stateReducer:(e,t)=>t.type===I.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),O=(e,t,n,r,i)=>(0,J.jsx)(xe,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id},e.id),k=e=>(0,J.jsx)(Ae,{inputValue:e,searchMessage:f(i.HOME$NO_WORKSPACES),emptyMessage:f(i.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),A=(0,K.useMemo)(()=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:`flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),D(),u()},children:f(i.HOME$ADD_WORKSPACES)}),(c??e.length>0)&&(0,J.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:`flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),D(),d()},children:f(i.HOME$MANAGE_WORKSPACES)})]}),[u,d,f,D,e.length,c]),j=(0,J.jsxs)(`div`,{className:S(`relative`,r),children:[(0,J.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,J.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,J.jsx)(ee,{width:16,height:16})}),(0,J.jsx)(`input`,{...C({disabled:a,placeholder:n??f(i.HOME$WORKSPACE_PLACEHOLDER),className:S(N,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{m(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,J.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[t&&(0,J.jsx)(Me,{disabled:a,onClear:v}),(0,J.jsx)(Te,{isOpen:y,disabled:a,getToggleButtonProps:b})]})]}),(0,J.jsx)(De,{isOpen:y,filteredItems:g,inputValue:p,highlightedIndex:w,selectedItem:E,getMenuProps:x,getItemProps:T,menuRef:h,renderItem:O,renderEmptyState:k,stickyFooterItem:A,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return s?(0,J.jsx)(L,{content:s,placement:`top`,children:(0,J.jsx)(`span`,{className:`block`,children:j})}):j}function Be({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=o(`openhands`),{navigate:r}=F(),{data:s,error:c}=U(),l=s?.workspaceParents??[],{mutate:u}=de(),{mutate:d}=oe(),{mutate:f}=ue(),{mutate:p}=ce(),{workspaces:m,isLoading:h,isError:g,error:_}=se(),v=W(c??_,n),[y,b]=K.useState(null),[x,S]=K.useState(!1),[C,w]=K.useState(!1),{mutate:T,isPending:E,isSuccess:D}=H(),O=a(),k=E||D||O,A=l.length>0||!!v,j=null;v?j=v:h?j=n(i.HOME$LOADING):g&&(j=n(i.HOME$WORKSPACE_SCAN_ERROR));let M=!!v||e||h&&m.length===0;return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,J.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,J.jsx)(pe,{width:24,height:24}),(0,J.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(i.HOME$WORKSPACES_TAB)})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,J.jsx)(ze,{workspaces:m,value:y,placeholder:v?n(i.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):M?n(i.HOME$LOADING):void 0,disabled:M,disabledTooltip:v,showManage:m.length>0||l.length>0,onChange:b,onAddClick:()=>S(!0),onManageClick:()=>w(!0),className:`max-w-auto`}),A&&j&&(0,J.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:j})]}),(0,J.jsx)(P,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!y||!t&&k||e,onClick:()=>{if(y){if(t){t(y);return}T({workingDir:y.path},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:t?n(i.BUTTON$CONFIRM):k?n(i.HOME$LOADING):`Launch`}),(0,J.jsx)(le,{isOpen:x,onClose:()=>S(!1),onAdd:e=>u(e),onAddParent:e=>f(e)}),(0,J.jsx)(fe,{isOpen:C,workspaces:m,workspaceParents:l,onClose:()=>w(!1),onRemove:e=>{y?.path===e&&b(null),d(e)},onRemoveParent:e=>{y?.parentPath===e&&b(null),p(e)}})]})}function Ve({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=o(`openhands`),{isLoadingSettings:a}=z();return e?(0,J.jsx)(T,{onClose:t,children:(0,J.jsxs)(E,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,J.jsx)(B,{onClose:t,testId:`close-open-workspace-dialog`}),(0,J.jsx)(`div`,{className:`w-full pr-6`,children:(0,J.jsx)(k,{title:r(i.HOME$OPEN_WORKSPACE)})}),(0,J.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,J.jsx)(Be,{isLoadingSettings:a,onConfirm:e=>{n(e),t()}})})]})}):null}function He({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=F(),[s,c]=K.useState(null),[l,u]=K.useState(null),[d,f]=K.useState(null),{providers:p}=z(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=te(),{mutate:_,isPending:v,isSuccess:y}=H(),b=a(),{t:x}=o(`openhands`);K.useEffect(()=>{if(p.length!==0){if(p.length===1&&!d){f(p[0]);return}if(p.length>1&&!d){let e=g();e&&p.includes(e)&&f(e)}}},[p,d,g]);let S=v||y||b,C=t=>{t!==d&&(f(t),h(t),c(null),u(null),e?.(null))},w=K.useCallback(e=>{u(e)},[]);return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,J.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,J.jsx)(R,{width:24,height:24}),(0,J.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(i.COMMON$OPEN_REPOSITORY)})]})}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(i.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,J.jsx)(be,{providers:p,value:d,placeholder:`Select Provider`,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,J.jsx)(ke,{provider:d||p[0],value:s?.id||null,repositoryName:s?.full_name||null,placeholder:`user/repo`,disabled:!d||t,onChange:t=>{t?(e?.(t),c(t)):(e?.(null),c(null),u(null))},className:`max-w-auto`}),(()=>{let e=s?.main_branch||null;return(0,J.jsx)(we,{repository:s?.full_name||null,provider:d||p[0],selectedBranch:l,onBranchSelect:w,defaultBranch:e,placeholder:`Select branch...`,className:`max-w-full`,disabled:!s||t})})()]}),(0,J.jsx)(P,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!s||!l||!n&&S||p.length>1&&!d||t,onClick:()=>{if(!(!s||!l)){if(m(s),n){n({repository:s,branch:l,provider:d});return}_({repository:{name:s.full_name||``,gitProvider:s.git_provider||`github`,branch:l.name||`main`}},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:n?x(i.BUTTON$CONFIRM):S?x(`HOME$LOADING`):`Launch`})]})}function Ue({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=o(`openhands`),{isLoadingSettings:a}=z();return e?(0,J.jsx)(T,{onClose:t,children:(0,J.jsxs)(E,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,J.jsx)(B,{onClose:t,testId:`close-open-repository-dialog`}),(0,J.jsx)(`div`,{className:`w-full pr-6`,children:(0,J.jsx)(k,{title:r(i.COMMON$OPEN_REPOSITORY)})}),(0,J.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,J.jsx)(He,{isLoadingSettings:a,onConfirm:e=>{n(e),t()}})})]})}):null}function We({workspace:e,repository:t,branch:n,provider:r,onRepoClick:i}){let a=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,J.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,J.jsx)(Ee,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:a,onClick:i}),n?(0,J.jsx)(je,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function Ge(){let{t:e}=o(`openhands`),{backend:t}=C(),{navigate:n}=F(),r=t.kind===`local`,[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(null),[d,m]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),{mutate:b,isPending:x}=H(),S=a(),w=x||S,{images:T,files:E,imagesMarkedUploadAsFile:D,clearAllFiles:O}=ie(),{handleUpload:k}=Se(),{error:A}=U({enabled:r}),j=r?W(A,e):null,M=r?!!l:!!d&&!!g,N=Ce(null,t=>{let a=t.trim(),o=T.length>0||E.length>0;if(!a&&!o||w)return;let s={images:[...T],files:[...E]},c={query:o?void 0:a||void 0};r&&l?c={...c,workingDir:l.path}:!r&&d&&g&&(c={...c,repository:{name:d.full_name,gitProvider:d.git_provider,branch:g.name}});let u=f.loading(e(i.HOME$CREATING_CONVERSATION),h);b(c,{onSuccess:async t=>{f.dismiss(u);try{sessionStorage.removeItem(ge)}catch{}let i=t.conversation_id,c=i.startsWith(`task-`);if(o)if(!r||c){let e=t.task_id??(c?i.slice(5):null);if(!e){p(null);return}ye(e,{content:a,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...D]}),O(),await q({conversationId:i,text:a,images:s.images,imagesMarkedUploadAsFile:D}),n(`/conversations/${i}`);return}else try{await he({conversationId:i,content:a,images:s.images,files:s.files,imagesMarkedUploadAsFile:D,t:e}),O()}catch(e){p(e instanceof Error?e.message:null);return}c&&a&&await q({conversationId:i,text:a,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${i}`)},onError:e=>{f.dismiss(u),p(e instanceof Error?e.message:null)}})});return(0,J.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,J.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,J.jsx)(Le,{})}),(0,J.jsx)(`div`,{className:`w-full`,children:(0,J.jsx)(Oe,{onSubmit:N,onFilesPaste:k,disabled:w})}),(0,J.jsx)(`div`,{className:`flex justify-start`,children:M?(0,J.jsx)(We,{workspace:l,repository:d,branch:g,provider:v,onRepoClick:()=>c(!0)}):(0,J.jsx)(Re,{kind:r?`local`:`cloud`,onClick:()=>c(!0),disabled:w||!!j,disabledTooltip:j})}),r?(0,J.jsx)(Ve,{isOpen:s,onClose:()=>c(!1),onConfirm:e=>{u(e),m(null),_(null),y(null)}}):(0,J.jsx)(Ue,{isOpen:s,onClose:()=>c(!1),onConfirm:({repository:e,branch:t,provider:n})=>{m(e),_(t),y(n??e.git_provider),u(null)}})]})}function Ke({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:S(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:S(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function qe(e){return e===`openhands`?`openhands`:V.find(({key:t})=>t===e)?.icon??`cli-generic`}function Je({id:e,muted:t}){let n=qe(e);return n===`openhands`?(0,J.jsx)(G,{kind:`openhands`,size:16,className:S(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(G,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Ye(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:i.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...V.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Xe({selectedAgentId:e,onSelect:t,onNext:n}){let{t:r}=o(`openhands`),{mutate:a,isPending:c}=me();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(i.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(i.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":r(i.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Ye().map(n=>{let i=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":i,onClick:()=>t(n.id),className:S(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,i?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(Je,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:r(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:i?(0,J.jsx)(d,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsx)(`div`,{className:`sticky bottom-0 flex justify-end bg-base-secondary pt-4 pb-7`,children:(0,J.jsx)(P,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:c,onClick:()=>{let t=ae(e);if(!t){n();return}a({agent_settings_diff:t},{onError:e=>{p(s(e)||r(i.ERROR$GENERIC))},onSuccess:()=>{m(r(i.SETTINGS$SAVED)),n()}})},children:r(c?i.SETTINGS$SAVING:i.ONBOARDING$NEXT)})})]})}function Ze({isConnected:e}){let{t}=o(`openhands`);return e===!0?(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:S(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(l,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(i.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(i.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(Fe,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(i.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(i.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(_,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(i.ONBOARDING$BACKEND_CHECKING)})]})}function Qe({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{active:r}=w(),{backend:a}=r,s=ne([a])[a.id]?.isConnected??null;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$BACKEND_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,J.jsx)(Ze,{isConnected:s}),(0,J.jsx)(re,{mode:`edit`,backend:a,onSubmitted:()=>{},testIdRoot:`onboarding-backend`,renderActions:({canSubmit:r,testIdRoot:a})=>(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-end gap-2 mt-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`${a}-submit`,type:`submit`,variant:`secondary`,isDisabled:!r,children:n(i.BACKEND$SAVE)}),(0,J.jsx)(P,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,isDisabled:s!==!0,onClick:t,children:n(i.ONBOARDING$NEXT)})]})})]})}var Y={"llm.model":`anthropic/claude-opus-4-7`};function $e({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{backend:r}=C(),a=r.kind===`local`,s=b(),c=y(),[l,u]=K.useState(null),[d,f]=K.useState(!1),p=K.useCallback(async()=>{if(!a||!l)return;let e=l.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=v(t),o={model:t};n&&(o.api_key=n),r&&(o.base_url=r);try{await s.mutateAsync({name:i,request:{llm:o,include_secrets:!0}}),await c.mutateAsync(i)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[a,l,s,c]),m=K.useCallback(async()=>{f(!0);try{await p()}finally{f(!1),t()}},[p,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,J.jsx)(x,{embedded:!0,hideSaveButton:!0,initialValueOverrides:Y,onSaveSuccess:m,onSaveControlChange:u})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-end gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(i.ONBOARDING$NEXT)})]})]})}function et({onBack:e,onLaunched:t}){let{t:n}=o(`openhands`),{navigate:r}=F(),s=n(i.ONBOARDING$HELLO_DEFAULT_MESSAGE),[c,l]=K.useState(s),{mutate:u,isPending:d,isSuccess:f}=H(),p=a(),m=d||f||p,h=K.useRef(!1),g=c.trim().length>0&&!m&&!h.current,_=()=>{!g||h.current||(h.current=!0,u({query:c.trim()},{onSuccess:e=>{t(),r(`/conversations/${e.conversation_id}`)},onError:()=>{h.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_()},className:`contents`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":n(i.ONBOARDING$HELLO_TITLE),type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:s,disabled:m,className:`w-full rounded-xl border border-white/10 bg-base-secondary px-4 py-3 text-base text-white placeholder:text-[var(--oh-text-subtle)] focus:border-primary focus:outline-none disabled:opacity-60`})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,children:(0,J.jsx)(Pe,{onLaunched:t})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:m,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-hello-launch`,type:`button`,variant:`primary`,isDisabled:!g,onClick:_,startContent:(0,J.jsx)(Ie,{className:`size-4`,"aria-hidden":!0}),children:n(m?i.ONBOARDING$HELLO_LAUNCHING:i.ONBOARDING$HELLO_LAUNCH)})]})]})}var X=4;function Z({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:S(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function tt({onClose:e}){let{t}=o(`openhands`),[n,r]=K.useState(0),[a,s]=K.useState(`openhands`),c=a!==`openhands`,l=K.useCallback(()=>r(e=>Math.min(e+(c&&e===1?2:1),X-1)),[c]),u=K.useCallback(()=>r(e=>Math.max(e-(c&&e===3?2:1),0)),[c]),d=c?X-1:X,f=c&&n>1?n-1:n;return(0,J.jsx)(T,{onClose:e,closeOnEscape:!1,"aria-label":t(i.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":n,className:S(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,D(`lg`),O,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(Ke,{currentStep:f,totalSteps:d})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":n,className:`relative overflow-clip`,children:[(0,J.jsx)(Z,{index:0,currentStep:n,children:(0,J.jsx)(Xe,{selectedAgentId:a,onSelect:s,onNext:l})}),(0,J.jsx)(Z,{index:1,currentStep:n,children:(0,J.jsx)(Qe,{onBack:u,onNext:l})}),(0,J.jsx)(Z,{index:2,currentStep:n,children:(0,J.jsx)($e,{onBack:u,onNext:l})}),(0,J.jsx)(Z,{index:3,currentStep:n,children:(0,J.jsx)(et,{onBack:u,onLaunched:e})})]})})]}),(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:t(i.ONBOARDING$SKIP)})]})})}var Q=`openhands-onboarded`;function $(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(Q)!==null}catch{return!0}}function nt(){let[e,t]=K.useState(()=>$());return K.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t($())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:K.useCallback(()=>{try{window.localStorage.setItem(Q,`1`)}catch{}t(!0)},[])}}function rt(){let{isCompleted:e,markCompleted:t}=nt();return e?null:(0,J.jsx)(tt,{onClose:t})}function it(){return(0,J.jsxs)(`div`,{"data-testid":`home-screen`,className:`custom-scrollbar-always flex h-full flex-col overflow-y-auto rounded-xl bg-transparent px-4 md:px-0 lg:px-[42px]`,children:[(0,J.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,J.jsx)(Ge,{})}),(0,J.jsx)(rt,{})]})}var at=n(it);export{at as default};
|
|
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{o as r,t as i}from"./declaration-D378OjpZ.js";import{t as a}from"./use-is-creating-conversation-DhDeeWfA.js";import{t as o}from"./useTranslation-CpIcQBq6.js";import{t as s}from"./retrieve-axios-error-message-BY-yIkIq.js";import{t as c}from"./createLucideIcon-Ddu8jDOQ.js";import{s as l}from"./vendor~home~conversation-panel~conversation-PK1-gtXU.js";import{n as u}from"./git-branch-DQS2nMK4.js";import{t as d}from"./check-CYxAHs85.js";import{a as f,n as p,r as m,t as h}from"./custom-toast-handlers-BOc3qeQ7.js";import{d as g,m as _}from"./conversation-websocket-context-Ywrxd_9p.js";import{a as v,i as y,r as b,t as x}from"./llm-settings-CcHqGOYL.js";import{t as S}from"./utils-D-HX7JCe.js";import{n as C,r as w}from"./active-backend-context-TVbjnvmP.js";import{t as T}from"./modal-backdrop-DTYGVmOR.js";import{n as E,r as D,t as O}from"./modal-body-YElmM1dV.js";import{r as k}from"./base-modal-CQRvRHu1.js";import{d as A,l as j,n as M,r as N,t as P}from"./brand-button-C2nEKopC.js";import{n as F}from"./navigation-context-DeIPtGPp.js";import{t as I}from"./vendor~root-layout~home~conversation-panel~conversation-DjAjXS5J.js";import{t as L}from"./styled-tooltip-CS3mB_1X.js";import{c as ee,d as R,n as te,s as z}from"./git-provider-icon-DYE9n7fs.js";import{i as ne,t as re}from"./backend-form-modal-K6IMCr3p.js";import{t as ie}from"./conversation-store-Z5iMCRpc.js";import{t as B}from"./modal-close-button-C_GpQt9F.js";import{i as ae,n as V}from"./acp-providers-DauuOsW9.js";import{t as H}from"./use-create-conversation-DW7AGgLA.js";import{a as U,c as oe,i as se,l as ce,n as le,o as ue,r as W,s as de,t as fe,u as G}from"./manage-workspaces-modal-C5EuW8m1.js";import{t as pe}from"./folder-0WSMImNX.js";import{t as me}from"./use-save-settings-CEEKSTWG.js";import{A as he,F as ge,I as _e,M as ve,N as ye,a as be,c as xe,d as Se,f as Ce,i as we,l as Te,n as Ee,o as De,p as Oe,r as ke,s as Ae,t as je,u as Me}from"./git-control-bar-branch-button-CcIpmyfM.js";import{r as Ne}from"./typography-vVUMoNUg.js";import{t as Pe}from"./recommended-automations-launcher-BI9NhG8Y.js";var Fe=c(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Ie=c(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),K=e(t(),1);async function q(e){let{imagesToEmbed:t}=_e(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>ve(e)));g.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var J=r();function Le(){let{t:e}=o(`openhands`);return(0,J.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,J.jsx)(Ne.H1,{className:`w-full text-center leading-normal`,children:e(`HOME$LETS_START_BUILDING`)})})}function Re({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:a}=o(`openhands`),s=e===`local`,c=a(s?i.HOME$OPEN_WORKSPACE:i.COMMON$OPEN_REPOSITORY),l=(0,J.jsxs)(`button`,{type:`button`,"data-testid":s?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:S(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,M,j,A,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,J.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:s?(0,J.jsx)(u,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,J.jsx)(R,{width:16,height:16,className:`shrink-0`})}),(0,J.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:c})]});return r?(0,J.jsx)(L,{content:r,placement:`top`,children:(0,J.jsx)(`span`,{className:`inline-flex`,children:l})}):l}function ze({workspaces:e,value:t,placeholder:n,className:r,disabled:a=!1,disabledTooltip:s,showManage:c,onChange:l,onAddClick:u,onManageClick:d}){let{t:f}=o(`openhands`),[p,m]=(0,K.useState)(t?.name??``),h=(0,K.useRef)(null),g=(0,K.useMemo)(()=>{let t=p.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,p]),_=(0,K.useCallback)(e=>{l(e),e&&m(e.name)},[l]),v=(0,K.useCallback)(()=>{_(null),m(``)},[_]),{isOpen:y,getToggleButtonProps:b,getMenuProps:x,getInputProps:C,highlightedIndex:w,getItemProps:T,selectedItem:E,closeMenu:D}=I({items:g,itemToString:e=>e?.name??``,selectedItem:t,onSelectedItemChange:({selectedItem:e})=>{_(e??null)},inputValue:p,stateReducer:(e,t)=>t.type===I.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),O=(e,t,n,r,i)=>(0,J.jsx)(xe,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id},e.id),k=e=>(0,J.jsx)(Ae,{inputValue:e,searchMessage:f(i.HOME$NO_WORKSPACES),emptyMessage:f(i.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),A=(0,K.useMemo)(()=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:`flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),D(),u()},children:f(i.HOME$ADD_WORKSPACES)}),(c??e.length>0)&&(0,J.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:`flex items-center w-full px-2 py-2 text-sm text-white hover:bg-[var(--oh-interactive-hover)] rounded-md transition-colors duration-150 font-normal`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),D(),d()},children:f(i.HOME$MANAGE_WORKSPACES)})]}),[u,d,f,D,e.length,c]),j=(0,J.jsxs)(`div`,{className:S(`relative`,r),children:[(0,J.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,J.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,J.jsx)(ee,{width:16,height:16})}),(0,J.jsx)(`input`,{...C({disabled:a,placeholder:n??f(i.HOME$WORKSPACE_PLACEHOLDER),className:S(N,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{m(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,J.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[t&&(0,J.jsx)(Me,{disabled:a,onClear:v}),(0,J.jsx)(Te,{isOpen:y,disabled:a,getToggleButtonProps:b})]})]}),(0,J.jsx)(De,{isOpen:y,filteredItems:g,inputValue:p,highlightedIndex:w,selectedItem:E,getMenuProps:x,getItemProps:T,menuRef:h,renderItem:O,renderEmptyState:k,stickyFooterItem:A,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return s?(0,J.jsx)(L,{content:s,placement:`top`,children:(0,J.jsx)(`span`,{className:`block`,children:j})}):j}function Be({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=o(`openhands`),{navigate:r}=F(),{data:s,error:c}=U(),l=s?.workspaceParents??[],{mutate:u}=de(),{mutate:d}=oe(),{mutate:f}=ue(),{mutate:p}=ce(),{workspaces:m,isLoading:h,isError:g,error:_}=se(),v=W(c??_,n),[y,b]=K.useState(null),[x,S]=K.useState(!1),[C,w]=K.useState(!1),{mutate:T,isPending:E,isSuccess:D}=H(),O=a(),k=E||D||O,A=l.length>0||!!v,j=null;v?j=v:h?j=n(i.HOME$LOADING):g&&(j=n(i.HOME$WORKSPACE_SCAN_ERROR));let M=!!v||e||h&&m.length===0;return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,J.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,J.jsx)(pe,{width:24,height:24}),(0,J.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(i.HOME$WORKSPACES_TAB)})]}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,J.jsx)(ze,{workspaces:m,value:y,placeholder:v?n(i.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):M?n(i.HOME$LOADING):void 0,disabled:M,disabledTooltip:v,showManage:m.length>0||l.length>0,onChange:b,onAddClick:()=>S(!0),onManageClick:()=>w(!0),className:`max-w-auto`}),A&&j&&(0,J.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:j})]}),(0,J.jsx)(P,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!y||!t&&k||e,onClick:()=>{if(y){if(t){t(y);return}T({workingDir:y.path},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:t?n(i.BUTTON$CONFIRM):k?n(i.HOME$LOADING):`Launch`}),(0,J.jsx)(le,{isOpen:x,onClose:()=>S(!1),onAdd:e=>u(e),onAddParent:e=>f(e)}),(0,J.jsx)(fe,{isOpen:C,workspaces:m,workspaceParents:l,onClose:()=>w(!1),onRemove:e=>{y?.path===e&&b(null),d(e)},onRemoveParent:e=>{y?.parentPath===e&&b(null),p(e)}})]})}function Ve({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=o(`openhands`),{isLoadingSettings:a}=z();return e?(0,J.jsx)(T,{onClose:t,children:(0,J.jsxs)(E,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,J.jsx)(B,{onClose:t,testId:`close-open-workspace-dialog`}),(0,J.jsx)(`div`,{className:`w-full pr-6`,children:(0,J.jsx)(k,{title:r(i.HOME$OPEN_WORKSPACE)})}),(0,J.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,J.jsx)(Be,{isLoadingSettings:a,onConfirm:e=>{n(e),t()}})})]})}):null}function He({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=F(),[s,c]=K.useState(null),[l,u]=K.useState(null),[d,f]=K.useState(null),{providers:p}=z(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=te(),{mutate:_,isPending:v,isSuccess:y}=H(),b=a(),{t:x}=o(`openhands`);K.useEffect(()=>{if(p.length!==0){if(p.length===1&&!d){f(p[0]);return}if(p.length>1&&!d){let e=g();e&&p.includes(e)&&f(e)}}},[p,d,g]);let S=v||y||b,C=t=>{t!==d&&(f(t),h(t),c(null),u(null),e?.(null))},w=K.useCallback(e=>{u(e)},[]);return(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,J.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,J.jsx)(R,{width:24,height:24}),(0,J.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(i.COMMON$OPEN_REPOSITORY)})]})}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(i.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,J.jsx)(be,{providers:p,value:d,placeholder:`Select Provider`,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,J.jsx)(ke,{provider:d||p[0],value:s?.id||null,repositoryName:s?.full_name||null,placeholder:`user/repo`,disabled:!d||t,onChange:t=>{t?(e?.(t),c(t)):(e?.(null),c(null),u(null))},className:`max-w-auto`}),(()=>{let e=s?.main_branch||null;return(0,J.jsx)(we,{repository:s?.full_name||null,provider:d||p[0],selectedBranch:l,onBranchSelect:w,defaultBranch:e,placeholder:`Select branch...`,className:`max-w-full`,disabled:!s||t})})()]}),(0,J.jsx)(P,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!s||!l||!n&&S||p.length>1&&!d||t,onClick:()=>{if(!(!s||!l)){if(m(s),n){n({repository:s,branch:l,provider:d});return}_({repository:{name:s.full_name||``,gitProvider:s.git_provider||`github`,branch:l.name||`main`}},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:n?x(i.BUTTON$CONFIRM):S?x(`HOME$LOADING`):`Launch`})]})}function Ue({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=o(`openhands`),{isLoadingSettings:a}=z();return e?(0,J.jsx)(T,{onClose:t,children:(0,J.jsxs)(E,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,J.jsx)(B,{onClose:t,testId:`close-open-repository-dialog`}),(0,J.jsx)(`div`,{className:`w-full pr-6`,children:(0,J.jsx)(k,{title:r(i.COMMON$OPEN_REPOSITORY)})}),(0,J.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,J.jsx)(He,{isLoadingSettings:a,onConfirm:e=>{n(e),t()}})})]})}):null}function We({workspace:e,repository:t,branch:n,provider:r,onRepoClick:i}){let a=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,J.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,J.jsx)(Ee,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:a,onClick:i}),n?(0,J.jsx)(je,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function Ge(){let{t:e}=o(`openhands`),{backend:t}=C(),{navigate:n}=F(),r=t.kind===`local`,[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(null),[d,m]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),{mutate:b,isPending:x}=H(),S=a(),w=x||S,{images:T,files:E,imagesMarkedUploadAsFile:D,clearAllFiles:O}=ie(),{handleUpload:k}=Se(),{error:A}=U({enabled:r}),j=r?W(A,e):null,M=r?!!l:!!d&&!!g,N=Ce(null,t=>{let a=t.trim(),o=T.length>0||E.length>0;if(!a&&!o||w)return;let s={images:[...T],files:[...E]},c={query:o?void 0:a||void 0};r&&l?c={...c,workingDir:l.path}:!r&&d&&g&&(c={...c,repository:{name:d.full_name,gitProvider:d.git_provider,branch:g.name}});let u=f.loading(e(i.HOME$CREATING_CONVERSATION),h);b(c,{onSuccess:async t=>{f.dismiss(u);try{sessionStorage.removeItem(ge)}catch{}let i=t.conversation_id,c=i.startsWith(`task-`);if(o)if(!r||c){let e=t.task_id??(c?i.slice(5):null);if(!e){p(null);return}ye(e,{content:a,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...D]}),O(),await q({conversationId:i,text:a,images:s.images,imagesMarkedUploadAsFile:D}),n(`/conversations/${i}`);return}else try{await he({conversationId:i,content:a,images:s.images,files:s.files,imagesMarkedUploadAsFile:D,t:e}),O()}catch(e){p(e instanceof Error?e.message:null);return}c&&a&&await q({conversationId:i,text:a,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${i}`)},onError:e=>{f.dismiss(u),p(e instanceof Error?e.message:null)}})});return(0,J.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,J.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,J.jsx)(Le,{})}),(0,J.jsx)(`div`,{className:`w-full`,children:(0,J.jsx)(Oe,{onSubmit:N,onFilesPaste:k,disabled:w})}),(0,J.jsx)(`div`,{className:`flex justify-start`,children:M?(0,J.jsx)(We,{workspace:l,repository:d,branch:g,provider:v,onRepoClick:()=>c(!0)}):(0,J.jsx)(Re,{kind:r?`local`:`cloud`,onClick:()=>c(!0),disabled:w||!!j,disabledTooltip:j})}),r?(0,J.jsx)(Ve,{isOpen:s,onClose:()=>c(!1),onConfirm:e=>{u(e),m(null),_(null),y(null)}}):(0,J.jsx)(Ue,{isOpen:s,onClose:()=>c(!1),onConfirm:({repository:e,branch:t,provider:n})=>{m(e),_(t),y(n??e.git_provider),u(null)}})]})}function Ke({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:S(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:S(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function qe(e){return e===`openhands`?`openhands`:V.find(({key:t})=>t===e)?.icon??`cli-generic`}function Je({id:e,muted:t}){let n=qe(e);return n===`openhands`?(0,J.jsx)(G,{kind:`openhands`,size:16,className:S(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(G,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Ye(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:i.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...V.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Xe({selectedAgentId:e,onSelect:t,onNext:n}){let{t:r}=o(`openhands`),{mutate:a,isPending:c}=me();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(i.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(i.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":r(i.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Ye().map(n=>{let i=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":i,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":i,onClick:()=>t(n.id),className:S(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,i?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(Je,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:r(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:i?(0,J.jsx)(d,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsx)(`div`,{className:`sticky bottom-0 flex justify-end bg-base-secondary pt-4 pb-7`,children:(0,J.jsx)(P,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:c,onClick:()=>{let t=ae(e);if(!t){n();return}a({agent_settings_diff:t},{onError:e=>{p(s(e)||r(i.ERROR$GENERIC))},onSuccess:()=>{m(r(i.SETTINGS$SAVED)),n()}})},children:r(c?i.SETTINGS$SAVING:i.ONBOARDING$NEXT)})})]})}function Ze({isConnected:e}){let{t}=o(`openhands`);return e===!0?(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:S(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(l,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:t(i.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:t(i.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]}):e===!1?(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(Fe,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:t(i.ONBOARDING$BACKEND_DISCONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:t(i.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]}):(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(_,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:t(i.ONBOARDING$BACKEND_CHECKING)})]})}function Qe({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{active:r}=w(),{backend:a}=r,s=ne([a])[a.id]?.isConnected??null;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$BACKEND_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$BACKEND_SUBTITLE)})]}),(0,J.jsx)(Ze,{isConnected:s}),(0,J.jsx)(re,{mode:`edit`,backend:a,onSubmitted:()=>{},testIdRoot:`onboarding-backend`,renderActions:({canSubmit:r,testIdRoot:a})=>(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-end gap-2 mt-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`${a}-submit`,type:`submit`,variant:`secondary`,isDisabled:!r,children:n(i.BACKEND$SAVE)}),(0,J.jsx)(P,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,isDisabled:s!==!0,onClick:t,children:n(i.ONBOARDING$NEXT)})]})})]})}var Y={"llm.model":`anthropic/claude-opus-4-7`};function $e({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{backend:r}=C(),a=r.kind===`local`,s=b(),c=y(),[l,u]=K.useState(null),[d,f]=K.useState(!1),p=K.useCallback(async()=>{if(!a||!l)return;let e=l.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=v(t),o={model:t};n&&(o.api_key=n),r&&(o.base_url=r);try{await s.mutateAsync({name:i,request:{llm:o,include_secrets:!0}}),await c.mutateAsync(i)}catch(e){console.error(`Failed to persist onboarding LLM as profile:`,e)}},[a,l,s,c]),m=K.useCallback(async()=>{f(!0);try{await p()}finally{f(!1),t()}},[p,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,J.jsx)(x,{embedded:!0,hideSaveButton:!0,initialValueOverrides:Y,onSaveSuccess:m,onSaveControlChange:u})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-end gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(i.ONBOARDING$NEXT)})]})]})}function et({onBack:e,onLaunched:t}){let{t:n}=o(`openhands`),{navigate:r}=F(),s=n(i.ONBOARDING$HELLO_DEFAULT_MESSAGE),[c,l]=K.useState(s),{mutate:u,isPending:d,isSuccess:f}=H(),p=a(),m=d||f||p,h=K.useRef(!1),g=c.trim().length>0&&!m&&!h.current,_=()=>{!g||h.current||(h.current=!0,u({query:c.trim()},{onSuccess:e=>{t(),r(`/conversations/${e.conversation_id}`)},onError:()=>{h.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(i.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(i.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),_()},className:`contents`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":n(i.ONBOARDING$HELLO_TITLE),type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:s,disabled:m,className:`w-full rounded-xl border border-white/10 bg-base-secondary px-4 py-3 text-base text-white placeholder:text-[var(--oh-text-subtle)] focus:border-primary focus:outline-none disabled:opacity-60`})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,children:(0,J.jsx)(Pe,{onLaunched:t})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(P,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:m,children:n(i.ONBOARDING$BACK)}),(0,J.jsx)(P,{testId:`onboarding-hello-launch`,type:`button`,variant:`primary`,isDisabled:!g,onClick:_,startContent:(0,J.jsx)(Ie,{className:`size-4`,"aria-hidden":!0}),children:n(m?i.ONBOARDING$HELLO_LAUNCHING:i.ONBOARDING$HELLO_LAUNCH)})]})]})}var X=4;function Z({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:S(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function tt({onClose:e}){let{t}=o(`openhands`),[n,r]=K.useState(0),[a,s]=K.useState(`openhands`),c=a!==`openhands`,l=K.useCallback(()=>r(e=>Math.min(e+(c&&e===1?2:1),X-1)),[c]),u=K.useCallback(()=>r(e=>Math.max(e-(c&&e===3?2:1),0)),[c]),d=c?X-1:X,f=c&&n>1?n-1:n;return(0,J.jsx)(T,{onClose:e,closeOnEscape:!1,"aria-label":t(i.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":n,className:S(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,D(`lg`),O,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(Ke,{currentStep:f,totalSteps:d})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":n,className:`relative overflow-clip`,children:[(0,J.jsx)(Z,{index:0,currentStep:n,children:(0,J.jsx)(Xe,{selectedAgentId:a,onSelect:s,onNext:l})}),(0,J.jsx)(Z,{index:1,currentStep:n,children:(0,J.jsx)(Qe,{onBack:u,onNext:l})}),(0,J.jsx)(Z,{index:2,currentStep:n,children:(0,J.jsx)($e,{onBack:u,onNext:l})}),(0,J.jsx)(Z,{index:3,currentStep:n,children:(0,J.jsx)(et,{onBack:u,onLaunched:e})})]})})]}),(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:e,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:t(i.ONBOARDING$SKIP)})]})})}var Q=`openhands-onboarded`;function $(){if(typeof window>`u`)return!0;try{return window.localStorage.getItem(Q)!==null}catch{return!0}}function nt(){let[e,t]=K.useState(()=>$());return K.useEffect(()=>{let e=e=>{e.key===`openhands-onboarded`&&t($())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{isCompleted:e,markCompleted:K.useCallback(()=>{try{window.localStorage.setItem(Q,`1`)}catch{}t(!0)},[])}}function rt(){let{isCompleted:e,markCompleted:t}=nt();return e?null:(0,J.jsx)(tt,{onClose:t})}function it(){return(0,J.jsxs)(`div`,{"data-testid":`home-screen`,className:`custom-scrollbar-always flex h-full flex-col overflow-y-auto rounded-xl bg-transparent px-4 md:px-0 lg:px-[42px]`,children:[(0,J.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,J.jsx)(Ge,{})}),(0,J.jsx)(rt,{})]})}var at=n(it);export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./declaration-
|
|
1
|
+
import{n as e}from"./declaration-D378OjpZ.js";import{n as t,r as n,t as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js";var i=`openhands`,a=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],o=new WeakMap,s=n=>{if(!o.has(n)){let s=n.use(t).use(r).use(e).init({fallbackLng:`en`,debug:!1,supportedLngs:a.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[i],defaultNS:i,fallbackNS:i,backend:{loadPath:`/locales/{{lng}}/{{ns}}.json`}});o.set(n,s)}return n},c=()=>s(n()),l=null,u=null,d=()=>(l||=c(),l),f=()=>u??d(),p=e=>(u=e??d(),u),m=async(e=d())=>(await o.get(e),e),h=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:i,...e}:e:{ns:i},g=new Proxy({},{get:(e,t)=>{let n=f();if(t===`t`)return(e,t)=>n.t(e,h(t));if(t===`exists`)return(e,t)=>n.exists(e,h(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=f();return Reflect.set(r,t,n,r)}});export{g as a,f as i,i as n,p as o,d as r,m as s,a as t};
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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};
|
package/build/assets/{manage-backends-modal-DqpzcxdI.js → manage-backends-modal-rYeyGx7j.js}
RENAMED
|
@@ -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-
|
|
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};
|
package/build/assets/{manage-workspaces-modal-eG6XgAvw.js → manage-workspaces-modal-C5EuW8m1.js}
RENAMED
|
@@ -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};
|