@openhands/agent-canvas 1.18.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (420) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/acp-providers-DOKcGeaV.js +1 -0
  4. package/build/assets/active-backend-context-BETEdaJl.js +2 -0
  5. package/build/assets/{agent-context-settings-D3peZkjX.js → agent-context-settings-Dir0loAn.js} +1 -1
  6. package/build/assets/{agent-profiles-service.api-DkeZaqIl.js → agent-profiles-service.api-CiMVQAIT.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-7yMWYjGF.js → agent-profiles-settings-CT5owzRT.js} +1 -1
  8. package/build/assets/agent-server-conversation-service.api-BtOlitCD.js +88 -0
  9. package/build/assets/agent-settings-BnzyTgCb.js +2 -0
  10. package/build/assets/agent-settings-CeXj3xK-.js +1 -0
  11. package/build/assets/{alert-banner-eYyqvHL3.js → alert-banner-Ccx1Du6n.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-CCBvBD8u.js → api-key-entry-screen-DXIuzBjY.js} +1 -1
  13. package/build/assets/{app-settings-BtYDs-Be.js → app-settings-DkIJVTKL.js} +1 -1
  14. package/build/assets/automation-detail-CF2SweVs.js +3 -0
  15. package/build/assets/automation-disabled-reason-QFtMrdOr.js +1 -0
  16. package/build/assets/{automation-export-BJsfi7n2.js → automation-export-CkvehhPF.js} +1 -1
  17. package/build/assets/{automation-git-sync-B7o_Nbl-.js → automation-git-sync-di4tBAyZ.js} +1 -1
  18. package/build/assets/automation-setup-route-FERj7WEe.js +3 -0
  19. package/build/assets/{automation-templates-Bb98r-kx.js → automation-templates-DlaCRvD-.js} +1 -1
  20. package/build/assets/automations-list-yK7ETmYP.js +1 -0
  21. package/build/assets/{back-nav-button-B2yBiVMB.js → back-nav-button-oDvIxpQ5.js} +1 -1
  22. package/build/assets/backend-form-modal-DzYf_arO.js +1 -0
  23. package/build/assets/{backend-synced-settings-badge-DLEp6cq7.js → backend-synced-settings-badge-DXDDHWX4.js} +1 -1
  24. package/build/assets/{badge-ehL-kgeO.js → badge-CDHZEVeN.js} +1 -1
  25. package/build/assets/{base-modal-C1a0TsSx.js → base-modal-CZq4kB_H.js} +1 -1
  26. package/build/assets/{brand-button-CUMfjb99.js → brand-button-CGUwj6zK.js} +1 -1
  27. package/build/assets/{browser-SE24Tk8g.js → browser-kY6jN61T.js} +2 -2
  28. package/build/assets/{browser-tab-HjJxHA0V.js → browser-tab-DFyZXsnB.js} +1 -1
  29. package/build/assets/{canvas-extension-page-BsUGBb1T.js → canvas-extension-page-DsGq1DtT.js} +1 -1
  30. package/build/assets/{canvas-extensions-C9Tm6s_E.js → canvas-extensions-Cb2Z0Hdc.js} +1 -1
  31. package/build/assets/{canvas-extensions-runtime-B8kxM4rO.js → canvas-extensions-runtime-DS6eT4nK.js} +1 -1
  32. package/build/assets/{chat-send-button-CGvc2wpE.js → chat-send-button-B6aVaD9V.js} +1 -1
  33. package/build/assets/{circle-plus-check-toggle-BDX_ctNs.js → circle-plus-check-toggle-ZOXpJ3I2.js} +1 -1
  34. package/build/assets/{cloud-funnel-analytics-D5uJ_4JE.js → cloud-funnel-analytics-BH_zxjiO.js} +1 -1
  35. package/build/assets/{cog-CAEugqtV.js → cog-DVZT1f0s.js} +1 -1
  36. package/build/assets/{command-menu-CQxs4mtX.js → command-menu-ImeHQ6c2.js} +1 -1
  37. package/build/assets/{commits-tab-D0xgjipP.js → commits-tab-B5SUF66c.js} +1 -1
  38. package/build/assets/{condenser-settings-D63NJRBT.js → condenser-settings-BlGOXEXM.js} +1 -1
  39. package/build/assets/{confirmation-modal-78sd9Vny.js → confirmation-modal-oN1EId79.js} +1 -1
  40. package/build/assets/{context-menu-list-item-Cm7-7Y-7.js → context-menu-list-item-DIm5xQg6.js} +1 -1
  41. package/build/assets/{conversation-B_nweu5p.js → conversation-9a53tdbO.js} +4 -4
  42. package/build/assets/conversation-XRsI28ZM.js +1 -0
  43. package/build/assets/conversation-panel-XRsI28ZM.js +1 -0
  44. package/build/assets/{conversation-state-store-9D_3P7q4.js → conversation-state-store-Br-eE-gg.js} +1 -1
  45. package/build/assets/{conversation-tab-empty-state-B3dpJXX0.js → conversation-tab-empty-state-BT1GrnKP.js} +1 -1
  46. package/build/assets/{copy-to-clipboard-button-B1ljgNxO.js → copy-to-clipboard-button-CvTHqY13.js} +1 -1
  47. package/build/assets/{device-verify-D5QRIS_x.js → device-verify-DX0xdNjo.js} +1 -1
  48. package/build/assets/{dropdown-classes-BGvOvW2_.js → dropdown-classes-DyyMaaXl.js} +1 -1
  49. package/build/assets/edit-automation-modal-bfD-5NIc.js +1 -0
  50. package/build/assets/empty-state-B5advKVW.js +1 -0
  51. package/build/assets/{entry.client-BMafTpjO.js → entry.client-D_2gnSyB.js} +2 -2
  52. package/build/assets/{enum-filter-dropdown-UNaom12H.js → enum-filter-dropdown-VAJp5mqh.js} +1 -1
  53. package/build/assets/{environment-switch-overlay-COibRUA-.js → environment-switch-overlay-C7x_yhEs.js} +1 -1
  54. package/build/assets/{error-state-Cf8LRuuY.js → error-state-BgYl7YeB.js} +1 -1
  55. package/build/assets/{extensions-hub-C_6ahIua.js → extensions-hub-DjhOed1I.js} +1 -1
  56. package/build/assets/{extensions-navigation-C5GfpzFe.js → extensions-navigation-Di-J2KUR.js} +1 -1
  57. package/build/assets/{files-tab-D5PPIWI1.js → files-tab-BNDp3e_x.js} +1 -1
  58. package/build/assets/{form-control-classes-Dbq-7YP_.js → form-control-classes-BVI_szaj.js} +1 -1
  59. package/build/assets/{get-git-path-jU2zjqIB.js → get-git-path-DOe6PM_a.js} +1 -1
  60. package/build/assets/git-repo-dropdown-1fZGYtYm.js +1 -0
  61. package/build/assets/{git-repo-dropdown-uxlFw2gn.js → git-repo-dropdown-DNlinQ7r.js} +1 -1
  62. package/build/assets/{highlighted-source-view-C7pAXrT0.js → highlighted-source-view-DPerL6tF.js} +1 -1
  63. package/build/assets/home-4lyLzYjG.js +1 -0
  64. package/build/assets/home-BGaB0EeK.js +1 -0
  65. package/build/assets/home-automation-run-tooltip-v5n7zXR0.js +1 -0
  66. package/build/assets/{home-store-DCbei3DX.js → home-store-roz1x6D5.js} +1 -1
  67. package/build/assets/{hooks-service-Dnmhqc0Z.js → hooks-service-tzRqtAlm.js} +1 -1
  68. package/build/assets/index-home-6Y_Y7kOo.js +1 -0
  69. package/build/assets/{install-server-modal-B81I-5OE.js → install-server-modal-DkMCfj0J.js} +1 -1
  70. package/build/assets/{key-O84CMFHb.js → key-DpfBWQbk.js} +1 -1
  71. package/build/assets/{launch-ZLxI4opd.js → launch-TrnYlJe6.js} +1 -1
  72. package/build/assets/link-external-B4gx3EeM.js +1 -0
  73. package/build/assets/llm-not-configured-banner-BdjItKQR.js +27 -0
  74. package/build/assets/{llm-settings-CODhjQzy.js → llm-settings-CUgt39uu.js} +1 -1
  75. package/build/assets/llm-settings-DEfw-fUJ.js +1 -0
  76. package/build/assets/{llm-subscription-service-CgIDc38n.js → llm-subscription-service-LGYVzyAc.js} +1 -1
  77. package/build/assets/{loading-spinner-BeLV0IXf.js → loading-spinner-BJc2J0Dw.js} +1 -1
  78. package/build/assets/{manage-backends-modal-cMXqCb-B.js → manage-backends-modal-CIjk0B2H.js} +1 -1
  79. package/build/assets/manifest-23d79467.js +1 -0
  80. package/build/assets/{manifest-subpage-layout-CVZgVKoY.js → manifest-subpage-layout-DGYRoP_8.js} +1 -1
  81. package/build/assets/{markdown-renderer-DyFl9-mL.js → markdown-renderer-DRpwRlNm.js} +1 -1
  82. package/build/assets/mcp-CoUOIGBF.js +1 -0
  83. package/build/assets/mcp-installed-servers-BW51n6PC.js +1 -0
  84. package/build/assets/mcp-marketplace-utils-BwEnDYqm.js +1 -0
  85. package/build/assets/mcp-page-hZ4aJjj_.js +9 -0
  86. package/build/assets/{messages-Bk1xhbU2.js → messages-WUb9Yh-p.js} +4 -4
  87. package/build/assets/{modal-body-C24WsdFb.js → modal-body-B_95ci1c.js} +1 -1
  88. package/build/assets/{modal-classes-B0b9eiL8.js → modal-classes-BPcBCWVj.js} +1 -1
  89. package/build/assets/{modal-close-button-DfqfB2Nj.js → modal-close-button-Cq3dma5u.js} +1 -1
  90. package/build/assets/onboarding-Cc4Av7bi.js +1 -0
  91. package/build/assets/{onboarding-modal-BT3Gx_sZ.js → onboarding-modal-DCFD4Dsa.js} +1 -1
  92. package/build/assets/{organization-service.api-B5CvmnYQ.js → organization-service.api-zhHpQU0t.js} +1 -1
  93. package/build/assets/parse-git-remote-url-BG8pcKL8.js +1 -0
  94. package/build/assets/{planner-tab-CstoOlAB.js → planner-tab-yISBVUKu.js} +1 -1
  95. package/build/assets/{plugins-management-service-5rqVPEGN.js → plugins-management-service-2oP6_tWr.js} +1 -1
  96. package/build/assets/{profiles-service.api-D1XKMgr0.js → profiles-service.api-B5thiTI3.js} +1 -1
  97. package/build/assets/{providers-XmZ9HM4Q.js → providers-Co9PsD0s.js} +1 -1
  98. package/build/assets/{proxy-XP6U1Dhv.js → proxy-BCCQUna8.js} +1 -1
  99. package/build/assets/recommended-automations-launcher-D1Do753p.js +1 -0
  100. package/build/assets/root-D1y82Lhg.js +2 -0
  101. package/build/assets/{root-layout-DUquNZTU.js → root-layout-cQTYEG2w.js} +2 -2
  102. package/build/assets/root-sEWn3ha1.css +1 -0
  103. package/build/assets/{schema-field-Y3F8JvXd.js → schema-field-DSi0d7a8.js} +1 -1
  104. package/build/assets/{sdk-section-page-CNZTLwH9.js → sdk-section-page-DCoI2dtd.js} +1 -1
  105. package/build/assets/{secret-form-9-BoGA40.js → secret-form-BDvzojzN.js} +1 -1
  106. package/build/assets/{secrets-service-BOIsfD9j.js → secrets-service-C3CNNEpY.js} +1 -1
  107. package/build/assets/{secrets-settings-CBJgFr42.js → secrets-settings-BKqfYQt5.js} +1 -1
  108. package/build/assets/{settings-D4hdToD4.js → settings-C8ZLONyx.js} +1 -1
  109. package/build/assets/{settings-dropdown-input-DBvsZ7-Q.js → settings-dropdown-input-Df_HXRk4.js} +1 -1
  110. package/build/assets/{settings-index-DeQphyBK.js → settings-index-BWvlGHg3.js} +1 -1
  111. package/build/assets/{settings-input-dVuzapBA.js → settings-input-B3i5U9GL.js} +1 -1
  112. package/build/assets/{settings-list-classes-DhAPuXm6.js → settings-list-classes-DbqcSiVW.js} +1 -1
  113. package/build/assets/{settings-modal-tHiJ8iYV.js → settings-modal-DHKJSBPL.js} +1 -1
  114. package/build/assets/{settings-nav-GAQjW1a-.js → settings-nav-BThjwLWD.js} +1 -1
  115. package/build/assets/{settings-service.api-C1vZH9Vh.js → settings-service.api-CYBTLGOd.js} +1 -1
  116. package/build/assets/{settings-switch-DDd1cQ8t.js → settings-switch-CI93Iozg.js} +1 -1
  117. package/build/assets/{shared-conversation-Cyg7m7ns.js → shared-conversation-C7OILS-U.js} +1 -1
  118. package/build/assets/{sidebar-layout-DH0E-5KW.js → sidebar-layout-Csb6Geq0.js} +1 -1
  119. package/build/assets/{sidebar-mobile-menu-toggle-CQ4iky__.js → sidebar-mobile-menu-toggle-B2xwXm4s.js} +1 -1
  120. package/build/assets/{sidebar-nav-link-oLQiKUBu.js → sidebar-nav-link-Xv7QEMVS.js} +1 -1
  121. package/build/assets/{sidebar-onboarding-checklist-storage-TfvNNnnr.js → sidebar-onboarding-checklist-storage-_zxMqHS0.js} +1 -1
  122. package/build/assets/{skill-card-pill-row-DfjIfj0K.js → skill-card-pill-row-CxOFySng.js} +1 -1
  123. package/build/assets/{skill-enablement-DXeaImBz.js → skill-enablement-BBKya60C.js} +1 -1
  124. package/build/assets/{skill-filter-DsNLmn76.js → skill-filter-BvtbD--b.js} +1 -1
  125. package/build/assets/{skill-icon-badge-0MK_68Nc.js → skill-icon-badge-CVxE42yg.js} +1 -1
  126. package/build/assets/{skill-scope-BE-H9TSZ.js → skill-scope-C0NxJnpT.js} +1 -1
  127. package/build/assets/{skills-plugins-vzSdxSk_.js → skills-plugins-BGjX4jve.js} +1 -1
  128. package/build/assets/{skills-settings-BiPOH9H9.js → skills-settings-d3ZwIjSP.js} +1 -1
  129. package/build/assets/{styled-tooltip-CejG0rqv.js → styled-tooltip-CknPQH4Y.js} +1 -1
  130. package/build/assets/{task-list-tab-OkZSqnTp.js → task-list-tab-CQisRcPh.js} +1 -1
  131. package/build/assets/{terminal-Dph60VFZ.js → terminal-Bs50gJPC.js} +1 -1
  132. package/build/assets/{toggle-switch-B2uXaAUS.js → toggle-switch-D3TBxlsc.js} +1 -1
  133. package/build/assets/trash-D1QMHInX.js +1 -0
  134. package/build/assets/{typography-DgcLGdHk.js → typography-BdAApXGl.js} +1 -1
  135. package/build/assets/{usage-tab-MCmNRAnR.js → usage-tab-ClVHAFJy.js} +1 -1
  136. package/build/assets/{use-acp-credential-form-ychoGqjC.js → use-acp-credential-form-GfqcTJl5.js} +1 -1
  137. package/build/assets/{use-activate-agent-profile-8L8Xdghy.js → use-activate-agent-profile-DO6SNPkK.js} +1 -1
  138. package/build/assets/{use-agent-profiles-Bi8hSkze.js → use-agent-profiles-YsBlt3tT.js} +1 -1
  139. package/build/assets/{use-automation-health-U99vvHxx.js → use-automation-health-CbQ9n-k7.js} +1 -1
  140. package/build/assets/{use-automation-permissions-Buus0R6h.js → use-automation-permissions-gFy-2VD0.js} +1 -1
  141. package/build/assets/{use-automations-Bq5hVuv0.js → use-automations-7_XBXHQK.js} +1 -1
  142. package/build/assets/{use-can-manage-org-profiles-MzIeEV8F.js → use-can-manage-org-profiles-Dt4YkPO7.js} +1 -1
  143. package/build/assets/{use-canvas-extensions-Ca9KoVEm.js → use-canvas-extensions-BhYQrtMK.js} +1 -1
  144. package/build/assets/{use-cloud-current-user-id-B4ZLUZSa.js → use-cloud-current-user-id-Dqw6qQUg.js} +1 -1
  145. package/build/assets/{use-config-l5tkDHyD.js → use-config-BJ_FJCjV.js} +1 -1
  146. package/build/assets/use-create-conversation-D15Px574.js +1 -0
  147. package/build/assets/use-create-secret-D_qPU88t.js +1 -0
  148. package/build/assets/{use-free-models-gCsJ5BV0.js → use-free-models-FAk2nngq.js} +1 -1
  149. package/build/assets/{use-get-secrets-CMTuWEp_.js → use-get-secrets-Pbo9jh2A.js} +1 -1
  150. package/build/assets/{use-llm-configured-Dl4zg8ht.js → use-llm-configured-DF9BYmIe.js} +1 -1
  151. package/build/assets/{use-llm-profiles-SWsuFmFu.js → use-llm-profiles-U4u1gzuk.js} +1 -1
  152. package/build/assets/use-manifest-capabilities-D81_YdAF.js +1 -0
  153. package/build/assets/{use-onboarding-completion-Xl63ZvzQ.js → use-onboarding-completion-C4W-m2Jk.js} +1 -1
  154. package/build/assets/{use-pinned-home-route-BXDIUaxQ.js → use-pinned-home-route-DByWTojw.js} +1 -1
  155. package/build/assets/{use-plugins-marketplace-BIIaPiaB.js → use-plugins-marketplace-CTRoukH0.js} +1 -1
  156. package/build/assets/{use-save-agent-profile-D-ZHHE94.js → use-save-agent-profile-xpHBxMZM.js} +1 -1
  157. package/build/assets/{use-save-settings-Dapkf4cC.js → use-save-settings-CmX41wlf.js} +1 -1
  158. package/build/assets/{use-settings-C2KKQKVC.js → use-settings-D69cw06D.js} +1 -1
  159. package/build/assets/{use-settings-nav-items-TOc0Rsfd.js → use-settings-nav-items-CVz0SnDr.js} +1 -1
  160. package/build/assets/use-tracking-BAFpgpgq.js +3 -0
  161. package/build/assets/{use-user-conversation-5UFqMoO4.js → use-user-conversation-BBDXUbOc.js} +1 -1
  162. package/build/assets/utils-CbjwNcR-.js +1 -0
  163. package/build/assets/{vendor~browser-hbU4u2Ag.js → vendor~browser-BZ-zIfb6.js} +1 -1
  164. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js +2 -0
  165. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js → vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js} +1 -1
  166. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js +48 -0
  167. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js} +3579 -165
  168. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BqdU447s.js} +794 -227
  169. package/build/assets/{verification-settings-DdBpaVPz.js → verification-settings-BXspn27q.js} +1 -1
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +18 -1
  172. package/build/locales/ca/openhands.json +18 -1
  173. package/build/locales/de/openhands.json +18 -1
  174. package/build/locales/en/openhands.json +18 -1
  175. package/build/locales/es/openhands.json +18 -1
  176. package/build/locales/fr/openhands.json +18 -1
  177. package/build/locales/it/openhands.json +18 -1
  178. package/build/locales/ja/openhands.json +18 -1
  179. package/build/locales/ko-KR/openhands.json +18 -1
  180. package/build/locales/no/openhands.json +18 -1
  181. package/build/locales/pt/openhands.json +18 -1
  182. package/build/locales/tr/openhands.json +18 -1
  183. package/build/locales/uk/openhands.json +18 -1
  184. package/build/locales/zh-CN/openhands.json +18 -1
  185. package/build/locales/zh-TW/openhands.json +18 -1
  186. package/config/defaults.json +3 -3
  187. package/dist/api/agent-profiles-service/profile-field-support.d.ts +2 -0
  188. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs +3 -3
  189. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.cjs.map +1 -1
  190. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js +12 -16
  191. package/dist/components/conversation-events/chat/event-content-helpers/get-skill-ready-content.js.map +1 -1
  192. package/dist/components/features/automations/agent-profile-selector.d.ts +7 -0
  193. package/dist/components/features/automations/detail/disabled-reason-banner.d.ts +16 -0
  194. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  195. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  196. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +38 -29
  197. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  198. package/dist/components/features/settings/agent-profiles/profile-scope-list.d.ts +20 -0
  199. package/dist/config/defaults.cjs +1 -1
  200. package/dist/config/defaults.cjs.map +1 -1
  201. package/dist/config/defaults.js +3 -3
  202. package/dist/config/defaults.js.map +1 -1
  203. package/dist/constants/acp-providers.cjs +1 -1
  204. package/dist/constants/acp-providers.cjs.map +1 -1
  205. package/dist/constants/acp-providers.d.ts +0 -5
  206. package/dist/constants/acp-providers.js +20 -16
  207. package/dist/constants/acp-providers.js.map +1 -1
  208. package/dist/constants/profile-scope.d.ts +21 -0
  209. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  210. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  211. package/dist/hooks/mutation/use-create-conversation.js +30 -19
  212. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  213. package/dist/hooks/mutation/use-switch-acp-model.cjs +1 -1
  214. package/dist/hooks/mutation/use-switch-acp-model.cjs.map +1 -1
  215. package/dist/hooks/mutation/use-switch-acp-model.js +11 -12
  216. package/dist/hooks/mutation/use-switch-acp-model.js.map +1 -1
  217. package/dist/hooks/query/query-keys.cjs +1 -1
  218. package/dist/hooks/query/query-keys.cjs.map +1 -1
  219. package/dist/hooks/query/query-keys.d.ts +1 -0
  220. package/dist/hooks/query/query-keys.js +10 -1
  221. package/dist/hooks/query/query-keys.js.map +1 -1
  222. package/dist/hooks/query/use-active-acp-profile-detail.cjs +1 -1
  223. package/dist/hooks/query/use-active-acp-profile-detail.cjs.map +1 -1
  224. package/dist/hooks/query/use-active-acp-profile-detail.d.ts +0 -9
  225. package/dist/hooks/query/use-active-acp-profile-detail.js +4 -13
  226. package/dist/hooks/query/use-active-acp-profile-detail.js.map +1 -1
  227. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  228. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  229. package/dist/hooks/query/use-automation-sdk-version.js +3 -1
  230. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  231. package/dist/hooks/use-drag-resize.cjs +1 -1
  232. package/dist/hooks/use-drag-resize.cjs.map +1 -1
  233. package/dist/hooks/use-drag-resize.js +8 -9
  234. package/dist/hooks/use-drag-resize.js.map +1 -1
  235. package/dist/i18n/declaration.cjs +1 -1
  236. package/dist/i18n/declaration.cjs.map +1 -1
  237. package/dist/i18n/declaration.d.ts +18 -1
  238. package/dist/i18n/declaration.js +1 -1
  239. package/dist/i18n/declaration.js.map +1 -1
  240. package/dist/i18n/translation.cjs +3 -3
  241. package/dist/i18n/translation.cjs.map +1 -1
  242. package/dist/i18n/translation.js +289 -0
  243. package/dist/i18n/translation.js.map +1 -1
  244. package/dist/locales/ar/openhands.json +18 -1
  245. package/dist/locales/ca/openhands.json +18 -1
  246. package/dist/locales/de/openhands.json +18 -1
  247. package/dist/locales/en/openhands.json +18 -1
  248. package/dist/locales/es/openhands.json +18 -1
  249. package/dist/locales/fr/openhands.json +18 -1
  250. package/dist/locales/it/openhands.json +18 -1
  251. package/dist/locales/ja/openhands.json +18 -1
  252. package/dist/locales/ko-KR/openhands.json +18 -1
  253. package/dist/locales/no/openhands.json +18 -1
  254. package/dist/locales/pt/openhands.json +18 -1
  255. package/dist/locales/tr/openhands.json +18 -1
  256. package/dist/locales/uk/openhands.json +18 -1
  257. package/dist/locales/zh-CN/openhands.json +18 -1
  258. package/dist/locales/zh-TW/openhands.json +18 -1
  259. package/dist/manifests/automation-setup.cjs.map +1 -1
  260. package/dist/manifests/automation-setup.js.map +1 -1
  261. package/dist/manifests/manifest-local-validation.cjs.map +1 -1
  262. package/dist/manifests/manifest-local-validation.js.map +1 -1
  263. package/dist/manifests/manifest-validation.cjs +1 -1
  264. package/dist/manifests/manifest-validation.cjs.map +1 -1
  265. package/dist/manifests/manifest-validation.js +2 -2
  266. package/dist/manifests/manifest-validation.js.map +1 -1
  267. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +3670 -247
  268. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  269. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +26 -3
  270. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  271. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  272. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  273. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +4 -1
  274. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  275. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs +2 -0
  276. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.cjs.map +1 -0
  277. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js +79 -0
  278. package/dist/node_modules/@openhands/extensions/automations/catalog/github-delivery-watchdog/manifest.js.map +1 -0
  279. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -11
  280. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  281. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +25 -11
  282. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  283. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs +2 -0
  284. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.cjs.map +1 -0
  285. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js +72 -0
  286. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-triage/manifest.js.map +1 -0
  287. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -10
  288. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  289. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +24 -11
  290. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  291. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs +12 -0
  292. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.cjs.map +1 -0
  293. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js +115 -0
  294. package/dist/node_modules/@openhands/extensions/automations/catalog/gitlab-issue-to-mr/manifest.js.map +1 -0
  295. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  296. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  297. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +20 -14
  298. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  299. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs +2 -0
  300. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.cjs.map +1 -0
  301. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js +73 -0
  302. package/dist/node_modules/@openhands/extensions/integrations/catalog/reportportal.js.map +1 -0
  303. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  304. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  305. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +9 -7
  306. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  307. package/dist/node_modules/@openhands/extensions/skills/index.cjs +794 -227
  308. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  309. package/dist/node_modules/@openhands/extensions/skills/index.js +46 -6
  310. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  311. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs +1 -1
  312. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.cjs.map +1 -1
  313. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js +15 -8
  314. package/dist/node_modules/@openhands/typescript-client/dist/client/agent-server-compatibility.js.map +1 -1
  315. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs +1 -1
  316. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.cjs.map +1 -1
  317. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js +11 -13
  318. package/dist/node_modules/@openhands/typescript-client/dist/client/bash-client.js.map +1 -1
  319. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs +1 -1
  320. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.cjs.map +1 -1
  321. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js +6 -0
  322. package/dist/node_modules/@openhands/typescript-client/dist/client/conversation-client.js.map +1 -1
  323. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs +1 -1
  324. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.cjs.map +1 -1
  325. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js +9 -12
  326. package/dist/node_modules/@openhands/typescript-client/dist/client/file-client.js.map +1 -1
  327. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs +1 -1
  328. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.cjs.map +1 -1
  329. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js +9 -10
  330. package/dist/node_modules/@openhands/typescript-client/dist/client/openhands-client.js.map +1 -1
  331. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs +2 -0
  332. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.cjs.map +1 -0
  333. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js +41 -0
  334. package/dist/node_modules/@openhands/typescript-client/dist/client/runtime-transport.js.map +1 -0
  335. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs +1 -1
  336. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.cjs.map +1 -1
  337. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js +2 -2
  338. package/dist/node_modules/@openhands/typescript-client/dist/client/settings-client.js.map +1 -1
  339. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs +1 -1
  340. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.cjs.map +1 -1
  341. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js +3 -6
  342. package/dist/node_modules/@openhands/typescript-client/dist/client/vscode-client.js.map +1 -1
  343. package/dist/node_modules/@openhands/typescript-client/dist/clients.cjs +1 -1
  344. package/dist/node_modules/@openhands/typescript-client/dist/clients.js +1 -2
  345. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.cjs +1 -1
  346. package/dist/node_modules/@openhands/typescript-client/dist/conversation/conversation-manager.js +0 -1
  347. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs +1 -1
  348. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.cjs.map +1 -1
  349. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js +199 -61
  350. package/dist/node_modules/@openhands/typescript-client/dist/models/acp-providers.js.map +1 -1
  351. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs +1 -1
  352. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.cjs.map +1 -1
  353. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js +9 -8
  354. package/dist/node_modules/@openhands/typescript-client/dist/workspace/remote-workspace.js.map +1 -1
  355. package/dist/package.cjs +1 -1
  356. package/dist/package.cjs.map +1 -1
  357. package/dist/package.js +3 -3
  358. package/dist/package.js.map +1 -1
  359. package/dist/routes/agent-settings.d.ts +11 -0
  360. package/dist/types/automation.cjs.map +1 -1
  361. package/dist/types/automation.d.ts +26 -2
  362. package/dist/types/automation.js.map +1 -1
  363. package/dist/utils/automation-disabled-reason.cjs +2 -0
  364. package/dist/utils/automation-disabled-reason.cjs.map +1 -0
  365. package/dist/utils/automation-disabled-reason.d.ts +32 -0
  366. package/dist/utils/automation-disabled-reason.js +19 -0
  367. package/dist/utils/automation-disabled-reason.js.map +1 -0
  368. package/dist/utils/parse-git-remote-url.cjs +1 -1
  369. package/dist/utils/parse-git-remote-url.cjs.map +1 -1
  370. package/dist/utils/parse-git-remote-url.d.ts +5 -1
  371. package/dist/utils/parse-git-remote-url.js +20 -13
  372. package/dist/utils/parse-git-remote-url.js.map +1 -1
  373. package/package.json +3 -3
  374. package/scripts/check-sdk-version-sync.mjs +79 -8
  375. package/scripts/dev-safe.mjs +14 -1
  376. package/scripts/docker-build.mjs +3 -0
  377. package/scripts/static-server.mjs +24 -7
  378. package/build/assets/acp-providers-DcY_mKYa.js +0 -1
  379. package/build/assets/active-backend-context-BnH4-L8h.js +0 -2
  380. package/build/assets/agent-server-conversation-service.api-jiCopc2E.js +0 -88
  381. package/build/assets/agent-settings-BF8hM6wb.js +0 -2
  382. package/build/assets/agent-settings-YPutBAeR.js +0 -1
  383. package/build/assets/automation-detail-BxXhb_m2.js +0 -3
  384. package/build/assets/automation-setup-route-qaJ6lLCf.js +0 -3
  385. package/build/assets/automations-list-DEPVNud3.js +0 -1
  386. package/build/assets/backend-form-modal-DxisQV_6.js +0 -1
  387. package/build/assets/conversation-edjzrv5w.js +0 -1
  388. package/build/assets/conversation-panel-edjzrv5w.js +0 -1
  389. package/build/assets/edit-automation-modal-D_JWSmxT.js +0 -1
  390. package/build/assets/empty-state-FK_s1B60.js +0 -1
  391. package/build/assets/git-repo-dropdown-BoDDWXfX.js +0 -1
  392. package/build/assets/home-BM5_Wz_R.js +0 -1
  393. package/build/assets/home-Ivfm7KC4.js +0 -1
  394. package/build/assets/home-automation-run-tooltip-B1N2uO9p.js +0 -1
  395. package/build/assets/index-home-td9BN2T3.js +0 -1
  396. package/build/assets/kebab-menu-item-content-SCJBwZnp.js +0 -1
  397. package/build/assets/link-external-BNZzCM1I.js +0 -1
  398. package/build/assets/llm-not-configured-banner-Dh_ajcM8.js +0 -27
  399. package/build/assets/llm-settings-CZaXYgtw.js +0 -1
  400. package/build/assets/manifest-bfeccb98.js +0 -1
  401. package/build/assets/mcp-CraxoXQv.js +0 -1
  402. package/build/assets/mcp-marketplace-utils-C7PYr293.js +0 -1
  403. package/build/assets/mcp-page-CteH_K0N.js +0 -9
  404. package/build/assets/onboarding-DXFBRqEy.js +0 -1
  405. package/build/assets/parse-git-remote-url-DpDM9bK6.js +0 -1
  406. package/build/assets/recommended-automations-launcher-DEHRKIAg.js +0 -1
  407. package/build/assets/root-CM6IZHlg.css +0 -1
  408. package/build/assets/root-DdFkodKW.js +0 -2
  409. package/build/assets/trash-Ckh7yCaB.js +0 -1
  410. package/build/assets/use-create-conversation-i_PdFdIs.js +0 -1
  411. package/build/assets/use-create-secret-CjWq0J4O.js +0 -1
  412. package/build/assets/use-manifest-capabilities-CdqYfUAC.js +0 -1
  413. package/build/assets/use-tracking-j4uo9VEW.js +0 -3
  414. package/build/assets/utils-BgLSZdyy.js +0 -1
  415. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +0 -2
  416. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js +0 -48
  417. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs +0 -2
  418. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.cjs.map +0 -1
  419. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js +0 -21
  420. package/dist/node_modules/@openhands/typescript-client/dist/client/desktop-client.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Ck5D_A2Q.js";import{f as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{i as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as c}from"./useMutation-Cszf8mKy.js";import{t as l}from"./useQuery-DAAacS7O.js";import{t as u}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as d}from"./useTranslation-CCgUjPJF.js";import{gt as f,n as p,st as m}from"./active-backend-context-BnH4-L8h.js";import{K as h,O as g,k as _,t as v,z as y}from"./utils-BgLSZdyy.js";import{a as b,c as x,f as ee,g as te,n as ne}from"./agent-server-client-options-EHB23gyx.js";import{t as S}from"./chevron-down-Cr6Fn_wS.js";import{t as C}from"./chevron-right-CfdfRn-8.js";import{t as re}from"./loader-circle-BxJgk73D.js";import{v as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as w}from"./proxy-XP6U1Dhv.js";import{r as T}from"./use-free-models-gCsJ5BV0.js";import{t as E}from"./react-BX7IV650.js";import{i as ae}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{t as oe}from"./use-config-l5tkDHyD.js";import{n as se}from"./use-settings-C2KKQKVC.js";import{t as ce}from"./modal-backdrop-BSzNhM4r.js";import{n as D,o as le}from"./form-control-classes-Dbq-7YP_.js";import{n as ue}from"./navigation-context-CQZwH_tC.js";import{ot as de,st as fe}from"./vendor-markdown-j0kYzV48.js";import{t as O}from"./styled-tooltip-CejG0rqv.js";import{t as pe}from"./conversation-store-DC-JlJuq.js";import{t as me}from"./modal-close-button-DfqfB2Nj.js";import{d as he,m as ge,t as _e,x as ve}from"./agent-server-conversation-service.api-jiCopc2E.js";import{_ as ye,a as be,h as xe,o as Se,p as Ce,r as we,s as Te}from"./conversation-state-store-9D_3P7q4.js";import{n as Ee}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{t as De}from"./skills-B0IliMxw.js";import{n as Oe}from"./format-model-name-Dfh9Udrx.js";import{t as ke}from"./close-ScPlnwyq.js";import{t as Ae}from"./copy-to-clipboard-button-B1ljgNxO.js";import{r as k}from"./typography-DgcLGdHk.js";import{t as je}from"./u-check-circle-BKn1spCL.js";import{$ as Me,A as Ne,D as Pe,F as Fe,G as Ie,H as Le,K as Re,L as ze,M as Be,N as Ve,P as A,S as He,T as Ue,V as We,W as j,Y as Ge,a as Ke,b as M,c as qe,et as Je,i as Ye,j as Xe,n as Ze,o as Qe,r as $e,rt as N,t as P,tt as et,v as tt,y as nt,z as rt}from"./markdown-renderer-DyFl9-mL.js";import{t as it}from"./syntax-highlighter-BGDg_7w9.js";import{n as at,t as ot}from"./get-git-path-jU2zjqIB.js";var st=s(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),F=e(r(),1);function ct(){!t.current&&i();let[e]=(0,F.useState)(n.current);return e}var I=a(),lt=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(lt||{});function ut(){let{conversationId:e}=N(),t=qe();return{send:(0,F.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function dt(e,t,n,r){return{action:lt.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var L=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,I.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),R=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,I.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function ft({status:e}){return(0,I.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,I.jsx)(Ee,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function pt(e,t){if(!e)return null;let n=/(?:Z|[+-]\d{2}:?\d{2})$/i.test(e)?e:`${e}Z`,r=new Date(n);return Number.isNaN(r.getTime())?null:r.toLocaleString(t,{dateStyle:`medium`,timeStyle:`short`})}function z({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o,timestamp:s}){let{t:c,i18n:l}=d(`openhands`),[u,f]=F.useState(r),[p,m]=F.useState(!1),[g,_]=F.useState(!1),y=pt(s,l?.language),b=t?(0,I.jsx)(`button`,{type:`button`,onClick:e=>{f(e=>!e),e.detail>0&&(m(!1),e.currentTarget.blur())},className:`cursor-pointer text-left`,"aria-label":c(u?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:u?(0,I.jsx)(R,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,I.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null,x=(0,I.jsxs)(`div`,{"data-testid":`generic-event-message-title`,className:`flex items-center`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocusCapture:()=>_(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||_(!1)},children:[i===`before`&&b,o,(0,I.jsx)(`span`,{children:e}),i===`after`&&b]});return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[y?(0,I.jsx)(O,{content:(0,I.jsx)(`time`,{dateTime:s,children:y}),placement:`top`,isOpen:p||g,children:x}):x,(0,I.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,I.jsx)(ft,{status:n})]})]}),u&&(typeof t==`string`?(0,I.jsx)(P,{children:t}):t)]})}var mt=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,I.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),ht=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,I.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),gt={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function _t({status:e}){let{t}=d(`openhands`),{conversationId:n}=N(),r=He(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,F.useState)(!1),{active:o,objective:s,iteration:c,max_iterations:l,verdict:u}=e,f=u?Math.round(u.score*100):null,p=u?.missing?t(h.GOAL$MISSING,{missing:u.missing}):``,g=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},_=()=>g(async e=>{await ye(e),await Ce(e)},h.GOAL$STOP_FAILED),y=()=>g(xe,h.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,I.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:_,className:v(D,le),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,I.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:y,className:v(D,le),children:t(h.GOAL$RESUME)})),(0,I.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,I.jsx)(z,{title:(0,I.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,I.jsx)(`span`,{children:s}),(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:c,max:l})}),(0,I.jsx)(`span`,{children:t(gt[e.status])}),f!==null&&(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:f})}),o?(0,I.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,I.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,I.jsx)(mt,{className:`w-3.5 h-3.5 fill-success`})}):(0,I.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,I.jsx)(ht,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var vt=e=>(0,I.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,I.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,I.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,I.jsx)(`defs`,{children:(0,I.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,I.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function yt({profile:e}){let[t,n]=F.useState(!1),r=T(),i=Oe(e.model,r);return(0,I.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,I.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,I.jsx)(S,{size:14}):(0,I.jsx)(C,{size:14})}),(0,I.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`hr`,{className:`border-neutral-700`}),(0,I.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${i??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function bt({conversationId:e,anchorEventId:t}){let n=nt(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,I.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,I.jsx)(z,{title:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(vt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,I.jsx)(u,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,I.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,I.jsx)(z,{title:(0,I.jsx)(`span`,{children:t?(0,I.jsx)(u,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,I.jsx)(u,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,I.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,I.jsx)(u,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,I.jsx)(yt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function xt(e){let[t,n]=(0,F.useState)(!0),[r,i]=(0,F.useState)(!0),a=(0,F.useRef)(0),o=(0,F.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,F.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,F.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var St=(0,F.createContext)(void 0);function Ct({children:e,value:t}){let n=xt(F.useRef(null)),r=t||n;return(0,I.jsx)(St.Provider,{value:r,children:e})}function wt(){let e=(0,F.useContext)(St);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Tt(){return(0,F.useContext)(St)}var Et=class{static async executeCommand(e,t,n,r,i=30){let a=x().backend;if(a.kind===`cloud`&&e){let o=await w({backend:a,method:`POST`,hostOverride:b(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new ae(ne({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=x().backend;return r.kind===`cloud`&&e?(await w({backend:r,method:`GET`,hostOverride:b(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new ie(ne({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}},Dt=2e3,Ot=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function kt(){return`find . \\( ${Ot.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Dt}`}function At(e){return e.startsWith(`./`)?e.slice(2):e}function jt(e){let{data:t}=et(),n=at(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),s=l({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await Et.executeCommand(i,a,kt(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(At);return Array.from(new Set(t)).slice(0,Dt)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:s.data,isLoading:s.isLoading}}function Mt(e){let{conversationId:t}=N(),{data:n}=et(),r=at(),i=n?.selected_repository,a=n?.workspace?.working_dir?.trim(),o=ot(i,a),s=o.startsWith(`/`)?o:`/${o}`,c=l({queryKey:[`workspace-files-cloud`,t,s],queryFn:async()=>{let e=(await ve(t,s)).map(At).filter(Boolean);return Array.from(new Set(e)).slice(0,Dt)},enabled:e&&r&&!!t,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function Nt(){let e=(0,F.useSyncExternalStore)(te,ee,ee).active.backend.kind===`cloud`,t=jt(!e),n=Mt(e);return e?n:t}var Pt=(0,F.createContext)(!1),Ft=(0,F.createContext)(void 0);function It({children:e}){let{data:t}=Nt();return(0,I.jsx)(Ft.Provider,{value:t,children:e})}function Lt(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e)){let t=e.map(Lt);return t.some(e=>e===null)?null:t.join(``)}return null}function Rt(e){let t=(0,F.useContext)(Ft);if(!t?.length||!we(e))return null;let n=Te.getCurrentConversation()?.workspace?.working_dir,r=be(e,n);return r&&t.includes(r)?r:null}function zt({path:e,className:t,children:n}){let{conversationId:r}=N();return(0,I.jsx)(`button`,{type:`button`,"data-testid":`markdown-file-path-link`,title:e,className:v(t,`cursor-pointer rounded border border-surface-raised bg-surface-raised px-[0.4em] py-[0.2em] font-mono text-foreground hover:underline`),onClick:t=>{t.stopPropagation(),M(e,r)},children:n})}function Bt(e){let{children:t,className:n}=e,r=(0,F.useContext)(Pt),i=/language-(\w+)/.exec(n||``),a=String(t).replace(/\n$/,``),o=String(t).includes(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Ck5D_A2Q.js";import{f as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{i as s}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as c}from"./useMutation-Cszf8mKy.js";import{t as l}from"./useQuery-DAAacS7O.js";import{t as u}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BCe0JJVy.js";import{t as d}from"./useTranslation-CCgUjPJF.js";import{gt as f,n as p,st as m}from"./active-backend-context-BETEdaJl.js";import{K as h,O as g,k as _,t as v,z as y}from"./utils-CbjwNcR-.js";import{a as b,c as x,f as ee,g as te,n as ne}from"./agent-server-client-options-EHB23gyx.js";import{t as S}from"./chevron-down-Cr6Fn_wS.js";import{t as C}from"./chevron-right-CfdfRn-8.js";import{t as re}from"./loader-circle-BxJgk73D.js";import{_ as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as w}from"./proxy-BCCQUna8.js";import{r as T}from"./use-free-models-FAk2nngq.js";import{t as E}from"./react-BX7IV650.js";import{i as ae}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";import{t as oe}from"./use-config-BJ_FJCjV.js";import{n as se}from"./use-settings-D69cw06D.js";import{t as ce}from"./modal-backdrop-BSzNhM4r.js";import{n as D,o as le}from"./form-control-classes-BVI_szaj.js";import{n as ue}from"./navigation-context-CQZwH_tC.js";import{ot as de,st as fe}from"./vendor-markdown-j0kYzV48.js";import{t as O}from"./styled-tooltip-CknPQH4Y.js";import{t as pe}from"./conversation-store-DC-JlJuq.js";import{t as me}from"./modal-close-button-Cq3dma5u.js";import{d as he,m as ge,t as _e,x as ve}from"./agent-server-conversation-service.api-BtOlitCD.js";import{_ as ye,a as be,h as xe,o as Se,p as Ce,r as we,s as Te}from"./conversation-state-store-Br-eE-gg.js";import{n as Ee}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{t as De}from"./skills-B0IliMxw.js";import{n as Oe}from"./format-model-name-Dfh9Udrx.js";import{t as ke}from"./close-ScPlnwyq.js";import{t as Ae}from"./copy-to-clipboard-button-CvTHqY13.js";import{r as k}from"./typography-BdAApXGl.js";import{t as je}from"./u-check-circle-BKn1spCL.js";import{$ as Me,A as Ne,D as Pe,F as Fe,G as Ie,H as Le,K as Re,L as ze,M as Be,N as Ve,P as A,S as He,T as Ue,V as We,W as j,Y as Ge,a as Ke,b as M,c as qe,et as Je,i as Ye,j as Xe,n as Ze,o as Qe,r as $e,rt as N,t as P,tt as et,v as tt,y as nt,z as rt}from"./markdown-renderer-DRpwRlNm.js";import{t as it}from"./syntax-highlighter-BGDg_7w9.js";import{n as at,t as ot}from"./get-git-path-DOe6PM_a.js";var st=s(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),F=e(r(),1);function ct(){!t.current&&i();let[e]=(0,F.useState)(n.current);return e}var I=a(),lt=function(e){return e.INIT=`initialize`,e.MESSAGE=`message`,e.SYSTEM=`system`,e.READ=`read`,e.WRITE=`write`,e.RUN=`run`,e.RUN_IPYTHON=`run_ipython`,e.BROWSE=`browse`,e.BROWSE_INTERACTIVE=`browse_interactive`,e.DELEGATE=`delegate`,e.THINK=`think`,e.FINISH=`finish`,e.REJECT=`reject`,e.CHANGE_AGENT_STATE=`change_agent_state`,e.MCP=`call_tool_mcp`,e.TASK_TRACKING=`task_tracking`,e}(lt||{});function ut(){let{conversationId:e}=N(),t=qe();return{send:(0,F.useCallback)(async e=>{if(t){let{action:n,args:r}=e;if(n===`message`&&r?.content){let e=[{type:`text`,text:r.content}];return r.image_urls&&r.image_urls.length>0&&e.push({type:`image`,image_urls:r.image_urls}),await t.sendMessage({role:`user`,content:e})}return{queued:!1}}return{queued:!1}},[t,e])}}function dt(e,t,n,r){return{action:lt.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var L=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,I.jsx)(`path`,{d:`M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z`})}),R=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,I.jsx)(`path`,{d:`M201.4 137.4c12.5-12.5 32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 205.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160z`})});function ft({status:e}){return(0,I.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,I.jsx)(Ee,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function pt(e,t){if(!e)return null;let n=/(?:Z|[+-]\d{2}:?\d{2})$/i.test(e)?e:`${e}Z`,r=new Date(n);return Number.isNaN(r.getTime())?null:r.toLocaleString(t,{dateStyle:`medium`,timeStyle:`short`})}function z({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o,timestamp:s}){let{t:c,i18n:l}=d(`openhands`),[u,f]=F.useState(r),[p,m]=F.useState(!1),[g,_]=F.useState(!1),y=pt(s,l?.language),b=t?(0,I.jsx)(`button`,{type:`button`,onClick:e=>{f(e=>!e),e.detail>0&&(m(!1),e.currentTarget.blur())},className:`cursor-pointer text-left`,"aria-label":c(u?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:u?(0,I.jsx)(R,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,I.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null,x=(0,I.jsxs)(`div`,{"data-testid":`generic-event-message-title`,className:`flex items-center`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocusCapture:()=>_(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||_(!1)},children:[i===`before`&&b,o,(0,I.jsx)(`span`,{children:e}),i===`after`&&b]});return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[y?(0,I.jsx)(O,{content:(0,I.jsx)(`time`,{dateTime:s,children:y}),placement:`top`,isOpen:p||g,children:x}):x,(0,I.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,I.jsx)(ft,{status:n})]})]}),u&&(typeof t==`string`?(0,I.jsx)(P,{children:t}):t)]})}var mt=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,I.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z`})}),ht=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,I.jsx)(`path`,{d:`M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z`})}),gt={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function _t({status:e}){let{t}=d(`openhands`),{conversationId:n}=N(),r=He(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,F.useState)(!1),{active:o,objective:s,iteration:c,max_iterations:l,verdict:u}=e,f=u?Math.round(u.score*100):null,p=u?.missing?t(h.GOAL$MISSING,{missing:u.missing}):``,g=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},_=()=>g(async e=>{await ye(e),await Ce(e)},h.GOAL$STOP_FAILED),y=()=>g(xe,h.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,I.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:_,className:v(D,le),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,I.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:y,className:v(D,le),children:t(h.GOAL$RESUME)})),(0,I.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,I.jsx)(z,{title:(0,I.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,I.jsx)(`span`,{children:s}),(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:c,max:l})}),(0,I.jsx)(`span`,{children:t(gt[e.status])}),f!==null&&(0,I.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:f})}),o?(0,I.jsx)(`span`,{"data-testid":`goal-spinner`,className:`inline-block w-3.5 h-3.5 ml-1 rounded-full border-2 border-transparent border-t-[var(--oh-border-input)] animate-spin`}):e.status===`complete`?(0,I.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,I.jsx)(mt,{className:`w-3.5 h-3.5 fill-success`})}):(0,I.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,I.jsx)(ht,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var vt=e=>(0,I.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,I.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,I.jsx)(`path`,{d:`M6 11C8.76142 11 11 8.76142 11 6C11 3.23858 8.76142 1 6 1C3.23858 1 1 3.23858 1 6C1 8.76142 3.23858 11 6 11Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,I.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,I.jsx)(`defs`,{children:(0,I.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,I.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function yt({profile:e}){let[t,n]=F.useState(!1),r=T(),i=Oe(e.model,r);return(0,I.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,"aria-label":`Toggle details for ${e.name}`,className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-neutral-700 transition-colors cursor-pointer`,children:[(0,I.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,I.jsx)(S,{size:14}):(0,I.jsx)(C,{size:14})}),(0,I.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`hr`,{className:`border-neutral-700`}),(0,I.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${i??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function bt({conversationId:e,anchorEventId:t}){let n=nt(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,I.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,I.jsx)(z,{title:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(vt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,I.jsx)(u,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,I.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,I.jsx)(z,{title:(0,I.jsx)(`span`,{children:t?(0,I.jsx)(u,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,I.jsx)(u,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,I.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,I.jsx)(u,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,I.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,I.jsx)(yt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function xt(e){let[t,n]=(0,F.useState)(!0),[r,i]=(0,F.useState)(!0),a=(0,F.useRef)(0),o=(0,F.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,F.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,F.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var St=(0,F.createContext)(void 0);function Ct({children:e,value:t}){let n=xt(F.useRef(null)),r=t||n;return(0,I.jsx)(St.Provider,{value:r,children:e})}function wt(){let e=(0,F.useContext)(St);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Tt(){return(0,F.useContext)(St)}var Et=class{static async executeCommand(e,t,n,r,i=30){let a=x().backend;if(a.kind===`cloud`&&e){let o=await w({backend:a,method:`POST`,hostOverride:b(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new ae(ne({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=x().backend;return r.kind===`cloud`&&e?(await w({backend:r,method:`GET`,hostOverride:b(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new ie(ne({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}},Dt=2e3,Ot=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function kt(){return`find . \\( ${Ot.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Dt}`}function At(e){return e.startsWith(`./`)?e.slice(2):e}function jt(e){let{data:t}=et(),n=at(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),s=l({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await Et.executeCommand(i,a,kt(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(At);return Array.from(new Set(t)).slice(0,Dt)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:s.data,isLoading:s.isLoading}}function Mt(e){let{conversationId:t}=N(),{data:n}=et(),r=at(),i=n?.selected_repository,a=n?.workspace?.working_dir?.trim(),o=ot(i,a),s=o.startsWith(`/`)?o:`/${o}`,c=l({queryKey:[`workspace-files-cloud`,t,s],queryFn:async()=>{let e=(await ve(t,s)).map(At).filter(Boolean);return Array.from(new Set(e)).slice(0,Dt)},enabled:e&&r&&!!t,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function Nt(){let e=(0,F.useSyncExternalStore)(te,ee,ee).active.backend.kind===`cloud`,t=jt(!e),n=Mt(e);return e?n:t}var Pt=(0,F.createContext)(!1),Ft=(0,F.createContext)(void 0);function It({children:e}){let{data:t}=Nt();return(0,I.jsx)(Ft.Provider,{value:t,children:e})}function Lt(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e)){let t=e.map(Lt);return t.some(e=>e===null)?null:t.join(``)}return null}function Rt(e){let t=(0,F.useContext)(Ft);if(!t?.length||!we(e))return null;let n=Te.getCurrentConversation()?.workspace?.working_dir,r=be(e,n);return r&&t.includes(r)?r:null}function zt({path:e,className:t,children:n}){let{conversationId:r}=N();return(0,I.jsx)(`button`,{type:`button`,"data-testid":`markdown-file-path-link`,title:e,className:v(t,`cursor-pointer rounded border border-surface-raised bg-surface-raised px-[0.4em] py-[0.2em] font-mono text-foreground hover:underline`),onClick:t=>{t.stopPropagation(),M(e,r)},children:n})}function Bt(e){let{children:t,className:n}=e,r=(0,F.useContext)(Pt),i=/language-(\w+)/.exec(n||``),a=String(t).replace(/\n$/,``),o=String(t).includes(`
2
2
  `),s=Rt(!i&&!o&&!r?a:``);return s?(0,I.jsx)(zt,{path:s,className:n,children:t}):$e(e)}function Vt(e){let{children:t}=e,n=(0,F.useContext)(Pt),r=Lt(t)?.trim()??``,i=Rt(n?``:r);return i?(0,I.jsx)(zt,{path:i,children:t}):(0,I.jsx)(`strong`,{children:t})}function Ht(e){return(0,I.jsx)(Pt.Provider,{value:!0,children:Ze(e)})}var B=1e3,Ut=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,Wt=e=>{switch(e.tool_kind){case`execute`:return`ACTION_MESSAGE$ACP_RUN`;case`edit`:return`ACTION_MESSAGE$ACP_EDIT`;case`read`:return`ACTION_MESSAGE$ACP_READ`;case`fetch`:return`ACTION_MESSAGE$ACP_FETCH`;default:return`ACTION_MESSAGE$ACP_TOOL`}},Gt={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},Kt=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=Gt[n];if(!r)return t;for(let e of r)if(t.length>e.length&&t.startsWith(e)&&/\s/.test(t.charAt(e.length)))return t.slice(e.length).trimStart();return t},qt=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Jt=e=>e.length>1e3?`${e.slice(0,B)}...`:e,Yt=e=>{let t=e.tool_kind,n=e.raw_input,r=e.raw_output,i=e.is_error,a=``;if(t===`execute`&&n&&typeof n==`object`&&`command`in n&&typeof n.command==`string`){let{command:e}=n;a+=`Command: \`${e}\`\n\n`}else if(n!=null&&n!==``){let e=qt(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Jt(qt(r).trim()),s=i?`**Error:**`:`Output:`,c=o||f.t(h.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a},V=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,Xt=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Zt=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||Xt(t)?null:t},Qt=e=>{let t=Zt(e);if(t)return{kind:`text`,text:t};let n=e.action.kind;switch(n){case`ExecuteBashAction`:case`TerminalAction`:return{kind:`translation`,key:`ACTION_MESSAGE$RUN`,values:{command:V(e.action.command,80)}};case`FileEditorAction`:case`StrReplaceEditorAction`:return{kind:`translation`,key:e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,values:{path:e.action.path}};case`MCPToolAction`:return{kind:`translation`,key:`ACTION_MESSAGE$CALL_TOOL_MCP`,values:{mcp_tool_name:e.tool_name}};case`InvokeSkillAction`:return{kind:`translation`,key:`ACTION_MESSAGE$INVOKE_SKILL`,values:{name:e.action.name}};case`TaskAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK`,values:{name:e.action.subagent_type}};case`ThinkAction`:return{kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}};case`FinishAction`:return{kind:`translation`,key:`ACTION_MESSAGE$FINISH`,values:{}};case`TaskTrackerAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK_TRACKING`,values:{}};case`GrepAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GREP`,values:{pattern:e.action.pattern?V(e.action.pattern,50):``}};case`GlobAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GLOB`,values:{pattern:e.action.pattern?V(e.action.pattern,50):``}};case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return{kind:`translation`,key:`ACTION_MESSAGE$BROWSE`,values:{}};case`CanvasUIAction`:case ge:return{kind:`text`,text:`CANVASUI`};case he:return{kind:`translation`,key:`ACTION_MESSAGE$LAUNCH_CHILD_CONVERSATION`,values:{}};default:return{kind:`text`,text:String(n).replace(`Action`,``).toUpperCase()}}},$t=class{static isDevMode=!1;static message(e){this.isDevMode&&console.warn(JSON.stringify(JSON.parse(e.data.toString()),null,2))}static event(e,t){this.isDevMode&&console.warn(t||`EVENT`,e)}static warning(e){this.isDevMode&&console.warn(e)}static error(e){this.isDevMode&&console.error(e)}},en=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function tn(e){let{children:t}=e,n=e=>{try{return en(e)}catch(t){return $t.error(String(t)),e}};return Array.isArray(t)?(0,I.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,I.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,I.jsx)(`strong`,{className:`font-mono`,children:t})}var nn=(0,F.createContext)(!0),rn=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},an=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,on=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return an(e)&&!n.endsWith(`/`)?`${n}/`:n};function sn(e){let{children:t}=e,{conversationId:n}=N(),r=(0,F.useContext)(nn),i=e=>{try{let t=rn(e),i=on(t);return r?(0,I.jsx)(`button`,{type:`button`,"data-testid":`path-component-link`,className:`cursor-pointer font-mono font-normal tracking-tight hover:underline`,title:t,onClick:e=>{e.stopPropagation(),M(t,n)},children:i}):(0,I.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,title:t,children:i})}catch(t){return $t.error(String(t)),(0,I.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:e})}};return Array.isArray(t)?(0,I.jsx)(`span`,{className:`font-normal tracking-tight`,children:t.map((e,t)=>typeof e==`string`?(0,I.jsx)(`span`,{children:i(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,I.jsx)(`span`,{className:`font-normal tracking-tight`,children:i(t)}):(0,I.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:t})}var cn=()=>{let{setConversationMode:e}=pe(),{send:t}=ut(),{conversationId:n}=N(),r=Ue(e=>e.enqueuePendingMessage),i=Ue(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,F.useCallback)(a=>{a?.preventDefault(),a?.stopPropagation(),e(`code`);let o=`Execute the plan based on the .agents_tmp/PLAN.md file.`,s=new Date().toISOString(),c=n?r({conversationId:n,text:o,timestamp:s}):null;t(dt(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},ln=`200%`,H=8,un=H*2;function dn({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=ct(),c=`oh-text-shimmer-${(0,F.useId)().replace(/:/g,``)}`,l=(0,F.useMemo)(()=>Math.min(H/2-1,1+i/2),[i]),u=(0,F.useMemo)(()=>{let e=H/2;return{...a,backgroundImage:`repeating-linear-gradient(90deg, var(--oh-muted) 0%, var(--oh-muted) ${e-l}%, var(--oh-foreground) ${e}%, var(--oh-muted) ${e+l}%, var(--oh-muted) ${H}%)`,backgroundSize:`${ln} 100%`,backgroundRepeat:`no-repeat`,WebkitBackgroundClip:`text`,backgroundClip:`text`,color:`transparent`,WebkitTextFillColor:`transparent`,animation:`${c} ${r}s linear infinite`}},[c,l,r,a]);return s?(0,I.jsx)(t,{className:v(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${un}% center}to{background-position:0% center}}`}}),(0,I.jsx)(t,{className:v(`relative inline-block`,n),style:u,...o,children:e})]})}var fn=F.memo(dn);function pn({className:e}){return(0,I.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,I.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,className:`fill-[var(--oh-foreground)] transition-colors duration-150 group-hover:fill-[var(--oh-text-secondary)]`}),(0,I.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var mn=5,hn=360,gn={p:({children:e})=>(0,I.jsx)(`p`,{className:`m-0 leading-6`,children:e}),code:Bt,a:Ht,strong:Vt};function _n({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=d(`openhands`),a=F.useRef(null),[o,s]=F.useState(!1);F.useEffect(()=>{r(o)},[o,r]),F.useLayoutEffect(()=>{let t=a.current;if(!t||n){s(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=mn*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;s(t.scrollHeight>r+1||i>=mn||e.trim().length>hn)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let c=o&&!n;return(0,I.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,I.jsx)(`div`,{ref:a,className:v(`text-sm leading-6 whitespace-normal [word-break:break-word]`,c&&`line-clamp-5`),children:(0,I.jsx)(P,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:gn,children:e})}),c?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{"aria-hidden":!0,"data-testid":`chat-message-truncation-gradient`,className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t from-tertiary to-transparent`}),(0,I.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:v(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(h.COMMON$VIEW_MORE)})]}):null]})}function U({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onDismiss:s,onStop:c,timestamp:l}){let{t:u,i18n:f}=d(`openhands`),[p,m]=F.useState(!1),[g,_]=F.useState(!1),[y,b]=F.useState(!1),[x,ee]=F.useState(!1),[te,ne]=F.useState(!0),S=F.useRef(null),C=pt(l,f?.language);F.useEffect(()=>{b(!1)},[t]);let re=async()=>{await navigator.clipboard.writeText(t),_(!0)};F.useEffect(()=>{let e;return g&&(e=setTimeout(()=>{_(!1)},2e3)),()=>{clearTimeout(e)}},[g]);let ie=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&c!=null,T=w&&p,E=e===`user`&&a==null,ae=E&&x&&!y,oe=F.Children.count(n)>0;F.useLayoutEffect(()=>{if(!w||E)return;let e=S.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;ne(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let se=E?(0,I.jsx)(_n,{message:t,isHovering:p,isExpanded:y,onTruncatableChange:ee}):(0,I.jsx)(`div`,{ref:S,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,I.jsx)(P,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:gn,children:t})}),ce=(0,I.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:v(`rounded-xl relative w-fit max-w-full flex flex-col`,oe&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!ie&&`last:mb-4`),children:[(0,I.jsxs)(`div`,{className:v(`absolute -top-2.5 -right-2.5 z-10`,!p||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,I.jsx)(O,{content:e.tooltip,placement:`top`,children:(0,I.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,I.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,I.jsx)(Ae,{isHidden:!p,isDisabled:g,onClick:re,mode:g?`copied`:`copy`})]}),se,w?(0,I.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c?.()},"data-testid":`chat-message-stop`,"aria-label":u(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:v(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,I.jsx)(pn,{className:`block h-7 w-7 max-w-none`})}):null,ae?(0,I.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>b(!0)}):null,n]}),D=C?(0,I.jsx)(O,{content:(0,I.jsx)(`time`,{dateTime:l,children:C}),placement:`top`,isOpen:p,children:ce}):ce;return e===`user`&&a===`error`?(0,I.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,I.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,I.jsx)(`span`,{children:u(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,I.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:u(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null,s?(0,I.jsx)(`button`,{type:`button`,onClick:s,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-dismiss`,children:u(h.CHAT_INTERFACE$MESSAGE_DISMISS)}):null]})]}):e===`user`&&a===`sending`?(0,I.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,I.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,I.jsx)(fn,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:u(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function vn(e){return{h1:({children:t,className:n})=>(0,I.jsx)(`h1`,{className:v(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,I.jsx)(`h2`,{className:v(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,I.jsx)(`h3`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,I.jsx)(`h4`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,I.jsx)(`h5`,{className:v(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,I.jsx)(`h6`,{className:v(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,I.jsx)(`p`,{className:v(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,I.jsx)(`ul`,{className:v(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,I.jsx)(`ol`,{className:v(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,I.jsx)(`li`,{className:v(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,I.jsx)(`a`,{className:v(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,I.jsx)(`code`,{className:v(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var yn=vn(),bn=300,xn=vn(`shine-text`);function Sn({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=d(`openhands`),{navigateToTab:i}=Ke(),{handleBuildPlanClick:a}=cn(),{scrollDomToBottom:o}=wt(),s=()=>{i(`planner`)},c=(0,F.useCallback)(e=>{a(e),o()},[a,o]),l=(0,F.useMemo)(()=>e?e.length<=bn?e:`${e.slice(0,bn)}...`:``,[e]);return e?(0,I.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,I.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,I.jsx)(Qe,{width:18,height:18,color:`var(--oh-muted)`}),(0,I.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,I.jsx)(`div`,{className:`flex-1`}),(0,I.jsxs)(`button`,{type:`button`,onClick:s,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,I.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,I.jsx)(st,{className:`text-white`,size:18})]})]}),(0,I.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:l&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(P,{includeStandard:!0,components:t?xn:yn,children:l}),e&&e.length>bn&&(0,I.jsx)(`button`,{type:`button`,onClick:s,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(h.COMMON$READ_MORE)})]})}),(0,I.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,I.jsx)(`button`,{type:`button`,onClick:c,disabled:n,className:v(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,I.jsxs)(k.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,I.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function Cn({errorId:e,defaultMessage:t}){let{t:n}=d(`openhands`),[r,i]=F.useState(!1);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,I.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,I.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,I.jsx)(R,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,I.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,I.jsx)(P,{children:t})]})}function wn({event:e}){return Fe(e)?(0,I.jsx)(Cn,{errorId:e.id,defaultMessage:e.error}):null}function Tn({width:e=20,height:t=20,active:n}){return(0,I.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.204 15.0037L6.65511 9.99993L11.204 4.99617L12.1289 5.83701L8.34444 9.99993L12.1289 14.1628L11.204 15.0037Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function En({width:e=20,height:t=20,active:n}){return(0,I.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,I.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.79602 4.99634L13.3449 10.0001L8.79602 15.0038L7.87109 14.163L11.6556 10.0001L7.87109 5.83718L8.79602 4.99634Z`,fill:n?`var(--oh-text-tertiary)`:`var(--oh-border)`})})}function Dn({onClick:e,className:t,"aria-label":n}){return(0,I.jsx)(`button`,{type:`button`,onClick:e,"aria-label":n,className:v(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,I.jsx)(ke,{width:18,height:18})})}function On({src:e,onClose:t}){let{t:n}=d(`openhands`);return F.useEffect(()=>{let e=e=>{e.key===`Escape`&&(e.stopPropagation(),t())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[t]),(0,I.jsx)(ce,{onClose:t,closeOnEscape:!1,"aria-label":n(h.IMAGE$FULL_SIZE_PREVIEW),children:(0,I.jsxs)(`div`,{"data-testid":`image-lightbox`,className:`relative`,children:[(0,I.jsx)(me,{onClose:t,testId:`image-lightbox-close`,className:`bg-black/60 text-white hover:bg-black/80`}),(0,I.jsx)(`img`,{src:e,alt:n(h.IMAGE$FULL_SIZE_PREVIEW),className:`max-h-[90vh] max-w-[90vw] rounded-lg object-contain`})]})})}function kn({src:e,size:t=`small`}){return(0,I.jsx)(`img`,{role:`img`,alt:``,src:e,className:v(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function An({src:e,onRemove:t,size:n=`small`}){let{t:r}=d(`openhands`),[i,a]=F.useState(!1);return(0,I.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,I.jsx)(`button`,{type:`button`,"data-testid":`expand-image-button`,"aria-label":r(h.BUTTON$VIEW_FULL_SIZE_IMAGE),onClick:()=>a(!0),className:`block cursor-zoom-in rounded-sm transition-opacity hover:opacity-80`,children:(0,I.jsx)(kn,{src:e,size:n})}),t&&(0,I.jsx)(Dn,{onClick:t,"aria-label":r(h.BUTTON$REMOVE_IMAGE),className:`absolute right-[3px] top-[3px] cursor-pointer`}),i&&(0,I.jsx)(On,{src:e,onClose:()=>a(!1)})]})}function jn({size:e=`small`,images:t,onRemove:n}){let r=F.useRef(null),[i,a]=F.useState(!1),[o,s]=F.useState(!0),[c,l]=F.useState(!1);return F.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,I.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,I.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,I.jsx)(Tn,{active:!o})}),(0,I.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:v(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,I.jsx)(An,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,I.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,I.jsx)(En,{active:!c})})]})}var Mn=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
