@openhands/agent-canvas 1.7.2 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{Trans-DP5rcauH.js → Trans-B7lYw4uD.js} +1 -1
- package/build/assets/{acp-providers-BHKZvEm5.js → acp-providers-WUD4tfSq.js} +1 -1
- package/build/assets/active-backend-context-mY7Gff5c.js +2 -0
- package/build/assets/{agent-context-settings-CTaN-Iw9.js → agent-context-settings-BTUmWEzL.js} +1 -1
- package/build/assets/{agent-profiles-settings-CR4VTqv_.js → agent-profiles-settings-Ilqid_R5.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-C_7YnjzP.js +41 -0
- package/build/assets/{agent-settings-BIOsUglV.js → agent-settings-BGTyoT6X.js} +2 -2
- package/build/assets/agent-settings-CxfT4ksO.js +1 -0
- package/build/assets/{alert-banner-C1nzoXBC.js → alert-banner-eRyIwDyU.js} +1 -1
- package/build/assets/api-key-entry-screen-JOx3SH1-.js +1 -0
- package/build/assets/app-settings-D53QZy5p.js +1 -0
- package/build/assets/automation-detail-nEflClmc.js +2 -0
- package/build/assets/{automation-export-Bu-r-EzL.js → automation-export-BO_kfqC8.js} +1 -1
- package/build/assets/{automations-list-CYw7_6FR.js → automations-list-BYncC7gv.js} +1 -1
- package/build/assets/{back-nav-button-Be_L157B.js → back-nav-button-C02hGa8t.js} +1 -1
- package/build/assets/backend-form-modal-CKrBF80P.js +1 -0
- package/build/assets/{backend-synced-settings-badge-BNpEylNP.js → backend-synced-settings-badge-CQ9xtNWm.js} +1 -1
- package/build/assets/{badge-DwgrwohM.js → badge-CzXbf7tR.js} +1 -1
- package/build/assets/{base-modal-CSHhJTSr.js → base-modal-DkVyzFMt.js} +1 -1
- package/build/assets/{brand-button-CQO8oqVo.js → brand-button-BUlDL-mz.js} +1 -1
- package/build/assets/{browser-BUDJnBg4.js → browser-3QjrEr1D.js} +1 -1
- package/build/assets/{browser-tab-CEApjoEV.js → browser-tab-BijpUbdt.js} +1 -1
- package/build/assets/{chat-send-button-D4614wUz.js → chat-send-button-BKsVjhtA.js} +1 -1
- package/build/assets/check-CrxQfJZ2.js +1 -0
- package/build/assets/chevron-down-D_LsyTA7.js +1 -0
- package/build/assets/circle-check-DZn9HkLE.js +1 -0
- package/build/assets/{circle-plus-check-toggle-E3Ecb_gg.js → circle-plus-check-toggle-DdjUiOo1.js} +1 -1
- package/build/assets/cloud-funnel-analytics-NlmDoeo2.js +1 -0
- package/build/assets/{combobox-caret-C8_eGdp2.js → combobox-caret-Dl9UtvD6.js} +1 -1
- package/build/assets/{command-menu-N_BriUy8.js → command-menu-CvLPs7dg.js} +1 -1
- package/build/assets/{condenser-settings-Czi8cKxV.js → condenser-settings-C4Y9CzQV.js} +1 -1
- package/build/assets/{confirmation-modal-gZtbojCm.js → confirmation-modal-CRBJSllP.js} +1 -1
- package/build/assets/{context-menu-list-item-BTHGFhIx.js → context-menu-list-item-FGaafXGh.js} +1 -1
- package/build/assets/conversation-D_ORtpKC.js +1 -0
- package/build/assets/conversation-Dpc5nmGi.js +90 -0
- package/build/assets/conversation-panel-D_ORtpKC.js +1 -0
- package/build/assets/conversation-state-store-CGRQemtx.js +1 -0
- package/build/assets/{conversation-tab-empty-state-BCMHkGQk.js → conversation-tab-empty-state-CDjvNgpG.js} +1 -1
- package/build/assets/{copy-B8Y5ufoR.js → copy-Drwu97Gx.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-C4l3CMSd.js → copy-to-clipboard-button-NbN1clVr.js} +1 -1
- package/build/assets/{device-verify-C_M7Z8xs.js → device-verify-CDm_WrVu.js} +1 -1
- package/build/assets/{dropdown-classes-DQlj-MpS.js → dropdown-classes-CqA2BTCL.js} +1 -1
- package/build/assets/{entry.client-DETaouwO.js → entry.client-BO2KQj0y.js} +2 -2
- package/build/assets/{enum-filter-dropdown-paB-lFSP.js → enum-filter-dropdown-DSqPZnsD.js} +1 -1
- package/build/assets/{environment-switch-overlay-D0FgCMqs.js → environment-switch-overlay-mGl2pqqx.js} +1 -1
- package/build/assets/extensions-hub-Br3Lgynp.js +1 -0
- package/build/assets/extensions-navigation-BQmstKDZ.js +1 -0
- package/build/assets/{external-link-Cnnd6ikC.js → external-link-D9B2QMPf.js} +1 -1
- package/build/assets/files-tab-4c9HFSLo.js +1 -0
- package/build/assets/{form-control-classes-CSPevi7c.js → form-control-classes-CtVAktAy.js} +1 -1
- package/build/assets/{format-time-delta-DuhE50B-.js → format-time-delta-DICE64sz.js} +1 -1
- package/build/assets/git-provider-icon-0PqmIS_S.js +1 -0
- package/build/assets/{highlighted-source-view-suUKd5if.js → highlighted-source-view-KMsA9c4a.js} +1 -1
- package/build/assets/home-D9JsyEmE.js +1 -0
- package/build/assets/{home-sN90Xcxp.js → home-TFhnmZLx.js} +1 -1
- package/build/assets/index-home-D9JsyEmE.js +1 -0
- package/build/assets/install-server-modal-BgGRnqA0.js +1 -0
- package/build/assets/{launch-Ccnhte5b.js → launch-DjkKw55l.js} +1 -1
- package/build/assets/{list-todo-_BXQzOiB.js → list-todo-BpAf7aOT.js} +1 -1
- package/build/assets/{llm-not-configured-banner-DTWzISnk.js → llm-not-configured-banner-Y4W9-sar.js} +4 -4
- package/build/assets/llm-settings-D8zNkIlP.js +1 -0
- package/build/assets/llm-settings-nPwv7hKu.js +1 -0
- package/build/assets/{llm-subscription-service-W5BprsNA.js → llm-subscription-service-COTgZc1C.js} +1 -1
- package/build/assets/loader-circle-CGD6-Vak.js +1 -0
- package/build/assets/{loading-spinner-CcpnCr_d.js → loading-spinner-DRFyh6Iy.js} +1 -1
- package/build/assets/manage-backends-modal-DiRWE3tJ.js +1 -0
- package/build/assets/manifest-1cf33a7b.js +1 -0
- package/build/assets/markdown-renderer-U40HF0Ak.js +8 -0
- package/build/assets/mcp-xDMaHzOw.js +9 -0
- package/build/assets/{messages-DINDkPNK.js → messages-CdNfZPgd.js} +2 -2
- package/build/assets/{modal-body-DQhiw-AR.js → modal-body-C3bGicn4.js} +1 -1
- package/build/assets/{modal-classes-YaEEa5eZ.js → modal-classes-DFFO6BMU.js} +1 -1
- package/build/assets/{modal-close-button-turIYn0t.js → modal-close-button-vxkAIRyZ.js} +1 -1
- package/build/assets/{onboarding-BegDrOKn.js → onboarding-DWuFieEA.js} +1 -1
- package/build/assets/onboarding-modal-C8m72Dpb.js +1 -0
- package/build/assets/organization-service.api-CQ73CB-S.js +1 -0
- package/build/assets/{pencil-8_lvWDoZ.js → pencil-DzW2GB2M.js} +1 -1
- package/build/assets/{planner-tab-w6HT0N_A.js → planner-tab-YG0bGxDY.js} +1 -1
- package/build/assets/plugins-management-service-ijhH8OSh.js +1 -0
- package/build/assets/plus-CTGLo3aa.js +1 -0
- package/build/assets/profiles-service.api-C32pPm70.js +1 -0
- package/build/assets/providers-DuSn9s2i.js +1 -0
- package/build/assets/proxy-BiyDhMBd.js +1 -0
- package/build/assets/{puzzle-DXWdfaa7.js → puzzle-DlqT0yvr.js} +1 -1
- package/build/assets/{recommended-automations-launcher-BF2mtAKw.js → recommended-automations-launcher-Dru1yN46.js} +2 -2
- package/build/assets/{refresh-cw-D7CYLy-d.js → refresh-cw-Br5254f4.js} +1 -1
- package/build/assets/root-DOLLQteU.js +2 -0
- package/build/assets/root-layout-xmylWoew.js +3 -0
- package/build/assets/schema-field-htfNouTG.js +1 -0
- package/build/assets/{sdk-section-page-BW-i45yr.js → sdk-section-page-D0K1dBQY.js} +1 -1
- package/build/assets/search-BrpWXWUi.js +1 -0
- package/build/assets/secrets-service-Dbv5Zb8G.js +1 -0
- package/build/assets/{secrets-settings-D7U1ErCH.js → secrets-settings-Da4SSaX9.js} +1 -1
- package/build/assets/{segmented-toggle-DbbD3Tve.js → segmented-toggle-CZKOdIly.js} +1 -1
- package/build/assets/settings-F4a09IxY.js +1 -0
- package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-jOiv5Yrk.js} +1 -1
- package/build/assets/{settings-index-COAdxm2Q.js → settings-index-CyJBf5NA.js} +1 -1
- package/build/assets/{settings-input-BjW_zyTN.js → settings-input-BEaTCem1.js} +1 -1
- package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-VqMzkYYt.js} +1 -1
- package/build/assets/{settings-modal-CFnbQ8_4.js → settings-modal-C-S1NpbC.js} +1 -1
- package/build/assets/settings-service.api-CTJRrvMu.js +1 -0
- package/build/assets/{settings-switch-UNSf8K8I.js → settings-switch-B405oU_v.js} +1 -1
- package/build/assets/{shared-conversation-CnMxy7p_.js → shared-conversation-BvWtTwES.js} +1 -1
- package/build/assets/{sidebar-layout-DXHtbEj1.js → sidebar-layout-BGMuyC86.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-U78hQRJ1.js → sidebar-mobile-menu-toggle-xiKoUfGa.js} +1 -1
- package/build/assets/{sidebar-nav-link-pvUivfK2.js → sidebar-nav-link-DA4_ct9G.js} +1 -1
- package/build/assets/{sidebar-store-DwrYKwYr.js → sidebar-store-FRJ3rADB.js} +1 -1
- package/build/assets/{skill-card-pill-row-D7XCz5uk.js → skill-card-pill-row-BMdhr_sd.js} +1 -1
- package/build/assets/{skill-icon-badge-HqBWZ2Eq.js → skill-icon-badge-CGUkgcVH.js} +1 -1
- package/build/assets/{skills-plugins-BPhaNpfx.js → skills-plugins-C5eJnyft.js} +1 -1
- package/build/assets/{skills-settings-CcwMtnnJ.js → skills-settings-pUxMr6WZ.js} +1 -1
- package/build/assets/{styled-tooltip-DsjDnR_W.js → styled-tooltip-B3kIdVyH.js} +1 -1
- package/build/assets/{task-list-tab-BmaTwjaS.js → task-list-tab-B3k4W1cK.js} +1 -1
- package/build/assets/{terminal-BRcoba5B.js → terminal-CBI_41Zc.js} +1 -1
- package/build/assets/{toggle-switch-BptY3XRG.js → toggle-switch-DYRr9CAR.js} +1 -1
- package/build/assets/{trash-2-Bq4lHbTB.js → trash-2-gZPlx23R.js} +1 -1
- package/build/assets/{typography-C6fuRTTT.js → typography-B1UxuuEC.js} +1 -1
- package/build/assets/{use-acp-credential-form-B0_pZ_uS.js → use-acp-credential-form-CjSvKWFH.js} +1 -1
- package/build/assets/use-activate-agent-profile-DCRf47e-.js +1 -0
- package/build/assets/use-agent-profiles-DmT9zxAN.js +1 -0
- package/build/assets/{use-can-manage-org-profiles-CrG1km7R.js → use-can-manage-org-profiles-vBiP7rHF.js} +1 -1
- package/build/assets/use-cloud-current-user-id-BMq9gw93.js +1 -0
- package/build/assets/use-config-C959QcRC.js +1 -0
- package/build/assets/{use-create-conversation-Dsa4nzU9.js → use-create-conversation-CakhLF0X.js} +1 -1
- package/build/assets/{use-create-secret-BnxuAjDt.js → use-create-secret-RT4QtSS9.js} +1 -1
- package/build/assets/use-llm-profiles-CdaxVpyY.js +1 -0
- package/build/assets/use-onboarding-completion-CJU4MNAY.js +1 -0
- package/build/assets/use-plugins-marketplace-D-93nqtJ.js +1 -0
- package/build/assets/{use-save-agent-profile-2Mk9ZX37.js → use-save-agent-profile-DGJ3-u0M.js} +1 -1
- package/build/assets/{use-save-settings-BRh9p_fv.js → use-save-settings--C6LZXfI.js} +1 -1
- package/build/assets/use-settings-DIAo5KFk.js +1 -0
- package/build/assets/use-settings-nav-items-DPK5sxvR.js +16 -0
- package/build/assets/use-skills-D_mLhYNa.js +1 -0
- package/build/assets/use-tracking-COqZLobY.js +1 -0
- package/build/assets/{use-user-conversation-GnGhs_Ob.js → use-user-conversation-DhcAEyJX.js} +1 -1
- package/build/assets/{useMutation-DyQXZFEF.js → useMutation-DHLpZ6J0.js} +1 -1
- package/build/assets/utils-DsWhWn2F.js +1 -0
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js} +1 -1
- package/build/assets/{vendor~files-tab-vm3f67Pz.js → vendor~files-tab-atebg0iG.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-kX4LrGQC.js → vendor~index-home~home~conversation-panel~conversation-G9DMrR7m.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-DpA6fir3.js → vendor~root-layout~conversation-panel~conversation-DEhW1h3I.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js → vendor~root-layout~index-home~home~conversation-panel~conversation-Acmf1sKj.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js} +1 -1
- package/build/assets/{verification-settings-CaCzojbc.js → verification-settings-Vr5cN4md.js} +1 -1
- package/build/assets/x-Dx_JbpHA.js +1 -0
- package/build/favicon-16x16.png +0 -0
- package/build/favicon-32x32.png +0 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +2 -0
- package/build/locales/ca/openhands.json +2 -0
- package/build/locales/de/openhands.json +2 -0
- package/build/locales/en/openhands.json +2 -0
- package/build/locales/es/openhands.json +2 -0
- package/build/locales/fr/openhands.json +2 -0
- package/build/locales/it/openhands.json +2 -0
- package/build/locales/ja/openhands.json +2 -0
- package/build/locales/ko-KR/openhands.json +2 -0
- package/build/locales/no/openhands.json +2 -0
- package/build/locales/pt/openhands.json +2 -0
- package/build/locales/tr/openhands.json +2 -0
- package/build/locales/uk/openhands.json +2 -0
- package/build/locales/zh-CN/openhands.json +2 -0
- package/build/locales/zh-TW/openhands.json +2 -0
- package/config/defaults.json +4 -4
- package/dist/api/agent-server-adapter.cjs +1 -1
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.js +7 -7
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.js +95 -95
- package/dist/api/automation-service/automation-service.api.js.map +1 -1
- package/dist/api/backend-registry/storage.cjs +1 -1
- package/dist/api/backend-registry/storage.cjs.map +1 -1
- package/dist/api/backend-registry/storage.js +1 -1
- package/dist/api/backend-registry/storage.js.map +1 -1
- package/dist/api/backend-registry/types.d.ts +2 -0
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.js +22 -22
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -19
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.js +26 -12
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +16 -16
- package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
- package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-server-card.js +6 -7
- package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.cjs.map +1 -1
- package/dist/components/features/mcp-page/installed-servers-section.d.ts +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js +2 -2
- package/dist/components/features/mcp-page/installed-servers-section.js.map +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.cjs +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.js +4 -4
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/contexts/active-backend-context.cjs +1 -1
- package/dist/contexts/active-backend-context.cjs.map +1 -1
- package/dist/contexts/active-backend-context.d.ts +3 -2
- package/dist/contexts/active-backend-context.js +55 -42
- package/dist/contexts/active-backend-context.js.map +1 -1
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +5 -5
- package/dist/hooks/query/use-cloud-current-user-id.cjs +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-current-user-id.js +7 -5
- package/dist/hooks/query/use-cloud-current-user-id.js.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
- package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
- package/dist/hooks/query/use-cloud-organizations.js +5 -1
- package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
- package/dist/hooks/use-can-manage-org-profiles.cjs +1 -1
- package/dist/hooks/use-can-manage-org-profiles.cjs.map +1 -1
- package/dist/hooks/use-can-manage-org-profiles.js +2 -1
- package/dist/hooks/use-can-manage-org-profiles.js.map +1 -1
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.js +9 -9
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +2 -0
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +1 -1
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +34 -0
- package/dist/i18n/translation.js.map +1 -1
- package/dist/locales/ar/openhands.json +2 -0
- package/dist/locales/ca/openhands.json +2 -0
- package/dist/locales/de/openhands.json +2 -0
- package/dist/locales/en/openhands.json +2 -0
- package/dist/locales/es/openhands.json +2 -0
- package/dist/locales/fr/openhands.json +2 -0
- package/dist/locales/it/openhands.json +2 -0
- package/dist/locales/ja/openhands.json +2 -0
- package/dist/locales/ko-KR/openhands.json +2 -0
- package/dist/locales/no/openhands.json +2 -0
- package/dist/locales/pt/openhands.json +2 -0
- package/dist/locales/tr/openhands.json +2 -0
- package/dist/locales/uk/openhands.json +2 -0
- package/dist/locales/zh-CN/openhands.json +2 -0
- package/dist/locales/zh-TW/openhands.json +2 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +9 -0
- package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dist/routes/app-settings.cjs +1 -1
- package/dist/routes/app-settings.js +5 -5
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.js +73 -82
- package/dist/routes/mcp.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 +8 -0
- package/dist/services/telemetry.js +163 -116
- package/dist/services/telemetry.js.map +1 -1
- package/dist/types/mcp-server.d.ts +5 -0
- package/dist/types/settings.d.ts +3 -0
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.d.ts +8 -0
- package/dist/utils/mcp-config.js +25 -20
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-installed-servers.cjs +1 -1
- package/dist/utils/mcp-installed-servers.cjs.map +1 -1
- package/dist/utils/mcp-installed-servers.js +6 -3
- package/dist/utils/mcp-installed-servers.js.map +1 -1
- package/package.json +2 -2
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +2 -2
- package/build/assets/active-backend-context-BlZPzZNU.js +0 -1
- package/build/assets/agent-server-conversation-service.api-Btmi4q6d.js +0 -41
- package/build/assets/agent-settings-KQs-occT.js +0 -1
- package/build/assets/api-key-entry-screen-BhR24gkM.js +0 -1
- package/build/assets/app-settings-Bs4sY8WP.js +0 -1
- package/build/assets/automation-detail-CwDnJbYR.js +0 -2
- package/build/assets/backend-form-modal-Ce-KRHOJ.js +0 -1
- package/build/assets/check-BMOG005H.js +0 -1
- package/build/assets/chevron-down-CV1zZP_K.js +0 -1
- package/build/assets/circle-check-lvN_jFN5.js +0 -1
- package/build/assets/client-source-1v-kWLNU.js +0 -1
- package/build/assets/cloud-funnel-analytics-CasMM7EO.js +0 -1
- package/build/assets/conversation-C25pc2dT.js +0 -1
- package/build/assets/conversation-CObLYSJd.js +0 -90
- package/build/assets/conversation-panel-C25pc2dT.js +0 -1
- package/build/assets/conversation-state-store-DTq4hFoP.js +0 -1
- package/build/assets/extensions-hub-BKftOQ-X.js +0 -1
- package/build/assets/extensions-navigation-DF24q1H1.js +0 -1
- package/build/assets/files-tab-SAiFCnS5.js +0 -1
- package/build/assets/git-provider-icon-BREx-yUX.js +0 -1
- package/build/assets/home-EPNFgzUh.js +0 -1
- package/build/assets/index-home-EPNFgzUh.js +0 -1
- package/build/assets/install-server-modal-BI8yUfmr.js +0 -1
- package/build/assets/llm-settings-BXk5_Pac.js +0 -1
- package/build/assets/llm-settings-C1vpgWam.js +0 -1
- package/build/assets/loader-circle-6zlEYCJw.js +0 -1
- package/build/assets/manage-backends-modal-DhflyGTf.js +0 -1
- package/build/assets/manifest-8082e879.js +0 -1
- package/build/assets/markdown-renderer-CvOO0YIr.js +0 -8
- package/build/assets/mcp-CxLPda-W.js +0 -9
- package/build/assets/onboarding-modal-DdvE6rzw.js +0 -1
- package/build/assets/organization-service.api-CT2OQlLz.js +0 -1
- package/build/assets/plugins-management-service-DVkoM3eA.js +0 -1
- package/build/assets/plus-vIbGD459.js +0 -1
- package/build/assets/profiles-service.api-CBafmAPO.js +0 -1
- package/build/assets/providers-9UzRB9mT.js +0 -1
- package/build/assets/proxy-C79PCMjo.js +0 -1
- package/build/assets/root-Sj7W28yE.js +0 -2
- package/build/assets/root-layout-DbhKVoc7.js +0 -3
- package/build/assets/schema-field-CV6bFnoL.js +0 -1
- package/build/assets/search-sKuYKllf.js +0 -1
- package/build/assets/secrets-service-BjK-bPN2.js +0 -1
- package/build/assets/settings-Bj5Oo45A.js +0 -1
- package/build/assets/settings-service.api-DryhKdSr.js +0 -1
- package/build/assets/telemetry-cmCL3o6Z.js +0 -2
- package/build/assets/use-activate-agent-profile-DH33MvVj.js +0 -1
- package/build/assets/use-agent-profiles-Dmd_4H8q.js +0 -1
- package/build/assets/use-cloud-current-user-id-B6DP3s47.js +0 -1
- package/build/assets/use-config-Csy8EAP9.js +0 -1
- package/build/assets/use-llm-profiles-BMQoc612.js +0 -1
- package/build/assets/use-onboarding-completion-B-2BTS-y.js +0 -1
- package/build/assets/use-plugins-marketplace-PBc_XNz_.js +0 -1
- package/build/assets/use-settings-DBI44RnH.js +0 -1
- package/build/assets/use-settings-nav-items-Cva28C-c.js +0 -16
- package/build/assets/use-skills-RQsCtdzN.js +0 -1
- package/build/assets/use-tracking-CN1nIMnY.js +0 -1
- package/build/assets/utils-qjs_KuS4.js +0 -1
- package/build/assets/x-EjvKGawc.js +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-C-S1NpbC.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Bcgpimp9.js","assets/active-backend-context-mY7Gff5c.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js","assets/utils-DsWhWn2F.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js","assets/llm-settings-D8zNkIlP.js","assets/useMutation-DHLpZ6J0.js","assets/useQuery-B38jBavx.js","assets/back-nav-button-C02hGa8t.js","assets/navigation-link-Bxmn-pCs.js","assets/navigation-context-BOGzIng3.js","assets/form-control-classes-CtVAktAy.js","assets/copy-Drwu97Gx.js","assets/external-link-D9B2QMPf.js","assets/proxy-BiyDhMBd.js","assets/profiles-service.api-C32pPm70.js","assets/settings-service.api-CTJRrvMu.js","assets/settings-Chfn5xTD.js","assets/llm-subscription-service-COTgZc1C.js","assets/llm-subscription-DTqtBCWz.js","assets/use-can-manage-org-profiles-vBiP7rHF.js","assets/organization-service.api-CQ73CB-S.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js","assets/dropdown-classes-CqA2BTCL.js","assets/badge-CzXbf7tR.js","assets/settings-input-BEaTCem1.js","assets/base-modal-DkVyzFMt.js","assets/modal-body-C3bGicn4.js","assets/modal-classes-DFFO6BMU.js","assets/modal-backdrop-X-vKo61e.js","assets/brand-button-BUlDL-mz.js","assets/sdk-section-page-D0K1dBQY.js","assets/switch-skeleton-BQoOhQTB.js","assets/schema-field-htfNouTG.js","assets/dist-hOnv1nn2.js","assets/settings-dropdown-input-jOiv5Yrk.js","assets/combobox-caret-Dl9UtvD6.js","assets/settings-switch-B405oU_v.js","assets/toggle-switch-DYRr9CAR.js","assets/use-is-authed-BsS4XwSL.js","assets/typography-B1UxuuEC.js","assets/use-save-settings--C6LZXfI.js","assets/use-tracking-COqZLobY.js","assets/use-settings-DIAo5KFk.js","assets/extension-module-card-classes-Bo43vY5V.js","assets/copy-to-clipboard-button-NbN1clVr.js","assets/checkmark-CxdXtM3b.js","assets/copy-z7idLzWO.js","assets/loading-spinner-DRFyh6Iy.js","assets/settings-section-header-context-CnIIQAUn.js","assets/use-llm-profiles-CdaxVpyY.js","assets/u-check-circle-DBEvndTS.js","assets/u-edit-809W9D9T.js","assets/map-provider-CXU6issd.js","assets/settings-list-classes-VqMzkYYt.js","assets/settings-utils-BL_Z9uIe.js","assets/manage-backends-modal-DiRWE3tJ.js","assets/pencil-DzW2GB2M.js","assets/plus-CTGLo3aa.js","assets/refresh-cw-Br5254f4.js","assets/trash-2-gZPlx23R.js","assets/backend-form-modal-CKrBF80P.js","assets/segmented-toggle-CZKOdIly.js","assets/use-onboarding-completion-CJU4MNAY.js","assets/useQueries-B3T1a7qt.js","assets/modal-close-button-vxkAIRyZ.js","assets/cloud-funnel-analytics-NlmDoeo2.js","assets/confirmation-modal-CRBJSllP.js","assets/use-cloud-current-user-id-BMq9gw93.js","assets/environment-switch-overlay-mGl2pqqx.js","assets/environment-switch-store-DVQZLFbj.js","assets/alert-banner-eRyIwDyU.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js","assets/iconBase-B2rQun3J.js","assets/vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js","assets/close-CDAVqnTn.js","assets/command-menu-CvLPs7dg.js","assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js","assets/list-todo-BpAf7aOT.js","assets/search-BrpWXWUi.js","assets/sidebar-store-FRJ3rADB.js","assets/conversation-store-C6hSXHw0.js","assets/x-Dx_JbpHA.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,bt as r,i,xt as a,yt as o}from"./vendor-styling-Bcgpimp9.js";import{B as s,F as c,I as l,L as u,R as d,U as f,V as p,W as m,k as h,m as g,z as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as v}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{a as y,l as b,o as x,t as S,u as C}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js";import{E as w}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{t as T}from"./useQuery-B38jBavx.js";import{t as E}from"./use-is-creating-conversation-CIAcnd8M.js";import{Bt as D,Dt as O,Ot as ee,_ as k,d as A,g as j,i as M,l as N,lt as P,n as F,r as I,u as L,v as R,vt as te,y as z}from"./active-backend-context-mY7Gff5c.js";import{C as B,S as V,b as ne,t as H,y as re,z as U}from"./utils-DsWhWn2F.js";import{n as ie}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js";import{t as ae}from"./check-CrxQfJZ2.js";import{n as oe,t as se}from"./vendor~root-layout~conversation-panel~conversation-DEhW1h3I.js";import{r as ce}from"./onboarding-modal-C8m72Dpb.js";import{n as W,t as le}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-Acmf1sKj.js";import{a as ue,c as de,d as fe,f as pe,i as me,l as he,n as ge,o as _e,p as G,r as ve,s as ye,t as be,u as xe}from"./onboarding-DWuFieEA.js";import{n as Se,t as Ce}from"./format-time-delta-DICE64sz.js";import{t as we}from"./plus-CTGLo3aa.js";import{t as Te}from"./search-BrpWXWUi.js";import{n as Ee,r as K,t as De}from"./sidebar-store-FRJ3rADB.js";import{a as Oe}from"./llm-settings-D8zNkIlP.js";import{t as q}from"./trash-2-gZPlx23R.js";import{t as ke}from"./x-Dx_JbpHA.js";import{o as Ae}from"./use-onboarding-completion-CJU4MNAY.js";import{t as je}from"./loading-spinner-DRFyh6Iy.js";import{t as Me}from"./use-config-C959QcRC.js";import{n as Ne,t as Pe}from"./use-tracking-COqZLobY.js";import{n as Fe,t as Ie}from"./use-settings-DIAo5KFk.js";import{t as Le}from"./use-save-settings--C6LZXfI.js";import{t as Re}from"./modal-backdrop-X-vKo61e.js";import{n as ze}from"./modal-body-C3bGicn4.js";import{i as Be,r as Ve}from"./base-modal-DkVyzFMt.js";import{_ as He,c as Ue}from"./form-control-classes-CtVAktAy.js";import{n as We,t as Ge}from"./navigation-context-BOGzIng3.js";import{t as Ke}from"./openhands-logo-CmYvJXBa.js";import{t as qe}from"./navigation-link-Bxmn-pCs.js";import{a as Je,d as Ye,f as Xe,i as Ze,l as Qe,n as $e,r as et,u as tt}from"./sidebar-layout-BGMuyC86.js";import{n as nt,t as rt}from"./sidebar-nav-link-DA4_ct9G.js";import{t as it}from"./styled-tooltip-B3kIdVyH.js";import{a as at,d as ot,f as st,i as J,l as ct,n as lt,o as ut,r as dt,u as ft}from"./dropdown-classes-CqA2BTCL.js";import{r as pt,t as mt}from"./combobox-caret-Dl9UtvD6.js";import{_ as ht,a as gt,c as _t,d as vt,f as yt,g as bt,h as xt,i as St,l as Ct,m as wt,n as Tt,p as Et,r as Dt,t as Ot,u as kt,v as At}from"./git-provider-icon-0PqmIS_S.js";import{n as jt,t as Mt}from"./use-cloud-current-user-id-BMq9gw93.js";import{s as Nt}from"./environment-switch-store-DVQZLFbj.js";import{d as Pt,f as Ft,l as It,t as Lt}from"./conversation-store-C6hSXHw0.js";import{o as Rt,r as zt}from"./backend-form-modal-CKrBF80P.js";import{t as Bt}from"./manage-backends-modal-DiRWE3tJ.js";import{n as Vt,t as Ht}from"./agent-server-conversation-service.api-C_7YnjzP.js";import{c as Ut,d as Wt,u as Gt}from"./acp-providers-WUD4tfSq.js";import{t as Kt}from"./use-is-authed-BsS4XwSL.js";import{a as qt,i as Jt,n as Yt,t as Xt}from"./conversation-state-store-CGRQemtx.js";import{a as Zt,c as Qt,d as $t,f as en,i as tn,l as nn,o as rn,r as an,s as on,t as sn,u as cn}from"./sidebar-mobile-menu-toggle-xiKoUfGa.js";import{t as ln}from"./use-click-outside-element-DKqpqEEm.js";import{t as un}from"./use-llm-profiles-CdaxVpyY.js";import{n as dn}from"./use-create-conversation-CakhLF0X.js";import{r as fn,t as pn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{n as mn,t as hn}from"./context-menu-list-item-FGaafXGh.js";import{a as gn,i as _n,n as vn}from"./use-can-manage-org-profiles-vBiP7rHF.js";import{t as yn}from"./u-edit-809W9D9T.js";import{t as bn}from"./skills-CYFLsN5U.js";import{t as xn}from"./search-7DRiGm4Z.js";import{t as Sn}from"./use-user-conversation-DhcAEyJX.js";var Cn=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),wn=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Tn=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),En=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Dn=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),On=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),kn=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),An=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),jn=w(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Mn=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Nn=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Pn=w(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Y=e(n(),1),X=o(),Fn=46,In=30;function Ln({className:e,logoClassName:t,logoWidth:n=Fn,logoHeight:r=In}={}){let{t:i}=v(`openhands`);return(0,X.jsx)(qe,{to:`/conversations`,"aria-label":i(U.BRANDING$OPENHANDS_LOGO),className:H(e),children:(0,X.jsx)(Ke,{width:n,height:r,className:H(`shrink-0`,t)})})}function Rn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function zn({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(ke,{size:14})})}function Bn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:H(pt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(mt,{})})}function Vn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:H(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:H(`p-0`,J)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:H(ut,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:ft,children:e.prefix}):null,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(At,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Hn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:H(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,Ue,`px-0 not-italic text-inherit`)})})}var Un={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Wn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``);Y.useEffect(()=>()=>{_.current&&=(clearTimeout(_.current),null)},[]);let S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:ee,getItemProps:k,getInputProps:A}=le({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===le.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),j=r||i,M=w?e.find(e=>e.value===w.value)??w:null,N=e=>A({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:H(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...N({"aria-label":a??`Filter options`,tabIndex:-1}),style:Un}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Un,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:H(st,g?`w-auto`:`w-full`,j&&`cursor-not-allowed opacity-60`,l),children:[M?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:M.prefix}):null,(0,X.jsx)(Hn,{placeholder:a,isDisabled:j,getInputProps:N,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(Rn,{}),n&&w&&(0,X.jsx)(zn,{onClear:()=>T(null)}),(0,X.jsx)(Bn,{isOpen:C,isDisabled:j,getToggleButtonProps:O})]}),(0,X.jsx)(Vn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:ee,getItemProps:k,footer:u,openUpward:d,fitContent:g})]})}var Gn=t({AddBackendModal:()=>Kn});function Kn({onClose:e}){return(0,X.jsx)(zt,{mode:`add`,onClose:e})}var qn=`::`;function Jn(e,t){return t?`${e}${qn}${t}`:e}function Yn(e){let[t,n]=e.split(qn);return{backendId:t,orgId:n??null}}function Xn(e){return(0,X.jsx)(Rt,{isConnected:e?.isConnected??null})}function Zn(){return(0,X.jsx)(Rt,{isConnected:`unavailable`})}function Qn(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:Jn(e.id,null),label:e.name,prefix:Xn(i[e.id])});for(let e of s){let o=n[e.id],s=Xn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Jn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:Jn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function $n({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:o=!1}={}){let{t:s}=v(`openhands`),{backends:c,active:u,setActive:f}=I(),p=jt(),m=Mt(),h=Ae(c),g=d(),_=l(`/settings`),y=l(`/settings/*`),b=l(`/conversations/:conversationId`),x=l(`/automations/:automationId`),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),E=s(U.BACKEND$PERSONAL_WORKSPACE),D=Y.useMemo(()=>Qn(c,E,p,m,h),[c,E,p,m,h]),O=P(u.backend),ee=s(U.BACKEND$NO_BACKEND_AVAILABLE),k=Jn(u.backend.id,u.orgId),A=O?void 0:D.find(e=>e.value===k),j=!!(_||y),M=s(U.SIDEBAR$SETTINGS),N=Lt(e=>e.isRightPanelShown),F=!o||b&&N?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(O||u.backend.kind!==`cloud`||u.orgId)return;let{backend:e}=u,t=p[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=m[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&f(e.id,a.id)},[u,p,m,f,O]);let R=Y.useCallback(()=>{if(i){i(),r?.();return}C(!0)},[i,r]),z=Y.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),B=te()!==null,V=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ne=Y.useCallback(e=>{V(e),R()},[R,V]),re=Y.useCallback(e=>{V(e),R()},[R,V]),ie=Y.useCallback(e=>{V(e),z()},[z,V]),ae=Y.useCallback(e=>{V(e),z()},[z,V]),oe=(0,X.jsxs)(`div`,{className:J,children:[B?null:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:V,onTouchStart:V,onTouchEnd:re,onClick:ne,className:H(lt,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ft,"aria-hidden":!0,children:(0,X.jsx)(we,{width:16,height:16})}),s(U.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:V,onTouchStart:V,onTouchEnd:ae,onClick:ie,className:H(lt,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ft,"aria-hidden":!0,children:(0,X.jsx)(K,{width:16,height:16})}),s(B?U.BACKEND$RECONNECT_CLOUD:U.BACKEND$MANAGE)]})]}),se=Y.useCallback(async e=>{if(e===k)return;let{backendId:t,orgId:n}=Yn(e),i=c.find(e=>e.id===t);i&&(Nt(D.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(i.id,n),r?.())},[k,c,b,x,g,D,f,s,r]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(Wn,{testId:`backend-selector`,defaultValue:A??{value:k,label:O?ee:u.backend.name,prefix:O?Zn():Xn(h[u.backend.id])},footer:oe,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&se(e.value)},placeholder:O?ee:u.backend.name,loading:L,options:D,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${k}-${A?.label??``}`)}),t?null:(0,X.jsx)(it,{content:M,placement:F,offset:10,children:(0,X.jsx)(qe,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":j,"aria-label":M,className:H(j?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,He),children:(0,X.jsx)(K,{width:16,height:16})})})]}),S?(0,X.jsx)(Kn,{onClose:()=>C(!1)}):null,w?(0,X.jsx)(Bt,{onClose:()=>T(!1)}):null]})}var er=`command-menu-trigger`,tr=18;function nr({collapsed:e}){let{t}=v(`openhands`),n=Ee(e=>e.open),r=t(U.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":er,"aria-label":r,onClick:n,className:H(Xe({collapsed:e}),e?`cursor-pointer`:`group justify-between border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]/50 hover:border-[var(--oh-border)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e?(0,X.jsx)(nt,{active:!1,children:(0,X.jsx)(Te,{width:tr,height:tr})}):(0,X.jsx)(`span`,{className:H(Je,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(Te,{width:tr,height:tr})}),(0,X.jsx)(`span`,{className:tt(e),children:r})]}),e?null:(0,X.jsx)(`kbd`,{className:`rounded-md border border-[var(--oh-border)] bg-black/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--oh-text-dim)]`,children:t(U.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(it,{content:r,placement:`right`,children:i}):i}var rr=(e=20)=>{let{data:t}=Kt(),n=F(),r=!P(n.backend);return C({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await Ht.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},ir=(e=10)=>T({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function ar({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=v(`openhands`);return(0,X.jsx)(Re,{onClose:n,children:(0,X.jsxs)(ze,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(Ve,{title:r(U.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Be,{text:r(U.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Be,{text:r(U.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function or({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:H(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var sr=e=>{switch(e){case B.FINISHED:return`check`;case B.RUNNING:return`working`;case B.IDLE:case B.WAITING_FOR_CONFIRMATION:return`active`;case B.PAUSED:return`paused`;case B.ERROR:case B.STUCK:return`error`;default:return`unknown`}},cr=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function lr(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function ur({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=v(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:sr(e),o=r(cr(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(pn,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):lr(a)});return n?(0,X.jsx)(it,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function dr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=xt(i);return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(ur,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(or,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var fr=e(r(),1);function pr({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=v(`openhands`),{backend:p}=F(),m=ln(e,d),h=p.kind===`cloud`?U.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:U.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(At,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(mn,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(hn,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(yn,{width:16,height:16}),text:f(U.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(hn,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(wt,{width:16,height:16}),text:f(U.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(hn,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(bn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(U.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(hn,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(Et,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(hn,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(Qt,{width:16,height:16}),text:f(U.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(hn,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(Qt,{width:16,height:16}),text:f(U.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(hn,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(on,{width:16,height:16}),text:f(U.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(hn,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(gn,{icon:(0,X.jsx)(_n,{width:16,height:16}),text:f(U.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function mr({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=V(s),d=ne(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(vn,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:H(u&&`opacity-60`)}),e&&m&&h?(0,fr.createPortal)((0,X.jsx)(pr,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}function hr(e){return e?e.split(`/`).pop()||e:null}var gr={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function _r({selectedRepository:e}){let t=e.git_provider?gr[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(yt,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(fn,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function vr({workspaceWorkingDir:e}){let{t}=v(`openhands`),n=e?Yt(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Jt,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(U.COMMON$NO_REPOSITORY)})]})}function yr({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null,tags:d=null,showTags:f=!1}){let{t:p}=v(`openhands`),m=V(r),h=null;if(c)if(l===`acp`){let e=Ut(u)??p(U.CONVERSATION$ACP_AGENT_GENERIC),t=Gt(u,s),n=t??e;h={kind:Wt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(h={kind:`openhands`,text:hr(s)??s,tooltip:s});let g=r===void 0?void 0:`pl-[26px]`,_=f?Vt(d):[],y=_.slice(0,3),b=_.slice(3);return(0,X.jsxs)(`div`,{className:H(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,m&&`opacity-60`),children:[h?(0,X.jsx)(`div`,{className:g,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:h.tooltip,children:[(0,X.jsx)(ce,{kind:h.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:h.text})]})}):null,_.length>0?(0,X.jsxs)(`div`,{className:H(`flex flex-row flex-wrap items-center gap-1 min-w-0`,g),children:[y.map(([e,t])=>(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-chip`,title:`${e}: ${t}`,className:`inline-flex max-w-full min-w-0 items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:(0,X.jsx)(`span`,{className:`truncate`,children:`${e}: ${t}`})},e)),b.length>0?(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-overflow`,title:b.map(([e,t])=>`${e}: ${t}`).join(`
|
|
3
|
+
`),className:`inline-flex items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:`+${b.length}`}):null]}):null,(0,X.jsxs)(`div`,{className:H(`flex flex-row items-center gap-2 w-full min-w-0`,a&&g),children:[a&&(e?.selected_repository?(0,X.jsx)(_r,{selectedRepository:e}):(0,X.jsx)(vr,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${Ce(t??n)} ${p(U.CONVERSATION$AGO)}`})})})]})]})}function br(){let{t:e}=v(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(vt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(U.COMMON$ERROR)})]})}function xr({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:y=!1,agentKind:b=null,acpServer:x=null,tags:S=null,showTags:C=!1,isPinned:w=!1,onTogglePin:T,alwaysShowPinIcon:E=!1}){let{t:D}=v(`openhands`),{trackDownloadVsCodeButtonClicked:O}=Pe(),[ee,k]=Y.useState(`view`),{mutateAsync:A}=kt(),j=e=>{e!==``&&e!==a&&r?.(e),k(`view`)},M=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},N=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),k(`edit`),p?.(!1)},F=async e=>{if(e.preventDefault(),e.stopPropagation(),O(),l)try{let e=await qt.getVSCodeUrl(l);if(e.vscode_url){let t=nn(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},I=async e=>{e.preventDefault(),e.stopPropagation(),l&&await A(l),p?.(!1)},L=e=>{e.preventDefault(),e.stopPropagation(),T?.()},R=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":w,"aria-label":D(w?U.CONVERSATION_PANEL$UNPIN_CONVERSATION:U.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:L,className:H(`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`),children:(0,X.jsx)(jn,{className:H(`h-3.5 w-3.5`,w&&`fill-current`),"aria-hidden":!0})}),te=!!(t||r||i),z=te||!!T,B=E&&w&&!!T,V=g||y&&(b===`acp`||!!_)||C&&Vt(S).length>0;return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:H(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,!f&&`hover:bg-[var(--oh-surface)]`,(m||f)&&`bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(dr,{title:a,titleMode:ee,onTitleSave:j,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(br,{})]}),(0,X.jsxs)(`div`,{className:H(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,B?`min-w-[3.75rem]`:z&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!B&&(c??s)&&(0,X.jsx)(`p`,{className:H(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,z&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Ce(s??c)})}),z?(0,X.jsxs)(`div`,{className:H(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,B?`pointer-events-auto visible opacity-100`:H(`pointer-events-none opacity-0 invisible`,`group-hover:pointer-events-auto group-hover:opacity-100 group-hover:visible`,`group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-focus-within:visible`),f&&`pointer-events-auto visible opacity-100`),children:[T?R():null,B&&(c??s)&&te?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:H(!f&&`invisible pointer-events-none group-hover:visible group-hover:pointer-events-auto group-focus-within:visible group-focus-within:pointer-events-auto`),children:(0,X.jsx)(mr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:H(`pointer-events-none absolute inset-0 flex items-center justify-end`,`text-xs text-[var(--oh-muted)] whitespace-nowrap -translate-x-1.5`,`group-hover:hidden group-focus-within:hidden`,f&&`hidden`),children:(0,X.jsx)(`time`,{children:Ce(s??c)})})]}):null,!B&&te?(0,X.jsx)(mr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),V&&(0,X.jsx)(yr,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:y,agentKind:b,acpServer:x,tags:S,showTags:C})]})}var Sr={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function Cr({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,X.jsx)(`span`,{className:`w-20 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-[var(--oh-foreground)]`,children:t})]})}function wr({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,createdAt:o}){let{t:s}=v(`openhands`),c=r?.selected_repository??null,l=r?.selected_branch??null,u=r?.git_provider??null,d=u?Sr[u]:null,f=o?new Date(o).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null;return(0,X.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-3 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[t===void 0?null:(0,X.jsx)(`div`,{className:`mt-0.5`,children:(0,X.jsx)(ur,{executionStatus:t,sandboxStatus:n,showTooltip:!1})}),(0,X.jsx)(`span`,{className:`break-words text-sm font-medium text-white`,children:e})]}),(0,X.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Cr,{label:s(U.CONVERSATION$REPOSITORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[d?(0,X.jsx)(d,{size:12,className:`mt-0.5 shrink-0`}):null,u===`azure_devops`?(0,X.jsx)(yt,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(Cr,{label:s(U.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(fn,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(Cr,{label:s(U.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(G,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(Cr,{label:s(U.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(Cr,{label:s(U.CONVERSATION$CREATED),children:f}):null]})]})}function Tr({taskStatus:e}){return(0,X.jsx)(`div`,{className:H(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function Er({taskStatus:e}){let{t}=v(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:H(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:t(re(e))})}function Dr({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)(Tr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Er,{taskStatus:t})]})}function Or({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=v(`openhands`);return(0,X.jsxs)(`div`,{className:H(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(_r,{selectedRepository:e}):(0,X.jsx)(vr,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Ce(t)} ${r(U.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function kr({task:e,onClick:t}){let{t:n}=v(`openhands`),r=e.request.title||e.detail||n(U.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:H(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(Dr,{title:r,taskStatus:e.status})}),(0,X.jsx)(Or,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function Ar({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function jr({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:a,lastUpdatedAt:o,createdAt:s,workspaceWorkingDir:c,isActive:l=!1,onClose:u,showRepositoryMetadata:d=!0,llmModel:f=null,showLlmProfiles:p=!1,agentKind:m=null,acpServer:h=null,tags:g=null,showTags:_=!1}){let{t:y}=v(`openhands`);return(0,X.jsx)(i,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(ur,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||y(U.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(yr,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:r,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h,tags:g,showTags:_})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(qe,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>H(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||l?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(ur,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var Mr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showTagsMetadata:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=Ft()(Pt(e=>({...Mr,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setShowTagsMetadata:t=>e(()=>({showTagsMetadata:t})),toggleShowTagsMetadata:()=>e(e=>({showTagsMetadata:!e.showTagsMetadata})),setShowHoverMetadata:t=>e(()=>({showHoverMetadata:t})),toggleShowHoverMetadata:()=>e(e=>({showHoverMetadata:!e.showHoverMetadata})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t})),setGroupFolderOrder:t=>e(()=>({groupFolderOrder:[...t]}))}),{name:`conversation-panel-preferences`,storage:It(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showTagsMetadata:e.showTagsMetadata,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,groupFolderOrder:e.groupFolderOrder})})),Nr=`px-2 pb-1 pt-1`,Pr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Fr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:H(Nr,Pr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:H(`flex items-baseline justify-between gap-2`,Nr),children:[(0,X.jsx)(`span`,{className:H(`min-w-0 truncate text-left`,Pr),children:e}),t]})}function Ir(){return(0,X.jsx)(At,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:H(`group`,ut,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:H(`h-3.5 w-3.5`,ct),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(ae,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Lr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Rr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,showTagsMetadata:g,toggleShowTagsMetadata:_,showHoverMetadata:y,toggleShowHoverMetadata:b,totalConversationsCount:x,onRequestDeleteAll:S}){let{t:C}=v(`openhands`),w=C(r===`local`?U.CONVERSATION_PANEL$BY_WORKSPACE:U.CONVERSATION_PANEL$BY_REPOSITORY),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(e);return Y.useEffect(()=>{e?(E.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():D.current&&T.current?.focus(),D.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:T,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":C(U.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:H(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,dt),children:(0,X.jsx)(kn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:E,role:`menu`,"aria-orientation":`vertical`,"aria-label":C(U.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=E.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:H(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,J,ot),children:[(0,X.jsx)(Fr,{children:C(U.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:G,label:w,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:wn,label:C(U.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Ir,{}),(0,X.jsx)(Fr,{children:C(U.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:Cn,label:C(U.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:Tn,label:C(U.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Ir,{}),(0,X.jsx)(Fr,{children:C(U.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:An,label:C(U.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:Nn,label:C(U.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Ir,{}),(0,X.jsx)(Fr,{children:C(U.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:ie,label:C(U.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:pe,label:C(U.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:Pn,label:C(U.CONVERSATION_PANEL$TAGS),selected:g,testId:`toggle-tags-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Q,{icon:Se,label:C(U.CONVERSATION_PANEL$HOVER_METADATA),selected:y,testId:`toggle-hover-metadata`,onClick:()=>{b(),t(!1)}}),(0,X.jsx)(Ir,{}),(0,X.jsx)(Fr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:C(U.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:C(U.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?En:Dn,label:Lr(C(u?U.CONVERSATION$HIDE:U.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Ir,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:q,label:Lr(C(U.CONVERSATION$DELETE_ALL)),disabled:x===0,onClick:()=>{x!==0&&(S(),t(!1))}})]}):null]})}var zr=H(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,at);function Br(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function Vr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=We(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Br(u,{open:s,enabled:i}),{data:f,error:p}=ye(),m=f?.workspaceParents??[],{mutate:h}=he(),{mutate:g}=xe(),{mutate:_}=de(),{mutate:y}=fe(),{workspaces:b}=_e(),x=ue(p,a),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),{mutate:D,isPending:O}=dn(),ee=E(),k=O||ee;Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,S,w]),Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,S,w]);let A=e=>{k||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},j=ut,M=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),N=Y.useCallback(()=>{c(e=>!e)},[]),P=s&&(!i||d!==null),F=!!x,I=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,L=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:F,onMouseDown:M,onClick:e=>{e.preventDefault(),e.stopPropagation(),!F&&C(!0)},className:j,children:a(U.HOME$ADD_WORKSPACES)}),R=x?(0,X.jsx)(it,{content:x,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:L})}):L;return(0,X.jsxs)(`div`,{className:H(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:N,"aria-expanded":s,"aria-haspopup":`menu`,disabled:k})}),P&&(0,X.jsxs)(`div`,{"data-testid":r,className:H(zr,!i&&H(`absolute top-full mt-0`,n)),style:I,children:[(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,J),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:k,"data-testid":`launch-no-workspace`,onClick:()=>A(),className:j,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(U.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:k,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>A(e.path),className:j,children:[(0,X.jsx)(`span`,{className:ft,"aria-hidden":!0,children:(0,X.jsx)(Ct,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:H(`flex flex-col`,J),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(At,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),R,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:M,onClick:e=>{e.preventDefault(),e.stopPropagation(),T(!0)},className:j,children:a(U.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(me,{isOpen:S,onClose:()=>C(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(ve,{isOpen:w,workspaces:b,workspaceParents:m,onClose:()=>T(!1),onRemove:e=>g(e),onRemoveParent:e=>y(e)})]})}function Hr({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(`span`,{className:ft,"aria-hidden":!0,children:(0,X.jsx)(Ct,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Ur({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=We(),{providers:s}=_t(),{lastSelectedProvider:c,setLastSelectedProvider:l}=Tt(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Br(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,y]=Y.useState(``),b=Dt(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:x,isLoading:S,isError:C,hasNextPage:w,isFetchingNextPage:T,fetchNextPage:D}=gt({provider:h}),{data:O,isLoading:ee}=St(b,h),k=Y.useMemo(()=>x?.pages.flatMap(e=>e.items)??[],[x]),A=b?O??[]:k,{mutate:j,isPending:M}=dn(),N=E(),P=M||N;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let F=e=>{P||j({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`},entryPoint:`sidebar_cloud_menu`},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},I=e=>{g(e),l(e),y(``)},L=ut;Y.useEffect(()=>{u&&(b||!w||T||S||A.length===0||A.length>=10||D())},[u,b,w,T,S,A.length,D]);let R=b?ee:S,te=!b&&w&&A.length>0,z=Y.useCallback(()=>{d(e=>!e)},[]),B=u&&(!i||m!==null),V=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:H(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:z,"aria-expanded":u,"aria-haspopup":`menu`,disabled:P})}),B&&(0,X.jsxs)(`div`,{"data-testid":r,className:H(zr,!i&&H(`absolute top-full mt-0`,n)),style:V,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>I(e),className:H(`flex items-center gap-1 rounded border px-2 py-1 text-xs`,`transition-none`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(Ot,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(xn,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>y(e.target.value),placeholder:a(U.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:H(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(At,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,J),children:[R&&A.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(U.HOME$LOADING_REPOSITORIES)}),C&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(U.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!R&&!C&&A.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(U.GITHUB$NO_RESULTS)}),A.map(e=>(0,X.jsx)(Hr,{repo:e,disabled:P,onSelect:F,itemClass:L},`${e.git_provider}:${e.id}`)),te&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:T,onClick:()=>D(),className:L,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(T?U.HOME$LOADING_MORE_REPOSITORIES:U.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Wr=H(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function Gr({backendKind:e}){let{t}=v(`openhands`),n=t(U.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(On,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(Vr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:Wr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(Ur,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:Wr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Kr(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function qr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Jr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function Yr(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function Xr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Zr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Xr(t[n])-Xr(e[n]))}function Qr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function $r(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function ei(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?Qr(n):$r(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=Zr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:Yr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Xr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function ti(e,t){if(t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function ni(e,t,n,r,i=`after`){if(n===r)return[...e];let a=ti(t.map(e=>({id:e})),e).map(e=>e.id),o=a.indexOf(n),s=a.indexOf(r);if(o<0||s<0)return[...e];let c=[...a];c.splice(o,1);let l=c.indexOf(r),u=i===`before`?l:l+1;return c.splice(u,0,n),c}function ri({group:e,expanded:t,previewExpanded:n,isDragging:r,dropIndicatorPosition:i,animateLayout:a,isCreatingConversationFlow:o,activeConversationId:s,onToggleExpanded:c,onDragStart:l,onDragEnd:u,onDragOver:d,onDragLeave:f,onDrop:p,onTogglePreviewExpanded:m,onLaunchFromGroup:h,renderConversationCard:g}){let{t:_}=v(`openhands`),y=(0,Y.useRef)(null),b=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,x=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:S,isPreviewTruncated:C,isShowingAll:w}=Kr(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(se.section,{ref:y,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":b,"data-testid":`thread-folder-${x}`,onDragOver:d,onDragLeave:f,onDrop:p,className:`relative rounded-md`,children:[i?(0,X.jsx)(`div`,{"aria-hidden":!0,"data-testid":`thread-folder-drop-indicator-${x}`,className:H(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-[var(--oh-accent)]`,i===`before`?`-top-0.5`:`-bottom-0.5`)}):null,(0,X.jsxs)(`div`,{className:H(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:H(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,draggable:!0,id:b,"aria-expanded":t,"aria-controls":`thread-folder-content-${x}`,"data-testid":`thread-folder-drag-${x}`,"aria-label":_(t?U.CONVERSATION_PANEL$COLLAPSE_FOLDER:U.CONVERSATION_PANEL$EXPAND_FOLDER,{label:e.label}),onClick:c,onDragStart:t=>{t.stopPropagation();let{dataTransfer:n}=t;if(n){n.effectAllowed=`move`,n.setData(`text/plain`,e.id);let r=y.current;if(r&&typeof n.setDragImage==`function`){let e=r.getBoundingClientRect(),i=r.cloneNode(!0);i.style.position=`fixed`,i.style.top=`0`,i.style.left=`-9999px`,i.style.width=`${e.width}px`,i.style.margin=`0`,i.style.pointerEvents=`none`,i.style.borderRadius=`0.5rem`,i.style.padding=`0.25rem`,i.style.backgroundColor=`var(--oh-surface-raised)`,i.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.35)`,document.body.appendChild(i),n.setDragImage(i,t.clientX-e.left,t.clientY-e.top),window.setTimeout(()=>i.remove(),0)}}l()},onDragEnd:e=>{e.stopPropagation(),u()},className:H(`group/folder flex min-h-8 min-w-0 flex-1 cursor-grab items-center gap-2 rounded-md py-1 text-left text-inherit outline-none active:cursor-grabbing`,`focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`),children:[(0,X.jsx)(G,{className:H(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(W,{className:H(`h-4 w-4 shrink-0`,t?`block group-hover/folder:hidden`:`hidden group-hover/folder:block`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:H(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:o,"aria-label":_(U.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${x}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h()},children:(0,X.jsx)(we,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,X.jsxs)(`div`,{id:`thread-folder-content-${x}`,className:`mt-0.5 space-y-0.5`,children:[S.map(g),C?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${x}`,onClick:m,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:_(w?U.CONVERSATION_PANEL$LESS:U.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function ii({groups:e,groupIds:t,groupFolderOrder:n,setGroupFolderOrder:r,collapsedGroupIds:i,expandedGroupPreviewIds:a,onToggleGroupCollapsed:o,onToggleGroupPreviewExpanded:s,isCreatingConversationFlow:c,activeConversationId:l,onLaunchFromGroup:u,renderConversationCard:d}){let{t:f}=v(`openhands`),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),S=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=(0,Y.useCallback)(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1),S.current=null},300)},[]),w=(0,Y.useCallback)(()=>{m(null),g(null),y(null)},[]),T=(0,Y.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),E=(0,Y.useCallback)((e,i)=>{if(!p||p===e){w(),C();return}r(ni(n,t,p,e,i)),w(),C()},[p,n,t,w,r,C]);return(0,X.jsx)(`nav`,{"aria-label":f(U.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(ri,{group:e,expanded:!i.has(e.id),previewExpanded:a.has(e.id),isDragging:p===e.id,dropIndicatorPosition:h===e.id&&p!==e.id?_:null,animateLayout:b,isCreatingConversationFlow:c,activeConversationId:l,onToggleExpanded:()=>o(e.id),onDragStart:()=>{x(!0),m(e.id)},onDragEnd:()=>{w(),C()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),g(e.id),y(T(t))},onDragLeave:()=>{g(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),E(e.id,T(t))},onTogglePreviewExpanded:()=>s(e.id),onLaunchFromGroup:()=>u(e.launch),renderConversationCard:d},e.id))})}function ai({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=v(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Kr(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:H(`pt-1`,i?`mb-2 border-b border-[var(--oh-border-subtle)] pb-2`:`pb-2`),children:[(0,X.jsxs)(`h3`,{className:`flex items-center gap-1.5 py-1.5 pl-2 text-sm font-normal text-[var(--oh-muted)]`,children:[(0,X.jsx)(jn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(U.CONVERSATION_PANEL$PINNED)]}),(0,X.jsx)(`div`,{className:`space-y-0.5`,children:s.map(a)}),c?(0,X.jsx)(`div`,{className:`pl-2 pt-0.5`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`conversation-panel-pinned-view-more`,onClick:n,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:o(l?U.CONVERSATION_PANEL$LESS:U.CONVERSATION_PANEL$MORE)})}):null]})}var oi={pinsByBackendId:{}};function si(e,t){return e[t]??[]}var ci=Ft()(Pt((e,t)=>({...oi,pinConversation:(n,r)=>{let i=si(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=si(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{si(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=si(t().pinsByBackendId,n),o=a.filter(e=>i.has(e));o.length!==a.length&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:o}}))}}),{name:`pinned-conversations`,storage:It(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),li=()=>{},ui=[],di=3600*1e3,fi=e=>{let t=Date.now()-di,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function pi({onClose:e,compact:t=!1}){let{t:n}=v(`openhands`),{conversationId:r,navigate:a}=We(),{backend:o}=F(),s=ln(e??li),[c,l]=Y.useState(!1),[u,d]=Y.useState(!1),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Z(e=>e.showOlderConversations),_=Z(e=>e.toggleShowOlderConversations),y=Z(e=>e.showRepoBranchMetadata),b=Z(e=>e.toggleShowRepoBranchMetadata),x=Z(e=>e.showLlmProfiles),S=Z(e=>e.toggleShowLlmProfiles),C=Z(e=>e.showTagsMetadata),w=Z(e=>e.toggleShowTagsMetadata),T=Z(e=>e.showHoverMetadata),D=Z(e=>e.toggleShowHoverMetadata),k=Z(e=>e.organizeMode),A=Z(e=>e.setOrganizeMode),j=Z(e=>e.conversationSort),M=Z(e=>e.setConversationSort),N=Z(e=>e.threadScope),P=Z(e=>e.setThreadScope),I=Z(e=>e.groupFolderOrder),L=Z(e=>e.setGroupFolderOrder),[R,te]=Y.useState(!1),[z,B]=Y.useState(!1),V=ln(()=>{te(!1)}),[re,ie]=Y.useState(()=>new Set),[ae,oe]=Y.useState(()=>new Set),[se,ce]=Y.useState(!1),W=ci(e=>e.pinsByBackendId[o.id]??ui),le=ci(e=>e.togglePin),ue=ci(e=>e.pruneMissingConversations),de=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),fe=Y.useCallback(e=>{oe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{k!==`grouped`&&(ie(new Set),oe(new Set))},[k]);let pe=Y.useRef(null),[me,he]=Y.useState(null),[ge,_e]=Y.useState(null),[G,ve]=Y.useState(null),{data:ye,isLoading:be,isFetched:xe,hasNextPage:Se,isFetching:Ce,isFetchingNextPage:we,fetchNextPage:Te}=rr(),{data:Ee}=ir(),K=Y.useMemo(()=>{let e=ye?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[ye]),De=Y.useMemo(()=>qr(W,K),[K,W]);Y.useEffect(()=>{xe&&ue(o.id,K.map(e=>e.id))},[o.id,K,xe,ue]),Y.useEffect(()=>{W.length===0&&ce(!1)},[W.length]);let Oe=Y.useMemo(()=>{let e=N===`relevant`?K.filter(e=>ne(e.execution_status)):K;return t?e:Jr(e,W)},[t,K,W,N]),{recent:q,older:ke}=Y.useMemo(()=>fi(Oe),[Oe]),Ae=Y.useMemo(()=>Zr(g?[...q,...ke]:q,j),[q,ke,g,j]),je=Y.useMemo(()=>({emptyWorkspace:n(U.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(U.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),Me=Y.useMemo(()=>t||k!==`grouped`?null:ei([...q,...g?ke:[]],o.kind,j,je),[o.kind,t,j,je,ke,k,q,g]),Ne=Y.useMemo(()=>Me?ti(Me,I):null,[Me,I]),Pe=Y.useMemo(()=>Me?.map(e=>e.id)??[],[Me]),Fe=Y.useMemo(()=>Zr(q.filter(e=>ne(e.execution_status)),j),[j,q]),Ie=Ae.length,Le=Y.useMemo(()=>Ne?Ne.reduce((e,t)=>e+t.conversations.length,0):0,[Ne]),Re=k===`grouped`&&!t?Le===0:Ie===0,ze=k===`grouped`&&!t?Le:Ie,[Be,Ve]=Y.useState(null),He=Y.useRef(ze);He.current=ze;let Ue=Y.useCallback(()=>{Se&&Ve(He.current)},[Se]);Y.useEffect(()=>{if(Be!==null){if(ze>Be){Ve(null);return}if(!Se){Ve(null);return}Ce||we||Te()}},[Be,ze,Se,Ce,we,Te]);let Ge=Be!==null||we,{mutate:Ke,mutateAsync:Je}=ht(),{mutate:Ye}=bt(),{mutate:Xe}=cn(),Ze=ke.length>0&&!g,Qe=!!Se&&!Ze&&!t&&!Re,{mutate:$e}=dn(),et=E(),tt=Y.useCallback(e=>{et||$e({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[$e,et,a]),nt=Y.useCallback((e,t)=>{l(!0),he(e),_e(t)},[]),rt=Y.useCallback(e=>{d(!0),he(e)},[]),it=Y.useCallback((e,t)=>{Xe({conversationId:e,newTitle:t},{onSuccess:()=>{ee(n(U.CONVERSATION$TITLE_UPDATED))}})},[n,Xe]),at=()=>{me&&Ke({conversationId:me},{onSuccess:()=>{me===r&&a(`/conversations`)}})},ot=()=>{me&&Ye({conversationId:me})},st=async()=>{let e=K.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Je({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),i=t.length-n.length;r!==null&&n.includes(r)&&a(`/conversations`),i>0&&O(`${i} conversation${i===1?``:`s`} could not be deleted.`)},J=Y.useCallback((n,a)=>{let s=W.includes(n.id);return t?(0,X.jsx)(jr,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C},n.id):(0,X.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!T||G===n.id,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,content:(0,X.jsx)(wr,{title:n.title??``,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,llmModel:n.llm_model,createdAt:n.created_at}),children:(0,X.jsx)(qe,{to:`/conversations/${n.id}`,onClick:e,className:H(`block rounded-md transition-colors`,G!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||G===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(xr,{onDelete:()=>nt(n.id,n.title??``),onStop:()=>rt(n.id),onChangeTitle:e=>it(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:G===n.id,onContextMenuToggle:e=>ve(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C,isPinned:s,onTogglePin:()=>le(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,r,it,nt,rt,e,G,W,y,x,C,T,le]),ct=be||!xe,lt=!t&&!ct&&De.length>0,ut=xe&&!be&&!t&&Re&&!lt&&!Ee?.length;return(0,X.jsxs)(`div`,{ref:s,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:H(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,z?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(U.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(Gr,{backendKind:o.kind}),(0,X.jsx)(Rr,{filterMenuOpen:R,setFilterMenuOpen:te,menuRef:V,backendKind:o.kind,organizeMode:k,setOrganizeMode:A,conversationSort:j,setConversationSort:M,threadScope:N,setThreadScope:P,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:y,toggleShowRepoBranchMetadata:b,showLlmProfiles:x,toggleShowLlmProfiles:S,showTagsMetadata:C,toggleShowTagsMetadata:w,showHoverMetadata:T,toggleShowHoverMetadata:D,totalConversationsCount:K.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:pe,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{B(e.currentTarget.scrollTop>0)},className:H(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[ct&&(0,X.jsx)(Ar,{compact:t}),!t&&ut&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(U.CONVERSATION$NO_CONVERSATIONS)})}),lt?(0,X.jsx)(ai,{pinnedConversations:De,isPreviewExpanded:se,onTogglePreviewExpanded:()=>ce(e=>!e),activeConversationId:r,showDivider:!t&&k===`chronological`,renderConversationCard:e=>J(e,{inPinnedSection:!0})}):null,!t&&Ee?.map(t=>(0,X.jsx)(qe,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(kr,{task:t})},t.id)),!ct&&t?Fe.map(e=>J(e)):null,!ct&&!t&&k===`grouped`&&Ne&&Ne.length>0?(0,X.jsx)(ii,{groups:Ne,groupIds:Pe,groupFolderOrder:I,setGroupFolderOrder:L,collapsedGroupIds:re,expandedGroupPreviewIds:ae,onToggleGroupCollapsed:de,onToggleGroupPreviewExpanded:fe,isCreatingConversationFlow:et,activeConversationId:r,onLaunchFromGroup:tt,renderConversationCard:e=>J(e)}):null,!ct&&!t&&k===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Ae.map(e=>J(e))}):null,Qe&&(Ge?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(Ar,{compact:t})}):(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:Ue,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(U.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(en,{onConfirm:()=>{at(),l(!1),_e(null)},onCancel:()=>{l(!1),_e(null)},conversationTitle:ge??void 0}),m&&(0,X.jsx)(en,{title:n(U.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(U.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:K.length}),onConfirm:async()=>{await st(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)($t,{onConfirm:()=>{ot(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(ar,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function mi({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(pi,{})})})}var hi=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,gi=34,_i=Math.round(gi*30/46);function vi({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,collapseToggleLabel:i,onCollapse:a,onExpand:o,showCollapsedExpandButton:s,isExtensionsActive:c,currentPath:l,activeBackendHealth:u,collapsedBackendPopoverOpen:d,setCollapsedBackendPopoverOpen:f,collapsedBackendPopoverRef:p,collapsedBackendCloseTimer:m,onOpenAddBackend:h,onOpenManageBackends:g}){let{t:_}=v(`openhands`),y=m;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Qe(e),children:[(0,X.jsxs)(`div`,{className:H(e&&t?$e:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:H(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&s&&`opacity-0`),children:(0,X.jsx)(Ln,{logoWidth:gi,logoHeight:_i,logoClassName:`max-w-none`,className:H(Je,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:H(et,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(b,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:a,className:H(`hidden md:inline-flex ml-auto`,Ze,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(oe,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(U.SIDEBAR$CLOSE_MENU),className:H(`inline-flex ml-auto`,Ze,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(oe,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:Ye(e),children:[(0,X.jsx)(nr,{collapsed:e}),(0,X.jsx)(rt,{to:`/conversations`,end:!0,label:_(U.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(we,{width:$,height:$})}),(0,X.jsx)(rt,{to:`/customize`,label:_(U.NAV$CUSTOMIZE),testId:`sidebar-skills-link`,collapsed:e,forceActive:c,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(rt,{to:`/automations`,label:_(U.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(hi,{width:$,height:$})})]}),(0,X.jsx)(mi,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:H(Ye(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(it,{content:_(U.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(qe,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(U.SIDEBAR$SETTINGS),className:Xe({collapsed:!0}),children:[(0,X.jsx)(nt,{active:l.startsWith(`/settings`),children:(0,X.jsx)(K,{width:$,height:$})}),(0,X.jsx)(`span`,{className:tt(!0),children:_(U.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:p,onMouseEnter:()=>{y.current&&=(clearTimeout(y.current),null),f(!0)},onMouseLeave:()=>{y.current=setTimeout(()=>f(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":_(U.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:H(Xe({collapsed:!0}),`relative`),children:[(0,X.jsx)(nt,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(Rt,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(Mn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:tt(!0),children:_(U.BACKEND$MANAGE)})]}),d?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)($n,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:H(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)($n,{sidebarCollapsed:e,openUpward:!0})})]})}var yi=Y.lazy(()=>a(()=>import(`./settings-modal-C-S1NpbC.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59]))),bi=Y.lazy(()=>a(()=>Promise.resolve().then(()=>Gn).then(e=>({default:e.AddBackendModal})),void 0)),xi=Y.lazy(()=>a(()=>import(`./manage-backends-modal-DiRWE3tJ.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([60,1,2,3,4,5,6,7,8,11,61,62,63,64,65,46,18,66,67,26,68,25,34,15,29,33,31,69,14,70,32,71,72]))),Si=250;function Ci(){let{t:e}=v(`openhands`),{currentPath:t}=We(),{data:n}=Me(),{data:r,error:i,isError:a,isFetching:o}=Fe(),{backends:s,active:c}=I(),l=Ae(s)[c.backend.id],u=De(e=>e.collapsed),d=De(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,y]=Y.useState(!1),[b,x]=Y.useState(!1),[S,C]=Y.useState(!1),w=Y.useRef(!1),[,T]=Y.useReducer(e=>e+1,0),{isOpen:E,close:D}=rn(),[ee,k]=Y.useState(!1),[A,j]=Y.useState(!1),M=ln(()=>h(!1)),N=Ie(i);Y.useEffect(()=>{D()},[t,D]),Y.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{j(!0)});return()=>cancelAnimationFrame(e)}j(!1);let e=window.setTimeout(()=>{k(!1)},Si);return()=>window.clearTimeout(e)},[E]),Y.useEffect(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,D]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&N!==404?O(e(U.SETTINGS$FETCH_ERROR)):N===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,N,n?.feature_flags?.hide_llm_settings,e]);let P=e(u?U.SIDEBAR$EXPAND:U.SIDEBAR$COLLAPSE),F=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),L={collapseToggleLabel:P,onCollapse:Y.useCallback(()=>{C(!1),w.current=!0,T(),d(!0),window.setTimeout(()=>{w.current=!1,T()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&S&&!w.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:M,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>y(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(U.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:F,onMouseEnter:()=>{u&&C(!0)},onMouseLeave:()=>{C(!1)},className:H(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(vi,{collapsed:u,showCollapseToggle:!0,...L})}),ee?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:H(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,A?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Si}ms`},onClick:D,"aria-hidden":!A}),(0,X.jsx)(`aside`,{"aria-label":e(U.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:H(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,A?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Si}ms`},children:(0,X.jsx)(vi,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...L})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(yi,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(bi,{onClose:()=>y(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(xi,{onClose:()=>x(!1)})})]})}var wi=`/settings`,Ti=`/customize`,Ei=[`/skills`,`/mcp`,`/plugins`];function Di(e){return e===wi?{mode:`menu`}:e.startsWith(`${wi}/`)&&e.length>9?{mode:`back`,backTo:wi,backLabelKey:U.SETTINGS$TITLE}:e===Ti?{mode:`menu`}:Ei.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Ti,backLabelKey:U.NAV$CUSTOMIZE}:{mode:`menu`}}function Oi(){let{t:e}=v(`openhands`),{currentPath:t,navigate:n}=We(),r=Di(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(U.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(sn,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??U.COMMON$BACK),className:an,children:(0,X.jsx)(oe,{size:20,className:tn,"aria-hidden":!0,strokeWidth:2})}):null]})}function ki(){let{backend:e}=F(),t=e.kind===`local`,{data:n}=un(),{mutate:r,isPending:i}=Oe(),a=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{a.current=null},[e.id]),(0,Y.useEffect)(()=>{if(!t||i||!n)return;let{profiles:e,active_profile:o}=n,s=o!=null&&e.some(e=>e.name===o);if(e.length===0||s){a.current=null;return}let c=e.find(e=>e.api_key_set)??e[0];a.current!==c.name&&(a.current=c.name,r(c.name))},[t,n,i,r])}var Ai=()=>{let{backend:e}=F(),{data:t}=Fe(),{mutate:n,isPending:r}=Le(`personal`,{retry:2}),i=Y.useSyncExternalStore(z,N,()=>null),a=Y.useRef(null);Y.useEffect(()=>{if(t!==void 0){if(i!==null){if((t.user_consents_to_analytics===!0?`granted`:t.user_consents_to_analytics===!1?`denied`:null)===i){a.current=null,e.kind===`cloud`&&M(i);return}if(e.kind!==`cloud`)return;let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}t.user_consents_to_analytics!==null&&k(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function ji(){let{backend:e}=F(),t=Y.useSyncExternalStore(z,A,()=>`pending`),n=Y.useRef(null);Y.useEffect(()=>{let r=t===`pending`?L():null;if(e.kind!==`local`||t===`pending`&&!r)return;let i=t===`granted`?`granted`:`denied`,a=t===`pending`?r:``,o=`${e.id}:${e.host}:${e.apiKey??``}:${i}:${a}`;n.current!==o&&(n.current=o,Ne.syncTelemetryConsent(i).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Mi=`agent_canvas_cloud_cookie_backend_added`,Ni=new Set;function Pi(e,t){return`${Mi}:${e}:${t}`}function Fi(e,t){let n=Pi(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||Ni.has(n)}catch{return Ni.has(n)}}function Ii(e,t){let n=Pi(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{Ni.add(n)}}var Li=()=>{let{backend:e,orgId:t}=F(),{data:n}=Fe(),{trackBackendAdded:r}=Pe(),i=Y.useRef(r),a=Mt(),o=e.kind===`cloud`?a[e.id]:void 0,s=o?.isLoading??!0,c=o?.userId??null,l=(n?.email||n?.git_user_email)?.trim()||void 0;Y.useEffect(()=>{i.current=r},[r]),Y.useEffect(()=>{if(e.kind!==`cloud`){j(null);return}if(!s){if(!c){j(null),R(null);return}j({userId:c,email:l,orgId:t}),R(c,l?{email:l}:{}),e.authMode===`cookie`&&l&&!Fi(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),Ii(e.id,c))}},[e.authMode,e.connectionRevision,e.id,e.kind,l,s,t,c])};function Ri(e){switch(e){case B.RUNNING:return`🟢`;case B.FINISHED:case B.IDLE:case B.WAITING_FOR_CONFIRMATION:return`✅`;case B.PAUSED:return`⚪`;case B.ERROR:case B.STUCK:return`🔴`;default:return null}}var zi=`OpenHands`,Bi=()=>{let{conversationId:e}=s(),{data:t}=Sn(e??null),n=Xt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${zi}`:zi;if(!e)return i;let a=Ri(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Vi({children:e}){let{pathname:t}=c(),n=d(),r=_(),i=u(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(Ge,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Hi=Y.lazy(()=>a(()=>import(`./environment-switch-overlay-mGl2pqqx.js`),__vite__mapDeps([73,1,2,8,5,6,74,7]))),Ui=Y.lazy(()=>a(()=>import(`./alert-banner-eRyIwDyU.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([75,1,2,76,4,5,8,6,11,77,78,7,14,79,44,38]))),Wi=Y.lazy(()=>a(()=>import(`./command-menu-CvLPs7dg.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([80,1,2,81,4,5,8,6,82,83,84,85,86,7,14]))),Gi=m(function(){let e=p(),{t}=v(`openhands`);return h(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(U.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(U.ERROR$UNKNOWN)})})}),Ki=f(function(){let e=c(),t=Bi(),{data:n}=Fe(),r=Me();if(ji(),Ai(),Li(),ki(),Y.useEffect(()=>{n?.language&&D.changeLanguage(n.language)},[n?.language]),r.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(je,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=ge(e.search);return(0,X.jsx)(Vi,{children:(0,X.jsxs)(Zt,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(Ci,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[i?null:(0,X.jsx)(Oi,{}),r.data&&(r.data.maintenance_start_time||r.data.faulty_models&&r.data.faulty_models.length>0||r.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Ui,{maintenanceStartTime:r.data.maintenance_start_time,faultyModels:r.data.faulty_models,errorMessage:r.data.error_message,updatedAt:r.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(g,{})})]})]}),(0,X.jsxs)(Y.Suspense,{fallback:null,children:[(0,X.jsx)(Hi,{}),(0,X.jsx)(Wi,{})]}),a?(0,X.jsx)(be,{}):null]})})});export{Gi as ErrorBoundary,Ki as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i}from"./useQuery-B38jBavx.js";import{lt as a,n as o}from"./active-backend-context-mY7Gff5c.js";import{t as s}from"./utils-DsWhWn2F.js";import{t as c}from"./settings-service.api-CTJRrvMu.js";import{h as l,l as u}from"./form-control-classes-CtVAktAy.js";import{t as d}from"./dist-hOnv1nn2.js";import{n as f,t as p}from"./settings-input-BEaTCem1.js";import{a as m,i as h,n as ee}from"./llm-subscription-DTqtBCWz.js";import{t as te}from"./use-is-authed-BsS4XwSL.js";import{t as ne}from"./settings-dropdown-input-jOiv5Yrk.js";import{r as g}from"./typography-B1UxuuEC.js";import{t as _}from"./settings-switch-B405oU_v.js";var v=e(t(),1),y=n(),b=d(``,{variants:{size:{default:`text-xs`,settings:`text-sm text-[var(--oh-muted)] font-normal leading-5.5`},linkColor:{default:``,white:`text-white`}},defaultVariants:{size:`default`,linkColor:`default`}});function x({testId:e,text:t,linkText:n,href:r,suffix:i,size:a,linkColor:o,className:c,linkTextClassName:l,suffixClassName:u}){return(0,y.jsxs)(`p`,{"data-testid":e,className:s(b({size:a}),c),children:[t,` `,(0,y.jsx)(`a`,{href:r,rel:`noreferrer noopener`,target:`_blank`,className:s(`underline underline-offset-2`,b({size:a,linkColor:o}),l),children:n}),i&&(0,y.jsx)(`span`,{className:u,children:i})]})}var S=`llm`;function C(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==S)return e;let n=new Set(e.fields.map(e=>e.key)),r=h.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var w=(e,t)=>{let{data:n}=te(),{backend:r,orgId:s}=o(),l=!a(r),{data:u,error:d,isLoading:f,isFetching:p}=i({queryKey:[`settings-schema`,e,r.id,s,r.kind,r.host,r.apiKey],queryFn:e===`conversation`?c.getConversationSettingsSchema:c.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&l,meta:{disableToast:!0}}),m=(0,v.useMemo)(()=>e===`agent`?C(t):t,[t,e]),h=(0,v.useMemo)(()=>e===`agent`?C(u):u,[u,e]);return t?{data:m,error:null,isLoading:!1,isFetching:!1}:{data:h,error:d,isLoading:f,isFetching:p}},T=e=>w(`agent`,e),re=e=>w(`conversation`,e);function E(e,t){return`SCHEMA$${e.replace(/\./g,`$`).toUpperCase()}$${t}`}var D=e=>!!e?.includes(`$`),O={tool_concurrency_limit:{constraints:{min:1,step:1}},"llm.top_p":{constraints:{min:0,max:1,step:.01}},"llm.temperature":{constraints:{min:0,max:2,step:.1}}};function k(e){return O[e]?.constraints}function A(e,t,n,r){if(D(r))return e(r);let i=E(t,n);return e(i,{defaultValue:``})||(r&&console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r??null)}function j(e,t,n){return A(e,t,`LABEL`,n)??``}function M(e,t,n){return A(e,t,`DESCRIPTION`,n)}function ie(e,t,n,r){if(D(r))return e(r);let i=`SCHEMA$${t.replace(/\./g,`$`).toUpperCase()}$CHOICE$${String(n).toUpperCase()}`;return e(i,{defaultValue:``})||(console.warn(`[i18n] Missing translation for key "${i}", falling back to: "${r}"`),r)}var ae=new Set([`llm.model`,`llm.api_key`,`llm.base_url`,ee,m]),oe={basic:new Set([`critical`]),advanced:new Set([`critical`,`major`]),all:new Set([`critical`,`major`,`minor`])};function N(e){return!!e&&Array.isArray(e.sections)}function P(e){return N(e)?e.sections.flatMap(e=>e.fields):[]}function F(e,t){if(!e)return;let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r}function I(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e];(i[t]==null||typeof i[t]!=`object`||Array.isArray(i[t]))&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}function L(e,t,n=`agent_settings`){return F(e[n],t)??null}function R(e,t){return L(e,t,`agent_settings`)}function z(e){return e.choices.length>0}function B(e){return e.prominence===`critical`}function V(e){return e.prominence===`minor`}function H(e,t){let n=t??e.default;return z(e)?n==null?``:String(n):e.value_type===`boolean`?!!(n??!1):n==null?``:e.value_type===`array`||e.value_type===`object`?JSON.stringify(n,null,2):String(n)}function U(e,t){if(t===void 0)return null;if(e.value_type===`boolean`){if(typeof t==`string`){if(t===`true`)return!0;if(t===`false`)return!1}return t===null?null:!!t}if(e.value_type===`integer`||e.value_type===`number`){if(t===``||t===null)return null;let e=typeof t==`number`?t:Number(String(t));return Number.isNaN(e)?null:e}if(e.value_type===`array`||e.value_type===`object`){if(t===null||e.value_type===`object`&&typeof t==`object`&&!Array.isArray(t)&&Object.keys(t).length===0)return null;if(typeof t==`string`){let n=t.trim();if(!n)return null;try{let t=JSON.parse(n);return e.value_type===`object`&&typeof t==`object`&&t&&!Array.isArray(t)&&Object.keys(t).length===0?null:JSON.stringify(t)}catch{return n}}return JSON.stringify(t)}return t===null?null:String(t)}function W(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);return r?Object.fromEntries(P(r).map(t=>[t.key,H(t,L(e,t.key,n))])):{}}function G(e,t,n=`agent_settings`){let r=t??(n===`conversation_settings`?e.conversation_settings_schema:e.agent_settings_schema);if(!r)return`basic`;let i=!1,a=!1;for(let t of P(r))B(t)||U(t,L(e,t.key,n)??t.default??null)!==U(t,t.default??null)&&(V(t)?i=!0:a=!0);return i?`all`:a?`advanced`:`basic`}function K(e,t){return e.depends_on.every(e=>t[e]===!0)}function q(e){if(typeof e==`boolean`)return e;let t=e.trim().toLowerCase();if(!t)return null;if(t===`true`)return!0;if(t===`false`)return!1;throw Error(`Expected a boolean value, received: ${e}`)}function J(e,t){if(e.value_type===`boolean`)return q(t);if(e.value_type===`integer`||e.value_type===`number`){let n=String(t).trim();if(!n)return null;let r=Number(n);if(Number.isNaN(r))throw Error(`Expected a numeric value, received: ${n}`);if(e.value_type===`integer`&&!Number.isInteger(r))throw Error(`Expected an integer value, received: ${n}`);let i=k(e.key);if(i?.min!=null&&r<i.min)throw Error(`${e.label} must be at least ${i.min}`);if(i?.max!=null&&r>i.max)throw Error(`${e.label} must be at most ${i.max}`);return r}if(e.value_type===`array`||e.value_type===`object`){let n=String(t).trim();if(!n)return null;let r;try{r=JSON.parse(n)}catch{throw Error(`Invalid JSON for ${e.label}`)}if(e.value_type===`array`){if(!Array.isArray(r))throw Error(`${e.label} must be a JSON array`);return r}if(r===null||Array.isArray(r)||typeof r!=`object`)throw Error(`${e.label} must be a JSON object`);return r}let n=String(t);return n===``&&!e.secret?null:n}function Y(e,t,n){let r={};for(let i of P(e))n[i.key]&&I(r,i.key,J(i,t[i.key]));return r}function X(e,t){return oe[t].has(e.prominence)}function se(e,t,n,r){let i=Y(e,t,n);for(let t of P(e))X(t,r)||I(i,t.key,t.default??null);return i}function Z(e,t,n,r=ae){return N(e)?e.sections.map(e=>({...e,fields:e.fields.filter(e=>!r.has(e.key)&&X(e,n)&&K(e,t))})).filter(e=>e.fields.length>0):[]}function ce(e){return e?P(e).some(e=>e.prominence===`critical`):!1}function le(e){return e?P(e).some(e=>e.prominence===`major`):!1}function ue(e){return e?P(e).some(e=>e.prominence===`minor`):!1}var de={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$NAV_API_KEYS`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function Q({field:e}){let{t}=r(`openhands`),n=de[e.key],i=M(t,e.key,e.description);return(0,y.jsxs)(y.Fragment,{children:[i&&!n?.hideDescription?(0,y.jsx)(g.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:i}):null,n?(0,y.jsx)(x,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var fe=new Set([`verification.critic_api_key`]);function $(e){return e.choices.length>0}function pe(e){return e.value_type===`boolean`&&!$(e)}function me(e){return e.value_type===`array`||e.value_type===`object`}function he(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function ge(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&he(e)?`url`:`text`}function _e({field:e,value:t,isDisabled:n,onChange:i}){let{t:a}=r(`openhands`),o=j(a,e.key,e.label),c=k(e.key);return pe(e)?(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,y.jsx)(_,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:i,children:o}),(0,y.jsx)(`div`,{className:l,children:(0,y.jsx)(Q,{field:e})})]}):$(e)?(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,y.jsx)(ne,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,items:e.choices.map(t=>({key:String(t.value),label:ie(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>i(String(e??``))}),(0,y.jsx)(Q,{field:e})]}):me(e)?(0,y.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-sm`,children:o}),e.required?null:(0,y.jsx)(f,{})]}),(0,y.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>i(e.target.value),className:s(u,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,y.jsx)(Q,{field:e})]}):(0,y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,y.jsx)(p,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,type:ge(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:i,className:`w-full`,min:c?.min,max:c?.max,step:c?.step}),(0,y.jsx)(Q,{field:e})]})}export{T as _,se as a,Z as c,ue as d,G as f,j as g,M as h,Y as i,le as l,H as m,_e as n,J as o,N as p,W as r,R as s,fe as t,ce as u,re as v,x as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{k as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{k as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{Dt as a,Ot as o,jt as s}from"./active-backend-context-mY7Gff5c.js";import{t as c,z as l}from"./utils-DsWhWn2F.js";import{n as ee}from"./use-settings-DIAo5KFk.js";import{t as te}from"./use-save-settings--C6LZXfI.js";import{_ as u}from"./form-control-classes-CtVAktAy.js";import{t as ne}from"./brand-button-BUlDL-mz.js";import{_ as re,a as ie,c as ae,d as oe,f as se,i as d,l as f,n as ce,p as le,r as ue,t as de,u as fe,v as p}from"./schema-field-htfNouTG.js";import{n as m,t as h}from"./switch-skeleton-BQoOhQTB.js";import{o as pe}from"./extension-module-card-classes-Bo43vY5V.js";var g=e(t(),1),_=n();function v(){return(0,_.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function y(){return(0,_.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,_.jsx)(h,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(m,{}),(0,_.jsx)(v,{}),(0,_.jsx)(h,{}),(0,_.jsx)(h,{}),(0,_.jsx)(m,{})]})}var b=(e,t)=>c(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,u,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function me({view:e,setView:t,showBasic:n=!0,showAdvanced:i,showAll:a,isDisabled:o=!1}){let{t:s}=r(`openhands`);return[n,i,a].filter(Boolean).length<=1?null:(0,_.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[n?(0,_.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:b(e===`basic`,o),onClick:()=>t(`basic`),children:s(l.SETTINGS$BASIC)}):null,i?(0,_.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:b(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(l.SETTINGS$ADVANCED)}):null,a?(0,_.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:b(e===`all`,o),onClick:()=>t(`all`),children:s(l.SETTINGS$ALL)}):null]})}var he=new Set,x={basic:0,advanced:1,all:2},ge=(e,t)=>x[t]<x[e]?t:e,_e=(e,t)=>x[t]>x[e]?t:e,ve=(e,{showBasic:t,showAdvanced:n,showAll:r})=>{if(e===`all`)return r?`all`:n?`advanced`:`basic`;if(e===`advanced`)return n?`advanced`:r?`all`:`basic`;if(!t){if(n)return`advanced`;if(r)return`all`}return`basic`},ye={agent_settings:`agent_settings_diff`,conversation_settings:`conversation_settings_diff`},be=(e,t)=>e instanceof i?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function S({settingsSources:e,scope:t=`personal`,header:n,extraDirty:i=!1,buildPayload:c,onSaveSuccess:u,getInitialView:m,forceShowAdvancedView:h=!1,allowAllView:v=!0,initialValueOverrides:b,embedded:x=!1,hideSaveButton:S=!1,suppressSuccessToast:xe=!1,onSaveControlChange:C,testId:Se=`sdk-section-settings-screen`}){let{t:w}=r(`openhands`),{mutate:Ce,isPending:T}=te(t),{data:E,isLoading:we,isFetching:Te}=ee(t),D=re(E?.agent_settings_schema),O=p(E?.conversation_settings_schema),k=g.useMemo(()=>JSON.stringify(e.map(e=>({source:e.settingsSource,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?Array.from(e.excludeKeys).sort():null}))),[e]),A=g.useMemo(()=>JSON.parse(k).map(e=>({settingsSource:e.source,sectionKeys:e.sectionKeys,excludeKeys:e.excludeKeys?new Set(e.excludeKeys):void 0})),[k]),j=g.useCallback(e=>e===`conversation_settings`?O.data:D.data,[D.data,O.data]),Ee=A.some(e=>e.settingsSource===`conversation_settings`?O.isLoading:D.isLoading),M=g.useMemo(()=>A.map(e=>{let t=j(e.settingsSource);if(!le(t))return{...e,filteredSchema:null};let n=new Set(e.sectionKeys),r=new Set,i={...t,sections:t.sections.filter(e=>!n.has(e.key)||r.has(e.key)?!1:(r.add(e.key),!0))};return{...e,filteredSchema:i}}),[A,j]),N=M.some(e=>fe(e.filteredSchema)),P=h||M.some(e=>f(e.filteredSchema)),F=v&&M.some(e=>oe(e.filteredSchema)),De=g.useMemo(()=>be(A.reduce((e,t)=>e??(t.settingsSource===`conversation_settings`?O.error:D.error),null),w(l.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[A,D.error,O.error,w]),Oe=g.useMemo(()=>b?JSON.stringify(b):``,[b]),[I,L]=g.useState(`basic`),[R,z]=g.useState({}),[B,V]=g.useState({}),H=g.useRef(!1),U=g.useMemo(()=>{if(!E)return null;let e={};for(let t of M){if(!t.filteredSchema)return null;e[t.settingsSource]={...e[t.settingsSource]??{},...ue(E,t.filteredSchema,t.settingsSource)}}if(b){let t=M[0]?.settingsSource;t&&e[t]&&(e[t]={...e[t],...b})}return e},[E,M,Oe]),W=g.useMemo(()=>{if(!E)return null;let e=null;for(let t of M){if(!t.filteredSchema)return null;let n=m?m(E,t.filteredSchema):se(E,t.filteredSchema,t.settingsSource);e=e?_e(e,n):n}return e?ve(e,{showBasic:N,showAdvanced:P,showAll:F}):null},[E,M,m,N,P,F]);g.useEffect(()=>{H.current=!1,L(`basic`),z({}),V({})},[t,k]),g.useEffect(()=>{if(!(!U||!W)){if(z(U),b){let e=M[0]?.settingsSource;if(e){let t=Object.fromEntries(Object.keys(b).map(e=>[e,!0]));V({[e]:t})}else V({})}else V({});H.current?L(e=>ge(e,W)):(H.current=!0,L(W))}},[U,W]);let G=g.useMemo(()=>{let e=new Map;for(let t of M)if(t.filteredSchema)for(let n of t.filteredSchema.sections)for(let r of n.fields)e.has(r.key)||e.set(r.key,t.settingsSource);return e},[M]),K=g.useMemo(()=>{let e={};for(let t of M)Object.assign(e,R[t.settingsSource]??{});return e},[M,R]),q=g.useMemo(()=>{let e={};for(let t of M)Object.assign(e,B[t.settingsSource]??{});return e},[M,B]),J=g.useCallback((e,t)=>{let n=G.get(e);n&&(z(r=>({...r,[n]:{...r[n]??{},[e]:t}})),V(t=>({...t,[n]:{...t[n]??{},[e]:!0}})))},[G]),ke=g.useCallback(e=>{a(s(e)||w(l.ERROR$GENERIC))},[w]),Y=g.useRef(()=>{}),Ae=g.useCallback(()=>{Y.current()},[]),X=g.useRef(()=>({})),je=g.useCallback(()=>X.current(),[]),Z=()=>{if(M.some(e=>!e.filteredSchema))return;let e;try{let t={};for(let e of M){let n=e.filteredSchema,r=ie(n,R[e.settingsSource]??{},B[e.settingsSource]??{},I);if(Object.keys(r).length>0){let n=ye[e.settingsSource];t[n]={...t[n]??{},...r}}}e=c?c(t,{values:K,dirty:q,view:I}):t}catch(e){a(e instanceof Error?e.message:w(l.ERROR$GENERIC));return}Object.keys(e).length!==0&&Ce(e,{onError:ke,onSuccess:()=>{xe||o(w(l.SETTINGS$SAVED_WARNING)),V({}),u?.()}})};Y.current=Z,X.current=()=>{let e={};for(let t of M){if(!t.filteredSchema)continue;let n=R[t.settingsSource]??{},r=B[t.settingsSource]??{};Object.assign(e,d(t.filteredSchema,n,r))}return e};let Q=Object.keys(q).length>0,$=Q||i;return g.useEffect(()=>{C&&C({save:Ae,isSaving:T,isDirty:$,values:K,view:I,getDirtyPayload:je})},[T,$,K,I]),(we||Te)&&!E||Ee?(0,_.jsx)(y,{}):M.some(e=>e.filteredSchema&&e.filteredSchema.sections.length>0)?Object.keys(K).length===0?(0,_.jsx)(y,{}):(0,_.jsxs)(`div`,{"data-testid":Se,className:x?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,_.jsx)(me,{view:I,setView:L,showBasic:N,showAdvanced:P,showAll:F,isDisabled:!1}),(0,_.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[n?.({values:K,isDisabled:!1,view:I,onChange:J}),M.map(e=>{if(!e.filteredSchema)return null;let t=R[e.settingsSource]??{};return ae(e.filteredSchema,{...K,...t},I,e.excludeKeys??he).map(n=>(0,_.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,_.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:n.fields.map(e=>(0,_.jsx)(`div`,{className:de.has(e.key)?`xl:col-span-2`:void 0,children:(0,_.jsx)(ce,{field:e,value:t[e.key],isDisabled:!1,onChange:t=>J(e.key,t)})},e.key))})},`${e.settingsSource}:${n.key}`))}),S?null:(0,_.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,_.jsx)(ne,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:T||!Q&&!i,onClick:Z,children:w(T?l.SETTINGS$SAVING:l.SETTINGS$SAVE_CHANGES)})})]})]}):(0,_.jsx)(`div`,{"data-testid":`sdk-schema-unavailable`,className:pe,children:(0,_.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:De})})}export{S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{d as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{J as n,Z as r,ot as i}from"./active-backend-context-mY7Gff5c.js";import{t as a}from"./proxy-BiyDhMBd.js";async function o(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var s=100;function c(){let e=i().backend;if(e.kind!==`cloud`)throw Error(`Cloud secrets call requires a cloud backend.`);return e}async function l(){let e=c(),t=[],n=null;do{let r=new URLSearchParams({limit:String(s)});n&&r.set(`page_id`,n);let i=await a({backend:e,method:`GET`,path:`/api/v1/secrets/search?${r.toString()}`});t.push(...i.items??[]),n=i.next_page_id}while(n);return t}async function u({name:e,value:t,description:n,previousName:r}){let i=c();r!==void 0&&await o(()=>a({backend:i,method:`PUT`,path:`/api/v1/secrets/${encodeURIComponent(r)}`,body:{name:e,description:n}})),t!==void 0&&await o(()=>a({backend:i,method:`POST`,path:`/api/v1/secrets`,body:{name:e,value:t,description:n}}))}async function d(e){await a({backend:c(),method:`DELETE`,path:`/api/v1/secrets/${encodeURIComponent(e)}`})}var f=e({SecretsService:()=>p}),p=class{static async getSecrets(){try{return i().backend.kind===`cloud`?await o(()=>l()):(await o(()=>new t(r()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async createSecret(e,n,a){if(i().backend.kind===`cloud`){await u({name:e,value:n,description:a});return}await o(()=>new t(r()).upsertSecret({name:e,value:n,description:a}))}static async updateSecret(e,n,a,s){if(i().backend.kind===`cloud`){await u({name:n,value:s,description:a,previousName:e});return}let c=new t(r()),l=s??await o(()=>c.getSecret(e));await o(()=>c.upsertSecret({name:n,value:l,description:a})),n!==e&&await this.deleteSecret(e)}static async deleteSecret(e){try{if(i().backend.kind===`cloud`){await o(()=>d(e));return}await o(()=>new t(r()).deleteSecret(e))}catch(e){if(n(e,404)||e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};export{f as n,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as o}from"./useMutation-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as o}from"./useMutation-DHLpZ6J0.js";import{t as s,z as c}from"./utils-DsWhWn2F.js";import{t as l}from"./back-nav-button-C02hGa8t.js";import{t as u}from"./pencil-DzW2GB2M.js";import{t as d}from"./trash-2-gZPlx23R.js";import{t as f}from"./loading-spinner-DRFyh6Iy.js";import{f as p,l as m}from"./form-control-classes-CtVAktAy.js";import{t as h}from"./brand-button-BUlDL-mz.js";import{n as g,t as _}from"./settings-input-BEaTCem1.js";import{t as v}from"./confirmation-modal-CRBJSllP.js";import{r as y}from"./typography-B1UxuuEC.js";import"./extension-module-card-classes-Bo43vY5V.js";import{a as b,c as x,i as S,l as C,o as w,r as T,s as E}from"./settings-list-classes-VqMzkYYt.js";import{t as D}from"./secrets-service-Dbv5Zb8G.js";import{n as O,t as k}from"./use-create-secret-RT4QtSS9.js";var A=e(t(),1),j=()=>o({mutationFn:e=>D.deleteSecret(e)}),M=()=>o({mutationFn:({secretToEdit:e,name:t,description:n,value:r})=>D.updateSecret(e,t,n,r)}),N=n();function P({mode:e,selectedSecret:t,onCancel:n}){let r=i(),{t:o}=a(`openhands`),{data:l}=O(),{mutate:u}=k(),{mutate:d}=M(),[f,v]=A.useState(null),y=e===`edit`&&t&&l?.find(e=>e.name===t)?.description?.trim()||``,b=()=>{r.invalidateQueries({queryKey:[`secrets-search`]}),r.invalidateQueries({queryKey:[`secrets`]})},x=(e,t,r)=>{u({name:e,value:t,description:r},{onSettled:n,onSuccess:b})},S=(e,t,r,i)=>{d({secretToEdit:e,name:t,description:r,value:i},{onSettled:n,onSuccess:b})};return(0,N.jsxs)(`form`,{"data-testid":e===`add`?`add-secret-form`:`edit-secret-form`,onSubmit:n=>{n.preventDefault();let r=new FormData(n.currentTarget),i=r.get(`secret-name`)?.toString(),a=r.get(`secret-value`)?.toString().trim(),s=r.get(`secret-description`)?.toString();if(i){if(v(null),l?.some(e=>e.name===i&&e.name!==t)){v(o(c.SECRETS$SECRET_ALREADY_EXISTS));return}if(e===`add`){if(!a){v(o(c.SECRETS$SECRET_VALUE_REQUIRED));return}x(i,a,s||void 0)}else e===`edit`&&t&&S(t,i,s||void 0,a||void 0)}},className:`flex flex-col items-start gap-6`,children:[(0,N.jsx)(_,{testId:`name-input`,name:`secret-name`,type:`text`,label:o(c.SETTINGS$NAME),className:`w-full min-w-0`,required:!0,defaultValue:e===`edit`&&t?t:``,placeholder:o(c.SECRETS$API_KEY_EXAMPLE),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:o(c.SETTINGS$SECRET_NAME_PATTERN_TITLE)}),f&&(0,N.jsx)(`p`,{className:`text-red-500 text-sm`,children:f}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:o(e===`add`?c.FORM$VALUE:c.SECRETS$SECRET_VALUE_LEAVE_BLANK)}),(0,N.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:e===`add`,className:s(`resize-none`,m,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:o(c.FORM$DESCRIPTION)}),(0,N.jsx)(g,{})]}),(0,N.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,defaultValue:y,className:s(p,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(h,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:o(c.BUTTON$CANCEL)}),(0,N.jsxs)(h,{testId:`submit-button`,type:`submit`,variant:`primary`,children:[e===`add`&&o(c.SECRETS$ADD_SECRET),e===`edit`&&o(c.SECRETS$EDIT_SECRET)]})]})]})}function F(){return(0,N.jsxs)(`div`,{className:s(S,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function I({title:e,description:t,onEdit:n,onDelete:r}){return(0,N.jsxs)(`tr`,{"data-testid":`secret-item`,className:C,children:[(0,N.jsx)(`td`,{className:s(w,`text-content-2 truncate`),title:e,children:e}),(0,N.jsx)(`td`,{className:s(w,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,N.jsx)(`td`,{className:w,children:(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,N.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:T,children:(0,N.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,N.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:T,children:(0,N.jsx)(d,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var L={hideTitle:!0};function R(){let e=i(),{t}=a(`openhands`),n=(0,A.useRef)(null),{data:r,isLoading:o,hasNextPage:u,isFetchingNextPage:d,onLoadMore:p}=O(),{mutate:m}=j(),[g,_]=A.useState(`list`),[S,C]=A.useState(null),[w,T]=A.useState(!1),D=(0,A.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&u&&!d&&p()},[u,d,p]),k=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},M=e=>{m(e,{onSettled:()=>{T(!1)},onSuccess:k,onError:k})},L=()=>{S&&M(S)},R=()=>{T(!1)},z=()=>{_(`list`),C(null)},B=g===`add-secret-form`||g===`edit-secret-form`,V=t(g===`add-secret-form`?c.SECRETS$ADD_A_SECRET:c.SECRETS$EDIT_A_SECRET);return(0,N.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[g===`list`?(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(y.H2,{children:t(c.SETTINGS$NAV_SECRETS)}),(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(c.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,N.jsx)(h,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(`add-secret-form`),isDisabled:o,children:t(c.SECRETS$ADD_NEW_SECRET)})]}):null,B?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(l,{testId:`back-to-secrets`,onClick:z,children:t(c.BUTTON$BACK)}),(0,N.jsx)(y.H2,{testId:`secret-editor-title`,children:V})]}):null,o&&g===`list`&&(0,N.jsxs)(`ul`,{children:[(0,N.jsx)(F,{}),(0,N.jsx)(F,{}),(0,N.jsx)(F,{})]}),g===`list`&&!o&&r?.length===0&&(0,N.jsx)(`div`,{"data-testid":`secrets-empty`,className:`rounded-xl border border-[var(--oh-border)] p-8 text-center`,children:(0,N.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:t(c.SECRETS$EMPTY)})}),g===`list`&&!o&&(r?.length??0)>0&&(0,N.jsxs)(`div`,{ref:n,className:b,onScroll:D,children:[(0,N.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,N.jsx)(`thead`,{className:E,children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{className:s(x,`w-1/4`),children:t(c.SETTINGS$NAME)}),(0,N.jsx)(`th`,{className:s(x,`w-1/2`),children:t(c.SECRETS$DESCRIPTION)}),(0,N.jsx)(`th`,{className:s(x,`w-1/4 text-right`),children:t(c.SETTINGS$ACTIONS)})]})}),(0,N.jsx)(`tbody`,{children:r?.map(e=>(0,N.jsx)(I,{title:e.name,description:e.description,onEdit:()=>{_(`edit-secret-form`),C(e.name)},onDelete:()=>{T(!0),C(e.name)}},e.name))})]}),d&&(0,N.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,N.jsx)(f,{size:`small`})})]}),(g===`add-secret-form`||g===`edit-secret-form`)&&(0,N.jsx)(P,{mode:g===`add-secret-form`?`add`:`edit`,selectedSecret:S,onCancel:z}),w&&(0,N.jsx)(v,{text:t(c.SECRETS$CONFIRM_DELETE_KEY),onConfirm:L,onCancel:R})]})}var z=r(R);export{z as default,L as handle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{t}from"./utils-
|
|
1
|
+
import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{t}from"./utils-DsWhWn2F.js";var n=e();function r({value:e,options:r,onChange:i,ariaLabel:a,testId:o}){return(0,n.jsx)(`div`,{role:`radiogroup`,"aria-label":a,"data-testid":o,className:`inline-flex items-center rounded-md bg-[var(--oh-surface-raised)] p-0.5 text-xs`,children:r.map(r=>{let a=r.value===e;return(0,n.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":a,"data-testid":o?`${o}-option-${r.value}`:void 0,onClick:()=>i(r.value),className:t(`px-2 py-0.5 rounded cursor-pointer transition-colors`,a?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:text-white`),children:r.label},r.value)})})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{F as r,L as i,M as a,U as o,m as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as c}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{L as l,M as u,it as d}from"./active-backend-context-mY7Gff5c.js";import{t as f,z as p}from"./utils-DsWhWn2F.js";import{i as m,n as h,r as g,t as _}from"./use-settings-nav-items-DPK5sxvR.js";import{n as v}from"./use-config-C959QcRC.js";import"./navigation-link-Bxmn-pCs.js";import"./sidebar-layout-BGMuyC86.js";import{t as y}from"./sidebar-nav-link-DA4_ct9G.js";import"./close-CDAVqnTn.js";import{r as b}from"./typography-B1UxuuEC.js";import{t as x}from"./settings-section-header-context-CnIIQAUn.js";import"./settings-gear-TYXnELES.js";import{n as S,r as C}from"./settings-utils-BL_Z9uIe.js";import{t as w}from"./use-breakpoint-DA7JqsRN.js";import{t as T}from"./backend-synced-settings-badge-CQ9xtNWm.js";import{t as E}from"./settings-like-page-layout-classes-DyxyJ0k4.js";var D=e(t(),1),O=n();function k({navigationItems:e}){let{t}=c(`openhands`),n=e.filter(e=>e.type===`item`);return(0,O.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:f(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,O.jsx)(b.Text,{className:`px-2 text-sm font-normal text-white`,children:t(p.SETTINGS$TITLE)}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:[n.map(e=>(0,O.jsx)(y,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,O.jsx)(h,{}),(0,O.jsx)(g,{})]}),(0,O.jsx)(`div`,{className:`px-2 pt-3`,children:(0,O.jsx)(m,{})}),(0,O.jsx)(`div`,{className:`px-2 pt-3`,children:(0,O.jsx)(T,{})})]})}function A({children:e,navigationItems:t}){return(0,O.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,O.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,O.jsx)(k,{navigationItems:t}),(0,O.jsx)(`main`,{className:E,children:(0,O.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}var j=async({request:e})=>{let{pathname:t}=new URL(e.url),n=(await d.fetchQuery({queryKey:l.WEB_CLIENT_CONFIG,queryFn:v.getConfig,...u}))?.feature_flags;if(C(t,n)){let e=S(n);if(e&&e!==t)return a(e)}return null};function M(){let{t:e}=c(`openhands`),t=r(),n=i(),a=_(),o=w(768),[l,u]=(0,D.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,D.useMemo)(()=>{let e=a.find(e=>e.type===`item`&&e.item.to===t.pathname);if(e?.type===`item`)return{currentSectionTitle:e.item.text,currentSectionSubtitle:e.item.subtitle};let n=a.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[a,t.pathname]),p=n.find(e=>e.pathname===t.pathname)?.handle,m=o&&t.pathname===`/settings`;return(0,O.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,O.jsx)(x,{setHideSectionHeader:u,children:(0,O.jsx)(A,{navigationItems:a,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(p?.hideTitle===!0||m||l)&&(0,O.jsxs)(`header`,{className:`space-y-1`,children:[(0,O.jsx)(b.H2,{children:e(d)}),f?(0,O.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(f)}):null]}),(0,O.jsx)(s,{})]})})})})}var N=o(M);export{j as clientLoader,N as default};
|
package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-jOiv5Yrk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,r as t,t as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as a,z as o}from"./utils-
|
|
1
|
+
import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,r as t,t as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as a,z as o}from"./utils-DsWhWn2F.js";import{f as s}from"./form-control-classes-CtVAktAy.js";import{i as c}from"./combobox-caret-Dl9UtvD6.js";import{n as l}from"./settings-input-BEaTCem1.js";e();var u=r();function d({testId:e,label:r,wrapperClassName:d,name:f,items:p,placeholder:m,showOptionalTag:h,isDisabled:g,isLoading:_,defaultSelectedKey:v,selectedKey:y,isClearable:b,allowsCustomValue:x,required:S,onSelectionChange:C,onInputChange:w,defaultFilter:T,startContent:E,inputWrapperClassName:D,inputClassName:O}){let{t:k}=i(`openhands`);return(0,u.jsxs)(`label`,{className:a(`flex flex-col gap-2.5 w-full min-w-0`,d),children:[r&&(0,u.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,u.jsx)(`span`,{className:`text-sm`,children:r}),h&&(0,u.jsx)(l,{})]}),(0,u.jsx)(n,{"aria-label":typeof r==`string`?r:f,"data-testid":e,name:f,defaultItems:p,defaultSelectedKey:v,selectedKey:y,onSelectionChange:C,onInputChange:w,isClearable:b,isDisabled:g||_,isLoading:_,placeholder:_?k(o.HOME$LOADING):m,allowsCustomValue:x,isRequired:S,className:`w-full`,classNames:{popoverContent:`bg-content1 rounded-xl`,selectorButton:c},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:a(s,D),input:O}},defaultFilter:T,startContent:E||null,children:e=>(0,u.jsx)(t,{children:e.label},e.key)})]})}export{d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{U as t,p as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{z as i}from"./utils-
|
|
1
|
+
import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{U as t,p as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{z as i}from"./utils-DsWhWn2F.js";import{i as a,n as o,r as s,t as c}from"./use-settings-nav-items-DPK5sxvR.js";import{t as l}from"./use-config-C959QcRC.js";import{t as u}from"./sidebar-nav-link-DA4_ct9G.js";import{r as d}from"./typography-B1UxuuEC.js";import{n as f}from"./settings-utils-BL_Z9uIe.js";import{t as p}from"./use-breakpoint-DA7JqsRN.js";import{t as m}from"./backend-synced-settings-badge-CQ9xtNWm.js";var h=e();function g({navigationItems:e}){let{t}=r(`openhands`),n=e.filter(e=>e.type===`item`);return(0,h.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,h.jsx)(d.H2,{children:t(i.SETTINGS$TITLE)}),(0,h.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[n.map(e=>(0,h.jsx)(u,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to)),(0,h.jsx)(o,{}),(0,h.jsx)(s,{})]}),(0,h.jsx)(a,{}),(0,h.jsx)(`div`,{className:`pt-1`,children:(0,h.jsx)(m,{})})]})}var _=t(function(){let e=p(768),t=c(),{data:r}=l();return e?(0,h.jsx)(g,{navigationItems:t}):(0,h.jsx)(n,{to:f(r?.feature_flags)??`/settings/app`,replace:!0})});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i,z as a}from"./utils-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i,z as a}from"./utils-DsWhWn2F.js";import{f as o}from"./form-control-classes-CtVAktAy.js";var s=e(t(),1),c=n();function l(){let{t:e}=r(`openhands`);return(0,c.jsx)(`span`,{className:`text-xs text-tertiary-alt`,children:e(a.COMMON$OPTIONAL)})}var u=(0,s.forwardRef)(function({testId:e,name:t,label:n,type:r,defaultValue:a,value:s,placeholder:u,showOptionalTag:d,isDisabled:f,startContent:p,className:m,onChange:h,onKeyDown:g,required:_,min:v,max:y,step:b,pattern:x,title:S,labelClassName:C,ariaDescribedBy:w,ariaInvalid:T,error:E,showRequiredTag:D,onBlur:O,inputClassName:k},A){let j=E&&e?`${e}-error`:void 0;return(0,c.jsxs)(`label`,{className:i(`flex flex-col gap-2.5 w-full min-w-0`,m),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,c.jsx)(`span`,{className:i(`text-sm`,C),children:n}),D&&(0,c.jsx)(`span`,{className:`text-red-400 text-sm leading-none`,"aria-hidden":!0,children:`*`}),d&&(0,c.jsx)(l,{})]}),(0,c.jsx)(`input`,{ref:A,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:O,name:t,disabled:f,type:r,defaultValue:a,value:s,placeholder:u,min:v,max:y,step:b,required:_,pattern:x,title:S,"aria-describedby":j??w,"aria-invalid":!!E||T,className:i(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,E&&`border-red-500`,k)}),E&&(0,c.jsx)(`p`,{id:j,role:`alert`,"data-testid":e?`${e}-error`:void 0,className:`text-xs text-red-400 -mt-1`,children:E})]})});export{l as n,u as t};
|
package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-VqMzkYYt.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./utils-
|
|
1
|
+
import{t as e}from"./utils-DsWhWn2F.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-CtVAktAy.js";var a=`h-12 min-h-12`,o=e(r,n,i,`overflow-hidden`),s=e(o,`overflow-auto max-h-[min(70vh,39rem)]`),c=`divide-y divide-[var(--oh-border)]`,l=`hover:bg-[var(--oh-interactive-hover-low)]`,u=e(a,`flex items-center px-3`,t,l),d=e(l,t,`border-t border-[var(--oh-border)] first:border-t-0`),f=e(i,`sticky top-0 z-10 border-b border-[var(--oh-border)]`),p=e(a,`px-3 text-left text-sm font-medium align-middle`),m=e(a,`px-3 text-sm align-middle min-w-0`),h=e(`inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted`,t,`hover:bg-[var(--oh-interactive-hover-low)] hover:text-white`);export{s as a,p as c,u as i,d as l,c as n,m as o,h as r,f as s,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{Ut as i}from"./active-backend-context-mY7Gff5c.js";import{L as a,t as o,z as s}from"./utils-DsWhWn2F.js";import{i as c}from"./llm-settings-D8zNkIlP.js";import{t as l}from"./use-tracking-COqZLobY.js";import{t as u}from"./settings-Chfn5xTD.js";import{t as d}from"./use-save-settings--C6LZXfI.js";import{t as f}from"./modal-backdrop-X-vKo61e.js";import{r as p,t as m}from"./modal-body-C3bGicn4.js";import{t as h}from"./base-modal-DkVyzFMt.js";import{t as g}from"./modal-classes-DFFO6BMU.js";import{t as _}from"./brand-button-BUlDL-mz.js";import{n as v}from"./navigation-context-BOGzIng3.js";import{t as y}from"./settings-input-BEaTCem1.js";import{s as b,y as x}from"./schema-field-htfNouTG.js";import{t as S}from"./settings-utils-BL_Z9uIe.js";var C=e(t(),1),w=n();function T({testId:e,title:t,description:n,buttons:r}){return(0,w.jsx)(h,{testId:e,title:t,description:n,buttons:[{text:r.danger.text,onClick:r.danger.onClick,className:`bg-danger`},{text:r.cancel.text,onClick:r.cancel.onClick,className:`bg-[var(--oh-interactive-selected)]`}]})}function E({settings:e,onClose:t}){let{trackSettingsSaved:n}=l(),{mutate:i}=d(),{currentPath:o}=v(),{t:u}=r(`openhands`),p=C.useRef(null),[m,h]=C.useState(!1),g=async e=>{let r=S(e);await i(r,{onSuccess:()=>{t();let e=r.agent_settings_diff?.llm??{};n({llmModel:e.model,llmApiKeySet:e.api_key?`SET`:`UNSET`,searchApiKeySet:r.search_api_key?`SET`:`UNSET`,remoteRuntimeResourceFactor:r.remote_runtime_resource_factor})}})},E=()=>{g(new FormData(p.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);o.startsWith(`/conversations/`)?h(!0):g(t)},O=e.llm_api_key_set,k=b(e,`llm.model`);return(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`form`,{ref:p,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,w.jsx)(c,{currentModel:typeof k==`string`?k:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(y,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(s.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,w.jsx)(x,{testId:`llm-api-key-help-anchor`,text:u(s.SETTINGS$DONT_KNOW_API_KEY),linkText:u(s.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,w.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,w.jsx)(_,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:u(s.BUTTON$SAVE)})})]}),m&&(0,w.jsx)(f,{children:(0,w.jsx)(T,{title:u(s.MODAL$END_SESSION_TITLE),description:u(s.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(s.BUTTON$END_SESSION),onClick:E},cancel:{text:u(s.BUTTON$CANCEL),onClick:()=>h(!1)}}})})]})}function D({onClose:e,settings:t}){let{t:n}=r(`openhands`);return(0,w.jsx)(f,{children:(0,w.jsxs)(`div`,{"data-testid":`ai-config-modal`,className:o(`bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal`,p(`md`),m),children:[(0,w.jsx)(`span`,{className:g,children:n(s.AI_SETTINGS$TITLE)}),(0,w.jsx)(x,{testId:`advanced-settings-link`,text:`${n(s.SETTINGS$DESCRIPTION)}. ${n(s.SETTINGS$FOR_OTHER_OPTIONS)} ${n(s.COMMON$SEE)}`,linkText:n(s.COMMON$ADVANCED_SETTINGS),href:i(`/settings`),suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,w.jsx)(E,{settings:t||u,onClose:e})]})})}export{D as SettingsModal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{Z as t,ot as n}from"./active-backend-context-mY7Gff5c.js";import{t as r}from"./proxy-BiyDhMBd.js";import{t as i}from"./settings-Chfn5xTD.js";var a=/^[a-zA-Z0-9_-]+$/;function o(e){return a.test(e)}function s(e,t=`mcp`){return e.trim().replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``)||t}var c={sse_servers:[],stdio_servers:[],shttp_servers:[]},l=`**********`;function u(e,t){return RegExp(`^${t}(_\\d+)?$`).test(e)?void 0:e}function d(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function f(e){if(!d(e))return null;let t=e.mcpServers;return d(t)&&!(`url`in t)&&!(`command`in t)?t:e}function p(e){if(!d(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0}function m(e){return e===`**********`?!0:Array.isArray(e)?e.some(m):d(e)?Object.values(e).some(m):!1}function h(e){if(!d(e))return;let t={};return d(e.tokens)&&(t.tokens=e.tokens),d(e.client_info)&&(t.client_info=e.client_info),(typeof e.token_expires_at==`number`||e.token_expires_at===null)&&(t.token_expires_at=e.token_expires_at),Object.keys(t).length>0?t:void 0}function g(e){if(d(e))switch(e.strategy){case`none`:return{strategy:`none`};case`api_key`:return typeof e.value==`string`?{strategy:`api_key`,value:e.value,...typeof e.header_name==`string`&&{header_name:e.header_name}}:void 0;case`bearer`:return typeof e.value==`string`?{strategy:`bearer`,value:e.value}:void 0;case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?void 0:{strategy:`basic`,username:e.username,password:e.password};case`header`:{let t=p(e.headers);return t?{strategy:`header`,headers:t}:void 0}case`oauth2`:{let t=w(e.authentication),n=h(e.state);return{strategy:`oauth2`,...t&&{authentication:t},...n&&{state:n}}}default:return}}function _(e){return g(e.auth)}function v(e){let t={};return e.auth&&!m(e.auth)&&(t.auth=e.auth),e.headers&&Object.keys(e.headers).length>0&&(t.headers=e.headers),t}function y(e){return e.enabled===!1?{enabled:!1}:{}}function b(e){return{...e.name&&{name:e.name},url:e.url,...e.headers&&{headers:e.headers},...e.auth&&{auth:e.auth},...y(e)}}function x(e){return b(e)}function S(e){return{...b(e),...e.timeout!==void 0&&{timeout:e.timeout}}}function C(e){return{name:e.name,command:e.command,...e.args&&{args:e.args},...e.env&&{env:e.env},...y(e)}}function w(e){if(!e||typeof e!=`object`)return;let t=e;if(t.type!==`oauth`)return;let n={type:`oauth`};return(t.client_auth_method===`none`||t.client_auth_method===`client_secret_post`||t.client_auth_method===`client_secret_basic`||t.client_auth_method===`private_key_jwt`)&&(n.client_auth_method=t.client_auth_method),(typeof t.scopes==`string`||Array.isArray(t.scopes)&&t.scopes.every(e=>typeof e==`string`))&&(n.scopes=t.scopes),typeof t.client_name==`string`&&(n.client_name=t.client_name),typeof t.client_metadata_url==`string`&&(n.client_metadata_url=t.client_metadata_url),typeof t.client_id==`string`&&(n.client_id=t.client_id),typeof t.client_secret==`string`&&(n.client_secret=t.client_secret),t.additional_client_metadata&&typeof t.additional_client_metadata==`object`&&!Array.isArray(t.additional_client_metadata)&&(n.additional_client_metadata=t.additional_client_metadata),n}function T(e){let t=f(e);if(!t)return{...c};let n=[],r=[],i=[];for(let[e,a]of Object.entries(t)){if(!d(a))continue;let t=a.url,o=a.enabled===!1;if(t){let r=a.transport,s=_(a),c=p(a.headers);if(r===`sse`){let r=u(e,`sse`),i={url:t};r&&(i.name=r),s&&(i.auth=s),c&&(i.headers=c),o&&(i.enabled=!1),n.push(i)}else{let n=u(e,`shttp`),r={url:t};n&&(r.name=n),a.timeout!=null&&(r.timeout=a.timeout),s&&(r.auth=s),c&&(r.headers=c),o&&(r.enabled=!1),i.push(r)}}else{if(typeof a.command!=`string`)continue;let t={name:e,command:a.command};a.args&&(t.args=a.args),a.env&&(t.env=a.env),o&&(t.enabled=!1),r.push(t)}}return{sse_servers:n,stdio_servers:r,shttp_servers:i}}function E(e){let t={},n=e=>{let n=s(e);if(!(n in t))return n;let r=1;for(;`${n}_${r}`in t;)r+=1;return`${n}_${r}`};for(let r of e.sse_servers){let e={},i;typeof r==`string`?e.url=r:(i=r.name,e.url=r.url,Object.assign(e,v(r),y(r))),e.transport=`sse`,t[n(i||`sse`)]=e}for(let r of e.shttp_servers){let e={transport:`http`},i;typeof r==`string`?e.url=r:(i=r.name,e.url=r.url,Object.assign(e,v(r),y(r)),r.timeout!=null&&(e.timeout=r.timeout)),t[n(i||`shttp`)]=e}for(let r of e.stdio_servers){let e={command:r.command};r.args&&(e.args=r.args),r.env&&(e.env=r.env),Object.assign(e,y(r)),t[n(r.name||`stdio`)]=e}return Object.keys(t).length>0?t:null}function D(){let e=n().backend;if(e.kind!==`cloud`)throw Error(`Cloud settings call requires a cloud backend.`);return e}function O(e){if(e.agent_settings&&Object.keys(e.agent_settings).length>0)return e.agent_settings;let t={},n={};typeof e.llm_model==`string`&&(n.model=e.llm_model),typeof e.llm_base_url==`string`&&(n.base_url=e.llm_base_url),typeof e.llm_api_key==`string`&&(n.api_key=e.llm_api_key),Object.keys(n).length>0&&(t.llm=n);let r={};return typeof e.enable_default_condenser==`boolean`&&(r.enabled=e.enable_default_condenser),typeof e.condenser_max_size==`number`&&(r.max_size=e.condenser_max_size),Object.keys(r).length>0&&(t.condenser=r),typeof e.agent==`string`&&(t.agent=e.agent),e.mcp_config&&Object.keys(e.mcp_config).length>0&&(t.mcp_config=e.mcp_config),t}function k(e){if(e.conversation_settings&&Object.keys(e.conversation_settings).length>0)return e.conversation_settings;let t={};return typeof e.confirmation_mode==`boolean`&&(t.confirmation_mode=e.confirmation_mode),(typeof e.security_analyzer==`string`||e.security_analyzer===null)&&(t.security_analyzer=e.security_analyzer),typeof e.max_iterations==`number`&&(t.max_iterations=e.max_iterations),t}async function A(){let e=await r({backend:D(),method:`GET`,path:`/api/v1/settings`});return{...e,agent_settings:O(e),conversation_settings:k(e),llm_api_key_set:!!e.llm_api_key_set,search_api_key_set:!!e.search_api_key_set,provider_tokens_set:e.provider_tokens_set}}async function j(e){let t=D(),n={};if(e.agent_settings_diff){let t={...e.agent_settings_diff};t.agent_context===null&&delete t.agent_context,Object.keys(t).length>0&&(n.agent_settings_diff=t)}if(e.conversation_settings_diff&&Object.keys(e.conversation_settings_diff).length>0&&(n.conversation_settings_diff=e.conversation_settings_diff),e.app_preferences)for(let[t,r]of Object.entries(e.app_preferences))r!==void 0&&(n[t]=r);await r({backend:t,method:`POST`,path:`/api/v1/settings`,body:n})}async function M(){return r({backend:D(),method:`GET`,path:`/api/v1/settings/agent-schema`})}async function N(){return r({backend:D(),method:`GET`,path:`/api/v1/settings/conversation-schema`})}var P=[`language`,`user_consents_to_analytics`,`enable_sound_notifications`,`git_user_name`,`git_user_email`,`title_llm_profile`,`disabled_skills`],F=new Set(P),I=e=>F.has(e),L=e=>{let t={},n={};for(let[r,i]of Object.entries(e))I(r)?t[r]=i:n[r]=i;return{extracted:t,rest:n}},R=e=>JSON.parse(JSON.stringify(e)),z=(e,t)=>({...e??{},...t??{}});async function B(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var V={redacted:null,encrypted:null,timestamp:0},H=300*1e3,U=()=>Date.now()-V.timestamp<H,W=()=>{V={redacted:null,encrypted:null,timestamp:0}},G=e=>!!e&&typeof e==`object`&&!Array.isArray(e),K=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,q=e=>{switch(e.strategy){case`none`:return{};case`api_key`:{if(typeof e.value!=`string`||!e.value)return null;let t=typeof e.header_name==`string`&&e.header_name?e.header_name:`Authorization`,n=t===`Authorization`?`Bearer ${e.value}`:e.value;return{[t]:n}}case`bearer`:return typeof e.value!=`string`||!e.value?null:{Authorization:`Bearer ${e.value}`};case`basic`:return typeof e.username!=`string`||typeof e.password!=`string`?null:{Authorization:K(e.username,e.password)};case`header`:return p(e.headers)??{};case`oauth2`:{let t=G(e.state)?e.state.tokens:void 0;return!G(t)||typeof t.access_token!=`string`?null:{Authorization:`Bearer ${t.access_token}`}}default:return null}},J=e=>{if(!G(e))return e;let t=G(e.mcpServers),n=t?e.mcpServers:e,r=Object.fromEntries(Object.entries(n).map(([e,t])=>{if(!G(t)||!G(t.auth))return[e,t];let n=q(t.auth);if(n===null)return[e,t];let r={...t},i={...p(t.headers)??{},...n};return delete r.auth,Object.keys(i).length>0?r.headers=i:delete r.headers,[e,r]}));return t?{...e,mcpServers:r}:r},Y=e=>{if(!G(e))return e;let t=G(e.mcpServers),n=t?e.mcpServers:e,r=Object.fromEntries(Object.entries(n).map(([e,t])=>G(t)?[e,{...t,enabled:t.enabled!==!1}]:[e,t]));return t?{...e,mcpServers:r}:r},X=e=>{let t=f(e);return t?Object.values(t).some(e=>m(G(e)?e.auth:void 0)||m(G(e)?e.headers:void 0)||m(G(e)?e.env:void 0)):!1},Z=(e,t)=>{let n=f(e),r=f(t);return!n||!r?!1:Object.keys(n).some(e=>!(e in r))},Q=e=>{let t={agent_settings:e.agent_settings??{},conversation_settings:e.conversation_settings??{},llm_api_key_set:e.llm_api_key_is_set},n=e.misc_settings?.app_preferences;if(n)for(let e of P){let r=n[e];r!==void 0&&(t[e]=r)}return t},$=e=>{let t=z(i.agent_settings??{},e.agent_settings??{}),n=z(i.conversation_settings??{},e.conversation_settings??{}),r={...R(i),...e,provider_tokens_set:{...i.provider_tokens_set??{},...e.provider_tokens_set??{}},agent_settings:t,conversation_settings:n},a=t.llm,o=t.condenser;return typeof t.agent==`string`&&(r.agent=t.agent),typeof a?.model==`string`&&a.model.length>0&&(r.llm_model=a.model),typeof a?.base_url==`string`&&(r.llm_base_url=a.base_url),typeof o?.enabled==`boolean`&&(r.enable_default_condenser=o.enabled),typeof o?.max_size==`number`&&(r.condenser_max_size=o.max_size),typeof n.confirmation_mode==`boolean`&&(r.confirmation_mode=n.confirmation_mode),(typeof n.security_analyzer==`string`||n.security_analyzer===null)&&(r.security_analyzer=n.security_analyzer),typeof n.max_iterations==`number`&&(r.max_iterations=n.max_iterations),r.search_api_key_set=!!r.search_api_key,r},ee=class r{static async fetchSettingsFromApi(n){return B(()=>new e(t()).getSettings({exposeSecrets:n}))}static async getSettings(){if(n().backend.kind===`cloud`)try{return $(await B(()=>A()))}catch(e){return console.warn(`Failed to fetch cloud settings, using defaults:`,e),$({})}if(U()&&V.redacted)return $(Q(V.redacted));try{let e=await this.fetchSettingsFromApi();return V.redacted=e,V.timestamp=Date.now(),$(Q(e))}catch(e){return console.warn(`Failed to fetch settings from API, using defaults:`,e),$({})}}static async getSettingsForConversation(){if(U()&&V.encrypted)return{agentSettings:V.encrypted.agent_settings,conversationSettings:V.encrypted.conversation_settings,secretsEncrypted:!0};let e=await this.fetchSettingsFromApi(`encrypted`);return V.encrypted=e,V.timestamp||=Date.now(),{agentSettings:e.agent_settings,conversationSettings:e.conversation_settings,secretsEncrypted:!0}}static async getSettingsSchema(){return n().backend.kind===`cloud`?await M():await new e(t()).getAgentSchema()}static async getConversationSettingsSchema(){return n().backend.kind===`cloud`?await N():await new e(t()).getConversationSchema()}static async saveSettings(i){let{extracted:a,rest:o}=L(i),s=Object.keys(a).length>0,c={},l=o.agent_settings_diff;l&&Object.keys(l).length>0&&(c.agent_settings_diff=l);let u=o.conversation_settings_diff;u&&Object.keys(u).length>0&&(c.conversation_settings_diff=u),s&&(c.misc_settings_diff={app_preferences:a});let d=n().backend.kind===`cloud`,f=c.agent_settings_diff,p=!!f&&`mcp_config`in f&&f.mcp_config!==null,m;if(p)try{m=d?(await A())?.agent_settings?.mcp_config:(await r.fetchSettingsFromApi())?.agent_settings?.mcp_config}catch{}let h=d&&p&&X(m)&&!Z(m,f?.mcp_config),g=p&&!h;if(d){if(!(c.agent_settings_diff||c.conversation_settings_diff||s))return!0;g&&await B(()=>j({agent_settings_diff:{mcp_config:null}}));let e={};if(c.agent_settings_diff&&(e.agent_settings_diff={...c.agent_settings_diff},`mcp_config`in e.agent_settings_diff)){let t=J(e.agent_settings_diff.mcp_config);e.agent_settings_diff.mcp_config=h?Y(t):t}c.conversation_settings_diff&&(e.conversation_settings_diff=c.conversation_settings_diff),s&&(e.app_preferences=a);try{await B(()=>j(e))}catch(e){if(g&&m)try{await j({agent_settings_diff:{mcp_config:m}})}catch{}throw e}}else{if(!(c.agent_settings_diff||c.conversation_settings_diff||c.misc_settings_diff))return!0;g&&await B(()=>new e(t()).updateSettings({agent_settings_diff:{mcp_config:null}}));try{await B(()=>new e(t()).updateSettings(c))}catch(n){if(g&&m)try{await new e(t()).updateSettings({agent_settings_diff:{mcp_config:m}})}catch{}throw n}}return W(),!0}static invalidateCache(){W()}};export{S as a,E as c,s as d,T as i,a as l,l as n,x as o,m as r,C as s,ee as t,o as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i,z as a}from"./utils-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as i,z as a}from"./utils-DsWhWn2F.js";import{n as o}from"./toggle-switch-DYRr9CAR.js";var s=e(t(),1),c=n();function l({children:e,testId:t,name:n,onToggle:l,defaultIsToggled:u,isToggled:d,isBeta:f,isDisabled:p,togglePosition:m=`left`}){let{t:h}=r(`openhands`),[g,_]=s.useState(u??!1),v=e=>{p||(_(e),l?.(e))},y=(0,c.jsx)(`input`,{hidden:!0,"data-testid":t,name:n,type:`checkbox`,onChange:e=>v(e.target.checked),checked:d??g,disabled:p}),b=(0,c.jsx)(o,{enabled:d??g}),x=e||f?(0,c.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(`span`,{className:`text-sm`,children:e}),f&&(0,c.jsx)(`span`,{className:`text-[11px] leading-4 text-base font-[500] tracking-tighter bg-primary px-1 rounded-full`,children:h(a.BADGE$BETA)})]}):null;return(0,c.jsxs)(`label`,{className:i(`flex items-center gap-2`,m===`right`?`w-full justify-between`:`w-fit`,p?`cursor-not-allowed opacity-50`:`cursor-pointer`),children:[y,m===`right`?(0,c.jsxs)(c.Fragment,{children:[x,b]}):(0,c.jsxs)(c.Fragment,{children:[b,x]})]})}export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{B as r,U as i,l as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{u as s}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{B as r,U as i,l as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{u as s}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js";import{s as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{t as l}from"./useQuery-B38jBavx.js";import{Z as u}from"./active-backend-context-mY7Gff5c.js";import{z as d}from"./utils-DsWhWn2F.js";import{t as f}from"./messages-CdNfZPgd.js";import{t as p}from"./loading-spinner-DRFyh6Iy.js";import{t as m}from"./openhands-logo-CmYvJXBa.js";import{S as h,u as g}from"./markdown-renderer-U40HF0Ak.js";var _=e(t(),1),v=e=>l({queryKey:[`shared-conversation`,e],queryFn:()=>{if(!e)throw Error(`Conversation ID is required`);return new c(u()).getSharedConversation(e)},enabled:!!e,retry:!1}),y=e=>s({queryKey:[`shared-conversation-events`,e],queryFn:({pageParam:t})=>{if(!e)throw Error(`Conversation ID is required`);return new c(u()).searchSharedEvents({conversationId:e,limit:100,pageId:t})},initialPageParam:void 0,getNextPageParam:e=>e.next_page_id??void 0,enabled:!!e,retry:!1}),b=({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:n,threshold:r=100})=>{let i=(0,_.useRef)(null),a=(0,_.useCallback)(()=>{if(!i.current||t||!e)return;let{scrollTop:a,scrollHeight:o,clientHeight:s}=i.current;a+s>=o-r&&n()},[e,t,n,r]);return(0,_.useEffect)(()=>{let e=i.current;if(e)return e.addEventListener(`scroll`,a),()=>{e.removeEventListener(`scroll`,a)}},[a]),i},x=n(),S=i(function(){let{t:e}=o(`openhands`),{conversationId:t}=r(),{data:n,isLoading:i,error:s}=v(t),{data:c,isLoading:l,error:u,hasNextPage:S,fetchNextPage:C,isFetchingNextPage:w}=y(t),T=i||l,E=s||u,D=_.useMemo(()=>c?.pages?c.pages.flatMap(e=>e.items):[],[c?.pages]),O=_.useMemo(()=>D.reduce((e,t)=>h(t,e),[]).filter(g),[D]),k=b({hasNextPage:!!S,isFetchingNextPage:w,fetchNextPage:C});return T?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(p,{size:`large`})}):E||!n?(0,x.jsx)(`div`,{className:`flex items-center justify-center h-screen bg-base`,children:(0,x.jsx)(`div`,{className:`text-white`,children:e(d.CONVERSATION$NOT_FOUND)})}):(0,x.jsxs)(`div`,{className:`h-screen bg-base text-white flex flex-col`,children:[(0,x.jsx)(`div`,{className:`border-b border-[var(--oh-border-subtle)] p-4 flex-shrink-0`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto flex items-start gap-4`,children:[(0,x.jsx)(a,{to:`/conversations`,className:`flex-shrink-0`,"aria-label":e(d.BRANDING$OPENHANDS_LOGO),children:(0,x.jsx)(m,{width:46,height:30})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`h1`,{className:`text-xl font-medium mb-2`,children:n?.title||e(d.CONVERSATION$SHARED_CONVERSATION)}),n?.selected_branch&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.CONVERSATION$BRANCH),`: `,n.selected_branch]}),n?.selected_repository&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.CONVERSATION$REPOSITORY),`:`,` `,n.selected_repository]}),n?.llm_model&&(0,x.jsxs)(`div`,{className:`text-sm text-[var(--oh-muted)]`,children:[e(d.LLM$MODEL),`: `,n.llm_model]})]})]})}),(0,x.jsx)(`div`,{ref:k,className:`flex-1 overflow-y-auto custom-scrollbar-always px-4 pt-4 gap-2`,children:(0,x.jsxs)(`div`,{className:`max-w-4xl mx-auto p-4 border border-[var(--oh-border-subtle)] rounded`,children:[O.length>0?(0,x.jsx)(f,{messages:O,allEvents:D}):(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,x.jsx)(`div`,{className:`text-center text-[var(--oh-muted)] py-8`,children:e(d.CONVERSATION$NO_HISTORY_AVAILABLE)})}),w&&(0,x.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,x.jsx)(p,{size:`small`})})]})})]})});export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./utils-
|
|
1
|
+
import{t as e}from"./utils-DsWhWn2F.js";var t=`transition-none motion-reduce:transition-none`,n=`flex h-9 w-[18px] shrink-0 items-center justify-center`,r=`relative h-9 min-h-9 max-h-9 w-full shrink-0`;function i(t){return e(`flex h-10 min-h-10 shrink-0 items-center w-full`,t?`px-0`:`gap-2 pl-2.5 pr-2.5`)}var a={active:`bg-tertiary text-white font-normal`,idle:`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`};function o(t){return e(`flex flex-col gap-0.5 w-full shrink-0 items-stretch`,!t&&`pr-2.5`)}function s(n){let{indent:r=!1,collapsed:i=!1}=n??{};return e(`flex h-9 min-h-9 min-w-0 items-center rounded-md`,t,`text-sm leading-5 w-full`,i?`group gap-0 px-0 overflow-visible bg-transparent hover:bg-transparent`:`gap-2 px-2.5 overflow-hidden`,r&&!i&&`pl-7`)}function c(n){return e(`pointer-events-none absolute inset-0 z-0 rounded-md`,t,n?`bg-tertiary`:`bg-transparent group-hover:bg-[var(--oh-surface-raised)]`)}function l(t){return e(`relative z-[1] flex h-full w-full items-center justify-start pl-2.5 [&_svg]:shrink-0`,t?`text-white font-normal`:`text-[var(--oh-muted)] group-hover:text-white`)}function u(e){return e?`sr-only`:`min-w-0 truncate`}var d=e(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,t,`cursor-pointer`),f=e(`relative hidden md:block shrink-0 overflow-visible`,r),p=e(`absolute left-1/2 top-1/2 hidden h-7 w-7 -translate-x-1/2 -translate-y-1/2 md:inline-flex`,`items-center justify-center rounded-md`,t,`cursor-pointer`,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`);export{n as a,l as c,o as d,s as f,d as i,i as l,f as n,a as o,p as r,c as s,r as t,u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as a}from"./useMutation-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as a}from"./useMutation-DHLpZ6J0.js";import{t as o}from"./Trans-B7lYw4uD.js";import{t as s,z as c}from"./utils-DsWhWn2F.js";import{t as l}from"./modal-backdrop-X-vKo61e.js";import{n as u}from"./modal-body-C3bGicn4.js";import{n as d,r as f}from"./base-modal-DkVyzFMt.js";import{_ as p,u as m}from"./form-control-classes-CtVAktAy.js";import{t as h}from"./brand-button-BUlDL-mz.js";import{t as g}from"./agent-server-conversation-service.api-C_7YnjzP.js";var _=e(t(),1),v=n();function y({onConfirm:e,onCancel:t,conversationTitle:n,title:r,description:a}){let{t:s}=i(`openhands`),p;return p=a??(n?(0,v.jsx)(o,{ns:`openhands`,i18nKey:c.CONVERSATION$DELETE_WARNING_WITH_TITLE,values:{title:n},components:{title:(0,v.jsx)(`span`,{className:`text-white`})}}):s(c.CONVERSATION$DELETE_WARNING)),(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:r??s(c.CONVERSATION$CONFIRM_DELETE)}),(0,v.jsx)(d,{children:p})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:s(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:s(c.ACTION$CONFIRM_DELETE)})]})]})})}function b({onConfirm:e,onCancel:t}){let{t:n}=i(`openhands`);return(0,v.jsx)(l,{onClose:t,children:(0,v.jsxs)(u,{className:`items-start border border-[var(--oh-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,v.jsx)(f,{title:n(c.CONVERSATION$CONFIRM_CLOSE_CONVERSATION)}),(0,v.jsx)(d,{description:n(c.CONVERSATION$CLOSE_CONVERSATION_WARNING)})]}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 w-full`,onClick:e=>e.stopPropagation(),children:[(0,v.jsx)(h,{type:`button`,variant:`secondary`,onClick:t,"data-testid":`cancel-button`,children:n(c.BUTTON$CANCEL)}),(0,v.jsx)(h,{type:`button`,variant:`primary`,onClick:e,"data-testid":`confirm-button`,children:n(c.ACTION$CONFIRM_CLOSE)})]})]})})}var x=()=>{let e=r();return a({mutationFn:e=>g.updateConversationTitle(e.conversationId,e.newTitle),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.map(e=>e.id===t.conversationId?{...e,title:t.newTitle}:e)),e.setQueryData([`user`,`conversation`,t.conversationId],e=>e&&{...e,title:t.newTitle}),{previousConversations:n}},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`user`,`conversation`,r.conversationId]})}})};function S(e){if(!e)return null;try{let t=new URL(e);return t.hostname===`localhost`&&window.location.hostname!==`localhost`?(t.hostname=window.location.hostname,t.toString()):e}catch{return e}}var C=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{d:`M12 2C12.5523 2 13 2.44772 13 3V13.5858L15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929C7.68342 10.9024 8.31658 10.9024 8.70711 11.2929L11 13.5858V3C11 2.44772 11.4477 2 12 2ZM5 17C5.55228 17 6 17.4477 6 18V20H18V18C18 17.4477 18.4477 17 19 17C19.5523 17 20 17.4477 20 18V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V18C4 17.4477 4.44772 17 5 17Z`,fill:`currentColor`})}),w=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 7.5V9H3V7.5H21ZM3 10.5H21V18H3V10.5ZM21 6H3C2.60218 6 2.22064 6.15804 1.93934 6.43934C1.65804 6.72064 1.5 7.10218 1.5 7.5V18C1.5 18.3978 1.65804 18.7794 1.93934 19.0607C2.22064 19.342 2.60218 19.5 3 19.5H21C21.3978 19.5 21.7794 19.342 22.0607 19.0607C22.342 18.7794 22.5 18.3978 22.5 18V7.5C22.5 7.10218 22.342 6.72064 22.0607 6.43934C21.7794 6.15804 21.3978 6 21 6ZM16.5 15H19.5V16.5H16.5V15Z`,fill:`currentColor`})}),T=_.createContext(null);function E({children:e}){let[t,n]=_.useState(!1),r=_.useCallback(()=>n(!0),[]),i=_.useCallback(()=>n(!1),[]),a=_.useCallback(()=>n(e=>!e),[]),o=_.useMemo(()=>({isOpen:t,open:r,close:i,toggle:a}),[t,r,i,a]);return(0,v.jsx)(T.Provider,{value:o,children:e})}function D(){let e=_.useContext(T);if(!e)throw Error(`useSidebarMobileNav must be used within SidebarMobileNavProvider`);return e}var O=s(`inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)]`,p,m),k=`size-5 shrink-0`,A=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 5.5H18C18.2761 5.5 18.5 5.72386 18.5 6V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 5.5ZM8.5 5.5H6C5.72386 5.5 5.5 5.72386 5.5 6V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 5.5ZM18 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V6C20 4.89543 19.1046 4 18 4Z`,fill:`currentColor`})});function j(){let{t:e}=i(`openhands`),{isOpen:t,toggle:n}=D();return(0,v.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-menu-toggle`,onClick:n,"aria-expanded":t,"aria-label":e(t?c.SIDEBAR$CLOSE_MENU:c.SIDEBAR$OPEN_MENU),className:O,children:(0,v.jsx)(A,{className:k,"aria-hidden":!0})})}export{E as a,C as c,b as d,y as f,k as i,S as l,A as n,D as o,O as r,w as s,j as t,x as u};
|