@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 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{A as a,g as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{t as s}from"./useQuery-DiPh8LRJ.js";import{$ as c,Nt as l,X as u,ct as d,n as f,nt as p,pt as m}from"./active-backend-context-BiwzkzDy.js";import{E as h,t as g,z as _}from"./utils-BgGG1znF.js";import{c as v,r as y}from"./messages-kBjKaAeA.js";import{a as b,c as ee,i as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./vendor~files-tab-C7RmQJwN.js";import{n as O,t as k}from"./format-time-delta-CxfPJpzC.js";import{r as A}from"./conversation-CUJ0Vo8g.js";import{i as j}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js";import{t as M}from"./proxy-BBUG3sd2.js";import{c as N,f as P}from"./conversation-store-C6hSXHw0.js";import{t as te}from"./segmented-toggle-Do6oyepX.js";import{c as ne,u as re}from"./agent-server-conversation-service.api-CYSWw-2g.js";import{o as F}from"./home-store-Ch1ErdBc.js";import{r as ie}from"./typography-iYhzLlHO.js";import{d as I}from"./llm-not-configured-banner-3tMsM4K6.js";import{G as ae,J as oe,K as L,h as R,q as z,t as se,x as ce}from"./markdown-renderer-DgiLLhW6.js";import{t as le}from"./link-external-BDBCz-_z.js";import{n as ue,t as de}from"./highlighted-source-view-CX9oIoVT.js";import{t as B}from"./conversation-tab-empty-state-BCZ7rUMH.js";var V=e(t(),1),H=n();function fe(){let{t:e}=i(`openhands`);return(0,H.jsx)(B,{className:`h-full`,icon:(0,H.jsx)(O,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),children:e(_.FILES$NO_FILE_SELECTED)})}var pe=class{static async executeCommand(e,t,n,r,i=30){let a=d().backend;if(a.kind===`cloud`&&e){let o=await M({backend:a,method:`POST`,hostOverride:p(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new j(c({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=d().backend;return r.kind===`cloud`&&e?(await M({backend:r,method:`GET`,hostOverride:p(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new o(c({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}};function U(e){return e.startsWith(`/`)?e:`/${e}`}async function W(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let a=new URLSearchParams({...r,path:U(r.path)});return M({backend:i,method:`GET`,hostOverride:p(e),path:`${n}?${a.toString()}`,authMode:`session-api-key`,sessionApiKey:t??void 0})}return(await new j(c({conversationUrl:e,sessionApiKey:t})).client.get(n,{params:r})).data}function me(e){return u(e,404)||a(e)&&e.response?.status===404}var G=class{static async getGitChanges(e,t,n,r){let i=d().backend;if(i.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await M({backend:i,method:`GET`,path:`/api/v1/app-conversations/${e}/git/changes?${t.toString()}`});if(!Array.isArray(n))throw Error(`Invalid response from runtime - runtime may be unavailable`);return n.map(e=>({status:F(String(e.status)),path:e.path}))}let a=await new j(c({conversationUrl:t,sessionApiKey:n})).gitChanges(r);if(!Array.isArray(a))throw Error(`Invalid response from runtime - runtime may be unavailable`);return a.map(e=>({status:F(String(e.status)),path:e.path}))}static async getGitCommits(e,t,n,r=50){try{let i=await W(e,t,`/api/git/commits`,{path:n,limit:String(r)});return{commits:(i?.commits??[]).map(e=>({sha:e.sha,shortSha:e.short_sha,subject:e.subject,author:e.author,timestamp:e.timestamp})),hasMore:!!i?.has_more}}catch(e){if(me(e))return null;throw e}}static async getCommitChanges(e,t,n,r){let i=await W(e,t,`/api/git/commits/${encodeURIComponent(r)}/changes`,{path:n});if(!Array.isArray(i))throw Error(`Invalid response from runtime - runtime may be unavailable`);return i.map(e=>({status:F(String(e.status)),path:e.path}))}static async getGitChangeDiff(e,t,n,r,i){if(i){let e=await W(t,n,`/api/git/diff`,{path:r,commit:i});return{modified:e?.modified??``,original:e?.original??``,...e?.diff?{diff:e.diff}:{}}}let a=d().backend;if(a.kind===`cloud`&&e){let t=new URLSearchParams;t.set(`path`,U(r));let n=await M({backend:a,method:`GET`,path:`/api/v1/app-conversations/${e}/git/diff?${t.toString()}`});return{modified:n?.modified??``,original:n?.original??``,...n?.diff?{diff:n.diff}:{}}}let o=await new j(c({conversationUrl:t,sessionApiKey:n})).gitDiff(r);return{modified:o.modified??``,original:o.original??``,...o.diff?{diff:o.diff}:{}}}};function K(e,t){let n=t?.trim();if(n)return n;if(!e)return m;let r=e.split(`/`);return`${m}/${r[r.length-1]}`}var q=()=>{let{conversationId:e}=z(),{data:t}=L(),[n,r]=V.useState([]),i=V.useRef(null),a=A(),o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),d=V.useMemo(()=>K(l,u),[l,u]),f=s({queryKey:[`file_changes`,e,o,c,d],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitChanges(e,o,c,d)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:a&&!!e,meta:{disableToast:!0}});return V.useEffect(()=>{if(!f.isFetching&&f.isSuccess&&f.data){let e=f.data;if(e!==i.current)if(i.current=e,Array.isArray(e)){let t=new Set(e.map(e=>e.path)),i=new Set(n.map(e=>e.path)),a=e.filter(e=>!i.has(e.path)),o=n.filter(e=>t.has(e.path));r([...a,...o])}else r([e])}},[f.isFetching,f.isSuccess,f.data]),{data:n,isLoading:f.isLoading,isFetching:f.isFetching,isSuccess:f.isSuccess,isError:f.isError,error:f.error,refetch:f.refetch}},J=2e3,he=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function ge(){return`find . \\( ${he.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${J}`}function _e(e){return e.startsWith(`./`)?e.slice(2):e}function ve(e){let{data:t}=L(),n=A(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),c=s({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await pe.executeCommand(i,a,ge(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(_e);return Array.from(new Set(t)).slice(0,J)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function ye(e){let t=q(),n=(0,V.useMemo)(()=>{if(!e)return;let n=t.data.filter(e=>e.status!==`D`).map(e=>e.path);return Array.from(new Set(n)).slice(0,J)},[e,t.data]);return{data:e?n:void 0,isLoading:e?t.isLoading:!1}}function be(){let{backend:e}=f(),t=e.kind===`cloud`,n=ve(!t),r=ye(t);return t?r:n}function xe(){let{data:e}=L(),t=A(),n=e?.id,r=e?.conversation_url,i=e?.session_api_key,a=d().backend.kind===`local`,o=s({queryKey:[`workspace-session`,n,r,i],queryFn:async()=>({baseUrl:await new j(c({conversationUrl:r,sessionApiKey:i})).startWorkspaceSession(n)}),enabled:t&&!!n&&a,staleTime:1/0,gcTime:1/0,retry:!1});return{data:o.data??null,isLoading:o.isLoading,isError:o.isError,error:o.error??null}}function Se(e,t){let n=(t??``).replace(/^\/+/,``);return n?`${e}${n.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`:e}var Y=P(e=>({count:0,bump:()=>e(e=>({count:e.count+1}))}));function Ce(e,t){return e===null?null:`${e}${e.includes(`?`)?`&`:`?`}v=${t}`}var we=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`svg`,`avif`]),Te=new Set([`pdf`]);function Ee(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function De(e){switch(Ee(e)){case`html`:case`htm`:return`text/html`;case`css`:return`text/css`;case`js`:case`mjs`:case`cjs`:return`text/javascript`;case`json`:return`application/json`;case`md`:case`markdown`:return`text/markdown`;case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;case`bmp`:return`image/bmp`;case`ico`:return`image/x-icon`;case`avif`:return`image/avif`;case`pdf`:return`application/pdf`;default:return`text/plain`}}function Oe(e){let t=Ee(e);return we.has(t)?`image`:Te.has(t)?`pdf`:`text`}function ke(e){let t=new Uint8Array(e,0,Math.min(e.byteLength,8e3));for(let e=0;e<t.length;e+=1)if(t[e]===0)return!0;return!1}function X(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode.apply(null,t.subarray(e,e+n));return btoa(r)}function Ae(e){let{data:t}=L(),n=A(),{data:r}=xe(),i=Y(e=>e.count),a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.selected_repository,u=t?.workspace?.working_dir?.trim(),f=r?.baseUrl,p=d().backend.kind===`cloud`,m=K(l,u),h=m.startsWith(`/`)?m:`/${m}`,g=e?`${h}/${e}`:null;return s({queryKey:[`workspace-file-content`,a,o,c,p?`cloud`:f,e,g,i],queryFn:async()=>{if(!e)throw Error(`No path`);let t=Oe(e),n=De(e);if(p){let r=await ne(a,g);if(t===`text`){let t=new TextEncoder().encode(r);return ke(t.buffer)?{path:e,kind:`binary`,text:null,staticUrl:`data:application/octet-stream;base64,${X(t.buffer)}`,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:r,staticUrl:`data:${n};charset=utf-8;base64,${X(t.buffer)}`,mimeType:n}}return{path:e,kind:t,text:null,staticUrl:`data:${n};base64,${X(new TextEncoder().encode(r).buffer)}`,mimeType:n}}if(!f)throw Error(`No workspace session`);let r=Se(f,e);if(t!==`text`)return{path:e,kind:t,text:null,staticUrl:r,mimeType:n};let i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to read ${e}: ${i.status}`);let o=await i.arrayBuffer();return ke(o)?{path:e,kind:`binary`,text:null,staticUrl:r,mimeType:`application/octet-stream`}:{path:e,kind:`text`,text:new TextDecoder(`utf-8`,{fatal:!1}).decode(o),staticUrl:r,mimeType:n}},enabled:n&&!!a&&!!e&&(p||!!f),retry:!1,staleTime:1e3*5,gcTime:1e3*60,meta:{disableToast:!0}})}function je(){let{data:e,isLoading:t}=L(),n=e?.id?re(e.id):null;return{hasAttachedSource:!!e?.selected_repository||!!n?.selected_workspace,isLoading:t}}function Me(e){let{data:t}=L(),n=A(),{backend:r}=f(),i=r.kind===`local`,a=t?.id,o=t?.conversation_url,c=t?.session_api_key,l=t?.workspace?.working_dir?.trim(),u=(e?.enabled??!0)&&i&&n&&!!a&&!!l,d=s({queryKey:[`has-git-commits`,a,o,c,l],queryFn:async()=>(await pe.executeCommand(o,c,`git rev-parse --verify HEAD`,l,10)).exit_code===0,enabled:u,retry:!1,staleTime:6e4,gcTime:5*6e4,meta:{disableToast:!0}});return{hasCommits:d.data??null,isLoading:d.isLoading}}var Ne=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`,`PlanningFileEditorObservation`]),Pe=new Set([`view`]),Fe=new Set([`ExecuteBashObservation`,`TerminalObservation`]);function Ie(e){let t=e.observation;return!(!t||typeof t.kind!=`string`||!Ne.has(t.kind)||t.command&&Pe.has(t.command))}function Le(e){let t=e.observation;return!!t&&typeof t.kind==`string`&&Fe.has(t.kind)}function Re(){let e=r(),t=ce(e=>e.events),n=Y(e=>e.bump),i=(0,V.useRef)(new Set),a=(0,V.useRef)(new WeakSet);(0,V.useEffect)(()=>{let r=!1,o=!1;for(let e of t){let t=`id`in e?e.id:void 0;(t===void 0?a.current.has(e):i.current.has(t))||(t===void 0?a.current.add(e):i.current.add(t),Ie(e)?r=!0:Le(e)&&(o=!0))}!r&&!o||(e.invalidateQueries({queryKey:[`file_changes`]}),e.invalidateQueries({queryKey:[`file_diff`]}),e.invalidateQueries({queryKey:[`git_commits`]}),r&&(e.invalidateQueries({queryKey:[`workspace-files`]}),e.invalidateQueries({queryKey:[`workspace-file-content`]}),n()))},[t,e,n])}var ze=[`index.html`,`index.htm`,`readme.md`,`readme`,`main.html`,`app.html`,`index.js`,`index.ts`,`index.tsx`,`index.jsx`,`main.py`,`app.py`,`main.go`,`main.rs`,`main.java`,`main.c`,`main.cpp`,`package.json`,`pyproject.toml`,`cargo.toml`,`go.mod`,`pom.xml`,`dockerfile`,`makefile`],Be=[`license`,`license.md`,`license.txt`,`changelog.md`,`agents.md`,`tsconfig.json`,`.env.sample`,`.env.example`];function Ve(e){let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1)).toLowerCase()}function He(e){return e.split(`/`).filter(Boolean).length-1}function Ue(e){let t=Ve(e),n=ze.indexOf(t);if(n!==-1)return n;let r=Be.indexOf(t);return r===-1?1e4:1e3+r}function We(e){return[...e].sort((e,t)=>{let n=He(e)-He(t);if(n!==0)return n;let r=Ue(e)-Ue(t);return r===0?e.localeCompare(t):r})}function Ge({paths:e,selectedPath:t,onSelectFile:n,isTreeVisible:r,onToggleTree:a}){let{t:o}=i(`openhands`),s=(0,V.useMemo)(()=>We(e),[e]);return(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-[var(--oh-border)] px-2 py-1.5 min-h-[34px]`,"data-testid":`file-quick-row`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:a,"data-testid":`file-quick-row-tree-toggle`,"aria-pressed":r,"aria-label":o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),title:o(r?_.FILES$HIDE_FILE_TREE:_.FILES$SHOW_FILE_TREE),className:g(`shrink-0 inline-flex items-center justify-center w-6 h-6 rounded-md cursor-pointer`,`text-[var(--oh-text-tertiary)] hover:bg-tertiary`,r&&`bg-[var(--oh-surface-raised)]`),children:(0,H.jsx)(S,{className:`w-3 h-3`,"aria-hidden":!0,strokeWidth:2})}),s.length>0&&(0,H.jsx)(`div`,{className:`flex flex-nowrap items-center gap-1.5 overflow-hidden flex-1 min-w-0`,children:s.map(e=>{let r=t===e;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>n(e),title:e,"data-testid":`file-quick-row-item-${e}`,className:g(`inline-flex items-center px-2 py-0.5 text-xs whitespace-nowrap rounded-md cursor-pointer`,r?`bg-[var(--oh-interactive-hover)] text-white`:`bg-[var(--oh-surface-raised)] text-[var(--oh-text-tertiary)] hover:bg-tertiary`),children:e},e)})})]})}var Ke=new Set([`html`,`htm`,`svg`]),qe=new Set([`md`,`markdown`,`mdx`]),Je={pptx:`PowerPoint`,ppt:`PowerPoint`,docx:`Word`,doc:`Word`,xlsx:`Excel`,xls:`Excel`};function Z(e){let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Q({path:e}){let{t}=i(`openhands`),n=Je[Z(e)];return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":n?`file-content-viewer-unsupported-document`:`file-content-viewer-binary-fallback`,children:n?t(_.FILES$UNSUPPORTED_DOCUMENT,{type:n}):t(_.FILES$BINARY_FALLBACK)})}function Ye({path:e,viewMode:t}){let{t:n}=i(`openhands`),r=Ae(e),a=Y(e=>e.count);if(r.isLoading)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,children:n(_.FILES$LOADING_FILES)});if(r.isError||!r.data)return(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-sm text-[var(--oh-muted)]`,"data-testid":`file-content-viewer-error`,children:r.error?.message??n(_.FILES$LOAD_ERROR)});let{kind:o,text:s,staticUrl:c,mimeType:l}=r.data,u=Ce(c,a);return t===`plain`?o===`text`&&s!==null?(0,H.jsx)(de,{path:e,text:s,mimeType:l??void 0}):(0,H.jsx)(Q,{path:e}):o===`image`?(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-[var(--oh-surface)] p-4`,"data-testid":`file-content-viewer-image`,children:(0,H.jsx)(`img`,{src:u,alt:e,className:`max-h-full max-w-full object-contain`})}):o===`pdf`?(0,H.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`binary`?(0,H.jsx)(Q,{path:e}):l===`text/html`||Ke.has(Z(e))?(0,H.jsx)(`iframe`,{title:e,src:u,sandbox:`allow-same-origin`,"data-testid":`file-content-viewer-iframe`,className:`h-full w-full bg-white`}):o===`text`&&qe.has(Z(e))?(0,H.jsx)(`div`,{"data-testid":`file-content-viewer-markdown`,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] text-white custom-scrollbar-always`,children:(0,H.jsx)(`div`,{className:`prose prose-sm prose-invert max-w-none p-6 [--tw-prose-body:#fff] [--tw-prose-bold:#fff] [--tw-prose-headings:#fff] [--tw-prose-lead:#fff] [--tw-prose-counters:#fff] [--tw-prose-quotes:#fff] [--tw-prose-quote-borders:var(--oh-border-subtle)] [--tw-prose-bullets:var(--oh-muted)] [--tw-prose-hr:var(--oh-border-subtle)] [--tw-prose-captions:var(--oh-muted)] [--tw-prose-kbd:#fff]`,children:(0,H.jsx)(se,{content:s??``,includeStandard:!0,includeHeadings:!0})})}):o===`text`&&s!==null?(0,H.jsx)(de,{path:e,text:s,mimeType:l??void 0}):(0,H.jsx)(Q,{path:e})}var Xe=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 13 15`,fill:`none`,...e,children:(0,H.jsx)(`path`,{d:`M6.59467 0.21967C6.88756 -0.0732233 7.36244 -0.0732233 7.65533 0.21967L9.90533 2.46967C10.1982 2.76256 10.1982 3.23744 9.90533 3.53033L7.65533 5.78033C7.36244 6.07322 6.88756 6.07322 6.59467 5.78033C6.30178 5.48744 6.30178 5.01256 6.59467 4.71967L7.56434 3.75H6.375C3.71421 3.75 1.5 5.96421 1.5 8.625C1.5 11.2858 3.71421 13.5 6.375 13.5C9.03579 13.5 11.25 11.2858 11.25 8.625C11.25 8.21079 11.5858 7.875 12 7.875C12.4142 7.875 12.75 8.21079 12.75 8.625C12.75 12.1142 9.86421 15 6.375 15C2.88579 15 0 12.1142 0 8.625C0 5.13579 2.88579 2.25 6.375 2.25H7.56434L6.59467 1.28033C6.30178 0.987437 6.30178 0.512563 6.59467 0.21967Z`,fill:`currentColor`})}),Ze=()=>{let{conversationId:e}=z(),{data:t}=L(),n=A(),r=t?.conversation_url,i=t?.session_api_key,a=t?.selected_repository,o=t?.workspace?.working_dir?.trim(),c=V.useMemo(()=>K(a,o),[a,o]),l=s({queryKey:[`git_commits`,e,r,i,c],queryFn:async()=>{if(!e)throw Error(`No conversation ID`);return G.getGitCommits(r,i,c,50)},retry:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnMount:`always`,enabled:n&&!!e,meta:{disableToast:!0}});return{commits:l.data?.commits??[],hasMore:l.data?.hasMore??!1,isUnsupported:l.data===null,isLoading:l.isLoading,isFetching:l.isFetching,isSuccess:l.isSuccess,isError:l.isError}},Qe=e=>(0,H.jsx)(`svg`,{width:13,height:8,viewBox:`0 0 13 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,H.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.259766 6.17427L6.26425 0.715628L12.2688 6.17427L11.2597 7.28418L6.26425 2.74282L1.26878 7.28418L0.259766 6.17427Z`,fill:`currentColor`})}),$e=e=>{let{conversationId:t}=z(),{data:n}=L(),r=n?.conversation_url,i=n?.session_api_key,a=n?.selected_repository,o=n?.workspace?.working_dir?.trim(),c=V.useMemo(()=>`${K(a,o)}/${e.filePath}`,[a,e.filePath,o]),l=e.type===`D`;return s({queryKey:e.commit?[`commit_file_diff`,t,r,i,e.commit,c]:[`file_diff`,t,r,i,c],queryFn:async()=>{if(!t)throw Error(`No conversation ID`);return G.getGitChangeDiff(t,r,i,c,e.commit)},enabled:e.enabled&&(!l||!!e.commit),staleTime:e.commit?1/0:1e3*60*5,gcTime:1e3*60*15})};function et({className:e}){let{t}=i(`openhands`);return(0,H.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,H.jsx)(`div`,{className:g(`animate-spin rounded-full border-4 border-transparent border-t-white`,e),role:`status`,"aria-label":t(_.HOME$LOADING)})})}function tt({height:e,children:t}){return(0,H.jsx)(`div`,{"data-testid":`editor-container`,className:`w-full border-b border-[var(--oh-border)] overflow-hidden h-[var(--editor-height)]`,style:{"--editor-height":`${e}px`},children:t})}var nt=[{mode:`old`,icon:w},{mode:`diff`,icon:b},{mode:`new`,icon:D}],rt={renderValidationDecorations:`off`,readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},automaticLayout:!0,scrollbar:{alwaysConsumeMouseWheel:!1}},it={A:x,D:T,M:C,R:`Renamed`,U:`Untracked`},at=e=>{e.editor.defineTheme(`custom-diff-theme`,{base:`vs-dark`,inherit:!0,rules:[{token:`comment`,foreground:`6a9955`},{token:`keyword`,foreground:`569cd6`},{token:`string`,foreground:`ce9178`},{token:`number`,foreground:`b5cea8`}],colors:{"diffEditor.insertedTextBackground":`#014b01AA`,"diffEditor.removedTextBackground":`#750000AA`,"diffEditor.insertedLineBackground":`#003f00AA`,"diffEditor.removedLineBackground":`#5a0000AA`,"diffEditor.border":`var(--oh-border-subtle)`,"editorUnnecessaryCode.border":`#00000000`,"editorUnnecessaryCode.opacity":`rgba(0, 0, 0, 0.467)`}})};function ot({path:e,type:t,commit:n}){let{t:r}=i(`openhands`),[a,o]=V.useState(!0),[s,c]=V.useState(400),[l,u]=V.useState(`diff`),d=V.useRef(null),f=V.useRef(null),p=t===`A`||t===`U`,m=t===`D`,h=V.useMemo(()=>{if(t===`R`){let t=e.split(/\s+/).slice(1);return t[t.length-1]}return e},[e,t]),{data:v,isLoading:b,isSuccess:x,isRefetching:S}=$e({filePath:h,type:t,enabled:!a,commit:n}),C=V.useCallback(()=>{if(!d.current)return;let e=d.current.getOriginalEditor(),t=d.current.getModifiedEditor();e&&t&&c(Math.max(e.getContentHeight(),t.getContentHeight())+20)},[]),w=V.useCallback(()=>{f.current&&c(f.current.getContentHeight()+20)},[]),T=e=>{d.current=e,C(),e.getOriginalEditor().onDidContentSizeChange(C),e.getModifiedEditor().onDidContentSizeChange(C)},D=e=>{f.current=e,w(),e.onDidContentSizeChange(w)},O=(t===`U`?it.A:it[t])||`?`,k=typeof O==`string`?(0,H.jsx)(ie.Text,{children:O}):V.createElement(O,{className:`w-5 h-5`}),A=b||S,j=y(h),M=j===`markdown`,N=l===`old`?v?.original??``:v?.modified??``;return(0,H.jsxs)(`div`,{"data-testid":`file-diff-viewer-outer`,className:`w-full flex flex-col`,children:[(0,H.jsx)(`div`,{className:`flex justify-between items-center px-3 py-2.5 border-b border-[var(--oh-border)] hover:cursor-pointer`,onClick:()=>o(e=>!e),children:(0,H.jsxs)(`span`,{className:`text-sm w-full text-content flex items-center gap-2`,children:[A?(0,H.jsx)(et,{className:`w-4 h-4`}):k,(0,H.jsx)(`strong`,{className:`w-full truncate font-medium`,children:h}),!a&&!m&&(0,H.jsx)(`span`,{className:`flex items-center gap-0.5 shrink-0`,onClick:e=>e.stopPropagation(),children:nt.map(({mode:e,icon:t})=>(0,H.jsx)(`button`,{"data-testid":`view-mode-${e}`,type:`button`,"aria-pressed":l===e,onClick:()=>u(e),className:g(`p-1 rounded transition-colors cursor-pointer`,l===e?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-muted)] hover:bg-[var(--oh-interactive-hover)] hover:text-white`),children:(0,H.jsx)(t,{className:`w-4 h-4`})},e))}),(0,H.jsx)(`button`,{"data-testid":`collapse`,type:`button`,children:(0,H.jsx)(Qe,{className:g(`w-4 h-4 transition-transform`,a&&`transform rotate-180`)})})]})}),!a&&m&&!n&&(0,H.jsx)(`div`,{"data-testid":`file-deleted-message`,className:`w-full border-b border-[var(--oh-border)] p-4 bg-base text-[var(--oh-text-dim)] text-sm`,children:r(_.DIFF_VIEWER$FILE_DELETED)}),!a&&(!m||!!n)&&x&&(l===`diff`?(0,H.jsx)(tt,{height:s,children:(0,H.jsx)(ee,{"data-testid":`file-diff-viewer`,className:`w-full h-full`,language:j,original:p?``:v?.original??``,modified:m?``:v?.modified??``,theme:`custom-diff-theme`,onMount:T,beforeMount:at,options:{...rt,renderSideBySide:!p&&!m,hideUnchangedRegions:{enabled:!0}}})}):M?(0,H.jsx)(`div`,{className:`w-full border-b border-[var(--oh-border)] overflow-auto p-4 bg-base prose prose-invert max-w-none`,"data-testid":`markdown-preview`,children:(0,H.jsx)(se,{content:N,includeStandard:!0,includeHeadings:!0})}):(0,H.jsx)(tt,{height:s,children:(0,H.jsx)(E,{"data-testid":`file-single-viewer`,className:`w-full h-full`,language:j,value:N,theme:`custom-diff-theme`,beforeMount:at,onMount:D,options:rt})}))]})}function $(){return(0,H.jsx)(C,{"aria-hidden":!0,className:`size-full`})}function st(){let{t:e}=i(`openhands`);return(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_CHANGES)})}var ct=[{key:_.TIPS$CUSTOMIZE_MICROAGENT,link:`https://docs.all-hands.dev/usage/prompting/microagents-repo`},{key:_.TIPS$SETUP_SCRIPT,link:`https://docs.all-hands.dev/usage/prompting/repository#setup-script`},{key:_.TIPS$VSCODE_INSTANCE},{key:_.TIPS$SAVE_WORK},{key:_.TIPS$SPECIFY_FILES,link:`https://docs.all-hands.dev/usage/prompting/prompting-best-practices`},{key:_.TIPS$HEADLESS_MODE,link:`https://docs.all-hands.dev/usage/how-to/headless-mode`},{key:_.TIPS$CLI_MODE,link:`https://docs.all-hands.dev/usage/how-to/cli-mode`},{key:_.TIPS$GITHUB_HOOK,link:`https://docs.all-hands.dev/usage/cloud/github-installation#working-on-github-issues-and-pull-requests-using-openhands`},{key:_.TIPS$BLOG_SIGNUP,link:`https://www.all-hands.dev/blog`},{key:_.TIPS$API_USAGE,link:`https://docs.all-hands.dev/api-reference/health-check`}];function lt(){return ct[Math.floor(Math.random()*ct.length)]}function ut(){let{t:e}=i(`openhands`),[t,n]=V.useState(lt());return V.useEffect(()=>{n(lt())},[]),(0,H.jsx)(`div`,{className:`w-full bg-tertiary p-4 text-left`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(v,{className:`mt-0.5 h-4 w-4 shrink-0 fill-[var(--oh-muted)]`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h4`,{className:`text-sm font-semibold text-[var(--oh-text-tertiary)]`,children:e(_.TIPS$PROTIP)}),(0,H.jsxs)(`p`,{className:`text-sm font-normal leading-5 text-[var(--oh-muted)]`,children:[e(t.key),t.link?(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(`a`,{href:t.link,target:`_blank`,rel:`noopener noreferrer`,className:`underline transition-colors hover:text-white`,children:e(_.TIPS$LEARN_MORE)})]}):null]})]})]})})}var dt=/not a git repository/i,ft=new Set([_.DIFF_VIEWER$WAITING_FOR_RUNTIME,_.DIFF_VIEWER$LOADING]);function pt({messages:e}){let{t}=i(`openhands`);return e.length===1&&ft.has(e[0])?(0,H.jsx)(I,{testId:`changes-tab-status`,messageKey:e[0]}):(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e.map(e=>(0,H.jsx)(`span`,{className:`block`,children:t(e)},e))})}function mt(){let{data:e,isSuccess:t,isError:n,error:r,isLoading:i}=q(),[a,o]=V.useState(null),{curAgentState:s}=ae(),c=!h.includes(s),u=r&&dt.test(l(r));return V.useEffect(()=>{if(!c)o([_.DIFF_VIEWER$WAITING_FOR_RUNTIME]);else if(r){let e=l(r);dt.test(e)?o([_.DIFF_VIEWER$NOT_A_GIT_REPO,_.DIFF_VIEWER$ASK_OH]):o([e])}else o(i?[_.DIFF_VIEWER$LOADING]:null)},[c,u,i,r,o]),(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:!t||!e.length?(0,H.jsxs)(`div`,{className:`flex flex-col h-full w-full`,children:[(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[a&&(0,H.jsx)(pt,{messages:a}),!a&&t&&e.length===0&&(0,H.jsx)(st,{})]}),!n&&t&&e.length===0&&(0,H.jsx)(ut,{})]}):(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:e.slice(0,100).map(e=>(0,H.jsx)(ot,{path:e.path,type:e.status},e.path))})})}var ht=(e,t)=>{let{conversationId:n}=z(),{data:r}=L(),i=A(),a=r?.conversation_url,o=r?.session_api_key,c=r?.selected_repository,l=r?.workspace?.working_dir?.trim(),u=V.useMemo(()=>K(c,l),[c,l]);return s({queryKey:[`commit_changes`,n,a,o,u,e],queryFn:async()=>{if(!n)throw Error(`No conversation ID`);return G.getCommitChanges(a,o,u,e)},staleTime:1/0,gcTime:1e3*60*15,retry:!1,enabled:t.enabled&&i&&!!n,meta:{disableToast:!0}})};function gt({commit:e,showAuthor:t,isExpanded:n,onToggle:r}){let{t:a}=i(`openhands`),{data:o,isLoading:s,isSuccess:c}=ht(e.sha,{enabled:n});return(0,H.jsxs)(`div`,{"data-testid":`commit-row`,className:`w-full flex flex-col`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:r,"aria-expanded":n,"data-testid":`commit-row-toggle`,className:`w-full flex items-center gap-2 px-3 py-2.5 border-b border-[var(--oh-border)] text-sm text-content text-left hover:cursor-pointer`,children:[(0,H.jsx)(`code`,{className:`font-mono text-xs text-[var(--oh-muted)] flex-shrink-0`,children:e.shortSha}),(0,H.jsx)(`strong`,{className:`flex-1 truncate font-medium`,children:e.subject}),t&&(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate max-w-32 flex-shrink-0`,children:e.author}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] flex-shrink-0`,children:`${k(e.timestamp)} ${a(_.CONVERSATION$AGO)}`}),(0,H.jsx)(Qe,{className:g(`w-4 h-4 transition-transform flex-shrink-0`,!n&&`transform rotate-180`)})]}),n&&(0,H.jsxs)(`div`,{"data-testid":`commit-row-content`,className:`w-full flex flex-col pl-6`,children:[s&&(0,H.jsx)(`div`,{className:`p-3`,children:(0,H.jsx)(et,{className:`w-4 h-4`})}),c&&o?.map(t=>(0,H.jsx)(ot,{path:t.path,type:t.status,commit:e.sha},t.path))]})]})}function _t({commits:e,hasMore:t}){let{t:n}=i(`openhands`),[r,a]=V.useState(null),o=new Set(e.map(e=>e.author)).size>1;return(0,H.jsxs)(`section`,{"data-testid":`commit-list`,className:`w-full flex flex-col`,children:[e.map(e=>(0,H.jsx)(gt,{commit:e,showAuthor:o,isExpanded:r===e.sha,onToggle:()=>a(t=>t===e.sha?null:e.sha)},e.sha)),t&&(0,H.jsx)(`div`,{"data-testid":`commit-list-cap-notice`,className:`px-3 py-2.5 text-xs text-[var(--oh-muted)]`,children:n(_.DIFF_VIEWER$COMMITS_CAP,{count:e.length})})]})}function vt(){let{t:e}=i(`openhands`),{conversationId:t}=z(),{commits:n,hasMore:r,isUnsupported:a,isLoading:o,isSuccess:s}=Ze(),{curAgentState:c}=ae(),l=!h.includes(c);return(0,H.jsx)(`main`,{className:`h-full w-full flex flex-col items-stretch`,children:s&&!a&&n.length>0?(0,H.jsx)(`div`,{className:`h-full overflow-y-auto flex flex-col items-stretch custom-scrollbar-always`,children:(0,H.jsx)(_t,{commits:n,hasMore:r},t)}):(0,H.jsxs)(`div`,{className:`flex-1 flex items-center justify-center`,children:[!l&&(0,H.jsx)(I,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$WAITING_FOR_RUNTIME}),l&&o&&(0,H.jsx)(I,{testId:`commits-tab-status`,messageKey:_.DIFF_VIEWER$LOADING}),l&&!o&&(0,H.jsx)(B,{icon:(0,H.jsx)($,{}),children:e(_.DIFF_VIEWER$NO_COMMITS)})]})})}function yt(){let{t:e}=i(`openhands`);Re();let{hasAttachedSource:t,isLoading:n}=je(),{hasCommits:a}=Me({enabled:t}),{conversationId:o}=oe(),{state:s,setFilesTabDiffView:c,setFilesTabContentViewMode:l}=N(o??``),u=(t||n)&&a!==!1,d=s.filesTabDiffView??u,f=s.filesTabContentViewMode,{isSuccess:p,isUnsupported:m}=Ze(),h=p&&!m,[g,v]=(0,V.useState)(!1),y=d?`on`:`off`;g&&h&&(y=`commits`);let[b,ee]=(0,V.useState)(!1),x=be(),S=(0,V.useMemo)(()=>x.data??[],[x.data]),C=R(e=>e.selectedPath),w=R(e=>e.selectedConversationId),T=R(e=>e.setSelectedPath),E=w===o?C:null,D=(0,V.useCallback)(e=>T(e,o),[o,T]),O=Ae(E),k=Y(e=>e.count),A=Ce(O.data?.staticUrl??null,k);(0,V.useEffect)(()=>{w!==o&&T(null,o)},[w,o,T]),(0,V.useEffect)(()=>{if(E||S.length===0)return;let[e]=We(S);e&&T(e,o)},[S,E,o,T]);let j=r(),{refetch:M,isFetching:P}=q(),ne=()=>{M(),j.invalidateQueries({queryKey:[`workspace-files`]}),j.invalidateQueries({queryKey:[`workspace-file-content`]}),j.invalidateQueries({queryKey:[`git_commits`]})};return(0,H.jsxs)(`main`,{className:`h-full w-full flex flex-col items-stretch`,"data-testid":`files-tab`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5 border-b border-[var(--oh-border)]`,children:[(0,H.jsx)(te,{ariaLabel:e(_.FILES$DIFF_VIEW),testId:`files-tab-diff-toggle`,value:y,options:[{value:`on`,label:e(_.FILES$DIFF_VIEW)},...h?[{value:`commits`,label:e(_.DIFF_VIEWER$COMMITS)}]:[],{value:`off`,label:e(_.COMMON$FILES)}],onChange:e=>{e===`commits`?v(!0):(v(!1),c(e===`on`))}}),y===`off`&&(0,H.jsx)(te,{ariaLabel:e(_.FILES$RICH),testId:`files-tab-content-mode-toggle`,value:f,options:[{value:`rich`,label:e(_.FILES$RICH)},{value:`plain`,label:e(_.FILES$PLAIN)}],onChange:l}),(0,H.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[y===`off`&&A&&(0,H.jsx)(`a`,{href:A,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e(_.FILES$OPEN_IN_NEW_WINDOW),title:e(_.FILES$OPEN_IN_NEW_WINDOW),"data-testid":`files-tab-open-in-new-window`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:bg-[var(--oh-interactive-hover)] cursor-pointer text-white`,children:(0,H.jsx)(le,{width:14,height:14})}),(0,H.jsx)(`button`,{type:`button`,onClick:ne,disabled:P,"aria-label":e(_.FILES$REFRESH),title:e(_.FILES$REFRESH),"data-testid":`files-tab-refresh`,className:`flex items-center justify-center w-[26px] py-1 rounded-[7px] hover:enabled:bg-[var(--oh-interactive-hover)] cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:(0,H.jsx)(Xe,{width:12.75,height:15,color:`#ffffff`,className:P?`animate-spin`:``})})]})]}),y===`on`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(mt,{})}),y===`commits`&&(0,H.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,H.jsx)(vt,{})}),y===`off`&&(0,H.jsx)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:x.isLoading?(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-sm text-[var(--oh-muted)]`,children:e(_.FILES$LOADING_FILES)}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ge,{paths:S,selectedPath:E,onSelectFile:D,isTreeVisible:b,onToggleTree:()=>ee(e=>!e)}),(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1`,children:[b&&(0,H.jsx)(`aside`,{className:`w-56 shrink-0 border-r border-[var(--oh-border)] overflow-y-auto custom-scrollbar-always`,"data-testid":`files-tab-tree`,children:(0,H.jsx)(ue,{paths:S,selectedPath:E,onSelectFile:D})}),(0,H.jsx)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,"data-testid":`files-tab-content`,children:E?(0,H.jsx)(Ye,{path:E,viewMode:f}):(0,H.jsx)(fe,{})})]})]})})]})}export{yt as default};
@@ -1 +1 @@
1
- import{t as e}from"./utils-DsWhWn2F.js";var t=`h-9 min-h-9`,n=`rounded-lg`,r=`border border-[var(--oh-border)]`,i=`bg-base-secondary`,a=`duration-75`,o=`!duration-75`,s=`motion-reduce:transition-none`,c=e(`transition-[background-color,border-color,box-shadow,opacity]`,a,s),l=e(`!transition-[background-color,border-color,box-shadow,opacity]`,o,s),u=e(`transition-[transform] ease`,a,s),d=`hover:text-white hover:bg-white/10`,f=e(`inline-flex items-center gap-1 rounded-[100px] border border-transparent px-1.5`,`text-sm font-normal leading-5 text-[var(--oh-muted)] whitespace-nowrap min-w-0 cursor-pointer`,c,d),p=e(`flex items-center justify-center rounded-full text-[var(--oh-muted)] cursor-pointer`,c,d),m=`focus:border-white/40 focus:ring-1 focus:ring-white/20 focus:outline-none`,h=`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,g=`disabled:cursor-not-allowed disabled:opacity-60`,_=e(t,n,r,i,c,m,g,`w-full min-w-0 px-3 text-sm text-white placeholder:text-tertiary-alt`),v=e(_,`placeholder:italic`,l),y=e(n,r,i,c,m,g,`w-full min-w-0 px-3 py-2 text-sm text-white placeholder:text-tertiary-alt`),b=e(t,`relative flex min-w-0 items-center`,n,r,i,c,h),x=e(`min-w-0 flex-1 border-0 bg-transparent px-3 text-sm outline-none`,`placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`),S=e(t,`inline-flex w-fit cursor-pointer items-center justify-center gap-2 px-3`,n,c,`text-sm font-normal disabled:cursor-not-allowed disabled:opacity-30`),C=`pl-12`;e(S,r,i,`shrink-0 text-white`);var w=e(`inline-flex items-center gap-2 self-start rounded-lg p-2`,`text-sm font-normal leading-5 text-[var(--oh-muted)] cursor-pointer`,c,`hover:bg-tertiary hover:text-white`);export{c as _,S as a,x as c,n as d,v as f,u as g,C as h,r as i,y as l,i as m,f as n,g as o,b as p,w as r,_ as s,p as t,d as u};
1
+ import{t as e}from"./utils-BgGG1znF.js";var t=`h-9 min-h-9`,n=`rounded-lg`,r=`border border-[var(--oh-border)]`,i=`bg-base-secondary`,a=`duration-75`,o=`!duration-75`,s=`motion-reduce:transition-none`,c=e(`transition-[background-color,border-color,box-shadow,opacity]`,a,s),l=e(`!transition-[background-color,border-color,box-shadow,opacity]`,o,s),u=e(`transition-[transform] ease`,a,s),d=`hover:text-white hover:bg-white/10`,f=e(`inline-flex items-center gap-1 rounded-[100px] border border-transparent px-1.5`,`text-sm font-normal leading-5 text-[var(--oh-muted)] whitespace-nowrap min-w-0 cursor-pointer`,c,d),p=e(`flex items-center justify-center rounded-full text-[var(--oh-muted)] cursor-pointer`,c,d),m=`focus:border-white/40 focus:ring-1 focus:ring-white/20 focus:outline-none`,h=`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,g=`disabled:cursor-not-allowed disabled:opacity-60`,_=e(t,n,r,i,c,m,g,`w-full min-w-0 px-3 text-sm text-white placeholder:text-tertiary-alt`),v=e(_,`placeholder:italic`,l),y=e(n,r,i,c,m,g,`w-full min-w-0 px-3 py-2 text-sm text-white placeholder:text-tertiary-alt`),b=e(t,`relative flex min-w-0 items-center`,n,r,i,c,h),x=e(`min-w-0 flex-1 border-0 bg-transparent px-3 text-sm outline-none`,`placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`),S=e(t,`inline-flex w-fit cursor-pointer items-center justify-center gap-2 px-3`,n,c,`text-sm font-normal disabled:cursor-not-allowed disabled:opacity-30`),C=`pl-12`;e(S,r,i,`shrink-0 text-white`);var w=e(`inline-flex items-center gap-2 self-start rounded-lg p-2`,`text-sm font-normal leading-5 text-[var(--oh-muted)] cursor-pointer`,c,`hover:bg-tertiary hover:text-white`);export{c as _,S as a,x as c,n as d,v as f,u as g,C as h,r as i,y as l,i as m,f as n,g as o,b as p,w as r,_ as s,p as t,d as u};
@@ -1 +1 @@
1
- import{E as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";var t=e(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),n=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),r=e=>{let t=typeof e==`string`?n(e):e,r=new Date().getTime()-t.getTime(),i=Math.floor(r/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24),c=Math.floor(s/30),l=Math.floor(c/12);return i<60?`${i}s`:a<60?`${a}m`:o<24?`${o}h`:s<30?`${s}d`:c<12?`${c}mo`:`${l}y`};export{t as n,r as t};
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(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),n=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),r=e=>{let t=typeof e==`string`?n(e):e,r=new Date().getTime()-t.getTime(),i=Math.floor(r/1e3),a=Math.floor(i/60),o=Math.floor(a/60),s=Math.floor(o/24),c=Math.floor(s/30),l=Math.floor(c/12);return i<60?`${i}s`:a<60?`${a}m`:o<24?`${o}h`:s<30?`${s}d`:c<12?`${c}mo`:`${l}y`};export{t as n,r as t};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Bcgpimp9.js";import{n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{E as i,w as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{t as o}from"./useMutation-CaSHLnX0.js";import{Ot as s,kt as c}from"./active-backend-context-BiwzkzDy.js";import{C as l,i as u,t as d,z as f}from"./utils-BgGG1znF.js";import{a as p,o as m,t as h}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js";import{t as g}from"./use-tracking-BGboadaZ.js";import{n as _}from"./navigation-context-BOGzIng3.js";import{t as v}from"./dist-hOnv1nn2.js";import{n as y}from"./conversation-store-C6hSXHw0.js";import{t as b}from"./agent-server-conversation-service.api-CYSWw-2g.js";import{d as x,u as S}from"./conversation-state-store-F62HvuI1.js";var C=i(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),w=t(),T=v(`shrink-0 self-stretch min-w-full bg-[var(--oh-border)]`,{variants:{orientation:{horizontal:`h-[1px]`},color:{light:`bg-[var(--oh-border)]`},size:{thin:`h-[1px]`},inset:{none:``,menu:``}},defaultVariants:{orientation:`horizontal`,color:`light`,size:`thin`,inset:`none`}});function E({orientation:e,color:t,size:n,inset:r,className:i,testId:a}){return r===`menu`?(0,w.jsx)(`div`,{"data-testid":a,role:`separator`,className:d(`relative min-w-full shrink-0 self-stretch`,`h-3`,i),children:(0,w.jsx)(`div`,{"aria-hidden":!0,className:`absolute top-1/2 -left-1 -right-1 h-px -translate-y-1/2 bg-[var(--oh-border)]`})}):(0,w.jsx)(`div`,{"data-testid":a,role:`separator`,className:d(T({orientation:e,color:t,size:n,inset:r}),i)})}var D=()=>{let e=n();return o({mutationFn:e=>b.deleteConversation(e.conversationId),onMutate:async t=>{await e.cancelQueries({queryKey:[`user`,`conversations`]});let n=e.getQueryData([`user`,`conversations`]);return e.setQueryData([`user`,`conversations`],e=>e?.filter(e=>e.conversation_id!==t.conversationId)),{previousConversations:n}},onSuccess:(e,t)=>{y(t.conversationId)},onError:(t,n,r)=>{r?.previousConversations&&e.setQueryData([`user`,`conversations`],r.previousConversations)},onSettled:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]}),e.invalidateQueries({queryKey:[`start-tasks`]})}})},O=()=>{let{t:e}=r(`openhands`),t=n(),{conversationId:i,navigate:u}=_();return o({mutationKey:[`stop-conversation`],mutationFn:async e=>x(e.conversationId),onMutate:async()=>{let n=a.loading(e(f.TOAST$STOPPING_CONVERSATION),s);return await t.cancelQueries({queryKey:[`user`,`conversations`]}),{previousConversations:t.getQueryData([`user`,`conversations`]),toastId:n}},onError:(n,r,i)=>{i?.toastId&&a.dismiss(i.toastId),c(e(f.TOAST$FAILED_TO_STOP_CONVERSATION)),i?.previousConversations&&t.setQueryData([`user`,`conversations`],i.previousConversations)},onSuccess:(n,r,o)=>{o?.toastId&&a.dismiss(o.toastId),a.success(e(f.TOAST$CONVERSATION_STOPPED),s),S(t,r.conversationId,{execution_status:l.PAUSED,sandbox_status:`PAUSED`}),i===r.conversationId&&u(`/conversations`)}})};function k(e){return e===`MISSING`||e===`ERROR`}e();var A=e=>(0,w.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,w.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22.1595 5.22752L20.9895 4.95152L17.8275 8.09552L16.0365 6.27152L19.1205 3.03602L18.8505 1.84802C18.1988 1.62999 17.5172 1.51461 16.83 1.50602C16.0804 1.49449 15.3365 1.63746 14.6445 1.92602C13.9764 2.22843 13.3725 2.65616 12.8655 3.18602C12.3011 3.72063 11.8542 4.36683 11.553 5.08352C10.9732 6.50984 10.9732 8.10619 11.553 9.53252C8.42587 12.609 5.3391 15.7263 2.29351 18.8835C1.97851 19.296 1.82851 19.8105 1.86751 20.328C1.89825 20.8846 2.14856 21.4063 2.56351 21.7785C2.74951 21.981 2.97151 22.149 3.21901 22.2705C3.47401 22.383 3.74851 22.4475 4.02601 22.461C4.50001 22.452 4.95451 22.272 5.30701 21.9555C7.62901 19.77 12.078 15.2805 14.6055 12.6495C15.291 12.9405 16.0275 13.0905 16.7715 13.089C17.5204 13.0884 18.2616 12.9377 18.9513 12.6458C19.641 12.3539 20.2652 11.9267 20.787 11.3895C21.8588 10.2964 22.4575 8.82543 22.4535 7.29452C22.4708 6.59398 22.3715 5.89544 22.1595 5.22752ZM4.39951 20.892C4.34178 20.9433 4.27218 20.9794 4.19701 20.997C4.12306 21.0098 4.04746 21.0098 3.97351 20.997C3.89598 20.9852 3.82213 20.956 3.75751 20.9115C3.68817 20.8709 3.62955 20.8144 3.58651 20.7465C3.37651 20.532 3.18001 20.124 3.37651 19.8945C5.43151 17.709 9.66301 13.437 12.309 10.8255C12.459 11.0235 12.624 11.2125 12.801 11.3895C12.978 11.574 13.1685 11.745 13.371 11.901C10.812 14.526 6.63901 18.747 4.40101 20.892H4.39951ZM21.0765 7.29452C21.0795 8.44202 20.6325 9.54452 19.8285 10.3665C19.0262 11.1536 17.9472 11.5944 16.8233 11.5944C15.6994 11.5944 14.6203 11.1536 13.818 10.3665C13.23 9.75286 12.8283 8.98485 12.6597 8.15183C12.4911 7.31882 12.5624 6.45505 12.8655 5.66102C13.0673 5.12062 13.3802 4.62858 13.784 4.21671C14.1879 3.80485 14.6737 3.48233 15.21 3.27002C15.7192 3.05688 16.266 2.94774 16.818 2.94902H17.199L14.4735 5.75852V6.80252L17.316 9.63152H18.306L21.0765 6.90752V7.29452ZM4.86001 10.032H7.15651L8.21401 11.1075L9.23101 10.0965L8.23351 9.07952V9.01502L8.31901 6.54152L7.98901 5.88602L3.69901 3.06302L2.81251 3.16202L1.56601 4.43552L1.46701 5.33402L4.22401 9.71102L4.86001 10.0335V10.032ZM3.44251 4.58402L6.91351 6.87002L6.85501 8.55452H5.24101L3.00301 5.01152L3.44251 4.58402ZM14.1 15.024L15.111 14.0145L19.77 18.792C20.1624 19.2045 20.3813 19.752 20.3813 20.3213C20.3813 20.8906 20.1624 21.4381 19.77 21.8505C19.4749 22.1535 19.0955 22.3605 18.6811 22.4448C18.2667 22.5291 17.8365 22.4866 17.4465 22.323C17.1976 22.2126 16.9744 22.0517 16.791 21.8505L12.078 17.046L13.0965 16.029L17.7945 20.82C17.8577 20.8897 17.9363 20.9436 18.024 20.9775C18.1967 21.0476 18.3899 21.0476 18.5625 20.9775C18.6502 20.9436 18.7288 20.8897 18.792 20.82C18.8577 20.755 18.9088 20.6768 18.942 20.5905C18.9764 20.5025 18.9947 20.409 18.996 20.3145C18.9945 20.2202 18.9767 20.1268 18.9435 20.0385C18.9103 19.9523 18.8592 19.8741 18.7935 19.809L14.1 15.024Z`,fill:`currentColor`})}),j=e=>(0,w.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,w.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 13.0605L17.469 18.531L18.531 17.4705L13.0605 12L18.531 6.53099L17.4705 5.46899L12 10.9395L6.53099 5.46899L5.47049 6.53099L10.9395 12L5.47049 17.469L6.53099 18.531L12 13.0605Z`,fill:`currentColor`})}),M=e=>(0,w.jsx)(`svg`,{height:24,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,w.jsx)(`path`,{fill:`currentColor`,d:`m22 18-5 4-8-3v3l-4.19-5.75 12.91 1.05v-10.96l4.28-.69zm-17.19-1.75v-7.29l12.91-2.62-7.12-4.34v2.84l-6.63 1.92-1.97 2.62v5.69z`})}),N=e=>(0,w.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,w.jsx)(`path`,{d:`M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM7.79289 7.79289C8.18342 7.40237 8.81658 7.40237 9.20711 7.79289L12 10.5858L14.7929 7.79289C15.1834 7.40237 15.8166 7.40237 16.2071 7.79289C16.5976 8.18342 16.5976 8.81658 16.2071 9.20711L13.4142 12L16.2071 14.7929C16.5976 15.1834 16.5976 15.8166 16.2071 16.2071C15.8166 16.5976 15.1834 16.5976 14.7929 16.2071L12 13.4142L9.20711 16.2071C8.81658 16.5976 8.18342 16.5976 7.79289 16.2071C7.40237 15.8166 7.40237 15.1834 7.79289 14.7929L10.5858 12L7.79289 9.20711C7.40237 8.81658 7.40237 8.18342 7.79289 7.79289Z`,fill:`currentColor`})}),P=()=>{let{trackDownloadTrajectoryButtonClicked:e}=g(),{t}=r(`openhands`);return o({mutationKey:[`conversations`,`download`],mutationFn:async t=>{e(),u(await b.downloadConversation(t),`conversation_${t}.zip`)},onError:()=>{c(t(f.CONVERSATION$DOWNLOAD_ERROR))}})};function F({gitProvider:e,className:t}){return(0,w.jsxs)(w.Fragment,{children:[e===`github`&&(0,w.jsx)(p,{size:14,className:t}),e===`gitlab`&&(0,w.jsx)(m,{size:14,className:t}),e===`bitbucket`&&(0,w.jsx)(h,{size:14,className:t}),e===`bitbucket_data_center`&&(0,w.jsx)(h,{size:14,className:t}),e===`azure_devops`&&(0,w.jsx)(M,{className:d(t,`w-[14px] h-[14px]`)})]})}export{j as a,O as c,C as d,M as i,D as l,P as n,A as o,N as r,k as s,F as t,E as u};
@@ -0,0 +1 @@
1
+ import"./git-repo-dropdown-DEpOwUez.js";
@@ -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{s as o}from"./form-control-classes-DAfsCJTe.js";import{t as s}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js";import{c,i as l,r as u,u as d}from"./dropdown-classes-BB8rzqXL.js";import{r as f,t as p}from"./combobox-caret-Bd2yySnF.js";import{a as m,c as h,i as g,n as _,r as v,t as y}from"./home-store-Ch1ErdBc.js";import{r as b}from"./typography-iYhzLlHO.js";var x=e(t(),1),S=n();function C({disabled:e,onClear:t,testId:n=`dropdown-clear`}){let{t:o}=r(`openhands`);return(0,S.jsx)(`button`,{onClick:e=>{e.stopPropagation(),t()},disabled:e,className:i(`p-1 text-[#fff]`,`cursor-pointer disabled:cursor-not-allowed disabled:opacity-60`),type:`button`,"aria-label":o(a.COMMON$CLEAR_SELECTION),"data-testid":n,children:(0,S.jsx)(`svg`,{className:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,S.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})}function w({isOpen:e,disabled:t,getToggleButtonProps:n,iconClassName:o}){let{t:s}=r(`openhands`);return(0,S.jsx)(`button`,{...n({disabled:t,className:i(f,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed opacity-60`)}),type:`button`,"aria-label":s(a.COMMON$TOGGLE_MENU),children:(0,S.jsx)(p,{className:o})})}function T({item:e,index:t,isSelected:n,getItemProps:r,getDisplayText:a,getItemKey:o,isProviderDropdown:s=!1,renderIcon:l,itemClassName:f,ariaLabel:p}){return(0,S.jsx)(`li`,{...r({index:t,item:e,...p?{"aria-label":p}:{},className:i(s?`group px-2 py-0 cursor-pointer text-xs rounded-md mx-0 my-0 h-6 flex items-center`:`group px-2 py-2 cursor-pointer text-sm rounded-md mx-0 my-0.5`,`text-white focus:outline-none font-normal`,u,{"bg-[var(--oh-interactive-selected)] text-white":n,"hover:bg-[var(--oh-interactive-hover)]":!n},f)}),children:(0,S.jsxs)(`div`,{className:i(`flex items-center`,c),children:[l?(0,S.jsx)(`span`,{className:d,children:l(e)}):null,(0,S.jsx)(`span`,{className:`font-normal`,children:a(e)})]})},o(e))}function E({inputValue:e,searchMessage:t=`No items found`,emptyMessage:n=`No items available`,testId:r=`dropdown-empty`}){return(0,S.jsx)(`li`,{className:`px-3 py-2 text-[var(--oh-text-secondary)] text-sm rounded-lg mx-0.5 my-0.5`,"data-testid":r,children:e?t:n})}function D({isOpen:e,filteredItems:t,inputValue:n,highlightedIndex:r,selectedItem:a,getMenuProps:o,getItemProps:s,onScroll:c,menuRef:u,renderItem:d,renderItemPrefix:f,renderEmptyState:p,stickyTopItem:m,stickyFooterItem:h,testId:g,numberOfRecentItems:_=0,itemKey:v}){let y=!(t.length>0)&&!m&&!h;return e?(0,S.jsx)(`div`,{className:`relative`,children:(0,S.jsxs)(`div`,{className:i(`absolute z-10 w-full bg-tertiary border border-[var(--oh-border-input)] rounded-lg shadow-none`,`focus:outline-none mt-1 z-[9999]`,`max-h-60`),children:[(0,S.jsx)(`ul`,{...o({ref:u,className:i(`w-full overflow-auto p-1 custom-scrollbar-always`,l,m||h?`max-h-[calc(15rem-3rem)]`:`max-h-60`),onScroll:c,"data-testid":g}),children:y?p(n):(0,S.jsxs)(S.Fragment,{children:[m,t.map((e,t)=>{let n=v(e);return(0,S.jsxs)(x.Fragment,{children:[f?.(e,t),d(e,t,r,a,s),_>0&&t===_-1&&(0,S.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:`border-b border-[var(--oh-border-input)] bg-tertiary pb-1 mb-1 h-[1px]`})]},n)})]})}),h&&(0,S.jsx)(`div`,{className:`border-t border-[var(--oh-border-input)] bg-tertiary p-1 rounded-b-lg`,children:h})]})}):(0,S.jsx)(`div`,{className:`relative`,children:(0,S.jsx)(`ul`,{...o({ref:u,className:`hidden`,"data-testid":g})})})}function O({isError:e,message:t=`Failed to load data`,testId:n=`dropdown-error`}){return e?(0,S.jsx)(`div`,{className:`text-red-500 text-sm mt-1`,"data-testid":n,children:t}):null}function k(e,t){let[n,r]=(0,x.useState)([]),[i,a]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{(async()=>{if(!t){r([]);return}if(e.startsWith(`https://`)){let n=e.match(/https:\/\/[^/]+\/([^/]+\/[^/]+)/);if(n){let e=n[1];a(!0);try{r((await m.searchGitRepositories(e,t,3)).items)}catch{r([])}finally{a(!1)}}}else r([])})()},[e,t]),{urlSearchResults:n,isUrlSearchLoading:i}}function ee(e,t,n,r,i,a,o){let{data:s,fetchNextPage:c,hasNextPage:l,isLoading:u,isFetchingNextPage:d,isError:f}=g({provider:e,enabled:!t}),{data:p,isLoading:m}=v(n,e,(0,x.useMemo)(()=>i===o,[o,i])),h=(0,x.useMemo)(()=>s?.pages?.flatMap(e=>e.items)||[],[s]),_=(0,x.useMemo)(()=>a&&[...h,...r,...p||[]].find(e=>e.id===a)||null,[h,r,p,a]),y=(0,x.useMemo)(()=>r.length>0?r:n&&p&&i!==_?.full_name?p:h,[r,n,p,h,_,i]);return(0,x.useEffect)(()=>{!t&&!u&&!d&&!m&&l&&!n&&r.length===0&&y.length>0&&y.length<10&&c()},[t,u,d,m,l,n,r.length,y.length,c]),{repositories:y,allRepositories:h,selectedRepository:_,fetchNextPage:c,hasNextPage:l,isLoading:u,isFetchingNextPage:d,isError:f,isSearchLoading:m}}function A({provider:e,value:t,repositoryName:n,placeholder:c,className:l,disabled:u=!1,onChange:d}){let{t:f}=r(`openhands`),{recentRepositories:p}=y(),[m,g]=(0,x.useState)(``),[v,A]=(0,x.useState)(null),j=_(m,300),M=(0,x.useRef)(null),N=(0,x.useMemo)(()=>{if(j.startsWith(`https://`)){let e=j.match(/https:\/\/[^/]+\/([^/]+\/[^/]+)/);return e?e[1]:j}return j},[j]),{urlSearchResults:P,isUrlSearchLoading:te}=k(m,e),{repositories:F,selectedRepository:I,fetchNextPage:L,hasNextPage:R,isLoading:z,isFetchingNextPage:B,isError:V,isSearchLoading:H}=ee(e,u,N,P,m,t,n),U=I??v,W=(0,x.useMemo)(()=>{let t=p.filter(t=>t.git_provider===e);if(!m?.trim())return t;let n=m.startsWith(`https://`)?N:m;return t.filter(e=>e.full_name.toLowerCase().includes(n.toLowerCase()))},[p,e,m,N]),G=(0,x.useCallback)(e=>{let t=new Set(W.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));return[...W,...n]},[W]),K=(0,x.useMemo)(()=>{let e;if(P.length>0)e=F;else if(m===I?.full_name)e=F;else if(!m?.trim())e=F;else{let t=m.startsWith(`https://`)?N:m;e=F.filter(e=>e.full_name.toLowerCase().includes(t.toLowerCase()))}return G(e)},[F,m,I,P,N,G]),q=(0,x.useCallback)(e=>{A(e),d?.(e||void 0),e&&g(e.full_name)},[d]),J=(0,x.useCallback)(()=>{A(null),q(null),g(``)},[q]),Y=(0,x.useCallback)(e=>{let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t+r>=n-10&&R&&!B&&L()},[R,B,L]),{isOpen:X,getToggleButtonProps:Z,getMenuProps:ne,getInputProps:re,highlightedIndex:ie,getItemProps:Q,selectedItem:$}=s({items:K,itemToString:e=>e?.full_name||``,selectedItem:v,onSelectedItemChange:({selectedItem:e})=>{q(e)},inputValue:m,stateReducer:(e,t)=>t.type===s.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes});(0,x.useEffect)(()=>{I?A(I):t===null&&A(null)},[I,t]),(0,x.useEffect)(()=>{X||g(U?.full_name??``)},[U,X]);let ae=z||H||B||te,oe=(e,t,n,r,i)=>(0,S.jsx)(T,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.full_name,getItemKey:e=>e.id},e.id),se=e=>(0,S.jsx)(E,{inputValue:e,searchMessage:f(a.HOME$NO_REPOSITORY_FOUND),emptyMessage:f(a.COMMON$NO_REPOSITORY),testId:`git-repo-dropdown-empty`}),ce=(0,x.useMemo)(()=>W.length===0?null:(0,S.jsx)(`div`,{children:(0,S.jsx)(b.Text,{className:`text-xs text-content-2 font-semibold leading-4 pl-2`,children:f(a.COMMON$MOST_RECENT)})}),[W,v,Q,f]);return(0,S.jsxs)(`div`,{className:i(`relative`,l),children:[(0,S.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,S.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:ae?(0,S.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`}):(0,S.jsx)(h,{width:16,height:16})}),(0,S.jsx)(`input`,{...re({disabled:u,placeholder:c??f(a.COMMON$SEARCH_REPOSITORIES_PLACEHOLDER),className:i(o,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{g(e.target.value)}}),"data-testid":`git-repo-dropdown`}),(0,S.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[U&&(0,S.jsx)(C,{disabled:u,onClear:J}),(0,S.jsx)(w,{isOpen:X,disabled:u,getToggleButtonProps:Z})]})]}),(0,S.jsx)(D,{isOpen:X,filteredItems:K,inputValue:m,highlightedIndex:ie,selectedItem:$,getMenuProps:ne,getItemProps:Q,onScroll:Y,menuRef:M,renderItem:oe,renderEmptyState:se,stickyTopItem:ce,testId:`git-repo-dropdown-menu`,numberOfRecentItems:W.length,itemKey:e=>e.id}),(0,S.jsx)(O,{isError:V})]})}export{T as a,E as i,O as n,w as o,D as r,C as s,A 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{t as i,z as a}from"./utils-DsWhWn2F.js";import{ot as o,st as s}from"./vendor-markdown-BML7QbqS.js";import{t as c}from"./folder-C86qXV7M.js";import{t as l}from"./syntax-highlighter-B92AFGMy.js";var u=e(t(),1);function d(e){e.children.sort((e,t)=>e.isDirectory===t.isDirectory?e.name.localeCompare(t.name):e.isDirectory?-1:1);for(let t of e.children)t.isDirectory&&d(t)}function f(e,t,n,r,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let o=a.get(n);if(o)return!i&&!o.isDirectory&&(o.isDirectory=!0),o;let s={name:n,path:r,isDirectory:!i,children:[]};return e.children.push(s),a.set(n,s),s}function p(e){let t={name:``,path:``,isDirectory:!0,children:[]},n=new Map;for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length>0){let r=t,i=``;for(let t=0;t<e.length;t+=1){let a=e[t];i=i?`${i}/${a}`:a;let o=t===e.length-1;r=f(r,n,a,i,o)}}}return d(t),t}var m=n();function h({node:e,depth:t,selectedPath:n,onSelectFile:r}){let[a,o]=(0,u.useState)(!1),s=8+t*12;if(e.isDirectory)return(0,m.jsxs)(`li`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,"data-testid":`file-tree-dir-${e.path}`,className:i(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-white`,`hover:bg-tertiary cursor-pointer`),style:{paddingLeft:`${s}px`},children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:i(`inline-block w-3 text-[10px] text-[var(--oh-muted)] transition-transform`,a?`rotate-90`:`rotate-0`),children:`▶`}),(0,m.jsx)(c,{className:`w-3.5 h-3.5 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate`,children:e.name})]}),a&&e.children.length>0&&(0,m.jsx)(`ul`,{children:e.children.map(e=>(0,m.jsx)(h,{node:e,depth:t+1,selectedPath:n,onSelectFile:r},e.path))})]});let d=n===e.path;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`file-tree-file-${e.path}`,className:i(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm`,`hover:bg-tertiary cursor-pointer`,d?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-text-tertiary)]`),style:{paddingLeft:`${s+16}px`},children:[(0,m.jsx)(l,{className:`w-3.5 h-3.5 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate`,children:e.name})]})})}function g({paths:e,selectedPath:t,onSelectFile:n}){let{t:i}=r(`openhands`),o=(0,u.useMemo)(()=>p(e),[e]);return o.children.length===0?(0,m.jsx)(`div`,{className:`px-3 py-4 text-sm text-[var(--oh-muted)]`,children:i(a.FILES$NO_FILES)}):(0,m.jsx)(`ul`,{className:`py-1 custom-scrollbar-always`,"data-testid":`file-tree-view`,children:o.children.map(e=>(0,m.jsx)(h,{node:e,depth:0,selectedPath:t,onSelectFile:n},e.path))})}var _={js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,ts:`typescript`,tsx:`tsx`,py:`python`,pyi:`python`,pyw:`python`,html:`markup`,htm:`markup`,svg:`markup`,xml:`markup`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,json:`json`,json5:`json5`,yaml:`yaml`,yml:`yaml`,toml:`toml`,ini:`ini`,cfg:`ini`,properties:`properties`,conf:`ini`,env:`bash`,md:`markdown`,markdown:`markdown`,mdx:`markdown`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`bash`,bat:`batch`,cmd:`batch`,ps1:`powershell`,ps:`powershell`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,cs:`csharp`,java:`java`,kt:`kotlin`,kts:`kotlin`,scala:`scala`,rs:`rust`,go:`go`,rb:`ruby`,php:`php`,swift:`swift`,m:`objectivec`,mm:`objectivec`,hs:`haskell`,ex:`elixir`,exs:`elixir`,erl:`erlang`,fs:`fsharp`,fsx:`fsharp`,ml:`ocaml`,mli:`ocaml`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,lua:`lua`,pl:`perl`,pm:`perl`,r:`r`,jl:`julia`,dart:`dart`,groovy:`groovy`,gradle:`groovy`,tf:`hcl`,hcl:`hcl`,dockerfile:`docker`,sql:`sql`,graphql:`graphql`,gql:`graphql`,proto:`protobuf`,diff:`diff`,patch:`diff`,nix:`nix`,sol:`solidity`},v={dockerfile:`docker`,makefile:`makefile`,gnumakefile:`makefile`,".bashrc":`bash`,".zshrc":`bash`,".profile":`bash`,".env":`bash`,".gitignore":`bash`,".dockerignore":`bash`};function y(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function b(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return e.slice(t+1).toLowerCase()}function x(e,t){let n=v[b(e)];if(n)return n;let r=y(e);if(r&&_[r])return _[r];if(t){if(t===`text/html`)return`markup`;if(t===`text/css`)return`css`;if(t===`application/json`)return`json`;if(t===`text/markdown`)return`markdown`;if(t===`application/javascript`||t===`text/javascript`)return`javascript`;if(t===`application/x-yaml`||t===`text/yaml`)return`yaml`}return null}function S({path:e,text:t,mimeType:n}){let r=x(e,n);return r?(0,m.jsx)(`div`,{"data-testid":`file-content-viewer-highlighted`,"data-language":r,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] custom-scrollbar-always`,children:(0,m.jsx)(o,{language:r,style:s,showLineNumbers:!0,wrapLongLines:!1,customStyle:{margin:0,padding:`1rem`,background:`transparent`,fontSize:`0.75rem`,lineHeight:`1.25rem`,minHeight:`100%`},codeTagProps:{style:{background:`transparent`,fontFamily:`inherit`}},lineNumberStyle:{color:`var(--oh-border)`,minWidth:`2.5em`,paddingRight:`1em`,userSelect:`none`},children:t})}):(0,m.jsx)(`pre`,{"data-testid":`file-content-viewer-plain`,className:`h-full w-full overflow-auto whitespace-pre-wrap break-words bg-[var(--oh-surface)] p-4 text-xs leading-5 text-white custom-scrollbar-always`,children:t})}export{g as n,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{t as i,z as a}from"./utils-BgGG1znF.js";import{ot as o,st as s}from"./vendor-markdown-BML7QbqS.js";import{t as c}from"./folder-C86qXV7M.js";import{t as l}from"./syntax-highlighter-B92AFGMy.js";var u=e(t(),1);function d(e){e.children.sort((e,t)=>e.isDirectory===t.isDirectory?e.name.localeCompare(t.name):e.isDirectory?-1:1);for(let t of e.children)t.isDirectory&&d(t)}function f(e,t,n,r,i){let a=t.get(e);a||(a=new Map,t.set(e,a));let o=a.get(n);if(o)return!i&&!o.isDirectory&&(o.isDirectory=!0),o;let s={name:n,path:r,isDirectory:!i,children:[]};return e.children.push(s),a.set(n,s),s}function p(e){let t={name:``,path:``,isDirectory:!0,children:[]},n=new Map;for(let r of e){let e=r.split(`/`).filter(Boolean);if(e.length>0){let r=t,i=``;for(let t=0;t<e.length;t+=1){let a=e[t];i=i?`${i}/${a}`:a;let o=t===e.length-1;r=f(r,n,a,i,o)}}}return d(t),t}var m=n();function h({node:e,depth:t,selectedPath:n,onSelectFile:r}){let[a,o]=(0,u.useState)(!1),s=8+t*12;if(e.isDirectory)return(0,m.jsxs)(`li`,{children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,"data-testid":`file-tree-dir-${e.path}`,className:i(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm text-white`,`hover:bg-tertiary cursor-pointer`),style:{paddingLeft:`${s}px`},children:[(0,m.jsx)(`span`,{"aria-hidden":!0,className:i(`inline-block w-3 text-[10px] text-[var(--oh-muted)] transition-transform`,a?`rotate-90`:`rotate-0`),children:`▶`}),(0,m.jsx)(c,{className:`w-3.5 h-3.5 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate`,children:e.name})]}),a&&e.children.length>0&&(0,m.jsx)(`ul`,{children:e.children.map(e=>(0,m.jsx)(h,{node:e,depth:t+1,selectedPath:n,onSelectFile:r},e.path))})]});let d=n===e.path;return(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`file-tree-file-${e.path}`,className:i(`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm`,`hover:bg-tertiary cursor-pointer`,d?`bg-[var(--oh-interactive-hover)] text-white`:`text-[var(--oh-text-tertiary)]`),style:{paddingLeft:`${s+16}px`},children:[(0,m.jsx)(l,{className:`w-3.5 h-3.5 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate`,children:e.name})]})})}function g({paths:e,selectedPath:t,onSelectFile:n}){let{t:i}=r(`openhands`),o=(0,u.useMemo)(()=>p(e),[e]);return o.children.length===0?(0,m.jsx)(`div`,{className:`px-3 py-4 text-sm text-[var(--oh-muted)]`,children:i(a.FILES$NO_FILES)}):(0,m.jsx)(`ul`,{className:`py-1 custom-scrollbar-always`,"data-testid":`file-tree-view`,children:o.children.map(e=>(0,m.jsx)(h,{node:e,depth:0,selectedPath:t,onSelectFile:n},e.path))})}var _={js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,ts:`typescript`,tsx:`tsx`,py:`python`,pyi:`python`,pyw:`python`,html:`markup`,htm:`markup`,svg:`markup`,xml:`markup`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,json:`json`,json5:`json5`,yaml:`yaml`,yml:`yaml`,toml:`toml`,ini:`ini`,cfg:`ini`,properties:`properties`,conf:`ini`,env:`bash`,md:`markdown`,markdown:`markdown`,mdx:`markdown`,sh:`bash`,bash:`bash`,zsh:`bash`,fish:`bash`,bat:`batch`,cmd:`batch`,ps1:`powershell`,ps:`powershell`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,hh:`cpp`,cs:`csharp`,java:`java`,kt:`kotlin`,kts:`kotlin`,scala:`scala`,rs:`rust`,go:`go`,rb:`ruby`,php:`php`,swift:`swift`,m:`objectivec`,mm:`objectivec`,hs:`haskell`,ex:`elixir`,exs:`elixir`,erl:`erlang`,fs:`fsharp`,fsx:`fsharp`,ml:`ocaml`,mli:`ocaml`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,lua:`lua`,pl:`perl`,pm:`perl`,r:`r`,jl:`julia`,dart:`dart`,groovy:`groovy`,gradle:`groovy`,tf:`hcl`,hcl:`hcl`,dockerfile:`docker`,sql:`sql`,graphql:`graphql`,gql:`graphql`,proto:`protobuf`,diff:`diff`,patch:`diff`,nix:`nix`,sol:`solidity`},v={dockerfile:`docker`,makefile:`makefile`,gnumakefile:`makefile`,".bashrc":`bash`,".zshrc":`bash`,".profile":`bash`,".env":`bash`,".gitignore":`bash`,".dockerignore":`bash`};function y(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function b(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return e.slice(t+1).toLowerCase()}function x(e,t){let n=v[b(e)];if(n)return n;let r=y(e);if(r&&_[r])return _[r];if(t){if(t===`text/html`)return`markup`;if(t===`text/css`)return`css`;if(t===`application/json`)return`json`;if(t===`text/markdown`)return`markdown`;if(t===`application/javascript`||t===`text/javascript`)return`javascript`;if(t===`application/x-yaml`||t===`text/yaml`)return`yaml`}return null}function S({path:e,text:t,mimeType:n}){let r=x(e,n);return r?(0,m.jsx)(`div`,{"data-testid":`file-content-viewer-highlighted`,"data-language":r,className:`h-full w-full overflow-auto bg-[var(--oh-surface)] custom-scrollbar-always`,children:(0,m.jsx)(o,{language:r,style:s,showLineNumbers:!0,wrapLongLines:!1,customStyle:{margin:0,padding:`1rem`,background:`transparent`,fontSize:`0.75rem`,lineHeight:`1.25rem`,minHeight:`100%`},codeTagProps:{style:{background:`transparent`,fontFamily:`inherit`}},lineNumberStyle:{color:`var(--oh-border)`,minWidth:`2.5em`,paddingRight:`1em`,userSelect:`none`},children:t})}):(0,m.jsx)(`pre`,{"data-testid":`file-content-viewer-plain`,className:`h-full w-full overflow-auto whitespace-pre-wrap break-words bg-[var(--oh-surface)] p-4 text-xs leading-5 text-white custom-scrollbar-always`,children:t})}export{g as n,S as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{I as r,W as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{w as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{t as s}from"./use-is-creating-conversation-CAggrM75.js";import{Ot as c,kt as l,n as u}from"./active-backend-context-BiwzkzDy.js";import{t as d,z as f}from"./utils-BgGG1znF.js";import{t as p}from"./chevron-down-CP4QHvyc.js";import{a as m,c as h,d as g,f as _,i as v,l as y,n as b,o as x,p as S,r as C,s as w,t as T,u as E}from"./onboarding-47hh2IHA.js";import{t as D}from"./search-Dc2qR4O2.js";import{t as O}from"./x-omAzpXkl.js";import{t as k}from"./modal-backdrop-X-vKo61e.js";import{n as A,r as j,t as M}from"./modal-body-CMsDpalT.js";import{r as N}from"./base-modal-BBuy0WQQ.js";import{_ as P,i as F,m as I,s as L}from"./form-control-classes-DAfsCJTe.js";import{t as R}from"./brand-button-DGN6Y9o6.js";import{n as z}from"./navigation-context-BOGzIng3.js";import{t as B}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js";import{t as V}from"./styled-tooltip-C7grwnOX.js";import{i as H,n as U,o as W,u as G}from"./dropdown-classes-BB8rzqXL.js";import{t as K}from"./conversation-store-C6hSXHw0.js";import{t as q}from"./modal-close-button-DyxBZaAb.js";import{i as J}from"./conversation-state-store-F62HvuI1.js";import{n as ee}from"./use-create-conversation-nOJ6Um5h.js";import{c as te,s as ne,t as re}from"./home-store-Ch1ErdBc.js";import{t as ie}from"./folder-C86qXV7M.js";import{r as Y}from"./typography-iYhzLlHO.js";import{i as ae,n as oe,t as se}from"./extension-module-card-classes-Bo43vY5V.js";import{n as ce}from"./circle-plus-check-toggle-yTAS-nX3.js";import{F as le,I as ue,N as de,R as fe,T as pe,a as me,c as he,i as ge,l as _e,n as ve,o as ye,r as be,s as xe,t as Se,z as Ce}from"./llm-not-configured-banner-3tMsM4K6.js";import{y as we}from"./markdown-renderer-DgiLLhW6.js";import{t as Te}from"./use-plugins-marketplace-CVO7sXYR.js";import{a as Ee,i as De,o as Oe,r as ke,s as Ae,t as je}from"./git-repo-dropdown-DEpOwUez.js";import"./git-repo-dropdown-9WKINV6J.js";var X=e(t(),1);async function Me(e){let{imagesToEmbed:t}=Ce(e.images,e.imagesMarkedUploadAsFile),n=await Promise.all(t.map(e=>le(e)));we.getState().enqueuePendingMessage({conversationId:e.conversationId,text:e.text,content:e.text,imageUrls:n,fileUrls:[]})}var Z=n();function Ne({plugin:e,isSelected:t,isDisabled:n=!1,onToggle:r}){return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-card-${e.name}`,className:d(`flex min-w-0 items-start justify-between gap-3 rounded-lg bg-tertiary p-4`),children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{"data-testid":`plugin-picker-name-${e.name}`,className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 min-w-0 truncate text-xs text-tertiary-alt`,title:e.source,children:e.source}),e.description?(0,Z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-tertiary-light`,children:e.description}):null,e.repo_path||e.ref?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[e.repo_path?(0,Z.jsx)(`span`,{className:ae,children:e.repo_path}):null,e.ref?(0,Z.jsxs)(`span`,{className:ae,children:[`@`,e.ref]}):null]}):null]}),(0,Z.jsx)(ce,{testId:`plugin-picker-toggle-${e.name}`,isSelected:t,isDisabled:n,onToggle:r,enableLabelKey:f.BUTTON$ADD,disableLabelKey:f.COMMON$REMOVE,enableTooltipKey:f.BUTTON$ADD,disableTooltipKey:f.COMMON$REMOVE})]})}function Q(e){return[e.source,e.ref??``,e.repo_path??``].join(`\0`)}function Pe(e){return{source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}}function Fe(e,t){let n=Q(t);return e.some(e=>Q(e)===n)}function Ie(e,t){let n=Q(t);return e.some(e=>Q(e)===n)?e.filter(e=>Q(e)!==n):[...e,Pe(t)]}function Le(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description,e.source,e.repo_path,e.ref].filter(e=>typeof e==`string`&&e.length>0).some(e=>e.toLowerCase().includes(n)):!0}function Re({selected:e,onChange:t,disabled:n=!1}){let{t:r}=a(`openhands`),{data:i,isLoading:o,isError:s}=Te(),[c,l]=(0,X.useState)(``),u=(i??[]).filter(e=>Le(e,c));return(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker`,className:`flex w-full flex-col gap-3`,children:[(0,Z.jsxs)(`div`,{className:d(`relative flex min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`transition-colors focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`),children:[(0,Z.jsx)(D,{className:`ml-3 h-4 w-4 shrink-0 text-tertiary-alt`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{"data-testid":`plugin-picker-search-input`,type:`search`,value:c,onChange:e=>l(e.target.value),placeholder:r(f.PLUGINS$PICKER_SEARCH_PLACEHOLDER),"aria-label":r(f.PLUGINS$PICKER_SEARCH_PLACEHOLDER),className:d(`min-w-0 flex-1 border-0 bg-transparent outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),c?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(``),"aria-label":r(f.MCP$SEARCH_CLEAR),className:`mr-2 cursor-pointer rounded p-1 text-tertiary-alt hover:text-white`,children:(0,Z.jsx)(O,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),o?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-loading`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_LOADING)}):s?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-error`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_ERROR)}):u.length===0?(0,Z.jsx)(`p`,{"data-testid":`plugin-picker-empty`,className:`py-8 text-center text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_EMPTY)}):(0,Z.jsx)(`div`,{className:oe,children:(0,Z.jsx)(`div`,{className:se,children:u.map(r=>(0,Z.jsx)(Ne,{plugin:r,isSelected:Fe(e,r),isDisabled:n,onToggle:()=>t(Ie(e,r))},`${r.source} ${r.ref??``} ${r.repo_path??``} ${r.name}`))})})]})}function ze({selected:e,onChange:t,onClose:n}){let{t:r}=a(`openhands`);return(0,Z.jsx)(k,{onClose:n,children:(0,Z.jsxs)(`div`,{"data-testid":`plugin-picker-modal`,className:d(`relative flex max-h-[80vh] flex-col gap-4 rounded-xl border border-[var(--oh-border)] bg-base-secondary p-6`,j(`lg`),M),children:[(0,Z.jsx)(q,{onClose:n,testId:`plugin-picker-close`}),(0,Z.jsxs)(`div`,{className:`pr-6`,children:[(0,Z.jsx)(Y.H2,{children:r(f.PLUGINS$PICKER_TITLE)}),(0,Z.jsx)(Y.Text,{className:`mt-1 block text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_SUBTITLE)})]}),(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:(0,Z.jsx)(Re,{selected:e,onChange:t})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t border-[var(--oh-border-subtle)] pt-4`,children:[(0,Z.jsx)(Y.Text,{className:`text-sm text-tertiary-light`,children:r(f.PLUGINS$PICKER_SELECTED_COUNT,{count:e.length})}),(0,Z.jsx)(R,{testId:`plugin-picker-done`,type:`button`,variant:`primary`,onClick:n,className:`px-4`,children:r(f.PLUGINS$PICKER_DONE)})]})]})})}function Be({count:e,onClick:t,disabled:n=!1}){let{t:r}=a(`openhands`);return(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`open-plugin-picker`,onClick:t,disabled:n,className:d(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,F,I,P,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,Z.jsx)(pe,{width:16,height:16,className:`shrink-0`,"aria-hidden":!0})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:r(f.PLUGINS$PICKER_TRIGGER)}),e>0?(0,Z.jsx)(`span`,{"data-testid":`plugin-picker-count`,className:`inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-white px-1 text-[11px] font-semibold leading-none text-black`,children:e}):null]})}function Ve(){let{t:e}=a(`openhands`);return(0,Z.jsx)(`div`,{className:`flex min-h-[80px] w-full items-center justify-center py-2`,children:(0,Z.jsx)(Y.H1,{className:`w-full text-center leading-normal`,children:e(f.HOME$LETS_START_BUILDING)})})}function He({kind:e,onClick:t,disabled:n=!1,disabledTooltip:r}){let{t:i}=a(`openhands`),o=e===`local`,s=i(o?f.HOME$OPEN_WORKSPACE:f.COMMON$OPEN_REPOSITORY),c=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":o?`open-workspace-button`:`open-repository-button`,onClick:t,disabled:n,className:d(`flex flex-row items-center gap-2 rounded-full px-2.5 py-1 text-white`,F,I,P,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-raised`),children:[(0,Z.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:o?(0,Z.jsx)(S,{"aria-hidden":!0,className:`h-4 w-4`,strokeWidth:2}):(0,Z.jsx)(J,{width:16,height:16,className:`shrink-0`})}),(0,Z.jsx)(`span`,{className:`text-sm font-normal leading-5`,children:s})]});return r?(0,Z.jsx)(V,{content:r,placement:`top`,children:(0,Z.jsx)(`span`,{className:`inline-flex`,children:c})}):c}var $=`__ungrouped__`;function Ue({workspaces:e,parents:t=[],value:n,placeholder:r,className:i,disabled:o=!1,disabledTooltip:s,showManage:c,onChange:l,onAddClick:u,onManageClick:p}){let{t:m}=a(`openhands`),[h,g]=(0,X.useState)(n?.name??``),_=(0,X.useRef)(null),v=(0,X.useMemo)(()=>{let t=h.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,h]),y=(0,X.useCallback)(e=>e.parentPath??$,[]),b=(0,X.useMemo)(()=>{let e=new Map;return t.forEach(t=>e.set(t.path,t.name)),e},[t]),{groupedWorkspaces:x,isGrouped:S,headerByFirstIndex:C,groupLabelByIndex:w}=(0,X.useMemo)(()=>{let e=[],t=new Map;v.forEach(n=>{let r=y(n);t.has(r)||(t.set(r,[]),e.push(r)),t.get(r)?.push(n)}),e.sort((e,t)=>e===$?1:t===$?-1:0);let n=e.length>1,r=[],i=new Map,a=new Map;return e.forEach(e=>{let o=e===$?m(f.HOME$WORKSPACE_GROUP_OTHER):b.get(e)||e.split(`/`).filter(Boolean).pop()||e;n&&i.set(r.length,o),(t.get(e)??[]).forEach(e=>{a.set(r.length,o),r.push(e)})}),{groupedWorkspaces:r,isGrouped:n,headerByFirstIndex:i,groupLabelByIndex:a}},[v,y,b,m]),T=(0,X.useCallback)(e=>{l(e),e&&g(e.name)},[l]),E=(0,X.useCallback)(()=>{T(null),g(``)},[T]),{isOpen:D,getToggleButtonProps:O,getMenuProps:k,getInputProps:A,highlightedIndex:j,getItemProps:M,selectedItem:N,closeMenu:P}=B({items:x,itemToString:e=>e?.name??``,selectedItem:n,onSelectedItemChange:({selectedItem:e})=>{T(e??null)},inputValue:h,onIsOpenChange:({isOpen:e,selectedItem:t})=>{g(e?``:t?.name??``)},stateReducer:(e,t)=>t.type===B.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes}),F=(e,t,n,r,i)=>(0,Z.jsx)(Ee,{item:e,index:t,isSelected:r?.id===e.id,getItemProps:i,getDisplayText:e=>e.name,getItemKey:e=>e.id,ariaLabel:S?`${w.get(t)??``}, ${e.name}`.trim():void 0},e.id),I=e=>(0,Z.jsx)(De,{inputValue:e,searchMessage:m(f.HOME$NO_WORKSPACES),emptyMessage:m(f.HOME$NO_WORKSPACES),testId:`workspace-dropdown-empty`}),R=(0,X.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),z=(0,X.useCallback)(e=>{R(e),P(),u()},[P,u,R]),W=(0,X.useCallback)(e=>{R(e),P(),u()},[P,u,R]),G=(0,X.useCallback)(e=>{R(e),P(),p()},[P,p,R]),K=(0,X.useCallback)(e=>{R(e),P(),p()},[P,p,R]),q=(0,X.useMemo)(()=>(0,Z.jsxs)(`div`,{className:H,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,className:d(U,`cursor-pointer`),onMouseDown:R,onTouchStart:R,onTouchEnd:W,onClick:z,children:m(f.HOME$ADD_WORKSPACES)}),(c??e.length>0)&&(0,Z.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,className:d(U,`cursor-pointer`),onMouseDown:R,onTouchStart:R,onTouchEnd:K,onClick:G,children:m(f.HOME$MANAGE_WORKSPACES)})]}),[z,W,G,K,R,m,e.length,c]),J=(0,Z.jsxs)(`div`,{className:d(`relative`,i),children:[(0,Z.jsxs)(`div`,{className:`group relative text-[var(--oh-muted)] hover:text-white`,children:[(0,Z.jsx)(`div`,{className:`absolute left-2 top-1/2 transform -translate-y-1/2 z-10`,children:(0,Z.jsx)(te,{width:16,height:16})}),(0,Z.jsx)(`input`,{...A({disabled:o,placeholder:D&&n?n.name:r??m(f.HOME$WORKSPACE_PLACEHOLDER),className:d(L,`text-inherit shadow-none pl-7 pr-16 text-sm font-normal leading-5`,`placeholder:text-[var(--oh-muted)]`,`disabled:cursor-not-allowed disabled:opacity-60`),onChange:e=>{g(e.target.value)}}),"data-testid":`workspace-dropdown`}),(0,Z.jsxs)(`div`,{className:`absolute right-1 top-1/2 transform -translate-y-1/2 flex items-center`,children:[n&&(0,Z.jsx)(Ae,{disabled:o,onClear:E}),(0,Z.jsx)(Oe,{isOpen:D,disabled:o,getToggleButtonProps:O})]})]}),(0,Z.jsx)(ke,{isOpen:D,filteredItems:x,inputValue:h,highlightedIndex:j,selectedItem:N,getMenuProps:k,getItemProps:M,menuRef:_,renderItem:F,renderItemPrefix:S?(e,t)=>{let n=C.get(t);return n?(0,Z.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,"data-testid":`workspace-group-header`,className:`px-2 pt-2 pb-1 text-xs font-medium text-[var(--oh-muted)] select-none`,children:n}):null}:void 0,renderEmptyState:I,stickyFooterItem:q,testId:`workspace-dropdown-menu`,itemKey:e=>e.id})]});return s?(0,Z.jsx)(V,{content:s,placement:`top`,children:(0,Z.jsx)(`span`,{className:`block`,children:J})}):J}var We=`oh:home-selected-workspace-path`;function Ge(){if(typeof window>`u`)return null;try{let e=window.sessionStorage.getItem(We);return e&&e.length>0?e:null}catch{return null}}function Ke(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(We,e):window.sessionStorage.removeItem(We)}catch{}}function qe({isLoadingSettings:e=!1,onConfirm:t}){let{t:n}=a(`openhands`),{navigate:r}=z(),{data:i,error:o}=w(),c=i?.workspaceParents??[],{mutate:l}=y(),{mutate:u}=E(),{mutate:d}=h(),{mutate:p}=g(),{workspaces:_,parents:b,isLoading:S,isError:T,error:D}=x(),O=m(o??D,n),[k,A]=X.useState(null),[j,M]=X.useState(!1),[N,P]=X.useState(!1),{mutate:F,isPending:I,isSuccess:L}=ee(),B=s(),V=I||L||B,H=X.useCallback(e=>{A(e),Ke(e?.path??null)},[]);X.useEffect(()=>{let e=Ge();if(!e)return;let t=_.find(t=>t.path===e);if(t){A(e=>e?.path===t.path?e:t);return}!S&&!T&&!O&&(Ke(null),A(t=>t?.path===e?null:t))},[T,S,_,O]);let U=c.length>0||!!O,W=null;O?W=O:S?W=n(f.HOME$LOADING):T&&(W=n(f.HOME$WORKSPACE_SCAN_ERROR));let G=!!O||e||S&&_.length===0;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!t&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(ie,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:n(f.HOME$WORKSPACES_TAB)})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsx)(Ue,{workspaces:_,parents:b,value:k,placeholder:O?n(f.HOME$WORKSPACES_UNSUPPORTED_PLACEHOLDER):G?n(f.HOME$LOADING):void 0,disabled:G,disabledTooltip:O,showManage:_.length>0||c.length>0,onChange:H,onAddClick:()=>M(!0),onManageClick:()=>P(!0),className:`max-w-auto`},k?.path??`empty-workspace-selection`),U&&W&&(0,Z.jsx)(`p`,{className:`px-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`workspace-status-message`,children:W})]}),(0,Z.jsx)(R,{testId:`workspace-launch-button`,variant:`primary`,type:`button`,isDisabled:!k||!t&&V||e,onClick:()=>{if(k){if(t){t(k);return}F({workingDir:k.path,entryPoint:`home_workspace_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:t?`w-full`:`w-auto absolute bottom-5 left-5 right-5`,children:n(t?f.BUTTON$CONFIRM:V?f.HOME$LOADING:f.BUTTON$LAUNCH)}),(0,Z.jsx)(v,{isOpen:j,onClose:()=>M(!1),onAdd:e=>{let t=e[e.length-1];l(e,{onSuccess:()=>{t&&H(t)}})},onAddParent:e=>d(e)}),(0,Z.jsx)(C,{isOpen:N,workspaces:_,workspaceParents:c,onClose:()=>P(!1),onRemove:e=>{k?.path===e&&H(null),u(e)},onRemoveParent:e=>{k?.parentPath===e&&H(null),p(e)}})]})}function Je({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=a(`openhands`),{isLoadingSettings:i}=ne();return e?(0,Z.jsx)(k,{onClose:t,children:(0,Z.jsxs)(A,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(q,{onClose:t,testId:`close-open-workspace-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(N,{title:r(f.HOME$OPEN_WORKSPACE)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-workspace-dialog-body`,children:(0,Z.jsx)(qe,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ye({onRepoSelection:e,isLoadingSettings:t=!1,onConfirm:n}){let{navigate:r}=z(),[i,o]=X.useState(null),[c,l]=X.useState(null),[u,d]=X.useState(null),{providers:p}=ne(),{addRecentRepository:m,setLastSelectedProvider:h,getLastSelectedProvider:g}=re(),{mutate:_,isPending:v,isSuccess:y}=ee(),b=s(),{t:x}=a(`openhands`);X.useEffect(()=>{if(p.length!==0){if(p.length===1&&!u){d(p[0]);return}if(p.length>1&&!u){let e=g();e&&p.includes(e)&&d(e)}}},[p,u,g]);let S=v||y||b,C=t=>{t!==u&&(d(t),h(t),o(null),l(null),e?.(null))},w=X.useCallback(e=>{l(e)},[]);return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[!n&&(0,Z.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-[10px] pb-4`,children:[(0,Z.jsx)(J,{width:24,height:24}),(0,Z.jsx)(`span`,{className:`leading-5 font-bold text-base text-white`,children:x(f.COMMON$OPEN_REPOSITORY)})]})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-[10px] pb-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-white font-normal leading-[22px]`,children:x(f.HOME$SELECT_OR_INSERT_URL)}),p.length<=1?null:(0,Z.jsx)(me,{providers:p,value:u,className:`max-w-[500px]`,onChange:C,disabled:t})]}),(0,Z.jsx)(je,{provider:u||p[0],value:i?.id||null,repositoryName:i?.full_name||null,placeholder:`user/repo`,disabled:!u||t,onChange:t=>{t?(e?.(t),o(t)):(e?.(null),o(null),l(null))},className:`max-w-auto`}),(()=>{let e=i?.main_branch||null;return(0,Z.jsx)(ge,{repository:i?.full_name||null,provider:u||p[0],selectedBranch:c,onBranchSelect:w,defaultBranch:e,className:`max-w-full`,disabled:!i||t})})()]}),(0,Z.jsx)(R,{testId:`repo-launch-button`,variant:`primary`,type:`button`,isDisabled:!i||!c||!n&&S||p.length>1&&!u||t,onClick:()=>{if(!(!i||!c)){if(m(i),n){n({repository:i,branch:c,provider:u});return}_({repository:{name:i.full_name||``,gitProvider:i.git_provider||`github`,branch:c.name||`main`},entryPoint:`home_repo_form`},{onSuccess:e=>r(`/conversations/${e.conversation_id}`)})}},className:`w-full`,children:x(n?f.BUTTON$CONFIRM:S?f.HOME$LOADING:f.BUTTON$LAUNCH)})]})}function Xe({isOpen:e,onClose:t,onConfirm:n}){let{t:r}=a(`openhands`),{isLoadingSettings:i}=ne();return e?(0,Z.jsx)(k,{onClose:t,children:(0,Z.jsxs)(A,{width:`sm`,className:`relative items-start border border-[var(--oh-border)] !gap-4`,children:[(0,Z.jsx)(q,{onClose:t,testId:`close-open-repository-dialog`}),(0,Z.jsx)(`div`,{className:`w-full pr-6`,children:(0,Z.jsx)(N,{title:r(f.COMMON$OPEN_REPOSITORY)})}),(0,Z.jsx)(`div`,{className:`w-full`,"data-testid":`open-repository-dialog-body`,children:(0,Z.jsx)(Ye,{isLoadingSettings:i,onConfirm:e=>{n(e),t()}})})]})}):null}function Ze(e,t){return e===`new_worktree`?f.COMMON$WORKSPACE_MODE_NEW_WORKTREE:t===`cloud`?f.COMMON$WORKSPACE_MODE_CLOUD_REPO:f.COMMON$WORKSPACE_MODE_LOCAL_REPO}function Qe({mode:e}){return e===`new_worktree`?(0,Z.jsx)(_,{className:`size-3`,strokeWidth:2,"aria-hidden":!0}):(0,Z.jsx)(J,{width:12,height:12,color:`white`,"aria-hidden":!0})}var $e=[`local_repo`,`new_worktree`];function et({value:e,backendKind:t,onChange:n,disabled:r=!1,testId:i=`workspace-mode-selector`}){let{t:o}=a(`openhands`),[s,c]=(0,X.useState)(!1),l=(0,X.useRef)(null),u=o(Ze(e,t));return(0,X.useEffect)(()=>{if(!s)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]),(0,X.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]),(0,Z.jsxs)(`div`,{ref:l,className:`relative inline-flex`,children:[(0,Z.jsxs)(`button`,{type:`button`,"data-testid":i,"aria-haspopup":`menu`,"aria-expanded":s,"aria-label":u,disabled:r,onClick:()=>c(e=>!e),className:d(`group flex flex-row items-center justify-between gap-2 pl-2.5 pr-2 py-1 rounded-[100px] truncate relative`,`border border-[rgba(71,74,84,0.50)] bg-transparent text-white`,r?`cursor-not-allowed opacity-50`:`cursor-pointer hover:border-[var(--oh-border-subtle)]`),children:[(0,Z.jsx)(`span`,{className:`flex size-3 shrink-0 items-center justify-center`,children:(0,Z.jsx)(Qe,{mode:e})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-normal leading-5`,children:u}),(0,Z.jsx)(p,{className:`size-3 shrink-0 text-white`,"aria-hidden":!0})]}),s?(0,Z.jsx)(`div`,{role:`menu`,"data-testid":`${i}-menu`,className:d(`absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-[var(--oh-border)] bg-[var(--oh-surface)] p-1 shadow-lg`,H),children:$e.map(r=>{let a=o(Ze(r,t));return(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":r===e,"data-testid":`${i}-option-${r}`,onClick:()=>{n(r),c(!1)},className:W,children:[(0,Z.jsx)(`span`,{className:G,children:(0,Z.jsx)(Qe,{mode:r})}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]},r)})}):null]})}function tt({workspace:e,repository:t,branch:n,provider:r,workspaceMode:i,backendKind:a,onRepoClick:o,onWorkspaceModeChange:s}){let c=e?e.path.replace(/\/+$/,``).split(`/`).pop()||e.path:null;return(0,Z.jsxs)(`div`,{className:`flex flex-row gap-2.5 items-center flex-wrap`,"data-testid":`home-git-control-bar-preview`,children:[(0,Z.jsx)(be,{selectedRepository:t?.full_name??null,gitProvider:r??null,workspaceName:c,onClick:o}),e?(0,Z.jsx)(et,{value:i,backendKind:a,onChange:s}):null,n?(0,Z.jsx)(ve,{selectedBranch:n.name,selectedRepository:t?.full_name??null,gitProvider:r??null}):null]})}function nt(){let{t:e}=a(`openhands`),{backend:t}=u(),{navigate:n}=z(),r=t.kind===`local`,[i,d]=(0,X.useState)(!1),[p,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(`local_repo`),[T,E]=(0,X.useState)([]),[D,O]=(0,X.useState)(!1),{mutateAsync:k,isPending:A}=ee(),j=s(),M=A||j,{isConfigured:N,isLoading:P}=xe(),F=!P&&!N,{images:I,files:L,imagesMarkedUploadAsFile:R,clearAllFiles:B}=K(),{handleUpload:V}=ye(),{error:H}=w({enabled:r}),U=r?m(H,e):null,W=r?!!p:!!g&&!!v,G=he(null,t=>{let i=t.trim(),a=I.length>0||L.length>0;if(!i&&!a||M||F)return;let s={images:[...I],files:[...L]},u={query:a?void 0:i||void 0,entryPoint:`home_chat_launcher`};r&&p?u={...u,workingDir:p.path,workspaceMode:S}:!r&&g&&v&&(u={...u,repository:{name:g.full_name,gitProvider:g.git_provider,branch:v.name}}),T.length>0&&(u={...u,plugins:T});let d=o.loading(e(f.HOME$CREATING_CONVERSATION),c);(async()=>{try{let t=await k(u);o.dismiss(d);try{sessionStorage.removeItem(fe)}catch{}let c=t.conversation_id,f=c.startsWith(`task-`);if(a)if(!r||f){let e=t.task_id??(f?c.slice(5):null);if(!e){l(null);return}ue(e,{content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:[...R]}),B(),await Me({conversationId:c,text:i,images:s.images,imagesMarkedUploadAsFile:R}),n(`/conversations/${c}`);return}else try{await de({conversationId:c,content:i,images:s.images,files:s.files,imagesMarkedUploadAsFile:R,t:e}),B()}catch(e){l(e instanceof Error?e.message:null);return}f&&i&&await Me({conversationId:c,text:i,images:[],imagesMarkedUploadAsFile:[]}),n(`/conversations/${c}`)}catch(e){o.dismiss(d),l(e instanceof Error?e.message:null)}})()});return(0,Z.jsxs)(`div`,{"data-testid":`home-chat-launcher`,className:`flex w-full max-w-[800px] flex-col gap-4 md:px-4`,children:[(0,Z.jsx)(`div`,{className:`flex w-full justify-center`,children:(0,Z.jsx)(Ve,{})}),(0,Z.jsx)(`div`,{className:`w-full`,children:(0,Z.jsx)(_e,{onSubmit:G,onFilesPaste:V,disabled:M||F})}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[W?(0,Z.jsx)(tt,{workspace:p,repository:g,branch:v,provider:b,workspaceMode:S,backendKind:t.kind,onRepoClick:()=>d(!0),onWorkspaceModeChange:C}):(0,Z.jsx)(He,{kind:r?`local`:`cloud`,onClick:()=>d(!0),disabled:M||!!U,disabledTooltip:U}),(0,Z.jsx)(Be,{count:T.length,onClick:()=>O(!0),disabled:M})]}),r?(0,Z.jsx)(Je,{isOpen:i,onClose:()=>d(!1),onConfirm:e=>{h(e),_(null),y(null),x(null),C(`local_repo`)}}):(0,Z.jsx)(Xe,{isOpen:i,onClose:()=>d(!1),onConfirm:({repository:e,branch:t,provider:n})=>{_(e),y(t),x(n??e.git_provider),h(null),C(`local_repo`)}}),D&&(0,Z.jsx)(ze,{selected:T,onChange:E,onClose:()=>O(!1)})]})}function rt(){let e=b(r().search);return(0,Z.jsxs)(`div`,{"data-testid":`home-screen`,className:`custom-scrollbar-always flex h-full flex-col overflow-y-auto rounded-xl bg-transparent px-4 md:px-0 lg:px-[42px]`,children:[(0,Z.jsx)(`div`,{className:`md:px-4 lg:px-0`,children:(0,Z.jsx)(Se,{})}),(0,Z.jsx)(`div`,{className:`flex flex-1 min-h-0 flex-col items-center justify-center`,children:(0,Z.jsx)(nt,{})}),e?null:(0,Z.jsx)(T,{})]})}var it=i(rt);export{it as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./home-CY0JaxiY.js";export{e 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"./useInfiniteQuery-BLRVmVPU.js";import{t as i}from"./useQuery-DiPh8LRJ.js";import{$ as a,ct as o,n as s}from"./active-backend-context-BiwzkzDy.js";import{_ as c}from"./utils-BgGG1znF.js";import{i as l}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js";import{t as u}from"./proxy-BBUG3sd2.js";import{n as d}from"./use-settings-8nt3DGxW.js";import{d as f,f as p,l as m}from"./conversation-store-C6hSXHw0.js";import{t as h}from"./agent-server-conversation-service.api-CYSWw-2g.js";import{t as g}from"./use-is-authed-BT7Iud4U.js";var _=e(t()),v=n(),y=e=>(0,v.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,v.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M21 15V2.25L20.25 1.5H5.60999C5.26596 1.50381 4.92547 1.56987 4.60499 1.695C4.28194 1.83856 3.99081 2.0452 3.74868 2.30278C3.50656 2.56036 3.31831 2.8637 3.19499 3.195C3.07229 3.49004 3.00614 3.80552 2.99999 4.125V18.375C2.99638 18.7197 3.06272 19.0616 3.19499 19.38C3.46049 20.0205 3.96749 20.532 4.60499 20.805C4.92547 20.9301 5.26596 20.9962 5.60999 21H5.99999V19.5H5.60999C5.46032 19.5005 5.31218 19.4698 5.17499 19.41C4.90342 19.2974 4.68763 19.0816 4.57499 18.81C4.52706 18.6699 4.50174 18.5231 4.49999 18.375V17.625C4.50174 17.4769 4.52706 17.3301 4.57499 17.19C4.68763 16.9184 4.90342 16.7026 5.17499 16.59C5.31033 16.531 5.45634 16.5004 5.60399 16.5H19.5V19.5H13.5V21H20.25L21 20.25V15ZM5.99999 15V3H19.5V15H5.99999ZM7.49999 4.5H8.99999V6H7.49999V4.5ZM7.49999 7.5H8.99999V9H7.49999V7.5ZM8.99999 10.5H7.49999V12H8.99999V10.5ZM9.74999 20.235L7.91999 22.5H7.49999V18H12V22.5H11.58L9.74999 20.235Z`,fill:`currentColor`})}),b=e=>{if(!e)return[];let t=[];for(let n of Object.keys(e))n&&t.push(n);return t},x=()=>{let{data:e,isLoading:t}=d();return{providers:_.useMemo(()=>b(e?.provider_tokens_set),[e?.provider_tokens_set]),isLoadingSettings:t}};function S(e){switch(e){case`ADDED`:case`added`:return`A`;case`DELETED`:case`deleted`:return`D`;case`UPDATED`:case`modified`:return`M`;case`MOVED`:case`renamed`:return`R`;default:return`M`}}function C(){let e=o().backend;if(e.kind!==`cloud`)throw Error(`Cloud git call requires a cloud backend.`);return e}async function w(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.query&&n.set(`query`,e.query),e.pageId&&n.set(`page_id`,e.pageId),e.installationId&&n.set(`installation_id`,e.installationId);let r=await u({backend:t,method:`GET`,path:`/api/v1/git/repositories/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function T(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`limit`,String(e.limit??100)),e.pageId&&n.set(`page_id`,e.pageId);let r=await u({backend:t,method:`GET`,path:`/api/v1/git/installations/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}async function E(e){let t=C(),n=new URLSearchParams;n.set(`provider`,e.provider),n.set(`repository`,e.repository),n.set(`limit`,String(e.limit??30)),n.set(`query`,e.query??``),e.pageId&&n.set(`page_id`,e.pageId);let r=await u({backend:t,method:`GET`,path:`/api/v1/git/branches/search?${n.toString()}`});return{items:r?.items??[],next_page_id:r?.next_page_id??null}}var D=e=>e,O=()=>o().backend.kind===`cloud`,k=e=>!e||e===`undefined`||e===`null`,A={items:[],next_page_id:null},j={items:[],next_page_id:null},M={items:[],next_page_id:null},N=class{static async searchGitRepositories(e,t,n=100,r,i){return k(t)||!O()?A:w({provider:D(t),query:e||void 0,limit:n,pageId:r,installationId:i})}static async retrieveUserGitRepositories(e,t,n=30,r){return k(e)||!O()?A:w({provider:D(e),limit:n,pageId:t,installationId:r})}static async retrieveInstallationRepositories(e,t,n,r,i=30){if(k(e)||!O())return A;let a=n[t];return a?w({provider:D(e),installationId:a,limit:i,pageId:r}):A}static async getRepositoryBranches(e,t,n=``,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n||void 0,pageId:r,limit:i})}static async searchRepositoryBranches(e,t,n,r,i=30){return k(t)||!O()?j:E({provider:D(t),repository:e,query:n,pageId:r,limit:i})}static async getUserInstallations(e,t,n=100){return k(e)||!O()?M:T({provider:D(e),pageId:t,limit:n})}static async getGitChanges(e){let t=await h.resolveConversationWorkingDir(e);return(await new l(a({workingDir:t})).gitChanges(t)).map(e=>({path:e.path,status:S(String(e.status))}))}static async getGitChangeDiff(e,t){let n=await new l(a()).gitDiff(t);return{modified:n.modified??``,original:n.original??``}}},P=e=>{let{data:t}=g(),{providers:n}=x(),r=s();return i({queryKey:[`installations`,e,r.backend.id,r.orgId],queryFn:()=>N.getUserInstallations(e),enabled:t&&!!e&&n.length>0&&c(e,r.backend.kind),staleTime:1e3*60*5,gcTime:1e3*60*15})};function F(e){let{provider:t,pageSize:n=30,enabled:i=!0}=e,{providers:a}=x(),{data:o}=P(t),l=o?.items,u=s(),d=t?c(t,u.backend.kind):!1,f=r({queryKey:[`repositories`,t,d,n,u.backend.id,u.orgId,...d?[l||[]]:[]],queryFn:async({pageParam:e})=>{if(!t)throw Error(`Provider is required`);if(d){if(!l)throw Error(`Missing installation list`);let r=e;return await N.retrieveInstallationRepositories(t,r.installationIndex,l,r.pageId??void 0,n)}let r=e;return await N.retrieveUserGitRepositories(t,r??void 0,n)},getNextPageParam:(e,t,n)=>{if(d&&l){let t=n;if(e.next_page_id)return{installationIndex:t.installationIndex,pageId:e.next_page_id};let r=t.installationIndex+1;return r<l.length?{installationIndex:r,pageId:null}:void 0}return e.next_page_id},initialPageParam:d?{installationIndex:0,pageId:null}:null,enabled:i&&(a||[]).length>0&&!!t&&(!d||Array.isArray(l)&&l.length>0),staleTime:1e3*60*5,gcTime:1e3*60*15,refetchOnWindowFocus:!1});return{data:f.data,isLoading:f.isLoading,isError:f.isError,hasNextPage:f.hasNextPage,isFetchingNextPage:f.isFetchingNextPage,fetchNextPage:f.fetchNextPage,onLoadMore:()=>{f.hasNextPage&&!f.isFetchingNextPage&&f.fetchNextPage()}}}function I(e,t,n,r=100){return i({queryKey:[`repositories`,`search`,e,t,r],queryFn:async()=>t?(await N.searchGitRepositories(e,t,r)).items:[],enabled:!!e&&!!t&&!n,staleTime:1e3*60*5,gcTime:1e3*60*15})}function L(e,t){let[n,r]=(0,_.useState)(e);return(0,_.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}var R={recentRepositories:[],lastSelectedProvider:null},z=p()(f((e,t)=>({...R,addRecentRepository:t=>e(e=>({recentRepositories:[t,...e.recentRepositories.filter(e=>e.id!==t.id)].slice(0,3)})),clearRecentRepositories:()=>e(()=>({recentRepositories:[]})),getRecentRepositories:()=>t().recentRepositories,setLastSelectedProvider:t=>e(()=>({lastSelectedProvider:t})),getLastSelectedProvider:()=>t().lastSelectedProvider}),{name:`home-store`,storage:m(()=>localStorage)}));export{N as a,y as c,F as i,L as n,S as o,I as r,x as s,z as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./home-CY0JaxiY.js";export{e as default};
@@ -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(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{E as a,p as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js";import{t as s}from"./useMutation-CaSHLnX0.js";import{$ as c,At as l,Nt as u,R as d,ct as f,kt as ee,n as te,ut as p}from"./active-backend-context-BiwzkzDy.js";import{t as m,z as h}from"./utils-BgGG1znF.js";import{a as g,c as _,d as ne,i as v,n as y,o as b,r as x,s as S,t as C}from"./settings-service.api-CZiPD8__.js";import{n as w}from"./use-settings-8nt3DGxW.js";import{t as re}from"./modal-backdrop-X-vKo61e.js";import{n as ie}from"./modal-classes-B6PDrxXo.js";import{t as T}from"./brand-button-DGN6Y9o6.js";import{t as E}from"./styled-tooltip-C7grwnOX.js";import{t as ae}from"./modal-close-button-DyxBZaAb.js";import{t as D}from"./settings-input-B-q2gkVy.js";import{t as oe}from"./v4-DDdyfk2q.js";import{t as O}from"./secrets-service-Dhjh3HhH.js";import{c as se,i as ce,s as k,t as A}from"./mcp-marketplace-utils-DFmhKc5s.js";import{t as le}from"./vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js";var j=a(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),M=e(t()),N=n();function P({fieldKey:e,checked:t,onToggle:n}){let{t:r}=i(`openhands`);return(0,N.jsxs)(`label`,{"data-testid":`mcp-install-save-secret-${e}`,className:m(`flex items-center gap-2 px-3 py-2 mt-0.5 rounded-lg border cursor-pointer transition-colors`,t?`border-green-500/35 bg-green-500/10`:`border-[var(--oh-border)] bg-transparent hover:bg-white/[0.03]`),children:[(0,N.jsx)(`input`,{className:`sr-only`,id:`mcp-save-secret-checkbox-${e}`,type:`checkbox`,checked:t,onChange:e=>n(e.target.checked)}),(0,N.jsx)(`span`,{"aria-hidden":`true`,className:m(`relative inline-flex h-[22px] w-[40px] shrink-0 items-center rounded-full border transition-colors duration-200`,t?`border-green-500 bg-green-500`:`border-[var(--oh-border)] bg-surface-raised`),children:(0,N.jsx)(`span`,{className:m(`inline-block size-4 rounded-full transition-transform duration-200`,t?`translate-x-[21px] bg-white`:`translate-x-[2px] bg-[var(--oh-muted)]`)})}),(0,N.jsx)(`span`,{className:`text-sm`,children:r(h.MCP$ALSO_SAVE_AS_SECRET)}),(0,N.jsx)(`code`,{className:m(`ml-auto text-[11px] font-mono tracking-tight border rounded px-1.5 py-0.5`,t?`text-green-500 border-green-500/35 bg-white/[0.04]`:`text-tertiary-alt border-[var(--oh-border)]`),children:e}),(0,N.jsx)(E,{content:r(h.MCP$SAVE_AS_SECRET_TOOLTIP),placement:`top`,children:(0,N.jsx)(`button`,{type:`button`,"aria-label":r(h.MCP$SAVE_AS_SECRET_TOOLTIP),className:`flex items-center justify-center size-[15px] shrink-0 rounded-full border border-[var(--oh-muted)] text-tertiary-alt text-[9px] font-bold cursor-help`,onClick:e=>e.preventDefault(),children:`?`})})]})}var F=e=>(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,N.jsx)(`path`,{d:`M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z`,fill:`currentColor`})}),ue={xs:`h-4 w-4 rounded [&>svg]:h-2.5 [&>svg]:w-2.5`,sm:`h-5 w-5 rounded-md [&>svg]:h-3 [&>svg]:w-3`,md:`h-10 w-10 rounded-lg [&>svg]:h-5 [&>svg]:w-5`},de={slack:F};function fe({entry:e,size:t=`md`,className:n,fallback:r,testId:i}){let a=e?de[e.id]:void 0;return(0,N.jsx)(`span`,{"aria-hidden":`true`,title:e?.name,"data-testid":i,className:m(`inline-flex shrink-0 items-center justify-center overflow-hidden`,`border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`,ue[t],n),style:{backgroundColor:e?.iconBg??`var(--oh-color-tertiary)`,color:e?.iconColor??`#FFFFFF`},children:a?(0,N.jsx)(a,{}):e?.logoUrl?(0,N.jsx)(`img`,{src:e.logoUrl,alt:`${e.name} logo`,className:`h-full w-full object-contain p-[22%]`,onError:e=>{let t=e.currentTarget;t.style.display=`none`}}):r??(0,N.jsx)(j,{className:`h-5 w-5`,strokeWidth:2.25})})}var pe=new Set([`invalid_auth`,`not_authed`,`account_inactive`,`token_revoked`,`token_expired`]),me=e=>e.is_error?e.text||`tool call failed`:null,he={github:{toolCall:{name:`get_me`,arguments:{}},interpret:me},linear:{toolCall:{name:`list_teams`,arguments:{}},interpret:me},slack:{toolCall:{name:`slack_list_channels`,arguments:{limit:1}},interpret:e=>{if(e.is_error)return e.text||`tool call failed`;try{let t=JSON.parse(e.text);if(t?.ok===!1&&pe.has(t.error))return String(t.error)}catch{}return null}}};function I(e){let t=A(e,k(le));return t?he[t.id]:void 0}var ge=4,_e=/token|key|secret|auth/i,ve=[/\bgh[pousr]_[A-Za-z0-9]{16,}\b/g,/\bgithub_pat_[A-Za-z0-9_]{20,}\b/g,/\bxox[a-z](?:-[A-Za-z0-9]+)+/g,/\blin_api_[A-Za-z0-9]{10,}\b/g,/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{5,}\.[A-Za-z0-9_-]{5,}\b/g],ye=/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi;function L(e,t){typeof t==`string`&&(t.length<ge||t!==`**********`&&e.add(t))}function R(e,t){for(let n of Object.values(t??{}))L(e,n)}function be(e,t){if(t)try{let n=new URL(t);L(e,n.username),L(e,n.password),L(e,decodeURIComponent(n.username)),L(e,decodeURIComponent(n.password)),n.searchParams.forEach((t,n)=>{_e.test(n)&&L(e,t)})}catch{}}function xe(e,t){if(t)switch(t.strategy){case`api_key`:case`bearer`:L(e,t.value);break;case`basic`:L(e,t.username),L(e,t.password);break;case`header`:R(e,t.headers);break;case`oauth2`:L(e,t.authentication?.client_secret),R(e,t.state?.tokens);break;default:break}}function Se(e){let t=new Set;return R(t,e.env),R(t,e.headers),xe(t,e.auth),be(t,e.url),[...t].sort((e,t)=>t.length-e.length)}function z(e,...t){if(!e)return e;let n=e;for(let e of t)if(e)for(let t of Se(e))n=n.split(t).join(y);n=n.replace(ye,`Bearer ${y}`);for(let e of ve)n=n.replace(e,y);return n}var Ce=[`none`,`api_key`,`bearer`,`basic`,`header`,`oauth2`],we=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Te=e=>we(e)&&typeof e.strategy==`string`&&Ce.includes(e.strategy),Ee=e=>!!e&&typeof e==`object`&&!Array.isArray(e),De=e=>{if(!Ee(e))return;let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return t.length>0?Object.fromEntries(t):void 0},Oe=e=>!!e&&Object.values(e).some(e=>e===`**********`),ke=(e,t)=>e===`sse`?t===`sse`:e===`shttp`?t===void 0||t===`http`||t===`shttp`||t===`streamable-http`:!1,Ae=e=>{if(!e)return;let t=/^stdio-(\d+)$/.exec(e);return t?Number.parseInt(t[1],10):void 0},je=(e,t)=>{let n=Ae(e);if(n!==void 0)return Object.entries(t).filter(([,e])=>!e.url)[n]?.[1]},Me=(e,t)=>e.type===`stdio`?je(e.id,t)??(e.name?t[e.name]:void 0):e.name&&t[e.name]?t[e.name]:Object.values(t).find(t=>t.url===e.url&&ke(e.type,t.transport));async function Ne(e){let t=(await C.fetchSettingsFromApi(`encrypted`)).agent_settings?.mcp_config;if(Ee(t))return Me(e,t)}async function Pe(e){let t=e.type===`stdio`&&Oe(e.env),n=(e.type===`sse`||e.type===`shttp`)&&x(e.auth);if(!t&&!n)return e;try{let r=await Ne(e);if(!r)return e;if(t){let t=De(r.env)??{},n=Object.fromEntries(Object.entries(e.env??{}).map(([e,n])=>[e,n===`**********`&&typeof t[e]==`string`?t[e]:n]));return{...e,env:n}}return n&&Te(r.auth)?{...e,auth:r.auth}:e}catch{return e}}var Fe=120;function Ie(e){return e.type===`stdio`?{transport:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{transport:e.type===`sse`?`sse`:`http`,url:e.url,...e.headers&&Object.keys(e.headers).length>0&&{headers:e.headers},...e.auth?{auth:e.auth}:{}}}function Le(e){return e.auth?.strategy===`oauth2`?Fe:e.timeout}async function Re(e){let t=I(e),n=await Pe(e),r=Ie(n),i=Le(e);return{request:{server:r,...e.name?{name:e.name}:{},...i===void 0?{}:{timeout:i},...t?{tool_call:t.toolCall}:{}},substituted:n}}function ze(e,t){return e.ok?e.tool_result?{...e,tool_result:{...e.tool_result,text:z(e.tool_result.text,...t)}}:e:{...e,error:z(e.error,...t)}}function Be(e,t,n){let r=ze(e,n);if(r.ok&&t&&r.tool_result&&r.tools.includes(t.toolCall.name)){let e=t.interpret(r.tool_result);if(e)return{ok:!1,error:e,error_kind:`credentials`}}return r}function Ve(){if(f().backend.kind===`local`){let{host:e,apiKey:t}=c();return{host:e,...t?{apiKey:t}:{}}}let e=p().find(e=>e.kind===`local`&&e.host);if(e)return{host:e.host.replace(/\/+$/,``),...e.apiKey?{apiKey:e.apiKey}:{}};throw Error(`OAuth authorization requires a reachable local backend.`)}function B(){let{host:e,apiKey:t}=Ve();return new o({host:e,...t?{apiKey:t}:{},timeout:125e3})}function He(e){return e.status===`succeeded`?{ok:!0,tools:e.tools??[],...e.tool_result!==void 0&&{tool_result:e.tool_result},...e.oauth_state!==void 0&&{oauth_state:e.oauth_state}}:{ok:!1,error:e.error||`OAuth authorization did not complete`,error_kind:e.error_kind||`unknown`}}var Ue=e=>new Promise(t=>{window.setTimeout(t,e)}),V=class e{static async testServer(e){if(f().backend.kind===`cloud`)return{ok:!0,tools:[]};let t=I(e),{host:n,apiKey:r}=c(),i=new o({host:n,...r?{apiKey:r}:{}});try{let{request:n,substituted:r}=await Re(e);return Be(await i.testServer(n),t,[r,e])}finally{i.close()}}static async startOAuth(t){let n=B();try{return await e.startOAuthWithClient(n,t)}finally{n.close()}}static async getOAuthStatus(t){let n=B();try{return await e.getOAuthStatusWithClient(n,t)}finally{n.close()}}static async submitOAuthCallback(t,n){let r=B();try{return await e.submitOAuthCallbackWithClient(r,t,n)}finally{r.close()}}static async authorizeOAuth(t){let n=I(t),r=e=>Be(e,n,[t]),i=window.open(`about:blank`,`_blank`),a=B();try{let n=await e.startOAuthWithClient(a,t);if(!n.ok||!n.job_id||!n.authorization_url)return i?.close(),r({ok:!1,error:n.error||`Could not start OAuth authorization`,error_kind:n.error_kind||`unknown`});let o=await e.getOAuthStatusWithClient(a,n.job_id);for(let t=0;t<20;t+=1){if(o.status===`succeeded`||o.status===`failed`)return i?.close(),r(He(o));if(o.callback_ready)break;await Ue(250),o=await e.getOAuthStatusWithClient(a,n.job_id)}i&&(i.location.href=n.authorization_url);for(let t=0;t<Fe;t+=1)if(await Ue(1e3),o=await e.getOAuthStatusWithClient(a,n.job_id),o.status===`succeeded`||o.status===`failed`)return i?.close(),r(He(o));return{ok:!1,error:`OAuth authorization timed out`,error_kind:`timeout`}}finally{a.close()}}static async startOAuthWithClient(e,t){let{request:n}=await Re(t);return e.startOAuth(n)}static async getOAuthStatusWithClient(e,t){return await e.getOAuthStatus(t)}static async submitOAuthCallbackWithClient(e,t,n){return await e.submitOAuthCallback(t,{callback_url:n})}},H=e=>Object.keys(e??{}).sort();function U(e){return e.type===`stdio`?JSON.stringify({type:e.type,name:e.name??``,command:e.command??``,args:e.args??[],envKeys:H(e.env)}):JSON.stringify({type:e.type,name:e.name??``,url:e.url??``,headerKeys:H(e.headers),authStrategy:e.auth?.strategy??``,authHeaderName:e.auth?.strategy===`api_key`?e.auth.header_name??``:``,authHeaderKeys:e.auth?.strategy===`header`?H(e.auth.headers):[]})}var W={},G=new Set,We=1;function K(e){W=e,G.forEach(e=>e())}function Ge(){return W}function Ke(e){return G.add(e),()=>{G.delete(e)}}function qe(e){let t=We;return We+=1,K({...W,[e]:{status:`checking`,checkId:t}}),t}function q(e,t,n){let r=W[e];r?.status!==`checking`||r.checkId!==t||K({...W,[e]:n})}function Je(e,t){K({...W,[e]:t})}function Ye(e){if(!(e in W))return;let{[e]:t,...n}=W;K(n)}var Xe=/\b(401|403)\b|unauthorized|forbidden|invalid[ _-]?(token|credentials?|api[ _-]?key)/i;function Ze(e,t){return{status:`failed`,kind:`unknown`,error:z(t instanceof Error?t.message:String(t),e),checkedAt:Date.now()}}function J(e,t){let n=Date.now();if(!t.ok)return{status:`failed`,kind:(t.error_kind===`connection`||t.error_kind===`unknown`)&&Xe.test(t.error)?`credentials`:t.error_kind,error:t.error,checkedAt:n};let r=I(e);return{status:`healthy`,verification:r&&t.tools.includes(r.toolCall.name)&&t.tool_result&&!t.tool_result.is_error?`verified`:`connectivity-only`,toolCount:t.tools.length,checkedAt:n}}async function Qe(e){let t=U(e),n=qe(t),r;try{r=J(e,await V.testServer(e))}catch(t){r=Ze(e,t)}q(t,n,r)}async function $e(e){let t=U(e),n=qe(t);try{let r=await V.authorizeOAuth(e);return q(t,n,J(e,r)),r}catch(r){return q(t,n,Ze(e,r)),null}}function Y(e,t,n){let r=U(e);n.some(e=>U(e)===r)||Je(r,J(e,t))}function et(){let e=r(),{data:t}=w();return s({mutationFn:async e=>{if(!t)return;let n=v(t.agent_settings?.mcp_config),r={sse_servers:[...n.sse_servers],stdio_servers:[...n.stdio_servers],shttp_servers:[...n.shttp_servers]};e.type===`sse`?r.sse_servers.push(b(e)):e.type===`stdio`?r.stdio_servers.push(S(e)):e.type===`shttp`&&r.shttp_servers.push(g(e)),await C.saveSettings({agent_settings_diff:{mcp_config:_(r)}})},onSuccess:()=>{e.invalidateQueries({queryKey:d.personal()})}})}function tt(){return s({mutationFn:e=>V.testServer(e)})}function nt(e){return e.length<=3?e.join(`, `):`${e.slice(0,3).join(`, `)} … (+${e.length-3})`}function rt(){let{t:e}=i(`openhands`),t=r();return(0,M.useCallback)((n,r,i)=>{let a=n.filter(e=>i[e.key]&&(r[e.key]??``).trim());return a.length===0?Promise.resolve():Promise.allSettled(a.map(e=>O.createSecret(e.key,r[e.key].trim(),e.label))).then(n=>{let r=a.filter((e,t)=>n[t].status===`fulfilled`).map(e=>e.key),i=a.filter((e,t)=>n[t].status===`rejected`).map(e=>e.key);r.length>0&&(t.invalidateQueries({queryKey:[`secrets-search`]}),t.invalidateQueries({queryKey:[`secrets`]}),l(e(h.MCP$SECRETS_SAVED,{keys:nt(r)}))),i.length>0&&ee(e(h.MCP$SECRETS_SAVE_FAILED,{keys:nt(i)}))})},[e,t])}function X(e,t,n){switch(t){case`timeout`:return e(h.MCP$TEST_ERROR_TIMEOUT);case`connection`:return e(h.MCP$TEST_ERROR_CONNECTION);case`credentials`:return e(h.MCP$TEST_ERROR_CREDENTIALS,{error:n});default:return e(h.MCP$TEST_ERROR_UNKNOWN,{error:n})}}function Z(e){let t=/\[([^\]]+)\]\(([^)]+)\)/g,n=[],r=0;for(let i of e.matchAll(t))i.index>r&&n.push(e.slice(r,i.index)),n.push((0,N.jsx)(`a`,{href:/^https?:\/\//i.test(i[2])?i[2]:`#`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-white transition-colors`,children:i[1]},i.index)),r=i.index+i[0].length;return r<e.length&&n.push(e.slice(r)),n}function Q(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?!1:[`api_key`,`bearer`].includes(e.auth.strategy)}function it(e){return!!e&&e.auth.strategy===`oauth2`}function at(e){return e.transport.kind===`stdio`?e.auth.apiKeyOptional??!1:e.auth.apiKeyOptional??e.transport.apiKeyOptional??!1}function $(e){return e?.transport.kind!==`shttp`&&e?.transport.kind!==`sse`?[]:e.transport.headerFields??[]}function ot(e){let t={},n={},r=ce(e),i=r?.transport;if(i?.kind===`stdio`){for(let e of i.envFields??[])t[e.key]=``,n[e.key]=e.type===`password`;for(let e of i.argFields??[])t[e.key]=``}else if(i?.kind===`shttp`||i?.kind===`sse`){t.url=i.url;for(let e of $(r))t[e.key]=``,n[e.key]=e.type===`password`;Q(r)&&(t.api_key=``,r?.auth.credentialSecretName&&(n.api_key=r.auth.saveCredentialAsSecretByDefault??!1))}return{values:t,errors:{},savedAsSecret:n}}function st({entry:e,existingServers:t,onClose:n,onSuccess:r}){let{t:a}=i(`openhands`),{mutate:o,isPending:s}=et(),{mutate:c,isPending:d}=tt(),f=rt(),{backend:ee}=te(),p=ee.kind===`cloud`,[m,g]=M.useState(()=>ot(e)),_=M.useRef(m);_.current=m;let[v,y]=M.useState(null),[b,x]=M.useState(!1),[S,C]=M.useState(!1),w=ce(e),E=w?.transport,O=d||S||s||b,k=(e,t)=>{g(n=>({...n,values:{...n.values,[e]:t},errors:{...n.errors,[e]:null}})),y(null)},A=(e,t)=>{g(n=>({...n,savedAsSecret:{...n.savedAsSecret,[e]:t}}))},le=()=>{let e=w?.auth.credentialSecretName,t=_.current.values.api_key?.trim();return!e||!t||!_.current.savedAsSecret.api_key?Promise.resolve():f([{key:e,label:w.auth.credentialLabel??e,type:`password`,required:!0}],{[e]:t},{[e]:!0})},j=()=>E?.kind===`stdio`?f(E.envFields??[],_.current.values,_.current.savedAsSecret):E?.kind===`shttp`||E?.kind===`sse`?Promise.all([le(),f($(w),_.current.values,_.current.savedAsSecret)]).then(()=>void 0):Promise.resolve(),F=i=>{if(i.auth?.strategy===`oauth2`){C(!0),V.authorizeOAuth(i).then(s=>{if(!s.ok){y(X(a,s.error_kind,s.error));return}let c=s.oauth_state?{...i,auth:{...i.auth,state:s.oauth_state}}:i;o(c,{onSuccess:()=>{p||Y(c,s,t),l(a(h.MCP$INSTALL_SUCCESS)),x(!0),(async()=>{try{await j()}finally{r?.(e),n()}})()},onError:e=>{y(u(e)||a(h.ERROR$GENERIC))}})}).catch(e=>{y(u(e)||a(h.ERROR$GENERIC))}).finally(()=>C(!1));return}c(i,{onSuccess:s=>{if(!s.ok){y(X(a,s.error_kind,s.error));return}let c=s.oauth_state&&i.auth?.strategy===`oauth2`?{...i,auth:{...i.auth,state:s.oauth_state}}:i;o(c,{onSuccess:()=>{p||Y(c,s,t),l(a(h.MCP$INSTALL_SUCCESS)),x(!0),(async()=>{try{await j()}finally{r?.(e),n()}})()},onError:e=>{y(u(e)||a(h.ERROR$GENERIC))}})},onError:e=>{y(u(e)||a(h.ERROR$GENERIC))}})},ue=()=>{if(E?.kind!==`shttp`&&E?.kind!==`sse`||!w)return;let t=m.values.api_key?.trim()??``,n=E.urlEditable?m.values.url?.trim()??``:E.url,r=it(w),i=Q(w),o=$(w),s={};if(!n)s.url=a(h.SETTINGS$MCP_ERROR_URL_REQUIRED);else try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s.url=a(h.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL))}catch{s.url=a(h.SETTINGS$MCP_ERROR_URL_INVALID)}for(let e of o)e.required&&!(m.values[e.key]??``).trim()&&(s[e.key]=a(h.MCP$ERROR_FIELD_REQUIRED));if(!r&&i&&!at(w)&&!t&&(s.api_key=a(h.MCP$ERROR_FIELD_REQUIRED)),Object.values(s).some(Boolean)){g(e=>({...e,errors:s}));return}let c=r?se(w):void 0,l=Object.fromEntries(o.map(e=>[e.key,m.values[e.key]?.trim()??``]).filter(([,e])=>e)),u=Object.keys(l).length>0,d;r?d={strategy:`oauth2`,...c&&{authentication:c}}:i&&t?d=w.auth.strategy===`api_key`?{strategy:`api_key`,value:t,...w.auth.apiKeyHeaderName&&{header_name:w.auth.apiKeyHeaderName}}:{strategy:`bearer`,value:t}:u&&(d={strategy:`header`,headers:l}),F({id:`${E.kind}-${oe()}`,type:E.kind,name:ne(e.id),url:n,...d&&{auth:d},...u&&d?.strategy!==`header`&&{headers:l}})},de=()=>{if(E?.kind!==`stdio`)return;let e=E,t={};for(let n of e.envFields??[])n.required&&!(m.values[n.key]??``).trim()&&(t[n.key]=a(h.MCP$ERROR_FIELD_REQUIRED));for(let n of e.argFields??[])n.required&&!(m.values[n.key]??``).trim()&&(t[n.key]=a(h.MCP$ERROR_FIELD_REQUIRED));if(Object.values(t).some(Boolean)){g(e=>({...e,errors:t}));return}let n={};for(let t of e.envFields??[]){let e=m.values[t.key]?.trim();e&&(n[t.key]=e)}let r=[];for(let t of e.argFields??[]){let e=m.values[t.key]?.trim();if(e)for(let t of e.split(/\s+/))t&&r.push(t)}F({id:`stdio-${oe()}`,type:`stdio`,name:e.serverName,command:e.command,args:[...e.args,...r],...Object.keys(n).length>0&&{env:n}})};return(0,N.jsx)(re,{onClose:n,"aria-label":e.name,children:(0,N.jsxs)(`form`,{"data-testid":`mcp-install-modal`,"data-marketplace-id":e.id,onSubmit:e=>(e.preventDefault(),y(null),E?.kind===`shttp`||E?.kind===`sse`?ue():de()),className:`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[85vh] overflow-y-auto custom-scrollbar`,children:[(0,N.jsx)(ae,{onClose:n,testId:`mcp-install-modal-close`,disabled:O}),(0,N.jsxs)(`div`,{className:`flex items-start gap-3 pr-6`,children:[(0,N.jsx)(fe,{entry:e}),(0,N.jsxs)(`div`,{className:`flex flex-col flex-1`,children:[(0,N.jsx)(`h2`,{className:ie,children:e.name}),(0,N.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.description})]})]}),e.installHint&&(0,N.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:e.installHint}),e.docsUrl&&(0,N.jsx)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noreferrer`,className:`text-xs text-[var(--oh-muted)] hover:text-white hover:underline self-start transition-colors`,children:a(h.MCP$VIEW_DOCS)}),(0,N.jsx)(`div`,{className:`flex flex-col gap-3`,children:(()=>{if(E?.kind===`shttp`||E?.kind===`sse`){let e=it(w),t=Q(w),n=w?at(w):!1,r=w?.auth.credentialSecretName,i=$(w);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(D,{testId:`mcp-install-field-url`,name:`url`,type:`url`,label:a(h.SETTINGS$MCP_URL),value:m.values.url??E.url,onChange:e=>k(`url`,e),isDisabled:!E.urlEditable,className:`w-full`}),m.errors.url&&(0,N.jsx)(`p`,{className:`text-xs text-red-500`,children:m.errors.url}),i.map(e=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(D,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:m.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,N.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Z(e.helperText)}),m.errors[e.key]&&(0,N.jsx)(`p`,{className:`text-xs text-red-500`,children:m.errors[e.key]}),e.key in m.savedAsSecret&&(0,N.jsx)(P,{fieldKey:e.key,checked:m.savedAsSecret[e.key]??!1,onToggle:t=>A(e.key,t)})]},e.key)),e?(0,N.jsxs)(`div`,{"data-testid":`mcp-install-oauth-info`,className:`flex flex-col gap-2 p-3 rounded-lg border border-[var(--oh-border)] bg-base-tertiary`,children:[(0,N.jsx)(`p`,{className:`text-sm text-secondary-light`,children:a(h.MCP$OAUTH_CONNECT_INFO)}),(0,N.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:a(h.MCP$OAUTH_CONNECT_HINT)})]}):t?(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(D,{testId:`mcp-install-field-api_key`,name:`api_key`,type:`password`,label:w?.auth.credentialLabel??a(h.SETTINGS$MCP_API_KEY),value:m.values.api_key??``,onChange:e=>k(`api_key`,e),placeholder:w?.auth.credentialPlaceholder??a(h.SETTINGS$MCP_API_KEY_PLACEHOLDER),showOptionalTag:n,required:!n,className:`w-full`}),w?.auth.credentialHelp&&(0,N.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Z(w.auth.credentialHelp)}),m.errors.api_key&&(0,N.jsx)(`p`,{className:`text-xs text-red-500`,children:m.errors.api_key}),r&&(0,N.jsx)(P,{fieldKey:r,checked:m.savedAsSecret.api_key??!1,onToggle:e=>A(`api_key`,e)})]}):null]})}if(E?.kind!==`stdio`)return null;let e=E;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(D,{testId:`mcp-install-field-command-readonly`,name:`command-readonly`,type:`text`,label:a(h.MCP$COMMAND_LABEL),value:`${e.command} ${e.args.join(` `)}`.trim(),onChange:()=>{},isDisabled:!0,className:`w-full`}),(e.envFields??[]).map(e=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(D,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:m.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,N.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Z(e.helperText)}),m.errors[e.key]&&(0,N.jsx)(`p`,{className:`text-xs text-red-500`,children:m.errors[e.key]}),e.key in m.savedAsSecret&&(0,N.jsx)(P,{fieldKey:e.key,checked:m.savedAsSecret[e.key],onToggle:t=>A(e.key,t)})]},e.key)),(e.argFields??[]).map(e=>(0,N.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,N.jsx)(D,{testId:`mcp-install-field-${e.key}`,name:e.key,type:e.type===`password`?`password`:`text`,label:e.label,value:m.values[e.key]??``,onChange:t=>k(e.key,t),placeholder:e.placeholder,required:e.required,showOptionalTag:!e.required,className:`w-full`}),e.helperText&&(0,N.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:Z(e.helperText)}),m.errors[e.key]&&(0,N.jsx)(`p`,{className:`text-xs text-red-500`,children:m.errors[e.key]})]},e.key))]})})()}),v&&(0,N.jsx)(`p`,{"data-testid":`mcp-install-modal-error`,className:`text-sm text-red-500 whitespace-pre-wrap`,children:v}),(0,N.jsxs)(`div`,{className:`flex justify-end gap-2 mt-2`,children:[(0,N.jsx)(T,{type:`button`,variant:`secondary`,onClick:n,testId:`mcp-install-cancel`,isDisabled:O,children:a(h.BUTTON$CANCEL)}),(0,N.jsx)(T,{type:`submit`,variant:`primary`,isDisabled:O,testId:`mcp-install-submit`,children:a(d||S?h.MCP$VERIFYING:s||b?h.SETTINGS$SAVING:h.MCP$INSTALL_BUTTON)})]})]})})}export{Qe as a,Ye as c,U as d,V as f,j as h,et as i,Ge as l,fe as m,X as n,$e as o,Pe as p,tt as r,Y as s,st as t,Ke 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{H as r,R as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{t as s,z as c}from"./utils-DsWhWn2F.js";import{t as l}from"./modal-backdrop-X-vKo61e.js";import{r as u,t as d}from"./modal-body-C3bGicn4.js";import{t as f}from"./brand-button-BUlDL-mz.js";import{t as p}from"./modal-close-button-vxkAIRyZ.js";import{t as m}from"./settings-input-BEaTCem1.js";import{n as h}from"./use-create-conversation-CakhLF0X.js";import{r as g}from"./typography-B1UxuuEC.js";import{n as _,t as v}from"./vendor~launch-ChXCOGw8.js";var y=e(t(),1),b=n();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:s}=o(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[s(c.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[s(c.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=o(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(c.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:s(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6`,children:[a(c.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:s(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(c.LAUNCH$ADDITIONAL_PLUGINS):a(c.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(c.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?c.LAUNCH$STARTING:c.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=o(`openhands`),i={no_plugins:r(c.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(c.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(c.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(c.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(c.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(c.LAUNCH$TRY_AGAIN)})]})]})})}var D=a(function(){let[e]=r(),t=i(),{t:n}=o(`openhands`),a=h(),[s,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,r)=>{l(null);try{t(`/conversations/${(await a.mutateAsync({plugins:e,query:r,entryPoint:`launch_deeplink`})).conversation_id}`)}catch{l(n(c.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):s?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:a.isPending,onStartConversation:d,onClose:f})})});export{D 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{U as r,W as i,z as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js";import{t as o}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js";import{t as s,z as c}from"./utils-BgGG1znF.js";import{t as l}from"./modal-backdrop-X-vKo61e.js";import{r as u,t as d}from"./modal-body-CMsDpalT.js";import{t as f}from"./brand-button-DGN6Y9o6.js";import{t as p}from"./modal-close-button-DyxBZaAb.js";import{t as m}from"./settings-input-B-q2gkVy.js";import{n as h}from"./use-create-conversation-nOJ6Um5h.js";import{r as g}from"./typography-iYhzLlHO.js";import{n as _,t as v}from"./vendor~launch-ChXCOGw8.js";var y=e(t(),1),b=n();function x({pluginIndex:e,paramKey:t,paramValue:n,onParameterChange:r}){let i=`plugin-${e}-param-${t}`;return typeof n==`boolean`?(0,b.jsxs)(`label`,{htmlFor:i,className:`flex w-full cursor-pointer items-center gap-2.5`,children:[(0,b.jsx)(`input`,{id:i,"data-testid":i,type:`checkbox`,checked:n,onChange:n=>r(e,t,n.target.checked),className:`h-4 w-4 shrink-0 rounded`}),(0,b.jsx)(`span`,{className:`text-sm`,children:t})]}):typeof n==`number`?(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`number`,label:t,value:String(n),className:`w-full`,onChange:n=>r(e,t,n===``?0:parseFloat(n)||0)}):(0,b.jsx)(m,{testId:i,name:`plugin-${e}-param-${t}`,type:`text`,label:t,value:String(n??``),className:`w-full`,onChange:n=>r(e,t,n)})}function S({plugin:e,originalIndex:t,isExpanded:n,onToggle:r,getPluginDisplayName:i,onParameterChange:a}){let{t:s}=o(`openhands`);return e.parameters&&Object.keys(e.parameters).length>0?(0,b.jsxs)(`div`,{className:`rounded-lg border border-[var(--oh-border)] bg-tertiary`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full items-center justify-between px-4 py-3 text-left hover:bg-base-tertiary rounded-t-lg cursor-pointer`,"data-testid":`plugin-section-${t}`,children:[(0,b.jsx)(g.Text,{className:`text-base font-normal`,children:i(e)}),n?(0,b.jsx)(v,{className:`h-5 w-5 text-white`}):(0,b.jsx)(_,{className:`h-5 w-5 text-white`})]}),n&&(0,b.jsxs)(`div`,{className:`border-t border-[var(--oh-border-subtle)] px-4 pb-3`,children:[e.ref&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[s(c.LAUNCH$PLUGIN_REF),` `,e.ref]}),e.repo_path&&(0,b.jsxs)(`div`,{className:`mb-2 text-sm text-white`,children:[s(c.LAUNCH$PLUGIN_PATH),` `,e.repo_path]}),(0,b.jsx)(`div`,{className:`flex flex-col gap-4`,children:Object.entries(e.parameters||{}).map(([e,n])=>(0,b.jsx)(x,{pluginIndex:t,paramKey:e,paramValue:n,onParameterChange:a},e))})]})]}):null}function C({plugins:e,message:t,isLoading:n=!1,onStartConversation:r,onClose:i}){let{t:a}=o(`openhands`),[m,h]=y.useState(e),[_,v]=y.useState(()=>{let t={};return e.forEach((e,n)=>{e.parameters&&Object.keys(e.parameters).length>0&&(t[n]=!0)}),t}),[x,C]=y.useState(!1),w=m.filter(e=>e.parameters&&Object.keys(e.parameters).length>0),T=m.filter(e=>!e.parameters||Object.keys(e.parameters).length===0),E=e=>{v(t=>({...t,[e]:!t[e]}))},D=(e,t,n)=>{h(r=>{let i=[...r],a={...i[e]};return a.parameters={...a.parameters,[t]:n},i[e]=a,i})},O=e=>{let{source:t,repo_path:n}=e;if(n){let e=n.split(`/`);return e[e.length-1]}if(t.startsWith(`github:`))return t.replace(`github:`,``);if(t.includes(`/`)){let e=t.split(`/`);return e[e.length-1].replace(`.git`,``)}return t},k=e=>{let{source:t}=e;return t.startsWith(`github:`)?t.replace(`github:`,``):t.includes(`github.com/`)&&t.split(`github.com/`)[1]?.replace(`.git`,``)||t},A=()=>{let e=m.map(e=>k(e));return[...new Set(e)]},j=()=>{r(m,t)},M=m.length===1?O(m[0]):a(c.LAUNCH$MODAL_TITLE_GENERIC);return(0,b.jsx)(l,{onClose:i,children:(0,b.jsxs)(`div`,{"data-testid":`plugin-launch-modal`,className:s(`relative bg-base-secondary p-6 rounded-xl flex flex-col gap-4 border border-[var(--oh-border)] max-h-[80vh]`,u(`md`),d),children:[(0,b.jsx)(p,{onClose:i,testId:`close-button`}),(0,b.jsxs)(g.H2,{className:`pr-6`,children:[a(c.LAUNCH$MODAL_TITLE),` `,M]}),t&&(0,b.jsx)(`p`,{className:`text-sm text-white`,children:t}),(0,b.jsxs)(`div`,{className:`flex-1 overflow-y-auto custom-scrollbar`,children:[w.length>0&&(0,b.jsx)(`div`,{className:`space-y-3`,children:m.map((e,t)=>(0,b.jsx)(S,{plugin:e,originalIndex:t,isExpanded:!!_[t],onToggle:()=>E(t),getPluginDisplayName:O,onParameterChange:D},`plugin-${t}`))}),T.length>0&&(0,b.jsxs)(`div`,{className:s(w.length>0&&`mt-4`),children:[(0,b.jsx)(g.H3,{className:`mb-2 text-white`,children:w.length>0?a(c.LAUNCH$ADDITIONAL_PLUGINS):a(c.LAUNCH$PLUGINS)}),(0,b.jsx)(`div`,{className:`space-y-2`,children:T.map((e,t)=>(0,b.jsxs)(`div`,{className:`rounded-md bg-tertiary px-3 py-2 text-sm`,children:[(0,b.jsx)(`div`,{className:`font-medium`,children:O(e)}),(0,b.jsxs)(`div`,{className:`text-xs text-white mt-1`,children:[k(e),e.repo_path&&(0,b.jsxs)(`span`,{className:`ml-1`,children:[`/ `,e.repo_path]}),e.ref&&(0,b.jsxs)(`span`,{className:`ml-2`,children:[`@ `,e.ref]})]})]},`simple-plugin-${t}`))})]})]}),(0,b.jsxs)(`div`,{className:`pt-4 border-t border-[var(--oh-border-subtle)]`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,b.jsx)(`input`,{id:`trust-checkbox`,"data-testid":`trust-checkbox`,type:`checkbox`,checked:x,onChange:e=>C(e.target.checked),className:`mt-1 h-4 w-4 flex-shrink-0`}),(0,b.jsx)(`label`,{htmlFor:`trust-checkbox`,className:`text-sm text-white`,children:a(c.LAUNCH$TRUST_SKILL_CHECKBOX,{sources:A().join(`, `),interpolation:{escapeValue:!1}})})]}),(0,b.jsx)(`div`,{className:`flex w-full justify-end mt-8`,children:(0,b.jsx)(f,{testId:`start-conversation-button`,type:`button`,variant:`primary`,onClick:j,isDisabled:n||!x,className:`px-4`,children:a(n?c.LAUNCH$STARTING:c.LAUNCH$START_CONVERSATION)})})]})]})})}function w(e){if(e)return e.replace(/<[^>]*>/g,``).slice(0,500)||void 0}function T(e){let t=e.get(`plugins`);if(t)try{let n=atob(t),r=JSON.parse(n);if(!Array.isArray(r))return{plugins:[],error:`invalid_format`};let i=[];for(let e of r){if(typeof e!=`object`||!e||typeof e.source!=`string`)return{plugins:[],error:`invalid_format`};i.push({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null,parameters:e.parameters??null})}return i.length===0?{plugins:[],error:`no_plugins`}:{plugins:i,message:w(e.get(`message`))}}catch{return{plugins:[],error:`invalid_format`}}let n=e.get(`plugin_source`);return n?{plugins:[{source:n,ref:e.get(`plugin_ref`)??null,repo_path:e.get(`plugin_repo_path`)??null,parameters:null}],message:w(e.get(`message`))}:{plugins:[],error:`no_plugins`}}function E({errorType:e,onGoHome:t,onTryAgain:n}){let{t:r}=o(`openhands`),i={no_plugins:r(c.LAUNCH$ERROR_NO_PLUGINS),invalid_format:r(c.LAUNCH$ERROR_INVALID_FORMAT),creation_failed:r(c.LAUNCH$ERROR_CREATION_FAILED)};return(0,b.jsx)(`div`,{className:`flex h-full items-center justify-center`,"data-testid":`launch-error`,children:(0,b.jsxs)(`div`,{className:`max-w-md rounded-lg bg-[var(--oh-surface)] p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`mb-4 text-xl font-medium text-red-400`,children:r(c.LAUNCH$ERROR_TITLE)}),(0,b.jsx)(`p`,{className:`mb-6 text-[var(--oh-text-tertiary)]`,children:i[e]}),(0,b.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md bg-tertiary px-4 py-2 text-sm text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`go-home-button`,children:r(c.LAUNCH$GO_HOME)}),n&&(0,b.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-md bg-blue-600 px-4 py-2 text-sm text-white hover:bg-blue-700`,"data-testid":`try-again-button`,children:r(c.LAUNCH$TRY_AGAIN)})]})]})})}var D=i(function(){let[e]=r(),t=a(),{t:n}=o(`openhands`),i=h(),[s,l]=y.useState(null),u=y.useMemo(()=>T(e),[e]),d=async(e,r)=>{l(null);try{t(`/conversations/${(await i.mutateAsync({plugins:e,query:r,entryPoint:`launch_deeplink`})).conversation_id}`)}catch{l(n(c.LAUNCH$ERROR_CREATION_UNKNOWN))}},f=()=>{t(`/conversations`)};return u.error?(0,b.jsx)(E,{errorType:u.error,onGoHome:f}):s?(0,b.jsx)(E,{errorType:`creation_failed`,onGoHome:f,onTryAgain:()=>{l(null),window.location.reload()}}):(0,b.jsx)(`div`,{className:`h-full`,"data-testid":`launch-route`,children:(0,b.jsx)(C,{plugins:u.plugins,message:u.message,isLoading:i.isPending,onStartConversation:d,onClose:f})})});export{D as default};
@@ -1 +1 @@
1
- import{E as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";var t=e(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]);export{t};
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(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]);export{t};