3
3
  `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=f.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Nn(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Pn(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function Fn(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function In(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Ln(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rn(e){let t=e?.verification;if(!Ln(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function zn({feature:e}){let t=Math.round(e.probability*100),n=In(e.probability);return(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,I.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function W({label:e,features:t}){return!t||t.length===0?null:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,I.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,I.jsxs)(F.Fragment,{children:[t>0&&(0,I.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,I.jsx)(zn,{feature:e})]},e.name))]})}function Bn({categorized:e}){let{t}=d(),n=e.agent_behavioral_issues&&e.agent_behavioral_issues.length>0,r=e.user_followup_patterns&&e.user_followup_patterns.length>0,i=e.infrastructure_issues&&e.infrastructure_issues.length>0,a=e.other&&e.other.length>0;return!n&&!r&&!i&&!a?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,I.jsx)(W,{label:t(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,I.jsx)(W,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,I.jsx)(W,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,I.jsx)(W,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Vn({criticResult:e}){let{t}=d(),{data:n}=se(),[r,i]=F.useState(!1),a=Nn(e.score),{filled:o,empty:s}=Pn(a),c=Fn(a),l=(a*100).toFixed(1),u=Rn(n?.agent_settings)===!1,f=e.metadata?.categorized_features,p=f!=null&&((f.agent_behavioral_issues??[]).length>0||(f.user_followup_patterns??[]).length>0||(f.infrastructure_issues??[]).length>0||(f.other??[]).length>0);return(0,I.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(h.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,I.jsxs)(`span`,{className:`${c} text-xs tracking-wide`,"aria-label":`Score: ${l}%`,children:[`★`.repeat(o),`☆`.repeat(s)]}),(0,I.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,l,`%)`]}),p&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?h.BUTTON$COLLAPSE_DETAILS:h.BUTTON$EXPAND_DETAILS),children:r?(0,I.jsx)(R,{className:`h-3 w-3 inline fill-neutral-400`}):(0,I.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&p&&(0,I.jsx)(Bn,{categorized:f}),u&&(0,I.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(h.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var Hn=e=>(0,I.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,I.jsx)(`path`,{d:`M11.3931 1.88021C10.78 1.37593 10.062 1.01489 9.29157 0.823438C8.52113 0.631981 7.71767 0.614934 6.9398 0.773542C5.90405 0.982756 4.95379 1.49492 4.20959 2.24506C3.46538 2.9952 2.96078 3.9495 2.7598 4.98688C2.61303 5.76469 2.6397 6.56531 2.83791 7.33163C3.03611 8.09795 3.40097 8.8111 3.90647 9.42021C4.37559 9.94959 4.64449 10.6266 4.66647 11.3335V13.3335C4.66647 13.864 4.87718 14.3727 5.25225 14.7478C5.62732 15.1228 6.13603 15.3335 6.66647 15.3335H9.33313C9.86356 15.3335 10.3723 15.1228 10.7473 14.7478C11.1224 14.3727 11.3331 13.864 11.3331 13.3335V11.4602C11.3555 10.6797 11.6423 9.92983 12.1465 9.33354C13.0299 8.24073 13.4463 6.84342 13.3052 5.44529C13.1642 4.04716 12.477 2.7612 11.3931 1.86687V1.88021ZM9.9998 13.3335C9.9998 13.5104 9.92956 13.6799 9.80454 13.8049C9.67951 13.93 9.50994 14.0002 9.33313 14.0002H6.66647C6.48965 14.0002 6.32009 13.93 6.19506 13.8049C6.07004 13.6799 5.9998 13.5104 5.9998 13.3335V12.6669H9.9998V13.3335ZM11.1131 8.50688C10.4428 9.30194 10.0517 10.2949 9.9998 11.3335H8.66647V9.33354C8.66647 9.15673 8.59623 8.98716 8.4712 8.86214C8.34618 8.73711 8.17661 8.66688 7.9998 8.66688C7.82299 8.66688 7.65342 8.73711 7.52839 8.86214C7.40337 8.98716 7.33313 9.15673 7.33313 9.33354V11.3335H5.9998C5.98221 10.3123 5.60443 9.33005 4.93313 8.56021C4.49023 8.02954 4.19239 7.39316 4.06867 6.71311C3.94495 6.03306 3.99957 5.33255 4.22719 4.6799C4.45481 4.02724 4.84768 3.4447 5.36748 2.98909C5.88728 2.53348 6.51627 2.22034 7.19313 2.08021C7.77483 1.96044 8.37591 1.9717 8.95271 2.11319C9.52952 2.25467 10.0676 2.52282 10.5278 2.89818C10.9881 3.27353 11.359 3.74666 11.6136 4.28322C11.8682 4.81978 12.0001 5.4063 11.9998 6.00021C12.0047 6.91345 11.6912 7.79985 11.1131 8.50688Z`,fill:`currentColor`})});function G({content:e}){let{t}=d(`openhands`),[n,r]=F.useState(!1);if(!e.trim())return null;let i=n?R:L;return(0,I.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),"aria-expanded":n,"aria-label":t(n?h.THINKING$COLLAPSE:h.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,I.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,I.jsx)(Hn,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,I.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,I.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,I.jsx)(P,{children:e})})]})}var Un=()=>{let e=o();return c({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await _e.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await _e.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function Wn({event:e,isFromPlanningAgent:t}){let{t:n}=d(`openhands`),{navigate:r}=ue(),{conversationId:i}=N(),a=p().backend.kind===`cloud`,{mutate:o,isPending:s}=Un(),c=pe(e=>e.setMessageToSend),l=F.useRef(!1),u=Mn(e),{reasoning:f,message:g}=e.source===`agent`?Be(u):{reasoning:``,message:u},_=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&_.push(...e.image_urls)});let v=!a&&i?[{icon:(0,I.jsx)(Se,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!i||s||l.current)return;l.current=!0;let t=Te.getCurrentConversation(),n=t?.id===i?t.title:void 0,a=n?`${n} (branch)`:void 0,u=e.source===`user`&&g.length>0;o({sourceConversationId:i,eventId:e.id,...u?{editText:g}:{},...a?{title:a}:{}},{onSuccess:({info:e,excluded:t})=>{r(`/conversations/${e.id}`),t&&window.setTimeout(()=>c(g),0)},onError:e=>m(e instanceof Error?e.message:null),onSettled:()=>{l.current=!1}})},tooltip:n(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,I.jsxs)(I.Fragment,{children:[f&&(0,I.jsx)(G,{content:f}),(0,I.jsx)(U,{type:e.source,message:g,isFromPlanningAgent:t,actions:v,timestamp:e.timestamp,children:_.length>0&&(0,I.jsx)(jn,{size:`small`,images:_})}),e.source===`agent`&&e.critic_result!=null&&(0,I.jsx)(Vn,{criticResult:e.critic_result})]})}var Gn=e=>{switch(e){case g.LOW:return f.t(h.SECURITY$LOW_RISK);case g.MEDIUM:return f.t(h.SECURITY$MEDIUM_RISK);case g.HIGH:return f.t(h.SECURITY$HIGH_RISK);case g.UNKNOWN:default:return f.t(h.SECURITY$UNKNOWN_RISK)}},K=()=>``,Kn=e=>e.name?`**Skill:** \`${e.name}\``:K(),qn=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
