@openhands/agent-canvas 1.18.0 → 1.20.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 (420) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-DOKcGeaV.js +1 -0
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
  9. package/build/assets/agent-settings-BnzyTgCb.js +2 -0
  10. package/build/assets/agent-settings-CeXj3xK-.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/automation-detail-CF2SweVs.js +3 -0
  15. package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
  18. package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/automations-list-yK7ETmYP.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
  42. package/build/assets/conversation-XRsI28ZM.js +1 -0
  43. package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
  49. package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
  50. package/build/assets/empty-state-B5advKVW.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
  60. package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/home-BGaB0EeK.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
  68. package/build/assets/index-home-6Y_Y7kOo.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
  75. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  79. package/build/assets/manifest-23d79467.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
  82. package/build/assets/mcp-CoUOIGBF.js +1 -0
  83. package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
  90. package/build/assets/onboarding-Cc4Av7bi.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.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-yISBVUKu.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
  100. package/build/assets/root-D1y82Lhg.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
  123. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  124. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
  125. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
  126. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
  127. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
  128. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
  129. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
  130. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
  131. package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
  132. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
  133. package/build/assets/trash-D1QMHInX.js +1 -0
  134. package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
  135. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
  136. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  137. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  138. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  139. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
  140. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  141. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
  142. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  143. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  145. package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
  146. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  147. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  148. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
  149. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  150. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
  151. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  152. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  153. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  154. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
  155. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  156. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  157. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
  158. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
  159. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  160. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  161. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
  162. package/build/assets/utils-CbjwNcR-.js +1 -0
  163. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  164. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  165. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
  166. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
  167. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
  168. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
  169. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +18 -1
  172. package/build/locales/ca/openhands.json +18 -1
  173. package/build/locales/de/openhands.json +18 -1
  174. package/build/locales/en/openhands.json +18 -1
  175. package/build/locales/es/openhands.json +18 -1
  176. package/build/locales/fr/openhands.json +18 -1
  177. package/build/locales/it/openhands.json +18 -1
  178. package/build/locales/ja/openhands.json +18 -1
  179. package/build/locales/ko-KR/openhands.json +18 -1
  180. package/build/locales/no/openhands.json +18 -1
  181. package/build/locales/pt/openhands.json +18 -1
  182. package/build/locales/tr/openhands.json +18 -1
  183. package/build/locales/uk/openhands.json +18 -1
  184. package/build/locales/zh-CN/openhands.json +18 -1
  185. package/build/locales/zh-TW/openhands.json +18 -1
  186. package/config/defaults.json +3 -3
  187. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  188. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  189. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  190. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  191. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  192. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  193. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  194. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  195. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  196. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  197. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  198. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  199. package/dist/config/defaults.cjs +1 -1
  200. package/dist/config/defaults.cjs.map +1 -1
  201. package/dist/config/defaults.js +3 -3
  202. package/dist/config/defaults.js.map +1 -1
  203. package/dist/constants/acp-providers.cjs +1 -1
  204. package/dist/constants/acp-providers.cjs.map +1 -1
  205. package/dist/constants/acp-providers.d.ts +0 -5
  206. package/dist/constants/acp-providers.js +20 -16
  207. package/dist/constants/acp-providers.js.map +1 -1
  208. package/dist/constants/profile-scope.d.ts +21 -0
  209. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  210. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  211. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  212. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  213. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  214. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  215. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  216. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  217. package/dist/hooks/query/query-keys.cjs +1 -1
  218. package/dist/hooks/query/query-keys.cjs.map +1 -1
  219. package/dist/hooks/query/query-keys.d.ts +1 -0
  220. package/dist/hooks/query/query-keys.js +10 -1
  221. package/dist/hooks/query/query-keys.js.map +1 -1
  222. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  223. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  224. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  225. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  226. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  227. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  228. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  229. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  230. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  231. package/dist/hooks/use-drag-resize.cjs +1 -1
  232. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  233. package/dist/hooks/use-drag-resize.js +8 -9
  234. package/dist/hooks/use-drag-resize.js.map +1 -1
  235. package/dist/i18n/declaration.cjs +1 -1
  236. package/dist/i18n/declaration.cjs.map +1 -1
  237. package/dist/i18n/declaration.d.ts +18 -1
  238. package/dist/i18n/declaration.js +1 -1
  239. package/dist/i18n/declaration.js.map +1 -1
  240. package/dist/i18n/translation.cjs +3 -3
  241. package/dist/i18n/translation.cjs.map +1 -1
  242. package/dist/i18n/translation.js +289 -0
  243. package/dist/i18n/translation.js.map +1 -1
  244. package/dist/locales/ar/openhands.json +18 -1
  245. package/dist/locales/ca/openhands.json +18 -1
  246. package/dist/locales/de/openhands.json +18 -1
  247. package/dist/locales/en/openhands.json +18 -1
  248. package/dist/locales/es/openhands.json +18 -1
  249. package/dist/locales/fr/openhands.json +18 -1
  250. package/dist/locales/it/openhands.json +18 -1
  251. package/dist/locales/ja/openhands.json +18 -1
  252. package/dist/locales/ko-KR/openhands.json +18 -1
  253. package/dist/locales/no/openhands.json +18 -1
  254. package/dist/locales/pt/openhands.json +18 -1
  255. package/dist/locales/tr/openhands.json +18 -1
  256. package/dist/locales/uk/openhands.json +18 -1
  257. package/dist/locales/zh-CN/openhands.json +18 -1
  258. package/dist/locales/zh-TW/openhands.json +18 -1
  259. package/dist/manifests/automation-setup.cjs.map +1 -1
  260. package/dist/manifests/automation-setup.js.map +1 -1
  261. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  262. package/dist/manifests/manifest-local-validation.js.map +1 -1
  263. package/dist/manifests/manifest-validation.cjs +1 -1
  264. package/dist/manifests/manifest-validation.cjs.map +1 -1
  265. package/dist/manifests/manifest-validation.js +2 -2
  266. package/dist/manifests/manifest-validation.js.map +1 -1
  267. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  268. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  269. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  270. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  271. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  272. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  273. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  274. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  275. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  276. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  277. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  278. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  279. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  280. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  281. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  282. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  283. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  284. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  285. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  286. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  287. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  288. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  289. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  290. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  291. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  292. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  293. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  294. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  295. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  296. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  297. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  298. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  299. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  300. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  301. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  302. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  303. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  304. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  305. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  306. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  307. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  308. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  309. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  310. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  311. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  312. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  313. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  314. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  315. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  316. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  317. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  318. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  319. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  320. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  321. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  322. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  326. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  327. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  328. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  329. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  330. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  331. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  332. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  333. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  334. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  335. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  336. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  337. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  338. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  339. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  340. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  341. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  342. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  343. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  344. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
  345. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  346. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  347. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  348. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  349. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  350. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  351. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  352. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  353. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  354. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  355. package/dist/package.cjs +1 -1
  356. package/dist/package.cjs.map +1 -1
  357. package/dist/package.js +3 -3
  358. package/dist/package.js.map +1 -1
  359. package/dist/routes/agent-settings.d.ts +11 -0
  360. package/dist/types/automation.cjs.map +1 -1
  361. package/dist/types/automation.d.ts +26 -2
  362. package/dist/types/automation.js.map +1 -1
  363. package/dist/utils/automation-disabled-reason.cjs +2 -0
  364. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  365. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  366. package/dist/utils/automation-disabled-reason.js +19 -0
  367. package/dist/utils/automation-disabled-reason.js.map +1 -0
  368. package/dist/utils/parse-git-remote-url.cjs +1 -1
  369. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  370. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  371. package/dist/utils/parse-git-remote-url.js +20 -13
  372. package/dist/utils/parse-git-remote-url.js.map +1 -1
  373. package/package.json +3 -3
  374. package/scripts/check-sdk-version-sync.mjs +79 -8
  375. package/scripts/dev-safe.mjs +14 -1
  376. package/scripts/docker-build.mjs +3 -0
  377. package/scripts/static-server.mjs +24 -7
  378. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  379. package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
  380. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  381. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  382. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  383. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  384. package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
  385. package/build/assets/automations-list-DEPVNud3.js +0 -1
  386. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  387. package/build/assets/conversation-edjzrv5w.js +0 -1
  388. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  389. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  390. package/build/assets/empty-state-FK_s1B60.js +0 -1
  391. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  392. package/build/assets/home-BM5_Wz_R.js +0 -1
  393. package/build/assets/home-Ivfm7KC4.js +0 -1
  394. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  395. package/build/assets/index-home-td9BN2T3.js +0 -1
  396. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  397. package/build/assets/link-external-BNZzCM1I.js +0 -1
  398. package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
  399. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  400. package/build/assets/manifest-bfeccb98.js +0 -1
  401. package/build/assets/mcp-CraxoXQv.js +0 -1
  402. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  403. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  404. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  405. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  406. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  407. package/build/assets/root-CM6IZHlg.css +0 -1
  408. package/build/assets/root-DdFkodKW.js +0 -2
  409. package/build/assets/trash-Ckh7yCaB.js +0 -1
  410. package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
  411. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  412. package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
  413. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  414. package/build/assets/utils-BgLSZdyy.js +0 -1
  415. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  416. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
  417. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  418. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  419. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
  420. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
