@openhands/agent-canvas 1.15.0 → 1.16.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 (739) hide show
  1. package/README.md +15 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{acp-providers-BKvmTf82.js → acp-providers-CX3Lh9gj.js} +1 -1
  4. package/build/assets/active-backend-context-CrHTlgvN.js +2 -0
  5. package/build/assets/{agent-context-settings-D3PjSTU1.js → agent-context-settings-DSZlXrLj.js} +1 -1
  6. package/build/assets/{agent-profiles-settings-D4cY5U2T.js → agent-profiles-settings-Dzgb7G9z.js} +1 -1
  7. package/build/assets/agent-server-conversation-service.api-tnqNjbpE.js +86 -0
  8. package/build/assets/agent-settings-DLtsqaOs.js +2 -0
  9. package/build/assets/agent-settings-fFvR-XC2.js +1 -0
  10. package/build/assets/alert-banner-HP6mX-Vr.js +1 -0
  11. package/build/assets/{api-error-message-BJyfWp6p.js → api-error-message-B-XdSk3b.js} +1 -1
  12. package/build/assets/api-key-entry-screen-qTzrmJcr.js +1 -0
  13. package/build/assets/{app-settings-CbHqzQus.js → app-settings-dbnneVaV.js} +1 -1
  14. package/build/assets/automation-detail-BmwlCUAB.js +3 -0
  15. package/build/assets/{automation-export-BRopEHMu.js → automation-export-D3a3of4G.js} +1 -1
  16. package/build/assets/{automation-git-sync-CzyS4cn1.js → automation-git-sync-CprN5DcU.js} +1 -1
  17. package/build/assets/automation-setup-route-C40kXjMY.js +1 -0
  18. package/build/assets/{automation-templates-C_0FZgLG.js → automation-templates-BRppNh99.js} +1 -1
  19. package/build/assets/automations-list-DuNcRawl.js +1 -0
  20. package/build/assets/{back-nav-button-Dm9tIjVf.js → back-nav-button-Cjl_hoxq.js} +1 -1
  21. package/build/assets/backend-form-modal-lhGwzXFI.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-3fOwg6Bd.js → backend-synced-settings-badge-DPkz30BE.js} +1 -1
  23. package/build/assets/{badge-D4SqUCsR.js → badge-BU3S0VtE.js} +1 -1
  24. package/build/assets/{base-modal-C7_BDl_U.js → base-modal-D_L0oEbG.js} +1 -1
  25. package/build/assets/{bot-C-0Wu7vQ.js → bot-dMYHVfYM.js} +1 -1
  26. package/build/assets/{brand-button-Dxv6PDeN.js → brand-button-BAfk4wGP.js} +1 -1
  27. package/build/assets/browser-DSAo0tz1.js +46 -0
  28. package/build/assets/{browser-tab-BAl4ckJE.js → browser-tab-C9vy56R5.js} +1 -1
  29. package/build/assets/canvas-extension-page-dx1gFrfW.js +1 -0
  30. package/build/assets/canvas-extensions-8A-XhpgP.js +1 -0
  31. package/build/assets/canvas-extensions-runtime-2_x5Ezmi.js +1 -0
  32. package/build/assets/{chat-send-button-DWwR2cgI.js → chat-send-button-MUQqCZCS.js} +1 -1
  33. package/build/assets/check-CS0vmpQQ.js +1 -0
  34. package/build/assets/chevron-down-e1QBpjVy.js +1 -0
  35. package/build/assets/chevron-right-ZG4R5G4Q.js +1 -0
  36. package/build/assets/circle-check-DzWLNsbE.js +1 -0
  37. package/build/assets/{circle-plus-check-toggle-CBh_qomE.js → circle-plus-check-toggle-BO_kFZt3.js} +1 -1
  38. package/build/assets/{cloud-funnel-analytics-287iIERo.js → cloud-funnel-analytics-CztBCCPp.js} +1 -1
  39. package/build/assets/{cog-C4rrw-ZK.js → cog-D-MPQW6G.js} +1 -1
  40. package/build/assets/command-menu--UIlGL72.js +1 -0
  41. package/build/assets/{commits-tab-DZtJgaDM.js → commits-tab-AnZwLvh-.js} +1 -1
  42. package/build/assets/{condenser-settings-BcNmYR4s.js → condenser-settings-DmEOje-7.js} +1 -1
  43. package/build/assets/{confirmation-modal-Bk4JRcCM.js → confirmation-modal-Dv1ktp8K.js} +1 -1
  44. package/build/assets/{context-menu-list-item-lVYETtY5.js → context-menu-list-item-I86vKcmM.js} +1 -1
  45. package/build/assets/conversation-BbGrAO4Z.js +93 -0
  46. package/build/assets/conversation-mYT6NAoj.js +1 -0
  47. package/build/assets/conversation-panel-mYT6NAoj.js +1 -0
  48. package/build/assets/conversation-state-store-B0ImPLHO.js +1 -0
  49. package/build/assets/{conversation-tab-empty-state-HJtkmHZj.js → conversation-tab-empty-state-FIbh_lc8.js} +1 -1
  50. package/build/assets/{copy-to-clipboard-button-Cjkswvnj.js → copy-to-clipboard-button-Ca8iSkkA.js} +1 -1
  51. package/build/assets/{device-verify-EZhHhBT7.js → device-verify-Bhn2e_Ye.js} +1 -1
  52. package/build/assets/{dropdown-classes-DJe-E6MC.js → dropdown-classes-Bc1djN0-.js} +1 -1
  53. package/build/assets/{edit-automation-modal-D-urtv8n.js → edit-automation-modal-DadGbJ2u.js} +1 -1
  54. package/build/assets/empty-state-BoGVDecT.js +1 -0
  55. package/build/assets/{entry.client-C7Bi2tkU.js → entry.client-CqyPPjOq.js} +2 -2
  56. package/build/assets/{enum-filter-dropdown-DliX_Lo0.js → enum-filter-dropdown-Bgca129f.js} +1 -1
  57. package/build/assets/{environment-switch-overlay-CEKrFiMw.js → environment-switch-overlay-BmBRT7gv.js} +1 -1
  58. package/build/assets/{error-state-BALXiBNy.js → error-state-Body8Ngd.js} +1 -1
  59. package/build/assets/extensions-hub-CcDqq_vR.js +1 -0
  60. package/build/assets/extensions-navigation-Cr4yzYk4.js +1 -0
  61. package/build/assets/{external-link-DFpYunfj.js → external-link-DKUlnCQV.js} +1 -1
  62. package/build/assets/files-tab-D4o2VyE_.js +1 -0
  63. package/build/assets/{form-control-classes-CGw40z5h.js → form-control-classes-Bkh5FGrD.js} +1 -1
  64. package/build/assets/format-model-name-CasAP3nd.js +1 -0
  65. package/build/assets/get-git-path-ChKDVHZp.js +1 -0
  66. package/build/assets/{git-repo-dropdown-ai8qaNkD.js → git-repo-dropdown-4ROKl2cB.js} +1 -1
  67. package/build/assets/git-repo-dropdown-BkqzkMmM.js +1 -0
  68. package/build/assets/{highlighted-source-view-C3sxykQi.js → highlighted-source-view-BFRxGT_Q.js} +1 -1
  69. package/build/assets/home-ChpSuepX.js +1 -0
  70. package/build/assets/home-DIsB440S.js +1 -0
  71. package/build/assets/home-automation-run-tooltip-BVNDWjAH.js +1 -0
  72. package/build/assets/home-store-CY9Ej0ux.js +1 -0
  73. package/build/assets/index-home-BdlrFIif.js +1 -0
  74. package/build/assets/info-B6RQawoW.js +1 -0
  75. package/build/assets/install-server-modal-Dpy89p4g.js +1 -0
  76. package/build/assets/kebab-menu-item-content-D8hSNGmm.js +1 -0
  77. package/build/assets/{key-Cn5za3rg.js → key-BmVyxs-2.js} +1 -1
  78. package/build/assets/{launch-C1ieiOGe.js → launch-IrTDEFCs.js} +1 -1
  79. package/build/assets/list-filter-DsEK7NFC.js +1 -0
  80. package/build/assets/{list-todo-Cuu-STFc.js → list-todo-apgLVjMw.js} +1 -1
  81. package/build/assets/llm-not-configured-banner-CIFABh3K.js +27 -0
  82. package/build/assets/llm-settings-B9juXhIa.js +1 -0
  83. package/build/assets/llm-settings-De1d5dfr.js +1 -0
  84. package/build/assets/llm-subscription-service-BpJ0ouQo.js +1 -0
  85. package/build/assets/loader-circle-CC1au6hc.js +1 -0
  86. package/build/assets/{loading-spinner-0L3ZTToZ.js → loading-spinner-BY9N3pOe.js} +1 -1
  87. package/build/assets/manage-backends-modal-BrPV3oB-.js +1 -0
  88. package/build/assets/manifest-80fb1c29.js +1 -0
  89. package/build/assets/{manifest-subpage-layout-BGhiUQbA.js → manifest-subpage-layout-CAOYzrYp.js} +1 -1
  90. package/build/assets/{map-provider-B9LTm23I.js → map-provider-Cu3Zgumb.js} +1 -1
  91. package/build/assets/markdown-renderer-BzTlxI8x.js +8 -0
  92. package/build/assets/{mcp-CKbR4Vft.js → mcp-BTs_SXfZ.js} +1 -1
  93. package/build/assets/{mcp-marketplace-utils-C13fFccR.js → mcp-marketplace-utils-AIBzzHTO.js} +1 -1
  94. package/build/assets/{mcp-page-Bm4K2NQq.js → mcp-page-BEBYqH_K.js} +2 -2
  95. package/build/assets/messages-DKV9cRc2.js +41 -0
  96. package/build/assets/{modal-body-CMOc2tLl.js → modal-body-BxZjsju9.js} +1 -1
  97. package/build/assets/{modal-classes-BAb4Y_BG.js → modal-classes-C8eycCwG.js} +1 -1
  98. package/build/assets/{modal-close-button-CkJ0Ktjj.js → modal-close-button-DDzdRvCs.js} +1 -1
  99. package/build/assets/{mouse-pointer-click-CsgRs_-r.js → mouse-pointer-click-Co2uyaPA.js} +1 -1
  100. package/build/assets/onboarding-DV_OXoeP.js +1 -0
  101. package/build/assets/onboarding-modal-rkyBYkeQ.js +1 -0
  102. package/build/assets/{organization-service.api-C8XpQ0pM.js → organization-service.api-DrYNkEN_.js} +1 -1
  103. package/build/assets/{pencil-Clh1Wjvh.js → pencil-47jAZH_V.js} +1 -1
  104. package/build/assets/pin-By41Vl5J.js +1 -0
  105. package/build/assets/{planner-tab-DQvDU3ap.js → planner-tab-C9uZmhme.js} +1 -1
  106. package/build/assets/{plug-BuQhHSSG.js → plug-CG5HFcNG.js} +1 -1
  107. package/build/assets/plugins-management-service-BMJgC3Ga.js +1 -0
  108. package/build/assets/plus-C7Slq-0I.js +1 -0
  109. package/build/assets/profiles-service.api-ChoKrL0l.js +1 -0
  110. package/build/assets/providers-BhMcY5nv.js +1 -0
  111. package/build/assets/proxy-9Fe1v5na.js +1 -0
  112. package/build/assets/{puzzle-A9pGxxai.js → puzzle-JM_QaRm0.js} +1 -1
  113. package/build/assets/recommended-automations-launcher-6ABrI9Cy.js +1 -0
  114. package/build/assets/{refresh-cw-Bh69DyYO.js → refresh-cw-3q3Frrii.js} +1 -1
  115. package/build/assets/root-Dc8YmC9F.js +2 -0
  116. package/build/assets/root-VDaypvK4.css +1 -0
  117. package/build/assets/root-layout-CXkhSPYh.js +2 -0
  118. package/build/assets/schema-field-D-y9-LDb.js +1 -0
  119. package/build/assets/{sdk-section-page-HTffvm7Q.js → sdk-section-page-BlFiizlG.js} +1 -1
  120. package/build/assets/{secret-form-HTUbYw5o.js → secret-form-BB7the8W.js} +1 -1
  121. package/build/assets/secrets-service-ByZVENbp.js +1 -0
  122. package/build/assets/{secrets-settings-BizaTEr1.js → secrets-settings-B_GpxKW2.js} +1 -1
  123. package/build/assets/{settings-BlmrkwRi.js → settings-C0EWuBtA.js} +1 -1
  124. package/build/assets/settings-CKqk8ZnH.js +1 -0
  125. package/build/assets/{settings-dropdown-input-tM0A0ipy.js → settings-dropdown-input-BcwylHs2.js} +1 -1
  126. package/build/assets/{settings-index-CKq0b0Vg.js → settings-index-5w5UW2K3.js} +1 -1
  127. package/build/assets/{settings-input-C03KUoSC.js → settings-input-Db-1g8Ql.js} +1 -1
  128. package/build/assets/{settings-list-classes-BJ0g8rWj.js → settings-list-classes-BzeSZbF2.js} +1 -1
  129. package/build/assets/{settings-modal-AzEF1QPP.js → settings-modal-DfJ3tcJQ.js} +1 -1
  130. package/build/assets/settings-service.api-DJ1r62Zr.js +1 -0
  131. package/build/assets/{settings-switch-CQE0EGC-.js → settings-switch-CS-dJDmA.js} +1 -1
  132. package/build/assets/{settings-utils-ClYOkbbI.js → settings-utils-UYpEdPuD.js} +1 -1
  133. package/build/assets/shared-conversation-CA5ISEDy.js +1 -0
  134. package/build/assets/{shield-check-CFDViW82.js → shield-check-D2aCRd16.js} +1 -1
  135. package/build/assets/{sidebar-layout-D3hE08wK.js → sidebar-layout-D6fS8-Gl.js} +1 -1
  136. package/build/assets/{sidebar-mobile-menu-toggle-BOtyJHwE.js → sidebar-mobile-menu-toggle-C_fb0Jki.js} +1 -1
  137. package/build/assets/sidebar-nav-link-DQQcMf1A.js +1 -0
  138. package/build/assets/{sidebar-onboarding-checklist-storage-3qYflszY.js → sidebar-onboarding-checklist-storage-BBkeI6Bp.js} +1 -1
  139. package/build/assets/sidebar-store-DGqHkVLw.js +1 -0
  140. package/build/assets/{skill-card-pill-row-CFxjoqxn.js → skill-card-pill-row-B27-xyig.js} +1 -1
  141. package/build/assets/skill-enablement-DXeaImBz.js +1 -0
  142. package/build/assets/skill-filter-w__3UCEE.js +2 -0
  143. package/build/assets/{skill-icon-badge-CPQJ6A-I.js → skill-icon-badge-RQkq8wvl.js} +1 -1
  144. package/build/assets/skill-scope-B42H-XOc.js +1 -0
  145. package/build/assets/skills-plugins-tgF8EiXC.js +1 -0
  146. package/build/assets/skills-settings-BgJ9PaOe.js +1 -0
  147. package/build/assets/{styled-tooltip-Dl06rkpY.js → styled-tooltip-C4jf5Fv9.js} +1 -1
  148. package/build/assets/{task-list-tab-04GNQuii.js → task-list-tab-C5zcaktH.js} +1 -1
  149. package/build/assets/{terminal-Cj0iHIW7.js → terminal-CNElN42a.js} +2 -2
  150. package/build/assets/{toggle-switch-Fd_QGz0r.js → toggle-switch-ChOLXv2n.js} +1 -1
  151. package/build/assets/{trash-2-Dl8_RGz0.js → trash-2-D7K26eDO.js} +1 -1
  152. package/build/assets/{trash-_RMt7Ayc.js → trash-D-HYiVYM.js} +1 -1
  153. package/build/assets/{triangle-alert-SM-q4NU_.js → triangle-alert-CtdXWHUI.js} +1 -1
  154. package/build/assets/{typography-SgFy466J.js → typography-v1KN0tzi.js} +1 -1
  155. package/build/assets/usage-tab-CVDffLPt.js +1 -0
  156. package/build/assets/use-acp-credential-form-XIQmpX6M.js +1 -0
  157. package/build/assets/{use-activate-agent-profile-B2NS8nA5.js → use-activate-agent-profile-BLfmvDiG.js} +1 -1
  158. package/build/assets/use-agent-profiles-Bd9Bvvp1.js +1 -0
  159. package/build/assets/{use-automation-health-BxXdzZMP.js → use-automation-health-E6NZi9rb.js} +1 -1
  160. package/build/assets/{use-automations-zYb0dUny.js → use-automations-xijQKIl9.js} +1 -1
  161. package/build/assets/{use-can-manage-org-profiles-BWMahtUh.js → use-can-manage-org-profiles-CrJP5262.js} +1 -1
  162. package/build/assets/use-canvas-extensions-Bi693ujJ.js +1 -0
  163. package/build/assets/{use-cloud-current-user-id-CPHMDG-C.js → use-cloud-current-user-id-CDfAHpPX.js} +1 -1
  164. package/build/assets/use-config-A9QovgXO.js +1 -0
  165. package/build/assets/{use-create-conversation-DwN5vv2f.js → use-create-conversation-Dx3l7mFZ.js} +1 -1
  166. package/build/assets/use-create-secret-B9cUFWRG.js +1 -0
  167. package/build/assets/{use-get-secrets-BT4ihRwj.js → use-get-secrets-K3jmk-LH.js} +1 -1
  168. package/build/assets/use-is-authed-nTBcM7dE.js +1 -0
  169. package/build/assets/use-llm-configured-BV9nZ1_j.js +1 -0
  170. package/build/assets/use-llm-profiles-BO-P4Oyo.js +1 -0
  171. package/build/assets/use-manifest-capabilities-Cw_flwEz.js +1 -0
  172. package/build/assets/use-onboarding-completion-D8U7k4Qb.js +1 -0
  173. package/build/assets/use-pinned-home-route-CckOZrmb.js +1 -0
  174. package/build/assets/use-plugins-marketplace-7i94Zu3Z.js +1 -0
  175. package/build/assets/use-save-agent-profile-BUjSsDXK.js +1 -0
  176. package/build/assets/{use-save-settings-CUZW6yXP.js → use-save-settings-DYqkKv7T.js} +1 -1
  177. package/build/assets/{use-settings-C5VhGpqd.js → use-settings-DSXLbvBl.js} +1 -1
  178. package/build/assets/{use-settings-nav-items-DHaUu1Dg.js → use-settings-nav-items-CwRw-CmX.js} +1 -1
  179. package/build/assets/use-tracking-D53y3TH9.js +3 -0
  180. package/build/assets/{use-user-conversation-DT0_QCnL.js → use-user-conversation-B9Gebw_g.js} +1 -1
  181. package/build/assets/{useInfiniteQuery-CgeUQPfs.js → useInfiniteQuery-C926xzY4.js} +1 -1
  182. package/build/assets/{useMutation-DFnzkf6f.js → useMutation-B-qc391N.js} +1 -1
  183. package/build/assets/{useQueries-BhbrGEf1.js → useQueries-DlbhlH9I.js} +1 -1
  184. package/build/assets/{useQuery-BXWbZBZl.js → useQuery-BSTgq1rl.js} +1 -1
  185. package/build/assets/utils-CN5ZfZy1.js +1 -0
  186. package/build/assets/{vendor~conversation-panel~conversation-CTvDDiXg.js → vendor~conversation-panel~conversation-C8Fn4XOf.js} +1 -1
  187. package/build/assets/{vendor~entry.client-BFE7Llz9.js → vendor~entry.client-CoCfUXUF.js} +1 -1
  188. package/build/assets/{vendor~entry.client-BaKt_PIp.js → vendor~entry.client-DA2izTjq.js} +1 -1
  189. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-ZixYGy6E.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js} +1 -1
  190. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-BTyukeM-.js → vendor~index-home~home~conversation-panel~conversation-hWywRBaR.js} +1 -1
  191. package/build/assets/{vendor~root-layout-BlUaZ18v.js → vendor~root-layout-C9Ju9DQg.js} +1 -1
  192. package/build/assets/{vendor~root-layout~conversation-panel~conversation-BYAWJwQX.js → vendor~root-layout~conversation-panel~conversation-BMbMgaGu.js} +1 -1
  193. package/build/assets/{vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-CHaLEBVR.js → vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BWir3rJs.js} +1 -1
  194. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-j5MFqfSy.js +1 -0
  195. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-cDuKr-WD.js +1 -0
  196. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js} +1 -1
  197. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-Dtu7BpYk.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~nj1hli3r-DP9wmsjo.js} +2 -2
  198. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-DonTKfQD.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~eo2nf80n-CUmIwQCN.js} +117 -13
  199. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-BgxDvUcf.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~jz4f6vo2-C7HiY4Ae.js} +42 -3
  200. package/build/assets/{verification-settings-Bj6bo097.js → verification-settings-gw_q6vkL.js} +1 -1
  201. package/build/assets/{wrench-hi7Q13dF.js → wrench-CUEI1krB.js} +1 -1
  202. package/build/assets/{x-DkgltWa0.js → x-DJdhbdmt.js} +1 -1
  203. package/build/index.html +4 -4
  204. package/build/locales/ar/openhands.json +32 -16
  205. package/build/locales/ca/openhands.json +32 -16
  206. package/build/locales/de/openhands.json +32 -16
  207. package/build/locales/en/openhands.json +32 -16
  208. package/build/locales/es/openhands.json +32 -16
  209. package/build/locales/fr/openhands.json +32 -16
  210. package/build/locales/it/openhands.json +32 -16
  211. package/build/locales/ja/openhands.json +32 -16
  212. package/build/locales/ko-KR/openhands.json +32 -16
  213. package/build/locales/no/openhands.json +32 -16
  214. package/build/locales/pt/openhands.json +32 -16
  215. package/build/locales/tr/openhands.json +32 -16
  216. package/build/locales/uk/openhands.json +32 -16
  217. package/build/locales/zh-CN/openhands.json +32 -16
  218. package/build/locales/zh-TW/openhands.json +32 -16
  219. package/config/defaults.json +9 -5
  220. package/dist/api/agent-profiles-service/profile-field-support.d.ts +26 -0
  221. package/dist/api/agent-server-adapter.cjs +3 -3
  222. package/dist/api/agent-server-adapter.cjs.map +1 -1
  223. package/dist/api/agent-server-adapter.js +118 -116
  224. package/dist/api/agent-server-adapter.js.map +1 -1
  225. package/dist/api/agent-server-compatibility.cjs +1 -1
  226. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  227. package/dist/api/agent-server-compatibility.d.ts +21 -0
  228. package/dist/api/agent-server-compatibility.js +52 -38
  229. package/dist/api/agent-server-compatibility.js.map +1 -1
  230. package/dist/api/agent-server-config.cjs +1 -1
  231. package/dist/api/agent-server-config.cjs.map +1 -1
  232. package/dist/api/agent-server-config.d.ts +26 -0
  233. package/dist/api/agent-server-config.js +18 -5
  234. package/dist/api/agent-server-config.js.map +1 -1
  235. package/dist/api/canvas-extensions-service.cjs +1 -0
  236. package/dist/api/canvas-extensions-service.d.ts +22 -0
  237. package/dist/api/canvas-extensions-service.js +4 -0
  238. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  239. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  240. package/dist/api/cloud/conversation-service.api.d.ts +6 -0
  241. package/dist/api/cloud/conversation-service.api.js +14 -6
  242. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  243. package/dist/api/conversation-file-upload.api.cjs +1 -1
  244. package/dist/api/conversation-file-upload.api.js +10 -10
  245. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  246. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  247. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +11 -0
  248. package/dist/api/conversation-service/agent-server-conversation-service.api.js +129 -118
  249. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  250. package/dist/api/event-service/event-service.api.cjs +1 -1
  251. package/dist/api/event-service/event-service.api.js +12 -12
  252. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  253. package/dist/api/git-service/agent-server-git-service.api.js +8 -8
  254. package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
  255. package/dist/api/runtime-service/agent-server-runtime-service.js +8 -8
  256. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  257. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  258. package/dist/api/settings-service/settings-service.api.d.ts +3 -2
  259. package/dist/api/settings-service/settings-service.api.js +2 -1
  260. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  261. package/dist/components/conversation-events/chat/event-message-components/event-group.cjs +1 -1
  262. package/dist/components/conversation-events/chat/event-message-components/event-group.cjs.map +1 -1
  263. package/dist/components/conversation-events/chat/event-message-components/event-group.js +40 -36
  264. package/dist/components/conversation-events/chat/event-message-components/event-group.js.map +1 -1
  265. package/dist/components/features/automations/automation-card.cjs +1 -1
  266. package/dist/components/features/automations/automation-card.cjs.map +1 -1
  267. package/dist/components/features/automations/automation-card.js +114 -104
  268. package/dist/components/features/automations/automation-card.js.map +1 -1
  269. package/dist/components/features/automations/detail/run-phase.cjs +2 -0
  270. package/dist/components/features/automations/detail/run-phase.cjs.map +1 -0
  271. package/dist/components/features/automations/detail/run-phase.d.ts +89 -0
  272. package/dist/components/features/automations/detail/run-phase.js +72 -0
  273. package/dist/components/features/automations/detail/run-phase.js.map +1 -0
  274. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  275. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  276. package/dist/components/features/backends/backend-form-modal.js +5 -11
  277. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  278. package/dist/components/features/canvas-extensions/add-canvas-extension-modal.d.ts +6 -0
  279. package/dist/components/features/canvas-extensions/canvas-extension-card.d.ts +9 -0
  280. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs +2 -0
  281. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs.map +1 -0
  282. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.d.ts +23 -0
  283. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js +19 -0
  284. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js.map +1 -0
  285. package/dist/components/features/chat/chat-interface.cjs +2 -2
  286. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  287. package/dist/components/features/chat/chat-interface.js +171 -168
  288. package/dist/components/features/chat/chat-interface.js.map +1 -1
  289. package/dist/components/features/chat/chat-markdown-path-code.cjs +3 -0
  290. package/dist/components/features/chat/chat-markdown-path-code.cjs.map +1 -0
  291. package/dist/components/features/chat/chat-markdown-path-code.d.ts +27 -0
  292. package/dist/components/features/chat/chat-markdown-path-code.js +72 -0
  293. package/dist/components/features/chat/chat-markdown-path-code.js.map +1 -0
  294. package/dist/components/features/chat/path-component.cjs +1 -1
  295. package/dist/components/features/chat/path-component.cjs.map +1 -1
  296. package/dist/components/features/chat/path-component.d.ts +8 -2
  297. package/dist/components/features/chat/path-component.js +33 -21
  298. package/dist/components/features/chat/path-component.js.map +1 -1
  299. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  300. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  301. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +38 -43
  302. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  303. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  304. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  305. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +8 -5
  306. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +22 -16
  307. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  308. package/dist/components/features/chat/user-message-body.cjs +1 -1
  309. package/dist/components/features/chat/user-message-body.cjs.map +1 -1
  310. package/dist/components/features/chat/user-message-body.d.ts +4 -0
  311. package/dist/components/features/chat/user-message-body.js +30 -24
  312. package/dist/components/features/chat/user-message-body.js.map +1 -1
  313. package/dist/components/features/conversation/conversation-overview-skills-panel.cjs +1 -1
  314. package/dist/components/features/conversation/conversation-overview-skills-panel.cjs.map +1 -1
  315. package/dist/components/features/conversation/conversation-overview-skills-panel.js +63 -81
  316. package/dist/components/features/conversation/conversation-overview-skills-panel.js.map +1 -1
  317. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  318. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  319. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +50 -50
  320. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  321. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs +1 -1
  322. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs.map +1 -1
  323. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.d.ts +1 -1
  324. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js +3 -3
  325. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js.map +1 -1
  326. package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
  327. package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
  328. package/dist/components/features/conversation-panel/skills-modal.js +29 -28
  329. package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
  330. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  331. package/dist/components/features/files-tab/file-content-viewer.js +5 -5
  332. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  333. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  334. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +51 -29
  335. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  336. package/dist/components/features/onboarding/onboarding-host.d.ts +3 -4
  337. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +5 -9
  338. package/dist/components/features/settings/acp-auth-status-banner.d.ts +23 -6
  339. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  340. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +1 -0
  341. package/dist/components/features/settings/llm-profiles/provider-connection-modal.cjs +1 -1
  342. package/dist/components/features/settings/llm-profiles/provider-connection-modal.js +3 -0
  343. package/dist/components/features/settings/sdk-settings/field-help.cjs +1 -1
  344. package/dist/components/features/settings/sdk-settings/field-help.cjs.map +1 -1
  345. package/dist/components/features/settings/sdk-settings/field-help.d.ts +1 -1
  346. package/dist/components/features/settings/sdk-settings/field-help.js +1 -1
  347. package/dist/components/features/settings/sdk-settings/field-help.js.map +1 -1
  348. package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs +1 -1
  349. package/dist/components/features/settings/sdk-settings/sdk-section-page.js +6 -6
  350. package/dist/components/features/settings/sdk-settings/sdk-section-page.js.map +1 -1
  351. package/dist/components/features/sidebar/sidebar-nav-link.cjs +1 -1
  352. package/dist/components/features/sidebar/sidebar-nav-link.cjs.map +1 -1
  353. package/dist/components/features/sidebar/sidebar-nav-link.d.ts +10 -1
  354. package/dist/components/features/sidebar/sidebar-nav-link.js +54 -36
  355. package/dist/components/features/sidebar/sidebar-nav-link.js.map +1 -1
  356. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  357. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  358. package/dist/components/features/sidebar/sidebar-rail-body.js +143 -120
  359. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  360. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  361. package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
  362. package/dist/components/features/sidebar/sidebar.js +1 -1
  363. package/dist/components/features/sidebar/sidebar.js.map +1 -1
  364. package/dist/components/features/skills/build-skill-pills.cjs +1 -1
  365. package/dist/components/features/skills/build-skill-pills.cjs.map +1 -1
  366. package/dist/components/features/skills/build-skill-pills.js +60 -52
  367. package/dist/components/features/skills/build-skill-pills.js.map +1 -1
  368. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  369. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  370. package/dist/components/features/skills/extensions-navigation.js +54 -43
  371. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  372. package/dist/components/features/skills/skill-filter.cjs +1 -1
  373. package/dist/components/features/skills/skill-filter.cjs.map +1 -1
  374. package/dist/components/features/skills/skill-filter.d.ts +8 -3
  375. package/dist/components/features/skills/skill-filter.js +69 -52
  376. package/dist/components/features/skills/skill-filter.js.map +1 -1
  377. package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
  378. package/dist/components/shared/modals/settings/settings-form.js +8 -8
  379. package/dist/config/defaults.cjs +1 -1
  380. package/dist/config/defaults.cjs.map +1 -1
  381. package/dist/config/defaults.js +9 -5
  382. package/dist/config/defaults.js.map +1 -1
  383. package/dist/contexts/conversation-websocket-context.cjs +3 -3
  384. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  385. package/dist/contexts/conversation-websocket-context.js +5 -5
  386. package/dist/extensions/canvas-extension-module-loader.d.ts +11 -0
  387. package/dist/hooks/mutation/use-manage-canvas-extensions.d.ts +12 -0
  388. package/dist/hooks/query/concurrency-limiter.cjs +2 -0
  389. package/dist/hooks/query/concurrency-limiter.cjs.map +1 -0
  390. package/dist/hooks/query/concurrency-limiter.d.ts +22 -0
  391. package/dist/hooks/query/concurrency-limiter.js +29 -0
  392. package/dist/hooks/query/concurrency-limiter.js.map +1 -0
  393. package/dist/hooks/query/query-keys.cjs.map +1 -1
  394. package/dist/hooks/query/query-keys.d.ts +4 -0
  395. package/dist/hooks/query/query-keys.js.map +1 -1
  396. package/dist/hooks/query/use-active-conversation.cjs +1 -1
  397. package/dist/hooks/query/use-active-conversation.js +4 -4
  398. package/dist/hooks/query/use-automations.cjs.map +1 -1
  399. package/dist/hooks/query/use-automations.js.map +1 -1
  400. package/dist/hooks/query/use-backends-health.cjs +1 -1
  401. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  402. package/dist/hooks/query/use-backends-health.d.ts +1 -1
  403. package/dist/hooks/query/use-backends-health.js +50 -64
  404. package/dist/hooks/query/use-backends-health.js.map +1 -1
  405. package/dist/hooks/query/use-canvas-extensions.cjs +1 -0
  406. package/dist/hooks/query/use-canvas-extensions.d.ts +5 -0
  407. package/dist/hooks/query/use-canvas-extensions.js +3 -0
  408. package/dist/hooks/query/use-commit-changes.cjs +1 -1
  409. package/dist/hooks/query/use-commit-changes.js +4 -4
  410. package/dist/hooks/query/use-latest-automation-runs.cjs +1 -1
  411. package/dist/hooks/query/use-latest-automation-runs.js +1 -0
  412. package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
  413. package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
  414. package/dist/hooks/query/use-paginated-conversations.js +19 -16
  415. package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
  416. package/dist/hooks/query/use-search-providers.cjs +1 -1
  417. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  418. package/dist/hooks/query/use-search-providers.js +17 -10
  419. package/dist/hooks/query/use-search-providers.js.map +1 -1
  420. package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
  421. package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
  422. package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
  423. package/dist/hooks/query/use-unified-git-commits.js +4 -4
  424. package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
  425. package/dist/hooks/query/use-unified-git-diff.js +4 -4
  426. package/dist/hooks/query/use-unified-vscode-url.cjs +1 -1
  427. package/dist/hooks/query/use-unified-vscode-url.cjs.map +1 -1
  428. package/dist/hooks/query/use-unified-vscode-url.d.ts +1 -0
  429. package/dist/hooks/query/use-unified-vscode-url.js +40 -26
  430. package/dist/hooks/query/use-unified-vscode-url.js.map +1 -1
  431. package/dist/hooks/query/use-workspace-file-content.cjs +1 -1
  432. package/dist/hooks/query/use-workspace-file-content.js +5 -5
  433. package/dist/hooks/query/use-workspace-files.cjs +1 -1
  434. package/dist/hooks/query/use-workspace-files.js +6 -6
  435. package/dist/hooks/use-acp-credential-form.d.ts +6 -0
  436. package/dist/hooks/use-conversation-overview-git-diff-stats.cjs +1 -1
  437. package/dist/hooks/use-conversation-overview-git-diff-stats.js +4 -4
  438. package/dist/hooks/use-pinned-home-route.cjs +2 -0
  439. package/dist/hooks/use-pinned-home-route.cjs.map +1 -0
  440. package/dist/hooks/use-pinned-home-route.d.ts +33 -0
  441. package/dist/hooks/use-pinned-home-route.js +34 -0
  442. package/dist/hooks/use-pinned-home-route.js.map +1 -0
  443. package/dist/hooks/use-skill-enablement.cjs +2 -0
  444. package/dist/hooks/use-skill-enablement.cjs.map +1 -0
  445. package/dist/hooks/use-skill-enablement.d.ts +14 -0
  446. package/dist/hooks/use-skill-enablement.js +80 -0
  447. package/dist/hooks/use-skill-enablement.js.map +1 -0
  448. package/dist/i18n/declaration.cjs +1 -1
  449. package/dist/i18n/declaration.cjs.map +1 -1
  450. package/dist/i18n/declaration.d.ts +29 -13
  451. package/dist/i18n/declaration.js +1 -1
  452. package/dist/i18n/declaration.js.map +1 -1
  453. package/dist/i18n/translation.cjs +3 -3
  454. package/dist/i18n/translation.cjs.map +1 -1
  455. package/dist/i18n/translation.js +538 -266
  456. package/dist/i18n/translation.js.map +1 -1
  457. package/dist/index.cjs +1 -1
  458. package/dist/index.js +15 -14
  459. package/dist/lib/index.cjs +1 -1
  460. package/dist/lib/index.d.ts +1 -0
  461. package/dist/lib/index.js +1 -0
  462. package/dist/locales/ar/openhands.json +32 -16
  463. package/dist/locales/ca/openhands.json +32 -16
  464. package/dist/locales/de/openhands.json +32 -16
  465. package/dist/locales/en/openhands.json +32 -16
  466. package/dist/locales/es/openhands.json +32 -16
  467. package/dist/locales/fr/openhands.json +32 -16
  468. package/dist/locales/it/openhands.json +32 -16
  469. package/dist/locales/ja/openhands.json +32 -16
  470. package/dist/locales/ko-KR/openhands.json +32 -16
  471. package/dist/locales/no/openhands.json +32 -16
  472. package/dist/locales/pt/openhands.json +32 -16
  473. package/dist/locales/tr/openhands.json +32 -16
  474. package/dist/locales/uk/openhands.json +32 -16
  475. package/dist/locales/zh-CN/openhands.json +32 -16
  476. package/dist/locales/zh-TW/openhands.json +32 -16
  477. package/dist/manifests/automation-interface.cjs +1 -1
  478. package/dist/manifests/automation-interface.cjs.map +1 -1
  479. package/dist/manifests/automation-interface.d.ts +6 -0
  480. package/dist/manifests/automation-interface.js +11 -8
  481. package/dist/manifests/automation-interface.js.map +1 -1
  482. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +45 -4
  483. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  484. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +1 -1
  485. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  486. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  487. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  488. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +5 -0
  489. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  490. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +1 -1
  491. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  492. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +5 -0
  493. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  494. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +1 -1
  495. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  496. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +5 -0
  497. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  498. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +1 -1
  499. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -1
  500. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +5 -0
  501. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -1
  502. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs +9 -0
  503. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
  504. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js +21 -0
  505. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js.map +1 -0
  506. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs +9 -0
  507. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs.map +1 -0
  508. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js +21 -0
  509. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js.map +1 -0
  510. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs +9 -0
  511. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
  512. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js +21 -0
  513. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js.map +1 -0
  514. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs +9 -0
  515. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs.map +1 -0
  516. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js +21 -0
  517. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js.map +1 -0
  518. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs +9 -0
  519. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs.map +1 -0
  520. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js +21 -0
  521. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js.map +1 -0
  522. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs +1 -1
  523. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs.map +1 -1
  524. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js +5 -0
  525. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js.map +1 -1
  526. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs +30 -0
  527. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs.map +1 -0
  528. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js +65 -0
  529. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js.map +1 -0
  530. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  531. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  532. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +21 -9
  533. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  534. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  535. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  536. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +2 -2
  537. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  538. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs +2 -0
  539. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs.map +1 -0
  540. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js +40 -0
  541. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js.map +1 -0
  542. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +1 -1
  543. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -1
  544. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +1 -1
  545. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
  546. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  547. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  548. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +74 -72
  549. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  550. package/dist/node_modules/@openhands/extensions/skills/index.cjs +42 -3
  551. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  552. package/dist/node_modules/@openhands/extensions/skills/index.js +22 -3
  553. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  554. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.cjs +1 -1
  555. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.js +1 -1
  556. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs +1 -1
  557. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs.map +1 -1
  558. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js +8 -7
  559. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js.map +1 -1
  560. package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
  561. package/dist/node_modules/@openhands/typescript-client/dist/index.js +2 -2
  562. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs +2 -0
  563. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs.map +1 -0
  564. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js +16 -0
  565. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js.map +1 -0
  566. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs +2 -0
  567. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs.map +1 -0
  568. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js +23 -0
  569. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js.map +1 -0
  570. package/dist/package.cjs +1 -1
  571. package/dist/package.cjs.map +1 -1
  572. package/dist/package.js +3 -3
  573. package/dist/package.js.map +1 -1
  574. package/dist/routes/agent-settings.d.ts +10 -0
  575. package/dist/routes/app-settings.cjs +1 -1
  576. package/dist/routes/app-settings.cjs.map +1 -1
  577. package/dist/routes/app-settings.js +7 -7
  578. package/dist/routes/files-tab.cjs +1 -1
  579. package/dist/routes/files-tab.cjs.map +1 -1
  580. package/dist/routes/files-tab.js +14 -14
  581. package/dist/routes/files-tab.js.map +1 -1
  582. package/dist/routes/llm-settings.cjs +1 -1
  583. package/dist/routes/llm-settings.cjs.map +1 -1
  584. package/dist/routes/llm-settings.js +122 -114
  585. package/dist/routes/llm-settings.js.map +1 -1
  586. package/dist/services/canvas-ui.cjs +1 -1
  587. package/dist/services/canvas-ui.cjs.map +1 -1
  588. package/dist/services/canvas-ui.d.ts +5 -0
  589. package/dist/services/canvas-ui.js +24 -10
  590. package/dist/services/canvas-ui.js.map +1 -1
  591. package/dist/services/settings.cjs +1 -1
  592. package/dist/services/settings.cjs.map +1 -1
  593. package/dist/services/settings.js +3 -2
  594. package/dist/services/settings.js.map +1 -1
  595. package/dist/types/automation.cjs.map +1 -1
  596. package/dist/types/automation.d.ts +20 -0
  597. package/dist/types/automation.js.map +1 -1
  598. package/dist/types/canvas-extension.cjs +2 -0
  599. package/dist/types/canvas-extension.cjs.map +1 -0
  600. package/dist/types/canvas-extension.d.ts +77 -0
  601. package/dist/types/canvas-extension.js +6 -0
  602. package/dist/types/canvas-extension.js.map +1 -0
  603. package/dist/types/settings.d.ts +7 -0
  604. package/dist/ui/help-link.cjs +1 -1
  605. package/dist/ui/help-link.cjs.map +1 -1
  606. package/dist/ui/help-link.d.ts +6 -1
  607. package/dist/ui/help-link.js +32 -18
  608. package/dist/ui/help-link.js.map +1 -1
  609. package/dist/utils/acp-auth-display.d.ts +35 -0
  610. package/dist/utils/cache-utils.cjs +1 -1
  611. package/dist/utils/cache-utils.js +5 -5
  612. package/dist/utils/format-model-name.cjs +1 -1
  613. package/dist/utils/format-model-name.cjs.map +1 -1
  614. package/dist/utils/format-model-name.d.ts +7 -3
  615. package/dist/utils/format-model-name.js +6 -11
  616. package/dist/utils/format-model-name.js.map +1 -1
  617. package/dist/utils/format-relative-time.cjs +1 -1
  618. package/dist/utils/format-relative-time.cjs.map +1 -1
  619. package/dist/utils/format-relative-time.d.ts +7 -0
  620. package/dist/utils/format-relative-time.js +7 -2
  621. package/dist/utils/format-relative-time.js.map +1 -1
  622. package/dist/utils/path-utils.cjs +1 -1
  623. package/dist/utils/path-utils.cjs.map +1 -1
  624. package/dist/utils/path-utils.d.ts +15 -3
  625. package/dist/utils/path-utils.js +29 -3
  626. package/dist/utils/path-utils.js.map +1 -1
  627. package/dist/utils/skill-enablement.cjs +2 -0
  628. package/dist/utils/skill-enablement.cjs.map +1 -0
  629. package/dist/utils/skill-enablement.d.ts +51 -0
  630. package/dist/utils/skill-enablement.js +31 -0
  631. package/dist/utils/skill-enablement.js.map +1 -0
  632. package/dist/utils/vscode-origin.cjs +2 -0
  633. package/dist/utils/vscode-origin.cjs.map +1 -0
  634. package/dist/utils/vscode-origin.d.ts +55 -0
  635. package/dist/utils/vscode-origin.js +27 -0
  636. package/dist/utils/vscode-origin.js.map +1 -0
  637. package/dist/utils/workspace-mode.d.ts +4 -0
  638. package/package.json +3 -3
  639. package/scripts/check-sdk-version-sync.mjs +6 -6
  640. package/scripts/check-translation-completeness.cjs +1 -0
  641. package/scripts/dev-extra-backend.mjs +28 -9
  642. package/scripts/dev-safe.mjs +81 -8
  643. package/scripts/dev-static.mjs +35 -37
  644. package/scripts/dev-with-automation.mjs +82 -1
  645. package/scripts/ingress.mjs +27 -1
  646. package/scripts/static-server.mjs +74 -1
  647. package/tools/canvas_ui_tool.py +19 -0
  648. package/build/assets/active-backend-context-DKFSMbn3.js +0 -2
  649. package/build/assets/agent-server-conversation-service.api-DozDKIW_.js +0 -86
  650. package/build/assets/agent-settings-351vXWc9.js +0 -2
  651. package/build/assets/agent-settings-Ce7BDZ6I.js +0 -1
  652. package/build/assets/alert-banner-Kyy1YWZU.js +0 -1
  653. package/build/assets/api-key-entry-screen-INIxqAMs.js +0 -1
  654. package/build/assets/automation-detail-DXDhUwPq.js +0 -3
  655. package/build/assets/automation-setup-route-FRr05f_g.js +0 -1
  656. package/build/assets/automations-list-CERuQWE6.js +0 -1
  657. package/build/assets/backend-form-modal-DK78-jn1.js +0 -1
  658. package/build/assets/browser-11etCQ04.js +0 -7
  659. package/build/assets/check-Cf2YoT90.js +0 -1
  660. package/build/assets/chevron-down-C3OQ-ehx.js +0 -1
  661. package/build/assets/chevron-right-CN1uUiJ1.js +0 -1
  662. package/build/assets/circle-check-g5yeGMd-.js +0 -1
  663. package/build/assets/command-menu-BZQ8S3Ke.js +0 -1
  664. package/build/assets/conversation-CchMzpGl.js +0 -1
  665. package/build/assets/conversation-Dpzftz57.js +0 -93
  666. package/build/assets/conversation-panel-CchMzpGl.js +0 -1
  667. package/build/assets/conversation-state-store-a9d2fxRc.js +0 -1
  668. package/build/assets/empty-state-CvaVahVr.js +0 -1
  669. package/build/assets/extensions-hub-CFduxBnk.js +0 -1
  670. package/build/assets/extensions-navigation-BeC224yX.js +0 -1
  671. package/build/assets/files-tab-CL3J9b3p.js +0 -1
  672. package/build/assets/format-model-name-BNPKVsIq.js +0 -1
  673. package/build/assets/get-git-path-DlAJa_i6.js +0 -1
  674. package/build/assets/git-repo-dropdown-DGMEhz7d.js +0 -1
  675. package/build/assets/home-BCGlNJCA.js +0 -1
  676. package/build/assets/home-DB1pRqTC.js +0 -1
  677. package/build/assets/home-automation-run-tooltip-CooFQRIG.js +0 -1
  678. package/build/assets/home-store-Dl1dPE58.js +0 -1
  679. package/build/assets/index-home-DB1pRqTC.js +0 -1
  680. package/build/assets/info-uYSVzX86.js +0 -1
  681. package/build/assets/install-server-modal-BbJdhzet.js +0 -1
  682. package/build/assets/kebab-menu-item-content-BYokkRHi.js +0 -1
  683. package/build/assets/list-filter-OFkpRrmi.js +0 -1
  684. package/build/assets/llm-not-configured-banner-BqqYnJ1t.js +0 -27
  685. package/build/assets/llm-settings-CnDbbmVW.js +0 -1
  686. package/build/assets/llm-settings-S8Yjg__1.js +0 -1
  687. package/build/assets/llm-subscription-service-BpPfzW4x.js +0 -1
  688. package/build/assets/loader-circle-nvrwthvj.js +0 -1
  689. package/build/assets/manage-backends-modal-BCUPswyl.js +0 -1
  690. package/build/assets/manifest-58597dde.js +0 -1
  691. package/build/assets/markdown-renderer-Cb2sBWtV.js +0 -8
  692. package/build/assets/messages-BTN5thLe.js +0 -40
  693. package/build/assets/onboarding-Cx_kaiD1.js +0 -1
  694. package/build/assets/onboarding-modal-vMwn7ihv.js +0 -1
  695. package/build/assets/plugins-management-service-BjYeF0b0.js +0 -1
  696. package/build/assets/plus-CEKne-Yp.js +0 -1
  697. package/build/assets/profiles-service.api-QB-T_u-g.js +0 -1
  698. package/build/assets/providers-FfSZ5TXP.js +0 -1
  699. package/build/assets/proxy-tcFL2yTQ.js +0 -1
  700. package/build/assets/recommended-automations-launcher-Bw8uC4V6.js +0 -1
  701. package/build/assets/root-BLeQfBEq.css +0 -1
  702. package/build/assets/root-ZKKYPR1Z.js +0 -2
  703. package/build/assets/root-layout-luJoE9IG.js +0 -2
  704. package/build/assets/schema-field-Csw5fhtN.js +0 -1
  705. package/build/assets/secrets-service-BTor9uAU.js +0 -1
  706. package/build/assets/settings-DcNPxz0v.js +0 -1
  707. package/build/assets/settings-service.api-B2agVfjL.js +0 -1
  708. package/build/assets/shared-conversation-B55pCyBG.js +0 -1
  709. package/build/assets/sidebar-nav-link-CPzhyHQg.js +0 -1
  710. package/build/assets/sidebar-store-DtpU7zaI.js +0 -1
  711. package/build/assets/skill-filter-CWZ5kjcg.js +0 -2
  712. package/build/assets/skill-scope-CV1dkAbW.js +0 -1
  713. package/build/assets/skills-plugins-DGHULTq6.js +0 -1
  714. package/build/assets/skills-settings-CM1lFv3e.js +0 -1
  715. package/build/assets/usage-tab-BcfWV6db.js +0 -1
  716. package/build/assets/use-acp-credential-form-BsSW5NHG.js +0 -1
  717. package/build/assets/use-agent-profiles-DWBPC0Si.js +0 -1
  718. package/build/assets/use-config-Bft35DOK.js +0 -1
  719. package/build/assets/use-create-secret-BSxJMxHp.js +0 -1
  720. package/build/assets/use-is-authed-CFGkY3-Z.js +0 -1
  721. package/build/assets/use-llm-configured-BI6obxsc.js +0 -1
  722. package/build/assets/use-llm-profiles-djGAhTWL.js +0 -1
  723. package/build/assets/use-manifest-capabilities-3z0-1G59.js +0 -1
  724. package/build/assets/use-onboarding-completion-BXpyUSsJ.js +0 -1
  725. package/build/assets/use-plugins-marketplace-DI4_pK56.js +0 -1
  726. package/build/assets/use-save-agent-profile-DdBSTdpN.js +0 -1
  727. package/build/assets/use-tracking-D5t9otIF.js +0 -3
  728. package/build/assets/utils-DaCIEEQP.js +0 -1
  729. package/build/assets/vendor~index-home~home~conversation-panel~conversation~alert-banner-B3qC_oj8.js +0 -1
  730. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-B2OLKL7N.js +0 -1
  731. package/dist/components/features/tips/random-tip.d.ts +0 -2
  732. package/dist/utils/tips.d.ts +0 -7
  733. package/dist/utils/workspace-relative-path.cjs +0 -2
  734. package/dist/utils/workspace-relative-path.cjs.map +0 -1
  735. package/dist/utils/workspace-relative-path.d.ts +0 -10
  736. package/dist/utils/workspace-relative-path.js +0 -22
  737. package/dist/utils/workspace-relative-path.js.map +0 -1
  738. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew3u153i-rfV8mQ9m.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js} +0 -0
  739. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js} +0 -0