4
4
  `):K()},Jn=e=>{if(e.command!==`create`||!e.file_text)return K();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,B)}...`),`${e.path}\n${t}`},Yn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===g.HIGH||e.security_risk===g.MEDIUM)&&(t+=`\n\n${Gn(e.security_risk)}`),t},Xn=e=>{let t=`**MCP Tool Call**
@@ -25,11 +25,11 @@ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,
25
25
  `)),r.length>1e3&&(r=`${r.slice(0,B)}...(truncated)`),r},hr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
26
26
  `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
27
27
  `,t.is_error?r+=`**Error:**\n${n}`:t.matches.length===0?r+=`**Result:** No matches found.`:(r+=`**Matches (${t.matches.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.matches.map(e=>`- \`${e}\``).join(`
28
- `)),r.length>1e3&&(r=`${r.slice(0,B)}...(truncated)`),r},gr=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return ir(e);case`ExecuteBashObservation`:case`TerminalObservation`:return ar(e);case`BrowserObservation`:return or(e);case`MCPToolObservation`:return sr(e);case`TaskTrackerObservation`:return dr(e);case`ThinkObservation`:return fr(e);case`FinishObservation`:return pr(e);case`GlobObservation`:return mr(e);case`GrepObservation`:return hr(e);case`InvokeSkillObservation`:return cr(e);case`CanvasUIObservation`:return lr(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?lr(e):Ut(e);case`SwitchLLMObservation`:return ur(e);default:return Ut(e)}},_r=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,I.jsx)(`path`,{d:`M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z`,fill:`currentColor`})}),vr=e=>(0,I.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:[(0,I.jsx)(`path`,{d:`M5.79029 12.9507C5.69629 12.9042 5.59557 12.8843 5.50157 12.8843C5.25314 12.8843 5.01142 13.0238 4.89728 13.2562C4.72942 13.5883 4.87042 13.9868 5.20614 14.1462C5.30014 14.1927 5.40086 14.2127 5.50157 14.2127C5.75 14.2127 5.985 14.0732 6.10586 13.8407C6.15286 13.7477 6.17301 13.6481 6.17301 13.5551C6.17301 13.3027 6.03201 13.0636 5.79029 12.9507ZM13.3641 12.3463C13.3641 12.3463 13.3909 12.333 13.3977 12.3198C13.4178 12.2998 13.4312 12.2733 13.4447 12.2533C13.4245 12.2865 13.3977 12.3198 13.3641 12.3463ZM3.91698 11.463C3.7827 11.2969 3.58798 11.2106 3.39326 11.2106C3.24555 11.2106 3.09783 11.2637 2.97697 11.3567C2.68154 11.5892 2.63454 12.0076 2.86283 12.2932C2.99712 12.4592 3.19183 12.5456 3.39326 12.5456C3.54098 12.5456 3.68869 12.4924 3.80955 12.3995C3.97741 12.2666 4.0647 12.074 4.0647 11.8814C4.0647 11.7353 4.0177 11.5892 3.91698 11.463ZM2.88297 9.32433C2.80911 9.01881 2.53382 8.80627 2.23168 8.80627C2.18468 8.80627 2.13096 8.81291 2.07725 8.8262C1.71467 8.9059 1.48638 9.26455 1.56696 9.61657C1.64081 9.92873 1.9161 10.1346 2.22496 10.1346C2.27196 10.1346 2.32568 10.1346 2.37268 10.1213C2.68825 10.0549 2.8964 9.77597 2.8964 9.47045C2.8964 9.42395 2.8964 9.37082 2.88297 9.32433ZM2.37939 6.15621C2.33239 6.14293 2.27868 6.14293 2.23168 6.14293C1.92282 6.14293 1.64753 6.34218 1.57367 6.65434C1.4931 7.013 1.71467 7.36501 2.07725 7.45135C2.13096 7.46464 2.17796 7.47128 2.22496 7.47128C2.53382 7.47128 2.80911 7.25874 2.88297 6.95322C2.8964 6.90673 2.8964 6.8536 2.8964 6.8071C2.8964 6.50158 2.69497 6.22263 2.37939 6.15621ZM3.82298 3.87809C3.70212 3.78511 3.55441 3.73197 3.40669 3.73197C3.20526 3.73197 3.01054 3.81831 2.87626 3.98436C2.64797 4.26995 2.69497 4.68838 2.98369 4.92085C3.10454 5.01383 3.25226 5.06696 3.39998 5.06696C3.59469 5.06696 3.79612 4.98062 3.9237 4.81458C4.02441 4.69503 4.07141 4.54227 4.07141 4.39615C4.07141 4.20354 3.99084 4.01093 3.82298 3.87809ZM6.11929 2.45011C6.00515 2.21101 5.76343 2.07153 5.50829 2.07153C5.41428 2.07153 5.31357 2.09146 5.21957 2.13795C4.88385 2.29735 4.74956 2.69586 4.90399 3.0213C5.02485 3.26041 5.25985 3.39988 5.50829 3.39988C5.609 3.39988 5.70972 3.37996 5.80372 3.33347C6.04543 3.22056 6.17972 2.98145 6.17972 2.73571C6.17972 2.63608 6.15958 2.5431 6.11929 2.45011Z`,fill:`currentColor`}),(0,I.jsx)(`path`,{d:`M14.8809 8.14215C14.8809 8.65356 14.8205 9.15834 14.7063 9.64983C14.5251 10.4269 14.2028 11.1708 13.7462 11.8482C13.6589 11.9811 13.5649 12.1073 13.4642 12.2268C13.4642 12.2401 13.4575 12.2468 13.444 12.2534C13.4239 12.2866 13.397 12.3198 13.3635 12.3464C12.7457 13.1102 11.9602 13.7212 11.0604 14.1529C11.047 14.1596 11.0269 14.1662 11.0134 14.1729C10.9194 14.2194 10.8187 14.2658 10.718 14.3057C9.90558 14.6378 9.01928 14.8105 8.1397 14.8105H8.11955C7.74355 14.8038 7.45483 14.5116 7.45483 14.1463C7.45483 13.781 7.75698 13.4821 8.12627 13.4821H8.14641C8.85142 13.4821 9.55643 13.3426 10.2077 13.077C11.047 12.7316 11.7789 12.187 12.3496 11.4896C12.4436 11.37 12.5443 11.2438 12.6316 11.111C12.9942 10.5664 13.256 9.97527 13.397 9.35095C13.397 9.33766 13.397 9.32438 13.397 9.31774C13.4843 8.93252 13.5313 8.54065 13.5313 8.14215C13.5313 7.43812 13.3903 6.75402 13.1218 6.10313C12.927 5.64485 12.6786 5.21978 12.3697 4.83455C12.2422 4.67515 12.1012 4.51575 11.9535 4.36963C11.4499 3.8715 10.859 3.47964 10.201 3.21397C9.55643 2.9483 8.86485 2.81546 8.16655 2.80882H8.13298C7.76369 2.80882 7.46155 2.50994 7.46155 2.14464C7.46155 1.77935 7.76369 1.48047 8.13298 1.48047H8.17327C9.05285 1.48711 9.90557 1.65315 10.7113 1.98524C10.8322 2.03838 10.953 2.08487 11.0672 2.14464C11.0806 2.15129 11.094 2.15793 11.1007 2.15793C11.7722 2.48337 12.3697 2.90845 12.9002 3.43314C13.0815 3.61247 13.256 3.80508 13.4172 4.00434C13.4239 4.01098 13.4239 4.01762 13.4306 4.02426C13.8133 4.49583 14.1222 5.02717 14.3639 5.59171C14.4982 5.91052 14.6056 6.24261 14.6795 6.57469C14.6929 6.62119 14.7063 6.66768 14.7131 6.71417C14.8205 7.17909 14.8742 7.6573 14.8742 8.14215H14.8809Z`,fill:`currentColor`})]});function yr({task:e}){let{t}=d(`openhands`),n=(0,F.useMemo)(()=>{switch(e.status){case`todo`:return(0,I.jsx)(_r,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,I.jsx)(vr,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,I.jsx)(je,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,I.jsx)(_r,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,I.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,I.jsx)(`div`,{className:`shrink-0`,children:n}),(0,I.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,I.jsx)(k.Text,{className:v(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,I.jsxs)(k.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function br({taskList:e}){let{t}=d(`openhands`);return(0,I.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,I.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,I.jsx)(Qe,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,I.jsx)(k.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(h.COMMON$TASKS)})]}),(0,I.jsx)(`div`,{children:e.map((e,t)=>(0,I.jsx)(yr,{task:e},`task-${t}`))})]})}function xr({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,I.jsx)(br,{taskList:r})})}var Sr=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),Cr=e=>{let t=[],n=/<EXTRA_INFO>([\s\S]*?)<\/EXTRA_INFO>/gi,r=n.exec(e);for(;r!==null;){let i=r[1].trim();i.length>0&&t.push(i),r=n.exec(e)}return t},wr=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Tr=(e,t)=>{let n=`
28
+ `)),r.length>1e3&&(r=`${r.slice(0,B)}...(truncated)`),r},gr=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return ir(e);case`ExecuteBashObservation`:case`TerminalObservation`:return ar(e);case`BrowserObservation`:return or(e);case`MCPToolObservation`:return sr(e);case`TaskTrackerObservation`:return dr(e);case`ThinkObservation`:return fr(e);case`FinishObservation`:return pr(e);case`GlobObservation`:return mr(e);case`GrepObservation`:return hr(e);case`InvokeSkillObservation`:return cr(e);case`CanvasUIObservation`:return lr(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?lr(e):Ut(e);case`SwitchLLMObservation`:return ur(e);default:return Ut(e)}},_r=e=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,I.jsx)(`path`,{d:`M12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z`,fill:`currentColor`})}),vr=e=>(0,I.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:[(0,I.jsx)(`path`,{d:`M5.79029 12.9507C5.69629 12.9042 5.59557 12.8843 5.50157 12.8843C5.25314 12.8843 5.01142 13.0238 4.89728 13.2562C4.72942 13.5883 4.87042 13.9868 5.20614 14.1462C5.30014 14.1927 5.40086 14.2127 5.50157 14.2127C5.75 14.2127 5.985 14.0732 6.10586 13.8407C6.15286 13.7477 6.17301 13.6481 6.17301 13.5551C6.17301 13.3027 6.03201 13.0636 5.79029 12.9507ZM13.3641 12.3463C13.3641 12.3463 13.3909 12.333 13.3977 12.3198C13.4178 12.2998 13.4312 12.2733 13.4447 12.2533C13.4245 12.2865 13.3977 12.3198 13.3641 12.3463ZM3.91698 11.463C3.7827 11.2969 3.58798 11.2106 3.39326 11.2106C3.24555 11.2106 3.09783 11.2637 2.97697 11.3567C2.68154 11.5892 2.63454 12.0076 2.86283 12.2932C2.99712 12.4592 3.19183 12.5456 3.39326 12.5456C3.54098 12.5456 3.68869 12.4924 3.80955 12.3995C3.97741 12.2666 4.0647 12.074 4.0647 11.8814C4.0647 11.7353 4.0177 11.5892 3.91698 11.463ZM2.88297 9.32433C2.80911 9.01881 2.53382 8.80627 2.23168 8.80627C2.18468 8.80627 2.13096 8.81291 2.07725 8.8262C1.71467 8.9059 1.48638 9.26455 1.56696 9.61657C1.64081 9.92873 1.9161 10.1346 2.22496 10.1346C2.27196 10.1346 2.32568 10.1346 2.37268 10.1213C2.68825 10.0549 2.8964 9.77597 2.8964 9.47045C2.8964 9.42395 2.8964 9.37082 2.88297 9.32433ZM2.37939 6.15621C2.33239 6.14293 2.27868 6.14293 2.23168 6.14293C1.92282 6.14293 1.64753 6.34218 1.57367 6.65434C1.4931 7.013 1.71467 7.36501 2.07725 7.45135C2.13096 7.46464 2.17796 7.47128 2.22496 7.47128C2.53382 7.47128 2.80911 7.25874 2.88297 6.95322C2.8964 6.90673 2.8964 6.8536 2.8964 6.8071C2.8964 6.50158 2.69497 6.22263 2.37939 6.15621ZM3.82298 3.87809C3.70212 3.78511 3.55441 3.73197 3.40669 3.73197C3.20526 3.73197 3.01054 3.81831 2.87626 3.98436C2.64797 4.26995 2.69497 4.68838 2.98369 4.92085C3.10454 5.01383 3.25226 5.06696 3.39998 5.06696C3.59469 5.06696 3.79612 4.98062 3.9237 4.81458C4.02441 4.69503 4.07141 4.54227 4.07141 4.39615C4.07141 4.20354 3.99084 4.01093 3.82298 3.87809ZM6.11929 2.45011C6.00515 2.21101 5.76343 2.07153 5.50829 2.07153C5.41428 2.07153 5.31357 2.09146 5.21957 2.13795C4.88385 2.29735 4.74956 2.69586 4.90399 3.0213C5.02485 3.26041 5.25985 3.39988 5.50829 3.39988C5.609 3.39988 5.70972 3.37996 5.80372 3.33347C6.04543 3.22056 6.17972 2.98145 6.17972 2.73571C6.17972 2.63608 6.15958 2.5431 6.11929 2.45011Z`,fill:`currentColor`}),(0,I.jsx)(`path`,{d:`M14.8809 8.14215C14.8809 8.65356 14.8205 9.15834 14.7063 9.64983C14.5251 10.4269 14.2028 11.1708 13.7462 11.8482C13.6589 11.9811 13.5649 12.1073 13.4642 12.2268C13.4642 12.2401 13.4575 12.2468 13.444 12.2534C13.4239 12.2866 13.397 12.3198 13.3635 12.3464C12.7457 13.1102 11.9602 13.7212 11.0604 14.1529C11.047 14.1596 11.0269 14.1662 11.0134 14.1729C10.9194 14.2194 10.8187 14.2658 10.718 14.3057C9.90558 14.6378 9.01928 14.8105 8.1397 14.8105H8.11955C7.74355 14.8038 7.45483 14.5116 7.45483 14.1463C7.45483 13.781 7.75698 13.4821 8.12627 13.4821H8.14641C8.85142 13.4821 9.55643 13.3426 10.2077 13.077C11.047 12.7316 11.7789 12.187 12.3496 11.4896C12.4436 11.37 12.5443 11.2438 12.6316 11.111C12.9942 10.5664 13.256 9.97527 13.397 9.35095C13.397 9.33766 13.397 9.32438 13.397 9.31774C13.4843 8.93252 13.5313 8.54065 13.5313 8.14215C13.5313 7.43812 13.3903 6.75402 13.1218 6.10313C12.927 5.64485 12.6786 5.21978 12.3697 4.83455C12.2422 4.67515 12.1012 4.51575 11.9535 4.36963C11.4499 3.8715 10.859 3.47964 10.201 3.21397C9.55643 2.9483 8.86485 2.81546 8.16655 2.80882H8.13298C7.76369 2.80882 7.46155 2.50994 7.46155 2.14464C7.46155 1.77935 7.76369 1.48047 8.13298 1.48047H8.17327C9.05285 1.48711 9.90557 1.65315 10.7113 1.98524C10.8322 2.03838 10.953 2.08487 11.0672 2.14464C11.0806 2.15129 11.094 2.15793 11.1007 2.15793C11.7722 2.48337 12.3697 2.90845 12.9002 3.43314C13.0815 3.61247 13.256 3.80508 13.4172 4.00434C13.4239 4.01098 13.4239 4.01762 13.4306 4.02426C13.8133 4.49583 14.1222 5.02717 14.3639 5.59171C14.4982 5.91052 14.6056 6.24261 14.6795 6.57469C14.6929 6.62119 14.7063 6.66768 14.7131 6.71417C14.8205 7.17909 14.8742 7.6573 14.8742 8.14215H14.8809Z`,fill:`currentColor`})]});function yr({task:e}){let{t}=d(`openhands`),n=(0,F.useMemo)(()=>{switch(e.status){case`todo`:return(0,I.jsx)(_r,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,I.jsx)(vr,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,I.jsx)(je,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,I.jsx)(_r,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,I.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,I.jsx)(`div`,{className:`shrink-0`,children:n}),(0,I.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,I.jsx)(k.Text,{className:v(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,I.jsxs)(k.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function br({taskList:e}){let{t}=d(`openhands`);return(0,I.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,I.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,I.jsx)(Qe,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,I.jsx)(k.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(h.COMMON$TASKS)})]}),(0,I.jsx)(`div`,{children:e.map((e,t)=>(0,I.jsx)(yr,{task:e},`task-${t}`))})]})}function xr({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,I.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,I.jsx)(br,{taskList:r})})}function Sr(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}var Cr=e=>Array.from(e.matchAll(/<EXTRA_INFO>([\s\S]*?)<\/EXTRA_INFO>/gi),e=>e[1].trim()).filter(Boolean),wr=(e,t)=>{let n=`\n\n- **${e}**`;return t&&(n+=`\n\n${t}`),n},Tr=(e,t)=>{let n=`
29
29
 
30
- **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=wr(e,i)}),n},Er=e=>{let t=`
30
+ **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=t[r];n+=wr(e,i)}),n},Er=e=>{let t=`
31
31
 
32
- **Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},Dr=e=>!e||e.length===0?[]:Cr(Sr(e)),Or=(e,t)=>{let n=Dr(t);return e&&e.length>0?Tr(e,n):n.length>0?Er(n):``},kr=(e,t)=>{let n=Dr(t);return e&&e.length>0?e.map((e,t)=>({name:e,content:t<n.length?n[t].trim():``})):n.length>0?n.filter(e=>e.trim().length>0).map((e,t)=>({name:`Extended Content ${t+1}`,content:e.trim()})):[]},q=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,Ar=e=>{let t=e.activated_skills||[],n=e.extended_content||[];if(t.length===0&&n.length===0)throw Error(`Cannot create skill ready event without activated skills or extended content`);let r=Or(t,n),i=kr(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},J=e=>e,Y=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
32
+ **Extended Content:**`;return e.forEach(e=>{t+=`\n\n${e}`}),t},Dr=e=>e?Cr(Sr(e)):[],Or=(e,t)=>{let n=Dr(t);return e&&e.length>0?Tr(e,n):n.length>0?Er(n):``},kr=(e,t)=>{let n=Dr(t);return e&&e.length>0?e.map((e,t)=>({name:e,content:n[t]??``})):n.map((e,t)=>({name:`Extended Content ${t+1}`,content:e}))},q=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,Ar=e=>{let t=e.activated_skills||[],n=e.extended_content||[];if(t.length===0&&n.length===0)throw Error(`Cannot create skill ready event without activated skills or extended content`);let r=Or(t,n),i=kr(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},J=e=>e,Y=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
33
33
  `);function jr({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=d(`openhands`),[s,c]=F.useState(!1),l=e.length>B,u=(l&&!(i&&s)?`${e.slice(0,1e3)}…`:e).trim()||r||``,f=n&&e.trim().length>0,p=o(s?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),m=(0,I.jsx)(de,{className:`rounded-lg text-xs`,style:fe,language:t,PreTag:`div`,wrapLongLines:a,customStyle:a?{whiteSpace:`pre-wrap`}:void 0,codeTagProps:a?{style:{whiteSpace:`pre-wrap`}}:void 0,children:u});return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[f?(0,I.jsx)(Ye,{text:e,children:m}):m,i&&l&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`self-start text-xs text-muted transition-colors hover:text-white hover:underline`,children:p})]})}function Mr({output:e,exitCode:t,copy:n=!0}){let{t:r}=d(`openhands`);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t!=null&&t!==0&&t!==-1&&(0,I.jsx)(`span`,{className:`self-start rounded bg-status-fail-bg px-1.5 py-0.5 font-mono text-xs text-status-fail-text`,children:r(h.OBSERVATION$EXIT_CODE,{code:t})}),(0,I.jsx)(jr,{code:e,language:`bash`,copy:n,placeholder:r(h.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Nr=J({actionKinds:[`ExecuteBashAction`,`TerminalAction`],observationKinds:[`ExecuteBashObservation`,`TerminalObservation`],Body:function({action:e,observation:t}){let{t:n}=d(`openhands`),r=t?.observation.command??e?.action.command??``,i=e?.security_risk;return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r&&(0,I.jsx)(jr,{code:r,language:`bash`}),(i===g.HIGH||i===g.MEDIUM)&&(0,I.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===g.HIGH?h.SECURITY$HIGH_RISK:h.SECURITY$MEDIUM_RISK)}),t&&(0,I.jsx)(Mr,{output:Y(t.observation.content),exitCode:t.observation.exit_code})]})}}),Pr=e=>{switch(e.split(`.`).pop()?.toLowerCase()){case`js`:case`jsx`:return`javascript`;case`ts`:case`tsx`:return`typescript`;case`py`:return`python`;case`html`:return`html`;case`css`:return`css`;case`json`:return`json`;case`md`:return`markdown`;case`yml`:case`yaml`:return`yaml`;case`sh`:case`bash`:return`bash`;case`dockerfile`:return`dockerfile`;case`rs`:return`rust`;case`go`:return`go`;case`java`:return`java`;case`cpp`:case`cc`:case`cxx`:return`cpp`;case`c`:return`c`;case`rb`:return`ruby`;case`php`:return`php`;case`sql`:return`sql`;default:return`text`}},Fr=3,Ir=300,Lr=25e4,Rr=(e,t)=>{if(e.length*t.length>Lr)return[...e.map(e=>({type:`del`,text:e})),...t.map(e=>({type:`add`,text:e}))];let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;--a)for(let n=r-1;n>=0;--n)i[a][n]=e[a]===t[n]?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push({type:`ctx`,text:e[o]}),o+=1,s+=1):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,text:e[o]}),o+=1):(a.push({type:`add`,text:t[s]}),s+=1);for(;o<n;)a.push({type:`del`,text:e[o]}),o+=1;for(;s<r;)a.push({type:`add`,text:t[s]}),s+=1;return a},zr=(e,t)=>{let n=e.split(`
34
34
  `),r=t.split(`
35
35
  `),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i+=1;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)--a,--o;let s=n.slice(Math.max(0,i-Fr),i),c=n.slice(a,Math.min(n.length,a+Fr));return[...s.map(e=>({type:`ctx`,text:e})),...Rr(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},Br={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},Vr={add:`+ `,del:`- `,ctx:` `};function Hr({oldText:e,newText:t}){let{t:n}=d(`openhands`),r=zr(e,t),i=r.length>Ir;return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`div`,{className:`overflow-auto rounded-lg border border-surface-raised font-mono text-xs`,children:(i?r.slice(0,Ir):r).map((e,t)=>(0,I.jsx)(`div`,{className:v(`whitespace-pre-wrap px-2`,Br[e.type]),children:`${Vr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]})}function Ur({path:e,range:t,onClick:n}){let{conversationId:r}=N();return(0,I.jsx)(`button`,{type:`button`,"data-testid":`file-path-chip`,title:e,className:`inline-flex max-w-full cursor-pointer items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 text-left font-mono text-xs text-foreground hover:bg-[var(--oh-interactive-hover)]`,onClick:t=>{if(t.stopPropagation(),n){n();return}M(e,r)},children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(it,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,I.jsx)(`span`,{className:`break-all`,children:t?`${e}:${t}`:e})]})})}var Wr=new Set([`md`,`markdown`,`mdx`]);function Gr(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Wr.has(e.slice(t+1).toLowerCase())}var X=new Set([`FileEditorAction`,`StrReplaceEditorAction`]),Kr=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`]);function qr(e,t){if(A(e)&&X.has(e.action.kind))return e.action.path||null;if(j(e)&&Kr.has(e.observation.kind)){let n=e.observation.path;if(n)return n;if(t&&X.has(t.action.kind))return t.action.path||null}return null}function Jr(e,t){if(A(e)&&X.has(e.action.kind))return e.action.command||null;if(j(e)&&Kr.has(e.observation.kind)){let n=e.observation.command;if(n)return n;if(t&&X.has(t.action.kind))return t.action.command||null}return null}function Yr(e,t){let n=qr(e,t),r=Jr(e,t);return!!(n&&r===`create`&&Gr(n))}function Xr({content:e,path:t,onView:n}){let{t:r}=d(`openhands`),i=t.split(`/`).pop()||t;return(0,I.jsxs)(`div`,{className:`w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]`,"data-testid":`markdown-file-preview`,children:[(0,I.jsx)(`div`,{"data-testid":`markdown-file-preview-content`,className:`max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]`,children:(0,I.jsx)(P,{content:e,includeStandard:!0,includeHeadings:!0,components:yn})}),(0,I.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,I.jsx)(it,{className:`h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]`}),(0,I.jsx)(k.Text,{className:`truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]`,children:i})]}),n?(0,I.jsxs)(`button`,{type:`button`,onClick:n,className:`flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80`,"data-testid":`markdown-file-preview-view`,children:[(0,I.jsx)(k.Text,{className:`text-[11px] leading-4 tracking-[0.11px] text-white`,children:r(h.COMMON$VIEW)}),(0,I.jsx)(st,{className:`text-white`,size:16})]}):null]})]})}var Zr=({action:e,observation:t})=>t?.observation.path??e?.action.path??``;function Qr({action:e,observation:t,onOpenFile:n}){let r=Zr({action:e,observation:t}),i=t?.observation.command??e?.action.command,a=Pr(r),o=e?.action.view_range,s=i===`view`&&o?`${o[0]}-${o[1]}`:void 0,c=r?(0,I.jsx)(Ur,{path:r,range:s,onClick:n}):null,l=e=>r&&i===`create`&&Gr(r)?{chip:null,body:(0,I.jsx)(Xr,{content:e,path:r,onView:n})}:{chip:c,body:(0,I.jsx)(jr,{code:e,language:a})};if(t){let e=t.observation,n=null,r=c;if(e.error)n=(0,I.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:e.error});else if(e.old_content!=null&&e.new_content!=null)n=(0,I.jsx)(Hr,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?Y(e.content):``);if(t){let e=l(t);r=e.chip,n=e.body}}return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}if(e){let t=e.action,n=null,r=c;if(t.command===`create`&&t.file_text){let e=l(t.file_text);r=e.chip,n=e.body}else (t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,I.jsx)(Hr,{oldText:t.old_str??``,newText:t.new_str}));return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}return null}function $r({conversationId:e,...t}){let n=Zr(t),r=n&&t.observation?()=>M(n,e):void 0;return(0,I.jsx)(Qr,{...t,onOpenFile:r})}var ei=J({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function(e){let{conversationId:t}=N();return t?(0,I.jsx)($r,{...e,conversationId:t}):(0,I.jsx)(Qr,{...e})}});function ti({rows:e}){return(0,I.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:e.map(({label:e,value:t})=>(0,I.jsxs)(F.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted`,children:e}),(0,I.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:t})]},e))})}var ni=J({actionKinds:[`GrepAction`,`GlobAction`],observationKinds:[`GrepObservation`,`GlobObservation`],Body:function({action:e,observation:t}){let{t:n}=d(`openhands`),r=t?.observation,i=e?.action,a=r?.pattern??i?.pattern??``,o=r?.search_path??i?.path??``,s=r?`include_pattern`in r?r.include_pattern:null:i&&`include`in i?i.include:null,c=r?`matches`in r?r.matches:r.files:[];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(ti,{rows:[{label:n(h.COMMON$PATTERN),value:a},...o?[{label:n(h.COMMON$PATH),value:o}]:[],...s?[{label:n(h.COMMON$INCLUDE),value:s}]:[]]}),r&&(r.is_error?(0,I.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:Y(r.content)}):c.length===0?(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$NO_RESULTS)}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$RESULTS,{count:c.length})}),(0,I.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:c.map(e=>(0,I.jsx)(`span`,{className:`break-all`,children:e},e))}),r.truncated&&(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]}))]})}});function ri({label:e,text:t,isError:n=!1}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,I.jsx)(Ye,{text:t,children:(0,I.jsx)(`div`,{className:`overflow-auto rounded border border-surface-raised bg-surface-raised p-2 text-xs ${n?`text-danger`:`text-foreground`}`,children:(0,I.jsx)(P,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var ii=[Nr,ei,ni,J({actionKinds:[`TaskAction`],observationKinds:[`TaskObservation`],Body:function({action:e,observation:t}){let{t:n}=d(`openhands`),r=e?.action,i=t?.observation,a=i?.subagent??r?.subagent_type??``,o=i?.task_id,s=r?.prompt?.trim()??``,c=i?Y(i.content).trim():``,l=[...a?[{label:n(h.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(h.TASK$TASK_ID),value:o}]:[]];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l.length>0&&(0,I.jsx)(ti,{rows:l}),s&&(0,I.jsx)(ri,{label:n(h.TASK$QUERY),text:s}),c&&(0,I.jsx)(ri,{label:n(h.TASK$RESULT),text:c,isError:i?.is_error})]})}})],ai=e=>new Map(ii.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),oi=ai(e=>e.actionKinds),si=ai(e=>e.observationKinds);function ci(e,t){if(A(e)){let t=oi.get(e.action.kind);if(t)return(0,I.jsx)(t.Body,{action:e})}else if(j(e)){let n=si.get(e.observation.kind);if(n)return(0,I.jsx)(n.Body,{action:t,observation:e})}return null}var Z=(e,t)=>f.exists(e)?(0,I.jsx)(u,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,I.jsx)(sn,{}),cmd:(0,I.jsx)(tn,{})}}):e,li=e=>e.kind===`text`?e.text:Z(e.key,e.values),Q=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?V(n,t):n:null},ui=e=>{if(e.tool_name!==`inspect_image_with_vision`)return null;let t=e.action,n=Q(t.profile_name);return n?`Describing image with ${n}`:`Describing image with auxiliary vision LLM`},di=(e,t)=>{let n=t?.tool_name,r=e.observation,i=Q(r.tool_name);if(n!==`inspect_image_with_vision`&&i!==`inspect_image_with_vision`&&String(e.observation.kind)!==`VisionInspectObservation`)return null;let a=Q((t?.action??{}).profile_name)??Q(r.profile_name)??Q(r.base_url,80)??Q(r.endpoint,80)??Q(r.model,80);return a?`Describing image with ${a}`:`Describing image with auxiliary vision LLM`},fi=e=>A(e)?ui(e)||li(Qt(e)):``,pi=(e,t)=>{if(!j(e))return``;let n=di(e,t);if(n)return n;if(t){let e=ui(t);if(e)return e;let n=Zt(t);if(n)return n}let r=e.observation.kind,i=``,a={};switch(r){case`ExecuteBashObservation`:case`TerminalObservation`:i=`OBSERVATION_MESSAGE$RUN`,a={command:e.observation.command?V(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:e.observation.command===`create`?`OBSERVATION_MESSAGE$WRITE`:`OBSERVATION_MESSAGE$EDIT`,a={path:e.observation.path||``};break;case`MCPToolObservation`:i=`OBSERVATION_MESSAGE$MCP`,a={mcp_tool_name:e.observation.tool_name};break;case`InvokeSkillObservation`:i=`OBSERVATION_MESSAGE$INVOKE_SKILL`,a={name:e.observation.skill_name};break;case`TaskObservation`:i=`OBSERVATION_MESSAGE$TASK`,a={name:e.observation.subagent};break;case`CanvasUIObservation`:i=`OBSERVATION_MESSAGE$CANVAS_UI`;break;case`ClientToolObservation`:if(e.tool_name===`canvas_ui_control`){i=`OBSERVATION_MESSAGE$CANVAS_UI`;break}if(e.tool_name===`launch_child_conversation`){i=`OBSERVATION_MESSAGE$LAUNCH_CHILD_CONVERSATION`;break}return r.replace(`Observation`,``).toUpperCase();case`SwitchLLMObservation`:i=e.observation.is_error?`MODEL$SWITCH_FAILED`:`MODEL$SWITCHED_TO_PROFILE`,a={name:e.observation.profile_name};break;case`BrowserObservation`:i=`OBSERVATION_MESSAGE$BROWSE`;break;case`TaskTrackerObservation`:{let{command:t}=e.observation;i=t===`plan`?`OBSERVATION_MESSAGE$TASK_TRACKING_PLAN`:`OBSERVATION_MESSAGE$TASK_TRACKING_VIEW`;break}case`ThinkObservation`:i=`OBSERVATION_MESSAGE$THINK`;break;case`GlobObservation`:i=`OBSERVATION_MESSAGE$GLOB`,a={pattern:e.observation.pattern?V(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?V(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?Z(i,a):r},mi=(e,t)=>e.observation.kind!==`ClientToolObservation`||e.tool_name!==`canvas_ui_control`||!t||!ze(t)?null:`UI command '${t.action.command}' dispatched to the Agent Canvas frontend.`,hi=(e,t)=>{let n=``,r=``;if(q(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=f.exists(t)?Z(t,{}):`Skill Ready`,r=e._skillReadyContent}else A(e)?(n=fi(e),r=ci(e)??tr(e)):j(e)?(n=pi(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,I.jsx)(xr,{event:e}):mi(e,t)??ci(e,t)??gr(e)):Ve(e)?(n=Z(Wt(e),{title:Kt(e)}),r=Yt(e)):e.source===`agent`&&`action`in e&&e.action!==null&&typeof e.action==`object`&&`kind`in e.action&&typeof e.action.kind==`string`&&(n=String(e.action.kind).replace(`Action`,``).toUpperCase());return{title:n||f.t(h.EVENT$UNKNOWN_EVENT),details:r}};function gi({event:e,isFromPlanningAgent:t=!1}){let n=hi(e);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(U,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t,timestamp:e.timestamp}),e.critic_result!=null&&(0,I.jsx)(Vn,{criticResult:e.critic_result})]})}var _i=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-BgLSZdyy.js";e();var r=t(),i={sm:`w-[384px]`,md:`w-[520px]`,lg:`w-[640px]`,xl:`w-[720px]`},a=`max-w-[90vw]`;function o(e){return i[e]}function s({testID:e,children:t,className:i,width:a=`sm`}){return(0,r.jsx)(`div`,{"data-testid":e,className:n(`bg-base-secondary flex flex-col gap-6 items-center p-6 rounded-xl`,o(a),i),children:t})}export{s as n,o as r,a as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-CbjwNcR-.js";e();var r=t(),i={sm:`w-[384px]`,md:`w-[520px]`,lg:`w-[640px]`,xl:`w-[720px]`},a=`max-w-[90vw]`;function o(e){return i[e]}function s({testID:e,children:t,className:i,width:a=`sm`}){return(0,r.jsx)(`div`,{"data-testid":e,className:n(`bg-base-secondary flex flex-col gap-6 items-center p-6 rounded-xl`,o(a),i),children:t})}export{s as n,o as r,a as t};
@@ -1 +1 @@
1
- import{t as e}from"./utils-BgLSZdyy.js";var t=e(`text-xl leading-6 -tracking-[0.01em] font-medium text-[var(--oh-modal-title-foreground)]`),n=e(`text-sm font-medium text-[var(--oh-modal-title-foreground)]`),r=e(`text-lg font-medium text-[var(--oh-modal-title-foreground)]`),i=r;export{n as i,r as n,i as r,t};
1
+ import{t as e}from"./utils-CbjwNcR-.js";var t=e(`text-xl leading-6 -tracking-[0.01em] font-medium text-[var(--oh-modal-title-foreground)]`),n=e(`text-sm font-medium text-[var(--oh-modal-title-foreground)]`),r=e(`text-lg font-medium text-[var(--oh-modal-title-foreground)]`),i=r;export{n as i,r as n,i as r,t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useTranslation-CCgUjPJF.js";import{K as r,t as i}from"./utils-BgLSZdyy.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,a.jsx)(`path`,{d:`M12 4L4 12M4 4L12 12`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})});function s({onClose:e,testId:t,className:s,disabled:c=!1}){let{t:l}=n(`openhands`);return(0,a.jsx)(`button`,{type:`button`,"data-testid":t,onClick:e,disabled:c,"aria-label":l(r.BUTTON$CLOSE),className:i(`absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,s),children:(0,a.jsx)(o,{"aria-hidden":!0,className:`size-4`})})}export{s as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./useTranslation-CCgUjPJF.js";import{K as r,t as i}from"./utils-CbjwNcR-.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,a.jsx)(`path`,{d:`M12 4L4 12M4 4L12 12`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})});function s({onClose:e,testId:t,className:s,disabled:c=!1}){let{t:l}=n(`openhands`);return(0,a.jsx)(`button`,{type:`button`,"data-testid":t,onClick:e,disabled:c,"aria-label":l(r.BUTTON$CLOSE),className:i(`absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,s),children:(0,a.jsx)(o,{"aria-hidden":!0,className:`size-4`})})}export{s as t};
@@ -0,0 +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{F as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{f as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{i as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BXXGJNDU.js";import{t as o}from"./useMutation-Cszf8mKy.js";import{t as s}from"./useQueries-pUohFMSP.js";import{t as c}from"./useQuery-DAAacS7O.js";import{t as l}from"./useTranslation-CCgUjPJF.js";import{L as u,n as d}from"./active-backend-context-BETEdaJl.js";import{K as f,t as p}from"./utils-CbjwNcR-.js";import{n as m}from"./agent-server-client-options-EHB23gyx.js";import{_ as h,s as g,x as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as v}from"./use-onboarding-completion-C4W-m2Jk.js";import{n as y}from"./use-settings-D69cw06D.js";import{t as b}from"./modal-backdrop-BSzNhM4r.js";import{r as x,t as S}from"./modal-body-B_95ci1c.js";import{r as C}from"./base-modal-CZq4kB_H.js";import{i as w}from"./modal-classes-BPcBCWVj.js";import{t as T}from"./brand-button-CGUwj6zK.js";import{m as E}from"./use-llm-configured-DF9BYmIe.js";import{t as D}from"./confirmation-modal-oN1EId79.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as k}from"./onboarding-modal-DCFD4Dsa.js";import{t as A}from"./folder-C1ou4_DT.js";import{t as j}from"./close-ScPlnwyq.js";var M=a(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),N=e(t(),1);function P(){return new g(m())}function F(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var I=class{static async listWorkspaces(){return F(await P().listWorkspaces())}static async addWorkspaces(e){return F(await P().addWorkspaces(e))}static async removeWorkspace(e){await P().deleteWorkspace(e)}static async addWorkspaceParents(e){return F(await P().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await P().deleteWorkspaceParent(e)}};function L({enabled:e=!0}={}){return c({queryKey:u.all,queryFn:()=>I.listWorkspaces(),enabled:e,retry:(e,t)=>!_(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function R(){return new h(m())}async function z(e,t=R()){let n=[],r=new Set,i;for(;;){let a=await t.searchSubdirectories(e,i?{pageId:i}:void 0);if(n.push(...a.items),i=a.next_page_id,!i)return{items:n,next_page_id:null};if(r.has(i))throw Error(`File search returned a repeated page id`);r.add(i)}}var ee=e=>{let t=d();return c({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>z(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},B=()=>{let e=d();return c({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>R().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function te(){let{data:e,isLoading:t,isError:n,error:r}=L(),i=_(r),a=e?.workspaces??[],o=e?.workspaceParents??[],c=(0,N.useMemo)(()=>{let e=new Set(o.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?o:[...o,...t]},[o,i]),l=s({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>z(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,N.useMemo)(()=>{let e=new Map,t=new Map(c.map((e,t)=>[e.path,l[t]]));return c.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,c,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),parents:c,isLoading:u,isError:d,error:r}}var V=n();function ne(){return(0,V.jsx)(E,{inset:`menu`})}function re(){let e=i();return o({mutationFn:e=>I.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function ie(){let e=i();return o({mutationFn:e=>I.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function ae(){let e=i();return o({mutationFn:e=>I.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function H(){let e=i();return o({mutationFn:e=>I.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function U(e,t){return _(e)?t(f.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var W=e=>(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,V.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),G=`/projects`;function K({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,V.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,V.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,V.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:p(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,V.jsx)(A,{width:14,height:14,className:`shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function q(e){let t=Y(e);if(!t||t===`/`||J(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function J(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function Y(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function X(e){return e?.home===`/home/openhands`}function oe({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=l(`openhands`),[a,o]=(0,N.useState)(null),s=d(),{data:c}=B();(0,N.useEffect)(()=>{e&&c?.home&&a===null&&o(X(c)?G:c.home),e||o(null)},[e,c?.home,a]),(0,N.useEffect)(()=>{o(null)},[s.backend.id,s.orgId]);let{data:u,isLoading:m,isError:h,error:g}=ee(e?a:null),_=(0,N.useMemo)(()=>{if(!c?.home)return[];let e=[{label:`Home`,path:Y(c.home)||c.home},...c.favorites??[]];return X(c)&&!e.some(e=>e.path===G)&&e.push({label:G,path:G}),e},[c]),v=c?.locations??[];if(!e)return null;let y=u?.items??[],E=a?q(a):null,D=c?.home===`/home/openhands`&&(c?.favorites?.length??0)===0&&a===c?.home&&!m&&!h&&y.length===0,O=e=>{let t=Y(e);if(!t)return`/`;if(t===`/`||J(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,V.jsx)(b,{onClose:t,"aria-label":i(f.HOME$ADD_WORKSPACES_TITLE),children:(0,V.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`xl`),S,`h-[480px]`),children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,V.jsx)(C,{className:w,title:i(f.HOME$ADD_WORKSPACES_TITLE)})}),(0,V.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,V.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,V.jsx)(K,{label:i(f.HOME$FAVORITES),entries:_,currentPath:a,onPick:o}),(0,V.jsx)(K,{label:i(f.HOME$LOCATIONS),entries:v,currentPath:a,onPick:o})]}),(0,V.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,V.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&o(E),disabled:!E,"aria-label":i(f.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,V.jsx)(W,{width:16,height:16})}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,V.jsx)(`span`,{children:i(f.HOME$NAME)}),(0,V.jsx)(`span`,{children:i(f.HOME$KIND)})]}),(0,V.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[m&&(0,V.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(f.HOME$LOADING)}),h&&(0,V.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:g?.message??i(f.COMMON$FAILED_TO_LOAD)}),!m&&!h&&y.length===0&&(0,V.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":D?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(D?f.HOME$HOST_HOME_NOT_MOUNTED_HINT:f.HOME$NO_WORKSPACES)}),y.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,V.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,V.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,V.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(f.HOME$FOLDER)})]})},e.path))]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,V.jsx)(T,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(f.HOME$CANCEL)}),r&&(0,V.jsx)(T,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:O(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-add-all-subdirs`,children:i(f.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,V.jsx)(T,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:O(a),path:a}]),t())},isDisabled:!a||m,testId:`folder-browser-use`,children:i(f.HOME$ADD_THIS_DIRECTORY)})]})]})})}function se({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=l(`openhands`),[s,c]=N.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let m=u.length>0||n.length>0;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b,{onClose:r,"aria-label":o(f.HOME$MANAGE_WORKSPACES),children:(0,V.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`lg`),S,`max-h-[70vh]`),children:[(0,V.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,V.jsx)(C,{className:w,title:o(f.HOME$MANAGE_WORKSPACES)})}),(0,V.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!m&&(0,V.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(f.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,V.jsx)(`ul`,{children:u.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,V.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,V.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>c({type:`workspace`,path:e.path,text:o(f.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(f.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,V.jsx)(j,{width:12,height:12}),(0,V.jsx)(`span`,{children:o(f.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,V.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,V.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(f.HOME$WORKSPACE_PARENTS)}),(0,V.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,V.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,V.jsx)(A,{width:16,height:16,className:`shrink-0`}),(0,V.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>c({type:`parent`,path:e.path,text:o(f.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(f.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,V.jsx)(j,{width:12,height:12}),(0,V.jsx)(`span`,{children:o(f.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,V.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,V.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,V.jsx)(A,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,V.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,V.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,V.jsx)(T,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(f.HOME$DONE)})})]})}),s&&(0,V.jsx)(D,{text:s.text,onConfirm:()=>{s&&(s.type===`workspace`?i(s.path):a?.(s.path),c(null))},onCancel:()=>c(null)})]})}var Z=`previewOnboardingStep`,ce=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(Z);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ce?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function le(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.trim().length>0,r=e?.llm_api_key_set===!0||O(t);return n&&r}function ue(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=v(),{backend:o}=d(),s=y(),c=o.kind===`cloud`||o.id!==`default-local`;return!n&&(i||c&&s.isLoading||c&&le(s.data))?null:(0,V.jsx)(k,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{U as a,ie as c,te as d,L as f,oe as i,H as l,$ as n,ae as o,M as p,se as r,re as s,ue as t,ne as u};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i,t as a}from"./recommended-automations-launcher-DEHRKIAg.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,dt as c,n as l,r as u,st as d}from"./active-backend-context-BnH4-L8h.js";import{K as f,t as p}from"./utils-BgLSZdyy.js";import{p as m,v as h}from"./agent-server-client-options-EHB23gyx.js";import{c as g}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-3eJ4ExtV.js";import{t as _}from"./chat-send-button-CGvc2wpE.js";import{t as v}from"./check-Bo8s5Ylg.js";import{t as y}from"./circle-check-5pH3qCji.js";import{a as b,i as x,n as S,r as C,t as w}from"./use-acp-credential-form-ychoGqjC.js";import{t as T}from"./loader-circle-BxJgk73D.js";import{c as E,s as D,t as O}from"./backend-form-modal-DxisQV_6.js";import{a as k,r as A,t as j}from"./llm-settings-CODhjQzy.js";import{f as M,i as N,m as P,u as F}from"./agent-server-config-C_x8Otd9.js";import{n as I,t as L}from"./use-free-models-gCsJ5BV0.js";import{o as R}from"./use-onboarding-completion-Xl63ZvzQ.js";import{t as z}from"./use-tracking-j4uo9VEW.js";import{n as ee}from"./use-settings-C2KKQKVC.js";import{t as B}from"./use-save-settings-Dapkf4cC.js";import{t as te}from"./modal-backdrop-BSzNhM4r.js";import{r as ne,t as re}from"./modal-body-C24WsdFb.js";import{t as V}from"./brand-button-CUMfjb99.js";import{n as H}from"./navigation-context-CQZwH_tC.js";import{t as U}from"./openhands-logo-BS-Epajy.js";import{c as W,i as G,n as K,o as ie}from"./acp-providers-DcY_mKYa.js";import{n as ae,t as oe}from"./agent-profiles-service.api-DkeZaqIl.js";import{n as se}from"./use-create-conversation-i_PdFdIs.js";import{t as ce}from"./terminal-BUpID2wS.js";import{c as le,r as ue}from"./sidebar-onboarding-checklist-storage-TfvNNnnr.js";import{n as de}from"./sdk-section-page-CNZTLwH9.js";import{a as fe}from"./badge-ehL-kgeO.js";import{t as pe}from"./use-save-agent-profile-D-ZHHE94.js";import{n as me}from"./use-activate-agent-profile-8L8Xdghy.js";var q=e(n(),1),J=r(),he=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,ge=`0 0 100 100`,_e=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,ve=`0 0 12 12`,ye=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,be=`0 0 24 24`,xe=3/2;function Y({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,J.jsx)(U,{width:Math.round(t*xe),height:t,className:p(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ge,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:he})}):e===`codex`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ve,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:_e,fill:`currentColor`})}):e===`gemini`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:be,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:ye})}):(0,J.jsx)(ce,{width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function Se({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:p(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:p(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function Ce(e){return e===`openhands`?`openhands`:K.find(({key:t})=>t===e)?.icon??`cli-generic`}function we({id:e,muted:t}){let n=Ce(e);return n===`openhands`?(0,J.jsx)(Y,{kind:`openhands`,size:16,className:p(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(Y,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Te(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:f.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...K.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ee({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=o(`openhands`),{mutate:a,isPending:l}=B();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(f.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":i(f.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Te().map(n=>{let r=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:p(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(we,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,J.jsx)(v,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsxs)(`div`,{className:p(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,J.jsx)(V,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:l,children:i(f.ONBOARDING$BACK)}):null,(0,J.jsx)(V,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:l,onClick:()=>{let t=G(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{d(c(e)||i(f.ERROR$GENERIC))},onSuccess:()=>{s(i(f.SETTINGS$SAVED)),r()}})},children:i(l?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function De({backend:e,isConnected:t,lastError:n}){let{t:r}=o(`openhands`);if(t===!0)return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:p(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(f.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(f.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=D(r,e,{isConnected:t,lastError:n});return(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(g,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(f.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(T,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(f.ONBOARDING$BACKEND_CHECKING)})]})}function Oe({onBack:e,onNext:t,onClose:n}){let{t:r}=o(`openhands`),{active:i,addBackend:a,setActive:s,updateBackend:c}=u(),{trackBackendAdded:l}=z(),{backend:d}=i,g=m(d),_=F(),v=_!==null&&!g&&!(d.kind===`cloud`&&P(d.host,_)),y=g||v,b=q.useMemo(()=>N(),[]),x=y?{id:`onboarding-local-backend-draft`,name:h,host:b.baseUrl,apiKey:b.sessionApiKey,kind:`local`}:d,S=R(g?[]:[d]),C=y?null:S[d.id]?.isConnected??null,w=y?null:S[d.id]?.lastError??null,[T,D]=q.useState(!1);q.useEffect(()=>{C===!0&&D(!1)},[C]);let k=C===!0&&!T,A=q.useCallback((e,r)=>{if(g)a(e);else{let t=e.host!==d.host;c(d.id,e),t&&i.orgId!==null&&s(d.id,null)}l({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),_!==null&&e.kind===`cloud`&&n?n():t()},[i.orgId,a,d.host,d.id,_,g,n,t,s,l,c]),j=p(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(y?_?f.ONBOARDING$LOGIN_TO_CLOUD_TITLE:f.BACKEND$ADD_TITLE:f.ONBOARDING$BACKEND_TITLE)}),y?null:(0,J.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$BACKEND_SUBTITLE)})]}),y?null:(0,J.jsx)(De,{backend:x,isConnected:C,lastError:w}),C===!0?(0,J.jsxs)(`button`,{type:`button`,onClick:()=>D(e=>!e),"aria-expanded":T,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,J.jsx)(`span`,{children:r(T?f.ONBOARDING$BACKEND_HIDE_CONFIGURATION:f.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,J.jsx)(E,{className:p(`h-4 w-4 shrink-0 text-muted transition-transform`,T&&`rotate-180`),"aria-hidden":!0})]}):null,(0,J.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:k?null:(0,J.jsx)(O,{onConnected:A,testIdRoot:`onboarding-backend`,initialManualBackend:x,requireManualApiKey:M(),manualSubmitLabel:r(f.ONBOARDING$NEXT),manualSubmittingLabel:r(f.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),k?(0,J.jsxs)(`div`,{className:j,children:[e?(0,J.jsx)(V,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(f.ONBOARDING$BACK)}):null,(0,J.jsx)(V,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(f.ONBOARDING$NEXT)})]}):null]})}var X=ae;function Z(){let e=pe(),t=me();return(0,q.useCallback)(async n=>{try{await e.mutateAsync({name:X,profile:n});let r=(await oe.getProfile(X)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}function ke({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{backend:r}=l(),i=r.kind===`local`,a=A(),s=k(),c=Z(),u=L(),d=I(),p=u??`openai/gpt-5.6-sol`,[m,h]=q.useState(null),[g,_]=q.useState(!1),v=q.useCallback(async()=>{if(!i||!m)return null;let e=m.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,o=fe(t),c={model:t};n&&(c.api_key=n),r&&(c.base_url=r);try{return await a.mutateAsync({name:o,request:{llm:c,include_secrets:!0}}),await s.mutateAsync(o),o}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[i,m,a,s]),y=q.useCallback(async()=>{_(!0);try{let e=await v();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{_(!1),t()}},[v,c,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(f.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(f.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:d?(0,J.jsx)(j,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":p},onSaveSuccess:y,onSaveControlChange:h}):(0,J.jsx)(de,{})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:!d||(m?.isSaving??!1)||g,onClick:()=>{if(m?.isDirty){m.save();return}t()},children:n(f.ONBOARDING$NEXT)})]})]})}function Ae({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:i}=o(`openhands`),a=l(),{status:s,isChecking:c}=S(e,{enabled:t}),{fields:u,values:d,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,credentialsConfigured:_,consumesFileCredentials:v,save:y,isSaving:T}=w(e),E=Z(),D=W(e)??e,O=s===`authenticated`,k=je(a.backend.kind,s),A=O||u.some(e=>e.secret&&(!e.multiline||v)&&h(e.name)),j=k&&!A,M=T||j||c&&!A;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(f.ONBOARDING$ACP_SECRETS_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:D})}),k&&!O?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:D})}):s!==`authenticated`&&(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,J.jsx)(x,{status:s,isChecking:c,credentialsConfigured:_,providerName:D,testIdPrefix:`onboarding-acp-auth`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-5`,children:u.map(e=>(0,J.jsx)(C,{field:e,value:d[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,J.jsx)(b,{conflicts:g}),j?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:i(f.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:T,children:i(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:M,onClick:async()=>{await y()&&(e!==`openhands`&&await E({agent_kind:`acp`,acp_server:e,acp_model:ie(e)??void 0}),r())},children:i(T?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function je(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Me({onBack:e,onClose:t,onLaunched:n}){let{t:r}=o(`openhands`),{navigate:s}=H(),{backend:c}=l(),u=c.kind!==`cloud`,d=r(f.ONBOARDING$HELLO_DEFAULT_MESSAGE),[p,m]=q.useState(d),{mutate:h,isPending:g,isSuccess:v}=se(),y=i(),b=g||v||y,x=q.useRef(!1),S=p.trim().length>0&&!b&&!x.current,C=()=>{!S||x.current||(x.current=!0,h({query:p.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{s(`/conversations/${e.conversation_id}`),n()},onError:()=>{x.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(f.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),C()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,J.jsx)(`div`,{className:`relative w-full`,children:(0,J.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(f.ONBOARDING$HELLO_TITLE),type:`text`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},placeholder:d,disabled:b,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,J.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,J.jsx)(_,{buttonClassName:``,handleSubmit:C,disabled:!S})})]}),u?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,J.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(f.LANDING$OR)}),(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(a,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:b,children:r(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:b,children:r(f.BUTTON$CLOSE)})]})]})}var Ne=t({OnboardingModal:()=>Ie}),Q=[`backend`,`agent`,`setup`,`hello`],Pe=[`agent`,`setup`,`hello`],Fe=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:p(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ie({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=o(`openhands`),{data:i}=ee(),a=i?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:c,trackOnboardingCompleted:l,trackOnboardingSkipped:d}=z(),{active:h}=u(),{backend:g}=h,_=m(g),v=R(_?[]:[g]),y=F(),b=y!==null&&g.kind===`cloud`&&P(g.host,y),x=!_&&v[g.id]?.isConnected===!0&&(y===null||b),S=x?Pe:Q,[C,w]=q.useState(()=>Q[Math.min(Math.max(t,0),Q.length-1)]),[T,E]=q.useState(`openhands`),[D,O]=q.useState(()=>ue());q.useEffect(()=>{S.includes(C)||w(S[0])},[C,S]);let k=S.length,A=S.includes(C)?C:S[0],j=S.indexOf(A),M=e=>{let t=e.target.checked;O(t),le(t)},N=_||v[g.id]?.isConnected!==void 0,I=T===`openhands`,L=j===0&&F()!==null,B=q.useCallback(()=>{w(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=q.useCallback(()=>{w(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=q.useRef(!1);q.useEffect(()=>{n||!a||H.current||window.sessionStorage.getItem(Fe)||(H.current=!0,window.sessionStorage.setItem(Fe,`1`),s())},[n,a]);let U=q.useRef(null);q.useEffect(()=>{n||!a||!N||U.current!==A&&(U.current=A,c({step:A,stepIndex:j,totalSteps:k,agent:T}))},[n,a,N,A,j,k,T]);let W=()=>{l({agent:T}),e()},G=()=>{d({step:A,stepIndex:j,totalSteps:k,agent:T}),e()};return(0,J.jsx)(te,{"aria-label":r(f.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":j,"data-preview":n?`true`:void 0,className:p(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,ne(`lg`),re,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(Se,{currentStep:j,totalSteps:k})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`min-h-0 overflow-y-auto custom-scrollbar-always px-7 pb-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":j,className:`relative overflow-clip`,children:[x?null:(0,J.jsx)($,{index:S.indexOf(`backend`),currentStep:j,children:(0,J.jsx)(Oe,{onNext:B,onClose:e})}),(0,J.jsx)($,{index:S.indexOf(`agent`),currentStep:j,children:(0,J.jsx)(Ee,{selectedAgentId:T,onSelect:E,onBack:x?void 0:V,onNext:B})}),(0,J.jsx)($,{index:S.indexOf(`setup`),currentStep:j,children:I?(0,J.jsx)(ke,{onBack:V,onNext:B}):(0,J.jsx)(Ae,{providerKey:T,isActive:A===`setup`,onBack:V,onNext:B})}),(0,J.jsx)($,{index:S.indexOf(`hello`),currentStep:j,children:(0,J.jsx)(Me,{onBack:V,onClose:G,onLaunched:W})})]})})]}),j<k-1&&!L?(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:G,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(f.ONBOARDING$SKIP)}):null,A===`hello`?(0,J.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,J.jsx)(`input`,{"data-testid":`onboarding-skip-getting-started-checklist`,type:`checkbox`,checked:D,onChange:M,className:`size-4 cursor-pointer`}),r(f.ONBOARDING$SKIP_GETTING_STARTED_CHECKLIST)]}):null]})})}export{Ne as n,Y as r,Ie as t};
1
+ import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,yt as r}from"./vendor-styling-Ck5D_A2Q.js";import{i,t as a}from"./recommended-automations-launcher-D1Do753p.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{ct as s,dt as c,n as l,r as u,st as d}from"./active-backend-context-BETEdaJl.js";import{K as f,t as p}from"./utils-CbjwNcR-.js";import{p as m,v as h}from"./agent-server-client-options-EHB23gyx.js";import{c as g}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{t as _}from"./chat-send-button-B6aVaD9V.js";import{t as v}from"./check-Bo8s5Ylg.js";import{t as y}from"./circle-check-5pH3qCji.js";import{a as b,i as x,n as S,r as C,t as w}from"./use-acp-credential-form-GfqcTJl5.js";import{t as T}from"./loader-circle-BxJgk73D.js";import{c as E,s as D,t as O}from"./backend-form-modal-DzYf_arO.js";import{a as k,r as A,t as j}from"./llm-settings-CUgt39uu.js";import{f as M,i as N,m as P,u as F}from"./agent-server-config-C_x8Otd9.js";import{n as I,t as L}from"./use-free-models-FAk2nngq.js";import{o as R}from"./use-onboarding-completion-C4W-m2Jk.js";import{t as z}from"./use-tracking-BAFpgpgq.js";import{n as ee}from"./use-settings-D69cw06D.js";import{t as B}from"./use-save-settings-CmX41wlf.js";import{t as te}from"./modal-backdrop-BSzNhM4r.js";import{r as ne,t as re}from"./modal-body-B_95ci1c.js";import{t as V}from"./brand-button-CGUwj6zK.js";import{n as H}from"./navigation-context-CQZwH_tC.js";import{t as U}from"./openhands-logo-BS-Epajy.js";import{c as W,i as G,n as K,o as ie}from"./acp-providers-DOKcGeaV.js";import{n as ae,t as oe}from"./agent-profiles-service.api-CiMVQAIT.js";import{n as se}from"./use-create-conversation-D15Px574.js";import{t as ce}from"./terminal-BUpID2wS.js";import{c as le,r as ue}from"./sidebar-onboarding-checklist-storage-_zxMqHS0.js";import{n as de}from"./sdk-section-page-DCoI2dtd.js";import{a as fe}from"./badge-CDHZEVeN.js";import{t as pe}from"./use-save-agent-profile-xpHBxMZM.js";import{n as me}from"./use-activate-agent-profile-DO6SNPkK.js";var q=e(n(),1),J=r(),he=`m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z`,ge=`0 0 100 100`,_e=`M4.04286 0.228393C4.52451 0.0304495 5.0488 -0.0409817 5.56586 0.0208928C6.23236 0.0973928 6.82636 0.380893 7.34786 0.870893C7.35488 0.877545 7.36344 0.882351 7.37278 0.884881C7.38212 0.887412 7.39194 0.887588 7.40136 0.885393C8.10536 0.712393 8.78236 0.773393 9.43186 1.06839L9.46336 1.08339L9.54036 1.12139C10.2189 1.47289 10.7054 2.00639 10.9994 2.72039C11.1384 3.05989 11.2084 3.41439 11.2099 3.78339C11.2197 4.05816 11.1893 4.33288 11.1199 4.59889C11.1164 4.61245 11.1165 4.62665 11.12 4.6402C11.1235 4.65374 11.1303 4.66618 11.1399 4.67639C11.5329 5.0749 11.8063 5.57572 11.9289 6.12189C12.1214 7.07239 11.9239 7.92939 11.3374 8.69189L11.2464 8.80189C10.8579 9.24669 10.3481 9.56836 9.77936 9.72739C9.76694 9.73097 9.75556 9.73747 9.74617 9.74634C9.73677 9.75521 9.72964 9.7662 9.72536 9.77839C9.59786 10.1464 9.46986 10.4604 9.23186 10.7744C8.63236 11.5654 7.75086 12.0054 6.75786 11.9999C5.96636 11.9959 5.26486 11.7064 4.65286 11.1319C4.64358 11.1234 4.63225 11.1174 4.61998 11.1146C4.6077 11.1118 4.59491 11.1123 4.58286 11.1159C4.32386 11.1994 4.06286 11.2114 3.78086 11.2084C3.33033 11.2048 2.88658 11.0984 2.48336 10.8974C2.0613 10.688 1.6939 10.3831 1.41036 10.0069C1.30886 9.87239 1.20836 9.74589 1.13486 9.59639C1.03349 9.39033 0.95066 9.17565 0.887357 8.95489C0.754446 8.45324 0.751521 7.92599 0.878857 7.42289C0.882974 7.41102 0.884341 7.39837 0.882857 7.38589C0.88038 7.37348 0.873877 7.36223 0.864357 7.35389C0.556147 7.04213 0.320543 6.66619 0.174357 6.25289C0.0775698 5.99842 0.0213841 5.73031 0.00785682 5.45839C-0.0163229 5.10033 0.0153902 4.74069 0.101857 4.39239C0.326857 3.65039 0.756357 3.06839 1.39036 2.64589C1.53136 2.55189 1.66536 2.47889 1.79136 2.42689C1.93436 2.36689 2.07786 2.31689 2.22186 2.27489C2.23216 2.27184 2.24153 2.26626 2.24913 2.25866C2.25672 2.25107 2.2623 2.24169 2.26536 2.23139C2.37455 1.83888 2.56235 1.47264 2.81736 1.15489C3.15736 0.731893 3.56586 0.422893 4.04286 0.228393ZM3.64086 4.15339C3.58503 4.05573 3.49269 3.98424 3.38415 3.95465C3.27562 3.92507 3.15977 3.93981 3.06211 3.99564C2.96444 4.05147 2.89295 4.14381 2.86337 4.25235C2.83378 4.36088 2.84853 4.47673 2.90436 4.57439L3.75136 6.05689L2.90736 7.48089C2.85561 7.57738 2.84315 7.69014 2.87257 7.7956C2.902 7.90106 2.97104 7.99108 3.06526 8.04684C3.15949 8.1026 3.27162 8.1198 3.37823 8.09484C3.48484 8.06988 3.57768 8.00469 3.63736 7.91289L4.60736 6.27689C4.64561 6.21237 4.66609 6.13887 4.66671 6.06386C4.66732 5.98886 4.64805 5.91503 4.61086 5.84989L3.64086 4.15339ZM6.36386 7.27339C6.25583 7.27982 6.15434 7.32727 6.08012 7.40603C6.00591 7.48479 5.96458 7.58892 5.96458 7.69714C5.96458 7.80536 6.00591 7.90949 6.08012 7.98826C6.15434 8.06702 6.25583 8.11446 6.36386 8.12089H8.78786C8.89675 8.1156 8.99943 8.06862 9.07462 7.98969C9.14982 7.91075 9.19176 7.80591 9.19176 7.69689C9.19176 7.58787 9.14982 7.48303 9.07462 7.4041C8.99943 7.32516 8.89675 7.27818 8.78786 7.27289H6.36386V7.27339Z`,ve=`0 0 12 12`,ye=`M12 0C12.904 6.056 17.944 11.096 24 12C17.944 12.904 12.904 17.944 12 24C11.096 17.944 6.056 12.904 0 12C6.056 11.096 11.096 6.056 12 0Z`,be=`0 0 24 24`,xe=3/2;function Y({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,J.jsx)(U,{width:Math.round(t*xe),height:t,className:p(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ge,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:he})}):e===`codex`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:ve,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:_e,fill:`currentColor`})}):e===`gemini`?(0,J.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:be,width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,J.jsx)(`path`,{fill:`currentColor`,d:ye})}):(0,J.jsx)(ce,{width:t,height:t,className:p(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function Se({currentStep:e,totalSteps:t,className:n}){return(0,J.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:p(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,J.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:p(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function Ce(e){return e===`openhands`?`openhands`:K.find(({key:t})=>t===e)?.icon??`cli-generic`}function we({id:e,muted:t}){let n=Ce(e);return n===`openhands`?(0,J.jsx)(Y,{kind:`openhands`,size:16,className:p(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,J.jsx)(Y,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Te(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:f.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...K.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ee({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:i}=o(`openhands`),{mutate:a,isPending:l}=B();return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(f.ONBOARDING$AGENT_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$AGENT_SUBTITLE)})]}),(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":i(f.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Te().map(n=>{let r=n.id===e;return(0,J.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:p(`flex items-start justify-between gap-4 rounded-xl border px-4 py-3 text-left transition-colors cursor-pointer`,r?`border-white/45 bg-white/[0.09] shadow-none hover:border-white/45 hover:bg-white/[0.09]`:`border-white/30 bg-white/5 hover:border-white/40 hover:bg-white/[0.08]`),children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(we,{id:n.id,muted:!1}),(0,J.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,J.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:i(n.descriptionKey)})]}),(0,J.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,J.jsx)(v,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,J.jsxs)(`div`,{className:p(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,J.jsx)(V,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:l,children:i(f.ONBOARDING$BACK)}):null,(0,J.jsx)(V,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:l,onClick:()=>{let t=G(e);if(!t){r();return}a({agent_settings_diff:t},{onError:e=>{d(c(e)||i(f.ERROR$GENERIC))},onSuccess:()=>{s(i(f.SETTINGS$SAVED)),r()}})},children:i(l?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function De({backend:e,isConnected:t,lastError:n}){let{t:r}=o(`openhands`);if(t===!0)return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:p(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,J.jsx)(y,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(f.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,J.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(f.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=D(r,e,{isConnected:t,lastError:n});return(0,J.jsxs)(`div`,{role:`alert`,"data-testid":`onboarding-backend-disconnected`,className:`flex items-start gap-3 rounded-xl border border-red-500/40 bg-red-500/10 px-4 py-3`,children:[(0,J.jsx)(g,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,J.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,J.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(f.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,J.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-checking`,className:`flex items-start gap-3 rounded-xl border border-white/10 bg-white/5 px-4 py-3`,children:[(0,J.jsx)(T,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,J.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(f.ONBOARDING$BACKEND_CHECKING)})]})}function Oe({onBack:e,onNext:t,onClose:n}){let{t:r}=o(`openhands`),{active:i,addBackend:a,setActive:s,updateBackend:c}=u(),{trackBackendAdded:l}=z(),{backend:d}=i,g=m(d),_=F(),v=_!==null&&!g&&!(d.kind===`cloud`&&P(d.host,_)),y=g||v,b=q.useMemo(()=>N(),[]),x=y?{id:`onboarding-local-backend-draft`,name:h,host:b.baseUrl,apiKey:b.sessionApiKey,kind:`local`}:d,S=R(g?[]:[d]),C=y?null:S[d.id]?.isConnected??null,w=y?null:S[d.id]?.lastError??null,[T,D]=q.useState(!1);q.useEffect(()=>{C===!0&&D(!1)},[C]);let k=C===!0&&!T,A=q.useCallback((e,r)=>{if(g)a(e);else{let t=e.host!==d.host;c(d.id,e),t&&i.orgId!==null&&s(d.id,null)}l({backendKind:e.kind,connectionMethod:r,hasApiKey:!!e.apiKey,source:`onboarding`}),_!==null&&e.kind===`cloud`&&n?n():t()},[i.orgId,a,d.host,d.id,_,g,n,t,s,l,c]),j=p(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(y?_?f.ONBOARDING$LOGIN_TO_CLOUD_TITLE:f.BACKEND$ADD_TITLE:f.ONBOARDING$BACKEND_TITLE)}),y?null:(0,J.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$BACKEND_SUBTITLE)})]}),y?null:(0,J.jsx)(De,{backend:x,isConnected:C,lastError:w}),C===!0?(0,J.jsxs)(`button`,{type:`button`,onClick:()=>D(e=>!e),"aria-expanded":T,"data-testid":`onboarding-backend-show-configuration`,className:`flex w-full cursor-pointer items-center justify-center gap-1 text-center text-xs text-[var(--oh-muted)] transition-colors hover:text-content-2`,children:[(0,J.jsx)(`span`,{children:r(T?f.ONBOARDING$BACKEND_HIDE_CONFIGURATION:f.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,J.jsx)(E,{className:p(`h-4 w-4 shrink-0 text-muted transition-transform`,T&&`rotate-180`),"aria-hidden":!0})]}):null,(0,J.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:k?null:(0,J.jsx)(O,{onConnected:A,testIdRoot:`onboarding-backend`,initialManualBackend:x,requireManualApiKey:M(),manualSubmitLabel:r(f.ONBOARDING$NEXT),manualSubmittingLabel:r(f.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`,analyticsSource:`onboarding`})}),k?(0,J.jsxs)(`div`,{className:j,children:[e?(0,J.jsx)(V,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(f.ONBOARDING$BACK)}):null,(0,J.jsx)(V,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(f.ONBOARDING$NEXT)})]}):null]})}var X=ae;function Z(){let e=pe(),t=me();return(0,q.useCallback)(async n=>{try{await e.mutateAsync({name:X,profile:n});let r=(await oe.getProfile(X)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}function ke({onBack:e,onNext:t}){let{t:n}=o(`openhands`),{backend:r}=l(),i=r.kind===`local`,a=A(),s=k(),c=Z(),u=L(),d=I(),p=u??`openai/gpt-5.6-sol`,[m,h]=q.useState(null),[g,_]=q.useState(!1),v=q.useCallback(async()=>{if(!i||!m)return null;let e=m.values,t=typeof e[`llm.model`]==`string`?e[`llm.model`]:``;if(!t)return null;let n=typeof e[`llm.api_key`]==`string`?e[`llm.api_key`]:``,r=typeof e[`llm.base_url`]==`string`?e[`llm.base_url`]:``,o=fe(t),c={model:t};n&&(c.api_key=n),r&&(c.base_url=r);try{return await a.mutateAsync({name:o,request:{llm:c,include_secrets:!0}}),await s.mutateAsync(o),o}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[i,m,a,s]),y=q.useCallback(async()=>{_(!0);try{let e=await v();e&&await c({agent_kind:`openhands`,llm_profile_ref:e})}finally{_(!1),t()}},[v,c,t]);return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(f.ONBOARDING$LLM_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(f.ONBOARDING$LLM_SUBTITLE)})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:d?(0,J.jsx)(j,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":p},onSaveSuccess:y,onSaveControlChange:h}):(0,J.jsx)(de,{})}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:!d||(m?.isSaving??!1)||g,onClick:()=>{if(m?.isDirty){m.save();return}t()},children:n(f.ONBOARDING$NEXT)})]})]})}function Ae({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:i}=o(`openhands`),a=l(),{status:s,isChecking:c}=S(e,{enabled:t}),{fields:u,values:d,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,credentialsConfigured:_,consumesFileCredentials:v,save:y,isSaving:T}=w(e),E=Z(),D=W(e)??e,O=s===`authenticated`,k=je(a.backend.kind,s),A=O||u.some(e=>e.secret&&(!e.multiline||v)&&h(e.name)),j=k&&!A,M=T||j||c&&!A;return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,J.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:i(f.ONBOARDING$ACP_SECRETS_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:D})}),k&&!O?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:D})}):s!==`authenticated`&&(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:i(f.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,J.jsx)(x,{status:s,isChecking:c,credentialsConfigured:_,providerName:D,testIdPrefix:`onboarding-acp-auth`}),(0,J.jsx)(`div`,{className:`flex flex-col gap-5`,children:u.map(e=>(0,J.jsx)(C,{field:e,value:d[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,J.jsx)(b,{conflicts:g}),j?(0,J.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:i(f.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:T,children:i(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:M,onClick:async()=>{await y()&&(e!==`openhands`&&await E({agent_kind:`acp`,acp_server:e,acp_model:ie(e)??void 0}),r())},children:i(T?f.SETTINGS$SAVING:f.ONBOARDING$NEXT)})]})]})}function je(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Me({onBack:e,onClose:t,onLaunched:n}){let{t:r}=o(`openhands`),{navigate:s}=H(),{backend:c}=l(),u=c.kind!==`cloud`,d=r(f.ONBOARDING$HELLO_DEFAULT_MESSAGE),[p,m]=q.useState(d),{mutate:h,isPending:g,isSuccess:v}=se(),y=i(),b=g||v||y,x=q.useRef(!1),S=p.trim().length>0&&!b&&!x.current,C=()=>{!S||x.current||(x.current=!0,h({query:p.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{s(`/conversations/${e.conversation_id}`),n()},onError:()=>{x.current=!1}}))};return(0,J.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,J.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(f.ONBOARDING$HELLO_TITLE)}),(0,J.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(f.ONBOARDING$HELLO_SUBTITLE)})]}),(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),C()},"data-testid":`onboarding-hello-input-form`,className:`mt-6 box-border flex w-full shrink-0 flex-col items-start justify-center rounded-[15px] border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,J.jsx)(`div`,{className:`relative w-full`,children:(0,J.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,J.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(f.ONBOARDING$HELLO_TITLE),type:`text`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),C())},placeholder:d,disabled:b,className:`min-h-[20px] w-full flex-1 bg-transparent text-[16px] font-normal leading-[20px] text-white outline-none placeholder:text-[var(--oh-text-tertiary)] disabled:cursor-not-allowed disabled:opacity-50`})})}),(0,J.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,J.jsx)(_,{buttonClassName:``,handleSubmit:C,disabled:!S})})]}),u?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,J.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(f.LANDING$OR)}),(0,J.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,J.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,J.jsx)(a,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,J.jsx)(V,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:b,children:r(f.ONBOARDING$BACK)}),(0,J.jsx)(V,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:b,children:r(f.BUTTON$CLOSE)})]})]})}var Ne=t({OnboardingModal:()=>Ie}),Q=[`backend`,`agent`,`setup`,`hello`],Pe=[`agent`,`setup`,`hello`],Fe=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,J.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:p(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ie({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=o(`openhands`),{data:i}=ee(),a=i?.user_consents_to_analytics===!0,{trackOnboardingStarted:s,trackOnboardingStepViewed:c,trackOnboardingCompleted:l,trackOnboardingSkipped:d}=z(),{active:h}=u(),{backend:g}=h,_=m(g),v=R(_?[]:[g]),y=F(),b=y!==null&&g.kind===`cloud`&&P(g.host,y),x=!_&&v[g.id]?.isConnected===!0&&(y===null||b),S=x?Pe:Q,[C,w]=q.useState(()=>Q[Math.min(Math.max(t,0),Q.length-1)]),[T,E]=q.useState(`openhands`),[D,O]=q.useState(()=>ue());q.useEffect(()=>{S.includes(C)||w(S[0])},[C,S]);let k=S.length,A=S.includes(C)?C:S[0],j=S.indexOf(A),M=e=>{let t=e.target.checked;O(t),le(t)},N=_||v[g.id]?.isConnected!==void 0,I=T===`openhands`,L=j===0&&F()!==null,B=q.useCallback(()=>{w(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=q.useCallback(()=>{w(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=q.useRef(!1);q.useEffect(()=>{n||!a||H.current||window.sessionStorage.getItem(Fe)||(H.current=!0,window.sessionStorage.setItem(Fe,`1`),s())},[n,a]);let U=q.useRef(null);q.useEffect(()=>{n||!a||!N||U.current!==A&&(U.current=A,c({step:A,stepIndex:j,totalSteps:k,agent:T}))},[n,a,N,A,j,k,T]);let W=()=>{l({agent:T}),e()},G=()=>{d({step:A,stepIndex:j,totalSteps:k,agent:T}),e()};return(0,J.jsx)(te,{"aria-label":r(f.ONBOARDING$TITLE),children:(0,J.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,J.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":j,"data-preview":n?`true`:void 0,className:p(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,ne(`lg`),re,`max-h-[90vh]`),children:[(0,J.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,J.jsx)(Se,{currentStep:j,totalSteps:k})}),(0,J.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`min-h-0 overflow-y-auto custom-scrollbar-always px-7 pb-7`,children:(0,J.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":j,className:`relative overflow-clip`,children:[x?null:(0,J.jsx)($,{index:S.indexOf(`backend`),currentStep:j,children:(0,J.jsx)(Oe,{onNext:B,onClose:e})}),(0,J.jsx)($,{index:S.indexOf(`agent`),currentStep:j,children:(0,J.jsx)(Ee,{selectedAgentId:T,onSelect:E,onBack:x?void 0:V,onNext:B})}),(0,J.jsx)($,{index:S.indexOf(`setup`),currentStep:j,children:I?(0,J.jsx)(ke,{onBack:V,onNext:B}):(0,J.jsx)(Ae,{providerKey:T,isActive:A===`setup`,onBack:V,onNext:B})}),(0,J.jsx)($,{index:S.indexOf(`hello`),currentStep:j,children:(0,J.jsx)(Me,{onBack:V,onClose:G,onLaunched:W})})]})})]}),j<k-1&&!L?(0,J.jsx)(`button`,{type:`button`,"data-testid":`onboarding-skip`,onClick:G,className:`rounded-md px-3 py-2 text-sm text-[var(--oh-muted)] transition-colors hover:bg-white/5 hover:text-white cursor-pointer`,children:r(f.ONBOARDING$SKIP)}):null,A===`hello`?(0,J.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-sm text-[var(--oh-muted)]`,children:[(0,J.jsx)(`input`,{"data-testid":`onboarding-skip-getting-started-checklist`,type:`checkbox`,checked:D,onChange:M,className:`size-4 cursor-pointer`}),r(f.ONBOARDING$SKIP_GETTING_STARTED_CHECKLIST)]}):null]})})}export{Ne as n,Y as r,Ie as t};
@@ -1 +1 @@
1
- import{c as e}from"./agent-server-client-options-EHB23gyx.js";import{w as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as n}from"./proxy-XP6U1Dhv.js";import"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(t){if(t)return t;let n=e().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(e){let r=i(e);try{return{orgId:(await n({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(e instanceof t&&e.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function s(e,t){let r=await n({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}async function c(e,t,r){return n({backend:i(r),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`})}export{o as i,c as n,a as r,s as t};
1
+ import{c as e}from"./agent-server-client-options-EHB23gyx.js";import{T as t}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";import{t as n}from"./proxy-BCCQUna8.js";import"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-BBfdJIV9.js";function r(e){return{items:e?.items??[],currentOrgId:e?.current_org_id??null}}function i(t){if(t)return t;let n=e().backend;if(n.kind!==`cloud`)throw Error(`Cloud organization calls require a cloud backend. Active backend is local.`);return n}async function a(e){return r(await n({backend:i(e),method:`GET`,path:`/api/organizations`}))}async function o(e){let r=i(e);try{return{orgId:(await n({backend:r,method:`GET`,path:`/api/keys/current`}))?.org_id??null,isLegacyKey:!1}}catch(e){if(e instanceof t&&e.status===400)return{orgId:null,isLegacyKey:!0};throw e}}async function s(e,t){let r=await n({backend:i(t),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/me`});return{orgId:r?.org_id??e,userId:r?.user_id??``,role:r?.role??null,permissions:Array.isArray(r?.permissions)?r.permissions:null}}async function c(e,t,r){return n({backend:i(r),method:`GET`,path:`/api/organizations/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`})}export{o as i,c as n,a as r,s as t};
@@ -0,0 +1 @@
1
+ var e={"github.com":`github`,"gitlab.com":`gitlab`,"bitbucket.org":`bitbucket`,"dev.azure.com":`azure_devops`},t={"ssh.dev.azure.com":`dev.azure.com`,"vs-ssh.visualstudio.com":`dev.azure.com`};function n(e){let n=e.toLowerCase();return Object.hasOwn(t,n)?t[n]:e}function r(e){return e.replace(/\.git$/,``)}function i(t){return t?e[t.toLowerCase()]??null:null}function a(e){let t=e.split(`/`).filter(Boolean),n=t.indexOf(`_git`);return n===-1?(t[0]===`v3`&&t.shift(),t.join(`/`)):[...t.slice(0,n),...t.slice(n+1)].join(`/`)}function o(e,t,o){let s=t&&n(t),c=r(o.replace(/^\/+|\/+$/g,``)),l=i(s);return{url:e,host:s,repository:(l===`azure_devops`?a(c):c)||null,provider:l}}function s(e){let t=e?.trim();if(!t)return null;try{let e=new URL(t);if(e.hostname)return o(t,e.hostname,e.pathname)}catch{}let n=t.match(/^[^@\s]+@([^:\s]+):(.+)$/);if(n){let e=n[1];return o(t,e,n[2])}return null}export{s as t};
@@ -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}from"./utils-BgLSZdyy.js";import{E as a,d as o}from"./messages-Bk1xhbU2.js";import{t as s}from"./list-todo-Caa8E1X_.js";import{t as c}from"./brand-button-CUMfjb99.js";import{t as l}from"./conversation-store-DC-JlJuq.js";import{N as u}from"./llm-not-configured-banner-Dh_ajcM8.js";import{_ as d,t as f,tt as p}from"./markdown-renderer-DyFl9-mL.js";import{t as m}from"./conversation-tab-empty-state-B3dpJXX0.js";var h=e(t(),1),g=n();function _(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:_,scrollDomToBottom:v}=a(h.useRef(null)),{planContent:y,conversationMode:b,localPlanningConversationId:x,setPlanContent:S}=l(),{data:C}=p(),{mutate:w}=d();h.useEffect(()=>{let e=x??C?.id;!e||y!==null||w({conversationId:e},{onSuccess:e=>{S(e)},onError:()=>{}})},[C?.id,x,y,w,S]),h.useEffect(()=>{_&&v()},[y,_,v]);let T=b===`plan`,{handlePlanClick:E,hasPlanner:D,isCreatingConversation:O}=u();return y==null?(0,g.jsx)(m,{icon:(0,g.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,g.jsx)(c,{type:`button`,variant:`secondary`,onClick:E,isDisabled:T||O||D,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,g.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,g.jsx)(f,{includeStandard:!0,components:o,children:y})})}export{_ 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{K as i}from"./utils-CbjwNcR-.js";import{E as a,d as o}from"./messages-WUb9Yh-p.js";import{t as s}from"./list-todo-Caa8E1X_.js";import{t as c}from"./brand-button-CGUwj6zK.js";import{t as l}from"./conversation-store-DC-JlJuq.js";import{N as u}from"./llm-not-configured-banner-BdjItKQR.js";import{_ as d,t as f,tt as p}from"./markdown-renderer-DRpwRlNm.js";import{t as m}from"./conversation-tab-empty-state-BT1GrnKP.js";var h=e(t(),1),g=n();function _(){let{t:e}=r(`openhands`),{scrollRef:t,onChatBodyScroll:n,autoScroll:_,scrollDomToBottom:v}=a(h.useRef(null)),{planContent:y,conversationMode:b,localPlanningConversationId:x,setPlanContent:S}=l(),{data:C}=p(),{mutate:w}=d();h.useEffect(()=>{let e=x??C?.id;!e||y!==null||w({conversationId:e},{onSuccess:e=>{S(e)},onError:()=>{}})},[C?.id,x,y,w,S]),h.useEffect(()=>{_&&v()},[y,_,v]);let T=b===`plan`,{handlePlanClick:E,hasPlanner:D,isCreatingConversation:O}=u();return y==null?(0,g.jsx)(m,{icon:(0,g.jsx)(s,{"aria-hidden":!0,strokeWidth:2,className:`size-full`}),action:(0,g.jsx)(c,{type:`button`,variant:`secondary`,onClick:E,isDisabled:T||O||D,className:`min-w-40 justify-center px-6`,children:e(i.COMMON$CREATE_A_PLAN)}),children:e(i.PLANNER$EMPTY_MESSAGE)}):(0,g.jsx)(`div`,{ref:t,onScroll:e=>n(e.currentTarget),className:`flex flex-col w-full h-full p-4 overflow-auto`,children:(0,g.jsx)(f,{includeStandard:!0,components:o,children:y})})}export{_ as default};
@@ -1 +1 @@
1
- import{c as e,n as t}from"./agent-server-client-options-EHB23gyx.js";import{u as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";function r(){return e().backend.kind===`cloud`}function i(){return new n(t())}var a=class{static async listInstalledPlugins(){if(r())return[];try{return(await i().listInstalledPlugins()).plugins??[]}catch{return[]}}static async installPlugin(e){if(r())throw Error(`Installing plugins is only available on a local backend.`);return i().installPlugin(e)}static async setPluginEnabled(e,t){if(r())throw Error(`Enabling and disabling plugins is only available on a local backend.`);return i().setPluginEnabled(e,t)}static async uninstallPlugin(e){if(r())throw Error(`Uninstalling plugins is only available on a local backend.`);return i().uninstallPlugin(e)}static async refreshPlugin(e){if(r())throw Error(`Refreshing plugins is only available on a local backend.`);return i().refreshPlugin(e)}};export{a as t};
1
+ import{c as e,n as t}from"./agent-server-client-options-EHB23gyx.js";import{u as n}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";function r(){return e().backend.kind===`cloud`}function i(){return new n(t())}var a=class{static async listInstalledPlugins(){if(r())return[];try{return(await i().listInstalledPlugins()).plugins??[]}catch{return[]}}static async installPlugin(e){if(r())throw Error(`Installing plugins is only available on a local backend.`);return i().installPlugin(e)}static async setPluginEnabled(e,t){if(r())throw Error(`Enabling and disabling plugins is only available on a local backend.`);return i().setPluginEnabled(e,t)}static async uninstallPlugin(e){if(r())throw Error(`Uninstalling plugins is only available on a local backend.`);return i().uninstallPlugin(e)}static async refreshPlugin(e){if(r())throw Error(`Refreshing plugins is only available on a local backend.`);return i().refreshPlugin(e)}};export{a as t};
@@ -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{p as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as i}from"./proxy-XP6U1Dhv.js";var a=`/api/v1/settings/profiles`;function o(){let{backend:e,orgId:n}=t();if(e.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:e,base:n?`/api/organizations/${encodeURIComponent(n)}/profiles`:a}}async function s(){let{backend:e,base:t}=o();return i({backend:e,method:`GET`,path:t})}async function c(e){let{backend:t,base:n}=o(),r=await i({backend:t,method:`GET`,path:`${n}/${encodeURIComponent(e)}`});return{name:r.name,config:r.config??r.llm??{},api_key_set:r.api_key_set??!1}}async function l(e,t){let{backend:n,base:r}=o();return i({backend:n,method:`POST`,path:`${r}/${encodeURIComponent(e)}`,body:t})}async function u(e){let{backend:t,base:n}=o();return i({backend:t,method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function d(e,t){let{backend:n,base:r}=o();return i({backend:n,method:`POST`,path:`${r}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){let{backend:t,base:n}=o(),r=await i({backend:t,method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}});return{name:r.name,message:r.message,llm_applied:r.model!=null||r.llm!=null}}var p=e({default:()=>g});function m(){return t().backend.kind===`cloud`}function h(e){if(!e||typeof e!=`object`)return!1;let t=`name`in e?e.name:void 0;if(t===`AbortError`||t===`TimeoutError`)return!0;let n=`cause`in e?e.cause:void 0;return!!n&&typeof n==`object`&&`name`in n&&(n.name===`AbortError`||n.name===`TimeoutError`)}var g=class{static async listProfiles(){return m()?s():new r(n()).listProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateProfile(e)}static async validateProfile(e,t){if(m())return null;let i=new r({...n(),timeout:3e4});try{return await i.validateProfile(e,t)}catch(e){let t=e&&typeof e==`object`&&`status`in e?e.status:void 0;if(t===404||t===429||typeof t==`number`&&t>=500||h(e))return null;throw e}finally{i.close()}}};export{p as n,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{p 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/v1/settings/profiles`;function o(){let{backend:e,orgId:n}=t();if(e.kind!==`cloud`)throw Error(`Cloud profiles call requires a cloud backend.`);return{backend:e,base:n?`/api/organizations/${encodeURIComponent(n)}/profiles`:a}}async function s(){let{backend:e,base:t}=o();return i({backend:e,method:`GET`,path:t})}async function c(e){let{backend:t,base:n}=o(),r=await i({backend:t,method:`GET`,path:`${n}/${encodeURIComponent(e)}`});return{name:r.name,config:r.config??r.llm??{},api_key_set:r.api_key_set??!1}}async function l(e,t){let{backend:n,base:r}=o();return i({backend:n,method:`POST`,path:`${r}/${encodeURIComponent(e)}`,body:t})}async function u(e){let{backend:t,base:n}=o();return i({backend:t,method:`DELETE`,path:`${n}/${encodeURIComponent(e)}`})}async function d(e,t){let{backend:n,base:r}=o();return i({backend:n,method:`POST`,path:`${r}/${encodeURIComponent(e)}/rename`,body:{new_name:t}})}async function f(e){let{backend:t,base:n}=o(),r=await i({backend:t,method:`POST`,path:`${n}/${encodeURIComponent(e)}/activate`,body:{}});return{name:r.name,message:r.message,llm_applied:r.model!=null||r.llm!=null}}var p=e({default:()=>g});function m(){return t().backend.kind===`cloud`}function h(e){if(!e||typeof e!=`object`)return!1;let t=`name`in e?e.name:void 0;if(t===`AbortError`||t===`TimeoutError`)return!0;let n=`cause`in e?e.cause:void 0;return!!n&&typeof n==`object`&&`name`in n&&(n.name===`AbortError`||n.name===`TimeoutError`)}var g=class{static async listProfiles(){return m()?s():new r(n()).listProfiles()}static async getProfile(e,t){if(m())return c(e);let i=t?{exposeSecrets:t}:{};return new r(n()).getProfile(e,i)}static async saveProfile(e,t){return m()?l(e,t):new r(n()).saveProfile(e,t)}static async deleteProfile(e){return m()?u(e):new r(n()).deleteProfile(e)}static async renameProfile(e,t){return m()?d(e,t):new r(n()).renameProfile(e,t)}static async activateProfile(e){return m()?f(e):new r(n()).activateProfile(e)}static async validateProfile(e,t){if(m())return null;let i=new r({...n(),timeout:3e4});try{return await i.validateProfile(e,t)}catch(e){let t=e&&typeof e==`object`&&`status`in e?e.status:void 0;if(t===404||t===429||typeof t==`number`&&t>=500||h(e))return null;throw e}finally{i.close()}}};export{p as n,g as t};
@@ -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"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{d as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{S as a,_ as o,_t as s,at as c,b as l,c as u,d,ht as f,m as p,mt as m,nt as h,o as g,pt as _,rt as v,s as y,t as b,x,y as S}from"./active-backend-context-BnH4-L8h.js";import{t as C}from"./utils-BgLSZdyy.js";import{i as w}from"./use-free-models-gCsJ5BV0.js";import{n as T,t as E}from"./agent-server-ui-style-scope-DdG0ZAHu.js";var D=e(t());function O({i18n:e,defaultNS:t,children:n}){let i=(0,D.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,D.createElement)(r.Provider,{value:i},n)}function k(){let e=(0,D.useSyncExternalStore)(S,d,()=>`pending`),t=(0,D.useRef)(!1);(0,D.useEffect)(()=>{t.current||(t.current=!0,x())},[]),(0,D.useEffect)(()=>{e===`granted`&&a()},[e]);let n=(0,D.useCallback)(()=>o(`granted`),[]),r=(0,D.useCallback)(()=>o(`denied`),[]),i=(0,D.useCallback)((e,t)=>{l(e,t)},[]),s=(0,D.useCallback)(()=>g(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:s}}var A=n(),j=`posthog_bootstrap`;function M(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.distinctID==`string`&&typeof t.sessionID==`string`}function N(){if(typeof window>`u`||typeof sessionStorage>`u`)return;let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`distinct_id`),n=e.get(`session_id`);if(t&&n){let e={distinctID:t,sessionID:n};try{sessionStorage.setItem(j,JSON.stringify(e))}catch{}try{window.history.replaceState(null,``,window.location.pathname+window.location.search)}catch{}return e}try{let e=sessionStorage.getItem(j);if(!e)return;sessionStorage.removeItem(j);let t=JSON.parse(e);return M(t)?t:void 0}catch{try{sessionStorage.removeItem(j)}catch{}return}}function P(){return k(),null}function F({children:e,config:t={}}){let n=D.useRef(!1),r=t!==!1,i=t===!1?void 0:t.apiKey,a=t===!1?void 0:t.apiHost,o=t===!1?void 0:t.uiHost;return D.useLayoutEffect(()=>{u(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(y(N()),!0)},[r,a,i,o]),D.useEffect(()=>{r&&p().catch(()=>{})},[r,a,i,o]),(0,A.jsxs)(A.Fragment,{children:[r?(0,A.jsx)(P,{}):null,e]})}function I({children:e,theme:t=T,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=D.useMemo(()=>({...E,...i,...r}),[r,i]);return(0,A.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,A.jsx)(`div`,{className:C(t,a,`text-foreground`),"data-theme":t,children:e})})}var L={provider:`posthog`};function R(){return w(),null}function z({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,withStyleRoot:p=!0}){let g=D.useMemo(()=>t??h(),[t]),y=D.useMemo(()=>r??m(),[r]),x=D.useRef(null);x.current||={queryClient:v(),i18n:f()},c(g),s(y),D.useEffect(()=>()=>{x.current&&(c(x.current.queryClient),s(x.current.i18n))},[]);let S=(0,A.jsxs)(F,{config:n&&n.provider===`posthog`?{apiKey:n.apiKey,apiHost:n.apiHost,uiHost:n.uiHost}:!1,children:[(0,A.jsx)(R,{}),e]});return(0,A.jsx)(O,{i18n:y,defaultNS:_,children:(0,A.jsx)(i,{client:g,children:(0,A.jsx)(b,{children:p?(0,A.jsx)(I,{className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,children:S}):S})})})}export{L as n,I as r,z as t};
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"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{d as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{S as a,_ as o,_t as s,at as c,b as l,c as u,d,ht as f,m as p,mt as m,nt as h,o as g,pt as _,rt as v,s as y,t as b,x,y as S}from"./active-backend-context-BETEdaJl.js";import{t as C}from"./utils-CbjwNcR-.js";import{i as w}from"./use-free-models-FAk2nngq.js";import{n as T,t as E}from"./agent-server-ui-style-scope-DdG0ZAHu.js";var D=e(t());function O({i18n:e,defaultNS:t,children:n}){let i=(0,D.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,D.createElement)(r.Provider,{value:i},n)}function k(){let e=(0,D.useSyncExternalStore)(S,d,()=>`pending`),t=(0,D.useRef)(!1);(0,D.useEffect)(()=>{t.current||(t.current=!0,x())},[]),(0,D.useEffect)(()=>{e===`granted`&&a()},[e]);let n=(0,D.useCallback)(()=>o(`granted`),[]),r=(0,D.useCallback)(()=>o(`denied`),[]),i=(0,D.useCallback)((e,t)=>{l(e,t)},[]),s=(0,D.useCallback)(()=>g(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:s}}var A=n(),j=`posthog_bootstrap`;function M(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.distinctID==`string`&&typeof t.sessionID==`string`}function N(){if(typeof window>`u`||typeof sessionStorage>`u`)return;let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`distinct_id`),n=e.get(`session_id`);if(t&&n){let e={distinctID:t,sessionID:n};try{sessionStorage.setItem(j,JSON.stringify(e))}catch{}try{window.history.replaceState(null,``,window.location.pathname+window.location.search)}catch{}return e}try{let e=sessionStorage.getItem(j);if(!e)return;sessionStorage.removeItem(j);let t=JSON.parse(e);return M(t)?t:void 0}catch{try{sessionStorage.removeItem(j)}catch{}return}}function P(){return k(),null}function F({children:e,config:t={}}){let n=D.useRef(!1),r=t!==!1,i=t===!1?void 0:t.apiKey,a=t===!1?void 0:t.apiHost,o=t===!1?void 0:t.uiHost;return D.useLayoutEffect(()=>{u(r?{apiKey:i,apiHost:a,uiHost:o}:!1),n.current||=(y(N()),!0)},[r,a,i,o]),D.useEffect(()=>{r&&p().catch(()=>{})},[r,a,i,o]),(0,A.jsxs)(A.Fragment,{children:[r?(0,A.jsx)(P,{}):null,e]})}function I({children:e,theme:t=T,className:n,style:r,styleOverrides:i,contentClassName:a,...o}){let s=D.useMemo(()=>({...E,...i,...r}),[r,i]);return(0,A.jsx)(`div`,{"data-agent-server-ui":``,...o,className:n,style:s,children:(0,A.jsx)(`div`,{className:C(t,a,`text-foreground`),"data-theme":t,children:e})})}var L={provider:`posthog`};function R(){return w(),null}function z({children:e,queryClient:t,analytics:n,i18n:r,className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,withStyleRoot:p=!0}){let g=D.useMemo(()=>t??h(),[t]),y=D.useMemo(()=>r??m(),[r]),x=D.useRef(null);x.current||={queryClient:v(),i18n:f()},c(g),s(y),D.useEffect(()=>()=>{x.current&&(c(x.current.queryClient),s(x.current.i18n))},[]);let S=(0,A.jsxs)(F,{config:n&&n.provider===`posthog`?{apiKey:n.apiKey,apiHost:n.apiHost,uiHost:n.uiHost}:!1,children:[(0,A.jsx)(R,{}),e]});return(0,A.jsx)(O,{i18n:y,defaultNS:_,children:(0,A.jsx)(i,{client:g,children:(0,A.jsx)(b,{children:p?(0,A.jsx)(I,{className:a,contentClassName:o,style:l,styleOverrides:u,theme:d,children:S}):S})})})}export{L as n,I as r,z as t};
@@ -1 +1 @@
1
- import{c as e,t}from"./agent-server-client-options-EHB23gyx.js";import{a as n,r}from"./agent-server-config-C_x8Otd9.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";function a(t){if(t)return t;let n=e().backend;if(n.kind!==`cloud`)throw Error(`Cloud calls require a cloud backend.`);return n}function o(t){let n=e();return n.backend.id===t.id?n.orgId:null}function s(e){let t=a(e),s=r(),c=s?n():{};return new i({host:t.host,apiKey:t.apiKey,orgId:o(t),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let n=s(e);if(!n.proxy)throw new t;return n}async function l(e){return(e.hostOverride?c(e.backend):s(e.backend)).request({method:e.method,path:e.path,body:e.body,headers:e.headers,timeoutSeconds:e.timeoutSeconds,hostOverride:e.hostOverride,authMode:e.authMode===void 0||e.authMode===`bearer`?`bearer`:e.authMode,sessionApiKey:e.sessionApiKey,responseType:e.responseType})}export{l as t};
1
+ import{c as e,t}from"./agent-server-client-options-EHB23gyx.js";import{a as n,r}from"./agent-server-config-C_x8Otd9.js";import{t as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-DvZtOcoT.js";function a(t){if(t)return t;let n=e().backend;if(n.kind!==`cloud`)throw Error(`Cloud calls require a cloud backend.`);return n}function o(t){let n=e();return n.backend.id===t.id?n.orgId:null}function s(e){let t=a(e),s=r(),c=s?n():{};return new i({host:t.host,apiKey:t.apiKey,orgId:o(t),timeout:3e4,...s?{proxy:{host:s,headers:c}}:{}})}function c(e){let n=s(e);if(!n.proxy)throw new t;return n}async function l(e){return(e.hostOverride?c(e.backend):s(e.backend)).request({method:e.method,path:e.path,body:e.body,headers:e.headers,timeoutSeconds:e.timeoutSeconds,hostOverride:e.hostOverride,authMode:e.authMode===void 0||e.authMode===`bearer`?`bearer`:e.authMode,sessionApiKey:e.sessionApiKey,responseType:e.responseType})}export{l as t};
@@ -0,0 +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{b as r,f as i,k as a}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-40UR63Gt.js";import{t as o}from"./useTranslation-CCgUjPJF.js";import{dt as s,gt as c,n as l,st as u}from"./active-backend-context-BETEdaJl.js";import{H as d,K as f,t as p}from"./utils-CbjwNcR-.js";import{t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-fgzdgvrL.js";import{B as h,H as g,I as _,O as v,P as ee,V as y,j as b,t as te,w as ne,z as x}from"./use-tracking-BAFpgpgq.js";import{l as re}from"./settings-service.api-CYBTLGOd.js";import{n as ie}from"./use-settings-D69cw06D.js";import{t as S}from"./modal-backdrop-BSzNhM4r.js";import{n as C}from"./modal-classes-BPcBCWVj.js";import{t as w}from"./brand-button-CGUwj6zK.js";import{n as T}from"./navigation-context-CQZwH_tC.js";import{o as ae,s as oe,t as se}from"./conversation-store-DC-JlJuq.js";import{t as E}from"./modal-close-button-Cq3dma5u.js";import{n as ce}from"./use-create-conversation-D15Px574.js";import{p as D,t as le}from"./install-server-modal-DkMCfj0J.js";import{t as O}from"./scroll-fade-state-Dt_fx2kf.js";import{t as ue}from"./use-automations-7_XBXHQK.js";import{a as k,i as A,n as j,r as M,t as N}from"./extension-module-card-classes-DpeaYhYo.js";import{t as P}from"./secrets-service-C3CNNEpY.js";import{t as F}from"./use-create-secret-D_qPU88t.js";import{t as de}from"./mcp-installed-servers-BW51n6PC.js";import{t as I}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-BIjRfQ4u.js";import{n as L,o as R,u as z}from"./mcp-marketplace-utils-BwEnDYqm.js";import{n as B}from"./skill-card-pill-row-CxOFySng.js";import{t as V}from"./circle-plus-check-toggle-ZOXpJ3I2.js";var H=e(t(),1);function U(e,t){let n=i(t);return fe({filters:{...e,status:`pending`}},n).length}function W(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function fe(e={},t){let n=i(t).getMutationCache(),o=H.useRef(e),s=H.useRef(null);return s.current===null&&(s.current=W(n,e)),H.useEffect(()=>{o.current=e}),H.useSyncExternalStore(H.useCallback(e=>n.subscribe(()=>{let t=a(s.current,W(n,o.current));s.current!==t&&(s.current=t,r.schedule(e))}),[n]),()=>s.current,()=>s.current)}var G=()=>{let e=T(),t=U({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},K=`OPENHANDS_URL`;function pe(){let e=l(),t=i(),{mutateAsync:n}=F();return(0,H.useCallback)(async()=>{let r;try{r=await t.fetchQuery({queryKey:[`secrets`,e.backend.id,e.orgId],queryFn:P.getSecretsOrThrow,staleTime:0,retry:!1,meta:{disableToast:!0}})}catch(e){return u(s(e)||c.t(f.ERROR$GENERIC)),!1}if(r.some(e=>e.name===K))return!0;try{await n({name:K,value:window.location.origin})}catch{return!1}return await t.invalidateQueries({queryKey:[`secrets`]}),!0},[e.backend.id,e.orgId,n,t])}var me=`${d.PRODUCTION}/settings/integrations`;function he(e){let t=b(),n=g(e);return n.length>0&&n.every(e=>t.includes(e))}function ge(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:f.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:f.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:f.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:f.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:me}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var _e=[`local`,`openhands-cloud`];function q(e){return e.map((e,t)=>({automation:e,index:t})).sort((e,t)=>(t.automation.popularityRank??0)-(e.automation.popularityRank??0)||e.index-t.index).map(({automation:e})=>e)}function J(e){return e.trim().toLowerCase().replace(/&/g,`and`).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function ve(e){return[e.id,e.name,e.name?`${e.name} Agent`:void 0,e.skill].filter(e=>!!e).map(J)}function ye(e,t){let n=new Set(t.map(e=>J(e.name)));return ve(e).some(e=>n.has(e))}function Y(e){return v().includes(e.id)}function be(e){return _.findById(e.id)==null}function xe(e){let t=q(m).filter(t=>!ye(t,e));return{proven:t.filter(Y),conversation:t.filter(e=>!Y(e)&&be(e))}}function Se(e){return[...e.proven,...e.conversation]}var Ce=2;function we(e){let[t,n]=(0,H.useState)(!1),r=(0,H.useRef)(0),i=(0,H.useRef)(0),a=(0,H.useRef)(!1),o=(0,H.useCallback)(t=>{let o=e.current;t.button!==0||!o||(a.current=!1,r.current=t.clientX,i.current=o.scrollLeft,n(!0))},[e]),s=(0,H.useCallback)(e=>{a.current&&(a.current=!1,e.preventDefault(),e.stopPropagation())},[]),c=(0,H.useCallback)(e=>{e.preventDefault()},[]);return(0,H.useEffect)(()=>{if(!t)return;let o=t=>{let o=e.current;if(o){if(!(t.buttons&1)){n(!1);return}if(!a.current){if(Math.abs(t.clientX-r.current)<Ce)return;a.current=!0}t.preventDefault(),o.scrollLeft=i.current-(t.clientX-r.current)}},s=()=>n(!1);return document.addEventListener(`mousemove`,o),document.addEventListener(`mouseup`,s),()=>{document.removeEventListener(`mousemove`,o),document.removeEventListener(`mouseup`,s)}},[t,e]),{handleMouseDown:o,handleClickCapture:s,handleDragStart:c}}var X=`pb-12`,Z=n(),Te=`flex h-10 items-start`;function Ee(e){return y(e).flatMap(e=>{let t=R(e,I);return t?[t]:[]})}function De({automation:e,entries:t,testId:n}){let r=t.slice(0,4),i=r.length>1,a=x(e);return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":i&&!a?`overlap`:void 0,className:p(Te,i&&!a&&`-space-x-2`),children:a?(0,Z.jsx)(D,{entry:null,size:`base`,fallback:(0,H.createElement)(a,{className:`h-5 w-5`,strokeWidth:2.25})}):r.length===0?(0,Z.jsx)(D,{entry:null,size:`base`}):r.map(e=>(0,Z.jsx)(D,{entry:e,size:`base`,className:i?`ring-2 ring-[var(--oh-color-base-secondary)]`:void 0},e.id))})}function Oe({installedAutomations:e,onSelect:t,className:n}){let{t:r}=o(`openhands`),i=Se(xe(e)),a=(0,H.useRef)(null),{handleMouseDown:s,handleClickCapture:c,handleDragStart:l}=we(a),[u,d]=(0,H.useState)({left:!1,right:!1}),m=(0,H.useCallback)(()=>{let e=a.current;if(!e)return;let t=O(e);d(e=>e.left===t.left&&e.right===t.right?e:t)},[]);return(0,H.useLayoutEffect)(()=>{m();let e=a.current;if(!e)return;let t=new ResizeObserver(m);return t.observe(e),Array.from(e.children).forEach(e=>{t.observe(e)}),()=>t.disconnect()},[m,i.map(e=>e.id).join(`,`)]),i.length===0?null:(0,Z.jsxs)(`section`,{"data-testid":`recommended-automations-rail`,"aria-label":r(f.RECOMMENDED_AUTOMATIONS$SECTION_LABEL),className:p(`w-full`,X,n),children:[(0,Z.jsx)(`h2`,{className:`mb-2 text-sm font-medium text-[var(--oh-foreground)]`,children:r(f.RECOMMENDED_AUTOMATIONS$SECTION_LABEL)}),(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`div`,{ref:a,role:`list`,"data-testid":`recommended-automations-rail-scroll`,onScroll:m,onMouseDown:s,onClickCapture:c,onDragStart:l,className:`flex flex-nowrap gap-3 overflow-x-auto scrollbar-hide select-none`,children:i.map(e=>(0,Z.jsx)(`div`,{role:`listitem`,children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`recommended-automation-rail-card-${e.id}`,onClick:()=>t(e),className:p(`flex w-[220px] shrink-0 flex-col gap-3 p-3 text-left`,k,M),children:[(0,Z.jsx)(De,{automation:e,entries:Ee(e),testId:`recommended-automation-rail-icon-${e.id}`}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})},e.id))}),(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-testid":`recommended-automations-rail-fade-left`,"data-visible":u.left?`true`:`false`,className:p(`pointer-events-none absolute inset-y-0 left-0 z-10 w-10`,`bg-gradient-to-r from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,u.left?`opacity-100`:`opacity-0`)}),(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-testid":`recommended-automations-rail-fade-right`,"data-visible":u.right?`true`:`false`,className:p(`pointer-events-none absolute inset-y-0 right-0 z-10 w-10`,`bg-gradient-to-l from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,u.right?`opacity-100`:`opacity-0`)})]})]})}var ke=`inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-lg border border-white/10 bg-surface-raised shadow-[inset_0_1px_0_rgba(255,255,255,0.18)]`;function Ae(e){return e.slice(0,4)}function je({entries:e,className:t,testId:n}){let r=Ae(e);if(r.length===0)return(0,Z.jsx)(D,{entry:null,size:`md`,className:t,testId:n});if(r.length===1)return(0,Z.jsx)(D,{entry:r[0],size:`md`,className:t,testId:n});if(r.length===2)return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`overlap`,className:p(ke,`items-center justify-center`,t),children:(0,Z.jsx)(`span`,{className:`flex items-center justify-center -space-x-2`,children:r.map(e=>(0,Z.jsx)(D,{entry:e,size:`sm`,className:`ring-2 ring-surface-raised`},e.id))})});let i=[r[0]??null,r[1]??null,r[2]??null,r[3]??null];return(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":n,"data-layout":`quadrants`,className:p(ke,`grid grid-cols-2 grid-rows-2 gap-0.5 p-1`,t),children:i.map((e,t)=>e?(0,Z.jsx)(`span`,{className:`flex items-center justify-center`,children:(0,Z.jsx)(D,{entry:e,size:`xs`})},e.id):(0,Z.jsx)(`span`,{"aria-hidden":`true`},`empty-${t}`))})}function Q({count:e}){return(0,Z.jsx)(`span`,{className:`ml-2 inline-flex items-center justify-center rounded-full bg-surface-raised px-2 py-0.5 text-xs text-foreground`,children:e})}var Me=q(m);function Ne(e){return v().includes(e.id)}function Pe(e){return y(e).map(e=>{let t=R(e,I);return{id:e,entry:t,mcpInstallable:!!t&&z(t)}})}function Fe(e,t,n){let r=n.trim().toLowerCase();return r?[e.name,e.category,e.description,h(e),...t.flatMap(({entry:e,id:t})=>e?[e.name,t,...e.keywords??[]]:[t])].join(` `).toLowerCase().includes(r):!0}function Ie(e,t,n,r){let i=e.map(({id:e,entry:n,mcpInstallable:i})=>{let a=!!n&&L(n,t),o=n?.name??e;return{id:`integration-${e}`,node:(0,Z.jsxs)(`span`,{className:p(A,`gap-1`),children:[(0,Z.jsx)(D,{entry:n,size:`xs`}),o,a?(0,Z.jsx)(`span`,{className:`text-white`,children:r(f.RECOMMENDED_AUTOMATIONS$CONNECTED)}):n?i?null:(0,Z.jsx)(`span`,{className:`text-tertiary-alt`,"data-testid":`automation-integration-external-${e}`,children:r(f.RECOMMENDED_AUTOMATIONS$EXTERNAL_SETUP)}):(0,Z.jsx)(`span`,{className:`text-tertiary-alt`,"data-testid":`recommended-automation-integration-${e}`,children:r(f.RECOMMENDED_AUTOMATIONS$UNKNOWN_SETUP)})]})}});return n>0&&i.push({id:`missing-connect`,node:(0,Z.jsx)(`span`,{className:A,children:r(f.RECOMMENDED_AUTOMATIONS$MISSING_CONNECT,{count:n})})}),i}function Le({automation:e,integrations:t,size:n,testId:r}){let i=x(e);return i?(0,Z.jsx)(D,{entry:null,size:n,testId:r,fallback:(0,H.createElement)(i,{className:`h-5 w-5`,strokeWidth:2.25})}):(0,Z.jsx)(je,{entries:t.flatMap(({entry:e})=>e?[e]:[]),testId:r})}function $({automations:e,installedServers:t,onSelect:n,translate:r}){return(0,Z.jsx)(`div`,{className:p(`mt-3`,N),children:e.map(e=>{let i=Pe(e),a=i.filter(({entry:e,mcpInstallable:n})=>!!e&&n&&!L(e,t)).length;return(0,Z.jsx)(`button`,{type:`button`,"data-testid":`recommended-automation-card-${e.id}`,onClick:()=>n(e),className:p(`flex min-w-0 overflow-hidden p-4 text-left`,k,M),children:(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[(0,Z.jsx)(Le,{automation:e,integrations:i,size:`md`,testId:`recommended-automation-icon-${e.id}`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold text-white`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-tertiary-alt`,children:e.category})]}),(0,Z.jsx)(V,{testId:`recommended-automation-plus-${e.id}`})]}),(0,Z.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-tertiary-light`,children:e.description}),(0,Z.jsx)(B,{pills:Ie(i,t,a,r),testId:`recommended-automation-pills-${e.id}`})]})]})},e.id)})})}function Re({backendKind:e,installedServers:t,query:n=``,onSelect:r,scrollableGrid:i=!1}){let{t:a}=o(`openhands`),s=Me.filter(e=>Fe(e,Pe(e),n));if(s.length===0)return null;let c=s.filter(Ne),l=s.filter(e=>!Ne(e));return(0,Z.jsx)(`section`,{"data-testid":`recommended-automations-section`,className:p(i&&`flex min-h-0 flex-1 flex-col`),children:(0,Z.jsxs)(`div`,{"data-testid":i?`recommended-automations-scroll-area`:void 0,className:p(`mt-3`,j,i&&`min-h-0 flex-1 overflow-y-auto custom-scrollbar-always`),children:[c.length>0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:a(f.RECOMMENDED_AUTOMATIONS$SECTION_TITLE)}),(0,Z.jsx)(Q,{count:c.length})]}),(0,Z.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:a(f.RECOMMENDED_AUTOMATIONS$SECTION_DESCRIPTION)}),(0,Z.jsx)($,{automations:c,installedServers:t,onSelect:r,translate:a})]}),l.length>0&&(0,Z.jsxs)(`section`,{"data-testid":`recommended-automations-beta-section`,className:p(c.length>0&&`mt-8`),children:[(0,Z.jsxs)(`div`,{"data-testid":`recommended-automations-beta-heading`,className:`flex items-center`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:a(f.RECOMMENDED_AUTOMATIONS$BETA_LABEL)}),(0,Z.jsx)(Q,{count:l.length})]}),(0,Z.jsx)($,{automations:l,installedServers:t,onSelect:r,translate:a})]})]})})}function ze({isOpen:e,isPending:t,onClose:n,onContinueLocal:r,onOpenUrl:i}){let{t:a}=o(`openhands`);return e?(0,Z.jsx)(S,{onClose:n,closeOnEscape:!t,closeOnBackdropClick:!t,"aria-label":a(f.RESPONDER_DEPLOYMENT$TITLE),children:(0,Z.jsxs)(`div`,{"data-testid":`responder-deployment-modal`,className:`relative flex w-full max-w-3xl flex-col rounded-xl border border-[var(--oh-border)] bg-base-secondary`,children:[(0,Z.jsx)(E,{onClose:n,testId:`responder-deployment-modal-close`,disabled:t}),(0,Z.jsxs)(`header`,{className:`flex-shrink-0 px-6 pb-4 pt-6`,children:[(0,Z.jsx)(`h2`,{className:p(`pr-6`,C),children:a(f.RESPONDER_DEPLOYMENT$TITLE)}),(0,Z.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:a(f.RESPONDER_DEPLOYMENT$DESCRIPTION)})]}),(0,Z.jsx)(`div`,{className:`flex flex-col gap-3 px-6 pb-6 sm:flex-row`,children:_e.map(e=>{let n=ge(e),{action:o}=n;return(0,Z.jsxs)(`div`,{"data-testid":n.testId,className:`flex flex-1 flex-col gap-3 rounded-xl border border-[var(--oh-border)] bg-surface-raised p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Z.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:a(n.titleKey)}),(0,Z.jsx)(`p`,{className:`text-xs leading-relaxed text-tertiary-light`,children:a(n.descriptionKey)})]}),(0,Z.jsx)(w,{type:`button`,variant:`primary`,className:`mt-auto`,testId:n.primaryActionTestId,isDisabled:t,"aria-busy":t&&o.kind===`launch-local`?!0:void 0,onClick:()=>{o.kind===`launch-local`?r():i(o.url)},children:a(n.primaryActionKey)})]},n.target)})})]})}):null}function Be(e){return g(e).map(e=>R(e,I)).filter(e=>!!e).filter(z)}function Ve({query:e,onLaunched:t,scrollableGrid:n=!1,variant:r=`catalog`,className:i}){let a=l(),{navigate:o}=T(),{data:s}=ie(),{trackPrebuiltAutomationEnabled:c}=te(),u=ce(),d=pe(),f=G(),p=se(e=>e.setMessageToSend),[m,g]=(0,H.useState)(null),[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)([]),S=(0,H.useRef)(!1),C=(0,H.useRef)(!1),w=(0,H.useRef)(!1),[E,D]=(0,H.useState)(!1),O=r===`rail`,{data:k,isLoading:A}=ue({enabled:O&&a.backend.kind===`local`}),j=(0,H.useMemo)(()=>de(s?.mcp_config??re(s?.agent_settings?.mcp_config)).filter(e=>e.enabled!==!1),[s?.agent_settings?.mcp_config,s?.mcp_config]),M=(0,H.useCallback)(e=>{if(C.current||u.isPending||f)return;if(C.current=!0,_.findById(e.id)){o?.(ne(e.id)),t?.();return}let n=h(e);u.mutate({},{onSuccess:r=>{c({automationName:e.name,automationCategory:e.category}),r.conversation_id.startsWith(`task-`)&&r.task_id?oe(r.task_id,n):ae(r.conversation_id,{draftMessage:n}),o?.(`/conversations/${r.conversation_id}`),t?.(),window.setTimeout(()=>p(n),0)},onError:()=>{C.current=!1}})},[a.backend.kind,u,f,o,t,p,c]),N=(0,H.useCallback)(e=>Be(e).filter(e=>!L(e,j)),[j]),P=e=>{let t=N(e);if(t.length===0){M(e);return}g(e),x(t)},F=e=>{if(!(C.current||u.isPending||f||b.length>0||v!==null)){if(he(e)){y(e);return}P(e)}},I=async()=>{let e=v;if(!(!e||w.current)){w.current=!0,D(!0);try{if(!await d())return;y(null),P(e)}finally{w.current=!1,D(!1)}}},R=e=>{y(null),window.open(e,`_blank`,`noopener,noreferrer`)},z=()=>{y(null)},B=()=>{if(S.current){S.current=!1;return}g(null),x([])},V=()=>{S.current=!0,x(e=>{let t=e.slice(1);if(t.length===0){let e=m;window.setTimeout(()=>{g(null),e&&M(e)},0)}return t})},U=b[0]??null;return!ee()||a.backend.kind===`cloud`||O&&A?null:(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(Oe,{className:i,installedAutomations:k?.automations??[],onSelect:F}):(0,Z.jsx)(Re,{backendKind:a.backend.kind,installedServers:j,query:e,onSelect:F,scrollableGrid:n}),U&&(0,Z.jsx)(le,{entry:U,existingServers:j,onClose:B,onSuccess:V},U.id),(0,Z.jsx)(ze,{isOpen:v!==null,isPending:E,onClose:z,onContinueLocal:I,onOpenUrl:R})]})}export{U as a,G as i,Q as n,X as r,Ve as t};