@openhands/agent-canvas 1.2.0 → 1.3.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 (327) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-De9RwQhA.js → Trans-DY6toRDu.js} +1 -1
  4. package/build/assets/{acp-providers-D_D8VUpP.js → acp-providers-Djl6vNn-.js} +1 -1
  5. package/build/assets/active-backend-context-B3umL5R-.js +1 -0
  6. package/build/assets/{add-backend-modal-DzuB9zlG.js → add-backend-modal-DljoP9lc.js} +1 -1
  7. package/build/assets/{agent-profiles-settings-BfAwTshW.js → agent-profiles-settings-BJMmTZgv.js} +1 -1
  8. package/build/assets/{agent-server-conversation-service.api-DfH2k6Sx.js → agent-server-conversation-service.api-D_ZvtJjG.js} +3 -3
  9. package/build/assets/agent-settings-BVVFzBWS.js +1 -0
  10. package/build/assets/{agent-settings-DjVlKgaP.js → agent-settings-lUknCeaF.js} +1 -1
  11. package/build/assets/{alert-banner-BW0wRYw6.js → alert-banner-Bpf2NQJq.js} +1 -1
  12. package/build/assets/{api-key-entry-screen-O8gS-fnF.js → api-key-entry-screen-CWEHcPJA.js} +1 -1
  13. package/build/assets/{app-settings-SlZvaXlk.js → app-settings-Dj90qosy.js} +1 -1
  14. package/build/assets/automation-detail-CXJU0_gF.js +2 -0
  15. package/build/assets/automation-export-FWY9LPsG.js +2 -0
  16. package/build/assets/automations-list-DDGBkWLC.js +1 -0
  17. package/build/assets/{back-nav-button-BYmxFxGt.js → back-nav-button-CUS2mi-U.js} +1 -1
  18. package/build/assets/{backend-form-modal-D2EDGVAc.js → backend-form-modal-DSbrafX2.js} +1 -1
  19. package/build/assets/{backend-synced-settings-badge-6OCwIuLY.js → backend-synced-settings-badge-CanzmG12.js} +1 -1
  20. package/build/assets/{base-modal-CC5Pp8CF.js → base-modal-BuF2f0YL.js} +1 -1
  21. package/build/assets/{brand-button-DKPMEKcW.js → brand-button-vMVuyDXu.js} +1 -1
  22. package/build/assets/{browser-B39N74jU.js → browser-BifzWIBd.js} +1 -1
  23. package/build/assets/{browser-tab-aiDg7aEn.js → browser-tab-CkkqJnqw.js} +1 -1
  24. package/build/assets/{chat-send-button-DxuZIoW8.js → chat-send-button-B_jc5z5C.js} +1 -1
  25. package/build/assets/{circle-plus-check-toggle-T3eAIuPQ.js → circle-plus-check-toggle-C5YxjxvI.js} +1 -1
  26. package/build/assets/{color-themes-Dd1sO5U6.js → color-themes-DPBzNtVg.js} +3 -3
  27. package/build/assets/{combobox-caret-CLGvOs32.js → combobox-caret-DoObzqf4.js} +1 -1
  28. package/build/assets/{command-menu-DKrLCRla.js → command-menu-D-JV3Wqm.js} +1 -1
  29. package/build/assets/{condenser-settings-BhxvlfoY.js → condenser-settings-30cX9SK6.js} +1 -1
  30. package/build/assets/{confirmation-modal-BK1F0A68.js → confirmation-modal-BGLu6XJN.js} +1 -1
  31. package/build/assets/{context-menu-list-item-DBFzplWW.js → context-menu-list-item-BD5_EaKN.js} +1 -1
  32. package/build/assets/conversation-BltULtFA.js +89 -0
  33. package/build/assets/conversation-e0a0_X4S.js +1 -0
  34. package/build/assets/conversation-panel-Cr9_ZGI-.js +1 -0
  35. package/build/assets/{conversation-service.api-Ch9kR9aE.js → conversation-service.api-DQaKzIRj.js} +1 -1
  36. package/build/assets/{conversation-tab-empty-state-m8IUkfMj.js → conversation-tab-empty-state-B2dDYEwf.js} +1 -1
  37. package/build/assets/{copy-to-clipboard-button-Aj9wFmt2.js → copy-to-clipboard-button-CaR52OnA.js} +1 -1
  38. package/build/assets/declaration-gq8V5eTU.js +1 -0
  39. package/build/assets/{device-verify-B5YCrvSu.js → device-verify-BsznkV-a.js} +1 -1
  40. package/build/assets/{dropdown-classes-CgQ45JmQ.js → dropdown-classes-DJSXeLqc.js} +1 -1
  41. package/build/assets/{ellipsis-button-1BV9Sga8.js → ellipsis-button-C5Z-tPFp.js} +1 -1
  42. package/build/assets/{entry.client-BgWj9jL_.js → entry.client-JixNvFrr.js} +2 -2
  43. package/build/assets/{enum-filter-dropdown-DCITiYVi.js → enum-filter-dropdown-DXbVwiNZ.js} +1 -1
  44. package/build/assets/{environment-switch-overlay-DUnKILNH.js → environment-switch-overlay-DZQfRGTx.js} +1 -1
  45. package/build/assets/{extensions-hub-MtC8lK3A.js → extensions-hub-DfvgqzTc.js} +1 -1
  46. package/build/assets/{extensions-navigation-BtV14oQL.js → extensions-navigation-D9i0DL62.js} +1 -1
  47. package/build/assets/files-tab-DDtEJcGE.js +1 -0
  48. package/build/assets/{form-control-classes-9rkU4usZ.js → form-control-classes-ChpNBe9n.js} +1 -1
  49. package/build/assets/{git-provider-icon-CGU7_KiU.js → git-provider-icon-BjkecAuV.js} +1 -1
  50. package/build/assets/home-BCKWpKpf.js +1 -0
  51. package/build/assets/{install-server-modal-J_eQ6lhG.js → install-server-modal-BIugLhVB.js} +1 -1
  52. package/build/assets/{launch-DamfAY5L.js → launch-BgIlZLSX.js} +1 -1
  53. package/build/assets/lesson-plan-DgpP80mJ.js +4 -0
  54. package/build/assets/{llm-not-configured-banner-DTrLsVr_.js → llm-not-configured-banner-BlX8NifC.js} +4 -4
  55. package/build/assets/llm-settings-DJmbryaE.js +1 -0
  56. package/build/assets/{llm-settings-BgSFkbHC.js → llm-settings-kU5v0H1Z.js} +1 -1
  57. package/build/assets/{loading-spinner-DHAIPZkP.js → loading-spinner-BLdswi6q.js} +1 -1
  58. package/build/assets/{manage-backends-modal-BUzj5_Lq.js → manage-backends-modal-C8FJQIZR.js} +1 -1
  59. package/build/assets/manifest-56d40d7c.js +1 -0
  60. package/build/assets/{markdown-renderer-D8mayGjI.js → markdown-renderer-DMT7Zkpd.js} +1 -1
  61. package/build/assets/{mcp-DvqJYDbz.js → mcp-CHkklDMv.js} +1 -1
  62. package/build/assets/{messages-C4KEFkPk.js → messages-B3RugH7P.js} +11 -11
  63. package/build/assets/{modal-body-Dcu5McCa.js → modal-body-DouOE5KH.js} +1 -1
  64. package/build/assets/{modal-classes-DPqxSyuP.js → modal-classes-Cf-4tbHz.js} +1 -1
  65. package/build/assets/{modal-close-button-CTCX4nCH.js → modal-close-button-B6CfxxJj.js} +1 -1
  66. package/build/assets/{model-selector-VDHBytb6.js → model-selector-BOj1wBlq.js} +1 -1
  67. package/build/assets/onboarding-DYhDxmI9.js +1 -0
  68. package/build/assets/{onboarding-modal-CGHPoMp7.js → onboarding-modal-CP_WxDC9.js} +1 -1
  69. package/build/assets/{option-service.api-Dz7Eomnx.js → option-service.api-C0tYT4-r.js} +1 -1
  70. package/build/assets/{path-utils-CBaRYg35.js → path-utils-DWcgCGen.js} +1 -1
  71. package/build/assets/{plan-components-j9X4AxYM.js → plan-components-CcCBmCzW.js} +1 -1
  72. package/build/assets/{planner-tab-G4j36bJk.js → planner-tab-CCqdXxkL.js} +1 -1
  73. package/build/assets/providers-BxCuC9bZ.js +1 -0
  74. package/build/assets/recommended-automations-launcher-CVEF_1pc.js +58 -0
  75. package/build/assets/root-V8fkplMy.css +1 -0
  76. package/build/assets/root-layout-CttG_lQi.js +2 -0
  77. package/build/assets/{root-S6CfVoNm.js → root-uJ2t9rCQ.js} +2 -2
  78. package/build/assets/{runtime-waiting-state-DkzLgvMn.js → runtime-waiting-state-BsXLElvN.js} +1 -1
  79. package/build/assets/{schema-field-DwUzlw6b.js → schema-field-xUr6rDd6.js} +1 -1
  80. package/build/assets/{sdk-section-page-BUXONTx6.js → sdk-section-page-CbLrVUa3.js} +1 -1
  81. package/build/assets/{sdk-settings-schema-BjBkMHzZ.js → sdk-settings-schema-Cv7M9eSe.js} +1 -1
  82. package/build/assets/{secrets-settings-ZxyfRBgx.js → secrets-settings-DxTx9HgU.js} +1 -1
  83. package/build/assets/{segmented-toggle-Cen5AMUc.js → segmented-toggle-DyQqPhoD.js} +1 -1
  84. package/build/assets/{settings-Bx6vn-g8.js → settings-DnlfS09K.js} +1 -1
  85. package/build/assets/{settings-dropdown-input-xzoZwgUe.js → settings-dropdown-input-BjunGXJb.js} +1 -1
  86. package/build/assets/{settings-index-D4SM26d5.js → settings-index-BjeuYFFa.js} +1 -1
  87. package/build/assets/{settings-input-DYs7t3oK.js → settings-input-bD6npsDm.js} +1 -1
  88. package/build/assets/{settings-list-classes-DvQr5jVS.js → settings-list-classes-Dp_OgzN0.js} +1 -1
  89. package/build/assets/{settings-modal-BoC8oMlg.js → settings-modal-DfTcL-mV.js} +1 -1
  90. package/build/assets/settings-service.api-K4ncGlBv.js +1 -0
  91. package/build/assets/{settings-switch-C2N2xqEb.js → settings-switch-5cuxl8Dc.js} +1 -1
  92. package/build/assets/{shared-conversation-DMiaQFsj.js → shared-conversation-DWtBkJv7.js} +1 -1
  93. package/build/assets/{sidebar-layout-BtpUSN3j.js → sidebar-layout-DuzJMMw-.js} +1 -1
  94. package/build/assets/{sidebar-mobile-menu-toggle-CaV3tQFF.js → sidebar-mobile-menu-toggle-CMmAYkh8.js} +1 -1
  95. package/build/assets/{sidebar-nav-link-CIB3NBRW.js → sidebar-nav-link-5AlTT5-j.js} +1 -1
  96. package/build/assets/{skill-card-pill-row-D2bUe2kB.js → skill-card-pill-row-eTIkE4nz.js} +1 -1
  97. package/build/assets/{skills-plugins-D2WkrXkr.js → skills-plugins-BJ040luO.js} +1 -1
  98. package/build/assets/{skills-settings-CZGVOp_t.js → skills-settings-BYn4-AQQ.js} +1 -1
  99. package/build/assets/{styled-tooltip-DsKsFjuq.js → styled-tooltip-CgX2oRaK.js} +1 -1
  100. package/build/assets/{task-list-tab-BAThr9Ex.js → task-list-tab-0k9PhuqO.js} +1 -1
  101. package/build/assets/{terminal-B0aL_iDZ.js → terminal-BsGcSpRS.js} +1 -1
  102. package/build/assets/{toggle-switch-DBlOOzBr.js → toggle-switch-2j5wwR85.js} +1 -1
  103. package/build/assets/{typography-YGPBGzOG.js → typography-D8mHDeNG.js} +1 -1
  104. package/build/assets/{use-acp-credential-form-rzaqkJ1n.js → use-acp-credential-form-EtnbtYt0.js} +1 -1
  105. package/build/assets/{use-activate-agent-profile-DY0txItX.js → use-activate-agent-profile-WaAZYz4E.js} +1 -1
  106. package/build/assets/{use-active-agent-profile-Cp5AFONR.js → use-active-agent-profile-CYY3vGar.js} +1 -1
  107. package/build/assets/{use-active-conversation-DvcFBqFe.js → use-active-conversation-D-r929nx.js} +1 -1
  108. package/build/assets/{use-agent-profiles-DnH16_Vm.js → use-agent-profiles-DEAMFp-W.js} +1 -1
  109. package/build/assets/{use-agent-state-BvRcEzY4.js → use-agent-state-DijdVAQ0.js} +1 -1
  110. package/build/assets/{use-backends-health-e-Ull4wz.js → use-backends-health-DkC7tKkC.js} +1 -1
  111. package/build/assets/{use-can-manage-org-profiles-OIhplvQ0.js → use-can-manage-org-profiles-BEo0peGn.js} +1 -1
  112. package/build/assets/{use-cloud-current-user-id-ekU7UXDT.js → use-cloud-current-user-id-Dm99wXp2.js} +1 -1
  113. package/build/assets/{use-config-Dwf5gla-.js → use-config-CHzNIHpv.js} +1 -1
  114. package/build/assets/{use-create-conversation-CvAXfA3T.js → use-create-conversation-CTsvZ96U.js} +1 -1
  115. package/build/assets/{use-create-secret-BKeXCo__.js → use-create-secret-D5O5qdWC.js} +1 -1
  116. package/build/assets/{use-event-store-YSOxy9FC.js → use-event-store-DjgU4wfO.js} +1 -1
  117. package/build/assets/{use-handle-plan-click-cAXS-Hft.js → use-handle-plan-click-Mn_SNTCh.js} +1 -1
  118. package/build/assets/{use-llm-profiles-BcLibtGb.js → use-llm-profiles-BMhPDlwQ.js} +1 -1
  119. package/build/assets/use-runtime-is-ready-CC-KrLKe.js +1 -0
  120. package/build/assets/{use-save-agent-profile-DFjxHhNx.js → use-save-agent-profile-CLMmbx_X.js} +1 -1
  121. package/build/assets/{use-save-settings-5xPYpSQM.js → use-save-settings-D1HoCDbn.js} +1 -1
  122. package/build/assets/{use-settings-B07msZ2Z.js → use-settings-BReAMxCG.js} +1 -1
  123. package/build/assets/{use-settings-nav-items-CswsOEyw.js → use-settings-nav-items-xe1YgLnE.js} +1 -1
  124. package/build/assets/{use-skills-Aoaoq_ei.js → use-skills-Dqo-pDDx.js} +1 -1
  125. package/build/assets/{use-task-list-CmWGElgb.js → use-task-list-AVBLbbcR.js} +1 -1
  126. package/build/assets/{use-tracking-CqODdfO4.js → use-tracking-2ZwQwpg_.js} +1 -1
  127. package/build/assets/{use-user-conversation-BPHQ-dm-.js → use-user-conversation-OAfenBRG.js} +1 -1
  128. package/build/assets/{useTranslation-Cgy4JA_g.js → useTranslation-CDRCKC9-.js} +1 -1
  129. package/build/assets/{utils-CE0lDWtb.js → utils-D3U3rlqr.js} +1 -1
  130. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-DJHl5b-B.js → vendor~root-layout~home~conversation-panel~conversation~launch~skills-settings~automations-~ki5qnp0d-rV6d1Iv_.js} +267 -27
  131. package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-CXyYYvYh.js +1 -0
  132. package/build/assets/{verification-settings-DZQ-JvKH.js → verification-settings-DnXS6VWv.js} +1 -1
  133. package/build/index.html +4 -4
  134. package/build/locales/ar/openhands.json +24 -0
  135. package/build/locales/ca/openhands.json +24 -0
  136. package/build/locales/de/openhands.json +24 -0
  137. package/build/locales/en/openhands.json +24 -0
  138. package/build/locales/es/openhands.json +24 -0
  139. package/build/locales/fr/openhands.json +24 -0
  140. package/build/locales/it/openhands.json +24 -0
  141. package/build/locales/ja/openhands.json +24 -0
  142. package/build/locales/ko-KR/openhands.json +24 -0
  143. package/build/locales/no/openhands.json +24 -0
  144. package/build/locales/pt/openhands.json +24 -0
  145. package/build/locales/tr/openhands.json +24 -0
  146. package/build/locales/uk/openhands.json +24 -0
  147. package/build/locales/zh-CN/openhands.json +24 -0
  148. package/build/locales/zh-TW/openhands.json +24 -0
  149. package/config/defaults.json +4 -4
  150. package/dist/api/automation-service/automation-service.api.d.ts +2 -1
  151. package/dist/api/event-service/event-service.api.cjs +1 -1
  152. package/dist/api/event-service/event-service.api.cjs.map +1 -1
  153. package/dist/api/event-service/event-service.api.js +1 -1
  154. package/dist/api/event-service/event-service.api.js.map +1 -1
  155. package/dist/api/event-service/event-service.types.d.ts +6 -0
  156. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  157. package/dist/api/git-service/agent-server-git-service.api.cjs.map +1 -1
  158. package/dist/api/git-service/agent-server-git-service.api.js +2 -2
  159. package/dist/api/git-service/agent-server-git-service.api.js.map +1 -1
  160. package/dist/api/git-service/git-service.api.cjs +1 -1
  161. package/dist/api/git-service/git-service.api.cjs.map +1 -1
  162. package/dist/api/git-service/git-service.api.js +2 -2
  163. package/dist/api/git-service/git-service.api.js.map +1 -1
  164. package/dist/components/conversation-events/chat/event-thought-helpers.cjs +1 -1
  165. package/dist/components/conversation-events/chat/event-thought-helpers.js +1 -1
  166. package/dist/components/features/automations/automation-card.d.ts +2 -1
  167. package/dist/components/features/automations/automation-group.d.ts +2 -1
  168. package/dist/components/features/automations/automation-list-row.d.ts +2 -1
  169. package/dist/components/features/automations/build-automation-menu-items.d.ts +2 -1
  170. package/dist/components/features/automations/detail/detail-header.d.ts +3 -1
  171. package/dist/components/features/automations/import-automation-modal.d.ts +10 -0
  172. package/dist/components/features/conversation/conversation-name-context-menu.cjs +1 -1
  173. package/dist/components/features/conversation/conversation-name-context-menu.cjs.map +1 -1
  174. package/dist/components/features/conversation/conversation-name-context-menu.d.ts +2 -1
  175. package/dist/components/features/conversation/conversation-name-context-menu.js +74 -63
  176. package/dist/components/features/conversation/conversation-name-context-menu.js.map +1 -1
  177. package/dist/components/features/conversation/conversation-name.cjs +1 -1
  178. package/dist/components/features/conversation/conversation-name.cjs.map +1 -1
  179. package/dist/components/features/conversation/conversation-name.js +73 -61
  180. package/dist/components/features/conversation/conversation-name.js.map +1 -1
  181. package/dist/components/features/conversation/transcript-export-modal.cjs +2 -0
  182. package/dist/components/features/conversation/transcript-export-modal.cjs.map +1 -0
  183. package/dist/components/features/conversation/transcript-export-modal.d.ts +10 -0
  184. package/dist/components/features/conversation/transcript-export-modal.js +140 -0
  185. package/dist/components/features/conversation/transcript-export-modal.js.map +1 -0
  186. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  187. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  188. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +1 -1
  189. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  190. package/dist/components/features/home/shared/dropdown-item.cjs +1 -1
  191. package/dist/components/features/home/shared/dropdown-item.cjs.map +1 -1
  192. package/dist/components/features/home/shared/dropdown-item.d.ts +7 -1
  193. package/dist/components/features/home/shared/dropdown-item.js +2 -1
  194. package/dist/components/features/home/shared/dropdown-item.js.map +1 -1
  195. package/dist/components/features/home/shared/generic-dropdown-menu.cjs +1 -1
  196. package/dist/components/features/home/shared/generic-dropdown-menu.cjs.map +1 -1
  197. package/dist/components/features/home/shared/generic-dropdown-menu.d.ts +8 -1
  198. package/dist/components/features/home/shared/generic-dropdown-menu.js +18 -10
  199. package/dist/components/features/home/shared/generic-dropdown-menu.js.map +1 -1
  200. package/dist/components/features/home/workspace-dropdown/workspace-dropdown.d.ts +11 -2
  201. package/dist/config/defaults.cjs +1 -1
  202. package/dist/config/defaults.cjs.map +1 -1
  203. package/dist/config/defaults.js +4 -4
  204. package/dist/config/defaults.js.map +1 -1
  205. package/dist/hooks/query/use-automations.d.ts +2 -1
  206. package/dist/hooks/query/use-resolved-workspaces.cjs +1 -1
  207. package/dist/hooks/query/use-resolved-workspaces.cjs.map +1 -1
  208. package/dist/hooks/query/use-resolved-workspaces.d.ts +9 -1
  209. package/dist/hooks/query/use-resolved-workspaces.js +1 -0
  210. package/dist/hooks/query/use-resolved-workspaces.js.map +1 -1
  211. package/dist/hooks/query/use-workspace-file-content.cjs +1 -1
  212. package/dist/hooks/query/use-workspace-file-content.cjs.map +1 -1
  213. package/dist/hooks/query/use-workspace-file-content.js +61 -55
  214. package/dist/hooks/query/use-workspace-file-content.js.map +1 -1
  215. package/dist/hooks/query/use-workspace-files.cjs +1 -1
  216. package/dist/hooks/query/use-workspace-files.cjs.map +1 -1
  217. package/dist/hooks/query/use-workspace-files.d.ts +11 -4
  218. package/dist/hooks/query/use-workspace-files.js +39 -18
  219. package/dist/hooks/query/use-workspace-files.js.map +1 -1
  220. package/dist/hooks/use-auto-refresh-files-on-edit.cjs +1 -1
  221. package/dist/hooks/use-auto-refresh-files-on-edit.cjs.map +1 -1
  222. package/dist/hooks/use-auto-refresh-files-on-edit.d.ts +9 -0
  223. package/dist/hooks/use-auto-refresh-files-on-edit.js +15 -11
  224. package/dist/hooks/use-auto-refresh-files-on-edit.js.map +1 -1
  225. package/dist/hooks/use-tracking.cjs +1 -1
  226. package/dist/hooks/use-tracking.cjs.map +1 -1
  227. package/dist/hooks/use-tracking.d.ts +7 -0
  228. package/dist/hooks/use-tracking.js +9 -0
  229. package/dist/hooks/use-tracking.js.map +1 -1
  230. package/dist/i18n/declaration.cjs +1 -1
  231. package/dist/i18n/declaration.cjs.map +1 -1
  232. package/dist/i18n/declaration.d.ts +24 -0
  233. package/dist/i18n/declaration.js +1 -1
  234. package/dist/i18n/declaration.js.map +1 -1
  235. package/dist/i18n/translation.cjs +1 -1
  236. package/dist/i18n/translation.cjs.map +1 -1
  237. package/dist/i18n/translation.js +408 -0
  238. package/dist/i18n/translation.js.map +1 -1
  239. package/dist/locales/ar/openhands.json +24 -0
  240. package/dist/locales/ca/openhands.json +24 -0
  241. package/dist/locales/de/openhands.json +24 -0
  242. package/dist/locales/en/openhands.json +24 -0
  243. package/dist/locales/es/openhands.json +24 -0
  244. package/dist/locales/fr/openhands.json +24 -0
  245. package/dist/locales/it/openhands.json +24 -0
  246. package/dist/locales/ja/openhands.json +24 -0
  247. package/dist/locales/ko-KR/openhands.json +24 -0
  248. package/dist/locales/no/openhands.json +24 -0
  249. package/dist/locales/pt/openhands.json +24 -0
  250. package/dist/locales/tr/openhands.json +24 -0
  251. package/dist/locales/uk/openhands.json +24 -0
  252. package/dist/locales/zh-CN/openhands.json +24 -0
  253. package/dist/locales/zh-TW/openhands.json +24 -0
  254. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs +1 -1
  255. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.cjs.map +1 -1
  256. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js +70 -3
  257. package/dist/node_modules/@openhands/extensions/integrations/catalog/atlassian.js.map +1 -1
  258. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  259. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  260. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +27 -2
  261. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  262. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs +2 -0
  263. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.cjs.map +1 -0
  264. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js +33 -0
  265. package/dist/node_modules/@openhands/extensions/integrations/catalog/superhuman-mail.js.map +1 -0
  266. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  267. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  268. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +48 -46
  269. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  270. package/dist/node_modules/@openhands/extensions/skills/index.cjs +267 -27
  271. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  272. package/dist/node_modules/@openhands/extensions/skills/index.js +36 -30
  273. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  274. package/dist/package.cjs +1 -1
  275. package/dist/package.cjs.map +1 -1
  276. package/dist/package.js +2 -2
  277. package/dist/package.js.map +1 -1
  278. package/dist/routes/files-tab.cjs +1 -1
  279. package/dist/routes/files-tab.js +10 -10
  280. package/dist/themes/color-themes.cjs +3 -3
  281. package/dist/themes/color-themes.cjs.map +1 -1
  282. package/dist/themes/color-themes.d.ts +13 -2
  283. package/dist/themes/color-themes.js +2 -2
  284. package/dist/themes/color-themes.js.map +1 -1
  285. package/dist/types/automation.d.ts +8 -0
  286. package/dist/utils/custom-toast-handlers.cjs.map +1 -1
  287. package/dist/utils/custom-toast-handlers.d.ts +1 -0
  288. package/dist/utils/custom-toast-handlers.js.map +1 -1
  289. package/dist/utils/mcp-server-name.cjs +1 -1
  290. package/dist/utils/mcp-server-name.cjs.map +1 -1
  291. package/dist/utils/mcp-server-name.js +2 -2
  292. package/dist/utils/mcp-server-name.js.map +1 -1
  293. package/dist/utils/transcript-export/index.cjs +72 -0
  294. package/dist/utils/transcript-export/index.cjs.map +1 -0
  295. package/dist/utils/transcript-export/index.d.ts +10 -0
  296. package/dist/utils/transcript-export/index.js +302 -0
  297. package/dist/utils/transcript-export/index.js.map +1 -0
  298. package/dist/utils/transcript-export/load-complete-events.cjs +2 -0
  299. package/dist/utils/transcript-export/load-complete-events.cjs.map +1 -0
  300. package/dist/utils/transcript-export/load-complete-events.d.ts +22 -0
  301. package/dist/utils/transcript-export/load-complete-events.js +39 -0
  302. package/dist/utils/transcript-export/load-complete-events.js.map +1 -0
  303. package/package.json +2 -2
  304. package/scripts/check-sdk-version-sync.mjs +6 -6
  305. package/scripts/dev-safe.mjs +2 -2
  306. package/build/assets/active-backend-context-DRFevVIj.js +0 -1
  307. package/build/assets/agent-settings-CMMms-0q.js +0 -1
  308. package/build/assets/automation-detail-CwsNJ9AM.js +0 -2
  309. package/build/assets/automations-list-B9cPtugh.js +0 -1
  310. package/build/assets/conversation-B8prFAZF.js +0 -19
  311. package/build/assets/conversation-DGVDwGn8.js +0 -1
  312. package/build/assets/conversation-panel-C7DC4Cxx.js +0 -1
  313. package/build/assets/declaration-B9kpCaYl.js +0 -1
  314. package/build/assets/edit-automation-modal-BoibW8cd.js +0 -1
  315. package/build/assets/files-tab-DHqtsKLy.js +0 -1
  316. package/build/assets/home-BgjWP_UN.js +0 -1
  317. package/build/assets/lesson-plan-HD886V64.js +0 -4
  318. package/build/assets/llm-settings-Bkc8C5Bi.js +0 -1
  319. package/build/assets/manifest-4d6a1552.js +0 -1
  320. package/build/assets/onboarding-gGIqoxvA.js +0 -1
  321. package/build/assets/providers-CPoq0VXm.js +0 -1
  322. package/build/assets/recommended-automations-launcher-CXaEK1rW.js +0 -50
  323. package/build/assets/root-CxWZUXTQ.css +0 -1
  324. package/build/assets/root-layout-CvxdHJ6j.js +0 -2
  325. package/build/assets/settings-service.api-DldkFI1x.js +0 -1
  326. package/build/assets/use-runtime-is-ready-CBFe69Ew.js +0 -1
  327. package/build/assets/vendor~root-layout~home~mcp~automations-list~onboarding-modal-L2sdihTY.js +0 -1
