@openhands/agent-canvas 1.19.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 (326) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BQ4o4vqy.js → acp-providers-DOKcGeaV.js} +1 -1
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D9i6ezoJ.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-U-9YzDFU.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-D-bUV2PX.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/{agent-server-conversation-service.api-BaVQ6NpE.js → agent-server-conversation-service.api-BtOlitCD.js} +3 -3
  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-BkVt_8Or.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-fAIld-n7.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-DITbrM2u.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/{automation-detail-DawHmaOl.js → automation-detail-CF2SweVs.js} +1 -1
  15. package/build/assets/{automation-disabled-reason-DtgC8Ppt.js → automation-disabled-reason-QFtMrdOr.js} +1 -1
  16. package/build/assets/{automation-export-Kv6e0bHx.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-Dd98G_Oz.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-Xhr-FDAB.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/{automations-list-BeP1LuzQ.js → automations-list-yK7ETmYP.js} +1 -1
  21. package/build/assets/{back-nav-button-DWNiN277.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/{backend-form-modal-DeaUJIik.js → backend-form-modal-DzYf_arO.js} +1 -1
  23. package/build/assets/{backend-synced-settings-badge-Br85iWIY.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-Cdnei7Ly.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-Ds7grR67.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-mQq2Ld1I.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-Bfum8fkE.js → browser-kY6jN61T.js} +1 -1
  28. package/build/assets/{browser-tab-CmYT4j_r.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-CokKSVRG.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-BoQEYG-2.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-Du2M5iEX.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-DM3JgMc2.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BbYBiUwv.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D02kgq1s.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-Dy1eWbSZ.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-mehU3Evb.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-DhQW8CXi.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-eRk6Fkx6.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-BmVt_c0I.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-lx2zk9G7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-BOj0ENI6.js → conversation-9a53tdbO.js} +3 -3
  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-C6YncQNo.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-DIhwCC2J.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-DVNXLylP.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-LP-x7nra.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-goDldkiu.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-Cd-TFe7i.js → empty-state-B5advKVW.js} +1 -1
  51. package/build/assets/{entry.client-CJdjIvMZ.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-pocrz9AL.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-Dwe78wRl.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-SuWwztxV.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-O0esK3Er.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-CgCVSXje.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-B_6t8ljw.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-lQfLxzH4.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-Bp5rsUkl.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-DPQVumZg.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-Bp0sgK-f.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/{home-BghzJd-D.js → home-BGaB0EeK.js} +1 -1
  65. package/build/assets/{home-automation-run-tooltip-BdpCckKO.js → home-automation-run-tooltip-v5n7zXR0.js} +1 -1
  66. package/build/assets/{home-store-DNQpfIEO.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-DkxnQa4N.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-DvxxYKia.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-CwTE6XJj.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-jsRGPRBx.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  73. package/build/assets/{llm-settings-dkQ5Oq7W.js → llm-settings-CUgt39uu.js} +1 -1
  74. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  75. package/build/assets/{llm-subscription-service-BiQaZbvv.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  76. package/build/assets/{loading-spinner-DK1sAwVg.js → loading-spinner-BJc2J0Dw.js} +1 -1
  77. package/build/assets/{manage-backends-modal-DqCJohsX.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  78. package/build/assets/manifest-23d79467.js +1 -0
  79. package/build/assets/{manifest-subpage-layout-sxuPqfUr.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  80. package/build/assets/{markdown-renderer-BH5pqDuJ.js → markdown-renderer-DRpwRlNm.js} +1 -1
  81. package/build/assets/{mcp-BtaJDXnP.js → mcp-CoUOIGBF.js} +1 -1
  82. package/build/assets/{mcp-installed-servers-Br4ZLsjr.js → mcp-installed-servers-BW51n6PC.js} +1 -1
  83. package/build/assets/{mcp-page-DwbnQpVs.js → mcp-page-hZ4aJjj_.js} +1 -1
  84. package/build/assets/{messages-DmFJlW6c.js → messages-WUb9Yh-p.js} +1 -1
  85. package/build/assets/{modal-body-DBweM2EN.js → modal-body-B_95ci1c.js} +1 -1
  86. package/build/assets/{modal-classes-jvG85nkU.js → modal-classes-BPcBCWVj.js} +1 -1
  87. package/build/assets/{modal-close-button-BrM5fNnn.js → modal-close-button-Cq3dma5u.js} +1 -1
  88. package/build/assets/{onboarding-CQ8T6T0U.js → onboarding-Cc4Av7bi.js} +1 -1
  89. package/build/assets/{onboarding-modal-CnliiaSN.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  90. package/build/assets/{organization-service.api-DmFUEmu5.js → organization-service.api-zhHpQU0t.js} +1 -1
  91. package/build/assets/{planner-tab-CXph_C9F.js → planner-tab-yISBVUKu.js} +1 -1
  92. package/build/assets/{plugins-management-service-CcEpfNKz.js → plugins-management-service-2oP6_tWr.js} +1 -1
  93. package/build/assets/{profiles-service.api-DdF_4Zhe.js → profiles-service.api-B5thiTI3.js} +1 -1
  94. package/build/assets/{providers-BWRnl31s.js → providers-Co9PsD0s.js} +1 -1
  95. package/build/assets/{proxy-DbEf3Nqr.js → proxy-BCCQUna8.js} +1 -1
  96. package/build/assets/{recommended-automations-launcher-r0oI91HN.js → recommended-automations-launcher-D1Do753p.js} +1 -1
  97. package/build/assets/{root-j2fFRlWS.js → root-D1y82Lhg.js} +2 -2
  98. package/build/assets/{root-layout-CfGgm2lo.js → root-layout-cQTYEG2w.js} +2 -2
  99. package/build/assets/{schema-field-c3Ncgm4x.js → schema-field-DSi0d7a8.js} +1 -1
  100. package/build/assets/{sdk-section-page-DFEiuiFQ.js → sdk-section-page-DCoI2dtd.js} +1 -1
  101. package/build/assets/{secret-form-WXXNFqTM.js → secret-form-BDvzojzN.js} +1 -1
  102. package/build/assets/{secrets-service-DU6wh3wX.js → secrets-service-C3CNNEpY.js} +1 -1
  103. package/build/assets/{secrets-settings-BEqbPvjy.js → secrets-settings-BKqfYQt5.js} +1 -1
  104. package/build/assets/{settings-DjaSQwFh.js → settings-C8ZLONyx.js} +1 -1
  105. package/build/assets/{settings-dropdown-input-BRR2OZwi.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  106. package/build/assets/{settings-index-DHv4XFcM.js → settings-index-BWvlGHg3.js} +1 -1
  107. package/build/assets/{settings-input-Cm4VxUon.js → settings-input-B3i5U9GL.js} +1 -1
  108. package/build/assets/{settings-list-classes-CaUfKZ33.js → settings-list-classes-DbqcSiVW.js} +1 -1
  109. package/build/assets/{settings-modal-djXuAnBO.js → settings-modal-DHKJSBPL.js} +1 -1
  110. package/build/assets/{settings-nav-DFb3hBMr.js → settings-nav-BThjwLWD.js} +1 -1
  111. package/build/assets/{settings-service.api-Q9lKW1TX.js → settings-service.api-CYBTLGOd.js} +1 -1
  112. package/build/assets/{settings-switch-seaSJc7t.js → settings-switch-CI93Iozg.js} +1 -1
  113. package/build/assets/{shared-conversation-x3rxVCon.js → shared-conversation-C7OILS-U.js} +1 -1
  114. package/build/assets/{sidebar-layout-B6mcvvdV.js → sidebar-layout-Csb6Geq0.js} +1 -1
  115. package/build/assets/{sidebar-mobile-menu-toggle-CEqS8KnA.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  116. package/build/assets/{sidebar-nav-link-BTHX11LG.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  117. package/build/assets/{sidebar-onboarding-checklist-storage-BP1kzn6p.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  118. package/build/assets/{skill-card-pill-row-TD39nfP3.js → skill-card-pill-row-CxOFySng.js} +1 -1
  119. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  120. package/build/assets/{skill-filter-CdBbbwjm.js → skill-filter-BvtbD--b.js} +1 -1
  121. package/build/assets/{skill-icon-badge-vUEp7gsC.js → skill-icon-badge-CVxE42yg.js} +1 -1
  122. package/build/assets/{skill-scope-BTRBQt0-.js → skill-scope-C0NxJnpT.js} +1 -1
  123. package/build/assets/{skills-plugins-k1tUNAw4.js → skills-plugins-BGjX4jve.js} +1 -1
  124. package/build/assets/{skills-settings-CENviPT7.js → skills-settings-d3ZwIjSP.js} +1 -1
  125. package/build/assets/{styled-tooltip-DVAlWYnL.js → styled-tooltip-CknPQH4Y.js} +1 -1
  126. package/build/assets/{task-list-tab-BLKF_x9f.js → task-list-tab-CQisRcPh.js} +1 -1
  127. package/build/assets/{terminal-Ckbnqb23.js → terminal-Bs50gJPC.js} +1 -1
  128. package/build/assets/{toggle-switch-DeiG9Mf6.js → toggle-switch-D3TBxlsc.js} +1 -1
  129. package/build/assets/{trash-CXN2R54L.js → trash-D1QMHInX.js} +1 -1
  130. package/build/assets/{typography-NarNyelM.js → typography-BdAApXGl.js} +1 -1
  131. package/build/assets/{usage-tab-Drd3O006.js → usage-tab-ClVHAFJy.js} +1 -1
  132. package/build/assets/{use-acp-credential-form-CJ5wPsQm.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  133. package/build/assets/{use-activate-agent-profile-iQZ0U3qV.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  134. package/build/assets/{use-agent-profiles-LCvb5OXT.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  135. package/build/assets/{use-automation-health-DdgSa8sA.js → use-automation-health-CbQ9n-k7.js} +1 -1
  136. package/build/assets/{use-automation-permissions-D3kEeieu.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  137. package/build/assets/{use-automations-CEubcYTD.js → use-automations-7_XBXHQK.js} +1 -1
  138. package/build/assets/{use-can-manage-org-profiles-CB8ybxFK.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  139. package/build/assets/{use-canvas-extensions-BMacwi2v.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  140. package/build/assets/{use-cloud-current-user-id-BEKRd6XZ.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  141. package/build/assets/{use-config-3WYcJsgC.js → use-config-BJ_FJCjV.js} +1 -1
  142. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  143. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  144. package/build/assets/{use-free-models-Ci3FkKEm.js → use-free-models-FAk2nngq.js} +1 -1
  145. package/build/assets/{use-get-secrets-fqS0kxt6.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  146. package/build/assets/{use-llm-configured-B71ZEVg2.js → use-llm-configured-DF9BYmIe.js} +1 -1
  147. package/build/assets/{use-llm-profiles-xtCBMbef.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  148. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  149. package/build/assets/{use-onboarding-completion-CEgjL02y.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  150. package/build/assets/{use-pinned-home-route-pK4IlJ-p.js → use-pinned-home-route-DByWTojw.js} +1 -1
  151. package/build/assets/{use-plugins-marketplace-B8-ZEB34.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  152. package/build/assets/{use-save-agent-profile-D7hJuW_u.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  153. package/build/assets/{use-save-settings-CikTu5xV.js → use-save-settings-CmX41wlf.js} +1 -1
  154. package/build/assets/{use-settings-BWIH5EuN.js → use-settings-D69cw06D.js} +1 -1
  155. package/build/assets/{use-settings-nav-items-DSKwLDnd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  156. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  157. package/build/assets/{use-user-conversation-C_l65DqW.js → use-user-conversation-BBDXUbOc.js} +1 -1
  158. package/build/assets/utils-CbjwNcR-.js +1 -0
  159. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  160. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  161. 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
  162. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js} +1 -1
  163. 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
  164. 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
  165. package/build/assets/{verification-settings-PKtoIUUY.js → verification-settings-BXspn27q.js} +1 -1
  166. package/build/index.html +4 -4
  167. package/build/locales/ar/openhands.json +8 -1
  168. package/build/locales/ca/openhands.json +8 -1
  169. package/build/locales/de/openhands.json +8 -1
  170. package/build/locales/en/openhands.json +8 -1
  171. package/build/locales/es/openhands.json +8 -1
  172. package/build/locales/fr/openhands.json +8 -1
  173. package/build/locales/it/openhands.json +8 -1
  174. package/build/locales/ja/openhands.json +8 -1
  175. package/build/locales/ko-KR/openhands.json +8 -1
  176. package/build/locales/no/openhands.json +8 -1
  177. package/build/locales/pt/openhands.json +8 -1
  178. package/build/locales/tr/openhands.json +8 -1
  179. package/build/locales/uk/openhands.json +8 -1
  180. package/build/locales/zh-CN/openhands.json +8 -1
  181. package/build/locales/zh-TW/openhands.json +8 -1
  182. package/config/defaults.json +3 -3
  183. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  184. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  185. package/dist/config/defaults.cjs +1 -1
  186. package/dist/config/defaults.cjs.map +1 -1
  187. package/dist/config/defaults.js +3 -3
  188. package/dist/config/defaults.js.map +1 -1
  189. package/dist/constants/profile-scope.d.ts +2 -2
  190. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  191. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  192. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  193. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  194. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  195. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  196. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  197. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  198. package/dist/hooks/query/query-keys.cjs +1 -1
  199. package/dist/hooks/query/query-keys.cjs.map +1 -1
  200. package/dist/hooks/query/query-keys.d.ts +1 -0
  201. package/dist/hooks/query/query-keys.js +10 -1
  202. package/dist/hooks/query/query-keys.js.map +1 -1
  203. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  204. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  205. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  206. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  207. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  208. package/dist/i18n/declaration.cjs +1 -1
  209. package/dist/i18n/declaration.cjs.map +1 -1
  210. package/dist/i18n/declaration.d.ts +8 -1
  211. package/dist/i18n/declaration.js +1 -1
  212. package/dist/i18n/declaration.js.map +1 -1
  213. package/dist/i18n/translation.cjs +2 -2
  214. package/dist/i18n/translation.cjs.map +1 -1
  215. package/dist/i18n/translation.js +119 -0
  216. package/dist/i18n/translation.js.map +1 -1
  217. package/dist/locales/ar/openhands.json +8 -1
  218. package/dist/locales/ca/openhands.json +8 -1
  219. package/dist/locales/de/openhands.json +8 -1
  220. package/dist/locales/en/openhands.json +8 -1
  221. package/dist/locales/es/openhands.json +8 -1
  222. package/dist/locales/fr/openhands.json +8 -1
  223. package/dist/locales/it/openhands.json +8 -1
  224. package/dist/locales/ja/openhands.json +8 -1
  225. package/dist/locales/ko-KR/openhands.json +8 -1
  226. package/dist/locales/no/openhands.json +8 -1
  227. package/dist/locales/pt/openhands.json +8 -1
  228. package/dist/locales/tr/openhands.json +8 -1
  229. package/dist/locales/uk/openhands.json +8 -1
  230. package/dist/locales/zh-CN/openhands.json +8 -1
  231. package/dist/locales/zh-TW/openhands.json +8 -1
  232. package/dist/manifests/automation-setup.cjs.map +1 -1
  233. package/dist/manifests/automation-setup.js.map +1 -1
  234. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  235. package/dist/manifests/manifest-local-validation.js.map +1 -1
  236. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  237. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  238. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  239. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  240. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  241. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  242. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  243. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  244. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  245. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  246. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  247. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  248. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  249. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  250. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  251. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  252. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  253. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  254. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  255. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  256. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  257. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  258. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  259. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  260. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  261. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  262. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  263. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  264. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  265. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  266. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  267. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  268. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  269. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  270. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  271. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  272. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  273. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  274. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  275. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  276. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  277. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  278. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  279. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  280. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  281. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  282. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  283. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  284. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  285. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  286. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  287. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  288. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  289. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +0 -1
  290. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  291. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  292. package/dist/package.cjs +1 -1
  293. package/dist/package.cjs.map +1 -1
  294. package/dist/package.js +3 -3
  295. package/dist/package.js.map +1 -1
  296. package/dist/routes/agent-settings.d.ts +6 -0
  297. package/dist/types/automation.cjs.map +1 -1
  298. package/dist/types/automation.d.ts +3 -1
  299. package/dist/types/automation.js.map +1 -1
  300. package/package.json +3 -3
  301. package/scripts/check-sdk-version-sync.mjs +6 -6
  302. package/scripts/dev-safe.mjs +14 -1
  303. package/scripts/docker-build.mjs +3 -0
  304. package/build/assets/active-backend-context-BsLfwrXB.js +0 -2
  305. package/build/assets/agent-settings-BZJHtaIK.js +0 -2
  306. package/build/assets/agent-settings-D4snDd6u.js +0 -1
  307. package/build/assets/automation-setup-route-Cdc109ZD.js +0 -3
  308. package/build/assets/conversation-SouWlGvs.js +0 -1
  309. package/build/assets/conversation-panel-SouWlGvs.js +0 -1
  310. package/build/assets/edit-automation-modal-BJJR9wSW.js +0 -1
  311. package/build/assets/git-repo-dropdown-CbD0_LPN.js +0 -1
  312. package/build/assets/home-CXZ8zawS.js +0 -1
  313. package/build/assets/index-home-Ca6Q5CtT.js +0 -1
  314. package/build/assets/llm-not-configured-banner-DMdL1vaX.js +0 -27
  315. package/build/assets/llm-settings-lNDerSlu.js +0 -1
  316. package/build/assets/manifest-ff93dc8c.js +0 -1
  317. package/build/assets/use-create-conversation-Be-eVpFp.js +0 -1
  318. package/build/assets/use-create-secret-Bk9ZxTjl.js +0 -1
  319. package/build/assets/use-manifest-capabilities-Bso6A_-A.js +0 -1
  320. package/build/assets/use-tracking-ChnSFChv.js +0 -3
  321. package/build/assets/utils-D-gOfhmN.js +0 -1
  322. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js +0 -2
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -18
  326. 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.19.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.19.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.19.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.
@@ -1 +1 @@
1
- import{K as e}from"./utils-D-gOfhmN.js";import{n as t}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";var n=`cli-generic`;function r(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t===`acp-managed`?null:t}function i(e){for(let t of[e.runtimeName,e.runtimeId,e.configured,e.sdkLlm]){let e=r(t);if(e)return e}return e.providerDefault??null}var a={"claude-code":{icon:`claude-code`,description_key:e.ONBOARDING$AGENT_CLAUDE_CODE_DESCRIPTION},codex:{icon:`codex`,description_key:e.ONBOARDING$AGENT_CODEX_DESCRIPTION},"gemini-cli":{icon:`gemini`,description_key:e.ONBOARDING$AGENT_GEMINI_CLI_DESCRIPTION}};function o(e){return t(e)?.available_models?.map(e=>({id:e.id,label:e.label}))}var s=Object.entries(a).map(([e,n])=>{let r=t(e);return{key:e,display_name:r?.display_name??e,default_command:r?[...r.default_command]:[],available_models:o(e),default_model:r?.default_model??void 0,description_key:n.description_key,icon:n.icon}}),c=`custom`,l={codex:[{name:`CODEX_AUTH_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.codex/auth.json`}}],"claude-code":[{name:`CLAUDE_CODE_OAUTH_TOKEN`,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_OAUTH_TOKEN_HINT}],"gemini-cli":[{name:`GOOGLE_APPLICATION_CREDENTIALS_JSON`,secret:!0,multiline:!0,hint_key:e.ONBOARDING$ACP_SECRET_FILE_BLOB_HINT,hint_values:{file:`~/.config/gcloud/application_default_credentials.json`}},{name:`GOOGLE_CLOUD_PROJECT`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_PROJECT_HINT},{name:`GOOGLE_CLOUD_LOCATION`,hint_key:e.ONBOARDING$ACP_SECRET_GCP_LOCATION_HINT},{name:`GOOGLE_GENAI_USE_VERTEXAI`,hint_key:e.ONBOARDING$ACP_SECRET_VERTEXAI_FLAG_HINT}]},u={"claude-code":[[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_API_KEY`],[`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_BASE_URL`]]};function d(e,t){return e?(u[e]??[]).filter(([e,n])=>t(e)&&t(n)):[]}var f=`gemini-2.5-pro`;function p(e){return e===`gemini-cli`?f:h(e)?.default_model??null}function m(n){if(!n||!h(n))return[];let r=t(n);if(!r)return[];let i=[...l[n]??[]];return r.api_key_env_var&&i.push({name:r.api_key_env_var,secret:!0,hint_key:e.ONBOARDING$ACP_SECRET_API_KEY_HINT}),r.base_url_env_var&&i.push({name:r.base_url_env_var,hint_key:e.ONBOARDING$ACP_SECRET_BASE_URL_HINT}),i}function h(e){if(e)return s.find(t=>t.key===e)}function g(e){let t=h(e);return t?t.display_name:null}function _(e){return h(e)?.icon??`cli-generic`}function v(e,t){return t?h(e)?.available_models?.find(e=>e.id===t)?.label??t:null}function y(e,t={}){if(e===`openhands`)return{agent_kind:`openhands`};let n=e===c,r=n?void 0:h(e);if(!n&&!r&&!t.allowUnknownServer)return null;let i=t.model===void 0?p(e):t.model;return{agent_kind:`acp`,acp_server:e,acp_command:t.command??[],acp_args:[],acp_model:i??null}}export{d as a,g as c,_ as d,i as f,y as i,m as l,s as n,p as o,n as r,h as s,c as t,v as u};
1
+ 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-DFEiuiFQ.js";var r=e();function i(){return(0,r.jsx)(n,{settingsSources:[{settingsSource:`agent_settings`,sectionKeys:[`agent_context`]}],testId:`agent-context-settings-screen`})}var a=t(i);export{a as default};
1
+ 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{C as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as i}from"./proxy-DbEf3Nqr.js";var a=`/api/agent-profiles`;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud agent-profile call requires a cloud backend.`);return e}async function s(){return i({backend:o(),method:`GET`,path:a})}async function c(e){return i({backend:o(),method:`GET`,path:`${a}/${encodeURIComponent(e)}`})}async function l(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}`,body:t})}async function u(e){return i({backend:o(),method:`DELETE`,path:`${a}/${encodeURIComponent(e)}`})}async function d(e,t){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){return i({backend:o(),method:`POST`,path:`${a}/${encodeURIComponent(e)}/activate`,body:{}})}var p=e({WELL_KNOWN_DEFAULT_AGENT_PROFILE_NAME:()=>h,default:()=>g});function m(){return t().backend.kind===`cloud`}var h=`default`,g=class{static async listProfiles(){return m()?s():new r(n()).listAgentProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getAgentProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveAgentProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteAgentProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameAgentProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateAgentProfile(e)}};export{h as n,p as r,g as t};
1
+ 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-BsLfwrXB.js";import{K as f,t as p}from"./utils-D-gOfhmN.js";import{t as m}from"./back-nav-button-DWNiN277.js";import{t as h}from"./loading-spinner-DK1sAwVg.js";import{t as g}from"./brand-button-mQq2Ld1I.js";import{i as _}from"./dropdown-classes-goDldkiu.js";import{t as v}from"./settings-dropdown-input-BRR2OZwi.js";import{t as y}from"./use-llm-profiles-xtCBMbef.js";import{t as b}from"./agent-profiles-service.api-U-9YzDFU.js";import{t as x}from"./use-agent-profiles-LCvb5OXT.js";import{i as S,n as C,t as w}from"./use-can-manage-org-profiles-CB8ybxFK.js";import{t as T}from"./u-edit-DAkcF52u.js";import{r as E}from"./typography-NarNyelM.js";import{o as D}from"./extension-module-card-classes-DpeaYhYo.js";import{i as O,n as k,o as A,r as j,t as M}from"./badge-Cdnei7Ly.js";import{t as N}from"./u-check-circle-BKn1spCL.js";import{i as P,n as F,r as I,t as L}from"./settings-list-classes-CaUfKZ33.js";import{n as ee}from"./settings-section-header-context-BOJ_Fbak.js";import{t as R}from"./use-save-agent-profile-D7hJuW_u.js";import{n as z}from"./use-activate-agent-profile-iQZ0U3qV.js";import{t as B}from"./merge-agent-profile-save-input-WcFmQVKK.js";import{i as V,t as H}from"./agent-settings-BZJHtaIK.js";var U=e(t(),1),W=e(n(),1),G=r();function K({onEdit:e,onSetActive:t,onDelete:n,isActive:r,isActivating:i,onClose:a,anchorRef:o}){let{t:c}=s(`openhands`),l=(0,U.useRef)(null),u=(0,U.useRef)([]),d=o?.current??null,[m,h]=(0,U.useState)();(0,U.useLayoutEffect)(()=>{if(!d)return;let e=()=>{let e=d.getBoundingClientRect();e&&h({position:`fixed`,zIndex:9999,top:e.bottom+8,right:window.innerWidth-e.right,width:`max-content`})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[d]),(0,U.useEffect)(()=>{u.current[0]?.focus()},[]),(0,U.useEffect)(()=>{let e=e=>{let t=e.target;l.current?.contains(t)||d?.contains(t)||a()},t=e=>{e.key===`Escape`&&a()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[d,a]);let g=e=>{e(),a()},v=(0,U.useCallback)((e,t)=>{if(e.key===`Tab`){a();return}let n=u.current.filter(Boolean).length;if(e.key===`ArrowDown`){e.preventDefault();let r=(t+1)%n;u.current[r]?.focus()}else if(e.key===`ArrowUp`){e.preventDefault();let r=(t-1+n)%n;u.current[r]?.focus()}},[a]),y=r||i,b=!!d,x=(0,G.jsxs)(`div`,{ref:l,className:p(`absolute right-0 top-full z-10 mt-2 w-[160px] rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 shadow-lg`,_,b&&`!static !top-auto !bottom-auto !left-auto !right-auto !mt-0`),role:`menu`,"aria-orientation":`vertical`,"data-testid":`agent-profile-actions-menu`,children:[(0,G.jsx)(k,{index:0,icon:(0,G.jsx)(T,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_EDIT),onClick:()=>g(e),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-edit`}),(0,G.jsx)(k,{index:1,icon:(0,G.jsx)(N,{width:16,height:16}),label:c(f.SETTINGS$PROFILE_SET_ACTIVE),onClick:()=>g(t),onKeyDown:v,menuItemsRef:u,disabled:y,testId:`agent-profile-set-active`}),(0,G.jsx)(k,{index:2,icon:(0,G.jsx)(S,{width:16,height:16}),label:c(f.BUTTON$DELETE),onClick:()=>g(n),onKeyDown:v,menuItemsRef:u,testId:`agent-profile-delete`})]});return b?typeof document>`u`||!m?null:W.createPortal((0,G.jsx)(`div`,{style:m,children:x}),document.body):x}function q({profile:e,isActive:t,canManage:n,onActivate:r,onEdit:i,onDelete:a,isActivating:o}){let{t:c}=s(`openhands`),[l,u]=(0,U.useState)(!1),d=(0,U.useRef)(null),m=e.agent_kind===`openhands`?e.llm_profile_ref:c(f.SETTINGS$AGENT_TYPE_ACP);return(0,G.jsxs)(`div`,{"data-testid":`agent-profile-row`,className:p(P,`justify-between gap-3`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm font-medium text-white`,title:e.name,children:e.name}),m?(0,G.jsx)(`span`,{className:`min-w-0 max-w-full truncate text-sm text-[var(--oh-muted)]`,title:m,children:m}):null,t&&(0,G.jsx)(M,{className:`shrink-0 whitespace-nowrap px-2.5 py-1 text-xs`,"data-testid":`agent-profile-active-badge`,children:c(f.SETTINGS$PROFILE_DEFAULT)})]}),n&&(0,G.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,G.jsx)(C,{ref:d,onClick:()=>u(e=>!e),ariaLabel:c(f.SETTINGS$PROFILE_MENU),testId:`agent-profile-menu-trigger`,className:I}),l&&(0,G.jsx)(K,{anchorRef:d,onEdit:()=>i(e),onSetActive:()=>r(e),onDelete:()=>a(e),isActive:t,isActivating:o,onClose:()=>u(!1)})]})]})}function J({isLoading:e,loadError:t,profiles:n,activeId:r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l}){let{t:u}=s(`openhands`);return e?(0,G.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,G.jsx)(h,{size:`large`})}):t?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-load-error`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-red-400`,children:u(f.SETTINGS$PROFILES_LOAD_ERROR)})}):n.length===0?(0,G.jsx)(`div`,{"data-testid":`agent-profiles-empty`,className:D,children:(0,G.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:u(f.SETTINGS$PROFILES_EMPTY)})}):(0,G.jsx)(`div`,{className:p(L,F),children:n.map(e=>(0,G.jsx)(q,{profile:e,isActive:!!e.id&&e.id===r,canManage:i,onActivate:a,onEdit:o,onDelete:c,isActivating:l},e.name))})}function Y(){let e=a();return o({mutationFn:e=>b.deleteProfile(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function X({profile:e,onClose:t}){let{t:n}=s(`openhands`),r=Y(),i=(0,U.useRef)(null);if(!e)return null;let a=async()=>{try{await r.mutateAsync(e.name),l(n(f.SETTINGS$PROFILE_DELETED,{name:e.name})),t()}catch(e){d(e instanceof Error?e.message:n(f.ERROR$GENERIC))}},o=()=>{r.isPending||t()},c=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(g,{ref:i,type:`button`,variant:`tertiary`,onClick:o,isDisabled:r.isPending,children:n(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`delete-agent-profile-confirm`,type:`button`,variant:`danger`,onClick:a,isDisabled:r.isPending,"aria-busy":r.isPending,children:r.isPending?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{size:`small`}),(0,G.jsx)(`span`,{className:`sr-only`,children:n(f.BUTTON$DELETE)})]}):n(f.BUTTON$DELETE)})]});return(0,G.jsx)(j,{isOpen:!0,title:n(f.SETTINGS$PROFILE_DELETE_TITLE),footer:c,onClose:o,initialFocusRef:i,children:(0,G.jsx)(`p`,{className:`text-sm break-all`,children:n(f.SETTINGS$PROFILE_DELETE_CONFIRMATION,{name:e.name})})})}function te({onAddProfile:e,onEditProfile:t}){let{t:n}=s(`openhands`),{data:r,isLoading:i,error:a}=x(),o=z(),c=w(),[u,d]=(0,U.useState)(null),p=r?.profiles??[],m=r?.active_agent_profile_id??null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`h2`,{className:`text-base font-medium text-white`,children:n(f.SETTINGS$AVAILABLE_PROFILES)}),e&&c?(0,G.jsx)(g,{testId:`add-agent-profile`,type:`button`,variant:`secondary`,className:`ml-auto`,onClick:e,children:n(f.SETTINGS$ADD_AGENT_PROFILE)}):null]}),(0,G.jsx)(J,{isLoading:i,loadError:a??null,profiles:p,activeId:m,canManage:c,onActivate:async e=>{if(e.id)try{await o.mutateAsync(e.id),l(n(f.SETTINGS$PROFILE_ACTIVATED,{name:e.name}))}catch(e){console.error(`Failed to activate agent profile:`,e)}},onEdit:e=>t?.(e),onDelete:d,isActivating:o.isPending})]}),(0,G.jsx)(X,{profile:u,onClose:()=>d(null)})]})}function ne(){let e=a();return o({mutationFn:({name:e,newName:t})=>b.renameProfile(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:c.all})},meta:{disableToast:!0}})}function re(e){if(e.agent_kind===`acp`)return{agent_kind:`acp`,mcp_server_refs:e.mcp_server_refs??null,acp_server:e.acp_server,acp_command:e.acp_command?V(e.acp_command):[],acp_args:e.acp_args??[],acp_model:e.acp_model??``};let t=e.enable_switch_llm_tool??!0;return{agent_kind:`openhands`,mcp_server_refs:e.mcp_server_refs??null,enable_sub_agents:e.enable_sub_agents,enable_switch_llm_tool:t,tool_concurrency_limit:e.tool_concurrency_limit}}function Z(){let{t:e}=s(`openhands`),{setHideSectionHeader:t}=ee(),n=R(),r=ne(),{data:i}=x(),{data:a,isLoading:o}=y(),[c,p]=(0,U.useState)(`list`),[h,_]=(0,U.useState)(``),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(null),[D,k]=(0,U.useState)(``),[j,M]=(0,U.useState)(null),[N,P]=(0,U.useState)(!1);(0,U.useEffect)(()=>(t(c!==`list`),()=>t(!1)),[c,t]);let F=a?.profiles??[],I=a?.active_profile??F[0]?.name??``,L=(0,U.useMemo)(()=>new Set(i?.profiles?.map(e=>e.name)??[]),[i]),z=(0,U.useMemo)(()=>!(!A(h,{isRequired:!0})||c===`create`&&L.has(h)||c===`edit`&&h!==S?.name&&L.has(h)),[h,c,L,S?.name]),V=(0,U.useCallback)(()=>{_(``),C(null),T({agent_kind:`openhands`}),k(I),M(null),p(`create`)},[I]),W=(0,U.useCallback)(async t=>{try{let e=(await b.getProfile(t.name,`encrypted`)).profile;C(e),T(re(e)),e.agent_kind===`openhands`?k(o||F.some(t=>t.name===e.llm_profile_ref)?e.llm_profile_ref:I):k(``),_(e.name),M(null),p(`edit`)}catch(t){console.error(`Failed to fetch agent profile:`,t),d(e(f.ERROR$GENERIC))}},[e,F,o,I]),K=(0,U.useCallback)(()=>{p(`list`),C(null),_(``),T(null),M(null)},[]),q=(0,U.useCallback)(async()=>{if(!j||!z)return;let t;try{let n=j.buildAgentProfileFields();if(n.agent_kind===`openhands`){if(!D){d(e(f.SETTINGS$AGENT_PROFILE_LLM_REQUIRED));return}t={...n,llm_profile_ref:D}}else t=n}catch(t){d(t instanceof Error?t.message:e(f.ERROR$GENERIC));return}let i=h.trim(),a=S?.name,o=c===`edit`&&a&&a!==i;P(!0);try{if(j.credentials.isDirty){if(!await j.credentials.save({silent:!0}))return;j.credentials.reset()}o&&await r.mutateAsync({name:a,newName:i});let s=B(c===`edit`?S:null,t);await n.mutateAsync({name:i,profile:s}),l(e(c===`create`?f.SETTINGS$PROFILE_CREATED:f.SETTINGS$PROFILE_UPDATED,{name:i})),K()}catch(t){d(u(t)||e(f.ERROR$GENERIC))}finally{P(!1)}},[j,z,D,h,c,S,n,r,e,K]);if(c===`list`)return(0,G.jsx)(te,{onAddProfile:V,onEditProfile:W});let J=e(c===`edit`?f.SETTINGS$EDIT_AGENT_PROFILE:f.SETTINGS$ADD_AGENT_PROFILE),Y=c===`edit`&&S?e(f.SETTINGS$PROFILE_LOADED,{name:S.name}):e(f.SETTINGS$PROFILE_SAVE_HINT),X=j?.agentType!==`acp`,Z=c===`edit`&&h!==S?.name,Q=S?.agent_kind===`openhands`?S.llm_profile_ref:``,$=c===`edit`&&X&&D!==Q,ie=c===`create`||!!j?.isDirty||Z||$;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(m,{testId:`back-to-agent-profiles`,onClick:K,children:e(f.BUTTON$BACK)}),(0,G.jsx)(E.H2,{testId:`agent-profile-editor-title`,children:J}),(0,G.jsx)(`p`,{"data-testid":`agent-profile-editor-description`,className:`text-sm leading-5 text-tertiary-light`,children:Y})]}),(0,G.jsx)(O,{testId:`agent-profile-name-input`,value:h,onChange:_,isRequired:!0}),(0,G.jsx)(H,{embedded:!0,agentSettingsOverride:w,onSaveControlChange:M},c===`edit`?`edit-${S?.id}`:`new-profile`),X&&(F.length>0?(0,G.jsx)(v,{testId:`agent-profile-llm-selector`,name:`agent-profile-llm`,label:e(f.SETTINGS$AGENT_PROFILE_LLM_LABEL),items:F.map(e=>({key:e.name,label:e.model?`${e.name} (${e.model})`:e.name})),selectedKey:D,onSelectionChange:e=>e&&k(String(e))}):(0,G.jsx)(`p`,{"data-testid":`agent-profile-no-llm`,className:`text-sm text-red-400`,children:e(f.SETTINGS$AGENT_PROFILE_NO_LLM)})),(0,G.jsxs)(`div`,{className:`flex justify-start gap-3 pt-4`,children:[(0,G.jsx)(g,{testId:`cancel-agent-profile-btn`,type:`button`,variant:`secondary`,onClick:K,children:e(f.BUTTON$CANCEL)}),(0,G.jsx)(g,{testId:`save-agent-profile-btn`,type:`button`,variant:`primary`,onClick:q,isDisabled:!z||N||!j?.isValid||!ie,"aria-busy":N,children:e(N?f.SETTINGS$SAVING:f.BUTTON$SAVE)})]})]})}var Q={hideTitle:!1},$=i(function(){return(0,G.jsx)(Z,{})});export{$ as default,Q as handle};
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};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/profiles-service.api-DdF_4Zhe.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js","assets/vendor-styling-Ck5D_A2Q.js","assets/agent-server-client-options-EHB23gyx.js","assets/agent-server-config-C_x8Otd9.js","assets/proxy-DbEf3Nqr.js","assets/agent-profiles-service.api-U-9YzDFU.js","assets/secrets-service-DU6wh3wX.js","assets/active-backend-context-BsLfwrXB.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js","assets/utils-D-gOfhmN.js","assets/hooks-service-DkxnQa4N.js"])))=>i.map(i=>d[i]);
2
- import{xt as e}from"./vendor-styling-Ck5D_A2Q.js";import{K as t,X as n,f as r,w as i}from"./active-backend-context-BsLfwrXB.js";import{D as a}from"./utils-D-gOfhmN.js";import{a as o,c as s,d as c,n as l,t as u,u as ee}from"./agent-server-client-options-EHB23gyx.js";import{d as te,n as ne,s as d}from"./agent-server-config-C_x8Otd9.js";import{S as re,_ as f,l as p,p as m,v as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{t as g}from"./proxy-DbEf3Nqr.js";import{r as ie,t as _}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BFRW8wt-.js";import{n as ae}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js";import{t as v}from"./settings-CKqk8ZnH.js";import{t as y}from"./settings-service.api-Q9lKW1TX.js";import{t as oe}from"./profiles-service.api-DdF_4Zhe.js";import{f as b,o as se,s as x}from"./acp-providers-BQ4o4vqy.js";import{c as S,n as C,r as w}from"./skill-enablement-DXeaImBz.js";import{d as T,f as ce,r as le}from"./llm-subscription-DTqtBCWz.js";import{t as ue}from"./llm-subscription-service-BiQaZbvv.js";var E=[];for(let e=0;e<256;++e)E.push((e+256).toString(16).slice(1));function de(e,t=0){return(E[e[t+0]]+E[e[t+1]]+E[e[t+2]]+E[e[t+3]]+`-`+E[e[t+4]]+E[e[t+5]]+`-`+E[e[t+6]]+E[e[t+7]]+`-`+E[e[t+8]]+E[e[t+9]]+`-`+E[e[t+10]]+E[e[t+11]]+E[e[t+12]]+E[e[t+13]]+E[e[t+14]]+E[e[t+15]]).toLowerCase()}var fe=new Uint8Array(16);function pe(){return crypto.getRandomValues(fe)}function D(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():me(e,t,n)}function me(e,t,n){e||={};let r=e.random??e.rng?.()??pe();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return de(r)}var O=new Map;function he(e){return/^([/\\]|[a-zA-Z]:[/\\])/.test(e)}function ge(e,t){return`${e.replace(/[/\\]+$/,``)}/${t.replace(/^[/\\]+/,``)}`}async function _e(e={}){let t=l(e),n=t.host,r=O.get(n);if(r)return r;let i=(async()=>{let{home:e}=await new f(t).getHome();if(!e||typeof e!=`string`)throw Error(`Agent server returned an empty home directory`);return e.replace(/[/\\]+$/,``)})();O.set(n,i);try{return await i}catch(e){throw O.delete(n),e}}async function k(e,t={}){let n=e.replace(/[/\\]+$/,``);return n?he(n)?n:ge(await _e(t),n):_e(t)}var A=`openhands-agent-server-conversation-metadata`,ve=e=>({source:e.source,ref:e.ref??null,repo_path:e.repo_path??null}),j=()=>{if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(A);if(!e)return{};let t=JSON.parse(e);return!t||typeof t!=`object`?{}:t}catch{return{}}},ye=e=>{if(!(typeof window>`u`)){if(Object.keys(e).length===0){window.localStorage.removeItem(A);return}window.localStorage.setItem(A,JSON.stringify(e))}},M=e=>j()[e]??null,N=(e,t)=>{let n=j();n[e]=t,ye(n)},be=(e,t)=>{N(e,{selected_repository:null,selected_branch:null,git_provider:null,...M(e)??{},...t})},P=e=>{let t=j();e in t&&(delete t[e],ye(t))};function xe(e){if(!e?.id)return e;let t=M(e.id);return t?{...e,selected_repository:e.selected_repository??t.selected_repository??null,selected_branch:e.selected_branch??t.selected_branch??null,git_provider:e.git_provider??t.git_provider??null,selected_workspace:e.selected_workspace??t.selected_workspace??null}:e}function F(){let e=s().backend;if(e.kind!==`cloud`)throw Error(`Cloud conversations call requires a cloud backend.`);return e}function Se(){let e=s().backend;return e.kind===`cloud`?e:c().find(e=>e.kind===`cloud`&&!!e.apiKey)??null}async function Ce(e=20,t){let n=F(),r=new URLSearchParams;r.set(`limit`,String(e)),t&&r.set(`page_id`,t),r.set(`sort_order`,`UPDATED_AT_DESC`);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/search?${r.toString()}`});return{items:(i?.items??[]).map(e=>xe(e)),next_page_id:i?.next_page_id??null}}async function I(e){if(e.length===0)return[];let t=F(),n=new URLSearchParams;for(let t of e)n.append(`ids`,t);return(await g({backend:t,method:`GET`,path:`/api/v1/app-conversations?${n.toString()}`})??[]).map(xe)}async function we(e,t){return await g({backend:t??F(),method:`POST`,path:`/api/v1/app-conversations`,body:e,headers:i})}async function Te(e){return g({backend:F(),method:`GET`,path:`/api/v1/app-conversations/${e}/download`,responseType:`blob`})}async function Ee(e){await g({backend:F(),method:`DELETE`,path:`/api/v1/app-conversations/${e}`})}async function De(e,t){return await g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{public:t}})}async function Oe(e,t){return g({backend:F(),method:`PATCH`,path:`/api/v1/app-conversations/${e}`,body:{title:t}})}async function ke(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/pause`})}async function Ae(e){await g({backend:F(),method:`POST`,path:`/api/v1/sandboxes/${e}/resume`})}async function je(e,t){let n=F(),r=new URLSearchParams;return r.append(`file_path`,t),await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/file?${r.toString()}`})??``}async function Me(e,t){let n=F(),r=new URLSearchParams;r.append(`path`,t);let i=await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/${e}/files?${r.toString()}`});return Array.isArray(i)?i:[]}async function Ne(e,t){let n=t??F(),r=new URLSearchParams;return r.set(`ids`,e),(await g({backend:n,method:`GET`,path:`/api/v1/app-conversations/start-tasks?${r.toString()}`}))?.[0]??null}function Pe(e){return e.kind===`cloud`&&e.authMode===`cookie`||!e.apiKey?{}:e.kind===`cloud`?{Authorization:`Bearer ${e.apiKey}`}:{"X-Session-API-Key":e.apiKey}}function Fe(e){if(!e?.usage_to_metrics)return{accumulated_cost:0,max_budget_per_task:null,accumulated_token_usage:null};let t=0,n=null,r=null;for(let i of Object.values(e.usage_to_metrics))t+=i.accumulated_cost,n===null&&i.max_budget_per_task!==null&&(n=i.max_budget_per_task),i.accumulated_token_usage&&(r=r===null?{...i.accumulated_token_usage}:{prompt_tokens:r.prompt_tokens+i.accumulated_token_usage.prompt_tokens,completion_tokens:r.completion_tokens+i.accumulated_token_usage.completion_tokens,cache_read_tokens:r.cache_read_tokens+i.accumulated_token_usage.cache_read_tokens,cache_write_tokens:r.cache_write_tokens+i.accumulated_token_usage.cache_write_tokens,context_window:Math.max(r.context_window,i.accumulated_token_usage.context_window),per_turn_token:Math.max(r.per_turn_token,i.accumulated_token_usage.per_turn_token)});return{accumulated_cost:t,max_budget_per_task:n,accumulated_token_usage:r}}function Ie(e){return Fe(e.stats)}var Le=`canvas_ui`,L=`canvas_ui_control`,Re=`ClientAction_${L}`,ze={name:L,description:`The user is interacting with you inside Agent Canvas — a web UI with a chat panel on the left and a tabbed right-side panel (files, terminal, browser, vscode, planner, tasklist). This tool lets you drive that right-side panel so the user sees what you just produced.
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
3
 
4
4
  They will NOT see the files you wrote, the terminal output, or the browser
5
5
  unless you call this tool to switch the right-side panel to the relevant
@@ -85,4 +85,4 @@ reports an error, fix the parameters and call this tool again.`,parameters:{type
85
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
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
87
 
88
- `)}],run:!0}}function Mt(){return ae.map(e=>{let t=e.triggers?.length>0?{type:`keyword`,keywords:e.triggers}:null,n=`/home/runner/work/OpenHands/OpenHands/node_modules/@openhands/extensions/skills/${e.name}/SKILL.md`;return{name:e.name,content:e.content,trigger:t,source:n,description:e.description??null,is_agentskills_format:!0,...e.license?{license:e.license}:{},...e.compatibility?{compatibility:e.compatibility}:{}}})}function J(e,t,n={},r){let i=lt(t),a=W(e.agent_context),o=Array.isArray(a.skills)?a.skills:[],s=n.disabledSkills??[],c=new Set(s),l=C(n),u=[...o.filter(e=>typeof e.name!=`string`||!c.has(e.name)),...Mt().filter(e=>e.name===r||l(e.name))];return{...a,skills:u,load_public_skills:!1,load_user_skills:!0,load_project_skills:!0,disabled_skills:s,...i?{system_message_suffix:i}:{}}}function Nt(e){return W(e.agent_settings).agent_kind===`acp`}function Pt(e){let t=W(e.agent_settings).acp_server;return typeof t==`string`&&t.length>0?t:void 0}function Ft(e){let t=e.acp_command;if(!(Array.isArray(t)&&t.length===0)&&t!==void 0)return t;let n=x(typeof e.acp_server==`string`?e.acp_server:void 0);return n?[...n.default_command]:t}function It(e,t,n){let r=W(e.agent_settings),i={agent_kind:`acp`,agent_context:J(r,t,S(e),w(n))};for(let e of _){if(e===`acp_model`||e===`acp_env`)continue;let t=e===`acp_command`?Ft(r):r[e];t!=null&&(i[e]=t)}let a=W(r.mcp_config);Object.keys(a).length>0&&(i.mcp_config=a);let o=typeof r.acp_server==`string`?r.acp_server:void 0,s=b({configured:r.acp_model,providerDefault:se(o)});return s&&(i.acp_model=s),i}function Lt(e,t,n){let r=W(e.agent_settings),i=Tt(r.llm);i.stream=!0;let a=W(r.mcp_config);Object.keys(a).length===0&&delete r.mcp_config,delete r.acp_server;for(let e of _)delete r[e];return delete r.acp_env,{...r,llm:i,agent_context:J(r,t,S(e),w(n)),tools:At(r)}}function Rt(e,t,n){return Nt(e)?It(e,t,n):Lt(e,t,n)}function zt(e){let{settings:t,query:n,conversationInstructions:r,plugins:i,workingDir:a}=e,o=W(t.conversation_settings),s=jt(n,r);return Ct.forEach(e=>delete o[e]),{...o,workspace:{kind:`LocalWorkspace`,working_dir:a??d()},...s?{initial_message:s}:{},...i?.length?{plugins:i.map(e=>({source:e.source,...e.ref?{ref:e.ref}:{},...e.repo_path?{repo_path:e.repo_path}:{}}))}:{}}}function Bt(e){if(!e?.length)return;let t=ee(),n=t?Pe(t):{},r={};for(let t of e){let e={kind:`LookupSecret`,url:`/api/settings/secrets/${encodeURIComponent(t.name)}`,description:t.description};Object.keys(n).length>0&&(e.headers=n),r[t.name]=e}return r}function Vt(e){let t=e.encryptedAgentSettings?{...e.settings,agent_settings:e.encryptedAgentSettings}:e.settings,n=Nt(t),r=e.agentProfileId?e.agentProfileKind:n?`acp`:`openhands`,i=Rt(t,e.runtimeServicesInfo,e.query),a=n?Pt(t):void 0,o=zt(e.encryptedConversationSettings?{...e,settings:{...e.settings,conversation_settings:e.encryptedConversationSettings}}:e),s={...e.agentProfileId?{agent_profile_id:e.agentProfileId}:{agent_settings:i},workspace:o.workspace,client_tools:r===`openhands`?[ze,Ge]:[],confirmation_policy:Dt(o),max_iterations:ot(o.max_iterations),stuck_detection:!0,autotitle:!0,...e.titleLlmProfile?{title_llm_profile:e.titleLlmProfile}:{},worktree:e.worktree??!0};!e.agentProfileId&&a?s.tags={[pt]:a,[H]:mt}:s.tags={[H]:mt},!e.agentProfileId&&e.secretsEncrypted&&(!n||Et(i.mcp_config))&&(s.secrets_encrypted=!0),e.conversationId&&(s.conversation_id=e.conversationId),e.parentConversationId&&(s.parent_conversation_id=e.parentConversationId);let c=Ot(o);c&&(s.security_analyzer=c),o.initial_message&&(s.initial_message=o.initial_message),o.plugins&&(s.plugins=o.plugins),o.hook_config?s.hook_config=o.hook_config:e.workspaceHookConfig&&(s.hook_config=e.workspaceHookConfig);let l={...o.tool_module_qualnames??{}};delete l[Le],delete l[L],delete l[R],Object.keys(l).length>0&&(s.tool_module_qualnames=l),o.agent_definitions&&(s.agent_definitions=o.agent_definitions);let u=Bt(e.customSecrets);return u&&(s.secrets=u),s}function Ht(e){let t=W(e.encryptedAgentSettings),n=Tt(t.llm);n.stream=!0;let r=Qe(e.workingDir),i=J(t,void 0,e.skillEnablement),a=i.system_message_suffix;i.system_message_suffix=typeof a==`string`?`${Ze}\n\n${a}`:Ze;let o=jt(e.initialMessage),s={agent:{kind:`Agent`,llm:n,tools:[{name:`glob`,params:{}},{name:`grep`,params:{}},{name:Je,params:{plan_path:r}}],system_prompt_filename:qe,system_prompt_kwargs:{plan_structure:Xe},agent_context:i,condenser:{kind:`LLMSummarizingCondenser`,llm:{...n,usage_id:`planning_condenser`},max_size:100,keep_first:6}},workspace:{kind:`LocalWorkspace`,working_dir:e.workingDir},client_tools:[],confirmation_policy:{kind:`NeverConfirm`},max_iterations:e.maxIterations??at,stuck_detection:!0,autotitle:!1,worktree:!1,parent_conversation_id:e.parentConversationId,tags:{[z]:e.parentConversationId},...o?{initial_message:o}:{}};e.secretsEncrypted&&(s.secrets_encrypted=!0);let c=Bt(e.customSecrets);return c&&(s.secrets=c),s}async function Ut(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./profiles-service.api-DdF_4Zhe.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6])),r=await n.getProfile(t,`encrypted`);return G(r.config)?r.config:null}catch(e){return console.warn(`Falling back: could not resolve LLM profile ${t}`,e),null}}async function Wt(t){try{let{default:n}=await e(async()=>{let{default:e}=await import(`./agent-profiles-service.api-U-9YzDFU.js`).then(e=>e.r);return{default:e}},__vite__mapDeps([7,1,2,3,4,5,6])),{profiles:r}=await n.listProfiles(),i=r.find(e=>e.id===t&&e.llm_profile_ref);return i?.llm_profile_ref?await Ut(i.llm_profile_ref):null}catch(e){return console.warn(`Falling back to global agent settings: could not resolve the LLM for agent profile ${t}`,e),null}}async function Gt(t){let{SecretsService:n}=await e(async()=>{let{SecretsService:e}=await import(`./secrets-service-DU6wh3wX.js`).then(e=>e.n);return{SecretsService:e}},__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),[r,i]=await Promise.all([y.getSettingsForConversation(),n.getSecrets()]),a=(t.parentActiveProfileName?await Ut(t.parentActiveProfileName):null)??(t.parentAgentProfileId?await Wt(t.parentAgentProfileId):null),o=a?{...r.agentSettings,llm:a}:r.agentSettings;await Y(o);let s=ot(r.conversationSettings.max_iterations);return Ht({...t,encryptedAgentSettings:o,secretsEncrypted:r.secretsEncrypted,customSecrets:i,maxIterations:s,skillEnablement:r.skillEnablement})}var Kt=`Connect your ChatGPT subscription before starting a conversation with this LLM profile.`;async function Y(e){if(ce(W(e.llm))&&!(await ue.getOpenAIStatus()).connected)throw Error(Kt)}async function qt(t){let[{SecretsService:n},{default:r}]=await Promise.all([e(()=>import(`./secrets-service-DU6wh3wX.js`).then(e=>e.n),__vite__mapDeps([8,1,9,3,2,10,11,12,4,5,13,6])),e(()=>import(`./hooks-service-DkxnQa4N.js`),__vite__mapDeps([14,2,1,3,4,5]))]),[i,a,o,s]=await Promise.all([y.getSettingsForConversation(),n.getSecrets(),ct(),r.loadWorkspaceHooks(t.hooksProjectDir)]),{agentSettings:c,conversationSettings:l,secretsEncrypted:u}=i;return t.agentProfileId||await Y(c),Vt({...t,encryptedAgentSettings:c,encryptedConversationSettings:l,secretsEncrypted:u,customSecrets:a,runtimeServicesInfo:o,workspaceHookConfig:s})}function Jt(){return{hooks:[]}}function Yt(e,t){if(!t)return;let n=new Set(t.profiles.map(e=>e.name));if(e&&n.has(e))return e;if(t.active_profile&&n.has(t.active_profile))return t.active_profile}var Xt=`1970-01-01T00:00:00.000Z`,Zt=300*1e3,Qt=`Unable to load conversations because the selected agent server returned data this UI does not understand. Check the backend URL/session key and update the agent server if needed.`;function X(){return Error(Qt)}function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $t(e){return typeof e==`number`?e:null}function Q(e){return typeof e==`number`?e:0}function $(e){return typeof e==`string`?e:null}function en(e,t,n){let r=e[t]??e[n];return typeof r==`string`&&r.trim()?r:Xt}function tn(e){return Z(e)?{prompt_tokens:Q(e.prompt_tokens),completion_tokens:Q(e.completion_tokens),cache_read_tokens:Q(e.cache_read_tokens),cache_write_tokens:Q(e.cache_write_tokens),context_window:Q(e.context_window),per_turn_token:Q(e.per_turn_token)}:null}function nn(e){return Z(e)?{accumulated_cost:$t(e.accumulated_cost),max_budget_per_task:$t(e.max_budget_per_task),accumulated_token_usage:tn(e.accumulated_token_usage)}:null}function rn(e){return Z(e)?e:null}function an(e){if(!Z(e))return null;let t=Z(e.llm)?{model:$(e.llm.model)}:null;return{kind:$(e.kind),acp_server:$(e.acp_server),acp_model:$(e.acp_model),llm:t}}function on(e){return Z(e)?{working_dir:$(e.working_dir)}:null}function sn(e){if(!Z(e))return null;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function cn(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):null}function ln(e){if(!Z(e))return null;let{agent_profile_id:t,revision:n}=e;return typeof t!=`string`||typeof n!=`number`?null:{agent_profile_id:t,revision:n}}function un(e){if(!e.startsWith(`/`))return null;let t=[];for(let n of e.split(`/`))if(n&&n!==`.`)if(n===`..`){if(!t.length)return null;t.pop()}else t.push(n);return`/${t.join(`/`)}`}function dn(e,t){let n=un(e),r=un(t);if(!n||!r||n!==r&&!n.startsWith(`${r}/`))throw Error(`Conversation file path must stay inside the workspace`);return n}function fn(e){if(!Z(e)||typeof e.id!=`string`||!e.id.trim())throw X();return{id:e.id.trim(),title:$(e.title),created_at:en(e,`created_at`,`createdAt`),updated_at:en(e,`updated_at`,`updatedAt`),execution_status:$(e.execution_status),sandbox_status:$(e.sandbox_status),metrics:nn(e.metrics),stats:rn(e.stats),agent:an(e.agent),workspace:on(e.workspace),tags:sn(e.tags),launched_agent_profile:ln(e.launched_agent_profile),sub_conversation_ids:cn(e.sub_conversation_ids),current_model_id:$(e.current_model_id),current_model_name:$(e.current_model_name)}}function pn(e){if(!Array.isArray(e))throw X();return e.map(fn)}function mn(e){if(Array.isArray(e))return{items:pn(e),next_page_id:null};if(!Z(e))throw X();return{items:pn(e.items),next_page_id:typeof e.next_page_id==`string`?e.next_page_id:null}}var hn=new Set([`idle`,`running`,`paused`,`waiting_for_confirmation`,`finished`,`error`,`stuck`]);function gn(e){let t=e??`idle`;return hn.has(t)?t:`idle`}function _n(e,t){if(!e)throw Error(`Conversation ${t} was not found`);return e}var vn=class{static async sendMessage(e,t,n){let r=s().backend,i=n?.conversationUrl??null,a=n?.sessionApiKey??null;if(r.kind===`cloud`){if(!i||!a){let[t]=await I([e]);i=t?.conversation_url?.trim()??null,a=t?.session_api_key?.trim()??null}if(!i||!a)throw Error(`Conversation sandbox is still starting. Wait for it to finish, then try again.`);return await g({backend:r,method:`POST`,hostOverride:o(i),path:`/api/conversations/${e}/events`,body:{...t,run:!0},authMode:`session-api-key`,sessionApiKey:a}),t}return await new h(l({conversationUrl:i,sessionApiKey:a})).sendEvent(e,t,{run:!0}),t}static async createConversation(e={}){let{initialUserMsg:t,conversationInstructions:n,plugins:i,metadata:a,workingDirOverride:o,workspaceMode:c,parentConversationId:d,agentType:re,sandboxId:f,agentProfileId:p,agentProfileKind:m}=e;if(s().backend.kind===`cloud`)return we({initial_message:t?{role:`user`,content:[{type:`text`,text:t}]}:null,title:n??null,selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,plugins:i??null,parent_conversation_id:d??null,agent_type:re,sandbox_id:f??null,agent_profile_id:p??null,trigger:`gui`});let[g,ie]=await Promise.all([y.getSettings(),oe.listProfiles().catch(()=>void 0)]),_=Yt(g.title_llm_profile,ie),ae=D(),v=s().backend.host,b=await k(o??ne(ae,v)),se=o?b:await k(te(v)),x=c??(o?`local_repo`:`new_worktree`),S=await qt({settings:g,query:t,conversationInstructions:n,plugins:i,conversationId:ae,parentConversationId:d,workingDir:b,hooksProjectDir:se,worktree:x===`new_worktree`,agentProfileId:p,agentProfileKind:m,titleLlmProfile:_}),C=await r(),w=await new h(l({timeout:Zt})).createConversation({...S,...C?{user_id:C}:{}}),T=ee();if(!T)throw new u;return(a?.selected_repository||o)&&N(w.id,{selected_repository:a?.selected_repository??null,selected_branch:a?.selected_branch??null,git_provider:a?.git_provider??null,selected_workspace:o??null,workspace_mode:x}),{id:w.id,created_by_user_id:null,status:`READY`,detail:null,app_conversation_id:w.id,agent_server_url:T.host,request:{initial_message:S.initial_message,plugins:i??null},created_at:w.created_at,updated_at:w.updated_at}}static async createLocalPlanningConversation(e,t){if(s().backend.kind===`cloud`)throw Error(`Local planning conversations require a local backend.`);let[n]=await this.batchGetAppConversations([e]),r=await Gt({workingDir:n?.workspace?.working_dir??d(),parentConversationId:e,parentActiveProfileName:n?.agent_kind===`openhands`?n?.active_profile??null:null,parentAgentProfileId:n?.launched_agent_profile?.agent_profile_id??null,initialMessage:t}),i=await new h(l()).createConversation(r);return be(e,{local_planning_conversation_id:i.id}),V(i)}static async getLocalPlanningConversationIds(e){if(s().backend.kind===`cloud`)return[];let t=new Set;try{let[n]=await this.batchGetAppConversations([e]),r=n?.sub_conversation_ids??[];if(r.length>0){let n=await this.batchGetAppConversations(r);for(let r of n)r&&et(r,e)&&t.add(r.id)}}catch(t){console.warn(`Failed to read sub-conversations of ${e}`,t)}let n=M(e)?.local_planning_conversation_id;return n&&t.add(n),[...t]}static async getStartTask(e){return s().backend.kind===`cloud`?Ne(e):null}static async getVSCodeUrl(e,t,n){let r=await this.resolveConversationWorkingDir(e);return{vscode_url:await new p(l({conversationUrl:t,sessionApiKey:n})).getUrl({baseUrl:typeof window<`u`?window.location.origin:void 0,workspaceDir:r})}}static async getVSCodeStatus(e,t){return new p(l({conversationUrl:e,sessionApiKey:t})).getStatus()}static async resolveConversationWorkingDir(e){let[t]=await this.batchGetAppConversations([e]);return t?.workspace?.working_dir??d()}static async batchGetAppConversations(e){return e.length===0?[]:s().backend.kind===`cloud`?I(e):pn(await new h(l()).getConversations(e)).map(e=>V(e))}static async updateConversationPublicFlag(e,t){if(s().backend.kind!==`cloud`)throw Error(`Public sharing requires a cloud backend.`);return De(e,t)}static async updateConversationRepository(e,t,n,r){t?N(e,{...M(e)??{},selected_repository:t,selected_branch:n??null,git_provider:r??null}):P(e);let[i]=await this.batchGetAppConversations([e]);return _n(i,e)}static async readConversationFile(e,t){if(s().backend.kind===`cloud`)return je(e,dn(t??`/workspace/project/.agents_tmp/PLAN.md`,`/workspace/project`));let n=await this.resolveConversationWorkingDir(e),r=dn(t??`${n}/.agents_tmp/PLAN.md`,n);return new f(l()).downloadTextFile(r)}static async downloadConversation(e){return s().backend.kind===`cloud`?Te(e):new f(l()).downloadTrajectory(e)}static async getHooks(e){return Jt()}static async getRuntimeConversation(e,t,n){let r=fn(await new h(l({conversationUrl:t,sessionApiKey:n})).getConversation(e));return{id:r.id,title:r.title?.trim()?r.title:dt(r.id),metrics:nn(r.metrics),created_at:r.created_at,updated_at:r.updated_at,status:gn(r.execution_status),stats:r.stats??{usage_to_metrics:{}}}}static async condenseConversation(e,t,n){let r=s().backend;if(r.kind===`cloud`&&t){await g({backend:r,method:`POST`,hostOverride:o(t),path:`/api/conversations/${e}/condense`,authMode:`session-api-key`,sessionApiKey:n});return}await new h(l({conversationUrl:t,sessionApiKey:n})).condenseConversation(e)}static async searchConversations(e=20,t){return s().backend.kind===`cloud`?Ce(e,t):ft(mn(await new h(l()).searchConversations({limit:e,page_id:t,sort_order:ie.UPDATED_AT_DESC})))}static async deleteConversation(e){if(s().backend.kind===`cloud`){await Ee(e),P(e);return}let t=await this.getLocalPlanningConversationIds(e),n=new h(l());await Promise.all(t.map(async e=>{try{await n.deleteConversation(e)}catch(t){console.warn(`Failed to delete planning conversation ${e}`,t)}P(e)})),await n.deleteConversation(e),P(e)}static async updateConversationTitle(e,t){if(s().backend.kind===`cloud`)return Oe(e,t);await new h(l()).updateConversation(e,{title:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async updateConversationTags(e,t){await new h(l()).updateConversation(e,{tags:t});let[n]=await this.batchGetAppConversations([e]);return _n(n,e)}static async forkConversation(e,t,n){if(s().backend.kind===`cloud`)throw Error(`Branching a conversation isn't supported on the cloud backend yet.`);let r=await new h(l()).forkConversation(e,{from_event_id:t,...n?{title:n}:{}}),i=M(e);return i&&N(r.id,i),r}static async getEventParentId(e,t){return(await new h(l()).getEvent(e,t)).parent_id??void 0}static async switchProfile(e,t){let{backend:n}=s();if(n.kind===`cloud`){if(!e){await oe.activateProfile(t);return}await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_profile`,body:{profile_name:t}});return}if(!e){await new m(l()).activateProfile(t);return}let r=l(),i=new h(r),a=await new m(r).getProfile(t,{exposeSecrets:`encrypted`}),o=typeof a.config.model==`string`?a.config.model:``;if(!o)throw Error(`Profile '${t}' has no model.`);await Y({llm:a.config}),await i.switchLLM(e,{...a.config,model:o,stream:!0,usage_id:`profile:${t}:${D()}`})}static async switchAcpModel(e,t){let{backend:n}=s();if(n.kind===`cloud`){await g({backend:n,method:`POST`,path:`/api/v1/app-conversations/${e}/switch_acp_model`,body:{model:t}});return}await new h(l()).switchAcpModel(e,t)}};export{k as A,Se as C,be as D,M as E,N as O,ke as S,Ae as T,Ie as _,xt as a,Ne as b,Ue as c,Be as d,R as f,Le as g,L as h,yt as i,D as j,ve as k,Ve as l,Re as m,U as n,tt as o,We as p,vt as r,$e as s,vn as t,He as u,I as v,je as w,Me as x,we as y};
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-D-gOfhmN.js";import{t as o}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BGGbPcYh.js";import{n as s}from"./navigation-context-CQZwH_tC.js";import{c}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as l}from"./close-ScPlnwyq.js";import{r as u}from"./typography-NarNyelM.js";var d=e(t(),1),f=n();function p({maintenanceStartTime:e,faultyModels:t,errorMessage:n,updatedAt:p}){let{t:m}=r(`openhands`),[h,g]=o(`alert_banner_dismissed_at`,null),{currentPath:_}=s(),v=e?(e=>new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,timeZoneName:`short`}))(e):null,y=!!e,b=t&&t.length>0,x=n&&n.trim().length>0,S=y||b||x,C=(0,d.useMemo)(()=>S?h!==p:!1,[h,p,S]),w=(0,d.useMemo)(()=>{if(!n)return null;let e=m(n);return e===n?n:e},[n,m]);return C?(0,f.jsxs)(`div`,{"data-testid":`alert-banner`,className:a(`bg-base border border-primary text-white p-4 rounded`,`flex flex-row items-center justify-between m-1`,_===`/`&&`mt-3 mr-3`),children:[(0,f.jsxs)(`div`,{className:`flex items-center`,children:[(0,f.jsx)(`div`,{className:`flex-shrink-0`,children:(0,f.jsx)(c,{className:`text-primary align-middle`})}),(0,f.jsx)(`div`,{className:`ml-3 flex flex-col gap-1`,children:(()=>{let e=[];return y&&v&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:m(i.MAINTENANCE$SCHEDULED_MESSAGE,{time:v})},`maintenance`)),b&&e.push((0,f.jsxs)(u.Paragraph,{className:`text-sm font-medium`,children:[m(i.ALERT$FAULTY_MODELS_MESSAGE),` `,t.join(`, `)]},`faulty-models`)),x&&w&&e.push((0,f.jsx)(u.Paragraph,{className:`text-sm font-medium`,children:w},`error-message`)),e})()})]}),(0,f.jsx)(`button`,{type:`button`,"data-testid":`dismiss-button`,onClick:()=>g(p),className:a(`bg-base rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`),children:(0,f.jsx)(l,{})})]}):null}export{p as AlertBanner};
1
+ 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-BsLfwrXB.js";import{K as o,t as s}from"./utils-D-gOfhmN.js";import{n as c,p as l}from"./agent-server-client-options-EHB23gyx.js";import{n as u,o as d}from"./backend-form-modal-DeaUJIik.js";import{f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-D6owle9R.js";import{r as p,t as m}from"./modal-body-DBweM2EN.js";import{t as h}from"./brand-button-mQq2Ld1I.js";var g=e(t(),1),_=n();function v(){let{t:e}=r(`openhands`),{active:t,addBackend:n,updateBackend:v}=a(),y=window.location.origin,[b,x]=g.useState(!1),[S,C]=g.useState(`idle`),[w,T]=g.useState(null),E=g.useCallback(async r=>{x(!0),C(`idle`),T(null);try{await new f(c({host:r.host,sessionApiKey:r.apiKey,timeout:5e3})).getSettings(),C(`success`),l(t.backend)?n(r):v(t.backend.id,r),window.location.reload()}catch(t){if(C(`error`),i(t,401))T(e(o.AUTH$INVALID_KEY));else{let n=t instanceof Error?t.message:String(t);T(`${e(o.AUTH$CONNECTION_FAILED)}${n?`: ${n}`:``}`)}x(!1)}},[t.backend,n,v,e]);return(0,_.jsx)(`div`,{"data-testid":`api-key-entry-screen`,className:`flex min-h-screen items-center justify-center bg-base px-6`,children:(0,_.jsxs)(`div`,{className:s(`relative rounded-xl border border-[var(--oh-border)] bg-base-secondary`,p(`md`),m),children:[(0,_.jsx)(`div`,{className:`px-6 pt-6 pb-2 pr-12`,children:(0,_.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(o.BACKEND$ADD_TITLE)})}),(0,_.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:(0,_.jsx)(u,{mode:`add`,backend:{...t.backend,host:y,apiKey:``,name:``},onSubmitted:()=>{},testIdRoot:`api-key-entry`,hostReadOnly:!0,requireApiKey:!0,onSubmitOverride:E,renderActions:({canSubmit:t,testIdRoot:n})=>(0,_.jsxs)(_.Fragment,{children:[S!==`idle`&&(0,_.jsxs)(`div`,{className:`flex items-center gap-3 text-sm`,children:[(0,_.jsx)(d,{isConnected:S===`success`}),(0,_.jsx)(`span`,{"data-testid":`${n}-status`,className:S===`error`?`text-red-400`:`text-green-400`,children:S===`error`?w:e(o.ONBOARDING$BACKEND_STATUS_CONNECTED)})]}),(0,_.jsx)(h,{type:`submit`,variant:`secondary`,isDisabled:!t||b,testId:`${n}-submit`,className:`w-full text-center`,children:e(b?o.ONBOARDING$BACKEND_STATUS_CHECKING:o.BACKEND$CONNECT)})]})})})]})})}export{v as default};
1
+ 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-BsLfwrXB.js";import{K as d}from"./utils-D-gOfhmN.js";import{r as f}from"./use-free-models-Ci3FkKEm.js";import{t as p}from"./settings-CKqk8ZnH.js";import{n as m}from"./use-settings-BWIH5EuN.js";import{t as h}from"./use-save-settings-CikTu5xV.js";import{t as g}from"./brand-button-mQq2Ld1I.js";import{i as _,n as v,r as y,t as b}from"./color-themes-DTj5Ylbr.js";import{t as x}from"./navigation-link-Bxo3-4vo.js";import{t as S}from"./settings-dropdown-input-BRR2OZwi.js";import{t as C}from"./settings-input-Cm4VxUon.js";import{t as w}from"./use-llm-profiles-xtCBMbef.js";import{n as T}from"./format-model-name-Dfh9Udrx.js";import{c as E,o as D,t as O}from"./sidebar-onboarding-checklist-storage-BP1kzn6p.js";import{n as k,t as A}from"./switch-skeleton-DwOoCqaL.js";import{t as j}from"./settings-switch-seaSJc7t.js";var M=e(t(),1),N=n();function P({defaultKey:e,onChange:t,name:n}){let{t:r}=i(`openhands`);return(0,N.jsx)(S,{testId:n,name:n,onInputChange:t,label:r(d.SETTINGS$LANGUAGE),items:c.map(e=>({key:e.value,label:e.label})),defaultSelectedKey:e,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function F(){let{t:e}=i(`openhands`),t=M.useCallback(e=>{if(!e)return;let t=e;v(t),y(t)},[]);return(0,N.jsx)(S,{testId:`color-theme-input`,name:`color-theme-input`,label:e(d.SETTINGS$COLOR_THEME),items:b.map(e=>({key:e.key,label:e.label})),defaultSelectedKey:_(),onSelectionChange:t,isClearable:!1,wrapperClassName:`w-full min-w-0`})}function I(){return(0,M.useSyncExternalStore)(D,O,()=>!1)}function ee(){let{t:e}=i(`openhands`),t=I();return(0,N.jsx)(j,{testId:`show-getting-started-checklist-switch`,isToggled:!t,onToggle:e=>{E(!e)},children:e(d.SETTINGS$SHOW_GETTING_STARTED_CHECKLIST)})}function L(){return(0,N.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,N.jsx)(k,{}),(0,N.jsx)(A,{}),(0,N.jsx)(A,{})]})}var R=`__automatic__`;function z(){let{t:e}=i(`openhands`),{mutate:t,isPending:n}=h(),{data:r,isLoading:_}=m(),v=l().backend.kind===`cloud`,{data:y,isLoading:b}=w(),E=f(),[D,O]=M.useState(!1),[k,A]=M.useState(!1),[I,z]=M.useState(!1),[B,V]=M.useState(!1),[H,U]=M.useState(!1),[W,G]=M.useState(void 0),K=M.useMemo(()=>{let e=r?.title_llm_profile??null;return!e||!y||y.profiles.some(t=>t.name===e)?e:null},[y,r?.title_llm_profile]),q=W===void 0?K:W,J=M.useMemo(()=>[{key:R,label:e(d.SETTINGS$TITLE_GENERATION_AUTOMATIC)},...y?.profiles.map(t=>({key:t.name,label:t.model?e(d.SETTINGS$TITLE_GENERATION_PROFILE_OPTION,{name:t.name,model:T(t.model,E)??t.model}):t.name}))??[]],[y?.profiles,E,e]),Y=n=>{let r=n.get(`language-input`)?.toString(),i=c.find(({label:e})=>e===r)?.value||p.language,l=v?!0:n.get(`enable-analytics-switch`)?.toString()===`on`,f=n.get(`enable-sound-notifications-switch`)?.toString()===`on`,m=n.get(`git-user-name-input`)?.toString()||p.git_user_name,h=n.get(`git-user-email-input`)?.toString()||p.git_user_email;t({language:i,...!v&&{user_consents_to_analytics:l},enable_sound_notifications:f,git_user_name:m,git_user_email:h,title_llm_profile:q},{onSuccess:()=>{a(l?`granted`:`denied`),o(e(d.SETTINGS$SAVED))},onError:t=>{u(s(t)||e(d.ERROR$GENERIC))},onSettled:()=>{O(!1),A(!1),z(!1),V(!1),U(!1),G(void 0)}})},X=e=>{let t=c.find(({label:t})=>t===e)?.label,n=c.find(({value:e})=>e===r?.language)?.label;O(t!==n)},Z=e=>{A(e!==(r?.user_consents_to_analytics??!0))},Q=e=>{z(e!==!!r?.enable_sound_notifications)},te=e=>{let t=r?.git_user_name;V(e!==t)},ne=e=>{let t=r?.git_user_email;U(e!==t)},re=!D&&!k&&!I&&q===K&&!B&&!H,$=!r||_||b||n;return(0,N.jsxs)(`form`,{"data-testid":`app-settings-screen`,action:Y,className:`flex flex-col gap-6`,children:[$&&(0,N.jsx)(L,{}),!$&&(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(P,{name:`language-input`,defaultKey:r.language,onChange:X}),(0,N.jsx)(F,{}),(0,N.jsx)(j,{testId:`enable-analytics-switch`,name:v?void 0:`enable-analytics-switch`,defaultIsToggled:v?!0:r.user_consents_to_analytics??!0,isToggled:v?!0:void 0,isDisabled:v,onToggle:v?void 0:Z,children:e(d.ANALYTICS$SEND_ANONYMOUS_DATA)}),(0,N.jsx)(j,{testId:`enable-sound-notifications-switch`,name:`enable-sound-notifications-switch`,defaultIsToggled:!!r.enable_sound_notifications,onToggle:Q,children:e(d.SETTINGS$SOUND_NOTIFICATIONS)}),(0,N.jsx)(ee,{}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$CONVERSATION_TITLES)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$TITLE_GENERATION_DESCRIPTION)}),(0,N.jsx)(S,{testId:`title-llm-profile-input`,name:`title-llm-profile-input`,label:e(d.SETTINGS$TITLE_GENERATION_MODEL),items:J,selectedKey:q??R,onSelectionChange:e=>{let t=e?.toString();G(!t||t===R?null:t)}}),(0,N.jsx)(x,{to:`/settings/llm`,className:`mt-3 inline-block text-sm text-primary hover:underline`,children:e(d.SETTINGS$MANAGE_LLM_PROFILES)})]}),(0,N.jsxs)(`div`,{className:`border-t border-[var(--oh-border)] pt-6 mt-2`,children:[(0,N.jsx)(`h3`,{className:`text-lg font-medium mb-2`,children:e(d.SETTINGS$GIT_SETTINGS)}),(0,N.jsx)(`p`,{className:`mb-4 text-sm leading-5 text-tertiary-light`,children:e(d.SETTINGS$GIT_SETTINGS_DESCRIPTION)}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,N.jsx)(C,{testId:`git-user-name-input`,name:`git-user-name-input`,type:`text`,label:e(d.SETTINGS$GIT_USERNAME),defaultValue:r.git_user_name||``,onChange:te,placeholder:e(d.SETTINGS$GIT_USERNAME_PLACEHOLDER),className:`w-full min-w-0`}),(0,N.jsx)(C,{testId:`git-user-email-input`,name:`git-user-email-input`,type:`email`,label:e(d.SETTINGS$GIT_EMAIL),defaultValue:r.git_user_email||``,onChange:ne,placeholder:e(d.SETTINGS$GIT_EMAIL_PLACEHOLDER),className:`w-full min-w-0`})]}),(0,N.jsx)(`div`,{className:`flex justify-start pt-4`,children:(0,N.jsxs)(g,{testId:`submit-button`,variant:`primary`,type:`submit`,isDisabled:n||re,children:[!n&&e(d.SETTINGS$SAVE_CHANGES),n&&e(d.SETTINGS$SAVING)]})})]})]})]})}var B=r(z);export{B as default};
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};