@openhands/agent-canvas 1.17.0 → 1.18.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-DrjNsPOH.js → acp-providers-DcY_mKYa.js} +1 -1
- package/build/assets/active-backend-context-BnH4-L8h.js +2 -0
- package/build/assets/{agent-context-settings-CJUrcBut.js → agent-context-settings-D3peZkjX.js} +1 -1
- package/build/assets/{agent-profiles-service.api-Biieml2L.js → agent-profiles-service.api-DkeZaqIl.js} +1 -1
- package/build/assets/agent-profiles-settings-7yMWYjGF.js +1 -0
- package/build/assets/agent-server-client-options-EHB23gyx.js +1 -0
- package/build/assets/agent-server-config-C_x8Otd9.js +1 -0
- package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +88 -0
- package/build/assets/{agent-settings-CpY3zObk.js → agent-settings-BF8hM6wb.js} +1 -1
- package/build/assets/agent-settings-YPutBAeR.js +1 -0
- package/build/assets/alert-banner-eYyqvHL3.js +1 -0
- package/build/assets/{api-error-message-Ve79qDcN.js → api-error-message-BXo0lCI5.js} +1 -1
- package/build/assets/api-key-entry-screen-CCBvBD8u.js +1 -0
- package/build/assets/app-settings-BtYDs-Be.js +1 -0
- package/build/assets/automation-detail-BxXhb_m2.js +3 -0
- package/build/assets/{automation-export-DxY47m3T.js → automation-export-BJsfi7n2.js} +1 -1
- package/build/assets/automation-git-sync-B7o_Nbl-.js +1 -0
- package/build/assets/automation-setup-route-qaJ6lLCf.js +3 -0
- package/build/assets/{automation-templates-4C4PM8K7.js → automation-templates-Bb98r-kx.js} +1 -1
- package/build/assets/automations-list-DEPVNud3.js +1 -0
- package/build/assets/{back-nav-button-B8tH0BEp.js → back-nav-button-B2yBiVMB.js} +1 -1
- package/build/assets/backend-form-modal-DxisQV_6.js +1 -0
- package/build/assets/backend-synced-settings-badge-DLEp6cq7.js +1 -0
- package/build/assets/badge-ehL-kgeO.js +1 -0
- package/build/assets/{base-modal-DTULovNc.js → base-modal-C1a0TsSx.js} +1 -1
- package/build/assets/{bot-CLMxGFaq.js → bot-ByolqPEr.js} +1 -1
- package/build/assets/{brand-button-DxPO4Lf8.js → brand-button-CUMfjb99.js} +1 -1
- package/build/assets/{browser-C-_qBasq.js → browser-SE24Tk8g.js} +6 -6
- package/build/assets/browser-tab-HjJxHA0V.js +1 -0
- package/build/assets/canvas-extension-page-BsUGBb1T.js +1 -0
- package/build/assets/canvas-extensions-C9Tm6s_E.js +1 -0
- package/build/assets/{canvas-extensions-runtime-DdnkgJXV.js → canvas-extensions-runtime-B8kxM4rO.js} +1 -1
- package/build/assets/{chat-send-button-B3SFSIg5.js → chat-send-button-CGvc2wpE.js} +1 -1
- package/build/assets/check-Bo8s5Ylg.js +1 -0
- package/build/assets/chevron-down-Cr6Fn_wS.js +1 -0
- package/build/assets/chevron-right-CfdfRn-8.js +1 -0
- package/build/assets/circle-check-5pH3qCji.js +1 -0
- package/build/assets/circle-plus-check-toggle-BDX_ctNs.js +1 -0
- package/build/assets/{cloud-funnel-analytics-BQanUEEC.js → cloud-funnel-analytics-D5uJ_4JE.js} +1 -1
- package/build/assets/{cog-VBlRo6iw.js → cog-CAEugqtV.js} +1 -1
- package/build/assets/command-menu-CQxs4mtX.js +1 -0
- package/build/assets/commits-tab-D0xgjipP.js +1 -0
- package/build/assets/{condenser-settings-eVKFMvap.js → condenser-settings-D63NJRBT.js} +1 -1
- package/build/assets/confirmation-modal-78sd9Vny.js +1 -0
- package/build/assets/{context-menu-list-item-DDROe12Z.js → context-menu-list-item-Cm7-7Y-7.js} +1 -1
- package/build/assets/{conversation-BnjJSFf5.js → conversation-B_nweu5p.js} +8 -8
- package/build/assets/conversation-edjzrv5w.js +1 -0
- package/build/assets/conversation-panel-edjzrv5w.js +1 -0
- package/build/assets/conversation-state-store-9D_3P7q4.js +1 -0
- package/build/assets/conversation-store-DC-JlJuq.js +6 -0
- package/build/assets/{conversation-tab-empty-state-DKlzAz5c.js → conversation-tab-empty-state-B3dpJXX0.js} +1 -1
- package/build/assets/copy-to-clipboard-button-B1ljgNxO.js +1 -0
- package/build/assets/device-verify-D5QRIS_x.js +1 -0
- package/build/assets/{dropdown-classes-B9kJVDIk.js → dropdown-classes-BGvOvW2_.js} +1 -1
- package/build/assets/edit-automation-modal-D_JWSmxT.js +1 -0
- package/build/assets/empty-state-FK_s1B60.js +1 -0
- package/build/assets/{entry.client-Ds8LVp-E.js → entry.client-BMafTpjO.js} +2 -2
- package/build/assets/enum-filter-dropdown-UNaom12H.js +1 -0
- package/build/assets/environment-switch-overlay-COibRUA-.js +1 -0
- package/build/assets/error-state-Cf8LRuuY.js +1 -0
- package/build/assets/extensions-hub-C_6ahIua.js +1 -0
- package/build/assets/extensions-navigation-C5GfpzFe.js +1 -0
- package/build/assets/{external-link-DQtv7eTh.js → external-link-Bd7Tga-1.js} +1 -1
- package/build/assets/files-tab-D5PPIWI1.js +1 -0
- package/build/assets/{form-control-classes-B-z85REi.js → form-control-classes-Dbq-7YP_.js} +1 -1
- package/build/assets/format-model-name-Dfh9Udrx.js +1 -0
- package/build/assets/get-git-path-jU2zjqIB.js +1 -0
- package/build/assets/git-repo-dropdown-BoDDWXfX.js +1 -0
- package/build/assets/git-repo-dropdown-uxlFw2gn.js +1 -0
- package/build/assets/highlighted-source-view-C7pAXrT0.js +1 -0
- package/build/assets/home-BM5_Wz_R.js +1 -0
- package/build/assets/home-Ivfm7KC4.js +1 -0
- package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +1 -0
- package/build/assets/home-store-DCbei3DX.js +1 -0
- package/build/assets/hooks-service-Dnmhqc0Z.js +1 -0
- package/build/assets/index-home-td9BN2T3.js +1 -0
- package/build/assets/info-BcajzHn1.js +1 -0
- package/build/assets/install-server-modal-B81I-5OE.js +1 -0
- package/build/assets/kebab-menu-item-content-SCJBwZnp.js +1 -0
- package/build/assets/{key-CfXbJa8w.js → key-O84CMFHb.js} +1 -1
- package/build/assets/launch-ZLxI4opd.js +1 -0
- package/build/assets/list-filter-B8PQk3RA.js +1 -0
- package/build/assets/{list-todo-ByXMdY4W.js → list-todo-Caa8E1X_.js} +1 -1
- package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +27 -0
- package/build/assets/llm-settings-CODhjQzy.js +1 -0
- package/build/assets/llm-settings-CZaXYgtw.js +1 -0
- package/build/assets/{llm-subscription-service-aDNBQ7Gq.js → llm-subscription-service-CgIDc38n.js} +1 -1
- package/build/assets/loader-circle-BxJgk73D.js +1 -0
- package/build/assets/{loading-spinner-DfHI77BA.js → loading-spinner-BeLV0IXf.js} +1 -1
- package/build/assets/manage-backends-modal-cMXqCb-B.js +1 -0
- package/build/assets/manifest-bfeccb98.js +1 -0
- package/build/assets/manifest-subpage-layout-CVZgVKoY.js +1 -0
- package/build/assets/{map-provider-DXvssjw9.js → map-provider-iRs80q_6.js} +1 -1
- package/build/assets/markdown-renderer-DyFl9-mL.js +8 -0
- package/build/assets/mcp-CraxoXQv.js +1 -0
- package/build/assets/{mcp-marketplace-utils-Cn_NIMWM.js → mcp-marketplace-utils-C7PYr293.js} +1 -1
- package/build/assets/mcp-page-CteH_K0N.js +9 -0
- package/build/assets/messages-Bk1xhbU2.js +41 -0
- package/build/assets/{modal-body-DJw4xBki.js → modal-body-C24WsdFb.js} +1 -1
- package/build/assets/{modal-classes-Dg0ngBPO.js → modal-classes-B0b9eiL8.js} +1 -1
- package/build/assets/modal-close-button-DfqfB2Nj.js +1 -0
- package/build/assets/{mouse-pointer-click-DEhsSUpu.js → mouse-pointer-click-BXlRN92t.js} +1 -1
- package/build/assets/onboarding-DXFBRqEy.js +1 -0
- package/build/assets/onboarding-modal-BT3Gx_sZ.js +1 -0
- package/build/assets/{organization-service.api-Cyg1Tn03.js → organization-service.api-B5CvmnYQ.js} +1 -1
- package/build/assets/{pencil-D5c47kyN.js → pencil-q-ihqDYv.js} +1 -1
- package/build/assets/{pin-C7vMagvf.js → pin-BdroVQdN.js} +1 -1
- package/build/assets/planner-tab-CstoOlAB.js +1 -0
- package/build/assets/{plug-CeaqeF6u.js → plug-7ACOEbMs.js} +1 -1
- package/build/assets/{plugins-management-service-Bh_pBuf-.js → plugins-management-service-5rqVPEGN.js} +1 -1
- package/build/assets/plus-C2e21TFC.js +1 -0
- package/build/assets/{profiles-service.api-BbOK0EkF.js → profiles-service.api-D1XKMgr0.js} +1 -1
- package/build/assets/providers-XmZ9HM4Q.js +1 -0
- package/build/assets/proxy-XP6U1Dhv.js +1 -0
- package/build/assets/{puzzle-DdAqbUrb.js → puzzle-LJYnuxKe.js} +1 -1
- package/build/assets/react-BX7IV650.js +1 -0
- package/build/assets/recommended-automations-launcher-DEHRKIAg.js +1 -0
- package/build/assets/{refresh-cw-DEQdPCpH.js → refresh-cw-BtdC3T8P.js} +1 -1
- package/build/assets/root-CM6IZHlg.css +1 -0
- package/build/assets/root-DdFkodKW.js +2 -0
- package/build/assets/root-layout-DUquNZTU.js +2 -0
- package/build/assets/schema-field-Y3F8JvXd.js +1 -0
- package/build/assets/sdk-section-page-CNZTLwH9.js +1 -0
- package/build/assets/secret-form-9-BoGA40.js +1 -0
- package/build/assets/{secrets-service-Cr8g8xuv.js → secrets-service-BOIsfD9j.js} +1 -1
- package/build/assets/secrets-settings-CBJgFr42.js +1 -0
- package/build/assets/settings-D4hdToD4.js +1 -0
- package/build/assets/settings-dropdown-input-DBvsZ7-Q.js +1 -0
- package/build/assets/settings-index-DeQphyBK.js +1 -0
- package/build/assets/settings-input-dVuzapBA.js +1 -0
- package/build/assets/{settings-list-classes-Ds4jPBHK.js → settings-list-classes-DhAPuXm6.js} +1 -1
- package/build/assets/settings-modal-tHiJ8iYV.js +1 -0
- package/build/assets/settings-nav-GAQjW1a-.js +16 -0
- package/build/assets/{settings-service.api-9_xdv_mh.js → settings-service.api-C1vZH9Vh.js} +1 -1
- package/build/assets/settings-switch-DDd1cQ8t.js +1 -0
- package/build/assets/{settings-utils-8GIIgOQL.js → settings-utils-BTaaRhLZ.js} +1 -1
- package/build/assets/shared-conversation-Cyg7m7ns.js +1 -0
- package/build/assets/{shield-check-DO7wa_eu.js → shield-check-C3Rl0NF8.js} +1 -1
- package/build/assets/{sidebar-layout-EPfWxk11.js → sidebar-layout-DH0E-5KW.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-CQ4iky__.js +1 -0
- package/build/assets/{sidebar-nav-link-_t4_Ef-9.js → sidebar-nav-link-oLQiKUBu.js} +1 -1
- package/build/assets/{sidebar-onboarding-checklist-storage-DbDX-Wvj.js → sidebar-onboarding-checklist-storage-TfvNNnnr.js} +1 -1
- package/build/assets/sidebar-store-DAZVH-DR.js +1 -0
- package/build/assets/skill-card-pill-row-DfjIfj0K.js +1 -0
- package/build/assets/{skill-filter-BBeZ4JEP.js → skill-filter-DsNLmn76.js} +2 -2
- package/build/assets/{skill-icon-badge-BDhQ-tQ0.js → skill-icon-badge-0MK_68Nc.js} +1 -1
- package/build/assets/skill-scope-BE-H9TSZ.js +1 -0
- package/build/assets/skills-plugins-vzSdxSk_.js +1 -0
- package/build/assets/skills-settings-BiPOH9H9.js +1 -0
- package/build/assets/{styled-tooltip-Pd22BIvr.js → styled-tooltip-CejG0rqv.js} +1 -1
- package/build/assets/task-list-tab-OkZSqnTp.js +1 -0
- package/build/assets/{terminal-onXx0_Qz.js → terminal-Dph60VFZ.js} +1 -1
- package/build/assets/{toggle-switch-lwQtxDcm.js → toggle-switch-B2uXaAUS.js} +1 -1
- package/build/assets/{trash-2-ZhKuTLiz.js → trash-2-Bb40zQzs.js} +1 -1
- package/build/assets/trash-Ckh7yCaB.js +1 -0
- package/build/assets/{triangle-alert-BajLPpQg.js → triangle-alert-DEdu-b_L.js} +1 -1
- package/build/assets/{typography-HLLg_FAn.js → typography-DgcLGdHk.js} +1 -1
- package/build/assets/usage-tab-MCmNRAnR.js +1 -0
- package/build/assets/use-acp-credential-form-ychoGqjC.js +1 -0
- package/build/assets/{use-activate-agent-profile-BLKML6vQ.js → use-activate-agent-profile-8L8Xdghy.js} +1 -1
- package/build/assets/use-agent-profiles-Bi8hSkze.js +1 -0
- package/build/assets/{use-automation-health-BZkQNEA8.js → use-automation-health-U99vvHxx.js} +1 -1
- package/build/assets/{use-automation-permissions-B_RpvL-s.js → use-automation-permissions-Buus0R6h.js} +1 -1
- package/build/assets/{use-automations-Cg0PDIZr.js → use-automations-Bq5hVuv0.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BbN6KfDr.js → use-can-manage-org-profiles-MzIeEV8F.js} +1 -1
- package/build/assets/{use-canvas-extensions-CFUpHat6.js → use-canvas-extensions-Ca9KoVEm.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-Dk0rjr63.js → use-cloud-current-user-id-B4ZLUZSa.js} +1 -1
- package/build/assets/{use-config-DpafU_QP.js → use-config-l5tkDHyD.js} +1 -1
- package/build/assets/{use-create-conversation-1YgmAHt-.js → use-create-conversation-i_PdFdIs.js} +1 -1
- package/build/assets/use-create-secret-CjWq0J4O.js +1 -0
- package/build/assets/use-free-models-gCsJ5BV0.js +1 -0
- package/build/assets/{use-get-secrets-CQ4b0qK8.js → use-get-secrets-CMTuWEp_.js} +1 -1
- package/build/assets/use-is-authed-A2Yinlt0.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-DeYa1tFM.js → use-launch-skill-in-chat-QbXDhiHr.js} +1 -1
- package/build/assets/use-llm-configured-Dl4zg8ht.js +1 -0
- package/build/assets/use-llm-profiles-SWsuFmFu.js +1 -0
- package/build/assets/{use-manifest-capabilities-AOWGcu0j.js → use-manifest-capabilities-CdqYfUAC.js} +1 -1
- package/build/assets/{use-onboarding-completion-CoINurkm.js → use-onboarding-completion-Xl63ZvzQ.js} +1 -1
- package/build/assets/{use-pinned-home-route-D6krwXjy.js → use-pinned-home-route-BXDIUaxQ.js} +1 -1
- package/build/assets/{use-plugins-marketplace-mLsIDhBv.js → use-plugins-marketplace-BIIaPiaB.js} +1 -1
- package/build/assets/use-save-agent-profile-D-ZHHE94.js +1 -0
- package/build/assets/{use-save-settings-3U5K9-8x.js → use-save-settings-Dapkf4cC.js} +1 -1
- package/build/assets/{use-settings-Dn00UISA.js → use-settings-C2KKQKVC.js} +1 -1
- package/build/assets/use-settings-nav-items-TOc0Rsfd.js +1 -0
- package/build/assets/{use-tracking-B9prBsrq.js → use-tracking-j4uo9VEW.js} +1 -1
- package/build/assets/{use-user-conversation-ZWlXtbZb.js → use-user-conversation-5UFqMoO4.js} +1 -1
- package/build/assets/{useInfiniteQuery-BzrRqjLg.js → useInfiniteQuery-CtSRG7uW.js} +1 -1
- package/build/assets/{useMutation-CJuK90oc.js → useMutation-Cszf8mKy.js} +1 -1
- package/build/assets/useQueries-pUohFMSP.js +1 -0
- package/build/assets/useQuery-DAAacS7O.js +1 -0
- package/build/assets/useTranslation-CCgUjPJF.js +1 -0
- package/build/assets/utils-BgLSZdyy.js +1 -0
- package/build/assets/{vendor~conversation-panel~conversation-4eJ0tml3.js → vendor~conversation-panel~conversation-C22sJuWZ.js} +1 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js +185 -0
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js +1 -0
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-CSFLzmTN.js → vendor~index-home~home~conversation-panel~conversation-UTl7gUo9.js} +1 -1
- package/build/assets/{vendor~root-layout-n8XCEXG8.js → vendor~root-layout-CcdIqs-C.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-3Idg1_U3.js → vendor~root-layout~conversation-panel~conversation-C3EBV3kp.js} +1 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js +1 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-DgQ564nC.js → vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js} +1 -1
- package/build/assets/{verification-settings-u2POabjH.js → verification-settings-DdBpaVPz.js} +1 -1
- package/build/assets/{wrench-CkgI4rxA.js → wrench-B8Wg_nbp.js} +1 -1
- package/build/assets/{x-By6qCmtY.js → x-CX8lVGwm.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +6 -2
- package/build/locales/ca/openhands.json +6 -2
- package/build/locales/de/openhands.json +6 -2
- package/build/locales/en/openhands.json +6 -2
- package/build/locales/es/openhands.json +6 -2
- package/build/locales/fr/openhands.json +6 -2
- package/build/locales/it/openhands.json +6 -2
- package/build/locales/ja/openhands.json +6 -2
- package/build/locales/ko-KR/openhands.json +6 -2
- package/build/locales/no/openhands.json +6 -2
- package/build/locales/pt/openhands.json +6 -2
- package/build/locales/tr/openhands.json +6 -2
- package/build/locales/uk/openhands.json +6 -2
- package/build/locales/zh-CN/openhands.json +6 -2
- package/build/locales/zh-TW/openhands.json +6 -2
- package/config/defaults.json +1 -1
- package/dist/api/cloud/organization-service.api.cjs.map +1 -1
- package/dist/api/cloud/organization-service.api.d.ts +9 -1
- package/dist/api/cloud/organization-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.api.cjs +1 -1
- package/dist/api/config-service/config-service.api.cjs.map +1 -1
- package/dist/api/config-service/config-service.api.js +6 -2
- package/dist/api/config-service/config-service.api.js.map +1 -1
- package/dist/api/config-service/config-service.types.d.ts +13 -0
- package/dist/components/features/automations/automation-card.cjs +1 -1
- package/dist/components/features/automations/automation-card.cjs.map +1 -1
- package/dist/components/features/automations/automation-card.js +39 -38
- package/dist/components/features/automations/automation-card.js.map +1 -1
- package/dist/components/features/automations/automation-list-row.cjs +1 -1
- package/dist/components/features/automations/automation-list-row.cjs.map +1 -1
- package/dist/components/features/automations/automation-list-row.js +73 -72
- package/dist/components/features/automations/automation-list-row.js.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs +1 -1
- package/dist/components/features/automations/build-automation-menu-items.cjs.map +1 -1
- package/dist/components/features/automations/build-automation-menu-items.d.ts +3 -1
- package/dist/components/features/automations/build-automation-menu-items.js +12 -11
- package/dist/components/features/automations/build-automation-menu-items.js.map +1 -1
- package/dist/components/features/automations/detail/configuration-section.d.ts +7 -1
- package/dist/components/features/automations/detail/detail-header.d.ts +8 -5
- package/dist/components/features/backends/backend-selector.cjs +1 -1
- package/dist/components/features/backends/backend-selector.cjs.map +1 -1
- package/dist/components/features/backends/backend-selector.js +112 -112
- package/dist/components/features/backends/backend-selector.js.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.cjs.map +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js +62 -61
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.js.map +1 -1
- package/dist/components/features/chat/model-messages.cjs +1 -1
- package/dist/components/features/chat/model-messages.cjs.map +1 -1
- package/dist/components/features/chat/model-messages.js +27 -26
- package/dist/components/features/chat/model-messages.js.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs +1 -1
- package/dist/components/features/conversation-panel/budget-display.cjs.map +1 -1
- package/dist/components/features/conversation-panel/budget-display.d.ts +1 -2
- package/dist/components/features/conversation-panel/budget-display.js +12 -19
- package/dist/components/features/conversation-panel/budget-display.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +45 -44
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/home/featured-automations/build-home-automation-menu-items.d.ts +1 -2
- package/dist/components/features/home/featured-automations/build-pinned-automation-menu-items.d.ts +0 -1
- package/dist/components/features/images/image-lightbox.cjs +2 -0
- package/dist/components/features/images/image-lightbox.cjs.map +1 -0
- package/dist/components/features/images/image-lightbox.d.ts +11 -0
- package/dist/components/features/images/image-lightbox.js +37 -0
- package/dist/components/features/images/image-lightbox.js.map +1 -0
- package/dist/components/features/images/image-preview.cjs +1 -1
- package/dist/components/features/images/image-preview.cjs.map +1 -1
- package/dist/components/features/images/image-preview.d.ts +2 -1
- package/dist/components/features/images/image-preview.js +33 -13
- package/dist/components/features/images/image-preview.js.map +1 -1
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +3 -4
- package/dist/components/features/settings/cloud-settings-link.cjs +1 -1
- package/dist/components/features/settings/cloud-settings-link.cjs.map +1 -1
- package/dist/components/features/settings/cloud-settings-link.d.ts +3 -1
- package/dist/components/features/settings/cloud-settings-link.js +22 -21
- package/dist/components/features/settings/cloud-settings-link.js.map +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -1
- package/dist/components/features/settings/llm-profiles/profile-row.cjs +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.js +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +2 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +143 -142
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +28 -27
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.js +33 -29
- package/dist/components/providers/agent-server-ui-providers.js.map +1 -1
- package/dist/components/shared/buttons/remove-button.cjs +1 -1
- package/dist/components/shared/buttons/remove-button.cjs.map +1 -1
- package/dist/components/shared/buttons/remove-button.d.ts +2 -1
- package/dist/components/shared/buttons/remove-button.js +2 -1
- package/dist/components/shared/buttons/remove-button.js.map +1 -1
- package/dist/components/shared/free-models-note.cjs +2 -0
- package/dist/components/shared/free-models-note.cjs.map +1 -0
- package/dist/components/shared/free-models-note.d.ts +3 -0
- package/dist/components/shared/free-models-note.js +20 -0
- package/dist/components/shared/free-models-note.js.map +1 -0
- package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
- package/dist/components/shared/modals/settings/model-selector.cjs.map +1 -1
- package/dist/components/shared/modals/settings/model-selector.js +102 -112
- package/dist/components/shared/modals/settings/model-selector.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/acp-providers.cjs.map +1 -1
- package/dist/constants/acp-providers.d.ts +12 -0
- package/dist/constants/acp-providers.js.map +1 -1
- package/dist/hooks/chat/use-slash-command.cjs +1 -1
- package/dist/hooks/chat/use-slash-command.cjs.map +1 -1
- package/dist/hooks/chat/use-slash-command.js +63 -62
- package/dist/hooks/chat/use-slash-command.js.map +1 -1
- package/dist/hooks/query/use-free-models.cjs +2 -0
- package/dist/hooks/query/use-free-models.cjs.map +1 -0
- package/dist/hooks/query/use-free-models.d.ts +23 -0
- package/dist/hooks/query/use-free-models.js +67 -0
- package/dist/hooks/query/use-free-models.js.map +1 -0
- package/dist/hooks/query/use-local-git-info.cjs.map +1 -1
- package/dist/hooks/query/use-local-git-info.js.map +1 -1
- package/dist/hooks/query/use-provider-models.cjs +1 -1
- package/dist/hooks/query/use-provider-models.cjs.map +1 -1
- package/dist/hooks/query/use-provider-models.js +34 -25
- package/dist/hooks/query/use-provider-models.js.map +1 -1
- package/dist/hooks/query/use-search-providers.cjs +1 -1
- package/dist/hooks/query/use-search-providers.cjs.map +1 -1
- package/dist/hooks/query/use-search-providers.js +31 -19
- package/dist/hooks/query/use-search-providers.js.map +1 -1
- package/dist/hooks/use-home-automation-actions.cjs +1 -1
- package/dist/hooks/use-home-automation-actions.cjs.map +1 -1
- package/dist/hooks/use-home-automation-actions.d.ts +1 -2
- package/dist/hooks/use-home-automation-actions.js +0 -1
- package/dist/hooks/use-home-automation-actions.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 +6 -2
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +85 -17
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +6 -2
- package/dist/locales/ca/openhands.json +6 -2
- package/dist/locales/de/openhands.json +6 -2
- package/dist/locales/en/openhands.json +6 -2
- package/dist/locales/es/openhands.json +6 -2
- package/dist/locales/fr/openhands.json +6 -2
- package/dist/locales/it/openhands.json +6 -2
- package/dist/locales/ja/openhands.json +6 -2
- package/dist/locales/ko-KR/openhands.json +6 -2
- package/dist/locales/no/openhands.json +6 -2
- package/dist/locales/pt/openhands.json +6 -2
- package/dist/locales/tr/openhands.json +6 -2
- package/dist/locales/uk/openhands.json +6 -2
- package/dist/locales/zh-CN/openhands.json +6 -2
- package/dist/locales/zh-TW/openhands.json +6 -2
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +52 -47
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +137 -145
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/stores/free-models-store.cjs +2 -0
- package/dist/stores/free-models-store.cjs.map +1 -0
- package/dist/stores/free-models-store.d.ts +30 -0
- package/dist/stores/free-models-store.js +22 -0
- package/dist/stores/free-models-store.js.map +1 -0
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +27 -6
- package/dist/utils/format-model-name.js +14 -6
- package/dist/utils/format-model-name.js.map +1 -1
- package/package.json +1 -1
- package/build/assets/active-backend-context-rZiLJRUc.js +0 -2
- package/build/assets/agent-profiles-settings-x6RvPsq7.js +0 -1
- package/build/assets/agent-server-client-options-BikiNwTa.js +0 -1
- package/build/assets/agent-server-conversation-service.api-DYFsNHKf.js +0 -88
- package/build/assets/agent-settings-BJyovpJ_.js +0 -1
- package/build/assets/alert-banner-vARz1idS.js +0 -1
- package/build/assets/api-key-entry-screen-CsMuBhoP.js +0 -1
- package/build/assets/app-settings-BaJ7nfHt.js +0 -1
- package/build/assets/automation-detail-CVoGDrKq.js +0 -3
- package/build/assets/automation-git-sync-CRMP9Bbm.js +0 -1
- package/build/assets/automation-setup-route-072beLz1.js +0 -3
- package/build/assets/automations-list-xuqTSQL4.js +0 -1
- package/build/assets/backend-form-modal-0aJmWdsa.js +0 -1
- package/build/assets/backend-synced-settings-badge-B7rKWBir.js +0 -1
- package/build/assets/badge-CcGx2TaV.js +0 -1
- package/build/assets/browser-tab-DZanIw5m.js +0 -1
- package/build/assets/canvas-extension-page-o_cWgE9B.js +0 -1
- package/build/assets/canvas-extensions-DSgNlCha.js +0 -1
- package/build/assets/check-fDEfgSzj.js +0 -1
- package/build/assets/chevron-down-CFrWHqu8.js +0 -1
- package/build/assets/chevron-right-C5roOrJu.js +0 -1
- package/build/assets/circle-check-ClTzJTdb.js +0 -1
- package/build/assets/circle-plus-check-toggle-Fr-h-mbL.js +0 -1
- package/build/assets/command-menu-BT3Ia5Ru.js +0 -1
- package/build/assets/commits-tab-2jhtaohl.js +0 -1
- package/build/assets/confirmation-modal-gIFHeZt6.js +0 -1
- package/build/assets/conversation-DZ578rOX.js +0 -1
- package/build/assets/conversation-panel-DZ578rOX.js +0 -1
- package/build/assets/conversation-state-store-D1_G_9I-.js +0 -1
- package/build/assets/conversation-store-DVVfkCsk.js +0 -6
- package/build/assets/copy-to-clipboard-button-B3w0X7WH.js +0 -1
- package/build/assets/device-verify-BfkCzyFB.js +0 -1
- package/build/assets/edit-automation-modal-BwhJ39JT.js +0 -1
- package/build/assets/empty-state-RZz0OfnY.js +0 -1
- package/build/assets/enum-filter-dropdown-C4pW0ORd.js +0 -1
- package/build/assets/environment-switch-overlay-P2ZAuzov.js +0 -1
- package/build/assets/error-state-B_5cgNPJ.js +0 -1
- package/build/assets/extensions-hub-DsaUr4ca.js +0 -1
- package/build/assets/extensions-navigation-CRMZd-FE.js +0 -1
- package/build/assets/files-tab-CCgAcVdc.js +0 -1
- package/build/assets/format-model-name-CasAP3nd.js +0 -1
- package/build/assets/get-git-path-EHrSDxTM.js +0 -1
- package/build/assets/git-repo-dropdown-D2WEQ97X.js +0 -1
- package/build/assets/git-repo-dropdown-DVeCUUXG.js +0 -1
- package/build/assets/highlighted-source-view-DjHO3SdW.js +0 -1
- package/build/assets/home-BorS_vdS.js +0 -1
- package/build/assets/home-aIMbHw5M.js +0 -1
- package/build/assets/home-automation-run-tooltip-CpHNFiFl.js +0 -1
- package/build/assets/home-store-DyXz0w6d.js +0 -1
- package/build/assets/hooks-service-C6dpRtZM.js +0 -1
- package/build/assets/index-home-zKFuKK2B.js +0 -1
- package/build/assets/info-CTIdjttz.js +0 -1
- package/build/assets/install-server-modal-DUiZMc8u.js +0 -1
- package/build/assets/kebab-menu-item-content-mm04SBD3.js +0 -1
- package/build/assets/launch-BSIf9KEg.js +0 -1
- package/build/assets/list-filter-CNpqTWVY.js +0 -1
- package/build/assets/llm-not-configured-banner-z_QRSeV0.js +0 -27
- package/build/assets/llm-settings-B-5AHMiX.js +0 -1
- package/build/assets/llm-settings-B3SjHDmA.js +0 -1
- package/build/assets/loader-circle-Dex47vVW.js +0 -1
- package/build/assets/manage-backends-modal-q1NdFisr.js +0 -1
- package/build/assets/manifest-8920b615.js +0 -1
- package/build/assets/manifest-subpage-layout-BQQy5ipR.js +0 -1
- package/build/assets/markdown-renderer-rivLvYh-.js +0 -8
- package/build/assets/mcp-CEXDhQWn.js +0 -1
- package/build/assets/mcp-page-LGYIICMG.js +0 -9
- package/build/assets/messages-DUSeANAh.js +0 -41
- package/build/assets/modal-close-button-B9j4nasm.js +0 -1
- package/build/assets/onboarding-BjFebfs5.js +0 -1
- package/build/assets/onboarding-modal-DDTjOpyd.js +0 -1
- package/build/assets/planner-tab-D8f2Y3rn.js +0 -1
- package/build/assets/plus-B3wvU06-.js +0 -1
- package/build/assets/providers-2gIIkz2N.js +0 -1
- package/build/assets/proxy-CBgMd2zf.js +0 -1
- package/build/assets/recommended-automations-launcher-YLAQTp4s.js +0 -1
- package/build/assets/root-Bye_XmEL.js +0 -2
- package/build/assets/root-Cnwwzgo0.css +0 -1
- package/build/assets/root-layout-CSAwxBGM.js +0 -2
- package/build/assets/schema-field-CK0xYNbO.js +0 -1
- package/build/assets/sdk-section-page-Da73Rs_o.js +0 -1
- package/build/assets/secret-form-CB2VwYYg.js +0 -1
- package/build/assets/secrets-settings-Bh0udeKv.js +0 -1
- package/build/assets/settings-DmyIgRxO.js +0 -1
- package/build/assets/settings-dropdown-input-DVpyD87C.js +0 -1
- package/build/assets/settings-index-BSJUFmjE.js +0 -1
- package/build/assets/settings-input-C0dd8Utu.js +0 -1
- package/build/assets/settings-modal-yStgEh2o.js +0 -1
- package/build/assets/settings-switch-B78Khmyz.js +0 -1
- package/build/assets/shared-conversation-DM96X4KV.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-D5GR5xT9.js +0 -1
- package/build/assets/sidebar-store-CSDFK0W5.js +0 -1
- package/build/assets/skill-card-pill-row-989y15jV.js +0 -1
- package/build/assets/skill-scope-Dz3kPH3P.js +0 -1
- package/build/assets/skills-plugins-e3CYGdUJ.js +0 -1
- package/build/assets/skills-settings-3e-FuHw_.js +0 -1
- package/build/assets/task-list-tab-3Jg8ywch.js +0 -1
- package/build/assets/trash-B6OIe4yX.js +0 -1
- package/build/assets/usage-tab-Cm-9j3UK.js +0 -1
- package/build/assets/use-acp-credential-form-BARcvjYE.js +0 -1
- package/build/assets/use-agent-profiles-1P91KSXz.js +0 -1
- package/build/assets/use-create-secret-D8p9ybQj.js +0 -1
- package/build/assets/use-is-authed-BRPjCRKM.js +0 -1
- package/build/assets/use-llm-configured-DGm8FiRR.js +0 -1
- package/build/assets/use-llm-profiles-BTTtpW4z.js +0 -1
- package/build/assets/use-save-agent-profile-CxyO9YG-.js +0 -1
- package/build/assets/use-settings-nav-items-vrjxTqcu.js +0 -16
- package/build/assets/useQueries-CykmpT-a.js +0 -1
- package/build/assets/useQuery-S6j94er1.js +0 -1
- package/build/assets/utils-BOco8mxR.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js +0 -185
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js +0 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js +0 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Ck5D_A2Q.js";import{r as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{i as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";import{t as l}from"./useMutation-CJuK90oc.js";import{t as u}from"./useQuery-S6j94er1.js";import{t as d}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js";import{gt as f,n as p,st as m}from"./active-backend-context-rZiLJRUc.js";import{K as h,O as g,k as _,t as v,z as y}from"./utils-BOco8mxR.js";import{a as b,c as x,f as ee,g as te,n as ne}from"./agent-server-client-options-BikiNwTa.js";import{t as S}from"./chevron-down-CFrWHqu8.js";import{t as C}from"./chevron-right-C5roOrJu.js";import{t as re}from"./loader-circle-Dex47vVW.js";import{v as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{i as w}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{t as T}from"./proxy-CBgMd2zf.js";import{t as E}from"./use-config-DpafU_QP.js";import{n as ae}from"./use-settings-Dn00UISA.js";import{n as oe,o as se}from"./form-control-classes-B-z85REi.js";import{n as ce}from"./navigation-context-CQZwH_tC.js";import{ot as D,st as le}from"./vendor-markdown-j0kYzV48.js";import{t as ue}from"./styled-tooltip-Pd22BIvr.js";import{_ as de,t as fe}from"./conversation-store-DVVfkCsk.js";import{d as pe,m as me,t as he,x as ge}from"./agent-server-conversation-service.api-DYFsNHKf.js";import{_ as _e,a as ve,h as ye,o as be,p as xe,r as Se,s as Ce}from"./conversation-state-store-D1_G_9I-.js";import{n as we}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{t as Te}from"./skills-B0IliMxw.js";import{r as Ee}from"./format-model-name-CasAP3nd.js";import{t as De}from"./close-ScPlnwyq.js";import{t as Oe}from"./copy-to-clipboard-button-B3w0X7WH.js";import{r as O}from"./typography-HLLg_FAn.js";import{t as ke}from"./u-check-circle-BKn1spCL.js";import{$ as Ae,A as je,D as Me,F as Ne,G as Pe,H as Fe,K as Ie,L as Le,M as Re,N as ze,P as k,S as Be,T as Ve,V as He,W as A,Y as Ue,a as We,b as j,c as Ge,et as Ke,i as qe,j as Je,n as Ye,o as Xe,r as Ze,rt as M,t as N,tt as Qe,v as $e,y as et,z as tt}from"./markdown-renderer-rivLvYh-.js";import{t as nt}from"./syntax-highlighter-BGDg_7w9.js";import{n as rt,t as it}from"./get-git-path-EHrSDxTM.js";var at=c(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(r(),1);function ot(){!t.current&&i();let[e]=(0,P.useState)(n.current);return e}var F=a(),st=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(st||{});function ct(){let{conversationId:e}=M(),t=Ge();return{send:(0,P.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function lt(e,t,n,r){return{action:st.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),L=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function ut({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(we,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function dt(e,t){if(!e)return null;let n=/(?:Z|[+-]\d{2}:?\d{2})$/i.test(e)?e:`${e}Z`,r=new Date(n);return Number.isNaN(r.getTime())?null:r.toLocaleString(t,{dateStyle:`medium`,timeStyle:`short`})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o,timestamp:c}){let{t:l,i18n:u}=s(`openhands`),[d,f]=P.useState(r),[p,m]=P.useState(!1),[g,_]=P.useState(!1),y=dt(c,u?.language),b=t?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{f(e=>!e),e.detail>0&&(m(!1),e.currentTarget.blur())},className:`cursor-pointer text-left`,"aria-label":l(d?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:d?(0,F.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null,x=(0,F.jsxs)(`div`,{"data-testid":`generic-event-message-title`,className:`flex items-center`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocusCapture:()=>_(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||_(!1)},children:[i===`before`&&b,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&b]});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[y?(0,F.jsx)(ue,{content:(0,F.jsx)(`time`,{dateTime:c,children:y}),placement:`top`,isOpen:p||g,children:x}):x,(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(ut,{status:n})]})]}),d&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var ft=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),pt=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),mt={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function ht({status:e}){let{t}=s(`openhands`),{conversationId:n}=M(),r=Be(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:c,iteration:l,max_iterations:u,verdict:d}=e,f=d?Math.round(d.score*100):null,p=d?.missing?t(h.GOAL$MISSING,{missing:d.missing}):``,g=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},_=()=>g(async e=>{await _e(e),await xe(e)},h.GOAL$STOP_FAILED),y=()=>g(ye,h.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:_,className:v(oe,se),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:y,className:v(oe,se),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:c}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:l,max:u})}),(0,F.jsx)(`span`,{children:t(mt[e.status])}),f!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:f})}),o?(0,F.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,F.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,F.jsx)(ft,{className:`w-3.5 h-3.5 fill-success`})}):(0,F.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,F.jsx)(pt,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var gt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,F.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,F.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function _t({profile:e}){let[t,n]=P.useState(!1),r=Ee(e.model);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,F.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,F.jsx)(S,{size:14}):(0,F.jsx)(C,{size:14})}),(0,F.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-neutral-700`}),(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${r??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function vt({conversationId:e,anchorEventId:t}){let n=et(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,F.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(gt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(d,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(d,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(d,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(d,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(_t,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function yt(e){let[t,n]=(0,P.useState)(!0),[r,i]=(0,P.useState)(!0),a=(0,P.useRef)(0),o=(0,P.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,P.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,P.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var bt=(0,P.createContext)(void 0);function xt({children:e,value:t}){let n=yt(P.useRef(null)),r=t||n;return(0,F.jsx)(bt.Provider,{value:r,children:e})}function St(){let e=(0,P.useContext)(bt);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Ct(){return(0,P.useContext)(bt)}var wt=class{static async executeCommand(e,t,n,r,i=30){let a=x().backend;if(a.kind===`cloud`&&e){let o=await T({backend:a,method:`POST`,hostOverride:b(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new w(ne({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=x().backend;return r.kind===`cloud`&&e?(await T({backend:r,method:`GET`,hostOverride:b(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new ie(ne({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}},Tt=2e3,Et=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function Dt(){return`find . \\( ${Et.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Tt}`}function Ot(e){return e.startsWith(`./`)?e.slice(2):e}function kt(e){let{data:t}=Qe(),n=rt(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),s=u({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await wt.executeCommand(i,a,Dt(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(Ot);return Array.from(new Set(t)).slice(0,Tt)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:s.data,isLoading:s.isLoading}}function At(e){let{conversationId:t}=M(),{data:n}=Qe(),r=rt(),i=n?.selected_repository,a=n?.workspace?.working_dir?.trim(),o=it(i,a),s=o.startsWith(`/`)?o:`/${o}`,c=u({queryKey:[`workspace-files-cloud`,t,s],queryFn:async()=>{let e=(await ge(t,s)).map(Ot).filter(Boolean);return Array.from(new Set(e)).slice(0,Tt)},enabled:e&&r&&!!t,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function jt(){let e=(0,P.useSyncExternalStore)(te,ee,ee).active.backend.kind===`cloud`,t=kt(!e),n=At(e);return e?n:t}var Mt=(0,P.createContext)(!1),Nt=(0,P.createContext)(void 0);function Pt({children:e}){let{data:t}=jt();return(0,F.jsx)(Nt.Provider,{value:t,children:e})}function Ft(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e)){let t=e.map(Ft);return t.some(e=>e===null)?null:t.join(``)}return null}function It(e){let t=(0,P.useContext)(Nt);if(!t?.length||!Se(e))return null;let n=Ce.getCurrentConversation()?.workspace?.working_dir,r=ve(e,n);return r&&t.includes(r)?r:null}function Lt({path:e,className:t,children:n}){let{conversationId:r}=M();return(0,F.jsx)(`button`,{type:`button`,"data-testid":`markdown-file-path-link`,title:e,className:v(t,`cursor-pointer rounded border border-surface-raised bg-surface-raised px-[0.4em] py-[0.2em] font-mono text-foreground hover:underline`),onClick:t=>{t.stopPropagation(),j(e,r)},children:n})}function Rt(e){let{children:t,className:n}=e,r=(0,P.useContext)(Mt),i=/language-(\w+)/.exec(n||``),a=String(t).replace(/\n$/,``),o=String(t).includes(`
|
|
2
|
-
`),s=It(!i&&!o&&!r?a:``);return s?(0,F.jsx)(Lt,{path:s,className:n,children:t}):Ze(e)}function zt(e){let{children:t}=e,n=(0,P.useContext)(Mt),r=Ft(t)?.trim()??``,i=It(n?``:r);return i?(0,F.jsx)(Lt,{path:i,children:t}):(0,F.jsx)(`strong`,{children:t})}function Bt(e){return(0,F.jsx)(Mt.Provider,{value:!0,children:Ye(e)})}var z=1e3,Vt=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,Ht=e=>{switch(e.tool_kind){case`execute`:return`ACTION_MESSAGE$ACP_RUN`;case`edit`:return`ACTION_MESSAGE$ACP_EDIT`;case`read`:return`ACTION_MESSAGE$ACP_READ`;case`fetch`:return`ACTION_MESSAGE$ACP_FETCH`;default:return`ACTION_MESSAGE$ACP_TOOL`}},Ut={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},Wt=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=Ut[n];if(!r)return t;for(let e of r)if(t.length>e.length&&t.startsWith(e)&&/\s/.test(t.charAt(e.length)))return t.slice(e.length).trimStart();return t},Gt=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Kt=e=>e.length>1e3?`${e.slice(0,z)}...`:e,qt=e=>{let t=e.tool_kind,n=e.raw_input,r=e.raw_output,i=e.is_error,a=``;if(t===`execute`&&n&&typeof n==`object`&&`command`in n&&typeof n.command==`string`){let{command:e}=n;a+=`Command: \`${e}\`\n\n`}else if(n!=null&&n!==``){let e=Gt(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Kt(Gt(r).trim()),s=i?`**Error:**`:`Output:`,c=o||f.t(h.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a},B=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,Jt=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Yt=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||Jt(t)?null:t},Xt=e=>{let t=Yt(e);if(t)return{kind:`text`,text:t};let n=e.action.kind;switch(n){case`ExecuteBashAction`:case`TerminalAction`:return{kind:`translation`,key:`ACTION_MESSAGE$RUN`,values:{command:B(e.action.command,80)}};case`FileEditorAction`:case`StrReplaceEditorAction`:return{kind:`translation`,key:e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,values:{path:e.action.path}};case`MCPToolAction`:return{kind:`translation`,key:`ACTION_MESSAGE$CALL_TOOL_MCP`,values:{mcp_tool_name:e.tool_name}};case`InvokeSkillAction`:return{kind:`translation`,key:`ACTION_MESSAGE$INVOKE_SKILL`,values:{name:e.action.name}};case`TaskAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK`,values:{name:e.action.subagent_type}};case`ThinkAction`:return{kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}};case`FinishAction`:return{kind:`translation`,key:`ACTION_MESSAGE$FINISH`,values:{}};case`TaskTrackerAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK_TRACKING`,values:{}};case`GrepAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GREP`,values:{pattern:e.action.pattern?B(e.action.pattern,50):``}};case`GlobAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GLOB`,values:{pattern:e.action.pattern?B(e.action.pattern,50):``}};case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return{kind:`translation`,key:`ACTION_MESSAGE$BROWSE`,values:{}};case`CanvasUIAction`:case me:return{kind:`text`,text:`CANVASUI`};case pe:return{kind:`translation`,key:`ACTION_MESSAGE$LAUNCH_CHILD_CONVERSATION`,values:{}};default:return{kind:`text`,text:String(n).replace(`Action`,``).toUpperCase()}}},Zt=class{static isDevMode=!1;static message(e){this.isDevMode&&console.warn(JSON.stringify(JSON.parse(e.data.toString()),null,2))}static event(e,t){this.isDevMode&&console.warn(t||`EVENT`,e)}static warning(e){this.isDevMode&&console.warn(e)}static error(e){this.isDevMode&&console.error(e)}},Qt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function $t(e){let{children:t}=e,n=e=>{try{return Qt(e)}catch(t){return Zt.error(String(t)),e}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var en=(0,P.createContext)(!0),tn=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},nn=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,rn=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return nn(e)&&!n.endsWith(`/`)?`${n}/`:n};function an(e){let{children:t}=e,{conversationId:n}=M(),r=(0,P.useContext)(en),i=e=>{try{let t=tn(e),i=rn(t);return r?(0,F.jsx)(`button`,{type:`button`,"data-testid":`path-component-link`,className:`cursor-pointer font-mono font-normal tracking-tight hover:underline`,title:t,onClick:e=>{e.stopPropagation(),j(t,n)},children:i}):(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,title:t,children:i})}catch(t){return Zt.error(String(t)),(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:e})}};return Array.isArray(t)?(0,F.jsx)(`span`,{className:`font-normal tracking-tight`,children:t.map((e,t)=>typeof e==`string`?(0,F.jsx)(`span`,{children:i(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,F.jsx)(`span`,{className:`font-normal tracking-tight`,children:i(t)}):(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:t})}var on=()=>{let{setConversationMode:e}=fe(),{send:t}=ct(),{conversationId:n}=M(),r=Ve(e=>e.enqueuePendingMessage),i=Ve(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,P.useCallback)(a=>{a?.preventDefault(),a?.stopPropagation(),e(`code`);let o=`Execute the plan based on the .agents_tmp/PLAN.md file.`,s=new Date().toISOString(),c=n?r({conversationId:n,text:o,timestamp:s}):null;t(lt(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},sn=`200%`,V=8,cn=V*2;function ln({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=ot(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(V/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=V/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${V}%)`,backgroundSize:`${sn} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,F.jsx)(t,{className:v(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${cn}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:v(`relative inline-block`,n),style:u,...o,children:e})]})}var un=P.memo(ln);function dn({className:e}){return(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var fn=5,pn=360,mn={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e}),code:Rt,a:Bt,strong:zt};function hn({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),a=P.useRef(null),[o,c]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){c(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=fn*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=fn||e.trim().length>pn)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let l=o&&!n;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(`div`,{ref:a,className:v(`text-sm leading-6 whitespace-normal [word-break:break-word]`,l&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:mn,children:e})}),l?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,F.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:v(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(h.COMMON$VIEW_MORE)})]}):null]})}function H({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onDismiss:c,onStop:l,timestamp:u}){let{t:d,i18n:f}=s(`openhands`),[p,m]=P.useState(!1),[g,_]=P.useState(!1),[y,b]=P.useState(!1),[x,ee]=P.useState(!1),[te,ne]=P.useState(!0),S=P.useRef(null),C=dt(u,f?.language);P.useEffect(()=>{b(!1)},[t]);let re=async()=>{await navigator.clipboard.writeText(t),_(!0)};P.useEffect(()=>{let e;return g&&(e=setTimeout(()=>{_(!1)},2e3)),()=>{clearTimeout(e)}},[g]);let ie=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&l!=null,T=w&&p,E=e===`user`&&a==null,ae=E&&x&&!y,oe=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=S.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;ne(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let se=E?(0,F.jsx)(hn,{message:t,isHovering:p,isExpanded:y,onTruncatableChange:ee}):(0,F.jsx)(`div`,{ref:S,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:mn,children:t})}),ce=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:v(`rounded-xl relative w-fit max-w-full flex flex-col`,oe&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!ie&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:v(`absolute -top-2.5 -right-2.5 z-10`,!p||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(ue,{content:e.tooltip,placement:`top`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,F.jsx)(Oe,{isHidden:!p,isDisabled:g,onClick:re,mode:g?`copied`:`copy`})]}),se,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":d(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:v(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(dn,{className:`block h-7 w-7 max-w-none`})}):null,ae?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":d(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>b(!0)}):null,n]}),D=C?(0,F.jsx)(ue,{content:(0,F.jsx)(`time`,{dateTime:u,children:C}),placement:`top`,isOpen:p,children:ce}):ce;return e===`user`&&a===`error`?(0,F.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,F.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,F.jsx)(`span`,{children:d(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:d(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null,c?(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-dismiss`,children:d(h.CHAT_INTERFACE$MESSAGE_DISMISS)}):null]})]}):e===`user`&&a===`sending`?(0,F.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,F.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,F.jsx)(un,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:d(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function gn(e){return{h1:({children:t,className:n})=>(0,F.jsx)(`h1`,{className:v(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,F.jsx)(`h2`,{className:v(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,F.jsx)(`h3`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,F.jsx)(`h4`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,F.jsx)(`h5`,{className:v(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,F.jsx)(`h6`,{className:v(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,F.jsx)(`p`,{className:v(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,F.jsx)(`ul`,{className:v(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,F.jsx)(`ol`,{className:v(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,F.jsx)(`li`,{className:v(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,F.jsx)(`a`,{className:v(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,F.jsx)(`code`,{className:v(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var _n=gn(),vn=300,yn=gn(`shine-text`);function bn({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=We(),{handleBuildPlanClick:a}=on(),{scrollDomToBottom:o}=St(),c=()=>{i(`planner`)},l=(0,P.useCallback)(e=>{a(e),o()},[a,o]),u=(0,P.useMemo)(()=>e?e.length<=vn?e:`${e.slice(0,vn)}...`:``,[e]);return e?(0,F.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,F.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,F.jsx)(Xe,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:c,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,F.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(at,{className:`text-white`,size:18})]})]}),(0,F.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:u&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{includeStandard:!0,components:t?yn:_n,children:u}),e&&e.length>vn&&(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(h.COMMON$READ_MORE)})]})}),(0,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:v(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,F.jsxs)(O.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(O.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function xn({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Sn({event:e}){return Ne(e)?(0,F.jsx)(xn,{errorId:e.id,defaultMessage:e.error}):null}function Cn({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function wn({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Tn({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:v(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(De,{width:18,height:18})})}function En({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:v(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Dn({src:e,onRemove:t,size:n=`small`}){return(0,F.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,F.jsx)(En,{src:e,size:n}),t&&(0,F.jsx)(Tn,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function On({size:e=`small`,images:t,onRemove:n}){let r=P.useRef(null),[i,a]=P.useState(!1),[o,s]=P.useState(!0),[c,l]=P.useState(!1);return P.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,F.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,F.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(Cn,{active:!o})}),(0,F.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:v(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Dn,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,F.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(wn,{active:!c})})]})}var kn=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
3
|
-
`):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=f.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function An(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function jn(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function Mn(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Nn(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Pn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Fn(e){let t=e?.verification;if(!Pn(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function In({feature:e}){let t=Math.round(e.probability*100),n=Nn(e.probability);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,F.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function U({label:e,features:t}){return!t||t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0&&(0,F.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,F.jsx)(In,{feature:e})]},e.name))]})}function Ln({categorized:e}){let{t}=s(),n=e.agent_behavioral_issues&&e.agent_behavioral_issues.length>0,r=e.user_followup_patterns&&e.user_followup_patterns.length>0,i=e.infrastructure_issues&&e.infrastructure_issues.length>0,a=e.other&&e.other.length>0;return!n&&!r&&!i&&!a?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,F.jsx)(U,{label:t(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(U,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(U,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(U,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Rn({criticResult:e}){let{t}=s(),{data:n}=ae(),[r,i]=P.useState(!1),a=An(e.score),{filled:o,empty:c}=jn(a),l=Mn(a),u=(a*100).toFixed(1),d=Fn(n?.agent_settings)===!1,f=e.metadata?.categorized_features,p=f!=null&&((f.agent_behavioral_issues??[]).length>0||(f.user_followup_patterns??[]).length>0||(f.infrastructure_issues??[]).length>0||(f.other??[]).length>0);return(0,F.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(h.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,F.jsxs)(`span`,{className:`${l} text-xs tracking-wide`,"aria-label":`Score: ${u}%`,children:[`★`.repeat(o),`☆`.repeat(c)]}),(0,F.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,u,`%)`]}),p&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?h.BUTTON$COLLAPSE_DETAILS:h.BUTTON$EXPAND_DETAILS),children:r?(0,F.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,F.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&p&&(0,F.jsx)(Ln,{categorized:f}),d&&(0,F.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(h.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var zn=e=>(0,F.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{d:`M11.3931 1.88021C10.78 1.37593 10.062 1.01489 9.29157 0.823438C8.52113 0.631981 7.71767 0.614934 6.9398 0.773542C5.90405 0.982756 4.95379 1.49492 4.20959 2.24506C3.46538 2.9952 2.96078 3.9495 2.7598 4.98688C2.61303 5.76469 2.6397 6.56531 2.83791 7.33163C3.03611 8.09795 3.40097 8.8111 3.90647 9.42021C4.37559 9.94959 4.64449 10.6266 4.66647 11.3335V13.3335C4.66647 13.864 4.87718 14.3727 5.25225 14.7478C5.62732 15.1228 6.13603 15.3335 6.66647 15.3335H9.33313C9.86356 15.3335 10.3723 15.1228 10.7473 14.7478C11.1224 14.3727 11.3331 13.864 11.3331 13.3335V11.4602C11.3555 10.6797 11.6423 9.92983 12.1465 9.33354C13.0299 8.24073 13.4463 6.84342 13.3052 5.44529C13.1642 4.04716 12.477 2.7612 11.3931 1.86687V1.88021ZM9.9998 13.3335C9.9998 13.5104 9.92956 13.6799 9.80454 13.8049C9.67951 13.93 9.50994 14.0002 9.33313 14.0002H6.66647C6.48965 14.0002 6.32009 13.93 6.19506 13.8049C6.07004 13.6799 5.9998 13.5104 5.9998 13.3335V12.6669H9.9998V13.3335ZM11.1131 8.50688C10.4428 9.30194 10.0517 10.2949 9.9998 11.3335H8.66647V9.33354C8.66647 9.15673 8.59623 8.98716 8.4712 8.86214C8.34618 8.73711 8.17661 8.66688 7.9998 8.66688C7.82299 8.66688 7.65342 8.73711 7.52839 8.86214C7.40337 8.98716 7.33313 9.15673 7.33313 9.33354V11.3335H5.9998C5.98221 10.3123 5.60443 9.33005 4.93313 8.56021C4.49023 8.02954 4.19239 7.39316 4.06867 6.71311C3.94495 6.03306 3.99957 5.33255 4.22719 4.6799C4.45481 4.02724 4.84768 3.4447 5.36748 2.98909C5.88728 2.53348 6.51627 2.22034 7.19313 2.08021C7.77483 1.96044 8.37591 1.9717 8.95271 2.11319C9.52952 2.25467 10.0676 2.52282 10.5278 2.89818C10.9881 3.27353 11.359 3.74666 11.6136 4.28322C11.8682 4.81978 12.0001 5.4063 11.9998 6.00021C12.0047 6.91345 11.6912 7.79985 11.1131 8.50688Z`,fill:`currentColor`})});function W({content:e}){let{t}=s(`openhands`),[n,r]=P.useState(!1);if(!e.trim())return null;let i=n?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?h.THINKING$COLLAPSE:h.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,F.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(zn,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(N,{children:e})})]})}var Bn=()=>{let e=o();return l({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await he.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await he.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function Vn({event:e,isFromPlanningAgent:t}){let{t:n}=s(`openhands`),{navigate:r}=ce(),{conversationId:i}=M(),a=p().backend.kind===`cloud`,{mutate:o,isPending:c}=Bn(),l=fe(e=>e.setMessageToSend),u=P.useRef(!1),d=kn(e),{reasoning:f,message:g}=e.source===`agent`?Re(d):{reasoning:``,message:d},_=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&_.push(...e.image_urls)});let v=!a&&i?[{icon:(0,F.jsx)(be,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!i||c||u.current)return;u.current=!0;let t=Ce.getCurrentConversation(),n=t?.id===i?t.title:void 0,a=n?`${n} (branch)`:void 0,s=e.source===`user`&&g.length>0;o({sourceConversationId:i,eventId:e.id,...s?{editText:g}:{},...a?{title:a}:{}},{onSuccess:({info:e,excluded:t})=>{r(`/conversations/${e.id}`),t&&window.setTimeout(()=>l(g),0)},onError:e=>m(e instanceof Error?e.message:null),onSettled:()=>{u.current=!1}})},tooltip:n(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[f&&(0,F.jsx)(W,{content:f}),(0,F.jsx)(H,{type:e.source,message:g,isFromPlanningAgent:t,actions:v,timestamp:e.timestamp,children:_.length>0&&(0,F.jsx)(On,{size:`small`,images:_})}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Rn,{criticResult:e.critic_result})]})}var Hn=e=>{switch(e){case g.LOW:return f.t(h.SECURITY$LOW_RISK);case g.MEDIUM:return f.t(h.SECURITY$MEDIUM_RISK);case g.HIGH:return f.t(h.SECURITY$HIGH_RISK);case g.UNKNOWN:default:return f.t(h.SECURITY$UNKNOWN_RISK)}},G=()=>``,Un=e=>e.name?`**Skill:** \`${e.name}\``:G(),Wn=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
|
|
4
|
-
`):G()},Gn=e=>{if(e.command!==`create`||!e.file_text)return G();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,z)}...`),`${e.path}\n${t}`},Kn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===g.HIGH||e.security_risk===g.MEDIUM)&&(t+=`\n\n${Hn(e.security_risk)}`),t},qn=e=>{let t=`**MCP Tool Call**
|
|
5
|
-
|
|
6
|
-
`;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},Jn=e=>e.thought,Yn=e=>e.message.trim(),Xn=e=>{let t=`**Command:** \`${e.command}\``;return e.command===`plan`&&(e.task_list&&e.task_list.length>0?(t+=`\n\n**Task List (${e.task_list.length} ${e.task_list.length===1?`item`:`items`}):**\n`,e.task_list.forEach((e,n)=>{let r={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;t+=`\n${n+1}. ${r} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(t+=`\n *Notes: ${e.notes}*`)})):t+=`
|
|
7
|
-
|
|
8
|
-
**Task List:** Empty`),t},Zn=e=>{switch(e.kind){case`BrowserNavigateAction`:{let t=`Browsing ${e.url}`;return e.new_tab&&(t+=`
|
|
9
|
-
**New Tab:** Yes`),t}case`BrowserClickAction`:{let t=`**Element Index:** ${e.index}`;return e.new_tab&&(t+=`
|
|
10
|
-
**New Tab:** Yes`),t}case`BrowserTypeAction`:{let t=e.text.length>50?`${e.text.slice(0,50)}...`:e.text;return`**Element Index:** ${e.index}\n**Text:** ${t}`}case`BrowserGetStateAction`:return e.include_screenshot?`**Include Screenshot:** Yes`:G();case`BrowserGetContentAction`:{let t=[];return e.extract_links&&t.push(`**Extract Links:** Yes`),e.start_from_char>0&&t.push(`**Start From Character:** ${e.start_from_char}`),t.length>0?t.join(`
|
|
11
|
-
`):G()}case`BrowserScrollAction`:return`**Direction:** ${e.direction}`;case`BrowserGoBackAction`:return G();case`BrowserListTabsAction`:return G();case`BrowserSwitchTabAction`:return`**Tab ID:** ${e.tab_id}`;case`BrowserCloseTabAction`:return`**Tab ID:** ${e.tab_id}`;default:return G()}},Qn=e=>{let{action:t}=e;switch(t.kind){case`FileEditorAction`:case`StrReplaceEditorAction`:return Gn(t);case`ExecuteBashAction`:case`TerminalAction`:return Kn(e);case`MCPToolAction`:return qn(t);case`ThinkAction`:return Jn(t);case`FinishAction`:return Yn(t);case`TaskTrackerAction`:return Xn(t);case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return Zn(t);case`GrepAction`:case`GlobAction`:return Wn(e);case`InvokeSkillAction`:return Un(t);default:return Vt(e)}},$n=e=>{if(e.is_error||e.status===`failed`)return`error`;if(e.status===`completed`)return`success`},er=e=>{let{observation:t}=e;switch(t.kind){case`ExecuteBashObservation`:{let e=t.exit_code,{metadata:n}=t;return e===-1||n.exit_code===-1?`timeout`:e===0||n.exit_code===0?`success`:`error`}case`TerminalObservation`:{let e=t.exit_code??t.metadata.exit_code??null;return t.timeout||e===-1?`timeout`:e===0?`success`:t.is_error?`error`:`success`}case`FileEditorObservation`:case`StrReplaceEditorObservation`:return t.error?`error`:`success`;case`MCPToolObservation`:return t.is_error?`error`:`success`;case`SwitchLLMObservation`:return t.is_error?`error`:`success`;case`InvokeSkillObservation`:return t.is_error?`error`:`success`;case`TaskObservation`:return t.is_error||t.status===`failed`?`error`:`success`;case`CanvasUIObservation`:return t.is_error?`error`:`success`;default:return`success`}},tr=e=>{let{observation:t}=e;if(t.error)return`**Error:**\n${t.error}`;let n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
12
|
-
`):null;return er(e)===`success`&&`old_content`in t&&`new_content`in t&&t.old_content&&t.new_content||t.command===`view`?`\`\`\`\n${n||t.output}\n\`\`\``:n||t.output},nr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
13
|
-
`)||``;n.length>1e3&&(n=`${n.slice(0,z)}...`);let r=``;return t.command&&(r+=`Command: \`${t.command}\`\n\n`),r+=`Output:\n\`\`\`sh\n${n.trim()||f.t(h.OBSERVATION$COMMAND_NO_OUTPUT)}\n\`\`\``,r},rr=e=>{let{observation:t}=e,n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
14
|
-
`):t.output||``,r=``;return t.error?r+=`**Error:**\n${t.error}`:n?r+=`**Output:**\n${n}`:r+=`Browser action completed successfully.`,r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},ir=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
15
|
-
`),r=`**Tool:** ${t.tool_name}\n\n`;return t.is_error?r+=`**Error:**\n${n}`:r+=`**Result:**\n${n}`,r.length>1e3&&(r=`${r.slice(0,z)}...`),r},ar=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
16
|
-
`),r=`${t.skill_name?`**Skill:** \`${t.skill_name}\`\n\n`:``}${t.is_error?`**Error:**\n${n}`:n}`;return r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},or=e=>e.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
17
|
-
`),sr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
18
|
-
`);if(t.is_error)return n?`**Error:**\n${n}`:`**Error:**\nFailed to switch LLM profile \`${t.profile_name}\`.`;let r=[`**Profile:** \`${t.profile_name}\``];return t.active_model&&r.push(`**Active model:** \`${t.active_model}\``),t.reason&&r.push(`**Reason:** ${t.reason}`),r.join(`
|
|
19
|
-
`)},cr=e=>{let{observation:t}=e,{command:n,task_list:r}=t,i=`**Command:** \`${n}\``;return n===`plan`&&r.length>0?(i+=`\n\n**Task List (${r.length} ${r.length===1?`item`:`items`}):**\n`,r.forEach((e,t)=>{let n={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;i+=`\n${t+1}. ${n} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(i+=`\n *Notes: ${e.notes}*`)})):n===`plan`&&(i+=`
|
|
20
|
-
|
|
21
|
-
**Task List:** Empty`),`content`in t&&t.content&&typeof t.content==`string`&&t.content.trim()&&(i+=`\n\n**Result:** ${t.content.trim()}`),i},lr=e=>{let{observation:t}=e;return t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
22
|
-
`)||``},ur=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
23
|
-
`),r=``;return t.is_error?r+=`**Error:**\n${n}`:r+=n,r},dr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
24
|
-
`),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n\n`,t.is_error?r+=`**Error:**\n${n}`:t.files.length===0?r+=`**Result:** No files found.`:(r+=`**Files Found (${t.files.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.files.map(e=>`- \`${e}\``).join(`
|
|
25
|
-
`)),r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},fr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
26
|
-
`),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
|
|
27
|
-
`,t.is_error?r+=`**Error:**\n${n}`:t.matches.length===0?r+=`**Result:** No matches found.`:(r+=`**Matches (${t.matches.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.matches.map(e=>`- \`${e}\``).join(`
|
|
28
|
-
`)),r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},pr=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return tr(e);case`ExecuteBashObservation`:case`TerminalObservation`:return nr(e);case`BrowserObservation`:return rr(e);case`MCPToolObservation`:return ir(e);case`TaskTrackerObservation`:return cr(e);case`ThinkObservation`:return lr(e);case`FinishObservation`:return ur(e);case`GlobObservation`:return dr(e);case`GrepObservation`:return fr(e);case`InvokeSkillObservation`:return ar(e);case`CanvasUIObservation`:return or(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?or(e):Vt(e);case`SwitchLLMObservation`:return sr(e);default:return Vt(e)}},mr=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,F.jsx)(`path`,{d:`M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z`,fill:`currentColor`})}),hr=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M5.79029 12.9507C5.69629 12.9042 5.59557 12.8843 5.50157 12.8843C5.25314 12.8843 5.01142 13.0238 4.89728 13.2562C4.72942 13.5883 4.87042 13.9868 5.20614 14.1462C5.30014 14.1927 5.40086 14.2127 5.50157 14.2127C5.75 14.2127 5.985 14.0732 6.10586 13.8407C6.15286 13.7477 6.17301 13.6481 6.17301 13.5551C6.17301 13.3027 6.03201 13.0636 5.79029 12.9507ZM13.3641 12.3463C13.3641 12.3463 13.3909 12.333 13.3977 12.3198C13.4178 12.2998 13.4312 12.2733 13.4447 12.2533C13.4245 12.2865 13.3977 12.3198 13.3641 12.3463ZM3.91698 11.463C3.7827 11.2969 3.58798 11.2106 3.39326 11.2106C3.24555 11.2106 3.09783 11.2637 2.97697 11.3567C2.68154 11.5892 2.63454 12.0076 2.86283 12.2932C2.99712 12.4592 3.19183 12.5456 3.39326 12.5456C3.54098 12.5456 3.68869 12.4924 3.80955 12.3995C3.97741 12.2666 4.0647 12.074 4.0647 11.8814C4.0647 11.7353 4.0177 11.5892 3.91698 11.463ZM2.88297 9.32433C2.80911 9.01881 2.53382 8.80627 2.23168 8.80627C2.18468 8.80627 2.13096 8.81291 2.07725 8.8262C1.71467 8.9059 1.48638 9.26455 1.56696 9.61657C1.64081 9.92873 1.9161 10.1346 2.22496 10.1346C2.27196 10.1346 2.32568 10.1346 2.37268 10.1213C2.68825 10.0549 2.8964 9.77597 2.8964 9.47045C2.8964 9.42395 2.8964 9.37082 2.88297 9.32433ZM2.37939 6.15621C2.33239 6.14293 2.27868 6.14293 2.23168 6.14293C1.92282 6.14293 1.64753 6.34218 1.57367 6.65434C1.4931 7.013 1.71467 7.36501 2.07725 7.45135C2.13096 7.46464 2.17796 7.47128 2.22496 7.47128C2.53382 7.47128 2.80911 7.25874 2.88297 6.95322C2.8964 6.90673 2.8964 6.8536 2.8964 6.8071C2.8964 6.50158 2.69497 6.22263 2.37939 6.15621ZM3.82298 3.87809C3.70212 3.78511 3.55441 3.73197 3.40669 3.73197C3.20526 3.73197 3.01054 3.81831 2.87626 3.98436C2.64797 4.26995 2.69497 4.68838 2.98369 4.92085C3.10454 5.01383 3.25226 5.06696 3.39998 5.06696C3.59469 5.06696 3.79612 4.98062 3.9237 4.81458C4.02441 4.69503 4.07141 4.54227 4.07141 4.39615C4.07141 4.20354 3.99084 4.01093 3.82298 3.87809ZM6.11929 2.45011C6.00515 2.21101 5.76343 2.07153 5.50829 2.07153C5.41428 2.07153 5.31357 2.09146 5.21957 2.13795C4.88385 2.29735 4.74956 2.69586 4.90399 3.0213C5.02485 3.26041 5.25985 3.39988 5.50829 3.39988C5.609 3.39988 5.70972 3.37996 5.80372 3.33347C6.04543 3.22056 6.17972 2.98145 6.17972 2.73571C6.17972 2.63608 6.15958 2.5431 6.11929 2.45011Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M14.8809 8.14215C14.8809 8.65356 14.8205 9.15834 14.7063 9.64983C14.5251 10.4269 14.2028 11.1708 13.7462 11.8482C13.6589 11.9811 13.5649 12.1073 13.4642 12.2268C13.4642 12.2401 13.4575 12.2468 13.444 12.2534C13.4239 12.2866 13.397 12.3198 13.3635 12.3464C12.7457 13.1102 11.9602 13.7212 11.0604 14.1529C11.047 14.1596 11.0269 14.1662 11.0134 14.1729C10.9194 14.2194 10.8187 14.2658 10.718 14.3057C9.90558 14.6378 9.01928 14.8105 8.1397 14.8105H8.11955C7.74355 14.8038 7.45483 14.5116 7.45483 14.1463C7.45483 13.781 7.75698 13.4821 8.12627 13.4821H8.14641C8.85142 13.4821 9.55643 13.3426 10.2077 13.077C11.047 12.7316 11.7789 12.187 12.3496 11.4896C12.4436 11.37 12.5443 11.2438 12.6316 11.111C12.9942 10.5664 13.256 9.97527 13.397 9.35095C13.397 9.33766 13.397 9.32438 13.397 9.31774C13.4843 8.93252 13.5313 8.54065 13.5313 8.14215C13.5313 7.43812 13.3903 6.75402 13.1218 6.10313C12.927 5.64485 12.6786 5.21978 12.3697 4.83455C12.2422 4.67515 12.1012 4.51575 11.9535 4.36963C11.4499 3.8715 10.859 3.47964 10.201 3.21397C9.55643 2.9483 8.86485 2.81546 8.16655 2.80882H8.13298C7.76369 2.80882 7.46155 2.50994 7.46155 2.14464C7.46155 1.77935 7.76369 1.48047 8.13298 1.48047H8.17327C9.05285 1.48711 9.90557 1.65315 10.7113 1.98524C10.8322 2.03838 10.953 2.08487 11.0672 2.14464C11.0806 2.15129 11.094 2.15793 11.1007 2.15793C11.7722 2.48337 12.3697 2.90845 12.9002 3.43314C13.0815 3.61247 13.256 3.80508 13.4172 4.00434C13.4239 4.01098 13.4239 4.01762 13.4306 4.02426C13.8133 4.49583 14.1222 5.02717 14.3639 5.59171C14.4982 5.91052 14.6056 6.24261 14.6795 6.57469C14.6929 6.62119 14.7063 6.66768 14.7131 6.71417C14.8205 7.17909 14.8742 7.6573 14.8742 8.14215H14.8809Z`,fill:`currentColor`})]});function gr({task:e}){let{t}=s(`openhands`),n=(0,P.useMemo)(()=>{switch(e.status){case`todo`:return(0,F.jsx)(mr,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,F.jsx)(hr,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,F.jsx)(ke,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,F.jsx)(mr,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,F.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,F.jsx)(`div`,{className:`shrink-0`,children:n}),(0,F.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,F.jsx)(O.Text,{className:v(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,F.jsxs)(O.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function _r({taskList:e}){let{t}=s(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,F.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,F.jsx)(Xe,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,F.jsx)(O.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(h.COMMON$TASKS)})]}),(0,F.jsx)(`div`,{children:e.map((e,t)=>(0,F.jsx)(gr,{task:e},`task-${t}`))})]})}function vr({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,F.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,F.jsx)(_r,{taskList:r})})}var yr=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),br=e=>{let t=[],n=/<EXTRA_INFO>([\s\S]*?)<\/EXTRA_INFO>/gi,r=n.exec(e);for(;r!==null;){let i=r[1].trim();i.length>0&&t.push(i),r=n.exec(e)}return t},xr=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Sr=(e,t)=>{let n=`
|
|
29
|
-
|
|
30
|
-
**Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=xr(e,i)}),n},Cr=e=>{let t=`
|
|
31
|
-
|
|
32
|
-
**Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},wr=e=>!e||e.length===0?[]:br(yr(e)),Tr=(e,t)=>{let n=wr(t);return e&&e.length>0?Sr(e,n):n.length>0?Cr(n):``},Er=(e,t)=>{let n=wr(t);return e&&e.length>0?e.map((e,t)=>({name:e,content:t<n.length?n[t].trim():``})):n.length>0?n.filter(e=>e.trim().length>0).map((e,t)=>({name:`Extended Content ${t+1}`,content:e.trim()})):[]},K=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,Dr=e=>{let t=e.activated_skills||[],n=e.extended_content||[];if(t.length===0&&n.length===0)throw Error(`Cannot create skill ready event without activated skills or extended content`);let r=Tr(t,n),i=Er(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},q=e=>e,J=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
33
|
-
`);function Or({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=s(`openhands`),[c,l]=P.useState(!1),u=e.length>z,d=(u&&!(i&&c)?`${e.slice(0,1e3)}…`:e).trim()||r||``,f=n&&e.trim().length>0,p=o(c?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),m=(0,F.jsx)(D,{className:`rounded-lg text-xs`,style:le,language:t,PreTag:`div`,wrapLongLines:a,customStyle:a?{whiteSpace:`pre-wrap`}:void 0,codeTagProps:a?{style:{whiteSpace:`pre-wrap`}}:void 0,children:d});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[f?(0,F.jsx)(qe,{text:e,children:m}):m,i&&u&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`self-start text-xs text-muted transition-colors hover:text-white hover:underline`,children:p})]})}function kr({output:e,exitCode:t,copy:n=!0}){let{t:r}=s(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t!=null&&t!==0&&t!==-1&&(0,F.jsx)(`span`,{className:`self-start rounded bg-status-fail-bg px-1.5 py-0.5 font-mono text-xs text-status-fail-text`,children:r(h.OBSERVATION$EXIT_CODE,{code:t})}),(0,F.jsx)(Or,{code:e,language:`bash`,copy:n,placeholder:r(h.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Ar=q({actionKinds:[`ExecuteBashAction`,`TerminalAction`],observationKinds:[`ExecuteBashObservation`,`TerminalObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`openhands`),r=t?.observation.command??e?.action.command??``,i=e?.security_risk;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r&&(0,F.jsx)(Or,{code:r,language:`bash`}),(i===g.HIGH||i===g.MEDIUM)&&(0,F.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===g.HIGH?h.SECURITY$HIGH_RISK:h.SECURITY$MEDIUM_RISK)}),t&&(0,F.jsx)(kr,{output:J(t.observation.content),exitCode:t.observation.exit_code})]})}}),jr=e=>{switch(e.split(`.`).pop()?.toLowerCase()){case`js`:case`jsx`:return`javascript`;case`ts`:case`tsx`:return`typescript`;case`py`:return`python`;case`html`:return`html`;case`css`:return`css`;case`json`:return`json`;case`md`:return`markdown`;case`yml`:case`yaml`:return`yaml`;case`sh`:case`bash`:return`bash`;case`dockerfile`:return`dockerfile`;case`rs`:return`rust`;case`go`:return`go`;case`java`:return`java`;case`cpp`:case`cc`:case`cxx`:return`cpp`;case`c`:return`c`;case`rb`:return`ruby`;case`php`:return`php`;case`sql`:return`sql`;default:return`text`}},Mr=3,Nr=300,Pr=25e4,Fr=(e,t)=>{if(e.length*t.length>Pr)return[...e.map(e=>({type:`del`,text:e})),...t.map(e=>({type:`add`,text:e}))];let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;--a)for(let n=r-1;n>=0;--n)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o]}),o+=1,s+=1):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o]}),o+=1):(a.push({type:`add`,text:t[s]}),s+=1);for(;o<n;)a.push({type:`del`,text:e[o]}),o+=1;for(;s<r;)a.push({type:`add`,text:t[s]}),s+=1;return a},Ir=(e,t)=>{let n=e.split(`
|
|
34
|
-
`),r=t.split(`
|
|
35
|
-
`),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i+=1;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)--a,--o;let s=n.slice(Math.max(0,i-Mr),i),c=n.slice(a,Math.min(n.length,a+Mr));return[...s.map(e=>({type:`ctx`,text:e})),...Fr(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},Lr={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},Rr={add:`+ `,del:`- `,ctx:` `};function zr({oldText:e,newText:t}){let{t:n}=s(`openhands`),r=Ir(e,t),i=r.length>Nr;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`overflow-auto rounded-lg border border-surface-raised font-mono text-xs`,children:(i?r.slice(0,Nr):r).map((e,t)=>(0,F.jsx)(`div`,{className:v(`whitespace-pre-wrap px-2`,Lr[e.type]),children:`${Rr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]})}function Br({path:e,range:t,onClick:n}){let{conversationId:r}=M();return(0,F.jsx)(`button`,{type:`button`,"data-testid":`file-path-chip`,title:e,className:`inline-flex max-w-full cursor-pointer items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 text-left font-mono text-xs text-foreground hover:bg-[var(--oh-interactive-hover)]`,onClick:t=>{if(t.stopPropagation(),n){n();return}j(e,r)},children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(nt,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,F.jsx)(`span`,{className:`break-all`,children:t?`${e}:${t}`:e})]})})}var Vr=new Set([`md`,`markdown`,`mdx`]);function Hr(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Vr.has(e.slice(t+1).toLowerCase())}var Y=new Set([`FileEditorAction`,`StrReplaceEditorAction`]),Ur=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`]);function Wr(e,t){if(k(e)&&Y.has(e.action.kind))return e.action.path||null;if(A(e)&&Ur.has(e.observation.kind)){let n=e.observation.path;if(n)return n;if(t&&Y.has(t.action.kind))return t.action.path||null}return null}function Gr(e,t){if(k(e)&&Y.has(e.action.kind))return e.action.command||null;if(A(e)&&Ur.has(e.observation.kind)){let n=e.observation.command;if(n)return n;if(t&&Y.has(t.action.kind))return t.action.command||null}return null}function Kr(e,t){let n=Wr(e,t),r=Gr(e,t);return!!(n&&r===`create`&&Hr(n))}function qr({content:e,path:t,onView:n}){let{t:r}=s(`openhands`),i=t.split(`/`).pop()||t;return(0,F.jsxs)(`div`,{className:`w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]`,"data-testid":`markdown-file-preview`,children:[(0,F.jsx)(`div`,{"data-testid":`markdown-file-preview-content`,className:`max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]`,children:(0,F.jsx)(N,{content:e,includeStandard:!0,includeHeadings:!0,components:_n})}),(0,F.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(nt,{className:`h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]`}),(0,F.jsx)(O.Text,{className:`truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]`,children:i})]}),n?(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80`,"data-testid":`markdown-file-preview-view`,children:[(0,F.jsx)(O.Text,{className:`text-[11px] leading-4 tracking-[0.11px] text-white`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(at,{className:`text-white`,size:16})]}):null]})]})}var Jr=({action:e,observation:t})=>t?.observation.path??e?.action.path??``;function Yr({action:e,observation:t,onOpenFile:n}){let r=Jr({action:e,observation:t}),i=t?.observation.command??e?.action.command,a=jr(r),o=e?.action.view_range,s=i===`view`&&o?`${o[0]}-${o[1]}`:void 0,c=r?(0,F.jsx)(Br,{path:r,range:s,onClick:n}):null,l=e=>r&&i===`create`&&Hr(r)?{chip:null,body:(0,F.jsx)(qr,{content:e,path:r,onView:n})}:{chip:c,body:(0,F.jsx)(Or,{code:e,language:a})};if(t){let e=t.observation,n=null,r=c;if(e.error)n=(0,F.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:e.error});else if(e.old_content!=null&&e.new_content!=null)n=(0,F.jsx)(zr,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?J(e.content):``);if(t){let e=l(t);r=e.chip,n=e.body}}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}if(e){let t=e.action,n=null,r=c;if(t.command===`create`&&t.file_text){let e=l(t.file_text);r=e.chip,n=e.body}else (t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,F.jsx)(zr,{oldText:t.old_str??``,newText:t.new_str}));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}return null}function Xr({conversationId:e,...t}){let n=Jr(t),r=n&&t.observation?()=>j(n,e):void 0;return(0,F.jsx)(Yr,{...t,onOpenFile:r})}var Zr=q({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function(e){let{conversationId:t}=M();return t?(0,F.jsx)(Xr,{...e,conversationId:t}):(0,F.jsx)(Yr,{...e})}});function Qr({rows:e}){return(0,F.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:e.map(({label:e,value:t})=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-muted`,children:e}),(0,F.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:t})]},e))})}var $r=q({actionKinds:[`GrepAction`,`GlobAction`],observationKinds:[`GrepObservation`,`GlobObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`openhands`),r=t?.observation,i=e?.action,a=r?.pattern??i?.pattern??``,o=r?.search_path??i?.path??``,c=r?`include_pattern`in r?r.include_pattern:null:i&&`include`in i?i.include:null,l=r?`matches`in r?r.matches:r.files:[];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(Qr,{rows:[{label:n(h.COMMON$PATTERN),value:a},...o?[{label:n(h.COMMON$PATH),value:o}]:[],...c?[{label:n(h.COMMON$INCLUDE),value:c}]:[]]}),r&&(r.is_error?(0,F.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:J(r.content)}):l.length===0?(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$NO_RESULTS)}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$RESULTS,{count:l.length})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:l.map(e=>(0,F.jsx)(`span`,{className:`break-all`,children:e},e))}),r.truncated&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]}))]})}});function ei({label:e,text:t,isError:n=!1}){return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,F.jsx)(qe,{text:t,children:(0,F.jsx)(`div`,{className:`overflow-auto rounded border border-surface-raised bg-surface-raised p-2 text-xs ${n?`text-danger`:`text-foreground`}`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var ti=[Ar,Zr,$r,q({actionKinds:[`TaskAction`],observationKinds:[`TaskObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`openhands`),r=e?.action,i=t?.observation,a=i?.subagent??r?.subagent_type??``,o=i?.task_id,c=r?.prompt?.trim()??``,l=i?J(i.content).trim():``,u=[...a?[{label:n(h.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(h.TASK$TASK_ID),value:o}]:[]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[u.length>0&&(0,F.jsx)(Qr,{rows:u}),c&&(0,F.jsx)(ei,{label:n(h.TASK$QUERY),text:c}),l&&(0,F.jsx)(ei,{label:n(h.TASK$RESULT),text:l,isError:i?.is_error})]})}})],ni=e=>new Map(ti.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),ri=ni(e=>e.actionKinds),ii=ni(e=>e.observationKinds);function ai(e,t){if(k(e)){let t=ri.get(e.action.kind);if(t)return(0,F.jsx)(t.Body,{action:e})}else if(A(e)){let n=ii.get(e.observation.kind);if(n)return(0,F.jsx)(n.Body,{action:t,observation:e})}return null}var X=(e,t)=>f.exists(e)?(0,F.jsx)(d,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,F.jsx)(an,{}),cmd:(0,F.jsx)($t,{})}}):e,oi=e=>e.kind===`text`?e.text:X(e.key,e.values),Z=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?B(n,t):n:null},si=e=>{if(e.tool_name!==`inspect_image_with_vision`)return null;let t=e.action,n=Z(t.profile_name);return n?`Describing image with ${n}`:`Describing image with auxiliary vision LLM`},ci=(e,t)=>{let n=t?.tool_name,r=e.observation,i=Z(r.tool_name);if(n!==`inspect_image_with_vision`&&i!==`inspect_image_with_vision`&&String(e.observation.kind)!==`VisionInspectObservation`)return null;let a=Z((t?.action??{}).profile_name)??Z(r.profile_name)??Z(r.base_url,80)??Z(r.endpoint,80)??Z(r.model,80);return a?`Describing image with ${a}`:`Describing image with auxiliary vision LLM`},li=e=>k(e)?si(e)||oi(Xt(e)):``,ui=(e,t)=>{if(!A(e))return``;let n=ci(e,t);if(n)return n;if(t){let e=si(t);if(e)return e;let n=Yt(t);if(n)return n}let r=e.observation.kind,i=``,a={};switch(r){case`ExecuteBashObservation`:case`TerminalObservation`:i=`OBSERVATION_MESSAGE$RUN`,a={command:e.observation.command?B(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:e.observation.command===`create`?`OBSERVATION_MESSAGE$WRITE`:`OBSERVATION_MESSAGE$EDIT`,a={path:e.observation.path||``};break;case`MCPToolObservation`:i=`OBSERVATION_MESSAGE$MCP`,a={mcp_tool_name:e.observation.tool_name};break;case`InvokeSkillObservation`:i=`OBSERVATION_MESSAGE$INVOKE_SKILL`,a={name:e.observation.skill_name};break;case`TaskObservation`:i=`OBSERVATION_MESSAGE$TASK`,a={name:e.observation.subagent};break;case`CanvasUIObservation`:i=`OBSERVATION_MESSAGE$CANVAS_UI`;break;case`ClientToolObservation`:if(e.tool_name===`canvas_ui_control`){i=`OBSERVATION_MESSAGE$CANVAS_UI`;break}if(e.tool_name===`launch_child_conversation`){i=`OBSERVATION_MESSAGE$LAUNCH_CHILD_CONVERSATION`;break}return r.replace(`Observation`,``).toUpperCase();case`SwitchLLMObservation`:i=e.observation.is_error?`MODEL$SWITCH_FAILED`:`MODEL$SWITCHED_TO_PROFILE`,a={name:e.observation.profile_name};break;case`BrowserObservation`:i=`OBSERVATION_MESSAGE$BROWSE`;break;case`TaskTrackerObservation`:{let{command:t}=e.observation;i=t===`plan`?`OBSERVATION_MESSAGE$TASK_TRACKING_PLAN`:`OBSERVATION_MESSAGE$TASK_TRACKING_VIEW`;break}case`ThinkObservation`:i=`OBSERVATION_MESSAGE$THINK`;break;case`GlobObservation`:i=`OBSERVATION_MESSAGE$GLOB`,a={pattern:e.observation.pattern?B(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?B(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?X(i,a):r},di=(e,t)=>e.observation.kind!==`ClientToolObservation`||e.tool_name!==`canvas_ui_control`||!t||!Le(t)?null:`UI command '${t.action.command}' dispatched to the Agent Canvas frontend.`,fi=(e,t)=>{let n=``,r=``;if(K(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=f.exists(t)?X(t,{}):`Skill Ready`,r=e._skillReadyContent}else k(e)?(n=li(e),r=ai(e)??Qn(e)):A(e)?(n=ui(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,F.jsx)(vr,{event:e}):di(e,t)??ai(e,t)??pr(e)):ze(e)?(n=X(Ht(e),{title:Wt(e)}),r=qt(e)):e.source===`agent`&&`action`in e&&e.action!==null&&typeof e.action==`object`&&`kind`in e.action&&typeof e.action.kind==`string`&&(n=String(e.action.kind).replace(`Action`,``).toUpperCase());return{title:n||f.t(h.EVENT$UNKNOWN_EVENT),details:r}};function pi({event:e,isFromPlanningAgent:t=!1}){let n=fi(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(H,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t,timestamp:e.timestamp}),e.critic_result!=null&&(0,F.jsx)(Rn,{criticResult:e.critic_result})]})}var mi=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
36
|
-
`).trim();return!t.skill_name&&!n?[]:[{name:t.skill_name,content:n}]};function hi(e){let t=e.split(`
|
|
37
|
-
`),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(y[0]))n=a.trim(),i=e+1;else if(a.startsWith(y[2]))r=a.replace(y[2],``).trim(),i=e+1;else if(a.startsWith(y[1])||a.startsWith(y[3]))i=e+1;else if(a.trim()===``&&e<=i)i=e+1;else break}return{matchInfo:n,filePath:r,body:t.slice(i).join(`
|
|
38
|
-
`).trim()}}function gi(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function _i({content:e}){let{t}=s(`openhands`),{matchInfo:n,filePath:r,body:i}=hi(e),a=n||r;return(0,F.jsxs)(`div`,{className:`pl-6 pr-2 pt-2 pb-2`,children:[a&&(0,F.jsxs)(`div`,{className:`mb-3 text-sm text-[var(--oh-muted)] space-y-1`,children:[n&&(0,F.jsx)(`p`,{children:n}),r&&(0,F.jsxs)(`p`,{children:[(0,F.jsxs)(O.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.COMMON$PATH),` `]}),(0,F.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,F.jsx)(N,{children:gi(i)})]})}function vi({items:e,titleKey:t=h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}){let{t:n}=s(`openhands`),[r,i]=P.useState({}),a=e=>{i(t=>({...t,[e]:!t[e]}))};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1`,children:[(0,F.jsx)(O.Text,{className:`font-bold text-[var(--oh-foreground)] text-sm px-2 py-1`,children:n(t)}),e.map(e=>{let t=r[e.name]||!1;return(0,F.jsxs)(`div`,{className:`border border-[var(--oh-border-subtle)] rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(e.name),className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-tertiary transition-colors cursor-pointer`,children:[(0,F.jsx)(O.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,F.jsx)(S,{size:14}):(0,F.jsx)(C,{size:14})}),(0,F.jsx)(O.Text,{className:`font-normal text-[var(--oh-foreground)] text-sm`,children:e.name})]}),t&&e.content&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)]`}),(0,F.jsx)(_i,{content:e.content})]})]},e.name)})]})}function yi(e){if(K(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(A(e)&&e.observation.kind===`InvokeSkillObservation`){let t=mi(e);return t.length>0?{items:t,titleKey:h.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function Q({event:e,correspondingAction:t}){let{title:n,details:r}=fi(e,t);if(!K(e)&&A(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,F.jsx)(`div`,{children:r});let i;K(e)?i=`success`:A(e)?i=er(e):ze(e)&&(i=$n(e));let a=yi(e),o=a?(0,F.jsx)(vi,{items:a.items,titleKey:a.titleKey}):r,s=!K(e)&&Kr(e,t);return(0,F.jsx)(`div`,{children:(0,F.jsx)(R,{title:n,details:o,success:i,initiallyExpanded:s,timestamp:e.timestamp,titleIcon:a?(0,F.jsx)(Te,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0})})}function bi({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
39
|
-
`);return r?(0,F.jsx)(H,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n,timestamp:e.timestamp}):null}function xi(e,t){if(t)return`🚫`;switch(e){case`PreToolUse`:return`⏳`;case`PostToolUse`:return`✅`;case`UserPromptSubmit`:return`📝`;case`SessionStart`:return`🚀`;case`SessionEnd`:return`🏁`;case`Stop`:return`⏹️`;default:return`🔗`}}function Si(e){return e.length>80?`${e.slice(0,77)}...`:e}function Ci(e,t){return e?`blocked`:t?`ok`:`failed`}function wi(e,t){return e?`bg-amber-900/50 text-amber-300`:t?`bg-green-900/50 text-green-300`:`bg-red-900/50 text-red-300`}function Ti({event:e}){let{t}=s(`openhands`);if(!Fe(e))return null;let n=xi(e.hook_event_type,e.blocked),r=Ci(e.blocked,e.success),i=wi(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{children:[n,` `,t(h.HOOK$HOOK_LABEL),`: `,e.hook_event_type,e.tool_name&&(0,F.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,F.jsx)(`span`,{className:v(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$COMMAND),`:`]}),` `,(0,F.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:Si(e.hook_command)})]}),e.exit_code!==null&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$EXIT_CODE),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,F.jsxs)(`div`,{className:`text-amber-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$BLOCKED_REASON),`:`]}),` `,e.reason]}),e.additional_context&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$CONTEXT),`:`]}),` `,e.additional_context]}),e.error&&(0,F.jsxs)(`div`,{className:`text-red-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$OUTPUT),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto`,children:e.stdout})]}),e.stderr&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$STDERR),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto text-amber-300`,children:e.stderr})]})]}),success:a})}function Ei(e){let t=[],n=[];for(let r of e)Ue(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Di=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function Oi(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(Pe(n)&&Di(n.observation.path))return n.id}return null}function ki(e){return(0,P.useMemo)(()=>{let t=new Set;return Ei(e).forEach(e=>{let n=Oi(e);n&&t.add(n)}),t},[e])}function Ai(e,t){return t.has(e)}var ji=e=>e.activated_skills||[],Mi=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),Ni=e=>{let t=ji(e).length>0,n=Mi(e.extended_content);return t&&n},Pi=(e,t,n)=>{try{let r=Dr(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Vn,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,F.jsx)(Q,{event:r,isLastMessage:n})]})}catch{return(0,F.jsx)(Vn,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Fi({planContent:e,isLastMessage:t,isMainAgentRunning:n}){let{localPlanningConversationId:r,curPlanningAgentState:i,isPlanningAgentRunning:a}=Ke();return(0,F.jsx)(bn,{planContent:e,isStreaming:t&&!!r&&i===_.RUNNING,isBuildDisabled:n||a})}function Ii({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=E(),{planContent:s}=fe(),{curAgentState:c}=Ae(),l=c===_.RUNNING||c===_.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(tt(e)&&He(e))return(0,F.jsx)(ht,{status:e.value});if(Ne(e))return(0,F.jsx)(Sn,{event:e,...d});if(Fe(e))return(0,F.jsx)(Ti,{event:e});if(ze(e))return(0,F.jsx)(Q,{event:e,isLastMessage:n});if(Ie(e)){let{reasoning:t,message:n}=Re(e.content??``,{streaming:!0}),r=[e.reasoning_content??``,t].filter(Boolean).join(`
|
|
40
|
-
|
|
41
|
-
`);return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(W,{content:r}),n&&(0,F.jsx)(H,{type:`agent`,message:n,isFromPlanningAgent:u,timestamp:e.timestamp})]})}if(k(e)&&e.action.kind===`FinishAction`)return(0,F.jsx)(pi,{event:e,...d});if(k(e)&&e.action.kind===`ThinkAction`)return(0,F.jsx)(W,{content:e.action.thought});if(k(e)){let t=je(e);return(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(W,{content:t}),!a&&(0,F.jsx)(bi,{event:e,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n})]})}if(A(e)){if(Pe(e))return i&&Ai(e.id,i)?(0,F.jsx)(Fi,{planContent:s,isLastMessage:n,isMainAgentRunning:l}):null;let r=t.find(t=>k(t)&&t.id===e.action_id),o=!a&&r&&k(r)&&r.action.kind!==`ThinkAction`,c=r&&k(r)?je(r):``;return(0,F.jsxs)(F.Fragment,{children:[c&&(0,F.jsx)(W,{content:c}),o&&(0,F.jsx)(bi,{event:r,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n,correspondingAction:r&&k(r)?r:void 0})]})}if(!k(e)&&!A(e)){let t=e;return Ue(e)&&Ni(t)?Pi(t,d,n):(0,F.jsx)(Vn,{event:t,...d,isLastMessage:n})}return(0,F.jsx)(Q,{event:e,isLastMessage:n})}var Li=(e,t)=>{if(k(e)){let{kind:n}=e.action;return!(n===`FinishAction`||n===`ThinkAction`||Kr(e,t))}return A(e)?!(Pe(e)||Kr(e,t)||e.observation.kind===`TaskTrackerObservation`):!1},Ri=(e,t=2,n=e)=>{if(t<1)throw Error(`minSize must be at least 1`);let r=[],i=new Set,a=null,o=()=>{a&&=(a.events.length>=t?r.push({kind:`group`,events:a.events,startIndex:a.startIndex}):a.events.forEach((e,t)=>{r.push({kind:`single`,event:e,index:a.startIndex+t})}),null)};return e.forEach((e,t)=>{if(Li(e,A(e)?n.find(t=>k(t)&&t.id===e.action_id):void 0)){let s=Je(e,n);s&&!i.has(s.id)&&(o(),i.add(s.id),r.push({kind:`thought`,action:s,index:t})),a||={events:[],startIndex:t},a.events.push(e)}else o(),r.push({kind:`single`,event:e,index:t})}),o(),r},zi=(0,P.createContext)(!1);function Bi({events:e,allEvents:t,isFinalized:n=!1,children:r}){let{t:i}=s(`openhands`),[a,o]=P.useState(!1),c=P.useId(),l=`${c}-toggle`;if(e.length===0)return null;let u=e.find(e=>k(e)),d=e.filter(A).length,f=e.length,p=!!u,m=e[e.length-1],g=null;m&&(k(m)?g=fi(m).title:A(m)&&(g=fi(m,(t??e).find(e=>k(e)&&e.id===m.action_id)).title));let _=p?i(h.EVENT_GROUP$ACTIONS_PROGRESS,{completed:d,total:f}):i(h.EVENT_GROUP$ACTIONS_COMPLETED,{count:f}),v=a?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,F.jsx)(`button`,{id:l,type:`button`,onClick:()=>o(e=>!e),"aria-controls":c,"aria-expanded":a,"aria-label":i(a?h.EVENT_GROUP$COLLAPSE:h.EVENT_GROUP$EXPAND),"data-testid":`event-group-toggle`,className:`w-full flex items-center justify-between gap-2 text-left cursor-pointer`,children:n?(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:_})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:(0,F.jsx)(en.Provider,{value:!1,children:g??_})})]}),(0,F.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:_}),p?(0,F.jsx)(re,{"data-testid":`spinner-icon`,className:`h-4 w-4 ml-2 inline animate-spin text-[var(--oh-muted)]`}):null]})]})}),a&&(0,F.jsx)(`div`,{id:c,role:`region`,"aria-labelledby":l,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,F.jsx)(zi.Provider,{value:!0,children:r})})]})}function Vi({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ue,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:v(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function Hi({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:v(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,F.jsx)(`span`,{className:``,children:n}),(0,F.jsx)(`span`,{className:`font-bold`,children:i}),(0,F.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Ui=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Wi=de(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Gi=()=>l({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return $e.respondToConfirmation(e,t,i,n)}});function Ki(){let e=Wi(e=>e.submittedEventIds),t=Wi(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=Qe(),{curAgentState:i}=Ae(),{mutate:a}=Gi(),o=Me(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===_.AWAITING_USER_CONFIRMATION:!1),c=(0,P.useCallback)(e=>{!o||!r||(o.id&&t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,P.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),c(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),c(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,c]),i!==_.AWAITING_USER_CONFIRMATION||!o||o.id!==void 0&&e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(k(o)?o.security_risk:g.UNKNOWN)===g.HIGH&&(0,F.jsx)(Hi,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Ui,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Vi,{type:`reject`,onClick:()=>c(!1)}),(0,F.jsx)(Vi,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var qi=e=>e.at(-1)?.id,$=e=>e.at(-1),Ji=P.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=M(),r=ki(t),i=et(e=>n?e.entriesByConversation[n]:void 0),a=P.useMemo(()=>{if(!i||i.length===0)return null;let e=new Set;for(let t of i)t.anchorEventId!==null&&e.add(t.anchorEventId);return e.size>0?e:null},[i]),o=e=>{if(!a||e===void 0)return null;let t=String(e);return a.has(t)?(0,F.jsx)(vt,{conversationId:n,anchorEventId:t}):null},s=P.useMemo(()=>Ri(e,void 0,t),[e,t]),c=(n,i,a)=>(0,F.jsx)(Ii,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,F.jsxs)(F.Fragment,{children:[s.map((e,n)=>{if(e.kind===`single`)return(0,F.jsxs)(P.Fragment,{children:[c(e.event,e.index,!0),o(e.event.id)]},`single-${e.event.id}`);if(e.kind===`thought`)return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(bi,{event:e.action}),o(e.action.id)]},`thought-${e.action.id}`);let r=n<s.length-1,i=e.events[0]?.id??`group-${e.startIndex}`;return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(Bi,{events:e.events,allEvents:t,isFinalized:r,children:e.events.map((t,n)=>c(t,e.startIndex+n,!0))}),e.events.map(e=>(0,F.jsx)(P.Fragment,{children:o(e.id)},`model-${e.id}`))]},`group-${i}`)}),(0,F.jsx)(Ki,{})]})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&qi(e.messages)===qi(t.messages)&&qi(e.allEvents)===qi(t.allEvents)&&$(e.messages)===$(t.messages)&&$(e.allEvents)===$(t.allEvents));Ji.displayName=`Messages`;export{R as A,jt as C,vt as D,yt as E,ct as M,st as N,ht as O,ot as P,Pt as S,Ct as T,Xt as _,hr as a,Ht as b,Qn as c,_n as d,H as f,$t as g,an as h,jr as i,lt as j,ft as k,kn as l,on as m,Ri as n,mr as o,un as p,Hr as r,pr as s,Ji as t,On as u,Yt as v,xt as w,Wt as x,qt as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{K as r,t as i}from"./utils-BOco8mxR.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,a.jsx)(`path`,{d:`M12 4L4 12M4 4L12 12`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})});function s({onClose:e,testId:t,className:s,disabled:c=!1}){let{t:l}=n(`openhands`);return(0,a.jsx)(`button`,{type:`button`,"data-testid":t,onClick:e,disabled:c,"aria-label":l(r.BUTTON$CLOSE),className:i(`absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,s),children:(0,a.jsx)(o,{"aria-hidden":!0,className:`size-4`})})}export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{F as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{i as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";import{t as s}from"./useMutation-CJuK90oc.js";import{t as c}from"./useQueries-CykmpT-a.js";import{t as l}from"./useQuery-S6j94er1.js";import{L as u,n as d}from"./active-backend-context-rZiLJRUc.js";import{K as f,t as p}from"./utils-BOco8mxR.js";import{n as m}from"./agent-server-client-options-BikiNwTa.js";import{_ as h,s as g,v as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as v}from"./use-onboarding-completion-CoINurkm.js";import{n as y}from"./use-settings-Dn00UISA.js";import{t as b}from"./modal-backdrop-BSzNhM4r.js";import{r as x,t as S}from"./modal-body-DJw4xBki.js";import{r as C}from"./base-modal-DTULovNc.js";import{i as w}from"./modal-classes-Dg0ngBPO.js";import{t as T}from"./brand-button-DxPO4Lf8.js";import{m as E}from"./use-llm-configured-DGm8FiRR.js";import{t as D}from"./confirmation-modal-gIFHeZt6.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as ee}from"./onboarding-modal-DDTjOpyd.js";import{t as k}from"./folder-C1ou4_DT.js";import{t as A}from"./close-ScPlnwyq.js";var te=o(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),j=e(t(),1);function M(){return new g(m())}function N(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var P=class{static async listWorkspaces(){return N(await M().listWorkspaces())}static async addWorkspaces(e){return N(await M().addWorkspaces(e))}static async removeWorkspace(e){await M().deleteWorkspace(e)}static async addWorkspaceParents(e){return N(await M().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await M().deleteWorkspaceParent(e)}};function F({enabled:e=!0}={}){return l({queryKey:u.all,queryFn:()=>P.listWorkspaces(),enabled:e,retry:(e,t)=>!h(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function I(){return new _(m())}async function L(e,t=I()){let n=[],r=new Set,i;for(;;){let a=await t.searchSubdirectories(e,i?{pageId:i}:void 0);if(n.push(...a.items),i=a.next_page_id,!i)return{items:n,next_page_id:null};if(r.has(i))throw Error(`File search returned a repeated page id`);r.add(i)}}var R=e=>{let t=d();return l({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>L(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},z=()=>{let e=d();return l({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>I().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function ne(){let{data:e,isLoading:t,isError:n,error:r}=F(),i=h(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,j.useMemo)(()=>{let e=new Set(o.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?o:[...o,...t]},[o,i]),l=c({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>L(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,j.useMemo)(()=>{let e=new Map,t=new Map(s.map((e,t)=>[e.path,l[t]]));return s.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,s,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),parents:s,isLoading:u,isError:d,error:r}}var B=n();function re(){return(0,B.jsx)(E,{inset:`menu`})}function ie(){let e=i();return s({mutationFn:e=>P.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function ae(){let e=i();return s({mutationFn:e=>P.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function V(){let e=i();return s({mutationFn:e=>P.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function H(){let e=i();return s({mutationFn:e=>P.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function U(e,t){return h(e)?t(f.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var W=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),G=`/projects`;function K({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:p(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,B.jsx)(k,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function q(e){let t=Y(e);if(!t||t===`/`||J(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function J(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function Y(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function X(e){return e?.home===`/home/openhands`}function oe({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,j.useState)(null),c=d(),{data:l}=z();(0,j.useEffect)(()=>{e&&l?.home&&o===null&&s(X(l)?G:l.home),e||s(null)},[e,l?.home,o]),(0,j.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:m,isError:h,error:g}=R(e?o:null),_=(0,j.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:Y(l.home)||l.home},...l.favorites??[]];return X(l)&&!e.some(e=>e.path===G)&&e.push({label:G,path:G}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],E=o?q(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!m&&!h&&y.length===0,O=e=>{let t=Y(e);if(!t)return`/`;if(t===`/`||J(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,B.jsx)(b,{onClose:t,"aria-label":i(f.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`xl`),S,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(C,{className:w,title:i(f.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,B.jsx)(K,{label:i(f.HOME$FAVORITES),entries:_,currentPath:o,onPick:s}),(0,B.jsx)(K,{label:i(f.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&s(E),disabled:!E,"aria-label":i(f.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(W,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,B.jsx)(`span`,{children:i(f.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(f.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[m&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(f.HOME$LOADING)}),h&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:g?.message??i(f.COMMON$FAILED_TO_LOAD)}),!m&&!h&&y.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":D?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(D?f.HOME$HOST_HOME_NOT_MOUNTED_HINT:f.HOME$NO_WORKSPACES)}),y.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(f.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(T,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(f.HOME$CANCEL)}),r&&(0,B.jsx)(T,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||m,testId:`folder-browser-add-all-subdirs`,children:i(f.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(T,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||m,testId:`folder-browser-use`,children:i(f.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Z({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=j.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let m=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b,{onClose:r,"aria-label":s(f.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`lg`),S,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(C,{className:w,title:s(f.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!m&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(f.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(f.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(f.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(A,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(f.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(f.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(f.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(f.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(A,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(f.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,B.jsx)(k,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(T,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(f.HOME$DONE)})})]})}),c&&(0,B.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var se=`previewOnboardingStep`,ce=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(se);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ce?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function le(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.trim().length>0,r=e?.llm_api_key_set===!0||O(t);return n&&r}function ue(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=v(),{backend:o}=d(),s=y(),c=o.kind===`cloud`||o.id!==`default-local`;return!n&&(i||c&&s.isLoading||c&&le(s.data))?null:(0,B.jsx)(ee,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{U as a,ae as c,ne as d,F as f,oe as i,H as l,$ as n,V as o,te as p,Z as r,ie as s,ue as t,re as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{i as a,t as o}from"./recommended-automations-launcher-YLAQTp4s.js";import{ct as s,dt as c,n as l,r as u,st as d}from"./active-backend-context-rZiLJRUc.js";import{K as f,t as p}from"./utils-BOco8mxR.js";import{A as m,M as h,O as g,p as _,v,w as y}from"./agent-server-client-options-BikiNwTa.js";import{c as b}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js";import{t as x}from"./chat-send-button-B3SFSIg5.js";import{t as S}from"./check-fDEfgSzj.js";import{t as C}from"./circle-check-ClTzJTdb.js";import{a as w,i as T,n as E,r as D,t as O}from"./use-acp-credential-form-BARcvjYE.js";import{t as k}from"./loader-circle-Dex47vVW.js";import{c as A,s as j,t as M}from"./backend-form-modal-0aJmWdsa.js";import{a as N,r as P,t as F}from"./llm-settings-B3SjHDmA.js";import{o as I}from"./use-onboarding-completion-CoINurkm.js";import{t as L}from"./use-tracking-B9prBsrq.js";import{n as ee}from"./use-settings-Dn00UISA.js";import{t as R}from"./use-save-settings-3U5K9-8x.js";import{t as te}from"./modal-backdrop-BSzNhM4r.js";import{r as ne,t as re}from"./modal-body-DJw4xBki.js";import{t as z}from"./brand-button-DxPO4Lf8.js";import{n as B}from"./navigation-context-CQZwH_tC.js";import{t as V}from"./openhands-logo-BS-Epajy.js";import{c as H,i as U,n as W,o as G}from"./acp-providers-DrjNsPOH.js";import{n as ie,t as ae}from"./agent-profiles-service.api-Biieml2L.js";import{n as oe}from"./use-create-conversation-1YgmAHt-.js";import{t as se}from"./terminal-BUpID2wS.js";import{c as ce,r as le}from"./sidebar-onboarding-checklist-storage-DbDX-Wvj.js";import{a as ue}from"./badge-CcGx2TaV.js";import{t as de}from"./use-save-agent-profile-CxyO9YG-.js";import{n as fe}from"./use-activate-agent-profile-BLKML6vQ.js";var K=e(n(),1),q=r(),pe=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,me=`0 0 100 100`,he=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,ge=`0 0 12 12`,_e=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,ve=`0 0 24 24`,ye=3/2;function J({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,q.jsx)(V,{width:Math.round(t*ye),height:t,className:p(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:me,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:pe})}):e===`codex`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ge,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:he,fill:`currentColor`})}):e===`gemini`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ve,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:_e})}):(0,q.jsx)(se,{width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function be({currentStep:e,totalSteps:t,className:n}){return(0,q.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:p(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,q.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:p(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function xe(e){return e===`openhands`?`openhands`:W.find(({key:t})=>t===e)?.icon??`cli-generic`}function Se({id:e,muted:t}){let n=xe(e);return n===`openhands`?(0,q.jsx)(J,{kind:`openhands`,size:16,className:p(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,q.jsx)(J,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Ce(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:f.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...W.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function we({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),{mutate:o,isPending:l}=R();return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(f.ONBOARDING$AGENT_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(f.ONBOARDING$AGENT_SUBTITLE)})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":a(f.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Ce().map(n=>{let r=n.id===e;return(0,q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:p(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Se,{id:n.id,muted:!1}),(0,q.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,q.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(n.descriptionKey)})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,q.jsx)(S,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,q.jsxs)(`div`,{className:p(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,q.jsx)(z,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:l,children:a(f.ONBOARDING$BACK)}):null,(0,q.jsx)(z,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:l,onClick:()=>{let t=U(e);if(!t){r();return}o({agent_settings_diff:t},{onError:e=>{d(c(e)||a(f.ERROR$GENERIC))},onSuccess:()=>{s(a(f.SETTINGS$SAVED)),r()}})},children:a(l?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function Te({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:p(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,q.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(f.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,q.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(f.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=j(r,e,{isConnected:t,lastError:n});return(0,q.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,q.jsx)(b,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,q.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(f.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,q.jsx)(k,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,q.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(f.ONBOARDING$BACKEND_CHECKING)})]})}function Ee({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:a,addBackend:o,setActive:s,updateBackend:c}=u(),{trackBackendAdded:l}=L(),{backend:d}=a,b=_(d),x=g(),S=x!==null&&!b&&!(d.kind===`cloud`&&h(d.host,x)),C=b||S,w=K.useMemo(()=>y(),[]),T=C?{id:`onboarding-local-backend-draft`,name:v,host:w.baseUrl,apiKey:w.sessionApiKey,kind:`local`}:d,E=I(b?[]:[d]),D=C?null:E[d.id]?.isConnected??null,O=C?null:E[d.id]?.lastError??null,[k,j]=K.useState(!1);K.useEffect(()=>{D===!0&&j(!1)},[D]);let N=D===!0&&!k,P=K.useCallback((e,r)=>{if(b)o(e);else{let t=e.host!==d.host;c(d.id,e),t&&a.orgId!==null&&s(d.id,null)}l({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),x!==null&&e.kind===`cloud`&&n?n():t()},[a.orgId,o,d.host,d.id,x,b,n,t,s,l,c]),F=p(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(C?x?f.ONBOARDING$LOGIN_TO_CLOUD_TITLE:f.BACKEND$ADD_TITLE:f.ONBOARDING$BACKEND_TITLE)}),C?null:(0,q.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$BACKEND_SUBTITLE)})]}),C?null:(0,q.jsx)(Te,{backend:T,isConnected:D,lastError:O}),D===!0?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>j(e=>!e),"aria-expanded":k,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,q.jsx)(`span`,{children:r(k?f.ONBOARDING$BACKEND_HIDE_CONFIGURATION:f.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,q.jsx)(A,{className:p(`h-4 w-4 shrink-0 text-muted transition-transform`,k&&`rotate-180`),"aria-hidden":!0})]}):null,(0,q.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:N?null:(0,q.jsx)(M,{onConnected:P,testIdRoot:`onboarding-backend`,initialManualBackend:T,requireManualApiKey:m(),manualSubmitLabel:r(f.ONBOARDING$NEXT),manualSubmittingLabel:r(f.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),N?(0,q.jsxs)(`div`,{className:F,children:[e?(0,q.jsx)(z,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(f.ONBOARDING$BACK)}):null,(0,q.jsx)(z,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(f.ONBOARDING$NEXT)})]}):null]})}var Y=ie;function X(){let e=de(),t=fe();return(0,K.useCallback)(async n=>{try{await e.mutateAsync({name:Y,profile:n});let r=(await ae.getProfile(Y)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var De=`openai/gpt-5.6-sol`;function Oe({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=l(),a=r.kind===`local`,o=P(),s=N(),c=X(),[u,d]=K.useState(null),[p,m]=K.useState(!1),h=K.useCallback(async()=>{if(!a||!u)return null;let e=u.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,i=ue(t),c={model:t};n&&(c.api_key=n),r&&(c.base_url=r);try{return await o.mutateAsync({name:i,request:{llm:c,include_secrets:!0}}),await s.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[a,u,o,s]),g=K.useCallback(async()=>{m(!0);try{let e=await h();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{m(!1),t()}},[h,c,t]);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(f.ONBOARDING$LLM_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(f.ONBOARDING$LLM_SUBTITLE)})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,q.jsx)(F,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":De},onSaveSuccess:g,onSaveControlChange:d})}),(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(z,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(f.ONBOARDING$BACK)}),(0,q.jsx)(z,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(u?.isSaving??!1)||p,onClick:()=>{if(u?.isDirty){u.save();return}t()},children:n(f.ONBOARDING$NEXT)})]})]})}function ke({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),o=l(),{status:s,isChecking:c}=E(e,{enabled:t}),{fields:u,values:d,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,credentialsConfigured:_,consumesFileCredentials:v,save:y,isSaving:b}=O(e),x=X(),S=H(e)??e,C=s===`authenticated`,k=Ae(o.backend.kind,s),A=C||u.some(e=>e.secret&&(!e.multiline||v)&&h(e.name)),j=k&&!A,M=b||j||c&&!A;return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(f.ONBOARDING$ACP_SECRETS_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(f.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:S})}),k&&!C?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:a(f.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:S})}):s!==`authenticated`&&(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(f.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,q.jsx)(T,{status:s,isChecking:c,credentialsConfigured:_,providerName:S,testIdPrefix:`onboarding-acp-auth`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-5`,children:u.map(e=>(0,q.jsx)(D,{field:e,value:d[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,q.jsx)(w,{conflicts:g}),j?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:a(f.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(z,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:b,children:a(f.ONBOARDING$BACK)}),(0,q.jsx)(z,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:M,onClick:async()=>{await y()&&(e!==`openhands`&&await x({agent_kind:`acp`,acp_server:e,acp_model:G(e)??void 0}),r())},children:a(b?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function Ae(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function je({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:s}=B(),{backend:c}=l(),u=c.kind!==`cloud`,d=r(f.ONBOARDING$HELLO_DEFAULT_MESSAGE),[p,m]=K.useState(d),{mutate:h,isPending:g,isSuccess:_}=oe(),v=a(),y=g||_||v,b=K.useRef(!1),S=p.trim().length>0&&!y&&!b.current,C=()=>{!S||b.current||(b.current=!0,h({query:p.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{s(`/conversations/${e.conversation_id}`),n()},onError:()=>{b.current=!1}}))};return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,q.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(f.ONBOARDING$HELLO_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$HELLO_SUBTITLE)})]}),(0,q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),C()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,q.jsx)(`div`,{className:`relative w-full`,children:(0,q.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,q.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(f.ONBOARDING$HELLO_TITLE),type:`text`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},placeholder:d,disabled:y,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,q.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,q.jsx)(x,{buttonClassName:``,handleSubmit:C,disabled:!S})})]}),u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,q.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(f.LANDING$OR)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,q.jsx)(o,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,q.jsx)(z,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:y,children:r(f.ONBOARDING$BACK)}),(0,q.jsx)(z,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:y,children:r(f.BUTTON$CLOSE)})]})]})}var Me=t({OnboardingModal:()=>$}),Z=[`backend`,`agent`,`setup`,`hello`],Ne=[`agent`,`setup`,`hello`],Pe=`openhands-onboarding-started`;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,q.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:p(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function $({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:a}=ee(),o=a?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:c,trackOnboardingCompleted:l,trackOnboardingSkipped:d}=L(),{active:m}=u(),{backend:v}=m,y=_(v),b=I(y?[]:[v]),x=g(),S=x!==null&&v.kind===`cloud`&&h(v.host,x),C=!y&&b[v.id]?.isConnected===!0&&(x===null||S),w=C?Ne:Z,[T,E]=K.useState(()=>Z[Math.min(Math.max(t,0),Z.length-1)]),[D,O]=K.useState(`openhands`),[k,A]=K.useState(()=>le());K.useEffect(()=>{w.includes(T)||E(w[0])},[T,w]);let j=w.length,M=w.includes(T)?T:w[0],N=w.indexOf(M),P=e=>{let t=e.target.checked;A(t),ce(t)},F=y||b[v.id]?.isConnected!==void 0,R=D===`openhands`,z=N===0&&g()!==null,B=K.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[w]),V=K.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[w]),H=K.useRef(!1);K.useEffect(()=>{n||!o||H.current||window.sessionStorage.getItem(Pe)||(H.current=!0,window.sessionStorage.setItem(Pe,`1`),s())},[n,o]);let U=K.useRef(null);K.useEffect(()=>{n||!o||!F||U.current!==M&&(U.current=M,c({step:M,stepIndex:N,totalSteps:j,agent:D}))},[n,o,F,M,N,j,D]);let W=()=>{l({agent:D}),e()},G=()=>{d({step:M,stepIndex:N,totalSteps:j,agent:D}),e()};return(0,q.jsx)(te,{"aria-label":r(f.ONBOARDING$TITLE),children:(0,q.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,q.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":N,"data-preview":n?`true`:void 0,className:p(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,ne(`lg`),re,`max-h-[90vh]`),children:[(0,q.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,q.jsx)(be,{currentStep:N,totalSteps:j})}),(0,q.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`min-h-0 overflow-y-auto custom-scrollbar-always px-7 pb-7`,children:(0,q.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":N,className:`relative overflow-clip`,children:[C?null:(0,q.jsx)(Q,{index:w.indexOf(`backend`),currentStep:N,children:(0,q.jsx)(Ee,{onNext:B,onClose:e})}),(0,q.jsx)(Q,{index:w.indexOf(`agent`),currentStep:N,children:(0,q.jsx)(we,{selectedAgentId:D,onSelect:O,onBack:C?void 0:V,onNext:B})}),(0,q.jsx)(Q,{index:w.indexOf(`setup`),currentStep:N,children:R?(0,q.jsx)(Oe,{onBack:V,onNext:B}):(0,q.jsx)(ke,{providerKey:D,isActive:M===`setup`,onBack:V,onNext:B})}),(0,q.jsx)(Q,{index:w.indexOf(`hello`),currentStep:N,children:(0,q.jsx)(je,{onBack:V,onClose:G,onLaunched:W})})]})})]}),N<j-1&&!z?(0,q.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:G,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(f.ONBOARDING$SKIP)}):null,M===`hello`?(0,q.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,q.jsx)(`input`,{"data-testid":`onboarding-skip-getting-started-checklist`,type:`checkbox`,checked:k,onChange:P,className:`size-4 cursor-pointer`}),r(f.ONBOARDING$SKIP_GETTING_STARTED_CHECKLIST)]}):null]})})}export{Me as n,J as r,$ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{K as i}from"./utils-BOco8mxR.js";import{E as a,d as o}from"./messages-DUSeANAh.js";import{t as s}from"./list-todo-ByXMdY4W.js";import{t as c}from"./brand-button-DxPO4Lf8.js";import{t as l}from"./conversation-store-DVVfkCsk.js";import{N as u}from"./llm-not-configured-banner-z_QRSeV0.js";import{_ as d,t as f,tt as p}from"./markdown-renderer-rivLvYh-.js";import{t as m}from"./conversation-tab-empty-state-DKlzAz5c.js";var h=e(t(),1),g=n();function _(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:_,scrollDomToBottom:v}=a(h.useRef(null)),{planContent:y,conversationMode:b,localPlanningConversationId:x,setPlanContent:S}=l(),{data:C}=p(),{mutate:w}=d();h.useEffect(()=>{let e=x??C?.id;!e||y!==null||w({conversationId:e},{onSuccess:e=>{S(e)},onError:()=>{}})},[C?.id,x,y,w,S]),h.useEffect(()=>{_&&v()},[y,_,v]);let T=b===`plan`,{handlePlanClick:E,hasPlanner:D,isCreatingConversation:O}=u();return y==null?(0,g.jsx)(m,{icon:(0,g.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,g.jsx)(c,{type:`button`,variant:`secondary`,onClick:E,isDisabled:T||O||D,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,g.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,g.jsx)(f,{includeStandard:!0,components:o,children:y})})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{S as a,_ as o,_t as s,at as c,b as l,c as u,d,ht as f,m as p,mt as m,nt as h,o as g,pt as _,rt as v,s as y,t as b,x,y as S}from"./active-backend-context-rZiLJRUc.js";import{t as C}from"./utils-BOco8mxR.js";import{n as w,t as T}from"./agent-server-ui-style-scope-DdG0ZAHu.js";var E=e(t());function D({i18n:e,defaultNS:t,children:n}){let i=(0,E.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,E.createElement)(r.Provider,{value:i},n)}function O(){let e=(0,E.useSyncExternalStore)(S,d,()=>`pending`),t=(0,E.useRef)(!1);(0,E.useEffect)(()=>{t.current||(t.current=!0,x())},[]),(0,E.useEffect)(()=>{e===`granted`&&a()},[e]);let n=(0,E.useCallback)(()=>o(`granted`),[]),r=(0,E.useCallback)(()=>o(`denied`),[]),i=(0,E.useCallback)((e,t)=>{l(e,t)},[]),s=(0,E.useCallback)(()=>g(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:s}}var k=n(),A=`posthog_bootstrap`;function j(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.distinctID==`string`&&typeof t.sessionID==`string`}function M(){if(typeof window>`u`||typeof sessionStorage>`u`)return;let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`distinct_id`),n=e.get(`session_id`);if(t&&n){let e={distinctID:t,sessionID:n};try{sessionStorage.setItem(A,JSON.stringify(e))}catch{}try{window.history.replaceState(null,``,window.location.pathname+window.location.search)}catch{}return e}try{let e=sessionStorage.getItem(A);if(!e)return;sessionStorage.removeItem(A);let t=JSON.parse(e);return j(t)?t:void 0}catch{try{sessionStorage.removeItem(A)}catch{}return}}function N(){return O(),null}function P({children:e,config:t={}}){let n=E.useRef(!1),r=t!==!1,i=t===!1?void 0:t.apiKey,a=t===!1?void 0:t.apiHost,o=t===!1?void 0:t.uiHost;return E.useLayoutEffect(()=>{u(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(y(M()),!0)},[r,a,i,o]),E.useEffect(()=>{r&&p().catch(()=>{})},[r,a,i,o]),(0,k.jsxs)(k.Fragment,{children:[r?(0,k.jsx)(N,{}):null,e]})}function F({children:e,theme:t=w,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=E.useMemo(()=>({...T,...i,...r}),[r,i]);return(0,k.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,k.jsx)(`div`,{className:C(t,a,`text-foreground`),"data-theme":t,children:e})})}var I={provider:`posthog`};function L({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,withStyleRoot:p=!0}){let g=E.useMemo(()=>t??h(),[t]),y=E.useMemo(()=>r??m(),[r]),x=E.useRef(null);x.current||={queryClient:v(),i18n:f()},c(g),s(y),E.useEffect(()=>()=>{x.current&&(c(x.current.queryClient),s(x.current.i18n))},[]);let S=(0,k.jsx)(P,{config:n&&n.provider===`posthog`?{apiKey:n.apiKey,apiHost:n.apiHost,uiHost:n.uiHost}:!1,children:e});return(0,k.jsx)(D,{i18n:y,defaultNS:_,children:(0,k.jsx)(i,{client:g,children:(0,k.jsx)(b,{children:p?(0,k.jsx)(F,{className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,children:S}):S})})})}export{I as n,F as r,L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as e,T as t,c as n,t as r}from"./agent-server-client-options-BikiNwTa.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";function a(e){if(e)return e;let t=n().backend;if(t.kind!==`cloud`)throw Error(`Cloud calls require a cloud backend.`);return t}function o(e){let t=n();return t.backend.id===e.id?t.orgId:null}function s(n){let r=a(n),s=e(),c=s?t():{};return new i({host:r.host,apiKey:r.apiKey,orgId:o(r),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let t=s(e);if(!t.proxy)throw new r;return t}async function l(e){return(e.hostOverride?c(e.backend):s(e.backend)).request({method:e.method,path:e.path,body:e.body,headers:e.headers,timeoutSeconds:e.timeoutSeconds,hostOverride:e.hostOverride,authMode:e.authMode===void 0||e.authMode===`bearer`?`bearer`:e.authMode,sessionApiKey:e.sessionApiKey,responseType:e.responseType})}export{l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{C as r,d as i,r as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{dt as s,gt as c,n as l,st as u}from"./active-backend-context-rZiLJRUc.js";import{H as d,K as f,t as p}from"./utils-BOco8mxR.js";import{t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js";import{B as h,H as g,I as _,O as v,P as ee,V as y,j as b,t as te,w as ne,z as x}from"./use-tracking-B9prBsrq.js";import{l as re}from"./settings-service.api-9_xdv_mh.js";import{n as ie}from"./use-settings-Dn00UISA.js";import{t as S}from"./modal-backdrop-BSzNhM4r.js";import{n as C}from"./modal-classes-Dg0ngBPO.js";import{t as w}from"./brand-button-DxPO4Lf8.js";import{n as T}from"./navigation-context-CQZwH_tC.js";import{o as ae,s as oe,t as se}from"./conversation-store-DVVfkCsk.js";import{t as E}from"./modal-close-button-B9j4nasm.js";import{n as ce}from"./use-create-conversation-1YgmAHt-.js";import{p as D,t as le}from"./install-server-modal-DUiZMc8u.js";import{t as O}from"./scroll-fade-state-Dt_fx2kf.js";import{t as ue}from"./use-automations-Cg0PDIZr.js";import{a as k,i as A,n as j,r as M,t as N}from"./extension-module-card-classes-DpeaYhYo.js";import{t as P}from"./secrets-service-Cr8g8xuv.js";import{t as F}from"./use-create-secret-D8p9ybQj.js";import{f as de,n as I,o as L,u as R}from"./mcp-marketplace-utils-Cn_NIMWM.js";import{t as z}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{n as B}from"./skill-card-pill-row-989y15jV.js";import{t as V}from"./circle-plus-check-toggle-Fr-h-mbL.js";var H=e(t(),1);function U(e,t){let n=a(t);return fe({filters:{...e,status:`pending`}},n).length}function W(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function fe(e={},t){let n=a(t).getMutationCache(),o=H.useRef(e),s=H.useRef(null);return s.current===null&&(s.current=W(n,e)),H.useEffect(()=>{o.current=e}),H.useSyncExternalStore(H.useCallback(e=>n.subscribe(()=>{let t=r(s.current,W(n,o.current));s.current!==t&&(s.current=t,i.schedule(e))}),[n]),()=>s.current,()=>s.current)}var G=()=>{let e=T(),t=U({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},K=`OPENHANDS_URL`;function pe(){let e=l(),t=a(),{mutateAsync:n}=F();return(0,H.useCallback)(async()=>{let r;try{r=await t.fetchQuery({queryKey:[`secrets`,e.backend.id,e.orgId],queryFn:P.getSecretsOrThrow,staleTime:0,retry:!1,meta:{disableToast:!0}})}catch(e){return u(s(e)||c.t(f.ERROR$GENERIC)),!1}if(r.some(e=>e.name===K))return!0;try{await n({name:K,value:window.location.origin})}catch{return!1}return await t.invalidateQueries({queryKey:[`secrets`]}),!0},[e.backend.id,e.orgId,n,t])}var me=`${d.PRODUCTION}/settings/integrations`;function he(e){let t=b(),n=g(e);return n.length>0&&n.every(e=>t.includes(e))}function ge(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:f.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:f.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:f.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:me}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var _e=[`local`,`openhands-cloud`];function q(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}function J(e){return e.trim().toLowerCase().replace(/&/g,`and`).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function ve(e){return[e.id,e.name,e.name?`${e.name} Agent`:void 0,e.skill].filter(e=>!!e).map(J)}function ye(e,t){let n=new Set(t.map(e=>J(e.name)));return ve(e).some(e=>n.has(e))}function Y(e){return v().includes(e.id)}function be(e){return _.findById(e.id)==null}function xe(e){let t=q(m).filter(t=>!ye(t,e));return{proven:t.filter(Y),conversation:t.filter(e=>!Y(e)&&be(e))}}function Se(e){return[...e.proven,...e.conversation]}var Ce=2;function we(e){let[t,n]=(0,H.useState)(!1),r=(0,H.useRef)(0),i=(0,H.useRef)(0),a=(0,H.useRef)(!1),o=(0,H.useCallback)(t=>{let o=e.current;t.button!==0||!o||(a.current=!1,r.current=t.clientX,i.current=o.scrollLeft,n(!0))},[e]),s=(0,H.useCallback)(e=>{a.current&&(a.current=!1,e.preventDefault(),e.stopPropagation())},[]),c=(0,H.useCallback)(e=>{e.preventDefault()},[]);return(0,H.useEffect)(()=>{if(!t)return;let o=t=>{let o=e.current;if(o){if(!(t.buttons&1)){n(!1);return}if(!a.current){if(Math.abs(t.clientX-r.current)<Ce)return;a.current=!0}t.preventDefault(),o.scrollLeft=i.current-(t.clientX-r.current)}},s=()=>n(!1);return document.addEventListener(`mousemove`,o),document.addEventListener(`mouseup`,s),()=>{document.removeEventListener(`mousemove`,o),document.removeEventListener(`mouseup`,s)}},[t,e]),{handleMouseDown:o,handleClickCapture:s,handleDragStart:c}}var X=`pb-12`,Z=n(),Te=`flex h-10 items-start`;function Ee(e){return y(e).flatMap(e=>{let t=L(e,z);return t?[t]:[]})}function De({automation:e,entries:t,testId:n}){let r=t.slice(0,4),i=r.length>1,a=x(e);return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":i&&!a?`overlap`:void 0,className:p(Te,i&&!a&&`-space-x-2`),children:a?(0,Z.jsx)(D,{entry:null,size:`base`,fallback:(0,H.createElement)(a,{className:`h-5 w-5`,strokeWidth:2.25})}):r.length===0?(0,Z.jsx)(D,{entry:null,size:`base`}):r.map(e=>(0,Z.jsx)(D,{entry:e,size:`base`,className:i?`ring-2 ring-[var(--oh-color-base-secondary)]`:void 0},e.id))})}function Oe({installedAutomations:e,onSelect:t,className:n}){let{t:r}=o(`openhands`),i=Se(xe(e)),a=(0,H.useRef)(null),{handleMouseDown:s,handleClickCapture:c,handleDragStart:l}=we(a),[u,d]=(0,H.useState)({left:!1,right:!1}),m=(0,H.useCallback)(()=>{let e=a.current;if(!e)return;let t=O(e);d(e=>e.left===t.left&&e.right===t.right?e:t)},[]);return(0,H.useLayoutEffect)(()=>{m();let e=a.current;if(!e)return;let t=new ResizeObserver(m);return t.observe(e),Array.from(e.children).forEach(e=>{t.observe(e)}),()=>t.disconnect()},[m,i.map(e=>e.id).join(`,`)]),i.length===0?null:(0,Z.jsxs)(`section`,{"data-testid":`recommended-automations-rail`,"aria-label":r(f.RECOMMENDED_AUTOMATIONS$SECTION_LABEL),className:p(`w-full`,X,n),children:[(0,Z.jsx)(`h2`,{className:`mb-2 text-sm font-medium text-[var(--oh-foreground)]`,children:r(f.RECOMMENDED_AUTOMATIONS$SECTION_LABEL)}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{ref:a,role:`list`,"data-testid":`recommended-automations-rail-scroll`,onScroll:m,onMouseDown:s,onClickCapture:c,onDragStart:l,className:`flex flex-nowrap gap-3 overflow-x-auto scrollbar-hide select-none`,children:i.map(e=>(0,Z.jsx)(`div`,{role:`listitem`,children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`recommended-automation-rail-card-${e.id}`,onClick:()=>t(e),className:p(`flex w-[220px] shrink-0 flex-col gap-3 p-3 text-left`,k,M),children:[(0,Z.jsx)(De,{automation:e,entries:Ee(e),testId:`recommended-automation-rail-icon-${e.id}`}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})},e.id))}),(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-testid":`recommended-automations-rail-fade-left`,"data-visible":u.left?`true`:`false`,className:p(`pointer-events-none absolute inset-y-0 left-0 z-10 w-10`,`bg-gradient-to-r from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,u.left?`opacity-100`:`opacity-0`)}),(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-testid":`recommended-automations-rail-fade-right`,"data-visible":u.right?`true`:`false`,className:p(`pointer-events-none absolute inset-y-0 right-0 z-10 w-10`,`bg-gradient-to-l from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,u.right?`opacity-100`:`opacity-0`)})]})]})}var ke=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function Ae(e){return e.slice(0,4)}function je({entries:e,className:t,testId:n}){let r=Ae(e);if(r.length===0)return(0,Z.jsx)(D,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,Z.jsx)(D,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:p(ke,`items-center justify-center`,t),children:(0,Z.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,Z.jsx)(D,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:p(ke,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,Z.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,Z.jsx)(D,{entry:e,size:`xs`})},e.id):(0,Z.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function Q({count:e}){return(0,Z.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}var Me=q(m);function Ne(e){return v().includes(e.id)}function Pe(e){return y(e).map(e=>{let t=L(e,z);return{id:e,entry:t,mcpInstallable:!!t&&R(t)}})}function Fe(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,h(e),...t.flatMap(({entry:e,id:t})=>e?[e.name,t,...e.keywords??[]]:[t])].join(` `).toLowerCase().includes(r):!0}function Ie(e,t,n,r){let i=e.map(({id:e,entry:n,mcpInstallable:i})=>{let a=!!n&&I(n,t),o=n?.name??e;return{id:`integration-${e}`,node:(0,Z.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Z.jsx)(D,{entry:n,size:`xs`}),o,a?(0,Z.jsx)(`span`,{className:`text-white`,children:r(f.RECOMMENDED_AUTOMATIONS$CONNECTED)}):n?i?null:(0,Z.jsx)(`span`,{className:`text-tertiary-alt`,"data-testid":`automation-integration-external-${e}`,children:r(f.RECOMMENDED_AUTOMATIONS$EXTERNAL_SETUP)}):(0,Z.jsx)(`span`,{className:`text-tertiary-alt`,"data-testid":`recommended-automation-integration-${e}`,children:r(f.RECOMMENDED_AUTOMATIONS$UNKNOWN_SETUP)})]})}});return n>0&&i.push({id:`missing-connect`,node:(0,Z.jsx)(`span`,{className:A,children:r(f.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function Le({automation:e,integrations:t,size:n,testId:r}){let i=x(e);return i?(0,Z.jsx)(D,{entry:null,size:n,testId:r,fallback:(0,H.createElement)(i,{className:`h-5 w-5`,strokeWidth:2.25})}):(0,Z.jsx)(je,{entries:t.flatMap(({entry:e})=>e?[e]:[]),testId:r})}function $({automations:e,installedServers:t,onSelect:n,translate:r}){return(0,Z.jsx)(`div`,{className:p(`mt-3`,N),children:e.map(e=>{let i=Pe(e),a=i.filter(({entry:e,mcpInstallable:n})=>!!e&&n&&!I(e,t)).length;return(0,Z.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>n(e),className:p(`flex min-w-0 overflow-hidden p-4 text-left`,k,M),children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,Z.jsx)(Le,{automation:e,integrations:i,size:`md`,testId:`recommended-automation-icon-${e.id}`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,Z.jsx)(V,{testId:`recommended-automation-plus-${e.id}`})]}),(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,Z.jsx)(B,{pills:Ie(i,t,a,r),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})}function Re({backendKind:e,installedServers:t,query:n=``,onSelect:r,scrollableGrid:i=!1}){let{t:a}=o(`openhands`),s=Me.filter(e=>Fe(e,Pe(e),n));if(s.length===0)return null;let c=s.filter(Ne),l=s.filter(e=>!Ne(e));return(0,Z.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:p(i&&`flex min-h-0 flex-1 flex-col`),children:(0,Z.jsxs)(`div`,{"data-testid":i?`recommended-automations-scroll-area`:void 0,className:p(`mt-3`,j,i&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[c.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:a(f.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,Z.jsx)(Q,{count:c.length})]}),(0,Z.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:a(f.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,Z.jsx)($,{automations:c,installedServers:t,onSelect:r,translate:a})]}),l.length>0&&(0,Z.jsxs)(`section`,{"data-testid":`recommended-automations-beta-section`,className:p(c.length>0&&`mt-8`),children:[(0,Z.jsxs)(`div`,{"data-testid":`recommended-automations-beta-heading`,className:`flex items-center`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:a(f.RECOMMENDED_AUTOMATIONS$BETA_LABEL)}),(0,Z.jsx)(Q,{count:l.length})]}),(0,Z.jsx)($,{automations:l,installedServers:t,onSelect:r,translate:a})]})]})})}function ze({isOpen:e,isPending:t,onClose:n,onContinueLocal:r,onOpenUrl:i}){let{t:a}=o(`openhands`);return e?(0,Z.jsx)(S,{onClose:n,closeOnEscape:!t,closeOnBackdropClick:!t,"aria-label":a(f.RESPONDER_DEPLOYMENT$TITLE),children:(0,Z.jsxs)(`div`,{"data-testid":`responder-deployment-modal`,className:`relative flex w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Z.jsx)(E,{onClose:n,testId:`responder-deployment-modal-close`,disabled:t}),(0,Z.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,Z.jsx)(`h2`,{className:p(`pr-6`,C),children:a(f.RESPONDER_DEPLOYMENT$TITLE)}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:a(f.RESPONDER_DEPLOYMENT$DESCRIPTION)})]}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 px-6 pb-6 sm:flex-row`,children:_e.map(e=>{let n=ge(e),{action:o}=n;return(0,Z.jsxs)(`div`,{"data-testid":n.testId,className:`flex flex-1 flex-col gap-3 rounded-xl border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:a(n.titleKey)}),(0,Z.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:a(n.descriptionKey)})]}),(0,Z.jsx)(w,{type:`button`,variant:`primary`,className:`mt-auto`,testId:n.primaryActionTestId,isDisabled:t,"aria-busy":t&&o.kind===`launch-local`?!0:void 0,onClick:()=>{o.kind===`launch-local`?r():i(o.url)},children:a(n.primaryActionKey)})]},n.target)})})]})}):null}function Be(e){return g(e).map(e=>L(e,z)).filter(e=>!!e).filter(R)}function Ve({query:e,onLaunched:t,scrollableGrid:n=!1,variant:r=`catalog`,className:i}){let a=l(),{navigate:o}=T(),{data:s}=ie(),{trackPrebuiltAutomationEnabled:c}=te(),u=ce(),d=pe(),f=G(),p=se(e=>e.setMessageToSend),[m,g]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)([]),S=(0,H.useRef)(!1),C=(0,H.useRef)(!1),w=(0,H.useRef)(!1),[E,D]=(0,H.useState)(!1),O=r===`rail`,{data:k,isLoading:A}=ue({enabled:O&&a.backend.kind===`local`}),j=(0,H.useMemo)(()=>de(s?.mcp_config??re(s?.agent_settings?.mcp_config)).filter(e=>e.enabled!==!1),[s?.agent_settings?.mcp_config,s?.mcp_config]),M=(0,H.useCallback)(e=>{if(C.current||u.isPending||f)return;if(C.current=!0,_.findById(e.id)){o?.(ne(e.id)),t?.();return}let n=h(e);u.mutate({},{onSuccess:r=>{c({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?oe(r.task_id,n):ae(r.conversation_id,{draftMessage:n}),o?.(`/conversations/${r.conversation_id}`),t?.(),window.setTimeout(()=>p(n),0)},onError:()=>{C.current=!1}})},[a.backend.kind,u,f,o,t,p,c]),N=(0,H.useCallback)(e=>Be(e).filter(e=>!I(e,j)),[j]),P=e=>{let t=N(e);if(t.length===0){M(e);return}g(e),x(t)},F=e=>{if(!(C.current||u.isPending||f||b.length>0||v!==null)){if(he(e)){y(e);return}P(e)}},L=async()=>{let e=v;if(!(!e||w.current)){w.current=!0,D(!0);try{if(!await d())return;y(null),P(e)}finally{w.current=!1,D(!1)}}},R=e=>{y(null),window.open(e,`_blank`,`noopener,noreferrer`)},z=()=>{y(null)},B=()=>{if(S.current){S.current=!1;return}g(null),x([])},V=()=>{S.current=!0,x(e=>{let t=e.slice(1);if(t.length===0){let e=m;window.setTimeout(()=>{g(null),e&&M(e)},0)}return t})},U=b[0]??null;return!ee()||a.backend.kind===`cloud`||O&&A?null:(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(Oe,{className:i,installedAutomations:k?.automations??[],onSelect:F}):(0,Z.jsx)(Re,{backendKind:a.backend.kind,installedServers:j,query:e,onSelect:F,scrollableGrid:n}),U&&(0,Z.jsx)(le,{entry:U,existingServers:j,onClose:B,onSuccess:V},U.id),(0,Z.jsx)(ze,{isOpen:v!==null,isPending:E,onClose:z,onContinueLocal:L,onOpenUrl:R})]})}export{U as a,G as i,Q as n,X as r,Ve as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-q1NdFisr.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/active-backend-context-rZiLJRUc.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/agent-server-client-options-BikiNwTa.js","assets/utils-BOco8mxR.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js","assets/useQuery-S6j94er1.js","assets/backend-form-modal-0aJmWdsa.js","assets/chevron-down-CFrWHqu8.js","assets/cloud-funnel-analytics-BQanUEEC.js","assets/info-CTIdjttz.js","assets/use-tracking-B9prBsrq.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BPjI-atc.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js","assets/bot-CLMxGFaq.js","assets/proxy-CBgMd2zf.js","assets/use-onboarding-completion-CoINurkm.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js","assets/useQueries-CykmpT-a.js","assets/organization-service.api-Cyg1Tn03.js","assets/brand-button-DxPO4Lf8.js","assets/form-control-classes-B-z85REi.js","assets/settings-input-C0dd8Utu.js","assets/modal-backdrop-BSzNhM4r.js","assets/modal-body-DJw4xBki.js","assets/modal-close-button-B9j4nasm.js","assets/navigation-context-CQZwH_tC.js","assets/modal-classes-Dg0ngBPO.js","assets/pencil-D5c47kyN.js","assets/plus-B3wvU06-.js","assets/refresh-cw-DEQdPCpH.js","assets/trash-2-ZhKuTLiz.js","assets/confirmation-modal-gIFHeZt6.js","assets/use-cloud-current-user-id-Dk0rjr63.js","assets/api-key-entry-screen-CsMuBhoP.js","assets/onboarding-modal-DDTjOpyd.js","assets/recommended-automations-launcher-YLAQTp4s.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js","assets/conversation-store-DVVfkCsk.js","assets/secrets-service-Cr8g8xuv.js","assets/settings-service.api-9_xdv_mh.js","assets/settings-CKqk8ZnH.js","assets/install-server-modal-DUiZMc8u.js","assets/useMutation-CJuK90oc.js","assets/styled-tooltip-Pd22BIvr.js","assets/use-settings-Dn00UISA.js","assets/mcp-marketplace-utils-Cn_NIMWM.js","assets/skill-card-pill-row-989y15jV.js","assets/extension-module-card-classes-DpeaYhYo.js","assets/circle-plus-check-toggle-Fr-h-mbL.js","assets/checkmark-XZyokq_Y.js","assets/x-mark-BopmFoBq.js","assets/use-create-conversation-1YgmAHt-.js","assets/agent-server-conversation-service.api-DYFsNHKf.js","assets/profiles-service.api-BbOK0EkF.js","assets/llm-subscription-service-aDNBQ7Gq.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-DrjNsPOH.js","assets/skill-enablement-DXeaImBz.js","assets/agent-profiles-service.api-Biieml2L.js","assets/plugins-management-service-Bh_pBuf-.js","assets/use-agent-profiles-1P91KSXz.js","assets/use-llm-profiles-BTTtpW4z.js","assets/use-create-secret-D8p9ybQj.js","assets/use-automations-Cg0PDIZr.js","assets/automation-C_eCrGyP.js","assets/scroll-fade-state-Dt_fx2kf.js","assets/chat-send-button-B3SFSIg5.js","assets/check-fDEfgSzj.js","assets/circle-check-ClTzJTdb.js","assets/use-acp-credential-form-BARcvjYE.js","assets/loader-circle-Dex47vVW.js","assets/use-get-secrets-CQ4b0qK8.js","assets/llm-settings-B3SjHDmA.js","assets/back-nav-button-B8tH0BEp.js","assets/navigation-link-Bxo3-4vo.js","assets/map-provider-DXvssjw9.js","assets/external-link-DQtv7eTh.js","assets/triangle-alert-BajLPpQg.js","assets/use-can-manage-org-profiles-BbN6KfDr.js","assets/dropdown-classes-B9kJVDIk.js","assets/badge-CcGx2TaV.js","assets/base-modal-DTULovNc.js","assets/sdk-section-page-Da73Rs_o.js","assets/switch-skeleton-DwOoCqaL.js","assets/schema-field-CK0xYNbO.js","assets/dist-Bl64nBZL.js","assets/settings-dropdown-input-DVpyD87C.js","assets/settings-switch-B78Khmyz.js","assets/toggle-switch-lwQtxDcm.js","assets/use-is-authed-BRPjCRKM.js","assets/typography-HLLg_FAn.js","assets/use-save-settings-3U5K9-8x.js","assets/copy-to-clipboard-button-B3w0X7WH.js","assets/copy-Drmhc2jD.js","assets/loading-spinner-DfHI77BA.js","assets/settings-section-header-context-BOJ_Fbak.js","assets/u-check-circle-BKn1spCL.js","assets/u-edit-DAkcF52u.js","assets/api-error-message-Ve79qDcN.js","assets/format-model-name-CasAP3nd.js","assets/settings-list-classes-Ds4jPBHK.js","assets/openhands-logo-BS-Epajy.js","assets/sidebar-onboarding-checklist-storage-DbDX-Wvj.js","assets/use-activate-agent-profile-BLKML6vQ.js","assets/use-save-agent-profile-CxyO9YG-.js","assets/terminal-BUpID2wS.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{F as i,R as a,U as o,_ as s,g as c,l,p as u,u as d,z as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{r as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{l as h,t as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";import{t as _}from"./useQuery-S6j94er1.js";import{r as v}from"./providers-2gIIkz2N.js";import{B as y,W as b,Y as ee,Z as x,_ as S,n as C,ot as w,pt as T,r as te,yt as E}from"./active-backend-context-rZiLJRUc.js";import{K as D}from"./utils-BOco8mxR.js";import{D as O,M as ne,O as k,j as re,u as A}from"./agent-server-client-options-BikiNwTa.js";import{n as ie,o as j,r as M,t as N}from"./use-onboarding-completion-CoINurkm.js";import{t as P}from"./loading-spinner-DfHI77BA.js";import{t as F}from"./use-config-DpafU_QP.js";import{n as I}from"./use-settings-Dn00UISA.js";import{t as L}from"./use-save-settings-3U5K9-8x.js";import{t as R}from"./modal-backdrop-BSzNhM4r.js";import{n as z}from"./modal-body-DJw4xBki.js";import{n as B,r as V}from"./base-modal-DTULovNc.js";import{t as H}from"./brand-button-DxPO4Lf8.js";import{t as U}from"./navigation-context-CQZwH_tC.js";import{i as W,n as G}from"./color-themes-DTj5Ylbr.js";var K=e(t(),1),q=`/api/authenticate`,J=`/login`,Y=`returnTo`,ae=new Set([`localhost`,`127.0.0.1`,`::1`]);function oe(){return typeof window>`u`?`/`:`${window.location.pathname}${window.location.search}${window.location.hash}`}function se(){return typeof window>`u`?!1:ae.has(window.location.hostname)}function ce(){return O()===`cookie`&&!se()}async function le(){try{return await h.post(q,null,{withCredentials:!0}),!0}catch(e){if(h.isAxiosError(e)&&e.response?.status===401)return!1;throw e}}function ue(e=oe()){return`${J}?${new URLSearchParams({[Y]:e}).toString()}`}function de(){typeof window>`u`||window.location.assign(ue())}var X=r();function fe({backend:e,onChoice:t}){let{t:n,ready:r}=m(T),i=j([e])[e.id]?.isConnected===!0,{data:a,isSuccess:o}=I(),{mutateAsync:s,isPending:c}=L(),[l,u]=K.useState(!1),[d,f]=K.useState(!1);K.useEffect(()=>{f(!1)},[e.id]);let p=i&&o&&a?.user_consents_to_analytics===null&&!d;return K.useEffect(()=>{if(r&&p){let e=setTimeout(()=>u(!0),50);return()=>clearTimeout(e)}u(!1)},[r,p]),!p||!l?null:(0,X.jsx)(R,{elevated:!0,"aria-label":n(D.TELEMETRY$CONSENT_TITLE),children:(0,X.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:async e=>{e.preventDefault();let n=new FormData(e.currentTarget).get(`analytics`)===`on`;try{await s({user_consents_to_analytics:n})}catch{return}f(!0),await S(n?`granted`:`denied`),t?.(n)},className:`flex flex-col gap-2`,children:(0,X.jsxs)(z,{className:`border border-[var(--oh-border)]`,children:[(0,X.jsx)(V,{title:n(D.TELEMETRY$CONSENT_TITLE)}),(0,X.jsx)(B,{children:n(D.TELEMETRY$CONSENT_DESCRIPTION)}),(0,X.jsx)(`p`,{className:`text-xs text-neutral-400`,children:n(D.TELEMETRY$BACKEND_SCOPE,{name:e.name,host:e.host})}),(0,X.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,X.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),n(D.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,X.jsx)(H,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,isDisabled:c,children:n(D.TELEMETRY$CONFIRM_PREFERENCES)})]})})})}function Z({onChoice:e}){let{backend:t}=C();return k()!==null||t.kind!==`local`?null:(0,X.jsx)(fe,{backend:t,onChoice:e})}function pe(){return K.useEffect(()=>{G(W())},[]),null}var me=K.lazy(()=>n(()=>import(`./manage-backends-modal-q1NdFisr.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__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]))),Q=K.lazy(()=>n(()=>import(`./api-key-entry-screen-CsMuBhoP.js`),__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,10,12,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),he=K.lazy(()=>n(()=>import(`./onboarding-modal-DDTjOpyd.js`).then(e=>e.n).then(e=>({default:e.OnboardingModal})),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,17,10,41,42,43,16,18,11,19,20,44,45,46,47,48,25,26,27,49,28,30,50,51,32,52,53,54,55,56,31,57,58,22,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,12,13,14,15,21,23,24,29,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111]))),ge=K.lazy(()=>n(()=>import(`./backend-form-modal-0aJmWdsa.js`).then(e=>e.i).then(e=>({default:e.BackendFormModal})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])));function _e({children:e}){return(0,X.jsxs)(`html`,{lang:`en`,children:[(0,X.jsxs)(`head`,{children:[(0,X.jsx)(`meta`,{charSet:`utf-8`}),(0,X.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,X.jsx)(d,{}),(0,X.jsx)(l,{})]}),(0,X.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,X.jsxs)(v,{contentClassName:`min-h-screen`,children:[(0,X.jsx)(pe,{}),e,(0,X.jsx)(g,{toastOptions:w}),(0,X.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,X.jsx)(s,{}),(0,X.jsx)(c,{})]})]})}function $(){return(0,X.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,X.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,X.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,X.jsx)(P,{size:`large`})})})})}function ve(){let e=p(),t=K.useCallback(()=>{A()&&(b(),e.invalidateQueries({queryKey:y.WEB_CLIENT_CONFIG}))},[e]);return(0,X.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(K.Suspense,{fallback:null,children:(0,X.jsx)(me,{onClose:t,recoveryMode:!0})})})}function ye({onClose:e}){let t=i(),n=a(),r=f(),o=t.pathname.match(/^\/conversations\/([^/]+)/)?.[1]??null,s=K.useMemo(()=>({currentPath:t.pathname,conversationId:o,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[o,t.pathname,n,r.location]);return k()===null?(0,X.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(U,{value:s,children:(0,X.jsx)(K.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(he,{onClose:e})})})}):(0,X.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(K.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(ge,{mode:`add`,onClose:e,source:`manage_backends_modal`,hideCloseButton:!0})})})}var be=()=>[{rel:`icon`,type:`image/svg+xml`,href:E(`/favicon.svg`)}],xe=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Se=o(function(){let e=re(),t=!!A()?.apiKey,n=e&&!t,{active:r}=te(),i=p(),a=k(),o=O(),s=a!==null,c=s&&r.backend.kind===`cloud`&&ne(r.backend.host,a),{isCompleted:l,markCompleted:d}=N(),f=ce(),m=s?!f&&(!c||o!==`cookie`&&!l):!l,h=_({queryKey:y.MAIN_APP_COOKIE_AUTH,queryFn:le,enabled:f&&!m,retry:!1,staleTime:1e3*60*5,meta:{disableToast:!0}}),g=f&&!m&&h.isPending&&!h.isError,v=f&&h.data===!1,b=!f||h.data===!0||h.isError;K.useEffect(()=>{v&&de()},[v]);let S=F({enabled:!n&&!m&&b}),C=j(r.backend.kind===`cloud`&&b?[r.backend]:[])[r.backend.id],w=r.backend.kind===`cloud`&&C?.isConnected===!1&&M(C.lastError),T=f&&w;K.useEffect(()=>{T&&i.invalidateQueries({queryKey:y.MAIN_APP_COOKIE_AUTH})},[T,i]);let E=r.backend.kind===`cloud`&&C?.disabled===!0&&ie(C.lastError);return m?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ye,{onClose:d}),(0,X.jsx)(Z,{})]}):g||v||T&&h.isFetching?(0,X.jsx)($,{}):n||ee(S.error)?(0,X.jsx)(K.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(Q,{})}):S.isPending||S.isLoading?(0,X.jsx)($,{}):w||E||x(S.error)?(0,X.jsx)(ve,{}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(u,{}),(0,X.jsx)(Z,{})]})});export{_e as Layout,Se as default,be as links,xe as meta};
|