@@ -1,6 +1,6 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,M as n,N as r,P as i,bt as a}from"./vendor-styling-CI0PQ3ab.js";import{n as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{d as s,l as c,m as l,r as u,s as d}from"./path-utils-CBaRYg35.js";import{t as f}from"./useMutation-DCE9RcgK.js";import{t as p}from"./Trans-De9RwQhA.js";import{t as m}from"./useTranslation-Cgy4JA_g.js";import{t as h}from"./declaration-B9kpCaYl.js";import{A as g,H as _,n as v}from"./active-backend-context-DRFevVIj.js";import{t as y}from"./createLucideIcon-CVAsW2Yo.js";import{t as b}from"./chevron-down-CI8A6tet.js";import{t as ee}from"./loader-circle-BEykUKYG.js";import{C as x,M as S,t as C}from"./utils-CE0lDWtb.js";import{n as w}from"./common-Dh7OqABE.js";import{n as T,o as E}from"./form-control-classes-9rkU4usZ.js";import{t as te}from"./use-config-Dwf5gla-.js";import{n as ne}from"./navigation-context-DPs2G0X8.js";import{t as re}from"./styled-tooltip-DsKsFjuq.js";import{t as ie}from"./react-DPDgL6du.js";import{s as D}from"./conversation-local-storage-F6zVMM--.js";import{t as O}from"./conversation-store-LptbOvKa.js";import{r as ae}from"./use-settings-B07msZ2Z.js";import{t as oe}from"./agent-server-conversation-service.api-DfH2k6Sx.js";import{t as se}from"./conversation-service.api-Ch9kR9aE.js";import{n as ce}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js";import{t as le}from"./skills-9cDZONKh.js";import{t as ue}from"./close-p3Op5lxI.js";import{t as de}from"./copy-to-clipboard-button-Aj9wFmt2.js";import{r as k}from"./typography-YGPBGzOG.js";import{t as fe}from"./u-check-circle-BqoIxNz_.js";import{n as pe,r as A,t as me}from"./use-active-conversation-DvcFBqFe.js";import{n as he}from"./files-tab-store-DJsPxYdg.js";import{t as ge}from"./use-agent-state-BvRcEzY4.js";import{d as _e,f as ve,m as ye,p as be,r as xe,t as Se}from"./lesson-plan-HD886V64.js";import{C as Ce,O as we,S as j,T as Te,a as Ee,b as De,c as Oe,i as ke,m as Ae,o as je,r as Me,s as M,t as Ne,y as Pe}from"./use-event-store-YSOxy9FC.js";import{ot as Fe,st as Ie}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js";import{n as Le,t as N}from"./markdown-renderer-D8mayGjI.js";import{n as Re,r as ze,t as Be}from"./plan-components-j9X4AxYM.js";import{n as Ve,t as He}from"./get-language-from-path-CPNnuVhI.js";import{n as Ue,t as We}from"./u-check-circle-half-LiwZkuFe.js";var Ge=y(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(t(),1);function Ke(){!r.current&&n();let[e]=(0,P.useState)(i.current);return e}var F=a(),qe=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}(qe||{});function Je(){let{conversationId:e}=A(),t=xe();return{send:(0,P.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 Ye(e,t,n,r){return{action:qe.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.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`})}),L=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.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 Xe({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(ce,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:s}=m(`openhands`),[c,l]=P.useState(r),u=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`cursor-pointer text-left`,"aria-label":s(c?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:c?(0,F.jsx)(L,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:C(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&u,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&u]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(Xe,{status:n})]})]}),c&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var Ze=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.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`})}),Qe=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.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`})}),$e={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function et({status:e}){let{t}=m(`openhands`),{conversationId:n}=A(),r=be(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:l,iteration:u,max_iterations:f,verdict:p}=e,_=p?Math.round(p.score*100):null,v=p?.missing?t(h.GOAL$MISSING,{missing:p.missing}):``,y=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){g(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},b=()=>y(async e=>{await s(e),await d(e)},h.GOAL$STOP_FAILED),ee=()=>y(c,h.GOAL$RESUME_FAILED),x=null;return n&&o?x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:b,className:C(T,E),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(x=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:ee,className:C(T,E),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:l}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:u,max:f})}),(0,F.jsx)(`span`,{children:t($e[e.status])}),_!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:_})}),o?(0,F.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,F.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,F.jsx)(Ze,{className:`w-3.5 h-3.5 fill-success`})}):(0,F.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,F.jsx)(Qe,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:x,details:v,initiallyExpanded:!o,chevronPosition:`before`})})}var tt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,F.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,F.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,F.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function nt({profile:e}){let[t,n]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.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,F.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-neutral-700`}),(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function rt({conversationId:e,anchorEventId:t}){let n=ve(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,F.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(tt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(p,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.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,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(p,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(p,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(p,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(nt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var it=(0,P.createContext)(void 0);function at({children:e,value:t}){let n=ze(P.useRef(null)),r=t||n;return(0,F.jsx)(it.Provider,{value:r,children:e})}function ot(){let e=(0,P.useContext)(it);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function st(){return(0,P.useContext)(it)}var ct=()=>{let{setConversationMode:e}=O(),{send:t}=Je(),{conversationId:n}=A(),r=ye(e=>e.enqueuePendingMessage),i=ye(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,P.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(Ye(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},lt=`200%`,z=8,ut=z*2;function dt({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ke(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(z/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=z/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) ${z}%)`,backgroundSize:`${lt} 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,F.jsx)(t,{className:C(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${ut}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:C(`relative inline-block`,n),style:u,...o,children:e})]})}var ft=P.memo(dt);function pt({className:e}){return(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,F.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,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var mt=5,ht=360,gt={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function _t({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=m(`openhands`),a=P.useRef(null),[o,s]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){s(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=mt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;s(t.scrollHeight>r+1||i>=mt||e.trim().length>ht)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let c=o&&!n;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(`div`,{ref:a,className:C(`text-sm leading-6 whitespace-normal [word-break:break-word]`,c&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:gt,children:e})}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.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,F.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:C(`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 B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:s}){let{t:c}=m(`openhands`),[l,u]=P.useState(!1),[d,f]=P.useState(!1),[p,g]=P.useState(!1),[_,v]=P.useState(!1),[y,b]=P.useState(!0),ee=P.useRef(null);P.useEffect(()=>{g(!1)},[t]);let x=async()=>{await navigator.clipboard.writeText(t),f(!0)};P.useEffect(()=>{let e;return d&&(e=setTimeout(()=>{f(!1)},2e3)),()=>{clearTimeout(e)}},[d]);let S=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&s!=null,T=w&&l,E=e===`user`&&a==null,te=E&&_&&!p,ne=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=ee.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let ie=E?(0,F.jsx)(_t,{message:t,isHovering:l,isExpanded:p,onTruncatableChange:v}):(0,F.jsx)(`div`,{ref:ee,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:gt,children:t})}),D=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:C(`rounded-xl relative w-fit max-w-full flex flex-col`,ne&&`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`,!S&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:C(`absolute -top-2.5 -right-2.5 z-10`,!l||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(re,{content:e.tooltip,placement:`top`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,F.jsx)(de,{isHidden:!l,isDisabled:d,onClick:x,mode:d?`copied`:`copy`})]}),ie,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s?.()},"data-testid":`chat-message-stop`,"aria-label":c(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:C(`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`,y?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(pt,{className:`block h-7 w-7 max-w-none`})}):null,te?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":c(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>g(!0)}):null,n]});return e===`user`&&a===`error`?(0,F.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[D,(0,F.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,F.jsx)(`span`,{children:c(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.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:c(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,F.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[D,(0,F.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,F.jsx)(ft,{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:c(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function vt(){let{conversationId:e}=pe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=O(),{setSelectedTab:a}=D(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var yt=300,bt=Be(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=m(`openhands`),{navigateToTab:i}=vt(),{handleBuildPlanClick:a}=ct(),{scrollDomToBottom:o}=ot(),s=()=>{i(`planner`)},c=(0,P.useCallback)(e=>{a(e),o()},[a,o]),l=(0,P.useMemo)(()=>e?e.length<=yt?e:`${e.slice(0,yt)}...`:``,[e]);return e?(0,F.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,F.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,F.jsx)(Se,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.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,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(Ge,{className:`text-white`,size:18})]})]}),(0,F.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:l&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{includeStandard:!0,components:t?bt:Re,children:l}),e&&e.length>yt&&(0,F.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,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:c,disabled:n,className:C(`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,F.jsxs)(k.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=m(`openhands`),[r,i]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&_.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Ct({event:e}){return Oe(e)?(0,F.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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 Tt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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 Et({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:C(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ue,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:C(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,F.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,F.jsx)(Dt,{src:e,size:n}),t&&(0,F.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=P.useRef(null),[i,a]=P.useState(!1),[o,s]=P.useState(!0),[c,l]=P.useState(!1);return P.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,F.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,F.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(wt,{active:!o})}),(0,F.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:C(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,F.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=m(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(re,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:C(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:C(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,F.jsx)(`span`,{className:``,children:n}),(0,F.jsx)(`span`,{className:`font-bold`,children:i}),(0,F.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=ie(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>f({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return _e.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=m(`openhands`),{data:r}=me(),{curAgentState:i}=ge(),{mutate:a}=Pt(),o=Ne(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===x.AWAITING_USER_CONFIRMATION:!1),s=(0,P.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,P.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),s(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),s(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,s]),i!==x.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(M(o)?o.security_risk:w.UNKNOWN)===w.HIGH&&(0,F.jsx)(jt,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(At,{type:`reject`,onClick:()=>s(!1)}),(0,F.jsx)(At,{type:`confirm`,onClick:()=>s(!0)})]})]})]})}var It=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(`
2
- `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=_.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Lt(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Rt(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function zt(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Bt(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Vt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ht(e){let t=e?.verification;if(!Vt(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function Ut({feature:e}){let t=Math.round(e.probability*100),n=Bt(e.probability);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,F.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function V({label:e,features:t}){return!t||t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0&&(0,F.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,F.jsx)(Ut,{feature:e})]},e.name))]})}function Wt({categorized:e}){let{t}=m(),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,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,F.jsx)(V,{label:t(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(V,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(V,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(V,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Gt({criticResult:e}){let{t}=m(),{data:n}=ae(),[r,i]=P.useState(!1),a=Lt(e.score),{filled:o,empty:s}=Rt(a),c=zt(a),l=(a*100).toFixed(1),u=Ht(n?.agent_settings)===!1,d=e.metadata?.categorized_features,f=d!=null&&((d.agent_behavioral_issues??[]).length>0||(d.user_followup_patterns??[]).length>0||(d.infrastructure_issues??[]).length>0||(d.other??[]).length>0);return(0,F.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(h.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,F.jsxs)(`span`,{className:`${c} text-xs tracking-wide`,"aria-label":`Score: ${l}%`,children:[`★`.repeat(o),`☆`.repeat(s)]}),(0,F.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,l,`%)`]}),f&&(0,F.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,F.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,F.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&f&&(0,F.jsx)(Wt,{categorized:d}),u&&(0,F.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)})]})}function H({content:e}){let{t}=m(`openhands`),[n,r]=P.useState(!1);if(!e.trim())return null;let i=n?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,F.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,F.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(Ve,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(N,{children:e})})]})}var Kt=()=>{let e=o();return f({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await oe.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await oe.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function qt({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=m(`openhands`),{navigate:i}=ne(),{conversationId:a}=A(),o=v().backend.kind===`cloud`,{mutate:s,isPending:c}=Kt(),l=O(e=>e.setMessageToSend),d=P.useRef(!1),f=It(e),{reasoning:p,message:_}=e.source===`agent`?Ee(f):{reasoning:``,message:f},y=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&y.push(...e.image_urls)});let b=!o&&a?[{icon:(0,F.jsx)(u,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||c||d.current)return;d.current=!0;let t=se.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&_.length>0;s({sourceConversationId:a,eventId:e.id,...o?{editText:_}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>l(_),0)},onError:e=>g(e instanceof Error?e.message:null),onSettled:()=>{d.current=!1}})},tooltip:r(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[p&&(0,F.jsx)(H,{content:p}),(0,F.jsxs)(B,{type:e.source,message:_,isFromPlanningAgent:n,actions:b,children:[y.length>0&&(0,F.jsx)(kt,{size:`small`,images:y}),t&&(0,F.jsx)(Ft,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Gt,{criticResult:e.critic_result})]})}var Jt=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)}},Yt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Xt(e){let{children:t}=e,n=e=>{try{return Yt(e)}catch(t){return Jt.error(String(t)),e}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var Zt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},Qt=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,$t=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return Qt(e)&&!n.endsWith(`/`)?`${n}/`:n};function en(e){let{children:t}=e,n=e=>{try{let t=Zt(e);return(0,F.jsx)(`span`,{className:`font-mono`,title:t,children:$t(t)})}catch(t){return Jt.error(String(t)),(0,F.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map((e,t)=>typeof e==`string`?(0,F.jsx)(`span`,{children:n(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var U=1e3,tn=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,nn=e=>{switch(e){case w.LOW:return _.t(h.SECURITY$LOW_RISK);case w.MEDIUM:return _.t(h.SECURITY$MEDIUM_RISK);case w.HIGH:return _.t(h.SECURITY$HIGH_RISK);case w.UNKNOWN:default:return _.t(h.SECURITY$UNKNOWN_RISK)}},W=()=>``,rn=e=>e.name?`**Skill:** \`${e.name}\``:W(),an=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(`
3
- `):W()},on=e=>{if(e.command!==`create`||!e.file_text)return W();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,U)}...`),`${e.path}\n${t}`},sn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===w.HIGH||e.security_risk===w.MEDIUM)&&(t+=`\n\n${nn(e.security_risk)}`),t},cn=e=>{let t=`**MCP Tool Call**
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,M as n,N as r,P as i,bt as a}from"./vendor-styling-CI0PQ3ab.js";import{n as o}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{d as s,l as c,m as l,r as u,s as d}from"./path-utils-DWcgCGen.js";import{t as f}from"./useMutation-DCE9RcgK.js";import{t as p}from"./Trans-DY6toRDu.js";import{t as m}from"./useTranslation-CDRCKC9-.js";import{t as h}from"./declaration-gq8V5eTU.js";import{A as g,U as _,n as v}from"./active-backend-context-B3umL5R-.js";import{t as y}from"./createLucideIcon-CVAsW2Yo.js";import{t as b}from"./chevron-down-CI8A6tet.js";import{t as x}from"./loader-circle-BEykUKYG.js";import{C as S,M as C,t as w}from"./utils-D3U3rlqr.js";import{n as T}from"./common-Dh7OqABE.js";import{n as E,o as D}from"./form-control-classes-ChpNBe9n.js";import{t as ee}from"./use-config-CHzNIHpv.js";import{n as te}from"./navigation-context-DPs2G0X8.js";import{t as ne}from"./styled-tooltip-CgX2oRaK.js";import{t as re}from"./react-DPDgL6du.js";import{s as ie}from"./conversation-local-storage-F6zVMM--.js";import{t as O}from"./conversation-store-LptbOvKa.js";import{r as ae}from"./use-settings-BReAMxCG.js";import{t as oe}from"./agent-server-conversation-service.api-D_ZvtJjG.js";import{t as se}from"./conversation-service.api-DQaKzIRj.js";import{n as ce}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-_TdZcNMD.js";import{t as le}from"./skills-9cDZONKh.js";import{t as ue}from"./close-p3Op5lxI.js";import{t as de}from"./copy-to-clipboard-button-CaR52OnA.js";import{r as k}from"./typography-D8mHDeNG.js";import{t as fe}from"./u-check-circle-BqoIxNz_.js";import{n as pe,r as A,t as me}from"./use-active-conversation-D-r929nx.js";import{n as he}from"./files-tab-store-DJsPxYdg.js";import{t as ge}from"./use-agent-state-DijdVAQ0.js";import{d as _e,f as ve,m as ye,p as be,r as xe,t as Se}from"./lesson-plan-DgpP80mJ.js";import{C as j,E as Ce,a as we,b as Te,c as M,h as Ee,i as De,k as Oe,l as ke,o as Ae,s as je,t as Me,w as Ne,x as Pe}from"./use-event-store-DjgU4wfO.js";import{ot as Fe,st as Ie}from"./vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-d8aETPbZ.js";import{n as Le,t as N}from"./markdown-renderer-DMT7Zkpd.js";import{n as Re,r as ze,t as Be}from"./plan-components-CcCBmCzW.js";import{n as Ve,t as He}from"./get-language-from-path-CPNnuVhI.js";import{n as Ue,t as We}from"./u-check-circle-half-LiwZkuFe.js";var Ge=y(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(t(),1);function Ke(){!r.current&&n();let[e]=(0,P.useState)(i.current);return e}var F=a(),qe=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}(qe||{});function Je(){let{conversationId:e}=A(),t=xe();return{send:(0,P.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 Ye(e,t,n,r){return{action:qe.MESSAGE,args:{content:e,image_urls:t,file_urls:n,timestamp:r}}}var I=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.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`})}),L=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`,...e,children:(0,F.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 Xe({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(ce,{"data-testid":`status-icon`,className:`h-4 w-4 ml-2 inline fill-yellow-500`})})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o}){let{t:s}=m(`openhands`),[c,l]=P.useState(r),u=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`cursor-pointer text-left`,"aria-label":s(c?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:c?(0,F.jsx)(L,{className:w(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:w(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5 my-1 py-1 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between font-normal text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center`,children:[i===`before`&&u,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&u]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(Xe,{status:n})]})]}),c&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var Ze=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.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`})}),Qe=e=>(0,F.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`,...e,children:(0,F.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`})}),$e={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function et({status:e}){let{t}=m(`openhands`),{conversationId:n}=A(),r=be(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:l,iteration:u,max_iterations:f,verdict:p}=e,_=p?Math.round(p.score*100):null,v=p?.missing?t(h.GOAL$MISSING,{missing:p.missing}):``,y=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){g(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},b=()=>y(async e=>{await s(e),await d(e)},h.GOAL$STOP_FAILED),x=()=>y(c,h.GOAL$RESUME_FAILED),S=null;return n&&o?S=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:b,className:w(E,D),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(S=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:x,className:w(E,D),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:l}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:u,max:f})}),(0,F.jsx)(`span`,{children:t($e[e.status])}),_!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$SCORE,{score:_})}),o?(0,F.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,F.jsx)(`span`,{"data-testid":`goal-done`,className:`inline-flex ml-1`,children:(0,F.jsx)(Ze,{className:`w-3.5 h-3.5 fill-success`})}):(0,F.jsx)(`span`,{"data-testid":`goal-ended`,className:`inline-flex ml-1`,children:(0,F.jsx)(Qe,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:S,details:v,initiallyExpanded:!o,chevronPosition:`before`})})}var tt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,...e,children:[(0,F.jsxs)(`g`,{clipPath:`url(#clip0_17463_15006)`,children:[(0,F.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,F.jsx)(`path`,{d:`M6 8V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,F.jsx)(`path`,{d:`M6 4H6.00667`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),(0,F.jsx)(`defs`,{children:(0,F.jsx)(`clipPath`,{id:`clip0_17463_15006`,children:(0,F.jsx)(`rect`,{width:12,height:12,fill:`white`})})})]});function nt({profile:e}){let[t,n]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`border border-neutral-700 rounded-md overflow-hidden`,children:[(0,F.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,F.jsx)(`span`,{className:`text-neutral-300`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(`span`,{className:`font-normal text-neutral-200 text-sm`,children:e.name})]}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-neutral-700`}),(0,F.jsx)(`div`,{className:`px-3 py-2 text-xs text-neutral-300 font-mono whitespace-pre-wrap`,children:`model: ${e.model??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function rt({conversationId:e,anchorEventId:t}){let n=ve(e=>e.entriesByConversation),r=(e?n[e]??[]:[]).filter(e=>e.anchorEventId===t);return!e||r.length===0?null:(0,F.jsx)(`div`,{"data-testid":`model-messages`,className:`flex flex-col w-full`,children:r.map(e=>{if(e.switchedTo)return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(tt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(p,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.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,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(p,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(p,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(p,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(nt,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}var it=(0,P.createContext)(void 0);function at({children:e,value:t}){let n=ze(P.useRef(null)),r=t||n;return(0,F.jsx)(it.Provider,{value:r,children:e})}function ot(){let e=(0,P.useContext)(it);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function st(){return(0,P.useContext)(it)}var ct=()=>{let{setConversationMode:e}=O(),{send:t}=Je(),{conversationId:n}=A(),r=ye(e=>e.enqueuePendingMessage),i=ye(e=>e.markPendingMessageError);return{handleBuildPlanClick:(0,P.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(Ye(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},lt=`200%`,z=8,ut=z*2;function dt({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=Ke(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(z/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=z/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) ${z}%)`,backgroundSize:`${lt} 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,F.jsx)(t,{className:w(`text-[var(--oh-muted)]`,n),style:a,...o,children:e}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`@keyframes ${c}{from{background-position:${ut}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:w(`relative inline-block`,n),style:u,...o,children:e})]})}var ft=P.memo(dt);function pt({className:e}){return(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":!0,className:e,children:[(0,F.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,F.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,className:`fill-[var(--oh-color-tertiary)]`})]})}var mt=5,ht=360,gt={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e})};function _t({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=m(`openhands`),a=P.useRef(null),[o,s]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){s(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=mt*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;s(t.scrollHeight>r+1||i>=mt||e.trim().length>ht)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let c=o&&!n;return(0,F.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,F.jsx)(`div`,{ref:a,className:w(`text-sm leading-6 whitespace-normal [word-break:break-word]`,c&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:gt,children:e})}),c?(0,F.jsxs)(F.Fragment,{children:[(0,F.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,F.jsx)(`span`,{"data-testid":`chat-message-view-more`,className:w(`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 B({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onStop:s}){let{t:c}=m(`openhands`),[l,u]=P.useState(!1),[d,f]=P.useState(!1),[p,g]=P.useState(!1),[_,v]=P.useState(!1),[y,b]=P.useState(!0),x=P.useRef(null);P.useEffect(()=>{g(!1)},[t]);let S=async()=>{await navigator.clipboard.writeText(t),f(!0)};P.useEffect(()=>{let e;return d&&(e=setTimeout(()=>{f(!1)},2e3)),()=>{clearTimeout(e)}},[d]);let C=e===`user`&&(a===`error`||a===`sending`),T=a===`sending`&&s!=null,E=T&&l,D=e===`user`&&a==null,ee=D&&_&&!p,te=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!T||D)return;let e=x.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;b(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,T,D]);let re=D?(0,F.jsx)(_t,{message:t,isHovering:l,isExpanded:p,onTruncatableChange:v}):(0,F.jsx)(`div`,{ref:x,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:gt,children:t})}),ie=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:w(`rounded-xl relative w-fit max-w-full flex flex-col`,te&&`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`,!C&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:w(`absolute -top-2.5 -right-2.5 z-10`,!l||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(ne,{content:e.tooltip,placement:`top`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":e.tooltip,children:e.icon})},t):(0,F.jsx)(`button`,{type:`button`,onClick:e.onClick,className:`button-base p-1 cursor-pointer`,"aria-label":`Action ${t+1}`,children:e.icon},t)),(0,F.jsx)(de,{isHidden:!l,isDisabled:d,onClick:S,mode:d?`copied`:`copy`})]}),re,T?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s?.()},"data-testid":`chat-message-stop`,"aria-label":c(h.BUTTON$STOP),"aria-hidden":!E,tabIndex:E?0:-1,className:w(`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`,y?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,E?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(pt,{className:`block h-7 w-7 max-w-none`})}):null,ee?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":c(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>g(!0)}):null,n]});return e===`user`&&a===`error`?(0,F.jsxs)(`div`,{className:`flex w-fit max-w-full flex-col items-end gap-1.5 self-end last:mb-4`,children:[ie,(0,F.jsxs)(`div`,{role:`alert`,"data-testid":`chat-message-error`,className:`flex items-center gap-2 text-xs text-[var(--oh-status-error)]`,children:[(0,F.jsx)(`span`,{children:c(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.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:c(h.CHAT_INTERFACE$MESSAGE_RETRY)}):null]})]}):e===`user`&&a===`sending`?(0,F.jsxs)(`div`,{className:`flex w-full max-w-full flex-col last:mb-4`,children:[ie,(0,F.jsx)(`div`,{className:`my-1 w-full py-1 text-sm`,children:(0,F.jsx)(ft,{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:c(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):ie}function vt(){let{conversationId:e}=pe(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setSelectedTab:i}=O(),{setSelectedTab:a}=ie(e),o=e=>{i(e),a(e)};return{selectTab:e=>{t===e&&n?r(!1):(o(e),n||r(!0))},navigateToTab:e=>{o(e),n||r(!0)},isTabActive:e=>n&&t===e,onTabChange:o,selectedTab:t,isRightPanelShown:n}}var yt=300,bt=Be(`shine-text`);function xt({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=m(`openhands`),{navigateToTab:i}=vt(),{handleBuildPlanClick:a}=ct(),{scrollDomToBottom:o}=ot(),s=()=>{i(`planner`)},c=(0,P.useCallback)(e=>{a(e),o()},[a,o]),l=(0,P.useMemo)(()=>e?e.length<=yt?e:`${e.slice(0,yt)}...`:``,[e]);return e?(0,F.jsxs)(`div`,{className:`bg-[var(--oh-surface)] border border-[#597FF4] rounded-[12px] w-full mt-2`,children:[(0,F.jsxs)(`div`,{className:`border-b border-[var(--oh-border)] flex h-[41px] items-center px-2 gap-1`,children:[(0,F.jsx)(Se,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.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,F.jsx)(k.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(h.COMMON$VIEW)}),(0,F.jsx)(Ge,{className:`text-white`,size:18})]})]}),(0,F.jsx)(`div`,{"data-testid":`plan-preview-content`,className:`flex flex-col gap-[10px] p-4 text-[15px] text-white leading-[29px]`,children:l&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(N,{includeStandard:!0,components:t?bt:Re,children:l}),e&&e.length>yt&&(0,F.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,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:c,disabled:n,className:w(`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,F.jsxs)(k.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(k.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function St({errorId:e,defaultMessage:t}){let{t:n}=m(`openhands`),[r,i]=P.useState(!1);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 my-2 py-2 text-sm w-full`,children:[(0,F.jsxs)(`div`,{className:`font-bold text-danger`,children:[n(e&&_.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Ct({event:e}){return ke(e)?(0,F.jsx)(St,{errorId:e.id,defaultMessage:e.error}):null}function wt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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 Tt({width:e=20,height:t=20,active:n}){return(0,F.jsx)(`svg`,{width:e,height:t,viewBox:`0 0 ${e} ${t}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,F.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 Et({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:w(`bg-[var(--oh-muted)] rounded-full w-5 h-5 flex items-center justify-center cursor-pointer`,t),children:(0,F.jsx)(ue,{width:18,height:18})})}function Dt({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:w(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Ot({src:e,onRemove:t,size:n=`small`}){return(0,F.jsxs)(`div`,{"data-testid":`image-preview`,className:`relative w-fit shrink-0 py-1`,children:[(0,F.jsx)(Dt,{src:e,size:n}),t&&(0,F.jsx)(Et,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function kt({size:e=`small`,images:t,onRemove:n}){let r=P.useRef(null),[i,a]=P.useState(!1),[o,s]=P.useState(!0),[c,l]=P.useState(!1);return P.useEffect(()=>{let e=r.current;e&&a(e.scrollWidth>e.clientWidth)},[t]),(0,F.jsxs)(`div`,{"data-testid":`image-carousel`,className:`relative`,children:[i&&(0,F.jsx)(`div`,{className:`absolute right-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(wt,{active:!o})}),(0,F.jsx)(`div`,{ref:r,onScroll:e=>{let t=e.currentTarget;s(t.scrollLeft===0),l(t.scrollLeft+t.clientWidth===t.scrollWidth)},className:w(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Ot,{size:e,src:t,onRemove:n?()=>n?.(r):void 0},r))}),i&&(0,F.jsx)(`div`,{className:`absolute left-full transform top-1/2 -translate-y-1/2`,children:(0,F.jsx)(Tt,{active:!c})})]})}function At({type:e,onClick:t}){let{t:n}=m(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ne,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:w(`rounded px-2 h-6.5 text-sm font-normal leading-5 cursor-pointer hover:opacity-80`,e===`confirm`?`bg-tertiary text-white`:`bg-white text-base`),onClick:t,children:o})})}function jt({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:w(`flex items-center gap-3.5 bg-[#4A0709] border border-[#FF0006] text-red-400 rounded-xl px-3.5 h-13 text-sm text-white`,e),children:[n&&(0,F.jsx)(`span`,{className:``,children:n}),(0,F.jsx)(`span`,{className:`font-bold`,children:i}),(0,F.jsx)(`span`,{className:`font-normal`,children:t})]}):null}var Mt=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M12 14C11.4477 14 11 13.5523 11 13V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13C13 13.5523 12.5523 14 12 14Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.5 16.5C10.5 15.6716 11.1716 15 12 15C12.8284 15 13.5 15.6716 13.5 16.5C13.5 17.3284 12.8284 18 12 18C11.1716 18 10.5 17.3284 10.5 16.5Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M10.2301 3.2156C10.98 1.79093 13.02 1.79092 13.7698 3.2156L22.1135 19.0685C22.8144 20.4003 21.8486 22 20.3436 22H3.65635C2.15133 22 1.18556 20.4003 1.88651 19.0685L10.2301 3.2156ZM20.3436 20L12 4.1471L3.65635 20L20.3436 20Z`,fill:`currentColor`})]}),Nt=re(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Pt=()=>f({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return _e.respondToConfirmation(e,t,i,n)}});function Ft(){let e=Nt(e=>e.submittedEventIds),t=Nt(e=>e.addSubmittedEventId),{t:n}=m(`openhands`),{data:r}=me(),{curAgentState:i}=ge(),{mutate:a}=Pt(),o=Me(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===S.AWAITING_USER_CONFIRMATION:!1),s=(0,P.useCallback)(e=>{!o||!r||(t(o.id),a({conversationId:r.id,conversationUrl:r.conversation_url||``,sessionApiKey:r.session_api_key,accept:e}))},[o,r,t,a]);return(0,P.useEffect)(()=>{if(!o)return;let e=e=>{e.shiftKey&&e.metaKey&&e.key===`Backspace`&&(e.preventDefault(),s(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),s(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,s]),i!==S.AWAITING_USER_CONFIRMATION||!o||e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(M(o)?o.security_risk:T.UNKNOWN)===T.HIGH&&(0,F.jsx)(jt,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Mt,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(At,{type:`reject`,onClick:()=>s(!1)}),(0,F.jsx)(At,{type:`confirm`,onClick:()=>s(!0)})]})]})]})}var It=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(`
2
+ `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=_.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Lt(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Rt(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function zt(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Bt(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Vt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ht(e){let t=e?.verification;if(!Vt(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function Ut({feature:e}){let t=Math.round(e.probability*100),n=Bt(e.probability);return(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`text-neutral-200`,children:e.display_name}),(0,F.jsxs)(`span`,{className:n,children:[`(`,t,`%)`]})]})}function V({label:e,features:t}){return!t||t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 text-xs`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300`,children:e}),t.map((e,t)=>(0,F.jsxs)(P.Fragment,{children:[t>0&&(0,F.jsx)(`span`,{className:`text-neutral-500`,children:`·`}),(0,F.jsx)(Ut,{feature:e})]},e.name))]})}function Wt({categorized:e}){let{t}=m(),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,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1.5`,children:[n&&(0,F.jsx)(V,{label:t(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(V,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(V,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(V,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Gt({criticResult:e}){let{t}=m(),{data:n}=ae(),[r,i]=P.useState(!1),a=Lt(e.score),{filled:o,empty:s}=Rt(a),c=zt(a),l=(a*100).toFixed(1),u=Ht(n?.agent_settings)===!1,d=e.metadata?.categorized_features,f=d!=null&&((d.agent_behavioral_issues??[]).length>0||(d.user_followup_patterns??[]).length>0||(d.infrastructure_issues??[]).length>0||(d.other??[]).length>0);return(0,F.jsxs)(`div`,{className:`border-l-2 border-neutral-600 pl-2 my-2 py-1.5 text-sm`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(`span`,{className:`font-semibold text-neutral-300 text-xs`,children:t(h.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,F.jsxs)(`span`,{className:`${c} text-xs tracking-wide`,"aria-label":`Score: ${l}%`,children:[`★`.repeat(o),`☆`.repeat(s)]}),(0,F.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,l,`%)`]}),f&&(0,F.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,F.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,F.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&f&&(0,F.jsx)(Wt,{categorized:d}),u&&(0,F.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)})]})}function H({content:e}){let{t}=m(`openhands`),[n,r]=P.useState(!1);if(!e.trim())return null;let i=n?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`collapsible-thinking`,children:[(0,F.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,F.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(Ve,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(N,{children:e})})]})}var Kt=()=>{let e=o();return f({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await oe.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await oe.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function qt({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=m(`openhands`),{navigate:i}=te(),{conversationId:a}=A(),o=v().backend.kind===`cloud`,{mutate:s,isPending:c}=Kt(),l=O(e=>e.setMessageToSend),d=P.useRef(!1),f=It(e),{reasoning:p,message:_}=e.source===`agent`?Ae(f):{reasoning:``,message:f},y=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&y.push(...e.image_urls)});let b=!o&&a?[{icon:(0,F.jsx)(u,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||c||d.current)return;d.current=!0;let t=se.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&_.length>0;s({sourceConversationId:a,eventId:e.id,...o?{editText:_}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>l(_),0)},onError:e=>g(e instanceof Error?e.message:null),onSettled:()=>{d.current=!1}})},tooltip:r(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[p&&(0,F.jsx)(H,{content:p}),(0,F.jsxs)(B,{type:e.source,message:_,isFromPlanningAgent:n,actions:b,children:[y.length>0&&(0,F.jsx)(kt,{size:`small`,images:y}),t&&(0,F.jsx)(Ft,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Gt,{criticResult:e.critic_result})]})}var Jt=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)}},Yt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Xt(e){let{children:t}=e,n=e=>{try{return Yt(e)}catch(t){return Jt.error(String(t)),e}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map(e=>typeof e==`string`?n(e):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{className:`font-mono`,children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var Zt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},Qt=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,$t=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return Qt(e)&&!n.endsWith(`/`)?`${n}/`:n};function en(e){let{children:t}=e,n=e=>{try{let t=Zt(e);return(0,F.jsx)(`span`,{className:`font-mono`,title:t,children:$t(t)})}catch(t){return Jt.error(String(t)),(0,F.jsx)(`span`,{className:`font-mono`,children:e})}};return Array.isArray(t)?(0,F.jsx)(`strong`,{className:`font-mono`,children:t.map((e,t)=>typeof e==`string`?(0,F.jsx)(`span`,{children:n(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,F.jsx)(`strong`,{children:n(t)}):(0,F.jsx)(`strong`,{className:`font-mono`,children:t})}var U=1e3,tn=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,nn=e=>{switch(e){case T.LOW:return _.t(h.SECURITY$LOW_RISK);case T.MEDIUM:return _.t(h.SECURITY$MEDIUM_RISK);case T.HIGH:return _.t(h.SECURITY$HIGH_RISK);case T.UNKNOWN:default:return _.t(h.SECURITY$UNKNOWN_RISK)}},W=()=>``,rn=e=>e.name?`**Skill:** \`${e.name}\``:W(),an=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(`
3
+ `):W()},on=e=>{if(e.command!==`create`||!e.file_text)return W();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,U)}...`),`${e.path}\n${t}`},sn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===T.HIGH||e.security_risk===T.MEDIUM)&&(t+=`\n\n${nn(e.security_risk)}`),t},cn=e=>{let t=`**MCP Tool Call**
4
4
 
5
5
  `;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},ln=e=>e.thought,un=e=>e.message.trim(),dn=e=>{let t=`**Command:** \`${e.command}\``;return e.command===`plan`&&(e.task_list&&e.task_list.length>0?(t+=`\n\n**Task List (${e.task_list.length} ${e.task_list.length===1?`item`:`items`}):**\n`,e.task_list.forEach((e,n)=>{let r={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;t+=`\n${n+1}. ${r} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(t+=`\n *Notes: ${e.notes}*`)})):t+=`
6
6
 
@@ -24,17 +24,17 @@ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,M as n,N as r,
24
24
  `)),r.length>1e3&&(r=`${r.slice(0,U)}...(truncated)`),r},Dn=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
25
25
  `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
26
26
  `,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(`
27
- `)),r.length>1e3&&(r=`${r.slice(0,U)}...(truncated)`),r},On=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return gn(e);case`ExecuteBashObservation`:case`TerminalObservation`:return _n(e);case`BrowserObservation`:return vn(e);case`MCPToolObservation`:return yn(e);case`TaskTrackerObservation`:return Cn(e);case`ThinkObservation`:return wn(e);case`FinishObservation`:return Tn(e);case`GlobObservation`:return En(e);case`GrepObservation`:return Dn(e);case`InvokeSkillObservation`:return bn(e);case`CanvasUIObservation`:return xn(e);case`SwitchLLMObservation`:return Sn(e);default:return tn(e)}},kn=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`}},An={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},jn=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=An[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},Mn=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Nn=e=>e.length>1e3?`${e.slice(0,U)}...`:e,Pn=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=Mn(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Nn(Mn(r).trim()),s=i?`**Error:**`:`Output:`,c=o||_.t(h.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a};function Fn({task:e}){let{t}=m(`openhands`),n=(0,P.useMemo)(()=>{switch(e.status){case`todo`:return(0,F.jsx)(Ue,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,F.jsx)(We,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,F.jsx)(fe,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,F.jsx)(Ue,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,F.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,F.jsx)(`div`,{className:`shrink-0`,children:n}),(0,F.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,F.jsx)(k.Text,{className:C(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,F.jsxs)(k.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function In({taskList:e}){let{t}=m(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,F.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,F.jsx)(Se,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,F.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,F.jsx)(`div`,{children:e.map((e,t)=>(0,F.jsx)(Fn,{task:e},`task-${t}`))})]})}function Ln({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,F.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,F.jsx)(In,{taskList:r})})}var Rn=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),zn=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},Bn=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Vn=(e,t)=>{let n=`
27
+ `)),r.length>1e3&&(r=`${r.slice(0,U)}...(truncated)`),r},On=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return gn(e);case`ExecuteBashObservation`:case`TerminalObservation`:return _n(e);case`BrowserObservation`:return vn(e);case`MCPToolObservation`:return yn(e);case`TaskTrackerObservation`:return Cn(e);case`ThinkObservation`:return wn(e);case`FinishObservation`:return Tn(e);case`GlobObservation`:return En(e);case`GrepObservation`:return Dn(e);case`InvokeSkillObservation`:return bn(e);case`CanvasUIObservation`:return xn(e);case`SwitchLLMObservation`:return Sn(e);default:return tn(e)}},kn=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`}},An={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},jn=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=An[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},Mn=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Nn=e=>e.length>1e3?`${e.slice(0,U)}...`:e,Pn=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=Mn(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Nn(Mn(r).trim()),s=i?`**Error:**`:`Output:`,c=o||_.t(h.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a};function Fn({task:e}){let{t}=m(`openhands`),n=(0,P.useMemo)(()=>{switch(e.status){case`todo`:return(0,F.jsx)(Ue,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,F.jsx)(We,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,F.jsx)(fe,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,F.jsx)(Ue,{className:`w-4 h-4 text-[#ffffff]`})}},[e.status]),r=e.status===`done`;return(0,F.jsxs)(`div`,{className:`flex gap-[14px] items-center px-4 py-2 w-full`,"data-name":`item`,children:[(0,F.jsx)(`div`,{className:`shrink-0`,children:n}),(0,F.jsxs)(`div`,{className:`flex flex-col items-start justify-center leading-[20px] text-nowrap whitespace-pre font-normal`,children:[(0,F.jsx)(k.Text,{className:w(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,F.jsxs)(k.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function In({taskList:e}){let{t}=m(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col overflow-clip bg-[var(--oh-surface)] border border-[var(--oh-border)] rounded-[12px] w-full`,children:[(0,F.jsxs)(`div`,{className:`flex gap-1 items-center border-b border-[var(--oh-border)] h-[41px] px-2 shrink-0`,children:[(0,F.jsx)(Se,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,F.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,F.jsx)(`div`,{children:e.map((e,t)=>(0,F.jsx)(Fn,{task:e},`task-${t}`))})]})}function Ln({event:e}){let{observation:t}=e,{command:n,task_list:r}=t;return(0,F.jsx)(`div`,{className:`flex flex-col gap-4`,children:n===`plan`&&r.length>0&&(0,F.jsx)(In,{taskList:r})})}var Rn=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),zn=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},Bn=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Vn=(e,t)=>{let n=`
28
28
 
29
29
  **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=Bn(e,i)}),n},Hn=e=>{let t=`
30
30
 
31
31
  **Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},Un=e=>!e||e.length===0?[]:zn(Rn(e)),Wn=(e,t)=>{let n=Un(t);return e&&e.length>0?Vn(e,n):n.length>0?Hn(n):``},Gn=(e,t)=>{let n=Un(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()})):[]},G=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,Kn=e=>{let t=e.activated_skills||e.activated_microagents||[],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=Wn(t,n),i=Gn(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},K=e=>e,q=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
32
- `);function J({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=m(`openhands`),[s,c]=P.useState(!1),l=e.length>U,u=(l&&!(i&&s)?`${e.slice(0,1e3)}…`:e).trim()||r||``,d=n&&e.trim().length>0,f=o(s?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),p=(0,F.jsx)(Fe,{className:`rounded-lg text-xs`,style:Ie,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,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[d?(0,F.jsx)(Le,{text:e,children:p}):p,i&&l&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`self-start text-xs text-muted transition-colors hover:text-white hover:underline`,children:f})]})}function qn({output:e,exitCode:t,copy:n=!0}){let{t:r}=m(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t!=null&&t!==0&&t!==-1&&(0,F.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,F.jsx)(J,{code:e,language:`bash`,copy:n,placeholder:r(h.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Jn=K({actionKinds:[`ExecuteBashAction`,`TerminalAction`],observationKinds:[`ExecuteBashObservation`,`TerminalObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`openhands`),r=t?.observation.command??e?.action.command??``,i=e?.security_risk;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r&&(0,F.jsx)(J,{code:r,language:`bash`}),(i===w.HIGH||i===w.MEDIUM)&&(0,F.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===w.HIGH?h.SECURITY$HIGH_RISK:h.SECURITY$MEDIUM_RISK)}),t&&(0,F.jsx)(qn,{output:q(t.observation.content),exitCode:t.observation.exit_code})]})}}),Yn=3,Xn=300,Zn=25e4,Qn=(e,t)=>{if(e.length*t.length>Zn)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},$n=(e,t)=>{let n=e.split(`
32
+ `);function J({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=m(`openhands`),[s,c]=P.useState(!1),l=e.length>U,u=(l&&!(i&&s)?`${e.slice(0,1e3)}…`:e).trim()||r||``,d=n&&e.trim().length>0,f=o(s?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),p=(0,F.jsx)(Fe,{className:`rounded-lg text-xs`,style:Ie,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,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[d?(0,F.jsx)(Le,{text:e,children:p}):p,i&&l&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`self-start text-xs text-muted transition-colors hover:text-white hover:underline`,children:f})]})}function qn({output:e,exitCode:t,copy:n=!0}){let{t:r}=m(`openhands`);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t!=null&&t!==0&&t!==-1&&(0,F.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,F.jsx)(J,{code:e,language:`bash`,copy:n,placeholder:r(h.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Jn=K({actionKinds:[`ExecuteBashAction`,`TerminalAction`],observationKinds:[`ExecuteBashObservation`,`TerminalObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`openhands`),r=t?.observation.command??e?.action.command??``,i=e?.security_risk;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r&&(0,F.jsx)(J,{code:r,language:`bash`}),(i===T.HIGH||i===T.MEDIUM)&&(0,F.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===T.HIGH?h.SECURITY$HIGH_RISK:h.SECURITY$MEDIUM_RISK)}),t&&(0,F.jsx)(qn,{output:q(t.observation.content),exitCode:t.observation.exit_code})]})}}),Yn=3,Xn=300,Zn=25e4,Qn=(e,t)=>{if(e.length*t.length>Zn)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},$n=(e,t)=>{let n=e.split(`
33
33
  `),r=t.split(`
34
- `),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-Yn),i),c=n.slice(a,Math.min(n.length,a+Yn));return[...s.map(e=>({type:`ctx`,text:e})),...Qn(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},er={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},tr={add:`+ `,del:`- `,ctx:` `};function nr({oldText:e,newText:t}){let{t:n}=m(`openhands`),r=$n(e,t),i=r.length>Xn;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`overflow-auto rounded-lg border border-surface-raised font-mono text-xs`,children:(i?r.slice(0,Xn):r).map((e,t)=>(0,F.jsx)(`div`,{className:C(`whitespace-pre-wrap px-2`,er[e.type]),children:`${tr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]})}function rr({path:e,range:t}){return(0,F.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground`,children:[(0,F.jsx)(he,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,F.jsx)(`span`,{className:`break-all`,children:t?`${e}:${t}`:e})]})}var ir=K({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function({action:e,observation:t}){let n=t?.observation.path??e?.action.path??``,r=t?.observation.command??e?.action.command,i=He(n),a=e?.action.view_range,o=r===`view`&&a?`${a[0]}-${a[1]}`:void 0,s=n?(0,F.jsx)(rr,{path:n,range:o}):null;if(t){let e=t.observation,n=null;if(e.error)n=(0,F.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,F.jsx)(nr,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?q(e.content):``);n=t?(0,F.jsx)(J,{code:t,language:i}):null}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}if(e){let t=e.action,n=null;return t.command===`create`&&t.file_text?n=(0,F.jsx)(J,{code:t.file_text,language:i}):(t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,F.jsx)(nr,{oldText:t.old_str??``,newText:t.new_str})),(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}return null}});function ar({rows:e}){return(0,F.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:e.map(({label:e,value:t})=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-muted`,children:e}),(0,F.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:t})]},e))})}var or=K({actionKinds:[`GrepAction`,`GlobAction`],observationKinds:[`GrepObservation`,`GlobObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`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,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(ar,{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,F.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:q(r.content)}):c.length===0?(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$NO_RESULTS)}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$RESULTS,{count:c.length})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:c.map(e=>(0,F.jsx)(`span`,{className:`break-all`,children:e},e))}),r.truncated&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]}))]})}});function sr({label:e,text:t,isError:n=!1}){return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,F.jsx)(Le,{text:t,children:(0,F.jsx)(`div`,{className:`overflow-auto rounded border border-surface-raised bg-surface-raised p-2 text-xs ${n?`text-danger`:`text-foreground`}`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var cr=[Jn,ir,or,K({actionKinds:[`TaskAction`],observationKinds:[`TaskObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`openhands`),r=e?.action,i=t?.observation,a=i?.subagent??r?.subagent_type??``,o=i?.task_id,s=r?.prompt?.trim()??``,c=i?q(i.content).trim():``,l=[...a?[{label:n(h.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(h.TASK$TASK_ID),value:o}]:[]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l.length>0&&(0,F.jsx)(ar,{rows:l}),s&&(0,F.jsx)(sr,{label:n(h.TASK$QUERY),text:s}),c&&(0,F.jsx)(sr,{label:n(h.TASK$RESULT),text:c,isError:i?.is_error})]})}})],lr=e=>new Map(cr.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),ur=lr(e=>e.actionKinds),dr=lr(e=>e.observationKinds);function fr(e,t){if(M(e)){let t=ur.get(e.action.kind);if(t)return(0,F.jsx)(t.Body,{action:e})}else if(j(e)){let n=dr.get(e.observation.kind);if(n)return(0,F.jsx)(n.Body,{action:t,observation:e})}return null}var Y=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,X=(e,t)=>_.exists(e)?(0,F.jsx)(p,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,F.jsx)(en,{}),cmd:(0,F.jsx)(Xt,{})}}):e,pr=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),mr=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||pr(t)?null:t},Z=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?Y(n,t):n:null},hr=e=>{if(e.tool_name!==`inspect_image_with_vision`)return null;let t=e.action,n=Z(t.profile_name);return n?`Describing image with ${n}`:`Describing image with auxiliary vision LLM`},gr=(e,t)=>{let n=t?.tool_name,r=e.observation,i=Z(r.tool_name);if(n!==`inspect_image_with_vision`&&i!==`inspect_image_with_vision`&&String(e.observation.kind)!==`VisionInspectObservation`)return null;let a=Z((t?.action??{}).profile_name)??Z(r.profile_name)??Z(r.base_url,80)??Z(r.endpoint,80)??Z(r.model,80);return a?`Describing image with ${a}`:`Describing image with auxiliary vision LLM`},_r=e=>{if(!M(e))return``;let t=hr(e);if(t)return t;let n=mr(e);if(n)return n;let r=e.action.kind,i=``,a={};switch(r){case`ExecuteBashAction`:case`TerminalAction`:i=`ACTION_MESSAGE$RUN`,a={command:Y(e.action.command,80)};break;case`FileEditorAction`:case`StrReplaceEditorAction`:i=e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,a={path:e.action.path};break;case`MCPToolAction`:i=`ACTION_MESSAGE$CALL_TOOL_MCP`,a={mcp_tool_name:e.tool_name};break;case`InvokeSkillAction`:i=`ACTION_MESSAGE$INVOKE_SKILL`,a={name:e.action.name};break;case`TaskAction`:i=`ACTION_MESSAGE$TASK`,a={name:e.action.subagent_type};break;case`ThinkAction`:i=`ACTION_MESSAGE$THINK`;break;case`FinishAction`:i=`ACTION_MESSAGE$FINISH`;break;case`TaskTrackerAction`:i=`ACTION_MESSAGE$TASK_TRACKING`;break;case`GrepAction`:i=`ACTION_MESSAGE$GREP`,a={pattern:`pattern`in e.action&&e.action.pattern?Y(String(e.action.pattern),50):``};break;case`GlobAction`:i=`ACTION_MESSAGE$GLOB`,a={pattern:`pattern`in e.action&&e.action.pattern?Y(String(e.action.pattern),50):``};break;case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:i=`ACTION_MESSAGE$BROWSE`;break;default:return String(r).replace(`Action`,``).toUpperCase()}return i?X(i,a):r},vr=(e,t)=>{if(!j(e))return``;let n=gr(e,t);if(n)return n;if(t){let e=hr(t);if(e)return e;let n=mr(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?Y(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:`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`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?Y(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?Y(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?X(i,a):r},yr=(e,t)=>{let n=``,r=``;if(G(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=_.exists(t)?X(t,{}):`Skill Ready`,r=e._skillReadyContent}else M(e)?(n=_r(e),r=fr(e)??pn(e)):j(e)?(n=vr(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,F.jsx)(Ln,{event:e}):fr(e,t)??On(e)):je(e)?(n=X(kn(e),{title:jn(e)}),r=Pn(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||_.t(h.EVENT$UNKNOWN_EVENT),details:r}};function br({event:e,isFromPlanningAgent:t=!1}){let n=yr(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(B,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t}),e.critic_result!=null&&(0,F.jsx)(Gt,{criticResult:e.critic_result})]})}var xr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
35
- `).trim();return!t.skill_name&&!n?[]:[{name:t.skill_name,content:n}]};function Sr(e){let t=e.split(`
36
- `),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(S[0]))n=a.trim(),i=e+1;else if(a.startsWith(S[2]))r=a.replace(S[2],``).trim(),i=e+1;else if(a.startsWith(S[1])||a.startsWith(S[3]))i=e+1;else if(a.trim()===``&&e<=i)i=e+1;else break}return{matchInfo:n,filePath:r,body:t.slice(i).join(`
37
- `).trim()}}function Cr(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function wr({content:e}){let{t}=m(`openhands`),{matchInfo:n,filePath:r,body:i}=Sr(e),a=n||r;return(0,F.jsxs)(`div`,{className:`pl-6 pr-2 pt-2 pb-2`,children:[a&&(0,F.jsxs)(`div`,{className:`mb-3 text-sm text-[var(--oh-muted)] space-y-1`,children:[n&&(0,F.jsx)(`p`,{children:n}),r&&(0,F.jsxs)(`p`,{children:[(0,F.jsxs)(k.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.COMMON$PATH),` `]}),(0,F.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,F.jsx)(N,{children:Cr(i)})]})}function Tr({items:e,titleKey:t=h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}){let{t:n}=m(`openhands`),[r,i]=P.useState({}),a=e=>{i(t=>({...t,[e]:!t[e]}))};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1`,children:[(0,F.jsx)(k.Text,{className:`font-bold text-[var(--oh-foreground)] text-sm px-2 py-1`,children:n(t)}),e.map(e=>{let t=r[e.name]||!1;return(0,F.jsxs)(`div`,{className:`border border-[var(--oh-border-subtle)] rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(e.name),className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-tertiary transition-colors cursor-pointer`,children:[(0,F.jsx)(k.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(k.Text,{className:`font-normal text-[var(--oh-foreground)] text-sm`,children:e.name})]}),t&&e.content&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)]`}),(0,F.jsx)(wr,{content:e.content})]})]},e.name)})]})}function Er(e){if(G(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(j(e)&&e.observation.kind===`InvokeSkillObservation`){let t=xr(e);return t.length>0?{items:t,titleKey:h.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function Q({event:e,isLastMessage:t,correspondingAction:n}){let{title:r,details:i}=yr(e,n);if(!G(e)&&j(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,F.jsx)(`div`,{children:i});let a;G(e)?a=`success`:j(e)?a=hn(e):je(e)&&(a=mn(e));let o=Er(e);return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(R,{title:r,details:o?(0,F.jsx)(Tr,{items:o.items,titleKey:o.titleKey}):i,success:a,initiallyExpanded:!1,titleIcon:o?(0,F.jsx)(le,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0}),t&&(0,F.jsx)(Ft,{})]})}function Dr({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
38
- `);return r?(0,F.jsx)(B,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n}):null}function Or(e,t){if(t)return`🚫`;switch(e){case`PreToolUse`:return`⏳`;case`PostToolUse`:return`✅`;case`UserPromptSubmit`:return`📝`;case`SessionStart`:return`🚀`;case`SessionEnd`:return`🏁`;case`Stop`:return`⏹️`;default:return`🔗`}}function kr(e){return e.length>80?`${e.slice(0,77)}...`:e}function Ar(e,t){return e?`blocked`:t?`ok`:`failed`}function jr(e,t){return e?`bg-amber-900/50 text-amber-300`:t?`bg-green-900/50 text-green-300`:`bg-red-900/50 text-red-300`}function Mr({event:e}){let{t}=m(`openhands`);if(!De(e))return null;let n=Or(e.hook_event_type,e.blocked),r=Ar(e.blocked,e.success),i=jr(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{children:[n,` `,t(h.HOOK$HOOK_LABEL),`: `,e.hook_event_type,e.tool_name&&(0,F.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,F.jsx)(`span`,{className:C(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$COMMAND),`:`]}),` `,(0,F.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:kr(e.hook_command)})]}),e.exit_code!==null&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$EXIT_CODE),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,F.jsxs)(`div`,{className:`text-amber-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$BLOCKED_REASON),`:`]}),` `,e.reason]}),e.additional_context&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$CONTEXT),`:`]}),` `,e.additional_context]}),e.error&&(0,F.jsxs)(`div`,{className:`text-red-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$OUTPUT),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto`,children:e.stdout})]}),e.stderr&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$STDERR),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto text-amber-300`,children:e.stderr})]})]}),success:a})}function Nr(e){let t=[],n=[];for(let r of e)we(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Pr=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function Fr(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(Ce(n)&&Pr(n.observation.path))return n.id}return null}function Ir(e){return(0,P.useMemo)(()=>{let t=new Set;return Nr(e).forEach(e=>{let n=Fr(e);n&&t.add(n)}),t},[e])}function Lr(e,t){return t.has(e)}var Rr=e=>e.activated_skills||e.activated_microagents||[],zr=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),Br=e=>{let t=Rr(e).length>0,n=zr(e.extended_content);return t&&n},Vr=(e,t,n)=>{try{let r=Kn(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(qt,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,F.jsx)(Q,{event:r,isLastMessage:n})]})}catch{return(0,F.jsx)(qt,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Hr({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=te(),{planContent:s}=O(),{curAgentState:c}=ge(),l=c===x.RUNNING||c===x.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(Ae(e)&&Pe(e))return(0,F.jsx)(et,{status:e.value});if(Oe(e))return(0,F.jsx)(Ct,{event:e,...d});if(De(e))return(0,F.jsx)(Mr,{event:e});if(je(e))return(0,F.jsx)(Q,{event:e,isLastMessage:n});if(Te(e)){let{reasoning:t,message:n}=Ee(e.content??``,{streaming:!0}),r=[e.reasoning_content??``,t].filter(Boolean).join(`
34
+ `),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-Yn),i),c=n.slice(a,Math.min(n.length,a+Yn));return[...s.map(e=>({type:`ctx`,text:e})),...Qn(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},er={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},tr={add:`+ `,del:`- `,ctx:` `};function nr({oldText:e,newText:t}){let{t:n}=m(`openhands`),r=$n(e,t),i=r.length>Xn;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`div`,{className:`overflow-auto rounded-lg border border-surface-raised font-mono text-xs`,children:(i?r.slice(0,Xn):r).map((e,t)=>(0,F.jsx)(`div`,{className:w(`whitespace-pre-wrap px-2`,er[e.type]),children:`${tr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]})}function rr({path:e,range:t}){return(0,F.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 font-mono text-xs text-foreground`,children:[(0,F.jsx)(he,{className:`h-3.5 w-3.5 flex-shrink-0 text-muted`}),(0,F.jsx)(`span`,{className:`break-all`,children:t?`${e}:${t}`:e})]})}var ir=K({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function({action:e,observation:t}){let n=t?.observation.path??e?.action.path??``,r=t?.observation.command??e?.action.command,i=He(n),a=e?.action.view_range,o=r===`view`&&a?`${a[0]}-${a[1]}`:void 0,s=n?(0,F.jsx)(rr,{path:n,range:o}):null;if(t){let e=t.observation,n=null;if(e.error)n=(0,F.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,F.jsx)(nr,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?q(e.content):``);n=t?(0,F.jsx)(J,{code:t,language:i}):null}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}if(e){let t=e.action,n=null;return t.command===`create`&&t.file_text?n=(0,F.jsx)(J,{code:t.file_text,language:i}):(t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,F.jsx)(nr,{oldText:t.old_str??``,newText:t.new_str})),(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[s,n]})}return null}});function ar({rows:e}){return(0,F.jsx)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:e.map(({label:e,value:t})=>(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(`span`,{className:`text-muted`,children:e}),(0,F.jsx)(`span`,{className:`break-all font-mono text-foreground`,children:t})]},e))})}var or=K({actionKinds:[`GrepAction`,`GlobAction`],observationKinds:[`GrepObservation`,`GlobObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`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,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(ar,{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,F.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:q(r.content)}):c.length===0?(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$NO_RESULTS)}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$RESULTS,{count:c.length})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:c.map(e=>(0,F.jsx)(`span`,{className:`break-all`,children:e},e))}),r.truncated&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]}))]})}});function sr({label:e,text:t,isError:n=!1}){return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:e}),(0,F.jsx)(Le,{text:t,children:(0,F.jsx)(`div`,{className:`overflow-auto rounded border border-surface-raised bg-surface-raised p-2 text-xs ${n?`text-danger`:`text-foreground`}`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var cr=[Jn,ir,or,K({actionKinds:[`TaskAction`],observationKinds:[`TaskObservation`],Body:function({action:e,observation:t}){let{t:n}=m(`openhands`),r=e?.action,i=t?.observation,a=i?.subagent??r?.subagent_type??``,o=i?.task_id,s=r?.prompt?.trim()??``,c=i?q(i.content).trim():``,l=[...a?[{label:n(h.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(h.TASK$TASK_ID),value:o}]:[]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[l.length>0&&(0,F.jsx)(ar,{rows:l}),s&&(0,F.jsx)(sr,{label:n(h.TASK$QUERY),text:s}),c&&(0,F.jsx)(sr,{label:n(h.TASK$RESULT),text:c,isError:i?.is_error})]})}})],lr=e=>new Map(cr.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),ur=lr(e=>e.actionKinds),dr=lr(e=>e.observationKinds);function fr(e,t){if(M(e)){let t=ur.get(e.action.kind);if(t)return(0,F.jsx)(t.Body,{action:e})}else if(j(e)){let n=dr.get(e.observation.kind);if(n)return(0,F.jsx)(n.Body,{action:t,observation:e})}return null}var Y=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,X=(e,t)=>_.exists(e)?(0,F.jsx)(p,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,F.jsx)(en,{}),cmd:(0,F.jsx)(Xt,{})}}):e,pr=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),mr=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||pr(t)?null:t},Z=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?Y(n,t):n:null},hr=e=>{if(e.tool_name!==`inspect_image_with_vision`)return null;let t=e.action,n=Z(t.profile_name);return n?`Describing image with ${n}`:`Describing image with auxiliary vision LLM`},gr=(e,t)=>{let n=t?.tool_name,r=e.observation,i=Z(r.tool_name);if(n!==`inspect_image_with_vision`&&i!==`inspect_image_with_vision`&&String(e.observation.kind)!==`VisionInspectObservation`)return null;let a=Z((t?.action??{}).profile_name)??Z(r.profile_name)??Z(r.base_url,80)??Z(r.endpoint,80)??Z(r.model,80);return a?`Describing image with ${a}`:`Describing image with auxiliary vision LLM`},_r=e=>{if(!M(e))return``;let t=hr(e);if(t)return t;let n=mr(e);if(n)return n;let r=e.action.kind,i=``,a={};switch(r){case`ExecuteBashAction`:case`TerminalAction`:i=`ACTION_MESSAGE$RUN`,a={command:Y(e.action.command,80)};break;case`FileEditorAction`:case`StrReplaceEditorAction`:i=e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,a={path:e.action.path};break;case`MCPToolAction`:i=`ACTION_MESSAGE$CALL_TOOL_MCP`,a={mcp_tool_name:e.tool_name};break;case`InvokeSkillAction`:i=`ACTION_MESSAGE$INVOKE_SKILL`,a={name:e.action.name};break;case`TaskAction`:i=`ACTION_MESSAGE$TASK`,a={name:e.action.subagent_type};break;case`ThinkAction`:i=`ACTION_MESSAGE$THINK`;break;case`FinishAction`:i=`ACTION_MESSAGE$FINISH`;break;case`TaskTrackerAction`:i=`ACTION_MESSAGE$TASK_TRACKING`;break;case`GrepAction`:i=`ACTION_MESSAGE$GREP`,a={pattern:`pattern`in e.action&&e.action.pattern?Y(String(e.action.pattern),50):``};break;case`GlobAction`:i=`ACTION_MESSAGE$GLOB`,a={pattern:`pattern`in e.action&&e.action.pattern?Y(String(e.action.pattern),50):``};break;case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:i=`ACTION_MESSAGE$BROWSE`;break;default:return String(r).replace(`Action`,``).toUpperCase()}return i?X(i,a):r},vr=(e,t)=>{if(!j(e))return``;let n=gr(e,t);if(n)return n;if(t){let e=hr(t);if(e)return e;let n=mr(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?Y(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:`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`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?Y(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?Y(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?X(i,a):r},Q=(e,t)=>{let n=``,r=``;if(G(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=_.exists(t)?X(t,{}):`Skill Ready`,r=e._skillReadyContent}else M(e)?(n=_r(e),r=fr(e)??pn(e)):j(e)?(n=vr(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,F.jsx)(Ln,{event:e}):fr(e,t)??On(e)):je(e)?(n=X(kn(e),{title:jn(e)}),r=Pn(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||_.t(h.EVENT$UNKNOWN_EVENT),details:r}};function yr({event:e,isFromPlanningAgent:t=!1}){let n=Q(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(B,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t}),e.critic_result!=null&&(0,F.jsx)(Gt,{criticResult:e.critic_result})]})}var br=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
35
+ `).trim();return!t.skill_name&&!n?[]:[{name:t.skill_name,content:n}]};function xr(e){let t=e.split(`
36
+ `),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(C[0]))n=a.trim(),i=e+1;else if(a.startsWith(C[2]))r=a.replace(C[2],``).trim(),i=e+1;else if(a.startsWith(C[1])||a.startsWith(C[3]))i=e+1;else if(a.trim()===``&&e<=i)i=e+1;else break}return{matchInfo:n,filePath:r,body:t.slice(i).join(`
37
+ `).trim()}}function Sr(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function Cr({content:e}){let{t}=m(`openhands`),{matchInfo:n,filePath:r,body:i}=xr(e),a=n||r;return(0,F.jsxs)(`div`,{className:`pl-6 pr-2 pt-2 pb-2`,children:[a&&(0,F.jsxs)(`div`,{className:`mb-3 text-sm text-[var(--oh-muted)] space-y-1`,children:[n&&(0,F.jsx)(`p`,{children:n}),r&&(0,F.jsxs)(`p`,{children:[(0,F.jsxs)(k.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.COMMON$PATH),` `]}),(0,F.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,F.jsx)(N,{children:Sr(i)})]})}function wr({items:e,titleKey:t=h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}){let{t:n}=m(`openhands`),[r,i]=P.useState({}),a=e=>{i(t=>({...t,[e]:!t[e]}))};return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 mt-1`,children:[(0,F.jsx)(k.Text,{className:`font-bold text-[var(--oh-foreground)] text-sm px-2 py-1`,children:n(t)}),e.map(e=>{let t=r[e.name]||!1;return(0,F.jsxs)(`div`,{className:`border border-[var(--oh-border-subtle)] rounded-md overflow-hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>a(e.name),className:`w-full py-1.5 px-2 text-left flex items-center gap-2 hover:bg-tertiary transition-colors cursor-pointer`,children:[(0,F.jsx)(k.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,F.jsx)(b,{size:14}):(0,F.jsx)(l,{size:14})}),(0,F.jsx)(k.Text,{className:`font-normal text-[var(--oh-foreground)] text-sm`,children:e.name})]}),t&&e.content&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)]`}),(0,F.jsx)(Cr,{content:e.content})]})]},e.name)})]})}function Tr(e){if(G(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(j(e)&&e.observation.kind===`InvokeSkillObservation`){let t=br(e);return t.length>0?{items:t,titleKey:h.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function $({event:e,isLastMessage:t,correspondingAction:n}){let{title:r,details:i}=Q(e,n);if(!G(e)&&j(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,F.jsx)(`div`,{children:i});let a;G(e)?a=`success`:j(e)?a=hn(e):je(e)&&(a=mn(e));let o=Tr(e);return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(R,{title:r,details:o?(0,F.jsx)(wr,{items:o.items,titleKey:o.titleKey}):i,success:a,initiallyExpanded:!1,titleIcon:o?(0,F.jsx)(le,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0}),t&&(0,F.jsx)(Ft,{})]})}function Er({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
38
+ `);return r?(0,F.jsx)(B,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n}):null}function Dr(e,t){if(t)return`🚫`;switch(e){case`PreToolUse`:return`⏳`;case`PostToolUse`:return`✅`;case`UserPromptSubmit`:return`📝`;case`SessionStart`:return`🚀`;case`SessionEnd`:return`🏁`;case`Stop`:return`⏹️`;default:return`🔗`}}function Or(e){return e.length>80?`${e.slice(0,77)}...`:e}function kr(e,t){return e?`blocked`:t?`ok`:`failed`}function Ar(e,t){return e?`bg-amber-900/50 text-amber-300`:t?`bg-green-900/50 text-green-300`:`bg-red-900/50 text-red-300`}function jr({event:e}){let{t}=m(`openhands`);if(!Pe(e))return null;let n=Dr(e.hook_event_type,e.blocked),r=kr(e.blocked,e.success),i=Ar(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{children:[n,` `,t(h.HOOK$HOOK_LABEL),`: `,e.hook_event_type,e.tool_name&&(0,F.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,F.jsx)(`span`,{className:w(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$COMMAND),`:`]}),` `,(0,F.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:Or(e.hook_command)})]}),e.exit_code!==null&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$EXIT_CODE),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,F.jsxs)(`div`,{className:`text-amber-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$BLOCKED_REASON),`:`]}),` `,e.reason]}),e.additional_context&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$CONTEXT),`:`]}),` `,e.additional_context]}),e.error&&(0,F.jsxs)(`div`,{className:`text-red-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$OUTPUT),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto`,children:e.stdout})]}),e.stderr&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$STDERR),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto text-amber-300`,children:e.stderr})]})]}),success:a})}function Mr(e){let t=[],n=[];for(let r of e)Oe(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Nr=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function Pr(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(Ne(n)&&Nr(n.observation.path))return n.id}return null}function Fr(e){return(0,P.useMemo)(()=>{let t=new Set;return Mr(e).forEach(e=>{let n=Pr(e);n&&t.add(n)}),t},[e])}function Ir(e,t){return t.has(e)}var Lr=e=>e.activated_skills||e.activated_microagents||[],Rr=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),zr=e=>{let t=Lr(e).length>0,n=Rr(e.extended_content);return t&&n},Br=(e,t,n)=>{try{let r=Kn(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(qt,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,F.jsx)($,{event:r,isLastMessage:n})]})}catch{return(0,F.jsx)(qt,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Vr({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=ee(),{planContent:s}=O(),{curAgentState:c}=ge(),l=c===S.RUNNING||c===S.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(Ee(e)&&Te(e))return(0,F.jsx)(et,{status:e.value});if(ke(e))return(0,F.jsx)(Ct,{event:e,...d});if(Pe(e))return(0,F.jsx)(jr,{event:e});if(je(e))return(0,F.jsx)($,{event:e,isLastMessage:n});if(Ce(e)){let{reasoning:t,message:n}=Ae(e.content??``,{streaming:!0}),r=[e.reasoning_content??``,t].filter(Boolean).join(`
39
39
 