@@ -3,8 +3,15 @@
3
3
  /**
4
4
  * Check SDK Version Sync
5
5
  *
6
- * Verifies that the released automation package (openhands-automation on PyPI)
7
- * uses the SDK version expected for that automation release for all agent SDK libraries:
6
+ * Verifies two things against versions.agentServer in config/defaults.json:
7
+ *
8
+ * 1. The local @openhands/typescript-client pin in package.json. Canvas renders
9
+ * the ACP provider picker from that generated registry mirror but launches
10
+ * the adapter through the agent-server image, so a skew ships a picker
11
+ * offering models and launch commands agent-server does not implement.
12
+ *
13
+ * 2. That the released automation package (openhands-automation on PyPI)
14
+ * uses the SDK version expected for that automation release for all agent SDK libraries:
8
15
  * - openhands-sdk
9
16
  * - openhands-tools
10
17
  * - openhands-workspace
@@ -19,7 +26,7 @@
19
26
  *
20
27
  * Usage:
21
28
  * node scripts/check-sdk-version-sync.mjs
22
- * EXPECTED_SDK_VERSION=1.46.0 node scripts/check-sdk-version-sync.mjs
29
+ * EXPECTED_SDK_VERSION=1.49.1 node scripts/check-sdk-version-sync.mjs
23
30
  * node scripts/check-sdk-version-sync.mjs --check-pypi
24
31
  *
25
32
  * Environment variables:
@@ -78,7 +85,7 @@ Triggering from other repos:
78
85
  -H "Authorization: token \$GITHUB_TOKEN" \\
79
86
  -H "Accept: application/vnd.github.v3+json" \\
80
87
  https://api.github.com/repos/OpenHands/OpenHands/dispatches \\
81
- -d '{"event_type": "sdk-version-check", "client_payload": {"version": "1.46.0"}}'
88
+ -d '{"event_type": "sdk-version-check", "client_payload": {"version": "1.49.1"}}'
82
89
  `);
83
90
  process.exit(0);
84
91
  }
@@ -101,6 +108,11 @@ const SDK_PACKAGES = [
101
108
  "openhands-agent-server",
102
109
  ];
103
110
 
111
+ // Mirrors the SDK's ACP provider registry. Must track versions.agentServer:
112
+ // the picker is rendered from this pin but the adapter is launched by that
113
+ // image, so a skew advertises models the running agent-server cannot run.
114
+ const CLIENT_PACKAGE_NAME = "@openhands/typescript-client";
115
+
104
116
  // Configurable automation package (can be overridden via env)
105
117
  const AUTOMATION_PACKAGE_NAME = process.env.AUTOMATION_PACKAGE_NAME || "openhands-automation";
106
118
 
@@ -173,6 +185,34 @@ function getExpectedVersion() {
173
185
  };
174
186
  }
175
187
 
188
+ /**
189
+ * Compare the local typescript-client pin against the expected SDK version.
190
+ * Returns a mismatch descriptor, or null when they agree.
191
+ */
192
+ function findClientPinMismatch(pinnedVersion, expectedVersion) {
193
+ if (!pinnedVersion) {
194
+ return { package: CLIENT_PACKAGE_NAME, expected: expectedVersion, actual: null };
195
+ }
196
+ // A range would reintroduce the skew this check exists to catch.
197
+ if (!/^[0-9]/.test(pinnedVersion)) {
198
+ return { package: CLIENT_PACKAGE_NAME, expected: expectedVersion, actual: pinnedVersion };
199
+ }
200
+ if (versionsEqual(pinnedVersion, expectedVersion)) {
201
+ return null;
202
+ }
203
+ return { package: CLIENT_PACKAGE_NAME, expected: expectedVersion, actual: pinnedVersion };
204
+ }
205
+
206
+ /**
207
+ * Read the typescript-client pin from package.json.
208
+ */
209
+ function readClientPin() {
210
+ const pkg = JSON.parse(
211
+ readFileSync(join(projectRoot, "package.json"), "utf-8"),
212
+ );
213
+ return pkg.dependencies?.[CLIENT_PACKAGE_NAME] ?? null;
214
+ }
215
+
176
216
  /**
177
217
  * Fetch the latest version of a package from PyPI
178
218
  */
