@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
|
@@ -37,7 +37,9 @@ import sirv from "sirv";
|
|
|
37
37
|
import {
|
|
38
38
|
createProxyHandlers,
|
|
39
39
|
createRouter,
|
|
40
|
+
isServerInfoRequest,
|
|
40
41
|
matchesPathPrefix,
|
|
42
|
+
proxyServerInfoRequest,
|
|
41
43
|
} from "./proxy-utils.mjs";
|
|
42
44
|
|
|
43
45
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -558,6 +560,14 @@ export function startStaticServer(config) {
|
|
|
558
560
|
const server = createServer((req, res) => {
|
|
559
561
|
const backend = route(req.url ?? "/");
|
|
560
562
|
if (backend) {
|
|
563
|
+
if (
|
|
564
|
+
config.runtimeServicesInfo &&
|
|
565
|
+
isServerInfoRequest(req) &&
|
|
566
|
+
(req.method === "GET" || req.method === "HEAD")
|
|
567
|
+
) {
|
|
568
|
+
proxyServerInfoRequest(req, res, backend, config.runtimeServicesInfo);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
561
571
|
proxy.proxyHttp(req, res, backend);
|
|
562
572
|
return;
|
|
563
573
|
}
|
|
@@ -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{r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{D as i,F as a,I as o,M as s,O as ee,P as te,T as ne,d as re,k as ie,w as c,y as ae}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{R as oe,t as se,z as l}from"./utils-qjs_KuS4.js";var u=e(t(),1),ce=`__AGENT_CANVAS_BASE_PATH__`;function le(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function ue(){let e=le(void 0);if(e)return e;if(typeof window<`u`){let e=window[ce];if(typeof e==`string`)return le(e)}return``}function de(e){let t=ue();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var d=`openhands`,fe=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],f=new WeakMap,pe=e=>{if(!f.has(e)){let t=e.use(ee).use(i).use(r).init({fallbackLng:`en`,debug:!1,supportedLngs:fe.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[d],defaultNS:d,fallbackNS:d,backend:{loadPath:de(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});f.set(e,t)}return e},me=()=>pe(s()),he=null,p=null,m=()=>(he||=me(),he),ge=()=>p??m(),_e=e=>(p=e??m(),p),ve=async(e=m())=>(await f.get(e),e),ye=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:d,...e}:e:{ns:d},h=new Proxy({},{get:(e,t)=>{let n=ge();if(t===`t`)return(e,t)=>n.t(e,ye(t));if(t===`exists`)return(e,t)=>n.exists(e,ye(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=ge();return Reflect.set(r,t,n,r)}}),be=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,xe=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,Se=`Disconnected (check URL or network). Check that the backend URL is correct and the backend server is reachable. If the backend is on another origin, check that it allows this frontend origin.`,Ce=`Disconnected (request timed out). Check that the backend URL is correct and reachable.`,we=4;function Te(e){return typeof e==`object`&&!!e}function Ee(e){let t=[],n=new Set,r=e,i=0;for(;r!=null&&i<we&&!n.has(r);){if(n.add(r),r instanceof Error)r.message&&t.push(r.message),r=r.cause;else if(typeof r==`string`){r&&t.push(r);break}else if(Te(r)){let e=r.message;typeof e==`string`&&e&&t.push(e),r=r.cause}else break;i+=1}return t}function g(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`disconnected (check cors or network)`)||t.includes(`disconnected (check url or network)`)||t.includes(`blocked by cors`)||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`load failed`)||t.includes(`networkerror when attempting to fetch resource`)||t.includes(`cors`)&&t.includes(`blocked`)}function De(e){return Ee(e).some(g)}function _(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`request timeout`)||t.includes(`timeout after`)||t.includes(`backend request timed out`)}function v(e){let t=Ee(e);return t.some(g)?Se:t.some(_)?Ce:t[0]??null}function Oe(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var y=e=>{let t=null,n=!1;return Oe(e)?(n=!0,t=be(e)&&e.response?.data.error?e.response?.data.error:xe(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,v(n?t??e:e)??t??``},b=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},x=n(),ke={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},S={position:`top-right`,style:ke},Ae={...ke,color:`var(--oh-muted)`};function je({message:e}){let t=u.useRef(null),[n,r]=u.useState(!1);return u.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,x.jsxs)(`div`,{className:se(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,x.jsx)(ne,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:oe}}),(0,x.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var Me={...S,icon:null,style:Ae},Ne=e=>{let t=e||h.t(l.STATUS$ERROR);g(t)?t=h.t(l.ERROR$CORS_OR_NETWORK):_(t)&&(t=h.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=b(t,4e3);c((0,x.jsx)(je,{message:t}),{...Me,duration:n})},Pe=e=>{let t=b(e,5e3);c.success((0,x.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...S,duration:t})},Fe=(e,t,n)=>{let r=b(`${e} ${t}`,5e3);c.success((0,x.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,x.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{...S,duration:r})},Ie=e=>{let t=b(e,6e3);c((0,x.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...S,icon:`⚠️`,duration:t})},Le=`openhands-backend-health`,Re=500;function ze(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function Be(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Le);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&ze(r)&&(n[e]=r);return n}catch{return{}}}function Ve(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(Le);return}window.localStorage.setItem(Le,JSON.stringify(e))}catch{}}function He(e){let t=v(e)??`Unknown error`;return t.length>Re?`${t.slice(0,Re)}…`:t}var C=Be(),Ue=new Set;function We(){Ue.forEach(e=>e())}function w(e){C=e,Ve(e),We()}function Ge(){return C}function Ke(e){return C[e]??null}function qe(e){return Ue.add(e),()=>{Ue.delete(e)}}function Je(e,t){let n=C[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:He(t),lastFailureAt:Date.now(),disabled:i};w({...C,[e]:a})}function Ye(e){if(!(e in C))return;let{[e]:t,...n}=C;w(n)}function Xe(e){if(!(e in C))return;let{[e]:t,...n}=C;w(n)}function Ze(e){if(!(e in C))return;let{[e]:t,...n}=C;w(n)}var Qe=`workspace/project`,$e=`__AGENT_CANVAS_LOCK_TO_CLOUD__`,T=`all-hands.dev`,E=`openhands.dev`,et=`app.${T}`,tt=E,nt=`app.${E}`;function rt(e){return e?.trim()||null}function it(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function D(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function at(e){let t=e.toLowerCase();return t===et||t===nt?tt:t===T?E:t.endsWith(`.${T}`)?`${t.slice(0,-13)}${E}`:t}function ot(e){let t=D(e);if(!t)return null;try{let e=new URL(t),n=e.port?`:${e.port}`:``;return`${e.protocol}//${at(e.hostname)}${n}`}catch{return t.toLowerCase()}}function st(){let e=O();return!e||typeof window>`u`||!dt(window.location.origin,e)?null:window.location.origin}function ct(){return it(void 0)}function lt(){let e=rt(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return rt(e)}return null}function ut(){return{baseUrl:k()??``,sessionApiKey:A()??``}}function O(){let e=D(void 0);if(e)return e;if(typeof window<`u`){let e=window[$e];if(typeof e==`string`)return D(e)}return null}function dt(e,t){let n=ot(e),r=ot(t);return!n||!r?!1:n===r}function ft(){return st()?`cookie`:`api-key`}function k(){return ct()||(typeof window<`u`?window.location.origin:null)}function A(){return lt()}function j(){return Qe}function pt(e){return`${j().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function mt(){let e=A();return e?{"X-Session-API-Key":e}:{}}function M(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function ht(){return M()?!A():!1}var gt=`default-local`,_t=`Local`,vt=`locked-cloud`,yt=`OpenHands Cloud`;function bt(){if(!O())return null;let e=st();return e?{id:vt,name:yt,host:e,apiKey:``,kind:`cloud`,authMode:`cookie`}:null}function N(){if(O())return null;let e=k(),t=A();return!e||!t?null:{id:gt,name:_t,host:e,apiKey:t,kind:`local`}}var xt=`openhands-backends`,P=`openhands-active-backend`;function St(e){return e===`local`||e===`cloud`}function Ct(e){return e===void 0||e===`api-key`||e===`cookie`}function wt(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&St(t.kind)&&Ct(t.authMode)}function Tt(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function Et(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||Tt(e.host)&&Tt(t.host)}function Dt(e){let t=N();if(!t)return e;let n=!1,r=e.map(e=>!Et(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(F(r),r):e}function F(e){if(!(typeof window>`u`))try{window.localStorage.setItem(xt,JSON.stringify(e))}catch{}}function Ot(){if(typeof window>`u`)return[];try{let e=bt();if(e)return F([e]),Nt()?.backendId!==e.id&&I({backendId:e.id}),[e];let t=window.localStorage.getItem(xt);if(t===null){let e=N();return e?(F([e]),[e]):[]}let n=JSON.parse(t);if(!Array.isArray(n))return[];let r=n.filter(wt);if(r.length===0){let e=N();return e?(F([e]),[e]):[]}return Dt(r)}catch{return[]}}function kt(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function At(e,t){try{return e?.getItem(t)??null}catch{return null}}function jt(e,t,n){try{e?.setItem(t,n)}catch{}}function Mt(e,t){try{e?.removeItem(t)}catch{}}function Nt(){return typeof window>`u`?null:kt(At(window.sessionStorage,P))||kt(At(window.localStorage,P))}function I(e){if(typeof window>`u`)return;if(!e){Mt(window.sessionStorage,P),Mt(window.localStorage,P);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});jt(window.sessionStorage,P,t),jt(window.localStorage,P,t)}var Pt=`no-backend`,Ft={id:Pt,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function L(e){return e.id===Pt}function It(e){return e.find(e=>e.kind===`local`&&Ke(e.id)?.disabled!==!0)||(e.find(e=>e.kind===`local`)??e[0]??Ft)}function R(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=It(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var z=R(Ot(),Nt()),B=new Set;function Lt(){B.forEach(e=>e())}function V(){return z.active}function H(){let e=z.active.backend;return e.kind===`local`&&!L(e)?e:null}function U(){return z.backends}function W(){return z.selection}function Rt(){return z}function zt(e){I(e),z=R(z.backends,e),Lt()}function G(e){F(e);let t=z.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,I(null)),z=R(e,t),Lt()}function Bt(e){return B.add(e),()=>{B.delete(e)}}var Vt=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},Ht=e=>{if(!(e instanceof ie)||e.response?.status!==401&&e.status!==401)return!1;let t=V().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},K=new Set,Ut=()=>{let e=new te({queryCache:new a({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&Ye(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||Vt(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!Ht(t)){let e=y(t);K.has(e||``)||(Ne(e||h.t(l.ERROR$GENERIC)),K.add(e||``),setTimeout(()=>{K.delete(e||``)},3e3))}}}),mutationCache:new o({onError:(t,n,r,i)=>{Vt(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!Ht(t)&&Ne(y(t)||h.t(l.ERROR$GENERIC))}})});return e},Wt=null,Gt=null,Kt=()=>(Wt||=Ut(),Wt),qt=()=>Gt??Kt(),Jt=e=>(Gt=e??Kt(),Gt),Yt=new Proxy({},{get:(e,t)=>{let n=qt(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=qt();return Reflect.set(r,t,n,r)}});function Xt(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function Zt(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function Qt(e){let t=Xt(e),n=Zt(e),r=window.location.protocol===`https:`,i=$t(e)===`https:`;return`${r||i?`https:`:`http:`}//${t}${n}`}function $t(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function en(e){let t=Xt(e),n=Zt(e),r=window.location.protocol===`https:`,i=$t(e)===`https:`;return`${r||i?`wss:`:`ws:`}//${t}${n}/sockets/bash-events`}function tn(e,t){if(!e)return null;let n=Xt(t),r=Zt(t),i=window.location.protocol===`https:`,a=$t(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var nn=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function rn(e){return e.replace(/\/+$/,``)}function an(e,t){return e.host?rn(e.host):e.conversationUrl?rn(Qt(e.conversationUrl)):rn(t?.host??``)}function q(e={}){let t=H();if(!t&&!e.host&&!e.conversationUrl)throw new nn;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:an(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??j(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function on(e){let{host:t,apiKey:n,timeout:r}=q(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}var sn={_comment:`Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.`,versions:{agentServer:`1.38.0`,agentCanvas:`1.7.2`,automation:`1.4.1`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},cn=5e3,ln=`unknown`,J=sn.compatibility.minimumAgentServer,un=`AGENT_SERVER_UNSUPPORTED_VERSION`,dn=`AGENT_SERVER_UNKNOWN_VERSION`,Y=null,fn=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,X=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},pn=e=>e instanceof X||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,mn=class extends X{code=un;actualVersion;requiredVersion=J;constructor(e){let t=`Agent Canvas requires agent-server ${J} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},hn=class extends X{code=dn;actualVersion;requiredVersion=J;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${J} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},gn=e=>M()&&Q(e,401);function Z(){Y=null}function _n(e){let t=fn(Y);return Array.isArray(t)?t.includes(e):!0}function vn(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function Q(e,t){return vn(e)&&e.status===t}function yn(e){return typeof e==`string`&&e.trim()||null}function bn(e){return yn(e.sdk_version)}function xn(e){return yn(e.version)??bn(e)}function Sn(e){let t=xn(e);return!t||t.toLowerCase()===ln?null:t}function Cn(e){let t=Sn(e);return!t||!En(t)?null:t}function wn(e){return!Y||e&&H()?.host!==e?null:Cn(Y)}function Tn(e,t){let n=En(e),r=En(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function En(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function Dn(e){let t=Sn(e);if(!t)throw Z(),new hn(xn(e));let n=Tn(t,J);if(n===null)throw Z(),new hn(t);if(n<0)throw Z(),new mn(t)}async function On(){let e=H();if(!e){if(Z(),L(V().backend))throw new X(`No backend configured`,{noBackendConfigured:!0});return null}let t=q({host:e.host,sessionApiKey:e.apiKey||null,timeout:cn}),n;try{n=await new ae(t).getServerInfo()}catch(e){throw Z(),Q(e,401)?e:new X(e instanceof Error?e.message:null)}if(Dn(n),M())try{await new re(t).getSettings()}catch(e){if(Q(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return Y=n,n}var kn={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},An={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},jn={all:[`llm-profiles`]},Mn={all:[`agent-profiles`]},Nn={retry:!1},Pn={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},Fn={all:[`local-workspaces`]},In={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},Ln={latestVersion:[`agent-canvas-latest-version`]},Rn={staleTime:1e3*60*5,gcTime:1e3*60*15},$=u.createContext(null);function zn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Bn({children:e}){let t=u.useSyncExternalStore(Bt,Rt,Rt),n=u.useCallback(()=>{Z(),Yt.invalidateQueries({queryKey:kn.WEB_CLIENT_CONFIG})},[]),r=u.useCallback((e,t)=>{let r=W()?.backendId??null,i=W()?.orgId??null,a=t??null;e===r&&a===i||(zt({backendId:e,orgId:a}),n())},[n]),i=u.useCallback(e=>{let t={...e,id:zn()};return G([...U(),t]),zt({backendId:t.id}),n(),t},[n]),a=u.useCallback((e,t)=>{let r=U().find(t=>t.id===e),i=W()?.backendId??null;G(U().map(n=>n.id===e?{...n,...t}:n));let a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;(a||o)&&(Xe(e),i===e&&n())},[n]),o=u.useCallback(e=>{G(U().filter(t=>t.id!==e)),Ze(e),n()},[n]),s=u.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,x.jsx)($.Provider,{value:s,children:e})}function Vn(){let e=u.useContext($);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function Hn(){let e=u.useContext($);return e?e.active:{backend:N()??Ft,orgId:null}}export{Je as $,Qt as A,_t as B,Q as C,q as D,nn as E,Jt as F,mt as G,pt as H,V as I,O as J,j as K,H as L,Kt as M,qt as N,on as O,Yt as P,Ge as Q,U as R,vn as S,sn as T,k as U,Qe as V,ut as W,ht as X,M as Y,dt as Z,wn as _,_e as _t,Nn as a,Fe as at,_n as b,jn as c,v as ct,In as d,g as dt,Ye as et,kn as f,fe as ft,Tn as g,h as gt,Z as h,ge as ht,Mn as i,Pe as it,tn as j,en as k,Pn as l,_ as lt,Dn as m,m as mt,Hn as n,S as nt,Ln as o,Ie as ot,An as p,d as pt,ft as q,Vn as r,Ne as rt,Rn as s,y as st,Bn as t,qe as tt,Fn as u,De as ut,Cn as v,ve as vt,On as w,pn as x,gn as y,de as yt,L as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as n}from"./sdk-section-page-BW-i45yr.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as s}from"./useMutation-DyQXZFEF.js";import{i as c,it as l,rt as u,st as d}from"./active-backend-context-BlZPzZNU.js";import{t as f,z as p}from"./utils-qjs_KuS4.js";import{t as m}from"./back-nav-button-Be_L157B.js";import{t as h}from"./loading-spinner-CcpnCr_d.js";import{t as g}from"./brand-button-CQO8oqVo.js";import{i as _}from"./dropdown-classes-DQlj-MpS.js";import{t as v}from"./use-llm-profiles-BMQoc612.js";import{n as y,t as b}from"./use-agent-profiles-Dmd_4H8q.js";import{i as x,n as S,t as C}from"./use-can-manage-org-profiles-CrG1km7R.js";import{t as w}from"./u-edit-809W9D9T.js";import{t as T}from"./settings-dropdown-input-Dx6vlkgf.js";import{r as E}from"./typography-C6fuRTTT.js";import{o as D}from"./extension-module-card-classes-Bo43vY5V.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-DwgrwohM.js";import{t as N}from"./u-check-circle-DBEvndTS.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-gQdBahdt.js";import{n as R}from"./settings-section-header-context-CnIIQAUn.js";import{t as z}from"./use-save-agent-profile-2Mk9ZX37.js";import{n as B}from"./use-activate-agent-profile-DH33MvVj.js";import{t as V}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as H,t as U}from"./agent-settings-BIOsUglV.js";var W=e(t(),1),G=e(n(),1),K=r();function q({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:s}){let{t:c}=o(`openhands`),l=(0,W.useRef)(null),u=(0,W.useRef)([]),d=s?.current??null,[m,h]=(0,W.useState)();(0,W.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,W.useEffect)(()=>{u.current[0]?.focus()},[]),(0,W.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&!l.current.contains(t)&&a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let g=e=>{e(),a()},v=(0,W.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,S=(0,K.jsxs)(`div`,{ref:l,className:f(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,K.jsx)(k,{index:0,icon:(0,K.jsx)(w,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,K.jsx)(k,{index:1,icon:(0,K.jsx)(N,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,K.jsx)(k,{index:2,icon:(0,K.jsx)(x,{width:16,height:16}),label:c(p.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:G.createPortal((0,K.jsx)(`div`,{style:m,children:S}),document.body):S}function J({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:s}){let{t:c}=o(`openhands`),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(p.SETTINGS$AGENT_TYPE_ACP);return(0,K.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:f(P,`justify-between gap-3`),children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,K.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(p.SETTINGS$PROFILE_ACTIVE)})]}),n&&(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(S,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(p.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,K.jsx)(q,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:s,onClose:()=>u(!1)})]})]})}function Y({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l}){let{t:u}=o(`openhands`);return e?(0,K.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,K.jsx)(h,{size:`large`})}):t?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-red-400`,children:u(p.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(p.SETTINGS$PROFILES_EMPTY)})}):(0,K.jsx)(`div`,{className:f(L,F),children:n.map(e=>(0,K.jsx)(J,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l},e.name))})}function X(){let e=a();return s({mutationFn:e=>y.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function Z({profile:e,onClose:t}){let{t:n}=o(`openhands`),r=X(),i=(0,W.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(p.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){u(e instanceof Error?e.message:n(p.ERROR$GENERIC))}},s=()=>{r.isPending||t()},c=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:s,isDisabled:r.isPending,children:n(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{size:`small`}),(0,K.jsx)(`span`,{className:`sr-only`,children:n(p.BUTTON$DELETE)})]}):n(p.BUTTON$DELETE)})]});return(0,K.jsx)(j,{isOpen:!0,title:n(p.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:s,initialFocusRef:i,children:(0,K.jsx)(`p`,{className:`text-sm break-all`,children:n(p.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function Q({onAddProfile:e,onEditProfile:t}){let{t:n}=o(`openhands`),{data:r,isLoading:i,error:a}=b(),s=B(),c=C(),[u,d]=(0,W.useState)(null),f=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(p.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,K.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(p.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,K.jsx)(Y,{isLoading:i,loadError:a??null,profiles:f,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await s.mutateAsync(e.id),l(n(p.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:s.isPending})]}),(0,K.jsx)(Z,{profile:u,onClose:()=>d(null)})]})}function $(){let e=a();return s({mutationFn:({name:e,newName:t})=>y.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function ee(e){return e.agent_kind===`acp`?{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?H(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``}:{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,tool_concurrency_limit:e.tool_concurrency_limit}}function te(){let{t:e}=o(`openhands`),{setHideSectionHeader:t}=R(),n=z(),r=$(),{data:i}=b(),{data:a,isLoading:s}=v(),[c,f]=(0,W.useState)(`list`),[h,_]=(0,W.useState)(``),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(null),[D,k]=(0,W.useState)(``),[j,M]=(0,W.useState)(null),[N,P]=(0,W.useState)(!1);(0,W.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,W.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),B=(0,W.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==x?.name&&L.has(h)),[h,c,L,x?.name]),H=(0,W.useCallback)(()=>{_(``),S(null),w({agent_kind:`openhands`}),k(I),M(null),f(`create`)},[I]),G=(0,W.useCallback)(async t=>{try{let e=(await y.getProfile(t.name,`encrypted`)).profile;S(e),w(ee(e)),e.agent_kind===`openhands`?k(s||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),f(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),u(e(p.ERROR$GENERIC))}},[e,F,s,I]),q=(0,W.useCallback)(()=>{f(`list`),S(null),_(``),w(null),M(null)},[]),J=(0,W.useCallback)(async()=>{if(!j||!B)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){u(e(p.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){u(t instanceof Error?t.message:e(p.ERROR$GENERIC));return}let i=h.trim(),a=x?.name,o=c===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=V(c===`edit`?x:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?p.SETTINGS$PROFILE_CREATED:p.SETTINGS$PROFILE_UPDATED,{name:i})),q()}catch(t){u(d(t)||e(p.ERROR$GENERIC))}finally{P(!1)}},[j,B,D,h,c,x,n,r,e,q]);if(c===`list`)return(0,K.jsx)(Q,{onAddProfile:H,onEditProfile:G});let Y=e(c===`edit`?p.SETTINGS$EDIT_AGENT_PROFILE:p.SETTINGS$ADD_AGENT_PROFILE),X=c===`edit`&&x?e(p.SETTINGS$PROFILE_LOADED,{name:x.name}):e(p.SETTINGS$PROFILE_SAVE_HINT),Z=j?.agentType!==`acp`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(m,{testId:`back-to-agent-profiles`,onClick:q,children:e(p.BUTTON$BACK)}),(0,K.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:Y}),(0,K.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:X})]}),(0,K.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,K.jsx)(U,{embedded:!0,agentSettingsOverride:C,onSaveControlChange:M},c===`edit`?`edit-${x?.id}`:`new-profile`),Z&&(F.length>0?(0,K.jsx)(T,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(p.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,K.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(p.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,K.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,K.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:q,children:e(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:J,isDisabled:!B||N||!j?.isValid,"aria-busy":N,children:e(N?p.SETTINGS$SAVING:p.BUTTON$SAVE)})]})]})}var ne={hideTitle:!1},re=i(function(){return(0,K.jsx)(te,{})});export{re as default,ne as handle};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-BjK-bPN2.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/active-backend-context-BlZPzZNU.js","assets/vendor-styling-Bcgpimp9.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js","assets/utils-qjs_KuS4.js","assets/proxy-C79PCMjo.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{xt as e}from"./vendor-styling-Bcgpimp9.js";import{_ as t,c as n,f as r,g as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{A as a,D as o,E as s,H as c,I as l,K as u,L as d,b as f}from"./active-backend-context-BlZPzZNU.js";import{C as ee}from"./utils-qjs_KuS4.js";import{t as p}from"./client-source-1v-kWLNU.js";import{r as m,t as h}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";import{t as g}from"./proxy-C79PCMjo.js";import{t as _}from"./settings-Chfn5xTD.js";import{t as v}from"./settings-service.api-DryhKdSr.js";import{t as y}from"./v4-DDdyfk2q.js";import{t as te}from"./profiles-service.api-CBafmAPO.js";import{t as ne}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js";import{f as b,o as x,s as S}from"./acp-providers-BHKZvEm5.js";import{d as C,f as w,r as T}from"./llm-subscription-DTqtBCWz.js";import{t as re}from"./llm-subscription-service-W5BprsNA.js";var E=new Map;function ie(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function ae(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function oe(e={}){let t=o(e),n=t.host,r=E.get(n);if(r)return r;let a=(async()=>{let{home:e}=await new i(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();E.set(n,a);try{return await a}catch(e){throw E.delete(n),e}}async function se(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ie(n)?n:ae(await oe(t),n):oe(t)}var D=`openhands-agent-server-conversation-metadata`,ce=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),O=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(D);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},le=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},k=e=>O()[e]??null,A=(e,t)=>{let n=O();n[e]=t,le(n)},j=e=>{let t=O();e in t&&(delete t[e],le(t))};function M(e){if(!e?.id)return e;let t=k(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function N(){let e=l().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function ue(e=20,t){let n=N(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>M(e)),next_page_id:i?.next_page_id??null}}async function P(e){if(e.length===0)return[];let t=N(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(M)}async function de(e){return await g({backend:N(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:p})}async function fe(e){return g({backend:N(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function pe(e){await g({backend:N(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function me(e,t){return await g({backend:N(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function he(e){await g({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function ge(e){await g({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function F(e,t){let n=N(),r=new URLSearchParams;return r.append(`file_path`,t),await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function _e(e){let t=N(),n=new URLSearchParams;return n.set(`ids`,e),(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}function ve(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}var I=`canvas_ui`,L=`canvas_ui_control`,ye=`ClientAction_${L}`,be={name:L,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
|
|
3
|
-
|
|
4
|
-
They will NOT see the files you wrote, the terminal output, or the browser
|
|
5
|
-
unless you call this tool to switch the right-side panel to the relevant
|
|
6
|
-
tab. Call this every time you finish work that produces something the user
|
|
7
|
-
should look at — don't rely on them noticing on their own.
|
|
8
|
-
|
|
9
|
-
When to call (pick the most specific option that matches your last action):
|
|
10
|
-
|
|
11
|
-
* You wrote or modified a single file (ANY language, ANY size — including
|
|
12
|
-
small scripts like a hello-world bash file) →
|
|
13
|
-
command="navigate_to_file", path=<workspace-relative path of that file>
|
|
14
|
-
|
|
15
|
-
* You generated an HTML page, image, SVG, PDF, markdown report, or other
|
|
16
|
-
previewable artifact →
|
|
17
|
-
command="show_preview", path=<that file>
|
|
18
|
-
|
|
19
|
-
* You finished editing multiple files in one logical step →
|
|
20
|
-
command="open_tab", tab="files"
|
|
21
|
-
(The Files tab automatically renders a diff view when the workspace has
|
|
22
|
-
uncommitted git changes, which covers the "highlight changes" case.)
|
|
23
|
-
|
|
24
|
-
* You ran a long-running terminal command, or one whose output the user
|
|
25
|
-
should inspect →
|
|
26
|
-
command="open_tab", tab="terminal"
|
|
27
|
-
|
|
28
|
-
* You browsed to a URL the user should see →
|
|
29
|
-
First call browser_get_state(include_screenshot=true) after your final
|
|
30
|
-
browser interaction so Agent Canvas has a screenshot to display, then call
|
|
31
|
-
command="open_tab", tab="browser"
|
|
32
|
-
(browser_navigate alone only updates the URL; without browser_get_state,
|
|
33
|
-
the Browser tab will open without a screenshot.)
|
|
34
|
-
|
|
35
|
-
Call this BEFORE writing your chat-message summary of the change, so the
|
|
36
|
-
artifact is visible while the user reads what you did. One canvas_ui_control
|
|
37
|
-
call per logical step is enough — don't repeat it for the same file or tab in
|
|
38
|
-
the same turn.`,parameters:{type:`object`,additionalProperties:!1,properties:{command:{type:`string`,enum:[`navigate_to_file`,`open_tab`,`show_preview`],description:`UI command to dispatch.`},path:{type:`string`,description:`Workspace-relative file path. Required for navigate_to_file and show_preview; ignored otherwise.`},tab:{type:`string`,enum:[`files`,`browser`,`vscode`,`terminal`,`planner`,`tasklist`],description:`Tab to open. Required for open_tab; ignored otherwise.`}},required:[`command`]},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},xe=[`terminal`,`file_editor`,`task_tracker`],R=`browser_tool_set`,z=`task_tool_set`;function Se(){return!0}function Ce(){if(typeof window<`u`){let e=window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;if(typeof e==`string`)return e.trim()||null}return null}function we(){let e=Ce();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function Te(){let e=we();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,{frontend:a}=e.services;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
|
|
39
|
-
`)}function Ee(e){let{host:t}=o();return`${t}/api/conversations/${e}`}function B(e){return`Conversation ${e.slice(0,5)}`}function V(e){let t=k(e.id),n=e.agent?.kind===`ACPAgent`,r=n?e.tags?.acpserver??e.agent?.acp_server??null:null;return{id:e.id,created_by_user_id:null,selected_repository:t?.selected_repository??null,selected_branch:t?.selected_branch??null,git_provider:t?.git_provider??null,selected_workspace:t?.selected_workspace??null,active_profile:t?.active_profile??null,title:e.title?.trim()?e.title:B(e.id),trigger:null,pr_number:[],agent_kind:n?`acp`:`openhands`,acp_server:r,tags:e.tags??null,launched_agent_profile:e.launched_agent_profile??null,llm_model:n?b({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??_.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??ee.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:Ee(e.id),session_api_key:o().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??u()},public:!1,sub_conversation_ids:[]}}function De(e){return{items:e.items.map(V),next_page_id:e.next_page_id??null}}var H=`acpserver`,Oe=new Set([H]);function ke(e){return e?Object.entries(e).filter(([e])=>!Oe.has(e)).sort(([e],[t])=>e.localeCompare(t)):[]}var Ae=`gAAAAA`,je=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function U(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function W(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function G(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function K(e){return typeof e==`string`?e.startsWith(Ae):Array.isArray(e)?e.some(K):G(e)?Object.values(e).some(K):!1}function Me(e){return G(e)?Object.values(e).some(K):!1}function Ne(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Pe(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function Fe(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function q(e,t){return e===R?Se()&&f(e):e===z?t.enable_sub_agents===!0&&f(e):!0}function Ie(e){let t=new Map;for(let n of xe)q(n,e)&&t.set(n,{name:n,params:{}});for(let n of[R,z])q(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>Fe(e)))for(let r of n)q(r.name,e)&&t.set(r.name,{name:r.name,params:U(r.params)});return Array.from(t.values())}function Le(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
|
|
40
|
-
|
|
41
|
-
`)}],run:!0}}function Re(){return ne.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/OpenHands/OpenHands/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function ze(e){let t=Te(),n=U(e.agent_context),r=[...Array.isArray(n.skills)?n.skills:[],...Re()];return{...n,skills:r,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function Be(e){return U(e.agent_settings).agent_kind===`acp`}function Ve(e){let t=U(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function He(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=S(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Ue(e){let t=U(e.agent_settings),n={agent_kind:`acp`,agent_context:ze(t)};for(let e of h){if(e===`acp_model`||e===`acp_env`)continue;let r=e===`acp_command`?He(t):t[e];r!=null&&(n[e]=r)}let r=U(t.mcp_config);Object.keys(r).length>0&&(n.mcp_config=r);let i=typeof t.acp_server==`string`?t.acp_server:void 0,a=b({configured:t.acp_model,providerDefault:x(i)});return a&&(n.acp_model=a),n}function We(e){let t=U(e.agent_settings),n=U(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:_.llm_model,n.stream=!0;let r=W(n.api_key);r?n.api_key=r:delete n.api_key;let i=W(n.base_url);i?n.base_url=i:delete n.base_url,w(n)?(n.auth_type=T,n.subscription_vendor=C,delete n.api_key,delete n.base_url):(delete n.auth_type,delete n.subscription_vendor);let a=U(t.mcp_config);Object.keys(a).length===0&&delete t.mcp_config,delete t.acp_server;for(let e of h)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:ze(t),tools:Ie(t)}}function Ge(e){return Be(e)?Ue(e):We(e)}function Ke(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=U(t.conversation_settings),s=Le(n,r);return je.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??u()},...s?{initial_message:s}:{},...i?.length?{plugins:i.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function qe(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Be(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=Ge(t),a=n?Ve(t):void 0,o=Ke(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[be]:[],confirmation_policy:Ne(o),max_iterations:typeof o.max_iterations==`number`?o.max_iterations:500,stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a&&(s.tags={[H]:a}),!e.agentProfileId&&e.secretsEncrypted&&(!n||Me(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId);let c=Pe(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config&&(s.hook_config=o.hook_config);let l={...o.tool_module_qualnames??{}};if(delete l[I],delete l[L],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=d(),n=t?ve(t):{},r={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}s.secrets=r}return s}var Je=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Ye(e){if(w(U(e.llm))&&!(await re.getOpenAIStatus()).connected)throw Error(Je)}async function Xe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-BjK-bPN2.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),[r,i]=await Promise.all([v.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return t.agentProfileId||await Ye(a),qe({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Ze(){return{hooks:[]}}function Qe(e,t){if(!t)return;let n=new Set(t.profiles.map(e=>e.name));if(e&&n.has(e))return e;if(t.active_profile&&n.has(t.active_profile))return t.active_profile}var $e=`1970-01-01T00:00:00.000Z`,et=300*1e3,tt=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function J(){return Error(tt)}function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nt(e){return typeof e==`number`?e:null}function X(e){return typeof e==`number`?e:0}function Z(e){return typeof e==`string`?e:null}function Q(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:$e}function rt(e){return Y(e)?{prompt_tokens:X(e.prompt_tokens),completion_tokens:X(e.completion_tokens),cache_read_tokens:X(e.cache_read_tokens),cache_write_tokens:X(e.cache_write_tokens),context_window:X(e.context_window),per_turn_token:X(e.per_turn_token)}:null}function it(e){return Y(e)?{accumulated_cost:nt(e.accumulated_cost),max_budget_per_task:nt(e.max_budget_per_task),accumulated_token_usage:rt(e.accumulated_token_usage)}:null}function at(e){if(!Y(e))return null;let t=Y(e.llm)?{model:Z(e.llm.model)}:null;return{kind:Z(e.kind),acp_server:Z(e.acp_server),acp_model:Z(e.acp_model),llm:t}}function ot(e){return Y(e)?{working_dir:Z(e.working_dir)}:null}function st(e){if(!Y(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function ct(e){if(!Y(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function lt(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function ut(e,t){let n=lt(e),r=lt(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function dt(e){if(!Y(e)||typeof e.id!=`string`||!e.id.trim())throw J();return{id:e.id.trim(),title:Z(e.title),created_at:Q(e,`created_at`,`createdAt`),updated_at:Q(e,`updated_at`,`updatedAt`),execution_status:Z(e.execution_status),sandbox_status:Z(e.sandbox_status),metrics:it(e.metrics),agent:at(e.agent),workspace:ot(e.workspace),tags:st(e.tags),launched_agent_profile:ct(e.launched_agent_profile),current_model_id:Z(e.current_model_id),current_model_name:Z(e.current_model_name)}}function $(e){if(!Array.isArray(e))throw J();return e.map(dt)}function ft(e){if(Array.isArray(e))return{items:$(e),next_page_id:null};if(!Y(e))throw J();return{items:$(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var pt=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function mt(e){let t=e??`idle`;return pt.has(t)?t:`idle`}function ht(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var gt=class{static async sendMessage(e,n,r){let i=l().backend,s=r?.conversationUrl??null,c=r?.sessionApiKey??null;if(i.kind===`cloud`){if(!s||!c){let[t]=await P([e]);s=t?.conversation_url?.trim()??null,c=t?.session_api_key?.trim()??null}if(!s||!c)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await g({backend:i,method:`POST`,hostOverride:a(s),path:`/api/conversations/${e}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:c}),n}return await new t(o({conversationUrl:s,sessionApiKey:c})).sendEvent(e,n,{run:!0}),n}static async createConversation(e,n,r,i,a,u,f,ee,p,m,h){if(l().backend.kind===`cloud`)return de({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:n??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:r??null,parent_conversation_id:f??null,agent_type:ee,sandbox_id:p??null,agent_profile_id:m??null});let[g,_]=await Promise.all([v.getSettings(),te.listProfiles().catch(()=>void 0)]),ne=Qe(g.title_llm_profile,_),b=y(),x=await se(a??c(b)),S=u??(a?`local_repo`:`new_worktree`),C=await Xe({settings:g,query:e,conversationInstructions:n,plugins:r,conversationId:b,workingDir:x,worktree:S===`new_worktree`,agentProfileId:m,agentProfileKind:h,titleLlmProfile:ne}),w=await new t(o({timeout:et})).createConversation(C),T=d();if(!T)throw new s;return(i?.selected_repository||a)&&A(w.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:a??null,workspace_mode:S}),{id:w.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:w.id,agent_server_url:T.host,request:{initial_message:C.initial_message,plugins:r??null},created_at:w.created_at,updated_at:w.updated_at}}static async getStartTask(e){return l().backend.kind===`cloud`?_e(e):null}static async getVSCodeUrl(e,t,r){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new n(o({conversationUrl:t,sessionApiKey:r})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??u()}static async batchGetAppConversations(e){return e.length===0?[]:l().backend.kind===`cloud`?P(e):$(await new t(o()).getConversations(e)).map(e=>V(e))}static async updateConversationPublicFlag(e,t){if(l().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return me(e,t)}static async updateConversationRepository(e,t,n,r){t?A(e,{...k(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):j(e);let[i]=await this.batchGetAppConversations([e]);return ht(i,e)}static async readConversationFile(e,t){if(l().backend.kind===`cloud`)return F(e,ut(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=ut(t??`${n}/.agents_tmp/PLAN.md`,n);return new i(o()).downloadTextFile(r)}static async downloadConversation(e){return l().backend.kind===`cloud`?fe(e):new i(o()).downloadTrajectory(e)}static async getHooks(e){return Ze()}static async getRuntimeConversation(e,n,r){let i=l().backend,s=i.kind===`cloud`&&n?await g({backend:i,method:`GET`,hostOverride:a(n),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:r}):await new t(o({conversationUrl:n,sessionApiKey:r})).getConversation(e),c=dt(s),u=Y(s)?s.stats:null;return{id:c.id,title:c.title?.trim()?c.title:B(c.id),metrics:it(c.metrics),created_at:c.created_at,updated_at:c.updated_at,status:mt(c.execution_status),stats:Y(u)?u:{usage_to_metrics:{}}}}static async searchConversations(e=20,n){return l().backend.kind===`cloud`?ue(e,n):De(ft(await new t(o()).searchConversations({limit:e,page_id:n,sort_order:m.UPDATED_AT_DESC})))}static async deleteConversation(e){l().backend.kind===`cloud`?await pe(e):await new t(o()).deleteConversation(e),j(e)}static async updateConversationTitle(e,n){await new t(o()).updateConversation(e,{title:n});let[r]=await this.batchGetAppConversations([e]);return ht(r,e)}static async forkConversation(e,n,r){if(l().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new t(o()).forkConversation(e,{from_event_id:n,...r?{title:r}:{}}),a=k(e);return a&&A(i.id,a),i}static async getEventParentId(e,n){return(await new t(o()).getEvent(e,n)).parent_id??void 0}static async switchProfile(e,n){let{backend:i}=l();if(i.kind===`cloud`){if(!e){await te.activateProfile(n);return}await g({backend:i,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:n}});return}if(!e){await new r(o()).activateProfile(n);return}let a=o(),s=new t(a),c=await new r(a).getProfile(n,{exposeSecrets:`encrypted`}),u=typeof c.config.model==`string`?c.config.model:``;if(!u)throw Error(`Profile '${n}' has no model.`);await Ye({llm:c.config}),await s.switchLLM(e,{...c.config,model:u,stream:!0,usage_id:`profile:${n}:${y()}`})}static async switchAcpModel(e,n){let{backend:r}=l();if(r.kind===`cloud`){await g({backend:r,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:n}});return}await new t(o()).switchAcpModel(e,n)}};export{I as a,F as c,A as d,ce as f,L as i,ge as l,ke as n,P as o,se as p,ye as r,he as s,gt as t,k as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./agent-settings-BIOsUglV.js";export{e as default,t as handle};
|
|
@@ -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{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{d as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{C as a,D as o,r as s,z as c}from"./active-backend-context-BlZPzZNU.js";import{t as l,z as u}from"./utils-qjs_KuS4.js";import{r as d,t as f}from"./modal-body-DQhiw-AR.js";import{t as p}from"./brand-button-CQO8oqVo.js";import{n as m,o as h}from"./backend-form-modal-Ce-KRHOJ.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=s(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new i(o({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),c(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),a(t,401))T(e(u.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(u.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:l(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(u.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(m,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(h,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(u.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?u.ONBOARDING$BACKEND_STATUS_CHECKING:u.BACKEND$CONNECT)})]})})})]})})}export{v 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{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{ft as a,it as o,n as s,rt as c,st as l}from"./active-backend-context-BlZPzZNU.js";import{z as u}from"./utils-qjs_KuS4.js";import{f as d}from"./telemetry-cmCL3o6Z.js";import{t as f}from"./settings-Chfn5xTD.js";import{n as p}from"./use-settings-DBI44RnH.js";import{t as m}from"./use-save-settings-BRh9p_fv.js";import{t as h}from"./brand-button-CQO8oqVo.js";import{i as g,n as _,r as v,t as y}from"./color-themes-DTj5Ylbr.js";import{t as b}from"./navigation-link-Bxmn-pCs.js";import{t as x}from"./settings-input-BjW_zyTN.js";import{t as S}from"./use-llm-profiles-BMQoc612.js";import{t as C}from"./settings-dropdown-input-Dx6vlkgf.js";import{n as w,t as T}from"./switch-skeleton-BQoOhQTB.js";import{t as E}from"./settings-switch-UNSf8K8I.js";var D=e(t(),1),O=n();function k({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,O.jsx)(C,{testId:n,name:n,onInputChange:t,label:r(u.SETTINGS$LANGUAGE),items:a.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function A(){let{t:e}=i(`openhands`),t=D.useCallback(e=>{if(!e)return;let t=e;_(t),v(t)},[]);return(0,O.jsx)(C,{testId:`color-theme-input`,name:`color-theme-input`,label:e(u.SETTINGS$COLOR_THEME),items:y.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:g(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function j(){return(0,O.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,O.jsx)(w,{}),(0,O.jsx)(T,{}),(0,O.jsx)(T,{})]})}var M=`__automatic__`;function N(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=m(),{data:r,isLoading:g}=p(),_=s().backend.kind===`cloud`,{data:v,isLoading:y}=S(),[w,T]=D.useState(!1),[N,P]=D.useState(!1),[F,I]=D.useState(!1),[L,R]=D.useState(!1),[z,B]=D.useState(!1),[V,H]=D.useState(void 0),U=D.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!v||v.profiles.some(t=>t.name===e)?e:null},[v,r?.title_llm_profile]),W=V===void 0?U:V,G=D.useMemo(()=>[{key:M,label:e(u.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...v?.profiles.map(t=>({key:t.name,label:t.model?e(u.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:t.model}):t.name}))??[]],[v?.profiles,e]),K=n=>{let r=n.get(`language-input`)?.toString(),i=a.find(({label:e})=>e===r)?.value||f.language,s=_?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,p=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||f.git_user_name,h=n.get(`git-user-email-input`)?.toString()||f.git_user_email;t({language:i,...!_&&{user_consents_to_analytics:s},enable_sound_notifications:p,git_user_name:m,git_user_email:h,title_llm_profile:W},{onSuccess:()=>{d(s?`granted`:`denied`),o(e(u.SETTINGS$SAVED))},onError:t=>{c(l(t)||e(u.ERROR$GENERIC))},onSettled:()=>{T(!1),P(!1),I(!1),R(!1),B(!1),H(void 0)}})},q=e=>{let t=a.find(({label:t})=>t===e)?.label,n=a.find(({value:e})=>e===r?.language)?.label;T(t!==n)},J=e=>{P(e!==(r?.user_consents_to_analytics??!0))},Y=e=>{I(e!==!!r?.enable_sound_notifications)},X=e=>{let t=r?.git_user_name;R(e!==t)},Z=e=>{let t=r?.git_user_email;B(e!==t)},Q=!w&&!N&&!F&&W===U&&!L&&!z,$=!r||g||y||n;return(0,O.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:K,className:`flex flex-col gap-6`,children:[$&&(0,O.jsx)(j,{}),!$&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,O.jsx)(k,{name:`language-input`,defaultKey:r.language,onChange:q}),(0,O.jsx)(A,{}),(0,O.jsx)(E,{testId:`enable-analytics-switch`,name:_?void 0:`enable-analytics-switch`,defaultIsToggled:_?!0:r.user_consents_to_analytics??!0,isToggled:_?!0:void 0,isDisabled:_,onToggle:_?void 0:J,children:e(u.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,O.jsx)(E,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Y,children:e(u.SETTINGS$SOUND_NOTIFICATIONS)}),(0,O.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,O.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(u.SETTINGS$CONVERSATION_TITLES)}),(0,O.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(u.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,O.jsx)(C,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(u.SETTINGS$TITLE_GENERATION_MODEL),items:G,selectedKey:W??M,onSelectionChange:e=>{let t=e?.toString();H(!t||t===M?null:t)}}),(0,O.jsx)(b,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(u.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,O.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,O.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(u.SETTINGS$GIT_SETTINGS)}),(0,O.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(u.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,O.jsx)(x,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(u.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:X,placeholder:e(u.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,O.jsx)(x,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(u.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:Z,placeholder:e(u.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,O.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,O.jsxs)(h,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||Q,children:[!n&&e(u.SETTINGS$SAVE_CHANGES),n&&e(u.SETTINGS$SAVING)]})})]})]})]})}var P=r(N);export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=function(e){return e.PENDING=`PENDING`,e.RUNNING=`RUNNING`,e.COMPLETED=`COMPLETED`,e.FAILED=`FAILED`,e}({});export{e as t};
|
|
@@ -1,2 +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{B 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{j as o,v as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as c}from"./useQuery-B38jBavx.js";import{A as l,D as u,I as d,S as f,it as p,n as m,rt as h}from"./active-backend-context-BlZPzZNU.js";import{i as g,t as _,z as v}from"./utils-qjs_KuS4.js";import{t as y}from"./back-nav-button-Be_L157B.js";import{t as b}from"./proxy-C79PCMjo.js";import{n as x,t as S}from"./use-tracking-CN1nIMnY.js";import{t as C}from"./use-settings-DBI44RnH.js";import{r as w}from"./modal-classes-YaEEa5eZ.js";import{t as T}from"./brand-button-CQO8oqVo.js";import{n as E}from"./navigation-context-BOGzIng3.js";import{n as D}from"./use-create-conversation-Dsa4nzU9.js";import{t as O}from"./u-edit-809W9D9T.js";import{t as k}from"./terminal-cMS3RgVE.js";import{t as A}from"./use-user-conversation-GnGhs_Ob.js";import{t as ee}from"./toggle-switch-BptY3XRG.js";import{t as j}from"./x-mark-jcTkPiOB.js";import{n as M,t as N}from"./link-external-BDBCz-_z.js";import{C as te,D as P,E as ne,O as re,S as ie,T as ae,_ as F,a as oe,b as se,c as I,d as L,f as R,g as ce,h as le,i as ue,l as de,m as z,o as fe,p as pe,r as me,s as he,t as ge,u as _e}from"./automation-export-Bu-r-EzL.js";import{t as B}from"./automation-BGP_I1RR.js";var V=e(t()),H=n();function U(){let{t:e}=a(`openhands`);return(0,H.jsx)(y,{to:`/automations`,children:e(v.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var W=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function ve({active:e}){let{t}=a(`openhands`);return(0,H.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:_(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?v.AUTOMATIONS$DETAIL$ACTIVE:v.AUTOMATIONS$DETAIL$INACTIVE)})}function ye({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:o,onRunNow:s,isRunningNow:c=!1}){let{t:l}=a(`openhands`),u=ce(`manage_automations`),d=[...n?[{label:l(v.AUTOMATIONS$EDIT),icon:(0,H.jsx)(O,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?l(v.AUTOMATIONS$TURN_OFF):l(v.AUTOMATIONS$TURN_ON),icon:(0,H.jsx)(_e,{className:`size-4`}),onClick:t},{label:l(v.AUTOMATIONS$EXPORT),icon:(0,H.jsx)(W,{className:`size-4`}),onClick:i},{label:l(v.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,H.jsx)(W,{className:`size-4`}),onClick:o},{label:l(v.AUTOMATIONS$DELETE),icon:(0,H.jsx)(de,{className:`size-4`}),onClick:r}];return(0,H.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,H.jsx)(ve,{active:e.enabled})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u&&s&&(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:c||!e.enabled,onClick:s,children:[(0,H.jsx)(le,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),l(c?v.AUTOMATIONS$STARTING:v.AUTOMATIONS$RUN_NOW)]}),u&&(0,H.jsx)(ee,{enabled:e.enabled,label:e.enabled?l(v.AUTOMATIONS$TURN_OFF):l(v.AUTOMATIONS$TURN_ON),onToggle:t}),u&&(0,H.jsx)(F,{items:d})]})]})})}function G({icon:e,title:t,children:n}){return(0,H.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,H.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,H.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,H.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var be=240,xe=`max-h-60`;function Se({prompt:e}){let{t}=a(`openhands`),[n,r]=V.useState(!1),[i,o]=V.useState(!1),s=V.useRef(null),c=i&&!n;return V.useLayoutEffect(()=>{let e=s.current;if(!e)return;let t=()=>{o(e.scrollHeight>be)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,H.jsx)(G,{icon:(0,H.jsx)(k,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$PROMPT),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`p`,{ref:s,className:_(`whitespace-pre-wrap text-sm leading-6 text-content`,c&&_(xe,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),c?(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,H.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?v.COMMON$VIEW_LESS:v.COMMON$VIEW_MORE)}):null]})})}var Ce=e=>(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),we=e=>(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,H.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,H.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,H.jsx)(`circle`,{cx:9,cy:18,r:2})]}),K=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),q=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),Te=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function J({icon:e,label:t,children:n}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,H.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function Ee({branch:e}){return(0,H.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var Y=60;function De({filter:e}){let{t}=a(`openhands`),[n,r]=(0,V.useState)(!1),i=e.length>Y;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,Y)}…`:e}),i&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?v.SETTINGS$SKILLS_SHOW_LESS:v.SETTINGS$SKILLS_SHOW_MORE)})]})}function Oe({automation:e}){let{t}=a(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?v.AUTOMATIONS$DETAIL$TRIGGER_EVENT:v.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,H.jsx)(G,{icon:(0,H.jsx)(Ce,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,H.jsx)(J,{icon:(0,H.jsx)(we,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,H.jsx)(Ee,{branch:e.branch})]})}),(0,H.jsx)(J,{icon:(0,H.jsx)(K,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,H.jsx)(J,{icon:(0,H.jsx)(q,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,H.jsx)(J,{icon:(0,H.jsx)(pe,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,H.jsx)(J,{icon:(0,H.jsx)(N,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_TYPE),children:L(e.trigger.on)}),n&&e.trigger.filter&&(0,H.jsx)(J,{icon:(0,H.jsx)(M,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,H.jsx)(De,{filter:e.trigger.filter})}),(0,H.jsx)(J,{icon:(0,H.jsx)(R,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$MODEL),children:e.model??t(v.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,H.jsx)(J,{icon:(0,H.jsx)(Te,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var ke=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function Ae({name:e}){return(0,H.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function je({plugins:e}){let{t}=a(`openhands`);return(0,H.jsx)(G,{icon:(0,H.jsx)(ke,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$PLUGINS),children:(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,H.jsx)(Ae,{name:e},e))})})}var X=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function Z(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Me(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?n(v.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(v.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(v.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):o===1?n(v.AUTOMATIONS$DETAIL$TIME_YESTERDAY):o<7?n(v.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:o}):Z(e,t)}function Ne({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=a(`openhands`),i=r.language;return(0,H.jsx)(G,{icon:(0,H.jsx)(X,{className:`size-4`}),title:n(v.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,H.jsx)(J,{icon:(0,H.jsx)(q,{className:`size-3.5`}),label:n(v.AUTOMATIONS$DETAIL$CREATED),children:Z(e,i)}),(0,H.jsx)(J,{icon:(0,H.jsx)(z,{className:`size-3.5`}),label:n(v.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Me(t,i,n):n(v.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Pe=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Fe={[B.COMPLETED]:{label:v.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[B.FAILED]:{label:v.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[B.PENDING]:{label:v.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[B.RUNNING]:{label:v.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Ie({status:e}){switch(e){case B.COMPLETED:return(0,H.jsx)(K,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case B.FAILED:return(0,H.jsx)(Pe,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,H.jsx)(z,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Le({status:e}){let{t}=a(`openhands`),n=Fe[e];return(0,H.jsxs)(`span`,{className:_(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,H.jsx)(Ie,{status:e}),t(n.label)]})}var Re=20;function ze(e){return e.kind===`BashOutput`}var Be=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Re;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{ze(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=d().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:l(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new s(u({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Ve=[`bash-command-logs`];function He(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function Ue(e){let t=o.isAxiosError(e)?e.response?.status:f(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(o.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function We(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=m(),a=A(r?t??null:null),o=a.data,s=o?.conversation_url??null,l=o?.session_api_key??null,u=i.backend.kind===`cloud`,d=a.isFetched,f=null,p=!1;u&&d&&(o?f=He(o.sandbox_status)??(o.conversation_url?null:`missing`):p=!0);let h=r&&!!n&&(u?!!s:!0)&&!f&&!p,g=c({queryKey:[...Ve,n,s,l,i.backend.id,i.orgId],queryFn:()=>Be.listOutputs(s,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Ue(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:p,sandboxIssue:v}}var Ge=4e3;function Ke(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function qe({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?Ke(a,Ge):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
|
|
2
|
-
`)}function Je({run:e,automation:t,stderr:n}){let{t:r}=a(`openhands`),{navigate:i}=E(),o=D();return(0,H.jsx)(T,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(o.isPending)return;let r=qe({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});o.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:o.isPending,"aria-busy":o.isPending,children:r(v.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var Ye={missing:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function Q(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function Xe({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:o}){let{t:s}=a(`openhands`),[c,l]=(0,V.useState)(`stdout`),{data:u,isFetching:d,isResolvingConversation:f,sandboxIssue:p,conversationMissing:m,error:h}=We({conversationId:e,bashCommandId:t,enabled:n});(0,V.useEffect)(()=>{n&&l(`stdout`)},[n,t]),(0,V.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:g,stderr:y}=(0,V.useMemo)(()=>u?{stdout:Q(u,`stdout`),stderr:Q(u,`stderr`)}:{stdout:``,stderr:``},[u]);if(!n)return null;let b=f||d&&!u,x=!t,S=c===`stdout`?g:y,C=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,T=`border-[var(--oh-primary)] text-white`,E=`border-transparent text-muted hover:text-content`;return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":s(v.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,H.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,H.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":s(v.AUTOMATIONS$CANCEL),children:(0,H.jsx)(j,{className:`size-5`})}),(0,H.jsx)(`h2`,{className:_(`pr-8`,w),children:s(v.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":s(v.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:c===`stdout`?0:-1,onClick:()=>l(`stdout`),className:`${C} ${c===`stdout`?T:E}`,children:s(v.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:c===`stderr`?0:-1,onClick:()=>l(`stderr`),className:`${C} ${c===`stderr`?T:E}`,children:s(v.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,H.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${c}`,"aria-labelledby":`run-logs-tab-${c}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[x&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!x&&m&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!x&&!m&&p&&(0,H.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${p}`,className:`text-muted italic`,children:s(Ye[p])}),!x&&!m&&!p&&b&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!x&&!m&&!p&&!b&&h&&!u&&(0,H.jsxs)(`p`,{className:`text-danger`,children:[s(v.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(h)]}),!b&&!p&&u&&(0,H.jsx)(`pre`,{"data-testid":`run-logs-output-${c}`,className:`whitespace-pre-wrap break-words ${c===`stderr`?`text-danger`:`text-content`}`,children:S.length>0?S:(0,H.jsx)(`span`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===B.FAILED&&(0,H.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,H.jsx)(Je,{run:i,automation:o,stderr:y})})]})]})}function Ze(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Qe(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function $e(e){return`/conversations/${e}`}function et({run:e,automation:t}){let{t:n,i18n:r}=a(`openhands`),i=!!e.conversation_id,o=!!e.bash_command_id,s=e.status===B.COMPLETED||e.status===B.FAILED,c=!i&&s,[l,u]=(0,V.useState)(!1),[d]=(0,V.useState)(()=>new Date().toISOString()),f=Ze(Qe(e.started_at)?d:e.started_at,r.language),p=o?(0,H.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":n(v.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:n(v.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,H.jsx)(k,{className:`size-4`})}):null,m=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,H.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,n(v.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,H.jsx)(Le,{status:e.status})]})]});return(0,H.jsxs)(H.Fragment,{children:[i&&e.conversation_id?(0,H.jsx)(`a`,{href:$e(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${f}`,children:m}):(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:m}),o&&(0,H.jsx)(Xe,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1),run:e,automation:t})]})}var tt=20;function nt({automation:e}){let{t}=a(`openhands`),[n,r]=(0,V.useState)(tt),{data:i,isLoading:o}=P({id:e.id,limit:n,offset:0}),s=i?i.total>i.runs.length:!1;return(0,H.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,H.jsx)(`span`,{className:`size-4 text-muted`,children:(0,H.jsx)(X,{className:`size-4`})}),(0,H.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(v.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),o&&(0,H.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,H.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,H.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!o&&i?.runs.length===0&&(0,H.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(v.AUTOMATIONS$DETAIL$NO_RUNS)}),!o&&i&&i.runs.length>0&&(0,H.jsxs)(`div`,{children:[i.runs.map((t,n)=>(0,H.jsx)(`div`,{className:n>0?`border-t border-[var(--oh-border)]`:``,children:(0,H.jsx)(et,{run:t,automation:e})},t.id)),s&&(0,H.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+tt),className:`text-sm text-muted hover:text-foreground`,children:t(v.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function $({className:e}){return(0,H.jsx)(`div`,{className:_(`animate-pulse rounded bg-surface-raised`,e)})}function rt(){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,H.jsx)($,{className:`h-5 w-40`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)($,{className:`h-6 w-48`}),(0,H.jsx)($,{className:`h-6 w-16 rounded-full`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)($,{className:`h-6 w-11 rounded-full`}),(0,H.jsx)($,{className:`h-8 w-8`})]})]}),(0,H.jsx)($,{className:`h-5 w-96`}),(0,H.jsx)($,{className:`h-36 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-72 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-32 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-40 w-full rounded-2xl`})]})}function it(){let{t:e}=a(`openhands`);return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,H.jsx)(I,{className:`size-12 text-muted`}),(0,H.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(v.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,H.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(v.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,H.jsx)(`div`,{className:`mt-6`,children:(0,H.jsx)(U,{})})]})}var at=i(function(){let{t:e}=a(`openhands`),{automationId:t}=r(),{navigate:n}=E(),[i,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),{data:l,isLoading:u,refetch:d}=se(),f=l?.status===`ok`,_=m(),y=(0,V.useRef)(_.backend.id).current!==_.backend.id,{data:b,isLoading:w,isError:T,error:D,refetch:O}=ne({id:t??``,enabled:f&&!y}),{trackPrebuiltAutomationEnabled:k,trackAutomationExported:A}=S(),ee=ae(),j=ie(),M=te(),N=T&&C(D)===404;if(u)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(rt,{})})});if(!f)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(fe,{onRetry:d})})});if(w)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(rt,{})})});if(N)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(it,{})})});if(T||!b)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(he,{onRetry:()=>O()})})});let P=()=>{let e=!b.enabled;ee.mutate({id:b.id,enabled:e}),e&&k({automationId:b.id,automationName:b.name})},F=()=>{j.mutate(b.id,{onSuccess:()=>{n?.(`/automations`)}})},I=()=>{M.mutate(b.id,{onSuccess:()=>{p(e(v.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{h(re(t,e(v.AUTOMATIONS$RUN_NOW_ERROR)))}})},L=()=>{let e=`${JSON.stringify(me(b),null,2)}\n`;g(new Blob([e],{type:`application/json`}),ge(b)),A({backendKind:_.backend.kind})},R=_.backend.kind===`local`;return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(U,{}),(0,H.jsx)(ye,{automation:b,onToggle:P,onEdit:R?()=>c(!0):void 0,onDelete:()=>o(!0),onExport:L,onDownloadTarball:()=>x.downloadTarball(b.id,b.name),onRunNow:I,isRunningNow:M.isPending}),b.prompt&&(0,H.jsx)(Se,{prompt:b.prompt}),(0,H.jsx)(Oe,{automation:b}),b.plugins&&b.plugins.length>0&&(0,H.jsx)(je,{plugins:b.plugins}),(0,H.jsx)(Ne,{createdAt:b.created_at,lastRunAt:b.last_triggered_at}),(0,H.jsx)(nt,{automation:b}),(0,H.jsx)(oe,{automationName:b.name,isOpen:i,onConfirm:F,onCancel:()=>o(!1)}),R&&(0,H.jsx)(ue,{automation:b,isOpen:s,onClose:()=>c(!1)})]})})})});export{at as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{j as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as s}from"./useMutation-DyQXZFEF.js";import{t as c}from"./useQuery-B38jBavx.js";import{it as l,n as u,rt as d}from"./active-backend-context-BlZPzZNU.js";import{t as f,z as p}from"./utils-qjs_KuS4.js";import{n as m,t as h}from"./use-tracking-CN1nIMnY.js";import{r as g}from"./modal-classes-YaEEa5eZ.js";import{f as _,l as ee}from"./form-control-classes-CSPevi7c.js";import{t as v}from"./brand-button-CQO8oqVo.js";import{r as y,u as b}from"./dropdown-classes-DQlj-MpS.js";import{t as x}from"./settings-input-BjW_zyTN.js";import{t as te}from"./use-llm-profiles-BMQoc612.js";import{n as S,t as C}from"./context-menu-list-item-BTHGFhIx.js";import{t as w}from"./settings-dropdown-input-Dx6vlkgf.js";import{t as T}from"./x-mark-jcTkPiOB.js";import{t as E}from"./automation-BGP_I1RR.js";var D=e(t()),O=e(n(),1),k=r();function A(e,t){let n=o.isAxiosError(e)?e.response?.data:e instanceof Error&&`response`in e?e.response:void 0;if(n&&typeof n==`object`){let{message:e,detail:t}=n;if(typeof e==`string`&&e)return e;if(typeof t==`string`&&t)return t}return e instanceof Error&&e.message?e.message:t}var j=[`automation-detail`],M=[`automation-runs`];function ne(e){let{id:t,enabled:n=!0}=e,r=u();return c({queryKey:[...j,t,r.backend.id,r.orgId],queryFn:()=>m.getAutomation(t),staleTime:300*1e3,enabled:!!t&&n})}function re(e){let{id:t,limit:n=20,offset:r=0,enabled:i=!0}=e,a=u();return c({queryKey:[...M,t,{limit:n,offset:r},a.backend.id,a.orgId],queryFn:()=>m.getAutomationRuns(t,n,r),staleTime:60*1e3,enabled:!!t&&i,refetchInterval:e=>{let t=e.state.data;return t&&t.runs.some(e=>e.status===E.PENDING||e.status===E.RUNNING)?3e3:!1}})}var N=[`automations`];function ie(e={}){let{limit:t=50,offset:n=0,enabled:r=!0}=e,i=u();return c({queryKey:[...N,{limit:t,offset:n},i.backend.id,i.orgId],queryFn:()=>m.getAutomations(t,n),staleTime:0,enabled:r})}function ae(){let e=i(),t=u(),{trackAutomationDisableButton:n}=h();return s({mutationFn:({id:e,enabled:t})=>m.toggleAutomation(e,t),onSuccess:(r,i)=>{e.invalidateQueries({queryKey:N}),e.invalidateQueries({queryKey:j}),i.enabled||n({backendKind:t.backend.kind})}})}function oe(){let e=i(),t=u(),{trackAutomationImported:n}=h();return s({mutationFn:e=>m.createAutomation({...e,enabled:!1}),onSuccess:()=>{e.invalidateQueries({queryKey:N}),n({backendKind:t.backend.kind})}})}function se(){let e=i(),t=u(),{trackAutomationEdited:n}=h();return s({mutationFn:({id:e,body:t})=>m.updateAutomation(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:N}),e.invalidateQueries({queryKey:j}),n({backendKind:t.backend.kind})}})}function ce(){let e=i(),t=u(),{trackAutomationDeleted:n}=h();return s({mutationFn:e=>m.deleteAutomation(e),onSuccess:()=>{e.invalidateQueries({queryKey:N}),n({backendKind:t.backend.kind})}})}function le(){let e=i(),t=u(),{trackAutomationExecuted:n}=h();return s({mutationFn:e=>m.dispatchAutomation(e),onSuccess:(r,i)=>{e.invalidateQueries({queryKey:N}),e.invalidateQueries({queryKey:j}),e.invalidateQueries({queryKey:[...M,i]}),n({backendKind:t.backend.kind})}})}var ue=[`automation-health`];function de(){let e=u();return c({queryKey:[...ue,e.backend.id,e.orgId],queryFn:()=>m.checkHealth(),staleTime:30*1e3,retry:!1})}var fe=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 20 20`,...e,children:(0,k.jsx)(`path`,{d:`M10 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z`})}),P=f(`inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,y),F=f(`inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border-0 bg-transparent px-2 text-xs text-muted hover:bg-interactive-hover hover:text-white focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-muted`,y);function I({icon:e,label:t}){return(0,k.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,k.jsx)(`span`,{className:f(`[&_svg]:size-4`,b),"aria-hidden":!0,children:e}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}function L({items:e}){let{t}=a(`openhands`),[n,r]=(0,D.useState)(!1),[i,o]=(0,D.useState)(),s=(0,D.useRef)(null),c=(0,D.useRef)(null);(0,D.useLayoutEffect)(()=>{if(!n||!s.current)return;let e=()=>{let e=s.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[n]),(0,D.useEffect)(()=>{if(!n)return;let e=e=>{let t=e.target;s.current?.contains(t)||c.current?.contains(t)||r(!1)},t=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]);let l=n&&i?(0,k.jsx)(S,{ref:c,theme:`popover`,className:`min-w-[10rem]`,children:e.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsx)(C,{onClick:t=>{t.stopPropagation(),e.onClick(),r(!1)},isDisabled:e.disabled,className:`group`,children:(0,k.jsx)(I,{icon:e.icon,label:e.label})})},e.label))}):null;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{ref:s,type:`button`,onClick:e=>{e.stopPropagation(),r(e=>!e)},className:P,"aria-label":t(p.AUTOMATIONS$ACTIONS_MENU),"aria-expanded":n,"aria-haspopup":`menu`,children:(0,k.jsx)(fe,{className:`size-4`})}),n&&i&&typeof document<`u`?O.createPortal((0,k.jsx)(`div`,{style:i,children:l}),document.body):null]})}function R(e){return!0}var z=e=>(0,k.jsxs)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,k.jsx)(`g`,{clipPath:`url(#clip0_8467_30872)`,children:(0,k.jsx)(`path`,{d:`M6.26693 21.4874L6.25583 21.4951L6.24514 21.5033C5.95991 21.7227 5.5 21.5308 5.5 21.0996V2.89961C5.5 2.4684 5.95991 2.2765 6.24514 2.49592L6.25634 2.50452L6.26799 2.51249L19.518 11.5625L19.518 11.5625L19.5226 11.5656C19.8258 11.7677 19.8258 12.1815 19.5226 12.3836L19.5226 12.3835L19.5169 12.3874L6.26693 21.4874Z`,fill:`currentColor`,stroke:`currentColor`})}),(0,k.jsx)(`defs`,{children:(0,k.jsx)(`clipPath`,{id:`clip0_8467_30872`,children:(0,k.jsx)(`rect`,{width:24,height:24,fill:`white`})})})]}),B=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),V=e=>(0,k.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,k.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.4375 9C2.4375 5.37563 5.37563 2.4375 9 2.4375C12.6244 2.4375 15.5625 5.37563 15.5625 9C15.5625 12.6244 12.6244 15.5625 9 15.5625C5.37563 15.5625 2.4375 12.6244 2.4375 9ZM4.13812 6.5625C4.81317 5.21867 6.02897 4.19333 7.49996 3.77204C7.15155 4.17641 6.85182 4.65395 6.60713 5.17892C6.40828 5.60556 6.24263 6.06975 6.11494 6.5625H4.13812ZM3.72196 7.6875C3.61778 8.10783 3.5625 8.54746 3.5625 9C3.5625 9.45254 3.61778 9.89217 3.72196 10.3125H5.89738C5.84161 9.88758 5.8125 9.44852 5.8125 8.99998C5.8125 8.55142 5.84161 8.11239 5.89737 7.6875H3.72196ZM7.0333 7.6875C6.97087 8.10689 6.9375 8.54634 6.9375 8.99998C6.9375 9.45367 6.97087 9.89313 7.0333 10.3125H10.9667C11.0291 9.89311 11.0625 9.45367 11.0625 9.00002C11.0625 8.54637 11.0291 8.1069 10.9667 7.6875H7.0333ZM12.1026 7.6875C12.1584 8.1124 12.1875 8.55145 12.1875 9.00002C12.1875 9.44858 12.1584 9.88762 12.1026 10.3125H14.278C14.3822 9.89217 14.4375 9.45254 14.4375 9C14.4375 8.54746 14.3822 8.10783 14.278 7.6875H12.1026ZM13.8619 6.5625H11.885C11.7574 6.06976 11.5917 5.6056 11.3929 5.17897C11.1482 4.65397 10.8484 4.1764 10.5 3.77203C11.971 4.19331 13.1868 5.21866 13.8619 6.5625ZM10.7171 6.5625H7.28293C7.38007 6.23971 7.49559 5.93571 7.62681 5.65419C7.99835 4.85708 8.48101 4.26914 8.99997 3.92442C9.51895 4.26913 10.0016 4.8571 10.3732 5.65424C10.5044 5.93575 10.6199 6.23973 10.7171 6.5625ZM4.13812 11.4375H6.11496C6.24963 11.9572 6.42655 12.4452 6.64015 12.8909C6.87835 13.3879 7.16685 13.8413 7.50006 14.228C6.02902 13.8067 4.81318 12.7814 4.13812 11.4375ZM10.7171 11.4375H7.28295C7.3869 11.7829 7.51191 12.1068 7.65465 12.4047C8.02305 13.1733 8.49456 13.7398 9.00007 14.0756C9.51902 13.7308 10.0017 13.1429 10.3732 12.3458C10.5044 12.0643 10.6199 11.7603 10.7171 11.4375ZM11.3929 12.8211C11.5917 12.3944 11.7574 11.9303 11.8851 11.4375H13.8619C13.1868 12.7813 11.971 13.8067 10.5 14.228C10.8485 13.8236 11.1482 13.346 11.3929 12.8211Z`,fill:`currentColor`})}),pe=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z`})}),me=/^(\d+)$/;function H(e,t,n){let r=e.match(me);if(!r)return null;let i=Number(r[1]);return Number.isNaN(i)||i<t||i>n?null:i}function he(e){let t=(e??``).trim();if(!t)return{kind:`custom`,raw:``};let n=t.split(/\s+/);if(n.length!==5)return{kind:`custom`,raw:t};let[r,i,a,o,s]=n,c=H(r,0,59),l=H(i,0,23);if(c===null||l===null)return{kind:`custom`,raw:t};if(a!==`*`||o!==`*`)return{kind:`custom`,raw:t,hour:l,minute:c};if(s===`*`||s===`0-6`)return{kind:`daily`,hour:l,minute:c};if(s===`1-5`)return{kind:`weekdays`,hour:l,minute:c};let u=H(s,0,6);return u===null?{kind:`custom`,raw:t,hour:l,minute:c}:{kind:`weekly`,hour:l,minute:c,weekday:u}}function ge(e){let{kind:t,hour:n,minute:r,weekday:i}=e;switch(t){case`daily`:return`${r} ${n} * * *`;case`weekdays`:return`${r} ${n} * * 1-5`;case`weekly`:return`${r} ${n} * * ${i??1}`;default:return t}}function U(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function W(e){let t=e.match(/^(\d{1,2}):(\d{2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return Number.isNaN(n)||Number.isNaN(r)||n<0||n>23||r<0||r>59?null:{hour:n,minute:r}}function G(e){return e?Array.isArray(e)?e.join(`, `):e:`—`}var _e=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5.636 5.636a9 9 0 1012.728 0M12 3v9`})}),ve=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})}),K=e=>(0,k.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,...e,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z`})});function ye({onRetry:e}){let{t}=a(`openhands`);return(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,k.jsx)(K,{className:`size-12 text-danger`}),(0,k.jsx)(`p`,{className:`mt-4 text-sm text-muted`,children:t(p.AUTOMATIONS$ERROR_TITLE)}),(0,k.jsx)(`button`,{type:`button`,onClick:e,className:`mt-4 rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:t(p.AUTOMATIONS$ERROR_RETRY)})]})}function be({onRetry:e}){let{t}=a(`openhands`);return(0,k.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 px-4`,children:[(0,k.jsx)(K,{className:`size-12 text-[var(--oh-warning)]`}),(0,k.jsx)(`h2`,{className:`mt-4 text-lg font-medium text-content`,children:t(p.AUTOMATIONS$BACKEND_UNAVAILABLE_TITLE)}),(0,k.jsx)(`p`,{className:`mt-2 text-sm text-muted text-center max-w-md`,children:t(p.AUTOMATIONS$BACKEND_UNAVAILABLE_MESSAGE)}),(0,k.jsx)(v,{type:`button`,variant:`secondary`,className:`mt-6`,onClick:e,children:t(p.AUTOMATIONS$BACKEND_UNAVAILABLE_RETRY)})]})}function xe({automationName:e,isOpen:t,onConfirm:n,onCancel:r}){let{t:i}=a(`openhands`);return t?(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,k.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,k.jsxs)(`div`,{className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(p.BUTTON$CLOSE),children:(0,k.jsx)(T,{className:`size-5`})}),(0,k.jsx)(`h2`,{className:g,children:i(p.AUTOMATIONS$DELETE_CONFIRM_TITLE)}),(0,k.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:i(p.AUTOMATIONS$DELETE_CONFIRM_MESSAGE,{name:e})}),(0,k.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:i(p.AUTOMATIONS$CANCEL)}),(0,k.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:i(p.AUTOMATIONS$DELETE)})]})]})]}):null}var Se=1800;function Ce(e){let t=e.trim();if(!t)return{value:null};let n=Number(t);return Number.isInteger(n)?n<=0?{errorKey:p.AUTOMATIONS$ERROR_TIMEOUT_POSITIVE}:n>1800?{errorKey:p.AUTOMATIONS$ERROR_TIMEOUT_MAX_EXCEEDED}:{value:n}:{errorKey:p.AUTOMATIONS$ERROR_TIMEOUT_INVALID_NUMBER}}var q=`__active__`,we=[p.AUTOMATIONS$WEEKDAY_SUN,p.AUTOMATIONS$WEEKDAY_MON,p.AUTOMATIONS$WEEKDAY_TUE,p.AUTOMATIONS$WEEKDAY_WED,p.AUTOMATIONS$WEEKDAY_THU,p.AUTOMATIONS$WEEKDAY_FRI,p.AUTOMATIONS$WEEKDAY_SAT];function Te(e){let t=e.timeout==null?``:String(e.timeout);if(e.trigger.type===`event`)return{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:``,isCustomSchedule:!0,rawSchedule:``,timeout:t};let n=he(e.trigger.schedule);return n.kind===`custom`?{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:n.hour!==void 0&&n.minute!==void 0?U(n.hour,n.minute):``,isCustomSchedule:!0,rawSchedule:n.raw,timeout:t}:{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:n.kind,weekday:n.kind===`weekly`?n.weekday??1:1,timeOfDay:U(n.hour,n.minute),isCustomSchedule:!1,rawSchedule:e.trigger.schedule??``,timeout:t}}function J({automation:e,isOpen:t,onClose:n}){let{t:r}=a(`openhands`),i=se(),{data:o,isLoading:s}=te(),c=o?.profiles??[],u=[{key:q,label:r(p.COMMON$ACTIVE_PROFILE)},...c.map(e=>({key:e.name,label:e.name}))],m=(0,D.useMemo)(()=>Te(e),[e]),[h,y]=(0,D.useState)(m),[b,S]=(0,D.useState)(null),[C,E]=(0,D.useState)(null);if((0,D.useEffect)(()=>{t&&(y(m),S(null),E(null))},[t,m]),!t)return null;let O=[{key:`daily`,label:r(p.AUTOMATIONS$FREQUENCY_DAILY)},{key:`weekdays`,label:r(p.AUTOMATIONS$FREQUENCY_WEEKDAYS)},{key:`weekly`,label:r(p.AUTOMATIONS$FREQUENCY_WEEKLY)},...h.isCustomSchedule?[{key:`custom`,label:r(p.AUTOMATIONS$FREQUENCY_CUSTOM)}]:[]],j=we.map((e,t)=>({key:String(t),label:r(e)})),M=!h.isCustomSchedule||W(h.timeOfDay)!==null||h.timeOfDay===``;return(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,k.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`presentation`}),(0,k.jsxs)(`div`,{className:`relative w-full max-w-md rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":r(p.AUTOMATIONS$CANCEL),children:(0,k.jsx)(T,{className:`size-5`})}),(0,k.jsx)(`h2`,{className:g,children:r(p.AUTOMATIONS$EDIT_TITLE)}),(0,k.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let a=h.name.trim();if(!a){S(r(p.AUTOMATIONS$NAME_REQUIRED));return}S(null);let o=Ce(h.timeout);if(`errorKey`in o){E(r(o.errorKey));return}E(null);let s={};a!==e.name&&(s.name=a);let c=h.prompt.trim();c!==(e.prompt??``).trim()&&(s.prompt=c.length===0?null:c);let u=h.model.trim();if(u!==(e.model??``)&&(s.model=u===``?null:u),(o.value??null)!==(e.timeout??null)&&(s.timeout=o.value),!h.isCustomSchedule&&h.frequency!==`custom`){let t=W(h.timeOfDay);if(t){let n=ge({kind:h.frequency,hour:t.hour,minute:t.minute,weekday:h.frequency===`weekly`?h.weekday:void 0});n!==e.trigger.schedule&&(s.trigger={...e.trigger,schedule:n})}}if(Object.keys(s).length===0){n();return}i.mutate({id:e.id,body:s},{onSuccess:()=>{l(r(p.AUTOMATIONS$EDIT_SUCCESS)),n()},onError:e=>{d(A(e,r(p.AUTOMATIONS$EDIT_ERROR)))}})},noValidate:!0,className:`mt-4 flex flex-col gap-4`,"aria-label":r(p.AUTOMATIONS$EDIT_TITLE),children:[(0,k.jsx)(x,{testId:`edit-automation-name`,name:`name`,type:`text`,label:r(p.AUTOMATIONS$NAME),value:h.name,onChange:e=>y(t=>({...t,name:e})),error:b??void 0,showRequiredTag:!0}),(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:r(p.AUTOMATIONS$PROMPT)}),(0,k.jsx)(`textarea`,{"data-testid":`edit-automation-prompt`,name:`prompt`,value:h.prompt,onChange:e=>y(t=>({...t,prompt:e.target.value})),rows:4,className:f(ee,`placeholder:italic`)}),(0,k.jsx)(`span`,{className:`text-xs text-muted`,children:r(p.AUTOMATIONS$EDIT_PROMPT_HINT)})]}),(s||c.length>0)&&(0,k.jsx)(w,{testId:`edit-automation-model`,name:`model`,label:r(p.AUTOMATIONS$DETAIL$MODEL),items:u,selectedKey:h.model||q,isLoading:s,placeholder:r(p.COMMON$ACTIVE_PROFILE),onSelectionChange:e=>y(t=>({...t,model:e&&e!==q?String(e):``}))}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(x,{testId:`edit-automation-timeout`,name:`timeout`,type:`number`,label:r(p.AUTOMATIONS$TIMEOUT),value:h.timeout,onChange:e=>y(t=>({...t,timeout:e})),error:C??void 0,showOptionalTag:!0,min:1,max:Se,step:1,placeholder:`600`}),(0,k.jsx)(`span`,{"data-testid":`edit-automation-timeout-hint`,className:`text-xs text-muted`,children:r(p.AUTOMATIONS$TIMEOUT_HINT)})]}),e.trigger.type===`event`?(0,k.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg bg-[var(--oh-surface-raised)] p-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(p.AUTOMATIONS$DETAIL$TRIGGER)}),(0,k.jsx)(`span`,{className:`text-sm text-content`,children:r(p.AUTOMATIONS$DETAIL$TRIGGER_EVENT)})]}),e.trigger.source&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(p.AUTOMATIONS$DETAIL$EVENT_SOURCE)}),(0,k.jsx)(`span`,{className:`text-sm text-content`,children:e.trigger.source})]}),e.trigger.on&&(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(p.AUTOMATIONS$DETAIL$EVENT_TYPE)}),(0,k.jsx)(`code`,{className:`text-xs font-mono text-content`,children:G(e.trigger.on)})]}),e.trigger.filter&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:r(p.AUTOMATIONS$DETAIL$EVENT_FILTER)}),(0,k.jsx)(`code`,{className:`text-xs font-mono text-content break-all`,children:e.trigger.filter})]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(w,{testId:`edit-automation-frequency`,name:`frequency`,label:r(p.AUTOMATIONS$FREQUENCY),items:O,selectedKey:h.frequency,isDisabled:h.isCustomSchedule,onSelectionChange:e=>{!e||h.isCustomSchedule||y(t=>({...t,frequency:e}))}}),h.frequency===`weekly`&&!h.isCustomSchedule&&(0,k.jsx)(w,{testId:`edit-automation-weekday`,name:`weekday`,label:r(p.AUTOMATIONS$WEEKDAY),items:j,selectedKey:String(h.weekday),onSelectionChange:e=>{e!==null&&y(t=>({...t,weekday:Number(e)}))}}),(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:r(p.AUTOMATIONS$TIME_OF_DAY)}),(0,k.jsx)(`input`,{"data-testid":`edit-automation-time`,name:`timeOfDay`,type:`time`,value:h.timeOfDay,onChange:e=>y(t=>({...t,timeOfDay:e.target.value})),disabled:h.isCustomSchedule&&!M,className:f(_,`disabled:bg-[var(--oh-surface-raised)]`)}),e.timezone&&(0,k.jsxs)(`span`,{className:`text-xs text-muted`,children:[r(p.AUTOMATIONS$TIMEZONE),`: `,e.timezone]})]}),h.isCustomSchedule&&(0,k.jsxs)(`p`,{className:`text-xs text-muted`,"data-testid":`custom-schedule-hint`,children:[r(p.AUTOMATIONS$CUSTOM_SCHEDULE_HINT),h.rawSchedule&&(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.jsx)(`code`,{className:`text-xs text-content`,children:h.rawSchedule})]})]})]}),(0,k.jsxs)(`div`,{className:`mt-2 flex justify-end gap-3`,children:[(0,k.jsx)(v,{testId:`edit-automation-cancel`,type:`button`,variant:`secondary`,onClick:n,isDisabled:i.isPending,children:r(p.AUTOMATIONS$CANCEL)}),(0,k.jsx)(v,{testId:`edit-automation-save`,type:`submit`,variant:`primary`,isDisabled:i.isPending,"aria-busy":i.isPending,children:i.isPending?r(p.AUTOMATIONS$SAVING):r(p.AUTOMATIONS$SAVE)})]})]})]})]})}var Y=new Set([`cron`,`schedule`,`event`]),X=class extends Error{issues;constructor(e){super(e.join(`
|
|
2
|
-
`)),this.name=`AutomationFileValidationError`,this.issues=e}};function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e,t,n,r){let i=e[t];if(typeof i!=`string`||i.trim().length===0){r.push(`${n}: expected a non-empty string`);return}return i}function $(e,t,n,r){let i=e[t];if(i!==void 0){if(typeof i!=`string`){r.push(`${n}: expected a string`);return}return i}}function Ee(e,t){if(!Z(e)){t.push(`spec.trigger: expected an object`);return}let n=Q(e,`type`,`spec.trigger.type`,t);n&&!Y.has(n)&&t.push(`spec.trigger.type: expected one of "cron", "schedule", or "event"`);let r=$(e,`schedule`,`spec.trigger.schedule`,t),i=$(e,`schedule_human`,`spec.trigger.schedule_human`,t),a=$(e,`timezone`,`spec.trigger.timezone`,t),o=$(e,`source`,`spec.trigger.source`,t),s=$(e,`filter`,`spec.trigger.filter`,t),c;if(e.on!==void 0&&(typeof e.on==`string`||Array.isArray(e.on)&&e.on.length>0&&e.on.every(e=>typeof e==`string`&&e.trim().length>0)?c=e.on:t.push(`spec.trigger.on: expected a string or a non-empty array of strings`)),(n===`cron`||n===`schedule`)&&!r?.trim()&&t.push(`spec.trigger.schedule: required for a scheduled trigger`),n===`event`&&(o?.trim()||t.push(`spec.trigger.source: required for an event trigger`),(c===void 0||typeof c==`string`&&c.trim().length===0)&&t.push(`spec.trigger.on: required for an event trigger`)),!(!n||!Y.has(n)))return{type:n,...r!==void 0&&{schedule:r},...i!==void 0&&{schedule_human:i},...a!==void 0&&{timezone:a},...o!==void 0&&{source:o},...c!==void 0&&{on:c},...s!==void 0&&{filter:s}}}function De(e){let t=e.timezone??e.trigger.timezone;return{version:1,kind:`automation`,spec:{name:e.name,trigger:{...e.trigger},enabled:e.enabled,prompt:e.prompt,...e.repository!==void 0&&{repository:e.repository},...e.model!==void 0&&{model:e.model},...e.timeout!=null&&{timeout:e.timeout},...e.branch!==void 0&&{branch:e.branch},...e.plugins!==void 0&&{plugins:[...e.plugins]},...e.notification!==void 0&&{notification:e.notification},...t!==void 0&&{timezone:t}}}}function Oe(e){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}.automation.json`}function ke(e){let t=[];if(!Z(e))throw new X([`file: expected a JSON object`]);if(e.version!==1&&t.push(`version: expected 1`),e.kind!==`automation`&&t.push(`kind: expected "automation"`),!Z(e.spec))throw t.push(`spec: expected an object`),new X(t);let n=Q(e.spec,`name`,`spec.name`,t),r=Q(e.spec,`prompt`,`spec.prompt`,t),i=Ee(e.spec.trigger,t),a=e.spec.enabled;typeof a!=`boolean`&&t.push(`spec.enabled: expected a boolean`);let o=$(e.spec,`repository`,`spec.repository`,t),s=$(e.spec,`branch`,`spec.branch`,t),c=$(e.spec,`notification`,`spec.notification`,t),l=$(e.spec,`timezone`,`spec.timezone`,t),u;e.spec.model===null||e.spec.model===void 0||typeof e.spec.model==`string`&&e.spec.model.trim().length>0?u=e.spec.model:t.push(`spec.model: expected a non-empty string or null`);let d;e.spec.timeout===null||e.spec.timeout===void 0||typeof e.spec.timeout==`number`&&Number.isInteger(e.spec.timeout)&&e.spec.timeout>0?d=e.spec.timeout:t.push(`spec.timeout: expected a positive integer`);let f;if(e.spec.plugins!==void 0&&(Array.isArray(e.spec.plugins)&&e.spec.plugins.every(e=>typeof e==`string`&&e.trim().length>0)?f=[...e.spec.plugins]:t.push(`spec.plugins: expected an array of non-empty strings`)),t.length>0||!n||!r||!i)throw new X(t);return{name:n,prompt:r,trigger:i,enabled:a,...o!==void 0&&{repository:o},...u!==void 0&&{model:u},...d!==void 0&&{timeout:d},...s!==void 0&&{branch:s},...f!==void 0&&{plugins:f},...c!==void 0&&{notification:c},...l!==void 0&&{timezone:l}}}export{le as C,re as D,ne as E,A as O,ce as S,ae as T,L as _,xe as a,de as b,K as c,G as d,pe as f,R as g,z as h,J as i,ve as l,B as m,ke as n,be as o,V as p,De as r,ye as s,Oe as t,_e as u,P as v,oe as w,ie as x,F as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{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{E as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as s}from"./Trans-DP5rcauH.js";import{at as c,it as l,n as u,rt as d}from"./active-backend-context-BlZPzZNU.js";import{i as f,t as p,z as m}from"./utils-qjs_KuS4.js";import{t as h}from"./check-BMOG005H.js";import{t as g}from"./use-tracking-CN1nIMnY.js";import{t as _}from"./modal-backdrop-X-vKo61e.js";import{n as v}from"./modal-classes-YaEEa5eZ.js";import{t as y}from"./brand-button-CQO8oqVo.js";import{n as b}from"./navigation-context-BOGzIng3.js";import{t as x}from"./styled-tooltip-DsjDnR_W.js";import{u as S}from"./dropdown-classes-DQlj-MpS.js";import{t as C}from"./modal-close-button-turIYn0t.js";import{n as w,t as T}from"./context-menu-list-item-BTHGFhIx.js";import{t as E}from"./u-edit-809W9D9T.js";import{t as D}from"./folder-C86qXV7M.js";import{t as O}from"./search-7DRiGm4Z.js";import{a as k,i as A,n as j,o as M,r as N,t as ee}from"./extension-module-card-classes-Bo43vY5V.js";import{n as te,t as ne}from"./recommended-automations-launcher-BF2mtAKw.js";import{n as P}from"./skill-card-pill-row-D7XCz5uk.js";import{n as re,t as F}from"./use-launch-skill-in-chat-DKzCTMt0.js";import{C as ie,O as I,S as ae,T as oe,_ as L,a as se,b as ce,d as R,f as z,g as B,h as V,i as le,l as H,m as U,n as ue,o as de,p as W,r as fe,s as pe,t as me,u as G,v as K,w as he,x as ge,y as q}from"./automation-export-Bu-r-EzL.js";var _e=o(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ve=o(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ye=o(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),be=o(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),xe=o(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),J=e(t(),1),Y=r();function Se({value:e,onChange:t,className:n}){let{t:r}=a(`openhands`);return(0,Y.jsxs)(`div`,{className:p(`relative flex min-w-0 flex-1 items-center`,`h-9 rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`,n),children:[(0,Y.jsx)(O,{className:`ml-3 size-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Y.jsx)(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:r(m.AUTOMATIONS$SEARCH_PLACEHOLDER),"aria-label":r(m.AUTOMATIONS$SEARCH_PLACEHOLDER),className:`min-w-0 flex-1 border-0 bg-transparent px-3 text-sm text-white outline-none placeholder:text-tertiary-alt`})]})}function X(e,t){let n=[];if(e.repository&&n.push({id:`repository`,node:(0,Y.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Y.jsx)(D,{className:`size-3 shrink-0`}),e.repository]})}),e.trigger.type===`event`){let t=[e.trigger.on?R(e.trigger.on):``,e.trigger.source?`(${e.trigger.source})`:``].filter(Boolean).join(` `);n.push({id:`event-trigger`,node:(0,Y.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Y.jsx)(W,{className:`size-3 shrink-0`}),t]})})}else n.push({id:`schedule`,node:(0,Y.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Y.jsx)(U,{className:`size-3 shrink-0`}),t]})});return e.model&&n.push({id:`model`,node:(0,Y.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Y.jsx)(z,{className:`size-3 shrink-0`}),e.model]})}),n}function Ce({automation:e,t,canManage:n,onRunNow:r,isRunPending:i,onView:a,onExport:o,onEdit:s,onToggle:c,onDelete:l}){return[...n?[{label:t(m.AUTOMATIONS$RUN_NOW),icon:(0,Y.jsx)(V,{className:`size-4`}),onClick:()=>r(e.id),disabled:i||!e.enabled}]:[],{label:t(m.COMMON$VIEW),icon:(0,Y.jsx)(ve,{className:`size-4`,"aria-hidden":!0}),onClick:a},{label:t(m.AUTOMATIONS$EXPORT),icon:(0,Y.jsx)(_e,{className:`size-4`,"aria-hidden":!0}),onClick:()=>o(e)},...n&&s?[{label:t(m.AUTOMATIONS$EDIT),icon:(0,Y.jsx)(E,{className:`size-4`}),onClick:()=>s(e.id)}]:[],...n?[{label:e.enabled?t(m.AUTOMATIONS$TURN_OFF):t(m.AUTOMATIONS$TURN_ON),icon:(0,Y.jsx)(G,{className:`size-4`}),onClick:()=>c(e.id,e.enabled)},{label:t(m.AUTOMATIONS$DELETE),icon:(0,Y.jsx)(H,{className:`size-4`}),onClick:()=>l(e.id)}]:[]]}function we({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onExport:o,onEdit:s}){let{navigate:c}=b(),{t:l}=a(`openhands`),u=B(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,f=(0,J.useMemo)(()=>X(e,d),[e,d]),h=()=>{c?.(`/automations/${e.id}`)},g=Ce({automation:e,t:l,canManage:u,onRunNow:n,isRunPending:r,onView:h,onExport:o,onEdit:s,onToggle:t,onDelete:i}),_=()=>{h()};return(0,Y.jsxs)(`div`,{role:`link`,tabIndex:0,"data-testid":`automation-card-${e.id}`,onClick:_,onKeyDown:e=>{e.key===`Enter`&&_()},className:p(`flex min-w-0 flex-col gap-3 overflow-hidden p-4 text-left`,k,N),children:[(0,Y.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-2 truncate text-sm font-semibold text-white`,children:[e.trigger.type===`event`?(0,Y.jsx)(W,{className:`size-4 shrink-0 text-muted`}):(0,Y.jsx)(U,{className:`size-4 shrink-0 text-muted`}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.prompt?(0,Y.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.prompt}):null]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[u?(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:q,children:[(0,Y.jsx)(V,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),l(m.AUTOMATIONS$RUN_NOW)]}):null,(0,Y.jsx)(L,{items:g})]})]}),f.length>0?(0,Y.jsx)(P,{pills:f,testId:`automation-pills-${e.id}`}):null]})}var Te=`overflow-hidden rounded-md border border-[var(--oh-border)] bg-base-secondary`,Ee=[`h-11`,`border-t border-[var(--oh-border)] transition-colors`].join(` `),De=`hover:bg-interactive-hover-low outline-none focus:outline-none focus-visible:outline-none focus-visible:bg-interactive-hover-low`,Oe=`px-3 align-middle`,ke=[Ee,De,`cursor-pointer`].join(` `),Ae=`openhands-automations-view`;function je(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function Me(e){window.localStorage.setItem(Ae,e)}function Ne({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onExport:o,onEdit:s}){let{navigate:c}=b(),{t:l}=a(`openhands`),u=B(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,f=(0,J.useMemo)(()=>X(e,d),[e,d]),h=()=>{c?.(`/automations/${e.id}`)},g=Ce({automation:e,t:l,canManage:u,onRunNow:n,isRunPending:r,onView:h,onExport:o,onEdit:s,onToggle:t,onDelete:i}),_=()=>{h()};return(0,Y.jsxs)(`tr`,{"data-testid":`automation-list-row-${e.id}`,onClick:_,onKeyDown:e=>{e.key===`Enter`&&_()},tabIndex:0,className:p(ke,`cursor-pointer`),children:[(0,Y.jsx)(`td`,{className:Oe,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.trigger.type===`event`?(0,Y.jsx)(W,{className:`size-4 shrink-0 text-muted`}):(0,Y.jsx)(U,{className:`size-4 shrink-0 text-muted`}),(0,Y.jsx)(`span`,{className:`max-w-[40%] shrink-0 truncate text-sm font-medium text-white`,title:e.name,children:e.name}),f.length>0?(0,Y.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Y.jsx)(P,{pills:f,testId:`automation-pills-${e.id}`})}):null]})}),(0,Y.jsx)(`td`,{className:p(`w-0 whitespace-nowrap`,Oe),children:(0,Y.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[u?(0,Y.jsx)(x,{content:l(m.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":l(m.AUTOMATIONS$RUN_NOW),"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:K,children:(0,Y.jsx)(V,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,Y.jsx)(L,{items:g})]})})]})}function Pe({title:e,count:t,automations:n,view:r,onToggle:i,onRunNow:a,runPendingId:o=null,onDelete:s,onExport:c,onEdit:l}){return n.length===0?null:(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center`,children:[(0,Y.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e}),(0,Y.jsx)(te,{count:t})]}),r===`grid`?(0,Y.jsx)(`div`,{className:p(`mt-3`,j),children:(0,Y.jsx)(`div`,{className:ee,children:n.map(e=>(0,Y.jsx)(we,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onExport:c,onEdit:l},e.id))})}):(0,Y.jsx)(`div`,{className:p(Te,`mt-3`),children:(0,Y.jsx)(`table`,{className:`w-full min-w-full [&>tbody>tr:first-child]:border-t-0`,children:(0,Y.jsx)(`tbody`,{children:n.map(e=>(0,Y.jsx)(Ne,{automation:e,onToggle:i,onRunNow:a,isRunPending:o===e.id,onDelete:s,onExport:c,onEdit:l},e.id))})})})]})}var Fe=e(n(),1);function Ie({icon:e,label:t,isSelected:n}){return(0,Y.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:S,"aria-hidden":!0,children:(0,Y.jsx)(e,{})}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,Y.jsx)(h,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}var Z=[{value:`grid`,icon:be,labelKey:m.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:xe,labelKey:m.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function Le({view:e,onChange:t,disabled:n=!1}){let{t:r}=a(`openhands`),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d=(Z.find(t=>t.value===e)??Z[0]).icon;(0,J.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&c({position:`fixed`,zIndex:9999,top:e.bottom+4,right:window.innerWidth-e.right})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[i]),(0,J.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.current?.contains(t)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let f=i&&s?(0,Y.jsx)(w,{ref:u,theme:`popover`,className:`min-w-[10rem]`,children:Z.map(n=>(0,Y.jsx)(`li`,{children:(0,Y.jsx)(T,{testId:n.testId,onClick:()=>{t(n.value),o(!1)},className:`group`,children:(0,Y.jsx)(Ie,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{ref:l,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(m.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||o(e=>!e)},className:p(`inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-[var(--oh-border)] bg-base-secondary text-white transition-colors hover:bg-[var(--oh-interactive-hover)] focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-base-secondary`),children:(0,Y.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),i&&s&&typeof document<`u`?Fe.createPortal((0,Y.jsx)(`div`,{style:s,children:f}),document.body):null]})}function Re(){return(0,Y.jsxs)(`div`,{"data-testid":`automation-card-skeleton`,className:`${k} border border-transparent p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Y.jsx)(`div`,{className:`h-5 w-40 animate-pulse rounded bg-surface-raised`}),(0,Y.jsx)(`div`,{className:`h-5 w-10 animate-pulse rounded-full bg-surface-raised`})]}),(0,Y.jsx)(`div`,{className:`mt-2 h-4 w-72 animate-pulse rounded bg-surface-raised`}),(0,Y.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,Y.jsx)(`div`,{className:`h-7 w-32 animate-pulse rounded-full bg-surface-raised`}),(0,Y.jsx)(`div`,{className:`h-7 w-28 animate-pulse rounded-full bg-surface-raised`}),(0,Y.jsx)(`div`,{className:`h-7 w-24 animate-pulse rounded-full bg-surface-raised`})]})]})}var ze=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})}),Be=`https://docs.openhands.dev/openhands/usage/automations/overview`;function Ve({children:e}){return(0,Y.jsx)(`span`,{className:`whitespace-nowrap`,children:e})}function He({children:e}){return(0,Y.jsx)(`code`,{"data-testid":`automations-create-instructions-example`,className:p(`mx-0.5 inline-block rounded-sm border border-[var(--oh-border-subtle)]`,`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 align-baseline font-mono text-[11px] text-white`),children:e})}function Ue({children:e}){return(0,Y.jsx)(Y.Fragment,{children:e})}var We={example:(0,Y.jsx)(Ve,{}),cmd:(0,Y.jsx)(He,{}),punct:(0,Y.jsx)(Ue,{})};function Q({onLaunch:e}={}){let{t}=a(`openhands`),n=F(),r=u(),{trackAutomationCreatedButton:i}=g();return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[(0,Y.jsx)(s,{ns:`openhands`,i18nKey:m.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC,components:We}),` `,t(m.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE)]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Y.jsx)(`a`,{href:Be,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-muted underline transition-colors hover:text-foreground`,children:t(m.AUTOMATIONS$EMPTY_LEARN_MORE)}),(0,Y.jsx)(y,{type:`button`,variant:`primary`,testId:`automations-create-automation`,onClick:()=>{i({backendKind:r.backend.kind}),n(t(m.AUTOMATIONS$CREATE_AUTOMATION_PROMPT),e)},startContent:(0,Y.jsx)(re,{className:`size-4`,"aria-hidden":!0}),children:t(m.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})]})]})}function Ge({collapsible:e=!1}){let{t}=a(`openhands`),[n,r]=(0,J.useState)(!e);return e?(0,Y.jsxs)(`div`,{className:`w-full rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`flex w-full items-center justify-between rounded-lg p-4 text-left transition-colors hover:bg-surface-raised`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-normal text-content`,children:t(m.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,Y.jsx)(ze,{className:p(`size-5 text-muted transition-transform`,n&&`rotate-180`)})]}),n?(0,Y.jsx)(`div`,{className:`px-4 pb-4`,children:(0,Y.jsx)(Q,{})}):null]}):(0,Y.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[(0,Y.jsx)(`h3`,{className:`text-center text-sm font-medium text-content`,children:t(m.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,Y.jsx)(`div`,{className:`mt-4`,children:(0,Y.jsx)(Q,{})})]})}function Ke(){let{t:e}=a(`openhands`);return(0,Y.jsxs)(`div`,{"data-testid":`automations-empty`,className:M,children:[(0,Y.jsx)(`p`,{className:`text-sm text-white`,children:e(m.AUTOMATIONS$EMPTY)}),(0,Y.jsx)(`p`,{className:`mt-1 text-xs text-tertiary-light`,children:e(m.AUTOMATIONS$EMPTY_HINT)}),(0,Y.jsx)(`div`,{className:`mt-8 flex justify-center border-t border-[var(--oh-border)] pt-8`,children:(0,Y.jsx)(Ge,{})})]})}function qe({isOpen:e,onClose:t}){let{t:n}=a(`openhands`);return e?(0,Y.jsx)(_,{onClose:t,"aria-label":n(m.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE),children:(0,Y.jsxs)(`div`,{"data-testid":`add-automation-modal`,className:`relative flex w-full max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Y.jsx)(C,{onClose:t,testId:`add-automation-modal-close`}),(0,Y.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,Y.jsx)(`h2`,{id:`add-automation-modal-title`,className:p(`pr-6`,v),children:n(m.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)})}),(0,Y.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Y.jsx)(Q,{onLaunch:t})})]})}):null}function $({label:e,value:t}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted`,children:e}),(0,Y.jsx)(`dd`,{className:`whitespace-pre-wrap break-words text-sm text-content`,children:t})]})}function Je({isOpen:e,spec:t,isImporting:n,onClose:r,onImport:i}){let{t:o}=a(`openhands`);if(!e||!t)return null;let s=t.trigger.type===`event`?[t.trigger.source,R(t.trigger.on)].filter(Boolean).join(`: `):[t.trigger.schedule_human??t.trigger.schedule,t.timezone??t.trigger.timezone].filter(Boolean).join(` · `);return(0,Y.jsx)(_,{onClose:n?void 0:r,closeOnEscape:!n,closeOnBackdropClick:!n,"aria-label":o(m.AUTOMATIONS$IMPORT),children:(0,Y.jsxs)(`div`,{"data-testid":`import-automation-modal`,className:`relative flex max-h-[85vh] w-[min(36rem,calc(100vw-2rem))] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Y.jsx)(C,{onClose:r,testId:`import-automation-modal-close`,disabled:n}),(0,Y.jsxs)(`header`,{className:`px-6 pb-4 pt-6`,children:[(0,Y.jsx)(`h2`,{className:p(`pr-6`,v),children:o(m.AUTOMATIONS$IMPORT)}),(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-tertiary-light`,children:o(m.AUTOMATIONS$IMPORT_PREVIEW_DESCRIPTION)})]}),(0,Y.jsxs)(`dl`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto border-y border-[var(--oh-border)] px-6 py-5`,children:[(0,Y.jsx)($,{label:o(m.AUTOMATIONS$NAME),value:t.name}),(0,Y.jsx)($,{label:o(m.AUTOMATIONS$DETAIL$TRIGGER),value:s}),(0,Y.jsx)($,{label:o(m.AUTOMATIONS$PROMPT),value:t.prompt??``}),t.plugins&&t.plugins.length>0?(0,Y.jsx)($,{label:o(m.AUTOMATIONS$DETAIL$PLUGINS),value:t.plugins.join(`, `)}):null]}),(0,Y.jsxs)(`footer`,{className:`px-6 py-5`,children:[(0,Y.jsx)(`p`,{className:`mb-4 text-sm text-tertiary-light`,children:o(m.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,Y.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,Y.jsx)(y,{testId:`import-automation-cancel`,type:`button`,variant:`secondary`,onClick:r,isDisabled:n,children:o(m.AUTOMATIONS$CANCEL)}),(0,Y.jsx)(y,{testId:`import-automation-confirm`,type:`button`,variant:`primary`,onClick:i,isDisabled:n,"aria-busy":n,children:o(n?m.AUTOMATIONS$IMPORTING:m.AUTOMATIONS$IMPORT)})]})]})]})})}var Ye=50,Xe=i(function(){let{t:e}=a(`openhands`),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(()=>je()),[o,s]=(0,J.useState)(Ye),[p,h]=(0,J.useState)(null),[_,v]=(0,J.useState)(null),[b,x]=(0,J.useState)(!1),[S,C]=(0,J.useState)(null),w=(0,J.useRef)(null),T=u(),E=T.backend.kind===`local`,{data:D,isLoading:O,refetch:k}=ce(),A=D?.status===`ok`,{data:j,isLoading:M,isError:N,refetch:ee}=ge({limit:o,offset:0,enabled:A}),{trackPrebuiltAutomationEnabled:te,trackAutomationExported:P}=g(),re=oe(),F=ae(),L=ie(),R=he(),z=(0,J.useMemo)(()=>{if(!j?.automations)return[];let e=t.toLowerCase();return e?j.automations.filter(t=>t.name.toLowerCase().includes(e)||(t.prompt??``).toLowerCase().includes(e)||t.repository?.toLowerCase().includes(e)||t.model?.toLowerCase().includes(e)):j.automations},[j?.automations,t]),B=(0,J.useMemo)(()=>z.filter(e=>e.enabled),[z]),V=(0,J.useMemo)(()=>z.filter(e=>!e.enabled),[z]),H=(e,t)=>{let n=!t;if(re.mutate({id:e,enabled:n}),n){let t=j?.automations.find(t=>t.id===e);te({automationId:e,automationName:t?.name??e})}},U=t=>{L.mutate(t,{onSuccess:()=>{l(e(m.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{d(I(t,e(m.AUTOMATIONS$RUN_NOW_ERROR)))}})},W=e=>{let t=j?.automations.find(t=>t.id===e);t&&h({id:e,name:t.name})},G=e=>{let t=j?.automations.find(t=>t.id===e);t&&v(t)},K=e=>{let t=`${JSON.stringify(fe(e),null,2)}\n`;f(new Blob([t],{type:`application/json`}),me(e)),P({backendKind:T.backend.kind})},q=async t=>{let n=t.currentTarget,r=n.files?.[0];if(n.value=``,r)try{let t;try{t=JSON.parse(await r.text())}catch{d(e(m.AUTOMATIONS$IMPORT_INVALID_JSON));return}C(ue(t))}catch(t){d(t instanceof Error?t.message:e(m.ERROR$GENERIC))}},_e=()=>{S&&R.mutate({...S,enabled:!1},{onSuccess:t=>{C(null),c(e(m.AUTOMATIONS$IMPORT_SUCCESS,{name:t.name}),e(m.AUTOMATIONS$IMPORT_VIEW),`/automations/${encodeURIComponent(t.id)}`)},onError:t=>{d(I(t,e(m.ERROR$GENERIC)))}})},ve=()=>{p&&(F.mutate(p.id),h(null))},be=(0,J.useCallback)(e=>{i(e),Me(e)},[]),xe=j?j.total>j.automations.length:!1,X=!M&&!N&&j?.automations.length===0;return O?(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,Y.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(m.AUTOMATIONS$TITLE)}),(0,Y.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(m.AUTOMATIONS$SUBTITLE)}),(0,Y.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,Y.jsx)(Re,{},`skeleton-${String(t)}`))})]})}):A?(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:e(m.AUTOMATIONS$TITLE)}),(0,Y.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(m.AUTOMATIONS$SUBTITLE)})]}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[(0,Y.jsx)(y,{type:`button`,variant:`secondary`,testId:`automations-import-automation`,className:`whitespace-nowrap`,onClick:()=>w.current?.click(),startContent:(0,Y.jsx)(ye,{className:`size-4`,"aria-hidden":!0}),children:e(m.AUTOMATIONS$IMPORT)}),(0,Y.jsx)(`input`,{ref:w,type:`file`,accept:`application/json,.json`,className:`hidden`,"data-testid":`automations-import-file`,onChange:q}),(0,Y.jsx)(y,{type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`whitespace-nowrap`,onClick:()=>x(!0),children:e(m.AUTOMATIONS$ADD_AUTOMATION)})]})]}),(0,Y.jsxs)(`div`,{className:`mt-6 flex items-stretch gap-2`,children:[(0,Y.jsx)(Se,{value:t,onChange:n}),(0,Y.jsx)(Le,{view:r,onChange:be,disabled:X})]}),(0,Y.jsxs)(`div`,{className:`mt-6 flex flex-col gap-6`,children:[M&&(0,Y.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,Y.jsx)(Re,{},`skeleton-${String(t)}`))}),N&&!M&&(0,Y.jsx)(pe,{onRetry:ee}),X&&(0,Y.jsx)(Ke,{}),!M&&!N&&j&&j.automations.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Pe,{title:e(m.AUTOMATIONS$ACTIVE),count:B.length,automations:B,view:r,onToggle:H,onRunNow:U,runPendingId:L.isPending?L.variables??null:null,onDelete:W,onExport:K,onEdit:E?G:void 0}),(0,Y.jsx)(Pe,{title:e(m.AUTOMATIONS$INACTIVE),count:V.length,automations:V,view:r,onToggle:H,onRunNow:U,runPendingId:L.isPending?L.variables??null:null,onDelete:W,onExport:K,onEdit:E?G:void 0}),xe&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+Ye),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(m.AUTOMATIONS$LOAD_MORE)})]})]}),(0,Y.jsx)(`div`,{className:`mt-6`,children:(0,Y.jsx)(ne,{query:t})}),(0,Y.jsx)(se,{automationName:p?.name??``,isOpen:p!==null,onConfirm:ve,onCancel:()=>h(null)}),_&&(0,Y.jsx)(le,{automation:_,isOpen:_!==null,onClose:()=>v(null)}),(0,Y.jsx)(qe,{isOpen:b,onClose:()=>x(!1)}),(0,Y.jsx)(Je,{isOpen:S!==null,spec:S,isImporting:R.isPending,onClose:()=>C(null),onImport:_e})]})}):(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,Y.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(m.AUTOMATIONS$TITLE)}),(0,Y.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(m.AUTOMATIONS$SUBTITLE)}),(0,Y.jsx)(de,{onRetry:k})]})})});export{Xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{a,i as o,n as s,r as c,y as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as u}from"./useQuery-B38jBavx.js";import{D as d,J as f,ct as p,dt as m,lt as h,m as g,r as _,v}from"./active-backend-context-BlZPzZNU.js";import{t as y,z as b}from"./utils-qjs_KuS4.js";import{t as x}from"./client-source-1v-kWLNU.js";import{a as S,i as C,n as w,o as T,r as E}from"./use-onboarding-completion-B-2BTS-y.js";import{t as D}from"./use-tracking-CN1nIMnY.js";import{t as O}from"./modal-backdrop-X-vKo61e.js";import{n as k,r as A,t as j}from"./modal-body-DQhiw-AR.js";import{n as M,r as N}from"./modal-classes-YaEEa5eZ.js";import{t as P}from"./brand-button-CQO8oqVo.js";import{n as F}from"./navigation-context-BOGzIng3.js";import{t as I}from"./modal-close-button-turIYn0t.js";import{t as L}from"./settings-input-BjW_zyTN.js";import{t as R}from"./segmented-toggle-DbbD3Tve.js";import{n as z,r as ee}from"./cloud-funnel-analytics-CasMM7EO.js";var B=e(n()),V=r(),te=e=>(0,V.jsxs)(`svg`,{width:1365,height:1365,viewBox:`0 -24 148 148`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,V.jsx)(`path`,{d:`M71.7542 16.863V2.97414C71.7542 1.82355 72.6872 0.890503 73.8378 0.890503C74.9884 0.890503 75.9214 1.82355 75.9214 2.97414V16.863C75.9214 18.0136 74.9884 18.9466 73.8378 18.9466C72.6872 18.9466 71.7542 18.0136 71.7542 16.863Z`,fill:`white`}),(0,V.jsx)(`path`,{d:`M82.5272 18.9329L89.4716 6.90477C90.0469 5.90832 91.3215 5.5668 92.3179 6.1421C93.3144 6.7174 93.6559 7.99197 93.0806 8.98841L86.1362 21.0165C85.5609 22.0129 84.2863 22.3545 83.2899 21.7792C82.2934 21.2039 81.9519 19.9293 82.5272 18.9329Z`,fill:`white`}),(0,V.jsx)(`path`,{d:`M65.1481 18.9329L58.2037 6.90477C57.6284 5.90832 56.3538 5.5668 55.3574 6.1421C54.3609 6.7174 54.0194 7.99197 54.5947 8.98841L61.5391 21.0165C62.1144 22.0129 63.389 22.3545 64.3854 21.7792C65.3819 21.2039 65.7234 19.9293 65.1481 18.9329Z`,fill:`white`}),(0,V.jsx)(`path`,{d:`M140.606 62.0292C140.606 58.409 141.583 47.6748 141.89 44.1323C142.097 41.7374 141.809 40.4247 141.424 39.7542C141.141 39.2626 140.699 38.915 139.634 38.8436C138.865 38.7921 138.027 39.0114 137.401 39.5761C136.814 40.1052 136.159 41.1682 136.159 43.3176L136.155 43.4388L135.198 59.758C135.164 60.3451 134.883 60.8911 134.424 61.2599C133.966 61.6284 133.374 61.7859 132.793 61.6941L122.764 60.1068L111.948 58.6703C110.949 58.5376 110.188 57.7084 110.142 56.7016L109.561 44.1323C109.535 43.621 109.51 43.1141 109.484 42.6146C109.241 37.9294 109.022 33.7805 109.022 32.4282C109.022 28.3859 108.338 26.6806 107.74 25.9634C107.263 25.3915 106.577 25.1402 105.11 25.1402C104.583 25.1402 104.212 25.2481 103.933 25.4111C103.659 25.5714 103.346 25.8587 103.049 26.4208C102.41 27.6257 101.945 29.891 102.118 33.8479C102.342 38.9804 102.692 42.8146 103.035 46.2718C103.377 49.7231 103.718 52.8561 103.908 56.4971C104.204 62.1966 104.178 66.1256 103.945 68.7924C103.828 70.124 103.656 71.1996 103.423 72.0501C103.202 72.8558 102.871 73.6757 102.296 74.2887C101.6 75.0303 100.608 75.3844 99.577 75.136C98.7592 74.9389 98.1847 74.4215 97.8706 74.0916C97.2141 73.4017 96.7501 72.5106 96.568 72.0512C95.5097 69.3812 92.2352 63.1808 87.8023 59.6811C86.5089 58.6599 85.5666 58.3652 84.9736 58.3204C84.4148 58.2783 84.0094 58.4436 83.6909 58.6967C83.34 58.9756 83.0781 59.3811 82.9479 59.7643C82.9019 59.8999 82.8823 59.9968 82.8741 60.0584C84.0759 62.0865 88.8421 69.5222 91.0896 77.069C92.7648 82.6941 96.8038 88.4259 99.8194 90.8809C102.74 93.258 107.988 94.7313 113.9 95.0218C119.756 95.3095 125.788 94.4121 130.033 92.5092C138.233 88.8334 139.903 80.7382 140.651 77.2292C141.232 74.5057 141.243 71.5987 141.087 68.9009C141.01 67.5551 140.894 66.2969 140.793 65.1373C140.695 64.0105 140.606 62.9215 140.606 62.0292ZM120.986 27.0953C120.986 25.8314 120.648 24.7049 120.089 23.9514C119.583 23.27 118.84 22.7987 117.646 22.7984C116.668 22.7982 116.011 22.9187 115.546 23.1167C115.13 23.2943 114.781 23.5699 114.463 24.0831C113.73 25.2671 113.192 27.6455 113.189 32.384L113.721 43.9088C113.91 47.5661 114.106 51.4922 114.235 54.7707L120.986 55.6666V27.0953ZM125.153 56.2652L131.172 57.218L131.992 43.267V32.5083C131.992 31.031 131.39 30.1275 130.678 29.5489C129.884 28.9039 128.957 28.6731 128.519 28.6731C127.722 28.6731 126.899 28.797 126.306 29.2179C125.849 29.5421 125.153 30.3087 125.153 32.5083V56.2652ZM136.159 35.4278C137.406 34.8069 138.74 34.6083 139.912 34.6868C142.037 34.8292 143.91 35.718 145.037 37.6779C146.06 39.4592 146.273 41.8136 146.041 44.4927C145.72 48.1949 144.772 58.6457 144.772 62.0292C144.772 62.708 144.843 63.6116 144.944 64.7758C145.042 65.907 145.165 67.2389 145.247 68.6606C145.411 71.4987 145.422 74.8383 144.727 78.0987C144.002 81.4953 142.041 91.6918 131.738 96.3108C126.731 98.5551 120.002 99.4936 113.696 99.1838C107.445 98.8767 101.128 97.3189 97.1887 94.1122C93.4809 91.0937 88.9938 84.6307 87.0962 78.2589C84.9529 71.0619 80.3109 63.9646 79.1527 61.9533C78.4706 60.7689 78.684 59.3628 79.0019 58.4258C79.3607 57.3688 80.0554 56.2631 81.0993 55.4337C82.1758 54.5784 83.6043 54.0377 85.2876 54.1647C86.9369 54.2893 88.6462 55.0393 90.3834 56.4107C94.8541 59.9401 98.1342 65.5082 99.7424 68.9231C99.759 68.7664 99.779 68.6024 99.7941 68.4298C100.003 66.0435 100.039 62.3344 99.7467 56.7132C99.5635 53.1942 99.2356 50.1809 98.8888 46.6828C98.5425 43.1904 98.184 39.2713 97.955 34.0302C97.7722 29.8481 98.2012 26.6722 99.3672 24.471C99.9716 23.3302 100.79 22.4223 101.83 21.814C102.866 21.2087 103.995 20.974 105.11 20.974C106.759 20.974 108.813 21.2062 110.448 22.7678C110.593 22.4576 110.75 22.1652 110.921 21.8899C111.676 20.6698 112.681 19.8084 113.912 19.2835C115.095 18.7791 116.378 18.6309 117.646 18.6311C120.195 18.6315 122.164 19.7567 123.434 21.4683C124.256 22.576 124.75 23.8775 124.985 25.1982C126.338 24.5876 127.691 24.5068 128.519 24.5068C129.933 24.5068 131.784 25.0791 133.305 26.3154C134.908 27.6179 136.159 29.6733 136.159 32.5083V35.4278Z`,fill:`white`}),(0,V.jsx)(`path`,{d:`M7.15661 62.0292C7.15661 58.409 6.17994 47.6748 5.87291 44.1323C5.6654 41.7374 5.95357 40.4247 6.33875 39.7542C6.62116 39.2626 7.06336 38.915 8.12834 38.8436C8.89759 38.7921 9.73544 39.0114 10.3616 39.5761C10.9484 40.1052 11.6032 41.1682 11.6032 43.3176L11.6074 43.4388L12.5644 59.758C12.5988 60.3451 12.8798 60.8911 13.338 61.2599C13.7961 61.6284 14.3887 61.7859 14.9695 61.6941L24.9988 60.1068L35.8143 58.6703C36.8135 58.5376 37.5741 57.7084 37.6208 56.7016L38.2015 44.1323C38.2279 43.621 38.2525 43.1141 38.2784 42.6146C38.5218 37.9294 38.7401 33.7805 38.7401 32.4282C38.7401 28.3859 39.4246 26.6806 40.0227 25.9634C40.4996 25.3915 41.185 25.1402 42.6523 25.1402C43.1794 25.1402 43.5505 25.2481 43.8295 25.4111C44.1038 25.5714 44.416 25.8587 44.7138 26.4208C45.3521 27.6257 45.8173 29.891 45.6444 33.8479C45.4201 38.9804 45.0703 42.8146 44.7275 46.2718C44.3853 49.7231 44.0443 52.8561 43.8548 56.4971C43.5582 62.1966 43.5847 66.1256 43.8179 68.7924C43.9344 70.124 44.1069 71.1996 44.3396 72.0501C44.5601 72.8558 44.891 73.6757 45.4663 74.2887C46.1625 75.0303 47.1546 75.3844 48.1855 75.136C49.0033 74.9389 49.5778 74.4215 49.8918 74.0916C50.5484 73.4017 51.0123 72.5106 51.1945 72.0512C52.2527 69.3812 55.5272 63.1808 59.9601 59.6811C61.2536 58.6599 62.1958 58.3652 62.7889 58.3204C63.3476 58.2783 63.753 58.4436 64.0715 58.6967C64.4225 58.9756 64.6844 59.3811 64.8146 59.7643C64.8606 59.8999 64.8801 59.9968 64.8883 60.0584C63.6866 62.0865 58.9204 69.5222 56.6729 77.069C54.9977 82.6941 50.9586 88.4259 47.9431 90.8809C45.0229 93.258 39.7747 94.7313 33.8624 95.0218C28.0068 95.3095 21.9748 94.4121 17.7297 92.5092C9.52988 88.8334 7.85961 80.7382 7.11129 77.2292C6.53054 74.5057 6.5195 71.5987 6.67496 68.9009C6.75251 67.5551 6.86809 66.2969 6.96901 65.1373C7.06707 64.0105 7.1566 62.9215 7.15661 62.0292ZM26.7768 27.0953C26.7768 25.8314 27.1147 24.7049 27.6737 23.9514C28.1792 23.27 28.9221 22.7987 30.1167 22.7984C31.0942 22.7982 31.7518 22.9187 32.2162 23.1167C32.6326 23.2943 32.9817 23.5699 33.2996 24.0831C34.0328 25.2671 34.5705 27.6455 34.5738 32.384L34.0416 43.9088C33.8524 47.5661 33.6565 51.4922 33.5273 54.7707L26.7768 55.6666V27.0953ZM22.6095 56.2652L16.5904 57.218L15.7705 43.267V32.5083C15.7705 31.031 16.3726 30.1275 17.0847 29.5489C17.8785 28.9039 18.8058 28.6731 19.2432 28.6731C20.0404 28.6731 20.8634 28.797 21.4565 29.2179C21.9131 29.5421 22.6095 30.3087 22.6095 32.5083V56.2652ZM11.6032 35.4278C10.3568 34.8069 9.02265 34.6083 7.8501 34.6868C5.72541 34.8292 3.85197 35.718 2.72584 37.6779C1.70247 39.4592 1.48924 41.8136 1.72143 44.4927C2.0423 48.1949 2.99038 58.6457 2.99038 62.0292C2.99037 62.708 2.91991 63.6116 2.81859 64.7758C2.72014 65.907 2.59699 67.2389 2.51505 68.6606C2.3515 71.4987 2.34041 74.8383 3.0357 78.0987C3.76005 81.4953 5.72154 91.6918 16.0245 96.3108C21.0311 98.5551 27.7601 99.4936 34.0669 99.1838C40.3172 98.8767 46.6346 97.3189 50.5737 94.1122C54.2816 91.0937 58.7686 84.6307 60.6662 78.2589C62.8095 71.0619 67.4515 63.9646 68.6098 61.9533C69.2919 60.7689 69.0785 59.3628 68.7605 58.4258C68.4018 57.3688 67.707 56.2631 66.6632 55.4337C65.5867 54.5784 64.1582 54.0377 62.4748 54.1647C60.8256 54.2893 59.1162 55.0393 57.379 56.4107C52.9083 59.9401 49.6283 65.5082 48.02 68.9231C48.0034 68.7664 47.9835 68.6024 47.9684 68.4298C47.7597 66.0435 47.7232 62.3344 48.0158 56.7132C48.1989 53.1942 48.5269 50.1809 48.8737 46.6828C49.22 43.1904 49.5784 39.2713 49.8075 34.0302C49.9903 29.8481 49.5612 26.6722 48.3952 24.471C47.7909 23.3302 46.9729 22.4223 45.9321 21.814C44.8964 21.2087 43.7676 20.974 42.6523 20.974C41.0038 20.974 38.9497 21.2062 37.3141 22.7678C37.1698 22.4576 37.0124 22.1652 36.8419 21.8899C36.0863 20.6698 35.0817 19.8084 33.8508 19.2835C32.6679 18.7791 31.3849 18.6309 30.1167 18.6311C27.5677 18.6315 25.5986 19.7567 24.3285 21.4683C23.5066 22.576 23.0121 23.8775 22.7771 25.1982C21.4247 24.5876 20.0718 24.5068 19.2432 24.5068C17.8298 24.5068 15.9788 25.0791 14.4573 26.3154C12.8542 27.6179 11.6032 29.6733 11.6032 32.5083V35.4278Z`,fill:`white`})]});function ne(e){return a(e,{headers:x})}function re(e,t,n){return o(e,t,{...n,headers:x})}var H=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,V.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.3235 10.9352L11.5016 14.2111L7.67969 10.9352L8.6152 9.84375L11.5016 12.3178L14.388 9.84375L15.3235 10.9352Z`,fill:`currentColor`})});function U(e,t,n){let r=n?.lastError??null,i=t?.kind===`cloud`;return i&&!t?.apiKey?.trim()||S(r)?e(b.BACKEND$STATUS_DISCONNECTED_ADD_API_KEY):C(r)?e(b.BACKEND$STATUS_DISCONNECTED_CHECK_API_KEY):E(r)?e(b.BACKEND$LOGGED_OUT):n?.isConnected===!0?e(b.ONBOARDING$BACKEND_STATUS_CONNECTED):i&&n?.isConnected===!1&&(w(r)||m(r))?e(b.BACKEND$STATUS_DISCONNECTED_CHECK_CLOUD_ACCESS):n?.isConnected===!1&&h(r)?e(b.BACKEND$STATUS_DISCONNECTED_CHECK_TUNNEL):n?.isConnected===!1&&m(r)?e(b.BACKEND$STATUS_DISCONNECTED_CHECK_URL_OR_NETWORK):n?.isConnected===!1?e(b.ONBOARDING$BACKEND_STATUS_DISCONNECTED):e(b.ONBOARDING$BACKEND_STATUS_CHECKING)}function W({isConnected:e,className:t}){let n,r,i;return e===`unavailable`?(n=`bg-[var(--oh-text-tertiary)]`,r=`No Backend Available`,i=`unavailable`):e===!0?(n=`bg-[var(--oh-status-success)]`,r=`Connected`,i=`connected`):e===!1?(n=`bg-red-500`,r=`Disconnected`,i=`disconnected`):(n=`bg-[var(--oh-interactive-selected)]`,r=`Checking connection`,i=`checking`),(0,V.jsx)(`span`,{"data-testid":`backend-status-dot`,"data-status":i,"aria-label":r,title:r,role:`status`,className:y(`inline-block w-2 h-2 rounded-full shrink-0`,n,t)})}var G={status:`idle`,verificationUrl:null,userCode:null,apiKey:null,error:null,errorCode:null};function ie(){let[e,t]=B.useState(G),n=B.useRef(null),r=B.useCallback((e,r)=>{n.current?.abort();let i=new AbortController;n.current=i,t({...G,status:`starting`}),(async()=>{let n;try{n=await ne(e)}catch(e){if(i.signal.aborted)return;let n=e instanceof Error?e.message:`Failed to start device flow`,r=e instanceof s?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null});return}if(!i.signal.aborted){z(e,r),t({...G,status:`awaiting_authorization`,verificationUrl:n.verification_uri_complete,userCode:n.user_code});try{let a=await re(e,n.device_code,{interval:n.interval,signal:i.signal});if(i.signal.aborted)return;ee(e,r),t({...G,status:`success`,apiKey:a.access_token})}catch(e){if(i.signal.aborted)return;if(e instanceof s&&e.code===`cancelled`){t(G);return}let n=e instanceof Error?e.message:`Authorization failed`,r=e instanceof s?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null})}}})()},[]),i=B.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]),a=B.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]);return B.useEffect(()=>()=>{n.current?.abort()},[]),{...e,start:r,cancel:i,reset:a}}function K(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function q({host:e,onSuccess:t,testIdRoot:n,isDisabled:r=!1,idleButtonLabel:a,idleButtonContent:o,className:s,buttonClassName:c,buttonVariant:l=`primary`,statusDisplay:u=`inline`,analyticsSource:d}){let{t:f}=i(`openhands`),p=ie(),m=B.useRef(null);B.useEffect(()=>()=>{m.current?.close()},[]),B.useEffect(()=>{if(p.status===`awaiting_authorization`&&p.verificationUrl&&m.current&&!m.current.closed){if(!K(p.verificationUrl)){console.error(`Invalid verification URL protocol`);return}try{m.current.location.href=p.verificationUrl}catch{m.current=window.open(p.verificationUrl,`_blank`,`noopener,noreferrer`)}}},[p.status,p.verificationUrl]),B.useEffect(()=>{if(p.status===`success`&&p.apiKey)try{t(p.apiKey)}finally{p.reset(),m.current?.close()}},[p.status,p.apiKey,p.reset,t]);let h=()=>{let t=e.trim().replace(/\/+$/,``),n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(n);if(e.username||e.password)throw Error(`Invalid URL format`)}catch{return}m.current=window.open(`about:blank`,`_blank`),m.current||console.warn(`Popup blocked - user will need to use manual link`),p.start(n,d)},g=()=>{p.cancel(),m.current?.close()},_=(0,V.jsx)(ae,{status:p.status,error:p.error,verificationUrl:p.verificationUrl,testIdRoot:n,onCancel:g,onRetry:h}),v=u===`modal`&&p.status!==`idle`,x=a??f(b.BACKEND$LOGIN_WITH_OPENHANDS);return(0,V.jsxs)(`div`,{"data-testid":`${n}-device-flow`,className:y(`flex flex-col gap-3`,s),children:[p.status===`idle`&&l===`unstyled`&&(0,V.jsx)(`button`,{type:`button`,onClick:h,"data-testid":`${n}-login-button`,className:c,disabled:r,"aria-label":o?x:void 0,children:o??x}),p.status===`idle`&&l!==`unstyled`&&(0,V.jsx)(P,{type:`button`,variant:l,onClick:h,testId:`${n}-login-button`,className:y(`w-full`,c),isDisabled:r,ariaLabel:o?x:void 0,children:o??x}),u===`inline`?_:null,v?(0,V.jsx)(O,{onClose:g,"aria-label":f(b.BACKEND$LOGIN_WITH_OPENHANDS),closeOnBackdropClick:!1,children:(0,V.jsx)(k,{testID:`${n}-auth-modal`,width:`sm`,className:`items-stretch border border-[var(--oh-border)]`,children:_})}):null]})}function ae({status:e,error:t,verificationUrl:n,testIdRoot:r,onCancel:a,onRetry:o}){let{t:s}=i(`openhands`);if(e===`idle`||e===`success`)return null;if(e===`starting`)return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg bg-base-tertiary p-3`,"data-testid":`${r}-auth-starting`,role:`status`,"aria-live":`polite`,children:[(0,V.jsx)(J,{}),(0,V.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:s(b.BACKEND$AUTH_STARTING)})]});if(e===`awaiting_authorization`){let e=n&&K(n)?n:null;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-lg bg-base-tertiary p-4`,"data-testid":`${r}-auth-awaiting`,role:`status`,"aria-live":`polite`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(J,{}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-white`,children:s(b.BACKEND$AUTH_AWAITING)})]}),(0,V.jsx)(`p`,{className:`text-sm leading-5 text-[var(--oh-text-tertiary)]`,children:s(b.BACKEND$AUTH_BROWSER_OPENED)}),e?(0,V.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-md border border-[var(--oh-border)] bg-[var(--oh-surface)] p-3 text-xs text-[var(--oh-muted)]`,children:[(0,V.jsx)(`p`,{children:s(b.BACKEND$AUTH_OPEN_MANUALLY)}),(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`max-h-16 overflow-auto break-all text-blue-400 hover:underline`,children:e})]}):null,(0,V.jsx)(P,{type:`button`,variant:`secondary`,onClick:a,testId:`${r}-auth-cancel`,className:`w-full`,children:s(b.BACKEND$AUTH_CANCEL)})]})}return(0,V.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-red-700 bg-red-900/20 p-4`,"data-testid":`${r}-auth-error`,role:`alert`,children:[(0,V.jsx)(`p`,{className:`text-sm text-red-400`,children:t}),(0,V.jsx)(P,{type:`button`,variant:`secondary`,onClick:o,testId:`${r}-auth-retry`,className:`w-full`,children:s(b.BACKEND$AUTH_RETRY)})]})}function J(){return(0,V.jsx)(`svg`,{className:`animate-spin h-4 w-4 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})})}var oe=t({BackendConnectionOptions:()=>$,BackendForm:()=>Q,BackendFormModal:()=>ye});function se(e){return c(e)?`cloud`:`local`}function ce(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return!!(t===`localhost`||t===`::1`||t===`::`||t===`0.0.0.0`||/^127\./.test(t)||/^::ffff:127\./i.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)||/^fe[89ab][0-9a-f]:/i.test(t)||/^f[cd][0-9a-f]{2}:/i.test(t)||t.endsWith(`.local`)||!t.includes(`.`)&&!t.includes(`:`))}function Y(e){let t=e.trim().replace(/\/+$/,``);if(!t)return``;if(/^https?:\/\//i.test(t))return t;let n=t.match(/^\[([^\]]+)\]/);return`${ce(n?n[1]:(t.match(/:/g)??[]).length>1?t:t.split(`:`)[0])?`http`:`https`}://${t}`}function X(e){let t=e.trim();if(!t||/\s/.test(t))return!1;let n=Y(t);if(!n)return!1;try{let e=new URL(n);return(e.protocol===`http:`||e.protocol===`https:`)&&e.hostname.length>0}catch{return!1}}var Z=`https://app.all-hands.dev`;function le(e,t){return e(b.BACKEND$CONNECTION_TEST_FAILED,{host:t,interpolation:{escapeValue:!1}})}function ue(e){return p(e)}function de(e,t){let n=ue(t);return n?`${e}\n${n}`:e}async function fe(e){if(e.kind!==`local`)return{agentServerVersion:null};let t=await new l(d({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo();return g(t),{agentServerVersion:v(t)}}function pe({backend:e,testIdRoot:t}){let{t:n}=i(`openhands`),r=T([e])[e.id],a=r?.isConnected??null,o=r?.disabled===!0,s=r?.consecutiveFailures??0,c=r?.lastError??null,{data:f}=u({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>v(await new l(d({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()),retry:!1,staleTime:6e4,enabled:e.kind===`local`&&!o}),p=U(n,e,r),m=e.kind===`cloud`?n(b.BACKEND$KIND_CLOUD):n(b.BACKEND$KIND_LOCAL);return(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsxs)(`div`,{"data-testid":`${t}-status`,className:`flex items-center gap-3 text-sm`,children:[(0,V.jsx)(W,{isConnected:a}),(0,V.jsx)(`span`,{className:`text-white`,"data-testid":`${t}-status-label`,children:p}),(0,V.jsx)(`span`,{className:`text-tertiary-alt`,children:`·`}),(0,V.jsx)(`span`,{className:`text-[var(--oh-text-tertiary)]`,children:m}),f?(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-version`,children:n(b.BACKEND$VERSION_LABEL,{version:f})}):null]}),o?(0,V.jsxs)(`div`,{"data-testid":`${t}-status-error`,className:`flex flex-col gap-1 rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm`,children:[(0,V.jsx)(`span`,{className:`font-semibold text-red-300`,children:n(b.BACKEND$HEALTH_FAILED_TITLE)}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-text-tertiary)]`,children:n(b.BACKEND$HEALTH_FAILED_DETAIL,{count:s})}),c?(0,V.jsx)(`span`,{"data-testid":`${t}-status-error-message`,className:`text-xs text-red-300 whitespace-pre-wrap break-words`,children:c}):null]}):null]})}function me({initialName:e=``,initialHost:t=``,initialApiKey:n=``,onTestConnection:r,onSuccess:a,requireApiKey:o=!1,onSubmitOverride:s}){let{t:c}=i(`openhands`),[l,u]=B.useState(e),[d,f]=B.useState(t),[p,m]=B.useState(n),[h,g]=B.useState(null),[_,v]=B.useState(!1),[y,b]=B.useState(null),x=y??se(d),S=o||x!==`local`,C=l.trim().length>0&&X(d)&&(!S||p.trim().length>0);return{name:l,setName:u,host:d,setHost:f,apiKey:p,setApiKey:m,connectionError:h,setConnectionError:g,isSubmitting:_,kind:x,setKind:b,canSubmit:C,handleSubmit:B.useCallback(async e=>{if(e.preventDefault(),!C||_)return;let t={name:l.trim(),host:Y(d),apiKey:p.trim(),kind:x};g(null),v(!0);try{s?await s(t):a(await r(t))}catch(e){g(de(le(c,t.host),e))}finally{v(!1)}},[C,_,l,d,p,x,r,a,o,s,c])}}function Q({mode:e,backend:t,onSubmitted:n,renderActions:r,testIdRoot:a,hostReadOnly:o,requireApiKey:s,hideConfigurationFields:c=!1,onSubmitOverride:l}){let{t:u}=i(`openhands`),{addBackend:d,updateBackend:f}=_(),p=e===`edit`&&t?t.kind:null,{name:m,setName:h,host:g,setHost:v,apiKey:x,setApiKey:S,connectionError:C,setConnectionError:w,isSubmitting:T,kind:E,handleSubmit:D}=me({initialName:t?.name??``,initialHost:t?.host??``,initialApiKey:t?.apiKey??``,onTestConnection:fe,onSuccess:async()=>{let r={name:m.trim(),host:Y(g),apiKey:x.trim(),kind:p??E};e===`edit`&&t?f(t.id,r):d(r),n()},requireApiKey:s,onSubmitOverride:l}),[O,k]=B.useState(!1),[A,j]=B.useState(!1),M=p??E,N=a??(e===`edit`?`edit-backend`:`add-backend`),F=s||M!==`local`,I=m.trim().length>0&&X(g)&&(!F||x.trim().length>0),R=O&&!m.trim()?u(b.BACKEND$NAME_REQUIRED):void 0,z=A?g.trim()?X(g)?void 0:u(b.BACKEND$HOST_INVALID):u(b.BACKEND$HOST_REQUIRED):void 0;return(0,V.jsxs)(`form`,{"data-testid":`${N}-form`,onSubmit:async e=>{if(!I){k(!0),j(!0);return}await D(e)},className:`flex flex-col gap-4`,children:[(0,V.jsxs)(`div`,{"data-testid":`${N}-configuration-fields`,className:y(`flex flex-col gap-4`,c&&`hidden`),children:[(0,V.jsx)(L,{testId:`${N}-name`,name:`${N}-name`,type:`text`,label:u(b.BACKEND$NAME_LABEL),value:m,onChange:e=>{h(e),w(null)},onBlur:()=>k(!0),placeholder:`Production`,className:`w-full`,showRequiredTag:!0,error:R}),(0,V.jsx)(L,{testId:`${N}-host`,name:`${N}-host`,type:`text`,label:u(b.BACKEND$HOST_LABEL),value:g,onChange:o?void 0:e=>{v(e),w(null)},onBlur:()=>j(!0),placeholder:Z,className:`w-full`,showRequiredTag:!0,error:z,isDisabled:o}),(0,V.jsx)(L,{testId:`${N}-api-key`,name:`${N}-api-key`,type:`password`,label:u(b.BACKEND$KEY_LABEL),value:x,onChange:e=>{S(e),w(null)},placeholder:``,className:`w-full`}),C?(0,V.jsx)(`div`,{role:`alert`,"data-testid":`${N}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:C}):null,e===`edit`&&t&&(0,V.jsx)(pe,{backend:t,testIdRoot:N})]}),r?r({canSubmit:I&&!T,isSubmitting:T,testIdRoot:N}):(0,V.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2 w-full`,children:[(0,V.jsx)(P,{type:`button`,variant:`secondary`,onClick:n,testId:`${N}-cancel`,children:u(b.BUTTON$CANCEL)}),(0,V.jsx)(P,{type:`submit`,variant:`primary`,isDisabled:!I||T,testId:`${N}-submit`,children:u(b.BACKEND$SAVE)})]})]})}function he(){let{currentPath:e,navigate:t}=F();return B.useCallback(()=>{/^\/automations\/[^/]+/.test(e)?t(`/automations`):/^\/conversations\/[^/]+/.test(e)&&t(`/conversations`)},[e,t])}function $({onConnected:e,testIdRoot:t=`add-backend`,initialManualBackend:n,requireManualApiKey:r=!1,manualSubmitLabel:a,manualSubmittingLabel:o,manualSubmitTestId:s,analyticsSource:c}){let{t:l}=i(`openhands`),u=f();return u?(0,V.jsx)(`div`,{"data-testid":`${t}-connection-options`,className:`flex justify-center`,children:(0,V.jsx)(`div`,{className:`w-full`,children:(0,V.jsx)(_e,{onConnected:e,testIdRoot:t,lockedHost:u,analyticsSource:c})})}):(0,V.jsxs)(`div`,{"data-testid":`${t}-connection-options`,className:`flex flex-col gap-6 md:flex-row`,children:[(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,V.jsx)(ge,{onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:a??l(b.BACKEND$CONNECT),submittingLabel:o??l(b.ONBOARDING$BACKEND_STATUS_CHECKING),submitTestId:s})}),(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,V.jsx)(_e,{onConnected:e,testIdRoot:t,analyticsSource:c})})]})}function ge({onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:a,submittingLabel:o,submitTestId:s}){let{t:c}=i(`openhands`),{name:l,setName:u,host:d,setHost:f,apiKey:p,setApiKey:m,connectionError:h,setConnectionError:g,isSubmitting:_,kind:v,setKind:y,canSubmit:x,handleSubmit:S}=me({initialName:n?.name??``,initialHost:n?.host??``,initialApiKey:n?.apiKey??``,onTestConnection:fe,onSuccess:t=>{e({name:l.trim(),host:Y(d),apiKey:p.trim(),kind:v},`manual`,t)},requireApiKey:r});return(0,V.jsxs)(`form`,{"data-testid":`${t}-form`,onSubmit:S,className:`flex flex-col gap-4 flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(L,{testId:`${t}-name`,name:`${t}-name`,type:`text`,label:c(b.BACKEND$NAME_LABEL),value:l,onChange:e=>{u(e),g(null)},placeholder:`e.g. My Server`,className:`w-full`}),(0,V.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:c(b.BACKEND$NAME_HELPER)})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,V.jsx)(L,{testId:`${t}-host`,name:`${t}-host`,type:`text`,label:c(b.BACKEND$HOST_LABEL),value:d,onChange:e=>{f(e),g(null)},placeholder:`http://localhost:8000`,className:`w-full`}),(0,V.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-host-helper`,children:c(b.BACKEND$HOST_HELPER)})]}),(0,V.jsxs)(`div`,{className:`flex flex-col items-start gap-2.5`,children:[(0,V.jsx)(`span`,{className:`text-sm`,children:c(b.BACKEND$KIND_LABEL)}),(0,V.jsx)(R,{value:v,options:[{value:`local`,label:c(b.BACKEND$KIND_LOCAL)},{value:`cloud`,label:c(b.BACKEND$KIND_CLOUD)}],onChange:e=>y(e),ariaLabel:c(b.BACKEND$KIND_LABEL),testId:`${t}-kind`})]}),(0,V.jsx)(L,{testId:`${t}-api-key`,name:`${t}-api-key`,type:`password`,label:c(b.BACKEND$KEY_LABEL),value:p,onChange:e=>{m(e),g(null)},placeholder:`sk-••••••••••`,className:`w-full`}),h?(0,V.jsx)(`div`,{role:`alert`,"data-testid":`${t}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:h}):null,(0,V.jsx)(P,{type:`submit`,variant:`secondary`,isDisabled:!x||_,testId:s??`${t}-submit`,className:`w-full text-center`,children:_?o:a})]})}function _e({onConnected:e,testIdRoot:t,lockedHost:n,analyticsSource:r}){let{t:a}=i(`openhands`),[o,s]=B.useState(!1),[c,l]=B.useState(``),u=n??(c.trim()||Z);return(0,V.jsxs)(`div`,{className:`flex flex-1 min-w-0 flex-col items-center gap-3 pb-8`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,V.jsx)(te,{width:56,height:56,"aria-hidden":!0}),(0,V.jsx)(`h4`,{className:N,"data-testid":`${t}-cloud-title`,children:a(b.BACKEND$CLOUD_TITLE)})]}),(0,V.jsx)(`p`,{className:`text-center text-sm leading-relaxed text-[var(--oh-muted)]`,children:a(b.BACKEND$CLOUD_DESCRIPTION)}),(0,V.jsx)(q,{host:u,onSuccess:t=>{e({name:`OpenHands Cloud`,host:Y(u),apiKey:t,kind:`cloud`},`cloud_login`)},testIdRoot:t,analyticsSource:r}),n?null:(0,V.jsxs)(`div`,{className:`w-full`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>s(e=>!e),"aria-expanded":o,"data-testid":`${t}-advanced-toggle`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,V.jsx)(`span`,{children:a(b.BACKEND$ADVANCED)}),(0,V.jsx)(H,{className:y(`h-4 w-4 shrink-0 text-muted transition-transform`,o&&`rotate-180`),"aria-hidden":!0})]}),(0,V.jsxs)(`div`,{className:y(`pt-2`,!o&&`pointer-events-none invisible`),"aria-hidden":!o,children:[(0,V.jsx)(L,{testId:`${t}-cloud-host`,name:`${t}-cloud-host`,type:`text`,label:a(b.BACKEND$HOST_LABEL),value:c,onChange:l,placeholder:Z,className:`w-full`}),(0,V.jsx)(`p`,{className:`mt-1 text-xs text-[var(--oh-muted)]`,children:a(b.BACKEND$LOGIN_CLOUD_HINT)})]})]})]})}function ve({onClose:e,source:t}){let{addBackend:n}=_(),r=he(),{trackBackendAdded:i}=D();return(0,V.jsx)($,{onConnected:B.useCallback((a,o,s)=>{n(a),i({backendKind:a.kind,connectionMethod:o,hasApiKey:!!a.apiKey,source:t,agentServerVersion:s?.agentServerVersion}),r(),e()},[n,r,e,i,t]),analyticsSource:t})}function ye({mode:e,backend:t,onClose:n,source:r=`add_backend_modal`,hideCloseButton:a=!1}){let{t:o}=i(`openhands`);if(e===`add`)return(0,V.jsx)(O,{onClose:a?void 0:n,closeOnEscape:!1,closeOnBackdropClick:!a,"aria-label":o(b.BACKEND$ADD_TITLE),children:(0,V.jsxs)(`div`,{"data-testid":a?`onboarding-modal`:`add-backend-modal`,className:y(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,A(`xl`),j),children:[a?null:(0,V.jsx)(I,{onClose:n,testId:`add-backend-close`}),a?null:(0,V.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,V.jsx)(`h2`,{className:M,children:o(b.BACKEND$ADD_TITLE)})}),(0,V.jsx)(`div`,{className:y(`px-6 pb-6`,a?`pt-6`:`pt-2`),children:(0,V.jsx)(ve,{onClose:n,source:r})})]})});let s=`edit-backend`;return(0,V.jsx)(O,{onClose:n,closeOnEscape:!1,"aria-label":o(b.BACKEND$EDIT_TITLE),children:(0,V.jsxs)(`div`,{"data-testid":`${s}-modal`,className:y(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,A(`md`)),children:[(0,V.jsx)(I,{onClose:n,testId:`${s}-close`}),(0,V.jsx)(`h2`,{className:y(`pr-6`,M),children:o(b.BACKEND$EDIT_TITLE)}),(0,V.jsx)(Q,{mode:`edit`,backend:t,onSubmitted:n,testIdRoot:s})]})})}export{q as a,H as c,oe as i,Q as n,W as o,ye as r,U as s,$ as t};
|