@openhands/agent-canvas 1.18.0 → 1.19.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 (331) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-BQ4o4vqy.js +1 -0
  4. package/build/assets/{active-backend-context-BnH4-L8h.js → active-backend-context-BsLfwrXB.js} +1 -1
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-D9i6ezoJ.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-U-9YzDFU.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-D-bUV2PX.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BaVQ6NpE.js +88 -0
  9. package/build/assets/agent-settings-BZJHtaIK.js +2 -0
  10. package/build/assets/agent-settings-D4snDd6u.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-BkVt_8Or.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-fAIld-n7.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DITbrM2u.js} +1 -1
  14. package/build/assets/automation-detail-DawHmaOl.js +3 -0
  15. package/build/assets/automation-disabled-reason-DtgC8Ppt.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-Kv6e0bHx.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-Dd98G_Oz.js} +1 -1
  18. package/build/assets/{automation-setup-route-qaJ6lLCf.js → automation-setup-route-Cdc109ZD.js} +1 -1
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-Xhr-FDAB.js} +1 -1
  20. package/build/assets/automations-list-BeP1LuzQ.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-DWNiN277.js} +1 -1
  22. package/build/assets/backend-form-modal-DeaUJIik.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-Br85iWIY.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-Cdnei7Ly.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-Ds7grR67.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-mQq2Ld1I.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-Bfum8fkE.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-CmYT4j_r.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-CokKSVRG.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-BoQEYG-2.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-Du2M5iEX.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-DM3JgMc2.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-BbYBiUwv.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-D02kgq1s.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-Dy1eWbSZ.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-mehU3Evb.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-DhQW8CXi.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-eRk6Fkx6.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-BmVt_c0I.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-lx2zk9G7.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-BOj0ENI6.js} +4 -4
  42. package/build/assets/conversation-SouWlGvs.js +1 -0
  43. package/build/assets/conversation-panel-SouWlGvs.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-C6YncQNo.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-DIhwCC2J.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-DVNXLylP.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-LP-x7nra.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-goDldkiu.js} +1 -1
  49. package/build/assets/edit-automation-modal-BJJR9wSW.js +1 -0
  50. package/build/assets/empty-state-Cd-TFe7i.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-CJdjIvMZ.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-pocrz9AL.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-Dwe78wRl.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-SuWwztxV.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-O0esK3Er.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-CgCVSXje.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-B_6t8ljw.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-lQfLxzH4.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-Bp5rsUkl.js} +1 -1
  60. package/build/assets/git-repo-dropdown-CbD0_LPN.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DPQVumZg.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-Bp0sgK-f.js} +1 -1
  63. package/build/assets/home-BghzJd-D.js +1 -0
  64. package/build/assets/home-CXZ8zawS.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-BdpCckKO.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-DNQpfIEO.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-DkxnQa4N.js} +1 -1
  68. package/build/assets/index-home-Ca6Q5CtT.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DvxxYKia.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-CwTE6XJj.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-jsRGPRBx.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/{llm-not-configured-banner-Dh_ajcM8.js → llm-not-configured-banner-DMdL1vaX.js} +4 -4
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-dkQ5Oq7W.js} +1 -1
  75. package/build/assets/llm-settings-lNDerSlu.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-BiQaZbvv.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-DK1sAwVg.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-DqCJohsX.js} +1 -1
  79. package/build/assets/manifest-ff93dc8c.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-sxuPqfUr.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-BH5pqDuJ.js} +1 -1
  82. package/build/assets/mcp-BtaJDXnP.js +1 -0
  83. package/build/assets/mcp-installed-servers-Br4ZLsjr.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-DwbnQpVs.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-DmFJlW6c.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-DBweM2EN.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-jvG85nkU.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-BrM5fNnn.js} +1 -1
  90. package/build/assets/onboarding-CQ8T6T0U.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-CnliiaSN.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-DmFUEmu5.js} +1 -1
  93. package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
  94. package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-CXph_C9F.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-CcEpfNKz.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-DdF_4Zhe.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-BWRnl31s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-DbEf3Nqr.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-r0oI91HN.js +1 -0
  100. package/build/assets/root-j2fFRlWS.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-CfGgm2lo.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-c3Ncgm4x.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DFEiuiFQ.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-WXXNFqTM.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-DU6wh3wX.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BEqbPvjy.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-DjaSQwFh.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-BRR2OZwi.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-DHv4XFcM.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-Cm4VxUon.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-CaUfKZ33.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-djXuAnBO.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-DFb3hBMr.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-Q9lKW1TX.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-seaSJc7t.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-x3rxVCon.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-B6mcvvdV.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-CEqS8KnA.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-BTHX11LG.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-BP1kzn6p.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-TD39nfP3.js} +1 -1
  123. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-CdBbbwjm.js} +1 -1
  124. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-vUEp7gsC.js} +1 -1
  125. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-BTRBQt0-.js} +1 -1
  126. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-k1tUNAw4.js} +1 -1
  127. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-CENviPT7.js} +1 -1
  128. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-DVAlWYnL.js} +1 -1
  129. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-BLKF_x9f.js} +1 -1
  130. package/build/assets/{terminal-Dph60VFZ.js → terminal-Ckbnqb23.js} +1 -1
  131. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-DeiG9Mf6.js} +1 -1
  132. package/build/assets/trash-CXN2R54L.js +1 -0
  133. package/build/assets/{typography-DgcLGdHk.js → typography-NarNyelM.js} +1 -1
  134. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-Drd3O006.js} +1 -1
  135. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-CJ5wPsQm.js} +1 -1
  136. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-iQZ0U3qV.js} +1 -1
  137. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-LCvb5OXT.js} +1 -1
  138. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-DdgSa8sA.js} +1 -1
  139. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-D3kEeieu.js} +1 -1
  140. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-CEubcYTD.js} +1 -1
  141. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-CB8ybxFK.js} +1 -1
  142. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BMacwi2v.js} +1 -1
  143. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-BEKRd6XZ.js} +1 -1
  144. package/build/assets/{use-config-l5tkDHyD.js → use-config-3WYcJsgC.js} +1 -1
  145. package/build/assets/{use-create-conversation-i_PdFdIs.js → use-create-conversation-Be-eVpFp.js} +1 -1
  146. package/build/assets/use-create-secret-Bk9ZxTjl.js +1 -0
  147. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-Ci3FkKEm.js} +1 -1
  148. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-fqS0kxt6.js} +1 -1
  149. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-B71ZEVg2.js} +1 -1
  150. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-xtCBMbef.js} +1 -1
  151. package/build/assets/{use-manifest-capabilities-CdqYfUAC.js → use-manifest-capabilities-Bso6A_-A.js} +1 -1
  152. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-CEgjL02y.js} +1 -1
  153. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-pK4IlJ-p.js} +1 -1
  154. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-B8-ZEB34.js} +1 -1
  155. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-D7hJuW_u.js} +1 -1
  156. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CikTu5xV.js} +1 -1
  157. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-BWIH5EuN.js} +1 -1
  158. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-DSKwLDnd.js} +1 -1
  159. package/build/assets/use-tracking-ChnSFChv.js +3 -0
  160. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-C_l65DqW.js} +1 -1
  161. package/build/assets/utils-D-gOfhmN.js +1 -0
  162. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +2 -0
  163. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js +48 -0
  164. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-PKtoIUUY.js} +1 -1
  165. package/build/index.html +4 -4
  166. package/build/locales/ar/openhands.json +10 -0
  167. package/build/locales/ca/openhands.json +10 -0
  168. package/build/locales/de/openhands.json +10 -0
  169. package/build/locales/en/openhands.json +10 -0
  170. package/build/locales/es/openhands.json +10 -0
  171. package/build/locales/fr/openhands.json +10 -0
  172. package/build/locales/it/openhands.json +10 -0
  173. package/build/locales/ja/openhands.json +10 -0
  174. package/build/locales/ko-KR/openhands.json +10 -0
  175. package/build/locales/no/openhands.json +10 -0
  176. package/build/locales/pt/openhands.json +10 -0
  177. package/build/locales/tr/openhands.json +10 -0
  178. package/build/locales/uk/openhands.json +10 -0
  179. package/build/locales/zh-CN/openhands.json +10 -0
  180. package/build/locales/zh-TW/openhands.json +10 -0
  181. package/config/defaults.json +3 -3
  182. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  183. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  184. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  185. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  186. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  187. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  188. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  189. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  190. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  191. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  192. package/dist/config/defaults.cjs +1 -1
  193. package/dist/config/defaults.cjs.map +1 -1
  194. package/dist/config/defaults.js +3 -3
  195. package/dist/config/defaults.js.map +1 -1
  196. package/dist/constants/acp-providers.cjs +1 -1
  197. package/dist/constants/acp-providers.cjs.map +1 -1
  198. package/dist/constants/acp-providers.d.ts +0 -5
  199. package/dist/constants/acp-providers.js +20 -16
  200. package/dist/constants/acp-providers.js.map +1 -1
  201. package/dist/constants/profile-scope.d.ts +21 -0
  202. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  203. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  204. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  205. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  206. package/dist/hooks/use-drag-resize.cjs +1 -1
  207. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  208. package/dist/hooks/use-drag-resize.js +8 -9
  209. package/dist/hooks/use-drag-resize.js.map +1 -1
  210. package/dist/i18n/declaration.cjs +1 -1
  211. package/dist/i18n/declaration.cjs.map +1 -1
  212. package/dist/i18n/declaration.d.ts +10 -0
  213. package/dist/i18n/declaration.js +1 -1
  214. package/dist/i18n/declaration.js.map +1 -1
  215. package/dist/i18n/translation.cjs +2 -2
  216. package/dist/i18n/translation.cjs.map +1 -1
  217. package/dist/i18n/translation.js +170 -0
  218. package/dist/i18n/translation.js.map +1 -1
  219. package/dist/locales/ar/openhands.json +10 -0
  220. package/dist/locales/ca/openhands.json +10 -0
  221. package/dist/locales/de/openhands.json +10 -0
  222. package/dist/locales/en/openhands.json +10 -0
  223. package/dist/locales/es/openhands.json +10 -0
  224. package/dist/locales/fr/openhands.json +10 -0
  225. package/dist/locales/it/openhands.json +10 -0
  226. package/dist/locales/ja/openhands.json +10 -0
  227. package/dist/locales/ko-KR/openhands.json +10 -0
  228. package/dist/locales/no/openhands.json +10 -0
  229. package/dist/locales/pt/openhands.json +10 -0
  230. package/dist/locales/tr/openhands.json +10 -0
  231. package/dist/locales/uk/openhands.json +10 -0
  232. package/dist/locales/zh-CN/openhands.json +10 -0
  233. package/dist/locales/zh-TW/openhands.json +10 -0
  234. package/dist/manifests/manifest-validation.cjs +1 -1
  235. package/dist/manifests/manifest-validation.cjs.map +1 -1
  236. package/dist/manifests/manifest-validation.js +2 -2
  237. package/dist/manifests/manifest-validation.js.map +1 -1
  238. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  239. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  240. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  241. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  242. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  243. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  244. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  245. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  246. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  247. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  248. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  249. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  250. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +1 -1
  251. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +1 -1
  252. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +3 -6
  253. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +1 -1
  254. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  255. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  256. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  257. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  258. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  259. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  260. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  261. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  262. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  263. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  264. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  265. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  266. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  267. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -1
  268. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  269. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  270. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  271. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  272. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  273. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  274. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  275. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  276. package/dist/package.cjs +1 -1
  277. package/dist/package.cjs.map +1 -1
  278. package/dist/package.js +2 -2
  279. package/dist/package.js.map +1 -1
  280. package/dist/routes/agent-settings.d.ts +5 -0
  281. package/dist/types/automation.cjs.map +1 -1
  282. package/dist/types/automation.d.ts +23 -1
  283. package/dist/types/automation.js.map +1 -1
  284. package/dist/utils/automation-disabled-reason.cjs +2 -0
  285. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  286. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  287. package/dist/utils/automation-disabled-reason.js +19 -0
  288. package/dist/utils/automation-disabled-reason.js.map +1 -0
  289. package/dist/utils/parse-git-remote-url.cjs +1 -1
  290. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  291. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  292. package/dist/utils/parse-git-remote-url.js +20 -13
  293. package/dist/utils/parse-git-remote-url.js.map +1 -1
  294. package/package.json +2 -2
  295. package/scripts/check-sdk-version-sync.mjs +79 -8
  296. package/scripts/dev-safe.mjs +1 -1
  297. package/scripts/static-server.mjs +24 -7
  298. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  299. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  300. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  301. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  302. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  303. package/build/assets/automations-list-DEPVNud3.js +0 -1
  304. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  305. package/build/assets/conversation-edjzrv5w.js +0 -1
  306. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  307. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  308. package/build/assets/empty-state-FK_s1B60.js +0 -1
  309. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  310. package/build/assets/home-BM5_Wz_R.js +0 -1
  311. package/build/assets/home-Ivfm7KC4.js +0 -1
  312. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  313. package/build/assets/index-home-td9BN2T3.js +0 -1
  314. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  315. package/build/assets/link-external-BNZzCM1I.js +0 -1
  316. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  317. package/build/assets/manifest-bfeccb98.js +0 -1
  318. package/build/assets/mcp-CraxoXQv.js +0 -1
  319. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  320. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  321. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  322. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  323. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  324. package/build/assets/root-CM6IZHlg.css +0 -1
  325. package/build/assets/root-DdFkodKW.js +0 -2
  326. package/build/assets/trash-Ckh7yCaB.js +0 -1
  327. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  328. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  329. package/build/assets/utils-BgLSZdyy.js +0 -1
  330. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  331. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
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.18.0 # x-release-please-version
99
+ ghcr.io/openhands/agent-canvas:1.19.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.18.0 # x-release-please-version
15
+ docker pull ghcr.io/openhands/agent-canvas:1.19.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.18.0 # x-release-please-version
24
+ ghcr.io/openhands/agent-canvas:1.19.0 # x-release-please-version
25
25
  ```
26
26
 
27
27
  Open [http://localhost:8000/canvas](http://localhost:8000/canvas) in your browser.
@@ -0,0 +1 @@
1
+ import{K as e}from"./utils-D-gOfhmN.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.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}};function o(e){return t(e)?.available_models?.map(e=>({id:e.id,label:e.label}))}var s=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:o(e),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`,l={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}]},u={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function d(e,t){return e?(u[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var f=`gemini-2.5-pro`;function p(e){return e===`gemini-cli`?f:h(e)?.default_model??null}function m(n){if(!n||!h(n))return[];let r=t(n);if(!r)return[];let i=[...l[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 h(e){if(e)return s.find(t=>t.key===e)}function g(e){let t=h(e);return t?t.display_name:null}function _(e){return h(e)?.icon??`cli-generic`}function v(e,t){return t?h(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function y(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:h(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?p(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{d as a,g as c,_ as d,i as f,y as i,m as l,s as n,p as o,n as r,h as s,c as t,v as u};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor~module-DyG7x7JT.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-Ck5D_A2Q.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{a,f as o,m as s,n as c,o as ee,p as te,r as ne,s as re,u as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{K as l,W as ae,t as oe}from"./utils-BgLSZdyy.js";import{A as se,D as ce,O as le,T as ue,b as de,c as fe,d as u,f as d,g as pe,h as me,l as he,m as ge,n as _e,p as ve,s as ye,u as be,w as xe,x as Se}from"./agent-server-client-options-EHB23gyx.js";import{f as Ce,l as we}from"./agent-server-config-C_x8Otd9.js";import{f as Te,x as Ee}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";var f=e(t(),1),De=`__AGENT_CANVAS_BASE_PATH__`;function Oe(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function ke(){let e=Oe(void 0);if(e)return e;if(typeof window<`u`){let e=window[De];if(typeof e==`string`)return Oe(e)}return``}function Ae(e){let t=ke();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var p=`openhands`,je=[{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,Ne=e=>{if(!Me.has(e)){let t=e.use(ee).use(a).use(i).init({fallbackLng:`en`,debug:!1,supportedLngs:je.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[p],defaultNS:p,fallbackNS:p,backend:{loadPath:Ae(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});Me.set(e,t)}return e},Pe=()=>Ne(ie()),Fe=null,m=null,h=()=>(Fe||=Pe(),Fe),Ie=()=>m??h(),Le=e=>(m=e??h(),m),Re=async(e=h())=>(await Me.get(e),e),ze=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:p,...e}:e:{ns:p},g=new Proxy({},{get:(e,t)=>{let n=Ie();if(t===`t`)return(e,t)=>n.t(e,ze(t));if(t===`exists`)return(e,t)=>n.exists(e,ze(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=Ie();return Reflect.set(r,t,n,r)}}),Be=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,Ve=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`;function He(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var _=e=>{let t=null,n=!1;return He(e)?(n=!0,t=Be(e)&&e.response?.data.error?e.response?.data.error:Ve(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,ce(n?t??e:e)??t??``},v=(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)},y=r(),Ue={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`},b={position:`top-right`,style:Ue},We={...Ue,color:`var(--oh-muted)`};function Ge({message:e}){let t=f.useRef(null),[n,r]=f.useState(!1);return f.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,y.jsxs)(`div`,{className:oe(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,y.jsx)(ne,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:ae}}),(0,y.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var Ke={...b,icon:null,style:We},qe=e=>{let t=e||g.t(l.STATUS$ERROR);se(t)?t=g.t(l.ERROR$CORS_OR_NETWORK):le(t)&&(t=g.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=v(t,4e3);c((0,y.jsx)(Ge,{message:t}),{...Ke,duration:n})},Je=e=>{let t=v(e,5e3);c.success((0,y.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...b,duration:t})},Ye=(e,t,n)=>{let r=v(`${e} ${t}`,5e3);c.success((0,y.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,y.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{...b,duration:r})},Xe=e=>{let t=v(e,6e3);c((0,y.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...b,icon:`⚠️`,duration:t})},Ze=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},Qe=e=>{if(!(e instanceof re)||e.response?.status!==401&&e.status!==401)return!1;let t=fe().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},$e=new Set,et=()=>{let e=new o({queryCache:new te({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&xe(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||Ze(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!Qe(t)){let e=_(t);$e.has(e||``)||(qe(e||g.t(l.ERROR$GENERIC)),$e.add(e||``),setTimeout(()=>{$e.delete(e||``)},3e3))}}}),mutationCache:new s({onError:(t,n,r,i)=>{Ze(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!Qe(t)&&qe(_(t)||g.t(l.ERROR$GENERIC))}})});return e},tt=null,nt=null,rt=()=>(tt||=et(),tt),x=()=>nt??rt(),it=e=>(nt=e??rt(),nt),at=new Proxy({},{get:(e,t)=>{let n=x(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=x();return Reflect.set(r,t,n,r)}}),ot={_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.46.0`,agentCanvas:`1.18.0`,automation:`1.11.1`},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,_vscodeComment:`Port the bundled editor binds to inside the container; agent-server's own default. Only the Docker entrypoint reads this — the npm launchers derive the editor port from the agent-server port so several stacks can run side by side. It is never published: the editor is reached through paths.vscodeBasePath on the proxy port.`,vscode:8001},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`,_vscodeBasePathComment:`Path prefix the bundled editor is served under, on the same origin as the canvas. Passed to agent-server as OH_VSCODE_BASE_PATH (it launches openvscode-server with --server-base-path and advertises the prefix in /api/vscode/url), and registered as an ingress route to the VSCode port. Keeping one value on both sides is what lets a single-origin deployment reach the editor without publishing a second port. Tradeoff: a path prefix routes but does not isolate, so the editor shares the canvas's browser origin and therefore its localStorage — see docs/SELF_HOSTING.md and OpenHands/OpenHands#16492.`,vscodeBasePath:`/vscode`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},st=5e3,ct=`unknown`,S=ot.compatibility.minimumAgentServer,lt=`AGENT_SERVER_UNSUPPORTED_VERSION`,ut=`AGENT_SERVER_UNKNOWN_VERSION`,dt=`Invalid API key`,C=null,w=null,ft=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,T=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}},pt=e=>e instanceof T||typeof e==`object`&&!!e&&`name`in e&&(e.name===`AgentServerUnavailableError`||e.name===`AgentServerUnsupportedVersionError`||e.name===`AgentServerUnknownVersionError`),mt=class extends T{code=lt;actualVersion;requiredVersion=S;constructor(e){let t=`Agent Canvas requires agent-server ${S} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},ht=class extends T{code=ut;actualVersion;requiredVersion=S;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${S} 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}},gt=e=>Ce()&&D(e,401);function E(){C=null,w=null}function _t(e){return e?.host&&e.host!==w?null:C}function vt(e){let t=ft(C);return Array.isArray(t)?t.includes(e):!0}function yt(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function D(e,t){return yt(e)&&e.status===t}function bt(e){return typeof e==`string`&&e.trim()||null}function xt(e){return bt(e.sdk_version)}function St(e){return bt(e.version)??xt(e)}function Ct(e){let t=St(e);return!t||t.toLowerCase()===ct?null:t}function O(e){let t=Ct(e);return!t||!k(t)?null:t}function wt(e){return!C||e&&be()?.host!==e?null:O(C)}function Tt(e,t){let n=k(e),r=k(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 k(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 Et(e){let t=Ct(e);if(!t)throw E(),new ht(St(e));let n=Tt(t,S);if(n===null)throw E(),new ht(t);if(n<0)throw E(),new mt(t)}async function Dt(e,t){let n=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:t});try{await new Te(n).getSettings();let e=await new Ee(n).getServerInfo();return Et(e),O(e)}catch(e){throw D(e,401)?Error(dt):e}}async function Ot(){let e=be();if(!e){if(E(),ve(fe().backend))throw new T(`No backend configured`,{noBackendConfigured:!0});return null}let t=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:st}),n;try{n=await new Ee(t).getServerInfo()}catch(e){throw E(),D(e,401)?e:new T(e instanceof Error?e.message:null)}if(Et(n),Ce())try{await new Te(t).getSettings()}catch(e){if(D(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return C=n,w=t.host,n}var kt={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},At={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},jt={all:[`llm-profiles`]},Mt={all:[`agent-profiles`]},Nt={all:[`provider-connections`]},Pt={retry:!1},Ft={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},It={all:[`local-workspaces`]},Lt={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},Rt={all:[`canvas-extensions`],installed:(e,t,n)=>[`canvas-extensions`,`installed`,e,t,n]},zt={capabilities:()=>[`setup-capabilities`]},Bt={latestVersion:[`agent-canvas-latest-version`]},Vt={subConversations:[`v1`,`sub-conversations`]},Ht={create:[`create-local-planning-conversation`]},Ut={staleTime:1e3*60*5,gcTime:1e3*60*15},A={name:`@openhands/agent-canvas`,version:`1.18.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:`>=24`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.25`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.20.0`,"@openhands/typescript-client":`1.39.0`,"@react-router/node":`7.18.2`,"@react-router/serve":`7.18.2`,"@tailwindcss/vite":`4.3.3`,"@tanstack/react-query":`5.101.4`,"@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.3.6`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.1`,isbot:`5.1.39`,"lucide-react":`1.25.0`,"monaco-editor":`0.56.0`,"posthog-js":`1.380.0`,react:`19.2.8`,"react-dom":`19.2.8`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.11`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.18.2`,"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.6.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.14`},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}`,postinstall:`node -e "if (process.env.npm_config_global === 'true') { console.log('\\n\\x1b[32m\\x1b[1m\\u2713 @openhands/agent-canvas installed!\\x1b[0m\\n\\nTo start Agent Canvas, run:\\n\\n \\x1b[36m\\x1b[1magent-canvas\\x1b[0m\\n\\nThis launches the full stack at \\x1b[36mhttp://localhost:8000\\x1b[0m.\\n\\nDocs: https://docs.openhands.dev/openhands/usage/agent-canvas/setup\\n') }"`,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`,predesktop:`node scripts/brand-dev-electron.mjs`,desktop:`npm run build:app && electron electron`,"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`,"generate-icons":`node scripts/generate-icons.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.6`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.62.1`,"@react-router/dev":`7.18.2`,"@stryker-mutator/core":`9.6.1`,"@stryker-mutator/vitest-runner":`9.6.1`,"@tailwindcss/typography":`0.5.20`,"@tanstack/eslint-plugin-query":`5.101.4`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`7.0.0`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`26.1.2`,"@types/react":`19.2.18`,"@types/react-dom":`19.2.4`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.65.0`,"@typescript-eslint/parser":`8.65.0`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.10`,"cross-env":`10.1.0`,electron:`42.3.3`,"electron-builder":`26.15.3`,eslint:`9.39.5`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.5`,"eslint-plugin-i18next":`6.1.5`,"eslint-plugin-import-x":`4.17.1`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.6`,"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:`30.0.1`,"lint-staged":`17.3.0`,msw:`2.15.0`,png2icons:`2.0.1`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.3.3`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.10`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.14`,"typed-rest-client":{qs:`6.15.3`}},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.8`,"react-dom":`19.2.8`,"react-router":`7.18.2`}},j=`agent_canvas`,M=A.version,Wt=`X-OpenHands-Client`,Gt=`X-OpenHands-Client-Version`,Kt=`X-OpenHands-Telemetry-Distinct-Id`,qt={[Wt]:j,[Gt]:M};function Jt(e){return e?.trim()||`unknown`}function N(e){return e?.trim()||null}function P({backendKind:e,agentServerVersion:t,automationSdkVersion:n,backendVersion:r,connectionMethod:i}){let a=Jt(t??r),o=Jt(n),s=Jt(r??t);return{backend_kind:e??null,agent_server_version:a,automation_sdk_version:o,backend_version:s,...i?{connection_method:i}:{}}}function Yt(e=null){return{cloud_user_id:N(e?.userId),cloud_user_email:N(e?.email),cloud_org_id:N(e?.orgId)}}var F=`openhands-telemetry-consent`,I=`openhands-telemetry-consent-pending-cloud-sync`,L=`openhands-telemetry-consent-pending-local-revocation`,Xt=`openhands-telemetry-consent-change`,Zt=`openhands-telemetry-first-use`,Qt=`openhands-telemetry-session`,$t=`agent-canvas`,en=`history_change`,tn=`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,nn=`https://z.openhands.dev`,rn=`https://us.posthog.com`,R=null,z=null,an,B={},V=!1;function on(){return typeof window<`u`&&window.__AGENT_CANVAS_DO_NOT_TRACK__===!0}function sn(){return V||on()}var H,U=0,W=-1,cn=Object.freeze({client_source:j,client_version:M,package_name:A.name,package_version:A.version}),ln=P({}),un=Yt();function dn(e){ln=P(e)}function G(e){un=Yt(e)}function fn(e){return e?{...e,properties:{...ln,...un,...e.properties,...cn}}:null}function pn(e){V||X()!==`granted`?e.opt_out_capturing():e.opt_in_capturing()}function mn(e,t=!1){e.reset(t),W=-1,pn(e)}function K(e){if(H===void 0||!$())return;let t=H?.distinctId,n=e.get_property(`$user_id`);if(n!=null&&n!==t&&mn(e),H===null){W=U;return}(e.get_property(`$user_id`)!==H.distinctId||W!==U)&&(e.identify(H.distinctId,H.properties),W=U)}function hn(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function gn(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&&(pn(R),K(R)),Z())}function _n(){return sn()?null:{apiKey:B.apiKey||tn,apiHost:B.apiHost||nn,uiHost:B.uiHost||rn}}function q(){return typeof window<`u`&&typeof localStorage<`u`}async function vn(){if(!q())return null;if(R)return R;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~module-DyG7x7JT.js`).then(e=>e.t);return{default:e}},__vite__mapDeps([0,1]));return e}catch{return null}}function J(){return!!(V||on()||typeof process<`u`&&{}.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`))}function yn(e){R||(an=e)}async function Y(e=!1){if(R)return R;if(z)return z;z=(async()=>{let t=_n();if(!t)return null;let n=await vn();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:$t,consent_persistence_name:`${$t}-consent`,person_profiles:`always`,capture_pageview:en,autocapture:!0,disable_session_recording:!0,bootstrap:an,before_send:fn},$t);return r?(R=r,an=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(we()===`cookie`)return`granted`;try{let e=localStorage.getItem(F);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}function bn(){if(!q())return null;try{let e=localStorage.getItem(I);return e===`granted`||e===`denied`?e:null}catch{return null}}function xn(){if(!q())return null;try{return localStorage.getItem(L)}catch{return null}}function Sn(e){if(!q())return()=>{};let t=t=>{(t.key===F||t.key===I)&&e()};return window.addEventListener(Xt,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(Xt,e),window.removeEventListener(`storage`,t)}}function Z(){q()&&window.dispatchEvent(new Event(Xt))}function Cn(e){if(q())try{localStorage.setItem(I,e)}catch{}}function wn(e){if(!(!q()||!e))try{localStorage.setItem(L,e)}catch{}}function Tn(e){if(q())try{if(localStorage.getItem(L)!==e)return;localStorage.removeItem(L)}catch{}}function En(e){if(q())try{if(e!==void 0&&localStorage.getItem(I)!==e)return;localStorage.removeItem(I),Z()}catch{}}async function Dn(e,{syncToCloud:t=!0}={}){if(q())try{let t=X()===e;if(localStorage.setItem(F,e),sn()||t)return;let n=R??await Y();if(!n)return;e===`granted`?(n.opt_in_capturing(),K(n)):(wn(n.get_distinct_id?.()??null),n.get_property?.(`$user_id`)==null?n.opt_out_capturing():mn(n))}catch{}finally{t&&Cn(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&&hn(H.properties,t)||(H=n,U+=1,W=-1,!$()))return;let r=R??await Y();r&&$()&&K(r)}function $(){return X()===`granted`}function On(){if(!q())return!1;try{return localStorage.getItem(Zt)===`true`}catch{return!1}}function kn(){if(q())try{localStorage.setItem(Zt,`true`)}catch{}}async function An(){if(J()||On())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}),kn(),X()!==`granted`&&e.opt_out_capturing())}function jn(){if(!q())return!1;try{return sessionStorage.getItem(Qt)===`true`}catch{return!1}}function Mn(){if(q())try{sessionStorage.setItem(Qt,`true`)}catch{}}async function Nn(){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 Pn(){if(jn())return;let e=await Nn();e&&(e.capture(`canvas_new_session`,{is_first_use:!On()}),Mn())}async function Fn(){return(await Nn())?.get_distinct_id?.()??null}async function In(){if(!q())return null;if(X()!==`granted`){let e=xn();if(e)return e}return V||J()?null:(await Y())?.get_distinct_id?.()??null}async function Ln(e,t={}){let n=await Nn();n&&n.capture(e,t)}async function Rn(){if(q()){try{wn(R?.get_distinct_id?.()??null),localStorage.removeItem(F),localStorage.removeItem(Zt)}catch{}En();try{sessionStorage.removeItem(Qt)}catch{}ln=P({}),un=Yt(),H=null,U+=1,W=-1;try{R&&mn(R,!0)}catch{try{R?.opt_out_capturing()}catch{}}finally{Z()}}}var zn=f.createContext(null);function Bn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Vn(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 Hn({children:e}){let t=f.useSyncExternalStore(pe,d,d),n=f.useCallback(()=>{E(),at.invalidateQueries({queryKey:kt.WEB_CLIENT_CONFIG})},[]),r=f.useCallback((e,t)=>{let r=d(),i=he()?.backendId??null,a=he()?.orgId??null,o=t??null;if(e===i&&o===a)return;let s=u(),c=s.find(t=>t.id===e),ee={backend:c??s[0]??ye,orgId:c?o:null};Vn(r.active,ee),ge({backendId:e,orgId:o}),n()},[n]),i=f.useCallback(e=>{let t=d().active,r={...e,id:Bn()},i=[...u(),r];return Vn(t,{backend:r,orgId:null}),me(i),ge({backendId:r.id}),n(),r},[n]),a=f.useCallback((e,t)=>{let r=u().find(t=>t.id===e),i=d().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;me(u().map(n=>n.id===e?{...n,...t,connectionRevision:a||o?(n.connectionRevision??0)+1:n.connectionRevision}:n)),(a||o)&&(ue(e),i===e&&(r?.kind===`cloud`&&(G(null),Q(null)),n()))},[n]),o=f.useCallback(e=>{let t=u().find(t=>t.id===e),r=t?.kind===`cloud`&&d().active.backend.id===t.id;me(u().filter(t=>t.id!==e)),r&&(G(null),Q(null)),Se(e),n()},[n]),s=f.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,y.jsx)(zn.Provider,{value:s,children:e})}function Un(){let e=f.useContext(zn);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function Wn(){let e=f.useContext(zn);return e?e.active:{backend:de()??ye,orgId:null}}export{D as $,Bt as A,kt as B,P as C,Kt as D,M as E,Ft as F,Tt as G,zt as H,Ht as I,O as J,_t as K,It as L,Ut as M,Vt as N,Mt as O,jt as P,yt as Q,Lt as R,Pn as S,j as T,dt as U,At as V,E as W,vt as X,gt as Y,pt as Z,Dn as _,Le as _t,Tn as a,it as at,Ln as b,gn as c,Je as ct,X as d,_ as dt,Ot as et,Fn as f,je as ft,G as g,g as gt,dn as h,Ie as ht,En as i,at as it,Rt as j,Pt as k,bn as l,Ye as lt,Y as m,h as mt,Wn as n,rt as nt,Rn as o,b as ot,In as p,p as pt,wt as q,Un as r,x as rt,yn as s,qe as st,Hn as t,Dt as tt,xn as u,Xe as ut,Q as v,Re as vt,qt as w,An as x,Sn as y,Ae as yt,Nt as z};
2
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{a,f as o,m as s,n as c,o as ee,p as te,r as ne,s as re,u as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{K as l,W as ae,t as oe}from"./utils-D-gOfhmN.js";import{A as se,D as ce,O as le,T as ue,b as de,c as fe,d as u,f as d,g as pe,h as me,l as he,m as ge,n as _e,p as ve,s as ye,u as be,w as xe,x as Se}from"./agent-server-client-options-EHB23gyx.js";import{f as Ce,l as we}from"./agent-server-config-C_x8Otd9.js";import{S as Te,f as Ee}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";var f=e(t(),1),De=`__AGENT_CANVAS_BASE_PATH__`;function Oe(e){let t=e?.trim();return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/,``)}function ke(){let e=Oe(void 0);if(e)return e;if(typeof window<`u`){let e=window[De];if(typeof e==`string`)return Oe(e)}return``}function Ae(e){let t=ke();return t?`${t}${e.startsWith(`/`)?e:`/${e}`}`:e.startsWith(`/`)?e:`/${e}`}var p=`openhands`,je=[{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,Ne=e=>{if(!Me.has(e)){let t=e.use(ee).use(a).use(i).init({fallbackLng:`en`,debug:!1,supportedLngs:je.map(e=>e.value),nonExplicitSupportedLngs:!1,ns:[p],defaultNS:p,fallbackNS:p,backend:{loadPath:Ae(`/locales/{{lng}}/{{ns}}.json`)},interpolation:{escapeValue:!1}});Me.set(e,t)}return e},Pe=()=>Ne(ie()),Fe=null,m=null,h=()=>(Fe||=Pe(),Fe),Ie=()=>m??h(),Le=e=>(m=e??h(),m),Re=async(e=h())=>(await Me.get(e),e),ze=e=>e?typeof e==`object`&&!Array.isArray(e)?{ns:p,...e}:e:{ns:p},g=new Proxy({},{get:(e,t)=>{let n=Ie();if(t===`t`)return(e,t)=>n.t(e,ze(t));if(t===`exists`)return(e,t)=>n.exists(e,ze(t));let r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=Ie();return Reflect.set(r,t,n,r)}}),Be=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`error`in e.response.data&&typeof e.response?.data?.error==`string`,Ve=e=>typeof e.response?.data==`object`&&e.response?.data!==null&&`message`in e.response.data&&typeof e.response?.data?.message==`string`;function He(e){return typeof e==`object`&&!!e&&`isAxiosError`in e&&e.isAxiosError===!0}var _=e=>{let t=null,n=!1;return He(e)?(n=!0,t=Be(e)&&e.response?.data.error?e.response?.data.error:Ve(e)&&e.response?.data.message?e.response?.data.message:e.message):t=e instanceof Error?e.message:typeof e==`string`?e:null,ce(n?t??e:e)??t??``},v=(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)},y=r(),Ue={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`},b={position:`top-right`,style:Ue},We={...Ue,color:`var(--oh-muted)`};function Ge({message:e}){let t=f.useRef(null),[n,r]=f.useState(!1);return f.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,y.jsxs)(`div`,{className:oe(`flex min-w-0 gap-2`,n?`items-start`:`items-center`),children:[(0,y.jsx)(ne,{"aria-hidden":!0,className:`h-4 w-4 shrink-0`,strokeWidth:2,style:{color:ae}}),(0,y.jsx)(`span`,{ref:t,className:`min-w-0 flex-1 text-sm leading-5 [word-break:break-word] [overflow-wrap:anywhere]`,children:e})]})}var Ke={...b,icon:null,style:We},qe=e=>{let t=e||g.t(l.STATUS$ERROR);se(t)?t=g.t(l.ERROR$CORS_OR_NETWORK):le(t)&&(t=g.t(l.ERROR$BACKEND_REQUEST_TIMEOUT));let n=v(t,4e3);c((0,y.jsx)(Ge,{message:t}),{...Ke,duration:n})},Je=e=>{let t=v(e,5e3);c.success((0,y.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...b,duration:t})},Ye=(e,t,n)=>{let r=v(`${e} ${t}`,5e3);c.success((0,y.jsxs)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:[e,` `,(0,y.jsx)(`a`,{className:`underline hover:no-underline`,href:n,children:t})]}),{...b,duration:r})},Xe=e=>{let t=v(e,6e3);c((0,y.jsx)(`span`,{className:`[word-break:break-word] [overflow-wrap:anywhere]`,children:e}),{...b,icon:`⚠️`,duration:t})},Ze=(e,t)=>{(e?.response?.status===401||e?.status===401)&&t.invalidateQueries({queryKey:[`user`,`authenticated`]})},Qe=e=>{if(!(e instanceof re)||e.response?.status!==401&&e.status!==401)return!1;let t=fe().backend;if(t.kind!==`cloud`)return!1;let n=e.config?.url;return!n||n.startsWith(t.host.replace(/\/+$/,``))},$e=new Set,et=()=>{let e=new o({queryCache:new te({onSuccess:(e,t)=>{let n=t.meta?.backendId??t.options.meta?.backendId;typeof n==`string`&&xe(n)},onError:(t,n)=>{if(n.queryKey[0]===`user`&&n.queryKey[1]===`authenticated`||Ze(t,e),!(n.meta?.disableToast??n.options.meta?.disableToast)&&!Qe(t)){let e=_(t);$e.has(e||``)||(qe(e||g.t(l.ERROR$GENERIC)),$e.add(e||``),setTimeout(()=>{$e.delete(e||``)},3e3))}}}),mutationCache:new s({onError:(t,n,r,i)=>{Ze(t,e),!(i?.meta?.disableToast??i?.options.meta?.disableToast)&&!Qe(t)&&qe(_(t)||g.t(l.ERROR$GENERIC))}})});return e},tt=null,nt=null,rt=()=>(tt||=et(),tt),x=()=>nt??rt(),it=e=>(nt=e??rt(),nt),at=new Proxy({},{get:(e,t)=>{let n=x(),r=Reflect.get(n,t,n);return typeof r==`function`?r.bind(n):r},set:(e,t,n)=>{let r=x();return Reflect.set(r,t,n,r)}}),ot={_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.48.0`,agentCanvas:`1.19.0`,automation:`1.12.1`},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,_vscodeComment:`Port the bundled editor binds to inside the container; agent-server's own default. Only the Docker entrypoint reads this — the npm launchers derive the editor port from the agent-server port so several stacks can run side by side. It is never published: the editor is reached through paths.vscodeBasePath on the proxy port.`,vscode:8001},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`,_vscodeBasePathComment:`Path prefix the bundled editor is served under, on the same origin as the canvas. Passed to agent-server as OH_VSCODE_BASE_PATH (it launches openvscode-server with --server-base-path and advertises the prefix in /api/vscode/url), and registered as an ingress route to the VSCode port. Keeping one value on both sides is what lets a single-origin deployment reach the editor without publishing a second port. Tradeoff: a path prefix routes but does not isolate, so the editor shares the canvas's browser origin and therefore its localStorage — see docs/SELF_HOSTING.md and OpenHands/OpenHands#16492.`,vscodeBasePath:`/vscode`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},st=5e3,ct=`unknown`,S=ot.compatibility.minimumAgentServer,lt=`AGENT_SERVER_UNSUPPORTED_VERSION`,ut=`AGENT_SERVER_UNKNOWN_VERSION`,dt=`Invalid API key`,C=null,w=null,ft=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,T=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}},pt=e=>e instanceof T||typeof e==`object`&&!!e&&`name`in e&&(e.name===`AgentServerUnavailableError`||e.name===`AgentServerUnsupportedVersionError`||e.name===`AgentServerUnknownVersionError`),mt=class extends T{code=lt;actualVersion;requiredVersion=S;constructor(e){let t=`Agent Canvas requires agent-server ${S} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},ht=class extends T{code=ut;actualVersion;requiredVersion=S;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${S} 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}},gt=e=>Ce()&&D(e,401);function E(){C=null,w=null}function _t(e){return e?.host&&e.host!==w?null:C}function vt(e){let t=ft(C);return Array.isArray(t)?t.includes(e):!0}function yt(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function D(e,t){return yt(e)&&e.status===t}function bt(e){return typeof e==`string`&&e.trim()||null}function xt(e){return bt(e.sdk_version)}function St(e){return bt(e.version)??xt(e)}function Ct(e){let t=St(e);return!t||t.toLowerCase()===ct?null:t}function O(e){let t=Ct(e);return!t||!k(t)?null:t}function wt(e){return!C||e&&be()?.host!==e?null:O(C)}function Tt(e,t){let n=k(e),r=k(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 k(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 Et(e){let t=Ct(e);if(!t)throw E(),new ht(St(e));let n=Tt(t,S);if(n===null)throw E(),new ht(t);if(n<0)throw E(),new mt(t)}async function Dt(e,t){let n=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:t});try{await new Ee(n).getSettings();let e=await new Te(n).getServerInfo();return Et(e),O(e)}catch(e){throw D(e,401)?Error(dt):e}}async function Ot(){let e=be();if(!e){if(E(),ve(fe().backend))throw new T(`No backend configured`,{noBackendConfigured:!0});return null}let t=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:st}),n;try{n=await new Te(t).getServerInfo()}catch(e){throw E(),D(e,401)?e:new T(e instanceof Error?e.message:null)}if(Et(n),Ce())try{await new Ee(t).getSettings()}catch(e){if(D(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return C=n,w=t.host,n}var kt={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},At={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},jt={all:[`llm-profiles`]},Mt={all:[`agent-profiles`]},Nt={all:[`provider-connections`]},Pt={retry:!1},Ft={all:[`llm-subscription`],openaiStatus:[`llm-subscription`,`openai`,`status`],openaiModels:[`llm-subscription`,`openai`,`models`]},It={all:[`local-workspaces`]},Lt={marketplace:[`plugins-marketplace`],installed:[`plugins-installed`],local:[`plugins-local`]},Rt={all:[`canvas-extensions`],installed:(e,t,n)=>[`canvas-extensions`,`installed`,e,t,n]},zt={capabilities:()=>[`setup-capabilities`]},Bt={latestVersion:[`agent-canvas-latest-version`]},Vt={subConversations:[`v1`,`sub-conversations`]},Ht={create:[`create-local-planning-conversation`]},Ut={staleTime:1e3*60*5,gcTime:1e3*60*15},A={name:`@openhands/agent-canvas`,version:`1.19.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:`>=24`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.25`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`0.20.0`,"@openhands/typescript-client":`1.48.0`,"@react-router/node":`7.18.2`,"@react-router/serve":`7.18.2`,"@tailwindcss/vite":`4.3.3`,"@tanstack/react-query":`5.101.4`,"@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.3.6`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.1`,isbot:`5.1.39`,"lucide-react":`1.25.0`,"monaco-editor":`0.56.0`,"posthog-js":`1.380.0`,react:`19.2.8`,"react-dom":`19.2.8`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.11`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.18.2`,"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.6.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.14`},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}`,postinstall:`node -e "if (process.env.npm_config_global === 'true') { console.log('\\n\\x1b[32m\\x1b[1m\\u2713 @openhands/agent-canvas installed!\\x1b[0m\\n\\nTo start Agent Canvas, run:\\n\\n \\x1b[36m\\x1b[1magent-canvas\\x1b[0m\\n\\nThis launches the full stack at \\x1b[36mhttp://localhost:8000\\x1b[0m.\\n\\nDocs: https://docs.openhands.dev/openhands/usage/agent-canvas/setup\\n') }"`,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`,predesktop:`node scripts/brand-dev-electron.mjs`,desktop:`npm run build:app && electron electron`,"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`,"generate-icons":`node scripts/generate-icons.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.6`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.62.1`,"@react-router/dev":`7.18.2`,"@stryker-mutator/core":`9.6.1`,"@stryker-mutator/vitest-runner":`9.6.1`,"@tailwindcss/typography":`0.5.20`,"@tanstack/eslint-plugin-query":`5.101.4`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`7.0.0`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`26.1.2`,"@types/react":`19.2.18`,"@types/react-dom":`19.2.4`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.65.0`,"@typescript-eslint/parser":`8.65.0`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.10`,"cross-env":`10.1.0`,electron:`42.3.3`,"electron-builder":`26.15.3`,eslint:`9.39.5`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.5`,"eslint-plugin-i18next":`6.1.5`,"eslint-plugin-import-x":`4.17.1`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.6`,"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:`30.0.1`,"lint-staged":`17.3.0`,msw:`2.15.0`,png2icons:`2.0.1`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.3.3`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.10`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.14`,"typed-rest-client":{qs:`6.15.3`}},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.8`,"react-dom":`19.2.8`,"react-router":`7.18.2`}},j=`agent_canvas`,M=A.version,Wt=`X-OpenHands-Client`,Gt=`X-OpenHands-Client-Version`,Kt=`X-OpenHands-Telemetry-Distinct-Id`,qt={[Wt]:j,[Gt]:M};function Jt(e){return e?.trim()||`unknown`}function N(e){return e?.trim()||null}function P({backendKind:e,agentServerVersion:t,automationSdkVersion:n,backendVersion:r,connectionMethod:i}){let a=Jt(t??r),o=Jt(n),s=Jt(r??t);return{backend_kind:e??null,agent_server_version:a,automation_sdk_version:o,backend_version:s,...i?{connection_method:i}:{}}}function Yt(e=null){return{cloud_user_id:N(e?.userId),cloud_user_email:N(e?.email),cloud_org_id:N(e?.orgId)}}var F=`openhands-telemetry-consent`,I=`openhands-telemetry-consent-pending-cloud-sync`,L=`openhands-telemetry-consent-pending-local-revocation`,Xt=`openhands-telemetry-consent-change`,Zt=`openhands-telemetry-first-use`,Qt=`openhands-telemetry-session`,$t=`agent-canvas`,en=`history_change`,tn=`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,nn=`https://z.openhands.dev`,rn=`https://us.posthog.com`,R=null,z=null,an,B={},V=!1;function on(){return typeof window<`u`&&window.__AGENT_CANVAS_DO_NOT_TRACK__===!0}function sn(){return V||on()}var H,U=0,W=-1,cn=Object.freeze({client_source:j,client_version:M,package_name:A.name,package_version:A.version}),ln=P({}),un=Yt();function dn(e){ln=P(e)}function G(e){un=Yt(e)}function fn(e){return e?{...e,properties:{...ln,...un,...e.properties,...cn}}:null}function pn(e){V||X()!==`granted`?e.opt_out_capturing():e.opt_in_capturing()}function mn(e,t=!1){e.reset(t),W=-1,pn(e)}function K(e){if(H===void 0||!$())return;let t=H?.distinctId,n=e.get_property(`$user_id`);if(n!=null&&n!==t&&mn(e),H===null){W=U;return}(e.get_property(`$user_id`)!==H.distinctId||W!==U)&&(e.identify(H.distinctId,H.properties),W=U)}function hn(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function gn(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&&(pn(R),K(R)),Z())}function _n(){return sn()?null:{apiKey:B.apiKey||tn,apiHost:B.apiHost||nn,uiHost:B.uiHost||rn}}function q(){return typeof window<`u`&&typeof localStorage<`u`}async function vn(){if(!q())return null;if(R)return R;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~module-DyG7x7JT.js`).then(e=>e.t);return{default:e}},__vite__mapDeps([0,1]));return e}catch{return null}}function J(){return!!(V||on()||typeof process<`u`&&{}.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`))}function yn(e){R||(an=e)}async function Y(e=!1){if(R)return R;if(z)return z;z=(async()=>{let t=_n();if(!t)return null;let n=await vn();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:$t,consent_persistence_name:`${$t}-consent`,person_profiles:`always`,capture_pageview:en,autocapture:!0,disable_session_recording:!0,bootstrap:an,before_send:fn},$t);return r?(R=r,an=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(we()===`cookie`)return`granted`;try{let e=localStorage.getItem(F);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}function bn(){if(!q())return null;try{let e=localStorage.getItem(I);return e===`granted`||e===`denied`?e:null}catch{return null}}function xn(){if(!q())return null;try{return localStorage.getItem(L)}catch{return null}}function Sn(e){if(!q())return()=>{};let t=t=>{(t.key===F||t.key===I)&&e()};return window.addEventListener(Xt,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(Xt,e),window.removeEventListener(`storage`,t)}}function Z(){q()&&window.dispatchEvent(new Event(Xt))}function Cn(e){if(q())try{localStorage.setItem(I,e)}catch{}}function wn(e){if(!(!q()||!e))try{localStorage.setItem(L,e)}catch{}}function Tn(e){if(q())try{if(localStorage.getItem(L)!==e)return;localStorage.removeItem(L)}catch{}}function En(e){if(q())try{if(e!==void 0&&localStorage.getItem(I)!==e)return;localStorage.removeItem(I),Z()}catch{}}async function Dn(e,{syncToCloud:t=!0}={}){if(q())try{let t=X()===e;if(localStorage.setItem(F,e),sn()||t)return;let n=R??await Y();if(!n)return;e===`granted`?(n.opt_in_capturing(),K(n)):(wn(n.get_distinct_id?.()??null),n.get_property?.(`$user_id`)==null?n.opt_out_capturing():mn(n))}catch{}finally{t&&Cn(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&&hn(H.properties,t)||(H=n,U+=1,W=-1,!$()))return;let r=R??await Y();r&&$()&&K(r)}function $(){return X()===`granted`}function On(){if(!q())return!1;try{return localStorage.getItem(Zt)===`true`}catch{return!1}}function kn(){if(q())try{localStorage.setItem(Zt,`true`)}catch{}}async function An(){if(J()||On())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}),kn(),X()!==`granted`&&e.opt_out_capturing())}function jn(){if(!q())return!1;try{return sessionStorage.getItem(Qt)===`true`}catch{return!1}}function Mn(){if(q())try{sessionStorage.setItem(Qt,`true`)}catch{}}async function Nn(){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 Pn(){if(jn())return;let e=await Nn();e&&(e.capture(`canvas_new_session`,{is_first_use:!On()}),Mn())}async function Fn(){return(await Nn())?.get_distinct_id?.()??null}async function In(){if(!q())return null;if(X()!==`granted`){let e=xn();if(e)return e}return V||J()?null:(await Y())?.get_distinct_id?.()??null}async function Ln(e,t={}){let n=await Nn();n&&n.capture(e,t)}async function Rn(){if(q()){try{wn(R?.get_distinct_id?.()??null),localStorage.removeItem(F),localStorage.removeItem(Zt)}catch{}En();try{sessionStorage.removeItem(Qt)}catch{}ln=P({}),un=Yt(),H=null,U+=1,W=-1;try{R&&mn(R,!0)}catch{try{R?.opt_out_capturing()}catch{}}finally{Z()}}}var zn=f.createContext(null);function Bn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Vn(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 Hn({children:e}){let t=f.useSyncExternalStore(pe,d,d),n=f.useCallback(()=>{E(),at.invalidateQueries({queryKey:kt.WEB_CLIENT_CONFIG})},[]),r=f.useCallback((e,t)=>{let r=d(),i=he()?.backendId??null,a=he()?.orgId??null,o=t??null;if(e===i&&o===a)return;let s=u(),c=s.find(t=>t.id===e),ee={backend:c??s[0]??ye,orgId:c?o:null};Vn(r.active,ee),ge({backendId:e,orgId:o}),n()},[n]),i=f.useCallback(e=>{let t=d().active,r={...e,id:Bn()},i=[...u(),r];return Vn(t,{backend:r,orgId:null}),me(i),ge({backendId:r.id}),n(),r},[n]),a=f.useCallback((e,t)=>{let r=u().find(t=>t.id===e),i=d().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;me(u().map(n=>n.id===e?{...n,...t,connectionRevision:a||o?(n.connectionRevision??0)+1:n.connectionRevision}:n)),(a||o)&&(ue(e),i===e&&(r?.kind===`cloud`&&(G(null),Q(null)),n()))},[n]),o=f.useCallback(e=>{let t=u().find(t=>t.id===e),r=t?.kind===`cloud`&&d().active.backend.id===t.id;me(u().filter(t=>t.id!==e)),r&&(G(null),Q(null)),Se(e),n()},[n]),s=f.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,y.jsx)(zn.Provider,{value:s,children:e})}function Un(){let e=f.useContext(zn);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function Wn(){let e=f.useContext(zn);return e?e.active:{backend:de()??ye,orgId:null}}export{D as $,Bt as A,kt as B,P as C,Kt as D,M as E,Ft as F,Tt as G,zt as H,Ht as I,O as J,_t as K,It as L,Ut as M,Vt as N,Mt as O,jt as P,yt as Q,Lt as R,Pn as S,j as T,dt as U,At as V,E as W,vt as X,gt as Y,pt as Z,Dn as _,Le as _t,Tn as a,it as at,Ln as b,gn as c,Je as ct,X as d,_ as dt,Ot as et,Fn as f,je as ft,G as g,g as gt,dn as h,Ie as ht,En as i,at as it,Rt as j,Pt as k,bn as l,Ye as lt,Y as m,h as mt,Wn as n,rt as nt,Rn as o,b as ot,In as p,p as pt,wt as q,Un as r,x as rt,yn as s,qe as st,Hn as t,Dt as tt,xn as u,Xe as ut,Q as v,Re as vt,qt as w,An as x,Sn as y,Ae as yt,Nt as z};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-CNZTLwH9.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-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-DFEiuiFQ.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{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{c as t,n}from"./agent-server-client-options-EHB23gyx.js";import{S as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as i}from"./proxy-XP6U1Dhv.js";var a=`/api/agent-profiles`;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function s(){return i({backend:o(),method:`GET`,path:a})}async function c(e){return i({backend:o(),method:`GET`,path:`${a}/${encodeURIComponent(e)}`})}async function l(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:t})}async function u(e){return i({backend:o(),method:`DELETE`,path:`${a}/${encodeURIComponent(e)}`})}async function d(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/activate`,body:{}})}var p=e({WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME:()=>h,default:()=>g});function m(){return t().backend.kind===`cloud`}var h=`default`,g=class{static async listProfiles(){return m()?s():new r(n()).listAgentProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getAgentProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveAgentProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteAgentProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameAgentProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateAgentProfile(e)}};export{h as n,p as r,g as t};
1
+ import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{c as t,n}from"./agent-server-client-options-EHB23gyx.js";import{C as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as i}from"./proxy-DbEf3Nqr.js";var a=`/api/agent-profiles`;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function s(){return i({backend:o(),method:`GET`,path:a})}async function c(e){return i({backend:o(),method:`GET`,path:`${a}/${encodeURIComponent(e)}`})}async function l(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:t})}async function u(e){return i({backend:o(),method:`DELETE`,path:`${a}/${encodeURIComponent(e)}`})}async function d(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/activate`,body:{}})}var p=e({WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME:()=>h,default:()=>g});function m(){return t().backend.kind===`cloud`}var h=`default`,g=class{static async listProfiles(){return m()?s():new r(n()).listAgentProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getAgentProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveAgentProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteAgentProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameAgentProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateAgentProfile(e)}};export{h as n,p as r,g as t};
@@ -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-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as o}from"./useMutation-Cszf8mKy.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{O as c,ct as l,dt as u,st as d}from"./active-backend-context-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{t as m}from"./back-nav-button-B2yBiVMB.js";import{t as h}from"./loading-spinner-BeLV0IXf.js";import{t as g}from"./brand-button-CUMfjb99.js";import{i as _}from"./dropdown-classes-BGvOvW2_.js";import{t as v}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as y}from"./use-llm-profiles-SWsuFmFu.js";import{t as b}from"./agent-profiles-service.api-DkeZaqIl.js";import{t as x}from"./use-agent-profiles-Bi8hSkze.js";import{i as S,n as C,t as w}from"./use-can-manage-org-profiles-MzIeEV8F.js";import{t as T}from"./u-edit-DAkcF52u.js";import{r as E}from"./typography-DgcLGdHk.js";import{o as D}from"./extension-module-card-classes-DpeaYhYo.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-ehL-kgeO.js";import{t as N}from"./u-check-circle-BKn1spCL.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-DhAPuXm6.js";import{n as ee}from"./settings-section-header-context-BOJ_Fbak.js";import{t as R}from"./use-save-agent-profile-D-ZHHE94.js";import{n as z}from"./use-activate-agent-profile-8L8Xdghy.js";import{t as B}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as V,t as H}from"./agent-settings-BF8hM6wb.js";var U=e(t(),1),W=e(n(),1),G=r();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:c}=s(`openhands`),l=(0,U.useRef)(null),u=(0,U.useRef)([]),d=o?.current??null,[m,h]=(0,U.useState)();(0,U.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,U.useEffect)(()=>{u.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;l.current?.contains(t)||d?.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)}},[d,a]);let g=e=>{e(),a()},v=(0,U.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,x=(0,G.jsxs)(`div`,{ref:l,className:p(`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,G.jsx)(k,{index:0,icon:(0,G.jsx)(T,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,G.jsx)(k,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(k,{index:2,icon:(0,G.jsx)(S,{width:16,height:16}),label:c(f.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:W.createPortal((0,G.jsx)(`div`,{style:m,children:x}),document.body):x}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:c}=s(`openhands`),[l,u]=(0,U.useState)(!1),d=(0,U.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(f.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:p(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,G.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(f.SETTINGS$PROFILE_DEFAULT)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(C,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(f.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,G.jsx)(K,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>u(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l}){let{t:u}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(h,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:u(f.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(f.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:p(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l},e.name))})}function Y(){let e=a();return o({mutationFn:e=>b.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(f.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(f.ERROR$GENERIC))}},o=()=>{r.isPending||t()},c=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(f.BUTTON$DELETE)})]}):n(f.BUTTON$DELETE)})]});return(0,G.jsx)(j,{isOpen:!0,title:n(f.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(f.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function te({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=x(),o=z(),c=w(),[u,d]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(f.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,G.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(f.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(f.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:u,onClose:()=>d(null)})]})}function ne(){let e=a();return o({mutationFn:({name:e,newName:t})=>b.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function re(e){if(e.agent_kind===`acp`)return{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``};let t=e.enable_switch_llm_tool??!0;return{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,enable_switch_llm_tool:t,tool_concurrency_limit:e.tool_concurrency_limit}}function Z(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=ee(),n=R(),r=ne(),{data:i}=x(),{data:a,isLoading:o}=y(),[c,p]=(0,U.useState)(`list`),[h,_]=(0,U.useState)(``),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(null),[D,k]=(0,U.useState)(``),[j,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),z=(0,U.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==S?.name&&L.has(h)),[h,c,L,S?.name]),V=(0,U.useCallback)(()=>{_(``),C(null),T({agent_kind:`openhands`}),k(I),M(null),p(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await b.getProfile(t.name,`encrypted`)).profile;C(e),T(re(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),p(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(f.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{p(`list`),C(null),_(``),T(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!j||!z)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){d(e(f.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){d(t instanceof Error?t.message:e(f.ERROR$GENERIC));return}let i=h.trim(),a=S?.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=B(c===`edit`?S:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?f.SETTINGS$PROFILE_CREATED:f.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(f.ERROR$GENERIC))}finally{P(!1)}},[j,z,D,h,c,S,n,r,e,K]);if(c===`list`)return(0,G.jsx)(te,{onAddProfile:V,onEditProfile:W});let J=e(c===`edit`?f.SETTINGS$EDIT_AGENT_PROFILE:f.SETTINGS$ADD_AGENT_PROFILE),Y=c===`edit`&&S?e(f.SETTINGS$PROFILE_LOADED,{name:S.name}):e(f.SETTINGS$PROFILE_SAVE_HINT),X=j?.agentType!==`acp`,Z=c===`edit`&&h!==S?.name,Q=S?.agent_kind===`openhands`?S.llm_profile_ref:``,$=c===`edit`&&X&&D!==Q,ie=c===`create`||!!j?.isDirty||Z||$;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(m,{testId:`back-to-agent-profiles`,onClick:K,children:e(f.BUTTON$BACK)}),(0,G.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:w,onSaveControlChange:M},c===`edit`?`edit-${S?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(v,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(f.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,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(f.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!z||N||!j?.isValid||!ie,"aria-busy":N,children:e(N?f.SETTINGS$SAVING:f.BUTTON$SAVE)})]})]})}var Q={hideTitle:!1},$=i(function(){return(0,G.jsx)(Z,{})});export{$ as default,Q 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-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as o}from"./useMutation-Cszf8mKy.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{O as c,ct as l,dt as u,st as d}from"./active-backend-context-BsLfwrXB.js";import{K as f,t as p}from"./utils-D-gOfhmN.js";import{t as m}from"./back-nav-button-DWNiN277.js";import{t as h}from"./loading-spinner-DK1sAwVg.js";import{t as g}from"./brand-button-mQq2Ld1I.js";import{i as _}from"./dropdown-classes-goDldkiu.js";import{t as v}from"./settings-dropdown-input-BRR2OZwi.js";import{t as y}from"./use-llm-profiles-xtCBMbef.js";import{t as b}from"./agent-profiles-service.api-U-9YzDFU.js";import{t as x}from"./use-agent-profiles-LCvb5OXT.js";import{i as S,n as C,t as w}from"./use-can-manage-org-profiles-CB8ybxFK.js";import{t as T}from"./u-edit-DAkcF52u.js";import{r as E}from"./typography-NarNyelM.js";import{o as D}from"./extension-module-card-classes-DpeaYhYo.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-Cdnei7Ly.js";import{t as N}from"./u-check-circle-BKn1spCL.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-CaUfKZ33.js";import{n as ee}from"./settings-section-header-context-BOJ_Fbak.js";import{t as R}from"./use-save-agent-profile-D7hJuW_u.js";import{n as z}from"./use-activate-agent-profile-iQZ0U3qV.js";import{t as B}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as V,t as H}from"./agent-settings-BZJHtaIK.js";var U=e(t(),1),W=e(n(),1),G=r();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:c}=s(`openhands`),l=(0,U.useRef)(null),u=(0,U.useRef)([]),d=o?.current??null,[m,h]=(0,U.useState)();(0,U.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,U.useEffect)(()=>{u.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;l.current?.contains(t)||d?.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)}},[d,a]);let g=e=>{e(),a()},v=(0,U.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,x=(0,G.jsxs)(`div`,{ref:l,className:p(`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,G.jsx)(k,{index:0,icon:(0,G.jsx)(T,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,G.jsx)(k,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(k,{index:2,icon:(0,G.jsx)(S,{width:16,height:16}),label:c(f.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:W.createPortal((0,G.jsx)(`div`,{style:m,children:x}),document.body):x}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:c}=s(`openhands`),[l,u]=(0,U.useState)(!1),d=(0,U.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(f.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:p(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,G.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(f.SETTINGS$PROFILE_DEFAULT)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(C,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(f.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,G.jsx)(K,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>u(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l}){let{t:u}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(h,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:u(f.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(f.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:p(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l},e.name))})}function Y(){let e=a();return o({mutationFn:e=>b.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(f.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(f.ERROR$GENERIC))}},o=()=>{r.isPending||t()},c=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(f.BUTTON$DELETE)})]}):n(f.BUTTON$DELETE)})]});return(0,G.jsx)(j,{isOpen:!0,title:n(f.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(f.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function te({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=x(),o=z(),c=w(),[u,d]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(f.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,G.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(f.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(f.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:u,onClose:()=>d(null)})]})}function ne(){let e=a();return o({mutationFn:({name:e,newName:t})=>b.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function re(e){if(e.agent_kind===`acp`)return{agent_kind:`acp`,mcp_server_refs:e.mcp_server_refs??null,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``};let t=e.enable_switch_llm_tool??!0;return{agent_kind:`openhands`,mcp_server_refs:e.mcp_server_refs??null,enable_sub_agents:e.enable_sub_agents,enable_switch_llm_tool:t,tool_concurrency_limit:e.tool_concurrency_limit}}function Z(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=ee(),n=R(),r=ne(),{data:i}=x(),{data:a,isLoading:o}=y(),[c,p]=(0,U.useState)(`list`),[h,_]=(0,U.useState)(``),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(null),[D,k]=(0,U.useState)(``),[j,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),z=(0,U.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==S?.name&&L.has(h)),[h,c,L,S?.name]),V=(0,U.useCallback)(()=>{_(``),C(null),T({agent_kind:`openhands`}),k(I),M(null),p(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await b.getProfile(t.name,`encrypted`)).profile;C(e),T(re(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),p(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(f.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{p(`list`),C(null),_(``),T(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!j||!z)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){d(e(f.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){d(t instanceof Error?t.message:e(f.ERROR$GENERIC));return}let i=h.trim(),a=S?.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=B(c===`edit`?S:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?f.SETTINGS$PROFILE_CREATED:f.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(f.ERROR$GENERIC))}finally{P(!1)}},[j,z,D,h,c,S,n,r,e,K]);if(c===`list`)return(0,G.jsx)(te,{onAddProfile:V,onEditProfile:W});let J=e(c===`edit`?f.SETTINGS$EDIT_AGENT_PROFILE:f.SETTINGS$ADD_AGENT_PROFILE),Y=c===`edit`&&S?e(f.SETTINGS$PROFILE_LOADED,{name:S.name}):e(f.SETTINGS$PROFILE_SAVE_HINT),X=j?.agentType!==`acp`,Z=c===`edit`&&h!==S?.name,Q=S?.agent_kind===`openhands`?S.llm_profile_ref:``,$=c===`edit`&&X&&D!==Q,ie=c===`create`||!!j?.isDirty||Z||$;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(m,{testId:`back-to-agent-profiles`,onClick:K,children:e(f.BUTTON$BACK)}),(0,G.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:w,onSaveControlChange:M},c===`edit`?`edit-${S?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(v,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(f.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,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(f.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!z||N||!j?.isValid||!ie,"aria-busy":N,children:e(N?f.SETTINGS$SAVING:f.BUTTON$SAVE)})]})]})}var Q={hideTitle:!1},$=i(function(){return(0,G.jsx)(Z,{})});export{$ as default,Q as handle};
@@ -0,0 +1,88 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/profiles-service.api-DdF_4Zhe.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js","assets/vendor-styling-Ck5D_A2Q.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/proxy-DbEf3Nqr.js","assets/agent-profiles-service.api-U-9YzDFU.js","assets/secrets-service-DU6wh3wX.js","assets/active-backend-context-BsLfwrXB.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/utils-D-gOfhmN.js","assets/hooks-service-DkxnQa4N.js"])))=>i.map(i=>d[i]);
2
+ import{xt as e}from"./vendor-styling-Ck5D_A2Q.js";import{K as t,X as n,f as r,w as i}from"./active-backend-context-BsLfwrXB.js";import{D as a}from"./utils-D-gOfhmN.js";import{a as o,c as s,d as c,n as l,t as u,u as ee}from"./agent-server-client-options-EHB23gyx.js";import{d as te,n as ne,s as d}from"./agent-server-config-C_x8Otd9.js";import{S as re,_ as f,l as p,p as m,v as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as g}from"./proxy-DbEf3Nqr.js";import{r as ie,t as _}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";import{n as ae}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{t as v}from"./settings-CKqk8ZnH.js";import{t as y}from"./settings-service.api-Q9lKW1TX.js";import{t as oe}from"./profiles-service.api-DdF_4Zhe.js";import{f as b,o as se,s as x}from"./acp-providers-BQ4o4vqy.js";import{c as S,n as C,r as w}from"./skill-enablement-DXeaImBz.js";import{d as T,f as ce,r as le}from"./llm-subscription-DTqtBCWz.js";import{t as ue}from"./llm-subscription-service-BiQaZbvv.js";var E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function de(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+`-`+E[e[t+4]]+E[e[t+5]]+`-`+E[e[t+6]]+E[e[t+7]]+`-`+E[e[t+8]]+E[e[t+9]]+`-`+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}var fe=new Uint8Array(16);function pe(){return crypto.getRandomValues(fe)}function D(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():me(e,t,n)}function me(e,t,n){e||={};let r=e.random??e.rng?.()??pe();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return de(r)}var O=new Map;function he(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function ge(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function _e(e={}){let t=l(e),n=t.host,r=O.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new f(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();O.set(n,i);try{return await i}catch(e){throw O.delete(n),e}}async function k(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?he(n)?n:ge(await _e(t),n):_e(t)}var A=`openhands-agent-server-conversation-metadata`,ve=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),j=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(A);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},ye=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(A);return}window.localStorage.setItem(A,JSON.stringify(e))}},M=e=>j()[e]??null,N=(e,t)=>{let n=j();n[e]=t,ye(n)},be=(e,t)=>{N(e,{selected_repository:null,selected_branch:null,git_provider:null,...M(e)??{},...t})},P=e=>{let t=j();e in t&&(delete t[e],ye(t))};function xe(e){if(!e?.id)return e;let t=M(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 F(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}function Se(){let e=s().backend;return e.kind===`cloud`?e:c().find(e=>e.kind===`cloud`&&!!e.apiKey)??null}async function Ce(e=20,t){let n=F(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>xe(e)),next_page_id:i?.next_page_id??null}}async function I(e){if(e.length===0)return[];let t=F(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(xe)}async function we(e,t){return await g({backend:t??F(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:i})}async function Te(e){return g({backend:F(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function Ee(e){await g({backend:F(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function De(e,t){return await g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function Oe(e,t){return g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{title:t}})}async function ke(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function Ae(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function je(e,t){let n=F(),r=new URLSearchParams;return r.append(`file_path`,t),await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function Me(e,t){let n=F(),r=new URLSearchParams;r.append(`path`,t);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/files?${r.toString()}`});return Array.isArray(i)?i:[]}async function Ne(e,t){let n=t??F(),r=new URLSearchParams;return r.set(`ids`,e),(await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${r.toString()}`}))?.[0]??null}function Pe(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}function Fe(e){if(!e?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let t=0,n=null,r=null;for(let i of Object.values(e.usage_to_metrics))t+=i.accumulated_cost,n===null&&i.max_budget_per_task!==null&&(n=i.max_budget_per_task),i.accumulated_token_usage&&(r=r===null?{...i.accumulated_token_usage}:{prompt_tokens:r.prompt_tokens+i.accumulated_token_usage.prompt_tokens,completion_tokens:r.completion_tokens+i.accumulated_token_usage.completion_tokens,cache_read_tokens:r.cache_read_tokens+i.accumulated_token_usage.cache_read_tokens,cache_write_tokens:r.cache_write_tokens+i.accumulated_token_usage.cache_write_tokens,context_window:Math.max(r.context_window,i.accumulated_token_usage.context_window),per_turn_token:Math.max(r.per_turn_token,i.accumulated_token_usage.per_turn_token)});return{accumulated_cost:t,max_budget_per_task:n,accumulated_token_usage:r}}function Ie(e){return Fe(e.stats)}var Le=`canvas_ui`,L=`canvas_ui_control`,Re=`ClientAction_${L}`,ze={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}},R=`launch_child_conversation`,Be=`ClientAction_${R}`,Ve=`[child-conversation] `,He=[`local`,`cloud`],Ue=[`worktree`,`shared`],We=`1.37.1`,Ge={name:R,description:`Start a NEW, independent conversation to work on a well-scoped task in parallel with this one, without the user having to run any CLI command. The new conversation is recorded as a child of this one.
39
+
40
+ The child runs on its own. It does not block you, you do not see its output,
41
+ and it cannot see this conversation's history — everything it needs must be in
42
+ the task brief.
43
+
44
+ Choosing target:
45
+
46
+ * target="local" — runs on the same machine, in this conversation's workspace.
47
+ Fast, no repository clone, no sandbox provisioning. Use this by default when
48
+ the work is on code that is already checked out here.
49
+
50
+ * target="cloud" — runs on OpenHands Cloud in its own isolated sandbox, from a
51
+ git repository. Use this when the work should not touch the user's machine or
52
+ when it needs a repository that is not checked out locally. Requires the user
53
+ to have an OpenHands Cloud backend connected in Agent Canvas; if none is
54
+ connected you will be told so and should fall back to target="local".
55
+
56
+ Writing the task brief:
57
+
58
+ * Put everything the child needs in "task": the goal, the relevant file paths,
59
+ the constraints, the expected deliverable, and how it should report back.
60
+ * Keep each child's scope independent of its siblings so parallel children do
61
+ not fight over the same files.
62
+ * One call per delegated task. Do NOT call this tool twice for the same task.
63
+
64
+ Parameter rules (a call that breaks one of these launches nothing and comes
65
+ back with corrective guidance):
66
+
67
+ * "repository" and "branch" apply to target="cloud" only. A local child always
68
+ inherits this conversation's workspace, so do not pass them with
69
+ target="local".
70
+ * "isolation" applies to target="local" only. Cloud sandboxes are always
71
+ isolated, so do not pass it with target="cloud".
72
+ * isolation="worktree" (the default) gives the child its own git worktree and
73
+ branch, cut from the repository's default branch — it will NOT see this
74
+ conversation's uncommitted or committed work. isolation="shared" puts the
75
+ child in this conversation's exact directory; only choose it when the child
76
+ genuinely must see work in progress, and expect the two agents to conflict.
77
+
78
+ What comes back: this tool is acknowledged immediately, before the conversation
79
+ exists. The real outcome arrives moments later as a follow-up message starting
80
+ with "${Ve.trim()}" that carries the child's
81
+ conversation id, URL, target and initial status — or an error with guidance.
82
+ Wait for it, then tell the user what you launched and give them the URL. If it
83
+ reports an error, fix the parameters and call this tool again.`,parameters:{type:`object`,additionalProperties:!1,properties:{target:{type:`string`,enum:[...He],description:`Where the child runs. 'local' reuses this machine and this conversation's workspace; 'cloud' runs in an isolated OpenHands Cloud sandbox.`},task:{type:`string`,description:`Self-contained task brief, sent as the child's first message. The child cannot see this conversation, so state the goal, constraints, expected output and handoff criteria.`},title:{type:`string`,description:`Optional short title for the child conversation. Omit to let it title itself from the task.`},repository:{type:`string`,description:`target='cloud' only. Repository to clone into the sandbox, as 'owner/repo'. Defaults to this conversation's repository when it has one.`},branch:{type:`string`,description:`target='cloud' only, and only together with 'repository'. Defaults to the repository's default branch.`},isolation:{type:`string`,enum:[...Ue],description:`target='local' only. 'worktree' (default) gives the child its own git worktree and branch; 'shared' runs it in this conversation's exact directory.`}},required:[`target`,`task`]},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0}},Ke=`.agents_tmp/PLAN.md`,qe=`system_prompt_planning.j2`,Je=`planning_file_editor`,z=`plannerparent`,Ye=`PLAN.MD`,Xe=[`The plan must follow this structure exactly:`,``,`1. OBJECTIVE`,` * Summarize the goal of the plan in one or two sentences.`,` * Restate the problem in clear operational terms.`,``,`2. CONTEXT SUMMARY`,` * Briefly describe the relevant system components, files, or data involved.`,` * Mention any dependencies or constraints (technical, organizational, or external).`,``,`3. APPROACH OVERVIEW`,` * Outline the chosen approach at a high level.`,` * Mention why it was selected (short rationale) if alternatives were considered.`,``,`4. IMPLEMENTATION STEPS`,` * Provide a step-by-step plan for execution.`,` * Each step should include:`,` - a **goal** (what this step accomplishes),`,` - a **method** (how to do it, briefly),`,` - and optionally a **reference** (file, module, or function impacted).`,``,`5. TESTING AND VALIDATION`,` * Describe how the implementation can be verified or validated.`,` * This section should describe what success looks like — expected outputs, behaviors, or conditions.`].join(`
84
+ `),Ze=[`<IMPORTANT_PLANNING_BOUNDARIES>`,`You are a Planning Agent that can ONLY create plans - you CANNOT execute code or make changes.`,``,`Create or update the plan for the current task in the configured PLAN.md file.`,``,`After you finalize the plan in PLAN.md:`,`- Do NOT ask "Ready to proceed?" or offer to execute the plan`,`- Do NOT attempt to run any implementation commands`,`- Instead, tell the user they can click the **Build** button below the plan preview to switch to the code agent and execute the plan.`,``,`Your role ends when the plan is finalized. Implementation is handled by the code agent.`,`</IMPORTANT_PLANNING_BOUNDARIES>`].join(`
85
+ `);function Qe(e){return`${e.replace(/\/+$/,``)}/${Ke}`}function $e(e){if(!e)return!1;let t=e.replace(/\\/g,`/`).toUpperCase();return t===Ye||t.endsWith(`/${Ye}`)}function et(e,t){return e?.tags?.[z]===t}function tt(e,t){return t?e?.find(e=>et(e,t))?.id??null:null}var nt=[`terminal`,`file_editor`,`task_tracker`],rt=`browser_tool_set`,it=`task_tool_set`,at=500;function ot(e){return typeof e==`number`?e:at}function st(){return!0}function B(e){if(typeof e==`string`){let t=e.trim();if(!t)return null;try{return B(JSON.parse(t))}catch{return null}}if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return!t.services||typeof t.services!=`object`?null:t}async function ct(){let e;try{e=l({timeout:3e3})}catch{return null}let n=B(t({host:e.host})?.runtime_services);if(n)return n;try{return B((await new re(e).getServerInfo()).runtime_services)}catch{return null}}function lt(e){let t=B(e);if(!t?.services)return;let n=[];n.push(`<RUNTIME_SERVICES>`),t.mode?n.push(`You are running inside an agent-canvas dev stack started in '${t.mode}' mode.`):n.push(`You are running inside an agent-canvas dev stack.`),n.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:r,ingress:i,automation:a}=t.services,{frontend:o}=t.services;r?.url_from_agent&&n.push(`* Agent Server (you): ${r.url_from_agent}`,` ${r.description??`The agent-server hosting your tool calls.`}`),i?.url_from_agent&&n.push(`* Ingress: ${i.url_from_agent}`,` ${i.description??`Unified entry point for browser-facing traffic.`}`),o?.url_from_agent&&n.push(`* Frontend: ${o.url_from_agent}`,` ${o.description??`Frontend dev server.`}`),a?.url_from_agent?(n.push(`* Automation backend: ${a.url_from_agent}`,` ${a.description??`OpenHands Automations service.`}`),a.docs_url&&n.push(` Docs: ${a.docs_url}`),a.openapi_url&&n.push(` OpenAPI: ${a.openapi_url}`),a.auth_env_var&&n.push(` Auth: header 'X-Session-API-Key: $${a.auth_env_var}'`)):n.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let s=r?.url_from_agent;return n.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),s&&n.push(`In particular, ${s} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),n.push(`</RUNTIME_SERVICES>`),n.join(`
86
+ `)}function ut(e){let{host:t}=l();return`${t}/api/conversations/${e}`}function dt(e){return`Conversation ${e.slice(0,5)}`}function V(e){let t=M(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:dt(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??v.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}:Fe(e.stats),created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??a.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:ut(e.id),session_api_key:l().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??d()},public:!1,sub_conversation_ids:e.sub_conversation_ids??[]}}function ft(e){return{items:e.items.filter(e=>!e.tags?.[z]).map(V),next_page_id:e.next_page_id??null}}var pt=`acpserver`,H=`clientsource`,mt=`agentcanvas`,ht=`automationtrigger`,gt=`automationid`,U=`automationname`,_t=`automationrunid`,vt=[ht,gt,U,_t],yt=new Set([pt,H,ht,gt,U,_t,`title`,`git_provider`,`repo_name`,`repo`,`repository`,`selected_branch`,`branch`,`archiveworkspacepath`,`workspace`,`working_dir`,z]),bt=[`origin`];function xt(e){if(!e)return[];let t=e=>{let t=bt.indexOf(e.trim().toLowerCase());return t===-1?1/0:t};return Object.entries(e).filter(([e,t])=>!yt.has(e.trim().toLowerCase())&&typeof t==`string`&&(t===``||t.trim().length>0)).sort(([e],[n])=>{let r=t(e),i=t(n);return r===i?e.localeCompare(n):r-i})}var St=`gAAAAA`,Ct=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function W(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function wt(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Tt(e){let t=W(e);t.model=typeof t.model==`string`&&t.model.trim().length>0?t.model:v.llm_model;let n=wt(t.api_key);n?t.api_key=n:delete t.api_key;let r=wt(t.base_url);return r?t.base_url=r:delete t.base_url,ce(t)?(t.auth_type=le,t.subscription_vendor=T,delete t.api_key):(delete t.auth_type,delete t.subscription_vendor),t}function G(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function K(e){return typeof e==`string`?e.startsWith(St):Array.isArray(e)?e.some(K):G(e)?Object.values(e).some(K):!1}function Et(e){return G(e)?Object.values(e).some(K):!1}function Dt(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Ot(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function kt(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function q(e,t){return e===rt?st()&&n(e):e===it?t.enable_sub_agents===!0&&n(e):!0}function At(e){let t=new Map;for(let n of nt)q(n,e)&&t.set(n,{name:n,params:{}});for(let n of[rt,it])q(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>kt(e)))for(let r of n)q(r.name,e)&&t.set(r.name,{name:r.name,params:W(r.params)});return Array.from(t.values())}function jt(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
87
+
88
+ `)}],run:!0}}function Mt(){return ae.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 J(e,t,n={},r){let i=lt(t),a=W(e.agent_context),o=Array.isArray(a.skills)?a.skills:[],s=n.disabledSkills??[],c=new Set(s),l=C(n),u=[...o.filter(e=>typeof e.name!=`string`||!c.has(e.name)),...Mt().filter(e=>e.name===r||l(e.name))];return{...a,skills:u,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,disabled_skills:s,...i?{system_message_suffix:i}:{}}}function Nt(e){return W(e.agent_settings).agent_kind===`acp`}function Pt(e){let t=W(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function Ft(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=x(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function It(e,t,n){let r=W(e.agent_settings),i={agent_kind:`acp`,agent_context:J(r,t,S(e),w(n))};for(let e of _){if(e===`acp_model`||e===`acp_env`)continue;let t=e===`acp_command`?Ft(r):r[e];t!=null&&(i[e]=t)}let a=W(r.mcp_config);Object.keys(a).length>0&&(i.mcp_config=a);let o=typeof r.acp_server==`string`?r.acp_server:void 0,s=b({configured:r.acp_model,providerDefault:se(o)});return s&&(i.acp_model=s),i}function Lt(e,t,n){let r=W(e.agent_settings),i=Tt(r.llm);i.stream=!0;let a=W(r.mcp_config);Object.keys(a).length===0&&delete r.mcp_config,delete r.acp_server;for(let e of _)delete r[e];return delete r.acp_env,{...r,llm:i,agent_context:J(r,t,S(e),w(n)),tools:At(r)}}function Rt(e,t,n){return Nt(e)?It(e,t,n):Lt(e,t,n)}function zt(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=W(t.conversation_settings),s=jt(n,r);return Ct.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??d()},...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 Bt(e){if(!e?.length)return;let t=ee(),n=t?Pe(t):{},r={};for(let t of e){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}return r}function Vt(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Nt(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=Rt(t,e.runtimeServicesInfo,e.query),a=n?Pt(t):void 0,o=zt(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`?[ze,Ge]:[],confirmation_policy:Dt(o),max_iterations:ot(o.max_iterations),stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a?s.tags={[pt]:a,[H]:mt}:s.tags={[H]:mt},!e.agentProfileId&&e.secretsEncrypted&&(!n||Et(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId),e.parentConversationId&&(s.parent_conversation_id=e.parentConversationId);let c=Ot(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:e.workspaceHookConfig&&(s.hook_config=e.workspaceHookConfig);let l={...o.tool_module_qualnames??{}};delete l[Le],delete l[L],delete l[R],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions);let u=Bt(e.customSecrets);return u&&(s.secrets=u),s}function Ht(e){let t=W(e.encryptedAgentSettings),n=Tt(t.llm);n.stream=!0;let r=Qe(e.workingDir),i=J(t,void 0,e.skillEnablement),a=i.system_message_suffix;i.system_message_suffix=typeof a==`string`?`${Ze}\n\n${a}`:Ze;let o=jt(e.initialMessage),s={agent:{kind:`Agent`,llm:n,tools:[{name:`glob`,params:{}},{name:`grep`,params:{}},{name:Je,params:{plan_path:r}}],system_prompt_filename:qe,system_prompt_kwargs:{plan_structure:Xe},agent_context:i,condenser:{kind:`LLMSummarizingCondenser`,llm:{...n,usage_id:`planning_condenser`},max_size:100,keep_first:6}},workspace:{kind:`LocalWorkspace`,working_dir:e.workingDir},client_tools:[],confirmation_policy:{kind:`NeverConfirm`},max_iterations:e.maxIterations??at,stuck_detection:!0,autotitle:!1,worktree:!1,parent_conversation_id:e.parentConversationId,tags:{[z]:e.parentConversationId},...o?{initial_message:o}:{}};e.secretsEncrypted&&(s.secrets_encrypted=!0);let c=Bt(e.customSecrets);return c&&(s.secrets=c),s}async function Ut(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./profiles-service.api-DdF_4Zhe.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=await n.getProfile(t,`encrypted`);return G(r.config)?r.config:null}catch(e){return console.warn(`Falling back: could not resolve LLM profile ${t}`,e),null}}async function Wt(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./agent-profiles-service.api-U-9YzDFU.js`).then(e=>e.r);return{default:e}},__vite__mapDeps([7,1,2,3,4,5,6])),{profiles:r}=await n.listProfiles(),i=r.find(e=>e.id===t&&e.llm_profile_ref);return i?.llm_profile_ref?await Ut(i.llm_profile_ref):null}catch(e){return console.warn(`Falling back to global agent settings: could not resolve the LLM for agent profile ${t}`,e),null}}async function Gt(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-DU6wh3wX.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),[r,i]=await Promise.all([y.getSettingsForConversation(),n.getSecrets()]),a=(t.parentActiveProfileName?await Ut(t.parentActiveProfileName):null)??(t.parentAgentProfileId?await Wt(t.parentAgentProfileId):null),o=a?{...r.agentSettings,llm:a}:r.agentSettings;await Y(o);let s=ot(r.conversationSettings.max_iterations);return Ht({...t,encryptedAgentSettings:o,secretsEncrypted:r.secretsEncrypted,customSecrets:i,maxIterations:s,skillEnablement:r.skillEnablement})}var Kt=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Y(e){if(ce(W(e.llm))&&!(await ue.getOpenAIStatus()).connected)throw Error(Kt)}async function qt(t){let[{SecretsService:n},{default:r}]=await Promise.all([e(()=>import(`./secrets-service-DU6wh3wX.js`).then(e=>e.n),__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),e(()=>import(`./hooks-service-DkxnQa4N.js`),__vite__mapDeps([14,2,1,3,4,5]))]),[i,a,o,s]=await Promise.all([y.getSettingsForConversation(),n.getSecrets(),ct(),r.loadWorkspaceHooks(t.hooksProjectDir)]),{agentSettings:c,conversationSettings:l,secretsEncrypted:u}=i;return t.agentProfileId||await Y(c),Vt({...t,encryptedAgentSettings:c,encryptedConversationSettings:l,secretsEncrypted:u,customSecrets:a,runtimeServicesInfo:o,workspaceHookConfig:s})}function Jt(){return{hooks:[]}}function Yt(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 Xt=`1970-01-01T00:00:00.000Z`,Zt=300*1e3,Qt=`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 X(){return Error(Qt)}function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $t(e){return typeof e==`number`?e:null}function Q(e){return typeof e==`number`?e:0}function $(e){return typeof e==`string`?e:null}function en(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Xt}function tn(e){return Z(e)?{prompt_tokens:Q(e.prompt_tokens),completion_tokens:Q(e.completion_tokens),cache_read_tokens:Q(e.cache_read_tokens),cache_write_tokens:Q(e.cache_write_tokens),context_window:Q(e.context_window),per_turn_token:Q(e.per_turn_token)}:null}function nn(e){return Z(e)?{accumulated_cost:$t(e.accumulated_cost),max_budget_per_task:$t(e.max_budget_per_task),accumulated_token_usage:tn(e.accumulated_token_usage)}:null}function rn(e){return Z(e)?e:null}function an(e){if(!Z(e))return null;let t=Z(e.llm)?{model:$(e.llm.model)}:null;return{kind:$(e.kind),acp_server:$(e.acp_server),acp_model:$(e.acp_model),llm:t}}function on(e){return Z(e)?{working_dir:$(e.working_dir)}:null}function sn(e){if(!Z(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function cn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):null}function ln(e){if(!Z(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 un(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 dn(e,t){let n=un(e),r=un(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function fn(e){if(!Z(e)||typeof e.id!=`string`||!e.id.trim())throw X();return{id:e.id.trim(),title:$(e.title),created_at:en(e,`created_at`,`createdAt`),updated_at:en(e,`updated_at`,`updatedAt`),execution_status:$(e.execution_status),sandbox_status:$(e.sandbox_status),metrics:nn(e.metrics),stats:rn(e.stats),agent:an(e.agent),workspace:on(e.workspace),tags:sn(e.tags),launched_agent_profile:ln(e.launched_agent_profile),sub_conversation_ids:cn(e.sub_conversation_ids),current_model_id:$(e.current_model_id),current_model_name:$(e.current_model_name)}}function pn(e){if(!Array.isArray(e))throw X();return e.map(fn)}function mn(e){if(Array.isArray(e))return{items:pn(e),next_page_id:null};if(!Z(e))throw X();return{items:pn(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var hn=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function gn(e){let t=e??`idle`;return hn.has(t)?t:`idle`}function _n(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var vn=class{static async sendMessage(e,t,n){let r=s().backend,i=n?.conversationUrl??null,a=n?.sessionApiKey??null;if(r.kind===`cloud`){if(!i||!a){let[t]=await I([e]);i=t?.conversation_url?.trim()??null,a=t?.session_api_key?.trim()??null}if(!i||!a)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await g({backend:r,method:`POST`,hostOverride:o(i),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:a}),t}return await new h(l({conversationUrl:i,sessionApiKey:a})).sendEvent(e,t,{run:!0}),t}static async createConversation(e={}){let{initialUserMsg:t,conversationInstructions:n,plugins:i,metadata:a,workingDirOverride:o,workspaceMode:c,parentConversationId:d,agentType:re,sandboxId:f,agentProfileId:p,agentProfileKind:m}=e;if(s().backend.kind===`cloud`)return we({initial_message:t?{role:`user`,content:[{type:`text`,text:t}]}:null,title:n??null,selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,plugins:i??null,parent_conversation_id:d??null,agent_type:re,sandbox_id:f??null,agent_profile_id:p??null,trigger:`gui`});let[g,ie]=await Promise.all([y.getSettings(),oe.listProfiles().catch(()=>void 0)]),_=Yt(g.title_llm_profile,ie),ae=D(),v=s().backend.host,b=await k(o??ne(ae,v)),se=o?b:await k(te(v)),x=c??(o?`local_repo`:`new_worktree`),S=await qt({settings:g,query:t,conversationInstructions:n,plugins:i,conversationId:ae,parentConversationId:d,workingDir:b,hooksProjectDir:se,worktree:x===`new_worktree`,agentProfileId:p,agentProfileKind:m,titleLlmProfile:_}),C=await r(),w=await new h(l({timeout:Zt})).createConversation({...S,...C?{user_id:C}:{}}),T=ee();if(!T)throw new u;return(a?.selected_repository||o)&&N(w.id,{selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,selected_workspace:o??null,workspace_mode:x}),{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:S.initial_message,plugins:i??null},created_at:w.created_at,updated_at:w.updated_at}}static async createLocalPlanningConversation(e,t){if(s().backend.kind===`cloud`)throw Error(`Local planning conversations require a local backend.`);let[n]=await this.batchGetAppConversations([e]),r=await Gt({workingDir:n?.workspace?.working_dir??d(),parentConversationId:e,parentActiveProfileName:n?.agent_kind===`openhands`?n?.active_profile??null:null,parentAgentProfileId:n?.launched_agent_profile?.agent_profile_id??null,initialMessage:t}),i=await new h(l()).createConversation(r);return be(e,{local_planning_conversation_id:i.id}),V(i)}static async getLocalPlanningConversationIds(e){if(s().backend.kind===`cloud`)return[];let t=new Set;try{let[n]=await this.batchGetAppConversations([e]),r=n?.sub_conversation_ids??[];if(r.length>0){let n=await this.batchGetAppConversations(r);for(let r of n)r&&et(r,e)&&t.add(r.id)}}catch(t){console.warn(`Failed to read sub-conversations of ${e}`,t)}let n=M(e)?.local_planning_conversation_id;return n&&t.add(n),[...t]}static async getStartTask(e){return s().backend.kind===`cloud`?Ne(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new p(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getVSCodeStatus(e,t){return new p(l({conversationUrl:e,sessionApiKey:t})).getStatus()}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??d()}static async batchGetAppConversations(e){return e.length===0?[]:s().backend.kind===`cloud`?I(e):pn(await new h(l()).getConversations(e)).map(e=>V(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return De(e,t)}static async updateConversationRepository(e,t,n,r){t?N(e,{...M(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):P(e);let[i]=await this.batchGetAppConversations([e]);return _n(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return je(e,dn(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=dn(t??`${n}/.agents_tmp/PLAN.md`,n);return new f(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?Te(e):new f(l()).downloadTrajectory(e)}static async getHooks(e){return Jt()}static async getRuntimeConversation(e,t,n){let r=fn(await new h(l({conversationUrl:t,sessionApiKey:n})).getConversation(e));return{id:r.id,title:r.title?.trim()?r.title:dt(r.id),metrics:nn(r.metrics),created_at:r.created_at,updated_at:r.updated_at,status:gn(r.execution_status),stats:r.stats??{usage_to_metrics:{}}}}static async condenseConversation(e,t,n){let r=s().backend;if(r.kind===`cloud`&&t){await g({backend:r,method:`POST`,hostOverride:o(t),path:`/api/conversations/${e}/condense`,authMode:`session-api-key`,sessionApiKey:n});return}await new h(l({conversationUrl:t,sessionApiKey:n})).condenseConversation(e)}static async searchConversations(e=20,t){return s().backend.kind===`cloud`?Ce(e,t):ft(mn(await new h(l()).searchConversations({limit:e,page_id:t,sort_order:ie.UPDATED_AT_DESC})))}static async deleteConversation(e){if(s().backend.kind===`cloud`){await Ee(e),P(e);return}let t=await this.getLocalPlanningConversationIds(e),n=new h(l());await Promise.all(t.map(async e=>{try{await n.deleteConversation(e)}catch(t){console.warn(`Failed to delete planning conversation ${e}`,t)}P(e)})),await n.deleteConversation(e),P(e)}static async updateConversationTitle(e,t){if(s().backend.kind===`cloud`)return Oe(e,t);await new h(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async updateConversationTags(e,t){await new h(l()).updateConversation(e,{tags:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async forkConversation(e,t,n){if(s().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let r=await new h(l()).forkConversation(e,{from_event_id:t,...n?{title:n}:{}}),i=M(e);return i&&N(r.id,i),r}static async getEventParentId(e,t){return(await new h(l()).getEvent(e,t)).parent_id??void 0}static async switchProfile(e,t){let{backend:n}=s();if(n.kind===`cloud`){if(!e){await oe.activateProfile(t);return}await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:t}});return}if(!e){await new m(l()).activateProfile(t);return}let r=l(),i=new h(r),a=await new m(r).getProfile(t,{exposeSecrets:`encrypted`}),o=typeof a.config.model==`string`?a.config.model:``;if(!o)throw Error(`Profile '${t}' has no model.`);await Y({llm:a.config}),await i.switchLLM(e,{...a.config,model:o,stream:!0,usage_id:`profile:${t}:${D()}`})}static async switchAcpModel(e,t){let{backend:n}=s();if(n.kind===`cloud`){await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:t}});return}await new h(l()).switchAcpModel(e,t)}};export{k as A,Se as C,be as D,M as E,N as O,ke as S,Ae as T,Ie as _,xt as a,Ne as b,Ue as c,Be as d,R as f,Le as g,L as h,yt as i,D as j,ve as k,Ve as l,Re as m,U as n,tt as o,We as p,vt as r,$e as s,vn as t,He as u,I as v,je as w,Me as x,we as y};
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i,f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{G as s,ct as c,dt as l,q as u,st as d}from"./active-backend-context-BsLfwrXB.js";import{K as f,t as p}from"./utils-D-gOfhmN.js";import{a as m,i as h,n as g,r as _,t as v}from"./use-acp-credential-form-CJ5wPsQm.js";import{l as ee}from"./settings-service.api-Q9lKW1TX.js";import{n as te}from"./use-settings-BWIH5EuN.js";import{t as ne}from"./use-save-settings-CikTu5xV.js";import{h as re}from"./form-control-classes-lQfLxzH4.js";import{t as ie}from"./brand-button-mQq2Ld1I.js";import{t as y}from"./settings-dropdown-input-BRR2OZwi.js";import{t as ae}from"./settings-input-Cm4VxUon.js";import{c as b,i as oe,n as x,o as S,s as se,t as ce}from"./acp-providers-BQ4o4vqy.js";import{_ as le,g as ue,h as de,n as fe,o as pe,v as me}from"./schema-field-c3Ncgm4x.js";import{r as C}from"./typography-NarNyelM.js";import{t as he}from"./settings-switch-seaSJc7t.js";import{t as ge}from"./mcp-installed-servers-Br4ZLsjr.js";var w=e(n(),1),T=r();function _e({form:e,providerKey:t}){let{t:n}=o(`openhands`),{fields:r,values:i,setValue:a,secretExists:s,conflicts:c,credentialsConfigured:l}=e,{status:u,isChecking:d}=g(t),p=b(t)??t;return r.length===0?null:(0,T.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,T.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,T.jsx)(C.Text,{className:`text-sm font-medium text-white`,children:n(f.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,T.jsx)(C.Text,{className:`text-xs text-[#717888]`,children:n(f.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,T.jsx)(h,{status:u,isChecking:d,credentialsConfigured:l,providerName:p,testIdPrefix:`settings-acp-auth`}),(0,T.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,T.jsx)(_,{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,T.jsx)(m,{conflicts:c})]})}function ve({testId:e,items:t,selected:n,isDisabled:r=!1,onToggle:i}){return(0,T.jsx)(`ul`,{"data-testid":`${e}-list`,className:`flex flex-col gap-2.5`,children:t.map(({name:t,description:a})=>(0,T.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,T.jsx)(he,{testId:`${e}-${t}`,name:`${e}-${t}`,isToggled:n.includes(t),isDisabled:r,onToggle:e=>i(t,e),children:(0,T.jsx)(`span`,{className:`font-mono`,children:t})}),a?(0,T.jsx)(C.Text,{className:`text-xs text-tertiary-alt pl-11`,children:a}):null]},t))})}var E=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(` `)}})),ye=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 ee={comment:e.slice(n.index+m+1)};return d.length?[d,ee]:[ee]}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:D}=e(t((e=>{e.quote=E(),e.parse=ye()}))(),1);function O(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 k=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function A(e){return e.map(e=>k.test(e)||e===``?D([e]):e).join(` `)}function be(e){return Array.isArray(e)?{mode:`custom`,selected:e.filter(e=>typeof e==`string`)}:{mode:`standard`,selected:[]}}function xe(e,t){let n=e=>[...new Set(e)].sort().join(`\0`);return n(e)===n(t)}var j=`1.31.0`;function Se(){let e=u();if(!e)return!0;let t=s(e,j);return t===null?!0:t>=0}var Ce={hideTitle:!0},we=`enable_sub_agents`,Te=`enable_switch_llm_tool`,Ee=`tool_concurrency_limit`,De=`mcp_server_refs`,Oe=`npx -y <package-name>`,M=`__custom_model__`,ke={agentType:`openhands`,commandText:``,acpModel:``,isCustomAcpModel:!1};function Ae(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function je(e,t){let n=O(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return ce}function Me(e){return e?.find(e=>e.key===we)}function Ne(e,t){return typeof e==`boolean`?e:t?.default===!0}function Pe(e,t){return typeof e==`boolean`?e:t?.default===!0}function Fe(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function Ie(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,switchLlmToolField:s,switchLlmToolEnabled:c,switchLlmToolSupportedOnProfile:l,toolConcurrencyField:u,toolConcurrency:d,mcpMode:f,selectedMcpServers:p}=e,m={mcp_server_refs:f===`custom`?p:null};if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,...m,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:A(i)||null,acp_args:null}}let h={agent_kind:`openhands`,...m,enable_sub_agents:o};if(s&&l&&(h.enable_switch_llm_tool=c),u){let e=pe(u,d),t=typeof u.default==`number`?u.default:1;h.tool_concurrency_limit=e==null?t:Number(e)}return h}function Le({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=te(),s=t??i?.agent_settings??null,{mutate:u,isPending:m}=ne(),{data:h}=me(i?.agent_settings_schema),g=w.useMemo(()=>h?.sections.flatMap(e=>e.fields),[h]),_=Me(g),b=w.useMemo(()=>Ne(s?.[we],_),[_,s]),[E,ye]=(0,w.useState)(b),D=g?.find(e=>e.key===Te),k=w.useMemo(()=>Pe(s?.[Te],D),[D,s]),[j,Ce]=(0,w.useState)(k),Le=Se(),Re=!!D&&(!e||Le),N=g?.find(e=>e.key===Ee),ze=w.useMemo(()=>{if(!N)return``;let e=s?.[Ee];return de(N,e)},[N,s]),[Be,Ve]=(0,w.useState)(ze),He=e,P=w.useMemo(()=>be(s?.[De]),[s]),[F,Ue]=(0,w.useState)(P.mode),[We,Ge]=(0,w.useState)(P.selected),I=w.useMemo(()=>ge(i?.mcp_config??ee(i?.agent_settings?.mcp_config)).filter(e=>typeof e.name==`string`).map(e=>({name:e.name,description:e.type})),[i]),L=w.useMemo(()=>{let e=I,t=new Set(e.map(({name:e})=>e));return[...e,...P.selected.filter(e=>!t.has(e)).map(e=>({name:e,description:null}))]},[I,P]),R=w.useMemo(()=>L.map(({name:e})=>e).filter(e=>We.includes(e)),[L,We]),Ke=w.useMemo(()=>F===`custom`?R.filter(e=>!I.some(t=>t.name===e)):[],[F,R,I]),[z,qe]=(0,w.useState)(`openhands`),[B,V]=(0,w.useState)(``),[H,U]=(0,w.useState)(``),[Je,W]=(0,w.useState)(!1),Ye=z===`acp`?je(B,x):null,G=v(Ye&&Ye!==`custom`?Ye:null),Xe=(0,w.useRef)(null),Ze=(0,w.useRef)(null),K=(0,w.useRef)(``),[q,J]=(0,w.useState)(ke);(0,w.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(Xe.current!==n)if(Xe.current=n,e?.agent_kind===`acp`){qe(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=se(n),i=Ae(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],...Ae(e?.acp_args)],o=a.length>0?A(a):``;V(o),Ze.current=n??null,K.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``,l=c||S(n)||``,u=!!c&&(!r||!Fe(r,c));U(l),W(u),J({agentType:`acp`,commandText:o,acpModel:l,isCustomAcpModel:u})}else qe(`openhands`),V(``),U(``),Ze.current=null,K.current=``,W(!1),J(ke)},[i,t]),(0,w.useEffect)(()=>{ye(b)},[b]),(0,w.useEffect)(()=>{Ce(k)},[k]),(0,w.useEffect)(()=>{Ve(ze)},[ze]),(0,w.useEffect)(()=>{Ue(P.mode),Ge(P.selected)},[P]);let Qe=(0,w.useRef)(()=>({agent_kind:`openhands`,mcp_server_refs:null,enable_sub_agents:!1})),$e=(0,w.useCallback)(()=>Qe.current(),[]),et=(0,w.useRef)(G);et.current=G;let tt=(0,w.useCallback)(e=>et.current.save(e),[]),nt=(0,w.useCallback)(()=>et.current.reset(),[]),rt=z===`acp`&&O(B).length===0,it=F!==P.mode||!xe(R,P.selected),at=z!==q.agentType||it||(z===`acp`?B!==q.commandText||H!==q.acpModel||Je!==q.isCustomAcpModel:E!==b||j!==k||Be!==ze),ot=G.isDirty,st=at||ot;if((0,w.useEffect)(()=>{!e||!n||n({agentType:z,isValid:!rt,isDirty:st,buildAgentProfileFields:$e,credentials:{isDirty:ot,save:tt,reset:nt}})},[e,n,z,rt,st,ot,$e,tt,nt]),a)return null;let Y=z===`acp`,X=O(B),ct=Y&&X.length===0,Z=je(B,x),Q=se(Z),lt=Q?.available_models??[],ut=lt.length>0,dt=Fe(Q,H),ft=Je||!dt?M:H,pt=!!Q&&X.join(` `)===Q.default_command.join(` `),mt=A(x[0]?.default_command??[])||Oe;Qe.current=()=>Ie({isAcp:Y,selectedPreset:Z,isDefaultProviderCommand:pt,commandTokens:X,acpModel:H,subAgentsEnabled:E,switchLlmToolField:D,switchLlmToolEnabled:j,switchLlmToolSupportedOnProfile:Le,toolConcurrencyField:N,toolConcurrency:Be,mcpMode:F,selectedMcpServers:R});let $=m||G.isSaving,ht=async()=>{if(G.isDirty){if(!await G.save({silent:at}))return;G.reset()}if(at)if(Y){let e=!!(Q&&pt),t=Ze.current,n=B===K.current,i=!!t&&t!==`custom`&&!x.some(e=>e.key===t),a=Y&&n&&i,o=oe(a?t:Q&&pt?Q.key:ce,{command:e?[]:X,model:H.trim()||void 0,allowUnknownServer:a});if(!o)return;u({agent_settings_diff:o},{onError:e=>{d(l(e)||r(f.ERROR$GENERIC))},onSuccess:()=>{c(r(f.SETTINGS$SAVED)),J({agentType:z,commandText:B,acpModel:H,isCustomAcpModel:Je}),K.current=B}})}else{let e={agent_kind:`openhands`,enable_sub_agents:E};if(D&&(e[Te]=j),N){let t;try{t=pe(N,Be)}catch(e){d(e instanceof Error?e.message:r(f.ERROR$GENERIC));return}t!=null&&(e[Ee]=t)}u({agent_settings_diff:e},{onError:e=>{d(l(e)||r(f.ERROR$GENERIC))},onSuccess:()=>{c(r(f.SETTINGS$SAVED)),J({agentType:`openhands`,commandText:``,acpModel:``,isCustomAcpModel:!1})}})}},gt=_?le(r,_.key,_.label):r(f.SCHEMA$ENABLE_SUB_AGENTS$LABEL),_t=_?ue(r,_.key,_.description):r(f.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION),vt=D?le(r,D.key,D.label):r(f.SCHEMA$ENABLE_SWITCH_LLM_TOOL$LABEL),yt=D?ue(r,D.key,D.description):r(f.SCHEMA$ENABLE_SWITCH_LLM_TOOL$DESCRIPTION);return(0,T.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[!e&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(C.H2,{className:`mb-2`,children:r(f.SETTINGS$NAV_AGENT)}),(0,T.jsx)(C.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:r(f.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,T.jsx)(y,{testId:`agent-type-selector`,name:`agent-type`,label:r(f.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:r(f.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:r(f.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:z,onSelectionChange:e=>{if(!e)return;let t=e;if(qe(t),t===`acp`&&!B){let e=x[0];e&&(V(A(e.default_command)),U(S(e.key)??``),W(!1))}else t===`openhands`&&W(!1)}}),!Y&&(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(he,{testId:`agent-settings-enable-sub-agents`,isToggled:E,onToggle:e=>{ye(e)},children:gt}),_t?(0,T.jsx)(C.Paragraph,{className:p(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:_t}):null]}),!Y&&Re?(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(he,{testId:`agent-settings-enable-switch-llm-tool`,isToggled:j,onToggle:e=>{Ce(e)},children:vt}),yt?(0,T.jsx)(C.Paragraph,{className:p(re,`text-tertiary-alt text-xs leading-5`),children:yt}):null]}):null,!Y&&N?(0,T.jsx)(fe,{field:N,value:Be,isDisabled:$,onChange:Ve}):null,He?(0,T.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,T.jsx)(C.Text,{className:`text-sm`,children:r(f.SETTINGS$AGENT_PROFILE_MCP)}),(0,T.jsx)(y,{testId:`agent-settings-mcp-mode`,name:`agent-mcp-mode`,label:``,items:[{key:`standard`,label:r(f.SETTINGS$AGENT_PROFILE_MCP_ALL)},{key:`custom`,label:r(f.SETTINGS$AGENT_PROFILE_MCP_CHOOSE)}],selectedKey:F,isDisabled:$,onSelectionChange:e=>{if(!e)return;let t=e;Ue(t),t===`custom`&&We.length===0&&Ge(I.map(({name:e})=>e))}}),L.length>0?(0,T.jsx)(ve,{testId:`agent-settings-mcp`,items:L,selected:F===`custom`?R:L.map(({name:e})=>e),isDisabled:$||F===`standard`,onToggle:(e,t)=>Ge(n=>t?[...n,e]:n.filter(t=>t!==e))}):(0,T.jsx)(C.Text,{className:`text-xs text-tertiary-alt`,children:r(f.SETTINGS$AGENT_PROFILE_MCP_NONE)}),Ke.length>0?(0,T.jsx)(C.Text,{testId:`agent-settings-mcp-dangling`,className:`text-xs text-danger`,children:r(f.SETTINGS$AGENT_PROFILE_MCP_DANGLING,{names:Ke.join(`, `)})}):null,(0,T.jsx)(C.Text,{className:`text-xs text-tertiary-alt`,children:r(F===`custom`?f.SETTINGS$AGENT_PROFILE_MCP_CHOOSE_HINT:f.SETTINGS$AGENT_PROFILE_MCP_ALL_HINT)})]}):null,Y&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(y,{testId:`agent-preset-selector`,name:`agent-preset`,label:r(f.SETTINGS$AGENT_PRESET),items:[...x.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:r(f.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Z,onSelectionChange:e=>{if(!e)return;let t=String(e),n=se(t);n?(V(A(n.default_command)),U(S(t)??``),W(!1)):t===`custom`&&(V(``),U(``),W(!0))}}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,T.jsx)(C.Text,{className:`text-sm`,children:r(f.SETTINGS$AGENT_COMMAND)}),(0,T.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:B,placeholder:mt,onChange:e=>{let t=e.target.value,n=je(B,x),r=je(t,x);r!==n&&(U(S(r)??``),W(!1)),V(t)}}),(0,T.jsx)(C.Text,{className:`text-xs text-[#717888]`,children:r(f.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[ut&&(0,T.jsx)(y,{testId:`agent-model-selector`,name:`agent-model`,label:r(f.SETTINGS$AGENT_MODEL),items:[...lt.map(e=>({key:e.id,label:e.label})),{key:M,label:r(f.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:ft,onSelectionChange:e=>{if(!e)return;let t=String(e);t===M?(W(!0),U(``)):(W(!1),U(t))}}),ft===M&&(0,T.jsx)(ae,{testId:`agent-model-input`,label:r(ut?f.SETTINGS$AGENT_CUSTOM_MODEL:f.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:H,showOptionalTag:!0,onChange:e=>{U(e)}}),(0,T.jsx)(C.Text,{className:`text-xs text-[#717888]`,children:r(f.SETTINGS$AGENT_MODEL_HINT)})]})]}),Y&&Z!==`custom`&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`hr`,{className:`border-[#3D4046]`}),(0,T.jsx)(_e,{form:G,providerKey:Z})]}),!e&&(0,T.jsx)(`div`,{children:(0,T.jsx)(ie,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:$||!st||ct,onClick:ht,children:r($?f.SETTINGS$SAVING:f.SETTINGS$SAVE_CHANGES)})})]})}var Re=i(function(){return(0,T.jsx)(a,{to:`/settings/agents`,replace:!0})});export{O as i,Re as n,Ce as r,Le as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./agent-settings-BZJHtaIK.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-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{t as o}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{n as s}from"./navigation-context-CQZwH_tC.js";import{c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as l}from"./close-ScPlnwyq.js";import{r as u}from"./typography-DgcLGdHk.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]=o(`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)(c,{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)(u.Paragraph,{className:`text-sm font-medium`,children:m(i.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(u.Paragraph,{className:`text-sm font-medium`,children:[m(i.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(u.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)(l,{})})]}):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-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-D-gOfhmN.js";import{t as o}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{n as s}from"./navigation-context-CQZwH_tC.js";import{c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as l}from"./close-ScPlnwyq.js";import{r as u}from"./typography-NarNyelM.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]=o(`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)(c,{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)(u.Paragraph,{className:`text-sm font-medium`,children:m(i.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(u.Paragraph,{className:`text-sm font-medium`,children:[m(i.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(u.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)(l,{})})]}):null}export{p as AlertBanner};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{$ as i,r as a}from"./active-backend-context-BnH4-L8h.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{n as c,p as l}from"./agent-server-client-options-EHB23gyx.js";import{n as u,o as d}from"./backend-form-modal-DxisQV_6.js";import{f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{r as p,t as m}from"./modal-body-C24WsdFb.js";import{t as h}from"./brand-button-CUMfjb99.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),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 f(c({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),l(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),i(t,401))T(e(o.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(o.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:s(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,p(`md`),m),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(o.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(u,{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)(d,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(o.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(h,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})})})]})})}export{v as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{$ as i,r as a}from"./active-backend-context-BsLfwrXB.js";import{K as o,t as s}from"./utils-D-gOfhmN.js";import{n as c,p as l}from"./agent-server-client-options-EHB23gyx.js";import{n as u,o as d}from"./backend-form-modal-DeaUJIik.js";import{f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{r as p,t as m}from"./modal-body-DBweM2EN.js";import{t as h}from"./brand-button-mQq2Ld1I.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),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 f(c({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),l(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),i(t,401))T(e(o.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(o.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:s(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,p(`md`),m),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(o.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(u,{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)(d,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(o.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(h,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})})})]})})}export{v as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{_ as a,ct as o,dt as s,ft as c,n as l,st as u}from"./active-backend-context-BnH4-L8h.js";import{K as d}from"./utils-BgLSZdyy.js";import{r as f}from"./use-free-models-gCsJ5BV0.js";import{t as p}from"./settings-CKqk8ZnH.js";import{n as m}from"./use-settings-C2KKQKVC.js";import{t as h}from"./use-save-settings-Dapkf4cC.js";import{t as g}from"./brand-button-CUMfjb99.js";import{i as _,n as v,r as y,t as b}from"./color-themes-DTj5Ylbr.js";import{t as x}from"./navigation-link-Bxo3-4vo.js";import{t as S}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as C}from"./settings-input-dVuzapBA.js";import{t as w}from"./use-llm-profiles-SWsuFmFu.js";import{n as T}from"./format-model-name-Dfh9Udrx.js";import{c as E,o as D,t as O}from"./sidebar-onboarding-checklist-storage-TfvNNnnr.js";import{n as k,t as A}from"./switch-skeleton-DwOoCqaL.js";import{t as j}from"./settings-switch-DDd1cQ8t.js";var M=e(t(),1),N=n();function P({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,N.jsx)(S,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:c.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function F(){let{t:e}=i(`openhands`),t=M.useCallback(e=>{if(!e)return;let t=e;v(t),y(t)},[]);return(0,N.jsx)(S,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:b.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:_(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function I(){return(0,M.useSyncExternalStore)(D,O,()=>!1)}function ee(){let{t:e}=i(`openhands`),t=I();return(0,N.jsx)(j,{testId:`show-getting-started-checklist-switch`,isToggled:!t,onToggle:e=>{E(!e)},children:e(d.SETTINGS$SHOW_GETTING_STARTED_CHECKLIST)})}function L(){return(0,N.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,N.jsx)(k,{}),(0,N.jsx)(A,{}),(0,N.jsx)(A,{})]})}var R=`__automatic__`;function z(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=h(),{data:r,isLoading:_}=m(),v=l().backend.kind===`cloud`,{data:y,isLoading:b}=w(),E=f(),[D,O]=M.useState(!1),[k,A]=M.useState(!1),[I,z]=M.useState(!1),[B,V]=M.useState(!1),[H,U]=M.useState(!1),[W,G]=M.useState(void 0),K=M.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!y||y.profiles.some(t=>t.name===e)?e:null},[y,r?.title_llm_profile]),q=W===void 0?K:W,J=M.useMemo(()=>[{key:R,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...y?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:T(t.model,E)??t.model}):t.name}))??[]],[y?.profiles,E,e]),Y=n=>{let r=n.get(`language-input`)?.toString(),i=c.find(({label:e})=>e===r)?.value||p.language,l=v?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,f=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||p.git_user_name,h=n.get(`git-user-email-input`)?.toString()||p.git_user_email;t({language:i,...!v&&{user_consents_to_analytics:l},enable_sound_notifications:f,git_user_name:m,git_user_email:h,title_llm_profile:q},{onSuccess:()=>{a(l?`granted`:`denied`),o(e(d.SETTINGS$SAVED))},onError:t=>{u(s(t)||e(d.ERROR$GENERIC))},onSettled:()=>{O(!1),A(!1),z(!1),V(!1),U(!1),G(void 0)}})},X=e=>{let t=c.find(({label:t})=>t===e)?.label,n=c.find(({value:e})=>e===r?.language)?.label;O(t!==n)},Z=e=>{A(e!==(r?.user_consents_to_analytics??!0))},Q=e=>{z(e!==!!r?.enable_sound_notifications)},te=e=>{let t=r?.git_user_name;V(e!==t)},ne=e=>{let t=r?.git_user_email;U(e!==t)},re=!D&&!k&&!I&&q===K&&!B&&!H,$=!r||_||b||n;return(0,N.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:Y,className:`flex flex-col gap-6`,children:[$&&(0,N.jsx)(L,{}),!$&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(P,{name:`language-input`,defaultKey:r.language,onChange:X}),(0,N.jsx)(F,{}),(0,N.jsx)(j,{testId:`enable-analytics-switch`,name:v?void 0:`enable-analytics-switch`,defaultIsToggled:v?!0:r.user_consents_to_analytics??!0,isToggled:v?!0:void 0,isDisabled:v,onToggle:v?void 0:Z,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,N.jsx)(j,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Q,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,N.jsx)(S,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:J,selectedKey:q??R,onSelectionChange:e=>{let t=e?.toString();G(!t||t===R?null:t)}}),(0,N.jsx)(x,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(C,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:te,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,N.jsx)(C,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:ne,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,N.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,N.jsxs)(g,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||re,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var B=r(z);export{B as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{_ as a,ct as o,dt as s,ft as c,n as l,st as u}from"./active-backend-context-BsLfwrXB.js";import{K as d}from"./utils-D-gOfhmN.js";import{r as f}from"./use-free-models-Ci3FkKEm.js";import{t as p}from"./settings-CKqk8ZnH.js";import{n as m}from"./use-settings-BWIH5EuN.js";import{t as h}from"./use-save-settings-CikTu5xV.js";import{t as g}from"./brand-button-mQq2Ld1I.js";import{i as _,n as v,r as y,t as b}from"./color-themes-DTj5Ylbr.js";import{t as x}from"./navigation-link-Bxo3-4vo.js";import{t as S}from"./settings-dropdown-input-BRR2OZwi.js";import{t as C}from"./settings-input-Cm4VxUon.js";import{t as w}from"./use-llm-profiles-xtCBMbef.js";import{n as T}from"./format-model-name-Dfh9Udrx.js";import{c as E,o as D,t as O}from"./sidebar-onboarding-checklist-storage-BP1kzn6p.js";import{n as k,t as A}from"./switch-skeleton-DwOoCqaL.js";import{t as j}from"./settings-switch-seaSJc7t.js";var M=e(t(),1),N=n();function P({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,N.jsx)(S,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:c.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function F(){let{t:e}=i(`openhands`),t=M.useCallback(e=>{if(!e)return;let t=e;v(t),y(t)},[]);return(0,N.jsx)(S,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:b.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:_(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function I(){return(0,M.useSyncExternalStore)(D,O,()=>!1)}function ee(){let{t:e}=i(`openhands`),t=I();return(0,N.jsx)(j,{testId:`show-getting-started-checklist-switch`,isToggled:!t,onToggle:e=>{E(!e)},children:e(d.SETTINGS$SHOW_GETTING_STARTED_CHECKLIST)})}function L(){return(0,N.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,N.jsx)(k,{}),(0,N.jsx)(A,{}),(0,N.jsx)(A,{})]})}var R=`__automatic__`;function z(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=h(),{data:r,isLoading:_}=m(),v=l().backend.kind===`cloud`,{data:y,isLoading:b}=w(),E=f(),[D,O]=M.useState(!1),[k,A]=M.useState(!1),[I,z]=M.useState(!1),[B,V]=M.useState(!1),[H,U]=M.useState(!1),[W,G]=M.useState(void 0),K=M.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!y||y.profiles.some(t=>t.name===e)?e:null},[y,r?.title_llm_profile]),q=W===void 0?K:W,J=M.useMemo(()=>[{key:R,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...y?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:T(t.model,E)??t.model}):t.name}))??[]],[y?.profiles,E,e]),Y=n=>{let r=n.get(`language-input`)?.toString(),i=c.find(({label:e})=>e===r)?.value||p.language,l=v?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,f=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||p.git_user_name,h=n.get(`git-user-email-input`)?.toString()||p.git_user_email;t({language:i,...!v&&{user_consents_to_analytics:l},enable_sound_notifications:f,git_user_name:m,git_user_email:h,title_llm_profile:q},{onSuccess:()=>{a(l?`granted`:`denied`),o(e(d.SETTINGS$SAVED))},onError:t=>{u(s(t)||e(d.ERROR$GENERIC))},onSettled:()=>{O(!1),A(!1),z(!1),V(!1),U(!1),G(void 0)}})},X=e=>{let t=c.find(({label:t})=>t===e)?.label,n=c.find(({value:e})=>e===r?.language)?.label;O(t!==n)},Z=e=>{A(e!==(r?.user_consents_to_analytics??!0))},Q=e=>{z(e!==!!r?.enable_sound_notifications)},te=e=>{let t=r?.git_user_name;V(e!==t)},ne=e=>{let t=r?.git_user_email;U(e!==t)},re=!D&&!k&&!I&&q===K&&!B&&!H,$=!r||_||b||n;return(0,N.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:Y,className:`flex flex-col gap-6`,children:[$&&(0,N.jsx)(L,{}),!$&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(P,{name:`language-input`,defaultKey:r.language,onChange:X}),(0,N.jsx)(F,{}),(0,N.jsx)(j,{testId:`enable-analytics-switch`,name:v?void 0:`enable-analytics-switch`,defaultIsToggled:v?!0:r.user_consents_to_analytics??!0,isToggled:v?!0:void 0,isDisabled:v,onToggle:v?void 0:Z,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,N.jsx)(j,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Q,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,N.jsx)(S,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:J,selectedKey:q??R,onSelectionChange:e=>{let t=e?.toString();G(!t||t===R?null:t)}}),(0,N.jsx)(x,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(C,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:te,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,N.jsx)(C,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:ne,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,N.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,N.jsxs)(g,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||re,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var B=r(z);export{B as default};