@@ -260,9 +300,9 @@ async function fetchPyPIDependencies(packageName, version) {
260
300
  * Parse PyPI requires_dist array and extract SDK package versions
261
301
  *
262
302
  * PyPI returns dependencies in PEP 508 format like:
263
- * "openhands-sdk>=1.46.0,<2.0.0"
264
- * "openhands-tools==1.46.0"
265
- * "openhands-workspace (>=1.46.0)"
303
+ * "openhands-sdk>=1.49.1,<2.0.0"
304
+ * "openhands-tools==1.49.1"
305
+ * "openhands-workspace (>=1.49.1)"
266
306
  */
267
307
  function parseSdkVersionsFromRequiresDist(requiresDist) {
268
308
  const versions = {};
@@ -276,7 +316,7 @@ function parseSdkVersionsFromRequiresDist(requiresDist) {
276
316
  }
277
317
 
278
318
  // Extract the version number - look for patterns like:
279
- // ">=1.46.0", "==1.46.0", "(>=1.46.0)", "~=1.46.0"
319
+ // ">=1.49.1", "==1.49.1", "(>=1.49.1)", "~=1.49.1"
280
320
  // After the package name and before any comma or closing paren
281
321
  const versionPattern = /[><=~!]+\s*([0-9]+(?:\.[0-9]+)*)/;
282
322
  const match = dep.match(versionPattern);
@@ -308,6 +348,34 @@ async function main() {
308
348
  `Expected automation SDK version: ${colors.green}${expectedVersion}${colors.reset} (from ${versionSource})`,
309
349
  );
310
350
 
351
+ // Offline, so it runs first and fails fast without the PyPI round trip.
352
+ const clientMismatch = findClientPinMismatch(readClientPin(), expectedVersion);
353
+ if (clientMismatch) {
354
+ console.log("");
355
+ console.log(
356
+ ` ${CLIENT_PACKAGE_NAME.padEnd(30)} ${colors.red}✗ ${clientMismatch.actual ?? "(absent)"} (expected ${expectedVersion})${colors.reset}`,
357
+ );
358
+ console.log("");
359
+ console.log(`${colors.red}Version mismatch detected!${colors.reset}`);
360
+ console.log("");
361
+ console.log(
362
+ `${CLIENT_PACKAGE_NAME} mirrors the SDK's ACP provider registry that Canvas renders the`,
363
+ );
364
+ console.log(
365
+ `ACP picker from, but the adapter is launched by agent-server ${expectedVersion}. A skew ships a`,
366
+ );
367
+ console.log("picker offering models and launch commands that agent-server does not implement.");
368
+ console.log("");
369
+ console.log("To fix, update one of the following:");
370
+ console.log(` 1. Pin ${CLIENT_PACKAGE_NAME} to ${expectedVersion} in package.json`);
371
+ console.log(" 2. Update versions.agentServer in config/defaults.json");
372
+ console.log("");
373
+ process.exit(1);
374
+ }
375
+ console.log(
376
+ `Client registry pin: ${colors.green}${CLIENT_PACKAGE_NAME}@${expectedVersion}${colors.reset} (matches versions.agentServer)`,
377
+ );
378
+
311
379
  // Get automation version from env var or config/defaults.json
312
380
  const { version: automationVersion, source: automationSource } = getAutomationVersion();
313
381
  console.log(
@@ -422,7 +490,10 @@ export {
422
490
  normalizeVersion,
423
491
  versionsEqual,
424
492
  parseSdkVersionsFromRequiresDist,
493
+ findClientPinMismatch,
494
+ readClientPin,
425
495
  SDK_PACKAGES,
496
+ CLIENT_PACKAGE_NAME,
426
497
  AUTOMATION_PACKAGE_NAME,
427
498
  };
428
499
 
@@ -421,7 +421,7 @@ export const AGENT_SERVER_IMPORT_MODULES = "canvas_ui_tool";
421
421
  * edits are picked up without a manual reinstall. The agent-server itself
422
422
  * is rebuilt from local source on each invocation (--reinstall).
423
423
  * - OH_AGENT_SERVER_GIT_REF: Git commit SHA or branch name
424
- * - OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "1.46.0")
424
+ * - OH_AGENT_SERVER_VERSION: Specific PyPI version (e.g., "1.49.1")
425
425
  *
426
426
  * If none are set, defaults to the released version specified by
427
427
  * DEFAULT_AGENT_SERVER_VERSION. Set OH_AGENT_SERVER_GIT_REF to use a
@@ -789,8 +789,21 @@ export function buildAgentServerTelemetryEnv(env = process.env) {
789
789
  */
790
790
  export function buildAgentServerEnv(config, options = {}) {
791
791
  const { vscodeBasePath = null, env = process.env } = options;
792
+ const conversationRuntimeEnv = Object.fromEntries(
793
+ [
794
+ "OH_CONVERSATION_RUNTIME",
795
+ "OH_CONVERSATION_IMAGE",
796
+ "OH_CONVERSATION_CONTAINER_MEMORY",
797
+ "OH_CONVERSATION_CONTAINER_CPUS",
798
+ "OH_CONVERSATION_CONTAINER_PIDS_LIMIT",
799
+ "OH_CONVERSATION_CONTAINER_STARTUP_TIMEOUT",
800
+ ]
801
+ .filter((key) => env[key] !== undefined)
802
+ .map((key) => [key, env[key]]),
803
+ );
792
804
  return {
793
805
  ...buildAgentServerTelemetryEnv(env),
806
+ ...conversationRuntimeEnv,
794
807
  // Force Python to use UTF-8 for all file I/O and streams.
795
808
  //
796
809
  // On Windows, Python defaults to the system ANSI codepage (e.g. cp1252).
@@ -24,6 +24,7 @@ const config = JSON.parse(
24
24
  );
25
25
 
26
26
  const agentServerImage = `${config.images.agentServer}:${config.versions.agentServer}-python`;
27
+ const agentServerVersion = config.versions.agentServer;
27
28
  const automationVersion = config.versions.automation;
28
29
  const canvasBasePath = config.paths.canvasBasePath;
29
30
 
@@ -50,6 +51,8 @@ const cmd = [
50
51
  "--build-arg",
51
52
  `AGENT_SERVER_IMAGE=${agentServerImage}`,
52
53
  "--build-arg",
54
+ `AGENT_SERVER_VERSION=${agentServerVersion}`,
55
+ "--build-arg",
53
56
  `AUTOMATION_VERSION=${automationVersion}`,
54
57
  "--build-arg",
55
58
  `VITE_BASE_PATH=${canvasBasePath}`,
@@ -345,6 +345,23 @@ ROUTING:
345
345
  * `isDoNotTrackEnabled()` in `#/services/telemetry`. Enabled by
346
346
  * AGENT_CANVAS_DISABLE_TELEMETRY=1 or the --disable-telemetry flag.
347
347
  */
348
+
349
+ /**
350
+ * Serialize a value into a safe JavaScript literal for inclusion in an inline <script> tag.
351
+ * Escapes characters that could terminate or manipulate the surrounding HTML context:
352
+ * - '<' -> \u003c (prevents </script> breakout)
353
+ * - '>' -> \u003e (prevents premature tag closing in some contexts)
354
+ * - '\u2028' -> \u2028 (prevents syntax errors in JS parsers)
355
+ * - '\u2029' -> \u2029 (prevents syntax errors in JS parsers)
356
+ */
357
+ export function serializeForInlineScript(value) {
358
+ return JSON.stringify(value)
359
+ .replace(/</g, "\\u003c")
360
+ .replace(/>/g, "\\u003e")
361
+ .replace(/\u2028/g, "\\u2028")
362
+ .replace(/\u2029/g, "\\u2029");
363
+ }
364
+
348
365
  function makeConfigInjectionScript(
349
366
  sessionApiKey,
350
367
  authRequired,
@@ -357,7 +374,7 @@ function makeConfigInjectionScript(
357
374
  const parts = [];
358
375
 
359
376
  if (sessionApiKey) {
360
- const keyLiteral = JSON.stringify(sessionApiKey);
377
+ const keyLiteral = serializeForInlineScript(sessionApiKey);
361
378
  // Window global — read at module init by getBakedSessionApiKey().
362
379
  // Set first so it's available even if the localStorage write throws.
363
380
  parts.push(`window.__AGENT_CANVAS_SESSION_API_KEY__=${keyLiteral};`);
@@ -383,28 +400,28 @@ function makeConfigInjectionScript(
383
400
  if (runtimeServicesInfo) {
384
401
  // Stored as the raw JSON string so the browser-side parser
385
402
  // (parseRuntimeServicesInfo) can JSON.parse it exactly like the
386
- // VITE_RUNTIME_SERVICES_INFO env var. JSON.stringify produces a safe JS
403
+ // VITE_RUNTIME_SERVICES_INFO env var. serializeForInlineScript produces a safe JS
387
404
  // string literal for the inline <script>.
388
405
  parts.push(
389
- `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__=${JSON.stringify(runtimeServicesInfo)};`,
406
+ `window.__AGENT_CANVAS_RUNTIME_SERVICES_INFO__=${serializeForInlineScript(runtimeServicesInfo)};`,
390
407
  );
391
408
  }
392
409
 
393
410
  if (lockToCloud) {
394
411
  parts.push(
395
- `window.__AGENT_CANVAS_LOCK_TO_CLOUD__=${JSON.stringify(lockToCloud)};`,
412
+ `window.__AGENT_CANVAS_LOCK_TO_CLOUD__=${serializeForInlineScript(lockToCloud)};`,
396
413
  );
397
414
  }
398
415
 
399
416
  if (basePath && basePath !== "/") {
400
417
  parts.push(
401
- `window.__AGENT_CANVAS_BASE_PATH__=${JSON.stringify(basePath)};`,
418
+ `window.__AGENT_CANVAS_BASE_PATH__=${serializeForInlineScript(basePath)};`,
402
419
  );
403
420
  }
404
421
 
405
422
  if (vscodeBasePath) {
406
423
  parts.push(
407
- `window.__AGENT_CANVAS_VSCODE_BASE_PATH__=${JSON.stringify(vscodeBasePath)};`,
424
+ `window.__AGENT_CANVAS_VSCODE_BASE_PATH__=${serializeForInlineScript(vscodeBasePath)};`,
408
425
  );
409
426
  }
410
427
 
@@ -463,7 +480,7 @@ async function serveInjectedIndexHtml(
463
480
  res.writeHead(200, {
464
481
  "Content-Type": "text/html; charset=utf-8",
465
482
  "Content-Length": buf.length,
466
- "Cache-Control": "no-cache",
483
+ "Cache-Control": sessionApiKey ? "no-store" : "no-cache",
467
484
  });
468
485
  if (req.method === "HEAD") {
469
486
  res.end();
@@ -1 +0,0 @@
1
- import{K as e}from"./utils-BgLSZdyy.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";var n=`cli-generic`;function r(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t===`acp-managed`?null:t}function i(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=r(t);if(e)return e}return e.providerDefault??null}var a={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}},o=Object.entries(a).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:r?.available_models?.map(e=>({id:e.id,label:e.label})),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),s=`custom`,c={codex:[{name:`CODEX_AUTH_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.codex/auth.json`}}],"claude-code":[{name:`CLAUDE_CODE_OAUTH_TOKEN`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_OAUTH_TOKEN_HINT}],"gemini-cli":[{name:`GOOGLE_APPLICATION_CREDENTIALS_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.config/gcloud/application_default_credentials.json`}},{name:`GOOGLE_CLOUD_PROJECT`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_PROJECT_HINT},{name:`GOOGLE_CLOUD_LOCATION`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_LOCATION_HINT},{name:`GOOGLE_GENAI_USE_VERTEXAI`,hint_key:e.ONBOARDING$ACP_SECRET_VERTEXAI_FLAG_HINT}]},l={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function u(e,t){return e?(l[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var d=`gemini-2.5-pro`;function f(e){return e===`gemini-cli`?d:m(e)?.default_model??null}function p(n){if(!n||!m(n))return[];let r=t(n);if(!r)return[];let i=[...c[n]??[]];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function m(e){if(e)return o.find(t=>t.key===e)}function h(e){let t=m(e);return t?t.display_name:null}function g(e){return m(e)?.icon??`cli-generic`}function _(e,t){return t?m(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function v(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===s,r=n?void 0:m(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?f(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{u as a,h as c,g as d,i as f,v as i,p as l,o as n,f as o,n as r,m as s,s as t,_ as u};
@@ -1,2 +0,0 @@
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};
@@ -1,88 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/profiles-service.api-D1XKMgr0.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js","assets/vendor-styling-Ck5D_A2Q.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/proxy-XP6U1Dhv.js","assets/agent-profiles-service.api-DkeZaqIl.js","assets/secrets-service-BOIsfD9j.js","assets/active-backend-context-BnH4-L8h.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-BgLSZdyy.js","assets/hooks-service-Dnmhqc0Z.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-BnH4-L8h.js";import{D as a}from"./utils-BgLSZdyy.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{l as f,p,v as m,x as re,y as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as g}from"./proxy-XP6U1Dhv.js";import{r as ie,t as _}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.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 oe}from"./settings-service.api-C1vZH9Vh.js";import{t as se}from"./profiles-service.api-D1XKMgr0.js";import{f as y,o as ce,s as b}from"./acp-providers-DcY_mKYa.js";import{c as x,n as S,r as C}from"./skill-enablement-DXeaImBz.js";import{d as w,f as le,r as ue}from"./llm-subscription-DTqtBCWz.js";import{t as de}from"./llm-subscription-service-CgIDc38n.js";var T=[];for(let e=0;e<256;++e)T.push((e+256).toString(16).slice(1));function fe(e,t=0){return(T[e[t+0]]+T[e[t+1]]+T[e[t+2]]+T[e[t+3]]+`-`+T[e[t+4]]+T[e[t+5]]+`-`+T[e[t+6]]+T[e[t+7]]+`-`+T[e[t+8]]+T[e[t+9]]+`-`+T[e[t+10]]+T[e[t+11]]+T[e[t+12]]+T[e[t+13]]+T[e[t+14]]+T[e[t+15]]).toLowerCase()}var pe=new Uint8Array(16);function me(){return crypto.getRandomValues(pe)}function E(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():he(e,t,n)}function he(e,t,n){e||={};let r=e.random??e.rng?.()??me();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 fe(r)}var D=new Map;function ge(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function _e(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function ve(e={}){let t=l(e),n=t.host,r=D.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new m(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();D.set(n,i);try{return await i}catch(e){throw D.delete(n),e}}async function O(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?ge(n)?n:_e(await ve(t),n):ve(t)}var k=`openhands-agent-server-conversation-metadata`,ye=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),A=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(k);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},be=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(k);return}window.localStorage.setItem(k,JSON.stringify(e))}},j=e=>A()[e]??null,M=(e,t)=>{let n=A();n[e]=t,be(n)},xe=(e,t)=>{M(e,{selected_repository:null,selected_branch:null,git_provider:null,...j(e)??{},...t})},N=e=>{let t=A();e in t&&(delete t[e],be(t))};function Se(e){if(!e?.id)return e;let t=j(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 P(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}function Ce(){let e=s().backend;return e.kind===`cloud`?e:c().find(e=>e.kind===`cloud`&&!!e.apiKey)??null}async function we(e=20,t){let n=P(),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=>Se(e)),next_page_id:i?.next_page_id??null}}async function F(e){if(e.length===0)return[];let t=P(),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(Se)}async function Te(e,t){return await g({backend:t??P(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:i})}async function Ee(e){return g({backend:P(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function De(e){await g({backend:P(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function Oe(e,t){return await g({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function ke(e,t){return g({backend:P(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{title:t}})}async function Ae(e){await g({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function je(e){await g({backend:P(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function Me(e,t){let n=P(),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 Ne(e,t){let n=P(),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 Pe(e,t){let n=t??P(),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 Fe(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}function Ie(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 Le(e){return Ie(e.stats)}var Re=`canvas_ui`,I=`canvas_ui_control`,ze=`ClientAction_${I}`,Be={name:I,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}},L=`launch_child_conversation`,Ve=`ClientAction_${L}`,He=`[child-conversation] `,Ue=[`local`,`cloud`],We=[`worktree`,`shared`],Ge=`1.37.1`,Ke={name:L,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 "${He.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:[...Ue],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:[...We],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}},qe=`.agents_tmp/PLAN.md`,Je=`system_prompt_planning.j2`,Ye=`planning_file_editor`,R=`plannerparent`,Xe=`PLAN.MD`,Ze=[`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
- `),Qe=[`<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 $e(e){return`${e.replace(/\/+$/,``)}/${qe}`}function et(e){if(!e)return!1;let t=e.replace(/\\/g,`/`).toUpperCase();return t===Xe||t.endsWith(`/${Xe}`)}function tt(e,t){return e?.tags?.[R]===t}function nt(e,t){return t?e?.find(e=>tt(e,t))?.id??null:null}var rt=[`terminal`,`file_editor`,`task_tracker`],it=`browser_tool_set`,at=`task_tool_set`,ot=500;function st(e){return typeof e==`number`?e:ot}function ct(){return!0}function z(e){if(typeof e==`string`){let t=e.trim();if(!t)return null;try{return z(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 lt(){let e;try{e=l({timeout:3e3})}catch{return null}let n=z(t({host:e.host})?.runtime_services);if(n)return n;try{return z((await new re(e).getServerInfo()).runtime_services)}catch{return null}}function ut(e){let t=z(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 dt(e){let{host:t}=l();return`${t}/api/conversations/${e}`}function ft(e){return`Conversation ${e.slice(0,5)}`}function B(e){let t=j(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:ft(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?y({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}:Ie(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:dt(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 pt(e){return{items:e.items.filter(e=>!e.tags?.[R]).map(B),next_page_id:e.next_page_id??null}}var mt=`acpserver`,V=`clientsource`,ht=`agentcanvas`,gt=`automationtrigger`,_t=`automationid`,H=`automationname`,vt=`automationrunid`,yt=[gt,_t,H,vt],bt=new Set([mt,V,gt,_t,H,vt,`title`,`git_provider`,`repo_name`,`repo`,`repository`,`selected_branch`,`branch`,`archiveworkspacepath`,`workspace`,`working_dir`,R]),xt=[`origin`];function St(e){if(!e)return[];let t=e=>{let t=xt.indexOf(e.trim().toLowerCase());return t===-1?1/0:t};return Object.entries(e).filter(([e,t])=>!bt.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 Ct=`gAAAAA`,wt=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function U(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function Tt(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Et(e){let t=U(e);t.model=typeof t.model==`string`&&t.model.trim().length>0?t.model:v.llm_model;let n=Tt(t.api_key);n?t.api_key=n:delete t.api_key;let r=Tt(t.base_url);return r?t.base_url=r:delete t.base_url,le(t)?(t.auth_type=ue,t.subscription_vendor=w,delete t.api_key):(delete t.auth_type,delete t.subscription_vendor),t}function W(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function G(e){return typeof e==`string`?e.startsWith(Ct):Array.isArray(e)?e.some(G):W(e)?Object.values(e).some(G):!1}function Dt(e){return W(e)?Object.values(e).some(G):!1}function Ot(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function kt(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function At(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function K(e,t){return e===it?ct()&&n(e):e===at?t.enable_sub_agents===!0&&n(e):!0}function jt(e){let t=new Map;for(let n of rt)K(n,e)&&t.set(n,{name:n,params:{}});for(let n of[it,at])K(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>At(e)))for(let r of n)K(r.name,e)&&t.set(r.name,{name:r.name,params:U(r.params)});return Array.from(t.values())}function Mt(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 Nt(){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 q(e,t,n={},r){let i=ut(t),a=U(e.agent_context),o=Array.isArray(a.skills)?a.skills:[],s=n.disabledSkills??[],c=new Set(s),l=S(n),u=[...o.filter(e=>typeof e.name!=`string`||!c.has(e.name)),...Nt().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 Pt(e){return U(e.agent_settings).agent_kind===`acp`}function Ft(e){let t=U(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function It(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=b(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function Lt(e,t,n){let r=U(e.agent_settings),i={agent_kind:`acp`,agent_context:q(r,t,x(e),C(n))};for(let e of _){if(e===`acp_model`||e===`acp_env`)continue;let t=e===`acp_command`?It(r):r[e];t!=null&&(i[e]=t)}let a=U(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=y({configured:r.acp_model,providerDefault:ce(o)});return s&&(i.acp_model=s),i}function Rt(e,t,n){let r=U(e.agent_settings),i=Et(r.llm);i.stream=!0;let a=U(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:q(r,t,x(e),C(n)),tools:jt(r)}}function zt(e,t,n){return Pt(e)?Lt(e,t,n):Rt(e,t,n)}function Bt(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=U(t.conversation_settings),s=Mt(n,r);return wt.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 Vt(e){if(!e?.length)return;let t=ee(),n=t?Fe(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 Ht(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Pt(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=zt(t,e.runtimeServicesInfo,e.query),a=n?Ft(t):void 0,o=Bt(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[Be,Ke]:[],confirmation_policy:Ot(o),max_iterations:st(o.max_iterations),stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a?s.tags={[mt]:a,[V]:ht}:s.tags={[V]:ht},!e.agentProfileId&&e.secretsEncrypted&&(!n||Dt(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId),e.parentConversationId&&(s.parent_conversation_id=e.parentConversationId);let c=kt(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[Re],delete l[I],delete l[L],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions);let u=Vt(e.customSecrets);return u&&(s.secrets=u),s}function Ut(e){let t=U(e.encryptedAgentSettings),n=Et(t.llm);n.stream=!0;let r=$e(e.workingDir),i=q(t,void 0,e.skillEnablement),a=i.system_message_suffix;i.system_message_suffix=typeof a==`string`?`${Qe}\n\n${a}`:Qe;let o=Mt(e.initialMessage),s={agent:{kind:`Agent`,llm:n,tools:[{name:`glob`,params:{}},{name:`grep`,params:{}},{name:Ye,params:{plan_path:r}}],system_prompt_filename:Je,system_prompt_kwargs:{plan_structure:Ze},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??ot,stuck_detection:!0,autotitle:!1,worktree:!1,parent_conversation_id:e.parentConversationId,tags:{[R]:e.parentConversationId},...o?{initial_message:o}:{}};e.secretsEncrypted&&(s.secrets_encrypted=!0);let c=Vt(e.customSecrets);return c&&(s.secrets=c),s}async function Wt(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./profiles-service.api-D1XKMgr0.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=await n.getProfile(t,`encrypted`);return W(r.config)?r.config:null}catch(e){return console.warn(`Falling back: could not resolve LLM profile ${t}`,e),null}}async function Gt(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./agent-profiles-service.api-DkeZaqIl.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 Wt(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 Kt(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-BOIsfD9j.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([oe.getSettingsForConversation(),n.getSecrets()]),a=(t.parentActiveProfileName?await Wt(t.parentActiveProfileName):null)??(t.parentAgentProfileId?await Gt(t.parentAgentProfileId):null),o=a?{...r.agentSettings,llm:a}:r.agentSettings;await J(o);let s=st(r.conversationSettings.max_iterations);return Ut({...t,encryptedAgentSettings:o,secretsEncrypted:r.secretsEncrypted,customSecrets:i,maxIterations:s,skillEnablement:r.skillEnablement})}var qt=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function J(e){if(le(U(e.llm))&&!(await de.getOpenAIStatus()).connected)throw Error(qt)}async function Jt(t){let[{SecretsService:n},{default:r}]=await Promise.all([e(()=>import(`./secrets-service-BOIsfD9j.js`).then(e=>e.n),__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),e(()=>import(`./hooks-service-Dnmhqc0Z.js`),__vite__mapDeps([14,2,1,3,4,5]))]),[i,a,o,s]=await Promise.all([oe.getSettingsForConversation(),n.getSecrets(),lt(),r.loadWorkspaceHooks(t.hooksProjectDir)]),{agentSettings:c,conversationSettings:l,secretsEncrypted:u}=i;return t.agentProfileId||await J(c),Ht({...t,encryptedAgentSettings:c,encryptedConversationSettings:l,secretsEncrypted:u,customSecrets:a,runtimeServicesInfo:o,workspaceHookConfig:s})}function Yt(){return{hooks:[]}}function Xt(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 Zt=`1970-01-01T00:00:00.000Z`,Qt=300*1e3,$t=`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 Y(){return Error($t)}function X(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function en(e){return typeof e==`number`?e:null}function Z(e){return typeof e==`number`?e:0}function Q(e){return typeof e==`string`?e:null}function tn(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Zt}function nn(e){return X(e)?{prompt_tokens:Z(e.prompt_tokens),completion_tokens:Z(e.completion_tokens),cache_read_tokens:Z(e.cache_read_tokens),cache_write_tokens:Z(e.cache_write_tokens),context_window:Z(e.context_window),per_turn_token:Z(e.per_turn_token)}:null}function rn(e){return X(e)?{accumulated_cost:en(e.accumulated_cost),max_budget_per_task:en(e.max_budget_per_task),accumulated_token_usage:nn(e.accumulated_token_usage)}:null}function an(e){return X(e)?e:null}function on(e){if(!X(e))return null;let t=X(e.llm)?{model:Q(e.llm.model)}:null;return{kind:Q(e.kind),acp_server:Q(e.acp_server),acp_model:Q(e.acp_model),llm:t}}function sn(e){return X(e)?{working_dir:Q(e.working_dir)}:null}function cn(e){if(!X(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function ln(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):null}function un(e){if(!X(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 dn(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 fn(e,t){let n=dn(e),r=dn(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function pn(e){if(!X(e)||typeof e.id!=`string`||!e.id.trim())throw Y();return{id:e.id.trim(),title:Q(e.title),created_at:tn(e,`created_at`,`createdAt`),updated_at:tn(e,`updated_at`,`updatedAt`),execution_status:Q(e.execution_status),sandbox_status:Q(e.sandbox_status),metrics:rn(e.metrics),stats:an(e.stats),agent:on(e.agent),workspace:sn(e.workspace),tags:cn(e.tags),launched_agent_profile:un(e.launched_agent_profile),sub_conversation_ids:ln(e.sub_conversation_ids),current_model_id:Q(e.current_model_id),current_model_name:Q(e.current_model_name)}}function mn(e){if(!Array.isArray(e))throw Y();return e.map(pn)}function hn(e){if(Array.isArray(e))return{items:mn(e),next_page_id:null};if(!X(e))throw Y();return{items:mn(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var gn=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function _n(e){let t=e??`idle`;return gn.has(t)?t:`idle`}function $(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 F([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:f,sandboxId:p,agentProfileId:m,agentProfileKind:re}=e;if(s().backend.kind===`cloud`)return Te({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:f,sandbox_id:p??null,agent_profile_id:m??null,trigger:`gui`});let[g,ie]=await Promise.all([oe.getSettings(),se.listProfiles().catch(()=>void 0)]),_=Xt(g.title_llm_profile,ie),ae=E(),v=s().backend.host,y=await O(o??ne(ae,v)),ce=o?y:await O(te(v)),b=c??(o?`local_repo`:`new_worktree`),x=await Jt({settings:g,query:t,conversationInstructions:n,plugins:i,conversationId:ae,parentConversationId:d,workingDir:y,hooksProjectDir:ce,worktree:b===`new_worktree`,agentProfileId:m,agentProfileKind:re,titleLlmProfile:_}),S=await r(),C=await new h(l({timeout:Qt})).createConversation({...x,...S?{user_id:S}:{}}),w=ee();if(!w)throw new u;return(a?.selected_repository||o)&&M(C.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:b}),{id:C.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:C.id,agent_server_url:w.host,request:{initial_message:x.initial_message,plugins:i??null},created_at:C.created_at,updated_at:C.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 Kt({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 xe(e,{local_planning_conversation_id:i.id}),B(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&&tt(r,e)&&t.add(r.id)}}catch(t){console.warn(`Failed to read sub-conversations of ${e}`,t)}let n=j(e)?.local_planning_conversation_id;return n&&t.add(n),[...t]}static async getStartTask(e){return s().backend.kind===`cloud`?Pe(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new f(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getVSCodeStatus(e,t){return new f(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`?F(e):mn(await new h(l()).getConversations(e)).map(e=>B(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return Oe(e,t)}static async updateConversationRepository(e,t,n,r){t?M(e,{...j(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):N(e);let[i]=await this.batchGetAppConversations([e]);return $(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return Me(e,fn(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=fn(t??`${n}/.agents_tmp/PLAN.md`,n);return new m(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?Ee(e):new m(l()).downloadTrajectory(e)}static async getHooks(e){return Yt()}static async getRuntimeConversation(e,t,n){let r=pn(await new h(l({conversationUrl:t,sessionApiKey:n})).getConversation(e));return{id:r.id,title:r.title?.trim()?r.title:ft(r.id),metrics:rn(r.metrics),created_at:r.created_at,updated_at:r.updated_at,status:_n(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`?we(e,t):pt(hn(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 De(e),N(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)}N(e)})),await n.deleteConversation(e),N(e)}static async updateConversationTitle(e,t){if(s().backend.kind===`cloud`)return ke(e,t);await new h(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return $(n,e)}static async updateConversationTags(e,t){await new h(l()).updateConversation(e,{tags:t});let[n]=await this.batchGetAppConversations([e]);return $(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=j(e);return i&&M(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 se.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 p(l()).activateProfile(t);return}let r=l(),i=new h(r),a=await new p(r).getProfile(t,{exposeSecrets:`encrypted`}),o=typeof a.config.model==`string`?a.config.model:``;if(!o)throw Error(`Profile '${t}' has no model.`);await J({llm:a.config}),await i.switchLLM(e,{...a.config,model:o,stream:!0,usage_id:`profile:${t}:${E()}`})}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{O as A,Ce as C,xe as D,j as E,M as O,Ae as S,je as T,Le as _,St as a,Pe as b,We as c,Ve as d,L as f,Re as g,I as h,bt as i,E as j,ye as k,He as l,ze as m,H as n,nt as o,Ge as p,yt as r,et as s,vn as t,Ue as u,F as v,Me as w,Ne as x,Te as y};
@@ -1,2 +0,0 @@
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-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{a as m,i as h,n as g,r as _,t as v}from"./use-acp-credential-form-ychoGqjC.js";import{n as y}from"./use-settings-C2KKQKVC.js";import{t as ee}from"./use-save-settings-Dapkf4cC.js";import{h as te}from"./form-control-classes-Dbq-7YP_.js";import{t as ne}from"./brand-button-CUMfjb99.js";import{t as re}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as ie}from"./settings-input-dVuzapBA.js";import{c as b,i as ae,n as x,o as S,s as oe,t as se}from"./acp-providers-DcY_mKYa.js";import{_ as ce,g as le,h as ue,n as de,o as fe,v as pe}from"./schema-field-Y3F8JvXd.js";import{r as C}from"./typography-DgcLGdHk.js";import{t as me}from"./settings-switch-DDd1cQ8t.js";var w=e(n(),1),T=r();function he({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})]})}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(` `)}})),D=t(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r[r.length]=i,t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||={};var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||={};var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p||=!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e[e.length]=t,e;var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?(e[e.length]=n[0],e):(n.filter(Boolean).forEach(function(t){e[e.length]=m.test(t)?JSON.parse(t.split(d)[1]):t}),e)},[]):r}})),{quote:O}=e(t((e=>{e.quote=E(),e.parse=D()}))(),1);function k(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 A=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function j(e){return e.map(e=>A.test(e)||e===``?O([e]):e).join(` `)}var M=`1.31.0`;function ge(){let e=u();if(!e)return!0;let t=s(e,M);return t===null?!0:t>=0}var N={hideTitle:!0},_e=`enable_sub_agents`,ve=`enable_switch_llm_tool`,ye=`tool_concurrency_limit`,be=`npx -y <package-name>`,P=`__custom_model__`,xe={agentType:`openhands`,commandText:``,acpModel:``,isCustomAcpModel:!1};function Se(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function F(e,t){let n=k(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return se}function Ce(e){return e?.find(e=>e.key===_e)}function we(e,t){return typeof e==`boolean`?e:t?.default===!0}function Te(e,t){return typeof e==`boolean`?e:t?.default===!0}function Ee(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function De(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,switchLlmToolField:s,switchLlmToolEnabled:c,switchLlmToolSupportedOnProfile:l,toolConcurrencyField:u,toolConcurrency:d}=e;if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:j(i)||null,acp_args:null}}let f={agent_kind:`openhands`,enable_sub_agents:o};if(s&&l&&(f.enable_switch_llm_tool=c),u){let e=fe(u,d),t=typeof u.default==`number`?u.default:1;f.tool_concurrency_limit=e==null?t:Number(e)}return f}function Oe({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=y(),s=t??i?.agent_settings??null,{mutate:u,isPending:m}=ee(),{data:h}=pe(i?.agent_settings_schema),g=w.useMemo(()=>h?.sections.flatMap(e=>e.fields),[h]),_=Ce(g),b=w.useMemo(()=>we(s?.[_e],_),[_,s]),[E,D]=(0,w.useState)(b),O=g?.find(e=>e.key===ve),A=w.useMemo(()=>Te(s?.[ve],O),[O,s]),[M,N]=(0,w.useState)(A),Oe=ge(),ke=!!O&&(!e||Oe),I=g?.find(e=>e.key===ye),L=w.useMemo(()=>{if(!I)return``;let e=s?.[ye];return ue(I,e)},[I,s]),[R,Ae]=(0,w.useState)(L),[z,je]=(0,w.useState)(`openhands`),[B,V]=(0,w.useState)(``),[H,U]=(0,w.useState)(``),[Me,W]=(0,w.useState)(!1),Ne=z===`acp`?F(B,x):null,G=v(Ne&&Ne!==`custom`?Ne:null),Pe=(0,w.useRef)(null),Fe=(0,w.useRef)(null),K=(0,w.useRef)(``),[q,J]=(0,w.useState)(xe);(0,w.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(Pe.current!==n)if(Pe.current=n,e?.agent_kind===`acp`){je(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=oe(n),i=Se(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],...Se(e?.acp_args)],o=a.length>0?j(a):``;V(o),Fe.current=n??null,K.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``,l=c||S(n)||``,u=!!c&&(!r||!Ee(r,c));U(l),W(u),J({agentType:`acp`,commandText:o,acpModel:l,isCustomAcpModel:u})}else je(`openhands`),V(``),U(``),Fe.current=null,K.current=``,W(!1),J(xe)},[i,t]),(0,w.useEffect)(()=>{D(b)},[b]),(0,w.useEffect)(()=>{N(A)},[A]),(0,w.useEffect)(()=>{Ae(L)},[L]);let Ie=(0,w.useRef)(()=>({agent_kind:`openhands`,enable_sub_agents:!1})),Le=(0,w.useCallback)(()=>Ie.current(),[]),Re=(0,w.useRef)(G);Re.current=G;let ze=(0,w.useCallback)(e=>Re.current.save(e),[]),Be=(0,w.useCallback)(()=>Re.current.reset(),[]),Ve=z===`acp`&&k(B).length===0,He=z!==q.agentType||(z===`acp`?B!==q.commandText||H!==q.acpModel||Me!==q.isCustomAcpModel:E!==b||M!==A||R!==L),Ue=G.isDirty,We=He||Ue;if((0,w.useEffect)(()=>{!e||!n||n({agentType:z,isValid:!Ve,isDirty:We,buildAgentProfileFields:Le,credentials:{isDirty:Ue,save:ze,reset:Be}})},[e,n,z,Ve,We,Ue,Le,ze,Be]),a)return null;let Y=z===`acp`,X=k(B),Ge=Y&&X.length===0,Z=F(B,x),Q=oe(Z),Ke=Q?.available_models??[],qe=Ke.length>0,Je=Ee(Q,H),Ye=Me||!Je?P:H,Xe=!!Q&&X.join(` `)===Q.default_command.join(` `),Ze=j(x[0]?.default_command??[])||be;Ie.current=()=>De({isAcp:Y,selectedPreset:Z,isDefaultProviderCommand:Xe,commandTokens:X,acpModel:H,subAgentsEnabled:E,switchLlmToolField:O,switchLlmToolEnabled:M,switchLlmToolSupportedOnProfile:Oe,toolConcurrencyField:I,toolConcurrency:R});let $=m||G.isSaving,Qe=async()=>{if(G.isDirty){if(!await G.save({silent:He}))return;G.reset()}if(He)if(Y){let e=!!(Q&&Xe),t=Fe.current,n=B===K.current,i=!!t&&t!==`custom`&&!x.some(e=>e.key===t),a=Y&&n&&i,o=ae(a?t:Q&&Xe?Q.key:se,{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:Me}),K.current=B}})}else{let e={agent_kind:`openhands`,enable_sub_agents:E};if(O&&(e[ve]=M),I){let t;try{t=fe(I,R)}catch(e){d(e instanceof Error?e.message:r(f.ERROR$GENERIC));return}t!=null&&(e[ye]=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})}})}},$e=_?ce(r,_.key,_.label):r(f.SCHEMA$ENABLE_SUB_AGENTS$LABEL),et=_?le(r,_.key,_.description):r(f.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION),tt=O?ce(r,O.key,O.label):r(f.SCHEMA$ENABLE_SWITCH_LLM_TOOL$LABEL),nt=O?le(r,O.key,O.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)(re,{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(je(t),t===`acp`&&!B){let e=x[0];e&&(V(j(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)(me,{testId:`agent-settings-enable-sub-agents`,isToggled:E,onToggle:e=>{D(e)},children:$e}),et?(0,T.jsx)(C.Paragraph,{className:p(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:et}):null]}),!Y&&ke?(0,T.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,T.jsx)(me,{testId:`agent-settings-enable-switch-llm-tool`,isToggled:M,onToggle:e=>{N(e)},children:tt}),nt?(0,T.jsx)(C.Paragraph,{className:p(te,`text-tertiary-alt text-xs leading-5`),children:nt}):null]}):null,!Y&&I?(0,T.jsx)(de,{field:I,value:R,isDisabled:$,onChange:Ae}):null,Y&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(re,{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=oe(t);n?(V(j(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:Ze,onChange:e=>{let t=e.target.value,n=F(B,x),r=F(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:[qe&&(0,T.jsx)(re,{testId:`agent-model-selector`,name:`agent-model`,label:r(f.SETTINGS$AGENT_MODEL),items:[...Ke.map(e=>({key:e.id,label:e.label})),{key:P,label:r(f.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Ye,onSelectionChange:e=>{if(!e)return;let t=String(e);t===P?(W(!0),U(``)):(W(!1),U(t))}}),Ye===P&&(0,T.jsx)(ie,{testId:`agent-model-input`,label:r(qe?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)(he,{form:G,providerKey:Z})]}),!e&&(0,T.jsx)(`div`,{children:(0,T.jsx)(ne,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:$||!We||Ge,onClick:Qe,children:r($?f.SETTINGS$SAVING:f.SETTINGS$SAVE_CHANGES)})})]})}var ke=i(function(){return(0,T.jsx)(a,{to:`/settings/agents`,replace:!0})});export{k as i,ke as n,N as r,Oe as t};
@@ -1 +0,0 @@
1
- import{n as e,r as t}from"./agent-settings-BF8hM6wb.js";export{e as default,t as handle};