@openhands/agent-canvas 1.0.0-beta.7 → 1.0.0-beta.9
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 +2 -2
- package/README.windows.md +2 -2
- package/build/assets/{QueryClientProvider-Cnr-Yl3j.js → QueryClientProvider-w1cZWY41.js} +1 -1
- package/build/assets/{Trans-4jmk54WC.js → Trans-BJeYqz2A.js} +1 -1
- package/build/assets/{acp-providers-CPdgcp13.js → acp-providers-DJr8DlNG.js} +1 -1
- package/build/assets/{acp-route-guard-BoVmCn0e.js → acp-route-guard-A__sWgbc.js} +1 -1
- package/build/assets/{active-backend-context-Beu-LZL-.js → active-backend-context-I2w666XY.js} +1 -1
- package/build/assets/add-backend-modal-BDBDBXsJ.js +1 -0
- package/build/assets/agent-server-client-options-9agOSarV.js +1 -0
- package/build/assets/{agent-server-compatibility-CdI3N7dr.js → agent-server-compatibility-B7QStIcH.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-Cagoqq1V.js +5 -0
- package/build/assets/agent-settings-BXBaybB_.js +2 -0
- package/build/assets/{alert-banner-DFnn_lC6.js → alert-banner-NeUl1-PQ.js} +1 -1
- package/build/assets/analytics-consent-form-modal-CmWcFlc6.js +1 -0
- package/build/assets/{api-key-entry-screen-M6su2VSf.js → api-key-entry-screen-ByXA4hXH.js} +1 -1
- package/build/assets/{app-settings-BlvBhBdc.js → app-settings-C-U6jONZ.js} +1 -1
- package/build/assets/automation-detail-Dbmgt974.js +1 -0
- package/build/assets/automations-list-BLJzAd-p.js +1 -0
- package/build/assets/{back-nav-button-7dQJ2k3O.js → back-nav-button-DgkK0Ka6.js} +1 -1
- package/build/assets/{backend-form-modal-CDnEYjaU.js → backend-form-modal-CeB983Sj.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BTIj-Ffq.js → backend-synced-settings-badge-BktJcGgH.js} +1 -1
- package/build/assets/{base-modal-C2oy2EBG.js → base-modal-DZCNv0A4.js} +1 -1
- package/build/assets/{brand-button-DJ_S16rO.js → brand-button-LBFNic99.js} +1 -1
- package/build/assets/browser-D08Sp3ZY.js +5 -0
- package/build/assets/{browser-tab-dvSPdvkm.js → browser-tab-be3QvXg9.js} +1 -1
- package/build/assets/chat-send-button-5qz0zj6R.js +1 -0
- package/build/assets/{checkmark-Dus0b6jt.js → checkmark-Rmpruj7q.js} +1 -1
- package/build/assets/{chevron-left-small-_uvG7RVM.js → chevron-left-small-6nyFCWVQ.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-DKS8MAVV.js → circle-plus-check-toggle-DquBwJ_6.js} +1 -1
- package/build/assets/{close-BU5iTc66.js → close-D_o3d8QM.js} +1 -1
- package/build/assets/{code-tag-BzyqOtPD.js → code-tag-DhsjDB-v.js} +1 -1
- package/build/assets/{combobox-caret-BJC7XJsz.js → combobox-caret-CO7eozIY.js} +1 -1
- package/build/assets/{condenser-settings-BolbDvm5.js → condenser-settings-BulzYEuW.js} +1 -1
- package/build/assets/{confirmation-modal-B5Ca6qFE.js → confirmation-modal-CMAtd9R0.js} +1 -1
- package/build/assets/{context-menu-list-item-7tAcm2c3.js → context-menu-list-item-D0swnhFt.js} +1 -1
- package/build/assets/conversation-BrjF2-Ky.js +1 -0
- package/build/assets/conversation-HgR_TTPE.js +19 -0
- package/build/assets/conversation-panel-BlRcO5AC.js +1 -0
- package/build/assets/conversation-service.api-B_Pdmwsa.js +1 -0
- package/build/assets/{conversation-tab-empty-state-CStQLPVW.js → conversation-tab-empty-state-DYjKsg_c.js} +1 -1
- package/build/assets/conversation-websocket-context-G95yfL81.js +3 -0
- package/build/assets/{copy-Chg-sFu3.js → copy-BM0RpLez.js} +1 -1
- package/build/assets/{custom-toast-handlers-ufGJ6_Rc.js → custom-toast-handlers-BohXx7uh.js} +1 -1
- package/build/assets/{declaration-CR6HMp29.js → declaration-DaUdB2Wg.js} +1 -1
- package/build/assets/{device-verify-C6mj28zv.js → device-verify-DiEJqpJb.js} +1 -1
- package/build/assets/dist-Bl-1K5Tv.js +1 -0
- package/build/assets/{dist-C3NfioQC.js → dist-xtCm0O6P.js} +1 -1
- package/build/assets/{dropdown-classes-BsVmxlNG.js → dropdown-classes-Vqz86I0R.js} +1 -1
- package/build/assets/{edit-automation-modal-BpX-t-HD.js → edit-automation-modal-CNZgSSiH.js} +1 -1
- package/build/assets/{entry.client-Ck9rQCg-.js → entry.client-BvKgdCQ9.js} +2 -2
- package/build/assets/{enum-filter-dropdown-5JeF2RLb.js → enum-filter-dropdown-DdFgk0EM.js} +1 -1
- package/build/assets/{environment-switch-overlay-Tf_BIfeR.js → environment-switch-overlay-CuBuZOaa.js} +1 -1
- package/build/assets/{extensions-hub-CE9QOb5n.js → extensions-hub-Dayqvv0n.js} +1 -1
- package/build/assets/{extensions-navigation-DSLGNGbS.js → extensions-navigation-yFLAU06N.js} +1 -1
- package/build/assets/{file-BTY6Gyy9.js → file-DwHCkWZT.js} +1 -1
- package/build/assets/files-tab-CMredyYX.js +1 -0
- package/build/assets/{folder-D1T2W1cj.js → folder-2h1hR1Qb.js} +1 -1
- package/build/assets/git-control-bar-branch-button-D8blTNXh.js +27 -0
- package/build/assets/{globe-Bzj_0oXT.js → globe-qFjFNG6J.js} +1 -1
- package/build/assets/home-TrU0fLgG.js +1 -0
- package/build/assets/{i18n-DET2iOyh.js → i18n-zDndR1Ne.js} +1 -1
- package/build/assets/install-server-modal-D8Q0xZcN.js +1 -0
- package/build/assets/{launch-CWz0dm4o.js → launch-I00QV8YT.js} +1 -1
- package/build/assets/{lesson-plan-duSsqWVs.js → lesson-plan-C18uB_56.js} +1 -1
- package/build/assets/{link-external-DGxVm4Ps.js → link-external-DtcdPFbw.js} +1 -1
- package/build/assets/{llm-client-CYEaUjGx.js → llm-client-BqyLKgUN.js} +1 -1
- package/build/assets/llm-settings-C4R4HMUO.js +1 -0
- package/build/assets/llm-settings-Dq3w2cob.js +1 -0
- package/build/assets/{loading-spinner-5GT9q1xy.js → loading-spinner-DNwR4--Z.js} +1 -1
- package/build/assets/{manage-backends-modal-DpBD_vR9.js → manage-backends-modal-Ceo_SOcf.js} +1 -1
- package/build/assets/manifest-8c2efa8a.js +1 -0
- package/build/assets/{markdown-renderer-B3IAVfv4.js → markdown-renderer-D6B-u2nM.js} +1 -1
- package/build/assets/{mcp-BUe7kiYM.js → mcp-EvrLVTla.js} +1 -1
- package/build/assets/messages-Bz9TWjlh.js +36 -0
- package/build/assets/modal-backdrop-BDqI1zBV.js +1 -0
- package/build/assets/{modal-body-aoa2fx5W.js → modal-body-CCLCqX1J.js} +1 -1
- package/build/assets/{modal-classes-6YqcqA6y.js → modal-classes-DwTdT3IK.js} +1 -1
- package/build/assets/{modal-close-button-CtWOUMmw.js → modal-close-button-gQgKqUf-.js} +1 -1
- package/build/assets/{model-selector-BvSTrkhT.js → model-selector-DoL0CL0_.js} +1 -1
- package/build/assets/{mutation-D0OogFCz.js → mutation-CaJwPR9O.js} +1 -1
- package/build/assets/{navigation-context-BdKYH32C.js → navigation-context-aNGUUtdq.js} +1 -1
- package/build/assets/{navigation-link-U4vY9i_C.js → navigation-link-CYkF2y3K.js} +1 -1
- package/build/assets/onboarding-DLr9jbKH.js +1 -0
- package/build/assets/{openhands-logo-CCo0wJZX.js → openhands-logo-CHmtDV-t.js} +1 -1
- package/build/assets/{option-service.api-DmNVxAvS.js → option-service.api-CGNANEcT.js} +1 -1
- package/build/assets/{organization-service.api-DbnougaQ.js → organization-service.api-Dn74hBTH.js} +1 -1
- package/build/assets/path-utils-BjxzIGLp.js +1 -0
- package/build/assets/{plan-components-CRDMQzsS.js → plan-components--aLlpASH.js} +1 -1
- package/build/assets/{planner-tab-CmIjLz7q.js → planner-tab-B-5EeCEm.js} +1 -1
- package/build/assets/{profiles-client-fEmgWkCW.js → profiles-client-BrqNmaDV.js} +1 -1
- package/build/assets/{providers-CbD7fiic.js → providers-DknP6O2g.js} +1 -1
- package/build/assets/{proxy-BAdHH8QB.js → proxy-sRh0WKI7.js} +1 -1
- package/build/assets/{query-client-config-CRnGSujB.js → query-client-config-CWWGQWvw.js} +1 -1
- package/build/assets/{recommended-automations-launcher-uTyODuzB.js → recommended-automations-launcher-BIul0osB.js} +3 -3
- package/build/assets/root-BietmyRa.js +2 -0
- package/build/assets/{root-Z2VHU4R3.css → root-CN7qsvxg.css} +1 -1
- package/build/assets/root-layout-BgPi-t57.js +2 -0
- package/build/assets/{sdk-section-page-BgDlMhcq.js → sdk-section-page-VmtJWH3A.js} +1 -1
- package/build/assets/{sdk-settings-schema-CLmJ9sho.js → sdk-settings-schema-DFievvEK.js} +1 -1
- package/build/assets/{search-SuJctqNJ.js → search-BeVRXvX7.js} +1 -1
- package/build/assets/{secrets-service-B7CxNinp.js → secrets-service-DVtlLWY8.js} +1 -1
- package/build/assets/{secrets-settings-yK7CqIpm.js → secrets-settings-BLMvCkKm.js} +1 -1
- package/build/assets/{server-client-Kh4QSwDJ.js → server-client-DYv_GHPl.js} +1 -1
- package/build/assets/{settings-DN5PpgRD.js → settings-CXvJUx_j.js} +1 -1
- package/build/assets/{settings-dropdown-input-BtoovFre.js → settings-dropdown-input-DA_pzHWE.js} +1 -1
- package/build/assets/{settings-gear-Dd8K2_8B.js → settings-gear-aNebYlCy.js} +1 -1
- package/build/assets/{settings-index-DKC8IY1P.js → settings-index-CycvkOoq.js} +1 -1
- package/build/assets/{settings-input-CehsXnb3.js → settings-input-8y5p4kze.js} +1 -1
- package/build/assets/{settings-list-classes-E3v_f6QG.js → settings-list-classes-Qk7zl0Wu.js} +1 -1
- package/build/assets/settings-modal-nJYxCsyp.js +1 -0
- package/build/assets/{settings-section-header-context-DewwJ0-F.js → settings-section-header-context-B77tsYlx.js} +1 -1
- package/build/assets/{settings-service.api-C3rxTtPj.js → settings-service.api-DxIEtvx6.js} +1 -1
- package/build/assets/{settings-switch-BiBuS3xa.js → settings-switch-ba4DuiNO.js} +1 -1
- package/build/assets/{settings-utils-DY04tWG1.js → settings-utils-BxzHqLmZ.js} +1 -1
- package/build/assets/{shared-conversation-h9YnBtCU.js → shared-conversation-x41nZQi7.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-D0-AvsnT.js → sidebar-mobile-menu-toggle-C0mmabKj.js} +1 -1
- package/build/assets/{sidebar-nav-link-OhIeFyna.js → sidebar-nav-link-BsYdDFfb.js} +1 -1
- package/build/assets/{skill-card-pill-row-BW9qvhoK.js → skill-card-pill-row-BhUlGcYB.js} +1 -1
- package/build/assets/{skills-0GRKX5Xj.js → skills-TYjOUQ2d.js} +1 -1
- package/build/assets/{skills-plugins-DNcsNF88.js → skills-plugins-D0pdqgKa.js} +1 -1
- package/build/assets/{skills-settings-7liFiSY6.js → skills-settings-VqKTkmVl.js} +2 -2
- package/build/assets/{styled-tooltip-hdfMXPQC.js → styled-tooltip-TCp7svY3.js} +1 -1
- package/build/assets/{switch-skeleton-DSKqSx2A.js → switch-skeleton-cKrdaYGj.js} +1 -1
- package/build/assets/{task-list-tab-DT6_zfUs.js → task-list-tab-BiizRsY3.js} +1 -1
- package/build/assets/telemetry-3piyXm5H.js +2 -0
- package/build/assets/{terminal-CPYWdo4j.js → terminal-BSYITdM0.js} +1 -1
- package/build/assets/{terminal-CDhQGDua.js → terminal-CpgZx6go.js} +1 -1
- package/build/assets/{toggle-switch-T2v6sJ6l.js → toggle-switch-CUgOZqZu.js} +1 -1
- package/build/assets/{typography-BDgnT7Yp.js → typography-Bvw0IxaN.js} +1 -1
- package/build/assets/{u-check-circle-half-steSK_JB.js → u-check-circle-half-DjpjzWu3.js} +1 -1
- package/build/assets/{u-check-circle-DOauqQKb.js → u-check-circle-u9QiS4Fr.js} +1 -1
- package/build/assets/{u-circuit-x3ExjBbU.js → u-circuit-DlBlOwx9.js} +1 -1
- package/build/assets/{u-edit-BbrptMCa.js → u-edit-BIYzjs3v.js} +1 -1
- package/build/assets/{use-active-conversation-DHGcmjCK.js → use-active-conversation-q1wT8LI5.js} +1 -1
- package/build/assets/{use-agent-settings-schema-CLoTOSJI.js → use-agent-settings-schema-Yxf7KGyG.js} +1 -1
- package/build/assets/{use-agent-state-PKrUPMJ3.js → use-agent-state-CCHlVqvY.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-Ddr75hEz.js → use-cloud-current-user-id-BAKf91Zx.js} +1 -1
- package/build/assets/{use-config-OIMQLQ2s.js → use-config-DwfigQ_Y.js} +1 -1
- package/build/assets/use-create-conversation-BEzddjXn.js +1 -0
- package/build/assets/{use-get-secrets-8Jby8ele.js → use-get-secrets-BlO1BfUo.js} +1 -1
- package/build/assets/{use-handle-plan-click-CohJPvvW.js → use-handle-plan-click-Bfl0zIBr.js} +1 -1
- package/build/assets/use-is-authed-hHndEep7.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-sQNEOLGD.js → use-launch-skill-in-chat-3ydwpi_M.js} +1 -1
- package/build/assets/use-llm-profiles-E-jjZMZw.js +1 -0
- package/build/assets/use-runtime-is-ready-DBWzvAmc.js +1 -0
- package/build/assets/use-save-settings-rE9aA29R.js +1 -0
- package/build/assets/{use-settings-D5hbTS9t.js → use-settings-BPTbE7lg.js} +1 -1
- package/build/assets/{use-settings-nav-items-BcSbo02d.js → use-settings-nav-items-C7MOWj09.js} +1 -1
- package/build/assets/{use-skills-D7PS0fH0.js → use-skills-QhoaIYGF.js} +1 -1
- package/build/assets/{use-task-list-CsT10CBb.js → use-task-list-YMkSzdDv.js} +1 -1
- package/build/assets/use-tracking-DQYdZpxi.js +1 -0
- package/build/assets/{use-unified-vscode-url-DEoe-NRI.js → use-unified-vscode-url-DFtNIC1Q.js} +1 -1
- package/build/assets/{use-user-conversation-Cs5H1pUF.js → use-user-conversation-BRAseenw.js} +1 -1
- package/build/assets/{useMutation-GSSKKebK.js → useMutation-DDo48A8t.js} +1 -1
- package/build/assets/{useTranslation-B6voJV4y.js → useTranslation-CEcjrme-.js} +1 -1
- package/build/assets/{utils-DCVfKFRt.js → utils-CdgBzLA7.js} +1 -1
- package/build/assets/{vendor~browser-BrOJLj3y.js → vendor~browser-DWk6fNtJ.js} +1 -1
- package/build/assets/{vendor~browser-tab-BxhTtM9_.js → vendor~browser-tab-NZdVoI2Z.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation-C9o-K1hW.js → vendor~conversation-panel~conversation-gp03cWZW.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation~index-RXYdJYxU.js → vendor~conversation-panel~conversation~index-BZ5C6Xpz.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js} +1 -1
- package/build/assets/{vendor~files-tab-BtkpAiMX.js → vendor~files-tab-Buz36Y-q.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation-PK1-gtXU.js → vendor~home~conversation-panel~conversation-DG0H5SkJ.js} +2 -2
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-6ByzelMS.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-1pTajrpX.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BED5W_c4.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9Il_wz8U.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CCbqAFiI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B7I1ZxCx.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-E4d6IEfI.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ceeqkj0k.js} +1 -1
- package/build/assets/{vendor~launch-BXgl67Re.js → vendor~launch-DXL78kBf.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-DW31UyBp.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-CfAc3nMS.js} +1 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation-DkwcKRtv.js +1 -0
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BC9XTECT.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DSqEbr0N.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-D0XUSHNN.js} +2 -2
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-hTzSytKK.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-d2oallMa.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js} +1 -1
- package/build/assets/vendor~root-layout~home~mcp~automations-list-BnIlGhjl.js +1 -0
- package/build/assets/{vendor~home~mcp~automations-list-BgV86Sti.js → vendor~root-layout~home~mcp~automations-list-cNHi83v_.js} +1 -1
- package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BGWUbqUq.js} +1 -1
- package/build/assets/{vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BuCSnjsW.js} +2 -2
- package/build/assets/{vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js → vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js} +1 -1
- package/build/assets/{verification-settings-Dlt8pINd.js → verification-settings-CIqtxWat.js} +1 -1
- package/build/assets/{vscode-tab-DgepcYtF.js → vscode-tab-DEt72yJX.js} +1 -1
- package/build/assets/{waiting-for-runtime-message-CdK3btDZ.js → waiting-for-runtime-message-DSjJfeoj.js} +1 -1
- package/build/assets/{x-mark-BrkSPIiT.js → x-mark-DsJ9tDD0.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +4 -2
- package/build/locales/ca/openhands.json +4 -2
- package/build/locales/de/openhands.json +4 -2
- package/build/locales/en/openhands.json +4 -2
- package/build/locales/es/openhands.json +4 -2
- package/build/locales/fr/openhands.json +4 -2
- package/build/locales/it/openhands.json +4 -2
- package/build/locales/ja/openhands.json +4 -2
- package/build/locales/ko-KR/openhands.json +4 -2
- package/build/locales/no/openhands.json +4 -2
- package/build/locales/pt/openhands.json +4 -2
- package/build/locales/tr/openhands.json +4 -2
- package/build/locales/uk/openhands.json +4 -2
- package/build/locales/zh-CN/openhands.json +4 -2
- package/build/locales/zh-TW/openhands.json +4 -2
- package/config/defaults.json +1 -1
- package/dist/api/agent-server-config.cjs +1 -1
- package/dist/api/agent-server-config.cjs.map +1 -1
- package/dist/api/agent-server-config.d.ts +17 -0
- package/dist/api/agent-server-config.js +7 -1
- package/dist/api/agent-server-config.js.map +1 -1
- package/dist/api/agent-server-home.cjs +2 -0
- package/dist/api/agent-server-home.cjs.map +1 -0
- package/dist/api/agent-server-home.d.ts +34 -0
- package/dist/api/agent-server-home.js +33 -0
- package/dist/api/agent-server-home.js.map +1 -0
- package/dist/api/conversation-file-upload.api.cjs +1 -1
- package/dist/api/conversation-file-upload.api.cjs.map +1 -1
- package/dist/api/conversation-file-upload.api.js +4 -1
- package/dist/api/conversation-file-upload.api.js.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +101 -100
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/option-service/option-service.api.cjs.map +1 -1
- package/dist/api/option-service/option-service.api.js.map +1 -1
- package/dist/api/workspace-upload-path.cjs +1 -1
- package/dist/api/workspace-upload-path.cjs.map +1 -1
- package/dist/api/workspace-upload-path.d.ts +44 -2
- package/dist/api/workspace-upload-path.js +16 -14
- package/dist/api/workspace-upload-path.js.map +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +3 -1
- package/dist/components/features/automations/recommended-automations-section.d.ts +3 -1
- 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.d.ts +7 -1
- package/dist/components/features/backends/backend-form-modal.js +94 -91
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +66 -66
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/confirmation-mode-enabled.cjs +1 -1
- package/dist/components/features/chat/confirmation-mode-enabled.js +4 -4
- package/dist/components/features/chat/switch-profile-button.cjs +1 -1
- package/dist/components/features/chat/switch-profile-button.js +3 -3
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +5 -5
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
- package/dist/components/features/onboarding/index.d.ts +1 -0
- package/dist/components/features/onboarding/onboarding-host.d.ts +3 -1
- package/dist/components/features/onboarding/onboarding-modal.d.ts +7 -3
- package/dist/components/features/onboarding/onboarding-preview.d.ts +4 -0
- package/dist/components/features/onboarding/steps/say-hello-step.d.ts +3 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs +1 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs.map +1 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.d.ts +3 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.js +56 -56
- package/dist/components/features/settings/sdk-settings/sdk-section-page.js.map +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.js +7 -7
- package/dist/components/shared/modals/modal-backdrop.cjs +1 -1
- package/dist/components/shared/modals/modal-backdrop.cjs.map +1 -1
- package/dist/components/shared/modals/modal-backdrop.d.ts +3 -1
- package/dist/components/shared/modals/modal-backdrop.js +3 -3
- package/dist/components/shared/modals/modal-backdrop.js.map +1 -1
- package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
- package/dist/components/shared/modals/settings/settings-form.cjs.map +1 -1
- package/dist/components/shared/modals/settings/settings-form.js +7 -7
- package/dist/components/shared/modals/settings/settings-form.js.map +1 -1
- package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
- package/dist/hooks/chat/use-model-interceptor.js +4 -4
- package/dist/hooks/mutation/use-save-settings.cjs +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs.map +1 -1
- package/dist/hooks/mutation/use-save-settings.js +13 -14
- package/dist/hooks/mutation/use-save-settings.js.map +1 -1
- package/dist/hooks/query/use-llm-profiles.cjs +1 -1
- package/dist/hooks/query/use-llm-profiles.js +5 -5
- package/dist/hooks/use-download-conversation.cjs +1 -1
- package/dist/hooks/use-download-conversation.cjs.map +1 -1
- package/dist/hooks/use-download-conversation.js +4 -4
- package/dist/hooks/use-download-conversation.js.map +1 -1
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +31 -0
- package/dist/hooks/use-tracking.js +51 -14
- 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 +2 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +1 -1
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +64 -30
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +4 -2
- package/dist/locales/ca/openhands.json +4 -2
- package/dist/locales/de/openhands.json +4 -2
- package/dist/locales/en/openhands.json +4 -2
- package/dist/locales/es/openhands.json +4 -2
- package/dist/locales/fr/openhands.json +4 -2
- package/dist/locales/it/openhands.json +4 -2
- package/dist/locales/ja/openhands.json +4 -2
- package/dist/locales/ko-KR/openhands.json +4 -2
- package/dist/locales/no/openhands.json +4 -2
- package/dist/locales/pt/openhands.json +4 -2
- package/dist/locales/tr/openhands.json +4 -2
- package/dist/locales/uk/openhands.json +4 -2
- package/dist/locales/zh-CN/openhands.json +4 -2
- package/dist/locales/zh-TW/openhands.json +4 -2
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.d.ts +3 -1
- package/dist/routes/llm-settings.js +17 -16
- package/dist/routes/llm-settings.js.map +1 -1
- package/package.json +1 -1
- package/scripts/dev-static.mjs +0 -2
- package/scripts/dev-with-automation.mjs +0 -2
- package/scripts/static-server.mjs +28 -6
- package/build/assets/add-backend-modal-BheqYXHK.js +0 -1
- package/build/assets/agent-server-client-options-HEOwGVIU.js +0 -1
- package/build/assets/agent-server-conversation-service.api-CORdqJZg.js +0 -5
- package/build/assets/agent-settings-UFvcGjoI.js +0 -2
- package/build/assets/analytics-consent-form-modal-CVNugqzu.js +0 -1
- package/build/assets/automation-detail-BWrQk4Oa.js +0 -1
- package/build/assets/automations-list-ux9KvYsU.js +0 -1
- package/build/assets/browser-CGM-k-sH.js +0 -5
- package/build/assets/conversation-D0N4dw_p.js +0 -19
- package/build/assets/conversation-DhRJuZLG.js +0 -1
- package/build/assets/conversation-panel-CNqHbS_Z.js +0 -1
- package/build/assets/conversation-service.api-BsJy6uuL.js +0 -1
- package/build/assets/conversation-websocket-context-DvHgx_FE.js +0 -3
- package/build/assets/dist-DNeWJ2bh.js +0 -1
- package/build/assets/ellipsis-button-Vh5MvRZa.js +0 -1
- package/build/assets/files-tab-cL668j1I.js +0 -1
- package/build/assets/git-branch-DQS2nMK4.js +0 -1
- package/build/assets/git-control-bar-branch-button-DtIrOrie.js +0 -27
- package/build/assets/git-provider-icon-CHdGBdU2.js +0 -1
- package/build/assets/home-Cz2Veg56.js +0 -1
- package/build/assets/install-server-modal-B9nXCS3u.js +0 -1
- package/build/assets/llm-settings-DFkXHuvT.js +0 -1
- package/build/assets/llm-settings-DhrdCXqX.js +0 -1
- package/build/assets/manage-workspaces-modal-CtRbxREx.js +0 -1
- package/build/assets/manifest-eed90ff5.js +0 -1
- package/build/assets/messages-dqp_KYyl.js +0 -36
- package/build/assets/modal-backdrop-RfNCrSpK.js +0 -1
- package/build/assets/path-utils-onx24uF5.js +0 -1
- package/build/assets/root-DmjpFpTu.js +0 -2
- package/build/assets/root-layout-DejMsKhy.js +0 -2
- package/build/assets/settings-modal-DJ4kGzUx.js +0 -1
- package/build/assets/use-create-conversation-Bszyp13O.js +0 -1
- package/build/assets/use-is-authed-dw2026rR.js +0 -1
- package/build/assets/use-is-creating-conversation-DX2qSlfL.js +0 -1
- package/build/assets/use-llm-profiles-C861aFAq.js +0 -1
- package/build/assets/use-runtime-is-ready-Do2h_hRl.js +0 -1
- package/build/assets/use-save-settings-DkAOEfD9.js +0 -1
- package/build/assets/vendor~home~mcp~automations-list-CZSK-lT2.js +0 -1
- package/build/assets/vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js +0 -1
- /package/build/assets/{automation-XDPAjiZi.js → automation-DJ_3GeXD.js} +0 -0
- /package/build/assets/{browser-store-DAsixKdU.js → browser-store-JRrcGdlk.js} +0 -0
- /package/build/assets/{check-CYxAHs85.js → check-CZhEL6rP.js} +0 -0
- /package/build/assets/{chevron-down-Bnmd5iG-.js → chevron-down-KhWYEjeW.js} +0 -0
- /package/build/assets/{color-themes-B9pm9c-R.js → color-themes-0biOprdo.js} +0 -0
- /package/build/assets/{command-store-CE1weJy8.js → command-store-UzKGSUC2.js} +0 -0
- /package/build/assets/{files-tab-store-m0ARqX_E.js → files-tab-store-DLU28g8C.js} +0 -0
- /package/build/assets/{iconBase-DE30Zj_-.js → iconBase-BVhFI-0E.js} +0 -0
- /package/build/assets/{map-provider-BJ_8KZKU.js → map-provider-C3Z5Dx2J.js} +0 -0
- /package/build/assets/{sdk-settings-field-metadata-DQiaIBie.js → sdk-settings-field-metadata-C6KMD-jZ.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-D7YjdTd0.js → settings-like-page-layout-classes-DNg2vKSM.js} +0 -0
- /package/build/assets/{use-breakpoint-DF_RiQ6s.js → use-breakpoint-DpxHDmuH.js} +0 -0
- /package/build/assets/{use-event-store-BomO7ywK.js → use-event-store-Cxqc45Sw.js} +0 -0
- /package/build/assets/{vendor~browser-DisFGEp9.js → vendor~browser-BDNLFng6.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js → vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~hkqzh1hb-BZ0HXuHD.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-OFpe9fX_.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BPuuVEqr.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CG96FCly.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CXivI4Ym.js} +0 -0
- /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CyZ-3lDQ.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dr3Ow7Ms.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-B1TKKuuH.js} +0 -0
- /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js} +0 -0
- /package/build/assets/{vendor~terminal-DZaJIY8A.js → vendor~terminal-0ObOedYm.js} +0 -0
- /package/build/assets/{vscode-url-helper-Cwy1A62q.js → vscode-url-helper-BMq8JBhB.js} +0 -0
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ agent-canvas --backend-only # agent server + automation backend + ingress only
|
|
|
74
74
|
|
|
75
75
|
**macOS / Linux:**
|
|
76
76
|
```sh
|
|
77
|
-
docker pull ghcr.io/openhands/agent-canvas:1.0.0-beta.
|
|
77
|
+
docker pull ghcr.io/openhands/agent-canvas:1.0.0-beta.9
|
|
78
78
|
|
|
79
79
|
export PROJECTS_PATH="$HOME/projects" # directory containing your project folders
|
|
80
80
|
mkdir -p "$PROJECTS_PATH" "$HOME/.openhands"
|
|
@@ -83,7 +83,7 @@ docker run -it --rm \
|
|
|
83
83
|
-p 8000:8000 \
|
|
84
84
|
-v "$HOME/.openhands:/home/openhands/.openhands" \
|
|
85
85
|
-v "${PROJECTS_PATH}:/projects" \
|
|
86
|
-
ghcr.io/openhands/agent-canvas:1.0.0-beta.
|
|
86
|
+
ghcr.io/openhands/agent-canvas:1.0.0-beta.9
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
**Windows (PowerShell / Windows Terminal):** See [README.windows.md](./README.windows.md) for the equivalent commands.
|
package/README.windows.md
CHANGED
|
@@ -12,7 +12,7 @@ For the main install options and overall context, see [README.md](./README.md).
|
|
|
12
12
|
- A host directory for `PROJECTS_PATH` containing the project folders you want the agent to access (create it before starting the container)
|
|
13
13
|
|
|
14
14
|
```powershell
|
|
15
|
-
docker pull ghcr.io/openhands/agent-canvas:1.0.0-
|
|
15
|
+
docker pull ghcr.io/openhands/agent-canvas:1.0.0-beta.9
|
|
16
16
|
|
|
17
17
|
$env:PROJECTS_PATH = Join-Path $HOME "projects" # directory containing your project folders
|
|
18
18
|
New-Item -ItemType Directory -Force -Path $env:PROJECTS_PATH, (Join-Path $env:USERPROFILE ".openhands") | Out-Null
|
|
@@ -21,7 +21,7 @@ docker run -it --rm `
|
|
|
21
21
|
-p 8000:8000 `
|
|
22
22
|
-v "$($env:USERPROFILE)\.openhands:/home/openhands/.openhands" `
|
|
23
23
|
-v "$($env:PROJECTS_PATH):/projects" `
|
|
24
|
-
ghcr.io/openhands/agent-canvas:1.0.0-
|
|
24
|
+
ghcr.io/openhands/agent-canvas:1.0.0-beta.9
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
The agent will be able to access any project under `PROJECTS_PATH`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-DaUdB2Wg.js";var r=e(t(),1),i=n(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t}));export{o as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{a as r,i,r as a}from"./declaration-
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{a as r,i,r as a}from"./declaration-DaUdB2Wg.js";import{i as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js";import{a as s,i as c,n as l,r as u}from"./useTranslation-CEcjrme-.js";import{t as d}from"./context-CEQZwATj.js";var f=t(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}})),p=e(n()),m=e(f()),h=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function g(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(m.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(h),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var _=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,v=/^\s*$/,y=Object.create(null);function b(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>`),t.voidElement?e:e+t.children.reduce(b,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var x={parse:function(e,t){t||={},t.components||=y;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(_,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=g(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=g(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),_=e.slice(f,h===-1?void 0:h);v.test(_)&&(_=` `),(h>-1&&a+l.length>=0||_!==` `)&&l.push({type:`text`,content:_})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+b(``,t)},``)}},S=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},C=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?T(t):t},w=e=>Array.isArray(e)&&e.every(p.isValidElement),T=e=>Array.isArray(e)?e:[e],E=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},D=e=>{let t={};if(!e)return t;let n=e=>{T(e).forEach(e=>{u(e)||(S(e)?n(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},O=(e,t,n,r)=>{if(!e)return``;let i=``,a=T(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((e,a)=>{if(u(e)){i+=`${e}`;return}if((0,p.isValidElement)(e)){let{props:s,type:c}=e,l=Object.keys(s).length,d=o.indexOf(c)>-1,f=s.children;if(!f&&d&&!l){i+=`<${c}/>`;return}if(!f&&(!d||l)||s.i18nIsDynamicList){i+=`<${a}></${a}>`;return}if(d&&l<=1){let e=u(f)?f:O(f,t,n,r);i+=`<${c}>${e}</${c}>`;return}let p=O(f,t,n,r);i+=`<${a}>${p}</${a}>`;return}if(e===null){c(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(l(e)){let{format:t,...a}=e,o=Object.keys(a);if(o.length===1){let e=t?`${o[0]}, ${t}`:o[0];i+=`{{${e}}}`;return}c(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}c(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},k=(e,t=[],n={})=>{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`<`,o+=1)}else a+=e[o],o+=1;return a},A=(e,t,n,a,o,s,c)=>{if(n===``)return[];let d=o.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(d.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!f&&!c)return[n];let m=t??{},h=e=>{T(e).forEach(e=>{u(e)||(S(e)?h(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=k(n,d,m),_=x.parse(`<0>${g}</0>`),v={...m,...s},y=(e,t,n)=>{let r=C(e),i=D(r,t.children,n);return w(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,p.cloneElement)(e,{key:r},i?void 0:t))):n.push(...p.Children.map([e],e=>{if(e.type===p.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,p.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,p.cloneElement)(e,n,i?null:t)}))},D=(e,n,s)=>{let m=T(e),h=T(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&a.services.interpolator.interpolate(n.children[0].content,v,a.language);if(n.type===`tag`){let i=m[parseInt(n.name,10)];!i&&t&&(i=t[n.name]),s.length===1&&!i&&(i=s[0][n.name]),i||={};let x={...n.attrs};c&&Object.keys(x).forEach(e=>{let t=x[e];u(t)&&(x[e]=r(t))});let w=Object.keys(x).length===0?i:E({props:x},i),O=(0,p.isValidElement)(w),k=O&&S(n,!0)&&!n.voidElement,A=f&&l(w)&&w.dummy&&!O,j=l(t)&&Object.hasOwnProperty.call(t,n.name);if(u(w)){let t=a.services.interpolator.interpolate(w,v,a.language);e.push(t)}else if(S(w)||k)b(w,y(w,n,s),e,h);else if(A)b(w,D(m,n.children,s),e,h);else if(Number.isNaN(parseFloat(n.name)))if(j)b(w,y(w,n,s),e,h,n.voidElement);else if(o.transSupportBasicHtmlNodes&&d.indexOf(n.name)>-1)if(n.voidElement)e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,p.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=D(r?T(C(r)):m,n.children,s);e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`},a))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=D(m,n.children,s);e.push(`<${n.name}>${t}</${n.name}>`)}else if(l(w)&&!O){let t=n.children[0]?_:null;t&&e.push(t)}else b(w,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=o.transWrapTextNodes,r=typeof o.unescape==`function`?o.unescape:i().unescape,s=c?r(a.services.interpolator.interpolate(n.content,v,a.language)):a.services.interpolator.interpolate(n.content,v,a.language);t?e.push((0,p.createElement)(t,{key:`${n.name}-${h}`},s)):e.push(s)}return e},[])};return C(D([{dummy:!0,children:e||[]}],_,T(e||[]))[0])},j=(e,t,n)=>{let r=e.key||t,i=(0,p.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,p.createElement)(p.Fragment,null,i)}return(0,p.createElement)(a,{key:r})},M=(e,t)=>e.map((e,n)=>j(e,n,t)),N=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:j(e[r],r,t)})}),n},P=(e,t,n,r)=>e?Array.isArray(e)?M(e,t):l(e)?N(e,t):(s(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,F=e=>!l(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function I({children:e,count:t,parent:n,i18nKey:r,context:c,tOptions:l={},values:d,defaults:f,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||a();if(!b)return s(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:r}),e;let x=_||b.t.bind(b)||(e=>e),S={...i(),...b.options?.react},C=h||x.ns||b.options?.defaultNS;C=u(C)?[C]:C||[`translation`];let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...l}:l,E=v??w?.shouldUnescape,k=w?.values?{...w.values,...d}:d,j=w?.components?{...w.components,...m}:m,M=O(e,S,b,r),N=f||T?.defaultValue||M||S.transEmptyNodeValue||(typeof r==`function`?o(r):r),{hashTransKey:I}=S,L=r||(I?I(M||N):M||N);d=b.options?.interpolation?.defaultVariables?k&&Object.keys(k).length>0?{...k,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:k;let R=D(e);R&&typeof R.count==`number`&&t===void 0&&(t=R.count);let z=d||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:c||T.context,count:t,...d,...z,defaultValue:N,ns:C},V=L?x(L,B):N;V===L&&N&&(V=N);let H=P(j,V,b,r),U=H||e,W=null;F(H)&&(W=H,U=e);let G=A(U,W,V,b,S,B,E),K=n??S.defaultTransParent;return K?(0,p.createElement)(K,y,G):G}function L({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:o={},values:s,defaults:c,components:l,ns:u,i18n:f,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,p.useContext)(d)||{},y=f||_||a(),b=m||y?.t.bind(y);return I({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:o,values:s,defaults:c,components:l,ns:u||b?.ns||v||y?.options?.defaultNS,i18n:y,t:m,shouldUnescape:h,...g})}export{L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./declaration-
|
|
1
|
+
import{t as e}from"./declaration-DaUdB2Wg.js";import{t}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";var n=`cli-generic`,r=new Set([`default`,`default (recommended)`]);function i(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||r.has(t.toLowerCase())||t===`acp-managed`?null:t}function a(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=i(t);if(e)return e}return e.providerDefault??null}var o={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},s=Object.entries(o).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`;function l(n){let r=n?t(n):null;if(!r)return[];let i=[];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function u(e){if(e)return s.find(t=>t.key===e)}function d(e){let t=u(e);return t?t.display_name:null}function f(e){return u(e)?.icon??`cli-generic`}function p(e,t){return t?u(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function m(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:u(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?r?.default_model??null:t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{u as a,p as c,m as i,f as l,s as n,d as o,n as r,l as s,c as t,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{r as t}from"./query-client-config-
|
|
1
|
+
import{E as e}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{r as t}from"./query-client-config-CWWGQWvw.js";import{d as n}from"./agent-server-client-options-9agOSarV.js";import{a as r}from"./query-keys-tAsQcc_9.js";import{n as i}from"./use-settings-BPTbE7lg.js";async function a(){try{let a=n();if((await t.fetchQuery({queryKey:[...r.byScope(`personal`),a.backend.id,a.orgId],queryFn:()=>i(`personal`),staleTime:0}))?.agent_settings?.agent_kind===`acp`)return e(`/settings/agent`)}catch{}return null}export{a as t};
|
package/build/assets/{active-backend-context-Beu-LZL-.js → active-backend-context-I2w666XY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n}from"./declaration-DaUdB2Wg.js";import{a as r,t as i}from"./health-store-B5f0S2FY.js";import{_ as a,f as o,h as s,m as c,u as l,v as u,x as d,y as f}from"./agent-server-client-options-9agOSarV.js";var p=e(t(),1),m=n(),h=p.createContext(null);function g(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function _({children:e}){let t=p.useSyncExternalStore(f,s,s),n=p.useCallback((e,t)=>{let n=o()?.backendId??null,r=o()?.orgId??null,i=t??null;e===n&&i===r||a({backendId:e,orgId:i})},[]),l=p.useCallback(e=>{let t={...e,id:g()};return u([...c(),t]),a({backendId:t.id}),t},[]),d=p.useCallback((e,t)=>{let n=c().find(t=>t.id===e);u(c().map(n=>n.id===e?{...n,...t}:n));let i=t.host!==void 0&&n!==void 0&&t.host!==n.host,a=t.apiKey!==void 0&&n!==void 0&&t.apiKey!==n.apiKey;(i||a)&&r(e)},[]),_=p.useCallback(e=>{u(c().filter(t=>t.id!==e)),i(e)},[]),v=p.useMemo(()=>({backends:t.backends,active:t.active,setActive:n,addBackend:l,updateBackend:d,removeBackend:_}),[t,n,l,d,_]);return(0,m.jsx)(h.Provider,{value:v,children:e})}function v(){let e=p.useContext(h);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function y(){let e=p.useContext(h);return e?e.active:{backend:d()??l,orgId:null}}export{y as n,v as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-BFRubm34.js";import{o as t}from"./declaration-DaUdB2Wg.js";import{n}from"./backend-form-modal-CeB983Sj.js";var r=e({AddBackendModal:()=>a}),i=t();function a({onClose:e}){return(0,i.jsx)(n,{mode:`add`,onClose:e})}export{r as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`workspace/project`;function t(e){return e?.trim()||null}function n(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 r(){return n(void 0)}function i(){let e=t(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return t(e)}return null}function a(){return{baseUrl:o()??``,sessionApiKey:s()??``}}function o(){return r()||(typeof window<`u`?window.location.origin:null)}function s(){return i()}function c(){return(void 0)?.trim()||e}function ee(e){return`${c().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function l(){let e=s();return e?{"X-Session-API-Key":e}:{}}function te(){return!0}function u(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function ne(){return u()?!s():!1}var d=`default-local`,f=`Local`;function p(){let e=o(),t=s();return!e||!t?null:{id:d,name:f,host:e,apiKey:t,kind:`local`}}var m=`openhands-backends`,h=`openhands-active-backend`,g=`openhands-agent-server-config`;function _(e){return e===`local`||e===`cloud`}function v(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`&&_(t.kind)}function re(e){if(typeof e!=`string`)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`http://${t}`:null}function y(){let e=window.localStorage.getItem(g);if(!e)return null;try{let t=JSON.parse(e),n=re(t.baseUrl),r=typeof t.sessionApiKey==`string`?t.sessionApiKey.trim():``;return!n||!r?null:{id:d,name:f,host:n,apiKey:r,kind:`local`}}catch{return null}}function b(){window.localStorage.removeItem(g)}function x(e){return T(e),b(),e}function S(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function C(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||S(e.host)&&S(t.host)}function w(e){let t=p();if(!t)return e;let n=!1,r=e.map(e=>!C(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(T(r),r):e}function T(e){if(!(typeof window>`u`))try{window.localStorage.setItem(m,JSON.stringify(e))}catch{}}function E(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(m);if(e===null){let e=y();if(e)return x([e]);let t=p();return t?x([t]):[]}let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=t.filter(v);if(n.length===0){let e=p();return e?x([e]):[]}let r=w(n);return b(),r}catch{return[]}}function D(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(h);if(!e)return null;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 O(e){if(!(typeof window>`u`))try{if(!e){window.localStorage.removeItem(h);return}window.localStorage.setItem(h,JSON.stringify({backendId:e.backendId,orgId:e.orgId??null}))}catch{}}var k=`no-backend`,A={id:k,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function j(e){return e.id===k}function ie(e){return e[0]??A}function M(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=ie(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var N=M(E(),D()),P=new Set;function F(){P.forEach(e=>e())}function I(){return N.active}function L(){let e=N.active.backend;return e.kind===`local`&&!j(e)?e:null}function R(){return N.backends}function z(){return N.selection}function B(){return N}function V(e){O(e),N=M(N.backends,e),F()}function H(e){T(e);let t=N.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,O(null)),N=M(e,t),F()}function U(e){return P.add(e),()=>{P.delete(e)}}var W=class extends Error{constructor(e,t,n,r){super(r||`HTTP ${e}: ${t}`),this.status=e,this.statusText=t,this.response=n,this.name=`HttpError`}},G=class{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.apiKey=e.apiKey,this.timeout=e.timeout||6e4}async request(e){let t=e.url.startsWith(`/`)?e.url.slice(1):e.url,n=new URL(t,this.baseUrl+`/`);e.params&&Object.entries(e.params).forEach(([e,t])=>{t!=null&&(Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,String(t))):n.searchParams.append(e,String(t)))});let r={"Content-Type":`application/json`,...e.headers};this.apiKey&&(r[`X-Session-API-Key`]=this.apiKey);let i={method:e.method,headers:r,signal:AbortSignal.timeout(e.timeout||this.timeout)};e.credentials&&(i.credentials=e.credentials),e.data&&e.method!==`GET`&&(e.data instanceof FormData?(delete r[`Content-Type`],i.body=e.data):i.body=JSON.stringify(e.data));try{let t=await fetch(n.toString(),i);if(!(e.acceptableStatusCodes?.has(t.status)||!e.acceptableStatusCodes&&t.ok)){let e;try{e=t.headers.get(`content-type`)?.includes(`application/json`)?await t.json():await t.text()}catch{e=null}throw new W(t.status,t.statusText,e,`HTTP request failed (${t.status} ${t.statusText}): ${JSON.stringify(e)}`)}let r=await this.parseResponse(t,e.responseType||`auto`),a={};return t.headers.forEach((e,t)=>{a[t]=e}),{data:r,status:t.status,statusText:t.statusText,headers:a}}catch(t){throw t instanceof W?t:t instanceof Error?t.name===`AbortError`?Error(`Request timeout after ${e.timeout||this.timeout}ms`,{cause:t}):Error(`Request failed: ${t.message}`,{cause:t}):Error(`Unknown request error`,{cause:t})}}async parseResponse(e,t){return t===`json`?await e.json():t===`text`?await e.text():t===`blob`?await e.blob():t===`arrayBuffer`?await e.arrayBuffer():e.headers.get(`content-type`)?.includes(`application/json`)?await e.json():await e.text()}async get(e,t){return this.request({method:`GET`,url:e,...t})}async post(e,t,n){return this.request({method:`POST`,url:e,data:t,...n})}async put(e,t,n){return this.request({method:`PUT`,url:e,data:t,...n})}async patch(e,t,n){return this.request({method:`PATCH`,url:e,data:t,...n})}async delete(e,t){return this.request({method:`DELETE`,url:e,...t})}close(){}},K=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new G({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async getAgentSchema(){return(await this.client.get(`/api/settings/agent-schema`)).data}async getSettings(e={}){return(await this.client.get(`/api/settings`,{headers:e.exposeSecrets?{"X-Expose-Secrets":e.exposeSecrets}:void 0})).data}async updateSettings(e){return(await this.client.patch(`/api/settings`,e)).data}async listSecrets(){return(await this.client.get(`/api/settings/secrets`)).data}async upsertSecret(e){return(await this.client.put(`/api/settings/secrets`,e)).data}async getSecret(e){return(await this.client.get(`/api/settings/secrets/${encodeURIComponent(e)}`,{responseType:`text`})).data}async deleteSecret(e){return(await this.client.delete(`/api/settings/secrets/${encodeURIComponent(e)}`)).data}async getConversationSchema(){return(await this.client.get(`/api/settings/conversation-schema`)).data}async listProfiles(){return(await this.client.get(`/api/profiles`)).data}async getProfile(e,t={}){return(await this.client.get(`/api/profiles/${encodeURIComponent(e)}`,{headers:t.exposeSecrets?{"X-Expose-Secrets":t.exposeSecrets}:void 0})).data}async saveProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}`,t)).data}async deleteProfile(e){return(await this.client.delete(`/api/profiles/${encodeURIComponent(e)}`)).data}async renameProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/rename`,{new_name:t})).data}close(){this.client.close()}};function q(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 J(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function Y(e){let t=q(e),n=J(e);return`${window.location.protocol===`https:`?`https:`:`http:`}//${t}${n}`}function X(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function ae(e,t){let n=q(e),r=J(e),i=window.location.protocol===`https:`,a=X(e)===`https:`,o=`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/bash-events`;return t?`${o}?session_api_key=${encodeURIComponent(t)}`:o}function oe(e,t){if(!e)return null;let n=q(t),r=J(t),i=window.location.protocol===`https:`,a=X(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var Z=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function Q(e){return e.replace(/\/+$/,``)}function se(e,t){return e.host?Q(e.host):e.conversationUrl?Q(Y(e.conversationUrl)):Q(t?.host??``)}function $(e={}){let t=L();if(!t&&!e.host&&!e.conversationUrl)throw new Z;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:se(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??c(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function ce(e){let{host:t,apiKey:n,timeout:r}=$(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}export{te as A,ee as C,c as D,l as E,u as O,e as S,a as T,V as _,Y as a,f as b,G as c,I as d,z as f,j as g,B as h,ae as i,ne as k,W as l,R as m,$ as n,oe as o,L as p,ce as r,K as s,Z as t,A as u,H as v,o as w,p as x,U as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as e,d as t,g as n,n as r,p as i,s as a}from"./agent-server-client-options-
|
|
1
|
+
import{O as e,d as t,g as n,n as r,p as i,s as a}from"./agent-server-client-options-9agOSarV.js";import{t as o}from"./server-client-DYv_GHPl.js";var s=5e3,c=null,l=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,u=class extends Error{details;constructor(e){super(`Agent server not found. Could not connect to the configured agent server. Start a compatible agent server and reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null}},d=e=>e instanceof u||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,f=t=>e()&&g(t,401);function p(){c=null}function m(e){let t=l(c);return Array.isArray(t)?t.includes(e):!0}function h(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function g(e,t){return h(e)&&e.status===t}async function _(){let l=i();if(!l){if(p(),n(t().backend))throw new u(`No backend configured`);return null}let d=r({host:l.host,sessionApiKey:l.apiKey||null,timeout:s}),f;try{f=await new o(d).getServerInfo()}catch(e){throw p(),g(e,401)?e:new u(e instanceof Error?e.message:null)}if(e())try{await new a(d).getSettings()}catch(e){if(g(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return c=f,f}export{_ as a,g as i,m as n,d as r,f as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-DVtlLWY8.js","assets/rolldown-runtime-BFRubm34.js","assets/agent-server-client-options-9agOSarV.js","assets/proxy-sRh0WKI7.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-CT1Z6Pdu.js";import{t}from"./common-DqjLSBOt.js";import{A as n,C as r,D as i,a,c as o,d as s,l as c,n as l,p as u,t as ee}from"./agent-server-client-options-9agOSarV.js";import{n as d,s as f,u as p}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{t as m}from"./profiles-client-BrqNmaDV.js";import{n as h}from"./agent-server-compatibility-B7QStIcH.js";import{n as g,t as _}from"./proxy-sRh0WKI7.js";import{t as v}from"./v4-khGvL7i2.js";import{t as y}from"./settings-DGY6n4J2.js";import{a as b,u as x}from"./acp-providers-DJr8DlNG.js";import{t as S}from"./settings-service.api-DxIEtvx6.js";var C=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new o({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async createConversation(e){return(await this.client.post(`/api/conversations`,e)).data}async searchConversations(e={}){return(await this.client.get(`/api/conversations/search`,{params:e})).data}async countConversations(e={}){return(await this.client.get(`/api/conversations/count`,{params:e})).data}async getConversations(e){return(await this.client.get(`/api/conversations`,{params:{ids:e}})).data}async getConversation(e){return(await this.client.get(`/api/conversations/${e}`)).data}async searchEvents(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/search`,{params:t})).data}async getEvent(e,t){return(await this.client.get(`/api/conversations/${e}/events/${t}`)).data}async getEvents(e,t){return Promise.all(t.map(async t=>{try{return await this.getEvent(e,t)}catch(e){if(e instanceof c&&e.status===404)return null;throw e}}))}async sendEvent(e,t,n={}){await this.client.post(`/api/conversations/${e}/events`,{...t,...n.run===void 0?{}:{run:n.run}})}async pauseConversation(e){return(await this.client.post(`/api/conversations/${e}/pause`,{})).data}async interruptConversation(e){return(await this.client.post(`/api/conversations/${e}/interrupt`,{})).data}async runConversation(e){return(await this.client.post(`/api/conversations/${e}/run`,{})).data}async askAgent(e,t){return(await this.client.post(`/api/conversations/${e}/ask_agent`,{question:t})).data}async getEventCount(e,t={}){return(await this.client.get(`/api/conversations/${e}/events/count`,{params:t})).data}async respondToConfirmation(e,t){return(await this.client.post(`/api/conversations/${e}/events/respond_to_confirmation`,t)).data}async getAgentFinalResponse(e){return(await this.client.get(`/api/conversations/${e}/agent_final_response`)).data}async setConfirmationPolicy(e,t){let n=`policy`in t?t:{policy:t};return(await this.client.post(`/api/conversations/${e}/confirmation_policy`,n)).data}async condenseConversation(e){return(await this.client.post(`/api/conversations/${e}/condense`,{})).data}async setSecurityAnalyzer(e,t){let n=te(t)?t:{security_analyzer:t};return(await this.client.post(`/api/conversations/${e}/security_analyzer`,n)).data}async updateSecrets(e,t){return(await this.client.post(`/api/conversations/${e}/secrets`,t)).data}async forkConversation(e,t={},n={}){return(await this.client.post(`/api/conversations/${e}/fork`,t,{params:n.includeSkills===void 0?void 0:{include_skills:n.includeSkills}})).data}async switchProfile(e,t){await this.client.post(`/api/conversations/${e}/switch_profile`,{profile_name:t})}async switchLLM(e,t){await this.client.post(`/api/conversations/${e}/switch_llm`,{llm:t})}async switchAcpModel(e,t){await this.client.post(`/api/conversations/${e}/switch_acp_model`,{model:t})}async deleteConversation(e){await this.client.delete(`/api/conversations/${e}`)}async updateConversation(e,t){return(await this.client.patch(`/api/conversations/${e}`,t)).data}close(){this.client.close()}};function te(e){return typeof e==`object`&&!!e&&`security_analyzer`in e}var w=new Map;function ne(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function re(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function T(e={}){let t=l(e),n=t.host,r=w.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new p(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();w.set(n,i);try{return await i}catch(e){throw w.delete(n),e}}async function E(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ne(n)?n:re(await T(t),n):T(t)}var D=`openhands-agent-server-conversation-metadata`,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{}}},k=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},A=e=>O()[e]??null,j=(e,t)=>{let n=O();n[e]=t,k(n)},M=e=>{let t=O();e in t&&(delete t[e],k(t))};function N(e){if(!e?.id)return e;let t=A(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 P(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function ie(e=20,t){let n=P(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>N(e)),next_page_id:i?.next_page_id??null}}async function F(e){if(e.length===0)return[];let t=P(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(N)}async function ae(e){return await _({backend:P(),method:`POST`,path:`/api/v1/app-conversations`,body:e})}async function oe(e){return _({backend:P(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function se(e){await _({backend:P(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function ce(e,t){return await _({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function le(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function ue(e){await _({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function de(e,t){let n=P(),r=new URLSearchParams;return r.append(`file_path`,t),await _({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function fe(e){let t=P(),n=new URLSearchParams;return n.set(`ids`,e),(await _({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}var I=`canvas_ui`,pe=`canvas_ui_tool`,me=[`terminal`,`file_editor`,`task_tracker`,I],L=`browser_tool_set`,R=`task_tool_set`;function he(){return!0}function ge(){let e=(void 0)?.trim();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function _e(){let e=ge();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,a=e.services.frontend??e.services.vite;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(`
|
|
3
|
+
`)}function ve(e){let{host:t}=l();return`${t}/api/conversations/${e}`}function z(e){return`Conversation ${e.slice(0,5)}`}function B(e){let n=A(e.id),r=e.agent?.kind===`ACPAgent`,a=r?e.tags?.acpserver??null:null;return{id:e.id,created_by_user_id:null,selected_repository:n?.selected_repository??null,selected_branch:n?.selected_branch??null,git_provider:n?.git_provider??null,selected_workspace:n?.selected_workspace??null,title:e.title?.trim()?e.title:z(e.id),trigger:null,pr_number:[],agent_kind:r?`acp`:`openhands`,acp_server:a,llm_model:r?x({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??y.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??t.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:ve(e.id),session_api_key:l().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??i()},public:!1,sub_conversation_ids:[]}}function ye(e){return{items:e.items.map(B),next_page_id:e.next_page_id??null}}var V=[`acp_command`,`acp_args`,`acp_model`,`acp_session_mode`,`acp_prompt_timeout`],be=`acpserver`,xe=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function H(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function U(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Se(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Ce(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function we(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function Te(e,t){return e===L?he()&&h(e):e===R?t.enable_sub_agents===!0&&h(e):!0}function Ee(e){let t=new Map;for(let e of me)t.set(e,{name:e,params:{}});for(let n of[L,R])Te(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>we(e)))for(let r of n)Te(r.name,e)&&t.set(r.name,{name:r.name,params:H(r.params)});return Array.from(t.values())}function De(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
|
|
4
|
+
|
|
5
|
+
`)}],run:!0}}function W(e){let t=_e();return{...H(e.agent_context),load_public_skills:n(),load_user_skills:!0,load_project_skills:!0,...t?{system_message_suffix:t}:{}}}function G(e){return H(e.agent_settings).agent_kind===`acp`}function Oe(e){let t=H(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function ke(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=b(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Ae(e){let t=H(e.agent_settings),n={agent_kind:`acp`,agent_context:W(t)};for(let e of V){if(e===`acp_model`)continue;let r=e===`acp_command`?ke(t):t[e];r!=null&&(n[e]=r)}let r=b(typeof t.acp_server==`string`?t.acp_server:void 0),i=x({configured:t.acp_model,providerDefault:r?.default_model});return i&&(n.acp_model=i),n}function je(e){let t=H(e.agent_settings),n=H(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:y.llm_model;let r=U(n.api_key);r?n.api_key=r:delete n.api_key;let i=U(n.base_url);i?n.base_url=i:delete n.base_url;let a=H(t.mcp_config);(Object.keys(a).length===0||!(`mcpServers`in a))&&delete t.mcp_config,delete t.acp_server;for(let e of V)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:W(t),tools:Ee(t)}}function Me(e){return G(e)?Ae(e):je(e)}function Ne(e){let{settings:t,query:n,conversationInstructions:r,plugins:a,workingDir:o}=e,s=H(t.conversation_settings),c=De(n,r);return xe.forEach(e=>delete s[e]),{...s,workspace:{kind:`LocalWorkspace`,working_dir:o??i()},...c?{initial_message:c}:{},...a?.length?{plugins:a.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Pe(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=G(t),r=Me(t),i=n?Oe(t):void 0,a=Ne(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),o={agent_settings:r,workspace:a.workspace,confirmation_policy:Se(a),max_iterations:typeof a.max_iterations==`number`?a.max_iterations:500,stuck_detection:!0,autotitle:!0,worktree:!0};i&&(o.tags={[be]:i}),e.secretsEncrypted&&(o.secrets_encrypted=!0),e.conversationId&&(o.conversation_id=e.conversationId);let s=Ce(a);if(s&&(o.security_analyzer=s),a.initial_message&&(o.initial_message=a.initial_message),a.plugins&&(o.plugins=a.plugins),a.hook_config&&(o.hook_config=a.hook_config),o.tool_module_qualnames={[I]:pe,...a.tool_module_qualnames??{}},a.agent_definitions&&(o.agent_definitions=a.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=u(),r=t?g(t):{},i={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(r).length>0&&(e.headers=r),i[t.name]=e}o.secrets=i,n&&(o.agent_settings.agent_context={...o.agent_settings.agent_context,secrets:i})}return o}async function Fe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-DVtlLWY8.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4])),[r,i]=await Promise.all([S.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return Pe({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Ie(){return{hooks:[]}}var Le=`1970-01-01T00:00:00.000Z`,Re=`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 K(){return Error(Re)}function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function J(e){return typeof e==`number`?e:null}function Y(e){return typeof e==`number`?e:0}function X(e){return typeof e==`string`?e:null}function Z(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Le}function ze(e){return q(e)?{prompt_tokens:Y(e.prompt_tokens),completion_tokens:Y(e.completion_tokens),cache_read_tokens:Y(e.cache_read_tokens),cache_write_tokens:Y(e.cache_write_tokens),context_window:Y(e.context_window),per_turn_token:Y(e.per_turn_token)}:null}function Q(e){return q(e)?{accumulated_cost:J(e.accumulated_cost),max_budget_per_task:J(e.max_budget_per_task),accumulated_token_usage:ze(e.accumulated_token_usage)}:null}function Be(e){if(!q(e))return null;let t=q(e.llm)?{model:X(e.llm.model)}:null;return{kind:X(e.kind),acp_model:X(e.acp_model),llm:t}}function Ve(e){return q(e)?{working_dir:X(e.working_dir)}:null}function He(e){if(!q(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function Ue(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 We(e,t){let n=Ue(e),r=Ue(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function Ge(e){if(!q(e)||typeof e.id!=`string`||!e.id.trim())throw K();return{id:e.id.trim(),title:X(e.title),created_at:Z(e,`created_at`,`createdAt`),updated_at:Z(e,`updated_at`,`updatedAt`),execution_status:X(e.execution_status),sandbox_status:X(e.sandbox_status),metrics:Q(e.metrics),agent:Be(e.agent),workspace:Ve(e.workspace),tags:He(e.tags),current_model_id:X(e.current_model_id),current_model_name:X(e.current_model_name)}}function $(e){if(!Array.isArray(e))throw K();return e.map(Ge)}function Ke(e){if(Array.isArray(e))return{items:$(e),next_page_id:null};if(!q(e))throw K();return{items:$(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var qe=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function Je(e){let t=e??`idle`;return qe.has(t)?t:`idle`}function Ye(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var Xe=class{static async sendMessage(e,t,n){let r=s().backend,i=n?.conversationUrl??null,o=n?.sessionApiKey??null;if(r.kind===`cloud`){if(!i||!o){let[t]=await F([e]);i=t?.conversation_url?.trim()??null,o=t?.session_api_key?.trim()??null}if(!i||!o)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await _({backend:r,method:`POST`,hostOverride:a(i),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:o}),t}return await new C(l({conversationUrl:i,sessionApiKey:o})).sendEvent(e,t,{run:!0}),t}static async createConversation(e,t,n,i,a,o,c,d){if(s().backend.kind===`cloud`)return ae({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:t??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:n??null,parent_conversation_id:o??null,agent_type:c,sandbox_id:d??null});let f=await S.getSettings(),p=v(),m=await Fe({settings:f,query:e,conversationInstructions:t,plugins:n,conversationId:p,workingDir:await E(a??r(p))}),h=await new C(l()).createConversation(m),g=u();if(!g)throw new ee;return(i?.selected_repository||a)&&j(h.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:a??null}),{id:h.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:h.id,agent_server_url:g.host,request:{initial_message:m.initial_message,plugins:n??null},created_at:h.created_at,updated_at:h.updated_at}}static async getStartTask(e){return s().backend.kind===`cloud`?fe(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new f(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??i()}static async batchGetAppConversations(e){return e.length===0?[]:s().backend.kind===`cloud`?F(e):$(await new C(l()).getConversations(e)).map(e=>B(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return ce(e,t)}static async updateConversationRepository(e,t,n,r){t?j(e,{...A(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):M(e);let[i]=await this.batchGetAppConversations([e]);return Ye(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return de(e,We(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=We(t??`${n}/.agents_tmp/PLAN.md`,n);return new p(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?oe(e):new p(l()).downloadTrajectory(e)}static async getHooks(e){return Ie()}static async getRuntimeConversation(e,t,n){let r=s().backend,i=r.kind===`cloud`&&t?await _({backend:r,method:`GET`,hostOverride:a(t),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:n}):await new C(l({conversationUrl:t,sessionApiKey:n})).getConversation(e),o=Ge(i),c=q(i)?i.stats:null;return{id:o.id,title:o.title?.trim()?o.title:z(o.id),metrics:Q(o.metrics),created_at:o.created_at,updated_at:o.updated_at,status:Je(o.execution_status),stats:q(c)?c:{usage_to_metrics:{}}}}static async searchConversations(e=20,t){return s().backend.kind===`cloud`?ie(e,t):ye(Ke(await new C(l()).searchConversations({limit:e,page_id:t,sort_order:d.UPDATED_AT_DESC})))}static async deleteConversation(e){s().backend.kind===`cloud`?await se(e):await new C(l()).deleteConversation(e),M(e)}static async updateConversationTitle(e,t){await new C(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return Ye(n,e)}static async switchProfile(e,t){if(s().backend.kind===`cloud`)throw Error(`LLM profile switching is only supported for local agent-server backends.`);if(!e){await new m(l()).activateProfile(t);return}let n=l(),r=new C(n),i=await new m(n).getProfile(t,{exposeSecrets:`encrypted`}),a=typeof i.config.model==`string`?i.config.model:``;if(!a)throw Error(`Profile '${t}' has no model.`);await r.switchLLM(e,{...i.config,model:a,usage_id:`profile:${t}:${v()}`})}static async switchAcpModel(e,t){if(s().backend.kind===`cloud`)throw Error(`ACP model switching is only supported for local agent-server backends.`);await new C(l()).switchAcpModel(e,t)}};export{A as a,ue as i,F as n,E as o,le as r,C as s,Xe as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-BFRubm34.js";import{t as n}from"./react-CM_dJw1Z.js";import{L as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as i,t as a}from"./declaration-DaUdB2Wg.js";import{t as o}from"./useTranslation-CEcjrme-.js";import{t as s}from"./retrieve-axios-error-message-BY-yIkIq.js";import{n as c,r as l}from"./custom-toast-handlers-BohXx7uh.js";import{t as u}from"./utils-CdgBzLA7.js";import{t as d}from"./brand-button-LBFNic99.js";import{t as f}from"./settings-input-8y5p4kze.js";import{a as p,i as m,n as h,t as g}from"./acp-providers-DJr8DlNG.js";import{r as _}from"./use-settings-BPTbE7lg.js";import{t as v}from"./use-save-settings-rE9aA29R.js";import{t as y}from"./use-agent-settings-schema-Yxf7KGyG.js";import{r as b}from"./typography-Bvw0IxaN.js";import{i as ee,r as te}from"./sdk-settings-field-metadata-C6KMD-jZ.js";import{t as x}from"./settings-dropdown-input-DA_pzHWE.js";import{t as ne}from"./settings-switch-ba4DuiNO.js";var S=t(((e,t)=>{t.exports=function(e){return e.map(function(e){return e===``?`''`:e&&typeof e==`object`?e.op.replace(/(.)/g,`\\$1`):/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,`$1\\$2`)}).join(` `)}})),C=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r.push(i),t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p||=!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0?e:e.concat(t)},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e.concat(t);var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?e.concat(n[0]):e.concat(n.filter(Boolean).map(function(e){return m.test(e)?JSON.parse(e.split(d)[1]):e}))},[]):r}})),w=t((e=>{e.quote=S(),e.parse=C()})),T=e(n(),1),{quote:E}=e(w(),1);function D(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
|
|
2
|
+
`||a===`\r`){i&&=(t.push(r),r=``,!1),n+=1;continue}if(a===`'`){for(i=!0,n+=1;n<e.length&&e[n]!==`'`;)r+=e[n],n+=1;n<e.length&&(n+=1);continue}if(a===`"`){for(i=!0,n+=1;n<e.length&&e[n]!==`"`;){if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];if(t===`"`||t===`\\`){r+=t,n+=2;continue}}r+=e[n],n+=1}n<e.length&&(n+=1);continue}if(a===`\\`&&n+1<e.length){i=!0,r+=e[n+1],n+=2;continue}i=!0,r+=a,n+=1}return i&&t.push(r),t}var O=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function k(e){return e.map(e=>O.test(e)||e===``?E([e]):e).join(` `)}var A=i(),j={hideTitle:!0},M=`enable_sub_agents`,re=`npx -y <package-name>`,N=`__custom_model__`;function P(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function F(e,t){let n=D(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return g}function ie(e){return e?.find(e=>e.key===M)}function ae(e,t){return typeof e==`boolean`?e:t?.default===!0}function I(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function L(){let{t:e}=o(`openhands`),{data:t,isLoading:n}=_(),{mutate:r,isPending:i}=v(),{data:S}=y(t?.agent_settings_schema),C=ie(T.useMemo(()=>S?.sections.flatMap(e=>e.fields),[S])),w=T.useMemo(()=>ae(t?.agent_settings?.[M],C),[C,t?.agent_settings]),[E,O]=(0,T.useState)(w),[j,L]=(0,T.useState)(`openhands`),[R,z]=(0,T.useState)(``),[B,V]=(0,T.useState)(``),[oe,H]=(0,T.useState)(!1),[se,U]=(0,T.useState)(!1),W=(0,T.useRef)(null),G=(0,T.useRef)(null),K=(0,T.useRef)(``);if((0,T.useEffect)(()=>{if(t&&W.current!==t){if(W.current=t,t.agent_settings?.agent_kind===`acp`){L(`acp`);let e=t.agent_settings?.acp_server,n=typeof e==`string`?e:void 0,r=p(n),i=P(t.agent_settings?.acp_command),a=[...i.length>0?i:r?.default_command??[],...P(t.agent_settings?.acp_args)],o=a.length>0?k(a):``;z(o),G.current=n??null,K.current=o;let s=t.agent_settings?.acp_model,c=typeof s==`string`?s.trim():``;V(c||r?.default_model||``),H(!!c&&(!r||!I(r,c)))}else L(`openhands`),z(``),V(``),G.current=null,K.current=``,H(!1);U(!1)}},[t]),(0,T.useEffect)(()=>{O(w)},[w]),n)return null;let q=j===`acp`,J=D(R),ce=q&&J.length===0,Y=F(R,h),X=p(Y),Z=X?.available_models??[],Q=Z.length>0,le=I(X,B),$=oe||!le?N:B,ue=!!X&&J.join(` `)===X.default_command.join(` `),de=k(h[0]?.default_command??[])||re,fe=se||!q&&E!==w,pe=()=>{if(q){let t=!!(X&&ue),n=G.current,i=R===K.current,o=!!n&&n!==`custom`&&!h.some(e=>e.key===n),u=q&&i&&o,d=m(u?n:X&&ue?X.key:g,{command:t?[]:J,model:B.trim()||void 0,allowUnknownServer:u});if(!d)return;r({agent_settings_diff:d},{onError:t=>{c(s(t)||e(a.ERROR$GENERIC))},onSuccess:()=>{l(e(a.SETTINGS$SAVED)),U(!1)}})}else r({agent_settings_diff:{agent_kind:`openhands`,enable_sub_agents:E}},{onError:t=>{c(s(t)||e(a.ERROR$GENERIC))},onSuccess:()=>{l(e(a.SETTINGS$SAVED)),U(!1)}})},me=C?ee(e,C.key,C.label):e(a.SCHEMA$ENABLE_SUB_AGENTS$LABEL),he=C?te(e,C.key,C.description):e(a.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION);return(0,A.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(b.H2,{className:`mb-2`,children:e(a.SETTINGS$NAV_AGENT)}),(0,A.jsx)(b.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:e(a.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,A.jsx)(x,{testId:`agent-type-selector`,name:`agent-type`,label:e(a.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:e(a.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:e(a.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:j,onSelectionChange:e=>{if(!e)return;let t=e;if(L(t),t===`acp`&&!R){let e=h[0];e&&(z(k(e.default_command)),V(e.default_model??``),H(!1))}else t===`openhands`&&H(!1);U(!0)}}),!q&&(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(ne,{testId:`agent-settings-enable-sub-agents`,isToggled:E,onToggle:e=>{O(e)},children:me}),he?(0,A.jsx)(b.Paragraph,{className:u(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:he}):null]}),q&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(x,{testId:`agent-preset-selector`,name:`agent-preset`,label:e(a.SETTINGS$AGENT_PRESET),items:[...h.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:e(a.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Y,onSelectionChange:e=>{if(!e)return;let t=String(e),n=p(t);n?(z(k(n.default_command)),V(n.default_model??``),H(!1)):t===`custom`&&(z(``),V(``),H(!0)),U(!0)}}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,A.jsx)(b.Text,{className:`text-sm`,children:e(a.SETTINGS$AGENT_COMMAND)}),(0,A.jsx)(`textarea`,{"data-testid":`agent-command-input`,className:`bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white`,value:R,placeholder:de,onChange:e=>{let t=e.target.value,n=F(R,h),r=F(t,h);r!==n&&(V(p(r)?.default_model??``),H(!1)),z(t),U(!0)}}),(0,A.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:e(a.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Q&&(0,A.jsx)(x,{testId:`agent-model-selector`,name:`agent-model`,label:e(a.SETTINGS$AGENT_MODEL),items:[...Z.map(e=>({key:e.id,label:e.label})),{key:N,label:e(a.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:$,onSelectionChange:e=>{if(!e)return;let t=String(e);t===N?(H(!0),V(``)):(H(!1),V(t)),U(!0)}}),$===N&&(0,A.jsx)(f,{testId:`agent-model-input`,label:e(Q?a.SETTINGS$AGENT_CUSTOM_MODEL:a.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:B,showOptionalTag:!0,onChange:e=>{V(e),U(!0)}}),(0,A.jsx)(b.Text,{className:`text-xs text-[#717888]`,children:e(a.SETTINGS$AGENT_MODEL_HINT)})]})]}),(0,A.jsx)(`div`,{children:(0,A.jsx)(d,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:i||!fe||ce,onClick:pe,children:e(i?a.SETTINGS$SAVING:a.SETTINGS$SAVE_CHANGES)})})]})}var R=r(L);export{R as default,j as handle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-DaUdB2Wg.js";import{t as i}from"./useTranslation-CEcjrme-.js";import{t as a}from"./utils-CdgBzLA7.js";import{n as o}from"./navigation-context-aNGUUtdq.js";import{l as s}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js";import{t as c}from"./close-D_o3d8QM.js";import{r as l}from"./typography-Bvw0IxaN.js";import{t as u}from"./vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=i(`openhands`),[h,g]=u(`alert_banner_dismissed_at`,null),{currentPath:_}=o(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(s,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:m(r.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(l.Paragraph,{className:`text-sm font-medium`,children:[m(r.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(c,{})})]}):null}export{p as AlertBanner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,t}from"./declaration-DaUdB2Wg.js";import{t as n}from"./useTranslation-CEcjrme-.js";import{n as r}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js";import{r as i}from"./telemetry-3piyXm5H.js";import{t as a}from"./modal-backdrop-BDqI1zBV.js";import{n as o}from"./modal-body-CCLCqX1J.js";import{n as s,r as c}from"./base-modal-DZCNv0A4.js";import{t as l}from"./brand-button-LBFNic99.js";import{t as u}from"./handle-capture-consent-3XrjZ8wi.js";import{t as d}from"./use-save-settings-rE9aA29R.js";var f=e();function p({onClose:e}){let p=r(),{t:m}=n(`openhands`),{mutate:h}=d();return(0,f.jsx)(a,{children:(0,f.jsx)(`form`,{"data-testid":`user-capture-consent-form`,onSubmit:async t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;h({user_consents_to_analytics:n},{onSuccess:()=>{u(p,n),i(n?`granted`:`denied`),e()}})},className:`flex flex-col gap-2`,children:(0,f.jsxs)(o,{className:`border border-[var(--oh-border)]`,children:[(0,f.jsx)(c,{title:m(t.ANALYTICS$TITLE)}),(0,f.jsx)(s,{children:m(t.ANALYTICS$DESCRIPTION)}),(0,f.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm`,children:[(0,f.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0}),m(t.ANALYTICS$SEND_ANONYMOUS_DATA)]}),(0,f.jsx)(l,{testId:`confirm-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:m(t.ANALYTICS$CONFIRM_PREFERENCES)})]})})})}export{p as AnalyticsConsentFormModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-DaUdB2Wg.js";import{t as i}from"./useTranslation-CEcjrme-.js";import{t as a}from"./utils-CdgBzLA7.js";import{g as o,n as s,s as c}from"./agent-server-client-options-9agOSarV.js";import{r as l}from"./active-backend-context-I2w666XY.js";import{i as u}from"./agent-server-compatibility-B7QStIcH.js";import{r as d,t as f}from"./modal-body-CCLCqX1J.js";import{t as p}from"./brand-button-LBFNic99.js";import{r as m,t as h}from"./backend-form-modal-CeB983Sj.js";var g=e(t(),1),_=n();function v(){let{t:e}=i(`openhands`),{active:t,addBackend:n,updateBackend:v}=l(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async i=>{x(!0),C(`idle`),T(null);try{await new c(s({host:i.host,sessionApiKey:i.apiKey,timeout:5e3})).getSettings(),C(`success`),o(t.backend)?n(i):v(t.backend.id,i),window.location.reload()}catch(t){if(C(`error`),u(t,401))T(e(r.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(r.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:a(`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(r.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(h,{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)(m,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(r.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?r.ONBOARDING$BACKEND_STATUS_CHECKING:r.BACKEND$CONNECT)})]})})})]})})}export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as r,t as i}from"./declaration-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as r,t as i}from"./declaration-DaUdB2Wg.js";import{t as a}from"./useTranslation-CEcjrme-.js";import{t as o}from"./i18n-zDndR1Ne.js";import{t as s}from"./retrieve-axios-error-message-BY-yIkIq.js";import{n as c,r as l}from"./custom-toast-handlers-BohXx7uh.js";import{n as u}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js";import{t as d}from"./brand-button-LBFNic99.js";import{i as f,n as p,r as m,t as h}from"./color-themes-0biOprdo.js";import{t as g}from"./settings-input-8y5p4kze.js";import{t as _}from"./settings-DGY6n4J2.js";import{r as v}from"./use-settings-BPTbE7lg.js";import{t as y}from"./handle-capture-consent-3XrjZ8wi.js";import{t as b}from"./use-save-settings-rE9aA29R.js";import{n as x,t as S}from"./switch-skeleton-cKrdaYGj.js";import{t as C}from"./settings-dropdown-input-DA_pzHWE.js";import{t as w}from"./settings-switch-ba4DuiNO.js";var T=e(t(),1),E=r();function D({defaultKey:e,onChange:t,name:n}){let{t:r}=a(`openhands`);return(0,E.jsx)(C,{testId:n,name:n,onInputChange:t,label:r(i.SETTINGS$LANGUAGE),items:o.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function O(){let{t:e}=a(`openhands`),t=T.useCallback(e=>{if(!e)return;let t=e;p(t),m(t)},[]);return(0,E.jsx)(C,{testId:`color-theme-input`,name:`color-theme-input`,label:e(i.SETTINGS$COLOR_THEME),items:h.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:f(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function k(){return(0,E.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,E.jsx)(x,{}),(0,E.jsx)(S,{}),(0,E.jsx)(S,{})]})}function A(){let e=u(),{t}=a(`openhands`),{mutate:n,isPending:r}=b(),{data:f,isLoading:p}=v(),[m,h]=T.useState(!1),[x,S]=T.useState(!1),[C,A]=T.useState(!1),[j,M]=T.useState(!1),[N,P]=T.useState(!1),F=r=>{let a=r.get(`language-input`)?.toString(),u=o.find(({label:e})=>e===a)?.value||_.language,d=r.get(`enable-analytics-switch`)?.toString()===`on`;n({language:u,user_consents_to_analytics:d,enable_sound_notifications:r.get(`enable-sound-notifications-switch`)?.toString()===`on`,git_user_name:r.get(`git-user-name-input`)?.toString()||_.git_user_name,git_user_email:r.get(`git-user-email-input`)?.toString()||_.git_user_email},{onSuccess:()=>{y(e,d),l(t(i.SETTINGS$SAVED))},onError:e=>{c(s(e)||t(i.ERROR$GENERIC))},onSettled:()=>{h(!1),S(!1),A(!1),M(!1),P(!1)}})},I=e=>{let t=o.find(({label:t})=>t===e)?.label,n=o.find(({value:e})=>e===f?.language)?.label;h(t!==n)},L=e=>{S(e!==(f?.user_consents_to_analytics??!0))},R=e=>{A(e!==!!f?.enable_sound_notifications)},z=e=>{let t=f?.git_user_name;M(e!==t)},B=e=>{let t=f?.git_user_email;P(e!==t)},V=!m&&!x&&!C&&!j&&!N,H=!f||p||r;return(0,E.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:F,className:`flex flex-col gap-6`,children:[H&&(0,E.jsx)(k,{}),!H&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,E.jsx)(D,{name:`language-input`,defaultKey:f.language,onChange:I}),(0,E.jsx)(O,{}),(0,E.jsx)(w,{testId:`enable-analytics-switch`,name:`enable-analytics-switch`,defaultIsToggled:f.user_consents_to_analytics??!0,onToggle:L,children:t(i.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,E.jsx)(w,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!f.enable_sound_notifications,onToggle:R,children:t(i.SETTINGS$SOUND_NOTIFICATIONS)}),(0,E.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,E.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:t(i.SETTINGS$GIT_SETTINGS)}),(0,E.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:t(i.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,E.jsx)(g,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:t(i.SETTINGS$GIT_USERNAME),defaultValue:f.git_user_name||``,onChange:z,placeholder:t(i.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,E.jsx)(g,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:t(i.SETTINGS$GIT_EMAIL),defaultValue:f.git_user_email||``,onChange:B,placeholder:t(i.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,E.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,E.jsxs)(d,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:r||V,children:[!r&&t(`SETTINGS$SAVE_CHANGES`),r&&t(`SETTINGS$SAVING`)]})})]})]})]})}var j=n(A);export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,P as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as i}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js";import{o as a,t as o}from"./declaration-DaUdB2Wg.js";import{t as s}from"./useTranslation-CEcjrme-.js";import{t as c}from"./back-nav-button-DgkK0Ka6.js";import{n as l,r as u}from"./custom-toast-handlers-BohXx7uh.js";import{t as d}from"./utils-CdgBzLA7.js";import{a as f,d as p,n as m}from"./agent-server-client-options-9agOSarV.js";import{n as h}from"./active-backend-context-I2w666XY.js";import{f as g}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js";import{r as _}from"./modal-classes-DwTdT3IK.js";import{n as v}from"./navigation-context-aNGUUtdq.js";import{n as y,r as b}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js";import{t as x}from"./proxy-sRh0WKI7.js";import{t as S}from"./use-tracking-DQYdZpxi.js";import{t as C}from"./u-edit-BIYzjs3v.js";import{t as w}from"./terminal-BSYITdM0.js";import{t as T}from"./use-user-conversation-BRAseenw.js";import{t as E}from"./toggle-switch-CUgOZqZu.js";import{t as D}from"./x-mark-DsJ9tDD0.js";import{t as O}from"./code-tag-DhsjDB-v.js";import{t as k}from"./link-external-DtcdPFbw.js";import{t as A}from"./globe-qFjFNG6J.js";import{C as j,S as M,a as N,b as ee,c as P,d as F,f as te,g as ne,i as re,l as I,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as L,v as ue,x as de,y as fe}from"./edit-automation-modal-CNZgSSiH.js";import{t as R}from"./automation-DJ_3GeXD.js";var z=e(t()),B=a();function V(){let{t:e}=s(`openhands`);return(0,B.jsx)(c,{to:`/automations`,children:e(o.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var pe=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,B.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 me({active:e}){let{t}=s(`openhands`);return(0,B.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:d(`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?o.AUTOMATIONS$DETAIL$ACTIVE:o.AUTOMATIONS$DETAIL$INACTIVE)})}function he({automation:e,onToggle:t,onEdit:n,onDelete:r,onRunNow:i,isRunningNow:a=!1}){let{t:c}=s(`openhands`),l=te(`manage_automations`),u=[...n?[{label:c(o.AUTOMATIONS$EDIT),icon:(0,B.jsx)(C,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),icon:(0,B.jsx)(ce,{className:`size-4`}),onClick:t},{label:c(o.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,B.jsx)(pe,{className:`size-4`}),onClick:()=>{j.downloadTarball(e.id,e.name)}},{label:c(o.AUTOMATIONS$DELETE),icon:(0,B.jsx)(ae,{className:`size-4`}),onClick:r}];return(0,B.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,B.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,B.jsx)(me,{active:e.enabled})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&i&&(0,B.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:a||!e.enabled,onClick:i,children:[(0,B.jsx)(F,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),a?`Starting…`:c(o.AUTOMATIONS$RUN_NOW)]}),l&&(0,B.jsx)(E,{enabled:e.enabled,label:e.enabled?c(o.AUTOMATIONS$TURN_OFF):c(o.AUTOMATIONS$TURN_ON),onToggle:t}),l&&(0,B.jsx)(oe,{items:u})]})]})})}function H({icon:e,title:t,children:n}){return(0,B.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,B.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,B.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,B.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var ge=240,_e=`max-h-60`;function ve({prompt:e}){let{t}=s(`openhands`),[n,r]=z.useState(!1),[i,a]=z.useState(!1),c=z.useRef(null),l=i&&!n;return z.useLayoutEffect(()=>{let e=c.current;if(!e)return;let t=()=>{a(e.scrollHeight>ge)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,B.jsx)(H,{icon:(0,B.jsx)(w,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PROMPT),children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`relative`,children:[(0,B.jsx)(`p`,{ref:c,className:d(`whitespace-pre-wrap text-sm leading-6 text-content`,l&&d(_e,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),l?(0,B.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,B.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?o.COMMON$VIEW_LESS:o.COMMON$VIEW_MORE)}):null]})})}var ye=e=>(0,B.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,B.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,B.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),be=e=>(0,B.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,B.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,B.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,B.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,B.jsx)(`circle`,{cx:9,cy:18,r:2})]}),U=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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`})}),W=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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`})}),xe=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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 G({icon:e,label:t,children:n}){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,B.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,B.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function Se({branch:e}){return(0,B.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 K=60;function Ce({filter:e}){let{t}=s(`openhands`),[n,r]=(0,z.useState)(!1),i=e.length>K;return(0,B.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,B.jsx)(`span`,{className:`break-all`,children:i&&!n?`${e.slice(0,K)}…`:e}),i&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?o.SETTINGS$SKILLS_SHOW_LESS:o.SETTINGS$SKILLS_SHOW_MORE)})]})}function we({automation:e}){let{t}=s(`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?o.AUTOMATIONS$DETAIL$TRIGGER_EVENT:o.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,B.jsx)(H,{icon:(0,B.jsx)(ye,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,B.jsx)(G,{icon:(0,B.jsx)(be,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,B.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,B.jsx)(Se,{branch:e.branch})]})}),(0,B.jsx)(G,{icon:(0,B.jsx)(U,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,B.jsx)(G,{icon:(0,B.jsx)(W,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,B.jsx)(G,{icon:(0,B.jsx)(A,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,B.jsx)(G,{icon:(0,B.jsx)(k,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_TYPE),children:P(e.trigger.on)}),n&&e.trigger.filter&&(0,B.jsx)(G,{icon:(0,B.jsx)(O,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,B.jsx)(Ce,{filter:e.trigger.filter})}),(0,B.jsx)(G,{icon:(0,B.jsx)(I,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$MODEL),children:e.model??`Active profile`}),e.notification&&(0,B.jsx)(G,{icon:(0,B.jsx)(xe,{className:`size-3.5`}),label:t(o.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var Te=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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 Ee({name:e}){return(0,B.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 De({plugins:e}){let{t}=s(`openhands`);return(0,B.jsx)(H,{icon:(0,B.jsx)(Te,{className:`size-4`}),title:t(o.AUTOMATIONS$DETAIL$PLUGINS),children:(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,B.jsx)(Ee,{name:e},e))})})}var q=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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 J(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Oe(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(o.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(o.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(o.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):s===1?n(o.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(o.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):J(e,t)}function ke({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=s(`openhands`),i=r.language;return(0,B.jsx)(H,{icon:(0,B.jsx)(q,{className:`size-4`}),title:n(o.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,B.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,B.jsx)(G,{icon:(0,B.jsx)(W,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$CREATED),children:J(e,i)}),(0,B.jsx)(G,{icon:(0,B.jsx)(L,{className:`size-3.5`}),label:n(o.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Oe(t,i,n):n(o.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Ae=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,B.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`})}),je={[R.COMPLETED]:{label:o.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[R.FAILED]:{label:o.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[R.PENDING]:{label:o.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[R.RUNNING]:{label:o.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Me({status:e}){switch(e){case R.COMPLETED:return(0,B.jsx)(U,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case R.FAILED:return(0,B.jsx)(Ae,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,B.jsx)(L,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Ne({status:e}){let{t}=s(`openhands`),n=je[e];return(0,B.jsxs)(`span`,{className:d(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,B.jsx)(Me,{status:e}),t(n.label)]})}var Pe=20;function Fe(e){return e.kind===`BashOutput`}var Ie=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Pe;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=>{Fe(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=p().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))}),x({backend:r,method:`GET`,hostOverride:f(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new g(m({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Le=[`bash-command-logs`];function Re(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 Y(e){if(!b.isAxiosError(e))return null;if(!e.response)return`unreachable`;let t=e.response.status;return t===404||t>=500?`unreachable`:null}function ze(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,a=h(),o=T(r?t??null:null),s=o.data,c=s?.conversation_url??null,l=s?.session_api_key??null,u=a.backend.kind===`cloud`,d=o.isFetched,f=null,p=!1;u&&d&&(s?f=Re(s.sandbox_status)??(s.conversation_url?null:`missing`):p=!0);let m=r&&!!n&&(u?!!c:!0)&&!f&&!p,g=i({queryKey:[...Le,n,c,l,a.backend.id,a.orgId],queryFn:()=>Ie.listOutputs(c,l,n),enabled:m,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Y(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&o.isPending,conversationMissing:p,sandboxIssue:v}}var Be={missing:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:o.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function X(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 Ve({conversationId:e,bashCommandId:t,isOpen:n,onClose:r}){let{t:i}=s(`openhands`),[a,c]=(0,z.useState)(`stdout`),{data:l,isFetching:u,isResolvingConversation:f,sandboxIssue:p,conversationMissing:m,error:h}=ze({conversationId:e,bashCommandId:t,enabled:n});(0,z.useEffect)(()=>{n&&c(`stdout`)},[n,t]),(0,z.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:v}=(0,z.useMemo)(()=>l?{stdout:X(l,`stdout`),stderr:X(l,`stderr`)}:{stdout:``,stderr:``},[l]);if(!n)return null;let y=f||u&&!l,b=!t,x=a===`stdout`?g:v,S=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,C=`border-[var(--oh-primary)] text-white`,w=`border-transparent text-muted hover:text-content`;return(0,B.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,B.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,B.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,B.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(o.AUTOMATIONS$CANCEL),children:(0,B.jsx)(D,{className:`size-5`})}),(0,B.jsx)(`h2`,{className:d(`pr-8`,_),children:i(o.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,B.jsxs)(`div`,{role:`tablist`,"aria-label":i(o.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,B.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:a===`stdout`?0:-1,onClick:()=>c(`stdout`),className:`${S} ${a===`stdout`?C:w}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,B.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:a===`stderr`?0:-1,onClick:()=>c(`stderr`),className:`${S} ${a===`stderr`?C:w}`,children:i(o.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,B.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${a}`,"aria-labelledby":`run-logs-tab-${a}`,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:[b&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!b&&m&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!b&&!m&&p&&(0,B.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${p}`,className:`text-muted italic`,children:i(Be[p])}),!b&&!m&&!p&&y&&(0,B.jsx)(`p`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!b&&!m&&!p&&!y&&h&&!l&&(0,B.jsxs)(`p`,{className:`text-danger`,children:[i(o.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(h)]}),!y&&!p&&l&&(0,B.jsx)(`pre`,{"data-testid":`run-logs-output-${a}`,className:`whitespace-pre-wrap break-words ${a===`stderr`?`text-danger`:`text-content`}`,children:x.length>0?x:(0,B.jsx)(`span`,{className:`text-muted italic`,children:i(o.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]})]})]})}function He(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Ue(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function We(e){return`/conversations/${e}`}function Ge({run:e}){let{t,i18n:n}=s(`openhands`),r=!!e.conversation_id,i=!!e.bash_command_id,a=e.status===R.COMPLETED||e.status===R.FAILED,c=!r&&a,[l,u]=(0,z.useState)(!1),[d]=(0,z.useState)(()=>new Date().toISOString()),f=He(Ue(e.started_at)?d:e.started_at,n.language),p=i?(0,B.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":t(o.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:t(o.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,B.jsx)(w,{className:`size-4`})}):null,m=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,B.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,t(o.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,B.jsx)(Ne,{status:e.status})]})]});return(0,B.jsxs)(B.Fragment,{children:[r&&e.conversation_id?(0,B.jsx)(`a`,{href:We(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,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:m}),i&&(0,B.jsx)(Ve,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1)})]})}var Z=20;function Ke({automationId:e}){let{t}=s(`openhands`),[n,r]=(0,z.useState)(Z),{data:i,isLoading:a}=M({id:e,limit:n,offset:0}),c=i?i.total>i.runs.length:!1;return(0,B.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,B.jsx)(`span`,{className:`size-4 text-muted`,children:(0,B.jsx)(q,{className:`size-4`})}),(0,B.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(o.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),a&&(0,B.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,B.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,B.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!a&&i?.runs.length===0&&(0,B.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(o.AUTOMATIONS$DETAIL$NO_RUNS)}),!a&&i&&i.runs.length>0&&(0,B.jsxs)(`div`,{children:[i.runs.map((e,t)=>(0,B.jsx)(`div`,{className:t>0?`border-t border-[var(--oh-border)]`:``,children:(0,B.jsx)(Ge,{run:e})},e.id)),c&&(0,B.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,B.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+Z),className:`text-sm text-muted hover:text-foreground`,children:t(o.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function Q({className:e}){return(0,B.jsx)(`div`,{className:d(`animate-pulse rounded bg-surface-raised`,e)})}function $(){return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,B.jsx)(Q,{className:`h-5 w-40`}),(0,B.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,B.jsx)(Q,{className:`h-6 w-48`}),(0,B.jsx)(Q,{className:`h-6 w-16 rounded-full`})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(Q,{className:`h-6 w-11 rounded-full`}),(0,B.jsx)(Q,{className:`h-8 w-8`})]})]}),(0,B.jsx)(Q,{className:`h-5 w-96`}),(0,B.jsx)(Q,{className:`h-36 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-72 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-32 w-full rounded-2xl`}),(0,B.jsx)(Q,{className:`h-40 w-full rounded-2xl`})]})}function qe(){let{t:e}=s(`openhands`);return(0,B.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,B.jsx)(N,{className:`size-12 text-muted`}),(0,B.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(o.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,B.jsx)(`div`,{className:`mt-6`,children:(0,B.jsx)(V,{})})]})}var Je=n(function(){let{t:e}=s(`openhands`),{automationId:t}=r(),{navigate:n}=v(),[i,a]=(0,z.useState)(!1),[c,d]=(0,z.useState)(!1),{data:f,isLoading:p,refetch:m}=ne(),g=f?.status===`ok`,_=h(),b=(0,z.useRef)(_.backend.id).current!==_.backend.id,{data:x,isLoading:C,isError:w,error:T,refetch:E}=de({id:t??``,enabled:g&&!b}),{trackPrebuiltAutomationEnabled:D}=S(),O=ee(),k=ue(),A=fe(),j=w&&y(T)&&T.response?.status===404;if(p)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)($,{})})});if(!g)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(se,{onRetry:m})})});if(C)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)($,{})})});if(j)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(qe,{})})});if(w||!x)return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsx)(re,{onRetry:()=>E()})})});let M=()=>{let e=!x.enabled;O.mutate({id:x.id,enabled:e}),e&&D({automationId:x.id,automationName:x.name})},N=()=>{k.mutate(x.id,{onSuccess:()=>{n?.(`/automations`)}})},P=()=>{A.mutate(x.id,{onSuccess:()=>{u(e(o.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{l(y(t)?t.response?.data?.message||t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(o.AUTOMATIONS$RUN_NOW_ERROR))}})},F=_.backend.kind===`local`;return(0,B.jsx)(`div`,{className:`min-h-full`,children:(0,B.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(V,{}),(0,B.jsx)(he,{automation:x,onToggle:M,onEdit:F?()=>d(!0):void 0,onDelete:()=>a(!0),onRunNow:P,isRunningNow:A.isPending}),x.prompt&&(0,B.jsx)(ve,{prompt:x.prompt}),(0,B.jsx)(we,{automation:x}),x.plugins&&x.plugins.length>0&&(0,B.jsx)(De,{plugins:x.plugins}),(0,B.jsx)(ke,{createdAt:x.created_at,lastRunAt:x.last_triggered_at}),(0,B.jsx)(Ke,{automationId:x.id}),(0,B.jsx)(ie,{automationName:x.name,isOpen:i,onConfirm:N,onCancel:()=>a(!1)}),F&&(0,B.jsx)(le,{automation:x,isOpen:c,onClose:()=>d(!1)})]})})})});export{Je as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./react-dom-hVBnwgwZ.js";import{o as i,t as a}from"./declaration-DaUdB2Wg.js";import{n as o,t as s}from"./recommended-automations-launcher-BIul0osB.js";import{t as c}from"./Trans-BJeYqz2A.js";import{t as l}from"./useTranslation-CEcjrme-.js";import{t as u}from"./createLucideIcon-Ddu8jDOQ.js";import{t as d}from"./check-CZhEL6rP.js";import{n as f,r as p}from"./custom-toast-handlers-BohXx7uh.js";import{a as m,c as h,i as g,o as _,r as v,s as y}from"./circle-plus-check-toggle-DquBwJ_6.js";import{t as b}from"./utils-CdgBzLA7.js";import{n as ee}from"./active-backend-context-I2w666XY.js";import{t as x}from"./modal-backdrop-BDqI1zBV.js";import{n as S}from"./modal-classes-DwTdT3IK.js";import{t as C}from"./brand-button-LBFNic99.js";import{n as w}from"./navigation-context-aNGUUtdq.js";import{t as T}from"./styled-tooltip-TCp7svY3.js";import{u as E}from"./dropdown-classes-Vqz86I0R.js";import{n as te}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js";import{t as D}from"./modal-close-button-gQgKqUf-.js";import{t as ne}from"./use-tracking-DQYdZpxi.js";import{n as O,t as k}from"./context-menu-list-item-D0swnhFt.js";import{t as A}from"./u-edit-BIYzjs3v.js";import{t as j}from"./folder-2h1hR1Qb.js";import{t as M}from"./search-BeVRXvX7.js";import{n as N}from"./skill-card-pill-row-BhUlGcYB.js";import{t as P}from"./globe-qFjFNG6J.js";import{n as F,t as I}from"./use-launch-skill-in-chat-3ydwpi_M.js";import{_ as re,b as ie,c as L,d as R,f as z,g as ae,h as B,i as oe,l as V,m as H,n as se,o as ce,p as U,r as le,s as ue,t as de,u as W,v as fe,y as pe}from"./edit-automation-modal-CNZgSSiH.js";var me=u(`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`}]]),he=u(`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`}]]),ge=u(`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`}]]),G=e(t(),1),K=i();function _e({value:e,onChange:t,className:n}){let{t:r}=l(`openhands`);return(0,K.jsxs)(`div`,{className:b(`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,K.jsx)(M,{className:`ml-3 size-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,K.jsx)(`input`,{type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:r(a.AUTOMATIONS$SEARCH_PLACEHOLDER),"aria-label":r(a.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 q(e,t){let n=[];if(e.repository&&n.push({id:`repository`,node:(0,K.jsxs)(`span`,{className:b(_,`gap-1`),children:[(0,K.jsx)(j,{className:`size-3 shrink-0`}),e.repository]})}),e.trigger.type===`event`){let t=[e.trigger.on?L(e.trigger.on):``,e.trigger.source?`(${e.trigger.source})`:``].filter(Boolean).join(` `);n.push({id:`event-trigger`,node:(0,K.jsxs)(`span`,{className:b(_,`gap-1`),children:[(0,K.jsx)(P,{className:`size-3 shrink-0`}),t]})})}else n.push({id:`schedule`,node:(0,K.jsxs)(`span`,{className:b(_,`gap-1`),children:[(0,K.jsx)(W,{className:`size-3 shrink-0`}),t]})});return e.model&&n.push({id:`model`,node:(0,K.jsxs)(`span`,{className:b(_,`gap-1`),children:[(0,K.jsx)(V,{className:`size-3 shrink-0`}),e.model]})}),n}function J({automation:e,t,canManage:n,onRunNow:r,isRunPending:i,onView:o,onEdit:s,onToggle:c,onDelete:l}){return[...n?[{label:t(a.AUTOMATIONS$RUN_NOW),icon:(0,K.jsx)(R,{className:`size-4`}),onClick:()=>r(e.id),disabled:i||!e.enabled}]:[],{label:t(a.COMMON$VIEW),icon:(0,K.jsx)(me,{className:`size-4`,"aria-hidden":!0}),onClick:o},...n&&s?[{label:t(a.AUTOMATIONS$EDIT),icon:(0,K.jsx)(A,{className:`size-4`}),onClick:()=>s(e.id)}]:[],...n?[{label:e.enabled?t(a.AUTOMATIONS$TURN_OFF):t(a.AUTOMATIONS$TURN_ON),icon:(0,K.jsx)(ue,{className:`size-4`}),onClick:()=>c(e.id,e.enabled)},{label:t(a.AUTOMATIONS$DELETE),icon:(0,K.jsx)(ce,{className:`size-4`}),onClick:()=>l(e.id)}]:[]]}function ve({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onEdit:o}){let{navigate:s}=w(),{t:c}=l(`openhands`),u=z(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,f=(0,G.useMemo)(()=>q(e,d),[e,d]),p=()=>{s?.(`/automations/${e.id}`)},h=J({automation:e,t:c,canManage:u,onRunNow:n,isRunPending:r,onView:p,onEdit:o,onToggle:t,onDelete:i}),g=()=>{p()};return(0,K.jsxs)(`div`,{role:`link`,tabIndex:0,"data-testid":`automation-card-${e.id}`,onClick:g,onKeyDown:e=>{e.key===`Enter`&&g()},className:b(`flex min-w-0 flex-col gap-3 overflow-hidden p-4 text-left`,y,m),children:[(0,K.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,K.jsxs)(`h3`,{className:`flex items-center gap-2 truncate text-sm font-semibold text-white`,children:[e.trigger.type===`event`?(0,K.jsx)(P,{className:`size-4 shrink-0 text-muted`}):(0,K.jsx)(W,{className:`size-4 shrink-0 text-muted`}),(0,K.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.prompt?(0,K.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.prompt}):null]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[u?(0,K.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:B,children:[(0,K.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),c(a.AUTOMATIONS$RUN_NOW)]}):null,(0,K.jsx)(U,{items:h})]})]}),f.length>0?(0,K.jsx)(N,{pills:f,testId:`automation-pills-${e.id}`}):null]})}var ye=`overflow-hidden rounded-md border border-[var(--oh-border)] bg-base-secondary`,be=[`h-11`,`border-t border-[var(--oh-border)] transition-colors`].join(` `),xe=`hover:bg-interactive-hover-low outline-none focus:outline-none focus-visible:outline-none focus-visible:bg-interactive-hover-low`,Y=`px-3 align-middle`,Se=[be,xe,`cursor-pointer`].join(` `),Ce=`openhands-automations-view`;function we(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function Te(e){window.localStorage.setItem(Ce,e)}function Ee({automation:e,onToggle:t,onRunNow:n,isRunPending:r=!1,onDelete:i,onEdit:o}){let{navigate:s}=w(),{t:c}=l(`openhands`),u=z(`manage_automations`),d=e.trigger.schedule_human||e.trigger.type,f=(0,G.useMemo)(()=>q(e,d),[e,d]),p=()=>{s?.(`/automations/${e.id}`)},m=J({automation:e,t:c,canManage:u,onRunNow:n,isRunPending:r,onView:p,onEdit:o,onToggle:t,onDelete:i}),h=()=>{p()};return(0,K.jsxs)(`tr`,{"data-testid":`automation-list-row-${e.id}`,onClick:h,onKeyDown:e=>{e.key===`Enter`&&h()},tabIndex:0,className:b(Se,`cursor-pointer`),children:[(0,K.jsx)(`td`,{className:Y,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[e.trigger.type===`event`?(0,K.jsx)(P,{className:`size-4 shrink-0 text-muted`}):(0,K.jsx)(W,{className:`size-4 shrink-0 text-muted`}),(0,K.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,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(N,{pills:f,testId:`automation-pills-${e.id}`})}):null]})}),(0,K.jsx)(`td`,{className:b(`w-0 whitespace-nowrap`,Y),children:(0,K.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[u?(0,K.jsx)(T,{content:c(a.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,K.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":c(a.AUTOMATIONS$RUN_NOW),"aria-busy":r,disabled:r||!e.enabled,onClick:t=>{t.stopPropagation(),n(e.id)},className:H,children:(0,K.jsx)(R,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,K.jsx)(U,{items:m})]})})]})}function X({title:e,count:t,automations:n,view:r,onToggle:i,onRunNow:a,runPendingId:s=null,onDelete:c,onEdit:l}){return n.length===0?null:(0,K.jsxs)(`section`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e}),(0,K.jsx)(o,{count:t})]}),r===`grid`?(0,K.jsx)(`div`,{className:b(`mt-3`,g),children:(0,K.jsx)(`div`,{className:v,children:n.map(e=>(0,K.jsx)(ve,{automation:e,onToggle:i,onRunNow:a,isRunPending:s===e.id,onDelete:c,onEdit:l},e.id))})}):(0,K.jsx)(`div`,{className:b(ye,`mt-3`),children:(0,K.jsx)(`table`,{className:`w-full min-w-full [&>tbody>tr:first-child]:border-t-0`,children:(0,K.jsx)(`tbody`,{children:n.map(e=>(0,K.jsx)(Ee,{automation:e,onToggle:i,onRunNow:a,isRunPending:s===e.id,onDelete:c,onEdit:l},e.id))})})})]})}var De=e(r(),1),Z=[{value:`grid`,icon:he,labelKey:a.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:ge,labelKey:a.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function Oe({icon:e,label:t,isSelected:n}){return(0,K.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,K.jsx)(`span`,{className:E,"aria-hidden":!0,children:(0,K.jsx)(e,{})}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,K.jsx)(d,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}function ke({view:e,onChange:t,disabled:n=!1}){let{t:r}=l(`openhands`),[i,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(),u=(0,G.useRef)(null),d=(0,G.useRef)(null),f=(Z.find(t=>t.value===e)??Z[0]).icon;(0,G.useLayoutEffect)(()=>{if(!i||!u.current)return;let e=()=>{let e=u.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,G.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;u.current?.contains(t)||d.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 p=i&&s?(0,K.jsx)(O,{ref:d,theme:`popover`,className:`min-w-[10rem]`,children:Z.map(n=>(0,K.jsx)(`li`,{children:(0,K.jsx)(k,{testId:n.testId,onClick:()=>{t(n.value),o(!1)},className:`group`,children:(0,K.jsx)(Oe,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{ref:u,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(a.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||o(e=>!e)},className:b(`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,K.jsx)(f,{className:`size-4`,"aria-hidden":!0})}),i&&s&&typeof document<`u`?De.createPortal((0,K.jsx)(`div`,{style:s,children:p}),document.body):null]})}function Q(){return(0,K.jsxs)(`div`,{"data-testid":`automation-card-skeleton`,className:`${y} border border-transparent p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,K.jsx)(`div`,{className:`h-5 w-40 animate-pulse rounded bg-surface-raised`}),(0,K.jsx)(`div`,{className:`h-5 w-10 animate-pulse rounded-full bg-surface-raised`})]}),(0,K.jsx)(`div`,{className:`mt-2 h-4 w-72 animate-pulse rounded bg-surface-raised`}),(0,K.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,K.jsx)(`div`,{className:`h-7 w-32 animate-pulse rounded-full bg-surface-raised`}),(0,K.jsx)(`div`,{className:`h-7 w-28 animate-pulse rounded-full bg-surface-raised`}),(0,K.jsx)(`div`,{className:`h-7 w-24 animate-pulse rounded-full bg-surface-raised`})]})]})}var Ae=e=>(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,K.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})}),je=`https://docs.openhands.dev/openhands/usage/automations/overview`;function Me({children:e}){return(0,K.jsx)(`span`,{className:`whitespace-nowrap`,children:e})}function Ne({children:e}){return(0,K.jsx)(`code`,{"data-testid":`automations-create-instructions-example`,className:b(`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 Pe({children:e}){return(0,K.jsx)(K.Fragment,{children:e})}var Fe={example:(0,K.jsx)(Me,{}),cmd:(0,K.jsx)(Ne,{}),punct:(0,K.jsx)(Pe,{})};function $({onLaunch:e}={}){let{t}=l(`openhands`),n=I();return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[(0,K.jsx)(c,{ns:`openhands`,i18nKey:a.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC,components:Fe}),` `,t(a.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE)]}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsx)(`a`,{href:je,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-muted underline transition-colors hover:text-foreground`,children:t(a.AUTOMATIONS$EMPTY_LEARN_MORE)}),(0,K.jsx)(C,{type:`button`,variant:`primary`,testId:`automations-create-automation`,onClick:()=>{n(t(a.AUTOMATIONS$CREATE_AUTOMATION_PROMPT),e)},startContent:(0,K.jsx)(F,{className:`size-4`,"aria-hidden":!0}),children:t(a.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})]})]})}function Ie({collapsible:e=!1}){let{t}=l(`openhands`),[n,r]=(0,G.useState)(!e);return e?(0,K.jsxs)(`div`,{className:`w-full rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,K.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,K.jsx)(`span`,{className:`text-sm font-normal text-content`,children:t(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,K.jsx)(Ae,{className:b(`size-5 text-muted transition-transform`,n&&`rotate-180`)})]}),n?(0,K.jsx)(`div`,{className:`px-4 pb-4`,children:(0,K.jsx)($,{})}):null]}):(0,K.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[(0,K.jsx)(`h3`,{className:`text-center text-sm font-medium text-content`,children:t(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)($,{})})]})}function Le(){let{t:e}=l(`openhands`);return(0,K.jsxs)(`div`,{"data-testid":`automations-empty`,className:h,children:[(0,K.jsx)(`p`,{className:`text-sm text-white`,children:e(a.AUTOMATIONS$EMPTY)}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-tertiary-light`,children:e(a.AUTOMATIONS$EMPTY_HINT)}),(0,K.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,K.jsx)(Ie,{})})]})}function Re({isOpen:e,onClose:t}){let{t:n}=l(`openhands`);return e?(0,K.jsx)(x,{onClose:t,"aria-label":n(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE),children:(0,K.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,K.jsx)(D,{onClose:t,testId:`add-automation-modal-close`}),(0,K.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,K.jsx)(`h2`,{id:`add-automation-modal-title`,className:b(`pr-6`,S),children:n(a.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)})}),(0,K.jsx)(`div`,{className:`px-6 pb-6`,children:(0,K.jsx)($,{onLaunch:t})})]})}):null}var ze=50,Be=n(function(){let{t:e}=l(`openhands`),[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)(()=>we()),[o,c]=(0,G.useState)(ze),[u,d]=(0,G.useState)(null),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),v=ee().backend.kind===`local`,{data:y,isLoading:b,refetch:x}=ae(),S=y?.status===`ok`,{data:w,isLoading:T,isError:E,refetch:D}=re({limit:o,offset:0,enabled:S}),{trackPrebuiltAutomationEnabled:O}=ne(),k=ie(),A=fe(),j=pe(),M=(0,G.useMemo)(()=>{if(!w?.automations)return[];let e=t.toLowerCase();return e?w.automations.filter(t=>t.name.toLowerCase().includes(e)||(t.prompt??``).toLowerCase().includes(e)||t.repository?.toLowerCase().includes(e)||t.model?.toLowerCase().includes(e)):w.automations},[w?.automations,t]),N=(0,G.useMemo)(()=>M.filter(e=>e.enabled),[M]),P=(0,G.useMemo)(()=>M.filter(e=>!e.enabled),[M]),F=(e,t)=>{let n=!t;if(k.mutate({id:e,enabled:n}),n){let t=w?.automations.find(t=>t.id===e);O({automationId:e,automationName:t?.name??e})}},I=t=>{j.mutate(t,{onSuccess:()=>{p(e(a.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{f(te(t)?t.response?.data?.message||t.message||e(a.AUTOMATIONS$RUN_NOW_ERROR):t.message||e(a.AUTOMATIONS$RUN_NOW_ERROR))}})},L=e=>{let t=w?.automations.find(t=>t.id===e);t&&d({id:e,name:t.name})},R=e=>{let t=w?.automations.find(t=>t.id===e);t&&h(t)},z=()=>{u&&(A.mutate(u.id),d(null))},B=(0,G.useCallback)(e=>{i(e),Te(e)},[]),V=w?w.total>w.automations.length:!1,H=!T&&!E&&w?.automations.length===0;return b?(0,K.jsx)(`div`,{className:`min-h-full`,children:(0,K.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)}),(0,K.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,K.jsx)(Q,{},`skeleton-${String(t)}`))})]})}):S?(0,K.jsx)(`div`,{className:`min-h-full`,children:(0,K.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)})]}),(0,K.jsx)(C,{type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(!0),children:e(a.AUTOMATIONS$ADD_AUTOMATION)})]}),(0,K.jsxs)(`div`,{className:`mt-6 flex items-stretch gap-2`,children:[(0,K.jsx)(_e,{value:t,onChange:n}),(0,K.jsx)(ke,{view:r,onChange:B,disabled:H})]}),(0,K.jsxs)(`div`,{className:`mt-6 flex flex-col gap-6`,children:[T&&(0,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,K.jsx)(Q,{},`skeleton-${String(t)}`))}),E&&!T&&(0,K.jsx)(oe,{onRetry:D}),H&&(0,K.jsx)(Le,{}),!T&&!E&&w&&w.automations.length>0&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(X,{title:e(a.AUTOMATIONS$ACTIVE),count:N.length,automations:N,view:r,onToggle:F,onRunNow:I,runPendingId:j.isPending?j.variables??null:null,onDelete:L,onEdit:v?R:void 0}),(0,K.jsx)(X,{title:e(a.AUTOMATIONS$INACTIVE),count:P.length,automations:P,view:r,onToggle:F,onRunNow:I,runPendingId:j.isPending?j.variables??null:null,onDelete:L,onEdit:v?R:void 0}),V&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>e+ze),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(a.AUTOMATIONS$LOAD_MORE)})]})]}),(0,K.jsx)(`div`,{className:`mt-6`,children:(0,K.jsx)(s,{query:t})}),(0,K.jsx)(se,{automationName:u?.name??``,isOpen:u!==null,onConfirm:z,onCancel:()=>d(null)}),m&&(0,K.jsx)(de,{automation:m,isOpen:m!==null,onClose:()=>h(null)}),(0,K.jsx)(Re,{isOpen:g,onClose:()=>_(!1)})]})}):(0,K.jsx)(`div`,{className:`min-h-full`,children:(0,K.jsxs)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:[(0,K.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e(a.AUTOMATIONS$TITLE)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:e(a.AUTOMATIONS$SUBTITLE)}),(0,K.jsx)(le,{onRetry:x})]})})});export{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-
|
|
1
|
+
import"./rolldown-runtime-BFRubm34.js";import{t as e}from"./react-CM_dJw1Z.js";import{o as t}from"./declaration-DaUdB2Wg.js";import{t as n}from"./createLucideIcon-Ddu8jDOQ.js";import{t as r}from"./utils-CdgBzLA7.js";import{i}from"./brand-button-LBFNic99.js";import{t as a}from"./navigation-link-CYkF2y3K.js";var o=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);e();var s=t();function c({children:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o,{size:20,"aria-hidden":!0}),e]})}function l(e){let{children:t,testId:n,className:o}=e,l=r(i,o);return`to`in e?(0,s.jsx)(a,{to:e.to,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})}):(0,s.jsx)(`button`,{type:`button`,onClick:e.onClick,"data-testid":n,className:l,children:(0,s.jsx)(c,{children:t})})}export{l as t};
|