@openhands/agent-canvas 1.18.0 → 1.19.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-BQ4o4vqy.js +1 -0
- package/build/assets/{active-backend-context-BnH4-L8h.js → active-backend-context-BsLfwrXB.js} +1 -1
- package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-D9i6ezoJ.js} +1 -1
- package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-U-9YzDFU.js} +1 -1
- package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-D-bUV2PX.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-BaVQ6NpE.js +88 -0
- package/build/assets/agent-settings-BZJHtaIK.js +2 -0
- package/build/assets/agent-settings-D4snDd6u.js +1 -0
- package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-BkVt_8Or.js} +1 -1
- package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-fAIld-n7.js} +1 -1
- package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DITbrM2u.js} +1 -1
- package/build/assets/automation-detail-DawHmaOl.js +3 -0
- package/build/assets/automation-disabled-reason-DtgC8Ppt.js +1 -0
- package/build/assets/{automation-export-BJsfi7n2.js → automation-export-Kv6e0bHx.js} +1 -1
- package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-Dd98G_Oz.js} +1 -1
- package/build/assets/{automation-setup-route-qaJ6lLCf.js → automation-setup-route-Cdc109ZD.js} +1 -1
- package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-Xhr-FDAB.js} +1 -1
- package/build/assets/automations-list-BeP1LuzQ.js +1 -0
- package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-DWNiN277.js} +1 -1
- package/build/assets/backend-form-modal-DeaUJIik.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-Br85iWIY.js} +1 -1
- package/build/assets/{badge-ehL-kgeO.js → badge-Cdnei7Ly.js} +1 -1
- package/build/assets/{base-modal-C1a0TsSx.js → base-modal-Ds7grR67.js} +1 -1
- package/build/assets/{brand-button-CUMfjb99.js → brand-button-mQq2Ld1I.js} +1 -1
- package/build/assets/{browser-SE24Tk8g.js → browser-Bfum8fkE.js} +2 -2
- package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-CmYT4j_r.js} +1 -1
- package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-CokKSVRG.js} +1 -1
- package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-BoQEYG-2.js} +1 -1
- package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-Du2M5iEX.js} +1 -1
- package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-DM3JgMc2.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-BbYBiUwv.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-D02kgq1s.js} +1 -1
- package/build/assets/{cog-CAEugqtV.js → cog-Dy1eWbSZ.js} +1 -1
- package/build/assets/{command-menu-CQxs4mtX.js → command-menu-mehU3Evb.js} +1 -1
- package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-DhQW8CXi.js} +1 -1
- package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-eRk6Fkx6.js} +1 -1
- package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-BmVt_c0I.js} +1 -1
- package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-lx2zk9G7.js} +1 -1
- package/build/assets/{conversation-B_nweu5p.js → conversation-BOj0ENI6.js} +4 -4
- package/build/assets/conversation-SouWlGvs.js +1 -0
- package/build/assets/conversation-panel-SouWlGvs.js +1 -0
- package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-C6YncQNo.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-DIhwCC2J.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-DVNXLylP.js} +1 -1
- package/build/assets/{device-verify-D5QRIS_x.js → device-verify-LP-x7nra.js} +1 -1
- package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-goDldkiu.js} +1 -1
- package/build/assets/edit-automation-modal-BJJR9wSW.js +1 -0
- package/build/assets/empty-state-Cd-TFe7i.js +1 -0
- package/build/assets/{entry.client-BMafTpjO.js → entry.client-CJdjIvMZ.js} +2 -2
- package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-pocrz9AL.js} +1 -1
- package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-Dwe78wRl.js} +1 -1
- package/build/assets/{error-state-Cf8LRuuY.js → error-state-SuWwztxV.js} +1 -1
- package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-O0esK3Er.js} +1 -1
- package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-CgCVSXje.js} +1 -1
- package/build/assets/{files-tab-D5PPIWI1.js → files-tab-B_6t8ljw.js} +1 -1
- package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-lQfLxzH4.js} +1 -1
- package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-Bp5rsUkl.js} +1 -1
- package/build/assets/git-repo-dropdown-CbD0_LPN.js +1 -0
- package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DPQVumZg.js} +1 -1
- package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-Bp0sgK-f.js} +1 -1
- package/build/assets/home-BghzJd-D.js +1 -0
- package/build/assets/home-CXZ8zawS.js +1 -0
- package/build/assets/home-automation-run-tooltip-BdpCckKO.js +1 -0
- package/build/assets/{home-store-DCbei3DX.js → home-store-DNQpfIEO.js} +1 -1
- package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-DkxnQa4N.js} +1 -1
- package/build/assets/index-home-Ca6Q5CtT.js +1 -0
- package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DvxxYKia.js} +1 -1
- package/build/assets/{key-O84CMFHb.js → key-CwTE6XJj.js} +1 -1
- package/build/assets/{launch-ZLxI4opd.js → launch-jsRGPRBx.js} +1 -1
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/{llm-not-configured-banner-Dh_ajcM8.js → llm-not-configured-banner-DMdL1vaX.js} +4 -4
- package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-dkQ5Oq7W.js} +1 -1
- package/build/assets/llm-settings-lNDerSlu.js +1 -0
- package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-BiQaZbvv.js} +1 -1
- package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-DK1sAwVg.js} +1 -1
- package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-DqCJohsX.js} +1 -1
- package/build/assets/manifest-ff93dc8c.js +1 -0
- package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-sxuPqfUr.js} +1 -1
- package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-BH5pqDuJ.js} +1 -1
- package/build/assets/mcp-BtaJDXnP.js +1 -0
- package/build/assets/mcp-installed-servers-Br4ZLsjr.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-DwbnQpVs.js +9 -0
- package/build/assets/{messages-Bk1xhbU2.js → messages-DmFJlW6c.js} +4 -4
- package/build/assets/{modal-body-C24WsdFb.js → modal-body-DBweM2EN.js} +1 -1
- package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-jvG85nkU.js} +1 -1
- package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-BrM5fNnn.js} +1 -1
- package/build/assets/onboarding-CQ8T6T0U.js +1 -0
- package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-CnliiaSN.js} +1 -1
- package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-DmFUEmu5.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-CXph_C9F.js} +1 -1
- package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-CcEpfNKz.js} +1 -1
- package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-DdF_4Zhe.js} +1 -1
- package/build/assets/{providers-XmZ9HM4Q.js → providers-BWRnl31s.js} +1 -1
- package/build/assets/{proxy-XP6U1Dhv.js → proxy-DbEf3Nqr.js} +1 -1
- package/build/assets/recommended-automations-launcher-r0oI91HN.js +1 -0
- package/build/assets/root-j2fFRlWS.js +2 -0
- package/build/assets/{root-layout-DUquNZTU.js → root-layout-CfGgm2lo.js} +2 -2
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-c3Ncgm4x.js} +1 -1
- package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DFEiuiFQ.js} +1 -1
- package/build/assets/{secret-form-9-BoGA40.js → secret-form-WXXNFqTM.js} +1 -1
- package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-DU6wh3wX.js} +1 -1
- package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BEqbPvjy.js} +1 -1
- package/build/assets/{settings-D4hdToD4.js → settings-DjaSQwFh.js} +1 -1
- package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-BRR2OZwi.js} +1 -1
- package/build/assets/{settings-index-DeQphyBK.js → settings-index-DHv4XFcM.js} +1 -1
- package/build/assets/{settings-input-dVuzapBA.js → settings-input-Cm4VxUon.js} +1 -1
- package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-CaUfKZ33.js} +1 -1
- package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-djXuAnBO.js} +1 -1
- package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-DFb3hBMr.js} +1 -1
- package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-Q9lKW1TX.js} +1 -1
- package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-seaSJc7t.js} +1 -1
- package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-x3rxVCon.js} +1 -1
- package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-B6mcvvdV.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-CEqS8KnA.js} +1 -1
- package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-BTHX11LG.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-BP1kzn6p.js} +1 -1
- package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-TD39nfP3.js} +1 -1
- package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-CdBbbwjm.js} +1 -1
- package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-vUEp7gsC.js} +1 -1
- package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-BTRBQt0-.js} +1 -1
- package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-k1tUNAw4.js} +1 -1
- package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-CENviPT7.js} +1 -1
- package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-DVAlWYnL.js} +1 -1
- package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-BLKF_x9f.js} +1 -1
- package/build/assets/{terminal-Dph60VFZ.js → terminal-Ckbnqb23.js} +1 -1
- package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-DeiG9Mf6.js} +1 -1
- package/build/assets/trash-CXN2R54L.js +1 -0
- package/build/assets/{typography-DgcLGdHk.js → typography-NarNyelM.js} +1 -1
- package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-Drd3O006.js} +1 -1
- package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-CJ5wPsQm.js} +1 -1
- package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-iQZ0U3qV.js} +1 -1
- package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-LCvb5OXT.js} +1 -1
- package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-DdgSa8sA.js} +1 -1
- package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-D3kEeieu.js} +1 -1
- package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-CEubcYTD.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-CB8ybxFK.js} +1 -1
- package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BMacwi2v.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-BEKRd6XZ.js} +1 -1
- package/build/assets/{use-config-l5tkDHyD.js → use-config-3WYcJsgC.js} +1 -1
- package/build/assets/{use-create-conversation-i_PdFdIs.js → use-create-conversation-Be-eVpFp.js} +1 -1
- package/build/assets/use-create-secret-Bk9ZxTjl.js +1 -0
- package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-Ci3FkKEm.js} +1 -1
- package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-fqS0kxt6.js} +1 -1
- package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-B71ZEVg2.js} +1 -1
- package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-xtCBMbef.js} +1 -1
- package/build/assets/{use-manifest-capabilities-CdqYfUAC.js → use-manifest-capabilities-Bso6A_-A.js} +1 -1
- package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-CEgjL02y.js} +1 -1
- package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-pK4IlJ-p.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-B8-ZEB34.js} +1 -1
- package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-D7hJuW_u.js} +1 -1
- package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CikTu5xV.js} +1 -1
- package/build/assets/{use-settings-C2KKQKVC.js → use-settings-BWIH5EuN.js} +1 -1
- package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-DSKwLDnd.js} +1 -1
- package/build/assets/use-tracking-ChnSFChv.js +3 -0
- package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-C_l65DqW.js} +1 -1
- package/build/assets/utils-D-gOfhmN.js +1 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +2 -0
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js +48 -0
- package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-PKtoIUUY.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +10 -0
- package/build/locales/ca/openhands.json +10 -0
- package/build/locales/de/openhands.json +10 -0
- package/build/locales/en/openhands.json +10 -0
- package/build/locales/es/openhands.json +10 -0
- package/build/locales/fr/openhands.json +10 -0
- package/build/locales/it/openhands.json +10 -0
- package/build/locales/ja/openhands.json +10 -0
- package/build/locales/ko-KR/openhands.json +10 -0
- package/build/locales/no/openhands.json +10 -0
- package/build/locales/pt/openhands.json +10 -0
- package/build/locales/tr/openhands.json +10 -0
- package/build/locales/uk/openhands.json +10 -0
- package/build/locales/zh-CN/openhands.json +10 -0
- package/build/locales/zh-TW/openhands.json +10 -0
- package/config/defaults.json +3 -3
- 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/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/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 +10 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +170 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +10 -0
- package/dist/locales/ca/openhands.json +10 -0
- package/dist/locales/de/openhands.json +10 -0
- package/dist/locales/en/openhands.json +10 -0
- package/dist/locales/es/openhands.json +10 -0
- package/dist/locales/fr/openhands.json +10 -0
- package/dist/locales/it/openhands.json +10 -0
- package/dist/locales/ja/openhands.json +10 -0
- package/dist/locales/ko-KR/openhands.json +10 -0
- package/dist/locales/no/openhands.json +10 -0
- package/dist/locales/pt/openhands.json +10 -0
- package/dist/locales/tr/openhands.json +10 -0
- package/dist/locales/uk/openhands.json +10 -0
- package/dist/locales/zh-CN/openhands.json +10 -0
- package/dist/locales/zh-TW/openhands.json +10 -0
- 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/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/desktop-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-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/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/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 -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 +2 -2
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +5 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +23 -1
- 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 +2 -2
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +1 -1
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DcY_mKYa.js +0 -1
- 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/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-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-secret-CjWq0J4O.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
|
@@ -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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,i as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{i as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{K as a,t as o}from"./utils-BgLSZdyy.js";import{c as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js";import{t as c}from"./loader-circle-BxJgk73D.js";import{t as l}from"./styled-tooltip-CejG0rqv.js";import{u}from"./dropdown-classes-BGvOvW2_.js";import{n as d}from"./use-automation-health-U99vvHxx.js";import{t as f}from"./automation-C_eCrGyP.js";var p=r(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);e();var m=n(),ee=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456z`})}),te=[`success`,`partial_success`,`blocked`,`failed`,`unknown`];function h(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function g(e){return typeof e==`string`&&te.includes(e)}function _(e){return typeof e==`string`&&e.trim()||null}var v=new Set([`status`,`outcome_summary`]);function y(e){return e.run_metadata?.finish_tool_response??null}function b(e){let t=_(e);if(t)return t;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function x(e){if(e==null)return null;if(!h(e))return e;let t=Object.entries(e).filter(([e])=>!v.has(e));return t.length>0?Object.fromEntries(t):`status`in e&&!g(e.status)?{status:e.status}:null}function S(e){let t=y(e);if(!h(t))return null;let n=_(t.outcome_summary);return typeof t.status!=`string`&&!n?null:{status:g(t.status)?t.status:`unknown`,outcomeSummary:n}}function C(e){let t=y(e),n=x(t),r=b(n),i=S(e),a=_(e.error_detail);return e.status===f.COMPLETED?{badgeStatus:i?.status??(t===null?`success`:`unknown`),summary:i?.outcomeSummary??null,taskOutcome:i,customTaskMetadata:n,customTaskMetadataText:r}:{badgeStatus:e.status,summary:a,taskOutcome:i,customTaskMetadata:n,customTaskMetadataText:r}}function w(e){switch(e){case f.COMPLETED:case`success`:return a.AUTOMATIONS$DETAIL$SUCCESSFUL;case f.FAILED:case`failed`:return a.AUTOMATIONS$DETAIL$FAILED;case f.PENDING:return a.AUTOMATIONS$DETAIL$PENDING;case f.RUNNING:return a.AUTOMATIONS$DETAIL$RUNNING;case f.CANCELLED:return a.AUTOMATIONS$DETAIL$CANCELLED;case f.SKIPPED:return a.AUTOMATIONS$DETAIL$SKIPPED;case`blocked`:return a.AUTOMATIONS$DETAIL$BLOCKED;case`partial_success`:return a.AUTOMATIONS$DETAIL$PARTIAL;case`unknown`:return a.AUTOMATIONS$DETAIL$NEEDS_REVIEW;default:return a.FEATURED_AUTOMATIONS$STATUS_UNKNOWN}}var T=/^(\d+)$/;function E(e,t,n){let r=e.match(T);if(!r)return null;let i=Number(r[1]);return Number.isNaN(i)||i<t||i>n?null:i}function ne(e){let t=(e??``).trim();if(!t)return{kind:`custom`,raw:``};let n=t.split(/\s+/);if(n.length!==5)return{kind:`custom`,raw:t};let[r,i,a,o,s]=n,c=E(r,0,59),l=E(i,0,23);if(c===null||l===null)return{kind:`custom`,raw:t};if(a!==`*`||o!==`*`)return{kind:`custom`,raw:t,hour:l,minute:c};if(s===`*`||s===`0-6`)return{kind:`daily`,hour:l,minute:c};if(s===`1-5`)return{kind:`weekdays`,hour:l,minute:c};let u=E(s,0,6);return u===null?{kind:`custom`,raw:t,hour:l,minute:c}:{kind:`weekly`,hour:l,minute:c,weekday:u}}function re(e){let{kind:t,hour:n,minute:r,weekday:i}=e;switch(t){case`daily`:return`${r} ${n} * * *`;case`weekdays`:return`${r} ${n} * * 1-5`;case`weekly`:return`${r} ${n} * * ${i??1}`;default:return t}}function D(e,t){return`${String(e).padStart(2,`0`)}:${String(t).padStart(2,`0`)}`}function O(e){let t=e.match(/^(\d{1,2}):(\d{2})$/);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return Number.isNaN(n)||Number.isNaN(r)||n<0||n>23||r<0||r>59?null:{hour:n,minute:r}}function k(e){return e?Array.isArray(e)?e.join(`, `):e:`—`}var A=`*/10 * * * *`,j=new Set([`@yearly`,`@annually`,`@monthly`,`@weekly`,`@daily`,`@midnight`,`@hourly`]),M=5,N=7,P=[[0,59],[0,23],[1,31],[1,12],[0,7]],F=2,I=3,L=[0,31,29,31,30,31,30,31,31,30,31,30,31],R=`JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC`,z=`SUN|MON|TUE|WED|THU|FRI|SAT`,B=/^(\*|\d+(?:-\d+)?)(?:\/(\d+))?$/,V=[null,null,/^(?:\?|L|\d+W)$/i,RegExp(`^(?:${R})(?:-(?:${R}))?(?:/\\d+)?$`,`i`),RegExp(`^(?:(?:${z}|\\d+)(?:-(?:${z}|\\d+))?(?:/\\d+)?(?:#\\d+)?|\\?)$`,`i`)];function H(e,[t,n],r){let i=new Set;for(let a of e.split(`,`)){let e=a.match(B);if(!e)return r?.test(a)?{kind:`unmodelled`}:{kind:`invalid`};let[,o,s]=e,c=s===void 0?1:Number(s);if(c<1)return{kind:`invalid`};if(o===`*`){for(let e=t;e<=n;e+=c)i.add(e);continue}let[l,u]=o.split(`-`),d=E(l,t,n);if(d===null)return{kind:`invalid`};if(u===void 0){i.add(d);continue}let f=E(u,t,n);if(f===null)return{kind:`invalid`};if(f<d)return{kind:`unmodelled`};for(let e=d;e<=f;e+=c)i.add(e)}return{kind:`values`,values:[...i]}}function ie(e){let t=e.trim();if(!t)return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};if(t.startsWith(`@`))return j.has(t.toLowerCase())?{schedule:t}:{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let n=t.split(/\s+/);if(n.length<M||n.length>N)return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let r=P.map((e,t)=>H(n[t],e,V[t]));if(r.some(e=>e.kind===`invalid`))return{errorKey:a.AUTOMATIONS$ERROR_CRON_INVALID};let i=r[F],o=r[I];return i.kind===`values`&&o.kind===`values`&&!o.values.some(e=>i.values.some(t=>t<=L[e]))?{errorKey:a.AUTOMATIONS$ERROR_CRON_UNREACHABLE}:{schedule:t}}function U(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function W(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function G(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),o=Math.floor(r/36e5),s=Math.floor(r/864e5);return i<1?n(a.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(a.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):o<24?n(a.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:o}):s===1?n(a.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(a.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):U(e,t)}function K(e){return e===f.FAILED||e===f.PENDING||e===f.RUNNING}function q(e){return e===f.PENDING||e===f.RUNNING}var J={queued:a.AUTOMATIONS$DETAIL$PHASE_QUEUED,sandbox_provisioning:a.AUTOMATIONS$DETAIL$PHASE_SANDBOX_PROVISIONING,bundle_upload:a.AUTOMATIONS$DETAIL$PHASE_BUNDLE_UPLOAD,entrypoint_start:a.AUTOMATIONS$DETAIL$PHASE_ENTRYPOINT_START,preparing:a.AUTOMATIONS$DETAIL$PHASE_PREPARING,running_agent:a.AUTOMATIONS$DETAIL$PHASE_RUNNING_AGENT};function Y(e,t,n){let r=t&&Object.hasOwn(J,t)?J[t]:void 0;return r?e(r):n?.trim()||t?.trim()||null}function ae(e,t,n){return!e||W(e)?null:G(e,t,n)}function X({status:e,code:t,label:n,updatedAt:r}){let{t:a,i18n:o}=i(`openhands`),s=Y(a,t,n);return s?{text:s,age:q(e)?ae(r,o.language,a):null}:null}function oe({status:e,code:n,label:r,updatedAt:i,wide:a=!1}){let s=X({status:e,code:n,label:r,updatedAt:i});if(!s)return null;let{text:c,age:l}=s;return(0,m.jsx)(t,{content:(0,m.jsxs)(m.Fragment,{children:[c,l?(0,m.jsx)(`span`,{className:`mt-1 block text-muted`,children:l}):null]}),placement:`top`,closeDelay:100,disableAnimation:!1,classNames:{content:`max-w-xs whitespace-pre-wrap break-words rounded-xl border border-[var(--oh-border)] bg-base-secondary px-3 py-2 text-left text-xs text-white shadow-xl`},children:(0,m.jsxs)(`span`,{className:`flex min-w-0 cursor-default items-center gap-1`,children:[(0,m.jsx)(`span`,{"data-testid":`run-phase`,className:o(`min-w-0 truncate text-xs text-muted`,a?`max-w-[28rem]`:`max-w-[12rem]`),children:c}),l?(0,m.jsxs)(`span`,{"data-testid":`run-phase-age`,className:`shrink-0 whitespace-nowrap text-xs text-muted`,children:[`· `,l]}):null]})})}var Z=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),se=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Q={[f.COMPLETED]:{style:`bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,iconTone:`text-[var(--oh-success)]`},success:{style:`bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,iconTone:`text-[var(--oh-success)]`},[f.FAILED]:{style:`bg-[var(--oh-danger)]/10 text-danger`,iconTone:`text-danger`},failed:{style:`bg-[var(--oh-danger)]/10 text-danger`,iconTone:`text-danger`},blocked:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},partial_success:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},unknown:{style:`bg-[var(--oh-warning)]/10 text-[var(--oh-warning)]`,iconTone:`text-[var(--oh-warning)]`},[f.PENDING]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.RUNNING]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.CANCELLED]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`},[f.SKIPPED]:{style:`bg-surface-raised text-muted`,iconTone:`text-muted`}};function $({status:e,compact:t=!1}){let n=t?`size-3`:`size-3.5`;switch(e){case f.COMPLETED:case`success`:return(0,m.jsx)(Z,{"data-testid":`run-status-icon-completed`,className:n});case f.FAILED:case`failed`:return(0,m.jsx)(se,{"data-testid":`run-status-icon-failed`,className:n});case f.RUNNING:return(0,m.jsx)(c,{"data-testid":`run-status-icon-running`,className:o(n,`animate-spin motion-reduce:animate-none`),"aria-hidden":`true`});case`blocked`:case`partial_success`:return(0,m.jsx)(s,{"data-testid":`run-status-icon-warning`,className:n,"aria-hidden":`true`});case`unknown`:return(0,m.jsx)(p,{"data-testid":`run-status-icon-needs-review`,className:n,"aria-hidden":`true`});default:return(0,m.jsx)(d,{"data-testid":`run-status-icon-pending`,className:n})}}function ce({status:e,iconOnly:t=!1,showLabel:n=!1,compact:r=!1}){let{t:a}=i(`openhands`),s=Q[e]??Q[f.PENDING],c=a(w(e));return t?n?(0,m.jsxs)(`span`,{"data-testid":`run-status-badge-icon`,className:o(`inline-flex min-w-0 shrink-0 items-center gap-1.5 text-xs font-medium`,s.iconTone),children:[(0,m.jsx)($,{status:e,compact:r}),(0,m.jsx)(`span`,{className:`truncate`,children:c})]}):(0,m.jsx)(l,{content:c,placement:`top`,children:(0,m.jsx)(`span`,{role:`img`,"aria-label":c,"data-testid":`run-status-badge-icon`,className:o(`inline-flex shrink-0 cursor-default items-center justify-center`,s.iconTone),children:(0,m.jsx)($,{status:e,compact:r})})}):(0,m.jsxs)(`span`,{className:o(`inline-flex items-center rounded-full font-medium`,r?`gap-1 pl-1 pr-1.5 py-0 text-[10px] leading-4`:`gap-1.5 pl-2 pr-2.5 py-1 text-xs`,s.style),children:[(0,m.jsx)($,{status:e,compact:r}),c]})}var le=e=>(0,m.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,m.jsx)(`path`,{d:`M8.4 3.9c-1.1-.66-2.5.13-2.5 1.4v13.4c0 1.27 1.4 2.06 2.5 1.4l11.2-6.7c1.06-.64 1.06-2.16 0-2.8L8.4 3.9Z`,fill:`currentColor`})}),ue=e=>(0,m.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5.636 5.636a9 9 0 1012.728 0M12 3v9`})});function de({icon:e,label:t}){return(0,m.jsxs)(`span`,{className:`flex min-w-0 w-full items-center gap-2`,children:[(0,m.jsx)(`span`,{className:o(`[&_svg]:size-4`,u),"aria-hidden":!0,children:e}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}export{O as _,Z as a,C as b,X as c,W as d,A as f,ne as g,D as h,ce as i,U as l,k as m,ue as n,oe as o,re as p,le as r,K as s,de as t,G as u,ie as v,ee as x,w as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,n.jsx)(`path`,{d:`M7.062 8.367L3.0915 12.336L7.062 16.305L6 17.367L1.5 12.867V11.805L6 7.305L7.062 8.367ZM17.562 7.305L16.5 8.367L20.4705 12.336L16.5 16.305L17.562 17.367L22.062 12.867V11.805L17.562 7.305ZM7.362 19.5L8.703 20.172L16.203 5.172L14.862 4.5L7.362 19.5Z`,fill:`currentColor`})}),i=e=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,n.jsx)(`path`,{d:`M2.25 1.5H9V3H3V21H21V15H22.5V21.75L21.75 22.5H2.25L1.5 21.75V2.25L2.25 1.5Z`,fill:`currentColor`}),(0,n.jsx)(`path`,{d:`M22.5 2.25V12H21V4.0605L10.8645 14.1975L9.80402 13.1355L19.9395 3H12V1.5H21.75L22.5 2.25Z`,fill:`currentColor`})]});export{r as n,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./llm-settings-CODhjQzy.js";export{e as default};
|