@openhands/agent-canvas 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/acp-providers-DOKcGeaV.js +1 -0
- package/build/assets/active-backend-context-BETEdaJl.js +2 -0
- package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
- package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
- package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
- package/build/assets/agent-settings-BnzyTgCb.js +2 -0
- package/build/assets/agent-settings-CeXj3xK-.js +1 -0
- package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
- package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
- package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
- package/build/assets/automation-detail-CF2SweVs.js +3 -0
- package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
- package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
- package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
- package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
- package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
- package/build/assets/automations-list-yK7ETmYP.js +1 -0
- package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
- package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
- package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
- package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
- package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
- package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
- package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
- package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
- package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
- package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
- package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
- package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
- package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
- package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
- package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
- package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
- package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
- package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
- package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
- package/build/assets/conversation-XRsI28ZM.js +1 -0
- package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
- package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
- package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
- package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
- package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
- package/build/assets/empty-state-B5advKVW.js +1 -0
- package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
- package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
- package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
- package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
- package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
- package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
- package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
- package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
- package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
- package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
- package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
- package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
- package/build/assets/home-4lyLzYjG.js +1 -0
- package/build/assets/home-BGaB0EeK.js +1 -0
- package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
- package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
- package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
- package/build/assets/index-home-6Y_Y7kOo.js +1 -0
- package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
- package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
- package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
- package/build/assets/link-external-B4gx3EeM.js +1 -0
- package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
- package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
- package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
- package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
- package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
- package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
- package/build/assets/manifest-23d79467.js +1 -0
- package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
- package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
- package/build/assets/mcp-CoUOIGBF.js +1 -0
- package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
- package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
- package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
- package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
- package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
- package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
- package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
- package/build/assets/onboarding-Cc4Av7bi.js +1 -0
- package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
- package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
- package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
- package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
- package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
- package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
- package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
- package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
- package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
- package/build/assets/root-D1y82Lhg.js +2 -0
- package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
- package/build/assets/root-sEWn3ha1.css +1 -0
- package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
- package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
- package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
- package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
- package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
- package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
- package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
- package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
- package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
- package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
- package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
- package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
- package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
- package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
- package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
- package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
- package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
- package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
- package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
- package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
- package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
- package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
- package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
- package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
- package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
- package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
- package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
- package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
- package/build/assets/trash-D1QMHInX.js +1 -0
- package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
- package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
- package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
- package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
- package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
- package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
- package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
- package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
- package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
- package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
- package/build/assets/use-create-conversation-D15Px574.js +1 -0
- package/build/assets/use-create-secret-D_qPU88t.js +1 -0
- package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
- package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
- package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
- package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
- package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
- package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
- package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
- package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
- package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
- package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
- package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
- package/build/assets/use-tracking-BAFpgpgq.js +3 -0
- package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
- package/build/assets/utils-CbjwNcR-.js +1 -0
- package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
- package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +18 -1
- package/build/locales/ca/openhands.json +18 -1
- package/build/locales/de/openhands.json +18 -1
- package/build/locales/en/openhands.json +18 -1
- package/build/locales/es/openhands.json +18 -1
- package/build/locales/fr/openhands.json +18 -1
- package/build/locales/it/openhands.json +18 -1
- package/build/locales/ja/openhands.json +18 -1
- package/build/locales/ko-KR/openhands.json +18 -1
- package/build/locales/no/openhands.json +18 -1
- package/build/locales/pt/openhands.json +18 -1
- package/build/locales/tr/openhands.json +18 -1
- package/build/locales/uk/openhands.json +18 -1
- package/build/locales/zh-CN/openhands.json +18 -1
- package/build/locales/zh-TW/openhands.json +18 -1
- package/config/defaults.json +3 -3
- package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
- package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
- package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
- package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
- package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +0 -5
- package/dist/constants/acp-providers.js +20 -16
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/constants/profile-scope.d.ts +21 -0
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +30 -19
- package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
- package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
- package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
- package/dist/hooks/query/query-keys.cjs +1 -1
- package/dist/hooks/query/query-keys.cjs.map +1 -1
- package/dist/hooks/query/query-keys.d.ts +1 -0
- package/dist/hooks/query/query-keys.js +10 -1
- package/dist/hooks/query/query-keys.js.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
- package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
- package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
- package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
- package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
- package/dist/hooks/query/use-automation-sdk-version.js +3 -1
- package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
- package/dist/hooks/use-drag-resize.cjs +1 -1
- package/dist/hooks/use-drag-resize.cjs.map +1 -1
- package/dist/hooks/use-drag-resize.js +8 -9
- package/dist/hooks/use-drag-resize.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +18 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +289 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +18 -1
- package/dist/locales/ca/openhands.json +18 -1
- package/dist/locales/de/openhands.json +18 -1
- package/dist/locales/en/openhands.json +18 -1
- package/dist/locales/es/openhands.json +18 -1
- package/dist/locales/fr/openhands.json +18 -1
- package/dist/locales/it/openhands.json +18 -1
- package/dist/locales/ja/openhands.json +18 -1
- package/dist/locales/ko-KR/openhands.json +18 -1
- package/dist/locales/no/openhands.json +18 -1
- package/dist/locales/pt/openhands.json +18 -1
- package/dist/locales/tr/openhands.json +18 -1
- package/dist/locales/uk/openhands.json +18 -1
- package/dist/locales/zh-CN/openhands.json +18 -1
- package/dist/locales/zh-TW/openhands.json +18 -1
- package/dist/manifests/automation-setup.cjs.map +1 -1
- package/dist/manifests/automation-setup.js.map +1 -1
- package/dist/manifests/manifest-local-validation.cjs.map +1 -1
- package/dist/manifests/manifest-local-validation.js.map +1 -1
- package/dist/manifests/manifest-validation.cjs +1 -1
- package/dist/manifests/manifest-validation.cjs.map +1 -1
- package/dist/manifests/manifest-validation.js +2 -2
- package/dist/manifests/manifest-validation.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
- package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
- package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
- package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
- package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
- package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
- package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
- package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
- package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
- package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
- package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +11 -0
- package/dist/types/automation.cjs.map +1 -1
- package/dist/types/automation.d.ts +26 -2
- package/dist/types/automation.js.map +1 -1
- package/dist/utils/automation-disabled-reason.cjs +2 -0
- package/dist/utils/automation-disabled-reason.cjs.map +1 -0
- package/dist/utils/automation-disabled-reason.d.ts +32 -0
- package/dist/utils/automation-disabled-reason.js +19 -0
- package/dist/utils/automation-disabled-reason.js.map +1 -0
- package/dist/utils/parse-git-remote-url.cjs +1 -1
- package/dist/utils/parse-git-remote-url.cjs.map +1 -1
- package/dist/utils/parse-git-remote-url.d.ts +5 -1
- package/dist/utils/parse-git-remote-url.js +20 -13
- package/dist/utils/parse-git-remote-url.js.map +1 -1
- package/package.json +3 -3
- package/scripts/check-sdk-version-sync.mjs +79 -8
- package/scripts/dev-safe.mjs +14 -1
- package/scripts/docker-build.mjs +3 -0
- package/scripts/static-server.mjs +24 -7
- package/build/assets/acp-providers-DcY_mKYa.js +0 -1
- package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
- package/build/assets/agent-settings-BF8hM6wb.js +0 -2
- package/build/assets/agent-settings-YPutBAeR.js +0 -1
- package/build/assets/automation-detail-BxXhb_m2.js +0 -3
- package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
- package/build/assets/automations-list-DEPVNud3.js +0 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
- package/build/assets/conversation-edjzrv5w.js +0 -1
- package/build/assets/conversation-panel-edjzrv5w.js +0 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
- package/build/assets/empty-state-FK_s1B60.js +0 -1
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
- package/build/assets/home-BM5_Wz_R.js +0 -1
- package/build/assets/home-Ivfm7KC4.js +0 -1
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
- package/build/assets/index-home-td9BN2T3.js +0 -1
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
- package/build/assets/link-external-BNZzCM1I.js +0 -1
- package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
- package/build/assets/llm-settings-CZaXYgtw.js +0 -1
- package/build/assets/manifest-bfeccb98.js +0 -1
- package/build/assets/mcp-CraxoXQv.js +0 -1
- package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
- package/build/assets/mcp-page-CteH_K0N.js +0 -9
- package/build/assets/onboarding-DXFBRqEy.js +0 -1
- package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
- package/build/assets/root-CM6IZHlg.css +0 -1
- package/build/assets/root-DdFkodKW.js +0 -2
- package/build/assets/trash-Ckh7yCaB.js +0 -1
- package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
- package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
- package/build/assets/use-tracking-j4uo9VEW.js +0 -3
- package/build/assets/utils-BgLSZdyy.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
- package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,a as n,bt as r,m as i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{F as s,I as c,R as l,U as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{c as f,n as p,r as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as h}from"./useMutation-Cszf8mKy.js";import{t as g}from"./useQueries-pUohFMSP.js";import{t as _}from"./useQuery-DAAacS7O.js";import{i as v}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as y}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as b}from"./useTranslation-CCgUjPJF.js";import{$ as x,ct as S,dt as C,gt as w,n as T,ot as E,st as D}from"./active-backend-context-BnH4-L8h.js";import{A as O,D as k,E as A,F as j,G as M,K as N,L as P,M as F,T as ee,V as te,W as ne,a as I,d as re,f as ie,h as ae,i as oe,j as se,k as L,l as ce,m as le,n as ue,o as de,p as fe,r as pe,s as me,t as R,u as z,w as he,y as ge}from"./utils-BgLSZdyy.js";import{a as _e,c as ve,i as ye,n as B}from"./agent-server-client-options-EHB23gyx.js";import{c as be}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js";import{A as xe,D as Se,E as Ce,M as we,N as Te,O as Ee,P as De,S as Oe,T as ke,_ as Ae,b as je,c as Me,f as Ne,g as Pe,h as Fe,j as Ie,k as Le,l as Re,m as ze,n as Be,p as Ve,s as He,t as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./messages-Bk1xhbU2.js";import{t as Ye}from"./check-Bo8s5Ylg.js";import{n as Xe,r as Ze,t as Qe}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{r as $e}from"./map-provider-iRs80q_6.js";import{i as et,n as tt,r as nt,t as rt}from"./empty-state-FK_s1B60.js";import{t as it}from"./external-link-Bd7Tga-1.js";import{n as at,r as ot,t as st}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{c as ct,d as lt,l as ut,n as dt,s as ft,u as pt}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{a as mt,i as ht}from"./cloud-funnel-analytics-D5uJ_4JE.js";import{t as gt}from"./info-BcajzHn1.js";import{t as _t}from"./list-todo-Caa8E1X_.js";import{t as vt}from"./loader-circle-BxJgk73D.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,m as Tt,n as Et,p as Dt,r as Ot,t as kt}from"./skill-filter-DsNLmn76.js";import{t as At}from"./x-CX8lVGwm.js";import{t as jt}from"./trash-2-Bb40zQzs.js";import{n as Mt,t as V}from"./context-menu-list-item-Cm7-7Y-7.js";import{f as Nt}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as Pt}from"./proxy-XP6U1Dhv.js";import{t as Ft}from"./react-BX7IV650.js";import{i as It}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{t as Lt}from"./loading-spinner-BeLV0IXf.js";import{t as Rt}from"./use-tracking-j4uo9VEW.js";import{l as zt}from"./settings-service.api-C1vZH9Vh.js";import{n as Bt}from"./use-settings-C2KKQKVC.js";import{t as Vt}from"./modal-backdrop-BSzNhM4r.js";import{n as Ht}from"./modal-body-C24WsdFb.js";import{n as Ut,r as Wt}from"./base-modal-C1a0TsSx.js";import{_ as Gt,i as Kt,u as qt}from"./form-control-classes-Dbq-7YP_.js";import{t as Jt}from"./brand-button-CUMfjb99.js";import{n as Yt}from"./navigation-context-CQZwH_tC.js";import{t as Xt}from"./styled-tooltip-CejG0rqv.js";import{r as Zt,u as Qt}from"./dropdown-classes-BGvOvW2_.js";import{c as $t,d as en,i as tn,l as nn,m as rn,t as an}from"./use-llm-configured-Dl4zg8ht.js";import{a as on,c as sn,d as cn,f as ln,h as un,l as H,o as dn,p as fn,t as U,u as W}from"./conversation-store-DC-JlJuq.js";import{t as pn}from"./modal-close-button-DfqfB2Nj.js";import{t as mn}from"./confirmation-modal-78sd9Vny.js";import{E as hn,T as gn,j as _n,o as vn,t as yn}from"./agent-server-conversation-service.api-jiCopc2E.js";import{t as bn}from"./use-is-authed-A2Yinlt0.js";import{d as xn,g as Sn,l as Cn,m as wn,s as Tn,t as En,u as Dn,v as On}from"./conversation-state-store-9D_3P7q4.js";import{c as kn,d as An,i as jn,l as Mn,n as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./sidebar-mobile-menu-toggle-CQ4iky__.js";import{t as Rn}from"./use-click-outside-element-W6Os4Nlb.js";import{n as zn}from"./use-create-conversation-i_PdFdIs.js";import{r as Bn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as G,i as Vn,n as Hn}from"./use-can-manage-org-profiles-MzIeEV8F.js";import{t as Un}from"./u-edit-DAkcF52u.js";import{t as Wn}from"./skills-B0IliMxw.js";import{t as Gn}from"./install-server-modal-B81I-5OE.js";import{o as Kn,s as qn,t as Jn}from"./home-store-DCbei3DX.js";import{t as Yn}from"./use-automation-health-U99vvHxx.js";import{t as Xn}from"./use-automations-Bq5hVuv0.js";import{t as Zn}from"./use-user-conversation-5UFqMoO4.js";import{t as Qn}from"./copy-Drmhc2jD.js";import{r as $n}from"./typography-DgcLGdHk.js";import{n as er,o as tr,t as nr}from"./extension-module-card-classes-DpeaYhYo.js";import{t as rr}from"./secrets-service-BOIsfD9j.js";import{t as ir}from"./use-get-secrets-CMTuWEp_.js";import{f as ar,l as or,s as sr,t as cr}from"./mcp-marketplace-utils-C7PYr293.js";import{t as lr}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{t as ur}from"./x-mark-BopmFoBq.js";import{A as dr,B as fr,C as pr,D as mr,E as hr,F as gr,G as _r,I as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,R as wr,S as Tr,T as Er,U as Dr,V as Or,W as kr,_ as Ar,a as jr,b as Mr,c as Nr,g as Pr,h as Fr,i as Ir,j as Lr,n as Rr,o as zr,p as Br,q as Vr,r as Hr,s as Ur,t as Wr,v as Gr,w as Kr,x as qr,y as Jr}from"./llm-not-configured-banner-Dh_ajcM8.js";import{$ as Yr,A as Xr,B as Zr,D as K,E as Qr,F as $r,H as ei,I as ti,J as ni,K as ri,M as ii,N as ai,O as oi,P as si,Q as ci,S as li,T as q,U as ui,V as di,W as fi,Z as pi,a as mi,c as hi,et as gi,h as _i,k as vi,m as yi,nt as J,p as bi,q as xi,rt as Si,s as Ci,tt as Y,u as wi,v as Ti,w as Ei,y as Di,z as Oi}from"./markdown-renderer-DyFl9-mL.js";import{a as ki,n as Ai,t as ji}from"./skill-scope-BE-H9TSZ.js";import{t as Mi}from"./git-repo-dropdown-uxlFw2gn.js";import{n as Ni,t as Pi}from"./get-git-path-jU2zjqIB.js";import{t as Fi}from"./parse-git-remote-url-DpDM9bK6.js";import{t as Ii}from"./use-breakpoint-DWtihr9g.js";import{n as Li,t as Ri}from"./error-state-Cf8LRuuY.js";import{a as zi,i as Bi,n as Vi,o as Hi,r as Ui,t as Wi}from"./mcp-page-CteH_K0N.js";import{n as Gi,t as Ki}from"./secret-form-9-BoGA40.js";var X=e(t(),1),qi={curAgentState:L.LOADING},Ji=Ft(e=>({...qi,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(qi)})),Yi=`openhands-last-conversation-by-backend`;function Xi(e,t){return t?`${e}::${t}`:e}function Zi(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Yi);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function Qi(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Yi,JSON.stringify(e))}catch{}}function $i(e,t,n){if(!n)return;let r=Zi();r[Xi(e,t)]=n,Qi(r)}function ea(e,t){let n=Zi(),r=Xi(e,t);r in n&&(delete n[r],Qi(n))}var ta=e=>({action:Te.CHANGE_AGENT_STATE,args:{agent_state:e}}),na=e=>`error`in e,ra=e=>`type`in e&&e.type===`error`,ia=()=>{let{send:e}=we(),t=K(e=>e.events);X.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(ti(n)&&$r(n))){if(na(n)){if(n.error_code===401){D(`Session expired.`);return}typeof n.error==`string`?D(n.error):D(n.message);return}ra(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(ta(L.PAUSED))}},[t.length])},aa=()=>{let{curAgentState:e}=Yr();return{runtimeActive:!O.includes(e)}};function oa({children:e}){return ia(),aa(),e}var sa=`ACPAuthRequired`,ca={ACPAuthRequired:N.ERROR$ACP_AUTH_REQUIRED_TITLE,ACPSpawnError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPInitError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPPromptError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,UsagePolicyRefusal:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE};function la(e){return e?ca[e]??null:null}function ua(e){return e===sa}var da={entriesByConversation:{}},fa=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),pa=Ft()(un(e=>({...da,addPending:(t,n)=>{let r=_n();return e(e=>fa(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>fa(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`})),Z=o();function ma({onClick:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,Z.jsx)(Le,{className:`w-3.5 h-3.5 fill-success`}),(0,Z.jsx)(`span`,{children:t(N.CHAT_INTERFACE$BTW_GOT_IT)})]})}function ha({conversationId:e}){let{t}=b(`openhands`),n=pa(e=>e.entriesByConversation),r=pa(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,Z.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,Z.jsx)(xe,{title:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`opacity-60`,children:t(N.CHAT_INTERFACE$BTW_PREFIX)}),(0,Z.jsx)(`span`,{children:n.question}),i&&(0,Z.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`})]}),details:i?t(N.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,Z.jsx)(ma,{onClick:()=>r(e,n.id)})},n.id)})})}function ga({conversationId:e}){let t=li(e=>e.statusByConversation),n=e?t[e]:void 0;return n?.active?(0,Z.jsx)(Ee,{status:n}):null}var _a=`${F} `,va=(e,t)=>{let n=pa(e=>e.addPending),r=pa(e=>e.resolve),i=pa(e=>e.fail);return(0,X.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(_a);if(!e||!s){t(a);return}let c=o.slice(F.length).trim();if(!c)return;let l=n(e,c);Dn(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])},ya=`${P} `,ba=/^--max(?:=|\s+)(\d+)\s*/,xa=(e,t)=>{let{t:n}=b();return(0,X.useCallback)(r=>{let i=r.trim(),a=i===`/goal`||i.startsWith(ya);if(!e||!a){t(r);return}let o=i.slice(P.length).trim(),s,c=o.match(ba);c&&(s=parseInt(c[1],10),o=o.slice(c[0].length).trim());let l=o;if(!l){D(n(N.GOAL$OBJECTIVE_REQUIRED));return}let u={objective:l};s&&s>=1&&(u.max_iterations=s),Sn(e,u).catch(e=>{let t=n(N.GOAL$START_FAILED);D(e instanceof Error&&e.message?e.message:t)})},[e,t,n])},Sa=`${te} `,Ca=`${j} `,wa=(e,t,n)=>{let r=U(e=>e.setConversationMode),{handlePlanClick:i,hasPlanner:a,isCreatingConversation:o}=xr(),s=Dr()===`OPEN`,c=kr()===`OPEN`,{isPlanningAgentRunning:l}=gi();return(0,X.useCallback)(u=>{let d=u.trim(),f=d===`/plan`||d.startsWith(Sa),p=d===`/code`||d.startsWith(Ca);if(!e||!f&&!p){n(u);return}if(!(t===L.RUNNING||o))if(f){if(l||!c)return;let e=d.slice(te.length).trim();e&&a?(r(`plan`),n(e)):i(void 0,e||void 0)}else{if(!s)return;r(`code`);let e=d.slice(j.length).trim();e&&n(e)}},[e,t,a,o,s,l,c,n,i,r])},Ta=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Ea(e){return R(Ta,e?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white`:`bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]`)}function Da(e){return e?`white`:`var(--oh-muted)`}var Oa=`font-normal text-sm leading-5 truncate`;function ka({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=b(`openhands`),{trackPullButtonClick:a}=Rt(),o=n&&t&&r;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(re())},disabled:!o,className:R(Ea(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Er,{width:12,height:12,color:Da(o)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[76px]`),title:i(N.COMMON$PULL),children:i(N.COMMON$PULL)})]})}function Aa({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackPushButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ie(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(hr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[77px]`),title:a(N.COMMON$PUSH),children:a(N.COMMON$PUSH)})]})}function ja({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackCreatePrButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(me(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Kr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[126px]`),title:a(N.COMMON$PULL_REQUEST),children:a(N.COMMON$PULL_REQUEST)})]})}function Ma(e){return e.kind===`BashCommand`}function Na(e){return e.kind===`BashOutput`}function Pa(e){return e.kind===`BashError`}function Fa(e,t,n){let r=(0,X.useRef)(null),i=(0,X.useRef)(null),a=(0,X.useRef)([]),o=(0,X.useRef)([]),s=(0,X.useRef)(new Map);return(0,X.useEffect)(()=>{if(!n)return;let c=ye(e),l=new WebSocket(c);r.current=l,i.current=null;let u=pi(l);l.onopen=()=>{u(),ci(l,t),i.current=l;for(let{command:e,cwd:t,timeout:n,resolve:r,reject:i}of a.current)o.current.push({resolve:r,reject:i}),l.send(JSON.stringify({command:e,cwd:t,timeout:n}));a.current=[]},l.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Ma(t)){let e=o.current.shift();e&&s.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Na(t)&&t.command_id){let e=s.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(s.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else Pa(t)&&d(`Bash error: ${t.code}: ${t.detail}`)};function d(e){let t=Error(e);for(let{reject:e}of a.current)e(t);a.current=[];for(let e of o.current)e.reject(t);o.current=[];for(let e of s.current.values())e.reject(t);s.current.clear()}return l.onclose=()=>{u(),r.current=null,i.current=null,d(`Bash WebSocket closed`)},l.onerror=()=>{r.current=null,i.current=null,d(`Bash WebSocket error`)},()=>{u(),l.onclose=null,l.onerror=null,l.close(),r.current=null,i.current=null,d(`Bash WebSocket unmounted`)}},[n,e,t]),(0,X.useCallback)((e,t,n)=>new Promise((s,c)=>{let l=r.current;if(!l||l.readyState===WebSocket.CLOSED||l.readyState===WebSocket.CLOSING){c(Error(`Bash WebSocket not available`));return}l.readyState!==WebSocket.OPEN||i.current!==l?a.current.push({command:e,cwd:t,timeout:n,resolve:s,reject:c}):(o.current.push({resolve:s,reject:c}),l.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Ia={repository:null,branch:null,provider:null,remoteUrl:null},La=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-BNDp3e_x.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/useQuery-DAAacS7O.js","assets/messages-WUb9Yh-p.js","assets/active-backend-context-BETEdaJl.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/utils-CbjwNcR-.js","assets/vendor-markdown-j0kYzV48.js","assets/useMutation-Cszf8mKy.js","assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js","assets/useTranslation-CCgUjPJF.js","assets/markdown-renderer-DRpwRlNm.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js","assets/iconBase-C2sR-uAp.js","assets/agent-server-conversation-service.api-BtOlitCD.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js","assets/proxy-BCCQUna8.js","assets/profiles-service.api-B5thiTI3.js","assets/settings-service.api-CYBTLGOd.js","assets/settings-CKqk8ZnH.js","assets/llm-subscription-service-LGYVzyAc.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-DOKcGeaV.js","assets/skill-enablement-BBKya60C.js","assets/conversation-store-DC-JlJuq.js","assets/react-BX7IV650.js","assets/conversation-state-store-Br-eE-gg.js","assets/syntax-highlighter-BGDg_7w9.js","assets/copy-to-clipboard-button-CvTHqY13.js","assets/checkmark-XZyokq_Y.js","assets/copy-Drmhc2jD.js","assets/navigation-context-CQZwH_tC.js","assets/use-settings-D69cw06D.js","assets/use-user-conversation-BBDXUbOc.js","assets/scroll-fade-state-Dt_fx2kf.js","assets/chevron-down-Cr6Fn_wS.js","assets/chevron-right-CfdfRn-8.js","assets/loader-circle-BxJgk73D.js","assets/vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js","assets/use-free-models-FAk2nngq.js","assets/use-config-BJ_FJCjV.js","assets/styled-tooltip-CknPQH4Y.js","assets/modal-backdrop-BSzNhM4r.js","assets/modal-close-button-Cq3dma5u.js","assets/get-git-path-DOe6PM_a.js","assets/close-ScPlnwyq.js","assets/skills-B0IliMxw.js","assets/u-check-circle-BKn1spCL.js","assets/typography-BdAApXGl.js","assets/dist-Bl64nBZL.js","assets/form-control-classes-BVI_szaj.js","assets/format-model-name-Dfh9Udrx.js","assets/cloud-funnel-analytics-BH_zxjiO.js","assets/mouse-pointer-click-BXlRN92t.js","assets/use-llm-configured-DF9BYmIe.js","assets/agent-profiles-service.api-CiMVQAIT.js","assets/use-tracking-BAFpgpgq.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js","assets/bot-ByolqPEr.js","assets/use-agent-profiles-YsBlt3tT.js","assets/use-llm-profiles-U4u1gzuk.js","assets/settings-utils-BTaaRhLZ.js","assets/map-provider-iRs80q_6.js","assets/conversation-tab-empty-state-BT1GrnKP.js","assets/highlighted-source-view-DPerL6tF.js","assets/folder-C1ou4_DT.js","assets/link-external-B4gx3EeM.js","assets/commits-tab-B5SUF66c.js","assets/vendor~commits-tab-BaO2Ce3e.js","assets/vendor~conversation-panel~conversation-C22sJuWZ.js","assets/vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js","assets/llm-not-configured-banner-BdjItKQR.js","assets/vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js","assets/useInfiniteQuery-CtSRG7uW.js","assets/recommended-automations-launcher-D1Do753p.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js","assets/secrets-service-C3CNNEpY.js","assets/install-server-modal-DkMCfj0J.js","assets/brand-button-CGUwj6zK.js","assets/settings-input-B3i5U9GL.js","assets/mcp-marketplace-utils-BwEnDYqm.js","assets/modal-classes-BPcBCWVj.js","assets/skill-card-pill-row-CxOFySng.js","assets/extension-module-card-classes-DpeaYhYo.js","assets/circle-plus-check-toggle-ZOXpJ3I2.js","assets/x-mark-BopmFoBq.js","assets/use-create-conversation-D15Px574.js","assets/plugins-management-service-2oP6_tWr.js","assets/use-create-secret-D_qPU88t.js","assets/use-automations-7_XBXHQK.js","assets/automation-C_eCrGyP.js","assets/mcp-installed-servers-BW51n6PC.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js","assets/chat-send-button-B6aVaD9V.js","assets/check-Bo8s5Ylg.js","assets/circle-check-5pH3qCji.js","assets/plus-C2e21TFC.js","assets/refresh-cw-BtdC3T8P.js","assets/context-menu-list-item-DIm5xQg6.js","assets/dropdown-classes-DyyMaaXl.js","assets/home-store-roz1x6D5.js","assets/use-is-authed-A2Yinlt0.js","assets/skill-scope-C0NxJnpT.js","assets/use-save-settings-CmX41wlf.js","assets/use-can-manage-org-profiles-Dt4YkPO7.js","assets/organization-service.api-zhHpQU0t.js","assets/git-repo-dropdown-DNlinQ7r.js","assets/settings-dropdown-input-Df_HXRk4.js","assets/merge-agent-profile-save-input-WcFmQVKK.js","assets/base-modal-CZq4kB_H.js","assets/modal-body-B_95ci1c.js","assets/loading-spinner-BJc2J0Dw.js","assets/navigation-link-Bxo3-4vo.js","assets/use-activate-agent-profile-DO6SNPkK.js","assets/use-click-outside-element-W6Os4Nlb.js","assets/settings-gear-DaJj6Pde.js","assets/u-robot-BvAOA2ZD.js","assets/format-time-delta-BIR5Os7T.js","assets/browser-tab-DFyZXsnB.js","assets/external-link-Bd7Tga-1.js","assets/vendor~browser-tab-C5uuAxZX.js","assets/planner-tab-yISBVUKu.js","assets/list-todo-Caa8E1X_.js","assets/task-list-tab-CQisRcPh.js","assets/usage-tab-ClVHAFJy.js","assets/info-BcajzHn1.js","assets/terminal-Bs50gJPC.js","assets/vendor~terminal-BVSbSr6V.js","assets/vendor~terminal-T4IDBjWs.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,a as n,bt as r,m as i,xt as a,yt as o}from"./vendor-styling-Ck5D_A2Q.js";import{F as s,I as c,R as l,U as u}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{c as f,n as p,r as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as h}from"./useMutation-Cszf8mKy.js";import{t as g}from"./useQueries-pUohFMSP.js";import{t as _}from"./useQuery-DAAacS7O.js";import{i as v}from"./recommended-automations-launcher-D1Do753p.js";import{t as y}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as b}from"./useTranslation-CCgUjPJF.js";import{$ as x,ct as S,dt as C,gt as w,n as T,ot as E,st as D}from"./active-backend-context-BETEdaJl.js";import{A as O,D as k,E as A,F as j,G as M,K as N,L as P,M as F,T as ee,V as te,W as ne,a as I,d as re,f as ie,h as ae,i as oe,j as se,k as L,l as ce,m as le,n as ue,o as de,p as fe,r as pe,s as me,t as R,u as z,w as he,y as ge}from"./utils-CbjwNcR-.js";import{a as _e,c as ve,i as ye,n as B}from"./agent-server-client-options-EHB23gyx.js";import{c as be}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{A as xe,D as Se,E as Ce,M as we,N as Te,O as Ee,P as De,S as Oe,T as ke,_ as Ae,b as je,c as Me,f as Ne,g as Pe,h as Fe,j as Ie,k as Le,l as Re,m as ze,n as Be,p as Ve,s as He,t as Ue,u as We,v as Ge,w as Ke,x as qe,y as Je}from"./messages-WUb9Yh-p.js";import{t as Ye}from"./check-Bo8s5Ylg.js";import{n as Xe,r as Ze,t as Qe}from"./vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js";import{r as $e}from"./map-provider-iRs80q_6.js";import{i as et,n as tt,r as nt,t as rt}from"./empty-state-B5advKVW.js";import{t as it}from"./external-link-Bd7Tga-1.js";import{n as at,r as ot,t as st}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{c as ct,d as lt,l as ut,n as dt,s as ft,u as pt}from"./vendor~conversation-panel~conversation-C22sJuWZ.js";import{a as mt,i as ht}from"./cloud-funnel-analytics-BH_zxjiO.js";import{t as gt}from"./info-BcajzHn1.js";import{t as _t}from"./list-todo-Caa8E1X_.js";import{t as vt}from"./loader-circle-BxJgk73D.js";import{a as yt,c as bt,d as xt,f as St,i as Ct,l as wt,m as Tt,n as Et,p as Dt,r as Ot,t as kt}from"./skill-filter-BvtbD--b.js";import{t as At}from"./x-CX8lVGwm.js";import{t as jt}from"./trash-2-Bb40zQzs.js";import{n as Mt,t as V}from"./context-menu-list-item-DIm5xQg6.js";import{f as Nt}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as Pt}from"./proxy-BCCQUna8.js";import{t as Ft}from"./react-BX7IV650.js";import{i as It}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";import{t as Lt}from"./loading-spinner-BJc2J0Dw.js";import{t as Rt}from"./use-tracking-BAFpgpgq.js";import{l as zt}from"./settings-service.api-CYBTLGOd.js";import{n as Bt}from"./use-settings-D69cw06D.js";import{t as Vt}from"./modal-backdrop-BSzNhM4r.js";import{n as Ht}from"./modal-body-B_95ci1c.js";import{n as Ut,r as Wt}from"./base-modal-CZq4kB_H.js";import{_ as Gt,i as Kt,u as qt}from"./form-control-classes-BVI_szaj.js";import{t as Jt}from"./brand-button-CGUwj6zK.js";import{n as Yt}from"./navigation-context-CQZwH_tC.js";import{t as Xt}from"./styled-tooltip-CknPQH4Y.js";import{r as Zt,u as Qt}from"./dropdown-classes-DyyMaaXl.js";import{c as $t,d as en,i as tn,l as nn,m as rn,t as an}from"./use-llm-configured-DF9BYmIe.js";import{a as on,c as sn,d as cn,f as ln,h as un,l as H,o as dn,p as fn,t as U,u as W}from"./conversation-store-DC-JlJuq.js";import{t as pn}from"./modal-close-button-Cq3dma5u.js";import{t as mn}from"./confirmation-modal-oN1EId79.js";import{E as hn,T as gn,j as _n,o as vn,t as yn}from"./agent-server-conversation-service.api-BtOlitCD.js";import{t as bn}from"./use-is-authed-A2Yinlt0.js";import{d as xn,g as Sn,l as Cn,m as wn,s as Tn,t as En,u as Dn,v as On}from"./conversation-state-store-Br-eE-gg.js";import{c as kn,d as An,i as jn,l as Mn,n as Nn,r as Pn,s as Fn,t as In,u as Ln}from"./sidebar-mobile-menu-toggle-B2xwXm4s.js";import{t as Rn}from"./use-click-outside-element-W6Os4Nlb.js";import{n as zn}from"./use-create-conversation-D15Px574.js";import{r as Bn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{a as G,i as Vn,n as Hn}from"./use-can-manage-org-profiles-Dt4YkPO7.js";import{t as Un}from"./u-edit-DAkcF52u.js";import{t as Wn}from"./skills-B0IliMxw.js";import{t as Gn}from"./install-server-modal-DkMCfj0J.js";import{o as Kn,s as qn,t as Jn}from"./home-store-roz1x6D5.js";import{t as Yn}from"./use-automation-health-CbQ9n-k7.js";import{t as Xn}from"./use-automations-7_XBXHQK.js";import{t as Zn}from"./use-user-conversation-BBDXUbOc.js";import{t as Qn}from"./copy-Drmhc2jD.js";import{r as $n}from"./typography-BdAApXGl.js";import{n as er,o as tr,t as nr}from"./extension-module-card-classes-DpeaYhYo.js";import{t as rr}from"./secrets-service-C3CNNEpY.js";import{t as ir}from"./use-get-secrets-Pbo9jh2A.js";import{t as ar}from"./mcp-installed-servers-BW51n6PC.js";import{t as or}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js";import{l as sr,s as cr,t as lr}from"./mcp-marketplace-utils-BwEnDYqm.js";import{t as ur}from"./x-mark-BopmFoBq.js";import{A as dr,B as fr,C as pr,D as mr,E as hr,F as gr,G as _r,I as vr,L as yr,M as br,N as xr,O as Sr,P as Cr,R as wr,S as Tr,T as Er,U as Dr,V as Or,W as kr,_ as Ar,a as jr,b as Mr,c as Nr,g as Pr,h as Fr,i as Ir,j as Lr,n as Rr,o as zr,p as Br,q as Vr,r as Hr,s as Ur,t as Wr,v as Gr,w as Kr,x as qr,y as Jr}from"./llm-not-configured-banner-BdjItKQR.js";import{$ as Yr,A as Xr,B as Zr,D as K,E as Qr,F as $r,H as ei,I as ti,J as ni,K as ri,M as ii,N as ai,O as oi,P as si,Q as ci,S as li,T as q,U as ui,V as di,W as fi,Z as pi,a as mi,c as hi,et as gi,h as _i,k as vi,m as yi,nt as J,p as bi,q as xi,rt as Si,s as Ci,tt as Y,u as wi,v as Ti,w as Ei,y as Di,z as Oi}from"./markdown-renderer-DRpwRlNm.js";import{a as ki,n as Ai,t as ji}from"./skill-scope-C0NxJnpT.js";import{t as Mi}from"./git-repo-dropdown-DNlinQ7r.js";import{n as Ni,t as Pi}from"./get-git-path-DOe6PM_a.js";import{t as Fi}from"./parse-git-remote-url-BG8pcKL8.js";import{t as Ii}from"./use-breakpoint-DWtihr9g.js";import{n as Li,t as Ri}from"./error-state-BgYl7YeB.js";import{a as zi,i as Bi,n as Vi,o as Hi,r as Ui,t as Wi}from"./mcp-page-hZ4aJjj_.js";import{n as Gi,t as Ki}from"./secret-form-BDvzojzN.js";var X=e(t(),1),qi={curAgentState:L.LOADING},Ji=Ft(e=>({...qi,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(qi)})),Yi=`openhands-last-conversation-by-backend`;function Xi(e,t){return t?`${e}::${t}`:e}function Zi(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Yi);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function Qi(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Yi,JSON.stringify(e))}catch{}}function $i(e,t,n){if(!n)return;let r=Zi();r[Xi(e,t)]=n,Qi(r)}function ea(e,t){let n=Zi(),r=Xi(e,t);r in n&&(delete n[r],Qi(n))}var ta=e=>({action:Te.CHANGE_AGENT_STATE,args:{agent_state:e}}),na=e=>`error`in e,ra=e=>`type`in e&&e.type===`error`,ia=()=>{let{send:e}=we(),t=K(e=>e.events);X.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(ti(n)&&$r(n))){if(na(n)){if(n.error_code===401){D(`Session expired.`);return}typeof n.error==`string`?D(n.error):D(n.message);return}ra(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(ta(L.PAUSED))}},[t.length])},aa=()=>{let{curAgentState:e}=Yr();return{runtimeActive:!O.includes(e)}};function oa({children:e}){return ia(),aa(),e}var sa=`ACPAuthRequired`,ca={ACPAuthRequired:N.ERROR$ACP_AUTH_REQUIRED_TITLE,ACPSpawnError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPInitError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPPromptError:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,UsagePolicyRefusal:N.CHAT_INTERFACE$AGENT_ERROR_MESSAGE};function la(e){return e?ca[e]??null:null}function ua(e){return e===sa}var da={entriesByConversation:{}},fa=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),pa=Ft()(un(e=>({...da,addPending:(t,n)=>{let r=_n();return e(e=>fa(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>fa(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>fa(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`})),Z=o();function ma({onClick:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,Z.jsx)(Le,{className:`w-3.5 h-3.5 fill-success`}),(0,Z.jsx)(`span`,{children:t(N.CHAT_INTERFACE$BTW_GOT_IT)})]})}function ha({conversationId:e}){let{t}=b(`openhands`),n=pa(e=>e.entriesByConversation),r=pa(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,Z.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,Z.jsx)(xe,{title:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`opacity-60`,children:t(N.CHAT_INTERFACE$BTW_PREFIX)}),(0,Z.jsx)(`span`,{children:n.question}),i&&(0,Z.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`})]}),details:i?t(N.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,Z.jsx)(ma,{onClick:()=>r(e,n.id)})},n.id)})})}function ga({conversationId:e}){let t=li(e=>e.statusByConversation),n=e?t[e]:void 0;return n?.active?(0,Z.jsx)(Ee,{status:n}):null}var _a=`${F} `,va=(e,t)=>{let n=pa(e=>e.addPending),r=pa(e=>e.resolve),i=pa(e=>e.fail);return(0,X.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(_a);if(!e||!s){t(a);return}let c=o.slice(F.length).trim();if(!c)return;let l=n(e,c);Dn(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])},ya=`${P} `,ba=/^--max(?:=|\s+)(\d+)\s*/,xa=(e,t)=>{let{t:n}=b();return(0,X.useCallback)(r=>{let i=r.trim(),a=i===`/goal`||i.startsWith(ya);if(!e||!a){t(r);return}let o=i.slice(P.length).trim(),s,c=o.match(ba);c&&(s=parseInt(c[1],10),o=o.slice(c[0].length).trim());let l=o;if(!l){D(n(N.GOAL$OBJECTIVE_REQUIRED));return}let u={objective:l};s&&s>=1&&(u.max_iterations=s),Sn(e,u).catch(e=>{let t=n(N.GOAL$START_FAILED);D(e instanceof Error&&e.message?e.message:t)})},[e,t,n])},Sa=`${te} `,Ca=`${j} `,wa=(e,t,n)=>{let r=U(e=>e.setConversationMode),{handlePlanClick:i,hasPlanner:a,isCreatingConversation:o}=xr(),s=Dr()===`OPEN`,c=kr()===`OPEN`,{isPlanningAgentRunning:l}=gi();return(0,X.useCallback)(u=>{let d=u.trim(),f=d===`/plan`||d.startsWith(Sa),p=d===`/code`||d.startsWith(Ca);if(!e||!f&&!p){n(u);return}if(!(t===L.RUNNING||o))if(f){if(l||!c)return;let e=d.slice(te.length).trim();e&&a?(r(`plan`),n(e)):i(void 0,e||void 0)}else{if(!s)return;r(`code`);let e=d.slice(j.length).trim();e&&n(e)}},[e,t,a,o,s,l,c,n,i,r])},Ta=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Ea(e){return R(Ta,e?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white`:`bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]`)}function Da(e){return e?`white`:`var(--oh-muted)`}var Oa=`font-normal text-sm leading-5 truncate`;function ka({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=b(`openhands`),{trackPullButtonClick:a}=Rt(),o=n&&t&&r;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(re())},disabled:!o,className:R(Ea(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Er,{width:12,height:12,color:Da(o)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[76px]`),title:i(N.COMMON$PULL),children:i(N.COMMON$PULL)})]})}function Aa({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackPushButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ie(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(hr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[77px]`),title:a(N.COMMON$PUSH),children:a(N.COMMON$PUSH)})]})}function ja({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackCreatePrButtonClick:o}=Rt(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(me(r))},disabled:!s,className:R(Ea(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Kr,{width:12,height:12,color:Da(s)})}),(0,Z.jsx)(`div`,{className:R(Oa,`max-w-[126px]`),title:a(N.COMMON$PULL_REQUEST),children:a(N.COMMON$PULL_REQUEST)})]})}function Ma(e){return e.kind===`BashCommand`}function Na(e){return e.kind===`BashOutput`}function Pa(e){return e.kind===`BashError`}function Fa(e,t,n){let r=(0,X.useRef)(null),i=(0,X.useRef)(null),a=(0,X.useRef)([]),o=(0,X.useRef)([]),s=(0,X.useRef)(new Map);return(0,X.useEffect)(()=>{if(!n)return;let c=ye(e),l=new WebSocket(c);r.current=l,i.current=null;let u=pi(l);l.onopen=()=>{u(),ci(l,t),i.current=l;for(let{command:e,cwd:t,timeout:n,resolve:r,reject:i}of a.current)o.current.push({resolve:r,reject:i}),l.send(JSON.stringify({command:e,cwd:t,timeout:n}));a.current=[]},l.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Ma(t)){let e=o.current.shift();e&&s.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Na(t)&&t.command_id){let e=s.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(s.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else Pa(t)&&d(`Bash error: ${t.code}: ${t.detail}`)};function d(e){let t=Error(e);for(let{reject:e}of a.current)e(t);a.current=[];for(let e of o.current)e.reject(t);o.current=[];for(let e of s.current.values())e.reject(t);s.current.clear()}return l.onclose=()=>{u(),r.current=null,i.current=null,d(`Bash WebSocket closed`)},l.onerror=()=>{r.current=null,i.current=null,d(`Bash WebSocket error`)},()=>{u(),l.onclose=null,l.onerror=null,l.close(),r.current=null,i.current=null,d(`Bash WebSocket unmounted`)}},[n,e,t]),(0,X.useCallback)((e,t,n)=>new Promise((s,c)=>{let l=r.current;if(!l||l.readyState===WebSocket.CLOSED||l.readyState===WebSocket.CLOSING){c(Error(`Bash WebSocket not available`));return}l.readyState!==WebSocket.OPEN||i.current!==l?a.current.push({command:e,cwd:t,timeout:n,resolve:s,reject:c}):(o.current.push({resolve:s,reject:c}),l.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var Ia={repository:null,branch:null,provider:null,remoteUrl:null},La=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
|
|
3
3
|
`);async function Ra(e,t){let n=await e(La,t,10);if(n.exit_code!==0)return Ia;let r=n.stdout.indexOf(`
|
|
4
4
|
`),i=(r>=0?n.stdout.slice(0,r):n.stdout).trim(),a=(r>=0?n.stdout.slice(r+1):``).trim(),o=a&&a!==`HEAD`?a:null;if(!i&&!o)return Ia;let s=Fi(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var za=()=>{let{data:e}=Y(),t=Ni(),{backend:n}=T(),r=n.kind===`local`,i=e?.id,a=e?.conversation_url,o=e?.session_api_key,s=e?.workspace?.working_dir?.trim(),c=!!e?.selected_repository,l=!!e?.git_provider,u=!!e?.selected_branch,d=r&&t&&!!i&&!!s&&(!c||!l||!u),f=Fa(a,o,d),p=(0,X.useRef)(f);return p.current=f,_({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>Ra((e,t,n)=>p.current(e,t,n),s),enabled:d,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},Ba=()=>{let e=d(),{t}=b(`openhands`);return h({mutationFn:e=>yn.updateConversationRepository(e.conversationId,e.repository,e.branch,e.gitProvider),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n});let r=e.getQueriesData({queryKey:n});return e.setQueriesData({queryKey:n},e=>e&&{...e,selected_repository:t.repository,selected_branch:t.branch??null,git_provider:t.gitProvider??null}),{previousEntries:r}},onError:(n,r,i)=>{i?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),D(t(N.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{S(t(N.CONVERSATION$REPOSITORY_UPDATED))},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`local-git-info`,r.conversationId]})}})};function Va({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,Z.jsx)(Xt,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,Z.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function Ha({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=b(`openhands`),{providers:a}=qn(),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(null);(0,X.useEffect)(()=>{a.length===1&&!o?s(a[0]):a.length>1&&!o&&r&&a.includes(r)&&s(r)},[a,o,r]);let f=(0,X.useCallback)(e=>{e!==o&&(s(e),l(null),d(null))},[o]),p=(0,X.useCallback)(e=>{e?(l(e),d(null)):(l(null),d(null))},[]),m=(0,X.useCallback)(e=>{d(e)},[]),h=()=>{!c||!u||(n(c,u),l(null),d(null),t())},g=()=>{s(null),l(null),d(null),t()};if(!e)return null;let _=c?.git_provider||o||r,v=!!c&&!!u;return(0,Z.jsx)(Vt,{onClose:g,children:(0,Z.jsxs)(Ht,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(pn,{onClose:g,testId:`close-open-repository-modal`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(Wt,{title:i(N.CONVERSATION$OPEN_REPOSITORY)})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(N.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,Z.jsx)(jr,{providers:a,value:o,onChange:f})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,Z.jsx)(Mi,{provider:_,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,className:`w-full`}),(0,Z.jsx)(Ir,{repository:c?.full_name||null,provider:_,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,disabled:!c,className:`w-full`})]})]}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,onClick:g,children:i(N.BUTTON$CANCEL)}),(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,onClick:h,isDisabled:!v,children:i(N.BUTTON$LAUNCH)})]})]})})}function Ua({onSuggestionsClick:e}){let{t}=b(`openhands`),{conversationId:n}=J(),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),{addRecentRepository:c}=Jn(),l=q(e=>e.enqueuePendingMessage),u=q(e=>e.markPendingMessageError),{backend:d}=T(),f=d.kind===`local`,{providers:p}=qn(),m=f||p.length>0,{data:h}=Y(),{repositoryInfo:g}=vr(),{data:_}=za(),v=kr(),y=hi()?.isLoadingHistory??!1,x=(0,X.useRef)(v);(0,X.useEffect)(()=>{x.current=v},[v]);let{send:S}=we(),C=(0,X.useRef)(S);(0,X.useEffect)(()=>{C.current=S},[S]);let w=ke(),{mutate:E}=Ba(),{mutate:O,isPending:k}=zn(),A=h?.selected_repository||g?.selectedRepository,j=h?.git_provider||g?.gitProvider,M=h?.selected_branch||g?.selectedBranch,P=A||_?.repository||void 0,F=j||_?.provider,ee=M||_?.branch||void 0,te=(h?.id?hn(h.id):null)?.selected_workspace??null,ne=te&&te.replace(/\/+$/,``).split(`/`).pop()||null,I=!!P&&!!F,re=!!h&&v===`OPEN`&&!y;(0,X.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,X.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let ie=(e,r)=>{n&&(c(e),E({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(x.current!==`OPEN`){D(t(N.CONVERSATION$CLONE_COMMAND_FAILED_DISCONNECTED));return}let i=e.git_provider.charAt(0).toUpperCase()+e.git_provider.slice(1),a=`Clone ${e.full_name} from ${i} and checkout branch ${r.name}.`,o=n?l({conversationId:n,text:a}):null;w?.scrollDomToBottom(),Promise.resolve(C.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:t(N.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))})}}))},ae=!f||!!P||!!ne,oe=f&&!I;return ae||ee||I?(0,Z.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[ae?(0,Z.jsx)(Hr,{selectedRepository:P,gitProvider:F,workspaceName:ne,onClick:()=>i(!0),disabled:!re||oe}):null,ee?(0,Z.jsx)(Rr,{selectedBranch:ee,selectedRepository:P,gitProvider:F}):null,I?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(ka,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,isConversationReady:re})}),(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(Aa,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,currentGitProvider:F,isConversationReady:re})}),(0,Z.jsx)(Va,{tooltipMessage:t(N.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!I,children:(0,Z.jsx)(ja,{onSuggestionsClick:e,hasRepository:I,providerTokensReady:m,currentGitProvider:F,isConversationReady:re})})]}):null]}),(0,Z.jsx)(Ha,{isOpen:r,onClose:()=>i(!1),onLaunch:ie,defaultProvider:F})]}):null}function Wa({onSubmit:e,disabled:t=!1,hasStartedConversation:n}){let{images:r,files:i,imagesMarkedUploadAsFile:a,clearAllFiles:o,subConversationTaskId:s}=U(),{curAgentState:c}=Yr(),{data:l}=Y(),{conversationId:u}=Si(),d=u??l?.id??null,{taskStatus:f}=gr(s,l?.id||null),{handleUpload:p}=zr(),m=Ur(d,xa(d,wa(d,c,va(d,t=>{let{imagesToEmbed:n,imagesAsFiles:s}=Vr(r,a);e(t,n,[...i,...s]),o()}))));return(0,Z.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,Z.jsx)(Nr,{disabled:t||c===L.AWAITING_USER_CONFIRMATION||ge(f),isNewConversationPending:t,hasStartedConversation:n,onSubmit:m,onFilesPaste:p}),(0,Z.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,Z.jsx)(Ua,{onSuggestionsClick:e=>{m(e)}})})]})}function Ga(){let e=K(e=>e.events),t=K(e=>e.uiEvents),n=X.useMemo(()=>t.filter(yi),[t]),r=X.useMemo(()=>e,[e]),i=X.useMemo(()=>n.length,[n]),a=X.useMemo(()=>r.some(e=>e.source===`agent`&&!ni(e)&&!Oi(e)),[r]),o=bi(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var Ka=e=>`timestamp`in e?e.timestamp:void 0,qa=e=>{let t=!!e&&on(e),n=t?void 0:e,{data:r}=Zn(e??null),{data:i,isFetched:a}=_i(n??void 0),o=K(e=>e.addEvents),[s,c]=X.useState(!1),[l,u]=X.useState(!0),d=X.useRef(!1),f=X.useRef(!0);return X.useEffect(()=>{if(d.current=!1,c(!1),t){f.current=!1,u(!1);return}f.current=!0,u(!0)},[e,t]),X.useEffect(()=>{t||!a||!i||i.hasMore||(f.current=!1,u(!1))},[t,a,i?.hasMore,n]),{isLoading:s,hasMore:l,loadOlder:X.useCallback(async()=>{if(!e||on(e)||d.current||!f.current||!r)return;let{events:t}=K.getState(),n=t[0];if(!n)return;let i=Ka(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await Ti.searchEvents(e,r?.conversation_url??null,r?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`,timestampLt:i});if(!Array.isArray(t.items))throw Error(`Invalid older-events response: expected page.items to be an array.`);let n=[...t.items].reverse();n.length>0&&(o(n),wi(e,K.getState().uiEvents)),(!t.next_page_id||t.items.length<50)&&(f.current=!1,u(!1))}finally{d.current=!1,c(!1)}},[e,r,r?.conversation_url,r?.session_api_key,o])}},Ja=Ft(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Ya(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var Xa=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Za=new Set([`view`]),Qa=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function $a(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Xa.has(t.kind)||t.command&&Za.has(t.command))}function eo(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Qa.has(t.kind)}function to(){let e=d(),t=K(e=>e.events),n=Ja(e=>e.bump),r=(0,X.useRef)(new Set),i=(0,X.useRef)(new WeakSet);(0,X.useEffect)(()=>{let a=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?i.current.has(e):r.current.has(t))||(t===void 0?i.current.add(e):r.current.add(t),$a(e)?a=!0:eo(e)&&(o=!0))}!a&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),a&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var no={kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}},ro=new Set([`ExecuteBashAction`,`TerminalAction`,`FileEditorAction`,`StrReplaceEditorAction`,`MCPToolAction`,`InvokeSkillAction`,`TaskAction`,`ThinkAction`,`TaskTrackerAction`,`GrepAction`,`GlobAction`,`BrowserNavigateAction`,`BrowserClickAction`,`BrowserTypeAction`,`BrowserGetStateAction`,`BrowserGetContentAction`,`BrowserScrollAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserSwitchTabAction`,`BrowserCloseTabAction`]),io=e=>{if(!si(e))return null;let t=Ge(e);return t?{kind:`text`,text:t}:ro.has(e.action.kind)?Ae(e):null},ao=e=>e.source===`environment`&&`rejection_reason`in e,oo=e=>{let t=new Set,n=new Set;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isFromPlanningAgent){if(fi(i)||ao(i)){t.add(i.action_id),n.add(i.tool_call_id);continue}if($r(i)){n.add(i.tool_call_id);continue}if(ai(i)){if(!(i.status===`pending`||i.status===`in_progress`)){n.add(i.tool_call_id);continue}if(n.has(i.tool_call_id))continue;let e=qe(i);return e?{kind:`translation`,key:je(i),values:{title:e}}:no}if(si(i)&&!t.has(i.id)&&!n.has(i.tool_call_id))return io(i)??no}}return no};function so({events:e}){let t=oo(e);return(0,Z.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-3 py-1.5 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`live-activity-chip`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 shrink-0 animate-pulse rounded-full bg-[var(--oh-status-success)] motion-reduce:animate-none`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t.kind===`text`?t.text:(0,Z.jsx)(y,{ns:`openhands`,i18nKey:t.key,values:t.values,components:{path:(0,Z.jsx)(Fe,{}),cmd:(0,Z.jsx)(Pe,{})}})})]})}function co({suggestion:e,onClick:t}){let{t:n}=b(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,className:`list-none border border-[var(--oh-border)] rounded-[15px] hover:bg-surface-raised hover:border-[var(--oh-interactive-hover)] transition-colors flex-1 flex items-center justify-center cursor-pointer gap-[10px] h-[55px] px-4`,onClick:()=>t(e.value),children:[(0,X.useMemo)(()=>{switch(e.label){case`INCREASE_TEST_COVERAGE`:return(0,Z.jsx)(pr,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,Z.jsx)(Tr,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,Z.jsx)(qr,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,Z.jsx)(Mr,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,Z.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function lo({suggestions:e,onSuggestionClick:t}){return(0,Z.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,Z.jsx)(co,{suggestion:e,onClick:t},n))})}var uo=N.SUGGESTIONS$HACKER_NEWS,fo=`Please write a bash script which displays the top story on Hacker News. It should show the title, the link, and the number of points.
|
|
5
5
|
The script should only use tools that are widely available on unix systems, like curl and grep.`,po=N.SUGGESTIONS$HELLO_WORLD,mo=`I want to create a Hello World app in Javascript that:
|
|
@@ -20,7 +20,7 @@ This should be a client-only app with no backend. The list should persist in loc
|
|
|
20
20
|
`)}`,h=p.length>0?`${r}\n\n${m}`:r,g=w({conversationId:z,text:r,content:h,imageUrls:u,fileUrls:p,timestamp:d});A(),n(``);try{await _(Ie(h,u,p,d))}catch(e){T(g,e instanceof Error?e.message:O(N.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))}};X.useEffect(()=>{if(B.current&&k.current){let{scrollHeight:e,scrollTop:t}=B.current,n=k.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),B.current=null;return}P&&A()},[v.length,Te,he,A]);let Ne=X.useRef(be);X.useEffect(()=>{Ne.current=be}),X.useEffect(()=>{let e=k.current;e&&Ne.current(e)},[v.length,ve]);let Pe={scrollRef:k,autoScroll:P,setAutoScroll:F,scrollDomToBottom:A,hitBottom:M,setHitBottom:ee,onChatBodyScroll:j},Fe=I===L.LOADING||I===L.INIT,Le=I===L.STOPPED,Re=I===L.PAUSED,Be=le({isPausing:Re,isTask:f,taskStatus:p,isStartingStatus:Fe,isStopStatus:Le,curAgentState:I}),Ve=ae({isPausing:Re,isTask:f,taskStatus:p,taskDetail:m,isStartingStatus:Fe,isStopStatus:Le,curAgentState:I,errorMessage:a,t:O});return(0,Z.jsx)(Oe,{children:(0,Z.jsx)(Ke,{value:Pe,children:(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!S&&!Te&&!C&&!Ee&&!je&&!h&&x===0&&!ce&&!fe&&(0,Z.jsx)(vo,{onSuggestionsClick:e=>n(e)}),(0,Z.jsxs)(`div`,{ref:k,"data-testid":`chat-scroll-container`,onScroll:e=>{j(e.currentTarget),be(e.currentTarget)},onWheel:xe,className:`custom-scrollbar-always flex min-h-0 grow flex-col gap-2 overflow-x-hidden overflow-y-auto px-0 pt-4 pb-8 md:px-4`,children:[je&&Ae&&(0,Z.jsx)(To,{}),je&&!Ae&&(0,Z.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,Z.jsx)(Lt,{size:`small`})}),_e&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,Z.jsx)(Lt,{size:`small`}),(0,Z.jsx)(`span`,{children:O(N.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,Z.jsx)(Se,{conversationId:z,anchorEventId:null}),ke&&v.length>0&&(0,Z.jsx)(Ue,{messages:v,allEvents:y}),(0,Z.jsx)(Po,{}),(0,Z.jsx)(ga,{conversationId:z})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px] pb-4`,children:[(0,Z.jsx)(No,{conversationId:z}),(0,Z.jsx)(ha,{conversationId:z}),a&&(0,Z.jsx)(Do,{message:a,code:o,classification:s,onDismiss:c,onRetry:a===`Unable to connect to server`?()=>g?.reconnect():void 0,onReauth:ua(o)?()=>d(`/settings/agents`):void 0}),fe&&!ce&&(0,Z.jsx)(Wr,{}),ce?(0,Z.jsxs)(`div`,{"data-testid":`archived-conversation-banner`,className:`mx-1 px-4 py-3 rounded-lg bg-[var(--oh-surface)] border border-[var(--oh-border-subtle)]`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:O(se===`ERROR`?N.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:N.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,Z.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:O(se===`ERROR`?N.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:N.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,Z.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,Z.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,Z.jsx)(Lo,{}),Fe&&(0,Z.jsx)(zo,{statusColor:Be,status:Ve})]}),M?(I===L.RUNNING||re)&&(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-9 bottom-0 flex justify-center`,children:(0,Z.jsx)(so,{events:y})}):(0,Z.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,Z.jsx)(So,{onClick:A})})]})}),(0,Z.jsx)(Wa,{onSubmit:Me,disabled:ne||fe,hasStartedConversation:De})]})]})]})})})}function Uo(e){return e?e.replace(/\/+$/,``).split(`/`).pop()||e:null}function Wo(){let{conversationId:e}=J(),{data:t}=Y();return{workspaceName:Uo((e?hn(e):null)?.selected_workspace??t?.selected_workspace??null)}}function Go(){let{data:e}=Y(),{repositoryInfo:t}=vr(),{data:n}=za(),r=e?.selected_repository||t?.selectedRepository,i=e?.git_provider||t?.gitProvider,a=e?.selected_branch||t?.selectedBranch,o=r||n?.repository||null,s=i||n?.provider||null;return{repository:o,provider:s,branch:a||n?.branch||null,isConnected:!!(o&&s)}}function Ko(e){return e.startsWith(`/`)?e:`/${e}`}async function qo(e,t,n,r){let i=ve().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:Ko(r.path)});return Pt({backend:i,method:`GET`,hostOverride:_e(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new It(B({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function Jo(e){return x(e,404)||f(e)&&e.response?.status===404}var Yo=class{static async getGitChanges(e,t,n,r){let i=ve().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,Ko(r));let n=await Pt({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:Kn(String(e.status)),path:e.path}))}let a=await new It(B({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:Kn(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await qo(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(Jo(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await qo(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:Kn(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await qo(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=ve().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,Ko(r));let n=await Pt({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new It(B({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}},Xo=()=>{let{conversationId:e}=J(),{data:t}=Y(),[n,r]=X.useState([]),i=X.useRef(null),a=Ni(),o=t?.conversation_url,s=t?.session_api_key,c=t?.selected_repository,l=t?.workspace?.working_dir?.trim(),u=X.useMemo(()=>Pi(c,l),[c,l]),d=_({queryKey:[`file_changes`,e,o,s,u],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitChanges(e,o,s,u)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:a&&!!e,meta:{disableToast:!0}});return X.useEffect(()=>{if(!d.isFetching&&d.isSuccess&&d.data){let e=d.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[d.isFetching,d.isSuccess,d.data]),{data:n,isLoading:d.isLoading,isFetching:d.isFetching,isSuccess:d.isSuccess,isError:d.isError,error:d.error,refetch:d.refetch}};function Zo(e){let t=0,n=0,r=!1;for(let i of e.split(`
|
|
21
21
|
`)){if(i.startsWith(`diff --git`)||i.startsWith(`index `)){r=!1;continue}if(i.startsWith(`@@`)){r=!0;continue}!r&&(i.startsWith(`---`)||i.startsWith(`+++`))||r&&(i.startsWith(`+`)?t+=1:i.startsWith(`-`)&&(n+=1))}return{additions:t,deletions:n}}function Qo(e,t){let n=e.length===0?[]:e.split(`
|
|
22
22
|
`),r=t.length===0?[]:t.split(`
|
|
23
|
-
`);if(n.length===0)return{additions:r.length,deletions:0};if(r.length===0)return{additions:0,deletions:n.length};let i=0,a=0,o=0,s=0;for(;o<n.length||s<r.length;){let e=n[o],t=r[s];if(o<n.length&&s<r.length&&e===t){o+=1,s+=1;continue}if(s<r.length&&(o>=n.length||!n.slice(o).includes(t))){i+=1,s+=1;continue}o<n.length&&(a+=1,o+=1)}return{additions:i,deletions:a}}function $o(e){return typeof e.diff==`string`&&e.diff.length>0?Zo(e.diff):Qo(e.original??``,e.modified??``)}function es(e){return e.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}function ts(){let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),{data:r,isLoading:i,isSuccess:a,isError:o}=Xo(),s=t?.conversation_url,c=t?.session_api_key,l=(0,X.useMemo)(()=>Pi(t?.selected_repository,t?.workspace?.working_dir?.trim()),[t?.selected_repository,t?.workspace?.working_dir]),u=g({queries:(0,X.useMemo)(()=>(r??[]).filter(e=>e.status!==`D`),[r]).map(t=>({queryKey:[`conversation_overview_file_diff`,e,s,c,l,t.path],queryFn:async()=>Yo.getGitChangeDiff(e,s,c,`${l}/${t.path}`),enabled:n&&!!e&&a&&!!t.path,staleTime:1e3*60*5,meta:{disableToast:!0}}))}),d=u.some(e=>e.isLoading),f=es(u.flatMap(e=>e.data?[$o(e.data)]:[]));return{additions:f.additions,deletions:f.deletions,changeCount:r?.length??0,isLoading:i||d,isError:o}}var ns=(0,X.createContext)(null);function rs({children:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(0),s=(0,X.useCallback)((e,t)=>{n(e),i(!!t?.openAdd),o(0)},[]),c=(0,X.useCallback)(()=>{n(null),i(!1),o(0)},[]),l=(0,X.useCallback)(()=>{o(e=>e+1)},[]),u=(0,X.useMemo)(()=>({section:t,openAdd:r,addRequestKey:a,openSection:s,closeDrawer:c,requestAdd:l}),[a,c,r,s,l,t]);return(0,Z.jsx)(ns.Provider,{value:u,children:e})}function is(){let e=(0,X.useContext)(ns);if(!e)throw Error(`useConversationOverviewDrawer must be used within ConversationOverviewDrawerProvider`);return e}function as(){return(0,X.useContext)(ns)}var os=e(r(),1),ss=`!w-auto whitespace-nowrap`;function cs({anchorRef:e,onClose:t,gitProvider:n,testIdPrefix:r=`conversation-git-actions`}){let{t:i}=b(`openhands`),a=Rn(t),o=U(e=>e.setMessageToSend),[s,c]=(0,X.useState)();return(0,X.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();c({position:`fixed`,top:e.bottom+4,right:window.innerWidth-e.right,zIndex:50})};return n(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]),s?os.createPortal((0,Z.jsxs)(Mt,{ref:a,testId:`${r}-menu`,theme:`popover`,style:s,className:`w-max min-w-[8rem]`,children:[(0,Z.jsx)(V,{testId:`${r}-commit`,onClick:()=>{o(ce()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0}),text:i(N.DIFF_VIEWER$COMMITS)})}),(0,Z.jsx)(V,{testId:`${r}-pull`,onClick:()=>{o(re()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Er,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PULL)})}),(0,Z.jsx)(V,{testId:`${r}-push`,onClick:()=>{o(ie(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(hr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PUSH)})}),(0,Z.jsx)(V,{testId:`${r}-create-pr`,onClick:()=>{o(me(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Kr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_PR)})}),(0,Z.jsx)(V,{testId:`${r}-create-new-branch`,onClick:()=>{o(de()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(dr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_NEW_BRANCH)})})]}),document.body):null}var ls=R(`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer border-0 bg-transparent text-left`),us=`size-4 shrink-0 text-[var(--oh-muted)]`,ds=`conversation-overview-diffs-git-action`,fs=R(ds,`absolute inset-0 inline-flex items-center justify-center`,`rounded-md text-[var(--oh-muted)] transition-opacity`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),ps=R(`flex items-center rounded-md transition-colors`,`hover:bg-white/5`,`has-[.${ds}:hover]:bg-transparent`),ms=R(`pointer-events-none invisible opacity-0`,`group-hover/diffstats:pointer-events-auto group-hover/diffstats:visible group-hover/diffstats:opacity-100`,`group-focus-within/diffstats:pointer-events-auto group-focus-within/diffstats:visible group-focus-within/diffstats:opacity-100`);function hs(){let{t:e}=b(`openhands`),{navigateToChanges:t}=mi(),n=as(),{data:r}=Y(),{additions:i,deletions:a,isLoading:o}=ts(),s=r?.git_provider??`github`,[c,l]=(0,X.useState)(!1),u=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!c)return;let e=e=>{e.key===`Escape`&&l(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,Z.jsxs)(`li`,{className:ps,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-diffs`,"aria-label":e(N.CONVERSATION$OVERVIEW_OPEN_CHANGES),onClick:()=>{n?.closeDrawer(),t()},className:ls,children:[(0,Z.jsx)(dt,{className:us,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.COMMON$CHANGES)})]}),(0,Z.jsx)(`div`,{className:`group/diffstats relative mr-2 flex h-6 min-w-6 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:R(`flex items-center gap-1.5 text-sm tabular-nums transition-opacity`,c?`opacity-0`:`group-hover/diffstats:opacity-0 group-focus-within/diffstats:opacity-0`),children:[(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-additions`,style:{color:M},children:e(N.CONVERSATION$OVERVIEW_DIFF_ADDITIONS,{count:i.toLocaleString()})}),(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-deletions`,style:{color:ne},children:e(N.CONVERSATION$OVERVIEW_DIFF_DELETIONS,{count:a.toLocaleString()})})]}),(0,Z.jsx)(`button`,{ref:u,type:`button`,"data-testid":`conversation-overview-diffs-git-action`,"aria-label":e(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),"aria-expanded":c,"aria-haspopup":`menu`,onClick:e=>{e.stopPropagation(),l(e=>!e)},className:R(fs,!c&&ms,c&&`pointer-events-auto visible opacity-100 text-[var(--oh-foreground)]`),children:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0})}),c?(0,Z.jsx)(cs,{anchorRef:u,gitProvider:s,testIdPrefix:`conversation-overview-diffs-git`,onClose:()=>l(!1)}):null]})})]})}var gs=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:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),_s=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`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})}),Q={automations:`automations`,skills:`skills`,mcp:`mcp`,secrets:`secrets`,pull_requests:`pull_requests`,issues:`issues`},vs={[W.workspace]:{section:W.workspace,icon:pt,i18nKey:N.CONVERSATION$OVERVIEW_WORKSPACE}},ys=[{part:H.changes,icon:dt,i18nKey:N.COMMON$CHANGES,opensChanges:!0},{part:H.repository,icon:Xe,i18nKey:N.CONVERSATION$REPOSITORY},{part:H.branch,icon:at,i18nKey:N.CONVERSATION$BRANCH},{part:H.commits,icon:lt,i18nKey:N.DIFF_VIEWER$COMMITS,opensCommits:!0},{part:H.pull_requests,icon:Kr,i18nKey:N.CONVERSATION$OVERVIEW_PULL_REQUESTS,drawerSection:Q.pull_requests}];function bs({testId:e,pinned:t,pinnedLabel:n,unpinnedLabel:r,onClick:i}){return(0,Z.jsx)(`button`,{type:`button`,"data-testid":e,className:R(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white`,Zt,`hover:bg-white/10`),"aria-pressed":t,"aria-label":t?n:r,onClick:i,children:(0,Z.jsx)(`span`,{className:R(`ml-auto overflow-hidden`,Qt),"aria-hidden":!0,children:t?(0,Z.jsx)(_s,{className:`size-4`,width:16,height:16}):(0,Z.jsx)(gs,{className:`size-4`,width:16,height:16})})})}function xs({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)(),{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedOverviewSections:u,setUnpinnedOverviewGitParts:d}=sn(c),{navigateToChanges:f,navigateToCommits:p}=mi(),m=as();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let h=e=>{if(e.opensChanges){m?.closeDrawer(),f(),t();return}if(e.opensCommits){m?.closeDrawer(),p(),t();return}e.drawerSection&&(m?.openSection(e.drawerSection),t())},g=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewSections??[];if(n.includes(e)){u?.(n.filter(t=>t!==e));return}u?.([...n,e])},_=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewGitParts??[];if(n.includes(e)){d?.(n.filter(t=>t!==e));return}d?.([...n,e])};if(!e)return null;let v=!!(r?.current&&a),y=fn(W.git,l.unpinnedOverviewSections??[]),x=s(N.CONVERSATION$UNPIN_OVERVIEW_SECTION),S=s(N.CONVERSATION$PIN_OVERVIEW_SECTION),C=({key:e,testIdOpen:t,testIdPin:n,icon:r,label:i,pinned:a,isActionable:o,indent:s=!1,onOpen:c,onPinToggle:l})=>{let u=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(r,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:i})]});return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded hover:bg-[var(--oh-interactive-hover)]`,s&&`pl-4`),children:[o?(0,Z.jsx)(`button`,{type:`button`,"data-testid":t,className:R(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white`,Zt),onClick:c,children:u}):(0,Z.jsx)(`div`,{"data-testid":t,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt),children:u}),(0,Z.jsx)(bs,{testId:n,pinned:a,pinnedLabel:x,unpinnedLabel:S,onClick:l})]})},e)},w=e=>{if(e===W.git)return null;let t=vs[e];return C({key:e,testIdOpen:`conversation-overview-menu-open-${e}`,testIdPin:`conversation-overview-menu-pin-${e}`,icon:t.icon,label:s(t.i18nKey),pinned:fn(e,l.unpinnedOverviewSections??[]),isActionable:!1,onPinToggle:t=>g(e,t)})},T=(0,Z.jsxs)(Mt,{ref:i,testId:`conversation-overview-context-menu`,theme:v?`popover`:`default`,position:v?`none`:`bottom`,alignment:v?`none`:`right`,spacing:v?`none`:`default`,className:R(`z-[9999] w-fit`,v?`mt-0`:`mt-2`),children:[cn.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-${t}`,inset:`menu`}):null,e.sections.map(e=>w(e))]},e.sections.join(`-`))),(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-git`,inset:`menu`}),C({key:W.git,testIdOpen:`conversation-overview-menu-open-${W.git}`,testIdPin:`conversation-overview-menu-pin-${W.git}`,icon:at,label:s(N.CONVERSATION$OVERVIEW_GIT),pinned:y,isActionable:!1,onPinToggle:e=>g(W.git,e)}),ys.map(e=>C({key:e.part,testIdOpen:`conversation-overview-menu-open-git-${e.part}`,testIdPin:`conversation-overview-menu-pin-git-${e.part}`,icon:e.icon,label:s(e.i18nKey),pinned:ln(e.part,l.unpinnedOverviewGitParts??[]),isActionable:!!(e.drawerSection||e.opensCommits||e.opensChanges),indent:!0,onOpen:()=>h(e),onPinToggle:t=>_(e.part,t)}))]});return v&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:T}),document.body):T}var Ss={github:[`GITHUB_TOKEN`,`GH_TOKEN`,`github`],gitlab:[`GITLAB_TOKEN`,`GL_TOKEN`,`gitlab`],bitbucket:[`BITBUCKET_TOKEN`,`bitbucket`],forgejo:[`FORGEJO_TOKEN`,`forgejo`]},Cs=30;async function ws(e){if(ve().backend.kind!==`local`)return null;let t=Ss[e]??[];if(t.length===0)return null;let n=await rr.getSecrets(),r=new Set(n.map(e=>e.name)),i=t.find(e=>r.has(e));if(!i)return null;try{return await new Nt(B()).getSecret(i)}catch{return null}}function Ts(e,t,n){let r=z(t);switch(t){case`gitlab`:return`${r}/${n}/-/issues/${e}`;case`bitbucket`:return`${r}/${n}/issues/${e}`;case`forgejo`:return`${r}/${n}/issues/${e}`;default:return`${r}/${n}/issues/${e}`}}function Es(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/issues`;case`bitbucket`:return`${n}/${t}/issues`;case`forgejo`:return`${n}/${t}/issues`;default:return`${n}/${t}/issues`}}function Ds(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/merge_requests`;case`bitbucket`:return`${n}/${t}/pull-requests`;case`forgejo`:return`${n}/${t}/pulls`;default:return`${n}/${t}/pulls`}}async function Os(e,t){let n={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`https://api.github.com${e}`,{headers:n});if(!r.ok)throw Error(`GitHub API ${r.status}`);return r.json()}async function ks(e,t){let n={Accept:`application/json`};t&&(n[`PRIVATE-TOKEN`]=t);let r=await fetch(`https://gitlab.com/api/v4${e}`,{headers:n});if(!r.ok)throw Error(`GitLab API ${r.status}`);return r.json()}var As=class{static constructIssuesListUrl=Es;static constructPullRequestsListUrl=Ds;static async listPullRequests(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/merge_requests?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/pulls?state=open&per_page=${Cs}`,n)).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||pe(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}static async listIssues(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/issues?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/issues?state=open&per_page=${Cs}`,n)).filter(e=>!e.pull_request).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||Ts(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}};function js(e,t){return _({queryKey:[`repository-pull-requests`,t,e],queryFn:()=>As.listPullRequests(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}function Ms(e,t){return _({queryKey:[`repository-issues`,t,e],queryFn:()=>As.listIssues(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}var Ns=()=>{let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),s=X.useMemo(()=>Pi(a,o),[a,o]),c=_({queryKey:[`git_commits`,e,r,i,s],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitCommits(r,i,s,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:c.data?.commits??[],hasMore:c.data?.hasMore??!1,isUnsupported:c.data===null,isLoading:c.isLoading,isFetching:c.isFetching,isSuccess:c.isSuccess,isError:c.isError}},Ps=`size-4 shrink-0 text-[var(--oh-muted)]`,Fs=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`),Is=`-`;function Ls(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{state:n}=sn(t),{navigateToCommits:r}=mi(),i=as(),{data:a}=Bt(),{repository:o,provider:s,branch:c,isConnected:l}=Go(),u=ln(H.repository,n.unpinnedOverviewGitParts??[]),d=ln(H.branch,n.unpinnedOverviewGitParts??[]),f=ln(H.commits,n.unpinnedOverviewGitParts??[]),p=ln(H.pull_requests,n.unpinnedOverviewGitParts??[]),m=js(p?o:null,p?s:null),h=Ns();if(!l||!o||!s||!u&&!d&&!f&&!p)return null;let g=a?.provider_tokens_set?.[s]??null,_=oe(s,o,g),v=c?ue(s,o,c,g):null,y=m.data?.length??null,x=h.isUnsupported?null:h.commits.length,S=x!==null&&x>0?h.hasMore?`${x}+`:String(x):Is,C=()=>{i?.openSection(Q.pull_requests)},w=()=>{i?.closeDrawer(),r()},T=u||d,E=f||p;return(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-section`,children:[T?(0,Z.jsxs)(`div`,{className:`px-2 pb-1`,children:[u?(0,Z.jsxs)(`a`,{href:_,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-repo`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(tn,{gitProvider:s,className:Ps}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:o}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):null,d?c&&v?(0,Z.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-branch`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Bn,{size:14,className:`shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:c}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-branch`,className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,Z.jsx)(at,{className:`size-3.5 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:R(`text-sm`,c?`text-[var(--oh-foreground)]`:`text-[var(--oh-muted)]`),children:c||e(N.CONVERSATION$OVERVIEW_NONE)})]}):null]}):null,E?(0,Z.jsxs)(`ul`,{className:`px-2`,children:[f?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-commits`,onClick:w,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(lt,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.DIFF_VIEWER$COMMITS)}),h.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-commits-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:S})]})}):null,p?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-pull-requests`,onClick:C,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Kr,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.CONVERSATION$OVERVIEW_PULL_REQUESTS)}),m.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-pull-requests-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:y!==null&&y>0?y:Is})]})}):null]}):null]})}var Rs=R(`w-full max-w-[240px] rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface)] pb-1`),zs=R(`flex items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),Bs=`size-4 shrink-0 text-[var(--oh-muted)]`;function Vs({icon:e,label:t,value:n,testId:r}){return(0,Z.jsxs)(`li`,{"data-testid":r,className:zs,children:[e,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t}),(0,Z.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-right text-sm text-[var(--oh-muted)]`,children:n})]})}function Hs(){return(0,Z.jsx)(`div`,{className:`px-1`,children:(0,Z.jsx)(rn,{inset:`menu`})})}function Us(){let{t:e}=b(`openhands`),t=Wo(),{conversationId:n}=J(),{state:r}=sn(n),{isConnected:i}=Go(),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),c=e=>fn(e,r.unpinnedOverviewSections??[]),l=ln(H.changes,r.unpinnedOverviewGitParts??[]),u=c(W.git)&&(l||i),d=cn.flatMap(e=>e.sections.filter(e=>c(e))),f=[];u&&f.push({kind:`git`,key:`git`}),d.length>0&&f.push({kind:`sections`,key:d.join(`-`),sections:d});let p=n=>{switch(n){case W.workspace:return(0,Z.jsx)(Vs,{testId:`conversation-overview-workspace`,icon:(0,Z.jsx)(pt,{className:Bs}),label:e(N.CONVERSATION$OVERVIEW_WORKSPACE),value:t.workspaceName??e(N.CONVERSATION$OVERVIEW_NONE)},n);case W.git:return null;default:return n}};return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-panel`,"aria-label":e(N.CONVERSATION$OVERVIEW),className:Rs,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-0.5 pt-2.5`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-[var(--oh-muted)]`,children:e(N.CONVERSATION$OVERVIEW)}),(0,Z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:s,testId:`conversation-overview-ellipsis`,onClick:()=>o(e=>!e),ariaLabel:e(N.COMMON$MORE_OPTIONS)}),(0,Z.jsx)(xs,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:s,anchorRef:s})]})]}),f.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(Hs,{}):null,e.kind===`git`?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-block`,children:[l?(0,Z.jsx)(`ul`,{className:`px-2`,children:(0,Z.jsx)(hs,{})}):null,i?(0,Z.jsx)(Ls,{}):null]}):(0,Z.jsx)(`ul`,{className:`px-2`,children:e.sections.map(e=>p(e))})]},e.key))]})}var Ws={duration:.2,ease:`easeInOut`};function Gs(e){return e>=596}var Ks=typeof window<`u`?X.useLayoutEffect:X.useEffect;function qs(e,t){let[n,r]=(0,X.useState)(!1);return Ks(()=>{if(!t){r(!1);return}let n=e.current;if(!n)return;let i=()=>{r(Gs(n.clientWidth))};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e,t]),n}var Js=`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0`;function Ys({isRightPanelShown:e}){let t=Ii(),n=!De()&&!0,r=U(e=>e.isOverviewPanelShown),a=(0,X.useRef)(null),o=!t&&r,s=qs(a,o);return(0,Z.jsxs)(`div`,{ref:a,className:`flex h-full min-h-0 w-full overflow-hidden`,children:[(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 justify-center overflow-hidden`,children:(0,Z.jsx)(`div`,{className:Js,children:(0,Z.jsx)(Ho,{})})}),(0,Z.jsx)(i,{children:o&&s?(0,Z.jsx)(Qe.div,{"data-testid":`conversation-overview-column`,initial:n?{width:0,opacity:0}:!1,animate:{width:268,opacity:1},exit:n?{width:0,opacity:0}:{opacity:0},transition:Ws,className:`flex shrink-0 flex-col items-start overflow-hidden pt-4 pl-3 pr-4`,children:(0,Z.jsx)(`div`,{className:`w-full shrink-0`,style:{width:268},children:(0,Z.jsx)(Us,{})})},`conversation-overview-column`):null})]})}function Xs({children:e}){return(0,Z.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Zs({children:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Qs({children:e}){return(0,Z.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function $s({className:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`div`,{className:R(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,Z.jsx)(vt,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,Z.jsx)(Ve,{as:`p`,role:`status`,"aria-live":`polite`,className:`block w-full text-center text-base font-normal leading-5`,duration:1,spread:2,children:t(N.HOME$LOADING)})]})}function ec({children:e,onReady:t}){return(0,X.useLayoutEffect)(()=>{t()},[t]),e}function tc({onPending:e}){return(0,X.useLayoutEffect)(()=>{e()},[e]),(0,Z.jsx)($s,{})}var nc={duration:.35,ease:`easeInOut`};function rc({showAgentLoading:e,tabKey:t,children:n}){let r=De(),[a,o]=(0,X.useState)(!1);(0,X.useLayoutEffect)(()=>{o(!1)},[t]);let s=(0,X.useCallback)(()=>{o(!0)},[]),c=(0,X.useCallback)(()=>{o(!1)},[]),l=e||a;return r?(0,Z.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:l?(0,Z.jsx)($s,{}):(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}):(0,Z.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,Z.jsx)(Qe.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!l},transition:nc,"aria-hidden":l,children:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}),(0,Z.jsx)(i,{children:l?(0,Z.jsx)(Qe.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:nc,children:(0,Z.jsx)($s,{})},`conversation-tab-loading-overlay`):null})]})}var ic=(0,X.lazy)(()=>a(()=>import(`./files-tab-D5PPIWI1.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),ac=(0,X.lazy)(()=>a(()=>import(`./commits-tab-D0xgjipP.js`),__vite__mapDeps([74,1,2,75,7,5,76,6,20,77,8,9,4,10,11,12,13,14,3,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,59,103,104,105,106,107,108,109,110,61,68,69,111,112,113,114,115,116,117,118,119,120,121,73,122,123,70,124]))),oc=(0,X.lazy)(()=>a(()=>import(`./browser-tab-HjJxHA0V.js`),__vite__mapDeps([125,2,1,18,9,4,6,5,10,11,12,13,14,3,15,7,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,126,127,70]))),sc=(0,X.lazy)(()=>a(()=>import(`./planner-tab-CstoOlAB.js`),__vite__mapDeps([128,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,129,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,59,103,104,105,106,107,108,109,110,61,68,69,111,112,113,114,115,116,117,118,119,120,121,73,122,123,70]))),cc=(0,X.lazy)(()=>a(()=>import(`./task-list-tab-OkZSqnTp.js`),__vite__mapDeps([130,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,70]))),lc=(0,X.lazy)(()=>a(()=>import(`./usage-tab-MCmNRAnR.js`),__vite__mapDeps([131,1,2,9,4,6,5,10,11,12,13,79,7,98,18,14,3,15,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,132,44,104,78,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,56,99,100,101,42,43,102,59,103,105,106,107,108,109,110,46,61,47,68,69,111,112,113,114,55,115,116,117,118,119,120,121,73,122,53,123,58,70]))),uc=(0,X.lazy)(()=>a(()=>import(`./terminal-Dph60VFZ.js`),__vite__mapDeps([133,1,2,134,135,76,6,5,20,18,9,4,10,11,12,13,14,3,15,7,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,78,79,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,56,99,100,101,42,43,102,59,44,103,104,105,106,107,108,109,110,46,61,47,68,69,111,112,113,114,55,115,116,117,118,119,120,121,73,122,53,123,58,70]))),dc={tasklist:{component:cc},files:{component:ic},commits:{component:ac},browser:{component:oc},terminal:{component:uc},planner:{component:sc},usage:{component:lc}};function fc(){let{selectedTab:e,shouldShownAgentLoading:t}=U(),{conversationId:n}=J(),r=(0,X.useMemo)(()=>dc[e]??dc.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,Z.jsx)(Zs,{children:(0,Z.jsx)(Qs,{children:(0,Z.jsx)(rc,{showAgentLoading:t,tabKey:i,children:(0,Z.jsx)(Xs,{children:(0,Z.jsx)(r,{})},i)})})})}var pc=()=>{let e=d(),t=Qr(e=>e.removeErrorMessage);return h({mutationKey:[`start-conversation`],mutationFn:async e=>wn(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{xn(e,r.conversationId)},onSuccess:(n,r)=>{t(),On(e,r.conversationId,k.RUNNING)}})},mc=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:`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM10 9H14A1 1 0 0 1 15 10V14A1 1 0 0 1 14 15H10A1 1 0 0 1 9 14V10A1 1 0 0 1 10 9Z`,fill:`currentColor`})}),hc=e=>(0,Z.jsxs)(`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:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function gc({icon:e,text:t,onClick:n,testId:r}){return(0,Z.jsx)(V,{testId:r,onClick:n,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:e})]})})}function _c({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=Yr(),{isTask:i,taskStatus:a,taskDetail:o}=vr(),{t:s}=b(`openhands`),{errorMessage:c}=Qr(),l=r===L.LOADING||r===L.INIT,u=ee(t)||A(t),d=le({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=ae({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,Z.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(Ro,{className:`w-6 h-6 shrink-0`,color:d}),(0,Z.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function vc({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1,ignoreOutsideClickRef:s}){let{t:c}=b(`openhands`),l=Rn(e,s),u=he(r),d=A(r),f=u||d;return(0,Z.jsxs)(Mt,{ref:l,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:R(`left-2 w-fit min-w-42`,a),children:[(0,Z.jsx)(_c,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rn,{inset:`menu`}),u&&t&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(mc,{width:18,height:18}),text:c(N.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),d&&n&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(hc,{width:18,height:18}),text:c(N.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}function yc({isPublic:e,onToggle:t,ariaLabel:n}){return(0,Z.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,Z.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:R(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,Z.jsx)(`span`,{className:R(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function bc({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onExportTranscript:u,onDownloadConversation:d,shareUrl:f,position:p=`bottom`,anchorRef:m}){let h=Ii(),{t:g}=b(`openhands`),{backend:_}=T(),{data:v}=Y(),y=Ar(),x=Rn(e,m),S=m?.current??null,[C,w]=X.useState();X.useLayoutEffect(()=>{if(!S)return;let e=()=>{let e=S.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};p===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,w(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[S,p]);let E=!!(a||o||s),D=!!i,O=!!(r||n),k=_.kind===`cloud`?N.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:N.COMMON$STOP_CONVERSATION,A=_.kind===`cloud`&&!!c,j=v?.public||!1,M=!!S,P=(0,Z.jsxs)(Mt,{ref:x,testId:`conversation-name-context-menu`,position:p,alignment:`left`,className:R(h?`right-0 translate-x-[34%] left-auto`:``,M?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,Z.jsx)(V,{testId:`rename-button`,onClick:t,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Un,{width:16,height:16}),text:g(N.BUTTON$RENAME)})}),E&&(0,Z.jsx)(rn,{testId:`separator-tools`,inset:`menu`}),o&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-skills-button`,onClick:o,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Wn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-hooks-button`,onClick:s,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Sr,{width:16,height:16,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-agent-tools-button`,onClick:a,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(nn,{width:16,height:16}),text:g(N.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,Z.jsx)(V,{testId:`export-transcript-button`,onClick:u,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$EXPORT_TRANSCRIPT)})}),d&&(0,Z.jsx)(V,{testId:`download-trajectory-button`,onClick:d,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(D||O)&&(0,Z.jsx)(rn,{testId:`separator-info-control`,inset:`menu`}),i&&(0,Z.jsx)(V,{testId:`display-cost-button`,onClick:i,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(ot,{size:16}),text:g(N.BUTTON$DISPLAY_COST)})}),A&&c&&(0,Z.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,Z.jsx)(ut,{size:16})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:g(N.CONVERSATION$SHARE_PUBLICLY)}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[j&&f&&l&&(0,Z.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$COPY_TO_CLIPBOARD),children:(0,Z.jsx)(Qn,{width:14,height:14})}),(0,Z.jsx)(`a`,{"data-testid":`open-share-link-button`,href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$OPEN_IN_NEW_TAB),children:(0,Z.jsx)(it,{size:14,"aria-hidden":!0})})]}),(0,Z.jsx)(yc,{isPublic:j,onToggle:c,ariaLabel:g(N.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`stop-button`,onClick:r,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)($t,{width:16,height:16}),text:g(k)})})}),n&&(0,Z.jsx)(V,{testId:`delete-button`,onClick:n,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Vn,{width:16,height:16}),text:g(N.COMMON$DELETE_CONVERSATION)})})]});return M?typeof document>`u`||!C?null:os.createPortal((0,Z.jsx)(`div`,{style:C,children:P}),document.body):P}var xc=new Set([`BrowserClickAction`,`BrowserCloseTabAction`,`BrowserGetContentAction`,`BrowserGetStateAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserNavigateAction`,`BrowserScrollAction`,`BrowserSwitchTabAction`,`BrowserTypeAction`,`ExecuteBashAction`,`FileEditorAction`,`GlobAction`,`GrepAction`,`InvokeSkillAction`,`MCPToolAction`,`StrReplaceEditorAction`,`TaskAction`,`TaskTrackerAction`,`TerminalAction`,`ThinkAction`]),Sc=new Set([`BrowserObservation`,`CanvasUIObservation`,`ExecuteBashObservation`,`FileEditorObservation`,`GlobObservation`,`GrepObservation`,`InvokeSkillObservation`,`MCPToolObservation`,`StrReplaceEditorObservation`,`SwitchLLMObservation`,`TaskTrackerObservation`,`TaskObservation`,`TerminalObservation`]),Cc=e=>e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim(),wc=(e,t=100)=>e.length>t?`${e.slice(0,t)}…`:e,Tc=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()},$=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`).replaceAll(`'`,`'`),Ec=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replace(/(!?)\[([^\]]*)\]\(\s*((?:javascript|data|vbscript):[^)]*)\)/gi,`$1\\[$2\\]($3)`).replace(/^(\s{0,3})\[([^\]]+)\]:(\s*<?(?:javascript|data|vbscript):)/gim,`$1\\[$2\\]:$3`),Dc=e=>Cc(e||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE))||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE),Oc=(e,t)=>Cc(w.t(e,t).replace(/<\/?(?:cmd|path)>/g,``)),kc=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Ac=e=>e.replace(/(?:Action|Observation)$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).trim(),jc=e=>{let t=Cc(e.summary||``);return t&&!kc(t)?t:Cc(e.tool_name)||Ac(e.action.kind)},Mc=(e,t)=>t?jc(t):Cc(e.tool_name)||Ac(e.observation.kind),Nc=e=>e.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
|
|
23
|
+
`);if(n.length===0)return{additions:r.length,deletions:0};if(r.length===0)return{additions:0,deletions:n.length};let i=0,a=0,o=0,s=0;for(;o<n.length||s<r.length;){let e=n[o],t=r[s];if(o<n.length&&s<r.length&&e===t){o+=1,s+=1;continue}if(s<r.length&&(o>=n.length||!n.slice(o).includes(t))){i+=1,s+=1;continue}o<n.length&&(a+=1,o+=1)}return{additions:i,deletions:a}}function $o(e){return typeof e.diff==`string`&&e.diff.length>0?Zo(e.diff):Qo(e.original??``,e.modified??``)}function es(e){return e.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0})}function ts(){let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),{data:r,isLoading:i,isSuccess:a,isError:o}=Xo(),s=t?.conversation_url,c=t?.session_api_key,l=(0,X.useMemo)(()=>Pi(t?.selected_repository,t?.workspace?.working_dir?.trim()),[t?.selected_repository,t?.workspace?.working_dir]),u=g({queries:(0,X.useMemo)(()=>(r??[]).filter(e=>e.status!==`D`),[r]).map(t=>({queryKey:[`conversation_overview_file_diff`,e,s,c,l,t.path],queryFn:async()=>Yo.getGitChangeDiff(e,s,c,`${l}/${t.path}`),enabled:n&&!!e&&a&&!!t.path,staleTime:1e3*60*5,meta:{disableToast:!0}}))}),d=u.some(e=>e.isLoading),f=es(u.flatMap(e=>e.data?[$o(e.data)]:[]));return{additions:f.additions,deletions:f.deletions,changeCount:r?.length??0,isLoading:i||d,isError:o}}var ns=(0,X.createContext)(null);function rs({children:e}){let[t,n]=(0,X.useState)(null),[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(0),s=(0,X.useCallback)((e,t)=>{n(e),i(!!t?.openAdd),o(0)},[]),c=(0,X.useCallback)(()=>{n(null),i(!1),o(0)},[]),l=(0,X.useCallback)(()=>{o(e=>e+1)},[]),u=(0,X.useMemo)(()=>({section:t,openAdd:r,addRequestKey:a,openSection:s,closeDrawer:c,requestAdd:l}),[a,c,r,s,l,t]);return(0,Z.jsx)(ns.Provider,{value:u,children:e})}function is(){let e=(0,X.useContext)(ns);if(!e)throw Error(`useConversationOverviewDrawer must be used within ConversationOverviewDrawerProvider`);return e}function as(){return(0,X.useContext)(ns)}var os=e(r(),1),ss=`!w-auto whitespace-nowrap`;function cs({anchorRef:e,onClose:t,gitProvider:n,testIdPrefix:r=`conversation-git-actions`}){let{t:i}=b(`openhands`),a=Rn(t),o=U(e=>e.setMessageToSend),[s,c]=(0,X.useState)();return(0,X.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let n=()=>{let e=t.getBoundingClientRect();c({position:`fixed`,top:e.bottom+4,right:window.innerWidth-e.right,zIndex:50})};return n(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]),s?os.createPortal((0,Z.jsxs)(Mt,{ref:a,testId:`${r}-menu`,theme:`popover`,style:s,className:`w-max min-w-[8rem]`,children:[(0,Z.jsx)(V,{testId:`${r}-commit`,onClick:()=>{o(ce()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0}),text:i(N.DIFF_VIEWER$COMMITS)})}),(0,Z.jsx)(V,{testId:`${r}-pull`,onClick:()=>{o(re()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Er,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PULL)})}),(0,Z.jsx)(V,{testId:`${r}-push`,onClick:()=>{o(ie(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(hr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$PUSH)})}),(0,Z.jsx)(V,{testId:`${r}-create-pr`,onClick:()=>{o(me(n)),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(Kr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_PR)})}),(0,Z.jsx)(V,{testId:`${r}-create-new-branch`,onClick:()=>{o(de()),t()},className:ss,children:(0,Z.jsx)(mr,{icon:(0,Z.jsx)(dr,{width:16,height:16,"aria-hidden":!0}),text:i(N.COMMON$CREATE_NEW_BRANCH)})})]}),document.body):null}var ls=R(`flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer border-0 bg-transparent text-left`),us=`size-4 shrink-0 text-[var(--oh-muted)]`,ds=`conversation-overview-diffs-git-action`,fs=R(ds,`absolute inset-0 inline-flex items-center justify-center`,`rounded-md text-[var(--oh-muted)] transition-opacity`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),ps=R(`flex items-center rounded-md transition-colors`,`hover:bg-white/5`,`has-[.${ds}:hover]:bg-transparent`),ms=R(`pointer-events-none invisible opacity-0`,`group-hover/diffstats:pointer-events-auto group-hover/diffstats:visible group-hover/diffstats:opacity-100`,`group-focus-within/diffstats:pointer-events-auto group-focus-within/diffstats:visible group-focus-within/diffstats:opacity-100`);function hs(){let{t:e}=b(`openhands`),{navigateToChanges:t}=mi(),n=as(),{data:r}=Y(),{additions:i,deletions:a,isLoading:o}=ts(),s=r?.git_provider??`github`,[c,l]=(0,X.useState)(!1),u=(0,X.useRef)(null);return(0,X.useEffect)(()=>{if(!c)return;let e=e=>{e.key===`Escape`&&l(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,Z.jsxs)(`li`,{className:ps,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-diffs`,"aria-label":e(N.CONVERSATION$OVERVIEW_OPEN_CHANGES),onClick:()=>{n?.closeDrawer(),t()},className:ls,children:[(0,Z.jsx)(dt,{className:us,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.COMMON$CHANGES)})]}),(0,Z.jsx)(`div`,{className:`group/diffstats relative mr-2 flex h-6 min-w-6 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{className:R(`flex items-center gap-1.5 text-sm tabular-nums transition-opacity`,c?`opacity-0`:`group-hover/diffstats:opacity-0 group-focus-within/diffstats:opacity-0`),children:[(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-additions`,style:{color:M},children:e(N.CONVERSATION$OVERVIEW_DIFF_ADDITIONS,{count:i.toLocaleString()})}),(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-diffs-deletions`,style:{color:ne},children:e(N.CONVERSATION$OVERVIEW_DIFF_DELETIONS,{count:a.toLocaleString()})})]}),(0,Z.jsx)(`button`,{ref:u,type:`button`,"data-testid":`conversation-overview-diffs-git-action`,"aria-label":e(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),"aria-expanded":c,"aria-haspopup":`menu`,onClick:e=>{e.stopPropagation(),l(e=>!e)},className:R(fs,!c&&ms,c&&`pointer-events-auto visible opacity-100 text-[var(--oh-foreground)]`),children:(0,Z.jsx)(lt,{className:`size-4`,"aria-hidden":!0})}),c?(0,Z.jsx)(cs,{anchorRef:u,gitProvider:s,testIdPrefix:`conversation-overview-diffs-git`,onClose:()=>l(!1)}):null]})})]})}var gs=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:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),_s=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`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})}),Q={automations:`automations`,skills:`skills`,mcp:`mcp`,secrets:`secrets`,pull_requests:`pull_requests`,issues:`issues`},vs={[W.workspace]:{section:W.workspace,icon:pt,i18nKey:N.CONVERSATION$OVERVIEW_WORKSPACE}},ys=[{part:H.changes,icon:dt,i18nKey:N.COMMON$CHANGES,opensChanges:!0},{part:H.repository,icon:Xe,i18nKey:N.CONVERSATION$REPOSITORY},{part:H.branch,icon:at,i18nKey:N.CONVERSATION$BRANCH},{part:H.commits,icon:lt,i18nKey:N.DIFF_VIEWER$COMMITS,opensCommits:!0},{part:H.pull_requests,icon:Kr,i18nKey:N.CONVERSATION$OVERVIEW_PULL_REQUESTS,drawerSection:Q.pull_requests}];function bs({testId:e,pinned:t,pinnedLabel:n,unpinnedLabel:r,onClick:i}){return(0,Z.jsx)(`button`,{type:`button`,"data-testid":e,className:R(`flex shrink-0 cursor-pointer items-center justify-center rounded-r px-2 text-white`,Zt,`hover:bg-white/10`),"aria-pressed":t,"aria-label":t?n:r,onClick:i,children:(0,Z.jsx)(`span`,{className:R(`ml-auto overflow-hidden`,Qt),"aria-hidden":!0,children:t?(0,Z.jsx)(_s,{className:`size-4`,width:16,height:16}):(0,Z.jsx)(gs,{className:`size-4`,width:16,height:16})})})}function xs({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)(),{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedOverviewSections:u,setUnpinnedOverviewGitParts:d}=sn(c),{navigateToChanges:f,navigateToCommits:p}=mi(),m=as();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let h=e=>{if(e.opensChanges){m?.closeDrawer(),f(),t();return}if(e.opensCommits){m?.closeDrawer(),p(),t();return}e.drawerSection&&(m?.openSection(e.drawerSection),t())},g=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewSections??[];if(n.includes(e)){u?.(n.filter(t=>t!==e));return}u?.([...n,e])},_=(e,t)=>{t.preventDefault(),t.stopPropagation();let n=l.unpinnedOverviewGitParts??[];if(n.includes(e)){d?.(n.filter(t=>t!==e));return}d?.([...n,e])};if(!e)return null;let v=!!(r?.current&&a),y=fn(W.git,l.unpinnedOverviewSections??[]),x=s(N.CONVERSATION$UNPIN_OVERVIEW_SECTION),S=s(N.CONVERSATION$PIN_OVERVIEW_SECTION),C=({key:e,testIdOpen:t,testIdPin:n,icon:r,label:i,pinned:a,isActionable:o,indent:s=!1,onOpen:c,onPinToggle:l})=>{let u=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(r,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:i})]});return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded hover:bg-[var(--oh-interactive-hover)]`,s&&`pl-4`),children:[o?(0,Z.jsx)(`button`,{type:`button`,"data-testid":t,className:R(`flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-l p-2 text-start text-white`,Zt),onClick:c,children:u}):(0,Z.jsx)(`div`,{"data-testid":t,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt),children:u}),(0,Z.jsx)(bs,{testId:n,pinned:a,pinnedLabel:x,unpinnedLabel:S,onClick:l})]})},e)},w=e=>{if(e===W.git)return null;let t=vs[e];return C({key:e,testIdOpen:`conversation-overview-menu-open-${e}`,testIdPin:`conversation-overview-menu-pin-${e}`,icon:t.icon,label:s(t.i18nKey),pinned:fn(e,l.unpinnedOverviewSections??[]),isActionable:!1,onPinToggle:t=>g(e,t)})},T=(0,Z.jsxs)(Mt,{ref:i,testId:`conversation-overview-context-menu`,theme:v?`popover`:`default`,position:v?`none`:`bottom`,alignment:v?`none`:`right`,spacing:v?`none`:`default`,className:R(`z-[9999] w-fit`,v?`mt-0`:`mt-2`),children:[cn.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-${t}`,inset:`menu`}):null,e.sections.map(e=>w(e))]},e.sections.join(`-`))),(0,Z.jsx)(rn,{testId:`conversation-overview-menu-divider-git`,inset:`menu`}),C({key:W.git,testIdOpen:`conversation-overview-menu-open-${W.git}`,testIdPin:`conversation-overview-menu-pin-${W.git}`,icon:at,label:s(N.CONVERSATION$OVERVIEW_GIT),pinned:y,isActionable:!1,onPinToggle:e=>g(W.git,e)}),ys.map(e=>C({key:e.part,testIdOpen:`conversation-overview-menu-open-git-${e.part}`,testIdPin:`conversation-overview-menu-pin-git-${e.part}`,icon:e.icon,label:s(e.i18nKey),pinned:ln(e.part,l.unpinnedOverviewGitParts??[]),isActionable:!!(e.drawerSection||e.opensCommits||e.opensChanges),indent:!0,onOpen:()=>h(e),onPinToggle:t=>_(e.part,t)}))]});return v&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:T}),document.body):T}var Ss={github:[`GITHUB_TOKEN`,`GH_TOKEN`,`github`],gitlab:[`GITLAB_TOKEN`,`GL_TOKEN`,`gitlab`],bitbucket:[`BITBUCKET_TOKEN`,`bitbucket`],forgejo:[`FORGEJO_TOKEN`,`forgejo`]},Cs=30;async function ws(e){if(ve().backend.kind!==`local`)return null;let t=Ss[e]??[];if(t.length===0)return null;let n=await rr.getSecrets(),r=new Set(n.map(e=>e.name)),i=t.find(e=>r.has(e));if(!i)return null;try{return await new Nt(B()).getSecret(i)}catch{return null}}function Ts(e,t,n){let r=z(t);switch(t){case`gitlab`:return`${r}/${n}/-/issues/${e}`;case`bitbucket`:return`${r}/${n}/issues/${e}`;case`forgejo`:return`${r}/${n}/issues/${e}`;default:return`${r}/${n}/issues/${e}`}}function Es(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/issues`;case`bitbucket`:return`${n}/${t}/issues`;case`forgejo`:return`${n}/${t}/issues`;default:return`${n}/${t}/issues`}}function Ds(e,t){let n=z(e);switch(e){case`gitlab`:return`${n}/${t}/-/merge_requests`;case`bitbucket`:return`${n}/${t}/pull-requests`;case`forgejo`:return`${n}/${t}/pulls`;default:return`${n}/${t}/pulls`}}async function Os(e,t){let n={Accept:`application/vnd.github+json`,"X-GitHub-Api-Version":`2022-11-28`};t&&(n.Authorization=`Bearer ${t}`);let r=await fetch(`https://api.github.com${e}`,{headers:n});if(!r.ok)throw Error(`GitHub API ${r.status}`);return r.json()}async function ks(e,t){let n={Accept:`application/json`};t&&(n[`PRIVATE-TOKEN`]=t);let r=await fetch(`https://gitlab.com/api/v4${e}`,{headers:n});if(!r.ok)throw Error(`GitLab API ${r.status}`);return r.json()}var As=class{static constructIssuesListUrl=Es;static constructPullRequestsListUrl=Ds;static async listPullRequests(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/merge_requests?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/pulls?state=open&per_page=${Cs}`,n)).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||pe(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}static async listIssues(e,t){let n=await ws(t);if(t===`gitlab`)return(await ks(`/projects/${encodeURIComponent(e)}/issues?state=opened&per_page=${Cs}`,n)).map(e=>({id:e.id,number:e.iid,title:e.title,url:e.web_url,authorLogin:e.author?.username??null,updatedAt:e.updated_at??null}));if(t!==`github`&&t!==`forgejo`)return[];let[r,i]=e.split(`/`);return!r||!i?[]:(await Os(`/repos/${r}/${i}/issues?state=open&per_page=${Cs}`,n)).filter(e=>!e.pull_request).map(n=>({id:n.id,number:n.number,title:n.title,url:n.html_url||Ts(n.number,t,e),authorLogin:n.user?.login??null,updatedAt:n.updated_at??null}))}};function js(e,t){return _({queryKey:[`repository-pull-requests`,t,e],queryFn:()=>As.listPullRequests(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}function Ms(e,t){return _({queryKey:[`repository-issues`,t,e],queryFn:()=>As.listIssues(e,t),enabled:!!(e&&t),staleTime:6e4,meta:{disableToast:!0}})}var Ns=()=>{let{conversationId:e}=J(),{data:t}=Y(),n=Ni(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),s=X.useMemo(()=>Pi(a,o),[a,o]),c=_({queryKey:[`git_commits`,e,r,i,s],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return Yo.getGitCommits(r,i,s,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:c.data?.commits??[],hasMore:c.data?.hasMore??!1,isUnsupported:c.data===null,isLoading:c.isLoading,isFetching:c.isFetching,isSuccess:c.isSuccess,isError:c.isError}},Ps=`size-4 shrink-0 text-[var(--oh-muted)]`,Fs=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`),Is=`-`;function Ls(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{state:n}=sn(t),{navigateToCommits:r}=mi(),i=as(),{data:a}=Bt(),{repository:o,provider:s,branch:c,isConnected:l}=Go(),u=ln(H.repository,n.unpinnedOverviewGitParts??[]),d=ln(H.branch,n.unpinnedOverviewGitParts??[]),f=ln(H.commits,n.unpinnedOverviewGitParts??[]),p=ln(H.pull_requests,n.unpinnedOverviewGitParts??[]),m=js(p?o:null,p?s:null),h=Ns();if(!l||!o||!s||!u&&!d&&!f&&!p)return null;let g=a?.provider_tokens_set?.[s]??null,_=oe(s,o,g),v=c?ue(s,o,c,g):null,y=m.data?.length??null,x=h.isUnsupported?null:h.commits.length,S=x!==null&&x>0?h.hasMore?`${x}+`:String(x):Is,C=()=>{i?.openSection(Q.pull_requests)},w=()=>{i?.closeDrawer(),r()},T=u||d,E=f||p;return(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-section`,children:[T?(0,Z.jsxs)(`div`,{className:`px-2 pb-1`,children:[u?(0,Z.jsxs)(`a`,{href:_,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-repo`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(tn,{gitProvider:s,className:Ps}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:o}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):null,d?c&&v?(0,Z.jsxs)(`a`,{href:v,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-git-branch`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Bn,{size:14,className:`shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:c}),(0,Z.jsx)(it,{className:Fs,"aria-hidden":!0})]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-branch`,className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,Z.jsx)(at,{className:`size-3.5 shrink-0 text-[var(--oh-muted)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:R(`text-sm`,c?`text-[var(--oh-foreground)]`:`text-[var(--oh-muted)]`),children:c||e(N.CONVERSATION$OVERVIEW_NONE)})]}):null]}):null,E?(0,Z.jsxs)(`ul`,{className:`px-2`,children:[f?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-commits`,onClick:w,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(lt,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.DIFF_VIEWER$COMMITS)}),h.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-commits-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:S})]})}):null,p?(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-overview-pull-requests`,onClick:C,className:R(`flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5`,`cursor-pointer bg-transparent text-left transition-colors hover:bg-white/5`),children:[(0,Z.jsx)(Kr,{className:Ps,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:e(N.CONVERSATION$OVERVIEW_PULL_REQUESTS)}),m.isLoading?(0,Z.jsx)(`span`,{className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:`…`}):(0,Z.jsx)(`span`,{"data-testid":`conversation-overview-pull-requests-count`,className:`text-sm tabular-nums text-[var(--oh-muted)]`,children:y!==null&&y>0?y:Is})]})}):null]}):null]})}var Rs=R(`w-full max-w-[240px] rounded-xl border border-[var(--oh-border)]`,`bg-[var(--oh-surface)] pb-1`),zs=R(`flex items-center gap-2 rounded-md px-2 py-1.5`,`transition-colors hover:bg-white/5`),Bs=`size-4 shrink-0 text-[var(--oh-muted)]`;function Vs({icon:e,label:t,value:n,testId:r}){return(0,Z.jsxs)(`li`,{"data-testid":r,className:zs,children:[e,(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t}),(0,Z.jsx)(`span`,{className:`max-w-[45%] shrink-0 truncate text-right text-sm text-[var(--oh-muted)]`,children:n})]})}function Hs(){return(0,Z.jsx)(`div`,{className:`px-1`,children:(0,Z.jsx)(rn,{inset:`menu`})})}function Us(){let{t:e}=b(`openhands`),t=Wo(),{conversationId:n}=J(),{state:r}=sn(n),{isConnected:i}=Go(),[a,o]=(0,X.useState)(!1),s=(0,X.useRef)(null),c=e=>fn(e,r.unpinnedOverviewSections??[]),l=ln(H.changes,r.unpinnedOverviewGitParts??[]),u=c(W.git)&&(l||i),d=cn.flatMap(e=>e.sections.filter(e=>c(e))),f=[];u&&f.push({kind:`git`,key:`git`}),d.length>0&&f.push({kind:`sections`,key:d.join(`-`),sections:d});let p=n=>{switch(n){case W.workspace:return(0,Z.jsx)(Vs,{testId:`conversation-overview-workspace`,icon:(0,Z.jsx)(pt,{className:Bs}),label:e(N.CONVERSATION$OVERVIEW_WORKSPACE),value:t.workspaceName??e(N.CONVERSATION$OVERVIEW_NONE)},n);case W.git:return null;default:return n}};return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-panel`,"aria-label":e(N.CONVERSATION$OVERVIEW),className:Rs,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-0.5 pt-2.5`,children:[(0,Z.jsx)(`span`,{className:`text-xs font-medium text-[var(--oh-muted)]`,children:e(N.CONVERSATION$OVERVIEW)}),(0,Z.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:s,testId:`conversation-overview-ellipsis`,onClick:()=>o(e=>!e),ariaLabel:e(N.COMMON$MORE_OPTIONS)}),(0,Z.jsx)(xs,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:s,anchorRef:s})]})]}),f.map((e,t)=>(0,Z.jsxs)(X.Fragment,{children:[t>0?(0,Z.jsx)(Hs,{}):null,e.kind===`git`?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-git-block`,children:[l?(0,Z.jsx)(`ul`,{className:`px-2`,children:(0,Z.jsx)(hs,{})}):null,i?(0,Z.jsx)(Ls,{}):null]}):(0,Z.jsx)(`ul`,{className:`px-2`,children:e.sections.map(e=>p(e))})]},e.key))]})}var Ws={duration:.2,ease:`easeInOut`};function Gs(e){return e>=596}var Ks=typeof window<`u`?X.useLayoutEffect:X.useEffect;function qs(e,t){let[n,r]=(0,X.useState)(!1);return Ks(()=>{if(!t){r(!1);return}let n=e.current;if(!n)return;let i=()=>{r(Gs(n.clientWidth))};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(n),()=>a.disconnect()},[e,t]),n}var Js=`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0`;function Ys({isRightPanelShown:e}){let t=Ii(),n=!De()&&!0,r=U(e=>e.isOverviewPanelShown),a=(0,X.useRef)(null),o=!t&&r,s=qs(a,o);return(0,Z.jsxs)(`div`,{ref:a,className:`flex h-full min-h-0 w-full overflow-hidden`,children:[(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 justify-center overflow-hidden`,children:(0,Z.jsx)(`div`,{className:Js,children:(0,Z.jsx)(Ho,{})})}),(0,Z.jsx)(i,{children:o&&s?(0,Z.jsx)(Qe.div,{"data-testid":`conversation-overview-column`,initial:n?{width:0,opacity:0}:!1,animate:{width:268,opacity:1},exit:n?{width:0,opacity:0}:{opacity:0},transition:Ws,className:`flex shrink-0 flex-col items-start overflow-hidden pt-4 pl-3 pr-4`,children:(0,Z.jsx)(`div`,{className:`w-full shrink-0`,style:{width:268},children:(0,Z.jsx)(Us,{})})},`conversation-overview-column`):null})]})}function Xs({children:e}){return(0,Z.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Zs({children:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Qs({children:e}){return(0,Z.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function $s({className:e}){let{t}=b(`openhands`);return(0,Z.jsxs)(`div`,{className:R(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,Z.jsx)(vt,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,Z.jsx)(Ve,{as:`p`,role:`status`,"aria-live":`polite`,className:`block w-full text-center text-base font-normal leading-5`,duration:1,spread:2,children:t(N.HOME$LOADING)})]})}function ec({children:e,onReady:t}){return(0,X.useLayoutEffect)(()=>{t()},[t]),e}function tc({onPending:e}){return(0,X.useLayoutEffect)(()=>{e()},[e]),(0,Z.jsx)($s,{})}var nc={duration:.35,ease:`easeInOut`};function rc({showAgentLoading:e,tabKey:t,children:n}){let r=De(),[a,o]=(0,X.useState)(!1);(0,X.useLayoutEffect)(()=>{o(!1)},[t]);let s=(0,X.useCallback)(()=>{o(!0)},[]),c=(0,X.useCallback)(()=>{o(!1)},[]),l=e||a;return r?(0,Z.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:l?(0,Z.jsx)($s,{}):(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}):(0,Z.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,Z.jsx)(Qe.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!l},transition:nc,"aria-hidden":l,children:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(tc,{onPending:s}),children:(0,Z.jsx)(ec,{onReady:c,children:n})})}),(0,Z.jsx)(i,{children:l?(0,Z.jsx)(Qe.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:nc,children:(0,Z.jsx)($s,{})},`conversation-tab-loading-overlay`):null})]})}var ic=(0,X.lazy)(()=>a(()=>import(`./files-tab-BNDp3e_x.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73]))),ac=(0,X.lazy)(()=>a(()=>import(`./commits-tab-B5SUF66c.js`),__vite__mapDeps([74,1,2,75,7,5,76,6,20,77,8,9,4,10,11,12,13,14,3,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70,125]))),oc=(0,X.lazy)(()=>a(()=>import(`./browser-tab-DFyZXsnB.js`),__vite__mapDeps([126,2,1,18,9,4,6,5,10,11,12,13,14,3,15,7,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,127,128,70]))),sc=(0,X.lazy)(()=>a(()=>import(`./planner-tab-yISBVUKu.js`),__vite__mapDeps([129,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,130,78,79,80,81,64,82,63,65,83,84,85,86,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,100,101,102,103,59,104,105,106,107,108,109,110,111,61,68,69,112,113,114,115,116,117,118,119,120,121,122,73,123,124,70]))),cc=(0,X.lazy)(()=>a(()=>import(`./task-list-tab-CQisRcPh.js`),__vite__mapDeps([131,1,2,8,9,4,6,5,10,11,12,13,14,3,15,7,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,70]))),lc=(0,X.lazy)(()=>a(()=>import(`./usage-tab-ClVHAFJy.js`),__vite__mapDeps([132,1,2,9,4,6,5,10,11,12,13,79,7,99,18,14,3,15,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,133,44,105,78,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,56,100,101,102,42,43,103,59,104,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),uc=(0,X.lazy)(()=>a(()=>import(`./terminal-Bs50gJPC.js`),__vite__mapDeps([134,1,2,135,136,76,6,5,20,18,9,4,10,11,12,13,14,3,15,7,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,17,36,37,38,39,40,41,78,79,80,81,64,82,63,65,83,84,85,57,86,48,49,50,87,88,89,90,91,92,93,62,94,66,67,95,96,97,98,99,56,100,101,102,42,43,103,59,44,104,105,106,107,108,109,110,111,46,61,47,68,69,112,113,114,115,55,116,117,118,119,120,121,122,73,123,53,124,58,70]))),dc={tasklist:{component:cc},files:{component:ic},commits:{component:ac},browser:{component:oc},terminal:{component:uc},planner:{component:sc},usage:{component:lc}};function fc(){let{selectedTab:e,shouldShownAgentLoading:t}=U(),{conversationId:n}=J(),r=(0,X.useMemo)(()=>dc[e]??dc.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,Z.jsx)(Zs,{children:(0,Z.jsx)(Qs,{children:(0,Z.jsx)(rc,{showAgentLoading:t,tabKey:i,children:(0,Z.jsx)(Xs,{children:(0,Z.jsx)(r,{})},i)})})})}var pc=()=>{let e=d(),t=Qr(e=>e.removeErrorMessage);return h({mutationKey:[`start-conversation`],mutationFn:async e=>wn(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{xn(e,r.conversationId)},onSuccess:(n,r)=>{t(),On(e,r.conversationId,k.RUNNING)}})},mc=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:`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM10 9H14A1 1 0 0 1 15 10V14A1 1 0 0 1 14 15H10A1 1 0 0 1 9 14V10A1 1 0 0 1 10 9Z`,fill:`currentColor`})}),hc=e=>(0,Z.jsxs)(`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:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function gc({icon:e,text:t,onClick:n,testId:r}){return(0,Z.jsx)(V,{testId:r,onClick:n,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:e})]})})}function _c({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=Yr(),{isTask:i,taskStatus:a,taskDetail:o}=vr(),{t:s}=b(`openhands`),{errorMessage:c}=Qr(),l=r===L.LOADING||r===L.INIT,u=ee(t)||A(t),d=le({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=ae({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,Z.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(Ro,{className:`w-6 h-6 shrink-0`,color:d}),(0,Z.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function vc({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1,ignoreOutsideClickRef:s}){let{t:c}=b(`openhands`),l=Rn(e,s),u=he(r),d=A(r),f=u||d;return(0,Z.jsxs)(Mt,{ref:l,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:R(`left-2 w-fit min-w-42`,a),children:[(0,Z.jsx)(_c,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rn,{inset:`menu`}),u&&t&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(mc,{width:18,height:18}),text:c(N.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),d&&n&&(0,Z.jsx)(gc,{icon:(0,Z.jsx)(hc,{width:18,height:18}),text:c(N.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}function yc({isPublic:e,onToggle:t,ariaLabel:n}){return(0,Z.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,Z.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:R(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,Z.jsx)(`span`,{className:R(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function bc({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onExportTranscript:u,onDownloadConversation:d,shareUrl:f,position:p=`bottom`,anchorRef:m}){let h=Ii(),{t:g}=b(`openhands`),{backend:_}=T(),{data:v}=Y(),y=Ar(),x=Rn(e,m),S=m?.current??null,[C,w]=X.useState();X.useLayoutEffect(()=>{if(!S)return;let e=()=>{let e=S.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};p===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,w(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[S,p]);let E=!!(a||o||s),D=!!i,O=!!(r||n),k=_.kind===`cloud`?N.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:N.COMMON$STOP_CONVERSATION,A=_.kind===`cloud`&&!!c,j=v?.public||!1,M=!!S,P=(0,Z.jsxs)(Mt,{ref:x,testId:`conversation-name-context-menu`,position:p,alignment:`left`,className:R(h?`right-0 translate-x-[34%] left-auto`:``,M?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,Z.jsx)(V,{testId:`rename-button`,onClick:t,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Un,{width:16,height:16}),text:g(N.BUTTON$RENAME)})}),E&&(0,Z.jsx)(rn,{testId:`separator-tools`,inset:`menu`}),o&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-skills-button`,onClick:o,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Wn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-hooks-button`,onClick:s,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Sr,{width:16,height:16,"aria-hidden":!0}),text:g(N.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`show-agent-tools-button`,onClick:a,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(nn,{width:16,height:16}),text:g(N.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,Z.jsx)(V,{testId:`export-transcript-button`,onClick:u,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$EXPORT_TRANSCRIPT)})}),d&&(0,Z.jsx)(V,{testId:`download-trajectory-button`,onClick:d,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Fn,{width:16,height:16}),text:g(N.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(D||O)&&(0,Z.jsx)(rn,{testId:`separator-info-control`,inset:`menu`}),i&&(0,Z.jsx)(V,{testId:`display-cost-button`,onClick:i,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(ot,{size:16}),text:g(N.BUTTON$DISPLAY_COST)})}),A&&c&&(0,Z.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,Z.jsx)(ut,{size:16})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:g(N.CONVERSATION$SHARE_PUBLICLY)}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[j&&f&&l&&(0,Z.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$COPY_TO_CLIPBOARD),children:(0,Z.jsx)(Qn,{width:14,height:14})}),(0,Z.jsx)(`a`,{"data-testid":`open-share-link-button`,href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:g(N.BUTTON$OPEN_IN_NEW_TAB),children:(0,Z.jsx)(it,{size:14,"aria-hidden":!0})})]}),(0,Z.jsx)(yc,{isPublic:j,onToggle:c,ariaLabel:g(N.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,Z.jsx)(Gr,{isDisabled:y,children:(0,Z.jsx)(V,{testId:`stop-button`,onClick:r,isDisabled:y,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)($t,{width:16,height:16}),text:g(k)})})}),n&&(0,Z.jsx)(V,{testId:`delete-button`,onClick:n,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Vn,{width:16,height:16}),text:g(N.COMMON$DELETE_CONVERSATION)})})]});return M?typeof document>`u`||!C?null:os.createPortal((0,Z.jsx)(`div`,{style:C,children:P}),document.body):P}var xc=new Set([`BrowserClickAction`,`BrowserCloseTabAction`,`BrowserGetContentAction`,`BrowserGetStateAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserNavigateAction`,`BrowserScrollAction`,`BrowserSwitchTabAction`,`BrowserTypeAction`,`ExecuteBashAction`,`FileEditorAction`,`GlobAction`,`GrepAction`,`InvokeSkillAction`,`MCPToolAction`,`StrReplaceEditorAction`,`TaskAction`,`TaskTrackerAction`,`TerminalAction`,`ThinkAction`]),Sc=new Set([`BrowserObservation`,`CanvasUIObservation`,`ExecuteBashObservation`,`FileEditorObservation`,`GlobObservation`,`GrepObservation`,`InvokeSkillObservation`,`MCPToolObservation`,`StrReplaceEditorObservation`,`SwitchLLMObservation`,`TaskTrackerObservation`,`TaskObservation`,`TerminalObservation`]),Cc=e=>e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim(),wc=(e,t=100)=>e.length>t?`${e.slice(0,t)}…`:e,Tc=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()},$=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`).replaceAll(`'`,`'`),Ec=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replace(/(!?)\[([^\]]*)\]\(\s*((?:javascript|data|vbscript):[^)]*)\)/gi,`$1\\[$2\\]($3)`).replace(/^(\s{0,3})\[([^\]]+)\]:(\s*<?(?:javascript|data|vbscript):)/gim,`$1\\[$2\\]:$3`),Dc=e=>Cc(e||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE))||w.t(N.TRANSCRIPT_EXPORT$DEFAULT_TITLE),Oc=(e,t)=>Cc(w.t(e,t).replace(/<\/?(?:cmd|path)>/g,``)),kc=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Ac=e=>e.replace(/(?:Action|Observation)$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).trim(),jc=e=>{let t=Cc(e.summary||``);return t&&!kc(t)?t:Cc(e.tool_name)||Ac(e.action.kind)},Mc=(e,t)=>t?jc(t):Cc(e.tool_name)||Ac(e.observation.kind),Nc=e=>e.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
|
|
24
24
|
`),Pc=e=>[`${w.t(N.TASK$SUBAGENT)}: ${e.subagent_type}`,`${w.t(N.TASK$QUERY)}:\n${e.prompt}`].join(`
|
|
25
25
|
|
|
26
26
|
`),Fc=(e,t)=>{let n=t?.action.kind===`TaskAction`?t.action:void 0;return[`${w.t(N.TASK$SUBAGENT)}: ${e.subagent}`,`${w.t(N.TASK$TASK_ID)}: ${e.task_id}`,n?`${w.t(N.TASK$QUERY)}:\n${n.prompt}`:``,`${w.t(N.TASK$RESULT)}:\n${Nc(e.content)}`].filter(Boolean).join(`
|
|
@@ -90,4 +90,4 @@ This should be a client-only app with no backend. The list should persist in loc
|
|
|
90
90
|
</main>
|
|
91
91
|
</body>
|
|
92
92
|
</html>
|
|
93
|
-
`},qc=(e,t)=>(e.timestamp??``).localeCompare(t.timestamp??``),Jc=async(e,t,n)=>{let r=[],i=new Set,a=[],o=0,s=new Set,c,l,u=!1,d=!1;for(;;){let e=await t({limit:100,sortOrder:`TIMESTAMP_DESC`,strictPagination:!0,...l?{pageId:l}:{},...c?{timestampLt:c}:{}});if(!Array.isArray(e.items))throw Error(`Invalid transcript history response: expected page.items to be an array.`);r.push(...e.items);let a,f=!1;if(e.items.forEach(e=>{i.has(e.id??``)||(e.id?i.add(e.id):o+=1,f=!0),(!a||(e.timestamp??``)<a)&&(a=e.timestamp??``)}),e.next_page_id){if(s.has(e.next_page_id))throw Error(`Transcript history pagination repeated a page cursor.`);s.add(e.next_page_id),l=e.next_page_id,c=void 0,u=!0;continue}if(u&&!d||e.items.length<100)break;if(n===void 0)throw Error(`Transcript history pagination cannot prove that all events were loaded.`);if(!a||c&&(!f||a>=c))throw Error(`Transcript history pagination did not advance.`);l=void 0,c=a,d=!0}let f=new Map;r.slice().reverse().forEach(e=>{if(e.id!==void 0){f.has(e.id)||f.set(e.id,e);return}a.push(e)}),e.forEach(e=>{if(e.id!==void 0){f.has(e.id)||f.set(e.id,e);return}a.push(e)});let p=[...a,...f.values()].sort(qc);if(n!==void 0&&i.size+o<n)throw Error(`Transcript history is incomplete: expected ${n} persisted events, received ${i.size+o}.`);return p},Yc=`transcript-export-format`;function Xc({conversationId:e,conversationUrl:t,sessionApiKey:n,conversationTitle:r,model:i,onClose:a}){let{t:o}=b(`openhands`),{trackConversationExported:s}=Rt(),[c,l]=X.useState(`markdown`),[u,d]=X.useState(!0),[f,p]=X.useState(!0),[m,h]=X.useState(!1),g=X.useRef(!1),_=X.useRef(!1),v=X.useRef(!0);X.useEffect(()=>(v.current=!0,()=>{v.current=!1,_.current=!0}),[]);let y=()=>{g.current&&(_.current=!0),a()};return(0,Z.jsx)(Vt,{onClose:y,"aria-label":o(N.TRANSCRIPT_EXPORT$TITLE),children:(0,Z.jsxs)(Ht,{testID:`transcript-export-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,Z.jsx)(pn,{onClose:y,testId:`close-transcript-export-modal`,className:`absolute right-4 top-4`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Z.jsx)(Wt,{title:o(N.TRANSCRIPT_EXPORT$TITLE)}),(0,Z.jsx)(Ut,{description:o(N.TRANSCRIPT_EXPORT$DESCRIPTION)})]}),(0,Z.jsxs)(`fieldset`,{className:`flex w-full flex-col gap-2`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium text-white`,children:o(N.TRANSCRIPT_EXPORT$FORMAT)}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:Yc,value:`markdown`,disabled:m,checked:c===`markdown`,onChange:()=>l(`markdown`)}),o(N.TRANSCRIPT_EXPORT$MARKDOWN)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:Yc,value:`html`,disabled:m,checked:c===`html`,onChange:()=>l(`html`)}),o(N.TRANSCRIPT_EXPORT$HTML)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-sm text-white`,children:[(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:u,onChange:e=>d(e.target.checked)}),o(N.TRANSCRIPT_EXPORT$INCLUDE_TOOL_DETAILS)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:f,onChange:e=>p(e.target.checked)}),o(N.TRANSCRIPT_EXPORT$INCLUDE_TIMESTAMPS)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,onClick:y,testId:`cancel-transcript-export`,children:o(N.BUTTON$CANCEL)}),(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,onClick:async()=>{if(!g.current){_.current=!1,g.current=!0,h(!0);try{let o=await Ti.getEventCount(e,t??``,n).catch(()=>void 0);if(_.current)return;let l=K.getState(),d=await Jc(l.loadedConversationId===e?l.events:[],r=>Ti.searchEvents(e,t,n,r),o);if(_.current)return;let p={includeToolDetails:u,includeTimestamps:f,title:r,model:i},m=c===`markdown`,h=m?Wc(d,p):Kc(d,p),g=m?`md`:`html`;I(new Blob([h],{type:m?`text/markdown;charset=utf-8`:`text/html;charset=utf-8`}),`conversation-${e}.${g}`),s(c),a()}catch{_.current||D(o(N.ERROR$GENERIC))}finally{g.current=!1,v.current&&h(!1)}}},testId:`confirm-transcript-export`,isDisabled:m,"aria-busy":m,children:o(N.BUTTON$EXPORT_CONVERSATION)})]})]})})}function Zc(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{mutate:r}=Mn(),[i,a]=X.useState(`view`),[o,s]=X.useState(!1),[c,l]=X.useState(!1),u=X.useRef(null),d=X.useRef(null),{handleDelete:f,handleStop:p,handleDownloadConversation:m,handleDisplayCost:h,handleShowAgentTools:g,handleShowSkills:_,handleShowHooks:v,handleTogglePublic:y,handleCopyShareLink:x,shareUrl:C,handleConfirmDelete:w,handleConfirmStop:T,systemModalVisible:E,setSystemModalVisible:D,skillsModalVisible:O,setSkillsModalVisible:k,hooksModalVisible:A,setHooksModalVisible:j,confirmDeleteModalVisible:M,setConfirmDeleteModalVisible:P,confirmStopModalVisible:F,setConfirmStopModalVisible:ee,systemMessage:te,shouldShowStop:ne,shouldShowDownloadConversation:I,shouldShowDisplayCost:re,shouldShowAgentTools:ie,shouldShowSkills:ae,shouldShowHooks:oe}=Lr({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return X.useEffect(()=>{i===`edit`&&u.current?.focus()},[i]),n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 h-[22px] text-base font-normal text-left pl-0 lg:pl-1 min-w-0`,"data-testid":`conversation-name`,children:[i===`edit`?(0,Z.jsx)(`input`,{ref:u,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(u.current?.value&&t){let i=u.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{S(e(N.CONVERSATION$TITLE_UPDATED))}})}else u.current&&(u.current.value=n?.title??``);a(`view`)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:n.title||``,className:`text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content`}):(0,Z.jsx)(`div`,{className:`text-white leading-5 truncate`,"data-testid":`conversation-name-title`,onDoubleClick:()=>{a(`edit`)},title:n.title||``,children:n.title}),i!==`edit`&&(0,Z.jsxs)(`div`,{ref:d,className:`relative flex items-center shrink-0`,children:[(0,Z.jsx)(Hn,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)},ariaLabel:e(N.COMMON$MORE_OPTIONS)}),o&&(0,Z.jsx)(bc,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:f,onStop:ne?p:void 0,onDisplayCost:re?h:void 0,onShowAgentTools:ie?g:void 0,onShowSkills:ae?_:void 0,onShowHooks:oe?v:void 0,onTogglePublic:y,onCopyShareLink:x,shareUrl:C,onExportTranscript:e=>{e.preventDefault(),e.stopPropagation(),l(!0),s(!1)},onDownloadConversation:I?m:void 0,position:`bottom`,anchorRef:d})]})]}),c&&t&&(0,Z.jsx)(Xc,{conversationId:t,conversationUrl:n.conversation_url,sessionApiKey:n.session_api_key,conversationTitle:n.title,model:n.llm_model,onClose:()=>l(!1)}),(0,Z.jsx)(Pr,{isOpen:E,onClose:()=>D(!1),systemMessage:te||null}),O&&(0,Z.jsx)(Fr,{onClose:()=>k(!1)}),A&&(0,Z.jsx)(Br,{onClose:()=>j(!1)}),M&&(0,Z.jsx)(An,{onConfirm:w,onCancel:()=>P(!1),conversationTitle:n?.title||``}),F&&(0,Z.jsx)(Ln,{onConfirm:T,onCancel:()=>ee(!1)})]}):null}function Qc({children:e,tooltip:t,ariaLabel:n}){return(0,Z.jsx)(Xt,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,Z.jsx)(`span`,{"data-aria-label":n,children:e})})}var $c=R(`inline-flex h-7 min-h-7 w-fit shrink-0 cursor-pointer items-center justify-center gap-1.5 px-2.5`,`rounded-md text-xs font-normal leading-none`,Kt,Gt,`text-[var(--oh-muted)]`,qt,`disabled:cursor-not-allowed disabled:opacity-30`);function el({className:e}){let{t}=b(`openhands`),n=Ar(),{data:r}=Y(),[i,a]=(0,X.useState)(!1),o=(0,X.useRef)(null),s=r?.git_provider??`github`;(0,X.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let c=t(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),l=(0,Z.jsxs)(`button`,{ref:o,type:`button`,onClick:()=>{n||a(e=>!e)},disabled:n,className:R($c,i&&`bg-white/10 text-[var(--oh-foreground)]`,n&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-expanded":i,"aria-haspopup":`menu`,"aria-disabled":n,"data-testid":`conversation-git-actions-toggle`,children:[(0,Z.jsx)(lt,{className:`size-4 shrink-0`,size:16,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`whitespace-nowrap`,children:c})]});return(0,Z.jsxs)(`div`,{className:`relative inline-flex items-center self-center`,children:[n?(0,Z.jsx)(Qc,{tooltip:t(N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES),ariaLabel:t(N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES),children:l}):l,i?(0,Z.jsx)(cs,{anchorRef:o,gitProvider:s,onClose:()=>a(!1)}):null]})}var tl=null;function nl(){tl!==null&&(clearTimeout(tl),tl=null)}function rl(){let{isRightPanelShown:e,isOverviewPanelShown:t,setIsOverviewPanelPeeked:n}=U.getState();!e||t||(nl(),n(!0))}function il(){nl(),tl=setTimeout(()=>{tl=null,U.getState().setIsOverviewPanelPeeked(!1)},150)}function al(){nl(),U.getState().setIsOverviewPanelPeeked(!1)}function ol(){let e=U(e=>e.isRightPanelShown),t=U(e=>e.isOverviewPanelShown),n=U(e=>e.isOverviewPanelPeeked);(0,X.useEffect)(()=>{n&&(!e||t)&&al()},[n,t,e])}function sl({className:e}){let{t}=b(`openhands`),n=Ar(),{conversationId:r}=Si(),i=(0,X.useRef)(null),[a,o]=(0,X.useState)(null),{isOverviewPanelShown:s,isOverviewPanelPeeked:c,isRightPanelShown:l,setIsOverviewPanelShown:u,setHasRightPanelToggled:d,setIsRightPanelShown:f}=U();ol(),(0,X.useEffect)(()=>{l&&s&&u(!1)},[s,l,u]);let p=!n&&l&&!s,m=p&&c;(0,X.useLayoutEffect)(()=>{if(!m){o(null);return}let e=()=>{let e=i.current?.getBoundingClientRect();e&&o({top:e.bottom+4,left:Math.max(8,e.right-240)})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[m]);let h=()=>{if(!n){if(l){d(!1),f(!1),r&&dn(r,{rightPanelShown:!1}),u(!0);return}u(!s)}},g=s||m,_=t(n?N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:s?N.CONVERSATION$HIDE_OVERVIEW:N.CONVERSATION$SHOW_OVERVIEW),v=m&&a?os.createPortal((0,Z.jsx)(`div`,{"data-testid":`conversation-overview-peek`,className:`fixed z-50`,style:{top:a.top,left:a.left,width:240},onMouseEnter:rl,onMouseLeave:il,children:(0,Z.jsx)(`div`,{className:`shadow-lg`,children:(0,Z.jsx)(Us,{})})}),document.body):null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:i,className:`relative inline-flex items-center self-center`,onMouseEnter:()=>{p&&rl()},onMouseLeave:()=>{(p||c)&&il()},children:(0,Z.jsx)(Qc,{tooltip:_,ariaLabel:_,children:(0,Z.jsx)(`button`,{type:`button`,onClick:h,disabled:n,className:R(Pn,`size-7`,g&&`bg-white/10 text-[var(--oh-foreground)]`,n&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":_,"aria-pressed":s,"aria-disabled":n,"data-testid":`conversation-overview-toggle`,children:(0,Z.jsx)(gt,{className:`h-4 w-4 shrink-0`,size:16,"aria-hidden":!0})})})}),v]})}function cl({className:e}){let{t}=b(`openhands`),n=Ii(),r=Ar(),i=l(),{conversationId:a}=J(),{isRightPanelShown:o,setHasRightPanelToggled:s,setIsRightPanelShown:c,setSelectedTab:u}=U(),d=()=>{if(r)return;if(n){if(!a)return;s(!0),c(!0),dn(a,{rightPanelShown:!0});let{selectedTab:e}=U.getState();e||u(`files`),i(`/conversations/${a}/panel`);return}let e=!o;if(s(e),c(e),a&&dn(a,{rightPanelShown:e}),e){let{selectedTab:e}=U.getState();e||u(`files`)}},f=t(r?N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:n?N.COMMON$SHOW_PANEL:o?N.COMMON$HIDE_PANEL:N.COMMON$SHOW_PANEL),p=n?!1:o;return(0,Z.jsx)(Qc,{tooltip:f,ariaLabel:f,children:(0,Z.jsx)(`button`,{type:`button`,onClick:d,disabled:r,className:R(Pn,`size-7 self-center`,r&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":f,"aria-pressed":p,"aria-disabled":r,"data-testid":`right-panel-toggle`,children:(0,Z.jsx)(Nn,{className:`size-5 -scale-x-100`})})})}function ll(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{curAgentState:r}=Yr(),{isTask:i,taskStatus:a}=vr(),{mutate:o}=en(),{mutate:s}=pc(),{providers:c}=qn(),[l,u]=X.useState(!1),[d,f]=X.useState(!1),p=X.useRef(null),m=n?.execution_status??null,h=le({isPausing:!1,isTask:i,taskStatus:a,isStartingStatus:r===L.LOADING||r===L.INIT,isStopStatus:ee(m),curAgentState:r}),g=l||d,_=()=>{u(!1),f(!1)};return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`relative shrink-0`,onPointerEnter:e=>{e.pointerType===`mouse`&&f(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&f(!1)},children:[(0,Z.jsx)(`button`,{ref:p,type:`button`,"data-testid":`server-status-menu-trigger`,"aria-label":e(N.COMMON$SERVER_STATUS),"aria-expanded":g,"aria-haspopup":`menu`,onClick:e=>{if(e.preventDefault(),e.stopPropagation(),g){_();return}u(!0)},className:R(`flex items-center justify-center rounded-md`,`text-[var(--oh-muted)] hover:bg-white/10`),children:(0,Z.jsx)(Ro,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:h,"aria-hidden":!0})}),g?(0,Z.jsx)(vc,{onClose:_,ignoreOutsideClickRef:p,onStopServer:he(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&o({conversationId:t}),_()}:void 0,onStartServer:A(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&s({conversationId:t,providers:c}),_()}:void 0,executionStatus:m,position:`bottom`,className:`bottom-full left-0 mt-0 min-h-fit`,isPausing:!1}):null]}),(0,Z.jsx)(Zc,{})]}),(0,Z.jsxs)(`div`,{className:`mr-2 flex shrink-0 items-center gap-1`,children:[(0,Z.jsx)(el,{}),(0,Z.jsx)(sl,{}),(0,Z.jsx)(cl,{})]})]})}var ul=e=>(0,Z.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,Z.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Z.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]}),dl=160,fl={duration:.22,ease:[.4,0,.2,1]};function pl({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o,suppressLayoutAnimation:s=!1}){let c=De(),l=o||c||!1,u=!l&&!s,d=R(`flex items-center rounded-md cursor-pointer`,`pl-1.5 pr-2 py-1 lg:py-1.5`,`text-[var(--oh-muted)] bg-transparent`,r&&`bg-[var(--oh-interactive-active)] text-white`,r?`hover:text-white hover:bg-[var(--oh-interactive-hover)]`:`hover:text-white hover:bg-white/5`,r?`focus-within:text-white`:`focus-within:text-[var(--oh-muted)]`,a),f=(0,Z.jsx)(t,{className:R(`h-4 w-4 shrink-0 text-inherit`)}),p=i&&r?(0,Z.jsx)(`span`,{className:`whitespace-nowrap text-sm font-normal`,children:i}):null,m=i?(0,Z.jsx)(Qe.span,{initial:!1,animate:{maxWidth:r?dl:0,opacity:+!!r,marginLeft:r?8:0},transition:fl,className:`block overflow-hidden whitespace-nowrap text-sm font-normal`,"aria-hidden":!r,children:i}):null;return l?(0,Z.jsxs)(`button`,{type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:R(d,`gap-2`),children:[f,p]}):(0,Z.jsxs)(Qe.button,{layout:u?`position`:!1,type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:d,transition:u?{layout:fl}:void 0,children:[f,m]})}var ml=e=>(0,Z.jsx)(`svg`,{viewBox:`0 0 128 128`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,Z.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M90.767 127.126a7.968 7.968 0 0 0 6.35-.244l26.353-12.681a8 8 0 0 0 4.53-7.209V21.009a8 8 0 0 0-4.53-7.21L97.117 1.12a7.97 7.97 0 0 0-9.093 1.548l-50.45 46.026L15.6 32.013a5.328 5.328 0 0 0-6.807.302l-7.048 6.411a5.335 5.335 0 0 0-.006 7.888L20.796 64 1.74 81.387a5.336 5.336 0 0 0 .006 7.887l7.048 6.411a5.327 5.327 0 0 0 6.807.303l21.974-16.68 50.45 46.025a7.96 7.96 0 0 0 2.743 1.793Zm5.252-92.183L57.74 64l38.28 29.058V34.943Z`})});function hl(){let e=ve().backend;if(e.kind!==`cloud`)throw Error(`Cloud sandboxes call requires a cloud backend.`);return e}async function gl(e){if(e.length===0)return[];let t=hl(),n=new URLSearchParams;for(let t of e)n.append(`id`,t);return await Pt({backend:t,method:`GET`,path:`/api/v1/sandboxes?${n.toString()}`})??[]}var _l=e=>{let t=T(),n=t.backend.kind===`cloud`;return _({queryKey:[`cloud`,`sandbox`,t.backend.id,t.orgId,e],queryFn:async()=>{if(!e)return null;let[t]=await gl([e]);return t??null},enabled:n&&!!e,staleTime:1e3*60*5,gcTime:1e3*60*15})},vl=`__AGENT_CANVAS_VSCODE_BASE_PATH__`;function yl(){if(typeof window<`u`){let e=window[vl];if(typeof e==`string`&&e.trim())return bl(e.trim())}return null}function bl(e){let t=e.startsWith(`/`)?e:`/${e}`;return t.length>1?t.replace(/\/+$/,``):t}function xl(e,t){if(!e||!t)return!1;let n;try{n=new URL(e,typeof window<`u`?window.location.href:void 0)}catch{return!1}return typeof window<`u`&&n.origin!==window.location.origin?!1:n.pathname===t||n.pathname.startsWith(`${t}/`)}var Sl=`VSCODE`,Cl=()=>{let{t:e}=b(`openhands`),{conversationId:t}=J(),n=Ni({allowAgentError:!0}),{data:r}=Y(),i=T(),a=r?.conversation_url??null,o=r?.session_api_key??null,s=r?.sandbox_id??null,c=i.backend.kind===`cloud`,l=yl(),u=l!==null,d=_l(c?s:null),f=_({queryKey:[`unified`,`vscode_status`,`local`,t,a,o],queryFn:()=>yn.getVSCodeStatus(a,o),enabled:!c&&u&&n&&!!t,refetchOnMount:!0}),p=f.data?.enabled===!0&&f.data?.running===!0,m=_({queryKey:[`unified`,`vscode_url`,`local`,t,a,o],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return{url:kn((await yn.getVSCodeUrl(t,a,o).catch(()=>Tn.getVSCodeUrl(t))).vscode_url)}},enabled:!c&&u&&n&&!!t&&p,refetchOnMount:!0,retry:3}),h,g,v,y,x,S,C,w;if(c){let e=d.data?.exposed_urls?.find(e=>e.name===Sl)?.url??null;h=d.isSuccess?{url:kn(e)}:void 0,g=d.isLoading,v=d.isError,y=d.isSuccess,x=d.status,S=d.error,C=async()=>{let e=await d.refetch(),t=e.data?.exposed_urls?.find(e=>e.name===Sl)?.url??null;return{data:e.data?{url:kn(t)}:void 0}},w=!1}else h=m.data,g=f.isLoading||m.isLoading,v=f.isError||m.isError,y=m.isSuccess,x=m.status,S=f.error??m.error,C=async()=>({data:(await m.refetch()).data}),w=!u||f.isSuccess&&!p||y&&!m.data?.url||y&&!xl(m.data?.url,l);let E=h&&!h.url?e(N.VSCODE$URL_NOT_AVAILABLE):null;return{data:h?{...h,error:E}:void 0,error:S,isLoading:g,isError:v,isSuccess:y,isUnavailable:w,status:x,refetch:C}};function wl(){let{t:e}=b(`openhands`),{curAgentState:t}=Yr(),{data:n,refetch:r,isLoading:i,isUnavailable:a}=Cl(),o=se.includes(t);return a?null:(0,Z.jsxs)(`button`,{type:`button`,onClick:async()=>{let e=n?.url;e||=(await r()).data?.url??null,e&&window.open(e,`_blank`,`noopener,noreferrer`)},disabled:i||o,"aria-label":e(N.VSCODE$OPEN),title:e(N.VSCODE$OPEN),"data-testid":`drawer-vscode-link`,className:R(`inline-flex items-center gap-1.5 rounded-[7px] border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs`,`text-[var(--oh-muted)] transition-colors hover:enabled:bg-surface-raised hover:enabled:text-white`,`cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,Z.jsx)(ml,{className:`h-[15px] w-[15px] shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:e(N.FILES$VSCODE)}),(0,Z.jsx)(it,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})]})}function Tl(e){if(fi(e)&&e.observation.kind===`TaskTrackerObservation`){let t=e.observation;if(t.command===`plan`)return t.task_list.map((e,t)=>({id:String(t+1),title:e.title,status:e.status,notes:e.notes||void 0}))}return null}function El(){let e=K(e=>e.events);return(0,X.useMemo)(()=>{for(let t=e.length-1;t>=0;--t){let n=Tl(e[t]);if(n)return{taskList:n,hasTaskList:n.length>0}}return{taskList:[],hasTaskList:!1}},[e])}function Dl({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,left:e.left})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedTabs:u,setSelectedTab:d}=sn(c),{selectedTab:f,isRightPanelShown:p,setSelectedTab:m}=U(),{navigateToTab:h}=mi(),{hasTaskList:g}=El(),_=Ar(),v=[{tab:`planner`,icon:_t,i18nKey:N.COMMON$PLANNER},{tab:`files`,icon:qr,i18nKey:N.COMMON$FILES},{tab:`commits`,icon:dt,i18nKey:N.DIFF_VIEWER$COMMITS},{tab:`terminal`,icon:ct,i18nKey:N.COMMON$TERMINAL},{tab:`browser`,icon:mt,i18nKey:N.COMMON$BROWSER},{tab:`usage`,icon:ot,i18nKey:N.COMMON$USAGE}];g&&v.unshift({tab:`tasklist`,icon:ul,i18nKey:N.COMMON$TASK_LIST});let y=e=>{_||(h(e),t())},x=(e,t)=>{if(_){t.preventDefault(),t.stopPropagation();return}if(t.preventDefault(),t.stopPropagation(),l.unpinnedTabs.includes(e))u(l.unpinnedTabs.filter(t=>t!==e));else{let t=[...l.unpinnedTabs,e];if(u(t),f===e&&p){let n=v.find(({tab:n})=>n!==e&&!t.includes(n));n&&(m(n.tab),d(n.tab))}}};if(!e)return null;let S=!!(r?.current&&a),C=(0,Z.jsx)(Mt,{ref:i,theme:S?`popover`:`default`,position:S?`none`:`bottom`,alignment:S?`none`:`left`,spacing:S?`none`:`default`,className:R(`z-[9999] w-fit`,S?`mt-0`:`mt-2`),children:v.map(({tab:e,icon:t,i18nKey:n})=>{let r=!l.unpinnedTabs.includes(e);return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsx)(Gr,{isDisabled:_,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded`,!_&&`hover:bg-[var(--oh-interactive-hover)]`,_&&`opacity-50`),children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,disabled:_,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt,_?`cursor-not-allowed`:`cursor-pointer`),onClick:()=>y(e),children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(t,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:s(n)})]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,disabled:_,className:R(`flex shrink-0 items-center justify-center rounded-r px-2 text-white`,Zt,_?`cursor-not-allowed`:`cursor-pointer hover:bg-white/10`),"aria-pressed":r,"aria-label":s(r?N.CONVERSATION$UNPIN_TAB:N.CONVERSATION$PIN_TAB),onClick:t=>x(e,t),children:r?(0,Z.jsx)(`span`,{className:R(`-mr-[5px] ml-auto`,Qt),"aria-hidden":!0,children:(0,Z.jsx)(_s,{className:`h-7 w-7`})}):(0,Z.jsx)(`span`,{className:R(`ml-auto`,Qt),"aria-hidden":!0,children:(0,Z.jsx)(gs,{className:`h-4.5 w-4.5`})})})]})})},e)})});return S&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:C}),document.body):C}function Ol({variant:e=`default`,isPanelResizing:t=!1}){let{conversationId:n}=J(),{setSelectedTab:r,planContent:i}=U(),[a,o]=(0,X.useState)(!1),{state:s}=sn(n),{hasTaskList:c}=El(),{backend:l}=T(),{handleBuildPlanClick:u}=ze(),{curAgentState:d}=Yr(),{isPlanningAgentRunning:f}=gi(),{selectTab:p,isTabActive:m,onTabChange:h,selectedTab:g,isRightPanelShown:_}=mi();(0,X.useEffect)(()=>{r(s.selectedTab)},[r,s.selectedTab]),(0,X.useEffect)(()=>{_&&(g||h(`files`))},[_,g,h]);let{t:v,i18n:y}=b(`openhands`),x=[{tabValue:`files`,isActive:m(`files`),icon:qr,onClick:()=>p(`files`),tooltipContent:v(N.COMMON$FILES),tooltipAriaLabel:v(N.COMMON$FILES),label:v(N.COMMON$FILES)},{tabValue:`commits`,isActive:m(`commits`),icon:dt,onClick:()=>p(`commits`),tooltipContent:v(N.DIFF_VIEWER$COMMITS),tooltipAriaLabel:v(N.DIFF_VIEWER$COMMITS),label:v(N.DIFF_VIEWER$COMMITS)},{tabValue:`planner`,isActive:m(`planner`),icon:_t,onClick:()=>p(`planner`),tooltipContent:v(N.COMMON$PLANNER),tooltipAriaLabel:v(N.COMMON$PLANNER),label:v(N.COMMON$PLANNER)},{tabValue:`terminal`,isActive:m(`terminal`),icon:ct,onClick:()=>p(`terminal`),tooltipContent:v(N.COMMON$TERMINAL),tooltipAriaLabel:v(N.COMMON$TERMINAL),label:v(N.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:m(`browser`),icon:mt,onClick:()=>p(`browser`),tooltipContent:v(N.COMMON$BROWSER),tooltipAriaLabel:v(N.COMMON$BROWSER),label:v(N.COMMON$BROWSER)},{tabValue:`usage`,isActive:m(`usage`),icon:ot,onClick:()=>p(`usage`),tooltipContent:v(N.COMMON$USAGE),tooltipAriaLabel:v(N.COMMON$USAGE),label:v(N.COMMON$USAGE)}];c&&x.splice(2,0,{tabValue:`tasklist`,isActive:m(`tasklist`),icon:ul,onClick:()=>p(`tasklist`),tooltipContent:v(N.COMMON$TASK_LIST),tooltipAriaLabel:v(N.COMMON$TASK_LIST),label:v(N.COMMON$TASK_LIST)});let S=x.filter(e=>s.unpinnedTabs.includes(e.tabValue)?g===e.tabValue:!0),C=s.unpinnedTabs.join(`,`),w=d===L.RUNNING||d===L.LOADING||f||!i,E=(0,X.useRef)(null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=(0,X.useRef)(null),A=(0,X.useRef)(null),[j,M]=(0,X.useState)(S.length);(0,X.useLayoutEffect)(()=>{let e=E.current,t=D.current,n=O.current,r=k.current;if(!e||!t||!n||!r)return;let i=()=>{let i=t.querySelectorAll(`[data-tab-measure="true"]`),a=i.length,o=e.getBoundingClientRect().width;if(o===0){M(a);return}let s=Array.from(i).map(e=>e.getBoundingClientRect().width);if(s.length!==a||a===0){M(Math.max(0,a));return}let c=n.getBoundingClientRect().width,l=r.getBoundingClientRect().width,u=getComputedStyle(e).columnGap||getComputedStyle(e).gap,d=parseFloat(u)||6,f=0;for(let e=a;e>=0;--e){let t=c+l;for(let n=0;n<e;n+=1)t+=s[n]??0;if(e>0&&(t+=e*d),t<=o+.5){f=e;break}}M(e=>e===f?e:f)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(e),a.observe(r),()=>a.disconnect()},[C,S.length,c,l.kind,g,_,y.language]);let P=Math.min(j,S.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:R(`relative w-full min-w-0`,e===`compact`?`flex h-full min-h-0 items-center py-0 pl-0 pr-1`:`min-h-10 p-1`),children:[(0,Z.jsx)(`div`,{ref:D,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:S.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,Z.jsx)(Qc,{tooltip:r,ariaLabel:i,children:(0,Z.jsx)(pl,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:R(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,Z.jsxs)(`div`,{ref:E,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-start overflow-hidden`,children:(0,Z.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(ft,{id:`conversation-drawer-tabs`,children:(0,Z.jsx)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:S.slice(0,P).map(({tabValue:e,icon:n,onClick:r,isActive:i,tooltipContent:a,tooltipAriaLabel:o,label:s,className:c},l)=>(0,Z.jsx)(Qc,{tooltip:a,ariaLabel:o,children:(0,Z.jsx)(pl,{tabValue:e,icon:n,onClick:r,isActive:i,label:s,className:R(c,`shrink-0`),suppressLayoutAnimation:t})},`${e}-${l}`))})}),(0,Z.jsxs)(`div`,{ref:O,className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:A,onClick:()=>o(!a),ariaLabel:v(N.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?jn:void 0}),(0,Z.jsx)(Dl,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:A,anchorRef:A})]})]})}),(0,Z.jsx)(`div`,{ref:k,className:`ml-auto shrink-0 pr-1`,children:(0,Z.jsx)(wl,{})})]})]}),m(`planner`)&&(0,Z.jsx)(`div`,{className:R(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,Z.jsx)(`button`,{type:`button`,onClick:u,disabled:w,className:R(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,w?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,Z.jsxs)($n.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[v(N.COMMON$BUILD),` ⌘↩`]})})})]})}function kl({onMouseDown:e,className:t,isDragging:n=!1,testId:r}){let[i,a]=(0,X.useState)(!1),o=n||i;return(0,Z.jsxs)(`div`,{"data-testid":r,className:R(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,Z.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-3 min-w-[12px] -translate-x-1/2 cursor-ew-resize`,onMouseDown:e,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)}),(0,Z.jsx)(`div`,{className:R(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`,o?`bg-white`:`bg-transparent`),"aria-hidden":!0})]})}var Al=200;function jl({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=st(r,e),o=(0,X.useCallback)(e=>Math.max(t,Math.min(n,e)),[t,n]),[s,c]=(0,X.useState)(()=>o(i)),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(null),f=(0,X.useCallback)(e=>{e.preventDefault(),u(!0)},[]),p=(0,X.useCallback)(e=>{if(!l||!d.current)return;let t=d.current.getBoundingClientRect();c(o((e.clientX-t.left)/t.width*100))},[l,o]),m=(0,X.useCallback)(()=>{l&&(u(!1),a(s))},[l,s,a]);return(0,X.useLayoutEffect)(()=>{if(!l)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(Al),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,m),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,m),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[l,p,m]),{leftWidth:s,rightWidth:100-s,isDragging:l,containerRef:d,handleMouseDown:f}}var Ml=200;function Nl({containerRef:e,defaultWidth:t,minWidth:n,maxWidth:r,storageKey:i,enabled:a=!0,edge:o=`right`}){let[s,c]=st(i,t),l=(0,X.useCallback)(e=>Math.max(n,Math.min(r,e)),[n,r]),[u,d]=(0,X.useState)(()=>l(s)),[f,p]=(0,X.useState)(!1),m=(0,X.useRef)(u);m.current=u;let h=(0,X.useCallback)(e=>{a&&(e.preventDefault(),p(!0))},[a]),g=(0,X.useCallback)(t=>{if(!f||!e.current)return;let n=e.current.getBoundingClientRect();d(l(o===`left`?t.clientX-n.left:n.right-t.clientX))},[l,e,o,f]),_=(0,X.useCallback)(()=>{f&&(p(!1),c(m.current))},[f,c]);return(0,X.useLayoutEffect)(()=>{if(!f)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(Ml),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[g,_,f]),{drawerWidth:u,isDragging:f,handleMouseDown:h}}var Pl=()=>void 0;function Fl({openAdd:e}){let{t}=b(`openhands`),[n,r]=(0,X.useState)(e),{data:i,isLoading:a,refetch:o}=Yn(),{data:s,isLoading:c,isError:l,refetch:u}=Xn({limit:50,offset:0,enabled:i?.status===`ok`});(0,X.useEffect)(()=>{e&&r(!0)},[e]);let d;return d=a||i?.status===`ok`&&c?(0,Z.jsx)(et,{}):i?.status===`ok`?l?(0,Z.jsx)(Ri,{onRetry:u}):s?.automations.length?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nt,{title:t(N.CONVERSATION_PANEL$AUTOMATIONS),count:s.automations.length,automations:s.automations,view:`list`,onToggle:Pl,onRunNow:Pl,onDelete:Pl,onExport:Pl}),(0,Z.jsx)(tt,{isOpen:n,onClose:()=>r(!1)})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{}),(0,Z.jsx)(tt,{isOpen:n,onClose:()=>r(!1)})]}):(0,Z.jsx)(Li,{onRetry:o}),(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-automations-panel`,children:d})}var Il={project:`project`,all:`all`};function Ll(e,t){return Ai(e,t)===`project`}function Rl(e,t,n){return t===Il.all?e:e.filter(e=>Ll(e,n))}function zl(e,t){return[...e].sort((e,n)=>{let r=Ai(e,t),i=Ai(n,t),a=ji.indexOf(r),o=ji.indexOf(i);return a===o?e.name.localeCompare(n.name):a-o})}function Bl({value:e,onChange:t,testId:n}){let{t:r}=b(`openhands`);return(0,Z.jsx)(`div`,{className:`flex w-full justify-center [&>[role=radiogroup]]:w-full`,children:(0,Z.jsx)(ht,{value:e,onChange:t,ariaLabel:r(N.CONVERSATION$OVERVIEW_SCOPE_FILTER),testId:n,options:[{value:Il.project,label:r(N.CONVERSATION$OVERVIEW_SCOPE_PROJECT)},{value:Il.all,label:r(N.CONVERSATION$OVERVIEW_SCOPE_ALL)}]})})}function Vl({openAdd:e}){let{t}=b(`openhands`),{isLoading:n}=Bt(),{data:r}=Y(),{data:i,isLoading:a}=_r(),{isEnabled:o,setEnabled:s}=ki(),c=as()?.addRequestKey??0,l=r?.selected_workspace??null,[u,d]=(0,X.useState)(Il.project),[f,p]=(0,X.useState)(kt),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(!1);(0,X.useEffect)(()=>{e&&y(!0)},[e]),(0,X.useEffect)(()=>{c!==0&&y(!0)},[c]);let x=(0,X.useMemo)(()=>{if(!i)return[];let e=Rl(i,u,l);return u===Il.all?zl(e,l):e},[i,u,l]),S=(0,X.useMemo)(()=>Et(x,o,f),[x,o,f]);return a||n?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`text-sm text-muted`,children:`…`}):!i||i.length===0?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-empty`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.SETTINGS$SKILLS_NO_SKILLS)})}),v?(0,Z.jsx)(St,{onClose:()=>y(!1)}):null]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(Bl,{value:u,onChange:d,testId:`conversation-overview-skills-scope`}),(0,Z.jsx)(xt,{search:f.query,onSearchChange:e=>p(t=>({...t,query:e})),activeFilterCount:yt(f),onOpenFilters:()=>h(!0)}),x.length===0?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-project-empty`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.CONVERSATION$OVERVIEW_SCOPE_PROJECT_EMPTY_SKILLS)})}):S.length===0?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-no-match`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.SETTINGS$SKILLS_NO_MATCH)})}):(0,Z.jsx)(`section`,{className:R(`flex min-w-0 flex-col gap-3`,er),children:(0,Z.jsx)(`div`,{className:R(nr,`grid-cols-1`),children:S.map(e=>(0,Z.jsx)(Tt,{skill:e,enabled:o(e),onOpen:()=>_(e),onToggle:t=>s(e.name,t)},e.name))})}),g?(0,Z.jsx)(Dt,{skill:g,enabled:o(g),onToggle:e=>s(g.name,e),onClose:()=>_(null)}):null,v?(0,Z.jsx)(St,{onClose:()=>y(!1)}):null,m?(0,Z.jsx)(wt,{groups:Ot(x,o,f),activeCount:yt(f),onToggle:(e,t)=>p(n=>bt(n,e,t)),onClearAll:()=>p(e=>Ct(e)),onClose:()=>h(!1)}):null]})}function Hl({openAdd:e}){let{t}=b(`openhands`),{data:n,isLoading:r}=Bt(),{mutate:i,isPending:a}=Hi(),{mutate:o}=zi(),s=as()?.addRequestKey??0,[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(`all`);(0,X.useEffect)(()=>{e&&d({id:``,type:`sse`})},[e]),(0,X.useEffect)(()=>{s!==0&&d({id:``,type:`sse`})},[s]);let v=ar(zt(n?.agent_settings?.mcp_config)),y=sr(lr),x=v.filter(e=>or(e,cr(e,y),m));return r||!n?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-mcp-panel`,className:`text-sm text-muted`,children:`…`}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-mcp-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(Wi,{search:m,onSearchChange:h,sectionFilter:g,onSectionFilterChange:_}),g===`library`?null:(0,Z.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(N.MCP$INSTALLED_TITLE)}),(0,Z.jsx)(Bi,{servers:x,hasAnyInstalled:v.length>0,query:m,onEdit:d,onToggleEnabled:(e,t)=>{o({serverId:e.id,server:{...e,enabled:t}})}})]}),g===`installed`?null:(0,Z.jsx)(Ui,{onSelect:l,onAdd:l,query:m}),c?(0,Z.jsx)(Gn,{entry:c,existingServers:v,onClose:()=>l(null)}):null,u?(0,Z.jsx)(Vi,{server:u,existingServers:v,onClose:()=>d(null)}):null,f?(0,Z.jsx)(mn,{text:t(N.SETTINGS$MCP_CONFIRM_DELETE),onCancel:()=>p(null),onConfirm:()=>{f&&i(f,{onSuccess:()=>{S(t(N.MCP$REMOVE_SUCCESS)),p(null)},onError:e=>{D(C(e)||t(N.ERROR$GENERIC)),p(null)}})},isConfirming:a}):null]})}function Ul({openAdd:e}){let t=d(),{t:n}=b(`openhands`),r=as()?.addRequestKey??0,{data:i,isLoading:a}=ir(),{mutate:o,isPending:s}=Gi(),[c,l]=(0,X.useState)(`list`),[u,f]=(0,X.useState)(null);(0,X.useEffect)(()=>{e&&l(`add-secret-form`)},[e]),(0,X.useEffect)(()=>{r!==0&&l(`add-secret-form`)},[r]);let p=()=>{t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]})};return c===`add-secret-form`?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-secrets-add-form`,className:`flex h-full min-h-0 flex-col overflow-y-auto p-4`,children:(0,Z.jsx)(Ki,{mode:`add`,selectedSecret:null,onCancel:()=>l(`list`)})}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-secrets-panel`,className:`flex h-full min-h-0 flex-col`,children:[(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:a?(0,Z.jsx)(`p`,{className:`px-2 py-4 text-sm text-[var(--oh-muted)]`,children:n(N.HOME$LOADING)}):i&&i.length>0?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i.map(e=>(0,Z.jsxs)(`li`,{"data-testid":`conversation-overview-secret-item`,className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-white/5`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-sm text-[var(--oh-foreground)]`,children:e.name}),e.description?(0,Z.jsx)(`p`,{className:`truncate text-xs text-[var(--oh-muted)]`,children:e.description}):null]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-overview-secret-delete-${e.name}`,"aria-label":n(N.BUTTON$DELETE),onClick:()=>f(e.name),className:R(`shrink-0 rounded-md p-1 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),children:(0,Z.jsx)(jt,{className:`size-3.5`,"aria-hidden":!0})})]},e.name))}):(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-secrets-empty`,className:R(tr,`px-2 py-6 text-center text-sm`),children:n(N.SECRETS$EMPTY)})}),u?(0,Z.jsx)(mn,{text:n(N.SECRETS$CONFIRM_DELETE_KEY),isConfirming:s,onCancel:()=>f(null),onConfirm:()=>{o(u,{onSettled:()=>f(null),onSuccess:p,onError:p})}}):null]})}var Wl=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`);function Gl(e){let{repository:t,provider:n}=Go();return!t||!n?null:e===Q.pull_requests?As.constructPullRequestsListUrl(n,t):As.constructIssuesListUrl(n,t)}function Kl({kind:e}){let{t}=b(`openhands`),{provider:n}=Go(),r=Gl(e);return!r||!n?null:(0,Z.jsxs)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-${e}-open-external`,className:R(`inline-flex h-7 min-h-7 shrink-0 items-center gap-1.5 whitespace-nowrap`,`px-1 text-xs text-[var(--oh-muted)] transition-colors`,`hover:text-[var(--oh-foreground)]`),children:[t(N.CONVERSATION$OVERVIEW_VIEW_ON_PROVIDER,{provider:fe(n)}),(0,Z.jsx)(it,{className:`size-3.5`,"aria-hidden":!0})]})}function ql({kind:e}){let{t}=b(`openhands`),{repository:n,provider:r,isConnected:i}=Go(),a=js(n,r),o=Ms(n,r),s=e===Q.pull_requests?a:o;return!i||!n||!r?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-git-items-unavailable`,className:R(tr,`px-4 py-6 text-center text-sm`),children:t(N.CONVERSATION$OVERVIEW_GIT_UNAVAILABLE)}):(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-${e}-panel`,className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:s.isLoading?(0,Z.jsx)(`p`,{className:`px-2 py-4 text-sm text-[var(--oh-muted)]`,children:t(N.HOME$LOADING)}):s.isError?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-${e}-error`,className:R(tr,`px-2 py-6 text-center text-sm`),children:t(N.CONVERSATION$OVERVIEW_GIT_ITEMS_ERROR)}):s.data&&s.data.length>0?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:s.data.map(t=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-${e}-item-${t.number}`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-2`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsxs)(`span`,{className:`shrink-0 text-sm tabular-nums text-[var(--oh-muted)]`,children:[`#`,t.number]}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t.title}),(0,Z.jsx)(it,{className:Wl,"aria-hidden":!0})]})},t.id))}):(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-${e}-empty`,className:R(tr,`px-2 py-6 text-center text-sm`),children:e===Q.pull_requests?t(N.CONVERSATION$OVERVIEW_PULL_REQUESTS_EMPTY):t(N.CONVERSATION$OVERVIEW_ISSUES_EMPTY)})})}var Jl=R(`flex h-10 min-h-10 shrink-0 items-center gap-1.5`,`border-b border-[var(--oh-border)] py-1 pl-1 pr-4`),Yl=R(`h-7 min-h-7 shrink-0 whitespace-nowrap px-2.5 text-xs`),Xl=R(`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-muted transition-colors hover:bg-white/10 hover:text-white`);function Zl(e){switch(e){case Q.automations:return N.CONVERSATION_PANEL$AUTOMATIONS;case Q.skills:return N.SETTINGS$NAV_SKILLS;case Q.mcp:return N.CONVERSATION$OVERVIEW_MCP;case Q.secrets:return N.SETTINGS$NAV_SECRETS;case Q.pull_requests:return N.CONVERSATION$OVERVIEW_PULL_REQUESTS;case Q.issues:return N.CONVERSATION$OVERVIEW_ISSUES;default:return e}}function Ql({section:e}){let{t}=b(`openhands`),{requestAdd:n}=is();switch(e){case Q.automations:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-automations-add`,className:Yl,onClick:n,children:t(N.AUTOMATIONS$ADD_AUTOMATION)});case Q.skills:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-skills-add-skill-button`,className:Yl,onClick:n,children:t(N.SETTINGS$SKILLS_ADD_BUTTON)});case Q.mcp:return(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,testId:`conversation-overview-mcp-add-server`,className:Yl,onClick:n,children:t(N.MCP$ADD_CUSTOM)});case Q.secrets:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-secrets-add-button`,className:Yl,onClick:n,children:t(N.SECRETS$ADD_NEW_SECRET)});case Q.pull_requests:return(0,Z.jsx)(Kl,{kind:`pull_requests`});case Q.issues:return(0,Z.jsx)(Kl,{kind:`issues`});default:return null}}function $l({section:e,openAdd:t}){switch(e){case Q.automations:return(0,Z.jsx)(Fl,{openAdd:t});case Q.skills:return(0,Z.jsx)(Vl,{openAdd:t});case Q.mcp:return(0,Z.jsx)(Hl,{openAdd:t});case Q.secrets:return(0,Z.jsx)(Ul,{openAdd:t});case Q.pull_requests:return(0,Z.jsx)(ql,{kind:`pull_requests`});case Q.issues:return(0,Z.jsx)(ql,{kind:`issues`});default:return e}}function eu({className:e}){let{t}=b(`openhands`),{section:n,openAdd:r,closeDrawer:i}=is(),{workspaceName:a}=Wo();if((0,X.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&i()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[i,n]),!n)return null;let o=n===Q.pull_requests||n===Q.issues||n===Q.secrets;return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-drawer-content`,"aria-label":t(Zl(n)),className:R(`flex h-full w-full min-h-0 flex-col overflow-hidden bg-base-secondary`,e),children:[(0,Z.jsxs)(`header`,{className:Jl,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-overview-drawer-close`,"aria-label":t(N.BUTTON$CLOSE),onClick:i,className:Xl,children:(0,Z.jsx)(ur,{className:`size-4`,"aria-hidden":!0})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Z.jsx)(`h2`,{className:`truncate text-sm font-medium text-content`,children:t(Zl(n))}),a?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-drawer-workspace`,className:`truncate text-xs text-muted`,children:a}):null]}),(0,Z.jsx)(`div`,{className:`shrink-0`,children:(0,Z.jsx)(Ql,{section:n})})]}),(0,Z.jsx)(`div`,{className:R(`min-h-0 flex-1 custom-scrollbar-always`,o?`flex flex-col overflow-hidden`:`overflow-y-auto px-4 py-4`),children:(0,Z.jsx)($l,{section:n,openAdd:r})})]})}var tu=`conversation-overview-drawer-width`,nu=`conversation-overview-drawer-resize-handle`,ru=`conversation-overview-drawer`;function iu(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function au({isMobile:e,resizeContainerRef:t}){let n=as(),r=!!n?.section,{drawerWidth:i,isDragging:a,handleMouseDown:o}=Nl({containerRef:t??{current:null},defaultWidth:420,minWidth:300,maxWidth:640,storageKey:tu,enabled:r&&!e&&t!=null});return n?e?r?(0,Z.jsx)(eu,{className:`max-h-[min(50vh,420px)] w-full border-t border-[var(--oh-border)]`}):null:(0,Z.jsxs)(Z.Fragment,{children:[r&&t?(0,Z.jsx)(`div`,{"data-testid":nu,children:(0,Z.jsx)(kl,{onMouseDown:o,isDragging:a})}):null,(0,Z.jsx)(`div`,{"data-testid":ru,"aria-hidden":!r,className:R(`shrink-0 overflow-hidden ease-in-out`,a?`transition-[transform,opacity] duration-300`:`transition-all duration-300`,iu(r)),style:{width:r?`${i}px`:`0px`,transitionProperty:a?`transform, opacity`:`width, transform, opacity`},children:(0,Z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden border-l border-[var(--oh-border)] bg-base-secondary`,style:{width:`${i}px`},children:r?(0,Z.jsx)(eu,{className:`h-full`}):null})})]}):null}function ou(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function su(){let e=Ii(),t=Ii(767),{isRightPanelShown:n}=U(),r=!!as()?.section,{leftWidth:i,rightWidth:a,isDragging:o,containerRef:s,handleMouseDown:c}=jl({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,Z.jsx)(`div`,{className:R(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,Z.jsxs)(`div`,{ref:s,className:R(`flex flex-1 overflow-hidden`,e?`flex-col`:`transition-all duration-300 ease-in-out`),style:e?void 0:{transitionProperty:o?`none`:`all`},children:[(0,Z.jsxs)(`div`,{className:R(`flex flex-col bg-base overflow-hidden`,e?`flex-1`:R(`min-w-0`,!r&&`transition-[width] duration-300 ease-in-out`)),style:e?void 0:{width:n?`${i}%`:`100%`,transitionProperty:o||r?`none`:`width`},children:[(0,Z.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:R(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,Z.jsx)(In,{}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(ll,{})})]}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(Ys,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,Z.jsx)(kl,{onMouseDown:c,isDragging:o}),!e&&(0,Z.jsx)(`div`,{className:R(`transition-all duration-300 ease-in-out overflow-hidden`,ou(n)),style:{width:n?`${a}%`:`0%`,transitionProperty:o?`opacity, transform`:`all`},children:(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 bg-[var(--oh-surface)] border-l border-[var(--oh-border)] overflow-hidden`,children:[(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,Z.jsx)(Ol,{isPanelResizing:o})}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(fc,{})})]})})}),(0,Z.jsx)(au,{isMobile:e,resizeContainerRef:s})]})})}function cu({onNavigateBack:e}){let{t}=b(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=U();return X.useLayoutEffect(()=>(n(!0),r(!0),U.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,Z.jsxs)(`div`,{"data-testid":`conversation-mobile-panel-top`,className:`flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-[var(--oh-border)] pl-2.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(N.COMMON$BACK),className:Pn,children:(0,Z.jsx)(Ze,{size:20,className:jn,"aria-hidden":!0,strokeWidth:2})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex h-full min-h-0 w-full min-w-0 flex-col justify-center`,children:(0,Z.jsx)(Ol,{variant:`compact`})})})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,Z.jsx)(fc,{})})]})}function lu({children:e,conversationId:t}){let{data:n}=Y(),{backend:r}=T(),i=r.kind!==`cloud`,a=U(e=>e.localPlanningConversationId),o=n?.id===t?a:null,s=X.useMemo(()=>i?n?.sub_conversation_ids&&n.sub_conversation_ids.length>0?n.sub_conversation_ids:o?[o]:[]:n?.sub_conversation_ids??[],[i,n?.sub_conversation_ids,o]),{data:c}=Cr(s),l=X.useMemo(()=>i?vn(c,n?.id):null,[i,c,n?.id]),u=X.useMemo(()=>i?l?[l]:o?[o]:[]:s,[i,s,l,o]),d=c?.filter(e=>e!==null&&u.includes(e.id));return(0,Z.jsx)(Ci,{conversationId:t,conversationUrl:n?.sandbox_status===`PAUSED`?null:n?.conversation_url,sessionApiKey:n?.session_api_key,subConversationIds:u,subConversations:d,children:e})}function uu(){let{t:e}=b(`openhands`),{conversationId:t}=J(),n=c(`/conversations/:conversationId/panel`),{isTask:r,taskStatus:i,taskDetail:a}=yr(),o=T(),u=X.useRef(o.backend.id),d=X.useRef(o.orgId),f=u.current!==o.backend.id||d.current!==o.orgId,{data:p,isFetched:m}=Y(),{data:h}=bn(),{resetConversationState:g}=U(),_=l(),v=s(),y=Ei(e=>e.clearTerminal),x=En(e=>e.reset),S=Ji(e=>e.setCurrentAgentState),C=Qr(e=>e.removeErrorMessage);X.useEffect(()=>{y(),g(),x(),S(L.LOADING),C()},[t,y,g,x,S,C]),X.useEffect(()=>{if(r&&i===`ERROR`){D(a||e(N.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=v.state?.resumedFromConversationId;_(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[r,i,a,e,_,v.state]),X.useEffect(()=>{!m||!h||f||p||(ea(o.backend.id,o.orgId),D(e(N.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),_(`/conversations`))},[p,m,h,_,e,f,o.backend.id,o.orgId]),X.useEffect(()=>{f||t&&(t.startsWith(`task-`)||$i(o.backend.id,o.orgId,t))},[t,f,o.backend.id,o.orgId]);let w=X.useRef(null);return X.useEffect(()=>{!m||!p||o.backend.kind===`cloud`&&p.sandbox_status===`PAUSED`&&p.sandbox_id&&w.current!==p.id&&(w.current=p.id,gn(p.sandbox_id).catch(()=>{D(e(N.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[m,p?.id,p?.sandbox_status,p?.sandbox_id,o.backend.kind,e]),f?null:(0,Z.jsx)(lu,{conversationId:t,children:(0,Z.jsx)(oa,{children:(0,Z.jsx)(rs,{children:(0,Z.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,Z.jsx)(cu,{onNavigateBack:()=>_(`/conversations/${t}`)}):(0,Z.jsx)(su,{})})})})})}function du(){return(0,Z.jsx)(uu,{})}var fu=u(du);export{Ns as a,to as c,El as i,Ja as l,Nl as n,Xo as o,kl as r,Yo as s,fu as t,Ya as u};
|
|
93
|
+
`},qc=(e,t)=>(e.timestamp??``).localeCompare(t.timestamp??``),Jc=async(e,t,n)=>{let r=[],i=new Set,a=[],o=0,s=new Set,c,l,u=!1,d=!1;for(;;){let e=await t({limit:100,sortOrder:`TIMESTAMP_DESC`,strictPagination:!0,...l?{pageId:l}:{},...c?{timestampLt:c}:{}});if(!Array.isArray(e.items))throw Error(`Invalid transcript history response: expected page.items to be an array.`);r.push(...e.items);let a,f=!1;if(e.items.forEach(e=>{i.has(e.id??``)||(e.id?i.add(e.id):o+=1,f=!0),(!a||(e.timestamp??``)<a)&&(a=e.timestamp??``)}),e.next_page_id){if(s.has(e.next_page_id))throw Error(`Transcript history pagination repeated a page cursor.`);s.add(e.next_page_id),l=e.next_page_id,c=void 0,u=!0;continue}if(u&&!d||e.items.length<100)break;if(n===void 0)throw Error(`Transcript history pagination cannot prove that all events were loaded.`);if(!a||c&&(!f||a>=c))throw Error(`Transcript history pagination did not advance.`);l=void 0,c=a,d=!0}let f=new Map;r.slice().reverse().forEach(e=>{if(e.id!==void 0){f.has(e.id)||f.set(e.id,e);return}a.push(e)}),e.forEach(e=>{if(e.id!==void 0){f.has(e.id)||f.set(e.id,e);return}a.push(e)});let p=[...a,...f.values()].sort(qc);if(n!==void 0&&i.size+o<n)throw Error(`Transcript history is incomplete: expected ${n} persisted events, received ${i.size+o}.`);return p},Yc=`transcript-export-format`;function Xc({conversationId:e,conversationUrl:t,sessionApiKey:n,conversationTitle:r,model:i,onClose:a}){let{t:o}=b(`openhands`),{trackConversationExported:s}=Rt(),[c,l]=X.useState(`markdown`),[u,d]=X.useState(!0),[f,p]=X.useState(!0),[m,h]=X.useState(!1),g=X.useRef(!1),_=X.useRef(!1),v=X.useRef(!0);X.useEffect(()=>(v.current=!0,()=>{v.current=!1,_.current=!0}),[]);let y=()=>{g.current&&(_.current=!0),a()};return(0,Z.jsx)(Vt,{onClose:y,"aria-label":o(N.TRANSCRIPT_EXPORT$TITLE),children:(0,Z.jsxs)(Ht,{testID:`transcript-export-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,Z.jsx)(pn,{onClose:y,testId:`close-transcript-export-modal`,className:`absolute right-4 top-4`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Z.jsx)(Wt,{title:o(N.TRANSCRIPT_EXPORT$TITLE)}),(0,Z.jsx)(Ut,{description:o(N.TRANSCRIPT_EXPORT$DESCRIPTION)})]}),(0,Z.jsxs)(`fieldset`,{className:`flex w-full flex-col gap-2`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium text-white`,children:o(N.TRANSCRIPT_EXPORT$FORMAT)}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:Yc,value:`markdown`,disabled:m,checked:c===`markdown`,onChange:()=>l(`markdown`)}),o(N.TRANSCRIPT_EXPORT$MARKDOWN)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:Yc,value:`html`,disabled:m,checked:c===`html`,onChange:()=>l(`html`)}),o(N.TRANSCRIPT_EXPORT$HTML)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-sm text-white`,children:[(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:u,onChange:e=>d(e.target.checked)}),o(N.TRANSCRIPT_EXPORT$INCLUDE_TOOL_DETAILS)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:f,onChange:e=>p(e.target.checked)}),o(N.TRANSCRIPT_EXPORT$INCLUDE_TIMESTAMPS)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,onClick:y,testId:`cancel-transcript-export`,children:o(N.BUTTON$CANCEL)}),(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,onClick:async()=>{if(!g.current){_.current=!1,g.current=!0,h(!0);try{let o=await Ti.getEventCount(e,t??``,n).catch(()=>void 0);if(_.current)return;let l=K.getState(),d=await Jc(l.loadedConversationId===e?l.events:[],r=>Ti.searchEvents(e,t,n,r),o);if(_.current)return;let p={includeToolDetails:u,includeTimestamps:f,title:r,model:i},m=c===`markdown`,h=m?Wc(d,p):Kc(d,p),g=m?`md`:`html`;I(new Blob([h],{type:m?`text/markdown;charset=utf-8`:`text/html;charset=utf-8`}),`conversation-${e}.${g}`),s(c),a()}catch{_.current||D(o(N.ERROR$GENERIC))}finally{g.current=!1,v.current&&h(!1)}}},testId:`confirm-transcript-export`,isDisabled:m,"aria-busy":m,children:o(N.BUTTON$EXPORT_CONVERSATION)})]})]})})}function Zc(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{mutate:r}=Mn(),[i,a]=X.useState(`view`),[o,s]=X.useState(!1),[c,l]=X.useState(!1),u=X.useRef(null),d=X.useRef(null),{handleDelete:f,handleStop:p,handleDownloadConversation:m,handleDisplayCost:h,handleShowAgentTools:g,handleShowSkills:_,handleShowHooks:v,handleTogglePublic:y,handleCopyShareLink:x,shareUrl:C,handleConfirmDelete:w,handleConfirmStop:T,systemModalVisible:E,setSystemModalVisible:D,skillsModalVisible:O,setSkillsModalVisible:k,hooksModalVisible:A,setHooksModalVisible:j,confirmDeleteModalVisible:M,setConfirmDeleteModalVisible:P,confirmStopModalVisible:F,setConfirmStopModalVisible:ee,systemMessage:te,shouldShowStop:ne,shouldShowDownloadConversation:I,shouldShowDisplayCost:re,shouldShowAgentTools:ie,shouldShowSkills:ae,shouldShowHooks:oe}=Lr({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return X.useEffect(()=>{i===`edit`&&u.current?.focus()},[i]),n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 h-[22px] text-base font-normal text-left pl-0 lg:pl-1 min-w-0`,"data-testid":`conversation-name`,children:[i===`edit`?(0,Z.jsx)(`input`,{ref:u,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(u.current?.value&&t){let i=u.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{S(e(N.CONVERSATION$TITLE_UPDATED))}})}else u.current&&(u.current.value=n?.title??``);a(`view`)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:n.title||``,className:`text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content`}):(0,Z.jsx)(`div`,{className:`text-white leading-5 truncate`,"data-testid":`conversation-name-title`,onDoubleClick:()=>{a(`edit`)},title:n.title||``,children:n.title}),i!==`edit`&&(0,Z.jsxs)(`div`,{ref:d,className:`relative flex items-center shrink-0`,children:[(0,Z.jsx)(Hn,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)},ariaLabel:e(N.COMMON$MORE_OPTIONS)}),o&&(0,Z.jsx)(bc,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:f,onStop:ne?p:void 0,onDisplayCost:re?h:void 0,onShowAgentTools:ie?g:void 0,onShowSkills:ae?_:void 0,onShowHooks:oe?v:void 0,onTogglePublic:y,onCopyShareLink:x,shareUrl:C,onExportTranscript:e=>{e.preventDefault(),e.stopPropagation(),l(!0),s(!1)},onDownloadConversation:I?m:void 0,position:`bottom`,anchorRef:d})]})]}),c&&t&&(0,Z.jsx)(Xc,{conversationId:t,conversationUrl:n.conversation_url,sessionApiKey:n.session_api_key,conversationTitle:n.title,model:n.llm_model,onClose:()=>l(!1)}),(0,Z.jsx)(Pr,{isOpen:E,onClose:()=>D(!1),systemMessage:te||null}),O&&(0,Z.jsx)(Fr,{onClose:()=>k(!1)}),A&&(0,Z.jsx)(Br,{onClose:()=>j(!1)}),M&&(0,Z.jsx)(An,{onConfirm:w,onCancel:()=>P(!1),conversationTitle:n?.title||``}),F&&(0,Z.jsx)(Ln,{onConfirm:T,onCancel:()=>ee(!1)})]}):null}function Qc({children:e,tooltip:t,ariaLabel:n}){return(0,Z.jsx)(Xt,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,Z.jsx)(`span`,{"data-aria-label":n,children:e})})}var $c=R(`inline-flex h-7 min-h-7 w-fit shrink-0 cursor-pointer items-center justify-center gap-1.5 px-2.5`,`rounded-md text-xs font-normal leading-none`,Kt,Gt,`text-[var(--oh-muted)]`,qt,`disabled:cursor-not-allowed disabled:opacity-30`);function el({className:e}){let{t}=b(`openhands`),n=Ar(),{data:r}=Y(),[i,a]=(0,X.useState)(!1),o=(0,X.useRef)(null),s=r?.git_provider??`github`;(0,X.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]);let c=t(N.CONVERSATION$OVERVIEW_DIFF_GIT_ACTIONS),l=(0,Z.jsxs)(`button`,{ref:o,type:`button`,onClick:()=>{n||a(e=>!e)},disabled:n,className:R($c,i&&`bg-white/10 text-[var(--oh-foreground)]`,n&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-expanded":i,"aria-haspopup":`menu`,"aria-disabled":n,"data-testid":`conversation-git-actions-toggle`,children:[(0,Z.jsx)(lt,{className:`size-4 shrink-0`,size:16,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`whitespace-nowrap`,children:c})]});return(0,Z.jsxs)(`div`,{className:`relative inline-flex items-center self-center`,children:[n?(0,Z.jsx)(Qc,{tooltip:t(N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES),ariaLabel:t(N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES),children:l}):l,i?(0,Z.jsx)(cs,{anchorRef:o,gitProvider:s,onClose:()=>a(!1)}):null]})}var tl=null;function nl(){tl!==null&&(clearTimeout(tl),tl=null)}function rl(){let{isRightPanelShown:e,isOverviewPanelShown:t,setIsOverviewPanelPeeked:n}=U.getState();!e||t||(nl(),n(!0))}function il(){nl(),tl=setTimeout(()=>{tl=null,U.getState().setIsOverviewPanelPeeked(!1)},150)}function al(){nl(),U.getState().setIsOverviewPanelPeeked(!1)}function ol(){let e=U(e=>e.isRightPanelShown),t=U(e=>e.isOverviewPanelShown),n=U(e=>e.isOverviewPanelPeeked);(0,X.useEffect)(()=>{n&&(!e||t)&&al()},[n,t,e])}function sl({className:e}){let{t}=b(`openhands`),n=Ar(),{conversationId:r}=Si(),i=(0,X.useRef)(null),[a,o]=(0,X.useState)(null),{isOverviewPanelShown:s,isOverviewPanelPeeked:c,isRightPanelShown:l,setIsOverviewPanelShown:u,setHasRightPanelToggled:d,setIsRightPanelShown:f}=U();ol(),(0,X.useEffect)(()=>{l&&s&&u(!1)},[s,l,u]);let p=!n&&l&&!s,m=p&&c;(0,X.useLayoutEffect)(()=>{if(!m){o(null);return}let e=()=>{let e=i.current?.getBoundingClientRect();e&&o({top:e.bottom+4,left:Math.max(8,e.right-240)})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[m]);let h=()=>{if(!n){if(l){d(!1),f(!1),r&&dn(r,{rightPanelShown:!1}),u(!0);return}u(!s)}},g=s||m,_=t(n?N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:s?N.CONVERSATION$HIDE_OVERVIEW:N.CONVERSATION$SHOW_OVERVIEW),v=m&&a?os.createPortal((0,Z.jsx)(`div`,{"data-testid":`conversation-overview-peek`,className:`fixed z-50`,style:{top:a.top,left:a.left,width:240},onMouseEnter:rl,onMouseLeave:il,children:(0,Z.jsx)(`div`,{className:`shadow-lg`,children:(0,Z.jsx)(Us,{})})}),document.body):null;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:i,className:`relative inline-flex items-center self-center`,onMouseEnter:()=>{p&&rl()},onMouseLeave:()=>{(p||c)&&il()},children:(0,Z.jsx)(Qc,{tooltip:_,ariaLabel:_,children:(0,Z.jsx)(`button`,{type:`button`,onClick:h,disabled:n,className:R(Pn,`size-7`,g&&`bg-white/10 text-[var(--oh-foreground)]`,n&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":_,"aria-pressed":s,"aria-disabled":n,"data-testid":`conversation-overview-toggle`,children:(0,Z.jsx)(gt,{className:`h-4 w-4 shrink-0`,size:16,"aria-hidden":!0})})})}),v]})}function cl({className:e}){let{t}=b(`openhands`),n=Ii(),r=Ar(),i=l(),{conversationId:a}=J(),{isRightPanelShown:o,setHasRightPanelToggled:s,setIsRightPanelShown:c,setSelectedTab:u}=U(),d=()=>{if(r)return;if(n){if(!a)return;s(!0),c(!0),dn(a,{rightPanelShown:!0});let{selectedTab:e}=U.getState();e||u(`files`),i(`/conversations/${a}/panel`);return}let e=!o;if(s(e),c(e),a&&dn(a,{rightPanelShown:e}),e){let{selectedTab:e}=U.getState();e||u(`files`)}},f=t(r?N.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:n?N.COMMON$SHOW_PANEL:o?N.COMMON$HIDE_PANEL:N.COMMON$SHOW_PANEL),p=n?!1:o;return(0,Z.jsx)(Qc,{tooltip:f,ariaLabel:f,children:(0,Z.jsx)(`button`,{type:`button`,onClick:d,disabled:r,className:R(Pn,`size-7 self-center`,r&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":f,"aria-pressed":p,"aria-disabled":r,"data-testid":`right-panel-toggle`,children:(0,Z.jsx)(Nn,{className:`size-5 -scale-x-100`})})})}function ll(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{curAgentState:r}=Yr(),{isTask:i,taskStatus:a}=vr(),{mutate:o}=en(),{mutate:s}=pc(),{providers:c}=qn(),[l,u]=X.useState(!1),[d,f]=X.useState(!1),p=X.useRef(null),m=n?.execution_status??null,h=le({isPausing:!1,isTask:i,taskStatus:a,isStartingStatus:r===L.LOADING||r===L.INIT,isStopStatus:ee(m),curAgentState:r}),g=l||d,_=()=>{u(!1),f(!1)};return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`relative shrink-0`,onPointerEnter:e=>{e.pointerType===`mouse`&&f(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&f(!1)},children:[(0,Z.jsx)(`button`,{ref:p,type:`button`,"data-testid":`server-status-menu-trigger`,"aria-label":e(N.COMMON$SERVER_STATUS),"aria-expanded":g,"aria-haspopup":`menu`,onClick:e=>{if(e.preventDefault(),e.stopPropagation(),g){_();return}u(!0)},className:R(`flex items-center justify-center rounded-md`,`text-[var(--oh-muted)] hover:bg-white/10`),children:(0,Z.jsx)(Ro,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:h,"aria-hidden":!0})}),g?(0,Z.jsx)(vc,{onClose:_,ignoreOutsideClickRef:p,onStopServer:he(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&o({conversationId:t}),_()}:void 0,onStartServer:A(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&s({conversationId:t,providers:c}),_()}:void 0,executionStatus:m,position:`bottom`,className:`bottom-full left-0 mt-0 min-h-fit`,isPausing:!1}):null]}),(0,Z.jsx)(Zc,{})]}),(0,Z.jsxs)(`div`,{className:`mr-2 flex shrink-0 items-center gap-1`,children:[(0,Z.jsx)(el,{}),(0,Z.jsx)(sl,{}),(0,Z.jsx)(cl,{})]})]})}var ul=e=>(0,Z.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,Z.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Z.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]}),dl=160,fl={duration:.22,ease:[.4,0,.2,1]};function pl({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o,suppressLayoutAnimation:s=!1}){let c=De(),l=o||c||!1,u=!l&&!s,d=R(`flex items-center rounded-md cursor-pointer`,`pl-1.5 pr-2 py-1 lg:py-1.5`,`text-[var(--oh-muted)] bg-transparent`,r&&`bg-[var(--oh-interactive-active)] text-white`,r?`hover:text-white hover:bg-[var(--oh-interactive-hover)]`:`hover:text-white hover:bg-white/5`,r?`focus-within:text-white`:`focus-within:text-[var(--oh-muted)]`,a),f=(0,Z.jsx)(t,{className:R(`h-4 w-4 shrink-0 text-inherit`)}),p=i&&r?(0,Z.jsx)(`span`,{className:`whitespace-nowrap text-sm font-normal`,children:i}):null,m=i?(0,Z.jsx)(Qe.span,{initial:!1,animate:{maxWidth:r?dl:0,opacity:+!!r,marginLeft:r?8:0},transition:fl,className:`block overflow-hidden whitespace-nowrap text-sm font-normal`,"aria-hidden":!r,children:i}):null;return l?(0,Z.jsxs)(`button`,{type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:R(d,`gap-2`),children:[f,p]}):(0,Z.jsxs)(Qe.button,{layout:u?`position`:!1,type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:d,transition:u?{layout:fl}:void 0,children:[f,m]})}var ml=e=>(0,Z.jsx)(`svg`,{viewBox:`0 0 128 128`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,Z.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M90.767 127.126a7.968 7.968 0 0 0 6.35-.244l26.353-12.681a8 8 0 0 0 4.53-7.209V21.009a8 8 0 0 0-4.53-7.21L97.117 1.12a7.97 7.97 0 0 0-9.093 1.548l-50.45 46.026L15.6 32.013a5.328 5.328 0 0 0-6.807.302l-7.048 6.411a5.335 5.335 0 0 0-.006 7.888L20.796 64 1.74 81.387a5.336 5.336 0 0 0 .006 7.887l7.048 6.411a5.327 5.327 0 0 0 6.807.303l21.974-16.68 50.45 46.025a7.96 7.96 0 0 0 2.743 1.793Zm5.252-92.183L57.74 64l38.28 29.058V34.943Z`})});function hl(){let e=ve().backend;if(e.kind!==`cloud`)throw Error(`Cloud sandboxes call requires a cloud backend.`);return e}async function gl(e){if(e.length===0)return[];let t=hl(),n=new URLSearchParams;for(let t of e)n.append(`id`,t);return await Pt({backend:t,method:`GET`,path:`/api/v1/sandboxes?${n.toString()}`})??[]}var _l=e=>{let t=T(),n=t.backend.kind===`cloud`;return _({queryKey:[`cloud`,`sandbox`,t.backend.id,t.orgId,e],queryFn:async()=>{if(!e)return null;let[t]=await gl([e]);return t??null},enabled:n&&!!e,staleTime:1e3*60*5,gcTime:1e3*60*15})},vl=`__AGENT_CANVAS_VSCODE_BASE_PATH__`;function yl(){if(typeof window<`u`){let e=window[vl];if(typeof e==`string`&&e.trim())return bl(e.trim())}return null}function bl(e){let t=e.startsWith(`/`)?e:`/${e}`;return t.length>1?t.replace(/\/+$/,``):t}function xl(e,t){if(!e||!t)return!1;let n;try{n=new URL(e,typeof window<`u`?window.location.href:void 0)}catch{return!1}return typeof window<`u`&&n.origin!==window.location.origin?!1:n.pathname===t||n.pathname.startsWith(`${t}/`)}var Sl=`VSCODE`,Cl=()=>{let{t:e}=b(`openhands`),{conversationId:t}=J(),n=Ni({allowAgentError:!0}),{data:r}=Y(),i=T(),a=r?.conversation_url??null,o=r?.session_api_key??null,s=r?.sandbox_id??null,c=i.backend.kind===`cloud`,l=yl(),u=l!==null,d=_l(c?s:null),f=_({queryKey:[`unified`,`vscode_status`,`local`,t,a,o],queryFn:()=>yn.getVSCodeStatus(a,o),enabled:!c&&u&&n&&!!t,refetchOnMount:!0}),p=f.data?.enabled===!0&&f.data?.running===!0,m=_({queryKey:[`unified`,`vscode_url`,`local`,t,a,o],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return{url:kn((await yn.getVSCodeUrl(t,a,o).catch(()=>Tn.getVSCodeUrl(t))).vscode_url)}},enabled:!c&&u&&n&&!!t&&p,refetchOnMount:!0,retry:3}),h,g,v,y,x,S,C,w;if(c){let e=d.data?.exposed_urls?.find(e=>e.name===Sl)?.url??null;h=d.isSuccess?{url:kn(e)}:void 0,g=d.isLoading,v=d.isError,y=d.isSuccess,x=d.status,S=d.error,C=async()=>{let e=await d.refetch(),t=e.data?.exposed_urls?.find(e=>e.name===Sl)?.url??null;return{data:e.data?{url:kn(t)}:void 0}},w=!1}else h=m.data,g=f.isLoading||m.isLoading,v=f.isError||m.isError,y=m.isSuccess,x=m.status,S=f.error??m.error,C=async()=>({data:(await m.refetch()).data}),w=!u||f.isSuccess&&!p||y&&!m.data?.url||y&&!xl(m.data?.url,l);let E=h&&!h.url?e(N.VSCODE$URL_NOT_AVAILABLE):null;return{data:h?{...h,error:E}:void 0,error:S,isLoading:g,isError:v,isSuccess:y,isUnavailable:w,status:x,refetch:C}};function wl(){let{t:e}=b(`openhands`),{curAgentState:t}=Yr(),{data:n,refetch:r,isLoading:i,isUnavailable:a}=Cl(),o=se.includes(t);return a?null:(0,Z.jsxs)(`button`,{type:`button`,onClick:async()=>{let e=n?.url;e||=(await r()).data?.url??null,e&&window.open(e,`_blank`,`noopener,noreferrer`)},disabled:i||o,"aria-label":e(N.VSCODE$OPEN),title:e(N.VSCODE$OPEN),"data-testid":`drawer-vscode-link`,className:R(`inline-flex items-center gap-1.5 rounded-[7px] border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs`,`text-[var(--oh-muted)] transition-colors hover:enabled:bg-surface-raised hover:enabled:text-white`,`cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,Z.jsx)(ml,{className:`h-[15px] w-[15px] shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:e(N.FILES$VSCODE)}),(0,Z.jsx)(it,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})]})}function Tl(e){if(fi(e)&&e.observation.kind===`TaskTrackerObservation`){let t=e.observation;if(t.command===`plan`)return t.task_list.map((e,t)=>({id:String(t+1),title:e.title,status:e.status,notes:e.notes||void 0}))}return null}function El(){let e=K(e=>e.events);return(0,X.useMemo)(()=>{for(let t=e.length-1;t>=0;--t){let n=Tl(e[t]);if(n)return{taskList:n,hasTaskList:n.length>0}}return{taskList:[],hasTaskList:!1}},[e])}function Dl({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Rn(t,n),[a,o]=(0,X.useState)();(0,X.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,left:e.left})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let{t:s}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedTabs:u,setSelectedTab:d}=sn(c),{selectedTab:f,isRightPanelShown:p,setSelectedTab:m}=U(),{navigateToTab:h}=mi(),{hasTaskList:g}=El(),_=Ar(),v=[{tab:`planner`,icon:_t,i18nKey:N.COMMON$PLANNER},{tab:`files`,icon:qr,i18nKey:N.COMMON$FILES},{tab:`commits`,icon:dt,i18nKey:N.DIFF_VIEWER$COMMITS},{tab:`terminal`,icon:ct,i18nKey:N.COMMON$TERMINAL},{tab:`browser`,icon:mt,i18nKey:N.COMMON$BROWSER},{tab:`usage`,icon:ot,i18nKey:N.COMMON$USAGE}];g&&v.unshift({tab:`tasklist`,icon:ul,i18nKey:N.COMMON$TASK_LIST});let y=e=>{_||(h(e),t())},x=(e,t)=>{if(_){t.preventDefault(),t.stopPropagation();return}if(t.preventDefault(),t.stopPropagation(),l.unpinnedTabs.includes(e))u(l.unpinnedTabs.filter(t=>t!==e));else{let t=[...l.unpinnedTabs,e];if(u(t),f===e&&p){let n=v.find(({tab:n})=>n!==e&&!t.includes(n));n&&(m(n.tab),d(n.tab))}}};if(!e)return null;let S=!!(r?.current&&a),C=(0,Z.jsx)(Mt,{ref:i,theme:S?`popover`:`default`,position:S?`none`:`bottom`,alignment:S?`none`:`left`,spacing:S?`none`:`default`,className:R(`z-[9999] w-fit`,S?`mt-0`:`mt-2`),children:v.map(({tab:e,icon:t,i18nKey:n})=>{let r=!l.unpinnedTabs.includes(e);return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsx)(Gr,{isDisabled:_,children:(0,Z.jsxs)(`div`,{className:R(`group flex h-[30px] w-full min-w-0 items-stretch rounded`,!_&&`hover:bg-[var(--oh-interactive-hover)]`,_&&`opacity-50`),children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,disabled:_,className:R(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Zt,_?`cursor-not-allowed`:`cursor-pointer`),onClick:()=>y(e),children:[(0,Z.jsx)(`span`,{className:Qt,"aria-hidden":!0,children:(0,Z.jsx)(t,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:s(n)})]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,disabled:_,className:R(`flex shrink-0 items-center justify-center rounded-r px-2 text-white`,Zt,_?`cursor-not-allowed`:`cursor-pointer hover:bg-white/10`),"aria-pressed":r,"aria-label":s(r?N.CONVERSATION$UNPIN_TAB:N.CONVERSATION$PIN_TAB),onClick:t=>x(e,t),children:r?(0,Z.jsx)(`span`,{className:R(`-mr-[5px] ml-auto`,Qt),"aria-hidden":!0,children:(0,Z.jsx)(_s,{className:`h-7 w-7`})}):(0,Z.jsx)(`span`,{className:R(`ml-auto`,Qt),"aria-hidden":!0,children:(0,Z.jsx)(gs,{className:`h-4.5 w-4.5`})})})]})})},e)})});return S&&a&&typeof document<`u`?os.createPortal((0,Z.jsx)(`div`,{style:a,children:C}),document.body):C}function Ol({variant:e=`default`,isPanelResizing:t=!1}){let{conversationId:n}=J(),{setSelectedTab:r,planContent:i}=U(),[a,o]=(0,X.useState)(!1),{state:s}=sn(n),{hasTaskList:c}=El(),{backend:l}=T(),{handleBuildPlanClick:u}=ze(),{curAgentState:d}=Yr(),{isPlanningAgentRunning:f}=gi(),{selectTab:p,isTabActive:m,onTabChange:h,selectedTab:g,isRightPanelShown:_}=mi();(0,X.useEffect)(()=>{r(s.selectedTab)},[r,s.selectedTab]),(0,X.useEffect)(()=>{_&&(g||h(`files`))},[_,g,h]);let{t:v,i18n:y}=b(`openhands`),x=[{tabValue:`files`,isActive:m(`files`),icon:qr,onClick:()=>p(`files`),tooltipContent:v(N.COMMON$FILES),tooltipAriaLabel:v(N.COMMON$FILES),label:v(N.COMMON$FILES)},{tabValue:`commits`,isActive:m(`commits`),icon:dt,onClick:()=>p(`commits`),tooltipContent:v(N.DIFF_VIEWER$COMMITS),tooltipAriaLabel:v(N.DIFF_VIEWER$COMMITS),label:v(N.DIFF_VIEWER$COMMITS)},{tabValue:`planner`,isActive:m(`planner`),icon:_t,onClick:()=>p(`planner`),tooltipContent:v(N.COMMON$PLANNER),tooltipAriaLabel:v(N.COMMON$PLANNER),label:v(N.COMMON$PLANNER)},{tabValue:`terminal`,isActive:m(`terminal`),icon:ct,onClick:()=>p(`terminal`),tooltipContent:v(N.COMMON$TERMINAL),tooltipAriaLabel:v(N.COMMON$TERMINAL),label:v(N.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:m(`browser`),icon:mt,onClick:()=>p(`browser`),tooltipContent:v(N.COMMON$BROWSER),tooltipAriaLabel:v(N.COMMON$BROWSER),label:v(N.COMMON$BROWSER)},{tabValue:`usage`,isActive:m(`usage`),icon:ot,onClick:()=>p(`usage`),tooltipContent:v(N.COMMON$USAGE),tooltipAriaLabel:v(N.COMMON$USAGE),label:v(N.COMMON$USAGE)}];c&&x.splice(2,0,{tabValue:`tasklist`,isActive:m(`tasklist`),icon:ul,onClick:()=>p(`tasklist`),tooltipContent:v(N.COMMON$TASK_LIST),tooltipAriaLabel:v(N.COMMON$TASK_LIST),label:v(N.COMMON$TASK_LIST)});let S=x.filter(e=>s.unpinnedTabs.includes(e.tabValue)?g===e.tabValue:!0),C=s.unpinnedTabs.join(`,`),w=d===L.RUNNING||d===L.LOADING||f||!i,E=(0,X.useRef)(null),D=(0,X.useRef)(null),O=(0,X.useRef)(null),k=(0,X.useRef)(null),A=(0,X.useRef)(null),[j,M]=(0,X.useState)(S.length);(0,X.useLayoutEffect)(()=>{let e=E.current,t=D.current,n=O.current,r=k.current;if(!e||!t||!n||!r)return;let i=()=>{let i=t.querySelectorAll(`[data-tab-measure="true"]`),a=i.length,o=e.getBoundingClientRect().width;if(o===0){M(a);return}let s=Array.from(i).map(e=>e.getBoundingClientRect().width);if(s.length!==a||a===0){M(Math.max(0,a));return}let c=n.getBoundingClientRect().width,l=r.getBoundingClientRect().width,u=getComputedStyle(e).columnGap||getComputedStyle(e).gap,d=parseFloat(u)||6,f=0;for(let e=a;e>=0;--e){let t=c+l;for(let n=0;n<e;n+=1)t+=s[n]??0;if(e>0&&(t+=e*d),t<=o+.5){f=e;break}}M(e=>e===f?e:f)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(e),a.observe(r),()=>a.disconnect()},[C,S.length,c,l.kind,g,_,y.language]);let P=Math.min(j,S.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:R(`relative w-full min-w-0`,e===`compact`?`flex h-full min-h-0 items-center py-0 pl-0 pr-1`:`min-h-10 p-1`),children:[(0,Z.jsx)(`div`,{ref:D,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:S.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,Z.jsx)(Qc,{tooltip:r,ariaLabel:i,children:(0,Z.jsx)(pl,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:R(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,Z.jsxs)(`div`,{ref:E,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-start overflow-hidden`,children:(0,Z.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(ft,{id:`conversation-drawer-tabs`,children:(0,Z.jsx)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:S.slice(0,P).map(({tabValue:e,icon:n,onClick:r,isActive:i,tooltipContent:a,tooltipAriaLabel:o,label:s,className:c},l)=>(0,Z.jsx)(Qc,{tooltip:a,ariaLabel:o,children:(0,Z.jsx)(pl,{tabValue:e,icon:n,onClick:r,isActive:i,label:s,className:R(c,`shrink-0`),suppressLayoutAnimation:t})},`${e}-${l}`))})}),(0,Z.jsxs)(`div`,{ref:O,className:`relative shrink-0`,children:[(0,Z.jsx)(Hn,{ref:A,onClick:()=>o(!a),ariaLabel:v(N.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?jn:void 0}),(0,Z.jsx)(Dl,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:A,anchorRef:A})]})]})}),(0,Z.jsx)(`div`,{ref:k,className:`ml-auto shrink-0 pr-1`,children:(0,Z.jsx)(wl,{})})]})]}),m(`planner`)&&(0,Z.jsx)(`div`,{className:R(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,Z.jsx)(`button`,{type:`button`,onClick:u,disabled:w,className:R(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,w?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,Z.jsxs)($n.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[v(N.COMMON$BUILD),` ⌘↩`]})})})]})}function kl({onMouseDown:e,className:t,isDragging:n=!1,testId:r}){let[i,a]=(0,X.useState)(!1),o=n||i;return(0,Z.jsxs)(`div`,{"data-testid":r,className:R(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,Z.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-3 min-w-[12px] -translate-x-1/2 cursor-ew-resize`,onMouseDown:e,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)}),(0,Z.jsx)(`div`,{className:R(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`,o?`bg-white`:`bg-transparent`),"aria-hidden":!0})]})}var Al=200;function jl({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=st(r,e),o=(0,X.useCallback)(e=>Math.max(t,Math.min(n,e)),[t,n]),[s,c]=(0,X.useState)(()=>o(i)),[l,u]=(0,X.useState)(!1),d=(0,X.useRef)(null),f=(0,X.useCallback)(e=>{e.preventDefault(),u(!0)},[]),p=(0,X.useCallback)(e=>{if(!l||!d.current)return;let t=d.current.getBoundingClientRect();c(o((e.clientX-t.left)/t.width*100))},[l,o]),m=(0,X.useCallback)(()=>{l&&(u(!1),a(s))},[l,s,a]);return(0,X.useLayoutEffect)(()=>{if(!l)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(Al),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,m),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,m),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[l,p,m]),{leftWidth:s,rightWidth:100-s,isDragging:l,containerRef:d,handleMouseDown:f}}var Ml=200;function Nl({containerRef:e,defaultWidth:t,minWidth:n,maxWidth:r,storageKey:i,enabled:a=!0,edge:o=`right`}){let[s,c]=st(i,t),l=(0,X.useCallback)(e=>Math.max(n,Math.min(r,e)),[n,r]),[u,d]=(0,X.useState)(()=>l(s)),[f,p]=(0,X.useState)(!1),m=(0,X.useRef)(u);m.current=u;let h=(0,X.useCallback)(e=>{a&&(e.preventDefault(),p(!0))},[a]),g=(0,X.useCallback)(t=>{if(!f||!e.current)return;let n=e.current.getBoundingClientRect();d(l(o===`left`?t.clientX-n.left:n.right-t.clientX))},[l,e,o,f]),_=(0,X.useCallback)(()=>{f&&(p(!1),c(m.current))},[f,c]);return(0,X.useLayoutEffect)(()=>{if(!f)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(Ml),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[g,_,f]),{drawerWidth:u,isDragging:f,handleMouseDown:h}}var Pl=()=>void 0;function Fl({openAdd:e}){let{t}=b(`openhands`),[n,r]=(0,X.useState)(e),{data:i,isLoading:a,refetch:o}=Yn(),{data:s,isLoading:c,isError:l,refetch:u}=Xn({limit:50,offset:0,enabled:i?.status===`ok`});(0,X.useEffect)(()=>{e&&r(!0)},[e]);let d;return d=a||i?.status===`ok`&&c?(0,Z.jsx)(et,{}):i?.status===`ok`?l?(0,Z.jsx)(Ri,{onRetry:u}):s?.automations.length?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nt,{title:t(N.CONVERSATION_PANEL$AUTOMATIONS),count:s.automations.length,automations:s.automations,view:`list`,onToggle:Pl,onRunNow:Pl,onDelete:Pl,onExport:Pl}),(0,Z.jsx)(tt,{isOpen:n,onClose:()=>r(!1)})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{}),(0,Z.jsx)(tt,{isOpen:n,onClose:()=>r(!1)})]}):(0,Z.jsx)(Li,{onRetry:o}),(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-automations-panel`,children:d})}var Il={project:`project`,all:`all`};function Ll(e,t){return Ai(e,t)===`project`}function Rl(e,t,n){return t===Il.all?e:e.filter(e=>Ll(e,n))}function zl(e,t){return[...e].sort((e,n)=>{let r=Ai(e,t),i=Ai(n,t),a=ji.indexOf(r),o=ji.indexOf(i);return a===o?e.name.localeCompare(n.name):a-o})}function Bl({value:e,onChange:t,testId:n}){let{t:r}=b(`openhands`);return(0,Z.jsx)(`div`,{className:`flex w-full justify-center [&>[role=radiogroup]]:w-full`,children:(0,Z.jsx)(ht,{value:e,onChange:t,ariaLabel:r(N.CONVERSATION$OVERVIEW_SCOPE_FILTER),testId:n,options:[{value:Il.project,label:r(N.CONVERSATION$OVERVIEW_SCOPE_PROJECT)},{value:Il.all,label:r(N.CONVERSATION$OVERVIEW_SCOPE_ALL)}]})})}function Vl({openAdd:e}){let{t}=b(`openhands`),{isLoading:n}=Bt(),{data:r}=Y(),{data:i,isLoading:a}=_r(),{isEnabled:o,setEnabled:s}=ki(),c=as()?.addRequestKey??0,l=r?.selected_workspace??null,[u,d]=(0,X.useState)(Il.project),[f,p]=(0,X.useState)(kt),[m,h]=(0,X.useState)(!1),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(!1);(0,X.useEffect)(()=>{e&&y(!0)},[e]),(0,X.useEffect)(()=>{c!==0&&y(!0)},[c]);let x=(0,X.useMemo)(()=>{if(!i)return[];let e=Rl(i,u,l);return u===Il.all?zl(e,l):e},[i,u,l]),S=(0,X.useMemo)(()=>Et(x,o,f),[x,o,f]);return a||n?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`text-sm text-muted`,children:`…`}):!i||i.length===0?(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-empty`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.SETTINGS$SKILLS_NO_SKILLS)})}),v?(0,Z.jsx)(St,{onClose:()=>y(!1)}):null]}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-skills-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(Bl,{value:u,onChange:d,testId:`conversation-overview-skills-scope`}),(0,Z.jsx)(xt,{search:f.query,onSearchChange:e=>p(t=>({...t,query:e})),activeFilterCount:yt(f),onOpenFilters:()=>h(!0)}),x.length===0?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-project-empty`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.CONVERSATION$OVERVIEW_SCOPE_PROJECT_EMPTY_SKILLS)})}):S.length===0?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-skills-no-match`,className:tr,children:(0,Z.jsx)(`p`,{className:`text-sm text-tertiary-light`,children:t(N.SETTINGS$SKILLS_NO_MATCH)})}):(0,Z.jsx)(`section`,{className:R(`flex min-w-0 flex-col gap-3`,er),children:(0,Z.jsx)(`div`,{className:R(nr,`grid-cols-1`),children:S.map(e=>(0,Z.jsx)(Tt,{skill:e,enabled:o(e),onOpen:()=>_(e),onToggle:t=>s(e.name,t)},e.name))})}),g?(0,Z.jsx)(Dt,{skill:g,enabled:o(g),onToggle:e=>s(g.name,e),onClose:()=>_(null)}):null,v?(0,Z.jsx)(St,{onClose:()=>y(!1)}):null,m?(0,Z.jsx)(wt,{groups:Ot(x,o,f),activeCount:yt(f),onToggle:(e,t)=>p(n=>bt(n,e,t)),onClearAll:()=>p(e=>Ct(e)),onClose:()=>h(!1)}):null]})}function Hl({openAdd:e}){let{t}=b(`openhands`),{data:n,isLoading:r}=Bt(),{mutate:i,isPending:a}=Hi(),{mutate:o}=zi(),s=as()?.addRequestKey??0,[c,l]=(0,X.useState)(null),[u,d]=(0,X.useState)(null),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)(``),[g,_]=(0,X.useState)(`all`);(0,X.useEffect)(()=>{e&&d({id:``,type:`sse`})},[e]),(0,X.useEffect)(()=>{s!==0&&d({id:``,type:`sse`})},[s]);let v=ar(zt(n?.agent_settings?.mcp_config)),y=cr(or),x=v.filter(e=>sr(e,lr(e,y),m));return r||!n?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-mcp-panel`,className:`text-sm text-muted`,children:`…`}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-mcp-panel`,className:`flex flex-col gap-4`,children:[(0,Z.jsx)(Wi,{search:m,onSearchChange:h,sectionFilter:g,onSectionFilterChange:_}),g===`library`?null:(0,Z.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:t(N.MCP$INSTALLED_TITLE)}),(0,Z.jsx)(Bi,{servers:x,hasAnyInstalled:v.length>0,query:m,onEdit:d,onToggleEnabled:(e,t)=>{o({serverId:e.id,server:{...e,enabled:t}})}})]}),g===`installed`?null:(0,Z.jsx)(Ui,{onSelect:l,onAdd:l,query:m}),c?(0,Z.jsx)(Gn,{entry:c,existingServers:v,onClose:()=>l(null)}):null,u?(0,Z.jsx)(Vi,{server:u,existingServers:v,onClose:()=>d(null)}):null,f?(0,Z.jsx)(mn,{text:t(N.SETTINGS$MCP_CONFIRM_DELETE),onCancel:()=>p(null),onConfirm:()=>{f&&i(f,{onSuccess:()=>{S(t(N.MCP$REMOVE_SUCCESS)),p(null)},onError:e=>{D(C(e)||t(N.ERROR$GENERIC)),p(null)}})},isConfirming:a}):null]})}function Ul({openAdd:e}){let t=d(),{t:n}=b(`openhands`),r=as()?.addRequestKey??0,{data:i,isLoading:a}=ir(),{mutate:o,isPending:s}=Gi(),[c,l]=(0,X.useState)(`list`),[u,f]=(0,X.useState)(null);(0,X.useEffect)(()=>{e&&l(`add-secret-form`)},[e]),(0,X.useEffect)(()=>{r!==0&&l(`add-secret-form`)},[r]);let p=()=>{t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]})};return c===`add-secret-form`?(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-secrets-add-form`,className:`flex h-full min-h-0 flex-col overflow-y-auto p-4`,children:(0,Z.jsx)(Ki,{mode:`add`,selectedSecret:null,onCancel:()=>l(`list`)})}):(0,Z.jsxs)(`div`,{"data-testid":`conversation-overview-secrets-panel`,className:`flex h-full min-h-0 flex-col`,children:[(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:a?(0,Z.jsx)(`p`,{className:`px-2 py-4 text-sm text-[var(--oh-muted)]`,children:n(N.HOME$LOADING)}):i&&i.length>0?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:i.map(e=>(0,Z.jsxs)(`li`,{"data-testid":`conversation-overview-secret-item`,className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-white/5`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`truncate text-sm text-[var(--oh-foreground)]`,children:e.name}),e.description?(0,Z.jsx)(`p`,{className:`truncate text-xs text-[var(--oh-muted)]`,children:e.description}):null]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-overview-secret-delete-${e.name}`,"aria-label":n(N.BUTTON$DELETE),onClick:()=>f(e.name),className:R(`shrink-0 rounded-md p-1 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-white/10 hover:text-[var(--oh-foreground)]`),children:(0,Z.jsx)(jt,{className:`size-3.5`,"aria-hidden":!0})})]},e.name))}):(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-secrets-empty`,className:R(tr,`px-2 py-6 text-center text-sm`),children:n(N.SECRETS$EMPTY)})}),u?(0,Z.jsx)(mn,{text:n(N.SECRETS$CONFIRM_DELETE_KEY),isConfirming:s,onCancel:()=>f(null),onConfirm:()=>{o(u,{onSettled:()=>f(null),onSuccess:p,onError:p})}}):null]})}var Wl=R(`size-3.5 shrink-0 text-[var(--oh-muted)]`,`opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`);function Gl(e){let{repository:t,provider:n}=Go();return!t||!n?null:e===Q.pull_requests?As.constructPullRequestsListUrl(n,t):As.constructIssuesListUrl(n,t)}function Kl({kind:e}){let{t}=b(`openhands`),{provider:n}=Go(),r=Gl(e);return!r||!n?null:(0,Z.jsxs)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-${e}-open-external`,className:R(`inline-flex h-7 min-h-7 shrink-0 items-center gap-1.5 whitespace-nowrap`,`px-1 text-xs text-[var(--oh-muted)] transition-colors`,`hover:text-[var(--oh-foreground)]`),children:[t(N.CONVERSATION$OVERVIEW_VIEW_ON_PROVIDER,{provider:fe(n)}),(0,Z.jsx)(it,{className:`size-3.5`,"aria-hidden":!0})]})}function ql({kind:e}){let{t}=b(`openhands`),{repository:n,provider:r,isConnected:i}=Go(),a=js(n,r),o=Ms(n,r),s=e===Q.pull_requests?a:o;return!i||!n||!r?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-git-items-unavailable`,className:R(tr,`px-4 py-6 text-center text-sm`),children:t(N.CONVERSATION$OVERVIEW_GIT_UNAVAILABLE)}):(0,Z.jsx)(`div`,{"data-testid":`conversation-overview-${e}-panel`,className:`min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:s.isLoading?(0,Z.jsx)(`p`,{className:`px-2 py-4 text-sm text-[var(--oh-muted)]`,children:t(N.HOME$LOADING)}):s.isError?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-${e}-error`,className:R(tr,`px-2 py-6 text-center text-sm`),children:t(N.CONVERSATION$OVERVIEW_GIT_ITEMS_ERROR)}):s.data&&s.data.length>0?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:s.data.map(t=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,"data-testid":`conversation-overview-${e}-item-${t.number}`,className:R(`group flex min-w-0 items-center gap-2 rounded-md px-2 py-2`,`transition-colors hover:bg-white/5`),children:[(0,Z.jsxs)(`span`,{className:`shrink-0 text-sm tabular-nums text-[var(--oh-muted)]`,children:[`#`,t.number]}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-[var(--oh-foreground)]`,children:t.title}),(0,Z.jsx)(it,{className:Wl,"aria-hidden":!0})]})},t.id))}):(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-${e}-empty`,className:R(tr,`px-2 py-6 text-center text-sm`),children:e===Q.pull_requests?t(N.CONVERSATION$OVERVIEW_PULL_REQUESTS_EMPTY):t(N.CONVERSATION$OVERVIEW_ISSUES_EMPTY)})})}var Jl=R(`flex h-10 min-h-10 shrink-0 items-center gap-1.5`,`border-b border-[var(--oh-border)] py-1 pl-1 pr-4`),Yl=R(`h-7 min-h-7 shrink-0 whitespace-nowrap px-2.5 text-xs`),Xl=R(`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-muted transition-colors hover:bg-white/10 hover:text-white`);function Zl(e){switch(e){case Q.automations:return N.CONVERSATION_PANEL$AUTOMATIONS;case Q.skills:return N.SETTINGS$NAV_SKILLS;case Q.mcp:return N.CONVERSATION$OVERVIEW_MCP;case Q.secrets:return N.SETTINGS$NAV_SECRETS;case Q.pull_requests:return N.CONVERSATION$OVERVIEW_PULL_REQUESTS;case Q.issues:return N.CONVERSATION$OVERVIEW_ISSUES;default:return e}}function Ql({section:e}){let{t}=b(`openhands`),{requestAdd:n}=is();switch(e){case Q.automations:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-automations-add`,className:Yl,onClick:n,children:t(N.AUTOMATIONS$ADD_AUTOMATION)});case Q.skills:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-skills-add-skill-button`,className:Yl,onClick:n,children:t(N.SETTINGS$SKILLS_ADD_BUTTON)});case Q.mcp:return(0,Z.jsx)(Jt,{type:`button`,variant:`secondary`,testId:`conversation-overview-mcp-add-server`,className:Yl,onClick:n,children:t(N.MCP$ADD_CUSTOM)});case Q.secrets:return(0,Z.jsx)(Jt,{type:`button`,variant:`primary`,testId:`conversation-overview-secrets-add-button`,className:Yl,onClick:n,children:t(N.SECRETS$ADD_NEW_SECRET)});case Q.pull_requests:return(0,Z.jsx)(Kl,{kind:`pull_requests`});case Q.issues:return(0,Z.jsx)(Kl,{kind:`issues`});default:return null}}function $l({section:e,openAdd:t}){switch(e){case Q.automations:return(0,Z.jsx)(Fl,{openAdd:t});case Q.skills:return(0,Z.jsx)(Vl,{openAdd:t});case Q.mcp:return(0,Z.jsx)(Hl,{openAdd:t});case Q.secrets:return(0,Z.jsx)(Ul,{openAdd:t});case Q.pull_requests:return(0,Z.jsx)(ql,{kind:`pull_requests`});case Q.issues:return(0,Z.jsx)(ql,{kind:`issues`});default:return e}}function eu({className:e}){let{t}=b(`openhands`),{section:n,openAdd:r,closeDrawer:i}=is(),{workspaceName:a}=Wo();if((0,X.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&i()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[i,n]),!n)return null;let o=n===Q.pull_requests||n===Q.issues||n===Q.secrets;return(0,Z.jsxs)(`aside`,{"data-testid":`conversation-overview-drawer-content`,"aria-label":t(Zl(n)),className:R(`flex h-full w-full min-h-0 flex-col overflow-hidden bg-base-secondary`,e),children:[(0,Z.jsxs)(`header`,{className:Jl,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-overview-drawer-close`,"aria-label":t(N.BUTTON$CLOSE),onClick:i,className:Xl,children:(0,Z.jsx)(ur,{className:`size-4`,"aria-hidden":!0})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Z.jsx)(`h2`,{className:`truncate text-sm font-medium text-content`,children:t(Zl(n))}),a?(0,Z.jsx)(`p`,{"data-testid":`conversation-overview-drawer-workspace`,className:`truncate text-xs text-muted`,children:a}):null]}),(0,Z.jsx)(`div`,{className:`shrink-0`,children:(0,Z.jsx)(Ql,{section:n})})]}),(0,Z.jsx)(`div`,{className:R(`min-h-0 flex-1 custom-scrollbar-always`,o?`flex flex-col overflow-hidden`:`overflow-y-auto px-4 py-4`),children:(0,Z.jsx)($l,{section:n,openAdd:r})})]})}var tu=`conversation-overview-drawer-width`,nu=`conversation-overview-drawer-resize-handle`,ru=`conversation-overview-drawer`;function iu(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function au({isMobile:e,resizeContainerRef:t}){let n=as(),r=!!n?.section,{drawerWidth:i,isDragging:a,handleMouseDown:o}=Nl({containerRef:t??{current:null},defaultWidth:420,minWidth:300,maxWidth:640,storageKey:tu,enabled:r&&!e&&t!=null});return n?e?r?(0,Z.jsx)(eu,{className:`max-h-[min(50vh,420px)] w-full border-t border-[var(--oh-border)]`}):null:(0,Z.jsxs)(Z.Fragment,{children:[r&&t?(0,Z.jsx)(`div`,{"data-testid":nu,children:(0,Z.jsx)(kl,{onMouseDown:o,isDragging:a})}):null,(0,Z.jsx)(`div`,{"data-testid":ru,"aria-hidden":!r,className:R(`shrink-0 overflow-hidden ease-in-out`,a?`transition-[transform,opacity] duration-300`:`transition-all duration-300`,iu(r)),style:{width:r?`${i}px`:`0px`,transitionProperty:a?`transform, opacity`:`width, transform, opacity`},children:(0,Z.jsx)(`div`,{className:`flex h-full flex-col overflow-hidden border-l border-[var(--oh-border)] bg-base-secondary`,style:{width:`${i}px`},children:r?(0,Z.jsx)(eu,{className:`h-full`}):null})})]}):null}function ou(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function su(){let e=Ii(),t=Ii(767),{isRightPanelShown:n}=U(),r=!!as()?.section,{leftWidth:i,rightWidth:a,isDragging:o,containerRef:s,handleMouseDown:c}=jl({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,Z.jsx)(`div`,{className:R(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,Z.jsxs)(`div`,{ref:s,className:R(`flex flex-1 overflow-hidden`,e?`flex-col`:`transition-all duration-300 ease-in-out`),style:e?void 0:{transitionProperty:o?`none`:`all`},children:[(0,Z.jsxs)(`div`,{className:R(`flex flex-col bg-base overflow-hidden`,e?`flex-1`:R(`min-w-0`,!r&&`transition-[width] duration-300 ease-in-out`)),style:e?void 0:{width:n?`${i}%`:`100%`,transitionProperty:o||r?`none`:`width`},children:[(0,Z.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:R(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,Z.jsx)(In,{}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(ll,{})})]}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(Ys,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,Z.jsx)(kl,{onMouseDown:c,isDragging:o}),!e&&(0,Z.jsx)(`div`,{className:R(`transition-all duration-300 ease-in-out overflow-hidden`,ou(n)),style:{width:n?`${a}%`:`0%`,transitionProperty:o?`opacity, transform`:`all`},children:(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 bg-[var(--oh-surface)] border-l border-[var(--oh-border)] overflow-hidden`,children:[(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,Z.jsx)(Ol,{isPanelResizing:o})}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(fc,{})})]})})}),(0,Z.jsx)(au,{isMobile:e,resizeContainerRef:s})]})})}function cu({onNavigateBack:e}){let{t}=b(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=U();return X.useLayoutEffect(()=>(n(!0),r(!0),U.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,Z.jsxs)(`div`,{"data-testid":`conversation-mobile-panel-top`,className:`flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-[var(--oh-border)] pl-2.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(N.COMMON$BACK),className:Pn,children:(0,Z.jsx)(Ze,{size:20,className:jn,"aria-hidden":!0,strokeWidth:2})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex h-full min-h-0 w-full min-w-0 flex-col justify-center`,children:(0,Z.jsx)(Ol,{variant:`compact`})})})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,Z.jsx)(fc,{})})]})}function lu({children:e,conversationId:t}){let{data:n}=Y(),{backend:r}=T(),i=r.kind!==`cloud`,a=U(e=>e.localPlanningConversationId),o=n?.id===t?a:null,s=X.useMemo(()=>i?n?.sub_conversation_ids&&n.sub_conversation_ids.length>0?n.sub_conversation_ids:o?[o]:[]:n?.sub_conversation_ids??[],[i,n?.sub_conversation_ids,o]),{data:c}=Cr(s),l=X.useMemo(()=>i?vn(c,n?.id):null,[i,c,n?.id]),u=X.useMemo(()=>i?l?[l]:o?[o]:[]:s,[i,s,l,o]),d=c?.filter(e=>e!==null&&u.includes(e.id));return(0,Z.jsx)(Ci,{conversationId:t,conversationUrl:n?.sandbox_status===`PAUSED`?null:n?.conversation_url,sessionApiKey:n?.session_api_key,subConversationIds:u,subConversations:d,children:e})}function uu(){let{t:e}=b(`openhands`),{conversationId:t}=J(),n=c(`/conversations/:conversationId/panel`),{isTask:r,taskStatus:i,taskDetail:a}=yr(),o=T(),u=X.useRef(o.backend.id),d=X.useRef(o.orgId),f=u.current!==o.backend.id||d.current!==o.orgId,{data:p,isFetched:m}=Y(),{data:h}=bn(),{resetConversationState:g}=U(),_=l(),v=s(),y=Ei(e=>e.clearTerminal),x=En(e=>e.reset),S=Ji(e=>e.setCurrentAgentState),C=Qr(e=>e.removeErrorMessage);X.useEffect(()=>{y(),g(),x(),S(L.LOADING),C()},[t,y,g,x,S,C]),X.useEffect(()=>{if(r&&i===`ERROR`){D(a||e(N.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=v.state?.resumedFromConversationId;_(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[r,i,a,e,_,v.state]),X.useEffect(()=>{!m||!h||f||p||(ea(o.backend.id,o.orgId),D(e(N.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),_(`/conversations`))},[p,m,h,_,e,f,o.backend.id,o.orgId]),X.useEffect(()=>{f||t&&(t.startsWith(`task-`)||$i(o.backend.id,o.orgId,t))},[t,f,o.backend.id,o.orgId]);let w=X.useRef(null);return X.useEffect(()=>{!m||!p||o.backend.kind===`cloud`&&p.sandbox_status===`PAUSED`&&p.sandbox_id&&w.current!==p.id&&(w.current=p.id,gn(p.sandbox_id).catch(()=>{D(e(N.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[m,p?.id,p?.sandbox_status,p?.sandbox_id,o.backend.kind,e]),f?null:(0,Z.jsx)(lu,{conversationId:t,children:(0,Z.jsx)(oa,{children:(0,Z.jsx)(rs,{children:(0,Z.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,Z.jsx)(cu,{onNavigateBack:()=>_(`/conversations/${t}`)}):(0,Z.jsx)(su,{})})})})})}function du(){return(0,Z.jsx)(uu,{})}var fu=u(du);export{Ns as a,to as c,El as i,Ja as l,Nl as n,Xo as o,kl as r,Yo as s,fu as t,Ya as u};
|