@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
package/README.md CHANGED
@@ -96,7 +96,7 @@ docker run -it --rm \
96
96
  -p 8000:8000 \
97
97
  -v "$HOME/.openhands:/home/openhands/.openhands" \
98
98
  -v "${PROJECTS_PATH}:/projects" \
99
- ghcr.io/openhands/agent-canvas:1.18.0 # x-release-please-version
99
+ ghcr.io/openhands/agent-canvas:1.20.0 # x-release-please-version
100
100
  ```
101
101
 
102
102
  **Windows (PowerShell / Windows Terminal):** See [README.windows.md](./README.windows.md) for the equivalent commands.
package/README.windows.md CHANGED
@@ -12,7 +12,7 @@ For the main install options and overall context, see [README.md](./README.md).
12
12
  - A host directory for `PROJECTS_PATH` containing the project folders you want the agent to access (create it before starting the container)
13
13
 
14
14
  ```powershell
15
- docker pull ghcr.io/openhands/agent-canvas:1.18.0 # x-release-please-version
15
+ docker pull ghcr.io/openhands/agent-canvas:1.20.0 # x-release-please-version
16
16
 
17
17
  $env:PROJECTS_PATH = Join-Path $HOME "projects" # directory containing your project folders
18
18
  New-Item -ItemType Directory -Force -Path $env:PROJECTS_PATH, (Join-Path $env:USERPROFILE ".openhands") | Out-Null
@@ -21,7 +21,7 @@ docker run -it --rm `
21
21
  -p 8000:8000 `
22
22
  -v "$($env:USERPROFILE)\.openhands:/home/openhands/.openhands" `
23
23
  -v "$($env:PROJECTS_PATH):/projects" `
