@openhands/agent-canvas 1.0.0-rc.7 → 1.0.0-rc.9
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 -3
- package/README.windows.md +2 -2
- package/build/assets/{QueryClientProvider-2bFjjuvv.js → QueryClientProvider-XcSjsfpb.js} +1 -1
- package/build/assets/{Trans-D1xHkKyr.js → Trans-sy4l4TyQ.js} +1 -1
- package/build/assets/{acp-providers-Djbp2WMV.js → acp-providers-Dzb4nxxB.js} +1 -1
- package/build/assets/{active-backend-context-BiVlte2V.js → active-backend-context-B2OSC-qe.js} +1 -1
- package/build/assets/add-backend-modal-lG8XDYjr.js +1 -0
- package/build/assets/{agent-server-adapter-BD6kvwWb.js → agent-server-adapter-BPpZcLOE.js} +3 -3
- package/build/assets/agent-server-client-options-wXLeJYeM.js +1 -0
- package/build/assets/{agent-server-conversation-service.api-8AC86rC5.js → agent-server-conversation-service.api-C4Fc9Jnp.js} +1 -1
- package/build/assets/{agent-settings-DycVwGfd.js → agent-settings-Blipgztd.js} +1 -1
- package/build/assets/{alert-banner-BUqPui_3.js → alert-banner-Bsvys-hT.js} +1 -1
- package/build/assets/{analytics-consent-form-modal-D0KeG5vZ.js → analytics-consent-form-modal-Cujm1lCj.js} +1 -1
- package/build/assets/{api-key-entry-screen-BnvQM0v5.js → api-key-entry-screen-BarZU9nr.js} +1 -1
- package/build/assets/{app-settings-FRYUtG-Z.js → app-settings-CofRfixq.js} +1 -1
- package/build/assets/{automation-detail-DiIq3Vsh.js → automation-detail-BV4Cn0O8.js} +1 -1
- package/build/assets/{automations-list-DQn7k1Ix.js → automations-list-BaJ61q7P.js} +1 -1
- package/build/assets/{back-nav-button-B8eULM4t.js → back-nav-button-D20Avel_.js} +1 -1
- package/build/assets/{backend-form-modal-DY3My0us.js → backend-form-modal-B3BCZDPq.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BW2WPX-c.js → backend-synced-settings-badge-Da0G6Lwv.js} +1 -1
- package/build/assets/{base-modal-B_MCb3rx.js → base-modal-DvuGYyu1.js} +1 -1
- package/build/assets/{brand-button-B6g_UvEG.js → brand-button-9SOzmqPP.js} +1 -1
- package/build/assets/{browser-tab-DVHx54yn.js → browser-tab-bveyJhG9.js} +1 -1
- package/build/assets/{chat-send-button-Ce9rK8Vd.js → chat-send-button-DzRpAQr4.js} +1 -1
- package/build/assets/{checkmark-BQIxLn5W.js → checkmark--JWAesua.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-DRwQ4Z7K.js → circle-plus-check-toggle-AO9DWyDX.js} +1 -1
- package/build/assets/{close-HybccyBS.js → close--W-tHn1h.js} +1 -1
- package/build/assets/{code-tag-DZCEX2zo.js → code-tag-chmctf4w.js} +1 -1
- package/build/assets/{combobox-caret-kEa3kTvf.js → combobox-caret-C9BNHfSu.js} +1 -1
- package/build/assets/{condenser-settings-BlbT8YRd.js → condenser-settings-Bo07FAEi.js} +1 -1
- package/build/assets/{confirmation-modal-CG_Fgrny.js → confirmation-modal-Cq3eqvqH.js} +1 -1
- package/build/assets/{context-menu-list-item-CvJv3-kq.js → context-menu-list-item-BQU0jZPq.js} +1 -1
- package/build/assets/conversation-DDdRyW4z.js +19 -0
- package/build/assets/conversation-panel-Dww2uJOd.js +1 -0
- package/build/assets/conversation-rGQV1Eym.js +1 -0
- package/build/assets/{conversation-service.api-CngSQhPh.js → conversation-service.api-ByRiRU1e.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-B5eOSEGv.js → conversation-tab-empty-state-C8tztloo.js} +1 -1
- package/build/assets/{copy-D6CyDz2n.js → copy-CdKN5rtJ.js} +1 -1
- package/build/assets/{declaration-BDfM67Kl.js → declaration-D9ucT0fq.js} +1 -1
- package/build/assets/{device-verify-CAevP6_3.js → device-verify-YuGXnpRk.js} +1 -1
- package/build/assets/{dropdown-classes-CL8egwz_.js → dropdown-classes-CVp0kVdt.js} +1 -1
- package/build/assets/{edit-automation-modal-CwLfhSMN.js → edit-automation-modal-CpA_JKLY.js} +1 -1
- package/build/assets/{ellipsis-button-Db-AwbLv.js → ellipsis-button-k7HLwYth.js} +1 -1
- package/build/assets/{entry.client-BKDpKmdB.js → entry.client-DUpefbBp.js} +2 -2
- package/build/assets/{enum-filter-dropdown-DnYXhc1E.js → enum-filter-dropdown-COqUq3mB.js} +1 -1
- package/build/assets/{environment-switch-overlay-BgYKFdf6.js → environment-switch-overlay-wB5LxfYZ.js} +1 -1
- package/build/assets/{extensions-hub-CgisT2wb.js → extensions-hub-BYCLWP3d.js} +1 -1
- package/build/assets/{extensions-navigation-nurGkQe5.js → extensions-navigation-3FLKfb6g.js} +1 -1
- package/build/assets/{files-tab-DIyAYvp0.js → files-tab-CBUPwSV1.js} +1 -1
- package/build/assets/{files-tab-store-RScGdwu8.js → files-tab-store-DSKUhziI.js} +1 -1
- package/build/assets/{folder-IChmji2Y.js → folder-DPTBlxWb.js} +1 -1
- package/build/assets/home-BDCL0Psk.js +1 -0
- package/build/assets/{install-server-modal-C8fylTet.js → install-server-modal-CWZhBKwH.js} +1 -1
- package/build/assets/{launch-BNiqgTvz.js → launch-CMZknx1e.js} +1 -1
- package/build/assets/{lesson-plan-BdmMvboE.js → lesson-plan-y520IDs6.js} +1 -1
- package/build/assets/{lightbulb-DzViGAuw.js → lightbulb-S616sGEL.js} +1 -1
- package/build/assets/{link-external-Dwv3oQAx.js → link-external-ooNztGLp.js} +1 -1
- package/build/assets/{llm-client-P9f2gKeW.js → llm-client-D6EtdLBs.js} +1 -1
- package/build/assets/llm-not-configured-banner-CJyURBCm.js +27 -0
- package/build/assets/llm-settings-BW6yW2Go.js +1 -0
- package/build/assets/{llm-settings-B92l1Z2N.js → llm-settings-CiY22Wzi.js} +1 -1
- package/build/assets/{loading-spinner-Dtm7y-w5.js → loading-spinner-D7bOU6I7.js} +1 -1
- package/build/assets/{manage-backends-modal-qpq2M_oN.js → manage-backends-modal-v5POMal5.js} +1 -1
- package/build/assets/manifest-eccb7f46.js +1 -0
- package/build/assets/{markdown-renderer-Dt0RXhUJ.js → markdown-renderer-z446oW0Z.js} +1 -1
- package/build/assets/{mcp-BKdD21xY.js → mcp-DgPFZ_Dv.js} +1 -1
- package/build/assets/{messages-Ch8Rd1cx.js → messages-Dq6AQ8mp.js} +1 -1
- package/build/assets/{modal-backdrop-DmDLoot0.js → modal-backdrop-_VbcKk5K.js} +1 -1
- package/build/assets/{modal-body-BWjhfiSa.js → modal-body-Cd-PtMHr.js} +1 -1
- package/build/assets/{modal-classes-DbJbhQCW.js → modal-classes-CNm4ovfm.js} +1 -1
- package/build/assets/{modal-close-button-DXN6uYvt.js → modal-close-button-Dbo0NAMt.js} +1 -1
- package/build/assets/{model-selector-BMn4D5v6.js → model-selector-CdZs21EZ.js} +1 -1
- package/build/assets/{navigation-context-BrRCrWhm.js → navigation-context-BpAOh_t5.js} +1 -1
- package/build/assets/{navigation-link-qUrH_I5_.js → navigation-link-Dci7Nuyf.js} +1 -1
- package/build/assets/{onboarding-B50IeNyy.js → onboarding-Cdwu8QIy.js} +1 -1
- package/build/assets/{openhands-logo-DnfHAq7Y.js → openhands-logo-Dzm-d_V_.js} +1 -1
- package/build/assets/{option-service.api-lzN_3s9w.js → option-service.api-CdYnKVsu.js} +1 -1
- package/build/assets/{organization-service.api-CNmSPGj4.js → organization-service.api-CzMvXIQT.js} +1 -1
- package/build/assets/{path-utils-CKgIQZAY.js → path-utils-DKu3CNkH.js} +1 -1
- package/build/assets/{plan-components-D9fU4FFh.js → plan-components-CutRBi0G.js} +1 -1
- package/build/assets/{planner-tab-B7kpsTT8.js → planner-tab-YkOp7QXt.js} +1 -1
- package/build/assets/{profiles-client-BNvHck-I.js → profiles-client-BjUo3q05.js} +1 -1
- package/build/assets/{providers-189W9TJO.js → providers-CbpQft-X.js} +1 -1
- package/build/assets/{proxy--Uy1iGsW.js → proxy-Bx3NeKeo.js} +1 -1
- package/build/assets/{query-client-config-B9ZI-1_w.js → query-client-config-Ca3tW1AH.js} +1 -1
- package/build/assets/{recommended-automations-launcher-C_RcP2yb.js → recommended-automations-launcher-WxaZcjRD.js} +1 -1
- package/build/assets/{root-Bz22PITD.js → root-CiNoOVrb.js} +2 -2
- package/build/assets/{root-layout-B8swq9fS.js → root-layout-DUw-s9LS.js} +2 -2
- package/build/assets/{runtime-waiting-state-DPjfE32a.js → runtime-waiting-state-8i0Z3A_i.js} +1 -1
- package/build/assets/{sdk-section-page-ozvrzW4r.js → sdk-section-page-DPBwwLle.js} +1 -1
- package/build/assets/{sdk-settings-schema-Ck6f2ON9.js → sdk-settings-schema-Big50zDH.js} +1 -1
- package/build/assets/{search-aDWSdSb7.js → search-C_l_XW4e.js} +1 -1
- package/build/assets/{secrets-service-D6Gcymcs.js → secrets-service-Skzza9sx.js} +1 -1
- package/build/assets/{secrets-settings-Bga0bwB1.js → secrets-settings-DmpsTC9V.js} +1 -1
- package/build/assets/{settings-DHAhcPm2.js → settings-ChsRtIJQ.js} +1 -1
- package/build/assets/{settings-dropdown-input-N0FtDFkk.js → settings-dropdown-input-BP-arqjU.js} +1 -1
- package/build/assets/{settings-gear-D8ao16bi.js → settings-gear-f-zWpxfI.js} +1 -1
- package/build/assets/{settings-index-CJvQH5ls.js → settings-index-BLfmrKRl.js} +1 -1
- package/build/assets/{settings-input-CyWJBrqC.js → settings-input-BM8ANxDb.js} +1 -1
- package/build/assets/{settings-list-classes-CYRnRf8r.js → settings-list-classes-B9uo5WES.js} +1 -1
- package/build/assets/{settings-modal-BeAlR7Be.js → settings-modal-Cth7Zb-I.js} +1 -1
- package/build/assets/{settings-section-header-context-1fN7Xkb3.js → settings-section-header-context-Cid25HM2.js} +1 -1
- package/build/assets/{settings-service.api-CFt5HmXD.js → settings-service.api-CcpckquT.js} +1 -1
- package/build/assets/{settings-switch-D3aEIphL.js → settings-switch-xa6q4M6j.js} +1 -1
- package/build/assets/{shared-conversation-CtRf6CQN.js → shared-conversation-Y0C8zqdr.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DkYaKR6Q.js → sidebar-mobile-menu-toggle-BvcBXvLY.js} +1 -1
- package/build/assets/{sidebar-nav-link-CzeuB4So.js → sidebar-nav-link-BekRAssb.js} +1 -1
- package/build/assets/{skill-card-pill-row-CvLCLqqD.js → skill-card-pill-row-DeodrwPG.js} +1 -1
- package/build/assets/{skills-jKeJCunm.js → skills-BE5HJuGM.js} +1 -1
- package/build/assets/{skills-client-Ui_9FvXp.js → skills-client-CgraS-wA.js} +1 -1
- package/build/assets/{skills-plugins-juwPhlEE.js → skills-plugins-rIza_fUf.js} +1 -1
- package/build/assets/{skills-settings-BW09n_Px.js → skills-settings-Dvl7gpEx.js} +1 -1
- package/build/assets/{styled-tooltip-B3wz8m5E.js → styled-tooltip-X61SEwqk.js} +1 -1
- package/build/assets/{suspense-BpkWt-39.js → suspense-Bqb0V0q1.js} +1 -1
- package/build/assets/{switch-skeleton-Cl_Nh2kt.js → switch-skeleton-BbIWemkK.js} +1 -1
- package/build/assets/{task-list-tab-DKnHShLG.js → task-list-tab-BFnyHGsn.js} +1 -1
- package/build/assets/{telemetry-DR_3fMN0.js → telemetry-CAWBJ_rB.js} +1 -1
- package/build/assets/{terminal-BFi5FOMc.js → terminal-B92mACR5.js} +1 -1
- package/build/assets/{terminal-CZH2h1J3.js → terminal-BFypysgZ.js} +1 -1
- package/build/assets/{toggle-switch-BzaEofjj.js → toggle-switch-CL_wRiGs.js} +1 -1
- package/build/assets/{typography-BFj4IzMj.js → typography-BLSEGjph.js} +1 -1
- package/build/assets/{u-check-circle-Cs2GOrZ7.js → u-check-circle-dG_VJqx5.js} +1 -1
- package/build/assets/{u-check-circle-half-DGgLKVV1.js → u-check-circle-half-D-5ZPRnd.js} +1 -1
- package/build/assets/{u-circuit-DniZPNAV.js → u-circuit-BXoisXOA.js} +1 -1
- package/build/assets/{u-edit-BvTiDr33.js → u-edit-DIgADxLH.js} +1 -1
- package/build/assets/{use-acp-credential-form-8yHKY_py.js → use-acp-credential-form-Dj7Jkhgp.js} +1 -1
- package/build/assets/{use-active-conversation-CLzls6XV.js → use-active-conversation-BkohEtaN.js} +1 -1
- package/build/assets/{use-agent-settings-schema-BCXxH2N-.js → use-agent-settings-schema-Lf_lBAky.js} +1 -1
- package/build/assets/{use-agent-state-BocVPR5S.js → use-agent-state-DITv5qV7.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-BjDwnldw.js → use-cloud-current-user-id-CSm3kgqy.js} +1 -1
- package/build/assets/use-config-DVU9HaPf.js +1 -0
- package/build/assets/{use-create-conversation-CIkPp9u9.js → use-create-conversation-CJUAOf1q.js} +1 -1
- package/build/assets/{use-create-secret-Bwy6457V.js → use-create-secret-LObNBU3M.js} +1 -1
- package/build/assets/{use-handle-plan-click-CjNwpDeO.js → use-handle-plan-click-BdcdMWbv.js} +1 -1
- package/build/assets/use-is-authed-B8eLO-Xq.js +1 -0
- package/build/assets/{use-launch-skill-in-chat-QmcJQxUY.js → use-launch-skill-in-chat-BTgXIu3N.js} +1 -1
- package/build/assets/{use-llm-profiles-CZD1ALup.js → use-llm-profiles-BBTR-OsK.js} +1 -1
- package/build/assets/use-runtime-is-ready-BOQpqCvp.js +1 -0
- package/build/assets/{use-save-settings-BjYPOrtF.js → use-save-settings-7_MLft-Y.js} +1 -1
- package/build/assets/{use-settings-YTDcMvj1.js → use-settings-CNsxccvQ.js} +1 -1
- package/build/assets/{use-settings-nav-items-DMit9adK.js → use-settings-nav-items-ykMjd_NG.js} +1 -1
- package/build/assets/{use-skills-fh_U4ZGe.js → use-skills-_unimM2d.js} +1 -1
- package/build/assets/{use-tracking-DJ3Z7ha1.js → use-tracking-C9P88zSo.js} +1 -1
- package/build/assets/{use-user-conversation-Ct93yaXj.js → use-user-conversation-2jZZ-MLA.js} +1 -1
- package/build/assets/{useMutation-B1gQr_yr.js → useMutation-Dm84WAKR.js} +1 -1
- package/build/assets/{useQuery-CbqdITLM.js → useQuery-DGRSm7IT.js} +1 -1
- package/build/assets/{useTranslation-C-T8J2U-.js → useTranslation-CL6FTf1b.js} +1 -1
- package/build/assets/{utils-CXRkUr73.js → utils-eXk6yerZ.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation-CkFCLbQW.js → vendor~conversation-panel~conversation-D98u43rl.js} +1 -1
- package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-C1BmvJX4.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dqpi2xyZ.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-RuHTcYaf.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-7eqKdLSQ.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-B04AZhMW.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-BP3MGAAY.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-D7ZsdcLa.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ceijy54y-Dkd2wxJA.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-CGm-Jxp5.js → vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-DQE89epK.js} +1 -1
- package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DH07jaIY.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DavKsAvB.js} +186 -40
- package/build/assets/{vendor~root-layout~home~mcp~automations-list-COlx7Is6.js → vendor~root-layout~home~mcp~automations-list-D40jgugf.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-DuiHR4ce.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BIm99UaF.js} +1 -1
- package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-4yr76Evz.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-xCM3k6Rd.js} +1 -1
- package/build/assets/{verification-settings-CeIuPtF2.js → verification-settings-EUkt_CkZ.js} +1 -1
- package/build/assets/{x-mark-BMhi11Sg.js → x-mark-C42svtnu.js} +1 -1
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +45 -40
- package/build/locales/ca/openhands.json +41 -36
- package/build/locales/de/openhands.json +42 -37
- package/build/locales/en/openhands.json +6 -1
- package/build/locales/es/openhands.json +44 -39
- package/build/locales/fr/openhands.json +44 -39
- package/build/locales/it/openhands.json +44 -39
- package/build/locales/ja/openhands.json +44 -39
- package/build/locales/ko-KR/openhands.json +44 -39
- package/build/locales/no/openhands.json +44 -39
- package/build/locales/pt/openhands.json +44 -39
- package/build/locales/tr/openhands.json +43 -38
- package/build/locales/uk/openhands.json +44 -39
- package/build/locales/zh-CN/openhands.json +44 -39
- package/build/locales/zh-TW/openhands.json +44 -39
- package/config/defaults.json +4 -4
- package/dist/components/features/backends/backend-form-modal.cjs +1 -1
- package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
- package/dist/components/features/backends/backend-form-modal.js +1 -1
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/features/chat/chat-interface.cjs +1 -1
- package/dist/components/features/chat/chat-interface.cjs.map +1 -1
- package/dist/components/features/chat/chat-interface.js +1 -1
- package/dist/components/features/chat/chat-interface.js.map +1 -1
- package/dist/components/features/chat/git-control-bar.cjs +1 -1
- package/dist/components/features/chat/git-control-bar.cjs.map +1 -1
- package/dist/components/features/chat/git-control-bar.js +1 -1
- package/dist/components/features/chat/git-control-bar.js.map +1 -1
- package/dist/components/features/chat/open-repository-modal.cjs +1 -1
- package/dist/components/features/chat/open-repository-modal.cjs.map +1 -1
- package/dist/components/features/chat/open-repository-modal.js +0 -3
- package/dist/components/features/chat/open-repository-modal.js.map +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs +1 -1
- package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
- package/dist/components/features/chat/pending-user-messages.js +31 -28
- package/dist/components/features/chat/pending-user-messages.js.map +1 -1
- package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.cjs +1 -1
- package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.cjs.map +1 -1
- package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.js +79 -77
- package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.js.map +1 -1
- package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.cjs +1 -1
- package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.cjs.map +1 -1
- package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.js +67 -65
- package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.js.map +1 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs +1 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.cjs.map +1 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.js +2 -2
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.js.map +1 -1
- package/dist/components/features/settings/settings-navigation.cjs +1 -1
- package/dist/components/features/settings/settings-navigation.cjs.map +1 -1
- package/dist/components/features/settings/settings-navigation.js +1 -1
- package/dist/components/features/settings/settings-navigation.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.cjs +1 -1
- package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar.js +3 -2
- package/dist/components/features/sidebar/sidebar.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +6 -1
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +3 -3
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +612 -527
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +45 -40
- package/dist/locales/ca/openhands.json +41 -36
- package/dist/locales/de/openhands.json +42 -37
- package/dist/locales/en/openhands.json +6 -1
- package/dist/locales/es/openhands.json +44 -39
- package/dist/locales/fr/openhands.json +44 -39
- package/dist/locales/it/openhands.json +44 -39
- package/dist/locales/ja/openhands.json +44 -39
- package/dist/locales/ko-KR/openhands.json +44 -39
- package/dist/locales/no/openhands.json +44 -39
- package/dist/locales/pt/openhands.json +44 -39
- package/dist/locales/tr/openhands.json +43 -38
- package/dist/locales/uk/openhands.json +44 -39
- package/dist/locales/zh-CN/openhands.json +44 -39
- package/dist/locales/zh-TW/openhands.json +44 -39
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +186 -40
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +2 -2
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dist/utils/websocket-url.cjs +1 -1
- package/dist/utils/websocket-url.cjs.map +1 -1
- package/dist/utils/websocket-url.js +2 -2
- package/dist/utils/websocket-url.js.map +1 -1
- package/package.json +2 -2
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +149 -59
- package/scripts/dev-safe.mjs +1 -1
- package/build/assets/add-backend-modal-CSfOPrnr.js +0 -1
- package/build/assets/agent-server-client-options-B-C8JaTb.js +0 -1
- package/build/assets/conversation-B7ztPdyS.js +0 -1
- package/build/assets/conversation-DZYd8QiZ.js +0 -19
- package/build/assets/conversation-panel-CklMXcs6.js +0 -1
- package/build/assets/home-iVOrSOWL.js +0 -1
- package/build/assets/llm-not-configured-banner-BQgVTo0O.js +0 -27
- package/build/assets/llm-settings-ICWFhhjM.js +0 -1
- package/build/assets/manifest-d230d4a5.js +0 -1
- package/build/assets/use-config-C4DX1-nF.js +0 -1
- package/build/assets/use-is-authed-7P3xSsit.js +0 -1
- package/build/assets/use-runtime-is-ready-B7sbw-q5.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=class extends Error{constructor(e,t,n,r){super(r||`HTTP ${e}: ${t}`),this.status=e,this.statusText=t,this.response=n,this.name=`HttpError`}},t=class{constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.apiKey=e.apiKey,this.timeout=e.timeout||6e4}async request(t){let n=t.url.startsWith(`/`)?t.url.slice(1):t.url,r=new URL(n,this.baseUrl+`/`);t.params&&Object.entries(t.params).forEach(([e,t])=>{t!=null&&(Array.isArray(t)?t.forEach(t=>r.searchParams.append(e,String(t))):r.searchParams.append(e,String(t)))});let i={"Content-Type":`application/json`,...t.headers};this.apiKey&&(i[`X-Session-API-Key`]=this.apiKey);let a={method:t.method,headers:i,signal:AbortSignal.timeout(t.timeout||this.timeout)};t.credentials&&(a.credentials=t.credentials),t.data&&t.method!==`GET`&&(t.data instanceof FormData?(delete i[`Content-Type`],a.body=t.data):a.body=JSON.stringify(t.data));try{let n=await fetch(r.toString(),a);if(!(t.acceptableStatusCodes?.has(n.status)||!t.acceptableStatusCodes&&n.ok)){let t;try{t=n.headers.get(`content-type`)?.includes(`application/json`)?await n.json():await n.text()}catch{t=null}throw new e(n.status,n.statusText,t,`HTTP request failed (${n.status} ${n.statusText}): ${JSON.stringify(t)}`)}let i=await this.parseResponse(n,t.responseType||`auto`),o={};return n.headers.forEach((e,t)=>{o[t]=e}),{data:i,status:n.status,statusText:n.statusText,headers:o}}catch(n){throw n instanceof e?n:n instanceof Error?n.name===`AbortError`?Error(`Request timeout after ${t.timeout||this.timeout}ms`,{cause:n}):Error(`Request failed: ${n.message}`,{cause:n}):Error(`Unknown request error`,{cause:n})}}async parseResponse(e,t){return t===`json`?await e.json():t===`text`?await e.text():t===`blob`?await e.blob():t===`arrayBuffer`?await e.arrayBuffer():e.headers.get(`content-type`)?.includes(`application/json`)?await e.json():await e.text()}async get(e,t){return this.request({method:`GET`,url:e,...t})}async post(e,t,n){return this.request({method:`POST`,url:e,data:t,...n})}async put(e,t,n){return this.request({method:`PUT`,url:e,data:t,...n})}async patch(e,t,n){return this.request({method:`PATCH`,url:e,data:t,...n})}async delete(e,t){return this.request({method:`DELETE`,url:e,...t})}close(){}},n=class{constructor(e){this.host=e.host.replace(/\/$/,``),this.apiKey=e.apiKey,this.client=new t({baseUrl:this.host,apiKey:this.apiKey,timeout:e.timeout||6e4})}async getAgentSchema(){return(await this.client.get(`/api/settings/agent-schema`)).data}async getSettings(e={}){return(await this.client.get(`/api/settings`,{headers:e.exposeSecrets?{"X-Expose-Secrets":e.exposeSecrets}:void 0})).data}async updateSettings(e){return(await this.client.patch(`/api/settings`,e)).data}async listSecrets(){return(await this.client.get(`/api/settings/secrets`)).data}async upsertSecret(e){return(await this.client.put(`/api/settings/secrets`,e)).data}async getSecret(e){return(await this.client.get(`/api/settings/secrets/${encodeURIComponent(e)}`,{responseType:`text`})).data}async deleteSecret(e){return(await this.client.delete(`/api/settings/secrets/${encodeURIComponent(e)}`)).data}async getConversationSchema(){return(await this.client.get(`/api/settings/conversation-schema`)).data}async listProfiles(){return(await this.client.get(`/api/profiles`)).data}async getProfile(e,t={}){return(await this.client.get(`/api/profiles/${encodeURIComponent(e)}`,{headers:t.exposeSecrets?{"X-Expose-Secrets":t.exposeSecrets}:void 0})).data}async saveProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}`,t)).data}async deleteProfile(e){return(await this.client.delete(`/api/profiles/${encodeURIComponent(e)}`)).data}async renameProfile(e,t){return(await this.client.post(`/api/profiles/${encodeURIComponent(e)}/rename`,{new_name:t})).data}close(){this.client.close()}};function r(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function i(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function a(e){let t=r(e),n=i(e);return`${window.location.protocol===`https:`?`https:`:`http:`}//${t}${n}`}function o(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function s(e,t){let n=r(e),a=i(e),s=window.location.protocol===`https:`,c=o(e)===`https:`,l=`${s||c?`wss:`:`ws:`}//${n}${a}/sockets/bash-events`;return t?`${l}?session_api_key=${encodeURIComponent(t)}`:l}function c(e,t){if(!e)return null;let n=r(t),a=i(t),s=window.location.protocol===`https:`,c=o(t)===`https:`;return`${s||c?`wss:`:`ws:`}//${n}${a}/sockets/events/${e}`}var l=`workspace/project`;function u(e){return e?.trim()||null}function ee(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function d(){return ee(void 0)}function f(){let e=u(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return u(e)}return null}function p(){return{baseUrl:m()??``,sessionApiKey:h()??``}}function m(){return d()||(typeof window<`u`?window.location.origin:null)}function h(){return f()}function g(){return(void 0)?.trim()||l}function _(e){return`${g().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function v(){let e=h();return e?{"X-Session-API-Key":e}:{}}function y(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function b(){return y()?!h():!1}var x=`default-local`,S=`Local`;function C(){let e=m(),t=h();return!e||!t?null:{id:x,name:S,host:e,apiKey:t,kind:`local`}}var w=`openhands-backends`,T=`openhands-active-backend`,E=`openhands-agent-server-config`;function D(e){return e===`local`||e===`cloud`}function te(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&D(t.kind)}function ne(e){if(typeof e!=`string`)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`http://${t}`:null}function re(){let e=window.localStorage.getItem(E);if(!e)return null;try{let t=JSON.parse(e),n=ne(t.baseUrl),r=typeof t.sessionApiKey==`string`?t.sessionApiKey.trim():``;return!n||!r?null:{id:x,name:S,host:n,apiKey:r,kind:`local`}}catch{return null}}function O(){window.localStorage.removeItem(E)}function k(e){return N(e),O(),e}function A(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function j(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||A(e.host)&&A(t.host)}function M(e){let t=C();if(!t)return e;let n=!1,r=e.map(e=>!j(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(N(r),r):e}function N(e){if(!(typeof window>`u`))try{window.localStorage.setItem(w,JSON.stringify(e))}catch{}}function P(){if(typeof window>`u`)return[];try{let e=window.localStorage.getItem(w);if(e===null){let e=re();if(e)return k([e]);let t=C();return t?k([t]):[]}let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=t.filter(te);if(n.length===0){let e=C();return e?k([e]):[]}let r=M(n);return O(),r}catch{return[]}}function F(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function I(e,t){try{return e?.getItem(t)??null}catch{return null}}function L(e,t,n){try{e?.setItem(t,n)}catch{}}function R(e,t){try{e?.removeItem(t)}catch{}}function z(){return typeof window>`u`?null:F(I(window.sessionStorage,T))||F(I(window.localStorage,T))}function B(e){if(typeof window>`u`)return;if(!e){R(window.sessionStorage,T),R(window.localStorage,T);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});L(window.sessionStorage,T,t),L(window.localStorage,T,t)}var V=`no-backend`,H={id:V,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function U(e){return e.id===V}function W(e){return e[0]??H}function G(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=W(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var K=G(P(),z()),q=new Set;function J(){q.forEach(e=>e())}function Y(){return K.active}function X(){let e=K.active.backend;return e.kind===`local`&&!U(e)?e:null}function ie(){return K.backends}function ae(){return K.selection}function oe(){return K}function se(e){B(e),K=G(K.backends,e),J()}function ce(e){N(e);let t=K.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,B(null)),K=G(e,t),J()}function le(e){return q.add(e),()=>{q.delete(e)}}var Z=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function Q(e){return e.replace(/\/+$/,``)}function ue(e,t){return e.host?Q(e.host):e.conversationUrl?Q(a(e.conversationUrl)):Q(t?.host??``)}function $(e={}){let t=X();if(!t&&!e.host&&!e.conversationUrl)throw new Z;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:ue(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??g(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function de(e){let{host:t,apiKey:n,timeout:r}=$(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}export{b as C,n as D,c as E,t as O,y as S,a as T,_,Y as a,v as b,ie as c,se as d,ce as f,l as g,C as h,H as i,e as k,oe as l,S as m,$ as n,ae as o,le as p,de as r,X as s,Z as t,U as u,m as v,s as w,g as x,p as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-DZYd8QiZ.js";export{e as default};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/files-tab-DIyAYvp0.js","assets/rolldown-runtime-BFRubm34.js","assets/vendor~files-tab--640YzQO.js","assets/iconBase-BVhFI-0E.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~mcp~settings~settings-index~~m3acswdn-CGm-Jxp5.js","assets/agent-server-client-options-B-C8JaTb.js","assets/active-backend-context-BiVlte2V.js","assets/declaration-BDfM67Kl.js","assets/query-client-config-B9ZI-1_w.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~dqseey1n-D_BSEDk4.js","assets/createLucideIcon-CkGTf9Qj.js","assets/utils-CXRkUr73.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~nh19ovoo-DJTFnsA1.js","assets/common-Dh7OqABE.js","assets/QueryClientProvider-2bFjjuvv.js","assets/useQuery-CbqdITLM.js","assets/suspense-BpkWt-39.js","assets/mouse-pointer-click-D0QNGSIo.js","assets/useTranslation-C-T8J2U-.js","assets/context-CI9FqkUp.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-C1BmvJX4.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BoE6JRJj.js","assets/objectWithoutPropertiesLoose-DSQKyRhw.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DMOoHVBy.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BNExlCqT.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DX2CmDJ0.js","assets/vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DCn1M97v.js","assets/agent-server-adapter-BD6kvwWb.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~mcp~automati~dou5smdo-DH07jaIY.js","assets/proxy--Uy1iGsW.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~bxn4ldi1-_LydBB1e.js","assets/settings-service.api-CFt5HmXD.js","assets/settings-wh2sLLJM.js","assets/acp-providers-Djbp2WMV.js","assets/react-Dy05vyj5.js","assets/runtime-waiting-state-DPjfE32a.js","assets/loading-spinner-Dtm7y-w5.js","assets/typography-BFj4IzMj.js","assets/dist-5dObF4p4.js","assets/conversation-tab-empty-state-B5eOSEGv.js","assets/markdown-renderer-Dt0RXhUJ.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CsO1gYxF.js","assets/checkmark-BQIxLn5W.js","assets/copy-D6CyDz2n.js","assets/use-active-conversation-CLzls6XV.js","assets/conversation-service.api-CngSQhPh.js","assets/agent-server-conversation-service.api-8AC86rC5.js","assets/profiles-client-BNvHck-I.js","assets/navigation-context-BrRCrWhm.js","assets/use-user-conversation-Ct93yaXj.js","assets/use-agent-state-BocVPR5S.js","assets/conversation-state-store-NEktJKfL.js","assets/use-runtime-is-ready-B7sbw-q5.js","assets/files-tab-store-RScGdwu8.js","assets/folder-IChmji2Y.js","assets/lightbulb-DzViGAuw.js","assets/link-external-Dwv3oQAx.js","assets/use-event-store-DNSmyzUh.js","assets/conversation-local-storage-an3MiIiJ.js","assets/git-status-mapper-BI8FyUVp.js","assets/browser-tab-DVHx54yn.js","assets/external-link-BATfjnkz.js","assets/vendor~browser-tab-BGJDGHyS.js","assets/browser-store-JRrcGdlk.js","assets/planner-tab-B7kpsTT8.js","assets/list-todo-nCa9zxVE.js","assets/conversation-store-FQmakEd-.js","assets/plan-components-D9fU4FFh.js","assets/brand-button-B6g_UvEG.js","assets/use-handle-plan-click-CjNwpDeO.js","assets/use-create-conversation-CIkPp9u9.js","assets/useMutation-B1gQr_yr.js","assets/use-llm-profiles-CZD1ALup.js","assets/use-tracking-DJ3Z7ha1.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BmOMM-6e.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-Cl4h-NSi.js","assets/use-settings-YTDcMvj1.js","assets/task-list-tab-DKnHShLG.js","assets/use-task-list-E5t-jtgs.js","assets/u-check-circle-half-DGgLKVV1.js","assets/u-check-circle-Cs2GOrZ7.js","assets/terminal-CZH2h1J3.js","assets/vendor~terminal-DyxmaTEx.js","assets/vendor~terminal-T4IDBjWs.css","assets/square-chevron-right-BWAB7NPp.js","assets/command-store-UzKGSUC2.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,L as i,M as a,k as o}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{t as s}from"./react-dom-hVBnwgwZ.js";import{c,i as l,r as u,s as d}from"./path-utils-CKgIQZAY.js";import{n as f,r as p}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{t as m}from"./useMutation-B1gQr_yr.js";import{o as h,t as g}from"./declaration-BDfM67Kl.js";import{n as _}from"./QueryClientProvider-2bFjjuvv.js";import{t as v}from"./useQuery-CbqdITLM.js";import{t as y}from"./Trans-D1xHkKyr.js";import{t as b}from"./useTranslation-C-T8J2U-.js";import{f as x,m as S,p as C}from"./query-client-config-B9ZI-1_w.js";import{a as w,c as T,d as E,f as D,i as O,l as k,m as A,n as j,o as M,p as ee,r as te,s as ne,t as N,u as re}from"./messages-Ch8Rd1cx.js";import{c as ie,d as P,f as F,i as I,l as L,n as R,p as ae,r as oe,s as se,t as ce,u as le}from"./sidebar-mobile-menu-toggle-DkYaKR6Q.js";import{t as ue}from"./external-link-BATfjnkz.js";import{t as z}from"./globe-Dpgjreyy.js";import{t as de}from"./list-todo-nCa9zxVE.js";import{t as fe}from"./loader-circle-1XB9nbwF.js";import{n as pe,r as me,t as B}from"./vendor~conversation-panel~conversation-CkFCLbQW.js";import{t as V}from"./square-chevron-right-BWAB7NPp.js";import{t as he}from"./x-CCfDppg5.js";import{C as ge,P as _e,S as H,T as ve,b as ye,c as be,d as xe,l as Se,m as Ce,o as we,t as U,u as Te,w as Ee,x as De,y as Oe}from"./utils-CXRkUr73.js";import{t as ke}from"./common-Dh7OqABE.js";import{a as Ae,w as je}from"./agent-server-client-options-B-C8JaTb.js";import{n as W}from"./active-backend-context-BiVlte2V.js";import{i as Me,t as Ne}from"./agent-server-conversation-service.api-8AC86rC5.js";import{t as Pe}from"./modal-backdrop-DmDLoot0.js";import{n as Fe}from"./modal-body-BWjhfiSa.js";import{r as Ie}from"./base-modal-B_MCb3rx.js";import{t as Le}from"./brand-button-B6g_UvEG.js";import{t as Re}from"./loading-spinner-Dtm7y-w5.js";import{n as ze}from"./navigation-context-BrRCrWhm.js";import{h as Be}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-B04AZhMW.js";import{O as Ve}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-RuHTcYaf.js";import{t as He}from"./styled-tooltip-B3wz8m5E.js";import{r as Ue,u as We}from"./dropdown-classes-CL8egwz_.js";import{_ as Ge,c as Ke,h as qe,m as Je,r as Ye,y as Xe}from"./chat-send-button-Ce9rK8Vd.js";import{t as Ze}from"./proxy--Uy1iGsW.js";import{t as Qe}from"./react-Dy05vyj5.js";import{r as $e,t as G}from"./conversation-store-FQmakEd-.js";import{i as et,s as tt}from"./conversation-local-storage-an3MiIiJ.js";import{t as nt}from"./modal-close-button-DXN6uYvt.js";import{s as rt,u as it}from"./agent-server-adapter-BD6kvwWb.js";import{t as at}from"./use-is-authed-7P3xSsit.js";import{t as ot}from"./use-click-outside-element-DhxCUyWl.js";import{r as st}from"./use-settings-YTDcMvj1.js";import{t as ct}from"./use-tracking-DJ3Z7ha1.js";import{t as lt}from"./use-create-conversation-CIkPp9u9.js";import{r as ut,t as dt}from"./conversation-service.api-CngSQhPh.js";import{n as ft,t as K}from"./context-menu-list-item-CvJv3-kq.js";import{i as q,r as pt,t as mt}from"./ellipsis-button-Db-AwbLv.js";import{t as ht}from"./u-edit-BvTiDr33.js";import{t as gt}from"./skills-jKeJCunm.js";import{t as _t}from"./use-user-conversation-Ct93yaXj.js";import{t as vt}from"./conversation-state-store-NEktJKfL.js";import{r as yt}from"./typography-BFj4IzMj.js";import{A as bt,B as xt,C as St,D as Ct,E as wt,F as Tt,I as Et,M as Dt,N as Ot,O as kt,R as At,S as jt,T as Mt,_ as Nt,a as Pt,b as Ft,f as It,g as Lt,h as Rt,i as zt,j as Bt,k as Vt,m as Ht,n as Ut,o as Wt,p as Gt,r as Kt,t as qt,v as Jt,w as Yt,x as Xt,y as Zt}from"./llm-not-configured-banner-BQgVTo0O.js";import{n as J,r as Qt,t as Y}from"./use-active-conversation-CLzls6XV.js";import{t as X}from"./use-agent-state-BocVPR5S.js";import{a as $t,c as en,d as tn,f as nn,l as rn,m as an,n as on,p as Z,r as sn,s as cn,u as ln}from"./lesson-plan-BdmMvboE.js";import{C as un,a as dn,d as fn,o as pn,t as mn}from"./use-event-store-DNSmyzUh.js";import{t as hn}from"./command-store-UzKGSUC2.js";import{t as gn}from"./copy-D6CyDz2n.js";import{t as _n}from"./use-runtime-is-ready-B7sbw-q5.js";import{r as vn}from"./plan-components-D9fU4FFh.js";import{t as yn}from"./use-breakpoint-DpxHDmuH.js";import{t as bn}from"./use-task-list-E5t-jtgs.js";import{t as xn}from"./vendor~conversation-panel~conversation~alert-banner-CtjHOMO_.js";var Q=e(t(),1),Sn={curAgentState:H.LOADING},Cn=Qe(e=>({...Sn,setCurrentAgentState:t=>e({curAgentState:t}),reset:()=>e(Sn)})),wn=`openhands-last-conversation-by-backend`;function Tn(e,t){return t?`${e}::${t}`:e}function En(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(wn);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 Dn(e){if(!(typeof window>`u`))try{window.localStorage.setItem(wn,JSON.stringify(e))}catch{}}function On(e,t,n){if(!n)return;let r=En();r[Tn(e,t)]=n,Dn(r)}function kn(e,t){let n=En(),r=Tn(e,t);r in n&&(delete n[r],Dn(n))}var An=e=>({action:ee.CHANGE_AGENT_STATE,args:{agent_state:e}}),jn=e=>`error`in e,Mn=e=>`type`in e&&e.type===`error`,Nn=()=>{let{send:e}=D(),t=mn(e=>e.events);Q.useEffect(()=>{if(!t.length)return;let n=t[t.length-1];if(!(pn(n)&&dn(n))){if(jn(n)){if(n.error_code===401){C(`Session expired.`);return}typeof n.error==`string`?C(n.error):C(n.message);return}Mn(n)&&`${n.message??``}`.startsWith(`Agent reached maximum`)&&e(An(H.PAUSED))}},[t.length])},Pn=()=>{let{curAgentState:e}=X();return{runtimeActive:!ge.includes(e)}};function Fn({children:e}){return Nn(),Pn(),e}var $=h(),In=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,$.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),Ln={entriesByConversation:{}},Rn=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:n(e.entriesByConversation[t]??[])}}),zn=Qe()($e(e=>({...Ln,addPending:(t,n)=>{let r=it();return e(e=>Rn(e,t,e=>[...e,{id:r,question:n,status:`pending`}])),r},resolve:(t,n,r)=>e(e=>Rn(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`done`}:e))),fail:(t,n,r)=>e(e=>Rn(e,t,e=>e.map(e=>e.id===n?{...e,response:r,status:`error`}:e))),dismiss:(t,n)=>e(e=>Rn(e,t,e=>e.filter(e=>e.id!==n)))}),{name:`BtwStore`}));function Bn({onClick:e}){let{t}=b(`openhands`);return(0,$.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,$.jsx)(In,{className:`w-3.5 h-3.5 fill-success`}),(0,$.jsx)(`span`,{children:t(g.CHAT_INTERFACE$BTW_GOT_IT)})]})}function Vn({conversationId:e}){let{t}=b(`openhands`),n=zn(e=>e.entriesByConversation),r=zn(e=>e.dismiss),i=e?n[e]??[]:[];return!e||i.length===0?null:(0,$.jsx)(`div`,{"data-testid":`btw-messages`,className:`flex flex-col w-full`,children:i.map(n=>{let i=n.status===`pending`;return(0,$.jsx)(re,{title:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`opacity-60`,children:t(g.CHAT_INTERFACE$BTW_PREFIX)}),(0,$.jsx)(`span`,{children:n.question}),i&&(0,$.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(g.CHAT_INTERFACE$BTW_WAITING_FOR_ANSWER):n.response??``,initiallyExpanded:!i,chevronPosition:`before`,titleTrailing:!i&&(0,$.jsx)(Bn,{onClick:()=>r(e,n.id)})},n.id)})})}var Hn=`${ve} `,Un=(e,t)=>{let n=zn(e=>e.addPending),r=zn(e=>e.resolve),i=zn(e=>e.fail);return(0,Q.useCallback)(a=>{let o=a.trim(),s=o===`/btw`||o.startsWith(Hn);if(!e||!s){t(a);return}let c=o.slice(ve.length).trim();if(!c)return;let l=n(e,c);u(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])},Wn=`flex flex-row gap-1 items-center justify-center rounded-[100px]`;function Gn(e){return U(Wn,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 Kn(e){return e?`white`:`var(--oh-muted)`}var qn=`font-normal text-sm leading-5 truncate`;function Jn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,isConversationReady:r=!0}){let{t:i}=b(`openhands`),{trackPullButtonClick:a}=ct(),o=n&&t&&r;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{a(),e(be())},disabled:!o,className:U(Gn(o),`px-0.5 py-1 w-[76px] min-w-[76px]`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(Ct,{width:12,height:12,color:Kn(o)})}),(0,$.jsx)(`div`,{className:U(qn,`max-w-[76px]`),title:i(g.COMMON$PULL),children:i(g.COMMON$PULL)})]})}function Yn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackPushButtonClick:o}=ct(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(Se(r))},disabled:!s,className:U(Gn(s),`px-2 py-1 w-[77px] min-w-[77px]`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(kt,{width:12,height:12,color:Kn(s)})}),(0,$.jsx)(`div`,{className:U(qn,`max-w-[77px]`),title:a(g.COMMON$PUSH),children:a(g.COMMON$PUSH)})]})}function Xn({onSuggestionsClick:e,hasRepository:t,providerTokensReady:n,currentGitProvider:r,isConversationReady:i=!0}){let{t:a}=b(`openhands`),{trackCreatePrButtonClick:o}=ct(),s=n&&t&&i;return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>{o(),e(we(r))},disabled:!s,className:U(Gn(s),`px-2 py-1 w-[126px] min-w-[126px] h-7`),children:[(0,$.jsx)(`div`,{className:`w-3 h-3 flex items-center justify-center`,children:(0,$.jsx)(wt,{width:12,height:12,color:Kn(s)})}),(0,$.jsx)(`div`,{className:U(qn,`max-w-[126px]`),title:a(g.COMMON$PULL_REQUEST),children:a(g.COMMON$PULL_REQUEST)})]})}function Zn(e){return e.kind===`BashCommand`}function Qn(e){return e.kind===`BashOutput`}function $n(e){return e.kind===`BashError`}function er(e,t,n){let r=(0,Q.useRef)(null),i=(0,Q.useRef)([]),a=(0,Q.useRef)([]),o=(0,Q.useRef)(new Map);return(0,Q.useEffect)(()=>{if(!n)return;let s=je(e,t),c=new WebSocket(s);r.current=c,c.onopen=()=>{for(let{command:e,cwd:t,timeout:n,resolve:r,reject:o}of i.current)a.current.push({resolve:r,reject:o}),c.send(JSON.stringify({command:e,cwd:t,timeout:n}));i.current=[]},c.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}if(Zn(t)){let e=a.current.shift();e&&o.current.set(t.id,{...e,stdout:[],stderr:[]})}else if(Qn(t)&&t.command_id){let e=o.current.get(t.command_id);e&&(t.stdout&&e.stdout.push(t.stdout),t.stderr&&e.stderr.push(t.stderr),t.exit_code!=null&&(o.current.delete(t.command_id),e.resolve({exit_code:t.exit_code,stdout:e.stdout.join(``),stderr:e.stderr.join(``)})))}else $n(t)&&l(`Bash error: ${t.code}: ${t.detail}`)};function l(e){let t=Error(e);for(let{reject:e}of i.current)e(t);i.current=[];for(let e of a.current)e.reject(t);a.current=[];for(let e of o.current.values())e.reject(t);o.current.clear()}return c.onclose=()=>{r.current=null,l(`Bash WebSocket closed`)},c.onerror=()=>{r.current=null,l(`Bash WebSocket error`)},()=>{c.onclose=null,c.onerror=null,c.close(),r.current=null,l(`Bash WebSocket unmounted`)}},[n,e,t]),(0,Q.useCallback)((e,t,n)=>new Promise((o,s)=>{let c=r.current;if(!c||c.readyState===WebSocket.CLOSED||c.readyState===WebSocket.CLOSING){s(Error(`Bash WebSocket not available`));return}c.readyState===WebSocket.CONNECTING?i.current.push({command:e,cwd:t,timeout:n,resolve:o,reject:s}):(a.current.push({resolve:o,reject:s}),c.send(JSON.stringify({command:e,cwd:t,timeout:n})))}),[])}var tr={"github.com":`github`,"gitlab.com":`gitlab`,"bitbucket.org":`bitbucket`,"dev.azure.com":`azure_devops`};function nr(e){return e.replace(/\.git$/,``)}function rr(e){return e?tr[e.toLowerCase()]??null:null}function ir(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 ar(e,t,n){let r=nr(n.replace(/^\/+/,``)),i=rr(t);return{url:e,host:t,repository:(i===`azure_devops`?ir(r):r)||null,provider:i}}function or(e){let t=e?.trim();if(!t)return null;let n=t.match(/^[^@\s]+@([^:\s]+):(.+)$/);if(n){let e=n[1];return ar(t,e,n[2])}try{let e=new URL(t);return ar(t,e.hostname||null,e.pathname)}catch{return null}}var sr={repository:null,branch:null,provider:null,remoteUrl:null},cr=[`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 lr(e,t){let n=await e(cr,t,10);if(n.exit_code!==0)return sr;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 sr;let s=or(i);return{repository:s?.repository??null,provider:s?.provider??null,remoteUrl:i||null,branch:o}}var ur=()=>{let{data:e}=Y(),t=_n(),{backend:n}=W(),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=er(a,o,d),p=(0,Q.useRef)(f);return p.current=f,v({queryKey:[`local-git-info`,i,a,o,s],queryFn:async()=>lr((e,t,n)=>p.current(e,t,n),s),enabled:d,retry:!1,staleTime:1e4,refetchInterval:1e4,gcTime:1e3*60*5,meta:{disableToast:!0}})},dr=()=>{let e=_(),{t}=b(`openhands`);return m({mutationFn:e=>Ne.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(g.CONVERSATION$FAILED_TO_UPDATE_REPOSITORY))},onSuccess:()=>{S(t(g.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 fr({children:e,tooltipMessage:t,testId:n,shouldShowTooltip:r}){return r?(0,$.jsx)(He,{content:t,placement:`top`,showArrow:!0,tooltipClassName:`bg-white text-black`,children:(0,$.jsx)(`span`,{"data-testid":n,className:`hover:opacity-100`,children:e})}):e}function pr({isOpen:e,onClose:t,onLaunch:n,defaultProvider:r=`github`}){let{t:i}=b(`openhands`),{providers:a}=Ke(),[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)},[]),h=()=>{!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,$.jsx)(Pe,{onClose:_,children:(0,$.jsxs)(Fe,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,$.jsx)(nt,{onClose:_,testId:`close-open-repository-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(Ie,{title:i(g.CONVERSATION$OPEN_REPOSITORY)})}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:i(g.CONVERSATION$SELECT_OR_INSERT_LINK)}),a.length>1&&(0,$.jsx)(Wt,{providers:a,value:o,placeholder:`Select Provider`,onChange:f})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-[10px] w-full`,children:[(0,$.jsx)(zt,{provider:v,value:c?.id||null,repositoryName:c?.full_name||null,onChange:p,placeholder:`Search repositories...`,className:`w-full`}),(0,$.jsx)(Pt,{repository:c?.full_name||null,provider:v,selectedBranch:u,onBranchSelect:m,defaultBranch:c?.main_branch||null,placeholder:`Select branch...`,disabled:!c,className:`w-full`})]})]}),(0,$.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,$.jsx)(Le,{type:`button`,variant:`secondary`,onClick:_,children:i(g.BUTTON$CANCEL)}),(0,$.jsx)(Le,{type:`button`,variant:`primary`,onClick:h,isDisabled:!y,children:i(g.BUTTON$LAUNCH)})]})]})})}function mr({onSuggestionsClick:e}){let{t}=b(`openhands`),{conversationId:n}=J(),[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),{addRecentRepository:c}=Ye(),l=Z(e=>e.enqueuePendingMessage),u=Z(e=>e.markPendingMessageError),{backend:d}=W(),f=d.kind===`local`,{providers:p}=Ke(),m=f||p.length>0,{data:h}=Y(),{repositoryInfo:_}=Dt(),{data:v}=ur(),y=At(),x=sn()?.isLoadingHistory??!1,S=(0,Q.useRef)(y);(0,Q.useEffect)(()=>{S.current=y},[y]);let{send:w}=D(),E=(0,Q.useRef)(w);(0,Q.useEffect)(()=>{E.current=w},[w]);let O=T(),{mutate:k}=dr(),{mutate:A,isPending:j}=lt(),M=h?.selected_repository||_?.selectedRepository,ee=h?.git_provider||_?.gitProvider,te=h?.selected_branch||_?.selectedBranch,ne=M||v?.repository||void 0,N=ee||v?.provider,re=te||v?.branch||void 0,ie=(h?.id?rt(h.id):null)?.selected_workspace??null,P=ie&&ie.replace(/\/+$/,``).split(`/`).pop()||null,F=!!ne&&!!N,I=!!h&&y===`OPEN`&&!x;(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 L=(e,r)=>{n&&(c(e),k({conversationId:n,repository:e.full_name,branch:r.name,gitProvider:e.git_provider},{onSuccess:()=>{if(S.current!==`OPEN`){C(t(g.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;O?.scrollDomToBottom(),Promise.resolve(E.current({action:`message`,args:{content:a,timestamp:new Date().toISOString()}})).catch(e=>{o&&u(o,e instanceof Error?e.message:`Failed to send message`)})}}))},R=!f||!!ne||!!P,ae=f&&!F;return R||re||F?(0,$.jsxs)(`div`,{className:`flex flex-row items-center`,children:[(0,$.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center overflow-x-auto flex-nowrap relative scrollbar-hide`,children:[R?(0,$.jsx)(Kt,{selectedRepository:ne,gitProvider:N,workspaceName:P,onClick:()=>i(!0),disabled:!I||ae}):null,re?(0,$.jsx)(Ut,{selectedBranch:re,selectedRepository:ne,gitProvider:N}):null,F?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(fr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pull-button-tooltip`,shouldShowTooltip:!F,children:(0,$.jsx)(Jn,{onSuggestionsClick:e,hasRepository:F,providerTokensReady:m,isConversationReady:I})}),(0,$.jsx)(fr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-push-button-tooltip`,shouldShowTooltip:!F,children:(0,$.jsx)(Yn,{onSuggestionsClick:e,hasRepository:F,providerTokensReady:m,currentGitProvider:N,isConversationReady:I})}),(0,$.jsx)(fr,{tooltipMessage:t(g.COMMON$GIT_TOOLS_DISABLED_CONTENT),testId:`git-control-bar-pr-button-tooltip`,shouldShowTooltip:!F,children:(0,$.jsx)(Xn,{onSuggestionsClick:e,hasRepository:F,providerTokensReady:m,currentGitProvider:N,isConversationReady:I})})]}):null]}),(0,$.jsx)(pr,{isOpen:r,onClose:()=>i(!1),onLaunch:L,defaultProvider:N})]}):null}function hr({onSubmit:e,disabled:t=!1}){let{images:n,files:r,imagesMarkedUploadAsFile:i,clearAllFiles:a,subConversationTaskId:o}=G(),{curAgentState:s}=X(),{data:c}=Y(),{conversationId:l}=Qt(),u=l??c?.id??null,{taskStatus:d}=Bt(o,c?.id||null),{handleUpload:f}=It(),p=Ht(u,Un(u,t=>{let{imagesToEmbed:o,imagesAsFiles:s}=xt(n,i);e(t,o,[...r,...s]),a()}));return(0,$.jsxs)(`div`,{"data-testid":`interactive-chat-box`,children:[(0,$.jsx)(Rt,{disabled:t||s===H.AWAITING_USER_CONFIRMATION||Ce(d),isNewConversationPending:t,onSubmit:p,onFilesPaste:f}),(0,$.jsx)(`div`,{className:`mt-3 pb-3`,children:(0,$.jsx)(mr,{onSuggestionsClick:e=>{p(e)}})})]})}function gr(){let e=mn(e=>e.events),t=mn(e=>e.uiEvents),n=Q.useMemo(()=>t.filter(en),[t]),r=Q.useMemo(()=>e,[e]),i=Q.useMemo(()=>n.length,[n]),a=Q.useMemo(()=>r.some(e=>e.source===`agent`&&!un(e)&&!fn(e)),[r]),o=cn(r);return{storeEvents:e,uiEvents:t,renderableEvents:n,allConversationEvents:r,totalEvents:i,hasSubstantiveAgentActions:a,conversationUserEventsExist:o,userEventsExist:o}}var _r=e=>`timestamp`in e?e.timestamp:void 0,vr=e=>{let t=!!e&&et(e),n=t?void 0:e,{data:r}=_t(e??null),{data:i,isFetched:a}=rn(n??void 0),o=mn(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||et(e)||d.current||!f.current||!r)return;let{events:t}=mn.getState(),n=t[0];if(!n)return;let i=_r(n);if(!i){f.current=!1,u(!1);return}d.current=!0,c(!0);try{let t=await tn.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),$t(e,mn.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])}};function yr(){return(0,$.jsxs)(`div`,{className:`flex items-center space-x-1.5 rounded-full bg-[var(--oh-surface)] px-3 py-1.5`,children:[(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:0ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:75ms]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--oh-muted)] animate-[bounce_0.5s_infinite] translate-y-[1px] [animation-delay:150ms]`})]})}function br({suggestion:e,onClick:t}){let{t:n}=b(`openhands`);return(0,$.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,$.jsx)(Mt,{width:24,height:24,color:`#fff`});case`AUTO_MERGE_PRS`:return(0,$.jsx)(Yt,{width:19,height:20,color:`#fff`});case`FIX_README`:return(0,$.jsx)(St,{width:24,height:24,color:`#fff`});case`CLEAN_DEPENDENCIES`:return(0,$.jsx)(jt,{width:24,height:24,color:`#fff`});default:return null}},[e]),(0,$.jsx)(`span`,{"data-testid":`suggestion`,className:`text-[15px] font-normal leading-5 text-white text-center cursor-pointer`,children:n(e.label)})]})}function xr({suggestions:e,onSuggestionClick:t}){return(0,$.jsx)(`div`,{"data-testid":`suggestions`,className:`grid grid-cols-2 gap-5 max-w-fit`,children:e.map((e,n)=>(0,$.jsx)(br,{suggestion:e,onClick:t},n))})}var Sr=g.SUGGESTIONS$HACKER_NEWS,Cr=`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.`,wr=g.SUGGESTIONS$HELLO_WORLD,Tr=`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.`,Er=g.SUGGESTIONS$TODO_APP,Dr=`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.`,Or={repo:Xt,"non-repo":{[Sr]:Cr,[wr]:Tr,[Er]:Dr}};function kr({onSuggestionsClick:e}){let{t}=b(`openhands`),{shouldHideSuggestions:n}=G();return(0,$.jsx)(Ve,{children:!n&&(0,$.jsxs)(B.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,$.jsx)(`div`,{className:`flex flex-col items-center p-4 rounded-xl w-full`,children:(0,$.jsx)(`span`,{className:`pb-6 text-[32px] font-medium leading-5 text-white`,children:t(g.LANDING$TITLE)})}),(0,$.jsx)(xr,{suggestions:Object.entries(Or.repo).slice(0,4).map(([e,t])=>({label:e,value:t})),onSuggestionClick:e})]})})}var Ar={files:[],initialPrompt:null,selectedRepository:null,selectedRepositoryProvider:null,replayJson:null},jr=Qe(e=>({...Ar,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(()=>Ar)})),Mr=e=>(0,$.jsx)(`svg`,{width:12,height:17,viewBox:`0 0 12 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,$.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 Nr({onClick:e}){return(0,$.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,$.jsx)(Mr,{width:15,height:15})})}var Pr=[{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 Fr({width:e,height:t}){return(0,$.jsx)(`div`,{className:U(`rounded-md bg-foreground/5 animate-pulse`,e,t)})}function Ir(){return(0,$.jsx)(`div`,{className:`flex flex-col gap-6 p-4 w-full h-full overflow-hidden`,"data-testid":`chat-messages-skeleton`,"aria-label":`Loading conversation`,children:Pr.map((e,t)=>(0,$.jsx)(`div`,{className:U(`flex w-full`,e.align),children:(0,$.jsx)(Fr,{width:e.width,height:e.height})},t))})}var Lr=220;function Rr({message:e,onDismiss:t,onRetry:n}){let{t:r,i18n:i}=b(`openhands`),[a,o]=Q.useState(!1),[s,c]=Q.useState(!1),l=Q.useRef(null),u=i.exists(e,{ns:`openhands`}),d=u?String(r(e)):e,f=d.length>Lr,m=f&&!a;return Q.useLayoutEffect(()=>{let e=l.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){c(!1);return}c(e.getBoundingClientRect().height>t*1.5)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[d,m,a,e]),(0,$.jsxs)(`div`,{className:U(`flex w-full gap-2 rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface-raised)] p-2 text-[var(--oh-foreground)]`,s?`items-start`:`items-center`),"data-testid":`error-message-banner`,children:[(0,$.jsx)(p,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:_e},"data-testid":`error-message-banner-icon`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{ref:l,className:U(`whitespace-pre-wrap break-words text-sm text-[var(--oh-muted)]`,m&&`line-clamp-3`),"data-testid":`error-message-banner-content`,children:u?(0,$.jsx)(y,{ns:`openhands`,i18nKey:e}):e}),f&&(0,$.jsx)(`button`,{type:`button`,className:`mt-1 cursor-pointer text-xs font-normal text-[var(--oh-foreground)] underline`,onClick:()=>o(e=>!e),"data-testid":`error-message-banner-toggle`,children:r(a?g.COMMON$VIEW_LESS:g.COMMON$VIEW_MORE)})]}),(0,$.jsxs)(`div`,{className:U(`flex shrink-0 gap-1`,s?`self-start`:`items-center`),children:[n&&(0,$.jsx)(`button`,{type:`button`,onClick:n,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:r(g.CHAT_INTERFACE$MESSAGE_RETRY)}),t&&(0,$.jsx)(`button`,{type:`button`,onClick:t,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":r(g.BUTTON$CLOSE),"data-testid":`error-message-banner-dismiss`,children:(0,$.jsx)(he,{className:`h-4 w-4`,"aria-hidden":!0})})]})]})}function zr(){let{conversationId:e}=Qt(),t=Z(e=>e.pendingMessages),n=Z(e=>e.markPendingMessageError),r=Z(e=>e.markPendingMessageSending),i=Z(e=>e.removePendingMessage),a=G(e=>e.restoreMessageToInputIfEmpty),{send:o}=D(),s=Q.useMemo(()=>e?t.filter(t=>Ot(e,t.conversationId)):[],[t,e]),c=Q.useCallback(async e=>{let t=Z.getState().pendingMessages.find(t=>t.id===e);if(t){r(e);try{await o(E(t.text,t.imageUrls,t.fileUrls,t.timestamp))}catch(t){n(e,t instanceof Error?t.message:`Failed to send message`)}}},[o,n,r]),l=Q.useCallback((e,t)=>{a(t),i(e)},[a,i]);return s.length===0?null:(0,$.jsx)($.Fragment,{children:s.map(e=>(0,$.jsx)(O,{type:`user`,message:e.text,pendingStatus:e.status,onRetry:e.status===`error`?()=>c(e.id):void 0,onStop:e.status===`sending`?()=>l(e.id,e.text):void 0,children:e.imageUrls.length>0&&(0,$.jsx)(j,{size:`small`,images:e.imageUrls})},e.id))})}var Br=()=>{let{data:e}=Y();return m({mutationKey:[`unified-upload-files`],mutationFn:async t=>{let{conversationId:n,files:r}=t;return ut(n,r,e)},meta:{disableToast:!0}})},Vr=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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 Hr(){let{t:e}=b(`openhands`),{data:t}=st();return t?.confirmation_mode?(0,$.jsx)(He,{closeDelay:100,content:e(g.COMMON$CONFIRMATION_MODE_ENABLED),tooltipClassName:`bg-white text-black hover:bg-transparent`,children:(0,$.jsx)(`div`,{className:`flex items-center justify-center w-[26px] h-[26px] rounded-lg bg-[var(--oh-surface)]`,children:(0,$.jsx)(Vr,{width:15,height:15})})}):null}var Ur=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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 Wr({status:e,statusColor:t}){return(0,$.jsx)(`div`,{"data-testid":`chat-status-indicator`,className:Be(`w-full max-w-full rounded-[100px] p-1 bg-[var(--oh-surface)] flex items-center gap-1`),children:(0,$.jsxs)(Ve,{mode:`wait`,children:[(0,$.jsx)(B.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,$.jsx)(Ur,{className:`w-4 h-4`,color:t})},`dot-${e}`),(0,$.jsx)(B.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 Gr=()=>{let e=_(),{navigate:t}=ze(),{t:n}=b(`openhands`),{data:r}=Y();return m({mutationFn:async()=>{if(!r?.id)throw Error(`No active conversation`);let e=await Ne.createConversation(void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,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}},onMutate:()=>{f.loading(n(g.CONVERSATION$CLEARING),{...x,id:`clear-conversation`})},onSuccess:r=>{f.dismiss(`clear-conversation`),S(n(g.CONVERSATION$CLEAR_SUCCESS)),t(`/conversations/${r.newConversationId}`),e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`v1-batch-get-app-conversations`]})},onError:e=>{f.dismiss(`clear-conversation`);let t=n(g.CONVERSATION$CLEAR_UNKNOWN_ERROR);e instanceof Error?t=e.message:typeof e==`string`&&(t=e),C(n(g.CONVERSATION$CLEAR_FAILED,{error:t}))}})};function Kr(e,t){return e?`github`:t?`replay`:`direct`}function qr(){let{trackInitialQuerySubmitted:e,trackUserMessageSent:t}=ct(),{setMessageToSend:n}=G(),{errorMessage:r,removeErrorMessage:i,setErrorMessage:a}=an(),{isTask:o,taskStatus:s,taskDetail:c}=Dt(),l=o,u=sn(),{send:d}=D(),{renderableEvents:f,allConversationEvents:p,totalEvents:m,hasSubstantiveAgentActions:h,userEventsExist:_}=gr(),v=Z(e=>e.enqueuePendingMessage),y=Z(e=>e.markPendingMessageError),x=Z(e=>e.pendingMessages),{t:S}=b(`openhands`),w=Q.useRef(null),{scrollDomToBottom:T,onChatBodyScroll:O,hitBottom:A,autoScroll:j,setAutoScroll:ee,setHitBottom:te}=vn(w),{mutate:re,isPending:ie}=Gr(),{curAgentState:P}=X(),{handleBuildPlanClick:F}=M(),{data:I}=Y(),L=I?.sandbox_status??null,R=Zt(),{isConfigured:ae,isLoading:oe}=Gt(),se=!oe&&!ae,ce=P===H.RUNNING||P===H.LOADING;Q.useEffect(()=>{if(ce)return;let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),F(e),T())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[ce,F,T]);let{selectedRepository:le,replayJson:ue}=jr(),{conversationId:z}=Qt(),{mutateAsync:de}=Br(),{isLoading:fe,hasMore:pe,loadOlder:me}=vr(z),B=Q.useRef(null),V=Q.useCallback(e=>{if(l||fe||!pe)return;let t=e.scrollTop<=80,n=e.scrollHeight<=e.clientHeight+80;!t&&!n||(B.current={scrollHeight:e.scrollHeight,scrollTop:e.scrollTop},me().catch(e=>{B.current=null,a(e instanceof Error&&e.message?e.message:S(g.ERROR$GENERIC))}))},[pe,fe,l,me,a,S]),he=Q.useCallback(e=>{e.deltaY<0&&e.currentTarget.scrollTop<=0&&V(e.currentTarget)},[V]),ge=Q.useMemo(()=>z?x.some(e=>Ot(z,e.conversationId)):!1,[x,z]),_e=p.length>0||ge||!u?.isLoadingHistory,ve=!!z,ye=!_e&&!o,be=nn(e=>z?(e.entriesByConversation[z]?.length??0)>0:!1),Se=async(r,i,a)=>{if(r.trim()===`/new`){if(!z){C(S(g.CONVERSATION$CLEAR_NO_ID));return}if(m===0){C(S(g.CONVERSATION$CLEAR_EMPTY));return}if(ie)return;re();return}let o=[...i],s=[...a];m===0?e({entryPoint:Kr(le!==null,ue!==null),queryCharacterLength:r.length,replayJsonSize:ue?.length}):t({sessionMessageCount:m,currentMessageLength:r.length});let c=Tt([...o,...s]);if(!c.isValid){C(`Error: ${c.errorMessage}`);return}let l=o.map(e=>Et(e)),u=await Promise.all(l),f=new Date().toISOString(),{skipped_files:p,uploaded_files:h}=s.length>0?await de({conversationId:z,files:s}):{skipped_files:[],uploaded_files:[]};p.forEach(e=>C(e.reason));let _=`${S(g.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE)}: ${h.join(`
|
|
18
|
-
|
|
19
|
-
`)}`,b=h.length>0?`${r}\n\n${_}`:r,x=v({conversationId:z,text:r,content:b,imageUrls:u,fileUrls:h,timestamp:f});T(),n(``);try{await d(E(b,u,h,f))}catch(e){y(x,e instanceof Error?e.message:`Failed to send message`)}};Q.useEffect(()=>{if(B.current&&w.current){let{scrollHeight:e,scrollTop:t}=B.current,n=w.current,r=n.scrollHeight-e;r>0&&(n.scrollTop=t+r),B.current=null;return}j&&T()},[f.length,ge,T]);let Ce=Q.useRef(V);Q.useEffect(()=>{Ce.current=V}),Q.useEffect(()=>{let e=w.current;e&&Ce.current(e)},[f.length,pe]);let we={scrollRef:w,autoScroll:j,setAutoScroll:ee,scrollDomToBottom:T,hitBottom:A,setHitBottom:te,onChatBodyScroll:O},U=P===H.LOADING||P===H.INIT,Ee=P===H.STOPPED,De=P===H.PAUSED,Oe=Te({isPausing:De,isTask:o,taskStatus:s,isStartingStatus:U,isStopStatus:Ee,curAgentState:P}),ke=xe({isPausing:De,isTask:o,taskStatus:s,taskDetail:c,isStartingStatus:U,isStopStatus:Ee,curAgentState:P,errorMessage:r,t:S});return(0,$.jsx)(ne,{value:we,children:(0,$.jsxs)(`div`,{className:`relative flex h-full flex-col justify-between px-4`,"data-testid":`chat-interface`,children:[!h&&!ge&&!_&&!be&&!ye&&!l&&m===0&&!R&&!se&&(0,$.jsx)(kr,{onSuggestionsClick:e=>n(e)}),(0,$.jsxs)(`div`,{ref:w,"data-testid":`chat-scroll-container`,onScroll:e=>{O(e.currentTarget),V(e.currentTarget)},onWheel:he,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:[ye&&ve&&(0,$.jsx)(Ir,{}),ye&&!ve&&(0,$.jsx)(`div`,{className:`flex justify-center`,"data-testid":`loading-spinner`,children:(0,$.jsx)(Re,{size:`small`})}),fe&&(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-3 text-sm text-neutral-400`,"data-testid":`loading-older-events`,children:[(0,$.jsx)(Re,{size:`small`}),(0,$.jsx)(`span`,{children:S(g.CHAT_INTERFACE$FETCHING_OLDER_MESSAGES)})]}),(0,$.jsx)(k,{conversationId:z,anchorEventId:null}),_e&&f.length>0&&(0,$.jsx)(N,{messages:f,allEvents:p}),(0,$.jsx)(zr,{})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-[6px] pb-4`,children:[(0,$.jsx)(Vn,{conversationId:z}),r&&(0,$.jsx)(Rr,{message:r,onDismiss:i,onRetry:r===`Unable to connect to server`?()=>u?.reconnect():void 0}),se&&!R&&(0,$.jsx)(qt,{}),R?(0,$.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,$.jsx)(`p`,{className:`text-xs font-semibold text-[var(--oh-foreground)]`,children:S(L===`ERROR`?g.CHAT_INTERFACE$ERROR_SANDBOX_TITLE:g.CHAT_INTERFACE$ARCHIVED_SANDBOX_TITLE)}),(0,$.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] mt-0.5`,children:S(L===`ERROR`?g.CHAT_INTERFACE$ERROR_SANDBOX_DESCRIPTION:g.CHAT_INTERFACE$ARCHIVED_SANDBOX_DESCRIPTION)})]}):(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-full mb-1 z-20`,children:(0,$.jsxs)(`div`,{className:`flex justify-between relative`,children:[(0,$.jsxs)(`div`,{className:`flex items-end gap-1 pointer-events-auto`,children:[(0,$.jsx)(Hr,{}),U&&(0,$.jsx)(Wr,{statusColor:Oe,status:ke})]}),A?P===H.RUNNING&&(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(yr,{})}):(0,$.jsx)(`div`,{className:`absolute left-1/2 transform -translate-x-1/2 bottom-0 pointer-events-auto`,children:(0,$.jsx)(Nr,{onClick:T})})]})}),(0,$.jsx)(hr,{onSubmit:Se,disabled:ie||se})]})]})]})})}function Jr({isRightPanelShown:e}){return(0,$.jsx)(`div`,{className:`flex justify-center w-full h-full`,children:(0,$.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,$.jsx)(qr,{})})})}function Yr({children:e}){return(0,$.jsx)(`div`,{className:`absolute inset-0`,children:e})}function Xr({children:e}){return(0,$.jsx)(`div`,{className:`flex flex-col h-full w-full`,children:e})}function Zr({children:e}){return(0,$.jsx)(`div`,{className:`overflow-hidden flex-grow h-full w-full relative`,children:e})}function Qr({className:e}){let{t}=b(`openhands`);return(0,$.jsxs)(`div`,{className:U(`bg-[var(--oh-surface)] flex h-full w-full flex-col items-center justify-center gap-3`,e),children:[(0,$.jsx)(fe,{className:`h-8 w-8 shrink-0 animate-spin text-tertiary-light`,"aria-hidden":!0}),(0,$.jsx)(w,{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(g.HOME$LOADING)})]})}var $r={duration:.35,ease:`easeInOut`};function ei({children:e,onReady:t}){return(0,Q.useLayoutEffect)(()=>{t()},[t]),e}function ti({onPending:e}){return(0,Q.useLayoutEffect)(()=>{e()},[e]),(0,$.jsx)(Qr,{})}function ni({showAgentLoading:e,tabKey:t,children:n}){let r=A(),[i,a]=(0,Q.useState)(!1);(0,Q.useLayoutEffect)(()=>{a(!1)},[t]);let o=(0,Q.useCallback)(()=>{a(!0)},[]),s=(0,Q.useCallback)(()=>{a(!1)},[]),c=e||i;return r?(0,$.jsx)(`div`,{className:`relative h-full w-full overflow-hidden`,children:c?(0,$.jsx)(Qr,{}):(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ti,{onPending:o}),children:(0,$.jsx)(ei,{onReady:s,children:n})})}):(0,$.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden`,children:[(0,$.jsx)(B.div,{className:`absolute inset-0 h-full w-full`,initial:!1,animate:{opacity:+!c},transition:$r,"aria-hidden":c,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(ti,{onPending:o}),children:(0,$.jsx)(ei,{onReady:s,children:n})})}),(0,$.jsx)(Ve,{children:c?(0,$.jsx)(B.div,{className:`absolute inset-0 z-10 h-full w-full`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:$r,children:(0,$.jsx)(Qr,{})},`conversation-tab-loading-overlay`):null})]})}var ri=(0,Q.lazy)(()=>n(()=>import(`./files-tab-DIyAYvp0.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]))),ii=(0,Q.lazy)(()=>n(()=>import(`./browser-tab-DVHx54yn.js`),__vite__mapDeps([63,64,12,1,4,8,20,21,65,3,42,13,14,15,66,37]))),ai=(0,Q.lazy)(()=>n(()=>import(`./planner-tab-B7kpsTT8.js`),__vite__mapDeps([67,1,68,12,4,8,20,21,69,37,61,42,13,14,15,43,25,23,24,26,27,44,3,22,28,45,46,70,71,72,9,10,11,73,49,5,6,50,29,30,31,7,32,33,34,35,36,74,16,75,17,18,76,77,78,79,47,48,51,52]))),oi=(0,Q.lazy)(()=>n(()=>import(`./task-list-tab-DKnHShLG.js`),__vite__mapDeps([80,1,8,20,21,4,42,13,14,15,81,60,37,82,83,40,41]))),si=(0,Q.lazy)(()=>n(()=>import(`./terminal-CZH2h1J3.js`),__vite__mapDeps([84,1,85,86,87,12,4,8,20,21,38,39,13,14,15,40,41,42,53,47,48,5,6,49,50,29,30,31,7,9,10,11,32,33,34,35,36,51,52,17,18,16,54,37,88]))),ci={tasklist:{component:oi},files:{component:ri},browser:{component:ii},terminal:{component:si},planner:{component:ai}};function li(){let{selectedTab:e,shouldShownAgentLoading:t}=G(),{conversationId:n}=J(),r=(0,Q.useMemo)(()=>ci[e]??ci.files,[e]).component,i=e===`terminal`?`${e}-${n}`:e??`files`;return(0,$.jsx)(Xr,{children:(0,$.jsx)(Zr,{children:(0,$.jsx)(ni,{showAgentLoading:t,tabKey:i,children:(0,$.jsx)(Yr,{children:(0,$.jsx)(r,{})},i)})})})}var ui=()=>{let e=_(),t=an(e=>e.removeErrorMessage);return m({mutationKey:[`start-conversation`],mutationFn:async e=>d(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)=>{l(e,r.conversationId)},onSuccess:(n,r)=>{t(),c(e,r.conversationId,ke.RUNNING)}})},di=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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`})}),fi=e=>(0,$.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,$.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,$.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 pi({icon:e,text:t,onClick:n,testId:r}){return(0,$.jsx)(K,{testId:r,onClick:n,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 w-full items-center justify-between gap-2`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,$.jsx)(`span`,{className:We,"aria-hidden":!0,children:e})]})})}function mi({className:e=``,executionStatus:t,isPausing:n=!1}){let{curAgentState:r}=X(),{isTask:i,taskStatus:a,taskDetail:o}=Dt(),{t:s}=b(`openhands`),{errorMessage:c}=an(),l=r===H.LOADING||r===H.INIT,u=ye(t)||De(t),d=Te({isPausing:n,isTask:i,taskStatus:a,isStartingStatus:l,isStopStatus:u,curAgentState:r}),f=xe({isPausing:n,isTask:i,taskStatus:a,taskDetail:o,isStartingStatus:l,isStopStatus:u,curAgentState:r,errorMessage:c,t:s});return(0,$.jsx)(`div`,{className:e,"data-testid":`server-status`,children:(0,$.jsxs)(`div`,{className:`flex items-center`,children:[(0,$.jsx)(Ur,{className:`w-6 h-6 shrink-0`,color:d}),(0,$.jsx)(`span`,{className:`text-[13px] text-white font-normal`,children:f})]})})}function hi({onClose:e,onStopServer:t,onStartServer:n,executionStatus:r,position:i=`top`,className:a=``,isPausing:o=!1}){let{t:s}=b(`openhands`),c=ot(e),l=Oe(r),u=De(r),d=l||u;return(0,$.jsxs)(ft,{ref:c,testId:`server-status-context-menu`,position:i,alignment:`left`,size:`default`,className:U(`left-2 w-fit min-w-42`,a),children:[(0,$.jsx)(mi,{executionStatus:r,isPausing:o,className:`pl-0 pr-2 py-1`}),d&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Xe,{inset:`menu`}),l&&t&&(0,$.jsx)(pi,{icon:(0,$.jsx)(di,{width:18,height:18}),text:s(g.COMMON$STOP_RUNTIME),onClick:t,testId:`stop-server-button`}),u&&n&&(0,$.jsx)(pi,{icon:(0,$.jsx)(fi,{width:18,height:18}),text:s(g.COMMON$START_RUNTIME),onClick:n,testId:`start-server-button`})]})]})}var gi=e(s(),1);function _i({isPublic:e,onToggle:t,ariaLabel:n}){return(0,$.jsxs)(`label`,{className:`relative inline-flex shrink-0 cursor-pointer items-center`,children:[(0,$.jsx)(`input`,{hidden:!0,type:`checkbox`,"data-testid":`share-publicly-button`,checked:e,"aria-label":n,onChange:e=>t(e.target.checked)}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:U(`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,$.jsx)(`span`,{className:U(`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 vi({onClose:e,onRename:t,onDelete:n,onStop:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onShowHooks:s,onTogglePublic:c,onCopyShareLink:l,onDownloadConversation:u,shareUrl:d,position:f=`bottom`,anchorRef:p}){let m=yn(),{t:h}=b(`openhands`),{backend:_}=W(),{data:v}=Y(),y=Zt(),x=ot(e),S=p?.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};f===`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,f]);let T=!!(a||o||s),E=!!i,D=!!(r||n),O=_.kind===`cloud`?g.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:g.COMMON$STOP_CONVERSATION,k=_.kind===`cloud`&&!!c,A=v?.public||!1,j=!!S,M=(0,$.jsxs)(ft,{ref:x,testId:`conversation-name-context-menu`,position:f,alignment:`left`,className:U(m?`right-0 translate-x-[34%] left-auto`:``,j?`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`:``),children:[t&&(0,$.jsx)(K,{testId:`rename-button`,onClick:t,children:(0,$.jsx)(q,{icon:(0,$.jsx)(ht,{width:16,height:16}),text:h(g.BUTTON$RENAME)})}),T&&(0,$.jsx)(Xe,{testId:`separator-tools`,inset:`menu`}),o&&(0,$.jsx)(Ft,{isDisabled:y,children:(0,$.jsx)(K,{testId:`show-skills-button`,onClick:o,isDisabled:y,children:(0,$.jsx)(q,{icon:(0,$.jsx)(gt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:h(g.CONVERSATION$SHOW_SKILLS)})})}),s&&(0,$.jsx)(Ft,{isDisabled:y,children:(0,$.jsx)(K,{testId:`show-hooks-button`,onClick:s,isDisabled:y,children:(0,$.jsx)(q,{icon:(0,$.jsx)(Vt,{width:16,height:16,"aria-hidden":!0}),text:h(g.CONVERSATION$SHOW_HOOKS)})})}),a&&(0,$.jsx)(Ft,{isDisabled:y,children:(0,$.jsx)(K,{testId:`show-agent-tools-button`,onClick:a,isDisabled:y,children:(0,$.jsx)(q,{icon:(0,$.jsx)(qe,{width:16,height:16}),text:h(g.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})})}),u&&(0,$.jsx)(K,{testId:`download-trajectory-button`,onClick:u,children:(0,$.jsx)(q,{icon:(0,$.jsx)(ie,{width:16,height:16}),text:h(g.BUTTON$EXPORT_CONVERSATION)})}),(E||D)&&(0,$.jsx)(Xe,{testId:`separator-info-control`,inset:`menu`}),i&&(0,$.jsx)(K,{testId:`display-cost-button`,onClick:i,children:(0,$.jsx)(q,{icon:(0,$.jsx)(se,{width:16,height:16}),text:h(g.BUTTON$DISPLAY_COST)})}),k&&c&&(0,$.jsxs)(`li`,{className:`flex w-full items-center gap-2 rounded px-2 py-2 hover:bg-[var(--oh-interactive-hover)]`,children:[(0,$.jsx)(`span`,{className:`flex shrink-0 items-center text-[var(--oh-muted)]`,"aria-hidden":!0,children:(0,$.jsx)(me,{size:16})}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:h(g.CONVERSATION$SHARE_PUBLICLY)}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center`,children:[A&&d&&l&&(0,$.jsxs)(`div`,{className:`mr-2 flex items-center gap-0.5`,children:[(0,$.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:h(g.BUTTON$COPY_TO_CLIPBOARD),children:(0,$.jsx)(gn,{width:14,height:14})}),(0,$.jsx)(`a`,{"data-testid":`open-share-link-button`,href:d,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:h(g.BUTTON$OPEN_IN_NEW_TAB),children:(0,$.jsx)(ue,{size:14,"aria-hidden":!0})})]}),(0,$.jsx)(_i,{isPublic:A,onToggle:c,ariaLabel:h(g.CONVERSATION$SHARE_PUBLICLY)})]})]}),r&&(0,$.jsx)(Ft,{isDisabled:y,children:(0,$.jsx)(K,{testId:`stop-button`,onClick:r,isDisabled:y,children:(0,$.jsx)(q,{icon:(0,$.jsx)(Je,{width:16,height:16}),text:h(O)})})}),n&&(0,$.jsx)(K,{testId:`delete-button`,onClick:n,children:(0,$.jsx)(q,{icon:(0,$.jsx)(pt,{width:16,height:16}),text:h(g.COMMON$DELETE_CONVERSATION)})})]});return j?typeof document>`u`||!C?null:gi.createPortal((0,$.jsx)(`div`,{style:C,children:M}),document.body):M}function yi({onClose:e}){let{t}=b(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(nt,{onClose:e,testId:`close-metrics-modal`}),(0,$.jsx)(`div`,{className:`w-full pr-6`,children:(0,$.jsx)(Ie,{title:t(g.CONVERSATION$METRICS_INFO)})})]})}function bi({currentCost:e,maxBudget:t}){let n=e/t*100;return(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden mt-1`,children:(0,$.jsx)(`div`,{className:U(`h-full transition-all duration-300`,n>80?`bg-red-500`:`bg-blue-500`),style:{width:`${Math.min(100,n)}%`}})})}function xi({currentCost:e,maxBudget:t}){let{t:n}=b(`openhands`),r=e/t*100;return(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(g.CONVERSATION$BUDGET_USAGE_FORMAT,{currentCost:`$${e.toFixed(4)}`,maxBudget:`$${t.toFixed(4)}`,usagePercentage:r.toFixed(2),used:n(g.CONVERSATION$USED)})})})}function Si({cost:e,maxBudgetPerTask:t}){let{t:n}=b(`openhands`);return e===null?null:(0,$.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)]`,children:t!==null&&t>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(bi,{currentCost:e,maxBudget:t}),(0,$.jsx)(xi,{currentCost:e,maxBudget:t})]}):(0,$.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:n(g.CONVERSATION$NO_BUDGET_LIMIT)})})}function Ci({cost:e,maxBudgetPerTask:t}){let{t:n}=b(`openhands`);return e===null?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex justify-between items-center pb-2`,children:[(0,$.jsx)(`span`,{className:`text-lg font-semibold`,children:n(g.CONVERSATION$TOTAL_COST)}),(0,$.jsxs)(`span`,{className:`font-semibold`,children:[`$`,e.toFixed(4)]})]}),(0,$.jsx)(Si,{cost:e,maxBudgetPerTask:t})]})}function wi({label:e,value:t,labelClassName:n=``,valueClassName:r=`font-semibold`}){return(0,$.jsxs)(`div`,{className:`flex justify-between items-center border-b border-[var(--oh-border-subtle)] pb-2`,children:[(0,$.jsx)(`span`,{className:n,children:e}),(0,$.jsx)(`span`,{className:r,children:t})]})}function Ti({usage:e}){let{t}=b(`openhands`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wi,{label:t(g.CONVERSATION$INPUT),value:e.prompt_tokens.toLocaleString()}),(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 pl-4 text-sm`,children:[(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(g.CONVERSATION$CACHE_HIT)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_read_tokens.toLocaleString()}),(0,$.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:t(g.CONVERSATION$CACHE_WRITE)}),(0,$.jsx)(`span`,{className:`text-right`,children:e.cache_write_tokens.toLocaleString()})]}),(0,$.jsx)(wi,{label:t(g.CONVERSATION$OUTPUT),value:e.completion_tokens.toLocaleString()}),(0,$.jsx)(wi,{label:t(g.CONVERSATION$TOTAL),value:(e.prompt_tokens+e.completion_tokens).toLocaleString(),labelClassName:`font-semibold`,valueClassName:`font-bold`})]})}function Ei({perTurnToken:e,contextWindow:t}){let{t:n}=b(`openhands`),r=t>0?e/t*100:0,i=Math.min(100,r);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,$.jsx)(`span`,{className:`font-semibold`,children:n(g.CONVERSATION$CONTEXT_WINDOW)})}),(0,$.jsx)(`div`,{className:`w-full h-1.5 bg-tertiary rounded-full overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full bg-foreground transition-all duration-300`,style:{width:`${i}%`}})}),(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsxs)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:[e.toLocaleString(),` / `,t.toLocaleString(),` (`,r.toFixed(2),`% `,n(g.CONVERSATION$USED),`)`]})})]})}function Di(){let{t:e}=b(`openhands`);return(0,$.jsx)(`div`,{className:`text-center`,children:(0,$.jsx)(`p`,{className:`text-[var(--oh-muted)]`,children:e(g.CONVERSATION$NO_METRICS)})})}function Oi(e){let{stats:t}=e;if(!t?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let n=0,r=null,i=null;for(let e of Object.values(t.usage_to_metrics))n+=e.accumulated_cost,r===null&&e.max_budget_per_task!==null&&(r=e.max_budget_per_task),e.accumulated_token_usage&&(i=i===null?{...e.accumulated_token_usage}:{prompt_tokens:i.prompt_tokens+e.accumulated_token_usage.prompt_tokens,completion_tokens:i.completion_tokens+e.accumulated_token_usage.completion_tokens,cache_read_tokens:i.cache_read_tokens+e.accumulated_token_usage.cache_read_tokens,cache_write_tokens:i.cache_write_tokens+e.accumulated_token_usage.cache_write_tokens,context_window:Math.max(i.context_window,e.accumulated_token_usage.context_window),per_turn_token:Math.max(i.per_turn_token,e.accumulated_token_usage.per_turn_token)});return{accumulated_cost:n,max_budget_per_task:r,accumulated_token_usage:i}}var ki=(e,t,n,r=!0)=>{let i=v({queryKey:[`conversation-metrics`,e,t,n],queryFn:async()=>{if(!e)throw Error(`Conversation ID is required`);return Oi(await Ne.getRuntimeConversation(e,t,n))},enabled:r&&!!e&&!!t,staleTime:1e3*30,gcTime:1e3*60*5,refetchInterval:1e3*30,retry:!1});return{data:i.data,isLoading:i.isLoading,error:i.error}};function Ai({isOpen:e,onOpenChange:t}){let n=ln(),{data:r}=Y(),i=r?.id,a=r?.conversation_url,o=r?.session_api_key,{data:s}=ki(i,a,o,e),c=(0,Q.useMemo)(()=>s?{cost:s.accumulated_cost,max_budget_per_task:s.max_budget_per_task,usage:s.accumulated_token_usage?{prompt_tokens:s.accumulated_token_usage.prompt_tokens??0,completion_tokens:s.accumulated_token_usage.completion_tokens??0,cache_read_tokens:s.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:s.accumulated_token_usage.cache_write_tokens??0,context_window:s.accumulated_token_usage.context_window??0,per_turn_token:s.accumulated_token_usage.per_turn_token??0}:null}:n,[s,n]);return e?(0,$.jsx)(Pe,{onClose:()=>t(!1),children:(0,$.jsxs)(Fe,{testID:`metrics-modal`,className:`relative items-start border border-[var(--oh-border)]`,children:[(0,$.jsx)(yi,{onClose:()=>t(!1)}),(0,$.jsxs)(`div`,{className:`w-full`,children:[(c?.cost!==null||c?.usage!==null)&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(Ci,{cost:c?.cost??null,maxBudgetPerTask:c?.max_budget_per_task??null}),c?.usage!==null&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Ti,{usage:c.usage}),(0,$.jsx)(Ei,{perTurnToken:c.usage.per_turn_token,contextWindow:c.usage.context_window})]})]})}),!c?.cost&&!c?.usage&&(0,$.jsx)(`div`,{className:`rounded-md border border-[var(--oh-border)] bg-surface-raised p-3`,children:(0,$.jsx)(Di,{})})]})]})}):null}function ji(){let{t:e}=b(`openhands`),{conversationId:t}=J(),{data:n}=Y(),{mutate:r}=le(),[i,a]=Q.useState(`view`),[o,s]=Q.useState(!1),c=Q.useRef(null),l=Q.useRef(null),{handleDelete:u,handleStop:d,handleDownloadConversation:f,handleDisplayCost:p,handleShowAgentTools:m,handleShowSkills:h,handleShowHooks:_,handleTogglePublic:v,handleCopyShareLink:y,shareUrl:x,handleConfirmDelete:C,handleConfirmStop:w,metricsModalVisible:T,setMetricsModalVisible:E,systemModalVisible:D,setSystemModalVisible:O,skillsModalVisible:k,setSkillsModalVisible:A,hooksModalVisible:j,setHooksModalVisible:M,confirmDeleteModalVisible:ee,setConfirmDeleteModalVisible:te,confirmStopModalVisible:ne,setConfirmStopModalVisible:N,systemMessage:re,shouldShowStop:ie,shouldShowDownloadConversation:I,shouldShowDisplayCost:L,shouldShowAgentTools:R,shouldShowSkills:ae,shouldShowHooks:oe}=bt({conversationId:t,executionStatus:n?.execution_status,showOptions:!0,onContextMenuToggle:s});return Q.useEffect(()=>{i===`edit`&&c.current?.focus()},[i]),n?(0,$.jsxs)($.Fragment,{children:[(0,$.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,$.jsx)(`input`,{ref:c,"data-testid":`conversation-name-input`,onClick:e=>{i===`edit`&&(e.preventDefault(),e.stopPropagation())},onBlur:()=>{if(c.current?.value&&t){let i=c.current.value.trim();i!==n?.title&&r({conversationId:t,newTitle:i},{onSuccess:()=>{S(e(g.CONVERSATION$TITLE_UPDATED))}})}else c.current&&(c.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,$.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,$.jsxs)(`div`,{ref:l,className:`relative flex items-center shrink-0`,children:[(0,$.jsx)(mt,{onClick:e=>{e.preventDefault(),e.stopPropagation(),s(!o)}}),o&&(0,$.jsx)(vi,{onClose:()=>s(!1),onRename:e=>{e.preventDefault(),e.stopPropagation(),a(`edit`),s(!1)},onDelete:u,onStop:ie?d:void 0,onDisplayCost:L?p:void 0,onShowAgentTools:R?m:void 0,onShowSkills:ae?h:void 0,onShowHooks:oe?_:void 0,onTogglePublic:v,onCopyShareLink:y,shareUrl:x,onDownloadConversation:I?f:void 0,position:`bottom`,anchorRef:l})]})]}),(0,$.jsx)(Ai,{isOpen:T,onOpenChange:E}),(0,$.jsx)(Jt,{isOpen:D,onClose:()=>O(!1),systemMessage:re||null}),k&&(0,$.jsx)(Nt,{onClose:()=>A(!1)}),j&&(0,$.jsx)(Lt,{onClose:()=>M(!1)}),ee&&(0,$.jsx)(F,{onConfirm:C,onCancel:()=>te(!1),conversationTitle:n?.title||``}),ne&&(0,$.jsx)(P,{onConfirm:w,onCancel:()=>N(!1)})]}):null}function Mi({children:e,tooltip:t,ariaLabel:n}){return(0,$.jsx)(He,{content:t,placement:`bottom`,tooltipClassName:`bg-white text-black text-xs font-medium leading-5`,children:(0,$.jsx)(`span`,{"data-aria-label":n,children:e})})}function Ni({className:e}){let{t}=b(`openhands`),n=yn(),r=Zt(),i=a(),{conversationId:o}=J(),{isRightPanelShown:s,setHasRightPanelToggled:c,setIsRightPanelShown:l,setSelectedTab:u}=G(),d=()=>{if(r)return;if(n){if(!o)return;c(!0),l(!0);let{selectedTab:e}=G.getState();e||u(`files`),i(`/conversations/${o}/panel`);return}let e=!s;if(c(e),e){let{selectedTab:e}=G.getState();e||u(`files`)}},f=t(r?g.CONVERSATION$UNAVAILABLE_FOR_ARCHIVES:n?g.COMMON$SHOW_PANEL:s?g.COMMON$HIDE_PANEL:g.COMMON$SHOW_PANEL),p=n?!1:s;return(0,$.jsx)(Mi,{tooltip:f,ariaLabel:f,children:(0,$.jsx)(`button`,{type:`button`,onClick:d,disabled:r,className:U(oe,r&&`cursor-not-allowed opacity-50 hover:bg-transparent hover:text-[var(--oh-muted)]`,e),"aria-label":f,"aria-pressed":p,"aria-disabled":r,"data-testid":`right-panel-toggle`,children:(0,$.jsx)(R,{className:`w-5 h-5 -scale-x-100`})})})}function Pi(){let{conversationId:e}=J(),{data:t}=Y(),{curAgentState:n}=X(),{isTask:r,taskStatus:i}=Dt(),{mutate:a}=Ge(),{mutate:o}=ui(),{providers:s}=Ke(),c=t?.execution_status??null,l=Te({isPausing:!1,isTask:r,taskStatus:i,isStartingStatus:n===H.LOADING||n===H.INIT,isStopStatus:ye(c),curAgentState:n});return(0,$.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,$.jsxs)(`div`,{className:`flex items-center min-w-0`,children:[(0,$.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,$.jsx)(Ur,{className:`ml-[3.5px] w-6 h-6 cursor-pointer`,color:l}),(0,$.jsx)(hi,{onClose:()=>{},onStopServer:Oe(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&a({conversationId:e})}:void 0,onStartServer:De(c)?t=>{t.preventDefault(),t.stopPropagation(),e&&o({conversationId:e,providers:s})}:void 0,executionStatus:c,position:`bottom`,className:`opacity-0 invisible pointer-events-none group-hover:opacity-100 group-hover:visible group-hover:pointer-events-auto bottom-full left-0 mt-0 min-h-fit`,isPausing:!1})]}),(0,$.jsx)(ji,{})]}),(0,$.jsx)(Ni,{className:`mr-2`})]})}var Fi=e=>(0,$.jsxs)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[(0,$.jsx)(`path`,{d:`M3 10.5L6.5 14L14 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,$.jsx)(`path`,{d:`M7 10.5L10.5 14L18 6`,stroke:`currentColor`,strokeWidth:2.2,strokeLinecap:`round`,strokeLinejoin:`round`})]}),Ii=160,Li={duration:.22,ease:[.4,0,.2,1]};function Ri({tabValue:e,icon:t,onClick:n,isActive:r,label:i,className:a,measureOnly:o,suppressLayoutAnimation:s=!1}){let c=A(),l=o||c||!1,u=!l&&!s,d=U(`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,$.jsx)(t,{className:U(`h-4 w-4 shrink-0 text-inherit`)}),p=i&&r?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-sm font-normal`,children:i}):null,m=i?(0,$.jsx)(B.span,{initial:!1,animate:{maxWidth:r?Ii:0,opacity:+!!r,marginLeft:r?8:0},transition:Li,className:`block overflow-hidden whitespace-nowrap text-sm font-normal`,"aria-hidden":!r,children:i}):null;return l?(0,$.jsxs)(`button`,{type:`button`,onClick:n,...o?{}:{"data-testid":`conversation-tab-${e}`},"data-tab-measure":o?`true`:void 0,className:U(d,`gap-2`),children:[f,p]}):(0,$.jsxs)(B.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:Li}:void 0,children:[f,m]})}var zi=e=>(0,$.jsx)(`svg`,{viewBox:`0 0 128 128`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,$.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 Bi(){let e=Ae().backend;if(e.kind!==`cloud`)throw Error(`Cloud sandboxes call requires a cloud backend.`);return e}async function Vi(e){if(e.length===0)return[];let t=Bi(),n=new URLSearchParams;for(let t of e)n.append(`id`,t);return await Ze({backend:t,method:`GET`,path:`/api/v1/sandboxes?${n.toString()}`})??[]}var Hi=e=>{let t=W(),n=t.backend.kind===`cloud`;return v({queryKey:[`cloud`,`sandbox`,t.backend.id,t.orgId,e],queryFn:async()=>{if(!e)return null;let[t]=await Vi([e]);return t??null},enabled:n&&!!e,staleTime:1e3*60*5,gcTime:1e3*60*15})},Ui=`VSCODE`,Wi=()=>{let{t:e}=b(`openhands`),{conversationId:t}=J(),n=_n({allowAgentError:!0}),{data:r}=Y(),i=W(),a=r?.conversation_url??null,o=r?.session_api_key??null,s=r?.sandbox_id??null,c=i.backend.kind===`cloud`,l=Hi(c?s:null),u=v({queryKey:[`unified`,`vscode_url`,`local`,t,a,o],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return{url:L((await Ne.getVSCodeUrl(t,a,o).catch(()=>dt.getVSCodeUrl(t))).vscode_url)}},enabled:!c&&n&&!!t,refetchOnMount:!0,retry:3}),d,f,p,m,h,_,y;if(c){let e=l.data?.exposed_urls?.find(e=>e.name===Ui)?.url??null;d=l.isSuccess?{url:L(e)}:void 0,f=l.isLoading,p=l.isError,m=l.isSuccess,h=l.status,_=l.error,y=async()=>{let e=await l.refetch(),t=e.data?.exposed_urls?.find(e=>e.name===Ui)?.url??null;return{data:e.data?{url:L(t)}:void 0}}}else d=u.data,f=u.isLoading,p=u.isError,m=u.isSuccess,h=u.status,_=u.error,y=async()=>({data:(await u.refetch()).data});let x=d&&!d.url?e(g.VSCODE$URL_NOT_AVAILABLE):null;return{data:d?{...d,error:x}:void 0,error:_,isLoading:f,isError:p,isSuccess:m,status:h,refetch:y}};function Gi(){let{t:e}=b(`openhands`),{curAgentState:t}=X(),{data:n,refetch:r,isLoading:i}=Wi(),a=Ee.includes(t);return(0,$.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(g.VSCODE$OPEN),title:e(g.VSCODE$OPEN),"data-testid":`drawer-vscode-link`,className:U(`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,$.jsx)(zi,{className:`h-[15px] w-[15px] shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:e(g.FILES$VSCODE)}),(0,$.jsx)(ue,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})]})}var Ki=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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`})}),qi=e=>(0,$.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,$.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 Ji({isOpen:e,onClose:t,ignoreOutsideClickRef:n,anchorRef:r}){let i=ot(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}=b(`openhands`),{conversationId:c}=J(),{state:l,setUnpinnedTabs:u,setSelectedTab:d}=tt(c),{selectedTab:f,isRightPanelShown:p,setSelectedTab:m}=G(),{navigateToTab:h}=te(),{hasTaskList:_}=bn(),{backend:v}=W(),y=Zt(),x=[{tab:`planner`,icon:de,i18nKey:g.COMMON$PLANNER},{tab:`files`,icon:St,i18nKey:g.COMMON$FILES},{tab:`terminal`,icon:V,i18nKey:g.COMMON$TERMINAL},{tab:`browser`,icon:z,i18nKey:g.COMMON$BROWSER}];_&&x.unshift({tab:`tasklist`,icon:Fi,i18nKey:g.COMMON$TASK_LIST});let S=x.filter(({tab:e})=>e!==`planner`||v.kind===`cloud`),C=e=>{y||(h(e),t())},w=(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=S.find(({tab:n})=>n!==e&&!t.includes(n));n&&(m(n.tab),d(n.tab))}}};if(!e)return null;let T=!!(r?.current&&a),E=(0,$.jsx)(ft,{ref:i,theme:T?`popover`:`default`,position:T?`none`:`bottom`,alignment:T?`none`:`left`,spacing:T?`none`:`default`,className:U(`z-[9999] w-fit`,T?`mt-0`:`mt-2`),children:S.map(({tab:e,icon:t,i18nKey:n})=>{let r=!l.unpinnedTabs.includes(e);return(0,$.jsx)(`li`,{className:`list-none`,children:(0,$.jsx)(Ft,{isDisabled:y,children:(0,$.jsxs)(`div`,{className:U(`group flex h-[30px] w-full min-w-0 items-stretch rounded`,!y&&`hover:bg-[var(--oh-interactive-hover)]`,y&&`opacity-50`),children:[(0,$.jsxs)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-open-${e}`,disabled:y,className:U(`flex min-w-0 flex-1 items-center gap-2 rounded-l p-2 text-start text-white`,Ue,y?`cursor-not-allowed`:`cursor-pointer`),onClick:()=>C(e),children:[(0,$.jsx)(`span`,{className:We,"aria-hidden":!0,children:(0,$.jsx)(t,{className:`h-4 w-4`})}),(0,$.jsx)(`span`,{className:`text-sm`,children:s(n)})]}),(0,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-tabs-menu-pin-${e}`,disabled:y,className:U(`flex shrink-0 items-center justify-center rounded-r px-2 text-white`,Ue,y?`cursor-not-allowed`:`cursor-pointer hover:bg-white/10`),"aria-pressed":r,"aria-label":r?`Unpin tab from bar`:`Pin tab to bar`,onClick:t=>w(e,t),children:r?(0,$.jsx)(`span`,{className:U(`-mr-[5px] ml-auto`,We),"aria-hidden":!0,children:(0,$.jsx)(qi,{className:`h-7 w-7`})}):(0,$.jsx)(`span`,{className:U(`ml-auto`,We),"aria-hidden":!0,children:(0,$.jsx)(Ki,{className:`h-4.5 w-4.5`})})})]})})},e)})});return T&&a&&typeof document<`u`?gi.createPortal((0,$.jsx)(`div`,{style:a,children:E}),document.body):E}function Yi({variant:e=`default`,isPanelResizing:t=!1}){let{conversationId:n}=J(),{setSelectedTab:r,planContent:i}=G(),[a,o]=(0,Q.useState)(!1),{state:s}=tt(n),{hasTaskList:c}=bn(),{backend:l}=W(),{handleBuildPlanClick:u}=M(),{curAgentState:d}=X(),{selectTab:f,isTabActive:p,onTabChange:m,selectedTab:h,isRightPanelShown:_}=te();(0,Q.useEffect)(()=>{r(s.selectedTab)},[r,s.selectedTab]),(0,Q.useEffect)(()=>{_&&(h||m(`files`))},[_,h,m]);let{t:v,i18n:y}=b(`openhands`),x=[{tabValue:`files`,isActive:p(`files`),icon:St,onClick:()=>f(`files`),tooltipContent:v(g.COMMON$FILES),tooltipAriaLabel:v(g.COMMON$FILES),label:v(g.COMMON$FILES)},{tabValue:`planner`,isActive:p(`planner`),icon:de,onClick:()=>f(`planner`),tooltipContent:v(g.COMMON$PLANNER),tooltipAriaLabel:v(g.COMMON$PLANNER),label:v(g.COMMON$PLANNER)},{tabValue:`terminal`,isActive:p(`terminal`),icon:V,onClick:()=>f(`terminal`),tooltipContent:v(g.COMMON$TERMINAL),tooltipAriaLabel:v(g.COMMON$TERMINAL),label:v(g.COMMON$TERMINAL),className:`pl-2`},{tabValue:`browser`,isActive:p(`browser`),icon:z,onClick:()=>f(`browser`),tooltipContent:v(g.COMMON$BROWSER),tooltipAriaLabel:v(g.COMMON$BROWSER),label:v(g.COMMON$BROWSER)}];c&&x.splice(1,0,{tabValue:`tasklist`,isActive:p(`tasklist`),icon:Fi,onClick:()=>f(`tasklist`),tooltipContent:v(g.COMMON$TASK_LIST),tooltipAriaLabel:v(g.COMMON$TASK_LIST),label:v(g.COMMON$TASK_LIST)});let S=x.filter(e=>e.tabValue===`planner`&&l.kind!==`cloud`?!1:s.unpinnedTabs.includes(e.tabValue)?h===e.tabValue:!0),C=s.unpinnedTabs.join(`,`),w=d===H.RUNNING||d===H.LOADING||!i,T=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),[A,j]=(0,Q.useState)(S.length);(0,Q.useLayoutEffect)(()=>{let e=T.current,t=E.current,n=D.current,r=O.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){j(a);return}let s=Array.from(i).map(e=>e.getBoundingClientRect().width);if(s.length!==a||a===0){j(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}}j(e=>e===f?e:f)};if(i(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(i);return a.observe(e),()=>a.disconnect()},[C,S.length,c,l.kind,h,_,y.language]);let ee=Math.min(A,S.length);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:U(`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,$.jsx)(`div`,{ref:E,"aria-hidden":!0,className:`pointer-events-none absolute top-0 left-[-10000px] flex flex-nowrap items-center gap-1.5`,children:S.map(({tabValue:e,icon:t,isActive:n,tooltipContent:r,tooltipAriaLabel:i,label:a,className:o},s)=>(0,$.jsx)(Mi,{tooltip:r,ariaLabel:i,children:(0,$.jsx)(Ri,{tabValue:e,icon:t,onClick:()=>{},isActive:n,label:a,className:U(o,`shrink-0`),measureOnly:!0})},`measure-${e}-${s}`))}),(0,$.jsxs)(`div`,{ref:T,className:`flex w-full min-w-0 flex-nowrap items-center justify-start`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-start overflow-hidden`,children:(0,$.jsxs)(`div`,{className:`flex w-fit max-w-full min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(pe,{id:`conversation-drawer-tabs`,children:(0,$.jsx)(`div`,{className:`flex w-fit max-w-full min-w-0 flex-nowrap items-center gap-1.5 overflow-x-hidden`,children:S.slice(0,ee).map(({tabValue:e,icon:n,onClick:r,isActive:i,tooltipContent:a,tooltipAriaLabel:o,label:s,className:c},l)=>(0,$.jsx)(Mi,{tooltip:a,ariaLabel:o,children:(0,$.jsx)(Ri,{tabValue:e,icon:n,onClick:r,isActive:i,label:s,className:U(c,`shrink-0`),suppressLayoutAnimation:t})},`${e}-${l}`))})}),(0,$.jsxs)(`div`,{ref:D,className:`relative shrink-0`,children:[(0,$.jsx)(mt,{ref:k,onClick:()=>o(!a),ariaLabel:v(g.COMMON$MORE_OPTIONS),iconClassName:e===`compact`?I:void 0}),(0,$.jsx)(Ji,{isOpen:a,onClose:()=>o(!1),ignoreOutsideClickRef:k,anchorRef:k})]})]})}),(0,$.jsx)(`div`,{ref:O,className:U(`ml-auto shrink-0`,l.kind===`cloud`&&`pr-1`),children:l.kind===`cloud`&&(0,$.jsx)(Gi,{})})]})]}),p(`planner`)&&(0,$.jsx)(`div`,{className:U(`flex h-10 min-h-10 shrink-0 items-center border-t border-[var(--oh-border)] pl-[10px] pr-1`),children:(0,$.jsx)(`button`,{type:`button`,onClick:u,disabled:w,className:U(`flex h-5 min-w-17 items-center justify-center rounded bg-white px-2 transition-opacity`,w?`cursor-not-allowed opacity-50`:`cursor-pointer hover:opacity-90`),"data-testid":`planner-tab-build-button`,children:(0,$.jsxs)(yt.Text,{className:`text-[11px] font-normal leading-5 text-black`,children:[v(g.COMMON$BUILD),` ⌘↩`]})})})]})}function Xi({onMouseDown:e,className:t,isDragging:n=!1}){let[r,i]=(0,Q.useState)(!1),a=n||r;return(0,$.jsxs)(`div`,{className:U(`relative z-10 w-0 shrink-0 self-stretch`,t),"aria-hidden":!0,children:[(0,$.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,$.jsx)(`div`,{className:U(`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 Zi=200;function Qi({defaultLeftWidth:e=50,minLeftWidth:t=30,maxLeftWidth:n=80,storageKey:r=`desktop-layout-panel-width`}={}){let[i,a]=xn(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(Zi),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 $i(e){return e?`translate-x-0 opacity-100`:`w-0 translate-x-full opacity-0`}function ea(){let e=yn(),t=yn(767),{isRightPanelShown:n}=G(),{leftWidth:r,rightWidth:i,isDragging:a,containerRef:o,handleMouseDown:s}=Qi({defaultLeftWidth:50,minLeftWidth:30,maxLeftWidth:80,storageKey:`desktop-layout-panel-width`});return(0,$.jsx)(`div`,{className:U(e?`relative min-h-0 flex-1 flex flex-col`:`h-full flex flex-col overflow-hidden`),children:(0,$.jsxs)(`div`,{ref:o,className:U(`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,$.jsxs)(`div`,{className:U(`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,$.jsxs)(`div`,{"data-testid":`chat-pane-header`,className:U(`flex h-10 min-h-10 shrink-0 items-center`,t&&`gap-2 pl-2.5`),children:[t?(0,$.jsx)(ce,{}):null,(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(Pi,{})})]}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(Jr,{isRightPanelShown:!e&&n})})]}),!e&&n&&(0,$.jsx)(Xi,{onMouseDown:s,isDragging:a}),!e&&(0,$.jsx)(`div`,{className:U(`transition-all duration-300 ease-in-out overflow-hidden`,$i(n)),style:{width:n?`${i}%`:`0%`,transitionProperty:a?`opacity, transform`:`all`},children:(0,$.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:(0,$.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,$.jsx)(`div`,{"data-testid":`tabs-pane-header`,className:`flex shrink-0 flex-col border-b border-[var(--oh-border)]`,children:(0,$.jsx)(Yi,{isPanelResizing:a})}),(0,$.jsx)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:(0,$.jsx)(li,{})})]})})})]})})}function ta({onNavigateBack:e}){let{t}=b(`openhands`),{setIsRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=G();return Q.useLayoutEffect(()=>(n(!0),r(!0),G.getState().selectedTab||i(`files`),()=>{n(!1),r(!1)}),[n,r,i]),(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-[var(--oh-surface)]`,children:[(0,$.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,$.jsx)(`button`,{type:`button`,"data-testid":`conversation-mobile-panel-back`,onClick:()=>{e()},"aria-label":t(g.COMMON$BACK),className:oe,children:(0,$.jsx)(ae,{size:20,className:I,"aria-hidden":!0,strokeWidth:2})}),(0,$.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 items-center self-stretch`,children:(0,$.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,$.jsx)(Yi,{variant:`compact`})})})]}),(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--oh-surface)]`,children:(0,$.jsx)(li,{})})]})}var na=1e3*60*5,ra=1e3*60*15,ia=e=>{let t=e||[],n=W();return v({queryKey:[`v1`,`sub-conversations`,t,n.backend.id,n.orgId],queryFn:async()=>t.length===0?[]:Ne.batchGetAppConversations(t),enabled:t.length>0,staleTime:na,gcTime:ra,retry:!1})};function aa({children:e,conversationId:t}){let{data:n}=Y(),{data:r}=ia(n?.sub_conversation_ids??[]),i=r?.filter(e=>e!==null);return(0,$.jsx)(on,{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 oa(){let{t:e}=b(`openhands`),{conversationId:t}=J(),n=r(`/conversations/:conversationId/panel`),{isTask:i,taskStatus:s,taskDetail:c}=Dt(),l=W(),u=Q.useRef(l.backend.id),d=Q.useRef(l.orgId),f=u.current!==l.backend.id||d.current!==l.orgId,{data:p,isFetched:m}=Y(),{data:h}=at(),{resetConversationState:_}=G(),v=a(),y=o(),x=hn(e=>e.clearTerminal),S=vt(e=>e.reset),w=Cn(e=>e.setCurrentAgentState),T=an(e=>e.removeErrorMessage);Q.useEffect(()=>{x(),_(),S(),w(H.LOADING),T()},[t,x,_,S,w,T]),Q.useEffect(()=>{if(i&&s===`ERROR`){C(c||e(g.CONVERSATION$FAILED_TO_START_FROM_TASK));let t=y.state?.resumedFromConversationId;v(t?`/conversations/${t}`:`/conversations`,{replace:!0})}},[i,s,c,e,v,y.state]),Q.useEffect(()=>{!m||!h||f||p||(kn(l.backend.id,l.orgId),C(e(g.CONVERSATION$NOT_EXIST_OR_NO_PERMISSION)),v(`/conversations`))},[p,m,h,v,e,f,l.backend.id,l.orgId]),Q.useEffect(()=>{f||t&&(t.startsWith(`task-`)||On(l.backend.id,l.orgId,t))},[t,f,l.backend.id,l.orgId]);let E=Q.useRef(null);return Q.useEffect(()=>{!m||!p||l.backend.kind===`cloud`&&p.sandbox_status===`PAUSED`&&p.sandbox_id&&E.current!==p.id&&(E.current=p.id,Me(p.sandbox_id).catch(()=>{C(e(g.CONVERSATION$FAILED_TO_START_FROM_TASK))}))},[m,p?.id,p?.sandbox_status,p?.sandbox_id,l.backend.kind,e]),f?null:(0,$.jsx)(aa,{conversationId:t,children:(0,$.jsx)(Fn,{children:(0,$.jsx)(`div`,{"data-testid":`app-route`,className:`flex h-full flex-col`,children:n?(0,$.jsx)(ta,{onNavigateBack:()=>v(`/conversations/${t}`)}):(0,$.jsx)(ea,{})})})})}function sa(){return(0,$.jsx)(oa,{})}var ca=i(sa);export{ca as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./conversation-DZYd8QiZ.js";export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n,k as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-BjMt2JeR.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~jfbjdnyv-C5ZIbuq8.js";import{o as a,t as o}from"./declaration-BDfM67Kl.js";import{r as s}from"./recommended-automations-launcher-C_RcP2yb.js";import{t as c}from"./useTranslation-C-T8J2U-.js";import{f as l,p as u}from"./query-client-config-B9ZI-1_w.js";import{t as d}from"./vendor~root-layout~home~conversation-panel~conversation-eG1kjEbj.js";import{a as f,i as p}from"./vendor~root-layout~home~mcp~automations-list-COlx7Is6.js";import{t as m}from"./chevron-down-B9j6lcFg.js";import{a as h,c as g,d as _,i as v,l as y,n as b,o as x,r as S,s as C,t as w,u as T}from"./onboarding-B50IeNyy.js";import{t as E}from"./utils-CXRkUr73.js";import{n as D}from"./active-backend-context-BiVlte2V.js";import{t as O}from"./modal-backdrop-DmDLoot0.js";import{n as k}from"./modal-body-BWjhfiSa.js";import{r as A}from"./base-modal-B_MCb3rx.js";import{a as j,g as M,o as N,p as P,t as F}from"./brand-button-B6g_UvEG.js";import{n as I}from"./navigation-context-BrRCrWhm.js";import{t as L}from"./styled-tooltip-B3wz8m5E.js";import{i as R,n as z,o as B,u as V}from"./dropdown-classes-CL8egwz_.js";import{c as H,f as U,l as W,r as ee}from"./chat-send-button-Ce9rK8Vd.js";import{t as te}from"./conversation-store-FQmakEd-.js";import{t as G}from"./modal-close-button-DXN6uYvt.js";import{t as K}from"./use-create-conversation-CIkPp9u9.js";import{t as ne}from"./folder-IChmji2Y.js";import{r as re}from"./typography-BFj4IzMj.js";import{B as ie,I as ae,L as oe,P as se,a as ce,c as le,d as ue,f as de,h as fe,i as pe,l as me,m as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se,z as Ce}from"./llm-not-configured-banner-BQgVTo0O.js";import{p as we}from"./lesson-plan-BdmMvboE.js";var q=e(t(),1);async function J(e){let{imagesToEmbed:t}=ie(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>ae(e)));we.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Y=a();function Te(){let{t:e}=c(`openhands`);return(0,Y.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,Y.jsx)(re.H1,{className:`w-full text-center leading-normal`,children:e(o.HOME$LETS_START_BUILDING)})})}function Ee({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=c(`openhands`),a=e===`local`,s=i(a?o.HOME$OPEN_WORKSPACE:o.COMMON$OPEN_REPOSITORY),l=(0,Y.jsxs)(`button`,{type:`button`,"data-testid":a?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:E(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,j,P,M,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Y.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:a?(0,Y.jsx)(f,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Y.jsx)(U,{width:16,height:16,className:`shrink-0`})}),(0,Y.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:s})]});return r?(0,Y.jsx)(L,{content:r,placement:`top`,children:(0,Y.jsx)(`span`,{className:`inline-flex`,children:l})}):l}function De({workspaces:e,value:t,placeholder:n,className:r,disabled:i=!1,disabledTooltip:a,showManage:s,onChange:l,onAddClick:u,onManageClick:f}){let{t:p}=c(`openhands`),[m,h]=(0,q.useState)(t?.name??``),g=(0,q.useRef)(null),_=(0,q.useMemo)(()=>{let t=m.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,m]),v=(0,q.useCallback)(e=>{l(e),e&&h(e.name)},[l]),y=(0,q.useCallback)(()=>{v(null),h(``)},[v]),{isOpen:b,getToggleButtonProps:x,getMenuProps:S,getInputProps:C,highlightedIndex:w,getItemProps:T,selectedItem:D,closeMenu:O}=d({items:_,itemToString:e=>e?.name??``,selectedItem:t,onSelectedItemChange:({selectedItem:e})=>{v(e??null)},inputValue:m,stateReducer:(e,t)=>t.type===d.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),k=(e,t,n,r,i)=>(0,Y.jsx)(me,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id},e.id),A=e=>(0,Y.jsx)(le,{inputValue:e,searchMessage:p(o.HOME$NO_WORKSPACES),emptyMessage:p(o.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),j=(0,q.useMemo)(()=>(0,Y.jsxs)(`div`,{className:R,children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:E(z,`cursor-pointer`),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),O(),u()},children:p(o.HOME$ADD_WORKSPACES)}),(s??e.length>0)&&(0,Y.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:E(z,`cursor-pointer`),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),O(),f()},children:p(o.HOME$MANAGE_WORKSPACES)})]}),[u,f,p,O,e.length,s]),M=(0,Y.jsxs)(`div`,{className:E(`relative`,r),children:[(0,Y.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Y.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Y.jsx)(W,{width:16,height:16})}),(0,Y.jsx)(`input`,{...C({disabled:i,placeholder:n??p(o.HOME$WORKSPACE_PLACEHOLDER),className:E(N,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{h(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Y.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[t&&(0,Y.jsx)(ue,{disabled:i,onClear:y}),(0,Y.jsx)(Se,{isOpen:b,disabled:i,getToggleButtonProps:x})]})]}),(0,Y.jsx)(be,{isOpen:b,filteredItems:_,inputValue:m,highlightedIndex:w,selectedItem:D,getMenuProps:S,getItemProps:T,menuRef:g,renderItem:k,renderEmptyState:A,stickyFooterItem:j,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return a?(0,Y.jsx)(L,{content:a,placement:`top`,children:(0,Y.jsx)(`span`,{className:`block`,children:M})}):M}var X=`oh:home-selected-workspace-path`;function Oe(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(X);return e&&e.length>0?e:null}catch{return null}}function Z(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(X,e):window.sessionStorage.removeItem(X)}catch{}}function ke({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=c(`openhands`),{navigate:r}=I(),{data:i,error:a}=C(),l=i?.workspaceParents??[],{mutate:u}=y(),{mutate:d}=T(),{mutate:f}=g(),{mutate:p}=_(),{workspaces:m,isLoading:b,isError:w,error:E}=x(),D=h(a??E,n),[O,k]=q.useState(null),[A,j]=q.useState(!1),[M,N]=q.useState(!1),{mutate:P,isPending:L,isSuccess:R}=K(),z=s(),B=L||R||z,V=q.useCallback(e=>{k(e),Z(e?.path??null)},[]);q.useEffect(()=>{let e=Oe();if(!e)return;let t=m.find(t=>t.path===e);if(t){k(e=>e?.path===t.path?e:t);return}!b&&!w&&!D&&(Z(null),k(t=>t?.path===e?null:t))},[w,b,m,D]);let H=l.length>0||!!D,U=null;D?U=D:b?U=n(o.HOME$LOADING):w&&(U=n(o.HOME$WORKSPACE_SCAN_ERROR));let W=!!D||e||b&&m.length===0;return(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Y.jsx)(ne,{width:24,height:24}),(0,Y.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(o.HOME$WORKSPACES_TAB)})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Y.jsx)(De,{workspaces:m,value:O,placeholder:D?n(o.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):W?n(o.HOME$LOADING):void 0,disabled:W,disabledTooltip:D,showManage:m.length>0||l.length>0,onChange:V,onAddClick:()=>j(!0),onManageClick:()=>N(!0),className:`max-w-auto`},O?.path??`empty-workspace-selection`),H&&U&&(0,Y.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:U})]}),(0,Y.jsx)(F,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!O||!t&&B||e,onClick:()=>{if(O){if(t){t(O);return}P({workingDir:O.path},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:t?n(o.BUTTON$CONFIRM):B?n(o.HOME$LOADING):`Launch`}),(0,Y.jsx)(v,{isOpen:A,onClose:()=>j(!1),onAdd:e=>u(e),onAddParent:e=>f(e)}),(0,Y.jsx)(S,{isOpen:M,workspaces:m,workspaceParents:l,onClose:()=>N(!1),onRemove:e=>{O?.path===e&&V(null),d(e)},onRemoveParent:e=>{O?.parentPath===e&&V(null),p(e)}})]})}function Ae({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=c(`openhands`),{isLoadingSettings:i}=H();return e?(0,Y.jsx)(O,{onClose:t,children:(0,Y.jsxs)(k,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Y.jsx)(G,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Y.jsx)(`div`,{className:`w-full pr-6`,children:(0,Y.jsx)(A,{title:r(o.HOME$OPEN_WORKSPACE)})}),(0,Y.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Y.jsx)(ke,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function je({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=I(),[i,a]=q.useState(null),[l,u]=q.useState(null),[d,f]=q.useState(null),{providers:p}=H(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=ee(),{mutate:_,isPending:v,isSuccess:y}=K(),b=s(),{t:x}=c(`openhands`);q.useEffect(()=>{if(p.length!==0){if(p.length===1&&!d){f(p[0]);return}if(p.length>1&&!d){let e=g();e&&p.includes(e)&&f(e)}}},[p,d,g]);let S=v||y||b,C=t=>{t!==d&&(f(t),h(t),a(null),u(null),e?.(null))},w=q.useCallback(e=>{u(e)},[]);return(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Y.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Y.jsx)(U,{width:24,height:24}),(0,Y.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(o.COMMON$OPEN_REPOSITORY)})]})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(o.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,Y.jsx)(_e,{providers:p,value:d,placeholder:`Select Provider`,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Y.jsx)(pe,{provider:d||p[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!d||t,onChange:t=>{t?(e?.(t),a(t)):(e?.(null),a(null),u(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Y.jsx)(ce,{repository:i?.full_name||null,provider:d||p[0],selectedBranch:l,onBranchSelect:w,defaultBranch:e,placeholder:`Select branch...`,className:`max-w-full`,disabled:!i||t})})()]}),(0,Y.jsx)(F,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!i||!l||!n&&S||p.length>1&&!d||t,onClick:()=>{if(!(!i||!l)){if(m(i),n){n({repository:i,branch:l,provider:d});return}_({repository:{name:i.full_name||``,gitProvider:i.git_provider||`github`,branch:l.name||`main`}},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:n?x(o.BUTTON$CONFIRM):S?x(o.HOME$LOADING):`Launch`})]})}function Me({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=c(`openhands`),{isLoadingSettings:i}=H();return e?(0,Y.jsx)(O,{onClose:t,children:(0,Y.jsxs)(k,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Y.jsx)(G,{onClose:t,testId:`close-open-repository-dialog`}),(0,Y.jsx)(`div`,{className:`w-full pr-6`,children:(0,Y.jsx)(A,{title:r(o.COMMON$OPEN_REPOSITORY)})}),(0,Y.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Y.jsx)(je,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Q(e,t){return e===`new_worktree`?o.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?o.COMMON$WORKSPACE_MODE_CLOUD_REPO:o.COMMON$WORKSPACE_MODE_LOCAL_REPO}var Ne=[`local_repo`,`new_worktree`];function $({mode:e}){return e===`new_worktree`?(0,Y.jsx)(p,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Y.jsx)(U,{width:12,height:12,color:`white`,"aria-hidden":!0})}function Pe({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:a}=c(`openhands`),[o,s]=(0,q.useState)(!1),l=(0,q.useRef)(null),u=a(Q(e,t));return(0,q.useEffect)(()=>{if(!o)return;let e=e=>{l.current&&!l.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,q.useEffect)(()=>{if(!o)return;let e=e=>{e.key===`Escape`&&s(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),(0,Y.jsxs)(`div`,{ref:l,className:`relative inline-flex`,children:[(0,Y.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":o,"aria-label":u,disabled:r,onClick:()=>s(e=>!e),className:E(`group flex flex-row items-center justify-between gap-2 pl-2.5 pr-2 py-1 rounded-[100px] truncate relative`,`border border-[rgba(71,74,84,0.50)] bg-transparent text-white`,r?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-[var(--oh-border-subtle)]`),children:[(0,Y.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Y.jsx)($,{mode:e})}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:u}),(0,Y.jsx)(m,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),o?(0,Y.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:E(`absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-1 shadow-lg`,R),children:Ne.map(r=>{let o=a(Q(r,t));return(0,Y.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),s(!1)},className:B,children:[(0,Y.jsx)(`span`,{className:V,children:(0,Y.jsx)($,{mode:r})}),(0,Y.jsx)(`span`,{className:`truncate`,children:o})]},r)})}):null]})}function Fe({workspace:e,repository:t,branch:n,provider:r,workspaceMode:i,backendKind:a,onRepoClick:o,onWorkspaceModeChange:s}){let c=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,Y.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Y.jsx)(ye,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Y.jsx)(Pe,{value:i,backendKind:a,onChange:s}):null,n?(0,Y.jsx)(ge,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function Ie(){let{t:e}=c(`openhands`),{backend:t}=D(),{navigate:n}=I(),r=t.kind===`local`,[a,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(null),[m,g]=(0,q.useState)(null),[_,v]=(0,q.useState)(null),[y,b]=(0,q.useState)(null),[x,S]=(0,q.useState)(`local_repo`),{mutate:w,isPending:T}=K(),E=s(),O=T||E,{isConfigured:k,isLoading:A}=ve(),j=!A&&!k,{images:M,files:N,imagesMarkedUploadAsFile:P,clearAllFiles:F}=te(),{handleUpload:L}=de(),{error:R}=C({enabled:r}),z=r?h(R,e):null,B=r?!!f:!!m&&!!_,V=he(null,t=>{let a=t.trim(),s=M.length>0||N.length>0;if(!a&&!s||O||j)return;let c={images:[...M],files:[...N]},d={query:s?void 0:a||void 0};r&&f?d={...d,workingDir:f.path,workspaceMode:x}:!r&&m&&_&&(d={...d,repository:{name:m.full_name,gitProvider:m.git_provider,branch:_.name}});let p=i.loading(e(o.HOME$CREATING_CONVERSATION),l);w(d,{onSuccess:async t=>{i.dismiss(p);try{sessionStorage.removeItem(Ce)}catch{}let o=t.conversation_id,l=o.startsWith(`task-`);if(s)if(!r||l){let e=t.task_id??(l?o.slice(5):null);if(!e){u(null);return}oe(e,{content:a,images:c.images,files:c.files,imagesMarkedUploadAsFile:[...P]}),F(),await J({conversationId:o,text:a,images:c.images,imagesMarkedUploadAsFile:P}),n(`/conversations/${o}`);return}else try{await se({conversationId:o,content:a,images:c.images,files:c.files,imagesMarkedUploadAsFile:P,t:e}),F()}catch(e){u(e instanceof Error?e.message:null);return}l&&a&&await J({conversationId:o,text:a,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${o}`)},onError:e=>{i.dismiss(p),u(e instanceof Error?e.message:null)}})});return(0,Y.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Y.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Y.jsx)(Te,{})}),(0,Y.jsx)(`div`,{className:`w-full`,children:(0,Y.jsx)(fe,{onSubmit:V,onFilesPaste:L,disabled:O||j})}),(0,Y.jsx)(`div`,{className:`flex justify-start`,children:B?(0,Y.jsx)(Fe,{workspace:f,repository:m,branch:_,provider:y,workspaceMode:x,backendKind:t.kind,onRepoClick:()=>d(!0),onWorkspaceModeChange:S}):(0,Y.jsx)(Ee,{kind:r?`local`:`cloud`,onClick:()=>d(!0),disabled:O||!!z,disabledTooltip:z})}),r?(0,Y.jsx)(Ae,{isOpen:a,onClose:()=>d(!1),onConfirm:e=>{p(e),g(null),v(null),b(null),S(`local_repo`)}}):(0,Y.jsx)(Me,{isOpen:a,onClose:()=>d(!1),onConfirm:({repository:e,branch:t,provider:n})=>{g(e),v(t),b(n??e.git_provider),p(null),S(`local_repo`)}})]})}function Le(){let e=b(r().search);return(0,Y.jsxs)(`div`,{"data-testid":`home-screen`,className:`custom-scrollbar-always flex h-full flex-col overflow-y-auto rounded-xl bg-transparent px-4 md:px-0 lg:px-[42px]`,children:[(0,Y.jsx)(xe,{}),(0,Y.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,Y.jsx)(Ie,{})}),e?null:(0,Y.jsx)(w,{})]})}var Re=n(Le);export{Re as default};
|