@openhands/agent-canvas 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-BQwoUBpe.js → acp-providers-DerAmTyY.js} +1 -1
- package/build/assets/{active-backend-context-BCXRv5pm.js → active-backend-context-B8rMv0X9.js} +1 -1
- package/build/assets/{add-backend-modal-BKHzq5no.js → add-backend-modal-CxC7BNEc.js} +1 -1
- package/build/assets/{agent-profiles-settings-CEp5CIz8.js → agent-profiles-settings-BJb8YXR1.js} +1 -1
- package/build/assets/{agent-server-compatibility-D6DSanlx.js → agent-server-compatibility-BWN-EIQn.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-cylugfDz.js → agent-server-conversation-service.api-DSPIkMwJ.js} +4 -4
- package/build/assets/{agent-settings-C-tann3x.js → agent-settings-CgCnqaAA.js} +1 -1
- package/build/assets/agent-settings-DDkSavD7.js +1 -0
- package/build/assets/{alert-banner-Dd4woGbm.js → alert-banner-Dh51WURQ.js} +1 -1
- package/build/assets/{api-key-entry-screen-Bll_CkuQ.js → api-key-entry-screen-iZc7n8AI.js} +1 -1
- package/build/assets/app-settings-B5zyipxJ.js +1 -0
- package/build/assets/{automation-detail-Z9dN2f5l.js → automation-detail-CZsu2CoM.js} +1 -1
- package/build/assets/{automation-export-D5uL0Tf8.js → automation-export-BwRX6H32.js} +1 -1
- package/build/assets/{automations-list-BMOWcqzZ.js → automations-list-lHAVzMoA.js} +1 -1
- package/build/assets/{back-nav-button-ZUDTMOTB.js → back-nav-button-DVknCcSP.js} +1 -1
- package/build/assets/backend-form-modal-RGcu909r.js +1 -0
- package/build/assets/{backend-synced-settings-badge-Db_REKVw.js → backend-synced-settings-badge-BSfN0AZA.js} +1 -1
- package/build/assets/{base-modal-Cb0C6m0Q.js → base-modal-CIF_785P.js} +1 -1
- package/build/assets/{brand-button-2Tp3aXk1.js → brand-button-B1izLAdR.js} +1 -1
- package/build/assets/{browser-QYLVr1kS.js → browser-DKaeq_sT.js} +2 -2
- package/build/assets/browser-store-BI6uklCG.js +1 -0
- package/build/assets/{browser-tab-BTTP1OE2.js → browser-tab-qb_ftCxW.js} +1 -1
- package/build/assets/{circle-plus-check-toggle-QQJKUnF6.js → circle-plus-check-toggle-DoFIjVE0.js} +1 -1
- package/build/assets/client-source-BZK8vRs2.js +1 -0
- package/build/assets/cloud-funnel-analytics-Zcv57hfT.js +1 -0
- package/build/assets/{color-themes-bVMmJJG6.js → color-themes-CHizm1xF.js} +1 -1
- package/build/assets/{combobox-caret-A5jMVHgE.js → combobox-caret-CxZpqoSR.js} +1 -1
- package/build/assets/{command-menu-BMVEme4H.js → command-menu-oTvKDU3Y.js} +1 -1
- package/build/assets/{command-store-jrWX_CcW.js → command-store-D8J5LMW1.js} +1 -1
- package/build/assets/{condenser-settings-CIa6eyB4.js → condenser-settings-BGlWn93P.js} +1 -1
- package/build/assets/{confirmation-modal-4n_944zq.js → confirmation-modal-DGBWM2Ls.js} +1 -1
- package/build/assets/{context-menu-list-item-DvfFic5I.js → context-menu-list-item-6psNyl7X.js} +1 -1
- package/build/assets/{conversation-D4o4dG2t.js → conversation-BoCYx8n2.js} +3 -3
- package/build/assets/conversation-DgHqMjnY.js +1 -0
- package/build/assets/conversation-panel-78Rxh_-I.js +1 -0
- package/build/assets/{conversation-service.api-0JG_fF9d.js → conversation-service.api-_f9GlIEi.js} +1 -1
- package/build/assets/conversation-state-store-B2Bp32XI.js +1 -0
- package/build/assets/{conversation-store-BCSpLuEf.js → conversation-store-LptbOvKa.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-Dp4Q_hXi.js → copy-to-clipboard-button-CFzH_NOX.js} +1 -1
- package/build/assets/{device-verify-CM086oKs.js → device-verify-WBSjJBLH.js} +1 -1
- package/build/assets/{dropdown-classes-DZq0BQjb.js → dropdown-classes-D3wMJlXT.js} +1 -1
- package/build/assets/{ellipsis-button-TPJdyxnK.js → ellipsis-button-CbNnHlIq.js} +1 -1
- package/build/assets/{entry.client-DypYHsYm.js → entry.client-DNlPGxsu.js} +2 -2
- package/build/assets/{enum-filter-dropdown-CW_mBg0e.js → enum-filter-dropdown-JLYv1t8L.js} +1 -1
- package/build/assets/{environment-switch-overlay-6laJch-9.js → environment-switch-overlay-B1PFO8P8.js} +1 -1
- package/build/assets/{extensions-hub-BJFbFfKS.js → extensions-hub-CCbLA7IM.js} +1 -1
- package/build/assets/{extensions-navigation-DqSl7CJw.js → extensions-navigation-CPNjMNvR.js} +1 -1
- package/build/assets/{files-tab-store-tfCav6bB.js → files-tab-store-DJsPxYdg.js} +1 -1
- package/build/assets/{files-tab-c316dKAq.js → files-tab-y4K7EXBO.js} +1 -1
- package/build/assets/{git-provider-icon-DUb2pEos.js → git-provider-icon-ITvsH4Ko.js} +1 -1
- package/build/assets/{home-D7ds4Jyw.js → home-BwbeOWwU.js} +1 -1
- package/build/assets/home-DKPGQ5P3.js +1 -0
- package/build/assets/index-home-Bko2Itv5.js +1 -0
- package/build/assets/{install-server-modal-CvHvzZj3.js → install-server-modal-Qk1gwyI8.js} +1 -1
- package/build/assets/{launch-A47TK2Me.js → launch-CAGavYl-.js} +1 -1
- package/build/assets/lesson-plan-DMCPdtrf.js +4 -0
- package/build/assets/{llm-not-configured-banner-B7DR8SPs.js → llm-not-configured-banner-C1ktyb3C.js} +1 -1
- package/build/assets/llm-settings-BBsZFi9l.js +1 -0
- package/build/assets/{llm-settings-Cvi7q4ox.js → llm-settings-DFkJQr_w.js} +1 -1
- package/build/assets/{llm-subscription-service-Cz1yBBvE.js → llm-subscription-service-Casyzgn1.js} +1 -1
- package/build/assets/{manage-backends-modal-DAVhNUCe.js → manage-backends-modal-CKQ46rvw.js} +1 -1
- package/build/assets/manifest-03478bbf.js +1 -0
- package/build/assets/{map-provider-XSFHmdDs.js → map-provider-BbIb12oh.js} +1 -1
- package/build/assets/{markdown-renderer-B6cJJ_MN.js → markdown-renderer-B4V2OMFP.js} +1 -1
- package/build/assets/{mcp-BwssgMpg.js → mcp-BapoJsDc.js} +1 -1
- package/build/assets/{messages-D8MeG2ZQ.js → messages-CUBFMY5o.js} +1 -1
- package/build/assets/{model-selector-BxTbbKub.js → model-selector-DJrMrFAr.js} +1 -1
- package/build/assets/{navigation-link-imH6S7h2.js → navigation-link-D8hfwvxI.js} +1 -1
- package/build/assets/{onboarding-CyicadGt.js → onboarding-6NMkdNxV.js} +1 -1
- package/build/assets/onboarding-modal-Q4AnpIdg.js +1 -0
- package/build/assets/{organization-service.api-QknzKDh3.js → organization-service.api-vrRNwOma.js} +1 -1
- package/build/assets/{path-utils-BECGet7G.js → path-utils-PNfCKQDV.js} +1 -1
- package/build/assets/{planner-tab-DPKHmMAX.js → planner-tab-ByOw1he8.js} +1 -1
- package/build/assets/{plugins-management-service-DuTTxquo.js → plugins-management-service-B75jyC56.js} +1 -1
- package/build/assets/{profiles-service.api-D6jvZOWu.js → profiles-service.api-BQTklD5D.js} +1 -1
- package/build/assets/providers-DfTB2gPd.js +1 -0
- package/build/assets/{proxy-CuhhyjdX.js → proxy-B3tCGf0X.js} +1 -1
- package/build/assets/{recommended-automations-launcher-DA6DWS7V.js → recommended-automations-launcher-Bj7PuHY1.js} +1 -1
- package/build/assets/root-CDnuTToz.js +2 -0
- package/build/assets/root-layout-DfYVlcRG.js +2 -0
- package/build/assets/{runtime-waiting-state-DeD9G7yJ.js → runtime-waiting-state-CnyVhX4T.js} +1 -1
- package/build/assets/{schema-field-BOLdL_U7.js → schema-field-CUwk4wrQ.js} +1 -1
- package/build/assets/{sdk-section-page-ZIltERxf.js → sdk-section-page-DLLNrYjI.js} +1 -1
- package/build/assets/{sdk-settings-schema-Ba_Pa9uf.js → sdk-settings-schema-CLR01YIK.js} +1 -1
- package/build/assets/{secrets-service-50DElFny.js → secrets-service-CvyPWJhg.js} +1 -1
- package/build/assets/{secrets-settings-Digl7JLe.js → secrets-settings-CHy72A5C.js} +1 -1
- package/build/assets/settings-B9S8UVQr.js +1 -0
- package/build/assets/{settings-dropdown-input-BD5C9fBn.js → settings-dropdown-input-Dhx9ErGd.js} +1 -1
- package/build/assets/{settings-index-CODBijya.js → settings-index-BKDl2CQ-.js} +1 -1
- package/build/assets/{settings-input-CzNOq-Pj.js → settings-input-BsgQWS5R.js} +1 -1
- package/build/assets/{settings-list-classes-CuxH9ZoR.js → settings-list-classes-DSJJX99U.js} +1 -1
- package/build/assets/{settings-modal-BcSWpKI0.js → settings-modal-DeK11CyT.js} +1 -1
- package/build/assets/{settings-service.api-Bsu1PvYO.js → settings-service.api-DXk5TdeJ.js} +1 -1
- package/build/assets/{settings-switch-DqmHAfWJ.js → settings-switch-Bes8dIlV.js} +1 -1
- package/build/assets/{settings-utils-B1lBErvV.js → settings-utils-DzCVfiR3.js} +1 -1
- package/build/assets/{shared-conversation-CDskdmrb.js → shared-conversation-9atDzTR4.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DmCmZgq1.js → sidebar-mobile-menu-toggle-giMMZctn.js} +1 -1
- package/build/assets/{sidebar-nav-link-DMc8AIe7.js → sidebar-nav-link-CHqyFXwV.js} +1 -1
- package/build/assets/{sidebar-store-DXWSCFpa.js → sidebar-store-uiUXBU1N.js} +1 -1
- package/build/assets/{skill-card-pill-row-DOIWjiMF.js → skill-card-pill-row-BPYKQ3IN.js} +1 -1
- package/build/assets/{skills-plugins-DLgINYuY.js → skills-plugins-Tropusio.js} +1 -1
- package/build/assets/{skills-settings-DPiCWalR.js → skills-settings-BvzBBCWk.js} +1 -1
- package/build/assets/{task-list-tab-CuhcDycu.js → task-list-tab-DyfgG4MC.js} +1 -1
- package/build/assets/telemetry-C5JMEfqB.js +2 -0
- package/build/assets/{terminal-CVqF-tCD.js → terminal-DRXt2Lr4.js} +1 -1
- package/build/assets/{typography-CQn9wyEX.js → typography-CzfoD9DY.js} +1 -1
- package/build/assets/{use-acp-credential-form-LlfZO_DD.js → use-acp-credential-form-Bm8qXdlc.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DpQjsXM0.js → use-activate-agent-profile-DlykqEfN.js} +1 -1
- package/build/assets/{use-active-agent-profile-Gw_uJujV.js → use-active-agent-profile-hI-x-UBa.js} +1 -1
- package/build/assets/{use-active-conversation-B0sttISF.js → use-active-conversation-2qeez40F.js} +1 -1
- package/build/assets/{use-agent-profiles-LHZEK0Gg.js → use-agent-profiles-0pr5bLS7.js} +1 -1
- package/build/assets/{use-agent-state-C5uA0bRj.js → use-agent-state-C6peDXUm.js} +1 -1
- package/build/assets/{use-backends-health-DKt1SmiU.js → use-backends-health-CLHPitJM.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BAtqsbCi.js → use-can-manage-org-profiles-Ck_bsNbH.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-C8m1oBy4.js → use-cloud-current-user-id-DUCSxNjY.js} +1 -1
- package/build/assets/use-config-B5r8erYt.js +1 -0
- package/build/assets/{use-create-conversation-CWQGNQ9J.js → use-create-conversation-r1JHfKO5.js} +1 -1
- package/build/assets/{use-create-secret-BIrsX3OB.js → use-create-secret-Cf2N11d2.js} +1 -1
- package/build/assets/{use-event-store-CsD17BKu.js → use-event-store-Bbaz51GR.js} +1 -1
- package/build/assets/{use-handle-plan-click-DEuO7Byo.js → use-handle-plan-click-CsAW3FlH.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-CdHOoQGM.js → use-launch-skill-in-chat-DJWEfVc5.js} +1 -1
- package/build/assets/{use-llm-profiles-DQpQxVOD.js → use-llm-profiles-Dr5__SlZ.js} +1 -1
- package/build/assets/{use-plugins-marketplace-Bkk07W_M.js → use-plugins-marketplace-BplU65ae.js} +1 -1
- package/build/assets/use-runtime-is-ready-vCFOcLFa.js +1 -0
- package/build/assets/{use-save-agent-profile-BxEsjnW0.js → use-save-agent-profile-RqUGqTv6.js} +1 -1
- package/build/assets/{use-save-settings-ioSUMqbE.js → use-save-settings-Chvzeu2s.js} +1 -1
- package/build/assets/{use-settings-DNJC4gqu.js → use-settings-CyxSlyTQ.js} +1 -1
- package/build/assets/{use-settings-nav-items-BUsrDbVR.js → use-settings-nav-items-zEkSO_Bf.js} +1 -1
- package/build/assets/{use-skills-BsmKm23M.js → use-skills-xrVoKYrF.js} +1 -1
- package/build/assets/{use-task-list-rs7Xbzl8.js → use-task-list-CfisapBW.js} +1 -1
- package/build/assets/use-tracking-D2Qg5Lpd.js +1 -0
- package/build/assets/{use-user-conversation-B337kUKB.js → use-user-conversation-CnE4zhOA.js} +1 -1
- package/build/assets/{vendor~browser-tab-Xn94EtUo.js → vendor~browser-tab-CsMb-pta.js} +1 -1
- package/build/assets/{vendor~browser-5Njjw1Cl.js → vendor~browser-wXQ-WZEC.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-BIieS_OD.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js} +2 -2
- package/build/assets/{vendor~files-tab-CiC3-lGh.js → vendor~files-tab-B-5fBohe.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DWteoTyr.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BD7v71DM.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-tlf6AnDe.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BT05Osu4.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B8XNNEQZ.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-COhHANvV.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dc5nKwLO.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DgzWSMRc.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CnJRLn5s.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DqZatR3B.js} +1 -1
- package/build/assets/{vendor~launch-28DK5Rsl.js → vendor~launch-_Km3J77E.js} +1 -1
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g9hift2g-DmmpG9SI.js → vendor~module-D5a_AClf.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-lYNG9C1U.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-Zhq6xAxR.js → vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-B81b08bw.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-jpyLM1Nn.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js} +1 -1
- package/build/assets/{verification-settings-HRgEM-_3.js → verification-settings-CfkrXoSa.js} +1 -1
- package/build/index.html +4 -4
- package/config/defaults.json +1 -1
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.js +4 -4
- package/dist/api/option-service/option-service.api.cjs +1 -1
- package/dist/api/option-service/option-service.api.cjs.map +1 -1
- package/dist/api/option-service/option-service.api.js +0 -1
- package/dist/api/option-service/option-service.api.js.map +1 -1
- package/dist/api/option-service/option.types.d.ts +0 -1
- 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.d.ts +1 -1
- package/dist/components/features/backends/backend-form-modal.js +137 -144
- package/dist/components/features/backends/backend-form-modal.js.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs +1 -1
- package/dist/components/providers/agent-server-ui-providers.cjs.map +1 -1
- package/dist/components/providers/agent-server-ui-providers.d.ts +4 -2
- package/dist/components/providers/agent-server-ui-providers.js +9 -2
- package/dist/components/providers/agent-server-ui-providers.js.map +1 -1
- package/dist/components/providers/index.cjs +1 -1
- package/dist/components/providers/index.d.ts +1 -2
- package/dist/components/providers/index.js +0 -1
- package/dist/components/providers/telemetry-provider.cjs +2 -0
- package/dist/components/providers/telemetry-provider.cjs.map +1 -0
- package/dist/components/providers/telemetry-provider.d.ts +6 -0
- package/dist/components/providers/telemetry-provider.js +64 -0
- package/dist/components/providers/telemetry-provider.js.map +1 -0
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.js +197 -204
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs.map +1 -1
- package/dist/hooks/mutation/use-save-settings.d.ts +3 -1
- package/dist/hooks/mutation/use-save-settings.js +6 -5
- package/dist/hooks/mutation/use-save-settings.js.map +1 -1
- package/dist/hooks/use-telemetry.cjs +1 -1
- package/dist/hooks/use-telemetry.cjs.map +1 -1
- package/dist/hooks/use-telemetry.d.ts +3 -3
- package/dist/hooks/use-telemetry.js +16 -22
- package/dist/hooks/use-telemetry.js.map +1 -1
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +3 -4
- package/dist/hooks/use-tracking.js +37 -37
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/index.d.ts +2 -2
- 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/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.cjs.map +1 -1
- package/dist/routes/app-settings.js +66 -68
- package/dist/routes/app-settings.js.map +1 -1
- package/dist/routes/llm-settings.cjs +1 -1
- package/dist/routes/llm-settings.cjs.map +1 -1
- package/dist/routes/llm-settings.js +4 -1
- package/dist/routes/llm-settings.js.map +1 -1
- package/dist/services/cloud-funnel-analytics.cjs +1 -1
- package/dist/services/cloud-funnel-analytics.cjs.map +1 -1
- package/dist/services/cloud-funnel-analytics.d.ts +3 -11
- package/dist/services/cloud-funnel-analytics.js +16 -30
- package/dist/services/cloud-funnel-analytics.js.map +1 -1
- package/dist/services/telemetry.cjs +1 -1
- package/dist/services/telemetry.cjs.map +1 -1
- package/dist/services/telemetry.d.ts +46 -9
- package/dist/services/telemetry.js +181 -72
- package/dist/services/telemetry.js.map +1 -1
- package/dist/themes/color-themes.cjs.map +1 -1
- package/dist/themes/color-themes.d.ts +3 -6
- package/dist/themes/color-themes.js.map +1 -1
- package/dist/utils/error-handler.cjs +1 -1
- package/dist/utils/error-handler.cjs.map +1 -1
- package/dist/utils/error-handler.d.ts +1 -4
- package/dist/utils/error-handler.js +6 -7
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/map-provider.cjs +1 -1
- package/dist/utils/map-provider.cjs.map +1 -1
- package/dist/utils/map-provider.d.ts +1 -0
- package/dist/utils/map-provider.js +2 -1
- package/dist/utils/map-provider.js.map +1 -1
- package/package.json +2 -2
- package/build/assets/agent-settings-DGUKNSnU.js +0 -1
- package/build/assets/app-settings-BpViWwpC.js +0 -1
- package/build/assets/backend-form-modal-DhBT8P4g.js +0 -1
- package/build/assets/browser-store-BGXOGo-R.js +0 -1
- package/build/assets/client-source-Biqarhgr.js +0 -1
- package/build/assets/cloud-funnel-analytics-D-27T5Ao.js +0 -1
- package/build/assets/conversation-CHnEXGRM.js +0 -1
- package/build/assets/conversation-panel-11FjLCId.js +0 -1
- package/build/assets/conversation-state-store-JiUQp02U.js +0 -1
- package/build/assets/handle-capture-consent-DDnXMC9Y.js +0 -1
- package/build/assets/home-BQ-DC06B.js +0 -1
- package/build/assets/index-home-BRFDWs_4.js +0 -1
- package/build/assets/lesson-plan-DSf95kQ2.js +0 -4
- package/build/assets/llm-settings-Ch4ZbW3c.js +0 -1
- package/build/assets/manifest-958c741a.js +0 -1
- package/build/assets/onboarding-modal-DQwihcTz.js +0 -1
- package/build/assets/option-service.api-DAkg_F7p.js +0 -1
- package/build/assets/package-Dk_VtWJ4.js +0 -1
- package/build/assets/providers-B8pxQK8x.js +0 -1
- package/build/assets/root-BhP6bTBB.js +0 -2
- package/build/assets/root-layout-oBaHHW4s.js +0 -2
- package/build/assets/settings-BfgLHsgd.js +0 -1
- package/build/assets/telemetry-DHiTRl5_.js +0 -2
- package/build/assets/use-config-CXy4vD0H.js +0 -1
- package/build/assets/use-runtime-is-ready-D4pkGT6E.js +0 -1
- package/build/assets/use-tracking-poxQHMwR.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ljq5gbus-B2XD4bi2.js +0 -1
- package/dist/components/providers/posthog-wrapper.cjs +0 -2
- package/dist/components/providers/posthog-wrapper.cjs.map +0 -1
- package/dist/components/providers/posthog-wrapper.d.ts +0 -4
- package/dist/components/providers/posthog-wrapper.js +0 -49
- package/dist/components/providers/posthog-wrapper.js.map +0 -1
- package/dist/node_modules/posthog-js/react/dist/esm/index.cjs +0 -2
- package/dist/node_modules/posthog-js/react/dist/esm/index.cjs.map +0 -1
- package/dist/node_modules/posthog-js/react/dist/esm/index.js +0 -113
- package/dist/node_modules/posthog-js/react/dist/esm/index.js.map +0 -1
- package/dist/utils/handle-capture-consent.cjs +0 -2
- package/dist/utils/handle-capture-consent.cjs.map +0 -1
- package/dist/utils/handle-capture-consent.d.ts +0 -7
- package/dist/utils/handle-capture-consent.js +0 -8
- package/dist/utils/handle-capture-consent.js.map +0 -1
- /package/build/assets/{__vite-browser-external-DU-Cb_sT.js → __vite-browser-external-BQUj0sYu.js} +0 -0
- /package/build/assets/{agent-server-ui-style-scope-COnDHTm5.js → agent-server-ui-style-scope-qhnhZHBV.js} +0 -0
- /package/build/assets/{automation-BVEmGghX.js → automation-LZB0MjdV.js} +0 -0
- /package/build/assets/{canvas-ui-BhxjoA1f.js → canvas-ui-COgjltGz.js} +0 -0
- /package/build/assets/{checkmark-DhcMGwtO.js → checkmark-h7udgXMM.js} +0 -0
- /package/build/assets/{close-DO5Rq_CS.js → close-DLFb5kfv.js} +0 -0
- /package/build/assets/{code-tag-BvjtzUsr.js → code-tag-DYlAhEQY.js} +0 -0
- /package/build/assets/{conversation-local-storage-B31voBg7.js → conversation-local-storage-F6zVMM--.js} +0 -0
- /package/build/assets/{conversation-tab-empty-state-BUhKVwoi.js → conversation-tab-empty-state-CNUmIms2.js} +0 -0
- /package/build/assets/{copy-DLUw2us-.js → copy-BLmGeJcd.js} +0 -0
- /package/build/assets/{dist-Dj01FXbZ.js → dist-CodhvuAP.js} +0 -0
- /package/build/assets/{environment-switch-store-D9hB9PvY.js → environment-switch-store-DkjlKWzN.js} +0 -0
- /package/build/assets/{extension-module-card-classes-BlO4w702.js → extension-module-card-classes-9V3J9J_b.js} +0 -0
- /package/build/assets/{folder-ynxP2EIL.js → folder-Bk311brm.js} +0 -0
- /package/build/assets/{form-control-classes-CvUaw8_L.js → form-control-classes-CbdN5aO3.js} +0 -0
- /package/build/assets/{get-language-from-path-rWEQrOGU.js → get-language-from-path-DBqBsCWH.js} +0 -0
- /package/build/assets/{git-status-mapper-C3rfzUex.js → git-status-mapper-DnL9OC8_.js} +0 -0
- /package/build/assets/{iconBase-CuvxAQZ5.js → iconBase-Dz51Zn5x.js} +0 -0
- /package/build/assets/{link-external-BVDiJfZt.js → link-external-CaBmUEs_.js} +0 -0
- /package/build/assets/{llm-subscription-BkdHwtQe.js → llm-subscription-DtsX5Lhg.js} +0 -0
- /package/build/assets/{loading-spinner-Txxx1I1p.js → loading-spinner-BcdnT0mN.js} +0 -0
- /package/build/assets/{middleware-CWYDMVuG.js → middleware-DYHYNAnP.js} +0 -0
- /package/build/assets/{modal-backdrop-Dsmzgr5s.js → modal-backdrop-zVwfOJZr.js} +0 -0
- /package/build/assets/{modal-body-CDZdZ-eT.js → modal-body-Cc2zp0xb.js} +0 -0
- /package/build/assets/{modal-classes-B4oit_4c.js → modal-classes-3qT9Ap7Q.js} +0 -0
- /package/build/assets/{modal-close-button-DQElFMPo.js → modal-close-button-BcIBUdSq.js} +0 -0
- /package/build/assets/{navigation-context-SjzfpygH.js → navigation-context-DPs2G0X8.js} +0 -0
- /package/build/assets/{objectWithoutPropertiesLoose-CQwg6tC0.js → objectWithoutPropertiesLoose-BgYIAs2y.js} +0 -0
- /package/build/assets/{openhands-logo-C-gDp1wr.js → openhands-logo-bcNw5bkY.js} +0 -0
- /package/build/assets/{plan-components-CgPHWz3E.js → plan-components-BdZXPyZU.js} +0 -0
- /package/build/assets/{react-ao3tWj6K.js → react-DPDgL6du.js} +0 -0
- /package/build/assets/{search-pb4UKTfK.js → search-BgOCR7_c.js} +0 -0
- /package/build/assets/{segmented-toggle-C1-ZVyr5.js → segmented-toggle-kzwZkLaj.js} +0 -0
- /package/build/assets/{settings-gear-D_HVvE5L.js → settings-gear-MXCyZW0x.js} +0 -0
- /package/build/assets/{settings-like-page-layout-classes-DLrsPCaI.js → settings-like-page-layout-classes-Cdl6jOe5.js} +0 -0
- /package/build/assets/{settings-DksoDv5z.js → settings-mQUckT0g.js} +0 -0
- /package/build/assets/{settings-section-header-context-C2MUIG88.js → settings-section-header-context-COMOIaxV.js} +0 -0
- /package/build/assets/{sidebar-layout-Cn6eQaEI.js → sidebar-layout-Bm7pa3Vk.js} +0 -0
- /package/build/assets/{skills-CH4xgIh-.js → skills-EqzxYBvT.js} +0 -0
- /package/build/assets/{styled-tooltip-CvsjHuIf.js → styled-tooltip-B14i_Uac.js} +0 -0
- /package/build/assets/{switch-skeleton-BpSOvZ-n.js → switch-skeleton-DqQwalyu.js} +0 -0
- /package/build/assets/{terminal-Dokfkxn0.js → terminal-Cgf___rK.js} +0 -0
- /package/build/assets/{toggle-switch-CS0ClOy2.js → toggle-switch-DX_k418f.js} +0 -0
- /package/build/assets/{u-check-circle-DPWVO-9N.js → u-check-circle-BqoIxNz_.js} +0 -0
- /package/build/assets/{u-check-circle-half-BGNAAjOW.js → u-check-circle-half-MsShT8Ec.js} +0 -0
- /package/build/assets/{u-edit-BIskOoEG.js → u-edit-DL5LgKon.js} +0 -0
- /package/build/assets/{use-breakpoint-OjLm94cF.js → use-breakpoint-BP3lqLMx.js} +0 -0
- /package/build/assets/{use-click-outside-element-Jpt2WWd7.js → use-click-outside-element-D9BYdANT.js} +0 -0
- /package/build/assets/{use-is-authed-Dvbpiu3B.js → use-is-authed-BezEyfeh.js} +0 -0
- /package/build/assets/{use-onboarding-completion-DkRpDTsD.js → use-onboarding-completion-C_Swglzp.js} +0 -0
- /package/build/assets/{v4-DPgam_jW.js → v4-DbCkTSoU.js} +0 -0
- /package/build/assets/{vendor~browser-BvEKaLBz.js → vendor~browser-By2MVv_N.js} +0 -0
- /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-CznX01nZ.js → vendor~conversation-panel~conversation~alert-banner-CxfzCmkN.js} +0 -0
- /package/build/assets/{vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-BuL5kjfS.js → vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-FghQ3Z1a.js} +0 -0
- /package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-DUYl8gbZ.js → vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js} +0 -0
- /package/build/assets/{vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-pIgQDxTc.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js} +0 -0
- /package/build/assets/{vendor~terminal-jAaNQWS9.js → vendor~terminal-CnKZILnC.js} +0 -0
- /package/build/assets/{x-mark-C5przfXl.js → x-mark-Batp6gXa.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,St as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{n as i}from"./vendor~entry.client-DDuH4--y.js";import{t as a}from"./vendor~entry.client-DQGrNspu.js";import{n as o,t as s}from"./providers-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-DKaeq_sT.js","assets/vendor~browser-wXQ-WZEC.js","assets/vendor~browser-By2MVv_N.js","assets/llm-subscription-DtsX5Lhg.js","assets/settings-mQUckT0g.js","assets/common-CxbUL3nR.js","assets/automation-LZB0MjdV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,St as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{n as i}from"./vendor~entry.client-DDuH4--y.js";import{t as a}from"./vendor~entry.client-DQGrNspu.js";import{n as o,t as s}from"./providers-DfTB2gPd.js";import{L as c}from"./active-backend-context-B8rMv0X9.js";var l=e(t(),1),u=a();function d({mockApi:e=void 0,hasWindow:t=typeof window<`u`}={}){return t&&e===`true`}var f=r();async function p(){if(await c(),d()){let{worker:e}=await n(async()=>{let{worker:e}=await import(`./browser-DKaeq_sT.js`);return{worker:e}},__vite__mapDeps([0,1,2,3,4,5,6]));await e.start({onUnhandledRequest:`bypass`})}}p().then(()=>(0,l.startTransition)(()=>{(0,u.hydrateRoot)(document,(0,f.jsx)(l.StrictMode,{children:(0,f.jsx)(s,{analytics:o,withStyleRoot:!1,children:(0,f.jsx)(i,{})})}))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{t as a}from"./check-TbOEtHKj.js";import{t as o}from"./chevron-down-D7IvFMBM.js";import{t as s}from"./utils-DB9LsAzA.js";import{i as c,o as l,t as u}from"./dropdown-classes-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{t as a}from"./check-TbOEtHKj.js";import{t as o}from"./chevron-down-D7IvFMBM.js";import{t as s}from"./utils-DB9LsAzA.js";import{i as c,o as l,t as u}from"./dropdown-classes-D3wMJlXT.js";import{t as d}from"./use-click-outside-element-D9BYdANT.js";var f=e(t(),1),p=n();function m({testId:e,value:t,onChange:n,options:m,labelKeyByValue:h}){let{t:g}=r(`openhands`),[_,v]=f.useState(!1),y=d(()=>v(!1)),b=m[0],x=g(h[t]);return(0,p.jsxs)(`div`,{ref:y,className:`relative shrink-0 w-auto`,"data-testid":e,children:[(0,p.jsxs)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,"aria-haspopup":`menu`,"aria-expanded":_,"aria-label":g(i.CONVERSATION_PANEL$FILTER_LABEL),onClick:()=>v(e=>!e),className:s(u,b&&t!==b&&`border-white/60 bg-white/10`),children:[(0,p.jsx)(`span`,{className:`whitespace-nowrap`,children:x}),(0,p.jsx)(o,{className:s(`h-4 w-4 shrink-0 text-tertiary-alt transition-transform`,_&&`rotate-180`),"aria-hidden":!0})]}),_?(0,p.jsx)(`div`,{role:`menu`,"data-testid":`${e}-menu`,"aria-label":g(i.CONVERSATION_PANEL$FILTER_LABEL),className:s(`absolute right-0 top-full z-50 mt-1 min-w-full w-max`,`max-h-60 overflow-auto rounded-[6px] bg-tertiary p-1 context-menu-box-shadow`,c),children:m.map(r=>{let i=r===t;return(0,p.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":i,"data-testid":`${e}-${r}`,onClick:()=>{n(r),v(!1)},className:s(l,i&&`bg-[var(--oh-interactive-selected)]`),children:[(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:g(h[r])}),i?(0,p.jsx)(a,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}):null]},r)})}):null]})}export{m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,xt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./environment-switch-store-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,xt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./environment-switch-store-DkjlKWzN.js";var p=e(t(),1),m=e(r(),1),h=n();function g({className:e}){return(0,h.jsxs)(`svg`,{viewBox:`0 0 74.17 22`,xmlns:`http://www.w3.org/2000/svg`,className:e,"aria-hidden":!0,children:[(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`rect`,{x:`1`,y:`1`,width:`20`,height:`8`,rx:`2`,ry:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,h.jsx)(`rect`,{x:`1`,y:`13`,width:`20`,height:`8`,rx:`2`,ry:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,h.jsx)(`line`,{x1:`5`,y1:`5`,x2:`5.01`,y2:`5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,h.jsx)(`line`,{x1:`5`,y1:`17`,x2:`5.01`,y2:`17`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]}),(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`rect`,{x:`53.17`,y:`1`,width:`20`,height:`8`,rx:`2`,ry:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,h.jsx)(`rect`,{x:`53.17`,y:`13`,width:`20`,height:`8`,rx:`2`,ry:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,h.jsx)(`line`,{x1:`57.17`,y1:`5`,x2:`57.18`,y2:`5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,h.jsx)(`line`,{x1:`57.17`,y1:`17`,x2:`57.18`,y2:`17`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]}),(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`path`,{d:`M43.09,7l4,4-4,4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,h.jsx)(`path`,{d:`M27.09,11h20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,h.jsx)(`path`,{d:`M31.09,7l-4,4,4,4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})]})}function _(){let{t:e}=i(`openhands`),{visible:t,target:n}=p.useSyncExternalStore(l,o,o);return!t||typeof document>`u`?null:(0,m.createPortal)((0,h.jsx)(`div`,{"data-testid":`environment-switch-overlay`,"data-target":n,className:`environment-switch-overlay pointer-events-none fixed inset-0 z-[2147483646] flex items-center justify-center`,"aria-live":`polite`,"aria-atomic":`true`,children:(0,h.jsxs)(`div`,{className:`pointer-events-none flex min-w-[280px] max-w-[420px] flex-col items-center gap-2 rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] px-5 py-4 text-[var(--oh-foreground)] shadow-2xl`,children:[(0,h.jsx)(g,{className:`mb-2 h-6 w-20 shrink-0 text-[var(--oh-foreground)]`}),(0,h.jsx)(`p`,{className:`text-center text-sm font-medium`,children:e(a.BACKEND$SWITCHING_TO,{environment:n})})]})}),document.body)}export{f as ENVIRONMENT_SWITCH_DURATION_MS,c as ENVIRONMENT_SWITCH_SETACTIVE_DELAY_MS,_ as EnvironmentSwitchOverlay,_ as default,u as __resetEnvironmentSwitchOverlayForTests,s as dismissEnvironmentSwitch,d as triggerEnvironmentSwitch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{L as t,s as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{t as a}from"./sidebar-nav-link-
|
|
1
|
+
import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{L as t,s as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as r}from"./useTranslation-Cbf5AGg_.js";import{t as i}from"./declaration-BGsHjPEW.js";import{t as a}from"./sidebar-nav-link-CHqyFXwV.js";import{r as o}from"./typography-CzfoD9DY.js";import{t as s}from"./use-breakpoint-BP3lqLMx.js";import{t as c}from"./backend-synced-settings-badge-BSfN0AZA.js";import{t as l}from"./extensions-navigation-CPNjMNvR.js";var u=e();function d(){let{t:e}=r(`openhands`);return(0,u.jsxs)(`div`,{"data-testid":`extensions-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,u.jsx)(o.H2,{children:e(i.NAV$CUSTOMIZE)}),(0,u.jsx)(`nav`,{className:`flex flex-col gap-0.5`,children:l.map(e=>(0,u.jsx)(a,{to:e.to,label:e.label,end:e.end,testId:`sidebar-extensions-${e.to}`,icon:e.icon,disabled:e.comingSoon},e.to))}),(0,u.jsx)(`div`,{className:`pt-1`,children:(0,u.jsx)(c,{})})]})}var f=t(function(){return s(768)?(0,u.jsx)(d,{}):(0,u.jsx)(n,{to:`/skills`,replace:!0})});export{f as default};
|
package/build/assets/{extensions-navigation-DqSl7CJw.js → extensions-navigation-CPNjMNvR.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-Cbf5AGg_.js";import{t as r}from"./declaration-BGsHjPEW.js";import{t as i}from"./utils-DB9LsAzA.js";import{t as a}from"./navigation-link-
|
|
1
|
+
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-Cbf5AGg_.js";import{t as r}from"./declaration-BGsHjPEW.js";import{t as i}from"./utils-DB9LsAzA.js";import{t as a}from"./navigation-link-D8hfwvxI.js";import{f as o,o as s}from"./sidebar-layout-Bm7pa3Vk.js";import{t as c}from"./skills-EqzxYBvT.js";import{t as l}from"./backend-synced-settings-badge-BSfN0AZA.js";e();var u=t(),d=[{to:`/skills`,label:`Skills`,icon:(0,u.jsx)(c,{width:16,height:16,"aria-hidden":`true`}),end:!0},{to:`/mcp`,label:`MCP Servers`,icon:(0,u.jsx)(e=>(0,u.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M2.25 3H21.75L22.5 3.75V13.5H21V9H3V19.5H13.5V21H2.25L1.5 20.25V3.75L2.25 3ZM3 7.5H21V4.5H3V7.5ZM10.5 18V16.359C10.2451 16.2664 10.0074 16.132 9.7965 15.9615L8.379 16.77L7.629 15.48L9.0345 14.6595C8.98649 14.3881 8.98649 14.1104 9.0345 13.839L7.629 13.02L8.379 11.73L9.7965 12.54C10.023 12.36 10.2585 12.2265 10.5 12.141V10.5H12V12.141C12.2568 12.2293 12.4953 12.3641 12.7035 12.5385L14.121 11.73L14.871 13.02L13.4655 13.8405C13.5133 14.1114 13.5133 14.3886 13.4655 14.6595L14.871 15.48L14.121 16.77L12.7035 15.96C12.4903 16.1274 12.2531 16.2619 12 16.359V18H10.5ZM10.125 14.25C10.125 14.562 10.2345 14.8275 10.4535 15.0465C10.5568 15.1528 10.6807 15.2367 10.8177 15.2932C10.9547 15.3497 11.1018 15.3776 11.25 15.375C11.3982 15.3776 11.5453 15.3497 11.6823 15.2932C11.8193 15.2367 11.9432 15.1528 12.0465 15.0465C12.1528 14.9432 12.2367 14.8193 12.2932 14.6823C12.3497 14.5453 12.3776 14.3982 12.375 14.25C12.3776 14.1018 12.3497 13.9547 12.2932 13.8177C12.2367 13.6807 12.1528 13.5568 12.0465 13.4535C11.9432 13.3472 11.8193 13.2633 11.6823 13.2068C11.5453 13.1503 11.3982 13.1224 11.25 13.125C11.1018 13.1224 10.9547 13.1503 10.8177 13.2068C10.6807 13.2633 10.5568 13.3472 10.4535 13.4535C10.3472 13.5568 10.2633 13.6807 10.2068 13.8177C10.1503 13.9547 10.1224 14.1018 10.125 14.25ZM18.126 22.5V20.859C17.8711 20.7663 17.6334 20.632 17.4225 20.4615L16.005 21.27L15.255 19.98L16.662 19.1595C16.614 18.8881 16.614 18.6104 16.662 18.339L15.255 17.52L16.005 16.23L17.4225 17.04C17.649 16.86 17.8845 16.7265 18.1275 16.641V15H19.6275V16.641C19.8837 16.7297 20.1216 16.8644 20.3295 17.0385L21.747 16.23L22.497 17.52L21.0915 18.3405C21.1396 18.6114 21.1396 18.8886 21.0915 19.1595L22.497 19.98L21.747 21.27L20.3295 20.46C20.1163 20.6275 19.8791 20.762 19.626 20.859V22.5H18.126ZM17.751 18.75C17.751 19.062 17.8605 19.3275 18.0795 19.5465C18.1828 19.6528 18.3067 19.7367 18.4437 19.7932C18.5807 19.8497 18.7278 19.8776 18.876 19.875C19.0242 19.8776 19.1713 19.8497 19.3083 19.7932C19.4453 19.7367 19.5692 19.6528 19.6725 19.5465C19.779 19.4434 19.8633 19.3195 19.9201 19.1825C19.9768 19.0455 20.0049 18.8983 20.0025 18.75C20.0049 18.6017 19.9768 18.4545 19.9201 18.3175C19.8633 18.1805 19.779 18.0566 19.6725 17.9535C19.5694 17.8474 19.4457 17.7636 19.309 17.7071C19.1722 17.6506 19.0254 17.6226 18.8775 17.625C18.7291 17.6222 18.5817 17.65 18.4444 17.7065C18.3072 17.763 18.183 17.847 18.0795 17.9535C17.9732 18.0568 17.8893 18.1807 17.8328 18.3177C17.7763 18.4547 17.7484 18.6018 17.751 18.75Z`,fill:`currentColor`})}),{width:16,height:16}),end:!0},{to:`/plugins`,label:`Plugins`,icon:(0,u.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,width:16,height:16,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}),(0,u.jsx)(`path`,{d:`m3.3 7 8.7 5 8.7-5`}),(0,u.jsx)(`path`,{d:`M12 22V12`})]}),end:!0}];function f(){let{t:e}=n(`openhands`);return(0,u.jsxs)(`aside`,{"data-testid":`extensions-navbar-desktop`,className:`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2 md:sticky md:top-8 md:self-start`,children:[(0,u.jsx)(`span`,{className:`px-2 text-sm font-normal text-white`,children:e(r.NAV$CUSTOMIZE)}),(0,u.jsx)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:d.map(t=>{let n=(0,u.jsx)(`span`,{className:`shrink-0 flex items-center justify-center`,children:t.icon}),c=(0,u.jsx)(`span`,{className:`truncate`,children:t.label}),l=t.comingSoon&&(0,u.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-white/20 bg-white/5 px-1.5 py-0.5 text-[10px] font-medium text-[var(--oh-text-dim)]`,children:e(r.NAV$COMING_SOON)});return(0,u.jsxs)(a,{to:t.to,end:t.end,"data-testid":`sidebar-extensions-${t.to}`,className:({isActive:e})=>i(o(),`truncate`,e?s.active:s.idle),children:[n,c,l]},t.to)})}),(0,u.jsx)(`div`,{className:`px-2 pt-3`,children:(0,u.jsx)(l,{})})]})}export{f as n,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./react-
|
|
1
|
+
import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./react-DPDgL6du.js";e();var r=t(),i=e=>(0,r.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,r.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.565 6.435L16.065 1.935L15 1.5H6L4.5 3V21L6 22.5H19.5L21 21V7.5L20.565 6.435ZM19.5 21H6V3H13.5V9H19.5V21ZM15 7.5V3L19.5 7.5H15Z`,fill:`currentColor`})}),a=n(e=>({selectedPath:null,selectedConversationId:null,setSelectedPath:(t,n=null)=>e({selectedPath:t,selectedConversationId:n})}));export{i as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{s as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as a}from"./useQuery-D5pEZbY0.js";import{t as o}from"./useTranslation-Cbf5AGg_.js";import{t as s}from"./declaration-BGsHjPEW.js";import{E as c,n as l}from"./active-backend-context-BCXRv5pm.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as ee,t as _}from"./vendor~files-tab-CiC3-lGh.js";import{n as v,t as y}from"./format-time-delta-DhDbkD7V.js";import{t as b,w as x}from"./utils-DB9LsAzA.js";import{O as S,_ as C,c as w,d as T,m as E}from"./agent-server-compatibility-D6DSanlx.js";import{g as D}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-BIieS_OD.js";import{i as O}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-jpyLM1Nn.js";import{t as k}from"./proxy-CuhhyjdX.js";import{t as A}from"./react-ao3tWj6K.js";import{s as te}from"./conversation-local-storage-B31voBg7.js";import{t as j}from"./segmented-toggle-C1-ZVyr5.js";import{i as M,o as ne}from"./agent-server-conversation-service.api-cylugfDz.js";import{t as N}from"./folder-ynxP2EIL.js";import{t as P}from"./git-status-mapper-C3rfzUex.js";import{r as re}from"./typography-CQn9wyEX.js";import{n as F,r as ie,t as I}from"./use-active-conversation-B0sttISF.js";import{n as ae,t as L}from"./files-tab-store-tfCav6bB.js";import{t as oe}from"./use-agent-state-C5uA0bRj.js";import{t as se}from"./use-event-store-CsD17BKu.js";import{ot as ce,st as le}from"./vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CnJRLn5s.js";import{t as ue}from"./markdown-renderer-B6cJJ_MN.js";import{t as R}from"./runtime-waiting-state-DeD9G7yJ.js";import{t as de}from"./link-external-BVDiJfZt.js";import{t as z}from"./use-runtime-is-ready-D4pkGT6E.js";import{n as fe,t as pe}from"./get-language-from-path-rWEQrOGU.js";import{t as B}from"./conversation-tab-empty-state-BUhKVwoi.js";var V=e(t(),1),H=n();function me(){let{t:e}=o(`openhands`);return(0,H.jsx)(B,{className:`h-full`,icon:(0,H.jsx)(v,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(s.FILES$NO_FILE_SELECTED)})}var he=class{static async executeCommand(e,t,n,r,i=30){let a=C().backend;if(a.kind===`cloud`&&e){let o=await k({backend:a,method:`POST`,hostOverride:E(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new O(T({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=C().backend;return r.kind===`cloud`&&e?(await k({backend:r,method:`GET`,hostOverride:E(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new D(T({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}};function U(e){return e.startsWith(`/`)?e:`/${e}`}async function W(e,t,n,r){let i=C().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:U(r.path)});return k({backend:i,method:`GET`,hostOverride:E(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new O(T({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function ge(e){return w(e,404)||i(e)&&e.response?.status===404}var G=class{static async getGitChanges(e,t,n,r){let i=C().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await k({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:P(String(e.status)),path:e.path}))}let a=await new O(T({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await W(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(ge(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await W(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await W(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=C().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await k({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new O(T({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}};function K(e,t){let n=t?.trim();if(n)return n;if(!e)return S;let r=e.split(`/`);return`${S}/${r[r.length-1]}`}var q=()=>{let{conversationId:e}=F(),{data:t}=I(),[n,r]=V.useState([]),i=V.useRef(null),o=z(),s=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=V.useMemo(()=>K(l,u),[l,u]),f=a({queryKey:[`file_changes`,e,s,c,d],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitChanges(e,s,c,d)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:o&&!!e,meta:{disableToast:!0}});return V.useEffect(()=>{if(!f.isFetching&&f.isSuccess&&f.data){let e=f.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[f.isFetching,f.isSuccess,f.data]),{data:n,isLoading:f.isLoading,isFetching:f.isFetching,isSuccess:f.isSuccess,isError:f.isError,error:f.error,refetch:f.refetch}},J=2e3,_e=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function ve(){return`find . \\( ${_e.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${J}`}function ye(e){return e.startsWith(`./`)?e.slice(2):e}function be(e){let{data:t}=I(),n=z(),r=t?.id,i=t?.conversation_url,o=t?.session_api_key,s=t?.workspace?.working_dir?.trim(),c=a({queryKey:[`workspace-files`,r,i,o,s],queryFn:async()=>{let e=await he.executeCommand(i,o,ve(),s,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(ye);return Array.from(new Set(t)).slice(0,J)},enabled:e&&n&&!!r&&!!s,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function xe(e){let t=q(),n=(0,V.useMemo)(()=>{if(!e)return;let n=t.data.filter(e=>e.status!==`D`).map(e=>e.path);return Array.from(new Set(n)).slice(0,J)},[e,t.data]);return{data:e?n:void 0,isLoading:e?t.isLoading:!1}}function Se(){let{backend:e}=l(),t=e.kind===`cloud`,n=be(!t),r=xe(t);return t?r:n}function Ce(){let{data:e}=I(),t=z(),n=e?.id,r=e?.conversation_url,i=e?.session_api_key,o=C().backend.kind===`local`,s=a({queryKey:[`workspace-session`,n,r,i],queryFn:async()=>({baseUrl:await new O(T({conversationUrl:r,sessionApiKey:i})).startWorkspaceSession(n)}),enabled:t&&!!n&&o,staleTime:1/0,gcTime:1/0,retry:!1});return{data:s.data??null,isLoading:s.isLoading,isError:s.isError,error:s.error??null}}function we(e,t){let n=(t??``).replace(/^\/+/,``);return n?`${e}${n.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`:e}var Y=A(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Te(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var Ee=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`svg`,`avif`]),De=new Set([`pdf`]);function Oe(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function ke(e){switch(Oe(e)){case`html`:case`htm`:return`text/html`;case`css`:return`text/css`;case`js`:case`mjs`:case`cjs`:return`text/javascript`;case`json`:return`application/json`;case`md`:case`markdown`:return`text/markdown`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;case`bmp`:return`image/bmp`;case`ico`:return`image/x-icon`;case`avif`:return`image/avif`;case`pdf`:return`application/pdf`;default:return`text/plain`}}function Ae(e){let t=Oe(e);return Ee.has(t)?`image`:De.has(t)?`pdf`:`text`}function je(e){let t=new Uint8Array(e,0,Math.min(e.byteLength,8e3));for(let e=0;e<t.length;e+=1)if(t[e]===0)return!0;return!1}function X(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode.apply(null,t.subarray(e,e+n));return btoa(r)}function Me(e){let{data:t}=I(),n=z(),{data:r}=Ce(),i=Y(e=>e.count),o=t?.id,s=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=r?.baseUrl,f=C().backend.kind===`cloud`,p=K(l,u),m=p.startsWith(`/`)?p:`/${p}`,h=e?`${m}/${e}`:null;return a({queryKey:[`workspace-file-content`,o,s,c,f?`cloud`:d,e,h,i],queryFn:async()=>{if(!e)throw Error(`No path`);let t=Ae(e),n=ke(e);if(f){let r=await M(o,h);if(t===`text`){let t=new TextEncoder().encode(r);return je(t.buffer)?{path:e,kind:`binary`,text:null,staticUrl:`data:application/octet-stream;base64,${X(t.buffer)}`,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:r,staticUrl:`data:${n};charset=utf-8;base64,${X(t.buffer)}`,mimeType:n}}return{path:e,kind:t,text:null,staticUrl:`data:${n};base64,${X(new TextEncoder().encode(r).buffer)}`,mimeType:n}}if(!d)throw Error(`No workspace session`);let r=we(d,e);if(t!==`text`)return{path:e,kind:t,text:null,staticUrl:r,mimeType:n};let i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to read ${e}: ${i.status}`);let a=await i.arrayBuffer();return je(a)?{path:e,kind:`binary`,text:null,staticUrl:r,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:new TextDecoder(`utf-8`,{fatal:!1}).decode(a),staticUrl:r,mimeType:n}},enabled:n&&!!o&&!!e&&(f||!!d),retry:!1,staleTime:1e3*5,gcTime:1e3*60,meta:{disableToast:!0}})}function Ne(){let{data:e,isLoading:t}=I(),n=e?.id?ne(e.id):null;return{hasAttachedSource:!!e?.selected_repository||!!n?.selected_workspace,isLoading:t}}function Pe(e){let{data:t}=I(),n=z(),{backend:r}=l(),i=r.kind===`local`,o=t?.id,s=t?.conversation_url,c=t?.session_api_key,u=t?.workspace?.working_dir?.trim(),d=(e?.enabled??!0)&&i&&n&&!!o&&!!u,f=a({queryKey:[`has-git-commits`,o,s,c,u],queryFn:async()=>(await he.executeCommand(s,c,`git rev-parse --verify HEAD`,u,10)).exit_code===0,enabled:d,retry:!1,staleTime:6e4,gcTime:5*6e4,meta:{disableToast:!0}});return{hasCommits:f.data??null,isLoading:f.isLoading}}var Fe=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Ie=new Set([`view`]),Le=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function Re(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Fe.has(t.kind)||t.command&&Ie.has(t.command))}function ze(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Le.has(t.kind)}function Be(){let e=r(),t=se(e=>e.events),n=Y(e=>e.bump),i=(0,V.useRef)(new Set),a=(0,V.useRef)(new WeakSet);(0,V.useEffect)(()=>{let r=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?a.current.has(e):i.current.has(t))||(t===void 0?a.current.add(e):i.current.add(t),Re(e)?r=!0:ze(e)&&(o=!0))}!r&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),r&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var Ve=[`index.html`,`index.htm`,`readme.md`,`readme`,`main.html`,`app.html`,`index.js`,`index.ts`,`index.tsx`,`index.jsx`,`main.py`,`app.py`,`main.go`,`main.rs`,`main.java`,`main.c`,`main.cpp`,`package.json`,`pyproject.toml`,`cargo.toml`,`go.mod`,`pom.xml`,`dockerfile`,`makefile`],He=[`license`,`license.md`,`license.txt`,`changelog.md`,`agents.md`,`tsconfig.json`,`.env.sample`,`.env.example`];function Ue(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()}function We(e){return e.split(`/`).filter(Boolean).length-1}function Ge(e){let t=Ue(e),n=Ve.indexOf(t);if(n!==-1)return n;let r=He.indexOf(t);return r===-1?1e4:1e3+r}function Ke(e){return[...e].sort((e,t)=>{let n=We(e)-We(t);if(n!==0)return n;let r=Ge(e)-Ge(t);return r===0?e.localeCompare(t):r})}function qe({paths:e,selectedPath:t,onSelectFile:n,isTreeVisible:r,onToggleTree:i}){let{t:a}=o(`openhands`),c=(0,V.useMemo)(()=>Ke(e),[e]);return(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]`,"data-testid":`file-quick-row`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:i,"data-testid":`file-quick-row-tree-toggle`,"aria-pressed":r,"aria-label":a(r?s.FILES$HIDE_FILE_TREE:s.FILES$SHOW_FILE_TREE),title:a(r?s.FILES$HIDE_FILE_TREE:s.FILES$SHOW_FILE_TREE),className:b(`shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer`,`text-[var(--oh-text-tertiary)] hover:bg-tertiary`,r&&`bg-[var(--oh-surface-raised)]`),children:(0,H.jsx)(p,{className:`w-3 h-3`,"aria-hidden":!0,strokeWidth:2})}),c.length>0&&(0,H.jsx)(`div`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0`,children:c.map(e=>{let r=t===e;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>n(e),title:e,"data-testid":`file-quick-row-item-${e}`,className:b(`inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer`,r?`bg-[var(--oh-interactive-hover)] text-white`:`bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary`),children:e},e)})})]})}function Je(e){e.children.sort((e,t)=>e.isDirectory===t.isDirectory?e.name.localeCompare(t.name):e.isDirectory?-1:1);for(let t of e.children)t.isDirectory&&Je(t)}function Ye(e,t,n,r,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let o=a.get(n);if(o)return!i&&!o.isDirectory&&(o.isDirectory=!0),o;let s={name:n,path:r,isDirectory:!i,children:[]};return e.children.push(s),a.set(n,s),s}function Xe(e){let t={name:``,path:``,isDirectory:!0,children:[]},n=new Map;for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length>0){let r=t,i=``;for(let t=0;t<e.length;t+=1){let a=e[t];i=i?`${i}/${a}`:a;let o=t===e.length-1;r=Ye(r,n,a,i,o)}}}return Je(t),t}function Ze({node:e,depth:t,selectedPath:n,onSelectFile:r}){let[i,a]=(0,V.useState)(!1),o=8+t*12;if(e.isDirectory)return(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"data-testid":`file-tree-dir-${e.path}`,className:b(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-white`,`hover:bg-tertiary cursor-pointer`),style:{paddingLeft:`${o}px`},children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:b(`inline-block w-3 text-[10px] text-[var(--oh-muted)] transition-transform`,i?`rotate-90`:`rotate-0`),children:`▶`}),(0,H.jsx)(N,{className:`w-3.5 h-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),i&&e.children.length>0&&(0,H.jsx)(`ul`,{children:e.children.map(e=>(0,H.jsx)(Ze,{node:e,depth:t+1,selectedPath:n,onSelectFile:r},e.path))})]});let s=n===e.path;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`file-tree-file-${e.path}`,className:b(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm`,`hover:bg-tertiary cursor-pointer`,s?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-text-tertiary)]`),style:{paddingLeft:`${o+16}px`},children:[(0,H.jsx)(ae,{className:`w-3.5 h-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]})})}function Qe({paths:e,selectedPath:t,onSelectFile:n}){let{t:r}=o(`openhands`),i=(0,V.useMemo)(()=>Xe(e),[e]);return i.children.length===0?(0,H.jsx)(`div`,{className:`px-3 py-4 text-sm text-[var(--oh-muted)]`,children:r(s.FILES$NO_FILES)}):(0,H.jsx)(`ul`,{className:`py-1 custom-scrollbar-always`,"data-testid":`file-tree-view`,children:i.children.map(e=>(0,H.jsx)(Ze,{node:e,depth:0,selectedPath:t,onSelectFile:n},e.path))})}var $e={js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,ts:`typescript`,tsx:`tsx`,py:`python`,pyi:`python`,pyw:`python`,html:`markup`,htm:`markup`,svg:`markup`,xml:`markup`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,json:`json`,json5:`json5`,yaml:`yaml`,yml:`yaml`,toml:`toml`,ini:`ini`,cfg:`ini`,properties:`properties`,conf:`ini`,env:`bash`,md:`markdown`,markdown:`markdown`,mdx:`markdown`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`bash`,bat:`batch`,cmd:`batch`,ps1:`powershell`,ps:`powershell`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,cs:`csharp`,java:`java`,kt:`kotlin`,kts:`kotlin`,scala:`scala`,rs:`rust`,go:`go`,rb:`ruby`,php:`php`,swift:`swift`,m:`objectivec`,mm:`objectivec`,hs:`haskell`,ex:`elixir`,exs:`elixir`,erl:`erlang`,fs:`fsharp`,fsx:`fsharp`,ml:`ocaml`,mli:`ocaml`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,lua:`lua`,pl:`perl`,pm:`perl`,r:`r`,jl:`julia`,dart:`dart`,groovy:`groovy`,gradle:`groovy`,tf:`hcl`,hcl:`hcl`,dockerfile:`docker`,sql:`sql`,graphql:`graphql`,gql:`graphql`,proto:`protobuf`,diff:`diff`,patch:`diff`,nix:`nix`,sol:`solidity`},et={dockerfile:`docker`,makefile:`makefile`,gnumakefile:`makefile`,".bashrc":`bash`,".zshrc":`bash`,".profile":`bash`,".env":`bash`,".gitignore":`bash`,".dockerignore":`bash`};function tt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function nt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return e.slice(t+1).toLowerCase()}function rt(e,t){let n=et[nt(e)];if(n)return n;let r=tt(e);if(r&&$e[r])return $e[r];if(t){if(t===`text/html`)return`markup`;if(t===`text/css`)return`css`;if(t===`application/json`)return`json`;if(t===`text/markdown`)return`markdown`;if(t===`application/javascript`||t===`text/javascript`)return`javascript`;if(t===`application/x-yaml`||t===`text/yaml`)return`yaml`}return null}function it({path:e,text:t,mimeType:n}){let r=rt(e,n);return r?(0,H.jsx)(`div`,{"data-testid":`file-content-viewer-highlighted`,"data-language":r,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] custom-scrollbar-always`,children:(0,H.jsx)(ce,{language:r,style:le,showLineNumbers:!0,wrapLongLines:!1,customStyle:{margin:0,padding:`1rem`,background:`transparent`,fontSize:`0.75rem`,lineHeight:`1.25rem`,minHeight:`100%`},codeTagProps:{style:{background:`transparent`,fontFamily:`inherit`}},lineNumberStyle:{color:`var(--oh-border)`,minWidth:`2.5em`,paddingRight:`1em`,userSelect:`none`},children:t})}):(0,H.jsx)(`pre`,{"data-testid":`file-content-viewer-plain`,className:`h-full w-full overflow-auto whitespace-pre-wrap break-words bg-[var(--oh-surface)] p-4 text-xs leading-5 text-white custom-scrollbar-always`,children:t})}var at=new Set([`html`,`htm`,`svg`]),ot=new Set([`md`,`markdown`,`mdx`]),st={pptx:`PowerPoint`,ppt:`PowerPoint`,docx:`Word`,doc:`Word`,xlsx:`Excel`,xls:`Excel`};function Z(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Q({path:e}){let{t}=o(`openhands`),n=st[Z(e)];return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":n?`file-content-viewer-unsupported-document`:`file-content-viewer-binary-fallback`,children:n?t(s.FILES$UNSUPPORTED_DOCUMENT,{type:n}):t(s.FILES$BINARY_FALLBACK)})}function ct({path:e,viewMode:t}){let{t:n}=o(`openhands`),r=Me(e),i=Y(e=>e.count);if(r.isLoading)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,children:n(s.FILES$LOADING_FILES)});if(r.isError||!r.data)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":`file-content-viewer-error`,children:r.error?.message??n(s.FILES$LOAD_ERROR)});let{kind:a,text:c,staticUrl:l,mimeType:u}=r.data,d=Te(l,i);return t===`plain`?a===`text`&&c!==null?(0,H.jsx)(it,{path:e,text:c,mimeType:u??void 0}):(0,H.jsx)(Q,{path:e}):a===`image`?(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-[var(--oh-surface)] p-4`,"data-testid":`file-content-viewer-image`,children:(0,H.jsx)(`img`,{src:d,alt:e,className:`max-h-full max-w-full object-contain`})}):a===`pdf`?(0,H.jsx)(`iframe`,{title:e,src:d,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):a===`binary`?(0,H.jsx)(Q,{path:e}):u===`text/html`||at.has(Z(e))?(0,H.jsx)(`iframe`,{title:e,src:d,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):a===`text`&&ot.has(Z(e))?(0,H.jsx)(`div`,{"data-testid":`file-content-viewer-markdown`,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] text-white custom-scrollbar-always`,children:(0,H.jsx)(`div`,{className:`prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]`,children:(0,H.jsx)(ue,{content:c??``,includeStandard:!0,includeHeadings:!0})})}):a===`text`&&c!==null?(0,H.jsx)(it,{path:e,text:c,mimeType:u??void 0}):(0,H.jsx)(Q,{path:e})}var lt=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 13 15`,fill:`none`,...e,children:(0,H.jsx)(`path`,{d:`M6.59467 0.21967C6.88756 -0.0732233 7.36244 -0.0732233 7.65533 0.21967L9.90533 2.46967C10.1982 2.76256 10.1982 3.23744 9.90533 3.53033L7.65533 5.78033C7.36244 6.07322 6.88756 6.07322 6.59467 5.78033C6.30178 5.48744 6.30178 5.01256 6.59467 4.71967L7.56434 3.75H6.375C3.71421 3.75 1.5 5.96421 1.5 8.625C1.5 11.2858 3.71421 13.5 6.375 13.5C9.03579 13.5 11.25 11.2858 11.25 8.625C11.25 8.21079 11.5858 7.875 12 7.875C12.4142 7.875 12.75 8.21079 12.75 8.625C12.75 12.1142 9.86421 15 6.375 15C2.88579 15 0 12.1142 0 8.625C0 5.13579 2.88579 2.25 6.375 2.25H7.56434L6.59467 1.28033C6.30178 0.987437 6.30178 0.512563 6.59467 0.21967Z`,fill:`currentColor`})}),ut=()=>{let{conversationId:e}=F(),{data:t}=I(),n=z(),r=t?.conversation_url,i=t?.session_api_key,o=t?.selected_repository,s=t?.workspace?.working_dir?.trim(),c=V.useMemo(()=>K(o,s),[o,s]),l=a({queryKey:[`git_commits`,e,r,i,c],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitCommits(r,i,c,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:l.data?.commits??[],hasMore:l.data?.hasMore??!1,isUnsupported:l.data===null,isLoading:l.isLoading,isFetching:l.isFetching,isSuccess:l.isSuccess,isError:l.isError}},dt=e=>(0,H.jsx)(`svg`,{width:13,height:8,viewBox:`0 0 13 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.259766 6.17427L6.26425 0.715628L12.2688 6.17427L11.2597 7.28418L6.26425 2.74282L1.26878 7.28418L0.259766 6.17427Z`,fill:`currentColor`})}),ft=e=>{let{conversationId:t}=F(),{data:n}=I(),r=n?.conversation_url,i=n?.session_api_key,o=n?.selected_repository,s=n?.workspace?.working_dir?.trim(),c=V.useMemo(()=>`${K(o,s)}/${e.filePath}`,[o,e.filePath,s]),l=e.type===`D`;return a({queryKey:e.commit?[`commit_file_diff`,t,r,i,e.commit,c]:[`file_diff`,t,r,i,c],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return G.getGitChangeDiff(t,r,i,c,e.commit)},enabled:e.enabled&&(!l||!!e.commit),staleTime:e.commit?1/0:1e3*60*5,gcTime:1e3*60*15})};function pt({className:e}){let{t}=o(`openhands`);return(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(`div`,{className:b(`animate-spin rounded-full border-4 border-transparent border-t-white`,e),role:`status`,"aria-label":t(s.HOME$LOADING)})})}function mt({height:e,children:t}){return(0,H.jsx)(`div`,{"data-testid":`editor-container`,className:`w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]`,style:{"--editor-height":`${e}px`},children:t})}var ht=[{mode:`old`,icon:h},{mode:`diff`,icon:u},{mode:`new`,icon:_}],gt={renderValidationDecorations:`off`,readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},automaticLayout:!0,scrollbar:{alwaysConsumeMouseWheel:!1}},_t={A:f,D:g,M:m,R:`Renamed`,U:`Untracked`},vt=e=>{e.editor.defineTheme(`custom-diff-theme`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`6a9955`},{token:`keyword`,foreground:`569cd6`},{token:`string`,foreground:`ce9178`},{token:`number`,foreground:`b5cea8`}],colors:{"diffEditor.insertedTextBackground":`#014b01AA`,"diffEditor.removedTextBackground":`#750000AA`,"diffEditor.insertedLineBackground":`#003f00AA`,"diffEditor.removedLineBackground":`#5a0000AA`,"diffEditor.border":`var(--oh-border-subtle)`,"editorUnnecessaryCode.border":`#00000000`,"editorUnnecessaryCode.opacity":`rgba(0, 0, 0, 0.467)`}})};function yt({path:e,type:t,commit:n}){let{t:r}=o(`openhands`),[i,a]=V.useState(!0),[c,l]=V.useState(400),[u,f]=V.useState(`diff`),p=V.useRef(null),m=V.useRef(null),h=t===`A`||t===`U`,g=t===`D`,_=V.useMemo(()=>{if(t===`R`){let t=e.split(/\s+/).slice(1);return t[t.length-1]}return e},[e,t]),{data:v,isLoading:y,isSuccess:x,isRefetching:S}=ft({filePath:_,type:t,enabled:!i,commit:n}),C=V.useCallback(()=>{if(!p.current)return;let e=p.current.getOriginalEditor(),t=p.current.getModifiedEditor();e&&t&&l(Math.max(e.getContentHeight(),t.getContentHeight())+20)},[]),w=V.useCallback(()=>{m.current&&l(m.current.getContentHeight()+20)},[]),T=e=>{p.current=e,C(),e.getOriginalEditor().onDidContentSizeChange(C),e.getModifiedEditor().onDidContentSizeChange(C)},E=e=>{m.current=e,w(),e.onDidContentSizeChange(w)},D=(t===`U`?_t.A:_t[t])||`?`,O=typeof D==`string`?(0,H.jsx)(re.Text,{children:D}):V.createElement(D,{className:`w-5 h-5`}),k=y||S,A=pe(_),te=A===`markdown`,j=u===`old`?v?.original??``:v?.modified??``;return(0,H.jsxs)(`div`,{"data-testid":`file-diff-viewer-outer`,className:`w-full flex flex-col`,children:[(0,H.jsx)(`div`,{className:`flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer`,onClick:()=>a(e=>!e),children:(0,H.jsxs)(`span`,{className:`text-sm w-full text-content flex items-center gap-2`,children:[k?(0,H.jsx)(pt,{className:`w-4 h-4`}):O,(0,H.jsx)(`strong`,{className:`w-full truncate font-medium`,children:_}),!i&&!g&&(0,H.jsx)(`span`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:ht.map(({mode:e,icon:t})=>(0,H.jsx)(`button`,{"data-testid":`view-mode-${e}`,type:`button`,"aria-pressed":u===e,onClick:()=>f(e),className:b(`p-1 rounded transition-colors cursor-pointer`,u===e?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-white`),children:(0,H.jsx)(t,{className:`w-4 h-4`})},e))}),(0,H.jsx)(`button`,{"data-testid":`collapse`,type:`button`,children:(0,H.jsx)(dt,{className:b(`w-4 h-4 transition-transform`,i&&`transform rotate-180`)})})]})}),!i&&g&&!n&&(0,H.jsx)(`div`,{"data-testid":`file-deleted-message`,className:`w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm`,children:r(s.DIFF_VIEWER$FILE_DELETED)}),!i&&(!g||!!n)&&x&&(u===`diff`?(0,H.jsx)(mt,{height:c,children:(0,H.jsx)(d,{"data-testid":`file-diff-viewer`,className:`w-full h-full`,language:A,original:h?``:v?.original??``,modified:g?``:v?.modified??``,theme:`custom-diff-theme`,onMount:T,beforeMount:vt,options:{...gt,renderSideBySide:!h&&!g,hideUnchangedRegions:{enabled:!0}}})}):te?(0,H.jsx)(`div`,{className:`w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none`,"data-testid":`markdown-preview`,children:(0,H.jsx)(ue,{content:j,includeStandard:!0,includeHeadings:!0})}):(0,H.jsx)(mt,{height:c,children:(0,H.jsx)(ee,{"data-testid":`file-single-viewer`,className:`w-full h-full`,language:A,value:j,theme:`custom-diff-theme`,beforeMount:vt,onMount:E,options:gt})}))]})}function $(){return(0,H.jsx)(m,{"aria-hidden":!0,className:`size-full`})}function bt(){let{t:e}=o(`openhands`);return(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(s.DIFF_VIEWER$NO_CHANGES)})}var xt=[{key:s.TIPS$CUSTOMIZE_MICROAGENT,link:`https://docs.all-hands.dev/usage/prompting/microagents-repo`},{key:s.TIPS$SETUP_SCRIPT,link:`https://docs.all-hands.dev/usage/prompting/repository#setup-script`},{key:s.TIPS$VSCODE_INSTANCE},{key:s.TIPS$SAVE_WORK},{key:s.TIPS$SPECIFY_FILES,link:`https://docs.all-hands.dev/usage/prompting/prompting-best-practices`},{key:s.TIPS$HEADLESS_MODE,link:`https://docs.all-hands.dev/usage/how-to/headless-mode`},{key:s.TIPS$CLI_MODE,link:`https://docs.all-hands.dev/usage/how-to/cli-mode`},{key:s.TIPS$GITHUB_HOOK,link:`https://docs.all-hands.dev/usage/cloud/github-installation#working-on-github-issues-and-pull-requests-using-openhands`},{key:s.TIPS$BLOG_SIGNUP,link:`https://www.all-hands.dev/blog`},{key:s.TIPS$API_USAGE,link:`https://docs.all-hands.dev/api-reference/health-check`}];function St(){return xt[Math.floor(Math.random()*xt.length)]}function Ct(){let{t:e}=o(`openhands`),[t,n]=V.useState(St());return V.useEffect(()=>{n(St())},[]),(0,H.jsx)(`div`,{className:`w-full bg-tertiary p-4 text-left`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(fe,{className:`mt-0.5 h-4 w-4 shrink-0 fill-[var(--oh-muted)]`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h4`,{className:`text-sm font-semibold text-[var(--oh-text-tertiary)]`,children:e(s.TIPS$PROTIP)}),(0,H.jsxs)(`p`,{className:`text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:[e(t.key),t.link?(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(`a`,{href:t.link,target:`_blank`,rel:`noopener noreferrer`,className:`underline transition-colors hover:text-white`,children:e(s.TIPS$LEARN_MORE)})]}):null]})]})]})})}var wt=/not a git repository/i,Tt=new Set([s.DIFF_VIEWER$WAITING_FOR_RUNTIME,s.DIFF_VIEWER$LOADING]);function Et({messages:e}){let{t}=o(`openhands`);return e.length===1&&Tt.has(e[0])?(0,H.jsx)(R,{testId:`changes-tab-status`,messageKey:e[0]}):(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e.map(e=>(0,H.jsx)(`span`,{className:`block`,children:t(e)},e))})}function Dt(){let{data:e,isSuccess:t,isError:n,error:r,isLoading:i}=q(),[a,o]=V.useState(null),{curAgentState:l}=oe(),u=!x.includes(l),d=r&&wt.test(c(r));return V.useEffect(()=>{if(!u)o([s.DIFF_VIEWER$WAITING_FOR_RUNTIME]);else if(r){let e=c(r);wt.test(e)?o([s.DIFF_VIEWER$NOT_A_GIT_REPO,s.DIFF_VIEWER$ASK_OH]):o([e])}else o(i?[s.DIFF_VIEWER$LOADING]:null)},[u,d,i,r,o]),(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:!t||!e.length?(0,H.jsxs)(`div`,{className:`flex flex-col h-full w-full`,children:[(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[a&&(0,H.jsx)(Et,{messages:a}),!a&&t&&e.length===0&&(0,H.jsx)(bt,{})]}),!n&&t&&e.length===0&&(0,H.jsx)(Ct,{})]}):(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:e.slice(0,100).map(e=>(0,H.jsx)(yt,{path:e.path,type:e.status},e.path))})})}var Ot=(e,t)=>{let{conversationId:n}=F(),{data:r}=I(),i=z(),o=r?.conversation_url,s=r?.session_api_key,c=r?.selected_repository,l=r?.workspace?.working_dir?.trim(),u=V.useMemo(()=>K(c,l),[c,l]);return a({queryKey:[`commit_changes`,n,o,s,u,e],queryFn:async()=>{if(!n)throw Error(`No conversation ID`);return G.getCommitChanges(o,s,u,e)},staleTime:1/0,gcTime:1e3*60*15,retry:!1,enabled:t.enabled&&i&&!!n,meta:{disableToast:!0}})};function kt({commit:e,showAuthor:t,isExpanded:n,onToggle:r}){let{t:i}=o(`openhands`),{data:a,isLoading:c,isSuccess:l}=Ot(e.sha,{enabled:n});return(0,H.jsxs)(`div`,{"data-testid":`commit-row`,className:`w-full flex flex-col`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,"data-testid":`commit-row-toggle`,className:`w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer`,children:[(0,H.jsx)(`code`,{className:`font-mono text-xs text-[var(--oh-muted)] flex-shrink-0`,children:e.shortSha}),(0,H.jsx)(`strong`,{className:`flex-1 truncate font-medium`,children:e.subject}),t&&(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate max-w-32 flex-shrink-0`,children:e.author}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] flex-shrink-0`,children:`${y(e.timestamp)} ${i(s.CONVERSATION$AGO)}`}),(0,H.jsx)(dt,{className:b(`w-4 h-4 transition-transform flex-shrink-0`,!n&&`transform rotate-180`)})]}),n&&(0,H.jsxs)(`div`,{"data-testid":`commit-row-content`,className:`w-full flex flex-col pl-6`,children:[c&&(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(pt,{className:`w-4 h-4`})}),l&&a?.map(t=>(0,H.jsx)(yt,{path:t.path,type:t.status,commit:e.sha},t.path))]})]})}function At({commits:e,hasMore:t}){let{t:n}=o(`openhands`),[r,i]=V.useState(null),a=new Set(e.map(e=>e.author)).size>1;return(0,H.jsxs)(`section`,{"data-testid":`commit-list`,className:`w-full flex flex-col`,children:[e.map(e=>(0,H.jsx)(kt,{commit:e,showAuthor:a,isExpanded:r===e.sha,onToggle:()=>i(t=>t===e.sha?null:e.sha)},e.sha)),t&&(0,H.jsx)(`div`,{"data-testid":`commit-list-cap-notice`,className:`px-3 py-2.5 text-xs text-[var(--oh-muted)]`,children:n(s.DIFF_VIEWER$COMMITS_CAP,{count:e.length})})]})}function jt(){let{t:e}=o(`openhands`),{conversationId:t}=F(),{commits:n,hasMore:r,isUnsupported:i,isLoading:a,isSuccess:c}=ut(),{curAgentState:l}=oe(),u=!x.includes(l);return(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:c&&!i&&n.length>0?(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:(0,H.jsx)(At,{commits:n,hasMore:r},t)}):(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[!u&&(0,H.jsx)(R,{testId:`commits-tab-status`,messageKey:s.DIFF_VIEWER$WAITING_FOR_RUNTIME}),u&&a&&(0,H.jsx)(R,{testId:`commits-tab-status`,messageKey:s.DIFF_VIEWER$LOADING}),u&&!a&&(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(s.DIFF_VIEWER$NO_COMMITS)})]})})}function Mt(){let{t:e}=o(`openhands`);Be();let{hasAttachedSource:t,isLoading:n}=Ne(),{hasCommits:i}=Pe({enabled:t}),{conversationId:a}=ie(),{state:c,setFilesTabDiffView:l,setFilesTabContentViewMode:u}=te(a??``),d=(t||n)&&i!==!1,f=c.filesTabDiffView??d,p=c.filesTabContentViewMode,{isSuccess:m,isUnsupported:h}=ut(),g=m&&!h,[ee,_]=(0,V.useState)(!1),v=f?`on`:`off`;ee&&g&&(v=`commits`);let[y,b]=(0,V.useState)(!1),x=Se(),S=(0,V.useMemo)(()=>x.data??[],[x.data]),C=L(e=>e.selectedPath),w=L(e=>e.selectedConversationId),T=L(e=>e.setSelectedPath),E=w===a?C:null,D=(0,V.useCallback)(e=>T(e,a),[a,T]),O=Me(E),k=Y(e=>e.count),A=Te(O.data?.staticUrl??null,k);(0,V.useEffect)(()=>{w!==a&&T(null,a)},[w,a,T]),(0,V.useEffect)(()=>{if(E||S.length===0)return;let[e]=Ke(S);e&&T(e,a)},[S,E,a,T]);let M=r(),{refetch:ne,isFetching:N}=q(),P=()=>{ne(),M.invalidateQueries({queryKey:[`workspace-files`]}),M.invalidateQueries({queryKey:[`workspace-file-content`]}),M.invalidateQueries({queryKey:[`git_commits`]})};return(0,H.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,H.jsx)(j,{ariaLabel:e(s.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:v,options:[{value:`on`,label:e(s.FILES$DIFF_VIEW)},...g?[{value:`commits`,label:e(s.DIFF_VIEWER$COMMITS)}]:[],{value:`off`,label:e(s.COMMON$FILES)}],onChange:e=>{e===`commits`?_(!0):(_(!1),l(e===`on`))}}),v===`off`&&(0,H.jsx)(j,{ariaLabel:e(s.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:p,options:[{value:`rich`,label:e(s.FILES$RICH)},{value:`plain`,label:e(s.FILES$PLAIN)}],onChange:u}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[v===`off`&&A&&(0,H.jsx)(`a`,{href:A,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e(s.FILES$OPEN_IN_NEW_WINDOW),title:e(s.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,H.jsx)(de,{width:14,height:14})}),(0,H.jsx)(`button`,{type:`button`,onClick:P,disabled:N,"aria-label":e(s.FILES$REFRESH),title:e(s.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,H.jsx)(lt,{width:12.75,height:15,color:`#ffffff`,className:N?`animate-spin`:``})})]})]}),v===`on`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(Dt,{})}),v===`commits`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(jt,{})}),v===`off`&&(0,H.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:x.isLoading?(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:e(s.FILES$LOADING_FILES)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qe,{paths:S,selectedPath:E,onSelectFile:D,isTreeVisible:y,onToggleTree:()=>b(e=>!e)}),(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[y&&(0,H.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,H.jsx)(Qe,{paths:S,selectedPath:E,onSelectFile:D})}),(0,H.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:E?(0,H.jsx)(ct,{path:E,viewMode:p}):(0,H.jsx)(me,{})})]})]})})]})}export{Mt as default};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{s as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as a}from"./useQuery-D5pEZbY0.js";import{t as o}from"./useTranslation-Cbf5AGg_.js";import{t as s}from"./declaration-BGsHjPEW.js";import{E as c,n as l}from"./active-backend-context-B8rMv0X9.js";import{a as u,c as d,i as f,l as p,n as m,o as h,r as g,s as ee,t as _}from"./vendor~files-tab-B-5fBohe.js";import{n as v,t as y}from"./format-time-delta-DhDbkD7V.js";import{t as b,w as x}from"./utils-DB9LsAzA.js";import{O as S,_ as C,c as w,d as T,m as E}from"./agent-server-compatibility-BWN-EIQn.js";import{g as D}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{i as O}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js";import{t as k}from"./proxy-B3tCGf0X.js";import{t as A}from"./react-DPDgL6du.js";import{s as te}from"./conversation-local-storage-F6zVMM--.js";import{t as j}from"./segmented-toggle-kzwZkLaj.js";import{i as M,o as ne}from"./agent-server-conversation-service.api-DSPIkMwJ.js";import{t as N}from"./folder-Bk311brm.js";import{t as P}from"./git-status-mapper-DnL9OC8_.js";import{r as re}from"./typography-CzfoD9DY.js";import{n as F,r as ie,t as I}from"./use-active-conversation-2qeez40F.js";import{n as ae,t as L}from"./files-tab-store-DJsPxYdg.js";import{t as oe}from"./use-agent-state-C6peDXUm.js";import{t as se}from"./use-event-store-Bbaz51GR.js";import{ot as ce,st as le}from"./vendor~index-home~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DqZatR3B.js";import{t as ue}from"./markdown-renderer-B4V2OMFP.js";import{t as R}from"./runtime-waiting-state-CnyVhX4T.js";import{t as de}from"./link-external-CaBmUEs_.js";import{t as z}from"./use-runtime-is-ready-vCFOcLFa.js";import{n as fe,t as pe}from"./get-language-from-path-DBqBsCWH.js";import{t as B}from"./conversation-tab-empty-state-CNUmIms2.js";var V=e(t(),1),H=n();function me(){let{t:e}=o(`openhands`);return(0,H.jsx)(B,{className:`h-full`,icon:(0,H.jsx)(v,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(s.FILES$NO_FILE_SELECTED)})}var he=class{static async executeCommand(e,t,n,r,i=30){let a=C().backend;if(a.kind===`cloud`&&e){let o=await k({backend:a,method:`POST`,hostOverride:E(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new O(T({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=C().backend;return r.kind===`cloud`&&e?(await k({backend:r,method:`GET`,hostOverride:E(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new D(T({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}};function U(e){return e.startsWith(`/`)?e:`/${e}`}async function W(e,t,n,r){let i=C().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:U(r.path)});return k({backend:i,method:`GET`,hostOverride:E(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new O(T({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function ge(e){return w(e,404)||i(e)&&e.response?.status===404}var G=class{static async getGitChanges(e,t,n,r){let i=C().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await k({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:P(String(e.status)),path:e.path}))}let a=await new O(T({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await W(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(ge(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await W(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:P(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await W(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=C().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await k({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new O(T({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}};function K(e,t){let n=t?.trim();if(n)return n;if(!e)return S;let r=e.split(`/`);return`${S}/${r[r.length-1]}`}var q=()=>{let{conversationId:e}=F(),{data:t}=I(),[n,r]=V.useState([]),i=V.useRef(null),o=z(),s=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=V.useMemo(()=>K(l,u),[l,u]),f=a({queryKey:[`file_changes`,e,s,c,d],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitChanges(e,s,c,d)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:o&&!!e,meta:{disableToast:!0}});return V.useEffect(()=>{if(!f.isFetching&&f.isSuccess&&f.data){let e=f.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[f.isFetching,f.isSuccess,f.data]),{data:n,isLoading:f.isLoading,isFetching:f.isFetching,isSuccess:f.isSuccess,isError:f.isError,error:f.error,refetch:f.refetch}},J=2e3,_e=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function ve(){return`find . \\( ${_e.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${J}`}function ye(e){return e.startsWith(`./`)?e.slice(2):e}function be(e){let{data:t}=I(),n=z(),r=t?.id,i=t?.conversation_url,o=t?.session_api_key,s=t?.workspace?.working_dir?.trim(),c=a({queryKey:[`workspace-files`,r,i,o,s],queryFn:async()=>{let e=await he.executeCommand(i,o,ve(),s,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(ye);return Array.from(new Set(t)).slice(0,J)},enabled:e&&n&&!!r&&!!s,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function xe(e){let t=q(),n=(0,V.useMemo)(()=>{if(!e)return;let n=t.data.filter(e=>e.status!==`D`).map(e=>e.path);return Array.from(new Set(n)).slice(0,J)},[e,t.data]);return{data:e?n:void 0,isLoading:e?t.isLoading:!1}}function Se(){let{backend:e}=l(),t=e.kind===`cloud`,n=be(!t),r=xe(t);return t?r:n}function Ce(){let{data:e}=I(),t=z(),n=e?.id,r=e?.conversation_url,i=e?.session_api_key,o=C().backend.kind===`local`,s=a({queryKey:[`workspace-session`,n,r,i],queryFn:async()=>({baseUrl:await new O(T({conversationUrl:r,sessionApiKey:i})).startWorkspaceSession(n)}),enabled:t&&!!n&&o,staleTime:1/0,gcTime:1/0,retry:!1});return{data:s.data??null,isLoading:s.isLoading,isError:s.isError,error:s.error??null}}function we(e,t){let n=(t??``).replace(/^\/+/,``);return n?`${e}${n.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`:e}var Y=A(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Te(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var Ee=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`svg`,`avif`]),De=new Set([`pdf`]);function Oe(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function ke(e){switch(Oe(e)){case`html`:case`htm`:return`text/html`;case`css`:return`text/css`;case`js`:case`mjs`:case`cjs`:return`text/javascript`;case`json`:return`application/json`;case`md`:case`markdown`:return`text/markdown`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;case`bmp`:return`image/bmp`;case`ico`:return`image/x-icon`;case`avif`:return`image/avif`;case`pdf`:return`application/pdf`;default:return`text/plain`}}function Ae(e){let t=Oe(e);return Ee.has(t)?`image`:De.has(t)?`pdf`:`text`}function je(e){let t=new Uint8Array(e,0,Math.min(e.byteLength,8e3));for(let e=0;e<t.length;e+=1)if(t[e]===0)return!0;return!1}function X(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode.apply(null,t.subarray(e,e+n));return btoa(r)}function Me(e){let{data:t}=I(),n=z(),{data:r}=Ce(),i=Y(e=>e.count),o=t?.id,s=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=r?.baseUrl,f=C().backend.kind===`cloud`,p=K(l,u),m=p.startsWith(`/`)?p:`/${p}`,h=e?`${m}/${e}`:null;return a({queryKey:[`workspace-file-content`,o,s,c,f?`cloud`:d,e,h,i],queryFn:async()=>{if(!e)throw Error(`No path`);let t=Ae(e),n=ke(e);if(f){let r=await M(o,h);if(t===`text`){let t=new TextEncoder().encode(r);return je(t.buffer)?{path:e,kind:`binary`,text:null,staticUrl:`data:application/octet-stream;base64,${X(t.buffer)}`,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:r,staticUrl:`data:${n};charset=utf-8;base64,${X(t.buffer)}`,mimeType:n}}return{path:e,kind:t,text:null,staticUrl:`data:${n};base64,${X(new TextEncoder().encode(r).buffer)}`,mimeType:n}}if(!d)throw Error(`No workspace session`);let r=we(d,e);if(t!==`text`)return{path:e,kind:t,text:null,staticUrl:r,mimeType:n};let i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to read ${e}: ${i.status}`);let a=await i.arrayBuffer();return je(a)?{path:e,kind:`binary`,text:null,staticUrl:r,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:new TextDecoder(`utf-8`,{fatal:!1}).decode(a),staticUrl:r,mimeType:n}},enabled:n&&!!o&&!!e&&(f||!!d),retry:!1,staleTime:1e3*5,gcTime:1e3*60,meta:{disableToast:!0}})}function Ne(){let{data:e,isLoading:t}=I(),n=e?.id?ne(e.id):null;return{hasAttachedSource:!!e?.selected_repository||!!n?.selected_workspace,isLoading:t}}function Pe(e){let{data:t}=I(),n=z(),{backend:r}=l(),i=r.kind===`local`,o=t?.id,s=t?.conversation_url,c=t?.session_api_key,u=t?.workspace?.working_dir?.trim(),d=(e?.enabled??!0)&&i&&n&&!!o&&!!u,f=a({queryKey:[`has-git-commits`,o,s,c,u],queryFn:async()=>(await he.executeCommand(s,c,`git rev-parse --verify HEAD`,u,10)).exit_code===0,enabled:d,retry:!1,staleTime:6e4,gcTime:5*6e4,meta:{disableToast:!0}});return{hasCommits:f.data??null,isLoading:f.isLoading}}var Fe=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Ie=new Set([`view`]),Le=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function Re(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Fe.has(t.kind)||t.command&&Ie.has(t.command))}function ze(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Le.has(t.kind)}function Be(){let e=r(),t=se(e=>e.events),n=Y(e=>e.bump),i=(0,V.useRef)(new Set),a=(0,V.useRef)(new WeakSet);(0,V.useEffect)(()=>{let r=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?a.current.has(e):i.current.has(t))||(t===void 0?a.current.add(e):i.current.add(t),Re(e)?r=!0:ze(e)&&(o=!0))}!r&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),r&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var Ve=[`index.html`,`index.htm`,`readme.md`,`readme`,`main.html`,`app.html`,`index.js`,`index.ts`,`index.tsx`,`index.jsx`,`main.py`,`app.py`,`main.go`,`main.rs`,`main.java`,`main.c`,`main.cpp`,`package.json`,`pyproject.toml`,`cargo.toml`,`go.mod`,`pom.xml`,`dockerfile`,`makefile`],He=[`license`,`license.md`,`license.txt`,`changelog.md`,`agents.md`,`tsconfig.json`,`.env.sample`,`.env.example`];function Ue(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()}function We(e){return e.split(`/`).filter(Boolean).length-1}function Ge(e){let t=Ue(e),n=Ve.indexOf(t);if(n!==-1)return n;let r=He.indexOf(t);return r===-1?1e4:1e3+r}function Ke(e){return[...e].sort((e,t)=>{let n=We(e)-We(t);if(n!==0)return n;let r=Ge(e)-Ge(t);return r===0?e.localeCompare(t):r})}function qe({paths:e,selectedPath:t,onSelectFile:n,isTreeVisible:r,onToggleTree:i}){let{t:a}=o(`openhands`),c=(0,V.useMemo)(()=>Ke(e),[e]);return(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]`,"data-testid":`file-quick-row`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:i,"data-testid":`file-quick-row-tree-toggle`,"aria-pressed":r,"aria-label":a(r?s.FILES$HIDE_FILE_TREE:s.FILES$SHOW_FILE_TREE),title:a(r?s.FILES$HIDE_FILE_TREE:s.FILES$SHOW_FILE_TREE),className:b(`shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer`,`text-[var(--oh-text-tertiary)] hover:bg-tertiary`,r&&`bg-[var(--oh-surface-raised)]`),children:(0,H.jsx)(p,{className:`w-3 h-3`,"aria-hidden":!0,strokeWidth:2})}),c.length>0&&(0,H.jsx)(`div`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0`,children:c.map(e=>{let r=t===e;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>n(e),title:e,"data-testid":`file-quick-row-item-${e}`,className:b(`inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer`,r?`bg-[var(--oh-interactive-hover)] text-white`:`bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary`),children:e},e)})})]})}function Je(e){e.children.sort((e,t)=>e.isDirectory===t.isDirectory?e.name.localeCompare(t.name):e.isDirectory?-1:1);for(let t of e.children)t.isDirectory&&Je(t)}function Ye(e,t,n,r,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let o=a.get(n);if(o)return!i&&!o.isDirectory&&(o.isDirectory=!0),o;let s={name:n,path:r,isDirectory:!i,children:[]};return e.children.push(s),a.set(n,s),s}function Xe(e){let t={name:``,path:``,isDirectory:!0,children:[]},n=new Map;for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length>0){let r=t,i=``;for(let t=0;t<e.length;t+=1){let a=e[t];i=i?`${i}/${a}`:a;let o=t===e.length-1;r=Ye(r,n,a,i,o)}}}return Je(t),t}function Ze({node:e,depth:t,selectedPath:n,onSelectFile:r}){let[i,a]=(0,V.useState)(!1),o=8+t*12;if(e.isDirectory)return(0,H.jsxs)(`li`,{children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"data-testid":`file-tree-dir-${e.path}`,className:b(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-white`,`hover:bg-tertiary cursor-pointer`),style:{paddingLeft:`${o}px`},children:[(0,H.jsx)(`span`,{"aria-hidden":!0,className:b(`inline-block w-3 text-[10px] text-[var(--oh-muted)] transition-transform`,i?`rotate-90`:`rotate-0`),children:`▶`}),(0,H.jsx)(N,{className:`w-3.5 h-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),i&&e.children.length>0&&(0,H.jsx)(`ul`,{children:e.children.map(e=>(0,H.jsx)(Ze,{node:e,depth:t+1,selectedPath:n,onSelectFile:r},e.path))})]});let s=n===e.path;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`file-tree-file-${e.path}`,className:b(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm`,`hover:bg-tertiary cursor-pointer`,s?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-text-tertiary)]`),style:{paddingLeft:`${o+16}px`},children:[(0,H.jsx)(ae,{className:`w-3.5 h-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]})})}function Qe({paths:e,selectedPath:t,onSelectFile:n}){let{t:r}=o(`openhands`),i=(0,V.useMemo)(()=>Xe(e),[e]);return i.children.length===0?(0,H.jsx)(`div`,{className:`px-3 py-4 text-sm text-[var(--oh-muted)]`,children:r(s.FILES$NO_FILES)}):(0,H.jsx)(`ul`,{className:`py-1 custom-scrollbar-always`,"data-testid":`file-tree-view`,children:i.children.map(e=>(0,H.jsx)(Ze,{node:e,depth:0,selectedPath:t,onSelectFile:n},e.path))})}var $e={js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,ts:`typescript`,tsx:`tsx`,py:`python`,pyi:`python`,pyw:`python`,html:`markup`,htm:`markup`,svg:`markup`,xml:`markup`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,json:`json`,json5:`json5`,yaml:`yaml`,yml:`yaml`,toml:`toml`,ini:`ini`,cfg:`ini`,properties:`properties`,conf:`ini`,env:`bash`,md:`markdown`,markdown:`markdown`,mdx:`markdown`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`bash`,bat:`batch`,cmd:`batch`,ps1:`powershell`,ps:`powershell`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,cs:`csharp`,java:`java`,kt:`kotlin`,kts:`kotlin`,scala:`scala`,rs:`rust`,go:`go`,rb:`ruby`,php:`php`,swift:`swift`,m:`objectivec`,mm:`objectivec`,hs:`haskell`,ex:`elixir`,exs:`elixir`,erl:`erlang`,fs:`fsharp`,fsx:`fsharp`,ml:`ocaml`,mli:`ocaml`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,lua:`lua`,pl:`perl`,pm:`perl`,r:`r`,jl:`julia`,dart:`dart`,groovy:`groovy`,gradle:`groovy`,tf:`hcl`,hcl:`hcl`,dockerfile:`docker`,sql:`sql`,graphql:`graphql`,gql:`graphql`,proto:`protobuf`,diff:`diff`,patch:`diff`,nix:`nix`,sol:`solidity`},et={dockerfile:`docker`,makefile:`makefile`,gnumakefile:`makefile`,".bashrc":`bash`,".zshrc":`bash`,".profile":`bash`,".env":`bash`,".gitignore":`bash`,".dockerignore":`bash`};function tt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function nt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return e.slice(t+1).toLowerCase()}function rt(e,t){let n=et[nt(e)];if(n)return n;let r=tt(e);if(r&&$e[r])return $e[r];if(t){if(t===`text/html`)return`markup`;if(t===`text/css`)return`css`;if(t===`application/json`)return`json`;if(t===`text/markdown`)return`markdown`;if(t===`application/javascript`||t===`text/javascript`)return`javascript`;if(t===`application/x-yaml`||t===`text/yaml`)return`yaml`}return null}function it({path:e,text:t,mimeType:n}){let r=rt(e,n);return r?(0,H.jsx)(`div`,{"data-testid":`file-content-viewer-highlighted`,"data-language":r,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] custom-scrollbar-always`,children:(0,H.jsx)(ce,{language:r,style:le,showLineNumbers:!0,wrapLongLines:!1,customStyle:{margin:0,padding:`1rem`,background:`transparent`,fontSize:`0.75rem`,lineHeight:`1.25rem`,minHeight:`100%`},codeTagProps:{style:{background:`transparent`,fontFamily:`inherit`}},lineNumberStyle:{color:`var(--oh-border)`,minWidth:`2.5em`,paddingRight:`1em`,userSelect:`none`},children:t})}):(0,H.jsx)(`pre`,{"data-testid":`file-content-viewer-plain`,className:`h-full w-full overflow-auto whitespace-pre-wrap break-words bg-[var(--oh-surface)] p-4 text-xs leading-5 text-white custom-scrollbar-always`,children:t})}var at=new Set([`html`,`htm`,`svg`]),ot=new Set([`md`,`markdown`,`mdx`]),st={pptx:`PowerPoint`,ppt:`PowerPoint`,docx:`Word`,doc:`Word`,xlsx:`Excel`,xls:`Excel`};function Z(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Q({path:e}){let{t}=o(`openhands`),n=st[Z(e)];return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":n?`file-content-viewer-unsupported-document`:`file-content-viewer-binary-fallback`,children:n?t(s.FILES$UNSUPPORTED_DOCUMENT,{type:n}):t(s.FILES$BINARY_FALLBACK)})}function ct({path:e,viewMode:t}){let{t:n}=o(`openhands`),r=Me(e),i=Y(e=>e.count);if(r.isLoading)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,children:n(s.FILES$LOADING_FILES)});if(r.isError||!r.data)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":`file-content-viewer-error`,children:r.error?.message??n(s.FILES$LOAD_ERROR)});let{kind:a,text:c,staticUrl:l,mimeType:u}=r.data,d=Te(l,i);return t===`plain`?a===`text`&&c!==null?(0,H.jsx)(it,{path:e,text:c,mimeType:u??void 0}):(0,H.jsx)(Q,{path:e}):a===`image`?(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-[var(--oh-surface)] p-4`,"data-testid":`file-content-viewer-image`,children:(0,H.jsx)(`img`,{src:d,alt:e,className:`max-h-full max-w-full object-contain`})}):a===`pdf`?(0,H.jsx)(`iframe`,{title:e,src:d,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):a===`binary`?(0,H.jsx)(Q,{path:e}):u===`text/html`||at.has(Z(e))?(0,H.jsx)(`iframe`,{title:e,src:d,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):a===`text`&&ot.has(Z(e))?(0,H.jsx)(`div`,{"data-testid":`file-content-viewer-markdown`,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] text-white custom-scrollbar-always`,children:(0,H.jsx)(`div`,{className:`prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]`,children:(0,H.jsx)(ue,{content:c??``,includeStandard:!0,includeHeadings:!0})})}):a===`text`&&c!==null?(0,H.jsx)(it,{path:e,text:c,mimeType:u??void 0}):(0,H.jsx)(Q,{path:e})}var lt=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 13 15`,fill:`none`,...e,children:(0,H.jsx)(`path`,{d:`M6.59467 0.21967C6.88756 -0.0732233 7.36244 -0.0732233 7.65533 0.21967L9.90533 2.46967C10.1982 2.76256 10.1982 3.23744 9.90533 3.53033L7.65533 5.78033C7.36244 6.07322 6.88756 6.07322 6.59467 5.78033C6.30178 5.48744 6.30178 5.01256 6.59467 4.71967L7.56434 3.75H6.375C3.71421 3.75 1.5 5.96421 1.5 8.625C1.5 11.2858 3.71421 13.5 6.375 13.5C9.03579 13.5 11.25 11.2858 11.25 8.625C11.25 8.21079 11.5858 7.875 12 7.875C12.4142 7.875 12.75 8.21079 12.75 8.625C12.75 12.1142 9.86421 15 6.375 15C2.88579 15 0 12.1142 0 8.625C0 5.13579 2.88579 2.25 6.375 2.25H7.56434L6.59467 1.28033C6.30178 0.987437 6.30178 0.512563 6.59467 0.21967Z`,fill:`currentColor`})}),ut=()=>{let{conversationId:e}=F(),{data:t}=I(),n=z(),r=t?.conversation_url,i=t?.session_api_key,o=t?.selected_repository,s=t?.workspace?.working_dir?.trim(),c=V.useMemo(()=>K(o,s),[o,s]),l=a({queryKey:[`git_commits`,e,r,i,c],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitCommits(r,i,c,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:l.data?.commits??[],hasMore:l.data?.hasMore??!1,isUnsupported:l.data===null,isLoading:l.isLoading,isFetching:l.isFetching,isSuccess:l.isSuccess,isError:l.isError}},dt=e=>(0,H.jsx)(`svg`,{width:13,height:8,viewBox:`0 0 13 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.259766 6.17427L6.26425 0.715628L12.2688 6.17427L11.2597 7.28418L6.26425 2.74282L1.26878 7.28418L0.259766 6.17427Z`,fill:`currentColor`})}),ft=e=>{let{conversationId:t}=F(),{data:n}=I(),r=n?.conversation_url,i=n?.session_api_key,o=n?.selected_repository,s=n?.workspace?.working_dir?.trim(),c=V.useMemo(()=>`${K(o,s)}/${e.filePath}`,[o,e.filePath,s]),l=e.type===`D`;return a({queryKey:e.commit?[`commit_file_diff`,t,r,i,e.commit,c]:[`file_diff`,t,r,i,c],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return G.getGitChangeDiff(t,r,i,c,e.commit)},enabled:e.enabled&&(!l||!!e.commit),staleTime:e.commit?1/0:1e3*60*5,gcTime:1e3*60*15})};function pt({className:e}){let{t}=o(`openhands`);return(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(`div`,{className:b(`animate-spin rounded-full border-4 border-transparent border-t-white`,e),role:`status`,"aria-label":t(s.HOME$LOADING)})})}function mt({height:e,children:t}){return(0,H.jsx)(`div`,{"data-testid":`editor-container`,className:`w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]`,style:{"--editor-height":`${e}px`},children:t})}var ht=[{mode:`old`,icon:h},{mode:`diff`,icon:u},{mode:`new`,icon:_}],gt={renderValidationDecorations:`off`,readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},automaticLayout:!0,scrollbar:{alwaysConsumeMouseWheel:!1}},_t={A:f,D:g,M:m,R:`Renamed`,U:`Untracked`},vt=e=>{e.editor.defineTheme(`custom-diff-theme`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`6a9955`},{token:`keyword`,foreground:`569cd6`},{token:`string`,foreground:`ce9178`},{token:`number`,foreground:`b5cea8`}],colors:{"diffEditor.insertedTextBackground":`#014b01AA`,"diffEditor.removedTextBackground":`#750000AA`,"diffEditor.insertedLineBackground":`#003f00AA`,"diffEditor.removedLineBackground":`#5a0000AA`,"diffEditor.border":`var(--oh-border-subtle)`,"editorUnnecessaryCode.border":`#00000000`,"editorUnnecessaryCode.opacity":`rgba(0, 0, 0, 0.467)`}})};function yt({path:e,type:t,commit:n}){let{t:r}=o(`openhands`),[i,a]=V.useState(!0),[c,l]=V.useState(400),[u,f]=V.useState(`diff`),p=V.useRef(null),m=V.useRef(null),h=t===`A`||t===`U`,g=t===`D`,_=V.useMemo(()=>{if(t===`R`){let t=e.split(/\s+/).slice(1);return t[t.length-1]}return e},[e,t]),{data:v,isLoading:y,isSuccess:x,isRefetching:S}=ft({filePath:_,type:t,enabled:!i,commit:n}),C=V.useCallback(()=>{if(!p.current)return;let e=p.current.getOriginalEditor(),t=p.current.getModifiedEditor();e&&t&&l(Math.max(e.getContentHeight(),t.getContentHeight())+20)},[]),w=V.useCallback(()=>{m.current&&l(m.current.getContentHeight()+20)},[]),T=e=>{p.current=e,C(),e.getOriginalEditor().onDidContentSizeChange(C),e.getModifiedEditor().onDidContentSizeChange(C)},E=e=>{m.current=e,w(),e.onDidContentSizeChange(w)},D=(t===`U`?_t.A:_t[t])||`?`,O=typeof D==`string`?(0,H.jsx)(re.Text,{children:D}):V.createElement(D,{className:`w-5 h-5`}),k=y||S,A=pe(_),te=A===`markdown`,j=u===`old`?v?.original??``:v?.modified??``;return(0,H.jsxs)(`div`,{"data-testid":`file-diff-viewer-outer`,className:`w-full flex flex-col`,children:[(0,H.jsx)(`div`,{className:`flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer`,onClick:()=>a(e=>!e),children:(0,H.jsxs)(`span`,{className:`text-sm w-full text-content flex items-center gap-2`,children:[k?(0,H.jsx)(pt,{className:`w-4 h-4`}):O,(0,H.jsx)(`strong`,{className:`w-full truncate font-medium`,children:_}),!i&&!g&&(0,H.jsx)(`span`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:ht.map(({mode:e,icon:t})=>(0,H.jsx)(`button`,{"data-testid":`view-mode-${e}`,type:`button`,"aria-pressed":u===e,onClick:()=>f(e),className:b(`p-1 rounded transition-colors cursor-pointer`,u===e?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-white`),children:(0,H.jsx)(t,{className:`w-4 h-4`})},e))}),(0,H.jsx)(`button`,{"data-testid":`collapse`,type:`button`,children:(0,H.jsx)(dt,{className:b(`w-4 h-4 transition-transform`,i&&`transform rotate-180`)})})]})}),!i&&g&&!n&&(0,H.jsx)(`div`,{"data-testid":`file-deleted-message`,className:`w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm`,children:r(s.DIFF_VIEWER$FILE_DELETED)}),!i&&(!g||!!n)&&x&&(u===`diff`?(0,H.jsx)(mt,{height:c,children:(0,H.jsx)(d,{"data-testid":`file-diff-viewer`,className:`w-full h-full`,language:A,original:h?``:v?.original??``,modified:g?``:v?.modified??``,theme:`custom-diff-theme`,onMount:T,beforeMount:vt,options:{...gt,renderSideBySide:!h&&!g,hideUnchangedRegions:{enabled:!0}}})}):te?(0,H.jsx)(`div`,{className:`w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none`,"data-testid":`markdown-preview`,children:(0,H.jsx)(ue,{content:j,includeStandard:!0,includeHeadings:!0})}):(0,H.jsx)(mt,{height:c,children:(0,H.jsx)(ee,{"data-testid":`file-single-viewer`,className:`w-full h-full`,language:A,value:j,theme:`custom-diff-theme`,beforeMount:vt,onMount:E,options:gt})}))]})}function $(){return(0,H.jsx)(m,{"aria-hidden":!0,className:`size-full`})}function bt(){let{t:e}=o(`openhands`);return(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(s.DIFF_VIEWER$NO_CHANGES)})}var xt=[{key:s.TIPS$CUSTOMIZE_MICROAGENT,link:`https://docs.all-hands.dev/usage/prompting/microagents-repo`},{key:s.TIPS$SETUP_SCRIPT,link:`https://docs.all-hands.dev/usage/prompting/repository#setup-script`},{key:s.TIPS$VSCODE_INSTANCE},{key:s.TIPS$SAVE_WORK},{key:s.TIPS$SPECIFY_FILES,link:`https://docs.all-hands.dev/usage/prompting/prompting-best-practices`},{key:s.TIPS$HEADLESS_MODE,link:`https://docs.all-hands.dev/usage/how-to/headless-mode`},{key:s.TIPS$CLI_MODE,link:`https://docs.all-hands.dev/usage/how-to/cli-mode`},{key:s.TIPS$GITHUB_HOOK,link:`https://docs.all-hands.dev/usage/cloud/github-installation#working-on-github-issues-and-pull-requests-using-openhands`},{key:s.TIPS$BLOG_SIGNUP,link:`https://www.all-hands.dev/blog`},{key:s.TIPS$API_USAGE,link:`https://docs.all-hands.dev/api-reference/health-check`}];function St(){return xt[Math.floor(Math.random()*xt.length)]}function Ct(){let{t:e}=o(`openhands`),[t,n]=V.useState(St());return V.useEffect(()=>{n(St())},[]),(0,H.jsx)(`div`,{className:`w-full bg-tertiary p-4 text-left`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(fe,{className:`mt-0.5 h-4 w-4 shrink-0 fill-[var(--oh-muted)]`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h4`,{className:`text-sm font-semibold text-[var(--oh-text-tertiary)]`,children:e(s.TIPS$PROTIP)}),(0,H.jsxs)(`p`,{className:`text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:[e(t.key),t.link?(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(`a`,{href:t.link,target:`_blank`,rel:`noopener noreferrer`,className:`underline transition-colors hover:text-white`,children:e(s.TIPS$LEARN_MORE)})]}):null]})]})]})})}var wt=/not a git repository/i,Tt=new Set([s.DIFF_VIEWER$WAITING_FOR_RUNTIME,s.DIFF_VIEWER$LOADING]);function Et({messages:e}){let{t}=o(`openhands`);return e.length===1&&Tt.has(e[0])?(0,H.jsx)(R,{testId:`changes-tab-status`,messageKey:e[0]}):(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e.map(e=>(0,H.jsx)(`span`,{className:`block`,children:t(e)},e))})}function Dt(){let{data:e,isSuccess:t,isError:n,error:r,isLoading:i}=q(),[a,o]=V.useState(null),{curAgentState:l}=oe(),u=!x.includes(l),d=r&&wt.test(c(r));return V.useEffect(()=>{if(!u)o([s.DIFF_VIEWER$WAITING_FOR_RUNTIME]);else if(r){let e=c(r);wt.test(e)?o([s.DIFF_VIEWER$NOT_A_GIT_REPO,s.DIFF_VIEWER$ASK_OH]):o([e])}else o(i?[s.DIFF_VIEWER$LOADING]:null)},[u,d,i,r,o]),(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:!t||!e.length?(0,H.jsxs)(`div`,{className:`flex flex-col h-full w-full`,children:[(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[a&&(0,H.jsx)(Et,{messages:a}),!a&&t&&e.length===0&&(0,H.jsx)(bt,{})]}),!n&&t&&e.length===0&&(0,H.jsx)(Ct,{})]}):(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:e.slice(0,100).map(e=>(0,H.jsx)(yt,{path:e.path,type:e.status},e.path))})})}var Ot=(e,t)=>{let{conversationId:n}=F(),{data:r}=I(),i=z(),o=r?.conversation_url,s=r?.session_api_key,c=r?.selected_repository,l=r?.workspace?.working_dir?.trim(),u=V.useMemo(()=>K(c,l),[c,l]);return a({queryKey:[`commit_changes`,n,o,s,u,e],queryFn:async()=>{if(!n)throw Error(`No conversation ID`);return G.getCommitChanges(o,s,u,e)},staleTime:1/0,gcTime:1e3*60*15,retry:!1,enabled:t.enabled&&i&&!!n,meta:{disableToast:!0}})};function kt({commit:e,showAuthor:t,isExpanded:n,onToggle:r}){let{t:i}=o(`openhands`),{data:a,isLoading:c,isSuccess:l}=Ot(e.sha,{enabled:n});return(0,H.jsxs)(`div`,{"data-testid":`commit-row`,className:`w-full flex flex-col`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,"data-testid":`commit-row-toggle`,className:`w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer`,children:[(0,H.jsx)(`code`,{className:`font-mono text-xs text-[var(--oh-muted)] flex-shrink-0`,children:e.shortSha}),(0,H.jsx)(`strong`,{className:`flex-1 truncate font-medium`,children:e.subject}),t&&(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate max-w-32 flex-shrink-0`,children:e.author}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] flex-shrink-0`,children:`${y(e.timestamp)} ${i(s.CONVERSATION$AGO)}`}),(0,H.jsx)(dt,{className:b(`w-4 h-4 transition-transform flex-shrink-0`,!n&&`transform rotate-180`)})]}),n&&(0,H.jsxs)(`div`,{"data-testid":`commit-row-content`,className:`w-full flex flex-col pl-6`,children:[c&&(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(pt,{className:`w-4 h-4`})}),l&&a?.map(t=>(0,H.jsx)(yt,{path:t.path,type:t.status,commit:e.sha},t.path))]})]})}function At({commits:e,hasMore:t}){let{t:n}=o(`openhands`),[r,i]=V.useState(null),a=new Set(e.map(e=>e.author)).size>1;return(0,H.jsxs)(`section`,{"data-testid":`commit-list`,className:`w-full flex flex-col`,children:[e.map(e=>(0,H.jsx)(kt,{commit:e,showAuthor:a,isExpanded:r===e.sha,onToggle:()=>i(t=>t===e.sha?null:e.sha)},e.sha)),t&&(0,H.jsx)(`div`,{"data-testid":`commit-list-cap-notice`,className:`px-3 py-2.5 text-xs text-[var(--oh-muted)]`,children:n(s.DIFF_VIEWER$COMMITS_CAP,{count:e.length})})]})}function jt(){let{t:e}=o(`openhands`),{conversationId:t}=F(),{commits:n,hasMore:r,isUnsupported:i,isLoading:a,isSuccess:c}=ut(),{curAgentState:l}=oe(),u=!x.includes(l);return(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:c&&!i&&n.length>0?(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:(0,H.jsx)(At,{commits:n,hasMore:r},t)}):(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[!u&&(0,H.jsx)(R,{testId:`commits-tab-status`,messageKey:s.DIFF_VIEWER$WAITING_FOR_RUNTIME}),u&&a&&(0,H.jsx)(R,{testId:`commits-tab-status`,messageKey:s.DIFF_VIEWER$LOADING}),u&&!a&&(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(s.DIFF_VIEWER$NO_COMMITS)})]})})}function Mt(){let{t:e}=o(`openhands`);Be();let{hasAttachedSource:t,isLoading:n}=Ne(),{hasCommits:i}=Pe({enabled:t}),{conversationId:a}=ie(),{state:c,setFilesTabDiffView:l,setFilesTabContentViewMode:u}=te(a??``),d=(t||n)&&i!==!1,f=c.filesTabDiffView??d,p=c.filesTabContentViewMode,{isSuccess:m,isUnsupported:h}=ut(),g=m&&!h,[ee,_]=(0,V.useState)(!1),v=f?`on`:`off`;ee&&g&&(v=`commits`);let[y,b]=(0,V.useState)(!1),x=Se(),S=(0,V.useMemo)(()=>x.data??[],[x.data]),C=L(e=>e.selectedPath),w=L(e=>e.selectedConversationId),T=L(e=>e.setSelectedPath),E=w===a?C:null,D=(0,V.useCallback)(e=>T(e,a),[a,T]),O=Me(E),k=Y(e=>e.count),A=Te(O.data?.staticUrl??null,k);(0,V.useEffect)(()=>{w!==a&&T(null,a)},[w,a,T]),(0,V.useEffect)(()=>{if(E||S.length===0)return;let[e]=Ke(S);e&&T(e,a)},[S,E,a,T]);let M=r(),{refetch:ne,isFetching:N}=q(),P=()=>{ne(),M.invalidateQueries({queryKey:[`workspace-files`]}),M.invalidateQueries({queryKey:[`workspace-file-content`]}),M.invalidateQueries({queryKey:[`git_commits`]})};return(0,H.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,H.jsx)(j,{ariaLabel:e(s.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:v,options:[{value:`on`,label:e(s.FILES$DIFF_VIEW)},...g?[{value:`commits`,label:e(s.DIFF_VIEWER$COMMITS)}]:[],{value:`off`,label:e(s.COMMON$FILES)}],onChange:e=>{e===`commits`?_(!0):(_(!1),l(e===`on`))}}),v===`off`&&(0,H.jsx)(j,{ariaLabel:e(s.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:p,options:[{value:`rich`,label:e(s.FILES$RICH)},{value:`plain`,label:e(s.FILES$PLAIN)}],onChange:u}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[v===`off`&&A&&(0,H.jsx)(`a`,{href:A,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e(s.FILES$OPEN_IN_NEW_WINDOW),title:e(s.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,H.jsx)(de,{width:14,height:14})}),(0,H.jsx)(`button`,{type:`button`,onClick:P,disabled:N,"aria-label":e(s.FILES$REFRESH),title:e(s.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,H.jsx)(lt,{width:12.75,height:15,color:`#ffffff`,className:N?`animate-spin`:``})})]})]}),v===`on`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(Dt,{})}),v===`commits`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(jt,{})}),v===`off`&&(0,H.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:x.isLoading?(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:e(s.FILES$LOADING_FILES)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qe,{paths:S,selectedPath:E,onSelectFile:D,isTreeVisible:y,onToggleTree:()=>b(e=>!e)}),(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[y&&(0,H.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,H.jsx)(Qe,{paths:S,selectedPath:E,onSelectFile:D})}),(0,H.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:E?(0,H.jsx)(ct,{path:E,viewMode:p}):(0,H.jsx)(me,{})})]})]})})]})}export{Mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{h as i,o as a,s as o}from"./path-utils-BECGet7G.js";import{n as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as c}from"./useMutation-u8UgRgDK.js";import{t as l}from"./useQuery-D5pEZbY0.js";import{t as u}from"./useTranslation-Cbf5AGg_.js";import{t as d}from"./declaration-BGsHjPEW.js";import{S as f,n as p,x as m}from"./active-backend-context-BCXRv5pm.js";import{_ as h,i as g,t as _}from"./utils-DB9LsAzA.js";import{t as v}from"./common-CxbUL3nR.js";import{_ as y,d as b}from"./agent-server-compatibility-D6DSanlx.js";import{i as x}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-jpyLM1Nn.js";import{t as S}from"./proxy-CuhhyjdX.js";import{n as ee}from"./navigation-context-SjzfpygH.js";import{t as te}from"./dist-Dj01FXbZ.js";import{t as ne}from"./react-ao3tWj6K.js";import{r as re,t as C}from"./middleware-CWYDMVuG.js";import{t as w}from"./conversation-local-storage-B31voBg7.js";import{r as ie}from"./use-settings-DNJC4gqu.js";import{t as ae}from"./use-tracking-poxQHMwR.js";import{t as T}from"./agent-server-conversation-service.api-cylugfDz.js";import{t as E}from"./use-is-authed-Dvbpiu3B.js";import{a as oe,o as se,t as D}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-B81b08bw.js";import{t as ce}from"./git-status-mapper-C3rfzUex.js";var O=n(),k=te(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function A({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,O.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(k({orientation:e,color:t,size:n,inset:r}),i)})}var j=()=>{let e=r();return c({mutationFn:e=>T.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{w(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},M=()=>{let{t:e}=u(`openhands`),t=r(),{conversationId:n,navigate:i}=ee();return c({mutationKey:[`stop-conversation`],mutationFn:async e=>o(e.conversationId),onMutate:async()=>{let n=s.loading(e(d.TOAST$STOPPING_CONVERSATION),m);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&s.dismiss(i.toastId),f(e(d.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(r,o,c)=>{c?.toastId&&s.dismiss(c.toastId),s.success(e(d.TOAST$CONVERSATION_STOPPED),m),a(t,o.conversationId,{execution_status:v.PAUSED,sandbox_status:`PAUSED`}),n===o.conversationId&&i(`/conversations`)}})};function N(e){return e===`MISSING`||e===`ERROR`}var P=e(t()),F=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),I=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),L=e=>(0,O.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,O.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),R=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),z=()=>{let{trackDownloadTrajectoryButtonClicked:e}=ae(),{t}=u(`openhands`);return c({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),g(await T.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{f(t(d.CONVERSATION$DOWNLOAD_ERROR))}})},B=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),V=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},H=()=>{let{data:e,isLoading:t}=ie();return{providers:P.useMemo(()=>V(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function U(){let e=y().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function W(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function G(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function K(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var q=e=>e,J=()=>y().backend.kind===`cloud`,Y=e=>!e||e===`undefined`||e===`null`,X={items:[],next_page_id:null},Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return Y(t)||!J()?X:W({provider:q(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return Y(e)||!J()?X:W({provider:q(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(Y(e)||!J())return X;let a=n[t];return a?W({provider:q(e),installationId:a,limit:i,pageId:r}):X}static async getRepositoryBranches(e,t,n=``,r,i=30){return Y(t)||!J()?Z:K({provider:q(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return Y(t)||!J()?Z:K({provider:q(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return Y(e)||!J()?Q:G({provider:q(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await T.resolveConversationWorkingDir(e);return(await new x(b({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:ce(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new x(b()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},le=e=>{let{data:t}=E(),{providers:n}=H(),r=p();return l({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&h(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function ue(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:a}=H(),{data:o}=le(t),s=o?.items,c=p(),l=t?h(t,c.backend.kind):!1,u=i({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function de(e,t,n,r=100){return l({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await $.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function fe(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var pe={recentRepositories:[],lastSelectedProvider:null},me=ne()(re((e,t)=>({...pe,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:C(()=>localStorage)}));function he({gitProvider:e,className:t}){return(0,O.jsxs)(O.Fragment,{children:[e===`github`&&(0,O.jsx)(oe,{size:14,className:t}),e===`gitlab`&&(0,O.jsx)(se,{size:14,className:t}),e===`bitbucket`&&(0,O.jsx)(D,{size:14,className:t}),e===`bitbucket_data_center`&&(0,O.jsx)(D,{size:14,className:t}),e===`azure_devops`&&(0,O.jsx)(L,{className:_(t,`w-[14px] h-[14px]`)})]})}export{A as _,ue as a,B as c,L as d,I as f,j as g,M as h,de as i,z as l,N as m,me as n,$ as o,F as p,fe as r,H as s,he as t,R as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{h as i,o as a,s as o}from"./path-utils-PNfCKQDV.js";import{n as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as c}from"./useMutation-u8UgRgDK.js";import{t as l}from"./useQuery-D5pEZbY0.js";import{t as u}from"./useTranslation-Cbf5AGg_.js";import{t as d}from"./declaration-BGsHjPEW.js";import{S as f,n as p,x as m}from"./active-backend-context-B8rMv0X9.js";import{_ as h,i as g,t as _}from"./utils-DB9LsAzA.js";import{t as v}from"./common-CxbUL3nR.js";import{_ as y,d as b}from"./agent-server-compatibility-BWN-EIQn.js";import{i as x}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js";import{t as S}from"./proxy-B3tCGf0X.js";import{n as ee}from"./navigation-context-DPs2G0X8.js";import{t as te}from"./dist-CodhvuAP.js";import{t as ne}from"./react-DPDgL6du.js";import{r as re,t as C}from"./middleware-DYHYNAnP.js";import{t as w}from"./conversation-local-storage-F6zVMM--.js";import{r as ie}from"./use-settings-CyxSlyTQ.js";import{t as ae}from"./use-tracking-D2Qg5Lpd.js";import{t as T}from"./agent-server-conversation-service.api-DSPIkMwJ.js";import{t as E}from"./use-is-authed-BezEyfeh.js";import{a as oe,o as se,t as D}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js";import{t as ce}from"./git-status-mapper-DnL9OC8_.js";var O=n(),k=te(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function A({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,O.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,O.jsx)(`div`,{"data-testid":a,role:`separator`,className:_(k({orientation:e,color:t,size:n,inset:r}),i)})}var j=()=>{let e=r();return c({mutationFn:e=>T.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{w(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},M=()=>{let{t:e}=u(`openhands`),t=r(),{conversationId:n,navigate:i}=ee();return c({mutationKey:[`stop-conversation`],mutationFn:async e=>o(e.conversationId),onMutate:async()=>{let n=s.loading(e(d.TOAST$STOPPING_CONVERSATION),m);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&s.dismiss(i.toastId),f(e(d.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(r,o,c)=>{c?.toastId&&s.dismiss(c.toastId),s.success(e(d.TOAST$CONVERSATION_STOPPED),m),a(t,o.conversationId,{execution_status:v.PAUSED,sandbox_status:`PAUSED`}),n===o.conversationId&&i(`/conversations`)}})};function N(e){return e===`MISSING`||e===`ERROR`}var P=e(t()),F=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),I=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),L=e=>(0,O.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,O.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),R=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),z=()=>{let{trackDownloadTrajectoryButtonClicked:e}=ae(),{t}=u(`openhands`);return c({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),g(await T.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{f(t(d.CONVERSATION$DOWNLOAD_ERROR))}})},B=e=>(0,O.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,O.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),V=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},H=()=>{let{data:e,isLoading:t}=ie();return{providers:P.useMemo(()=>V(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function U(){let e=y().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function W(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function G(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function K(e){let t=U(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await S({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var q=e=>e,J=()=>y().backend.kind===`cloud`,Y=e=>!e||e===`undefined`||e===`null`,X={items:[],next_page_id:null},Z={items:[],next_page_id:null},Q={items:[],next_page_id:null},$=class{static async searchGitRepositories(e,t,n=100,r,i){return Y(t)||!J()?X:W({provider:q(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return Y(e)||!J()?X:W({provider:q(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(Y(e)||!J())return X;let a=n[t];return a?W({provider:q(e),installationId:a,limit:i,pageId:r}):X}static async getRepositoryBranches(e,t,n=``,r,i=30){return Y(t)||!J()?Z:K({provider:q(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return Y(t)||!J()?Z:K({provider:q(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return Y(e)||!J()?Q:G({provider:q(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await T.resolveConversationWorkingDir(e);return(await new x(b({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:ce(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new x(b()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},le=e=>{let{data:t}=E(),{providers:n}=H(),r=p();return l({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>$.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&h(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function ue(e){let{provider:t,pageSize:n=30,enabled:r=!0}=e,{providers:a}=H(),{data:o}=le(t),s=o?.items,c=p(),l=t?h(t,c.backend.kind):!1,u=i({queryKey:[`repositories`,t,l,n,c.backend.id,c.orgId,...l?[s||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(l){if(!s)throw Error(`Missing installation list`);let r=e;return await $.retrieveInstallationRepositories(t,r.installationIndex,s,r.pageId??void 0,n)}let r=e;return await $.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(l&&s){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<s.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:l?{installationIndex:0,pageId:null}:null,enabled:r&&(a||[]).length>0&&!!t&&(!l||Array.isArray(s)&&s.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:u.data,isLoading:u.isLoading,isError:u.isError,hasNextPage:u.hasNextPage,isFetchingNextPage:u.isFetchingNextPage,fetchNextPage:u.fetchNextPage,onLoadMore:()=>{u.hasNextPage&&!u.isFetchingNextPage&&u.fetchNextPage()}}}function de(e,t,n,r=100){return l({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await $.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function fe(e,t){let[n,r]=(0,P.useState)(e);return(0,P.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var pe={recentRepositories:[],lastSelectedProvider:null},me=ne()(re((e,t)=>({...pe,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:C(()=>localStorage)}));function he({gitProvider:e,className:t}){return(0,O.jsxs)(O.Fragment,{children:[e===`github`&&(0,O.jsx)(oe,{size:14,className:t}),e===`gitlab`&&(0,O.jsx)(se,{size:14,className:t}),e===`bitbucket`&&(0,O.jsx)(D,{size:14,className:t}),e===`bitbucket_data_center`&&(0,O.jsx)(D,{size:14,className:t}),e===`azure_devops`&&(0,O.jsx)(L,{className:_(t,`w-[14px] h-[14px]`)})]})}export{A as _,ue as a,B as c,L as d,I as f,j as g,M as h,de as i,z as l,N as m,me as n,$ as o,F as p,fe as r,H as s,he as t,R as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r,k as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{r as a}from"./path-utils-BECGet7G.js";import{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{S as l,n as u,x as d}from"./active-backend-context-BCXRv5pm.js";import{t as f}from"./chevron-down-D7IvFMBM.js";import{t as p}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-Zhq6xAxR.js";import{a as m,c as h,d as g,f as _,i as v,l as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./onboarding-CyicadGt.js";import{t as D}from"./search-dIQ09UY2.js";import{t as O}from"./x-ZE4iplpF.js";import{t as k}from"./utils-DB9LsAzA.js";import{t as A}from"./modal-backdrop-Dsmzgr5s.js";import{n as j,r as M,t as N}from"./modal-body-CDZdZ-eT.js";import{r as P}from"./base-modal-Cb0C6m0Q.js";import{_ as F,i as I,m as L,s as R}from"./form-control-classes-CvUaw8_L.js";import{t as z}from"./brand-button-2Tp3aXk1.js";import{n as B}from"./navigation-context-SjzfpygH.js";import{t as V}from"./styled-tooltip-CvsjHuIf.js";import{i as H,n as U,o as W,u as G}from"./dropdown-classes-DZq0BQjb.js";import{c as ee,n as K,s as q}from"./git-provider-icon-DUb2pEos.js";import{t as J}from"./conversation-store-BCSpLuEf.js";import{t as te}from"./modal-close-button-DQElFMPo.js";import{n as ne}from"./use-create-conversation-CWQGNQ9J.js";import{r as re}from"./recommended-automations-launcher-DA6DWS7V.js";import{t as ie}from"./folder-ynxP2EIL.js";import{r as Y}from"./typography-CQn9wyEX.js";import{i as ae,n as oe,t as se}from"./extension-module-card-classes-BlO4w702.js";import{n as ce}from"./circle-plus-check-toggle-QQJKUnF6.js";import{A as le,H as ue,I as de,R as fe,V as pe,a as me,c as he,d as ge,f as _e,h as ve,i as ye,l as be,m as xe,n as Se,o as Ce,p as we,r as Te,s as Ee,t as De,u as Oe,z as ke}from"./llm-not-configured-banner-B7DR8SPs.js";import{m as Ae}from"./lesson-plan-DSf95kQ2.js";import{t as je}from"./use-plugins-marketplace-Bkk07W_M.js";var X=e(t(),1);async function Me(e){let{imagesToEmbed:t}=ue(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>fe(e)));Ae.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Z=n();function Ne({plugin:e,isSelected:t,isDisabled:n=!1,onToggle:r}){return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-card-${e.name}`,className:k(`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-tertiary p-4`),children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{"data-testid":`plugin-picker-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),e.description?(0,Z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-tertiary-light`,children:e.description}):null,e.repo_path||e.ref?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.repo_path?(0,Z.jsx)(`span`,{className:ae,children:e.repo_path}):null,e.ref?(0,Z.jsxs)(`span`,{className:ae,children:[`@`,e.ref]}):null]}):null]}),(0,Z.jsx)(ce,{testId:`plugin-picker-toggle-${e.name}`,isSelected:t,isDisabled:n,onToggle:r,enableLabelKey:c.BUTTON$ADD,disableLabelKey:c.COMMON$REMOVE,enableTooltipKey:c.BUTTON$ADD,disableTooltipKey:c.COMMON$REMOVE})]})}function Q(e){return[e.source,e.ref??``,e.repo_path??``].join(`\0`)}function Pe(e){return{source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}}function Fe(e,t){let n=Q(t);return e.some(e=>Q(e)===n)}function Ie(e,t){let n=Q(t);return e.some(e=>Q(e)===n)?e.filter(e=>Q(e)!==n):[...e,Pe(t)]}function Le(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description,e.source,e.repo_path,e.ref].filter(e=>typeof e==`string`&&e.length>0).some(e=>e.toLowerCase().includes(n)):!0}function Re({selected:e,onChange:t,disabled:n=!1}){let{t:r}=s(`openhands`),{data:i,isLoading:a,isError:o}=je(),[l,u]=(0,X.useState)(``),d=(i??[]).filter(e=>Le(e,l));return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker`,className:`flex w-full flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:k(`relative flex min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`),children:[(0,Z.jsx)(D,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{"data-testid":`plugin-picker-search-input`,type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:r(c.PLUGINS$PICKER_SEARCH_PLACEHOLDER),"aria-label":r(c.PLUGINS$PICKER_SEARCH_PLACEHOLDER),className:k(`min-w-0 flex-1 border-0 bg-transparent outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),l?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>u(``),"aria-label":r(c.MCP$SEARCH_CLEAR),className:`mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white`,children:(0,Z.jsx)(O,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),a?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-loading`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_LOADING)}):o?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-error`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_ERROR)}):d.length===0?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-empty`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_EMPTY)}):(0,Z.jsx)(`div`,{className:oe,children:(0,Z.jsx)(`div`,{className:se,children:d.map(r=>(0,Z.jsx)(Ne,{plugin:r,isSelected:Fe(e,r),isDisabled:n,onToggle:()=>t(Ie(e,r))},`${r.source} ${r.ref??``} ${r.repo_path??``} ${r.name}`))})})]})}function ze({selected:e,onChange:t,onClose:n}){let{t:r}=s(`openhands`);return(0,Z.jsx)(A,{onClose:n,children:(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-modal`,className:k(`relative flex max-h-[80vh] flex-col gap-4 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,M(`lg`),N),children:[(0,Z.jsx)(te,{onClose:n,testId:`plugin-picker-close`}),(0,Z.jsxs)(`div`,{className:`pr-6`,children:[(0,Z.jsx)(Y.H2,{children:r(c.PLUGINS$PICKER_TITLE)}),(0,Z.jsx)(Y.Text,{className:`mt-1 block text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_SUBTITLE)})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:(0,Z.jsx)(Re,{selected:e,onChange:t})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t border-[var(--oh-border-subtle)] pt-4`,children:[(0,Z.jsx)(Y.Text,{className:`text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_SELECTED_COUNT,{count:e.length})}),(0,Z.jsx)(z,{testId:`plugin-picker-done`,type:`button`,variant:`primary`,onClick:n,className:`px-4`,children:r(c.PLUGINS$PICKER_DONE)})]})]})})}function Be({count:e,onClick:t,disabled:n=!1}){let{t:r}=s(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`open-plugin-picker`,onClick:t,disabled:n,className:k(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,Z.jsx)(le,{width:16,height:16,className:`shrink-0`,"aria-hidden":!0})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:r(c.PLUGINS$PICKER_TRIGGER)}),e>0?(0,Z.jsx)(`span`,{"data-testid":`plugin-picker-count`,className:`inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black`,children:e}):null]})}function Ve(){let{t:e}=s(`openhands`);return(0,Z.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,Z.jsx)(Y.H1,{className:`w-full text-center leading-normal`,children:e(c.HOME$LETS_START_BUILDING)})})}function He({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=s(`openhands`),o=e===`local`,l=i(o?c.HOME$OPEN_WORKSPACE:c.COMMON$OPEN_REPOSITORY),u=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":o?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:k(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(S,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Z.jsx)(a,{width:16,height:16,className:`shrink-0`})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:l})]});return r?(0,Z.jsx)(V,{content:r,placement:`top`,children:(0,Z.jsx)(`span`,{className:`inline-flex`,children:u})}):u}var $=`__ungrouped__`;function Ue({workspaces:e,parents:t=[],value:n,placeholder:r,className:i,disabled:a=!1,disabledTooltip:o,showManage:l,onChange:u,onAddClick:d,onManageClick:f}){let{t:m}=s(`openhands`),[h,g]=(0,X.useState)(n?.name??``),_=(0,X.useRef)(null),v=(0,X.useMemo)(()=>{let t=h.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,h]),y=(0,X.useCallback)(e=>e.parentPath??$,[]),b=(0,X.useMemo)(()=>{let e=new Map;return t.forEach(t=>e.set(t.path,t.name)),e},[t]),{groupedWorkspaces:x,isGrouped:S,headerByFirstIndex:C,groupLabelByIndex:w}=(0,X.useMemo)(()=>{let e=[],t=new Map;v.forEach(n=>{let r=y(n);t.has(r)||(t.set(r,[]),e.push(r)),t.get(r)?.push(n)}),e.sort((e,t)=>e===$?1:t===$?-1:0);let n=e.length>1,r=[],i=new Map,a=new Map;return e.forEach(e=>{let o=e===$?m(c.HOME$WORKSPACE_GROUP_OTHER):b.get(e)||e.split(`/`).filter(Boolean).pop()||e;n&&i.set(r.length,o),(t.get(e)??[]).forEach(e=>{a.set(r.length,o),r.push(e)})}),{groupedWorkspaces:r,isGrouped:n,headerByFirstIndex:i,groupLabelByIndex:a}},[v,y,b,m]),T=(0,X.useCallback)(e=>{u(e),e&&g(e.name)},[u]),E=(0,X.useCallback)(()=>{T(null),g(``)},[T]),{isOpen:D,getToggleButtonProps:O,getMenuProps:A,getInputProps:j,highlightedIndex:M,getItemProps:N,selectedItem:P,closeMenu:F}=p({items:x,itemToString:e=>e?.name??``,selectedItem:n,onSelectedItemChange:({selectedItem:e})=>{T(e??null)},inputValue:h,onIsOpenChange:({isOpen:e,selectedItem:t})=>{g(e?``:t?.name??``)},stateReducer:(e,t)=>t.type===p.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),I=(e,t,n,r,i)=>(0,Z.jsx)(be,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id,ariaLabel:S?`${w.get(t)??``}, ${e.name}`.trim():void 0},e.id),L=e=>(0,Z.jsx)(he,{inputValue:e,searchMessage:m(c.HOME$NO_WORKSPACES),emptyMessage:m(c.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),z=(0,X.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),B=(0,X.useCallback)(e=>{z(e),F(),d()},[F,d,z]),W=(0,X.useCallback)(e=>{z(e),F(),d()},[F,d,z]),G=(0,X.useCallback)(e=>{z(e),F(),f()},[F,f,z]),K=(0,X.useCallback)(e=>{z(e),F(),f()},[F,f,z]),q=(0,X.useMemo)(()=>(0,Z.jsxs)(`div`,{className:H,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:k(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:W,onClick:B,children:m(c.HOME$ADD_WORKSPACES)}),(l??e.length>0)&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:k(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:K,onClick:G,children:m(c.HOME$MANAGE_WORKSPACES)})]}),[B,W,G,K,z,m,e.length,l]),J=(0,Z.jsxs)(`div`,{className:k(`relative`,i),children:[(0,Z.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Z.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Z.jsx)(ee,{width:16,height:16})}),(0,Z.jsx)(`input`,{...j({disabled:a,placeholder:D&&n?n.name:r??m(c.HOME$WORKSPACE_PLACEHOLDER),className:k(R,`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=>{g(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Z.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[n&&(0,Z.jsx)(ge,{disabled:a,onClear:E}),(0,Z.jsx)(Oe,{isOpen:D,disabled:a,getToggleButtonProps:O})]})]}),(0,Z.jsx)(Ee,{isOpen:D,filteredItems:x,inputValue:h,highlightedIndex:M,selectedItem:P,getMenuProps:A,getItemProps:N,menuRef:_,renderItem:I,renderItemPrefix:S?(e,t)=>{let n=C.get(t);return n?(0,Z.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,"data-testid":`workspace-group-header`,className:`px-2 pt-2 pb-1 text-xs font-medium text-[var(--oh-muted)] select-none`,children:n}):null}:void 0,renderEmptyState:L,stickyFooterItem:q,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return o?(0,Z.jsx)(V,{content:o,placement:`top`,children:(0,Z.jsx)(`span`,{className:`block`,children:J})}):J}var We=`oh:home-selected-workspace-path`;function Ge(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(We);return e&&e.length>0?e:null}catch{return null}}function Ke(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(We,e):window.sessionStorage.removeItem(We)}catch{}}function qe({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=s(`openhands`),{navigate:r}=B(),{data:i,error:a}=w(),o=i?.workspaceParents??[],{mutate:l}=y(),{mutate:u}=E(),{mutate:d}=h(),{mutate:f}=g(),{workspaces:p,parents:_,isLoading:b,isError:S,error:T}=x(),D=m(a??T,n),[O,k]=X.useState(null),[A,j]=X.useState(!1),[M,N]=X.useState(!1),{mutate:P,isPending:F,isSuccess:I}=ne(),L=re(),R=F||I||L,V=X.useCallback(e=>{k(e),Ke(e?.path??null)},[]);X.useEffect(()=>{let e=Ge();if(!e)return;let t=p.find(t=>t.path===e);if(t){k(e=>e?.path===t.path?e:t);return}!b&&!S&&!D&&(Ke(null),k(t=>t?.path===e?null:t))},[S,b,p,D]);let H=o.length>0||!!D,U=null;D?U=D:b?U=n(c.HOME$LOADING):S&&(U=n(c.HOME$WORKSPACE_SCAN_ERROR));let W=!!D||e||b&&p.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(ie,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(c.HOME$WORKSPACES_TAB)})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsx)(Ue,{workspaces:p,parents:_,value:O,placeholder:D?n(c.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):W?n(c.HOME$LOADING):void 0,disabled:W,disabledTooltip:D,showManage:p.length>0||o.length>0,onChange:V,onAddClick:()=>j(!0),onManageClick:()=>N(!0),className:`max-w-auto`},O?.path??`empty-workspace-selection`),H&&U&&(0,Z.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:U})]}),(0,Z.jsx)(z,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!O||!t&&R||e,onClick:()=>{if(O){if(t){t(O);return}P({workingDir:O.path,entryPoint:`home_workspace_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:n(t?c.BUTTON$CONFIRM:R?c.HOME$LOADING:c.BUTTON$LAUNCH)}),(0,Z.jsx)(v,{isOpen:A,onClose:()=>j(!1),onAdd:e=>{let t=e[e.length-1];l(e,{onSuccess:()=>{t&&V(t)}})},onAddParent:e=>d(e)}),(0,Z.jsx)(C,{isOpen:M,workspaces:p,workspaceParents:o,onClose:()=>N(!1),onRemove:e=>{O?.path===e&&V(null),u(e)},onRemoveParent:e=>{O?.parentPath===e&&V(null),f(e)}})]})}function Je({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=s(`openhands`),{isLoadingSettings:i}=q();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(te,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(c.HOME$OPEN_WORKSPACE)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Z.jsx)(qe,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ye({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=B(),[i,o]=X.useState(null),[l,u]=X.useState(null),[d,f]=X.useState(null),{providers:p}=q(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=K(),{mutate:_,isPending:v,isSuccess:y}=ne(),b=re(),{t:x}=s(`openhands`);X.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),o(null),u(null),e?.(null))},w=X.useCallback(e=>{u(e)},[]);return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Z.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(a,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(c.COMMON$OPEN_REPOSITORY)})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(c.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,Z.jsx)(Ce,{providers:p,value:d,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Z.jsx)(ye,{provider:d||p[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!d||t,onChange:t=>{t?(e?.(t),o(t)):(e?.(null),o(null),u(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Z.jsx)(me,{repository:i?.full_name||null,provider:d||p[0],selectedBranch:l,onBranchSelect:w,defaultBranch:e,className:`max-w-full`,disabled:!i||t})})()]}),(0,Z.jsx)(z,{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`},entryPoint:`home_repo_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:x(n?c.BUTTON$CONFIRM:S?c.HOME$LOADING:c.BUTTON$LAUNCH)})]})}function Xe({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=s(`openhands`),{isLoadingSettings:i}=q();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(te,{onClose:t,testId:`close-open-repository-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(c.COMMON$OPEN_REPOSITORY)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Z.jsx)(Ye,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ze(e,t){return e===`new_worktree`?c.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?c.COMMON$WORKSPACE_MODE_CLOUD_REPO:c.COMMON$WORKSPACE_MODE_LOCAL_REPO}function Qe({mode:e}){return e===`new_worktree`?(0,Z.jsx)(_,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Z.jsx)(a,{width:12,height:12,color:`white`,"aria-hidden":!0})}var $e=[`local_repo`,`new_worktree`];function et({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:a}=s(`openhands`),[o,c]=(0,X.useState)(!1),l=(0,X.useRef)(null),u=a(Ze(e,t));return(0,X.useEffect)(()=>{if(!o)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,X.useEffect)(()=>{if(!o)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),(0,Z.jsxs)(`div`,{ref:l,className:`relative inline-flex`,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":o,"aria-label":u,disabled:r,onClick:()=>c(e=>!e),className:k(`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,Z.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Z.jsx)(Qe,{mode:e})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:u}),(0,Z.jsx)(f,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),o?(0,Z.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:k(`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`,H),children:$e.map(r=>{let o=a(Ze(r,t));return(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),c(!1)},className:W,children:[(0,Z.jsx)(`span`,{className:G,children:(0,Z.jsx)(Qe,{mode:r})}),(0,Z.jsx)(`span`,{className:`truncate`,children:o})]},r)})}):null]})}function tt({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,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Z.jsx)(Te,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Z.jsx)(et,{value:i,backendKind:a,onChange:s}):null,n?(0,Z.jsx)(Se,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function nt(){let{t:e}=s(`openhands`),{backend:t}=u(),{navigate:n}=B(),r=t.kind===`local`,[i,a]=(0,X.useState)(!1),[f,p]=(0,X.useState)(null),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(`local_repo`),[C,T]=(0,X.useState)([]),[E,D]=(0,X.useState)(!1),{mutateAsync:O,isPending:k}=ne(),A=re(),j=k||A,{isConfigured:M,isLoading:N}=we(),P=!N&&!M,{images:F,files:I,imagesMarkedUploadAsFile:L,clearAllFiles:R}=J(),{handleUpload:z}=_e(),{error:V}=w({enabled:r}),H=r?m(V,e):null,U=r?!!f:!!h&&!!_,W=xe(null,t=>{let i=t.trim(),a=F.length>0||I.length>0;if(!i&&!a||j||P)return;let s={images:[...F],files:[...I]},u={query:a?void 0:i||void 0,entryPoint:`home_chat_launcher`};r&&f?u={...u,workingDir:f.path,workspaceMode:x}:!r&&h&&_&&(u={...u,repository:{name:h.full_name,gitProvider:h.git_provider,branch:_.name}}),C.length>0&&(u={...u,plugins:C});let p=o.loading(e(c.HOME$CREATING_CONVERSATION),d);(async()=>{try{let t=await O(u);o.dismiss(p);try{sessionStorage.removeItem(pe)}catch{}let c=t.conversation_id,d=c.startsWith(`task-`);if(a)if(!r||d){let e=t.task_id??(d?c.slice(5):null);if(!e){l(null);return}ke(e,{content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...L]}),R(),await Me({conversationId:c,text:i,images:s.images,imagesMarkedUploadAsFile:L}),n(`/conversations/${c}`);return}else try{await de({conversationId:c,content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:L,t:e}),R()}catch(e){l(e instanceof Error?e.message:null);return}d&&i&&await Me({conversationId:c,text:i,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${c}`)}catch(e){o.dismiss(p),l(e instanceof Error?e.message:null)}})()});return(0,Z.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Z.jsx)(Ve,{})}),(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(ve,{onSubmit:W,onFilesPaste:z,disabled:j||P})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[U?(0,Z.jsx)(tt,{workspace:f,repository:h,branch:_,provider:y,workspaceMode:x,backendKind:t.kind,onRepoClick:()=>a(!0),onWorkspaceModeChange:S}):(0,Z.jsx)(He,{kind:r?`local`:`cloud`,onClick:()=>a(!0),disabled:j||!!H,disabledTooltip:H}),(0,Z.jsx)(Be,{count:C.length,onClick:()=>D(!0),disabled:j})]}),r?(0,Z.jsx)(Je,{isOpen:i,onClose:()=>a(!1),onConfirm:e=>{p(e),g(null),v(null),b(null),S(`local_repo`)}}):(0,Z.jsx)(Xe,{isOpen:i,onClose:()=>a(!1),onConfirm:({repository:e,branch:t,provider:n})=>{g(e),v(t),b(n??e.git_provider),p(null),S(`local_repo`)}}),E&&(0,Z.jsx)(ze,{selected:C,onChange:T,onClose:()=>D(!1)})]})}function rt(){let e=b(i().search);return(0,Z.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,Z.jsx)(`div`,{className:`md:px-4 lg:px-0`,children:(0,Z.jsx)(De,{})}),(0,Z.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,Z.jsx)(nt,{})}),e?null:(0,Z.jsx)(T,{})]})}var it=r(rt);export{it as t};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{L as r,k as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{r as a}from"./path-utils-PNfCKQDV.js";import{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as s}from"./useTranslation-Cbf5AGg_.js";import{t as c}from"./declaration-BGsHjPEW.js";import{S as l,n as u,x as d}from"./active-backend-context-B8rMv0X9.js";import{t as f}from"./chevron-down-D7IvFMBM.js";import{t as p}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js";import{a as m,c as h,d as g,f as _,i as v,l as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./onboarding-6NMkdNxV.js";import{t as D}from"./search-dIQ09UY2.js";import{t as O}from"./x-ZE4iplpF.js";import{t as k}from"./utils-DB9LsAzA.js";import{t as A}from"./modal-backdrop-zVwfOJZr.js";import{n as j,r as M,t as N}from"./modal-body-Cc2zp0xb.js";import{r as P}from"./base-modal-CIF_785P.js";import{_ as F,i as I,m as L,s as R}from"./form-control-classes-CbdN5aO3.js";import{t as z}from"./brand-button-B1izLAdR.js";import{n as B}from"./navigation-context-DPs2G0X8.js";import{t as V}from"./styled-tooltip-B14i_Uac.js";import{i as H,n as U,o as W,u as G}from"./dropdown-classes-D3wMJlXT.js";import{c as ee,n as K,s as q}from"./git-provider-icon-ITvsH4Ko.js";import{t as J}from"./conversation-store-LptbOvKa.js";import{t as te}from"./modal-close-button-BcIBUdSq.js";import{n as ne}from"./use-create-conversation-r1JHfKO5.js";import{r as re}from"./recommended-automations-launcher-Bj7PuHY1.js";import{t as ie}from"./folder-Bk311brm.js";import{r as Y}from"./typography-CzfoD9DY.js";import{i as ae,n as oe,t as se}from"./extension-module-card-classes-9V3J9J_b.js";import{n as ce}from"./circle-plus-check-toggle-DoFIjVE0.js";import{A as le,H as ue,I as de,R as fe,V as pe,a as me,c as he,d as ge,f as _e,h as ve,i as ye,l as be,m as xe,n as Se,o as Ce,p as we,r as Te,s as Ee,t as De,u as Oe,z as ke}from"./llm-not-configured-banner-C1ktyb3C.js";import{m as Ae}from"./lesson-plan-DMCPdtrf.js";import{t as je}from"./use-plugins-marketplace-BplU65ae.js";var X=e(t(),1);async function Me(e){let{imagesToEmbed:t}=ue(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>fe(e)));Ae.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Z=n();function Ne({plugin:e,isSelected:t,isDisabled:n=!1,onToggle:r}){return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-card-${e.name}`,className:k(`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-tertiary p-4`),children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{"data-testid":`plugin-picker-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),e.description?(0,Z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-tertiary-light`,children:e.description}):null,e.repo_path||e.ref?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.repo_path?(0,Z.jsx)(`span`,{className:ae,children:e.repo_path}):null,e.ref?(0,Z.jsxs)(`span`,{className:ae,children:[`@`,e.ref]}):null]}):null]}),(0,Z.jsx)(ce,{testId:`plugin-picker-toggle-${e.name}`,isSelected:t,isDisabled:n,onToggle:r,enableLabelKey:c.BUTTON$ADD,disableLabelKey:c.COMMON$REMOVE,enableTooltipKey:c.BUTTON$ADD,disableTooltipKey:c.COMMON$REMOVE})]})}function Q(e){return[e.source,e.ref??``,e.repo_path??``].join(`\0`)}function Pe(e){return{source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}}function Fe(e,t){let n=Q(t);return e.some(e=>Q(e)===n)}function Ie(e,t){let n=Q(t);return e.some(e=>Q(e)===n)?e.filter(e=>Q(e)!==n):[...e,Pe(t)]}function Le(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description,e.source,e.repo_path,e.ref].filter(e=>typeof e==`string`&&e.length>0).some(e=>e.toLowerCase().includes(n)):!0}function Re({selected:e,onChange:t,disabled:n=!1}){let{t:r}=s(`openhands`),{data:i,isLoading:a,isError:o}=je(),[l,u]=(0,X.useState)(``),d=(i??[]).filter(e=>Le(e,l));return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker`,className:`flex w-full flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:k(`relative flex min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`),children:[(0,Z.jsx)(D,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{"data-testid":`plugin-picker-search-input`,type:`search`,value:l,onChange:e=>u(e.target.value),placeholder:r(c.PLUGINS$PICKER_SEARCH_PLACEHOLDER),"aria-label":r(c.PLUGINS$PICKER_SEARCH_PLACEHOLDER),className:k(`min-w-0 flex-1 border-0 bg-transparent outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),l?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>u(``),"aria-label":r(c.MCP$SEARCH_CLEAR),className:`mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white`,children:(0,Z.jsx)(O,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),a?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-loading`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_LOADING)}):o?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-error`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_ERROR)}):d.length===0?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-empty`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_EMPTY)}):(0,Z.jsx)(`div`,{className:oe,children:(0,Z.jsx)(`div`,{className:se,children:d.map(r=>(0,Z.jsx)(Ne,{plugin:r,isSelected:Fe(e,r),isDisabled:n,onToggle:()=>t(Ie(e,r))},`${r.source} ${r.ref??``} ${r.repo_path??``} ${r.name}`))})})]})}function ze({selected:e,onChange:t,onClose:n}){let{t:r}=s(`openhands`);return(0,Z.jsx)(A,{onClose:n,children:(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-modal`,className:k(`relative flex max-h-[80vh] flex-col gap-4 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,M(`lg`),N),children:[(0,Z.jsx)(te,{onClose:n,testId:`plugin-picker-close`}),(0,Z.jsxs)(`div`,{className:`pr-6`,children:[(0,Z.jsx)(Y.H2,{children:r(c.PLUGINS$PICKER_TITLE)}),(0,Z.jsx)(Y.Text,{className:`mt-1 block text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_SUBTITLE)})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:(0,Z.jsx)(Re,{selected:e,onChange:t})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t border-[var(--oh-border-subtle)] pt-4`,children:[(0,Z.jsx)(Y.Text,{className:`text-sm text-tertiary-light`,children:r(c.PLUGINS$PICKER_SELECTED_COUNT,{count:e.length})}),(0,Z.jsx)(z,{testId:`plugin-picker-done`,type:`button`,variant:`primary`,onClick:n,className:`px-4`,children:r(c.PLUGINS$PICKER_DONE)})]})]})})}function Be({count:e,onClick:t,disabled:n=!1}){let{t:r}=s(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`open-plugin-picker`,onClick:t,disabled:n,className:k(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,Z.jsx)(le,{width:16,height:16,className:`shrink-0`,"aria-hidden":!0})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:r(c.PLUGINS$PICKER_TRIGGER)}),e>0?(0,Z.jsx)(`span`,{"data-testid":`plugin-picker-count`,className:`inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black`,children:e}):null]})}function Ve(){let{t:e}=s(`openhands`);return(0,Z.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,Z.jsx)(Y.H1,{className:`w-full text-center leading-normal`,children:e(c.HOME$LETS_START_BUILDING)})})}function He({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=s(`openhands`),o=e===`local`,l=i(o?c.HOME$OPEN_WORKSPACE:c.COMMON$OPEN_REPOSITORY),u=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":o?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:k(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,I,L,F,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(S,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Z.jsx)(a,{width:16,height:16,className:`shrink-0`})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:l})]});return r?(0,Z.jsx)(V,{content:r,placement:`top`,children:(0,Z.jsx)(`span`,{className:`inline-flex`,children:u})}):u}var $=`__ungrouped__`;function Ue({workspaces:e,parents:t=[],value:n,placeholder:r,className:i,disabled:a=!1,disabledTooltip:o,showManage:l,onChange:u,onAddClick:d,onManageClick:f}){let{t:m}=s(`openhands`),[h,g]=(0,X.useState)(n?.name??``),_=(0,X.useRef)(null),v=(0,X.useMemo)(()=>{let t=h.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,h]),y=(0,X.useCallback)(e=>e.parentPath??$,[]),b=(0,X.useMemo)(()=>{let e=new Map;return t.forEach(t=>e.set(t.path,t.name)),e},[t]),{groupedWorkspaces:x,isGrouped:S,headerByFirstIndex:C,groupLabelByIndex:w}=(0,X.useMemo)(()=>{let e=[],t=new Map;v.forEach(n=>{let r=y(n);t.has(r)||(t.set(r,[]),e.push(r)),t.get(r)?.push(n)}),e.sort((e,t)=>e===$?1:t===$?-1:0);let n=e.length>1,r=[],i=new Map,a=new Map;return e.forEach(e=>{let o=e===$?m(c.HOME$WORKSPACE_GROUP_OTHER):b.get(e)||e.split(`/`).filter(Boolean).pop()||e;n&&i.set(r.length,o),(t.get(e)??[]).forEach(e=>{a.set(r.length,o),r.push(e)})}),{groupedWorkspaces:r,isGrouped:n,headerByFirstIndex:i,groupLabelByIndex:a}},[v,y,b,m]),T=(0,X.useCallback)(e=>{u(e),e&&g(e.name)},[u]),E=(0,X.useCallback)(()=>{T(null),g(``)},[T]),{isOpen:D,getToggleButtonProps:O,getMenuProps:A,getInputProps:j,highlightedIndex:M,getItemProps:N,selectedItem:P,closeMenu:F}=p({items:x,itemToString:e=>e?.name??``,selectedItem:n,onSelectedItemChange:({selectedItem:e})=>{T(e??null)},inputValue:h,onIsOpenChange:({isOpen:e,selectedItem:t})=>{g(e?``:t?.name??``)},stateReducer:(e,t)=>t.type===p.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),I=(e,t,n,r,i)=>(0,Z.jsx)(be,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id,ariaLabel:S?`${w.get(t)??``}, ${e.name}`.trim():void 0},e.id),L=e=>(0,Z.jsx)(he,{inputValue:e,searchMessage:m(c.HOME$NO_WORKSPACES),emptyMessage:m(c.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),z=(0,X.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),B=(0,X.useCallback)(e=>{z(e),F(),d()},[F,d,z]),W=(0,X.useCallback)(e=>{z(e),F(),d()},[F,d,z]),G=(0,X.useCallback)(e=>{z(e),F(),f()},[F,f,z]),K=(0,X.useCallback)(e=>{z(e),F(),f()},[F,f,z]),q=(0,X.useMemo)(()=>(0,Z.jsxs)(`div`,{className:H,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:k(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:W,onClick:B,children:m(c.HOME$ADD_WORKSPACES)}),(l??e.length>0)&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:k(U,`cursor-pointer`),onMouseDown:z,onTouchStart:z,onTouchEnd:K,onClick:G,children:m(c.HOME$MANAGE_WORKSPACES)})]}),[B,W,G,K,z,m,e.length,l]),J=(0,Z.jsxs)(`div`,{className:k(`relative`,i),children:[(0,Z.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Z.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Z.jsx)(ee,{width:16,height:16})}),(0,Z.jsx)(`input`,{...j({disabled:a,placeholder:D&&n?n.name:r??m(c.HOME$WORKSPACE_PLACEHOLDER),className:k(R,`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=>{g(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Z.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[n&&(0,Z.jsx)(ge,{disabled:a,onClear:E}),(0,Z.jsx)(Oe,{isOpen:D,disabled:a,getToggleButtonProps:O})]})]}),(0,Z.jsx)(Ee,{isOpen:D,filteredItems:x,inputValue:h,highlightedIndex:M,selectedItem:P,getMenuProps:A,getItemProps:N,menuRef:_,renderItem:I,renderItemPrefix:S?(e,t)=>{let n=C.get(t);return n?(0,Z.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,"data-testid":`workspace-group-header`,className:`px-2 pt-2 pb-1 text-xs font-medium text-[var(--oh-muted)] select-none`,children:n}):null}:void 0,renderEmptyState:L,stickyFooterItem:q,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return o?(0,Z.jsx)(V,{content:o,placement:`top`,children:(0,Z.jsx)(`span`,{className:`block`,children:J})}):J}var We=`oh:home-selected-workspace-path`;function Ge(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(We);return e&&e.length>0?e:null}catch{return null}}function Ke(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(We,e):window.sessionStorage.removeItem(We)}catch{}}function qe({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=s(`openhands`),{navigate:r}=B(),{data:i,error:a}=w(),o=i?.workspaceParents??[],{mutate:l}=y(),{mutate:u}=E(),{mutate:d}=h(),{mutate:f}=g(),{workspaces:p,parents:_,isLoading:b,isError:S,error:T}=x(),D=m(a??T,n),[O,k]=X.useState(null),[A,j]=X.useState(!1),[M,N]=X.useState(!1),{mutate:P,isPending:F,isSuccess:I}=ne(),L=re(),R=F||I||L,V=X.useCallback(e=>{k(e),Ke(e?.path??null)},[]);X.useEffect(()=>{let e=Ge();if(!e)return;let t=p.find(t=>t.path===e);if(t){k(e=>e?.path===t.path?e:t);return}!b&&!S&&!D&&(Ke(null),k(t=>t?.path===e?null:t))},[S,b,p,D]);let H=o.length>0||!!D,U=null;D?U=D:b?U=n(c.HOME$LOADING):S&&(U=n(c.HOME$WORKSPACE_SCAN_ERROR));let W=!!D||e||b&&p.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(ie,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(c.HOME$WORKSPACES_TAB)})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsx)(Ue,{workspaces:p,parents:_,value:O,placeholder:D?n(c.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):W?n(c.HOME$LOADING):void 0,disabled:W,disabledTooltip:D,showManage:p.length>0||o.length>0,onChange:V,onAddClick:()=>j(!0),onManageClick:()=>N(!0),className:`max-w-auto`},O?.path??`empty-workspace-selection`),H&&U&&(0,Z.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:U})]}),(0,Z.jsx)(z,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!O||!t&&R||e,onClick:()=>{if(O){if(t){t(O);return}P({workingDir:O.path,entryPoint:`home_workspace_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:n(t?c.BUTTON$CONFIRM:R?c.HOME$LOADING:c.BUTTON$LAUNCH)}),(0,Z.jsx)(v,{isOpen:A,onClose:()=>j(!1),onAdd:e=>{let t=e[e.length-1];l(e,{onSuccess:()=>{t&&V(t)}})},onAddParent:e=>d(e)}),(0,Z.jsx)(C,{isOpen:M,workspaces:p,workspaceParents:o,onClose:()=>N(!1),onRemove:e=>{O?.path===e&&V(null),u(e)},onRemoveParent:e=>{O?.parentPath===e&&V(null),f(e)}})]})}function Je({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=s(`openhands`),{isLoadingSettings:i}=q();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(te,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(c.HOME$OPEN_WORKSPACE)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Z.jsx)(qe,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ye({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=B(),[i,o]=X.useState(null),[l,u]=X.useState(null),[d,f]=X.useState(null),{providers:p}=q(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=K(),{mutate:_,isPending:v,isSuccess:y}=ne(),b=re(),{t:x}=s(`openhands`);X.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),o(null),u(null),e?.(null))},w=X.useCallback(e=>{u(e)},[]);return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Z.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(a,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(c.COMMON$OPEN_REPOSITORY)})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(c.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,Z.jsx)(Ce,{providers:p,value:d,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Z.jsx)(ye,{provider:d||p[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!d||t,onChange:t=>{t?(e?.(t),o(t)):(e?.(null),o(null),u(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Z.jsx)(me,{repository:i?.full_name||null,provider:d||p[0],selectedBranch:l,onBranchSelect:w,defaultBranch:e,className:`max-w-full`,disabled:!i||t})})()]}),(0,Z.jsx)(z,{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`},entryPoint:`home_repo_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:x(n?c.BUTTON$CONFIRM:S?c.HOME$LOADING:c.BUTTON$LAUNCH)})]})}function Xe({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=s(`openhands`),{isLoadingSettings:i}=q();return e?(0,Z.jsx)(A,{onClose:t,children:(0,Z.jsxs)(j,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(te,{onClose:t,testId:`close-open-repository-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(P,{title:r(c.COMMON$OPEN_REPOSITORY)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Z.jsx)(Ye,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ze(e,t){return e===`new_worktree`?c.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?c.COMMON$WORKSPACE_MODE_CLOUD_REPO:c.COMMON$WORKSPACE_MODE_LOCAL_REPO}function Qe({mode:e}){return e===`new_worktree`?(0,Z.jsx)(_,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Z.jsx)(a,{width:12,height:12,color:`white`,"aria-hidden":!0})}var $e=[`local_repo`,`new_worktree`];function et({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:a}=s(`openhands`),[o,c]=(0,X.useState)(!1),l=(0,X.useRef)(null),u=a(Ze(e,t));return(0,X.useEffect)(()=>{if(!o)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]),(0,X.useEffect)(()=>{if(!o)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),(0,Z.jsxs)(`div`,{ref:l,className:`relative inline-flex`,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":o,"aria-label":u,disabled:r,onClick:()=>c(e=>!e),className:k(`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,Z.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Z.jsx)(Qe,{mode:e})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:u}),(0,Z.jsx)(f,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),o?(0,Z.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:k(`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`,H),children:$e.map(r=>{let o=a(Ze(r,t));return(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),c(!1)},className:W,children:[(0,Z.jsx)(`span`,{className:G,children:(0,Z.jsx)(Qe,{mode:r})}),(0,Z.jsx)(`span`,{className:`truncate`,children:o})]},r)})}):null]})}function tt({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,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Z.jsx)(Te,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Z.jsx)(et,{value:i,backendKind:a,onChange:s}):null,n?(0,Z.jsx)(Se,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function nt(){let{t:e}=s(`openhands`),{backend:t}=u(),{navigate:n}=B(),r=t.kind===`local`,[i,a]=(0,X.useState)(!1),[f,p]=(0,X.useState)(null),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(null),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(`local_repo`),[C,T]=(0,X.useState)([]),[E,D]=(0,X.useState)(!1),{mutateAsync:O,isPending:k}=ne(),A=re(),j=k||A,{isConfigured:M,isLoading:N}=we(),P=!N&&!M,{images:F,files:I,imagesMarkedUploadAsFile:L,clearAllFiles:R}=J(),{handleUpload:z}=_e(),{error:V}=w({enabled:r}),H=r?m(V,e):null,U=r?!!f:!!h&&!!_,W=xe(null,t=>{let i=t.trim(),a=F.length>0||I.length>0;if(!i&&!a||j||P)return;let s={images:[...F],files:[...I]},u={query:a?void 0:i||void 0,entryPoint:`home_chat_launcher`};r&&f?u={...u,workingDir:f.path,workspaceMode:x}:!r&&h&&_&&(u={...u,repository:{name:h.full_name,gitProvider:h.git_provider,branch:_.name}}),C.length>0&&(u={...u,plugins:C});let p=o.loading(e(c.HOME$CREATING_CONVERSATION),d);(async()=>{try{let t=await O(u);o.dismiss(p);try{sessionStorage.removeItem(pe)}catch{}let c=t.conversation_id,d=c.startsWith(`task-`);if(a)if(!r||d){let e=t.task_id??(d?c.slice(5):null);if(!e){l(null);return}ke(e,{content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...L]}),R(),await Me({conversationId:c,text:i,images:s.images,imagesMarkedUploadAsFile:L}),n(`/conversations/${c}`);return}else try{await de({conversationId:c,content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:L,t:e}),R()}catch(e){l(e instanceof Error?e.message:null);return}d&&i&&await Me({conversationId:c,text:i,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${c}`)}catch(e){o.dismiss(p),l(e instanceof Error?e.message:null)}})()});return(0,Z.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Z.jsx)(Ve,{})}),(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(ve,{onSubmit:W,onFilesPaste:z,disabled:j||P})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[U?(0,Z.jsx)(tt,{workspace:f,repository:h,branch:_,provider:y,workspaceMode:x,backendKind:t.kind,onRepoClick:()=>a(!0),onWorkspaceModeChange:S}):(0,Z.jsx)(He,{kind:r?`local`:`cloud`,onClick:()=>a(!0),disabled:j||!!H,disabledTooltip:H}),(0,Z.jsx)(Be,{count:C.length,onClick:()=>D(!0),disabled:j})]}),r?(0,Z.jsx)(Je,{isOpen:i,onClose:()=>a(!1),onConfirm:e=>{p(e),g(null),v(null),b(null),S(`local_repo`)}}):(0,Z.jsx)(Xe,{isOpen:i,onClose:()=>a(!1),onConfirm:({repository:e,branch:t,provider:n})=>{g(e),v(t),b(n??e.git_provider),p(null),S(`local_repo`)}}),E&&(0,Z.jsx)(ze,{selected:C,onChange:T,onClose:()=>D(!1)})]})}function rt(){let e=b(i().search);return(0,Z.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,Z.jsx)(`div`,{className:`md:px-4 lg:px-0`,children:(0,Z.jsx)(De,{})}),(0,Z.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,Z.jsx)(nt,{})}),e?null:(0,Z.jsx)(T,{})]})}var it=r(rt);export{it as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./home-BwbeOWwU.js";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./home-BwbeOWwU.js";export{e as default};
|