40
- `);return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(H,{content:r}),n&&(0,F.jsx)(B,{type:`agent`,message:n,isFromPlanningAgent:u})]})}if(M(e)&&e.action.kind===`FinishAction`)return(0,F.jsx)(br,{event:e,...d});if(M(e)&&e.action.kind===`ThinkAction`)return(0,F.jsx)(H,{content:e.action.thought});if(M(e)){let t=Me(e);return(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(H,{content:t}),!a&&(0,F.jsx)(Dr,{event:e,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n})]})}if(j(e)){if(Ce(e))return i&&Lr(e.id,i)?(0,F.jsx)(xt,{planContent:s,isStreaming:n&&c===x.RUNNING,isBuildDisabled:l}):null;let r=t.find(t=>M(t)&&t.id===e.action_id),o=!a&&r&&M(r)&&r.action.kind!==`ThinkAction`,d=r&&M(r)?Me(r):``;return(0,F.jsxs)(F.Fragment,{children:[d&&(0,F.jsx)(H,{content:d}),o&&(0,F.jsx)(Dr,{event:r,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n,correspondingAction:r&&M(r)?r:void 0})]})}if(!M(e)&&!j(e)){let t=e;return we(e)&&Br(t)?Vr(t,d,n):(0,F.jsx)(qt,{event:t,...d,isLastMessage:n})}return(0,F.jsx)(Q,{event:e,isLastMessage:n})}var Ur=e=>{if(M(e)){let{kind:t}=e.action;return!(t===`FinishAction`||t===`ThinkAction`)}return j(e)?!(Ce(e)||e.observation.kind===`TaskTrackerObservation`):!1},Wr=(e,t=2,n=e)=>{if(t<1)throw Error(`minSize must be at least 1`);let r=[],i=new Set,a=null,o=()=>{a&&=(a.events.length>=t?r.push({kind:`group`,events:a.events,startIndex:a.startIndex}):a.events.forEach((e,t)=>{r.push({kind:`single`,event:e,index:a.startIndex+t})}),null)};return e.forEach((e,t)=>{if(Ur(e)){let s=ke(e,n);s&&!i.has(s.id)&&(o(),i.add(s.id),r.push({kind:`thought`,action:s,index:t})),a||={events:[],startIndex:t},a.events.push(e)}else o(),r.push({kind:`single`,event:e,index:t})}),o(),r},Gr=(0,P.createContext)(!1);function Kr({events:e,allEvents:t,isFinalized:n=!1,children:r}){let{t:i}=m(`openhands`),[a,o]=P.useState(!1),s=P.useId(),c=`${s}-toggle`;if(e.length===0)return null;let l=e.find(e=>M(e)),u=e.filter(j).length,d=e.length,f=!!l,p=e[e.length-1],g=null;p&&(M(p)?g=yr(p).title:j(p)&&(g=yr(p,(t??e).find(e=>M(e)&&e.id===p.action_id)).title));let _=f?i(h.EVENT_GROUP$ACTIONS_PROGRESS,{completed:u,total:d}):i(h.EVENT_GROUP$ACTIONS_COMPLETED,{count:d}),v=a?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,F.jsx)(`button`,{id:c,type:`button`,onClick:()=>o(e=>!e),"aria-controls":s,"aria-expanded":a,"aria-label":i(a?h.EVENT_GROUP$COLLAPSE:h.EVENT_GROUP$EXPAND),"data-testid":`event-group-toggle`,className:`w-full flex items-center justify-between gap-2 text-left cursor-pointer`,children:n?(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:_})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:g??_})]}),(0,F.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:_}),f?(0,F.jsx)(ee,{"data-testid":`spinner-icon`,className:`h-4 w-4 ml-2 inline animate-spin text-[var(--oh-muted)]`}):null]})]})}),a&&(0,F.jsx)(`div`,{id:s,role:`region`,"aria-labelledby":c,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,F.jsx)(Gr.Provider,{value:!0,children:r})})]})}var qr=e=>e.at(-1)?.id,$=e=>e.at(-1),Jr=P.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=A(),r=Ir(t),i=ve(e=>n?e.entriesByConversation[n]:void 0),a=P.useMemo(()=>{if(!i||i.length===0)return null;let e=new Set;for(let t of i)t.anchorEventId!==null&&e.add(t.anchorEventId);return e.size>0?e:null},[i]),o=e=>{if(!a||e===void 0)return null;let t=String(e);return a.has(t)?(0,F.jsx)(rt,{conversationId:n,anchorEventId:t}):null},s=P.useMemo(()=>Wr(e,void 0,t),[e,t]),c=(n,i,a)=>(0,F.jsx)(Hr,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,F.jsx)(F.Fragment,{children:s.map((e,n)=>{if(e.kind===`single`)return(0,F.jsxs)(P.Fragment,{children:[c(e.event,e.index,!0),o(e.event.id)]},`single-${e.event.id}`);if(e.kind===`thought`)return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(Dr,{event:e.action}),o(e.action.id)]},`thought-${e.action.id}`);let r=n<s.length-1,i=e.events[0]?.id??`group-${e.startIndex}`;return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(Kr,{events:e.events,allEvents:t,isFinalized:r,children:e.events.map((t,n)=>c(t,e.startIndex+n,!0))}),e.events.map(e=>(0,F.jsx)(P.Fragment,{children:o(e.id)},`model-${e.id}`))]},`group-${i}`)})})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&qr(e.messages)===qr(t.messages)&&qr(e.allEvents)===qr(t.allEvents)&&$(e.messages)===$(t.messages)&&$(e.allEvents)===$(t.allEvents));Jr.displayName=`Messages`;export{ft as a,st as c,Ze as d,R as f,Ke as g,qe as h,B as i,rt as l,Je as m,kt as n,ct as o,Ye as p,vt as r,at as s,Jr as t,et as u};
40
+ `);return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(H,{content:r}),n&&(0,F.jsx)(B,{type:`agent`,message:n,isFromPlanningAgent:u})]})}if(M(e)&&e.action.kind===`FinishAction`)return(0,F.jsx)(yr,{event:e,...d});if(M(e)&&e.action.kind===`ThinkAction`)return(0,F.jsx)(H,{content:e.action.thought});if(M(e)){let t=De(e);return(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(H,{content:t}),!a&&(0,F.jsx)(Er,{event:e,isFromPlanningAgent:u}),(0,F.jsx)($,{event:e,isLastMessage:n})]})}if(j(e)){if(Ne(e))return i&&Ir(e.id,i)?(0,F.jsx)(xt,{planContent:s,isStreaming:n&&c===S.RUNNING,isBuildDisabled:l}):null;let r=t.find(t=>M(t)&&t.id===e.action_id),o=!a&&r&&M(r)&&r.action.kind!==`ThinkAction`,d=r&&M(r)?De(r):``;return(0,F.jsxs)(F.Fragment,{children:[d&&(0,F.jsx)(H,{content:d}),o&&(0,F.jsx)(Er,{event:r,isFromPlanningAgent:u}),(0,F.jsx)($,{event:e,isLastMessage:n,correspondingAction:r&&M(r)?r:void 0})]})}if(!M(e)&&!j(e)){let t=e;return Oe(e)&&zr(t)?Br(t,d,n):(0,F.jsx)(qt,{event:t,...d,isLastMessage:n})}return(0,F.jsx)($,{event:e,isLastMessage:n})}var Hr=e=>{if(M(e)){let{kind:t}=e.action;return!(t===`FinishAction`||t===`ThinkAction`)}return j(e)?!(Ne(e)||e.observation.kind===`TaskTrackerObservation`):!1},Ur=(e,t=2,n=e)=>{if(t<1)throw Error(`minSize must be at least 1`);let r=[],i=new Set,a=null,o=()=>{a&&=(a.events.length>=t?r.push({kind:`group`,events:a.events,startIndex:a.startIndex}):a.events.forEach((e,t)=>{r.push({kind:`single`,event:e,index:a.startIndex+t})}),null)};return e.forEach((e,t)=>{if(Hr(e)){let s=we(e,n);s&&!i.has(s.id)&&(o(),i.add(s.id),r.push({kind:`thought`,action:s,index:t})),a||={events:[],startIndex:t},a.events.push(e)}else o(),r.push({kind:`single`,event:e,index:t})}),o(),r},Wr=(0,P.createContext)(!1);function Gr({events:e,allEvents:t,isFinalized:n=!1,children:r}){let{t:i}=m(`openhands`),[a,o]=P.useState(!1),s=P.useId(),c=`${s}-toggle`;if(e.length===0)return null;let l=e.find(e=>M(e)),u=e.filter(j).length,d=e.length,f=!!l,p=e[e.length-1],g=null;p&&(M(p)?g=Q(p).title:j(p)&&(g=Q(p,(t??e).find(e=>M(e)&&e.id===p.action_id)).title));let _=f?i(h.EVENT_GROUP$ACTIONS_PROGRESS,{completed:u,total:d}):i(h.EVENT_GROUP$ACTIONS_COMPLETED,{count:d}),v=a?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,F.jsx)(`button`,{id:c,type:`button`,onClick:()=>o(e=>!e),"aria-controls":s,"aria-expanded":a,"aria-label":i(a?h.EVENT_GROUP$COLLAPSE:h.EVENT_GROUP$EXPAND),"data-testid":`event-group-toggle`,className:`w-full flex items-center justify-between gap-2 text-left cursor-pointer`,children:n?(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:_})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:g??_})]}),(0,F.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:_}),f?(0,F.jsx)(x,{"data-testid":`spinner-icon`,className:`h-4 w-4 ml-2 inline animate-spin text-[var(--oh-muted)]`}):null]})]})}),a&&(0,F.jsx)(`div`,{id:s,role:`region`,"aria-labelledby":c,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,F.jsx)(Wr.Provider,{value:!0,children:r})})]})}var Kr=e=>e.at(-1)?.id,qr=e=>e.at(-1),Jr=P.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=A(),r=Fr(t),i=ve(e=>n?e.entriesByConversation[n]:void 0),a=P.useMemo(()=>{if(!i||i.length===0)return null;let e=new Set;for(let t of i)t.anchorEventId!==null&&e.add(t.anchorEventId);return e.size>0?e:null},[i]),o=e=>{if(!a||e===void 0)return null;let t=String(e);return a.has(t)?(0,F.jsx)(rt,{conversationId:n,anchorEventId:t}):null},s=P.useMemo(()=>Ur(e,void 0,t),[e,t]),c=(n,i,a)=>(0,F.jsx)(Vr,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,F.jsx)(F.Fragment,{children:s.map((e,n)=>{if(e.kind===`single`)return(0,F.jsxs)(P.Fragment,{children:[c(e.event,e.index,!0),o(e.event.id)]},`single-${e.event.id}`);if(e.kind===`thought`)return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(Er,{event:e.action}),o(e.action.id)]},`thought-${e.action.id}`);let r=n<s.length-1,i=e.events[0]?.id??`group-${e.startIndex}`;return(0,F.jsxs)(P.Fragment,{children:[(0,F.jsx)(Gr,{events:e.events,allEvents:t,isFinalized:r,children:e.events.map((t,n)=>c(t,e.startIndex+n,!0))}),e.events.map(e=>(0,F.jsx)(P.Fragment,{children:o(e.id)},`model-${e.id}`))]},`group-${i}`)})})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&Kr(e.messages)===Kr(t.messages)&&Kr(e.allEvents)===Kr(t.allEvents)&&qr(e.messages)===qr(t.messages)&&qr(e.allEvents)===qr(t.allEvents));Jr.displayName=`Messages`;export{Ke as S,Ze as _,On as a,Je as b,kt as c,ft as d,ct as f,et as g,rt as h,jn as i,vt as l,st as m,Ur as n,pn as o,at as p,Pn as r,It as s,Jr as t,B as u,R as v,qe as x,Ye as y};
@@ -1 +1 @@
1
- import"./rolldown-runtime-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./utils-CE0lDWtb.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-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./utils-D3U3rlqr.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-CE0lDWtb.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-D3U3rlqr.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-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-Cgy4JA_g.js";import{t as r}from"./declaration-B9kpCaYl.js";import{t as i}from"./utils-CE0lDWtb.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-BFRubm34.js";import{Ct as e,bt as t}from"./vendor-styling-CI0PQ3ab.js";import{t as n}from"./useTranslation-CDRCKC9-.js";import{t as r}from"./declaration-gq8V5eTU.js";import{t as i}from"./utils-D3U3rlqr.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 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,i as r,n as i,r as a}from"./vendor-styling-CI0PQ3ab.js";import{t as o}from"./useQuery-CpjHYtZc.js";import{t as s}from"./useTranslation-Cgy4JA_g.js";import{t as c}from"./declaration-B9kpCaYl.js";import{l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{P as u,t as d}from"./utils-CE0lDWtb.js";import{c as f,n as p}from"./agent-server-client-options-DVLRd9sw.js";import{t as m}from"./proxy-CHmFkV16.js";import{f as h}from"./form-control-classes-9rkU4usZ.js";import{i as g}from"./combobox-caret-CLGvOs32.js";import{n as _}from"./map-provider-BM2SJarp.js";import{g as v}from"./sdk-settings-schema-BjBkMHzZ.js";var y=e(t(),1),b=e=>{let[t,...n]=e.split(`/`);return!t||n.length===0?{provider:``,model:e,separator:``}:{provider:t,model:n.join(`/`),separator:`/`}};function x(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function S(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function C(e,t){return!t||t<=0?e:e.slice(0,t)}function w(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var T=class{static async searchModels(e={},t){let n=f();if(n.backend.kind===`cloud`){let t=w({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return m({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new l(p()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getModels(),i]),s=e.provider__eq??null,c=new Set(s?o?.[s]??[]:[]),u=[...c].map(e=>({provider:s,name:e,verified:!0})),d=s?(a??[]).filter(e=>e.startsWith(`${s}/`)).map(e=>e.slice(s.length+1)).filter(e=>e.length>0&&!c.has(e)).map(e=>({provider:s,name:e,verified:!1})):[];return{items:C(S(x([...u,...d],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=f();if(n.backend.kind===`cloud`){let t=w({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return m({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new l(p()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getProviders(),i]),s=new Set(Object.keys(o??{}));return{items:C(S(x([...new Set([...s,...a??[]])].map(e=>({name:e,verified:s.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},E=[`config`,`verified-models`],D=1e3*60*5,O=1e3*60*15;async function k(){return f().backend.kind===`cloud`?{}:await new l(p()).getVerifiedModels()??{}}var A=()=>o({queryKey:[`config`,`providers`],queryFn:async({client:e})=>{let t=await e.fetchQuery({queryKey:E,queryFn:k,staleTime:D});return(await T.searchProviders({limit:100},t)).items},staleTime:D,gcTime:O}),j=10;async function M(e,t,n,r=0){if(r>=j)throw Error(`Too many pagination requests for provider ${e}`);let i=await T.searchModels({provider__eq:e,limit:100,page_id:n},t);if(i.next_page_id){let n=await M(e,t,i.next_page_id,r+1);return[...i.items,...n]}return i.items}var N=e=>o({queryKey:[`config`,`models`,e],queryFn:async({client:t})=>M(e,await t.fetchQuery({queryKey:E,queryFn:k,staleTime:D})),enabled:!!e,staleTime:D,gcTime:O}),P=n();function F({isDisabled:e,currentModel:t,onChange:n,onDefaultValuesChanged:o,wrapperClassName:l,labelClassName:f}){let[,p]=y.useState(null),[m,x]=y.useState(null),[S,C]=y.useState(null),{data:w=[]}=A(),{data:T=[],isLoading:E,error:D}=N(m),O=y.useMemo(()=>w.filter(e=>e.verified),[w]),k=y.useMemo(()=>w.filter(e=>!e.verified),[w]),j=y.useMemo(()=>T.filter(e=>e.verified),[T]),M=y.useMemo(()=>T.filter(e=>!e.verified),[T]);y.useEffect(()=>{if(t){let{provider:e,model:n}=b(t);p(t),x(e||null),C(n),o?.(e||null,n)}},[t]);let F=e=>{x(e),C(null),p(`${e}/`),n?.(e,null)},I=e=>{let t=`${m}/${e}`;m===`openai`&&(t=e),p(t),C(e),n?.(m,e)},L=()=>{x(null),p(null)},{t:R}=s(`openhands`);return(0,P.jsxs)(`div`,{className:d(`flex flex-col md:flex-row w-full min-w-0 justify-between gap-4 md:gap-[46px]`,l),children:[(0,P.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,P.jsx)(`label`,{className:d(`text-sm`,f),children:R(c.LLM$PROVIDER)}),(0,P.jsxs)(i,{"data-testid":`llm-provider-input`,isRequired:!0,isVirtualized:!1,name:`llm-provider-input`,isDisabled:e,"aria-label":R(c.LLM$PROVIDER),isClearable:!1,onSelectionChange:e=>{e?.toString()&&F(e.toString())},onInputChange:e=>!e&&L(),defaultSelectedKey:m??void 0,selectedKey:m,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:g},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:h}},children:[(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:O.map(e=>(0,P.jsx)(r,{"data-testid":`provider-item-${e.name}`,children:_(e.name)},e.name))}),k.length>0?(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:k.map(e=>(0,P.jsx)(r,{children:_(e.name)},e.name))}):null]})]}),m===`openhands`&&(0,P.jsx)(v,{testId:`openhands-account-help`,text:R(c.SETTINGS$NEED_OPENHANDS_ACCOUNT),linkText:R(c.SETTINGS$CLICK_HERE),href:u.PRODUCTION,size:`settings`,linkColor:`white`}),(0,P.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,P.jsx)(`label`,{className:d(`text-sm`,f),children:R(c.LLM$MODEL)}),(0,P.jsxs)(i,{"data-testid":`llm-model-input`,isRequired:!0,isVirtualized:!1,isLoading:E,name:`llm-model-input`,"aria-label":R(c.LLM$MODEL),isClearable:!1,onSelectionChange:e=>{e?.toString()&&I(e.toString())},isDisabled:e||!m,selectedKey:S,defaultSelectedKey:S??void 0,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:g},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:h}},children:[(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:j.map(e=>(0,P.jsx)(r,{children:e.name},e.name))}),M.length>0?(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:M.map(e=>(0,P.jsx)(r,{"data-testid":`model-item-${e.name}`,children:e.name},e.name))}):null]}),D&&(0,P.jsx)(`p`,{"data-testid":`models-error`,className:`text-danger text-xs`,children:R(c.CONFIGURATION$ERROR_FETCH_MODELS)})]})]})}export{b as n,F as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n,i as r,n as i,r as a}from"./vendor-styling-CI0PQ3ab.js";import{t as o}from"./useQuery-CpjHYtZc.js";import{t as s}from"./useTranslation-CDRCKC9-.js";import{t as c}from"./declaration-gq8V5eTU.js";import{l}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{P as u,t as d}from"./utils-D3U3rlqr.js";import{c as f,n as p}from"./agent-server-client-options-DVLRd9sw.js";import{t as m}from"./proxy-CHmFkV16.js";import{f as h}from"./form-control-classes-ChpNBe9n.js";import{i as g}from"./combobox-caret-DoObzqf4.js";import{n as _}from"./map-provider-BM2SJarp.js";import{g as v}from"./sdk-settings-schema-Cv7M9eSe.js";var y=e(t(),1),b=e=>{let[t,...n]=e.split(`/`);return!t||n.length===0?{provider:``,model:e,separator:``}:{provider:t,model:n.join(`/`),separator:`/`}};function x(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(n))}function S(e,t){return t===void 0?e:e.filter(e=>e.verified===t)}function C(e,t){return!t||t<=0?e:e.slice(0,t)}function w(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&t.set(n,String(r));let n=t.toString();return n?`?${n}`:``}var T=class{static async searchModels(e={},t){let n=f();if(n.backend.kind===`cloud`){let t=w({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq,provider__eq:e.provider__eq});return m({backend:n.backend,method:`GET`,path:`/api/v1/config/models/search${t}`})}let r=new l(p()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getModels(),i]),s=e.provider__eq??null,c=new Set(s?o?.[s]??[]:[]),u=[...c].map(e=>({provider:s,name:e,verified:!0})),d=s?(a??[]).filter(e=>e.startsWith(`${s}/`)).map(e=>e.slice(s.length+1)).filter(e=>e.length>0&&!c.has(e)).map(e=>({provider:s,name:e,verified:!1})):[];return{items:C(S(x([...u,...d],e.query),e.verified__eq),e.limit),next_page_id:null}}static async searchProviders(e={},t){let n=f();if(n.backend.kind===`cloud`){let t=w({page_id:e.page_id,limit:e.limit,query:e.query,verified__eq:e.verified__eq});return m({backend:n.backend,method:`GET`,path:`/api/v1/config/providers/search${t}`})}let r=new l(p()),i=t===void 0?r.getVerifiedModels():Promise.resolve(t),[a,o]=await Promise.all([r.getProviders(),i]),s=new Set(Object.keys(o??{}));return{items:C(S(x([...new Set([...s,...a??[]])].map(e=>({name:e,verified:s.has(e)})),e.query),e.verified__eq),e.limit),next_page_id:null}}},E=[`config`,`verified-models`],D=1e3*60*5,O=1e3*60*15;async function k(){return f().backend.kind===`cloud`?{}:await new l(p()).getVerifiedModels()??{}}var A=()=>o({queryKey:[`config`,`providers`],queryFn:async({client:e})=>{let t=await e.fetchQuery({queryKey:E,queryFn:k,staleTime:D});return(await T.searchProviders({limit:100},t)).items},staleTime:D,gcTime:O}),j=10;async function M(e,t,n,r=0){if(r>=j)throw Error(`Too many pagination requests for provider ${e}`);let i=await T.searchModels({provider__eq:e,limit:100,page_id:n},t);if(i.next_page_id){let n=await M(e,t,i.next_page_id,r+1);return[...i.items,...n]}return i.items}var N=e=>o({queryKey:[`config`,`models`,e],queryFn:async({client:t})=>M(e,await t.fetchQuery({queryKey:E,queryFn:k,staleTime:D})),enabled:!!e,staleTime:D,gcTime:O}),P=n();function F({isDisabled:e,currentModel:t,onChange:n,onDefaultValuesChanged:o,wrapperClassName:l,labelClassName:f}){let[,p]=y.useState(null),[m,x]=y.useState(null),[S,C]=y.useState(null),{data:w=[]}=A(),{data:T=[],isLoading:E,error:D}=N(m),O=y.useMemo(()=>w.filter(e=>e.verified),[w]),k=y.useMemo(()=>w.filter(e=>!e.verified),[w]),j=y.useMemo(()=>T.filter(e=>e.verified),[T]),M=y.useMemo(()=>T.filter(e=>!e.verified),[T]);y.useEffect(()=>{if(t){let{provider:e,model:n}=b(t);p(t),x(e||null),C(n),o?.(e||null,n)}},[t]);let F=e=>{x(e),C(null),p(`${e}/`),n?.(e,null)},I=e=>{let t=`${m}/${e}`;m===`openai`&&(t=e),p(t),C(e),n?.(m,e)},L=()=>{x(null),p(null)},{t:R}=s(`openhands`);return(0,P.jsxs)(`div`,{className:d(`flex flex-col md:flex-row w-full min-w-0 justify-between gap-4 md:gap-[46px]`,l),children:[(0,P.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,P.jsx)(`label`,{className:d(`text-sm`,f),children:R(c.LLM$PROVIDER)}),(0,P.jsxs)(i,{"data-testid":`llm-provider-input`,isRequired:!0,isVirtualized:!1,name:`llm-provider-input`,isDisabled:e,"aria-label":R(c.LLM$PROVIDER),isClearable:!1,onSelectionChange:e=>{e?.toString()&&F(e.toString())},onInputChange:e=>!e&&L(),defaultSelectedKey:m??void 0,selectedKey:m,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:g},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:h}},children:[(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:O.map(e=>(0,P.jsx)(r,{"data-testid":`provider-item-${e.name}`,children:_(e.name)},e.name))}),k.length>0?(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:k.map(e=>(0,P.jsx)(r,{children:_(e.name)},e.name))}):null]})]}),m===`openhands`&&(0,P.jsx)(v,{testId:`openhands-account-help`,text:R(c.SETTINGS$NEED_OPENHANDS_ACCOUNT),linkText:R(c.SETTINGS$CLICK_HERE),href:u.PRODUCTION,size:`settings`,linkColor:`white`}),(0,P.jsxs)(`fieldset`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,P.jsx)(`label`,{className:d(`text-sm`,f),children:R(c.LLM$MODEL)}),(0,P.jsxs)(i,{"data-testid":`llm-model-input`,isRequired:!0,isVirtualized:!1,isLoading:E,name:`llm-model-input`,"aria-label":R(c.LLM$MODEL),isClearable:!1,onSelectionChange:e=>{e?.toString()&&I(e.toString())},isDisabled:e||!m,selectedKey:S,defaultSelectedKey:S??void 0,classNames:{popoverContent:`bg-content1 rounded-xl border border-[var(--oh-border)]`,selectorButton:g},selectorButtonProps:{disableRipple:!0},inputProps:{classNames:{inputWrapper:h}},children:[(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$VERIFIED),classNames:{heading:`text-[var(--oh-muted)]`},children:j.map(e=>(0,P.jsx)(r,{children:e.name},e.name))}),M.length>0?(0,P.jsx)(a,{title:R(c.MODEL_SELECTOR$OTHERS),classNames:{heading:`text-[var(--oh-muted)]`},children:M.map(e=>(0,P.jsx)(r,{"data-testid":`model-item-${e.name}`,children:e.name},e.name))}):null]}),D&&(0,P.jsx)(`p`,{"data-testid":`models-error`,className:`text-danger text-xs`,children:R(c.CONFIGURATION$ERROR_FETCH_MODELS)})]})]})}export{b as n,F as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{k as r}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~byh8a1g4-XNPdpuO8.js";import{n as i}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~i3v2mlbw-BrJQ3XZH.js";import{t as a}from"./useMutation-DCE9RcgK.js";import{t as o}from"./useQueries-CRzaAqzH.js";import{t as s}from"./useQuery-CpjHYtZc.js";import{t as c}from"./useTranslation-CDRCKC9-.js";import{t as l}from"./declaration-gq8V5eTU.js";import{d as u,t as d,u as f}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{l as p,n as m}from"./active-backend-context-B3umL5R-.js";import{t as h}from"./createLucideIcon-CVAsW2Yo.js";import{t as g}from"./onboarding-modal-CP_WxDC9.js";import{t as _}from"./utils-D3U3rlqr.js";import{n as v}from"./agent-server-client-options-DVLRd9sw.js";import{t as y}from"./modal-backdrop-zVwfOJZr.js";import{r as b,t as x}from"./modal-body-DouOE5KH.js";import{r as S}from"./base-modal-BuF2f0YL.js";import{i as C}from"./modal-classes-Cf-4tbHz.js";import{t as w}from"./brand-button-vMVuyDXu.js";import{t as T}from"./use-onboarding-completion-C_Swglzp.js";import{t as E}from"./confirmation-modal-BGLu6XJN.js";import{t as D}from"./folder-mMWFvaw0.js";import{t as O}from"./close-p3Op5lxI.js";var k=h(`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`}]]),A=h(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]);function j(){return new d(v())}function M(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var N=class{static async listWorkspaces(){return M(await j().listWorkspaces())}static async addWorkspaces(e){return M(await j().addWorkspaces(e))}static async removeWorkspace(e){await j().deleteWorkspace(e)}static async addWorkspaceParents(e){return M(await j().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await j().deleteWorkspaceParent(e)}};function P(){let e=i();return a({mutationFn:e=>N.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function ee(){let e=i();return a({mutationFn:e=>N.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function F(){let e=i();return a({mutationFn:e=>N.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}function I(){let e=i();return a({mutationFn:e=>N.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:p.all})})}var L=e(t(),1);function R({enabled:e=!0}={}){return s({queryKey:p.all,queryFn:()=>N.listWorkspaces(),enabled:e,retry:(e,t)=>!f(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function z(){let{data:e,isLoading:t,isError:n,error:r}=R(),i=f(r),a=e?.workspaces??[],s=e?.workspaceParents??[],c=(0,L.useMemo)(()=>{let e=new Set(s.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?s:[...s,...t]},[s,i]),l=o({queries:i?[]:c.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>new u(v()).searchSubdirectories(e.path),retry:!1,meta:{disableToast:!0}}))}),d=t||l.some(e=>e.isLoading),p=n||l.some(e=>e.isError);return{workspaces:(0,L.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:d,isError:p,error:r}}function B(e,t){return f(e)?t(l.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}function V(){return new u(v())}var te=e=>{let t=m();return s({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>V().searchSubdirectories(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},ne=()=>{let e=m();return s({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>V().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})},H=n(),U=e=>(0,H.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,H.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`})}),W=`/projects`;function G({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,H.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,H.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,H.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:_(`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,H.jsx)(D,{width:14,height:14,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function K(e){let t=J(e);if(!t||t===`/`||q(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 q(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function J(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function Y(e){return e?.home===`/home/openhands`}function X({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=c(`openhands`),[a,o]=(0,L.useState)(null),s=m(),{data:u}=ne();(0,L.useEffect)(()=>{e&&u?.home&&a===null&&o(Y(u)?W:u.home),e||o(null)},[e,u?.home,a]),(0,L.useEffect)(()=>{o(null)},[s.backend.id,s.orgId]);let{data:d,isLoading:f,isError:p,error:h}=te(e?a:null),g=(0,L.useMemo)(()=>{if(!u?.home)return[];let e=[{label:`Home`,path:J(u.home)||u.home},...u.favorites??[]];return Y(u)&&!e.some(e=>e.path===W)&&e.push({label:W,path:W}),e},[u]),v=u?.locations??[];if(!e)return null;let T=d?.items??[],E=a?K(a):null,O=u?.home===`/home/openhands`&&(u?.favorites?.length??0)===0&&a===u?.home&&!f&&!p&&T.length===0,k=e=>{let t=J(e);if(!t)return`/`;if(t===`/`||q(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,H.jsx)(y,{onClose:t,"aria-label":i(l.HOME$ADD_WORKSPACES_TITLE),children:(0,H.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`xl`),x,`h-[480px]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:i(l.HOME$ADD_WORKSPACES_TITLE)})}),(0,H.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,H.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,H.jsx)(G,{label:i(l.HOME$FAVORITES),entries:g,currentPath:a,onPick:o}),(0,H.jsx)(G,{label:i(l.HOME$LOCATIONS),entries:v,currentPath:a,onPick:o})]}),(0,H.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,H.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&o(E),disabled:!E,"aria-label":i(l.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,H.jsx)(U,{width:16,height:16})}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:a??``})]}),(0,H.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,H.jsx)(`span`,{children:i(l.HOME$NAME)}),(0,H.jsx)(`span`,{children:i(l.HOME$KIND)})]}),(0,H.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[f&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(l.HOME$LOADING)}),p&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:h?.message??i(l.COMMON$FAILED_TO_LOAD)}),!f&&!p&&T.length===0&&(0,H.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":O?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(O?l.HOME$HOST_HOME_NOT_MOUNTED_HINT:l.HOME$NO_WORKSPACES)}),T.map(e=>(0,H.jsx)(`li`,{children:(0,H.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,H.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,H.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(l.HOME$FOLDER)})]})},e.path))]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(l.HOME$CANCEL)}),r&&(0,H.jsx)(w,{type:`button`,variant:`secondary`,onClick:()=>{!a||!r||(r([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-add-all-subdirs`,children:i(l.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:()=>{a&&(n([{id:a,name:k(a),path:a}]),t())},isDisabled:!a||f,testId:`folder-browser-use`,children:i(l.HOME$ADD_THIS_DIRECTORY)})]})]})})}function re({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:a}){let{t:o}=c(`openhands`),[s,u]=L.useState(null);if(!e)return null;let d=t.filter(e=>!e.parentPath),f=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=f.get(e.parentPath)??[];t.push(e),f.set(e.parentPath,t)});let p=d.length>0||n.length>0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(y,{onClose:r,"aria-label":o(l.HOME$MANAGE_WORKSPACES),children:(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:_(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,b(`lg`),x,`max-h-[70vh]`),children:[(0,H.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,H.jsx)(S,{className:C,title:o(l.HOME$MANAGE_WORKSPACES)})}),(0,H.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!p&&(0,H.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:o(l.HOME$MANAGE_WORKSPACES_EMPTY)}),d.length>0&&(0,H.jsx)(`ul`,{children:d.map(e=>(0,H.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,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`workspace`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":o(l.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,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,H.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,H.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:o(l.HOME$WORKSPACE_PARENTS)}),(0,H.jsx)(`ul`,{children:n.map(e=>{let t=f.get(e.path)??[];return(0,H.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,H.jsx)(D,{width:16,height:16,className:`shrink-0`}),(0,H.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,H.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),a&&(0,H.jsxs)(`button`,{type:`button`,onClick:()=>u({type:`parent`,path:e.path,text:o(l.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":o(l.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,H.jsx)(O,{width:12,height:12}),(0,H.jsx)(`span`,{children:o(l.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,H.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,H.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,H.jsx)(D,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,H.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,H.jsx)(w,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:o(l.HOME$DONE)})})]})}),s&&(0,H.jsx)(E,{text:s.text,onConfirm:()=>{s&&(s.type===`workspace`?i(s.path):a?.(s.path),u(null))},onCancel:()=>u(null)})]})}var Z=`previewOnboardingStep`,ie=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>ie?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function ae(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=T();return!n&&i?null:(0,H.jsx)(g,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{B as a,F as c,I as d,A as f,X as i,P as l,$ as n,z as o,k as p,re as r,R as s,ae as t,ee as u};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-Cgy4JA_g.js";import{t as a}from"./declaration-B9kpCaYl.js";import{A as o,N as s,j as c,n as l,r as u}from"./active-backend-context-DRFevVIj.js";import{t as d}from"./createLucideIcon-CVAsW2Yo.js";import{n as f,t as p}from"./chat-send-button-DxuZIoW8.js";import{t as m}from"./check-Bvi71siz.js";import{t as h}from"./loader-circle-BEykUKYG.js";import{i as g,r as _,t as v}from"./llm-settings-BgSFkbHC.js";import{t as y}from"./utils-CE0lDWtb.js";import{E as b,O as x,S,T as C,_ as w,p as T}from"./agent-server-client-options-DVLRd9sw.js";import{a as E}from"./use-backends-health-e-Ull4wz.js";import{t as D}from"./modal-backdrop-zVwfOJZr.js";import{r as O,t as k}from"./modal-body-Dcu5McCa.js";import{t as A}from"./brand-button-DKPMEKcW.js";import{n as j}from"./navigation-context-DPs2G0X8.js";import{t as M}from"./openhands-logo-bcNw5bkY.js";import{o as N,s as P,t as F}from"./backend-form-modal-D2EDGVAc.js";import{r as I}from"./use-settings-B07msZ2Z.js";import{t as ee}from"./use-tracking-CqODdfO4.js";import{c as L,i as R,n as z,o as B}from"./acp-providers-D_D8VUpP.js";import{n as V,r as H}from"./use-agent-profiles-DnH16_Vm.js";import{t as U}from"./use-create-conversation-CvAXfA3T.js";import{r as W,t as G}from"./recommended-automations-launcher-CXaEK1rW.js";import{t as te}from"./terminal-BuLtIrb9.js";import{t as ne}from"./use-save-settings-5xPYpSQM.js";import{o as re}from"./use-can-manage-org-profiles-OIhplvQ0.js";import{t as ie}from"./use-save-agent-profile-DFjxHhNx.js";import{n as ae}from"./use-activate-agent-profile-DY0txItX.js";import{a as oe,i as se,n as ce,r as le,t as ue}from"./use-acp-credential-form-rzaqkJ1n.js";var de=d(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=e(n(),1),q=r(),fe=`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`,pe=`0 0 100 100`,me=`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`,he=`0 0 12 12`,ge=`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`,_e=`0 0 24 24`,ve=3/2;function J({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,q.jsx)(M,{width:Math.round(t*ve),height:t,className:y(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,q.jsx)(te,{width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,q.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:y(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,q.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:y(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:z.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,q.jsx)(J,{kind:`openhands`,size:16,className:y(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,q.jsx)(J,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:a.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...z.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:l}=i(`openhands`),{mutate:u,isPending:d}=ne();return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:l(a.ONBOARDING$AGENT_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:l(a.ONBOARDING$AGENT_SUBTITLE)})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":l(a.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:y(`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,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{id:n.id,muted:!1}),(0,q.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,q.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:l(n.descriptionKey)})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,q.jsx)(m,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,q.jsxs)(`div`,{className:y(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,q.jsx)(A,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:d,children:l(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:d,onClick:()=>{let t=R(e);if(!t){r();return}u({agent_settings_diff:t},{onError:e=>{o(s(e)||l(a.ERROR$GENERIC))},onSuccess:()=>{c(l(a.SETTINGS$SAVED)),r()}})},children:l(d?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:y(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,q.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(a.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,q.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(a.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=N(r,e,{isConnected:t,lastError:n});return(0,q.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,q.jsx)(de,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,q.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(a.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,q.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,q.jsx)(h,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,q.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(a.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:o,addBackend:s,setActive:c,updateBackend:l}=u(),{backend:d}=o,f=T(d),p=C(),m=p!==null&&!f&&!(d.kind===`cloud`&&x(d.host,p)),h=f||m,g=K.useMemo(()=>S(),[]),_=h?{id:`onboarding-local-backend-draft`,name:w,host:g.baseUrl,apiKey:g.sessionApiKey,kind:`local`}:d,v=E(f?[]:[d]),D=h?null:v[d.id]?.isConnected??null,O=h?null:v[d.id]?.lastError??null,[k,j]=K.useState(!1);K.useEffect(()=>{D===!0&&j(!1)},[D]);let M=D===!0&&!k,N=K.useCallback(e=>{if(f)s(e);else{let t=e.host!==d.host;l(d.id,e),t&&o.orgId!==null&&c(d.id,null)}p!==null&&e.kind===`cloud`&&n?n():t()},[o.orgId,s,d.host,d.id,p,f,n,t,c,l]),I=y(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(h?p?a.ONBOARDING$LOGIN_TO_CLOUD_TITLE:a.BACKEND$ADD_TITLE:a.ONBOARDING$BACKEND_TITLE)}),h?null:(0,q.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$BACKEND_SUBTITLE)})]}),h?null:(0,q.jsx)(we,{backend:_,isConnected:D,lastError:O}),D===!0?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>j(e=>!e),"aria-expanded":k,"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,q.jsx)(`span`,{children:r(k?a.ONBOARDING$BACKEND_HIDE_CONFIGURATION:a.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,q.jsx)(P,{className:y(`h-4 w-4 shrink-0 text-muted transition-transform`,k&&`rotate-180`),"aria-hidden":!0})]}):null,(0,q.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:M?null:(0,q.jsx)(F,{onConnected:N,testIdRoot:`onboarding-backend`,initialManualBackend:_,requireManualApiKey:b(),manualSubmitLabel:r(a.ONBOARDING$NEXT),manualSubmittingLabel:r(a.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`})}),M?(0,q.jsxs)(`div`,{className:I,children:[e?(0,q.jsx)(A,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(a.ONBOARDING$NEXT)})]}):null]})}var Y=H;function X(){let e=ie(),t=ae();return(0,K.useCallback)(async n=>{try{await e.mutateAsync({name:Y,profile:n});let r=(await V.getProfile(Y)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=l(),o=r.kind===`local`,s=_(),c=g(),u=X(),[d,f]=K.useState(null),[p,m]=K.useState(!1),h=K.useCallback(async()=>{if(!o||!d)return null;let e=d.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`]:``,i=re(t),a={model:t};n&&(a.api_key=n),r&&(a.base_url=r);try{return await s.mutateAsync({name:i,request:{llm:a,include_secrets:!0}}),await c.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[o,d,s,c]),y=K.useCallback(async()=>{m(!0);try{let e=await h();e&&await u({agent_kind:`openhands`,llm_profile_ref:e})}finally{m(!1),t()}},[h,u,t]);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(a.ONBOARDING$LLM_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(a.ONBOARDING$LLM_SUBTITLE)})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,q.jsx)(v,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:y,onSaveControlChange:f})}),(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(d?.isSaving??!1)||p,onClick:()=>{if(d?.isDirty){d.save();return}t()},children:n(a.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:o}=i(`openhands`),s=l(),{status:c,isChecking:u}=ce(e,{enabled:t}),{fields:d,values:f,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,consumesFileCredentials:_,save:v,isSaving:y}=ue(e),b=X(),x=L(e)??e,S=c===`authenticated`,C=ke(s.backend.kind,c),w=S||d.some(e=>e.secret&&(!e.multiline||_)&&h(e.name)),T=C&&!w,E=y||T||u&&!w;return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:o(a.ONBOARDING$ACP_SECRETS_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):c!==`authenticated`&&(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,q.jsx)(se,{status:c,isChecking:u,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,q.jsx)(le,{field:e,value:f[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,q.jsx)(oe,{conflicts:g}),T?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:o(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await v()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:B(e)??void 0}),r())},children:o(y?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=j(),{backend:s}=l(),c=s.kind!==`cloud`,u=r(a.ONBOARDING$HELLO_DEFAULT_MESSAGE),[d,f]=K.useState(u),{mutate:m,isPending:h,isSuccess:g}=U(),_=W(),v=h||g||_,y=K.useRef(!1),b=d.trim().length>0&&!v&&!y.current,x=()=>{!b||y.current||(y.current=!0,m({query:d.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{y.current=!1}}))};return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,q.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(a.ONBOARDING$HELLO_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$HELLO_SUBTITLE)})]}),(0,q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},"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,q.jsx)(`div`,{className:`relative w-full`,children:(0,q.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,q.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(a.ONBOARDING$HELLO_TITLE),type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},placeholder:u,disabled:v,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,q.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,q.jsx)(p,{buttonClassName:``,handleSubmit:x,disabled:!b})})]}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,q.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(a.LANDING$OR)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,q.jsx)(G,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:v,children:r(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:v,children:r(a.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>Ne}),Z=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Q=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,q.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:y(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:o}=I(),s=o?.user_consents_to_analytics===!0,{trackOnboardingStarted:c,trackOnboardingStepViewed:l,trackOnboardingCompleted:d,trackOnboardingSkipped:f}=ee(),{active:p}=u(),{backend:m}=p,h=T(m),g=E(h?[]:[m]),_=C(),v=_!==null&&m.kind===`cloud`&&x(m.host,_),b=!h&&g[m.id]?.isConnected===!0&&(_===null||v),S=b?Me:Z,[w,A]=K.useState(()=>Z[Math.min(Math.max(t,0),Z.length-1)]),[j,M]=K.useState(`openhands`);K.useEffect(()=>{S.includes(w)||A(S[0])},[w,S]);let N=S.length,P=S.includes(w)?w:S[0],F=S.indexOf(P),L=h||g[m.id]?.isConnected!==void 0,R=j===`openhands`,z=F===0&&C()!==null,B=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=K.useRef(!1);K.useEffect(()=>{n||!s||H.current||window.sessionStorage.getItem(Q)||(H.current=!0,window.sessionStorage.setItem(Q,`1`),c())},[n,s]);let U=K.useRef(null);K.useEffect(()=>{n||!s||!L||U.current!==P&&(U.current=P,l({step:P,stepIndex:F,totalSteps:N,agent:j}))},[n,s,L,P,F,N,j]);let W=()=>{d({agent:j}),e()},G=()=>{f({step:P,stepIndex:F,totalSteps:N,agent:j}),e()};return(0,q.jsx)(D,{"aria-label":r(a.ONBOARDING$TITLE),children:(0,q.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,q.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":F,"data-preview":n?`true`:void 0,className:y(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,O(`lg`),k,`max-h-[90vh]`),children:[(0,q.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,q.jsx)(ye,{currentStep:F,totalSteps:N})}),(0,q.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,q.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":F,className:`relative overflow-clip`,children:[b?null:(0,q.jsx)($,{index:S.indexOf(`backend`),currentStep:F,children:(0,q.jsx)(Te,{onNext:B,onClose:e})}),(0,q.jsx)($,{index:S.indexOf(`agent`),currentStep:F,children:(0,q.jsx)(Ce,{selectedAgentId:j,onSelect:M,onBack:b?void 0:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`setup`),currentStep:F,children:R?(0,q.jsx)(De,{onBack:V,onNext:B}):(0,q.jsx)(Oe,{providerKey:j,isActive:P===`setup`,onBack:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`hello`),currentStep:F,children:(0,q.jsx)(Ae,{onBack:V,onClose:G,onLaunched:W})})]})})]}),F<N-1&&!z?(0,q.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(a.ONBOARDING$SKIP)}):null]})})}export{je as n,J as r,Ne as t};
1
+ import{a as e,r as t}from"./rolldown-runtime-BFRubm34.js";import{Ct as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{t as i}from"./useTranslation-CDRCKC9-.js";import{t as a}from"./declaration-gq8V5eTU.js";import{A as o,P as s,j as c,n as l,r as u}from"./active-backend-context-B3umL5R-.js";import{t as d}from"./createLucideIcon-CVAsW2Yo.js";import{n as f,t as p}from"./chat-send-button-B_jc5z5C.js";import{t as m}from"./check-Bvi71siz.js";import{t as h}from"./loader-circle-BEykUKYG.js";import{i as g,r as _,t as v}from"./llm-settings-kU5v0H1Z.js";import{t as y}from"./utils-D3U3rlqr.js";import{E as b,O as x,S,T as C,_ as w,p as T}from"./agent-server-client-options-DVLRd9sw.js";import{a as E}from"./use-backends-health-DkC7tKkC.js";import{t as D}from"./modal-backdrop-zVwfOJZr.js";import{r as O,t as k}from"./modal-body-DouOE5KH.js";import{t as A}from"./brand-button-vMVuyDXu.js";import{n as j}from"./navigation-context-DPs2G0X8.js";import{t as M}from"./openhands-logo-bcNw5bkY.js";import{o as N,s as P,t as F}from"./backend-form-modal-DSbrafX2.js";import{r as I}from"./use-settings-BReAMxCG.js";import{t as ee}from"./use-tracking-2ZwQwpg_.js";import{c as L,i as R,n as z,o as B}from"./acp-providers-Djl6vNn-.js";import{n as V,r as H}from"./use-agent-profiles-DEAMFp-W.js";import{t as U}from"./use-create-conversation-CTsvZ96U.js";import{r as W,t as G}from"./recommended-automations-launcher-CVEF_1pc.js";import{t as te}from"./terminal-BuLtIrb9.js";import{t as ne}from"./use-save-settings-D1HoCDbn.js";import{o as re}from"./use-can-manage-org-profiles-BEo0peGn.js";import{t as ie}from"./use-save-agent-profile-CLMmbx_X.js";import{n as ae}from"./use-activate-agent-profile-WaAZYz4E.js";import{a as oe,i as se,n as ce,r as le,t as ue}from"./use-acp-credential-form-EtnbtYt0.js";var de=d(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),K=e(n(),1),q=r(),fe=`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`,pe=`0 0 100 100`,me=`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`,he=`0 0 12 12`,ge=`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`,_e=`0 0 24 24`,ve=3/2;function J({kind:e,size:t=12,className:n,"data-testid":r}){return e===`openhands`?(0,q.jsx)(M,{width:Math.round(t*ve),height:t,className:y(`shrink-0 [&_path:not([fill=transparent])]:fill-current`,n),"data-testid":r??`agent-brand-icon-openhands`,"aria-hidden":!0}):e===`claude-code`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:pe,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-claude-code`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:fe})}):e===`codex`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:he,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-codex`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:me,fill:`currentColor`})}):e===`gemini`?(0,q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:_e,width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-gemini`,"aria-hidden":!0,children:(0,q.jsx)(`path`,{fill:`currentColor`,d:ge})}):(0,q.jsx)(te,{width:t,height:t,className:y(`shrink-0`,n),"data-testid":r??`agent-brand-icon-generic`,"aria-hidden":!0})}function ye({currentStep:e,totalSteps:t,className:n}){return(0,q.jsx)(`div`,{role:`progressbar`,"aria-valuemin":1,"aria-valuemax":t,"aria-valuenow":e+1,"data-testid":`onboarding-progress-bar`,className:y(`flex w-full items-center gap-2`,n),children:Array.from({length:t},(t,n)=>{let r=n<e,i=n===e;return(0,q.jsx)(`div`,{"data-testid":`onboarding-progress-step-${n}`,"data-state":r?`completed`:i?`current`:`upcoming`,className:y(`h-1.5 flex-1 rounded-full transition-colors duration-300`,r||i?`bg-white`:`bg-white/15`)},n)})})}function be(e){return e===`openhands`?`openhands`:z.find(({key:t})=>t===e)?.icon??`cli-generic`}function xe({id:e,muted:t}){let n=be(e);return n===`openhands`?(0,q.jsx)(J,{kind:`openhands`,size:16,className:y(`text-white`,t&&`opacity-55`),"data-testid":`onboarding-agent-icon-openhands`}):(0,q.jsx)(J,{kind:n,size:18,className:t?`text-[var(--oh-muted)]`:`text-white`,"data-testid":`onboarding-agent-icon-${n}`})}function Se(){return[{id:`openhands`,label:`OpenHands`,descriptionKey:a.ONBOARDING$AGENT_OPENHANDS_DESCRIPTION},...z.map(e=>({id:e.key,label:e.display_name,descriptionKey:e.description_key}))]}function Ce({selectedAgentId:e,onSelect:t,onBack:n,onNext:r}){let{t:l}=i(`openhands`),{mutate:u,isPending:d}=ne();return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-choose-agent`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:l(a.ONBOARDING$AGENT_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:l(a.ONBOARDING$AGENT_SUBTITLE)})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":l(a.ONBOARDING$AGENT_TITLE),className:`flex flex-col gap-3`,children:Se().map(n=>{let r=n.id===e;return(0,q.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"data-testid":`onboarding-agent-option-${n.id}`,"data-selected":r,onClick:()=>t(n.id),className:y(`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,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(xe,{id:n.id,muted:!1}),(0,q.jsx)(`span`,{className:`truncate text-base font-normal text-white`,children:n.label})]}),(0,q.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)]`,children:l(n.descriptionKey)})]}),(0,q.jsx)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:r?(0,q.jsx)(m,{width:18,height:18,className:`mt-1 shrink-0 text-white`,"aria-hidden":!0}):null})]},n.id)})}),(0,q.jsxs)(`div`,{className:y(`sticky bottom-0 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,n?`justify-between`:`justify-end`),children:[n?(0,q.jsx)(A,{testId:`onboarding-agent-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:d,children:l(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-agent-next`,type:`button`,variant:`primary`,isDisabled:d,onClick:()=>{let t=R(e);if(!t){r();return}u({agent_settings_diff:t},{onError:e=>{o(s(e)||l(a.ERROR$GENERIC))},onSuccess:()=>{c(l(a.SETTINGS$SAVED)),r()}})},children:l(d?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function we({backend:e,isConnected:t,lastError:n}){let{t:r}=i(`openhands`);if(t===!0)return(0,q.jsxs)(`div`,{role:`status`,"data-testid":`onboarding-backend-connected`,className:y(`flex items-start gap-3 rounded-xl border border-green-500/40 bg-green-500/10 px-4 py-3`),children:[(0,q.jsx)(f,{className:`mt-0.5 size-5 shrink-0 text-green-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-green-200`,children:r(a.ONBOARDING$BACKEND_CONNECTED_TITLE)}),(0,q.jsx)(`span`,{className:`text-xs text-green-200/80`,children:r(a.ONBOARDING$BACKEND_CONNECTED_BODY)})]})]});if(t===!1){let i=N(r,e,{isConnected:t,lastError:n});return(0,q.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,q.jsx)(de,{className:`mt-0.5 size-5 shrink-0 text-red-400`}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium text-red-200`,children:i}),(0,q.jsx)(`span`,{className:`text-xs text-red-200/80`,children:r(a.ONBOARDING$BACKEND_DISCONNECTED_BODY)})]})]})}return(0,q.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,q.jsx)(h,{className:`mt-0.5 size-5 shrink-0 animate-spin text-[var(--oh-text-tertiary)]`}),(0,q.jsx)(`span`,{className:`text-sm text-[var(--oh-text-tertiary)]`,children:r(a.ONBOARDING$BACKEND_CHECKING)})]})}function Te({onBack:e,onNext:t,onClose:n}){let{t:r}=i(`openhands`),{active:o,addBackend:s,setActive:c,updateBackend:l}=u(),{backend:d}=o,f=T(d),p=C(),m=p!==null&&!f&&!(d.kind===`cloud`&&x(d.host,p)),h=f||m,g=K.useMemo(()=>S(),[]),_=h?{id:`onboarding-local-backend-draft`,name:w,host:g.baseUrl,apiKey:g.sessionApiKey,kind:`local`}:d,v=E(f?[]:[d]),D=h?null:v[d.id]?.isConnected??null,O=h?null:v[d.id]?.lastError??null,[k,j]=K.useState(!1);K.useEffect(()=>{D===!0&&j(!1)},[D]);let M=D===!0&&!k,N=K.useCallback(e=>{if(f)s(e);else{let t=e.host!==d.host;l(d.id,e),t&&o.orgId!==null&&c(d.id,null)}p!==null&&e.kind===`cloud`&&n?n():t()},[o.orgId,s,d.host,d.id,p,f,n,t,c,l]),I=y(`sticky bottom-0 mt-2 flex items-center gap-2 bg-base-secondary pt-4 pb-7`,e?`justify-between`:`justify-end`);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-check-backend`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(h?p?a.ONBOARDING$LOGIN_TO_CLOUD_TITLE:a.BACKEND$ADD_TITLE:a.ONBOARDING$BACKEND_TITLE)}),h?null:(0,q.jsx)(`p`,{"data-testid":`onboarding-backend-subtitle`,className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$BACKEND_SUBTITLE)})]}),h?null:(0,q.jsx)(we,{backend:_,isConnected:D,lastError:O}),D===!0?(0,q.jsxs)(`button`,{type:`button`,onClick:()=>j(e=>!e),"aria-expanded":k,"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,q.jsx)(`span`,{children:r(k?a.ONBOARDING$BACKEND_HIDE_CONFIGURATION:a.ONBOARDING$BACKEND_SHOW_CONFIGURATION)}),(0,q.jsx)(P,{className:y(`h-4 w-4 shrink-0 text-muted transition-transform`,k&&`rotate-180`),"aria-hidden":!0})]}):null,(0,q.jsx)(`div`,{"data-testid":`onboarding-backend-configuration-fields`,children:M?null:(0,q.jsx)(F,{onConnected:N,testIdRoot:`onboarding-backend`,initialManualBackend:_,requireManualApiKey:b(),manualSubmitLabel:r(a.ONBOARDING$NEXT),manualSubmittingLabel:r(a.SETTINGS$SAVING),manualSubmitTestId:`onboarding-backend-next`})}),M?(0,q.jsxs)(`div`,{className:I,children:[e?(0,q.jsx)(A,{testId:`onboarding-backend-back`,type:`button`,variant:`secondary`,onClick:e,children:r(a.ONBOARDING$BACK)}):null,(0,q.jsx)(A,{testId:`onboarding-backend-next`,type:`button`,variant:`primary`,onClick:t,children:r(a.ONBOARDING$NEXT)})]}):null]})}var Y=H;function X(){let e=ie(),t=ae();return(0,K.useCallback)(async n=>{try{await e.mutateAsync({name:Y,profile:n});let r=(await V.getProfile(Y)).profile.id;r&&await t.mutateAsync(r)}catch(e){console.error(`Failed to configure onboarding agent profile:`,e)}},[e,t])}var Ee=`openai/gpt-5.5`;function De({onBack:e,onNext:t}){let{t:n}=i(`openhands`),{backend:r}=l(),o=r.kind===`local`,s=_(),c=g(),u=X(),[d,f]=K.useState(null),[p,m]=K.useState(!1),h=K.useCallback(async()=>{if(!o||!d)return null;let e=d.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`]:``,i=re(t),a={model:t};n&&(a.api_key=n),r&&(a.base_url=r);try{return await s.mutateAsync({name:i,request:{llm:a,include_secrets:!0}}),await c.mutateAsync(i),i}catch(e){return console.error(`Failed to persist onboarding LLM as profile:`,e),null}},[o,d,s,c]),y=K.useCallback(async()=>{m(!0);try{let e=await h();e&&await u({agent_kind:`openhands`,llm_profile_ref:e})}finally{m(!1),t()}},[h,u,t]);return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-llm`,className:`flex flex-col gap-6 max-h-[calc(90vh-7rem)]`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:n(a.ONBOARDING$LLM_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:n(a.ONBOARDING$LLM_SUBTITLE)})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-llm-settings`,className:`flex min-h-0 flex-1 flex-col overflow-y-auto custom-scrollbar-always`,children:(0,q.jsx)(v,{embedded:!0,hideSaveButton:!0,suppressSuccessToast:!0,initialValueOverrides:{"llm.model":Ee},onSaveSuccess:y,onSaveControlChange:f})}),(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-llm-back`,type:`button`,variant:`secondary`,onClick:e,children:n(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-llm-next`,type:`button`,variant:`primary`,isDisabled:(d?.isSaving??!1)||p,onClick:()=>{if(d?.isDirty){d.save();return}t()},children:n(a.ONBOARDING$NEXT)})]})]})}function Oe({providerKey:e,isActive:t,onBack:n,onNext:r}){let{t:o}=i(`openhands`),s=l(),{status:c,isChecking:u}=ce(e,{enabled:t}),{fields:d,values:f,setValue:p,secretExists:m,hasValueFor:h,conflicts:g,consumesFileCredentials:_,save:v,isSaving:y}=ue(e),b=X(),x=L(e)??e,S=c===`authenticated`,C=ke(s.backend.kind,c),w=S||d.some(e=>e.secret&&(!e.multiline||_)&&h(e.name)),T=C&&!w,E=y||T||u&&!w;return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-setup-acp-secrets`,className:`flex flex-col gap-6`,children:[(0,q.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:o(a.ONBOARDING$ACP_SECRETS_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBTITLE,{provider:x})}),C&&!S?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-required-note`,className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_NOTE,{provider:x})}):c!==`authenticated`&&(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:o(a.ONBOARDING$ACP_SECRETS_SUBSCRIPTION_NOTE)})]}),(0,q.jsx)(se,{status:c,isChecking:u,providerName:x,testIdPrefix:`onboarding-acp-auth`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-5`,children:d.map(e=>(0,q.jsx)(le,{field:e,value:f[e.name]??``,onChange:t=>p(e.name,t),alreadySet:m(e.name),testId:`onboarding-acp-secret-${e.name}`,showOptionalTag:!0},e.name))}),(0,q.jsx)(oe,{conflicts:g}),T?(0,q.jsx)(`p`,{"data-testid":`onboarding-acp-secrets-blocked`,className:`text-sm text-amber-300`,children:o(a.ONBOARDING$ACP_SECRETS_REQUIRED_BLOCKED)}):null,(0,q.jsxs)(`div`,{className:`sticky bottom-0 flex items-center justify-between gap-2 bg-base-secondary pt-4 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-acp-secrets-back`,type:`button`,variant:`secondary`,onClick:n,isDisabled:y,children:o(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-acp-secrets-next`,type:`button`,variant:`primary`,isDisabled:E,onClick:async()=>{await v()&&(e!==`openhands`&&await b({agent_kind:`acp`,acp_server:e,acp_model:B(e)??void 0}),r())},children:o(y?a.SETTINGS$SAVING:a.ONBOARDING$NEXT)})]})]})}function ke(e,t){return t===`authenticated`?!1:e===`cloud`?!0:t===`unauthenticated`}function Ae({onBack:e,onClose:t,onLaunched:n}){let{t:r}=i(`openhands`),{navigate:o}=j(),{backend:s}=l(),c=s.kind!==`cloud`,u=r(a.ONBOARDING$HELLO_DEFAULT_MESSAGE),[d,f]=K.useState(u),{mutate:m,isPending:h,isSuccess:g}=U(),_=W(),v=h||g||_,y=K.useRef(!1),b=d.trim().length>0&&!v&&!y.current,x=()=>{!b||y.current||(y.current=!0,m({query:d.trim(),entryPoint:`onboarding_say_hello`},{onSuccess:e=>{o(`/conversations/${e.conversation_id}`),n()},onError:()=>{y.current=!1}}))};return(0,q.jsxs)(`div`,{"data-testid":`onboarding-step-say-hello`,className:`flex max-h-[calc(90vh-7rem)] flex-col`,children:[(0,q.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2`,children:[(0,q.jsx)(`h2`,{className:`text-2xl font-medium text-white`,children:r(a.ONBOARDING$HELLO_TITLE)}),(0,q.jsx)(`p`,{className:`text-sm text-[var(--oh-muted)]`,children:r(a.ONBOARDING$HELLO_SUBTITLE)})]}),(0,q.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},"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,q.jsx)(`div`,{className:`relative w-full`,children:(0,q.jsx)(`div`,{className:`box-border flex w-full shrink-0 flex-row items-end justify-between gap-2 p-0 pb-[18px]`,children:(0,q.jsx)(`input`,{"data-testid":`onboarding-hello-input`,"aria-label":r(a.ONBOARDING$HELLO_TITLE),type:`text`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},placeholder:u,disabled:v,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,q.jsx)(`div`,{className:`flex w-full min-w-0 items-center justify-end gap-2`,children:(0,q.jsx)(p,{buttonClassName:``,handleSubmit:x,disabled:!b})})]}),c?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{"data-testid":`onboarding-hello-or-separator`,className:`mt-6 flex w-full items-center gap-3`,children:[(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`}),(0,q.jsx)(`span`,{className:`text-xs uppercase text-[var(--oh-muted)]`,children:r(a.LANDING$OR)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-[var(--oh-border)]`})]}),(0,q.jsx)(`div`,{"data-testid":`onboarding-recommended-automations`,className:`flex min-h-0 flex-1 flex-col`,children:(0,q.jsx)(G,{onLaunched:n,scrollableGrid:!0})})]}):null,(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 bg-base-secondary pt-7 pb-7`,children:[(0,q.jsx)(A,{testId:`onboarding-hello-back`,type:`button`,variant:`secondary`,onClick:e,isDisabled:v,children:r(a.ONBOARDING$BACK)}),(0,q.jsx)(A,{testId:`onboarding-hello-close`,type:`button`,variant:`secondary`,onClick:t,isDisabled:v,children:r(a.BUTTON$CLOSE)})]})]})}var je=t({OnboardingModal:()=>Ne}),Z=[`backend`,`agent`,`setup`,`hello`],Me=[`agent`,`setup`,`hello`],Q=`openhands-onboarding-started`;function $({index:e,currentStep:t,children:n}){let r=e===t,i=(e-t)*100;return(0,q.jsx)(`div`,{"data-testid":`onboarding-slide-${e}`,"data-active":r,"aria-hidden":!r,style:{transform:`translateX(${i}%)`},className:y(`w-full transition-transform duration-300 ease-out`,!r&&`pointer-events-none absolute inset-0`),children:n})}function Ne({onClose:e,initialStep:t=0,isPreview:n=!1}){let{t:r}=i(`openhands`),{data:o}=I(),s=o?.user_consents_to_analytics===!0,{trackOnboardingStarted:c,trackOnboardingStepViewed:l,trackOnboardingCompleted:d,trackOnboardingSkipped:f}=ee(),{active:p}=u(),{backend:m}=p,h=T(m),g=E(h?[]:[m]),_=C(),v=_!==null&&m.kind===`cloud`&&x(m.host,_),b=!h&&g[m.id]?.isConnected===!0&&(_===null||v),S=b?Me:Z,[w,A]=K.useState(()=>Z[Math.min(Math.max(t,0),Z.length-1)]),[j,M]=K.useState(`openhands`);K.useEffect(()=>{S.includes(w)||A(S[0])},[w,S]);let N=S.length,P=S.includes(w)?w:S[0],F=S.indexOf(P),L=h||g[m.id]?.isConnected!==void 0,R=j===`openhands`,z=F===0&&C()!==null,B=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.min((n===-1?0:n)+1,t.length-1)]})},[S]),V=K.useCallback(()=>{A(e=>{let t=S,n=t.indexOf(e);return t[Math.max((n===-1?0:n)-1,0)]})},[S]),H=K.useRef(!1);K.useEffect(()=>{n||!s||H.current||window.sessionStorage.getItem(Q)||(H.current=!0,window.sessionStorage.setItem(Q,`1`),c())},[n,s]);let U=K.useRef(null);K.useEffect(()=>{n||!s||!L||U.current!==P&&(U.current=P,l({step:P,stepIndex:F,totalSteps:N,agent:j}))},[n,s,L,P,F,N,j]);let W=()=>{d({agent:j}),e()},G=()=>{f({step:P,stepIndex:F,totalSteps:N,agent:j}),e()};return(0,q.jsx)(D,{"aria-label":r(a.ONBOARDING$TITLE),children:(0,q.jsxs)(`div`,{className:`relative flex flex-col items-center gap-4`,children:[(0,q.jsxs)(`section`,{"data-testid":`onboarding-modal`,"data-current-step":F,"data-preview":n?`true`:void 0,className:y(`flex flex-col gap-6 overflow-hidden rounded-2xl border border-white/10 bg-base-secondary shadow-2xl`,O(`lg`),k,`max-h-[90vh]`),children:[(0,q.jsx)(`header`,{className:`flex flex-col gap-3 px-7 pt-7 shrink-0`,children:(0,q.jsx)(ye,{currentStep:F,totalSteps:N})}),(0,q.jsx)(`div`,{"data-testid":`onboarding-scroll-area`,className:`flex-1 min-h-0 overflow-y-auto custom-scrollbar-always px-7`,children:(0,q.jsxs)(`div`,{"data-testid":`onboarding-slide-rail`,"data-current-step":F,className:`relative overflow-clip`,children:[b?null:(0,q.jsx)($,{index:S.indexOf(`backend`),currentStep:F,children:(0,q.jsx)(Te,{onNext:B,onClose:e})}),(0,q.jsx)($,{index:S.indexOf(`agent`),currentStep:F,children:(0,q.jsx)(Ce,{selectedAgentId:j,onSelect:M,onBack:b?void 0:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`setup`),currentStep:F,children:R?(0,q.jsx)(De,{onBack:V,onNext:B}):(0,q.jsx)(Oe,{providerKey:j,isActive:P===`setup`,onBack:V,onNext:B})}),(0,q.jsx)($,{index:S.indexOf(`hello`),currentStep:F,children:(0,q.jsx)(Ae,{onBack:V,onClose:G,onLaunched:W})})]})})]}),F<N-1&&!z?(0,q.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(a.ONBOARDING$SKIP)}):null]})})}export{je as n,J as r,Ne as t};
@@ -1 +1 @@
1
- import{l as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{b as t}from"./active-backend-context-DRFevVIj.js";import{n}from"./agent-server-client-options-DVLRd9sw.js";var r=class{static async getModels(){let t=new e(n()),[r,i,a]=await Promise.all([t.getModels(),t.getVerifiedModels(),t.getProviders()]),o=Object.keys(i??{}).sort(),s=o.flatMap(e=>i[e]??[]);return{models:r??[],verified_models:s,verified_providers:a?.filter(e=>o.includes(e))??o,default_model:s[0]??r?.[0]??``}}static async getConfig(){return await t(),{posthog_client_key:`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}};export{r as t};
1
+ import{l as e}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~ncdxw0bh-ClHnt5lR.js";import{b as t}from"./active-backend-context-B3umL5R-.js";import{n}from"./agent-server-client-options-DVLRd9sw.js";var r=class{static async getModels(){let t=new e(n()),[r,i,a]=await Promise.all([t.getModels(),t.getVerifiedModels(),t.getProviders()]),o=Object.keys(i??{}).sort(),s=o.flatMap(e=>i[e]??[]);return{models:r??[],verified_models:s,verified_providers:a?.filter(e=>o.includes(e))??o,default_model:s[0]??r?.[0]??``}}static async getConfig(){return await t(),{posthog_client_key:`phc_BgzfxKdgsYMLFTmJqt424ZoyVHvKFfrwttLimzdYTKFK`,feature_flags:{hide_llm_settings:!1,hide_users_page:!0},providers_configured:[],maintenance_start_time:null,recaptcha_site_key:null,faulty_models:[],error_message:null,updated_at:new Date().toISOString()}}};export{r as t};