@openhands/agent-canvas 1.5.0 → 1.5.2
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-DHhm10VS.js} +1 -1
- package/build/assets/{add-backend-modal-BKHzq5no.js → add-backend-modal-BoMkMyLB.js} +1 -1
- package/build/assets/{agent-profiles-settings-CEp5CIz8.js → agent-profiles-settings-CYPloKYK.js} +1 -1
- package/build/assets/{agent-server-compatibility-D6DSanlx.js → agent-server-compatibility-C0MtTTwb.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-cylugfDz.js → agent-server-conversation-service.api-lzc8dabY.js} +4 -4
- package/build/assets/{agent-settings-C-tann3x.js → agent-settings-GwiXe_6k.js} +1 -1
- package/build/assets/agent-settings-OdsyI2gX.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-2gsoZAOK.js} +1 -1
- package/build/assets/app-settings-CD9euh81.js +1 -0
- package/build/assets/{automation-detail-Z9dN2f5l.js → automation-detail-Bn8q0AG3.js} +1 -1
- package/build/assets/{automation-export-D5uL0Tf8.js → automation-export-Djc8Tf0M.js} +1 -1
- package/build/assets/{automations-list-BMOWcqzZ.js → automations-list-Dtiolk1h.js} +1 -1
- package/build/assets/{back-nav-button-ZUDTMOTB.js → back-nav-button-DVknCcSP.js} +1 -1
- package/build/assets/backend-form-modal-B8GtBA-J.js +1 -0
- package/build/assets/{backend-synced-settings-badge-Db_REKVw.js → backend-synced-settings-badge-yVh6Kf4E.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-CtQjJEy6.js +1 -0
- package/build/assets/cloud-funnel-analytics-uzzLlLuj.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-Q1rHh4Qe.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-B8d8_Upd.js +1 -0
- package/build/assets/{conversation-D4o4dG2t.js → conversation-Lmqm6VJC.js} +20 -20
- package/build/assets/conversation-panel-B8n40Swu.js +1 -0
- package/build/assets/{conversation-service.api-0JG_fF9d.js → conversation-service.api-D8QU-BiL.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-Dnnak-Hq.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-DqvwvpCi.js} +1 -1
- package/build/assets/{extensions-navigation-DqSl7CJw.js → extensions-navigation-BMc9Nluv.js} +1 -1
- package/build/assets/{files-tab-c316dKAq.js → files-tab-BAkaV4aO.js} +1 -1
- package/build/assets/{files-tab-store-tfCav6bB.js → files-tab-store-DJsPxYdg.js} +1 -1
- package/build/assets/{git-provider-icon-DUb2pEos.js → git-provider-icon-xvbukHaT.js} +1 -1
- package/build/assets/{home-D7ds4Jyw.js → home-D01kSnmo.js} +1 -1
- package/build/assets/home-NZO2bF4N.js +1 -0
- package/build/assets/index-home-BsI6i0TC.js +1 -0
- package/build/assets/{install-server-modal-CvHvzZj3.js → install-server-modal-BYjqoRyX.js} +1 -1
- package/build/assets/{launch-A47TK2Me.js → launch-DlXspDku.js} +1 -1
- package/build/assets/lesson-plan-cNUjpdFx.js +4 -0
- package/build/assets/{llm-not-configured-banner-B7DR8SPs.js → llm-not-configured-banner-DUPyoFIZ.js} +7 -7
- package/build/assets/{llm-settings-Cvi7q4ox.js → llm-settings-Cs_iieFY.js} +1 -1
- package/build/assets/llm-settings-J2ke2foG.js +1 -0
- package/build/assets/{llm-subscription-service-Cz1yBBvE.js → llm-subscription-service-C0zN0-rH.js} +1 -1
- package/build/assets/{manage-backends-modal-DAVhNUCe.js → manage-backends-modal-nMoCZ2a0.js} +1 -1
- package/build/assets/manifest-f1b46f62.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-kZM-cAZw.js} +1 -1
- package/build/assets/{messages-D8MeG2ZQ.js → messages-CJAv5n4j.js} +1 -1
- package/build/assets/{model-selector-BxTbbKub.js → model-selector-D51W2Q9b.js} +1 -1
- package/build/assets/{navigation-link-imH6S7h2.js → navigation-link-D8hfwvxI.js} +1 -1
- package/build/assets/{onboarding-CyicadGt.js → onboarding-Dx8n8HFr.js} +1 -1
- package/build/assets/onboarding-modal-Bxuxpfdz.js +1 -0
- package/build/assets/{organization-service.api-QknzKDh3.js → organization-service.api-Da2jiuBS.js} +1 -1
- package/build/assets/{path-utils-BECGet7G.js → path-utils-D53ZHUQU.js} +1 -1
- package/build/assets/{planner-tab-DPKHmMAX.js → planner-tab-BM-pKx0z.js} +1 -1
- package/build/assets/{plugins-management-service-DuTTxquo.js → plugins-management-service-DISfOL13.js} +1 -1
- package/build/assets/{profiles-service.api-D6jvZOWu.js → profiles-service.api-DWetW2TL.js} +1 -1
- package/build/assets/providers-C7lMslCi.js +1 -0
- package/build/assets/{proxy-CuhhyjdX.js → proxy-G4ce0fnQ.js} +1 -1
- package/build/assets/{recommended-automations-launcher-DA6DWS7V.js → recommended-automations-launcher-BWRRvMPE.js} +1 -1
- package/build/assets/root-layout-ClEl-JlJ.js +2 -0
- package/build/assets/root-oT83qVlk.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-CwdqUOnE.js} +1 -1
- package/build/assets/{sdk-section-page-ZIltERxf.js → sdk-section-page-Cwj0T4gF.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-Ch7RH8eH.js} +1 -1
- package/build/assets/{secrets-settings-Digl7JLe.js → secrets-settings-Bc_pBX6F.js} +1 -1
- package/build/assets/{settings-dropdown-input-BD5C9fBn.js → settings-dropdown-input-Dhx9ErGd.js} +1 -1
- package/build/assets/{settings-index-CODBijya.js → settings-index-BzSIM1-N.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-BnZ7mMu7.js} +1 -1
- package/build/assets/settings-n9a395O0.js +1 -0
- package/build/assets/{settings-service.api-Bsu1PvYO.js → settings-service.api-DPTFyRXL.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-CIDDti9I.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-DmCmZgq1.js → sidebar-mobile-menu-toggle-CTX7J4wM.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-HZEbNDmX.js} +1 -1
- package/build/assets/{skills-settings-DPiCWalR.js → skills-settings-BdqijFlC.js} +1 -1
- package/build/assets/{task-list-tab-CuhcDycu.js → task-list-tab-DyfgG4MC.js} +1 -1
- package/build/assets/telemetry-SHxpVxk8.js +2 -0
- package/build/assets/{terminal-CVqF-tCD.js → terminal-BDTa1HEr.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-DHd_Id-q.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DpQjsXM0.js → use-activate-agent-profile-BRDdSwQ0.js} +1 -1
- package/build/assets/{use-active-agent-profile-Gw_uJujV.js → use-active-agent-profile-BMDTXsay.js} +1 -1
- package/build/assets/{use-active-conversation-B0sttISF.js → use-active-conversation-BbeVgedA.js} +1 -1
- package/build/assets/{use-agent-profiles-LHZEK0Gg.js → use-agent-profiles-Dn_S_Tkz.js} +1 -1
- package/build/assets/{use-agent-state-C5uA0bRj.js → use-agent-state-5qM3X30V.js} +1 -1
- package/build/assets/{use-backends-health-DKt1SmiU.js → use-backends-health-BagmAE_W.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-BAtqsbCi.js → use-can-manage-org-profiles-CyYqfzeo.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-C8m1oBy4.js → use-cloud-current-user-id-BwMX7jHW.js} +1 -1
- package/build/assets/use-config-B39iHYFi.js +1 -0
- package/build/assets/{use-create-conversation-CWQGNQ9J.js → use-create-conversation-CkKUQVbP.js} +1 -1
- package/build/assets/{use-create-secret-BIrsX3OB.js → use-create-secret-DEgM0MXZ.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-BFcE0Xms.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-CgRtnj74.js} +1 -1
- package/build/assets/{use-plugins-marketplace-Bkk07W_M.js → use-plugins-marketplace-DOJp9rlE.js} +1 -1
- package/build/assets/use-runtime-is-ready-ziHQvXZQ.js +1 -0
- package/build/assets/{use-save-agent-profile-BxEsjnW0.js → use-save-agent-profile-i4FcEP98.js} +1 -1
- package/build/assets/{use-save-settings-ioSUMqbE.js → use-save-settings-DiDEbIJw.js} +1 -1
- package/build/assets/{use-settings-DNJC4gqu.js → use-settings-BeJap6YL.js} +1 -1
- package/build/assets/{use-settings-nav-items-BUsrDbVR.js → use-settings-nav-items-D5JJjFHJ.js} +1 -1
- package/build/assets/{use-skills-BsmKm23M.js → use-skills-Blpg2BqE.js} +1 -1
- package/build/assets/{use-task-list-rs7Xbzl8.js → use-task-list-CfisapBW.js} +1 -1
- package/build/assets/use-tracking-DFoPQUSU.js +1 -0
- package/build/assets/{use-user-conversation-B337kUKB.js → use-user-conversation-BrN2xeQU.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-C8KzAdAX.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/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.d.ts +19 -3
- package/dist/hooks/query/use-task-polling.js +36 -35
- package/dist/hooks/query/use-task-polling.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/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +1 -1
- package/dist/routes/conversation.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
package/build/assets/{conversation-service.api-0JG_fF9d.js → conversation-service.api-D8QU-BiL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as e,_ as t,d as n,f as r}from"./agent-server-compatibility-
|
|
1
|
+
import{N as e,_ as t,d as n,f as r}from"./agent-server-compatibility-C0MtTTwb.js";import{c as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js";import{a,i as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js";import{l as s,n as c,o as l,t as u}from"./agent-server-conversation-service.api-lzc8dabY.js";var d=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function f(e){let t=e.split(/[\\/]+/).filter(Boolean),n=t[t.length-1];if(!n||n===`.`||n===`..`)throw Error(`Invalid file name`);return n}async function p(e,t={}){return s(e,t)}async function m(e,t,n={}){let r=f(e);return`${(await p(t,n)).replace(/[/\\]+$/,``)}/${r}`}async function h(t,n){if(n?.id===t&&n.workspace?.working_dir?.trim())return n.workspace.working_dir.trim();let r=l(t);return r?.selected_workspace?.trim()?r.selected_workspace.trim():d.test(t)?u.resolveConversationWorkingDir(t):e()}var g=5;async function _(e,n){if(n?.id===e&&n.conversation_url?.trim()&&n.session_api_key?.trim())return{conversationUrl:n.conversation_url.trim(),sessionApiKey:n.session_api_key.trim()};if(t().backend.kind===`cloud`){let[t]=await c([e]);return{conversationUrl:t?.conversation_url?.trim()??null,sessionApiKey:t?.session_api_key?.trim()??null}}return{conversationUrl:null,sessionApiKey:null}}function v(e){if(!e.conversationUrl||!e.sessionApiKey)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return{conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey}}async function y(e,n,r){let i=await h(e,r),a=await _(e,r),o=t().backend.kind===`cloud`,s=r?.id===e?r.session_api_key??a.sessionApiKey:a.sessionApiKey,c=r?.id===e?r.conversation_url??a.conversationUrl:a.conversationUrl;if(o){let e=v({conversationUrl:c,sessionApiKey:s});return b({files:n,workingDir:i,conversationUrl:e.conversationUrl,sessionApiKey:e.sessionApiKey})}return b({files:n,workingDir:i,conversationUrl:c,sessionApiKey:s})}async function b(e){let{files:t,workingDir:r,conversationUrl:i,sessionApiKey:a}=e,s=new o(n({conversationUrl:i,sessionApiKey:a,workingDir:r})),c=async e=>{try{let t=f(e.name),n=await m(e.name,r,{conversationUrl:i,sessionApiKey:a});return await s.fileUpload(e,n),{uploadedFile:t,skippedFile:null}}catch(t){return{uploadedFile:null,skippedFile:{name:e.name,reason:t instanceof Error?t.message:`Upload failed`}}}},l=[];for(let e=0;e<t.length;e+=g){let n=t.slice(e,e+g);l.push(...await Promise.all(n.map(c)))}return{uploaded_files:l.flatMap(e=>e.uploadedFile?[e.uploadedFile]:[]),skipped_files:l.flatMap(e=>e.skippedFile?[e.skippedFile]:[])}}var x=class{static currentConversation=null;static setCurrentConversation(e){this.currentConversation=e}static getCurrentConversation(){return this.currentConversation}static getClientOverrides(){return{sessionApiKey:this.currentConversation?.session_api_key}}static async getVSCodeUrl(t){let r=this.currentConversation?.id===t?this.currentConversation?.workspace?.working_dir??e():e();return{vscode_url:await new i(n(this.getClientOverrides())).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getTrajectory(e){return{trajectory:(await new a(r(this.getClientOverrides()),e).search({limit:1e4})).items??[]}}static async uploadFiles(e,t){return y(e,t,this.currentConversation)}};export{_ as n,y as r,x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-DPDgL6du.js";var t=e(e=>({execution_status:null,setExecutionStatus:t=>e({execution_status:t}),reset:()=>e({execution_status:null})}));export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-
|
|
1
|
+
import{t as e}from"./react-DPDgL6du.js";import{n as t}from"./middleware-DYHYNAnP.js";import{a as n,r}from"./conversation-local-storage-F6zVMM--.js";var i=()=>{if(typeof window>`u`)return null;let e=window.location.pathname.match(/\/conversations\/([^/]+)/);return e?e[1]:null},a=()=>{if(typeof window>`u`)return`code`;let e=i();return e?r(e).conversationMode:`code`},o=e()(t(e=>({isRightPanelShown:!1,selectedTab:`files`,images:[],files:[],imagesMarkedUploadAsFile:[],pastedImageNames:[],loadingFiles:[],loadingImages:[],messageToSend:null,messageRestoreIfEmpty:null,shouldShownAgentLoading:!1,submittedMessage:null,shouldHideSuggestions:!1,hasRightPanelToggled:!1,planContent:null,conversationMode:a(),subConversationTaskId:null,setIsRightPanelShown:t=>e({isRightPanelShown:t},!1,`setIsRightPanelShown`),setSelectedTab:t=>e({selectedTab:t},!1,`setSelectedTab`),setShouldShownAgentLoading:t=>e({shouldShownAgentLoading:t},!1,`setShouldShownAgentLoading`),setShouldHideSuggestions:t=>e({shouldHideSuggestions:t},!1,`setShouldHideSuggestions`),addImages:t=>e(e=>({images:[...e.images,...t]}),!1,`addImages`),addFiles:t=>e(e=>({files:[...e.files,...t]}),!1,`addFiles`),toggleImageUploadAsFile:t=>e(e=>{let n=new Set(e.imagesMarkedUploadAsFile);return n.has(t)?n.delete(t):n.add(t),{imagesMarkedUploadAsFile:[...n]}},!1,`toggleImageUploadAsFile`),markImagesAsPasted:t=>e(e=>({pastedImageNames:[...new Set([...e.pastedImageNames,...t])]}),!1,`markImagesAsPasted`),removeImage:t=>e(e=>{let n=e.images[t],r=[...e.images];return r.splice(t,1),{images:r,imagesMarkedUploadAsFile:n?e.imagesMarkedUploadAsFile.filter(e=>e!==n.name):e.imagesMarkedUploadAsFile,pastedImageNames:n?e.pastedImageNames.filter(e=>e!==n.name):e.pastedImageNames}},!1,`removeImage`),removeFile:t=>e(e=>{let n=[...e.files];return n.splice(t,1),{files:n}},!1,`removeFile`),clearImages:()=>e({images:[]},!1,`clearImages`),clearFiles:()=>e({files:[]},!1,`clearFiles`),clearAllFiles:()=>e({images:[],files:[],imagesMarkedUploadAsFile:[],pastedImageNames:[],loadingFiles:[],loadingImages:[]},!1,`clearAllFiles`),addFileLoading:t=>e(e=>e.loadingFiles.includes(t)?e:{loadingFiles:[...e.loadingFiles,t]},!1,`addFileLoading`),removeFileLoading:t=>e(e=>({loadingFiles:e.loadingFiles.filter(e=>e!==t)}),!1,`removeFileLoading`),addImageLoading:t=>e(e=>e.loadingImages.includes(t)?e:{loadingImages:[...e.loadingImages,t]},!1,`addImageLoading`),removeImageLoading:t=>e(e=>({loadingImages:e.loadingImages.filter(e=>e!==t)}),!1,`removeImageLoading`),clearAllLoading:()=>e({loadingFiles:[],loadingImages:[]},!1,`clearAllLoading`),setMessageToSend:t=>e({messageToSend:{text:t,timestamp:Date.now()}},!1,`setMessageToSend`),clearMessageToSend:()=>e({messageToSend:null},!1,`clearMessageToSend`),restoreMessageToInputIfEmpty:t=>e({messageRestoreIfEmpty:{text:t,timestamp:Date.now()}},!1,`restoreMessageToInputIfEmpty`),clearMessageRestoreIfEmpty:()=>e({messageRestoreIfEmpty:null},!1,`clearMessageRestoreIfEmpty`),setSubmittedMessage:t=>e({submittedMessage:t},!1,`setSubmittedMessage`),resetConversationState:()=>e({shouldHideSuggestions:!1,conversationMode:a(),subConversationTaskId:null,planContent:null},!1,`resetConversationState`),setHasRightPanelToggled:t=>e({hasRightPanelToggled:t},!1,`setHasRightPanelToggled`),setConversationMode:t=>{let r=i();r&&n(r,{conversationMode:t}),e({conversationMode:t},!1,`setConversationMode`)},setSubConversationTaskId:t=>e({subConversationTaskId:t},!1,`setSubConversationTaskId`),setPlanContent:t=>e({planContent:t},!1,`setPlanContent`)}),{name:`conversation-store`}));export{o as t};
|
package/build/assets/{copy-to-clipboard-button-Dp4Q_hXi.js → copy-to-clipboard-button-CFzH_NOX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{t}from"./useTranslation-Cbf5AGg_.js";import{t as n}from"./declaration-BGsHjPEW.js";import{t as r}from"./checkmark-
|
|
1
|
+
import{bt as e}from"./vendor-styling-CI0PQ3ab.js";import{t}from"./useTranslation-Cbf5AGg_.js";import{t as n}from"./declaration-BGsHjPEW.js";import{t as r}from"./checkmark-h7udgXMM.js";import{t as i}from"./copy-BLmGeJcd.js";var a=e();function o({isHidden:e,isDisabled:o,onClick:s,mode:c}){let{t:l}=t(`openhands`);return(0,a.jsxs)(`button`,{hidden:e,disabled:o,"data-testid":`copy-to-clipboard`,type:`button`,onClick:s,"aria-label":l(c===`copy`?n.BUTTON$COPY:n.BUTTON$COPIED),className:`button-base p-1 cursor-pointer`,children:[c===`copy`&&(0,a.jsx)(i,{width:15,height:15}),c===`copied`&&(0,a.jsx)(r,{width:15,height:15})]})}export{o 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{I as r,L as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as a}from"./useTranslation-Cbf5AGg_.js";import{t as o}from"./declaration-BGsHjPEW.js";import{t as s}from"./utils-DB9LsAzA.js";import{t as c}from"./use-is-authed-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{I as r,L as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{t as a}from"./useTranslation-Cbf5AGg_.js";import{t as o}from"./declaration-BGsHjPEW.js";import{t as s}from"./utils-DB9LsAzA.js";import{t as c}from"./use-is-authed-BezEyfeh.js";import{t as l}from"./typography-CzfoD9DY.js";var u=e(t(),1),d=n(),f=i(function(){let{t:e}=a(`openhands`),[t]=r(),{data:n,isLoading:i}=c(),[f,p]=(0,u.useState)(null),[m,h]=(0,u.useState)(!1),g=t.get(`user_code`),_=async e=>{try{h(!0),(await fetch(`/oauth/device/verify-authenticated`,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:`user_code=${encodeURIComponent(e)}`,credentials:`include`})).ok?p({success:!0,messageKey:o.DEVICE$SUCCESS_MESSAGE}):p({success:!1,messageKey:o.DEVICE$ERROR_FAILED})}catch{p({success:!1,messageKey:o.DEVICE$ERROR_OCCURRED})}finally{h(!1)}};return f?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:s(`mb-4`,f.success?`text-green-600`:`text-red-600`),children:f.success?(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 13l4 4L19 7`})}):(0,d.jsx)(`svg`,{className:`w-12 h-12 mx-auto`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,d.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})}),(0,d.jsx)(`h2`,{className:`text-xl font-medium mb-2`,children:f.success?e(o.DEVICE$SUCCESS_TITLE):e(o.DEVICE$ERROR_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-4`,children:e(f.messageKey)}),!f.success&&(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$TRY_AGAIN)})]})})}):m?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsx)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})})}):n&&g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background p-4`,children:(0,d.jsx)(`div`,{className:`flex flex-col items-center gap-6 w-full max-w-md`,children:(0,d.jsxs)(`div`,{className:`flex-1 min-w-0 max-w-md w-full mx-auto p-6 bg-card rounded-2xl shadow-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_REQUEST)}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-base rounded-lg border border-[var(--oh-border-subtle)]`,children:[(0,d.jsx)(`p`,{className:`text-xs text-[var(--oh-text-subtle)] mb-2 text-center uppercase tracking-wider`,children:e(o.DEVICE$CODE_LABEL)}),(0,d.jsx)(`p`,{className:`text-xl font-mono font-semibold text-center tracking-[0.3em]`,children:g})]}),(0,d.jsxs)(`div`,{className:`mb-6 p-4 bg-amber-950/50 border-l-2 border-amber-500 rounded-r-lg`,children:[(0,d.jsx)(`p`,{className:`text-sm font-medium text-amber-500 mb-1`,children:e(o.DEVICE$SECURITY_NOTICE)}),(0,d.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:e(o.DEVICE$SECURITY_WARNING)})]}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$CONFIRM_PROMPT)}),(0,d.jsxs)(`div`,{className:`flex gap-3`,children:[(0,d.jsx)(`button`,{type:`button`,onClick:()=>window.close(),className:`flex-1 px-4 py-2 border border-[var(--oh-border)] rounded-md hover:bg-muted text-[var(--oh-text-tertiary)]`,children:e(o.DEVICE$CANCEL)}),(0,d.jsx)(`button`,{type:`button`,onClick:()=>_(g),className:`flex-1 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700`,children:e(o.DEVICE$AUTHORIZE)})]})]})})}):n&&!g?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4 text-center`,children:e(o.DEVICE$AUTHORIZATION_TITLE)}),(0,d.jsx)(`p`,{className:`text-muted-foreground mb-6 text-center`,children:e(o.DEVICE$ENTER_CODE_PROMPT)}),(0,d.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=new FormData(e.currentTarget).get(`user_code`);t&&n&&_(t)},children:[(0,d.jsxs)(`div`,{className:`mb-4`,children:[(0,d.jsx)(`label`,{htmlFor:`user_code`,className:`block text-sm font-medium mb-2`,children:e(o.DEVICE$CODE_INPUT_LABEL)}),(0,d.jsx)(`input`,{type:`text`,id:`user_code`,name:`user_code`,required:!0,className:`w-full px-3 py-2 border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring`,placeholder:e(o.DEVICE$CODE_PLACEHOLDER)})]}),(0,d.jsx)(`button`,{type:`submit`,className:`w-full px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90`,children:e(o.DEVICE$CONTINUE)})]})]})}):i?(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`text-center`,children:[(0,d.jsx)(`div`,{className:`animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$PROCESSING)})]})}):(0,d.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,d.jsxs)(`div`,{className:`max-w-md w-full mx-auto p-6 bg-card rounded-lg shadow-lg text-center`,children:[(0,d.jsx)(l,{className:`text-2xl mb-4`,children:e(o.DEVICE$AUTH_REQUIRED)}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:e(o.DEVICE$SIGN_IN_PROMPT)})]})})});export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./utils-DB9LsAzA.js";import{p as t}from"./form-control-classes-
|
|
1
|
+
import{t as e}from"./utils-DB9LsAzA.js";import{p as t}from"./form-control-classes-CbdN5aO3.js";var n=`transition-none`,r=`gap-0.5`,i=`gap-2`,a=e(`flex flex-col`,r),o=e(`bg-tertiary border border-[var(--oh-border-input)] rounded p-2`,`flex items-center gap-2`,t,n,`group w-full gap-2 px-3 text-[var(--oh-muted)] hover:text-white`),s=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-left text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)] disabled:cursor-not-allowed disabled:opacity-60`,n),c=e(`group flex w-full cursor-pointer items-center rounded px-2 py-2 text-start text-sm font-normal`,i,`text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,`disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,n),l=e(`shrink-0 text-[var(--oh-muted)] group-hover:text-white group-focus-visible:text-white`,n),u=e(`flex size-4 shrink-0 items-center justify-center [&_svg]:text-current`,l),d=e(`inline-flex cursor-pointer items-center gap-1.5 rounded-lg border px-3 py-2 text-sm font-medium`,`border-[var(--oh-border)] bg-base-secondary text-white`,`focus-visible:border-white/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/20`,n);e(a,`overflow-y-auto custom-scrollbar-always`,`max-h-[13.875rem]`);var f=e(`overflow-y-auto custom-scrollbar`,`max-h-[min(60vh,calc(100dvh-5rem))]`),p=e(`group flex w-full items-center rounded-md px-2 py-2 text-sm font-normal text-white`,i,`hover:bg-[var(--oh-interactive-hover)]`,n);export{r as a,i as c,f as d,o as f,a as i,l,p as n,s as o,n as r,c as s,d as t,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{t as r}from"./utils-DB9LsAzA.js";import{_ as i,u as a}from"./form-control-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"./utils-DB9LsAzA.js";import{_ as i,u as a}from"./form-control-classes-CbdN5aO3.js";import{c as o,u as s}from"./dropdown-classes-D3wMJlXT.js";var c=n();function l({icon:e,text:t,className:n}){return(0,c.jsxs)(`div`,{className:r(`flex min-w-0 w-full items-center`,o,n),children:[(0,c.jsx)(`span`,{className:s,"aria-hidden":!0,children:e}),(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t})]})}var u=e(t()),d=e=>(0,c.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,c.jsx)(`path`,{d:`M7 4C7 2.89543 7.89543 2 9 2H15C16.1046 2 17 2.89543 17 4V6H18.9897C18.9959 5.99994 19.0021 5.99994 19.0083 6H21C21.5523 6 22 6.44772 22 7C22 7.55228 21.5523 8 21 8H19.9311L19.0638 20.1425C18.989 21.1891 18.1182 22 17.0689 22H6.93112C5.88184 22 5.01096 21.1891 4.9362 20.1425L4.06888 8H3C2.44772 8 2 7.55228 2 7C2 6.44772 2.44772 6 3 6H4.99174C4.99795 5.99994 5.00414 5.99994 5.01032 6H7V4ZM9 6H15V4H9V6ZM6.07398 8L6.93112 20H17.0689L17.926 8H6.07398ZM10 10C10.5523 10 11 10.4477 11 11V17C11 17.5523 10.5523 18 10 18C9.44772 18 9 17.5523 9 17V11C9 10.4477 9.44772 10 10 10ZM14 10C14.5523 10 15 10.4477 15 11V17C15 17.5523 14.5523 18 14 18C13.4477 18 13 17.5523 13 17V11C13 10.4477 13.4477 10 14 10Z`,fill:`currentColor`})}),f=e=>(0,c.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,c.jsx)(`path`,{d:`M14.25 19.5C14.25 20.7426 13.2426 21.75 12 21.75C10.7574 21.75 9.75 20.7426 9.75 19.5C9.75 18.2574 10.7574 17.25 12 17.25C13.2426 17.25 14.25 18.2574 14.25 19.5ZM14.25 12C14.25 13.2426 13.2426 14.25 12 14.25C10.7574 14.25 9.75 13.2426 9.75 12C9.75 10.7574 10.7574 9.75 12 9.75C13.2426 9.75 14.25 10.7574 14.25 12ZM14.25 4.5C14.25 5.74264 13.2426 6.75 12 6.75C10.7574 6.75 9.75 5.74264 9.75 4.5C9.75 3.25736 10.7574 2.25 12 2.25C13.2426 2.25 14.25 3.25736 14.25 4.5Z`,fill:`currentColor`})}),p=u.forwardRef(function({onClick:e,className:t,iconClassName:n,ariaLabel:o,testId:s=`ellipsis-button`},l){return(0,c.jsx)(`button`,{ref:l,"data-testid":s,type:`button`,onClick:e,"aria-label":o,className:r(`p-1 rounded-md cursor-pointer`,i,`text-[var(--oh-muted)]`,a,`flex items-center justify-center`,t),children:(0,c.jsx)(f,{className:n??`w-4 h-4`})})});export{l as i,f as n,d as r,p as t};
|
|
@@ -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-C7lMslCi.js";import{L as c}from"./active-backend-context-DHhm10VS.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-yVh6Kf4E.js";import{t as l}from"./extensions-navigation-BMc9Nluv.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-BMc9Nluv.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-yVh6Kf4E.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{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-DHhm10VS.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-C0MtTTwb.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-G4ce0fnQ.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-lzc8dabY.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-BbeVgedA.js";import{n as ae,t as L}from"./files-tab-store-DJsPxYdg.js";import{t as oe}from"./use-agent-state-5qM3X30V.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-ziHQvXZQ.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"./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{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-D53ZHUQU.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-DHhm10VS.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-C0MtTTwb.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-G4ce0fnQ.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-BeJap6YL.js";import{t as ae}from"./use-tracking-DFoPQUSU.js";import{t as T}from"./agent-server-conversation-service.api-lzc8dabY.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};
|