@openhands/agent-canvas 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-DP5rcauH.js → Trans-B7lYw4uD.js} +1 -1
  4. package/build/assets/{acp-providers-BHKZvEm5.js → acp-providers-WUD4tfSq.js} +1 -1
  5. package/build/assets/active-backend-context-mY7Gff5c.js +2 -0
  6. package/build/assets/{agent-context-settings-CTaN-Iw9.js → agent-context-settings-BTUmWEzL.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-CR4VTqv_.js → agent-profiles-settings-Ilqid_R5.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-C_7YnjzP.js +41 -0
  9. package/build/assets/{agent-settings-BIOsUglV.js → agent-settings-BGTyoT6X.js} +2 -2
  10. package/build/assets/agent-settings-CxfT4ksO.js +1 -0
  11. package/build/assets/{alert-banner-C1nzoXBC.js → alert-banner-eRyIwDyU.js} +1 -1
  12. package/build/assets/api-key-entry-screen-JOx3SH1-.js +1 -0
  13. package/build/assets/app-settings-D53QZy5p.js +1 -0
  14. package/build/assets/automation-detail-nEflClmc.js +2 -0
  15. package/build/assets/{automation-export-Bu-r-EzL.js → automation-export-BO_kfqC8.js} +1 -1
  16. package/build/assets/{automations-list-CYw7_6FR.js → automations-list-BYncC7gv.js} +1 -1
  17. package/build/assets/{back-nav-button-Be_L157B.js → back-nav-button-C02hGa8t.js} +1 -1
  18. package/build/assets/backend-form-modal-CKrBF80P.js +1 -0
  19. package/build/assets/{backend-synced-settings-badge-BNpEylNP.js → backend-synced-settings-badge-CQ9xtNWm.js} +1 -1
  20. package/build/assets/{badge-DwgrwohM.js → badge-CzXbf7tR.js} +1 -1
  21. package/build/assets/{base-modal-CSHhJTSr.js → base-modal-DkVyzFMt.js} +1 -1
  22. package/build/assets/{brand-button-CQO8oqVo.js → brand-button-BUlDL-mz.js} +1 -1
  23. package/build/assets/{browser-BUDJnBg4.js → browser-3QjrEr1D.js} +1 -1
  24. package/build/assets/{browser-tab-CEApjoEV.js → browser-tab-BijpUbdt.js} +1 -1
  25. package/build/assets/{chat-send-button-D4614wUz.js → chat-send-button-BKsVjhtA.js} +1 -1
  26. package/build/assets/check-CrxQfJZ2.js +1 -0
  27. package/build/assets/chevron-down-D_LsyTA7.js +1 -0
  28. package/build/assets/circle-check-DZn9HkLE.js +1 -0
  29. package/build/assets/{circle-plus-check-toggle-E3Ecb_gg.js → circle-plus-check-toggle-DdjUiOo1.js} +1 -1
  30. package/build/assets/cloud-funnel-analytics-NlmDoeo2.js +1 -0
  31. package/build/assets/{combobox-caret-C8_eGdp2.js → combobox-caret-Dl9UtvD6.js} +1 -1
  32. package/build/assets/{command-menu-N_BriUy8.js → command-menu-CvLPs7dg.js} +1 -1
  33. package/build/assets/{condenser-settings-Czi8cKxV.js → condenser-settings-C4Y9CzQV.js} +1 -1
  34. package/build/assets/{confirmation-modal-gZtbojCm.js → confirmation-modal-CRBJSllP.js} +1 -1
  35. package/build/assets/{context-menu-list-item-BTHGFhIx.js → context-menu-list-item-FGaafXGh.js} +1 -1
  36. package/build/assets/conversation-D_ORtpKC.js +1 -0
  37. package/build/assets/conversation-Dpc5nmGi.js +90 -0
  38. package/build/assets/conversation-panel-D_ORtpKC.js +1 -0
  39. package/build/assets/conversation-state-store-CGRQemtx.js +1 -0
  40. package/build/assets/{conversation-tab-empty-state-BCMHkGQk.js → conversation-tab-empty-state-CDjvNgpG.js} +1 -1
  41. package/build/assets/{copy-B8Y5ufoR.js → copy-Drwu97Gx.js} +1 -1
  42. package/build/assets/{copy-to-clipboard-button-C4l3CMSd.js → copy-to-clipboard-button-NbN1clVr.js} +1 -1
  43. package/build/assets/{device-verify-C_M7Z8xs.js → device-verify-CDm_WrVu.js} +1 -1
  44. package/build/assets/{dropdown-classes-DQlj-MpS.js → dropdown-classes-CqA2BTCL.js} +1 -1
  45. package/build/assets/{entry.client-DETaouwO.js → entry.client-BO2KQj0y.js} +2 -2
  46. package/build/assets/{enum-filter-dropdown-paB-lFSP.js → enum-filter-dropdown-DSqPZnsD.js} +1 -1
  47. package/build/assets/{environment-switch-overlay-D0FgCMqs.js → environment-switch-overlay-mGl2pqqx.js} +1 -1
  48. package/build/assets/extensions-hub-Br3Lgynp.js +1 -0
  49. package/build/assets/extensions-navigation-BQmstKDZ.js +1 -0
  50. package/build/assets/{external-link-Cnnd6ikC.js → external-link-D9B2QMPf.js} +1 -1
  51. package/build/assets/files-tab-4c9HFSLo.js +1 -0
  52. package/build/assets/{form-control-classes-CSPevi7c.js → form-control-classes-CtVAktAy.js} +1 -1
  53. package/build/assets/{format-time-delta-DuhE50B-.js → format-time-delta-DICE64sz.js} +1 -1
  54. package/build/assets/git-provider-icon-0PqmIS_S.js +1 -0
  55. package/build/assets/{highlighted-source-view-suUKd5if.js → highlighted-source-view-KMsA9c4a.js} +1 -1
  56. package/build/assets/home-D9JsyEmE.js +1 -0
  57. package/build/assets/{home-sN90Xcxp.js → home-TFhnmZLx.js} +1 -1
  58. package/build/assets/index-home-D9JsyEmE.js +1 -0
  59. package/build/assets/install-server-modal-BgGRnqA0.js +1 -0
  60. package/build/assets/{launch-Ccnhte5b.js → launch-DjkKw55l.js} +1 -1
  61. package/build/assets/{list-todo-_BXQzOiB.js → list-todo-BpAf7aOT.js} +1 -1
  62. package/build/assets/{llm-not-configured-banner-DTWzISnk.js → llm-not-configured-banner-Y4W9-sar.js} +4 -4
  63. package/build/assets/llm-settings-D8zNkIlP.js +1 -0
  64. package/build/assets/llm-settings-nPwv7hKu.js +1 -0
  65. package/build/assets/{llm-subscription-service-W5BprsNA.js → llm-subscription-service-COTgZc1C.js} +1 -1
  66. package/build/assets/loader-circle-CGD6-Vak.js +1 -0
  67. package/build/assets/{loading-spinner-CcpnCr_d.js → loading-spinner-DRFyh6Iy.js} +1 -1
  68. package/build/assets/manage-backends-modal-DiRWE3tJ.js +1 -0
  69. package/build/assets/manifest-1cf33a7b.js +1 -0
  70. package/build/assets/markdown-renderer-U40HF0Ak.js +8 -0
  71. package/build/assets/mcp-xDMaHzOw.js +9 -0
  72. package/build/assets/{messages-DINDkPNK.js → messages-CdNfZPgd.js} +2 -2
  73. package/build/assets/{modal-body-DQhiw-AR.js → modal-body-C3bGicn4.js} +1 -1
  74. package/build/assets/{modal-classes-YaEEa5eZ.js → modal-classes-DFFO6BMU.js} +1 -1
  75. package/build/assets/{modal-close-button-turIYn0t.js → modal-close-button-vxkAIRyZ.js} +1 -1
  76. package/build/assets/{onboarding-BegDrOKn.js → onboarding-DWuFieEA.js} +1 -1
  77. package/build/assets/onboarding-modal-C8m72Dpb.js +1 -0
  78. package/build/assets/organization-service.api-CQ73CB-S.js +1 -0
  79. package/build/assets/{pencil-8_lvWDoZ.js → pencil-DzW2GB2M.js} +1 -1
  80. package/build/assets/{planner-tab-w6HT0N_A.js → planner-tab-YG0bGxDY.js} +1 -1
  81. package/build/assets/plugins-management-service-ijhH8OSh.js +1 -0
  82. package/build/assets/plus-CTGLo3aa.js +1 -0
  83. package/build/assets/profiles-service.api-C32pPm70.js +1 -0
  84. package/build/assets/providers-DuSn9s2i.js +1 -0
  85. package/build/assets/proxy-BiyDhMBd.js +1 -0
  86. package/build/assets/{puzzle-DXWdfaa7.js → puzzle-DlqT0yvr.js} +1 -1
  87. package/build/assets/{recommended-automations-launcher-BF2mtAKw.js → recommended-automations-launcher-Dru1yN46.js} +2 -2
  88. package/build/assets/{refresh-cw-D7CYLy-d.js → refresh-cw-Br5254f4.js} +1 -1
  89. package/build/assets/root-DOLLQteU.js +2 -0
  90. package/build/assets/root-layout-xmylWoew.js +3 -0
  91. package/build/assets/schema-field-htfNouTG.js +1 -0
  92. package/build/assets/{sdk-section-page-BW-i45yr.js → sdk-section-page-D0K1dBQY.js} +1 -1
  93. package/build/assets/search-BrpWXWUi.js +1 -0
  94. package/build/assets/secrets-service-Dbv5Zb8G.js +1 -0
  95. package/build/assets/{secrets-settings-D7U1ErCH.js → secrets-settings-Da4SSaX9.js} +1 -1
  96. package/build/assets/{segmented-toggle-DbbD3Tve.js → segmented-toggle-CZKOdIly.js} +1 -1
  97. package/build/assets/settings-F4a09IxY.js +1 -0
  98. package/build/assets/{settings-dropdown-input-Dx6vlkgf.js → settings-dropdown-input-jOiv5Yrk.js} +1 -1
  99. package/build/assets/{settings-index-COAdxm2Q.js → settings-index-CyJBf5NA.js} +1 -1
  100. package/build/assets/{settings-input-BjW_zyTN.js → settings-input-BEaTCem1.js} +1 -1
  101. package/build/assets/{settings-list-classes-gQdBahdt.js → settings-list-classes-VqMzkYYt.js} +1 -1
  102. package/build/assets/{settings-modal-CFnbQ8_4.js → settings-modal-C-S1NpbC.js} +1 -1
  103. package/build/assets/settings-service.api-CTJRrvMu.js +1 -0
  104. package/build/assets/{settings-switch-UNSf8K8I.js → settings-switch-B405oU_v.js} +1 -1
  105. package/build/assets/{shared-conversation-CnMxy7p_.js → shared-conversation-BvWtTwES.js} +1 -1
  106. package/build/assets/{sidebar-layout-DXHtbEj1.js → sidebar-layout-BGMuyC86.js} +1 -1
  107. package/build/assets/{sidebar-mobile-menu-toggle-U78hQRJ1.js → sidebar-mobile-menu-toggle-xiKoUfGa.js} +1 -1
  108. package/build/assets/{sidebar-nav-link-pvUivfK2.js → sidebar-nav-link-DA4_ct9G.js} +1 -1
  109. package/build/assets/{sidebar-store-DwrYKwYr.js → sidebar-store-FRJ3rADB.js} +1 -1
  110. package/build/assets/{skill-card-pill-row-D7XCz5uk.js → skill-card-pill-row-BMdhr_sd.js} +1 -1
  111. package/build/assets/{skill-icon-badge-HqBWZ2Eq.js → skill-icon-badge-CGUkgcVH.js} +1 -1
  112. package/build/assets/{skills-plugins-BPhaNpfx.js → skills-plugins-C5eJnyft.js} +1 -1
  113. package/build/assets/{skills-settings-CcwMtnnJ.js → skills-settings-pUxMr6WZ.js} +1 -1
  114. package/build/assets/{styled-tooltip-DsjDnR_W.js → styled-tooltip-B3kIdVyH.js} +1 -1
  115. package/build/assets/{task-list-tab-BmaTwjaS.js → task-list-tab-B3k4W1cK.js} +1 -1
  116. package/build/assets/{terminal-BRcoba5B.js → terminal-CBI_41Zc.js} +1 -1
  117. package/build/assets/{toggle-switch-BptY3XRG.js → toggle-switch-DYRr9CAR.js} +1 -1
  118. package/build/assets/{trash-2-Bq4lHbTB.js → trash-2-gZPlx23R.js} +1 -1
  119. package/build/assets/{typography-C6fuRTTT.js → typography-B1UxuuEC.js} +1 -1
  120. package/build/assets/{use-acp-credential-form-B0_pZ_uS.js → use-acp-credential-form-CjSvKWFH.js} +1 -1
  121. package/build/assets/use-activate-agent-profile-DCRf47e-.js +1 -0
  122. package/build/assets/use-agent-profiles-DmT9zxAN.js +1 -0
  123. package/build/assets/{use-can-manage-org-profiles-CrG1km7R.js → use-can-manage-org-profiles-vBiP7rHF.js} +1 -1
  124. package/build/assets/use-cloud-current-user-id-BMq9gw93.js +1 -0
  125. package/build/assets/use-config-C959QcRC.js +1 -0
  126. package/build/assets/{use-create-conversation-Dsa4nzU9.js → use-create-conversation-CakhLF0X.js} +1 -1
  127. package/build/assets/{use-create-secret-BnxuAjDt.js → use-create-secret-RT4QtSS9.js} +1 -1
  128. package/build/assets/use-llm-profiles-CdaxVpyY.js +1 -0
  129. package/build/assets/use-onboarding-completion-CJU4MNAY.js +1 -0
  130. package/build/assets/use-plugins-marketplace-D-93nqtJ.js +1 -0
  131. package/build/assets/{use-save-agent-profile-2Mk9ZX37.js → use-save-agent-profile-DGJ3-u0M.js} +1 -1
  132. package/build/assets/{use-save-settings-BRh9p_fv.js → use-save-settings--C6LZXfI.js} +1 -1
  133. package/build/assets/use-settings-DIAo5KFk.js +1 -0
  134. package/build/assets/use-settings-nav-items-DPK5sxvR.js +16 -0
  135. package/build/assets/use-skills-D_mLhYNa.js +1 -0
  136. package/build/assets/use-tracking-COqZLobY.js +1 -0
  137. package/build/assets/{use-user-conversation-GnGhs_Ob.js → use-user-conversation-DhcAEyJX.js} +1 -1
  138. package/build/assets/{useMutation-DyQXZFEF.js → useMutation-DHLpZ6J0.js} +1 -1
  139. package/build/assets/utils-DsWhWn2F.js +1 -0
  140. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js} +1 -1
  141. package/build/assets/{vendor~files-tab-vm3f67Pz.js → vendor~files-tab-atebg0iG.js} +1 -1
  142. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-kX4LrGQC.js → vendor~index-home~home~conversation-panel~conversation-G9DMrR7m.js} +1 -1
  143. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DpA6fir3.js → vendor~root-layout~conversation-panel~conversation-DEhW1h3I.js} +1 -1
  144. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js → vendor~root-layout~index-home~home~conversation-panel~conversation-Acmf1sKj.js} +1 -1
  145. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js} +1 -1
  146. package/build/assets/{vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js → vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js} +1 -1
  147. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js} +1 -1
  148. package/build/assets/{verification-settings-CaCzojbc.js → verification-settings-Vr5cN4md.js} +1 -1
  149. package/build/assets/x-Dx_JbpHA.js +1 -0
  150. package/build/favicon-16x16.png +0 -0
  151. package/build/favicon-32x32.png +0 -0
  152. package/build/favicon.ico +0 -0
  153. package/build/index.html +4 -4
  154. package/build/locales/ar/openhands.json +2 -0
  155. package/build/locales/ca/openhands.json +2 -0
  156. package/build/locales/de/openhands.json +2 -0
  157. package/build/locales/en/openhands.json +2 -0
  158. package/build/locales/es/openhands.json +2 -0
  159. package/build/locales/fr/openhands.json +2 -0
  160. package/build/locales/it/openhands.json +2 -0
  161. package/build/locales/ja/openhands.json +2 -0
  162. package/build/locales/ko-KR/openhands.json +2 -0
  163. package/build/locales/no/openhands.json +2 -0
  164. package/build/locales/pt/openhands.json +2 -0
  165. package/build/locales/tr/openhands.json +2 -0
  166. package/build/locales/uk/openhands.json +2 -0
  167. package/build/locales/zh-CN/openhands.json +2 -0
  168. package/build/locales/zh-TW/openhands.json +2 -0
  169. package/config/defaults.json +4 -4
  170. package/dist/api/agent-server-adapter.cjs +1 -1
  171. package/dist/api/agent-server-adapter.cjs.map +1 -1
  172. package/dist/api/agent-server-adapter.js +7 -7
  173. package/dist/api/agent-server-adapter.js.map +1 -1
  174. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  175. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  176. package/dist/api/automation-service/automation-service.api.js +95 -95
  177. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  178. package/dist/api/backend-registry/storage.cjs +1 -1
  179. package/dist/api/backend-registry/storage.cjs.map +1 -1
  180. package/dist/api/backend-registry/storage.js +1 -1
  181. package/dist/api/backend-registry/storage.js.map +1 -1
  182. package/dist/api/backend-registry/types.d.ts +2 -0
  183. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  184. package/dist/api/cloud/conversation-service.api.js +22 -22
  185. package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
  186. package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
  187. package/dist/api/mcp-service/mcp-service.api.js +19 -19
  188. package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
  189. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  190. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  191. package/dist/api/settings-service/settings-service.api.js +26 -12
  192. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  193. package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
  194. package/dist/components/features/mcp-page/custom-server-editor.js +16 -16
  195. package/dist/components/features/mcp-page/installed-server-card.cjs +1 -1
  196. package/dist/components/features/mcp-page/installed-server-card.cjs.map +1 -1
  197. package/dist/components/features/mcp-page/installed-server-card.d.ts +2 -2
  198. package/dist/components/features/mcp-page/installed-server-card.js +6 -7
  199. package/dist/components/features/mcp-page/installed-server-card.js.map +1 -1
  200. package/dist/components/features/mcp-page/installed-servers-section.cjs +1 -1
  201. package/dist/components/features/mcp-page/installed-servers-section.cjs.map +1 -1
  202. package/dist/components/features/mcp-page/installed-servers-section.d.ts +2 -2
  203. package/dist/components/features/mcp-page/installed-servers-section.js +2 -2
  204. package/dist/components/features/mcp-page/installed-servers-section.js.map +1 -1
  205. package/dist/components/features/mcp-page/mcp-server-health.cjs +1 -1
  206. package/dist/components/features/mcp-page/mcp-server-health.js +4 -4
  207. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
  208. package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
  209. package/dist/components/features/settings/mcp-settings/mcp-server-form.js +2 -1
  210. package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
  211. package/dist/config/defaults.cjs +1 -1
  212. package/dist/config/defaults.cjs.map +1 -1
  213. package/dist/config/defaults.js +3 -3
  214. package/dist/config/defaults.js.map +1 -1
  215. package/dist/contexts/active-backend-context.cjs +1 -1
  216. package/dist/contexts/active-backend-context.cjs.map +1 -1
  217. package/dist/contexts/active-backend-context.d.ts +3 -2
  218. package/dist/contexts/active-backend-context.js +55 -42
  219. package/dist/contexts/active-backend-context.js.map +1 -1
  220. package/dist/favicon-16x16.png +0 -0
  221. package/dist/favicon-32x32.png +0 -0
  222. package/dist/favicon.ico +0 -0
  223. package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
  224. package/dist/hooks/mutation/use-update-mcp-server.js +5 -5
  225. package/dist/hooks/query/use-cloud-current-user-id.cjs +1 -1
  226. package/dist/hooks/query/use-cloud-current-user-id.cjs.map +1 -1
  227. package/dist/hooks/query/use-cloud-current-user-id.js +7 -5
  228. package/dist/hooks/query/use-cloud-current-user-id.js.map +1 -1
  229. package/dist/hooks/query/use-cloud-organizations.cjs +1 -1
  230. package/dist/hooks/query/use-cloud-organizations.cjs.map +1 -1
  231. package/dist/hooks/query/use-cloud-organizations.js +5 -1
  232. package/dist/hooks/query/use-cloud-organizations.js.map +1 -1
  233. package/dist/hooks/use-can-manage-org-profiles.cjs +1 -1
  234. package/dist/hooks/use-can-manage-org-profiles.cjs.map +1 -1
  235. package/dist/hooks/use-can-manage-org-profiles.js +2 -1
  236. package/dist/hooks/use-can-manage-org-profiles.js.map +1 -1
  237. package/dist/hooks/use-tracking.cjs +1 -1
  238. package/dist/hooks/use-tracking.js +9 -9
  239. package/dist/i18n/declaration.cjs +1 -1
  240. package/dist/i18n/declaration.cjs.map +1 -1
  241. package/dist/i18n/declaration.d.ts +2 -0
  242. package/dist/i18n/declaration.js +1 -1
  243. package/dist/i18n/declaration.js.map +1 -1
  244. package/dist/i18n/translation.cjs +1 -1
  245. package/dist/i18n/translation.cjs.map +1 -1
  246. package/dist/i18n/translation.js +34 -0
  247. package/dist/i18n/translation.js.map +1 -1
  248. package/dist/locales/ar/openhands.json +2 -0
  249. package/dist/locales/ca/openhands.json +2 -0
  250. package/dist/locales/de/openhands.json +2 -0
  251. package/dist/locales/en/openhands.json +2 -0
  252. package/dist/locales/es/openhands.json +2 -0
  253. package/dist/locales/fr/openhands.json +2 -0
  254. package/dist/locales/it/openhands.json +2 -0
  255. package/dist/locales/ja/openhands.json +2 -0
  256. package/dist/locales/ko-KR/openhands.json +2 -0
  257. package/dist/locales/no/openhands.json +2 -0
  258. package/dist/locales/pt/openhands.json +2 -0
  259. package/dist/locales/tr/openhands.json +2 -0
  260. package/dist/locales/uk/openhands.json +2 -0
  261. package/dist/locales/zh-CN/openhands.json +2 -0
  262. package/dist/locales/zh-TW/openhands.json +2 -0
  263. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  264. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  265. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +9 -0
  266. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  267. package/dist/package.cjs +1 -1
  268. package/dist/package.cjs.map +1 -1
  269. package/dist/package.js +2 -2
  270. package/dist/package.js.map +1 -1
  271. package/dist/routes/app-settings.cjs +1 -1
  272. package/dist/routes/app-settings.js +5 -5
  273. package/dist/routes/mcp.cjs +1 -1
  274. package/dist/routes/mcp.cjs.map +1 -1
  275. package/dist/routes/mcp.js +73 -82
  276. package/dist/routes/mcp.js.map +1 -1
  277. package/dist/services/telemetry.cjs +1 -1
  278. package/dist/services/telemetry.cjs.map +1 -1
  279. package/dist/services/telemetry.d.ts +8 -0
  280. package/dist/services/telemetry.js +163 -116
  281. package/dist/services/telemetry.js.map +1 -1
  282. package/dist/types/mcp-server.d.ts +5 -0
  283. package/dist/types/settings.d.ts +3 -0
  284. package/dist/utils/mcp-config.cjs +1 -1
  285. package/dist/utils/mcp-config.cjs.map +1 -1
  286. package/dist/utils/mcp-config.d.ts +8 -0
  287. package/dist/utils/mcp-config.js +25 -20
  288. package/dist/utils/mcp-config.js.map +1 -1
  289. package/dist/utils/mcp-installed-servers.cjs +1 -1
  290. package/dist/utils/mcp-installed-servers.cjs.map +1 -1
  291. package/dist/utils/mcp-installed-servers.js +6 -3
  292. package/dist/utils/mcp-installed-servers.js.map +1 -1
  293. package/package.json +2 -2
  294. package/scripts/check-sdk-version-sync.mjs +6 -6
  295. package/scripts/dev-safe.mjs +2 -2
  296. package/build/assets/active-backend-context-BlZPzZNU.js +0 -1
  297. package/build/assets/agent-server-conversation-service.api-Btmi4q6d.js +0 -41
  298. package/build/assets/agent-settings-KQs-occT.js +0 -1
  299. package/build/assets/api-key-entry-screen-BhR24gkM.js +0 -1
  300. package/build/assets/app-settings-Bs4sY8WP.js +0 -1
  301. package/build/assets/automation-detail-CwDnJbYR.js +0 -2
  302. package/build/assets/backend-form-modal-Ce-KRHOJ.js +0 -1
  303. package/build/assets/check-BMOG005H.js +0 -1
  304. package/build/assets/chevron-down-CV1zZP_K.js +0 -1
  305. package/build/assets/circle-check-lvN_jFN5.js +0 -1
  306. package/build/assets/client-source-1v-kWLNU.js +0 -1
  307. package/build/assets/cloud-funnel-analytics-CasMM7EO.js +0 -1
  308. package/build/assets/conversation-C25pc2dT.js +0 -1
  309. package/build/assets/conversation-CObLYSJd.js +0 -90
  310. package/build/assets/conversation-panel-C25pc2dT.js +0 -1
  311. package/build/assets/conversation-state-store-DTq4hFoP.js +0 -1
  312. package/build/assets/extensions-hub-BKftOQ-X.js +0 -1
  313. package/build/assets/extensions-navigation-DF24q1H1.js +0 -1
  314. package/build/assets/files-tab-SAiFCnS5.js +0 -1
  315. package/build/assets/git-provider-icon-BREx-yUX.js +0 -1
  316. package/build/assets/home-EPNFgzUh.js +0 -1
  317. package/build/assets/index-home-EPNFgzUh.js +0 -1
  318. package/build/assets/install-server-modal-BI8yUfmr.js +0 -1
  319. package/build/assets/llm-settings-BXk5_Pac.js +0 -1
  320. package/build/assets/llm-settings-C1vpgWam.js +0 -1
  321. package/build/assets/loader-circle-6zlEYCJw.js +0 -1
  322. package/build/assets/manage-backends-modal-DhflyGTf.js +0 -1
  323. package/build/assets/manifest-8082e879.js +0 -1
  324. package/build/assets/markdown-renderer-CvOO0YIr.js +0 -8
  325. package/build/assets/mcp-CxLPda-W.js +0 -9
  326. package/build/assets/onboarding-modal-DdvE6rzw.js +0 -1
  327. package/build/assets/organization-service.api-CT2OQlLz.js +0 -1
  328. package/build/assets/plugins-management-service-DVkoM3eA.js +0 -1
  329. package/build/assets/plus-vIbGD459.js +0 -1
  330. package/build/assets/profiles-service.api-CBafmAPO.js +0 -1
  331. package/build/assets/providers-9UzRB9mT.js +0 -1
  332. package/build/assets/proxy-C79PCMjo.js +0 -1
  333. package/build/assets/root-Sj7W28yE.js +0 -2
  334. package/build/assets/root-layout-DbhKVoc7.js +0 -3
  335. package/build/assets/schema-field-CV6bFnoL.js +0 -1
  336. package/build/assets/search-sKuYKllf.js +0 -1
  337. package/build/assets/secrets-service-BjK-bPN2.js +0 -1
  338. package/build/assets/settings-Bj5Oo45A.js +0 -1
  339. package/build/assets/settings-service.api-DryhKdSr.js +0 -1
  340. package/build/assets/telemetry-cmCL3o6Z.js +0 -2
  341. package/build/assets/use-activate-agent-profile-DH33MvVj.js +0 -1
  342. package/build/assets/use-agent-profiles-Dmd_4H8q.js +0 -1
  343. package/build/assets/use-cloud-current-user-id-B6DP3s47.js +0 -1
  344. package/build/assets/use-config-Csy8EAP9.js +0 -1
  345. package/build/assets/use-llm-profiles-BMQoc612.js +0 -1
  346. package/build/assets/use-onboarding-completion-B-2BTS-y.js +0 -1
  347. package/build/assets/use-plugins-marketplace-PBc_XNz_.js +0 -1
  348. package/build/assets/use-settings-DBI44RnH.js +0 -1
  349. package/build/assets/use-settings-nav-items-Cva28C-c.js +0 -16
  350. package/build/assets/use-skills-RQsCtdzN.js +0 -1
  351. package/build/assets/use-tracking-CN1nIMnY.js +0 -1
  352. package/build/assets/utils-qjs_KuS4.js +0 -1
  353. package/build/assets/x-EjvKGawc.js +0 -1