24
- ghcr.io/openhands/agent-canvas:1.18.0 # x-release-please-version
24
+ ghcr.io/openhands/agent-canvas:1.20.0 # x-release-please-version
25
25
  ```
26
26
 
27
27
  Open [http://localhost:8000/canvas](http://localhost:8000/canvas) in your browser.
@@ -0,0 +1 @@
1
+ import{K as e}from"./utils-CbjwNcR-.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";var n=`cli-generic`;function r(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t===`acp-managed`?null:t}function i(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=r(t);if(e)return e}return e.providerDefault??null}var a={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}};function o(e){return t(e)?.available_models?.map(e=>({id:e.id,label:e.label}))}var s=Object.entries(a).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:o(e),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`,l={codex:[{name:`CODEX_AUTH_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.codex/auth.json`}}],"claude-code":[{name:`CLAUDE_CODE_OAUTH_TOKEN`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_OAUTH_TOKEN_HINT}],"gemini-cli":[{name:`GOOGLE_APPLICATION_CREDENTIALS_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.config/gcloud/application_default_credentials.json`}},{name:`GOOGLE_CLOUD_PROJECT`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_PROJECT_HINT},{name:`GOOGLE_CLOUD_LOCATION`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_LOCATION_HINT},{name:`GOOGLE_GENAI_USE_VERTEXAI`,hint_key:e.ONBOARDING$ACP_SECRET_VERTEXAI_FLAG_HINT}]},u={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function d(e,t){return e?(u[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var f=`gemini-2.5-pro`;function p(e){return e===`gemini-cli`?f:h(e)?.default_model??null}function m(n){if(!n||!h(n))return[];let r=t(n);if(!r)return[];let i=[...l[n]??[]];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function h(e){if(e)return s.find(t=>t.key===e)}function g(e){let t=h(e);return t?t.display_name:null}function _(e){return h(e)?.icon??`cli-generic`}function v(e,t){return t?h(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function y(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:h(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?p(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{d as a,g as c,_ as d,i as f,y as i,m as l,s as n,p as o,n as r,h as s,c as t,v as u};
@@ -0,0 +1,2 @@
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-CbjwNcR-.js";import{A as se,D as ce,O as le,T as ue,b as de,c as fe,d as u,f as d,g as pe,h as me,l as he,m as ge,n as _e,p as ve,s as ye,u as be,w as xe,x as Se}from"./agent-server-client-options-EHB23gyx.js";import{f as Ce,l as we}from"./agent-server-config-C_x8Otd9.js";import{S as Te,f as Ee}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.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.49.1`,agentCanvas:`1.20.0`,automation:`1.13.1`},compatibility:{minimumAgentServer:`1.28.0`},constraints:{_comment:`Temporary upper bound on the agent-client-protocol (acp) transitive dependency. openhands-sdk 1.35.0 requires agent-client-protocol>=0.10.1 with no upper bound, but acp 0.11.0 reordered the ACP prompt() arguments and breaks the SDK's ACP client (a PromptRequest validation error surfaces as 'ACP error: 2 validation errors for PromptRequest'). Pin acp <0.11 until a fixed openhands-sdk ships. Consumed by scripts/dev-safe.mjs (agent-server uvx install) and .github/workflows/mock-llm-e2e.yml (mock ACP server venv).`,agentClientProtocol:`agent-client-protocol<0.11`},images:{agentServer:`ghcr.io/openhands/agent-server`,agentCanvas:`ghcr.io/openhands/agent-canvas`},ports:{agentServer:18e3,automation:18001,proxy:8e3,_vscodeComment:`Port the bundled editor binds to inside the container; agent-server's own default. Only the Docker entrypoint reads this — the npm launchers derive the editor port from the agent-server port so several stacks can run side by side. It is never published: the editor is reached through paths.vscodeBasePath on the proxy port.`,vscode:8001},paths:{stateSubdir:`agent-canvas`,conversations:`agent-canvas/conversations`,bashEvents:`agent-canvas/bash_events`,automationDb:`automation/automations.db`,canvasBasePath:`/canvas`,_vscodeBasePathComment:`Path prefix the bundled editor is served under, on the same origin as the canvas. Passed to agent-server as OH_VSCODE_BASE_PATH (it launches openvscode-server with --server-base-path and advertises the prefix in /api/vscode/url), and registered as an ingress route to the VSCode port. Keeping one value on both sides is what lets a single-origin deployment reach the editor without publishing a second port. Tradeoff: a path prefix routes but does not isolate, so the editor shares the canvas's browser origin and therefore its localStorage — see docs/SELF_HOSTING.md and OpenHands/OpenHands#16492.`,vscodeBasePath:`/vscode`},packages:{agentServer:`openhands-agent-server`,automation:`openhands-automation`,tools:`openhands-tools`,workspace:`openhands-workspace`},telemetry:{posthogApiKey:`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,posthogHost:`https://us.i.posthog.com`}},st=5e3,ct=`unknown`,S=ot.compatibility.minimumAgentServer,lt=`AGENT_SERVER_UNSUPPORTED_VERSION`,ut=`AGENT_SERVER_UNKNOWN_VERSION`,dt=`Invalid API key`,C=null,w=null,ft=e=>Array.isArray(e?.usable_tools)?e.usable_tools:null,T=class extends Error{details;noBackendConfigured;constructor(e,t){let n=t?.noBackendConfigured??!1;super(n?`No agent server backend is configured yet. Add a backend to get started.`:`Could not connect to the configured agent server. Make sure it is running and reachable, then reload the page.`),this.name=`AgentServerUnavailableError`,this.details=e??null,this.noBackendConfigured=n}},pt=e=>e instanceof T||typeof e==`object`&&!!e&&`name`in e&&(e.name===`AgentServerUnavailableError`||e.name===`AgentServerUnsupportedVersionError`||e.name===`AgentServerUnknownVersionError`),mt=class extends T{code=lt;actualVersion;requiredVersion=S;constructor(e){let t=`Agent Canvas requires agent-server ${S} or newer; this backend is running ${e}. Please upgrade the agent-server backend.`;super(t),this.name=`AgentServerUnsupportedVersionError`,this.message=t,this.actualVersion=e}},ht=class extends T{code=ut;actualVersion;requiredVersion=S;constructor(e){let t=`Could not determine this backend's agent-server version.${e?` It reported "${e}".`:``} Agent Canvas requires agent-server ${S} or newer, but this backend did not return a valid version from /server_info. Restart or rebuild the agent-server backend, then try again.`;super(t),this.name=`AgentServerUnknownVersionError`,this.message=t,this.actualVersion=e}},gt=e=>Ce()&&D(e,401);function E(){C=null,w=null}function _t(e){return e?.host&&e.host!==w?null:C}function vt(e){let t=ft(C);return Array.isArray(t)?t.includes(e):!0}function yt(e){return e instanceof Error&&e.name===`HttpError`&&`status`in e&&typeof e.status==`number`}function D(e,t){return yt(e)&&e.status===t}function bt(e){return typeof e==`string`&&e.trim()||null}function xt(e){return bt(e.sdk_version)}function St(e){return bt(e.version)??xt(e)}function Ct(e){let t=St(e);return!t||t.toLowerCase()===ct?null:t}function O(e){let t=Ct(e);return!t||!k(t)?null:t}function wt(e){return!C||e&&be()?.host!==e?null:O(C)}function Tt(e,t){let n=k(e),r=k(t);if(!n||!r)return null;for(let e of[`major`,`minor`,`patch`]){if(n[e]>r[e])return 1;if(n[e]<r[e])return-1}return n.prerelease&&!r.prerelease?-1:!n.prerelease&&r.prerelease?1:n.prerelease&&r.prerelease?n.prerelease.localeCompare(r.prerelease):0}function k(e){let[t]=e.trim().replace(/^v/,``).split(`+`),[n,r]=t.split(`-`,2),i=n.split(`.`);if(i.length!==3)return null;let[a,o,s]=i.map(e=>Number(e));return[a,o,s].every(e=>Number.isInteger(e)&&e>=0)?{major:a,minor:o,patch:s,prerelease:r}:null}function Et(e){let t=Ct(e);if(!t)throw E(),new ht(St(e));let n=Tt(t,S);if(n===null)throw E(),new ht(t);if(n<0)throw E(),new mt(t)}async function Dt(e,t){let n=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:t});try{await new Ee(n).getSettings();let e=await new Te(n).getServerInfo();return Et(e),O(e)}catch(e){throw D(e,401)?Error(dt):e}}async function Ot(){let e=be();if(!e){if(E(),ve(fe().backend))throw new T(`No backend configured`,{noBackendConfigured:!0});return null}let t=_e({host:e.host,sessionApiKey:e.apiKey||null,timeout:st}),n;try{n=await new Te(t).getServerInfo()}catch(e){throw E(),D(e,401)?e:new T(e instanceof Error?e.message:null)}if(Et(n),Ce())try{await new Ee(t).getSettings()}catch(e){if(D(e,401))throw e;console.warn(`[agent-server] getSettings() probe failed (non-401):`,e)}return C=n,w=t.host,n}var kt={WEB_CLIENT_CONFIG:[`web-client-config`],MAIN_APP_COOKIE_AUTH:[`main-app-cookie-auth`]},At={all:[`settings`],byScope:e=>[`settings`,e],personal:()=>[`settings`,`personal`]},jt={all:[`llm-profiles`]},Mt={all:[`agent-profiles`],detail:(e,t,n)=>[`agent-profiles`,e,t,`detail`,n]},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.20.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.22.1`,"@openhands/typescript-client":`1.49.1`,"@react-router/node":`7.18.2`,"@react-router/serve":`7.18.2`,"@tailwindcss/vite":`4.3.3`,"@tanstack/react-query":`5.101.4`,"@types/shell-quote":`1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.18.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,httpxy:`0.5.3`,i18next:`26.3.6`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.1`,isbot:`5.1.39`,"lucide-react":`1.25.0`,"monaco-editor":`0.56.0`,"posthog-js":`1.380.0`,react:`19.2.8`,"react-dom":`19.2.8`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.11`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.18.2`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`1.9.0`,sirv:`3.0.2`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.6.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.16`,winston:`3.19.0`,"winston-daily-rotate-file":`5.0.0`,zustand:`5.0.14`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:coverage":`npm run make-i18n && vitest run --coverage`,"test:mutation":`npm run make-i18n && stryker run`,"test:mutation:diff":`npm run make-i18n && node scripts/stryker-diff.mjs`,"test:mutation:incremental":`npm run make-i18n && stryker run --incremental`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,postinstall:`node -e "if (process.env.npm_config_global === 'true') { console.log('\\n\\x1b[32m\\x1b[1m\\u2713 @openhands/agent-canvas installed!\\x1b[0m\\n\\nTo start Agent Canvas, run:\\n\\n \\x1b[36m\\x1b[1magent-canvas\\x1b[0m\\n\\nThis launches the full stack at \\x1b[36mhttp://localhost:8000\\x1b[0m.\\n\\nDocs: https://docs.openhands.dev/openhands/usage/agent-canvas/setup\\n') }"`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`,"example:acp-docker:env":`node scripts/gen-acp-docker-env.mjs`,predesktop:`node scripts/brand-dev-electron.mjs`,desktop:`npm run build:app && electron electron`,"build:desktop":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && electron-builder --config electron-builder.config.mjs --publish never`,"build:desktop:universal":`npm run build:app && node scripts/download-uv.mjs && node scripts/download-node.mjs && cross-env ELECTRON_ARCH=universal electron-builder --config electron-builder.config.mjs --publish never`,"download-uv":`node scripts/download-uv.mjs`,"download-node":`node scripts/download-node.mjs`,"generate-icons":`node scripts/generate-icons.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`node scripts/run-staged-typecheck.mjs`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.6`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.62.1`,"@react-router/dev":`7.18.2`,"@stryker-mutator/core":`9.6.1`,"@stryker-mutator/vitest-runner":`9.6.1`,"@tailwindcss/typography":`0.5.20`,"@tanstack/eslint-plugin-query":`5.101.4`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`7.0.0`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`26.1.2`,"@types/react":`19.2.18`,"@types/react-dom":`19.2.4`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.65.0`,"@typescript-eslint/parser":`8.65.0`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.10`,"cross-env":`10.1.0`,electron:`42.3.3`,"electron-builder":`26.15.3`,eslint:`9.39.5`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.5`,"eslint-plugin-i18next":`6.1.5`,"eslint-plugin-import-x":`4.17.1`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.6`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`30.0.1`,"lint-staged":`17.3.0`,msw:`2.15.0`,png2icons:`2.0.1`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.3.3`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.10`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{"@vercel/static-config":{ajv:`8.20.0`},dompurify:`3.4.14`,"typed-rest-client":{qs:`6.15.3`}},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.8`,"react-dom":`19.2.8`,"react-router":`7.18.2`}},j=`agent_canvas`,M=A.version,Wt=`X-OpenHands-Client`,Gt=`X-OpenHands-Client-Version`,Kt=`X-OpenHands-Telemetry-Distinct-Id`,qt={[Wt]:j,[Gt]:M};function Jt(e){return e?.trim()||`unknown`}function N(e){return e?.trim()||null}function P({backendKind:e,agentServerVersion:t,automationSdkVersion:n,backendVersion:r,connectionMethod:i}){let a=Jt(t??r),o=Jt(n),s=Jt(r??t);return{backend_kind:e??null,agent_server_version:a,automation_sdk_version:o,backend_version:s,...i?{connection_method:i}:{}}}function Yt(e=null){return{cloud_user_id:N(e?.userId),cloud_user_email:N(e?.email),cloud_org_id:N(e?.orgId)}}var F=`openhands-telemetry-consent`,I=`openhands-telemetry-consent-pending-cloud-sync`,L=`openhands-telemetry-consent-pending-local-revocation`,Xt=`openhands-telemetry-consent-change`,Zt=`openhands-telemetry-first-use`,Qt=`openhands-telemetry-session`,$t=`agent-canvas`,en=`history_change`,tn=`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,nn=`https://z.openhands.dev`,rn=`https://us.posthog.com`,R=null,z=null,an,B={},V=!1;function on(){return typeof window<`u`&&window.__AGENT_CANVAS_DO_NOT_TRACK__===!0}function sn(){return V||on()}var H,U=0,W=-1,cn=Object.freeze({client_source:j,client_version:M,package_name:A.name,package_version:A.version}),ln=P({}),un=Yt();function dn(e){ln=P(e)}function G(e){un=Yt(e)}function fn(e){return e?{...e,properties:{...ln,...un,...e.properties,...cn}}:null}function pn(e){V||X()!==`granted`?e.opt_out_capturing():e.opt_in_capturing()}function mn(e,t=!1){e.reset(t),W=-1,pn(e)}function K(e){if(H===void 0||!$())return;let t=H?.distinctId,n=e.get_property(`$user_id`);if(n!=null&&n!==t&&mn(e),H===null){W=U;return}(e.get_property(`$user_id`)!==H.distinctId||W!==U)&&(e.identify(H.distinctId,H.properties),W=U)}function hn(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>e[n]===t[n])}function gn(e){if(e===!1){if(V)return;V=!0,R?.opt_out_capturing(),Z();return}let t=V;if(V=!1,!R&&!z){let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0));B={...B,...t}}t&&(R&&(pn(R),K(R)),Z())}function _n(){return sn()?null:{apiKey:B.apiKey||tn,apiHost:B.apiHost||nn,uiHost:B.uiHost||rn}}function q(){return typeof window<`u`&&typeof localStorage<`u`}async function vn(){if(!q())return null;if(R)return R;try{let{default:e}=await n(async()=>{let{default:e}=await import(`./vendor~module-DyG7x7JT.js`).then(e=>e.t);return{default:e}},__vite__mapDeps([0,1]));return e}catch{return null}}function J(){return!!(V||on()||typeof process<`u`&&{}.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`))}function yn(e){R||(an=e)}async function Y(e=!1){if(R)return R;if(z)return z;z=(async()=>{let t=_n();if(!t)return null;let n=await vn();if(!n)return null;let r=n.init(t.apiKey,{api_host:t.apiHost,ui_host:t.uiHost,opt_out_capturing_by_default:!e,persistence:`localStorage`,persistence_name:$t,consent_persistence_name:`${$t}-consent`,person_profiles:`always`,capture_pageview:en,autocapture:!0,disable_session_recording:!0,bootstrap:an,before_send:fn},$t);return r?(R=r,an=void 0,V?R.opt_out_capturing():X()===`granted`?(R.opt_in_capturing(),K(R)):e||R.opt_out_capturing(),R):null})();try{return await z}finally{R||(z=null)}}function X(){if(!q())return`pending`;if(J())return`denied`;if(we()===`cookie`)return`granted`;try{let e=localStorage.getItem(F);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}function bn(){if(!q())return null;try{let e=localStorage.getItem(I);return e===`granted`||e===`denied`?e:null}catch{return null}}function xn(){if(!q())return null;try{return localStorage.getItem(L)}catch{return null}}function Sn(e){if(!q())return()=>{};let t=t=>{(t.key===F||t.key===I)&&e()};return window.addEventListener(Xt,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(Xt,e),window.removeEventListener(`storage`,t)}}function Z(){q()&&window.dispatchEvent(new Event(Xt))}function Cn(e){if(q())try{localStorage.setItem(I,e)}catch{}}function wn(e){if(!(!q()||!e))try{localStorage.setItem(L,e)}catch{}}function Tn(e){if(q())try{if(localStorage.getItem(L)!==e)return;localStorage.removeItem(L)}catch{}}function En(e){if(q())try{if(e!==void 0&&localStorage.getItem(I)!==e)return;localStorage.removeItem(I),Z()}catch{}}async function Dn(e,{syncToCloud:t=!0}={}){if(q())try{let t=X()===e;if(localStorage.setItem(F,e),sn()||t)return;let n=R??await Y();if(!n)return;e===`granted`?(n.opt_in_capturing(),K(n)):(wn(n.get_distinct_id?.()??null),n.get_property?.(`$user_id`)==null?n.opt_out_capturing():mn(n))}catch{}finally{t&&Cn(e),Z()}}async function Q(e,t={}){let n=e===null?null:{distinctId:e,properties:t};if(H===n||H!=null&&n!==null&&H.distinctId===n.distinctId&&hn(H.properties,t)||(H=n,U+=1,W=-1,!$()))return;let r=R??await Y();r&&$()&&K(r)}function $(){return X()===`granted`}function On(){if(!q())return!1;try{return localStorage.getItem(Zt)===`true`}catch{return!1}}function kn(){if(q())try{localStorage.setItem(Zt,`true`)}catch{}}async function An(){if(J()||On())return;let e=await Y(!0);!e||J()||((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),kn(),X()!==`granted`&&e.opt_out_capturing())}function jn(){if(!q())return!1;try{return sessionStorage.getItem(Qt)===`true`}catch{return!1}}function Mn(){if(q())try{sessionStorage.setItem(Qt,`true`)}catch{}}async function Nn(){if(!$()||X()!==`granted`)return null;let e=await Y();return!e||!$()?null:(e.has_opted_out_capturing?.()&&e.opt_in_capturing(),K(e),e)}async function Pn(){if(jn())return;let e=await Nn();e&&(e.capture(`canvas_new_session`,{is_first_use:!On()}),Mn())}async function Fn(){return(await Nn())?.get_distinct_id?.()??null}async function In(){if(!q())return null;if(X()!==`granted`){let e=xn();if(e)return e}return V||J()?null:(await Y())?.get_distinct_id?.()??null}async function Ln(e,t={}){let n=await Nn();n&&n.capture(e,t)}async function Rn(){if(q()){try{wn(R?.get_distinct_id?.()??null),localStorage.removeItem(F),localStorage.removeItem(Zt)}catch{}En();try{sessionStorage.removeItem(Qt)}catch{}ln=P({}),un=Yt(),H=null,U+=1,W=-1;try{R&&mn(R,!0)}catch{try{R?.opt_out_capturing()}catch{}}finally{Z()}}}var zn=f.createContext(null);function Bn(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`backend-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Vn(e,t){let n=e.backend.kind===`cloud`,r=t.backend.kind===`cloud`;!n&&!r||(G(null),r&&(!n||e.backend.id!==t.backend.id)&&Q(null))}function Hn({children:e}){let t=f.useSyncExternalStore(pe,d,d),n=f.useCallback(()=>{E(),at.invalidateQueries({queryKey:kt.WEB_CLIENT_CONFIG})},[]),r=f.useCallback((e,t)=>{let r=d(),i=he()?.backendId??null,a=he()?.orgId??null,o=t??null;if(e===i&&o===a)return;let s=u(),c=s.find(t=>t.id===e),ee={backend:c??s[0]??ye,orgId:c?o:null};Vn(r.active,ee),ge({backendId:e,orgId:o}),n()},[n]),i=f.useCallback(e=>{let t=d().active,r={...e,id:Bn()},i=[...u(),r];return Vn(t,{backend:r,orgId:null}),me(i),ge({backendId:r.id}),n(),r},[n]),a=f.useCallback((e,t)=>{let r=u().find(t=>t.id===e),i=d().active.backend.id,a=t.host!==void 0&&r!==void 0&&t.host!==r.host,o=t.apiKey!==void 0&&r!==void 0&&t.apiKey!==r.apiKey;me(u().map(n=>n.id===e?{...n,...t,connectionRevision:a||o?(n.connectionRevision??0)+1:n.connectionRevision}:n)),(a||o)&&(ue(e),i===e&&(r?.kind===`cloud`&&(G(null),Q(null)),n()))},[n]),o=f.useCallback(e=>{let t=u().find(t=>t.id===e),r=t?.kind===`cloud`&&d().active.backend.id===t.id;me(u().filter(t=>t.id!==e)),r&&(G(null),Q(null)),Se(e),n()},[n]),s=f.useMemo(()=>({backends:t.backends,active:t.active,setActive:r,addBackend:i,updateBackend:a,removeBackend:o}),[t,r,i,a,o]);return(0,y.jsx)(zn.Provider,{value:s,children:e})}function Un(){let e=f.useContext(zn);if(!e)throw Error(`useActiveBackendContext must be used inside <ActiveBackendProvider>`);return e}function Wn(){let e=f.useContext(zn);return e?e.active:{backend:de()??ye,orgId:null}}export{D as $,Bt as A,kt as B,P as C,Kt as D,M as E,Ft as F,Tt as G,zt as H,Ht as I,O as J,_t as K,It as L,Ut as M,Vt as N,Mt as O,jt as P,yt as Q,Lt as R,Pn as S,j as T,dt as U,At as V,E as W,vt as X,gt as Y,pt as Z,Dn as _,Le as _t,Tn as a,it as at,Ln as b,gn as c,Je as ct,X as d,_ as dt,Ot as et,Fn as f,je as ft,G as g,g as gt,dn as h,Ie as ht,En as i,at as it,Rt as j,Pt as k,bn as l,Ye as lt,Y as m,h as mt,Wn as n,rt as nt,Rn as o,b as ot,In as p,p as pt,wt as q,Un as r,x as rt,yn as s,qe as st,Hn as t,Dt as tt,xn as u,Xe as ut,Q as v,Re as vt,qt as w,An as x,Sn as y,Ae as yt,Nt as z};
@@ -1 +1 @@
1
- import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-CNZTLwH9.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
1
+ import{yt as e}from"./vendor-styling-Ck5D_A2Q.js";import{U as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as n}from"./sdk-section-page-DCoI2dtd.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{c as t,n}from"./agent-server-client-options-EHB23gyx.js";import{S as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as i}from"./proxy-XP6U1Dhv.js";var a=`/api/agent-profiles`;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function s(){return i({backend:o(),method:`GET`,path:a})}async function c(e){return i({backend:o(),method:`GET`,path:`${a}/${encodeURIComponent(e)}`})}async function l(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:t})}async function u(e){return i({backend:o(),method:`DELETE`,path:`${a}/${encodeURIComponent(e)}`})}async function d(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/activate`,body:{}})}var p=e({WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME:()=>h,default:()=>g});function m(){return t().backend.kind===`cloud`}var h=`default`,g=class{static async listProfiles(){return m()?s():new r(n()).listAgentProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getAgentProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveAgentProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteAgentProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameAgentProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateAgentProfile(e)}};export{h as n,p as r,g as t};
1
+ import{r as e}from"./rolldown-runtime-Cyuzqnbw.js";import{c as t,n}from"./agent-server-client-options-EHB23gyx.js";import{C as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as i}from"./proxy-BCCQUna8.js";var a=`/api/agent-profiles`;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function s(){return i({backend:o(),method:`GET`,path:a})}async function c(e){return i({backend:o(),method:`GET`,path:`${a}/${encodeURIComponent(e)}`})}async function l(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:t})}async function u(e){return i({backend:o(),method:`DELETE`,path:`${a}/${encodeURIComponent(e)}`})}async function d(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/activate`,body:{}})}var p=e({WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME:()=>h,default:()=>g});function m(){return t().backend.kind===`cloud`}var h=`default`,g=class{static async listProfiles(){return m()?s():new r(n()).listAgentProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getAgentProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveAgentProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteAgentProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameAgentProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateAgentProfile(e)}};export{h as n,p as r,g as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as o}from"./useMutation-Cszf8mKy.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{O as c,ct as l,dt as u,st as d}from"./active-backend-context-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{t as m}from"./back-nav-button-B2yBiVMB.js";import{t as h}from"./loading-spinner-BeLV0IXf.js";import{t as g}from"./brand-button-CUMfjb99.js";import{i as _}from"./dropdown-classes-BGvOvW2_.js";import{t as v}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as y}from"./use-llm-profiles-SWsuFmFu.js";import{t as b}from"./agent-profiles-service.api-DkeZaqIl.js";import{t as x}from"./use-agent-profiles-Bi8hSkze.js";import{i as S,n as C,t as w}from"./use-can-manage-org-profiles-MzIeEV8F.js";import{t as T}from"./u-edit-DAkcF52u.js";import{r as E}from"./typography-DgcLGdHk.js";import{o as D}from"./extension-module-card-classes-DpeaYhYo.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-ehL-kgeO.js";import{t as N}from"./u-check-circle-BKn1spCL.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-DhAPuXm6.js";import{n as ee}from"./settings-section-header-context-BOJ_Fbak.js";import{t as R}from"./use-save-agent-profile-D-ZHHE94.js";import{n as z}from"./use-activate-agent-profile-8L8Xdghy.js";import{t as B}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as V,t as H}from"./agent-settings-BF8hM6wb.js";var U=e(t(),1),W=e(n(),1),G=r();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:c}=s(`openhands`),l=(0,U.useRef)(null),u=(0,U.useRef)([]),d=o?.current??null,[m,h]=(0,U.useState)();(0,U.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,U.useEffect)(()=>{u.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;l.current?.contains(t)||d?.contains(t)||a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[d,a]);let g=e=>{e(),a()},v=(0,U.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,x=(0,G.jsxs)(`div`,{ref:l,className:p(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,G.jsx)(k,{index:0,icon:(0,G.jsx)(T,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,G.jsx)(k,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(k,{index:2,icon:(0,G.jsx)(S,{width:16,height:16}),label:c(f.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:W.createPortal((0,G.jsx)(`div`,{style:m,children:x}),document.body):x}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:c}=s(`openhands`),[l,u]=(0,U.useState)(!1),d=(0,U.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(f.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:p(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,G.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(f.SETTINGS$PROFILE_DEFAULT)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(C,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(f.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,G.jsx)(K,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>u(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l}){let{t:u}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(h,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:u(f.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(f.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:p(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l},e.name))})}function Y(){let e=a();return o({mutationFn:e=>b.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(f.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(f.ERROR$GENERIC))}},o=()=>{r.isPending||t()},c=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(f.BUTTON$DELETE)})]}):n(f.BUTTON$DELETE)})]});return(0,G.jsx)(j,{isOpen:!0,title:n(f.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(f.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function te({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=x(),o=z(),c=w(),[u,d]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(f.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,G.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(f.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(f.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:u,onClose:()=>d(null)})]})}function ne(){let e=a();return o({mutationFn:({name:e,newName:t})=>b.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function re(e){if(e.agent_kind===`acp`)return{agent_kind:`acp`,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``};let t=e.enable_switch_llm_tool??!0;return{agent_kind:`openhands`,enable_sub_agents:e.enable_sub_agents,enable_switch_llm_tool:t,tool_concurrency_limit:e.tool_concurrency_limit}}function Z(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=ee(),n=R(),r=ne(),{data:i}=x(),{data:a,isLoading:o}=y(),[c,p]=(0,U.useState)(`list`),[h,_]=(0,U.useState)(``),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(null),[D,k]=(0,U.useState)(``),[j,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),z=(0,U.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==S?.name&&L.has(h)),[h,c,L,S?.name]),V=(0,U.useCallback)(()=>{_(``),C(null),T({agent_kind:`openhands`}),k(I),M(null),p(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await b.getProfile(t.name,`encrypted`)).profile;C(e),T(re(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),p(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(f.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{p(`list`),C(null),_(``),T(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!j||!z)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){d(e(f.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){d(t instanceof Error?t.message:e(f.ERROR$GENERIC));return}let i=h.trim(),a=S?.name,o=c===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=B(c===`edit`?S:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?f.SETTINGS$PROFILE_CREATED:f.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(f.ERROR$GENERIC))}finally{P(!1)}},[j,z,D,h,c,S,n,r,e,K]);if(c===`list`)return(0,G.jsx)(te,{onAddProfile:V,onEditProfile:W});let J=e(c===`edit`?f.SETTINGS$EDIT_AGENT_PROFILE:f.SETTINGS$ADD_AGENT_PROFILE),Y=c===`edit`&&S?e(f.SETTINGS$PROFILE_LOADED,{name:S.name}):e(f.SETTINGS$PROFILE_SAVE_HINT),X=j?.agentType!==`acp`,Z=c===`edit`&&h!==S?.name,Q=S?.agent_kind===`openhands`?S.llm_profile_ref:``,$=c===`edit`&&X&&D!==Q,ie=c===`create`||!!j?.isDirty||Z||$;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(m,{testId:`back-to-agent-profiles`,onClick:K,children:e(f.BUTTON$BACK)}),(0,G.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:w,onSaveControlChange:M},c===`edit`?`edit-${S?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(v,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(f.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(f.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!z||N||!j?.isValid||!ie,"aria-busy":N,children:e(N?f.SETTINGS$SAVING:f.BUTTON$SAVE)})]})]})}var Q={hideTitle:!1},$=i(function(){return(0,G.jsx)(Z,{})});export{$ as default,Q as handle};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,bt as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as o}from"./useMutation-Cszf8mKy.js";import{t as s}from"./useTranslation-CCgUjPJF.js";import{O as c,ct as l,dt as u,st as d}from"./active-backend-context-BETEdaJl.js";import{K as f,t as p}from"./utils-CbjwNcR-.js";import{t as m}from"./back-nav-button-oDvIxpQ5.js";import{t as h}from"./loading-spinner-BJc2J0Dw.js";import{t as g}from"./brand-button-CGUwj6zK.js";import{i as _}from"./dropdown-classes-DyyMaaXl.js";import{t as v}from"./settings-dropdown-input-Df_HXRk4.js";import{t as y}from"./use-llm-profiles-U4u1gzuk.js";import{t as b}from"./agent-profiles-service.api-CiMVQAIT.js";import{t as x}from"./use-agent-profiles-YsBlt3tT.js";import{i as S,n as C,t as w}from"./use-can-manage-org-profiles-Dt4YkPO7.js";import{t as T}from"./u-edit-DAkcF52u.js";import{r as E}from"./typography-BdAApXGl.js";import{o as D}from"./extension-module-card-classes-DpeaYhYo.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-CDHZEVeN.js";import{t as N}from"./u-check-circle-BKn1spCL.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-DbqcSiVW.js";import{n as ee}from"./settings-section-header-context-BOJ_Fbak.js";import{t as R}from"./use-save-agent-profile-xpHBxMZM.js";import{n as z}from"./use-activate-agent-profile-DO6SNPkK.js";import{t as B}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as V,t as H}from"./agent-settings-BnzyTgCb.js";var U=e(t(),1),W=e(n(),1),G=r();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:c}=s(`openhands`),l=(0,U.useRef)(null),u=(0,U.useRef)([]),d=o?.current??null,[m,h]=(0,U.useState)();(0,U.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,U.useEffect)(()=>{u.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;l.current?.contains(t)||d?.contains(t)||a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[d,a]);let g=e=>{e(),a()},v=(0,U.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,x=(0,G.jsxs)(`div`,{ref:l,className:p(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,G.jsx)(k,{index:0,icon:(0,G.jsx)(T,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,G.jsx)(k,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(k,{index:2,icon:(0,G.jsx)(S,{width:16,height:16}),label:c(f.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:W.createPortal((0,G.jsx)(`div`,{style:m,children:x}),document.body):x}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:c}=s(`openhands`),[l,u]=(0,U.useState)(!1),d=(0,U.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(f.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:p(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,G.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(f.SETTINGS$PROFILE_DEFAULT)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(C,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(f.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,G.jsx)(K,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>u(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l}){let{t:u}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(h,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:u(f.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(f.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:p(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l},e.name))})}function Y(){let e=a();return o({mutationFn:e=>b.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(f.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(f.ERROR$GENERIC))}},o=()=>{r.isPending||t()},c=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(f.BUTTON$DELETE)})]}):n(f.BUTTON$DELETE)})]});return(0,G.jsx)(j,{isOpen:!0,title:n(f.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(f.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function te({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=x(),o=z(),c=w(),[u,d]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(f.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,G.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(f.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(f.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:u,onClose:()=>d(null)})]})}function ne(){let e=a();return o({mutationFn:({name:e,newName:t})=>b.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function re(e){let t=e.secret_refs??null;if(e.agent_kind===`acp`)return{agent_kind:`acp`,mcp_server_refs:e.mcp_server_refs??null,secret_refs:t,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``};let n=e.enable_switch_llm_tool??!0;return{agent_kind:`openhands`,mcp_server_refs:e.mcp_server_refs??null,enable_sub_agents:e.enable_sub_agents,enable_switch_llm_tool:n,tool_concurrency_limit:e.tool_concurrency_limit,secret_refs:t}}function Z(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=ee(),n=R(),r=ne(),{data:i}=x(),{data:a,isLoading:o}=y(),[c,p]=(0,U.useState)(`list`),[h,_]=(0,U.useState)(``),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(null),[D,k]=(0,U.useState)(``),[j,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),z=(0,U.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==S?.name&&L.has(h)),[h,c,L,S?.name]),V=(0,U.useCallback)(()=>{_(``),C(null),T({agent_kind:`openhands`}),k(I),M(null),p(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await b.getProfile(t.name,`encrypted`)).profile;C(e),T(re(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),p(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(f.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{p(`list`),C(null),_(``),T(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!j||!z)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){d(e(f.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){d(t instanceof Error?t.message:e(f.ERROR$GENERIC));return}let i=h.trim(),a=S?.name,o=c===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=B(c===`edit`?S:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?f.SETTINGS$PROFILE_CREATED:f.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(f.ERROR$GENERIC))}finally{P(!1)}},[j,z,D,h,c,S,n,r,e,K]);if(c===`list`)return(0,G.jsx)(te,{onAddProfile:V,onEditProfile:W});let J=e(c===`edit`?f.SETTINGS$EDIT_AGENT_PROFILE:f.SETTINGS$ADD_AGENT_PROFILE),Y=c===`edit`&&S?e(f.SETTINGS$PROFILE_LOADED,{name:S.name}):e(f.SETTINGS$PROFILE_SAVE_HINT),X=j?.agentType!==`acp`,Z=c===`edit`&&h!==S?.name,Q=S?.agent_kind===`openhands`?S.llm_profile_ref:``,$=c===`edit`&&X&&D!==Q,ie=c===`create`||!!j?.isDirty||Z||$;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(m,{testId:`back-to-agent-profiles`,onClick:K,children:e(f.BUTTON$BACK)}),(0,G.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:w,onSaveControlChange:M},c===`edit`?`edit-${S?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(v,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(f.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(f.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!z||N||!j?.isValid||!ie,"aria-busy":N,children:e(N?f.SETTINGS$SAVING:f.BUTTON$SAVE)})]})]})}var Q={hideTitle:!1},$=i(function(){return(0,G.jsx)(Z,{})});export{$ as default,Q as handle};
@@ -0,0 +1,88 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/profiles-service.api-B5thiTI3.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js","assets/vendor-styling-Ck5D_A2Q.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/proxy-BCCQUna8.js","assets/agent-profiles-service.api-CiMVQAIT.js","assets/secrets-service-C3CNNEpY.js","assets/active-backend-context-BETEdaJl.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-CbjwNcR-.js","assets/hooks-service-tzRqtAlm.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-BETEdaJl.js";import{D as a}from"./utils-CbjwNcR-.js";import{a as o,c as s,d as c,n as l,t as u,u as ee}from"./agent-server-client-options-EHB23gyx.js";import{d as te,n as ne,s as d}from"./agent-server-config-C_x8Otd9.js";import{S as re,_ as f,l as p,p as m,v as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as g}from"./proxy-BCCQUna8.js";import{r as ie,t as _}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";import{n as ae}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js";import{t as v}from"./settings-CKqk8ZnH.js";import{t as y}from"./settings-service.api-CYBTLGOd.js";import{t as oe}from"./profiles-service.api-B5thiTI3.js";import{f as b,o as se,s as x}from"./acp-providers-DOKcGeaV.js";import{c as S,n as C,r as w}from"./skill-enablement-BBKya60C.js";import{d as T,f as ce,r as le}from"./llm-subscription-DTqtBCWz.js";import{t as ue}from"./llm-subscription-service-LGYVzyAc.js";var E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function de(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+`-`+E[e[t+4]]+E[e[t+5]]+`-`+E[e[t+6]]+E[e[t+7]]+`-`+E[e[t+8]]+E[e[t+9]]+`-`+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}var fe=new Uint8Array(16);function pe(){return crypto.getRandomValues(fe)}function D(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():me(e,t,n)}function me(e,t,n){e||={};let r=e.random??e.rng?.()??pe();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return de(r)}var O=new Map;function he(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function ge(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function _e(e={}){let t=l(e),n=t.host,r=O.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new f(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();O.set(n,i);try{return await i}catch(e){throw O.delete(n),e}}async function k(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?he(n)?n:ge(await _e(t),n):_e(t)}var A=`openhands-agent-server-conversation-metadata`,ve=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),j=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(A);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},ye=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(A);return}window.localStorage.setItem(A,JSON.stringify(e))}},M=e=>j()[e]??null,N=(e,t)=>{let n=j();n[e]=t,ye(n)},be=(e,t)=>{N(e,{selected_repository:null,selected_branch:null,git_provider:null,...M(e)??{},...t})},P=e=>{let t=j();e in t&&(delete t[e],ye(t))};function xe(e){if(!e?.id)return e;let t=M(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function F(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}function Se(){let e=s().backend;return e.kind===`cloud`?e:c().find(e=>e.kind===`cloud`&&!!e.apiKey)??null}async function Ce(e=20,t){let n=F(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>xe(e)),next_page_id:i?.next_page_id??null}}async function I(e){if(e.length===0)return[];let t=F(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(xe)}async function we(e,t){return await g({backend:t??F(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:i})}async function Te(e){return g({backend:F(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function Ee(e){await g({backend:F(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function De(e,t){return await g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function Oe(e,t){return g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{title:t}})}async function ke(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function Ae(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function je(e,t){let n=F(),r=new URLSearchParams;return r.append(`file_path`,t),await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function Me(e,t){let n=F(),r=new URLSearchParams;r.append(`path`,t);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/files?${r.toString()}`});return Array.isArray(i)?i:[]}async function Ne(e,t){let n=t??F(),r=new URLSearchParams;return r.set(`ids`,e),(await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${r.toString()}`}))?.[0]??null}function Pe(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}function Fe(e){if(!e?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let t=0,n=null,r=null;for(let i of Object.values(e.usage_to_metrics))t+=i.accumulated_cost,n===null&&i.max_budget_per_task!==null&&(n=i.max_budget_per_task),i.accumulated_token_usage&&(r=r===null?{...i.accumulated_token_usage}:{prompt_tokens:r.prompt_tokens+i.accumulated_token_usage.prompt_tokens,completion_tokens:r.completion_tokens+i.accumulated_token_usage.completion_tokens,cache_read_tokens:r.cache_read_tokens+i.accumulated_token_usage.cache_read_tokens,cache_write_tokens:r.cache_write_tokens+i.accumulated_token_usage.cache_write_tokens,context_window:Math.max(r.context_window,i.accumulated_token_usage.context_window),per_turn_token:Math.max(r.per_turn_token,i.accumulated_token_usage.per_turn_token)});return{accumulated_cost:t,max_budget_per_task:n,accumulated_token_usage:r}}function Ie(e){return Fe(e.stats)}var Le=`canvas_ui`,L=`canvas_ui_control`,Re=`ClientAction_${L}`,ze={name:L,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
3
+
4
+ They will NOT see the files you wrote, the terminal output, or the browser
5
+ unless you call this tool to switch the right-side panel to the relevant
6
+ tab. Call this every time you finish work that produces something the user
7
+ should look at — don't rely on them noticing on their own.
8
+
9
+ When to call (pick the most specific option that matches your last action):
10
+
11
+ * You wrote or modified a single file (ANY language, ANY size — including
12
+ small scripts like a hello-world bash file) →
13
+ command="navigate_to_file", path=<workspace-relative path of that file>
14
+
15
+ * You generated an HTML page, image, SVG, PDF, markdown report, or other
16
+ previewable artifact →
17
+ command="show_preview", path=<that file>
18
+
19
+ * You finished editing multiple files in one logical step →
20
+ command="open_tab", tab="files"
21
+ (The Files tab automatically renders a diff view when the workspace has
22
+ uncommitted git changes, which covers the "highlight changes" case.)
23
+
24
+ * You ran a long-running terminal command, or one whose output the user
25
+ should inspect →
26
+ command="open_tab", tab="terminal"
27
+
28
+ * You browsed to a URL the user should see →
29
+ First call browser_get_state(include_screenshot=true) after your final
30
+ browser interaction so Agent Canvas has a screenshot to display, then call
31
+ command="open_tab", tab="browser"
32
+ (browser_navigate alone only updates the URL; without browser_get_state,
33
+ the Browser tab will open without a screenshot.)
34
+
35
+ Call this BEFORE writing your chat-message summary of the change, so the
36
+ artifact is visible while the user reads what you did. One canvas_ui_control
37
+ call per logical step is enough — don't repeat it for the same file or tab in
38
+ the same turn.`,parameters:{type:`object`,additionalProperties:!1,properties:{command:{type:`string`,enum:[`navigate_to_file`,`open_tab`,`show_preview`],description:`UI command to dispatch.`},path:{type:`string`,description:`Workspace-relative file path. Required for navigate_to_file and show_preview; ignored otherwise.`},tab:{type:`string`,enum:[`files`,`browser`,`vscode`,`terminal`,`planner`,`tasklist`],description:`Tab to open. Required for open_tab; ignored otherwise.`}},required:[`command`]},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},R=`launch_child_conversation`,Be=`ClientAction_${R}`,Ve=`[child-conversation] `,He=[`local`,`cloud`],Ue=[`worktree`,`shared`],We=`1.37.1`,Ge={name:R,description:`Start a NEW, independent conversation to work on a well-scoped task in parallel with this one, without the user having to run any CLI command. The new conversation is recorded as a child of this one.
39
+
40
+ The child runs on its own. It does not block you, you do not see its output,
41
+ and it cannot see this conversation's history — everything it needs must be in
42
+ the task brief.
43
+
44
+ Choosing target:
45
+
46
+ * target="local" — runs on the same machine, in this conversation's workspace.
47
+ Fast, no repository clone, no sandbox provisioning. Use this by default when
48
+ the work is on code that is already checked out here.
49
+
50
+ * target="cloud" — runs on OpenHands Cloud in its own isolated sandbox, from a
51
+ git repository. Use this when the work should not touch the user's machine or
52
+ when it needs a repository that is not checked out locally. Requires the user
53
+ to have an OpenHands Cloud backend connected in Agent Canvas; if none is
54
+ connected you will be told so and should fall back to target="local".
55
+
56
+ Writing the task brief:
57
+
58
+ * Put everything the child needs in "task": the goal, the relevant file paths,
59
+ the constraints, the expected deliverable, and how it should report back.
60
+ * Keep each child's scope independent of its siblings so parallel children do
61
+ not fight over the same files.
62
+ * One call per delegated task. Do NOT call this tool twice for the same task.
63
+
64
+ Parameter rules (a call that breaks one of these launches nothing and comes
65
+ back with corrective guidance):
66
+
67
+ * "repository" and "branch" apply to target="cloud" only. A local child always
68
+ inherits this conversation's workspace, so do not pass them with
69
+ target="local".
70
+ * "isolation" applies to target="local" only. Cloud sandboxes are always
71
+ isolated, so do not pass it with target="cloud".
72
+ * isolation="worktree" (the default) gives the child its own git worktree and
73
+ branch, cut from the repository's default branch — it will NOT see this
74
+ conversation's uncommitted or committed work. isolation="shared" puts the
75
+ child in this conversation's exact directory; only choose it when the child
76
+ genuinely must see work in progress, and expect the two agents to conflict.
77
+
78
+ What comes back: this tool is acknowledged immediately, before the conversation
79
+ exists. The real outcome arrives moments later as a follow-up message starting
80
+ with "${Ve.trim()}" that carries the child's
81
+ conversation id, URL, target and initial status — or an error with guidance.
82
+ Wait for it, then tell the user what you launched and give them the URL. If it
83
+ reports an error, fix the parameters and call this tool again.`,parameters:{type:`object`,additionalProperties:!1,properties:{target:{type:`string`,enum:[...He],description:`Where the child runs. 'local' reuses this machine and this conversation's workspace; 'cloud' runs in an isolated OpenHands Cloud sandbox.`},task:{type:`string`,description:`Self-contained task brief, sent as the child's first message. The child cannot see this conversation, so state the goal, constraints, expected output and handoff criteria.`},title:{type:`string`,description:`Optional short title for the child conversation. Omit to let it title itself from the task.`},repository:{type:`string`,description:`target='cloud' only. Repository to clone into the sandbox, as 'owner/repo'. Defaults to this conversation's repository when it has one.`},branch:{type:`string`,description:`target='cloud' only, and only together with 'repository'. Defaults to the repository's default branch.`},isolation:{type:`string`,enum:[...Ue],description:`target='local' only. 'worktree' (default) gives the child its own git worktree and branch; 'shared' runs it in this conversation's exact directory.`}},required:[`target`,`task`]},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0}},Ke=`.agents_tmp/PLAN.md`,qe=`system_prompt_planning.j2`,Je=`planning_file_editor`,z=`plannerparent`,Ye=`PLAN.MD`,Xe=[`The plan must follow this structure exactly:`,``,`1. OBJECTIVE`,` * Summarize the goal of the plan in one or two sentences.`,` * Restate the problem in clear operational terms.`,``,`2. CONTEXT SUMMARY`,` * Briefly describe the relevant system components, files, or data involved.`,` * Mention any dependencies or constraints (technical, organizational, or external).`,``,`3. APPROACH OVERVIEW`,` * Outline the chosen approach at a high level.`,` * Mention why it was selected (short rationale) if alternatives were considered.`,``,`4. IMPLEMENTATION STEPS`,` * Provide a step-by-step plan for execution.`,` * Each step should include:`,` - a **goal** (what this step accomplishes),`,` - a **method** (how to do it, briefly),`,` - and optionally a **reference** (file, module, or function impacted).`,``,`5. TESTING AND VALIDATION`,` * Describe how the implementation can be verified or validated.`,` * This section should describe what success looks like — expected outputs, behaviors, or conditions.`].join(`
84
+ `),Ze=[`<IMPORTANT_PLANNING_BOUNDARIES>`,`You are a Planning Agent that can ONLY create plans - you CANNOT execute code or make changes.`,``,`Create or update the plan for the current task in the configured PLAN.md file.`,``,`After you finalize the plan in PLAN.md:`,`- Do NOT ask "Ready to proceed?" or offer to execute the plan`,`- Do NOT attempt to run any implementation commands`,`- Instead, tell the user they can click the **Build** button below the plan preview to switch to the code agent and execute the plan.`,``,`Your role ends when the plan is finalized. Implementation is handled by the code agent.`,`</IMPORTANT_PLANNING_BOUNDARIES>`].join(`
85
+ `);function Qe(e){return`${e.replace(/\/+$/,``)}/${Ke}`}function $e(e){if(!e)return!1;let t=e.replace(/\\/g,`/`).toUpperCase();return t===Ye||t.endsWith(`/${Ye}`)}function et(e,t){return e?.tags?.[z]===t}function tt(e,t){return t?e?.find(e=>et(e,t))?.id??null:null}var nt=[`terminal`,`file_editor`,`task_tracker`],rt=`browser_tool_set`,it=`task_tool_set`,at=500;function ot(e){return typeof e==`number`?e:at}function st(){return!0}function B(e){if(typeof e==`string`){let t=e.trim();if(!t)return null;try{return B(JSON.parse(t))}catch{return null}}if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;return!t.services||typeof t.services!=`object`?null:t}async function ct(){let e;try{e=l({timeout:3e3})}catch{return null}let n=B(t({host:e.host})?.runtime_services);if(n)return n;try{return B((await new re(e).getServerInfo()).runtime_services)}catch{return null}}function lt(e){let t=B(e);if(!t?.services)return;let n=[];n.push(`<RUNTIME_SERVICES>`),t.mode?n.push(`You are running inside an agent-canvas dev stack started in '${t.mode}' mode.`):n.push(`You are running inside an agent-canvas dev stack.`),n.push(`The following services are reachable from your sandbox. URLs are written`,`from your point of view (i.e., as you should curl/fetch them).`,``);let{agent_server:r,ingress:i,automation:a}=t.services,{frontend:o}=t.services;r?.url_from_agent&&n.push(`* Agent Server (you): ${r.url_from_agent}`,` ${r.description??`The agent-server hosting your tool calls.`}`),i?.url_from_agent&&n.push(`* Ingress: ${i.url_from_agent}`,` ${i.description??`Unified entry point for browser-facing traffic.`}`),o?.url_from_agent&&n.push(`* Frontend: ${o.url_from_agent}`,` ${o.description??`Frontend dev server.`}`),a?.url_from_agent?(n.push(`* Automation backend: ${a.url_from_agent}`,` ${a.description??`OpenHands Automations service.`}`),a.docs_url&&n.push(` Docs: ${a.docs_url}`),a.openapi_url&&n.push(` OpenAPI: ${a.openapi_url}`),a.auth_env_var&&n.push(` Auth: header 'X-Session-API-Key: $${a.auth_env_var}'`)):n.push(`* Automation backend: not running in this dev mode (skip /api/automation calls).`);let s=r?.url_from_agent;return n.push(``,`Trust this block over guessing: do not assume any other URLs are running.`),s&&n.push(`In particular, ${s} inside your sandbox is the Agent Server`,`you are running inside of — NOT the automation backend.`),n.push(`</RUNTIME_SERVICES>`),n.join(`
86
+ `)}function ut(e){let{host:t}=l();return`${t}/api/conversations/${e}`}function dt(e){return`Conversation ${e.slice(0,5)}`}function V(e){let t=M(e.id),n=e.agent?.kind===`ACPAgent`,r=n?e.tags?.acpserver??e.agent?.acp_server??null:null;return{id:e.id,created_by_user_id:null,selected_repository:t?.selected_repository??null,selected_branch:t?.selected_branch??null,git_provider:t?.git_provider??null,selected_workspace:t?.selected_workspace??null,active_profile:t?.active_profile??null,title:e.title?.trim()?e.title:dt(e.id),trigger:null,pr_number:[],agent_kind:n?`acp`:`openhands`,acp_server:r,tags:e.tags??null,launched_agent_profile:e.launched_agent_profile??null,llm_model:n?b({runtimeName:e.current_model_name,runtimeId:e.current_model_id,configured:e.agent?.acp_model,sdkLlm:e.agent?.llm?.model}):e.agent?.llm?.model??v.llm_model,metrics:e.metrics?{accumulated_cost:e.metrics.accumulated_cost??null,max_budget_per_task:e.metrics.max_budget_per_task??null,accumulated_token_usage:e.metrics.accumulated_token_usage?{prompt_tokens:e.metrics.accumulated_token_usage.prompt_tokens??0,completion_tokens:e.metrics.accumulated_token_usage.completion_tokens??0,cache_read_tokens:e.metrics.accumulated_token_usage.cache_read_tokens??0,cache_write_tokens:e.metrics.accumulated_token_usage.cache_write_tokens??0,context_window:e.metrics.accumulated_token_usage.context_window??0,per_turn_token:e.metrics.accumulated_token_usage.per_turn_token??0}:null}:Fe(e.stats),created_at:e.created_at,updated_at:e.updated_at,execution_status:e.execution_status??a.IDLE,sandbox_status:e.sandbox_status??null,conversation_url:ut(e.id),session_api_key:l().apiKey??null,sandbox_id:null,workspace:{working_dir:e.workspace?.working_dir??d()},public:!1,sub_conversation_ids:e.sub_conversation_ids??[]}}function ft(e){return{items:e.items.filter(e=>!e.tags?.[z]).map(V),next_page_id:e.next_page_id??null}}var pt=`acpserver`,H=`clientsource`,mt=`agentcanvas`,ht=`automationtrigger`,gt=`automationid`,U=`automationname`,_t=`automationrunid`,vt=[ht,gt,U,_t],yt=new Set([pt,H,ht,gt,U,_t,`title`,`git_provider`,`repo_name`,`repo`,`repository`,`selected_branch`,`branch`,`archiveworkspacepath`,`workspace`,`working_dir`,z]),bt=[`origin`];function xt(e){if(!e)return[];let t=e=>{let t=bt.indexOf(e.trim().toLowerCase());return t===-1?1/0:t};return Object.entries(e).filter(([e,t])=>!yt.has(e.trim().toLowerCase())&&typeof t==`string`&&(t===``||t.trim().length>0)).sort(([e],[n])=>{let r=t(e),i=t(n);return r===i?e.localeCompare(n):r-i})}var St=`gAAAAA`,Ct=new Set([`schema_version`,`agent_settings`,`workspace`,`conversation_id`,`initial_message`,`plugins`]);function W(e){return!e||typeof e!=`object`||Array.isArray(e)?{}:structuredClone(e)}function wt(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function Tt(e){let t=W(e);t.model=typeof t.model==`string`&&t.model.trim().length>0?t.model:v.llm_model;let n=wt(t.api_key);n?t.api_key=n:delete t.api_key;let r=wt(t.base_url);return r?t.base_url=r:delete t.base_url,ce(t)?(t.auth_type=le,t.subscription_vendor=T,delete t.api_key):(delete t.auth_type,delete t.subscription_vendor),t}function G(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function K(e){return typeof e==`string`?e.startsWith(St):Array.isArray(e)?e.some(K):G(e)?Object.values(e).some(K):!1}function Et(e){return G(e)?Object.values(e).some(K):!1}function Dt(e){return e.confirmation_mode===!0?e.security_analyzer===`llm`?{kind:`ConfirmRisky`,threshold:`HIGH`,confirm_unknown:!0}:{kind:`AlwaysConfirm`}:{kind:`NeverConfirm`}}function Ot(e){switch(e.security_analyzer){case`llm`:return{kind:`LLMSecurityAnalyzer`};case`pattern`:return{kind:`PatternSecurityAnalyzer`};case`policy_rail`:return{kind:`PolicyRailSecurityAnalyzer`};default:return}}function kt(e){return!!e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.name==`string`}function q(e,t){return e===rt?st()&&n(e):e===it?t.enable_sub_agents===!0&&n(e):!0}function At(e){let t=new Map;for(let n of nt)q(n,e)&&t.set(n,{name:n,params:{}});for(let n of[rt,it])q(n,e)&&t.set(n,{name:n,params:{}});let n=e.tools;if(Array.isArray(n)&&n.every(e=>kt(e)))for(let r of n)q(r.name,e)&&t.set(r.name,{name:r.name,params:W(r.params)});return Array.from(t.values())}function jt(e,t){let n=[e?.trim(),t?.trim()].filter(Boolean);return n.length===0?null:{role:`user`,content:[{type:`text`,text:n.join(`
87
+
88
+ `)}],run:!0}}function Mt(){return ae.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/OpenHands/OpenHands/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function J(e,t,n={},r){let i=lt(t),a=W(e.agent_context),o=Array.isArray(a.skills)?a.skills:[],s=n.disabledSkills??[],c=new Set(s),l=C(n),u=[...o.filter(e=>typeof e.name!=`string`||!c.has(e.name)),...Mt().filter(e=>e.name===r||l(e.name))];return{...a,skills:u,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,disabled_skills:s,...i?{system_message_suffix:i}:{}}}function Nt(e){return W(e.agent_settings).agent_kind===`acp`}function Pt(e){let t=W(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function Ft(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=x(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function It(e,t,n){let r=W(e.agent_settings),i={agent_kind:`acp`,agent_context:J(r,t,S(e),w(n))};for(let e of _){if(e===`acp_model`||e===`acp_env`)continue;let t=e===`acp_command`?Ft(r):r[e];t!=null&&(i[e]=t)}let a=W(r.mcp_config);Object.keys(a).length>0&&(i.mcp_config=a);let o=typeof r.acp_server==`string`?r.acp_server:void 0,s=b({configured:r.acp_model,providerDefault:se(o)});return s&&(i.acp_model=s),i}function Lt(e,t,n){let r=W(e.agent_settings),i=Tt(r.llm);i.stream=!0;let a=W(r.mcp_config);Object.keys(a).length===0&&delete r.mcp_config,delete r.acp_server;for(let e of _)delete r[e];return delete r.acp_env,{...r,llm:i,agent_context:J(r,t,S(e),w(n)),tools:At(r)}}function Rt(e,t,n){return Nt(e)?It(e,t,n):Lt(e,t,n)}function zt(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=W(t.conversation_settings),s=jt(n,r);return Ct.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??d()},...s?{initial_message:s}:{},...i?.length?{plugins:i.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Bt(e){if(!e?.length)return;let t=ee(),n=t?Pe(t):{},r={};for(let t of e){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}return r}function Vt(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Nt(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=Rt(t,e.runtimeServicesInfo,e.query),a=n?Pt(t):void 0,o=zt(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[ze,Ge]:[],confirmation_policy:Dt(o),max_iterations:ot(o.max_iterations),stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a?s.tags={[pt]:a,[H]:mt}:s.tags={[H]:mt},!e.agentProfileId&&e.secretsEncrypted&&(!n||Et(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId),e.parentConversationId&&(s.parent_conversation_id=e.parentConversationId);let c=Ot(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config?s.hook_config=o.hook_config:e.workspaceHookConfig&&(s.hook_config=e.workspaceHookConfig);let l={...o.tool_module_qualnames??{}};delete l[Le],delete l[L],delete l[R],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions);let u=Bt(e.customSecrets);return u&&(s.secrets=u),s}function Ht(e){let t=W(e.encryptedAgentSettings),n=Tt(t.llm);n.stream=!0;let r=Qe(e.workingDir),i=J(t,void 0,e.skillEnablement),a=i.system_message_suffix;i.system_message_suffix=typeof a==`string`?`${Ze}\n\n${a}`:Ze;let o=jt(e.initialMessage),s={agent:{kind:`Agent`,llm:n,tools:[{name:`glob`,params:{}},{name:`grep`,params:{}},{name:Je,params:{plan_path:r}}],system_prompt_filename:qe,system_prompt_kwargs:{plan_structure:Xe},agent_context:i,condenser:{kind:`LLMSummarizingCondenser`,llm:{...n,usage_id:`planning_condenser`},max_size:100,keep_first:6}},workspace:{kind:`LocalWorkspace`,working_dir:e.workingDir},client_tools:[],confirmation_policy:{kind:`NeverConfirm`},max_iterations:e.maxIterations??at,stuck_detection:!0,autotitle:!1,worktree:!1,parent_conversation_id:e.parentConversationId,tags:{[z]:e.parentConversationId},...o?{initial_message:o}:{}};e.secretsEncrypted&&(s.secrets_encrypted=!0);let c=Bt(e.customSecrets);return c&&(s.secrets=c),s}async function Ut(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./profiles-service.api-B5thiTI3.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=await n.getProfile(t,`encrypted`);return G(r.config)?r.config:null}catch(e){return console.warn(`Falling back: could not resolve LLM profile ${t}`,e),null}}async function Wt(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./agent-profiles-service.api-CiMVQAIT.js`).then(e=>e.r);return{default:e}},__vite__mapDeps([7,1,2,3,4,5,6])),{profiles:r}=await n.listProfiles(),i=r.find(e=>e.id===t&&e.llm_profile_ref);return i?.llm_profile_ref?await Ut(i.llm_profile_ref):null}catch(e){return console.warn(`Falling back to global agent settings: could not resolve the LLM for agent profile ${t}`,e),null}}async function Gt(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-C3CNNEpY.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),[r,i]=await Promise.all([y.getSettingsForConversation(),n.getSecrets()]),a=(t.parentActiveProfileName?await Ut(t.parentActiveProfileName):null)??(t.parentAgentProfileId?await Wt(t.parentAgentProfileId):null),o=a?{...r.agentSettings,llm:a}:r.agentSettings;await Y(o);let s=ot(r.conversationSettings.max_iterations);return Ht({...t,encryptedAgentSettings:o,secretsEncrypted:r.secretsEncrypted,customSecrets:i,maxIterations:s,skillEnablement:r.skillEnablement})}var Kt=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Y(e){if(ce(W(e.llm))&&!(await ue.getOpenAIStatus()).connected)throw Error(Kt)}async function qt(t){let[{SecretsService:n},{default:r}]=await Promise.all([e(()=>import(`./secrets-service-C3CNNEpY.js`).then(e=>e.n),__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),e(()=>import(`./hooks-service-tzRqtAlm.js`),__vite__mapDeps([14,2,1,3,4,5]))]),[i,a,o,s]=await Promise.all([y.getSettingsForConversation(),n.getSecrets(),ct(),r.loadWorkspaceHooks(t.hooksProjectDir)]),{agentSettings:c,conversationSettings:l,secretsEncrypted:u}=i;return t.agentProfileId||await Y(c),Vt({...t,encryptedAgentSettings:c,encryptedConversationSettings:l,secretsEncrypted:u,customSecrets:a,runtimeServicesInfo:o,workspaceHookConfig:s})}function Jt(){return{hooks:[]}}function Yt(e,t){if(!t)return;let n=new Set(t.profiles.map(e=>e.name));if(e&&n.has(e))return e;if(t.active_profile&&n.has(t.active_profile))return t.active_profile}var Xt=`1970-01-01T00:00:00.000Z`,Zt=300*1e3,Qt=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function X(){return Error(Qt)}function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $t(e){return typeof e==`number`?e:null}function Q(e){return typeof e==`number`?e:0}function $(e){return typeof e==`string`?e:null}function en(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Xt}function tn(e){return Z(e)?{prompt_tokens:Q(e.prompt_tokens),completion_tokens:Q(e.completion_tokens),cache_read_tokens:Q(e.cache_read_tokens),cache_write_tokens:Q(e.cache_write_tokens),context_window:Q(e.context_window),per_turn_token:Q(e.per_turn_token)}:null}function nn(e){return Z(e)?{accumulated_cost:$t(e.accumulated_cost),max_budget_per_task:$t(e.max_budget_per_task),accumulated_token_usage:tn(e.accumulated_token_usage)}:null}function rn(e){return Z(e)?e:null}function an(e){if(!Z(e))return null;let t=Z(e.llm)?{model:$(e.llm.model)}:null;return{kind:$(e.kind),acp_server:$(e.acp_server),acp_model:$(e.acp_model),llm:t}}function on(e){return Z(e)?{working_dir:$(e.working_dir)}:null}function sn(e){if(!Z(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function cn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):null}function ln(e){if(!Z(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function un(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function dn(e,t){let n=un(e),r=un(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function fn(e){if(!Z(e)||typeof e.id!=`string`||!e.id.trim())throw X();return{id:e.id.trim(),title:$(e.title),created_at:en(e,`created_at`,`createdAt`),updated_at:en(e,`updated_at`,`updatedAt`),execution_status:$(e.execution_status),sandbox_status:$(e.sandbox_status),metrics:nn(e.metrics),stats:rn(e.stats),agent:an(e.agent),workspace:on(e.workspace),tags:sn(e.tags),launched_agent_profile:ln(e.launched_agent_profile),sub_conversation_ids:cn(e.sub_conversation_ids),current_model_id:$(e.current_model_id),current_model_name:$(e.current_model_name)}}function pn(e){if(!Array.isArray(e))throw X();return e.map(fn)}function mn(e){if(Array.isArray(e))return{items:pn(e),next_page_id:null};if(!Z(e))throw X();return{items:pn(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var hn=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function gn(e){let t=e??`idle`;return hn.has(t)?t:`idle`}function _n(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var vn=class{static async sendMessage(e,t,n){let r=s().backend,i=n?.conversationUrl??null,a=n?.sessionApiKey??null;if(r.kind===`cloud`){if(!i||!a){let[t]=await I([e]);i=t?.conversation_url?.trim()??null,a=t?.session_api_key?.trim()??null}if(!i||!a)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await g({backend:r,method:`POST`,hostOverride:o(i),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:a}),t}return await new h(l({conversationUrl:i,sessionApiKey:a})).sendEvent(e,t,{run:!0}),t}static async createConversation(e={}){let{initialUserMsg:t,conversationInstructions:n,plugins:i,metadata:a,workingDirOverride:o,workspaceMode:c,parentConversationId:d,agentType:re,sandboxId:f,agentProfileId:p,agentProfileKind:m}=e;if(s().backend.kind===`cloud`)return we({initial_message:t?{role:`user`,content:[{type:`text`,text:t}]}:null,title:n??null,selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,plugins:i??null,parent_conversation_id:d??null,agent_type:re,sandbox_id:f??null,agent_profile_id:p??null,trigger:`gui`});let[g,ie]=await Promise.all([y.getSettings(),oe.listProfiles().catch(()=>void 0)]),_=Yt(g.title_llm_profile,ie),ae=D(),v=s().backend.host,b=await k(o??ne(ae,v)),se=o?b:await k(te(v)),x=c??(o?`local_repo`:`new_worktree`),S=await qt({settings:g,query:t,conversationInstructions:n,plugins:i,conversationId:ae,parentConversationId:d,workingDir:b,hooksProjectDir:se,worktree:x===`new_worktree`,agentProfileId:p,agentProfileKind:m,titleLlmProfile:_}),C=await r(),w=await new h(l({timeout:Zt})).createConversation({...S,...C?{user_id:C}:{}}),T=ee();if(!T)throw new u;return(a?.selected_repository||o)&&N(w.id,{selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,selected_workspace:o??null,workspace_mode:x}),{id:w.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:w.id,agent_server_url:T.host,request:{initial_message:S.initial_message,plugins:i??null},created_at:w.created_at,updated_at:w.updated_at}}static async createLocalPlanningConversation(e,t){if(s().backend.kind===`cloud`)throw Error(`Local planning conversations require a local backend.`);let[n]=await this.batchGetAppConversations([e]),r=await Gt({workingDir:n?.workspace?.working_dir??d(),parentConversationId:e,parentActiveProfileName:n?.agent_kind===`openhands`?n?.active_profile??null:null,parentAgentProfileId:n?.launched_agent_profile?.agent_profile_id??null,initialMessage:t}),i=await new h(l()).createConversation(r);return be(e,{local_planning_conversation_id:i.id}),V(i)}static async getLocalPlanningConversationIds(e){if(s().backend.kind===`cloud`)return[];let t=new Set;try{let[n]=await this.batchGetAppConversations([e]),r=n?.sub_conversation_ids??[];if(r.length>0){let n=await this.batchGetAppConversations(r);for(let r of n)r&&et(r,e)&&t.add(r.id)}}catch(t){console.warn(`Failed to read sub-conversations of ${e}`,t)}let n=M(e)?.local_planning_conversation_id;return n&&t.add(n),[...t]}static async getStartTask(e){return s().backend.kind===`cloud`?Ne(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new p(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getVSCodeStatus(e,t){return new p(l({conversationUrl:e,sessionApiKey:t})).getStatus()}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??d()}static async batchGetAppConversations(e){return e.length===0?[]:s().backend.kind===`cloud`?I(e):pn(await new h(l()).getConversations(e)).map(e=>V(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return De(e,t)}static async updateConversationRepository(e,t,n,r){t?N(e,{...M(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):P(e);let[i]=await this.batchGetAppConversations([e]);return _n(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return je(e,dn(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=dn(t??`${n}/.agents_tmp/PLAN.md`,n);return new f(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?Te(e):new f(l()).downloadTrajectory(e)}static async getHooks(e){return Jt()}static async getRuntimeConversation(e,t,n){let r=fn(await new h(l({conversationUrl:t,sessionApiKey:n})).getConversation(e));return{id:r.id,title:r.title?.trim()?r.title:dt(r.id),metrics:nn(r.metrics),created_at:r.created_at,updated_at:r.updated_at,status:gn(r.execution_status),stats:r.stats??{usage_to_metrics:{}}}}static async condenseConversation(e,t,n){let r=s().backend;if(r.kind===`cloud`&&t){await g({backend:r,method:`POST`,hostOverride:o(t),path:`/api/conversations/${e}/condense`,authMode:`session-api-key`,sessionApiKey:n});return}await new h(l({conversationUrl:t,sessionApiKey:n})).condenseConversation(e)}static async searchConversations(e=20,t){return s().backend.kind===`cloud`?Ce(e,t):ft(mn(await new h(l()).searchConversations({limit:e,page_id:t,sort_order:ie.UPDATED_AT_DESC})))}static async deleteConversation(e){if(s().backend.kind===`cloud`){await Ee(e),P(e);return}let t=await this.getLocalPlanningConversationIds(e),n=new h(l());await Promise.all(t.map(async e=>{try{await n.deleteConversation(e)}catch(t){console.warn(`Failed to delete planning conversation ${e}`,t)}P(e)})),await n.deleteConversation(e),P(e)}static async updateConversationTitle(e,t){if(s().backend.kind===`cloud`)return Oe(e,t);await new h(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async updateConversationTags(e,t){await new h(l()).updateConversation(e,{tags:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async forkConversation(e,t,n){if(s().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let r=await new h(l()).forkConversation(e,{from_event_id:t,...n?{title:n}:{}}),i=M(e);return i&&N(r.id,i),r}static async getEventParentId(e,t){return(await new h(l()).getEvent(e,t)).parent_id??void 0}static async switchProfile(e,t){let{backend:n}=s();if(n.kind===`cloud`){if(!e){await oe.activateProfile(t);return}await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:t}});return}if(!e){await new m(l()).activateProfile(t);return}let r=l(),i=new h(r),a=await new m(r).getProfile(t,{exposeSecrets:`encrypted`}),o=typeof a.config.model==`string`?a.config.model:``;if(!o)throw Error(`Profile '${t}' has no model.`);await Y({llm:a.config}),await i.switchLLM(e,{...a.config,model:o,stream:!0,usage_id:`profile:${t}:${D()}`})}static async switchAcpModel(e,t){let{backend:n}=s();if(n.kind===`cloud`){await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:t}});return}await new h(l()).switchAcpModel(e,t)}};export{k as A,Se as C,be as D,M as E,N as O,ke as S,Ae as T,Ie as _,xt as a,Ne as b,Ue as c,Be as d,R as f,Le as g,L as h,yt as i,D as j,ve as k,Ve as l,Re as m,U as n,tt as o,We as p,vt as r,$e as s,vn as t,He as u,I as v,je as w,Me as x,we as y};
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{U as i,f as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{G as s,K as c,ct as l,dt as u,q as d,st as f}from"./active-backend-context-BETEdaJl.js";import{K as p,t as m}from"./utils-CbjwNcR-.js";import{c as h}from"./agent-server-client-options-EHB23gyx.js";import{a as g,i as _,n as v,r as y,t as ee}from"./use-acp-credential-form-GfqcTJl5.js";import{l as te}from"./settings-service.api-CYBTLGOd.js";import{n as ne}from"./use-settings-D69cw06D.js";import{t as re}from"./use-save-settings-CmX41wlf.js";import{h as ie}from"./form-control-classes-BVI_szaj.js";import{t as ae}from"./brand-button-CGUwj6zK.js";import{t as b}from"./settings-dropdown-input-Df_HXRk4.js";import{t as oe}from"./settings-input-B3i5U9GL.js";import{c as se,i as ce,l as le,n as x,o as ue,s as de,t as fe}from"./acp-providers-DOKcGeaV.js";import{_ as pe,g as me,h as he,n as ge,o as _e,v as ve}from"./schema-field-DSi0d7a8.js";import{r as S}from"./typography-BdAApXGl.js";import{t as ye}from"./settings-switch-CI93Iozg.js";import{t as be}from"./use-get-secrets-Pbo9jh2A.js";import{t as xe}from"./mcp-installed-servers-BW51n6PC.js";var C=e(n(),1),w=r();function Se({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}=v(t),f=se(t)??t;return r.length===0?null:(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(S.Text,{className:`text-sm font-medium text-white`,children:n(p.SETTINGS$ACP_CREDENTIALS_TITLE)}),(0,w.jsx)(S.Text,{className:`text-xs text-[#717888]`,children:n(p.SETTINGS$ACP_CREDENTIALS_DESCRIPTION)})]}),(0,w.jsx)(_,{status:u,isChecking:d,credentialsConfigured:l,providerName:f,testIdPrefix:`settings-acp-auth`}),(0,w.jsx)(`div`,{className:`flex flex-col gap-5`,children:r.map(e=>(0,w.jsx)(y,{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,w.jsx)(g,{conflicts:c})]})}function Ce({testId:e,items:t,selected:n,isDisabled:r=!1,onToggle:i}){return(0,w.jsx)(`ul`,{"data-testid":`${e}-list`,className:`flex flex-col gap-2.5`,children:t.map(({name:t,description:a})=>(0,w.jsxs)(`li`,{className:`flex flex-col gap-0.5`,children:[(0,w.jsx)(ye,{testId:`${e}-${t}`,name:`${e}-${t}`,isToggled:n.includes(t),isDisabled:r,onToggle:e=>i(t,e),children:(0,w.jsx)(`span`,{className:`font-mono`,children:t})}),a?(0,w.jsx)(S.Text,{className:`text-xs text-tertiary-alt pl-11`,children:a}):null]},t))})}var T=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(` `)}})),E=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:D}=e(t((e=>{e.quote=T(),e.parse=E()}))(),1);function O(e){let t=[],n=0,r=``,i=!1;for(;n<e.length;){let a=e[n];if(a===` `||a===` `||a===`
2
+ `||a===`\r`){i&&=(t.push(r),r=``,!1),n+=1;continue}if(a===`'`){for(i=!0,n+=1;n<e.length&&e[n]!==`'`;)r+=e[n],n+=1;n<e.length&&(n+=1);continue}if(a===`"`){for(i=!0,n+=1;n<e.length&&e[n]!==`"`;){if(e[n]===`\\`&&n+1<e.length){let t=e[n+1];if(t===`"`||t===`\\`){r+=t,n+=2;continue}}r+=e[n],n+=1}n<e.length&&(n+=1);continue}if(a===`\\`&&n+1<e.length){i=!0,r+=e[n+1],n+=2;continue}i=!0,r+=a,n+=1}return i&&t.push(r),t}var we=/[\s"'\\$`&|;<>(){}*?#!~[\]]/;function k(e){return e.map(e=>we.test(e)||e===``?D([e]):e).join(` `)}function Te(e){return Array.isArray(e)?{mode:`custom`,selected:e.filter(e=>typeof e==`string`)}:{mode:`standard`,selected:[]}}function Ee(e,t){let n=e=>[...new Set(e)].sort().join(`\0`);return n(e)===n(t)}var De=`1.31.0`;function Oe(){let e=d();if(!e)return!0;let t=s(e,De);return t===null?!0:t>=0}function ke(){if(h().backend.kind===`cloud`)return!1;let e=c()?.capabilities;return Array.isArray(e)&&e.includes(`profile_secret_scope_v1`)}var Ae={hideTitle:!0},je=`enable_sub_agents`,Me=`enable_switch_llm_tool`,Ne=`tool_concurrency_limit`,Pe=`mcp_server_refs`,Fe=`secret_refs`,Ie=`npx -y <package-name>`,A=`__custom_model__`,Le={agentType:`openhands`,commandText:``,acpModel:``,isCustomAcpModel:!1};function Re(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function j(e,t){let n=O(e).join(` `);for(let e of t)if(n===e.default_command.join(` `))return e.key;return fe}function ze(e){return e?.find(e=>e.key===je)}function Be(e,t){return typeof e==`boolean`?e:t?.default===!0}function Ve(e,t){return typeof e==`boolean`?e:t?.default===!0}function He(e,t){return e?.available_models?.some(({id:e})=>e===t.trim())??!1}function Ue(e){let{isAcp:t,selectedPreset:n,isDefaultProviderCommand:r,commandTokens:i,acpModel:a,subAgentsEnabled:o,switchLlmToolField:s,switchLlmToolEnabled:c,switchLlmToolSupportedOnProfile:l,toolConcurrencyField:u,toolConcurrency:d,mcpMode:f,selectedMcpServers:p,secretsMode:m,selectedSecrets:h,secretRefsSupportedOnProfile:g}=e,_={mcp_server_refs:f===`custom`?p:null},v=g?{secret_refs:m===`custom`?h:null}:{};if(t){let e=r&&n!==`custom`;return{agent_kind:`acp`,..._,...v,acp_server:n,acp_model:a.trim()||null,acp_command:e?null:k(i)||null,acp_args:null}}let y={agent_kind:`openhands`,..._,enable_sub_agents:o,...v};if(s&&l&&(y.enable_switch_llm_tool=c),u){let e=_e(u,d),t=typeof u.default==`number`?u.default:1;y.tool_concurrency_limit=e==null?t:Number(e)}return y}function M({embedded:e=!1,agentSettingsOverride:t=null,onSaveControlChange:n}={}){let{t:r}=o(`openhands`),{data:i,isLoading:a}=ne(),s=t??i?.agent_settings??null,{mutate:c,isPending:d}=re(),{data:h}=ve(i?.agent_settings_schema),g=C.useMemo(()=>h?.sections.flatMap(e=>e.fields),[h]),_=ze(g),v=C.useMemo(()=>Be(s?.[je],_),[_,s]),[y,se]=(0,C.useState)(v),T=g?.find(e=>e.key===Me),E=C.useMemo(()=>Ve(s?.[Me],T),[T,s]),[D,we]=(0,C.useState)(E),De=Oe(),Ae=!!T&&(!e||De),M=g?.find(e=>e.key===Ne),N=C.useMemo(()=>{if(!M)return``;let e=s?.[Ne];return he(M,e)},[M,s]),[We,Ge]=(0,C.useState)(N),Ke=e,P=C.useMemo(()=>Te(s?.[Pe]),[s]),[F,qe]=(0,C.useState)(P.mode),[Je,Ye]=(0,C.useState)(P.selected),I=C.useMemo(()=>xe(i?.mcp_config??te(i?.agent_settings?.mcp_config)).filter(e=>typeof e.name==`string`).map(e=>({name:e.name,description:e.type})),[i]),L=C.useMemo(()=>{let e=I,t=new Set(e.map(({name:e})=>e));return[...e,...P.selected.filter(e=>!t.has(e)).map(e=>({name:e,description:null}))]},[I,P]),R=C.useMemo(()=>L.map(({name:e})=>e).filter(e=>Je.includes(e)),[L,Je]),Xe=ke(),{data:Ze}=be({enabled:e&&Xe}),z=C.useMemo(()=>Te(s?.[Fe]),[s]),[B,Qe]=(0,C.useState)(z.mode),[$e,et]=(0,C.useState)(z.selected),V=(0,C.useCallback)(e=>et(t=>{let n=le(e).map(({name:e})=>e).filter(e=>!t.includes(e));return n.length?[...t,...n]:t}),[]),tt=C.useMemo(()=>F===`custom`?R.filter(e=>!I.some(t=>t.name===e)):[],[F,R,I]),[H,nt]=(0,C.useState)(`openhands`),[U,W]=(0,C.useState)(``),[G,K]=(0,C.useState)(``),[rt,q]=(0,C.useState)(!1),it=H===`acp`?j(U,x):null,J=ee(it&&it!==`custom`?it:null),Y=C.useMemo(()=>{let e=(Ze??[]).map(e=>({name:e.name,description:e.description??null})),t=new Set(e.map(e=>e.name));return[...e,...[...new Set([...z.selected,...J.fields.map(({name:e})=>e)])].filter(e=>!t.has(e)).map(e=>({name:e,description:null}))]},[Ze,z,J.fields]),at=C.useMemo(()=>Y.map(({name:e})=>e).filter(e=>$e.includes(e)),[Y,$e]),ot=(0,C.useRef)(null),st=(0,C.useRef)(null),ct=(0,C.useRef)(``),[lt,ut]=(0,C.useState)(Le);(0,C.useEffect)(()=>{let e=t??i?.agent_settings??null;if(!e&&!i)return;let n=t??i;if(ot.current!==n)if(ot.current=n,e?.agent_kind===`acp`){nt(`acp`);let t=e?.acp_server,n=typeof t==`string`?t:void 0,r=de(n),i=Re(e?.acp_command),a=[...i.length>0?i:r?.default_command??[],...Re(e?.acp_args)],o=a.length>0?k(a):``;W(o),st.current=n??null,ct.current=o;let s=e?.acp_model,c=typeof s==`string`?s.trim():``,l=c||ue(n)||``,u=!!c&&(!r||!He(r,c));K(l),q(u),ut({agentType:`acp`,commandText:o,acpModel:l,isCustomAcpModel:u})}else nt(`openhands`),W(``),K(``),st.current=null,ct.current=``,q(!1),ut(Le)},[i,t]),(0,C.useEffect)(()=>{se(v)},[v]),(0,C.useEffect)(()=>{we(E)},[E]),(0,C.useEffect)(()=>{Ge(N)},[N]),(0,C.useEffect)(()=>{qe(P.mode),Ye(P.selected)},[P]),(0,C.useEffect)(()=>{Qe(z.mode),et(z.selected)},[z]);let dt=(0,C.useRef)(()=>({agent_kind:`openhands`,mcp_server_refs:null,enable_sub_agents:!1})),ft=(0,C.useCallback)(()=>dt.current(),[]),pt=(0,C.useRef)(J);pt.current=J;let mt=(0,C.useCallback)(e=>pt.current.save(e),[]),ht=(0,C.useCallback)(()=>pt.current.reset(),[]),gt=H===`acp`&&O(U).length===0,_t=F!==P.mode||!Ee(R,P.selected),vt=B!==z.mode||!Ee(at,z.selected),yt=H!==lt.agentType||_t||vt||(H===`acp`?U!==lt.commandText||G!==lt.acpModel||rt!==lt.isCustomAcpModel:y!==v||D!==E||We!==N),bt=J.isDirty,xt=yt||bt;if((0,C.useEffect)(()=>{!e||!n||n({agentType:H,isValid:!gt,isDirty:xt,buildAgentProfileFields:ft,credentials:{isDirty:bt,save:mt,reset:ht}})},[e,n,H,gt,xt,bt,ft,mt,ht]),a)return null;let X=H===`acp`,St=O(U),Ct=X&&St.length===0,Z=j(U,x),Q=de(Z),wt=Q?.available_models??[],Tt=wt.length>0,Et=He(Q,G),Dt=rt||!Et?A:G,Ot=!!Q&&St.join(` `)===Q.default_command.join(` `),kt=k(x[0]?.default_command??[])||Ie;dt.current=()=>Ue({isAcp:X,selectedPreset:Z,isDefaultProviderCommand:Ot,commandTokens:St,acpModel:G,subAgentsEnabled:y,switchLlmToolField:T,switchLlmToolEnabled:D,switchLlmToolSupportedOnProfile:De,toolConcurrencyField:M,toolConcurrency:We,mcpMode:F,selectedMcpServers:R,secretsMode:B,selectedSecrets:at,secretRefsSupportedOnProfile:Xe});let $=d||J.isSaving,At=async()=>{if(J.isDirty){if(!await J.save({silent:yt}))return;J.reset()}if(yt)if(X){let e=!!(Q&&Ot),t=st.current,n=U===ct.current,i=!!t&&t!==`custom`&&!x.some(e=>e.key===t),a=X&&n&&i,o=ce(a?t:Q&&Ot?Q.key:fe,{command:e?[]:St,model:G.trim()||void 0,allowUnknownServer:a});if(!o)return;c({agent_settings_diff:o},{onError:e=>{f(u(e)||r(p.ERROR$GENERIC))},onSuccess:()=>{l(r(p.SETTINGS$SAVED)),ut({agentType:H,commandText:U,acpModel:G,isCustomAcpModel:rt}),ct.current=U}})}else{let e={agent_kind:`openhands`,enable_sub_agents:y};if(T&&(e[Me]=D),M){let t;try{t=_e(M,We)}catch(e){f(e instanceof Error?e.message:r(p.ERROR$GENERIC));return}t!=null&&(e[Ne]=t)}c({agent_settings_diff:e},{onError:e=>{f(u(e)||r(p.ERROR$GENERIC))},onSuccess:()=>{l(r(p.SETTINGS$SAVED)),ut({agentType:`openhands`,commandText:``,acpModel:``,isCustomAcpModel:!1})}})}},jt=_?pe(r,_.key,_.label):r(p.SCHEMA$ENABLE_SUB_AGENTS$LABEL),Mt=_?me(r,_.key,_.description):r(p.SCHEMA$ENABLE_SUB_AGENTS$DESCRIPTION),Nt=T?pe(r,T.key,T.label):r(p.SCHEMA$ENABLE_SWITCH_LLM_TOOL$LABEL),Pt=T?me(r,T.key,T.description):r(p.SCHEMA$ENABLE_SWITCH_LLM_TOOL$DESCRIPTION);return(0,w.jsxs)(`div`,{"data-testid":`agent-settings-screen`,className:`flex flex-col gap-6 pb-8 max-w-2xl`,children:[!e&&(0,w.jsxs)(`div`,{children:[(0,w.jsx)(S.H2,{className:`mb-2`,children:r(p.SETTINGS$NAV_AGENT)}),(0,w.jsx)(S.Paragraph,{className:`text-sm text-[#A3A3A3]`,children:r(p.SETTINGS$AGENT_PAGE_DESCRIPTION)})]}),(0,w.jsx)(b,{testId:`agent-type-selector`,name:`agent-type`,label:r(p.SETTINGS$NAV_AGENT),items:[{key:`openhands`,label:r(p.SETTINGS$AGENT_TYPE_OPENHANDS)},{key:`acp`,label:r(p.SETTINGS$AGENT_TYPE_ACP)}],selectedKey:H,onSelectionChange:e=>{if(!e)return;let t=e;if(nt(t),t===`acp`&&!U){let e=x[0];e&&(W(k(e.default_command)),K(ue(e.key)??``),q(!1),B===`custom`&&V(e.key))}else t===`acp`&&H!==`acp`&&B===`custom`?V(Z):t===`openhands`&&q(!1)}}),!X&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(ye,{testId:`agent-settings-enable-sub-agents`,isToggled:y,onToggle:e=>{se(e)},children:jt}),Mt?(0,w.jsx)(S.Paragraph,{className:m(`pl-12`,`text-tertiary-alt text-xs leading-5`),children:Mt}):null]}),!X&&Ae?(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,w.jsx)(ye,{testId:`agent-settings-enable-switch-llm-tool`,isToggled:D,onToggle:e=>{we(e)},children:Nt}),Pt?(0,w.jsx)(S.Paragraph,{className:m(ie,`text-tertiary-alt text-xs leading-5`),children:Pt}):null]}):null,!X&&M?(0,w.jsx)(ge,{field:M,value:We,isDisabled:$,onChange:Ge}):null,Ke?(0,w.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,w.jsx)(S.Text,{className:`text-sm`,children:r(p.SETTINGS$AGENT_PROFILE_MCP)}),(0,w.jsx)(b,{testId:`agent-settings-mcp-mode`,name:`agent-mcp-mode`,label:``,items:[{key:`standard`,label:r(p.SETTINGS$AGENT_PROFILE_MCP_ALL)},{key:`custom`,label:r(p.SETTINGS$AGENT_PROFILE_MCP_CHOOSE)}],selectedKey:F,isDisabled:$,onSelectionChange:e=>{if(!e)return;let t=e;qe(t),t===`custom`&&Je.length===0&&Ye(I.map(({name:e})=>e))}}),L.length>0?(0,w.jsx)(Ce,{testId:`agent-settings-mcp`,items:L,selected:F===`custom`?R:L.map(({name:e})=>e),isDisabled:$||F===`standard`,onToggle:(e,t)=>Ye(n=>t?[...n,e]:n.filter(t=>t!==e))}):(0,w.jsx)(S.Text,{className:`text-xs text-tertiary-alt`,children:r(p.SETTINGS$AGENT_PROFILE_MCP_NONE)}),tt.length>0?(0,w.jsx)(S.Text,{testId:`agent-settings-mcp-dangling`,className:`text-xs text-danger`,children:r(p.SETTINGS$AGENT_PROFILE_MCP_DANGLING,{names:tt.join(`, `)})}):null,(0,w.jsx)(S.Text,{className:`text-xs text-tertiary-alt`,children:r(F===`custom`?p.SETTINGS$AGENT_PROFILE_MCP_CHOOSE_HINT:p.SETTINGS$AGENT_PROFILE_MCP_ALL_HINT)})]}):null,Ke&&Xe?(0,w.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,w.jsx)(S.Text,{className:`text-sm`,children:r(p.SETTINGS$AGENT_PROFILE_SECRETS)}),(0,w.jsx)(b,{testId:`agent-settings-secrets-mode`,name:`agent-secrets-mode`,label:``,items:[{key:`standard`,label:r(p.SETTINGS$AGENT_PROFILE_SECRETS_ALL)},{key:`custom`,label:r(p.SETTINGS$AGENT_PROFILE_SECRETS_CHOOSE)}],selectedKey:B,isDisabled:$,onSelectionChange:e=>{if(!e)return;let t=e;Qe(t),t===`custom`&&X&&V(Z)}}),Y.length>0?(0,w.jsx)(Ce,{testId:`agent-settings-secret`,items:Y,selected:B===`custom`?at:Y.map(({name:e})=>e),isDisabled:$||B===`standard`,onToggle:(e,t)=>et(n=>t?[...n,e]:n.filter(t=>t!==e))}):(0,w.jsx)(S.Text,{className:`text-xs text-tertiary-alt`,children:r(p.SETTINGS$AGENT_PROFILE_SECRETS_NONE)}),(0,w.jsx)(S.Text,{className:`text-xs text-tertiary-alt`,children:r(B===`custom`?p.SETTINGS$AGENT_PROFILE_SECRETS_CHOOSE_HINT:p.SETTINGS$AGENT_PROFILE_SECRETS_ALL_HINT)})]}):null,X&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(b,{testId:`agent-preset-selector`,name:`agent-preset`,label:r(p.SETTINGS$AGENT_PRESET),items:[...x.map(e=>({key:e.key,label:e.display_name})),{key:`custom`,label:r(p.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Z,onSelectionChange:e=>{if(!e)return;let t=String(e),n=de(t);n?(W(k(n.default_command)),K(ue(t)??``),q(!1),B===`custom`&&t!==Z&&V(t)):t===`custom`&&(W(``),K(``),q(!0))}}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,w.jsx)(S.Text,{className:`text-sm`,children:r(p.SETTINGS$AGENT_COMMAND)}),(0,w.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:U,placeholder:kt,onChange:e=>{let t=e.target.value,n=j(U,x),r=j(t,x);r!==n&&(K(ue(r)??``),q(!1),B===`custom`&&V(r)),W(t)}}),(0,w.jsx)(S.Text,{className:`text-xs text-[#717888]`,children:r(p.SETTINGS$AGENT_COMMAND_HINT)})]}),(0,w.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[Tt&&(0,w.jsx)(b,{testId:`agent-model-selector`,name:`agent-model`,label:r(p.SETTINGS$AGENT_MODEL),items:[...wt.map(e=>({key:e.id,label:e.label})),{key:A,label:r(p.SETTINGS$AGENT_PRESET_CUSTOM)}],selectedKey:Dt,onSelectionChange:e=>{if(!e)return;let t=String(e);t===A?(q(!0),K(``)):(q(!1),K(t))}}),Dt===A&&(0,w.jsx)(oe,{testId:`agent-model-input`,label:r(Tt?p.SETTINGS$AGENT_CUSTOM_MODEL:p.SETTINGS$AGENT_MODEL),type:`text`,className:`w-full`,value:G,showOptionalTag:!0,onChange:e=>{K(e)}}),(0,w.jsx)(S.Text,{className:`text-xs text-[#717888]`,children:r(p.SETTINGS$AGENT_MODEL_HINT)})]})]}),X&&Z!==`custom`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`hr`,{className:`border-[#3D4046]`}),(0,w.jsx)(Se,{form:J,providerKey:Z})]}),!e&&(0,w.jsx)(`div`,{children:(0,w.jsx)(ae,{testId:`agent-save-button`,type:`button`,variant:`primary`,isDisabled:$||!xt||Ct,onClick:At,children:r($?p.SETTINGS$SAVING:p.SETTINGS$SAVE_CHANGES)})})]})}var N=i(function(){return(0,w.jsx)(a,{to:`/settings/agents`,replace:!0})});export{O as i,N as n,Ae as r,M as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./agent-settings-BnzyTgCb.js";export{e as default,t as handle};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-BgLSZdyy.js";import{t as o}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{n as s}from"./navigation-context-CQZwH_tC.js";import{c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as l}from"./close-ScPlnwyq.js";import{r as u}from"./typography-DgcLGdHk.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=r(`openhands`),[h,g]=o(`alert_banner_dismissed_at`,null),{currentPath:_}=s(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(c,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:m(i.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(u.Paragraph,{className:`text-sm font-medium`,children:[m(i.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(l,{})})]}):null}export{p as AlertBanner};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{K as i,t as a}from"./utils-CbjwNcR-.js";import{t as o}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{n as s}from"./navigation-context-CQZwH_tC.js";import{c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as l}from"./close-ScPlnwyq.js";import{r as u}from"./typography-BdAApXGl.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=r(`openhands`),[h,g]=o(`alert_banner_dismissed_at`,null),{currentPath:_}=s(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(c,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:m(i.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(u.Paragraph,{className:`text-sm font-medium`,children:[m(i.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(l,{})})]}):null}export{p as AlertBanner};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{$ as i,r as a}from"./active-backend-context-BnH4-L8h.js";import{K as o,t as s}from"./utils-BgLSZdyy.js";import{n as c,p as l}from"./agent-server-client-options-EHB23gyx.js";import{n as u,o as d}from"./backend-form-modal-DxisQV_6.js";import{f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{r as p,t as m}from"./modal-body-C24WsdFb.js";import{t as h}from"./brand-button-CUMfjb99.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new f(c({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),l(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),i(t,401))T(e(o.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(o.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:s(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,p(`md`),m),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(o.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(u,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(d,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(o.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(h,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})})})]})})}export{v as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{t as r}from"./useTranslation-CCgUjPJF.js";import{$ as i,r as a}from"./active-backend-context-BETEdaJl.js";import{K as o,t as s}from"./utils-CbjwNcR-.js";import{n as c,p as l}from"./agent-server-client-options-EHB23gyx.js";import{n as u,o as d}from"./backend-form-modal-DzYf_arO.js";import{f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{r as p,t as m}from"./modal-body-B_95ci1c.js";import{t as h}from"./brand-button-CGUwj6zK.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new f(c({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),l(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),i(t,401))T(e(o.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(o.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:s(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,p(`md`),m),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(o.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(u,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(d,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(o.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(h,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})})})]})})}export{v as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{_ as a,ct as o,dt as s,ft as c,n as l,st as u}from"./active-backend-context-BnH4-L8h.js";import{K as d}from"./utils-BgLSZdyy.js";import{r as f}from"./use-free-models-gCsJ5BV0.js";import{t as p}from"./settings-CKqk8ZnH.js";import{n as m}from"./use-settings-C2KKQKVC.js";import{t as h}from"./use-save-settings-Dapkf4cC.js";import{t as g}from"./brand-button-CUMfjb99.js";import{i as _,n as v,r as y,t as b}from"./color-themes-DTj5Ylbr.js";import{t as x}from"./navigation-link-Bxo3-4vo.js";import{t as S}from"./settings-dropdown-input-DBvsZ7-Q.js";import{t as C}from"./settings-input-dVuzapBA.js";import{t as w}from"./use-llm-profiles-SWsuFmFu.js";import{n as T}from"./format-model-name-Dfh9Udrx.js";import{c as E,o as D,t as O}from"./sidebar-onboarding-checklist-storage-TfvNNnnr.js";import{n as k,t as A}from"./switch-skeleton-DwOoCqaL.js";import{t as j}from"./settings-switch-DDd1cQ8t.js";var M=e(t(),1),N=n();function P({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,N.jsx)(S,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:c.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function F(){let{t:e}=i(`openhands`),t=M.useCallback(e=>{if(!e)return;let t=e;v(t),y(t)},[]);return(0,N.jsx)(S,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:b.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:_(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function I(){return(0,M.useSyncExternalStore)(D,O,()=>!1)}function ee(){let{t:e}=i(`openhands`),t=I();return(0,N.jsx)(j,{testId:`show-getting-started-checklist-switch`,isToggled:!t,onToggle:e=>{E(!e)},children:e(d.SETTINGS$SHOW_GETTING_STARTED_CHECKLIST)})}function L(){return(0,N.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,N.jsx)(k,{}),(0,N.jsx)(A,{}),(0,N.jsx)(A,{})]})}var R=`__automatic__`;function z(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=h(),{data:r,isLoading:_}=m(),v=l().backend.kind===`cloud`,{data:y,isLoading:b}=w(),E=f(),[D,O]=M.useState(!1),[k,A]=M.useState(!1),[I,z]=M.useState(!1),[B,V]=M.useState(!1),[H,U]=M.useState(!1),[W,G]=M.useState(void 0),K=M.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!y||y.profiles.some(t=>t.name===e)?e:null},[y,r?.title_llm_profile]),q=W===void 0?K:W,J=M.useMemo(()=>[{key:R,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...y?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:T(t.model,E)??t.model}):t.name}))??[]],[y?.profiles,E,e]),Y=n=>{let r=n.get(`language-input`)?.toString(),i=c.find(({label:e})=>e===r)?.value||p.language,l=v?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,f=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||p.git_user_name,h=n.get(`git-user-email-input`)?.toString()||p.git_user_email;t({language:i,...!v&&{user_consents_to_analytics:l},enable_sound_notifications:f,git_user_name:m,git_user_email:h,title_llm_profile:q},{onSuccess:()=>{a(l?`granted`:`denied`),o(e(d.SETTINGS$SAVED))},onError:t=>{u(s(t)||e(d.ERROR$GENERIC))},onSettled:()=>{O(!1),A(!1),z(!1),V(!1),U(!1),G(void 0)}})},X=e=>{let t=c.find(({label:t})=>t===e)?.label,n=c.find(({value:e})=>e===r?.language)?.label;O(t!==n)},Z=e=>{A(e!==(r?.user_consents_to_analytics??!0))},Q=e=>{z(e!==!!r?.enable_sound_notifications)},te=e=>{let t=r?.git_user_name;V(e!==t)},ne=e=>{let t=r?.git_user_email;U(e!==t)},re=!D&&!k&&!I&&q===K&&!B&&!H,$=!r||_||b||n;return(0,N.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:Y,className:`flex flex-col gap-6`,children:[$&&(0,N.jsx)(L,{}),!$&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(P,{name:`language-input`,defaultKey:r.language,onChange:X}),(0,N.jsx)(F,{}),(0,N.jsx)(j,{testId:`enable-analytics-switch`,name:v?void 0:`enable-analytics-switch`,defaultIsToggled:v?!0:r.user_consents_to_analytics??!0,isToggled:v?!0:void 0,isDisabled:v,onToggle:v?void 0:Z,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,N.jsx)(j,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Q,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,N.jsx)(S,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:J,selectedKey:q??R,onSelectionChange:e=>{let t=e?.toString();G(!t||t===R?null:t)}}),(0,N.jsx)(x,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(C,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:te,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,N.jsx)(C,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:ne,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,N.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,N.jsxs)(g,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||re,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var B=r(z);export{B as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./useTranslation-CCgUjPJF.js";import{_ as a,ct as o,dt as s,ft as c,n as l,st as u}from"./active-backend-context-BETEdaJl.js";import{K as d}from"./utils-CbjwNcR-.js";import{r as f}from"./use-free-models-FAk2nngq.js";import{t as p}from"./settings-CKqk8ZnH.js";import{n as m}from"./use-settings-D69cw06D.js";import{t as h}from"./use-save-settings-CmX41wlf.js";import{t as g}from"./brand-button-CGUwj6zK.js";import{i as _,n as v,r as y,t as b}from"./color-themes-DTj5Ylbr.js";import{t as x}from"./navigation-link-Bxo3-4vo.js";import{t as S}from"./settings-dropdown-input-Df_HXRk4.js";import{t as C}from"./settings-input-B3i5U9GL.js";import{t as w}from"./use-llm-profiles-U4u1gzuk.js";import{n as T}from"./format-model-name-Dfh9Udrx.js";import{c as E,o as D,t as O}from"./sidebar-onboarding-checklist-storage-_zxMqHS0.js";import{n as k,t as A}from"./switch-skeleton-DwOoCqaL.js";import{t as j}from"./settings-switch-CI93Iozg.js";var M=e(t(),1),N=n();function P({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,N.jsx)(S,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:c.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function F(){let{t:e}=i(`openhands`),t=M.useCallback(e=>{if(!e)return;let t=e;v(t),y(t)},[]);return(0,N.jsx)(S,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:b.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:_(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function I(){return(0,M.useSyncExternalStore)(D,O,()=>!1)}function ee(){let{t:e}=i(`openhands`),t=I();return(0,N.jsx)(j,{testId:`show-getting-started-checklist-switch`,isToggled:!t,onToggle:e=>{E(!e)},children:e(d.SETTINGS$SHOW_GETTING_STARTED_CHECKLIST)})}function L(){return(0,N.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,N.jsx)(k,{}),(0,N.jsx)(A,{}),(0,N.jsx)(A,{})]})}var R=`__automatic__`;function z(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=h(),{data:r,isLoading:_}=m(),v=l().backend.kind===`cloud`,{data:y,isLoading:b}=w(),E=f(),[D,O]=M.useState(!1),[k,A]=M.useState(!1),[I,z]=M.useState(!1),[B,V]=M.useState(!1),[H,U]=M.useState(!1),[W,G]=M.useState(void 0),K=M.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!y||y.profiles.some(t=>t.name===e)?e:null},[y,r?.title_llm_profile]),q=W===void 0?K:W,J=M.useMemo(()=>[{key:R,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...y?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:T(t.model,E)??t.model}):t.name}))??[]],[y?.profiles,E,e]),Y=n=>{let r=n.get(`language-input`)?.toString(),i=c.find(({label:e})=>e===r)?.value||p.language,l=v?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,f=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||p.git_user_name,h=n.get(`git-user-email-input`)?.toString()||p.git_user_email;t({language:i,...!v&&{user_consents_to_analytics:l},enable_sound_notifications:f,git_user_name:m,git_user_email:h,title_llm_profile:q},{onSuccess:()=>{a(l?`granted`:`denied`),o(e(d.SETTINGS$SAVED))},onError:t=>{u(s(t)||e(d.ERROR$GENERIC))},onSettled:()=>{O(!1),A(!1),z(!1),V(!1),U(!1),G(void 0)}})},X=e=>{let t=c.find(({label:t})=>t===e)?.label,n=c.find(({value:e})=>e===r?.language)?.label;O(t!==n)},Z=e=>{A(e!==(r?.user_consents_to_analytics??!0))},Q=e=>{z(e!==!!r?.enable_sound_notifications)},te=e=>{let t=r?.git_user_name;V(e!==t)},ne=e=>{let t=r?.git_user_email;U(e!==t)},re=!D&&!k&&!I&&q===K&&!B&&!H,$=!r||_||b||n;return(0,N.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:Y,className:`flex flex-col gap-6`,children:[$&&(0,N.jsx)(L,{}),!$&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(P,{name:`language-input`,defaultKey:r.language,onChange:X}),(0,N.jsx)(F,{}),(0,N.jsx)(j,{testId:`enable-analytics-switch`,name:v?void 0:`enable-analytics-switch`,defaultIsToggled:v?!0:r.user_consents_to_analytics??!0,isToggled:v?!0:void 0,isDisabled:v,onToggle:v?void 0:Z,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,N.jsx)(j,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Q,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,N.jsx)(S,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:J,selectedKey:q??R,onSelectionChange:e=>{let t=e?.toString();G(!t||t===R?null:t)}}),(0,N.jsx)(x,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(C,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:te,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,N.jsx)(C,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:ne,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,N.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,N.jsxs)(g,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||re,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var B=r(z);export{B as default};
@@ -0,0 +1,3 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{B as r,H as i,U as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{l as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as s}from"./useQuery-DAAacS7O.js";import{t as c}from"./useTranslation-CCgUjPJF.js";import{Q as l,ct as u,n as d,st as f}from"./active-backend-context-BETEdaJl.js";import{K as p,a as m,t as h}from"./utils-CbjwNcR-.js";import{a as g,c as _,n as v}from"./agent-server-client-options-EHB23gyx.js";import{C as y,S as b,a as x,c as S,d as C,f as w,g as T,i as E,l as D,o as O,p as k,s as A,t as j}from"./automation-disabled-reason-QFtMrdOr.js";import{r as M}from"./context-menu-list-item-DIm5xQg6.js";import{y as N}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as P}from"./proxy-BCCQUna8.js";import{n as F}from"./organization-service.api-zhHpQU0t.js";import{C as ee,P as I,n as L,t as R}from"./use-tracking-BAFpgpgq.js";import{t as te}from"./use-settings-D69cw06D.js";import{r as z}from"./modal-classes-BPcBCWVj.js";import{t as ne}from"./brand-button-CGUwj6zK.js";import{n as re}from"./navigation-context-CQZwH_tC.js";import{n as ie}from"./use-create-conversation-D15Px574.js";import{t as ae}from"./u-edit-DAkcF52u.js";import{t as B}from"./terminal-BUpID2wS.js";import{t as V}from"./toggle-switch-D3TBxlsc.js";import{n as H,t as oe}from"./use-automation-health-CbQ9n-k7.js";import{t as U}from"./automation-C_eCrGyP.js";import{i as se,l as ce,o as le,r as ue,u as de}from"./use-automations-7_XBXHQK.js";import{t as fe}from"./use-user-conversation-BBDXUbOc.js";import{n as W}from"./api-error-message-BXo0lCI5.js";import{t as pe}from"./x-mark-BopmFoBq.js";import{n as me,r as he,t as ge}from"./link-external-B4gx3EeM.js";import{t as _e}from"./edit-automation-modal-bfD-5NIc.js";import{n as ve,t as ye}from"./use-automation-permissions-gFy-2VD0.js";import{n as be,t as xe}from"./trash-D1QMHInX.js";import{n as Se,r as Ce,t as we}from"./error-state-BgYl7YeB.js";import{i as Te,r as Ee,t as De}from"./automation-export-CkvehhPF.js";import{a as G,i as Oe,n as K,r as q,t as ke}from"./cog-DVZT1f0s.js";var J=e(t());function Ae(e){let{backend:t,orgId:n}=d(),r=t.kind===`cloud`&&!!n&&!!e;return s({queryKey:[`cloud-org-member`,t.id,n,e,t.connectionRevision??0],queryFn:()=>F(n,e,t),enabled:r,staleTime:1e3*60*5,retry:!1,meta:{disableToast:!0}})}var Y=n(),X=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3`})});function je({active:e}){let{t}=c(`openhands`);return(0,Y.jsx)(`span`,{"data-testid":e?`active-status-badge-active`:`active-status-badge-inactive`,className:h(`inline-flex items-center rounded-full px-3 py-1 text-xs font-medium`,e?`bg-[var(--oh-success)]/15 text-[var(--oh-success)]`:`bg-surface-raised text-muted`),children:t(e?p.AUTOMATIONS$DETAIL$ACTIVE:p.AUTOMATIONS$DETAIL$INACTIVE)})}function Me({automation:e,onToggle:t,onEdit:n,onDelete:r,onExport:i,onDownloadTarball:a,onRunNow:o,isRunningNow:s=!1,canManage:l=!0,canToggle:u=l}){let{t:d}=c(`openhands`),f=[{label:d(p.AUTOMATIONS$EXPORT),icon:(0,Y.jsx)(X,{className:`size-4`}),onClick:i},{label:d(p.AUTOMATIONS$DOWNLOAD_TARBALL),icon:(0,Y.jsx)(X,{className:`size-4`}),onClick:a},...l&&n?[{label:d(p.AUTOMATIONS$EDIT),icon:(0,Y.jsx)(ae,{className:`size-4`}),onClick:n}]:[],...u?[{label:e.enabled?d(p.AUTOMATIONS$TURN_OFF):d(p.AUTOMATIONS$TURN_ON),icon:(0,Y.jsx)(E,{className:`size-4`}),onClick:t}]:[],...l?[{label:d(p.AUTOMATIONS$DELETE),icon:(0,Y.jsx)(xe,{className:`size-4`}),onClick:r}]:[]];return(0,Y.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,Y.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`h1`,{className:`text-xl font-medium text-content`,children:e.name}),(0,Y.jsx)(je,{active:e.enabled})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&o&&(0,Y.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--oh-border)] px-3 py-1.5 text-sm font-medium text-content transition-colors hover:bg-surface-raised disabled:cursor-not-allowed disabled:opacity-60`,disabled:s||!e.enabled,onClick:o,children:[(0,Y.jsx)(x,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),d(s?p.AUTOMATIONS$STARTING:p.AUTOMATIONS$RUN_NOW)]}),u&&(0,Y.jsx)(V,{enabled:e.enabled,label:e.enabled?d(p.AUTOMATIONS$TURN_OFF):d(p.AUTOMATIONS$TURN_ON),onToggle:t}),(0,Y.jsx)(be,{items:f})]})]})})}function Ne({automation:e}){let{t,i18n:n}=c(`openhands`),r=j(e,t);if(!r)return null;let i=!k(e.disabled_at);return(0,Y.jsxs)(`div`,{"data-testid":`automation-disabled-reason-banner`,className:`flex flex-col gap-2 rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)] px-5 py-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(he,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:t(p.AUTOMATIONS$DETAIL$DISABLED_REASON_HEADING)})]}),(0,Y.jsx)(`p`,{"data-testid":`automation-disabled-reason-text`,className:`text-sm leading-5 text-[var(--oh-text-secondary)]`,children:r.text}),i?(0,Y.jsx)(`p`,{"data-testid":`automation-disabled-reason-timestamp`,className:`text-xs text-muted`,children:t(p.AUTOMATIONS$DETAIL$DISABLED_AT,{time:w(e.disabled_at,n.language,t)})}):null]})}var Pe=240,Fe=`max-h-60`;function Ie({prompt:e}){let{t}=c(`openhands`),[n,r]=J.useState(!1),[i,a]=J.useState(!1),o=J.useRef(null),s=i&&!n;return J.useLayoutEffect(()=>{let e=o.current;if(!e)return;let t=()=>{a(e.scrollHeight>Pe)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),(0,Y.jsx)(q,{icon:(0,Y.jsx)(B,{className:`size-4`}),title:t(p.AUTOMATIONS$DETAIL$PROMPT),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(`p`,{ref:o,className:h(`whitespace-pre-wrap text-sm leading-6 text-content`,s&&h(Fe,`overflow-hidden`)),"data-testid":`automation-prompt-content`,children:e}),s?(0,Y.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-20 bg-gradient-to-t from-[var(--oh-surface)] to-transparent`,"aria-hidden":!0,"data-testid":`automation-prompt-fade`}):null]}),i?(0,Y.jsx)(`button`,{type:`button`,className:`self-start cursor-pointer text-sm font-normal text-[var(--oh-muted)] hover:text-white`,onClick:()=>r(e=>!e),"data-testid":`automation-prompt-toggle`,children:t(n?p.COMMON$VIEW_LESS:p.COMMON$VIEW_MORE)}):null]})})}var Le=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5`})}),Re=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,Y.jsx)(`path`,{d:`M12 4C9.79086 4 8 5.79086 8 8C8 10.2091 9.79086 12 12 12C14.2091 12 16 10.2091 16 8C16 5.79086 14.2091 4 12 4ZM6 8C6 4.68629 8.68629 2 12 2C15.3137 2 18 4.68629 18 8C18 11.3137 15.3137 14 12 14C8.68629 14 6 11.3137 6 8ZM8 18C6.34315 18 5 19.3431 5 21C5 21.5523 4.55228 22 4 22C3.44772 22 3 21.5523 3 21C3 18.2386 5.23858 16 8 16H16C18.7614 16 21 18.2386 21 21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21C19 19.3431 17.6569 18 16 18H8Z`,fill:`currentColor`})}),ze=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0`})});function Be({branch:e}){return(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-surface-raised px-2.5 py-0.5 text-xs text-muted`,children:e})}var Ve=60;function He({filter:e}){let{t}=c(`openhands`),[n,r]=(0,J.useState)(!1),i=e.length>Ve;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-mono break-all`,children:i&&!n?`${e.slice(0,Ve)}…`:e}),i&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`text-xs text-muted hover:text-content self-start`,children:t(n?p.SETTINGS$SKILLS_SHOW_LESS:p.SETTINGS$SKILLS_SHOW_MORE)})]})}function Ue({automation:e,runsAs:t}){let{t:n}=c(`openhands`),r=e.trigger.type===`event`,i=e.trigger.schedule??``;e.trigger.schedule_human&&(i=e.timezone?`${e.trigger.schedule_human} (${e.timezone})`:e.trigger.schedule_human);let a=n(r?p.AUTOMATIONS$DETAIL$TRIGGER_EVENT:p.AUTOMATIONS$DETAIL$TRIGGER_SCHEDULE);return(0,Y.jsx)(q,{icon:(0,Y.jsx)(ke,{className:`size-4`}),title:n(p.AUTOMATIONS$DETAIL$CONFIGURATION),children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-5`,children:[e.repository&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Oe,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$REPOSITORIES),children:(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[e.repository,e.branch&&(0,Y.jsx)(Be,{branch:e.branch})]})}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(A,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$TRIGGER),children:a}),!r&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Le,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$SCHEDULE),children:i}),r&&e.trigger.source&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(M,{className:`size-3.5`,"aria-hidden":`true`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_SOURCE),children:e.trigger.source}),r&&e.trigger.on&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(ge,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_TYPE),children:T(e.trigger.on)}),r&&e.trigger.filter&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(me,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$EVENT_FILTER),children:(0,Y.jsx)(He,{filter:e.trigger.filter})}),t&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(Re,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$RUNS_AS),children:(0,Y.jsx)(`span`,{className:`break-all`,children:t})}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(y,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$MODEL),children:e.model??n(p.COMMON$ACTIVE_PROFILE)}),e.notification&&(0,Y.jsx)(K,{icon:(0,Y.jsx)(ze,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$NOTIFICATION),children:e.notification})]})})}var We=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z`})});function Ge({name:e}){return(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-[var(--oh-border)] bg-[var(--oh-surface-deep)] px-3.5 py-1.5 text-sm text-content`,children:e})}function Ke({plugins:e}){let{t}=c(`openhands`);return(0,Y.jsx)(q,{icon:(0,Y.jsx)(We,{className:`size-4`}),title:t(p.AUTOMATIONS$DETAIL$PLUGINS),children:(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,Y.jsx)(Ge,{name:e},e))})})}var qe=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,...e,children:(0,Y.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182`})});function Je({createdAt:e,lastRunAt:t}){let{t:n,i18n:r}=c(`openhands`),i=r.language;return(0,Y.jsx)(q,{icon:(0,Y.jsx)(qe,{className:`size-4`}),title:n(p.AUTOMATIONS$DETAIL$ACTIVITY),children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4`,children:[(0,Y.jsx)(K,{icon:(0,Y.jsx)(Le,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$CREATED),children:C(e,i)}),(0,Y.jsx)(K,{icon:(0,Y.jsx)(H,{className:`size-3.5`}),label:n(p.AUTOMATIONS$DETAIL$LAST_RUN),children:t?w(t,i,n):n(p.AUTOMATIONS$DETAIL$TIME_NEVER)})]})})}var Ye=100,Xe=[`run_id`,`automation_id`,`automation_name`,`trigger`,`start_time`,`end_time`,`duration_seconds`,`status`,`conversation_id`,`conversation_url`,`error`,`cost`,`phase`];function Ze(e,t){return`${e.name.trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||e.id}.activity-log.${t}`}function Qe(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function $e(e){let t=[Xe.join(`,`)];for(let n of e){let e=Xe.map(e=>{let t=n[e];return t==null?``:Qe(e===`trigger`?JSON.stringify(t):String(t))});t.push(e.join(`,`))}return`${t.join(`
2
+ `)}\n`}function et(e,t){if(!e)return null;let n=`/conversations/${e}`;return t?`${t.replace(/\/$/,``)}${n}`:n}function tt(e,t,n){let r=e.started_at||null,i=e.completed_at,a=null;return r&&i&&(a=(new Date(i).getTime()-new Date(r).getTime())/1e3),{run_id:e.id,automation_id:t.id,automation_name:t.name,trigger:t.trigger,start_time:r,end_time:i,duration_seconds:a,status:e.status,conversation_id:e.conversation_id,conversation_url:et(e.conversation_id,n),error:e.error_detail,cost:e.cost??null,phase:e.phase_code?.trim()||e.phase_label?.trim()||null}}async function nt(e,t){let n=[],r=0,i=1/0;for(;r<i;){let a=await L.listAutomationRuns(e.id,{limit:Ye,offset:r});for(let r of a.runs)n.push(tt(r,e,t));if(i=a.total,r+=a.runs.length,a.runs.length===0)break}return n}async function rt(e){let{automation:t,format:n,conversationBaseUrl:r}=e,i=await nt(t,r);if(n===`json`){m(new Blob([`${JSON.stringify({runs:i,total:i.length},null,2)}\n`],{type:`application/json`}),Ze(t,`json`));return}m(new Blob([$e(i)],{type:`text/csv;charset=utf-8`}),Ze(t,`csv`))}var it=20;function at(e){return e.kind===`BashOutput`}var ot=class e{static async listOutputs(t,n,r){let i=[],a;for(let o=0;o<it;o+=1){let o=await e.searchEvents(t,n,{kind__eq:`BashOutput`,command_id__eq:r,sort_order:`TIMESTAMP`,...a?{page_id:a}:{}});if(o.items.forEach(e=>{at(e)&&i.push(e)}),!o.next_page_id)break;a=o.next_page_id}return i}static async searchEvents(e,t,n){let r=_().backend;if(r.kind===`cloud`){if(!e)throw Error(`BashService.listOutputs requires a conversation URL on cloud backends`);let i=new URLSearchParams;return Object.entries(n).forEach(([e,t])=>{t!=null&&i.set(e,String(t))}),P({backend:r,method:`GET`,hostOverride:g(e),path:`/api/bash/bash_events/search?${i.toString()}`,authMode:`session-api-key`,sessionApiKey:t})}return new N(v({...e?{conversationUrl:e}:{},sessionApiKey:t})).searchEvents(n)}},st=[`bash-command-logs`];function ct(e){switch(e){case`MISSING`:return`missing`;case`PAUSED`:return`paused`;case`STARTING`:return`starting`;case`ERROR`:return`errored`;case`RUNNING`:case null:case void 0:default:return null}}function lt(e){let t=o.isAxiosError(e)?e.response?.status:l(e)?e.status:void 0;if(t!==void 0)return t===404||t>=500?`unreachable`:null;if(o.isAxiosError(e)||e instanceof TypeError)return`unreachable`;if(e instanceof Error){let t=e.cause instanceof Error?e.cause.name:null;if(e.name===`AbortError`||e.name===`TimeoutError`||t===`AbortError`||t===`TimeoutError`)return`unreachable`}return null}function ut(e){let{conversationId:t,bashCommandId:n,enabled:r=!0}=e,i=d(),a=fe(r?t??null:null),o=a.data,c=o?.conversation_url??null,l=o?.session_api_key??null,u=i.backend.kind===`cloud`,f=a.isFetched,p=null,m=!1;u&&f&&(o?p=ct(o.sandbox_status)??(o.conversation_url?null:`missing`):m=!0);let h=r&&!!n&&(u?!!c:!0)&&!p&&!m,g=s({queryKey:[...st,n,c,l,i.backend.id,i.orgId],queryFn:()=>ot.listOutputs(c,l,n),enabled:h,staleTime:60*1e3,gcTime:300*1e3,retry:!1}),_=u?lt(g.error):null,v=p??_;return{data:g.data,error:_?null:g.error,isFetching:g.isFetching,isPending:g.isPending,isResolvingConversation:u&&a.isPending,conversationMissing:m,sandboxIssue:v}}var dt=4e3;function ft(e,t){return e.length<=t?e:`…(truncated)…\n${e.slice(e.length-t)}`}function pt({automationName:e,automationPrompt:t,errorDetail:n,stderr:r,runId:i}){let a=r?.trim()||n?.trim()||``,o=a?ft(a,dt):`No error output was captured for this run.`,s=e?.trim(),c=[`${s?`The scheduled automation "${s}" failed during a run.`:`A scheduled automation failed during a run.`} Please investigate the error and fix the root cause.`],l=t?.trim();return l&&c.push(``,`What the automation was set up to do:`,l),c.push(``,`Error output from the failed run (run ${i}):`,o,``,`Please diagnose why it failed and propose or implement a fix.`),c.join(`
3
+ `)}function mt({run:e,automation:t,stderr:n}){let{t:r}=c(`openhands`),{navigate:i}=re(),a=ie();return(0,Y.jsx)(ne,{testId:`debug-automation-button`,type:`button`,variant:`primary`,onClick:()=>{if(a.isPending)return;let r=pt({automationName:t?.name,automationPrompt:t?.prompt,errorDetail:e.error_detail,stderr:n,runId:e.id});a.mutate({query:r},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},isDisabled:a.isPending,"aria-busy":a.isPending,children:r(p.AUTOMATIONS$DETAIL$DEBUG_WITH_OPENHANDS)})}var ht={missing:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_MISSING,paused:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_PAUSED,starting:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_STARTING,errored:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_ERROR,unreachable:p.AUTOMATIONS$DETAIL$LOGS_SANDBOX_UNREACHABLE};function gt(e,t){return[...e].sort((e,t)=>{let n=e.timestamp.localeCompare(t.timestamp);return n===0?(e.order??0)-(t.order??0):n}).map(e=>e[t]??``).join(``)}function Z(e){return typeof e==`string`?e.trim()||null:typeof e==`number`||typeof e==`boolean`?String(e):null}function _t(e){if(!e)return null;let t=Z(e.formatted_detail)??Z(e.detail),n=[Z(e.phase),Z(e.kind),Z(e.source),Z(e.operation),Z(e.code),Z(e.status_code)].filter(Boolean);return t&&n.length>0?`${t} (${n.join(` · `)})`:t||(n.length>0?n.join(` · `):JSON.stringify(e))}function vt({run:e}){let{t}=c(`openhands`);if(!e)return null;let n=b(e),r=n.taskOutcome?.outcomeSummary??null,i=n.customTaskMetadataText,a=e.status===U.COMPLETED||n.taskOutcome?n.badgeStatus:null,o=e.error_detail?.trim()||null,s=_t(e.status_detail),l=o||s;return(0,Y.jsxs)(`dl`,{className:`mt-4 grid gap-3 rounded-lg border border-[var(--oh-border)] bg-black/20 p-3 text-xs`,children:[(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-center`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$RUN_LABEL)}),(0,Y.jsx)(`dd`,{children:(0,Y.jsx)(`span`,{className:`inline-flex rounded-md bg-surface-raised px-2 py-0.5 font-mono text-[10px] font-medium text-muted`,children:e.status})})]}),(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-start`,children:[(0,Y.jsx)(`dt`,{className:`pt-0.5 text-muted`,children:t(p.AUTOMATIONS$DETAIL$TASK_LABEL)}),(0,Y.jsxs)(`dd`,{className:`min-w-0 space-y-2`,children:[a?(0,Y.jsx)(O,{status:a,compact:!0}):null,r?(0,Y.jsx)(`p`,{className:`break-words text-content`,children:r}):i?(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$CUSTOM_TASK_METADATA)}):(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$NO_TASK_OUTCOME)}),i?(0,Y.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$TASK_METADATA)}),(0,Y.jsx)(`pre`,{"data-testid":`automation-task-metadata`,className:`max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md border border-[var(--oh-border)] bg-black/30 p-2 font-mono text-[11px] leading-4 text-content`,children:i})]}):null]})]}),(0,Y.jsxs)(`div`,{className:`grid gap-1 sm:grid-cols-[5rem_minmax(0,1fr)] sm:items-start`,children:[(0,Y.jsx)(`dt`,{className:`pt-0.5 text-muted`,children:t(p.AUTOMATIONS$DETAIL$SYSTEM_LABEL)}),(0,Y.jsx)(`dd`,{className:`min-w-0 space-y-1 break-words text-content`,children:l?(0,Y.jsxs)(Y.Fragment,{children:[o?(0,Y.jsxs)(`p`,{children:[(0,Y.jsxs)(`span`,{className:`text-muted`,children:[t(p.COMMON$ERROR),`:`,` `]}),o]}):null,s?(0,Y.jsxs)(`p`,{children:[(0,Y.jsxs)(`span`,{className:`text-muted`,children:[t(p.AUTOMATIONS$DETAIL$STATUS_DETAIL),`:`,` `]}),s]}):null]}):(0,Y.jsx)(`p`,{className:`text-muted`,children:t(p.AUTOMATIONS$DETAIL$NO_SYSTEM_ISSUES)})})]})]})}function yt({conversationId:e,bashCommandId:t,isOpen:n,onClose:r,run:i,automation:a}){let{t:o}=c(`openhands`),[s,l]=(0,J.useState)(`stdout`),{data:u,isFetching:d,isResolvingConversation:f,sandboxIssue:m,conversationMissing:g,error:_}=ut({conversationId:e,bashCommandId:t,enabled:n});(0,J.useEffect)(()=>{n&&l(`stdout`)},[n,t]),(0,J.useEffect)(()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,r]);let{stdout:v,stderr:y}=(0,J.useMemo)(()=>u?{stdout:gt(u,`stdout`),stderr:gt(u,`stderr`)}:{stdout:``,stderr:``},[u]);if(!n)return null;let b=f||d&&!u,x=!t,S=s===`stdout`?v:y,C=`border-b-2 px-3 py-2 text-sm font-normal transition-colors focus:outline-none`,w=`border-[var(--oh-primary)] text-white`,T=`border-transparent text-muted hover:text-content`;return(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,role:`dialog`,"aria-modal":`true`,"aria-label":o(p.AUTOMATIONS$DETAIL$LOGS_TITLE),children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 bg-black/60`,onClick:r,onKeyDown:e=>{e.key===`Escape`&&r()},role:`presentation`}),(0,Y.jsxs)(`div`,{className:`relative flex max-h-[80vh] w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-[var(--oh-surface)] p-6`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:r,className:`absolute right-4 top-4 text-muted hover:text-foreground`,"aria-label":o(p.AUTOMATIONS$CANCEL),children:(0,Y.jsx)(pe,{className:`size-5`})}),(0,Y.jsx)(`h2`,{className:h(`pr-8`,z),children:o(p.AUTOMATIONS$DETAIL$LOGS_TITLE)}),(0,Y.jsx)(vt,{run:i}),(0,Y.jsxs)(`div`,{role:`tablist`,"aria-label":o(p.AUTOMATIONS$DETAIL$LOGS_TITLE),className:`mt-4 flex gap-1 border-b border-[var(--oh-border)]`,children:[(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`stdout`,"aria-controls":`run-logs-panel-stdout`,id:`run-logs-tab-stdout`,tabIndex:s===`stdout`?0:-1,onClick:()=>l(`stdout`),className:`${C} ${s===`stdout`?w:T}`,children:o(p.AUTOMATIONS$DETAIL$LOGS_TAB_OUTPUT)}),(0,Y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===`stderr`,"aria-controls":`run-logs-panel-stderr`,id:`run-logs-tab-stderr`,tabIndex:s===`stderr`?0:-1,onClick:()=>l(`stderr`),className:`${C} ${s===`stderr`?w:T}`,children:o(p.AUTOMATIONS$DETAIL$LOGS_TAB_ERROR)})]}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`run-logs-panel-${s}`,"aria-labelledby":`run-logs-tab-${s}`,className:`mt-3 min-h-[12rem] flex-1 overflow-auto rounded-lg border border-[var(--oh-border)] bg-black/40 p-4 font-mono text-xs`,children:[x&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_NO_COMMAND)}),!x&&g&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_CONVERSATION_MISSING)}),!x&&!g&&m&&(0,Y.jsx)(`p`,{"data-testid":`run-logs-sandbox-issue-${m}`,className:`text-muted italic`,children:o(ht[m])}),!x&&!g&&!m&&b&&(0,Y.jsx)(`p`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_LOADING)}),!x&&!g&&!m&&!b&&_&&!u&&(0,Y.jsxs)(`p`,{className:`text-danger`,children:[o(p.AUTOMATIONS$DETAIL$LOGS_ERROR),`: `,String(_)]}),!b&&!m&&u&&(0,Y.jsx)(`pre`,{"data-testid":`run-logs-output-${s}`,className:`whitespace-pre-wrap break-words ${s===`stderr`?`text-danger`:`text-content`}`,children:S.length>0?S:(0,Y.jsx)(`span`,{className:`text-muted italic`,children:o(p.AUTOMATIONS$DETAIL$LOGS_EMPTY)})})]}),i?.status===U.FAILED&&(0,Y.jsx)(`div`,{className:`mt-4 flex justify-end`,children:(0,Y.jsx)(mt,{run:i,automation:a,stderr:y})})]})]})}function bt(e,t){return new Date(e).toLocaleDateString(t,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function xt(e){return`/conversations/${e}`}function St(e){return typeof e!=`number`||!Number.isFinite(e)?null:`$${e.toFixed(4)}`}function Ct({run:e,automation:t}){let{t:n,i18n:r}=c(`openhands`),i=!!e.conversation_id,a=!!e.bash_command_id,o=e.status===U.COMPLETED||e.status===U.FAILED||e.status===U.CANCELLED||e.status===U.SKIPPED,s=!i&&o,l=D(e.status),[u,d]=(0,J.useState)(!1),[f]=(0,J.useState)(()=>new Date().toISOString()),m=bt(k(e.started_at)?f:e.started_at,r.language),h=St(e.cost),g=b(e),_=a?(0,Y.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),e.preventDefault(),d(!0)},className:`rounded-md p-1 text-muted hover:bg-surface-raised hover:text-foreground focus:bg-surface-raised focus:outline-none`,"aria-label":n(p.AUTOMATIONS$DETAIL$LOGS_VIEW,{timestamp:m}),title:n(p.AUTOMATIONS$DETAIL$LOGS_VIEW_SHORT),children:(0,Y.jsx)(B,{className:`size-4`})}):null,v=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-sm text-content`,children:m}),s&&(0,Y.jsx)(`span`,{className:`text-xs text-muted`,children:n(p.AUTOMATIONS$DETAIL$NO_CONVERSATION)})]}),g.summary?(0,Y.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted`,children:g.summary}):null]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&(0,Y.jsx)(`span`,{"data-testid":`run-cost`,title:n(p.AUTOMATIONS$DETAIL$RUN_COST),className:`text-xs tabular-nums text-muted`,children:h}),_,l&&(0,Y.jsx)(S,{status:e.status,code:e.phase_code,label:e.phase_label,updatedAt:e.phase_updated_at,wide:!0}),(0,Y.jsx)(O,{status:g.badgeStatus})]})]});return(0,Y.jsxs)(Y.Fragment,{children:[i&&e.conversation_id?(0,Y.jsx)(`a`,{href:xt(e.conversation_id),className:`flex items-center justify-between px-5 py-3 transition-colors cursor-pointer hover:bg-surface-raised focus:bg-surface-raised focus:outline-none`,"aria-label":n(p.AUTOMATIONS$DETAIL$VIEW_CONVERSATION_FOR_RUN,{timestamp:m}),children:v}):(0,Y.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 cursor-default`,children:v}),a&&(0,Y.jsx)(yt,{conversationId:e.conversation_id,bashCommandId:e.bash_command_id,isOpen:u,onClose:()=>d(!1),run:e,automation:t})]})}var Q=20,wt=100;function Tt({automation:e,highlightedRunId:t=null}){let{t:n}=c(`openhands`),r=d(),{trackAutomationActivityLogExported:i}=R(),[a,o]=(0,J.useState)(Q),s=(0,J.useRef)(null),[l,u]=(0,J.useState)(!1),{data:m,isLoading:g}=de({id:e.id,limit:a,offset:0}),_=m?m.total>m.runs.length:!1,v=!g&&(m?.total??0)>0&&!l,y=async t=>{if(v){u(!0);try{await rt({automation:e,format:t,conversationBaseUrl:window.location.origin}),i({backendKind:r.backend.kind,format:t})}catch(e){f(W(e,n(p.AUTOMATIONS$DETAIL$EXPORT_ACTIVITY_LOG_ERROR)))}finally{u(!1)}}};return(0,J.useEffect)(()=>{if(!(!t||!m?.runs.length)){if(m.runs.findIndex(e=>e.id===t)<0){_&&a<wt&&o(e=>e+Q);return}s.current?.scrollIntoView({behavior:`smooth`,block:`center`})}},[m?.runs,_,t,a]),(0,Y.jsxs)(`div`,{"data-testid":`automation-activity-log`,className:`rounded-2xl border border-[var(--oh-border)] bg-[var(--oh-surface)]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--oh-border)] px-5 py-3`,children:[(0,Y.jsx)(`span`,{className:`size-4 text-muted`,children:(0,Y.jsx)(qe,{className:`size-4`})}),(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-content`,children:n(p.AUTOMATIONS$DETAIL$ACTIVITY_LOG)}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,Y.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-json`,disabled:!v,onClick:()=>void y(`json`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(p.AUTOMATIONS$DETAIL$EXPORT_JSON)}),(0,Y.jsx)(`button`,{type:`button`,"data-testid":`activity-log-export-csv`,disabled:!v,onClick:()=>void y(`csv`),className:`text-sm text-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,children:n(p.AUTOMATIONS$DETAIL$EXPORT_CSV)})]})]}),g&&(0,Y.jsx)(`div`,{className:`space-y-1 p-5`,children:Array.from({length:3}).map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,Y.jsx)(`div`,{className:`h-5 w-64 animate-pulse rounded bg-surface-raised`}),(0,Y.jsx)(`div`,{className:`h-6 w-24 animate-pulse rounded-full bg-surface-raised`})]},`skeleton-${t}`))}),!g&&m?.runs.length===0&&(0,Y.jsx)(`p`,{className:`px-5 py-8 text-center text-sm text-muted`,children:n(p.AUTOMATIONS$DETAIL$NO_RUNS)}),!g&&m&&m.runs.length>0&&(0,Y.jsxs)(`div`,{children:[m.runs.map((n,r)=>{let i=n.id===t;return(0,Y.jsx)(`div`,{ref:i?s:void 0,"data-testid":i?`automation-run-highlight-${n.id}`:void 0,className:h(r>0?`border-t border-[var(--oh-border)]`:``,i&&`bg-[var(--oh-focus)]/10`),children:(0,Y.jsx)(Ct,{run:n,automation:e})},n.id)}),_&&(0,Y.jsx)(`div`,{className:`border-t border-[var(--oh-border)] px-5 py-3`,children:(0,Y.jsx)(`button`,{type:`button`,onClick:()=>o(e=>e+Q),className:`text-sm text-muted hover:text-foreground`,children:n(p.AUTOMATIONS$DETAIL$LOAD_MORE_RUNS)})})]})]})}function $({className:e}){return(0,Y.jsx)(`div`,{className:h(`animate-pulse rounded bg-surface-raised`,e)})}function Et(){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,"data-testid":`detail-skeleton`,children:[(0,Y.jsx)($,{className:`h-5 w-40`}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)($,{className:`h-6 w-48`}),(0,Y.jsx)($,{className:`h-6 w-16 rounded-full`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)($,{className:`h-6 w-11 rounded-full`}),(0,Y.jsx)($,{className:`h-8 w-8`})]})]}),(0,Y.jsx)($,{className:`h-5 w-96`}),(0,Y.jsx)($,{className:`h-36 w-full rounded-2xl`}),(0,Y.jsx)($,{className:`h-72 w-full rounded-2xl`}),(0,Y.jsx)($,{className:`h-32 w-full rounded-2xl`}),(0,Y.jsx)($,{className:`h-40 w-full rounded-2xl`})]})}function Dt(){let{t:e}=c(`openhands`);return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20`,children:[(0,Y.jsx)(Ce,{className:`size-12 text-muted`}),(0,Y.jsx)(`p`,{className:`mt-4 text-sm font-medium text-content`,children:e(p.AUTOMATIONS$DETAIL$NOT_FOUND_TITLE)}),(0,Y.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:e(p.AUTOMATIONS$DETAIL$NOT_FOUND_MESSAGE)}),(0,Y.jsx)(`div`,{className:`mt-6`,children:(0,Y.jsx)(G,{})})]})}var Ot={id:``,name:``,prompt:null,trigger:{type:`cron`},enabled:!1,created_at:``,updated_at:``},kt=()=>{if(!I())throw new Response(null,{status:404,statusText:`Not Found`});return null},At=a(function(){let{t:e}=c(`openhands`),{automationId:t}=r(),[n]=i(),a=n.get(`run`),{navigate:o}=re(),[s,l]=(0,J.useState)(!1),[h,g]=(0,J.useState)(!1),{data:_,isLoading:v,refetch:y}=oe(),b=_?.status===`ok`,x=d(),S=(0,J.useRef)(x.backend.id).current!==x.backend.id,{data:C,isLoading:w,isError:T,error:E,refetch:D}=ce({id:t??``,enabled:b&&!S}),{trackPrebuiltAutomationEnabled:O,trackAutomationExported:k}=R(),A=le(),j=ue(),M=se(),{canManage:N}=ye(),P=ve(C??Ot),F=Ae(C?.user_id),I=T&&te(E)===404;if(v)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(Et,{})})});if(!b)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(Se,{onRetry:y})})});if(w)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(Et,{})})});if(I)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(Dt,{})})});if(T||!C)return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsx)(we,{onRetry:()=>D()})})});let z=()=>{let e=!C.enabled;A.mutate({id:C.id,enabled:e}),e&&O({automationId:C.id,automationName:C.name})},ne=()=>{j.mutate(C.id,{onSuccess:()=>{o?.(ee())}})},ie=()=>{M.mutate(C.id,{onSuccess:()=>{u(e(p.AUTOMATIONS$RUN_NOW_SUCCESS))},onError:t=>{f(W(t,e(p.AUTOMATIONS$RUN_NOW_ERROR)))}})},ae=()=>{let e=`${JSON.stringify(Ee(C),null,2)}\n`;m(new Blob([e],{type:`application/json`}),De(C)),k({backendKind:x.backend.kind})},B=N||P,V=null;x.backend.kind===`cloud`&&C.user_id&&(V=F.data?.email??(F.isError?C.user_id:null));let H=C.enabled?B:P;return(0,Y.jsx)(`div`,{className:`min-h-full`,children:(0,Y.jsx)(`div`,{className:`p-6 max-w-4xl mx-auto`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(G,{}),(0,Y.jsx)(Me,{automation:C,onToggle:z,onEdit:()=>g(!0),onDelete:()=>l(!0),onExport:ae,onDownloadTarball:()=>L.downloadTarball(C.id,C.name),onRunNow:ie,isRunningNow:M.isPending,canManage:B,canToggle:H}),(0,Y.jsx)(Ne,{automation:C}),C.prompt&&(0,Y.jsx)(Ie,{prompt:C.prompt}),(0,Y.jsx)(Ue,{automation:C,runsAs:V}),C.plugins&&C.plugins.length>0&&(0,Y.jsx)(Ke,{plugins:C.plugins}),(0,Y.jsx)(Je,{createdAt:C.created_at,lastRunAt:C.last_triggered_at}),(0,Y.jsx)(Tt,{automation:C,highlightedRunId:a}),(0,Y.jsx)(Te,{automationName:C.name,isOpen:s,onConfirm:ne,onCancel:()=>l(!1)}),h&&(0,Y.jsx)(_e,{automation:C,isOpen:h,onClose:()=>g(!1)})]})})})});export{kt as clientLoader,At as default};