@openhands/agent-canvas 1.10.0 → 1.11.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-DLe_gVDY.js → acp-providers-BkL3HWa3.js} +1 -1
- package/build/assets/{active-backend-context-B0wI7OzM.js → active-backend-context-BBvP-bI2.js} +1 -1
- package/build/assets/{agent-context-settings-CaQtdNA-.js → agent-context-settings-Bno1nwPL.js} +1 -1
- package/build/assets/{agent-profiles-settings-CvuErjp6.js → agent-profiles-settings-DqoS7RL3.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +86 -0
- package/build/assets/agent-settings-BJHryp65.js +1 -0
- package/build/assets/{agent-settings-UE-U4Xii.js → agent-settings-h8hQz-IU.js} +1 -1
- package/build/assets/{alert-banner-BMaOtTCG.js → alert-banner-lrK-2_0Y.js} +1 -1
- package/build/assets/{api-key-entry-screen-Cy66vT4D.js → api-key-entry-screen-Qsb83VX1.js} +1 -1
- package/build/assets/{app-settings-9ok42bV6.js → app-settings-r1RUbgGi.js} +1 -1
- package/build/assets/{automation-detail-fuITm6i3.js → automation-detail-7LkL91j9.js} +3 -3
- package/build/assets/{automation-export-CRq40mux.js → automation-export-U2QNyNy6.js} +1 -1
- package/build/assets/{automation-setup-route-EXDazOHW.js → automation-setup-route-Bel9_Lue.js} +1 -1
- package/build/assets/{automation-templates-BArZsaxP.js → automation-templates-CRLDssaI.js} +1 -1
- package/build/assets/{automations-list-CG4HKOTn.js → automations-list-B2iV3ZKW.js} +1 -1
- package/build/assets/{back-nav-button-BZB6H7xz.js → back-nav-button-B3pYwmUJ.js} +1 -1
- package/build/assets/backend-form-modal-OroTqnAv.js +1 -0
- package/build/assets/{backend-synced-settings-badge-B_NXJ3u1.js → backend-synced-settings-badge-DB4717Iu.js} +1 -1
- package/build/assets/{badge-C64c-7PO.js → badge-yR53enbU.js} +1 -1
- package/build/assets/{base-modal-C0RQPug5.js → base-modal-3NmIOKDm.js} +1 -1
- package/build/assets/{brand-button-DJmFCyMK.js → brand-button-CJcwjnfb.js} +1 -1
- package/build/assets/{browser-D3gd2n83.js → browser--eoQOo4M.js} +1 -1
- package/build/assets/{browser-tab-BicAWuJ1.js → browser-tab-A94o33Vn.js} +1 -1
- package/build/assets/{chat-send-button-CCrH1E8u.js → chat-send-button-B8n6-DQA.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-CB_sNERY.js → circle-plus-check-toggle-BVzv5EkZ.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-XynamQGU.js → cloud-funnel-analytics-CBQdPZl_.js} +1 -1
- package/build/assets/{combobox-caret-Bwiifgjs.js → combobox-caret-BlmRwiM8.js} +1 -1
- package/build/assets/command-menu-PsRXVBz2.js +1 -0
- package/build/assets/{condenser-settings-cNGy75gq.js → condenser-settings-w7L3EFvm.js} +1 -1
- package/build/assets/{confirmation-modal-BATFmFyP.js → confirmation-modal-DAH0XtOp.js} +1 -1
- package/build/assets/{context-menu-list-item-DhJCcBA0.js → context-menu-list-item-BQhmFVEK.js} +1 -1
- package/build/assets/{conversation-Csdxh9Xt.js → conversation-BUzBZAc-.js} +4 -4
- package/build/assets/conversation-panel-pzAKsSDb.js +1 -0
- package/build/assets/conversation-pzAKsSDb.js +1 -0
- package/build/assets/{conversation-state-store-C2QzhPaK.js → conversation-state-store-Bs8gA263.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-D3fb5xIA.js → conversation-tab-empty-state-C9sfDOlt.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-c4MQwKGj.js → copy-to-clipboard-button-DatoElj8.js} +1 -1
- package/build/assets/{device-verify-oFpQoLgm.js → device-verify-BIjXeW9N.js} +1 -1
- package/build/assets/{dropdown-classes-f91ARMV1.js → dropdown-classes-zFW7qPSK.js} +1 -1
- package/build/assets/{entry.client-BCzY2Bf3.js → entry.client-DzbDyLkV.js} +2 -2
- package/build/assets/{enum-filter-dropdown-HG3q3rkV.js → enum-filter-dropdown-CctILg5t.js} +1 -1
- package/build/assets/{environment-switch-overlay-CquZXolz.js → environment-switch-overlay-Cvmo6clk.js} +1 -1
- package/build/assets/{extensions-hub-BeweE0PW.js → extensions-hub-DOmHPGTA.js} +1 -1
- package/build/assets/{extensions-navigation-Dd58NlUF.js → extensions-navigation-6zU5M1pa.js} +1 -1
- package/build/assets/{files-tab-CLLG55-q.js → files-tab-BzofBmF4.js} +1 -1
- package/build/assets/{form-control-classes-pHtZUI6K.js → form-control-classes-DLN3Qgub.js} +1 -1
- package/build/assets/{format-relative-time-6-3uvOXe.js → format-relative-time-DGPQlPx0.js} +1 -1
- package/build/assets/{git-provider-icon-wg7ShB98.js → git-provider-icon-BLMlwy02.js} +1 -1
- package/build/assets/{git-repo-dropdown-CWnaUyxL.js → git-repo-dropdown-B7RvO70z.js} +1 -1
- package/build/assets/git-repo-dropdown-B_PTq4ol.js +1 -0
- package/build/assets/{highlighted-source-view-DBtI3por.js → highlighted-source-view-CgJfD5VT.js} +1 -1
- package/build/assets/{home-BpZQkDWM.js → home-DEZaZqYv.js} +1 -1
- package/build/assets/home-r89Vj2td.js +1 -0
- package/build/assets/{home-store-DM4qw1lF.js → home-store-D7CjMN_-.js} +1 -1
- package/build/assets/index-home-r89Vj2td.js +1 -0
- package/build/assets/install-server-modal-BTwK5lbi.js +1 -0
- package/build/assets/{kebab-menu-item-content-By16Tm_0.js → kebab-menu-item-content-C4CkeiJO.js} +1 -1
- package/build/assets/{launch-C9uijypN.js → launch-DVlx4v9o.js} +1 -1
- package/build/assets/{llm-not-configured-banner-DrBrhfN0.js → llm-not-configured-banner-CwKu8C6g.js} +2 -2
- package/build/assets/llm-settings-BJotLQND.js +1 -0
- package/build/assets/llm-settings-CDM-5H2A.js +1 -0
- package/build/assets/{llm-subscription-service-DwjJ8-_X.js → llm-subscription-service-7eVfDIE1.js} +1 -1
- package/build/assets/{loading-spinner-6Yj-YyoS.js → loading-spinner-CN3riY7k.js} +1 -1
- package/build/assets/{manage-backends-modal-DrwErS0N.js → manage-backends-modal-HNWKLYhq.js} +1 -1
- package/build/assets/manifest-2a36a8f8.js +1 -0
- package/build/assets/{manifest-subpage-layout-CtqVwIvJ.js → manifest-subpage-layout-D-m-h8_t.js} +1 -1
- package/build/assets/map-provider-7Bp2aih5.js +1 -0
- package/build/assets/markdown-renderer-BiiiIznl.js +8 -0
- package/build/assets/mcp-gLgPP7AS.js +9 -0
- package/build/assets/{mcp-marketplace-utils-BMnYz0Gc.js → mcp-marketplace-utils-Dr_HG_ol.js} +1 -1
- package/build/assets/messages-D1cbVhRK.js +40 -0
- package/build/assets/{modal-body-BHGCSAtj.js → modal-body-duRaxj_K.js} +1 -1
- package/build/assets/{modal-classes-DSTLuxkA.js → modal-classes-CLEXO6dj.js} +1 -1
- package/build/assets/{modal-close-button-dheWZ2ys.js → modal-close-button-D0aT02hs.js} +1 -1
- package/build/assets/npm-DRzJF5Zn.js +1 -0
- package/build/assets/{onboarding-5CZvRBbh.js → onboarding-DSr8hOpk.js} +1 -1
- package/build/assets/{onboarding-modal-CD2ehuxt.js → onboarding-modal-C6Euf7N4.js} +1 -1
- package/build/assets/{organization-service.api-Dsuoep0g.js → organization-service.api-C4GYWwj9.js} +1 -1
- package/build/assets/{planner-tab-DeO7Thb0.js → planner-tab-CZcguxTK.js} +1 -1
- package/build/assets/{plugins-management-service-C9f75R6X.js → plugins-management-service-BmDzOQsd.js} +1 -1
- package/build/assets/{profiles-service.api-Dl20_2IM.js → profiles-service.api-CoLTwjc1.js} +1 -1
- package/build/assets/{providers-CeuhK46N.js → providers-tBzTpz1w.js} +1 -1
- package/build/assets/{proxy-CIGI9zQC.js → proxy-DCI9S-LA.js} +1 -1
- package/build/assets/recommended-automations-launcher-BbJAJVED.js +1 -0
- package/build/assets/root-BfM_kC_d.css +1 -0
- package/build/assets/root-gstBEjty.js +2 -0
- package/build/assets/root-layout-BIAFLP9p.js +2 -0
- package/build/assets/{schema-field-z2vSLuLo.js → schema-field-zhsVDllR.js} +1 -1
- package/build/assets/{sdk-section-page-BnCXAytf.js → sdk-section-page-CS4GWn0y.js} +1 -1
- package/build/assets/{secrets-service-DGUNlwQd.js → secrets-service-DjgGduXk.js} +1 -1
- package/build/assets/{secrets-settings-DUmML_dK.js → secrets-settings-f-qahfbi.js} +1 -1
- package/build/assets/{segmented-toggle-eSofF7gn.js → segmented-toggle-SmvsR3jW.js} +1 -1
- package/build/assets/settings-DQd0xLEw.js +1 -0
- package/build/assets/{settings-dropdown-input-Cx4g7Xfl.js → settings-dropdown-input-TWIeiG02.js} +1 -1
- package/build/assets/{settings-index-BECdgecg.js → settings-index-BVwy9JEp.js} +1 -1
- package/build/assets/{settings-input-BQY115xH.js → settings-input-D61Vzp9e.js} +1 -1
- package/build/assets/{settings-list-classes-C9cLrrcc.js → settings-list-classes-sE0ASr1s.js} +1 -1
- package/build/assets/{settings-modal-ChBJNTdd.js → settings-modal-D6D5ngET.js} +1 -1
- package/build/assets/{settings-service.api-Dz9cZyvx.js → settings-service.api-DZp7E7A9.js} +1 -1
- package/build/assets/{settings-switch-BIodMVz9.js → settings-switch-Drt-rF5s.js} +1 -1
- package/build/assets/{settings-utils-BL_Z9uIe.js → settings-utils-gw2ppAvw.js} +1 -1
- package/build/assets/{shared-conversation-CSF0aTuE.js → shared-conversation-DIxZjElr.js} +1 -1
- package/build/assets/{wrench-DRitTfwe.js → shield-check-D2cpEpv3.js} +1 -1
- package/build/assets/{sidebar-layout-DEycoFd_.js → sidebar-layout-Dxg6zc2K.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DeRvTupV.js → sidebar-mobile-menu-toggle-OoZBHxaT.js} +1 -1
- package/build/assets/{sidebar-nav-link-BjpQ-NVc.js → sidebar-nav-link-CxLoG-dG.js} +1 -1
- package/build/assets/sidebar-store-BJeYY-E9.js +1 -0
- package/build/assets/{skill-card-pill-row-BH6fPGba.js → skill-card-pill-row-B_BYBONu.js} +1 -1
- package/build/assets/{skill-icon-badge-D4uznfjU.js → skill-icon-badge-CN41Hy9l.js} +1 -1
- package/build/assets/{skill-scope-DH_AUUUP.js → skill-scope-B1Per5XI.js} +1 -1
- package/build/assets/{skills-plugins-vfvOk34h.js → skills-plugins-B3AO6sMz.js} +1 -1
- package/build/assets/skills-settings-DmmgJ6CT.js +2 -0
- package/build/assets/{styled-tooltip-CQ9JEFiO.js → styled-tooltip-C5C07RQC.js} +1 -1
- package/build/assets/{task-list-tab-DeF_uXdw.js → task-list-tab-C19Q_JNf.js} +1 -1
- package/build/assets/{terminal-DRc4rup7.js → terminal-CbuMRYal.js} +1 -1
- package/build/assets/{toggle-switch--8n8NeV_.js → toggle-switch-CIioisto.js} +1 -1
- package/build/assets/{typography-BSbUhJPn.js → typography-D9tiHct7.js} +1 -1
- package/build/assets/{use-acp-credential-form-BGKFi1VL.js → use-acp-credential-form-DJmmJKMo.js} +1 -1
- package/build/assets/{use-activate-agent-profile-2nvALjC-.js → use-activate-agent-profile-CeFfYwu_.js} +1 -1
- package/build/assets/{use-agent-profiles-BlQA67MW.js → use-agent-profiles-BHLkLbRR.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Clw5Dh1s.js → use-can-manage-org-profiles-Bu4y8gSx.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-B8AQSQFM.js → use-cloud-current-user-id-QD9x3ySO.js} +1 -1
- package/build/assets/{use-config-C3zGuUQI.js → use-config-CPwqciXN.js} +1 -1
- package/build/assets/{use-create-conversation-FaP0kUpg.js → use-create-conversation-DWaSVUOB.js} +1 -1
- package/build/assets/{use-create-secret-CgQ3pXd6.js → use-create-secret-BsOfOLvg.js} +1 -1
- package/build/assets/{use-llm-profiles-C-tDO6UB.js → use-llm-profiles-CU8ah1pz.js} +1 -1
- package/build/assets/{use-manifest-capabilities-DLP5wCxp.js → use-manifest-capabilities-DBYPjyV6.js} +1 -1
- package/build/assets/{use-onboarding-completion-BiCdXvlU.js → use-onboarding-completion-CtNJxkXG.js} +1 -1
- package/build/assets/{use-plugins-marketplace-DRFNLBlr.js → use-plugins-marketplace-ZEA-gyM9.js} +1 -1
- package/build/assets/{use-save-agent-profile-CaGVAudI.js → use-save-agent-profile-DgI_Uz9a.js} +1 -1
- package/build/assets/{use-save-settings-C9B8Y-h3.js → use-save-settings-pSjRhD_m.js} +1 -1
- package/build/assets/{use-settings-3RcgdUuZ.js → use-settings-BHWsOcIG.js} +1 -1
- package/build/assets/use-settings-nav-items-CQgkxUbV.js +16 -0
- package/build/assets/{use-tracking-CTtkLAmx.js → use-tracking-CGCsBWhg.js} +1 -1
- package/build/assets/{use-user-conversation-Bei82QsZ.js → use-user-conversation-DRfEU8x0.js} +1 -1
- package/build/assets/utils-DPQfkd-7.js +1 -0
- package/build/assets/{verification-settings-nD61Ijph.js → verification-settings-BItwt998.js} +1 -1
- package/build/assets/wrench-B1_H-tL1.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +39 -2
- package/build/locales/ca/openhands.json +39 -2
- package/build/locales/de/openhands.json +39 -2
- package/build/locales/en/openhands.json +39 -2
- package/build/locales/es/openhands.json +39 -2
- package/build/locales/fr/openhands.json +39 -2
- package/build/locales/it/openhands.json +39 -2
- package/build/locales/ja/openhands.json +39 -2
- package/build/locales/ko-KR/openhands.json +39 -2
- package/build/locales/no/openhands.json +39 -2
- package/build/locales/pt/openhands.json +39 -2
- package/build/locales/tr/openhands.json +39 -2
- package/build/locales/uk/openhands.json +39 -2
- package/build/locales/zh-CN/openhands.json +39 -2
- package/build/locales/zh-TW/openhands.json +39 -2
- package/config/defaults.json +1 -1
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +32 -5
- package/dist/api/agent-server-adapter.js +120 -91
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +19 -2
- package/dist/api/cloud/conversation-service.api.js +51 -47
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/conversation-file-upload.api.cjs +1 -1
- package/dist/api/conversation-file-upload.api.js +10 -10
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +55 -61
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.js +12 -12
- package/dist/api/launch-child-conversation-client-tool.cjs +47 -0
- package/dist/api/launch-child-conversation-client-tool.cjs.map +1 -0
- package/dist/api/launch-child-conversation-client-tool.d.ts +3 -0
- package/dist/api/launch-child-conversation-client-tool.js +93 -0
- package/dist/api/launch-child-conversation-client-tool.js.map +1 -0
- package/dist/api/open-hands.types.d.ts +1 -1
- package/dist/api/workspace-upload-path.cjs +1 -1
- package/dist/api/workspace-upload-path.js +8 -8
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +24 -18
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +5 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +2 -2
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +11 -7
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -2
- 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.d.ts +2 -8
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +48 -51
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.d.ts +12 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js +6 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.d.ts +16 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +95 -78
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js +40 -38
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +14 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +167 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +63 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +66 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.d.ts +15 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js +117 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js +30 -19
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +7 -2
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +146 -104
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +20 -0
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +53 -27
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +226 -213
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.d.ts +10 -5
- package/dist/components/features/settings/agent-canvas-update-card.js +223 -149
- package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -1
- package/dist/components/features/settings/agent-canvas-version-modal.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-modal.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-modal.d.ts +11 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js +166 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.d.ts +13 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js +60 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js.map +1 -0
- package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js.map +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.js +109 -108
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.js +9 -9
- package/dist/components/features/skills/extensions-navigation.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/child-conversation.cjs +2 -0
- package/dist/constants/child-conversation.cjs.map +1 -0
- package/dist/constants/child-conversation.d.ts +29 -0
- package/dist/constants/child-conversation.js +6 -0
- package/dist/constants/child-conversation.js.map +1 -0
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +189 -188
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
- package/dist/hooks/chat/use-model-interceptor.js +6 -6
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +6 -6
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +38 -1
- 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 +644 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/docker.cjs +2 -0
- package/dist/icons/docker.cjs.map +1 -0
- package/dist/icons/docker.js +19 -0
- package/dist/icons/docker.js.map +1 -0
- package/dist/icons/npm.cjs +2 -0
- package/dist/icons/npm.cjs.map +1 -0
- package/dist/icons/npm.js +19 -0
- package/dist/icons/npm.js.map +1 -0
- package/dist/locales/ar/openhands.json +39 -2
- package/dist/locales/ca/openhands.json +39 -2
- package/dist/locales/de/openhands.json +39 -2
- package/dist/locales/en/openhands.json +39 -2
- package/dist/locales/es/openhands.json +39 -2
- package/dist/locales/fr/openhands.json +39 -2
- package/dist/locales/it/openhands.json +39 -2
- package/dist/locales/ja/openhands.json +39 -2
- package/dist/locales/ko-KR/openhands.json +39 -2
- package/dist/locales/no/openhands.json +39 -2
- package/dist/locales/pt/openhands.json +39 -2
- package/dist/locales/tr/openhands.json +39 -2
- package/dist/locales/uk/openhands.json +39 -2
- package/dist/locales/zh-CN/openhands.json +39 -2
- package/dist/locales/zh-TW/openhands.json +39 -2
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js +35 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js +33 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +6 -3
- package/dist/package.js.map +1 -1
- package/dist/services/child-conversation-launch.cjs +2 -0
- package/dist/services/child-conversation-launch.cjs.map +1 -0
- package/dist/services/child-conversation-launch.d.ts +41 -0
- package/dist/services/child-conversation-launch.js +182 -0
- package/dist/services/child-conversation-launch.js.map +1 -0
- package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.d.ts +5 -1
- package/dist/stores/conversation-panel-preferences-store.js +8 -2
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/types/agent-server/core/base/action.d.ts +17 -1
- package/dist/types/agent-server/core/base/base.d.ts +2 -1
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +8 -1
- package/dist/types/agent-server/type-guards.js +4 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/types/automation.d.ts +14 -0
- package/dist/utils/custom-toast-handlers.cjs +1 -1
- package/dist/utils/custom-toast-handlers.cjs.map +1 -1
- package/dist/utils/custom-toast-handlers.js +18 -1
- package/dist/utils/custom-toast-handlers.js.map +1 -1
- package/package.json +6 -3
- package/scripts/brand-dev-electron.mjs +244 -0
- package/scripts/check-translation-completeness.cjs +4 -0
- package/scripts/generate-icons.mjs +109 -0
- package/build/assets/agent-server-conversation-service.api-km_8sOVf.js +0 -41
- package/build/assets/agent-settings-nmO-KSXr.js +0 -1
- package/build/assets/backend-form-modal-B_lXjOGa.js +0 -1
- package/build/assets/command-menu-CA3IjGNc.js +0 -1
- package/build/assets/conversation-B6t6EiVp.js +0 -1
- package/build/assets/conversation-panel-B6t6EiVp.js +0 -1
- package/build/assets/copy-DaHuDtG4.js +0 -1
- package/build/assets/git-repo-dropdown-TzOuG5Ef.js +0 -1
- package/build/assets/home-OEx0XtfP.js +0 -1
- package/build/assets/index-home-OEx0XtfP.js +0 -1
- package/build/assets/info-C9lpK5pw.js +0 -1
- package/build/assets/install-server-modal-DnjZrJUy.js +0 -1
- package/build/assets/list-filter-C86CBRDE.js +0 -1
- package/build/assets/llm-settings-CRsLqxgu.js +0 -1
- package/build/assets/llm-settings-RBm_3kNm.js +0 -1
- package/build/assets/manifest-c352d453.js +0 -1
- package/build/assets/map-provider-CXU6issd.js +0 -1
- package/build/assets/markdown-renderer-lsvsp7jn.js +0 -8
- package/build/assets/mcp-DD4hPTRE.js +0 -9
- package/build/assets/messages-Dt77e0qi.js +0 -40
- package/build/assets/recommended-automations-launcher-6xmbf7lh.js +0 -1
- package/build/assets/root-BQPNqNvD.js +0 -2
- package/build/assets/root-BeuHFY2s.css +0 -1
- package/build/assets/root-layout-Dl_2CDoq.js +0 -3
- package/build/assets/settings-Co-M5bK9.js +0 -1
- package/build/assets/sidebar-store-B04sX8aP.js +0 -1
- package/build/assets/skills-settings-DnbIu2eO.js +0 -2
- package/build/assets/use-settings-nav-items-y-Oyc93G.js +0 -16
- package/build/assets/utils-BX9XJ0IE.js +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
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{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{E as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as l}from"./useMutation-ChpkYxI5.js";import{t as u}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js";import{At as d,Ut as f,n as p}from"./active-backend-context-BBvP-bI2.js";import{P as m,T as h,t as g,w as _,z as v}from"./utils-DPQfkd-7.js";import{t as y}from"./chevron-down-CnIbtM6i.js";import{l as b}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js";import{t as ee}from"./loader-circle-C5AnEN8r.js";import{t as te}from"./use-config-CPwqciXN.js";import{n as ne}from"./use-settings-BHWsOcIG.js";import{n as x,o as re}from"./form-control-classes-DLN3Qgub.js";import{n as S}from"./navigation-context-CQZwH_tC.js";import{ot as C,st as w}from"./vendor-markdown-j0kYzV48.js";import{t as ie}from"./styled-tooltip-C5C07RQC.js";import{c as ae,f as oe,t as T}from"./conversation-store-B8Eahyeg.js";import{c as E,d as se,t as ce}from"./agent-server-conversation-service.api-0RztSdJJ.js";import{a as le,d as ue,h as de,i as fe,p as pe}from"./conversation-state-store-Bs8gA263.js";import{n as me}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{t as he}from"./skills-B0IliMxw.js";import{t as ge}from"./close-ScPlnwyq.js";import{t as _e}from"./copy-to-clipboard-button-DatoElj8.js";import{r as D}from"./typography-D9tiHct7.js";import{t as ve}from"./u-check-circle-BKn1spCL.js";import{D as ye,E as be,F as xe,G as Se,H as Ce,J as O,K as we,L as k,M as Te,O as A,P as Ee,R as De,T as Oe,a as ke,g as Ae,j as je,k as Me,m as Ne,n as Pe,p as Fe,q as Ie,r as Le,t as j,w as Re,x as ze,y as Be,z as Ve}from"./markdown-renderer-BiiiIznl.js";import{t as He}from"./syntax-highlighter-BGDg_7w9.js";var Ue=c(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),M=e(r(),1);function We(){!t.current&&i();let[e]=(0,M.useState)(n.current);return e}var N=a(),Ge=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}(Ge||{});function Ke(){let{conversationId:e}=O(),t=ke();return{send:(0,M.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 qe(e,t,n,r){return{action:Ge.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var P=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,N.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`})}),F=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,N.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 Je({status:e}){return(0,N.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,N.jsx)(me,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function I({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:c}=s(`openhands`),[l,u]=M.useState(r),d=t?(0,N.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`cursor-pointer text-left`,"aria-label":c(l?v.BUTTON$COLLAPSE:v.BUTTON$EXPAND),children:l?(0,N.jsx)(F,{className:g(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,N.jsx)(P,{className:g(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,N.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&d,o,(0,N.jsx)(`span`,{children:e}),i===`after`&&d]}),(0,N.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,N.jsx)(Je,{status:n})]})]}),l&&(typeof t==`string`?(0,N.jsx)(j,{children:t}):t)]})}var Ye=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,N.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`})}),Xe=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,N.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`})}),Ze={running:v.GOAL$STATUS_RUNNING,complete:v.GOAL$STATUS_COMPLETE,capped:v.GOAL$STATUS_CAPPED,interrupted:v.GOAL$STATUS_INTERRUPTED};function Qe({status:e}){let{t}=s(`openhands`),{conversationId:n}=O(),r=Ae(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,M.useState)(!1),{active:o,objective:c,iteration:l,max_iterations:u,verdict:f}=e,p=f?Math.round(f.score*100):null,m=f?.missing?t(v.GOAL$MISSING,{missing:f.missing}):``,h=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){d(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},_=()=>h(async e=>{await de(e),await ue(e)},v.GOAL$STOP_FAILED),y=()=>h(pe,v.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,N.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:_,className:g(x,re),children:t(v.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,N.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:y,className:g(x,re),children:t(v.GOAL$RESUME)})),(0,N.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,N.jsx)(I,{title:(0,N.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,N.jsx)(`span`,{className:`opacity-60`,children:t(v.GOAL$PREFIX)}),(0,N.jsx)(`span`,{children:c}),(0,N.jsx)(`span`,{className:`opacity-60`,children:t(v.GOAL$ROUND,{iteration:l,max:u})}),(0,N.jsx)(`span`,{children:t(Ze[e.status])}),p!==null&&(0,N.jsx)(`span`,{className:`opacity-60`,children:t(v.GOAL$SCORE,{score:p})}),o?(0,N.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,N.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,N.jsx)(Ye,{className:`w-3.5 h-3.5 fill-success`})}):(0,N.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,N.jsx)(Xe,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:m,initiallyExpanded:!o,chevronPosition:`before`})})}var $e=e=>(0,N.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,N.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,N.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,N.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,N.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,N.jsx)(`defs`,{children:(0,N.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,N.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function et({profile:e}){let[t,n]=M.useState(!1);return(0,N.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,N.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,N.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,N.jsx)(y,{size:14}):(0,N.jsx)(b,{size:14})}),(0,N.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`hr`,{className:`border-neutral-700`}),(0,N.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function tt({conversationId:e,anchorEventId:t}){let n=Ne(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,N.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,N.jsx)(I,{title:(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,N.jsx)($e,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,N.jsx)(u,{i18nKey:v.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,N.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,N.jsx)(I,{title:(0,N.jsx)(`span`,{children:t?(0,N.jsx)(u,{i18nKey:v.MODEL$NO_SAVED_PROFILES}):(0,N.jsx)(u,{i18nKey:v.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,N.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,N.jsx)(u,{i18nKey:v.MODEL$NO_PROFILES_HINT})}):(0,N.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,N.jsx)(et,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function nt(e){let[t,n]=(0,M.useState)(!0),[r,i]=(0,M.useState)(!0),a=(0,M.useRef)(0),o=(0,M.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,M.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,M.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var rt=(0,M.createContext)(void 0);function it({children:e,value:t}){let n=nt(M.useRef(null)),r=t||n;return(0,N.jsx)(rt.Provider,{value:r,children:e})}function at(){let e=(0,M.useContext)(rt);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function ot(){return(0,M.useContext)(rt)}var L=1e3,st=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,ct=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`}},lt={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},ut=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=lt[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},dt=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},ft=e=>e.length>1e3?`${e.slice(0,L)}...`:e,pt=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=dt(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=ft(dt(r).trim()),s=i?`**Error:**`:`Output:`,c=o||f.t(v.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a},R=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,mt=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),ht=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||mt(t)?null:t},gt=e=>{let t=ht(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:R(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?R(e.action.pattern,50):``}};case`GlobAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GLOB`,values:{pattern:e.action.pattern?R(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 se:return{kind:`text`,text:`CANVASUI`};case E:return{kind:`translation`,key:`ACTION_MESSAGE$LAUNCH_CHILD_CONVERSATION`,values:{}};default:return{kind:`text`,text:String(n).replace(`Action`,``).toUpperCase()}}},_t=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)}},vt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function yt(e){let{children:t}=e,n=e=>{try{return vt(e)}catch(t){return _t.error(String(t)),e}};return Array.isArray(t)?(0,N.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,N.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,N.jsx)(`strong`,{className:`font-mono`,children:t})}var bt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},xt=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,St=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return xt(e)&&!n.endsWith(`/`)?`${n}/`:n};function Ct(e){let{children:t}=e,n=e=>{try{let t=bt(e);return(0,N.jsx)(`span`,{className:`font-mono`,title:t,children:St(t)})}catch(t){return _t.error(String(t)),(0,N.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,N.jsx)(`strong`,{className:`font-mono`,children:t.map((e,t)=>typeof e==`string`?(0,N.jsx)(`span`,{children:n(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,N.jsx)(`strong`,{children:n(t)}):(0,N.jsx)(`strong`,{className:`font-mono`,children:t})}var wt=()=>{let{setConversationMode:e}=T(),{send:t}=Ke(),{conversationId:n}=O(),r=Be(e=>e.enqueuePendingMessage),i=Be(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,M.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(qe(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},Tt=`200%`,z=8,Et=z*2;function Dt({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=We(),c=`oh-text-shimmer-${(0,M.useId)().replace(/:/g,``)}`,l=(0,M.useMemo)(()=>Math.min(z/2-1,1+i/2),[i]),u=(0,M.useMemo)(()=>{let e=z/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) ${z}%)`,backgroundSize:`${Tt} 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,N.jsx)(t,{className:g(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${Et}% center}to{background-position:0% center}}`}}),(0,N.jsx)(t,{className:g(`relative inline-block`,n),style:u,...o,children:e})]})}var Ot=M.memo(Dt);function kt({className:e}){return(0,N.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,N.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,N.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var At=5,jt=360,Mt={p:({children:e})=>(0,N.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function Nt({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),a=M.useRef(null),[o,c]=M.useState(!1);M.useEffect(()=>{r(o)},[o,r]),M.useLayoutEffect(()=>{let t=a.current;if(!t||n){c(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=At*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=At||e.trim().length>jt)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let l=o&&!n;return(0,N.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,N.jsx)(`div`,{ref:a,className:g(`text-sm leading-6 whitespace-normal [word-break:break-word]`,l&&`line-clamp-5`),children:(0,N.jsx)(j,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:Mt,children:e})}),l?(0,N.jsxs)(N.Fragment,{children:[(0,N.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,N.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:g(`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(v.COMMON$VIEW_MORE)})]}):null]})}function B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onDismiss:c,onStop:l}){let{t:u}=s(`openhands`),[d,f]=M.useState(!1),[p,m]=M.useState(!1),[h,_]=M.useState(!1),[y,b]=M.useState(!1),[ee,te]=M.useState(!0),ne=M.useRef(null);M.useEffect(()=>{_(!1)},[t]);let x=async()=>{await navigator.clipboard.writeText(t),m(!0)};M.useEffect(()=>{let e;return p&&(e=setTimeout(()=>{m(!1)},2e3)),()=>{clearTimeout(e)}},[p]);let re=e===`user`&&(a===`error`||a===`sending`),S=a===`sending`&&l!=null,C=S&&d,w=e===`user`&&a==null,ae=w&&y&&!h,oe=M.Children.count(n)>0;M.useLayoutEffect(()=>{if(!S||w)return;let e=ne.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;te(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,S,w]);let T=w?(0,N.jsx)(Nt,{message:t,isHovering:d,isExpanded:h,onTruncatableChange:b}):(0,N.jsx)(`div`,{ref:ne,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,N.jsx)(j,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:Mt,children:t})}),E=(0,N.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:g(`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`,!re&&`last:mb-4`),children:[(0,N.jsxs)(`div`,{className:g(`absolute -top-2.5 -right-2.5 z-10`,!d||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,N.jsx)(ie,{content:e.tooltip,placement:`top`,children:(0,N.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,N.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,N.jsx)(_e,{isHidden:!d,isDisabled:p,onClick:x,mode:p?`copied`:`copy`})]}),T,S?(0,N.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":u(v.BUTTON$STOP),"aria-hidden":!C,tabIndex:C?0:-1,className:g(`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`,ee?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,C?`opacity-100`:`pointer-events-none opacity-0`),children:(0,N.jsx)(kt,{className:`block h-7 w-7 max-w-none`})}):null,ae?(0,N.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(v.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>_(!0)}):null,n]});return e===`user`&&a===`error`?(0,N.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[E,(0,N.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,N.jsx)(`span`,{children:u(v.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,N.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:u(v.CHAT_INTERFACE$MESSAGE_RETRY)}):null,c?(0,N.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:u(v.CHAT_INTERFACE$MESSAGE_DISMISS)}):null]})]}):e===`user`&&a===`sending`?(0,N.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[E,(0,N.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,N.jsx)(Ot,{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:u(v.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):E}function Pt(){let{conversationId:e}=Ie(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=T(),{setSelectedTab:a}=ae(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}function Ft(e){return{h1:({children:t,className:n})=>(0,N.jsx)(`h1`,{className:g(`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,N.jsx)(`h2`,{className:g(`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,N.jsx)(`h3`,{className:g(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,N.jsx)(`h4`,{className:g(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,N.jsx)(`h5`,{className:g(`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,N.jsx)(`h6`,{className:g(`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,N.jsx)(`p`,{className:g(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,N.jsx)(`ul`,{className:g(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,N.jsx)(`ol`,{className:g(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,N.jsx)(`li`,{className:g(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,N.jsx)(`a`,{className:g(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,N.jsx)(`code`,{className:g(`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 It=Ft(),Lt=300,Rt=Ft(`shine-text`);function zt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Pt(),{handleBuildPlanClick:a}=wt(),{scrollDomToBottom:o}=at(),c=()=>{i(`planner`)},l=(0,M.useCallback)(e=>{a(e),o()},[a,o]),u=(0,M.useMemo)(()=>e?e.length<=Lt?e:`${e.slice(0,Lt)}...`:``,[e]);return e?(0,N.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,N.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,N.jsx)(Le,{width:18,height:18,color:`var(--oh-muted)`}),(0,N.jsx)(D.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(v.COMMON$PLAN_MD)}),(0,N.jsx)(`div`,{className:`flex-1`}),(0,N.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,N.jsx)(D.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(v.COMMON$VIEW)}),(0,N.jsx)(Ue,{className:`text-white`,size:18})]})]}),(0,N.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:u&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(j,{includeStandard:!0,components:t?Rt:It,children:u}),e&&e.length>Lt&&(0,N.jsx)(`button`,{type:`button`,onClick:c,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(v.COMMON$READ_MORE)})]})}),(0,N.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,N.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:g(`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,N.jsxs)(D.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(v.COMMON$BUILD),` `,(0,N.jsx)(D.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function Bt({errorId:e,defaultMessage:t}){let{t:n}=s(`openhands`),[r,i]=M.useState(!1);return(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,N.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,N.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,N.jsx)(F,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,N.jsx)(P,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,N.jsx)(j,{children:t})]})}function Vt({event:e}){return Me(e)?(0,N.jsx)(Bt,{errorId:e.id,defaultMessage:e.error}):null}function Ht({width:e=20,height:t=20,active:n}){return(0,N.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,N.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 Ut({width:e=20,height:t=20,active:n}){return(0,N.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,N.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 Wt({onClick:e,className:t}){return(0,N.jsx)(`button`,{type:`button`,onClick:e,className:g(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,N.jsx)(ge,{width:18,height:18})})}function Gt({src:e,size:t=`small`}){return(0,N.jsx)(`img`,{role:`img`,alt:``,src:e,className:g(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Kt({src:e,onRemove:t,size:n=`small`}){return(0,N.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,N.jsx)(Gt,{src:e,size:n}),t&&(0,N.jsx)(Wt,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function qt({size:e=`small`,images:t,onRemove:n}){let r=M.useRef(null),[i,a]=M.useState(!1),[o,s]=M.useState(!0),[c,l]=M.useState(!1);return M.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,N.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,N.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,N.jsx)(Ht,{active:!o})}),(0,N.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:g(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,N.jsx)(Kt,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,N.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,N.jsx)(Ut,{active:!c})})]})}function Jt({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?v.ACTION$CONFIRM:v.ACTION$REJECT),a=n(r?v.CHAT_INTERFACE$USER_CONFIRMED:v.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(v.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(v.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,N.jsx)(ie,{closeDelay:100,content:a,children:(0,N.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:g(`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 Yt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,N.jsxs)(`div`,{className:g(`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,N.jsx)(`span`,{className:``,children:n}),(0,N.jsx)(`span`,{className:`font-bold`,children:i}),(0,N.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Xt=e=>(0,N.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,N.jsx)(`path`,{d:`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,N.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,N.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`})]}),Zt=oe(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Qt=()=>l({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return Fe.respondToConfirmation(e,t,i,n)}});function $t(){let e=Zt(e=>e.submittedEventIds),t=Zt(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=we(),{curAgentState:i}=Se(),{mutate:a}=Qt(),o=ze(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===h.AWAITING_USER_CONFIRMATION:!1),c=(0,M.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,M.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!==h.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(A(o)?o.security_risk:_.UNKNOWN)===_.HIGH&&(0,N.jsx)(Yt,{content:n(v.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,N.jsx)(Xt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(v.COMMON$HIGH_RISK)}),(0,N.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,N.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(v.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(Jt,{type:`reject`,onClick:()=>c(!1)}),(0,N.jsx)(Jt,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var en=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(`
|
|
2
|
+
`):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=f.t(v.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function tn(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function nn(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function rn(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function an(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function on(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sn(e){let t=e?.verification;if(!on(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function cn({feature:e}){let t=Math.round(e.probability*100),n=an(e.probability);return(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,N.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function V({label:e,features:t}){return!t||t.length===0?null:(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,N.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,N.jsxs)(M.Fragment,{children:[t>0&&(0,N.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,N.jsx)(cn,{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,N.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,N.jsx)(V,{label:t(v.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,N.jsx)(V,{label:t(v.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,N.jsx)(V,{label:t(v.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,N.jsx)(V,{label:t(v.CRITIC$OTHER),features:e.other})]})}function un({criticResult:e}){let{t}=s(),{data:n}=ne(),[r,i]=M.useState(!1),a=tn(e.score),{filled:o,empty:c}=nn(a),l=rn(a),u=(a*100).toFixed(1),d=sn(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,N.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(v.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,N.jsxs)(`span`,{className:`${l} text-xs tracking-wide`,"aria-label":`Score: ${u}%`,children:[`★`.repeat(o),`☆`.repeat(c)]}),(0,N.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,u,`%)`]}),p&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?v.BUTTON$COLLAPSE_DETAILS:v.BUTTON$EXPAND_DETAILS),children:r?(0,N.jsx)(F,{className:`h-3 w-3 inline fill-neutral-400`}):(0,N.jsx)(P,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&p&&(0,N.jsx)(ln,{categorized:f}),d&&(0,N.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(v.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var dn=e=>(0,N.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,N.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 H({content:e}){let{t}=s(`openhands`),[n,r]=M.useState(!1);if(!e.trim())return null;let i=n?F:P;return(0,N.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,N.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?v.THINKING$COLLAPSE:v.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,N.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,N.jsx)(dn,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,N.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(v.THINKING$TITLE)})]}),n&&(0,N.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,N.jsx)(j,{children:e})})]})}var fn=()=>{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 ce.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await ce.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function pn({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=s(`openhands`),{navigate:i}=S(),{conversationId:a}=O(),o=p().backend.kind===`cloud`,{mutate:c,isPending:l}=fn(),u=T(e=>e.setMessageToSend),f=M.useRef(!1),m=en(e),{reasoning:h,message:g}=e.source===`agent`?be(m):{reasoning:``,message:m},_=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&_.push(...e.image_urls)});let y=!o&&a?[{icon:(0,N.jsx)(fe,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||l||f.current)return;f.current=!0;let t=le.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&g.length>0;c({sourceConversationId:a,eventId:e.id,...o?{editText:g}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>u(g),0)},onError:e=>d(e instanceof Error?e.message:null),onSettled:()=>{f.current=!1}})},tooltip:r(v.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,N.jsxs)(N.Fragment,{children:[h&&(0,N.jsx)(H,{content:h}),(0,N.jsxs)(B,{type:e.source,message:g,isFromPlanningAgent:n,actions:y,children:[_.length>0&&(0,N.jsx)(qt,{size:`small`,images:_}),t&&(0,N.jsx)($t,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,N.jsx)(un,{criticResult:e.critic_result})]})}var mn=e=>{switch(e){case _.LOW:return f.t(v.SECURITY$LOW_RISK);case _.MEDIUM:return f.t(v.SECURITY$MEDIUM_RISK);case _.HIGH:return f.t(v.SECURITY$HIGH_RISK);case _.UNKNOWN:default:return f.t(v.SECURITY$UNKNOWN_RISK)}},U=()=>``,hn=e=>e.name?`**Skill:** \`${e.name}\``:U(),gn=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(`
|
|
3
|
+
`):U()},_n=e=>{if(e.command!==`create`||!e.file_text)return U();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,L)}...`),`${e.path}\n${t}`},vn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===_.HIGH||e.security_risk===_.MEDIUM)&&(t+=`\n\n${mn(e.security_risk)}`),t},yn=e=>{let t=`**MCP Tool Call**
|
|
4
|
+
|
|
5
|
+
`;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},bn=e=>e.thought,xn=e=>e.message.trim(),Sn=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+=`
|
|
6
|
+
|
|
7
|
+
**Task List:** Empty`),t},Cn=e=>{switch(e.kind){case`BrowserNavigateAction`:{let t=`Browsing ${e.url}`;return e.new_tab&&(t+=`
|
|
8
|
+
**New Tab:** Yes`),t}case`BrowserClickAction`:{let t=`**Element Index:** ${e.index}`;return e.new_tab&&(t+=`
|
|
9
|
+
**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`:U();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(`
|
|
10
|
+
`):U()}case`BrowserScrollAction`:return`**Direction:** ${e.direction}`;case`BrowserGoBackAction`:return U();case`BrowserListTabsAction`:return U();case`BrowserSwitchTabAction`:return`**Tab ID:** ${e.tab_id}`;case`BrowserCloseTabAction`:return`**Tab ID:** ${e.tab_id}`;default:return U()}},wn=e=>{let{action:t}=e;switch(t.kind){case`FileEditorAction`:case`StrReplaceEditorAction`:return _n(t);case`ExecuteBashAction`:case`TerminalAction`:return vn(e);case`MCPToolAction`:return yn(t);case`ThinkAction`:return bn(t);case`FinishAction`:return xn(t);case`TaskTrackerAction`:return Sn(t);case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return Cn(t);case`GrepAction`:case`GlobAction`:return gn(e);case`InvokeSkillAction`:return hn(t);default:return st(e)}},Tn=e=>{if(e.is_error||e.status===`failed`)return`error`;if(e.status===`completed`)return`success`},En=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`}},Dn=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(`
|
|
11
|
+
`):null;return En(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},On=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
12
|
+
`)||``;n.length>1e3&&(n=`${n.slice(0,L)}...`);let r=``;return t.command&&(r+=`Command: \`${t.command}\`\n\n`),r+=`Output:\n\`\`\`sh\n${n.trim()||f.t(v.OBSERVATION$COMMAND_NO_OUTPUT)}\n\`\`\``,r},kn=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(`
|
|
13
|
+
`):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,L)}...(truncated)`),r},An=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
14
|
+
`),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,L)}...`),r},jn=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
15
|
+
`),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,L)}...(truncated)`),r},Mn=e=>e.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
16
|
+
`),Nn=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
17
|
+
`);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(`
|
|
18
|
+
`)},Pn=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+=`
|
|
19
|
+
|
|
20
|
+
**Task List:** Empty`),`content`in t&&t.content&&typeof t.content==`string`&&t.content.trim()&&(i+=`\n\n**Result:** ${t.content.trim()}`),i},Fn=e=>{let{observation:t}=e;return t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
21
|
+
`)||``},In=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
22
|
+
`),r=``;return t.is_error?r+=`**Error:**\n${n}`:r+=n,r},Ln=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
23
|
+
`),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(`
|
|
24
|
+
`)),r.length>1e3&&(r=`${r.slice(0,L)}...(truncated)`),r},Rn=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
25
|
+
`),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
|
|
26
|
+
`,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(`
|
|
27
|
+
`)),r.length>1e3&&(r=`${r.slice(0,L)}...(truncated)`),r},zn=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return Dn(e);case`ExecuteBashObservation`:case`TerminalObservation`:return On(e);case`BrowserObservation`:return kn(e);case`MCPToolObservation`:return An(e);case`TaskTrackerObservation`:return Pn(e);case`ThinkObservation`:return Fn(e);case`FinishObservation`:return In(e);case`GlobObservation`:return Ln(e);case`GrepObservation`:return Rn(e);case`InvokeSkillObservation`:return jn(e);case`CanvasUIObservation`:return Mn(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?Mn(e):st(e);case`SwitchLLMObservation`:return Nn(e);default:return st(e)}},Bn=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,N.jsx)(`path`,{d:`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`})}),Vn=e=>(0,N.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:[(0,N.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,N.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 Hn({task:e}){let{t}=s(`openhands`),n=(0,M.useMemo)(()=>{switch(e.status){case`todo`:return(0,N.jsx)(Bn,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,N.jsx)(Vn,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,N.jsx)(ve,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,N.jsx)(Bn,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,N.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,N.jsx)(`div`,{className:`shrink-0`,children:n}),(0,N.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,N.jsx)(D.Text,{className:g(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,N.jsxs)(D.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(v.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function Un({taskList:e}){let{t}=s(`openhands`);return(0,N.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,N.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,N.jsx)(Le,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,N.jsx)(D.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(v.COMMON$TASKS)})]}),(0,N.jsx)(`div`,{children:e.map((e,t)=>(0,N.jsx)(Hn,{task:e},`task-${t}`))})]})}function Wn({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,N.jsx)(Un,{taskList:r})})}var Gn=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),Kn=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},qn=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Jn=(e,t)=>{let n=`
|
|
28
|
+
|
|
29
|
+
**Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=qn(e,i)}),n},Yn=e=>{let t=`
|
|
30
|
+
|
|
31
|
+
**Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},Xn=e=>!e||e.length===0?[]:Kn(Gn(e)),Zn=(e,t)=>{let n=Xn(t);return e&&e.length>0?Jn(e,n):n.length>0?Yn(n):``},Qn=(e,t)=>{let n=Xn(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()})):[]},W=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,$n=e=>{let t=e.activated_skills||e.activated_microagents||[],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=Zn(t,n),i=Qn(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},G=e=>e,K=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
32
|
+
`);function q({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=s(`openhands`),[c,l]=M.useState(!1),u=e.length>L,d=(u&&!(i&&c)?`${e.slice(0,1e3)}…`:e).trim()||r||``,f=n&&e.trim().length>0,p=o(c?v.BUTTON$COLLAPSE:v.BUTTON$EXPAND),m=(0,N.jsx)(C,{className:`rounded-lg text-xs`,style:w,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,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[f?(0,N.jsx)(Pe,{text:e,children:m}):m,i&&u&&(0,N.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 er({output:e,exitCode:t,copy:n=!0}){let{t:r}=s(`openhands`);return(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t!=null&&t!==0&&t!==-1&&(0,N.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(v.OBSERVATION$EXIT_CODE,{code:t})}),(0,N.jsx)(q,{code:e,language:`bash`,copy:n,placeholder:r(v.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var tr=G({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,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r&&(0,N.jsx)(q,{code:r,language:`bash`}),(i===_.HIGH||i===_.MEDIUM)&&(0,N.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===_.HIGH?v.SECURITY$HIGH_RISK:v.SECURITY$MEDIUM_RISK)}),t&&(0,N.jsx)(er,{output:K(t.observation.content),exitCode:t.observation.exit_code})]})}}),nr=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`}},rr=3,ir=300,ar=25e4,or=(e,t)=>{if(e.length*t.length>ar)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},sr=(e,t)=>{let n=e.split(`
|
|
33
|
+
`),r=t.split(`
|
|
34
|
+
`),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-rr),i),c=n.slice(a,Math.min(n.length,a+rr));return[...s.map(e=>({type:`ctx`,text:e})),...or(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},cr={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},lr={add:`+ `,del:`- `,ctx:` `};function ur({oldText:e,newText:t}){let{t:n}=s(`openhands`),r=sr(e,t),i=r.length>ir;return(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(`div`,{className:`overflow-auto rounded-lg border border-surface-raised font-mono text-xs`,children:(i?r.slice(0,ir):r).map((e,t)=>(0,N.jsx)(`div`,{className:g(`whitespace-pre-wrap px-2`,cr[e.type]),children:`${lr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,N.jsx)(`span`,{className:`text-xs text-muted`,children:n(v.COMMON$TRUNCATED)})]})}function dr({path:e,range:t}){return(0,N.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground`,children:[(0,N.jsx)(He,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,N.jsx)(`span`,{className:`break-all`,children:t?`${e}:${t}`:e})]})}var fr=G({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function({action:e,observation:t}){let n=t?.observation.path??e?.action.path??``,r=t?.observation.command??e?.action.command,i=nr(n),a=e?.action.view_range,o=r===`view`&&a?`${a[0]}-${a[1]}`:void 0,s=n?(0,N.jsx)(dr,{path:n,range:o}):null;if(t){let e=t.observation,n=null;if(e.error)n=(0,N.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,N.jsx)(ur,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?K(e.content):``);n=t?(0,N.jsx)(q,{code:t,language:i}):null}return(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}if(e){let t=e.action,n=null;return t.command===`create`&&t.file_text?n=(0,N.jsx)(q,{code:t.file_text,language:i}):(t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,N.jsx)(ur,{oldText:t.old_str??``,newText:t.new_str})),(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}return null}});function pr({rows:e}){return(0,N.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:e.map(({label:e,value:t})=>(0,N.jsxs)(M.Fragment,{children:[(0,N.jsx)(`span`,{className:`text-muted`,children:e}),(0,N.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:t})]},e))})}var mr=G({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,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(pr,{rows:[{label:n(v.COMMON$PATTERN),value:a},...o?[{label:n(v.COMMON$PATH),value:o}]:[],...c?[{label:n(v.COMMON$INCLUDE),value:c}]:[]]}),r&&(r.is_error?(0,N.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:K(r.content)}):l.length===0?(0,N.jsx)(`span`,{className:`text-xs text-muted`,children:n(v.COMMON$NO_RESULTS)}):(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(`span`,{className:`text-xs text-muted`,children:n(v.COMMON$RESULTS,{count:l.length})}),(0,N.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:l.map(e=>(0,N.jsx)(`span`,{className:`break-all`,children:e},e))}),r.truncated&&(0,N.jsx)(`span`,{className:`text-xs text-muted`,children:n(v.COMMON$TRUNCATED)})]}))]})}});function hr({label:e,text:t,isError:n=!1}){return(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,N.jsx)(Pe,{text:t,children:(0,N.jsx)(`div`,{className:`overflow-auto rounded border border-surface-raised bg-surface-raised p-2 text-xs ${n?`text-danger`:`text-foreground`}`,children:(0,N.jsx)(j,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var gr=[tr,fr,mr,G({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?K(i.content).trim():``,u=[...a?[{label:n(v.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(v.TASK$TASK_ID),value:o}]:[]];return(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[u.length>0&&(0,N.jsx)(pr,{rows:u}),c&&(0,N.jsx)(hr,{label:n(v.TASK$QUERY),text:c}),l&&(0,N.jsx)(hr,{label:n(v.TASK$RESULT),text:l,isError:i?.is_error})]})}})],_r=e=>new Map(gr.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),vr=_r(e=>e.actionKinds),yr=_r(e=>e.observationKinds);function br(e,t){if(A(e)){let t=vr.get(e.action.kind);if(t)return(0,N.jsx)(t.Body,{action:e})}else if(k(e)){let n=yr.get(e.observation.kind);if(n)return(0,N.jsx)(n.Body,{action:t,observation:e})}return null}var J=(e,t)=>f.exists(e)?(0,N.jsx)(u,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,N.jsx)(Ct,{}),cmd:(0,N.jsx)(yt,{})}}):e,xr=e=>e.kind===`text`?e.text:J(e.key,e.values),Y=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?R(n,t):n:null},Sr=e=>{if(e.tool_name!==`inspect_image_with_vision`)return null;let t=e.action,n=Y(t.profile_name);return n?`Describing image with ${n}`:`Describing image with auxiliary vision LLM`},Cr=(e,t)=>{let n=t?.tool_name,r=e.observation,i=Y(r.tool_name);if(n!==`inspect_image_with_vision`&&i!==`inspect_image_with_vision`&&String(e.observation.kind)!==`VisionInspectObservation`)return null;let a=Y((t?.action??{}).profile_name)??Y(r.profile_name)??Y(r.base_url,80)??Y(r.endpoint,80)??Y(r.model,80);return a?`Describing image with ${a}`:`Describing image with auxiliary vision LLM`},wr=e=>A(e)?Sr(e)||xr(gt(e)):``,Tr=(e,t)=>{if(!k(e))return``;let n=Cr(e,t);if(n)return n;if(t){let e=Sr(t);if(e)return e;let n=ht(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?R(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:`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?R(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?R(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?J(i,a):r},Er=(e,t)=>e.observation.kind!==`ClientToolObservation`||e.tool_name!==`canvas_ui_control`||!t||!je(t)?null:`UI command '${t.action.command}' dispatched to the Agent Canvas frontend.`,X=(e,t)=>{let n=``,r=``;if(W(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=f.exists(t)?J(t,{}):`Skill Ready`,r=e._skillReadyContent}else A(e)?(n=wr(e),r=br(e)??wn(e)):k(e)?(n=Tr(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,N.jsx)(Wn,{event:e}):Er(e,t)??br(e,t)??zn(e)):ye(e)?(n=J(ct(e),{title:ut(e)}),r=pt(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(v.EVENT$UNKNOWN_EVENT),details:r}};function Dr({event:e,isFromPlanningAgent:t=!1}){let n=X(e);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(B,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t}),e.critic_result!=null&&(0,N.jsx)(un,{criticResult:e.critic_result})]})}var Or=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
35
|
+
`).trim();return!t.skill_name&&!n?[]:[{name:t.skill_name,content:n}]};function kr(e){let t=e.split(`
|
|
36
|
+
`),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(m[0]))n=a.trim(),i=e+1;else if(a.startsWith(m[2]))r=a.replace(m[2],``).trim(),i=e+1;else if(a.startsWith(m[1])||a.startsWith(m[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(`
|
|
37
|
+
`).trim()}}function Ar(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function jr({content:e}){let{t}=s(`openhands`),{matchInfo:n,filePath:r,body:i}=kr(e),a=n||r;return(0,N.jsxs)(`div`,{className:`pl-6 pr-2 pt-2 pb-2`,children:[a&&(0,N.jsxs)(`div`,{className:`mb-3 text-sm text-[var(--oh-muted)] space-y-1`,children:[n&&(0,N.jsx)(`p`,{children:n}),r&&(0,N.jsxs)(`p`,{children:[(0,N.jsxs)(D.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.COMMON$PATH),` `]}),(0,N.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,N.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,N.jsx)(j,{children:Ar(i)})]})}function Mr({items:e,titleKey:t=v.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}){let{t:n}=s(`openhands`),[r,i]=M.useState({}),a=e=>{i(t=>({...t,[e]:!t[e]}))};return(0,N.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1`,children:[(0,N.jsx)(D.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,N.jsxs)(`div`,{className:`border border-[var(--oh-border-subtle)] rounded-md overflow-hidden`,children:[(0,N.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,N.jsx)(D.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,N.jsx)(y,{size:14}):(0,N.jsx)(b,{size:14})}),(0,N.jsx)(D.Text,{className:`font-normal text-[var(--oh-foreground)] text-sm`,children:e.name})]}),t&&e.content&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)]`}),(0,N.jsx)(jr,{content:e.content})]})]},e.name)})]})}function Nr(e){if(W(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:v.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(k(e)&&e.observation.kind===`InvokeSkillObservation`){let t=Or(e);return t.length>0?{items:t,titleKey:v.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function Z({event:e,isLastMessage:t,correspondingAction:n}){let{title:r,details:i}=X(e,n);if(!W(e)&&k(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,N.jsx)(`div`,{children:i});let a;W(e)?a=`success`:k(e)?a=En(e):ye(e)&&(a=Tn(e));let o=Nr(e);return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(I,{title:r,details:o?(0,N.jsx)(Mr,{items:o.items,titleKey:o.titleKey}):i,success:a,initiallyExpanded:!1,titleIcon:o?(0,N.jsx)(he,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0}),t&&(0,N.jsx)($t,{})]})}function Pr({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
38
|
+
`);return r?(0,N.jsx)(B,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n}):null}function Fr(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 Ir(e){return e.length>80?`${e.slice(0,77)}...`:e}function Lr(e,t){return e?`blocked`:t?`ok`:`failed`}function Rr(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 zr({event:e}){let{t}=s(`openhands`);if(!xe(e))return null;let n=Fr(e.hook_event_type,e.blocked),r=Lr(e.blocked,e.success),i=Rr(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,N.jsx)(I,{title:(0,N.jsxs)(`span`,{children:[n,` `,t(v.HOOK$HOOK_LABEL),`: `,e.hook_event_type,e.tool_name&&(0,N.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,N.jsx)(`span`,{className:g(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,N.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$COMMAND),`:`]}),` `,(0,N.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:Ir(e.hook_command)})]}),e.exit_code!==null&&(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$EXIT_CODE),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,N.jsxs)(`div`,{className:`text-amber-400`,children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$BLOCKED_REASON),`:`]}),` `,e.reason]}),e.additional_context&&(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$CONTEXT),`:`]}),` `,e.additional_context]}),e.error&&(0,N.jsxs)(`div`,{className:`text-red-400`,children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$OUTPUT),`:`]}),(0,N.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,N.jsxs)(`div`,{children:[(0,N.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(v.HOOK$STDERR),`:`]}),(0,N.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 Br(e){let t=[],n=[];for(let r of e)Ce(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Vr=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function Hr(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(De(n)&&Vr(n.observation.path))return n.id}return null}function Ur(e){return(0,M.useMemo)(()=>{let t=new Set;return Br(e).forEach(e=>{let n=Hr(e);n&&t.add(n)}),t},[e])}function Wr(e,t){return t.has(e)}var Gr=e=>e.activated_skills||e.activated_microagents||[],Kr=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),qr=e=>{let t=Gr(e).length>0,n=Kr(e.extended_content);return t&&n},Jr=(e,t,n)=>{try{let r=$n(e);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(pn,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,N.jsx)(Z,{event:r,isLastMessage:n})]})}catch{return(0,N.jsx)(pn,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Yr({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=te(),{planContent:s}=T(),{curAgentState:c}=Se(),l=c===h.RUNNING||c===h.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(Te(e)&&Ee(e))return(0,N.jsx)(Qe,{status:e.value});if(Me(e))return(0,N.jsx)(Vt,{event:e,...d});if(xe(e))return(0,N.jsx)(zr,{event:e});if(ye(e))return(0,N.jsx)(Z,{event:e,isLastMessage:n});if(Ve(e)){let{reasoning:t,message:n}=be(e.content??``,{streaming:!0}),r=[e.reasoning_content??``,t].filter(Boolean).join(`
|
|
39
|
+
|
|
40
|
+
`);return(0,N.jsxs)(N.Fragment,{children:[r&&(0,N.jsx)(H,{content:r}),n&&(0,N.jsx)(B,{type:`agent`,message:n,isFromPlanningAgent:u})]})}if(A(e)&&e.action.kind===`FinishAction`)return(0,N.jsx)(Dr,{event:e,...d});if(A(e)&&e.action.kind===`ThinkAction`)return(0,N.jsx)(H,{content:e.action.thought});if(A(e)){let t=Re(e);return(0,N.jsxs)(N.Fragment,{children:[t&&(0,N.jsx)(H,{content:t}),!a&&(0,N.jsx)(Pr,{event:e,isFromPlanningAgent:u}),(0,N.jsx)(Z,{event:e,isLastMessage:n})]})}if(k(e)){if(De(e))return i&&Wr(e.id,i)?(0,N.jsx)(zt,{planContent:s,isStreaming:n&&c===h.RUNNING,isBuildDisabled:l}):null;let r=t.find(t=>A(t)&&t.id===e.action_id),o=!a&&r&&A(r)&&r.action.kind!==`ThinkAction`,d=r&&A(r)?Re(r):``;return(0,N.jsxs)(N.Fragment,{children:[d&&(0,N.jsx)(H,{content:d}),o&&(0,N.jsx)(Pr,{event:r,isFromPlanningAgent:u}),(0,N.jsx)(Z,{event:e,isLastMessage:n,correspondingAction:r&&A(r)?r:void 0})]})}if(!A(e)&&!k(e)){let t=e;return Ce(e)&&qr(t)?Jr(t,d,n):(0,N.jsx)(pn,{event:t,...d,isLastMessage:n})}return(0,N.jsx)(Z,{event:e,isLastMessage:n})}var Xr=e=>{if(A(e)){let{kind:t}=e.action;return!(t===`FinishAction`||t===`ThinkAction`)}return k(e)?!(De(e)||e.observation.kind===`TaskTrackerObservation`):!1},Zr=(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(Xr(e)){let s=Oe(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},Qr=(0,M.createContext)(!1);function $r({events:e,allEvents:t,isFinalized:n=!1,children:r}){let{t:i}=s(`openhands`),[a,o]=M.useState(!1),c=M.useId(),l=`${c}-toggle`;if(e.length===0)return null;let u=e.find(e=>A(e)),d=e.filter(k).length,f=e.length,p=!!u,m=e[e.length-1],h=null;m&&(A(m)?h=X(m).title:k(m)&&(h=X(m,(t??e).find(e=>A(e)&&e.id===m.action_id)).title));let g=p?i(v.EVENT_GROUP$ACTIONS_PROGRESS,{completed:d,total:f}):i(v.EVENT_GROUP$ACTIONS_COMPLETED,{count:f}),_=a?F:P;return(0,N.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,N.jsx)(`button`,{id:l,type:`button`,onClick:()=>o(e=>!e),"aria-controls":c,"aria-expanded":a,"aria-label":i(a?v.EVENT_GROUP$COLLAPSE:v.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,N.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,N.jsx)(_,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:g})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,N.jsx)(_,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,N.jsx)(`span`,{className:`truncate`,children:h??g})]}),(0,N.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:g}),p?(0,N.jsx)(ee,{"data-testid":`spinner-icon`,className:`h-4 w-4 ml-2 inline animate-spin text-[var(--oh-muted)]`}):null]})]})}),a&&(0,N.jsx)(`div`,{id:c,role:`region`,"aria-labelledby":l,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,N.jsx)(Qr.Provider,{value:!0,children:r})})]})}var Q=e=>e.at(-1)?.id,$=e=>e.at(-1),ei=M.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=O(),r=Ur(t),i=Ne(e=>n?e.entriesByConversation[n]:void 0),a=M.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,N.jsx)(tt,{conversationId:n,anchorEventId:t}):null},s=M.useMemo(()=>Zr(e,void 0,t),[e,t]),c=(n,i,a)=>(0,N.jsx)(Yr,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,N.jsx)(N.Fragment,{children:s.map((e,n)=>{if(e.kind===`single`)return(0,N.jsxs)(M.Fragment,{children:[c(e.event,e.index,!0),o(e.event.id)]},`single-${e.event.id}`);if(e.kind===`thought`)return(0,N.jsxs)(M.Fragment,{children:[(0,N.jsx)(Pr,{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,N.jsxs)(M.Fragment,{children:[(0,N.jsx)($r,{events:e.events,allEvents:t,isFinalized:r,children:e.events.map((t,n)=>c(t,e.startIndex+n,!0))}),e.events.map(e=>(0,N.jsx)(M.Fragment,{children:o(e.id)},`model-${e.id}`))]},`group-${i}`)})})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&Q(e.messages)===Q(t.messages)&&Q(e.allEvents)===Q(t.allEvents)&&$(e.messages)===$(t.messages)&&$(e.allEvents)===$(t.allEvents));ei.displayName=`Messages`;export{qe as A,it as C,Qe as D,tt as E,Ge as M,We as N,Ye as O,ut as S,nt as T,yt as _,Bn as a,pt as b,dn as c,It as d,Pt as f,Ct as g,wt as h,Vn as i,Ke as j,I as k,en as l,Ot as m,Zr as n,zn as o,B as p,nr as r,wn as s,ei as t,qt as u,gt as v,ot as w,ct as x,ht as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-
|
|
1
|
+
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-DPQfkd-7.js";e();var r=t(),i={sm:`w-[384px]`,md:`w-[520px]`,lg:`w-[640px]`,xl:`w-[720px]`},a=`max-w-[90vw]`;function o(e){return i[e]}function s({testID:e,children:t,className:i,width:a=`sm`}){return(0,r.jsx)(`div`,{"data-testid":e,className:n(`bg-base-secondary flex flex-col gap-6 items-center p-6 rounded-xl`,o(a),i),children:t})}export{s as n,o as r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./utils-
|
|
1
|
+
import{t as e}from"./utils-DPQfkd-7.js";var t=e(`text-xl leading-6 -tracking-[0.01em] font-medium text-[var(--oh-modal-title-foreground)]`),n=e(`text-sm font-medium text-[var(--oh-modal-title-foreground)]`),r=e(`text-lg font-medium text-[var(--oh-modal-title-foreground)]`),i=r;export{n as i,r as n,i as r,t};
|
|
@@ -1 +1 @@
|
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{t as r,z as i}from"./utils-
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{t as r,z as i}from"./utils-DPQfkd-7.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(i.BUTTON$CLOSE),className:r(`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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{E as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as r}from"./useQuery-BCnzy4LX.js";import{j as i}from"./active-backend-context-BBvP-bI2.js";var a=n(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),o=`https://registry.npmjs.org/@openhands/agent-canvas/latest`,s=`https://github.com/OpenHands/OpenHands/releases`,c={npm:`npm install -g @openhands/agent-canvas@latest`,docker:`docker pull ghcr.io/openhands/agent-canvas:latest`};async function l(e){let t=await fetch(o,{signal:e,headers:{Accept:`application/json`}});if(!t.ok)throw Error(`npm registry responded ${t.status}`);let n=(await t.json())?.version;if(typeof n!=`string`||!n.trim())throw Error(`npm registry response missing version`);return n.trim()}function u({enabled:e=!0}={}){return r({queryKey:i.latestVersion,queryFn:({signal:e})=>l(e),enabled:e,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*60,meta:{disableToast:!0}})}e();var d=t(),f=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{fill:`currentColor`,d:`M21.81 10.25c-.06-.04-.56-.43-1.64-.43c-.28 0-.56.03-.84.08c-.21-1.4-1.38-2.11-1.43-2.14l-.29-.17l-.18.27c-.24.36-.43.77-.51 1.19c-.2.8-.08 1.56.33 2.21c-.49.28-1.29.35-1.46.35H2.62c-.34 0-.62.28-.62.63c0 1.15.18 2.3.58 3.38c.45 1.19 1.13 2.07 2 2.61c.98.6 2.59.94 4.42.94c.79 0 1.61-.07 2.42-.22c1.12-.2 2.2-.59 3.19-1.16A8.3 8.3 0 0 0 16.78 16c1.05-1.17 1.67-2.5 2.12-3.65h.19c1.14 0 1.85-.46 2.24-.85c.26-.24.45-.53.59-.87l.08-.24zm-17.96.99h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H3.85c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.43 0h1.76c.08 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16H6.28c-.09 0-.16.07-.16.16v1.58c.01.09.07.16.16.16m2.47 0h1.75c.1 0 .17-.07.17-.16V9.5c0-.08-.06-.16-.17-.16H8.75c-.08 0-.15.07-.15.16v1.58c0 .09.06.16.15.16m2.44 0h1.77c.08 0 .15-.07.15-.16V9.5c0-.08-.06-.16-.15-.16h-1.77c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16M6.28 9h1.76c.08 0 .16-.09.16-.18V7.25c0-.09-.07-.16-.16-.16H6.28c-.09 0-.16.06-.16.16v1.57c.01.09.07.18.16.18m2.47 0h1.75c.1 0 .17-.09.17-.18V7.25c0-.09-.06-.16-.17-.16H8.75c-.08 0-.15.06-.15.16v1.57c0 .09.06.18.15.18m2.44 0h1.77c.08 0 .15-.09.15-.18V7.25c0-.09-.07-.16-.15-.16h-1.77c-.08 0-.15.06-.15.16v1.57c0 .09.07.18.15.18m0-2.28h1.77c.08 0 .15-.07.15-.16V5c0-.1-.07-.17-.15-.17h-1.77c-.08 0-.15.06-.15.17v1.56c0 .08.07.16.15.16m2.46 4.52h1.76c.09 0 .16-.07.16-.16V9.5c0-.08-.07-.16-.16-.16h-1.76c-.08 0-.15.07-.15.16v1.58c0 .09.07.16.15.16`})}),p=e=>(0,d.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,d.jsx)(`path`,{fill:`currentColor`,d:`M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z`})});export{c as a,s as i,f as n,a as o,u as r,p as t};
|
|
@@ -1 +1 @@
|
|
|
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~lq5hicxx-cHFhpUBq.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{E as o,g as s,h as c,o as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as u}from"./useMutation-ChpkYxI5.js";import{t as d}from"./useQueries-Cjv3E8_1.js";import{t as f}from"./useQuery-BCnzy4LX.js";import{$ as p,F as m,n as h}from"./active-backend-context-B0wI7OzM.js";import{t as g,z as _}from"./utils-BX9XJ0IE.js";import{u as v}from"./git-provider-icon-wg7ShB98.js";import{t as y}from"./use-onboarding-completion-BiCdXvlU.js";import{n as b}from"./use-settings-3RcgdUuZ.js";import{t as x}from"./modal-backdrop-BSzNhM4r.js";import{r as S,t as C}from"./modal-body-BHGCSAtj.js";import{r as w}from"./base-modal-C0RQPug5.js";import{i as T}from"./modal-classes-DSTLuxkA.js";import{t as E}from"./brand-button-DJmFCyMK.js";import{t as D}from"./confirmation-modal-BATFmFyP.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as k}from"./onboarding-modal-CD2ehuxt.js";import{t as A}from"./folder-C1ou4_DT.js";import{t as j}from"./close-ScPlnwyq.js";var M=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`}]]),N=o(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),ee=o(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),P=n();function te(){return(0,P.jsx)(v,{inset:`menu`})}function F(){return new l(p())}function I(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var L=class{static async listWorkspaces(){return I(await F().listWorkspaces())}static async addWorkspaces(e){return I(await F().addWorkspaces(e))}static async removeWorkspace(e){await F().deleteWorkspace(e)}static async addWorkspaceParents(e){return I(await F().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await F().deleteWorkspaceParent(e)}};function ne(){let e=i();return u({mutationFn:e=>L.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function re(){let e=i();return u({mutationFn:e=>L.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function ie(){let e=i();return u({mutationFn:e=>L.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function ae(){let e=i();return u({mutationFn:e=>L.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}var R=e(t(),1);function z({enabled:e=!0}={}){return f({queryKey:m.all,queryFn:()=>L.listWorkspaces(),enabled:e,retry:(e,t)=>!c(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function B(){return new s(p())}async function V(e,t=B()){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 H=e=>{let t=h();return f({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},U=()=>{let e=h();return f({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>B().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function W(){let{data:e,isLoading:t,isError:n,error:r}=z(),i=c(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,R.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=d({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>V(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,R.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:f,error:r}}function G(e,t){return c(e)?t(_.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var K=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,P.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`})}),q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,P.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,P.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,P.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:g(`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,P.jsx)(A,{width:14,height:14,className:`shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function oe(e){let t=X(e);if(!t||t===`/`||Y(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 Y(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function X(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function Z(e){return e?.home===`/home/openhands`}function se({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,R.useState)(null),c=h(),{data:l}=U();(0,R.useEffect)(()=>{e&&l?.home&&o===null&&s(Z(l)?q:l.home),e||s(null)},[e,l?.home,o]),(0,R.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:f,error:p}=H(e?o:null),m=(0,R.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:X(l.home)||l.home},...l.favorites??[]];return Z(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],b=o?oe(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!d&&!f&&y.length===0,O=e=>{let t=X(e);if(!t)return`/`;if(t===`/`||Y(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,P.jsx)(x,{onClose:t,"aria-label":i(_.HOME$ADD_WORKSPACES_TITLE),children:(0,P.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`xl`),C,`h-[480px]`),children:[(0,P.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,P.jsx)(w,{className:T,title:i(_.HOME$ADD_WORKSPACES_TITLE)})}),(0,P.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,P.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,P.jsx)(J,{label:i(_.HOME$FAVORITES),entries:m,currentPath:o,onPick:s}),(0,P.jsx)(J,{label:i(_.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,P.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,P.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>b&&s(b),disabled:!b,"aria-label":i(_.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,P.jsx)(K,{width:16,height:16})}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,P.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,P.jsx)(`span`,{children:i(_.HOME$NAME)}),(0,P.jsx)(`span`,{children:i(_.HOME$KIND)})]}),(0,P.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,P.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(_.HOME$LOADING)}),f&&(0,P.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:p?.message??i(_.COMMON$FAILED_TO_LOAD)}),!d&&!f&&y.length===0&&(0,P.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?_.HOME$HOST_HOME_NOT_MOUNTED_HINT:_.HOME$NO_WORKSPACES)}),y.map(e=>(0,P.jsx)(`li`,{children:(0,P.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,P.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,P.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(_.HOME$FOLDER)})]})},e.path))]})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,P.jsx)(E,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(_.HOME$CANCEL)}),r&&(0,P.jsx)(E,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-add-all-subdirs`,children:i(_.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,P.jsx)(E,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-use`,children:i(_.HOME$ADD_THIS_DIRECTORY)})]})]})})}function ce({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=R.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 f=u.length>0||n.length>0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{onClose:r,"aria-label":s(_.HOME$MANAGE_WORKSPACES),children:(0,P.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`lg`),C,`max-h-[70vh]`),children:[(0,P.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,P.jsx)(w,{className:T,title:s(_.HOME$MANAGE_WORKSPACES)})}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!f&&(0,P.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(_.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,P.jsx)(`ul`,{children:u.map(e=>(0,P.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,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(_.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,P.jsx)(j,{width:12,height:12}),(0,P.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,P.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,P.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(_.HOME$WORKSPACE_PARENTS)}),(0,P.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,P.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(_.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,P.jsx)(j,{width:12,height:12}),(0,P.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,P.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,P.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,P.jsx)(A,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,P.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,P.jsx)(E,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(_.HOME$DONE)})})]})}),c&&(0,P.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var le=`previewOnboardingStep`,ue=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(le);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ue?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function de(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 fe(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=y(),{backend:o}=h(),s=b(),c=o.kind===`cloud`;return!n&&(i||c&&s.isLoading||c&&de(s.data))?null:(0,P.jsx)(k,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{G as a,ie as c,ae as d,te as f,M as h,se as i,ne as l,N as m,$ as n,W as o,ee as p,ce as r,z as s,fe as t,re as u};
|
|
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~lq5hicxx-cHFhpUBq.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js";import{E as o,g as s,h as c,o as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as u}from"./useMutation-ChpkYxI5.js";import{t as d}from"./useQueries-Cjv3E8_1.js";import{t as f}from"./useQuery-BCnzy4LX.js";import{$ as p,F as m,n as h}from"./active-backend-context-BBvP-bI2.js";import{t as g,z as _}from"./utils-DPQfkd-7.js";import{u as v}from"./git-provider-icon-BLMlwy02.js";import{t as y}from"./use-onboarding-completion-CtNJxkXG.js";import{n as b}from"./use-settings-BHWsOcIG.js";import{t as x}from"./modal-backdrop-BSzNhM4r.js";import{r as S,t as C}from"./modal-body-duRaxj_K.js";import{r as w}from"./base-modal-3NmIOKDm.js";import{i as T}from"./modal-classes-CLEXO6dj.js";import{t as E}from"./brand-button-CJcwjnfb.js";import{t as D}from"./confirmation-modal-DAH0XtOp.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as k}from"./onboarding-modal-C6Euf7N4.js";import{t as A}from"./folder-C1ou4_DT.js";import{t as j}from"./close-ScPlnwyq.js";var M=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`}]]),N=o(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),ee=o(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),P=n();function te(){return(0,P.jsx)(v,{inset:`menu`})}function F(){return new l(p())}function I(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var L=class{static async listWorkspaces(){return I(await F().listWorkspaces())}static async addWorkspaces(e){return I(await F().addWorkspaces(e))}static async removeWorkspace(e){await F().deleteWorkspace(e)}static async addWorkspaceParents(e){return I(await F().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await F().deleteWorkspaceParent(e)}};function ne(){let e=i();return u({mutationFn:e=>L.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function re(){let e=i();return u({mutationFn:e=>L.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function ie(){let e=i();return u({mutationFn:e=>L.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}function ae(){let e=i();return u({mutationFn:e=>L.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:m.all})})}var R=e(t(),1);function z({enabled:e=!0}={}){return f({queryKey:m.all,queryFn:()=>L.listWorkspaces(),enabled:e,retry:(e,t)=>!c(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function B(){return new s(p())}async function V(e,t=B()){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 H=e=>{let t=h();return f({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},U=()=>{let e=h();return f({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>B().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function W(){let{data:e,isLoading:t,isError:n,error:r}=z(),i=c(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,R.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=d({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>V(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),f=n||l.some(e=>e.isError);return{workspaces:(0,R.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:f,error:r}}function G(e,t){return c(e)?t(_.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var K=e=>(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,P.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`})}),q=`/projects`;function J({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,P.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,P.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,P.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:g(`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,P.jsx)(A,{width:14,height:14,className:`shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function oe(e){let t=X(e);if(!t||t===`/`||Y(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 Y(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function X(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function Z(e){return e?.home===`/home/openhands`}function se({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,R.useState)(null),c=h(),{data:l}=U();(0,R.useEffect)(()=>{e&&l?.home&&o===null&&s(Z(l)?q:l.home),e||s(null)},[e,l?.home,o]),(0,R.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:d,isError:f,error:p}=H(e?o:null),m=(0,R.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:X(l.home)||l.home},...l.favorites??[]];return Z(l)&&!e.some(e=>e.path===q)&&e.push({label:q,path:q}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],b=o?oe(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!d&&!f&&y.length===0,O=e=>{let t=X(e);if(!t)return`/`;if(t===`/`||Y(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,P.jsx)(x,{onClose:t,"aria-label":i(_.HOME$ADD_WORKSPACES_TITLE),children:(0,P.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`xl`),C,`h-[480px]`),children:[(0,P.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,P.jsx)(w,{className:T,title:i(_.HOME$ADD_WORKSPACES_TITLE)})}),(0,P.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,P.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,P.jsx)(J,{label:i(_.HOME$FAVORITES),entries:m,currentPath:o,onPick:s}),(0,P.jsx)(J,{label:i(_.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,P.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,P.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>b&&s(b),disabled:!b,"aria-label":i(_.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,P.jsx)(K,{width:16,height:16})}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,P.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,P.jsx)(`span`,{children:i(_.HOME$NAME)}),(0,P.jsx)(`span`,{children:i(_.HOME$KIND)})]}),(0,P.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[d&&(0,P.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(_.HOME$LOADING)}),f&&(0,P.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:p?.message??i(_.COMMON$FAILED_TO_LOAD)}),!d&&!f&&y.length===0&&(0,P.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?_.HOME$HOST_HOME_NOT_MOUNTED_HINT:_.HOME$NO_WORKSPACES)}),y.map(e=>(0,P.jsx)(`li`,{children:(0,P.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,P.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,P.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(_.HOME$FOLDER)})]})},e.path))]})]})]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,P.jsx)(E,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(_.HOME$CANCEL)}),r&&(0,P.jsx)(E,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-add-all-subdirs`,children:i(_.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,P.jsx)(E,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||d,testId:`folder-browser-use`,children:i(_.HOME$ADD_THIS_DIRECTORY)})]})]})})}function ce({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=R.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 f=u.length>0||n.length>0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(x,{onClose:r,"aria-label":s(_.HOME$MANAGE_WORKSPACES),children:(0,P.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:g(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,S(`lg`),C,`max-h-[70vh]`),children:[(0,P.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,P.jsx)(w,{className:T,title:s(_.HOME$MANAGE_WORKSPACES)})}),(0,P.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!f&&(0,P.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(_.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,P.jsx)(`ul`,{children:u.map(e=>(0,P.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,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(_.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,P.jsx)(j,{width:12,height:12}),(0,P.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,P.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,P.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(_.HOME$WORKSPACE_PARENTS)}),(0,P.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,P.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,P.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,P.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,P.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(_.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(_.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,P.jsx)(j,{width:12,height:12}),(0,P.jsx)(`span`,{children:s(_.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,P.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,P.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,P.jsx)(A,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,P.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,P.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,P.jsx)(E,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(_.HOME$DONE)})})]})}),c&&(0,P.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var le=`previewOnboardingStep`,ue=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(le);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ue?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function de(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 fe(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=y(),{backend:o}=h(),s=b(),c=o.kind===`cloud`;return!n&&(i||c&&s.isLoading||c&&de(s.data))?null:(0,P.jsx)(k,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{G as a,ie as c,ae as d,te as f,M as h,se as i,ne as l,N as m,$ as n,W as o,ee as p,ce as r,z as s,fe as t,re as u};
|
|
@@ -1 +1 @@
|
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{t as a}from"./use-is-creating-conversation-CVefC9Ns.js";import{At as o,Pt as s,St as c,_t as l,dt as u,jt as d,n as f,pt as p,r as m,wt as h,xt as g}from"./active-backend-context-B0wI7OzM.js";import{t as _,z as v}from"./utils-BX9XJ0IE.js";import{t as y}from"./chat-send-button-CCrH1E8u.js";import{t as b}from"./check-DLOKoFU9.js";import{r as x,t as S}from"./recommended-automations-launcher-6xmbf7lh.js";import{t as C}from"./circle-check-CxCYJrpZ.js";import{t as w}from"./loader-circle-C5AnEN8r.js";import{c as T,s as E,t as D}from"./backend-form-modal-B_lXjOGa.js";import{a as O,r as k,t as A}from"./llm-settings-CRsLqxgu.js";import{o as ee}from"./use-onboarding-completion-BiCdXvlU.js";import{t as j}from"./use-tracking-CTtkLAmx.js";import{n as M}from"./use-settings-3RcgdUuZ.js";import{t as N}from"./use-save-settings-C9B8Y-h3.js";import{t as P}from"./modal-backdrop-BSzNhM4r.js";import{r as F,t as I}from"./modal-body-BHGCSAtj.js";import{t as L}from"./brand-button-DJmFCyMK.js";import{n as R}from"./navigation-context-CQZwH_tC.js";import{t as z}from"./openhands-logo-BS-Epajy.js";import{c as B,i as V,n as H,o as U}from"./acp-providers-DLe_gVDY.js";import{n as te,r as W}from"./use-agent-profiles-BlQA67MW.js";import{n as ne}from"./use-create-conversation-FaP0kUpg.js";import{t as re}from"./terminal-BUpID2wS.js";import{a as ie}from"./badge-C64c-7PO.js";import{t as ae}from"./use-save-agent-profile-CaGVAudI.js";import{n as oe}from"./use-activate-agent-profile-2nvALjC-.js";import{a as se,i as ce,n as le,r as ue,t as de}from"./use-acp-credential-form-BGKFi1VL.js";var G=e(n(),1),K=r(),fe=`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`,pe=`0 0 100 100`,me=`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`,he=`0 0 12 12`,ge=`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`,_e=`0 0 24 24`,ve=3/2;function q({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,K.jsx)(z,{width:Math.round(t*ve),height:t,className:_(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,K.jsx)(re,{width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,K.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:_(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,K.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:_(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:H.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,K.jsx)(q,{kind:`openhands`,size:16,className:_(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,K.jsx)(q,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:v.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...H.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),{mutate:c,isPending:l}=N();return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(v.ONBOARDING$AGENT_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$AGENT_SUBTITLE)})]}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":a(v.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,K.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:_(`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,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(xe,{id:n.id,muted:!1}),(0,K.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,K.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(n.descriptionKey)})]}),(0,K.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,K.jsx)(b,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,K.jsxs)(`div`,{className:_(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,K.jsx)(L,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:l,children:a(v.ONBOARDING$BACK)}):null,(0,K.jsx)(L,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:l,onClick:()=>{let t=V(e);if(!t){r();return}c({agent_settings_diff:t},{onError:e=>{o(s(e)||a(v.ERROR$GENERIC))},onSuccess:()=>{d(a(v.SETTINGS$SAVED)),r()}})},children:a(l?v.SETTINGS$SAVING:v.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,K.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:_(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,K.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(v.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,K.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(v.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=E(r,e,{isConnected:t,lastError:n});return(0,K.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,K.jsx)(x,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,K.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(v.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,K.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,K.jsx)(w,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,K.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(v.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:a,addBackend:o,setActive:s,updateBackend:d}=m(),{trackBackendAdded:f}=j(),{backend:y}=a,b=u(y),x=g(),S=x!==null&&!b&&!(y.kind===`cloud`&&h(y.host,x)),C=b||S,w=G.useMemo(()=>l(),[]),E=C?{id:`onboarding-local-backend-draft`,name:p,host:w.baseUrl,apiKey:w.sessionApiKey,kind:`local`}:y,O=ee(b?[]:[y]),k=C?null:O[y.id]?.isConnected??null,A=C?null:O[y.id]?.lastError??null,[M,N]=G.useState(!1);G.useEffect(()=>{k===!0&&N(!1)},[k]);let P=k===!0&&!M,F=G.useCallback((e,r)=>{if(b)o(e);else{let t=e.host!==y.host;d(y.id,e),t&&a.orgId!==null&&s(y.id,null)}f({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),x!==null&&e.kind===`cloud`&&n?n():t()},[a.orgId,o,y.host,y.id,x,b,n,t,s,f,d]),I=_(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(C?x?v.ONBOARDING$LOGIN_TO_CLOUD_TITLE:v.BACKEND$ADD_TITLE:v.ONBOARDING$BACKEND_TITLE)}),C?null:(0,K.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(v.ONBOARDING$BACKEND_SUBTITLE)})]}),C?null:(0,K.jsx)(we,{backend:E,isConnected:k,lastError:A}),k===!0?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>N(e=>!e),"aria-expanded":M,"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,K.jsx)(`span`,{children:r(M?v.ONBOARDING$BACKEND_HIDE_CONFIGURATION:v.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,K.jsx)(T,{className:_(`h-4 w-4 shrink-0 text-muted transition-transform`,M&&`rotate-180`),"aria-hidden":!0})]}):null,(0,K.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:P?null:(0,K.jsx)(D,{onConnected:F,testIdRoot:`onboarding-backend`,initialManualBackend:E,requireManualApiKey:c(),manualSubmitLabel:r(v.ONBOARDING$NEXT),manualSubmittingLabel:r(v.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),P?(0,K.jsxs)(`div`,{className:I,children:[e?(0,K.jsx)(L,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(v.ONBOARDING$BACK)}):null,(0,K.jsx)(L,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(v.ONBOARDING$NEXT)})]}):null]})}var J=W;function Y(){let e=ae(),t=oe();return(0,G.useCallback)(async n=>{try{await e.mutateAsync({name:J,profile:n});let r=(await te.getProfile(J)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=f(),a=r.kind===`local`,o=k(),s=O(),c=Y(),[l,u]=G.useState(null),[d,p]=G.useState(!1),m=G.useCallback(async()=>{if(!a||!l)return null;let e=l.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=ie(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,l,o,s]),h=G.useCallback(async()=>{p(!0);try{let e=await m();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{p(!1),t()}},[m,c,t]);return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(v.ONBOARDING$LLM_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(v.ONBOARDING$LLM_SUBTITLE)})]}),(0,K.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,K.jsx)(A,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:h,onSaveControlChange:u})}),(0,K.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(v.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),o=f(),{status:s,isChecking:c}=le(e,{enabled:t}),{fields:l,values:u,setValue:d,secretExists:p,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:y}=de(e),b=Y(),x=B(e)??e,S=s===`authenticated`,C=ke(o.backend.kind,s),w=S||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),T=C&&!w,E=y||T||c&&!w;return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(v.ONBOARDING$ACP_SECRETS_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,K.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):s!==`authenticated`&&(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,K.jsx)(ce,{status:s,isChecking:c,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,K.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,K.jsx)(ue,{field:e,value:u[e.name]??``,onChange:t=>d(e.name,t),alreadySet:p(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,K.jsx)(se,{conflicts:h}),T?(0,K.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:a(v.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,K.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:a(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await _()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:U(e)??void 0}),r())},children:a(y?v.SETTINGS$SAVING:v.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=R(),{backend:s}=f(),c=s.kind!==`cloud`,l=r(v.ONBOARDING$HELLO_DEFAULT_MESSAGE),[u,d]=G.useState(l),{mutate:p,isPending:m,isSuccess:h}=ne(),g=a(),_=m||h||g,b=G.useRef(!1),x=u.trim().length>0&&!_&&!b.current,C=()=>{!x||b.current||(b.current=!0,p({query:u.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{b.current=!1}}))};return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,K.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(v.ONBOARDING$HELLO_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(v.ONBOARDING$HELLO_SUBTITLE)})]}),(0,K.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,K.jsx)(`div`,{className:`relative w-full`,children:(0,K.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,K.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(v.ONBOARDING$HELLO_TITLE),type:`text`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},placeholder:l,disabled:_,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,K.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,K.jsx)(y,{buttonClassName:``,handleSubmit:C,disabled:!x})})]}),c?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,K.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(v.LANDING$OR)}),(0,K.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,K.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(S,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:_,children:r(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:_,children:r(v.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>$}),X=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Z=`openhands-onboarding-started`;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,K.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:_(`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}=M(),o=a?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:c,trackOnboardingCompleted:l,trackOnboardingSkipped:d}=j(),{active:f}=m(),{backend:p}=f,y=u(p),b=ee(y?[]:[p]),x=g(),S=x!==null&&p.kind===`cloud`&&h(p.host,x),C=!y&&b[p.id]?.isConnected===!0&&(x===null||S),w=C?Me:X,[T,E]=G.useState(()=>X[Math.min(Math.max(t,0),X.length-1)]),[D,O]=G.useState(`openhands`);G.useEffect(()=>{w.includes(T)||E(w[0])},[T,w]);let k=w.length,A=w.includes(T)?T:w[0],N=w.indexOf(A),L=y||b[p.id]?.isConnected!==void 0,R=D===`openhands`,z=N===0&&g()!==null,B=G.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[w]),V=G.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[w]),H=G.useRef(!1);G.useEffect(()=>{n||!o||H.current||window.sessionStorage.getItem(Z)||(H.current=!0,window.sessionStorage.setItem(Z,`1`),s())},[n,o]);let U=G.useRef(null);G.useEffect(()=>{n||!o||!L||U.current!==A&&(U.current=A,c({step:A,stepIndex:N,totalSteps:k,agent:D}))},[n,o,L,A,N,k,D]);let te=()=>{l({agent:D}),e()},W=()=>{d({step:A,stepIndex:N,totalSteps:k,agent:D}),e()};return(0,K.jsx)(P,{"aria-label":r(v.ONBOARDING$TITLE),children:(0,K.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,K.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":N,"data-preview":n?`true`:void 0,className:_(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,F(`lg`),I,`max-h-[90vh]`),children:[(0,K.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,K.jsx)(ye,{currentStep:N,totalSteps:k})}),(0,K.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,K.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":N,className:`relative overflow-clip`,children:[C?null:(0,K.jsx)(Q,{index:w.indexOf(`backend`),currentStep:N,children:(0,K.jsx)(Te,{onNext:B,onClose:e})}),(0,K.jsx)(Q,{index:w.indexOf(`agent`),currentStep:N,children:(0,K.jsx)(Ce,{selectedAgentId:D,onSelect:O,onBack:C?void 0:V,onNext:B})}),(0,K.jsx)(Q,{index:w.indexOf(`setup`),currentStep:N,children:R?(0,K.jsx)(De,{onBack:V,onNext:B}):(0,K.jsx)(Oe,{providerKey:D,isActive:A===`setup`,onBack:V,onNext:B})}),(0,K.jsx)(Q,{index:w.indexOf(`hello`),currentStep:N,children:(0,K.jsx)(Ae,{onBack:V,onClose:W,onLaunched:te})})]})})]}),N<k-1&&!z?(0,K.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:W,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(v.ONBOARDING$SKIP)}):null]})})}export{je as n,q as r,$ as t};
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{t as a}from"./use-is-creating-conversation-CVefC9Ns.js";import{At as o,Pt as s,St as c,_t as l,dt as u,jt as d,n as f,pt as p,r as m,wt as h,xt as g}from"./active-backend-context-BBvP-bI2.js";import{t as _,z as v}from"./utils-DPQfkd-7.js";import{t as y}from"./chat-send-button-B8n6-DQA.js";import{t as b}from"./check-DLOKoFU9.js";import{r as x,t as S}from"./recommended-automations-launcher-BbJAJVED.js";import{t as C}from"./circle-check-CxCYJrpZ.js";import{c as w,s as T,t as E}from"./backend-form-modal-OroTqnAv.js";import{t as D}from"./loader-circle-C5AnEN8r.js";import{a as O,r as k,t as A}from"./llm-settings-BJotLQND.js";import{o as ee}from"./use-onboarding-completion-CtNJxkXG.js";import{t as j}from"./use-tracking-CGCsBWhg.js";import{n as M}from"./use-settings-BHWsOcIG.js";import{t as N}from"./use-save-settings-pSjRhD_m.js";import{t as P}from"./modal-backdrop-BSzNhM4r.js";import{r as F,t as I}from"./modal-body-duRaxj_K.js";import{t as L}from"./brand-button-CJcwjnfb.js";import{n as R}from"./navigation-context-CQZwH_tC.js";import{t as z}from"./openhands-logo-BS-Epajy.js";import{c as B,i as V,n as H,o as U}from"./acp-providers-BkL3HWa3.js";import{n as te,r as W}from"./use-agent-profiles-BHLkLbRR.js";import{n as ne}from"./use-create-conversation-DWaSVUOB.js";import{t as re}from"./terminal-BUpID2wS.js";import{a as ie}from"./badge-yR53enbU.js";import{t as ae}from"./use-save-agent-profile-DgI_Uz9a.js";import{n as oe}from"./use-activate-agent-profile-CeFfYwu_.js";import{a as se,i as ce,n as le,r as ue,t as de}from"./use-acp-credential-form-DJmmJKMo.js";var G=e(n(),1),K=r(),fe=`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`,pe=`0 0 100 100`,me=`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`,he=`0 0 12 12`,ge=`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`,_e=`0 0 24 24`,ve=3/2;function q({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,K.jsx)(z,{width:Math.round(t*ve),height:t,className:_(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,K.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,K.jsx)(re,{width:t,height:t,className:_(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,K.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:_(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,K.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:_(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:H.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,K.jsx)(q,{kind:`openhands`,size:16,className:_(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,K.jsx)(q,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:v.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...H.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),{mutate:c,isPending:l}=N();return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(v.ONBOARDING$AGENT_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$AGENT_SUBTITLE)})]}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-label":a(v.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,K.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:_(`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,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(xe,{id:n.id,muted:!1}),(0,K.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,K.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:a(n.descriptionKey)})]}),(0,K.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,K.jsx)(b,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,K.jsxs)(`div`,{className:_(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,K.jsx)(L,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:l,children:a(v.ONBOARDING$BACK)}):null,(0,K.jsx)(L,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:l,onClick:()=>{let t=V(e);if(!t){r();return}c({agent_settings_diff:t},{onError:e=>{o(s(e)||a(v.ERROR$GENERIC))},onSuccess:()=>{d(a(v.SETTINGS$SAVED)),r()}})},children:a(l?v.SETTINGS$SAVING:v.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,K.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:_(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,K.jsx)(C,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(v.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,K.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(v.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=T(r,e,{isConnected:t,lastError:n});return(0,K.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,K.jsx)(x,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,K.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(v.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,K.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,K.jsx)(D,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,K.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(v.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:a,addBackend:o,setActive:s,updateBackend:d}=m(),{trackBackendAdded:f}=j(),{backend:y}=a,b=u(y),x=g(),S=x!==null&&!b&&!(y.kind===`cloud`&&h(y.host,x)),C=b||S,T=G.useMemo(()=>l(),[]),D=C?{id:`onboarding-local-backend-draft`,name:p,host:T.baseUrl,apiKey:T.sessionApiKey,kind:`local`}:y,O=ee(b?[]:[y]),k=C?null:O[y.id]?.isConnected??null,A=C?null:O[y.id]?.lastError??null,[M,N]=G.useState(!1);G.useEffect(()=>{k===!0&&N(!1)},[k]);let P=k===!0&&!M,F=G.useCallback((e,r)=>{if(b)o(e);else{let t=e.host!==y.host;d(y.id,e),t&&a.orgId!==null&&s(y.id,null)}f({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),x!==null&&e.kind===`cloud`&&n?n():t()},[a.orgId,o,y.host,y.id,x,b,n,t,s,f,d]),I=_(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(C?x?v.ONBOARDING$LOGIN_TO_CLOUD_TITLE:v.BACKEND$ADD_TITLE:v.ONBOARDING$BACKEND_TITLE)}),C?null:(0,K.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(v.ONBOARDING$BACKEND_SUBTITLE)})]}),C?null:(0,K.jsx)(we,{backend:D,isConnected:k,lastError:A}),k===!0?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>N(e=>!e),"aria-expanded":M,"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,K.jsx)(`span`,{children:r(M?v.ONBOARDING$BACKEND_HIDE_CONFIGURATION:v.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,K.jsx)(w,{className:_(`h-4 w-4 shrink-0 text-muted transition-transform`,M&&`rotate-180`),"aria-hidden":!0})]}):null,(0,K.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:P?null:(0,K.jsx)(E,{onConnected:F,testIdRoot:`onboarding-backend`,initialManualBackend:D,requireManualApiKey:c(),manualSubmitLabel:r(v.ONBOARDING$NEXT),manualSubmittingLabel:r(v.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),P?(0,K.jsxs)(`div`,{className:I,children:[e?(0,K.jsx)(L,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(v.ONBOARDING$BACK)}):null,(0,K.jsx)(L,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(v.ONBOARDING$NEXT)})]}):null]})}var J=W;function Y(){let e=ae(),t=oe();return(0,G.useCallback)(async n=>{try{await e.mutateAsync({name:J,profile:n});let r=(await te.getProfile(J)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=f(),a=r.kind===`local`,o=k(),s=O(),c=Y(),[l,u]=G.useState(null),[d,p]=G.useState(!1),m=G.useCallback(async()=>{if(!a||!l)return null;let e=l.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=ie(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,l,o,s]),h=G.useCallback(async()=>{p(!0);try{let e=await m();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{p(!1),t()}},[m,c,t]);return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(v.ONBOARDING$LLM_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(v.ONBOARDING$LLM_SUBTITLE)})]}),(0,K.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,K.jsx)(A,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:h,onSaveControlChange:u})}),(0,K.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(l?.isSaving??!1)||d,onClick:()=>{if(l?.isDirty){l.save();return}t()},children:n(v.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:a}=i(`openhands`),o=f(),{status:s,isChecking:c}=le(e,{enabled:t}),{fields:l,values:u,setValue:d,secretExists:p,hasValueFor:m,conflicts:h,consumesFileCredentials:g,save:_,isSaving:y}=de(e),b=Y(),x=B(e)??e,S=s===`authenticated`,C=ke(o.backend.kind,s),w=S||l.some(e=>e.secret&&(!e.multiline||g)&&m(e.name)),T=C&&!w,E=y||T||c&&!w;return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:a(v.ONBOARDING$ACP_SECRETS_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,K.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):s!==`authenticated`&&(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:a(v.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,K.jsx)(ce,{status:s,isChecking:c,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,K.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,K.jsx)(ue,{field:e,value:u[e.name]??``,onChange:t=>d(e.name,t),alreadySet:p(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,K.jsx)(se,{conflicts:h}),T?(0,K.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:a(v.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,K.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:a(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await _()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:U(e)??void 0}),r())},children:a(y?v.SETTINGS$SAVING:v.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=R(),{backend:s}=f(),c=s.kind!==`cloud`,l=r(v.ONBOARDING$HELLO_DEFAULT_MESSAGE),[u,d]=G.useState(l),{mutate:p,isPending:m,isSuccess:h}=ne(),g=a(),_=m||h||g,b=G.useRef(!1),x=u.trim().length>0&&!_&&!b.current,C=()=>{!x||b.current||(b.current=!0,p({query:u.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{b.current=!1}}))};return(0,K.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,K.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(v.ONBOARDING$HELLO_TITLE)}),(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(v.ONBOARDING$HELLO_SUBTITLE)})]}),(0,K.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,K.jsx)(`div`,{className:`relative w-full`,children:(0,K.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,K.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(v.ONBOARDING$HELLO_TITLE),type:`text`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},placeholder:l,disabled:_,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,K.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,K.jsx)(y,{buttonClassName:``,handleSubmit:C,disabled:!x})})]}),c?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,K.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(v.LANDING$OR)}),(0,K.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,K.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(S,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,K.jsx)(L,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:_,children:r(v.ONBOARDING$BACK)}),(0,K.jsx)(L,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:_,children:r(v.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>$}),X=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Z=`openhands-onboarding-started`;function Q({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,K.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:_(`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}=M(),o=a?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:c,trackOnboardingCompleted:l,trackOnboardingSkipped:d}=j(),{active:f}=m(),{backend:p}=f,y=u(p),b=ee(y?[]:[p]),x=g(),S=x!==null&&p.kind===`cloud`&&h(p.host,x),C=!y&&b[p.id]?.isConnected===!0&&(x===null||S),w=C?Me:X,[T,E]=G.useState(()=>X[Math.min(Math.max(t,0),X.length-1)]),[D,O]=G.useState(`openhands`);G.useEffect(()=>{w.includes(T)||E(w[0])},[T,w]);let k=w.length,A=w.includes(T)?T:w[0],N=w.indexOf(A),L=y||b[p.id]?.isConnected!==void 0,R=D===`openhands`,z=N===0&&g()!==null,B=G.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[w]),V=G.useCallback(()=>{E(e=>{let t=w,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[w]),H=G.useRef(!1);G.useEffect(()=>{n||!o||H.current||window.sessionStorage.getItem(Z)||(H.current=!0,window.sessionStorage.setItem(Z,`1`),s())},[n,o]);let U=G.useRef(null);G.useEffect(()=>{n||!o||!L||U.current!==A&&(U.current=A,c({step:A,stepIndex:N,totalSteps:k,agent:D}))},[n,o,L,A,N,k,D]);let te=()=>{l({agent:D}),e()},W=()=>{d({step:A,stepIndex:N,totalSteps:k,agent:D}),e()};return(0,K.jsx)(P,{"aria-label":r(v.ONBOARDING$TITLE),children:(0,K.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,K.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":N,"data-preview":n?`true`:void 0,className:_(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,F(`lg`),I,`max-h-[90vh]`),children:[(0,K.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,K.jsx)(ye,{currentStep:N,totalSteps:k})}),(0,K.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,K.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":N,className:`relative overflow-clip`,children:[C?null:(0,K.jsx)(Q,{index:w.indexOf(`backend`),currentStep:N,children:(0,K.jsx)(Te,{onNext:B,onClose:e})}),(0,K.jsx)(Q,{index:w.indexOf(`agent`),currentStep:N,children:(0,K.jsx)(Ce,{selectedAgentId:D,onSelect:O,onBack:C?void 0:V,onNext:B})}),(0,K.jsx)(Q,{index:w.indexOf(`setup`),currentStep:N,children:R?(0,K.jsx)(De,{onBack:V,onNext:B}):(0,K.jsx)(Oe,{providerKey:D,isActive:A===`setup`,onBack:V,onNext:B})}),(0,K.jsx)(Q,{index:w.indexOf(`hello`),currentStep:N,children:(0,K.jsx)(Ae,{onBack:V,onClose:W,onLaunched:te})})]})})]}),N<k-1&&!z?(0,K.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:W,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(v.ONBOARDING$SKIP)}):null]})})}export{je as n,q as r,$ as t};
|
package/build/assets/{organization-service.api-Dsuoep0g.js → organization-service.api-C4GYWwj9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{ct as t}from"./active-backend-context-
|
|
1
|
+
import{S as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{ct as t}from"./active-backend-context-BBvP-bI2.js";import"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js";import{t as n}from"./proxy-DCI9S-LA.js";function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(e){if(e)return e;let n=t().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(t){let r=i(t);try{return{orgId:(await n({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(t){if(t instanceof e&&t.status===400)return{orgId:null,isLegacyKey:!0};throw t}}async function s(e,t){let r=await n({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}export{a as n,o as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{z as i}from"./utils-
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{z as i}from"./utils-DPQfkd-7.js";import{T as a,d as o}from"./messages-D1cbVhRK.js";import{t as s}from"./list-todo-CheUtB7F.js";import{t as c}from"./brand-button-CJcwjnfb.js";import{t as l}from"./conversation-store-B8Eahyeg.js";import{O as u}from"./llm-not-configured-banner-CwKu8C6g.js";import{t as d}from"./markdown-renderer-BiiiIznl.js";import{t as f}from"./conversation-tab-empty-state-C9sfDOlt.js";var p=e(t(),1),m=n();function h(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:h,scrollDomToBottom:g}=a(p.useRef(null)),{planContent:_,conversationMode:v}=l();p.useEffect(()=>{h&&g()},[_,h,g]);let y=v===`plan`,{handlePlanClick:b}=u();return _==null?(0,m.jsx)(f,{icon:(0,m.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,m.jsx)(c,{type:`button`,variant:`secondary`,onClick:b,isDisabled:y,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,m.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,m.jsx)(d,{includeStandard:!0,components:o,children:_})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{$ as t,ct as n}from"./active-backend-context-
|
|
1
|
+
import{l as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{$ as t,ct as n}from"./active-backend-context-BBvP-bI2.js";function r(){return n().backend.kind===`cloud`}function i(){return new e(t())}var a=class{static async listInstalledPlugins(){if(r())return[];try{return(await i().listInstalledPlugins()).plugins??[]}catch{return[]}}static async installPlugin(e){if(r())throw Error(`Installing plugins is only available on a local backend.`);return i().installPlugin(e)}static async setPluginEnabled(e,t){if(r())throw Error(`Enabling and disabling plugins is only available on a local backend.`);return i().setPluginEnabled(e,t)}static async uninstallPlugin(e){if(r())throw Error(`Uninstalling plugins is only available on a local backend.`);return i().uninstallPlugin(e)}static async refreshPlugin(e){if(r())throw Error(`Refreshing plugins is only available on a local backend.`);return i().refreshPlugin(e)}};export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{$ as t,ct as n}from"./active-backend-context-
|
|
1
|
+
import{f as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{$ as t,ct as n}from"./active-backend-context-BBvP-bI2.js";import{t as r}from"./proxy-DCI9S-LA.js";var i=`/api/v1/settings/profiles`;function a(){let{backend:e,orgId:t}=n();if(e.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:e,base:t?`/api/organizations/${encodeURIComponent(t)}/profiles`:i}}async function o(){let{backend:e,base:t}=a();return r({backend:e,method:`GET`,path:t})}async function s(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`GET`,path:`${n}/${encodeURIComponent(e)}`});return{name:i.name,config:i.config??i.llm??{},api_key_set:i.api_key_set??!1}}async function c(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}`,body:t})}async function l(e){let{backend:t,base:n}=a();return r({backend:t,method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function u(e,t){let{backend:n,base:i}=a();return r({backend:n,method:`POST`,path:`${i}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function d(e){let{backend:t,base:n}=a(),i=await r({backend:t,method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}});return{name:i.name,message:i.message,llm_applied:i.model!=null||i.llm!=null}}function f(){return n().backend.kind===`cloud`}var p=class{static async listProfiles(){return f()?o():new e(t()).listProfiles()}static async getProfile(n,r){if(f())return s(n);let i=r?{exposeSecrets:r}:{};return new e(t()).getProfile(n,i)}static async saveProfile(n,r){return f()?c(n,r):new e(t()).saveProfile(n,r)}static async deleteProfile(n){return f()?l(n):new e(t()).deleteProfile(n)}static async renameProfile(n,r){return f()?u(n,r):new e(t()).renameProfile(n,r)}static async activateProfile(n){return f()?d(n):new e(t()).activateProfile(n)}};export{p as t};
|
|
@@ -1 +1 @@
|
|
|
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~lq5hicxx-cHFhpUBq.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{Bt as a,C as o,Ht as s,S as c,Vt as l,Wt as u,_ as d,at as f,b as p,c as m,d as h,it as g,m as _,o as v,s as y,st as b,t as x,y as S}from"./active-backend-context-
|
|
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~lq5hicxx-cHFhpUBq.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js";import{Bt as a,C as o,Ht as s,S as c,Vt as l,Wt as u,_ as d,at as f,b as p,c as m,d as h,it as g,m as _,o as v,s as y,st as b,t as x,y as S}from"./active-backend-context-BBvP-bI2.js";import{t as C}from"./utils-DPQfkd-7.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,h,()=>`pending`),t=(0,E.useRef)(!1);(0,E.useEffect)(()=>{t.current||(t.current=!0,c())},[]),(0,E.useEffect)(()=>{e===`granted`&&o()},[e]);let n=(0,E.useCallback)(()=>d(`granted`),[]),r=(0,E.useCallback)(()=>d(`denied`),[]),i=(0,E.useCallback)((e,t)=>{p(e,t)},[]),a=(0,E.useCallback)(()=>v(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:a}}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(()=>{m(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(y(M()),!0)},[r,a,i,o]),E.useEffect(()=>{r&&_().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:o,contentClassName:c,style:d,styleOverrides:p,theme:m,withStyleRoot:h=!0}){let _=E.useMemo(()=>t??g(),[t]),v=E.useMemo(()=>r??l(),[r]),y=E.useRef(null);y.current||={queryClient:f(),i18n:s()},b(_),u(v),E.useEffect(()=>()=>{y.current&&(b(y.current.queryClient),u(y.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:v,defaultNS:a,children:(0,k.jsx)(i,{client:_,children:(0,k.jsx)(x,{children:h?(0,k.jsx)(F,{className:o,contentClassName:c,style:d,styleOverrides:p,theme:m,children:S}):S})})})}export{I as n,F as r,L as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{Q as t,ct as n,gt as r,vt as i}from"./active-backend-context-
|
|
1
|
+
import{t as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{Q as t,ct as n,gt as r,vt as i}from"./active-backend-context-BBvP-bI2.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(t){let n=a(t),s=r(),c=s?i():{};return new e({host:n.host,apiKey:n.apiKey,orgId:o(n),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let n=s(e);if(!n.proxy)throw new t;return n}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};
|
|
@@ -0,0 +1 @@
|
|
|
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~gxu4j2ea-Cwhh3zLe.js";import{E as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js";import{t as a}from"./use-is-creating-conversation-CVefC9Ns.js";import{n as o}from"./active-backend-context-BBvP-bI2.js";import{I as s,t as c,z as l}from"./utils-DPQfkd-7.js";import{D as u,O as d,S as f,T as p,h as m,k as h,t as g,y as _}from"./use-tracking-CGCsBWhg.js";import{t as v}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js";import{l as y}from"./settings-service.api-DZp7E7A9.js";import{n as b}from"./use-settings-BHWsOcIG.js";import{t as x}from"./modal-backdrop-BSzNhM4r.js";import{n as S}from"./modal-classes-CLEXO6dj.js";import{t as C}from"./brand-button-CJcwjnfb.js";import{n as w}from"./navigation-context-CQZwH_tC.js";import{o as T,s as ee,t as E}from"./conversation-store-B8Eahyeg.js";import{t as D}from"./modal-close-button-D0aT02hs.js";import{n as O}from"./use-create-conversation-DWaSVUOB.js";import{p as k,t as A}from"./install-server-modal-BTwK5lbi.js";import{i as j,n as M,r as N,t as P}from"./extension-module-card-classes-Bo43vY5V.js";import{d as F,n as I,o as L,s as R}from"./mcp-marketplace-utils-Dr_HG_ol.js";import{t as z}from"./vendor~root-layout~index-home~home~mcp~automations-list~automation-templates~automation-set~bxsimjx0-D7IDevqN.js";import{n as B}from"./skill-card-pill-row-B_BYBONu.js";import{t as V}from"./circle-plus-check-toggle-BVzv5EkZ.js";var H=i(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),U=e(t(),1),W=`${s.PRODUCTION}/settings/integrations`;function G(e){let t=f(),n=h(e);return n.length>0&&n.every(e=>t.includes(e))}function K(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:l.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:l.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:l.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:l.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:l.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:l.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:W}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var q=[`local`,`openhands-cloud`],J=n(),Y=`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 te(e){return e.slice(0,4)}function ne({entries:e,className:t,testId:n}){let r=te(e);if(r.length===0)return(0,J.jsx)(k,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,J.jsx)(k,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,J.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:c(Y,`items-center justify-center`,t),children:(0,J.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,J.jsx)(k,{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,J.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:c(Y,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,J.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,J.jsx)(k,{entry:e,size:`xs`})},e.id):(0,J.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function X({count:e}){return(0,J.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})}function re(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)}var ie=re(v);function Z(e){return _().includes(e.id)}function Q(e){let t=R(z);return d(e).map(e=>L(e,t)).filter(e=>!!e)}function ae(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,u(e),...t.map(e=>e.name),...t.flatMap(e=>e.keywords??[])].join(` `).toLowerCase().includes(r):!0}function oe(e){return Q(e).length>0}function se(e,t,n,r){let i=e.map(e=>{let n=!!I(e,t);return{id:`mcp-${e.id}`,node:(0,J.jsxs)(`span`,{className:c(j,`gap-1`),children:[(0,J.jsx)(k,{entry:e,size:`xs`}),e.name,n?(0,J.jsx)(`span`,{className:`text-white`,children:r(l.RECOMMENDED_AUTOMATIONS$CONNECTED)}):null]})}});return n>0&&i.push({id:`missing-connect`,node:(0,J.jsx)(`span`,{className:j,children:r(l.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function $({automations:e,installedServers:t,onSelect:n,translate:r}){return(0,J.jsx)(`div`,{className:c(`mt-3`,P),children:e.map(e=>{let i=Q(e),a=i.filter(e=>!I(e,t)).length;return(0,J.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>n(e),className:c(`flex min-w-0 overflow-hidden p-4 text-left rounded-xl bg-surface-raised`,N),children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,J.jsx)(ne,{entries:i,testId:`recommended-automation-icon-${e.id}`}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,J.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,J.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,J.jsx)(V,{testId:`recommended-automation-plus-${e.id}`})]}),(0,J.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,J.jsx)(B,{pills:se(i,t,a,r),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})}function ce({backendKind:e,installedServers:t,query:n=``,onSelect:i,scrollableGrid:a=!1}){let{t:o}=r(`openhands`),s=ie.filter(e=>{let t=Q(e);return oe(e)&&ae(e,t,n)});if(s.length===0)return null;let u=s.filter(Z),d=s.filter(e=>!Z(e));return(0,J.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:c(a&&`flex min-h-0 flex-1 flex-col`),children:(0,J.jsxs)(`div`,{"data-testid":a?`recommended-automations-scroll-area`:void 0,className:c(`mt-3`,M,a&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[u.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`flex items-center`,children:[(0,J.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:o(l.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,J.jsx)(X,{count:u.length})]}),(0,J.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:o(l.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,J.jsx)($,{automations:u,installedServers:t,onSelect:i,translate:o})]}),d.length>0&&(0,J.jsxs)(`section`,{"data-testid":`recommended-automations-beta-section`,className:c(u.length>0&&`mt-8`),children:[(0,J.jsxs)(`div`,{"data-testid":`recommended-automations-beta-heading`,className:`flex items-center`,children:[(0,J.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:o(l.RECOMMENDED_AUTOMATIONS$BETA_LABEL)}),(0,J.jsx)(X,{count:d.length})]}),(0,J.jsx)($,{automations:d,installedServers:t,onSelect:i,translate:o})]})]})})}function le({isOpen:e,onClose:t,onContinueLocal:n,onOpenUrl:i}){let{t:a}=r(`openhands`);return e?(0,J.jsx)(x,{onClose:t,"aria-label":a(l.RESPONDER_DEPLOYMENT$TITLE),children:(0,J.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,J.jsx)(D,{onClose:t,testId:`responder-deployment-modal-close`}),(0,J.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,J.jsx)(`h2`,{className:c(`pr-6`,S),children:a(l.RESPONDER_DEPLOYMENT$TITLE)}),(0,J.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:a(l.RESPONDER_DEPLOYMENT$DESCRIPTION)})]}),(0,J.jsx)(`div`,{className:`flex flex-col gap-3 px-6 pb-6 sm:flex-row`,children:q.map(e=>{let t=K(e),{action:r}=t;return(0,J.jsxs)(`div`,{"data-testid":t.testId,className:`flex flex-1 flex-col gap-3 rounded-xl border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:a(t.titleKey)}),(0,J.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:a(t.descriptionKey)})]}),(0,J.jsx)(C,{type:`button`,variant:`primary`,className:`mt-auto`,testId:t.primaryActionTestId,onClick:()=>{r.kind===`launch-local`?n():i(r.url)},children:a(t.primaryActionKey)})]},t.target)})})]})}):null}function ue(e){let t=R(z);return h(e).map(e=>L(e,t)).filter(e=>!!e)}function de({query:e,onLaunched:t,scrollableGrid:n=!1}){let r=o(),{navigate:i}=w(),{data:s}=b(),{trackPrebuiltAutomationEnabled:c}=g(),l=O(),d=a(),f=E(e=>e.setMessageToSend),[h,_]=(0,U.useState)(null),[v,x]=(0,U.useState)(null),[S,C]=(0,U.useState)([]),D=(0,U.useRef)(!1),k=(0,U.useRef)(!1),j=(0,U.useMemo)(()=>F(s?.mcp_config??y(s?.agent_settings?.mcp_config)).filter(e=>e.enabled!==!1),[s?.agent_settings?.mcp_config,s?.mcp_config]),M=(0,U.useCallback)(e=>{if(k.current||l.isPending||d)return;if(k.current=!0,p.findById(e.id)){i?.(m(e.id)),t?.();return}let n=u(e);l.mutate({},{onSuccess:r=>{c({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?ee(r.task_id,n):T(r.conversation_id,{draftMessage:n}),i?.(`/conversations/${r.conversation_id}`),t?.(),window.setTimeout(()=>f(n),0)},onError:()=>{k.current=!1}})},[r.backend.kind,l,d,i,t,f,c]),N=(0,U.useCallback)(e=>ue(e).filter(e=>!I(e,j)),[j]),P=e=>{let t=N(e);if(t.length===0){M(e);return}_(e),C(t)},L=e=>{if(!(k.current||l.isPending||d||S.length>0||v!==null)){if(G(e)){x(e);return}P(e)}},R=()=>{let e=v;x(null),e&&P(e)},z=e=>{x(null),window.open(e,`_blank`,`noopener,noreferrer`)},B=()=>{x(null)},V=()=>{if(D.current){D.current=!1;return}_(null),C([])},H=()=>{D.current=!0,C(e=>{let t=e.slice(1);if(t.length===0){let e=h;window.setTimeout(()=>{_(null),e&&M(e)},0)}return t})},W=S[0]??null;return r.backend.kind===`cloud`?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ce,{backendKind:r.backend.kind,installedServers:j,query:e,onSelect:L,scrollableGrid:n}),W&&(0,J.jsx)(A,{entry:W,existingServers:j,onClose:V,onSuccess:H},W.id),(0,J.jsx)(le,{isOpen:v!==null,onClose:B,onContinueLocal:R,onOpenUrl:z})]})}export{X as n,H as r,de as t};
|