package/README.md CHANGED
@@ -96,7 +96,7 @@ docker run -it --rm \
96
96
  -p 8000:8000 \
97
97
  -v "$HOME/.openhands:/home/openhands/.openhands" \
98
98
  -v "${PROJECTS_PATH}:/projects" \
99
- ghcr.io/openhands/agent-canvas:1.7.2 # x-release-please-version
99
+ ghcr.io/openhands/agent-canvas:1.8.0 # x-release-please-version
100
100
  ```
101
101
 
102
102
  **Windows (PowerShell / Windows Terminal):** See [README.windows.md](./README.windows.md) for the equivalent commands.
package/README.windows.md CHANGED
@@ -12,7 +12,7 @@ For the main install options and overall context, see [README.md](./README.md).
12
12
  - A host directory for `PROJECTS_PATH` containing the project folders you want the agent to access (create it before starting the container)
13
13
 
14
14
  ```powershell
15
- docker pull ghcr.io/openhands/agent-canvas:1.7.2 # x-release-please-version
15
+ docker pull ghcr.io/openhands/agent-canvas:1.8.0 # x-release-please-version
16
16
 
17
17
  $env:PROJECTS_PATH = Join-Path $HOME "projects" # directory containing your project folders
18
18
  New-Item -ItemType Directory -Force -Path $env:PROJECTS_PATH, (Join-Path $env:USERPROFILE ".openhands") | Out-Null
@@ -21,7 +21,7 @@ docker run -it --rm `
21
21
  -p 8000:8000 `
22
22
  -v "$($env:USERPROFILE)\.openhands:/home/openhands/.openhands" `
23
23
  -v "$($env:PROJECTS_PATH):/projects" `
