@openhands/agent-canvas 1.7.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{Trans-DP5rcauH.js → Trans-Bwpzk1wT.js} +1 -1
- package/build/assets/{acp-providers-BHKZvEm5.js → acp-providers-C921BlYB.js} +1 -1
- package/build/assets/active-backend-context-BiwzkzDy.js +2 -0
- package/build/assets/agent-context-settings-DXNT_dcw.js +1 -0
- package/build/assets/agent-profiles-settings-BymJf3EP.js +1 -0
- package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +41 -0
- package/build/assets/agent-settings-BjgQQe-_.js +1 -0
- package/build/assets/{agent-settings-BIOsUglV.js → agent-settings-WzqXk6B4.js} +2 -2
- package/build/assets/{alert-banner-C1nzoXBC.js → alert-banner-DR8EVyZM.js} +1 -1
- package/build/assets/api-error-message-e16L1kwH.js +1 -0
- package/build/assets/api-key-entry-screen-DI0I04O3.js +1 -0
- package/build/assets/app-settings-DGistSFV.js +1 -0
- package/build/assets/automation-C_eCrGyP.js +1 -0
- package/build/assets/automation-detail-DY6x2FW1.js +2 -0
- package/build/assets/automation-export-C09f-Lua.js +2 -0
- package/build/assets/automation-setup-route-CqKp0717.js +1 -0
- package/build/assets/automations-list-CqWJ7qXW.js +1 -0
- package/build/assets/{back-nav-button-Be_L157B.js → back-nav-button-D4ngzpSh.js} +1 -1
- package/build/assets/backend-form-modal-B8D5hBzK.js +1 -0
- package/build/assets/{backend-synced-settings-badge-BNpEylNP.js → backend-synced-settings-badge-BnzI8Ysj.js} +1 -1
- package/build/assets/{badge-DwgrwohM.js → badge-1Mf1iPcX.js} +1 -1
- package/build/assets/{base-modal-CSHhJTSr.js → base-modal-BBuy0WQQ.js} +1 -1
- package/build/assets/{brand-button-CQO8oqVo.js → brand-button-DGN6Y9o6.js} +1 -1
- package/build/assets/browser-D_ekTlTS.js +6 -0
- package/build/assets/{browser-tab-CEApjoEV.js → browser-tab-D4a4Ou_w.js} +1 -1
- package/build/assets/{chat-send-button-D4614wUz.js → chat-send-button-CgbcjD97.js} +1 -1
- package/build/assets/check-CPLXgluF.js +1 -0
- package/build/assets/chevron-down-CP4QHvyc.js +1 -0
- package/build/assets/circle-check-Dpy2_xSI.js +1 -0
- package/build/assets/{circle-plus-check-toggle-E3Ecb_gg.js → circle-plus-check-toggle-yTAS-nX3.js} +1 -1
- package/build/assets/cloud-funnel-analytics-CEOl5Gxr.js +1 -0
- package/build/assets/{combobox-caret-C8_eGdp2.js → combobox-caret-Bd2yySnF.js} +1 -1
- package/build/assets/command-menu-Bj6X4ckE.js +1 -0
- package/build/assets/condenser-settings-EAXQNR2E.js +1 -0
- package/build/assets/{confirmation-modal-gZtbojCm.js → confirmation-modal-NCUPr2-O.js} +1 -1
- package/build/assets/{context-menu-list-item-BTHGFhIx.js → context-menu-list-item-CrCrYuPF.js} +1 -1
- package/build/assets/conversation-BzyIcSwr.js +1 -0
- package/build/assets/conversation-CUJ0Vo8g.js +90 -0
- package/build/assets/conversation-panel-BzyIcSwr.js +1 -0
- package/build/assets/conversation-state-store-F62HvuI1.js +1 -0
- package/build/assets/{conversation-tab-empty-state-BCMHkGQk.js → conversation-tab-empty-state-BCZ7rUMH.js} +1 -1
- package/build/assets/{copy-B8Y5ufoR.js → copy-DCmZtz6n.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-C4l3CMSd.js → copy-to-clipboard-button-D_Lp6-Fl.js} +1 -1
- package/build/assets/{device-verify-C_M7Z8xs.js → device-verify-DLmolX8Q.js} +1 -1
- package/build/assets/{dropdown-classes-DQlj-MpS.js → dropdown-classes-BB8rzqXL.js} +1 -1
- package/build/assets/{entry.client-DETaouwO.js → entry.client-BbIYOsIg.js} +2 -2
- package/build/assets/{enum-filter-dropdown-paB-lFSP.js → enum-filter-dropdown-C08-srev.js} +1 -1
- package/build/assets/{environment-switch-overlay-D0FgCMqs.js → environment-switch-overlay-BepBBX66.js} +1 -1
- package/build/assets/extensions-hub-R3KNv-5V.js +1 -0
- package/build/assets/extensions-navigation-CfWFmI1I.js +1 -0
- package/build/assets/{external-link-Cnnd6ikC.js → external-link-BdBSg8rk.js} +1 -1
- package/build/assets/files-tab-DEq8MbHu.js +1 -0
- package/build/assets/{form-control-classes-CSPevi7c.js → form-control-classes-DAfsCJTe.js} +1 -1
- package/build/assets/{format-time-delta-DuhE50B-.js → format-time-delta-CxfPJpzC.js} +1 -1
- package/build/assets/git-provider-icon-BZqqUPlm.js +1 -0
- package/build/assets/git-repo-dropdown-9WKINV6J.js +1 -0
- package/build/assets/git-repo-dropdown-DEpOwUez.js +1 -0
- package/build/assets/{highlighted-source-view-suUKd5if.js → highlighted-source-view-CX9oIoVT.js} +1 -1
- package/build/assets/home-CY0JaxiY.js +1 -0
- package/build/assets/home-CaNWlVvB.js +1 -0
- package/build/assets/home-store-Ch1ErdBc.js +1 -0
- package/build/assets/index-home-CaNWlVvB.js +1 -0
- package/build/assets/info-CmWQXtRQ.js +1 -0
- package/build/assets/install-server-modal-BWrudmZU.js +1 -0
- package/build/assets/{launch-Ccnhte5b.js → launch-B1POpHuP.js} +1 -1
- package/build/assets/{list-todo-_BXQzOiB.js → list-todo-DtiL3lTp.js} +1 -1
- package/build/assets/llm-not-configured-banner-3tMsM4K6.js +27 -0
- package/build/assets/llm-settings-CXo8iPNW.js +1 -0
- package/build/assets/llm-settings-D0W8mJDk.js +1 -0
- package/build/assets/{llm-subscription-service-W5BprsNA.js → llm-subscription-service-DBJbfd8Z.js} +1 -1
- package/build/assets/loader-circle-B4QDBARx.js +1 -0
- package/build/assets/{loading-spinner-CcpnCr_d.js → loading-spinner-DfZ_bhV7.js} +1 -1
- package/build/assets/manage-backends-modal-CwyWsiag.js +1 -0
- package/build/assets/manifest-39f4789d.js +1 -0
- package/build/assets/{markdown-renderer-CvOO0YIr.js → markdown-renderer-DgiLLhW6.js} +6 -6
- package/build/assets/mcp-DXG9LWrI.js +9 -0
- package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +1 -0
- package/build/assets/messages-kBjKaAeA.js +40 -0
- package/build/assets/{modal-body-DQhiw-AR.js → modal-body-CMsDpalT.js} +1 -1
- package/build/assets/{modal-classes-YaEEa5eZ.js → modal-classes-B6PDrxXo.js} +1 -1
- package/build/assets/{modal-close-button-turIYn0t.js → modal-close-button-DyxBZaAb.js} +1 -1
- package/build/assets/{onboarding-BegDrOKn.js → onboarding-47hh2IHA.js} +1 -1
- package/build/assets/onboarding-modal-9BuvvROo.js +1 -0
- package/build/assets/organization-service.api-UDy63-oC.js +1 -0
- package/build/assets/{pencil-8_lvWDoZ.js → pencil-BjgtZmWp.js} +1 -1
- package/build/assets/{planner-tab-w6HT0N_A.js → planner-tab-BWk8885v.js} +1 -1
- package/build/assets/plugins-management-service-CjkgF2dd.js +1 -0
- package/build/assets/plus-DrKuuvMe.js +1 -0
- package/build/assets/profiles-service.api-CukSFLzz.js +1 -0
- package/build/assets/providers-CqUWC85T.js +1 -0
- package/build/assets/proxy-BBUG3sd2.js +1 -0
- package/build/assets/{puzzle-DXWdfaa7.js → puzzle-BoNc6zZ8.js} +1 -1
- package/build/assets/recommended-automations-launcher-ejxy1P27.js +1 -0
- package/build/assets/{refresh-cw-D7CYLy-d.js → refresh-cw-BrM5ZAZD.js} +1 -1
- package/build/assets/root-5S-M8SYa.js +2 -0
- package/build/assets/root-DZ39lS5f.css +1 -0
- package/build/assets/root-layout-BPqoa0gv.js +3 -0
- package/build/assets/schema-field-nImDoY6-.js +1 -0
- package/build/assets/{sdk-section-page-BW-i45yr.js → sdk-section-page-BxMrtUNV.js} +1 -1
- package/build/assets/search-Dc2qR4O2.js +1 -0
- package/build/assets/secrets-service-Dhjh3HhH.js +1 -0
- package/build/assets/{secrets-settings-D7U1ErCH.js → secrets-settings-CPdxceT_.js} +1 -1
- package/build/assets/segmented-toggle-Do6oyepX.js +1 -0
- package/build/assets/settings-BRbnfKEm.js +1 -0
- package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-DYCULKpp.js} +1 -1
- package/build/assets/{settings-index-COAdxm2Q.js → settings-index-C9o2NBO0.js} +1 -1
- package/build/assets/settings-input-B-q2gkVy.js +1 -0
- package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-WpQi0q1L.js} +1 -1
- package/build/assets/{settings-modal-CFnbQ8_4.js → settings-modal-CEK0AIx6.js} +1 -1
- package/build/assets/settings-service.api-CZiPD8__.js +1 -0
- package/build/assets/{settings-switch-UNSf8K8I.js → settings-switch-LqKdGxHL.js} +1 -1
- package/build/assets/shared-conversation-Bu-dQlgp.js +1 -0
- package/build/assets/{sidebar-layout-DXHtbEj1.js → sidebar-layout-oHBGQmLh.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-U78hQRJ1.js → sidebar-mobile-menu-toggle-ND-hgygu.js} +1 -1
- package/build/assets/{sidebar-nav-link-pvUivfK2.js → sidebar-nav-link-CrujNA09.js} +1 -1
- package/build/assets/{sidebar-store-DwrYKwYr.js → sidebar-store-Bui-WNEr.js} +1 -1
- package/build/assets/{skill-card-pill-row-D7XCz5uk.js → skill-card-pill-row-CZBI7OqH.js} +1 -1
- package/build/assets/{skill-icon-badge-HqBWZ2Eq.js → skill-icon-badge-BOov_phZ.js} +1 -1
- package/build/assets/{skills-plugins-BPhaNpfx.js → skills-plugins-D0PiHWAD.js} +1 -1
- package/build/assets/{skills-settings-CcwMtnnJ.js → skills-settings-B43KArIz.js} +2 -2
- package/build/assets/{styled-tooltip-DsjDnR_W.js → styled-tooltip-C7grwnOX.js} +1 -1
- package/build/assets/{task-list-tab-BmaTwjaS.js → task-list-tab-R3ac6m7O.js} +1 -1
- package/build/assets/{terminal-BRcoba5B.js → terminal-yqkNdEAx.js} +1 -1
- package/build/assets/{toggle-switch-BptY3XRG.js → toggle-switch-BeSrbgCg.js} +1 -1
- package/build/assets/{trash-2-Bq4lHbTB.js → trash-2-wW5TWcdN.js} +1 -1
- package/build/assets/{typography-C6fuRTTT.js → typography-iYhzLlHO.js} +1 -1
- package/build/assets/{use-acp-credential-form-B0_pZ_uS.js → use-acp-credential-form-DUxbxmbq.js} +1 -1
- package/build/assets/use-activate-agent-profile-CDHA52tC.js +1 -0
- package/build/assets/use-agent-profiles-TsOdIyw5.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-CrG1km7R.js → use-can-manage-org-profiles-Bt1M71u5.js} +1 -1
- package/build/assets/use-cloud-current-user-id-DWt7HCgf.js +1 -0
- package/build/assets/{use-config-Csy8EAP9.js → use-config-CxlEdf_v.js} +1 -1
- package/build/assets/{use-create-conversation-Dsa4nzU9.js → use-create-conversation-nOJ6Um5h.js} +1 -1
- package/build/assets/{use-create-secret-BnxuAjDt.js → use-create-secret-Dj5ang9x.js} +1 -1
- package/build/assets/use-is-authed-BT7Iud4U.js +1 -0
- package/build/assets/{use-is-creating-conversation-CIAcnd8M.js → use-is-creating-conversation-CAggrM75.js} +1 -1
- package/build/assets/use-llm-profiles-2Wc2db8u.js +1 -0
- package/build/assets/use-onboarding-completion-gxQlcEy2.js +1 -0
- package/build/assets/use-plugins-marketplace-CVO7sXYR.js +1 -0
- package/build/assets/use-save-agent-profile-D0wC5ExW.js +1 -0
- package/build/assets/{use-save-settings-BRh9p_fv.js → use-save-settings-L3aMaDeS.js} +1 -1
- package/build/assets/use-settings-8nt3DGxW.js +1 -0
- package/build/assets/use-settings-nav-items-DHAAD-zk.js +16 -0
- package/build/assets/use-skills-CE6miQ3r.js +1 -0
- package/build/assets/use-tracking-BGboadaZ.js +68 -0
- package/build/assets/{use-user-conversation-GnGhs_Ob.js → use-user-conversation-BIIpGUgM.js} +1 -1
- package/build/assets/useInfiniteQuery-BLRVmVPU.js +1 -0
- package/build/assets/{useMutation-DyQXZFEF.js → useMutation-CaSHLnX0.js} +1 -1
- package/build/assets/{useQueries-B3T1a7qt.js → useQueries--d_WWAzc.js} +1 -1
- package/build/assets/{useQuery-B38jBavx.js → useQuery-DiPh8LRJ.js} +1 -1
- package/build/assets/utils-BgGG1znF.js +1 -0
- package/build/assets/{vendor~browser-CIoZCqGs.js → vendor~browser-IVYgIgG1.js} +1 -1
- package/build/assets/{vendor~entry.client-Di4qO77Y.js → vendor~entry.client-BcYIVQvB.js} +1 -1
- package/build/assets/{vendor~entry.client-BfviqoVc.js → vendor~entry.client-CXM9oiAk.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js} +2 -2
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js} +1 -1
- package/build/assets/{vendor~files-tab-vm3f67Pz.js → vendor~files-tab-C7RmQJwN.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-kX4LrGQC.js → vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DpA6fir3.js → vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js} +1 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js +1 -0
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js +1 -0
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js +1 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js} +17 -4
- package/build/assets/{verification-settings-CaCzojbc.js → verification-settings-DBsnSXC3.js} +1 -1
- package/build/assets/x-omAzpXkl.js +1 -0
- package/build/favicon-16x16.png +0 -0
- package/build/favicon-32x32.png +0 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +39 -2
- package/build/locales/ca/openhands.json +39 -2
- package/build/locales/de/openhands.json +39 -2
- package/build/locales/en/openhands.json +40 -3
- package/build/locales/es/openhands.json +39 -2
- package/build/locales/fr/openhands.json +39 -2
- package/build/locales/it/openhands.json +39 -2
- package/build/locales/ja/openhands.json +39 -2
- package/build/locales/ko-KR/openhands.json +39 -2
- package/build/locales/no/openhands.json +39 -2
- package/build/locales/pt/openhands.json +39 -2
- package/build/locales/tr/openhands.json +39 -2
- package/build/locales/uk/openhands.json +39 -2
- package/build/locales/zh-CN/openhands.json +39 -2
- package/build/locales/zh-TW/openhands.json +39 -2
- package/config/defaults.json +4 -4
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +46 -6
- package/dist/api/agent-server-adapter.js +187 -168
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/agent-server-compatibility.cjs +1 -1
- package/dist/api/agent-server-compatibility.cjs.map +1 -1
- package/dist/api/agent-server-compatibility.d.ts +4 -0
- package/dist/api/agent-server-compatibility.js +41 -38
- package/dist/api/agent-server-compatibility.js.map +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.d.ts +20 -0
- package/dist/api/automation-service/automation-service.api.js +136 -99
- package/dist/api/automation-service/automation-service.api.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +1 -1
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/backend-registry/types.d.ts +2 -0
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.js +22 -22
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -19
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- 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.js +26 -12
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.d.ts +12 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +94 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +31 -90
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +0 -7
- package/dist/components/features/automations/recommended-automations-section.d.ts +0 -6
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.js +568 -358
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs +1 -1
- package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
- package/dist/components/features/backends/device-flow-auth.d.ts +9 -1
- package/dist/components/features/backends/device-flow-auth.js +56 -55
- package/dist/components/features/backends/device-flow-auth.js.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
- package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
- package/dist/components/features/backends/manage-backends-modal.js +1 -1
- package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +1 -1
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +105 -105
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/chat-message.cjs +1 -1
- package/dist/components/features/chat/chat-message.cjs.map +1 -1
- package/dist/components/features/chat/chat-message.d.ts +2 -1
- package/dist/components/features/chat/chat-message.js +59 -49
- package/dist/components/features/chat/chat-message.js.map +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
- package/dist/components/features/chat/pending-user-messages.js +4 -1
- package/dist/components/features/chat/pending-user-messages.js.map +1 -1
- package/dist/components/features/chat/typing-indicator.cjs +1 -1
- package/dist/components/features/chat/typing-indicator.cjs.map +1 -1
- package/dist/components/features/chat/typing-indicator.d.ts +8 -1
- package/dist/components/features/chat/typing-indicator.js +94 -10
- package/dist/components/features/chat/typing-indicator.js.map +1 -1
- package/dist/components/features/command-menu/command-menu-items.d.ts +5 -1
- package/dist/components/features/files-tab/segmented-toggle.cjs +1 -1
- package/dist/components/features/files-tab/segmented-toggle.cjs.map +1 -1
- package/dist/components/features/files-tab/segmented-toggle.d.ts +2 -0
- package/dist/components/features/files-tab/segmented-toggle.js +17 -14
- package/dist/components/features/files-tab/segmented-toggle.js.map +1 -1
- package/dist/components/features/manifest/manifest-form-field.d.ts +27 -0
- package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +11 -0
- package/dist/components/features/manifest/manifest-review-step.d.ts +14 -0
- package/dist/components/features/manifest/manifest-setup-dialog.d.ts +14 -0
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +16 -16
- 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.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-server-card.js +6 -7
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js.map +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.cjs +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.js +4 -4
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/components/features/settings/settings-input.cjs +1 -1
- package/dist/components/features/settings/settings-input.cjs.map +1 -1
- package/dist/components/features/settings/settings-input.d.ts +6 -0
- package/dist/components/features/settings/settings-input.js +13 -8
- package/dist/components/features/settings/settings-input.js.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +124 -123
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/active-backend-context.cjs +1 -1
- package/dist/contexts/active-backend-context.cjs.map +1 -1
- package/dist/contexts/active-backend-context.d.ts +3 -2
- package/dist/contexts/active-backend-context.js +55 -42
- package/dist/contexts/active-backend-context.js.map +1 -1
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +5 -5
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +4 -0
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.cjs +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.js +7 -5
- package/dist/hooks/query/use-cloud-current-user-id.js.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.js +5 -1
- package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
- package/dist/hooks/query/use-manifest-capabilities.d.ts +21 -0
- package/dist/hooks/query/use-manifest-prerequisites.d.ts +24 -0
- package/dist/hooks/use-can-manage-org-profiles.cjs +1 -1
- package/dist/hooks/use-can-manage-org-profiles.cjs.map +1 -1
- package/dist/hooks/use-can-manage-org-profiles.js +2 -1
- package/dist/hooks/use-can-manage-org-profiles.js.map +1 -1
- package/dist/hooks/use-llm-configured.cjs +1 -1
- package/dist/hooks/use-llm-configured.cjs.map +1 -1
- package/dist/hooks/use-llm-configured.js +2 -1
- package/dist/hooks/use-llm-configured.js.map +1 -1
- package/dist/hooks/use-manifest-preflight.d.ts +18 -0
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +14 -0
- package/dist/hooks/use-tracking.js +28 -10
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +38 -1
- 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 +645 -16
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/external-link.cjs +2 -0
- package/dist/icons/external-link.cjs.map +1 -0
- package/dist/icons/external-link.js +22 -0
- package/dist/icons/external-link.js.map +1 -0
- package/dist/icons/server.cjs +2 -0
- package/dist/icons/server.cjs.map +1 -0
- package/dist/icons/server.js +17 -0
- package/dist/icons/server.js.map +1 -0
- package/dist/locales/ar/openhands.json +39 -2
- package/dist/locales/ca/openhands.json +39 -2
- package/dist/locales/de/openhands.json +39 -2
- package/dist/locales/en/openhands.json +40 -3
- package/dist/locales/es/openhands.json +39 -2
- package/dist/locales/fr/openhands.json +39 -2
- package/dist/locales/it/openhands.json +39 -2
- package/dist/locales/ja/openhands.json +39 -2
- package/dist/locales/ko-KR/openhands.json +39 -2
- package/dist/locales/no/openhands.json +39 -2
- package/dist/locales/pt/openhands.json +39 -2
- package/dist/locales/tr/openhands.json +39 -2
- package/dist/locales/uk/openhands.json +39 -2
- package/dist/locales/zh-CN/openhands.json +39 -2
- package/dist/locales/zh-TW/openhands.json +39 -2
- package/dist/manifests/automation-interface.cjs +2 -0
- package/dist/manifests/automation-interface.cjs.map +1 -0
- package/dist/manifests/automation-interface.d.ts +44 -0
- package/dist/manifests/automation-interface.js +81 -0
- package/dist/manifests/automation-interface.js.map +1 -0
- package/dist/manifests/automation-setup.cjs +2 -0
- package/dist/manifests/automation-setup.cjs.map +1 -0
- package/dist/manifests/automation-setup.d.ts +52 -0
- package/dist/manifests/automation-setup.js +8 -0
- package/dist/manifests/automation-setup.js.map +1 -0
- package/dist/manifests/interface-validation.cjs +2 -0
- package/dist/manifests/interface-validation.cjs.map +1 -0
- package/dist/manifests/interface-validation.d.ts +27 -0
- package/dist/manifests/interface-validation.js +182 -0
- package/dist/manifests/interface-validation.js.map +1 -0
- package/dist/manifests/manifest-actions.d.ts +15 -0
- package/dist/manifests/manifest-capabilities.d.ts +25 -0
- package/dist/manifests/manifest-error-map.d.ts +40 -0
- package/dist/manifests/manifest-local-validation.d.ts +56 -0
- package/dist/manifests/manifest-registry.cjs +2 -0
- package/dist/manifests/manifest-registry.cjs.map +1 -0
- package/dist/manifests/manifest-registry.d.ts +15 -0
- package/dist/manifests/manifest-registry.js +26 -0
- package/dist/manifests/manifest-registry.js.map +1 -0
- package/dist/manifests/manifest-sources.cjs +2 -0
- package/dist/manifests/manifest-sources.cjs.map +1 -0
- package/dist/manifests/manifest-sources.d.ts +15 -0
- package/dist/manifests/manifest-sources.js +8 -0
- package/dist/manifests/manifest-sources.js.map +1 -0
- package/dist/manifests/manifest-template.d.ts +18 -0
- package/dist/manifests/manifest-validation.cjs +2 -0
- package/dist/manifests/manifest-validation.cjs.map +1 -0
- package/dist/manifests/manifest-validation.d.ts +30 -0
- package/dist/manifests/manifest-validation.js +145 -0
- package/dist/manifests/manifest-validation.js.map +1 -0
- package/dist/manifests/types.cjs +2 -0
- package/dist/manifests/types.cjs.map +1 -0
- package/dist/manifests/types.d.ts +227 -0
- package/dist/manifests/types.js +6 -0
- package/dist/manifests/types.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +75 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +78 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs +17 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js +89 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs +10 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js +17 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js +15 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js +18 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js +14 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js +14 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +23 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/index.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/index.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/index.js +18 -0
- package/dist/node_modules/@openhands/extensions/automations/index.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.js +89 -0
- package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +3 -3
- package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +17 -4
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +5 -5
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +9 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js +29 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.js +5 -5
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js +73 -82
- package/dist/routes/mcp.js.map +1 -1
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.ts +8 -0
- package/dist/services/telemetry.js +163 -116
- package/dist/services/telemetry.js.map +1 -1
- package/dist/types/agent-server/core/events/conversation-state-event.d.ts +2 -19
- package/dist/types/agent-server/core/events/observation-event.d.ts +2 -18
- package/dist/types/automation.d.ts +7 -3
- package/dist/types/mcp-server.d.ts +5 -0
- package/dist/types/settings.d.ts +3 -0
- package/dist/utils/api-error-message.d.ts +6 -2
- package/dist/utils/automation-catalog.cjs +2 -0
- package/dist/utils/automation-catalog.cjs.map +1 -0
- package/dist/utils/automation-catalog.d.ts +28 -0
- package/dist/utils/automation-catalog.js +5 -0
- package/dist/utils/automation-catalog.js.map +1 -0
- package/dist/utils/automation-timeout.d.ts +3 -2
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.d.ts +8 -0
- package/dist/utils/mcp-config.js +25 -20
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-installed-servers.cjs +1 -1
- package/dist/utils/mcp-installed-servers.cjs.map +1 -1
- package/dist/utils/mcp-installed-servers.js +6 -3
- package/dist/utils/mcp-installed-servers.js.map +1 -1
- package/dist/utils/responder-deployment.d.ts +5 -1
- package/dist/utils/transcript-export/index.cjs +5 -5
- package/dist/utils/transcript-export/index.js +12 -12
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +1 -0
- package/scripts/dev-safe.mjs +17 -12
- package/scripts/dev-static.mjs +17 -0
- package/scripts/dev-with-automation.mjs +12 -14
- package/scripts/ingress.mjs +22 -0
- package/scripts/proxy-utils.mjs +157 -2
- package/scripts/runtime-services-info.mjs +6 -6
- package/scripts/static-build.mjs +0 -7
- package/scripts/static-server.mjs +10 -0
- package/build/assets/active-backend-context-BlZPzZNU.js +0 -1
- package/build/assets/agent-context-settings-CTaN-Iw9.js +0 -1
- package/build/assets/agent-profiles-settings-CR4VTqv_.js +0 -1
- package/build/assets/agent-server-conversation-service.api-Btmi4q6d.js +0 -41
- package/build/assets/agent-settings-KQs-occT.js +0 -1
- package/build/assets/api-key-entry-screen-BhR24gkM.js +0 -1
- package/build/assets/app-settings-Bs4sY8WP.js +0 -1
- package/build/assets/automation-BGP_I1RR.js +0 -1
- package/build/assets/automation-detail-CwDnJbYR.js +0 -2
- package/build/assets/automation-export-Bu-r-EzL.js +0 -2
- package/build/assets/automations-list-CYw7_6FR.js +0 -1
- package/build/assets/backend-form-modal-Ce-KRHOJ.js +0 -1
- package/build/assets/browser-BUDJnBg4.js +0 -6
- package/build/assets/check-BMOG005H.js +0 -1
- package/build/assets/chevron-down-CV1zZP_K.js +0 -1
- package/build/assets/circle-check-lvN_jFN5.js +0 -1
- package/build/assets/client-source-1v-kWLNU.js +0 -1
- package/build/assets/cloud-funnel-analytics-CasMM7EO.js +0 -1
- package/build/assets/command-menu-N_BriUy8.js +0 -1
- package/build/assets/condenser-settings-Czi8cKxV.js +0 -1
- package/build/assets/conversation-C25pc2dT.js +0 -1
- package/build/assets/conversation-CObLYSJd.js +0 -90
- package/build/assets/conversation-panel-C25pc2dT.js +0 -1
- package/build/assets/conversation-state-store-DTq4hFoP.js +0 -1
- package/build/assets/extensions-hub-BKftOQ-X.js +0 -1
- package/build/assets/extensions-navigation-DF24q1H1.js +0 -1
- package/build/assets/files-tab-SAiFCnS5.js +0 -1
- package/build/assets/git-provider-icon-BREx-yUX.js +0 -1
- package/build/assets/home-EPNFgzUh.js +0 -1
- package/build/assets/home-sN90Xcxp.js +0 -1
- package/build/assets/index-home-EPNFgzUh.js +0 -1
- package/build/assets/install-server-modal-BI8yUfmr.js +0 -1
- package/build/assets/llm-not-configured-banner-DTWzISnk.js +0 -27
- package/build/assets/llm-settings-BXk5_Pac.js +0 -1
- package/build/assets/llm-settings-C1vpgWam.js +0 -1
- package/build/assets/loader-circle-6zlEYCJw.js +0 -1
- package/build/assets/manage-backends-modal-DhflyGTf.js +0 -1
- package/build/assets/manifest-8082e879.js +0 -1
- package/build/assets/mcp-CxLPda-W.js +0 -9
- package/build/assets/messages-DINDkPNK.js +0 -40
- package/build/assets/onboarding-modal-DdvE6rzw.js +0 -1
- package/build/assets/organization-service.api-CT2OQlLz.js +0 -1
- package/build/assets/plugins-management-service-DVkoM3eA.js +0 -1
- package/build/assets/plus-vIbGD459.js +0 -1
- package/build/assets/profiles-service.api-CBafmAPO.js +0 -1
- package/build/assets/providers-9UzRB9mT.js +0 -1
- package/build/assets/proxy-C79PCMjo.js +0 -1
- package/build/assets/recommended-automations-launcher-BF2mtAKw.js +0 -58
- package/build/assets/root-B5JXKp1P.css +0 -1
- package/build/assets/root-Sj7W28yE.js +0 -2
- package/build/assets/root-layout-DbhKVoc7.js +0 -3
- package/build/assets/schema-field-CV6bFnoL.js +0 -1
- package/build/assets/search-sKuYKllf.js +0 -1
- package/build/assets/secrets-service-BjK-bPN2.js +0 -1
- package/build/assets/segmented-toggle-DbbD3Tve.js +0 -1
- package/build/assets/settings-Bj5Oo45A.js +0 -1
- package/build/assets/settings-input-BjW_zyTN.js +0 -1
- package/build/assets/settings-service.api-DryhKdSr.js +0 -1
- package/build/assets/shared-conversation-CnMxy7p_.js +0 -1
- package/build/assets/telemetry-cmCL3o6Z.js +0 -2
- package/build/assets/use-activate-agent-profile-DH33MvVj.js +0 -1
- package/build/assets/use-agent-profiles-Dmd_4H8q.js +0 -1
- package/build/assets/use-cloud-current-user-id-B6DP3s47.js +0 -1
- package/build/assets/use-is-authed-BsS4XwSL.js +0 -1
- package/build/assets/use-llm-profiles-BMQoc612.js +0 -1
- package/build/assets/use-onboarding-completion-B-2BTS-y.js +0 -1
- package/build/assets/use-plugins-marketplace-PBc_XNz_.js +0 -1
- package/build/assets/use-save-agent-profile-2Mk9ZX37.js +0 -1
- package/build/assets/use-settings-DBI44RnH.js +0 -1
- package/build/assets/use-settings-nav-items-Cva28C-c.js +0 -16
- package/build/assets/use-skills-RQsCtdzN.js +0 -1
- package/build/assets/use-tracking-CN1nIMnY.js +0 -1
- package/build/assets/utils-qjs_KuS4.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js +0 -1
- package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js +0 -1
- package/build/assets/x-EjvKGawc.js +0 -1
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{A as a,g as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as s}from"./useQuery-B38jBavx.js";import{A as c,C as l,D as u,I as d,V as f,n as p,st as m}from"./active-backend-context-BlZPzZNU.js";import{E as h,t as g,z as _}from"./utils-qjs_KuS4.js";import{r as v,u as y}from"./messages-DINDkPNK.js";import{r as b}from"./conversation-CObLYSJd.js";import{a as x,c as S,i as C,l as w,n as T,o as E,r as D,s as O,t as k}from"./vendor~files-tab-vm3f67Pz.js";import{n as A,t as j}from"./format-time-delta-DuhE50B-.js";import{i as M}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";import{t as N}from"./proxy-C79PCMjo.js";import{s as P}from"./git-provider-icon-BREx-yUX.js";import{c as ee,f as te}from"./conversation-store-C6hSXHw0.js";import{t as ne}from"./segmented-toggle-DbbD3Tve.js";import{c as re,u as ie}from"./agent-server-conversation-service.api-Btmi4q6d.js";import{r as ae}from"./typography-C6fuRTTT.js";import{_ as F}from"./llm-not-configured-banner-DTWzISnk.js";import{G as oe,J as se,K as I,h as L,q as R,t as ce,x as le}from"./markdown-renderer-CvOO0YIr.js";import{t as ue}from"./link-external-BDBCz-_z.js";import{n as de,t as fe}from"./highlighted-source-view-suUKd5if.js";import{t as z}from"./conversation-tab-empty-state-BCMHkGQk.js";var B=e(t(),1),V=n();function pe(){let{t:e}=i(`openhands`);return(0,V.jsx)(z,{className:`h-full`,icon:(0,V.jsx)(A,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(_.FILES$NO_FILE_SELECTED)})}var me=class{static async executeCommand(e,t,n,r,i=30){let a=d().backend;if(a.kind===`cloud`&&e){let o=await N({backend:a,method:`POST`,hostOverride:c(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new M(u({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=d().backend;return r.kind===`cloud`&&e?(await N({backend:r,method:`GET`,hostOverride:c(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new o(u({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}};function H(e){return e.startsWith(`/`)?e:`/${e}`}async function U(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:H(r.path)});return N({backend:i,method:`GET`,hostOverride:c(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new M(u({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function he(e){return l(e,404)||a(e)&&e.response?.status===404}var W=class{static async getGitChanges(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,H(r));let n=await N({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:P(String(e.status)),path:e.path}))}let a=await new M(u({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await U(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(he(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await U(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await U(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=d().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,H(r));let n=await N({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new M(u({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}};function G(e,t){let n=t?.trim();if(n)return n;if(!e)return f;let r=e.split(`/`);return`${f}/${r[r.length-1]}`}var K=()=>{let{conversationId:e}=R(),{data:t}=I(),[n,r]=B.useState([]),i=B.useRef(null),a=b(),o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=B.useMemo(()=>G(l,u),[l,u]),f=s({queryKey:[`file_changes`,e,o,c,d],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return W.getGitChanges(e,o,c,d)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:a&&!!e,meta:{disableToast:!0}});return B.useEffect(()=>{if(!f.isFetching&&f.isSuccess&&f.data){let e=f.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[f.isFetching,f.isSuccess,f.data]),{data:n,isLoading:f.isLoading,isFetching:f.isFetching,isSuccess:f.isSuccess,isError:f.isError,error:f.error,refetch:f.refetch}},q=2e3,ge=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function _e(){return`find . \\( ${ge.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${q}`}function ve(e){return e.startsWith(`./`)?e.slice(2):e}function ye(e){let{data:t}=I(),n=b(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),c=s({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await me.executeCommand(i,a,_e(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(ve);return Array.from(new Set(t)).slice(0,q)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function be(e){let t=K(),n=(0,B.useMemo)(()=>{if(!e)return;let n=t.data.filter(e=>e.status!==`D`).map(e=>e.path);return Array.from(new Set(n)).slice(0,q)},[e,t.data]);return{data:e?n:void 0,isLoading:e?t.isLoading:!1}}function xe(){let{backend:e}=p(),t=e.kind===`cloud`,n=ye(!t),r=be(t);return t?r:n}function Se(){let{data:e}=I(),t=b(),n=e?.id,r=e?.conversation_url,i=e?.session_api_key,a=d().backend.kind===`local`,o=s({queryKey:[`workspace-session`,n,r,i],queryFn:async()=>({baseUrl:await new M(u({conversationUrl:r,sessionApiKey:i})).startWorkspaceSession(n)}),enabled:t&&!!n&&a,staleTime:1/0,gcTime:1/0,retry:!1});return{data:o.data??null,isLoading:o.isLoading,isError:o.isError,error:o.error??null}}function Ce(e,t){let n=(t??``).replace(/^\/+/,``);return n?`${e}${n.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`:e}var J=te(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function we(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var Te=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`svg`,`avif`]),Ee=new Set([`pdf`]);function Y(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function De(e){switch(Y(e)){case`html`:case`htm`:return`text/html`;case`css`:return`text/css`;case`js`:case`mjs`:case`cjs`:return`text/javascript`;case`json`:return`application/json`;case`md`:case`markdown`:return`text/markdown`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;case`bmp`:return`image/bmp`;case`ico`:return`image/x-icon`;case`avif`:return`image/avif`;case`pdf`:return`application/pdf`;default:return`text/plain`}}function Oe(e){let t=Y(e);return Te.has(t)?`image`:Ee.has(t)?`pdf`:`text`}function ke(e){let t=new Uint8Array(e,0,Math.min(e.byteLength,8e3));for(let e=0;e<t.length;e+=1)if(t[e]===0)return!0;return!1}function X(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode.apply(null,t.subarray(e,e+n));return btoa(r)}function Ae(e){let{data:t}=I(),n=b(),{data:r}=Se(),i=J(e=>e.count),a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),f=r?.baseUrl,p=d().backend.kind===`cloud`,m=G(l,u),h=m.startsWith(`/`)?m:`/${m}`,g=e?`${h}/${e}`:null;return s({queryKey:[`workspace-file-content`,a,o,c,p?`cloud`:f,e,g,i],queryFn:async()=>{if(!e)throw Error(`No path`);let t=Oe(e),n=De(e);if(p){let r=await re(a,g);if(t===`text`){let t=new TextEncoder().encode(r);return ke(t.buffer)?{path:e,kind:`binary`,text:null,staticUrl:`data:application/octet-stream;base64,${X(t.buffer)}`,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:r,staticUrl:`data:${n};charset=utf-8;base64,${X(t.buffer)}`,mimeType:n}}return{path:e,kind:t,text:null,staticUrl:`data:${n};base64,${X(new TextEncoder().encode(r).buffer)}`,mimeType:n}}if(!f)throw Error(`No workspace session`);let r=Ce(f,e);if(t!==`text`)return{path:e,kind:t,text:null,staticUrl:r,mimeType:n};let i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to read ${e}: ${i.status}`);let o=await i.arrayBuffer();return ke(o)?{path:e,kind:`binary`,text:null,staticUrl:r,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:new TextDecoder(`utf-8`,{fatal:!1}).decode(o),staticUrl:r,mimeType:n}},enabled:n&&!!a&&!!e&&(p||!!f),retry:!1,staleTime:1e3*5,gcTime:1e3*60,meta:{disableToast:!0}})}function je(){let{data:e,isLoading:t}=I(),n=e?.id?ie(e.id):null;return{hasAttachedSource:!!e?.selected_repository||!!n?.selected_workspace,isLoading:t}}function Me(e){let{data:t}=I(),n=b(),{backend:r}=p(),i=r.kind===`local`,a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.workspace?.working_dir?.trim(),u=(e?.enabled??!0)&&i&&n&&!!a&&!!l,d=s({queryKey:[`has-git-commits`,a,o,c,l],queryFn:async()=>(await me.executeCommand(o,c,`git rev-parse --verify HEAD`,l,10)).exit_code===0,enabled:u,retry:!1,staleTime:6e4,gcTime:5*6e4,meta:{disableToast:!0}});return{hasCommits:d.data??null,isLoading:d.isLoading}}var Ne=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Pe=new Set([`view`]),Fe=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function Ie(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Ne.has(t.kind)||t.command&&Pe.has(t.command))}function Le(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Fe.has(t.kind)}function Re(){let e=r(),t=le(e=>e.events),n=J(e=>e.bump),i=(0,B.useRef)(new Set),a=(0,B.useRef)(new WeakSet);(0,B.useEffect)(()=>{let r=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?a.current.has(e):i.current.has(t))||(t===void 0?a.current.add(e):i.current.add(t),Ie(e)?r=!0:Le(e)&&(o=!0))}!r&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),r&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var ze=[`index.html`,`index.htm`,`readme.md`,`readme`,`main.html`,`app.html`,`index.js`,`index.ts`,`index.tsx`,`index.jsx`,`main.py`,`app.py`,`main.go`,`main.rs`,`main.java`,`main.c`,`main.cpp`,`package.json`,`pyproject.toml`,`cargo.toml`,`go.mod`,`pom.xml`,`dockerfile`,`makefile`],Be=[`license`,`license.md`,`license.txt`,`changelog.md`,`agents.md`,`tsconfig.json`,`.env.sample`,`.env.example`];function Ve(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()}function He(e){return e.split(`/`).filter(Boolean).length-1}function Ue(e){let t=Ve(e),n=ze.indexOf(t);if(n!==-1)return n;let r=Be.indexOf(t);return r===-1?1e4:1e3+r}function We(e){return[...e].sort((e,t)=>{let n=He(e)-He(t);if(n!==0)return n;let r=Ue(e)-Ue(t);return r===0?e.localeCompare(t):r})}function Ge({paths:e,selectedPath:t,onSelectFile:n,isTreeVisible:r,onToggleTree:a}){let{t:o}=i(`openhands`),s=(0,B.useMemo)(()=>We(e),[e]);return(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]`,"data-testid":`file-quick-row`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:a,"data-testid":`file-quick-row-tree-toggle`,"aria-pressed":r,"aria-label":o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),title:o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),className:g(`shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer`,`text-[var(--oh-text-tertiary)] hover:bg-tertiary`,r&&`bg-[var(--oh-surface-raised)]`),children:(0,V.jsx)(w,{className:`w-3 h-3`,"aria-hidden":!0,strokeWidth:2})}),s.length>0&&(0,V.jsx)(`div`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0`,children:s.map(e=>{let r=t===e;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(e),title:e,"data-testid":`file-quick-row-item-${e}`,className:g(`inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer`,r?`bg-[var(--oh-interactive-hover)] text-white`:`bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary`),children:e},e)})})]})}var Ke=new Set([`html`,`htm`,`svg`]),qe=new Set([`md`,`markdown`,`mdx`]),Je={pptx:`PowerPoint`,ppt:`PowerPoint`,docx:`Word`,doc:`Word`,xlsx:`Excel`,xls:`Excel`};function Z(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Q({path:e}){let{t}=i(`openhands`),n=Je[Z(e)];return(0,V.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":n?`file-content-viewer-unsupported-document`:`file-content-viewer-binary-fallback`,children:n?t(_.FILES$UNSUPPORTED_DOCUMENT,{type:n}):t(_.FILES$BINARY_FALLBACK)})}function Ye({path:e,viewMode:t}){let{t:n}=i(`openhands`),r=Ae(e),a=J(e=>e.count);if(r.isLoading)return(0,V.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,children:n(_.FILES$LOADING_FILES)});if(r.isError||!r.data)return(0,V.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":`file-content-viewer-error`,children:r.error?.message??n(_.FILES$LOAD_ERROR)});let{kind:o,text:s,staticUrl:c,mimeType:l}=r.data,u=we(c,a);return t===`plain`?o===`text`&&s!==null?(0,V.jsx)(fe,{path:e,text:s,mimeType:l??void 0}):(0,V.jsx)(Q,{path:e}):o===`image`?(0,V.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-[var(--oh-surface)] p-4`,"data-testid":`file-content-viewer-image`,children:(0,V.jsx)(`img`,{src:u,alt:e,className:`max-h-full max-w-full object-contain`})}):o===`pdf`?(0,V.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`binary`?(0,V.jsx)(Q,{path:e}):l===`text/html`||Ke.has(Z(e))?(0,V.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`text`&&qe.has(Z(e))?(0,V.jsx)(`div`,{"data-testid":`file-content-viewer-markdown`,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] text-white custom-scrollbar-always`,children:(0,V.jsx)(`div`,{className:`prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]`,children:(0,V.jsx)(ce,{content:s??``,includeStandard:!0,includeHeadings:!0})})}):o===`text`&&s!==null?(0,V.jsx)(fe,{path:e,text:s,mimeType:l??void 0}):(0,V.jsx)(Q,{path:e})}var Xe=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 13 15`,fill:`none`,...e,children:(0,V.jsx)(`path`,{d:`M6.59467 0.21967C6.88756 -0.0732233 7.36244 -0.0732233 7.65533 0.21967L9.90533 2.46967C10.1982 2.76256 10.1982 3.23744 9.90533 3.53033L7.65533 5.78033C7.36244 6.07322 6.88756 6.07322 6.59467 5.78033C6.30178 5.48744 6.30178 5.01256 6.59467 4.71967L7.56434 3.75H6.375C3.71421 3.75 1.5 5.96421 1.5 8.625C1.5 11.2858 3.71421 13.5 6.375 13.5C9.03579 13.5 11.25 11.2858 11.25 8.625C11.25 8.21079 11.5858 7.875 12 7.875C12.4142 7.875 12.75 8.21079 12.75 8.625C12.75 12.1142 9.86421 15 6.375 15C2.88579 15 0 12.1142 0 8.625C0 5.13579 2.88579 2.25 6.375 2.25H7.56434L6.59467 1.28033C6.30178 0.987437 6.30178 0.512563 6.59467 0.21967Z`,fill:`currentColor`})}),Ze=()=>{let{conversationId:e}=R(),{data:t}=I(),n=b(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),c=B.useMemo(()=>G(a,o),[a,o]),l=s({queryKey:[`git_commits`,e,r,i,c],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return W.getGitCommits(r,i,c,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:l.data?.commits??[],hasMore:l.data?.hasMore??!1,isUnsupported:l.data===null,isLoading:l.isLoading,isFetching:l.isFetching,isSuccess:l.isSuccess,isError:l.isError}},Qe=e=>(0,V.jsx)(`svg`,{width:13,height:8,viewBox:`0 0 13 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,V.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.259766 6.17427L6.26425 0.715628L12.2688 6.17427L11.2597 7.28418L6.26425 2.74282L1.26878 7.28418L0.259766 6.17427Z`,fill:`currentColor`})}),$e=e=>{let{conversationId:t}=R(),{data:n}=I(),r=n?.conversation_url,i=n?.session_api_key,a=n?.selected_repository,o=n?.workspace?.working_dir?.trim(),c=B.useMemo(()=>`${G(a,o)}/${e.filePath}`,[a,e.filePath,o]),l=e.type===`D`;return s({queryKey:e.commit?[`commit_file_diff`,t,r,i,e.commit,c]:[`file_diff`,t,r,i,c],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return W.getGitChangeDiff(t,r,i,c,e.commit)},enabled:e.enabled&&(!l||!!e.commit),staleTime:e.commit?1/0:1e3*60*5,gcTime:1e3*60*15})};function et({className:e}){let{t}=i(`openhands`);return(0,V.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,V.jsx)(`div`,{className:g(`animate-spin rounded-full border-4 border-transparent border-t-white`,e),role:`status`,"aria-label":t(_.HOME$LOADING)})})}function tt({height:e,children:t}){return(0,V.jsx)(`div`,{"data-testid":`editor-container`,className:`w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]`,style:{"--editor-height":`${e}px`},children:t})}var nt=[{mode:`old`,icon:E},{mode:`diff`,icon:x},{mode:`new`,icon:k}],rt={renderValidationDecorations:`off`,readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},automaticLayout:!0,scrollbar:{alwaysConsumeMouseWheel:!1}},it={A:C,D,M:T,R:`Renamed`,U:`Untracked`},at=e=>{e.editor.defineTheme(`custom-diff-theme`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`6a9955`},{token:`keyword`,foreground:`569cd6`},{token:`string`,foreground:`ce9178`},{token:`number`,foreground:`b5cea8`}],colors:{"diffEditor.insertedTextBackground":`#014b01AA`,"diffEditor.removedTextBackground":`#750000AA`,"diffEditor.insertedLineBackground":`#003f00AA`,"diffEditor.removedLineBackground":`#5a0000AA`,"diffEditor.border":`var(--oh-border-subtle)`,"editorUnnecessaryCode.border":`#00000000`,"editorUnnecessaryCode.opacity":`rgba(0, 0, 0, 0.467)`}})};function ot({path:e,type:t,commit:n}){let{t:r}=i(`openhands`),[a,o]=B.useState(!0),[s,c]=B.useState(400),[l,u]=B.useState(`diff`),d=B.useRef(null),f=B.useRef(null),p=t===`A`||t===`U`,m=t===`D`,h=B.useMemo(()=>{if(t===`R`){let t=e.split(/\s+/).slice(1);return t[t.length-1]}return e},[e,t]),{data:y,isLoading:b,isSuccess:x,isRefetching:C}=$e({filePath:h,type:t,enabled:!a,commit:n}),w=B.useCallback(()=>{if(!d.current)return;let e=d.current.getOriginalEditor(),t=d.current.getModifiedEditor();e&&t&&c(Math.max(e.getContentHeight(),t.getContentHeight())+20)},[]),T=B.useCallback(()=>{f.current&&c(f.current.getContentHeight()+20)},[]),E=e=>{d.current=e,w(),e.getOriginalEditor().onDidContentSizeChange(w),e.getModifiedEditor().onDidContentSizeChange(w)},D=e=>{f.current=e,T(),e.onDidContentSizeChange(T)},k=(t===`U`?it.A:it[t])||`?`,A=typeof k==`string`?(0,V.jsx)(ae.Text,{children:k}):B.createElement(k,{className:`w-5 h-5`}),j=b||C,M=v(h),N=M===`markdown`,P=l===`old`?y?.original??``:y?.modified??``;return(0,V.jsxs)(`div`,{"data-testid":`file-diff-viewer-outer`,className:`w-full flex flex-col`,children:[(0,V.jsx)(`div`,{className:`flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer`,onClick:()=>o(e=>!e),children:(0,V.jsxs)(`span`,{className:`text-sm w-full text-content flex items-center gap-2`,children:[j?(0,V.jsx)(et,{className:`w-4 h-4`}):A,(0,V.jsx)(`strong`,{className:`w-full truncate font-medium`,children:h}),!a&&!m&&(0,V.jsx)(`span`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:nt.map(({mode:e,icon:t})=>(0,V.jsx)(`button`,{"data-testid":`view-mode-${e}`,type:`button`,"aria-pressed":l===e,onClick:()=>u(e),className:g(`p-1 rounded transition-colors cursor-pointer`,l===e?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-white`),children:(0,V.jsx)(t,{className:`w-4 h-4`})},e))}),(0,V.jsx)(`button`,{"data-testid":`collapse`,type:`button`,children:(0,V.jsx)(Qe,{className:g(`w-4 h-4 transition-transform`,a&&`transform rotate-180`)})})]})}),!a&&m&&!n&&(0,V.jsx)(`div`,{"data-testid":`file-deleted-message`,className:`w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm`,children:r(_.DIFF_VIEWER$FILE_DELETED)}),!a&&(!m||!!n)&&x&&(l===`diff`?(0,V.jsx)(tt,{height:s,children:(0,V.jsx)(S,{"data-testid":`file-diff-viewer`,className:`w-full h-full`,language:M,original:p?``:y?.original??``,modified:m?``:y?.modified??``,theme:`custom-diff-theme`,onMount:E,beforeMount:at,options:{...rt,renderSideBySide:!p&&!m,hideUnchangedRegions:{enabled:!0}}})}):N?(0,V.jsx)(`div`,{className:`w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none`,"data-testid":`markdown-preview`,children:(0,V.jsx)(ce,{content:P,includeStandard:!0,includeHeadings:!0})}):(0,V.jsx)(tt,{height:s,children:(0,V.jsx)(O,{"data-testid":`file-single-viewer`,className:`w-full h-full`,language:M,value:P,theme:`custom-diff-theme`,beforeMount:at,onMount:D,options:rt})}))]})}function $(){return(0,V.jsx)(T,{"aria-hidden":!0,className:`size-full`})}function st(){let{t:e}=i(`openhands`);return(0,V.jsx)(z,{icon:(0,V.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_CHANGES)})}var ct=[{key:_.TIPS$CUSTOMIZE_MICROAGENT,link:`https://docs.all-hands.dev/usage/prompting/microagents-repo`},{key:_.TIPS$SETUP_SCRIPT,link:`https://docs.all-hands.dev/usage/prompting/repository#setup-script`},{key:_.TIPS$VSCODE_INSTANCE},{key:_.TIPS$SAVE_WORK},{key:_.TIPS$SPECIFY_FILES,link:`https://docs.all-hands.dev/usage/prompting/prompting-best-practices`},{key:_.TIPS$HEADLESS_MODE,link:`https://docs.all-hands.dev/usage/how-to/headless-mode`},{key:_.TIPS$CLI_MODE,link:`https://docs.all-hands.dev/usage/how-to/cli-mode`},{key:_.TIPS$GITHUB_HOOK,link:`https://docs.all-hands.dev/usage/cloud/github-installation#working-on-github-issues-and-pull-requests-using-openhands`},{key:_.TIPS$BLOG_SIGNUP,link:`https://www.all-hands.dev/blog`},{key:_.TIPS$API_USAGE,link:`https://docs.all-hands.dev/api-reference/health-check`}];function lt(){return ct[Math.floor(Math.random()*ct.length)]}function ut(){let{t:e}=i(`openhands`),[t,n]=B.useState(lt());return B.useEffect(()=>{n(lt())},[]),(0,V.jsx)(`div`,{className:`w-full bg-tertiary p-4 text-left`,children:(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(y,{className:`mt-0.5 h-4 w-4 shrink-0 fill-[var(--oh-muted)]`,"aria-hidden":!0}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h4`,{className:`text-sm font-semibold text-[var(--oh-text-tertiary)]`,children:e(_.TIPS$PROTIP)}),(0,V.jsxs)(`p`,{className:`text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:[e(t.key),t.link?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{href:t.link,target:`_blank`,rel:`noopener noreferrer`,className:`underline transition-colors hover:text-white`,children:e(_.TIPS$LEARN_MORE)})]}):null]})]})]})})}var dt=/not a git repository/i,ft=new Set([_.DIFF_VIEWER$WAITING_FOR_RUNTIME,_.DIFF_VIEWER$LOADING]);function pt({messages:e}){let{t}=i(`openhands`);return e.length===1&&ft.has(e[0])?(0,V.jsx)(F,{testId:`changes-tab-status`,messageKey:e[0]}):(0,V.jsx)(z,{icon:(0,V.jsx)($,{}),children:e.map(e=>(0,V.jsx)(`span`,{className:`block`,children:t(e)},e))})}function mt(){let{data:e,isSuccess:t,isError:n,error:r,isLoading:i}=K(),[a,o]=B.useState(null),{curAgentState:s}=oe(),c=!h.includes(s),l=r&&dt.test(m(r));return B.useEffect(()=>{if(!c)o([_.DIFF_VIEWER$WAITING_FOR_RUNTIME]);else if(r){let e=m(r);dt.test(e)?o([_.DIFF_VIEWER$NOT_A_GIT_REPO,_.DIFF_VIEWER$ASK_OH]):o([e])}else o(i?[_.DIFF_VIEWER$LOADING]:null)},[c,l,i,r,o]),(0,V.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:!t||!e.length?(0,V.jsxs)(`div`,{className:`flex flex-col h-full w-full`,children:[(0,V.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[a&&(0,V.jsx)(pt,{messages:a}),!a&&t&&e.length===0&&(0,V.jsx)(st,{})]}),!n&&t&&e.length===0&&(0,V.jsx)(ut,{})]}):(0,V.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:e.slice(0,100).map(e=>(0,V.jsx)(ot,{path:e.path,type:e.status},e.path))})})}var ht=(e,t)=>{let{conversationId:n}=R(),{data:r}=I(),i=b(),a=r?.conversation_url,o=r?.session_api_key,c=r?.selected_repository,l=r?.workspace?.working_dir?.trim(),u=B.useMemo(()=>G(c,l),[c,l]);return s({queryKey:[`commit_changes`,n,a,o,u,e],queryFn:async()=>{if(!n)throw Error(`No conversation ID`);return W.getCommitChanges(a,o,u,e)},staleTime:1/0,gcTime:1e3*60*15,retry:!1,enabled:t.enabled&&i&&!!n,meta:{disableToast:!0}})};function gt({commit:e,showAuthor:t,isExpanded:n,onToggle:r}){let{t:a}=i(`openhands`),{data:o,isLoading:s,isSuccess:c}=ht(e.sha,{enabled:n});return(0,V.jsxs)(`div`,{"data-testid":`commit-row`,className:`w-full flex flex-col`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,"data-testid":`commit-row-toggle`,className:`w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer`,children:[(0,V.jsx)(`code`,{className:`font-mono text-xs text-[var(--oh-muted)] flex-shrink-0`,children:e.shortSha}),(0,V.jsx)(`strong`,{className:`flex-1 truncate font-medium`,children:e.subject}),t&&(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate max-w-32 flex-shrink-0`,children:e.author}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] flex-shrink-0`,children:`${j(e.timestamp)} ${a(_.CONVERSATION$AGO)}`}),(0,V.jsx)(Qe,{className:g(`w-4 h-4 transition-transform flex-shrink-0`,!n&&`transform rotate-180`)})]}),n&&(0,V.jsxs)(`div`,{"data-testid":`commit-row-content`,className:`w-full flex flex-col pl-6`,children:[s&&(0,V.jsx)(`div`,{className:`p-3`,children:(0,V.jsx)(et,{className:`w-4 h-4`})}),c&&o?.map(t=>(0,V.jsx)(ot,{path:t.path,type:t.status,commit:e.sha},t.path))]})]})}function _t({commits:e,hasMore:t}){let{t:n}=i(`openhands`),[r,a]=B.useState(null),o=new Set(e.map(e=>e.author)).size>1;return(0,V.jsxs)(`section`,{"data-testid":`commit-list`,className:`w-full flex flex-col`,children:[e.map(e=>(0,V.jsx)(gt,{commit:e,showAuthor:o,isExpanded:r===e.sha,onToggle:()=>a(t=>t===e.sha?null:e.sha)},e.sha)),t&&(0,V.jsx)(`div`,{"data-testid":`commit-list-cap-notice`,className:`px-3 py-2.5 text-xs text-[var(--oh-muted)]`,children:n(_.DIFF_VIEWER$COMMITS_CAP,{count:e.length})})]})}function vt(){let{t:e}=i(`openhands`),{conversationId:t}=R(),{commits:n,hasMore:r,isUnsupported:a,isLoading:o,isSuccess:s}=Ze(),{curAgentState:c}=oe(),l=!h.includes(c);return(0,V.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:s&&!a&&n.length>0?(0,V.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:(0,V.jsx)(_t,{commits:n,hasMore:r},t)}):(0,V.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[!l&&(0,V.jsx)(F,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$WAITING_FOR_RUNTIME}),l&&o&&(0,V.jsx)(F,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$LOADING}),l&&!o&&(0,V.jsx)(z,{icon:(0,V.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_COMMITS)})]})})}function yt(){let{t:e}=i(`openhands`);Re();let{hasAttachedSource:t,isLoading:n}=je(),{hasCommits:a}=Me({enabled:t}),{conversationId:o}=se(),{state:s,setFilesTabDiffView:c,setFilesTabContentViewMode:l}=ee(o??``),u=(t||n)&&a!==!1,d=s.filesTabDiffView??u,f=s.filesTabContentViewMode,{isSuccess:p,isUnsupported:m}=Ze(),h=p&&!m,[g,v]=(0,B.useState)(!1),y=d?`on`:`off`;g&&h&&(y=`commits`);let[b,x]=(0,B.useState)(!1),S=xe(),C=(0,B.useMemo)(()=>S.data??[],[S.data]),w=L(e=>e.selectedPath),T=L(e=>e.selectedConversationId),E=L(e=>e.setSelectedPath),D=T===o?w:null,O=(0,B.useCallback)(e=>E(e,o),[o,E]),k=Ae(D),A=J(e=>e.count),j=we(k.data?.staticUrl??null,A);(0,B.useEffect)(()=>{T!==o&&E(null,o)},[T,o,E]),(0,B.useEffect)(()=>{if(D||C.length===0)return;let[e]=We(C);e&&E(e,o)},[C,D,o,E]);let M=r(),{refetch:N,isFetching:P}=K(),te=()=>{N(),M.invalidateQueries({queryKey:[`workspace-files`]}),M.invalidateQueries({queryKey:[`workspace-file-content`]}),M.invalidateQueries({queryKey:[`git_commits`]})};return(0,V.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,V.jsx)(ne,{ariaLabel:e(_.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:y,options:[{value:`on`,label:e(_.FILES$DIFF_VIEW)},...h?[{value:`commits`,label:e(_.DIFF_VIEWER$COMMITS)}]:[],{value:`off`,label:e(_.COMMON$FILES)}],onChange:e=>{e===`commits`?v(!0):(v(!1),c(e===`on`))}}),y===`off`&&(0,V.jsx)(ne,{ariaLabel:e(_.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:f,options:[{value:`rich`,label:e(_.FILES$RICH)},{value:`plain`,label:e(_.FILES$PLAIN)}],onChange:l}),(0,V.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[y===`off`&&j&&(0,V.jsx)(`a`,{href:j,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e(_.FILES$OPEN_IN_NEW_WINDOW),title:e(_.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,V.jsx)(ue,{width:14,height:14})}),(0,V.jsx)(`button`,{type:`button`,onClick:te,disabled:P,"aria-label":e(_.FILES$REFRESH),title:e(_.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,V.jsx)(Xe,{width:12.75,height:15,color:`#ffffff`,className:P?`animate-spin`:``})})]})]}),y===`on`&&(0,V.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,V.jsx)(mt,{})}),y===`commits`&&(0,V.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,V.jsx)(vt,{})}),y===`off`&&(0,V.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:S.isLoading?(0,V.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:e(_.FILES$LOADING_FILES)}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ge,{paths:C,selectedPath:D,onSelectFile:O,isTreeVisible:b,onToggleTree:()=>x(e=>!e)}),(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[b&&(0,V.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,V.jsx)(de,{paths:C,selectedPath:D,onSelectFile:O})}),(0,V.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:D?(0,V.jsx)(Ye,{path:D,viewMode:f}):(0,V.jsx)(pe,{})})]})]})})]})}export{yt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{a,o,t as s,u as c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{w as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useMutation-DyQXZFEF.js";import{t as d}from"./useQuery-B38jBavx.js";import{D as f,I as p,n as m,nt as h,rt as g}from"./active-backend-context-BlZPzZNU.js";import{C as ee,_,i as v,t as y,z as b}from"./utils-qjs_KuS4.js";import{i as x}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";import{t as S}from"./proxy-C79PCMjo.js";import{t as C}from"./use-tracking-CN1nIMnY.js";import{n as te}from"./use-settings-DBI44RnH.js";import{n as w}from"./navigation-context-BOGzIng3.js";import{t as ne}from"./dist-hOnv1nn2.js";import{d as re,f as T,l as E,n as ie}from"./conversation-store-C6hSXHw0.js";import{t as D}from"./agent-server-conversation-service.api-Btmi4q6d.js";import{t as ae}from"./use-is-authed-BsS4XwSL.js";import{d as oe,u as se}from"./conversation-state-store-DTq4hFoP.js";var O=n(),k=ne(`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 A({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:y(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,O.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,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:y(k({orientation:e,color:t,size:n,inset:r}),i)})}var j=()=>{let e=r();return u({mutationFn:e=>D.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)=>{ie(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`]})}})},M=()=>{let{t:e}=i(`openhands`),t=r(),{conversationId:n,navigate:a}=w();return u({mutationKey:[`stop-conversation`],mutationFn:async e=>oe(e.conversationId),onMutate:async()=>{let n=l.loading(e(b.TOAST$STOPPING_CONVERSATION),h);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&l.dismiss(i.toastId),g(e(b.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(r,i,o)=>{o?.toastId&&l.dismiss(o.toastId),l.success(e(b.TOAST$CONVERSATION_STOPPED),h),se(t,i.conversationId,{execution_status:ee.PAUSED,sandbox_status:`PAUSED`}),n===i.conversationId&&a(`/conversations`)}})};function N(e){return e===`MISSING`||e===`ERROR`}var P=e(t()),F=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.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,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.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,O.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,O.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,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.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`})}),z=()=>{let{trackDownloadTrajectoryButtonClicked:e}=C(),{t}=i(`openhands`);return u({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),v(await D.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{g(t(b.CONVERSATION$DOWNLOAD_ERROR))}})},B=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.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`})}),V=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},H=()=>{let{data:e,isLoading:t}=te();return{providers:P.useMemo(()=>V(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function U(e){switch(e){case`ADDED`:case`added`:return`A`;case`DELETED`:case`deleted`:return`D`;case`UPDATED`:case`modified`:return`M`;case`MOVED`:case`renamed`:return`R`;default:return`M`}}function W(){let e=p().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 S({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 S({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 S({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=()=>p().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 D.resolveConversationWorkingDir(e);return(await new x(f({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:U(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new x(f()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},le=e=>{let{data:t}=ae(),{providers:n}=H(),r=m();return d({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&_(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function ue(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:i}=H(),{data:a}=le(t),o=a?.items,s=m(),l=t?_(t,s.backend.kind):!1,u=c({queryKey:[`repositories`,t,l,n,s.backend.id,s.orgId,...l?[o||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!o)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,o,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&o){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<o.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(i||[]).length>0&&!!t&&(!l||Array.isArray(o)&&o.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,n,r=100){return d({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await $.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,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=T()(re((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:E(()=>localStorage)}));function he({gitProvider:e,className:t}){return(0,O.jsxs)(O.Fragment,{children:[e===`github`&&(0,O.jsx)(a,{size:14,className:t}),e===`gitlab`&&(0,O.jsx)(o,{size:14,className:t}),e===`bitbucket`&&(0,O.jsx)(s,{size:14,className:t}),e===`bitbucket_data_center`&&(0,O.jsx)(s,{size:14,className:t}),e===`azure_devops`&&(0,O.jsx)(L,{className:y(t,`w-[14px] h-[14px]`)})]})}export{j as _,ue as a,H 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,A as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./home-sN90Xcxp.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{F as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{w as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as s}from"./use-is-creating-conversation-CIAcnd8M.js";import{n as c,nt as l,rt as u}from"./active-backend-context-BlZPzZNU.js";import{t as d,z as f}from"./utils-qjs_KuS4.js";import{t as p}from"./chevron-down-CV1zZP_K.js";import{t as m}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js";import{a as h,c as g,d as _,f as v,i as y,l as b,n as x,o as S,p as C,r as w,s as T,t as E,u as D}from"./onboarding-BegDrOKn.js";import{t as O}from"./search-sKuYKllf.js";import{t as k}from"./x-EjvKGawc.js";import{t as A}from"./modal-backdrop-X-vKo61e.js";import{n as j,r as M,t as N}from"./modal-body-DQhiw-AR.js";import{r as P}from"./base-modal-CSHhJTSr.js";import{_ as F,i as I,m as L,s as R}from"./form-control-classes-CSPevi7c.js";import{t as z}from"./brand-button-CQO8oqVo.js";import{n as B}from"./navigation-context-BOGzIng3.js";import{t as V}from"./styled-tooltip-DsjDnR_W.js";import{i as H,n as U,o as W,u as G}from"./dropdown-classes-DQlj-MpS.js";import{c as K,l as ee,n as te}from"./git-provider-icon-BREx-yUX.js";import{t as q}from"./conversation-store-C6hSXHw0.js";import{t as J}from"./modal-close-button-turIYn0t.js";import{i as ne}from"./conversation-state-store-DTq4hFoP.js";import{n as re}from"./use-create-conversation-Dsa4nzU9.js";import{t as ie}from"./folder-C86qXV7M.js";import{r as Y}from"./typography-C6fuRTTT.js";import{i as ae,n as oe,t as se}from"./extension-module-card-classes-Bo43vY5V.js";import{n as ce}from"./circle-plus-check-toggle-E3Ecb_gg.js";import{G as le,H as ue,V as de,W as fe,a as pe,c as me,d as he,f as ge,h as _e,i as ve,j as ye,l as be,m as xe,n as Se,o as Ce,p as we,r as Te,s as Ee,t as De,u as Oe,z as ke}from"./llm-not-configured-banner-DTWzISnk.js";import{y as Ae}from"./markdown-renderer-CvOO0YIr.js";import{t as je}from"./use-plugins-marketplace-PBc_XNz_.js";var X=e(t(),1);async function Me(e){let{imagesToEmbed:t}=le(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>de(e)));Ae.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Z=n();function Ne({plugin:e,isSelected:t,isDisabled:n=!1,onToggle:r}){return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-card-${e.name}`,className:d(`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-tertiary p-4`),children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{"data-testid":`plugin-picker-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),e.description?(0,Z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-tertiary-light`,children:e.description}):null,e.repo_path||e.ref?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.repo_path?(0,Z.jsx)(`span`,{className:ae,children:e.repo_path}):null,e.ref?(0,Z.jsxs)(`span`,{className:ae,children:[`@`,e.ref]}):null]}):null]}),(0,Z.jsx)(ce,{testId:`plugin-picker-toggle-${e.name}`,isSelected:t,isDisabled:n,onToggle:r,enableLabelKey:f.BUTTON$ADD,disableLabelKey:f.COMMON$REMOVE,enableTooltipKey:f.BUTTON$ADD,disableTooltipKey:f.COMMON$REMOVE})]})}function Q(e){return[e.source,e.ref??``,e.repo_path??``].join(`\0`)}function Pe(e){return{source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}}function Fe(e,t){let n=Q(t);return e.some(e=>Q(e)===n)}function Ie(e,t){let n=Q(t);return e.some(e=>Q(e)===n)?e.filter(e=>Q(e)!==n):[...e,Pe(t)]}function Le(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description,e.source,e.repo_path,e.ref].filter(e=>typeof e==`string`&&e.length>0).some(e=>e.toLowerCase().includes(n)):!0}function Re({selected:e,onChange:t,disabled:n=!1}){let{t:r}=a(`openhands`),{data:i,isLoading:o,isError:s}=je(),[c,l]=(0,X.useState)(``),u=(i??[]).filter(e=>Le(e,c));return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker`,className:`flex w-full flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:d(`relative flex min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`),children:[(0,Z.jsx)(O,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{"data-testid":`plugin-picker-search-input`,type:`search`,value:c,onChange:e=>l(e.target.value),placeholder:r(f.PLUGINS$PICKER_SEARCH_PLACEHOLDER),"aria-label":r(f.PLUGINS$PICKER_SEARCH_PLACEHOLDER),className:d(`min-w-0 flex-1 border-0 bg-transparent outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),c?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(``),"aria-label":r(f.MCP$SEARCH_CLEAR),className:`mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white`,children:(0,Z.jsx)(k,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),o?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-loading`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_LOADING)}):s?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-error`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_ERROR)}):u.length===0?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-empty`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_EMPTY)}):(0,Z.jsx)(`div`,{className:oe,children:(0,Z.jsx)(`div`,{className:se,children:u.map(r=>(0,Z.jsx)(Ne,{plugin:r,isSelected:Fe(e,r),isDisabled:n,onToggle:()=>t(Ie(e,r))},`${r.source} ${r.ref??``} ${r.repo_path??``} ${r.name}`))})})]})}function ze({selected:e,onChange:t,onClose:n}){let{t:r}=a(`openhands`);return(0,Z.jsx)(A,{onClose:n,children:(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-modal`,className:d(`relative flex max-h-[80vh] flex-col gap-4 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,M(`lg`),N),children:[(0,Z.jsx)(J,{onClose:n,testId:`plugin-picker-close`}),(0,Z.jsxs)(`div`,{className:`pr-6`,children:[(0,Z.jsx)(Y.H2,{children:r(f.PLUGINS$PICKER_TITLE)}),(0,Z.jsx)(Y.Text,{className:`mt-1 block text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_SUBTITLE)})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:(0,Z.jsx)(Re,{selected:e,onChange:t})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t border-[var(--oh-border-subtle)] pt-4`,children:[(0,Z.jsx)(Y.Text,{className:`text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_SELECTED_COUNT,{count:e.length})}),(0,Z.jsx)(z,{testId:`plugin-picker-done`,type:`button`,variant:`primary`,onClick:n,className:`px-4`,children:r(f.PLUGINS$PICKER_DONE)})]})]})})}function Be({count:e,onClick:t,disabled:n=!1}){let{t:r}=a(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`open-plugin-picker`,onClick:t,disabled:n,className:d(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,Z.jsx)(ye,{width:16,height:16,className:`shrink-0`,"aria-hidden":!0})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:r(f.PLUGINS$PICKER_TRIGGER)}),e>0?(0,Z.jsx)(`span`,{"data-testid":`plugin-picker-count`,className:`inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black`,children:e}):null]})}function Ve(){let{t:e}=a(`openhands`);return(0,Z.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,Z.jsx)(Y.H1,{className:`w-full text-center leading-normal`,children:e(f.HOME$LETS_START_BUILDING)})})}function He({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=a(`openhands`),o=e===`local`,s=i(o?f.HOME$OPEN_WORKSPACE:f.COMMON$OPEN_REPOSITORY),c=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":o?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:d(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(C,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Z.jsx)(ne,{width:16,height:16,className:`shrink-0`})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:s})]});return r?(0,Z.jsx)(V,{content:r,placement:`top`,children:(0,Z.jsx)(`span`,{className:`inline-flex`,children:c})}):c}var $=`__ungrouped__`;function Ue({workspaces:e,parents:t=[],value:n,placeholder:r,className:i,disabled:o=!1,disabledTooltip:s,showManage:c,onChange:l,onAddClick:u,onManageClick:p}){let{t:h}=a(`openhands`),[g,_]=(0,X.useState)(n?.name??``),v=(0,X.useRef)(null),y=(0,X.useMemo)(()=>{let t=g.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,g]),b=(0,X.useCallback)(e=>e.parentPath??$,[]),x=(0,X.useMemo)(()=>{let e=new Map;return t.forEach(t=>e.set(t.path,t.name)),e},[t]),{groupedWorkspaces:S,isGrouped:C,headerByFirstIndex:w,groupLabelByIndex:T}=(0,X.useMemo)(()=>{let e=[],t=new Map;y.forEach(n=>{let r=b(n);t.has(r)||(t.set(r,[]),e.push(r)),t.get(r)?.push(n)}),e.sort((e,t)=>e===$?1:t===$?-1:0);let n=e.length>1,r=[],i=new Map,a=new Map;return e.forEach(e=>{let o=e===$?h(f.HOME$WORKSPACE_GROUP_OTHER):x.get(e)||e.split(`/`).filter(Boolean).pop()||e;n&&i.set(r.length,o),(t.get(e)??[]).forEach(e=>{a.set(r.length,o),r.push(e)})}),{groupedWorkspaces:r,isGrouped:n,headerByFirstIndex:i,groupLabelByIndex:a}},[y,b,x,h]),E=(0,X.useCallback)(e=>{l(e),e&&_(e.name)},[l]),D=(0,X.useCallback)(()=>{E(null),_(``)},[E]),{isOpen:O,getToggleButtonProps:k,getMenuProps:A,getInputProps:j,highlightedIndex:M,getItemProps:N,selectedItem:P,closeMenu:F}=m({items:S,itemToString:e=>e?.name??``,selectedItem:n,onSelectedItemChange:({selectedItem:e})=>{E(e??null)},inputValue:g,onIsOpenChange:({isOpen:e,selectedItem:t})=>{_(e?``:t?.name??``)},stateReducer:(e,t)=>t.type===m.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),I=(e,t,n,r,i)=>(0,Z.jsx)(be,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id,ariaLabel:C?`${T.get(t)??``}, ${e.name}`.trim():void 0},e.id),L=e=>(0,Z.jsx)(me,{inputValue:e,searchMessage:h(f.HOME$NO_WORKSPACES),emptyMessage:h(f.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),z=(0,X.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),B=(0,X.useCallback)(e=>{z(e),F(),u()},[F,u,z]),W=(0,X.useCallback)(e=>{z(e),F(),u()},[F,u,z]),G=(0,X.useCallback)(e=>{z(e),F(),p()},[F,p,z]),K=(0,X.useCallback)(e=>{z(e),F(),p()},[F,p,z]),te=(0,X.useMemo)(()=>(0,Z.jsxs)(`div`,{className:H,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:d(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:W,onClick:B,children:h(f.HOME$ADD_WORKSPACES)}),(c??e.length>0)&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:d(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:K,onClick:G,children:h(f.HOME$MANAGE_WORKSPACES)})]}),[B,W,G,K,z,h,e.length,c]),q=(0,Z.jsxs)(`div`,{className:d(`relative`,i),children:[(0,Z.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Z.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Z.jsx)(ee,{width:16,height:16})}),(0,Z.jsx)(`input`,{...j({disabled:o,placeholder:O&&n?n.name:r??h(f.HOME$WORKSPACE_PLACEHOLDER),className:d(R,`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=>{_(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Z.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[n&&(0,Z.jsx)(he,{disabled:o,onClear:D}),(0,Z.jsx)(Oe,{isOpen:O,disabled:o,getToggleButtonProps:k})]})]}),(0,Z.jsx)(Ee,{isOpen:O,filteredItems:S,inputValue:g,highlightedIndex:M,selectedItem:P,getMenuProps:A,getItemProps:N,menuRef:v,renderItem:I,renderItemPrefix:C?(e,t)=>{let n=w.get(t);return n?(0,Z.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,"data-testid":`workspace-group-header`,className:`px-2 pt-2 pb-1 text-xs font-medium text-[var(--oh-muted)] select-none`,children:n}):null}:void 0,renderEmptyState:L,stickyFooterItem:te,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return s?(0,Z.jsx)(V,{content:s,placement:`top`,children:(0,Z.jsx)(`span`,{className:`block`,children:q})}):q}var We=`oh:home-selected-workspace-path`;function Ge(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(We);return e&&e.length>0?e:null}catch{return null}}function Ke(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(We,e):window.sessionStorage.removeItem(We)}catch{}}function qe({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=a(`openhands`),{navigate:r}=B(),{data:i,error:o}=T(),c=i?.workspaceParents??[],{mutate:l}=b(),{mutate:u}=D(),{mutate:d}=g(),{mutate:p}=_(),{workspaces:m,parents:v,isLoading:x,isError:C,error:E}=S(),O=h(o??E,n),[k,A]=X.useState(null),[j,M]=X.useState(!1),[N,P]=X.useState(!1),{mutate:F,isPending:I,isSuccess:L}=re(),R=s(),V=I||L||R,H=X.useCallback(e=>{A(e),Ke(e?.path??null)},[]);X.useEffect(()=>{let e=Ge();if(!e)return;let t=m.find(t=>t.path===e);if(t){A(e=>e?.path===t.path?e:t);return}!x&&!C&&!O&&(Ke(null),A(t=>t?.path===e?null:t))},[C,x,m,O]);let U=c.length>0||!!O,W=null;O?W=O:x?W=n(f.HOME$LOADING):C&&(W=n(f.HOME$WORKSPACE_SCAN_ERROR));let G=!!O||e||x&&m.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(ie,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(f.HOME$WORKSPACES_TAB)})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsx)(Ue,{workspaces:m,parents:v,value:k,placeholder:O?n(f.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):G?n(f.HOME$LOADING):void 0,disabled:G,disabledTooltip:O,showManage:m.length>0||c.length>0,onChange:H,onAddClick:()=>M(!0),onManageClick:()=>P(!0),className:`max-w-auto`},k?.path??`empty-workspace-selection`),U&&W&&(0,Z.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:W})]}),(0,Z.jsx)(z,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!k||!t&&V||e,onClick:()=>{if(k){if(t){t(k);return}F({workingDir:k.path,entryPoint:`home_workspace_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:n(t?f.BUTTON$CONFIRM:V?f.HOME$LOADING:f.BUTTON$LAUNCH)}),(0,Z.jsx)(y,{isOpen:j,onClose:()=>M(!1),onAdd:e=>{let t=e[e.length-1];l(e,{onSuccess:()=>{t&&H(t)}})},onAddParent:e=>d(e)}),(0,Z.jsx)(w,{isOpen:N,workspaces:m,workspaceParents:c,onClose:()=>P(!1),onRemove:e=>{k?.path===e&&H(null),u(e)},onRemoveParent:e=>{k?.parentPath===e&&H(null),p(e)}})]})}function Je({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=a(`openhands`),{isLoadingSettings:i}=K();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(J,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(f.HOME$OPEN_WORKSPACE)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Z.jsx)(qe,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ye({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=B(),[i,o]=X.useState(null),[c,l]=X.useState(null),[u,d]=X.useState(null),{providers:p}=K(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=te(),{mutate:_,isPending:v,isSuccess:y}=re(),b=s(),{t:x}=a(`openhands`);X.useEffect(()=>{if(p.length!==0){if(p.length===1&&!u){d(p[0]);return}if(p.length>1&&!u){let e=g();e&&p.includes(e)&&d(e)}}},[p,u,g]);let S=v||y||b,C=t=>{t!==u&&(d(t),h(t),o(null),l(null),e?.(null))},w=X.useCallback(e=>{l(e)},[]);return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Z.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(ne,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(f.COMMON$OPEN_REPOSITORY)})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(f.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,Z.jsx)(Ce,{providers:p,value:u,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Z.jsx)(ve,{provider:u||p[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!u||t,onChange:t=>{t?(e?.(t),o(t)):(e?.(null),o(null),l(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Z.jsx)(pe,{repository:i?.full_name||null,provider:u||p[0],selectedBranch:c,onBranchSelect:w,defaultBranch:e,className:`max-w-full`,disabled:!i||t})})()]}),(0,Z.jsx)(z,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!i||!c||!n&&S||p.length>1&&!u||t,onClick:()=>{if(!(!i||!c)){if(m(i),n){n({repository:i,branch:c,provider:u});return}_({repository:{name:i.full_name||``,gitProvider:i.git_provider||`github`,branch:c.name||`main`},entryPoint:`home_repo_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:x(n?f.BUTTON$CONFIRM:S?f.HOME$LOADING:f.BUTTON$LAUNCH)})]})}function Xe({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=a(`openhands`),{isLoadingSettings:i}=K();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(J,{onClose:t,testId:`close-open-repository-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(f.COMMON$OPEN_REPOSITORY)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Z.jsx)(Ye,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ze(e,t){return e===`new_worktree`?f.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?f.COMMON$WORKSPACE_MODE_CLOUD_REPO:f.COMMON$WORKSPACE_MODE_LOCAL_REPO}function Qe({mode:e}){return e===`new_worktree`?(0,Z.jsx)(v,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Z.jsx)(ne,{width:12,height:12,color:`white`,"aria-hidden":!0})}var $e=[`local_repo`,`new_worktree`];function et({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:o}=a(`openhands`),[s,c]=(0,X.useState)(!1),l=(0,X.useRef)(null),u=o(Ze(e,t));return(0,X.useEffect)(()=>{if(!s)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]),(0,X.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]),(0,Z.jsxs)(`div`,{ref:l,className:`relative inline-flex`,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":s,"aria-label":u,disabled:r,onClick:()=>c(e=>!e),className:d(`group flex flex-row items-center justify-between gap-2 pl-2.5 pr-2 py-1 rounded-[100px] truncate relative`,`border border-[rgba(71,74,84,0.50)] bg-transparent text-white`,r?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-[var(--oh-border-subtle)]`),children:[(0,Z.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Z.jsx)(Qe,{mode:e})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:u}),(0,Z.jsx)(p,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),s?(0,Z.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:d(`absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-1 shadow-lg`,H),children:$e.map(r=>{let a=o(Ze(r,t));return(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),c(!1)},className:W,children:[(0,Z.jsx)(`span`,{className:G,children:(0,Z.jsx)(Qe,{mode:r})}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]},r)})}):null]})}function tt({workspace:e,repository:t,branch:n,provider:r,workspaceMode:i,backendKind:a,onRepoClick:o,onWorkspaceModeChange:s}){let c=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Z.jsx)(Te,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Z.jsx)(et,{value:i,backendKind:a,onChange:s}):null,n?(0,Z.jsx)(Se,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function nt(){let{t:e}=a(`openhands`),{backend:t}=c(),{navigate:n}=B(),r=t.kind===`local`,[i,d]=(0,X.useState)(!1),[p,m]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(`local_repo`),[w,E]=(0,X.useState)([]),[D,O]=(0,X.useState)(!1),{mutateAsync:k,isPending:A}=re(),j=s(),M=A||j,{isConfigured:N,isLoading:P}=we(),F=!P&&!N,{images:I,files:L,imagesMarkedUploadAsFile:R,clearAllFiles:z}=q(),{handleUpload:V}=ge(),{error:H}=T({enabled:r}),U=r?h(H,e):null,W=r?!!p:!!g&&!!v,G=xe(null,t=>{let i=t.trim(),a=I.length>0||L.length>0;if(!i&&!a||M||F)return;let s={images:[...I],files:[...L]},c={query:a?void 0:i||void 0,entryPoint:`home_chat_launcher`};r&&p?c={...c,workingDir:p.path,workspaceMode:S}:!r&&g&&v&&(c={...c,repository:{name:g.full_name,gitProvider:g.git_provider,branch:v.name}}),w.length>0&&(c={...c,plugins:w});let d=o.loading(e(f.HOME$CREATING_CONVERSATION),l);(async()=>{try{let t=await k(c);o.dismiss(d);try{sessionStorage.removeItem(fe)}catch{}let l=t.conversation_id,f=l.startsWith(`task-`);if(a)if(!r||f){let e=t.task_id??(f?l.slice(5):null);if(!e){u(null);return}ue(e,{content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...R]}),z(),await Me({conversationId:l,text:i,images:s.images,imagesMarkedUploadAsFile:R}),n(`/conversations/${l}`);return}else try{await ke({conversationId:l,content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:R,t:e}),z()}catch(e){u(e instanceof Error?e.message:null);return}f&&i&&await Me({conversationId:l,text:i,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${l}`)}catch(e){o.dismiss(d),u(e instanceof Error?e.message:null)}})()});return(0,Z.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Z.jsx)(Ve,{})}),(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(_e,{onSubmit:G,onFilesPaste:V,disabled:M||F})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[W?(0,Z.jsx)(tt,{workspace:p,repository:g,branch:v,provider:b,workspaceMode:S,backendKind:t.kind,onRepoClick:()=>d(!0),onWorkspaceModeChange:C}):(0,Z.jsx)(He,{kind:r?`local`:`cloud`,onClick:()=>d(!0),disabled:M||!!U,disabledTooltip:U}),(0,Z.jsx)(Be,{count:w.length,onClick:()=>O(!0),disabled:M})]}),r?(0,Z.jsx)(Je,{isOpen:i,onClose:()=>d(!1),onConfirm:e=>{m(e),_(null),y(null),x(null),C(`local_repo`)}}):(0,Z.jsx)(Xe,{isOpen:i,onClose:()=>d(!1),onConfirm:({repository:e,branch:t,provider:n})=>{_(e),y(t),x(n??e.git_provider),m(null),C(`local_repo`)}}),D&&(0,Z.jsx)(ze,{selected:w,onChange:E,onClose:()=>O(!1)})]})}function rt(){let e=x(r().search);return(0,Z.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,Z.jsx)(`div`,{className:`md:px-4 lg:px-0`,children:(0,Z.jsx)(De,{})}),(0,Z.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,Z.jsx)(nt,{})}),e?null:(0,Z.jsx)(E,{})]})}var it=i(rt);export{it as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./home-sN90Xcxp.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{p as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as o}from"./useMutation-DyQXZFEF.js";import{D as s,I as c,R as l,it as u,n as d,p as f,rt as ee,st as p}from"./active-backend-context-BlZPzZNU.js";import{t as m,z as h}from"./utils-qjs_KuS4.js";import{n as g,t as _}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{a as v,c as y,d as te,i as b,n as x,o as S,r as C,s as w,t as T}from"./settings-service.api-DryhKdSr.js";import{n as E}from"./use-settings-DBI44RnH.js";import{t as ne}from"./modal-backdrop-X-vKo61e.js";import{n as re}from"./modal-classes-YaEEa5eZ.js";import{t as ie}from"./brand-button-CQO8oqVo.js";import{t as D}from"./styled-tooltip-DsjDnR_W.js";import{t as ae}from"./modal-close-button-turIYn0t.js";import{t as O}from"./settings-input-BjW_zyTN.js";import{t as oe}from"./v4-DDdyfk2q.js";import{t as k}from"./secrets-service-BjK-bPN2.js";function A(e){return[...e.sse_servers.map((e,t)=>({id:`sse-${t}`,type:`sse`,name:typeof e==`object`?e.name:void 0,url:typeof e==`string`?e:e.url,headers:typeof e==`object`?e.headers:void 0,auth:typeof e==`object`?e.auth: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`,name:typeof e==`object`?e.name:void 0,url:typeof e==`string`?e:e.url,headers:typeof e==`object`?e.headers:void 0,timeout:typeof e==`object`?e.timeout:void 0,auth:typeof e==`object`?e.auth:void 0}))]}var j=e(t()),M=n();function N(e){return e.connectionOptions.filter(e=>e.provider===`mcp`&&!!e.transport)}function P(e){return N(e)[0]}function F(e){if(e.auth.strategy!==`oauth2`)return!0;let t=e.auth.oauth;return t?!t.authorizationUrl&&!t.tokenUrl&&!t.registrationUrl&&!t.additionalAuthorizationParams&&!t.additionalTokenParams:!1}function se(e){return N(e).find(F)}function ce(e){return P(e)?.transport}function le(e){switch(e){case`none`:return`none`;case`body`:return`client_secret_post`;case`basic`:return`client_secret_basic`;default:return}}function ue(e){if(e.auth.strategy!==`oauth2`)return;let t={type:`oauth`},n=le(e.auth.oauth?.clientAuthentication);return n&&(t.client_auth_method=n),e.auth.oauth?.scopes?.length&&(t.scopes=e.auth.oauth.scopes),Object.keys(t).length>1?t:void 0}function de(e){return e.filter(e=>!!P(e))}var fe=e=>{try{return new URL(e)}catch{return null}};function pe(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;if(!n||!r)return!1;let i=fe(n),a=fe(r);return!i||!a?n.replace(/\/+$/,``)===r.replace(/\/+$/,``):i.protocol===a.protocol&&i.host===a.host&&i.pathname.replace(/\/+$/,``)===a.pathname.replace(/\/+$/,``)}function me(e,t){return t.find(t=>ge(e,t))??null}function he(e,t){for(let n of N(e)){let e=me(n.transport,t);if(e)return e}return null}function ge(e,t){if(e.kind===`shttp`){let n=e.url;return t.type===`shttp`&&!!t.url&&pe(t.url,n)}if(e.kind===`sse`){let n=e.url;return t.type===`sse`&&!!t.url&&pe(t.url,n)}return t.type===`stdio`&&t.name===e.serverName}function _e(e){return e.trim().toLowerCase()}function ve(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 ye(e,t){return t.find(t=>t.id===e)}function be(e,t){let n=_e(t);return n?[e.name,e.description,e.id,...e.keywords??[]].join(` `).toLowerCase().includes(n):!0}function xe(e,t,n){let r=_e(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 Se(e,t){return t.find(t=>N(t).some(t=>ge(t.transport,e)))}function I({fieldKey:e,checked:t,onToggle:n}){let{t:r}=i(`openhands`);return(0,M.jsxs)(`label`,{"data-testid":`mcp-install-save-secret-${e}`,className:m(`flex items-center gap-2 px-3 py-2 mt-0.5 rounded-lg border cursor-pointer transition-colors`,t?`border-green-500/35 bg-green-500/10`:`border-[var(--oh-border)] bg-transparent hover:bg-white/[0.03]`),children:[(0,M.jsx)(`input`,{className:`sr-only`,id:`mcp-save-secret-checkbox-${e}`,type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),(0,M.jsx)(`span`,{"aria-hidden":`true`,className:m(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border transition-colors duration-200`,t?`border-green-500 bg-green-500`:`border-[var(--oh-border)] bg-surface-raised`),children:(0,M.jsx)(`span`,{className:m(`inline-block size-4 rounded-full transition-transform duration-200`,t?`translate-x-[21px] bg-white`:`translate-x-[2px] bg-[var(--oh-muted)]`)})}),(0,M.jsx)(`span`,{className:`text-sm`,children:r(h.MCP$ALSO_SAVE_AS_SECRET)}),(0,M.jsx)(`code`,{className:m(`ml-auto text-[11px] font-mono tracking-tight border rounded px-1.5 py-0.5`,t?`text-green-500 border-green-500/35 bg-white/[0.04]`:`text-tertiary-alt border-[var(--oh-border)]`),children:e}),(0,M.jsx)(D,{content:r(h.MCP$SAVE_AS_SECRET_TOOLTIP),placement:`top`,children:(0,M.jsx)(`button`,{type:`button`,"aria-label":r(h.MCP$SAVE_AS_SECRET_TOOLTIP),className:`flex items-center justify-center size-[15px] shrink-0 rounded-full border border-[var(--oh-muted)] text-tertiary-alt text-[9px] font-bold cursor-help`,onClick:e=>e.preventDefault(),children:`?`})})]})}var Ce=e=>(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,M.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,fill:`currentColor`})}),we={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`},Te={slack:Ce};function Ee({entry:e,size:t=`md`,className:n,fallback:r,testId:i}){let a=e?Te[e.id]:void 0;return(0,M.jsx)(`span`,{"aria-hidden":`true`,title:e?.name,"data-testid":i,className:m(`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)]`,we[t],n),style:{backgroundColor:e?.iconBg??`var(--oh-color-tertiary)`,color:e?.iconColor??`#FFFFFF`},children:a?(0,M.jsx)(a,{}):e?.logoUrl?(0,M.jsx)(`img`,{src:e.logoUrl,alt:`${e.name} logo`,className:`h-full w-full object-contain p-[22%]`,onError:e=>{let t=e.currentTarget;t.style.display=`none`}}):r??(0,M.jsx)(g,{className:`h-5 w-5`,strokeWidth:2.25})})}var De=new Set([`invalid_auth`,`not_authed`,`account_inactive`,`token_revoked`,`token_expired`]),Oe=e=>e.is_error?e.text||`tool call failed`:null,ke={github:{toolCall:{name:`get_me`,arguments:{}},interpret:Oe},linear:{toolCall:{name:`list_teams`,arguments:{}},interpret:Oe},slack:{toolCall:{name:`slack_list_channels`,arguments:{limit:1}},interpret:e=>{if(e.is_error)return e.text||`tool call failed`;try{let t=JSON.parse(e.text);if(t?.ok===!1&&De.has(t.error))return String(t.error)}catch{}return null}}};function L(e){let t=Se(e,de(_));return t?ke[t.id]:void 0}var Ae=4,je=/token|key|secret|auth/i,Me=[/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,/\bxox[a-z](?:-[A-Za-z0-9]+)+/g,/\blin_api_[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g],Ne=/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi;function R(e,t){typeof t==`string`&&(t.length<Ae||t!==`**********`&&e.add(t))}function z(e,t){for(let n of Object.values(t??{}))R(e,n)}function Pe(e,t){if(t)try{let n=new URL(t);R(e,n.username),R(e,n.password),R(e,decodeURIComponent(n.username)),R(e,decodeURIComponent(n.password)),n.searchParams.forEach((t,n)=>{je.test(n)&&R(e,t)})}catch{}}function Fe(e,t){if(t)switch(t.strategy){case`api_key`:case`bearer`:R(e,t.value);break;case`basic`:R(e,t.username),R(e,t.password);break;case`header`:z(e,t.headers);break;case`oauth2`:R(e,t.authentication?.client_secret),z(e,t.state?.tokens);break;default:break}}function Ie(e){let t=new Set;return z(t,e.env),z(t,e.headers),Fe(t,e.auth),Pe(t,e.url),[...t].sort((e,t)=>t.length-e.length)}function B(e,...t){if(!e)return e;let n=e;for(let e of t)if(e)for(let t of Ie(e))n=n.split(t).join(x);n=n.replace(Ne,`Bearer ${x}`);for(let e of Me)n=n.replace(e,x);return n}var Le=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],Re=e=>!!e&&typeof e==`object`&&!Array.isArray(e),ze=e=>Re(e)&&typeof e.strategy==`string`&&Le.includes(e.strategy),Be=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Ve=e=>{if(!Be(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0},He=e=>!!e&&Object.values(e).some(e=>e===`**********`),Ue=(e,t)=>e===`sse`?t===`sse`:e===`shttp`?t===void 0||t===`http`||t===`shttp`||t===`streamable-http`:!1,We=e=>{if(!e)return;let t=/^stdio-(\d+)$/.exec(e);return t?Number.parseInt(t[1],10):void 0},Ge=(e,t)=>{let n=We(e);if(n!==void 0)return Object.entries(t).filter(([,e])=>!e.url)[n]?.[1]},Ke=(e,t)=>e.type===`stdio`?Ge(e.id,t)??(e.name?t[e.name]:void 0):e.name&&t[e.name]?t[e.name]:Object.values(t).find(t=>t.url===e.url&&Ue(e.type,t.transport));async function qe(e){let t=(await T.fetchSettingsFromApi(`encrypted`)).agent_settings?.mcp_config;if(Be(t))return Ke(e,t)}async function Je(e){let t=e.type===`stdio`&&He(e.env),n=(e.type===`sse`||e.type===`shttp`)&&C(e.auth);if(!t&&!n)return e;try{let r=await qe(e);if(!r)return e;if(t){let t=Ve(r.env)??{},n=Object.fromEntries(Object.entries(e.env??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]));return{...e,env:n}}return n&&ze(r.auth)?{...e,auth:r.auth}:e}catch{return e}}var Ye=120;function Xe(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0&&{headers:e.headers},...e.auth?{auth:e.auth}:{}}}function Ze(e){return e.auth?.strategy===`oauth2`?Ye:e.timeout}async function Qe(e){let t=L(e),n=await Je(e),r=Xe(n),i=Ze(e);return{request:{server:r,...e.name?{name:e.name}:{},...i===void 0?{}:{timeout:i},...t?{tool_call:t.toolCall}:{}},substituted:n}}function $e(e,t){return e.ok?e.tool_result?{...e,tool_result:{...e.tool_result,text:B(e.tool_result.text,...t)}}:e:{...e,error:B(e.error,...t)}}function et(e,t,n){let r=$e(e,n);if(r.ok&&t&&r.tool_result&&r.tools.includes(t.toolCall.name)){let e=t.interpret(r.tool_result);if(e)return{ok:!1,error:e,error_kind:`credentials`}}return r}function tt(){if(c().backend.kind===`local`){let{host:e,apiKey:t}=s();return{host:e,...t?{apiKey:t}:{}}}let e=l().find(e=>e.kind===`local`&&e.host);if(e)return{host:e.host.replace(/\/+$/,``),...e.apiKey?{apiKey:e.apiKey}:{}};throw Error(`OAuth authorization requires a reachable local backend.`)}function V(){let{host:e,apiKey:t}=tt();return new a({host:e,...t?{apiKey:t}:{},timeout:125e3})}function nt(e){return e.status===`succeeded`?{ok:!0,tools:e.tools??[],...e.tool_result!==void 0&&{tool_result:e.tool_result},...e.oauth_state!==void 0&&{oauth_state:e.oauth_state}}:{ok:!1,error:e.error||`OAuth authorization did not complete`,error_kind:e.error_kind||`unknown`}}var rt=e=>new Promise(t=>{window.setTimeout(t,e)}),H=class e{static async testServer(e){if(c().backend.kind===`cloud`)return{ok:!0,tools:[]};let t=L(e),{host:n,apiKey:r}=s(),i=new a({host:n,...r?{apiKey:r}:{}});try{let{request:n,substituted:r}=await Qe(e);return et(await i.testServer(n),t,[r,e])}finally{i.close()}}static async startOAuth(t){let n=V();try{return await e.startOAuthWithClient(n,t)}finally{n.close()}}static async getOAuthStatus(t){let n=V();try{return await e.getOAuthStatusWithClient(n,t)}finally{n.close()}}static async submitOAuthCallback(t,n){let r=V();try{return await e.submitOAuthCallbackWithClient(r,t,n)}finally{r.close()}}static async authorizeOAuth(t){let n=L(t),r=e=>et(e,n,[t]),i=window.open(`about:blank`,`_blank`),a=V();try{let n=await e.startOAuthWithClient(a,t);if(!n.ok||!n.job_id||!n.authorization_url)return i?.close(),r({ok:!1,error:n.error||`Could not start OAuth authorization`,error_kind:n.error_kind||`unknown`});let o=await e.getOAuthStatusWithClient(a,n.job_id);for(let t=0;t<20;t+=1){if(o.status===`succeeded`||o.status===`failed`)return i?.close(),r(nt(o));if(o.callback_ready)break;await rt(250),o=await e.getOAuthStatusWithClient(a,n.job_id)}i&&(i.location.href=n.authorization_url);for(let t=0;t<Ye;t+=1)if(await rt(1e3),o=await e.getOAuthStatusWithClient(a,n.job_id),o.status===`succeeded`||o.status===`failed`)return i?.close(),r(nt(o));return{ok:!1,error:`OAuth authorization timed out`,error_kind:`timeout`}}finally{a.close()}}static async startOAuthWithClient(e,t){let{request:n}=await Qe(t);return e.startOAuth(n)}static async getOAuthStatusWithClient(e,t){return e.getOAuthStatus(t)}static async submitOAuthCallbackWithClient(e,t,n){return e.submitOAuthCallback(t,{callback_url:n})}},U=e=>Object.keys(e??{}).sort();function W(e){return e.type===`stdio`?JSON.stringify({type:e.type,name:e.name??``,command:e.command??``,args:e.args??[],envKeys:U(e.env)}):JSON.stringify({type:e.type,name:e.name??``,url:e.url??``,headerKeys:U(e.headers),authStrategy:e.auth?.strategy??``,authHeaderName:e.auth?.strategy===`api_key`?e.auth.header_name??``:``,authHeaderKeys:e.auth?.strategy===`header`?U(e.auth.headers):[]})}var G={},K=new Set,it=1;function q(e){G=e,K.forEach(e=>e())}function at(){return G}function ot(e){return K.add(e),()=>{K.delete(e)}}function st(e){let t=it;return it+=1,q({...G,[e]:{status:`checking`,checkId:t}}),t}function J(e,t,n){let r=G[e];r?.status!==`checking`||r.checkId!==t||q({...G,[e]:n})}function ct(e,t){q({...G,[e]:t})}function lt(e){if(!(e in G))return;let{[e]:t,...n}=G;q(n)}var ut=/\b(401|403)\b|unauthorized|forbidden|invalid[ _-]?(token|credentials?|api[ _-]?key)/i;function dt(e,t){return{status:`failed`,kind:`unknown`,error:B(t instanceof Error?t.message:String(t),e),checkedAt:Date.now()}}function Y(e,t){let n=Date.now();if(!t.ok)return{status:`failed`,kind:(t.error_kind===`connection`||t.error_kind===`unknown`)&&ut.test(t.error)?`credentials`:t.error_kind,error:t.error,checkedAt:n};let r=L(e);return{status:`healthy`,verification:r&&t.tools.includes(r.toolCall.name)&&t.tool_result&&!t.tool_result.is_error?`verified`:`connectivity-only`,toolCount:t.tools.length,checkedAt:n}}async function ft(e){let t=W(e),n=st(t),r;try{r=Y(e,await H.testServer(e))}catch(t){r=dt(e,t)}J(t,n,r)}async function pt(e){let t=W(e),n=st(t);try{let r=await H.authorizeOAuth(e);return J(t,n,Y(e,r)),r}catch(r){return J(t,n,dt(e,r)),null}}function X(e,t,n){let r=W(e);n.some(e=>W(e)===r)||ct(r,Y(e,t))}function mt(){let e=r(),{data:t}=E();return o({mutationFn:async e=>{if(!t)return;let n=b(t.agent_settings?.mcp_config),r={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]};e.type===`sse`?r.sse_servers.push(S(e)):e.type===`stdio`?r.stdio_servers.push(w(e)):e.type===`shttp`&&r.shttp_servers.push(v(e)),await T.saveSettings({agent_settings_diff:{mcp_config:y(r)}})},onSuccess:()=>{e.invalidateQueries({queryKey:f.personal()})}})}function ht(){return o({mutationFn:e=>H.testServer(e)})}function gt(e){return e.length<=3?e.join(`, `):`${e.slice(0,3).join(`, `)} … (+${e.length-3})`}function _t(){let{t:e}=i(`openhands`),t=r();return(0,j.useCallback)((n,r,i)=>{let a=n.filter(e=>i[e.key]&&(r[e.key]??``).trim());return a.length===0?Promise.resolve():Promise.allSettled(a.map(e=>k.createSecret(e.key,r[e.key].trim(),e.label))).then(n=>{let r=a.filter((e,t)=>n[t].status===`fulfilled`).map(e=>e.key),i=a.filter((e,t)=>n[t].status===`rejected`).map(e=>e.key);r.length>0&&(t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]}),u(e(h.MCP$SECRETS_SAVED,{keys:gt(r)}))),i.length>0&&ee(e(h.MCP$SECRETS_SAVE_FAILED,{keys:gt(i)}))})},[e,t])}function Z(e,t,n){switch(t){case`timeout`:return e(h.MCP$TEST_ERROR_TIMEOUT);case`connection`:return e(h.MCP$TEST_ERROR_CONNECTION);case`credentials`:return e(h.MCP$TEST_ERROR_CREDENTIALS,{error:n});default:return e(h.MCP$TEST_ERROR_UNKNOWN,{error:n})}}function Q(e){let t=/\[([^\]]+)\]\(([^)]+)\)/g,n=[],r=0;for(let i of e.matchAll(t))i.index>r&&n.push(e.slice(r,i.index)),n.push((0,M.jsx)(`a`,{href:/^https?:\/\//i.test(i[2])?i[2]:`#`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-white transition-colors`,children:i[1]},i.index)),r=i.index+i[0].length;return r<e.length&&n.push(e.slice(r)),n}function vt(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?!1:[`api_key`,`bearer`].includes(e.auth.strategy)}function yt(e){return!!e&&e.auth.strategy===`oauth2`}function bt(e){return e.transport.kind===`stdio`?e.auth.apiKeyOptional??!1:e.auth.apiKeyOptional??e.transport.apiKeyOptional??!1}function $(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?[]:e.transport.headerFields??[]}function xt(e){let t={},n={},r=se(e),i=r?.transport;if(i?.kind===`stdio`){for(let e of i.envFields??[])t[e.key]=``,n[e.key]=e.type===`password`;for(let e of i.argFields??[])t[e.key]=``}else if(i?.kind===`shttp`||i?.kind===`sse`){t.url=i.url;for(let e of $(r))t[e.key]=``,n[e.key]=e.type===`password`;vt(r)&&(t.api_key=``,r?.auth.credentialSecretName&&(n.api_key=r.auth.saveCredentialAsSecretByDefault??!1))}return{values:t,errors:{},savedAsSecret:n}}function St({entry:e,existingServers:t,onClose:n,onSuccess:r}){let{t:a}=i(`openhands`),{mutate:o,isPending:s}=mt(),{mutate:c,isPending:l}=ht(),f=_t(),{backend:ee}=d(),m=ee.kind===`cloud`,[g,_]=j.useState(()=>xt(e)),v=j.useRef(g);v.current=g;let[y,b]=j.useState(null),[x,S]=j.useState(!1),[C,w]=j.useState(!1),T=se(e),E=T?.transport,D=l||C||s||x,k=(e,t)=>{_(n=>({...n,values:{...n.values,[e]:t},errors:{...n.errors,[e]:null}})),b(null)},A=(e,t)=>{_(n=>({...n,savedAsSecret:{...n.savedAsSecret,[e]:t}}))},N=()=>{let e=T?.auth.credentialSecretName,t=v.current.values.api_key?.trim();return!e||!t||!v.current.savedAsSecret.api_key?Promise.resolve():f([{key:e,label:T.auth.credentialLabel??e,type:`password`,required:!0}],{[e]:t},{[e]:!0})},P=()=>E?.kind===`stdio`?f(E.envFields??[],v.current.values,v.current.savedAsSecret):E?.kind===`shttp`||E?.kind===`sse`?Promise.all([N(),f($(T),v.current.values,v.current.savedAsSecret)]).then(()=>void 0):Promise.resolve(),F=i=>{if(i.auth?.strategy===`oauth2`){w(!0),H.authorizeOAuth(i).then(s=>{if(!s.ok){b(Z(a,s.error_kind,s.error));return}let c=s.oauth_state?{...i,auth:{...i.auth,state:s.oauth_state}}:i;o(c,{onSuccess:()=>{m||X(c,s,t),u(a(h.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await P()}finally{r?.(e),n()}})()},onError:e=>{b(p(e)||a(h.ERROR$GENERIC))}})}).catch(e=>{b(p(e)||a(h.ERROR$GENERIC))}).finally(()=>w(!1));return}c(i,{onSuccess:s=>{if(!s.ok){b(Z(a,s.error_kind,s.error));return}let c=s.oauth_state&&i.auth?.strategy===`oauth2`?{...i,auth:{...i.auth,state:s.oauth_state}}:i;o(c,{onSuccess:()=>{m||X(c,s,t),u(a(h.MCP$INSTALL_SUCCESS)),S(!0),(async()=>{try{await P()}finally{r?.(e),n()}})()},onError:e=>{b(p(e)||a(h.ERROR$GENERIC))}})},onError:e=>{b(p(e)||a(h.ERROR$GENERIC))}})},ce=()=>{if(E?.kind!==`shttp`&&E?.kind!==`sse`||!T)return;let t=g.values.api_key?.trim()??``,n=E.urlEditable?g.values.url?.trim()??``:E.url,r=yt(T),i=vt(T),o=$(T),s={};if(!n)s.url=a(h.SETTINGS$MCP_ERROR_URL_REQUIRED);else try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s.url=a(h.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL))}catch{s.url=a(h.SETTINGS$MCP_ERROR_URL_INVALID)}for(let e of o)e.required&&!(g.values[e.key]??``).trim()&&(s[e.key]=a(h.MCP$ERROR_FIELD_REQUIRED));if(!r&&i&&!bt(T)&&!t&&(s.api_key=a(h.MCP$ERROR_FIELD_REQUIRED)),Object.values(s).some(Boolean)){_(e=>({...e,errors:s}));return}let c=r?ue(T):void 0,l=Object.fromEntries(o.map(e=>[e.key,g.values[e.key]?.trim()??``]).filter(([,e])=>e)),u=Object.keys(l).length>0,d;r?d={strategy:`oauth2`,...c&&{authentication:c}}:i&&t?d=T.auth.strategy===`api_key`?{strategy:`api_key`,value:t,...T.auth.apiKeyHeaderName&&{header_name:T.auth.apiKeyHeaderName}}:{strategy:`bearer`,value:t}:u&&(d={strategy:`header`,headers:l}),F({id:`${E.kind}-${oe()}`,type:E.kind,name:te(e.id),url:n,...d&&{auth:d},...u&&d?.strategy!==`header`&&{headers:l}})},le=()=>{if(E?.kind!==`stdio`)return;let e=E,t={};for(let n of e.envFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=a(h.MCP$ERROR_FIELD_REQUIRED));for(let n of e.argFields??[])n.required&&!(g.values[n.key]??``).trim()&&(t[n.key]=a(h.MCP$ERROR_FIELD_REQUIRED));if(Object.values(t).some(Boolean)){_(e=>({...e,errors:t}));return}let n={};for(let t of e.envFields??[]){let e=g.values[t.key]?.trim();e&&(n[t.key]=e)}let r=[];for(let t of e.argFields??[]){let e=g.values[t.key]?.trim();if(e)for(let t of e.split(/\s+/))t&&r.push(t)}F({id:`stdio-${oe()}`,type:`stdio`,name:e.serverName,command:e.command,args:[...e.args,...r],...Object.keys(n).length>0&&{env:n}})};return(0,M.jsx)(ne,{onClose:n,"aria-label":e.name,children:(0,M.jsxs)(`form`,{"data-testid":`mcp-install-modal`,"data-marketplace-id":e.id,onSubmit:e=>(e.preventDefault(),b(null),E?.kind===`shttp`||E?.kind===`sse`?ce():le()),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,M.jsx)(ae,{onClose:n,testId:`mcp-install-modal-close`,disabled:D}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,M.jsx)(Ee,{entry:e}),(0,M.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,M.jsx)(`h2`,{className:re,children:e.name}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.description})]})]}),e.installHint&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.installHint}),e.docsUrl&&(0,M.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:a(h.MCP$VIEW_DOCS)}),(0,M.jsx)(`div`,{className:`flex flex-col gap-3`,children:(()=>{if(E?.kind===`shttp`||E?.kind===`sse`){let e=yt(T),t=vt(T),n=T?bt(T):!1,r=T?.auth.credentialSecretName,i=$(T);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(O,{testId:`mcp-install-field-url`,name:`url`,type:`url`,label:a(h.SETTINGS$MCP_URL),value:g.values.url??E.url,onChange:e=>k(`url`,e),isDisabled:!E.urlEditable,className:`w-full`}),g.errors.url&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.url}),i.map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(O,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(I,{fieldKey:e.key,checked:g.savedAsSecret[e.key]??!1,onToggle:t=>A(e.key,t)})]},e.key)),e?(0,M.jsxs)(`div`,{"data-testid":`mcp-install-oauth-info`,className:`flex flex-col gap-2 p-3 rounded-lg border border-[var(--oh-border)] bg-base-tertiary`,children:[(0,M.jsx)(`p`,{className:`text-sm text-secondary-light`,children:a(h.MCP$OAUTH_CONNECT_INFO)}),(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:a(h.MCP$OAUTH_CONNECT_HINT)})]}):t?(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(O,{testId:`mcp-install-field-api_key`,name:`api_key`,type:`password`,label:T?.auth.credentialLabel??a(h.SETTINGS$MCP_API_KEY),value:g.values.api_key??``,onChange:e=>k(`api_key`,e),placeholder:T?.auth.credentialPlaceholder??a(h.SETTINGS$MCP_API_KEY_PLACEHOLDER),showOptionalTag:n,required:!n,className:`w-full`}),T?.auth.credentialHelp&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(T.auth.credentialHelp)}),g.errors.api_key&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors.api_key}),r&&(0,M.jsx)(I,{fieldKey:r,checked:g.savedAsSecret.api_key??!1,onToggle:e=>A(`api_key`,e)})]}):null]})}if(E?.kind!==`stdio`)return null;let e=E;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(O,{testId:`mcp-install-field-command-readonly`,name:`command-readonly`,type:`text`,label:a(h.MCP$COMMAND_LABEL),value:`${e.command} ${e.args.join(` `)}`.trim(),onChange:()=>{},isDisabled:!0,className:`w-full`}),(e.envFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(O,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]}),e.key in g.savedAsSecret&&(0,M.jsx)(I,{fieldKey:e.key,checked:g.savedAsSecret[e.key],onToggle:t=>A(e.key,t)})]},e.key)),(e.argFields??[]).map(e=>(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsx)(O,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:g.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,M.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Q(e.helperText)}),g.errors[e.key]&&(0,M.jsx)(`p`,{className:`text-xs text-red-500`,children:g.errors[e.key]})]},e.key))]})})()}),y&&(0,M.jsx)(`p`,{"data-testid":`mcp-install-modal-error`,className:`text-sm text-red-500 whitespace-pre-wrap`,children:y}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,M.jsx)(ie,{type:`button`,variant:`secondary`,onClick:n,testId:`mcp-install-cancel`,isDisabled:D,children:a(h.BUTTON$CANCEL)}),(0,M.jsx)(ie,{type:`submit`,variant:`primary`,isDisabled:D,testId:`mcp-install-submit`,children:a(l||C?h.MCP$VERIFYING:s||x?h.SETTINGS$SAVING:h.MCP$INSTALL_BUTTON)})]})]})})}export{A as C,be as S,ce as _,ft as a,de as b,lt as c,W as d,H as f,he as g,Se as h,mt as i,at as l,Ee as m,Z as n,pt as o,Je as p,ht as r,X as s,St as t,ot as u,ve as v,xe as x,ye as y};
|