@openhands/agent-canvas 1.13.0 → 1.14.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-D1PORKc0.js → acp-providers-CYy8qA2z.js} +1 -1
- package/build/assets/active-backend-context-BZDG15C0.js +2 -0
- package/build/assets/{agent-context-settings-DMrObcIS.js → agent-context-settings-DGWBBbcp.js} +1 -1
- package/build/assets/{agent-profiles-settings-DororXN5.js → agent-profiles-settings-DrkGdf4_.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DWBe0rbX.js → agent-server-conversation-service.api-DK56YPTs.js} +7 -7
- package/build/assets/{agent-settings-BJVk92PU.js → agent-settings-DfcSgkLD.js} +2 -2
- package/build/assets/agent-settings-Lrc5-twS.js +1 -0
- package/build/assets/{alert-banner-CzZsm7ms.js → alert-banner-BgDHhL7b.js} +1 -1
- package/build/assets/api-error-message-BEIE_yD1.js +1 -0
- package/build/assets/{api-key-entry-screen-D8Fade_-.js → api-key-entry-screen-DaZnOlVo.js} +1 -1
- package/build/assets/{app-settings-CpyGB3AT.js → app-settings-BG5NAUbC.js} +1 -1
- package/build/assets/automation-detail-D4Hs831Z.js +3 -0
- package/build/assets/automation-export-n0X6FB0C.js +2 -0
- package/build/assets/automation-git-sync-CDrm8WV7.js +1 -0
- package/build/assets/automation-setup-route-CZCl4ONs.js +1 -0
- package/build/assets/{automation-templates-DgpCGOJV.js → automation-templates-DFF96AdL.js} +1 -1
- package/build/assets/automations-list-Bl-oGOrV.js +1 -0
- package/build/assets/{back-nav-button-HHEneWMw.js → back-nav-button-H_ThtDA0.js} +1 -1
- package/build/assets/{backend-form-modal-DiVrD4Cm.js → backend-form-modal-CbCemvHt.js} +1 -1
- package/build/assets/backend-not-configured-DP8KLNq_.js +1 -0
- package/build/assets/{backend-synced-settings-badge-7MIjpr8M.js → backend-synced-settings-badge-BBASWqsb.js} +1 -1
- package/build/assets/{badge-CpYmcVZV.js → badge-B-51h-SW.js} +1 -1
- package/build/assets/{base-modal-Fnh6Uln9.js → base-modal-BbjycA8X.js} +1 -1
- package/build/assets/{bot-BQZx8e2i.js → bot-CGPCg03p.js} +1 -1
- package/build/assets/{brand-button-swT1RyO0.js → brand-button-Blxv5nww.js} +1 -1
- package/build/assets/browser-CuW0nWvh.js +7 -0
- package/build/assets/{browser-tab-zAY12m_i.js → browser-tab-D5G0ORwt.js} +1 -1
- package/build/assets/{chat-send-button-DsJtivmL.js → chat-send-button-BD2tii1r.js} +1 -1
- package/build/assets/check-DSuS-lyr.js +1 -0
- package/build/assets/chevron-down-CgGcmtE2.js +1 -0
- package/build/assets/circle-check-CG5-NPw7.js +1 -0
- package/build/assets/{circle-plus-check-toggle-Cuzx55bo.js → circle-plus-check-toggle-ASbpB8vN.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-86CwNdSh.js → cloud-funnel-analytics-GlCUG0gk.js} +1 -1
- package/build/assets/cog-CZiR80uT.js +1 -0
- package/build/assets/{combobox-caret-D0fRotFi.js → combobox-caret-DvpEsh2O.js} +1 -1
- package/build/assets/{command-menu-BXy03FBl.js → command-menu-DwUQzjYP.js} +1 -1
- package/build/assets/{condenser-settings-BmZa0ui_.js → condenser-settings-BptcoiLA.js} +1 -1
- package/build/assets/{confirmation-modal-BgoN6lbN.js → confirmation-modal-CiEwxZAA.js} +1 -1
- package/build/assets/{context-menu-list-item-Bq02tc-P.js → context-menu-list-item-CdcamfM1.js} +1 -1
- package/build/assets/conversation-DREHj4nT.js +1 -0
- package/build/assets/conversation-DotRfiDz.js +90 -0
- package/build/assets/conversation-panel-DREHj4nT.js +1 -0
- package/build/assets/conversation-state-store-DMLtlHbE.js +1 -0
- package/build/assets/{conversation-tab-empty-state-CMqo_0Bd.js → conversation-tab-empty-state-D-puECpY.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-Cg1pF0xn.js → copy-to-clipboard-button-BGxcUbgy.js} +1 -1
- package/build/assets/{device-verify-BfQLgNyq.js → device-verify-CZJfWaJf.js} +1 -1
- package/build/assets/{dropdown-classes-BIqQr5mx.js → dropdown-classes-tLhpwtxS.js} +1 -1
- package/build/assets/{entry.client-CxFjRYqH.js → entry.client-D8GnI6GZ.js} +2 -2
- package/build/assets/{enum-filter-dropdown-C_yV4_bo.js → enum-filter-dropdown-Fk8k60nk.js} +1 -1
- package/build/assets/{environment-switch-overlay-Bi4qbh2g.js → environment-switch-overlay-DeztVYuL.js} +1 -1
- package/build/assets/{extensions-hub-BqUINAhp.js → extensions-hub-Cd6GCYzq.js} +1 -1
- package/build/assets/{extensions-navigation-lraj88Wk.js → extensions-navigation-C4sgZg-y.js} +1 -1
- package/build/assets/{external-link-CgtpA_a1.js → external-link-C0UpBgsE.js} +1 -1
- package/build/assets/{file-text-DEK4LSVw.js → file-text-C6WYtNdV.js} +1 -1
- package/build/assets/files-tab-BW_qzyAm.js +1 -0
- package/build/assets/{form-control-classes-7yFSQJq_.js → form-control-classes-CGXBLcn1.js} +1 -1
- package/build/assets/format-model-name-BNPKVsIq.js +1 -0
- package/build/assets/format-relative-time-ZhQD4rsl.js +1 -0
- package/build/assets/git-provider-icon-CaQ1yLPi.js +1 -0
- package/build/assets/{git-repo-dropdown-ByMzpNko.js → git-repo-dropdown-CgXR6M_E.js} +1 -1
- package/build/assets/git-repo-dropdown-D2Uei3CO.js +1 -0
- package/build/assets/{highlighted-source-view-C_sfncLZ.js → highlighted-source-view-C_YOp8Fo.js} +1 -1
- package/build/assets/home-DNzzJcMP.js +1 -0
- package/build/assets/home-aCos-5vc.js +1 -0
- package/build/assets/{home-store-CxqsY9Fi.js → home-store-DgzViC3f.js} +1 -1
- package/build/assets/index-home-DNzzJcMP.js +1 -0
- package/build/assets/info-CLoC1LRo.js +1 -0
- package/build/assets/install-server-modal-D7zIqNKz.js +1 -0
- package/build/assets/kebab-menu-item-content-DERMdnDv.js +1 -0
- package/build/assets/{launch-CkqiSCqi.js → launch-5PjKeLak.js} +1 -1
- package/build/assets/{list-todo-DNWlzfaM.js → list-todo-BF049YaY.js} +1 -1
- package/build/assets/llm-not-configured-banner-BK9z5eS0.js +27 -0
- package/build/assets/llm-settings-BLAMK2tR.js +1 -0
- package/build/assets/llm-settings-BWsbarGM.js +1 -0
- package/build/assets/{llm-subscription-service-BAdOl5Xx.js → llm-subscription-service-SfnEV9Uc.js} +1 -1
- package/build/assets/loader-circle-D7IagAyF.js +1 -0
- package/build/assets/{loading-spinner-xhnrGP4Y.js → loading-spinner-DBgXgra0.js} +1 -1
- package/build/assets/{manage-backends-modal-DhGk5mJt.js → manage-backends-modal-BTqNPhzc.js} +1 -1
- package/build/assets/manifest-abebca3c.js +1 -0
- package/build/assets/manifest-subpage-layout-Rn-glaxV.js +1 -0
- package/build/assets/{map-provider-Mx8mZuE-.js → map-provider-BK4HnqYz.js} +1 -1
- package/build/assets/markdown-renderer-Cp6DlHQN.js +8 -0
- package/build/assets/{mcp-DCkvl6K0.js → mcp-BC-Ixn4T.js} +2 -2
- package/build/assets/{mcp-marketplace-utils-DEbMXlQr.js → mcp-marketplace-utils-BJWJgbB6.js} +1 -1
- package/build/assets/{messages-DSXvyc21.js → messages-CzFKrzPG.js} +5 -5
- package/build/assets/{modal-body-gIe21fDv.js → modal-body-BdKfD3Hl.js} +1 -1
- package/build/assets/{modal-classes-D66dlgZ7.js → modal-classes-D5_b5vMi.js} +1 -1
- package/build/assets/{modal-close-button-B6iOGYpI.js → modal-close-button-objukxk_.js} +1 -1
- package/build/assets/{mouse-pointer-click-BYX1Pw5W.js → mouse-pointer-click-C_gXyLyD.js} +1 -1
- package/build/assets/{npm-DLckoeJc.js → npm-CHVHV1MC.js} +1 -1
- package/build/assets/{onboarding-D7WDG66N.js → onboarding-Diw0V51A.js} +1 -1
- package/build/assets/onboarding-modal-Da4yHzsA.js +1 -0
- package/build/assets/{organization-service.api-D-s9z18a.js → organization-service.api-BztSy69u.js} +1 -1
- package/build/assets/parse-git-remote-url-BkXN9jzl.js +1 -0
- package/build/assets/{pencil-BGOCPRyu.js → pencil-49avMHlD.js} +1 -1
- package/build/assets/{planner-tab-AKaXIIfg.js → planner-tab-CJiSpNax.js} +1 -1
- package/build/assets/{plugins-management-service-wtmY4QQw.js → plugins-management-service-lHdNKWNU.js} +1 -1
- package/build/assets/plus-C0BagBpV.js +1 -0
- package/build/assets/profiles-service.api-BLr7FXec.js +1 -0
- package/build/assets/providers-CWXnb7S3.js +1 -0
- package/build/assets/{proxy-9Z_WZggZ.js → proxy-DYDXxtje.js} +1 -1
- package/build/assets/{puzzle-BWLmN8z4.js → puzzle-Bt2B1rzf.js} +1 -1
- package/build/assets/recommended-automations-launcher-CcFMfJRR.js +1 -0
- package/build/assets/{refresh-cw-CXtFWpwv.js → refresh-cw-nmcesifB.js} +1 -1
- package/build/assets/root-CT4t7apy.css +1 -0
- package/build/assets/root-DnRgLKpU.js +2 -0
- package/build/assets/root-layout-2L9tr-BN.js +2 -0
- package/build/assets/{schema-field-OnM5Uob_.js → schema-field-C59lVZTA.js} +1 -1
- package/build/assets/{sdk-section-page-m5WQm2sy.js → sdk-section-page-BbBEQQjq.js} +1 -1
- package/build/assets/search-CYSDBczG.js +1 -0
- package/build/assets/secrets-service-BtsgYSlj.js +1 -0
- package/build/assets/secrets-settings-DJ0OKa4_.js +1 -0
- package/build/assets/{segmented-toggle-DCspm2U5.js → segmented-toggle-DiVfTZuN.js} +1 -1
- package/build/assets/{settings-BJQI_iBM.js → settings-CDqL_Uqh.js} +1 -1
- package/build/assets/{settings-CWFxymAf.js → settings-DcNPxz0v.js} +1 -1
- package/build/assets/{settings-dropdown-input-BI8V_Nov.js → settings-dropdown-input-Ba1UN5Du.js} +1 -1
- package/build/assets/{settings-index-BiTqJoH7.js → settings-index-Cz2cKt2K.js} +1 -1
- package/build/assets/{settings-input-Cz62hWVW.js → settings-input-CWUEHHvS.js} +1 -1
- package/build/assets/{settings-list-classes-z_3FW5H3.js → settings-list-classes-DdcLXDGn.js} +1 -1
- package/build/assets/{settings-modal-BIrIVn97.js → settings-modal-nEEK1Kh1.js} +1 -1
- package/build/assets/{settings-service.api--rJmnuLa.js → settings-service.api-3yAUFcaP.js} +1 -1
- package/build/assets/{settings-switch-BRsSI8Vs.js → settings-switch-Dk9hChx1.js} +1 -1
- package/build/assets/{settings-utils-Ba7vel6T.js → settings-utils-CxjtCSB3.js} +1 -1
- package/build/assets/{shared-conversation-CQK_PqHx.js → shared-conversation-DbAcrx3s.js} +1 -1
- package/build/assets/{shield-check-T3JsDJiM.js → shield-check-CiOTXxV2.js} +1 -1
- package/build/assets/{sidebar-layout-Bhi3hVcu.js → sidebar-layout-lrfPooIB.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-YWJNRN4p.js → sidebar-mobile-menu-toggle-KERXfNu1.js} +1 -1
- package/build/assets/{sidebar-nav-link-BSUlY5Ml.js → sidebar-nav-link-B8lFD6Cb.js} +1 -1
- package/build/assets/{sidebar-store-Cl1cUv_F.js → sidebar-store-u6pUpxJ7.js} +1 -1
- package/build/assets/{skill-card-pill-row-BXz8L8Rn.js → skill-card-pill-row-dGIUzr_b.js} +1 -1
- package/build/assets/{skill-icon-badge-QgfKv31M.js → skill-icon-badge-kkOWZ89w.js} +1 -1
- package/build/assets/{skill-scope-Dc3JPW-8.js → skill-scope-DWN1PBPH.js} +1 -1
- package/build/assets/{skills-plugins-CpTV27n3.js → skills-plugins-DFjH2Nq6.js} +1 -1
- package/build/assets/{skills-settings-CSW__IW4.js → skills-settings-DIHpl3ol.js} +2 -2
- package/build/assets/{sparkles-TJ0mdECe.js → sparkles-ntyMLnbj.js} +1 -1
- package/build/assets/{styled-tooltip-BUMSbgrF.js → styled-tooltip-B6JXcsmL.js} +1 -1
- package/build/assets/{task-list-tab-mAHMOkUz.js → task-list-tab-aEJzEcHD.js} +1 -1
- package/build/assets/{terminal-BzxBaHx2.js → terminal-Dch7Ty5K.js} +1 -1
- package/build/assets/{toggle-switch-O5v1FgxW.js → toggle-switch-B2MLKsgt.js} +1 -1
- package/build/assets/{trash-2-C0xNVp9c.js → trash-2-yZnDM4Ji.js} +1 -1
- package/build/assets/{typography-NOKSk9_R.js → typography-DB5HoCk0.js} +1 -1
- package/build/assets/usage-tab-DrEtBmBT.js +1 -0
- package/build/assets/use-acp-credential-form-c8KXAa8A.js +1 -0
- package/build/assets/{use-activate-agent-profile-D9YRQPTF.js → use-activate-agent-profile-B0p34N3q.js} +1 -1
- package/build/assets/use-agent-profiles-CPIc6wLH.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-Dxzq2AEd.js → use-can-manage-org-profiles-Dz_8Eqkv.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-Co2eJk2A.js → use-cloud-current-user-id-DvUVqCle.js} +1 -1
- package/build/assets/use-config-C3PO4TBw.js +1 -0
- package/build/assets/{use-create-conversation-CoHTiCbI.js → use-create-conversation-DVrA_uLD.js} +1 -1
- package/build/assets/use-create-secret-DbBIpaCR.js +1 -0
- package/build/assets/use-get-secrets-6PBitf54.js +1 -0
- package/build/assets/use-has-permission-CQ31Cl8j.js +1 -0
- package/build/assets/use-is-authed-2UrDIziV.js +1 -0
- package/build/assets/use-is-creating-conversation-BvYpmb3v.js +1 -0
- package/build/assets/use-llm-profiles-diZS4FiN.js +1 -0
- package/build/assets/use-manifest-capabilities-HIWCtIUm.js +1 -0
- package/build/assets/{use-onboarding-completion-CCE8OQgV.js → use-onboarding-completion-Bs8PcXik.js} +1 -1
- package/build/assets/{use-plugins-marketplace-CEiak69h.js → use-plugins-marketplace-BCuNLFsr.js} +1 -1
- package/build/assets/use-save-agent-profile-BaMNSpBV.js +1 -0
- package/build/assets/{use-save-settings-DNmnbG6f.js → use-save-settings-BahvC2Gw.js} +1 -1
- package/build/assets/{use-settings-wCwPaSIv.js → use-settings-C6ZxpBDX.js} +1 -1
- package/build/assets/{use-settings-nav-items-BlFL7YhM.js → use-settings-nav-items-Bqn69Ggw.js} +2 -2
- package/build/assets/use-tracking-Bhu7gk2y.js +3 -0
- package/build/assets/{use-user-conversation-DVtfg0B_.js → use-user-conversation-BkNXpXrd.js} +1 -1
- package/build/assets/{useInfiniteQuery-p1xq35r2.js → useInfiniteQuery-c_OmS3lK.js} +1 -1
- package/build/assets/{useMutation-BFDQmgk9.js → useMutation-6ZsQCqAn.js} +1 -1
- package/build/assets/{useQueries-DF1NAAeC.js → useQueries-xDrGlTO_.js} +1 -1
- package/build/assets/{useQuery-DRv--6bK.js → useQuery-Bs5NFz2s.js} +1 -1
- package/build/assets/{utils-zxEjKE70.js → utils-DUD5ScdA.js} +1 -1
- package/build/assets/{vendor~entry.client-CgNUwtQL.js → vendor~entry.client-BFE7Llz9.js} +1 -1
- package/build/assets/{vendor~entry.client-zSIea5EO.js → vendor~entry.client-BaKt_PIp.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-D87mAf6K.js} +1 -1
- package/build/assets/{vendor~files-tab-D9wR9yM2.js → vendor~files-tab-B6POTS66.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js → vendor~index-home~home~conversation-panel~conversation-53Q_U6uP.js} +1 -1
- package/build/assets/{vendor~root-layout-C-IgVx6e.js → vendor~root-layout-DeQACFVA.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js → vendor~root-layout~conversation-panel~conversation-bv7ooVgH.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-e8pX05xf.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-BvS6PCK2.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-DOPLJMH9.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz8NQve5.js} +1 -1
- package/build/assets/{verification-settings-B8UMQ7MG.js → verification-settings-COueVXmM.js} +1 -1
- package/build/assets/{wrench-DIka3hCq.js → wrench-C95ujnYo.js} +1 -1
- package/build/assets/x-86ZCfxKY.js +1 -0
- package/build/assets/{zap-DHddTPc0.js → zap-DRa-r-Tf.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +60 -2
- package/build/locales/ca/openhands.json +60 -2
- package/build/locales/de/openhands.json +60 -2
- package/build/locales/en/openhands.json +60 -2
- package/build/locales/es/openhands.json +60 -2
- package/build/locales/fr/openhands.json +60 -2
- package/build/locales/it/openhands.json +60 -2
- package/build/locales/ja/openhands.json +60 -2
- package/build/locales/ko-KR/openhands.json +60 -2
- package/build/locales/no/openhands.json +60 -2
- package/build/locales/pt/openhands.json +60 -2
- package/build/locales/tr/openhands.json +60 -2
- package/build/locales/uk/openhands.json +60 -2
- package/build/locales/zh-CN/openhands.json +60 -2
- package/build/locales/zh-TW/openhands.json +60 -2
- package/config/defaults.json +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.d.ts +10 -0
- package/dist/api/automation-service/automation-service.api.js +42 -0
- package/dist/api/automation-service/automation-service.api.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 +9 -0
- package/dist/api/cloud/conversation-service.api.js +11 -1
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/profiles-service/profiles-service.api.cjs +1 -1
- package/dist/api/profiles-service/profiles-service.api.cjs.map +1 -1
- package/dist/api/profiles-service/profiles-service.api.d.ts +15 -2
- package/dist/api/profiles-service/profiles-service.api.js +25 -2
- package/dist/api/profiles-service/profiles-service.api.js.map +1 -1
- package/dist/api/secrets-service.cjs +1 -1
- package/dist/api/secrets-service.cjs.map +1 -1
- package/dist/api/secrets-service.d.ts +5 -0
- package/dist/api/secrets-service.js +12 -6
- package/dist/api/secrets-service.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/index.d.ts +0 -1
- package/dist/components/features/automations/git-sync/git-sync-activity-row.d.ts +15 -0
- package/dist/components/features/automations/git-sync/git-sync-config-form.d.ts +13 -0
- package/dist/components/features/automations/git-sync/git-sync-error-banner.d.ts +6 -0
- package/dist/components/features/automations/git-sync/git-sync-not-local-state.d.ts +1 -0
- package/dist/components/features/automations/git-sync/git-sync-overview-section.d.ts +12 -0
- package/dist/components/features/automations/git-sync/git-sync-skeleton.d.ts +1 -0
- package/dist/components/features/automations/git-sync/git-sync-status-pill.d.ts +7 -0
- package/dist/components/features/automations/git-sync/git-sync-unsupported-state.d.ts +7 -0
- package/dist/components/features/automations/responder-deployment-modal.d.ts +2 -1
- package/dist/components/features/chat/chat-interface.cjs +2 -2
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +177 -176
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/error-message-banner.cjs +1 -1
- package/dist/components/features/chat/error-message-banner.cjs.map +1 -1
- package/dist/components/features/chat/error-message-banner.d.ts +3 -1
- package/dist/components/features/chat/error-message-banner.js +64 -58
- package/dist/components/features/chat/error-message-banner.js.map +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.cjs +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.js +6 -6
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +19 -19
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +10 -7
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.cjs.map +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.js +1 -1
- package/dist/components/shared/buttons/conversation-confirmation-buttons.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/contexts/conversation-websocket-context.cjs +2 -2
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +12 -12
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/query/use-commit-changes.cjs +1 -1
- package/dist/hooks/query/use-commit-changes.js +4 -4
- package/dist/hooks/query/use-git-sync.d.ts +19 -0
- package/dist/hooks/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.js +12 -10
- package/dist/hooks/query/use-task-polling.js.map +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
- package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
- package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
- package/dist/hooks/query/use-unified-git-commits.js +4 -4
- package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
- package/dist/hooks/query/use-unified-git-diff.js +4 -4
- package/dist/hooks/query/use-workspace-files.cjs +1 -1
- package/dist/hooks/query/use-workspace-files.cjs.map +1 -1
- package/dist/hooks/query/use-workspace-files.d.ts +14 -4
- package/dist/hooks/query/use-workspace-files.js +45 -32
- package/dist/hooks/query/use-workspace-files.js.map +1 -1
- package/dist/hooks/use-responder-url-secret.d.ts +5 -0
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +6 -0
- package/dist/hooks/use-tracking.js +6 -0
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +59 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +1 -1
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +1001 -15
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +60 -2
- package/dist/locales/ca/openhands.json +60 -2
- package/dist/locales/de/openhands.json +60 -2
- package/dist/locales/en/openhands.json +60 -2
- package/dist/locales/es/openhands.json +60 -2
- package/dist/locales/fr/openhands.json +60 -2
- package/dist/locales/it/openhands.json +60 -2
- package/dist/locales/ja/openhands.json +60 -2
- package/dist/locales/ko-KR/openhands.json +60 -2
- package/dist/locales/no/openhands.json +60 -2
- package/dist/locales/pt/openhands.json +60 -2
- package/dist/locales/tr/openhands.json +60 -2
- package/dist/locales/uk/openhands.json +60 -2
- package/dist/locales/zh-CN/openhands.json +60 -2
- package/dist/locales/zh-TW/openhands.json +60 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/files-tab.cjs +1 -1
- package/dist/routes/files-tab.js +11 -11
- package/dist/routes/files-tab.js.map +1 -1
- package/dist/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +2 -2
- package/dist/services/settings.js.map +1 -1
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.js +47 -51
- package/dist/services/telemetry.js.map +1 -1
- package/dist/stores/error-message-store.cjs +1 -1
- package/dist/stores/error-message-store.cjs.map +1 -1
- package/dist/stores/error-message-store.d.ts +3 -1
- package/dist/stores/error-message-store.js +5 -3
- package/dist/stores/error-message-store.js.map +1 -1
- package/dist/types/git-sync.d.ts +51 -0
- package/dist/utils/error-handler.cjs +1 -1
- package/dist/utils/error-handler.cjs.map +1 -1
- package/dist/utils/error-handler.d.ts +3 -2
- package/dist/utils/error-handler.js +18 -5
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/format-model-name.cjs +1 -1
- package/dist/utils/format-model-name.cjs.map +1 -1
- package/dist/utils/format-model-name.d.ts +1 -0
- package/dist/utils/format-model-name.js +1 -0
- package/dist/utils/format-model-name.js.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs +1 -1
- package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -1
- package/dist/utils/transcript-export/load-complete-events.js +24 -16
- package/dist/utils/transcript-export/load-complete-events.js.map +1 -1
- package/package.json +1 -1
- package/scripts/check-translation-completeness.cjs +3 -0
- package/scripts/dev-with-automation.mjs +98 -9
- package/build/assets/active-backend-context-IqOjobNK.js +0 -2
- package/build/assets/agent-settings-COfJsQ1d.js +0 -1
- package/build/assets/automation-detail-B-jQ39Mm.js +0 -3
- package/build/assets/automation-export-B1dywoqk.js +0 -2
- package/build/assets/automation-setup-route-C-bWUZBi.js +0 -1
- package/build/assets/automations-list-DnMxlxsL.js +0 -1
- package/build/assets/browser-B9AbV6kG.js +0 -7
- package/build/assets/check-WAFXrrs_.js +0 -1
- package/build/assets/chevron-down-CifNWzme.js +0 -1
- package/build/assets/circle-check-CtnimJa8.js +0 -1
- package/build/assets/conversation-BPo8SvLN.js +0 -1
- package/build/assets/conversation-CPCVsCUY.js +0 -90
- package/build/assets/conversation-panel-BPo8SvLN.js +0 -1
- package/build/assets/conversation-state-store-C5YpjMNy.js +0 -1
- package/build/assets/files-tab-DV0L-lFE.js +0 -1
- package/build/assets/format-model-name-BN_rx1Y3.js +0 -1
- package/build/assets/format-relative-time-DSErAuVr.js +0 -1
- package/build/assets/git-provider-icon-BvlLAche.js +0 -1
- package/build/assets/git-repo-dropdown-C6R7hgM8.js +0 -1
- package/build/assets/home-BOrlwLqG.js +0 -1
- package/build/assets/home-BvMNC6E-.js +0 -1
- package/build/assets/index-home-BvMNC6E-.js +0 -1
- package/build/assets/info-BRVcJAUg.js +0 -1
- package/build/assets/install-server-modal-Bl4G1zF4.js +0 -1
- package/build/assets/kebab-menu-item-content-BGoGFEAg.js +0 -1
- package/build/assets/llm-not-configured-banner-DLw_tu-G.js +0 -27
- package/build/assets/llm-settings-B-pkVCrt.js +0 -1
- package/build/assets/llm-settings-DSC0-IQ7.js +0 -1
- package/build/assets/loader-circle-B47W9XqT.js +0 -1
- package/build/assets/manifest-653b89aa.js +0 -1
- package/build/assets/manifest-subpage-layout-CKWvL2ig.js +0 -1
- package/build/assets/markdown-renderer-DUmk7pFc.js +0 -8
- package/build/assets/onboarding-modal-C_xVrFNv.js +0 -1
- package/build/assets/plus-zNEL8rcX.js +0 -1
- package/build/assets/profiles-service.api-DCMYxHMi.js +0 -1
- package/build/assets/providers-BjrtjX4L.js +0 -1
- package/build/assets/recommended-automations-launcher-CFlzhu1o.js +0 -1
- package/build/assets/root-CanxKlNV.css +0 -1
- package/build/assets/root-DkfG_UWR.js +0 -2
- package/build/assets/root-layout-D75LHYhh.js +0 -2
- package/build/assets/search-CycosyjN.js +0 -1
- package/build/assets/secrets-service-B26R61C1.js +0 -1
- package/build/assets/secrets-settings-CbLYCKOX.js +0 -1
- package/build/assets/usage-tab-tEmVN0KD.js +0 -1
- package/build/assets/use-acp-credential-form-BPNi0Zbm.js +0 -1
- package/build/assets/use-agent-profiles-Cb2zUW3l.js +0 -1
- package/build/assets/use-config-DKAMiI5R.js +0 -1
- package/build/assets/use-create-secret-2zBlCDsF.js +0 -1
- package/build/assets/use-is-authed-C52-ivnB.js +0 -1
- package/build/assets/use-is-creating-conversation-DdaAE6jV.js +0 -1
- package/build/assets/use-llm-profiles-C_BHue65.js +0 -1
- package/build/assets/use-manifest-capabilities-DPrQsaPP.js +0 -1
- package/build/assets/use-save-agent-profile-DK9idD6a.js +0 -1
- package/build/assets/use-tracking-CVwPmhlX.js +0 -3
- package/build/assets/x-BWKA2Ver.js +0 -1
- package/dist/api/cloud/suggestions-service.api.d.ts +0 -8
- package/dist/api/suggestions-service/suggestions-service.api.d.ts +0 -11
- package/dist/components/conversation-events/chat/event-message-components/observation-pair-event-message.d.ts +0 -7
- package/dist/components/conversation-events/index.d.ts +0 -1
- package/dist/components/features/automations/metadata-chip.d.ts +0 -6
- package/dist/components/features/chat/task-tracking/status-badge.d.ts +0 -5
- package/dist/components/features/chat/task-tracking/status-icon.d.ts +0 -5
- package/dist/components/features/chat/task-tracking/task-list-section.d.ts +0 -10
- package/dist/components/features/controls/tools.d.ts +0 -2
- package/dist/components/features/conversation-panel/new-conversation-button.d.ts +0 -23
- package/dist/components/features/home/home-header/guide-message.d.ts +0 -1
- package/dist/components/features/home/home-header/home-header.d.ts +0 -1
- package/dist/components/features/home/new-conversation/create-conversation-button.d.ts +0 -1
- package/dist/components/features/home/new-conversation/new-conversation.d.ts +0 -1
- package/dist/components/features/home/new-conversation.d.ts +0 -1
- package/dist/components/features/home/tasks/task-card.d.ts +0 -6
- package/dist/components/features/home/tasks/task-group.d.ts +0 -7
- package/dist/components/features/home/tasks/task-issue-number.d.ts +0 -6
- package/dist/components/features/home/tasks/task-item-title.d.ts +0 -1
- package/dist/components/features/home/tasks/task-suggestions-skeleton.d.ts +0 -1
- package/dist/components/features/home/tasks/task-suggestions.d.ts +0 -6
- package/dist/components/features/settings/agent-server-onboarding.d.ts +0 -10
- package/dist/components/features/settings/mcp-settings/mcp-server-list-item.d.ts +0 -6
- package/dist/components/features/settings/mcp-settings/mcp-server-list.d.ts +0 -8
- package/dist/hooks/query/use-suggested-tasks.d.ts +0 -1
- package/dist/hooks/use-should-show-user-features.d.ts +0 -1
- package/dist/ui/card-title.d.ts +0 -16
- package/dist/ui/card.d.ts +0 -14
- package/dist/utils/group-suggested-tasks.d.ts +0 -7
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dcc51rps-rfV8mQ9m.js} +0 -0
- /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js} +0 -0
- /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-BOVIFA_g.js} +0 -0
- /package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C0JXQb_q.js} +0 -0
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-DV0L-lFE.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Ck5D_A2Q.js","assets/active-backend-context-IqOjobNK.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js","assets/utils-zxEjKE70.js","assets/vendor~files-tab-D9wR9yM2.js","assets/iconBase-C2sR-uAp.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js","assets/useQuery-DRv--6bK.js","assets/messages-DSXvyc21.js","assets/vendor-markdown-j0kYzV48.js","assets/useMutation-BFDQmgk9.js","assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js","assets/markdown-renderer-DUmk7pFc.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js","assets/agent-server-conversation-service.api-DWBe0rbX.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js","assets/proxy-9Z_WZggZ.js","assets/profiles-service.api-DCMYxHMi.js","assets/settings-service.api--rJmnuLa.js","assets/settings-CWFxymAf.js","assets/llm-subscription-service-BAdOl5Xx.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-D1PORKc0.js","assets/conversation-store-Blc5xysY.js","assets/conversation-state-store-C5YpjMNy.js","assets/syntax-highlighter-BGDg_7w9.js","assets/copy-to-clipboard-button-Cg1pF0xn.js","assets/checkmark-XZyokq_Y.js","assets/copy-Drmhc2jD.js","assets/navigation-context-CQZwH_tC.js","assets/use-user-conversation-DVtfg0B_.js","assets/chevron-down-CifNWzme.js","assets/loader-circle-B47W9XqT.js","assets/vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js","assets/use-config-DKAMiI5R.js","assets/styled-tooltip-BUMSbgrF.js","assets/use-settings-wCwPaSIv.js","assets/close-ScPlnwyq.js","assets/skills-B0IliMxw.js","assets/u-check-circle-BKn1spCL.js","assets/typography-NOKSk9_R.js","assets/dist-Bl64nBZL.js","assets/form-control-classes-7yFSQJq_.js","assets/format-model-name-BN_rx1Y3.js","assets/mouse-pointer-click-BYX1Pw5W.js","assets/home-store-CxqsY9Fi.js","assets/useInfiniteQuery-p1xq35r2.js","assets/use-is-authed-C52-ivnB.js","assets/llm-not-configured-banner-DLw_tu-G.js","assets/vendor~index-home~home~conversation-panel~conversation-Ipoe6hvY.js","assets/use-is-creating-conversation-DdaAE6jV.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js","assets/chat-send-button-DsJtivmL.js","assets/check-WAFXrrs_.js","assets/circle-check-CtnimJa8.js","assets/git-provider-icon-BvlLAche.js","assets/use-tracking-CVwPmhlX.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js","assets/cloud-funnel-analytics-86CwNdSh.js","assets/plus-zNEL8rcX.js","assets/refresh-cw-CXtFWpwv.js","assets/use-agent-profiles-Cb2zUW3l.js","assets/skill-scope-Dc3JPW-8.js","assets/context-menu-list-item-Bq02tc-P.js","assets/dropdown-classes-BIqQr5mx.js","assets/use-can-manage-org-profiles-Dxzq2AEd.js","assets/organization-service.api-D-s9z18a.js","assets/git-repo-dropdown-ByMzpNko.js","assets/combobox-caret-D0fRotFi.js","assets/merge-agent-profile-save-input-WcFmQVKK.js","assets/brand-button-swT1RyO0.js","assets/base-modal-Fnh6Uln9.js","assets/modal-body-gIe21fDv.js","assets/modal-classes-D66dlgZ7.js","assets/loading-spinner-xhnrGP4Y.js","assets/modal-backdrop-BSzNhM4r.js","assets/modal-close-button-B6iOGYpI.js","assets/navigation-link-Bxo3-4vo.js","assets/use-activate-agent-profile-D9YRQPTF.js","assets/use-create-conversation-CoHTiCbI.js","assets/plugins-management-service-wtmY4QQw.js","assets/use-llm-profiles-C_BHue65.js","assets/use-click-outside-element-W6Os4Nlb.js","assets/link-external-BNZzCM1I.js","assets/settings-gear-DaJj6Pde.js","assets/u-robot-BvAOA2ZD.js","assets/settings-utils-Ba7vel6T.js","assets/map-provider-Mx8mZuE-.js","assets/conversation-tab-empty-state-CMqo_0Bd.js","assets/highlighted-source-view-C_sfncLZ.js","assets/folder-C1ou4_DT.js","assets/segmented-toggle-DCspm2U5.js","assets/format-time-delta-BIR5Os7T.js","assets/browser-tab-zAY12m_i.js","assets/external-link-CgtpA_a1.js","assets/vendor~browser-tab-C5uuAxZX.js","assets/planner-tab-AKaXIIfg.js","assets/list-todo-DNWlzfaM.js","assets/task-list-tab-mAHMOkUz.js","assets/usage-tab-tEmVN0KD.js","assets/info-BRVcJAUg.js","assets/terminal-BzxBaHx2.js","assets/vendor~terminal-BVSbSr6V.js","assets/vendor~terminal-T4IDBjWs.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{$ as t,St as n,a as r,bt as i,gt as a,ht as o,m as s,xt as c,yt as l}from"./vendor-styling-Ck5D_A2Q.js";import{F as u,I as d,R as f,U as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js";import{n as m}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as h}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{D as g,E as _,T as v}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as y}from"./useMutation-BFDQmgk9.js";import{t as b}from"./useQuery-DRv--6bK.js";import{t as x}from"./use-is-creating-conversation-DdaAE6jV.js";import{t as S}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-Cc0f9kPP.js";import{At as C,Ut as w,ct as T,jt as E,kt as D,n as O,tt as k}from"./active-backend-context-IqOjobNK.js";import{C as ee,D as A,E as j,M,O as N,R as P,S as F,T as I,b as L,c as R,d as te,h as ne,i as re,l as ie,o as ae,t as z,u as oe,x as se,z as B}from"./utils-zxEjKE70.js";import{A as ce,C as le,D as ue,E as de,M as V,N as fe,O as pe,S as me,T as he,_ as ge,b as _e,c as ve,d as ye,g as be,h as xe,j as Se,k as Ce,m as we,n as Te,p as Ee,s as De,t as Oe,u as ke,v as Ae,w as je,x as Me,y as Ne}from"./messages-DSXvyc21.js";import{t as Pe}from"./check-WAFXrrs_.js";import{n as Fe,t as H}from"./vendor~root-layout~conversation-panel~conversation-Dhd_I4H4.js";import{r as Ie}from"./map-provider-Mx8mZuE-.js";import{t as Le}from"./external-link-CgtpA_a1.js";import{a as Re,c as ze,d as Be,o as Ve,u as He}from"./git-provider-icon-BvlLAche.js";import{i as Ue}from"./cloud-funnel-analytics-86CwNdSh.js";import{t as We}from"./list-todo-DNWlzfaM.js";import{t as Ge}from"./loader-circle-B47W9XqT.js";import{t as Ke}from"./x-BWKA2Ver.js";import{t as qe}from"./proxy-9Z_WZggZ.js";import{t as Je}from"./loading-spinner-xhnrGP4Y.js";import{t as Ye}from"./use-tracking-CVwPmhlX.js";import{n as Xe}from"./use-settings-wCwPaSIv.js";import{t as Ze}from"./modal-backdrop-BSzNhM4r.js";import{n as Qe}from"./modal-body-gIe21fDv.js";import{n as $e,r as et}from"./base-modal-Fnh6Uln9.js";import{t as tt}from"./brand-button-swT1RyO0.js";import{n as nt}from"./navigation-context-CQZwH_tC.js";import{t as rt}from"./styled-tooltip-BUMSbgrF.js";import{r as it,u as at}from"./dropdown-classes-BIqQr5mx.js";import{a as ot,c as st,f as ct,t as U,u as lt}from"./conversation-store-Blc5xysY.js";import{t as ut}from"./modal-close-button-B6iOGYpI.js";import{T as dt,b as ft,t as pt,x as mt}from"./agent-server-conversation-service.api-DWBe0rbX.js";import{t as ht}from"./use-is-authed-C52-ivnB.js";import{a as gt,c as _t,f as vt,g as yt,l as bt,m as xt,s as St,t as Ct}from"./conversation-state-store-C5YpjMNy.js";import{c as wt,d as Tt,i as Et,l as Dt,n as Ot,r as kt,s as At,t as jt,u as Mt}from"./sidebar-mobile-menu-toggle-YWJNRN4p.js";import{t as Nt}from"./use-click-outside-element-W6Os4Nlb.js";import{n as Pt}from"./use-create-conversation-CoHTiCbI.js";import{n as Ft,t as W}from"./context-menu-list-item-Bq02tc-P.js";import{a as G,i as It,n as Lt}from"./use-can-manage-org-profiles-Dxzq2AEd.js";import{t as Rt}from"./u-edit-DAkcF52u.js";import{t as zt}from"./skills-B0IliMxw.js";import{s as Bt,t as Vt}from"./home-store-CxqsY9Fi.js";import{t as Ht}from"./use-user-conversation-DVtfg0B_.js";import{t as Ut}from"./copy-Drmhc2jD.js";import{r as Wt}from"./typography-NOKSk9_R.js";import{A as Gt,C as Kt,D as qt,E as Jt,F as Yt,I as Xt,N as Zt,O as Qt,P as $t,R as en,S as tn,T as nn,U as rn,V as an,_ as on,a as sn,b as cn,c as ln,g as un,i as dn,j as fn,l as pn,m as mn,n as hn,o as gn,r as _n,s as vn,t as yn,v as bn,w as xn,x as Sn,y as Cn,z as wn}from"./llm-not-configured-banner-DLw_tu-G.js";import{A as Tn,C as En,D as Dn,F as On,H as kn,I as An,J as K,K as jn,L as Mn,O as Nn,P as Pn,R as Fn,S as q,T as In,U as Ln,V as Rn,X as zn,Y as J,_ as Bn,a as Vn,b as Y,c as Hn,d as Un,f as Wn,h as Gn,j as Kn,k as qn,m as Jn,o as Yn,q as X,r as Xn,u as Zn,w as Qn,x as $n,y as er,z as tr}from"./markdown-renderer-DUmk7pFc.js";import{t as nr}from"./vendor~index-home~home~conversation-panel~conversation~alert-banner-B3qC_oj8.js";import{t as rr}from"./git-repo-dropdown-ByMzpNko.js";import{t as ir}from"./use-breakpoint-DWtihr9g.js";var ar=g(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),or=g(`square-chevron-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),sr=e=>!e.isLayoutDirty&&e.willUpdate(!1);function cr(){let e=new Set,t=new WeakMap,n=()=>e.forEach(sr);return{add:r=>{e.add(r),t.set(r,r.addEventListener(`willUpdate`,n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n}}var Z=l(),Q=e(n(),1),lr=(0,Q.createContext)(null);function ur(){let e=(0,Q.useRef)(!1);return o(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function dr(){let e=ur(),[n,r]=(0,Q.useState)(0),i=(0,Q.useCallback)(()=>{e.current&&r(n+1)},[n]);return[(0,Q.useCallback)(()=>t.postRender(i),[i]),n]}var fr=e=>e===!0,pr=e=>fr(e===!0)||e===`id`,mr=({children:e,id:t,inherit:n=!0})=>{let r=(0,Q.useContext)(a),i=(0,Q.useContext)(lr),[o,s]=dr(),c=(0,Q.useRef)(null),l=r.id||i;c.current===null&&(pr(n)&&l&&(t=t?l+`-`+t:l),c.current={id:t,group:fr(n)&&r.group||cr()});let u=(0,Q.useMemo)(()=>({...c.current,forceRender:o}),[s]);return(0,Z.jsx)(a.Provider,{value:u,children:e})},hr={curAgentState:I.LOADING},gr=ct(e=>({...hr,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(hr)})),_r=`openhands-last-conversation-by-backend`;function vr(e,t){return t?`${e}::${t}`:e}function yr(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(_r);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`string`&&r.length>0&&(n[e]=r);return n}catch{return{}}}function br(e){if(!(typeof window>`u`))try{window.localStorage.setItem(_r,JSON.stringify(e))}catch{}}function xr(e,t,n){if(!n)return;let r=yr();r[vr(e,t)]=n,br(r)}function Sr(e,t){let n=yr(),r=vr(e,t);r in n&&(delete n[r],br(n))}var Cr=e=>({action:V.CHANGE_AGENT_STATE,args:{agent_state:e}}),wr=e=>`error`in e,Tr=e=>`type`in e&&e.type===`error`,Er=()=>{let{send:e}=Se(),t=q(e=>e.events);Q.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(Kn(n)&&Tn(n))){if(wr(n)){if(n.error_code===401){C(`Session expired.`);return}typeof n.error==`string`?C(n.error):C(n.message);return}Tr(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(Cr(I.PAUSED))}},[t.length])},Dr=()=>{let{curAgentState:e}=X();return{runtimeActive:!j.includes(e)}};function Or({children:e}){return Er(),Dr(),e}var kr=`ACPAuthRequired`,Ar={ACPAuthRequired:B.ERROR$ACP_AUTH_REQUIRED_TITLE,ACPSpawnError:B.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPInitError:B.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,ACPPromptError:B.CHAT_INTERFACE$AGENT_ERROR_MESSAGE,UsagePolicyRefusal:B.CHAT_INTERFACE$AGENT_ERROR_MESSAGE};function jr(e){return e?Ar[e]??null:null}function Mr(e){return e===kr}var Nr={entriesByConversation:{}},Pr=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),Fr=ct()(lt(e=>({...Nr,addPending:(t,n)=>{let r=dt();return e(e=>Pr(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>Pr(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>Pr(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>Pr(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`}));function Ir({onClick:e}){let{t}=h(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-normal text-success bg-success/10 hover:bg-success/20 border border-success/30 transition-colors`,children:[(0,Z.jsx)(pe,{className:`w-3.5 h-3.5 fill-success`}),(0,Z.jsx)(`span`,{children:t(B.CHAT_INTERFACE$BTW_GOT_IT)})]})}function Lr({conversationId:e}){let{t}=h(`openhands`),n=Fr(e=>e.entriesByConversation),r=Fr(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,Z.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,Z.jsx)(Ce,{title:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`opacity-60`,children:t(B.CHAT_INTERFACE$BTW_PREFIX)}),(0,Z.jsx)(`span`,{children:n.question}),i&&(0,Z.jsx)(`span`,{"data-testid":`btw-spinner`,className:`inline-block w-3.5 h-3.5 ml-2 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`})]}),details:i?t(B.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,Z.jsx)(Ir,{onClick:()=>r(e,n.id)})},n.id)})})}function Rr({conversationId:e}){let t=Bn(e=>e.statusByConversation),n=e?t[e]:void 0;return n?.active?(0,Z.jsx)(ue,{status:n}):null}var zr=`${N} `,Br=(e,t)=>{let n=Fr(e=>e.addPending),r=Fr(e=>e.resolve),i=Fr(e=>e.fail);return(0,Q.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(zr);if(!e||!s){t(a);return}let c=o.slice(N.length).trim();if(!c)return;let l=n(e,c);_t(e,c).then(({response:t})=>r(e,l,t)).catch(t=>i(e,l,t?.message??`Failed to ask agent`))},[e,t,n,r,i])},Vr=`${M} `,Hr=/^--max(?:=|\s+)(\d+)\s*/,Ur=(e,t)=>{let{t:n}=h();return(0,Q.useCallback)(r=>{let i=r.trim(),a=i===`/goal`||i.startsWith(Vr);if(!e||!a){t(r);return}let o=i.slice(M.length).trim(),s,c=o.match(Hr);c&&(s=parseInt(c[1],10),o=o.slice(c[0].length).trim());let l=o;if(!l){C(n(B.GOAL$OBJECTIVE_REQUIRED));return}let u={objective:l};s&&s>=1&&(u.max_iterations=s),xt(e,u).catch(e=>{let t=n(B.GOAL$START_FAILED);C(e instanceof Error&&e.message?e.message:t)})},[e,t,n])},Wr=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Gr(e){return z(Wr,e?`bg-[var(--oh-surface)] hover:bg-tertiary cursor-pointer text-white`:`bg-[var(--oh-surface)] cursor-not-allowed opacity-50 text-[var(--oh-muted)]`)}function Kr(e){return e?`white`:`var(--oh-muted)`}var qr=`font-normal text-sm leading-5 truncate`;function Jr({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=h(`openhands`),{trackPullButtonClick:a}=Ye(),o=n&&t&&r;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(R())},disabled:!o,className:z(Gr(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(Jt,{width:12,height:12,color:Kr(o)})}),(0,Z.jsx)(`div`,{className:z(qr,`max-w-[76px]`),title:i(B.COMMON$PULL),children:i(B.COMMON$PULL)})]})}function Yr({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=h(`openhands`),{trackPushButtonClick:o}=Ye(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ie(r))},disabled:!s,className:z(Gr(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(qt,{width:12,height:12,color:Kr(s)})}),(0,Z.jsx)(`div`,{className:z(qr,`max-w-[77px]`),title:a(B.COMMON$PUSH),children:a(B.COMMON$PUSH)})]})}function Xr({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=h(`openhands`),{trackCreatePrButtonClick:o}=Ye(),s=n&&t&&i;return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(ae(r))},disabled:!s,className:z(Gr(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,Z.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,Z.jsx)(nn,{width:12,height:12,color:Kr(s)})}),(0,Z.jsx)(`div`,{className:z(qr,`max-w-[126px]`),title:a(B.COMMON$PULL_REQUEST),children:a(B.COMMON$PULL_REQUEST)})]})}var Zr=({allowAgentError:e=!1}={})=>{let{data:t}=K(),{curAgentState:n}=X(),r=e?A:j;return L(t?.execution_status)&&!r.includes(n)};function Qr(e){return e.kind===`BashCommand`}function $r(e){return e.kind===`BashOutput`}function ei(e){return e.kind===`BashError`}function ti(e,t,n){let r=(0,Q.useRef)(null),i=(0,Q.useRef)(null),a=(0,Q.useRef)([]),o=(0,Q.useRef)([]),s=(0,Q.useRef)(new Map);return(0,Q.useEffect)(()=>{if(!n)return;let c=k(e),l=new WebSocket(c);r.current=l,i.current=null,l.onopen=()=>{jn(l,t),i.current=l;for(let{command:e,cwd:t,timeout:n,resolve:r,reject:i}of a.current)o.current.push({resolve:r,reject:i}),l.send(JSON.stringify({command:e,cwd:t,timeout:n}));a.current=[]},l.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Qr(t)){let e=o.current.shift();e&&s.current.set(t.id,{...e,stdout:[],stderr:[]})}else if($r(t)&&t.command_id){let e=s.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(s.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else ei(t)&&u(`Bash error: ${t.code}: ${t.detail}`)};function u(e){let t=Error(e);for(let{reject:e}of a.current)e(t);a.current=[];for(let e of o.current)e.reject(t);o.current=[];for(let e of s.current.values())e.reject(t);s.current.clear()}return l.onclose=()=>{r.current=null,i.current=null,u(`Bash WebSocket closed`)},l.onerror=()=>{r.current=null,i.current=null,u(`Bash WebSocket error`)},()=>{l.onclose=null,l.onerror=null,l.close(),r.current=null,i.current=null,u(`Bash WebSocket unmounted`)}},[n,e,t]),(0,Q.useCallback)((e,t,n)=>new Promise((s,c)=>{let l=r.current;if(!l||l.readyState===WebSocket.CLOSED||l.readyState===WebSocket.CLOSING){c(Error(`Bash WebSocket not available`));return}l.readyState!==WebSocket.OPEN||i.current!==l?a.current.push({command:e,cwd:t,timeout:n,resolve:s,reject:c}):(o.current.push({resolve:s,reject:c}),l.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var ni={"github.com":`github`,"gitlab.com":`gitlab`,"bitbucket.org":`bitbucket`,"dev.azure.com":`azure_devops`};function ri(e){return e.replace(/\.git$/,``)}function ii(e){return e?ni[e.toLowerCase()]??null:null}function ai(e){let t=e.split(`/`).filter(Boolean),n=t.indexOf(`_git`);return n===-1?t.join(`/`):[...t.slice(0,n),...t.slice(n+1)].join(`/`)}function oi(e,t,n){let r=ri(n.replace(/^\/+/,``)),i=ii(t);return{url:e,host:t,repository:(i===`azure_devops`?ai(r):r)||null,provider:i}}function si(e){let t=e?.trim();if(!t)return null;let n=t.match(/^[^@\s]+@([^:\s]+):(.+)$/);if(n){let e=n[1];return oi(t,e,n[2])}try{let e=new URL(t);return oi(t,e.hostname||null,e.pathname)}catch{return null}}var ci={repository:null,branch:null,provider:null,remoteUrl:null},li=[`r=$(git remote get-url origin 2>/dev/null)`,`b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)`,`if [ -z "$r$b" ]; then`,`n=$(find . -mindepth 2 -maxdepth 4 -name .git 2>/dev/null | cut -c3- | sed 's|/.git$||' | sort -u)`,`c=$(printf '%s\\n' "$n" | grep -c '[^[:space:]]')`,`if [ "$c" = "1" ] && [ -n "$n" ]; then`,`r=$(git -C "$n" remote get-url origin 2>/dev/null)`,`b=$(git -C "$n" rev-parse --abbrev-ref HEAD 2>/dev/null)`,`fi`,`fi`,`printf '%s\\n%s' "$r" "$b"`].join(`
|
|
3
|
-
`);async function ui(e,t){let n=await e(li,t,10);if(n.exit_code!==0)return ci;let r=n.stdout.indexOf(`
|
|
4
|
-
`),i=(r>=0?n.stdout.slice(0,r):n.stdout).trim(),a=(r>=0?n.stdout.slice(r+1):``).trim(),o=a&&a!==`HEAD`?a:null;if(!i&&!o)return ci;let s=si(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var di=()=>{let{data:e}=K(),t=Zr(),{backend:n}=O(),r=n.kind===`local`,i=e?.id,a=e?.conversation_url,o=e?.session_api_key,s=e?.workspace?.working_dir?.trim(),c=!!e?.selected_repository,l=!!e?.git_provider,u=!!e?.selected_branch,d=r&&t&&!!i&&!!s&&(!c||!l||!u),f=ti(a,o,d),p=(0,Q.useRef)(f);return p.current=f,b({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>ui((e,t,n)=>p.current(e,t,n),s),enabled:d,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},fi=()=>{let e=m(),{t}=h(`openhands`);return y({mutationFn:e=>pt.updateConversationRepository(e.conversationId,e.repository,e.branch,e.gitProvider),onMutate:async t=>{let n=[`user`,`conversation`,t.conversationId];await e.cancelQueries({queryKey:n});let r=e.getQueriesData({queryKey:n});return e.setQueriesData({queryKey:n},e=>e&&{...e,selected_repository:t.repository,selected_branch:t.branch??null,git_provider:t.gitProvider??null}),{previousEntries:r}},onError:(n,r,i)=>{i?.previousEntries.forEach(([t,n])=>{e.setQueryData(t,n)}),C(t(B.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{E(t(B.CONVERSATION$REPOSITORY_UPDATED))},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`local-git-info`,r.conversationId]})}})};function pi({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,Z.jsx)(rt,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,Z.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function mi({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=h(`openhands`),{providers:a}=Bt(),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{a.length===1&&!o?s(a[0]):a.length>1&&!o&&r&&a.includes(r)&&s(r)},[a,o,r]);let f=(0,Q.useCallback)(e=>{e!==o&&(s(e),l(null),d(null))},[o]),p=(0,Q.useCallback)(e=>{e?(l(e),d(null)):(l(null),d(null))},[]),m=(0,Q.useCallback)(e=>{d(e)},[]),g=()=>{!c||!u||(n(c,u),l(null),d(null),t())},_=()=>{s(null),l(null),d(null),t()};if(!e)return null;let v=c?.git_provider||o||r,y=!!c&&!!u;return(0,Z.jsx)(Ze,{onClose:_,children:(0,Z.jsxs)(Qe,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(ut,{onClose:_,testId:`close-open-repository-modal`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(et,{title:i(B.CONVERSATION$OPEN_REPOSITORY)})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(B.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,Z.jsx)(sn,{providers:a,value:o,onChange:f})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,Z.jsx)(rr,{provider:v,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,className:`w-full`}),(0,Z.jsx)(dn,{repository:c?.full_name||null,provider:v,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,disabled:!c,className:`w-full`})]})]}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(tt,{type:`button`,variant:`secondary`,onClick:_,children:i(B.BUTTON$CANCEL)}),(0,Z.jsx)(tt,{type:`button`,variant:`primary`,onClick:g,isDisabled:!y,children:i(B.BUTTON$LAUNCH)})]})]})})}function hi({onSuggestionsClick:e}){let{t}=h(`openhands`),{conversationId:n}=J(),[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),{addRecentRepository:c}=Vt(),l=Y(e=>e.enqueuePendingMessage),u=Y(e=>e.markPendingMessageError),{backend:d}=O(),f=d.kind===`local`,{providers:p}=Bt(),m=f||p.length>0,{data:g}=K(),{repositoryInfo:_}=$t(),{data:v}=di(),y=an(),b=Yn()?.isLoadingHistory??!1,x=(0,Q.useRef)(y);(0,Q.useEffect)(()=>{x.current=y},[y]);let{send:S}=Se(),w=(0,Q.useRef)(S);(0,Q.useEffect)(()=>{w.current=S},[S]);let T=je(),{mutate:E}=fi(),{mutate:D,isPending:k}=Pt(),ee=g?.selected_repository||_?.selectedRepository,A=g?.git_provider||_?.gitProvider,j=g?.selected_branch||_?.selectedBranch,M=ee||v?.repository||void 0,N=A||v?.provider,P=j||v?.branch||void 0,F=(g?.id?mt(g.id):null)?.selected_workspace??null,I=F&&F.replace(/\/+$/,``).split(`/`).pop()||null,L=!!M&&!!N,R=!!g&&y===`OPEN`&&!b;(0,Q.useEffect)(()=>{if(!a)return;let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[a]),(0,Q.useEffect)(()=>{if(!a)return;let e=e=>{e.key===`Escape`&&o(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let te=(e,r)=>{n&&(c(e),E({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(x.current!==`OPEN`){C(t(B.CONVERSATION$CLONE_COMMAND_FAILED_DISCONNECTED));return}let i=e.git_provider.charAt(0).toUpperCase()+e.git_provider.slice(1),a=`Clone ${e.full_name} from ${i} and checkout branch ${r.name}.`,o=n?l({conversationId:n,text:a}):null;T?.scrollDomToBottom(),Promise.resolve(w.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:t(B.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))})}}))},ne=!f||!!M||!!I,re=f&&!L;return ne||P||L?(0,Z.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[ne?(0,Z.jsx)(_n,{selectedRepository:M,gitProvider:N,workspaceName:I,onClick:()=>i(!0),disabled:!R||re}):null,P?(0,Z.jsx)(hn,{selectedBranch:P,selectedRepository:M,gitProvider:N}):null,L?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pi,{tooltipMessage:t(B.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!L,children:(0,Z.jsx)(Jr,{onSuggestionsClick:e,hasRepository:L,providerTokensReady:m,isConversationReady:R})}),(0,Z.jsx)(pi,{tooltipMessage:t(B.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!L,children:(0,Z.jsx)(Yr,{onSuggestionsClick:e,hasRepository:L,providerTokensReady:m,currentGitProvider:N,isConversationReady:R})}),(0,Z.jsx)(pi,{tooltipMessage:t(B.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!L,children:(0,Z.jsx)(Xr,{onSuggestionsClick:e,hasRepository:L,providerTokensReady:m,currentGitProvider:N,isConversationReady:R})})]}):null]}),(0,Z.jsx)(mi,{isOpen:r,onClose:()=>i(!1),onLaunch:te,defaultProvider:N})]}):null}function gi({onSubmit:e,disabled:t=!1,hasStartedConversation:n}){let{images:r,files:i,imagesMarkedUploadAsFile:a,clearAllFiles:o,subConversationTaskId:s}=U(),{curAgentState:c}=X(),{data:l}=K(),{conversationId:u}=zn(),d=u??l?.id??null,{taskStatus:f}=Zt(s,l?.id||null),{handleUpload:p}=gn(),m=ln(d,Ur(d,Br(d,t=>{let{imagesToEmbed:n,imagesAsFiles:s}=rn(r,a);e(t,n,[...i,...s]),o()})));return(0,Z.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,Z.jsx)(pn,{disabled:t||c===I.AWAITING_USER_CONFIRMATION||ne(f),isNewConversationPending:t,hasStartedConversation:n,onSubmit:m,onFilesPaste:p}),(0,Z.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,Z.jsx)(hi,{onSuggestionsClick:e=>{m(e)}})})]})}function _i(){let e=q(e=>e.events),t=q(e=>e.uiEvents),n=Q.useMemo(()=>t.filter(Un),[t]),r=Q.useMemo(()=>e,[e]),i=Q.useMemo(()=>n.length,[n]),a=Q.useMemo(()=>r.some(e=>e.source===`agent`&&!Ln(e)&&!Pn(e)),[r]),o=Zn(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var vi=e=>`timestamp`in e?e.timestamp:void 0,yi=e=>{let t=!!e&&ot(e),n=t?void 0:e,{data:r}=Ht(e??null),{data:i,isFetched:a}=Wn(n??void 0),o=q(e=>e.addEvents),[s,c]=Q.useState(!1),[l,u]=Q.useState(!0),d=Q.useRef(!1),f=Q.useRef(!0);return Q.useEffect(()=>{if(d.current=!1,c(!1),t){f.current=!1,u(!1);return}f.current=!0,u(!0)},[e,t]),Q.useEffect(()=>{t||!a||!i||i.hasMore||(f.current=!1,u(!1))},[t,a,i?.hasMore,n]),{isLoading:s,hasMore:l,loadOlder:Q.useCallback(async()=>{if(!e||ot(e)||d.current||!f.current||!r)return;let{events:t}=q.getState(),n=t[0];if(!n)return;let i=vi(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await Jn.searchEvents(e,r?.conversation_url??null,r?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`,timestampLt:i});if(!Array.isArray(t.items))throw Error(`Invalid older-events response: expected page.items to be an array.`);let n=[...t.items].reverse();n.length>0&&(o(n),Hn(e,q.getState().uiEvents)),(!t.next_page_id||t.items.length<50)&&(f.current=!1,u(!1))}finally{d.current=!1,c(!1)}},[e,r,r?.conversation_url,r?.session_api_key,o])}},bi={kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}},xi=new Set([`ExecuteBashAction`,`TerminalAction`,`FileEditorAction`,`StrReplaceEditorAction`,`MCPToolAction`,`InvokeSkillAction`,`TaskAction`,`ThinkAction`,`TaskTrackerAction`,`GrepAction`,`GlobAction`,`BrowserNavigateAction`,`BrowserClickAction`,`BrowserTypeAction`,`BrowserGetStateAction`,`BrowserGetContentAction`,`BrowserScrollAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserSwitchTabAction`,`BrowserCloseTabAction`]),Si=e=>{if(!qn(e))return null;let t=Ne(e);return t?{kind:`text`,text:t}:xi.has(e.action.kind)?Ae(e):null},Ci=e=>e.source===`environment`&&`rejection_reason`in e,wi=e=>{let t=new Set,n=new Set;for(let r=e.length-1;r>=0;--r){let i=e[r];if(!i.isFromPlanningAgent){if(tr(i)||Ci(i)){t.add(i.action_id),n.add(i.tool_call_id);continue}if(Tn(i)){n.add(i.tool_call_id);continue}if(Nn(i)){if(!(i.status===`pending`||i.status===`in_progress`)){n.add(i.tool_call_id);continue}if(n.has(i.tool_call_id))continue;let e=me(i);return e?{kind:`translation`,key:Me(i),values:{title:e}}:bi}if(qn(i)&&!t.has(i.id)&&!n.has(i.tool_call_id))return Si(i)??bi}}return bi};function Ti({events:e}){let t=wi(e);return(0,Z.jsxs)(`div`,{className:`flex min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface)] px-3 py-1.5 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`live-activity-chip`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 shrink-0 animate-pulse rounded-full bg-[var(--oh-status-success)] motion-reduce:animate-none`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t.kind===`text`?t.text:(0,Z.jsx)(S,{ns:`openhands`,i18nKey:t.key,values:t.values,components:{path:(0,Z.jsx)(be,{}),cmd:(0,Z.jsx)(ge,{})}})})]})}function Ei({suggestion:e,onClick:t}){let{t:n}=h(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,className:`list-none border border-[var(--oh-border)] rounded-[15px] hover:bg-surface-raised hover:border-[var(--oh-interactive-hover)] transition-colors flex-1 flex items-center justify-center cursor-pointer gap-[10px] h-[55px] px-4`,onClick:()=>t(e.value),children:[(0,Q.useMemo)(()=>{switch(e.label){case`INCREASE_TEST_COVERAGE`:return(0,Z.jsx)(xn,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,Z.jsx)(Kt,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,Z.jsx)(tn,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,Z.jsx)(Sn,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,Z.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function Di({suggestions:e,onSuggestionClick:t}){return(0,Z.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,Z.jsx)(Ei,{suggestion:e,onClick:t},n))})}var Oi=B.SUGGESTIONS$HACKER_NEWS,ki=`Please write a bash script which displays the top story on Hacker News. It should show the title, the link, and the number of points.
|
|
5
|
-
The script should only use tools that are widely available on unix systems, like curl and grep.`,Ai=B.SUGGESTIONS$HELLO_WORLD,ji=`I want to create a Hello World app in Javascript that:
|
|
6
|
-
* Displays Hello World in the middle.
|
|
7
|
-
* Has a button that when clicked, changes the greeting with a bouncing animation to fun versions of Hello.
|
|
8
|
-
* Has a counter for how many times the button has been clicked.
|
|
9
|
-
* Has another button that changes the app's background color.`,Mi=B.SUGGESTIONS$TODO_APP,Ni=`I want to create a VueJS app that allows me to:
|
|
10
|
-
* See all the items on my todo list
|
|
11
|
-
* add a new item to the list
|
|
12
|
-
* mark an item as done
|
|
13
|
-
* totally remove an item from the list
|
|
14
|
-
* change the text of an item
|
|
15
|
-
* set a due date on the item
|
|
16
|
-
|
|
17
|
-
This should be a client-only app with no backend. The list should persist in localStorage.`,Pi={repo:cn,"non-repo":{[Oi]:ki,[Ai]:ji,[Mi]:Ni}};function Fi({onSuggestionsClick:e}){let{t}=h(`openhands`),{shouldHideSuggestions:n}=U();return(0,Z.jsx)(s,{children:!n&&(0,Z.jsxs)(H.div,{"data-testid":`chat-suggestions`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:`easeInOut`},className:`pointer-events-auto absolute inset-x-4 bottom-[151px] top-0 flex flex-col items-center justify-center md:inset-x-8`,children:[(0,Z.jsx)(`div`,{className:`flex flex-col items-center p-4 rounded-xl w-full`,children:(0,Z.jsx)(`span`,{className:`pb-6 text-[32px] font-medium leading-5 text-white`,children:t(B.LANDING$TITLE)})}),(0,Z.jsx)(Di,{suggestions:Object.entries(Pi.repo).slice(0,4).map(([e,t])=>({label:e,value:t})),onSuggestionClick:e})]})})}var Ii={files:[],initialPrompt:null,selectedRepository:null,selectedRepositoryProvider:null,replayJson:null},Li=ct(e=>({...Ii,addFile:t=>e(e=>({files:[...e.files,t]})),removeFile:t=>e(e=>({files:e.files.filter((e,n)=>n!==t)})),clearFiles:()=>e(()=>({files:[]})),setInitialPrompt:t=>e(()=>({initialPrompt:t})),clearInitialPrompt:()=>e(()=>({initialPrompt:null})),setSelectedRepository:t=>e(()=>({selectedRepository:t})),clearSelectedRepository:()=>e(()=>({selectedRepository:null})),setSelectedRepositoryProvider:t=>e(()=>({selectedRepositoryProvider:t})),setReplayJson:t=>e(()=>({replayJson:t})),reset:()=>e(()=>Ii)})),Ri=e=>(0,Z.jsx)(`svg`,{width:12,height:17,viewBox:`0 0 12 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.5304 6.46978L10.4697 7.53044L6.75006 3.81077L6.75006 17.0001H5.25006L5.25006 3.81077L1.53039 7.53044L0.469727 6.46978L6.00006 0.939453L11.5304 6.46978Z`,fill:`currentColor`})});function zi({onClick:e}){return(0,Z.jsx)(`button`,{type:`button`,onClick:e,"data-testid":`scroll-to-bottom`,className:`flex items-center justify-center size-8 rounded-full bg-[var(--oh-surface)] text-[var(--oh-muted)] hover:bg-tertiary hover:text-white rotate-180 cursor-pointer transition-colors`,children:(0,Z.jsx)(Ri,{width:15,height:15})})}var Bi=[{width:`w-[25%]`,height:`h-4`,align:`justify-end`},{width:`w-[60%]`,height:`h-4`,align:`justify-start`},{width:`w-[45%]`,height:`h-4`,align:`justify-start`},{width:`w-[65%]`,height:`h-20`,align:`justify-start`},{width:`w-[35%]`,height:`h-4`,align:`justify-end`},{width:`w-[50%]`,height:`h-4`,align:`justify-start`},{width:`w-[30%]`,height:`h-4`,align:`justify-end`},{width:`w-[75%]`,height:`h-4`,align:`justify-start`},{width:`w-[55%]`,height:`h-4`,align:`justify-start`}];function Vi({width:e,height:t}){return(0,Z.jsx)(`div`,{className:z(`rounded-md bg-foreground/5 animate-pulse`,e,t)})}function Hi(){let{t:e}=h(`openhands`);return(0,Z.jsx)(`div`,{className:`flex flex-col gap-6 p-4 w-full h-full overflow-hidden`,"data-testid":`chat-messages-skeleton`,"aria-label":e(B.CHAT_INTERFACE$LOADING_CONVERSATION),children:Bi.map((e,t)=>(0,Z.jsx)(`div`,{className:z(`flex w-full`,e.align),children:(0,Z.jsx)(Vi,{width:e.width,height:e.height})},t))})}var Ui=220;function Wi({message:e,code:t,onDismiss:n,onRetry:r,onReauth:i}){let{t:a,i18n:o}=h(`openhands`),s=jr(t),[c,l]=Q.useState(!1),[u,d]=Q.useState(!1),[f,p]=Q.useState(!1),m=Q.useRef(null),g=o.exists(e,{ns:`openhands`}),v=g?String(a(e)):e,y=v.length>Ui,b=y&&!c;return Q.useEffect(()=>{if(!f)return;let e=setTimeout(()=>{p(!1)},2e3);return()=>clearTimeout(e)},[f]),Q.useEffect(()=>{p(!1)},[v]),Q.useLayoutEffect(()=>{let e=m.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){d(!1);return}d(e.getBoundingClientRect().height>t*1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[v,b,c,e]),(0,Z.jsxs)(`div`,{className:z(`flex w-full gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,u?`items-start`:`items-center`),"data-testid":`error-message-banner`,children:[(0,Z.jsx)(_,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:P},"data-testid":`error-message-banner-icon`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s&&(0,Z.jsx)(`div`,{className:`text-sm font-medium text-[var(--oh-foreground)]`,"data-testid":`error-message-banner-header`,children:a(s)}),(0,Z.jsx)(`div`,{ref:m,className:z(`whitespace-pre-wrap break-words text-sm text-[var(--oh-muted)]`,b&&`line-clamp-3`),"data-testid":`error-message-banner-content`,children:g?(0,Z.jsx)(S,{ns:`openhands`,i18nKey:e}):e}),i&&(0,Z.jsx)(`button`,{type:`button`,onClick:i,className:`mt-2 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":`error-message-banner-reauth`,children:a(B.ERROR$ACP_UPDATE_CREDENTIALS)}),y&&(0,Z.jsx)(`button`,{type:`button`,className:`mt-1 cursor-pointer text-xs font-normal text-[var(--oh-foreground)] underline`,onClick:()=>l(e=>!e),"data-testid":`error-message-banner-toggle`,children:a(c?B.COMMON$VIEW_LESS:B.COMMON$VIEW_MORE)})]}),(0,Z.jsxs)(`div`,{className:z(`flex shrink-0 gap-1`,u?`self-start`:`items-center`),children:[r&&(0,Z.jsx)(`button`,{type:`button`,onClick:r,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":`error-message-banner-retry`,children:a(B.CHAT_INTERFACE$MESSAGE_RETRY)}),(0,Z.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(v),p(!0)}catch{C(a(B.CHAT_INTERFACE$CHAT_MESSAGE_COPY_FAILED))}},className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":a(f?B.BUTTON$COPIED:B.BUTTON$COPY),"data-testid":`error-message-banner-copy`,children:f?(0,Z.jsx)(Pe,{className:`h-4 w-4`,"aria-hidden":!0}):(0,Z.jsx)(Ie,{className:`h-4 w-4`,"aria-hidden":!0})}),n&&(0,Z.jsx)(`button`,{type:`button`,onClick:n,className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":a(B.BUTTON$CLOSE),"data-testid":`error-message-banner-dismiss`,children:(0,Z.jsx)(Ke,{className:`h-4 w-4`,"aria-hidden":!0})})]})]})}var Gi={dismissedEventIds:{}},Ki=ct()(lt(e=>({...Gi,dismiss:t=>e(e=>({dismissedEventIds:{...e.dismissedEventIds,...Object.fromEntries(t.map(e=>[e,!0]))}}))}),{name:`SkillInstallBannerStore`})),qi=/^✅ Successfully installed '([^']+)' to (.+)$/m;function Ji(e){let t=new Map;for(let n of e){if(!On(n))continue;let e=n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
18
|
-
`).match(qi);if(!e)continue;let r=e[1],i=e[2].replace(/\\/g,`/`).replace(/\/+$/,``),a=`/.agents/skills/${r}`;if(!i.endsWith(a))continue;let o=i.slice(0,-a.length);if(!o)continue;let s=`${o}::${r}`;t.delete(s),t.set(s,{eventId:n.id,skillName:r,workspacePath:o})}return[...t.values()]}var Yi=e=>{let t=q(e=>e.events),n=q(e=>e.loadedConversationId),r=Ki(e=>e.dismissedEventIds),i=Ki(e=>e.dismiss),a=(0,Q.useMemo)(()=>!e||e!==n?[]:Ji(t).filter(e=>!r[e.eventId]),[e,n,t,r]);return{installs:a,dismissAll:(0,Q.useCallback)(()=>i(a.map(e=>e.eventId)),[i,a])}};function Xi({conversationId:e}){let{t}=h(`openhands`),{installs:n,dismissAll:r}=Yi(e),{backend:i}=O(),{mutate:a,isPending:o}=Pt(),s=x(),{navigate:c}=nt(),{data:l}=K();if(i.kind!==`local`||n.length===0)return null;let u=n[n.length-1],d=n.filter(e=>e.workspacePath===u.workspacePath).map(e=>e.skillName);return(0,Z.jsxs)(`div`,{className:`flex w-full items-start gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,"data-testid":`skill-install-restart-banner`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`p`,{className:`text-sm text-[var(--oh-foreground)]`,children:t(B.SKILLS$INSTALL_BANNER_MESSAGE,{skills:d.join(`, `)})}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>{o||s||a({workingDir:u.workspacePath,workspaceMode:`local_repo`,repository:l?.selected_repository&&l?.git_provider?{name:l.selected_repository,gitProvider:l.git_provider,branch:l.selected_branch??void 0}:void 0,entryPoint:`skill_install_restart_banner`},{onSuccess:e=>c(`/conversations/${e.conversation_id}`),onError:e=>C(e.message)})},disabled:o||s,className:`mt-2 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)] disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":`skill-install-restart-action`,children:t(B.SKILLS$INSTALL_BANNER_ACTION)})]}),(0,Z.jsx)(`button`,{type:`button`,onClick:r,className:`shrink-0 cursor-pointer rounded-md p-1 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-[var(--oh-foreground)]`,"aria-label":t(B.BUTTON$CLOSE),"data-testid":`skill-install-restart-dismiss`,children:(0,Z.jsx)(Ke,{className:`h-4 w-4`,"aria-hidden":!0})})]})}function Zi(){let{t:e}=h(`openhands`),{conversationId:t}=zn(),n=Y(e=>e.pendingMessages),r=Y(e=>e.markPendingMessageError),i=Y(e=>e.markPendingMessageSending),a=Y(e=>e.removePendingMessage),o=U(e=>e.restoreMessageToInputIfEmpty),{send:s}=Se(),c=Q.useMemo(()=>t?n.filter(e=>Xt(t,e.conversationId)):[],[n,t]),l=Q.useCallback(async t=>{let n=Y.getState().pendingMessages.find(e=>e.id===t);if(n){i(t);try{await s(ce(n.text,n.imageUrls,n.fileUrls,n.timestamp))}catch(n){r(t,n instanceof Error?n.message:e(B.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))}}},[s,r,i,e]),u=Q.useCallback((e,t)=>{o(t),a(e)},[o,a]),d=Q.useCallback(e=>{a(e)},[a]);return c.length===0?null:(0,Z.jsx)(Z.Fragment,{children:c.map(e=>(0,Z.jsx)(Ee,{type:`user`,message:e.text,pendingStatus:e.status,onRetry:e.status===`error`?()=>l(e.id):void 0,onDismiss:e.status===`error`?()=>d(e.id):void 0,onStop:e.status===`sending`?()=>u(e.id,e.text):void 0,children:e.imageUrls.length>0&&(0,Z.jsx)(ye,{size:`small`,images:e.imageUrls})},e.id))})}var Qi=()=>{let{data:e}=K();return y({mutationKey:[`unified-upload-files`],mutationFn:async t=>{let{conversationId:n,files:r}=t;return St(n,r,e)},meta:{disableToast:!0}})},$i=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 3.25C9.92893 3.25 8.25 4.92893 8.25 7V10H7C6.44772 10 6 10.4477 6 11V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V11C18 10.4477 17.5523 10 17 10H15.75V7C15.75 4.92893 14.0711 3.25 12 3.25ZM14.25 10V7C14.25 5.75736 13.2426 4.75 12 4.75C10.7574 4.75 9.75 5.75736 9.75 7V10H14.25Z`,fill:`currentColor`})});function ea(){let{t:e}=h(`openhands`),{data:t}=Xe();return t?.confirmation_mode?(0,Z.jsx)(rt,{closeDelay:100,content:e(B.COMMON$CONFIRMATION_MODE_ENABLED),tooltipClassName:`bg-white text-black hover:bg-transparent`,children:(0,Z.jsx)(`div`,{className:`flex items-center justify-center w-[26px] h-[26px] rounded-lg bg-[var(--oh-surface)]`,children:(0,Z.jsx)($i,{width:15,height:15})})}):null}var ta=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{d:`M15 12C15 12.7956 14.6839 13.5587 14.1213 14.1213C13.5587 14.6839 12.7956 15 12 15C11.2044 15 10.4413 14.6839 9.87868 14.1213C9.31607 13.5587 9 12.7956 9 12C9 11.2044 9.31607 10.4413 9.87868 9.87868C10.4413 9.31607 11.2044 9 12 9C12.7956 9 13.5587 9.31607 14.1213 9.87868C14.6839 10.4413 15 11.2044 15 12Z`,fill:`currentColor`})});function na({status:e,statusColor:t}){return(0,Z.jsx)(`div`,{"data-testid":`chat-status-indicator`,className:r(`w-full max-w-full rounded-[100px] p-1 bg-[var(--oh-surface)] flex items-center gap-1`),children:(0,Z.jsxs)(s,{mode:`wait`,children:[(0,Z.jsx)(H.span,{className:`flex-shrink-0 animate-[pulse_1.2s_ease-in-out_infinite]`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(0,Z.jsx)(ta,{className:`w-4 h-4`,color:t})},`dot-${e}`),(0,Z.jsx)(H.span,{initial:{opacity:0,y:-2},animate:{opacity:1,y:0},exit:{opacity:0,y:2},transition:{duration:.3},className:`pr-1.5 font-normal text-[11px] leading-[16px] normal-case break-words whitespace-normal`,children:e},`text-${e}`)]})})}var ra=()=>{let e=m(),{navigate:t}=nt(),{t:n}=h(`openhands`),{data:r}=K(),{trackConversationCreated:i}=Ye();return y({mutationFn:async()=>{if(!r?.id)throw Error(`No active conversation`);let e=await pt.createConversation({sandboxId:r.sandbox_id??void 0});if(e.status===`ERROR`)throw Error(e.detail||`Failed to create new conversation`);return{newConversationId:e.app_conversation_id?e.app_conversation_id:`task-${e.id}`,oldConversationId:r.id,taskId:e.id}},onMutate:()=>{v.loading(n(B.CONVERSATION$CLEARING),{...D,id:`clear-conversation`})},onSuccess:r=>{i({conversationId:r.newConversationId,taskId:r.taskId,hasRepository:!1,hasWorkspace:!1,hasInitialQuery:!1,hasParentConversation:!1,entryPoint:`new_command`}),v.dismiss(`clear-conversation`),E(n(B.CONVERSATION$CLEAR_SUCCESS)),t(`/conversations/${r.newConversationId}`),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]})},onError:e=>{v.dismiss(`clear-conversation`);let t=n(B.CONVERSATION$CLEAR_UNKNOWN_ERROR);e instanceof Error?t=e.message:typeof e==`string`&&(t=e),C(n(B.CONVERSATION$CLEAR_FAILED,{error:t}))}})};function ia(e,t){return e?`github`:t?`replay`:`direct`}function aa(){let{trackInitialQuerySubmitted:e,trackUserMessageSent:t}=Ye(),{setMessageToSend:n}=U(),{errorMessage:r,errorCode:i,removeErrorMessage:a,setErrorMessage:o}=$n(),s=f(),{isTask:c,taskStatus:l,taskDetail:u}=$t(),d=c,p=Yn(),{send:m}=Se(),{renderableEvents:g,allConversationEvents:_,totalEvents:v,hasSubstantiveAgentActions:y,userEventsExist:b}=_i(),x=Y(e=>e.enqueuePendingMessage),S=Y(e=>e.markPendingMessageError),w=Y(e=>e.pendingMessages),{t:T}=h(`openhands`),E=Q.useRef(null),{scrollDomToBottom:D,onChatBodyScroll:O,hitBottom:k,autoScroll:ee,setAutoScroll:A,setHitBottom:j}=he(E),{mutate:M,isPending:N}=ra(),{curAgentState:P}=X(),{handleBuildPlanClick:F}=xe(),{data:L}=K(),R=L?.sandbox_status??null,ne=bn(),{isConfigured:re,isLoading:ie}=vn(),ae=!ie&&!re,z=P===I.RUNNING||P===I.LOADING;Q.useEffect(()=>{if(z)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),F(e),D())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[z,F,D]);let{selectedRepository:se,replayJson:ue}=Li(),{conversationId:V}=zn(),fe=Bn(e=>{let t=V?e.statusByConversation[V]:void 0;return t?.active?`${t.iteration}:${t.status}`:null}),{mutateAsync:pe}=Qi(),{isLoading:me,hasMore:ge,loadOlder:_e}=yi(V),ve=Q.useRef(null),ye=Q.useCallback(e=>{if(d||me||!ge)return;let t=e.scrollTop<=80,n=e.scrollHeight<=e.clientHeight+80;!t&&!n||(ve.current={scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},_e().catch(e=>{ve.current=null,o(e instanceof Error&&e.message?e.message:T(B.ERROR$GENERIC))}))},[ge,me,d,_e,o,T]),be=Q.useCallback(e=>{e.deltaY<0&&e.currentTarget.scrollTop<=0&&ye(e.currentTarget)},[ye]),Ce=Q.useMemo(()=>V?w.some(e=>Xt(V,e.conversationId)):!1,[w,V]),we=Gn(e=>V?(e.entriesByConversation[V]?.length??0)>0:!1),Te=fn({isLoadingHistory:p?.isLoadingHistory===!0,hasUserEvents:b,hasPendingUserMessages:Ce,hasSubstantiveAgentActions:y,hasModelEntries:we}),Ee=_.length>0||Ce||!p?.isLoadingHistory,De=!!V,ke=!Ee&&!c,Ae=async(r,i,a)=>{if(r.trim()===`/new`){if(!V){C(T(B.CONVERSATION$CLEAR_NO_ID));return}if(v===0){C(T(B.CONVERSATION$CLEAR_EMPTY));return}if(N)return;M();return}let o=[...i],s=[...a];v===0?e({entryPoint:ia(se!==null,ue!==null),queryCharacterLength:r.length,replayJsonSize:ue?.length}):t({sessionMessageCount:v,currentMessageLength:r.length});let c=en([...o,...s]);if(!c.isValid){C(`Error: ${c.errorMessage}`);return}let l=o.map(e=>wn(e)),u=await Promise.all(l),d=new Date().toISOString(),{skipped_files:f,uploaded_files:p}=s.length>0?await pe({conversationId:V,files:s}):{skipped_files:[],uploaded_files:[]};f.forEach(e=>C(e.reason));let h=`${T(B.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE)}: ${p.join(`
|
|
19
|
-
|
|
20
|
-
`)}`,g=p.length>0?`${r}\n\n${h}`:r,_=x({conversationId:V,text:r,content:g,imageUrls:u,fileUrls:p,timestamp:d});D(),n(``);try{await m(ce(g,u,p,d))}catch(e){S(_,e instanceof Error?e.message:T(B.CHAT_INTERFACE$FAILED_TO_SEND_MESSAGE))}};Q.useEffect(()=>{if(ve.current&&E.current){let{scrollHeight:e,scrollTop:t}=ve.current,n=E.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),ve.current=null;return}ee&&D()},[g.length,Ce,fe,D]);let je=Q.useRef(ye);Q.useEffect(()=>{je.current=ye}),Q.useEffect(()=>{let e=E.current;e&&je.current(e)},[g.length,ge]);let Me={scrollRef:E,autoScroll:ee,setAutoScroll:A,scrollDomToBottom:D,hitBottom:k,setHitBottom:j,onChatBodyScroll:O},Ne=P===I.LOADING||P===I.INIT,Pe=P===I.STOPPED,Fe=P===I.PAUSED,H=oe({isPausing:Fe,isTask:c,taskStatus:l,isStartingStatus:Ne,isStopStatus:Pe,curAgentState:P}),Ie=te({isPausing:Fe,isTask:c,taskStatus:l,taskDetail:u,isStartingStatus:Ne,isStopStatus:Pe,curAgentState:P,errorMessage:r,t:T});return(0,Z.jsx)(le,{value:Me,children:(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!y&&!Ce&&!b&&!we&&!ke&&!d&&v===0&&!ne&&!ae&&(0,Z.jsx)(Fi,{onSuggestionsClick:e=>n(e)}),(0,Z.jsxs)(`div`,{ref:E,"data-testid":`chat-scroll-container`,onScroll:e=>{O(e.currentTarget),ye(e.currentTarget)},onWheel:be,className:`custom-scrollbar-always flex min-h-0 grow flex-col gap-2 overflow-x-hidden overflow-y-auto px-0 pt-4 pb-8 md:px-4`,children:[ke&&De&&(0,Z.jsx)(Hi,{}),ke&&!De&&(0,Z.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,Z.jsx)(Je,{size:`small`})}),me&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,Z.jsx)(Je,{size:`small`}),(0,Z.jsx)(`span`,{children:T(B.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,Z.jsx)(de,{conversationId:V,anchorEventId:null}),Ee&&g.length>0&&(0,Z.jsx)(Oe,{messages:g,allEvents:_}),(0,Z.jsx)(Zi,{}),(0,Z.jsx)(Rr,{conversationId:V})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px] pb-4`,children:[(0,Z.jsx)(Xi,{conversationId:V}),(0,Z.jsx)(Lr,{conversationId:V}),r&&(0,Z.jsx)(Wi,{message:r,code:i,onDismiss:a,onRetry:r===`Unable to connect to server`?()=>p?.reconnect():void 0,onReauth:Mr(i)?()=>s(`/settings/agents`):void 0}),ae&&!ne&&(0,Z.jsx)(yn,{}),ne?(0,Z.jsxs)(`div`,{"data-testid":`archived-conversation-banner`,className:`mx-1 px-4 py-3 rounded-lg bg-[var(--oh-surface)] border border-[var(--oh-border-subtle)]`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:T(R===`ERROR`?B.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:B.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,Z.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:T(R===`ERROR`?B.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:B.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,Z.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,Z.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,Z.jsx)(ea,{}),Ne&&(0,Z.jsx)(na,{statusColor:H,status:Ie})]}),k?P===I.RUNNING&&(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-9 bottom-0 flex justify-center`,children:(0,Z.jsx)(Ti,{events:_})}):(0,Z.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,Z.jsx)(zi,{onClick:D})})]})}),(0,Z.jsx)(gi,{onSubmit:Ae,disabled:N||ae,hasStartedConversation:Te})]})]})]})})}function oa({isRightPanelShown:e}){return(0,Z.jsx)(`div`,{className:`flex justify-center w-full h-full`,children:(0,Z.jsx)(`div`,{className:`w-full min-w-0 max-w-[800px] h-full flex flex-col min-h-0 transition-all duration-300 ease-in-out`,children:(0,Z.jsx)(aa,{})})})}function sa({children:e}){return(0,Z.jsx)(`div`,{className:`absolute inset-0`,children:e})}function ca({children:e}){return(0,Z.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function la({children:e}){return(0,Z.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function ua({className:e}){let{t}=h(`openhands`);return(0,Z.jsxs)(`div`,{className:z(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,Z.jsx)(Ge,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,Z.jsx)(we,{as:`p`,role:`status`,"aria-live":`polite`,className:`block w-full text-center text-base font-normal leading-5`,duration:1,spread:2,children:t(B.HOME$LOADING)})]})}function da({children:e,onReady:t}){return(0,Q.useLayoutEffect)(()=>{t()},[t]),e}function fa({onPending:e}){return(0,Q.useLayoutEffect)(()=>{e()},[e]),(0,Z.jsx)(ua,{})}var pa={duration:.35,ease:`easeInOut`};function ma({showAgentLoading:e,tabKey:t,children:n}){let r=fe(),[i,a]=(0,Q.useState)(!1);(0,Q.useLayoutEffect)(()=>{a(!1)},[t]);let o=(0,Q.useCallback)(()=>{a(!0)},[]),c=(0,Q.useCallback)(()=>{a(!1)},[]),l=e||i;return r?(0,Z.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:l?(0,Z.jsx)(ua,{}):(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(fa,{onPending:o}),children:(0,Z.jsx)(da,{onReady:c,children:n})})}):(0,Z.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,Z.jsx)(H.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!l},transition:pa,"aria-hidden":l,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(fa,{onPending:o}),children:(0,Z.jsx)(da,{onReady:c,children:n})})}),(0,Z.jsx)(s,{children:l?(0,Z.jsx)(H.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:pa,children:(0,Z.jsx)(ua,{})},`conversation-tab-loading-overlay`):null})]})}var ha=(0,Q.lazy)(()=>c(()=>import(`./files-tab-DV0L-lFE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]))),ga=(0,Q.lazy)(()=>c(()=>import(`./browser-tab-zAY12m_i.js`),__vite__mapDeps([98,2,1,11,5,6,17,3,4,7,14,10,15,12,18,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,99,100,93]))),_a=(0,Q.lazy)(()=>c(()=>import(`./planner-tab-AKaXIIfg.js`),__vite__mapDeps([101,1,2,11,5,6,13,3,4,7,14,15,16,17,10,12,18,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,102,53,54,51,55,56,57,58,59,60,61,62,63,64,65,66,50,52,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93]))),va=(0,Q.lazy)(()=>c(()=>import(`./task-list-tab-mAHMOkUz.js`),__vite__mapDeps([103,1,2,11,5,6,13,3,4,7,14,15,16,17,10,12,18,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,93]))),ya=(0,Q.lazy)(()=>c(()=>import(`./usage-tab-tEmVN0KD.js`),__vite__mapDeps([104,1,2,3,4,5,6,7,54,11,12,17,14,10,15,18,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,60,46,61,62,105,37,65,53,51,55,56,57,58,36,59,63,64,66,50,52,41,67,39,68,69,47,70,71,72,73,45,74,75,76,77,78,40,79,80,81,82,83,84,85,86,87,88,89,43,90,48,91,92,93]))),ba=(0,Q.lazy)(()=>c(()=>import(`./terminal-BzxBaHx2.js`),__vite__mapDeps([106,1,2,11,5,6,107,108,17,3,4,7,14,10,15,12,18,9,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,53,54,51,55,46,56,57,58,36,59,60,61,62,63,37,64,65,66,50,52,41,67,39,68,69,47,70,71,72,73,45,74,75,76,77,78,40,79,80,81,82,83,84,85,86,87,88,89,43,90,48,91,92,93]))),xa={tasklist:{component:va},files:{component:ha},browser:{component:ga},terminal:{component:ba},planner:{component:_a},usage:{component:ya}};function Sa(){let{selectedTab:e,shouldShownAgentLoading:t}=U(),{conversationId:n}=J(),r=(0,Q.useMemo)(()=>xa[e]??xa.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,Z.jsx)(ca,{children:(0,Z.jsx)(la,{children:(0,Z.jsx)(ma,{showAgentLoading:t,tabKey:i,children:(0,Z.jsx)(sa,{children:(0,Z.jsx)(r,{})},i)})})})}var Ca=()=>{let e=m(),t=$n(e=>e.removeErrorMessage);return y({mutationKey:[`start-conversation`],mutationFn:async e=>vt(e.conversationId),onMutate:async()=>(await e.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:e.getQueryData([`user`,`conversations`])}),onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{bt(e,r.conversationId)},onSuccess:(n,r)=>{t(),yt(e,r.conversationId,ee.RUNNING)}})},wa=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM10 9H14A1 1 0 0 1 15 10V14A1 1 0 0 1 14 15H10A1 1 0 0 1 9 14V10A1 1 0 0 1 10 9Z`,fill:`currentColor`})}),Ta=e=>(0,Z.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.9 1.50004C15.3 1.65004 17.55 2.85004 19.2 4.50004C21.15 6.60004 22.2 9.15004 22.2 12.15C22.2 14.55 21.3 16.8 19.8 18.75C18.3 20.55 16.2 21.9 13.8 22.35C11.4 22.8 9 22.5 6.9 21.3C4.8 20.1 3.15 18.3 2.25 16.05C1.35 13.8 1.2 11.25 1.95 9.00004C2.7 6.60004 4.05 4.65004 6.15 3.30004C8.1 1.95004 10.5 1.35004 12.9 1.50004ZM13.65 20.85C15.6 20.4 17.4 19.35 18.75 17.7C19.95 16.05 20.7 14.1 20.55 12C20.55 9.60004 19.65 7.20004 18 5.55004C16.5 4.05004 14.7 3.15004 12.6 3.00004C10.65 2.85004 8.55 3.30004 6.9 4.50004C5.25 5.70004 4.05 7.35004 3.45 9.45004C2.85 11.4 2.85 13.5 3.75 15.45C4.65 17.4 6 18.9 7.8 19.95C9.6 21 11.7 21.3 13.65 20.85Z`,fill:`currentColor`}),(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 7.49998L10.1655 6.87598L16.9155 11.376V12.624L10.1655 17.124L9 16.5V7.49998ZM10.5 8.90098V15.099L15.1485 12L10.5 8.90098Z`,fill:`currentColor`})]});function Ea({icon:e,text:t,onClick:n,testId:r}){return(0,Z.jsx)(W,{testId:r,onClick:n,children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:at,"aria-hidden":!0,children:e})]})})}function Da({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=X(),{isTask:i,taskStatus:a,taskDetail:o}=$t(),{t:s}=h(`openhands`),{errorMessage:c}=$n(),l=r===I.LOADING||r===I.INIT,u=se(t)||F(t),d=oe({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=te({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,Z.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(ta,{className:`w-6 h-6 shrink-0`,color:d}),(0,Z.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function Oa({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1,ignoreOutsideClickRef:s}){let{t:c}=h(`openhands`),l=Nt(e,s),u=L(r),d=F(r),f=u||d;return(0,Z.jsxs)(Ft,{ref:l,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:z(`left-2 w-fit min-w-42`,a),children:[(0,Z.jsx)(Da,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(He,{inset:`menu`}),u&&t&&(0,Z.jsx)(Ea,{icon:(0,Z.jsx)(wa,{width:18,height:18}),text:c(B.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),d&&n&&(0,Z.jsx)(Ea,{icon:(0,Z.jsx)(Ta,{width:18,height:18}),text:c(B.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}var ka=e(i(),1);function Aa({isPublic:e,onToggle:t,ariaLabel:n}){return(0,Z.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,Z.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:z(`inline-flex h-3.5 w-7 items-center rounded-full px-0.5 py-px transition-colors duration-200 ease-in-out`,e?`bg-white`:`bg-base-secondary`),children:(0,Z.jsx)(`span`,{className:z(`block h-2 w-2 shrink-0 rounded-full transition-transform duration-200 ease-in-out`,e?`translate-x-[calc(1rem-1px)] bg-base-secondary`:`translate-x-px bg-tertiary-light`)})})]})}function ja({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onExportTranscript:u,onDownloadConversation:d,shareUrl:f,position:p=`bottom`,anchorRef:m}){let g=ir(),{t:_}=h(`openhands`),{backend:v}=O(),{data:y}=K(),b=bn(),x=Nt(e,m),S=m?.current??null,[C,w]=Q.useState();Q.useLayoutEffect(()=>{if(!S)return;let e=()=>{let e=S.getBoundingClientRect();if(!e)return;let t={position:`fixed`,zIndex:9999};p===`top`?t.bottom=window.innerHeight-e.top+8:t.top=e.bottom+8,t.left=e.left,w(t)};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[S,p]);let T=!!(a||o||s),E=!!i,D=!!(r||n),k=v.kind===`cloud`?B.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:B.COMMON$STOP_CONVERSATION,ee=v.kind===`cloud`&&!!c,A=y?.public||!1,j=!!S,M=(0,Z.jsxs)(Ft,{ref:x,testId:`conversation-name-context-menu`,position:p,alignment:`left`,className:z(g?`right-0 translate-x-[34%] left-auto`:``,j?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,Z.jsx)(W,{testId:`rename-button`,onClick:t,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Rt,{width:16,height:16}),text:_(B.BUTTON$RENAME)})}),T&&(0,Z.jsx)(He,{testId:`separator-tools`,inset:`menu`}),o&&(0,Z.jsx)(Cn,{isDisabled:b,children:(0,Z.jsx)(W,{testId:`show-skills-button`,onClick:o,isDisabled:b,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(zt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:_(B.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,Z.jsx)(Cn,{isDisabled:b,children:(0,Z.jsx)(W,{testId:`show-hooks-button`,onClick:s,isDisabled:b,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Qt,{width:16,height:16,"aria-hidden":!0}),text:_(B.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,Z.jsx)(Cn,{isDisabled:b,children:(0,Z.jsx)(W,{testId:`show-agent-tools-button`,onClick:a,isDisabled:b,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Ve,{width:16,height:16}),text:_(B.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,Z.jsx)(W,{testId:`export-transcript-button`,onClick:u,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(At,{width:16,height:16}),text:_(B.BUTTON$EXPORT_TRANSCRIPT)})}),d&&(0,Z.jsx)(W,{testId:`download-trajectory-button`,onClick:d,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(At,{width:16,height:16}),text:_(B.BUTTON$DOWNLOAD_CONVERSATION_DATA)})}),(E||D)&&(0,Z.jsx)(He,{testId:`separator-info-control`,inset:`menu`}),i&&(0,Z.jsx)(W,{testId:`display-cost-button`,onClick:i,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Be,{size:16}),text:_(B.BUTTON$DISPLAY_COST)})}),ee&&c&&(0,Z.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,Z.jsx)(ar,{size:16})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:_(B.CONVERSATION$SHARE_PUBLICLY)}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[A&&f&&l&&(0,Z.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`copy-share-link-button`,onClick:l,className:`rounded p-0.5 text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:_(B.BUTTON$COPY_TO_CLIPBOARD),children:(0,Z.jsx)(Ut,{width:14,height:14})}),(0,Z.jsx)(`a`,{"data-testid":`open-share-link-button`,href:f,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded p-0.5 text-[var(--oh-muted)] no-underline visited:text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-selected)] hover:text-[var(--oh-foreground)] cursor-pointer [&_svg]:text-current`,title:_(B.BUTTON$OPEN_IN_NEW_TAB),children:(0,Z.jsx)(Le,{size:14,"aria-hidden":!0})})]}),(0,Z.jsx)(Aa,{isPublic:A,onToggle:c,ariaLabel:_(B.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,Z.jsx)(Cn,{isDisabled:b,children:(0,Z.jsx)(W,{testId:`stop-button`,onClick:r,isDisabled:b,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(Re,{width:16,height:16}),text:_(k)})})}),n&&(0,Z.jsx)(W,{testId:`delete-button`,onClick:n,children:(0,Z.jsx)(G,{icon:(0,Z.jsx)(It,{width:16,height:16}),text:_(B.COMMON$DELETE_CONVERSATION)})})]});return j?typeof document>`u`||!C?null:ka.createPortal((0,Z.jsx)(`div`,{style:C,children:M}),document.body):M}var Ma=new Set([`BrowserClickAction`,`BrowserCloseTabAction`,`BrowserGetContentAction`,`BrowserGetStateAction`,`BrowserGoBackAction`,`BrowserListTabsAction`,`BrowserNavigateAction`,`BrowserScrollAction`,`BrowserSwitchTabAction`,`BrowserTypeAction`,`ExecuteBashAction`,`FileEditorAction`,`GlobAction`,`GrepAction`,`InvokeSkillAction`,`MCPToolAction`,`StrReplaceEditorAction`,`TaskAction`,`TaskTrackerAction`,`TerminalAction`,`ThinkAction`]),Na=new Set([`BrowserObservation`,`CanvasUIObservation`,`ExecuteBashObservation`,`FileEditorObservation`,`GlobObservation`,`GrepObservation`,`InvokeSkillObservation`,`MCPToolObservation`,`StrReplaceEditorObservation`,`SwitchLLMObservation`,`TaskTrackerObservation`,`TaskObservation`,`TerminalObservation`]),Pa=e=>e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim(),Fa=(e,t=100)=>e.length>t?`${e.slice(0,t)}…`:e,Ia=e=>{let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString()},$=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`).replaceAll(`'`,`'`),La=e=>e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replace(/(!?)\[([^\]]*)\]\(\s*((?:javascript|data|vbscript):[^)]*)\)/gi,`$1\\[$2\\]($3)`).replace(/^(\s{0,3})\[([^\]]+)\]:(\s*<?(?:javascript|data|vbscript):)/gim,`$1\\[$2\\]:$3`),Ra=e=>Pa(e||w.t(B.TRANSCRIPT_EXPORT$DEFAULT_TITLE))||w.t(B.TRANSCRIPT_EXPORT$DEFAULT_TITLE),za=(e,t)=>Pa(w.t(e,t).replace(/<\/?(?:cmd|path)>/g,``)),Ba=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Va=e=>e.replace(/(?:Action|Observation)$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).trim(),Ha=e=>{let t=Pa(e.summary||``);return t&&!Ba(t)?t:Pa(e.tool_name)||Va(e.action.kind)},Ua=(e,t)=>t?Ha(t):Pa(e.tool_name)||Va(e.observation.kind),Wa=e=>e.filter(e=>e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
|
|
21
|
-
`),Ga=e=>[`${w.t(B.TASK$SUBAGENT)}: ${e.subagent_type}`,`${w.t(B.TASK$QUERY)}:\n${e.prompt}`].join(`
|
|
22
|
-
|
|
23
|
-
`),Ka=(e,t)=>{let n=t?.action.kind===`TaskAction`?t.action:void 0;return[`${w.t(B.TASK$SUBAGENT)}: ${e.subagent}`,`${w.t(B.TASK$TASK_ID)}: ${e.task_id}`,n?`${w.t(B.TASK$QUERY)}:\n${n.prompt}`:``,`${w.t(B.TASK$RESULT)}:\n${Wa(e.content)}`].filter(Boolean).join(`
|
|
24
|
-
|
|
25
|
-
`)},qa=e=>e.action.kind===`TaskAction`?Ga(e.action):Ma.has(e.action.kind)?ve(e):``,Ja=(e,t)=>e.observation.kind===`TaskObservation`?Ka(e.observation,t):Na.has(e.observation.kind)?De(e):``,Ya=e=>Mn(e)?[e.reason,e.error,e.stdout,e.stderr].filter(e=>!!e?.trim()).join(`
|
|
26
|
-
|
|
27
|
-
`):``,Xa=e=>[In(e),Qn(e)].map(e=>e.trim()).filter(Boolean).join(`
|
|
28
|
-
|
|
29
|
-
`),Za=e=>![`FinishAction`,`SwitchLLMAction`,`ThinkAction`].includes(e.action.kind),Qa=(e,t)=>{let n=e.reduce((e,t)=>{try{return En(t,e)}catch{return e}},[]),r=new Map(e.filter(qn).map(e=>[e.id,e])),i=[],a=new Set,o=Te(n.filter(e=>kn(e)&&!e.observation.is_error||Un(e)),2**53-1,e),s=e=>{if(a.has(e.id)||!Za(e))return;a.add(e.id);let t=Xa(e);t&&i.push({kind:`message`,author:`assistant`,content:t,timestamp:e.timestamp})};for(let e of o){if(e.kind===`group`)continue;if(e.kind===`thought`){s(e.action);continue}let{event:n}=e;try{let e=qn(n)?n:tr(n)?r.get(n.action_id):void 0;if(e&&s(e),kn(n)&&!n.observation.is_error){i.push({kind:`note`,summary:za(B.MODEL$SWITCHED_TO_PROFILE,{name:n.observation.profile_name}),content:[n.observation.active_model?`${w.t(B.TRANSCRIPT_EXPORT$MODEL)}: ${n.observation.active_model}`:``,n.observation.reason?`${w.t(B.TRANSCRIPT_EXPORT$REASON)}: ${n.observation.reason}`:``].filter(Boolean).join(`
|
|
30
|
-
`),timestamp:n.timestamp??``});continue}if(Fn(n)){let e=ke(n).trim();if(n.source===`agent`){let{reasoning:t,message:r}=Dn(e);[t,r].filter(Boolean).forEach(e=>{i.push({kind:`message`,author:`assistant`,content:e,timestamp:n.timestamp??``})})}else e&&i.push({kind:`message`,author:`user`,content:e,timestamp:n.timestamp??``});continue}if(Rn(n)){let{reasoning:e,message:t}=Dn(n.content??``,{streaming:!0}),r=[n.reasoning_content?.trim()||``,e].filter(Boolean).join(`
|
|
31
|
-
|
|
32
|
-
`);r&&i.push({kind:`message`,author:`assistant`,content:r,timestamp:n.timestamp??``}),t.trim()&&i.push({kind:`message`,author:`assistant`,content:t.trim(),timestamp:n.timestamp??``});continue}if(Tn(n)){i.push({kind:`error`,content:n.error,timestamp:n.timestamp??``});continue}if(qn(n)){if(n.action.kind===`FinishAction`){let e=n.action.message.trim();e&&i.push({kind:`message`,author:`assistant`,content:e,timestamp:n.timestamp??``})}else i.push({kind:`tool`,summary:Ha(n),details:t?qa(n):``,timestamp:n.timestamp??``});continue}if(tr(n)){let e=r.get(n.action_id);i.push({kind:`tool`,summary:Ua(n,e),details:t?Ja(n,e):``,timestamp:n.timestamp??``});continue}if(Nn(n)){i.push({kind:`tool`,summary:me(n)||w.t(B.ACTION_MESSAGE$ACP_TOOL),details:t?_e(n):``,timestamp:n.timestamp??``});continue}if(Mn(n)){i.push({kind:`tool`,summary:w.t(B.TRANSCRIPT_EXPORT$HOOK,{command:Fa(Pa(n.hook_command),100)}),details:t?Ya(n):``,timestamp:n.timestamp??``});continue}Pn(n)&&An(n)&&i.push({kind:`note`,summary:`${w.t(B.GOAL$PREFIX)} ${w.t({running:B.GOAL$STATUS_RUNNING,complete:B.GOAL$STATUS_COMPLETE,capped:B.GOAL$STATUS_CAPPED,interrupted:B.GOAL$STATUS_INTERRUPTED}[n.value.status])}`,content:[n.value.objective,n.value.verdict?.missing||``].filter(Boolean).join(`
|
|
33
|
-
|
|
34
|
-
`),timestamp:n.timestamp??``})}catch{}}return i},$a=(e,t)=>t.includeTimestamps?`<sub>${$(Ia(e.timestamp))}</sub>\n\n`:``,eo=e=>{let t=Math.max(0,...Array.from(e.matchAll(/`+/g),e=>e[0].length)),n="`".repeat(Math.max(3,t+1));return`${n}text\n${e}\n${n}`},to=(e,t)=>{let n=[`# ${La(Ra(t.title))}`,``];t.model&&n.push(`**${w.t(B.TRANSCRIPT_EXPORT$MODEL)}:** ${La(Pa(t.model))}`,``);for(let r of Qa(e,t.includeToolDetails)){let e=$a(r,t);if(r.kind===`message`){let t=r.author===`user`?w.t(B.TRANSCRIPT_EXPORT$USER):w.t(B.CHAT_INTERFACE$ASSISTANT);n.push(`## ${t}`,``,e+La(r.content),``)}else if(r.kind===`error`){let t=r.content.split(`
|
|
35
|
-
`).map(e=>`> ${La(e)}`).join(`
|
|
36
|
-
`);n.push(`## ${w.t(B.COMMON$ERROR)}`,``,e+t,``)}else if(r.kind===`note`)n.push(`> **${$(r.summary)}**`,``,e+La(r.content),``);else if(t.includeToolDetails&&r.details)n.push(`<details>`,`<summary><strong>${$(w.t(B.TRANSCRIPT_EXPORT$TOOL))}:</strong> ${$(r.summary)}</summary>`,``,e+eo(r.details),``,`</details>`,``);else{let t=e?`<br>${e.trimEnd()}`:``;n.push(`<p><strong>${$(w.t(B.TRANSCRIPT_EXPORT$TOOL))}:</strong> ${$(r.summary)}${t}</p>`,``)}}return`${n.join(`
|
|
37
|
-
`).trim()}\n`},no=(e,t)=>{if(!t.includeTimestamps)return``;let n=Ia(e.timestamp);return`<time datetime="${$(n)}">${$(n)}</time>`},ro=(e,t)=>{let n=Ra(t.title),r=Qa(e,t.includeToolDetails).map(e=>{let n=no(e,t);if(e.kind===`message`){let t=e.author===`user`?w.t(B.TRANSCRIPT_EXPORT$USER):w.t(B.CHAT_INTERFACE$ASSISTANT);return`<section class="message ${e.author.toLowerCase()}">
|
|
38
|
-
<header><h2>${$(t)}</h2>${n}</header>
|
|
39
|
-
<div class="content">${$(e.content)}</div>
|
|
40
|
-
</section>`}return e.kind===`error`?`<section class="message error">
|
|
41
|
-
<header><h2>${$(w.t(B.COMMON$ERROR))}</h2>${n}</header>
|
|
42
|
-
<div class="content">${$(e.content)}</div>
|
|
43
|
-
</section>`:e.kind===`note`?`<aside class="note">
|
|
44
|
-
<header><strong>${$(e.summary)}</strong>${n}</header>
|
|
45
|
-
${e.content?`<div class="content">${$(e.content)}</div>`:``}
|
|
46
|
-
</aside>`:t.includeToolDetails&&e.details?`<details>
|
|
47
|
-
<summary><strong>${$(w.t(B.TRANSCRIPT_EXPORT$TOOL))}:</strong> ${$(e.summary)}${n}</summary>
|
|
48
|
-
<pre>${$(e.details)}</pre>
|
|
49
|
-
</details>`:`<div class="tool-summary"><strong>${$(w.t(B.TRANSCRIPT_EXPORT$TOOL))}:</strong> ${$(e.summary)}${n}</div>`}).join(`
|
|
50
|
-
`),i=t.model?`<p class="model"><strong>${$(w.t(B.TRANSCRIPT_EXPORT$MODEL))}:</strong> ${$(Pa(t.model))}</p>`:``;return`<!doctype html>
|
|
51
|
-
<html lang="${$(w.resolvedLanguage||w.language||`en`)}">
|
|
52
|
-
<head>
|
|
53
|
-
<meta charset="utf-8">
|
|
54
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
55
|
-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">
|
|
56
|
-
<title>${$(n)}</title>
|
|
57
|
-
<style>
|
|
58
|
-
:root { color-scheme: light dark; font-family: ui-sans-serif, system-ui, sans-serif; }
|
|
59
|
-
body { margin: 0; background: #111827; color: #e5e7eb; line-height: 1.55; }
|
|
60
|
-
main { box-sizing: border-box; width: min(860px, 100%); margin: 0 auto; padding: 48px 24px 80px; }
|
|
61
|
-
h1 { margin: 0; font-size: 2rem; }
|
|
62
|
-
h2 { margin: 0; font-size: 1rem; }
|
|
63
|
-
.model { margin: 8px 0 32px; color: #9ca3af; }
|
|
64
|
-
.message, details, .tool-summary, .note { margin: 16px 0; border: 1px solid #374151; border-radius: 10px; padding: 16px; background: #1f2937; }
|
|
65
|
-
.user { border-left: 4px solid #60a5fa; }
|
|
66
|
-
.assistant { border-left: 4px solid #34d399; }
|
|
67
|
-
.error { border-left: 4px solid #f87171; }
|
|
68
|
-
.note { border-left: 4px solid #a78bfa; }
|
|
69
|
-
header, summary, .tool-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
|
|
70
|
-
summary { cursor: pointer; }
|
|
71
|
-
time { flex: none; color: #9ca3af; font-size: .75rem; font-weight: 400; }
|
|
72
|
-
.content { margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
73
|
-
pre { margin: 14px 0 0; padding: 14px; overflow-x: auto; border-radius: 7px; background: #111827; color: #d1d5db; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
74
|
-
@media (prefers-color-scheme: light) {
|
|
75
|
-
body { background: #f9fafb; color: #111827; }
|
|
76
|
-
.message, details, .tool-summary, .note { border-color: #d1d5db; background: #fff; }
|
|
77
|
-
pre { background: #f3f4f6; color: #1f2937; }
|
|
78
|
-
.model, time { color: #6b7280; }
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
81
|
-
</head>
|
|
82
|
-
<body>
|
|
83
|
-
<main>
|
|
84
|
-
<h1>${$(n)}</h1>
|
|
85
|
-
${i}
|
|
86
|
-
${r}
|
|
87
|
-
</main>
|
|
88
|
-
</body>
|
|
89
|
-
</html>
|
|
90
|
-
`},io=(e,t)=>(e.timestamp??``).localeCompare(t.timestamp??``),ao=async(e,t,n)=>{let r=[],i=new Set,a=new Set,o,s,c=!1,l=!1;for(;;){let e=await t({limit:100,sortOrder:`TIMESTAMP_DESC`,strictPagination:!0,...s?{pageId:s}:{},...o?{timestampLt:o}:{}});if(!Array.isArray(e.items))throw Error(`Invalid transcript history response: expected page.items to be an array.`);r.push(...e.items);let u,d=!1;if(e.items.forEach(e=>{i.has(e.id??``)||(e.id&&i.add(e.id),d=!0),(!u||(e.timestamp??``)<u)&&(u=e.timestamp??``)}),e.next_page_id){if(a.has(e.next_page_id))throw Error(`Transcript history pagination repeated a page cursor.`);a.add(e.next_page_id),s=e.next_page_id,o=void 0,c=!0;continue}if(c&&!l||e.items.length<100)break;if(n===void 0)throw Error(`Transcript history pagination cannot prove that all events were loaded.`);if(!u||o&&(!d||u>=o))throw Error(`Transcript history pagination did not advance.`);s=void 0,o=u,l=!0}let u=new Map;r.slice().reverse().forEach(e=>{u.has(e.id??``)||e.id&&u.set(e.id,e)}),e.forEach(e=>{u.has(e.id??``)||e.id&&u.set(e.id,e)});let d=[...u.values()].sort(io);if(n!==void 0&&i.size<n)throw Error(`Transcript history is incomplete: expected ${n} persisted events, received ${i.size}.`);return d},oo=`transcript-export-format`;function so({conversationId:e,conversationUrl:t,sessionApiKey:n,conversationTitle:r,model:i,onClose:a}){let{t:o}=h(`openhands`),{trackConversationExported:s}=Ye(),[c,l]=Q.useState(`markdown`),[u,d]=Q.useState(!0),[f,p]=Q.useState(!0),[m,g]=Q.useState(!1),_=Q.useRef(!1),v=Q.useRef(!1),y=Q.useRef(!0);Q.useEffect(()=>(y.current=!0,()=>{y.current=!1,v.current=!0}),[]);let b=()=>{_.current&&(v.current=!0),a()};return(0,Z.jsx)(Ze,{onClose:b,"aria-label":o(B.TRANSCRIPT_EXPORT$TITLE),children:(0,Z.jsxs)(Qe,{testID:`transcript-export-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,Z.jsx)(ut,{onClose:b,testId:`close-transcript-export-modal`,className:`absolute right-4 top-4`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pr-8`,children:[(0,Z.jsx)(et,{title:o(B.TRANSCRIPT_EXPORT$TITLE)}),(0,Z.jsx)($e,{description:o(B.TRANSCRIPT_EXPORT$DESCRIPTION)})]}),(0,Z.jsxs)(`fieldset`,{className:`flex w-full flex-col gap-2`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 text-sm font-medium text-white`,children:o(B.TRANSCRIPT_EXPORT$FORMAT)}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:oo,value:`markdown`,disabled:m,checked:c===`markdown`,onChange:()=>l(`markdown`)}),o(B.TRANSCRIPT_EXPORT$MARKDOWN)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 rounded-md border border-[var(--oh-border)] px-3 py-2 text-sm text-white`,children:[(0,Z.jsx)(`input`,{type:`radio`,name:oo,value:`html`,disabled:m,checked:c===`html`,onChange:()=>l(`html`)}),o(B.TRANSCRIPT_EXPORT$HTML)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-sm text-white`,children:[(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:u,onChange:e=>d(e.target.checked)}),o(B.TRANSCRIPT_EXPORT$INCLUDE_TOOL_DETAILS)]}),(0,Z.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,disabled:m,checked:f,onChange:e=>p(e.target.checked)}),o(B.TRANSCRIPT_EXPORT$INCLUDE_TIMESTAMPS)]})]}),(0,Z.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,Z.jsx)(tt,{type:`button`,variant:`secondary`,onClick:b,testId:`cancel-transcript-export`,children:o(B.BUTTON$CANCEL)}),(0,Z.jsx)(tt,{type:`button`,variant:`primary`,onClick:async()=>{if(!_.current){v.current=!1,_.current=!0,g(!0);try{let o=await Jn.getEventCount(e,t??``,n).catch(()=>void 0);if(v.current)return;let l=q.getState(),d=await ao(l.loadedConversationId===e?l.events:[],r=>Jn.searchEvents(e,t,n,r),o);if(v.current)return;let p={includeToolDetails:u,includeTimestamps:f,title:r,model:i},m=c===`markdown`,h=m?to(d,p):ro(d,p),g=m?`md`:`html`;re(new Blob([h],{type:m?`text/markdown;charset=utf-8`:`text/html;charset=utf-8`}),`conversation-${e}.${g}`),s(c),a()}catch{v.current||C(o(B.ERROR$GENERIC))}finally{_.current=!1,y.current&&g(!1)}}},testId:`confirm-transcript-export`,isDisabled:m,"aria-busy":m,children:o(B.BUTTON$EXPORT_CONVERSATION)})]})]})})}function co(){let{t:e}=h(`openhands`),{conversationId:t}=J(),{data:n}=K(),{mutate:r}=Dt(),[i,a]=Q.useState(`view`),[o,s]=Q.useState(!1),[c,l]=Q.useState(!1),u=Q.useRef(null),d=Q.useRef(null),{handleDelete:f,handleStop:p,handleDownloadConversation:m,handleDisplayCost:g,handleShowAgentTools:_,handleShowSkills:v,handleShowHooks:y,handleTogglePublic:b,handleCopyShareLink:x,shareUrl:S,handleConfirmDelete:C,handleConfirmStop:w,systemModalVisible:T,setSystemModalVisible:D,skillsModalVisible:O,setSkillsModalVisible:k,hooksModalVisible:ee,setHooksModalVisible:A,confirmDeleteModalVisible:j,setConfirmDeleteModalVisible:M,confirmStopModalVisible:N,setConfirmStopModalVisible:P,systemMessage:F,shouldShowStop:I,shouldShowDownloadConversation:L,shouldShowDisplayCost:R,shouldShowAgentTools:te,shouldShowSkills:ne,shouldShowHooks:re}=Gt({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return Q.useEffect(()=>{i===`edit`&&u.current?.focus()},[i]),n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 h-[22px] text-base font-normal text-left pl-0 lg:pl-1 min-w-0`,"data-testid":`conversation-name`,children:[i===`edit`?(0,Z.jsx)(`input`,{ref:u,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(u.current?.value&&t){let i=u.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{E(e(B.CONVERSATION$TITLE_UPDATED))}})}else u.current&&(u.current.value=n?.title??``);a(`view`)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:n.title||``,className:`text-white leading-5 bg-transparent border-none outline-none text-base font-normal w-fit max-w-fit field-sizing-content`}):(0,Z.jsx)(`div`,{className:`text-white leading-5 truncate`,"data-testid":`conversation-name-title`,onDoubleClick:()=>{a(`edit`)},title:n.title||``,children:n.title}),i!==`edit`&&(0,Z.jsxs)(`div`,{ref:d,className:`relative flex items-center shrink-0`,children:[(0,Z.jsx)(Lt,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)},ariaLabel:e(B.COMMON$MORE_OPTIONS)}),o&&(0,Z.jsx)(ja,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:f,onStop:I?p:void 0,onDisplayCost:R?g:void 0,onShowAgentTools:te?_:void 0,onShowSkills:ne?v:void 0,onShowHooks:re?y:void 0,onTogglePublic:b,onCopyShareLink:x,shareUrl:S,onExportTranscript:e=>{e.preventDefault(),e.stopPropagation(),l(!0),s(!1)},onDownloadConversation:L?m:void 0,position:`bottom`,anchorRef:d})]})]}),c&&t&&(0,Z.jsx)(so,{conversationId:t,conversationUrl:n.conversation_url,sessionApiKey:n.session_api_key,conversationTitle:n.title,model:n.llm_model,onClose:()=>l(!1)}),(0,Z.jsx)(on,{isOpen:T,onClose:()=>D(!1),systemMessage:F||null}),O&&(0,Z.jsx)(un,{onClose:()=>k(!1)}),ee&&(0,Z.jsx)(mn,{onClose:()=>A(!1)}),j&&(0,Z.jsx)(Tt,{onConfirm:C,onCancel:()=>M(!1),conversationTitle:n?.title||``}),N&&(0,Z.jsx)(Mt,{onConfirm:w,onCancel:()=>P(!1)})]}):null}function lo({children:e,tooltip:t,ariaLabel:n}){return(0,Z.jsx)(rt,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,Z.jsx)(`span`,{"data-aria-label":n,children:e})})}function uo({className:e}){let{t}=h(`openhands`),n=ir(),r=bn(),i=f(),{conversationId:a}=J(),{isRightPanelShown:o,setHasRightPanelToggled:s,setIsRightPanelShown:c,setSelectedTab:l}=U(),u=()=>{if(r)return;if(n){if(!a)return;s(!0),c(!0);let{selectedTab:e}=U.getState();e||l(`files`),i(`/conversations/${a}/panel`);return}let e=!o;if(s(e),c(e),e){let{selectedTab:e}=U.getState();e||l(`files`)}},d=t(r?B.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:n?B.COMMON$SHOW_PANEL:o?B.COMMON$HIDE_PANEL:B.COMMON$SHOW_PANEL),p=n?!1:o;return(0,Z.jsx)(lo,{tooltip:d,ariaLabel:d,children:(0,Z.jsx)(`button`,{type:`button`,onClick:u,disabled:r,className:z(kt,r&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":d,"aria-pressed":p,"aria-disabled":r,"data-testid":`right-panel-toggle`,children:(0,Z.jsx)(Ot,{className:`w-5 h-5 -scale-x-100`})})})}function fo(){let{t:e}=h(`openhands`),{conversationId:t}=J(),{data:n}=K(),{curAgentState:r}=X(),{isTask:i,taskStatus:a}=$t(),{mutate:o}=ze(),{mutate:s}=Ca(),{providers:c}=Bt(),[l,u]=Q.useState(!1),[d,f]=Q.useState(!1),p=Q.useRef(null),m=n?.execution_status??null,g=oe({isPausing:!1,isTask:i,taskStatus:a,isStartingStatus:r===I.LOADING||r===I.INIT,isStopStatus:se(m),curAgentState:r}),_=l||d,v=()=>{u(!1),f(!1)};return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`relative shrink-0`,onPointerEnter:e=>{e.pointerType===`mouse`&&f(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&f(!1)},children:[(0,Z.jsx)(`button`,{ref:p,type:`button`,"data-testid":`server-status-menu-trigger`,"aria-label":e(B.COMMON$SERVER_STATUS),"aria-expanded":_,"aria-haspopup":`menu`,onClick:e=>{if(e.preventDefault(),e.stopPropagation(),_){v();return}u(!0)},className:z(`flex items-center justify-center rounded-md`,`text-[var(--oh-muted)] hover:bg-white/10`),children:(0,Z.jsx)(ta,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:g,"aria-hidden":!0})}),_?(0,Z.jsx)(Oa,{onClose:v,ignoreOutsideClickRef:p,onStopServer:L(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&o({conversationId:t}),v()}:void 0,onStartServer:F(m)?e=>{e.preventDefault(),e.stopPropagation(),t&&s({conversationId:t,providers:c}),v()}:void 0,executionStatus:m,position:`bottom`,className:`bottom-full left-0 mt-0 min-h-fit`,isPausing:!1}):null]}),(0,Z.jsx)(co,{})]}),(0,Z.jsx)(uo,{className:`mr-2`})]})}var po=e=>(0,Z.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,Z.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,Z.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]}),mo=160,ho={duration:.22,ease:[.4,0,.2,1]};function go({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o,suppressLayoutAnimation:s=!1}){let c=fe(),l=o||c||!1,u=!l&&!s,d=z(`flex items-center rounded-md cursor-pointer`,`pl-1.5 pr-2 py-1 lg:py-1.5`,`text-[var(--oh-muted)] bg-transparent`,r&&`bg-[var(--oh-interactive-active)] text-white`,r?`hover:text-white hover:bg-[var(--oh-interactive-hover)]`:`hover:text-white hover:bg-white/5`,r?`focus-within:text-white`:`focus-within:text-[var(--oh-muted)]`,a),f=(0,Z.jsx)(t,{className:z(`h-4 w-4 shrink-0 text-inherit`)}),p=i&&r?(0,Z.jsx)(`span`,{className:`whitespace-nowrap text-sm font-normal`,children:i}):null,m=i?(0,Z.jsx)(H.span,{initial:!1,animate:{maxWidth:r?mo:0,opacity:+!!r,marginLeft:r?8:0},transition:ho,className:`block overflow-hidden whitespace-nowrap text-sm font-normal`,"aria-hidden":!r,children:i}):null;return l?(0,Z.jsxs)(`button`,{type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:z(d,`gap-2`),children:[f,p]}):(0,Z.jsxs)(H.button,{layout:u?`position`:!1,type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:d,transition:u?{layout:ho}:void 0,children:[f,m]})}var _o=e=>(0,Z.jsx)(`svg`,{viewBox:`0 0 128 128`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,Z.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M90.767 127.126a7.968 7.968 0 0 0 6.35-.244l26.353-12.681a8 8 0 0 0 4.53-7.209V21.009a8 8 0 0 0-4.53-7.21L97.117 1.12a7.97 7.97 0 0 0-9.093 1.548l-50.45 46.026L15.6 32.013a5.328 5.328 0 0 0-6.807.302l-7.048 6.411a5.335 5.335 0 0 0-.006 7.888L20.796 64 1.74 81.387a5.336 5.336 0 0 0 .006 7.887l7.048 6.411a5.327 5.327 0 0 0 6.807.303l21.974-16.68 50.45 46.025a7.96 7.96 0 0 0 2.743 1.793Zm5.252-92.183L57.74 64l38.28 29.058V34.943Z`})});function vo(){let e=T().backend;if(e.kind!==`cloud`)throw Error(`Cloud sandboxes call requires a cloud backend.`);return e}async function yo(e){if(e.length===0)return[];let t=vo(),n=new URLSearchParams;for(let t of e)n.append(`id`,t);return await qe({backend:t,method:`GET`,path:`/api/v1/sandboxes?${n.toString()}`})??[]}var bo=e=>{let t=O(),n=t.backend.kind===`cloud`;return b({queryKey:[`cloud`,`sandbox`,t.backend.id,t.orgId,e],queryFn:async()=>{if(!e)return null;let[t]=await yo([e]);return t??null},enabled:n&&!!e,staleTime:1e3*60*5,gcTime:1e3*60*15})},xo=`VSCODE`,So=()=>{let{t:e}=h(`openhands`),{conversationId:t}=J(),n=Zr({allowAgentError:!0}),{data:r}=K(),i=O(),a=r?.conversation_url??null,o=r?.session_api_key??null,s=r?.sandbox_id??null,c=i.backend.kind===`cloud`,l=bo(c?s:null),u=b({queryKey:[`unified`,`vscode_url`,`local`,t,a,o],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return{url:wt((await pt.getVSCodeUrl(t,a,o).catch(()=>gt.getVSCodeUrl(t))).vscode_url)}},enabled:!c&&n&&!!t,refetchOnMount:!0,retry:3}),d,f,p,m,g,_,v;if(c){let e=l.data?.exposed_urls?.find(e=>e.name===xo)?.url??null;d=l.isSuccess?{url:wt(e)}:void 0,f=l.isLoading,p=l.isError,m=l.isSuccess,g=l.status,_=l.error,v=async()=>{let e=await l.refetch(),t=e.data?.exposed_urls?.find(e=>e.name===xo)?.url??null;return{data:e.data?{url:wt(t)}:void 0}}}else d=u.data,f=u.isLoading,p=u.isError,m=u.isSuccess,g=u.status,_=u.error,v=async()=>({data:(await u.refetch()).data});let y=d&&!d.url?e(B.VSCODE$URL_NOT_AVAILABLE):null;return{data:d?{...d,error:y}:void 0,error:_,isLoading:f,isError:p,isSuccess:m,status:g,refetch:v}};function Co(){let{t:e}=h(`openhands`),{curAgentState:t}=X(),{data:n,refetch:r,isLoading:i}=So(),a=A.includes(t);return(0,Z.jsxs)(`button`,{type:`button`,onClick:async()=>{let e=n?.url;e||=(await r()).data?.url??null,e&&window.open(e,`_blank`,`noopener,noreferrer`)},disabled:i||a,"aria-label":e(B.VSCODE$OPEN),title:e(B.VSCODE$OPEN),"data-testid":`drawer-vscode-link`,className:z(`inline-flex items-center gap-1.5 rounded-[7px] border border-[var(--oh-border)] bg-base-secondary px-2 py-1 text-xs`,`text-[var(--oh-muted)] transition-colors hover:enabled:bg-surface-raised hover:enabled:text-white`,`cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,Z.jsx)(_o,{className:`h-[15px] w-[15px] shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:e(B.FILES$VSCODE)}),(0,Z.jsx)(Le,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})]})}var wo=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.13832 8.76476C8.25957 8.17949 9.52697 7.9727 10.7515 8.14436L14.9025 2.52826L21.4717 9.09737L15.8555 13.2484C16.0272 14.4729 15.8204 15.7403 15.2351 16.8616C15.1872 16.9535 15.1366 17.0444 15.0836 17.1343C14.8318 17.5605 14.5228 17.9624 14.1566 18.3286L10.4443 14.6163L4.75207 20.3085H3.69141V19.2478L9.38361 13.5556L5.6713 9.84332C6.03755 9.47708 6.43936 9.16808 6.86562 8.91632C6.95547 8.86326 7.04641 8.81274 7.13832 8.76476ZM15.0735 4.82054L19.1794 8.92641L14.2461 12.5727L14.3701 13.4567C14.492 14.3266 14.3596 15.2233 13.9758 16.0265L7.97338 10.0241C8.77665 9.64035 9.67335 9.50789 10.5432 9.62984L11.4272 9.75376L15.0735 4.82054Z`,fill:`currentColor`})}),To=e=>(0,Z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Z.jsx)(`path`,{d:`M10.9706 10.1586C10.2819 10.0621 9.56905 10.1784 8.93842 10.5075C8.88672 10.5345 8.83557 10.5629 8.78504 10.5928C8.54529 10.7344 8.3193 10.9082 8.11331 11.1142L9.83702 12.8372L7.00054 15.75L7 17H8.25064L11.1628 14.1632L12.8857 15.8865C13.0917 15.6805 13.2655 15.4545 13.4071 15.2147C13.437 15.1642 13.4654 15.1131 13.4924 15.0614C13.8215 14.4308 13.9378 13.718 13.8413 13.0293L17 10.6946L13.3053 7L10.9706 10.1586Z`,fill:`currentColor`})});function Eo(e){if(tr(e)&&e.observation.kind===`TaskTrackerObservation`){let t=e.observation;if(t.command===`plan`)return t.task_list.map((e,t)=>({id:String(t+1),title:e.title,status:e.status,notes:e.notes||void 0}))}return null}function Do(){let e=q(e=>e.events);return(0,Q.useMemo)(()=>{for(let t=e.length-1;t>=0;--t){let n=Eo(e[t]);if(n)return{taskList:n,hasTaskList:n.length>0}}return{taskList:[],hasTaskList:!1}},[e])}function Oo({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=Nt(t,n),[a,o]=(0,Q.useState)();(0,Q.useLayoutEffect)(()=>{if(!e||!r?.current){o(void 0);return}let t=()=>{let e=r.current?.getBoundingClientRect();e&&o({position:`fixed`,zIndex:9999,top:e.bottom+8,left:e.left})};return t(),window.addEventListener(`resize`,t),window.addEventListener(`scroll`,t,!0),()=>{window.removeEventListener(`resize`,t),window.removeEventListener(`scroll`,t,!0)}},[e,r]);let{t:s}=h(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedTabs:u,setSelectedTab:d}=st(c),{selectedTab:f,isRightPanelShown:p,setSelectedTab:m}=U(),{navigateToTab:g}=Xn(),{hasTaskList:_}=Do(),{backend:v}=O(),y=bn(),b=[{tab:`planner`,icon:We,i18nKey:B.COMMON$PLANNER},{tab:`files`,icon:tn,i18nKey:B.COMMON$FILES},{tab:`terminal`,icon:or,i18nKey:B.COMMON$TERMINAL},{tab:`browser`,icon:Ue,i18nKey:B.COMMON$BROWSER},{tab:`usage`,icon:Be,i18nKey:B.COMMON$USAGE}];_&&b.unshift({tab:`tasklist`,icon:po,i18nKey:B.COMMON$TASK_LIST});let x=b.filter(({tab:e})=>e!==`planner`||v.kind===`cloud`),S=e=>{y||(g(e),t())},C=(e,t)=>{if(y){t.preventDefault(),t.stopPropagation();return}if(t.preventDefault(),t.stopPropagation(),l.unpinnedTabs.includes(e))u(l.unpinnedTabs.filter(t=>t!==e));else{let t=[...l.unpinnedTabs,e];if(u(t),f===e&&p){let n=x.find(({tab:n})=>n!==e&&!t.includes(n));n&&(m(n.tab),d(n.tab))}}};if(!e)return null;let w=!!(r?.current&&a),T=(0,Z.jsx)(Ft,{ref:i,theme:w?`popover`:`default`,position:w?`none`:`bottom`,alignment:w?`none`:`left`,spacing:w?`none`:`default`,className:z(`z-[9999] w-fit`,w?`mt-0`:`mt-2`),children:x.map(({tab:e,icon:t,i18nKey:n})=>{let r=!l.unpinnedTabs.includes(e);return(0,Z.jsx)(`li`,{className:`list-none`,children:(0,Z.jsx)(Cn,{isDisabled:y,children:(0,Z.jsxs)(`div`,{className:z(`group flex h-[30px] w-full min-w-0 items-stretch rounded`,!y&&`hover:bg-[var(--oh-interactive-hover)]`,y&&`opacity-50`),children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,disabled:y,className:z(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,it,y?`cursor-not-allowed`:`cursor-pointer`),onClick:()=>S(e),children:[(0,Z.jsx)(`span`,{className:at,"aria-hidden":!0,children:(0,Z.jsx)(t,{className:`h-4 w-4`})}),(0,Z.jsx)(`span`,{className:`text-sm`,children:s(n)})]}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,disabled:y,className:z(`flex shrink-0 items-center justify-center rounded-r px-2 text-white`,it,y?`cursor-not-allowed`:`cursor-pointer hover:bg-white/10`),"aria-pressed":r,"aria-label":s(r?B.CONVERSATION$UNPIN_TAB:B.CONVERSATION$PIN_TAB),onClick:t=>C(e,t),children:r?(0,Z.jsx)(`span`,{className:z(`-mr-[5px] ml-auto`,at),"aria-hidden":!0,children:(0,Z.jsx)(To,{className:`h-7 w-7`})}):(0,Z.jsx)(`span`,{className:z(`ml-auto`,at),"aria-hidden":!0,children:(0,Z.jsx)(wo,{className:`h-4.5 w-4.5`})})})]})})},e)})});return w&&a&&typeof document<`u`?ka.createPortal((0,Z.jsx)(`div`,{style:a,children:T}),document.body):T}function ko({variant:e=`default`,isPanelResizing:t=!1}){let{conversationId:n}=J(),{setSelectedTab:r,planContent:i}=U(),[a,o]=(0,Q.useState)(!1),{state:s}=st(n),{hasTaskList:c}=Do(),{backend:l}=O(),{handleBuildPlanClick:u}=xe(),{curAgentState:d}=X(),{selectTab:f,isTabActive:p,onTabChange:m,selectedTab:g,isRightPanelShown:_}=Xn();(0,Q.useEffect)(()=>{r(s.selectedTab)},[r,s.selectedTab]),(0,Q.useEffect)(()=>{_&&(g||m(`files`))},[_,g,m]);let{t:v,i18n:y}=h(`openhands`),b=[{tabValue:`files`,isActive:p(`files`),icon:tn,onClick:()=>f(`files`),tooltipContent:v(B.COMMON$FILES),tooltipAriaLabel:v(B.COMMON$FILES),label:v(B.COMMON$FILES)},{tabValue:`planner`,isActive:p(`planner`),icon:We,onClick:()=>f(`planner`),tooltipContent:v(B.COMMON$PLANNER),tooltipAriaLabel:v(B.COMMON$PLANNER),label:v(B.COMMON$PLANNER)},{tabValue:`terminal`,isActive:p(`terminal`),icon:or,onClick:()=>f(`terminal`),tooltipContent:v(B.COMMON$TERMINAL),tooltipAriaLabel:v(B.COMMON$TERMINAL),label:v(B.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:p(`browser`),icon:Ue,onClick:()=>f(`browser`),tooltipContent:v(B.COMMON$BROWSER),tooltipAriaLabel:v(B.COMMON$BROWSER),label:v(B.COMMON$BROWSER)},{tabValue:`usage`,isActive:p(`usage`),icon:Be,onClick:()=>f(`usage`),tooltipContent:v(B.COMMON$USAGE),tooltipAriaLabel:v(B.COMMON$USAGE),label:v(B.COMMON$USAGE)}];c&&b.splice(1,0,{tabValue:`tasklist`,isActive:p(`tasklist`),icon:po,onClick:()=>f(`tasklist`),tooltipContent:v(B.COMMON$TASK_LIST),tooltipAriaLabel:v(B.COMMON$TASK_LIST),label:v(B.COMMON$TASK_LIST)});let x=b.filter(e=>e.tabValue===`planner`&&l.kind!==`cloud`?!1:s.unpinnedTabs.includes(e.tabValue)?g===e.tabValue:!0),S=s.unpinnedTabs.join(`,`),C=d===I.RUNNING||d===I.LOADING||!i,w=(0,Q.useRef)(null),T=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D=(0,Q.useRef)(null),k=(0,Q.useRef)(null),[ee,A]=(0,Q.useState)(x.length);(0,Q.useLayoutEffect)(()=>{let e=w.current,t=T.current,n=E.current,r=D.current;if(!e||!t||!n||!r)return;let i=()=>{let i=t.querySelectorAll(`[data-tab-measure="true"]`),a=i.length,o=e.getBoundingClientRect().width;if(o===0){A(a);return}let s=Array.from(i).map(e=>e.getBoundingClientRect().width);if(s.length!==a||a===0){A(Math.max(0,a));return}let c=n.getBoundingClientRect().width,l=r.getBoundingClientRect().width,u=getComputedStyle(e).columnGap||getComputedStyle(e).gap,d=parseFloat(u)||6,f=0;for(let e=a;e>=0;--e){let t=c+l;for(let n=0;n<e;n+=1)t+=s[n]??0;if(e>0&&(t+=e*d),t<=o+.5){f=e;break}}A(e=>e===f?e:f)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(e),()=>a.disconnect()},[S,x.length,c,l.kind,g,_,y.language]);let j=Math.min(ee,x.length);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:z(`relative w-full min-w-0`,e===`compact`?`flex h-full min-h-0 items-center py-0 pl-0 pr-1`:`min-h-10 p-1`),children:[(0,Z.jsx)(`div`,{ref:T,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:x.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,Z.jsx)(lo,{tooltip:r,ariaLabel:i,children:(0,Z.jsx)(go,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:z(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,Z.jsxs)(`div`,{ref:w,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-start overflow-hidden`,children:(0,Z.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(mr,{id:`conversation-drawer-tabs`,children:(0,Z.jsx)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:x.slice(0,j).map(({tabValue:e,icon:n,onClick:r,isActive:i,tooltipContent:a,tooltipAriaLabel:o,label:s,className:c},l)=>(0,Z.jsx)(lo,{tooltip:a,ariaLabel:o,children:(0,Z.jsx)(go,{tabValue:e,icon:n,onClick:r,isActive:i,label:s,className:z(c,`shrink-0`),suppressLayoutAnimation:t})},`${e}-${l}`))})}),(0,Z.jsxs)(`div`,{ref:E,className:`relative shrink-0`,children:[(0,Z.jsx)(Lt,{ref:k,onClick:()=>o(!a),ariaLabel:v(B.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?Et:void 0}),(0,Z.jsx)(Oo,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:k,anchorRef:k})]})]})}),(0,Z.jsx)(`div`,{ref:D,className:z(`ml-auto shrink-0`,l.kind===`cloud`&&`pr-1`),children:l.kind===`cloud`&&(0,Z.jsx)(Co,{})})]})]}),p(`planner`)&&(0,Z.jsx)(`div`,{className:z(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,Z.jsx)(`button`,{type:`button`,onClick:u,disabled:C,className:z(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,C?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,Z.jsxs)(Wt.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[v(B.COMMON$BUILD),` ⌘↩`]})})})]})}function Ao({onMouseDown:e,className:t,isDragging:n=!1}){let[r,i]=(0,Q.useState)(!1),a=n||r;return(0,Z.jsxs)(`div`,{className:z(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,Z.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 w-3 min-w-[12px] -translate-x-1/2 cursor-ew-resize`,onMouseDown:e,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)}),(0,Z.jsx)(`div`,{className:z(`pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 transition-colors`,a?`bg-white`:`bg-transparent`),"aria-hidden":!0})]})}var jo=200;function Mo({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=nr(r,e),o=(0,Q.useCallback)(e=>Math.max(t,Math.min(n,e)),[t,n]),[s,c]=(0,Q.useState)(()=>o(i)),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useCallback)(e=>{e.preventDefault(),u(!0)},[]),p=(0,Q.useCallback)(e=>{if(!l||!d.current)return;let t=d.current.getBoundingClientRect();c(o((e.clientX-t.left)/t.width*100))},[l,o]),m=(0,Q.useCallback)(()=>{l&&(u(!1),a(s))},[l,s,a]);return(0,Q.useLayoutEffect)(()=>{if(!l)return;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.dataset.panelDragShield=``,Object.assign(e.style,{position:`fixed`,inset:`0`,zIndex:String(jo),cursor:`ew-resize`}),document.body.appendChild(e),document.addEventListener(`mousemove`,p),document.addEventListener(`mouseup`,m),document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`,()=>{document.removeEventListener(`mousemove`,p),document.removeEventListener(`mouseup`,m),document.body.style.cursor=``,document.body.style.userSelect=``,e.remove()}},[l,p,m]),{leftWidth:s,rightWidth:100-s,isDragging:l,containerRef:d,handleMouseDown:f}}function No(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function Po(){let e=ir(),t=ir(767),{isRightPanelShown:n}=U(),{leftWidth:r,rightWidth:i,isDragging:a,containerRef:o,handleMouseDown:s}=Mo({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,Z.jsx)(`div`,{className:z(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,Z.jsxs)(`div`,{ref:o,className:z(`flex flex-1 overflow-hidden`,e?`flex-col`:`transition-all duration-300 ease-in-out`),style:e?void 0:{transitionProperty:a?`none`:`all`},children:[(0,Z.jsxs)(`div`,{className:z(`flex flex-col bg-base overflow-hidden`,e?`flex-1`:`transition-all duration-300 ease-in-out`),style:e?void 0:{width:n?`${r}%`:`100%`,transitionProperty:a?`none`:`all`},children:[(0,Z.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:z(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,Z.jsx)(jt,{}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(fo,{})})]}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(oa,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,Z.jsx)(Ao,{onMouseDown:s,isDragging:a}),!e&&(0,Z.jsx)(`div`,{className:z(`transition-all duration-300 ease-in-out overflow-hidden`,No(n)),style:{width:n?`${i}%`:`0%`,transitionProperty:a?`opacity, transform`:`all`},children:(0,Z.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-0 bg-[var(--oh-surface)] border-l border-[var(--oh-border)] overflow-hidden`,children:[(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,Z.jsx)(ko,{isPanelResizing:a})}),(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,Z.jsx)(Sa,{})})]})})})]})})}function Fo({onNavigateBack:e}){let{t}=h(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=U();return Q.useLayoutEffect(()=>(n(!0),r(!0),U.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,Z.jsxs)(`div`,{"data-testid":`conversation-mobile-panel-top`,className:`flex h-10 min-h-10 shrink-0 items-center gap-1.5 border-b border-[var(--oh-border)] pl-2.5`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(B.COMMON$BACK),className:kt,children:(0,Z.jsx)(Fe,{size:20,className:Et,"aria-hidden":!0,strokeWidth:2})}),(0,Z.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,Z.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex h-full min-h-0 w-full min-w-0 flex-col justify-center`,children:(0,Z.jsx)(ko,{variant:`compact`})})})]}),(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,Z.jsx)(Sa,{})})]})}var Io=1e3*60*5,Lo=1e3*60*15,Ro=e=>{let t=e||[],n=O();return b({queryKey:[`v1`,`sub-conversations`,t,n.backend.id,n.orgId],queryFn:async()=>t.length===0?[]:pt.batchGetAppConversations(t),enabled:t.length>0,staleTime:Io,gcTime:Lo,retry:!1})};function zo({children:e,conversationId:t}){let{data:n}=K(),{data:r}=Ro(n?.sub_conversation_ids??[]),i=r?.filter(e=>e!==null);return(0,Z.jsx)(Vn,{conversationId:t,conversationUrl:n?.sandbox_status===`PAUSED`?null:n?.conversation_url,sessionApiKey:n?.session_api_key,subConversationIds:n?.sub_conversation_ids,subConversations:i,children:e})}function Bo(){let{t:e}=h(`openhands`),{conversationId:t}=J(),n=d(`/conversations/:conversationId/panel`),{isTask:r,taskStatus:i,taskDetail:a}=Yt(),o=O(),s=Q.useRef(o.backend.id),c=Q.useRef(o.orgId),l=s.current!==o.backend.id||c.current!==o.orgId,{data:p,isFetched:m}=K(),{data:g}=ht(),{resetConversationState:_}=U(),v=f(),y=u(),b=er(e=>e.clearTerminal),x=Ct(e=>e.reset),S=gr(e=>e.setCurrentAgentState),w=$n(e=>e.removeErrorMessage);Q.useEffect(()=>{b(),_(),x(),S(I.LOADING),w()},[t,b,_,x,S,w]),Q.useEffect(()=>{if(r&&i===`ERROR`){C(a||e(B.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=y.state?.resumedFromConversationId;v(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[r,i,a,e,v,y.state]),Q.useEffect(()=>{!m||!g||l||p||(Sr(o.backend.id,o.orgId),C(e(B.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),v(`/conversations`))},[p,m,g,v,e,l,o.backend.id,o.orgId]),Q.useEffect(()=>{l||t&&(t.startsWith(`task-`)||xr(o.backend.id,o.orgId,t))},[t,l,o.backend.id,o.orgId]);let T=Q.useRef(null);return Q.useEffect(()=>{!m||!p||o.backend.kind===`cloud`&&p.sandbox_status===`PAUSED`&&p.sandbox_id&&T.current!==p.id&&(T.current=p.id,ft(p.sandbox_id).catch(()=>{C(e(B.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[m,p?.id,p?.sandbox_status,p?.sandbox_id,o.backend.kind,e]),l?null:(0,Z.jsx)(zo,{conversationId:t,children:(0,Z.jsx)(Or,{children:(0,Z.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,Z.jsx)(Fo,{onNavigateBack:()=>v(`/conversations/${t}`)}):(0,Z.jsx)(Po,{})})})})}function Vo(){return(0,Z.jsx)(Bo,{})}var Ho=p(Vo);export{or as i,Do as n,Zr as r,Ho as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-CPCVsCUY.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{l as n,v as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{$ as i,ct as a,et as o,yt as s}from"./active-backend-context-IqOjobNK.js";import{a as c,i as l}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js";import{f as u}from"./conversation-store-Blc5xysY.js";import{_ as d,m as f,t as p,w as m,x as h}from"./agent-server-conversation-service.api-DWBe0rbX.js";var g=async e=>{let t=(await p.batchGetAppConversations([e]))[0];if(!t)throw Error(`V1 conversation not found: ${e}`);return{conversationUrl:t.conversation_url,sessionApiKey:t.session_api_key,sandboxId:t.sandbox_id}},_=async e=>{let{conversationUrl:t,sessionApiKey:n,sandboxId:o}=await g(e);if(a().backend.kind===`cloud`){if(!o)throw Error(`Cannot stop runtime: cloud conversation ${e} has no sandbox_id.`);return await d(o),{success:!0}}return new r(i({conversationUrl:t,sessionApiKey:n})).interruptConversation(e)},v=async(e,t)=>{let{conversationUrl:n,sessionApiKey:a}=await g(e);return new r(i({conversationUrl:n,sessionApiKey:a})).askAgent(e,t)},y=async(e,t)=>{let{conversationUrl:n,sessionApiKey:a}=await g(e);await new r(i({conversationUrl:n,sessionApiKey:a})).startGoal(e,t)},b=async e=>{let{conversationUrl:t,sessionApiKey:n}=await g(e);await new r(i({conversationUrl:t,sessionApiKey:n})).stopGoal(e)},x=async e=>{let{conversationUrl:t,sessionApiKey:n}=await g(e);await new r(i({conversationUrl:t,sessionApiKey:n})).resumeGoal(e)},S=async e=>{let{conversationUrl:t,sessionApiKey:n}=await g(e);return new r(i({conversationUrl:t,sessionApiKey:n})).runConversation(e)},C=(e,t,n)=>{e.setQueriesData({queryKey:[`user`,`conversation`,t]},e=>e&&{...e,...n}),e.setQueriesData({queryKey:[`user`,`conversations`]},e=>e&&{...e,pages:e.pages.map(e=>({...e,items:e.items.map(e=>e.id===t?{...e,...n}:e)}))})},w=(e,t,n)=>C(e,t,{execution_status:n}),T=(e,t,n)=>C(e,t,{llm_model:n}),E=(e,t)=>{e.invalidateQueries({queryKey:[`user`,`conversation`,t]}),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]}),e.invalidateQueries({queryKey:[`unified`,`vscode_url`]})},D=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function O(e){let t=e.split(/[\\/]+/).filter(Boolean),n=t[t.length-1];if(!n||n===`.`||n===`..`)throw Error(`Invalid file name`);return n}async function k(e,t={}){return m(e,t)}async function A(e,t,n={}){let r=O(e);return`${(await k(t,n)).replace(/[/\\]+$/,``)}/${r}`}async function j(e,t){if(t?.id===e&&t.workspace?.working_dir?.trim())return t.workspace.working_dir.trim();let n=h(e);return n?.selected_workspace?.trim()?n.selected_workspace.trim():D.test(e)?p.resolveConversationWorkingDir(e):s()}var M=5;async function N(e,t){if(t?.id===e&&t.conversation_url?.trim()&&t.session_api_key?.trim())return{conversationUrl:t.conversation_url.trim(),sessionApiKey:t.session_api_key.trim()};if(a().backend.kind===`cloud`){let[t]=await f([e]);return{conversationUrl:t?.conversation_url?.trim()??null,sessionApiKey:t?.session_api_key?.trim()??null}}return{conversationUrl:null,sessionApiKey:null}}function P(e){if(!e.conversationUrl||!e.sessionApiKey)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return{conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey}}async function F(e,t,n){let r=await j(e,n),i=await N(e,n),o=a().backend.kind===`cloud`,s=n?.id===e?n.session_api_key??i.sessionApiKey:i.sessionApiKey,c=n?.id===e?n.conversation_url??i.conversationUrl:i.conversationUrl;if(o){let e=P({conversationUrl:c,sessionApiKey:s});return I({files:t,workingDir:r,conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey})}return I({files:t,workingDir:r,conversationUrl:c,sessionApiKey:s})}async function I(e){let{files:t,workingDir:n,conversationUrl:r,sessionApiKey:a}=e,o=new l(i({conversationUrl:r,sessionApiKey:a,workingDir:n})),s=async e=>{try{let t=O(e.name),i=await A(e.name,n,{conversationUrl:r,sessionApiKey:a});return await o.fileUpload(e,i),{uploadedFile:t,skippedFile:null}}catch(t){return{uploadedFile:null,skippedFile:{name:e.name,reason:t instanceof Error?t.message:`Upload failed`}}}},c=[];for(let e=0;e<t.length;e+=M){let n=t.slice(e,e+M);c.push(...await Promise.all(n.map(s)))}return{uploaded_files:c.flatMap(e=>e.uploadedFile?[e.uploadedFile]:[]),skipped_files:c.flatMap(e=>e.skippedFile?[e.skippedFile]:[])}}var L=class{static currentConversation=null;static setCurrentConversation(e){this.currentConversation=e}static getCurrentConversation(){return this.currentConversation}static getClientOverrides(){return{sessionApiKey:this.currentConversation?.session_api_key}}static async getVSCodeUrl(e){let t=this.currentConversation?.id===e?this.currentConversation?.workspace?.working_dir??s():s();return{vscode_url:await new n(i(this.getClientOverrides())).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:t})}}static async getTrajectory(e){return{trajectory:(await new c(o(this.getClientOverrides()),e).search({limit:1e4})).items??[]}}static async uploadFiles(e,t){return F(e,t,this.currentConversation)}};e();var R=t(),z=e=>(0,R.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,R.jsx)(`path`,{d:`M21.0004 6.00001C21.0016 5.43668 20.8441 4.88442 20.5459 4.40644C20.2478 3.92846 19.8212 3.54406 19.3148 3.29726C18.8084 3.05046 18.2428 2.95122 17.6826 3.0109C17.1224 3.07059 16.5904 3.28678 16.1474 3.63473C15.7044 3.98269 15.3683 4.44835 15.1776 4.97841C14.9869 5.50848 14.9493 6.08152 15.0691 6.63197C15.1888 7.18241 15.4612 7.688 15.8549 8.09088C16.2487 8.49375 16.7479 8.77762 17.2954 8.91001V10.5C17.2978 10.6372 17.261 10.7722 17.1892 10.8891C17.1175 11.006 17.0138 11.1 16.8904 11.16L12.7354 13.32L8.59544 11.22C8.46356 11.1544 8.35443 11.0507 8.28221 10.9223C8.21 10.7939 8.17802 10.6468 8.19044 10.5V8.91001C8.89743 8.72746 9.51358 8.29333 9.92339 7.689C10.3332 7.08467 10.5085 6.35161 10.4165 5.62725C10.3245 4.90289 9.97149 4.23695 9.42361 3.75426C8.87573 3.27157 8.17062 3.00527 7.44044 3.00527C6.71026 3.00527 6.00514 3.27157 5.45726 3.75426C4.90938 4.23695 4.55635 4.90289 4.46435 5.62725C4.37234 6.35161 4.54768 7.08467 4.95749 7.689C5.36729 8.29333 5.98344 8.72746 6.69044 8.91001V10.5C6.6913 10.9156 6.80651 11.323 7.02346 11.6776C7.24041 12.0321 7.55073 12.3201 7.92044 12.51L12.0004 14.61V16.59C11.2934 16.7726 10.6773 17.2067 10.2675 17.811C9.85768 18.4153 9.68234 19.1484 9.77435 19.8728C9.86635 20.5971 10.2194 21.2631 10.7673 21.7457C11.3151 22.2284 12.0203 22.4947 12.7504 22.4947C13.4806 22.4947 14.1857 22.2284 14.7336 21.7457C15.2815 21.2631 15.6345 20.5971 15.7265 19.8728C15.8185 19.1484 15.6432 18.4153 15.2334 17.811C14.8236 17.2067 14.2074 16.7726 13.5004 16.59V14.61L17.5504 12.57C17.9317 12.3784 18.2501 12.0816 18.468 11.7148C18.686 11.348 18.7944 10.9265 18.7804 10.5V8.88001C19.4147 8.70922 19.9755 8.33496 20.3765 7.81469C20.7776 7.29442 20.9967 6.6569 21.0004 6.00001ZM6.00044 6.00001C6.00044 5.60218 6.15847 5.22065 6.43978 4.93934C6.72108 4.65804 7.10261 4.5 7.50044 4.5C7.89826 4.5 8.27979 4.65804 8.5611 4.93934C8.8424 5.22065 9.00044 5.60218 9.00044 6.00001C9.00044 6.39783 8.8424 6.77936 8.5611 7.06067C8.27979 7.34197 7.89826 7.50001 7.50044 7.50001C7.10261 7.50001 6.72108 7.34197 6.43978 7.06067C6.15847 6.77936 6.00044 6.39783 6.00044 6.00001ZM14.2054 19.5C14.2054 19.8978 14.0474 20.2794 13.7661 20.5607C13.4848 20.842 13.1033 21 12.7054 21C12.3076 21 11.9261 20.842 11.6448 20.5607C11.3635 20.2794 11.2054 19.8978 11.2054 19.5C11.2054 19.1022 11.3635 18.7207 11.6448 18.4393C11.9261 18.158 12.3076 18 12.7054 18C13.1033 18 13.4848 18.158 13.7661 18.4393C14.0474 18.7207 14.2054 19.1022 14.2054 19.5ZM18.0004 7.50001C17.6026 7.50001 17.2211 7.34197 16.9398 7.06067C16.6585 6.77936 16.5004 6.39783 16.5004 6.00001C16.5004 5.60218 16.6585 5.22065 16.9398 4.93934C17.2211 4.65804 17.6026 4.5 18.0004 4.5C18.3983 4.5 18.7798 4.65804 19.0611 4.93934C19.3424 5.22065 19.5004 5.60218 19.5004 6.00001C19.5004 6.39783 19.3424 6.77936 19.0611 7.06067C18.7798 7.34197 18.3983 7.50001 18.0004 7.50001Z`,fill:`currentColor`})}),B=e=>{let t=e.match(/^\/workspace\/[^/]+\/(.*)$/);return t?t[1]:e},V=e=>{let t=e.trim();if(!t)return``;let n=t.replace(/[\\/]+$/,``);if(!n||/^[A-Za-z]:$/.test(n))return``;let r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`));return r>=0?n.slice(r+1):n},H=u(e=>({execution_status:null,setExecutionStatus:t=>e({execution_status:t}),reset:()=>e({execution_status:null})}));export{T as _,L as a,v as c,_ as d,S as f,w as g,b as h,z as i,E as l,y as m,V as n,N as o,x as p,B as r,F as s,H as t,C as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{_ as a,j as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as s}from"./useQuery-DRv--6bK.js";import{$ as c,Pt as l,X as u,ct as d,mt as f,n as p,nt as m}from"./active-backend-context-IqOjobNK.js";import{E as h,t as g,z as _}from"./utils-zxEjKE70.js";import{i as v,l as y,r as b}from"./messages-DSXvyc21.js";import{a as x,c as S,i as C,l as w,n as T,o as E,r as D,s as O,t as k}from"./vendor~files-tab-D9wR9yM2.js";import{t as A}from"./mouse-pointer-click-BYX1Pw5W.js";import{r as j}from"./conversation-CPCVsCUY.js";import{i as M}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-4WsUP-tz.js";import{t as N}from"./proxy-9Z_WZggZ.js";import{c as P,f as F}from"./conversation-store-Blc5xysY.js";import{t as ee}from"./segmented-toggle-DCspm2U5.js";import{x as te,y as ne}from"./agent-server-conversation-service.api-DWBe0rbX.js";import{t as re}from"./format-time-delta-BIR5Os7T.js";import{o as I}from"./home-store-CxqsY9Fi.js";import{r as ie}from"./typography-NOKSk9_R.js";import{h as L}from"./llm-not-configured-banner-DLw_tu-G.js";import{J as R,S as ae,X as oe,Y as z,g as B,q as se,t as ce}from"./markdown-renderer-DUmk7pFc.js";import{t as le}from"./link-external-BNZzCM1I.js";import{n as ue,t as de}from"./highlighted-source-view-C_sfncLZ.js";import{t as V}from"./conversation-tab-empty-state-CMqo_0Bd.js";var H=e(t(),1),U=n();function fe(){let{t:e}=i(`openhands`);return(0,U.jsx)(V,{className:`h-full`,icon:(0,U.jsx)(A,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(_.FILES$NO_FILE_SELECTED)})}var pe=class{static async executeCommand(e,t,n,r,i=30){let a=d().backend;if(a.kind===`cloud`&&e){let o=await N({backend:a,method:`POST`,hostOverride:m(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new M(c({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=d().backend;return r.kind===`cloud`&&e?(await N({backend:r,method:`GET`,hostOverride:m(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new a(c({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}};function W(e){return e.startsWith(`/`)?e:`/${e}`}async function G(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:W(r.path)});return N({backend:i,method:`GET`,hostOverride:m(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new M(c({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function me(e){return u(e,404)||o(e)&&e.response?.status===404}var K=class{static async getGitChanges(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,W(r));let n=await N({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:I(String(e.status)),path:e.path}))}let a=await new M(c({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:I(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await G(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(me(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await G(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:I(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await G(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=d().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,W(r));let n=await N({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new M(c({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}};function q(e,t){let n=t?.trim();if(n)return n;if(!e)return f;let r=e.split(`/`);return`${f}/${r[r.length-1]}`}var J=()=>{let{conversationId:e}=z(),{data:t}=R(),[n,r]=H.useState([]),i=H.useRef(null),a=j(),o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=H.useMemo(()=>q(l,u),[l,u]),f=s({queryKey:[`file_changes`,e,o,c,d],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return K.getGitChanges(e,o,c,d)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:a&&!!e,meta:{disableToast:!0}});return H.useEffect(()=>{if(!f.isFetching&&f.isSuccess&&f.data){let e=f.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[f.isFetching,f.isSuccess,f.data]),{data:n,isLoading:f.isLoading,isFetching:f.isFetching,isSuccess:f.isSuccess,isError:f.isError,error:f.error,refetch:f.refetch}},Y=2e3,he=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function ge(){return`find . \\( ${he.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Y}`}function _e(e){return e.startsWith(`./`)?e.slice(2):e}function ve(e){let{data:t}=R(),n=j(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),c=s({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await pe.executeCommand(i,a,ge(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(_e);return Array.from(new Set(t)).slice(0,Y)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function ye(e){let t=J(),n=(0,H.useMemo)(()=>{if(!e)return;let n=t.data.filter(e=>e.status!==`D`).map(e=>e.path);return Array.from(new Set(n)).slice(0,Y)},[e,t.data]);return{data:e?n:void 0,isLoading:e?t.isLoading:!1}}function be(){let{backend:e}=p(),t=e.kind===`cloud`,n=ve(!t),r=ye(t);return t?r:n}function xe(){let{data:e}=R(),t=j(),n=e?.id,r=e?.conversation_url,i=e?.session_api_key,a=d().backend.kind===`local`,o=s({queryKey:[`workspace-session`,n,r,i],queryFn:async()=>({baseUrl:await new M(c({conversationUrl:r,sessionApiKey:i})).startWorkspaceSession(n)}),enabled:t&&!!n&&a,staleTime:1/0,gcTime:1/0,retry:!1});return{data:o.data??null,isLoading:o.isLoading,isError:o.isError,error:o.error??null}}function Se(e,t){let n=(t??``).replace(/^\/+/,``);return n?`${e}${n.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`:e}var X=F(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Ce(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var we=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`svg`,`avif`]),Te=new Set([`pdf`]);function Ee(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function De(e){switch(Ee(e)){case`html`:case`htm`:return`text/html`;case`css`:return`text/css`;case`js`:case`mjs`:case`cjs`:return`text/javascript`;case`json`:return`application/json`;case`md`:case`markdown`:return`text/markdown`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;case`bmp`:return`image/bmp`;case`ico`:return`image/x-icon`;case`avif`:return`image/avif`;case`pdf`:return`application/pdf`;default:return`text/plain`}}function Oe(e){let t=Ee(e);return we.has(t)?`image`:Te.has(t)?`pdf`:`text`}function ke(e){let t=new Uint8Array(e,0,Math.min(e.byteLength,8e3));for(let e=0;e<t.length;e+=1)if(t[e]===0)return!0;return!1}function Z(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode.apply(null,t.subarray(e,e+n));return btoa(r)}function Ae(e){let{data:t}=R(),n=j(),{data:r}=xe(),i=X(e=>e.count),a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),f=r?.baseUrl,p=d().backend.kind===`cloud`,m=q(l,u),h=m.startsWith(`/`)?m:`/${m}`,g=e?`${h}/${e}`:null;return s({queryKey:[`workspace-file-content`,a,o,c,p?`cloud`:f,e,g,i],queryFn:async()=>{if(!e)throw Error(`No path`);let t=Oe(e),n=De(e);if(p){let r=await ne(a,g);if(t===`text`){let t=new TextEncoder().encode(r);return ke(t.buffer)?{path:e,kind:`binary`,text:null,staticUrl:`data:application/octet-stream;base64,${Z(t.buffer)}`,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:r,staticUrl:`data:${n};charset=utf-8;base64,${Z(t.buffer)}`,mimeType:n}}return{path:e,kind:t,text:null,staticUrl:`data:${n};base64,${Z(new TextEncoder().encode(r).buffer)}`,mimeType:n}}if(!f)throw Error(`No workspace session`);let r=Se(f,e);if(t!==`text`)return{path:e,kind:t,text:null,staticUrl:r,mimeType:n};let i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to read ${e}: ${i.status}`);let o=await i.arrayBuffer();return ke(o)?{path:e,kind:`binary`,text:null,staticUrl:r,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:new TextDecoder(`utf-8`,{fatal:!1}).decode(o),staticUrl:r,mimeType:n}},enabled:n&&!!a&&!!e&&(p||!!f),retry:!1,staleTime:1e3*5,gcTime:1e3*60,meta:{disableToast:!0}})}function je(){let{data:e,isLoading:t}=R(),n=e?.id?te(e.id):null;return{hasAttachedSource:!!e?.selected_repository||!!n?.selected_workspace,isLoading:t}}function Me(e){let{data:t}=R(),n=j(),{backend:r}=p(),i=r.kind===`local`,a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.workspace?.working_dir?.trim(),u=(e?.enabled??!0)&&i&&n&&!!a&&!!l,d=s({queryKey:[`has-git-commits`,a,o,c,l],queryFn:async()=>(await pe.executeCommand(o,c,`git rev-parse --verify HEAD`,l,10)).exit_code===0,enabled:u,retry:!1,staleTime:6e4,gcTime:5*6e4,meta:{disableToast:!0}});return{hasCommits:d.data??null,isLoading:d.isLoading}}var Ne=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Pe=new Set([`view`]),Fe=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function Ie(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Ne.has(t.kind)||t.command&&Pe.has(t.command))}function Le(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Fe.has(t.kind)}function Re(){let e=r(),t=ae(e=>e.events),n=X(e=>e.bump),i=(0,H.useRef)(new Set),a=(0,H.useRef)(new WeakSet);(0,H.useEffect)(()=>{let r=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?a.current.has(e):i.current.has(t))||(t===void 0?a.current.add(e):i.current.add(t),Ie(e)?r=!0:Le(e)&&(o=!0))}!r&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),r&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var ze=[`index.html`,`index.htm`,`readme.md`,`readme`,`main.html`,`app.html`,`index.js`,`index.ts`,`index.tsx`,`index.jsx`,`main.py`,`app.py`,`main.go`,`main.rs`,`main.java`,`main.c`,`main.cpp`,`package.json`,`pyproject.toml`,`cargo.toml`,`go.mod`,`pom.xml`,`dockerfile`,`makefile`],Be=[`license`,`license.md`,`license.txt`,`changelog.md`,`agents.md`,`tsconfig.json`,`.env.sample`,`.env.example`];function Ve(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()}function He(e){return e.split(`/`).filter(Boolean).length-1}function Ue(e){let t=Ve(e),n=ze.indexOf(t);if(n!==-1)return n;let r=Be.indexOf(t);return r===-1?1e4:1e3+r}function We(e){return[...e].sort((e,t)=>{let n=He(e)-He(t);if(n!==0)return n;let r=Ue(e)-Ue(t);return r===0?e.localeCompare(t):r})}function Ge({paths:e,selectedPath:t,onSelectFile:n,isTreeVisible:r,onToggleTree:a}){let{t:o}=i(`openhands`),s=(0,H.useMemo)(()=>We(e),[e]);return(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]`,"data-testid":`file-quick-row`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:a,"data-testid":`file-quick-row-tree-toggle`,"aria-pressed":r,"aria-label":o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),title:o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),className:g(`shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer`,`text-[var(--oh-text-tertiary)] hover:bg-tertiary`,r&&`bg-[var(--oh-surface-raised)]`),children:(0,U.jsx)(w,{className:`w-3 h-3`,"aria-hidden":!0,strokeWidth:2})}),s.length>0&&(0,U.jsx)(`div`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0`,children:s.map(e=>{let r=t===e;return(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(e),title:e,"data-testid":`file-quick-row-item-${e}`,className:g(`inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer`,r?`bg-[var(--oh-interactive-hover)] text-white`:`bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary`),children:e},e)})})]})}var Ke=new Set([`html`,`htm`,`svg`]),qe={pptx:`PowerPoint`,ppt:`PowerPoint`,docx:`Word`,doc:`Word`,xlsx:`Excel`,xls:`Excel`};function Je(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Q({path:e}){let{t}=i(`openhands`),n=qe[Je(e)];return(0,U.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":n?`file-content-viewer-unsupported-document`:`file-content-viewer-binary-fallback`,children:n?t(_.FILES$UNSUPPORTED_DOCUMENT,{type:n}):t(_.FILES$BINARY_FALLBACK)})}function Ye({path:e,viewMode:t}){let{t:n}=i(`openhands`),r=Ae(e),a=X(e=>e.count);if(r.isLoading)return(0,U.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,children:n(_.FILES$LOADING_FILES)});if(r.isError||!r.data)return(0,U.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":`file-content-viewer-error`,children:r.error?.message??n(_.FILES$LOAD_ERROR)});let{kind:o,text:s,staticUrl:c,mimeType:l}=r.data,u=Ce(c,a);return t===`plain`?o===`text`&&s!==null?(0,U.jsx)(de,{path:e,text:s,mimeType:l??void 0}):(0,U.jsx)(Q,{path:e}):o===`image`?(0,U.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-[var(--oh-surface)] p-4`,"data-testid":`file-content-viewer-image`,children:(0,U.jsx)(`img`,{src:u,alt:e,className:`max-h-full max-w-full object-contain`})}):o===`pdf`?(0,U.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`binary`?(0,U.jsx)(Q,{path:e}):l===`text/html`||Ke.has(Je(e))?(0,U.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`text`&&b(e)?(0,U.jsx)(`div`,{"data-testid":`file-content-viewer-markdown`,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]`,children:(0,U.jsx)(`div`,{className:`prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]`,children:(0,U.jsx)(ce,{content:s??``,includeStandard:!0,includeHeadings:!0})})}):o===`text`&&s!==null?(0,U.jsx)(de,{path:e,text:s,mimeType:l??void 0}):(0,U.jsx)(Q,{path:e})}var Xe=e=>(0,U.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 13 15`,fill:`none`,...e,children:(0,U.jsx)(`path`,{d:`M6.59467 0.21967C6.88756 -0.0732233 7.36244 -0.0732233 7.65533 0.21967L9.90533 2.46967C10.1982 2.76256 10.1982 3.23744 9.90533 3.53033L7.65533 5.78033C7.36244 6.07322 6.88756 6.07322 6.59467 5.78033C6.30178 5.48744 6.30178 5.01256 6.59467 4.71967L7.56434 3.75H6.375C3.71421 3.75 1.5 5.96421 1.5 8.625C1.5 11.2858 3.71421 13.5 6.375 13.5C9.03579 13.5 11.25 11.2858 11.25 8.625C11.25 8.21079 11.5858 7.875 12 7.875C12.4142 7.875 12.75 8.21079 12.75 8.625C12.75 12.1142 9.86421 15 6.375 15C2.88579 15 0 12.1142 0 8.625C0 5.13579 2.88579 2.25 6.375 2.25H7.56434L6.59467 1.28033C6.30178 0.987437 6.30178 0.512563 6.59467 0.21967Z`,fill:`currentColor`})}),Ze=()=>{let{conversationId:e}=z(),{data:t}=R(),n=j(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),c=H.useMemo(()=>q(a,o),[a,o]),l=s({queryKey:[`git_commits`,e,r,i,c],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return K.getGitCommits(r,i,c,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:l.data?.commits??[],hasMore:l.data?.hasMore??!1,isUnsupported:l.data===null,isLoading:l.isLoading,isFetching:l.isFetching,isSuccess:l.isSuccess,isError:l.isError}},Qe=e=>(0,U.jsx)(`svg`,{width:13,height:8,viewBox:`0 0 13 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,U.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.259766 6.17427L6.26425 0.715628L12.2688 6.17427L11.2597 7.28418L6.26425 2.74282L1.26878 7.28418L0.259766 6.17427Z`,fill:`currentColor`})}),$e=e=>{let{conversationId:t}=z(),{data:n}=R(),r=n?.conversation_url,i=n?.session_api_key,a=n?.selected_repository,o=n?.workspace?.working_dir?.trim(),c=H.useMemo(()=>`${q(a,o)}/${e.filePath}`,[a,e.filePath,o]),l=e.type===`D`;return s({queryKey:e.commit?[`commit_file_diff`,t,r,i,e.commit,c]:[`file_diff`,t,r,i,c],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return K.getGitChangeDiff(t,r,i,c,e.commit)},enabled:e.enabled&&(!l||!!e.commit),staleTime:e.commit?1/0:1e3*60*5,gcTime:1e3*60*15})};function et({className:e}){let{t}=i(`openhands`);return(0,U.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:g(`animate-spin rounded-full border-4 border-transparent border-t-white`,e),role:`status`,"aria-label":t(_.HOME$LOADING)})})}function tt({height:e,children:t}){return(0,U.jsx)(`div`,{"data-testid":`editor-container`,className:`w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]`,style:{"--editor-height":`${e}px`},children:t})}var nt=[{mode:`old`,icon:E},{mode:`diff`,icon:x},{mode:`new`,icon:k}],rt={renderValidationDecorations:`off`,readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},automaticLayout:!0,scrollbar:{alwaysConsumeMouseWheel:!1}},it={A:C,D,M:T,R:`Renamed`,U:`Untracked`},at=e=>{e.editor.defineTheme(`custom-diff-theme`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`6a9955`},{token:`keyword`,foreground:`569cd6`},{token:`string`,foreground:`ce9178`},{token:`number`,foreground:`b5cea8`}],colors:{"diffEditor.insertedTextBackground":`#014b01AA`,"diffEditor.removedTextBackground":`#750000AA`,"diffEditor.insertedLineBackground":`#003f00AA`,"diffEditor.removedLineBackground":`#5a0000AA`,"diffEditor.border":`var(--oh-border-subtle)`,"editorUnnecessaryCode.border":`#00000000`,"editorUnnecessaryCode.opacity":`rgba(0, 0, 0, 0.467)`}})};function ot({path:e,type:t,commit:n}){let{t:r}=i(`openhands`),[a,o]=H.useState(!0),[s,c]=H.useState(400),[l,u]=H.useState(`diff`),d=H.useRef(null),f=H.useRef(null),p=t===`A`||t===`U`,m=t===`D`,h=H.useMemo(()=>{if(t===`R`){let t=e.split(/\s+/).slice(1);return t[t.length-1]}return e},[e,t]),{data:y,isLoading:b,isSuccess:x,isRefetching:C}=$e({filePath:h,type:t,enabled:!a,commit:n}),w=H.useCallback(()=>{if(!d.current)return;let e=d.current.getOriginalEditor(),t=d.current.getModifiedEditor();e&&t&&c(Math.max(e.getContentHeight(),t.getContentHeight())+20)},[]),T=H.useCallback(()=>{f.current&&c(f.current.getContentHeight()+20)},[]),E=e=>{d.current=e,w(),e.getOriginalEditor().onDidContentSizeChange(w),e.getModifiedEditor().onDidContentSizeChange(w)},D=e=>{f.current=e,T(),e.onDidContentSizeChange(T)},k=(t===`U`?it.A:it[t])||`?`,A=typeof k==`string`?(0,U.jsx)(ie.Text,{children:k}):H.createElement(k,{className:`w-5 h-5`}),j=b||C,M=v(h),N=M===`markdown`,P=l===`old`?y?.original??``:y?.modified??``;return(0,U.jsxs)(`div`,{"data-testid":`file-diff-viewer-outer`,className:`w-full flex flex-col`,children:[(0,U.jsx)(`div`,{className:`flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer`,onClick:()=>o(e=>!e),children:(0,U.jsxs)(`span`,{className:`text-sm w-full text-content flex items-center gap-2`,children:[j?(0,U.jsx)(et,{className:`w-4 h-4`}):A,(0,U.jsx)(`strong`,{className:`w-full truncate font-medium`,children:h}),!a&&!m&&(0,U.jsx)(`span`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:nt.map(({mode:e,icon:t})=>(0,U.jsx)(`button`,{"data-testid":`view-mode-${e}`,type:`button`,"aria-pressed":l===e,onClick:()=>u(e),className:g(`p-1 rounded transition-colors cursor-pointer`,l===e?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-white`),children:(0,U.jsx)(t,{className:`w-4 h-4`})},e))}),(0,U.jsx)(`button`,{"data-testid":`collapse`,type:`button`,children:(0,U.jsx)(Qe,{className:g(`w-4 h-4 transition-transform`,a&&`transform rotate-180`)})})]})}),!a&&m&&!n&&(0,U.jsx)(`div`,{"data-testid":`file-deleted-message`,className:`w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm`,children:r(_.DIFF_VIEWER$FILE_DELETED)}),!a&&(!m||!!n)&&x&&(l===`diff`?(0,U.jsx)(tt,{height:s,children:(0,U.jsx)(S,{"data-testid":`file-diff-viewer`,className:`w-full h-full`,language:M,original:p?``:y?.original??``,modified:m?``:y?.modified??``,theme:`custom-diff-theme`,onMount:E,beforeMount:at,options:{...rt,renderSideBySide:!p&&!m,hideUnchangedRegions:{enabled:!0}}})}):N?(0,U.jsx)(`div`,{className:`w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none`,"data-testid":`markdown-preview`,children:(0,U.jsx)(ce,{content:P,includeStandard:!0,includeHeadings:!0})}):(0,U.jsx)(tt,{height:s,children:(0,U.jsx)(O,{"data-testid":`file-single-viewer`,className:`w-full h-full`,language:M,value:P,theme:`custom-diff-theme`,beforeMount:at,onMount:D,options:rt})}))]})}function $(){return(0,U.jsx)(T,{"aria-hidden":!0,className:`size-full`})}function st(){let{t:e}=i(`openhands`);return(0,U.jsx)(V,{icon:(0,U.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_CHANGES)})}var ct=[{key:_.TIPS$CUSTOMIZE_MICROAGENT,link:`https://docs.all-hands.dev/usage/prompting/microagents-repo`},{key:_.TIPS$SETUP_SCRIPT,link:`https://docs.all-hands.dev/usage/prompting/repository#setup-script`},{key:_.TIPS$VSCODE_INSTANCE},{key:_.TIPS$SAVE_WORK},{key:_.TIPS$SPECIFY_FILES,link:`https://docs.all-hands.dev/usage/prompting/prompting-best-practices`},{key:_.TIPS$HEADLESS_MODE,link:`https://docs.all-hands.dev/usage/how-to/headless-mode`},{key:_.TIPS$CLI_MODE,link:`https://docs.all-hands.dev/usage/how-to/cli-mode`},{key:_.TIPS$GITHUB_HOOK,link:`https://docs.all-hands.dev/usage/cloud/github-installation#working-on-github-issues-and-pull-requests-using-openhands`},{key:_.TIPS$BLOG_SIGNUP,link:`https://www.all-hands.dev/blog`},{key:_.TIPS$API_USAGE,link:`https://docs.all-hands.dev/api-reference/health-check`}];function lt(){return ct[Math.floor(Math.random()*ct.length)]}function ut(){let{t:e}=i(`openhands`),[t,n]=H.useState(lt());return H.useEffect(()=>{n(lt())},[]),(0,U.jsx)(`div`,{className:`w-full bg-tertiary p-4 text-left`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(y,{className:`mt-0.5 h-4 w-4 shrink-0 fill-[var(--oh-muted)]`,"aria-hidden":!0}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h4`,{className:`text-sm font-semibold text-[var(--oh-text-tertiary)]`,children:e(_.TIPS$PROTIP)}),(0,U.jsxs)(`p`,{className:`text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:[e(t.key),t.link?(0,U.jsxs)(U.Fragment,{children:[` `,(0,U.jsx)(`a`,{href:t.link,target:`_blank`,rel:`noopener noreferrer`,className:`underline transition-colors hover:text-white`,children:e(_.TIPS$LEARN_MORE)})]}):null]})]})]})})}var dt=/not a git repository/i,ft=new Set([_.DIFF_VIEWER$WAITING_FOR_RUNTIME,_.DIFF_VIEWER$LOADING]);function pt({messages:e}){let{t}=i(`openhands`);return e.length===1&&ft.has(e[0])?(0,U.jsx)(L,{testId:`changes-tab-status`,messageKey:e[0]}):(0,U.jsx)(V,{icon:(0,U.jsx)($,{}),children:e.map(e=>(0,U.jsx)(`span`,{className:`block`,children:t(e)},e))})}function mt(){let{data:e,isSuccess:t,isError:n,error:r,isLoading:i}=J(),[a,o]=H.useState(null),{curAgentState:s}=se(),c=!h.includes(s),u=r&&dt.test(l(r));return H.useEffect(()=>{if(!c)o([_.DIFF_VIEWER$WAITING_FOR_RUNTIME]);else if(r){let e=l(r);dt.test(e)?o([_.DIFF_VIEWER$NOT_A_GIT_REPO,_.DIFF_VIEWER$ASK_OH]):o([e])}else o(i?[_.DIFF_VIEWER$LOADING]:null)},[c,u,i,r,o]),(0,U.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:!t||!e.length?(0,U.jsxs)(`div`,{className:`flex flex-col h-full w-full`,children:[(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[a&&(0,U.jsx)(pt,{messages:a}),!a&&t&&e.length===0&&(0,U.jsx)(st,{})]}),!n&&t&&e.length===0&&(0,U.jsx)(ut,{})]}):(0,U.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:e.slice(0,100).map(e=>(0,U.jsx)(ot,{path:e.path,type:e.status},e.path))})})}var ht=(e,t)=>{let{conversationId:n}=z(),{data:r}=R(),i=j(),a=r?.conversation_url,o=r?.session_api_key,c=r?.selected_repository,l=r?.workspace?.working_dir?.trim(),u=H.useMemo(()=>q(c,l),[c,l]);return s({queryKey:[`commit_changes`,n,a,o,u,e],queryFn:async()=>{if(!n)throw Error(`No conversation ID`);return K.getCommitChanges(a,o,u,e)},staleTime:1/0,gcTime:1e3*60*15,retry:!1,enabled:t.enabled&&i&&!!n,meta:{disableToast:!0}})};function gt({commit:e,showAuthor:t,isExpanded:n,onToggle:r}){let{t:a}=i(`openhands`),{data:o,isLoading:s,isSuccess:c}=ht(e.sha,{enabled:n});return(0,U.jsxs)(`div`,{"data-testid":`commit-row`,className:`w-full flex flex-col`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,"data-testid":`commit-row-toggle`,className:`w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer`,children:[(0,U.jsx)(`code`,{className:`font-mono text-xs text-[var(--oh-muted)] flex-shrink-0`,children:e.shortSha}),(0,U.jsx)(`strong`,{className:`flex-1 truncate font-medium`,children:e.subject}),t&&(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate max-w-32 flex-shrink-0`,children:e.author}),(0,U.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] flex-shrink-0`,children:`${re(e.timestamp)} ${a(_.CONVERSATION$AGO)}`}),(0,U.jsx)(Qe,{className:g(`w-4 h-4 transition-transform flex-shrink-0`,!n&&`transform rotate-180`)})]}),n&&(0,U.jsxs)(`div`,{"data-testid":`commit-row-content`,className:`w-full flex flex-col pl-6`,children:[s&&(0,U.jsx)(`div`,{className:`p-3`,children:(0,U.jsx)(et,{className:`w-4 h-4`})}),c&&o?.map(t=>(0,U.jsx)(ot,{path:t.path,type:t.status,commit:e.sha},t.path))]})]})}function _t({commits:e,hasMore:t}){let{t:n}=i(`openhands`),[r,a]=H.useState(null),o=new Set(e.map(e=>e.author)).size>1;return(0,U.jsxs)(`section`,{"data-testid":`commit-list`,className:`w-full flex flex-col`,children:[e.map(e=>(0,U.jsx)(gt,{commit:e,showAuthor:o,isExpanded:r===e.sha,onToggle:()=>a(t=>t===e.sha?null:e.sha)},e.sha)),t&&(0,U.jsx)(`div`,{"data-testid":`commit-list-cap-notice`,className:`px-3 py-2.5 text-xs text-[var(--oh-muted)]`,children:n(_.DIFF_VIEWER$COMMITS_CAP,{count:e.length})})]})}function vt(){let{t:e}=i(`openhands`),{conversationId:t}=z(),{commits:n,hasMore:r,isUnsupported:a,isLoading:o,isSuccess:s}=Ze(),{curAgentState:c}=se(),l=!h.includes(c);return(0,U.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:s&&!a&&n.length>0?(0,U.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:(0,U.jsx)(_t,{commits:n,hasMore:r},t)}):(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[!l&&(0,U.jsx)(L,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$WAITING_FOR_RUNTIME}),l&&o&&(0,U.jsx)(L,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$LOADING}),l&&!o&&(0,U.jsx)(V,{icon:(0,U.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_COMMITS)})]})})}function yt(){let{t:e}=i(`openhands`);Re();let{hasAttachedSource:t,isLoading:n}=je(),{hasCommits:a}=Me({enabled:t}),{conversationId:o}=oe(),{state:s,setFilesTabDiffView:c,setFilesTabContentViewMode:l}=P(o??``),u=(t||n)&&a!==!1,d=s.filesTabDiffView??u,f=s.filesTabContentViewMode,{isSuccess:p,isUnsupported:m}=Ze(),h=p&&!m,[g,v]=(0,H.useState)(!1),y=d?`on`:`off`;g&&h&&(y=`commits`);let[b,x]=(0,H.useState)(!1),S=be(),C=(0,H.useMemo)(()=>S.data??[],[S.data]),w=B(e=>e.selectedPath),T=B(e=>e.selectedConversationId),E=B(e=>e.setSelectedPath),D=T===o?w:null,O=(0,H.useCallback)(e=>E(e,o),[o,E]),k=Ae(D),A=X(e=>e.count),j=Ce(k.data?.staticUrl??null,A);(0,H.useEffect)(()=>{T!==o&&E(null,o)},[T,o,E]),(0,H.useEffect)(()=>{if(D||C.length===0)return;let[e]=We(C);e&&E(e,o)},[C,D,o,E]);let M=r(),{refetch:N,isFetching:F}=J(),te=()=>{N(),M.invalidateQueries({queryKey:[`workspace-files`]}),M.invalidateQueries({queryKey:[`workspace-file-content`]}),M.invalidateQueries({queryKey:[`git_commits`]})};return(0,U.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,U.jsx)(ee,{ariaLabel:e(_.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:y,options:[{value:`on`,label:e(_.FILES$DIFF_VIEW)},...h?[{value:`commits`,label:e(_.DIFF_VIEWER$COMMITS)}]:[],{value:`off`,label:e(_.COMMON$FILES)}],onChange:e=>{e===`commits`?v(!0):(v(!1),c(e===`on`))}}),y===`off`&&(0,U.jsx)(ee,{ariaLabel:e(_.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:f,options:[{value:`rich`,label:e(_.FILES$RICH)},{value:`plain`,label:e(_.FILES$PLAIN)}],onChange:l}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[y===`off`&&j&&(0,U.jsx)(`a`,{href:j,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e(_.FILES$OPEN_IN_NEW_WINDOW),title:e(_.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,U.jsx)(le,{width:14,height:14})}),(0,U.jsx)(`button`,{type:`button`,onClick:te,disabled:F,"aria-label":e(_.FILES$REFRESH),title:e(_.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,U.jsx)(Xe,{width:12.75,height:15,color:`#ffffff`,className:F?`animate-spin`:``})})]})]}),y===`on`&&(0,U.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,U.jsx)(mt,{})}),y===`commits`&&(0,U.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,U.jsx)(vt,{})}),y===`off`&&(0,U.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:S.isLoading?(0,U.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:e(_.FILES$LOADING_FILES)}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ge,{paths:C,selectedPath:D,onSelectFile:O,isTreeVisible:b,onToggleTree:()=>x(e=>!e)}),(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[b&&(0,U.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,U.jsx)(ue,{paths:C,selectedPath:D,onSelectFile:O})}),(0,U.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:D?(0,U.jsx)(Ye,{path:D,viewMode:f}):(0,U.jsx)(fe,{})})]})]})})]})}export{yt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`Free`,t={"openhands/glm-5.2":`OpenHands GLM-5.2 (free)`,"openhands/deepseek-v4-flash":`OpenHands DeepSeek V4 Flash (free)`,"openhands/minimax-m2.7":`OpenHands MiniMax M2.7 (free)`},n=`Free OpenHands models: ${Object.keys(t).join(`, `)}. Other provider endpoints with similar model names may require separate billing.`,r=e=>!!(e&&e in t);function i(e){return e?r(e)?t[e]:e:null}function a(e){return e?r(e)?t[e]:e.split(`/`).pop()||e:null}export{r as a,a as i,n,i as r,e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{t as r,z as i}from"./utils-zxEjKE70.js";import{t as a}from"./loader-circle-B47W9XqT.js";import{t as o}from"./styled-tooltip-BUMSbgrF.js";import{a as s}from"./kebab-menu-item-content-BGoGFEAg.js";import{t as c}from"./automation-C_eCrGyP.js";e();var l=t(),u=e=>(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),d=e=>(0,l.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),f={[c.COMPLETED]:{label:i.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`,iconTone:`text-[var(--oh-success)]`},[c.FAILED]:{label:i.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`,iconTone:`text-danger`},[c.PENDING]:{label:i.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`,iconTone:`text-muted`},[c.RUNNING]:{label:i.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`,iconTone:`text-muted`},[c.CANCELLED]:{label:i.AUTOMATIONS$DETAIL$CANCELLED,style:`border-[var(--oh-border)] bg-surface-raised text-muted`,iconTone:`text-muted`},[c.SKIPPED]:{label:i.AUTOMATIONS$DETAIL$SKIPPED,style:`border-[var(--oh-border)] bg-surface-raised text-muted`,iconTone:`text-muted`}};function p({status:e,compact:t=!1}){let n=t?`size-3`:`size-3.5`;switch(e){case c.COMPLETED:return(0,l.jsx)(u,{"data-testid":`run-status-icon-completed`,className:n});case c.FAILED:return(0,l.jsx)(d,{"data-testid":`run-status-icon-failed`,className:n});case c.RUNNING:return(0,l.jsx)(a,{"data-testid":`run-status-icon-running`,className:r(n,`animate-spin motion-reduce:animate-none`),"aria-hidden":`true`});default:return(0,l.jsx)(s,{"data-testid":`run-status-icon-pending`,className:n})}}function m({status:e,iconOnly:t=!1,showLabel:i=!1,compact:a=!1}){let{t:s}=n(`openhands`),u=f[e]??f[c.PENDING],d=s(u.label);return t?i?(0,l.jsxs)(`span`,{"data-testid":`run-status-badge-icon`,className:r(`inline-flex min-w-0 shrink-0 items-center gap-1.5 text-xs font-medium`,u.iconTone),children:[(0,l.jsx)(p,{status:e,compact:a}),(0,l.jsx)(`span`,{className:`truncate`,children:d})]}):(0,l.jsx)(o,{content:d,placement:`top`,children:(0,l.jsx)(`span`,{role:`img`,"aria-label":d,"data-testid":`run-status-badge-icon`,className:r(`inline-flex shrink-0 cursor-default items-center justify-center`,u.iconTone),children:(0,l.jsx)(p,{status:e,compact:a})})}):(0,l.jsxs)(`span`,{className:r(`inline-flex items-center rounded-full border font-medium`,a?`gap-1 px-1.5 py-0 text-[10px] leading-4`:`gap-1.5 px-2.5 py-1 text-xs`,u.style),children:[(0,l.jsx)(p,{status:e,compact:a}),d]})}function h(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function g(e,t,n){let r=Date.now()-new Date(e).getTime(),a=Math.floor(r/6e4),o=Math.floor(r/36e5),s=Math.floor(r/864e5);return a<1?n(i.AUTOMATIONS$DETAIL$TIME_JUST_NOW):a<60?n(i.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:a}):o<24?n(i.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:o}):s===1?n(i.AUTOMATIONS$DETAIL$TIME_YESTERDAY):s<7?n(i.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:s}):h(e,t)}export{u as i,g as n,m as r,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dh9v73sa-rfV8mQ9m.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-D5DWZVc7.js";import{D as i,T as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-B8i84bh4.js";import{t as o}from"./useMutation-BFDQmgk9.js";import{At as s,kt as c}from"./active-backend-context-IqOjobNK.js";import{C as l,i as u,t as d,z as f}from"./utils-zxEjKE70.js";import{a as p,o as m,t as h}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-d7svw-BB.js";import{t as g}from"./use-tracking-CVwPmhlX.js";import{n as _}from"./navigation-context-CQZwH_tC.js";import{t as v}from"./dist-Bl64nBZL.js";import{n as y}from"./conversation-store-Blc5xysY.js";import{t as b}from"./agent-server-conversation-service.api-DWBe0rbX.js";import{d as x,u as S}from"./conversation-state-store-C5YpjMNy.js";var C=i(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),w=i(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),T=t(),E=v(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function D({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,T.jsx)(`div`,{"data-testid":a,role:`separator`,className:d(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,T.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,T.jsx)(`div`,{"data-testid":a,role:`separator`,className:d(E({orientation:e,color:t,size:n,inset:r}),i)})}var O=()=>{let e=n();return o({mutationFn:e=>b.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{y(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},k=()=>{let{t:e}=r(`openhands`),t=n(),{conversationId:i,navigate:u}=_();return o({mutationKey:[`stop-conversation`],mutationFn:async e=>x(e.conversationId),onMutate:async()=>{let n=a.loading(e(f.TOAST$STOPPING_CONVERSATION),c);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&a.dismiss(i.toastId),s(e(f.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(n,r,o)=>{o?.toastId&&a.dismiss(o.toastId),a.success(e(f.TOAST$CONVERSATION_STOPPED),c),S(t,r.conversationId,{execution_status:l.PAUSED,sandbox_status:`PAUSED`}),i===r.conversationId&&u(`/conversations`)}})};function A(e){return e===`MISSING`||e===`ERROR`}e();var j=e=>(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,T.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),M=e=>(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,T.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),N=e=>(0,T.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,T.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),P=e=>(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,T.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),F=()=>{let{trackDownloadTrajectoryButtonClicked:e}=g(),{t}=r(`openhands`);return o({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),u(await b.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{s(t(f.CONVERSATION$DOWNLOAD_ERROR))}})};function I({gitProvider:e,className:t}){return(0,T.jsxs)(T.Fragment,{children:[e===`github`&&(0,T.jsx)(p,{size:14,className:t}),e===`gitlab`&&(0,T.jsx)(m,{size:14,className:t}),e===`bitbucket`&&(0,T.jsx)(h,{size:14,className:t}),e===`bitbucket_data_center`&&(0,T.jsx)(h,{size:14,className:t}),e===`azure_devops`&&(0,T.jsx)(N,{className:d(t,`w-[14px] h-[14px]`)})]})}export{M as a,k as c,w as d,C as f,N as i,O as l,F as n,j as o,P as r,A as s,I as t,D as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./git-repo-dropdown-ByMzpNko.js";
|