24
- ghcr.io/openhands/agent-canvas:1.7.2 # x-release-please-version
24
+ ghcr.io/openhands/agent-canvas:1.8.0 # x-release-please-version
25
25
  ```
26
26
 
27
27
  Open [http://localhost:8000/canvas](http://localhost:8000/canvas) in your browser.
@@ -1 +1 @@
1
- import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n}from"./vendor-styling-Bcgpimp9.js";import{a as r,i,o as a,t as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{a as s,i as c,n as l,r as u}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{N as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";var f=t(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}})),p=e(n()),m=e(f()),h=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function g(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(m.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(h),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var _=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,v=/^\s*$/,y=Object.create(null);function b(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>`),t.voidElement?e:e+t.children.reduce(b,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var x={parse:function(e,t){t||={},t.components||=y;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(_,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=g(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=g(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),_=e.slice(f,h===-1?void 0:h);v.test(_)&&(_=` `),(h>-1&&a+l.length>=0||_!==` `)&&l.push({type:`text`,content:_})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+b(``,t)},``)}},S=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},C=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?T(t):t},w=e=>Array.isArray(e)&&e.every(p.isValidElement),T=e=>Array.isArray(e)?e:[e],E=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},D=e=>{let t={};if(!e)return t;let n=e=>{T(e).forEach(e=>{u(e)||(S(e)?n(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},O=(e,t,n,r)=>{if(!e)return``;let i=``,a=T(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((e,a)=>{if(u(e)){i+=`${e}`;return}if((0,p.isValidElement)(e)){let{props:s,type:c}=e,l=Object.keys(s).length,d=o.indexOf(c)>-1,f=s.children;if(!f&&d&&!l){i+=`<${c}/>`;return}if(!f&&(!d||l)||s.i18nIsDynamicList){i+=`<${a}></${a}>`;return}if(d&&l<=1){let e=u(f)?f:O(f,t,n,r);i+=`<${c}>${e}</${c}>`;return}let p=O(f,t,n,r);i+=`<${a}>${p}</${a}>`;return}if(e===null){c(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(l(e)){let{format:t,...a}=e,o=Object.keys(a);if(o.length===1){let e=t?`${o[0]}, ${t}`:o[0];i+=`{{${e}}}`;return}c(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}c(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},k=(e,t=[],n={})=>{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`&lt;`,o+=1)}else a+=e[o],o+=1;return a},A=(e,t,n,i,o,s,c)=>{if(n===``)return[];let d=o.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(d.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!f&&!c)return[n];let m=t??{},h=e=>{T(e).forEach(e=>{u(e)||(S(e)?h(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=k(n,d,m),_=x.parse(`<0>${g}</0>`),v={...m,...s},y=(e,t,n)=>{let r=C(e),i=D(r,t.children,n);return w(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,p.cloneElement)(e,{key:r},i?void 0:t))):n.push(...p.Children.map([e],e=>{if(e.type===p.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,p.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,p.cloneElement)(e,n,i?null:t)}))},D=(e,n,s)=>{let m=T(e),h=T(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&i.services.interpolator.interpolate(n.children[0].content,v,i.language);if(n.type===`tag`){let r=m[parseInt(n.name,10)];!r&&t&&(r=t[n.name]),s.length===1&&!r&&(r=s[0][n.name]),r||={};let x={...n.attrs};c&&Object.keys(x).forEach(e=>{let t=x[e];u(t)&&(x[e]=a(t))});let w=Object.keys(x).length===0?r:E({props:x},r),O=(0,p.isValidElement)(w),k=O&&S(n,!0)&&!n.voidElement,A=f&&l(w)&&w.dummy&&!O,j=l(t)&&Object.hasOwnProperty.call(t,n.name);if(u(w)){let t=i.services.interpolator.interpolate(w,v,i.language);e.push(t)}else if(S(w)||k)b(w,y(w,n,s),e,h);else if(A)b(w,D(m,n.children,s),e,h);else if(Number.isNaN(parseFloat(n.name)))if(j)b(w,y(w,n,s),e,h,n.voidElement);else if(o.transSupportBasicHtmlNodes&&d.indexOf(n.name)>-1)if(n.voidElement)e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,p.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=D(r?T(C(r)):m,n.children,s);e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`},a))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=D(m,n.children,s);e.push(`<${n.name}>${t}</${n.name}>`)}else if(l(w)&&!O){let t=n.children[0]?_:null;t&&e.push(t)}else b(w,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=o.transWrapTextNodes,a=typeof o.unescape==`function`?o.unescape:r().unescape,s=c?a(i.services.interpolator.interpolate(n.content,v,i.language)):i.services.interpolator.interpolate(n.content,v,i.language);t?e.push((0,p.createElement)(t,{key:`${n.name}-${h}`},s)):e.push(s)}return e},[])};return C(D([{dummy:!0,children:e||[]}],_,T(e||[]))[0])},j=(e,t,n)=>{let r=e.key||t,i=(0,p.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,p.createElement)(p.Fragment,null,i)}return(0,p.createElement)(a,{key:r})},M=(e,t)=>e.map((e,n)=>j(e,n,t)),N=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:j(e[r],r,t)})}),n},P=(e,t,n,r)=>e?Array.isArray(e)?M(e,t):l(e)?N(e,t):(s(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,F=e=>!l(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function I({children:e,count:t,parent:n,i18nKey:a,context:o,tOptions:c={},values:l,defaults:f,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||i();if(!b)return s(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:a}),e;let x=_||b.t.bind(b)||(e=>e),S={...r(),...b.options?.react},C=h||x.ns||b.options?.defaultNS;C=u(C)?[C]:C||[`translation`];let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...c}:c,E=v??w?.shouldUnescape,k=w?.values?{...w.values,...l}:l,j=w?.components?{...w.components,...m}:m,M=O(e,S,b,a),N=f||T?.defaultValue||M||S.transEmptyNodeValue||(typeof a==`function`?d(a):a),{hashTransKey:I}=S,L=a||(I?I(M||N):M||N);l=b.options?.interpolation?.defaultVariables?k&&Object.keys(k).length>0?{...k,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:k;let R=D(e);R&&typeof R.count==`number`&&t===void 0&&(t=R.count);let z=l||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:o||T.context,count:t,...l,...z,defaultValue:N,ns:C},V=L?x(L,B):N;V===L&&N&&(V=N);let H=P(j,V,b,a),U=H||e,W=null;F(H)&&(W=H,U=e);let G=A(U,W,V,b,S,B,E),K=n??S.defaultTransParent;return K?(0,p.createElement)(K,y,G):G}function L({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:s={},values:c,defaults:l,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,p.useContext)(o)||{},y=f||_||i(),b=m||y?.t.bind(y);return I({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:s,values:c,defaults:l,components:u,ns:d||b?.ns||v||y?.options?.defaultNS,i18n:y,t:m,shouldUnescape:h,...g})}export{L as t};
1
+ import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n}from"./vendor-styling-Bcgpimp9.js";import{a as r,i,o as a,t as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{a as s,i as c,n as l,r as u}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{N as d}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";var f=t(((e,t)=>{t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}})),p=e(n()),m=e(f()),h=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function g(e){var t={type:`tag`,name:``,voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(m.default[n[1]]||e.charAt(e.length-2)===`/`)&&(t.voidElement=!0),t.name.startsWith(`!--`))){var r=e.indexOf(`-->`);return{type:`comment`,comment:r===-1?``:e.slice(4,r)}}for(var i=new RegExp(h),a=null;(a=i.exec(e))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,``];o.indexOf(`=`)>-1&&(s=o.split(`=`)),t.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(t.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return t}var _=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,v=/^\s*$/,y=Object.create(null);function b(e,t){switch(t.type){case`text`:return e+t.content;case`tag`:return e+=`<`+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+`="`+e[n]+`"`);return t.length?` `+t.join(` `):``}(t.attrs):``)+(t.voidElement?`/>`:`>`),t.voidElement?e:e+t.children.reduce(b,``)+`</`+t.name+`>`;case`comment`:return e+`<!--`+t.comment+`-->`}}var x={parse:function(e,t){t||={},t.components||=y;var n,r=[],i=[],a=-1,o=!1;if(e.indexOf(`<`)!==0){var s=e.indexOf(`<`);r.push({type:`text`,content:s===-1?e:e.substring(0,s)})}return e.replace(_,function(s,c){if(o){if(s!==`</`+n.name+`>`)return;o=!1}var l,u=s.charAt(1)!==`/`,d=s.startsWith(`<!--`),f=c+s.length,p=e.charAt(f);if(d){var m=g(s);return a<0?(r.push(m),r):((l=i[a]).children.push(m),r)}if(u&&(a++,(n=g(s)).type===`tag`&&t.components[n.name]&&(n.type=`component`,o=!0),n.voidElement||o||!p||p===`<`||n.children.push({type:`text`,content:e.slice(f,e.indexOf(`<`,f))}),a===0&&r.push(n),(l=i[a-1])&&l.children.push(n),i[a]=n),(!u||n.voidElement)&&(a>-1&&(n.voidElement||n.name===s.slice(2,-1))&&(a--,n=a===-1?r:i[a]),!o&&p!==`<`&&p)){l=a===-1?r:i[a].children;var h=e.indexOf(`<`,f),_=e.slice(f,h===-1?void 0:h);v.test(_)&&(_=` `),(h>-1&&a+l.length>=0||_!==` `)&&l.push({type:`text`,content:_})}}),r},stringify:function(e){return e.reduce(function(e,t){return e+b(``,t)},``)}},S=(e,t)=>{if(!e)return!1;let n=e.props?.children??e.children;return t?n.length>0:!!n},C=e=>{if(!e)return[];let t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?T(t):t},w=e=>Array.isArray(e)&&e.every(p.isValidElement),T=e=>Array.isArray(e)?e:[e],E=(e,t)=>{let n={...t};return n.props={...t.props,...e.props},n},D=e=>{let t={};if(!e)return t;let n=e=>{T(e).forEach(e=>{u(e)||(S(e)?n(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(t,e))})};return n(e),t},O=(e,t,n,r)=>{if(!e)return``;let i=``,a=T(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((e,a)=>{if(u(e)){i+=`${e}`;return}if((0,p.isValidElement)(e)){let{props:s,type:c}=e,l=Object.keys(s).length,d=o.indexOf(c)>-1,f=s.children;if(!f&&d&&!l){i+=`<${c}/>`;return}if(!f&&(!d||l)||s.i18nIsDynamicList){i+=`<${a}></${a}>`;return}if(d&&l<=1){let e=u(f)?f:O(f,t,n,r);i+=`<${c}>${e}</${c}>`;return}let p=O(f,t,n,r);i+=`<${a}>${p}</${a}>`;return}if(e===null){c(n,`TRANS_NULL_VALUE`,`Passed in a null value as child`,{i18nKey:r});return}if(l(e)){let{format:t,...a}=e,o=Object.keys(a);if(o.length===1){let e=t?`${o[0]}, ${t}`:o[0];i+=`{{${e}}}`;return}c(n,`TRANS_INVALID_OBJ`,`Invalid child - Object should only have keys {{ value, format }} (format is optional).`,{i18nKey:r,child:e});return}c(n,`TRANS_INVALID_VAR`,`Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`,{i18nKey:r,child:e})}),i},k=(e,t=[],n={})=>{if(!e)return e;let r=Object.keys(n),i=[...t,...r],a=``,o=0;for(;o<e.length;)if(e[o]===`<`){let t=!1,n=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}if(!t){let n=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(n){let e=n[1];(/^\d+$/.test(e)||i.includes(e))&&(t=!0,a+=n[0],o+=n[0].length)}}t||(a+=`&lt;`,o+=1)}else a+=e[o],o+=1;return a},A=(e,t,n,i,o,s,c)=>{if(n===``)return[];let d=o.transKeepBasicHtmlNodesFor||[],f=n&&new RegExp(d.map(e=>`<${e}`).join(`|`)).test(n);if(!e&&!t&&!f&&!c)return[n];let m=t??{},h=e=>{T(e).forEach(e=>{u(e)||(S(e)?h(C(e)):l(e)&&!(0,p.isValidElement)(e)&&Object.assign(m,e))})};h(e);let g=k(n,d,m),_=x.parse(`<0>${g}</0>`),v={...m,...s},y=(e,t,n)=>{let r=C(e),i=D(r,t.children,n);return w(r)&&i.length===0||e.props?.i18nIsDynamicList?r:i},b=(e,t,n,r,i)=>{e.dummy?(e.children=t,n.push((0,p.cloneElement)(e,{key:r},i?void 0:t))):n.push(...p.Children.map([e],e=>{if(e.type===p.Fragment||e.props?.i18nIsDynamicList!==void 0){let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`children`||t===`i18nIsDynamicList`||(n[t]=e.props[t])}),(0,p.createElement)(e.type,n,i?null:t)}let n={key:r};return e&&e.props&&Object.keys(e.props).forEach(t=>{t===`ref`||t===`children`||(n[t]=e.props[t])}),(0,p.cloneElement)(e,n,i?null:t)}))},D=(e,n,s)=>{let m=T(e),h=T(n),g={};return h.reduce((e,n,h)=>{let _=n.children?.[0]?.content&&i.services.interpolator.interpolate(n.children[0].content,v,i.language);if(n.type===`tag`){let r=m[parseInt(n.name,10)];!r&&t&&(r=t[n.name]),s.length===1&&!r&&(r=s[0][n.name]),r||={};let x={...n.attrs};c&&Object.keys(x).forEach(e=>{let t=x[e];u(t)&&(x[e]=a(t))});let w=Object.keys(x).length===0?r:E({props:x},r),O=(0,p.isValidElement)(w),k=O&&S(n,!0)&&!n.voidElement,A=f&&l(w)&&w.dummy&&!O,j=l(t)&&Object.hasOwnProperty.call(t,n.name);if(u(w)){let t=i.services.interpolator.interpolate(w,v,i.language);e.push(t)}else if(S(w)||k)b(w,y(w,n,s),e,h);else if(A)b(w,D(m,n.children,s),e,h);else if(Number.isNaN(parseFloat(n.name)))if(j)b(w,y(w,n,s),e,h,n.voidElement);else if(o.transSupportBasicHtmlNodes&&d.indexOf(n.name)>-1)if(n.voidElement)e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`}));else{let t=g[n.name]||0;g[n.name]=t+1;let r,i=0;for(let e=0;e<m.length;e+=1){let a=m[e];if((0,p.isValidElement)(a)&&a.type===n.name){if(i===t){r=a;break}i+=1}}let a=D(r?T(C(r)):m,n.children,s);e.push((0,p.createElement)(n.name,{key:`${n.name}-${h}`},a))}else if(n.voidElement)e.push(`<${n.name} />`);else{let t=D(m,n.children,s);e.push(`<${n.name}>${t}</${n.name}>`)}else if(l(w)&&!O){let t=n.children[0]?_:null;t&&e.push(t)}else b(w,_,e,h,n.children.length!==1||!_)}else if(n.type===`text`){let t=o.transWrapTextNodes,a=typeof o.unescape==`function`?o.unescape:r().unescape,s=c?a(i.services.interpolator.interpolate(n.content,v,i.language)):i.services.interpolator.interpolate(n.content,v,i.language);t?e.push((0,p.createElement)(t,{key:`${n.name}-${h}`},s)):e.push(s)}return e},[])};return C(D([{dummy:!0,children:e||[]}],_,T(e||[]))[0])},j=(e,t,n)=>{let r=e.key||t,i=(0,p.cloneElement)(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function a(){return(0,p.createElement)(p.Fragment,null,i)}return(0,p.createElement)(a,{key:r})},M=(e,t)=>e.map((e,n)=>j(e,n,t)),N=(e,t)=>{let n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:j(e[r],r,t)})}),n},P=(e,t,n,r)=>e?Array.isArray(e)?M(e,t):l(e)?N(e,t):(s(n,`TRANS_INVALID_COMPONENTS`,`<Trans /> "components" prop expects an object or array`,{i18nKey:r}),null):null,F=e=>!l(e)||Array.isArray(e)?!1:Object.keys(e).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function I({children:e,count:t,parent:n,i18nKey:a,context:o,tOptions:c={},values:l,defaults:f,components:m,ns:h,i18n:g,t:_,shouldUnescape:v,...y}){let b=g||i();if(!b)return s(b,`NO_I18NEXT_INSTANCE`,`Trans: You need to pass in an i18next instance using i18nextReactModule`,{i18nKey:a}),e;let x=_||b.t.bind(b)||(e=>e),S={...r(),...b.options?.react},C=h||x.ns||b.options?.defaultNS;C=u(C)?[C]:C||[`translation`];let{transDefaultProps:w}=S,T=w?.tOptions?{...w.tOptions,...c}:c,E=v??w?.shouldUnescape,k=w?.values?{...w.values,...l}:l,j=w?.components?{...w.components,...m}:m,M=O(e,S,b,a),N=f||T?.defaultValue||M||S.transEmptyNodeValue||(typeof a==`function`?d(a):a),{hashTransKey:I}=S,L=a||(I?I(M||N):M||N);l=b.options?.interpolation?.defaultVariables?k&&Object.keys(k).length>0?{...k,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables}:k;let R=D(e);R&&typeof R.count==`number`&&t===void 0&&(t=R.count);let z=l||t!==void 0&&!b.options?.interpolation?.alwaysFormat||!e?T.interpolation:{interpolation:{...T.interpolation,prefix:`#$?`,suffix:`?$#`}},B={...T,context:o||T.context,count:t,...l,...z,defaultValue:N,ns:C},V=L?x(L,B):N;V===L&&N&&(V=N);let H=P(j,V,b,a),U=H||e,W=null;F(H)&&(W=H,U=e);let G=A(U,W,V,b,S,B,E),K=n??S.defaultTransParent;return K?(0,p.createElement)(K,y,G):G}function L({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:s={},values:c,defaults:l,components:u,ns:d,i18n:f,t:m,shouldUnescape:h,...g}){let{i18n:_,defaultNS:v}=(0,p.useContext)(o)||{},y=f||_||i(),b=m||y?.t.bind(y);return I({children:e,count:t,parent:n,i18nKey:r,context:a,tOptions:s,values:c,defaults:l,components:u,ns:d||b?.ns||v||y?.options?.defaultNS,i18n:y,t:m,shouldUnescape:h,...g})}export{L as t};
@@ -1 +1 @@
1
- import{z as e}from"./utils-qjs_KuS4.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js";var n=`cli-generic`;function r(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t===`acp-managed`?null:t}function i(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=r(t);if(e)return e}return e.providerDefault??null}var a={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},o=Object.entries(a).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),s=`custom`,c={codex:[{name:`CODEX_AUTH_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.codex/auth.json`}}],"claude-code":[{name:`CLAUDE_CODE_OAUTH_TOKEN`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_OAUTH_TOKEN_HINT}],"gemini-cli":[{name:`GOOGLE_APPLICATION_CREDENTIALS_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.config/gcloud/application_default_credentials.json`}},{name:`GOOGLE_CLOUD_PROJECT`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_PROJECT_HINT},{name:`GOOGLE_CLOUD_LOCATION`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_LOCATION_HINT},{name:`GOOGLE_GENAI_USE_VERTEXAI`,hint_key:e.ONBOARDING$ACP_SECRET_VERTEXAI_FLAG_HINT}]},l={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function u(e,t){return e?(l[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var d=`gemini-2.5-pro`;function f(e){return e===`gemini-cli`?d:m(e)?.default_model??null}function p(n){if(!n)return[];let r=t(n);if(!r)return[];let i=[...c[n]??[]];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function m(e){if(e)return o.find(t=>t.key===e)}function h(e){let t=m(e);return t?t.display_name:null}function g(e){return m(e)?.icon??`cli-generic`}function _(e,t){return t?m(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function v(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===s,r=n?void 0:m(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?f(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{u as a,h as c,g as d,i as f,v as i,p as l,o as n,f as o,n as r,m as s,s as t,_ as u};
1
+ import{z as e}from"./utils-DsWhWn2F.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js";var n=`cli-generic`;function r(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t===`acp-managed`?null:t}function i(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=r(t);if(e)return e}return e.providerDefault??null}var a={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},o=Object.entries(a).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),s=`custom`,c={codex:[{name:`CODEX_AUTH_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.codex/auth.json`}}],"claude-code":[{name:`CLAUDE_CODE_OAUTH_TOKEN`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_OAUTH_TOKEN_HINT}],"gemini-cli":[{name:`GOOGLE_APPLICATION_CREDENTIALS_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.config/gcloud/application_default_credentials.json`}},{name:`GOOGLE_CLOUD_PROJECT`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_PROJECT_HINT},{name:`GOOGLE_CLOUD_LOCATION`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_LOCATION_HINT},{name:`GOOGLE_GENAI_USE_VERTEXAI`,hint_key:e.ONBOARDING$ACP_SECRET_VERTEXAI_FLAG_HINT}]},l={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function u(e,t){return e?(l[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var d=`gemini-2.5-pro`;function f(e){return e===`gemini-cli`?d:m(e)?.default_model??null}function p(n){if(!n)return[];let r=t(n);if(!r)return[];let i=[...c[n]??[]];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function m(e){if(e)return o.find(t=>t.key===e)}function h(e){let t=m(e);return t?t.display_name:null}function g(e){return m(e)?.icon??`cli-generic`}function _(e,t){return t?m(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function v(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===s,r=n?void 0:m(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?f(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{u as a,h as c,g as d,i as f,v as i,p as l,o as n,f as o,n as r,m as s,s as t,_ as u};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor~module-BZXjBMvd.js","assets/rolldown-runtime-Cyuzqnbw.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{D as a,F as o,I as s,M as ee,O as te,P as ne,T as re,d as ie,k as ae,w as c,y as oe}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{R as se,t as ce,z as l}from"./utils-DsWhWn2F.js";var u=e(t(),1),le=`__AGENT_CANVAS_BASE_PATH__`;function ue(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function de(){let e=ue(void 0);if(e)return e;if(typeof window<`u`){let e=window[le];if(typeof e==`string`)return ue(e)}return``}function fe(e){let t=de();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var d=`openhands`,pe=[{label:`English`,value:`en`},{label:`日本語`,value:`ja`},{label:`简体中文`,value:`zh-CN`},{label:`繁體中文`,value:`zh-TW`},{label:`한국어`,value:`ko-KR`},{label:`Norsk`,value:`no`},{label:`Arabic`,value:`ar`},{label:`Deutsch`,value:`de`},{label:`Français`,value:`fr`},{label:`Italiano`,value:`it`},{label:`Português`,value:`pt`},{label:`Español`,value:`es`},{label:`Català`,value:`ca`},{label:`Türkçe`,value:`tr`},{label:`Українська`,value:`uk`}],me=new WeakMap,he=e=>{if(!me.has(e)){let t=e.use(te).use(a).use(i).init({fallbackLng:`en`,debug:!1,supportedLngs:pe.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[d],defaultNS:d,fallbackNS:d,backend:{loadPath:fe(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});me.set(e,t)}return e},ge=()=>he(ee()),_e=null,ve=null,f=()=>(_e||=ge(),_e),ye=()=>ve??f(),be=e=>(ve=e??f(),ve),xe=async(e=f())=>(await me.get(e),e),Se=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:d,...e}:e:{ns:d},p=new Proxy({},{get:(e,t)=>{let n=ye();if(t===`t`)return(e,t)=>n.t(e,Se(t));if(t===`exists`)return(e,t)=>n.exists(e,Se(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=ye();return Reflect.set(r,t,n,r)}}),Ce=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,we=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`,Te=`Disconnected (check URL or network). Check that the backend URL is correct and the backend server is reachable. If the backend is on another origin, check that it allows this frontend origin.`,Ee=`Disconnected (request timed out). Check that the backend URL is correct and reachable.`,De=4;function Oe(e){return typeof e==`object`&&!!e}function ke(e){let t=[],n=new Set,r=e,i=0;for(;r!=null&&i<De&&!n.has(r);){if(n.add(r),r instanceof Error)r.message&&t.push(r.message),r=r.cause;else if(typeof r==`string`){r&&t.push(r);break}else if(Oe(r)){let e=r.message;typeof e==`string`&&e&&t.push(e),r=r.cause}else break;i+=1}return t}function m(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`disconnected (check cors or network)`)||t.includes(`disconnected (check url or network)`)||t.includes(`blocked by cors`)||t.includes(`failed to fetch`)||t.includes(`network error`)||t.includes(`load failed`)||t.includes(`networkerror when attempting to fetch resource`)||t.includes(`cors`)&&t.includes(`blocked`)}function Ae(e){return ke(e).some(m)}function je(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`request timeout`)||t.includes(`timeout after`)||t.includes(`backend request timed out`)}function Me(e){let t=ke(e);return t.some(m)?Te:t.some(je)?Ee:t[0]??null}function Ne(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var Pe=e=>{let t=null,n=!1;return Ne(e)?(n=!0,t=Ce(e)&&e.response?.data.error?e.response?.data.error:we(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,Me(n?t??e:e)??t??``},h=(e,t=5e3,n=1e4)=>{if(!e)return t;let r=e.length/(1e3/60)*1e3*1.5;return Math.min(Math.max(r,t),n)},g=r(),Fe={background:`var(--oh-color-tertiary)`,border:`1px solid var(--oh-border-input)`,color:`#fff`,borderRadius:`var(--oh-radius)`,maxWidth:`400px`,wordBreak:`break-word`,overflowWrap:`anywhere`,whiteSpace:`pre-wrap`},_={position:`top-right`,style:Fe},Ie={...Fe,color:`var(--oh-muted)`};function Le({message:e}){let t=u.useRef(null),[n,r]=u.useState(!1);return u.useLayoutEffect(()=>{let e=t.current;if(!e)return;let n=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);if(!Number.isFinite(t)||t<=0){r(!1);return}r(e.getBoundingClientRect().height>t*1.5)};n();let i=new ResizeObserver(n);return i.observe(e),()=>i.disconnect()},[e]),(0,g.jsxs)(`div`,{className:ce(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,g.jsx)(re,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:se}}),(0,g.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var Re={..._,icon:null,style:Ie},ze=e=>{let t=e||p.t(l.STATUS$ERROR);m(t)?t=p.t(l.ERROR$CORS_OR_NETWORK):je(t)&&(t=p.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=h(t,4e3);c((0,g.jsx)(Le,{message:t}),{...Re,duration:n})},Be=e=>{let t=h(e,5e3);c.success((0,g.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{..._,duration:t})},Ve=(e,t,n)=>{let r=h(`${e} ${t}`,5e3);c.success((0,g.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,g.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{..._,duration:r})},He=e=>{let t=h(e,6e3);c((0,g.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{..._,icon:`⚠️`,duration:t})},Ue=`openhands-backend-health`,We=500;function Ge(e){if(typeof e!=`object`||!e)return!1;let t=e;return Number.isInteger(t.consecutiveFailures)&&t.consecutiveFailures>=0&&t.consecutiveFailures<=5&&(t.lastError===null||typeof t.lastError==`string`)&&(t.lastFailureAt===null||typeof t.lastFailureAt==`number`)&&typeof t.disabled==`boolean`}function Ke(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Ue);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof e==`string`&&e.length>0&&Ge(r)&&(n[e]=r);return n}catch{return{}}}function qe(e){if(!(typeof window>`u`))try{if(Object.keys(e).length===0){window.localStorage.removeItem(Ue);return}window.localStorage.setItem(Ue,JSON.stringify(e))}catch{}}function Je(e){let t=Me(e)??`Unknown error`;return t.length>We?`${t.slice(0,We)}…`:t}var v=Ke(),Ye=new Set;function Xe(){Ye.forEach(e=>e())}function y(e){v=e,qe(e),Xe()}function Ze(){return v}function Qe(e){return v[e]??null}function $e(e){return Ye.add(e),()=>{Ye.delete(e)}}function et(e,t){let n=v[e],r=Math.min((n?.consecutiveFailures??0)+1,5),i=n?.disabled===!0||r>=5,a={consecutiveFailures:r,lastError:Je(t),lastFailureAt:Date.now(),disabled:i};y({...v,[e]:a})}function tt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}function nt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}function rt(e){if(!(e in v))return;let{[e]:t,...n}=v;y(n)}var it=`workspace/project`,at=`__AGENT_CANVAS_LOCK_TO_CLOUD__`,ot=`all-hands.dev`,b=`openhands.dev`,st=`app.${ot}`,ct=b,lt=`app.${b}`;function ut(e){return e?.trim()||null}function dt(e){if(!e)return null;let t=e.trim().replace(/\/$/,``);return t?/^https?:\/\//i.test(t)?t:typeof window<`u`?`${window.location.protocol}//${t}`:`http://${t}`:null}function ft(e){if(!e)return null;let t=e.trim().replace(/\/+$/,``);return t?/^https?:\/\//i.test(t)?t:`https://${t}`:null}function pt(e){let t=e.toLowerCase();return t===st||t===lt?ct:t===ot?b:t.endsWith(`.${ot}`)?`${t.slice(0,-13)}${b}`:t}function mt(e){let t=ft(e);if(!t)return null;try{let e=new URL(t),n=e.port?`:${e.port}`:``;return`${e.protocol}//${pt(e.hostname)}${n}`}catch{return t.toLowerCase()}}function ht(){let e=yt();return!e||typeof window>`u`||!bt(window.location.origin,e)?null:window.location.origin}function gt(){return dt(void 0)}function _t(){let e=ut(void 0);if(e)return e;if(typeof window<`u`){let e=window.__AGENT_CANVAS_SESSION_API_KEY__;if(typeof e==`string`)return ut(e)}return null}function vt(){return{baseUrl:St()??``,sessionApiKey:x()??``}}function yt(){let e=ft(void 0);if(e)return e;if(typeof window<`u`){let e=window[at];if(typeof e==`string`)return ft(e)}return null}function bt(e,t){let n=mt(e),r=mt(t);return!n||!r?!1:n===r}function xt(){return ht()?`cookie`:`api-key`}function St(){return gt()||(typeof window<`u`?window.location.origin:null)}function x(){return _t()}function Ct(){return it}function wt(e){return`${Ct().replace(/\/+$/,``)}/${e.replace(/-/g,``)}`}function Tt(){let e=x();return e?{"X-Session-API-Key":e}:{}}function S(){return typeof window<`u`&&window.__AGENT_CANVAS_AUTH_REQUIRED__===!0}function Et(){return S()?!x():!1}var Dt=`default-local`,Ot=`Local`,kt=`locked-cloud`,At=`OpenHands Cloud`;function jt(){if(!yt())return null;let e=ht();return e?{id:kt,name:At,host:e,apiKey:``,kind:`cloud`,authMode:`cookie`}:null}function C(){if(yt())return null;let e=St(),t=x();return!e||!t?null:{id:Dt,name:Ot,host:e,apiKey:t,kind:`local`}}var Mt=`openhands-backends`,w=`openhands-active-backend`;function Nt(e){return e===`local`||e===`cloud`}function Pt(e){return e===void 0||e===`api-key`||e===`cookie`}function Ft(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&t.id.length>0&&typeof t.name==`string`&&typeof t.host==`string`&&typeof t.apiKey==`string`&&Nt(t.kind)&&Pt(t.authMode)&&(t.connectionRevision===void 0||typeof t.connectionRevision==`number`&&Number.isSafeInteger(t.connectionRevision)&&t.connectionRevision>=0)}function It(e){try{let{hostname:t}=new URL(e);return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`[::1]`}catch{return!1}}function Lt(e,t){return e.id!==`default-local`||e.kind!==`local`?!1:e.host===t.host||It(e.host)&&It(t.host)}function Rt(e){let t=C();if(!t)return e;let n=!1,r=e.map(e=>!Lt(e,t)||e.apiKey===t.apiKey?e:(n=!0,{...e,apiKey:t.apiKey}));return n?(T(r),r):e}function T(e){if(!(typeof window>`u`))try{window.localStorage.setItem(Mt,JSON.stringify(e))}catch{}}function zt(){if(typeof window>`u`)return[];try{let e=jt();if(e)return T([e]),Wt()?.backendId!==e.id&&Gt({backendId:e.id}),[e];let t=window.localStorage.getItem(Mt);if(t===null){let e=C();return e?(T([e]),[e]):[]}let n=JSON.parse(t);if(!Array.isArray(n))return[];let r=n.filter(Ft);if(r.length===0){let e=C();return e?(T([e]),[e]):[]}return Rt(r)}catch{return[]}}function Bt(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.backendId!=`string`)return null;let n=t.orgId;return{backendId:t.backendId,orgId:typeof n==`string`&&n.length>0?n:null}}catch{return null}}function Vt(e,t){try{return e?.getItem(t)??null}catch{return null}}function Ht(e,t,n){try{e?.setItem(t,n)}catch{}}function Ut(e,t){try{e?.removeItem(t)}catch{}}function Wt(){return typeof window>`u`?null:Bt(Vt(window.sessionStorage,w))||Bt(Vt(window.localStorage,w))}function Gt(e){if(typeof window>`u`)return;if(!e){Ut(window.sessionStorage,w),Ut(window.localStorage,w);return}let t=JSON.stringify({backendId:e.backendId,orgId:e.orgId??null});Ht(window.sessionStorage,w,t),Ht(window.localStorage,w,t)}var Kt=`no-backend`,qt={id:Kt,name:`No Backend Available`,host:``,apiKey:``,kind:`local`};function Jt(e){return e.id===Kt}function Yt(e){return e.find(e=>e.kind===`local`&&Qe(e.id)?.disabled!==!0)||(e.find(e=>e.kind===`local`)??e[0]??qt)}function Xt(e,t){let n=null,r=null;if(t){let i=e.find(e=>e.id===t.backendId);i&&(n=i,r=t.orgId??null)}return n||(n=Yt(e),r=null),{backends:e,selection:t,active:{backend:n,orgId:r}}}var E=Xt(zt(),Wt()),Zt=new Set;function Qt(){Zt.forEach(e=>e())}function $t(){return E.active}function en(){let e=E.active.backend;return e.kind===`local`&&!Jt(e)?e:null}function D(){return E.backends}function tn(){return E.selection}function O(){return E}function nn(e){Gt(e),E=Xt(E.backends,e),Qt()}function rn(e){T(e);let t=E.selection;t&&!e.some(e=>e.id===t.backendId)&&(t=null,Gt(null)),E=Xt(e,t),Qt()}function an(e){return Zt.add(e),()=>{Zt.delete(e)}}var on=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},sn=e=>{if(!(e instanceof ae)||e.response?.status!==401&&e.status!==401)return!1;let t=$t().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},cn=new Set,ln=()=>{let e=new ne({queryCache:new o({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&tt(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||on(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!sn(t)){let e=Pe(t);cn.has(e||``)||(ze(e||p.t(l.ERROR$GENERIC)),cn.add(e||``),setTimeout(()=>{cn.delete(e||``)},3e3))}}}),mutationCache:new s({onError:(t,n,r,i)=>{on(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!sn(t)&&ze(Pe(t)||p.t(l.ERROR$GENERIC))}})});return e},un=null,dn=null,fn=()=>(un||=ln(),un),pn=()=>dn??fn(),mn=e=>(dn=e??fn(),dn),hn=new Proxy({},{get:(e,t)=>{let n=pn(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=pn();return Reflect.set(r,t,n,r)}});function gn(e){if(e&&!e.startsWith(`/`))try{let t=new URL(e),n=t.hostname,r=window.location.hostname??window.location.host?.split(`:`)[0];return r&&(n===`localhost`||n===`127.0.0.1`)&&r!==`localhost`&&r!==`127.0.0.1`?`${r}:${t.port}`:t.host}catch{return window.location.host}return window.location.host}function _n(e){if(e&&!e.startsWith(`/`))try{return(new URL(e).pathname.split(`/api/conversations`)[0]||``).replace(/\/$/,``)}catch{return``}return``}function vn(e){let t=gn(e),n=_n(e),r=window.location.protocol===`https:`,i=yn(e)===`https:`;return`${r||i?`https:`:`http:`}//${t}${n}`}function yn(e){if(!e||e.startsWith(`/`))return null;try{return new URL(e).protocol}catch{return null}}function bn(e){let t=gn(e),n=_n(e),r=window.location.protocol===`https:`,i=yn(e)===`https:`;return`${r||i?`wss:`:`ws:`}//${t}${n}/sockets/bash-events`}function xn(e,t){if(!e)return null;let n=gn(t),r=_n(t),i=window.location.protocol===`https:`,a=yn(t)===`https:`;return`${i||a?`wss:`:`ws:`}//${n}${r}/sockets/events/${e}`}var Sn=class extends Error{constructor(){super(`No backend is configured.`),this.name=`NoBackendAvailableError`}};function Cn(e){return e.replace(/\/+$/,``)}function wn(e,t){return e.host?Cn(e.host):e.conversationUrl?Cn(vn(e.conversationUrl)):Cn(t?.host??``)}function Tn(e={}){let t=en();if(!t&&!e.host&&!e.conversationUrl)throw new Sn;let n=e.sessionApiKey??e.apiKey??t?.apiKey??void 0;return{host:wn(e,t),...n?{apiKey:n}:{},workingDir:e.workingDir??Ct(),...e.timeout===void 0?{}:{timeout:e.timeout}}}function En(e){let{host:t,apiKey:n,timeout:r}=Tn(e);return{baseUrl:t,...n?{apiKey:n}:{},timeout:r??6e4}}var Dn={_comment:`Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.`,versions:{agentServer:`1.39.1`,agentCanvas:`1.8.0`,automation:`1.5.0`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},On=5e3,kn=`unknown`,k=Dn.compatibility.minimumAgentServer,An=`AGENT_SERVER_UNSUPPORTED_VERSION`,jn=`AGENT_SERVER_UNKNOWN_VERSION`,A=null,Mn=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,j=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},Nn=e=>e instanceof j||typeof e==`object`&&!!e&&`name`in e&&e.name===`AgentServerUnavailableError`,Pn=class extends j{code=An;actualVersion;requiredVersion=k;constructor(e){let t=`Agent Canvas requires agent-server ${k} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},Fn=class extends j{code=jn;actualVersion;requiredVersion=k;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${k} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},In=e=>S()&&N(e,401);function M(){A=null}function Ln(e){let t=Mn(A);return Array.isArray(t)?t.includes(e):!0}function Rn(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function N(e,t){return Rn(e)&&e.status===t}function zn(e){return typeof e==`string`&&e.trim()||null}function Bn(e){return zn(e.sdk_version)}function Vn(e){return zn(e.version)??Bn(e)}function Hn(e){let t=Vn(e);return!t||t.toLowerCase()===kn?null:t}function Un(e){let t=Hn(e);return!t||!Kn(t)?null:t}function Wn(e){return!A||e&&en()?.host!==e?null:Un(A)}function Gn(e,t){let n=Kn(e),r=Kn(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function Kn(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function qn(e){let t=Hn(e);if(!t)throw M(),new Fn(Vn(e));let n=Gn(t,k);if(n===null)throw M(),new Fn(t);if(n<0)throw M(),new Pn(t)}async function Jn(){let e=en();if(!e){if(M(),Jt($t().backend))throw new j(`No backend configured`,{noBackendConfigured:!0});return null}let t=Tn({host:e.host,sessionApiKey:e.apiKey||null,timeout:On}),n;try{n=await new oe(t).getServerInfo()}catch(e){throw M(),N(e,401)?e:new j(e instanceof Error?e.message:null)}if(qn(n),S())try{await new ie(t).getSettings()}catch(e){if(N(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return A=n,n}var Yn={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},Xn={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},Zn={all:[`llm-profiles`]},Qn={all:[`agent-profiles`]},$n={retry:!1},er={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},tr={all:[`local-workspaces`]},nr={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},rr={latestVersion:[`agent-canvas-latest-version`]},ir={staleTime:1e3*60*5,gcTime:1e3*60*15},ar={name:`@openhands/agent-canvas`,version:`1.8.0`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/OpenHands`},homepage:`https://github.com/OpenHands/OpenHands#readme`,bugs:{url:`https://github.com/OpenHands/OpenHands/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.11.0`,"@openhands/typescript-client":`1.36.1`,"@react-router/node":`7.17.0`,"@react-router/serve":`7.17.0`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.18.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,httpxy:`0.5.3`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.25.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.17.0`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`1.9.0`,sirv:`3.0.2`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.16`,winston:`3.19.0`,"winston-daily-rotate-file":`5.0.0`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:coverage":`npm run make-i18n && vitest run --coverage`,"test:mutation":`npm run make-i18n && stryker run`,"test:mutation:diff":`npm run make-i18n && node scripts/stryker-diff.mjs`,"test:mutation:incremental":`npm run make-i18n && stryker run --incremental`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`,"example:acp-docker:env":`node scripts/gen-acp-docker-env.mjs`,desktop:`npm run build:app && electron electron/main.mjs`,"build:desktop":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && electron-builder --config electron-builder.config.mjs --publish never`,"build:desktop:universal":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && cross-env ELECTRON_ARCH=universal electron-builder --config electron-builder.config.mjs --publish never`,"download-uv":`node scripts/download-uv.mjs`,"download-node":`node scripts/download-node.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`node scripts/run-staged-typecheck.mjs`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.17.0`,"@stryker-mutator/core":`9.6.1`,"@stryker-mutator/vitest-runner":`9.6.1`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,electron:`42.3.3`,"electron-builder":`26.8.1`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.7`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.17.0`}},or=`agent_canvas`,sr=ar.version,cr=`X-OpenHands-Client`,lr=`X-OpenHands-Client-Version`,ur=`X-OpenHands-Telemetry-Distinct-Id`,dr={[cr]:or,[lr]:sr};function fr(e){return e?.trim()||`unknown`}function pr(e){return e?.trim()||null}function P({backendKind:e,agentServerVersion:t,automationSdkVersion:n,backendVersion:r,connectionMethod:i}){let a=fr(t??r),o=fr(n),s=fr(r??t);return{backend_kind:e??null,agent_server_version:a,automation_sdk_version:o,backend_version:s,...i?{connection_method:i}:{}}}function mr(e=null){return{cloud_user_id:pr(e?.userId),cloud_user_email:pr(e?.email),cloud_org_id:pr(e?.orgId)}}var F=`openhands-telemetry-consent`,I=`openhands-telemetry-consent-pending-cloud-sync`,L=`openhands-telemetry-consent-pending-local-revocation`,hr=`openhands-telemetry-consent-change`,gr=`openhands-telemetry-first-use`,_r=`openhands-telemetry-session`,vr=`agent-canvas`,yr=`history_change`,br=`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,xr=`https://z.openhands.dev`,Sr=`https://us.posthog.com`,R=null,z=null,Cr,B={},V=!1,H,U=0,W=-1,wr=Object.freeze({client_source:or,client_version:sr,package_name:ar.name,package_version:ar.version}),Tr=P({}),Er=mr();function Dr(e){Tr=P(e)}function G(e){Er=mr(e)}function Or(e){return e?{...e,properties:{...Tr,...Er,...e.properties,...wr}}:null}function kr(e){V||X()!==`granted`?e.opt_out_capturing():e.opt_in_capturing()}function Ar(e,t=!1){e.reset(t),W=-1,kr(e)}function K(e){if(H===void 0||!$())return;let t=H?.distinctId,n=e.get_property(`$user_id`);if(n!=null&&n!==t&&Ar(e),H===null){W=U;return}(e.get_property(`$user_id`)!==H.distinctId||W!==U)&&(e.identify(H.distinctId,H.properties),W=U)}function jr(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function Mr(e){if(e===!1){if(V)return;V=!0,R?.opt_out_capturing(),Z();return}let t=V;if(V=!1,!R&&!z){let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));B={...B,...t}}t&&(R&&(kr(R),K(R)),Z())}function Nr(){return V?null:{apiKey:B.apiKey||br,apiHost:B.apiHost||xr,uiHost:B.uiHost||Sr}}function q(){return typeof window<`u`&&typeof localStorage<`u`}async function Pr(){if(!q())return null;if(R)return R;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~module-BZXjBMvd.js`).then(e=>e.t);return{default:e}},__vite__mapDeps([0,1]));return e}catch{return null}}function J(){return!!(V||typeof process<`u`&&{}.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`))}function Fr(e){R||(Cr=e)}async function Y(e=!1){if(R)return R;if(z)return z;z=(async()=>{let t=Nr();if(!t)return null;let n=await Pr();if(!n)return null;let r=n.init(t.apiKey,{api_host:t.apiHost,ui_host:t.uiHost,opt_out_capturing_by_default:!e,persistence:`localStorage`,persistence_name:vr,consent_persistence_name:`${vr}-consent`,person_profiles:`always`,capture_pageview:yr,autocapture:!0,disable_session_recording:!0,bootstrap:Cr,before_send:Or},vr);return r?(R=r,Cr=void 0,V?R.opt_out_capturing():X()===`granted`?(R.opt_in_capturing(),K(R)):e||R.opt_out_capturing(),R):null})();try{return await z}finally{R||(z=null)}}function X(){if(!q())return`pending`;if(J())return`denied`;if(xt()===`cookie`)return`granted`;try{let e=localStorage.getItem(F);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}function Ir(){if(!q())return null;try{let e=localStorage.getItem(I);return e===`granted`||e===`denied`?e:null}catch{return null}}function Lr(){if(!q())return null;try{return localStorage.getItem(L)}catch{return null}}function Rr(e){if(!q())return()=>{};let t=t=>{(t.key===F||t.key===I)&&e()};return window.addEventListener(hr,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(hr,e),window.removeEventListener(`storage`,t)}}function Z(){q()&&window.dispatchEvent(new Event(hr))}function zr(e){if(q())try{localStorage.setItem(I,e)}catch{}}function Br(e){if(!(!q()||!e))try{localStorage.setItem(L,e)}catch{}}function Vr(e){if(q())try{if(localStorage.getItem(L)!==e)return;localStorage.removeItem(L)}catch{}}function Hr(e){if(q())try{if(e!==void 0&&localStorage.getItem(I)!==e)return;localStorage.removeItem(I),Z()}catch{}}async function Ur(e,{syncToCloud:t=!0}={}){if(q())try{let t=X()===e;if(localStorage.setItem(F,e),V||t)return;let n=R??await Y();if(!n)return;e===`granted`?(n.opt_in_capturing(),K(n)):(Br(n.get_distinct_id?.()??null),n.get_property?.(`$user_id`)==null?n.opt_out_capturing():Ar(n))}catch{}finally{t&&zr(e),Z()}}async function Q(e,t={}){let n=e===null?null:{distinctId:e,properties:t};if(H===n||H!=null&&n!==null&&H.distinctId===n.distinctId&&jr(H.properties,t)||(H=n,U+=1,W=-1,!$()))return;let r=R??await Y();r&&$()&&K(r)}function $(){return X()===`granted`}function Wr(){if(!q())return!1;try{return localStorage.getItem(gr)===`true`}catch{return!1}}function Gr(){if(q())try{localStorage.setItem(gr,`true`)}catch{}}async function Kr(){if(J()||Wr())return;let e=await Y(!0);!e||J()||((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),Gr(),X()!==`granted`&&e.opt_out_capturing())}function qr(){if(!q())return!1;try{return sessionStorage.getItem(_r)===`true`}catch{return!1}}function Jr(){if(q())try{sessionStorage.setItem(_r,`true`)}catch{}}async function Yr(){if(!$()||X()!==`granted`)return null;let e=await Y();return!e||!$()?null:(e.has_opted_out_capturing?.()&&e.opt_in_capturing(),K(e),e)}async function Xr(){if(qr())return;let e=await Yr();e&&(e.capture(`canvas_new_session`,{is_first_use:!Wr()}),Jr())}async function Zr(){return(await Yr())?.get_distinct_id?.()??null}async function Qr(){if(!q())return null;if(X()!==`granted`){let e=Lr();if(e)return e}return V||J()?null:(await Y())?.get_distinct_id?.()??null}async function $r(e,t={}){let n=await Yr();n&&n.capture(e,t)}async function ei(e,t={}){let n=await Yr();n&&n.captureException(e,t)}async function ti(){if(q()){try{Br(R?.get_distinct_id?.()??null),localStorage.removeItem(F),localStorage.removeItem(gr)}catch{}Hr();try{sessionStorage.removeItem(_r)}catch{}Tr=P({}),Er=mr(),H=null,U+=1,W=-1;try{R&&Ar(R,!0)}catch{try{R?.opt_out_capturing()}catch{}}finally{Z()}}}var ni=u.createContext(null);function ri(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ii(e,t){let n=e.backend.kind===`cloud`,r=t.backend.kind===`cloud`;!n&&!r||(G(null),r&&(!n||e.backend.id!==t.backend.id)&&Q(null))}function ai({children:e}){let t=u.useSyncExternalStore(an,O,O),n=u.useCallback(()=>{M(),hn.invalidateQueries({queryKey:Yn.WEB_CLIENT_CONFIG})},[]),r=u.useCallback((e,t)=>{let r=O(),i=tn()?.backendId??null,a=tn()?.orgId??null,o=t??null;if(e===i&&o===a)return;let s=D(),ee=s.find(t=>t.id===e),te={backend:ee??s[0]??qt,orgId:ee?o:null};ii(r.active,te),nn({backendId:e,orgId:o}),n()},[n]),i=u.useCallback(e=>{let t=O().active,r={...e,id:ri()},i=[...D(),r];return ii(t,{backend:r,orgId:null}),rn(i),nn({backendId:r.id}),n(),r},[n]),a=u.useCallback((e,t)=>{let r=D().find(t=>t.id===e),i=O().active.backend.id,a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;rn(D().map(n=>n.id===e?{...n,...t,connectionRevision:a||o?(n.connectionRevision??0)+1:n.connectionRevision}:n)),(a||o)&&(nt(e),i===e&&(r?.kind===`cloud`&&(G(null),Q(null)),n()))},[n]),o=u.useCallback(e=>{let t=D().find(t=>t.id===e),r=t?.kind===`cloud`&&O().active.backend.id===t.id;rn(D().filter(t=>t.id!==e)),r&&(G(null),Q(null)),rt(e),n()},[n]),s=u.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,g.jsx)(ni.Provider,{value:s,children:e})}function oi(){let e=u.useContext(ni);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function si(){let e=u.useContext(ni);return e?e.active:{backend:C()??qt,orgId:null}}export{bn as $,$n as A,He as At,M as B,p as Bt,Xr as C,et as Ct,sr as D,ze as Dt,or as E,_ as Et,tr as F,m as Ft,Ln as G,Wn as H,xe as Ht,nr as I,pe as It,N as J,Nn as K,Yn as L,d as Lt,ir as M,Me as Mt,Zn as N,je as Nt,ur as O,Be as Ot,er as P,Ae as Pt,En as Q,Xn as R,f as Rt,Kr as S,Ze as St,dr as T,$e as Tt,Un as U,fe as Ut,Gn as V,be as Vt,In as W,Sn as X,Jn as Y,Tn as Z,Ur as _,xt as _t,Vr as a,mn as at,$r as b,Et as bt,Mr as c,D as ct,X as d,it as dt,vn as et,Zr as f,wt as ft,G as g,Ct as gt,Dr as h,Tt as ht,Hr as i,hn as it,rr as j,Pe as jt,Qn as k,Ve as kt,Ir as l,Jt as lt,Y as m,vt as mt,si as n,fn as nt,ti as o,$t as ot,Qr as p,St as pt,Rn as q,oi as r,pn as rt,Fr as s,en as st,ai as t,xn as tt,Lr as u,Ot as ut,Q as v,yt as vt,P as w,tt as wt,ei as x,bt as xt,Rr as y,S as yt,qn as z,ye as zt};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as n}from"./sdk-section-page-BW-i45yr.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
1
+ import{yt as e}from"./vendor-styling-Bcgpimp9.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as n}from"./sdk-section-page-D0K1dBQY.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.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}from"./useMutation-DyQXZFEF.js";import{i as c,it as l,rt as u,st as d}from"./active-backend-context-BlZPzZNU.js";import{t as f,z as p}from"./utils-qjs_KuS4.js";import{t as m}from"./back-nav-button-Be_L157B.js";import{t as h}from"./loading-spinner-CcpnCr_d.js";import{t as g}from"./brand-button-CQO8oqVo.js";import{i as _}from"./dropdown-classes-DQlj-MpS.js";import{t as v}from"./use-llm-profiles-BMQoc612.js";import{n as y,t as b}from"./use-agent-profiles-Dmd_4H8q.js";import{i as x,n as S,t as C}from"./use-can-manage-org-profiles-CrG1km7R.js";import{t as w}from"./u-edit-809W9D9T.js";import{t as T}from"./settings-dropdown-input-Dx6vlkgf.js";import{r as E}from"./typography-C6fuRTTT.js";import{o as D}from"./extension-module-card-classes-Bo43vY5V.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-DwgrwohM.js";import{t as N}from"./u-check-circle-DBEvndTS.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-gQdBahdt.js";import{n as R}from"./settings-section-header-context-CnIIQAUn.js";import{t as z}from"./use-save-agent-profile-2Mk9ZX37.js";import{n as B}from"./use-activate-agent-profile-DH33MvVj.js";import{t as V}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as H,t as U}from"./agent-settings-BIOsUglV.js";var W=e(t(),1),G=e(n(),1),K=r();function q({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:s}){let{t:c}=o(`openhands`),l=(0,W.useRef)(null),u=(0,W.useRef)([]),d=s?.current??null,[m,h]=(0,W.useState)();(0,W.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,W.useEffect)(()=>{u.current[0]?.focus()},[]),(0,W.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&!l.current.contains(t)&&a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let g=e=>{e(),a()},v=(0,W.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,S=(0,K.jsxs)(`div`,{ref:l,className:f(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,K.jsx)(k,{index:0,icon:(0,K.jsx)(w,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,K.jsx)(k,{index:1,icon:(0,K.jsx)(N,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,K.jsx)(k,{index:2,icon:(0,K.jsx)(x,{width:16,height:16}),label:c(p.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:G.createPortal((0,K.jsx)(`div`,{style:m,children:S}),document.body):S}function J({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:s}){let{t:c}=o(`openhands`),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(p.SETTINGS$AGENT_TYPE_ACP);return(0,K.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:f(P,`justify-between gap-3`),children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,K.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(p.SETTINGS$PROFILE_ACTIVE)})]}),n&&(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(S,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(p.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,K.jsx)(q,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:s,onClose:()=>u(!1)})]})]})}function Y({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l}){let{t:u}=o(`openhands`);return e?(0,K.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,K.jsx)(h,{size:`large`})}):t?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-red-400`,children:u(p.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(p.SETTINGS$PROFILES_EMPTY)})}):(0,K.jsx)(`div`,{className:f(L,F),children:n.map(e=>(0,K.jsx)(J,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l},e.name))})}function X(){let e=a();return s({mutationFn:e=>y.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function Z({profile:e,onClose:t}){let{t:n}=o(`openhands`),r=X(),i=(0,W.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(p.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){u(e instanceof Error?e.message:n(p.ERROR$GENERIC))}},s=()=>{r.isPending||t()},c=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:s,isDisabled:r.isPending,children:n(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{size:`small`}),(0,K.jsx)(`span`,{className:`sr-only`,children:n(p.BUTTON$DELETE)})]}):n(p.BUTTON$DELETE)})]});return(0,K.jsx)(j,{isOpen:!0,title:n(p.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:s,initialFocusRef:i,children:(0,K.jsx)(`p`,{className:`text-sm break-all`,children:n(p.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function Q({onAddProfile:e,onEditProfile:t}){let{t:n}=o(`openhands`),{data:r,isLoading:i,error:a}=b(),s=B(),c=C(),[u,d]=(0,W.useState)(null),f=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(p.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,K.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(p.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,K.jsx)(Y,{isLoading:i,loadError:a??null,profiles:f,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await s.mutateAsync(e.id),l(n(p.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:s.isPending})]}),(0,K.jsx)(Z,{profile:u,onClose:()=>d(null)})]})}function $(){let e=a();return s({mutationFn:({name:e,newName:t})=>y.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function ee(e){return e.agent_kind===`acp`?{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?H(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``}:{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,tool_concurrency_limit:e.tool_concurrency_limit}}function te(){let{t:e}=o(`openhands`),{setHideSectionHeader:t}=R(),n=z(),r=$(),{data:i}=b(),{data:a,isLoading:s}=v(),[c,f]=(0,W.useState)(`list`),[h,_]=(0,W.useState)(``),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(null),[D,k]=(0,W.useState)(``),[j,M]=(0,W.useState)(null),[N,P]=(0,W.useState)(!1);(0,W.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,W.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),B=(0,W.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==x?.name&&L.has(h)),[h,c,L,x?.name]),H=(0,W.useCallback)(()=>{_(``),S(null),w({agent_kind:`openhands`}),k(I),M(null),f(`create`)},[I]),G=(0,W.useCallback)(async t=>{try{let e=(await y.getProfile(t.name,`encrypted`)).profile;S(e),w(ee(e)),e.agent_kind===`openhands`?k(s||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),f(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),u(e(p.ERROR$GENERIC))}},[e,F,s,I]),q=(0,W.useCallback)(()=>{f(`list`),S(null),_(``),w(null),M(null)},[]),J=(0,W.useCallback)(async()=>{if(!j||!B)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){u(e(p.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){u(t instanceof Error?t.message:e(p.ERROR$GENERIC));return}let i=h.trim(),a=x?.name,o=c===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=V(c===`edit`?x:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?p.SETTINGS$PROFILE_CREATED:p.SETTINGS$PROFILE_UPDATED,{name:i})),q()}catch(t){u(d(t)||e(p.ERROR$GENERIC))}finally{P(!1)}},[j,B,D,h,c,x,n,r,e,q]);if(c===`list`)return(0,K.jsx)(Q,{onAddProfile:H,onEditProfile:G});let Y=e(c===`edit`?p.SETTINGS$EDIT_AGENT_PROFILE:p.SETTINGS$ADD_AGENT_PROFILE),X=c===`edit`&&x?e(p.SETTINGS$PROFILE_LOADED,{name:x.name}):e(p.SETTINGS$PROFILE_SAVE_HINT),Z=j?.agentType!==`acp`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(m,{testId:`back-to-agent-profiles`,onClick:q,children:e(p.BUTTON$BACK)}),(0,K.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:Y}),(0,K.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:X})]}),(0,K.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,K.jsx)(U,{embedded:!0,agentSettingsOverride:C,onSaveControlChange:M},c===`edit`?`edit-${x?.id}`:`new-profile`),Z&&(F.length>0?(0,K.jsx)(T,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(p.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,K.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(p.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,K.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,K.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:q,children:e(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:J,isDisabled:!B||N||!j?.isValid,"aria-busy":N,children:e(N?p.SETTINGS$SAVING:p.BUTTON$SAVE)})]})]})}var ne={hideTitle:!1},re=i(function(){return(0,K.jsx)(te,{})});export{re as default,ne as handle};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.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}from"./useMutation-DHLpZ6J0.js";import{Dt as c,Ot as l,jt as u,k as d}from"./active-backend-context-mY7Gff5c.js";import{t as f,z as p}from"./utils-DsWhWn2F.js";import{t as m}from"./back-nav-button-C02hGa8t.js";import{t as h}from"./loading-spinner-DRFyh6Iy.js";import{t as g}from"./brand-button-BUlDL-mz.js";import{i as _}from"./dropdown-classes-CqA2BTCL.js";import{t as v}from"./use-llm-profiles-CdaxVpyY.js";import{n as y,t as b}from"./use-agent-profiles-DmT9zxAN.js";import{i as x,n as S,t as C}from"./use-can-manage-org-profiles-vBiP7rHF.js";import{t as w}from"./u-edit-809W9D9T.js";import{t as T}from"./settings-dropdown-input-jOiv5Yrk.js";import{r as E}from"./typography-B1UxuuEC.js";import{o as D}from"./extension-module-card-classes-Bo43vY5V.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-CzXbf7tR.js";import{t as N}from"./u-check-circle-DBEvndTS.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-VqMzkYYt.js";import{n as R}from"./settings-section-header-context-CnIIQAUn.js";import{t as z}from"./use-save-agent-profile-DGJ3-u0M.js";import{n as B}from"./use-activate-agent-profile-DCRf47e-.js";import{t as V}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as H,t as U}from"./agent-settings-BGTyoT6X.js";var W=e(t(),1),G=e(n(),1),K=r();function q({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:s}){let{t:c}=o(`openhands`),l=(0,W.useRef)(null),u=(0,W.useRef)([]),d=s?.current??null,[m,h]=(0,W.useState)();(0,W.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,W.useEffect)(()=>{u.current[0]?.focus()},[]),(0,W.useEffect)(()=>{let e=e=>{let t=e.target;l.current&&!l.current.contains(t)&&a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let g=e=>{e(),a()},v=(0,W.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,S=(0,K.jsxs)(`div`,{ref:l,className:f(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,K.jsx)(k,{index:0,icon:(0,K.jsx)(w,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,K.jsx)(k,{index:1,icon:(0,K.jsx)(N,{width:16,height:16}),label:c(p.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,K.jsx)(k,{index:2,icon:(0,K.jsx)(x,{width:16,height:16}),label:c(p.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:G.createPortal((0,K.jsx)(`div`,{style:m,children:S}),document.body):S}function J({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:s}){let{t:c}=o(`openhands`),[l,u]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(p.SETTINGS$AGENT_TYPE_ACP);return(0,K.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:f(P,`justify-between gap-3`),children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,K.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,K.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(p.SETTINGS$PROFILE_ACTIVE)})]}),n&&(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(S,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(p.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,K.jsx)(q,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:s,onClose:()=>u(!1)})]})]})}function Y({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l}){let{t:u}=o(`openhands`);return e?(0,K.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,K.jsx)(h,{size:`large`})}):t?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-red-400`,children:u(p.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,K.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,K.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(p.SETTINGS$PROFILES_EMPTY)})}):(0,K.jsx)(`div`,{className:f(L,F),children:n.map(e=>(0,K.jsx)(J,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:s,onDelete:c,isActivating:l},e.name))})}function X(){let e=a();return s({mutationFn:e=>y.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:d.all})},meta:{disableToast:!0}})}function Z({profile:e,onClose:t}){let{t:n}=o(`openhands`),r=X(),i=(0,W.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(p.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){c(e instanceof Error?e.message:n(p.ERROR$GENERIC))}},s=()=>{r.isPending||t()},u=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:s,isDisabled:r.isPending,children:n(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(h,{size:`small`}),(0,K.jsx)(`span`,{className:`sr-only`,children:n(p.BUTTON$DELETE)})]}):n(p.BUTTON$DELETE)})]});return(0,K.jsx)(j,{isOpen:!0,title:n(p.SETTINGS$PROFILE_DELETE_TITLE),footer:u,onClose:s,initialFocusRef:i,children:(0,K.jsx)(`p`,{className:`text-sm break-all`,children:n(p.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function Q({onAddProfile:e,onEditProfile:t}){let{t:n}=o(`openhands`),{data:r,isLoading:i,error:a}=b(),s=B(),c=C(),[u,d]=(0,W.useState)(null),f=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(p.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,K.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(p.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,K.jsx)(Y,{isLoading:i,loadError:a??null,profiles:f,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await s.mutateAsync(e.id),l(n(p.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:s.isPending})]}),(0,K.jsx)(Z,{profile:u,onClose:()=>d(null)})]})}function $(){let e=a();return s({mutationFn:({name:e,newName:t})=>y.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:d.all})},meta:{disableToast:!0}})}function ee(e){return e.agent_kind===`acp`?{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?H(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``}:{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,tool_concurrency_limit:e.tool_concurrency_limit}}function te(){let{t:e}=o(`openhands`),{setHideSectionHeader:t}=R(),n=z(),r=$(),{data:i}=b(),{data:a,isLoading:s}=v(),[d,f]=(0,W.useState)(`list`),[h,_]=(0,W.useState)(``),[x,S]=(0,W.useState)(null),[C,w]=(0,W.useState)(null),[D,k]=(0,W.useState)(``),[j,M]=(0,W.useState)(null),[N,P]=(0,W.useState)(!1);(0,W.useEffect)(()=>(t(d!==`list`),()=>t(!1)),[d,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,W.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),B=(0,W.useMemo)(()=>!(!A(h,{isRequired:!0})||d===`create`&&L.has(h)||d===`edit`&&h!==x?.name&&L.has(h)),[h,d,L,x?.name]),H=(0,W.useCallback)(()=>{_(``),S(null),w({agent_kind:`openhands`}),k(I),M(null),f(`create`)},[I]),G=(0,W.useCallback)(async t=>{try{let e=(await y.getProfile(t.name,`encrypted`)).profile;S(e),w(ee(e)),e.agent_kind===`openhands`?k(s||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),f(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),c(e(p.ERROR$GENERIC))}},[e,F,s,I]),q=(0,W.useCallback)(()=>{f(`list`),S(null),_(``),w(null),M(null)},[]),J=(0,W.useCallback)(async()=>{if(!j||!B)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){c(e(p.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){c(t instanceof Error?t.message:e(p.ERROR$GENERIC));return}let i=h.trim(),a=x?.name,o=d===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=V(d===`edit`?x:null,t);await n.mutateAsync({name:i,profile:s}),l(e(d===`create`?p.SETTINGS$PROFILE_CREATED:p.SETTINGS$PROFILE_UPDATED,{name:i})),q()}catch(t){c(u(t)||e(p.ERROR$GENERIC))}finally{P(!1)}},[j,B,D,h,d,x,n,r,e,q]);if(d===`list`)return(0,K.jsx)(Q,{onAddProfile:H,onEditProfile:G});let Y=e(d===`edit`?p.SETTINGS$EDIT_AGENT_PROFILE:p.SETTINGS$ADD_AGENT_PROFILE),X=d===`edit`&&x?e(p.SETTINGS$PROFILE_LOADED,{name:x.name}):e(p.SETTINGS$PROFILE_SAVE_HINT),Z=j?.agentType!==`acp`;return(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(m,{testId:`back-to-agent-profiles`,onClick:q,children:e(p.BUTTON$BACK)}),(0,K.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:Y}),(0,K.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:X})]}),(0,K.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,K.jsx)(U,{embedded:!0,agentSettingsOverride:C,onSaveControlChange:M},d===`edit`?`edit-${x?.id}`:`new-profile`),Z&&(F.length>0?(0,K.jsx)(T,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(p.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,K.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(p.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,K.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,K.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:q,children:e(p.BUTTON$CANCEL)}),(0,K.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:J,isDisabled:!B||N||!j?.isValid,"aria-busy":N,children:e(N?p.SETTINGS$SAVING:p.BUTTON$SAVE)})]})]})}var ne={hideTitle:!1},re=i(function(){return(0,K.jsx)(te,{})});export{re as default,ne as handle};
@@ -0,0 +1,41 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/secrets-service-Dbv5Zb8G.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/active-backend-context-mY7Gff5c.js","assets/vendor-styling-Bcgpimp9.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js","assets/utils-DsWhWn2F.js","assets/proxy-BiyDhMBd.js"])))=>i.map(i=>d[i]);
2
+ import{xt as e}from"./vendor-styling-Bcgpimp9.js";import{_ as t,c as n,f as r,g as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{G as a,T as o,X as s,Z as c,et as l,ft as ee,gt as u,ot as d,st as te}from"./active-backend-context-mY7Gff5c.js";import{C as f}from"./utils-DsWhWn2F.js";import{r as p,t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js";import{t as h}from"./proxy-BiyDhMBd.js";import{t as g}from"./settings-Chfn5xTD.js";import{t as _}from"./settings-service.api-CTJRrvMu.js";import{t as v}from"./v4-DDdyfk2q.js";import{t as y}from"./profiles-service.api-C32pPm70.js";import{t as ne}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js";import{f as b,o as x,s as S}from"./acp-providers-WUD4tfSq.js";import{d as C,f as w,r as T}from"./llm-subscription-DTqtBCWz.js";import{t as re}from"./llm-subscription-service-COTgZc1C.js";var E=new Map;function ie(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function ae(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function oe(e={}){let t=c(e),n=t.host,r=E.get(n);if(r)return r;let a=(async()=>{let{home:e}=await new i(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();E.set(n,a);try{return await a}catch(e){throw E.delete(n),e}}async function se(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ie(n)?n:ae(await oe(t),n):oe(t)}var D=`openhands-agent-server-conversation-metadata`,ce=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),O=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(D);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},le=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(D);return}window.localStorage.setItem(D,JSON.stringify(e))}},k=e=>O()[e]??null,A=(e,t)=>{let n=O();n[e]=t,le(n)},j=e=>{let t=O();e in t&&(delete t[e],le(t))};function M(e){if(!e?.id)return e;let t=k(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function N(){let e=d().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}async function ue(e=20,t){let n=N(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await h({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>M(e)),next_page_id:i?.next_page_id??null}}async function P(e){if(e.length===0)return[];let t=N(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await h({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(M)}async function de(e){return await h({backend:N(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:o})}async function fe(e){return h({backend:N(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function pe(e){await h({backend:N(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function me(e,t){return await h({backend:N(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function he(e){await h({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function ge(e){await h({backend:N(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function F(e,t){let n=N(),r=new URLSearchParams;return r.append(`file_path`,t),await h({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function _e(e){let t=N(),n=new URLSearchParams;return n.set(`ids`,e),(await h({backend:t,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${n.toString()}`}))?.[0]??null}function ve(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}var I=`canvas_ui`,L=`canvas_ui_control`,ye=`ClientAction_${L}`,be={name:L,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
3
+
4
+ They will NOT see the files you wrote, the terminal output, or the browser
5
+ unless you call this tool to switch the right-side panel to the relevant
6
+ tab. Call this every time you finish work that produces something the user
7
+ should look at — don't rely on them noticing on their own.
8
+
9
+ When to call (pick the most specific option that matches your last action):
10
+
11
+ * You wrote or modified a single file (ANY language, ANY size — including
12
+ small scripts like a hello-world bash file) →
13
+ command="navigate_to_file", path=<workspace-relative path of that file>
14
+
15
+ * You generated an HTML page, image, SVG, PDF, markdown report, or other
16
+ previewable artifact →
17
+ command="show_preview", path=<that file>
18
+
19
+ * You finished editing multiple files in one logical step →
20
+ command="open_tab", tab="files"
21
+ (The Files tab automatically renders a diff view when the workspace has
22
+ uncommitted git changes, which covers the "highlight changes" case.)
23
+
24
+ * You ran a long-running terminal command, or one whose output the user
25
+ should inspect →
26
+ command="open_tab", tab="terminal"
27
+
28
+ * You browsed to a URL the user should see →
29
+ First call browser_get_state(include_screenshot=true) after your final
30
+ browser interaction so Agent Canvas has a screenshot to display, then call
31
+ command="open_tab", tab="browser"
32
+ (browser_navigate alone only updates the URL; without browser_get_state,
33
+ the Browser tab will open without a screenshot.)
34
+
35
+ Call this BEFORE writing your chat-message summary of the change, so the
36
+ artifact is visible while the user reads what you did. One canvas_ui_control
37
+ call per logical step is enough — don't repeat it for the same file or tab in
38
+ the same turn.`,parameters:{type:`object`,additionalProperties:!1,properties:{command:{type:`string`,enum:[`navigate_to_file`,`open_tab`,`show_preview`],description:`UI command to dispatch.`},path:{type:`string`,description:`Workspace-relative file path. Required for navigate_to_file and show_preview; ignored otherwise.`},tab:{type:`string`,enum:[`files`,`browser`,`vscode`,`terminal`,`planner`,`tasklist`],description:`Tab to open. Required for open_tab; ignored otherwise.`}},required:[`command`]},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},xe=[`terminal`,`file_editor`,`task_tracker`],R=`browser_tool_set`,z=`task_tool_set`;function Se(){return!0}function Ce(){if(typeof window<`u`){let e=window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__;if(typeof e==`string`)return e.trim()||null}return null}function we(){let e=Ce();if(!e)return null;try{let t=JSON.parse(e);return!t||typeof t!=`object`?null:t}catch{return null}}function Te(){let e=we();if(!e?.services)return;let t=[];t.push(`<RUNTIME_SERVICES>`),e.mode?t.push(`You are running inside an agent-canvas dev stack started in '${e.mode}' mode.`):t.push(`You are running inside an agent-canvas dev stack.`),t.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:n,ingress:r,automation:i}=e.services,{frontend:a}=e.services;n?.url_from_agent&&t.push(`* Agent Server (you): ${n.url_from_agent}`,` ${n.description??`The agent-server hosting your tool calls.`}`),r?.url_from_agent&&t.push(`* Ingress: ${r.url_from_agent}`,` ${r.description??`Unified entry point for browser-facing traffic.`}`),a?.url_from_agent&&t.push(`* Frontend: ${a.url_from_agent}`,` ${a.description??`Frontend dev server.`}`),i?.url_from_agent?(t.push(`* Automation backend: ${i.url_from_agent}`,` ${i.description??`OpenHands Automations service.`}`),i.docs_url&&t.push(` Docs: ${i.docs_url}`),i.openapi_url&&t.push(` OpenAPI: ${i.openapi_url}`),i.auth_env_var&&t.push(` Auth: header 'X-Session-API-Key: $${i.auth_env_var}'`)):t.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let o=n?.url_from_agent;return t.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),o&&t.push(`In particular, ${o} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),t.push(`</RUNTIME_SERVICES>`),t.join(`
39
+ `)}function Ee(e){let{host:t}=c();return`${t}/api/conversations/${e}`}function B(e){return`Conversation ${e.slice(0,5)}`}function V(e){let t=k(e.id),n=e.agent?.kind===`ACPAgent`,r=n?e.tags?.acpserver??e.agent?.acp_server??null:null;return{id:e.id,created_by_user_id:null,selected_repository:t?.selected_repository??null,selected_branch:t?.selected_branch??null,git_provider:t?.git_provider??null,selected_workspace:t?.selected_workspace??null,active_profile:t?.active_profile??null,title:e.title?.trim()?e.title:B(e.id),trigger:null,pr_number:[],agent_kind:n?`acp`:`openhands`,acp_server:r,tags:e.tags??null,launched_agent_profile:e.launched_agent_profile??null,llm_model:n?b({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??g.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:null,created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??f.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:Ee(e.id),session_api_key:c().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??u()},public:!1,sub_conversation_ids:[]}}function De(e){return{items:e.items.map(V),next_page_id:e.next_page_id??null}}var H=`acpserver`,Oe=new Set([H]);function ke(e){return e?Object.entries(e).filter(([e])=>!Oe.has(e)).sort(([e],[t])=>e.localeCompare(t)):[]}var Ae=`gAAAAA`,je=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function U(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function W(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function G(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function K(e){return typeof e==`string`?e.startsWith(Ae):Array.isArray(e)?e.some(K):G(e)?Object.values(e).some(K):!1}function Me(e){return G(e)?Object.values(e).some(K):!1}function Ne(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Pe(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function Fe(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function q(e,t){return e===R?Se()&&a(e):e===z?t.enable_sub_agents===!0&&a(e):!0}function Ie(e){let t=new Map;for(let n of xe)q(n,e)&&t.set(n,{name:n,params:{}});for(let n of[R,z])q(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>Fe(e)))for(let r of n)q(r.name,e)&&t.set(r.name,{name:r.name,params:U(r.params)});return Array.from(t.values())}function Le(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
40
+
41
+ `)}],run:!0}}function Re(){return ne.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/OpenHands/OpenHands/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function ze(e,t=[]){let n=Te(),r=U(e.agent_context),i=Array.isArray(r.skills)?r.skills:[],a=new Set(t),o=[...i,...Re()].filter(e=>typeof e.name!=`string`||!a.has(e.name));return{...r,skills:o,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,...n?{system_message_suffix:n}:{}}}function Be(e){return U(e.agent_settings).agent_kind===`acp`}function Ve(e){let t=U(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function He(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=S(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Ue(e){let t=U(e.agent_settings),n={agent_kind:`acp`,agent_context:ze(t,e.disabled_skills)};for(let e of m){if(e===`acp_model`||e===`acp_env`)continue;let r=e===`acp_command`?He(t):t[e];r!=null&&(n[e]=r)}let r=U(t.mcp_config);Object.keys(r).length>0&&(n.mcp_config=r);let i=typeof t.acp_server==`string`?t.acp_server:void 0,a=b({configured:t.acp_model,providerDefault:x(i)});return a&&(n.acp_model=a),n}function We(e){let t=U(e.agent_settings),n=U(t.llm);n.model=typeof n.model==`string`&&n.model.trim().length>0?n.model:g.llm_model,n.stream=!0;let r=W(n.api_key);r?n.api_key=r:delete n.api_key;let i=W(n.base_url);i?n.base_url=i:delete n.base_url,w(n)?(n.auth_type=T,n.subscription_vendor=C,delete n.api_key,delete n.base_url):(delete n.auth_type,delete n.subscription_vendor);let a=U(t.mcp_config);Object.keys(a).length===0&&delete t.mcp_config,delete t.acp_server;for(let e of m)delete t[e];return delete t.acp_env,{...t,llm:n,agent_context:ze(t,e.disabled_skills),tools:Ie(t)}}function Ge(e){return Be(e)?Ue(e):We(e)}function Ke(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=U(t.conversation_settings),s=Le(n,r);return je.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??u()},...s?{initial_message:s}:{},...i?.length?{plugins:i.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function qe(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Be(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=Ge(t),a=n?Ve(t):void 0,o=Ke(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[be]:[],confirmation_policy:Ne(o),max_iterations:typeof o.max_iterations==`number`?o.max_iterations:500,stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a&&(s.tags={[H]:a}),!e.agentProfileId&&e.secretsEncrypted&&(!n||Me(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId);let c=Pe(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config&&(s.hook_config=o.hook_config);let l={...o.tool_module_qualnames??{}};if(delete l[I],delete l[L],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions),e.customSecrets&&e.customSecrets.length>0){let t=te(),n=t?ve(t):{},r={};for(let t of e.customSecrets){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}s.secrets=r}return s}var Je=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Ye(e){if(w(U(e.llm))&&!(await re.getOpenAIStatus()).connected)throw Error(Je)}async function Xe(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-Dbv5Zb8G.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),[r,i]=await Promise.all([_.getSettingsForConversation(),n.getSecrets()]),{agentSettings:a,conversationSettings:o,secretsEncrypted:s}=r;return t.agentProfileId||await Ye(a),qe({...t,encryptedAgentSettings:a,encryptedConversationSettings:o,secretsEncrypted:s,customSecrets:i})}function Ze(){return{hooks:[]}}function Qe(e,t){if(!t)return;let n=new Set(t.profiles.map(e=>e.name));if(e&&n.has(e))return e;if(t.active_profile&&n.has(t.active_profile))return t.active_profile}var $e=`1970-01-01T00:00:00.000Z`,et=300*1e3,tt=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function J(){return Error(tt)}function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nt(e){return typeof e==`number`?e:null}function X(e){return typeof e==`number`?e:0}function Z(e){return typeof e==`string`?e:null}function Q(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:$e}function rt(e){return Y(e)?{prompt_tokens:X(e.prompt_tokens),completion_tokens:X(e.completion_tokens),cache_read_tokens:X(e.cache_read_tokens),cache_write_tokens:X(e.cache_write_tokens),context_window:X(e.context_window),per_turn_token:X(e.per_turn_token)}:null}function it(e){return Y(e)?{accumulated_cost:nt(e.accumulated_cost),max_budget_per_task:nt(e.max_budget_per_task),accumulated_token_usage:rt(e.accumulated_token_usage)}:null}function at(e){if(!Y(e))return null;let t=Y(e.llm)?{model:Z(e.llm.model)}:null;return{kind:Z(e.kind),acp_server:Z(e.acp_server),acp_model:Z(e.acp_model),llm:t}}function ot(e){return Y(e)?{working_dir:Z(e.working_dir)}:null}function st(e){if(!Y(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function ct(e){if(!Y(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function lt(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function ut(e,t){let n=lt(e),r=lt(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function dt(e){if(!Y(e)||typeof e.id!=`string`||!e.id.trim())throw J();return{id:e.id.trim(),title:Z(e.title),created_at:Q(e,`created_at`,`createdAt`),updated_at:Q(e,`updated_at`,`updatedAt`),execution_status:Z(e.execution_status),sandbox_status:Z(e.sandbox_status),metrics:it(e.metrics),agent:at(e.agent),workspace:ot(e.workspace),tags:st(e.tags),launched_agent_profile:ct(e.launched_agent_profile),current_model_id:Z(e.current_model_id),current_model_name:Z(e.current_model_name)}}function $(e){if(!Array.isArray(e))throw J();return e.map(dt)}function ft(e){if(Array.isArray(e))return{items:$(e),next_page_id:null};if(!Y(e))throw J();return{items:$(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var pt=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function mt(e){let t=e??`idle`;return pt.has(t)?t:`idle`}function ht(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var gt=class{static async sendMessage(e,n,r){let i=d().backend,a=r?.conversationUrl??null,o=r?.sessionApiKey??null;if(i.kind===`cloud`){if(!a||!o){let[t]=await P([e]);a=t?.conversation_url?.trim()??null,o=t?.session_api_key?.trim()??null}if(!a||!o)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await h({backend:i,method:`POST`,hostOverride:l(a),path:`/api/conversations/${e}/events`,body:{...n,run:!0},authMode:`session-api-key`,sessionApiKey:o}),n}return await new t(c({conversationUrl:a,sessionApiKey:o})).sendEvent(e,n,{run:!0}),n}static async createConversation(e,n,r,i,a,o,l,u,f,p,m){if(d().backend.kind===`cloud`)return de({initial_message:e?{role:`user`,content:[{type:`text`,text:e}]}:null,title:n??null,selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,plugins:r??null,parent_conversation_id:l??null,agent_type:u,sandbox_id:f??null,agent_profile_id:p??null});let[h,g]=await Promise.all([_.getSettings(),y.listProfiles().catch(()=>void 0)]),ne=Qe(h.title_llm_profile,g),b=v(),x=await se(a??ee(b)),S=o??(a?`local_repo`:`new_worktree`),C=await Xe({settings:h,query:e,conversationInstructions:n,plugins:r,conversationId:b,workingDir:x,worktree:S===`new_worktree`,agentProfileId:p,agentProfileKind:m,titleLlmProfile:ne}),w=await new t(c({timeout:et})).createConversation(C),T=te();if(!T)throw new s;return(i?.selected_repository||a)&&A(w.id,{selected_repository:i?.selected_repository??null,selected_branch:i?.selected_branch??null,git_provider:i?.git_provider??null,selected_workspace:a??null,workspace_mode:S}),{id:w.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:w.id,agent_server_url:T.host,request:{initial_message:C.initial_message,plugins:r??null},created_at:w.created_at,updated_at:w.updated_at}}static async getStartTask(e){return d().backend.kind===`cloud`?_e(e):null}static async getVSCodeUrl(e,t,r){let i=await this.resolveConversationWorkingDir(e);return{vscode_url:await new n(c({conversationUrl:t,sessionApiKey:r})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:i})}}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??u()}static async batchGetAppConversations(e){return e.length===0?[]:d().backend.kind===`cloud`?P(e):$(await new t(c()).getConversations(e)).map(e=>V(e))}static async updateConversationPublicFlag(e,t){if(d().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return me(e,t)}static async updateConversationRepository(e,t,n,r){t?A(e,{...k(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):j(e);let[i]=await this.batchGetAppConversations([e]);return ht(i,e)}static async readConversationFile(e,t){if(d().backend.kind===`cloud`)return F(e,ut(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=ut(t??`${n}/.agents_tmp/PLAN.md`,n);return new i(c()).downloadTextFile(r)}static async downloadConversation(e){return d().backend.kind===`cloud`?fe(e):new i(c()).downloadTrajectory(e)}static async getHooks(e){return Ze()}static async getRuntimeConversation(e,n,r){let i=d().backend,a=i.kind===`cloud`&&n?await h({backend:i,method:`GET`,hostOverride:l(n),path:`/api/conversations/${e}`,authMode:`session-api-key`,sessionApiKey:r}):await new t(c({conversationUrl:n,sessionApiKey:r})).getConversation(e),o=dt(a),s=Y(a)?a.stats:null;return{id:o.id,title:o.title?.trim()?o.title:B(o.id),metrics:it(o.metrics),created_at:o.created_at,updated_at:o.updated_at,status:mt(o.execution_status),stats:Y(s)?s:{usage_to_metrics:{}}}}static async searchConversations(e=20,n){return d().backend.kind===`cloud`?ue(e,n):De(ft(await new t(c()).searchConversations({limit:e,page_id:n,sort_order:p.UPDATED_AT_DESC})))}static async deleteConversation(e){d().backend.kind===`cloud`?await pe(e):await new t(c()).deleteConversation(e),j(e)}static async updateConversationTitle(e,n){await new t(c()).updateConversation(e,{title:n});let[r]=await this.batchGetAppConversations([e]);return ht(r,e)}static async forkConversation(e,n,r){if(d().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let i=await new t(c()).forkConversation(e,{from_event_id:n,...r?{title:r}:{}}),a=k(e);return a&&A(i.id,a),i}static async getEventParentId(e,n){return(await new t(c()).getEvent(e,n)).parent_id??void 0}static async switchProfile(e,n){let{backend:i}=d();if(i.kind===`cloud`){if(!e){await y.activateProfile(n);return}await h({backend:i,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:n}});return}if(!e){await new r(c()).activateProfile(n);return}let a=c(),o=new t(a),s=await new r(a).getProfile(n,{exposeSecrets:`encrypted`}),l=typeof s.config.model==`string`?s.config.model:``;if(!l)throw Error(`Profile '${n}' has no model.`);await Ye({llm:s.config}),await o.switchLLM(e,{...s.config,model:l,stream:!0,usage_id:`profile:${n}:${v()}`})}static async switchAcpModel(e,n){let{backend:r}=d();if(r.kind===`cloud`){await h({backend:r,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:n}});return}await new t(c()).switchAcpModel(e,n)}};export{I as a,F as c,A as d,ce as f,L as i,ge as l,ke as n,P as o,se as p,ye as r,he as s,gt as t,k as u};
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{U as i,p 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{it as s,rt as c,st as l}from"./active-backend-context-BlZPzZNU.js";import{t as u,z as d}from"./utils-qjs_KuS4.js";import{n as f}from"./use-settings-DBI44RnH.js";import{t as p}from"./use-save-settings-BRh9p_fv.js";import"./form-control-classes-CSPevi7c.js";import{t as m}from"./brand-button-CQO8oqVo.js";import{t as h}from"./settings-input-BjW_zyTN.js";import{c as g,i as _,n as v,o as y,s as ee,t as te}from"./acp-providers-BHKZvEm5.js";import{_ as ne,g as re,h as ie,m as ae,n as oe,o as se}from"./schema-field-CV6bFnoL.js";import{t as b}from"./settings-dropdown-input-Dx6vlkgf.js";import{r as x}from"./typography-C6fuRTTT.js";import{t as ce}from"./settings-switch-UNSf8K8I.js";import{a as S,i as le,n as C,r as w,t as ue}from"./use-acp-credential-form-B0_pZ_uS.js";var T=e(n(),1),E=r();function de({form:e,providerKey:t}){let{t:n}=o(`openhands`),{fields:r,values:i,setValue:a,secretExists:s,conflicts:c}=e,{status:l,isChecking:u}=C(t),f=g(t)??t;return r.length===0?null:(0,E.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(x.Text,{className:`text-sm font-medium text-white`,children:n(d.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:n(d.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,E.jsx)(le,{status:l,isChecking:u,providerName:f,testIdPrefix:`settings-acp-auth`}),(0,E.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,E.jsx)(w,{field:e,value:i[e.name]??``,onChange:t=>a(e.name,t),alreadySet:s(e.name),testId:`settings-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,E.jsx)(S,{conflicts:c})]})}var D=t(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(`op`in e&&e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(`op`in e&&typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(`comment`in e&&typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,`$1\\$2`)}).join(` `)}})),O=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p||=!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}})),{quote:k}=e(t((e=>{e.quote=D(),e.parse=O()}))(),1);function A(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
2
- `||a===`\r`){i&&=(t.push(r),r=``,!1),n+=1;continue}if(a===`'`){for(i=!0,n+=1;n<e.length&&e[n]!==`'`;)r+=e[n],n+=1;n<e.length&&(n+=1);continue}if(a===`"`){for(i=!0,n+=1;n<e.length&&e[n]!==`"`;){if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];if(t===`"`||t===`\\`){r+=t,n+=2;continue}}r+=e[n],n+=1}n<e.length&&(n+=1);continue}if(a===`\\`&&n+1<e.length){i=!0,r+=e[n+1],n+=2;continue}i=!0,r+=a,n+=1}return i&&t.push(r),t}var fe=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function j(e){return e.map(e=>fe.test(e)||e===``?k([e]):e).join(` `)}var M={hideTitle:!0},pe=`enable_sub_agents`,me=`tool_concurrency_limit`,he=`npx -y <package-name>`,N=`__custom_model__`;function ge(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function P(e,t){let n=A(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return te}function _e(e){return e?.find(e=>e.key===pe)}function ve(e,t){return typeof e==`boolean`?e:t?.default===!0}function ye(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function be(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,toolConcurrencyField:s,toolConcurrency:c}=e;if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:j(i)||null,acp_args:null}}let l={agent_kind:`openhands`,enable_sub_agents:o};if(s){let e=se(s,c),t=typeof s.default==`number`?s.default:1;l.tool_concurrency_limit=e==null?t:Number(e)}return l}function F({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=f(),g=t??i?.agent_settings??null,{mutate:S,isPending:le}=p(),{data:C}=ne(i?.agent_settings_schema),w=T.useMemo(()=>C?.sections.flatMap(e=>e.fields),[C]),D=_e(w),O=T.useMemo(()=>ve(g?.[pe],D),[D,g]),[k,fe]=(0,T.useState)(O),M=w?.find(e=>e.key===me),F=T.useMemo(()=>{if(!M)return``;let e=g?.[me];return ae(M,e)},[M,g]),[I,xe]=(0,T.useState)(F),[L,R]=(0,T.useState)(`openhands`),[z,B]=(0,T.useState)(``),[V,H]=(0,T.useState)(``),[Se,U]=(0,T.useState)(!1),[Ce,W]=(0,T.useState)(!1),G=L===`acp`?P(z,v):null,K=ue(G&&G!==`custom`?G:null),we=(0,T.useRef)(null),q=(0,T.useRef)(null),J=(0,T.useRef)(``);(0,T.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(we.current!==n){if(we.current=n,e?.agent_kind===`acp`){R(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=ee(n),i=ge(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],...ge(e?.acp_args)],o=a.length>0?j(a):``;B(o),q.current=n??null,J.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``;H(c||y(n)||``),U(!!c&&(!r||!ye(r,c)))}else R(`openhands`),B(``),H(``),q.current=null,J.current=``,U(!1);W(!1)}},[i,t]),(0,T.useEffect)(()=>{fe(O)},[O]),(0,T.useEffect)(()=>{xe(F)},[F]);let Te=(0,T.useRef)(()=>({agent_kind:`openhands`,enable_sub_agents:!1})),Ee=(0,T.useCallback)(()=>Te.current(),[]),Y=(0,T.useRef)(K);Y.current=K;let De=(0,T.useCallback)(e=>Y.current.save(e),[]),Oe=(0,T.useCallback)(()=>Y.current.reset(),[]),ke=L===`acp`&&A(z).length===0,Ae=K.isDirty;if((0,T.useEffect)(()=>{!e||!n||n({agentType:L,isValid:!ke,buildAgentProfileFields:Ee,credentials:{isDirty:Ae,save:De,reset:Oe}})},[e,n,L,ke,Ae,Ee,De,Oe]),a)return null;let X=L===`acp`,Z=A(z),je=X&&Z.length===0,Q=P(z,v),$=ee(Q),Me=$?.available_models??[],Ne=Me.length>0,Pe=ye($,V),Fe=Se||!Pe?N:V,Ie=!!$&&Z.join(` `)===$.default_command.join(` `),Le=j(v[0]?.default_command??[])||he;Te.current=()=>be({isAcp:X,selectedPreset:Q,isDefaultProviderCommand:Ie,commandTokens:Z,acpModel:V,subAgentsEnabled:k,toolConcurrencyField:M,toolConcurrency:I});let Re=Ce||!X&&(k!==O||I!==F),ze=K.isDirty,Be=Re||ze,Ve=le||K.isSaving,He=async()=>{if(K.isDirty){if(!await K.save({silent:Re}))return;K.reset()}if(Re)if(X){let e=!!($&&Ie),t=q.current,n=z===J.current,i=!!t&&t!==`custom`&&!v.some(e=>e.key===t),a=X&&n&&i,o=_(a?t:$&&Ie?$.key:te,{command:e?[]:Z,model:V.trim()||void 0,allowUnknownServer:a});if(!o)return;S({agent_settings_diff:o},{onError:e=>{c(l(e)||r(d.ERROR$GENERIC))},onSuccess:()=>{s(r(d.SETTINGS$SAVED)),W(!1)}})}else{let e={agent_kind:`openhands`,enable_sub_agents:k};if(M){let t;try{t=se(M,I)}catch(e){c(e instanceof Error?e.message:r(d.ERROR$GENERIC));return}t!=null&&(e[me]=t)}S({agent_settings_diff:e},{onError:e=>{c(l(e)||r(d.ERROR$GENERIC))},onSuccess:()=>{s(r(d.SETTINGS$SAVED)),W(!1)}})}},Ue=D?re(r,D.key,D.label):r(d.SCHEMA$ENABLE_SUB_AGENTS$LABEL),We=D?ie(r,D.key,D.description):r(d.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION);return(0,E.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[!e&&(0,E.jsxs)(`div`,{children:[(0,E.jsx)(x.H2,{className:`mb-2`,children:r(d.SETTINGS$NAV_AGENT)}),(0,E.jsx)(x.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:r(d.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,E.jsx)(b,{testId:`agent-type-selector`,name:`agent-type`,label:r(d.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:r(d.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:r(d.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:L,onSelectionChange:e=>{if(!e)return;let t=e;if(R(t),t===`acp`&&!z){let e=v[0];e&&(B(j(e.default_command)),H(y(e.key)??``),U(!1))}else t===`openhands`&&U(!1);W(!0)}}),!X&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(ce,{testId:`agent-settings-enable-sub-agents`,isToggled:k,onToggle:e=>{fe(e)},children:Ue}),We?(0,E.jsx)(x.Paragraph,{className:u(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:We}):null]}),!X&&M?(0,E.jsx)(oe,{field:M,value:I,isDisabled:Ve,onChange:xe}):null,X&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(b,{testId:`agent-preset-selector`,name:`agent-preset`,label:r(d.SETTINGS$AGENT_PRESET),items:[...v.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:r(d.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Q,onSelectionChange:e=>{if(!e)return;let t=String(e),n=ee(t);n?(B(j(n.default_command)),H(y(t)??``),U(!1)):t===`custom`&&(B(``),H(``),U(!0)),W(!0)}}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,E.jsx)(x.Text,{className:`text-sm`,children:r(d.SETTINGS$AGENT_COMMAND)}),(0,E.jsx)(`textarea`,{"data-testid":`agent-command-input`,className:`bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white`,value:z,placeholder:Le,onChange:e=>{let t=e.target.value,n=P(z,v),r=P(t,v);r!==n&&(H(y(r)??``),U(!1)),B(t),W(!0)}}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:r(d.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Ne&&(0,E.jsx)(b,{testId:`agent-model-selector`,name:`agent-model`,label:r(d.SETTINGS$AGENT_MODEL),items:[...Me.map(e=>({key:e.id,label:e.label})),{key:N,label:r(d.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Fe,onSelectionChange:e=>{if(!e)return;let t=String(e);t===N?(U(!0),H(``)):(U(!1),H(t)),W(!0)}}),Fe===N&&(0,E.jsx)(h,{testId:`agent-model-input`,label:r(Ne?d.SETTINGS$AGENT_CUSTOM_MODEL:d.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:V,showOptionalTag:!0,onChange:e=>{H(e),W(!0)}}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:r(d.SETTINGS$AGENT_MODEL_HINT)})]})]}),X&&Q!==`custom`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`hr`,{className:`border-[#3D4046]`}),(0,E.jsx)(de,{form:K,providerKey:Q})]}),!e&&(0,E.jsx)(`div`,{children:(0,E.jsx)(m,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:Ve||!Be||je,onClick:He,children:r(Ve?d.SETTINGS$SAVING:d.SETTINGS$SAVE_CHANGES)})})]})}var I=i(function(){return(0,E.jsx)(a,{to:`/settings/agents`,replace:!0})});export{A as i,I as n,M as r,F as t};
1
+ import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{U as i,p 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{Dt as s,Ot as c,jt as l}from"./active-backend-context-mY7Gff5c.js";import{t as u,z as d}from"./utils-DsWhWn2F.js";import{n as f}from"./use-settings-DIAo5KFk.js";import{t as p}from"./use-save-settings--C6LZXfI.js";import"./form-control-classes-CtVAktAy.js";import{t as m}from"./brand-button-BUlDL-mz.js";import{t as h}from"./settings-input-BEaTCem1.js";import{c as g,i as _,n as v,o as y,s as ee,t as te}from"./acp-providers-WUD4tfSq.js";import{_ as ne,g as re,h as ie,m as ae,n as oe,o as se}from"./schema-field-htfNouTG.js";import{t as b}from"./settings-dropdown-input-jOiv5Yrk.js";import{r as x}from"./typography-B1UxuuEC.js";import{t as ce}from"./settings-switch-B405oU_v.js";import{a as S,i as le,n as C,r as w,t as ue}from"./use-acp-credential-form-CjSvKWFH.js";var T=e(n(),1),E=r();function de({form:e,providerKey:t}){let{t:n}=o(`openhands`),{fields:r,values:i,setValue:a,secretExists:s,conflicts:c}=e,{status:l,isChecking:u}=C(t),f=g(t)??t;return r.length===0?null:(0,E.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,E.jsx)(x.Text,{className:`text-sm font-medium text-white`,children:n(d.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:n(d.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,E.jsx)(le,{status:l,isChecking:u,providerName:f,testIdPrefix:`settings-acp-auth`}),(0,E.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,E.jsx)(w,{field:e,value:i[e.name]??``,onChange:t=>a(e.name,t),alreadySet:s(e.name),testId:`settings-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,E.jsx)(S,{conflicts:c})]})}var D=t(((e,t)=>{var n=[`||`,`&&`,`;;`,`|&`,`<(`,`<<<`,`>>`,`>&`,`<&`,`&`,`;`,`(`,`)`,`|`,`<`,`>`],r=/[\n\r\u2028\u2029]/,i=/[\s#!"$&'():;<=>@\\^`|]/g;t.exports=function(e){return e.map(function(e){if(e===``)return`''`;if(e&&typeof e==`object`){if(`op`in e&&e.op===`glob`){if(typeof e.pattern!=`string`)throw TypeError("glob token requires a string `pattern`");if(r.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(i,`\\$&`)}if(`op`in e&&typeof e.op==`string`){if(n.indexOf(e.op)<0)throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,`\\$&`)}if(`comment`in e&&typeof e.comment==`string`){if(r.test(e.comment))throw TypeError("`comment` must not contain line terminators");return`#`+e.comment}throw TypeError(`unrecognized object token shape`)}return/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,`$1\\$2`)}).join(` `)}})),O=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p||=!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}})),{quote:k}=e(t((e=>{e.quote=D(),e.parse=O()}))(),1);function A(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
2
+ `||a===`\r`){i&&=(t.push(r),r=``,!1),n+=1;continue}if(a===`'`){for(i=!0,n+=1;n<e.length&&e[n]!==`'`;)r+=e[n],n+=1;n<e.length&&(n+=1);continue}if(a===`"`){for(i=!0,n+=1;n<e.length&&e[n]!==`"`;){if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];if(t===`"`||t===`\\`){r+=t,n+=2;continue}}r+=e[n],n+=1}n<e.length&&(n+=1);continue}if(a===`\\`&&n+1<e.length){i=!0,r+=e[n+1],n+=2;continue}i=!0,r+=a,n+=1}return i&&t.push(r),t}var fe=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function j(e){return e.map(e=>fe.test(e)||e===``?k([e]):e).join(` `)}var M={hideTitle:!0},pe=`enable_sub_agents`,me=`tool_concurrency_limit`,he=`npx -y <package-name>`,N=`__custom_model__`;function ge(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function P(e,t){let n=A(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return te}function _e(e){return e?.find(e=>e.key===pe)}function ve(e,t){return typeof e==`boolean`?e:t?.default===!0}function ye(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function be(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,toolConcurrencyField:s,toolConcurrency:c}=e;if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:j(i)||null,acp_args:null}}let l={agent_kind:`openhands`,enable_sub_agents:o};if(s){let e=se(s,c),t=typeof s.default==`number`?s.default:1;l.tool_concurrency_limit=e==null?t:Number(e)}return l}function F({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=f(),g=t??i?.agent_settings??null,{mutate:S,isPending:le}=p(),{data:C}=ne(i?.agent_settings_schema),w=T.useMemo(()=>C?.sections.flatMap(e=>e.fields),[C]),D=_e(w),O=T.useMemo(()=>ve(g?.[pe],D),[D,g]),[k,fe]=(0,T.useState)(O),M=w?.find(e=>e.key===me),F=T.useMemo(()=>{if(!M)return``;let e=g?.[me];return ae(M,e)},[M,g]),[I,xe]=(0,T.useState)(F),[L,R]=(0,T.useState)(`openhands`),[z,B]=(0,T.useState)(``),[V,H]=(0,T.useState)(``),[Se,U]=(0,T.useState)(!1),[Ce,W]=(0,T.useState)(!1),G=L===`acp`?P(z,v):null,K=ue(G&&G!==`custom`?G:null),we=(0,T.useRef)(null),q=(0,T.useRef)(null),J=(0,T.useRef)(``);(0,T.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(we.current!==n){if(we.current=n,e?.agent_kind===`acp`){R(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=ee(n),i=ge(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],...ge(e?.acp_args)],o=a.length>0?j(a):``;B(o),q.current=n??null,J.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``;H(c||y(n)||``),U(!!c&&(!r||!ye(r,c)))}else R(`openhands`),B(``),H(``),q.current=null,J.current=``,U(!1);W(!1)}},[i,t]),(0,T.useEffect)(()=>{fe(O)},[O]),(0,T.useEffect)(()=>{xe(F)},[F]);let Te=(0,T.useRef)(()=>({agent_kind:`openhands`,enable_sub_agents:!1})),Ee=(0,T.useCallback)(()=>Te.current(),[]),Y=(0,T.useRef)(K);Y.current=K;let De=(0,T.useCallback)(e=>Y.current.save(e),[]),Oe=(0,T.useCallback)(()=>Y.current.reset(),[]),ke=L===`acp`&&A(z).length===0,Ae=K.isDirty;if((0,T.useEffect)(()=>{!e||!n||n({agentType:L,isValid:!ke,buildAgentProfileFields:Ee,credentials:{isDirty:Ae,save:De,reset:Oe}})},[e,n,L,ke,Ae,Ee,De,Oe]),a)return null;let X=L===`acp`,Z=A(z),je=X&&Z.length===0,Q=P(z,v),$=ee(Q),Me=$?.available_models??[],Ne=Me.length>0,Pe=ye($,V),Fe=Se||!Pe?N:V,Ie=!!$&&Z.join(` `)===$.default_command.join(` `),Le=j(v[0]?.default_command??[])||he;Te.current=()=>be({isAcp:X,selectedPreset:Q,isDefaultProviderCommand:Ie,commandTokens:Z,acpModel:V,subAgentsEnabled:k,toolConcurrencyField:M,toolConcurrency:I});let Re=Ce||!X&&(k!==O||I!==F),ze=K.isDirty,Be=Re||ze,Ve=le||K.isSaving,He=async()=>{if(K.isDirty){if(!await K.save({silent:Re}))return;K.reset()}if(Re)if(X){let e=!!($&&Ie),t=q.current,n=z===J.current,i=!!t&&t!==`custom`&&!v.some(e=>e.key===t),a=X&&n&&i,o=_(a?t:$&&Ie?$.key:te,{command:e?[]:Z,model:V.trim()||void 0,allowUnknownServer:a});if(!o)return;S({agent_settings_diff:o},{onError:e=>{s(l(e)||r(d.ERROR$GENERIC))},onSuccess:()=>{c(r(d.SETTINGS$SAVED)),W(!1)}})}else{let e={agent_kind:`openhands`,enable_sub_agents:k};if(M){let t;try{t=se(M,I)}catch(e){s(e instanceof Error?e.message:r(d.ERROR$GENERIC));return}t!=null&&(e[me]=t)}S({agent_settings_diff:e},{onError:e=>{s(l(e)||r(d.ERROR$GENERIC))},onSuccess:()=>{c(r(d.SETTINGS$SAVED)),W(!1)}})}},Ue=D?re(r,D.key,D.label):r(d.SCHEMA$ENABLE_SUB_AGENTS$LABEL),We=D?ie(r,D.key,D.description):r(d.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION);return(0,E.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[!e&&(0,E.jsxs)(`div`,{children:[(0,E.jsx)(x.H2,{className:`mb-2`,children:r(d.SETTINGS$NAV_AGENT)}),(0,E.jsx)(x.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:r(d.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,E.jsx)(b,{testId:`agent-type-selector`,name:`agent-type`,label:r(d.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:r(d.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:r(d.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:L,onSelectionChange:e=>{if(!e)return;let t=e;if(R(t),t===`acp`&&!z){let e=v[0];e&&(B(j(e.default_command)),H(y(e.key)??``),U(!1))}else t===`openhands`&&U(!1);W(!0)}}),!X&&(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(ce,{testId:`agent-settings-enable-sub-agents`,isToggled:k,onToggle:e=>{fe(e)},children:Ue}),We?(0,E.jsx)(x.Paragraph,{className:u(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:We}):null]}),!X&&M?(0,E.jsx)(oe,{field:M,value:I,isDisabled:Ve,onChange:xe}):null,X&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(b,{testId:`agent-preset-selector`,name:`agent-preset`,label:r(d.SETTINGS$AGENT_PRESET),items:[...v.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:r(d.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Q,onSelectionChange:e=>{if(!e)return;let t=String(e),n=ee(t);n?(B(j(n.default_command)),H(y(t)??``),U(!1)):t===`custom`&&(B(``),H(``),U(!0)),W(!0)}}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,E.jsx)(x.Text,{className:`text-sm`,children:r(d.SETTINGS$AGENT_COMMAND)}),(0,E.jsx)(`textarea`,{"data-testid":`agent-command-input`,className:`bg-tertiary border border-[#717888] rounded-sm p-2 text-sm font-mono text-white placeholder:text-[#717888] min-h-[60px] resize-y focus:outline-none focus:border-white`,value:z,placeholder:Le,onChange:e=>{let t=e.target.value,n=P(z,v),r=P(t,v);r!==n&&(H(y(r)??``),U(!1)),B(t),W(!0)}}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:r(d.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Ne&&(0,E.jsx)(b,{testId:`agent-model-selector`,name:`agent-model`,label:r(d.SETTINGS$AGENT_MODEL),items:[...Me.map(e=>({key:e.id,label:e.label})),{key:N,label:r(d.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Fe,onSelectionChange:e=>{if(!e)return;let t=String(e);t===N?(U(!0),H(``)):(U(!1),H(t)),W(!0)}}),Fe===N&&(0,E.jsx)(h,{testId:`agent-model-input`,label:r(Ne?d.SETTINGS$AGENT_CUSTOM_MODEL:d.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:V,showOptionalTag:!0,onChange:e=>{H(e),W(!0)}}),(0,E.jsx)(x.Text,{className:`text-xs text-[#717888]`,children:r(d.SETTINGS$AGENT_MODEL_HINT)})]})]}),X&&Q!==`custom`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`hr`,{className:`border-[#3D4046]`}),(0,E.jsx)(de,{form:K,providerKey:Q})]}),!e&&(0,E.jsx)(`div`,{children:(0,E.jsx)(m,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:Ve||!Be||je,onClick:He,children:r(Ve?d.SETTINGS$SAVING:d.SETTINGS$SAVE_CHANGES)})})]})}var I=i(function(){return(0,E.jsx)(a,{to:`/settings/agents`,replace:!0})});export{A as i,I as n,M as r,F as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./agent-settings-BGTyoT6X.js";export{e as default,t as handle};
@@ -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{c as i}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{t as a,z as o}from"./utils-qjs_KuS4.js";import{n as s}from"./navigation-context-BOGzIng3.js";import{t as c}from"./close-CDAVqnTn.js";import{r as l}from"./typography-C6fuRTTT.js";import{t as u}from"./vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=r(`openhands`),[h,g]=u(`alert_banner_dismissed_at`,null),{currentPath:_}=s(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(i,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:m(o.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(l.Paragraph,{className:`text-sm font-medium`,children:[m(o.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(c,{})})]}):null}export{p as AlertBanner};
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{c as i}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js";import{t as a,z as o}from"./utils-DsWhWn2F.js";import{n as s}from"./navigation-context-BOGzIng3.js";import{t as c}from"./close-CDAVqnTn.js";import{r as l}from"./typography-B1UxuuEC.js";import{t as u}from"./vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=r(`openhands`),[h,g]=u(`alert_banner_dismissed_at`,null),{currentPath:_}=s(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(i,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:m(o.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(l.Paragraph,{className:`text-sm font-medium`,children:[m(o.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(l.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(c,{})})]}):null}export{p as AlertBanner};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{t as r}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{d as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{J as a,Z as o,lt as s,r as c}from"./active-backend-context-mY7Gff5c.js";import{t as l,z as u}from"./utils-DsWhWn2F.js";import{r as d,t as f}from"./modal-body-C3bGicn4.js";import{t as p}from"./brand-button-BUlDL-mz.js";import{n as m,o as h}from"./backend-form-modal-CKrBF80P.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=c(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new i(o({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),s(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),a(t,401))T(e(u.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(u.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:l(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,d(`md`),f),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(u.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(m,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(h,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(u.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(p,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?u.ONBOARDING$BACKEND_STATUS_CHECKING:u.BACKEND$CONNECT)})]})})})]})})}export{v 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{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{Dt as a,It as o,Ot as s,_ as c,jt as l,n as u}from"./active-backend-context-mY7Gff5c.js";import{z as d}from"./utils-DsWhWn2F.js";import{t as f}from"./settings-Chfn5xTD.js";import{n as p}from"./use-settings-DIAo5KFk.js";import{t as m}from"./use-save-settings--C6LZXfI.js";import{t as h}from"./brand-button-BUlDL-mz.js";import{i as g,n as _,r as v,t as y}from"./color-themes-DTj5Ylbr.js";import{t as b}from"./navigation-link-Bxmn-pCs.js";import{t as x}from"./settings-input-BEaTCem1.js";import{t as S}from"./use-llm-profiles-CdaxVpyY.js";import{t as C}from"./settings-dropdown-input-jOiv5Yrk.js";import{n as w,t as T}from"./switch-skeleton-BQoOhQTB.js";import{t as E}from"./settings-switch-B405oU_v.js";var D=e(t(),1),O=n();function k({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,O.jsx)(C,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:o.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function A(){let{t:e}=i(`openhands`),t=D.useCallback(e=>{if(!e)return;let t=e;_(t),v(t)},[]);return(0,O.jsx)(C,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:y.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:g(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function j(){return(0,O.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,O.jsx)(w,{}),(0,O.jsx)(T,{}),(0,O.jsx)(T,{})]})}var M=`__automatic__`;function N(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=m(),{data:r,isLoading:g}=p(),_=u().backend.kind===`cloud`,{data:v,isLoading:y}=S(),[w,T]=D.useState(!1),[N,P]=D.useState(!1),[F,I]=D.useState(!1),[L,R]=D.useState(!1),[z,B]=D.useState(!1),[V,H]=D.useState(void 0),U=D.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!v||v.profiles.some(t=>t.name===e)?e:null},[v,r?.title_llm_profile]),W=V===void 0?U:V,G=D.useMemo(()=>[{key:M,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...v?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:t.model}):t.name}))??[]],[v?.profiles,e]),K=n=>{let r=n.get(`language-input`)?.toString(),i=o.find(({label:e})=>e===r)?.value||f.language,u=_?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,p=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||f.git_user_name,h=n.get(`git-user-email-input`)?.toString()||f.git_user_email;t({language:i,...!_&&{user_consents_to_analytics:u},enable_sound_notifications:p,git_user_name:m,git_user_email:h,title_llm_profile:W},{onSuccess:()=>{c(u?`granted`:`denied`),s(e(d.SETTINGS$SAVED))},onError:t=>{a(l(t)||e(d.ERROR$GENERIC))},onSettled:()=>{T(!1),P(!1),I(!1),R(!1),B(!1),H(void 0)}})},q=e=>{let t=o.find(({label:t})=>t===e)?.label,n=o.find(({value:e})=>e===r?.language)?.label;T(t!==n)},J=e=>{P(e!==(r?.user_consents_to_analytics??!0))},Y=e=>{I(e!==!!r?.enable_sound_notifications)},X=e=>{let t=r?.git_user_name;R(e!==t)},Z=e=>{let t=r?.git_user_email;B(e!==t)},Q=!w&&!N&&!F&&W===U&&!L&&!z,$=!r||g||y||n;return(0,O.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:K,className:`flex flex-col gap-6`,children:[$&&(0,O.jsx)(j,{}),!$&&(0,O.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,O.jsx)(k,{name:`language-input`,defaultKey:r.language,onChange:q}),(0,O.jsx)(A,{}),(0,O.jsx)(E,{testId:`enable-analytics-switch`,name:_?void 0:`enable-analytics-switch`,defaultIsToggled:_?!0:r.user_consents_to_analytics??!0,isToggled:_?!0:void 0,isDisabled:_,onToggle:_?void 0:J,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,O.jsx)(E,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Y,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,O.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,O.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,O.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,O.jsx)(C,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:G,selectedKey:W??M,onSelectionChange:e=>{let t=e?.toString();H(!t||t===M?null:t)}}),(0,O.jsx)(b,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,O.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,O.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,O.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,O.jsx)(x,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:X,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,O.jsx)(x,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:Z,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,O.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,O.jsxs)(h,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||Q,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var P=r(N);export{P as default};
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Bcgpimp9.js";import{B as r,U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{j as o,v as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js";import{t as c}from"./useQuery-B38jBavx.js";import{Dt as l,Ot as u,Z as d,et as f,n as p,ot as m,q as h}from"./active-backend-context-mY7Gff5c.js";import{i as g,t as _,z as v}from"./utils-DsWhWn2F.js";import{t as y}from"./back-nav-button-C02hGa8t.js";import{t as b}from"./proxy-BiyDhMBd.js";import{n as x,t as S}from"./use-tracking-COqZLobY.js";import{t as C}from"./use-settings-DIAo5KFk.js";import{r as w}from"./modal-classes-DFFO6BMU.js";import{t as T}from"./brand-button-BUlDL-mz.js";import{n as E}from"./navigation-context-BOGzIng3.js";import{n as D}from"./use-create-conversation-CakhLF0X.js";import{t as O}from"./u-edit-809W9D9T.js";import{t as k}from"./terminal-cMS3RgVE.js";import{t as A}from"./use-user-conversation-DhcAEyJX.js";import{t as ee}from"./toggle-switch-DYRr9CAR.js";import{t as j}from"./x-mark-jcTkPiOB.js";import{n as M,t as N}from"./link-external-BDBCz-_z.js";import{C as te,D as P,E as ne,O as re,S as ie,T as ae,_ as F,a as oe,b as se,c as I,d as L,f as R,g as ce,h as le,i as ue,l as de,m as z,o as fe,p as pe,r as me,s as he,t as ge,u as _e}from"./automation-export-BO_kfqC8.js";import{t as B}from"./automation-BGP_I1RR.js";var V=e(t()),H=n();function U(){let{t:e}=a(`openhands`);return(0,H.jsx)(y,{to:`/automations`,children:e(v.AUTOMATIONS$DETAIL$BACK_TO_LIST)})}var W=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function ve({active:e}){let{t}=a(`openhands`);return(0,H.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:_(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?v.AUTOMATIONS$DETAIL$ACTIVE:v.AUTOMATIONS$DETAIL$INACTIVE)})}function ye({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:o,onRunNow:s,isRunningNow:c=!1}){let{t:l}=a(`openhands`),u=ce(`manage_automations`),d=[...n?[{label:l(v.AUTOMATIONS$EDIT),icon:(0,H.jsx)(O,{className:`size-4`}),onClick:n}]:[],{label:e.enabled?l(v.AUTOMATIONS$TURN_OFF):l(v.AUTOMATIONS$TURN_ON),icon:(0,H.jsx)(_e,{className:`size-4`}),onClick:t},{label:l(v.AUTOMATIONS$EXPORT),icon:(0,H.jsx)(W,{className:`size-4`}),onClick:i},{label:l(v.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,H.jsx)(W,{className:`size-4`}),onClick:o},{label:l(v.AUTOMATIONS$DELETE),icon:(0,H.jsx)(de,{className:`size-4`}),onClick:r}];return(0,H.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,H.jsx)(ve,{active:e.enabled})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u&&s&&(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:c||!e.enabled,onClick:s,children:[(0,H.jsx)(le,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),l(c?v.AUTOMATIONS$STARTING:v.AUTOMATIONS$RUN_NOW)]}),u&&(0,H.jsx)(ee,{enabled:e.enabled,label:e.enabled?l(v.AUTOMATIONS$TURN_OFF):l(v.AUTOMATIONS$TURN_ON),onToggle:t}),u&&(0,H.jsx)(F,{items:d})]})]})})}function G({icon:e,title:t,children:n}){return(0,H.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,H.jsx)(`span`,{className:`size-4 text-muted`,children:e}),(0,H.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t})]}),(0,H.jsx)(`div`,{className:`px-5 py-5`,children:n})]})}var be=240,xe=`max-h-60`;function Se({prompt:e}){let{t}=a(`openhands`),[n,r]=V.useState(!1),[i,o]=V.useState(!1),s=V.useRef(null),c=i&&!n;return V.useLayoutEffect(()=>{let e=s.current;if(!e)return;let t=()=>{o(e.scrollHeight>be)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,H.jsx)(G,{icon:(0,H.jsx)(k,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$PROMPT),children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(`p`,{ref:s,className:_(`whitespace-pre-wrap text-sm leading-6 text-content`,c&&_(xe,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),c?(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,H.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?v.COMMON$VIEW_LESS:v.COMMON$VIEW_MORE)}):null]})})}var Ce=e=>(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.204-.107-.397.165-.71.505-.78.929l-.15.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z`}),(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z`})]}),we=e=>(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:[(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 3v12m0 0a3 3 0 1 0 3 3M6 15a3 3 0 0 1 3-3h6a3 3 0 0 0 3-3V3m0 0a3 3 0 1 0 0 0`}),(0,H.jsx)(`circle`,{cx:6,cy:3,r:2}),(0,H.jsx)(`circle`,{cx:18,cy:3,r:2}),(0,H.jsx)(`circle`,{cx:9,cy:18,r:2})]}),K=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),q=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),Te=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function J({icon:e,label:t,children:n}){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`size-3.5 text-muted`,children:e}),(0,H.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:t})]}),(0,H.jsx)(`div`,{className:`text-sm text-content`,children:n})]})}function Ee({branch:e}){return(0,H.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var Y=60;function De({filter:e}){let{t}=a(`openhands`),[n,r]=(0,V.useState)(!1),i=e.length>Y;return(0,H.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,Y)}…`:e}),i&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?v.SETTINGS$SKILLS_SHOW_LESS:v.SETTINGS$SKILLS_SHOW_MORE)})]})}function Oe({automation:e}){let{t}=a(`openhands`),n=e.trigger.type===`event`,r=e.trigger.schedule??``;e.trigger.schedule_human&&(r=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let i=t(n?v.AUTOMATIONS$DETAIL$TRIGGER_EVENT:v.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,H.jsx)(G,{icon:(0,H.jsx)(Ce,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,H.jsx)(J,{icon:(0,H.jsx)(we,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,H.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,H.jsx)(Ee,{branch:e.branch})]})}),(0,H.jsx)(J,{icon:(0,H.jsx)(K,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$TRIGGER),children:i}),!n&&(0,H.jsx)(J,{icon:(0,H.jsx)(q,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$SCHEDULE),children:r}),n&&e.trigger.source&&(0,H.jsx)(J,{icon:(0,H.jsx)(pe,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),n&&e.trigger.on&&(0,H.jsx)(J,{icon:(0,H.jsx)(N,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_TYPE),children:L(e.trigger.on)}),n&&e.trigger.filter&&(0,H.jsx)(J,{icon:(0,H.jsx)(M,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,H.jsx)(De,{filter:e.trigger.filter})}),(0,H.jsx)(J,{icon:(0,H.jsx)(R,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$MODEL),children:e.model??t(v.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,H.jsx)(J,{icon:(0,H.jsx)(Te,{className:`size-3.5`}),label:t(v.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var ke=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function Ae({name:e}){return(0,H.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function je({plugins:e}){let{t}=a(`openhands`);return(0,H.jsx)(G,{icon:(0,H.jsx)(ke,{className:`size-4`}),title:t(v.AUTOMATIONS$DETAIL$PLUGINS),children:(0,H.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,H.jsx)(Ae,{name:e},e))})})}var X=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function Z(e,t){return new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`})}function Me(e,t,n){let r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?n(v.AUTOMATIONS$DETAIL$TIME_JUST_NOW):i<60?n(v.AUTOMATIONS$DETAIL$TIME_MINUTES_AGO,{count:i}):a<24?n(v.AUTOMATIONS$DETAIL$TIME_HOURS_AGO,{count:a}):o===1?n(v.AUTOMATIONS$DETAIL$TIME_YESTERDAY):o<7?n(v.AUTOMATIONS$DETAIL$TIME_DAYS_AGO,{count:o}):Z(e,t)}function Ne({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=a(`openhands`),i=r.language;return(0,H.jsx)(G,{icon:(0,H.jsx)(X,{className:`size-4`}),title:n(v.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,H.jsx)(J,{icon:(0,H.jsx)(q,{className:`size-3.5`}),label:n(v.AUTOMATIONS$DETAIL$CREATED),children:Z(e,i)}),(0,H.jsx)(J,{icon:(0,H.jsx)(z,{className:`size-3.5`}),label:n(v.AUTOMATIONS$DETAIL$LAST_RUN),children:t?Me(t,i,n):n(v.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Pe=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,H.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z`})}),Fe={[B.COMPLETED]:{label:v.AUTOMATIONS$DETAIL$SUCCESSFUL,style:`border-[var(--oh-success)]/50 bg-[var(--oh-success)]/10 text-[var(--oh-success)]`},[B.FAILED]:{label:v.AUTOMATIONS$DETAIL$FAILED,style:`border-[var(--oh-danger)]/50 bg-[var(--oh-danger)]/10 text-danger`},[B.PENDING]:{label:v.AUTOMATIONS$DETAIL$PENDING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`},[B.RUNNING]:{label:v.AUTOMATIONS$DETAIL$RUNNING,style:`border-[var(--oh-border)] bg-surface-raised text-muted`}};function Ie({status:e}){switch(e){case B.COMPLETED:return(0,H.jsx)(K,{"data-testid":`run-status-icon-completed`,className:`size-3.5`});case B.FAILED:return(0,H.jsx)(Pe,{"data-testid":`run-status-icon-failed`,className:`size-3.5`});default:return(0,H.jsx)(z,{"data-testid":`run-status-icon-pending`,className:`size-3.5`})}}function Le({status:e}){let{t}=a(`openhands`),n=Fe[e];return(0,H.jsxs)(`span`,{className:_(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium`,n.style),children:[(0,H.jsx)(Ie,{status:e}),t(n.label)]})}var Re=20;function ze(e){return e.kind===`BashOutput`}var Be=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<Re;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{ze(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=m().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),b({backend:r,method:`GET`,hostOverride:f(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new s(d({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},Ve=[`bash-command-logs`];function He(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function Ue(e){let t=o.isAxiosError(e)?e.response?.status:h(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(o.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function We(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=p(),a=A(r?t??null:null),o=a.data,s=o?.conversation_url??null,l=o?.session_api_key??null,u=i.backend.kind===`cloud`,d=a.isFetched,f=null,m=!1;u&&d&&(o?f=He(o.sandbox_status)??(o.conversation_url?null:`missing`):m=!0);let h=r&&!!n&&(u?!!s:!0)&&!f&&!m,g=c({queryKey:[...Ve,n,s,l,i.backend.id,i.orgId],queryFn:()=>Be.listOutputs(s,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?Ue(g.error):null,v=f??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:m,sandboxIssue:v}}var Ge=4e3;function Ke(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function qe({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?Ke(a,Ge):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
2
+ `)}function Je({run:e,automation:t,stderr:n}){let{t:r}=a(`openhands`),{navigate:i}=E(),o=D();return(0,H.jsx)(T,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(o.isPending)return;let r=qe({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});o.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:o.isPending,"aria-busy":o.isPending,children:r(v.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var Ye={missing:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:v.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function Q(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function Xe({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:o}){let{t:s}=a(`openhands`),[c,l]=(0,V.useState)(`stdout`),{data:u,isFetching:d,isResolvingConversation:f,sandboxIssue:p,conversationMissing:m,error:h}=We({conversationId:e,bashCommandId:t,enabled:n});(0,V.useEffect)(()=>{n&&l(`stdout`)},[n,t]),(0,V.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:g,stderr:y}=(0,V.useMemo)(()=>u?{stdout:Q(u,`stdout`),stderr:Q(u,`stderr`)}:{stdout:``,stderr:``},[u]);if(!n)return null;let b=f||d&&!u,x=!t,S=c===`stdout`?g:y,C=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,T=`border-[var(--oh-primary)] text-white`,E=`border-transparent text-muted hover:text-content`;return(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":s(v.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,H.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,H.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":s(v.AUTOMATIONS$CANCEL),children:(0,H.jsx)(j,{className:`size-5`})}),(0,H.jsx)(`h2`,{className:_(`pr-8`,w),children:s(v.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":s(v.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:c===`stdout`?0:-1,onClick:()=>l(`stdout`),className:`${C} ${c===`stdout`?T:E}`,children:s(v.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":c===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:c===`stderr`?0:-1,onClick:()=>l(`stderr`),className:`${C} ${c===`stderr`?T:E}`,children:s(v.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,H.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${c}`,"aria-labelledby":`run-logs-tab-${c}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[x&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!x&&m&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!x&&!m&&p&&(0,H.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${p}`,className:`text-muted italic`,children:s(Ye[p])}),!x&&!m&&!p&&b&&(0,H.jsx)(`p`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!x&&!m&&!p&&!b&&h&&!u&&(0,H.jsxs)(`p`,{className:`text-danger`,children:[s(v.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(h)]}),!b&&!p&&u&&(0,H.jsx)(`pre`,{"data-testid":`run-logs-output-${c}`,className:`whitespace-pre-wrap break-words ${c===`stderr`?`text-danger`:`text-content`}`,children:S.length>0?S:(0,H.jsx)(`span`,{className:`text-muted italic`,children:s(v.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===B.FAILED&&(0,H.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,H.jsx)(Je,{run:i,automation:o,stderr:y})})]})]})}function Ze(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Qe(e){if(!e)return!0;let t=new Date(e).getTime();return Number.isNaN(t)||t===0}function $e(e){return`/conversations/${e}`}function et({run:e,automation:t}){let{t:n,i18n:r}=a(`openhands`),i=!!e.conversation_id,o=!!e.bash_command_id,s=e.status===B.COMPLETED||e.status===B.FAILED,c=!i&&s,[l,u]=(0,V.useState)(!1),[d]=(0,V.useState)(()=>new Date().toISOString()),f=Ze(Qe(e.started_at)?d:e.started_at,r.language),p=o?(0,H.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),u(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":n(v.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:f}),title:n(v.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,H.jsx)(k,{className:`size-4`})}):null,m=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`span`,{className:`text-sm text-content`,children:f}),c&&(0,H.jsxs)(`span`,{className:`text-xs text-muted italic`,children:[`(`,n(v.AUTOMATIONS$DETAIL$NO_CONVERSATION),`)`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,(0,H.jsx)(Le,{status:e.status})]})]});return(0,H.jsxs)(H.Fragment,{children:[i&&e.conversation_id?(0,H.jsx)(`a`,{href:$e(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":`View conversation for run at ${f}`,children:m}):(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:m}),o&&(0,H.jsx)(Xe,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:l,onClose:()=>u(!1),run:e,automation:t})]})}var tt=20;function nt({automation:e}){let{t}=a(`openhands`),[n,r]=(0,V.useState)(tt),{data:i,isLoading:o}=P({id:e.id,limit:n,offset:0}),s=i?i.total>i.runs.length:!1;return(0,H.jsxs)(`div`,{className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,H.jsx)(`span`,{className:`size-4 text-muted`,children:(0,H.jsx)(X,{className:`size-4`})}),(0,H.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(v.AUTOMATIONS$DETAIL$ACTIVITY_LOG)})]}),o&&(0,H.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,H.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,H.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,H.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!o&&i?.runs.length===0&&(0,H.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:t(v.AUTOMATIONS$DETAIL$NO_RUNS)}),!o&&i&&i.runs.length>0&&(0,H.jsxs)(`div`,{children:[i.runs.map((t,n)=>(0,H.jsx)(`div`,{className:n>0?`border-t border-[var(--oh-border)]`:``,children:(0,H.jsx)(et,{run:t,automation:e})},t.id)),s&&(0,H.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(e=>e+tt),className:`text-sm text-muted hover:text-foreground`,children:t(v.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function $({className:e}){return(0,H.jsx)(`div`,{className:_(`animate-pulse rounded bg-surface-raised`,e)})}function rt(){return(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,H.jsx)($,{className:`h-5 w-40`}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)($,{className:`h-6 w-48`}),(0,H.jsx)($,{className:`h-6 w-16 rounded-full`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)($,{className:`h-6 w-11 rounded-full`}),(0,H.jsx)($,{className:`h-8 w-8`})]})]}),(0,H.jsx)($,{className:`h-5 w-96`}),(0,H.jsx)($,{className:`h-36 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-72 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-32 w-full rounded-2xl`}),(0,H.jsx)($,{className:`h-40 w-full rounded-2xl`})]})}function it(){let{t:e}=a(`openhands`);return(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,H.jsx)(I,{className:`size-12 text-muted`}),(0,H.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(v.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,H.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(v.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,H.jsx)(`div`,{className:`mt-6`,children:(0,H.jsx)(U,{})})]})}var at=i(function(){let{t:e}=a(`openhands`),{automationId:t}=r(),{navigate:n}=E(),[i,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),{data:d,isLoading:f,refetch:m}=se(),h=d?.status===`ok`,_=p(),y=(0,V.useRef)(_.backend.id).current!==_.backend.id,{data:b,isLoading:w,isError:T,error:D,refetch:O}=ne({id:t??``,enabled:h&&!y}),{trackPrebuiltAutomationEnabled:k,trackAutomationExported:A}=S(),ee=ae(),j=ie(),M=te(),N=T&&C(D)===404;if(f)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(rt,{})})});if(!h)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(fe,{onRetry:m})})});if(w)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(rt,{})})});if(N)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(it,{})})});if(T||!b)return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsx)(he,{onRetry:()=>O()})})});let P=()=>{let e=!b.enabled;ee.mutate({id:b.id,enabled:e}),e&&k({automationId:b.id,automationName:b.name})},F=()=>{j.mutate(b.id,{onSuccess:()=>{n?.(`/automations`)}})},I=()=>{M.mutate(b.id,{onSuccess:()=>{u(e(v.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{l(re(t,e(v.AUTOMATIONS$RUN_NOW_ERROR)))}})},L=()=>{let e=`${JSON.stringify(me(b),null,2)}\n`;g(new Blob([e],{type:`application/json`}),ge(b)),A({backendKind:_.backend.kind})},R=_.backend.kind===`local`;return(0,H.jsx)(`div`,{className:`min-h-full`,children:(0,H.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(U,{}),(0,H.jsx)(ye,{automation:b,onToggle:P,onEdit:R?()=>c(!0):void 0,onDelete:()=>o(!0),onExport:L,onDownloadTarball:()=>x.downloadTarball(b.id,b.name),onRunNow:I,isRunningNow:M.isPending}),b.prompt&&(0,H.jsx)(Se,{prompt:b.prompt}),(0,H.jsx)(Oe,{automation:b}),b.plugins&&b.plugins.length>0&&(0,H.jsx)(je,{plugins:b.plugins}),(0,H.jsx)(Ne,{createdAt:b.created_at,lastRunAt:b.last_triggered_at}),(0,H.jsx)(nt,{automation:b}),(0,H.jsx)(oe,{automationName:b.name,isOpen:i,onConfirm:F,onCancel:()=>o(!1)}),R&&(0,H.jsx)(ue,{automation:b,isOpen:s,onClose:()=>c(!1)})]})})})});export{at as default};