@@ -0,0 +1,8 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js";import{v as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js";import{t as a}from"./useMutation-B-qc391N.js";import{t as o}from"./useQuery-BSTgq1rl.js";import{Ft as s,G as c,Jt as l,Lt as u,U as d,Zt as f,at as p,b as m,it as h,nt as g,tt as ee,ut as _}from"./active-backend-context-CrHTlgvN.js";import{D as v,W as y,k as b,t as x,w as S}from"./utils-CN5ZfZy1.js";import{a as C}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~nj1hli3r-DP9wmsjo.js";import{t as w}from"./proxy-9Fe1v5na.js";import{n as T}from"./navigation-context-CQZwH_tC.js";import{_t as te,ct as E,dt as D,ft as O,gt as k,ht as A,lt as j,mt as M,ot as ne,pt as N,st as P,ut as re,vt as F}from"./vendor-markdown-j0kYzV48.js";import{_ as I,c as L,h as R,o as ie,t as z}from"./conversation-store-Ca3ghXap.js";import{C as ae,D as oe,_ as se,a as ce,b as B,g as le,l as V,o as ue,s as de,t as H,u as fe,w as pe}from"./agent-server-conversation-service.api-tnqNjbpE.js";import{a as U,d as me,i as he,s as W,t as ge,y as _e}from"./conversation-state-store-B0ImPLHO.js";import{c as ve,i as ye,n as be,r as xe,s as Se}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as Ce}from"./use-user-conversation-B9Gebw_g.js";import{t as we}from"./copy-to-clipboard-button-Ca8iSkkA.js";import{t as Te}from"./scroll-fade-state-Dw-i4SGq.js";import"./syntax-highlighter-BGDg_7w9.js";var G=e(t(),1);function Ee(){let{conversationId:e}=T();return{conversationId:e}}function De(){let{conversationId:e}=Ee();if(!e)throw Error(`useConversationId must be used within a route that has a conversationId parameter`);return{conversationId:e}}var Oe=()=>{let{conversationId:e}=Ee(),t=!!e&&e.startsWith(`task-`),n=Ce(!e||t?null:e,e=>{let t=e.state.data;return t&&(!t.conversation_url||t.sandbox_status===`PAUSED`||!t.title&&S(t.execution_status))?3e3:3e4});return(0,G.useEffect)(()=>{let e=n.data;W.setCurrentConversation(e||null)},[e,n.isFetched,n?.data?.execution_status]),n};function ke(e){if(!e)return b.LOADING;switch(e){case v.IDLE:return b.AWAITING_USER_INPUT;case v.RUNNING:return b.RUNNING;case v.PAUSED:return b.PAUSED;case v.WAITING_FOR_CONFIRMATION:return b.AWAITING_USER_CONFIRMATION;case v.FINISHED:return b.FINISHED;case v.ERROR:return b.ERROR;case v.STUCK:return b.ERROR;default:return b.LOADING}}function Ae(){let e=ge(e=>e.execution_status),t=Oe().data?.execution_status??null,n=e??t;return{curAgentState:(0,G.useMemo)(()=>ke(n),[n]),executionStatus:n}}var je=`auth`,Me=`session_api_key`;function Ne(e,t){t&&e.send(JSON.stringify({type:je,[Me]:t}))}var Pe=1e4;function Fe(e){let t=setTimeout(()=>{e.readyState===WebSocket.CONNECTING&&e.close()},Pe);return()=>clearTimeout(t)}var Ie=1e3,Le=3e4,Re=(e,t)=>{let[n,r]=G.useState(!1),[i,a]=G.useState(null),[o,s]=G.useState(!1),c=G.useRef(null),l=G.useRef(0),u=G.useRef(null),d=G.useRef(!0),f=G.useRef(new WeakSet),p=G.useRef(t);G.useEffect(()=>{p.current=t},[t]);let m=G.useCallback(()=>{let t=e;if(p.current?.queryParams){let n=Object.entries(p.current.queryParams).reduce((e,[t,n])=>(e[t]=String(n),e),{});t=`${e}?${new URLSearchParams(n).toString()}`}let n=new WebSocket(t);c.current=n,f.current.add(n);let i=Fe(n);n.onopen=e=>{i(),Ne(n,p.current?.sessionApiKey),r(!0),a(null),s(!1),l.current=0,p.current?.onOpen?.(e)},n.onmessage=e=>{p.current?.onMessage?.(e)},n.onclose=e=>{i();let t=f.current.has(n);r(!1),e.code!==1e3&&(a(Error(`WebSocket closed with code ${e.code}: ${e.reason||`Connection closed unexpectedly`}`)),t&&p.current?.onError?.(e)),c.current!==null&&c.current!==n||p.current?.onClose?.(e);let o=p.current?.reconnect?.enabled??!1,h=p.current?.reconnect?.maxAttempts??1/0;if(o&&t&&d.current&&l.current<h){s(!0),l.current+=1;let e=Math.min(Ie*2**(l.current-1),Le),t=e+Math.random()*e*.3;u.current=setTimeout(()=>{m()},t)}else s(!1)},n.onerror=e=>{f.current.has(n)&&(r(!1),p.current?.onError?.(e))}},[e]);G.useEffect(()=>(d.current=!0,l.current=0,e&&e.trim()!==``&&m(),()=>{if(d.current=!1,u.current&&=(clearTimeout(u.current),null),c.current){let{readyState:e}=c.current;f.current.delete(c.current),(e===WebSocket.CONNECTING||e===WebSocket.OPEN)&&c.current.close(),c.current=null}}),[e,m]);let h=G.useCallback(e=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(e)},[]),g=G.useCallback(()=>{d.current=!1,s(!1),u.current&&=(clearTimeout(u.current),null),c.current&&(f.current.delete(c.current),c.current.close())},[]),ee=G.useCallback(()=>{if(d.current=!0,l.current=0,s(!0),a(null),u.current&&=(clearTimeout(u.current),null),c.current){let e=c.current;f.current.delete(e),c.current=null,(e.readyState===WebSocket.CONNECTING||e.readyState===WebSocket.OPEN)&&e.close()}m()},[m]);return{isConnected:n,error:i,socket:c.current,sendMessage:h,isReconnecting:o,attemptCount:l.current,disconnect:g,reconnect:ee}},ze=`Unable to connect to server`;function Be(e){return typeof e==`object`&&!!e&&`id`in e&&`timestamp`in e&&`source`in e&&typeof e.id==`string`&&e.id.length>0&&typeof e.timestamp==`string`&&e.timestamp.length>0&&typeof e.source==`string`&&(e.source===`agent`||e.source===`user`||e.source===`environment`||e.source===`hook`)}var K=e=>e.source===`environment`&&`action_id`in e&&`observation`in e&&e.observation!==null&&typeof e.observation==`object`&&`kind`in e.observation,Ve=e=>e.source===`agent`&&`tool_name`in e&&`tool_call_id`in e&&`error`in e&&typeof e.tool_name==`string`&&typeof e.tool_call_id==`string`&&typeof e.error==`string`,q=e=>`llm_message`in e&&typeof e.llm_message==`object`&&e.llm_message!==null&&`role`in e.llm_message&&`content`in e.llm_message,He=e=>q(e)&&e.llm_message.role===`user`,J=e=>e.source===`agent`&&`action`in e&&e.action!==null&&typeof e.action==`object`&&`kind`in e.action&&`tool_name`in e&&`tool_call_id`in e&&typeof e.tool_name==`string`&&typeof e.tool_call_id==`string`,Ue=e=>J(e)&&(e.action.kind===`ExecuteBashAction`||e.action.kind===`TerminalAction`),We=e=>K(e)&&(e.observation.kind===`ExecuteBashObservation`||e.observation.kind===`TerminalObservation`),Ge=e=>K(e)&&e.observation.kind===`PlanningFileEditorObservation`,Ke=e=>K(e)&&e.observation.kind===`BrowserObservation`,qe=e=>K(e)&&e.observation.kind===`SwitchLLMObservation`,Je=e=>J(e)&&e.action.kind===`BrowserNavigateAction`,Ye=e=>J(e)&&(e.tool_name===`canvas_ui`||e.tool_name===`canvas_ui_control`),Xe=e=>J(e)&&e.tool_name===`launch_child_conversation`,Ze=e=>e.source===`agent`&&`system_prompt`in e&&`tools`in e&&typeof e.system_prompt==`object`&&Array.isArray(e.tools),Qe=e=>`kind`in e&&e.kind===`ConversationStateUpdateEvent`,$e=e=>e.key===`full_state`,et=e=>e.key===`execution_status`,tt=e=>e.key===`stats`,nt=e=>e.key===`goal`,rt=e=>`kind`in e&&e.kind===`ConversationErrorEvent`,it=e=>`kind`in e&&e.kind===`ServerErrorEvent`,at=e=>rt(e)||it(e),ot=e=>`kind`in e&&e.kind===`HookExecutionEvent`,st=e=>`kind`in e&&e.kind===`ACPToolCallEvent`,Y=e=>`kind`in e&&e.kind===`StreamingDeltaEvent`,ct=e=>`kind`in e&&e.kind===`Condensation`;function lt(e){return Be(e)}var ut=e=>e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
+ `),dt=e=>e.reasoning_content?e.reasoning_content:e.thinking_blocks?.length?e.thinking_blocks.filter(e=>e.type===`thinking`).map(e=>e.thinking).join(`
3
+
4
+ `):``,ft=e=>ut(e).trim().length>0,pt=(e,t)=>{let n=e.replace(/^\s+/,``);if(!n.startsWith(`<think>`))return{reasoning:``,message:e};let r=n.slice(7),i=r.indexOf(`</think>`);return i===-1?t?.streaming?{reasoning:r.trim(),message:``}:{reasoning:``,message:e}:{reasoning:r.slice(0,i).trim(),message:r.slice(i+8).trim()}},mt=(e,t)=>{if(J(e))return e.action.kind===`ThinkAction`?null:ft(e)?e:null;if(K(e)){let n=t.find(t=>J(t)&&t.id===e.action_id);return!n||n.action.kind===`ThinkAction`?null:ft(n)?n:null}return null},ht=(e,t)=>({...t,content:`${t.content??``}${e.content??``}`||null,reasoning_content:`${t.reasoning_content??``}${e.reasoning_content??``}`||null}),X=(e,t)=>!!e.isFromPlanningAgent==!!t.isFromPlanningAgent,gt=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t];if(q(n)&&n.source===`user`)return t}return-1},_t=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),vt=(e,t)=>{let n=0,r=0;for(let i of t){let t=e.indexOf(i,n);if(t===-1)return{matched:!1,lastMatchEnd:r};r=t+i.length,n=r}return{matched:!0,lastMatchEnd:r}},yt=(e,t)=>{let n=gt(e);return e.map((e,t)=>({event:e,index:t})).filter(e=>e.index>n&&Y(e.event)&&(e.event.content?.length??0)>0&&X(t,e.event))},bt=(e,t)=>{let n=[];for(let r=e.length-1;r>=0;--r){let i=e[r];if(!Y(i))break;t(i)&&n.unshift({event:i,index:r})}return n},xt=(e,t)=>bt(e,e=>(e.content?.length??0)>0&&X(t,e)),St=(e,t)=>bt(e,e=>!!e.reasoning_content&&X(t,e)),Ct=(e,t,n)=>{let r=new Set(t.map(({index:e})=>e)),i=[];return e.forEach((e,t)=>{if(!r.has(t)||!Y(e)){i.push(e);return}!n&&e.reasoning_content&&i.push({...e,content:null})}),i},wt=(e,t)=>{let n=t.join(``),r=new Set([n,n.trimEnd(),n.trimStart(),n.trim()]);for(let t of r)if(t&&e.startsWith(t))return{matched:!0,lastMatchEnd:t.length};let i=t.length-1;return vt(e,t.map((e,t)=>t===i?e.trimEnd():e))},Tt=e=>e.some(e=>e.includes(`<function=`)),Et=e=>J(e)?dt(e).trim().length>0:q(e)&&e.source===`agent`?pt(_t(e.llm_message.content)).reasoning.length>0:!1,Dt=(e,t)=>{let n=yt(t,e);if(n.length===0)return null;let r=Ct(t,n,Et(e));return r.push(e),r},Ot=(e,t)=>{let n=_t(e.thought);if(!n)return null;let r=xt(t,e);if(r.length===0)return null;let i=r.map(({event:e})=>e.content??``);return!wt(n,i).matched&&!Tt(i)?null:Ct(t,r,dt(e).trim().length>0)},kt=(e,t)=>{if(dt(e).trim().length===0)return null;let n=St(t,e);if(n.length===0)return null;let r=new Set(n.map(({index:e})=>e)),i=[];return t.forEach((e,t)=>{if(!r.has(t)||!Y(e)){i.push(e);return}e.content&&i.push({...e,reasoning_content:null})}),i},At=(e,t)=>{let n=[...t];if(Y(e)){if(e.content===null&&e.reasoning_content===null)return n;let t=n.length-1,r=n[t];return r&&Y(r)&&X(e,r)?(n[t]=ht(e,r),n):(n.push(e),n)}if(J(e)&&e.action.kind===`FinishAction`||q(e)&&e.source===`agent`){let t=Dt(e,n);if(t)return t}if(J(e)&&e.action.kind!==`FinishAction`&&e.action.kind!==`ThinkAction`){let t=Ot(e,n)??kt(e,n);if(t)return t.push(e),t}if(st(e)){let t=n.findIndex(t=>st(t)&&t.tool_call_id===e.tool_call_id);return t===-1?n.push(e):n[t]=e,n}if(K(e)){if(e.observation.kind===`ThinkObservation`||e.observation.kind===`FinishObservation`)return n;let t=n.findIndex(t=>t.id===e.action_id);t===-1?n.push(e):n[t]=e}else n.push(e);return n},jt=e=>`id`in e?e.id:void 0,Mt=e=>`timestamp`in e?e.timestamp:void 0,Nt=(e,t)=>{let n=Mt(e),r=Mt(t);return!n&&!r?0:n?r?n.localeCompare(r):-1:1},Pt=(e,t)=>{if(e.length===0)return!1;let n=e[e.length-1],r=Mt(n),i=Mt(t);return!r||!i?!1:i<r},Ft=(e,t)=>{let n=jt(t),r=Y(t);if(!r&&n!==void 0&&e.eventIds.has(n))return e;let i=!r&&n!==void 0?new Set(e.eventIds).add(n):e.eventIds,a=e.events.length-1,o=e.events[a],s=o&&r&&Y(o)&&X(t,o),c=[...e.events];return s?c[a]=ht(t,o):c.push(t),{...e,events:c,eventIds:i,uiEvents:At(t,e.uiEvents)}},It=e=>({...e,events:[...e.events].sort(Nt),uiEvents:[...e.uiEvents].sort(Nt)}),Lt=(e,t)=>{let n=Ft(e,t);return n===e?e:!Pt(e.events,t)&&!Pt(e.uiEvents,t)?n:It(n)},Z=I()(e=>({events:[],eventIds:new Set,uiEvents:[],loadedConversationId:null,addEvent:t=>e(e=>Lt(e,t)),addEvents:t=>e(e=>{if(t.length===0)return e;let n=new Set(e.eventIds),r=[...e.events],i=[...e.uiEvents],a=!1;for(let e of t){let t=jt(e),o=Y(e);if(!(!o&&t!==void 0&&n.has(t))){a=!0,!o&&t!==void 0&&n.add(t);let s=r.length-1,c=r[s];c&&Y(e)&&Y(c)&&X(e,c)?r[s]=ht(e,c):r.push(e),i=At(e,i)}}return a?It({...e,events:r,eventIds:n,uiEvents:i}):e}),clearEvents:()=>e(()=>({events:[],eventIds:new Set,uiEvents:[],loadedConversationId:null})),clearEventsForConversation:t=>e(()=>({events:[],eventIds:new Set,uiEvents:[],loadedConversationId:t}))})),Rt={errorMessage:null,errorType:null,errorCode:null,errorClassification:null},zt=I(e=>({...Rt,setErrorMessage:(t,n=`conversation`,r=null,i=null)=>e(()=>({errorMessage:t,errorType:n,errorCode:r,errorClassification:i})),removeErrorMessage:()=>e(()=>({...Rt})),clearConnectionError:()=>e(e=>e.errorType===`connection`?{...Rt}:e)})),Bt=15e4,Vt={pendingMessages:[]},Ht=()=>`pending-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,Ut=I((e,t)=>({...Vt,enqueuePendingMessage:n=>{let r=Ht(),i={id:r,conversationId:n.conversationId,text:n.text,content:n.content??n.text,status:`sending`,imageUrls:n.imageUrls??[],fileUrls:n.fileUrls??[],timestamp:n.timestamp??new Date().toISOString()};return e(e=>({pendingMessages:[...e.pendingMessages,i]})),setTimeout(()=>{t().pendingMessages.find(e=>e.id===r)?.status===`sending`&&t().markPendingMessageError(r,`Send timed out`)},Bt),r},markPendingMessageError:(t,n)=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.id===t?{...e,status:`error`,errorMessage:n}:e)})),markPendingMessageSending:t=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.id===t?{...e,status:`sending`,errorMessage:void 0}:e)})),removePendingMessage:t=>e(e=>({pendingMessages:e.pendingMessages.filter(e=>e.id!==t)})),consumeMatchingPendingMessage:(t,n)=>{let r=null;return e(e=>{let i=e.pendingMessages.map((e,t)=>({m:e,i:t})).filter(({m:e})=>e.status===`sending`&&e.conversationId===t);if(i.length===0)return e;let a=i.find(({m:e})=>e.content===n)??i[0];return r=a.m,{pendingMessages:[...e.pendingMessages.slice(0,a.i),...e.pendingMessages.slice(a.i+1)]}}),r},clearPendingMessages:()=>e(()=>({...Vt})),reassignPendingMessages:(t,n)=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.conversationId===t?{...e,conversationId:n}:e)}))})),Wt=I(e=>({commands:[],appendInput:t=>e(e=>({commands:[...e.commands,{content:t,type:`input`}]})),appendOutput:t=>e(e=>({commands:[...e.commands,{content:t,type:`output`}]})),clearTerminal:()=>e({commands:[]})})),Gt={url:``,screenshotSrc:``},Kt=I(e=>({...Gt,setUrl:t=>e({url:t}),setScreenshotSrc:t=>e({screenshotSrc:t}),reset:()=>e(Gt)})),qt={statusByConversation:{}},Jt=I()(R(e=>({...qt,setStatus:(t,n)=>e(e=>({statusByConversation:{...e.statusByConversation,[t]:n}}))}),{name:`GoalStore`})),Yt=typeof requestAnimationFrame==`function`?{schedule:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}:{schedule:e=>setTimeout(e,16),cancel:e=>clearTimeout(e)};function Xt(e,t=Yt){let n=[],r=null,i=()=>{r!==null&&(t.cancel(r),r=null)},a=()=>{if(i(),n.length===0)return;let t=n;n=[],e(t.reduce((e,t)=>ht(t,e)))};return{enqueue:e=>{n.push(e),r===null&&(r=t.schedule(a))},flush:a,reset:()=>{i(),n=[]}}}function Zt(e,t,n){return n?e.includes(t)?e:[...e,t]:[t]}function Qt(e,t,n){if(n!==t)return n;let r=e.indexOf(t),i=e.filter(e=>e!==t);return i.length===0?null:i[Math.min(r,i.length-1)]??null}function $t(e,t){return t&&e.includes(t)?t:null}function en(e,t,n){e&&ie(e,{filesTabOpenPaths:t,filesTabSelectedPath:n})}var tn=I(e=>({selectedPath:null,selectedConversationId:null,openPaths:[],setSelectedPath:(t,n=null)=>e(e=>{if(t===null){let t={selectedPath:null,selectedConversationId:n,openPaths:n===e.selectedConversationId?e.openPaths:[]};return en(n,t.openPaths,t.selectedPath),t}let r=e.selectedConversationId===n,i={selectedPath:t,selectedConversationId:n,openPaths:Zt(e.openPaths,t,r)};return en(n,i.openPaths,i.selectedPath),i}),closeOpenPath:t=>e(e=>{if(!e.openPaths.includes(t))return e;let n=Qt(e.openPaths,t,e.selectedPath),r={openPaths:e.openPaths.filter(e=>e!==t),selectedPath:n};return en(e.selectedConversationId,r.openPaths,r.selectedPath),r}),hydrateForConversation:(t,n,r)=>e({selectedConversationId:t,openPaths:n,selectedPath:$t(n,r)})})),nn=new Set([`files`,`browser`,`terminal`,`planner`,`tasklist`]);function rn(e){let t=z.getState();t.setSelectedTab(e),t.isRightPanelShown||(t.setHasRightPanelToggled(!0),t.setIsRightPanelShown(!0))}function an(e){return nn.has(e)}function on(e,t){let n=W.getCurrentConversation();sn({kind:`CanvasUIAction`,command:`navigate_to_file`,path:e},t??n?.id??null)}function sn(e,t=null){switch(e.command){case`navigate_to_file`:case`show_preview`:{if(rn(`files`),!e.path)return;let n=W.getCurrentConversation()?.workspace?.working_dir,r=U(e.path,n);if(!r)return;tn.getState().setSelectedPath(r,t);return}case`open_tab`:e.tab===`vscode`?rn(`files`):e.tab&&an(e.tab)?rn(e.tab):e.tab&&console.warn(`[canvas_ui] Ignoring open_tab with unknown tab: ${e.tab}`);return}}var cn=3e3,ln=18e4,un=`openhands-child-conversation-launches:`,Q=(e,t)=>({status:`error`,error:e,guidance:t}),dn=e=>e.map(e=>`"${e}"`).join(` or `),fn=e=>e?.trim()||null;function pn(e){let t=e.target;if(!de.includes(t))return{ok:!1,failure:Q(`Unknown target ${JSON.stringify(e.target)}.`,`\`target\` must be exactly ${dn(de)}. Nothing was launched — call ${V} again with a valid target.`)};let n=fn(e.task);if(!n)return{ok:!1,failure:Q("`task` is empty.","`task` must be a self-contained brief: the child conversation cannot see this one, so state the goal, constraints and expected output.")};let r=fn(e.repository),i=fn(e.branch),a=fn(e.isolation);return t===`local`&&(r||i)?{ok:!1,failure:Q('`repository`/`branch` were passed with target="local".','A local child always runs in this conversation\'s workspace. Drop `repository` and `branch`, or use target="cloud" to run against a repository in a Cloud sandbox.')}:t===`cloud`&&a?{ok:!1,failure:Q('`isolation` was passed with target="cloud".','Cloud children always run in their own isolated sandbox. Drop `isolation`, or use target="local" to choose between "worktree" and "shared".')}:i&&!r?{ok:!1,failure:Q("`branch` was passed without `repository`.",'Pass `repository` as "owner/repo" alongside `branch`, or drop `branch` to use the repository\'s default branch.')}:a&&!ce.includes(a)?{ok:!1,failure:Q(`Unknown isolation ${JSON.stringify(e.isolation)}.`,`\`isolation\` must be exactly ${dn(ce)}. Nothing was launched — call ${V} again with a valid isolation.`)}:{ok:!0,params:{target:t,task:n,title:fn(e.title),repository:r,branch:i,isolation:a??`worktree`}}}function mn(e,t){let n=`${un}${e}`,r=[];try{let e=window.localStorage.getItem(n),t=e?JSON.parse(e):null;Array.isArray(t)&&(r=t.filter(e=>typeof e==`string`))}catch{}if(r.includes(t))return!1;try{window.localStorage.setItem(n,JSON.stringify([...r,t]))}catch{}return!0}function hn(e){let t=f(e);return typeof window>`u`?t:new URL(t,window.location.origin).toString()}function gn(){let e=c();if(!e)return null;let t=d(e,fe);return t===null||t>=0?null:`Agent server ${e} does not persist parent/child conversation links (needs ${fe}); the child was created but is not linked to this conversation.`}var _n=e=>!!(e?.selected_repository||e?.selected_workspace),vn=`The child was launched in this conversation's directory instead, so it can see work in progress here and the two agents may conflict over the same files.`;async function yn(e,t){let n=await H.resolveConversationWorkingDir(t),r=ae(t),i=i=>H.createConversation({initialUserMsg:e.task,metadata:r?{selected_repository:r.selected_repository,selected_branch:r.selected_branch,git_provider:r.git_provider}:null,workingDirOverride:n,workspaceMode:i===`shared`?`local_repo`:`new_worktree`,parentConversationId:t}),a=e.isolation,o=null;a===`worktree`&&!_n(r)&&(a=`shared`,o=`This conversation's workspace is a scratch directory with no commits, which git cannot cut a worktree from. ${vn}`);let s;try{s=await i(a)}catch(e){if(a!==`worktree`)throw e;try{s=await i(`shared`)}catch{throw e}a=`shared`,o=`Creating a git worktree in this conversation's workspace failed (${e instanceof Error?e.message:String(e)}). ${vn}`}let c=s.app_conversation_id??s.id;e.title&&await H.updateConversationTitle(c,e.title).catch(()=>void 0);let l=gn();return{status:`launched`,target:`local`,conversation_id:c,url:hn(`/conversations/${c}`),initial_status:s.status,title:e.title,workspace:n,isolation:a,...o?{isolation_note:o}:{},parent_link:!l,...l?{parent_link_note:l}:{}}}var bn=e=>new Promise(t=>{setTimeout(t,e)});async function xn(e,t){let n=Date.now()+ln,r=e;for(;!r.app_conversation_id&&r.status!==`ERROR`&&!(Date.now()>=n);){await bn(cn);let e=await se(r.id,t).catch(()=>null);if(!e)break;r=e}return r}async function Sn(e,t){let n=B();if(!n)return Q(`No OpenHands Cloud backend is connected in Agent Canvas.`,`Ask the user to connect OpenHands Cloud from the backend picker, then call this tool again — or relaunch now with target="local".`);let r=ae(t),i=await xn(await le({initial_message:{role:`user`,content:[{type:`text`,text:e.task}]},title:e.title,selected_repository:e.repository??r?.selected_repository??null,selected_branch:e.branch??null,git_provider:e.repository?null:r?.git_provider??null,parent_conversation_id:null},n),n);if(i.status===`ERROR`)return Q(i.detail||`The Cloud conversation failed to start.`,`The Cloud sandbox could not be provisioned. Report this to the user; you can retry, or fall back to target="local".`);let a=i.app_conversation_id;return{status:`launched`,target:`cloud`,conversation_id:a,url:a?`${n.host.replace(/\/$/,``)}/conversations/${a}`:null,initial_status:i.status,title:e.title,start_task_id:i.id,backend:n.name,parent_link:!1,parent_link_note:`This conversation runs on the local agent server, so OpenHands Cloud has no parent to link the child to.`}}async function Cn(e,t){t.status===`error`?s(l.t(y.CHILD_CONVERSATION$LAUNCH_FAILED,{error:t.error})):t.url&&u(l.t(t.target===`cloud`?y.CHILD_CONVERSATION$LAUNCHED_CLOUD:y.CHILD_CONVERSATION$LAUNCHED_LOCAL),l.t(y.CHILD_CONVERSATION$OPEN),t.url),!Jt.getState().statusByConversation[e]?.active&&await H.sendMessage(e,{role:`user`,content:[{type:`text`,text:`${ue}${JSON.stringify(t)}`}]})}async function wn(e,t,n){if(!mn(t,n))return;let r=pn(e),i;if(!r.ok)i=r.failure;else try{i=r.params.target===`cloud`?await Sn(r.params,t):await yn(r.params,t)}catch(e){i=Q(e instanceof Error?e.message:String(e),`The launch request failed. Report the error to the user; retry only if the cause looks transient.`)}await Cn(t,i).catch(e=>{console.warn(`[${V}] Failed to report the launch result:`,e)})}var Tn=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:[...e.entriesByConversation[t]??[],n]}}),En=I()(R(e=>({entriesByConversation:{},activeProfileByConversation:{},show:(t,n,r)=>e(e=>Tn(e,t,{id:oe(),anchorEventId:n,profiles:r})),recordSwitch:(t,n,r)=>e(e=>({...Tn(e,t,{id:oe(),anchorEventId:n,profiles:[],switchedTo:r}),activeProfileByConversation:{...e.activeProfileByConversation,[t]:r}})),seedSwitches:(t,n)=>e(e=>{let r=e.entriesByConversation[t]??[],i=new Set(r.map(e=>e.id)),a=n.filter(e=>!i.has(e.id)).map(e=>({id:e.id,anchorEventId:e.anchorEventId,profiles:[],switchedTo:e.profileName}));return a.length===0?e:{entriesByConversation:{...e.entriesByConversation,[t]:[...r,...a]}}}),clearActiveProfile:t=>e(e=>{if(!(t in e.activeProfileByConversation))return e;let n={...e.activeProfileByConversation};return delete n[t],{activeProfileByConversation:n}}),clear:t=>e(e=>{let n={...e.entriesByConversation};delete n[t];let r={...e.activeProfileByConversation};return delete r[t],{entriesByConversation:n,activeProfileByConversation:r}}),clearAll:()=>e({entriesByConversation:{},activeProfileByConversation:{}})}),{name:`ModelStore`})),Dn=(e,t,n)=>{let{action:r}=e;if((r.kind===`StrReplaceEditorAction`||r.kind===`FileEditorAction`||r.kind===`ExecuteBashAction`)&&n.invalidateQueries({queryKey:[`file_changes`,t]},{cancelRefetch:!1}),(r.kind===`StrReplaceEditorAction`||r.kind===`FileEditorAction`)&&r.path){let e=he(r.path);n.invalidateQueries({queryKey:[`file_diff`,t,e]})}e.tool_name===`SwitchLLMTool`&&(n.invalidateQueries({queryKey:[`user`,`conversation`,t]}),En.getState().clearActiveProfile(t))},On=class{static async respondToConfirmation(e,t,n,r){let a=_().backend;return a.kind===`cloud`?w({backend:a,method:`POST`,hostOverride:h(t),path:`/api/conversations/${e}/events/respond_to_confirmation`,body:n,authMode:`session-api-key`,sessionApiKey:r}):new i(ee({conversationUrl:t,sessionApiKey:r})).respondToConfirmation(e,n)}static async getEventCount(e,t,n){let r=_().backend;return r.kind===`cloud`?w({backend:r,method:`GET`,hostOverride:h(t),path:`/api/conversations/${e}/events/count`,authMode:`session-api-key`,sessionApiKey:n}):new i(ee({conversationUrl:t,sessionApiKey:n})).getEventCount(e)}static async searchEvents(e,t,n,r={}){let i=_().backend,a=r.limit??100;if(i.kind===`cloud`){let t=Math.min(a,100),n=!!(r.sortOrder||r.pageId||r.timestampGte||r.timestampLt),o=new URLSearchParams;o.set(`limit`,String(t)),r.sortOrder&&o.set(`sort_order`,r.sortOrder),r.pageId&&o.set(`page_id`,r.pageId),r.timestampGte&&o.set(`timestamp__gte`,r.timestampGte),r.timestampLt&&o.set(`timestamp__lt`,r.timestampLt);let s=t=>w({backend:i,method:`GET`,path:`/api/v1/conversation/${e}/events/search?${t.toString()}`});try{let e=await s(o);return{items:e?.items??[],next_page_id:e?.next_page_id??null}}catch(e){if(!n||r.strictPagination)throw e;return console.warn(`[EventService] Cloud backend doesn't support pagination filters. Falling back to initial load only. Server needs OpenHands/OpenHands#14399.`),{items:[],next_page_id:null}}}let o=await new C(g({conversationUrl:t,sessionApiKey:n}),e).search({limit:a,...r.pageId?{page_id:r.pageId}:{},...r.sortOrder?{sort_order:r.sortOrder}:{},...r.timestampGte?{timestamp__gte:r.timestampGte}:{},...r.timestampLt?{timestamp__lt:r.timestampLt}:{}});return{items:o?.items??[],next_page_id:o?.next_page_id??null}}},kn=new Set([`error_source`,`error_kind`,`error_id`,`error_telemetry`]);function An({source:e,metadata:t={},classification:n}){let r=Object.fromEntries(Object.entries(t).filter(([e])=>!kn.has(e))),i=n?.kind||`unknown`,a=typeof t.eventId==`string`?t.eventId:void 0;a!=null&&delete r.eventId;let o=n?.error_id??a;m(`error_outcome`,{...r,current_url:window.location.href,error_source:e||`unknown`,error_kind:i,...o==null?{}:{error_id:o},error_telemetry:i===`internal`||i===`unknown`?`diagnostic`:`outcome`})}var jn=()=>a({mutationKey:[`read-conversation-file`],mutationFn:async({conversationId:e,filePath:t})=>H.readConversationFile(e,t)}),Mn={cost:null,max_budget_per_task:null,usage:null},Nn=I(e=>({...Mn,setMetrics:t=>e(t),resetMetrics:()=>e(Mn)})),Pn=e=>{let{data:t}=Ce(e??null);return o({queryKey:[`conversation-history`,e,t?.conversation_url??null,t?.session_api_key??null],enabled:!!e&&!!t,queryFn:async()=>{if(!e)return{events:[],hasMore:!1,nextPageId:null};let n=await On.searchEvents(e,t?.conversation_url??null,t?.session_api_key??null,{limit:50,sortOrder:`TIMESTAMP_DESC`});if(!Array.isArray(n.items))throw Error(`Invalid conversation history response: expected page.items to be an array.`);return{events:[...n.items].reverse(),hasMore:!!n.next_page_id||n.items.length>=50,nextPageId:n.next_page_id??null}},staleTime:0,gcTime:1800*1e3,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:1})},Fn=[`The goal is NOT yet complete (audit iteration`,`Resuming a goal that was paused or interrupted.`],In=e=>{if(e.llm_message?.role!==`user`)return null;let t=e.llm_message.content;return Array.isArray(t)?t.filter(e=>e.type===`text`).map(e=>e.text).join(`
5
+ `):``},Ln=e=>{let t=In(e);return t===null?!1:Fn.some(e=>t.startsWith(e))},Rn=e=>In(e)?.startsWith(`[child-conversation] `)??!1,zn=e=>{if(Qe(e))return nt(e)&&!e.value.active;if(J(e)){let t=e.action.kind;return!(!t||t===`ExecuteBashAction`&&e.source===`user`||t===`PlanningFileEditorAction`||t===`SwitchLLMAction`)}return K(e)?!(e.observation.kind===`SwitchLLMObservation`&&!e.observation.is_error):q(e)?!Ln(e)&&!Rn(e):Ve(e)||ot(e)||st(e)?!0:Y(e)?e.content!==null||e.reasoning_content!==null:!1},Bn=e=>e.some(e=>e.source===`user`),Vn=()=>{let{uiEvents:e}=Z.getState();for(let t=e.length-1;t>=0;--t){let n=e[t];if(zn(n))return String(n.id)}return null};function Hn(e,t,n=Vn()){En.getState().recordSwitch(e,n,t)}function Un(e,t){let n=[],r=null;for(let e of t)qe(e)&&!e.observation.is_error&&n.push({id:`history-switch:${e.id}`,anchorEventId:r,profileName:e.observation.profile_name}),zn(e)&&(r=String(e.id));n.length>0&&En.getState().seedSwitches(e,n)}var $=n(),Wn=(0,G.createContext)(void 0);function Gn(e){return e.llm_message.content.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Kn({children:e,conversationId:t,conversationUrl:n,sessionApiKey:a,subConversations:o,subConversationIds:s}){let[c,l]=(0,G.useState)(`CONNECTING`),[u,d]=(0,G.useState)(`CONNECTING`),f=G.useRef(!1),m=G.useRef(!1),h=r(),g=Z(e=>e.addEvent),_=Z(e=>e.addEvents),v=Z(e=>e.clearEventsForConversation),{setErrorMessage:y,removeErrorMessage:b,clearConnectionError:x}=zt(),S=Ut(e=>e.consumeMatchingPendingMessage),{setExecutionStatus:C}=ge(),{appendInput:w,appendOutput:T}=Wt(),te=Kt(e=>e.reset),E=(0,G.useRef)(null);E.current===null&&(E.current=Xt(e=>{Z.getState().addEvent(e),zt.getState().clearConnectionError()}));let D=(0,G.useRef)(null);D.current===null&&(D.current=Xt(e=>{Z.getState().addEvent({...e,isFromPlanningAgent:!0}),zt.getState().clearConnectionError()}));let[O,k]=(0,G.useState)(!0),[A,j]=(0,G.useState)(null),{setPlanContent:M}=z(),{mutate:ne}=jn(),N=(0,G.useRef)(0),P=(0,G.useRef)(null),re=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1,F=(0,G.useCallback)(()=>{x()},[x]),I=(0,G.useCallback)(e=>{let t=e.value.usage_to_metrics;if(!t)return;let n=Object.values(t).reduce((e,t)=>{e.cost+=t.accumulated_cost,e.maxBudgetPerTask===null&&t.max_budget_per_task!==null&&(e.maxBudgetPerTask=t.max_budget_per_task);let n=t.accumulated_token_usage;return n&&(e.usage={prompt_tokens:(e.usage?.prompt_tokens??0)+n.prompt_tokens,completion_tokens:(e.usage?.completion_tokens??0)+n.completion_tokens,cache_read_tokens:(e.usage?.cache_read_tokens??0)+n.cache_read_tokens,cache_write_tokens:(e.usage?.cache_write_tokens??0)+n.cache_write_tokens,context_window:Math.max(e.usage?.context_window??0,n.context_window),per_turn_token:Math.max(e.usage?.per_turn_token??0,n.per_turn_token)}),e},{cost:0,maxBudgetPerTask:null,usage:null});Nn.getState().setMetrics({cost:n.cost,max_budget_per_task:n.maxBudgetPerTask,usage:n.usage})},[]),{data:L,isPending:R}=Pn(t),oe=!!t&&R;(0,G.useLayoutEffect)(()=>{let e=t??null;Z.getState().loadedConversationId!==e&&(v(e),te(),Nn.getState().resetMetrics())},[t,v,te]),(0,G.useLayoutEffect)(()=>{if(!(!L||L.events.length===0)&&(_(L.events),t)){Un(t,Z.getState().uiEvents);for(let e of L.events)He(e)&&S(t,Gn(e))}},[L,_,t,S]);let se=(0,G.useMemo)(()=>{let e=L?.events??[],t=e[e.length-1];return!t||!(`timestamp`in t)||!t.timestamp?null:t.timestamp},[L]),ce=(0,G.useMemo)(()=>!t||!n||R?null:p(t,n),[t,n,R]),B=(0,G.useMemo)(()=>{if(!o?.length)return null;let e=o[0];return!e?.id||!e.conversation_url?null:p(e.id,e.conversation_url)},[o]),le=(0,G.useMemo)(()=>B?c===`CONNECTING`||u===`CONNECTING`?`CONNECTING`:c===`OPEN`&&u===`OPEN`?`OPEN`:c===`CLOSED`&&u===`CLOSED`?`CLOSED`:c===`CLOSING`||u===`CLOSING`?`CLOSING`:`CLOSED`:c,[c,u,B]);(0,G.useEffect)(()=>{A!==null&&N.current>=A&&O&&k(!1)},[A,O,N]),(0,G.useEffect)(()=>{if(!O&&P.current){let{path:e,conversationId:t}=P.current;ne({conversationId:t,filePath:e},{onSuccess:e=>{M(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}),P.current=null}},[O,ne,M]),(0,G.useEffect)(()=>{f.current=!1,k(!!s?.length),j(null),N.current=0,P.current=null},[s]),(0,G.useEffect)(()=>{f.current=!1,m.current=!1,P.current=null},[t]),(0,G.useEffect)(()=>{let e=E.current,t=D.current;return()=>{e?.reset(),t?.reset()}},[t]);let V=(0,G.useMemo)(()=>oe||O,[oe,O]),ue=(0,G.useCallback)(e=>{try{let n=JSON.parse(e.data);if(lt(n)){if(Y(n)){E.current?.enqueue(n);return}E.current?.flush();let e=Z.getState().eventIds.has(n.id??``),r=qe(n)?n:null;if(g(n),e)return;if(at(n)){let e=n,t=`classification`in e?e.classification:null;An({source:`conversation`,metadata:{eventId:e.id,errorCode:e.code},classification:t}),y(e.detail,`conversation`,e.code,t)}else F();if(Ve(n)&&An({source:`agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},classification:n.classification}),He(n)&&t&&(S(t,Gn(n)),ie(t,{draftMessage:null})),J(n)&&Dn(n,t||`test-conversation-id`,h),Qe(n)&&($e(n)&&C(n.value.execution_status),et(n)&&C(n.value),tt(n)&&I(n),nt(n)&&t&&Jt.getState().setStatus(t,n.value)),Ue(n)&&w(n.action.command),We(n)&&T(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
6
+ `)),Ke(n)){let{screenshot_data:e}=n.observation;if(e){let t=e.startsWith(`data:`)?e:`data:image/png;base64,${e}`;Kt.getState().setScreenshotSrc(t)}}if(Je(n)&&Kt.getState().setUrl(n.action.url),t&&r&&!r.observation.is_error){Hn(t,r.observation.profile_name);let e=ae(t);pe(t,{selected_repository:e?.selected_repository??null,selected_branch:e?.selected_branch??null,git_provider:e?.git_provider??null,selected_workspace:e?.selected_workspace??null,active_profile:r.observation.profile_name,plugins:e?.plugins??null}),r.observation.active_model&&_e(h,t,r.observation.active_model),me(h,t)}Ye(n)&&sn(n.action,t??null),t&&Xe(n)&&wn(n.action,t,n.tool_call_id)}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[g,y,S,h,t,C,w,T,I,F]),de=(0,G.useCallback)(e=>{try{let n=JSON.parse(e.data);if(O&&(N.current+=1,A!==null&&N.current>=A&&k(!1)),lt(n)){if(Y(n)){D.current?.enqueue(n);return}D.current?.flush();let e=Z.getState().eventIds.has(n.id??``);if(g({...n,isFromPlanningAgent:!0}),e)return;if(at(n)){let e=n,t=`classification`in e?e.classification:null;An({source:`planning_conversation`,metadata:{eventId:e.id,errorCode:e.code},classification:t}),y(e.detail,`conversation`,e.code,t)}else F();if(Ve(n)&&An({source:`planning_agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},classification:n.classification}),He(n)&&t&&(S(t,Gn(n)),ie(t,{draftMessage:null})),J(n)&&Dn(n,o?.[0]?.id||`test-conversation-id`,h),Qe(n)&&($e(n)&&C(n.value.execution_status),et(n)&&C(n.value),tt(n)&&I(n),nt(n)&&t&&Jt.getState().setStatus(t,n.value)),Ue(n)&&w(n.action.command),We(n)&&T(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
7
+ `)),Ge(n)){let{path:e}=n.observation;if(re(e)){let t=o?.[0]?.id;t&&e&&(O?P.current={path:e,conversationId:t}:ne({conversationId:t,filePath:e},{onSuccess:e=>{M(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}))}}}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[g,O,A,y,S,h,o,t,C,w,T,ne,M,I,F]),H=(0,G.useMemo)(()=>({queryParams:se?{resend_mode:`since`,after_timestamp:se}:{resend_mode:`all`},sessionApiKey:a,reconnect:{enabled:!0},onOpen:()=>{l(`OPEN`),f.current=!0,x()},onClose:()=>{l(`CLOSED`)},onError:()=>{l(`CLOSED`),f.current&&y(ze,`connection`)},onMessage:ue}),[ue,y,x,a,se]),fe=(0,G.useMemo)(()=>{let e={resend_all:!0},t=o?.[0];return{queryParams:e,sessionApiKey:t?.session_api_key??a,reconnect:{enabled:!0},onOpen:async()=>{if(d(`OPEN`),m.current=!0,x(),t?.id&&t.conversation_url)try{let e=await On.getEventCount(t.id,t.conversation_url,t.session_api_key);j(e),e===0&&k(!1)}catch{k(!1)}},onClose:()=>{d(`CLOSED`)},onError:()=>{d(`CLOSED`),m.current&&y(ze,`connection`)},onMessage:de}},[de,y,x,a,o]),{socket:U,reconnect:he}=Re(ce||``,H),{socket:W,reconnect:ve}=Re(B||``,fe),ye=(0,G.useCallback)(()=>{if(b(),z.getState().conversationMode===`plan`&&B){ve();return}he()},[B,he,ve,b]),be=(0,G.useCallback)(async e=>{let n=z.getState().conversationMode===`plan`?W:U;if(n?.readyState!==WebSocket.OPEN){if(!t){let e=Error(`No conversation ID available`);throw y(e.message),e}try{return await new i(ee()).sendEvent(t,{role:`user`,content:e.content},{run:!0}),{queued:!0}}catch(e){throw y(e instanceof Error?e.message:`Failed to queue message for delivery`),e}}try{return n.send(JSON.stringify({...e,run:!0})),{queued:!1}}catch(e){throw y(e instanceof Error?e.message:`Failed to send message`),e}},[U,W,y,t]);(0,G.useEffect)(()=>{U&&ce&&(()=>{switch(U.readyState){case WebSocket.CONNECTING:l(`CONNECTING`);break;case WebSocket.OPEN:l(`OPEN`);break;case WebSocket.CLOSING:l(`CLOSING`);break;case WebSocket.CLOSED:l(`CLOSED`);break;default:l(`CLOSED`);break}})()},[U,ce]),(0,G.useEffect)(()=>{W&&B&&(()=>{switch(W.readyState){case WebSocket.CONNECTING:d(`CONNECTING`);break;case WebSocket.OPEN:d(`OPEN`);break;case WebSocket.CLOSING:d(`CLOSING`);break;case WebSocket.CLOSED:d(`CLOSED`);break;default:d(`CLOSED`);break}})()},[W,B]);let xe=(0,G.useMemo)(()=>({connectionState:le,sendMessage:be,isLoadingHistory:V,reconnect:ye}),[le,be,V,ye]);return(0,$.jsx)(Wn.Provider,{value:xe,children:e})}var qn=()=>(0,G.useContext)(Wn)||null,Jn=e=>(0,$.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:109,height:109,viewBox:`0 0 109 109`,fill:`none`,...e,children:[(0,$.jsx)(`path`,{d:`M40.1979 21.8969L34.7311 17.832L25.2691 30.5574L20.2094 26.784L16.1367 32.2451L26.6653 40.0969L40.1979 21.8969Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M90.8342 35.1983H50.4639V28.3858H90.8342V35.1983Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M90.8342 57.9067H50.4638V51.0942H90.8342V57.9067Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M27.2508 63.5837C32.2674 63.5837 36.3342 59.517 36.3342 54.5004C36.3342 49.4838 32.2674 45.4171 27.2508 45.4171C22.2342 45.4171 18.1675 49.4838 18.1675 54.5004C18.1675 59.517 22.2342 63.5837 27.2508 63.5837ZM27.2508 59.0421C29.7591 59.0421 31.7925 57.0087 31.7925 54.5004C31.7925 51.9921 29.7591 49.9587 27.2508 49.9587C24.7425 49.9587 22.7092 51.9921 22.7092 54.5004C22.7092 57.0087 24.7425 59.0421 27.2508 59.0421Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M36.3342 77.2087C36.3342 82.2253 32.2674 86.2921 27.2508 86.2921C22.2342 86.2921 18.1675 82.2253 18.1675 77.2087C18.1675 72.1922 22.2342 68.1254 27.2508 68.1254C32.2674 68.1254 36.3342 72.1922 36.3342 77.2087ZM31.7925 77.2087C31.7925 79.717 29.7591 81.7504 27.2508 81.7504C24.7425 81.7504 22.7092 79.717 22.7092 77.2087C22.7092 74.7005 24.7425 72.6671 27.2508 72.6671C29.7591 72.6671 31.7925 74.7005 31.7925 77.2087Z`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M50.4637 80.615H90.834V73.8025H50.4637V80.615Z`,fill:`currentColor`})]});function Yn(){let{conversationId:e}=Ee(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setIsOverviewPanelShown:i,setIsRightPanelShown:a,setSelectedTab:o,setCommitsAutoExpandSection:s}=z(),{setSelectedTab:c,setRightPanelShown:l}=L(e??``),u=e=>{r(e),a(e),l?.(e)},d=e=>{o(e),c(e)},f=e=>{t===e&&n?u(!1):(d(e),n||u(!0),i(!1))},p=e=>{d(e),u(!0),i(!1)};return{selectTab:f,navigateToTab:p,navigateToChanges:()=>{s(`uncommitted`),p(`commits`)},navigateToCommits:()=>{s(null),p(`commits`)},isTabActive:e=>n&&t===e,onTabChange:d,selectedTab:t,isRightPanelShown:n}}var Xn={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Zn=[],Qn={allowDangerousHtml:!0},$n=/^(https?|ircs?|mailto|xmpp)$/i,er=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function tr(e){let t=nr(e),n=rr(e);return ir(t.runSync(t.parse(n),n),e)}function nr(e){let t=e.rehypePlugins||Zn,n=e.remarkPlugins||Zn,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qn}:Qn;return N().use(te).use(n).use(A,r).use(t)}function rr(e){let t=e.children||``,n=new M;return typeof t==`string`?n.value=t:``+t,n}function ir(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||ar;for(let e of er)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return k(e,l),F(e,{Fragment:$.Fragment,components:i,ignoreInvalidStyle:!0,jsx:$.jsx,jsxs:$.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Xn)if(Object.hasOwn(Xn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Xn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function ar(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||$n.test(e.slice(0,t))?e:``}function or({text:e,children:t}){let[n,r]=G.useState(!1),[i,a]=G.useState(!1);return G.useEffect(()=>{let e;return i&&(e=setTimeout(()=>a(!1),2e3)),()=>clearTimeout(e)},[i]),(0,$.jsxs)(`div`,{className:`relative`,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[(0,$.jsx)(`div`,{className:`absolute top-2 right-2 z-10`,children:(0,$.jsx)(we,{isHidden:!n,isDisabled:i,onClick:async()=>{await navigator.clipboard.writeText(e),a(!0)},mode:i?`copied`:`copy`})}),t]})}function sr({children:e,className:t}){let n=/language-(\w+)/.exec(t||``),r=String(e).replace(/\n$/,``);return n?(0,$.jsx)(or,{text:r,children:(0,$.jsx)(ne,{className:`rounded-lg`,style:P,language:n?.[1],PreTag:`div`,children:r})}):String(e).includes(`
8
+ `)?(0,$.jsx)(or,{text:r,children:(0,$.jsx)(`pre`,{className:`bg-surface-raised text-foreground border border-surface-raised rounded p-[1em] overflow-auto`,children:(0,$.jsx)(`code`,{className:t,children:r})})}):(0,$.jsx)(`code`,{className:x(t,`bg-surface-raised text-foreground border border-surface-raised rounded px-[0.4em] py-[0.2em]`),children:e})}function cr({children:e}){return(0,$.jsx)(`ul`,{className:`my-2 list-disc ml-5 pl-2 whitespace-normal leading-6`,children:e})}function lr({children:e,start:t}){return(0,$.jsx)(`ol`,{className:`my-2 list-decimal ml-5 pl-2 whitespace-normal leading-6`,start:t,children:e})}function ur({children:e}){return(0,$.jsx)(`li`,{className:`py-0.5`,children:e})}function dr({children:e}){return(0,$.jsx)(`p`,{className:`py-1.5 leading-6 first:pt-0 last:pb-0`,children:e})}function fr({href:e,children:t}){return(0,$.jsx)(`a`,{className:`text-blue-500 hover:underline`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})}function pr({children:e}){return(0,$.jsx)(`h1`,{className:`text-xl text-white font-medium leading-7 mb-3 mt-4 first:mt-0`,children:e})}function mr({children:e}){return(0,$.jsx)(`h2`,{className:`text-lg font-medium leading-6 -tracking-[0.01em] text-white mb-2.5 mt-4 first:mt-0`,children:e})}function hr({children:e}){return(0,$.jsx)(`h3`,{className:`text-base font-medium text-white mb-2 mt-3 first:mt-0`,children:e})}function gr({children:e}){return(0,$.jsx)(`h4`,{className:`text-sm font-medium text-white mb-1.5 mt-3 first:mt-0`,children:e})}function _r({children:e}){return(0,$.jsx)(`h5`,{className:`text-sm font-normal text-[var(--oh-text-tertiary)] mb-1.5 mt-2.5 first:mt-0`,children:e})}function vr({children:e}){return(0,$.jsx)(`h6`,{className:`text-sm font-normal text-[var(--oh-text-tertiary)] mb-1.5 mt-2.5 first:mt-0`,children:e})}var yr=`w-10`;function br({children:e}){let t=G.useRef(null),[n,r]=G.useState({left:!1,right:!1}),i=G.useCallback(()=>{let e=t.current;e&&r(Te(e))},[]);return G.useLayoutEffect(()=>{i();let e=t.current;if(!e)return;let n=new ResizeObserver(i);n.observe(e);let r=e.firstElementChild;return r&&n.observe(r),()=>n.disconnect()},[i,e]),(0,$.jsxs)(`div`,{className:`relative max-w-full`,children:[(0,$.jsx)(`div`,{ref:t,"data-testid":`markdown-table-scroll`,onScroll:i,className:`max-w-full overflow-x-auto custom-scrollbar-always`,children:e}),(0,$.jsx)(`div`,{"aria-hidden":!0,"data-testid":`markdown-table-scroll-fade-left`,"data-visible":n.left?`true`:`false`,className:x(`pointer-events-none absolute inset-y-0 left-0 z-10`,yr,`bg-gradient-to-r from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,n.left?`opacity-100`:`opacity-0`)}),(0,$.jsx)(`div`,{"aria-hidden":!0,"data-testid":`markdown-table-scroll-fade-right`,"data-visible":n.right?`true`:`false`,className:x(`pointer-events-none absolute inset-y-0 right-0 z-10`,yr,`bg-gradient-to-l from-[var(--oh-scroll-fade-from,var(--oh-color-base))] to-transparent`,`transition-opacity duration-300 ease-out motion-reduce:transition-none`,n.right?`opacity-100`:`opacity-0`)})]})}function xr({children:e}){return(0,$.jsx)(br,{children:(0,$.jsx)(`table`,{className:[`my-4 w-max min-w-full border-separate border-spacing-0 overflow-hidden rounded-xl border border-[var(--oh-border)] text-sm`,`[&_td]:border-b [&_td]:border-r [&_th]:border-b [&_th]:border-r`,`[&_td:last-child]:border-r-0 [&_th:last-child]:border-r-0`,`[&_tbody_tr:last-child_td]:border-b-0`].join(` `),children:e})})}function Sr({children:e}){return(0,$.jsx)(`th`,{className:`whitespace-nowrap border-[var(--oh-border)] bg-[var(--oh-surface)] px-3 py-2 text-left font-semibold text-white`,children:e})}function Cr({children:e}){return(0,$.jsx)(`td`,{className:`whitespace-nowrap border-[var(--oh-border)] px-3 py-2 align-top`,children:e})}var wr={note:{label:`Note`,icon:xe,containerClass:`border-l-blue-500 bg-blue-500/10`,titleClass:`text-blue-300`,iconClass:`text-blue-400`},tip:{label:`Tip`,icon:Se,containerClass:`border-l-emerald-500 bg-emerald-500/10`,titleClass:`text-emerald-300`,iconClass:`text-emerald-400`},important:{label:`Important`,icon:be,containerClass:`border-l-purple-500 bg-purple-500/10`,titleClass:`text-purple-300`,iconClass:`text-purple-400`},warning:{label:`Warning`,icon:ve,containerClass:`border-l-yellow-500 bg-yellow-500/10`,titleClass:`text-yellow-300`,iconClass:`text-yellow-400`},caution:{label:`Caution`,icon:ye,containerClass:`border-l-rose-500 bg-rose-500/10`,titleClass:`text-rose-300`,iconClass:`text-rose-400`}},Tr=/(?:^|\s)markdown-alert-(note|tip|important|warning|caution)(?:\s|$)/i;function Er(e){if(!e)return null;let t=e.match(Tr);return t?t[1].toLowerCase():null}function Dr({children:e,className:t}){let n=Er(t);if(n){let t=wr[n],r=t.icon;return(0,$.jsxs)(`div`,{"data-testid":`markdown-alert-${n}`,className:x(`my-3 rounded-r-sm border-l-4 px-3 py-2`,t.containerClass),children:[(0,$.jsxs)(`p`,{className:x(`flex items-center gap-2 font-semibold`,t.titleClass),children:[(0,$.jsx)(r,{"aria-hidden":!0,className:x(`shrink-0`,t.iconClass)}),(0,$.jsx)(`span`,{children:t.label})]}),(0,$.jsx)(`div`,{className:`text-content`,children:e})]})}return(0,$.jsx)(`blockquote`,{className:`my-2 border-l-4 border-border pl-3 italic text-content-muted`,children:e})}function Or({...e}){return(0,$.jsx)(`hr`,{...e,className:`my-4 border-0 border-t border-[var(--oh-border)]`})}var kr=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*\r?\n?/i;function Ar(e){return Array.isArray(e)?e:typeof e==`string`?e.split(/\s+/).filter(Boolean):[]}var jr=()=>e=>{k(e,`blockquote`,e=>{let t=e,n=t.children[0];if(n?.type!==`paragraph`)return;let r=n,i=r.children[0];if(i?.type!==`text`)return;let a=i.value.match(kr);if(!a)return;let o=a[1].toLowerCase(),s=i;s.value=s.value.replace(kr,``),s.value===``&&(r.children.shift(),r.children[0]?.type===`break`&&r.children.shift(),r.children.length===0&&t.children.shift()),t.data=t.data??{};let c=t.data.hProperties??{},l=Ar(c.className);t.data.hProperties={...c,className:[...l,`markdown-alert`,`markdown-alert-${o}`]}})},Mr={...j,attributes:{...j.attributes,"*":[...j.attributes?.[`*`]??[],`className`,`id`],a:[`href`,`title`,`target`,`rel`],img:[...j.attributes?.img??[],`src`,`alt`,`title`,`width`,`height`,`loading`]},tagNames:[...j.tagNames??[],`img`,`details`,`summary`,`figure`,`figcaption`,`mark`,`kbd`,`sub`,`sup`],protocols:{...j.protocols,src:[`http`,`https`],href:[`http`,`https`,`mailto`,`tel`]}};function Nr({children:e,content:t,components:n,includeStandard:r=!1,includeHeadings:i=!1,allowHtml:a=!0}){return(0,$.jsx)(`div`,{"data-testid":`markdown-renderer`,children:(0,$.jsx)(tr,{components:{code:sr,ul:cr,ol:lr,li:ur,hr:Or,table:xr,th:Sr,td:Cr,blockquote:Dr,...r&&{a:fr,p:dr},...i&&{h1:pr,h2:mr,h3:hr,h4:gr,h5:_r,h6:vr},...n},remarkPlugins:[jr,O,D],rehypePlugins:a?[re,[E,Mr]]:void 0,children:t??e??``})})}export{De as $,pt as A,ot as B,Ut as C,ut as D,At as E,Ye as F,qe as G,K as H,ct as I,ze as J,Ze as K,Qe as L,J as M,Ve as N,dt as O,lt as P,Oe as Q,We as R,Wt as S,Z as T,Ge as U,q as V,Y as W,Ne as X,Fe as Y,Ae as Z,En as _,Yn as a,Jt as b,qn as c,Vn as d,Ee as et,Bn as f,On as g,Nn as h,or as i,st as j,mt as k,Hn as l,Pn as m,fr as n,Jn as o,zn as p,He as q,sr as r,Kn as s,Nr as t,Un as u,on as v,zt as w,Kt as x,tn as y,nt as z};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ox0jfsa0-cHFhpUBq.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js";import{It as a,Mt as o}from"./active-backend-context-DKFSMbn3.js";import{W as s}from"./utils-DaCIEEQP.js";import{l as c}from"./settings-service.api-B2agVfjL.js";import{n as l}from"./use-settings-C5VhGpqd.js";import{t as u}from"./brand-button-Dxv6PDeN.js";import{t as d}from"./install-server-modal-BbJdhzet.js";import{f,l as p,s as m,t as h}from"./mcp-marketplace-utils-C13fFccR.js";import{t as g}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-B2OLKL7N.js";import{a as _,i as v,n as y,r as b,t as x}from"./mcp-page-Bm4K2NQq.js";import{n as S}from"./extensions-navigation-BeC224yX.js";import{n as C}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var w=e(t(),1),T=n(),E=r(function(){let{t:e}=i(`openhands`),{data:t,isLoading:n}=l(),{mutate:r}=_(),[E,D]=w.useState(null),[O,k]=w.useState(null),[A,j]=w.useState(``),[M,N]=w.useState(`all`),P=f(t?.mcp_config??c(t?.agent_settings?.mcp_config)),F=m(g),I=P.filter(e=>p(e,h(e,F),A)),L=e=>{D(e)};return n||!t?(0,T.jsxs)(`div`,{"data-testid":`mcp-page`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,T.jsx)(S,{}),(0,T.jsx)(`div`,{className:`flex h-full flex-1 items-center justify-center px-4 md:px-0`,children:(0,T.jsx)(`div`,{className:`h-8 w-8 rounded-full border-2 border-transparent border-t-white animate-spin`})})]}):(0,T.jsxs)(`div`,{"data-testid":`mcp-page`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,T.jsx)(S,{}),(0,T.jsxs)(`main`,{className:C,children:[(0,T.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,T.jsx)(`div`,{className:`min-w-0`,children:(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(`h2`,{className:`text-xl font-medium leading-6 text-foreground`,children:e(s.SETTINGS$MCP_TITLE)}),(0,T.jsx)(`div`,{className:`max-w-2xl text-sm text-tertiary-light`,children:e(s.MCP$PAGE_DESCRIPTION)})]}),(0,T.jsx)(u,{type:`button`,variant:`secondary`,testId:`mcp-add-custom-server`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>k({id:``,type:`sse`}),children:e(s.MCP$ADD_CUSTOM)})]})}),(0,T.jsx)(x,{search:A,onSearchChange:j,sectionFilter:M,onSectionFilterChange:N}),M===`library`?null:(0,T.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,T.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e(s.MCP$INSTALLED_TITLE)}),(0,T.jsx)(v,{servers:I,hasAnyInstalled:P.length>0,query:A,onEdit:e=>{k(e)},onToggleEnabled:(t,n)=>{r({serverId:t.id,server:{...t,enabled:n}},{onError:t=>{o(a(t)||e(s.ERROR$GENERIC))}})}})]}),M===`installed`?null:(0,T.jsx)(b,{onSelect:L,onAdd:L,query:A})]}),E&&(0,T.jsx)(d,{entry:E,existingServers:P,onClose:()=>D(null)}),O&&(0,T.jsx)(y,{server:O,existingServers:P,onClose:()=>k(null)})]})]})});export{E as default};
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{U as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js";import{Ft as a,zt as o}from"./active-backend-context-CrHTlgvN.js";import{W as s}from"./utils-CN5ZfZy1.js";import{n as c}from"./extensions-navigation-Cr4yzYk4.js";import{l}from"./settings-service.api-DJ1r62Zr.js";import{n as u}from"./use-settings-DSXLbvBl.js";import{t as d}from"./brand-button-BAfk4wGP.js";import{t as f}from"./install-server-modal-Dpy89p4g.js";import{f as p,l as m,s as h,t as g}from"./mcp-marketplace-utils-AIBzzHTO.js";import{t as _}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-cDuKr-WD.js";import{a as v,i as y,n as b,r as x,t as S}from"./mcp-page-BEBYqH_K.js";import{n as C}from"./settings-like-page-layout-classes-Cw4Yzv_P.js";var w=e(t(),1),T=n(),E=r(function(){let{t:e}=i(`openhands`),{data:t,isLoading:n}=u(),{mutate:r}=v(),[E,D]=w.useState(null),[O,k]=w.useState(null),[A,j]=w.useState(``),[M,N]=w.useState(`all`),P=p(t?.mcp_config??l(t?.agent_settings?.mcp_config)),F=h(_),I=P.filter(e=>m(e,g(e,F),A)),L=e=>{D(e)};return n||!t?(0,T.jsxs)(`div`,{"data-testid":`mcp-page`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,T.jsx)(c,{}),(0,T.jsx)(`div`,{className:`flex h-full flex-1 items-center justify-center px-4 md:px-0`,children:(0,T.jsx)(`div`,{className:`h-8 w-8 rounded-full border-2 border-transparent border-t-white animate-spin`})})]}):(0,T.jsxs)(`div`,{"data-testid":`mcp-page`,className:`flex h-full gap-4 md:gap-6 md:pl-8 lg:gap-10 lg:pl-10`,children:[(0,T.jsx)(c,{}),(0,T.jsxs)(`main`,{className:C,children:[(0,T.jsxs)(`div`,{className:`mx-auto flex w-full min-w-0 max-w-[800px] flex-col gap-6`,children:[(0,T.jsx)(`div`,{className:`min-w-0`,children:(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(`h2`,{className:`text-xl font-medium leading-6 text-foreground`,children:e(s.SETTINGS$MCP_TITLE)}),(0,T.jsx)(`div`,{className:`max-w-2xl text-sm text-tertiary-light`,children:e(s.MCP$PAGE_DESCRIPTION)})]}),(0,T.jsx)(d,{type:`button`,variant:`secondary`,testId:`mcp-add-custom-server`,className:`flex-shrink-0 whitespace-nowrap`,onClick:()=>k({id:``,type:`sse`}),children:e(s.MCP$ADD_CUSTOM)})]})}),(0,T.jsx)(S,{search:A,onSearchChange:j,sectionFilter:M,onSectionFilterChange:N}),M===`library`?null:(0,T.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,T.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:e(s.MCP$INSTALLED_TITLE)}),(0,T.jsx)(y,{servers:I,hasAnyInstalled:P.length>0,query:A,onEdit:e=>{k(e)},onToggleEnabled:(t,n)=>{r({serverId:t.id,server:{...t,enabled:n}},{onError:t=>{a(o(t)||e(s.ERROR$GENERIC))}})}})]}),M===`installed`?null:(0,T.jsx)(x,{onSelect:L,onAdd:L,query:A})]}),E&&(0,T.jsx)(f,{entry:E,existingServers:P,onClose:()=>D(null)}),O&&(0,T.jsx)(b,{server:O,existingServers:P,onClose:()=>k(null)})]})]})});export{E as default};
@@ -1 +1 @@
1
- import{s as e}from"./settings-service.api-B2agVfjL.js";function t(t){return Object.entries(t).map(([t,n])=>n.transport===`stdio`?{id:t,type:`stdio`,name:t,command:n.command,args:n.args??void 0,env:n.env??void 0,enabled:e(n)}:{id:t,type:n.transport===`sse`?`sse`:`shttp`,name:t,url:n.url,headers:n.headers??void 0,timeout:n.timeout??void 0,auth:n.auth??void 0,enabled:e(n)})}function n(e){return e.connectionOptions.filter(e=>e.provider===`mcp`&&!!e.transport)}function r(e){return n(e)[0]}function i(e){if(e.auth.strategy!==`oauth2`)return!0;let t=e.auth.oauth;return t?!t.authorizationUrl&&!t.tokenUrl&&!t.registrationUrl&&!t.additionalAuthorizationParams&&!t.additionalTokenParams:!1}function a(e){return n(e).find(i)}function o(e){return r(e)?.transport}function s(e){switch(e){case`none`:return`none`;case`body`:return`client_secret_post`;case`basic`:return`client_secret_basic`;default:return}}function c(e){if(e.auth.strategy!==`oauth2`)return;let t={type:`oauth`},n=s(e.auth.oauth?.clientAuthentication);return n&&(t.client_auth_method=n),e.auth.oauth?.scopes?.length&&(t.scopes=e.auth.oauth.scopes),Object.keys(t).length>1?t:void 0}function l(e){return e.filter(u)}function u(e){return!!r(e)}var d=e=>{try{return new URL(e)}catch{return null}};function f(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;if(!n||!r)return!1;let i=d(n),a=d(r);return!i||!a?n.replace(/\/+$/,``)===r.replace(/\/+$/,``):i.protocol===a.protocol&&i.host===a.host&&i.pathname.replace(/\/+$/,``)===a.pathname.replace(/\/+$/,``)}function p(e,t){return t.find(t=>h(e,t))??null}function m(e,t){for(let r of n(e)){let e=p(r.transport,t);if(e)return e}return null}function h(e,t){if(e.kind===`shttp`){let n=e.url;return t.type===`shttp`&&!!t.url&&f(t.url,n)}if(e.kind===`sse`){let n=e.url;return t.type===`sse`&&!!t.url&&f(t.url,n)}return t.type===`stdio`&&t.name===e.serverName}function g(e){return e.trim().toLowerCase()}function _(e){return e.map((e,t)=>({entry:e,index:t})).sort((e,t)=>(t.entry.popularityRank??0)-(e.entry.popularityRank??0)||e.index-t.index).map(({entry:e})=>e)}function v(e,t){return t.find(t=>t.id===e)}function y(e,t){let n=g(t);return n?[e.name,e.description,e.id,...e.keywords??[]].join(` `).toLowerCase().includes(n):!0}function b(e,t,n){let r=g(n);return r?[e.type,`name`in e?e.name:void 0,`command`in e?e.command:void 0,`args`in e?e.args?.join(` `):void 0,`url`in e?e.url:void 0,t?.name,t?.description,t?.id,...t?.keywords??[]].filter(Boolean).join(` `).toLowerCase().includes(r):!0}function x(e,t){return t.find(t=>n(t).some(t=>h(t.transport,e)))}export{_ as a,c,y as d,t as f,a as i,b as l,m as n,v as o,o as r,l as s,x as t,u};
1
+ import{s as e}from"./settings-service.api-DJ1r62Zr.js";function t(t){return Object.entries(t).map(([t,n])=>n.transport===`stdio`?{id:t,type:`stdio`,name:t,command:n.command,args:n.args??void 0,env:n.env??void 0,enabled:e(n)}:{id:t,type:n.transport===`sse`?`sse`:`shttp`,name:t,url:n.url,headers:n.headers??void 0,timeout:n.timeout??void 0,auth:n.auth??void 0,enabled:e(n)})}function n(e){return e.connectionOptions.filter(e=>e.provider===`mcp`&&!!e.transport)}function r(e){return n(e)[0]}function i(e){if(e.auth.strategy!==`oauth2`)return!0;let t=e.auth.oauth;return t?!t.authorizationUrl&&!t.tokenUrl&&!t.registrationUrl&&!t.additionalAuthorizationParams&&!t.additionalTokenParams:!1}function a(e){return n(e).find(i)}function o(e){return r(e)?.transport}function s(e){switch(e){case`none`:return`none`;case`body`:return`client_secret_post`;case`basic`:return`client_secret_basic`;default:return}}function c(e){if(e.auth.strategy!==`oauth2`)return;let t={type:`oauth`},n=s(e.auth.oauth?.clientAuthentication);return n&&(t.client_auth_method=n),e.auth.oauth?.scopes?.length&&(t.scopes=e.auth.oauth.scopes),Object.keys(t).length>1?t:void 0}function l(e){return e.filter(u)}function u(e){return!!r(e)}var d=e=>{try{return new URL(e)}catch{return null}};function f(e,t){let n=typeof e==`string`?e:``,r=typeof t==`string`?t:``;if(!n||!r)return!1;let i=d(n),a=d(r);return!i||!a?n.replace(/\/+$/,``)===r.replace(/\/+$/,``):i.protocol===a.protocol&&i.host===a.host&&i.pathname.replace(/\/+$/,``)===a.pathname.replace(/\/+$/,``)}function p(e,t){return t.find(t=>h(e,t))??null}function m(e,t){for(let r of n(e)){let e=p(r.transport,t);if(e)return e}return null}function h(e,t){if(e.kind===`shttp`){let n=e.url;return t.type===`shttp`&&!!t.url&&f(t.url,n)}if(e.kind===`sse`){let n=e.url;return t.type===`sse`&&!!t.url&&f(t.url,n)}return t.type===`stdio`&&t.name===e.serverName}function g(e){return e.trim().toLowerCase()}function _(e){return e.map((e,t)=>({entry:e,index:t})).sort((e,t)=>(t.entry.popularityRank??0)-(e.entry.popularityRank??0)||e.index-t.index).map(({entry:e})=>e)}function v(e,t){return t.find(t=>t.id===e)}function y(e,t){let n=g(t);return n?[e.name,e.description,e.id,...e.keywords??[]].join(` `).toLowerCase().includes(n):!0}function b(e,t,n){let r=g(n);return r?[e.type,`name`in e?e.name:void 0,`command`in e?e.command:void 0,`args`in e?e.args?.join(` `):void 0,`url`in e?e.url:void 0,t?.name,t?.description,t?.id,...t?.keywords??[]].filter(Boolean).join(` `).toLowerCase().includes(r):!0}function x(e,t){return t.find(t=>n(t).some(t=>h(t.transport,e)))}export{_ as a,c,y as d,t as f,a as i,b as l,m as n,v as o,o as r,l as s,x as t,u};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew3u153i-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js";import{t as a}from"./useMutation-DFnzkf6f.js";import{It as o,Mt as s,Nt as c,R as l,n as u}from"./active-backend-context-DKFSMbn3.js";import{W as d,t as f}from"./utils-DaCIEEQP.js";import{t as p}from"./puzzle-A9pGxxai.js";import{n as m,t as h}from"./x-DkgltWa0.js";import{t as g}from"./trash-2-Dl8_RGz0.js";import{a as _,d as v,f as y,l as b,o as x,p as S,t as C}from"./settings-service.api-B2agVfjL.js";import{n as w}from"./use-settings-C5VhGpqd.js";import{t as T}from"./modal-backdrop-BSzNhM4r.js";import{n as ee}from"./modal-classes-BAb4Y_BG.js";import{l as E}from"./form-control-classes-CGw40z5h.js";import{t as D}from"./brand-button-Dxv6PDeN.js";import{t as O}from"./settings-dropdown-input-tM0A0ipy.js";import{t as te}from"./modal-close-button-CkJ0Ktjj.js";import{n as k,t as A}from"./settings-input-C03KUoSC.js";import{t as ne}from"./confirmation-modal-Bk4JRcCM.js";import{a as j,c as M,d as N,f as P,i as re,l as F,n as I,o as L,p as R,r as z,s as B,u as V}from"./install-server-modal-BbJdhzet.js";import{a as H,n as U,o as W,r as G,t as K}from"./extension-module-card-classes-DpeaYhYo.js";import{a as q,d as ie,r as ae,s as J,t as oe}from"./mcp-marketplace-utils-C13fFccR.js";import{t as Y}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-B2OLKL7N.js";import{n as se}from"./circle-plus-check-toggle-CBh_qomE.js";import{t as ce}from"./enum-filter-dropdown-DliX_Lo0.js";var X=e(t(),1),Z=n();function le(){let e=r();return a({mutationFn:async e=>{await C.deleteMcpServer(e.id)},onSuccess:(t,n)=>{M(N(n)),e.invalidateQueries({queryKey:l.personal()})}})}function Q(){let e=r(),{data:t}=w();return a({mutationFn:async({serverId:e,server:n})=>{let r=t?.mcp_config??b(t?.agent_settings?.mcp_config),i=r[e];if(!i)throw Error(`MCP server "${e}" no longer exists.`);let a=N({id:e,type:i.transport===`stdio`?`stdio`:i.transport===`sse`?`sse`:`shttp`,name:e,...i.transport===`stdio`?{command:i.command,args:i.args??void 0,env:i.env??void 0}:{url:i.url,headers:i.headers??void 0,auth:i.auth??void 0}}),o=S(n.name||e);if(o!==e){if(o in r)throw Error(`MCP server "${o}" already exists.`);return await C.patchMcpConfig(x(e,o,i,n)),a}return await C.patchMcpServer(e,_(i,n)),a},onSuccess:(t,n)=>{M(t),M(N(n.server)),e.invalidateQueries({queryKey:l.personal()})}})}function ue(e){return e.name?.trim()||void 0}function de(e,t){let n=ue(e);return n&&n!==t?.id?n:t?.name?t.name:e.type===`stdio`?n??e.command??``:e.url??``}var fe={status:`unchecked`};function pe(e){let t=N(e),n=X.useSyncExternalStore(V,()=>F()[t]??fe),r=X.useRef(e);return r.current=e,{health:n,probe:X.useCallback(()=>j(r.current),[]),reauthorize:X.useCallback(()=>L(r.current),[])}}var me={unchecked:`bg-[var(--oh-text-tertiary)]`,checking:`bg-[var(--oh-interactive-selected)] animate-pulse`,healthy:`bg-[var(--oh-status-success)]`,failed:`bg-red-500`},$=`text-xs text-[var(--oh-muted)] underline transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-60`;function he(e){return e.status===`healthy`?e.verification===`verified`?`healthy`:`healthy-connectivity`:e.status}function ge(e,t){switch(t.status){case`checking`:return e(d.MCP$HEALTH_STATUS_CHECKING);case`healthy`:return t.verification===`verified`?e(d.MCP$HEALTH_STATUS_VERIFIED,{count:t.toolCount}):e(d.MCP$HEALTH_STATUS_CONNECTIVITY_ONLY);case`failed`:return I(e,t.kind,t.error);default:return e(d.MCP$HEALTH_STATUS_UNCHECKED)}}function _e({server:e,catalog:t,onEdit:n}){let{t:r}=i(`openhands`),{backend:a}=u(),{health:c,probe:l,reauthorize:p}=pe(e),{mutate:m}=Q();if(a.kind===`cloud`)return null;let h=c.status===`checking`,g=c.status===`failed`,_=ge(r,c),v=async()=>{let t=await p();if(!t?.ok||!t.oauth_state||e.auth?.strategy!==`oauth2`)return;let n={...e,auth:{...e.auth,state:t.oauth_state}};m({serverId:e.id,server:n},{onSuccess:()=>B(n,t,[]),onError:e=>s(o(e)||r(d.ERROR$GENERIC))})};return(0,Z.jsxs)(`div`,{"data-testid":`mcp-server-health-${e.id}`,role:`presentation`,className:`flex flex-col gap-1.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{"data-testid":`mcp-health-dot`,"data-status":he(c),"aria-hidden":`true`,className:f(`inline-block h-2 w-2 shrink-0 rounded-full`,me[c.status])}),(0,Z.jsx)(`p`,{"data-testid":`mcp-health-label-${e.id}`,className:f(`line-clamp-2 break-words text-xs`,g?`text-red-500`:`text-tertiary-alt`),title:_,children:_})]}),c.status===`healthy`&&c.verification===`connectivity-only`?(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(d.MCP$HEALTH_CONNECTIVITY_ONLY_HINT)}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-probe-${e.id}`,className:$,onClick:()=>void l(),disabled:h,children:r(g?d.MCP$HEALTH_RETRY:d.MCP$TEST_BUTTON)}),g&&c.kind===`credentials`?(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-update-credentials-${e.id}`,className:$,onClick:n,children:r(d.MCP$HEALTH_UPDATE_CREDENTIALS)}):null,g&&e.auth?.strategy===`oauth2`?(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-reauthorize-${e.id}`,className:$,onClick:()=>void v(),children:r(d.MCP$HEALTH_REAUTHORIZE)}):null,g&&t?.docsUrl?(0,Z.jsx)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noreferrer`,className:$,children:r(d.MCP$VIEW_DOCS)}):null]})]})}function ve(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function ye(e){if(e.type===`stdio`){let t=e.args&&e.args.length>0?` ${e.args.join(` `)}`:``;return`${e.command??``}${t}`.trim()}return e.url??``}function be({server:e,onEdit:t,onToggleEnabled:n}){let{t:r}=i(`openhands`),a=oe(e,J(Y)),o=de(e,a),s=ye(e),c=ve(e.type);return(0,Z.jsx)(`div`,{"data-testid":`mcp-server-item`,"data-server-id":e.id,role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"aria-label":r(d.MCP$EDIT_SERVER_ARIA,{name:o}),className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,H,G),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(R,{entry:a,fallback:(0,Z.jsx)(p,{strokeWidth:2.25})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold`,title:o,children:o}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:c})]}),(0,Z.jsx)(se,{testId:`mcp-installed-toggle-${e.id}`,isSelected:e.enabled!==!1,onToggle:n,enableLabelKey:d.MCP$TOGGLE_ENABLE_SERVER,disableLabelKey:d.MCP$TOGGLE_DISABLE_SERVER,disableTooltipKey:d.COMMON$DISABLE})]}),a?.description?(0,Z.jsx)(`p`,{"data-testid":`mcp-server-description-${e.id}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:a.description}):null,s?(0,Z.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:s,children:s}):null,(0,Z.jsx)(_e,{server:e,catalog:a,onEdit:t})]})]})})}function xe({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onToggleEnabled:a}){let{t:o}=i(`openhands`);return e.length===0?t&&n.trim().length>0?(0,Z.jsx)(`div`,{"data-testid":`mcp-installed-empty-search`,className:`rounded-xl border border-[var(--oh-border)] p-6 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:o(d.MCP$SEARCH_EMPTY)})}):(0,Z.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:W,children:[(0,Z.jsx)(`p`,{className:`text-sm text-white`,children:o(d.MCP$INSTALLED_EMPTY_TITLE)}),(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(d.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Z.jsx)(`div`,{className:U,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:K,children:e.map(e=>(0,Z.jsx)(be,{server:e,onEdit:()=>r(e),onToggleEnabled:t=>a(e,t)},e.id))})})}function Se({entry:e,onClick:t,onAdd:n}){let r=ae(e),i=(()=>{switch(r?.kind){case`stdio`:return`STDIO`;case`shttp`:return`HTTP`;case`sse`:return`SSE`;default:return``}})();return(0,Z.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"data-testid":`mcp-marketplace-card-${e.id}`,className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,H,G),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(R,{entry:e}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:i})]}),(0,Z.jsx)(se,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:d.MCP$TOGGLE_ADD_SERVER,disableLabelKey:d.MCP$TOGGLE_ADD_SERVER})]}),(0,Z.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function Ce({onSelect:e,onAdd:t,query:n=``}){let{t:r}=i(`openhands`),a=q(J(Y)).filter(e=>ie(e,n));return(0,Z.jsxs)(`section`,{"data-testid":`mcp-marketplace-section`,className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:r(d.MCP$LIBRARY_TITLE)}),a.length===0?(0,Z.jsx)(`div`,{"data-testid":`mcp-marketplace-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(d.MCP$SEARCH_EMPTY)})}):(0,Z.jsx)(`div`,{className:U,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:K,children:a.map(n=>(0,Z.jsx)(Se,{entry:n,onClick:()=>e(n),onAdd:()=>t(n)},n.id))})})]})}function we({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:a,onDelete:o,isActionDisabled:s=!1,onTest:c,isTestPending:l=!1,testMessage:u=null}){let{t:p}=i(`openhands`),[m,h]=X.useState(t?.type||`sse`),[_,b]=X.useState(()=>t?.auth?.strategy===`oauth2`?`oauth2`:t?.auth?.strategy===`header`?`header`:t?.auth?.strategy===`bearer`||t?.auth?.strategy===`api_key`?`bearer`:`none`),[x,S]=X.useState(()=>t?.auth?.strategy===`oauth2`?t.auth.authentication?.client_auth_method??`auto`:`auto`),[C,w]=X.useState(null),T=X.useRef(null),ee=[{key:`sse`,label:p(d.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:p(d.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:p(d.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],te=[{key:`none`,label:p(d.SETTINGS$MCP_AUTH_MODE_NONE)},{key:`bearer`,label:p(d.SETTINGS$MCP_AUTH_MODE_BEARER)},{key:`header`,label:p(d.SETTINGS$MCP_AUTH_MODE_HEADER)},{key:`oauth2`,label:p(d.SETTINGS$MCP_AUTH_MODE_OAUTH)}],ne=[{key:`auto`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_AUTO)},{key:`none`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_NONE)},{key:`client_secret_post`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_POST)},{key:`client_secret_basic`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_BASIC)},{key:`private_key_jwt`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_PRIVATE_KEY_JWT)}],j=e=>{if(!e)return p(d.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return p(d.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return p(d.SETTINGS$MCP_ERROR_URL_INVALID)}return null},M=e=>e?y(e)?null:p(d.SETTINGS$MCP_ERROR_NAME_INVALID):p(d.SETTINGS$MCP_ERROR_NAME_REQUIRED),N=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?p(d.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,P=e=>e?e.includes(` `)?p(d.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:p(d.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),re=r=>{if(!n)return null;let i=t?.url;return(e===`add`||e===`edit`&&i!==r)&&n.some(e=>(e.type===`sse`||e.type===`shttp`)&&e.url===r)?p(d.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},F=e=>{if(!e.trim())return null;let t=e.split(`
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{n as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js";import{t as a}from"./useMutation-B-qc391N.js";import{Ft as o,It as s,n as c,z as l,zt as u}from"./active-backend-context-CrHTlgvN.js";import{W as d,t as f}from"./utils-CN5ZfZy1.js";import{t as p}from"./puzzle-JM_QaRm0.js";import{n as m,t as h}from"./x-DJdhbdmt.js";import{t as g}from"./trash-2-D7K26eDO.js";import{a as _,d as v,f as y,l as b,o as x,p as S,t as C}from"./settings-service.api-DJ1r62Zr.js";import{n as w}from"./use-settings-DSXLbvBl.js";import{t as T}from"./modal-backdrop-BSzNhM4r.js";import{n as ee}from"./modal-classes-C8eycCwG.js";import{l as E}from"./form-control-classes-Bkh5FGrD.js";import{t as D}from"./brand-button-BAfk4wGP.js";import{t as O}from"./settings-dropdown-input-BcwylHs2.js";import{t as te}from"./modal-close-button-DDzdRvCs.js";import{n as k,t as A}from"./settings-input-Db-1g8Ql.js";import{t as ne}from"./confirmation-modal-Dv1ktp8K.js";import{a as j,c as M,d as N,f as P,i as re,l as F,n as I,o as L,p as R,r as z,s as B,u as V}from"./install-server-modal-Dpy89p4g.js";import{a as H,n as U,o as W,r as G,t as K}from"./extension-module-card-classes-DpeaYhYo.js";import{a as q,d as ie,r as ae,s as J,t as oe}from"./mcp-marketplace-utils-AIBzzHTO.js";import{t as Y}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-cDuKr-WD.js";import{n as se}from"./circle-plus-check-toggle-BO_kFZt3.js";import{t as ce}from"./enum-filter-dropdown-Bgca129f.js";var X=e(t(),1),Z=n();function le(){let e=r();return a({mutationFn:async e=>{await C.deleteMcpServer(e.id)},onSuccess:(t,n)=>{M(N(n)),e.invalidateQueries({queryKey:l.personal()})}})}function Q(){let e=r(),{data:t}=w();return a({mutationFn:async({serverId:e,server:n})=>{let r=t?.mcp_config??b(t?.agent_settings?.mcp_config),i=r[e];if(!i)throw Error(`MCP server "${e}" no longer exists.`);let a=N({id:e,type:i.transport===`stdio`?`stdio`:i.transport===`sse`?`sse`:`shttp`,name:e,...i.transport===`stdio`?{command:i.command,args:i.args??void 0,env:i.env??void 0}:{url:i.url,headers:i.headers??void 0,auth:i.auth??void 0}}),o=S(n.name||e);if(o!==e){if(o in r)throw Error(`MCP server "${o}" already exists.`);return await C.patchMcpConfig(x(e,o,i,n)),a}return await C.patchMcpServer(e,_(i,n)),a},onSuccess:(t,n)=>{M(t),M(N(n.server)),e.invalidateQueries({queryKey:l.personal()})}})}function ue(e){return e.name?.trim()||void 0}function de(e,t){let n=ue(e);return n&&n!==t?.id?n:t?.name?t.name:e.type===`stdio`?n??e.command??``:e.url??``}var fe={status:`unchecked`};function pe(e){let t=N(e),n=X.useSyncExternalStore(V,()=>F()[t]??fe),r=X.useRef(e);return r.current=e,{health:n,probe:X.useCallback(()=>j(r.current),[]),reauthorize:X.useCallback(()=>L(r.current),[])}}var me={unchecked:`bg-[var(--oh-text-tertiary)]`,checking:`bg-[var(--oh-interactive-selected)] animate-pulse`,healthy:`bg-[var(--oh-status-success)]`,failed:`bg-red-500`},$=`text-xs text-[var(--oh-muted)] underline transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-60`;function he(e){return e.status===`healthy`?e.verification===`verified`?`healthy`:`healthy-connectivity`:e.status}function ge(e,t){switch(t.status){case`checking`:return e(d.MCP$HEALTH_STATUS_CHECKING);case`healthy`:return t.verification===`verified`?e(d.MCP$HEALTH_STATUS_VERIFIED,{count:t.toolCount}):e(d.MCP$HEALTH_STATUS_CONNECTIVITY_ONLY);case`failed`:return I(e,t.kind,t.error);default:return e(d.MCP$HEALTH_STATUS_UNCHECKED)}}function _e({server:e,catalog:t,onEdit:n}){let{t:r}=i(`openhands`),{backend:a}=c(),{health:s,probe:l,reauthorize:p}=pe(e),{mutate:m}=Q();if(a.kind===`cloud`)return null;let h=s.status===`checking`,g=s.status===`failed`,_=ge(r,s),v=async()=>{let t=await p();if(!t?.ok||!t.oauth_state||e.auth?.strategy!==`oauth2`)return;let n={...e,auth:{...e.auth,state:t.oauth_state}};m({serverId:e.id,server:n},{onSuccess:()=>B(n,t,[]),onError:e=>o(u(e)||r(d.ERROR$GENERIC))})};return(0,Z.jsxs)(`div`,{"data-testid":`mcp-server-health-${e.id}`,role:`presentation`,className:`flex flex-col gap-1.5`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{"data-testid":`mcp-health-dot`,"data-status":he(s),"aria-hidden":`true`,className:f(`inline-block h-2 w-2 shrink-0 rounded-full`,me[s.status])}),(0,Z.jsx)(`p`,{"data-testid":`mcp-health-label-${e.id}`,className:f(`line-clamp-2 break-words text-xs`,g?`text-red-500`:`text-tertiary-alt`),title:_,children:_})]}),s.status===`healthy`&&s.verification===`connectivity-only`?(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(d.MCP$HEALTH_CONNECTIVITY_ONLY_HINT)}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-probe-${e.id}`,className:$,onClick:()=>void l(),disabled:h,children:r(g?d.MCP$HEALTH_RETRY:d.MCP$TEST_BUTTON)}),g&&s.kind===`credentials`?(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-update-credentials-${e.id}`,className:$,onClick:n,children:r(d.MCP$HEALTH_UPDATE_CREDENTIALS)}):null,g&&e.auth?.strategy===`oauth2`?(0,Z.jsx)(`button`,{type:`button`,"data-testid":`mcp-health-reauthorize-${e.id}`,className:$,onClick:()=>void v(),children:r(d.MCP$HEALTH_REAUTHORIZE)}):null,g&&t?.docsUrl?(0,Z.jsx)(`a`,{href:t.docsUrl,target:`_blank`,rel:`noreferrer`,className:$,children:r(d.MCP$VIEW_DOCS)}):null]})]})}function ve(e){switch(e){case`sse`:return`SSE`;case`shttp`:return`HTTP`;case`stdio`:return`STDIO`;default:return e}}function ye(e){if(e.type===`stdio`){let t=e.args&&e.args.length>0?` ${e.args.join(` `)}`:``;return`${e.command??``}${t}`.trim()}return e.url??``}function be({server:e,onEdit:t,onToggleEnabled:n}){let{t:r}=i(`openhands`),a=oe(e,J(Y)),o=de(e,a),s=ye(e),c=ve(e.type);return(0,Z.jsx)(`div`,{"data-testid":`mcp-server-item`,"data-server-id":e.id,role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"aria-label":r(d.MCP$EDIT_SERVER_ARIA,{name:o}),className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,H,G),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(R,{entry:a,fallback:(0,Z.jsx)(p,{strokeWidth:2.25})}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold`,title:o,children:o}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:c})]}),(0,Z.jsx)(se,{testId:`mcp-installed-toggle-${e.id}`,isSelected:e.enabled!==!1,onToggle:n,enableLabelKey:d.MCP$TOGGLE_ENABLE_SERVER,disableLabelKey:d.MCP$TOGGLE_DISABLE_SERVER,disableTooltipKey:d.COMMON$DISABLE})]}),a?.description?(0,Z.jsx)(`p`,{"data-testid":`mcp-server-description-${e.id}`,className:`line-clamp-2 break-words text-xs leading-relaxed text-tertiary-light`,children:a.description}):null,s?(0,Z.jsx)(`p`,{"data-testid":`mcp-server-detail-${e.id}`,className:`truncate text-xs text-tertiary-alt`,title:s,children:s}):null,(0,Z.jsx)(_e,{server:e,catalog:a,onEdit:t})]})]})})}function xe({servers:e,hasAnyInstalled:t,query:n=``,onEdit:r,onToggleEnabled:a}){let{t:o}=i(`openhands`);return e.length===0?t&&n.trim().length>0?(0,Z.jsx)(`div`,{"data-testid":`mcp-installed-empty-search`,className:`rounded-xl border border-[var(--oh-border)] p-6 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:o(d.MCP$SEARCH_EMPTY)})}):(0,Z.jsxs)(`div`,{"data-testid":`mcp-installed-empty`,className:W,children:[(0,Z.jsx)(`p`,{className:`text-sm text-white`,children:o(d.MCP$INSTALLED_EMPTY_TITLE)}),(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light mt-1`,children:o(d.MCP$INSTALLED_EMPTY_HINT)})]}):(0,Z.jsx)(`div`,{className:U,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:K,children:e.map(e=>(0,Z.jsx)(be,{server:e,onEdit:()=>r(e),onToggleEnabled:t=>a(e,t)},e.id))})})}function Se({entry:e,onClick:t,onAdd:n}){let r=ae(e),i=(()=>{switch(r?.kind){case`stdio`:return`STDIO`;case`shttp`:return`HTTP`;case`sse`:return`SSE`;default:return``}})();return(0,Z.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},"data-testid":`mcp-marketplace-card-${e.id}`,className:f(`flex min-h-[132px] flex-col overflow-hidden p-4 text-left`,H,G),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(R,{entry:e}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3`,children:[(0,Z.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-xs text-tertiary-alt`,children:i})]}),(0,Z.jsx)(se,{testId:`mcp-marketplace-toggle-${e.id}`,isSelected:!1,onToggle:e=>{e&&n()},enableLabelKey:d.MCP$TOGGLE_ADD_SERVER,disableLabelKey:d.MCP$TOGGLE_ADD_SERVER})]}),(0,Z.jsx)(`p`,{className:`line-clamp-3 text-xs leading-relaxed text-tertiary-light`,children:e.description})]})]})})}function Ce({onSelect:e,onAdd:t,query:n=``}){let{t:r}=i(`openhands`),a=q(J(Y)).filter(e=>ie(e,n));return(0,Z.jsxs)(`section`,{"data-testid":`mcp-marketplace-section`,className:`flex flex-col gap-3`,children:[(0,Z.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:r(d.MCP$LIBRARY_TITLE)}),a.length===0?(0,Z.jsx)(`div`,{"data-testid":`mcp-marketplace-empty`,className:`rounded-xl border border-dashed border-[var(--oh-border)] p-6 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-light`,children:r(d.MCP$SEARCH_EMPTY)})}):(0,Z.jsx)(`div`,{className:U,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:K,children:a.map(n=>(0,Z.jsx)(Se,{entry:n,onClick:()=>e(n),onAdd:()=>t(n)},n.id))})})]})}function we({mode:e,server:t,existingServers:n,onSubmit:r,onCancel:a,onDelete:o,isActionDisabled:s=!1,onTest:c,isTestPending:l=!1,testMessage:u=null}){let{t:p}=i(`openhands`),[m,h]=X.useState(t?.type||`sse`),[_,b]=X.useState(()=>t?.auth?.strategy===`oauth2`?`oauth2`:t?.auth?.strategy===`header`?`header`:t?.auth?.strategy===`bearer`||t?.auth?.strategy===`api_key`?`bearer`:`none`),[x,S]=X.useState(()=>t?.auth?.strategy===`oauth2`?t.auth.authentication?.client_auth_method??`auto`:`auto`),[C,w]=X.useState(null),T=X.useRef(null),ee=[{key:`sse`,label:p(d.SETTINGS$MCP_SERVER_TYPE_SSE)},{key:`stdio`,label:p(d.SETTINGS$MCP_SERVER_TYPE_STDIO)},{key:`shttp`,label:p(d.SETTINGS$MCP_SERVER_TYPE_SHTTP)}],te=[{key:`none`,label:p(d.SETTINGS$MCP_AUTH_MODE_NONE)},{key:`bearer`,label:p(d.SETTINGS$MCP_AUTH_MODE_BEARER)},{key:`header`,label:p(d.SETTINGS$MCP_AUTH_MODE_HEADER)},{key:`oauth2`,label:p(d.SETTINGS$MCP_AUTH_MODE_OAUTH)}],ne=[{key:`auto`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_AUTO)},{key:`none`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_NONE)},{key:`client_secret_post`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_POST)},{key:`client_secret_basic`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_SECRET_BASIC)},{key:`private_key_jwt`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH_PRIVATE_KEY_JWT)}],j=e=>{if(!e)return p(d.SETTINGS$MCP_ERROR_URL_REQUIRED);try{let t=new URL(e);if(![`http:`,`https:`].includes(t.protocol))return p(d.SETTINGS$MCP_ERROR_URL_INVALID_PROTOCOL)}catch{return p(d.SETTINGS$MCP_ERROR_URL_INVALID)}return null},M=e=>e?y(e)?null:p(d.SETTINGS$MCP_ERROR_NAME_INVALID):p(d.SETTINGS$MCP_ERROR_NAME_REQUIRED),N=r=>!n||!(e===`add`||e===`edit`&&t?.name!==r)?null:n.filter(e=>e.type===`stdio`).map(e=>e.name).filter(Boolean).includes(r)?p(d.SETTINGS$MCP_ERROR_NAME_DUPLICATE):null,P=e=>e?e.includes(` `)?p(d.SETTINGS$MCP_ERROR_COMMAND_NO_SPACES):null:p(d.SETTINGS$MCP_ERROR_COMMAND_REQUIRED),re=r=>{if(!n)return null;let i=t?.url;return(e===`add`||e===`edit`&&i!==r)&&n.some(e=>(e.type===`sse`||e.type===`shttp`)&&e.url===r)?p(d.SETTINGS$MCP_ERROR_URL_DUPLICATE):null},F=e=>{if(!e.trim())return null;let t=e.split(`
2
2
  `);for(let e=0;e<t.length;e+=1){let n=t[e].trim();if(n){let e=n.indexOf(`=`);if(e===-1||!n.substring(0,e).trim())return p(d.SETTINGS$MCP_ERROR_ENV_INVALID_FORMAT)}}return null},I=e=>{if(_===`header`){let t=e.get(`headers`)?.toString()||``;return t.trim()?F(t):p(d.SETTINGS$MCP_ERROR_HEADER_REQUIRED)}if(_===`oauth2`){let t=e.get(`oauth_client_id`)?.toString().trim();if(e.get(`oauth_client_secret`)?.toString().trim()&&!t)return p(d.SETTINGS$MCP_ERROR_OAUTH_SECRET_REQUIRES_ID)}return null},L=e=>{if(!e.trim())return null;let t=parseInt(e.trim(),10);return Number.isNaN(t)?p(d.SETTINGS$MCP_ERROR_TIMEOUT_INVALID_NUMBER):t<=0?p(d.SETTINGS$MCP_ERROR_TIMEOUT_POSITIVE):t>3600?p(d.SETTINGS$MCP_ERROR_TIMEOUT_MAX_EXCEEDED):null},R=e=>{let t=e.get(`name`)?.toString().trim()||``,n=e.get(`command`)?.toString().trim()||``,r=e.get(`env`)?.toString()||``;return M(t)||N(t)||P(n)||F(r)||null},z=e=>{if(m===`sse`||m===`shttp`){let t=e.get(`url`)?.toString().trim()||``,n=j(t);if(n)return n;let r=re(t);if(r)return r;let i=e.get(`name`)?.toString().trim()||``;if(i&&!y(i))return p(d.SETTINGS$MCP_ERROR_NAME_INVALID);if(m===`shttp`){let t=L(e.get(`timeout`)?.toString()||``);if(t)return t}return I(e)}return m===`stdio`?R(e):null},B=e=>{let t={},n=e.trim();if(!n)return t;for(let e of n.split(`
3
3
  `)){let n=e.trim(),r=n.indexOf(`=`),i=r>=0?n.substring(0,r).trim():``;n&&r!==-1&&i&&(t[i]=n.substring(r+1).trim())}return t},V=e=>e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
4
4
  `):``,H=e=>e?.strategy===`bearer`||e?.strategy===`api_key`?e.value??``:``,U=e=>e?.strategy===`header`?V(e.headers):``,W=t?.auth?.strategy===`oauth2`?t.auth.authentication:void 0,G=t?.auth?.strategy===`oauth2`?t.auth.state:void 0,K=e=>{if(_===`none`)return;if(_===`bearer`){let n=e.get(`api_key`)?.toString().trim();return n?t?.auth?.strategy===`api_key`?{...t.auth,value:n}:{strategy:`bearer`,value:n}:void 0}if(_===`header`)return{strategy:`header`,headers:B(e.get(`headers`)?.toString()||``)};let n=e.get(`oauth_scopes`)?.toString().trim(),r=e.get(`oauth_client_id`)?.toString().trim(),i=e.get(`oauth_client_secret`)?.toString().trim();return{strategy:`oauth2`,authentication:{type:`oauth`,...x!==`auto`&&{client_auth_method:x},...n&&{scopes:n},...r&&{client_id:r},...i&&{client_secret:i}},...G&&{state:G}}},q=e=>{let n={id:t?.id||``,type:m,...t?.enabled===!1&&{enabled:!1}};if(m===`sse`||m===`shttp`){let r=e.get(`name`)?.toString().trim(),i=e.get(`url`)?.toString().trim(),a=e.get(`timeout`)?.toString().trim(),o=K(e),s={...n,...r&&{name:r},url:i,...t?.headers&&{headers:t.headers},...o&&{auth:o}};if(m===`shttp`&&a){let e=parseInt(a,10);Number.isNaN(e)||(s.timeout=e)}return s}let r=e.get(`name`)?.toString().trim(),i=e.get(`command`)?.toString().trim(),a=e.get(`args`)?.toString().trim(),o=e.get(`env`)?.toString().trim(),s=a?a.split(`
@@ -6,4 +6,4 @@ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from".
6
6
  `)||``,placeholder:`arg1
7
7
  arg2
8
8
  arg3`,className:f(E,`resize-none placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,Z.jsx)(`p`,{className:`text-xs text-tertiary-alt`,children:p(d.SETTINGS$MCP_COMMAND_ARGUMENTS_HELP)})]}),(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:p(d.SETTINGS$MCP_ENVIRONMENT_VARIABLES)}),(0,Z.jsx)(k,{})]}),(0,Z.jsx)(`textarea`,{"data-testid":`env-input`,name:`env`,rows:4,defaultValue:V(t?.env),placeholder:`KEY1=value1
9
- KEY2=value2`,className:f(E,`resize-none placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]})]}),u&&(0,Z.jsx)(`p`,{"data-testid":`mcp-test-message`,className:u.ok?`text-sm text-green-500 whitespace-pre-wrap`:`text-sm text-red-500 whitespace-pre-wrap`,children:u.text}),(0,Z.jsxs)(`div`,{className:f(`flex w-full items-center gap-2`,o?`justify-between`:`justify-end`),children:[o?(0,Z.jsx)(D,{testId:`mcp-custom-editor-delete`,type:`button`,variant:`secondary`,onClick:o,isDisabled:s,startContent:(0,Z.jsx)(g,{"aria-hidden":!0,className:`size-4`,strokeWidth:2}),children:p(d.BUTTON$DELETE)}):null,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(D,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:a,isDisabled:s,children:p(d.BUTTON$CANCEL)}),c&&(0,Z.jsx)(D,{testId:`mcp-test-connection`,type:`button`,variant:`secondary`,onClick:()=>{if(!c||!T.current)return;w(null);let e=new FormData(T.current),t=z(e);if(t){w(t);return}c(q(e))},isDisabled:s||l,children:p(l?d.MCP$VERIFYING:d.MCP$TEST_BUTTON)}),(0,Z.jsxs)(D,{testId:`submit-button`,type:`submit`,variant:`primary`,isDisabled:s||l,children:[e===`add`&&p(d.SETTINGS$MCP_ADD_SERVER),e===`edit`&&p(d.SETTINGS$MCP_SAVE_SERVER)]})]})]})]})}function Te({server:e,existingServers:t,onClose:n}){let{t:r}=i(`openhands`),{mutate:a,isPending:l}=re(),{mutate:p,isPending:m}=Q(),{mutate:h,isPending:g}=le(),{mutate:_,isPending:v,data:y,reset:b}=z(),[x,S]=X.useState(!1),[C,w]=X.useState(null),[E,D]=X.useState(!1),{backend:O}=u(),k=O.kind===`cloud`,A=!!e.id,j=l||m||g,M=j||v||E||x,N=X.useMemo(()=>{let e=C??y;return e?e.ok?{ok:!0,text:r(d.MCP$TEST_SUCCESS,{count:e.tools.length})}:{ok:!1,text:I(r,e.error_kind,e.error)}:null},[C,y,r]),F=(n,r)=>{k||B(n,r,A?t.filter(t=>t.id!==e.id):t)},L=e=>{if(e instanceof Error&&e.message===`Replace or clear the stored credential before renaming this MCP server.`){s(e.message);return}s(o(e)||r(d.ERROR$GENERIC))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(T,{onClose:M?void 0:n,closeOnEscape:!M,"aria-label":r(A?d.MCP$EDIT_CUSTOM_TITLE:d.MCP$ADD_CUSTOM_TITLE),children:(0,Z.jsxs)(`div`,{"data-testid":`mcp-custom-editor`,className:`relative bg-base-secondary p-6 rounded-xl border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[90vh] overflow-y-auto custom-scrollbar`,children:[(0,Z.jsx)(te,{onClose:n,testId:`mcp-custom-editor-close`,disabled:M}),(0,Z.jsx)(`h2`,{className:f(`mb-4 pr-6`,ee),children:r(A?d.MCP$EDIT_CUSTOM_TITLE:d.MCP$ADD_CUSTOM_TITLE)}),(0,Z.jsx)(we,{mode:A?`edit`:`add`,server:A?e:void 0,existingServers:t,onSubmit:t=>{if(b(),w(null),t.auth?.strategy===`oauth2`){D(!0),P.authorizeOAuth(t).then(r=>{if(w(r),!r.ok)return;let i=r.oauth_state?{...t,auth:{...t.auth,state:r.oauth_state}}:t,o=()=>{F(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:L}):a(i,{onSuccess:o,onError:L})}).catch(L).finally(()=>D(!1));return}_(t,{onSuccess:r=>{if(!r.ok)return;let i=r.oauth_state&&t.auth?.strategy===`oauth2`?{...t,auth:{...t.auth,state:r.oauth_state}}:t,o=()=>{F(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:L}):a(i,{onSuccess:o,onError:L})},onError:L})},onCancel:n,onDelete:A?()=>S(!0):void 0,isActionDisabled:j,onTest:k?void 0:e=>{if(w(null),e.auth?.strategy===`oauth2`&&!k){D(!0),P.authorizeOAuth(e).then(w).catch(L).finally(()=>D(!1));return}_(e)},isTestPending:v||E,testMessage:k?null:N})]})}),x?(0,Z.jsx)(ne,{text:r(d.SETTINGS$MCP_CONFIRM_DELETE),onCancel:()=>S(!1),onConfirm:()=>{h(e,{onSuccess:()=>{c(r(d.MCP$REMOVE_SUCCESS)),S(!1),n()},onError:e=>{L(e),S(!1)}})},isConfirming:g}):null]})}var Ee=[`all`,`installed`,`library`],De={all:d.MCP$SECTION_FILTER_ALL,installed:d.MCP$INSTALLED_TITLE,library:d.MCP$LIBRARY_TITLE};function Oe({value:e,onChange:t}){return(0,Z.jsx)(ce,{testId:`mcp-section-filter`,value:e,onChange:t,options:Ee,labelKeyByValue:De})}function ke({search:e,onSearchChange:t,sectionFilter:n,onSectionFilterChange:r}){let{t:a}=i(`openhands`);return(0,Z.jsxs)(`div`,{"data-testid":`mcp-toolbar`,className:`flex items-stretch gap-2`,children:[(0,Z.jsxs)(`div`,{"data-testid":`mcp-search`,className:f(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,Z.jsx)(m,{className:`ml-3 h-4 w-4 text-tertiary-alt shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:a(d.MCP$SEARCH_PLACEHOLDER),"aria-label":a(d.MCP$SEARCH_PLACEHOLDER),"data-testid":`mcp-search-input`,className:f(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":a(d.MCP$SEARCH_CLEAR),"data-testid":`mcp-search-clear`,className:`mr-2 p-1 rounded text-tertiary-alt hover:text-content-1 cursor-pointer`,children:(0,Z.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,Z.jsx)(Oe,{value:n,onChange:r})]})}export{Q as a,xe as i,Te as n,le as o,Ce as r,ke as t};
9
+ KEY2=value2`,className:f(E,`resize-none placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]})]}),u&&(0,Z.jsx)(`p`,{"data-testid":`mcp-test-message`,className:u.ok?`text-sm text-green-500 whitespace-pre-wrap`:`text-sm text-red-500 whitespace-pre-wrap`,children:u.text}),(0,Z.jsxs)(`div`,{className:f(`flex w-full items-center gap-2`,o?`justify-between`:`justify-end`),children:[o?(0,Z.jsx)(D,{testId:`mcp-custom-editor-delete`,type:`button`,variant:`secondary`,onClick:o,isDisabled:s,startContent:(0,Z.jsx)(g,{"aria-hidden":!0,className:`size-4`,strokeWidth:2}),children:p(d.BUTTON$DELETE)}):null,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(D,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:a,isDisabled:s,children:p(d.BUTTON$CANCEL)}),c&&(0,Z.jsx)(D,{testId:`mcp-test-connection`,type:`button`,variant:`secondary`,onClick:()=>{if(!c||!T.current)return;w(null);let e=new FormData(T.current),t=z(e);if(t){w(t);return}c(q(e))},isDisabled:s||l,children:p(l?d.MCP$VERIFYING:d.MCP$TEST_BUTTON)}),(0,Z.jsxs)(D,{testId:`submit-button`,type:`submit`,variant:`primary`,isDisabled:s||l,children:[e===`add`&&p(d.SETTINGS$MCP_ADD_SERVER),e===`edit`&&p(d.SETTINGS$MCP_SAVE_SERVER)]})]})]})]})}function Te({server:e,existingServers:t,onClose:n}){let{t:r}=i(`openhands`),{mutate:a,isPending:l}=re(),{mutate:p,isPending:m}=Q(),{mutate:h,isPending:g}=le(),{mutate:_,isPending:v,data:y,reset:b}=z(),[x,S]=X.useState(!1),[C,w]=X.useState(null),[E,D]=X.useState(!1),{backend:O}=c(),k=O.kind===`cloud`,A=!!e.id,j=l||m||g,M=j||v||E||x,N=X.useMemo(()=>{let e=C??y;return e?e.ok?{ok:!0,text:r(d.MCP$TEST_SUCCESS,{count:e.tools.length})}:{ok:!1,text:I(r,e.error_kind,e.error)}:null},[C,y,r]),F=(n,r)=>{k||B(n,r,A?t.filter(t=>t.id!==e.id):t)},L=e=>{if(e instanceof Error&&e.message===`Replace or clear the stored credential before renaming this MCP server.`){o(e.message);return}o(u(e)||r(d.ERROR$GENERIC))};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(T,{onClose:M?void 0:n,closeOnEscape:!M,"aria-label":r(A?d.MCP$EDIT_CUSTOM_TITLE:d.MCP$ADD_CUSTOM_TITLE),children:(0,Z.jsxs)(`div`,{"data-testid":`mcp-custom-editor`,className:`relative bg-base-secondary p-6 rounded-xl border border-[var(--oh-border)] w-[520px] max-w-[90vw] max-h-[90vh] overflow-y-auto custom-scrollbar`,children:[(0,Z.jsx)(te,{onClose:n,testId:`mcp-custom-editor-close`,disabled:M}),(0,Z.jsx)(`h2`,{className:f(`mb-4 pr-6`,ee),children:r(A?d.MCP$EDIT_CUSTOM_TITLE:d.MCP$ADD_CUSTOM_TITLE)}),(0,Z.jsx)(we,{mode:A?`edit`:`add`,server:A?e:void 0,existingServers:t,onSubmit:t=>{if(b(),w(null),t.auth?.strategy===`oauth2`){D(!0),P.authorizeOAuth(t).then(r=>{if(w(r),!r.ok)return;let i=r.oauth_state?{...t,auth:{...t.auth,state:r.oauth_state}}:t,o=()=>{F(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:L}):a(i,{onSuccess:o,onError:L})}).catch(L).finally(()=>D(!1));return}_(t,{onSuccess:r=>{if(!r.ok)return;let i=r.oauth_state&&t.auth?.strategy===`oauth2`?{...t,auth:{...t.auth,state:r.oauth_state}}:t,o=()=>{F(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:L}):a(i,{onSuccess:o,onError:L})},onError:L})},onCancel:n,onDelete:A?()=>S(!0):void 0,isActionDisabled:j,onTest:k?void 0:e=>{if(w(null),e.auth?.strategy===`oauth2`&&!k){D(!0),P.authorizeOAuth(e).then(w).catch(L).finally(()=>D(!1));return}_(e)},isTestPending:v||E,testMessage:k?null:N})]})}),x?(0,Z.jsx)(ne,{text:r(d.SETTINGS$MCP_CONFIRM_DELETE),onCancel:()=>S(!1),onConfirm:()=>{h(e,{onSuccess:()=>{s(r(d.MCP$REMOVE_SUCCESS)),S(!1),n()},onError:e=>{L(e),S(!1)}})},isConfirming:g}):null]})}var Ee=[`all`,`installed`,`library`],De={all:d.MCP$SECTION_FILTER_ALL,installed:d.MCP$INSTALLED_TITLE,library:d.MCP$LIBRARY_TITLE};function Oe({value:e,onChange:t}){return(0,Z.jsx)(ce,{testId:`mcp-section-filter`,value:e,onChange:t,options:Ee,labelKeyByValue:De})}function ke({search:e,onSearchChange:t,sectionFilter:n,onSectionFilterChange:r}){let{t:a}=i(`openhands`);return(0,Z.jsxs)(`div`,{"data-testid":`mcp-toolbar`,className:`flex items-stretch gap-2`,children:[(0,Z.jsxs)(`div`,{"data-testid":`mcp-search`,className:f(`relative flex flex-1 min-w-0 items-center`,`rounded-lg border border-[var(--oh-border)] bg-base-secondary`,`focus-within:border-white/40 focus-within:ring-1 focus-within:ring-white/20`,`transition-colors`),children:[(0,Z.jsx)(m,{className:`ml-3 h-4 w-4 text-tertiary-alt shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:a(d.MCP$SEARCH_PLACEHOLDER),"aria-label":a(d.MCP$SEARCH_PLACEHOLDER),"data-testid":`mcp-search-input`,className:f(`flex-1 min-w-0 bg-transparent border-0 outline-none`,`px-3 py-2 text-sm placeholder:text-tertiary-alt`,`[&::-webkit-search-cancel-button]:hidden`)}),e?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":a(d.MCP$SEARCH_CLEAR),"data-testid":`mcp-search-clear`,className:`mr-2 p-1 rounded text-tertiary-alt hover:text-content-1 cursor-pointer`,children:(0,Z.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0})}):null]}),(0,Z.jsx)(Oe,{value:n,onChange:r})]})}export{Q as a,xe as i,Te as n,le as o,Ce as r,ke as t};
@@ -0,0 +1,41 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{M as t,N as n,St as r,j as i,yt as a}from"./vendor-styling-Ck5D_A2Q.js";import{n as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-rfV8mQ9m.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js";import{D as c,_ as l}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js";import{t as u}from"./useMutation-B-qc391N.js";import{t as d}from"./useQuery-BSTgq1rl.js";import{t as f}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-BWir3rJs.js";import{Ft as p,Jt as m,ht as h,it as g,n as _,pt as v,tt as ee,ut as te}from"./active-backend-context-CrHTlgvN.js";import{O as y,R as b,W as x,k as S,t as C}from"./utils-CN5ZfZy1.js";import{t as w}from"./chevron-down-e1QBpjVy.js";import{t as T}from"./chevron-right-ZG4R5G4Q.js";import{t as E}from"./loader-circle-CC1au6hc.js";import{i as ne}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~nj1hli3r-DP9wmsjo.js";import{t as re}from"./proxy-9Fe1v5na.js";import{t as ie}from"./use-config-A9QovgXO.js";import{n as D}from"./use-settings-DSXLbvBl.js";import{n as ae,o as oe}from"./form-control-classes-Bkh5FGrD.js";import{n as se}from"./navigation-context-CQZwH_tC.js";import{ot as ce,st as le}from"./vendor-markdown-j0kYzV48.js";import{t as ue}from"./styled-tooltip-C4jf5Fv9.js";import{_ as de,t as fe}from"./conversation-store-Ca3ghXap.js";import{c as pe,d as me,t as he,v as ge}from"./agent-server-conversation-service.api-tnqNjbpE.js";import{_ as _e,a as ve,h as ye,o as be,p as xe,r as Se,s as Ce}from"./conversation-state-store-B0ImPLHO.js";import{n as we}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js";import{t as Te}from"./skills-B0IliMxw.js";import{r as Ee}from"./format-model-name-CasAP3nd.js";import{t as De}from"./close-ScPlnwyq.js";import{t as Oe}from"./copy-to-clipboard-button-Ca8iSkkA.js";import{r as O}from"./typography-v1KN0tzi.js";import{t as ke}from"./u-check-circle-BKn1spCL.js";import{A as Ae,B as je,C as Me,F as Ne,H as k,L as Pe,M as A,N as Fe,O as Ie,Q as Le,T as Re,U as ze,W as Be,Z as Ve,_ as He,a as Ue,b as We,c as Ge,et as j,g as Ke,i as qe,j as Je,k as Ye,n as Xe,o as Ze,q as Qe,r as $e,t as M,v as N,z as et}from"./markdown-renderer-BzTlxI8x.js";import{t as tt}from"./syntax-highlighter-BGDg_7w9.js";import{n as nt,t as rt}from"./get-git-path-ChKDVHZp.js";var it=c(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(r(),1);function at(){!t.current&&i();let[e]=(0,P.useState)(n.current);return e}var F=a(),ot=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}(ot||{});function st(){let{conversationId:e}=j(),t=Ge();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 ct(e,t,n,r){return{action:ot.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 lt({status:e}){return(0,F.jsx)(`span`,{className:`flex-shrink-0`,children:e===`timeout`&&(0,F.jsx)(we,{"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:c}=s(`openhands`),[l,u]=P.useState(r),d=t?(0,F.jsx)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`cursor-pointer text-left`,"aria-label":c(l?x.BUTTON$COLLAPSE:x.BUTTON$EXPAND),children:l?(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`&&d,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&d]}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(lt,{status:n})]})]}),l&&(typeof t==`string`?(0,F.jsx)(M,{children:t}):t)]})}var ut=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`})}),dt=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`})}),ft={running:x.GOAL$STATUS_RUNNING,complete:x.GOAL$STATUS_COMPLETE,capped:x.GOAL$STATUS_CAPPED,interrupted:x.GOAL$STATUS_INTERRUPTED};function pt({status:e}){let{t}=s(`openhands`),{conversationId:n}=j(),r=We(e=>n?!!e.statusByConversation[n]?.active:!1),[i,a]=(0,P.useState)(!1),{active:o,objective:c,iteration:l,max_iterations:u,verdict:d}=e,f=d?Math.round(d.score*100):null,m=d?.missing?t(x.GOAL$MISSING,{missing:d.missing}):``,h=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){p(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},g=()=>h(async e=>{await _e(e),await xe(e)},x.GOAL$STOP_FAILED),_=()=>h(ye,x.GOAL$RESUME_FAILED),v=null;return n&&o?v=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:g,className:C(ae,oe),children:t(x.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(v=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:_,className:C(ae,oe),children:t(x.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(x.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:c}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(x.GOAL$ROUND,{iteration:l,max:u})}),(0,F.jsx)(`span`,{children:t(ft[e.status])}),f!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(x.GOAL$SCORE,{score:f})}),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)(ut,{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)(dt,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:v,details:m,initiallyExpanded:!o,chevronPosition:`before`})})}var mt=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 ht({profile:e}){let[t,n]=P.useState(!1),r=Ee(e.model);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)(w,{size:14}):(0,F.jsx)(T,{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: ${r??`—`}\nbase_url: ${e.base_url??`—`}\napi_key: ${e.api_key_set?`set`:`not set`}`})]})]})}function gt({conversationId:e,anchorEventId:t}){let n=He(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)(mt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(f,{i18nKey:x.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)(f,{i18nKey:x.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(f,{i18nKey:x.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)(f,{i18nKey:x.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(ht,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function _t(e){let[t,n]=(0,P.useState)(!0),[r,i]=(0,P.useState)(!0),a=(0,P.useRef)(0),o=(0,P.useCallback)(e=>e.scrollTop+e.clientHeight>=e.scrollHeight-20,[]),s=(0,P.useCallback)(e=>{let t=o(e);i(t);let r=e.scrollTop,s=r<a.current;a.current=r,s&&n(!1),t&&n(!0)},[o]);return{scrollRef:e,autoScroll:t,setAutoScroll:n,scrollDomToBottom:(0,P.useCallback)(()=>{let t=e.current;t&&requestAnimationFrame(()=>{n(!0),i(!0),t.scrollTop=t.scrollHeight})},[e]),hitBottom:r,setHitBottom:i,onChatBodyScroll:s}}var vt=(0,P.createContext)(void 0);function yt({children:e,value:t}){let n=_t(P.useRef(null)),r=t||n;return(0,F.jsx)(vt.Provider,{value:r,children:e})}function bt(){let e=(0,P.useContext)(vt);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function xt(){return(0,P.useContext)(vt)}var St=class{static async executeCommand(e,t,n,r,i=30){let a=te().backend;if(a.kind===`cloud`&&e){let o=await re({backend:a,method:`POST`,hostOverride:g(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new ne(ee({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=te().backend;return r.kind===`cloud`&&e?(await re({backend:r,method:`GET`,hostOverride:g(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new l(ee({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}},Ct=2e3,wt=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function Tt(){return`find . \\( ${wt.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Ct}`}function Et(e){return e.startsWith(`./`)?e.slice(2):e}function Dt(e){let{data:t}=Le(),n=nt(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),s=d({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await St.executeCommand(i,a,Tt(),o,30);if(e.exit_code!==0)throw Error(e.stderr?.trim()||`Failed to list workspace files`);let t=e.stdout.split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(Et);return Array.from(new Set(t)).slice(0,Ct)},enabled:e&&n&&!!r&&!!o,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:s.data,isLoading:s.isLoading}}function Ot(e){let{conversationId:t}=j(),{data:n}=Le(),r=nt(),i=n?.selected_repository,a=n?.workspace?.working_dir?.trim(),o=rt(i,a),s=o.startsWith(`/`)?o:`/${o}`,c=d({queryKey:[`workspace-files-cloud`,t,s],queryFn:async()=>{let e=(await ge(t,s)).map(Et).filter(Boolean);return Array.from(new Set(e)).slice(0,Ct)},enabled:e&&r&&!!t,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function kt(){let e=(0,P.useSyncExternalStore)(h,v,v).active.backend.kind===`cloud`,t=Dt(!e),n=Ot(e);return e?n:t}var At=(0,P.createContext)(!1),jt=(0,P.createContext)(void 0);function Mt({children:e}){let{data:t}=kt();return(0,F.jsx)(jt.Provider,{value:t,children:e})}function Nt(e){if(e==null||typeof e==`boolean`)return``;if(typeof e==`string`||typeof e==`number`)return String(e);if(Array.isArray(e)){let t=e.map(Nt);return t.some(e=>e===null)?null:t.join(``)}return null}function Pt(e){let t=(0,P.useContext)(jt);if(!t?.length||!Se(e))return null;let n=Ce.getCurrentConversation()?.workspace?.working_dir,r=ve(e,n);return r&&t.includes(r)?r:null}function Ft({path:e,className:t,children:n}){let{conversationId:r}=j();return(0,F.jsx)(`button`,{type:`button`,"data-testid":`markdown-file-path-link`,title:e,className:C(t,`cursor-pointer rounded border border-surface-raised bg-surface-raised px-[0.4em] py-[0.2em] font-mono text-foreground hover:underline`),onClick:t=>{t.stopPropagation(),N(e,r)},children:n})}function It(e){let{children:t,className:n}=e,r=(0,P.useContext)(At),i=/language-(\w+)/.exec(n||``),a=String(t).replace(/\n$/,``),o=String(t).includes(`
2
+ `),s=Pt(!i&&!o&&!r?a:``);return s?(0,F.jsx)(Ft,{path:s,className:n,children:t}):$e(e)}function Lt(e){let{children:t}=e,n=(0,P.useContext)(At),r=Nt(t)?.trim()??``,i=Pt(n?``:r);return i?(0,F.jsx)(Ft,{path:i,children:t}):(0,F.jsx)(`strong`,{children:t})}function Rt(e){return(0,F.jsx)(At.Provider,{value:!0,children:Xe(e)})}var z=1e3,zt=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,Bt=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`}},Vt={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},Ht=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=Vt[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},Ut=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Wt=e=>e.length>1e3?`${e.slice(0,z)}...`:e,Gt=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=Ut(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Wt(Ut(r).trim()),s=i?`**Error:**`:`Output:`,c=o||m.t(x.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a},B=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,Kt=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),qt=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||Kt(t)?null:t},Jt=e=>{let t=qt(e);if(t)return{kind:`text`,text:t};let n=e.action.kind;switch(n){case`ExecuteBashAction`:case`TerminalAction`:return{kind:`translation`,key:`ACTION_MESSAGE$RUN`,values:{command:B(e.action.command,80)}};case`FileEditorAction`:case`StrReplaceEditorAction`:return{kind:`translation`,key:e.action.command===`view`?`ACTION_MESSAGE$READ`:e.action.command===`create`?`ACTION_MESSAGE$WRITE`:`ACTION_MESSAGE$EDIT`,values:{path:e.action.path}};case`MCPToolAction`:return{kind:`translation`,key:`ACTION_MESSAGE$CALL_TOOL_MCP`,values:{mcp_tool_name:e.tool_name}};case`InvokeSkillAction`:return{kind:`translation`,key:`ACTION_MESSAGE$INVOKE_SKILL`,values:{name:e.action.name}};case`TaskAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK`,values:{name:e.action.subagent_type}};case`ThinkAction`:return{kind:`translation`,key:`ACTION_MESSAGE$THINK`,values:{}};case`FinishAction`:return{kind:`translation`,key:`ACTION_MESSAGE$FINISH`,values:{}};case`TaskTrackerAction`:return{kind:`translation`,key:`ACTION_MESSAGE$TASK_TRACKING`,values:{}};case`GrepAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GREP`,values:{pattern:e.action.pattern?B(e.action.pattern,50):``}};case`GlobAction`:return{kind:`translation`,key:`ACTION_MESSAGE$GLOB`,values:{pattern:e.action.pattern?B(e.action.pattern,50):``}};case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return{kind:`translation`,key:`ACTION_MESSAGE$BROWSE`,values:{}};case`CanvasUIAction`:case me:return{kind:`text`,text:`CANVASUI`};case pe:return{kind:`translation`,key:`ACTION_MESSAGE$LAUNCH_CHILD_CONVERSATION`,values:{}};default:return{kind:`text`,text:String(n).replace(`Action`,``).toUpperCase()}}},Yt=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)}},Xt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function Zt(e){let{children:t}=e,n=e=>{try{return Xt(e)}catch(t){return Yt.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 Qt=(0,P.createContext)(!0),$t=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},en=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,tn=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return en(e)&&!n.endsWith(`/`)?`${n}/`:n};function nn(e){let{children:t}=e,{conversationId:n}=j(),r=(0,P.useContext)(Qt),i=e=>{try{let t=$t(e),i=tn(t);return r?(0,F.jsx)(`button`,{type:`button`,"data-testid":`path-component-link`,className:`cursor-pointer font-mono font-normal tracking-tight hover:underline`,title:t,onClick:e=>{e.stopPropagation(),N(t,n)},children:i}):(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,title:t,children:i})}catch(t){return Yt.error(String(t)),(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:e})}};return Array.isArray(t)?(0,F.jsx)(`span`,{className:`font-normal tracking-tight`,children:t.map((e,t)=>typeof e==`string`?(0,F.jsx)(`span`,{children:i(e)},`${e}-${t}`):e)}):typeof t==`string`?(0,F.jsx)(`span`,{className:`font-normal tracking-tight`,children:i(t)}):(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,children:t})}var rn=()=>{let{setConversationMode:e}=fe(),{send:t}=st(),{conversationId:n}=j(),r=Me(e=>e.enqueuePendingMessage),i=Me(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(ct(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},an=`200%`,V=8,on=V*2;function sn({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=at(),c=`oh-text-shimmer-${(0,P.useId)().replace(/:/g,``)}`,l=(0,P.useMemo)(()=>Math.min(V/2-1,1+i/2),[i]),u=(0,P.useMemo)(()=>{let e=V/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) ${V}%)`,backgroundSize:`${an} 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:${on}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:C(`relative inline-block`,n),style:u,...o,children:e})]})}var cn=P.memo(sn);function ln({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 un=5,dn=360,fn={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e}),code:It,a:Rt,strong:Lt};function pn({message:e,isHovering:t,isExpanded:n,onTruncatableChange:r}){let{t:i}=s(`openhands`),a=P.useRef(null),[o,c]=P.useState(!1);P.useEffect(()=>{r(o)},[o,r]),P.useLayoutEffect(()=>{let t=a.current;if(!t||n){c(!1);return}let r=()=>{let n=Number.parseFloat(getComputedStyle(t).lineHeight),r=un*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=un||e.trim().length>dn)};r();let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e,n]);let l=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]`,l&&`line-clamp-5`),children:(0,F.jsx)(M,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:fn,children:e})}),l?(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(x.COMMON$VIEW_MORE)})]}):null]})}function H({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onDismiss:c,onStop:l}){let{t:u}=s(`openhands`),[d,f]=P.useState(!1),[p,m]=P.useState(!1),[h,g]=P.useState(!1),[_,v]=P.useState(!1),[ee,te]=P.useState(!0),y=P.useRef(null);P.useEffect(()=>{g(!1)},[t]);let b=async()=>{await navigator.clipboard.writeText(t),m(!0)};P.useEffect(()=>{let e;return p&&(e=setTimeout(()=>{m(!1)},2e3)),()=>{clearTimeout(e)}},[p]);let S=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&l!=null,T=w&&d,E=e===`user`&&a==null,ne=E&&_&&!h,re=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=y.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;te(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)(pn,{message:t,isHovering:d,isExpanded:h,onTruncatableChange:v}):(0,F.jsx)(`div`,{ref:y,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(M,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:fn,children:t})}),D=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:C(`rounded-xl relative w-fit max-w-full flex flex-col`,re&&`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`,!d||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,F.jsx)(ue,{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)(Oe,{isHidden:!d,isDisabled:p,onClick:b,mode:p?`copied`:`copy`})]}),ie,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":u(x.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`,ee?`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)(ln,{className:`block h-7 w-7 max-w-none`})}):null,ne?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":u(x.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:u(x.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:u(x.CHAT_INTERFACE$MESSAGE_RETRY)}):null,c?(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-dismiss`,children:u(x.CHAT_INTERFACE$MESSAGE_DISMISS)}):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)(cn,{as:`p`,role:`status`,"aria-live":`polite`,"data-testid":`chat-message-sending`,className:`block w-full text-sm font-normal`,duration:1,spread:2,children:u(x.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function mn(e){return{h1:({children:t,className:n})=>(0,F.jsx)(`h1`,{className:C(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,F.jsx)(`h2`,{className:C(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,F.jsx)(`h3`,{className:C(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,F.jsx)(`h4`,{className:C(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,F.jsx)(`h5`,{className:C(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,F.jsx)(`h6`,{className:C(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,F.jsx)(`p`,{className:C(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,F.jsx)(`ul`,{className:C(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,F.jsx)(`ol`,{className:C(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,F.jsx)(`li`,{className:C(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,F.jsx)(`a`,{className:C(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,F.jsx)(`code`,{className:C(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var hn=mn(),gn=300,_n=mn(`shine-text`);function vn({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=Ue(),{handleBuildPlanClick:a}=rn(),{scrollDomToBottom:o}=bt(),c=()=>{i(`planner`)},l=(0,P.useCallback)(e=>{a(e),o()},[a,o]),u=(0,P.useMemo)(()=>e?e.length<=gn?e:`${e.slice(0,gn)}...`:``,[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)(Ze,{width:18,height:18,color:`var(--oh-muted)`}),(0,F.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(x.COMMON$PLAN_MD)}),(0,F.jsx)(`div`,{className:`flex-1`}),(0,F.jsxs)(`button`,{type:`button`,onClick:c,className:`flex items-center gap-1 hover:opacity-80 transition-opacity cursor-pointer`,"data-testid":`plan-preview-view-button`,children:[(0,F.jsx)(O.Text,{className:`font-normal text-[11px] text-white tracking-[0.11px] leading-4`,children:r(x.COMMON$VIEW)}),(0,F.jsx)(it,{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:u&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(M,{includeStandard:!0,components:t?_n:hn,children:u}),e&&e.length>gn&&(0,F.jsx)(`button`,{type:`button`,onClick:c,className:`text-[#4a67bd] cursor-pointer hover:underline text-left`,"data-testid":`plan-preview-read-more-button`,children:r(x.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:l,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)(O.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(x.COMMON$BUILD),` `,(0,F.jsx)(O.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function yn({errorId:e,defaultMessage:t}){let{t:n}=s(`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&&m.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)(M,{children:t})]})}function bn({event:e}){return Fe(e)?(0,F.jsx)(yn,{errorId:e.id,defaultMessage:e.error}):null}function xn({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 Sn({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 Cn({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)(De,{width:18,height:18})})}function wn({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 Tn({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)(wn,{src:e,size:n}),t&&(0,F.jsx)(Cn,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function En({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)(xn,{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)(Tn,{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)(Sn,{active:!c})})]})}function Dn({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?x.ACTION$CONFIRM:x.ACTION$REJECT),a=n(r?x.CHAT_INTERFACE$USER_CONFIRMED:x.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(x.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(x.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ue,{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 On({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 kn=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`})]}),An=de(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),jn=()=>u({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return Ke.respondToConfirmation(e,t,i,n)}});function Mn(){let e=An(e=>e.submittedEventIds),t=An(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=Le(),{curAgentState:i}=Ve(),{mutate:a}=jn(),o=Re(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===S.AWAITING_USER_CONFIRMATION:!1),c=(0,P.useCallback)(e=>{!o||!r||(o.id&&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(),c(!1))},t=e=>{e.metaKey&&e.key===`Enter`&&(e.preventDefault(),c(!0))},n=n=>{e(n),t(n)};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[o,c]),i!==S.AWAITING_USER_CONFIRMATION||!o||o.id!==void 0&&e.includes(o.id)?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 pt-4`,children:[(A(o)?o.security_risk:y.UNKNOWN)===y.HIGH&&(0,F.jsx)(On,{content:n(x.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(kn,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(x.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(x.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Dn,{type:`reject`,onClick:()=>c(!1)}),(0,F.jsx)(Dn,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var Nn=e=>{let t=e.llm_message;if(!t?.content)return``;let n=``;if(t.content&&(Array.isArray(t.content)?n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
3
+ `):typeof t.content==`string`&&(n=t.content)),!(Array.isArray(t.content)&&t.content.some(e=>e.type===`image`)))return n;let r=m.t(x.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function Pn(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Fn(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function In(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Ln(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Rn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function zn(e){let t=e?.verification;if(!Rn(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function Bn({feature:e}){let t=Math.round(e.probability*100),n=Ln(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 U({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)(Bn,{feature:e})]},e.name))]})}function Vn({categorized:e}){let{t}=s(),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)(U,{label:t(x.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(U,{label:t(x.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(U,{label:t(x.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(U,{label:t(x.CRITIC$OTHER),features:e.other})]})}function Hn({criticResult:e}){let{t}=s(),{data:n}=D(),[r,i]=P.useState(!1),a=Pn(e.score),{filled:o,empty:c}=Fn(a),l=In(a),u=(a*100).toFixed(1),d=zn(n?.agent_settings)===!1,f=e.metadata?.categorized_features,p=f!=null&&((f.agent_behavioral_issues??[]).length>0||(f.user_followup_patterns??[]).length>0||(f.infrastructure_issues??[]).length>0||(f.other??[]).length>0);return(0,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(x.CRITIC$SUCCESS_LIKELIHOOD_LABEL)}),(0,F.jsxs)(`span`,{className:`${l} text-xs tracking-wide`,"aria-label":`Score: ${u}%`,children:[`★`.repeat(o),`☆`.repeat(c)]}),(0,F.jsxs)(`span`,{className:`text-neutral-500 text-xs`,children:[`(`,u,`%)`]}),p&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer ml-1`,"aria-label":t(r?x.BUTTON$COLLAPSE_DETAILS:x.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&&p&&(0,F.jsx)(Vn,{categorized:f}),d&&(0,F.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-neutral-500`,"data-testid":`critic-iterative-refinement-hint`,children:t(x.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var Un=e=>(0,F.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{d:`M11.3931 1.88021C10.78 1.37593 10.062 1.01489 9.29157 0.823438C8.52113 0.631981 7.71767 0.614934 6.9398 0.773542C5.90405 0.982756 4.95379 1.49492 4.20959 2.24506C3.46538 2.9952 2.96078 3.9495 2.7598 4.98688C2.61303 5.76469 2.6397 6.56531 2.83791 7.33163C3.03611 8.09795 3.40097 8.8111 3.90647 9.42021C4.37559 9.94959 4.64449 10.6266 4.66647 11.3335V13.3335C4.66647 13.864 4.87718 14.3727 5.25225 14.7478C5.62732 15.1228 6.13603 15.3335 6.66647 15.3335H9.33313C9.86356 15.3335 10.3723 15.1228 10.7473 14.7478C11.1224 14.3727 11.3331 13.864 11.3331 13.3335V11.4602C11.3555 10.6797 11.6423 9.92983 12.1465 9.33354C13.0299 8.24073 13.4463 6.84342 13.3052 5.44529C13.1642 4.04716 12.477 2.7612 11.3931 1.86687V1.88021ZM9.9998 13.3335C9.9998 13.5104 9.92956 13.6799 9.80454 13.8049C9.67951 13.93 9.50994 14.0002 9.33313 14.0002H6.66647C6.48965 14.0002 6.32009 13.93 6.19506 13.8049C6.07004 13.6799 5.9998 13.5104 5.9998 13.3335V12.6669H9.9998V13.3335ZM11.1131 8.50688C10.4428 9.30194 10.0517 10.2949 9.9998 11.3335H8.66647V9.33354C8.66647 9.15673 8.59623 8.98716 8.4712 8.86214C8.34618 8.73711 8.17661 8.66688 7.9998 8.66688C7.82299 8.66688 7.65342 8.73711 7.52839 8.86214C7.40337 8.98716 7.33313 9.15673 7.33313 9.33354V11.3335H5.9998C5.98221 10.3123 5.60443 9.33005 4.93313 8.56021C4.49023 8.02954 4.19239 7.39316 4.06867 6.71311C3.94495 6.03306 3.99957 5.33255 4.22719 4.6799C4.45481 4.02724 4.84768 3.4447 5.36748 2.98909C5.88728 2.53348 6.51627 2.22034 7.19313 2.08021C7.77483 1.96044 8.37591 1.9717 8.95271 2.11319C9.52952 2.25467 10.0676 2.52282 10.5278 2.89818C10.9881 3.27353 11.359 3.74666 11.6136 4.28322C11.8682 4.81978 12.0001 5.4063 11.9998 6.00021C12.0047 6.91345 11.6912 7.79985 11.1131 8.50688Z`,fill:`currentColor`})});function W({content:e}){let{t}=s(`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?x.THINKING$COLLAPSE:x.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)(Un,{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(x.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(M,{children:e})})]})}var Wn=()=>{let e=o();return u({mutationKey:[`fork-conversation`],mutationFn:async({sourceConversationId:e,eventId:t,editText:n,title:r})=>{let i=t,a=!1;if(n!=null){let n=await he.getEventParentId(e,t);n&&(i=n,a=!0)}let o=await he.forkConversation(e,i,r);return a&&o.leaf_event_id!==i&&(a=!1),{info:o,excluded:a}},onSuccess:()=>{e.invalidateQueries({queryKey:[`user`,`conversations`]})}})};function Gn({event:e,isLastMessage:t,isFromPlanningAgent:n}){let{t:r}=s(`openhands`),{navigate:i}=se(),{conversationId:a}=j(),o=_().backend.kind===`cloud`,{mutate:c,isPending:l}=Wn(),u=fe(e=>e.setMessageToSend),d=P.useRef(!1),f=Nn(e),{reasoning:m,message:h}=e.source===`agent`?Ae(f):{reasoning:``,message:f},g=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&g.push(...e.image_urls)});let v=!o&&a?[{icon:(0,F.jsx)(be,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!a||l||d.current)return;d.current=!0;let t=Ce.getCurrentConversation(),n=t?.id===a?t.title:void 0,r=n?`${n} (branch)`:void 0,o=e.source===`user`&&h.length>0;c({sourceConversationId:a,eventId:e.id,...o?{editText:h}:{},...r?{title:r}:{}},{onSuccess:({info:e,excluded:t})=>{i(`/conversations/${e.id}`),t&&window.setTimeout(()=>u(h),0)},onError:e=>p(e instanceof Error?e.message:null),onSettled:()=>{d.current=!1}})},tooltip:r(x.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[m&&(0,F.jsx)(W,{content:m}),(0,F.jsxs)(H,{type:e.source,message:h,isFromPlanningAgent:n,actions:v,children:[g.length>0&&(0,F.jsx)(En,{size:`small`,images:g}),t&&(0,F.jsx)(Mn,{})]}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Hn,{criticResult:e.critic_result})]})}var Kn=e=>{switch(e){case y.LOW:return m.t(x.SECURITY$LOW_RISK);case y.MEDIUM:return m.t(x.SECURITY$MEDIUM_RISK);case y.HIGH:return m.t(x.SECURITY$HIGH_RISK);case y.UNKNOWN:default:return m.t(x.SECURITY$UNKNOWN_RISK)}},G=()=>``,qn=e=>e.name?`**Skill:** \`${e.name}\``:G(),Jn=e=>{let{action:t}=e,n=[];return t.pattern&&n.push(`**Pattern:** \`${t.pattern}\``),t.path&&n.push(`**Path:** \`${t.path}\``),`include`in t&&t.include&&n.push(`**Include:** \`${t.include}\``),n.length>0?n.join(`
4
+ `):G()},Yn=e=>{if(e.command!==`create`||!e.file_text)return G();let t=e.file_text;return t.length>1e3&&(t=`${t.slice(0,z)}...`),`${e.path}\n${t}`},Xn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===y.HIGH||e.security_risk===y.MEDIUM)&&(t+=`\n\n${Kn(e.security_risk)}`),t},Zn=e=>{let t=`**MCP Tool Call**
5
+
6
+ `;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},Qn=e=>e.thought,$n=e=>e.message.trim(),er=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+=`
7
+
8
+ **Task List:** Empty`),t},tr=e=>{switch(e.kind){case`BrowserNavigateAction`:{let t=`Browsing ${e.url}`;return e.new_tab&&(t+=`
9
+ **New Tab:** Yes`),t}case`BrowserClickAction`:{let t=`**Element Index:** ${e.index}`;return e.new_tab&&(t+=`
10
+ **New Tab:** Yes`),t}case`BrowserTypeAction`:{let t=e.text.length>50?`${e.text.slice(0,50)}...`:e.text;return`**Element Index:** ${e.index}\n**Text:** ${t}`}case`BrowserGetStateAction`:return e.include_screenshot?`**Include Screenshot:** Yes`:G();case`BrowserGetContentAction`:{let t=[];return e.extract_links&&t.push(`**Extract Links:** Yes`),e.start_from_char>0&&t.push(`**Start From Character:** ${e.start_from_char}`),t.length>0?t.join(`
11
+ `):G()}case`BrowserScrollAction`:return`**Direction:** ${e.direction}`;case`BrowserGoBackAction`:return G();case`BrowserListTabsAction`:return G();case`BrowserSwitchTabAction`:return`**Tab ID:** ${e.tab_id}`;case`BrowserCloseTabAction`:return`**Tab ID:** ${e.tab_id}`;default:return G()}},nr=e=>{let{action:t}=e;switch(t.kind){case`FileEditorAction`:case`StrReplaceEditorAction`:return Yn(t);case`ExecuteBashAction`:case`TerminalAction`:return Xn(e);case`MCPToolAction`:return Zn(t);case`ThinkAction`:return Qn(t);case`FinishAction`:return $n(t);case`TaskTrackerAction`:return er(t);case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return tr(t);case`GrepAction`:case`GlobAction`:return Jn(e);case`InvokeSkillAction`:return qn(t);default:return zt(e)}},rr=e=>{if(e.is_error||e.status===`failed`)return`error`;if(e.status===`completed`)return`success`},ir=e=>{let{observation:t}=e;switch(t.kind){case`ExecuteBashObservation`:{let e=t.exit_code,{metadata:n}=t;return e===-1||n.exit_code===-1?`timeout`:e===0||n.exit_code===0?`success`:`error`}case`TerminalObservation`:{let e=t.exit_code??t.metadata.exit_code??null;return t.timeout||e===-1?`timeout`:e===0?`success`:t.is_error?`error`:`success`}case`FileEditorObservation`:case`StrReplaceEditorObservation`:return t.error?`error`:`success`;case`MCPToolObservation`:return t.is_error?`error`:`success`;case`SwitchLLMObservation`:return t.is_error?`error`:`success`;case`InvokeSkillObservation`:return t.is_error?`error`:`success`;case`TaskObservation`:return t.is_error||t.status===`failed`?`error`:`success`;case`CanvasUIObservation`:return t.is_error?`error`:`success`;default:return`success`}},ar=e=>{let{observation:t}=e;if(t.error)return`**Error:**\n${t.error}`;let n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
12
+ `):null;return ir(e)===`success`&&`old_content`in t&&`new_content`in t&&t.old_content&&t.new_content||t.command===`view`?`\`\`\`\n${n||t.output}\n\`\`\``:n||t.output},or=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
13
+ `)||``;n.length>1e3&&(n=`${n.slice(0,z)}...`);let r=``;return t.command&&(r+=`Command: \`${t.command}\`\n\n`),r+=`Output:\n\`\`\`sh\n${n.trim()||m.t(x.OBSERVATION$COMMAND_NO_OUTPUT)}\n\`\`\``,r},sr=e=>{let{observation:t}=e,n=`content`in t&&Array.isArray(t.content)?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
14
+ `):t.output||``,r=``;return t.error?r+=`**Error:**\n${t.error}`:n?r+=`**Output:**\n${n}`:r+=`Browser action completed successfully.`,r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},cr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
15
+ `),r=`**Tool:** ${t.tool_name}\n\n`;return t.is_error?r+=`**Error:**\n${n}`:r+=`**Result:**\n${n}`,r.length>1e3&&(r=`${r.slice(0,z)}...`),r},lr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
16
+ `),r=`${t.skill_name?`**Skill:** \`${t.skill_name}\`\n\n`:``}${t.is_error?`**Error:**\n${n}`:n}`;return r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},ur=e=>e.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
17
+ `),dr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
18
+ `);if(t.is_error)return n?`**Error:**\n${n}`:`**Error:**\nFailed to switch LLM profile \`${t.profile_name}\`.`;let r=[`**Profile:** \`${t.profile_name}\``];return t.active_model&&r.push(`**Active model:** \`${t.active_model}\``),t.reason&&r.push(`**Reason:** ${t.reason}`),r.join(`
19
+ `)},fr=e=>{let{observation:t}=e,{command:n,task_list:r}=t,i=`**Command:** \`${n}\``;return n===`plan`&&r.length>0?(i+=`\n\n**Task List (${r.length} ${r.length===1?`item`:`items`}):**\n`,r.forEach((e,t)=>{let n={todo:`⏳`,in_progress:`🔄`,done:`✅`}[e.status]||`❓`;i+=`\n${t+1}. ${n} **[${e.status.toUpperCase().replace(`_`,` `)}]** ${e.title}`,e.notes&&(i+=`\n *Notes: ${e.notes}*`)})):n===`plan`&&(i+=`
20
+
21
+ **Task List:** Empty`),`content`in t&&t.content&&typeof t.content==`string`&&t.content.trim()&&(i+=`\n\n**Result:** ${t.content.trim()}`),i},pr=e=>{let{observation:t}=e;return t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
22
+ `)||``},mr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
23
+ `),r=``;return t.is_error?r+=`**Error:**\n${n}`:r+=n,r},hr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
24
+ `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n\n`,t.is_error?r+=`**Error:**\n${n}`:t.files.length===0?r+=`**Result:** No files found.`:(r+=`**Files Found (${t.files.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.files.map(e=>`- \`${e}\``).join(`
25
+ `)),r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},gr=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
26
+ `),r=`**Pattern:** \`${t.pattern}\`\n`;return r+=`**Search Path:** \`${t.search_path}\`\n`,t.include_pattern&&(r+=`**Include:** \`${t.include_pattern}\`\n`),r+=`
27
+ `,t.is_error?r+=`**Error:**\n${n}`:t.matches.length===0?r+=`**Result:** No matches found.`:(r+=`**Matches (${t.matches.length}${t.truncated?`+, truncated`:``}):**\n`,r+=t.matches.map(e=>`- \`${e}\``).join(`
28
+ `)),r.length>1e3&&(r=`${r.slice(0,z)}...(truncated)`),r},_r=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return ar(e);case`ExecuteBashObservation`:case`TerminalObservation`:return or(e);case`BrowserObservation`:return sr(e);case`MCPToolObservation`:return cr(e);case`TaskTrackerObservation`:return fr(e);case`ThinkObservation`:return pr(e);case`FinishObservation`:return mr(e);case`GlobObservation`:return hr(e);case`GrepObservation`:return gr(e);case`InvokeSkillObservation`:return lr(e);case`CanvasUIObservation`:return ur(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?ur(e):zt(e);case`SwitchLLMObservation`:return dr(e);default:return zt(e)}},vr=e=>(0,F.jsx)(`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 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z`,fill:`currentColor`})}),yr=e=>(0,F.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,...e,children:[(0,F.jsx)(`path`,{d:`M5.79029 12.9507C5.69629 12.9042 5.59557 12.8843 5.50157 12.8843C5.25314 12.8843 5.01142 13.0238 4.89728 13.2562C4.72942 13.5883 4.87042 13.9868 5.20614 14.1462C5.30014 14.1927 5.40086 14.2127 5.50157 14.2127C5.75 14.2127 5.985 14.0732 6.10586 13.8407C6.15286 13.7477 6.17301 13.6481 6.17301 13.5551C6.17301 13.3027 6.03201 13.0636 5.79029 12.9507ZM13.3641 12.3463C13.3641 12.3463 13.3909 12.333 13.3977 12.3198C13.4178 12.2998 13.4312 12.2733 13.4447 12.2533C13.4245 12.2865 13.3977 12.3198 13.3641 12.3463ZM3.91698 11.463C3.7827 11.2969 3.58798 11.2106 3.39326 11.2106C3.24555 11.2106 3.09783 11.2637 2.97697 11.3567C2.68154 11.5892 2.63454 12.0076 2.86283 12.2932C2.99712 12.4592 3.19183 12.5456 3.39326 12.5456C3.54098 12.5456 3.68869 12.4924 3.80955 12.3995C3.97741 12.2666 4.0647 12.074 4.0647 11.8814C4.0647 11.7353 4.0177 11.5892 3.91698 11.463ZM2.88297 9.32433C2.80911 9.01881 2.53382 8.80627 2.23168 8.80627C2.18468 8.80627 2.13096 8.81291 2.07725 8.8262C1.71467 8.9059 1.48638 9.26455 1.56696 9.61657C1.64081 9.92873 1.9161 10.1346 2.22496 10.1346C2.27196 10.1346 2.32568 10.1346 2.37268 10.1213C2.68825 10.0549 2.8964 9.77597 2.8964 9.47045C2.8964 9.42395 2.8964 9.37082 2.88297 9.32433ZM2.37939 6.15621C2.33239 6.14293 2.27868 6.14293 2.23168 6.14293C1.92282 6.14293 1.64753 6.34218 1.57367 6.65434C1.4931 7.013 1.71467 7.36501 2.07725 7.45135C2.13096 7.46464 2.17796 7.47128 2.22496 7.47128C2.53382 7.47128 2.80911 7.25874 2.88297 6.95322C2.8964 6.90673 2.8964 6.8536 2.8964 6.8071C2.8964 6.50158 2.69497 6.22263 2.37939 6.15621ZM3.82298 3.87809C3.70212 3.78511 3.55441 3.73197 3.40669 3.73197C3.20526 3.73197 3.01054 3.81831 2.87626 3.98436C2.64797 4.26995 2.69497 4.68838 2.98369 4.92085C3.10454 5.01383 3.25226 5.06696 3.39998 5.06696C3.59469 5.06696 3.79612 4.98062 3.9237 4.81458C4.02441 4.69503 4.07141 4.54227 4.07141 4.39615C4.07141 4.20354 3.99084 4.01093 3.82298 3.87809ZM6.11929 2.45011C6.00515 2.21101 5.76343 2.07153 5.50829 2.07153C5.41428 2.07153 5.31357 2.09146 5.21957 2.13795C4.88385 2.29735 4.74956 2.69586 4.90399 3.0213C5.02485 3.26041 5.25985 3.39988 5.50829 3.39988C5.609 3.39988 5.70972 3.37996 5.80372 3.33347C6.04543 3.22056 6.17972 2.98145 6.17972 2.73571C6.17972 2.63608 6.15958 2.5431 6.11929 2.45011Z`,fill:`currentColor`}),(0,F.jsx)(`path`,{d:`M14.8809 8.14215C14.8809 8.65356 14.8205 9.15834 14.7063 9.64983C14.5251 10.4269 14.2028 11.1708 13.7462 11.8482C13.6589 11.9811 13.5649 12.1073 13.4642 12.2268C13.4642 12.2401 13.4575 12.2468 13.444 12.2534C13.4239 12.2866 13.397 12.3198 13.3635 12.3464C12.7457 13.1102 11.9602 13.7212 11.0604 14.1529C11.047 14.1596 11.0269 14.1662 11.0134 14.1729C10.9194 14.2194 10.8187 14.2658 10.718 14.3057C9.90558 14.6378 9.01928 14.8105 8.1397 14.8105H8.11955C7.74355 14.8038 7.45483 14.5116 7.45483 14.1463C7.45483 13.781 7.75698 13.4821 8.12627 13.4821H8.14641C8.85142 13.4821 9.55643 13.3426 10.2077 13.077C11.047 12.7316 11.7789 12.187 12.3496 11.4896C12.4436 11.37 12.5443 11.2438 12.6316 11.111C12.9942 10.5664 13.256 9.97527 13.397 9.35095C13.397 9.33766 13.397 9.32438 13.397 9.31774C13.4843 8.93252 13.5313 8.54065 13.5313 8.14215C13.5313 7.43812 13.3903 6.75402 13.1218 6.10313C12.927 5.64485 12.6786 5.21978 12.3697 4.83455C12.2422 4.67515 12.1012 4.51575 11.9535 4.36963C11.4499 3.8715 10.859 3.47964 10.201 3.21397C9.55643 2.9483 8.86485 2.81546 8.16655 2.80882H8.13298C7.76369 2.80882 7.46155 2.50994 7.46155 2.14464C7.46155 1.77935 7.76369 1.48047 8.13298 1.48047H8.17327C9.05285 1.48711 9.90557 1.65315 10.7113 1.98524C10.8322 2.03838 10.953 2.08487 11.0672 2.14464C11.0806 2.15129 11.094 2.15793 11.1007 2.15793C11.7722 2.48337 12.3697 2.90845 12.9002 3.43314C13.0815 3.61247 13.256 3.80508 13.4172 4.00434C13.4239 4.01098 13.4239 4.01762 13.4306 4.02426C13.8133 4.49583 14.1222 5.02717 14.3639 5.59171C14.4982 5.91052 14.6056 6.24261 14.6795 6.57469C14.6929 6.62119 14.7063 6.66768 14.7131 6.71417C14.8205 7.17909 14.8742 7.6573 14.8742 8.14215H14.8809Z`,fill:`currentColor`})]});function br({task:e}){let{t}=s(`openhands`),n=(0,P.useMemo)(()=>{switch(e.status){case`todo`:return(0,F.jsx)(vr,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,F.jsx)(yr,{className:`w-4 h-4 text-[#ffffff]`});case`done`:return(0,F.jsx)(ke,{className:`w-4 h-4 text-[var(--oh-muted)]`});default:return(0,F.jsx)(vr,{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)(O.Text,{className:C(`text-[12px] text-white`,r&&`text-[var(--oh-muted)]`),children:e.title}),e.notes&&(0,F.jsxs)(O.Text,{className:`text-[10px] text-[var(--oh-muted)]`,children:[t(x.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function xr({taskList:e}){let{t}=s(`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)(Ze,{className:`shrink-0 w-4.5 h-4.5 text-[var(--oh-muted)]`}),(0,F.jsx)(O.Text,{className:`text-[11px] text-nowrap text-white tracking-[0.11px] font-medium leading-[16px] whitespace-pre`,children:t(x.COMMON$TASKS)})]}),(0,F.jsx)(`div`,{children:e.map((e,t)=>(0,F.jsx)(br,{task:e},`task-${t}`))})]})}function Sr({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)(xr,{taskList:r})})}var Cr=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),wr=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},Tr=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Er=(e,t)=>{let n=`
29
+
30
+ **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=Tr(e,i)}),n},Dr=e=>{let t=`
31
+
32
+ **Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},Or=e=>!e||e.length===0?[]:wr(Cr(e)),kr=(e,t)=>{let n=Or(t);return e&&e.length>0?Er(e,n):n.length>0?Dr(n):``},Ar=(e,t)=>{let n=Or(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()})):[]},K=e=>typeof e==`object`&&!!e&&`_isSkillReadyEvent`in e&&e._isSkillReadyEvent===!0,jr=e=>{let t=e.activated_skills||[],n=e.extended_content||[];if(t.length===0&&n.length===0)throw Error(`Cannot create skill ready event without activated skills or extended content`);let r=kr(t,n),i=Ar(t,n);return{id:`${e.id}-skill-ready`,timestamp:e.timestamp,source:`agent`,_isSkillReadyEvent:!0,_skillReadyContent:r,_skillReadyItems:i}},q=e=>e,J=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
33
+ `);function Mr({code:e,language:t,copy:n=!0,placeholder:r,expandable:i=!1,wrapLongLines:a=!1}){let{t:o}=s(`openhands`),[c,l]=P.useState(!1),u=e.length>z,d=(u&&!(i&&c)?`${e.slice(0,1e3)}…`:e).trim()||r||``,f=n&&e.trim().length>0,p=o(c?x.BUTTON$COLLAPSE:x.BUTTON$EXPAND),m=(0,F.jsx)(ce,{className:`rounded-lg text-xs`,style:le,language:t,PreTag:`div`,wrapLongLines:a,customStyle:a?{whiteSpace:`pre-wrap`}:void 0,codeTagProps:a?{style:{whiteSpace:`pre-wrap`}}:void 0,children:d});return(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[f?(0,F.jsx)(qe,{text:e,children:m}):m,i&&u&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`self-start text-xs text-muted transition-colors hover:text-white hover:underline`,children:p})]})}function Nr({output:e,exitCode:t,copy:n=!0}){let{t:r}=s(`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(x.OBSERVATION$EXIT_CODE,{code:t})}),(0,F.jsx)(Mr,{code:e,language:`bash`,copy:n,placeholder:r(x.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Pr=q({actionKinds:[`ExecuteBashAction`,`TerminalAction`],observationKinds:[`ExecuteBashObservation`,`TerminalObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`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)(Mr,{code:r,language:`bash`}),(i===y.HIGH||i===y.MEDIUM)&&(0,F.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===y.HIGH?x.SECURITY$HIGH_RISK:x.SECURITY$MEDIUM_RISK)}),t&&(0,F.jsx)(Nr,{output:J(t.observation.content),exitCode:t.observation.exit_code})]})}}),Fr=e=>{switch(e.split(`.`).pop()?.toLowerCase()){case`js`:case`jsx`:return`javascript`;case`ts`:case`tsx`:return`typescript`;case`py`:return`python`;case`html`:return`html`;case`css`:return`css`;case`json`:return`json`;case`md`:return`markdown`;case`yml`:case`yaml`:return`yaml`;case`sh`:case`bash`:return`bash`;case`dockerfile`:return`dockerfile`;case`rs`:return`rust`;case`go`:return`go`;case`java`:return`java`;case`cpp`:case`cc`:case`cxx`:return`cpp`;case`c`:return`c`;case`rb`:return`ruby`;case`php`:return`php`;case`sql`:return`sql`;default:return`text`}},Ir=3,Lr=300,Rr=25e4,zr=(e,t)=>{if(e.length*t.length>Rr)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},Br=(e,t)=>{let n=e.split(`
34
+ `),r=t.split(`
35
+ `),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i+=1;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)--a,--o;let s=n.slice(Math.max(0,i-Ir),i),c=n.slice(a,Math.min(n.length,a+Ir));return[...s.map(e=>({type:`ctx`,text:e})),...zr(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},Vr={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},Hr={add:`+ `,del:`- `,ctx:` `};function Ur({oldText:e,newText:t}){let{t:n}=s(`openhands`),r=Br(e,t),i=r.length>Lr;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,Lr):r).map((e,t)=>(0,F.jsx)(`div`,{className:C(`whitespace-pre-wrap px-2`,Vr[e.type]),children:`${Hr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(x.COMMON$TRUNCATED)})]})}function Wr({path:e,range:t,onClick:n}){let{conversationId:r}=j();return(0,F.jsx)(`button`,{type:`button`,"data-testid":`file-path-chip`,title:e,className:`inline-flex max-w-full cursor-pointer items-center gap-1.5 self-start rounded bg-surface-raised px-2 py-0.5 text-left font-mono text-xs text-foreground hover:bg-[var(--oh-interactive-hover)]`,onClick:t=>{if(t.stopPropagation(),n){n();return}N(e,r)},children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(tt,{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 Gr=new Set([`md`,`markdown`,`mdx`]);function Kr(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Gr.has(e.slice(t+1).toLowerCase())}var Y=new Set([`FileEditorAction`,`StrReplaceEditorAction`]),qr=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`]);function Jr(e,t){if(A(e)&&Y.has(e.action.kind))return e.action.path||null;if(k(e)&&qr.has(e.observation.kind)){let n=e.observation.path;if(n)return n;if(t&&Y.has(t.action.kind))return t.action.path||null}return null}function Yr(e,t){if(A(e)&&Y.has(e.action.kind))return e.action.command||null;if(k(e)&&qr.has(e.observation.kind)){let n=e.observation.command;if(n)return n;if(t&&Y.has(t.action.kind))return t.action.command||null}return null}function Xr(e,t){let n=Jr(e,t),r=Yr(e,t);return!!(n&&r===`create`&&Kr(n))}function Zr({content:e,path:t,onView:n}){let{t:r}=s(`openhands`),i=t.split(`/`).pop()||t;return(0,F.jsxs)(`div`,{className:`w-full overflow-hidden rounded-[12px] border border-[var(--oh-border)] bg-[var(--oh-surface)]`,"data-testid":`markdown-file-preview`,children:[(0,F.jsx)(`div`,{"data-testid":`markdown-file-preview-content`,className:`max-h-40 overflow-y-auto px-4 py-3 text-white custom-scrollbar-always [--oh-scroll-fade-from:var(--oh-surface)]`,children:(0,F.jsx)(M,{content:e,includeStandard:!0,includeHeadings:!0,components:hn})}),(0,F.jsxs)(`div`,{className:`flex h-10 items-center justify-between gap-2 border-t border-[var(--oh-border)] px-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(tt,{className:`h-3.5 w-3.5 flex-shrink-0 text-[var(--oh-muted)]`}),(0,F.jsx)(O.Text,{className:`truncate font-mono text-[11px] leading-4 tracking-[0.11px] text-[var(--oh-muted)]`,children:i})]}),n?(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`flex shrink-0 cursor-pointer items-center gap-1 transition-opacity hover:opacity-80`,"data-testid":`markdown-file-preview-view`,children:[(0,F.jsx)(O.Text,{className:`text-[11px] leading-4 tracking-[0.11px] text-white`,children:r(x.COMMON$VIEW)}),(0,F.jsx)(it,{className:`text-white`,size:16})]}):null]})]})}var Qr=({action:e,observation:t})=>t?.observation.path??e?.action.path??``;function $r({action:e,observation:t,onOpenFile:n}){let r=Qr({action:e,observation:t}),i=t?.observation.command??e?.action.command,a=Fr(r),o=e?.action.view_range,s=i===`view`&&o?`${o[0]}-${o[1]}`:void 0,c=r?(0,F.jsx)(Wr,{path:r,range:s,onClick:n}):null,l=e=>r&&i===`create`&&Kr(r)?{chip:null,body:(0,F.jsx)(Zr,{content:e,path:r,onView:n})}:{chip:c,body:(0,F.jsx)(Mr,{code:e,language:a})};if(t){let e=t.observation,n=null,r=c;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)(Ur,{oldText:e.old_content,newText:e.new_content});else{let t=e.new_content||e.output||(e.content?J(e.content):``);if(t){let e=l(t);r=e.chip,n=e.body}}return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}if(e){let t=e.action,n=null,r=c;if(t.command===`create`&&t.file_text){let e=l(t.file_text);r=e.chip,n=e.body}else (t.command===`str_replace`||t.command===`insert`)&&t.new_str!=null&&(n=(0,F.jsx)(Ur,{oldText:t.old_str??``,newText:t.new_str}));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,n]})}return null}function ei({conversationId:e,...t}){let n=Qr(t),r=n&&t.observation?()=>N(n,e):void 0;return(0,F.jsx)($r,{...t,onOpenFile:r})}var ti=q({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function(e){let{conversationId:t}=j();return t?(0,F.jsx)(ei,{...e,conversationId:t}):(0,F.jsx)($r,{...e})}});function ni({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 ri=q({actionKinds:[`GrepAction`,`GlobAction`],observationKinds:[`GrepObservation`,`GlobObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`openhands`),r=t?.observation,i=e?.action,a=r?.pattern??i?.pattern??``,o=r?.search_path??i?.path??``,c=r?`include_pattern`in r?r.include_pattern:null:i&&`include`in i?i.include:null,l=r?`matches`in r?r.matches:r.files:[];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(ni,{rows:[{label:n(x.COMMON$PATTERN),value:a},...o?[{label:n(x.COMMON$PATH),value:o}]:[],...c?[{label:n(x.COMMON$INCLUDE),value:c}]:[]]}),r&&(r.is_error?(0,F.jsx)(`span`,{className:`whitespace-pre-wrap text-xs text-danger`,children:J(r.content)}):l.length===0?(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(x.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(x.COMMON$RESULTS,{count:l.length})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-0.5 font-mono text-xs text-foreground`,children:l.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(x.COMMON$TRUNCATED)})]}))]})}});function ii({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)(qe,{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)(M,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var ai=[Pr,ti,ri,q({actionKinds:[`TaskAction`],observationKinds:[`TaskObservation`],Body:function({action:e,observation:t}){let{t:n}=s(`openhands`),r=e?.action,i=t?.observation,a=i?.subagent??r?.subagent_type??``,o=i?.task_id,c=r?.prompt?.trim()??``,l=i?J(i.content).trim():``,u=[...a?[{label:n(x.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(x.TASK$TASK_ID),value:o}]:[]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[u.length>0&&(0,F.jsx)(ni,{rows:u}),c&&(0,F.jsx)(ii,{label:n(x.TASK$QUERY),text:c}),l&&(0,F.jsx)(ii,{label:n(x.TASK$RESULT),text:l,isError:i?.is_error})]})}})],oi=e=>new Map(ai.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),si=oi(e=>e.actionKinds),ci=oi(e=>e.observationKinds);function li(e,t){if(A(e)){let t=si.get(e.action.kind);if(t)return(0,F.jsx)(t.Body,{action:e})}else if(k(e)){let n=ci.get(e.observation.kind);if(n)return(0,F.jsx)(n.Body,{action:t,observation:e})}return null}var X=(e,t)=>m.exists(e)?(0,F.jsx)(f,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,F.jsx)(nn,{}),cmd:(0,F.jsx)(Zt,{})}}):e,ui=e=>e.kind===`text`?e.text:X(e.key,e.values),Z=(e,t)=>{if(typeof e!=`string`)return null;let n=e.trim();return n?t?B(n,t):n:null},di=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`},fi=(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`},pi=e=>A(e)?di(e)||ui(Jt(e)):``,mi=(e,t)=>{if(!k(e))return``;let n=fi(e,t);if(n)return n;if(t){let e=di(t);if(e)return e;let n=qt(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?B(e.observation.command,80):``};break;case`FileEditorObservation`:case`StrReplaceEditorObservation`:i=e.observation.command===`view`?`OBSERVATION_MESSAGE$READ`:e.observation.command===`create`?`OBSERVATION_MESSAGE$WRITE`:`OBSERVATION_MESSAGE$EDIT`,a={path:e.observation.path||``};break;case`MCPToolObservation`:i=`OBSERVATION_MESSAGE$MCP`,a={mcp_tool_name:e.observation.tool_name};break;case`InvokeSkillObservation`:i=`OBSERVATION_MESSAGE$INVOKE_SKILL`,a={name:e.observation.skill_name};break;case`TaskObservation`:i=`OBSERVATION_MESSAGE$TASK`,a={name:e.observation.subagent};break;case`CanvasUIObservation`:i=`OBSERVATION_MESSAGE$CANVAS_UI`;break;case`ClientToolObservation`:if(e.tool_name===`canvas_ui_control`){i=`OBSERVATION_MESSAGE$CANVAS_UI`;break}if(e.tool_name===`launch_child_conversation`){i=`OBSERVATION_MESSAGE$LAUNCH_CHILD_CONVERSATION`;break}return r.replace(`Observation`,``).toUpperCase();case`SwitchLLMObservation`:i=e.observation.is_error?`MODEL$SWITCH_FAILED`:`MODEL$SWITCHED_TO_PROFILE`,a={name:e.observation.profile_name};break;case`BrowserObservation`:i=`OBSERVATION_MESSAGE$BROWSE`;break;case`TaskTrackerObservation`:{let{command:t}=e.observation;i=t===`plan`?`OBSERVATION_MESSAGE$TASK_TRACKING_PLAN`:`OBSERVATION_MESSAGE$TASK_TRACKING_VIEW`;break}case`ThinkObservation`:i=`OBSERVATION_MESSAGE$THINK`;break;case`GlobObservation`:i=`OBSERVATION_MESSAGE$GLOB`,a={pattern:e.observation.pattern?B(e.observation.pattern,50):``};break;case`GrepObservation`:i=`OBSERVATION_MESSAGE$GREP`,a={pattern:e.observation.pattern?B(e.observation.pattern,50):``};break;default:return r.replace(`Observation`,``).toUpperCase()}return i?X(i,a):r},hi=(e,t)=>e.observation.kind!==`ClientToolObservation`||e.tool_name!==`canvas_ui_control`||!t||!Ne(t)?null:`UI command '${t.action.command}' dispatched to the Agent Canvas frontend.`,Q=(e,t)=>{let n=``,r=``;if(K(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=m.exists(t)?X(t,{}):`Skill Ready`,r=e._skillReadyContent}else A(e)?(n=pi(e),r=li(e)??nr(e)):k(e)?(n=mi(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,F.jsx)(Sr,{event:e}):hi(e,t)??li(e,t)??_r(e)):Je(e)?(n=X(Bt(e),{title:Ht(e)}),r=Gt(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||m.t(x.EVENT$UNKNOWN_EVENT),details:r}};function gi({event:e,isFromPlanningAgent:t=!1}){let n=Q(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(H,{type:`agent`,message:typeof n.details==`string`?n.details:String(n.details),isFromPlanningAgent:t}),e.critic_result!=null&&(0,F.jsx)(Hn,{criticResult:e.critic_result})]})}var _i=e=>{let{observation:t}=e,n=t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
36
+ `).trim();return!t.skill_name&&!n?[]:[{name:t.skill_name,content:n}]};function vi(e){let t=e.split(`
37
+ `),n=null,r=null,i=0;for(let e=0;e<t.length;e+=1){let a=t[e];if(a.startsWith(b[0]))n=a.trim(),i=e+1;else if(a.startsWith(b[2]))r=a.replace(b[2],``).trim(),i=e+1;else if(a.startsWith(b[1])||a.startsWith(b[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(`
38
+ `).trim()}}function yi(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function bi({content:e}){let{t}=s(`openhands`),{matchInfo:n,filePath:r,body:i}=vi(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)(O.Text,{className:`text-[var(--oh-text-subtle)]`,children:[t(x.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)(M,{children:yi(i)})]})}function xi({items:e,titleKey:t=x.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}){let{t:n}=s(`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)(O.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)(O.Text,{className:`text-[var(--oh-text-tertiary)]`,children:t?(0,F.jsx)(w,{size:14}):(0,F.jsx)(T,{size:14})}),(0,F.jsx)(O.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)(bi,{content:e.content})]})]},e.name)})]})}function Si(e){if(K(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:x.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(k(e)&&e.observation.kind===`InvokeSkillObservation`){let t=_i(e);return t.length>0?{items:t,titleKey:x.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function $({event:e,isLastMessage:t,correspondingAction:n}){let{title:r,details:i}=Q(e,n);if(!K(e)&&k(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,F.jsx)(`div`,{children:i});let a;K(e)?a=`success`:k(e)?a=ir(e):Je(e)&&(a=rr(e));let o=Si(e),s=o?(0,F.jsx)(xi,{items:o.items,titleKey:o.titleKey}):i,c=!K(e)&&Xr(e,n);return(0,F.jsxs)(`div`,{children:[(0,F.jsx)(R,{title:r,details:s,success:a,initiallyExpanded:c,titleIcon:o?(0,F.jsx)(Te,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0}),t&&(0,F.jsx)(Mn,{})]})}function Ci({event:e,actions:t,isFromPlanningAgent:n=!1}){let r=e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
39
+ `);return r?(0,F.jsx)(H,{type:`agent`,message:r,actions:t,isFromPlanningAgent:n}):null}function wi(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 Ti(e){return e.length>80?`${e.slice(0,77)}...`:e}function Ei(e,t){return e?`blocked`:t?`ok`:`failed`}function Di(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 Oi({event:e}){let{t}=s(`openhands`);if(!je(e))return null;let n=wi(e.hook_event_type,e.blocked),r=Ei(e.blocked,e.success),i=Di(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(x.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(x.HOOK$COMMAND),`:`]}),` `,(0,F.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:Ti(e.hook_command)})]}),e.exit_code!==null&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(x.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(x.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(x.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(x.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(x.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(x.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 ki(e){let t=[],n=[];for(let r of e)Qe(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Ai=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function ji(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(ze(n)&&Ai(n.observation.path))return n.id}return null}function Mi(e){return(0,P.useMemo)(()=>{let t=new Set;return ki(e).forEach(e=>{let n=ji(e);n&&t.add(n)}),t},[e])}function Ni(e,t){return t.has(e)}var Pi=e=>e.activated_skills||[],Fi=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),Ii=e=>{let t=Pi(e).length>0,n=Fi(e.extended_content);return t&&n},Li=(e,t,n)=>{try{let r=jr(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Gn,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,F.jsx)($,{event:r,isLastMessage:n})]})}catch{return(0,F.jsx)(Gn,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Ri({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=ie(),{planContent:s}=fe(),{curAgentState:c}=Ve(),l=c===S.RUNNING||c===S.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(Pe(e)&&et(e))return(0,F.jsx)(pt,{status:e.value});if(Fe(e))return(0,F.jsx)(bn,{event:e,...d});if(je(e))return(0,F.jsx)(Oi,{event:e});if(Je(e))return(0,F.jsx)($,{event:e,isLastMessage:n});if(Be(e)){let{reasoning:t,message:n}=Ae(e.content??``,{streaming:!0}),r=[e.reasoning_content??``,t].filter(Boolean).join(`
40
+
41
+ `);return(0,F.jsxs)(F.Fragment,{children:[r&&(0,F.jsx)(W,{content:r}),n&&(0,F.jsx)(H,{type:`agent`,message:n,isFromPlanningAgent:u})]})}if(A(e)&&e.action.kind===`FinishAction`)return(0,F.jsx)(gi,{event:e,...d});if(A(e)&&e.action.kind===`ThinkAction`)return(0,F.jsx)(W,{content:e.action.thought});if(A(e)){let t=Ie(e);return(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(W,{content:t}),!a&&(0,F.jsx)(Ci,{event:e,isFromPlanningAgent:u}),(0,F.jsx)($,{event:e,isLastMessage:n})]})}if(k(e)){if(ze(e))return i&&Ni(e.id,i)?(0,F.jsx)(vn,{planContent:s,isStreaming:n&&c===S.RUNNING,isBuildDisabled:l}):null;let r=t.find(t=>A(t)&&t.id===e.action_id),o=!a&&r&&A(r)&&r.action.kind!==`ThinkAction`,d=r&&A(r)?Ie(r):``;return(0,F.jsxs)(F.Fragment,{children:[d&&(0,F.jsx)(W,{content:d}),o&&(0,F.jsx)(Ci,{event:r,isFromPlanningAgent:u}),(0,F.jsx)($,{event:e,isLastMessage:n,correspondingAction:r&&A(r)?r:void 0})]})}if(!A(e)&&!k(e)){let t=e;return Qe(e)&&Ii(t)?Li(t,d,n):(0,F.jsx)(Gn,{event:t,...d,isLastMessage:n})}return(0,F.jsx)($,{event:e,isLastMessage:n})}var zi=(e,t)=>{if(A(e)){let{kind:n}=e.action;return!(n===`FinishAction`||n===`ThinkAction`||Xr(e,t))}return k(e)?!(ze(e)||Xr(e,t)||e.observation.kind===`TaskTrackerObservation`):!1},Bi=(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(zi(e,k(e)?n.find(t=>A(t)&&t.id===e.action_id):void 0)){let s=Ye(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},Vi=(0,P.createContext)(!1);function Hi({events:e,allEvents:t,isFinalized:n=!1,children:r}){let{t:i}=s(`openhands`),[a,o]=P.useState(!1),c=P.useId(),l=`${c}-toggle`;if(e.length===0)return null;let u=e.find(e=>A(e)),d=e.filter(k).length,f=e.length,p=!!u,m=e[e.length-1],h=null;m&&(A(m)?h=Q(m).title:k(m)&&(h=Q(m,(t??e).find(e=>A(e)&&e.id===m.action_id)).title));let g=p?i(x.EVENT_GROUP$ACTIONS_PROGRESS,{completed:d,total:f}):i(x.EVENT_GROUP$ACTIONS_COMPLETED,{count:f}),_=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:l,type:`button`,onClick:()=>o(e=>!e),"aria-controls":c,"aria-expanded":a,"aria-label":i(a?x.EVENT_GROUP$COLLAPSE:x.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)(_,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:g})]}):(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)(_,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:(0,F.jsx)(Qt.Provider,{value:!1,children:h??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:g}),p?(0,F.jsx)(E,{"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:c,role:`region`,"aria-labelledby":l,className:`mt-1.5 flex flex-col`,"data-testid":`event-group-content`,children:(0,F.jsx)(Vi.Provider,{value:!0,children:r})})]})}var Ui=e=>e.at(-1)?.id,Wi=e=>e.at(-1),Gi=P.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=j(),r=Mi(t),i=He(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)(gt,{conversationId:n,anchorEventId:t}):null},s=P.useMemo(()=>Bi(e,void 0,t),[e,t]),c=(n,i,a)=>(0,F.jsx)(Ri,{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)(Ci,{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)(Hi,{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&&Ui(e.messages)===Ui(t.messages)&&Ui(e.allEvents)===Ui(t.allEvents)&&Wi(e.messages)===Wi(t.messages)&&Wi(e.allEvents)===Wi(t.allEvents));Gi.displayName=`Messages`;export{R as A,kt as C,gt as D,_t as E,st as M,ot as N,pt as O,at as P,Mt as S,xt as T,Jt as _,yr as a,Bt as b,nr as c,hn as d,H as f,Zt as g,nn as h,Fr as i,ct as j,ut as k,Nn as l,rn as m,Bi as n,vr as o,cn as p,Kr as r,_r as s,Gi as t,En as u,qt as v,yt as w,Ht as x,Gt as y};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-DaCIEEQP.js";e();var r=t(),i={sm:`w-[384px]`,md:`w-[520px]`,lg:`w-[640px]`,xl:`w-[720px]`},a=`max-w-[90vw]`;function o(e){return i[e]}function s({testID:e,children:t,className:i,width:a=`sm`}){return(0,r.jsx)(`div`,{"data-testid":e,className:n(`bg-base-secondary flex flex-col gap-6 items-center p-6 rounded-xl`,o(a),i),children:t})}export{s as n,o as r,a as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./utils-CN5ZfZy1.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-DaCIEEQP.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-CN5ZfZy1.js";var t=e(`text-xl leading-6 -tracking-[0.01em] font-medium text-[var(--oh-modal-title-foreground)]`),n=e(`text-sm font-medium text-[var(--oh-modal-title-foreground)]`),r=e(`text-lg font-medium text-[var(--oh-modal-title-foreground)]`),i=r;export{n as i,r as n,i as r,t};
@@ -1 +1 @@
1
- import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js";import{W as r,t as i}from"./utils-DaCIEEQP.js";e();var a=t(),o=e=>(0,a.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,a.jsx)(`path`,{d:`M12 4L4 12M4 4L12 12`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`})});function s({onClose:e,testId:t,className:s,disabled:c=!1}){let{t:l}=n(`openhands`);return(0,a.jsx)(`button`,{type:`button`,"data-testid":t,onClick:e,disabled:c,"aria-label":l(r.BUTTON$CLOSE),className:i(`absolute right-4 top-4 z-10 flex cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-1 text-tertiary-alt transition-colors hover:bg-surface-raised hover:text-white disabled:cursor-not-allowed disabled:opacity-50`,s),children:(0,a.jsx)(o,{"aria-hidden":!0,className:`size-4`})})}export{s as t};
1
+ import"./rolldown-runtime-Cyuzqnbw.js";import{St as e,yt as t}from"./vendor-styling-Ck5D_A2Q.js";import{t as n}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-Chf7vmKB.js";import{W as r,t as i}from"./utils-CN5ZfZy1.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{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-ZixYGy6E.js";var t=e(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]);export{t};
1
+ import{D as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-DqZDXfg2.js";var t=e(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]);export{t};