@openhands/agent-canvas 1.8.0 → 1.9.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.
Files changed (492) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-B7lYw4uD.js → Trans-Bwpzk1wT.js} +1 -1
  4. package/build/assets/{acp-providers-WUD4tfSq.js → acp-providers-C921BlYB.js} +1 -1
  5. package/build/assets/active-backend-context-BiwzkzDy.js +2 -0
  6. package/build/assets/agent-context-settings-DXNT_dcw.js +1 -0
  7. package/build/assets/agent-profiles-settings-BymJf3EP.js +1 -0
  8. package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +41 -0
  9. package/build/assets/agent-settings-BjgQQe-_.js +1 -0
  10. package/build/assets/{agent-settings-BGTyoT6X.js → agent-settings-WzqXk6B4.js} +2 -2
  11. package/build/assets/{alert-banner-eRyIwDyU.js → alert-banner-DR8EVyZM.js} +1 -1
  12. package/build/assets/api-error-message-e16L1kwH.js +1 -0
  13. package/build/assets/{api-key-entry-screen-JOx3SH1-.js → api-key-entry-screen-DI0I04O3.js} +1 -1
  14. package/build/assets/{app-settings-D53QZy5p.js → app-settings-DGistSFV.js} +1 -1
  15. package/build/assets/automation-C_eCrGyP.js +1 -0
  16. package/build/assets/automation-detail-DY6x2FW1.js +2 -0
  17. package/build/assets/automation-export-C09f-Lua.js +2 -0
  18. package/build/assets/automation-setup-route-CqKp0717.js +1 -0
  19. package/build/assets/automations-list-CqWJ7qXW.js +1 -0
  20. package/build/assets/{back-nav-button-C02hGa8t.js → back-nav-button-D4ngzpSh.js} +1 -1
  21. package/build/assets/backend-form-modal-B8D5hBzK.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-CQ9xtNWm.js → backend-synced-settings-badge-BnzI8Ysj.js} +1 -1
  23. package/build/assets/{badge-CzXbf7tR.js → badge-1Mf1iPcX.js} +1 -1
  24. package/build/assets/{base-modal-DkVyzFMt.js → base-modal-BBuy0WQQ.js} +1 -1
  25. package/build/assets/{brand-button-BUlDL-mz.js → brand-button-DGN6Y9o6.js} +1 -1
  26. package/build/assets/browser-D_ekTlTS.js +6 -0
  27. package/build/assets/{browser-tab-BijpUbdt.js → browser-tab-D4a4Ou_w.js} +1 -1
  28. package/build/assets/{chat-send-button-BKsVjhtA.js → chat-send-button-CgbcjD97.js} +1 -1
  29. package/build/assets/check-CPLXgluF.js +1 -0
  30. package/build/assets/chevron-down-CP4QHvyc.js +1 -0
  31. package/build/assets/circle-check-Dpy2_xSI.js +1 -0
  32. package/build/assets/{circle-plus-check-toggle-DdjUiOo1.js → circle-plus-check-toggle-yTAS-nX3.js} +1 -1
  33. package/build/assets/cloud-funnel-analytics-CEOl5Gxr.js +1 -0
  34. package/build/assets/{combobox-caret-Dl9UtvD6.js → combobox-caret-Bd2yySnF.js} +1 -1
  35. package/build/assets/command-menu-Bj6X4ckE.js +1 -0
  36. package/build/assets/condenser-settings-EAXQNR2E.js +1 -0
  37. package/build/assets/{confirmation-modal-CRBJSllP.js → confirmation-modal-NCUPr2-O.js} +1 -1
  38. package/build/assets/{context-menu-list-item-FGaafXGh.js → context-menu-list-item-CrCrYuPF.js} +1 -1
  39. package/build/assets/conversation-BzyIcSwr.js +1 -0
  40. package/build/assets/conversation-CUJ0Vo8g.js +90 -0
  41. package/build/assets/conversation-panel-BzyIcSwr.js +1 -0
  42. package/build/assets/conversation-state-store-F62HvuI1.js +1 -0
  43. package/build/assets/{conversation-tab-empty-state-CDjvNgpG.js → conversation-tab-empty-state-BCZ7rUMH.js} +1 -1
  44. package/build/assets/{copy-Drwu97Gx.js → copy-DCmZtz6n.js} +1 -1
  45. package/build/assets/{copy-to-clipboard-button-NbN1clVr.js → copy-to-clipboard-button-D_Lp6-Fl.js} +1 -1
  46. package/build/assets/{device-verify-CDm_WrVu.js → device-verify-DLmolX8Q.js} +1 -1
  47. package/build/assets/{dropdown-classes-CqA2BTCL.js → dropdown-classes-BB8rzqXL.js} +1 -1
  48. package/build/assets/{entry.client-BO2KQj0y.js → entry.client-BbIYOsIg.js} +2 -2
  49. package/build/assets/{enum-filter-dropdown-DSqPZnsD.js → enum-filter-dropdown-C08-srev.js} +1 -1
  50. package/build/assets/{environment-switch-overlay-mGl2pqqx.js → environment-switch-overlay-BepBBX66.js} +1 -1
  51. package/build/assets/{extensions-hub-Br3Lgynp.js → extensions-hub-R3KNv-5V.js} +1 -1
  52. package/build/assets/{extensions-navigation-BQmstKDZ.js → extensions-navigation-CfWFmI1I.js} +1 -1
  53. package/build/assets/{external-link-D9B2QMPf.js → external-link-BdBSg8rk.js} +1 -1
  54. package/build/assets/files-tab-DEq8MbHu.js +1 -0
  55. package/build/assets/{form-control-classes-CtVAktAy.js → form-control-classes-DAfsCJTe.js} +1 -1
  56. package/build/assets/{format-time-delta-DICE64sz.js → format-time-delta-CxfPJpzC.js} +1 -1
  57. package/build/assets/git-provider-icon-BZqqUPlm.js +1 -0
  58. package/build/assets/git-repo-dropdown-9WKINV6J.js +1 -0
  59. package/build/assets/git-repo-dropdown-DEpOwUez.js +1 -0
  60. package/build/assets/{highlighted-source-view-KMsA9c4a.js → highlighted-source-view-CX9oIoVT.js} +1 -1
  61. package/build/assets/home-CY0JaxiY.js +1 -0
  62. package/build/assets/home-CaNWlVvB.js +1 -0
  63. package/build/assets/home-store-Ch1ErdBc.js +1 -0
  64. package/build/assets/index-home-CaNWlVvB.js +1 -0
  65. package/build/assets/info-CmWQXtRQ.js +1 -0
  66. package/build/assets/install-server-modal-BWrudmZU.js +1 -0
  67. package/build/assets/{launch-DjkKw55l.js → launch-B1POpHuP.js} +1 -1
  68. package/build/assets/{list-todo-BpAf7aOT.js → list-todo-DtiL3lTp.js} +1 -1
  69. package/build/assets/llm-not-configured-banner-3tMsM4K6.js +27 -0
  70. package/build/assets/{llm-settings-D8zNkIlP.js → llm-settings-CXo8iPNW.js} +1 -1
  71. package/build/assets/llm-settings-D0W8mJDk.js +1 -0
  72. package/build/assets/{llm-subscription-service-COTgZc1C.js → llm-subscription-service-DBJbfd8Z.js} +1 -1
  73. package/build/assets/loader-circle-B4QDBARx.js +1 -0
  74. package/build/assets/{loading-spinner-DRFyh6Iy.js → loading-spinner-DfZ_bhV7.js} +1 -1
  75. package/build/assets/{manage-backends-modal-DiRWE3tJ.js → manage-backends-modal-CwyWsiag.js} +1 -1
  76. package/build/assets/manifest-39f4789d.js +1 -0
  77. package/build/assets/markdown-renderer-DgiLLhW6.js +8 -0
  78. package/build/assets/mcp-DXG9LWrI.js +9 -0
  79. package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +1 -0
  80. package/build/assets/messages-kBjKaAeA.js +40 -0
  81. package/build/assets/{modal-body-C3bGicn4.js → modal-body-CMsDpalT.js} +1 -1
  82. package/build/assets/{modal-classes-DFFO6BMU.js → modal-classes-B6PDrxXo.js} +1 -1
  83. package/build/assets/{modal-close-button-vxkAIRyZ.js → modal-close-button-DyxBZaAb.js} +1 -1
  84. package/build/assets/{onboarding-DWuFieEA.js → onboarding-47hh2IHA.js} +1 -1
  85. package/build/assets/{onboarding-modal-C8m72Dpb.js → onboarding-modal-9BuvvROo.js} +1 -1
  86. package/build/assets/{organization-service.api-CQ73CB-S.js → organization-service.api-UDy63-oC.js} +1 -1
  87. package/build/assets/{pencil-DzW2GB2M.js → pencil-BjgtZmWp.js} +1 -1
  88. package/build/assets/{planner-tab-YG0bGxDY.js → planner-tab-BWk8885v.js} +1 -1
  89. package/build/assets/{plugins-management-service-ijhH8OSh.js → plugins-management-service-CjkgF2dd.js} +1 -1
  90. package/build/assets/plus-DrKuuvMe.js +1 -0
  91. package/build/assets/{profiles-service.api-C32pPm70.js → profiles-service.api-CukSFLzz.js} +1 -1
  92. package/build/assets/{providers-DuSn9s2i.js → providers-CqUWC85T.js} +1 -1
  93. package/build/assets/{proxy-BiyDhMBd.js → proxy-BBUG3sd2.js} +1 -1
  94. package/build/assets/{puzzle-DlqT0yvr.js → puzzle-BoNc6zZ8.js} +1 -1
  95. package/build/assets/recommended-automations-launcher-ejxy1P27.js +1 -0
  96. package/build/assets/{refresh-cw-Br5254f4.js → refresh-cw-BrM5ZAZD.js} +1 -1
  97. package/build/assets/root-5S-M8SYa.js +2 -0
  98. package/build/assets/root-DZ39lS5f.css +1 -0
  99. package/build/assets/root-layout-BPqoa0gv.js +3 -0
  100. package/build/assets/{schema-field-htfNouTG.js → schema-field-nImDoY6-.js} +1 -1
  101. package/build/assets/{sdk-section-page-D0K1dBQY.js → sdk-section-page-BxMrtUNV.js} +1 -1
  102. package/build/assets/search-Dc2qR4O2.js +1 -0
  103. package/build/assets/{secrets-service-Dbv5Zb8G.js → secrets-service-Dhjh3HhH.js} +1 -1
  104. package/build/assets/{secrets-settings-Da4SSaX9.js → secrets-settings-CPdxceT_.js} +1 -1
  105. package/build/assets/segmented-toggle-Do6oyepX.js +1 -0
  106. package/build/assets/{settings-F4a09IxY.js → settings-BRbnfKEm.js} +1 -1
  107. package/build/assets/{settings-dropdown-input-jOiv5Yrk.js → settings-dropdown-input-DYCULKpp.js} +1 -1
  108. package/build/assets/{settings-index-CyJBf5NA.js → settings-index-C9o2NBO0.js} +1 -1
  109. package/build/assets/settings-input-B-q2gkVy.js +1 -0
  110. package/build/assets/{settings-list-classes-VqMzkYYt.js → settings-list-classes-WpQi0q1L.js} +1 -1
  111. package/build/assets/{settings-modal-C-S1NpbC.js → settings-modal-CEK0AIx6.js} +1 -1
  112. package/build/assets/{settings-service.api-CTJRrvMu.js → settings-service.api-CZiPD8__.js} +1 -1
  113. package/build/assets/{settings-switch-B405oU_v.js → settings-switch-LqKdGxHL.js} +1 -1
  114. package/build/assets/shared-conversation-Bu-dQlgp.js +1 -0
  115. package/build/assets/{sidebar-layout-BGMuyC86.js → sidebar-layout-oHBGQmLh.js} +1 -1
  116. package/build/assets/{sidebar-mobile-menu-toggle-xiKoUfGa.js → sidebar-mobile-menu-toggle-ND-hgygu.js} +1 -1
  117. package/build/assets/{sidebar-nav-link-DA4_ct9G.js → sidebar-nav-link-CrujNA09.js} +1 -1
  118. package/build/assets/{sidebar-store-FRJ3rADB.js → sidebar-store-Bui-WNEr.js} +1 -1
  119. package/build/assets/{skill-card-pill-row-BMdhr_sd.js → skill-card-pill-row-CZBI7OqH.js} +1 -1
  120. package/build/assets/{skill-icon-badge-CGUkgcVH.js → skill-icon-badge-BOov_phZ.js} +1 -1
  121. package/build/assets/{skills-plugins-C5eJnyft.js → skills-plugins-D0PiHWAD.js} +1 -1
  122. package/build/assets/{skills-settings-pUxMr6WZ.js → skills-settings-B43KArIz.js} +2 -2
  123. package/build/assets/{styled-tooltip-B3kIdVyH.js → styled-tooltip-C7grwnOX.js} +1 -1
  124. package/build/assets/{task-list-tab-B3k4W1cK.js → task-list-tab-R3ac6m7O.js} +1 -1
  125. package/build/assets/{terminal-CBI_41Zc.js → terminal-yqkNdEAx.js} +1 -1
  126. package/build/assets/{toggle-switch-DYRr9CAR.js → toggle-switch-BeSrbgCg.js} +1 -1
  127. package/build/assets/{trash-2-gZPlx23R.js → trash-2-wW5TWcdN.js} +1 -1
  128. package/build/assets/{typography-B1UxuuEC.js → typography-iYhzLlHO.js} +1 -1
  129. package/build/assets/{use-acp-credential-form-CjSvKWFH.js → use-acp-credential-form-DUxbxmbq.js} +1 -1
  130. package/build/assets/{use-activate-agent-profile-DCRf47e-.js → use-activate-agent-profile-CDHA52tC.js} +1 -1
  131. package/build/assets/use-agent-profiles-TsOdIyw5.js +1 -0
  132. package/build/assets/{use-can-manage-org-profiles-vBiP7rHF.js → use-can-manage-org-profiles-Bt1M71u5.js} +1 -1
  133. package/build/assets/{use-cloud-current-user-id-BMq9gw93.js → use-cloud-current-user-id-DWt7HCgf.js} +1 -1
  134. package/build/assets/use-config-CxlEdf_v.js +1 -0
  135. package/build/assets/{use-create-conversation-CakhLF0X.js → use-create-conversation-nOJ6Um5h.js} +1 -1
  136. package/build/assets/{use-create-secret-RT4QtSS9.js → use-create-secret-Dj5ang9x.js} +1 -1
  137. package/build/assets/use-is-authed-BT7Iud4U.js +1 -0
  138. package/build/assets/{use-is-creating-conversation-CIAcnd8M.js → use-is-creating-conversation-CAggrM75.js} +1 -1
  139. package/build/assets/use-llm-profiles-2Wc2db8u.js +1 -0
  140. package/build/assets/{use-onboarding-completion-CJU4MNAY.js → use-onboarding-completion-gxQlcEy2.js} +1 -1
  141. package/build/assets/{use-plugins-marketplace-D-93nqtJ.js → use-plugins-marketplace-CVO7sXYR.js} +1 -1
  142. package/build/assets/use-save-agent-profile-D0wC5ExW.js +1 -0
  143. package/build/assets/{use-save-settings--C6LZXfI.js → use-save-settings-L3aMaDeS.js} +1 -1
  144. package/build/assets/{use-settings-DIAo5KFk.js → use-settings-8nt3DGxW.js} +1 -1
  145. package/build/assets/use-settings-nav-items-DHAAD-zk.js +16 -0
  146. package/build/assets/{use-skills-D_mLhYNa.js → use-skills-CE6miQ3r.js} +1 -1
  147. package/build/assets/use-tracking-BGboadaZ.js +68 -0
  148. package/build/assets/{use-user-conversation-DhcAEyJX.js → use-user-conversation-BIIpGUgM.js} +1 -1
  149. package/build/assets/useInfiniteQuery-BLRVmVPU.js +1 -0
  150. package/build/assets/{useMutation-DHLpZ6J0.js → useMutation-CaSHLnX0.js} +1 -1
  151. package/build/assets/{useQueries-B3T1a7qt.js → useQueries--d_WWAzc.js} +1 -1
  152. package/build/assets/{useQuery-B38jBavx.js → useQuery-DiPh8LRJ.js} +1 -1
  153. package/build/assets/utils-BgGG1znF.js +1 -0
  154. package/build/assets/{vendor~browser-CIoZCqGs.js → vendor~browser-IVYgIgG1.js} +1 -1
  155. package/build/assets/{vendor~entry.client-Di4qO77Y.js → vendor~entry.client-BcYIVQvB.js} +1 -1
  156. package/build/assets/{vendor~entry.client-BfviqoVc.js → vendor~entry.client-CXM9oiAk.js} +1 -1
  157. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js} +1 -1
  158. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js} +1 -1
  159. package/build/assets/{vendor~files-tab-atebg0iG.js → vendor~files-tab-C7RmQJwN.js} +1 -1
  160. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-G9DMrR7m.js → vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js} +1 -1
  161. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEhW1h3I.js → vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js} +1 -1
  162. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js +1 -0
  163. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js +1 -0
  164. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js +1 -0
  165. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js} +1 -1
  166. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js} +1 -1
  167. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js} +17 -4
  168. package/build/assets/{verification-settings-Vr5cN4md.js → verification-settings-DBsnSXC3.js} +1 -1
  169. package/build/assets/x-omAzpXkl.js +1 -0
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +37 -2
  172. package/build/locales/ca/openhands.json +37 -2
  173. package/build/locales/de/openhands.json +37 -2
  174. package/build/locales/en/openhands.json +38 -3
  175. package/build/locales/es/openhands.json +37 -2
  176. package/build/locales/fr/openhands.json +37 -2
  177. package/build/locales/it/openhands.json +37 -2
  178. package/build/locales/ja/openhands.json +37 -2
  179. package/build/locales/ko-KR/openhands.json +37 -2
  180. package/build/locales/no/openhands.json +37 -2
  181. package/build/locales/pt/openhands.json +37 -2
  182. package/build/locales/tr/openhands.json +37 -2
  183. package/build/locales/uk/openhands.json +37 -2
  184. package/build/locales/zh-CN/openhands.json +37 -2
  185. package/build/locales/zh-TW/openhands.json +37 -2
  186. package/config/defaults.json +1 -1
  187. package/dist/api/agent-server-adapter.cjs +3 -3
  188. package/dist/api/agent-server-adapter.cjs.map +1 -1
  189. package/dist/api/agent-server-adapter.d.ts +46 -6
  190. package/dist/api/agent-server-adapter.js +187 -168
  191. package/dist/api/agent-server-adapter.js.map +1 -1
  192. package/dist/api/agent-server-compatibility.cjs +1 -1
  193. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  194. package/dist/api/agent-server-compatibility.d.ts +4 -0
  195. package/dist/api/agent-server-compatibility.js +41 -38
  196. package/dist/api/agent-server-compatibility.js.map +1 -1
  197. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  198. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  199. package/dist/api/automation-service/automation-service.api.d.ts +20 -0
  200. package/dist/api/automation-service/automation-service.api.js +99 -62
  201. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  202. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +2 -0
  203. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -0
  204. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.d.ts +12 -0
  205. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +94 -0
  206. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -0
  207. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  208. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  209. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +31 -90
  210. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  211. package/dist/components/features/automations/recommended-automations-launcher.d.ts +0 -7
  212. package/dist/components/features/automations/recommended-automations-section.d.ts +0 -6
  213. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  214. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  215. package/dist/components/features/backends/backend-form-modal.js +568 -358
  216. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  217. package/dist/components/features/backends/device-flow-auth.cjs +1 -1
  218. package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
  219. package/dist/components/features/backends/device-flow-auth.d.ts +9 -1
  220. package/dist/components/features/backends/device-flow-auth.js +56 -55
  221. package/dist/components/features/backends/device-flow-auth.js.map +1 -1
  222. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  223. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  224. package/dist/components/features/backends/manage-backends-modal.js +1 -1
  225. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  226. package/dist/components/features/chat/chat-interface.cjs +1 -1
  227. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  228. package/dist/components/features/chat/chat-interface.js +105 -105
  229. package/dist/components/features/chat/chat-interface.js.map +1 -1
  230. package/dist/components/features/chat/chat-message.cjs +1 -1
  231. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  232. package/dist/components/features/chat/chat-message.d.ts +2 -1
  233. package/dist/components/features/chat/chat-message.js +59 -49
  234. package/dist/components/features/chat/chat-message.js.map +1 -1
  235. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  236. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  237. package/dist/components/features/chat/pending-user-messages.js +4 -1
  238. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  239. package/dist/components/features/chat/typing-indicator.cjs +1 -1
  240. package/dist/components/features/chat/typing-indicator.cjs.map +1 -1
  241. package/dist/components/features/chat/typing-indicator.d.ts +8 -1
  242. package/dist/components/features/chat/typing-indicator.js +94 -10
  243. package/dist/components/features/chat/typing-indicator.js.map +1 -1
  244. package/dist/components/features/command-menu/command-menu-items.d.ts +5 -1
  245. package/dist/components/features/files-tab/segmented-toggle.cjs +1 -1
  246. package/dist/components/features/files-tab/segmented-toggle.cjs.map +1 -1
  247. package/dist/components/features/files-tab/segmented-toggle.d.ts +2 -0
  248. package/dist/components/features/files-tab/segmented-toggle.js +17 -14
  249. package/dist/components/features/files-tab/segmented-toggle.js.map +1 -1
  250. package/dist/components/features/manifest/manifest-form-field.d.ts +27 -0
  251. package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +11 -0
  252. package/dist/components/features/manifest/manifest-review-step.d.ts +14 -0
  253. package/dist/components/features/manifest/manifest-setup-dialog.d.ts +14 -0
  254. package/dist/components/features/settings/settings-input.cjs +1 -1
  255. package/dist/components/features/settings/settings-input.cjs.map +1 -1
  256. package/dist/components/features/settings/settings-input.d.ts +6 -0
  257. package/dist/components/features/settings/settings-input.js +13 -8
  258. package/dist/components/features/settings/settings-input.js.map +1 -1
  259. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  260. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  261. package/dist/components/features/sidebar/sidebar-rail-body.js +124 -123
  262. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  263. package/dist/config/defaults.cjs +1 -1
  264. package/dist/config/defaults.cjs.map +1 -1
  265. package/dist/config/defaults.js +1 -1
  266. package/dist/config/defaults.js.map +1 -1
  267. package/dist/hooks/query/query-keys.cjs.map +1 -1
  268. package/dist/hooks/query/query-keys.d.ts +4 -0
  269. package/dist/hooks/query/query-keys.js.map +1 -1
  270. package/dist/hooks/query/use-manifest-capabilities.d.ts +21 -0
  271. package/dist/hooks/query/use-manifest-prerequisites.d.ts +24 -0
  272. package/dist/hooks/use-llm-configured.cjs +1 -1
  273. package/dist/hooks/use-llm-configured.cjs.map +1 -1
  274. package/dist/hooks/use-llm-configured.js +2 -1
  275. package/dist/hooks/use-llm-configured.js.map +1 -1
  276. package/dist/hooks/use-manifest-preflight.d.ts +18 -0
  277. package/dist/hooks/use-tracking.cjs +1 -1
  278. package/dist/hooks/use-tracking.cjs.map +1 -1
  279. package/dist/hooks/use-tracking.d.ts +14 -0
  280. package/dist/hooks/use-tracking.js +19 -1
  281. package/dist/hooks/use-tracking.js.map +1 -1
  282. package/dist/i18n/declaration.cjs +1 -1
  283. package/dist/i18n/declaration.cjs.map +1 -1
  284. package/dist/i18n/declaration.d.ts +36 -1
  285. package/dist/i18n/declaration.js +1 -1
  286. package/dist/i18n/declaration.js.map +1 -1
  287. package/dist/i18n/translation.cjs +2 -2
  288. package/dist/i18n/translation.cjs.map +1 -1
  289. package/dist/i18n/translation.js +611 -16
  290. package/dist/i18n/translation.js.map +1 -1
  291. package/dist/icons/external-link.cjs +2 -0
  292. package/dist/icons/external-link.cjs.map +1 -0
  293. package/dist/icons/external-link.js +22 -0
  294. package/dist/icons/external-link.js.map +1 -0
  295. package/dist/icons/server.cjs +2 -0
  296. package/dist/icons/server.cjs.map +1 -0
  297. package/dist/icons/server.js +17 -0
  298. package/dist/icons/server.js.map +1 -0
  299. package/dist/locales/ar/openhands.json +37 -2
  300. package/dist/locales/ca/openhands.json +37 -2
  301. package/dist/locales/de/openhands.json +37 -2
  302. package/dist/locales/en/openhands.json +38 -3
  303. package/dist/locales/es/openhands.json +37 -2
  304. package/dist/locales/fr/openhands.json +37 -2
  305. package/dist/locales/it/openhands.json +37 -2
  306. package/dist/locales/ja/openhands.json +37 -2
  307. package/dist/locales/ko-KR/openhands.json +37 -2
  308. package/dist/locales/no/openhands.json +37 -2
  309. package/dist/locales/pt/openhands.json +37 -2
  310. package/dist/locales/tr/openhands.json +37 -2
  311. package/dist/locales/uk/openhands.json +37 -2
  312. package/dist/locales/zh-CN/openhands.json +37 -2
  313. package/dist/locales/zh-TW/openhands.json +37 -2
  314. package/dist/manifests/automation-interface.cjs +2 -0
  315. package/dist/manifests/automation-interface.cjs.map +1 -0
  316. package/dist/manifests/automation-interface.d.ts +44 -0
  317. package/dist/manifests/automation-interface.js +81 -0
  318. package/dist/manifests/automation-interface.js.map +1 -0
  319. package/dist/manifests/automation-setup.cjs +2 -0
  320. package/dist/manifests/automation-setup.cjs.map +1 -0
  321. package/dist/manifests/automation-setup.d.ts +52 -0
  322. package/dist/manifests/automation-setup.js +8 -0
  323. package/dist/manifests/automation-setup.js.map +1 -0
  324. package/dist/manifests/interface-validation.cjs +2 -0
  325. package/dist/manifests/interface-validation.cjs.map +1 -0
  326. package/dist/manifests/interface-validation.d.ts +27 -0
  327. package/dist/manifests/interface-validation.js +182 -0
  328. package/dist/manifests/interface-validation.js.map +1 -0
  329. package/dist/manifests/manifest-actions.d.ts +15 -0
  330. package/dist/manifests/manifest-capabilities.d.ts +25 -0
  331. package/dist/manifests/manifest-error-map.d.ts +40 -0
  332. package/dist/manifests/manifest-local-validation.d.ts +56 -0
  333. package/dist/manifests/manifest-registry.cjs +2 -0
  334. package/dist/manifests/manifest-registry.cjs.map +1 -0
  335. package/dist/manifests/manifest-registry.d.ts +15 -0
  336. package/dist/manifests/manifest-registry.js +26 -0
  337. package/dist/manifests/manifest-registry.js.map +1 -0
  338. package/dist/manifests/manifest-sources.cjs +2 -0
  339. package/dist/manifests/manifest-sources.cjs.map +1 -0
  340. package/dist/manifests/manifest-sources.d.ts +15 -0
  341. package/dist/manifests/manifest-sources.js +8 -0
  342. package/dist/manifests/manifest-sources.js.map +1 -0
  343. package/dist/manifests/manifest-template.d.ts +18 -0
  344. package/dist/manifests/manifest-validation.cjs +2 -0
  345. package/dist/manifests/manifest-validation.cjs.map +1 -0
  346. package/dist/manifests/manifest-validation.d.ts +30 -0
  347. package/dist/manifests/manifest-validation.js +145 -0
  348. package/dist/manifests/manifest-validation.js.map +1 -0
  349. package/dist/manifests/types.cjs +2 -0
  350. package/dist/manifests/types.cjs.map +1 -0
  351. package/dist/manifests/types.d.ts +227 -0
  352. package/dist/manifests/types.js +6 -0
  353. package/dist/manifests/types.js.map +1 -0
  354. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +9 -0
  355. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -0
  356. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +75 -0
  357. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -0
  358. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +9 -0
  359. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -0
  360. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +78 -0
  361. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -0
  362. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs +17 -0
  363. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs.map +1 -0
  364. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js +89 -0
  365. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js.map +1 -0
  366. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs +10 -0
  367. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs.map +1 -0
  368. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js +17 -0
  369. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js.map +1 -0
  370. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs +9 -0
  371. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs.map +1 -0
  372. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js +15 -0
  373. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js.map +1 -0
  374. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs +9 -0
  375. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs.map +1 -0
  376. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js +18 -0
  377. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js.map +1 -0
  378. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs +9 -0
  379. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs.map +1 -0
  380. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js +14 -0
  381. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js.map +1 -0
  382. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs +9 -0
  383. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs.map +1 -0
  384. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js +14 -0
  385. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js.map +1 -0
  386. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +2 -0
  387. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -0
  388. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +23 -0
  389. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -0
  390. package/dist/node_modules/@openhands/extensions/automations/index.cjs +2 -0
  391. package/dist/node_modules/@openhands/extensions/automations/index.cjs.map +1 -0
  392. package/dist/node_modules/@openhands/extensions/automations/index.js +18 -0
  393. package/dist/node_modules/@openhands/extensions/automations/index.js.map +1 -0
  394. package/dist/node_modules/@openhands/extensions/automations/interface.cjs +2 -0
  395. package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -0
  396. package/dist/node_modules/@openhands/extensions/automations/interface.js +89 -0
  397. package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -0
  398. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  399. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  400. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +3 -3
  401. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  402. package/dist/node_modules/@openhands/extensions/skills/index.cjs +17 -4
  403. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  404. package/dist/node_modules/@openhands/extensions/skills/index.js +5 -5
  405. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  406. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs +2 -0
  407. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs.map +1 -0
  408. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js +29 -0
  409. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js.map +1 -0
  410. package/dist/package.cjs +1 -1
  411. package/dist/package.cjs.map +1 -1
  412. package/dist/package.js +2 -2
  413. package/dist/package.js.map +1 -1
  414. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +2 -19
  415. package/dist/types/agent-server/core/events/observation-event.d.ts +2 -18
  416. package/dist/types/automation.d.ts +7 -3
  417. package/dist/utils/api-error-message.d.ts +6 -2
  418. package/dist/utils/automation-catalog.cjs +2 -0
  419. package/dist/utils/automation-catalog.cjs.map +1 -0
  420. package/dist/utils/automation-catalog.d.ts +28 -0
  421. package/dist/utils/automation-catalog.js +5 -0
  422. package/dist/utils/automation-catalog.js.map +1 -0
  423. package/dist/utils/automation-timeout.d.ts +3 -2
  424. package/dist/utils/responder-deployment.d.ts +5 -1
  425. package/dist/utils/transcript-export/index.cjs +5 -5
  426. package/dist/utils/transcript-export/index.js +12 -12
  427. package/package.json +2 -2
  428. package/scripts/check-translation-completeness.cjs +1 -0
  429. package/scripts/dev-safe.mjs +15 -10
  430. package/scripts/dev-static.mjs +17 -0
  431. package/scripts/dev-with-automation.mjs +12 -14
  432. package/scripts/ingress.mjs +22 -0
  433. package/scripts/proxy-utils.mjs +157 -2
  434. package/scripts/runtime-services-info.mjs +6 -6
  435. package/scripts/static-build.mjs +0 -7
  436. package/scripts/static-server.mjs +10 -0
  437. package/build/assets/active-backend-context-mY7Gff5c.js +0 -2
  438. package/build/assets/agent-context-settings-BTUmWEzL.js +0 -1
  439. package/build/assets/agent-profiles-settings-Ilqid_R5.js +0 -1
  440. package/build/assets/agent-server-conversation-service.api-C_7YnjzP.js +0 -41
  441. package/build/assets/agent-settings-CxfT4ksO.js +0 -1
  442. package/build/assets/automation-BGP_I1RR.js +0 -1
  443. package/build/assets/automation-detail-nEflClmc.js +0 -2
  444. package/build/assets/automation-export-BO_kfqC8.js +0 -2
  445. package/build/assets/automations-list-BYncC7gv.js +0 -1
  446. package/build/assets/backend-form-modal-CKrBF80P.js +0 -1
  447. package/build/assets/browser-3QjrEr1D.js +0 -6
  448. package/build/assets/check-CrxQfJZ2.js +0 -1
  449. package/build/assets/chevron-down-D_LsyTA7.js +0 -1
  450. package/build/assets/circle-check-DZn9HkLE.js +0 -1
  451. package/build/assets/cloud-funnel-analytics-NlmDoeo2.js +0 -1
  452. package/build/assets/command-menu-CvLPs7dg.js +0 -1
  453. package/build/assets/condenser-settings-C4Y9CzQV.js +0 -1
  454. package/build/assets/conversation-D_ORtpKC.js +0 -1
  455. package/build/assets/conversation-Dpc5nmGi.js +0 -90
  456. package/build/assets/conversation-panel-D_ORtpKC.js +0 -1
  457. package/build/assets/conversation-state-store-CGRQemtx.js +0 -1
  458. package/build/assets/files-tab-4c9HFSLo.js +0 -1
  459. package/build/assets/git-provider-icon-0PqmIS_S.js +0 -1
  460. package/build/assets/home-D9JsyEmE.js +0 -1
  461. package/build/assets/home-TFhnmZLx.js +0 -1
  462. package/build/assets/index-home-D9JsyEmE.js +0 -1
  463. package/build/assets/install-server-modal-BgGRnqA0.js +0 -1
  464. package/build/assets/llm-not-configured-banner-Y4W9-sar.js +0 -27
  465. package/build/assets/llm-settings-nPwv7hKu.js +0 -1
  466. package/build/assets/loader-circle-CGD6-Vak.js +0 -1
  467. package/build/assets/manifest-1cf33a7b.js +0 -1
  468. package/build/assets/markdown-renderer-U40HF0Ak.js +0 -8
  469. package/build/assets/mcp-xDMaHzOw.js +0 -9
  470. package/build/assets/messages-CdNfZPgd.js +0 -40
  471. package/build/assets/plus-CTGLo3aa.js +0 -1
  472. package/build/assets/recommended-automations-launcher-Dru1yN46.js +0 -58
  473. package/build/assets/root-B5JXKp1P.css +0 -1
  474. package/build/assets/root-DOLLQteU.js +0 -2
  475. package/build/assets/root-layout-xmylWoew.js +0 -3
  476. package/build/assets/search-BrpWXWUi.js +0 -1
  477. package/build/assets/segmented-toggle-CZKOdIly.js +0 -1
  478. package/build/assets/settings-input-BEaTCem1.js +0 -1
  479. package/build/assets/shared-conversation-BvWtTwES.js +0 -1
  480. package/build/assets/use-agent-profiles-DmT9zxAN.js +0 -1
  481. package/build/assets/use-config-C959QcRC.js +0 -1
  482. package/build/assets/use-is-authed-BsS4XwSL.js +0 -1
  483. package/build/assets/use-llm-profiles-CdaxVpyY.js +0 -1
  484. package/build/assets/use-save-agent-profile-DGJ3-u0M.js +0 -1
  485. package/build/assets/use-settings-nav-items-DPK5sxvR.js +0 -16
  486. package/build/assets/use-tracking-COqZLobY.js +0 -1
  487. package/build/assets/utils-DsWhWn2F.js +0 -1
  488. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-Acmf1sKj.js +0 -1
  489. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js +0 -1
  490. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js +0 -1
  491. package/build/assets/x-Dx_JbpHA.js +0 -1
  492. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js} +0 -0
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-CEK0AIx6.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Bcgpimp9.js","assets/active-backend-context-BiwzkzDy.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js","assets/utils-BgGG1znF.js","assets/use-tracking-BGboadaZ.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js","assets/proxy-BBUG3sd2.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js","assets/llm-settings-CXo8iPNW.js","assets/useMutation-CaSHLnX0.js","assets/useQuery-DiPh8LRJ.js","assets/back-nav-button-D4ngzpSh.js","assets/navigation-link-Bxmn-pCs.js","assets/navigation-context-BOGzIng3.js","assets/form-control-classes-DAfsCJTe.js","assets/copy-DCmZtz6n.js","assets/external-link-BdBSg8rk.js","assets/profiles-service.api-CukSFLzz.js","assets/settings-service.api-CZiPD8__.js","assets/settings-Chfn5xTD.js","assets/llm-subscription-service-DBJbfd8Z.js","assets/llm-subscription-DTqtBCWz.js","assets/use-can-manage-org-profiles-Bt1M71u5.js","assets/organization-service.api-UDy63-oC.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js","assets/dropdown-classes-BB8rzqXL.js","assets/badge-1Mf1iPcX.js","assets/settings-input-B-q2gkVy.js","assets/base-modal-BBuy0WQQ.js","assets/modal-body-CMsDpalT.js","assets/modal-classes-B6PDrxXo.js","assets/modal-backdrop-X-vKo61e.js","assets/brand-button-DGN6Y9o6.js","assets/sdk-section-page-BxMrtUNV.js","assets/switch-skeleton-BQoOhQTB.js","assets/schema-field-nImDoY6-.js","assets/dist-hOnv1nn2.js","assets/settings-dropdown-input-DYCULKpp.js","assets/combobox-caret-Bd2yySnF.js","assets/settings-switch-LqKdGxHL.js","assets/toggle-switch-BeSrbgCg.js","assets/use-is-authed-BT7Iud4U.js","assets/typography-iYhzLlHO.js","assets/use-save-settings-L3aMaDeS.js","assets/use-settings-8nt3DGxW.js","assets/extension-module-card-classes-Bo43vY5V.js","assets/copy-to-clipboard-button-D_Lp6-Fl.js","assets/checkmark-CxdXtM3b.js","assets/copy-z7idLzWO.js","assets/loading-spinner-DfZ_bhV7.js","assets/settings-section-header-context-CnIIQAUn.js","assets/use-llm-profiles-2Wc2db8u.js","assets/u-check-circle-DBEvndTS.js","assets/u-edit-809W9D9T.js","assets/map-provider-CXU6issd.js","assets/settings-list-classes-WpQi0q1L.js","assets/settings-utils-BL_Z9uIe.js","assets/manage-backends-modal-CwyWsiag.js","assets/backend-form-modal-B8D5hBzK.js","assets/chevron-down-CP4QHvyc.js","assets/cloud-funnel-analytics-CEOl5Gxr.js","assets/info-CmWQXtRQ.js","assets/segmented-toggle-Do6oyepX.js","assets/use-onboarding-completion-gxQlcEy2.js","assets/useQueries--d_WWAzc.js","assets/modal-close-button-DyxBZaAb.js","assets/pencil-BjgtZmWp.js","assets/plus-DrKuuvMe.js","assets/refresh-cw-BrM5ZAZD.js","assets/trash-2-wW5TWcdN.js","assets/confirmation-modal-NCUPr2-O.js","assets/use-cloud-current-user-id-DWt7HCgf.js","assets/environment-switch-overlay-BepBBX66.js","assets/environment-switch-store-DVQZLFbj.js","assets/alert-banner-DR8EVyZM.js","assets/vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js","assets/iconBase-B2rQun3J.js","assets/close-CDAVqnTn.js","assets/command-menu-Bj6X4ckE.js","assets/install-server-modal-BWrudmZU.js","assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js","assets/v4-DDdyfk2q.js","assets/secrets-service-Dhjh3HhH.js","assets/styled-tooltip-C7grwnOX.js","assets/mcp-marketplace-utils-DFmhKc5s.js","assets/list-todo-DtiL3lTp.js","assets/search-Dc2qR4O2.js","assets/sidebar-store-Bui-WNEr.js","assets/conversation-store-C6hSXHw0.js","assets/x-omAzpXkl.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,G as c,H as l,I as u,L as d,R 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~d4by102p-C2f0ZhS-.js";import{t as v}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{t as y}from"./useInfiniteQuery-BLRVmVPU.js";import{E as b}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{t as x}from"./useQuery-DiPh8LRJ.js";import{t as S}from"./use-is-creating-conversation-CAggrM75.js";import{At as C,Ht as w,_ as T,bt as E,d as D,dt as O,g as k,i as A,kt as j,l as M,n as N,r as P,u as F,v as I,y as L}from"./active-backend-context-BiwzkzDy.js";import{C as R,S as ee,b as z,t as B,y as V,z as H}from"./utils-BgGG1znF.js";import{h as U}from"./install-server-modal-BWrudmZU.js";import{t as W}from"./check-CPLXgluF.js";import{n as te,t as ne}from"./vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js";import{a as re,l as ie,o as ae,t as oe}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js";import{r as se}from"./onboarding-modal-9BuvvROo.js";import{a as G,c as ce,d as le,i as ue,l as de,n as fe,o as pe,r as me,s as he,t as ge,u as _e}from"./git-provider-icon-BZqqUPlm.js";import{a as ve,c as ye,d as be,f as xe,i as Se,l as Ce,n as we,o as Te,p as Ee,r as De,s as Oe,t as K,u as ke}from"./onboarding-47hh2IHA.js";import{o as Ae,r as q}from"./backend-form-modal-B8D5hBzK.js";import{n as je,t as Me}from"./format-time-delta-CxfPJpzC.js";import{t as Ne}from"./plus-DrKuuvMe.js";import{t as Pe}from"./search-Dc2qR4O2.js";import{n as Fe,r as Ie,t as Le}from"./sidebar-store-Bui-WNEr.js";import{a as Re}from"./llm-settings-CXo8iPNW.js";import{t as ze}from"./trash-2-wW5TWcdN.js";import{t as Be}from"./x-omAzpXkl.js";import{o as Ve}from"./use-onboarding-completion-gxQlcEy2.js";import{t as He}from"./loading-spinner-DfZ_bhV7.js";import{t as Ue}from"./use-config-CxlEdf_v.js";import{n as We,p as Ge,t as Ke,y as qe}from"./use-tracking-BGboadaZ.js";import{n as Je,t as Ye}from"./use-settings-8nt3DGxW.js";import{t as Xe}from"./use-save-settings-L3aMaDeS.js";import{t as Ze}from"./modal-backdrop-X-vKo61e.js";import{n as Qe}from"./modal-body-CMsDpalT.js";import{i as $e,r as et}from"./base-modal-BBuy0WQQ.js";import{_ as tt,c as nt}from"./form-control-classes-DAfsCJTe.js";import{n as rt,t as it}from"./navigation-context-BOGzIng3.js";import{t as at}from"./openhands-logo-CmYvJXBa.js";import{t as ot}from"./navigation-link-Bxmn-pCs.js";import{a as st,d as ct,f as lt,i as ut,l as dt,n as ft,r as pt,u as mt}from"./sidebar-layout-oHBGQmLh.js";import{n as ht,t as gt}from"./sidebar-nav-link-CrujNA09.js";import{t as _t}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js";import{t as vt}from"./styled-tooltip-C7grwnOX.js";import{a as yt,d as bt,f as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,u as Dt}from"./dropdown-classes-BB8rzqXL.js";import{r as Ot,t as kt}from"./combobox-caret-Bd2yySnF.js";import{n as At,t as jt}from"./use-cloud-current-user-id-DWt7HCgf.js";import{s as Mt}from"./environment-switch-store-DVQZLFbj.js";import{d as Nt,f as Pt,l as Ft,t as It}from"./conversation-store-C6hSXHw0.js";import{t as Lt}from"./manage-backends-modal-CwyWsiag.js";import{n as Rt,t as zt}from"./agent-server-conversation-service.api-CYSWw-2g.js";import{c as Bt,d as Vt,u as Ht}from"./acp-providers-C921BlYB.js";import{t as Ut}from"./use-is-authed-BT7Iud4U.js";import{a as Wt,i as Gt,n as Kt,t as qt}from"./conversation-state-store-F62HvuI1.js";import{a as Jt,c as Yt,d as Xt,f as Zt,i as Qt,l as $t,o as en,r as tn,s as nn,t as rn,u as an}from"./sidebar-mobile-menu-toggle-ND-hgygu.js";import{t as on}from"./use-click-outside-element-DKqpqEEm.js";import{t as sn}from"./use-llm-profiles-2Wc2db8u.js";import{n as cn}from"./use-create-conversation-nOJ6Um5h.js";import{r as ln,t as un}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{n as dn,t as J}from"./context-menu-list-item-CrCrYuPF.js";import{a as fn,i as pn,n as mn}from"./use-can-manage-org-profiles-Bt1M71u5.js";import{t as hn}from"./u-edit-809W9D9T.js";import{t as gn}from"./skills-CYFLsN5U.js";import{c as _n,i as vn,n as yn,r as bn,s as xn,t as Sn}from"./home-store-Ch1ErdBc.js";import{t as Cn}from"./search-7DRiGm4Z.js";import{t as wn}from"./use-user-conversation-BIIpGUgM.js";var Tn=b(`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`}]]),En=b(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Dn=b(`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`}]]),On=b(`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`}]]),kn=b(`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`}]]),An=b(`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`}]]),jn=b(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Mn=b(`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`}]]),Nn=b(`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`}]]),Pn=b(`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`}]]),Fn=b(`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`}]]),In=b(`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(),Ln=46,Rn=30;function zn({className:e,logoClassName:t,logoWidth:n=Ln,logoHeight:r=Rn}={}){let{t:i}=v(`openhands`);return(0,X.jsx)(ot,{to:`/conversations`,"aria-label":i(H.BRANDING$OPENHANDS_LOGO),className:B(e),children:(0,X.jsx)(at,{width:n,height:r,className:B(`shrink-0`,t)})})}function Bn(){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 Vn({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)(Be,{size:14})})}function Hn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:B(Ot,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(kt,{})})}function Un({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:B(`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:B(`p-0`,St)}),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:B(Tt,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:Dt,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)(_e,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Wn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:B(`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`,nt,`px-0 not-italic text-inherit`)})})}var Gn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Kn({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:k,getItemProps:A,getInputProps:j}=_t({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===_t.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(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:B(`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`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:Gn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Gn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:B(xt,g?`w-auto`:`w-full`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,X.jsx)(Wn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(Bn,{}),n&&w&&(0,X.jsx)(Vn,{onClear:()=>T(null)}),(0,X.jsx)(Hn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(Un,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var qn=t({AddBackendModal:()=>Jn});function Jn({onClose:e}){return(0,X.jsx)(q,{mode:`add`,onClose:e})}var Yn=`::`;function Xn(e,t){return t?`${e}${Yn}${t}`:e}function Zn(e){let[t,n]=e.split(Yn);return{backendId:t,orgId:n??null}}function Qn(e){return(0,X.jsx)(Ae,{isConnected:e?.isConnected??null})}function $n(){return(0,X.jsx)(Ae,{isConnected:`unavailable`})}function er(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:Xn(e.id,null),label:e.name,prefix:Qn(i[e.id])});for(let e of s){let o=n[e.id],s=Qn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Xn(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:Xn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function tr({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:l,setActive:u}=P(),f=At(),p=jt(),m=Ve(c),h=_(),g=d(`/settings`),y=d(`/settings/*`),b=d(`/conversations/:conversationId`),x=d(`/automations/:automationId`),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),D=s(H.BACKEND$PERSONAL_WORKSPACE),k=Y.useMemo(()=>er(c,D,f,p,m),[c,D,f,p,m]),A=O(l.backend),j=s(H.BACKEND$NO_BACKEND_AVAILABLE),M=Xn(l.backend.id,l.orgId),N=A?void 0:k.find(e=>e.value===M),F=!!(g||y),I=s(H.SIDEBAR$SETTINGS),L=It(e=>e.isRightPanelShown),R=!o||b&&L?`top`:`left`,ee=Object.values(f).some(e=>e.isLoading);Y.useEffect(()=>{if(A||l.backend.kind!==`cloud`||l.orgId)return;let{backend:e}=l,t=f[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=p[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&u(e.id,a.id)},[l,f,p,u,A]);let z=Y.useCallback(()=>{if(i){i(),r?.();return}C(!0)},[i,r]),V=Y.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),U=E()!==null,W=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=Y.useCallback(e=>{W(e),z()},[z,W]),ne=Y.useCallback(e=>{W(e),z()},[z,W]),re=Y.useCallback(e=>{W(e),V()},[V,W]),ie=Y.useCallback(e=>{W(e),V()},[V,W]),ae=(0,X.jsxs)(`div`,{className:St,children:[U?null:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:W,onTouchStart:W,onTouchEnd:ne,onClick:te,className:B(wt,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:Dt,"aria-hidden":!0,children:(0,X.jsx)(Ne,{width:16,height:16})}),s(H.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:W,onTouchStart:W,onTouchEnd:ie,onClick:re,className:B(wt,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:Dt,"aria-hidden":!0,children:(0,X.jsx)(Ie,{width:16,height:16})}),s(U?H.BACKEND$RECONNECT_CLOUD:H.BACKEND$MANAGE)]})]}),oe=Y.useCallback(async e=>{if(e===M)return;let{backendId:t,orgId:n}=Zn(e),i=c.find(e=>e.id===t);i&&(Mt(k.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),b?h(`/conversations`):x&&h(`/automations`),u(i.id,n),r?.())},[M,c,b,x,h,k,u,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)(Kn,{testId:`backend-selector`,defaultValue:N??{value:M,label:A?j:l.backend.name,prefix:A?$n():Qn(m[l.backend.id])},footer:ae,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&oe(e.value)},placeholder:A?j:l.backend.name,loading:ee,options:k,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`},`${M}-${N?.label??``}`)}),t?null:(0,X.jsx)(vt,{content:I,placement:R,offset:10,children:(0,X.jsx)(ot,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":F,"aria-label":I,className:B(F?`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`,tt),children:(0,X.jsx)(Ie,{width:16,height:16})})})]}),S?(0,X.jsx)(Jn,{onClose:()=>C(!1)}):null,w?(0,X.jsx)(Lt,{onClose:()=>T(!1)}):null]})}var nr=`command-menu-trigger`,rr=18;function ir({collapsed:e}){let{t}=v(`openhands`),n=Fe(e=>e.open),r=t(H.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":nr,"aria-label":r,onClick:n,className:B(lt({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)(ht,{active:!1,children:(0,X.jsx)(Pe,{width:rr,height:rr})}):(0,X.jsx)(`span`,{className:B(st,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(Pe,{width:rr,height:rr})}),(0,X.jsx)(`span`,{className:mt(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(H.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(vt,{content:r,placement:`right`,children:i}):i}var ar=(e=20)=>{let{data:t}=Ut(),n=N(),r=!O(n.backend);return y({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await zt.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},or=(e=10)=>x({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function sr({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=v(`openhands`);return(0,X.jsx)(Ze,{onClose:n,children:(0,X.jsxs)(Qe,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(et,{title:r(H.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)($e,{text:r(H.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)($e,{text:r(H.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function cr({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:B(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var lr=e=>{switch(e){case R.FINISHED:return`check`;case R.RUNNING:return`working`;case R.IDLE:case R.WAITING_FOR_CONFIRMATION:return`active`;case R.PAUSED:return`paused`;case R.ERROR:case R.STUCK:return`error`;default:return`unknown`}},ur=(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 dr(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 fr({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=v(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:lr(e),o=r(ur(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)(un,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):dr(a)});return n?(0,X.jsx)(vt,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function pr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=he(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)(fr,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(cr,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var mr=e(r(),1);function hr({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}=N(),m=on(e,d),h=p.kind===`cloud`?H.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:H.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)(_e,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(dn,{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)(J,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(hn,{width:16,height:16}),text:f(H.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(J,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(pe,{width:16,height:16}),text:f(H.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(J,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(gn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(H.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(J,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(G,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(J,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(Yt,{width:16,height:16}),text:f(H.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(J,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(Yt,{width:16,height:16}),text:f(H.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(J,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(nn,{width:16,height:16}),text:f(H.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(J,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(fn,{icon:(0,X.jsx)(pn,{width:16,height:16}),text:f(H.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function gr({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ee(s),d=z(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)(mn,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:B(u&&`opacity-60`)}),e&&m&&h?(0,mr.createPortal)((0,X.jsx)(hr,{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 _r(e){return e?e.split(`/`).pop()||e:null}var vr={bitbucket:oe,bitbucket_data_center:oe,github:re,gitlab:ae};function yr({selectedRepository:e}){let t=e.git_provider?vr[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)(ue,{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)(ln,{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 br({workspaceWorkingDir:e}){let{t}=v(`openhands`),n=e?Kt(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)(Gt,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(H.COMMON$NO_REPOSITORY)})]})}function xr({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=ee(r),h=null;if(c)if(l===`acp`){let e=Bt(u)??p(H.CONVERSATION$ACP_AGENT_GENERIC),t=Ht(u,s),n=t??e;h={kind:Vt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(h={kind:`openhands`,text:_r(s)??s,tooltip:s});let g=r===void 0?void 0:`pl-[26px]`,_=f?Rt(d):[],y=_.slice(0,3),b=_.slice(3);return(0,X.jsxs)(`div`,{className:B(`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)(se,{kind:h.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:h.text})]})}):null,_.length>0?(0,X.jsxs)(`div`,{className:B(`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:B(`flex flex-row items-center gap-2 w-full min-w-0`,a&&g),children:[a&&(e?.selected_repository?(0,X.jsx)(yr,{selectedRepository:e}):(0,X.jsx)(br,{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:`${Me(t??n)} ${p(H.CONVERSATION$AGO)}`})})})]})]})}function Sr(){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)(me,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(H.COMMON$ERROR)})]})}function Cr({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}=Ke(),[k,A]=Y.useState(`view`),{mutateAsync:j}=fe(),M=e=>{e!==``&&e!==a&&r?.(e),A(`view`)},N=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},F=e=>{e.preventDefault(),e.stopPropagation(),A(`edit`),p?.(!1)},I=async e=>{if(e.preventDefault(),e.stopPropagation(),O(),l)try{let e=await Wt.getVSCodeUrl(l);if(e.vscode_url){let t=$t(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},L=async e=>{e.preventDefault(),e.stopPropagation(),l&&await j(l),p?.(!1)},R=e=>{e.preventDefault(),e.stopPropagation(),T?.()},ee=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":w,"aria-label":D(w?H.CONVERSATION_PANEL$UNPIN_CONVERSATION:H.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:R,className:B(`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)(Nn,{className:B(`h-3.5 w-3.5`,w&&`fill-current`),"aria-hidden":!0})}),z=!!(t||r||i),V=z||!!T,U=E&&w&&!!T,W=g||y&&(b===`acp`||!!_)||C&&Rt(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:B(`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)(pr,{title:a,titleMode:k,onTitleSave:M,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Sr,{})]}),(0,X.jsxs)(`div`,{className:B(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,U?`min-w-[3.75rem]`:V&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!U&&(c??s)&&(0,X.jsx)(`p`,{className:B(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,V&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Me(s??c)})}),V?(0,X.jsxs)(`div`,{className:B(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,U?`pointer-events-auto visible opacity-100`:B(`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?ee():null,U&&(c??s)&&z?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:B(!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)(gr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:L,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:B(`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:Me(s??c)})})]}):null,!U&&z?(0,X.jsx)(gr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:L,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),W&&(0,X.jsx)(xr,{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 wr={bitbucket:oe,bitbucket_data_center:oe,github:re,gitlab:ae};function Tr({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 Er({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?wr[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)(fr,{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)(Tr,{label:s(H.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)(ue,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(Tr,{label:s(H.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(ln,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(Tr,{label:s(H.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(Ee,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(Tr,{label:s(H.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(Tr,{label:s(H.CONVERSATION$CREATED),children:f}):null]})]})}function Dr({taskStatus:e}){return(0,X.jsx)(`div`,{className:B(`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 Or({taskStatus:e}){let{t}=v(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:B(`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(V(e))})}function kr({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)(Dr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Or,{taskStatus:t})]})}function Ar({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=v(`openhands`);return(0,X.jsxs)(`div`,{className:B(`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)(yr,{selectedRepository:e}):(0,X.jsx)(br,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Me(t)} ${r(H.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function jr({task:e,onClick:t}){let{t:n}=v(`openhands`),r=e.request.title||e.detail||n(H.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:B(`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)(kr,{title:r,taskStatus:e.status})}),(0,X.jsx)(Ar,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function Mr({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 Nr({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)(fr,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||y(H.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(xr,{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)(ot,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>B(`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)(fr,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var Pr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showTagsMetadata:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=Pt()(Nt(e=>({...Pr,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:Ft(()=>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})})),Fr=`px-2 pb-1 pt-1`,Ir=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Lr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:B(Fr,Ir),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:B(`flex items-baseline justify-between gap-2`,Fr),children:[(0,X.jsx)(`span`,{className:B(`min-w-0 truncate text-left`,Ir),children:e}),t]})}function Rr(){return(0,X.jsx)(_e,{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:B(`group`,Tt,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:B(`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)(W,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var zr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Br({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`?H.CONVERSATION_PANEL$BY_WORKSPACE:H.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(H.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:B(`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)]`,Et),children:(0,X.jsx)(jn,{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(H.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:B(`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`,St,bt),children:[(0,X.jsx)(Lr,{children:C(H.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:Ee,label:w,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:En,label:C(H.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Rr,{}),(0,X.jsx)(Lr,{children:C(H.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:Tn,label:C(H.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:Dn,label:C(H.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Rr,{}),(0,X.jsx)(Lr,{children:C(H.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:Mn,label:C(H.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:Fn,label:C(H.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Rr,{}),(0,X.jsx)(Lr,{children:C(H.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:U,label:C(H.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:xe,label:C(H.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:In,label:C(H.CONVERSATION_PANEL$TAGS),selected:g,testId:`toggle-tags-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Q,{icon:je,label:C(H.CONVERSATION_PANEL$HOVER_METADATA),selected:y,testId:`toggle-hover-metadata`,onClick:()=>{b(),t(!1)}}),(0,X.jsx)(Rr,{}),(0,X.jsx)(Lr,{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(H.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:C(H.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?On:kn,label:zr(C(u?H.CONVERSATION$HIDE:H.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Rr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ze,label:zr(C(H.CONVERSATION$DELETE_ALL)),disabled:x===0,onClick:()=>{x!==0&&(S(),t(!1))}})]}):null]})}var Vr=B(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,yt);function Hr(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 Ur({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=rt(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Hr(u,{open:s,enabled:i}),{data:f,error:p}=Oe(),m=f?.workspaceParents??[],{mutate:h}=Ce(),{mutate:g}=ke(),{mutate:_}=ye(),{mutate:y}=be(),{workspaces:b}=Te(),x=ve(p,a),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),{mutate:D,isPending:O}=cn(),k=S(),A=O||k;Y.useEffect(()=>{if(!s||C||T)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,C,T]),Y.useEffect(()=>{if(!s||C||T)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,C,T]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=Tt,N=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!x,L=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&w(!0)},className:M,children:a(H.HOME$ADD_WORKSPACES)}),ee=x?(0,X.jsx)(vt,{content:x,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:P,"aria-expanded":s,"aria-haspopup":`menu`,disabled:A})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(Vr,!i&&B(`absolute top-full mt-0`,n)),style:L,children:[(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,St),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:A,"data-testid":`launch-no-workspace`,onClick:()=>j(),className:M,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(H.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:A,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>j(e.path),className:M,children:[(0,X.jsx)(`span`,{className:Dt,"aria-hidden":!0,children:(0,X.jsx)(_n,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:B(`flex flex-col`,St),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(_e,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),ee,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(!0)},className:M,children:a(H.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(Se,{isOpen:C,onClose:()=>w(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(De,{isOpen:T,workspaces:b,workspaceParents:m,onClose:()=>E(!1),onRemove:e=>g(e),onRemoveParent:e=>y(e)})]})}function Wr({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:Dt,"aria-hidden":!0,children:(0,X.jsx)(_n,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Gr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=rt(),{providers:s}=xn(),{lastSelectedProvider:c,setLastSelectedProvider:l}=Sn(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Hr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,y]=Y.useState(``),b=yn(_,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:C,isError:w,hasNextPage:T,isFetchingNextPage:E,fetchNextPage:D}=vn({provider:h}),{data:O,isLoading:k}=bn(b,h),A=Y.useMemo(()=>x?.pages.flatMap(e=>e.items)??[],[x]),j=b?O??[]:A,{mutate:M,isPending:N}=cn(),P=S(),F=N||P;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 I=e=>{F||M({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}`)}})},L=e=>{g(e),l(e),y(``)},R=Tt;Y.useEffect(()=>{u&&(b||!T||E||C||j.length===0||j.length>=10||D())},[u,b,T,E,C,j.length,D]);let ee=b?k:C,z=!b&&T&&j.length>0,V=Y.useCallback(()=>{d(e=>!e)},[]),U=u&&(!i||m!==null),W=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:V,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),U&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(Vr,!i&&B(`absolute top-full mt-0`,n)),style:W,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:()=>L(e),className:B(`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)(ge,{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)(Cn,{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(H.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:B(`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)(_e,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,St),children:[ee&&j.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(H.HOME$LOADING_REPOSITORIES)}),w&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(H.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!ee&&!w&&j.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(H.GITHUB$NO_RESULTS)}),j.map(e=>(0,X.jsx)(Wr,{repo:e,disabled:F,onSelect:I,itemClass:R},`${e.git_provider}:${e.id}`)),z&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:E,onClick:()=>D(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(E?H.HOME$LOADING_MORE_REPOSITORIES:H.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Kr=B(`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 qr({backendKind:e}){let{t}=v(`openhands`),n=t(H.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(An,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(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:Kr,"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)(Gr,{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:Kr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Jr(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 Yr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Xr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function Zr(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 Qr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function $r(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Qr(t[n])-Qr(e[n]))}function ei(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 ti(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 ni(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?ei(n):ti(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=$r(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:Zr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Qr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function ri(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 ii(e,t,n,r,i=`after`){if(n===r)return[...e];let a=ri(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 ai({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}=Jr(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(ne.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:B(`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:B(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:B(`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?H.CONVERSATION_PANEL$COLLAPSE_FOLDER:H.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:B(`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)(Ee,{className:B(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(le,{className:B(`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:B(`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":_(H.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)(Ne,{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?H.CONVERSATION_PANEL$LESS:H.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function oi({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(ii(n,t,p,e,i)),w(),C()},[p,n,t,w,r,C]);return(0,X.jsx)(`nav`,{"aria-label":f(H.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(ai,{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 si({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=v(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Jr(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:B(`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)(Nn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(H.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?H.CONVERSATION_PANEL$LESS:H.CONVERSATION_PANEL$MORE)})}):null]})}var ci={pinsByBackendId:{}};function li(e,t){return e[t]??[]}var ui=Pt()(Nt((e,t)=>({...ci,pinConversation:(n,r)=>{let i=li(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=li(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{li(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=li(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:Ft(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),di=()=>{},fi=[],pi=3600*1e3,mi=e=>{let t=Date.now()-pi,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 hi({onClose:e,compact:t=!1}){let{t:n}=v(`openhands`),{conversationId:r,navigate:a}=rt(),{backend:o}=N(),s=on(e??di),[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),w=Z(e=>e.toggleShowLlmProfiles),T=Z(e=>e.showTagsMetadata),E=Z(e=>e.toggleShowTagsMetadata),D=Z(e=>e.showHoverMetadata),O=Z(e=>e.toggleShowHoverMetadata),k=Z(e=>e.organizeMode),A=Z(e=>e.setOrganizeMode),M=Z(e=>e.conversationSort),P=Z(e=>e.setConversationSort),F=Z(e=>e.threadScope),I=Z(e=>e.setThreadScope),L=Z(e=>e.groupFolderOrder),R=Z(e=>e.setGroupFolderOrder),[ee,V]=Y.useState(!1),[U,W]=Y.useState(!1),te=on(()=>{V(!1)}),[ne,re]=Y.useState(()=>new Set),[ie,ae]=Y.useState(()=>new Set),[oe,se]=Y.useState(!1),G=ui(e=>e.pinsByBackendId[o.id]??fi),le=ui(e=>e.togglePin),ue=ui(e=>e.pruneMissingConversations),fe=Y.useCallback(e=>{re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),pe=Y.useCallback(e=>{ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{k!==`grouped`&&(re(new Set),ae(new Set))},[k]);let me=Y.useRef(null),[he,ge]=Y.useState(null),[_e,ve]=Y.useState(null),[ye,be]=Y.useState(null),{data:xe,isLoading:Se,isFetched:Ce,hasNextPage:we,isFetching:Te,isFetchingNextPage:Ee,fetchNextPage:De}=ar(),{data:Oe}=or(),K=Y.useMemo(()=>{let e=xe?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[xe]),ke=Y.useMemo(()=>Yr(G,K),[K,G]);Y.useEffect(()=>{Ce&&ue(o.id,K.map(e=>e.id))},[o.id,K,Ce,ue]),Y.useEffect(()=>{G.length===0&&se(!1)},[G.length]);let Ae=Y.useMemo(()=>{let e=F===`relevant`?K.filter(e=>z(e.execution_status)):K;return t?e:Xr(e,G)},[t,K,G,F]),{recent:q,older:je}=Y.useMemo(()=>mi(Ae),[Ae]),Me=Y.useMemo(()=>$r(g?[...q,...je]:q,M),[q,je,g,M]),Ne=Y.useMemo(()=>({emptyWorkspace:n(H.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(H.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),Pe=Y.useMemo(()=>t||k!==`grouped`?null:ni([...q,...g?je:[]],o.kind,M,Ne),[o.kind,t,M,Ne,je,k,q,g]),Fe=Y.useMemo(()=>Pe?ri(Pe,L):null,[Pe,L]),Ie=Y.useMemo(()=>Pe?.map(e=>e.id)??[],[Pe]),Le=Y.useMemo(()=>$r(q.filter(e=>z(e.execution_status)),M),[M,q]),Re=Me.length,ze=Y.useMemo(()=>Fe?Fe.reduce((e,t)=>e+t.conversations.length,0):0,[Fe]),Be=k===`grouped`&&!t?ze===0:Re===0,Ve=k===`grouped`&&!t?ze:Re,[He,Ue]=Y.useState(null),We=Y.useRef(Ve);We.current=Ve;let Ge=Y.useCallback(()=>{we&&Ue(We.current)},[we]);Y.useEffect(()=>{if(He!==null){if(Ve>He){Ue(null);return}if(!we){Ue(null);return}Te||Ee||De()}},[He,Ve,we,Te,Ee,De]);let Ke=He!==null||Ee,{mutate:qe,mutateAsync:Je}=de(),{mutate:Ye}=ce(),{mutate:Xe}=an(),Ze=je.length>0&&!g,Qe=!!we&&!Ze&&!t&&!Be,{mutate:$e}=cn(),et=S(),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),ge(e),ve(t)},[]),it=Y.useCallback(e=>{d(!0),ge(e)},[]),at=Y.useCallback((e,t)=>{Xe({conversationId:e,newTitle:t},{onSuccess:()=>{C(n(H.CONVERSATION$TITLE_UPDATED))}})},[n,Xe]),st=()=>{he&&qe({conversationId:he},{onSuccess:()=>{he===r&&a(`/conversations`)}})},ct=()=>{he&&Ye({conversationId:he})},lt=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&&j(`${i} conversation${i===1?``:`s`} could not be deleted.`)},ut=Y.useCallback((n,a)=>{let s=G.includes(n.id);return t?(0,X.jsx)(Nr,{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:T},n.id):(0,X.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!D||ye===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)(Er,{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)(ot,{to:`/conversations/${n.id}`,onClick:e,className:B(`block rounded-md transition-colors`,ye!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||ye===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(Cr,{onDelete:()=>nt(n.id,n.title??``),onStop:()=>it(n.id),onChangeTitle:e=>at(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:ye===n.id,onContextMenuToggle:e=>be(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:T,isPinned:s,onTogglePin:()=>le(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,r,at,nt,it,e,ye,G,y,x,T,D,le]),dt=Se||!Ce,ft=!t&&!dt&&ke.length>0,pt=Ce&&!Se&&!t&&Be&&!ft&&!Oe?.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:B(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,U?`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(H.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(qr,{backendKind:o.kind}),(0,X.jsx)(Br,{filterMenuOpen:ee,setFilterMenuOpen:V,menuRef:te,backendKind:o.kind,organizeMode:k,setOrganizeMode:A,conversationSort:M,setConversationSort:P,threadScope:F,setThreadScope:I,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:y,toggleShowRepoBranchMetadata:b,showLlmProfiles:x,toggleShowLlmProfiles:w,showTagsMetadata:T,toggleShowTagsMetadata:E,showHoverMetadata:D,toggleShowHoverMetadata:O,totalConversationsCount:K.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:me,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{W(e.currentTarget.scrollTop>0)},className:B(`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:[dt&&(0,X.jsx)(Mr,{compact:t}),!t&&pt&&(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(H.CONVERSATION$NO_CONVERSATIONS)})}),ft?(0,X.jsx)(si,{pinnedConversations:ke,isPreviewExpanded:oe,onTogglePreviewExpanded:()=>se(e=>!e),activeConversationId:r,showDivider:!t&&k===`chronological`,renderConversationCard:e=>ut(e,{inPinnedSection:!0})}):null,!t&&Oe?.map(t=>(0,X.jsx)(ot,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(jr,{task:t})},t.id)),!dt&&t?Le.map(e=>ut(e)):null,!dt&&!t&&k===`grouped`&&Fe&&Fe.length>0?(0,X.jsx)(oi,{groups:Fe,groupIds:Ie,groupFolderOrder:L,setGroupFolderOrder:R,collapsedGroupIds:ne,expandedGroupPreviewIds:ie,onToggleGroupCollapsed:fe,onToggleGroupPreviewExpanded:pe,isCreatingConversationFlow:et,activeConversationId:r,onLaunchFromGroup:tt,renderConversationCard:e=>ut(e)}):null,!dt&&!t&&k===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Me.map(e=>ut(e))}):null,Qe&&(Ke?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(Mr,{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:Ge,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(H.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(Zt,{onConfirm:()=>{st(),l(!1),ve(null)},onCancel:()=>{l(!1),ve(null)},conversationTitle:_e??void 0}),m&&(0,X.jsx)(Zt,{title:n(H.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(H.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:K.length}),onConfirm:async()=>{await lt(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)(Xt,{onConfirm:()=>{ct(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(sr,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function gi({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)(hi,{})})})}var _i=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,vi=34,yi=Math.round(vi*30/46);function bi({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:dt(e),children:[(0,X.jsxs)(`div`,{className:B(e&&t?ft:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:B(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)(zn,{logoWidth:vi,logoHeight:yi,logoClassName:`max-w-none`,className:B(st,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:B(pt,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(ie,{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:B(`hidden md:inline-flex ml-auto`,ut,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(te,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(H.SIDEBAR$CLOSE_MENU),className:B(`inline-flex ml-auto`,ut,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(te,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:ct(e),children:[(0,X.jsx)(ir,{collapsed:e}),(0,X.jsx)(gt,{to:`/conversations`,end:!0,label:_(H.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(Ne,{width:$,height:$})}),(0,X.jsx)(gt,{to:`/customize`,label:_(H.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)(gt,{to:Ge(),label:qe().sidebarLabel??_(H.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(_i,{width:$,height:$})})]}),(0,X.jsx)(gi,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:B(ct(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(vt,{content:_(H.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(ot,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(H.SIDEBAR$SETTINGS),className:lt({collapsed:!0}),children:[(0,X.jsx)(ht,{active:l.startsWith(`/settings`),children:(0,X.jsx)(Ie,{width:$,height:$})}),(0,X.jsx)(`span`,{className:mt(!0),children:_(H.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":_(H.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:B(lt({collapsed:!0}),`relative`),children:[(0,X.jsx)(ht,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(Ae,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(Pn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:mt(!0),children:_(H.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)(tr,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:B(`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)(tr,{sidebarCollapsed:e,openUpward:!0})})]})}var xi=Y.lazy(()=>a(()=>import(`./settings-modal-CEK0AIx6.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,60]))),Si=Y.lazy(()=>a(()=>Promise.resolve().then(()=>qn).then(e=>({default:e.AddBackendModal})),void 0)),Ci=Y.lazy(()=>a(()=>import(`./manage-backends-modal-CwyWsiag.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([61,1,2,3,4,5,6,7,11,14,62,8,9,10,63,64,65,66,67,28,68,27,36,18,31,35,33,69,17,34,70,71,72,73,74,75]))),wi=250;function Ti(){let{t:e}=v(`openhands`),{currentPath:t}=rt(),{data:n}=Ue(),{data:r,error:i,isError:a,isFetching:o}=Je(),{backends:s,active:c}=P(),l=Ve(s)[c.backend.id],u=Le(e=>e.collapsed),d=Le(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}=en(),[O,k]=Y.useState(!1),[A,M]=Y.useState(!1),N=on(()=>h(!1)),F=Ye(i);Y.useEffect(()=>{D()},[t,D]),Y.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{k(!1)},wi);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&&F!==404?j(e(H.SETTINGS$FETCH_ERROR)):F===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,F,n?.feature_flags?.hide_llm_settings,e]);let I=e(u?H.SIDEBAR$EXPAND:H.SIDEBAR$COLLAPSE),L=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]),R={collapseToggleLabel:I,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:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>y(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(H.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:L,onMouseEnter:()=>{u&&C(!0)},onMouseLeave:()=>{C(!1)},className:B(`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)(bi,{collapsed:u,showCollapseToggle:!0,...R})}),O?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:B(`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:`${wi}ms`},onClick:D,"aria-hidden":!A}),(0,X.jsx)(`aside`,{"aria-label":e(H.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:B(`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:`${wi}ms`},children:(0,X.jsx)(bi,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(xi,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Si,{onClose:()=>y(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Ci,{onClose:()=>x(!1)})})]})}var Ei=`/settings`,Di=`/customize`,Oi=[`/skills`,`/mcp`,`/plugins`];function ki(e){return e===Ei?{mode:`menu`}:e.startsWith(`${Ei}/`)&&e.length>9?{mode:`back`,backTo:Ei,backLabelKey:H.SETTINGS$TITLE}:e===Di?{mode:`menu`}:Oi.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Di,backLabelKey:H.NAV$CUSTOMIZE}:{mode:`menu`}}function Ai(){let{t:e}=v(`openhands`),{currentPath:t,navigate:n}=rt(),r=ki(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(H.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(rn,{}),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??H.COMMON$BACK),className:tn,children:(0,X.jsx)(te,{size:20,className:Qt,"aria-hidden":!0,strokeWidth:2})}):null]})}function ji(){let{backend:e}=N(),t=e.kind===`local`,{data:n}=sn(),{mutate:r,isPending:i}=Re(),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 Mi=()=>{let{backend:e}=N(),{data:t}=Je(),{mutate:n,isPending:r}=Xe(`personal`,{retry:2}),i=Y.useSyncExternalStore(L,M,()=>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`&&A(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&&T(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function Ni(){let{backend:e}=N(),t=Y.useSyncExternalStore(L,D,()=>`pending`),n=Y.useRef(null);Y.useEffect(()=>{let r=t===`pending`?F():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,We.syncTelemetryConsent(i).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Pi=`agent_canvas_cloud_cookie_backend_added`,Fi=new Set;function Ii(e,t){return`${Pi}:${e}:${t}`}function Li(e,t){let n=Ii(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||Fi.has(n)}catch{return Fi.has(n)}}function Ri(e,t){let n=Ii(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{Fi.add(n)}}var zi=()=>{let{backend:e,orgId:t}=N(),{data:n}=Je(),{trackBackendAdded:r}=Ke(),i=Y.useRef(r),a=jt(),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`){k(null);return}if(!s){if(!c){k(null),I(null);return}k({userId:c,email:l,orgId:t}),I(c,l?{email:l}:{}),e.authMode===`cookie`&&l&&!Li(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),Ri(e.id,c))}},[e.authMode,e.connectionRevision,e.id,e.kind,l,s,t,c])};function Bi(e){switch(e){case R.RUNNING:return`🟢`;case R.FINISHED:case R.IDLE:case R.WAITING_FOR_CONFIRMATION:return`✅`;case R.PAUSED:return`⚪`;case R.ERROR:case R.STUCK:return`🔴`;default:return null}}var Vi=`OpenHands`,Hi=()=>{let{conversationId:e}=p(),{data:t}=wn(e??null),n=qt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Vi}`:Vi;if(!e)return i;let a=Bi(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Ui({children:e}){let{pathname:t}=u(),n=_(),r=s(),i=f(),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)(it,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Wi=Y.lazy(()=>a(()=>import(`./environment-switch-overlay-BepBBX66.js`),__vite__mapDeps([76,1,2,11,5,6,77,7]))),Gi=Y.lazy(()=>a(()=>import(`./alert-banner-DR8EVyZM.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([78,1,2,11,5,6,79,80,4,81,7,17,82,46,40]))),Ki=Y.lazy(()=>a(()=>import(`./command-menu-Bj6X4ckE.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([83,1,2,8,3,4,5,6,7,9,10,11,84,85,13,86,87,22,23,36,18,31,88,35,69,48,14,89,34,90,91,92,93,94,17]))),qi=c(function(){let e=l(),{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(H.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(H.ERROR$UNKNOWN)})})}),Ji=m(function(){let e=u(),t=Hi(),{data:n}=Je(),r=Ue();if(Ni(),Mi(),zi(),ji(),Y.useEffect(()=>{n?.language&&w.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)(He,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=we(e.search);return(0,X.jsx)(Ui,{children:(0,X.jsxs)(Jt,{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)(Ti,{}),(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)(Ai,{}),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)(Gi,{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)(Wi,{}),(0,X.jsx)(Ki,{})]}),a?(0,X.jsx)(K,{}):null]})})});export{qi as ErrorBoundary,Ji 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}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
+ 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~gy8zbn65-CGt6bWRT.js";import{t as i}from"./useQuery-DiPh8LRJ.js";import{dt as a,n as o}from"./active-backend-context-BiwzkzDy.js";import{t as s}from"./utils-BgGG1znF.js";import{t as c}from"./settings-service.api-CZiPD8__.js";import{h as l,l as u}from"./form-control-classes-DAfsCJTe.js";import{t as d}from"./dist-hOnv1nn2.js";import{n as f,t as p}from"./settings-input-B-q2gkVy.js";import{a as m,i as h,n as ee}from"./llm-subscription-DTqtBCWz.js";import{t as te}from"./use-is-authed-BT7Iud4U.js";import{t as ne}from"./settings-dropdown-input-DYCULKpp.js";import{r as g}from"./typography-iYhzLlHO.js";import{t as _}from"./settings-switch-LqKdGxHL.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-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};
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~gy8zbn65-CGt6bWRT.js";import{k as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{At as a,Nt as o,kt as s}from"./active-backend-context-BiwzkzDy.js";import{t as c,z as l}from"./utils-BgGG1znF.js";import{n as ee}from"./use-settings-8nt3DGxW.js";import{t as te}from"./use-save-settings-L3aMaDeS.js";import{_ as u}from"./form-control-classes-DAfsCJTe.js";import{t as ne}from"./brand-button-DGN6Y9o6.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-nImDoY6-.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=>{s(o(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){s(e instanceof Error?e.message:w(l.ERROR$GENERIC));return}Object.keys(e).length!==0&&Ce(e,{onError:ke,onSuccess:()=>{xe||a(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~b0bpqexo-CbTboogo.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};
@@ -1 +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
+ 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~b0bpqexo-CbTboogo.js";import{$ as n,X as r,ct as i}from"./active-backend-context-BiwzkzDy.js";import{t as a}from"./proxy-BBUG3sd2.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(n()).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,r,a){if(i().backend.kind===`cloud`){await u({name:e,value:r,description:a});return}await o(()=>new t(n()).upsertSecret({name:e,value:r,description:a}))}static async updateSecret(e,r,a,s){if(i().backend.kind===`cloud`){await u({name:r,value:s,description:a,previousName:e});return}let c=new t(n()),l=s??await o(()=>c.getSecret(e));await o(()=>c.upsertSecret({name:r,value:l,description:a})),r!==e&&await this.deleteSecret(e)}static async deleteSecret(e){try{if(i().backend.kind===`cloud`){await o(()=>d(e));return}await o(()=>new t(n()).deleteSecret(e))}catch(e){if(r(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-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
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{W as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js";import{n as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{t as o}from"./useMutation-CaSHLnX0.js";import{t as s,z as c}from"./utils-BgGG1znF.js";import{t as l}from"./back-nav-button-D4ngzpSh.js";import{t as u}from"./pencil-BjgtZmWp.js";import{t as d}from"./trash-2-wW5TWcdN.js";import{t as f}from"./loading-spinner-DfZ_bhV7.js";import{f as p,l as m}from"./form-control-classes-DAfsCJTe.js";import{t as h}from"./brand-button-DGN6Y9o6.js";import{n as g,t as _}from"./settings-input-B-q2gkVy.js";import{t as v}from"./confirmation-modal-NCUPr2-O.js";import{r as y}from"./typography-iYhzLlHO.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-WpQi0q1L.js";import{t as D}from"./secrets-service-Dhjh3HhH.js";import{n as O,t as k}from"./use-create-secret-Dj5ang9x.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};
@@ -0,0 +1 @@
1
+ import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{t}from"./utils-BgGG1znF.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.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a,"data-testid":o?`${o}-option-${r.value}`:void 0,onClick:()=>i(r.value),className:t(`inline-flex items-center gap-1.5 px-2.5 py-1 rounded cursor-pointer transition-colors`,a?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:text-white`),children:[r.icon?(0,n.jsx)(`span`,{className:`inline-flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5`,children:r.icon}):null,r.label]},r.value)})})}export{r 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{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};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{I as r,M as i,R as a,W as o,m as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js";import{t as c}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{L as l,M as u,ot as d}from"./active-backend-context-BiwzkzDy.js";import{t as f,z as p}from"./utils-BgGG1znF.js";import{i as m,n as h,r as g,t as _}from"./use-settings-nav-items-DHAAD-zk.js";import{n as v}from"./use-config-CxlEdf_v.js";import"./navigation-link-Bxmn-pCs.js";import"./sidebar-layout-oHBGQmLh.js";import{t as y}from"./sidebar-nav-link-CrujNA09.js";import"./close-CDAVqnTn.js";import{r as b}from"./typography-iYhzLlHO.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-BnzI8Ysj.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 i(e)}return null};function M(){let{t:e}=c(`openhands`),t=r(),n=a(),i=_(),o=w(768),[l,u]=(0,D.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:f}=(0,D.useMemo)(()=>{let e=i.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=i.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[i,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:i,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};
@@ -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-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
+ 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~gy8zbn65-CGt6bWRT.js";import{t as a,z as o}from"./utils-BgGG1znF.js";import{f as s}from"./form-control-classes-DAfsCJTe.js";import{i as c}from"./combobox-caret-Bd2yySnF.js";import{n as l}from"./settings-input-B-q2gkVy.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-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
+ import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{W as t,p as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{z as i}from"./utils-BgGG1znF.js";import{i as a,n as o,r as s,t as c}from"./use-settings-nav-items-DHAAD-zk.js";import{t as l}from"./use-config-CxlEdf_v.js";import{t as u}from"./sidebar-nav-link-CrujNA09.js";import{r as d}from"./typography-iYhzLlHO.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-BnzI8Ysj.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};
@@ -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~gy8zbn65-CGt6bWRT.js";import{t as i,z as a}from"./utils-BgGG1znF.js";import{f as o}from"./form-control-classes-DAfsCJTe.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,hint:O,onBlur:k,inputClassName:A},j){let M=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,{}),O&&(0,c.jsx)(`span`,{"data-testid":e?`${e}-hint`:void 0,className:`min-w-0 text-xs text-[var(--oh-muted)]`,children:O})]}),(0,c.jsx)(`input`,{ref:j,"data-testid":e,onChange:e=>h?.(e.target.value),onKeyDown:g,onBlur:k,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":M??w,"aria-invalid":!!E||T,className:i(o,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`,E&&`border-red-500`,A)}),E&&(0,c.jsx)(`p`,{id:M,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};
@@ -1 +1 @@
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
+ import{t as e}from"./utils-BgGG1znF.js";import{_ as t,d as n,i as r,m as i}from"./form-control-classes-DAfsCJTe.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{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};
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~gy8zbn65-CGt6bWRT.js";import{Gt as i}from"./active-backend-context-BiwzkzDy.js";import{L as a,t as o,z as s}from"./utils-BgGG1znF.js";import{i as c}from"./llm-settings-CXo8iPNW.js";import{t as l}from"./use-tracking-BGboadaZ.js";import{t as u}from"./settings-Chfn5xTD.js";import{t as d}from"./use-save-settings-L3aMaDeS.js";import{t as f}from"./modal-backdrop-X-vKo61e.js";import{r as p,t as m}from"./modal-body-CMsDpalT.js";import{t as h}from"./base-modal-BBuy0WQQ.js";import{t as g}from"./modal-classes-B6PDrxXo.js";import{t as _}from"./brand-button-DGN6Y9o6.js";import{n as v}from"./navigation-context-BOGzIng3.js";import{t as y}from"./settings-input-B-q2gkVy.js";import{s as b,y as x}from"./schema-field-nImDoY6-.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};
@@ -1 +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
+ import{d as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{$ as t,ct as n}from"./active-backend-context-BiwzkzDy.js";import{t as r}from"./proxy-BBUG3sd2.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-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
+ 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~gy8zbn65-CGt6bWRT.js";import{t as i,z as a}from"./utils-BgGG1znF.js";import{n as o}from"./toggle-switch-BeSrbgCg.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};