@openhands/agent-canvas 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/acp-providers-DOKcGeaV.js +1 -0
- package/build/assets/active-backend-context-BETEdaJl.js +2 -0
- package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
- package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
- package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
- package/build/assets/agent-settings-BnzyTgCb.js +2 -0
- package/build/assets/agent-settings-CeXj3xK-.js +1 -0
- package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
- package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
- package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
- package/build/assets/automation-detail-CF2SweVs.js +3 -0
- package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
- package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
- package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
- package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
- package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
- package/build/assets/automations-list-yK7ETmYP.js +1 -0
- package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
- package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
- package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
- package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
- package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
- package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
- package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
- package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
- package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
- package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
- package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
- package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
- package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
- package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
- package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
- package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
- package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
- package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
- package/build/assets/conversation-XRsI28ZM.js +1 -0
- package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
- package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
- package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
- package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
- package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
- package/build/assets/empty-state-B5advKVW.js +1 -0
- package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
- package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
- package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
- package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
- package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
- package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
- package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
- package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
- package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
- package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
- package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
- package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
- package/build/assets/home-4lyLzYjG.js +1 -0
- package/build/assets/home-BGaB0EeK.js +1 -0
- package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
- package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
- package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
- package/build/assets/index-home-6Y_Y7kOo.js +1 -0
- package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
- package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
- package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
- package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
- package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
- package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
- package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
- package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
- package/build/assets/manifest-23d79467.js +1 -0
- package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
- package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
- package/build/assets/mcp-CoUOIGBF.js +1 -0
- package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
- package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
- package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
- package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
- package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
- package/build/assets/onboarding-Cc4Av7bi.js +1 -0
- package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
- package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
- package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
- package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
- package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
- package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
- package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
- package/build/assets/root-D1y82Lhg.js +2 -0
- package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
- package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
- package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
- package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
- package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
- package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
- package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
- package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
- package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
- package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
- package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
- package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
- package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
- package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
- package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
- package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
- package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
- package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
- package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
- package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
- package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
- package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
- package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
- package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
- package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
- package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
- package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
- package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
- package/build/assets/trash-D1QMHInX.js +1 -0
- package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
- package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
- package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
- package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
- package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
- package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
- package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
- package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
- package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
- package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
- package/build/assets/use-create-conversation-D15Px574.js +1 -0
- package/build/assets/use-create-secret-D_qPU88t.js +1 -0
- package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
- package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
- package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
- package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
- package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
- package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
- package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
- package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
- package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
- package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
- package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
- package/build/assets/use-tracking-BAFpgpgq.js +3 -0
- package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
- package/build/assets/utils-CbjwNcR-.js +1 -0
- package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
- package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +18 -1
- package/build/locales/ca/openhands.json +18 -1
- package/build/locales/de/openhands.json +18 -1
- package/build/locales/en/openhands.json +18 -1
- package/build/locales/es/openhands.json +18 -1
- package/build/locales/fr/openhands.json +18 -1
- package/build/locales/it/openhands.json +18 -1
- package/build/locales/ja/openhands.json +18 -1
- package/build/locales/ko-KR/openhands.json +18 -1
- package/build/locales/no/openhands.json +18 -1
- package/build/locales/pt/openhands.json +18 -1
- package/build/locales/tr/openhands.json +18 -1
- package/build/locales/uk/openhands.json +18 -1
- package/build/locales/zh-CN/openhands.json +18 -1
- package/build/locales/zh-TW/openhands.json +18 -1
- package/config/defaults.json +3 -3
- package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
- package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
- package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
- package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +0 -5
- package/dist/constants/acp-providers.js +20 -16
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/constants/profile-scope.d.ts +21 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +30 -19
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
- package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +1 -0
- package/dist/hooks/query/query-keys.js +10 -1
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
- package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
- package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.js +3 -1
- package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.js +8 -9
- package/dist/hooks/use-drag-resize.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 +18 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +289 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +18 -1
- package/dist/locales/ca/openhands.json +18 -1
- package/dist/locales/de/openhands.json +18 -1
- package/dist/locales/en/openhands.json +18 -1
- package/dist/locales/es/openhands.json +18 -1
- package/dist/locales/fr/openhands.json +18 -1
- package/dist/locales/it/openhands.json +18 -1
- package/dist/locales/ja/openhands.json +18 -1
- package/dist/locales/ko-KR/openhands.json +18 -1
- package/dist/locales/no/openhands.json +18 -1
- package/dist/locales/pt/openhands.json +18 -1
- package/dist/locales/tr/openhands.json +18 -1
- package/dist/locales/uk/openhands.json +18 -1
- package/dist/locales/zh-CN/openhands.json +18 -1
- package/dist/locales/zh-TW/openhands.json +18 -1
- package/dist/manifests/automation-setup.cjs.map +1 -1
- package/dist/manifests/automation-setup.js.map +1 -1
- package/dist/manifests/manifest-local-validation.cjs.map +1 -1
- package/dist/manifests/manifest-local-validation.js.map +1 -1
- package/dist/manifests/manifest-validation.cjs +1 -1
- package/dist/manifests/manifest-validation.cjs.map +1 -1
- package/dist/manifests/manifest-validation.js +2 -2
- package/dist/manifests/manifest-validation.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +11 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +26 -2
- package/dist/types/automation.js.map +1 -1
- package/dist/utils/automation-disabled-reason.cjs +2 -0
- package/dist/utils/automation-disabled-reason.cjs.map +1 -0
- package/dist/utils/automation-disabled-reason.d.ts +32 -0
- package/dist/utils/automation-disabled-reason.js +19 -0
- package/dist/utils/automation-disabled-reason.js.map +1 -0
- package/dist/utils/parse-git-remote-url.cjs +1 -1
- package/dist/utils/parse-git-remote-url.cjs.map +1 -1
- package/dist/utils/parse-git-remote-url.d.ts +5 -1
- package/dist/utils/parse-git-remote-url.js +20 -13
- package/dist/utils/parse-git-remote-url.js.map +1 -1
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +14 -1
- package/scripts/docker-build.mjs +3 -0
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DcY_mKYa.js +0 -1
- package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
- package/build/assets/agent-settings-BF8hM6wb.js +0 -2
- package/build/assets/agent-settings-YPutBAeR.js +0 -1
- package/build/assets/automation-detail-BxXhb_m2.js +0 -3
- package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
- package/build/assets/automations-list-DEPVNud3.js +0 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
- package/build/assets/conversation-edjzrv5w.js +0 -1
- package/build/assets/conversation-panel-edjzrv5w.js +0 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
- package/build/assets/empty-state-FK_s1B60.js +0 -1
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
- package/build/assets/home-BM5_Wz_R.js +0 -1
- package/build/assets/home-Ivfm7KC4.js +0 -1
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
- package/build/assets/index-home-td9BN2T3.js +0 -1
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
- package/build/assets/link-external-BNZzCM1I.js +0 -1
- package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
- package/build/assets/llm-settings-CZaXYgtw.js +0 -1
- package/build/assets/manifest-bfeccb98.js +0 -1
- package/build/assets/mcp-CraxoXQv.js +0 -1
- package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
- package/build/assets/mcp-page-CteH_K0N.js +0 -9
- package/build/assets/onboarding-DXFBRqEy.js +0 -1
- package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
- package/build/assets/root-CM6IZHlg.css +0 -1
- package/build/assets/root-DdFkodKW.js +0 -2
- package/build/assets/trash-Ckh7yCaB.js +0 -1
- package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
- package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
- package/build/assets/use-tracking-j4uo9VEW.js +0 -3
- package/build/assets/utils-BgLSZdyy.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{B as r,H as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{l as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as s}from"./useQuery-DAAacS7O.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{Q as l,ct as u,n as d,st as f}from"./active-backend-context-BnH4-L8h.js";import{K as p,a as m,t as h}from"./utils-BgLSZdyy.js";import{a as g,c as _,n as v}from"./agent-server-client-options-EHB23gyx.js";import{a as y,b,d as x,i as S,l as C,m as w,n as T,o as E,r as D,s as O,u as k,x as ee}from"./kebab-menu-item-content-SCJBwZnp.js";import{r as te}from"./context-menu-list-item-Cm7-7Y-7.js";import{b as A}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as ne}from"./proxy-XP6U1Dhv.js";import{n as j}from"./organization-service.api-B5CvmnYQ.js";import{C as re,P as M,n as N,t as P}from"./use-tracking-j4uo9VEW.js";import{t as ie}from"./use-settings-C2KKQKVC.js";import{r as F}from"./modal-classes-B0b9eiL8.js";import{t as I}from"./brand-button-CUMfjb99.js";import{n as L}from"./navigation-context-CQZwH_tC.js";import{n as R}from"./use-create-conversation-i_PdFdIs.js";import{t as z}from"./u-edit-DAkcF52u.js";import{t as B}from"./terminal-BUpID2wS.js";import{t as V}from"./toggle-switch-B2uXaAUS.js";import{n as H,t as ae}from"./use-automation-health-U99vvHxx.js";import{t as U}from"./automation-C_eCrGyP.js";import{i as oe,l as se,o as ce,r as le,u as ue}from"./use-automations-Bq5hVuv0.js";import{t as de}from"./use-user-conversation-5UFqMoO4.js";import{n as W}from"./api-error-message-BXo0lCI5.js";import{t as fe}from"./x-mark-BopmFoBq.js";import{n as pe,t as me}from"./link-external-BNZzCM1I.js";import{t as he}from"./edit-automation-modal-D_JWSmxT.js";import{n as ge,t as _e}from"./use-automation-permissions-Buus0R6h.js";import{n as ve,t as ye}from"./trash-Ckh7yCaB.js";import{n as be,r as xe,t as Se}from"./error-state-Cf8LRuuY.js";import{i as Ce,r as we,t as Te}from"./automation-export-BJsfi7n2.js";import{a as G,i as Ee,n as K,r as q,t as De}from"./cog-CAEugqtV.js";var J=e(t());function Oe(e){let{backend:t,orgId:n}=d(),r=t.kind===`cloud`&&!!n&&!!e;return s({queryKey:[`cloud-org-member`,t.id,n,e,t.connectionRevision??0],queryFn:()=>j(n,e,t),enabled:r,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}})}var Y=n(),ke=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,Y.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 Ae({active:e}){let{t}=c(`openhands`);return(0,Y.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:h(`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?p.AUTOMATIONS$DETAIL$ACTIVE:p.AUTOMATIONS$DETAIL$INACTIVE)})}function je({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:a,onRunNow:o,isRunningNow:s=!1,canManage:l=!0,canToggle:u=l}){let{t:d}=c(`openhands`),f=[{label:d(p.AUTOMATIONS$EXPORT),icon:(0,Y.jsx)(ke,{className:`size-4`}),onClick:i},{label:d(p.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,Y.jsx)(ke,{className:`size-4`}),onClick:a},...l&&n?[{label:d(p.AUTOMATIONS$EDIT),icon:(0,Y.jsx)(z,{className:`size-4`}),onClick:n}]:[],...u?[{label:e.enabled?d(p.AUTOMATIONS$TURN_OFF):d(p.AUTOMATIONS$TURN_ON),icon:(0,Y.jsx)(T,{className:`size-4`}),onClick:t}]:[],...l?[{label:d(p.AUTOMATIONS$DELETE),icon:(0,Y.jsx)(ye,{className:`size-4`}),onClick:r}]:[]];return(0,Y.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,Y.jsx)(Ae,{active:e.enabled})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&o&&(0,Y.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:s||!e.enabled,onClick:o,children:[(0,Y.jsx)(D,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),d(s?p.AUTOMATIONS$STARTING:p.AUTOMATIONS$RUN_NOW)]}),u&&(0,Y.jsx)(V,{enabled:e.enabled,label:e.enabled?d(p.AUTOMATIONS$TURN_OFF):d(p.AUTOMATIONS$TURN_ON),onToggle:t}),(0,Y.jsx)(ve,{items:f})]})]})})}var Me=240,Ne=`max-h-60`;function Pe({prompt:e}){let{t}=c(`openhands`),[n,r]=J.useState(!1),[i,a]=J.useState(!1),o=J.useRef(null),s=i&&!n;return J.useLayoutEffect(()=>{let e=o.current;if(!e)return;let t=()=>{a(e.scrollHeight>Me)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,Y.jsx)(q,{icon:(0,Y.jsx)(B,{className:`size-4`}),title:t(p.AUTOMATIONS$DETAIL$PROMPT),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(`p`,{ref:o,className:h(`whitespace-pre-wrap text-sm leading-6 text-content`,s&&h(Ne,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),s?(0,Y.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,Y.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?p.COMMON$VIEW_LESS:p.COMMON$VIEW_MORE)}):null]})})}var Fe=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`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`})}),Ie=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Y.jsx)(`path`,{d:`M12 4C9.79086 4 8 5.79086 8 8C8 10.2091 9.79086 12 12 12C14.2091 12 16 10.2091 16 8C16 5.79086 14.2091 4 12 4ZM6 8C6 4.68629 8.68629 2 12 2C15.3137 2 18 4.68629 18 8C18 11.3137 15.3137 14 12 14C8.68629 14 6 11.3137 6 8ZM8 18C6.34315 18 5 19.3431 5 21C5 21.5523 4.55228 22 4 22C3.44772 22 3 21.5523 3 21C3 18.2386 5.23858 16 8 16H16C18.7614 16 21 18.2386 21 21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21C19 19.3431 17.6569 18 16 18H8Z`,fill:`currentColor`})}),Le=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`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 Re({branch:e}){return(0,Y.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 ze=60;function Be({filter:e}){let{t}=c(`openhands`),[n,r]=(0,J.useState)(!1),i=e.length>ze;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,ze)}…`:e}),i&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?p.SETTINGS$SKILLS_SHOW_LESS:p.SETTINGS$SKILLS_SHOW_MORE)})]})}function Ve({automation:e,runsAs:t}){let{t:n}=c(`openhands`),r=e.trigger.type===`event`,i=e.trigger.schedule??``;e.trigger.schedule_human&&(i=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let a=n(r?p.AUTOMATIONS$DETAIL$TRIGGER_EVENT:p.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,Y.jsx)(q,{icon:(0,Y.jsx)(De,{className:`size-4`}),title:n(p.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Ee,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,Y.jsx)(Re,{branch:e.branch})]})}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(y,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$TRIGGER),children:a}),!r&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Fe,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$SCHEDULE),children:i}),r&&e.trigger.source&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(te,{className:`size-3.5`,"aria-hidden":`true`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),r&&e.trigger.on&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(me,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_TYPE),children:w(e.trigger.on)}),r&&e.trigger.filter&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(pe,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,Y.jsx)(Be,{filter:e.trigger.filter})}),t&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Ie,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$RUNS_AS),children:(0,Y.jsx)(`span`,{className:`break-all`,children:t})}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(ee,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$MODEL),children:e.model??n(p.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Le,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var He=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`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 Ue({name:e}){return(0,Y.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 We({plugins:e}){let{t}=c(`openhands`);return(0,Y.jsx)(q,{icon:(0,Y.jsx)(He,{className:`size-4`}),title:t(p.AUTOMATIONS$DETAIL$PLUGINS),children:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,Y.jsx)(Ue,{name:e},e))})})}var Ge=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`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 Ke({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=c(`openhands`),i=r.language;return(0,Y.jsx)(q,{icon:(0,Y.jsx)(Ge,{className:`size-4`}),title:n(p.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,Y.jsx)(K,{icon:(0,Y.jsx)(Fe,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$CREATED),children:C(e,i)}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(H,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$LAST_RUN),children:t?k(t,i,n):n(p.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var qe=100,Je=[`run_id`,`automation_id`,`automation_name`,`trigger`,`start_time`,`end_time`,`duration_seconds`,`status`,`conversation_id`,`conversation_url`,`error`,`cost`,`phase`];function Ye(e,t){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}.activity-log.${t}`}function Xe(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Ze(e){let t=[Je.join(`,`)];for(let n of e){let e=Je.map(e=>{let t=n[e];return t==null?``:Xe(e===`trigger`?JSON.stringify(t):String(t))});t.push(e.join(`,`))}return`${t.join(`
|
|
2
|
-
`)}\n`}function Qe(e,t){if(!e)return null;let n=`/conversations/${e}`;return t?`${t.replace(/\/$/,``)}${n}`:n}function $e(e,t,n){let r=e.started_at||null,i=e.completed_at,a=null;return r&&i&&(a=(new Date(i).getTime()-new Date(r).getTime())/1e3),{run_id:e.id,automation_id:t.id,automation_name:t.name,trigger:t.trigger,start_time:r,end_time:i,duration_seconds:a,status:e.status,conversation_id:e.conversation_id,conversation_url:Qe(e.conversation_id,n),error:e.error_detail,cost:e.cost??null,phase:e.phase_code?.trim()||e.phase_label?.trim()||null}}async function et(e,t){let n=[],r=0,i=1/0;for(;r<i;){let a=await N.listAutomationRuns(e.id,{limit:qe,offset:r});for(let r of a.runs)n.push($e(r,e,t));if(i=a.total,r+=a.runs.length,a.runs.length===0)break}return n}async function tt(e){let{automation:t,format:n,conversationBaseUrl:r}=e,i=await et(t,r);if(n===`json`){m(new Blob([`${JSON.stringify({runs:i,total:i.length},null,2)}\n`],{type:`application/json`}),Ye(t,`json`));return}m(new Blob([Ze(i)],{type:`text/csv;charset=utf-8`}),Ye(t,`csv`))}var nt=20;function rt(e){return e.kind===`BashOutput`}var it=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<nt;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=>{rt(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=_().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))}),ne({backend:r,method:`GET`,hostOverride:g(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new A(v({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},at=[`bash-command-logs`];function ot(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 st(e){let t=o.isAxiosError(e)?e.response?.status:l(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(o.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function ct(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=d(),a=de(r?t??null:null),o=a.data,c=o?.conversation_url??null,l=o?.session_api_key??null,u=i.backend.kind===`cloud`,f=a.isFetched,p=null,m=!1;u&&f&&(o?p=ot(o.sandbox_status)??(o.conversation_url?null:`missing`):m=!0);let h=r&&!!n&&(u?!!c:!0)&&!p&&!m,g=s({queryKey:[...at,n,c,l,i.backend.id,i.orgId],queryFn:()=>it.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?st(g.error):null,v=p??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:m,sandboxIssue:v}}var lt=4e3;function ut(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function dt({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?ut(a,lt):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
|
|
3
|
-
`)}function ft({run:e,automation:t,stderr:n}){let{t:r}=c(`openhands`),{navigate:i}=L(),a=R();return(0,Y.jsx)(I,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(a.isPending)return;let r=dt({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});a.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:a.isPending,"aria-busy":a.isPending,children:r(p.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var pt={missing:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function mt(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 X(e){return typeof e==`string`?e.trim()||null:typeof e==`number`||typeof e==`boolean`?String(e):null}function ht(e){if(!e)return null;let t=X(e.formatted_detail)??X(e.detail),n=[X(e.phase),X(e.kind),X(e.source),X(e.operation),X(e.code),X(e.status_code)].filter(Boolean);return t&&n.length>0?`${t} (${n.join(` · `)})`:t||(n.length>0?n.join(` · `):JSON.stringify(e))}function gt({run:e}){let{t}=c(`openhands`);if(!e)return null;let n=b(e),r=n.taskOutcome?.outcomeSummary??null,i=n.customTaskMetadataText,a=e.status===U.COMPLETED||n.taskOutcome?n.badgeStatus:null,o=e.error_detail?.trim()||null,s=ht(e.status_detail),l=o||s;return(0,Y.jsxs)(`dl`,{className:`mt-4 grid gap-3 rounded-lg border border-[var(--oh-border)] bg-black/20 p-3 text-xs`,children:[(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-center`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$RUN_LABEL)}),(0,Y.jsx)(`dd`,{children:(0,Y.jsx)(`span`,{className:`inline-flex rounded-md bg-surface-raised px-2 py-0.5 font-mono text-[10px] font-medium text-muted`,children:e.status})})]}),(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-start`,children:[(0,Y.jsx)(`dt`,{className:`pt-0.5 text-muted`,children:t(p.AUTOMATIONS$DETAIL$TASK_LABEL)}),(0,Y.jsxs)(`dd`,{className:`min-w-0 space-y-2`,children:[a?(0,Y.jsx)(S,{status:a,compact:!0}):null,r?(0,Y.jsx)(`p`,{className:`break-words text-content`,children:r}):i?(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$CUSTOM_TASK_METADATA)}):(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$NO_TASK_OUTCOME)}),i?(0,Y.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$TASK_METADATA)}),(0,Y.jsx)(`pre`,{"data-testid":`automation-task-metadata`,className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-[var(--oh-border)] bg-black/30 p-2 font-mono text-[11px] leading-4 text-content`,children:i})]}):null]})]}),(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-start`,children:[(0,Y.jsx)(`dt`,{className:`pt-0.5 text-muted`,children:t(p.AUTOMATIONS$DETAIL$SYSTEM_LABEL)}),(0,Y.jsx)(`dd`,{className:`min-w-0 space-y-1 break-words text-content`,children:l?(0,Y.jsxs)(Y.Fragment,{children:[o?(0,Y.jsxs)(`p`,{children:[(0,Y.jsxs)(`span`,{className:`text-muted`,children:[t(p.COMMON$ERROR),`:`,` `]}),o]}):null,s?(0,Y.jsxs)(`p`,{children:[(0,Y.jsxs)(`span`,{className:`text-muted`,children:[t(p.AUTOMATIONS$DETAIL$STATUS_DETAIL),`:`,` `]}),s]}):null]}):(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$NO_SYSTEM_ISSUES)})})]})]})}function _t({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:a}){let{t:o}=c(`openhands`),[s,l]=(0,J.useState)(`stdout`),{data:u,isFetching:d,isResolvingConversation:f,sandboxIssue:m,conversationMissing:g,error:_}=ct({conversationId:e,bashCommandId:t,enabled:n});(0,J.useEffect)(()=>{n&&l(`stdout`)},[n,t]),(0,J.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:v,stderr:y}=(0,J.useMemo)(()=>u?{stdout:mt(u,`stdout`),stderr:mt(u,`stderr`)}:{stdout:``,stderr:``},[u]);if(!n)return null;let b=f||d&&!u,x=!t,S=s===`stdout`?v:y,C=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,w=`border-[var(--oh-primary)] text-white`,T=`border-transparent text-muted hover:text-content`;return(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":o(p.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,Y.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,Y.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":o(p.AUTOMATIONS$CANCEL),children:(0,Y.jsx)(fe,{className:`size-5`})}),(0,Y.jsx)(`h2`,{className:h(`pr-8`,F),children:o(p.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,Y.jsx)(gt,{run:i}),(0,Y.jsxs)(`div`,{role:`tablist`,"aria-label":o(p.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:s===`stdout`?0:-1,onClick:()=>l(`stdout`),className:`${C} ${s===`stdout`?w:T}`,children:o(p.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:s===`stderr`?0:-1,onClick:()=>l(`stderr`),className:`${C} ${s===`stderr`?w:T}`,children:o(p.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${s}`,"aria-labelledby":`run-logs-tab-${s}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[x&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!x&&g&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!x&&!g&&m&&(0,Y.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${m}`,className:`text-muted italic`,children:o(pt[m])}),!x&&!g&&!m&&b&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!x&&!g&&!m&&!b&&_&&!u&&(0,Y.jsxs)(`p`,{className:`text-danger`,children:[o(p.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(_)]}),!b&&!m&&u&&(0,Y.jsx)(`pre`,{"data-testid":`run-logs-output-${s}`,className:`whitespace-pre-wrap break-words ${s===`stderr`?`text-danger`:`text-content`}`,children:S.length>0?S:(0,Y.jsx)(`span`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===U.FAILED&&(0,Y.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,Y.jsx)(ft,{run:i,automation:a,stderr:y})})]})]})}function vt(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function yt(e){return`/conversations/${e}`}function bt(e){return typeof e!=`number`||!Number.isFinite(e)?null:`$${e.toFixed(4)}`}function xt({run:e,automation:t}){let{t:n,i18n:r}=c(`openhands`),i=!!e.conversation_id,a=!!e.bash_command_id,o=e.status===U.COMPLETED||e.status===U.FAILED||e.status===U.CANCELLED||e.status===U.SKIPPED,s=!i&&o,l=O(e.status),[u,d]=(0,J.useState)(!1),[f]=(0,J.useState)(()=>new Date().toISOString()),m=vt(x(e.started_at)?f:e.started_at,r.language),h=bt(e.cost),g=b(e),_=a?(0,Y.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),d(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":n(p.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:m}),title:n(p.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,Y.jsx)(B,{className:`size-4`})}):null,v=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-sm text-content`,children:m}),s&&(0,Y.jsx)(`span`,{className:`text-xs text-muted`,children:n(p.AUTOMATIONS$DETAIL$NO_CONVERSATION)})]}),g.summary?(0,Y.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted`,children:g.summary}):null]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&(0,Y.jsx)(`span`,{"data-testid":`run-cost`,title:n(p.AUTOMATIONS$DETAIL$RUN_COST),className:`text-xs tabular-nums text-muted`,children:h}),_,l&&(0,Y.jsx)(E,{status:e.status,code:e.phase_code,label:e.phase_label,updatedAt:e.phase_updated_at,wide:!0}),(0,Y.jsx)(S,{status:g.badgeStatus})]})]});return(0,Y.jsxs)(Y.Fragment,{children:[i&&e.conversation_id?(0,Y.jsx)(`a`,{href:yt(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":n(p.AUTOMATIONS$DETAIL$VIEW_CONVERSATION_FOR_RUN,{timestamp:m}),children:v}):(0,Y.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:v}),a&&(0,Y.jsx)(_t,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:u,onClose:()=>d(!1),run:e,automation:t})]})}var Z=20,St=100;function Ct({automation:e,highlightedRunId:t=null}){let{t:n}=c(`openhands`),r=d(),{trackAutomationActivityLogExported:i}=P(),[a,o]=(0,J.useState)(Z),s=(0,J.useRef)(null),[l,u]=(0,J.useState)(!1),{data:m,isLoading:g}=ue({id:e.id,limit:a,offset:0}),_=m?m.total>m.runs.length:!1,v=!g&&(m?.total??0)>0&&!l,y=async t=>{if(v){u(!0);try{await tt({automation:e,format:t,conversationBaseUrl:window.location.origin}),i({backendKind:r.backend.kind,format:t})}catch(e){f(W(e,n(p.AUTOMATIONS$DETAIL$EXPORT_ACTIVITY_LOG_ERROR)))}finally{u(!1)}}};return(0,J.useEffect)(()=>{if(!(!t||!m?.runs.length)){if(m.runs.findIndex(e=>e.id===t)<0){_&&a<St&&o(e=>e+Z);return}s.current?.scrollIntoView({behavior:`smooth`,block:`center`})}},[m?.runs,_,t,a]),(0,Y.jsxs)(`div`,{"data-testid":`automation-activity-log`,className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,Y.jsx)(`span`,{className:`size-4 text-muted`,children:(0,Y.jsx)(Ge,{className:`size-4`})}),(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:n(p.AUTOMATIONS$DETAIL$ACTIVITY_LOG)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-json`,disabled:!v,onClick:()=>void y(`json`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(p.AUTOMATIONS$DETAIL$EXPORT_JSON)}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-csv`,disabled:!v,onClick:()=>void y(`csv`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(p.AUTOMATIONS$DETAIL$EXPORT_CSV)})]})]}),g&&(0,Y.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,Y.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,Y.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!g&&m?.runs.length===0&&(0,Y.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:n(p.AUTOMATIONS$DETAIL$NO_RUNS)}),!g&&m&&m.runs.length>0&&(0,Y.jsxs)(`div`,{children:[m.runs.map((n,r)=>{let i=n.id===t;return(0,Y.jsx)(`div`,{ref:i?s:void 0,"data-testid":i?`automation-run-highlight-${n.id}`:void 0,className:h(r>0?`border-t border-[var(--oh-border)]`:``,i&&`bg-[var(--oh-focus)]/10`),children:(0,Y.jsx)(xt,{run:n,automation:e})},n.id)}),_&&(0,Y.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>o(e=>e+Z),className:`text-sm text-muted hover:text-foreground`,children:n(p.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function Q({className:e}){return(0,Y.jsx)(`div`,{className:h(`animate-pulse rounded bg-surface-raised`,e)})}function $(){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,Y.jsx)(Q,{className:`h-5 w-40`}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(Q,{className:`h-6 w-48`}),(0,Y.jsx)(Q,{className:`h-6 w-16 rounded-full`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Q,{className:`h-6 w-11 rounded-full`}),(0,Y.jsx)(Q,{className:`h-8 w-8`})]})]}),(0,Y.jsx)(Q,{className:`h-5 w-96`}),(0,Y.jsx)(Q,{className:`h-36 w-full rounded-2xl`}),(0,Y.jsx)(Q,{className:`h-72 w-full rounded-2xl`}),(0,Y.jsx)(Q,{className:`h-32 w-full rounded-2xl`}),(0,Y.jsx)(Q,{className:`h-40 w-full rounded-2xl`})]})}function wt(){let{t:e}=c(`openhands`);return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,Y.jsx)(xe,{className:`size-12 text-muted`}),(0,Y.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(p.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(p.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,Y.jsx)(`div`,{className:`mt-6`,children:(0,Y.jsx)(G,{})})]})}var Tt={id:``,name:``,prompt:null,trigger:{type:`cron`},enabled:!1,created_at:``,updated_at:``},Et=()=>{if(!M())throw new Response(null,{status:404,statusText:`Not Found`});return null},Dt=a(function(){let{t:e}=c(`openhands`),{automationId:t}=r(),[n]=i(),a=n.get(`run`),{navigate:o}=L(),[s,l]=(0,J.useState)(!1),[h,g]=(0,J.useState)(!1),{data:_,isLoading:v,refetch:y}=ae(),b=_?.status===`ok`,x=d(),S=(0,J.useRef)(x.backend.id).current!==x.backend.id,{data:C,isLoading:w,isError:T,error:E,refetch:D}=se({id:t??``,enabled:b&&!S}),{trackPrebuiltAutomationEnabled:O,trackAutomationExported:k}=P(),ee=ce(),te=le(),A=oe(),{canManage:ne}=_e(),j=ge(C??Tt),M=Oe(C?.user_id),F=T&&ie(E)===404;if(v)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)($,{})})});if(!b)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(be,{onRetry:y})})});if(w)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)($,{})})});if(F)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(wt,{})})});if(T||!C)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(Se,{onRetry:()=>D()})})});let I=()=>{let e=!C.enabled;ee.mutate({id:C.id,enabled:e}),e&&O({automationId:C.id,automationName:C.name})},R=()=>{te.mutate(C.id,{onSuccess:()=>{o?.(re())}})},z=()=>{A.mutate(C.id,{onSuccess:()=>{u(e(p.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{f(W(t,e(p.AUTOMATIONS$RUN_NOW_ERROR)))}})},B=()=>{let e=`${JSON.stringify(we(C),null,2)}\n`;m(new Blob([e],{type:`application/json`}),Te(C)),k({backendKind:x.backend.kind})},V=ne||j,H=null;x.backend.kind===`cloud`&&C.user_id&&(H=M.data?.email??(M.isError?C.user_id:null));let U=C.enabled?V:j;return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(G,{}),(0,Y.jsx)(je,{automation:C,onToggle:I,onEdit:()=>g(!0),onDelete:()=>l(!0),onExport:B,onDownloadTarball:()=>N.downloadTarball(C.id,C.name),onRunNow:z,isRunningNow:A.isPending,canManage:V,canToggle:U}),C.prompt&&(0,Y.jsx)(Pe,{prompt:C.prompt}),(0,Y.jsx)(Ve,{automation:C,runsAs:H}),C.plugins&&C.plugins.length>0&&(0,Y.jsx)(We,{plugins:C.plugins}),(0,Y.jsx)(Ke,{createdAt:C.created_at,lastRunAt:C.last_triggered_at}),(0,Y.jsx)(Ct,{automation:C,highlightedRunId:a}),(0,Y.jsx)(Ce,{automationName:C.name,isOpen:s,onConfirm:R,onCancel:()=>l(!1)}),h&&(0,Y.jsx)(he,{automation:C,isOpen:h,onClose:()=>g(!1)})]})})})});export{Et as clientLoader,Dt as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{F as r,P as i,R as a,U as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{l as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{$ as l,n as u}from"./active-backend-context-BnH4-L8h.js";import{K as d,t as f}from"./utils-BgLSZdyy.js";import{r as p}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js";import{t as m}from"./loading-spinner-BeLV0IXf.js";import{C as h,I as g,L as _,P as v,R as ee,S as y,_ as te,a as b,b as ne,c as x,d as re,f as S,g as ie,h as ae,i as oe,l as se,m as ce,n as C,o as le,p as w,r as ue,s as T,t as de,u as fe,v as pe,y as me}from"./use-tracking-j4uo9VEW.js";import{l as E}from"./settings-service.api-C1vZH9Vh.js";import{n as he}from"./use-settings-C2KKQKVC.js";import{t as ge}from"./modal-backdrop-BSzNhM4r.js";import{n as _e}from"./modal-classes-B0b9eiL8.js";import{f as ve,l as ye}from"./form-control-classes-Dbq-7YP_.js";import{t as D}from"./brand-button-CUMfjb99.js";import{t as O}from"./navigation-link-Bxo3-4vo.js";import{t as k}from"./settings-dropdown-input-DBvsZ7-Q.js";import{o as be,s as A,t as j}from"./conversation-store-DC-JlJuq.js";import{t as xe}from"./modal-close-button-DfqfB2Nj.js";import{t as M}from"./settings-input-dVuzapBA.js";import{t as Se}from"./use-llm-profiles-SWsuFmFu.js";import{n as N}from"./use-create-conversation-i_PdFdIs.js";import{t as Ce}from"./api-error-message-BXo0lCI5.js";import{f as P,n as F,o as I,s as L}from"./mcp-marketplace-utils-C7PYr293.js";import{t as R}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{i as we,n as Te,r as Ee}from"./use-manifest-capabilities-CdqYfUAC.js";import{t as z}from"./git-repo-dropdown-uxlFw2gn.js";import"./git-repo-dropdown-BoDDWXfX.js";var B=e(t(),1);function De(e){let t=e.requires.integrations,{data:n,isLoading:r}=he(),i=(0,B.useMemo)(()=>P(E(n?.agent_settings?.mcp_config)),[n?.agent_settings?.mcp_config]),a=(0,B.useMemo)(()=>{let e=L(R);return Object.entries(t).map(([t,n])=>({id:t,requirement:n,entry:I(t,e)??null})).filter(({entry:e})=>!e||!F(e,i))},[t,i]),o=a.filter(({requirement:e})=>e.required!==!1);return{blockingIntegrations:o,warningIntegrations:a.filter(({requirement:e})=>e.required===!1),isBlocked:o.length>0,isLoading:r}}var Oe={fieldErrors:{},formErrors:[]};function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ke(e,t){let n=e[0]===`body`?e.slice(1):e,r=[],i=t;return n.forEach(e=>{if(typeof e==`number`){Array.isArray(i)&&r.length>0&&(r[r.length-1]+=`[${e}]`,i=i[e]);return}V(i)&&e in i&&(r.push(e),i=i[e])}),r.join(`.`)}function Ae(e,t){if(!V(e))return[];if(Array.isArray(e.errors))return e.errors.flatMap(e=>!V(e)||typeof e.message!=`string`?[]:[{path:typeof e.field==`string`?e.field:``,message:e.message}]);let{detail:n}=e;return typeof n==`string`?[{path:``,message:n}]:Array.isArray(n)?n.flatMap(e=>!V(e)||typeof e.msg!=`string`?[]:[{path:ke(Array.isArray(e.loc)?e.loc:[],t),message:e.msg}]):[]}function je(e,t){return t[e]??t[e.replace(/\[\d+\]/g,`[0]`)]}function Me(e,t){if(e.length===0)return Oe;let n={},r=[];return e.forEach(({path:e,message:i})=>{let a=e?je(e,t):void 0;if(!a?.length){r.push(i);return}a.forEach(e=>{e in n||(n[e]=i)})}),{fieldErrors:n,formErrors:r}}var Ne={fieldErrors:{},formErrors:[]},Pe=[404,501];function H(e){return Pe.some(t=>l(e,t)||s.isAxiosError(e)&&e.response?.status===t)}function Fe(e){let t=(0,B.useRef)(0);return(0,B.useCallback)(async(n,r,i)=>{try{let a=b(e,n,r,i);if(!a)return null;t.current+=1;let o=t.current,s=await C.validateDraft(a);return o===t.current?s?.valid?Ne:Me(Ae(s,a.draft),le(e,r,i)):null}catch(e){return H(e)||console.warn(`Automation setup preflight failed:`,e),null}},[e])}var U=new TextEncoder,W=512,G=100,K=148;function q(e,t,n){let r=new Uint8Array(W),i=(e,t)=>{for(let n=0;n<t.length;n+=1)r[e+n]=t.charCodeAt(n)&127},a=(e,t,n)=>i(e,n.toString(8).padStart(t-1,`0`));return r.set(t,0),a(100,8,e.mode??420),a(108,8,0),a(116,8,0),a(124,12,n),a(136,12,0),r[156]=48,i(257,`ustar`),i(263,`00`),r.fill(32,K,156),i(K,r.reduce((e,t)=>e+t,0).toString(8).padStart(6,`0`)),r[154]=0,r[155]=32,r}function Ie(e){let t=[];for(let n of e){let e=U.encode(n.name);if(e.length>G)throw Error(`tar: name too long for a ustar header: ${n.name}`);let r=U.encode(n.content);t.push(q(n,e,r.length));let i=new Uint8Array(Math.ceil(r.length/W)*W);i.set(r),t.push(i)}t.push(new Uint8Array(W*2));let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(new ArrayBuffer(n)),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}async function Le(e){let t=Ie(e),n=new ReadableStream({start(e){e.enqueue(t),e.close()}}),r=new Response(n.pipeThrough(new CompressionStream(`gzip`)));return new Uint8Array(await r.arrayBuffer())}function Re(e){let t=p?.(e);if(!t||Object.keys(t).length===0)throw Error(`The published extensions package ships no bundle files for '${e}'.`);return t}function ze(e){let t=(e.entrypoint.trim().split(` `)[0]??``).replace(/^\.\//,``);return new Set([e.setupScript,t in e.files?t:void 0].filter(e=>e!==void 0))}async function Be(e,t){let n=e.setup.bundle;if(!n)throw Error(`'${e.id}' declares no bundle.`);let r=Re(e.id),i=Object.keys(n.files).filter(e=>typeof r[e]!=`string`);if(i.length>0)throw Error(`The published extensions package is missing bundle files for '${e.id}': ${i.join(`, `)}.`);let a=oe(e,t)?.template,o=ze(n),s=Object.keys(n.files).sort().map(e=>({name:e,content:r[e],mode:o.has(e)?493:420}));return s.push({name:_,content:`${JSON.stringify(a?.config??{},null,2)}\n`}),Le(s)}function Ve(e){return typeof File<`u`&&e instanceof File}function He(e,t,n){let r=t.tarball,i=Ve(r)?{name:r.name,size:r.size,lastModified:r.lastModified}:r;return`${e.id}
|
|
2
|
-
${n??``}
|
|
3
|
-
${JSON.stringify({...t,tarball:i})}`}async function Ue(e){let t=e.tarball;if(!Ve(t))throw Error(`Choose a tarball before creating this automation.`);return new Uint8Array(await t.arrayBuffer())}function We(){let e=N(),t=j(e=>e.setMessageToSend),n=(0,B.useRef)(null),r=(0,B.useCallback)(async n=>{let r=await e.mutateAsync({});return r.conversation_id.startsWith(`task-`)&&r.task_id?A(r.task_id,n):be(r.conversation_id,{draftMessage:n}),window.setTimeout(()=>t(n),0),{response:{...r}}},[e,t]);return(0,B.useCallback)(async(e,t,i,a,o)=>{if(!i)return r(ue(e,t));if(T(e)||x(e,o)){let r=He(e,t,o),i=n.current?.path??null;if(n.current?.key!==r||i===null){let a=T(e)?await Be(e,t):await Ue(t);i=await C.uploadAutomationTarball(e.id,a),n.current={key:r,path:i}}let s=oe(e,t,i,a,o);if(!s)throw Error(`'${e.id}' produced no create request.`);return{response:await C.createAutomationDraft(s,e,o)}}return{response:await C.createAutomationDraft(i,e,o)}},[r])}var J=n();function Y({name:e,field:t,values:n,canListRepositories:r,placeholder:i,disabled:a,onChange:o,onBlur:s}){let{t:l}=c(`openhands`),[u,f]=(0,B.useState)(``),p=e=>{let t=e.trim();!t||n.includes(t)||(o([...n,t]),f(``),s())},m=e=>{o(n.filter(t=>t!==e)),s()};return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,"data-testid":`setup-list-${e}`,children:[n.length>0&&(0,J.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:n.map(t=>(0,J.jsxs)(`li`,{className:`flex items-center justify-between gap-2 rounded-md border border-[var(--oh-border)] px-3 py-1.5`,children:[(0,J.jsx)(`span`,{className:`truncate text-sm`,children:t}),(0,J.jsx)(D,{testId:`setup-list-${e}-remove-${t}`,type:`button`,variant:`ghost-danger`,isDisabled:a,ariaLabel:l(d.COMMON$REMOVE),onClick:()=>m(t),children:l(d.COMMON$REMOVE)})]},t))}),r?(0,J.jsx)(z,{provider:t.provider??`github`,value:null,repositoryName:null,placeholder:i,disabled:a,onChange:e=>{e?.full_name&&p(e.full_name)}}):(0,J.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,J.jsx)(`div`,{className:`grow`,children:(0,J.jsx)(M,{testId:`setup-field-${e}`,name:e,label:``,ariaLabel:t.label,type:`text`,value:u,placeholder:i,isDisabled:a,onChange:f,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p(u))},onBlur:()=>p(u)})}),(0,J.jsx)(D,{testId:`setup-list-${e}-add`,type:`button`,variant:`secondary`,isDisabled:a||u.trim()===``,onClick:()=>p(u),children:l(d.BUTTON$ADD)})]})]})}function Ge({name:e,field:t,value:n,error:r,options:i,isOptionsLoading:a=!1,repository:o,disabled:s,onChange:l,onRepositoryChange:p,onBlur:m}){let{t:h}=c(`openhands`),{backend:g}=u(),_=`setup-field-${e}`,v=(0,J.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:t.help}),ee=g.kind===`cloud`,y=t.placeholder??h(d.SETUP$REPOSITORY_PLACEHOLDER);if(t.type===`repo-picker`&&t.multiple)return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(Z,{field:t}),(0,J.jsx)(Y,{name:e,field:t,values:w(n),canListRepositories:ee,placeholder:y,disabled:s,onChange:l,onBlur:m}),(0,J.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`repo-picker`&&ee)return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(Z,{field:t}),(0,J.jsx)(z,{provider:t.provider??`github`,value:o?.id??null,repositoryName:o?.full_name??S(n)??null,placeholder:t.placeholder,disabled:s,onChange:e=>{p(e??null),l(e?.full_name??``),m()}}),(0,J.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`select`||t.type===`llm-profile`||[`timezone`,`event-source`,`event-type`].includes(t.type)&&i.length>0){let o=i.length>0,c=t.type===`llm-profile`&&!a&&!o;return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(k,{testId:_,name:e,label:(0,J.jsx)(X,{field:t}),items:i.map(e=>({key:e.value,label:e.label})),selectedKey:S(n)||void 0,placeholder:c?h(d.MODEL$NO_SAVED_PROFILES):t.placeholder,isDisabled:s||c,isLoading:a,required:t.required,onSelectionChange:e=>{l(e===null?``:String(e)),m()}}),(0,J.jsx)(Q,{testId:_,error:r}),v]})}if(t.type===`plugin-sources`)return(0,J.jsxs)(`label`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(X,{field:t}),(0,J.jsx)(`textarea`,{"data-testid":_,name:e,rows:4,value:S(n),placeholder:t.placeholder,disabled:s,"aria-invalid":!!r,onChange:e=>l(e.target.value),onBlur:m,className:f(ye,r&&`border-red-500`)}),(0,J.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`tarball-upload`)return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(Z,{field:t}),(0,J.jsx)(`input`,{"data-testid":_,name:e,type:`file`,accept:`.tar,.tar.gz,.tgz,application/gzip,application/x-tar`,disabled:s,"aria-invalid":!!r,onChange:e=>{l(e.target.files?.[0]??``),m()},className:f(ve,`file:mr-3 file:rounded-md file:border-0 file:bg-neutral-700 file:px-3 file:py-1.5 file:text-sm file:text-white`,r&&`border-red-500`)}),S(n)&&(0,J.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:S(n)}),(0,J.jsx)(Q,{testId:_,error:r}),v]});if(t.type===`textarea`)return(0,J.jsxs)(`label`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(X,{field:t}),(0,J.jsx)(`textarea`,{"data-testid":_,name:e,rows:4,value:S(n),placeholder:t.placeholder,disabled:s,"aria-invalid":!!r,onChange:e=>l(e.target.value),onBlur:m,className:f(ye,r&&`border-red-500`)}),(0,J.jsx)(Q,{testId:_,error:r}),v]});let te=t.type===`repo-picker`?y:t.placeholder;return(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(M,{testId:_,name:e,type:t.type===`number`?`number`:`text`,label:t.label,value:S(n),placeholder:te,isDisabled:s,min:t.constraints?.min,max:t.constraints?.max,showRequiredTag:t.required,error:r,onChange:l,onBlur:m}),v]})}function X({field:e}){return(0,J.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[e.label,e.required&&(0,J.jsx)(`span`,{className:`text-sm leading-none text-red-400`,"aria-hidden":!0,children:`*`})]})}function Z({field:e}){return(0,J.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,J.jsx)(X,{field:e})})}function Q({testId:e,error:t}){return t?(0,J.jsx)(`p`,{role:`alert`,"data-testid":`${e}-error`,className:`-mt-1 text-xs text-red-400`,children:t}):null}var Ke=`/mcp`;function qe({prerequisites:e}){let{t}=c(`openhands`),{blockingIntegrations:n,warningIntegrations:r}=e;return(0,J.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-prerequisites`,children:[[...n,...r].map(({id:e,requirement:t,entry:n})=>(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm`,children:n?.name??e}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:t.message})]},e)),(0,J.jsx)(O,{to:Ke,className:`text-sm underline`,children:t(d.SETUP$MANAGE_INTEGRATIONS)})]})}function Je({setup:e,values:t,selectedTrigger:n,selectedAction:r}){let{t:i}=c(`openhands`);return(0,J.jsx)(`div`,{className:`flex flex-col gap-4`,"data-testid":`setup-review`,children:(0,J.jsxs)(`dl`,{className:`flex flex-col gap-3`,children:[r&&e.actions?.[r]&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-[var(--oh-muted)]`,children:i(d.SETUP$ACTION_LABEL)}),(0,J.jsx)(`dd`,{className:`text-sm break-words`,children:e.actions[r]?.label})]}),Object.entries(re(e,n,r)).map(([e,n])=>(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`dt`,{className:`text-xs text-[var(--oh-muted)]`,children:n.label}),(0,J.jsx)(`dd`,{className:`text-sm break-words`,children:w(t[e]).join(`, `)||i(d.SETUP$EMPTY_VALUE)})]},e))]})})}var Ye=400,$={fieldErrors:{},formErrors:[]};function Xe(e){return e.formErrors.length>0||Object.keys(e.fieldErrors).length>0}function Ze(e){return typeof e.conversation_id==`string`?`/conversations/${e.conversation_id}`:typeof e.id==`string`?y(e.id):null}function Qe({entry:e,onClose:t}){let{t:n}=c(`openhands`),r=a(),i=Te(e),o=De(e),s=Fe(e),l=We(),{trackAutomationSetupOpened:u,trackAutomationSetupValidated:p,trackAutomationSetupCreated:h,trackAutomationSetupFailed:g}=de(),[_,v]=(0,B.useState)(`prerequisites`),y=(0,B.useMemo)(()=>me(e.setup),[e]),b=(0,B.useMemo)(()=>y.length===0?[]:i.capabilities?we(e,i.capabilities):y,[y,i.capabilities,e]),x=(0,B.useMemo)(()=>fe(e.setup),[e]),[S,C]=(0,B.useState)(()=>te(e.setup)),[w,ue]=(0,B.useState)(()=>ie(e.setup)),[T,E]=(0,B.useState)(()=>ae(e.setup,te(e.setup),ie(e.setup))),[he,ve]=(0,B.useState)({}),[ye,O]=(0,B.useState)({}),[be,A]=(0,B.useState)($),[j,M]=(0,B.useState)(!1),N=(0,B.useRef)(T),P=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{P.current&&window.clearTimeout(P.current)},[]);let F=(0,B.useMemo)(()=>x.length===0?[]:(i.capabilities?Ee(e,i.capabilities):x).filter(t=>se(e,t).length===0),[x,i.capabilities,e]),I=(0,B.useMemo)(()=>re(e.setup,S,w),[e,S,w]),L=(0,B.useMemo)(()=>Object.values(I).some(e=>e.type===`llm-profile`),[I]),{data:R,isLoading:z}=Se({enabled:L}),Oe=(0,B.useMemo)(()=>(R?.profiles??[]).map(e=>({value:e.name,label:e.name})),[R?.profiles]),V=(0,B.useMemo)(()=>{let t=pe(e.setup,i.capabilities,S,w);return!L||z?t:Object.entries(I).reduce((e,[t,n])=>n.type===`llm-profile`?{...e,[t]:{options:Oe}}:e,t)},[e.setup,i.capabilities,S,w,L,z,I,Oe]),ke=(0,B.useMemo)(()=>oe(e,T,void 0,S,w),[e,T,S,w]),je=(0,B.useMemo)(()=>le(e,S,w),[e,S,w]),Ne=(0,B.useRef)(!1);(0,B.useEffect)(()=>{Ne.current||(Ne.current=!0,u({automationId:e.id}))},[e.id,u]);let Pe=(0,B.useMemo)(()=>se(e,w),[e,w]),H=i.supported===!1||Pe.length>0,U=[...i.unmet,...Pe],W=o.blockingIntegrations.length>0||o.warningIntegrations.length>0,G=_===`prerequisites`&&!W?`form`:_,K=t=>{C(t),N.current={...ae(e.setup,t,w),...N.current},E(N.current),O({}),A($)},q=t=>{ue(t),N.current={...ae(e.setup,S,t),...N.current},E(N.current),O({}),A($)};(0,B.useEffect)(()=>{y.length===0||i.isLoading||S&&b.includes(S)||b.length>0&&K(b[0])},[b,y.length,i.isLoading,S]),(0,B.useEffect)(()=>{x.length===0||i.isLoading||w&&F.includes(w)||F.length>0&&q(F[0])},[F,x.length,i.isLoading,w]);let Ie=(e,t)=>{N.current={...N.current,[e]:t},E(N.current),O(({[e]:t,...n})=>n),A(t=>{if(!(e in t.fieldErrors))return t;let{[e]:n,...r}=t.fieldErrors;return{...t,fieldErrors:r}})},Le=()=>{P.current&&window.clearTimeout(P.current),P.current=window.setTimeout(()=>{s(N.current,S,w).then(e=>{e&&A(e)})},Ye)},Re=async()=>{if(G===`prerequisites`){v(`form`);return}let t=ne(e.setup,T,V,S,w);if(Object.keys(t).length>0){O(t);return}O({});let n=await s(T,S,w);if(n&&Xe(n)){A(n);return}A($),p({automationId:e.id}),v(`review`)},ze=async(i,a)=>{M(!0);try{let{response:n}=await l(e,T,i,S,w);h({automationId:e.id,setupMode:a});let o=Ze(n);o?r(o,{replace:!0}):t()}catch(t){g({automationId:e.id,setupMode:a});let r=Me(Ae(Ce(t),i),je);A(Xe(r)?r:{fieldErrors:{},formErrors:[n(d.SETUP$SUBMIT_FAILED)]}),v(`form`)}finally{M(!1)}},Be=()=>ze(ke,e.setup.mode),Ve=()=>ze(null,`assisted`),He=e.setup.mode===`direct`&&(ee(e)!==null||e.setup.message!==void 0),Ue=e=>{let t=ye[e];return t?$e(t,n):be.fieldErrors[e]},Y=i.isLoading||o.isLoading,X=L&&z,Z=H?n(d.SETUP$UNAVAILABLE_TITLE):G===`prerequisites`?n(d.SETUP$PREREQUISITES_TITLE):G===`review`?n(d.SETUP$REVIEW_TITLE):e.name;return(0,J.jsx)(ge,{onClose:t,"aria-label":e.name,children:(0,J.jsxs)(`div`,{"data-testid":`setup-dialog`,className:`relative flex max-h-[85vh] w-[92vw] max-w-lg flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,J.jsx)(xe,{onClose:t,testId:`setup-dialog-close`,disabled:j}),(0,J.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,J.jsx)(`h2`,{className:f(`pr-6`,_e),children:Z})}),(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6`,children:[Y&&(0,J.jsx)(`div`,{className:`flex justify-center py-6`,children:(0,J.jsx)(m,{size:`small`})}),!Y&&H&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(d.SETUP$UNSUPPORTED_MESSAGE)}),U.length>0&&(0,J.jsx)(`p`,{"data-testid":`setup-unmet-requirements`,className:`text-sm text-[var(--oh-muted)]`,children:U.join(`, `)})]}),!Y&&!H&&G===`prerequisites`&&(0,J.jsx)(qe,{prerequisites:o}),!Y&&!H&&G===`form`&&(0,J.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.description}),e.setup.form.note&&(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e.setup.form.note}),x.length>1&&F.length>1&&(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(k,{testId:`setup-action-kind`,name:`actionKind`,label:n(d.SETUP$ACTION_LABEL),items:F.map(t=>({key:t,label:e.setup.actions?.[t]?.label??t})),selectedKey:w??void 0,isDisabled:j,required:!0,onSelectionChange:e=>{e!==null&&q(String(e))}}),w&&e.setup.actions?.[w]&&(0,J.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:e.setup.actions[w]?.help})]}),b.length>1&&(0,J.jsxs)(`div`,{className:`flex w-full flex-col gap-2.5`,children:[(0,J.jsx)(k,{testId:`setup-trigger-kind`,name:`triggerKind`,label:n(d.SETUP$TRIGGER_LABEL),items:b.map(e=>({key:e,label:e===`cron`?`Scheduled`:`Event`})),selectedKey:S??void 0,isDisabled:j,required:!0,onSelectionChange:e=>{e!==null&&K(String(e))}}),(0,J.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(d.SETUP$TRIGGER_HELP)})]}),Object.entries(I).map(([e,t])=>(0,J.jsx)(Ge,{name:e,field:t,value:T[e]??``,error:Ue(e),options:ce(e,t,V),repository:he[e]??null,disabled:j,isOptionsLoading:t.type===`llm-profile`&&X,onChange:t=>Ie(e,t),onRepositoryChange:t=>ve(n=>({...n,[e]:t})),onBlur:Le},e))]}),!Y&&!H&&G===`review`&&(0,J.jsx)(Je,{setup:e.setup,values:T,selectedTrigger:S,selectedAction:w}),be.formErrors.map(e=>(0,J.jsx)(`p`,{role:`alert`,"data-testid":`setup-form-error`,className:`pt-4 text-sm text-red-400`,children:e},e))]}),(0,J.jsxs)(`footer`,{className:`flex flex-shrink-0 justify-end gap-2 px-6 pb-6 pt-4`,children:[G===`review`&&(0,J.jsx)(D,{testId:`setup-back-button`,type:`button`,variant:`secondary`,isDisabled:j,onClick:()=>v(`form`),children:n(d.BUTTON$BACK)}),H?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{type:`button`,variant:`secondary`,isDisabled:j,onClick:t,children:n(d.BUTTON$CLOSE)}),He&&(0,J.jsx)(D,{testId:`setup-fallback-conversation`,type:`button`,variant:`primary`,isDisabled:j,onClick:Ve,children:n(d.SETUP$FALLBACK_CONVERSATION)})]}):(0,J.jsx)(D,{testId:`setup-continue-button`,type:`button`,variant:`primary`,isDisabled:Y||X||j||G===`prerequisites`&&o.isBlocked,onClick:G===`review`?Be:Re,children:n(G===`review`?d.SETUP$CONFIRM:d.BUTTON$CONTINUE)})]})]})})}function $e(e,t){switch(e.code){case`required`:return t(d.SETUP$VALIDATION_REQUIRED);case`minLength`:return t(d.SETUP$VALIDATION_MIN_LENGTH,{length:e.length});case`maxLength`:return t(d.SETUP$VALIDATION_MAX_LENGTH,{length:e.length});case`min`:return`Must be at least ${e.value}.`;case`max`:return`Must be at most ${e.value}.`;case`invalidOption`:return t(d.SETUP$VALIDATION_INVALID_OPTION);case`unsafeExpressionLiteral`:return t(d.SETUP$VALIDATION_UNSAFE_VALUE);default:return e}}var et=({params:e})=>{let t=g.findById(e.automationId??``);if(!t||!v())throw new Response(null,{status:404,statusText:`Not Found`});return{automationId:t.id}},tt=o(function(){let{automationId:e}=i(),t=r(),n=a(),o=g.findById(e);return o?(0,J.jsx)(Qe,{entry:o,onClose:()=>{t.key==="default"?n(h(),{replace:!0}):n(-1)}}):null});export{et as clientLoader,tt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{i as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as o}from"./useQueries-pUohFMSP.js";import{t as s}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{ct as l,lt as u,n as d,st as f}from"./active-backend-context-BnH4-L8h.js";import{K as p,a as m,t as h}from"./utils-BgLSZdyy.js";import{t as g}from"./check-Bo8s5Ylg.js";import{t as _}from"./chevron-down-Cr6Fn_wS.js";import{m as v,t as y}from"./kebab-menu-item-content-SCJBwZnp.js";import{i as b,n as ee,r as te,t as ne}from"./empty-state-FK_s1B60.js";import{P as x,_ as re,c as ie,g as ae,h as oe,l as se,m as ce}from"./home-automation-run-tooltip-B1N2uO9p.js";import{t as S}from"./list-filter-B8PQk3RA.js";import{t as C}from"./plus-C2e21TFC.js";import{t as le}from"./refresh-cw-BtdC3T8P.js";import{n as w,t as T}from"./context-menu-list-item-Cm7-7Y-7.js";import{A as ue,D as de,G as fe,P as E,S as pe,W as me,n as D,t as he,x as O}from"./use-tracking-j4uo9VEW.js";import{t as k}from"./modal-backdrop-BSzNhM4r.js";import{n as ge}from"./modal-classes-B0b9eiL8.js";import{t as A}from"./brand-button-CUMfjb99.js";import{n as _e}from"./navigation-context-CQZwH_tC.js";import{t as j,u as M}from"./dropdown-classes-BGvOvW2_.js";import{t as N}from"./modal-close-button-DfqfB2Nj.js";import{t as P}from"./use-click-outside-element-W6Os4Nlb.js";import{t as F}from"./enum-filter-dropdown-UNaom12H.js";import{t as ve}from"./use-automation-health-U99vvHxx.js";import{t as I}from"./automation-C_eCrGyP.js";import{a as ye,c as L,i as be,o as xe,r as Se,t as Ce}from"./use-automations-Bq5hVuv0.js";import{a as R}from"./extension-module-card-classes-DpeaYhYo.js";import{n as we}from"./api-error-message-BXo0lCI5.js";import{t as Te}from"./edit-automation-modal-D_JWSmxT.js";import{t as Ee}from"./use-automation-permissions-Buus0R6h.js";import{n as De,t as Oe}from"./error-state-Cf8LRuuY.js";import{n as ke,r as Ae,t as je}from"./manifest-subpage-layout-CVZgVKoY.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./automation-export-BJsfi7n2.js";var z=a(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Ie=a(`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`}]]),Le=a(`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`}]]),B=e(t(),1),V=e(n(),1),H=r();function U({icon:e,label:t,isSelected:n}){return(0,H.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,H.jsx)(`span`,{className:M,"aria-hidden":!0,children:(0,H.jsx)(e,{})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,H.jsx)(g,{className:`size-4 shrink-0`,"aria-hidden":!0}):null]})}var W=[{value:`grid`,icon:Ie,labelKey:p.AUTOMATIONS$VIEW_GRID,testId:`automations-view-toggle-grid`},{value:`list`,icon:Le,labelKey:p.AUTOMATIONS$VIEW_LIST,testId:`automations-view-toggle-list`}];function Re({view:e,onChange:t,disabled:n=!1}){let{t:r}=c(`openhands`),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(),l=(0,B.useRef)(null),u=(0,B.useRef)(null),d=(W.find(t=>t.value===e)??W[0]).icon;(0,B.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&s({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,B.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.current?.contains(t)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let f=i&&o?(0,H.jsx)(w,{ref:u,theme:`popover`,className:`min-w-[10rem]`,children:W.map(n=>(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:n.testId,onClick:()=>{t(n.value),a(!1)},className:`group`,children:(0,H.jsx)(U,{icon:n.icon,label:r(n.labelKey),isSelected:e===n.value})})},n.value))}):null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{ref:l,type:`button`,"data-testid":`automations-view-toggle`,"aria-label":r(p.AUTOMATIONS$VIEW_MODE),"aria-haspopup":`menu`,"aria-expanded":i,"aria-disabled":n,disabled:n,onClick:()=>{n||a(e=>!e)},className:h(`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,H.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),i&&o&&typeof document<`u`?V.createPortal((0,H.jsx)(`div`,{style:o,children:f}),document.body):null]})}function ze({onAdd:e,onImport:t,isAddDisabled:n=!1}){let{t:r}=c(`openhands`),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(),l=(0,B.useRef)(null),u=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(!i||!l.current)return;let e=()=>{let e=l.current?.getBoundingClientRect();e&&s({position:`fixed`,zIndex:9999,top:e.bottom+2,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,B.useEffect)(()=>{if(!i)return;let e=e=>{let t=e.target;l.current?.contains(t)||u.current?.contains(t)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]);let d=e=>{e(),a(!1)},f=i&&o?(0,H.jsxs)(w,{ref:u,testId:`automations-add-automation-menu`,theme:`popover`,position:`none`,alignment:`none`,spacing:`none`,className:`min-w-[10rem]`,children:[(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:`automations-add-automation-create`,isDisabled:n,className:`group`,onClick:()=>{n||d(e)},children:(0,H.jsx)(y,{icon:(0,H.jsx)(C,{className:`size-4`,"aria-hidden":!0}),label:r(p.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})})}),(0,H.jsx)(`li`,{children:(0,H.jsx)(T,{testId:`automations-import-automation`,className:`group`,onClick:()=>d(t),children:(0,H.jsx)(y,{icon:(0,H.jsx)(z,{className:`size-4`,"aria-hidden":!0}),label:r(p.AUTOMATIONS$IMPORT)})})})]}):null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(A,{ref:l,type:`button`,variant:`secondary`,testId:`automations-add-automation`,className:`whitespace-nowrap`,"aria-haspopup":`menu`,"aria-expanded":i,onClick:()=>a(e=>!e),children:[r(p.AUTOMATIONS$ADD_AUTOMATION),(0,H.jsx)(_,{className:`size-4 shrink-0`,"aria-hidden":!0})]}),i&&o&&typeof document<`u`?V.createPortal((0,H.jsx)(`div`,{style:o,children:f}),document.body):null]})}function G({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`dt`,{className:`text-xs font-medium uppercase tracking-wide text-muted`,children:e}),(0,H.jsx)(`dd`,{className:`whitespace-pre-wrap break-words text-sm text-content`,children:t})]})}function K(e){let t=e.dataTransfer?.files;return t&&t.length>0?t[0]:null}function Be({onFile:e}){let{t}=c(`openhands`),n=(0,B.useRef)(null),[r,i]=(0,B.useState)(!1),a=()=>n.current?.click();return(0,H.jsxs)(`div`,{className:`flex flex-col gap-5 px-6 pb-6`,children:[(0,H.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[t(p.AUTOMATIONS$IMPORT_EXPLAIN),` `,(0,H.jsx)(`a`,{href:O,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`import-automation-format-docs`,className:`text-white no-underline transition-colors hover:text-white`,children:t(p.AUTOMATIONS$IMPORT_FORMAT_DOCS)})]}),(0,H.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(p.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,H.jsx)(`input`,{ref:n,type:`file`,accept:`application/json,.json`,className:`hidden`,"data-testid":`automations-import-file`,onChange:()=>{let t=n.current,r=t?.files?.[0];t&&(t.value=``),r&&e(r)}}),(0,H.jsxs)(`div`,{"data-testid":`import-automation-dropzone`,"data-active":r?`true`:`false`,onClick:a,onDragEnter:e=>{e.preventDefault(),i(!0)},onDragOver:e=>{e.preventDefault(),i(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)},onDrop:t=>{t.preventDefault(),i(!1);let n=K(t);n&&e(n)},className:h(`flex cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border border-dashed px-6 py-10 text-center`,r?`border-[var(--oh-focus)] bg-[var(--oh-interactive-hover)]`:`border-[var(--oh-border)] bg-[var(--oh-surface)]`),children:[(0,H.jsx)(z,{className:`size-8 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,H.jsx)(`p`,{className:`text-sm font-medium text-content`,children:t(p.AUTOMATIONS$IMPORT_DROPZONE)}),(0,H.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:t(p.AUTOMATIONS$IMPORT_OR)}),(0,H.jsx)(A,{testId:`import-automation-choose-file`,type:`button`,variant:`secondary`,onClick:e=>{e?.stopPropagation(),a()},children:t(p.AUTOMATIONS$IMPORT_CHOOSE_FILE)})]})]})}function Ve({isOpen:e,spec:t,isImporting:n,onClose:r,onImport:i,onFile:a}){let{t:o}=c(`openhands`);if(!e)return null;let s=t?t.trigger.type===`event`?[t.trigger.source,v(t.trigger.on)].filter(Boolean).join(`: `):[t.trigger.schedule_human??t.trigger.schedule,t.timezone??t.trigger.timezone].filter(Boolean).join(` · `):``;return(0,H.jsx)(k,{onClose:n?void 0:r,closeOnEscape:!n,closeOnBackdropClick:!n,"aria-label":o(p.AUTOMATIONS$IMPORT),children:(0,H.jsxs)(`div`,{"data-testid":`import-automation-modal`,"data-view":t?`preview`:`picker`,className:`relative flex max-h-[85vh] w-[min(36rem,calc(100vw-2rem))] flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,H.jsx)(N,{onClose:r,testId:`import-automation-modal-close`,disabled:n}),(0,H.jsxs)(`header`,{className:`px-6 pb-4 pt-6`,children:[(0,H.jsx)(`h2`,{className:h(`pr-6`,ge),children:o(p.AUTOMATIONS$IMPORT)}),t?(0,H.jsx)(`p`,{className:`mt-2 text-sm text-tertiary-light`,children:o(p.AUTOMATIONS$IMPORT_PREVIEW_DESCRIPTION)}):null]}),t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`dl`,{className:`mx-6 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] px-4 py-4`,children:[(0,H.jsx)(G,{label:o(p.AUTOMATIONS$NAME),value:t.name}),(0,H.jsx)(G,{label:o(p.AUTOMATIONS$DETAIL$TRIGGER),value:s}),(0,H.jsx)(G,{label:o(p.AUTOMATIONS$PROMPT),value:t.prompt??``}),t.plugins&&t.plugins.length>0?(0,H.jsx)(G,{label:o(p.AUTOMATIONS$DETAIL$PLUGINS),value:t.plugins.join(`, `)}):null]}),(0,H.jsxs)(`footer`,{className:`px-6 py-5`,children:[(0,H.jsx)(`p`,{className:`mb-4 text-sm text-tertiary-light`,children:o(p.AUTOMATIONS$IMPORT_DISABLED_NOTICE)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,H.jsx)(A,{testId:`import-automation-cancel`,type:`button`,variant:`secondary`,onClick:r,isDisabled:n,children:o(p.AUTOMATIONS$CANCEL)}),(0,H.jsx)(A,{testId:`import-automation-confirm`,type:`button`,variant:`primary`,onClick:i,isDisabled:n,"aria-busy":n,children:o(n?p.AUTOMATIONS$IMPORTING:p.AUTOMATIONS$IMPORT)})]})]})]}):(0,H.jsx)(Be,{onFile:a})]})})}var q=20,He=15e3,Ue=e=>e.status===I.PENDING||e.status===I.RUNNING;function We(e,t={}){let{enabled:n=!0}=t,r=d();return o({queries:e.map(e=>({queryKey:[...L,e.id,{limit:q,offset:0},r.backend.id,r.orgId],queryFn:({signal:t})=>x.run(()=>D.getAutomationRuns(e.id,q,0),t),staleTime:60*1e3,retry:!1,refetchOnWindowFocus:!1,meta:{disableToast:!0},enabled:n&&!!e.id,refetchInterval:e=>{let t=e.state.data?.runs?.[0];return t&&Ue(t)?He:!1}})),combine:t=>{let n=new Map;return e.forEach((e,r)=>{let i=t[r];n.set(e.id,{summary:i.data?re(i.data):null,isLoading:i.isLoading,isError:i.isError})}),n}})}function J({label:e,children:t}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:e}),t]})}function Y(e){return Object.fromEntries(e.map(e=>[e.value,e.label]))}function Ge({spec:e,status:t,trigger:n,sort:r,onStatusChange:i,onTriggerChange:a,onSortChange:o}){let{t:s}=c(`openhands`),[l,u]=(0,B.useState)(!1),d=P(()=>u(!1)),f=e.filters.find(e=>e.id===`status`),m=e.filters.find(e=>e.id===`trigger`),g=[f&&t!==f.options[0]?.value,m&&n!==m.options[0]?.value,r!==e.sort.default].filter(Boolean).length,v=s(p.AUTOMATIONS$FILTERS),y=f?.options[0]?.value,b=m?.options[0]?.value;return(0,H.jsxs)(`div`,{ref:d,className:`relative shrink-0 w-auto`,"data-testid":`automations-filters`,children:[(0,H.jsxs)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,"aria-haspopup":`true`,"aria-expanded":l,"aria-label":v,onClick:()=>u(e=>!e),className:h(j,`h-9 py-0`,g>0&&`border-white/60 bg-white/10`),children:[(0,H.jsx)(S,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`whitespace-nowrap`,children:v}),g>0?(0,H.jsx)(`span`,{className:`rounded-full bg-white px-1.5 text-[11px] font-medium text-black`,children:g}):null,(0,H.jsx)(_,{className:h(`h-4 w-4 shrink-0 text-tertiary-alt transition-transform`,l&&`rotate-180`),"aria-hidden":!0})]}),l?(0,H.jsxs)(`div`,{role:`group`,"data-testid":`automations-filters-menu`,"aria-label":v,className:`absolute right-0 top-full z-50 mt-1 flex min-w-[16rem] w-max flex-col gap-3 overflow-visible rounded-[6px] bg-tertiary p-3 context-menu-box-shadow`,children:[f?(0,H.jsx)(J,{label:f.label,children:(0,H.jsx)(F,{testId:`automations-filter-status`,value:t,onChange:i,options:f.options.map(e=>e.value),labelByValue:Y(f.options),ariaLabel:f.label,fullWidth:!0})}):null,m?(0,H.jsx)(J,{label:m.label,children:(0,H.jsx)(F,{testId:`automations-filter-trigger`,value:n,onChange:a,options:m.options.map(e=>e.value),labelByValue:Y(m.options),ariaLabel:m.label,fullWidth:!0})}):null,(0,H.jsx)(J,{label:e.sort.label,children:(0,H.jsx)(F,{testId:`automations-sort`,value:r,onChange:o,options:e.sort.options.map(e=>e.value),labelByValue:Y(e.sort.options),ariaLabel:e.sort.label,fullWidth:!0})}),g>0?(0,H.jsx)(`button`,{type:`button`,"data-testid":`automations-filters-reset`,onClick:()=>{y&&i(y),b&&a(b),o(e.sort.default)},className:`self-start text-sm text-muted hover:text-foreground`,children:s(p.AUTOMATIONS$RESET_ALL)}):null]}):null]})}function Ke({onClear:e}){let{t}=c(`openhands`);return(0,H.jsxs)(`div`,{"data-testid":`automations-filtered-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-8 text-center`,children:[(0,H.jsx)(`p`,{className:`text-sm text-muted`,children:t(p.AUTOMATIONS$NO_FILTER_MATCHES)}),(0,H.jsx)(`button`,{type:`button`,"data-testid":`automations-clear-filters`,onClick:e,className:`mt-2 text-sm text-white underline-offset-2 hover:underline`,children:t(p.AUTOMATIONS$CLEAR_FILTERS)})]})}function qe({label:e,tiles:t}){return(0,H.jsx)(`section`,{"aria-label":e,className:`grid grid-cols-2 gap-3 xl:grid-cols-4`,children:t.map(e=>(0,H.jsxs)(`div`,{"data-testid":`overview-tile-${e.key}`,className:h(R,`p-4`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs text-muted`,children:e.label}),(0,H.jsx)(e.Icon,{className:`size-4 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0})]}),(0,H.jsx)(`div`,{className:`mt-2 text-xl font-semibold text-content`,children:e.value}),(0,H.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted`,children:e.detail})]},e.key))})}var Je=50,X=()=>{if(!E())throw new Response(null,{status:404,statusText:`Not Found`});return null},Z=i(function(){let{t:e}=c(`openhands`),t=ue(),n=(0,B.useMemo)(()=>de(),[]),r=ke(),i=n&&r?{spec:n,nav:r}:null,[a,o]=(0,B.useState)(``),[g,_]=(0,B.useState)(`all`),[v,y]=(0,B.useState)(`all`),[x,re]=(0,B.useState)(n?.sort.default??`last-run`),[S,C]=(0,B.useState)(()=>ie()),[w,T]=(0,B.useState)(Je),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)(null),[ge,j]=(0,B.useState)(!1),[M,N]=(0,B.useState)(null),[P,F]=(0,B.useState)(!1),I=d(),{navigate:L}=_e(),R=I.backend.kind===`local`,{canManage:z}=Ee(),{data:Ie,isLoading:Le,refetch:V}=ve(),U=Ie?.status===`ok`,{data:W,isLoading:G,isError:K,refetch:Be}=Ce({limit:w,offset:0,enabled:U}),q=We(W?.automations??[],{enabled:U&&i!==null}),{trackPrebuiltAutomationEnabled:He,trackAutomationExported:Ue}=he(),J=xe(),Y=Se(),X=be(),Z=ye(),Q=(0,B.useMemo)(()=>W?.automations?n?ce(W.automations,{search:a,status:g,trigger:v,sort:x},q):W.automations.filter(e=>ae(e,a)):[],[W?.automations,n,a,g,v,x,q]),$=(0,B.useMemo)(()=>Q.filter(e=>e.enabled),[Q]),Ye=(0,B.useMemo)(()=>Q.filter(e=>!e.enabled),[Q]),Xe=(e,t)=>{let n=!t;if(J.mutate({id:e,enabled:n}),n){let t=W?.automations.find(t=>t.id===e);He({automationId:e,automationName:t?.name??e})}},Ze=t=>{X.mutate(t,{onSuccess:()=>{l(e(p.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{f(we(t,e(p.AUTOMATIONS$RUN_NOW_ERROR)))}})},Qe=e=>{let t=W?.automations.find(t=>t.id===e);t&&D({id:e,name:t.name})},$e=e=>{let t=W?.automations.find(t=>t.id===e);t&&k(t)},et=e=>{let t=`${JSON.stringify(Pe(e),null,2)}\n`;m(new Blob([t],{type:`application/json`}),Fe(e)),Ue({backendKind:I.backend.kind})},tt=async t=>{try{let n;try{n=JSON.parse(await t.text())}catch{f(e(p.AUTOMATIONS$IMPORT_INVALID_JSON));return}N(Ne(n))}catch(t){f(t instanceof Error?t.message:e(p.ERROR$GENERIC))}},nt=()=>{M&&Z.mutate({...M,enabled:!1},{onSuccess:t=>{F(!1),N(null),u(e(p.AUTOMATIONS$IMPORT_SUCCESS,{name:t.name}),e(p.AUTOMATIONS$IMPORT_VIEW),pe(t.id))},onError:t=>{f(we(t,e(p.ERROR$GENERIC)))}})},rt=()=>{E&&(Y.mutate(E.id),D(null))},it=(0,B.useCallback)(e=>{C(e),se(e)},[]),at=()=>{o(``),_(`all`),y(`all`)},ot=(0,B.useMemo)(()=>{if(!n)return[];let e=W?.automations??[];return n.overview.tiles.map(t=>{let n=oe(t.metric,e,q),r=n.isZero&&t.zeroDetail?t.zeroDetail:t.detail;return{key:t.metric,label:t.label,value:n.display,detail:me(r,n.placeholderValues),Icon:fe[t.icon]}})},[n,W?.automations,q]),st=i?{spec:i.spec.insights,byId:q}:void 0,ct=e=>i?(0,H.jsx)(je,{heading:i.nav.heading,navTestIdBase:`automations-navbar`,items:i.nav.items,children:e}):(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:e})}),lt=W?W.total>W.automations.length:!1,ut=!G&&!K&&W?.automations.length===0;return ct(Le?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle}),(0,H.jsx)(`div`,{className:`mt-6 flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,H.jsx)(b,{},`skeleton-${String(t)}`))})]}):U?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-semibold text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[R&&(0,H.jsx)(A,{type:`button`,variant:`secondary`,testId:`automations-git-sync`,className:`whitespace-nowrap`,onClick:()=>L?.(`/automations/git-sync`),startContent:(0,H.jsx)(le,{className:`size-4`,"aria-hidden":!0}),children:e(p.AUTOMATIONS$GIT_SYNC$NAV_BUTTON)}),z?(0,H.jsx)(ze,{onAdd:()=>j(!0),onImport:()=>F(!0)}):null]})]}),i&&(0,H.jsx)(qe,{label:i.spec.overview.label,tiles:ot}),(0,H.jsxs)(`div`,{className:h(`flex items-stretch gap-2`,i?`flex-wrap`:`mt-6`),children:[(0,H.jsx)(Ae,{value:a,onChange:o}),i&&(0,H.jsx)(Ge,{spec:i.spec,status:g,trigger:v,sort:x,onStatusChange:_,onTriggerChange:y,onSortChange:re}),(0,H.jsx)(Re,{view:S,onChange:it,disabled:ut})]}),(0,H.jsxs)(`div`,{className:h(`flex flex-col gap-6`,!i&&`mt-6`),children:[G&&(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:3}).map((e,t)=>(0,H.jsx)(b,{},`skeleton-${String(t)}`))}),K&&!G&&(0,H.jsx)(Oe,{onRetry:Be}),ut&&(0,H.jsx)(ne,{}),!G&&!K&&W&&W.automations.length>0&&(i&&Q.length===0?(0,H.jsx)(Ke,{onClear:at}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te,{title:e(p.AUTOMATIONS$ACTIVE),count:$.length,automations:$,view:S,onToggle:Xe,onRunNow:Ze,runPendingId:X.isPending?X.variables??null:null,onDelete:Qe,onExport:et,onEdit:$e,insights:st}),(0,H.jsx)(te,{title:e(p.AUTOMATIONS$INACTIVE),count:Ye.length,automations:Ye,view:S,onToggle:Xe,onRunNow:Ze,runPendingId:X.isPending?X.variables??null:null,onDelete:Qe,onExport:et,onEdit:$e,insights:st}),lt&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>T(e=>e+Je),className:`self-center rounded-lg border border-[var(--oh-border)] px-6 py-2 text-sm text-white hover:bg-surface-raised`,children:e(p.AUTOMATIONS$LOAD_MORE)})]}))]}),!i&&(0,H.jsx)(`div`,{className:`mt-6`,children:(0,H.jsx)(s,{query:a})}),(0,H.jsx)(Me,{automationName:E?.name??``,isOpen:E!==null,onConfirm:rt,onCancel:()=>D(null)}),O&&(0,H.jsx)(Te,{automation:O,isOpen:O!==null,onClose:()=>k(null)}),(0,H.jsx)(ee,{isOpen:ge,onClose:()=>j(!1)}),(0,H.jsx)(Ve,{isOpen:P,spec:M,isImporting:Z.isPending,onClose:()=>{F(!1),N(null)},onImport:nt,onFile:tt})]}):(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:t.listTitle}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:t.listSubtitle}),(0,H.jsx)(De,{onRetry:V})]}))});export{X as clientLoader,Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQuery-DAAacS7O.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{J as s,r as c,tt as l,w as u}from"./active-backend-context-BnH4-L8h.js";import{K as d,t as f}from"./utils-BgLSZdyy.js";import{A as p,D as m,O as h,n as g}from"./agent-server-client-options-EHB23gyx.js";import{t as _}from"./chevron-down-Cr6Fn_wS.js";import{a as v,i as y,n as b,r as x}from"./cloud-funnel-analytics-D5uJ_4JE.js";import{t as S}from"./info-BcajzHn1.js";import{u as C}from"./agent-server-config-C_x8Otd9.js";import{a as w,i as T,n as E,r as D,x as ee}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{a as O,i as k,n as A,o as j,r as M}from"./use-onboarding-completion-Xl63ZvzQ.js";import{t as N}from"./use-tracking-j4uo9VEW.js";import{t as P}from"./modal-backdrop-BSzNhM4r.js";import{n as te,r as ne,t as re}from"./modal-body-C24WsdFb.js";import{n as ie,r as ae}from"./modal-classes-B0b9eiL8.js";import{t as F}from"./brand-button-CUMfjb99.js";import{n as oe}from"./navigation-context-CQZwH_tC.js";import{t as I}from"./modal-close-button-DfqfB2Nj.js";import{t as L}from"./settings-input-dVuzapBA.js";var se=i(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=e(n()),z=r(),B=e=>(0,z.jsxs)(`svg`,{width:1365,height:1365,viewBox:`0 -24 148 148`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M71.7542 16.863V2.97414C71.7542 1.82355 72.6872 0.890503 73.8378 0.890503C74.9884 0.890503 75.9214 1.82355 75.9214 2.97414V16.863C75.9214 18.0136 74.9884 18.9466 73.8378 18.9466C72.6872 18.9466 71.7542 18.0136 71.7542 16.863Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M82.5272 18.9329L89.4716 6.90477C90.0469 5.90832 91.3215 5.5668 92.3179 6.1421C93.3144 6.7174 93.6559 7.99197 93.0806 8.98841L86.1362 21.0165C85.5609 22.0129 84.2863 22.3545 83.2899 21.7792C82.2934 21.2039 81.9519 19.9293 82.5272 18.9329Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M65.1481 18.9329L58.2037 6.90477C57.6284 5.90832 56.3538 5.5668 55.3574 6.1421C54.3609 6.7174 54.0194 7.99197 54.5947 8.98841L61.5391 21.0165C62.1144 22.0129 63.389 22.3545 64.3854 21.7792C65.3819 21.2039 65.7234 19.9293 65.1481 18.9329Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M140.606 62.0292C140.606 58.409 141.583 47.6748 141.89 44.1323C142.097 41.7374 141.809 40.4247 141.424 39.7542C141.141 39.2626 140.699 38.915 139.634 38.8436C138.865 38.7921 138.027 39.0114 137.401 39.5761C136.814 40.1052 136.159 41.1682 136.159 43.3176L136.155 43.4388L135.198 59.758C135.164 60.3451 134.883 60.8911 134.424 61.2599C133.966 61.6284 133.374 61.7859 132.793 61.6941L122.764 60.1068L111.948 58.6703C110.949 58.5376 110.188 57.7084 110.142 56.7016L109.561 44.1323C109.535 43.621 109.51 43.1141 109.484 42.6146C109.241 37.9294 109.022 33.7805 109.022 32.4282C109.022 28.3859 108.338 26.6806 107.74 25.9634C107.263 25.3915 106.577 25.1402 105.11 25.1402C104.583 25.1402 104.212 25.2481 103.933 25.4111C103.659 25.5714 103.346 25.8587 103.049 26.4208C102.41 27.6257 101.945 29.891 102.118 33.8479C102.342 38.9804 102.692 42.8146 103.035 46.2718C103.377 49.7231 103.718 52.8561 103.908 56.4971C104.204 62.1966 104.178 66.1256 103.945 68.7924C103.828 70.124 103.656 71.1996 103.423 72.0501C103.202 72.8558 102.871 73.6757 102.296 74.2887C101.6 75.0303 100.608 75.3844 99.577 75.136C98.7592 74.9389 98.1847 74.4215 97.8706 74.0916C97.2141 73.4017 96.7501 72.5106 96.568 72.0512C95.5097 69.3812 92.2352 63.1808 87.8023 59.6811C86.5089 58.6599 85.5666 58.3652 84.9736 58.3204C84.4148 58.2783 84.0094 58.4436 83.6909 58.6967C83.34 58.9756 83.0781 59.3811 82.9479 59.7643C82.9019 59.8999 82.8823 59.9968 82.8741 60.0584C84.0759 62.0865 88.8421 69.5222 91.0896 77.069C92.7648 82.6941 96.8038 88.4259 99.8194 90.8809C102.74 93.258 107.988 94.7313 113.9 95.0218C119.756 95.3095 125.788 94.4121 130.033 92.5092C138.233 88.8334 139.903 80.7382 140.651 77.2292C141.232 74.5057 141.243 71.5987 141.087 68.9009C141.01 67.5551 140.894 66.2969 140.793 65.1373C140.695 64.0105 140.606 62.9215 140.606 62.0292ZM120.986 27.0953C120.986 25.8314 120.648 24.7049 120.089 23.9514C119.583 23.27 118.84 22.7987 117.646 22.7984C116.668 22.7982 116.011 22.9187 115.546 23.1167C115.13 23.2943 114.781 23.5699 114.463 24.0831C113.73 25.2671 113.192 27.6455 113.189 32.384L113.721 43.9088C113.91 47.5661 114.106 51.4922 114.235 54.7707L120.986 55.6666V27.0953ZM125.153 56.2652L131.172 57.218L131.992 43.267V32.5083C131.992 31.031 131.39 30.1275 130.678 29.5489C129.884 28.9039 128.957 28.6731 128.519 28.6731C127.722 28.6731 126.899 28.797 126.306 29.2179C125.849 29.5421 125.153 30.3087 125.153 32.5083V56.2652ZM136.159 35.4278C137.406 34.8069 138.74 34.6083 139.912 34.6868C142.037 34.8292 143.91 35.718 145.037 37.6779C146.06 39.4592 146.273 41.8136 146.041 44.4927C145.72 48.1949 144.772 58.6457 144.772 62.0292C144.772 62.708 144.843 63.6116 144.944 64.7758C145.042 65.907 145.165 67.2389 145.247 68.6606C145.411 71.4987 145.422 74.8383 144.727 78.0987C144.002 81.4953 142.041 91.6918 131.738 96.3108C126.731 98.5551 120.002 99.4936 113.696 99.1838C107.445 98.8767 101.128 97.3189 97.1887 94.1122C93.4809 91.0937 88.9938 84.6307 87.0962 78.2589C84.9529 71.0619 80.3109 63.9646 79.1527 61.9533C78.4706 60.7689 78.684 59.3628 79.0019 58.4258C79.3607 57.3688 80.0554 56.2631 81.0993 55.4337C82.1758 54.5784 83.6043 54.0377 85.2876 54.1647C86.9369 54.2893 88.6462 55.0393 90.3834 56.4107C94.8541 59.9401 98.1342 65.5082 99.7424 68.9231C99.759 68.7664 99.779 68.6024 99.7941 68.4298C100.003 66.0435 100.039 62.3344 99.7467 56.7132C99.5635 53.1942 99.2356 50.1809 98.8888 46.6828C98.5425 43.1904 98.184 39.2713 97.955 34.0302C97.7722 29.8481 98.2012 26.6722 99.3672 24.471C99.9716 23.3302 100.79 22.4223 101.83 21.814C102.866 21.2087 103.995 20.974 105.11 20.974C106.759 20.974 108.813 21.2062 110.448 22.7678C110.593 22.4576 110.75 22.1652 110.921 21.8899C111.676 20.6698 112.681 19.8084 113.912 19.2835C115.095 18.7791 116.378 18.6309 117.646 18.6311C120.195 18.6315 122.164 19.7567 123.434 21.4683C124.256 22.576 124.75 23.8775 124.985 25.1982C126.338 24.5876 127.691 24.5068 128.519 24.5068C129.933 24.5068 131.784 25.0791 133.305 26.3154C134.908 27.6179 136.159 29.6733 136.159 32.5083V35.4278Z`,fill:`white`}),(0,z.jsx)(`path`,{d:`M7.15661 62.0292C7.15661 58.409 6.17994 47.6748 5.87291 44.1323C5.6654 41.7374 5.95357 40.4247 6.33875 39.7542C6.62116 39.2626 7.06336 38.915 8.12834 38.8436C8.89759 38.7921 9.73544 39.0114 10.3616 39.5761C10.9484 40.1052 11.6032 41.1682 11.6032 43.3176L11.6074 43.4388L12.5644 59.758C12.5988 60.3451 12.8798 60.8911 13.338 61.2599C13.7961 61.6284 14.3887 61.7859 14.9695 61.6941L24.9988 60.1068L35.8143 58.6703C36.8135 58.5376 37.5741 57.7084 37.6208 56.7016L38.2015 44.1323C38.2279 43.621 38.2525 43.1141 38.2784 42.6146C38.5218 37.9294 38.7401 33.7805 38.7401 32.4282C38.7401 28.3859 39.4246 26.6806 40.0227 25.9634C40.4996 25.3915 41.185 25.1402 42.6523 25.1402C43.1794 25.1402 43.5505 25.2481 43.8295 25.4111C44.1038 25.5714 44.416 25.8587 44.7138 26.4208C45.3521 27.6257 45.8173 29.891 45.6444 33.8479C45.4201 38.9804 45.0703 42.8146 44.7275 46.2718C44.3853 49.7231 44.0443 52.8561 43.8548 56.4971C43.5582 62.1966 43.5847 66.1256 43.8179 68.7924C43.9344 70.124 44.1069 71.1996 44.3396 72.0501C44.5601 72.8558 44.891 73.6757 45.4663 74.2887C46.1625 75.0303 47.1546 75.3844 48.1855 75.136C49.0033 74.9389 49.5778 74.4215 49.8918 74.0916C50.5484 73.4017 51.0123 72.5106 51.1945 72.0512C52.2527 69.3812 55.5272 63.1808 59.9601 59.6811C61.2536 58.6599 62.1958 58.3652 62.7889 58.3204C63.3476 58.2783 63.753 58.4436 64.0715 58.6967C64.4225 58.9756 64.6844 59.3811 64.8146 59.7643C64.8606 59.8999 64.8801 59.9968 64.8883 60.0584C63.6866 62.0865 58.9204 69.5222 56.6729 77.069C54.9977 82.6941 50.9586 88.4259 47.9431 90.8809C45.0229 93.258 39.7747 94.7313 33.8624 95.0218C28.0068 95.3095 21.9748 94.4121 17.7297 92.5092C9.52988 88.8334 7.85961 80.7382 7.11129 77.2292C6.53054 74.5057 6.5195 71.5987 6.67496 68.9009C6.75251 67.5551 6.86809 66.2969 6.96901 65.1373C7.06707 64.0105 7.1566 62.9215 7.15661 62.0292ZM26.7768 27.0953C26.7768 25.8314 27.1147 24.7049 27.6737 23.9514C28.1792 23.27 28.9221 22.7987 30.1167 22.7984C31.0942 22.7982 31.7518 22.9187 32.2162 23.1167C32.6326 23.2943 32.9817 23.5699 33.2996 24.0831C34.0328 25.2671 34.5705 27.6455 34.5738 32.384L34.0416 43.9088C33.8524 47.5661 33.6565 51.4922 33.5273 54.7707L26.7768 55.6666V27.0953ZM22.6095 56.2652L16.5904 57.218L15.7705 43.267V32.5083C15.7705 31.031 16.3726 30.1275 17.0847 29.5489C17.8785 28.9039 18.8058 28.6731 19.2432 28.6731C20.0404 28.6731 20.8634 28.797 21.4565 29.2179C21.9131 29.5421 22.6095 30.3087 22.6095 32.5083V56.2652ZM11.6032 35.4278C10.3568 34.8069 9.02265 34.6083 7.8501 34.6868C5.72541 34.8292 3.85197 35.718 2.72584 37.6779C1.70247 39.4592 1.48924 41.8136 1.72143 44.4927C2.0423 48.1949 2.99038 58.6457 2.99038 62.0292C2.99037 62.708 2.91991 63.6116 2.81859 64.7758C2.72014 65.907 2.59699 67.2389 2.51505 68.6606C2.3515 71.4987 2.34041 74.8383 3.0357 78.0987C3.76005 81.4953 5.72154 91.6918 16.0245 96.3108C21.0311 98.5551 27.7601 99.4936 34.0669 99.1838C40.3172 98.8767 46.6346 97.3189 50.5737 94.1122C54.2816 91.0937 58.7686 84.6307 60.6662 78.2589C62.8095 71.0619 67.4515 63.9646 68.6098 61.9533C69.2919 60.7689 69.0785 59.3628 68.7605 58.4258C68.4018 57.3688 67.707 56.2631 66.6632 55.4337C65.5867 54.5784 64.1582 54.0377 62.4748 54.1647C60.8256 54.2893 59.1162 55.0393 57.379 56.4107C52.9083 59.9401 49.6283 65.5082 48.02 68.9231C48.0034 68.7664 47.9835 68.6024 47.9684 68.4298C47.7597 66.0435 47.7232 62.3344 48.0158 56.7132C48.1989 53.1942 48.5269 50.1809 48.8737 46.6828C49.22 43.1904 49.5784 39.2713 49.8075 34.0302C49.9903 29.8481 49.5612 26.6722 48.3952 24.471C47.7909 23.3302 46.9729 22.4223 45.9321 21.814C44.8964 21.2087 43.7676 20.974 42.6523 20.974C41.0038 20.974 38.9497 21.2062 37.3141 22.7678C37.1698 22.4576 37.0124 22.1652 36.8419 21.8899C36.0863 20.6698 35.0817 19.8084 33.8508 19.2835C32.6679 18.7791 31.3849 18.6309 30.1167 18.6311C27.5677 18.6315 25.5986 19.7567 24.3285 21.4683C23.5066 22.576 23.0121 23.8775 22.7771 25.1982C21.4247 24.5876 20.0718 24.5068 19.2432 24.5068C17.8298 24.5068 15.9788 25.0791 14.4573 26.3154C12.8542 27.6179 11.6032 29.6733 11.6032 32.5083V35.4278Z`,fill:`white`})]});function ce(e){return w(e,{headers:u})}function le(e,t,n){return T(e,t,{...n,headers:u})}var V=e=>(0,z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.3235 10.9352L11.5016 14.2111L7.67969 10.9352L8.6152 9.84375L11.5016 12.3178L14.388 9.84375L15.3235 10.9352Z`,fill:`currentColor`})}),H=e=>(0,z.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,z.jsx)(`path`,{d:`M13 3H8.33337V4H11.2929L7.31315 7.97978L8.02026 8.68689L12 4.70711V7.66667H13V3Z`,fill:`currentColor`}),(0,z.jsx)(`path`,{d:`M4.33333 3.66667C3.59695 3.66667 3 4.26362 3 5V11.6667C3 12.403 3.59695 13 4.33333 13H11C11.7364 13 12.3333 12.403 12.3333 11.6667V9.66667H11.3333V11.6667C11.3333 11.8508 11.1841 12 11 12H4.33333C4.14924 12 4 11.8508 4 11.6667V5C4 4.81591 4.14924 4.66667 4.33333 4.66667H6.33333V3.66667H4.33333Z`,fill:`currentColor`})]}),ue=e=>(0,z.jsx)(`svg`,{viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,z.jsx)(`path`,{d:`M8.25 9.75C8.10166 9.75 7.95666 9.79399 7.83332 9.8764C7.70999 9.95881 7.61386 10.0759 7.55709 10.213C7.50032 10.35 7.48547 10.5008 7.51441 10.6463C7.54335 10.7918 7.61478 10.9254 7.71967 11.0303C7.82456 11.1352 7.9582 11.2066 8.10368 11.2356C8.24917 11.2645 8.39997 11.2497 8.53701 11.1929C8.67406 11.1361 8.79119 11.04 8.8736 10.9167C8.95601 10.7933 9 10.6483 9 10.5C9 10.3011 8.92098 10.1103 8.78033 9.96967C8.63968 9.82902 8.44891 9.75 8.25 9.75ZM5.25 9.75C5.10166 9.75 4.95666 9.79399 4.83332 9.8764C4.70999 9.95881 4.61386 10.0759 4.55709 10.213C4.50032 10.35 4.48547 10.5008 4.51441 10.6463C4.54335 10.7918 4.61478 10.9254 4.71967 11.0303C4.82456 11.1352 4.9582 11.2066 5.10368 11.2356C5.24917 11.2645 5.39997 11.2497 5.53701 11.1929C5.67406 11.1361 5.79119 11.04 5.8736 10.9167C5.95601 10.7933 6 10.6483 6 10.5C6 10.3011 5.92098 10.1103 5.78033 9.96967C5.63968 9.82902 5.44891 9.75 5.25 9.75ZM16.5 3C16.5 2.40326 16.2629 1.83097 15.841 1.40901C15.419 0.987053 14.8467 0.75 14.25 0.75H3.75C3.15326 0.75 2.58097 0.987053 2.15901 1.40901C1.73705 1.83097 1.5 2.40326 1.5 3V6C1.50331 6.55504 1.71166 7.08927 2.085 7.5C1.71166 7.91073 1.50331 8.44496 1.5 9V12C1.5 12.5967 1.73705 13.169 2.15901 13.591C2.58097 14.0129 3.15326 14.25 3.75 14.25H8.25V15.75H2.25C2.05109 15.75 1.86032 15.829 1.71967 15.9697C1.57902 16.1103 1.5 16.3011 1.5 16.5C1.5 16.6989 1.57902 16.8897 1.71967 17.0303C1.86032 17.171 2.05109 17.25 2.25 17.25H15.75C15.9489 17.25 16.1397 17.171 16.2803 17.0303C16.421 16.8897 16.5 16.6989 16.5 16.5C16.5 16.3011 16.421 16.1103 16.2803 15.9697C16.1397 15.829 15.9489 15.75 15.75 15.75H9.75V14.25H14.25C14.8467 14.25 15.419 14.0129 15.841 13.591C16.2629 13.169 16.5 12.5967 16.5 12V9C16.4967 8.44496 16.2883 7.91073 15.915 7.5C16.2883 7.08927 16.4967 6.55504 16.5 6V3ZM15 12C15 12.1989 14.921 12.3897 14.7803 12.5303C14.6397 12.671 14.4489 12.75 14.25 12.75H3.75C3.55109 12.75 3.36032 12.671 3.21967 12.5303C3.07902 12.3897 3 12.1989 3 12V9C3 8.80109 3.07902 8.61032 3.21967 8.46967C3.36032 8.32902 3.55109 8.25 3.75 8.25H14.25C14.4489 8.25 14.6397 8.32902 14.7803 8.46967C14.921 8.61032 15 8.80109 15 9V12ZM15 6C15 6.19891 14.921 6.38968 14.7803 6.53033C14.6397 6.67098 14.4489 6.75 14.25 6.75H3.75C3.55109 6.75 3.36032 6.67098 3.21967 6.53033C3.07902 6.38968 3 6.19891 3 6V3C3 2.80109 3.07902 2.61032 3.21967 2.46967C3.36032 2.32902 3.55109 2.25 3.75 2.25H14.25C14.4489 2.25 14.6397 2.32902 14.7803 2.46967C14.921 2.61032 15 2.80109 15 3V6ZM8.25 3.75C8.10166 3.75 7.95666 3.79399 7.83332 3.8764C7.70999 3.95881 7.61386 4.07594 7.55709 4.21299C7.50032 4.35003 7.48547 4.50083 7.51441 4.64632C7.54335 4.7918 7.61478 4.92544 7.71967 5.03033C7.82456 5.13522 7.9582 5.20665 8.10368 5.23559C8.24917 5.26453 8.39997 5.24968 8.53701 5.19291C8.67406 5.13614 8.79119 5.04001 8.8736 4.91668C8.95601 4.79334 9 4.64834 9 4.5C9 4.30109 8.92098 4.11032 8.78033 3.96967C8.63968 3.82902 8.44891 3.75 8.25 3.75ZM5.25 3.75C5.10166 3.75 4.95666 3.79399 4.83332 3.8764C4.70999 3.95881 4.61386 4.07594 4.55709 4.21299C4.50032 4.35003 4.48547 4.50083 4.51441 4.64632C4.54335 4.7918 4.61478 4.92544 4.71967 5.03033C4.82456 5.13522 4.9582 5.20665 5.10368 5.23559C5.24917 5.26453 5.39997 5.24968 5.53701 5.19291C5.67406 5.13614 5.79119 5.04001 5.8736 4.91668C5.95601 4.79334 6 4.64834 6 4.5C6 4.30109 5.92098 4.11032 5.78033 3.96967C5.63968 3.82902 5.44891 3.75 5.25 3.75Z`,fill:`currentColor`})});function U(e,t,n){let r=n?.lastError??null,i=t?.kind===`cloud`;return i&&!t?.apiKey?.trim()||O(r)?e(d.BACKEND$STATUS_DISCONNECTED_ADD_API_KEY):k(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_API_KEY):M(r)?e(d.BACKEND$LOGGED_OUT):n?.isConnected===!0?e(d.ONBOARDING$BACKEND_STATUS_CONNECTED):i&&n?.isConnected===!1&&(A(r)||p(r))?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_CLOUD_ACCESS):n?.isConnected===!1&&h(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_TUNNEL):n?.isConnected===!1&&p(r)?e(d.BACKEND$STATUS_DISCONNECTED_CHECK_URL_OR_NETWORK):n?.isConnected===!1?e(d.ONBOARDING$BACKEND_STATUS_DISCONNECTED):e(d.ONBOARDING$BACKEND_STATUS_CHECKING)}function W({isConnected:e,className:t}){let n,r,i;return e===`unavailable`?(n=`bg-[var(--oh-text-tertiary)]`,r=`No Backend Available`,i=`unavailable`):e===!0?(n=`bg-[var(--oh-status-success)]`,r=`Connected`,i=`connected`):e===!1?(n=`bg-red-500`,r=`Disconnected`,i=`disconnected`):(n=`bg-[var(--oh-interactive-selected)]`,r=`Checking connection`,i=`checking`),(0,z.jsx)(`span`,{"data-testid":`backend-status-dot`,"data-status":i,"aria-label":r,title:r,role:`status`,className:f(`inline-block w-2 h-2 rounded-full shrink-0`,n,t)})}var G={status:`idle`,verificationUrl:null,userCode:null,apiKey:null,error:null,errorCode:null};function de(){let[e,t]=R.useState(G),n=R.useRef(null),r=R.useCallback((e,r)=>{n.current?.abort();let i=new AbortController;n.current=i,t({...G,status:`starting`}),(async()=>{let n;try{n=await ce(e)}catch(e){if(i.signal.aborted)return;let n=e instanceof Error?e.message:`Failed to start device flow`,r=e instanceof E?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null});return}if(!i.signal.aborted){b(e,r),t({...G,status:`awaiting_authorization`,verificationUrl:n.verification_uri_complete,userCode:n.user_code});try{let a=await le(e,n.device_code,{interval:n.interval,signal:i.signal});if(i.signal.aborted)return;x(e,r),t({...G,status:`success`,apiKey:a.access_token})}catch(e){if(i.signal.aborted)return;if(e instanceof E&&e.code===`cancelled`){t(G);return}let n=e instanceof Error?e.message:`Authorization failed`,r=e instanceof E?e.code:void 0;t({...G,status:`error`,error:n,errorCode:r??null})}}})()},[]),i=R.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]),a=R.useCallback(()=>{n.current?.abort(),n.current=null,t(G)},[]);return R.useEffect(()=>()=>{n.current?.abort()},[]),{...e,start:r,cancel:i,reset:a}}function K(e){try{return new URL(e).protocol===`https:`}catch{return!1}}function q({host:e,onSuccess:t,testIdRoot:n,isDisabled:r=!1,idleButtonLabel:i,idleButtonContent:a,idleDescription:s,idleFooter:c,className:l,buttonClassName:u,buttonVariant:p=`primary`,statusDisplay:m=`inline`,analyticsSource:h}){let{t:g}=o(`openhands`),_=de(),v=R.useRef(null);R.useEffect(()=>()=>{v.current?.close()},[]),R.useEffect(()=>{if(_.status===`awaiting_authorization`&&_.verificationUrl&&v.current&&!v.current.closed){if(!K(_.verificationUrl)){console.error(`Invalid verification URL protocol`);return}try{v.current.location.href=_.verificationUrl}catch{v.current=window.open(_.verificationUrl,`_blank`,`noopener,noreferrer`)}}},[_.status,_.verificationUrl]),R.useEffect(()=>{if(_.status===`success`&&_.apiKey)try{t(_.apiKey)}finally{_.reset(),v.current?.close()}},[_.status,_.apiKey,_.reset,t]);let y=()=>{let t=e.trim().replace(/\/+$/,``),n=/^https?:\/\//i.test(t)?t:`https://${t}`;try{let e=new URL(n);if(e.username||e.password)throw Error(`Invalid URL format`)}catch{return}v.current=window.open(`about:blank`,`_blank`),v.current||console.warn(`Popup blocked - user will need to use manual link`),_.start(n,h)},b=()=>{_.cancel(),v.current?.close()},x=(0,z.jsx)(fe,{status:_.status,error:_.error,verificationUrl:_.verificationUrl,testIdRoot:n,onCancel:b,onRetry:y}),S=m===`modal`&&_.status!==`idle`,C=i??g(d.BACKEND$LOGIN_WITH_OPENHANDS);return(0,z.jsxs)(`div`,{"data-testid":`${n}-device-flow`,className:f(`flex flex-col gap-3`,l),children:[_.status===`idle`?s:null,_.status===`idle`&&p===`unstyled`&&(0,z.jsx)(`button`,{type:`button`,onClick:y,"data-testid":`${n}-login-button`,className:u,disabled:r,"aria-label":a?C:void 0,children:a??C}),_.status===`idle`&&p!==`unstyled`&&(0,z.jsx)(F,{type:`button`,variant:p,onClick:y,testId:`${n}-login-button`,className:u,isDisabled:r,ariaLabel:a?C:void 0,children:a??C}),_.status===`idle`?c:null,m===`inline`?x:null,S?(0,z.jsx)(P,{onClose:b,"aria-label":g(d.BACKEND$LOGIN_WITH_OPENHANDS),closeOnBackdropClick:!1,children:(0,z.jsx)(te,{testID:`${n}-auth-modal`,width:`sm`,className:`items-stretch border border-[var(--oh-border)]`,children:x})}):null]})}function fe({status:e,error:t,verificationUrl:n,testIdRoot:r,onCancel:i,onRetry:a}){let{t:s}=o(`openhands`);if(e===`idle`||e===`success`)return null;if(e===`starting`)return(0,z.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,"data-testid":`${r}-auth-starting`,role:`status`,"aria-live":`polite`,children:[(0,z.jsx)(pe,{}),(0,z.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:s(d.BACKEND$AUTH_STARTING)})]});if(e===`awaiting_authorization`){let e=n&&K(n)?n:null;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`${r}-auth-awaiting`,role:`status`,"aria-live":`polite`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,z.jsx)(pe,{}),(0,z.jsx)(`span`,{className:`text-sm font-medium text-white`,children:s(d.BACKEND$AUTH_AWAITING)})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`p`,{className:`text-center text-sm leading-5 text-[var(--oh-text-tertiary)]`,children:e?`${s(d.BACKEND$AUTH_BROWSER_OPENED)} ${s(d.BACKEND$AUTH_OPEN_MANUALLY)}`:s(d.BACKEND$AUTH_BROWSER_OPENED)}),e?(0,z.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`max-h-16 overflow-auto break-all text-center text-xs text-blue-400 hover:underline`,children:e}):null]}),(0,z.jsx)(F,{type:`button`,variant:`secondary`,onClick:i,testId:`${r}-auth-cancel`,className:`w-full`,children:s(d.BACKEND$AUTH_CANCEL)})]})}return(0,z.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-red-700 bg-red-900/20 p-4`,"data-testid":`${r}-auth-error`,role:`alert`,children:[(0,z.jsx)(`p`,{className:`text-sm text-red-400`,children:t}),(0,z.jsx)(F,{type:`button`,variant:`secondary`,onClick:a,testId:`${r}-auth-retry`,className:`w-full`,children:s(d.BACKEND$AUTH_RETRY)})]})}function pe(){return(0,z.jsx)(`svg`,{className:`animate-spin h-4 w-4 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,z.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})})}var me=t({BackendConnectionOptions:()=>De,BackendForm:()=>Q,BackendFormModal:()=>Pe});function he(e){return D(e)?`cloud`:`local`}function ge(e){let t=e.toLowerCase().replace(/^\[|\]$/g,``);return!!(t===`localhost`||t===`::1`||t===`::`||t===`0.0.0.0`||/^127\./.test(t)||/^::ffff:127\./i.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2\d|3[01])\./.test(t)||/^fe[89ab][0-9a-f]:/i.test(t)||/^f[cd][0-9a-f]{2}:/i.test(t)||t.endsWith(`.local`)||!t.includes(`.`)&&!t.includes(`:`))}function J(e){let t=e.trim().replace(/\/+$/,``);if(!t)return``;if(/^https?:\/\//i.test(t))return t;let n=t.match(/^\[([^\]]+)\]/);return`${ge(n?n[1]:(t.match(/:/g)??[]).length>1?t:t.split(`:`)[0])?`http`:`https`}://${t}`}function Y(e){let t=e.trim();if(!t||/\s/.test(t))return!1;let n=J(t);if(!n)return!1;try{let e=new URL(n);return(e.protocol===`http:`||e.protocol===`https:`)&&e.hostname.length>0}catch{return!1}}var X=`https://app.all-hands.dev`,_e=`agent-canvas --backend-only --port 8001`,ve=`https://github.com/OpenHands/OpenHands/blob/main/docs/DEVELOPMENT.md#alternative-development-workflows`,ye=`https://github.com/OpenHands/OpenHands/blob/main/docs/SELF_HOSTING.md`,be=`https://docs.openhands.dev/overview/introduction`;function xe(e,t){return e(d.BACKEND$CONNECTION_TEST_FAILED,{host:t,interpolation:{escapeValue:!1}})}function Se(e){return m(e)}function Ce(e,t){let n=Se(t);return n?`${e}\n${n}`:e}async function we(e){return e.kind===`local`?{agentServerVersion:await l(e,5e3)}:{agentServerVersion:null}}function Te({backend:e,testIdRoot:t}){let{t:n}=o(`openhands`),r=j([e])[e.id],i=r?.isConnected??null,c=r?.disabled===!0,l=r?.consecutiveFailures??0,u=r?.lastError??null,{data:f}=a({queryKey:[`backend-version`,e.host,e.apiKey],queryFn:async()=>s(await new ee(g({host:e.host,sessionApiKey:e.apiKey||null,timeout:5e3})).getServerInfo()),retry:!1,staleTime:6e4,enabled:e.kind===`local`&&!c}),p=U(n,e,r),m=e.kind===`cloud`?n(d.BACKEND$KIND_CLOUD):n(d.BACKEND$KIND_LOCAL);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsxs)(`div`,{"data-testid":`${t}-status`,className:`flex items-center gap-3 text-sm`,children:[(0,z.jsx)(W,{isConnected:i}),(0,z.jsx)(`span`,{className:`text-white`,"data-testid":`${t}-status-label`,children:p}),(0,z.jsx)(`span`,{className:`text-tertiary-alt`,children:`·`}),(0,z.jsx)(`span`,{className:`text-[var(--oh-text-tertiary)]`,children:m}),f?(0,z.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,"data-testid":`${t}-version`,children:n(d.BACKEND$VERSION_LABEL,{version:f})}):null]}),c?(0,z.jsxs)(`div`,{"data-testid":`${t}-status-error`,className:`flex flex-col gap-1 rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`font-semibold text-red-300`,children:n(d.BACKEND$HEALTH_FAILED_TITLE)}),(0,z.jsx)(`span`,{className:`text-xs text-[var(--oh-text-tertiary)]`,children:n(d.BACKEND$HEALTH_FAILED_DETAIL,{count:l})}),u?(0,z.jsx)(`span`,{"data-testid":`${t}-status-error-message`,className:`text-xs text-red-300 whitespace-pre-wrap break-words`,children:u}):null]}):null]})}function Z({initialName:e=``,initialHost:t=``,initialApiKey:n=``,onTestConnection:r,onSuccess:i,requireApiKey:a=!1,onSubmitOverride:s,fixedKind:c}){let{t:l}=o(`openhands`),[u,d]=R.useState(e),[f,p]=R.useState(t),[m,h]=R.useState(n),[g,_]=R.useState(null),[v,y]=R.useState(!1),[b,x]=R.useState(null),S=c??b??he(f),C=a||S!==`local`,w=u.trim().length>0&&Y(f)&&(!C||m.trim().length>0);return{name:u,setName:d,host:f,setHost:p,apiKey:m,setApiKey:h,connectionError:g,setConnectionError:_,isSubmitting:v,kind:S,setKind:x,canSubmit:w,handleSubmit:R.useCallback(async e=>{if(e.preventDefault(),!w||v)return;let t={name:u.trim(),host:J(f),apiKey:m.trim(),kind:S};_(null),y(!0);try{s?await s(t):i(await r(t))}catch(e){_(Ce(xe(l,t.host),e))}finally{y(!1)}},[w,v,u,f,m,S,r,i,a,s,c,l])}}function Q({mode:e,backend:t,onSubmitted:n,renderActions:r,testIdRoot:i,hostReadOnly:a,requireApiKey:s,hideConfigurationFields:l=!1,onSubmitOverride:u}){let{t:p}=o(`openhands`),{addBackend:m,updateBackend:h}=c(),g=e===`edit`&&t?t.kind:null,{name:_,setName:v,host:y,setHost:b,apiKey:x,setApiKey:S,connectionError:C,setConnectionError:w,isSubmitting:T,kind:E,handleSubmit:D}=Z({initialName:t?.name??``,initialHost:t?.host??``,initialApiKey:t?.apiKey??``,onTestConnection:we,onSuccess:async()=>{let r={name:_.trim(),host:J(y),apiKey:x.trim(),kind:g??E};e===`edit`&&t?h(t.id,r):m(r),n()},requireApiKey:s,onSubmitOverride:u}),[ee,O]=R.useState(!1),[k,A]=R.useState(!1),j=g??E,M=i??(e===`edit`?`edit-backend`:`add-backend`),N=s||j!==`local`,P=_.trim().length>0&&Y(y)&&(!N||x.trim().length>0),te=ee&&!_.trim()?p(d.BACKEND$NAME_REQUIRED):void 0,ne=k?y.trim()?Y(y)?void 0:p(d.BACKEND$HOST_INVALID):p(d.BACKEND$HOST_REQUIRED):void 0;return(0,z.jsxs)(`form`,{"data-testid":`${M}-form`,onSubmit:async e=>{if(!P){O(!0),A(!0);return}await D(e)},className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`div`,{"data-testid":`${M}-configuration-fields`,className:f(`flex flex-col gap-4`,l&&`hidden`),children:[(0,z.jsx)(L,{testId:`${M}-name`,name:`${M}-name`,type:`text`,label:p(d.BACKEND$NAME_LABEL),value:_,onChange:e=>{v(e),w(null)},onBlur:()=>O(!0),placeholder:`Production`,className:`w-full`,showRequiredTag:!0,error:te}),(0,z.jsx)(L,{testId:`${M}-host`,name:`${M}-host`,type:`text`,label:p(d.BACKEND$HOST_LABEL),value:y,onChange:a?void 0:e=>{b(e),w(null)},onBlur:()=>A(!0),placeholder:X,className:`w-full`,showRequiredTag:!0,error:ne,isDisabled:a}),(0,z.jsx)(L,{testId:`${M}-api-key`,name:`${M}-api-key`,type:`password`,label:p(d.BACKEND$KEY_LABEL),value:x,onChange:e=>{S(e),w(null)},placeholder:``,className:`w-full`}),C?(0,z.jsx)(`div`,{role:`alert`,"data-testid":`${M}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:C}):null,e===`edit`&&t&&(0,z.jsx)(Te,{backend:t,testIdRoot:M})]}),r?r({canSubmit:P&&!T,isSubmitting:T,testIdRoot:M}):(0,z.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2 w-full`,children:[(0,z.jsx)(F,{type:`button`,variant:`secondary`,onClick:n,testId:`${M}-cancel`,children:p(d.BUTTON$CANCEL)}),(0,z.jsx)(F,{type:`submit`,variant:`primary`,isDisabled:!P||T,testId:`${M}-submit`,children:p(d.BACKEND$SAVE)})]})]})}function Ee(){let{currentPath:e,navigate:t}=oe();return R.useCallback(()=>{/^\/automations\/[^/]+/.test(e)?t(`/automations`):/^\/conversations\/[^/]+/.test(e)&&t(`/conversations`)},[e,t])}function De({onConnected:e,testIdRoot:t=`add-backend`,initialManualBackend:n,requireManualApiKey:r=!1,manualSubmitLabel:i,manualSubmittingLabel:a,manualSubmitTestId:s,analyticsSource:c}){let{t:l}=o(`openhands`),u=C();return u?(0,z.jsx)(`div`,{"data-testid":`${t}-connection-options`,className:`flex justify-center`,children:(0,z.jsx)(`div`,{className:`w-full`,children:(0,z.jsx)($,{onConnected:e,testIdRoot:t,lockedHost:u,analyticsSource:c})})}):(0,z.jsxs)(`div`,{"data-testid":`${t}-connection-options`,className:`flex flex-col gap-6 md:flex-row`,children:[(0,z.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,z.jsx)(Oe,{onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:i??l(d.BACKEND$CONNECT),submittingLabel:a??l(d.ONBOARDING$BACKEND_STATUS_CHECKING),submitTestId:s})}),(0,z.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,z.jsx)($,{onConnected:e,testIdRoot:t,analyticsSource:c})})]})}function Oe({onConnected:e,testIdRoot:t,initialBackend:n,requireApiKey:r,submitLabel:i,submittingLabel:a,submitTestId:s,fixedKind:c,showKindSelector:l=!0}){let{t:u}=o(`openhands`),{name:f,setName:p,host:m,setHost:h,apiKey:g,setApiKey:_,connectionError:v,setConnectionError:b,isSubmitting:x,kind:S,setKind:C,canSubmit:w,handleSubmit:T}=Z({initialName:n?.name??``,initialHost:n?.host??``,initialApiKey:n?.apiKey??``,onTestConnection:we,onSuccess:t=>{e({name:f.trim(),host:J(m),apiKey:g.trim(),kind:S},`manual`,t)},requireApiKey:r,fixedKind:c});return(0,z.jsxs)(`form`,{"data-testid":`${t}-form`,onSubmit:T,className:`flex flex-col gap-4 flex-1 min-w-0`,children:[(0,z.jsx)(L,{testId:`${t}-name`,name:`${t}-name`,type:`text`,label:u(d.BACKEND$NAME_LABEL),hint:u(d.BACKEND$NAME_HELPER),value:f,onChange:e=>{p(e),b(null)},placeholder:`e.g. My Server`,className:`w-full`}),(0,z.jsx)(L,{testId:`${t}-host`,name:`${t}-host`,type:`text`,label:u(d.BACKEND$HOST_LABEL),hint:u(d.BACKEND$HOST_HELPER),value:m,onChange:e=>{h(e),b(null)},placeholder:`http://localhost:8000`,className:`w-full`}),l?(0,z.jsxs)(`div`,{className:`flex flex-col items-start gap-2.5`,children:[(0,z.jsx)(`span`,{className:`text-sm`,children:u(d.BACKEND$KIND_LABEL)}),(0,z.jsx)(y,{value:S,options:[{value:`local`,label:u(d.BACKEND$KIND_LOCAL)},{value:`cloud`,label:u(d.BACKEND$KIND_CLOUD)}],onChange:e=>C(e),ariaLabel:u(d.BACKEND$KIND_LABEL),testId:`${t}-kind`})]}):null,(0,z.jsx)(L,{testId:`${t}-api-key`,name:`${t}-api-key`,type:`password`,label:u(d.BACKEND$KEY_LABEL),value:g,onChange:e=>{_(e),b(null)},placeholder:`sk-••••••••••`,className:`w-full`}),v?(0,z.jsx)(`div`,{role:`alert`,"data-testid":`${t}-error`,className:`rounded-md border border-red-500/40 bg-red-500/10 p-3 text-sm text-red-300 whitespace-pre-wrap break-words`,children:v}):null,(0,z.jsx)(F,{type:`submit`,variant:`secondary`,isDisabled:!w||x,testId:s??`${t}-submit`,className:`w-full text-center`,children:x?a:i})]})}function $({onConnected:e,testIdRoot:t,lockedHost:n,analyticsSource:r,showBranding:i=!0}){let{t:a}=o(`openhands`),[s,c]=R.useState(!1),[l,u]=R.useState(``),p=`${t}-advanced-panel`,m=n??(l.trim()||X);return(0,z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-center gap-3`,children:[i?(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,z.jsx)(B,{width:56,height:56,"aria-hidden":!0}),(0,z.jsx)(`h4`,{className:ae,"data-testid":`${t}-cloud-title`,children:a(d.BACKEND$CLOUD_TITLE)})]}):null,(0,z.jsx)(q,{host:m,onSuccess:t=>{e({name:`OpenHands Cloud`,host:J(m),apiKey:t,kind:`cloud`},`cloud_login`)},testIdRoot:t,analyticsSource:r,className:`w-full items-center`,idleDescription:(0,z.jsx)(`p`,{className:`text-center text-sm leading-relaxed text-[var(--oh-muted)]`,"data-testid":`${t}-cloud-description`,children:a(d.BACKEND$CLOUD_DESCRIPTION)}),idleFooter:n?null:(0,z.jsxs)(`div`,{className:`mx-auto w-full max-w-md`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),"aria-expanded":s,"aria-controls":p,"data-testid":`${t}-advanced-toggle`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,z.jsx)(`span`,{children:a(d.BACKEND$ADVANCED)}),(0,z.jsx)(V,{className:f(`h-4 w-4 shrink-0 text-muted transition-transform duration-200 ease-out`,s&&`rotate-180`),"aria-hidden":!0})]}),(0,z.jsx)(`div`,{className:f(`grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,s?`grid-rows-[1fr]`:`grid-rows-[0fr]`),children:(0,z.jsx)(`div`,{className:`overflow-hidden`,children:(0,z.jsxs)(`div`,{id:p,"data-testid":`${t}-advanced-panel`,"aria-hidden":!s,inert:s?void 0:!0,className:f(`pt-3 transition-opacity duration-200 ease-out motion-reduce:transition-none`,s?`opacity-100`:`opacity-0`),children:[(0,z.jsx)(L,{testId:`${t}-cloud-host`,name:`${t}-cloud-host`,type:`text`,label:a(d.BACKEND$HOST_LABEL),value:l,onChange:u,placeholder:X,className:`w-full`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-[var(--oh-muted)]`,children:a(d.BACKEND$LOGIN_CLOUD_HINT)})]})})})]})})]})}function ke({value:e,selectedValue:t,title:n,description:r,icon:i,onSelect:a,panelId:o,testId:s}){let c=e===t;return(0,z.jsxs)(`button`,{id:`${s}-tab`,type:`button`,role:`tab`,"aria-selected":c,"aria-controls":o,"data-testid":s,onClick:()=>a(e),className:f(`relative flex min-h-16 w-full cursor-pointer items-center gap-3 px-3 py-3 text-left transition-colors`,`first:border-r first:border-r-[var(--oh-border)]`,`focus-visible:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-300`,c?`bg-[var(--oh-surface-raised)] text-white after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-primary`:`text-[var(--oh-muted)] hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,z.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center`,"aria-hidden":!0,children:i}),(0,z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:n}),(0,z.jsx)(`span`,{className:`mt-0.5 block text-xs leading-tight text-[var(--oh-muted)]`,children:r})]})]})}function Ae({children:e}){let t=R.useRef(null),[n,r]=R.useState();return R.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=e.getBoundingClientRect().height;r(t>0?t:void 0)};if(n(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[]),(0,z.jsx)(`div`,{"data-testid":`add-backend-panel-height`,style:n===void 0?void 0:{height:n},className:`overflow-hidden transition-[height] duration-300 ease-in-out motion-reduce:transition-none`,children:(0,z.jsx)(`div`,{ref:t,children:e})})}function je({location:e}){let{t}=o(`openhands`),[n,r]=R.useState(!1),i=e===`remote`,a=t(i?d.BACKEND$REMOTE_SETUP_TITLE:d.BACKEND$BEFORE_CONNECT_TITLE),s=t(i?d.BACKEND$REMOTE_SETUP_DESCRIPTION:d.BACKEND$LOCAL_SETUP_DESCRIPTION),c=i?ye:ve,l=t(i?d.BACKEND$REMOTE_SETUP_DOCS:d.BACKEND$LOCAL_SETUP_DOCS),u=i?`add-backend-remote`:`add-backend-local`,p=`${u}-guidance-toggle`,m=`${u}-guidance-body`;return(0,z.jsxs)(`aside`,{"data-testid":`${u}-guidance`,className:`rounded-lg bg-[var(--oh-surface-raised)] text-sm text-[var(--oh-muted)]`,children:[(0,z.jsx)(`h4`,{className:`text-white`,children:(0,z.jsxs)(`button`,{id:p,type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-controls":m,"data-testid":p,className:f(`flex w-full cursor-pointer items-center justify-between gap-2 rounded-lg px-3 py-2 text-left font-medium`,`transition-colors hover:bg-[var(--oh-interactive-hover)]`,`focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-300`),children:[(0,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(S,{className:`size-4 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate`,children:a})]}),(0,z.jsx)(_,{className:f(`size-5 shrink-0 text-[var(--oh-muted)] transition-transform duration-200 ease-out`,n&&`rotate-180`),"aria-hidden":!0})]})}),(0,z.jsx)(`div`,{className:f(`grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,n?`grid-rows-[1fr]`:`grid-rows-[0fr]`),children:(0,z.jsx)(`div`,{className:`overflow-hidden`,children:(0,z.jsxs)(`div`,{id:m,"data-testid":m,role:`region`,"aria-labelledby":p,"aria-hidden":!n,inert:n?void 0:!0,className:f(`flex flex-col gap-2 px-3 pb-3 transition-opacity duration-200 ease-out motion-reduce:transition-none`,n?`opacity-100`:`opacity-0`),children:[(0,z.jsx)(`p`,{className:`leading-5`,children:s}),i?(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h5`,{className:`font-medium text-white`,children:t(d.BACKEND$REMOTE_CONNECTION_TITLE)}),(0,z.jsx)(`p`,{className:`mt-1 leading-5`,children:t(d.BACKEND$REMOTE_CONNECTION_DESCRIPTION)})]}):(0,z.jsx)(`code`,{className:`block break-words font-mono text-xs text-white`,children:_e}),(0,z.jsxs)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,"data-testid":`${u}-docs-link`,tabIndex:n?void 0:-1,className:`inline-flex w-fit items-center gap-1.5 text-primary hover:underline`,children:[(0,z.jsx)(`span`,{children:l}),(0,z.jsx)(H,{className:`size-4 shrink-0`,"aria-hidden":!0})]})]})})})]})}function Me({onConnected:e,source:t}){let{t:n}=o(`openhands`),[r,i]=R.useState(`cloud`),[a,s]=R.useState(`local`),c=`add-backend-selected-panel`,l=`add-backend-option-${r}-tab`,u=r===`cloud`;return(0,z.jsxs)(`div`,{"data-testid":`add-backend-chooser`,className:`flex flex-col`,children:[(0,z.jsxs)(`div`,{role:`tablist`,"aria-label":n(d.BACKEND$CHOOSER_TITLE),className:`grid grid-cols-2 overflow-hidden rounded-lg border border-[var(--oh-border)]`,children:[(0,z.jsx)(ke,{value:`cloud`,selectedValue:r,title:n(d.BACKEND$CLOUD_TITLE),description:n(d.BACKEND$CLOUD_OPTION_DESCRIPTION),icon:(0,z.jsx)(B,{width:32,height:32,"data-testid":`add-backend-option-cloud-logo`}),onSelect:i,panelId:c,testId:`add-backend-option-cloud`}),(0,z.jsx)(ke,{value:`agent-server`,selectedValue:r,title:n(d.BACKEND$AGENT_SERVER_TITLE),description:n(d.BACKEND$AGENT_SERVER_OPTION_DESCRIPTION),icon:(0,z.jsx)(ue,{className:`size-6`}),onSelect:i,panelId:c,testId:`add-backend-option-agent-server`})]}),(0,z.jsx)(`div`,{className:`mt-6`,children:(0,z.jsx)(Ae,{children:(0,z.jsx)(`section`,{id:c,role:`tabpanel`,"aria-labelledby":l,className:`min-w-0`,children:u?(0,z.jsx)(`div`,{"data-testid":`add-backend-cloud-panel`,className:f(`relative isolate flex min-h-[13.5rem] w-full items-center justify-center rounded-xl border border-[var(--oh-border)] px-5 py-6`,`before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-xl`,`before:bg-[radial-gradient(75%_75%_at_50%_50%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_70%)]`),children:(0,z.jsx)($,{onConnected:e,testIdRoot:`add-backend`,analyticsSource:t,showBranding:!1})}):(0,z.jsxs)(`div`,{"data-testid":`add-backend-agent-server-panel`,className:`mx-auto w-full max-w-xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`h-px flex-1 bg-[var(--oh-border)]`,"aria-hidden":!0}),(0,z.jsx)(y,{value:a,options:[{value:`local`,label:n(d.BACKEND$KIND_LOCAL),icon:(0,z.jsx)(se,{"aria-hidden":!0})},{value:`remote`,label:n(d.BACKEND$KIND_REMOTE),icon:(0,z.jsx)(v,{"aria-hidden":!0})}],onChange:s,ariaLabel:n(d.BACKEND$AGENT_SERVER_LOCATION),testId:`add-backend-location`}),(0,z.jsx)(`span`,{className:`h-px flex-1 bg-[var(--oh-border)]`,"aria-hidden":!0})]}),(0,z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4`,children:[(0,z.jsx)(je,{location:a},a),(0,z.jsx)(Oe,{onConnected:e,testIdRoot:`add-backend`,requireApiKey:a===`remote`,submitLabel:n(d.BACKEND$CONNECT),submittingLabel:n(d.ONBOARDING$BACKEND_STATUS_CHECKING),fixedKind:`local`,showKindSelector:!1})]})]})})})})]})}function Ne({onClose:e,source:t}){let{addBackend:n}=c(),r=Ee(),{trackBackendAdded:i}=N(),a=C(),o=R.useCallback((a,o,s)=>{n(a),i({backendKind:a.kind,connectionMethod:o,hasApiKey:!!a.apiKey,source:t,agentServerVersion:s?.agentServerVersion}),r(),e()},[n,r,e,i,t]);return a?(0,z.jsx)($,{onConnected:o,testIdRoot:`add-backend`,lockedHost:a,analyticsSource:t}):(0,z.jsx)(Me,{onConnected:o,source:t})}function Pe({mode:e,backend:t,onClose:n,source:r=`add_backend_modal`,hideCloseButton:i=!1}){let{t:a}=o(`openhands`);if(e===`add`)return(0,z.jsx)(P,{onClose:i?void 0:n,closeOnEscape:!1,closeOnBackdropClick:!i,"aria-label":a(d.BACKEND$ADD_TITLE),children:(0,z.jsxs)(`div`,{"data-testid":i?`onboarding-modal`:`add-backend-modal`,className:f(`relative max-h-[92vh] w-[720px] overflow-y-auto rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,re),children:[i?null:(0,z.jsx)(I,{onClose:n,testId:`add-backend-close`}),i?null:(0,z.jsxs)(`div`,{className:`pr-8`,children:[(0,z.jsx)(`h2`,{className:ie,children:a(d.BACKEND$CHOOSER_TITLE)}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm leading-6 text-[var(--oh-muted)]`,"data-testid":`add-backend-description`,children:[a(d.BACKEND$CHOOSER_DESCRIPTION),` `,(0,z.jsxs)(`a`,{href:be,target:`_blank`,rel:`noopener noreferrer`,"aria-label":a(d.BACKEND$DEPLOYMENT_OPTIONS),"data-testid":`add-backend-deployment-options-link`,className:`text-primary hover:underline`,children:[a(d.CTA$LEARN_MORE),(0,z.jsx)(H,{className:`ml-1 inline size-3.5 align-[-0.125em]`,"aria-hidden":!0})]})]})]}),(0,z.jsx)(`div`,{className:i?void 0:`mt-5`,children:(0,z.jsx)(Ne,{onClose:n,source:r})})]})});let s=`edit-backend`;return(0,z.jsx)(P,{onClose:n,closeOnEscape:!1,"aria-label":a(d.BACKEND$EDIT_TITLE),children:(0,z.jsxs)(`div`,{"data-testid":`${s}-modal`,className:f(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)]`,ne(`md`)),children:[(0,z.jsx)(I,{onClose:n,testId:`${s}-close`}),(0,z.jsx)(`h2`,{className:f(`pr-6`,ie),children:a(d.BACKEND$EDIT_TITLE)}),(0,z.jsx)(Q,{mode:`edit`,backend:t,onSubmitted:n,testIdRoot:s})]})})}export{q as a,V as c,me as i,Q as n,W as o,Pe as r,U as s,De as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-B_nweu5p.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-B_nweu5p.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{ct as i,st as a}from"./active-backend-context-BnH4-L8h.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{_ as c,g as l,h as u,m as d,p as f,v as p}from"./kebab-menu-item-content-SCJBwZnp.js";import{A as m,T as h}from"./use-tracking-j4uo9VEW.js";import{r as g}from"./modal-classes-B0b9eiL8.js";import{f as ee,l as _}from"./form-control-classes-Dbq-7YP_.js";import{t as v}from"./brand-button-CUMfjb99.js";import{t as y}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as b}from"./settings-input-dVuzapBA.js";import{t as x}from"./use-llm-profiles-SWsuFmFu.js";import{s as S}from"./use-automations-Bq5hVuv0.js";import{n as C}from"./api-error-message-BXo0lCI5.js";import{t as w}from"./x-mark-BopmFoBq.js";import{t as T}from"./use-manifest-capabilities-CdqYfUAC.js";var E=e(t(),1);function D(e,t){let n=e.trim();if(!n)return{value:null};let r=Number(n);return Number.isInteger(r)?r<=0?{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_POSITIVE}:t!==void 0&&r>t?{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_MAX_EXCEEDED}:{value:r}:{errorKey:o.AUTOMATIONS$ERROR_TIMEOUT_INVALID_NUMBER}}var O=n(),k=`__active__`,A=[o.AUTOMATIONS$WEEKDAY_SUN,o.AUTOMATIONS$WEEKDAY_MON,o.AUTOMATIONS$WEEKDAY_TUE,o.AUTOMATIONS$WEEKDAY_WED,o.AUTOMATIONS$WEEKDAY_THU,o.AUTOMATIONS$WEEKDAY_FRI,o.AUTOMATIONS$WEEKDAY_SAT];function j(e){let t=e.timeout==null?``:String(e.timeout);if(e.trigger.type===`event`)return{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:``,isCustomSchedule:!0,rawSchedule:``,timeout:t};let n=l(e.trigger.schedule);return n.kind===`custom`?{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:`custom`,weekday:1,timeOfDay:n.hour!==void 0&&n.minute!==void 0?u(n.hour,n.minute):``,isCustomSchedule:!0,rawSchedule:n.raw,timeout:t}:{name:e.name,prompt:e.prompt??``,model:e.model??``,frequency:n.kind,weekday:n.kind===`weekly`?n.weekday??1:1,timeOfDay:u(n.hour,n.minute),isCustomSchedule:!1,rawSchedule:e.trigger.schedule??``,timeout:t}}function M({automation:e,isOpen:t,onClose:n}){let{t:l}=r(`openhands`),u=S(),M=m().editTitle,N=h(`name`),P=h(`prompt`),F=h(`model`),I=h(`timeout`),L=h(`schedule`),{data:R}=T(),z=R?.maxAutomationTimeoutSeconds,B=z===void 0?void 0:Math.min(z,I.max??z),{data:V,isLoading:H}=x(),U=V?.profiles??[],W=[{key:k,label:l(o.COMMON$ACTIVE_PROFILE)},...U.map(e=>({key:e.name,label:e.name}))],G=(0,E.useMemo)(()=>j(e),[e]),[K,q]=(0,E.useState)(G),[J,Y]=(0,E.useState)(null),[X,Z]=(0,E.useState)(null),[Q,$]=(0,E.useState)(null);if((0,E.useEffect)(()=>{t&&(q(G),Y(null),Z(null),$(null))},[t,G]),!t)return null;let te=[{key:`daily`,label:l(o.AUTOMATIONS$FREQUENCY_DAILY)},{key:`weekdays`,label:l(o.AUTOMATIONS$FREQUENCY_WEEKDAYS)},{key:`weekly`,label:l(o.AUTOMATIONS$FREQUENCY_WEEKLY)},...K.isCustomSchedule?[{key:`custom`,label:l(o.AUTOMATIONS$FREQUENCY_CUSTOM)}]:[]],ne=A.map((e,t)=>({key:String(t),label:l(e)}));return(0,O.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,O.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`presentation`}),(0,O.jsxs)(`div`,{className:`relative w-full max-w-md rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,O.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":l(o.AUTOMATIONS$CANCEL),children:(0,O.jsx)(w,{className:`size-5`})}),(0,O.jsx)(`h2`,{className:g,children:M}),(0,O.jsxs)(`form`,{onSubmit:t=>{t.preventDefault();let r=K.name.trim();if(!r){Y(l(o.AUTOMATIONS$NAME_REQUIRED));return}Y(null);let s=D(K.timeout,B);if(`errorKey`in s){Z(l(s.errorKey,{max:B}));return}Z(null);let d={};r!==e.name&&(d.name=r);let m=K.prompt.trim();m!==(e.prompt??``).trim()&&(d.prompt=m.length===0?null:m);let h=K.model.trim();if(h!==(e.model??``)&&(d.model=h===``?null:h),(s.value??null)!==(e.timeout??null)&&(d.timeout=s.value),e.trigger.type!==`event`&&K.isCustomSchedule){if(K.rawSchedule.trim()!==(e.trigger.schedule??``).trim()){let t=p(K.rawSchedule);if(`errorKey`in t){$(l(t.errorKey));return}d.trigger={...e.trigger,schedule:t.schedule}}$(null)}else if(!K.isCustomSchedule&&K.frequency!==`custom`){let t=c(K.timeOfDay);if(t){let n=f({kind:K.frequency,hour:t.hour,minute:t.minute,weekday:K.frequency===`weekly`?K.weekday:void 0});n!==e.trigger.schedule&&(d.trigger={...e.trigger,schedule:n})}}if(Object.keys(d).length===0){n();return}u.mutate({id:e.id,body:d},{onSuccess:()=>{i(l(o.AUTOMATIONS$EDIT_SUCCESS)),n()},onError:e=>{a(C(e,l(o.AUTOMATIONS$EDIT_ERROR)))}})},noValidate:!0,className:`mt-4 flex flex-col gap-4`,"aria-label":M,children:[N.present&&(0,O.jsx)(b,{testId:`edit-automation-name`,name:`name`,type:`text`,label:N.label,value:K.name,onChange:e=>q(t=>({...t,name:e})),error:J??void 0,showRequiredTag:N.required}),P.present&&(0,O.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,O.jsx)(`span`,{className:`text-sm`,children:P.label}),(0,O.jsx)(`textarea`,{"data-testid":`edit-automation-prompt`,name:`prompt`,value:K.prompt,onChange:e=>q(t=>({...t,prompt:e.target.value})),rows:4,className:s(_,`placeholder:italic`)}),P.help!==null&&(0,O.jsx)(`span`,{className:`text-xs text-muted`,children:P.help})]}),F.present&&(H||U.length>0)&&(0,O.jsx)(y,{testId:`edit-automation-model`,name:`model`,label:F.label,items:W,selectedKey:K.model||k,isLoading:H,placeholder:l(o.COMMON$ACTIVE_PROFILE),onSelectionChange:e=>q(t=>({...t,model:e&&e!==k?String(e):``}))}),I.present&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,O.jsx)(b,{testId:`edit-automation-timeout`,name:`timeout`,type:`number`,label:I.label,value:K.timeout,onChange:e=>q(t=>({...t,timeout:e})),error:X??void 0,showOptionalTag:!0,min:I.min??1,max:B,step:1,placeholder:`600`}),I.help!==null&&(0,O.jsx)(`span`,{"data-testid":`edit-automation-timeout-hint`,className:`text-xs text-muted`,children:I.help})]}),e.trigger.type===`event`?(0,O.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg bg-[var(--oh-surface-raised)] p-3`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:l(o.AUTOMATIONS$DETAIL$TRIGGER)}),(0,O.jsx)(`span`,{className:`text-sm text-content`,children:l(o.AUTOMATIONS$DETAIL$TRIGGER_EVENT)})]}),e.trigger.source&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:l(o.AUTOMATIONS$DETAIL$EVENT_SOURCE)}),(0,O.jsx)(`span`,{className:`text-sm text-content`,children:e.trigger.source})]}),e.trigger.on&&(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:l(o.AUTOMATIONS$DETAIL$EVENT_TYPE)}),(0,O.jsx)(`code`,{className:`text-xs font-mono text-content`,children:d(e.trigger.on)})]}),e.trigger.filter&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:l(o.AUTOMATIONS$DETAIL$EVENT_FILTER)}),(0,O.jsx)(`code`,{className:`text-xs font-mono text-content break-all`,children:e.trigger.filter})]})]}):L.present?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(y,{testId:`edit-automation-frequency`,name:`frequency`,label:L.label,items:te,selectedKey:K.frequency,isDisabled:K.isCustomSchedule,onSelectionChange:e=>{!e||K.isCustomSchedule||q(t=>({...t,frequency:e}))}}),K.frequency===`weekly`&&!K.isCustomSchedule&&(0,O.jsx)(y,{testId:`edit-automation-weekday`,name:`weekday`,label:l(o.AUTOMATIONS$WEEKDAY),items:ne,selectedKey:String(K.weekday),onSelectionChange:e=>{e!==null&&q(t=>({...t,weekday:Number(e)}))}}),(0,O.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,O.jsx)(`span`,{className:`text-sm`,children:l(o.AUTOMATIONS$TIME_OF_DAY)}),(0,O.jsx)(`input`,{"data-testid":`edit-automation-time`,name:`timeOfDay`,type:`time`,value:K.timeOfDay,onChange:e=>q(t=>({...t,timeOfDay:e.target.value})),disabled:K.isCustomSchedule,className:s(ee,`disabled:bg-[var(--oh-surface-raised)]`)}),e.timezone&&(0,O.jsxs)(`span`,{className:`text-xs text-muted`,children:[l(o.AUTOMATIONS$TIMEZONE),`: `,e.timezone]})]}),K.isCustomSchedule&&(0,O.jsx)(b,{testId:`edit-automation-cron`,name:`cron`,type:`text`,label:l(o.AUTOMATIONS$CRON_EXPRESSION),value:K.rawSchedule,onChange:e=>q(t=>({...t,rawSchedule:e})),error:Q??void 0,placeholder:`*/10 * * * *`})]}):null,(0,O.jsxs)(`div`,{className:`mt-2 flex justify-end gap-3`,children:[(0,O.jsx)(v,{testId:`edit-automation-cancel`,type:`button`,variant:`secondary`,onClick:n,isDisabled:u.isPending,children:l(o.AUTOMATIONS$CANCEL)}),(0,O.jsx)(v,{testId:`edit-automation-save`,type:`submit`,variant:`primary`,isDisabled:u.isPending,"aria-busy":u.isPending,children:u.isPending?l(o.AUTOMATIONS$SAVING):l(o.AUTOMATIONS$SAVE)})]})]})]})]})}export{M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{n as a,t as o}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as s}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{n as l}from"./active-backend-context-BnH4-L8h.js";import{K as u,t as d}from"./utils-BgLSZdyy.js";import{b as f,i as p,n as m,o as h,r as g,s as _,u as v}from"./kebab-menu-item-content-SCJBwZnp.js";import{C as y,D as b,E as x,F as S,S as C,a as w,b as T,d as ee,i as te,n as ne,o as E,p as D,r as O,s as k,t as A,v as j,w as M,x as N,y as P}from"./home-automation-run-tooltip-B1N2uO9p.js";import{r as F}from"./context-menu-list-item-Cm7-7Y-7.js";import{E as I,U as re,t as L}from"./use-tracking-j4uo9VEW.js";import{t as R}from"./modal-backdrop-BSzNhM4r.js";import{n as z}from"./modal-classes-B0b9eiL8.js";import{t as B}from"./brand-button-CUMfjb99.js";import{n as V}from"./navigation-context-CQZwH_tC.js";import{t as H}from"./navigation-link-Bxo3-4vo.js";import{t as U}from"./styled-tooltip-CejG0rqv.js";import{t as W}from"./modal-close-button-DfqfB2Nj.js";import{t as G}from"./u-edit-DAkcF52u.js";import{n as K}from"./use-automation-health-U99vvHxx.js";import{a as q,i as J,n as Y,o as X,r as ie,t as Z}from"./extension-module-card-classes-DpeaYhYo.js";import{n as ae}from"./skill-card-pill-row-DfjIfj0K.js";import{n as oe,t as se}from"./use-automation-permissions-Buus0R6h.js";import{n as ce,r as le,t as ue}from"./trash-Ckh7yCaB.js";import{n as de,t as fe}from"./use-launch-skill-in-chat-QbXDhiHr.js";var pe=i(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Q=r();function me(){return(0,Q.jsxs)(`div`,{"data-testid":`automation-card-skeleton`,className:`${q} border border-transparent p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Q.jsx)(`div`,{className:`h-5 w-40 animate-pulse rounded bg-surface-raised`}),(0,Q.jsx)(`div`,{className:`size-8 animate-pulse rounded-md bg-surface-raised`})]}),(0,Q.jsx)(`div`,{className:`mt-2 h-4 w-72 animate-pulse rounded bg-surface-raised`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Q.jsx)(`div`,{className:`h-5 w-20 animate-pulse rounded-full bg-surface-raised`}),(0,Q.jsx)(`div`,{className:`h-5 w-24 animate-pulse rounded bg-surface-raised`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Q.jsx)(`div`,{className:`h-7 w-32 animate-pulse rounded-full bg-surface-raised`}),(0,Q.jsx)(`div`,{className:`h-7 w-28 animate-pulse rounded-full bg-surface-raised`}),(0,Q.jsx)(`div`,{className:`h-7 w-24 animate-pulse rounded-full bg-surface-raised`})]}),(0,Q.jsx)(`div`,{className:`mt-3 h-9 animate-pulse rounded-md bg-surface-raised`})]})}var he=e(t(),1);function ge({automation:e,t,canManage:n,canToggle:r,onRunNow:i,isRunPending:a,onView:o,onExport:s,onEdit:c,onToggle:l,onDelete:d}){return[...n?[{label:t(u.AUTOMATIONS$RUN_NOW),icon:(0,Q.jsx)(g,{className:`size-4`}),onClick:()=>i(e.id),disabled:a||!e.enabled}]:[],{label:t(u.COMMON$VIEW),icon:(0,Q.jsx)(S,{className:`size-4`,"aria-hidden":!0}),onClick:o},{label:t(u.AUTOMATIONS$EXPORT),icon:(0,Q.jsx)(pe,{className:`size-4`,"aria-hidden":!0}),onClick:()=>s(e)},...n&&c?[{label:t(u.AUTOMATIONS$EDIT),icon:(0,Q.jsx)(G,{className:`size-4`}),onClick:()=>c(e.id)}]:[],...r?[{label:e.enabled?t(u.AUTOMATIONS$TURN_OFF):t(u.AUTOMATIONS$TURN_ON),icon:(0,Q.jsx)(m,{className:`size-4`}),onClick:()=>l(e.id,e.enabled)}]:[],...n?[{label:t(u.AUTOMATIONS$DELETE),icon:(0,Q.jsx)(ue,{className:`size-4`}),onClick:()=>d(e.id)}]:[]]}function _e({automation:e,onToggle:t,onRunNow:r,isRunPending:i=!1,onDelete:a,onExport:o,onEdit:s,insights:l}){let{navigate:m}=V(),{t:y,i18n:S}=c(`openhands`),{canManage:C}=se(),w=oe(e),T=C||w,ne=e.enabled?T:w,E=e.trigger.schedule_human||e.trigger.type,O=(0,he.useMemo)(()=>j(e,E),[e,E]),A=()=>{m?.(`/automations/${e.id}`)},M=ge({automation:e,t:y,canManage:T,canToggle:ne,onRunNow:r,isRunPending:i,onView:A,onExport:o,onEdit:s,onToggle:t,onDelete:a}),P=ee(l?.state),F=re(e,l?.state?.summary?.completedTotal??null),{latestRun:I,recentRuns:L,isLoading:R,isError:z}=P,B=I?N(I):null,H=I?f(I):null,W=H?.summary??null,G=W?x(W):null,K=W!=null&&G!=null&&b(W,G),J=_(I?.status);return(0,Q.jsxs)(`div`,{role:`link`,tabIndex:0,"data-testid":`automation-card-${e.id}`,onClick:A,onKeyDown:e=>{e.key===`Enter`&&A()},className:d(`group relative flex min-w-0 flex-col overflow-hidden p-4 text-left`,q,ie),children:[(0,Q.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`div`,{className:`flex h-8 items-center justify-between gap-3`,children:[(0,Q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-semibold leading-none text-[var(--oh-foreground)]`,children:e.name}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[T?(0,Q.jsx)(U,{content:y(u.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,Q.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":y(u.AUTOMATIONS$RUN_NOW),"aria-busy":i,disabled:i||!e.enabled,onClick:t=>{t.stopPropagation(),r(e.id)},className:le,children:(0,Q.jsx)(g,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,Q.jsx)(ce,{items:M,triggerClassName:`opacity-70 group-hover:opacity-100`})]})]}),e.prompt?(0,Q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-[var(--oh-text-secondary)]`,children:e.prompt}):null]}),O.length>0||L.length>0?(0,Q.jsxs)(`div`,{className:d(`mt-3 flex items-center gap-3`,O.length>0?`justify-between`:`justify-end`),children:[O.length>0?(0,Q.jsx)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:(0,Q.jsx)(ae,{pills:O,testId:`automation-pills-${e.id}`})}):null,L.length>0?(0,Q.jsx)(te,{automationId:e.id,runs:L,testId:`automation-activity-${e.id}`}):null]}):null,l?(0,Q.jsxs)(`div`,{className:k,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[R?(0,Q.jsx)(`div`,{className:`h-3.5 w-3/4 animate-pulse rounded bg-surface-raised motion-reduce:animate-none`,"aria-hidden":`true`}):null,!R&&z?(0,Q.jsx)(`p`,{className:`truncate text-[var(--oh-text-secondary)]`,children:y(u.FEATURED_AUTOMATIONS$STATUS_UNAVAILABLE)}):null,!R&&!z&&!I?(0,Q.jsx)(`p`,{className:`truncate text-[var(--oh-text-secondary)]`,children:y(u.AUTOMATIONS$DETAIL$NO_RUNS)}):null,I?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(p,{status:H?.badgeStatus??I.status,iconOnly:!0,showLabel:!0}),J?(0,Q.jsx)(h,{status:I.status,code:I.phase_code,label:I.phase_label,updatedAt:I.phase_updated_at}):null,G?K&&W?(0,Q.jsx)(n,{content:(0,Q.jsx)(`p`,{className:`max-w-xs whitespace-pre-wrap break-words p-2 text-xs`,children:W}),placement:`top`,closeDelay:100,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 cursor-default truncate text-[var(--oh-text-secondary)]`,children:G})}):(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[var(--oh-text-secondary)]`,children:G}):null]}):null]}),B?(0,Q.jsx)(`span`,{"data-testid":`automation-last-run-${e.id}`,className:`shrink-0 text-[var(--oh-text-secondary)]`,children:v(B,S.language,y)}):null]}):null,F?(0,Q.jsx)(`p`,{"data-testid":`automation-impact-${e.id}`,className:`mt-3 truncate text-xs text-[var(--oh-text-secondary)]`,children:F}):null,l?(0,Q.jsx)(`div`,{className:`mt-3`,children:(0,Q.jsx)(D,{state:l.state,copy:l.spec.stats})}):null]})}function ve({automation:e,onToggle:t,onRunNow:r,isRunPending:i=!1,onDelete:a,onExport:o,onEdit:s,insights:l}){let{navigate:m}=V(),{t:h,i18n:_}=c(`openhands`),{canManage:b}=se(),x=oe(e),S=b||x,w=ge({automation:e,t:h,canManage:S,canToggle:e.enabled?S:x,onRunNow:r,isRunPending:i,onView:()=>{m?.(`/automations/${e.id}`)},onExport:o,onEdit:s,onToggle:t,onDelete:a}),D=e.trigger.type===`event`?F:K,k=C(e),j=y(e),I=M(e),L=!!(k||j||I),R=ee(l?.state),z=P(R),B=re(e,l?.state?.summary?.completedTotal??null),W=R.latestRun,G=W?f(W):null,q=W?N(W):e.last_triggered_at,Y=q?v(q,_.language,h):null,X=L||!!Y||!!W?.status,ie=`/automations/${encodeURIComponent(e.id)}`,Z=ne(R);return(0,Q.jsxs)(`li`,{"data-testid":`automation-list-row-${e.id}`,className:E,children:[(0,Q.jsx)(n,{content:(0,Q.jsx)(A,{automation:e,runState:R}),placement:`top-start`,closeDelay:100,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,Q.jsx)(H,{to:ie,"aria-label":`${e.name} ${h(Z)}`,className:`flex min-w-0 flex-1 items-center justify-between gap-3 px-3 py-2.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--oh-focus)]`,children:(0,Q.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)] gap-x-2`,children:[(0,Q.jsx)(`span`,{"data-testid":`automation-health-${e.id}`,className:`inline-flex h-5 w-2.5 shrink-0 items-center justify-center`,children:(0,Q.jsx)(O,{health:z})}),(0,Q.jsx)(`span`,{className:`truncate text-sm font-medium leading-5 text-[var(--oh-foreground)]`,children:e.name}),X?(0,Q.jsxs)(`span`,{className:`col-start-2 mt-0.5 flex min-w-0 items-center gap-1.5 text-xs leading-4 text-[var(--oh-text-secondary)]`,children:[(0,Q.jsx)(D,{className:`size-3 shrink-0`,"aria-hidden":`true`}),k?(0,Q.jsx)(`span`,{className:`truncate`,children:k}):null,j?(0,Q.jsx)(`span`,{className:`truncate`,children:j}):null,I?(0,Q.jsx)(`span`,{className:d(J,`shrink-0 px-1.5 py-0 text-[var(--oh-text-secondary)]`),children:T(I)}):null,Y?(0,Q.jsxs)(Q.Fragment,{children:[L?(0,Q.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:`·`}):null,(0,Q.jsx)(`span`,{"data-testid":`automation-last-run-${e.id}`,className:`truncate`,children:Y})]}):null,W?(0,Q.jsxs)(Q.Fragment,{children:[L||Y?(0,Q.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:`·`}):null,(0,Q.jsx)(p,{status:G?.badgeStatus??W.status,compact:!0})]}):null,B?(0,Q.jsxs)(Q.Fragment,{children:[L||Y||W?(0,Q.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:`·`}):null,(0,Q.jsx)(`span`,{"data-testid":`automation-impact-${e.id}`,className:`truncate`,children:B})]}):null]}):null,(0,Q.jsx)(`span`,{className:`sr-only`,children:h(Z)})]})})}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 pr-1.5`,children:[l?(0,Q.jsx)(te,{automationId:e.id,runs:R.recentRuns,testId:`automation-activity-${e.id}`}):null,S?(0,Q.jsx)(U,{content:h(u.AUTOMATIONS$RUN_NOW),placement:`top`,children:(0,Q.jsx)(`button`,{type:`button`,"data-testid":`automation-run-now-${e.id}`,"aria-label":h(u.AUTOMATIONS$RUN_NOW),"aria-busy":i,disabled:i||!e.enabled,onClick:t=>{t.stopPropagation(),r(e.id)},className:le,children:(0,Q.jsx)(g,{className:`size-4 shrink-0`,"aria-hidden":!0})})}):null,(0,Q.jsx)(ce,{items:w,triggerClassName:`opacity-70 group-hover:opacity-100`})]})]})}function ye({title:e,count:t,automations:n,view:r,onToggle:i,onRunNow:o,runPendingId:s=null,onDelete:c,onExport:l,onEdit:u,insights:f}){return n.length===0?null:(0,Q.jsxs)(`section`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center`,children:[(0,Q.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e}),(0,Q.jsx)(a,{count:t})]}),r===`grid`?(0,Q.jsx)(`div`,{className:d(`mt-3`,Y),children:(0,Q.jsx)(`div`,{className:Z,children:n.map(e=>(0,Q.jsx)(_e,{automation:e,onToggle:i,onRunNow:o,isRunPending:s===e.id,onDelete:c,onExport:l,onEdit:u,insights:f&&{spec:f.spec,state:f.byId.get(e.id)}},e.id))})}):(0,Q.jsx)(`ul`,{className:d(w,`mt-3`),children:n.map(e=>(0,Q.jsx)(ve,{automation:e,onToggle:i,onRunNow:o,isRunPending:s===e.id,onDelete:c,onExport:l,onEdit:u,insights:f&&{spec:f.spec,state:f.byId.get(e.id)}},e.id))})]})}var be=e=>(0,Q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Q.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m19.5 8.25-7.5 7.5-7.5-7.5`})});function xe({children:e}){return(0,Q.jsx)(`span`,{className:`whitespace-nowrap`,children:e})}function Se({children:e}){return(0,Q.jsx)(`code`,{"data-testid":`automations-create-instructions-example`,className:d(`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 Ce({children:e}){return(0,Q.jsx)(Q.Fragment,{children:e})}var we={example:(0,Q.jsx)(xe,{}),cmd:(0,Q.jsx)(Se,{}),punct:(0,Q.jsx)(Ce,{})};function $({onLaunch:e}={}){let{t}=c(`openhands`),n=fe(),r=l(),{trackAutomationCreatedButton:i}=L();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`p`,{className:`text-sm leading-relaxed text-tertiary-light`,children:[(0,Q.jsx)(s,{ns:`openhands`,i18nKey:u.AUTOMATIONS$EMPTY_OPTION_CONVERSATION_DESC,components:we}),` `,t(u.AUTOMATIONS$CREATE_INSTRUCTIONS_GUIDANCE),` `,(0,Q.jsx)(`a`,{href:I(),target:`_blank`,rel:`noopener noreferrer`,className:`text-muted underline transition-colors hover:text-foreground`,children:t(u.AUTOMATIONS$EMPTY_LEARN_MORE)})]}),(0,Q.jsx)(`div`,{className:`flex justify-center`,children:(0,Q.jsx)(B,{type:`button`,variant:`primary`,testId:`automations-create-automation`,onClick:()=>{i({backendKind:r.backend.kind}),n(t(u.AUTOMATIONS$CREATE_AUTOMATION_PROMPT),e)},startContent:(0,Q.jsx)(de,{className:`size-4`,"aria-hidden":!0}),children:t(u.AUTOMATIONS$CREATE_AUTOMATION_BUTTON)})})]})}function Te({collapsible:e=!1}){let{t}=c(`openhands`),[n,r]=(0,he.useState)(!e);return e?(0,Q.jsxs)(`div`,{className:`w-full rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,Q.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,Q.jsx)(`span`,{className:`text-sm font-normal text-content`,children:t(u.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)}),(0,Q.jsx)(be,{className:d(`size-5 text-muted transition-transform`,n&&`rotate-180`)})]}),n?(0,Q.jsx)(`div`,{className:`px-4 pb-4`,children:(0,Q.jsx)($,{})}):null]}):(0,Q.jsx)(`div`,{className:`w-full max-w-2xl`,children:(0,Q.jsx)($,{})})}function Ee({isOpen:e,onClose:t}){let{t:n}=c(`openhands`);return e?(0,Q.jsx)(R,{onClose:t,"aria-label":n(u.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE),children:(0,Q.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,Q.jsx)(W,{onClose:t,testId:`add-automation-modal-close`}),(0,Q.jsx)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:(0,Q.jsx)(`h2`,{id:`add-automation-modal-title`,className:d(`pr-6`,z),children:n(u.AUTOMATIONS$EMPTY_HOW_TO_CREATE_TITLE)})}),(0,Q.jsx)(`div`,{className:`px-6 pb-6`,children:(0,Q.jsx)($,{onLaunch:t})})]})}):null}function De(){let{t:e}=c(`openhands`);return(0,Q.jsxs)(`div`,{"data-testid":`automations-empty`,className:X,children:[(0,Q.jsx)(`p`,{className:`text-sm text-white`,children:e(u.AUTOMATIONS$EMPTY)}),(0,Q.jsx)(`div`,{className:`mt-4 flex justify-center`,children:(0,Q.jsx)(Te,{})}),(0,Q.jsx)(`div`,{className:`mt-8 w-full text-left`,children:(0,Q.jsx)(o,{className:`pb-0`,variant:`rail`})})]})}export{me as i,Ee as n,ye as r,De as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./git-repo-dropdown-uxlFw2gn.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./home-Ivfm7KC4.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,i as r,yt as i}from"./vendor-styling-Ck5D_A2Q.js";import{F as a,U as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{i as s,n as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{i as l,r as u,t as d}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as f}from"./useTranslation-CCgUjPJF.js";import{n as p,ot as m,st as h}from"./active-backend-context-BnH4-L8h.js";import{K as g,t as _}from"./utils-BgLSZdyy.js";import{t as v}from"./chevron-down-Cr6Fn_wS.js";import{b as y,i as b,n as x,o as S,r as C,s as w,t as T,u as E}from"./kebab-menu-item-content-SCJBwZnp.js";import{t as D}from"./external-link-Bd7Tga-1.js";import{A as O,C as k,D as A,E as j,F as M,M as N,N as P,O as F,S as I,T as L,a as R,b as z,f as B,i as V,j as ee,k as H,n as te,o as U,p as ne,r as W,s as re,t as ie,u as ae,v as oe,w as se,x as ce,y as le}from"./home-automation-run-tooltip-B1N2uO9p.js";import{n as ue,t as de}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{a as fe,c as pe,d as me,f as he,i as ge,l as _e,n as ve,o as ye,p as be,r as xe,s as Se,t as Ce,u as we}from"./onboarding-DXFBRqEy.js";import{t as Te}from"./pin-BdroVQdN.js";import{t as Ee}from"./plus-C2e21TFC.js";import{n as De,t as Oe}from"./x-CX8lVGwm.js";import{n as ke,r as Ae,t as je}from"./context-menu-list-item-Cm7-7Y-7.js";import{D as Me}from"./use-tracking-j4uo9VEW.js";import{t as Ne}from"./modal-backdrop-BSzNhM4r.js";import{n as Pe,r as Fe,t as Ie}from"./modal-body-C24WsdFb.js";import{r as Le}from"./base-modal-C1a0TsSx.js";import{r as Re}from"./modal-classes-B0b9eiL8.js";import{_ as ze,i as Be,m as Ve,s as He}from"./form-control-classes-Dbq-7YP_.js";import{t as Ue}from"./brand-button-CUMfjb99.js";import{n as We}from"./navigation-context-CQZwH_tC.js";import{t as G}from"./navigation-link-Bxo3-4vo.js";import{t as Ge}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js";import{t as Ke}from"./styled-tooltip-CejG0rqv.js";import{i as qe,n as Je,o as Ye,u as Xe}from"./dropdown-classes-BGvOvW2_.js";import{t as Ze}from"./use-llm-configured-Dl4zg8ht.js";import{t as Qe}from"./conversation-store-DC-JlJuq.js";import{t as $e}from"./modal-close-button-DfqfB2Nj.js";import{o as et}from"./conversation-state-store-9D_3P7q4.js";import{t as tt}from"./use-click-outside-element-W6Os4Nlb.js";import{n as nt}from"./use-create-conversation-i_PdFdIs.js";import{n as rt}from"./use-can-manage-org-profiles-MzIeEV8F.js";import{t as it}from"./u-edit-DAkcF52u.js";import{c as at,s as ot,t as st}from"./home-store-DCbei3DX.js";import{t as ct}from"./folder-C1ou4_DT.js";import{n as lt,t as ut}from"./use-automation-health-U99vvHxx.js";import{t as K}from"./automation-C_eCrGyP.js";import{t as dt}from"./use-automations-Bq5hVuv0.js";import{t as ft}from"./use-user-conversation-5UFqMoO4.js";import{r as q}from"./typography-DgcLGdHk.js";import{a as pt,i as mt,n as ht,r as gt,t as _t}from"./extension-module-card-classes-DpeaYhYo.js";import{n as vt}from"./skill-card-pill-row-DfjIfj0K.js";import{n as yt}from"./circle-plus-check-toggle-BDX_ctNs.js";import{t as bt}from"./x-mark-BopmFoBq.js";import{H as xt,K as St,V as Ct,a as wt,c as Tt,i as Et,k as Dt,n as Ot,o as kt,q as At,r as jt,s as Mt,t as Nt,z as Pt}from"./llm-not-configured-banner-Dh_ajcM8.js";import{T as Ft}from"./markdown-renderer-DyFl9-mL.js";import{t as It}from"./use-plugins-marketplace-BIIaPiaB.js";import{t as Lt}from"./edit-automation-modal-D_JWSmxT.js";import{a as Rt,i as zt,o as Bt,r as Vt,s as Ht,t as Ut}from"./git-repo-dropdown-uxlFw2gn.js";import"./git-repo-dropdown-BoDDWXfX.js";var Wt=s(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),J=e(t(),1);async function Gt(e){let{imagesToEmbed:t}=At(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>Ct(e)));Ft.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Kt=`local_repo`,qt=`openhands-last-local-workspace-mode`;function Jt(e){return e===`local_repo`||e===`new_worktree`}function Yt(){if(typeof window>`u`)return Kt;try{let e=window.localStorage.getItem(qt);return Jt(e)?e:Kt}catch{return Kt}}function Xt(e){if(!(typeof window>`u`))try{window.localStorage.setItem(qt,e)}catch{}}function Zt(e,t){return e===`new_worktree`?g.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?g.COMMON$WORKSPACE_MODE_CLOUD_REPO:g.COMMON$WORKSPACE_MODE_LOCAL_REPO}var Y=i();function Qt({plugin:e,isSelected:t,isDisabled:n=!1,onToggle:r}){return(0,Y.jsxs)(`div`,{"data-testid":`plugin-picker-card-${e.name}`,className:_(`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-tertiary p-4`),children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`h3`,{"data-testid":`plugin-picker-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Y.jsx)(`p`,{className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),e.description?(0,Y.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-tertiary-light`,children:e.description}):null,e.repo_path||e.ref?(0,Y.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.repo_path?(0,Y.jsx)(`span`,{className:mt,children:e.repo_path}):null,e.ref?(0,Y.jsxs)(`span`,{className:mt,children:[`@`,e.ref]}):null]}):null]}),(0,Y.jsx)(yt,{testId:`plugin-picker-toggle-${e.name}`,isSelected:t,isDisabled:n,onToggle:r,enableLabelKey:g.BUTTON$ADD,disableLabelKey:g.COMMON$REMOVE,enableTooltipKey:g.BUTTON$ADD,disableTooltipKey:g.COMMON$REMOVE})]})}function X(e){return[e.source,e.ref??``,e.repo_path??``].join(`\0`)}function $t(e){return{source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}}function en(e,t){let n=X(t);return e.some(e=>X(e)===n)}function tn(e,t){let n=X(t);return e.some(e=>X(e)===n)?e.filter(e=>X(e)!==n):[...e,$t(t)]}function nn(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description,e.source,e.repo_path,e.ref].filter(e=>typeof e==`string`&&e.length>0).some(e=>e.toLowerCase().includes(n)):!0}function rn({selected:e,onChange:t,disabled:n=!1}){let{t:r}=f(`openhands`),{data:i,isLoading:a,isError:o}=It(),[s,c]=(0,J.useState)(``),l=(i??[]).filter(e=>nn(e,s));return(0,Y.jsxs)(`div`,{"data-testid":`plugin-picker`,className:`flex w-full flex-col gap-3`,children:[(0,Y.jsxs)(`div`,{className:_(`relative flex min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`),children:[(0,Y.jsx)(De,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Y.jsx)(`input`,{"data-testid":`plugin-picker-search-input`,type:`search`,value:s,onChange:e=>c(e.target.value),placeholder:r(g.PLUGINS$PICKER_SEARCH_PLACEHOLDER),"aria-label":r(g.PLUGINS$PICKER_SEARCH_PLACEHOLDER),className:_(`min-w-0 flex-1 border-0 bg-transparent outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),s?(0,Y.jsx)(`button`,{type:`button`,onClick:()=>c(``),"aria-label":r(g.MCP$SEARCH_CLEAR),className:`mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white`,children:(0,Y.jsx)(Oe,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),a?(0,Y.jsx)(`p`,{"data-testid":`plugin-picker-loading`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(g.PLUGINS$PICKER_LOADING)}):o?(0,Y.jsx)(`p`,{"data-testid":`plugin-picker-error`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(g.PLUGINS$PICKER_ERROR)}):l.length===0?(0,Y.jsx)(`p`,{"data-testid":`plugin-picker-empty`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(g.PLUGINS$PICKER_EMPTY)}):(0,Y.jsx)(`div`,{className:ht,children:(0,Y.jsx)(`div`,{className:_t,children:l.map(r=>(0,Y.jsx)(Qt,{plugin:r,isSelected:en(e,r),isDisabled:n,onToggle:()=>t(tn(e,r))},`${r.source} ${r.ref??``} ${r.repo_path??``} ${r.name}`))})})]})}function an({selected:e,onChange:t,onClose:n}){let{t:r}=f(`openhands`);return(0,Y.jsx)(Ne,{onClose:n,children:(0,Y.jsxs)(`div`,{"data-testid":`plugin-picker-modal`,className:_(`relative flex max-h-[80vh] flex-col gap-4 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,Fe(`lg`),Ie),children:[(0,Y.jsx)($e,{onClose:n,testId:`plugin-picker-close`}),(0,Y.jsxs)(`div`,{className:`pr-6`,children:[(0,Y.jsx)(q.H2,{children:r(g.PLUGINS$PICKER_TITLE)}),(0,Y.jsx)(q.Text,{className:`mt-1 block text-sm text-tertiary-light`,children:r(g.PLUGINS$PICKER_SUBTITLE)})]}),(0,Y.jsx)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:(0,Y.jsx)(rn,{selected:e,onChange:t})}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-t border-[var(--oh-border-subtle)] pt-4`,children:[(0,Y.jsx)(q.Text,{className:`text-sm text-tertiary-light`,children:r(g.PLUGINS$PICKER_SELECTED_COUNT,{count:e.length})}),(0,Y.jsx)(Ue,{testId:`plugin-picker-done`,type:`button`,variant:`primary`,onClick:n,className:`px-4`,children:r(g.PLUGINS$PICKER_DONE)})]})]})})}function on({count:e,onClick:t,disabled:n=!1}){let{t:r}=f(`openhands`);return(0,Y.jsxs)(`button`,{type:`button`,"data-testid":`open-plugin-picker`,onClick:t,disabled:n,className:_(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,Be,Ve,ze,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Y.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,Y.jsx)(Dt,{width:16,height:16,className:`shrink-0`,"aria-hidden":!0})}),(0,Y.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:r(g.PLUGINS$PICKER_TRIGGER)}),e>0?(0,Y.jsx)(`span`,{"data-testid":`plugin-picker-count`,className:`inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black`,children:e}):null]})}var sn={latestRun:null,recentRuns:[],isLoading:!0,isError:!1};function cn(){let e=N(),{data:t,isLoading:n}=ut(),r=t?.status===`ok`,{data:i,isError:a,isLoading:o}=dt({limit:50,offset:0,enabled:!e&&r}),s=e?F:i?.automations??[],c=s.filter(e=>e.enabled).slice(0,20),l=new Set(s.map(e=>e.id)),u=e?!0:i!=null&&s.length>=i.total,d=P(e?[]:c),f=e?O:d;return e?{isBackendHealthy:!0,isHealthLoading:!1,isError:!1,isAutomationsLoading:!1,enabledAutomations:c,knownAutomationIds:l,isAutomationListComplete:u,runStates:f}:{isBackendHealthy:r,isHealthLoading:n,isError:a,isAutomationsLoading:o,enabledAutomations:c,knownAutomationIds:l,isAutomationListComplete:u,runStates:f}}var ln=`oh:home-pinned-automations`;function un(e,t){return`${ln}:${e}:${t??`-`}`}function Z(e){if(!Array.isArray(e))return[];let t=new Set,n=[];for(let r of e)typeof r!=`string`||!r||t.has(r)||(t.add(r),n.push(r));return n}function Q(e,t){let n=new Set(e),r=[];for(let e of t)n.has(e)&&(r.push(e),n.delete(e));for(let t of e)n.has(t)&&r.push(t);return r}function dn(e,t,n,r=`after`){if(t===n)return[...e];let i=e.indexOf(t),a=e.indexOf(n);if(i<0||a<0)return[...e];let o=[...e];o.splice(i,1);let s=o.indexOf(n),c=r===`before`?s:s+1;return o.splice(c,0,t),o}function fn(){let e=N(),t=p(),[n,r]=de(un(t.backend.id,t.orgId),[]),[i,a]=(0,J.useState)(null),o=(0,J.useMemo)(()=>e?i?Q(H,i):[...H]:Z(n),[e,i,n]),s=(0,J.useCallback)(e=>o.includes(e),[o]),c=(0,J.useCallback)(t=>{if(e){a(e=>{let n=e?Q(H,e):[...H];return n.includes(t)?n:[...n,t]});return}r(e=>{let n=Z(e);return n.includes(t)?n:[...n,t]})},[e,r]),l=(0,J.useCallback)(t=>{if(e){a(e=>(e?Q(H,e):[...H]).filter(e=>e!==t));return}r(e=>Z(e).filter(e=>e!==t))},[e,r]);return{pinnedIds:o,isPinned:s,pin:c,unpin:l,togglePin:(0,J.useCallback)(e=>{if(s(e)){l(e);return}c(e)},[s,c,l]),reorder:(0,J.useCallback)((t,n,i=`after`)=>{if(e){a(e=>dn(e?Q(H,e):[...H],t,n,i));return}r(e=>dn(Z(e),t,n,i))},[e,r]),pruneMissing:(0,J.useCallback)(t=>{e||r(e=>{let n=Z(e),r=n.filter(e=>t.has(e));return r.length===n.length&&r.every((e,t)=>e===n[t])?n:r})},[e,r])}}function pn({automationName:e,isOpen:t,onConfirm:n,onCancel:r}){let{t:i}=f(`openhands`);return t?(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,Y.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`turn-off-automation-title`,className:`relative w-full max-w-sm rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":i(g.BUTTON$CLOSE),children:(0,Y.jsx)(bt,{className:`size-5`})}),(0,Y.jsx)(`h2`,{id:`turn-off-automation-title`,className:Re,children:i(g.AUTOMATIONS$TURN_OFF_CONFIRM_TITLE)}),(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:i(g.AUTOMATIONS$TURN_OFF_CONFIRM_MESSAGE,{name:e})}),(0,Y.jsxs)(`div`,{className:`mt-6 flex justify-end gap-3`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg border border-[var(--oh-border)] px-4 py-2 text-sm text-white hover:bg-surface-raised`,children:i(g.AUTOMATIONS$CANCEL)}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`turn-off-automation-confirm`,onClick:n,className:`rounded-lg bg-danger px-4 py-2 text-sm text-white hover:bg-danger/80`,children:i(g.AUTOMATIONS$TURN_OFF)})]})]})]}):null}function mn({automation:e,t,canManage:n,isRunPending:r,isCancelPending:i,canCancel:a,testIdPrefix:o,pinTestId:s,isPinned:c,onRunNow:l,onCancelRun:u,onView:d,onEdit:f,onTurnOff:p,onTogglePin:m}){let h=[];return n&&h.push({kind:`item`,key:`run-now`,label:t(g.AUTOMATIONS$RUN_NOW),icon:(0,Y.jsx)(C,{className:`size-4`}),onClick:l,disabled:r||!e.enabled||a,testId:`${o}-run-${e.id}`}),n&&a&&h.push({kind:`item`,key:`cancel-run`,label:t(g.AUTOMATIONS$CANCEL_RUN),icon:(0,Y.jsx)(Wt,{className:`size-3.5 fill-current`,"aria-hidden":!0}),onClick:u,disabled:i,testId:`${o}-cancel-${e.id}`}),h.push({kind:`item`,key:`view`,label:t(g.COMMON$VIEW),icon:(0,Y.jsx)(M,{className:`size-4`,"aria-hidden":!0}),onClick:d,testId:`${o}-view-${e.id}`}),n&&f&&h.push({kind:`item`,key:`edit`,label:t(g.AUTOMATIONS$EDIT),icon:(0,Y.jsx)(it,{className:`size-4`}),onClick:f,testId:`${o}-edit-${e.id}`}),n&&h.push({kind:`item`,key:`turn-off`,label:t(g.AUTOMATIONS$TURN_OFF),icon:(0,Y.jsx)(x,{className:`size-4`}),onClick:p,testId:`${o}-turn-off-${e.id}`}),h.push({kind:`separator`,key:`pin-separator`},{kind:`item`,key:`pin`,label:t(c?g.FEATURED_AUTOMATIONS$UNPIN:g.FEATURED_AUTOMATIONS$PIN),icon:(0,Y.jsx)(Te,{className:c?`size-3.5 fill-current`:`size-3.5`,"aria-hidden":`true`}),onClick:m,testId:s}),h}function hn({onUnpin:e,automation:t,...n}){return mn({...n,automation:t,testIdPrefix:`pinned-automation`,pinTestId:`unpin-automation-${t.id}`,isPinned:!0,onTogglePin:e})}var gn=e(n(),1);function _n({testId:e,panelTestId:t,ariaLabel:n,items:r,triggerClassName:i}){let[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(0),l=(0,J.useRef)(null),u=(0,J.useRef)([]),[,d]=(0,J.useReducer)(e=>e+1,0),f=()=>{o(!1),queueMicrotask(()=>l.current?.focus())},p=tt(f,l),m=r.map((e,t)=>e.kind===`item`&&!e.disabled?t:-1).filter(e=>e>=0);(0,J.useLayoutEffect)(()=>{if(!a)return;d(),c(m[0]??0);let e=0,t=()=>{e||=window.requestAnimationFrame(()=>{e=0,d()})};return window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0),e&&window.cancelAnimationFrame(e)}},[a]),(0,J.useEffect)(()=>{a&&u.current[s]?.focus()},[s,a]);let h=(()=>{if(!a||!l.current)return;let e=l.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,i=r.reduce((e,t)=>e+(t.kind===`separator`?9:36),10),o=p.current?.getBoundingClientRect().height??i;return{position:`fixed`,...e.bottom+4+o+8>n?{bottom:n-e.top+4}:{top:e.bottom+4},right:Math.max(8,t-e.right),zIndex:1e5}})(),g=typeof document<`u`?document.body:null,_=e=>{m.length!==0&&c(m[(m.indexOf(s)+e+m.length)%m.length]??m[0])};return(0,Y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Y.jsx)(rt,{ref:l,testId:e,ariaLabel:n,className:i,onClick:e=>{e.preventDefault(),e.stopPropagation(),o(e=>!e)}}),a&&h&&g?(0,gn.createPortal)((0,Y.jsx)(ke,{ref:p,testId:t,theme:`popover`,position:`none`,alignment:`none`,spacing:`none`,style:h,className:`min-w-40`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),f();return}if(e.key===`ArrowDown`){e.preventDefault(),_(1);return}e.key===`ArrowUp`&&(e.preventDefault(),_(-1))},children:r.map((e,t)=>e.kind===`separator`?(0,Y.jsx)(we,{},e.key):(0,Y.jsx)(`li`,{children:(0,Y.jsx)(je,{ref:e=>{u.current[t]=e},testId:e.testId,isDisabled:e.disabled,className:`group`,onClick:t=>{t.preventDefault(),t.stopPropagation(),!e.disabled&&(e.onClick(),f())},children:(0,Y.jsx)(T,{icon:e.icon,label:e.label})})},e.key))}),g):null]})}function vn({automation:e,runState:t,onUnpin:n,onDragStart:i,onDragOver:a,onDrop:o,onDragEnd:s,isDropTarget:c,dropPosition:l,isDragging:u}){let{t:d,i18n:p}=f(`openhands`),{latestRun:m,recentRuns:h,isLoading:v,isError:x}=t,C=ae(e,m),T=m?.conversation_id??null,O=T?ee(T):void 0,{data:k}=ft(O===void 0?T:null),M=O===void 0?k?.title??null:O,N=m?ce(m):null,P=m?.status===K.COMPLETED||m?.status===K.FAILED,F=e.trigger.schedule_human||e.trigger.type,I=(0,J.useMemo)(()=>oe(e,F),[e,F]),L=w(m?.status),R=m?y(m):null,z=R?.summary??null,H=z?j(z):null,te=z!=null&&H!=null&&A(z,H),U=(0,J.useRef)(null),W=Me()?.insights,ie=hn({automation:e,t:d,canManage:C.canManage,isRunPending:C.isRunPending,isCancelPending:C.isCancelPending,canCancel:C.canCancel,onRunNow:C.runNow,onCancelRun:C.cancelRun,onView:C.viewDetails,onEdit:C.openEdit,onTurnOff:C.requestTurnOff,onUnpin:()=>n(e.id)});return(0,Y.jsxs)(`article`,{ref:U,role:`listitem`,"data-testid":`pinned-automation-card-${e.id}`,onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n.dropEffect=`move`;let r=t.currentTarget.getBoundingClientRect(),i=(t.clientX-r.left)/r.width,o=(t.clientY-r.top)/r.height,s=i<.3||i>.7?i<.5?`before`:`after`:o<.5?`before`:`after`;a(e.id,s)},onDrop:t=>{t.preventDefault(),o(e.id)},onDragEnd:s,className:_(`group relative flex min-w-0 flex-col overflow-hidden p-4 text-left`,pt,gt,u&&`opacity-50`,c&&l===`before`&&`shadow-[inset_0_2px_0_0_var(--oh-focus)]`,c&&l===`after`&&`shadow-[inset_0_-2px_0_0_var(--oh-focus)]`),children:[(0,Y.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{draggable:!0,"data-testid":`pinned-automation-drag-${e.id}`,"aria-label":d(g.FEATURED_AUTOMATIONS$REORDER_HANDLE,{name:e.name}),className:`-mx-4 -mt-4 flex cursor-grab items-center justify-between gap-3 px-4 pt-4 active:cursor-grabbing`,onDragStart:t=>{if(t.target?.closest(`[data-no-drag]`)){t.preventDefault();return}let{dataTransfer:n}=t;n.effectAllowed=`move`,n.setData(`text/plain`,e.id),U.current&&n.setDragImage(U.current,24,24),i(e.id)},onDragEnd:s,children:[(0,Y.jsx)(`span`,{role:`link`,tabIndex:0,title:d(g.FEATURED_AUTOMATIONS$VIEW_DETAILS),className:`h-8 min-w-0 flex-1 cursor-pointer truncate text-sm font-semibold leading-8 text-[var(--oh-foreground)] hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--oh-focus)]`,onClick:()=>C.viewDetails(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),C.viewDetails())},children:e.name}),(0,Y.jsx)(`div`,{"data-no-drag":!0,className:`flex h-8 shrink-0 items-center`,children:(0,Y.jsx)(_n,{testId:`pinned-automation-menu-${e.id}`,panelTestId:`pinned-automation-menu-panel-${e.id}`,ariaLabel:d(g.FEATURED_AUTOMATIONS$ROW_MENU_LABEL,{name:e.name}),triggerClassName:`opacity-70 group-hover:opacity-100`,items:ie})})]}),e.prompt?(0,Y.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-[var(--oh-text-secondary)]`,children:e.prompt}):null]}),I.length>0||h.length>0?(0,Y.jsxs)(`div`,{className:_(`mt-3 flex items-center gap-3`,I.length>0?`justify-between`:`justify-end`),children:[I.length>0?(0,Y.jsx)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:(0,Y.jsx)(vt,{pills:I,testId:`pinned-automation-pills-${e.id}`})}):null,h.length>0?(0,Y.jsx)(V,{automationId:e.id,runs:h,testId:`pinned-automation-activity-${e.id}`}):null]}):null,(0,Y.jsxs)(`div`,{className:re,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[v?(0,Y.jsx)(`div`,{className:`h-3.5 w-3/4 animate-pulse rounded bg-surface-raised motion-reduce:animate-none`,"aria-hidden":`true`}):null,!v&&x?(0,Y.jsx)(`p`,{className:`truncate text-[var(--oh-text-secondary)]`,children:d(g.FEATURED_AUTOMATIONS$STATUS_UNAVAILABLE)}):null,!v&&!x&&!m?(0,Y.jsx)(`p`,{className:`truncate text-[var(--oh-text-secondary)]`,children:d(g.AUTOMATIONS$DETAIL$NO_RUNS)}):null,m?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(b,{status:R?.badgeStatus??m.status,iconOnly:!0,showLabel:m.status===K.PENDING||m.status===K.RUNNING&&!M}),L?(0,Y.jsx)(S,{status:m.status,code:m.phase_code,label:m.phase_label,updatedAt:m.phase_updated_at}):null,H?te&&z?(0,Y.jsx)(r,{content:(0,Y.jsx)(`p`,{className:`max-w-xs whitespace-pre-wrap break-words p-2 text-xs`,children:z}),placement:`top`,closeDelay:100,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 cursor-default truncate text-[var(--oh-text-secondary)]`,children:H})}):(0,Y.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[var(--oh-text-secondary)]`,children:H}):null,T&&M?(0,Y.jsxs)(G,{to:`/conversations/${T}`,"aria-label":M,title:M,className:`group/conversation inline-flex min-w-0 items-center gap-1 text-[var(--oh-foreground)] hover:text-[var(--oh-text-secondary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--oh-focus)]`,children:[(0,Y.jsx)(`span`,{className:`truncate`,children:M}),(0,Y.jsx)(D,{className:`size-3 shrink-0 opacity-0 transition-opacity group-hover/conversation:opacity-100 group-focus-visible/conversation:opacity-100`,"aria-hidden":`true`})]}):null,!T&&P?(0,Y.jsx)(`p`,{className:`min-w-0 truncate text-[var(--oh-text-secondary)]`,children:d(g.AUTOMATIONS$DETAIL$NO_CONVERSATION)}):null]}):null]}),N?(0,Y.jsx)(`span`,{className:`shrink-0 text-[var(--oh-text-secondary)]`,children:E(N,p.language,d)}):null]}),W?(0,Y.jsx)(`div`,{className:`mt-3`,children:(0,Y.jsx)(ne,{state:B(t),copy:W.stats})}):null,C.editOpen?(0,Y.jsx)(Lt,{automation:e,isOpen:C.editOpen,onClose:()=>C.setEditOpen(!1)}):null,(0,Y.jsx)(pn,{automationName:e.name,isOpen:C.turnOffConfirmOpen,onConfirm:C.confirmTurnOff,onCancel:C.cancelTurnOff})]})}function yn(){let{t:e}=f(`openhands`),{pinnedIds:t,unpin:n,reorder:r,pruneMissing:i}=fn(),{isBackendHealthy:a,isHealthLoading:o,isError:s,enabledAutomations:c,knownAutomationIds:l,isAutomationListComplete:d,runStates:p}=cn(),[m,h]=(0,J.useState)(!1),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(null);(0,J.useEffect)(()=>{!d||l.size===0||i(l)},[d,l,i]);let w=new Map(c.map(e=>[e.id,e])),T=t.map(e=>w.get(e)).filter(e=>!!e);if(o||!a||s||T.length===0)return null;let E=m||T.length<=6?T:T.slice(0,6),D=T.length>6;return(0,Y.jsxs)(`section`,{"data-testid":`pinned-automations-dashboard`,"aria-label":e(g.FEATURED_AUTOMATIONS$PINNED_DASHBOARD_LABEL),className:_(`w-full`,u),children:[(0,Y.jsx)(`h2`,{className:`mb-2 text-sm font-medium text-[var(--oh-foreground)]`,children:e(g.FEATURED_AUTOMATIONS$PINNED_TITLE)}),(0,Y.jsx)(`div`,{role:`list`,className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:E.map(e=>(0,Y.jsx)(vn,{automation:e,runState:p.get(e.id)??sn,onUnpin:n,onDragStart:y,onDragOver:(e,t)=>{x(e),C(t)},onDrop:e=>{v&&S&&r(v,e,S),y(null),x(null),C(null)},onDragEnd:()=>{y(null),x(null),C(null)},isDropTarget:b===e.id,dropPosition:b===e.id?S:null,isDragging:v===e.id},e.id))}),D?(0,Y.jsx)(`div`,{className:`mt-2 flex justify-start`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`pinned-automations-view-more`,onClick:()=>h(e=>!e),className:`text-xs text-[var(--oh-text-secondary)] hover:text-[var(--oh-foreground)]`,children:e(m?g.COMMON$VIEW_LESS:g.COMMON$VIEW_MORE)})}):null]})}function bn(e,t,n,r){let{latestRun:i}=t,a=i?ce(i):null,o=i?y(i):null;return{id:e.id,name:e.name,triggerSummary:L(e),status:o?.badgeStatus??null,whenLabel:a?E(a,n,r):null,conversationId:i?.conversation_id??null}}function xn(e,t){let n=t.get(e),r=n?.latestRun?.status;if(r===K.PENDING||r===K.RUNNING)return 2**53-1;let i=n?.latestRun?ce(n.latestRun):null;return i?new Date(i).getTime():0}function Sn(e,t,n,r,i){return[...e].map(e=>bn(e,t.get(e.id)??i,n,r)).sort((e,n)=>xn(n.id,t)-xn(e.id,t))}function Cn(e){return e.conversationId?`/conversations/${e.conversationId}`:`/automations/${e.id}`}function wn({item:e,automation:t,runState:n}){let{t:i}=f(`openhands`),{isPinned:a,togglePin:o}=fn(),s=ae(t,n.latestRun),c=a(e.id),l=t.trigger.type===`event`?Ae:lt,u=I(t),d=k(t),p=se(t),m=!!(u||d||p),h=m||!!e.whenLabel||!!e.status,v=le(n),y=te(n),x=mn({automation:t,t:i,canManage:s.canManage,isRunPending:s.isRunPending,isCancelPending:s.isCancelPending,canCancel:s.canCancel,testIdPrefix:`running-automation`,pinTestId:`running-automation-pin-${e.id}`,isPinned:c,onRunNow:s.runNow,onCancelRun:s.cancelRun,onView:s.viewDetails,onEdit:s.openEdit,onTurnOff:s.requestTurnOff,onTogglePin:()=>o(e.id)});return(0,Y.jsxs)(`li`,{"data-testid":`running-automation-row-${e.id}`,className:U,children:[(0,Y.jsx)(r,{content:(0,Y.jsx)(ie,{automation:t,runState:n}),placement:`top-start`,closeDelay:100,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,Y.jsx)(G,{to:Cn(e),"aria-label":`${e.name} ${i(y)}`,className:`flex min-w-0 flex-1 items-center justify-between gap-3 px-3 py-2.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--oh-focus)]`,children:(0,Y.jsxs)(`div`,{className:`grid min-w-0 flex-1 grid-cols-[auto_minmax(0,1fr)] gap-x-2`,children:[(0,Y.jsx)(`span`,{className:`inline-flex h-5 w-2.5 shrink-0 items-center justify-center`,children:(0,Y.jsx)(W,{health:v})}),(0,Y.jsx)(`span`,{className:`truncate text-sm font-medium leading-5 text-[var(--oh-foreground)]`,children:e.name}),h?(0,Y.jsxs)(`span`,{className:`col-start-2 mt-0.5 flex min-w-0 items-center gap-1.5 text-xs leading-4 text-[var(--oh-text-secondary)]`,children:[(0,Y.jsx)(l,{className:`size-3 shrink-0`,"aria-hidden":`true`}),u?(0,Y.jsx)(`span`,{className:`truncate`,children:u}):null,d?(0,Y.jsx)(`span`,{className:`truncate`,children:d}):null,p?(0,Y.jsx)(`span`,{className:_(mt,`shrink-0 px-1.5 py-0 text-[var(--oh-text-secondary)]`),children:z(p)}):null,e.whenLabel?(0,Y.jsxs)(Y.Fragment,{children:[m?(0,Y.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:`·`}):null,(0,Y.jsx)(`span`,{className:`truncate`,children:e.whenLabel})]}):null,e.status?(0,Y.jsxs)(Y.Fragment,{children:[m||e.whenLabel?(0,Y.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:`·`}):null,(0,Y.jsx)(b,{status:e.status,compact:!0})]}):null]}):null,(0,Y.jsx)(`span`,{className:`sr-only`,children:i(y)})]})})}),(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 pr-1.5`,children:[(0,Y.jsx)(V,{automationId:t.id,runs:n.recentRuns,testId:`running-automation-activity-${e.id}`}),(0,Y.jsx)(_n,{testId:`running-automation-menu-${e.id}`,panelTestId:`running-automation-menu-panel-${e.id}`,ariaLabel:i(g.FEATURED_AUTOMATIONS$ROW_MENU_LABEL,{name:e.name}),triggerClassName:`opacity-70 group-hover:opacity-100`,items:x})]}),s.editOpen?(0,Y.jsx)(Lt,{automation:t,isOpen:s.editOpen,onClose:()=>s.setEditOpen(!1)}):null,(0,Y.jsx)(pn,{automationName:t.name,isOpen:s.turnOffConfirmOpen,onConfirm:s.confirmTurnOff,onCancel:s.cancelTurnOff})]})}function Tn(){let{t:e,i18n:t}=f(`openhands`),[n,r]=(0,J.useState)(!1),{isBackendHealthy:i,isHealthLoading:a,isError:o,isAutomationsLoading:s,enabledAutomations:c,runStates:l}=cn(),u=t?.language??`en`,d=(0,J.useMemo)(()=>Sn(c,l,u,e,sn),[c,l,u,e]),p=(0,J.useMemo)(()=>new Map(c.map(e=>[e.id,e])),[c]),m=n?20:10,h=d.slice(0,m),_=!n&&d.length>10,v=n&&d.length>=20;if(a||!i||o||s)return null;let y=d.length===0;return(0,Y.jsxs)(`section`,{"aria-labelledby":`running-automations-heading`,"data-testid":`running-automations-list`,className:`w-full`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`h2`,{id:`running-automations-heading`,className:`text-sm font-medium text-[var(--oh-foreground)]`,children:e(g.FEATURED_AUTOMATIONS$SECTION_TITLE)}),(0,Y.jsx)(Ke,{content:e(g.FEATURED_AUTOMATIONS$MANAGE),placement:`bottom`,children:(0,Y.jsxs)(G,{to:`/automations`,"data-testid":`home-automations-manage`,"aria-label":e(g.FEATURED_AUTOMATIONS$MANAGE),className:`inline-flex items-center gap-1 rounded-md px-1.5 py-0.5 text-xs font-medium text-[var(--oh-text-secondary)] transition-colors hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--oh-focus)]`,children:[(0,Y.jsx)(Ee,{className:`size-3`,"aria-hidden":`true`}),e(g.BUTTON$ADD)]})})]}),y?(0,Y.jsx)(`p`,{"data-testid":`running-automations-empty-hint`,className:`rounded-xl border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)] px-4 py-3 text-xs text-[var(--oh-text-secondary)]`,children:e(g.FEATURED_AUTOMATIONS$EMPTY_HINT)}):(0,Y.jsx)(`ul`,{"aria-label":e(g.FEATURED_AUTOMATIONS$RECENT_GROUP_LABEL),className:R,children:h.map(e=>{let t=p.get(e.id);return t?(0,Y.jsx)(wn,{item:e,automation:t,runState:l.get(e.id)??sn},e.id):null})}),_?(0,Y.jsx)(`div`,{className:`mt-2 flex justify-start`,children:(0,Y.jsx)(`button`,{type:`button`,"data-testid":`home-automations-view-more`,onClick:()=>r(!0),className:`rounded-md px-1.5 py-0.5 text-xs font-medium text-[var(--oh-text-secondary)] transition-colors hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--oh-focus)]`,children:e(g.COMMON$VIEW_MORE)})}):null,v?(0,Y.jsx)(`div`,{className:`mt-2 flex justify-start`,children:(0,Y.jsx)(G,{to:`/automations`,"data-testid":`home-automations-view-all`,className:`rounded-md px-1.5 py-0.5 text-xs font-medium text-[var(--oh-text-secondary)] transition-colors hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--oh-focus)]`,children:e(g.FEATURED_AUTOMATIONS$VIEW_ALL)})}):null]})}function En(){let{t:e}=f(`openhands`);return(0,Y.jsx)(`div`,{className:`flex w-full items-center justify-center py-2`,children:(0,Y.jsx)(q.H1,{className:`w-full text-center leading-normal`,children:e(g.HOME$LETS_START_BUILDING)})})}function Dn({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=f(`openhands`),a=e===`local`,o=i(a?g.HOME$OPEN_WORKSPACE:g.COMMON$OPEN_REPOSITORY),s=(0,Y.jsxs)(`button`,{type:`button`,"data-testid":a?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:_(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,Be,Ve,ze,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Y.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:a?(0,Y.jsx)(be,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Y.jsx)(et,{width:16,height:16,className:`shrink-0`})}),(0,Y.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:o})]});return r?(0,Y.jsx)(Ke,{content:r,placement:`top`,children:(0,Y.jsx)(`span`,{className:`inline-flex`,children:s})}):s}var $=`__ungrouped__`;function On({workspaces:e,parents:t=[],value:n,placeholder:r,className:i,disabled:a=!1,disabledTooltip:o,showManage:s,onChange:c,onAddClick:l,onManageClick:u}){let{t:d}=f(`openhands`),[p,m]=(0,J.useState)(n?.name??``),h=(0,J.useRef)(null),v=(0,J.useMemo)(()=>{let t=p.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,p]),y=(0,J.useCallback)(e=>e.parentPath??$,[]),b=(0,J.useMemo)(()=>{let e=new Map;return t.forEach(t=>e.set(t.path,t.name)),e},[t]),{groupedWorkspaces:x,isGrouped:S,headerByFirstIndex:C,groupLabelByIndex:w}=(0,J.useMemo)(()=>{let e=[],t=new Map;v.forEach(n=>{let r=y(n);t.has(r)||(t.set(r,[]),e.push(r)),t.get(r)?.push(n)}),e.sort((e,t)=>e===$?1:t===$?-1:0);let n=e.length>1,r=[],i=new Map,a=new Map;return e.forEach(e=>{let o=e===$?d(g.HOME$WORKSPACE_GROUP_OTHER):b.get(e)||e.split(`/`).filter(Boolean).pop()||e;n&&i.set(r.length,o),(t.get(e)??[]).forEach(e=>{a.set(r.length,o),r.push(e)})}),{groupedWorkspaces:r,isGrouped:n,headerByFirstIndex:i,groupLabelByIndex:a}},[v,y,b,d]),T=(0,J.useCallback)(e=>{c(e),e&&m(e.name)},[c]),E=(0,J.useCallback)(()=>{T(null),m(``)},[T]),{isOpen:D,getToggleButtonProps:O,getMenuProps:k,getInputProps:A,highlightedIndex:j,getItemProps:M,selectedItem:N,closeMenu:P}=Ge({items:x,itemToString:e=>e?.name??``,selectedItem:n,onSelectedItemChange:({selectedItem:e})=>{T(e??null)},inputValue:p,onIsOpenChange:({isOpen:e,selectedItem:t})=>{m(e?``:t?.name??``)},stateReducer:(e,t)=>t.type===Ge.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),F=(e,t,n,r,i)=>(0,Y.jsx)(Rt,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id,ariaLabel:S?`${w.get(t)??``}, ${e.name}`.trim():void 0},e.id),I=e=>(0,Y.jsx)(zt,{inputValue:e,searchMessage:d(g.HOME$NO_WORKSPACES),emptyMessage:d(g.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),L=(0,J.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),R=(0,J.useCallback)(e=>{L(e),P(),l()},[P,l,L]),z=(0,J.useCallback)(e=>{L(e),P(),l()},[P,l,L]),B=(0,J.useCallback)(e=>{L(e),P(),u()},[P,u,L]),V=(0,J.useCallback)(e=>{L(e),P(),u()},[P,u,L]),ee=(0,J.useMemo)(()=>(0,Y.jsxs)(`div`,{className:qe,children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:_(Je,`cursor-pointer`),onMouseDown:L,onTouchStart:L,onTouchEnd:z,onClick:R,children:d(g.HOME$ADD_WORKSPACES)}),(s??e.length>0)&&(0,Y.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:_(Je,`cursor-pointer`),onMouseDown:L,onTouchStart:L,onTouchEnd:V,onClick:B,children:d(g.HOME$MANAGE_WORKSPACES)})]}),[R,z,B,V,L,d,e.length,s]),H=(0,Y.jsxs)(`div`,{className:_(`relative`,i),children:[(0,Y.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Y.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Y.jsx)(at,{width:16,height:16})}),(0,Y.jsx)(`input`,{...A({disabled:a,placeholder:D&&n?n.name:r??d(g.HOME$WORKSPACE_PLACEHOLDER),className:_(He,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{m(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Y.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[n&&(0,Y.jsx)(Ht,{disabled:a,onClear:E}),(0,Y.jsx)(Bt,{isOpen:D,disabled:a,getToggleButtonProps:O})]})]}),(0,Y.jsx)(Vt,{isOpen:D,filteredItems:x,inputValue:p,highlightedIndex:j,selectedItem:N,getMenuProps:k,getItemProps:M,menuRef:h,renderItem:F,renderItemPrefix:S?(e,t)=>{let n=C.get(t);return n?(0,Y.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,"data-testid":`workspace-group-header`,className:`px-2 pt-2 pb-1 text-xs font-medium text-[var(--oh-muted)] select-none`,children:n}):null}:void 0,renderEmptyState:I,stickyFooterItem:ee,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return o?(0,Y.jsx)(Ke,{content:o,placement:`top`,children:(0,Y.jsx)(`span`,{className:`block`,children:H})}):H}var kn=`oh:home-selected-workspace-path`;function An(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(kn);return e&&e.length>0?e:null}catch{return null}}function jn(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(kn,e):window.sessionStorage.removeItem(kn)}catch{}}function Mn({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=f(`openhands`),{navigate:r}=We(),{data:i,error:a}=he(),o=i?.workspaceParents??[],{mutate:s}=Se(),{mutate:c}=pe(),{mutate:u}=ye(),{mutate:d}=_e(),{workspaces:p,parents:m,isLoading:h,isError:_,error:v}=me(),y=fe(a??v,n),[b,x]=J.useState(null),[S,C]=J.useState(!1),[w,T]=J.useState(!1),{mutate:E,isPending:D,isSuccess:O}=nt(),k=l(),A=D||O||k,j=J.useCallback(e=>{x(e),jn(e?.path??null)},[]);J.useEffect(()=>{let e=An();if(!e)return;let t=p.find(t=>t.path===e);if(t){x(e=>e?.path===t.path?e:t);return}!h&&!_&&!y&&(jn(null),x(t=>t?.path===e?null:t))},[_,h,p,y]);let M=o.length>0||!!y,N=null;y?N=y:h?N=n(g.HOME$LOADING):_&&(N=n(g.HOME$WORKSPACE_SCAN_ERROR));let P=!!y||e||h&&p.length===0;return(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Y.jsx)(ct,{width:24,height:24}),(0,Y.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(g.HOME$WORKSPACES_TAB)})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Y.jsx)(On,{workspaces:p,parents:m,value:b,placeholder:y?n(g.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):P?n(g.HOME$LOADING):void 0,disabled:P,disabledTooltip:y,showManage:p.length>0||o.length>0,onChange:j,onAddClick:()=>C(!0),onManageClick:()=>T(!0),className:`max-w-auto`},b?.path??`empty-workspace-selection`),M&&N&&(0,Y.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:N})]}),(0,Y.jsx)(Ue,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!b||!t&&A||e,onClick:()=>{if(b){if(t){t(b);return}E({workingDir:b.path,entryPoint:`home_workspace_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:n(t?g.BUTTON$CONFIRM:A?g.HOME$LOADING:g.BUTTON$LAUNCH)}),(0,Y.jsx)(ge,{isOpen:S,onClose:()=>C(!1),onAdd:e=>{let t=e[e.length-1];s(e,{onSuccess:()=>{t&&j(t)}})},onAddParent:e=>u(e)}),(0,Y.jsx)(xe,{isOpen:w,workspaces:p,workspaceParents:o,onClose:()=>T(!1),onRemove:e=>{b?.path===e&&j(null),c(e)},onRemoveParent:e=>{b?.parentPath===e&&j(null),d(e)}})]})}function Nn({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=f(`openhands`),{isLoadingSettings:i}=ot();return e?(0,Y.jsx)(Ne,{onClose:t,children:(0,Y.jsxs)(Pe,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Y.jsx)($e,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Y.jsx)(`div`,{className:`w-full pr-6`,children:(0,Y.jsx)(Le,{title:r(g.HOME$OPEN_WORKSPACE)})}),(0,Y.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Y.jsx)(Mn,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Pn({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=We(),[i,a]=J.useState(null),[o,s]=J.useState(null),[c,u]=J.useState(null),{providers:d}=ot(),{addRecentRepository:p,setLastSelectedProvider:m,getLastSelectedProvider:h}=st(),{mutate:_,isPending:v,isSuccess:y}=nt(),b=l(),{t:x}=f(`openhands`);J.useEffect(()=>{if(d.length!==0){if(d.length===1&&!c){u(d[0]);return}if(d.length>1&&!c){let e=h();e&&d.includes(e)&&u(e)}}},[d,c,h]);let S=v||y||b,C=t=>{t!==c&&(u(t),m(t),a(null),s(null),e?.(null))},w=J.useCallback(e=>{s(e)},[]);return(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Y.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Y.jsx)(et,{width:24,height:24}),(0,Y.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(g.COMMON$OPEN_REPOSITORY)})]})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(g.HOME$SELECT_OR_INSERT_URL)}),d.length<=1?null:(0,Y.jsx)(wt,{providers:d,value:c,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Y.jsx)(Ut,{provider:c||d[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!c||t,onChange:t=>{t?(e?.(t),a(t)):(e?.(null),a(null),s(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Y.jsx)(Et,{repository:i?.full_name||null,provider:c||d[0],selectedBranch:o,onBranchSelect:w,defaultBranch:e,className:`max-w-full`,disabled:!i||t})})()]}),(0,Y.jsx)(Ue,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!i||!o||!n&&S||d.length>1&&!c||t,onClick:()=>{if(!(!i||!o)){if(p(i),n){n({repository:i,branch:o,provider:c});return}_({repository:{name:i.full_name||``,gitProvider:i.git_provider||`github`,branch:o.name||`main`},entryPoint:`home_repo_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:x(n?g.BUTTON$CONFIRM:S?g.HOME$LOADING:g.BUTTON$LAUNCH)})]})}function Fn({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=f(`openhands`),{isLoadingSettings:i}=ot();return e?(0,Y.jsx)(Ne,{onClose:t,children:(0,Y.jsxs)(Pe,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Y.jsx)($e,{onClose:t,testId:`close-open-repository-dialog`}),(0,Y.jsx)(`div`,{className:`w-full pr-6`,children:(0,Y.jsx)(Le,{title:r(g.COMMON$OPEN_REPOSITORY)})}),(0,Y.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Y.jsx)(Pn,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function In({mode:e}){return e===`new_worktree`?(0,Y.jsx)(ue,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Y.jsx)(et,{width:12,height:12,color:`white`,"aria-hidden":!0})}var Ln=[`local_repo`,`new_worktree`];function Rn({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:a}=f(`openhands`),[o,s]=(0,J.useState)(!1),c=(0,J.useRef)(null),l=a(Zt(e,t));return(0,J.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,J.useEffect)(()=>{if(!o)return;let e=e=>{e.key===`Escape`&&s(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),(0,Y.jsxs)(`div`,{ref:c,className:`relative inline-flex`,children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":o,"aria-label":l,disabled:r,onClick:()=>s(e=>!e),className:_(`group flex flex-row items-center justify-between gap-2 pl-2.5 pr-2 py-1 rounded-[100px] truncate relative`,`border border-[rgba(71,74,84,0.50)] bg-transparent text-white`,r?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-[var(--oh-border-subtle)]`),children:[(0,Y.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Y.jsx)(In,{mode:e})}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:l}),(0,Y.jsx)(v,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),o?(0,Y.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:_(`absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-1 shadow-lg`,qe),children:Ln.map(r=>{let o=a(Zt(r,t));return(0,Y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),s(!1)},className:Ye,children:[(0,Y.jsx)(`span`,{className:Xe,children:(0,Y.jsx)(In,{mode:r})}),(0,Y.jsx)(`span`,{className:`truncate`,children:o})]},r)})}):null]})}function zn({workspace:e,repository:t,branch:n,provider:r,workspaceMode:i,backendKind:a,onRepoClick:o,onWorkspaceModeChange:s}){let c=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,Y.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Y.jsx)(jt,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Y.jsx)(Rn,{value:i,backendKind:a,onChange:s}):null,n?(0,Y.jsx)(Ot,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function Bn(){let{t:e}=f(`openhands`),{backend:t}=p(),{navigate:n}=We(),r=t.kind===`local`,[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(null),[u,_]=(0,J.useState)(null),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(null),[S,C]=(0,J.useState)(()=>Yt()),[w,T]=(0,J.useState)([]),[E,D]=(0,J.useState)(!1),{mutateAsync:O,isPending:k}=nt(),A=l(),j=k||A,{isConfigured:M,isLoading:N}=Ze(),P=!N&&!M,{images:F,files:I,imagesMarkedUploadAsFile:L,clearAllFiles:R}=Qe(),{handleUpload:z}=kt(),{error:B}=he({enabled:r}),V=r?fe(B,e):null,ee=e=>{C(e),r&&Xt(e)},H=r?!!o:!!u&&!!v,te=Mt(null,t=>{let i=t.trim(),a=F.length>0||I.length>0;if(!i&&!a||j||P)return;let s={images:[...F],files:[...I]},l={query:a?void 0:i||void 0,entryPoint:`home_chat_launcher`};r&&o?l={...l,workingDir:o.path,workspaceMode:S}:!r&&u&&v&&(l={...l,repository:{name:u.full_name,gitProvider:u.git_provider,branch:v.name}}),w.length>0&&(l={...l,plugins:w});let d=c.loading(e(g.HOME$CREATING_CONVERSATION),m);(async()=>{try{let t=await O(l);c.dismiss(d);try{sessionStorage.removeItem(St)}catch{}let o=t.conversation_id,u=o.startsWith(`task-`);if(a)if(!r||u){let e=t.task_id??(u?o.slice(5):null);if(!e){h(null);return}xt(e,{content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...L]}),R(),await Gt({conversationId:o,text:i,images:s.images,imagesMarkedUploadAsFile:L}),n(`/conversations/${o}`);return}else try{await Pt({conversationId:o,content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:L,t:e}),R()}catch(e){h(e instanceof Error?e.message:null);return}u&&i&&await Gt({conversationId:o,text:i,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${o}`)}catch(e){c.dismiss(d),h(e instanceof Error?e.message:null)}})()});return(0,Y.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full flex-col items-center pt-[max(4rem,28vh)] pb-10`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Y.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Y.jsx)(En,{})}),(0,Y.jsx)(`div`,{className:`w-full`,children:(0,Y.jsx)(Tt,{onSubmit:te,onFilesPaste:z,disabled:j||P})}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[H?(0,Y.jsx)(zn,{workspace:o,repository:u,branch:v,provider:b,workspaceMode:S,backendKind:t.kind,onRepoClick:()=>a(!0),onWorkspaceModeChange:ee}):(0,Y.jsx)(Dn,{kind:r?`local`:`cloud`,onClick:()=>a(!0),disabled:j||!!V,disabledTooltip:V}),(0,Y.jsx)(on,{count:w.length,onClick:()=>D(!0),disabled:j})]}),(0,Y.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-8`,children:[(0,Y.jsx)(d,{variant:`rail`}),(0,Y.jsx)(yn,{}),(0,Y.jsx)(Tn,{})]})]}),r?(0,Y.jsx)(Nn,{isOpen:i,onClose:()=>a(!1),onConfirm:e=>{s(e),_(null),y(null),x(null)}}):(0,Y.jsx)(Fn,{isOpen:i,onClose:()=>a(!1),onConfirm:({repository:e,branch:t,provider:n})=>{_(e),y(t),x(n??e.git_provider),s(null),C(`local_repo`)}}),E&&(0,Y.jsx)(an,{selected:w,onChange:T,onClose:()=>D(!1)})]})}function Vn(){let e=ve(a().search);return(0,Y.jsxs)(`div`,{"data-testid":`home-screen`,className:`custom-scrollbar-always h-full overflow-y-auto rounded-xl bg-transparent px-4 md:px-0 lg:px-[42px]`,children:[(0,Y.jsx)(`div`,{className:`md:px-4 lg:px-0`,children:(0,Y.jsx)(Nt,{})}),(0,Y.jsx)(Bn,{}),e?null:(0,Y.jsx)(Ce,{})]})}var Hn=o(Vn);export{Hn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,i as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as a}from"./useQueries-pUohFMSP.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,n as c,st as l}from"./active-backend-context-BnH4-L8h.js";import{K as u,t as d}from"./utils-BgLSZdyy.js";import{b as f,c as p,m,s as h,u as g,x as _,y as v}from"./kebab-menu-item-content-SCJBwZnp.js";import{t as ee}from"./plug-7ACOEbMs.js";import{r as y}from"./context-menu-list-item-Cm7-7Y-7.js";import{n as te}from"./use-tracking-j4uo9VEW.js";import{n as ne}from"./navigation-context-CQZwH_tC.js";import{t as re}from"./navigation-link-Bxo3-4vo.js";import{p as ie}from"./install-server-modal-B81I-5OE.js";import{t as ae}from"./folder-C1ou4_DT.js";import{n as b}from"./use-automation-health-U99vvHxx.js";import{t as x}from"./automation-C_eCrGyP.js";import{c as oe,i as se,n as ce,o as le}from"./use-automations-Bq5hVuv0.js";import{i as S}from"./extension-module-card-classes-DpeaYhYo.js";import{n as C}from"./api-error-message-BXo0lCI5.js";import{o as ue}from"./mcp-marketplace-utils-C7PYr293.js";import{t as de}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{n as fe,t as pe}from"./use-automation-permissions-Buus0R6h.js";var me=i(`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`}]]),w=e(t(),1),T=r(),he=new class{limit;active=0;queue=[];constructor(e){this.limit=e}async run(e,t){await this.acquire();try{if(t?.aborted)throw t.reason??new DOMException(`Aborted`,`AbortError`);return await e()}finally{this.release()}}acquire(){return this.active<this.limit?(this.active+=1,Promise.resolve()):new Promise(e=>{this.queue.push(e)})}release(){let e=this.queue.shift();e?e():--this.active}}(3),ge=15e3;function _e(e){let t=c(),n=a({queries:e.map(e=>({queryKey:[...oe,e.id,{limit:12,offset:0},t.backend.id,t.orgId],queryFn:({signal:t})=>he.run(()=>te.getAutomationRuns(e.id,12,0),t),staleTime:60*1e3,retry:!1,refetchOnWindowFocus:!1,refetchInterval:e=>{let t=e.state.data?.runs[0];return t?.status===x.PENDING||t?.status===x.RUNNING?ge:!1}}))}),r=new Map;return e.forEach((e,t)=>{let i=n[t],a=i?.data?.runs??[];r.set(e.id,{latestRun:a[0]??null,recentRuns:a,total:i?.data?.total,isLoading:i?.isPending??!0,isError:i?.isError??!1})}),r}var ve=20,ye=[x.COMPLETED,x.COMPLETED,x.FAILED,x.COMPLETED,x.CANCELLED,x.COMPLETED,x.COMPLETED,x.FAILED,x.COMPLETED,x.SKIPPED,x.COMPLETED];function E(){return!1}var D={"demo-conv-titled":`Fix flaky CI on main`,"demo-conv-untitled":`Summarize open pull requests`};function be(e){if(e in D)return D[e]}function O(e){return new Date(Date.now()-e*36e5).toISOString()}function k(e,t,n){return{id:e,name:t,trigger:n,enabled:!0,created_at:O(720),updated_at:O(24),prompt:`demo`}}function A(e,t,n={}){let r=n.startedHoursAgo??2,i=n.completedHoursAgo===void 0?1:n.completedHoursAgo;return{id:e,status:t,conversation_id:n.conversationId===void 0?null:n.conversationId,bash_command_id:null,error_detail:n.errorDetail===void 0?null:n.errorDetail,started_at:O(r),completed_at:i===null?null:O(i)}}function xe(e){if(!e)return[];let t=[2,8,45,3,15,1,25,90,5,12,6];return[e,...ye.slice(0,11).map((n,r)=>{let i=24+r*6,a=(t[r]??5)/60;return A(`${e.id}-hist-${r}`,n,{startedHoursAgo:i,completedHoursAgo:i-a,conversationId:null,errorDetail:n===x.FAILED?`Prior failure`:null})})]}function Se(e){return{...e,recentRuns:e.recentRuns??xe(e.latestRun)}}var j=[{pin:!0,automation:k(`demo-pin-loading`,`Card: loading skeleton`,{type:`cron`,schedule:`0 * * * *`,schedule_human:`Every hour`}),runState:{latestRun:null,isLoading:!0,isError:!1}},{pin:!0,automation:k(`demo-pin-error`,`Card: status unavailable`,{type:`cron`,schedule:`0 9 * * *`,schedule_human:`Daily at 9am`}),runState:{latestRun:null,isLoading:!1,isError:!0}},{pin:!0,automation:k(`demo-pin-no-runs`,`Card: no runs yet`,{type:`event`,source:`github`,on:`pull_request.opened`}),runState:{latestRun:null,isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-failed-detail`,`Card: failed with error detail`,{type:`cron`,schedule:`*/15 * * * *`,schedule_human:`Every 15 min`}),runState:{latestRun:A(`run-failed-detail`,x.FAILED,{errorDetail:`Sandbox provisioning timed out after 120s while waiting for the runtime to become ready.`,startedHoursAgo:3,completedHoursAgo:2.5}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-completed-title`,`Card: completed + conversation title`,{type:`event`,source:`github`,on:`push`}),runState:{latestRun:A(`run-completed-title`,x.COMPLETED,{conversationId:`demo-conv-titled`,startedHoursAgo:5,completedHoursAgo:4}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-completed-untitled`,`Card: completed + conversation title`,{type:`cron`,schedule:`0 0 * * 1`,schedule_human:`Mondays at midnight`}),runState:{latestRun:A(`run-completed-untitled`,x.COMPLETED,{conversationId:`demo-conv-untitled`,startedHoursAgo:8,completedHoursAgo:7}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-completed-no-conv`,`Card: completed, no conversation`,{type:`cron`,schedule:`0 12 * * *`,schedule_human:`Daily at noon`}),runState:{latestRun:A(`run-completed-no-conv`,x.COMPLETED,{conversationId:null,startedHoursAgo:10,completedHoursAgo:9}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-failed-no-conv`,`Card: failed, no conversation`,{type:`event`,source:`slack`,on:`message`}),runState:{latestRun:A(`run-failed-no-conv`,x.FAILED,{conversationId:null,errorDetail:null,startedHoursAgo:12,completedHoursAgo:11}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-pending`,`Card: pending (empty result panel)`,{type:`cron`,schedule:`0 */6 * * *`,schedule_human:`Every 6 hours`}),runState:{latestRun:A(`run-pending`,x.PENDING,{conversationId:null,startedHoursAgo:.1,completedHoursAgo:null}),isLoading:!1,isError:!1}},{pin:!0,automation:k(`demo-pin-running`,`Card: running (empty result panel)`,{type:`event`,source:`github`,on:`issues.opened`}),runState:{latestRun:A(`run-running`,x.RUNNING,{conversationId:null,startedHoursAgo:.25,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:k(`demo-list-cancelled`,`List: cancelled run`,{type:`cron`,schedule:`30 2 * * *`,schedule_human:`Daily at 2:30am`}),runState:{latestRun:A(`run-cancelled`,x.CANCELLED,{startedHoursAgo:14,completedHoursAgo:13}),isLoading:!1,isError:!1}},{automation:k(`demo-list-skipped`,`List: skipped run`,{type:`event`,source:`github`,on:`pull_request.synchronize`}),runState:{latestRun:A(`run-skipped`,x.SKIPPED,{startedHoursAgo:16,completedHoursAgo:16}),isLoading:!1,isError:!1}},{automation:k(`demo-list-running-2`,`List: second in-flight run`,{type:`cron`,schedule:`*/5 * * * *`,schedule_human:`Every 5 min`}),runState:{latestRun:A(`run-running-2`,x.RUNNING,{conversationId:null,startedHoursAgo:.5,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:k(`demo-list-success-old`,`List: older success`,{type:`cron`,schedule:`0 8 * * 1-5`,schedule_human:`Weekdays at 8am`}),runState:{latestRun:A(`run-success-old`,x.COMPLETED,{conversationId:`demo-conv-titled`,startedHoursAgo:48,completedHoursAgo:47}),isLoading:!1,isError:!1}},{automation:k(`demo-list-failed-old`,`List: older failure`,{type:`event`,source:`github`,on:`release.published`}),runState:{latestRun:A(`run-failed-old`,x.FAILED,{errorDetail:`Model returned an empty completion.`,startedHoursAgo:72,completedHoursAgo:71}),isLoading:!1,isError:!1}},{automation:k(`demo-list-no-runs-2`,`List: never ran`,{type:`cron`,schedule:`0 0 1 * *`,schedule_human:`Monthly on the 1st`}),runState:{latestRun:null,isLoading:!1,isError:!1}},{automation:k(`demo-list-loading-2`,`List: loading status`,{type:`event`,source:`linear`,on:`Issue.create`}),runState:{latestRun:null,isLoading:!0,isError:!1}},{automation:k(`demo-list-error-2`,`List: fetch error`,{type:`cron`,schedule:`15 * * * *`,schedule_human:`Hourly at :15`}),runState:{latestRun:null,isLoading:!1,isError:!0}},{automation:k(`demo-list-pending-2`,`List: pending, long name that should truncate in the activity row when the viewport is narrow`,{type:`cron`,schedule:`0 3 * * 0`,schedule_human:`Sundays at 3am`}),runState:{latestRun:A(`run-pending-2`,x.PENDING,{startedHoursAgo:.05,completedHoursAgo:null}),isLoading:!1,isError:!1}},{automation:k(`demo-list-completed-fallback`,`List: completed with conversation`,{type:`event`,source:`github`,on:`workflow_run.completed`}),runState:{latestRun:A(`run-completed-fallback`,x.COMPLETED,{conversationId:`demo-conv-untitled`,startedHoursAgo:20,completedHoursAgo:19}),isLoading:!1,isError:!1}}];if(j.length!==ve)throw Error(`home-automations-demo: expected ${ve} specs, got ${j.length}`);var Ce=j.filter(e=>e.pin).map(e=>e.automation.id),we=j.map(e=>e.automation),Te=new Map(j.map(e=>[e.automation.id,Se(e.runState)]));function M(e){if(e.isLoading||e.isError)return`unknown`;if(!e.latestRun)return`none`;switch(f(e.latestRun).badgeStatus){case x.COMPLETED:case`success`:return`success`;case x.FAILED:case`failed`:return`failed`;case`blocked`:case`partial_success`:case`unknown`:return`warning`;case x.PENDING:case x.RUNNING:return`in_progress`;default:return`unknown`}}function Ee(e){switch(e){case`success`:return u.FEATURED_AUTOMATIONS$LAST_RUN_SUCCEEDED;case`failed`:return u.FEATURED_AUTOMATIONS$LAST_RUN_FAILED;case`warning`:return u.AUTOMATIONS$DETAIL$NEEDS_REVIEW;case`in_progress`:return u.FEATURED_AUTOMATIONS$RUN_IN_PROGRESS;case`none`:return u.AUTOMATIONS$DETAIL$NO_RUNS;default:return u.FEATURED_AUTOMATIONS$STATUS_UNKNOWN}}var De={github:`GitHub`,gitlab:`GitLab`,slack:`Slack`,linear:`Linear`,jira:`Jira`};function N(e){let t=e.trim().toLowerCase();return t?De[t]??t.replace(/\b\w/g,e=>e.toUpperCase()):e}function P(e){let{trigger:t}=e;return t.type===`event`&&t.on?m(t.on):null}function F(e){let{trigger:t}=e;return t.type===`event`&&t.source?.trim()||null}function I(e){let{trigger:t}=e;return t.type===`event`?null:t.schedule_human||t.schedule||t.type||null}function L(e){let{trigger:t}=e;if(t.type===`event`){let t=F(e);return[P(e)??``,t?`(${N(t)})`:``].filter(Boolean).join(` `)}return I(e)??t.type}var R=48;function z(e){let t=e.trim().replace(/\s+/g,` `);if(!t)return t;let n=t.match(/^.*?[.!?](?=\s|$)/)?.[0]??t;return n.length<=R?n:`${n.slice(0,R-1).trimEnd()}…`}function Oe(e,t=z(e)){return e.trim().replace(/\s+/g,` `)!==t}function B(e){let t=e.completed_at??e.started_at;if(!t)return null;let n=new Date(t).getTime();return Number.isNaN(n)||n===0?null:t}function ke(e,t){let n=[];if(e.repository&&n.push({id:`repository`,node:(0,T.jsxs)(`span`,{className:d(S,`gap-1`),children:[(0,T.jsx)(ae,{className:`size-3 shrink-0`}),e.repository]})}),e.trigger.type===`event`){let t=P(e);t&&n.push({id:`event-trigger`,node:(0,T.jsxs)(`span`,{className:d(S,`gap-1`),children:[(0,T.jsx)(y,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t]})});let r=F(e);if(r){let e=ue(r.toLowerCase(),de);n.push({id:`event-source`,node:(0,T.jsxs)(`span`,{className:d(S,`gap-1`),children:[e?(0,T.jsx)(ie,{entry:e,size:`xs`,testId:`automation-source-logo`}):(0,T.jsx)(ee,{className:`size-3 shrink-0`,"aria-hidden":`true`,"data-testid":`automation-source-logo`}),N(r)]})})}}else n.push({id:`schedule`,node:(0,T.jsxs)(`span`,{className:d(S,`gap-1`),children:[(0,T.jsx)(b,{className:`size-3 shrink-0`}),t]})});return e.model&&n.push({id:`model`,node:(0,T.jsxs)(`span`,{className:d(S,`gap-1`),children:[(0,T.jsx)(_,{className:`size-3 shrink-0`}),e.model]})}),n}var Ae=new Set([x.COMPLETED,x.FAILED]);function V(e){let{badgeStatus:t}=f(e);return t===x.COMPLETED||t===`success`}function je(e){let{badgeStatus:t}=f(e);return t===x.FAILED||t===`failed`||t===`blocked`}function H(e){let t=e.runs.filter(e=>Ae.has(e.status)),n=t.filter(V).length,r;r=e.status_counts?e.status_counts[x.COMPLETED]??0:e.total<=e.runs.length?n:null;let i=t.flatMap(e=>{if(!e.completed_at)return[];let t=new Date(e.completed_at).getTime()-new Date(e.started_at).getTime();return Number.isFinite(t)&&t>=0?[t]:[]});return{total:e.total,completedTotal:r,latestRun:e.runs[0]??null,recentRuns:e.runs,recentSuccessRate:t.length===0?null:n/t.length,averageDurationMs:i.length===0?null:i.reduce((e,t)=>e+t,0)/i.length}}function U(e,t){if(!e.enabled)return`disabled`;if(!t||t.isError||t.isLoading||!t.summary)return`unknown`;let n=t.summary.latestRun;return n?je(n)?`failing`:n.status===x.PENDING||n.status===x.RUNNING?`running`:V(n)?`healthy`:`unknown`:`never-run`}function W(e){return e===null||!Number.isFinite(e)?`—`:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.max(1,Math.round(e/6e4))}m`:`${(e/36e5).toFixed(1)}h`}function G(e,t){let n=t.toLowerCase();return n?e.name.toLowerCase().includes(n)||(e.prompt??``).toLowerCase().includes(n)||e.repository?.toLowerCase().includes(n)===!0||e.model?.toLowerCase().includes(n)===!0:!0}var Me={active:e=>e.enabled,failing:(e,t)=>t===`failing`,disabled:e=>!e.enabled},Ne={event:e=>e.trigger.type===`event`,schedule:e=>e.trigger.type!==`event`};function K(e,t){return t.get(e.id)?.summary?.total??0}function q(e,t){let n=t.get(e.id)?.summary?.latestRun?.started_at??e.last_triggered_at;if(!n)return 0;let r=new Date(n).getTime();return Number.isFinite(r)?r:0}var Pe={"last-run":(e,t,n)=>q(t,n)-q(e,n),runs:(e,t,n)=>K(t,n)-K(e,n),name:(e,t)=>e.name.localeCompare(t.name)};function Fe(e,t,n){return e.filter(e=>!(!G(e,t.search)||t.status!==`all`&&!Me[t.status](e,U(e,n.get(e.id)))||t.trigger!==`all`&&!Ne[t.trigger](e))).sort((e,r)=>Pe[t.sort](e,r,n))}function J(e,t){return e.flatMap(e=>{let n=t.get(e.id);return n?.summary&&!n.isLoading&&!n.isError?[n.summary]:[]})}var Ie={automations:e=>({display:e.length.toLocaleString(),isZero:e.length===0,placeholderValues:{active:e.filter(e=>e.enabled).length}}),"needs-attention":(e,t)=>{let n=e.filter(e=>U(e,t.get(e.id))===`failing`).length;return{display:n.toLocaleString(),isZero:n===0,placeholderValues:{}}},"total-runs":(e,t)=>{let n=J(e,t);if(n.length===0&&e.length>0)return{display:`—`,isZero:!1,placeholderValues:{}};let r=n.reduce((e,t)=>e+t.total,0);return{display:r.toLocaleString(),isZero:r===0,placeholderValues:{}}},"average-duration":(e,t)=>{let n=J(e,t).flatMap(e=>e.averageDurationMs===null?[]:[e.averageDurationMs]);return{display:W(n.length===0?null:n.reduce((e,t)=>e+t,0)/n.length),isZero:!1,placeholderValues:{}}}};function Le(e,t,n){return Ie[e](t,n)}function Re(e){return e?.summary?e.summary.total.toLocaleString():!e||e.isLoading?`…`:`—`}function ze(e){let t=e?.summary?.recentSuccessRate;return t==null?`—`:`${Math.round(t*100)}%`}function Be(e){return W(e?.summary?.averageDurationMs??null)}function Ve({state:e,copy:t}){return(0,T.jsx)(`dl`,{"data-testid":`automation-run-stats`,className:`grid grid-cols-3 gap-2 text-xs`,children:[{label:t.runs,value:Re(e)},{label:t.recentSuccess,value:ze(e)},{label:t.averageDuration,value:Be(e)}].map(e=>(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`dt`,{className:`truncate text-muted`,children:e.label}),(0,T.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-content`,children:e.value})]},e.label))})}var He={latestRun:null,recentRuns:[],isLoading:!1,isError:!1};function Ue(e){return e?{latestRun:e.summary?.latestRun??null,recentRuns:e.summary?.recentRuns??[],total:e.summary?.total,isLoading:e.isLoading,isError:e.isError}:He}function We(e){return e.recentRuns.length===0&&(e.isLoading||e.isError)?{summary:null,isLoading:e.isLoading,isError:e.isError}:{summary:H({runs:e.recentRuns,total:e.total??e.recentRuns.length}),isLoading:e.isLoading,isError:e.isError}}function Y(e){return e?.status===x.PENDING||e?.status===x.RUNNING}function Ge(e,t){let{t:n}=o(`openhands`),{navigate:r}=ne(),{canManage:i}=pe(),a=fe(e),c=i||a,d=E(),f=se(),p=le(),m=ce(),[h,g]=(0,w.useState)(!1),[_,v]=(0,w.useState)(!1);return{canManage:c,isRunPending:f.isPending&&f.variables===e.id,isCancelPending:m.isPending&&m.variables?.runId===t?.id,canCancel:c&&Y(t),editOpen:h,setEditOpen:g,turnOffConfirmOpen:_,runNow:(0,w.useCallback)(()=>{if(d){s(n(u.AUTOMATIONS$RUN_NOW_SUCCESS));return}f.mutate(e.id,{onSuccess:()=>{s(n(u.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:e=>{l(C(e,n(u.AUTOMATIONS$RUN_NOW_ERROR)))}})},[e.id,f,d,n]),viewDetails:(0,w.useCallback)(()=>{r?.(`/automations/${e.id}`)},[e.id,r]),openEdit:(0,w.useCallback)(()=>{g(!0)},[]),requestTurnOff:(0,w.useCallback)(()=>{v(!0)},[]),confirmTurnOff:(0,w.useCallback)(()=>{v(!1),!d&&p.mutate({id:e.id,enabled:!1},{onError:e=>{l(C(e,n(u.AUTOMATIONS$TURN_OFF_ERROR)))}})},[e.id,d,n,p]),cancelTurnOff:(0,w.useCallback)(()=>{v(!1)},[]),cancelRun:(0,w.useCallback)(()=>{if(!(!t||!Y(t))){if(d){s(n(u.AUTOMATIONS$CANCEL_RUN_SUCCESS));return}m.mutate({automationId:e.id,runId:t.id},{onSuccess:()=>{s(n(u.AUTOMATIONS$CANCEL_RUN_SUCCESS))},onError:e=>{l(C(e,n(u.AUTOMATIONS$CANCEL_RUN_ERROR)))}})}},[e.id,m,d,t,n])}}var Ke=`openhands-automations-view`;function qe(){return typeof window>`u`?`grid`:window.localStorage.getItem(`openhands-automations-view`)===`list`?`list`:`grid`}function Je(e){window.localStorage.setItem(Ke,e)}var Ye=`divide-y divide-[var(--oh-border-subtle)] overflow-hidden rounded-xl border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]`,Xe=`group relative flex items-stretch transition-colors hover:bg-surface-raised has-[:focus-visible]:bg-surface-raised`,Ze=`mt-3 flex min-h-9 items-center justify-between gap-2 overflow-hidden rounded-md border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)] px-3 py-2 text-xs`,X=1e3,Z=30*6e4;function Q(e,t=Date.now()){let n=e.started_at?new Date(e.started_at).getTime():NaN;if(Number.isNaN(n)||n<=0)return null;if(e.completed_at){let t=new Date(e.completed_at).getTime();return Number.isNaN(t)||t<n?null:t-n}return e.status===x.PENDING||e.status===x.RUNNING?Math.max(0,t-n):null}function Qe(e){if(e==null||e<=0)return 11;let t=Math.log(Math.min(Z,Math.max(X,e))/X)/Math.log(Z/X);return Math.round(6+t*9)}function $e(e){switch(e){case x.COMPLETED:case`success`:return`bg-[var(--oh-status-success)]`;case x.FAILED:case`failed`:return`bg-[var(--oh-status-error)]`;case`blocked`:case`partial_success`:case`unknown`:return`bg-[var(--oh-warning)]`;case x.RUNNING:return`bg-[var(--oh-status-success)] animate-pulse motion-reduce:animate-none`;case x.PENDING:return`bg-[repeating-linear-gradient(-45deg,var(--oh-muted)_0_1.5px,var(--oh-border)_1.5px_3px)]`;case x.CANCELLED:return`bg-[var(--oh-muted)]`;default:return`bg-[var(--oh-border)]`}}function et(e){return v(e)}function tt(e){return e==null||e<=0?null:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.round(e/6e4)}m`:`${(e/36e5).toFixed(1)}h`}function nt({label:e,children:t}){return(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,T.jsx)(`span`,{className:`w-16 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-white`,children:t})]})}function rt({run:e,nowMs:t}){let{t:n,i18n:r}=o(`openhands`),i=B(e),a=i?g(i,r.language,n):null,s=tt(Q(e,t)),c=f(e),l=n(et(c.badgeStatus));return(0,T.jsxs)(`div`,{className:`flex w-[220px] flex-col gap-2 p-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{"aria-hidden":`true`,className:d(`h-3 w-1.5 shrink-0 rounded-[1px]`,$e(c.badgeStatus))}),(0,T.jsx)(`span`,{className:`text-sm font-medium text-white`,children:l})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[a?(0,T.jsx)(nt,{label:n(u.AUTOMATIONS$DETAIL$LAST_RUN),children:a}):null,s?(0,T.jsx)(nt,{label:n(u.FEATURED_AUTOMATIONS$RUN_DURATION),children:s}):null]}),c.summary?(0,T.jsx)(`p`,{className:`line-clamp-3 text-xs text-[var(--oh-text-secondary)]`,children:c.summary}):null]})}function it({automationId:e,run:t,nowMs:r}){let{t:i}=o(`openhands`),a=Q(t,r),s=f(t),c=i(et(s.badgeStatus)),l=`/automations/${encodeURIComponent(e)}?run=${encodeURIComponent(t.id)}`;return(0,T.jsx)(n,{content:(0,T.jsx)(rt,{run:t,nowMs:r}),placement:`top`,closeDelay:80,delay:200,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,children:(0,T.jsx)(re,{to:l,"aria-label":c,className:`group/spark-bar inline-flex h-full cursor-pointer items-end px-[2px] focus:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-focus)]`,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,T.jsx)(`span`,{className:d(`w-1 shrink-0 origin-bottom rounded-[1px]`,`transition-transform duration-100 ease-out motion-reduce:transition-none`,`group-hover/spark-bar:scale-x-[1.4] group-hover/spark-bar:scale-y-[1.15]`,`group-focus-visible/spark-bar:scale-x-[1.4] group-focus-visible/spark-bar:scale-y-[1.15]`,$e(s.badgeStatus)),style:{height:Qe(a)}})})})}function at({automationId:e,runs:t,testId:n}){let{t:r}=o(`openhands`),i=t.some(e=>Y(e)),[a,s]=(0,w.useState)(()=>Date.now());if((0,w.useEffect)(()=>{if(!i)return;let e=window.setInterval(()=>s(Date.now()),1e3);return()=>window.clearInterval(e)},[i]),t.length===0)return null;let c=[...t].reverse().slice(-12);return(0,T.jsx)(`span`,{"data-testid":n,"aria-label":r(u.FEATURED_AUTOMATIONS$RUN_ACTIVITY_LABEL,{count:c.length}),className:`inline-flex shrink-0 items-end`,style:{height:18},onMouseDown:e=>e.preventDefault(),children:c.map((t,n)=>(0,T.jsx)(it,{automationId:e,run:t,nowMs:a},`${t.id}-${n}`))})}function ot({health:e}){return e===`success`?(0,T.jsx)(`svg`,{viewBox:`0 0 12 12`,className:`h-2.5 w-2.5 shrink-0 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,T.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})}):(0,T.jsx)(`span`,{"aria-hidden":`true`,className:d(`h-1.5 w-1.5 shrink-0 rounded-full`,e===`failed`&&`bg-[var(--oh-status-error)]`,e===`warning`&&`bg-[var(--oh-warning)]`,e===`in_progress`&&`animate-pulse bg-[var(--oh-status-success)] motion-reduce:animate-none`,(e===`none`||e===`unknown`)&&`bg-[var(--oh-border)]`)})}function st(e){return e.isError?u.FEATURED_AUTOMATIONS$STATUS_UNAVAILABLE:e.latestRun?v(f(e.latestRun).badgeStatus):Ee(M(e))}function $({label:e,children:t}){return(0,T.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,T.jsx)(`span`,{className:`w-20 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-[var(--oh-foreground)]`,children:t})]})}function ct({run:e}){let{t}=o(`openhands`),n=p({status:e?.status,code:e?.phase_code,label:e?.phase_label,updatedAt:e?.phase_updated_at});if(!e||!h(e.status)||!n)return null;let{text:r,age:i}=n;return(0,T.jsx)($,{label:t(u.AUTOMATIONS$DETAIL$PHASE),children:(0,T.jsxs)(`span`,{"data-testid":`run-phase-row`,children:[r,i?(0,T.jsxs)(`span`,{className:`text-muted`,children:[` · `,i]}):null]})})}function lt({automation:e,runState:t}){let{t:n,i18n:r}=o(`openhands`),{latestRun:i}=t,a=i?B(i):null,s=e.trigger.type===`event`?y:b,c=M(t),l=i?f(i):null;return(0,T.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-3 p-3`,children:[(0,T.jsx)(`span`,{className:`break-words text-sm font-medium text-white`,children:e.name}),(0,T.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$TRIGGER),children:(0,T.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,T.jsx)(s,{className:`mt-0.5 size-3 shrink-0`,"aria-hidden":`true`}),(0,T.jsx)(`span`,{className:`break-all`,children:L(e)})]})}),(0,T.jsx)($,{label:n(u.COMMON$STATUS),children:(0,T.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,T.jsx)(ot,{health:c}),(0,T.jsx)(`span`,{children:n(st(t))})]})}),(0,T.jsx)(ct,{run:i}),a?(0,T.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$LAST_RUN),children:g(a,r.language,n)}):null,l?.summary?(0,T.jsx)($,{label:n(u.AUTOMATIONS$DETAIL$TASK_LABEL),children:(0,T.jsx)(`span`,{className:`line-clamp-3 text-[var(--oh-text-secondary)]`,children:l.summary})}):null]})]})}export{Te as A,I as C,Oe as D,z as E,me as F,E as M,_e as N,we as O,he as P,P as S,L as T,H as _,Ye as a,N as b,qe as c,Ue as d,We as f,G as g,Le as h,at as i,be as j,Ce as k,Je as l,Fe as m,st as n,Xe as o,Ve as p,ot as r,Ze as s,lt as t,Ge as u,ke as v,F as w,B as x,M as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t}from"./home-Ivfm7KC4.js";import{n}from"./use-pinned-home-route-BXDIUaxQ.js";var r=()=>{let t=n();return t?e(t):null};export{r as clientLoader,t as default};
|