@openhands/agent-canvas 1.15.0 → 1.17.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 (1277) 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-DrjNsPOH.js} +1 -1
  4. package/build/assets/active-backend-context-rZiLJRUc.js +2 -0
  5. package/build/assets/{agent-context-settings-D3PjSTU1.js → agent-context-settings-CJUrcBut.js} +1 -1
  6. package/build/assets/agent-profiles-service.api-Biieml2L.js +1 -0
  7. package/build/assets/agent-profiles-settings-x6RvPsq7.js +1 -0
  8. package/build/assets/agent-server-client-options-BikiNwTa.js +1 -0
  9. package/build/assets/agent-server-conversation-service.api-DYFsNHKf.js +88 -0
  10. package/build/assets/agent-settings-BJyovpJ_.js +1 -0
  11. package/build/assets/agent-settings-CpY3zObk.js +2 -0
  12. package/build/assets/alert-banner-vARz1idS.js +1 -0
  13. package/build/assets/{api-error-message-BJyfWp6p.js → api-error-message-Ve79qDcN.js} +1 -1
  14. package/build/assets/api-key-entry-screen-CsMuBhoP.js +1 -0
  15. package/build/assets/{app-settings-CbHqzQus.js → app-settings-BaJ7nfHt.js} +1 -1
  16. package/build/assets/automation-detail-CVoGDrKq.js +3 -0
  17. package/build/assets/{automation-export-BRopEHMu.js → automation-export-DxY47m3T.js} +1 -1
  18. package/build/assets/automation-git-sync-CRMP9Bbm.js +1 -0
  19. package/build/assets/automation-setup-route-072beLz1.js +3 -0
  20. package/build/assets/{automation-templates-C_0FZgLG.js → automation-templates-4C4PM8K7.js} +1 -1
  21. package/build/assets/automations-list-xuqTSQL4.js +1 -0
  22. package/build/assets/{back-nav-button-Dm9tIjVf.js → back-nav-button-B8tH0BEp.js} +1 -1
  23. package/build/assets/backend-form-modal-0aJmWdsa.js +1 -0
  24. package/build/assets/{backend-synced-settings-badge-3fOwg6Bd.js → backend-synced-settings-badge-B7rKWBir.js} +1 -1
  25. package/build/assets/{badge-D4SqUCsR.js → badge-CcGx2TaV.js} +1 -1
  26. package/build/assets/{base-modal-C7_BDl_U.js → base-modal-DTULovNc.js} +1 -1
  27. package/build/assets/bot-CLMxGFaq.js +1 -0
  28. package/build/assets/{brand-button-Dxv6PDeN.js → brand-button-DxPO4Lf8.js} +1 -1
  29. package/build/assets/browser-C-_qBasq.js +46 -0
  30. package/build/assets/{browser-tab-BAl4ckJE.js → browser-tab-DZanIw5m.js} +1 -1
  31. package/build/assets/canvas-extension-page-o_cWgE9B.js +1 -0
  32. package/build/assets/canvas-extensions-DSgNlCha.js +1 -0
  33. package/build/assets/canvas-extensions-runtime-DdnkgJXV.js +1 -0
  34. package/build/assets/{chat-send-button-DWwR2cgI.js → chat-send-button-B3SFSIg5.js} +1 -1
  35. package/build/assets/check-fDEfgSzj.js +1 -0
  36. package/build/assets/chevron-down-CFrWHqu8.js +1 -0
  37. package/build/assets/chevron-right-C5roOrJu.js +1 -0
  38. package/build/assets/circle-check-ClTzJTdb.js +1 -0
  39. package/build/assets/{circle-plus-check-toggle-CBh_qomE.js → circle-plus-check-toggle-Fr-h-mbL.js} +1 -1
  40. package/build/assets/{cloud-funnel-analytics-287iIERo.js → cloud-funnel-analytics-BQanUEEC.js} +1 -1
  41. package/build/assets/{cog-C4rrw-ZK.js → cog-VBlRo6iw.js} +1 -1
  42. package/build/assets/command-menu-BT3Ia5Ru.js +1 -0
  43. package/build/assets/commits-tab-2jhtaohl.js +1 -0
  44. package/build/assets/{condenser-settings-BcNmYR4s.js → condenser-settings-eVKFMvap.js} +1 -1
  45. package/build/assets/confirmation-modal-gIFHeZt6.js +1 -0
  46. package/build/assets/{context-menu-list-item-lVYETtY5.js → context-menu-list-item-DDROe12Z.js} +1 -1
  47. package/build/assets/conversation-BnjJSFf5.js +93 -0
  48. package/build/assets/conversation-DZ578rOX.js +1 -0
  49. package/build/assets/conversation-panel-DZ578rOX.js +1 -0
  50. package/build/assets/conversation-state-store-D1_G_9I-.js +1 -0
  51. package/build/assets/{conversation-store-Ca3ghXap.js → conversation-store-DVVfkCsk.js} +1 -1
  52. package/build/assets/{conversation-tab-empty-state-HJtkmHZj.js → conversation-tab-empty-state-DKlzAz5c.js} +1 -1
  53. package/build/assets/{copy-to-clipboard-button-Cjkswvnj.js → copy-to-clipboard-button-B3w0X7WH.js} +1 -1
  54. package/build/assets/{device-verify-EZhHhBT7.js → device-verify-BfkCzyFB.js} +1 -1
  55. package/build/assets/{dropdown-classes-DJe-E6MC.js → dropdown-classes-B9kJVDIk.js} +1 -1
  56. package/build/assets/edit-automation-modal-BwhJ39JT.js +1 -0
  57. package/build/assets/empty-state-RZz0OfnY.js +1 -0
  58. package/build/assets/{entry.client-C7Bi2tkU.js → entry.client-Ds8LVp-E.js} +2 -2
  59. package/build/assets/enum-filter-dropdown-C4pW0ORd.js +1 -0
  60. package/build/assets/{environment-switch-overlay-CEKrFiMw.js → environment-switch-overlay-P2ZAuzov.js} +1 -1
  61. package/build/assets/{error-state-BALXiBNy.js → error-state-B_5cgNPJ.js} +1 -1
  62. package/build/assets/extensions-hub-DsaUr4ca.js +1 -0
  63. package/build/assets/extensions-navigation-CRMZd-FE.js +1 -0
  64. package/build/assets/external-link-DQtv7eTh.js +1 -0
  65. package/build/assets/files-tab-CCgAcVdc.js +1 -0
  66. package/build/assets/{form-control-classes-CGw40z5h.js → form-control-classes-B-z85REi.js} +1 -1
  67. package/build/assets/format-model-name-CasAP3nd.js +1 -0
  68. package/build/assets/get-git-path-EHrSDxTM.js +1 -0
  69. package/build/assets/git-repo-dropdown-D2WEQ97X.js +1 -0
  70. package/build/assets/{git-repo-dropdown-ai8qaNkD.js → git-repo-dropdown-DVeCUUXG.js} +1 -1
  71. package/build/assets/{highlighted-source-view-C3sxykQi.js → highlighted-source-view-DjHO3SdW.js} +1 -1
  72. package/build/assets/home-BorS_vdS.js +1 -0
  73. package/build/assets/home-aIMbHw5M.js +1 -0
  74. package/build/assets/home-automation-run-tooltip-CpHNFiFl.js +1 -0
  75. package/build/assets/home-store-DyXz0w6d.js +1 -0
  76. package/build/assets/hooks-service-C6dpRtZM.js +1 -0
  77. package/build/assets/index-home-zKFuKK2B.js +1 -0
  78. package/build/assets/info-CTIdjttz.js +1 -0
  79. package/build/assets/install-server-modal-DUiZMc8u.js +1 -0
  80. package/build/assets/kebab-menu-item-content-mm04SBD3.js +1 -0
  81. package/build/assets/{key-Cn5za3rg.js → key-CfXbJa8w.js} +1 -1
  82. package/build/assets/{launch-C1ieiOGe.js → launch-BSIf9KEg.js} +1 -1
  83. package/build/assets/list-filter-CNpqTWVY.js +1 -0
  84. package/build/assets/{list-todo-Cuu-STFc.js → list-todo-ByXMdY4W.js} +1 -1
  85. package/build/assets/llm-not-configured-banner-z_QRSeV0.js +27 -0
  86. package/build/assets/llm-settings-B-5AHMiX.js +1 -0
  87. package/build/assets/llm-settings-B3SjHDmA.js +1 -0
  88. package/build/assets/llm-subscription-service-aDNBQ7Gq.js +1 -0
  89. package/build/assets/loader-circle-Dex47vVW.js +1 -0
  90. package/build/assets/{loading-spinner-0L3ZTToZ.js → loading-spinner-DfHI77BA.js} +1 -1
  91. package/build/assets/manage-backends-modal-q1NdFisr.js +1 -0
  92. package/build/assets/manifest-8920b615.js +1 -0
  93. package/build/assets/{manifest-subpage-layout-BGhiUQbA.js → manifest-subpage-layout-BQQy5ipR.js} +1 -1
  94. package/build/assets/{map-provider-B9LTm23I.js → map-provider-DXvssjw9.js} +1 -1
  95. package/build/assets/markdown-renderer-rivLvYh-.js +8 -0
  96. package/build/assets/{mcp-CKbR4Vft.js → mcp-CEXDhQWn.js} +1 -1
  97. package/build/assets/{mcp-marketplace-utils-C13fFccR.js → mcp-marketplace-utils-Cn_NIMWM.js} +1 -1
  98. package/build/assets/mcp-page-LGYIICMG.js +9 -0
  99. package/build/assets/messages-DUSeANAh.js +41 -0
  100. package/build/assets/{modal-body-CMOc2tLl.js → modal-body-DJw4xBki.js} +1 -1
  101. package/build/assets/{modal-classes-BAb4Y_BG.js → modal-classes-Dg0ngBPO.js} +1 -1
  102. package/build/assets/{modal-close-button-CkJ0Ktjj.js → modal-close-button-B9j4nasm.js} +1 -1
  103. package/build/assets/{mouse-pointer-click-CsgRs_-r.js → mouse-pointer-click-DEhsSUpu.js} +1 -1
  104. package/build/assets/onboarding-BjFebfs5.js +1 -0
  105. package/build/assets/onboarding-modal-DDTjOpyd.js +1 -0
  106. package/build/assets/organization-service.api-Cyg1Tn03.js +1 -0
  107. package/build/assets/pencil-D5c47kyN.js +1 -0
  108. package/build/assets/pin-C7vMagvf.js +1 -0
  109. package/build/assets/planner-tab-D8f2Y3rn.js +1 -0
  110. package/build/assets/plug-CeaqeF6u.js +1 -0
  111. package/build/assets/plugins-management-service-Bh_pBuf-.js +1 -0
  112. package/build/assets/plus-B3wvU06-.js +1 -0
  113. package/build/assets/profiles-service.api-BbOK0EkF.js +1 -0
  114. package/build/assets/providers-2gIIkz2N.js +1 -0
  115. package/build/assets/proxy-CBgMd2zf.js +1 -0
  116. package/build/assets/{puzzle-A9pGxxai.js → puzzle-DdAqbUrb.js} +1 -1
  117. package/build/assets/recommended-automations-launcher-YLAQTp4s.js +1 -0
  118. package/build/assets/refresh-cw-DEQdPCpH.js +1 -0
  119. package/build/assets/root-Bye_XmEL.js +2 -0
  120. package/build/assets/root-Cnwwzgo0.css +1 -0
  121. package/build/assets/root-layout-CSAwxBGM.js +2 -0
  122. package/build/assets/schema-field-CK0xYNbO.js +1 -0
  123. package/build/assets/scroll-fade-state-Dt_fx2kf.js +1 -0
  124. package/build/assets/sdk-section-page-Da73Rs_o.js +1 -0
  125. package/build/assets/secret-form-CB2VwYYg.js +1 -0
  126. package/build/assets/secrets-service-Cr8g8xuv.js +1 -0
  127. package/build/assets/{secrets-settings-BizaTEr1.js → secrets-settings-Bh0udeKv.js} +1 -1
  128. package/build/assets/settings-CKqk8ZnH.js +1 -0
  129. package/build/assets/settings-DmyIgRxO.js +1 -0
  130. package/build/assets/{settings-dropdown-input-tM0A0ipy.js → settings-dropdown-input-DVpyD87C.js} +1 -1
  131. package/build/assets/settings-index-BSJUFmjE.js +1 -0
  132. package/build/assets/{settings-input-C03KUoSC.js → settings-input-C0dd8Utu.js} +1 -1
  133. package/build/assets/{settings-list-classes-BJ0g8rWj.js → settings-list-classes-Ds4jPBHK.js} +1 -1
  134. package/build/assets/{settings-modal-AzEF1QPP.js → settings-modal-yStgEh2o.js} +1 -1
  135. package/build/assets/settings-service.api-9_xdv_mh.js +1 -0
  136. package/build/assets/{settings-switch-CQE0EGC-.js → settings-switch-B78Khmyz.js} +1 -1
  137. package/build/assets/{settings-utils-ClYOkbbI.js → settings-utils-8GIIgOQL.js} +1 -1
  138. package/build/assets/shared-conversation-DM96X4KV.js +1 -0
  139. package/build/assets/shield-check-DO7wa_eu.js +1 -0
  140. package/build/assets/{sidebar-layout-D3hE08wK.js → sidebar-layout-EPfWxk11.js} +1 -1
  141. package/build/assets/sidebar-mobile-menu-toggle-D5GR5xT9.js +1 -0
  142. package/build/assets/sidebar-nav-link-_t4_Ef-9.js +1 -0
  143. package/build/assets/{sidebar-onboarding-checklist-storage-3qYflszY.js → sidebar-onboarding-checklist-storage-DbDX-Wvj.js} +1 -1
  144. package/build/assets/sidebar-store-CSDFK0W5.js +1 -0
  145. package/build/assets/{skill-card-pill-row-CFxjoqxn.js → skill-card-pill-row-989y15jV.js} +1 -1
  146. package/build/assets/skill-enablement-DXeaImBz.js +1 -0
  147. package/build/assets/skill-filter-BBeZ4JEP.js +2 -0
  148. package/build/assets/{skill-icon-badge-CPQJ6A-I.js → skill-icon-badge-BDhQ-tQ0.js} +1 -1
  149. package/build/assets/skill-scope-Dz3kPH3P.js +1 -0
  150. package/build/assets/skills-plugins-e3CYGdUJ.js +1 -0
  151. package/build/assets/skills-settings-3e-FuHw_.js +1 -0
  152. package/build/assets/styled-tooltip-Pd22BIvr.js +1 -0
  153. package/build/assets/{task-list-tab-04GNQuii.js → task-list-tab-3Jg8ywch.js} +1 -1
  154. package/build/assets/{terminal-Cj0iHIW7.js → terminal-onXx0_Qz.js} +1 -1
  155. package/build/assets/toggle-switch-lwQtxDcm.js +1 -0
  156. package/build/assets/trash-2-ZhKuTLiz.js +1 -0
  157. package/build/assets/trash-B6OIe4yX.js +1 -0
  158. package/build/assets/triangle-alert-BajLPpQg.js +1 -0
  159. package/build/assets/{typography-SgFy466J.js → typography-HLLg_FAn.js} +1 -1
  160. package/build/assets/usage-tab-Cm-9j3UK.js +1 -0
  161. package/build/assets/use-acp-credential-form-BARcvjYE.js +1 -0
  162. package/build/assets/use-activate-agent-profile-BLKML6vQ.js +1 -0
  163. package/build/assets/use-agent-profiles-1P91KSXz.js +1 -0
  164. package/build/assets/{use-automation-health-BxXdzZMP.js → use-automation-health-BZkQNEA8.js} +1 -1
  165. package/build/assets/use-automation-permissions-B_RpvL-s.js +1 -0
  166. package/build/assets/{use-automations-zYb0dUny.js → use-automations-Cg0PDIZr.js} +1 -1
  167. package/build/assets/{use-can-manage-org-profiles-BWMahtUh.js → use-can-manage-org-profiles-BbN6KfDr.js} +1 -1
  168. package/build/assets/use-canvas-extensions-CFUpHat6.js +1 -0
  169. package/build/assets/{use-cloud-current-user-id-CPHMDG-C.js → use-cloud-current-user-id-Dk0rjr63.js} +1 -1
  170. package/build/assets/use-config-DpafU_QP.js +1 -0
  171. package/build/assets/use-create-conversation-1YgmAHt-.js +1 -0
  172. package/build/assets/use-create-secret-D8p9ybQj.js +1 -0
  173. package/build/assets/{use-get-secrets-BT4ihRwj.js → use-get-secrets-CQ4b0qK8.js} +1 -1
  174. package/build/assets/use-is-authed-BRPjCRKM.js +1 -0
  175. package/build/assets/{use-launch-skill-in-chat-BYjYihBP.js → use-launch-skill-in-chat-DeYa1tFM.js} +1 -1
  176. package/build/assets/use-llm-configured-DGm8FiRR.js +1 -0
  177. package/build/assets/use-llm-profiles-BTTtpW4z.js +1 -0
  178. package/build/assets/use-manifest-capabilities-AOWGcu0j.js +1 -0
  179. package/build/assets/use-onboarding-completion-CoINurkm.js +1 -0
  180. package/build/assets/use-pinned-home-route-D6krwXjy.js +1 -0
  181. package/build/assets/use-plugins-marketplace-mLsIDhBv.js +1 -0
  182. package/build/assets/use-save-agent-profile-CxyO9YG-.js +1 -0
  183. package/build/assets/{use-save-settings-CUZW6yXP.js → use-save-settings-3U5K9-8x.js} +1 -1
  184. package/build/assets/use-settings-Dn00UISA.js +1 -0
  185. package/build/assets/use-settings-nav-items-vrjxTqcu.js +16 -0
  186. package/build/assets/use-tracking-B9prBsrq.js +3 -0
  187. package/build/assets/{use-user-conversation-DT0_QCnL.js → use-user-conversation-ZWlXtbZb.js} +1 -1
  188. package/build/assets/{useInfiniteQuery-CgeUQPfs.js → useInfiniteQuery-BzrRqjLg.js} +1 -1
  189. package/build/assets/{useMutation-DFnzkf6f.js → useMutation-CJuK90oc.js} +1 -1
  190. package/build/assets/{useQueries-BhbrGEf1.js → useQueries-CykmpT-a.js} +1 -1
  191. package/build/assets/{useQuery-BXWbZBZl.js → useQuery-S6j94er1.js} +1 -1
  192. package/build/assets/utils-BOco8mxR.js +1 -0
  193. package/build/assets/{vendor~conversation-panel~conversation-CTvDDiXg.js → vendor~conversation-panel~conversation-4eJ0tml3.js} +1 -1
  194. package/build/assets/{vendor~entry.client-BFE7Llz9.js → vendor~entry.client-CoCfUXUF.js} +1 -1
  195. package/build/assets/{vendor~entry.client-BaKt_PIp.js → vendor~entry.client-DA2izTjq.js} +1 -1
  196. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js +2 -0
  197. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js +185 -0
  198. 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-DnDoaYNi.js} +1 -1
  199. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-BTyukeM-.js → vendor~index-home~home~conversation-panel~conversation-CSFLzmTN.js} +1 -1
  200. package/build/assets/vendor~root-layout-n8XCEXG8.js +1 -0
  201. package/build/assets/{vendor~root-layout~conversation-panel~conversation-BYAWJwQX.js → vendor~root-layout~conversation-panel~conversation-3Idg1_U3.js} +1 -1
  202. 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-DkPlXWl9.js} +1 -1
  203. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-DgQ564nC.js +1 -0
  204. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js +1 -0
  205. 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~inibp4qe-CnsDDzeE.js} +2 -2
  206. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js +1 -0
  207. 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-BPjI-atc.js} +125 -15
  208. 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
  209. package/build/assets/{verification-settings-Bj6bo097.js → verification-settings-u2POabjH.js} +1 -1
  210. package/build/assets/{wrench-hi7Q13dF.js → wrench-CkgI4rxA.js} +1 -1
  211. package/build/assets/x-By6qCmtY.js +1 -0
  212. package/build/index.html +4 -4
  213. package/build/locales/ar/openhands.json +94 -25
  214. package/build/locales/ca/openhands.json +94 -25
  215. package/build/locales/de/openhands.json +94 -25
  216. package/build/locales/en/openhands.json +94 -25
  217. package/build/locales/es/openhands.json +94 -25
  218. package/build/locales/fr/openhands.json +94 -25
  219. package/build/locales/it/openhands.json +94 -25
  220. package/build/locales/ja/openhands.json +94 -25
  221. package/build/locales/ko-KR/openhands.json +94 -25
  222. package/build/locales/no/openhands.json +94 -25
  223. package/build/locales/pt/openhands.json +94 -25
  224. package/build/locales/tr/openhands.json +94 -25
  225. package/build/locales/uk/openhands.json +94 -25
  226. package/build/locales/zh-CN/openhands.json +94 -25
  227. package/build/locales/zh-TW/openhands.json +94 -25
  228. package/config/defaults.json +9 -5
  229. package/dist/api/agent-profiles-service/profile-field-support.d.ts +26 -0
  230. package/dist/api/agent-server-adapter.cjs +3 -3
  231. package/dist/api/agent-server-adapter.cjs.map +1 -1
  232. package/dist/api/agent-server-adapter.d.ts +72 -12
  233. package/dist/api/agent-server-adapter.js +249 -145
  234. package/dist/api/agent-server-adapter.js.map +1 -1
  235. package/dist/api/agent-server-compatibility.cjs +1 -1
  236. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  237. package/dist/api/agent-server-compatibility.d.ts +21 -0
  238. package/dist/api/agent-server-compatibility.js +52 -38
  239. package/dist/api/agent-server-compatibility.js.map +1 -1
  240. package/dist/api/agent-server-config.cjs +1 -1
  241. package/dist/api/agent-server-config.cjs.map +1 -1
  242. package/dist/api/agent-server-config.d.ts +32 -0
  243. package/dist/api/agent-server-config.js +21 -5
  244. package/dist/api/agent-server-config.js.map +1 -1
  245. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  246. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  247. package/dist/api/automation-service/automation-service.api.d.ts +2 -2
  248. package/dist/api/automation-service/automation-service.api.js +7 -7
  249. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  250. package/dist/api/canvas-extensions-service.cjs +1 -0
  251. package/dist/api/canvas-extensions-service.d.ts +22 -0
  252. package/dist/api/canvas-extensions-service.js +4 -0
  253. package/dist/api/cloud/conversation-service.api.cjs +1 -1
  254. package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
  255. package/dist/api/cloud/conversation-service.api.d.ts +6 -0
  256. package/dist/api/cloud/conversation-service.api.js +14 -6
  257. package/dist/api/cloud/conversation-service.api.js.map +1 -1
  258. package/dist/api/cloud/provider-connections-service.api.cjs +2 -0
  259. package/dist/api/cloud/provider-connections-service.api.cjs.map +1 -0
  260. package/dist/api/cloud/provider-connections-service.api.d.ts +5 -0
  261. package/dist/api/cloud/provider-connections-service.api.js +50 -0
  262. package/dist/api/cloud/provider-connections-service.api.js.map +1 -0
  263. package/dist/api/cloud/skills-service.api.cjs +1 -1
  264. package/dist/api/cloud/skills-service.api.cjs.map +1 -1
  265. package/dist/api/cloud/skills-service.api.d.ts +10 -0
  266. package/dist/api/cloud/skills-service.api.js +11 -1
  267. package/dist/api/cloud/skills-service.api.js.map +1 -1
  268. package/dist/api/conversation-file-upload.api.cjs +1 -1
  269. package/dist/api/conversation-file-upload.api.js +10 -10
  270. package/dist/api/conversation-metadata-store.cjs +1 -1
  271. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  272. package/dist/api/conversation-metadata-store.d.ts +24 -0
  273. package/dist/api/conversation-metadata-store.js +10 -2
  274. package/dist/api/conversation-metadata-store.js.map +1 -1
  275. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
  276. package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
  277. package/dist/api/conversation-service/agent-server-conversation-service.api.d.ts +31 -0
  278. package/dist/api/conversation-service/agent-server-conversation-service.api.js +188 -128
  279. package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
  280. package/dist/api/event-service/event-service.api.cjs +1 -1
  281. package/dist/api/event-service/event-service.api.js +12 -12
  282. package/dist/api/git-service/agent-server-git-service.api.cjs +1 -1
  283. package/dist/api/git-service/agent-server-git-service.api.js +8 -8
  284. package/dist/api/hooks-service.cjs +2 -0
  285. package/dist/api/hooks-service.cjs.map +1 -0
  286. package/dist/api/hooks-service.d.ts +13 -0
  287. package/dist/api/hooks-service.js +20 -0
  288. package/dist/api/hooks-service.js.map +1 -0
  289. package/dist/api/provider-connections-service/provider-connections-service.api.cjs +1 -1
  290. package/dist/api/provider-connections-service/provider-connections-service.api.cjs.map +1 -1
  291. package/dist/api/provider-connections-service/provider-connections-service.api.js +25 -16
  292. package/dist/api/provider-connections-service/provider-connections-service.api.js.map +1 -1
  293. package/dist/api/runtime-service/agent-server-runtime-service.cjs +1 -1
  294. package/dist/api/runtime-service/agent-server-runtime-service.js +8 -8
  295. package/dist/api/settings-service/settings-service.api.cjs +1 -1
  296. package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
  297. package/dist/api/settings-service/settings-service.api.d.ts +5 -2
  298. package/dist/api/settings-service/settings-service.api.js +20 -11
  299. package/dist/api/settings-service/settings-service.api.js.map +1 -1
  300. package/dist/api/skills-service.cjs +1 -1
  301. package/dist/api/skills-service.cjs.map +1 -1
  302. package/dist/api/skills-service.d.ts +7 -0
  303. package/dist/api/skills-service.js +11 -8
  304. package/dist/api/skills-service.js.map +1 -1
  305. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.cjs +1 -1
  306. package/dist/components/conversation-events/chat/event-message-components/critic-result-display.js +5 -5
  307. package/dist/components/conversation-events/chat/event-message-components/event-group.cjs +1 -1
  308. package/dist/components/conversation-events/chat/event-message-components/event-group.cjs.map +1 -1
  309. package/dist/components/conversation-events/chat/event-message-components/event-group.js +40 -36
  310. package/dist/components/conversation-events/chat/event-message-components/event-group.js.map +1 -1
  311. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.cjs +1 -1
  312. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.cjs.map +1 -1
  313. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.js +2 -1
  314. package/dist/components/conversation-events/chat/event-message-components/finish-event-message.js.map +1 -1
  315. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs +1 -1
  316. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.cjs.map +1 -1
  317. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.d.ts +1 -1
  318. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js +28 -28
  319. package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.js.map +1 -1
  320. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.cjs +1 -1
  321. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.cjs.map +1 -1
  322. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.js +2 -1
  323. package/dist/components/conversation-events/chat/event-message-components/thought-event-message.js.map +1 -1
  324. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs +1 -1
  325. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.cjs.map +1 -1
  326. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.d.ts +1 -1
  327. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js +37 -37
  328. package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.js.map +1 -1
  329. package/dist/components/conversation-events/chat/event-message.cjs +2 -2
  330. package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
  331. package/dist/components/conversation-events/chat/event-message.js +79 -70
  332. package/dist/components/conversation-events/chat/event-message.js.map +1 -1
  333. package/dist/components/conversation-events/chat/messages.cjs +1 -1
  334. package/dist/components/conversation-events/chat/messages.cjs.map +1 -1
  335. package/dist/components/conversation-events/chat/messages.js +28 -27
  336. package/dist/components/conversation-events/chat/messages.js.map +1 -1
  337. package/dist/components/features/automations/automation-card.cjs +1 -1
  338. package/dist/components/features/automations/automation-card.cjs.map +1 -1
  339. package/dist/components/features/automations/automation-card.js +118 -102
  340. package/dist/components/features/automations/automation-card.js.map +1 -1
  341. package/dist/components/features/automations/automation-list-row.cjs +1 -1
  342. package/dist/components/features/automations/automation-list-row.cjs.map +1 -1
  343. package/dist/components/features/automations/automation-list-row.js +88 -77
  344. package/dist/components/features/automations/automation-list-row.js.map +1 -1
  345. package/dist/components/features/automations/detail/detail-header.d.ts +3 -1
  346. package/dist/components/features/automations/detail/run-phase.cjs +2 -0
  347. package/dist/components/features/automations/detail/run-phase.cjs.map +1 -0
  348. package/dist/components/features/automations/detail/run-phase.d.ts +89 -0
  349. package/dist/components/features/automations/detail/run-phase.js +72 -0
  350. package/dist/components/features/automations/detail/run-phase.js.map +1 -0
  351. package/dist/components/features/automations/detail/run-status-badge.cjs +1 -1
  352. package/dist/components/features/automations/detail/run-status-badge.cjs.map +1 -1
  353. package/dist/components/features/automations/detail/run-status-badge.d.ts +2 -2
  354. package/dist/components/features/automations/detail/run-status-badge.js +82 -53
  355. package/dist/components/features/automations/detail/run-status-badge.js.map +1 -1
  356. package/dist/components/features/automations/kebab-menu.cjs +1 -1
  357. package/dist/components/features/automations/kebab-menu.cjs.map +1 -1
  358. package/dist/components/features/automations/kebab-menu.js +9 -5
  359. package/dist/components/features/automations/kebab-menu.js.map +1 -1
  360. package/dist/components/features/automations/recommended-automations-launcher.cjs +1 -1
  361. package/dist/components/features/automations/recommended-automations-launcher.cjs.map +1 -1
  362. package/dist/components/features/automations/recommended-automations-launcher.js +12 -12
  363. package/dist/components/features/automations/recommended-automations-launcher.js.map +1 -1
  364. package/dist/components/features/automations/recommended-automations-section.cjs +1 -1
  365. package/dist/components/features/automations/recommended-automations-section.js +9 -9
  366. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  367. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  368. package/dist/components/features/backends/backend-form-modal.js +5 -11
  369. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  370. package/dist/components/features/backends/backend-selector.cjs +1 -1
  371. package/dist/components/features/backends/backend-selector.cjs.map +1 -1
  372. package/dist/components/features/backends/backend-selector.js +133 -122
  373. package/dist/components/features/backends/backend-selector.js.map +1 -1
  374. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  375. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  376. package/dist/components/features/backends/manage-backends-modal.js +29 -29
  377. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  378. package/dist/components/features/canvas-extensions/add-canvas-extension-modal.d.ts +6 -0
  379. package/dist/components/features/canvas-extensions/canvas-extension-card.d.ts +9 -0
  380. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs +2 -0
  381. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.cjs.map +1 -0
  382. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.d.ts +23 -0
  383. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js +19 -0
  384. package/dist/components/features/canvas-extensions/canvas-extensions-runtime.js.map +1 -0
  385. package/dist/components/features/chat/change-agent-button.cjs +1 -1
  386. package/dist/components/features/chat/change-agent-button.js +4 -4
  387. package/dist/components/features/chat/chat-interface.cjs +2 -2
  388. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  389. package/dist/components/features/chat/chat-interface.js +107 -104
  390. package/dist/components/features/chat/chat-interface.js.map +1 -1
  391. package/dist/components/features/chat/chat-markdown-path-code.cjs +3 -0
  392. package/dist/components/features/chat/chat-markdown-path-code.cjs.map +1 -0
  393. package/dist/components/features/chat/chat-markdown-path-code.d.ts +27 -0
  394. package/dist/components/features/chat/chat-markdown-path-code.js +72 -0
  395. package/dist/components/features/chat/chat-markdown-path-code.js.map +1 -0
  396. package/dist/components/features/chat/chat-message.cjs +1 -1
  397. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  398. package/dist/components/features/chat/chat-message.d.ts +2 -1
  399. package/dist/components/features/chat/chat-message.js +88 -79
  400. package/dist/components/features/chat/chat-message.js.map +1 -1
  401. package/dist/components/features/chat/components/context-window-meter.cjs +1 -1
  402. package/dist/components/features/chat/components/context-window-meter.js +4 -4
  403. package/dist/components/features/chat/confirmation-mode-enabled.cjs +1 -1
  404. package/dist/components/features/chat/confirmation-mode-enabled.js +4 -4
  405. package/dist/components/features/chat/generic-event-message.cjs +1 -1
  406. package/dist/components/features/chat/generic-event-message.cjs.map +1 -1
  407. package/dist/components/features/chat/generic-event-message.d.ts +2 -1
  408. package/dist/components/features/chat/generic-event-message.js +41 -22
  409. package/dist/components/features/chat/generic-event-message.js.map +1 -1
  410. package/dist/components/features/chat/interactive-chat-box.cjs +1 -1
  411. package/dist/components/features/chat/interactive-chat-box.cjs.map +1 -1
  412. package/dist/components/features/chat/interactive-chat-box.js +20 -19
  413. package/dist/components/features/chat/interactive-chat-box.js.map +1 -1
  414. package/dist/components/features/chat/path-component.cjs +1 -1
  415. package/dist/components/features/chat/path-component.cjs.map +1 -1
  416. package/dist/components/features/chat/path-component.d.ts +8 -2
  417. package/dist/components/features/chat/path-component.js +33 -21
  418. package/dist/components/features/chat/path-component.js.map +1 -1
  419. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs +1 -1
  420. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.cjs.map +1 -1
  421. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js +38 -43
  422. package/dist/components/features/chat/tool-visualizers/file-editor/file-editor.js.map +1 -1
  423. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs +1 -1
  424. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.cjs.map +1 -1
  425. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +8 -5
  426. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js +22 -16
  427. package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.js.map +1 -1
  428. package/dist/components/features/chat/user-message-body.cjs +1 -1
  429. package/dist/components/features/chat/user-message-body.cjs.map +1 -1
  430. package/dist/components/features/chat/user-message-body.d.ts +4 -0
  431. package/dist/components/features/chat/user-message-body.js +30 -24
  432. package/dist/components/features/chat/user-message-body.js.map +1 -1
  433. package/dist/components/features/conversation/conversation-overview-git-section.cjs +1 -1
  434. package/dist/components/features/conversation/conversation-overview-git-section.js +4 -4
  435. package/dist/components/features/conversation/conversation-overview-skills-panel.cjs +1 -1
  436. package/dist/components/features/conversation/conversation-overview-skills-panel.cjs.map +1 -1
  437. package/dist/components/features/conversation/conversation-overview-skills-panel.js +63 -81
  438. package/dist/components/features/conversation/conversation-overview-skills-panel.js.map +1 -1
  439. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs +1 -1
  440. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.cjs.map +1 -1
  441. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js +77 -78
  442. package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.js.map +1 -1
  443. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs +1 -1
  444. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.cjs.map +1 -1
  445. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js +96 -96
  446. package/dist/components/features/conversation/conversation-tabs/conversation-tabs.js.map +1 -1
  447. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs +1 -1
  448. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.cjs.map +1 -1
  449. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.d.ts +1 -1
  450. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js +3 -3
  451. package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.js.map +1 -1
  452. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.cjs +2 -0
  453. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.cjs.map +1 -0
  454. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.d.ts +21 -0
  455. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.js +239 -0
  456. package/dist/components/features/conversation-panel/advanced-conversation-options-modal.js.map +1 -0
  457. package/dist/components/features/conversation-panel/conversation-active-tag-filters.cjs +2 -0
  458. package/dist/components/features/conversation-panel/conversation-active-tag-filters.cjs.map +1 -0
  459. package/dist/components/features/conversation-panel/conversation-active-tag-filters.d.ts +28 -0
  460. package/dist/components/features/conversation-panel/conversation-active-tag-filters.js +69 -0
  461. package/dist/components/features/conversation-panel/conversation-active-tag-filters.js.map +1 -0
  462. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs +1 -1
  463. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.cjs.map +1 -1
  464. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +2 -1
  465. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js +19 -18
  466. package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.js.map +1 -1
  467. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs +1 -1
  468. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.cjs.map +1 -1
  469. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +2 -1
  470. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js +91 -80
  471. package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.js.map +1 -1
  472. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
  473. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
  474. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +1 -1
  475. package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
  476. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs +1 -1
  477. package/dist/components/features/conversation-panel/conversation-card/conversation-card.cjs.map +1 -1
  478. package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +7 -1
  479. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js +87 -81
  480. package/dist/components/features/conversation-panel/conversation-card/conversation-card.js.map +1 -1
  481. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +1 -1
  482. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -1
  483. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +2 -1
  484. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +1 -1
  485. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -1
  486. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +1 -1
  487. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -1
  488. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +2 -1
  489. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +2 -1
  490. package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -1
  491. package/dist/components/features/conversation-panel/conversation-layouts-menu.cjs +2 -0
  492. package/dist/components/features/conversation-panel/conversation-layouts-menu.cjs.map +1 -0
  493. package/dist/components/features/conversation-panel/conversation-layouts-menu.d.ts +29 -0
  494. package/dist/components/features/conversation-panel/conversation-layouts-menu.js +177 -0
  495. package/dist/components/features/conversation-panel/conversation-layouts-menu.js.map +1 -0
  496. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
  497. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
  498. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +37 -0
  499. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +85 -45
  500. package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
  501. package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
  502. package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
  503. package/dist/components/features/conversation-panel/conversation-panel.js +296 -290
  504. package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
  505. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.cjs +2 -0
  506. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.cjs.map +1 -0
  507. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.d.ts +22 -0
  508. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.js +153 -0
  509. package/dist/components/features/conversation-panel/edit-conversation-tags-modal.js.map +1 -0
  510. package/dist/components/features/conversation-panel/hide-older-conversations-row.cjs +2 -0
  511. package/dist/components/features/conversation-panel/hide-older-conversations-row.cjs.map +1 -0
  512. package/dist/components/features/conversation-panel/hide-older-conversations-row.d.ts +6 -0
  513. package/dist/components/features/conversation-panel/hide-older-conversations-row.js +65 -0
  514. package/dist/components/features/conversation-panel/hide-older-conversations-row.js.map +1 -0
  515. package/dist/components/features/conversation-panel/menu-row.cjs +1 -1
  516. package/dist/components/features/conversation-panel/menu-row.cjs.map +1 -1
  517. package/dist/components/features/conversation-panel/menu-row.d.ts +11 -1
  518. package/dist/components/features/conversation-panel/menu-row.js +27 -16
  519. package/dist/components/features/conversation-panel/menu-row.js.map +1 -1
  520. package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
  521. package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
  522. package/dist/components/features/conversation-panel/skills-modal.js +29 -28
  523. package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
  524. package/dist/components/features/files-tab/file-content-viewer.cjs +1 -1
  525. package/dist/components/features/files-tab/file-content-viewer.js +5 -5
  526. package/dist/components/features/home/featured-automations/automation-health-indicator.cjs +1 -1
  527. package/dist/components/features/home/featured-automations/automation-health-indicator.cjs.map +1 -1
  528. package/dist/components/features/home/featured-automations/automation-health-indicator.js +1 -1
  529. package/dist/components/features/home/featured-automations/automation-health-indicator.js.map +1 -1
  530. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.cjs +1 -1
  531. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.cjs.map +1 -1
  532. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.d.ts +4 -3
  533. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.js +22 -25
  534. package/dist/components/features/home/featured-automations/automation-run-activity-metrics.js.map +1 -1
  535. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.cjs +1 -1
  536. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.cjs.map +1 -1
  537. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.d.ts +1 -1
  538. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.js +15 -15
  539. package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.js.map +1 -1
  540. package/dist/components/features/home/featured-automations/automation-run-health.cjs +1 -1
  541. package/dist/components/features/home/featured-automations/automation-run-health.cjs.map +1 -1
  542. package/dist/components/features/home/featured-automations/automation-run-health.d.ts +5 -3
  543. package/dist/components/features/home/featured-automations/automation-run-health.js +30 -23
  544. package/dist/components/features/home/featured-automations/automation-run-health.js.map +1 -1
  545. package/dist/components/features/home/featured-automations/home-automation-activity.d.ts +3 -2
  546. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs +1 -1
  547. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.cjs.map +1 -1
  548. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.d.ts +1 -1
  549. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js +59 -37
  550. package/dist/components/features/home/featured-automations/home-automation-run-tooltip.js.map +1 -1
  551. package/dist/components/features/manifest/manifest-form-field.d.ts +3 -1
  552. package/dist/components/features/manifest/manifest-review-step.d.ts +3 -1
  553. package/dist/components/features/onboarding/onboarding-host.d.ts +3 -4
  554. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +5 -9
  555. package/dist/components/features/settings/acp-auth-status-banner.d.ts +23 -6
  556. package/dist/components/features/settings/cloud-settings-link.cjs +1 -1
  557. package/dist/components/features/settings/cloud-settings-link.cjs.map +1 -1
  558. package/dist/components/features/settings/cloud-settings-link.js +5 -3
  559. package/dist/components/features/settings/cloud-settings-link.js.map +1 -1
  560. package/dist/components/features/settings/integrations-settings-link.cjs +1 -1
  561. package/dist/components/features/settings/integrations-settings-link.cjs.map +1 -1
  562. package/dist/components/features/settings/integrations-settings-link.d.ts +3 -1
  563. package/dist/components/features/settings/integrations-settings-link.js +20 -17
  564. package/dist/components/features/settings/integrations-settings-link.js.map +1 -1
  565. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.cjs +1 -1
  566. package/dist/components/features/settings/llm-profiles/llm-settings-local-view.js +2 -1
  567. package/dist/components/features/settings/llm-profiles/profiles-body.d.ts +2 -2
  568. package/dist/components/features/settings/llm-profiles/provider-connection-modal.cjs +1 -1
  569. package/dist/components/features/settings/llm-profiles/provider-connection-modal.js +3 -0
  570. package/dist/components/features/settings/sdk-settings/field-help.cjs +1 -1
  571. package/dist/components/features/settings/sdk-settings/field-help.cjs.map +1 -1
  572. package/dist/components/features/settings/sdk-settings/field-help.d.ts +1 -1
  573. package/dist/components/features/settings/sdk-settings/field-help.js +1 -1
  574. package/dist/components/features/settings/sdk-settings/field-help.js.map +1 -1
  575. package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs +1 -1
  576. package/dist/components/features/settings/sdk-settings/sdk-section-page.cjs.map +1 -1
  577. package/dist/components/features/settings/sdk-settings/sdk-section-page.d.ts +8 -7
  578. package/dist/components/features/settings/sdk-settings/sdk-section-page.js +172 -142
  579. package/dist/components/features/settings/sdk-settings/sdk-section-page.js.map +1 -1
  580. package/dist/components/features/settings/secrets-settings/secret-form.cjs +1 -1
  581. package/dist/components/features/settings/secrets-settings/secret-form.cjs.map +1 -1
  582. package/dist/components/features/settings/secrets-settings/secret-form.js +38 -25
  583. package/dist/components/features/settings/secrets-settings/secret-form.js.map +1 -1
  584. package/dist/components/features/settings/settings-dropdown-input.cjs +1 -1
  585. package/dist/components/features/settings/settings-dropdown-input.js +6 -6
  586. package/dist/components/features/sidebar/sidebar-nav-link.cjs +1 -1
  587. package/dist/components/features/sidebar/sidebar-nav-link.cjs.map +1 -1
  588. package/dist/components/features/sidebar/sidebar-nav-link.d.ts +10 -1
  589. package/dist/components/features/sidebar/sidebar-nav-link.js +54 -36
  590. package/dist/components/features/sidebar/sidebar-nav-link.js.map +1 -1
  591. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  592. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  593. package/dist/components/features/sidebar/sidebar-rail-body.d.ts +3 -1
  594. package/dist/components/features/sidebar/sidebar-rail-body.js +98 -58
  595. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  596. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  597. package/dist/components/features/sidebar/sidebar.cjs.map +1 -1
  598. package/dist/components/features/sidebar/sidebar.js +44 -43
  599. package/dist/components/features/sidebar/sidebar.js.map +1 -1
  600. package/dist/components/features/sidebar/use-sidebar-onboarding-checklist.cjs +1 -1
  601. package/dist/components/features/sidebar/use-sidebar-onboarding-checklist.js +3 -3
  602. package/dist/components/features/skills/build-skill-pills.cjs +1 -1
  603. package/dist/components/features/skills/build-skill-pills.cjs.map +1 -1
  604. package/dist/components/features/skills/build-skill-pills.js +60 -52
  605. package/dist/components/features/skills/build-skill-pills.js.map +1 -1
  606. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  607. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  608. package/dist/components/features/skills/extensions-navigation.js +54 -43
  609. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  610. package/dist/components/features/skills/skill-filter.cjs +1 -1
  611. package/dist/components/features/skills/skill-filter.cjs.map +1 -1
  612. package/dist/components/features/skills/skill-filter.d.ts +8 -3
  613. package/dist/components/features/skills/skill-filter.js +69 -52
  614. package/dist/components/features/skills/skill-filter.js.map +1 -1
  615. package/dist/components/shared/buttons/styled-tooltip.cjs +1 -1
  616. package/dist/components/shared/buttons/styled-tooltip.cjs.map +1 -1
  617. package/dist/components/shared/buttons/styled-tooltip.d.ts +2 -1
  618. package/dist/components/shared/buttons/styled-tooltip.js +2 -1
  619. package/dist/components/shared/buttons/styled-tooltip.js.map +1 -1
  620. package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
  621. package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
  622. package/dist/components/shared/filters/enum-filter-dropdown.d.ts +5 -1
  623. package/dist/components/shared/filters/enum-filter-dropdown.js +14 -14
  624. package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
  625. package/dist/components/shared/modals/confirmation-modal.cjs +1 -1
  626. package/dist/components/shared/modals/confirmation-modal.cjs.map +1 -1
  627. package/dist/components/shared/modals/confirmation-modal.d.ts +2 -1
  628. package/dist/components/shared/modals/confirmation-modal.js +8 -8
  629. package/dist/components/shared/modals/confirmation-modal.js.map +1 -1
  630. package/dist/components/shared/modals/settings/model-selector.cjs +1 -1
  631. package/dist/components/shared/modals/settings/model-selector.js +27 -27
  632. package/dist/components/shared/modals/settings/settings-form.cjs +1 -1
  633. package/dist/components/shared/modals/settings/settings-form.js +8 -8
  634. package/dist/config/defaults.cjs +1 -1
  635. package/dist/config/defaults.cjs.map +1 -1
  636. package/dist/config/defaults.js +9 -5
  637. package/dist/config/defaults.js.map +1 -1
  638. package/dist/constants/settings-nav.d.ts +8 -0
  639. package/dist/contexts/conversation-websocket-context.cjs +3 -3
  640. package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
  641. package/dist/contexts/conversation-websocket-context.d.ts +5 -0
  642. package/dist/contexts/conversation-websocket-context.js +194 -198
  643. package/dist/contexts/conversation-websocket-context.js.map +1 -1
  644. package/dist/contexts/websocket-provider-wrapper.cjs +1 -1
  645. package/dist/contexts/websocket-provider-wrapper.cjs.map +1 -1
  646. package/dist/contexts/websocket-provider-wrapper.js +31 -15
  647. package/dist/contexts/websocket-provider-wrapper.js.map +1 -1
  648. package/dist/extensions/canvas-extension-module-loader.d.ts +11 -0
  649. package/dist/hooks/chat/record-model-switch-message.cjs +1 -1
  650. package/dist/hooks/chat/record-model-switch-message.cjs.map +1 -1
  651. package/dist/hooks/chat/record-model-switch-message.d.ts +31 -0
  652. package/dist/hooks/chat/record-model-switch-message.js +25 -12
  653. package/dist/hooks/chat/record-model-switch-message.js.map +1 -1
  654. package/dist/hooks/chat/use-plan-mode-interceptor.cjs +2 -0
  655. package/dist/hooks/chat/use-plan-mode-interceptor.cjs.map +1 -0
  656. package/dist/hooks/chat/use-plan-mode-interceptor.d.ts +16 -0
  657. package/dist/hooks/chat/use-plan-mode-interceptor.js +43 -0
  658. package/dist/hooks/chat/use-plan-mode-interceptor.js.map +1 -0
  659. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  660. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  661. package/dist/hooks/mutation/use-create-conversation.js +5 -1
  662. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  663. package/dist/hooks/mutation/use-manage-canvas-extensions.d.ts +12 -0
  664. package/dist/hooks/mutation/use-read-conversation-file.cjs +1 -1
  665. package/dist/hooks/mutation/use-read-conversation-file.cjs.map +1 -1
  666. package/dist/hooks/mutation/use-read-conversation-file.js +11 -4
  667. package/dist/hooks/mutation/use-read-conversation-file.js.map +1 -1
  668. package/dist/hooks/mutation/use-save-settings.cjs +1 -1
  669. package/dist/hooks/mutation/use-save-settings.js +3 -3
  670. package/dist/hooks/mutation/use-switch-llm-profile.cjs +1 -1
  671. package/dist/hooks/mutation/use-switch-llm-profile.cjs.map +1 -1
  672. package/dist/hooks/mutation/use-switch-llm-profile.js +13 -25
  673. package/dist/hooks/mutation/use-switch-llm-profile.js.map +1 -1
  674. package/dist/hooks/mutation/use-update-conversation-tags.cjs +2 -0
  675. package/dist/hooks/mutation/use-update-conversation-tags.cjs.map +1 -0
  676. package/dist/hooks/mutation/use-update-conversation-tags.d.ts +8 -0
  677. package/dist/hooks/mutation/use-update-conversation-tags.js +45 -0
  678. package/dist/hooks/mutation/use-update-conversation-tags.js.map +1 -0
  679. package/dist/hooks/query/concurrency-limiter.cjs +2 -0
  680. package/dist/hooks/query/concurrency-limiter.cjs.map +1 -0
  681. package/dist/hooks/query/concurrency-limiter.d.ts +22 -0
  682. package/dist/hooks/query/concurrency-limiter.js +29 -0
  683. package/dist/hooks/query/concurrency-limiter.js.map +1 -0
  684. package/dist/hooks/query/query-keys.cjs +1 -1
  685. package/dist/hooks/query/query-keys.cjs.map +1 -1
  686. package/dist/hooks/query/query-keys.d.ts +10 -0
  687. package/dist/hooks/query/query-keys.js +2 -2
  688. package/dist/hooks/query/query-keys.js.map +1 -1
  689. package/dist/hooks/query/use-active-conversation.cjs +1 -1
  690. package/dist/hooks/query/use-active-conversation.js +4 -4
  691. package/dist/hooks/query/use-automation-sdk-version.cjs +1 -1
  692. package/dist/hooks/query/use-automation-sdk-version.cjs.map +1 -1
  693. package/dist/hooks/query/use-automation-sdk-version.d.ts +0 -1
  694. package/dist/hooks/query/use-automation-sdk-version.js +30 -55
  695. package/dist/hooks/query/use-automation-sdk-version.js.map +1 -1
  696. package/dist/hooks/query/use-automations.cjs.map +1 -1
  697. package/dist/hooks/query/use-automations.js.map +1 -1
  698. package/dist/hooks/query/use-backends-health.cjs +1 -1
  699. package/dist/hooks/query/use-backends-health.cjs.map +1 -1
  700. package/dist/hooks/query/use-backends-health.d.ts +1 -1
  701. package/dist/hooks/query/use-backends-health.js +50 -64
  702. package/dist/hooks/query/use-backends-health.js.map +1 -1
  703. package/dist/hooks/query/use-canvas-extensions.cjs +1 -0
  704. package/dist/hooks/query/use-canvas-extensions.d.ts +5 -0
  705. package/dist/hooks/query/use-canvas-extensions.js +3 -0
  706. package/dist/hooks/query/use-commit-changes.cjs +1 -1
  707. package/dist/hooks/query/use-commit-changes.js +4 -4
  708. package/dist/hooks/query/use-conversation-skills.cjs +1 -1
  709. package/dist/hooks/query/use-conversation-skills.cjs.map +1 -1
  710. package/dist/hooks/query/use-conversation-skills.d.ts +14 -5
  711. package/dist/hooks/query/use-conversation-skills.js +20 -4
  712. package/dist/hooks/query/use-conversation-skills.js.map +1 -1
  713. package/dist/hooks/query/use-latest-automation-runs.cjs +1 -1
  714. package/dist/hooks/query/use-latest-automation-runs.js +1 -0
  715. package/dist/hooks/query/use-paginated-conversations.cjs +1 -1
  716. package/dist/hooks/query/use-paginated-conversations.cjs.map +1 -1
  717. package/dist/hooks/query/use-paginated-conversations.js +19 -16
  718. package/dist/hooks/query/use-paginated-conversations.js.map +1 -1
  719. package/dist/hooks/query/use-provider-connections.cjs +1 -1
  720. package/dist/hooks/query/use-provider-connections.cjs.map +1 -1
  721. package/dist/hooks/query/use-provider-connections.d.ts +6 -3
  722. package/dist/hooks/query/use-provider-connections.js +7 -3
  723. package/dist/hooks/query/use-provider-connections.js.map +1 -1
  724. package/dist/hooks/query/use-search-providers.cjs +1 -1
  725. package/dist/hooks/query/use-search-providers.cjs.map +1 -1
  726. package/dist/hooks/query/use-search-providers.js +17 -10
  727. package/dist/hooks/query/use-search-providers.js.map +1 -1
  728. package/dist/hooks/query/use-sub-conversations.cjs +1 -1
  729. package/dist/hooks/query/use-sub-conversations.cjs.map +1 -1
  730. package/dist/hooks/query/use-sub-conversations.js +16 -16
  731. package/dist/hooks/query/use-sub-conversations.js.map +1 -1
  732. package/dist/hooks/query/use-unified-get-git-changes.cjs +1 -1
  733. package/dist/hooks/query/use-unified-get-git-changes.js +4 -4
  734. package/dist/hooks/query/use-unified-git-commits.cjs +1 -1
  735. package/dist/hooks/query/use-unified-git-commits.js +4 -4
  736. package/dist/hooks/query/use-unified-git-diff.cjs +1 -1
  737. package/dist/hooks/query/use-unified-git-diff.js +4 -4
  738. package/dist/hooks/query/use-unified-vscode-url.cjs +1 -1
  739. package/dist/hooks/query/use-unified-vscode-url.cjs.map +1 -1
  740. package/dist/hooks/query/use-unified-vscode-url.d.ts +1 -0
  741. package/dist/hooks/query/use-unified-vscode-url.js +40 -26
  742. package/dist/hooks/query/use-unified-vscode-url.js.map +1 -1
  743. package/dist/hooks/query/use-workspace-file-content.cjs +1 -1
  744. package/dist/hooks/query/use-workspace-file-content.js +5 -5
  745. package/dist/hooks/query/use-workspace-files.cjs +1 -1
  746. package/dist/hooks/query/use-workspace-files.js +6 -6
  747. package/dist/hooks/use-acp-credential-form.d.ts +6 -0
  748. package/dist/hooks/use-acp-model-context.cjs +1 -1
  749. package/dist/hooks/use-acp-model-context.js +3 -3
  750. package/dist/hooks/use-agent-state.cjs +1 -1
  751. package/dist/hooks/use-agent-state.cjs.map +1 -1
  752. package/dist/hooks/use-agent-state.d.ts +17 -1
  753. package/dist/hooks/use-agent-state.js +19 -9
  754. package/dist/hooks/use-agent-state.js.map +1 -1
  755. package/dist/hooks/use-automation-permissions.cjs +2 -0
  756. package/dist/hooks/use-automation-permissions.cjs.map +1 -0
  757. package/dist/hooks/use-automation-permissions.d.ts +43 -0
  758. package/dist/hooks/use-automation-permissions.js +52 -0
  759. package/dist/hooks/use-automation-permissions.js.map +1 -0
  760. package/dist/hooks/use-chat-input-model-state.cjs +1 -1
  761. package/dist/hooks/use-chat-input-model-state.js +3 -3
  762. package/dist/hooks/use-conversation-overview-git-diff-stats.cjs +1 -1
  763. package/dist/hooks/use-conversation-overview-git-diff-stats.js +4 -4
  764. package/dist/hooks/use-handle-plan-click.cjs +1 -1
  765. package/dist/hooks/use-handle-plan-click.cjs.map +1 -1
  766. package/dist/hooks/use-handle-plan-click.d.ts +3 -1
  767. package/dist/hooks/use-handle-plan-click.js +85 -26
  768. package/dist/hooks/use-handle-plan-click.js.map +1 -1
  769. package/dist/hooks/use-home-automation-actions.cjs +1 -1
  770. package/dist/hooks/use-home-automation-actions.cjs.map +1 -1
  771. package/dist/hooks/use-home-automation-actions.js +1 -0
  772. package/dist/hooks/use-home-automation-actions.js.map +1 -1
  773. package/dist/hooks/use-llm-configured.cjs +1 -1
  774. package/dist/hooks/use-llm-configured.js +3 -3
  775. package/dist/hooks/use-manifest-preflight.d.ts +1 -1
  776. package/dist/hooks/use-pinned-home-route.cjs +2 -0
  777. package/dist/hooks/use-pinned-home-route.cjs.map +1 -0
  778. package/dist/hooks/use-pinned-home-route.d.ts +33 -0
  779. package/dist/hooks/use-pinned-home-route.js +34 -0
  780. package/dist/hooks/use-pinned-home-route.js.map +1 -0
  781. package/dist/hooks/use-skill-enablement.cjs +2 -0
  782. package/dist/hooks/use-skill-enablement.cjs.map +1 -0
  783. package/dist/hooks/use-skill-enablement.d.ts +14 -0
  784. package/dist/hooks/use-skill-enablement.js +80 -0
  785. package/dist/hooks/use-skill-enablement.js.map +1 -0
  786. package/dist/hooks/use-unified-websocket-status.cjs +1 -1
  787. package/dist/hooks/use-unified-websocket-status.cjs.map +1 -1
  788. package/dist/hooks/use-unified-websocket-status.d.ts +7 -0
  789. package/dist/hooks/use-unified-websocket-status.js +5 -1
  790. package/dist/hooks/use-unified-websocket-status.js.map +1 -1
  791. package/dist/i18n/declaration.cjs +1 -1
  792. package/dist/i18n/declaration.cjs.map +1 -1
  793. package/dist/i18n/declaration.d.ts +83 -14
  794. package/dist/i18n/declaration.js +1 -1
  795. package/dist/i18n/declaration.js.map +1 -1
  796. package/dist/i18n/translation.cjs +3 -3
  797. package/dist/i18n/translation.cjs.map +1 -1
  798. package/dist/i18n/translation.js +1575 -402
  799. package/dist/i18n/translation.js.map +1 -1
  800. package/dist/index.cjs +1 -1
  801. package/dist/index.js +15 -14
  802. package/dist/lib/index.cjs +1 -1
  803. package/dist/lib/index.d.ts +1 -0
  804. package/dist/lib/index.js +1 -0
  805. package/dist/locales/ar/openhands.json +94 -25
  806. package/dist/locales/ca/openhands.json +94 -25
  807. package/dist/locales/de/openhands.json +94 -25
  808. package/dist/locales/en/openhands.json +94 -25
  809. package/dist/locales/es/openhands.json +94 -25
  810. package/dist/locales/fr/openhands.json +94 -25
  811. package/dist/locales/it/openhands.json +94 -25
  812. package/dist/locales/ja/openhands.json +94 -25
  813. package/dist/locales/ko-KR/openhands.json +94 -25
  814. package/dist/locales/no/openhands.json +94 -25
  815. package/dist/locales/pt/openhands.json +94 -25
  816. package/dist/locales/tr/openhands.json +94 -25
  817. package/dist/locales/uk/openhands.json +94 -25
  818. package/dist/locales/zh-CN/openhands.json +94 -25
  819. package/dist/locales/zh-TW/openhands.json +94 -25
  820. package/dist/manifests/automation-insights.cjs.map +1 -1
  821. package/dist/manifests/automation-insights.d.ts +10 -2
  822. package/dist/manifests/automation-insights.js.map +1 -1
  823. package/dist/manifests/automation-interface.cjs +1 -1
  824. package/dist/manifests/automation-interface.cjs.map +1 -1
  825. package/dist/manifests/automation-interface.d.ts +6 -0
  826. package/dist/manifests/automation-interface.js +11 -8
  827. package/dist/manifests/automation-interface.js.map +1 -1
  828. package/dist/manifests/automation-setup.cjs +1 -1
  829. package/dist/manifests/automation-setup.cjs.map +1 -1
  830. package/dist/manifests/automation-setup.d.ts +9 -16
  831. package/dist/manifests/automation-setup.js +17 -7
  832. package/dist/manifests/automation-setup.js.map +1 -1
  833. package/dist/manifests/manifest-actions.d.ts +1 -1
  834. package/dist/manifests/manifest-capabilities.d.ts +3 -1
  835. package/dist/manifests/manifest-local-validation.cjs +2 -0
  836. package/dist/manifests/manifest-local-validation.cjs.map +1 -0
  837. package/dist/manifests/manifest-local-validation.d.ts +15 -11
  838. package/dist/manifests/manifest-local-validation.js +8 -0
  839. package/dist/manifests/manifest-local-validation.js.map +1 -0
  840. package/dist/manifests/manifest-template.cjs +2 -0
  841. package/dist/manifests/manifest-template.cjs.map +1 -0
  842. package/dist/manifests/manifest-template.d.ts +4 -4
  843. package/dist/manifests/manifest-template.js +12 -0
  844. package/dist/manifests/manifest-template.js.map +1 -0
  845. package/dist/manifests/manifest-validation.cjs +1 -1
  846. package/dist/manifests/manifest-validation.cjs.map +1 -1
  847. package/dist/manifests/manifest-validation.js +106 -28
  848. package/dist/manifests/manifest-validation.js.map +1 -1
  849. package/dist/manifests/types.cjs.map +1 -1
  850. package/dist/manifests/types.d.ts +39 -4
  851. package/dist/manifests/types.js.map +1 -1
  852. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs +45 -4
  853. package/dist/node_modules/@openhands/extensions/automations/bundle-index.cjs.map +1 -1
  854. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js +1 -1
  855. package/dist/node_modules/@openhands/extensions/automations/bundle-index.js.map +1 -1
  856. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.cjs +8 -0
  857. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.cjs.map +1 -0
  858. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.js +221 -0
  859. package/dist/node_modules/@openhands/extensions/automations/catalog/custom-automation/manifest.js.map +1 -0
  860. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs +1 -1
  861. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.cjs.map +1 -1
  862. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js +5 -0
  863. package/dist/node_modules/@openhands/extensions/automations/catalog/github-agents-md-maintainer/manifest.js.map +1 -1
  864. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs +2 -2
  865. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.cjs.map +1 -1
  866. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js +6 -1
  867. package/dist/node_modules/@openhands/extensions/automations/catalog/github-issue-to-pr/manifest.js.map +1 -1
  868. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +2 -2
  869. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -1
  870. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +6 -1
  871. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -1
  872. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +1 -1
  873. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -1
  874. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +5 -0
  875. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -1
  876. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs +9 -0
  877. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
  878. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js +21 -0
  879. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-bitbucket-pr/manifest.js.map +1 -0
  880. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs +9 -0
  881. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.cjs.map +1 -0
  882. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js +21 -0
  883. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-gitlab-mr/manifest.js.map +1 -0
  884. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs +9 -0
  885. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.cjs.map +1 -0
  886. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js +21 -0
  887. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-bitbucket-pr/manifest.js.map +1 -0
  888. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs +9 -0
  889. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.cjs.map +1 -0
  890. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js +21 -0
  891. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-github-pr/manifest.js.map +1 -0
  892. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs +9 -0
  893. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.cjs.map +1 -0
  894. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js +21 -0
  895. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-issue-to-gitlab-mr/manifest.js.map +1 -0
  896. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs +1 -1
  897. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.cjs.map +1 -1
  898. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js +5 -0
  899. package/dist/node_modules/@openhands/extensions/automations/catalog/news-digest/manifest.js.map +1 -1
  900. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs +30 -0
  901. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.cjs.map +1 -0
  902. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js +65 -0
  903. package/dist/node_modules/@openhands/extensions/automations/catalog/qa-changes/manifest.js.map +1 -0
  904. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
  905. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
  906. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +28 -14
  907. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
  908. package/dist/node_modules/@openhands/extensions/automations/interface.cjs +1 -1
  909. package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -1
  910. package/dist/node_modules/@openhands/extensions/automations/interface.js +2 -1
  911. package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -1
  912. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  913. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  914. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +2 -2
  915. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  916. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs +2 -0
  917. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.cjs.map +1 -0
  918. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js +59 -0
  919. package/dist/node_modules/@openhands/extensions/integrations/catalog/gitlab.js.map +1 -0
  920. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs +1 -1
  921. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.cjs.map +1 -1
  922. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js +1 -1
  923. package/dist/node_modules/@openhands/extensions/integrations/catalog/notion.js.map +1 -1
  924. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs +1 -1
  925. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.cjs.map +1 -1
  926. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js +74 -72
  927. package/dist/node_modules/@openhands/extensions/integrations/catalog-index.js.map +1 -1
  928. package/dist/node_modules/@openhands/extensions/skills/index.cjs +42 -3
  929. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  930. package/dist/node_modules/@openhands/extensions/skills/index.js +22 -3
  931. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  932. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.cjs +1 -1
  933. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-conversation.js +1 -1
  934. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs +1 -1
  935. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.cjs.map +1 -1
  936. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js +8 -7
  937. package/dist/node_modules/@openhands/typescript-client/dist/conversation/remote-state.js.map +1 -1
  938. package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
  939. package/dist/node_modules/@openhands/typescript-client/dist/index.js +2 -2
  940. package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.cjs +1 -1
  941. package/dist/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +1 -1
  942. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs +2 -0
  943. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.cjs.map +1 -0
  944. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js +16 -0
  945. package/dist/node_modules/lucide-react/dist/esm/icons/blocks.js.map +1 -0
  946. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.cjs +2 -0
  947. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.cjs.map +1 -0
  948. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.js +21 -0
  949. package/dist/node_modules/lucide-react/dist/esm/icons/circle-question-mark.js.map +1 -0
  950. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs +2 -0
  951. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.cjs.map +1 -0
  952. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js +23 -0
  953. package/dist/node_modules/lucide-react/dist/esm/icons/panels-top-left.js.map +1 -0
  954. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.cjs +2 -0
  955. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.cjs.map +1 -0
  956. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.js +23 -0
  957. package/dist/node_modules/lucide-react/dist/esm/icons/shrink.js.map +1 -0
  958. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.cjs +2 -0
  959. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.cjs.map +1 -0
  960. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js +43 -0
  961. package/dist/node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js.map +1 -0
  962. package/dist/node_modules/lucide-react/dist/esm/icons/tags.cjs +2 -0
  963. package/dist/node_modules/lucide-react/dist/esm/icons/tags.cjs.map +1 -0
  964. package/dist/node_modules/lucide-react/dist/esm/icons/tags.js +22 -0
  965. package/dist/node_modules/lucide-react/dist/esm/icons/tags.js.map +1 -0
  966. package/dist/package.cjs +1 -1
  967. package/dist/package.cjs.map +1 -1
  968. package/dist/package.js +5 -5
  969. package/dist/package.js.map +1 -1
  970. package/dist/routes/agent-settings.d.ts +12 -0
  971. package/dist/routes/app-settings.cjs +1 -1
  972. package/dist/routes/app-settings.cjs.map +1 -1
  973. package/dist/routes/app-settings.js +11 -11
  974. package/dist/routes/files-tab.cjs +1 -1
  975. package/dist/routes/files-tab.cjs.map +1 -1
  976. package/dist/routes/files-tab.js +14 -14
  977. package/dist/routes/files-tab.js.map +1 -1
  978. package/dist/routes/llm-settings.cjs +1 -1
  979. package/dist/routes/llm-settings.cjs.map +1 -1
  980. package/dist/routes/llm-settings.d.ts +3 -1
  981. package/dist/routes/llm-settings.js +100 -91
  982. package/dist/routes/llm-settings.js.map +1 -1
  983. package/dist/routes/planner-tab.cjs +1 -1
  984. package/dist/routes/planner-tab.cjs.map +1 -1
  985. package/dist/routes/planner-tab.js +44 -28
  986. package/dist/routes/planner-tab.js.map +1 -1
  987. package/dist/services/canvas-ui.cjs +1 -1
  988. package/dist/services/canvas-ui.cjs.map +1 -1
  989. package/dist/services/canvas-ui.d.ts +5 -0
  990. package/dist/services/canvas-ui.js +24 -10
  991. package/dist/services/canvas-ui.js.map +1 -1
  992. package/dist/services/settings.cjs +1 -1
  993. package/dist/services/settings.cjs.map +1 -1
  994. package/dist/services/settings.js +3 -2
  995. package/dist/services/settings.js.map +1 -1
  996. package/dist/services/telemetry.cjs +1 -1
  997. package/dist/services/telemetry.cjs.map +1 -1
  998. package/dist/services/telemetry.d.ts +5 -0
  999. package/dist/services/telemetry.js +122 -115
  1000. package/dist/services/telemetry.js.map +1 -1
  1001. package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
  1002. package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
  1003. package/dist/stores/conversation-panel-preferences-store.d.ts +32 -5
  1004. package/dist/stores/conversation-panel-preferences-store.js +29 -12
  1005. package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
  1006. package/dist/stores/conversation-state-store.cjs +1 -1
  1007. package/dist/stores/conversation-state-store.cjs.map +1 -1
  1008. package/dist/stores/conversation-state-store.d.ts +9 -3
  1009. package/dist/stores/conversation-state-store.js +6 -3
  1010. package/dist/stores/conversation-state-store.js.map +1 -1
  1011. package/dist/stores/conversation-store.cjs +1 -1
  1012. package/dist/stores/conversation-store.cjs.map +1 -1
  1013. package/dist/stores/conversation-store.d.ts +2 -0
  1014. package/dist/stores/conversation-store.js +3 -0
  1015. package/dist/stores/conversation-store.js.map +1 -1
  1016. package/dist/stores/model-store.cjs +1 -1
  1017. package/dist/stores/model-store.cjs.map +1 -1
  1018. package/dist/stores/model-store.d.ts +7 -0
  1019. package/dist/stores/model-store.js +4 -0
  1020. package/dist/stores/model-store.js.map +1 -1
  1021. package/dist/types/automation.cjs.map +1 -1
  1022. package/dist/types/automation.d.ts +66 -1
  1023. package/dist/types/automation.js.map +1 -1
  1024. package/dist/types/canvas-extension.cjs +2 -0
  1025. package/dist/types/canvas-extension.cjs.map +1 -0
  1026. package/dist/types/canvas-extension.d.ts +77 -0
  1027. package/dist/types/canvas-extension.js +6 -0
  1028. package/dist/types/canvas-extension.js.map +1 -0
  1029. package/dist/types/settings.d.ts +7 -0
  1030. package/dist/ui/context-menu.d.ts +1 -1
  1031. package/dist/ui/help-link.cjs +1 -1
  1032. package/dist/ui/help-link.cjs.map +1 -1
  1033. package/dist/ui/help-link.d.ts +6 -1
  1034. package/dist/ui/help-link.js +32 -18
  1035. package/dist/ui/help-link.js.map +1 -1
  1036. package/dist/ui/toggle-switch.cjs +1 -1
  1037. package/dist/ui/toggle-switch.cjs.map +1 -1
  1038. package/dist/ui/toggle-switch.d.ts +4 -1
  1039. package/dist/ui/toggle-switch.js +4 -3
  1040. package/dist/ui/toggle-switch.js.map +1 -1
  1041. package/dist/utils/acp-auth-display.d.ts +35 -0
  1042. package/dist/utils/automation-catalog.cjs +1 -1
  1043. package/dist/utils/automation-catalog.cjs.map +1 -1
  1044. package/dist/utils/automation-catalog.d.ts +12 -1
  1045. package/dist/utils/automation-catalog.js +42 -12
  1046. package/dist/utils/automation-catalog.js.map +1 -1
  1047. package/dist/utils/automation-run-display.cjs +2 -0
  1048. package/dist/utils/automation-run-display.cjs.map +1 -0
  1049. package/dist/utils/automation-run-display.d.ts +20 -0
  1050. package/dist/utils/automation-run-display.js +85 -0
  1051. package/dist/utils/automation-run-display.js.map +1 -0
  1052. package/dist/utils/automation-schedule.cjs +1 -1
  1053. package/dist/utils/automation-schedule.cjs.map +1 -1
  1054. package/dist/utils/automation-schedule.d.ts +16 -0
  1055. package/dist/utils/automation-schedule.js +2 -0
  1056. package/dist/utils/automation-schedule.js.map +1 -1
  1057. package/dist/utils/cache-utils.cjs +1 -1
  1058. package/dist/utils/cache-utils.js +5 -5
  1059. package/dist/utils/constants.cjs +1 -1
  1060. package/dist/utils/constants.cjs.map +1 -1
  1061. package/dist/utils/constants.d.ts +4 -0
  1062. package/dist/utils/constants.js +23 -3
  1063. package/dist/utils/constants.js.map +1 -1
  1064. package/dist/utils/format-event-timestamp.cjs +2 -0
  1065. package/dist/utils/format-event-timestamp.cjs.map +1 -0
  1066. package/dist/utils/format-event-timestamp.d.ts +1 -0
  1067. package/dist/utils/format-event-timestamp.js +13 -0
  1068. package/dist/utils/format-event-timestamp.js.map +1 -0
  1069. package/dist/utils/format-model-name.cjs +1 -1
  1070. package/dist/utils/format-model-name.cjs.map +1 -1
  1071. package/dist/utils/format-model-name.d.ts +7 -3
  1072. package/dist/utils/format-model-name.js +6 -11
  1073. package/dist/utils/format-model-name.js.map +1 -1
  1074. package/dist/utils/format-relative-time.cjs +1 -1
  1075. package/dist/utils/format-relative-time.cjs.map +1 -1
  1076. package/dist/utils/format-relative-time.d.ts +7 -0
  1077. package/dist/utils/format-relative-time.js +7 -2
  1078. package/dist/utils/format-relative-time.js.map +1 -1
  1079. package/dist/utils/git-diff-stats.cjs +2 -2
  1080. package/dist/utils/git-diff-stats.cjs.map +1 -1
  1081. package/dist/utils/git-diff-stats.d.ts +4 -0
  1082. package/dist/utils/git-diff-stats.js +12 -2
  1083. package/dist/utils/git-diff-stats.js.map +1 -1
  1084. package/dist/utils/path-utils.cjs +1 -1
  1085. package/dist/utils/path-utils.cjs.map +1 -1
  1086. package/dist/utils/path-utils.d.ts +15 -3
  1087. package/dist/utils/path-utils.js +29 -3
  1088. package/dist/utils/path-utils.js.map +1 -1
  1089. package/dist/utils/plan-file.cjs +4 -0
  1090. package/dist/utils/plan-file.cjs.map +1 -0
  1091. package/dist/utils/plan-file.d.ts +18 -0
  1092. package/dist/utils/plan-file.js +58 -0
  1093. package/dist/utils/plan-file.js.map +1 -0
  1094. package/dist/utils/recommended-automation-rail.cjs +1 -1
  1095. package/dist/utils/recommended-automation-rail.cjs.map +1 -1
  1096. package/dist/utils/recommended-automation-rail.js +1 -0
  1097. package/dist/utils/recommended-automation-rail.js.map +1 -1
  1098. package/dist/utils/scroll-fade-state.cjs +1 -1
  1099. package/dist/utils/scroll-fade-state.cjs.map +1 -1
  1100. package/dist/utils/scroll-fade-state.d.ts +6 -0
  1101. package/dist/utils/scroll-fade-state.js +8 -1
  1102. package/dist/utils/scroll-fade-state.js.map +1 -1
  1103. package/dist/utils/sdk-settings-schema.cjs +1 -1
  1104. package/dist/utils/sdk-settings-schema.cjs.map +1 -1
  1105. package/dist/utils/sdk-settings-schema.d.ts +1 -0
  1106. package/dist/utils/sdk-settings-schema.js +25 -22
  1107. package/dist/utils/sdk-settings-schema.js.map +1 -1
  1108. package/dist/utils/skill-enablement.cjs +2 -0
  1109. package/dist/utils/skill-enablement.cjs.map +1 -0
  1110. package/dist/utils/skill-enablement.d.ts +51 -0
  1111. package/dist/utils/skill-enablement.js +31 -0
  1112. package/dist/utils/skill-enablement.js.map +1 -0
  1113. package/dist/utils/utils.cjs +1 -1
  1114. package/dist/utils/utils.cjs.map +1 -1
  1115. package/dist/utils/utils.js +11 -11
  1116. package/dist/utils/utils.js.map +1 -1
  1117. package/dist/utils/vscode-origin.cjs +2 -0
  1118. package/dist/utils/vscode-origin.cjs.map +1 -0
  1119. package/dist/utils/vscode-origin.d.ts +55 -0
  1120. package/dist/utils/vscode-origin.js +27 -0
  1121. package/dist/utils/vscode-origin.js.map +1 -0
  1122. package/dist/utils/workspace-mode.d.ts +4 -0
  1123. package/package.json +5 -5
  1124. package/scripts/check-sdk-version-sync.mjs +6 -6
  1125. package/scripts/check-translation-completeness.cjs +1 -0
  1126. package/scripts/dev-extra-backend.mjs +28 -9
  1127. package/scripts/dev-safe.mjs +81 -8
  1128. package/scripts/dev-static.mjs +35 -37
  1129. package/scripts/dev-with-automation.mjs +83 -2
  1130. package/scripts/ingress.mjs +27 -1
  1131. package/scripts/static-server.mjs +107 -2
  1132. package/tools/canvas_ui_tool.py +19 -0
  1133. package/build/assets/active-backend-context-DKFSMbn3.js +0 -2
  1134. package/build/assets/agent-profiles-settings-D4cY5U2T.js +0 -1
  1135. package/build/assets/agent-server-conversation-service.api-DozDKIW_.js +0 -86
  1136. package/build/assets/agent-settings-351vXWc9.js +0 -2
  1137. package/build/assets/agent-settings-Ce7BDZ6I.js +0 -1
  1138. package/build/assets/alert-banner-Kyy1YWZU.js +0 -1
  1139. package/build/assets/api-key-entry-screen-INIxqAMs.js +0 -1
  1140. package/build/assets/automation-detail-DXDhUwPq.js +0 -3
  1141. package/build/assets/automation-git-sync-CzyS4cn1.js +0 -1
  1142. package/build/assets/automation-setup-route-FRr05f_g.js +0 -1
  1143. package/build/assets/automations-list-CERuQWE6.js +0 -1
  1144. package/build/assets/backend-form-modal-DK78-jn1.js +0 -1
  1145. package/build/assets/bot-C-0Wu7vQ.js +0 -1
  1146. package/build/assets/browser-11etCQ04.js +0 -7
  1147. package/build/assets/check-Cf2YoT90.js +0 -1
  1148. package/build/assets/chevron-down-C3OQ-ehx.js +0 -1
  1149. package/build/assets/chevron-right-CN1uUiJ1.js +0 -1
  1150. package/build/assets/circle-check-g5yeGMd-.js +0 -1
  1151. package/build/assets/command-menu-BZQ8S3Ke.js +0 -1
  1152. package/build/assets/commits-tab-DZtJgaDM.js +0 -1
  1153. package/build/assets/confirmation-modal-Bk4JRcCM.js +0 -1
  1154. package/build/assets/conversation-CchMzpGl.js +0 -1
  1155. package/build/assets/conversation-Dpzftz57.js +0 -93
  1156. package/build/assets/conversation-panel-CchMzpGl.js +0 -1
  1157. package/build/assets/conversation-state-store-a9d2fxRc.js +0 -1
  1158. package/build/assets/edit-automation-modal-D-urtv8n.js +0 -1
  1159. package/build/assets/empty-state-CvaVahVr.js +0 -1
  1160. package/build/assets/enum-filter-dropdown-DliX_Lo0.js +0 -1
  1161. package/build/assets/extensions-hub-CFduxBnk.js +0 -1
  1162. package/build/assets/extensions-navigation-BeC224yX.js +0 -1
  1163. package/build/assets/external-link-DFpYunfj.js +0 -1
  1164. package/build/assets/files-tab-CL3J9b3p.js +0 -1
  1165. package/build/assets/format-model-name-BNPKVsIq.js +0 -1
  1166. package/build/assets/get-git-path-DlAJa_i6.js +0 -1
  1167. package/build/assets/git-repo-dropdown-DGMEhz7d.js +0 -1
  1168. package/build/assets/home-BCGlNJCA.js +0 -1
  1169. package/build/assets/home-DB1pRqTC.js +0 -1
  1170. package/build/assets/home-automation-run-tooltip-CooFQRIG.js +0 -1
  1171. package/build/assets/home-store-Dl1dPE58.js +0 -1
  1172. package/build/assets/index-home-DB1pRqTC.js +0 -1
  1173. package/build/assets/info-uYSVzX86.js +0 -1
  1174. package/build/assets/install-server-modal-BbJdhzet.js +0 -1
  1175. package/build/assets/kebab-menu-item-content-BYokkRHi.js +0 -1
  1176. package/build/assets/list-filter-OFkpRrmi.js +0 -1
  1177. package/build/assets/llm-not-configured-banner-BqqYnJ1t.js +0 -27
  1178. package/build/assets/llm-settings-CnDbbmVW.js +0 -1
  1179. package/build/assets/llm-settings-S8Yjg__1.js +0 -1
  1180. package/build/assets/llm-subscription-service-BpPfzW4x.js +0 -1
  1181. package/build/assets/loader-circle-nvrwthvj.js +0 -1
  1182. package/build/assets/manage-backends-modal-BCUPswyl.js +0 -1
  1183. package/build/assets/manifest-58597dde.js +0 -1
  1184. package/build/assets/markdown-renderer-Cb2sBWtV.js +0 -8
  1185. package/build/assets/mcp-page-Bm4K2NQq.js +0 -9
  1186. package/build/assets/messages-BTN5thLe.js +0 -40
  1187. package/build/assets/onboarding-Cx_kaiD1.js +0 -1
  1188. package/build/assets/onboarding-modal-vMwn7ihv.js +0 -1
  1189. package/build/assets/organization-service.api-C8XpQ0pM.js +0 -1
  1190. package/build/assets/pencil-Clh1Wjvh.js +0 -1
  1191. package/build/assets/planner-tab-DQvDU3ap.js +0 -1
  1192. package/build/assets/plug-BuQhHSSG.js +0 -1
  1193. package/build/assets/plugins-management-service-BjYeF0b0.js +0 -1
  1194. package/build/assets/plus-CEKne-Yp.js +0 -1
  1195. package/build/assets/profiles-service.api-QB-T_u-g.js +0 -1
  1196. package/build/assets/providers-FfSZ5TXP.js +0 -1
  1197. package/build/assets/proxy-tcFL2yTQ.js +0 -1
  1198. package/build/assets/recommended-automations-launcher-Bw8uC4V6.js +0 -1
  1199. package/build/assets/refresh-cw-Bh69DyYO.js +0 -1
  1200. package/build/assets/root-BLeQfBEq.css +0 -1
  1201. package/build/assets/root-ZKKYPR1Z.js +0 -2
  1202. package/build/assets/root-layout-luJoE9IG.js +0 -2
  1203. package/build/assets/schema-field-Csw5fhtN.js +0 -1
  1204. package/build/assets/scroll-fade-state-Dw-i4SGq.js +0 -1
  1205. package/build/assets/sdk-section-page-HTffvm7Q.js +0 -1
  1206. package/build/assets/secret-form-HTUbYw5o.js +0 -1
  1207. package/build/assets/secrets-service-BTor9uAU.js +0 -1
  1208. package/build/assets/settings-BlmrkwRi.js +0 -1
  1209. package/build/assets/settings-DcNPxz0v.js +0 -1
  1210. package/build/assets/settings-index-CKq0b0Vg.js +0 -1
  1211. package/build/assets/settings-service.api-B2agVfjL.js +0 -1
  1212. package/build/assets/shared-conversation-B55pCyBG.js +0 -1
  1213. package/build/assets/shield-check-CFDViW82.js +0 -1
  1214. package/build/assets/sidebar-mobile-menu-toggle-BOtyJHwE.js +0 -1
  1215. package/build/assets/sidebar-nav-link-CPzhyHQg.js +0 -1
  1216. package/build/assets/sidebar-store-DtpU7zaI.js +0 -1
  1217. package/build/assets/skill-filter-CWZ5kjcg.js +0 -2
  1218. package/build/assets/skill-scope-CV1dkAbW.js +0 -1
  1219. package/build/assets/skills-plugins-DGHULTq6.js +0 -1
  1220. package/build/assets/skills-settings-CM1lFv3e.js +0 -1
  1221. package/build/assets/styled-tooltip-Dl06rkpY.js +0 -1
  1222. package/build/assets/toggle-switch-Fd_QGz0r.js +0 -1
  1223. package/build/assets/trash-2-Dl8_RGz0.js +0 -1
  1224. package/build/assets/trash-_RMt7Ayc.js +0 -1
  1225. package/build/assets/triangle-alert-SM-q4NU_.js +0 -1
  1226. package/build/assets/usage-tab-BcfWV6db.js +0 -1
  1227. package/build/assets/use-acp-credential-form-BsSW5NHG.js +0 -1
  1228. package/build/assets/use-activate-agent-profile-B2NS8nA5.js +0 -1
  1229. package/build/assets/use-agent-profiles-DWBPC0Si.js +0 -1
  1230. package/build/assets/use-config-Bft35DOK.js +0 -1
  1231. package/build/assets/use-create-conversation-DwN5vv2f.js +0 -1
  1232. package/build/assets/use-create-secret-BSxJMxHp.js +0 -1
  1233. package/build/assets/use-has-permission-B3C8rQmR.js +0 -1
  1234. package/build/assets/use-is-authed-CFGkY3-Z.js +0 -1
  1235. package/build/assets/use-llm-configured-BI6obxsc.js +0 -1
  1236. package/build/assets/use-llm-profiles-djGAhTWL.js +0 -1
  1237. package/build/assets/use-manifest-capabilities-3z0-1G59.js +0 -1
  1238. package/build/assets/use-onboarding-completion-BXpyUSsJ.js +0 -1
  1239. package/build/assets/use-plugins-marketplace-DI4_pK56.js +0 -1
  1240. package/build/assets/use-save-agent-profile-DdBSTdpN.js +0 -1
  1241. package/build/assets/use-settings-C5VhGpqd.js +0 -1
  1242. package/build/assets/use-settings-nav-items-DHaUu1Dg.js +0 -16
  1243. package/build/assets/use-tracking-D5t9otIF.js +0 -3
  1244. package/build/assets/utils-DaCIEEQP.js +0 -1
  1245. package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kepq2zme-ZixYGy6E.js +0 -186
  1246. package/build/assets/vendor~index-home~home~conversation-panel~conversation~alert-banner-B3qC_oj8.js +0 -1
  1247. package/build/assets/vendor~root-layout-BlUaZ18v.js +0 -1
  1248. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-B2OLKL7N.js +0 -1
  1249. package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iw7io29p-Dz-MAyNb.js +0 -1
  1250. package/build/assets/x-DkgltWa0.js +0 -1
  1251. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +0 -2
  1252. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +0 -1
  1253. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +0 -35
  1254. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +0 -247
  1255. package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +0 -1
  1256. package/dist/components/features/tips/random-tip.d.ts +0 -2
  1257. package/dist/hooks/query/use-skills.cjs +0 -2
  1258. package/dist/hooks/query/use-skills.cjs.map +0 -1
  1259. package/dist/hooks/query/use-skills.d.ts +0 -7
  1260. package/dist/hooks/query/use-skills.js +0 -13
  1261. package/dist/hooks/query/use-skills.js.map +0 -1
  1262. package/dist/hooks/use-has-permission.cjs +0 -2
  1263. package/dist/hooks/use-has-permission.cjs.map +0 -1
  1264. package/dist/hooks/use-has-permission.d.ts +0 -1
  1265. package/dist/hooks/use-has-permission.js +0 -8
  1266. package/dist/hooks/use-has-permission.js.map +0 -1
  1267. package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs +0 -2
  1268. package/dist/node_modules/lucide-react/dist/esm/icons/eye.cjs.map +0 -1
  1269. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +0 -14
  1270. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js.map +0 -1
  1271. package/dist/utils/tips.d.ts +0 -7
  1272. package/dist/utils/workspace-relative-path.cjs +0 -2
  1273. package/dist/utils/workspace-relative-path.cjs.map +0 -1
  1274. package/dist/utils/workspace-relative-path.d.ts +0 -10
  1275. package/dist/utils/workspace-relative-path.js +0 -22
  1276. package/dist/utils/workspace-relative-path.js.map +0 -1
  1277. /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{r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as i}from"./useMutation-CJuK90oc.js";import{t as a}from"./useQuery-S6j94er1.js";import{G as o,b as s,dt as c,gt as l,lt as u,q as d,st as f,yt as p}from"./active-backend-context-rZiLJRUc.js";import{D as m,K as h,k as g,t as _,w as ee}from"./utils-BOco8mxR.js";import{a as v,c as y,n as te,o as ne,r as b}from"./agent-server-client-options-BikiNwTa.js";import{y as re}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{a as x}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{t as S}from"./proxy-CBgMd2zf.js";import{t as ie}from"./use-settings-Dn00UISA.js";import{n as C}from"./navigation-context-CQZwH_tC.js";import{_t as w,ct as T,dt as E,ft as D,gt as ae,ht as O,lt as k,mt as A,ot as j,pt as oe,st as M,ut as N,vt as se}from"./vendor-markdown-j0kYzV48.js";import{_ as P,c as ce,h as F,o as le,t as I}from"./conversation-store-DVVfkCsk.js";import{C as L,D as R,E as z,b as ue,c as de,f as B,j as fe,l as pe,p as V,s as me,t as H,u as U,y as he}from"./agent-server-conversation-service.api-DYFsNHKf.js";import{a as ge,d as _e,i as ve,s as ye,t as be,y as xe}from"./conversation-state-store-D1_G_9I-.js";import{c as Se,i as Ce,n as we,r as Te,s as Ee}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DXqM7vqB.js";import{t as De}from"./scroll-fade-state-Dt_fx2kf.js";import{t as Oe}from"./use-user-conversation-ZWlXtbZb.js";import{t as ke}from"./copy-to-clipboard-button-B3w0X7WH.js";import"./syntax-highlighter-BGDg_7w9.js";var W=e(t(),1);function G(){let{conversationId:e}=C();return{conversationId:e}}function Ae(){let{conversationId:e}=G();if(!e)throw Error(`useConversationId must be used within a route that has a conversationId parameter`);return{conversationId:e}}var je=()=>{let{conversationId:e}=G(),t=!!e&&e.startsWith(`task-`),n=Oe(!e||t?null:e,e=>{let t=e.state.data;return t&&(!t.conversation_url||t.sandbox_status===`PAUSED`||!t.title&&ee(t.execution_status))?3e3:3e4});return(0,W.useEffect)(()=>{let e=n.data;ye.setCurrentConversation(e||null)},[e,n.isFetched,n?.data?.execution_status]),n};function Me(e){if(!e)return g.LOADING;switch(e){case m.IDLE:return g.AWAITING_USER_INPUT;case m.RUNNING:return g.RUNNING;case m.PAUSED:return g.PAUSED;case m.WAITING_FOR_CONFIRMATION:return g.AWAITING_USER_CONFIRMATION;case m.FINISHED:return g.FINISHED;case m.ERROR:return g.ERROR;case m.STUCK:return g.ERROR;default:return g.LOADING}}function Ne(e){let{conversationId:t}=G(),n=e??t,r=!e||e===t,i=be(e=>n?e.executionStatusByConversation[n]??null:null),a=je().data?.execution_status??null,o=i??(r?a:null);return{curAgentState:(0,W.useMemo)(()=>Me(o),[o]),executionStatus:o}}function Pe(){let e=I(e=>e.localPlanningConversationId),{curAgentState:t}=Ne(e??void 0);return{localPlanningConversationId:e,curPlanningAgentState:t,isPlanningAgentRunning:!!e&&(t===g.RUNNING||t===g.LOADING)}}var Fe=`auth`,Ie=`session_api_key`;function Le(e,t){t&&e.send(JSON.stringify({type:Fe,[Ie]:t}))}var Re=1e4;function ze(e){let t=setTimeout(()=>{e.readyState===WebSocket.CONNECTING&&e.close()},Re);return()=>clearTimeout(t)}var Be=1e3,Ve=3e4,He=(e,t)=>{let[n,r]=W.useState(!1),[i,a]=W.useState(null),[o,s]=W.useState(!1),c=W.useRef(null),l=W.useRef(0),u=W.useRef(null),d=W.useRef(!0),f=W.useRef(new WeakSet),p=W.useRef(t);W.useEffect(()=>{p.current=t},[t]);let m=W.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=ze(n);n.onopen=e=>{i(),Le(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(Be*2**(l.current-1),Ve),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]);W.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=W.useCallback(e=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(e)},[]),g=W.useCallback(()=>{d.current=!1,s(!1),u.current&&=(clearTimeout(u.current),null),c.current&&(f.current.delete(c.current),c.current.close())},[]),_=W.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:_}},Ue=`Unable to connect to server`;function We(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,Ge=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,Ke=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`,qe=e=>J(e)&&(e.action.kind===`ExecuteBashAction`||e.action.kind===`TerminalAction`),Je=e=>K(e)&&(e.observation.kind===`ExecuteBashObservation`||e.observation.kind===`TerminalObservation`),Ye=e=>K(e)&&e.observation.kind===`PlanningFileEditorObservation`,Xe=e=>K(e)&&e.observation.kind===`BrowserObservation`,Ze=e=>K(e)&&e.observation.kind===`SwitchLLMObservation`,Qe=e=>J(e)&&e.action.kind===`BrowserNavigateAction`,$e=e=>J(e)&&(e.tool_name===`canvas_ui`||e.tool_name===`canvas_ui_control`),et=e=>J(e)&&e.tool_name===`launch_child_conversation`,tt=e=>e.source===`agent`&&`system_prompt`in e&&`tools`in e&&typeof e.system_prompt==`object`&&Array.isArray(e.tools),nt=e=>`kind`in e&&e.kind===`ConversationStateUpdateEvent`,rt=e=>e.key===`full_state`,it=e=>e.key===`execution_status`,at=e=>e.key===`stats`,ot=e=>e.key===`goal`,st=e=>`kind`in e&&e.kind===`ConversationErrorEvent`,ct=e=>`kind`in e&&e.kind===`ServerErrorEvent`,lt=e=>st(e)||ct(e),ut=e=>`kind`in e&&e.kind===`HookExecutionEvent`,dt=e=>`kind`in e&&e.kind===`ACPToolCallEvent`,Y=e=>`kind`in e&&e.kind===`StreamingDeltaEvent`,ft=e=>`kind`in e&&e.kind===`Condensation`;function pt(e){return We(e)}var mt=e=>e.thought.filter(e=>e.type===`text`).map(e=>e.text).join(`
2
+ `),ht=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
+ `):``,gt=e=>mt(e).trim().length>0,_t=(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()}},vt=(e,t)=>{if(J(e))return e.action.kind===`ThinkAction`?null:gt(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:gt(n)?n:null}return null},yt=(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,bt=e=>{for(let t=e.length-1;t>=0;--t){let n=e[t];if(q(n)&&n.source===`user`)return t}return-1},xt=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),St=(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}},Ct=(e,t)=>{let n=bt(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))},wt=(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},Tt=(e,t)=>wt(e,e=>(e.content?.length??0)>0&&X(t,e)),Et=(e,t)=>wt(e,e=>!!e.reasoning_content&&X(t,e)),Dt=(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},Ot=(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 St(e,t.map((e,t)=>t===i?e.trimEnd():e))},kt=e=>e.some(e=>e.includes(`<function=`)),At=e=>J(e)?ht(e).trim().length>0:q(e)&&e.source===`agent`?_t(xt(e.llm_message.content)).reasoning.length>0:!1,jt=(e,t)=>{let n=Ct(t,e);if(n.length===0)return null;let r=Dt(t,n,At(e));return r.push(e),r},Mt=(e,t)=>{let n=xt(e.thought);if(!n)return null;let r=Tt(t,e);if(r.length===0)return null;let i=r.map(({event:e})=>e.content??``);return!Ot(n,i).matched&&!kt(i)?null:Dt(t,r,ht(e).trim().length>0)},Nt=(e,t)=>{if(ht(e).trim().length===0)return null;let n=Et(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},Pt=(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]=yt(e,r),n):(n.push(e),n)}if(J(e)&&e.action.kind===`FinishAction`||q(e)&&e.source===`agent`){let t=jt(e,n);if(t)return t}if(J(e)&&e.action.kind!==`FinishAction`&&e.action.kind!==`ThinkAction`){let t=Mt(e,n)??Nt(e,n);if(t)return t.push(e),t}if(dt(e)){let t=n.findIndex(t=>dt(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},Ft=e=>`id`in e?e.id:void 0,It=e=>`timestamp`in e?e.timestamp:void 0,Lt=(e,t)=>{let n=It(e),r=It(t);return!n&&!r?0:n?r?n.localeCompare(r):-1:1},Rt=(e,t)=>{if(e.length===0)return!1;let n=e[e.length-1],r=It(n),i=It(t);return!r||!i?!1:i<r},zt=(e,t)=>{let n=Ft(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]=yt(t,o):c.push(t),{...e,events:c,eventIds:i,uiEvents:Pt(t,e.uiEvents)}},Bt=e=>({...e,events:[...e.events].sort(Lt),uiEvents:[...e.uiEvents].sort(Lt)}),Vt=(e,t)=>{let n=zt(e,t);return n===e?e:!Rt(e.events,t)&&!Rt(e.uiEvents,t)?n:Bt(n)},Z=P()(e=>({events:[],eventIds:new Set,uiEvents:[],loadedConversationId:null,addEvent:t=>e(e=>Vt(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=Ft(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]=yt(e,c):r.push(e),i=Pt(e,i)}}return a?Bt({...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}))})),Ht={errorMessage:null,errorType:null,errorCode:null,errorClassification:null},Ut=P(e=>({...Ht,setErrorMessage:(t,n=`conversation`,r=null,i=null)=>e(()=>({errorMessage:t,errorType:n,errorCode:r,errorClassification:i})),removeErrorMessage:()=>e(()=>({...Ht})),clearConnectionError:()=>e(e=>e.errorType===`connection`?{...Ht}:e)})),Wt=15e4,Gt={pendingMessages:[]},Kt=()=>`pending-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,qt=P((e,t)=>({...Gt,enqueuePendingMessage:n=>{let r=Kt(),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`)},Wt),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(()=>({...Gt})),reassignPendingMessages:(t,n)=>e(e=>({pendingMessages:e.pendingMessages.map(e=>e.conversationId===t?{...e,conversationId:n}:e)}))})),Jt=P(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:[]})})),Yt={url:``,screenshotSrc:``},Xt=P(e=>({...Yt,setUrl:t=>e({url:t}),setScreenshotSrc:t=>e({screenshotSrc:t}),reset:()=>e(Yt)})),Zt={statusByConversation:{}},Qt=P()(F(e=>({...Zt,setStatus:(t,n)=>e(e=>({statusByConversation:{...e.statusByConversation,[t]:n}}))}),{name:`GoalStore`})),$t=typeof requestAnimationFrame==`function`?{schedule:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}:{schedule:e=>setTimeout(e,16),cancel:e=>clearTimeout(e)};function en(e,t=$t){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)=>yt(t,e)))};return{enqueue:e=>{n.push(e),r===null&&(r=t.schedule(a))},flush:a,reset:()=>{i(),n=[]}}}function tn(e,t,n){return n?e.includes(t)?e:[...e,t]:[t]}function nn(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 rn(e,t){return t&&e.includes(t)?t:null}function an(e,t,n){e&&le(e,{filesTabOpenPaths:t,filesTabSelectedPath:n})}var on=P(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 an(n,t.openPaths,t.selectedPath),t}let r=e.selectedConversationId===n,i={selectedPath:t,selectedConversationId:n,openPaths:tn(e.openPaths,t,r)};return an(n,i.openPaths,i.selectedPath),i}),closeOpenPath:t=>e(e=>{if(!e.openPaths.includes(t))return e;let n=nn(e.openPaths,t,e.selectedPath),r={openPaths:e.openPaths.filter(e=>e!==t),selectedPath:n};return an(e.selectedConversationId,r.openPaths,r.selectedPath),r}),hydrateForConversation:(t,n,r)=>e({selectedConversationId:t,openPaths:n,selectedPath:rn(n,r)})})),sn=new Set([`files`,`browser`,`terminal`,`planner`,`tasklist`]);function cn(e){let t=I.getState();t.setSelectedTab(e),t.isRightPanelShown||(t.setHasRightPanelToggled(!0),t.setIsRightPanelShown(!0))}function ln(e){return sn.has(e)}function un(e,t){let n=ye.getCurrentConversation();dn({kind:`CanvasUIAction`,command:`navigate_to_file`,path:e},t??n?.id??null)}function dn(e,t=null){switch(e.command){case`navigate_to_file`:case`show_preview`:{if(cn(`files`),!e.path)return;let n=ye.getCurrentConversation()?.workspace?.working_dir,r=ge(e.path,n);if(!r)return;on.getState().setSelectedPath(r,t);return}case`open_tab`:e.tab===`vscode`?cn(`files`):e.tab&&ln(e.tab)?cn(e.tab):e.tab&&console.warn(`[canvas_ui] Ignoring open_tab with unknown tab: ${e.tab}`);return}}var fn=3e3,pn=18e4,mn=`openhands-child-conversation-launches:`,Q=(e,t)=>({status:`error`,error:e,guidance:t}),hn=e=>e.map(e=>`"${e}"`).join(` or `),gn=e=>e?.trim()||null;function _n(e){let t=e.target;if(!U.includes(t))return{ok:!1,failure:Q(`Unknown target ${JSON.stringify(e.target)}.`,`\`target\` must be exactly ${hn(U)}. Nothing was launched — call ${B} again with a valid target.`)};let n=gn(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=gn(e.repository),i=gn(e.branch),a=gn(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&&!de.includes(a)?{ok:!1,failure:Q(`Unknown isolation ${JSON.stringify(e.isolation)}.`,`\`isolation\` must be exactly ${hn(de)}. Nothing was launched — call ${B} again with a valid isolation.`)}:{ok:!0,params:{target:t,task:n,title:gn(e.title),repository:r,branch:i,isolation:a??`worktree`}}}function vn(e,t){let n=`${mn}${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 yn(e){let t=p(e);return typeof window>`u`?t:new URL(t,window.location.origin).toString()}function bn(){let e=d();if(!e)return null;let t=o(e,V);return t===null||t>=0?null:`Agent server ${e} does not persist parent/child conversation links (needs ${V}); the child was created but is not linked to this conversation.`}var xn=e=>!!(e?.selected_repository||e?.selected_workspace),Sn=`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 Cn(e,t){let n=await H.resolveConversationWorkingDir(t),r=z(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`&&!xn(r)&&(a=`shared`,o=`This conversation's workspace is a scratch directory with no commits, which git cannot cut a worktree from. ${Sn}`);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)}). ${Sn}`}let c=s.app_conversation_id??s.id;e.title&&await H.updateConversationTitle(c,e.title).catch(()=>void 0);let l=bn();return{status:`launched`,target:`local`,conversation_id:c,url:yn(`/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 wn=e=>new Promise(t=>{setTimeout(t,e)});async function Tn(e,t){let n=Date.now()+pn,r=e;for(;!r.app_conversation_id&&r.status!==`ERROR`&&!(Date.now()>=n);){await wn(fn);let e=await ue(r.id,t).catch(()=>null);if(!e)break;r=e}return r}async function En(e,t){let n=L();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=z(t),i=await Tn(await he({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 Dn(e,t){t.status===`error`?f(l.t(h.CHILD_CONVERSATION$LAUNCH_FAILED,{error:t.error})):t.url&&u(l.t(t.target===`cloud`?h.CHILD_CONVERSATION$LAUNCHED_CLOUD:h.CHILD_CONVERSATION$LAUNCHED_LOCAL),l.t(h.CHILD_CONVERSATION$OPEN),t.url),!Qt.getState().statusByConversation[e]?.active&&await H.sendMessage(e,{role:`user`,content:[{type:`text`,text:`${pe}${JSON.stringify(t)}`}]})}async function On(e,t,n){if(!vn(t,n))return;let r=_n(e),i;if(!r.ok)i=r.failure;else try{i=r.params.target===`cloud`?await En(r.params,t):await Cn(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 Dn(t,i).catch(e=>{console.warn(`[${B}] Failed to report the launch result:`,e)})}var kn=(e,t,n)=>({entriesByConversation:{...e.entriesByConversation,[t]:[...e.entriesByConversation[t]??[],n]}}),An=P()(F(e=>({entriesByConversation:{},activeProfileByConversation:{},show:(t,n,r)=>e(e=>kn(e,t,{id:fe(),anchorEventId:n,profiles:r})),recordSwitch:(t,n,r)=>e(e=>({...kn(e,t,{id:fe(),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]}}}),setActiveProfile:(t,n)=>e(e=>({activeProfileByConversation:{...e.activeProfileByConversation,[t]:n}})),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`})),jn=(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=ve(r.path);n.invalidateQueries({queryKey:[`file_diff`,t,e]})}e.tool_name===`SwitchLLMTool`&&(n.invalidateQueries({queryKey:[`user`,`conversation`,t]}),An.getState().clearActiveProfile(t))},Mn=class{static async respondToConfirmation(e,t,n,r){let i=y().backend;return i.kind===`cloud`?S({backend:i,method:`POST`,hostOverride:v(t),path:`/api/conversations/${e}/events/respond_to_confirmation`,body:n,authMode:`session-api-key`,sessionApiKey:r}):new re(te({conversationUrl:t,sessionApiKey:r})).respondToConfirmation(e,n)}static async getEventCount(e,t,n){let r=y().backend;return r.kind===`cloud`?S({backend:r,method:`GET`,hostOverride:v(t),path:`/api/conversations/${e}/events/count`,authMode:`session-api-key`,sessionApiKey:n}):new re(te({conversationUrl:t,sessionApiKey:n})).getEventCount(e)}static async searchEvents(e,t,n,r={}){let i=y().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=>S({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 x(b({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}}},Nn=new Set([`error_source`,`error_kind`,`error_id`,`error_telemetry`]);function Pn({source:e,metadata:t={},classification:n}){let r=Object.fromEntries(Object.entries(t).filter(([e])=>!Nn.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;s(`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 Fn=()=>i({mutationKey:[`read-conversation-file`],meta:{disableToast:!0},mutationFn:async({conversationId:e,filePath:t})=>H.readConversationFile(e,t),onError:e=>{ie(e)!==404&&f(c(e))}}),In={cost:null,max_budget_per_task:null,usage:null},Ln=P(e=>({...In,setMetrics:t=>e(t),resetMetrics:()=>e(In)})),Rn=e=>{let{data:t}=Oe(e??null);return a({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 Mn.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})},zn=[`The goal is NOT yet complete (audit iteration`,`Resuming a goal that was paused or interrupted.`],Bn=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
+ `):``},Vn=e=>{let t=Bn(e);return t===null?!1:zn.some(e=>t.startsWith(e))},Hn=e=>Bn(e)?.startsWith(`[child-conversation] `)??!1,Un=e=>{if(nt(e))return ot(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)?!Vn(e)&&!Hn(e):Ge(e)||ut(e)||dt(e)?!0:Y(e)?e.content!==null||e.reasoning_content!==null:!1},Wn=e=>e.some(e=>e.source===`user`),Gn=()=>{let{uiEvents:e}=Z.getState();for(let t=e.length-1;t>=0;--t){let n=e[t];if(Un(n))return String(n.id)}return null};function Kn(e,t,n=Gn()){An.getState().recordSwitch(e,n,t)}function qn(e,t,n=new Date().toISOString()){An.getState().setActiveProfile(e,t),R(e,{active_profile:t,stamped_at:n})}function Jn(e,t){let n=[],r=null,i=null;for(let e of t)Ze(e)&&!e.observation.is_error&&(n.push({id:`history-switch:${e.id}`,anchorEventId:r,profileName:e.observation.profile_name}),i={profileName:e.observation.profile_name,timestamp:e.timestamp}),Un(e)&&(r=String(e.id));if(n.length>0&&An.getState().seedSwitches(e,n),i){let{profileName:t,timestamp:n}=i,r=z(e),a=r?.active_profile?r.stamped_at:null;(!a||Date.parse(n)>Date.parse(a))&&qn(e,t,n)}}var $=n(),Yn=(0,W.createContext)(void 0);function Xn(e){return e.llm_message.content.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Zn({children:e,conversationId:t,conversationUrl:n,sessionApiKey:i,subConversations:a,subConversationIds:o}){let[s,c]=(0,W.useState)(`CONNECTING`),[l,u]=(0,W.useState)(`CONNECTING`),d=W.useRef(!1),f=W.useRef(!1),p=r(),m=Z(e=>e.addEvent),h=Z(e=>e.addEvents),g=Z(e=>e.clearEventsForConversation),{setErrorMessage:_,removeErrorMessage:ee,clearConnectionError:v}=Ut(),y=qt(e=>e.consumeMatchingPendingMessage),{setExecutionStatus:b}=be(),{appendInput:x,appendOutput:S}=Jt(),ie=Xt(e=>e.reset),C=(0,W.useRef)(null);C.current===null&&(C.current=en(e=>{Z.getState().addEvent(e),Ut.getState().clearConnectionError()}));let w=(0,W.useRef)(null);w.current===null&&(w.current=en(e=>{Z.getState().addEvent({...e,isFromPlanningAgent:!0}),Ut.getState().clearConnectionError()}));let[T,E]=(0,W.useState)(!0),[D,ae]=(0,W.useState)(null),{setPlanContent:O}=I();(0,W.useEffect)(()=>{O(null)},[t,O]);let{mutate:k}=Fn(),A=(0,W.useRef)(0),j=(0,W.useRef)(null),oe=(0,W.useCallback)(()=>{v()},[v]),M=(0,W.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});Ln.getState().setMetrics({cost:n.cost,max_budget_per_task:n.maxBudgetPerTask,usage:n.usage})},[]),{data:N,isPending:se}=Rn(t),P=!!t&&se;(0,W.useLayoutEffect)(()=>{let e=t??null;Z.getState().loadedConversationId!==e&&(g(e),ie(),Ln.getState().resetMetrics())},[t,g,ie]),(0,W.useLayoutEffect)(()=>{if(!(!N||N.events.length===0)&&(h(N.events),t)){Jn(t,Z.getState().uiEvents);for(let e of N.events)Ke(e)&&y(t,Xn(e))}},[N,h,t,y]);let ce=(0,W.useMemo)(()=>{let e=N?.events??[],t=e[e.length-1];return!t||!(`timestamp`in t)||!t.timestamp?null:t.timestamp},[N]),F=(0,W.useMemo)(()=>!t||!n||se?null:ne(t,n),[t,n,se]),L=(0,W.useMemo)(()=>o?.[0]??null,[o]),R=(0,W.useMemo)(()=>{if(!a?.length)return null;let e=a[0];return!e?.id||!e.conversation_url?null:ne(e.id,e.conversation_url)},[a]),z=(0,W.useMemo)(()=>R?s===`CONNECTING`||l===`CONNECTING`?`CONNECTING`:s===`OPEN`&&l===`OPEN`?`OPEN`:s===`CLOSED`&&l===`CLOSED`?`CLOSED`:s===`CLOSING`||l===`CLOSING`?`CLOSING`:`CLOSED`:s,[s,l,R]);(0,W.useEffect)(()=>{D!==null&&A.current>=D&&T&&E(!1)},[D,T,A]),(0,W.useEffect)(()=>{if(!T&&j.current){let{path:e,conversationId:t}=j.current;k({conversationId:t,filePath:e},{onSuccess:e=>{O(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}),j.current=null}},[T,k,O]),(0,W.useEffect)(()=>{d.current=!1,E(!!o?.length),ae(null),A.current=0,j.current=null},[o]),(0,W.useEffect)(()=>{d.current=!1,f.current=!1,j.current=null},[t]),(0,W.useEffect)(()=>{let e=C.current,t=w.current;return()=>{e?.reset(),t?.reset()}},[t]);let ue=(0,W.useMemo)(()=>P||T,[P,T]),de=(0,W.useCallback)(e=>{try{let n=JSON.parse(e.data);if(pt(n)){if(Y(n)){C.current?.enqueue(n);return}C.current?.flush();let e=Z.getState().eventIds.has(n.id??``),r=Ze(n)?n:null;if(m(n),e)return;if(lt(n)){let e=n,t=`classification`in e?e.classification:null;Pn({source:`conversation`,metadata:{eventId:e.id,errorCode:e.code},classification:t}),_(e.detail,`conversation`,e.code,t)}else oe();if(Ge(n)&&Pn({source:`agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},classification:n.classification}),Ke(n)&&t&&(y(t,Xn(n)),le(t,{draftMessage:null})),J(n)&&jn(n,t||`test-conversation-id`,p),nt(n)&&(rt(n)&&t&&b(t,n.value.execution_status),it(n)&&t&&b(t,n.value),at(n)&&M(n),ot(n)&&t&&Qt.getState().setStatus(t,n.value)),qe(n)&&x(n.action.command),Je(n)&&S(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
6
+ `)),Xe(n)){let{screenshot_data:e}=n.observation;if(e){let t=e.startsWith(`data:`)?e:`data:image/png;base64,${e}`;Xt.getState().setScreenshotSrc(t)}}Qe(n)&&Xt.getState().setUrl(n.action.url),t&&r&&!r.observation.is_error&&(Kn(t,r.observation.profile_name),qn(t,r.observation.profile_name,r.timestamp),r.observation.active_model&&xe(p,t,r.observation.active_model),_e(p,t)),$e(n)&&dn(n.action,t??null),t&&et(n)&&On(n.action,t,n.tool_call_id)}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[m,_,y,p,t,b,x,S,M,oe]),B=(0,W.useCallback)(e=>{try{let n=JSON.parse(e.data);if(T&&(A.current+=1,D!==null&&A.current>=D&&E(!1)),pt(n)){if(Y(n)){w.current?.enqueue(n);return}w.current?.flush();let e=Z.getState().eventIds.has(n.id??``);if(m({...n,isFromPlanningAgent:!0}),e)return;if(lt(n)){let e=n,t=`classification`in e?e.classification:null;Pn({source:`planning_conversation`,metadata:{eventId:e.id,errorCode:e.code},classification:t}),_(e.detail,`conversation`,e.code,t)}else oe();if(Ge(n)&&Pn({source:`planning_agent`,metadata:{eventId:n.id,toolName:n.tool_name,toolCallId:n.tool_call_id},classification:n.classification}),Ke(n)&&t&&(y(t,Xn(n)),le(t,{draftMessage:null})),J(n)&&jn(n,a?.[0]?.id||`test-conversation-id`,p),nt(n)&&(rt(n)&&L&&b(L,n.value.execution_status),it(n)&&L&&b(L,n.value),at(n)&&M(n),ot(n)&&t&&Qt.getState().setStatus(t,n.value)),qe(n)&&x(n.action.command),Je(n)&&S(n.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
7
+ `)),Ye(n)){let{path:e}=n.observation;if(me(e)){let t=a?.[0]?.id;t&&e&&(T?j.current={path:e,conversationId:t}:k({conversationId:t,filePath:e},{onSuccess:e=>{O(e)},onError:e=>{console.warn(`Failed to read conversation file:`,e)}}))}}}}catch(e){console.warn(`Failed to parse WebSocket message as JSON:`,e)}},[m,T,D,_,y,p,a,L,t,b,x,S,k,O,M,oe]),fe=(0,W.useMemo)(()=>({queryParams:ce?{resend_mode:`since`,after_timestamp:ce}:{resend_mode:`all`},sessionApiKey:i,reconnect:{enabled:!0},onOpen:()=>{c(`OPEN`),d.current=!0,v()},onClose:()=>{c(`CLOSED`)},onError:()=>{c(`CLOSED`),d.current&&_(Ue,`connection`)},onMessage:de}),[de,_,v,i,ce]),pe=(0,W.useMemo)(()=>{let e={resend_all:!0},t=a?.[0];return{queryParams:e,sessionApiKey:t?.session_api_key??i,reconnect:{enabled:!0},onOpen:async()=>{if(u(`OPEN`),f.current=!0,v(),t?.id&&t.conversation_url)try{let e=await Mn.getEventCount(t.id,t.conversation_url,t.session_api_key);ae(e),e===0&&E(!1)}catch{E(!1)}},onClose:()=>{u(`CLOSED`)},onError:()=>{u(`CLOSED`),f.current&&_(Ue,`connection`)},onMessage:B}},[B,_,v,i,a]),{socket:V,reconnect:H}=He(F||``,fe),{socket:U,reconnect:he}=He(R||``,pe),ge=(0,W.useCallback)(()=>{if(ee(),I.getState().conversationMode===`plan`&&R){he();return}H()},[R,H,he,ee]),ve=(0,W.useCallback)(async e=>{let n=I.getState().conversationMode,r=n===`plan`?U:V,i=n===`plan`?L:t;if(r?.readyState!==WebSocket.OPEN){if(!i){let e=Error(n===`plan`?`Planning conversation is not ready yet`:`No conversation ID available`);throw _(e.message),e}try{return await new re(te()).sendEvent(i,{role:`user`,content:e.content},{run:!0}),{queued:!0}}catch(e){throw _(e instanceof Error?e.message:`Failed to queue message for delivery`),e}}try{return r.send(JSON.stringify({...e,run:!0})),{queued:!1}}catch(e){throw _(e instanceof Error?e.message:`Failed to send message`),e}},[V,U,_,t,L]);(0,W.useEffect)(()=>{V&&F&&(()=>{switch(V.readyState){case WebSocket.CONNECTING:c(`CONNECTING`);break;case WebSocket.OPEN:c(`OPEN`);break;case WebSocket.CLOSING:c(`CLOSING`);break;case WebSocket.CLOSED:c(`CLOSED`);break;default:c(`CLOSED`);break}})()},[V,F]),(0,W.useEffect)(()=>{U&&R&&(()=>{switch(U.readyState){case WebSocket.CONNECTING:u(`CONNECTING`);break;case WebSocket.OPEN:u(`OPEN`);break;case WebSocket.CLOSING:u(`CLOSING`);break;case WebSocket.CLOSED:u(`CLOSED`);break;default:u(`CLOSED`);break}})()},[U,R]);let ye=(0,W.useMemo)(()=>({connectionState:z,mainConnectionState:s,sendMessage:ve,isLoadingHistory:ue,reconnect:ge}),[z,s,ve,ue,ge]);return(0,$.jsx)(Yn.Provider,{value:ye,children:e})}var Qn=()=>(0,W.useContext)(Yn)||null,$n=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 er(){let{conversationId:e}=G(),{selectedTab:t,isRightPanelShown:n,setHasRightPanelToggled:r,setIsOverviewPanelShown:i,setIsRightPanelShown:a,setSelectedTab:o,setCommitsAutoExpandSection:s}=I(),{setSelectedTab:c,setRightPanelShown:l}=ce(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 tr={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`]},nr=[],rr={allowDangerousHtml:!0},ir=/^(https?|ircs?|mailto|xmpp)$/i,ar=[{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 or(e){let t=sr(e),n=cr(e);return lr(t.runSync(t.parse(n),n),e)}function sr(e){let t=e.rehypePlugins||nr,n=e.remarkPlugins||nr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rr}:rr;return oe().use(w).use(n).use(O,r).use(t)}function cr(e){let t=e.children||``,n=new A;return typeof t==`string`?n.value=t:``+t,n}function lr(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||ur;for(let e of ar)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return ae(e,l),se(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 tr)if(Object.hasOwn(tr,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=tr[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 ur(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||ir.test(e.slice(0,t))?e:``}function dr({text:e,children:t}){let[n,r]=W.useState(!1),[i,a]=W.useState(!1);return W.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)(ke,{isHidden:!n,isDisabled:i,onClick:async()=>{await navigator.clipboard.writeText(e),a(!0)},mode:i?`copied`:`copy`})}),t]})}function fr({children:e,className:t}){let n=/language-(\w+)/.exec(t||``),r=String(e).replace(/\n$/,``);return n?(0,$.jsx)(dr,{text:r,children:(0,$.jsx)(j,{className:`rounded-lg`,style:M,language:n?.[1],PreTag:`div`,children:r})}):String(e).includes(`
8
+ `)?(0,$.jsx)(dr,{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:_(t,`bg-surface-raised text-foreground border border-surface-raised rounded px-[0.4em] py-[0.2em]`),children:e})}function pr({children:e}){return(0,$.jsx)(`ul`,{className:`my-2 list-disc ml-5 pl-2 whitespace-normal leading-6`,children:e})}function mr({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 hr({children:e}){return(0,$.jsx)(`li`,{className:`py-0.5`,children:e})}function gr({children:e}){return(0,$.jsx)(`p`,{className:`py-1.5 leading-6 first:pt-0 last:pb-0`,children:e})}function _r({href:e,children:t}){return(0,$.jsx)(`a`,{className:`text-blue-500 hover:underline`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})}function vr({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 yr({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 br({children:e}){return(0,$.jsx)(`h3`,{className:`text-base font-medium text-white mb-2 mt-3 first:mt-0`,children:e})}function xr({children:e}){return(0,$.jsx)(`h4`,{className:`text-sm font-medium text-white mb-1.5 mt-3 first:mt-0`,children:e})}function Sr({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 Cr({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 wr=`w-10`;function Tr({children:e}){let t=W.useRef(null),[n,r]=W.useState({left:!1,right:!1}),i=W.useCallback(()=>{let e=t.current;e&&r(De(e))},[]);return W.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:_(`pointer-events-none absolute inset-y-0 left-0 z-10`,wr,`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:_(`pointer-events-none absolute inset-y-0 right-0 z-10`,wr,`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 Er({children:e}){return(0,$.jsx)(Tr,{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 Dr({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 Or({children:e}){return(0,$.jsx)(`td`,{className:`whitespace-nowrap border-[var(--oh-border)] px-3 py-2 align-top`,children:e})}var kr={note:{label:`Note`,icon:Te,containerClass:`border-l-blue-500 bg-blue-500/10`,titleClass:`text-blue-300`,iconClass:`text-blue-400`},tip:{label:`Tip`,icon:Ee,containerClass:`border-l-emerald-500 bg-emerald-500/10`,titleClass:`text-emerald-300`,iconClass:`text-emerald-400`},important:{label:`Important`,icon:we,containerClass:`border-l-purple-500 bg-purple-500/10`,titleClass:`text-purple-300`,iconClass:`text-purple-400`},warning:{label:`Warning`,icon:Se,containerClass:`border-l-yellow-500 bg-yellow-500/10`,titleClass:`text-yellow-300`,iconClass:`text-yellow-400`},caution:{label:`Caution`,icon:Ce,containerClass:`border-l-rose-500 bg-rose-500/10`,titleClass:`text-rose-300`,iconClass:`text-rose-400`}},Ar=/(?:^|\s)markdown-alert-(note|tip|important|warning|caution)(?:\s|$)/i;function jr(e){if(!e)return null;let t=e.match(Ar);return t?t[1].toLowerCase():null}function Mr({children:e,className:t}){let n=jr(t);if(n){let t=kr[n],r=t.icon;return(0,$.jsxs)(`div`,{"data-testid":`markdown-alert-${n}`,className:_(`my-3 rounded-r-sm border-l-4 px-3 py-2`,t.containerClass),children:[(0,$.jsxs)(`p`,{className:_(`flex items-center gap-2 font-semibold`,t.titleClass),children:[(0,$.jsx)(r,{"aria-hidden":!0,className:_(`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 Nr({...e}){return(0,$.jsx)(`hr`,{...e,className:`my-4 border-0 border-t border-[var(--oh-border)]`})}var Pr=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*\r?\n?/i;function Fr(e){return Array.isArray(e)?e:typeof e==`string`?e.split(/\s+/).filter(Boolean):[]}var Ir=()=>e=>{ae(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(Pr);if(!a)return;let o=a[1].toLowerCase(),s=i;s.value=s.value.replace(Pr,``),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=Fr(c.className);t.data.hProperties={...c,className:[...l,`markdown-alert`,`markdown-alert-${o}`]}})},Lr={...k,attributes:{...k.attributes,"*":[...k.attributes?.[`*`]??[],`className`,`id`],a:[`href`,`title`,`target`,`rel`],img:[...k.attributes?.img??[],`src`,`alt`,`title`,`width`,`height`,`loading`]},tagNames:[...k.tagNames??[],`img`,`details`,`summary`,`figure`,`figcaption`,`mark`,`kbd`,`sub`,`sup`],protocols:{...k.protocols,src:[`http`,`https`],href:[`http`,`https`,`mailto`,`tel`]}};function Rr({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)(or,{components:{code:fr,ul:pr,ol:mr,li:hr,hr:Nr,table:Er,th:Dr,td:Or,blockquote:Mr,...r&&{a:_r,p:gr},...i&&{h1:vr,h2:yr,h3:br,h4:xr,h5:Sr,h6:Cr},...n},remarkPlugins:[Ir,D,E],rehypePlugins:a?[N,[T,Lr]]:void 0,children:t??e??``})})}export{Ne as $,ht as A,Je as B,Xt as C,Z as D,Ut as E,Ge as F,Ye as G,ut as H,pt as I,tt as J,Y as K,$e as L,_t as M,dt as N,Pt as O,J as P,Le as Q,ft as R,Qt as S,qt as T,q as U,ot as V,K as W,Ue as X,Ke as Y,ze as Z,Fn as _,er as a,un as b,Qn as c,qn as d,Pe as et,Gn as f,Ln as g,Rn as h,dr as i,vt as j,mt as k,Kn as l,Un as m,_r as n,Ae as nt,$n as o,Wn as p,Ze as q,fr as r,G as rt,Zn as s,Rr as t,je as tt,Jn as u,Mn as v,Jt as w,on as x,An 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-CV850oio.js";import{dt as a,st as o}from"./active-backend-context-rZiLJRUc.js";import{K as s}from"./utils-BOco8mxR.js";import{n as c}from"./extensions-navigation-CRMZd-FE.js";import{l}from"./settings-service.api-9_xdv_mh.js";import{n as u}from"./use-settings-Dn00UISA.js";import{t as d}from"./brand-button-DxPO4Lf8.js";import{t as f}from"./install-server-modal-DUiZMc8u.js";import{f as p,l as m,s as h,t as g}from"./mcp-marketplace-utils-Cn_NIMWM.js";import{t as _}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{a as v,i as y,n as b,r as x,t as S}from"./mcp-page-LGYIICMG.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=>{o(a(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-9_xdv_mh.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};
@@ -0,0 +1,9 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as i}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{t as a}from"./useMutation-CJuK90oc.js";import{V as o,ct as s,dt as c,n as l,st as u}from"./active-backend-context-rZiLJRUc.js";import{K as d,t as f}from"./utils-BOco8mxR.js";import{t as p}from"./puzzle-DdAqbUrb.js";import{n as m,t as h}from"./x-By6qCmtY.js";import{t as g}from"./trash-2-ZhKuTLiz.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-9_xdv_mh.js";import{n as w}from"./use-settings-Dn00UISA.js";import{t as T}from"./modal-backdrop-BSzNhM4r.js";import{n as ee}from"./modal-classes-Dg0ngBPO.js";import{l as E}from"./form-control-classes-B-z85REi.js";import{t as D}from"./brand-button-DxPO4Lf8.js";import{t as O}from"./settings-dropdown-input-DVpyD87C.js";import{t as te}from"./modal-close-button-B9j4nasm.js";import{n as k,t as A}from"./settings-input-C0dd8Utu.js";import{t as ne}from"./confirmation-modal-gIFHeZt6.js";import{a as j,c as M,d as N,f as P,i as F,l as I,n as L,o as R,p as z,r as B,s as V,u as H}from"./install-server-modal-DUiZMc8u.js";import{t as re}from"./enum-filter-dropdown-C4pW0ORd.js";import{a as U,n as W,o as G,r as K,t as q}from"./extension-module-card-classes-DpeaYhYo.js";import{a as ie,d as ae,r as oe,s as J,t as se}from"./mcp-marketplace-utils-Cn_NIMWM.js";import{t as Y}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~mcp~automations-list~aut~ibfbmr9f-CxhwKuAd.js";import{n as ce}from"./circle-plus-check-toggle-Fr-h-mbL.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:o.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:o.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(H,()=>I()[t]??fe),r=X.useRef(e);return r.current=e,{health:n,probe:X.useCallback(()=>j(r.current),[]),reauthorize:X.useCallback(()=>R(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 L(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}=l(),{health:o,probe:s,reauthorize:p}=pe(e),{mutate:m}=Q();if(a.kind===`cloud`)return null;let h=o.status===`checking`,g=o.status===`failed`,_=ge(r,o),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:()=>V(n,t,[]),onError:e=>u(c(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(o),"aria-hidden":`true`,className:f(`inline-block h-2 w-2 shrink-0 rounded-full`,me[o.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:_})]}),o.status===`healthy`&&o.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 s(),disabled:h,children:r(g?d.MCP$HEALTH_RETRY:d.MCP$TEST_BUTTON)}),g&&o.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=se(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`,U,K),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(z,{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)(ce,{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:G,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:W,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-installed-list`,className:q,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=oe(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`,U,K),children:(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(z,{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)(ce,{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=ie(J(Y)).filter(e=>ae(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:W,children:(0,Z.jsx)(`div`,{"data-testid":`mcp-marketplace-grid`,className:q,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),F=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},I=e=>{if(!e.trim())return null;let t=e.split(`
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},L=e=>{if(_===`header`){let t=e.get(`headers`)?.toString()||``;return t.trim()?I(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},R=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},z=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)||I(r)||null},B=e=>{if(m===`sse`||m===`shttp`){let t=e.get(`url`)?.toString().trim()||``,n=j(t);if(n)return n;let r=F(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=R(e.get(`timeout`)?.toString()||``);if(t)return t}return L(e)}return m===`stdio`?z(e):null},V=e=>{let t={},n=e.trim();if(!n)return t;for(let e of n.split(`
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},H=e=>e?Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
4
+ `):``,re=e=>e?.strategy===`bearer`||e?.strategy===`api_key`?e.value??``:``,U=e=>e?.strategy===`header`?H(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:V(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(`
5
+ `).map(e=>e.trim()).filter(Boolean):[],c=V(o||``);return{...n,name:r,command:i,...s.length>0&&{args:s},...Object.keys(c).length>0&&{env:c}}};return(0,Z.jsxs)(`form`,{ref:T,"data-testid":e===`add`?`add-mcp-server-form`:`edit-mcp-server-form`,onSubmit:e=>{e.preventDefault(),w(null);let t=new FormData(e.currentTarget),n=B(t);if(n){w(n);return}r(q(t))},className:`flex flex-col items-start gap-6`,noValidate:!0,children:[e===`add`&&(0,Z.jsx)(O,{testId:`server-type-dropdown`,name:`server-type`,label:p(d.SETTINGS$MCP_SERVER_TYPE),items:ee,selectedKey:m,onSelectionChange:e=>h(e),onInputChange:()=>{},isClearable:!1,allowsCustomValue:!1,required:!0,wrapperClassName:`w-full min-w-0`}),C&&(0,Z.jsx)(`p`,{className:`text-red-500 text-sm`,children:C}),(m===`sse`||m===`shttp`)&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{testId:`server-name-input`,name:`name`,type:`text`,label:p(d.SETTINGS$MCP_SERVER_NAME),className:`w-full min-w-0`,showOptionalTag:!0,defaultValue:t?.name||``,placeholder:`my_search_server`,pattern:v.source}),(0,Z.jsx)(A,{testId:`url-input`,name:`url`,type:`url`,label:p(d.SETTINGS$MCP_URL),className:`w-full min-w-0`,required:!0,defaultValue:t?.url||``,placeholder:`https://api.example.com`}),(0,Z.jsx)(O,{testId:`auth-mode-dropdown`,name:`auth-mode`,label:p(d.SETTINGS$MCP_AUTHENTICATION),items:te,selectedKey:_,onSelectionChange:e=>b(e),onInputChange:()=>{},isClearable:!1,allowsCustomValue:!1,wrapperClassName:`w-full min-w-0`}),_===`bearer`&&(0,Z.jsx)(A,{testId:`api-key-input`,name:`api_key`,type:`password`,label:p(d.SETTINGS$MCP_API_KEY),className:`w-full min-w-0`,required:!0,defaultValue:re(t?.auth),placeholder:p(d.SETTINGS$MCP_API_KEY_PLACEHOLDER)}),_===`header`&&(0,Z.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,Z.jsx)(`span`,{className:`text-sm`,children:p(d.SETTINGS$MCP_HEADERS)}),(0,Z.jsx)(`textarea`,{"data-testid":`headers-input`,name:`headers`,rows:4,defaultValue:U(t?.auth),placeholder:p(d.SETTINGS$MCP_HEADERS_PLACEHOLDER),className:f(E,`resize-none placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),_===`oauth2`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(O,{testId:`oauth-client-auth-method-dropdown`,name:`oauth_client_auth_method`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_AUTH),items:ne,selectedKey:x,onSelectionChange:e=>S(e),onInputChange:()=>{},isClearable:!1,allowsCustomValue:!1,wrapperClassName:`w-full min-w-0`}),(0,Z.jsx)(A,{testId:`oauth-client-id-input`,name:`oauth_client_id`,type:`text`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_ID),className:`w-full min-w-0`,showOptionalTag:!0,defaultValue:W?.client_id||``,placeholder:p(d.SETTINGS$MCP_OAUTH_CLIENT_ID_PLACEHOLDER)}),(0,Z.jsx)(A,{testId:`oauth-client-secret-input`,name:`oauth_client_secret`,type:`password`,label:p(d.SETTINGS$MCP_OAUTH_CLIENT_SECRET),className:`w-full min-w-0`,showOptionalTag:!0,defaultValue:W?.client_secret||``,placeholder:p(d.SETTINGS$MCP_OAUTH_CLIENT_SECRET_PLACEHOLDER)}),(0,Z.jsx)(A,{testId:`oauth-scopes-input`,name:`oauth_scopes`,type:`text`,label:p(d.SETTINGS$MCP_OAUTH_SCOPES),className:`w-full min-w-0`,showOptionalTag:!0,defaultValue:Array.isArray(W?.scopes)?W.scopes.join(` `):W?.scopes||``,placeholder:p(d.SETTINGS$MCP_OAUTH_SCOPES_PLACEHOLDER)})]}),m===`shttp`&&(0,Z.jsx)(A,{testId:`timeout-input`,name:`timeout`,type:`number`,label:p(d.SETTINGS$MCP_TIMEOUT_LABEL),className:`w-full min-w-0`,showOptionalTag:!0,defaultValue:t?.timeout?.toString()||``,placeholder:`60`,min:1,max:3600})]}),m===`stdio`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{testId:`name-input`,name:`name`,type:`text`,label:p(d.SETTINGS$MCP_NAME),className:`w-full min-w-0`,required:!0,defaultValue:t?.name||``,placeholder:`my_mcp_server`,pattern:v.source}),(0,Z.jsx)(A,{testId:`command-input`,name:`command`,type:`text`,label:p(d.SETTINGS$MCP_COMMAND),className:`w-full min-w-0`,required:!0,defaultValue:t?.command||``,placeholder:`npx`}),(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_COMMAND_ARGUMENTS)}),(0,Z.jsx)(k,{})]}),(0,Z.jsx)(`textarea`,{"data-testid":`args-input`,name:`args`,rows:3,defaultValue:t?.args?.join(`
6
+ `)||``,placeholder:`arg1
7
+ arg2
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:H(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=B(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:o}=F(),{mutate:p,isPending:m}=Q(),{mutate:h,isPending:g}=le(),{mutate:_,isPending:v,data:y,reset:b}=B(),[x,S]=X.useState(!1),[C,w]=X.useState(null),[E,D]=X.useState(!1),{backend:O}=l(),k=O.kind===`cloud`,A=!!e.id,j=o||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:L(r,e.error_kind,e.error)}:null},[C,y,r]),I=(n,r)=>{k||V(n,r,A?t.filter(t=>t.id!==e.id):t)},R=e=>{if(e instanceof Error&&e.message===`Replace or clear the stored credential before renaming this MCP server.`){u(e.message);return}u(c(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=()=>{I(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:R}):a(i,{onSuccess:o,onError:R})}).catch(R).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=()=>{I(i,r),n()};A?p({serverId:e.id,server:i},{onSuccess:o,onError:R}):a(i,{onSuccess:o,onError:R})},onError:R})},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(R).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=>{R(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)(re,{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{r as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as s}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{i as c}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";import{t as l}from"./useMutation-CJuK90oc.js";import{t as u}from"./useQuery-S6j94er1.js";import{t as d}from"./vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-DkPlXWl9.js";import{gt as f,n as p,st as m}from"./active-backend-context-rZiLJRUc.js";import{K as h,O as g,k as _,t as v,z as y}from"./utils-BOco8mxR.js";import{a as b,c as x,f as ee,g as te,n as ne}from"./agent-server-client-options-BikiNwTa.js";import{t as S}from"./chevron-down-CFrWHqu8.js";import{t as C}from"./chevron-right-C5roOrJu.js";import{t as re}from"./loader-circle-Dex47vVW.js";import{v as ie}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{i as w}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~inibp4qe-CnsDDzeE.js";import{t as T}from"./proxy-CBgMd2zf.js";import{t as E}from"./use-config-DpafU_QP.js";import{n as ae}from"./use-settings-Dn00UISA.js";import{n as oe,o as se}from"./form-control-classes-B-z85REi.js";import{n as ce}from"./navigation-context-CQZwH_tC.js";import{ot as D,st as le}from"./vendor-markdown-j0kYzV48.js";import{t as ue}from"./styled-tooltip-Pd22BIvr.js";import{_ as de,t as fe}from"./conversation-store-DVVfkCsk.js";import{d as pe,m as me,t as he,x as ge}from"./agent-server-conversation-service.api-DYFsNHKf.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-D1_G_9I-.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-B3w0X7WH.js";import{r as O}from"./typography-HLLg_FAn.js";import{t as ke}from"./u-check-circle-BKn1spCL.js";import{$ as Ae,A as je,D as Me,F as Ne,G as Pe,H as Fe,K as Ie,L as Le,M as Re,N as ze,P as k,S as Be,T as Ve,V as He,W as A,Y as Ue,a as We,b as j,c as Ge,et as Ke,i as qe,j as Je,n as Ye,o as Xe,r as Ze,rt as M,t as N,tt as Qe,v as $e,y as et,z as tt}from"./markdown-renderer-rivLvYh-.js";import{t as nt}from"./syntax-highlighter-BGDg_7w9.js";import{n as rt,t as it}from"./get-git-path-EHrSDxTM.js";var at=c(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),P=e(r(),1);function ot(){!t.current&&i();let[e]=(0,P.useState)(n.current);return e}var F=a(),st=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}(st||{});function ct(){let{conversationId:e}=M(),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 lt(e,t,n,r){return{action:st.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 ut({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 dt(e,t){if(!e)return null;let n=/(?:Z|[+-]\d{2}:?\d{2})$/i.test(e)?e:`${e}Z`,r=new Date(n);return Number.isNaN(r.getTime())?null:r.toLocaleString(t,{dateStyle:`medium`,timeStyle:`short`})}function R({title:e,details:t,success:n,initiallyExpanded:r=!1,chevronPosition:i=`after`,titleTrailing:a,titleIcon:o,timestamp:c}){let{t:l,i18n:u}=s(`openhands`),[d,f]=P.useState(r),[p,m]=P.useState(!1),[g,_]=P.useState(!1),y=dt(c,u?.language),b=t?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{f(e=>!e),e.detail>0&&(m(!1),e.currentTarget.blur())},className:`cursor-pointer text-left`,"aria-label":l(d?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),children:d?(0,F.jsx)(L,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)}):(0,F.jsx)(I,{className:v(`h-4 w-4 inline fill-[var(--oh-muted)]`,i===`after`?`ml-2`:`mr-2`)})}):null,x=(0,F.jsxs)(`div`,{"data-testid":`generic-event-message-title`,className:`flex items-center`,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onFocusCapture:()=>_(!0),onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||_(!1)},children:[i===`before`&&b,o,(0,F.jsx)(`span`,{children:e}),i===`after`&&b]});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:[y?(0,F.jsx)(ue,{content:(0,F.jsx)(`time`,{dateTime:c,children:y}),placement:`top`,isOpen:p||g,children:x}):x,(0,F.jsxs)(`div`,{className:`flex items-center`,children:[a,n&&(0,F.jsx)(ut,{status:n})]})]}),d&&(typeof t==`string`?(0,F.jsx)(N,{children:t}):t)]})}var ft=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`})}),pt=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`})}),mt={running:h.GOAL$STATUS_RUNNING,complete:h.GOAL$STATUS_COMPLETE,capped:h.GOAL$STATUS_CAPPED,interrupted:h.GOAL$STATUS_INTERRUPTED};function ht({status:e}){let{t}=s(`openhands`),{conversationId:n}=M(),r=Be(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,p=d?.missing?t(h.GOAL$MISSING,{missing:d.missing}):``,g=async(e,r)=>{if(!(!n||i)){a(!0);try{await e(n)}catch(e){m(e instanceof Error&&e.message?e.message:t(r))}finally{a(!1)}}},_=()=>g(async e=>{await _e(e),await xe(e)},h.GOAL$STOP_FAILED),y=()=>g(ye,h.GOAL$RESUME_FAILED),b=null;return n&&o?b=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-stop`,disabled:i,onClick:_,className:v(oe,se),children:t(h.GOAL$STOP)}):n&&e.status===`interrupted`&&!r&&(b=(0,F.jsx)(`button`,{type:`button`,"data-testid":`goal-resume`,disabled:i,onClick:y,className:v(oe,se),children:t(h.GOAL$RESUME)})),(0,F.jsx)(`div`,{"data-testid":`goal-status`,className:`flex flex-col w-full`,children:(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$PREFIX)}),(0,F.jsx)(`span`,{children:c}),(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.GOAL$ROUND,{iteration:l,max:u})}),(0,F.jsx)(`span`,{children:t(mt[e.status])}),f!==null&&(0,F.jsx)(`span`,{className:`opacity-60`,children:t(h.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)(ft,{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)(pt,{className:`w-3.5 h-3.5 fill-[var(--oh-muted)]`})})]}),titleTrailing:b,details:p,initiallyExpanded:!o,chevronPosition:`before`})})}var gt=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 _t({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)(S,{size:14}):(0,F.jsx)(C,{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 vt({conversationId:e,anchorEventId:t}){let n=et(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)(gt,{width:14,height:14,className:`shrink-0 text-neutral-400`,"aria-hidden":!0}),(0,F.jsx)(d,{i18nKey:h.MODEL$SWITCHED_TO_PROFILE,values:{name:e.switchedTo},components:{cmd:(0,F.jsx)(`span`,{className:`font-mono text-neutral-200 bg-neutral-800 px-1 rounded`})}})]}),details:``},e.id);let t=e.profiles.length===0;return(0,F.jsx)(R,{title:(0,F.jsx)(`span`,{children:t?(0,F.jsx)(d,{i18nKey:h.MODEL$NO_SAVED_PROFILES}):(0,F.jsx)(d,{i18nKey:h.MODEL$AVAILABLE_PROFILES,values:{count:e.profiles.length}})}),details:t?(0,F.jsx)(`span`,{className:`text-neutral-300 text-sm px-2 py-1 block`,children:(0,F.jsx)(d,{i18nKey:h.MODEL$NO_PROFILES_HINT})}):(0,F.jsx)(`div`,{className:`flex flex-col gap-1 mt-1`,children:e.profiles.map(e=>(0,F.jsx)(_t,{profile:e},e.name))}),initiallyExpanded:t},e.id)})})}function yt(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 bt=(0,P.createContext)(void 0);function xt({children:e,value:t}){let n=yt(P.useRef(null)),r=t||n;return(0,F.jsx)(bt.Provider,{value:r,children:e})}function St(){let e=(0,P.useContext)(bt);if(e===void 0)throw Error(`useScrollContext must be used within a ScrollProvider`);return e}function Ct(){return(0,P.useContext)(bt)}var wt=class{static async executeCommand(e,t,n,r,i=30){let a=x().backend;if(a.kind===`cloud`&&e){let o=await T({backend:a,method:`POST`,hostOverride:b(e),path:`/api/bash/execute_bash_command`,body:{command:n,...r?{cwd:r}:{},timeout:Math.floor(i)},authMode:`session-api-key`,sessionApiKey:t,timeoutSeconds:i+10});return{exit_code:o.exit_code??-1,stdout:o.stdout??``,stderr:o.stderr??``}}let o=await new w(ne({conversationUrl:e,sessionApiKey:t})).executeCommand(n,r,i);return{exit_code:o.exit_code,stdout:o.stdout,stderr:o.stderr}}static async downloadFile(e,t,n){let r=x().backend;return r.kind===`cloud`&&e?(await T({backend:r,method:`GET`,hostOverride:b(e),path:`/api/file/download?path=${encodeURIComponent(n)}`,authMode:`session-api-key`,sessionApiKey:t,responseType:`blob`})).arrayBuffer():new ie(ne({conversationUrl:e,sessionApiKey:t})).downloadFile(n)}},Tt=2e3,Et=[`.git`,`node_modules`,`.venv`,`venv`,`__pycache__`,`dist`,`build`,`.next`,`.cache`,`.pytest_cache`,`.mypy_cache`,`.turbo`,`.parcel-cache`,`target`];function Dt(){return`find . \\( ${Et.map(e=>`-name '${e}' -prune`).join(` -o `)} \\) -o -type f -print 2>/dev/null | sort | head -n ${Tt}`}function Ot(e){return e.startsWith(`./`)?e.slice(2):e}function kt(e){let{data:t}=Qe(),n=rt(),r=t?.id,i=t?.conversation_url,a=t?.session_api_key,o=t?.workspace?.working_dir?.trim(),s=u({queryKey:[`workspace-files`,r,i,a,o],queryFn:async()=>{let e=await wt.executeCommand(i,a,Dt(),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(Ot);return Array.from(new Set(t)).slice(0,Tt)},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 At(e){let{conversationId:t}=M(),{data:n}=Qe(),r=rt(),i=n?.selected_repository,a=n?.workspace?.working_dir?.trim(),o=it(i,a),s=o.startsWith(`/`)?o:`/${o}`,c=u({queryKey:[`workspace-files-cloud`,t,s],queryFn:async()=>{let e=(await ge(t,s)).map(Ot).filter(Boolean);return Array.from(new Set(e)).slice(0,Tt)},enabled:e&&r&&!!t,retry:!1,staleTime:1e3*30,gcTime:1e3*60*5,meta:{disableToast:!0}});return{data:c.data,isLoading:c.isLoading}}function jt(){let e=(0,P.useSyncExternalStore)(te,ee,ee).active.backend.kind===`cloud`,t=kt(!e),n=At(e);return e?n:t}var Mt=(0,P.createContext)(!1),Nt=(0,P.createContext)(void 0);function Pt({children:e}){let{data:t}=jt();return(0,F.jsx)(Nt.Provider,{value:t,children:e})}function Ft(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(Ft);return t.some(e=>e===null)?null:t.join(``)}return null}function It(e){let t=(0,P.useContext)(Nt);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 Lt({path:e,className:t,children:n}){let{conversationId:r}=M();return(0,F.jsx)(`button`,{type:`button`,"data-testid":`markdown-file-path-link`,title:e,className:v(t,`cursor-pointer rounded border border-surface-raised bg-surface-raised px-[0.4em] py-[0.2em] font-mono text-foreground hover:underline`),onClick:t=>{t.stopPropagation(),j(e,r)},children:n})}function Rt(e){let{children:t,className:n}=e,r=(0,P.useContext)(Mt),i=/language-(\w+)/.exec(n||``),a=String(t).replace(/\n$/,``),o=String(t).includes(`
2
+ `),s=It(!i&&!o&&!r?a:``);return s?(0,F.jsx)(Lt,{path:s,className:n,children:t}):Ze(e)}function zt(e){let{children:t}=e,n=(0,P.useContext)(Mt),r=Ft(t)?.trim()??``,i=It(n?``:r);return i?(0,F.jsx)(Lt,{path:i,children:t}):(0,F.jsx)(`strong`,{children:t})}function Bt(e){return(0,F.jsx)(Mt.Provider,{value:!0,children:Ye(e)})}var z=1e3,Vt=e=>`\`\`\`json\n${JSON.stringify(e,null,2)}\n\`\`\``,Ht=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`}},Ut={read:[`Read`],edit:[`Edit`,`Write`],execute:[`Bash`,`Run`],fetch:[`Fetch`,`WebFetch`]},Wt=e=>{let t=e.title,n=e.tool_kind;if(!t||!n)return t;let r=Ut[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},Gt=e=>{if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}},Kt=e=>e.length>1e3?`${e.slice(0,z)}...`:e,qt=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=Gt(n);e.trim()&&(a+=`Input:\n\`\`\`json\n${e}\n\`\`\`\n\n`)}let o=Kt(Gt(r).trim()),s=i?`**Error:**`:`Output:`,c=o||f.t(h.OBSERVATION$COMMAND_NO_OUTPUT);return a+=`${s}\n\`\`\`\n${c}\n\`\`\``,a},B=(e,t)=>e?e.length>t?`${e.substring(0,t)}...`:e:``,Jt=e=>/^[a-z][a-z0-9_]*\s*:\s*[[{]/i.test(e),Yt=e=>{let t=e.summary?.trim().replace(/\s+/g,` `)||``;return!t||Jt(t)?null:t},Xt=e=>{let t=Yt(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()}}},Zt=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)}},Qt=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value};function $t(e){let{children:t}=e,n=e=>{try{return Qt(e)}catch(t){return Zt.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 en=(0,P.createContext)(!0),tn=e=>{let t=document.createElement(`textarea`);return t.innerHTML=e,t.value},nn=e=>e?e.endsWith(`/`)||e.endsWith(`\\`)?!0:!(e.split(/[/\\]/).pop()||``).includes(`.`):!1,rn=e=>{if(!e)return``;let t=e.split(/[/\\]/),n=t[t.length-1];return nn(e)&&!n.endsWith(`/`)?`${n}/`:n};function an(e){let{children:t}=e,{conversationId:n}=M(),r=(0,P.useContext)(en),i=e=>{try{let t=tn(e),i=rn(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(),j(t,n)},children:i}):(0,F.jsx)(`span`,{className:`font-mono font-normal tracking-tight`,title:t,children:i})}catch(t){return Zt.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 on=()=>{let{setConversationMode:e}=fe(),{send:t}=ct(),{conversationId:n}=M(),r=Ve(e=>e.enqueuePendingMessage),i=Ve(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(lt(o,[],[],s)).catch(e=>{c&&i(c,e instanceof Error?e.message:`Failed to send message`)})},[e,t,n,r,i])}},sn=`200%`,V=8,cn=V*2;function ln({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2,style:a,...o}){let s=ot(),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:`${sn} 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:v(`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:${cn}% center}to{background-position:0% center}}`}}),(0,F.jsx)(t,{className:v(`relative inline-block`,n),style:u,...o,children:e})]})}var un=P.memo(ln);function dn({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 fn=5,pn=360,mn={p:({children:e})=>(0,F.jsx)(`p`,{className:`m-0 leading-6`,children:e}),code:Rt,a:Bt,strong:zt};function hn({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=fn*(Number.isFinite(n)&&n>0?n:24),i=(e.match(/\n/g)??[]).length;c(t.scrollHeight>r+1||i>=fn||e.trim().length>pn)};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:v(`text-sm leading-6 whitespace-normal [word-break:break-word]`,l&&`line-clamp-5`),children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:!1,components:mn,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:v(`pointer-events-none absolute bottom-1 left-1/2 z-10 inline-flex -translate-x-1/2 items-center rounded-full border border-[var(--oh-border-subtle)] bg-[var(--oh-surface-raised)] px-2.5 py-0.5 text-xs font-normal text-[var(--oh-foreground)] transition-opacity duration-150`,t?`opacity-100`:`opacity-0`),children:i(h.COMMON$VIEW_MORE)})]}):null]})}function H({type:e,message:t,children:n,actions:r,isFromPlanningAgent:i=!1,pendingStatus:a,onRetry:o,onDismiss:c,onStop:l,timestamp:u}){let{t:d,i18n:f}=s(`openhands`),[p,m]=P.useState(!1),[g,_]=P.useState(!1),[y,b]=P.useState(!1),[x,ee]=P.useState(!1),[te,ne]=P.useState(!0),S=P.useRef(null),C=dt(u,f?.language);P.useEffect(()=>{b(!1)},[t]);let re=async()=>{await navigator.clipboard.writeText(t),_(!0)};P.useEffect(()=>{let e;return g&&(e=setTimeout(()=>{_(!1)},2e3)),()=>{clearTimeout(e)}},[g]);let ie=e===`user`&&(a===`error`||a===`sending`),w=a===`sending`&&l!=null,T=w&&p,E=e===`user`&&a==null,ae=E&&x&&!y,oe=P.Children.count(n)>0;P.useLayoutEffect(()=>{if(!w||E)return;let e=S.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight),n=Number.isFinite(t)&&t>0?t:24;ne(e.scrollHeight<=n+1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t,w,E]);let se=E?(0,F.jsx)(hn,{message:t,isHovering:p,isExpanded:y,onTruncatableChange:ee}):(0,F.jsx)(`div`,{ref:S,className:`min-w-0 text-sm leading-6 whitespace-normal [word-break:break-word]`,children:(0,F.jsx)(N,{includeStandard:!0,includeHeadings:!0,allowHtml:e!==`user`,components:mn,children:t})}),ce=(0,F.jsxs)(`article`,{"data-testid":`${e}-message`,"data-pending-status":a,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:v(`rounded-xl relative w-fit max-w-full flex flex-col`,oe&&`gap-2`,e===`user`&&`mt-6 bg-tertiary self-end px-4 py-2.5`,e===`agent`&&`mt-6 w-full max-w-full bg-transparent`,i&&e===`agent`&&`border border-[#597ff4] bg-tertiary p-4 mt-2`,a===`error`&&`border border-[var(--oh-status-error)]/40`,!ie&&`last:mb-4`),children:[(0,F.jsxs)(`div`,{className:v(`absolute -top-2.5 -right-2.5 z-10`,!p||a===`sending`?`hidden`:`flex`,`items-center gap-1`),onClick:e=>e.stopPropagation(),children:[r?.map((e,t)=>e.tooltip?(0,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:!p,isDisabled:g,onClick:re,mode:g?`copied`:`copy`})]}),se,w?(0,F.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),l?.()},"data-testid":`chat-message-stop`,"aria-label":d(h.BUTTON$STOP),"aria-hidden":!T,tabIndex:T?0:-1,className:v(`group absolute z-10 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full bg-[var(--oh-color-tertiary)] text-[var(--oh-foreground)] transition-opacity duration-150`,te?`right-3 top-1/2 -translate-y-1/2`:`right-3 bottom-2.5`,T?`opacity-100`:`pointer-events-none opacity-0`),children:(0,F.jsx)(dn,{className:`block h-7 w-7 max-w-none`})}):null,ae?(0,F.jsx)(`button`,{type:`button`,"data-testid":`chat-message-expand`,"aria-expanded":!1,"aria-label":d(h.COMMON$VIEW_MORE),className:`absolute inset-0 z-[1] cursor-pointer rounded-xl border-0 bg-transparent p-0`,onClick:()=>b(!0)}):null,n]}),D=C?(0,F.jsx)(ue,{content:(0,F.jsx)(`time`,{dateTime:u,children:C}),placement:`top`,isOpen:p,children:ce}):ce;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:d(h.CHAT_INTERFACE$MESSAGE_SEND_FAILED)}),o?(0,F.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer rounded-md border border-[var(--oh-border)] px-2 py-1 text-xs font-normal text-[var(--oh-foreground)] hover:bg-[var(--oh-interactive-hover)]`,"data-testid":`chat-message-retry`,children:d(h.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:d(h.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)(un,{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:d(h.CHAT_INTERFACE$MESSAGE_SENDING)})})]}):D}function gn(e){return{h1:({children:t,className:n})=>(0,F.jsx)(`h1`,{className:v(`text-lg text-white font-bold leading-6 mb-1.5 mt-3 first:mt-0`,n,e),children:t}),h2:({children:t,className:n})=>(0,F.jsx)(`h2`,{className:v(`text-base font-semibold leading-5 text-white mb-1 mt-2.5 first:mt-0`,n,e),children:t}),h3:({children:t,className:n})=>(0,F.jsx)(`h3`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h4:({children:t,className:n})=>(0,F.jsx)(`h4`,{className:v(`text-sm font-semibold text-white mb-1 mt-2 first:mt-0`,n,e),children:t}),h5:({children:t,className:n})=>(0,F.jsx)(`h5`,{className:v(`text-xs font-semibold text-white mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),h6:({children:t,className:n})=>(0,F.jsx)(`h6`,{className:v(`text-xs font-medium text-[var(--oh-text-tertiary)] mb-0.5 mt-1.5 first:mt-0`,n,e),children:t}),p:({children:t,className:n})=>(0,F.jsx)(`p`,{className:v(`py-2.5 first:pt-0 last:pb-0`,n,e),children:t}),ul:({children:t,className:n})=>(0,F.jsx)(`ul`,{className:v(`list-disc ml-5 pl-2 whitespace-normal`,n,e),children:t}),ol:({children:t,className:n,start:r})=>(0,F.jsx)(`ol`,{className:v(`list-decimal ml-5 pl-2 whitespace-normal`,n,e),start:r,children:t}),li:({children:t,className:n})=>(0,F.jsx)(`li`,{className:v(n,e),children:t}),a:({children:t,className:n,href:r})=>(0,F.jsx)(`a`,{className:v(`text-blue-500 hover:underline`,n,e),href:r,target:`_blank`,rel:`noopener noreferrer`,children:t}),code:({children:t,className:n})=>(0,F.jsx)(`code`,{className:v(`bg-[var(--oh-surface-raised)] px-1.5 py-0.5 rounded text-[var(--oh-foreground)] border border-[var(--oh-border-subtle)]`,n,e),children:t})}}var _n=gn(),vn=300,yn=gn(`shine-text`);function bn({planContent:e,isStreaming:t,isBuildDisabled:n}){let{t:r}=s(`openhands`),{navigateToTab:i}=We(),{handleBuildPlanClick:a}=on(),{scrollDomToBottom:o}=St(),c=()=>{i(`planner`)},l=(0,P.useCallback)(e=>{a(e),o()},[a,o]),u=(0,P.useMemo)(()=>e?e.length<=vn?e:`${e.slice(0,vn)}...`:``,[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)(Xe,{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(h.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(h.COMMON$VIEW)}),(0,F.jsx)(at,{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)(N,{includeStandard:!0,components:t?yn:_n,children:u}),e&&e.length>vn&&(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(h.COMMON$READ_MORE)})]})}),(0,F.jsx)(`div`,{className:`border-t border-[var(--oh-border)] flex h-[54px] items-center justify-start px-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:l,disabled:n,className:v(`bg-white flex items-center justify-center h-[26px] px-2 rounded-[4px] w-[93px] transition-opacity`,n?`opacity-50 cursor-not-allowed`:`hover:opacity-90 cursor-pointer`),"data-testid":`plan-preview-build-button`,children:(0,F.jsxs)(O.Text,{className:`font-normal text-[14px] text-black leading-5`,children:[r(h.COMMON$BUILD),` `,(0,F.jsx)(O.Text,{className:`font-normal text-black`,children:`⌘↩`})]})})})]}):null}function xn({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&&f.exists(e)?e:`CHAT_INTERFACE$AGENT_ERROR_MESSAGE`),(0,F.jsx)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`cursor-pointer text-left`,children:r?(0,F.jsx)(L,{className:`h-4 w-4 ml-2 inline fill-danger`}):(0,F.jsx)(I,{className:`h-4 w-4 ml-2 inline fill-danger`})})]}),r&&(0,F.jsx)(N,{children:t})]})}function Sn({event:e}){return Ne(e)?(0,F.jsx)(xn,{errorId:e.id,defaultMessage:e.error}):null}function Cn({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 wn({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 Tn({onClick:e,className:t}){return(0,F.jsx)(`button`,{type:`button`,onClick:e,className:v(`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 En({src:e,size:t=`small`}){return(0,F.jsx)(`img`,{role:`img`,alt:``,src:e,className:v(`rounded-sm object-cover`,t===`small`&&`w-[62px] h-[62px]`,t===`large`&&`w-[100px] h-[100px]`)})}function Dn({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)(En,{src:e,size:n}),t&&(0,F.jsx)(Tn,{onClick:t,className:`absolute right-[3px] top-[3px] cursor-pointer`})]})}function On({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)(Cn,{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:v(`flex overflow-x-auto`,e===`small`&&`gap-2`,e===`large`&&`gap-4`),children:t.map((t,r)=>(0,F.jsx)(Dn,{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)(wn,{active:!c})})]})}var kn=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=f.t(h.CHAT_INTERFACE$AUGMENTED_PROMPT_FILES_TITLE);return n.split(r)[0]};function An(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function jn(e){let t=Math.round(e*5);return{filled:t,empty:5-t}}function Mn(e){return e>=.6?`text-green-400`:e>=.4?`text-yellow-400`:`text-red-400`}function Nn(e){return e>=.7?`text-red-400 font-semibold`:e>=.5?`text-yellow-400`:`text-neutral-400`}function Pn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Fn(e){let t=e?.verification;if(!Pn(t))return null;let n=t.enable_iterative_refinement;return typeof n==`boolean`?n:null}function In({feature:e}){let t=Math.round(e.probability*100),n=Nn(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)(In,{feature:e})]},e.name))]})}function Ln({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(h.CRITIC$POTENTIAL_ISSUES),features:e.agent_behavioral_issues}),i&&(0,F.jsx)(U,{label:t(h.CRITIC$INFRASTRUCTURE),features:e.infrastructure_issues}),r&&(0,F.jsx)(U,{label:t(h.CRITIC$LIKELY_FOLLOWUP),features:e.user_followup_patterns}),a&&(0,F.jsx)(U,{label:t(h.CRITIC$OTHER),features:e.other})]})}function Rn({criticResult:e}){let{t}=s(),{data:n}=ae(),[r,i]=P.useState(!1),a=An(e.score),{filled:o,empty:c}=jn(a),l=Mn(a),u=(a*100).toFixed(1),d=Fn(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(h.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?h.BUTTON$COLLAPSE_DETAILS:h.BUTTON$EXPAND_DETAILS),children:r?(0,F.jsx)(L,{className:`h-3 w-3 inline fill-neutral-400`}):(0,F.jsx)(I,{className:`h-3 w-3 inline fill-neutral-400`})})]}),r&&p&&(0,F.jsx)(Ln,{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(h.CRITIC$ITERATIVE_REFINEMENT_HINT)})]})}var zn=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?h.THINKING$COLLAPSE:h.THINKING$EXPAND),"data-testid":`collapsible-thinking-toggle`,className:`w-full flex items-center gap-2 text-left cursor-pointer`,children:[(0,F.jsx)(i,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(zn,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-normal text-[var(--oh-muted)]`,children:t(h.THINKING$TITLE)})]}),n&&(0,F.jsx)(`div`,{className:`mt-1.5 pl-6`,"data-testid":`collapsible-thinking-content`,children:(0,F.jsx)(N,{children:e})})]})}var Bn=()=>{let e=o();return l({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 Vn({event:e,isFromPlanningAgent:t}){let{t:n}=s(`openhands`),{navigate:r}=ce(),{conversationId:i}=M(),a=p().backend.kind===`cloud`,{mutate:o,isPending:c}=Bn(),l=fe(e=>e.setMessageToSend),u=P.useRef(!1),d=kn(e),{reasoning:f,message:g}=e.source===`agent`?Re(d):{reasoning:``,message:d},_=[];Array.isArray(e.llm_message.content)&&e.llm_message.content.forEach(e=>{e.type===`image`&&_.push(...e.image_urls)});let v=!a&&i?[{icon:(0,F.jsx)(be,{width:15,height:15,"aria-hidden":!0}),onClick:()=>{if(!i||c||u.current)return;u.current=!0;let t=Ce.getCurrentConversation(),n=t?.id===i?t.title:void 0,a=n?`${n} (branch)`:void 0,s=e.source===`user`&&g.length>0;o({sourceConversationId:i,eventId:e.id,...s?{editText:g}:{},...a?{title:a}:{}},{onSuccess:({info:e,excluded:t})=>{r(`/conversations/${e.id}`),t&&window.setTimeout(()=>l(g),0)},onError:e=>m(e instanceof Error?e.message:null),onSettled:()=>{u.current=!1}})},tooltip:n(h.CHAT_INTERFACE$BRANCH_FROM_HERE)}]:void 0;return(0,F.jsxs)(F.Fragment,{children:[f&&(0,F.jsx)(W,{content:f}),(0,F.jsx)(H,{type:e.source,message:g,isFromPlanningAgent:t,actions:v,timestamp:e.timestamp,children:_.length>0&&(0,F.jsx)(On,{size:`small`,images:_})}),e.source===`agent`&&e.critic_result!=null&&(0,F.jsx)(Rn,{criticResult:e.critic_result})]})}var Hn=e=>{switch(e){case g.LOW:return f.t(h.SECURITY$LOW_RISK);case g.MEDIUM:return f.t(h.SECURITY$MEDIUM_RISK);case g.HIGH:return f.t(h.SECURITY$HIGH_RISK);case g.UNKNOWN:default:return f.t(h.SECURITY$UNKNOWN_RISK)}},G=()=>``,Un=e=>e.name?`**Skill:** \`${e.name}\``:G(),Wn=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()},Gn=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}`},Kn=e=>{let t=`Command:\n\`${e.action.command}\``;return(e.security_risk===g.HIGH||e.security_risk===g.MEDIUM)&&(t+=`\n\n${Hn(e.security_risk)}`),t},qn=e=>{let t=`**MCP Tool Call**
5
+
6
+ `;return t+=`**Arguments:**\n\`\`\`json\n${JSON.stringify(e.data,null,2)}\n\`\`\``,t},Jn=e=>e.thought,Yn=e=>e.message.trim(),Xn=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},Zn=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()}},Qn=e=>{let{action:t}=e;switch(t.kind){case`FileEditorAction`:case`StrReplaceEditorAction`:return Gn(t);case`ExecuteBashAction`:case`TerminalAction`:return Kn(e);case`MCPToolAction`:return qn(t);case`ThinkAction`:return Jn(t);case`FinishAction`:return Yn(t);case`TaskTrackerAction`:return Xn(t);case`BrowserNavigateAction`:case`BrowserClickAction`:case`BrowserTypeAction`:case`BrowserGetStateAction`:case`BrowserGetContentAction`:case`BrowserScrollAction`:case`BrowserGoBackAction`:case`BrowserListTabsAction`:case`BrowserSwitchTabAction`:case`BrowserCloseTabAction`:return Zn(t);case`GrepAction`:case`GlobAction`:return Wn(e);case`InvokeSkillAction`:return Un(t);default:return Vt(e)}},$n=e=>{if(e.is_error||e.status===`failed`)return`error`;if(e.status===`completed`)return`success`},er=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`}},tr=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 er(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},nr=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()||f.t(h.OBSERVATION$COMMAND_NO_OUTPUT)}\n\`\`\``,r},rr=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},ir=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},ar=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},or=e=>e.observation.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
17
+ `),sr=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
+ `)},cr=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},lr=e=>{let{observation:t}=e;return t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
22
+ `)||``},ur=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},dr=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},fr=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},pr=e=>{switch(e.observation.kind){case`FileEditorObservation`:case`StrReplaceEditorObservation`:return tr(e);case`ExecuteBashObservation`:case`TerminalObservation`:return nr(e);case`BrowserObservation`:return rr(e);case`MCPToolObservation`:return ir(e);case`TaskTrackerObservation`:return cr(e);case`ThinkObservation`:return lr(e);case`FinishObservation`:return ur(e);case`GlobObservation`:return dr(e);case`GrepObservation`:return fr(e);case`InvokeSkillObservation`:return ar(e);case`CanvasUIObservation`:return or(e);case`ClientToolObservation`:return e.tool_name===`canvas_ui_control`?or(e):Vt(e);case`SwitchLLMObservation`:return sr(e);default:return Vt(e)}},mr=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`})}),hr=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 gr({task:e}){let{t}=s(`openhands`),n=(0,P.useMemo)(()=>{switch(e.status){case`todo`:return(0,F.jsx)(mr,{className:`w-4 h-4 text-[#ffffff]`});case`in_progress`:return(0,F.jsx)(hr,{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)(mr,{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:v(`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(h.TASK_TRACKING_OBSERVATION$TASK_NOTES),`: `,e.notes]})]})]})}function _r({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)(Xe,{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(h.COMMON$TASKS)})]}),(0,F.jsx)(`div`,{children:e.map((e,t)=>(0,F.jsx)(gr,{task:e},`task-${t}`))})]})}function vr({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)(_r,{taskList:r})})}var yr=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(``),br=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},xr=(e,t)=>{let n=`\n\n- **${e}**`;return t&&t.trim().length>0&&(n+=`\n\n${t}`),n},Sr=(e,t)=>{let n=`
29
+
30
+ **Triggered Skill Knowledge:**`;return e.forEach((e,r)=>{let i=r<t.length?t[r]:void 0;n+=xr(e,i)}),n},Cr=e=>{let t=`
31
+
32
+ **Extended Content:**`;return e.forEach(e=>{e.trim().length>0&&(t+=`\n\n${e}`)}),t},wr=e=>!e||e.length===0?[]:br(yr(e)),Tr=(e,t)=>{let n=wr(t);return e&&e.length>0?Sr(e,n):n.length>0?Cr(n):``},Er=(e,t)=>{let n=wr(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,Dr=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=Tr(t,n),i=Er(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 Or({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?h.BUTTON$COLLAPSE:h.BUTTON$EXPAND),m=(0,F.jsx)(D,{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 kr({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(h.OBSERVATION$EXIT_CODE,{code:t})}),(0,F.jsx)(Or,{code:e,language:`bash`,copy:n,placeholder:r(h.OBSERVATION$COMMAND_NO_OUTPUT),expandable:!0,wrapLongLines:!0})]})}var Ar=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)(Or,{code:r,language:`bash`}),(i===g.HIGH||i===g.MEDIUM)&&(0,F.jsx)(`span`,{className:`text-xs text-status-fail-text`,children:n(i===g.HIGH?h.SECURITY$HIGH_RISK:h.SECURITY$MEDIUM_RISK)}),t&&(0,F.jsx)(kr,{output:J(t.observation.content),exitCode:t.observation.exit_code})]})}}),jr=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`}},Mr=3,Nr=300,Pr=25e4,Fr=(e,t)=>{if(e.length*t.length>Pr)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},Ir=(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-Mr),i),c=n.slice(a,Math.min(n.length,a+Mr));return[...s.map(e=>({type:`ctx`,text:e})),...Fr(n.slice(i,a),r.slice(i,o)),...c.map(e=>({type:`ctx`,text:e}))]},Lr={add:`bg-status-success-bg text-status-success-text`,del:`bg-status-fail-bg text-status-fail-text`,ctx:`text-muted`},Rr={add:`+ `,del:`- `,ctx:` `};function zr({oldText:e,newText:t}){let{t:n}=s(`openhands`),r=Ir(e,t),i=r.length>Nr;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,Nr):r).map((e,t)=>(0,F.jsx)(`div`,{className:v(`whitespace-pre-wrap px-2`,Lr[e.type]),children:`${Rr[e.type]}${e.text}`},`${t}-${e.type}`))}),i&&(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$TRUNCATED)})]})}function Br({path:e,range:t,onClick:n}){let{conversationId:r}=M();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}j(e,r)},children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(nt,{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 Vr=new Set([`md`,`markdown`,`mdx`]);function Hr(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Vr.has(e.slice(t+1).toLowerCase())}var Y=new Set([`FileEditorAction`,`StrReplaceEditorAction`]),Ur=new Set([`FileEditorObservation`,`StrReplaceEditorObservation`]);function Wr(e,t){if(k(e)&&Y.has(e.action.kind))return e.action.path||null;if(A(e)&&Ur.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 Gr(e,t){if(k(e)&&Y.has(e.action.kind))return e.action.command||null;if(A(e)&&Ur.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 Kr(e,t){let n=Wr(e,t),r=Gr(e,t);return!!(n&&r===`create`&&Hr(n))}function qr({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)(N,{content:e,includeStandard:!0,includeHeadings:!0,components:_n})}),(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)(nt,{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(h.COMMON$VIEW)}),(0,F.jsx)(at,{className:`text-white`,size:16})]}):null]})]})}var Jr=({action:e,observation:t})=>t?.observation.path??e?.action.path??``;function Yr({action:e,observation:t,onOpenFile:n}){let r=Jr({action:e,observation:t}),i=t?.observation.command??e?.action.command,a=jr(r),o=e?.action.view_range,s=i===`view`&&o?`${o[0]}-${o[1]}`:void 0,c=r?(0,F.jsx)(Br,{path:r,range:s,onClick:n}):null,l=e=>r&&i===`create`&&Hr(r)?{chip:null,body:(0,F.jsx)(qr,{content:e,path:r,onView:n})}:{chip:c,body:(0,F.jsx)(Or,{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)(zr,{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)(zr,{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 Xr({conversationId:e,...t}){let n=Jr(t),r=n&&t.observation?()=>j(n,e):void 0;return(0,F.jsx)(Yr,{...t,onOpenFile:r})}var Zr=q({actionKinds:[`FileEditorAction`,`StrReplaceEditorAction`],observationKinds:[`FileEditorObservation`,`StrReplaceEditorObservation`],Body:function(e){let{conversationId:t}=M();return t?(0,F.jsx)(Xr,{...e,conversationId:t}):(0,F.jsx)(Yr,{...e})}});function Qr({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 $r=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)(Qr,{rows:[{label:n(h.COMMON$PATTERN),value:a},...o?[{label:n(h.COMMON$PATH),value:o}]:[],...c?[{label:n(h.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(h.COMMON$NO_RESULTS)}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:n(h.COMMON$RESULTS,{count: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(h.COMMON$TRUNCATED)})]}))]})}});function ei({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)(N,{includeStandard:!0,includeHeadings:!0,children:t})})})]})}var ti=[Ar,Zr,$r,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(h.TASK$SUBAGENT),value:a}]:[],...o?[{label:n(h.TASK$TASK_ID),value:o}]:[]];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[u.length>0&&(0,F.jsx)(Qr,{rows:u}),c&&(0,F.jsx)(ei,{label:n(h.TASK$QUERY),text:c}),l&&(0,F.jsx)(ei,{label:n(h.TASK$RESULT),text:l,isError:i?.is_error})]})}})],ni=e=>new Map(ti.flatMap(t=>(e(t)??[]).map(e=>[e,t]))),ri=ni(e=>e.actionKinds),ii=ni(e=>e.observationKinds);function ai(e,t){if(k(e)){let t=ri.get(e.action.kind);if(t)return(0,F.jsx)(t.Body,{action:e})}else if(A(e)){let n=ii.get(e.observation.kind);if(n)return(0,F.jsx)(n.Body,{action:t,observation:e})}return null}var X=(e,t)=>f.exists(e)?(0,F.jsx)(d,{ns:`openhands`,i18nKey:e,values:t,components:{path:(0,F.jsx)(an,{}),cmd:(0,F.jsx)($t,{})}}):e,oi=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},si=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`},ci=(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`},li=e=>k(e)?si(e)||oi(Xt(e)):``,ui=(e,t)=>{if(!A(e))return``;let n=ci(e,t);if(n)return n;if(t){let e=si(t);if(e)return e;let n=Yt(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},di=(e,t)=>e.observation.kind!==`ClientToolObservation`||e.tool_name!==`canvas_ui_control`||!t||!Le(t)?null:`UI command '${t.action.command}' dispatched to the Agent Canvas frontend.`,fi=(e,t)=>{let n=``,r=``;if(K(e)){let t=`OBSERVATION_MESSAGE$SKILL_READY`;n=f.exists(t)?X(t,{}):`Skill Ready`,r=e._skillReadyContent}else k(e)?(n=li(e),r=ai(e)??Qn(e)):A(e)?(n=ui(e,t),r=e.observation.kind===`TaskTrackerObservation`?(0,F.jsx)(vr,{event:e}):di(e,t)??ai(e,t)??pr(e)):ze(e)?(n=X(Ht(e),{title:Wt(e)}),r=qt(e)):e.source===`agent`&&`action`in e&&e.action!==null&&typeof e.action==`object`&&`kind`in e.action&&typeof e.action.kind==`string`&&(n=String(e.action.kind).replace(`Action`,``).toUpperCase());return{title:n||f.t(h.EVENT$UNKNOWN_EVENT),details:r}};function pi({event:e,isFromPlanningAgent:t=!1}){let n=fi(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,timestamp:e.timestamp}),e.critic_result!=null&&(0,F.jsx)(Rn,{criticResult:e.critic_result})]})}var mi=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 hi(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(y[0]))n=a.trim(),i=e+1;else if(a.startsWith(y[2]))r=a.replace(y[2],``).trim(),i=e+1;else if(a.startsWith(y[1])||a.startsWith(y[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 gi(e){return e.replace(/<important>([\s\S]*?)<\/important>/gi,(e,t)=>`**${t.trim()}**`)}function _i({content:e}){let{t}=s(`openhands`),{matchInfo:n,filePath:r,body:i}=hi(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(h.COMMON$PATH),` `]}),(0,F.jsx)(`code`,{className:`bg-[var(--oh-surface)] px-1.5 py-0.5 rounded text-[var(--oh-text-tertiary)]`,children:r})]})]}),a&&i&&(0,F.jsx)(`hr`,{className:`border-[var(--oh-border-subtle)] mb-3`}),i&&(0,F.jsx)(N,{children:gi(i)})]})}function vi({items:e,titleKey:t=h.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)(S,{size:14}):(0,F.jsx)(C,{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)(_i,{content:e.content})]})]},e.name)})]})}function yi(e){if(K(e))return e._skillReadyItems.length>0?{items:e._skillReadyItems,titleKey:h.SKILLS$TRIGGERED_SKILL_KNOWLEDGE}:null;if(A(e)&&e.observation.kind===`InvokeSkillObservation`){let t=mi(e);return t.length>0?{items:t,titleKey:h.SKILLS$INVOKED_SKILL_KNOWLEDGE}:null}return null}function Q({event:e,correspondingAction:t}){let{title:n,details:r}=fi(e,t);if(!K(e)&&A(e)&&e.observation.kind===`TaskTrackerObservation`)return(0,F.jsx)(`div`,{children:r});let i;K(e)?i=`success`:A(e)?i=er(e):ze(e)&&(i=$n(e));let a=yi(e),o=a?(0,F.jsx)(vi,{items:a.items,titleKey:a.titleKey}):r,s=!K(e)&&Kr(e,t);return(0,F.jsx)(`div`,{children:(0,F.jsx)(R,{title:n,details:o,success:i,initiallyExpanded:s,timestamp:e.timestamp,titleIcon:a?(0,F.jsx)(Te,{className:`h-4 w-4 stroke-[var(--oh-muted)] flex-shrink-0 mr-2`}):void 0})})}function bi({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,timestamp:e.timestamp}):null}function xi(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 Si(e){return e.length>80?`${e.slice(0,77)}...`:e}function Ci(e,t){return e?`blocked`:t?`ok`:`failed`}function wi(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 Ti({event:e}){let{t}=s(`openhands`);if(!Fe(e))return null;let n=xi(e.hook_event_type,e.blocked),r=Ci(e.blocked,e.success),i=wi(e.blocked,e.success),a=(()=>{if(!e.blocked)return e.success?`success`:`error`})();return(0,F.jsx)(R,{title:(0,F.jsxs)(`span`,{children:[n,` `,t(h.HOOK$HOOK_LABEL),`: `,e.hook_event_type,e.tool_name&&(0,F.jsxs)(`span`,{className:`text-[var(--oh-muted)] ml-2`,children:[`(`,e.tool_name,`)`]}),(0,F.jsx)(`span`,{className:v(`ml-2 px-1 py-0.5 rounded text-xs`,i),children:r})]}),details:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 text-[var(--oh-muted)]`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$COMMAND),`:`]}),` `,(0,F.jsx)(`code`,{className:`text-xs bg-[var(--oh-surface)] px-1 py-0.5 rounded`,children:Si(e.hook_command)})]}),e.exit_code!==null&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$EXIT_CODE),`:`]}),` `,e.exit_code]}),e.blocked&&e.reason&&(0,F.jsxs)(`div`,{className:`text-amber-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$BLOCKED_REASON),`:`]}),` `,e.reason]}),e.additional_context&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$CONTEXT),`:`]}),` `,e.additional_context]}),e.error&&(0,F.jsxs)(`div`,{className:`text-red-400`,children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$ERROR),`:`]}),` `,e.error]}),e.stdout&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$OUTPUT),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto`,children:e.stdout})]}),e.stderr&&(0,F.jsxs)(`div`,{children:[(0,F.jsxs)(`span`,{className:`text-[var(--oh-text-subtle)]`,children:[t(h.HOOK$STDERR),`:`]}),(0,F.jsx)(`pre`,{className:`text-xs bg-[var(--oh-surface)] p-2 rounded mt-1 overflow-x-auto max-h-40 overflow-y-auto text-amber-300`,children:e.stderr})]})]}),success:a})}function Ei(e){let t=[],n=[];for(let r of e)Ue(r)?(n.length>0&&t.push(n),n=[r]):n.push(r);return n.length>0&&t.push(n),t}var Di=e=>e?.toUpperCase().endsWith(`PLAN.MD`)??!1;function Oi(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(Pe(n)&&Di(n.observation.path))return n.id}return null}function ki(e){return(0,P.useMemo)(()=>{let t=new Set;return Ei(e).forEach(e=>{let n=Oi(e);n&&t.add(n)}),t},[e])}function Ai(e,t){return t.has(e)}var ji=e=>e.activated_skills||[],Mi=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),Ni=e=>{let t=ji(e).length>0,n=Mi(e.extended_content);return t&&n},Pi=(e,t,n)=>{try{let r=Dr(e);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Vn,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,F.jsx)(Q,{event:r,isLastMessage:n})]})}catch{return(0,F.jsx)(Vn,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function Fi({planContent:e,isLastMessage:t,isMainAgentRunning:n}){let{localPlanningConversationId:r,curPlanningAgentState:i,isPlanningAgentRunning:a}=Ke();return(0,F.jsx)(bn,{planContent:e,isStreaming:t&&!!r&&i===_.RUNNING,isBuildDisabled:n||a})}function Ii({event:e,messages:t,isLastMessage:n,isInLast10Actions:r,planPreviewEventIds:i,suppressThought:a=!1}){let{data:o}=E(),{planContent:s}=fe(),{curAgentState:c}=Ae(),l=c===_.RUNNING||c===_.LOADING,u=e.isFromPlanningAgent||!1,d={isLastMessage:n,isInLast10Actions:r,config:o,isFromPlanningAgent:u};if(tt(e)&&He(e))return(0,F.jsx)(ht,{status:e.value});if(Ne(e))return(0,F.jsx)(Sn,{event:e,...d});if(Fe(e))return(0,F.jsx)(Ti,{event:e});if(ze(e))return(0,F.jsx)(Q,{event:e,isLastMessage:n});if(Ie(e)){let{reasoning:t,message:n}=Re(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,timestamp:e.timestamp})]})}if(k(e)&&e.action.kind===`FinishAction`)return(0,F.jsx)(pi,{event:e,...d});if(k(e)&&e.action.kind===`ThinkAction`)return(0,F.jsx)(W,{content:e.action.thought});if(k(e)){let t=je(e);return(0,F.jsxs)(F.Fragment,{children:[t&&(0,F.jsx)(W,{content:t}),!a&&(0,F.jsx)(bi,{event:e,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n})]})}if(A(e)){if(Pe(e))return i&&Ai(e.id,i)?(0,F.jsx)(Fi,{planContent:s,isLastMessage:n,isMainAgentRunning:l}):null;let r=t.find(t=>k(t)&&t.id===e.action_id),o=!a&&r&&k(r)&&r.action.kind!==`ThinkAction`,c=r&&k(r)?je(r):``;return(0,F.jsxs)(F.Fragment,{children:[c&&(0,F.jsx)(W,{content:c}),o&&(0,F.jsx)(bi,{event:r,isFromPlanningAgent:u}),(0,F.jsx)(Q,{event:e,isLastMessage:n,correspondingAction:r&&k(r)?r:void 0})]})}if(!k(e)&&!A(e)){let t=e;return Ue(e)&&Ni(t)?Pi(t,d,n):(0,F.jsx)(Vn,{event:t,...d,isLastMessage:n})}return(0,F.jsx)(Q,{event:e,isLastMessage:n})}var Li=(e,t)=>{if(k(e)){let{kind:n}=e.action;return!(n===`FinishAction`||n===`ThinkAction`||Kr(e,t))}return A(e)?!(Pe(e)||Kr(e,t)||e.observation.kind===`TaskTrackerObservation`):!1},Ri=(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(Li(e,A(e)?n.find(t=>k(t)&&t.id===e.action_id):void 0)){let s=Je(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},zi=(0,P.createContext)(!1);function Bi({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=>k(e)),d=e.filter(A).length,f=e.length,p=!!u,m=e[e.length-1],g=null;m&&(k(m)?g=fi(m).title:A(m)&&(g=fi(m,(t??e).find(e=>k(e)&&e.id===m.action_id)).title));let _=p?i(h.EVENT_GROUP$ACTIONS_PROGRESS,{completed:d,total:f}):i(h.EVENT_GROUP$ACTIONS_COMPLETED,{count:f}),v=a?L:I;return(0,F.jsxs)(`div`,{className:`my-1 w-full py-1 text-sm`,"data-testid":`event-group`,children:[(0,F.jsx)(`button`,{id:l,type:`button`,onClick:()=>o(e=>!e),"aria-controls":c,"aria-expanded":a,"aria-label":i(a?h.EVENT_GROUP$COLLAPSE:h.EVENT_GROUP$EXPAND),"data-testid":`event-group-toggle`,className:`w-full flex items-center justify-between gap-2 text-left cursor-pointer`,children:n?(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:_})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(v,{className:`h-4 w-4 fill-[var(--oh-muted)] flex-shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:(0,F.jsx)(en.Provider,{value:!1,children:g??_})})]}),(0,F.jsxs)(`span`,{className:`flex items-center flex-shrink-0 font-normal text-[var(--oh-muted)]`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:_}),p?(0,F.jsx)(re,{"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)(zi.Provider,{value:!0,children:r})})]})}function Vi({type:e,onClick:t}){let{t:n}=s(`openhands`),r=e===`confirm`,i=n(r?h.ACTION$CONFIRM:h.ACTION$REJECT),a=n(r?h.CHAT_INTERFACE$USER_CONFIRMED:h.CHAT_INTERFACE$USER_REJECTED),o=r?`${n(h.CHAT_INTERFACE$INPUT_CONTINUE_MESSAGE)} ⌘↩`:`${n(h.BUTTON$CANCEL)} ⇧⌘⌫`;return(0,F.jsx)(ue,{closeDelay:100,content:a,children:(0,F.jsx)(`button`,{"data-testid":`action-${e}-button`,type:`button`,"aria-label":i,className:v(`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 Hi({className:e,content:t,icon:n,severity:r,title:i}){return r===`high`?(0,F.jsxs)(`div`,{className:v(`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 Ui=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`})]}),Wi=de(e=>({submittedEventIds:[],addSubmittedEventId:t=>e(e=>({submittedEventIds:[...e.submittedEventIds,t]})),removeSubmittedEventId:t=>e(e=>({submittedEventIds:e.submittedEventIds.filter(e=>e!==t)}))})),Gi=()=>l({mutationKey:[`respond-to-confirmation`],mutationFn:async({conversationId:e,conversationUrl:t,sessionApiKey:n,accept:r})=>{let i={accept:r};return $e.respondToConfirmation(e,t,i,n)}});function Ki(){let e=Wi(e=>e.submittedEventIds),t=Wi(e=>e.addSubmittedEventId),{t:n}=s(`openhands`),{data:r}=Qe(),{curAgentState:i}=Ae(),{mutate:a}=Gi(),o=Me(e=>e.events).slice().reverse().find(e=>e.source===`agent`?i===_.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!==_.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:[(k(o)?o.security_risk:g.UNKNOWN)===g.HIGH&&(0,F.jsx)(Hi,{content:n(h.CHAT_INTERFACE$HIGH_RISK_WARNING),icon:(0,F.jsx)(Ui,{width:16,height:16,color:`#fff`}),severity:`high`,title:n(h.COMMON$HIGH_RISK)}),(0,F.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,F.jsx)(`p`,{className:`text-sm font-normal text-white`,children:n(h.CHAT_INTERFACE$USER_ASK_CONFIRMATION)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(Vi,{type:`reject`,onClick:()=>c(!1)}),(0,F.jsx)(Vi,{type:`confirm`,onClick:()=>c(!0)})]})]})]})}var qi=e=>e.at(-1)?.id,$=e=>e.at(-1),Ji=P.memo(({messages:e,allEvents:t})=>{let{conversationId:n}=M(),r=ki(t),i=et(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)(vt,{conversationId:n,anchorEventId:t}):null},s=P.useMemo(()=>Ri(e,void 0,t),[e,t]),c=(n,i,a)=>(0,F.jsx)(Ii,{event:n,messages:t,isLastMessage:e.length-1===i,isInLast10Actions:e.length-1-i<10,planPreviewEventIds:r,suppressThought:a},n.id);return(0,F.jsxs)(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)(bi,{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)(Bi,{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}`)}),(0,F.jsx)(Ki,{})]})},(e,t)=>e.messages.length===t.messages.length&&e.allEvents.length===t.allEvents.length&&qi(e.messages)===qi(t.messages)&&qi(e.allEvents)===qi(t.allEvents)&&$(e.messages)===$(t.messages)&&$(e.allEvents)===$(t.allEvents));Ji.displayName=`Messages`;export{R as A,jt as C,vt as D,yt as E,ct as M,st as N,ht as O,ot as P,Pt as S,Ct as T,Xt as _,hr as a,Ht as b,Qn as c,_n as d,H as f,$t as g,an as h,jr as i,lt as j,ft as k,kn as l,on as m,Ri as n,mr as o,un as p,Hr as r,pr as s,Ji as t,On as u,Yt as v,xt as w,Wt as x,qt 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-BOco8mxR.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-BOco8mxR.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-CV850oio.js";import{K as r,t as i}from"./utils-BOco8mxR.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{i as e}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.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};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,yt as n}from"./vendor-styling-Ck5D_A2Q.js";import{F as r}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~i58xkef6-cHFhpUBq.js";import{r as i}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~ew9ih1s8-DnDoaYNi.js";import{t as a}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~iyia17eu-CV850oio.js";import{i as o}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~czjee3a3-BfkNGovw.js";import{t as s}from"./useMutation-CJuK90oc.js";import{t as c}from"./useQueries-CykmpT-a.js";import{t as l}from"./useQuery-S6j94er1.js";import{L as u,n as d}from"./active-backend-context-rZiLJRUc.js";import{K as f,t as p}from"./utils-BOco8mxR.js";import{n as m}from"./agent-server-client-options-BikiNwTa.js";import{_ as h,s as g,v as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0x1wrp2-Z0lly3FE.js";import{t as v}from"./use-onboarding-completion-CoINurkm.js";import{n as y}from"./use-settings-Dn00UISA.js";import{t as b}from"./modal-backdrop-BSzNhM4r.js";import{r as x,t as S}from"./modal-body-DJw4xBki.js";import{r as C}from"./base-modal-DTULovNc.js";import{i as w}from"./modal-classes-Dg0ngBPO.js";import{t as T}from"./brand-button-DxPO4Lf8.js";import{m as E}from"./use-llm-configured-DGm8FiRR.js";import{t as D}from"./confirmation-modal-gIFHeZt6.js";import{f as O}from"./llm-subscription-DTqtBCWz.js";import{t as ee}from"./onboarding-modal-DDTjOpyd.js";import{t as k}from"./folder-C1ou4_DT.js";import{t as A}from"./close-ScPlnwyq.js";var te=o(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),j=e(t(),1);function M(){return new g(m())}function N(e){return{workspaces:e.workspaces.map(({parentPath:e,...t})=>({...t,...e?{parentPath:e}:{}})),workspaceParents:e.workspaceParents}}var P=class{static async listWorkspaces(){return N(await M().listWorkspaces())}static async addWorkspaces(e){return N(await M().addWorkspaces(e))}static async removeWorkspace(e){await M().deleteWorkspace(e)}static async addWorkspaceParents(e){return N(await M().addWorkspaceParents(e))}static async removeWorkspaceParent(e){await M().deleteWorkspaceParent(e)}};function F({enabled:e=!0}={}){return l({queryKey:u.all,queryFn:()=>P.listWorkspaces(),enabled:e,retry:(e,t)=>!h(t)&&e<3,meta:{disableToast:!0},staleTime:6e4})}function I(){return new _(m())}async function L(e,t=I()){let n=[],r=new Set,i;for(;;){let a=await t.searchSubdirectories(e,i?{pageId:i}:void 0);if(n.push(...a.items),i=a.next_page_id,!i)return{items:n,next_page_id:null};if(r.has(i))throw Error(`File search returned a repeated page id`);r.add(i)}}var R=e=>{let t=d();return l({queryKey:[`file`,`search_subdirs`,e,t.backend.id,t.orgId],queryFn:()=>L(e),enabled:!!e,retry:!1,meta:{disableToast:!0}})},z=()=>{let e=d();return l({queryKey:[`file`,`home`,e.backend.id,e.orgId],queryFn:async()=>I().getHome(),retry:!1,meta:{disableToast:!0},staleTime:1/0})};function ne(){let{data:e,isLoading:t,isError:n,error:r}=F(),i=h(r),a=e?.workspaces??[],o=e?.workspaceParents??[],s=(0,j.useMemo)(()=>{let e=new Set(o.map(e=>e.path)),t=[].filter(t=>!e.has(t.path));return t.length===0?o:[...o,...t]},[o,i]),l=c({queries:i?[]:s.map(e=>({queryKey:[`file`,`search_subdirs`,e.path],queryFn:()=>L(e.path),retry:!1,meta:{disableToast:!0}}))}),u=t||l.some(e=>e.isLoading),d=n||l.some(e=>e.isError);return{workspaces:(0,j.useMemo)(()=>{let e=new Map,t=new Map(s.map((e,t)=>[e.path,l[t]]));return s.forEach(n=>{(t.get(n.path)?.data?.items??[]).forEach(t=>{e.has(t.path)||e.set(t.path,{id:t.path,name:t.name,path:t.path,parentPath:n.path})})}),a.forEach(t=>{e.set(t.path,t)}),Array.from(e.values())},[a,s,l.map(e=>`${e.dataUpdatedAt??0}:${e.status}`).join(`|`)]),parents:s,isLoading:u,isError:d,error:r}}var B=n();function re(){return(0,B.jsx)(E,{inset:`menu`})}function ie(){let e=i();return s({mutationFn:e=>P.addWorkspaces(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function ae(){let e=i();return s({mutationFn:e=>P.removeWorkspace(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function V(){let e=i();return s({mutationFn:e=>P.addWorkspaceParents(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function H(){let e=i();return s({mutationFn:e=>P.removeWorkspaceParent(e),onSuccess:()=>e.invalidateQueries({queryKey:u.all})})}function U(e,t){return h(e)?t(f.HOME$WORKSPACES_UNSUPPORTED_AGENT_SERVER,{actualVersion:e.actualVersion,requiredVersion:e.requiredVersion}):null}var W=e=>(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,B.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.8227 16.6549L10.4043 12.6668L13.8227 8.67871L14.9615 9.6549L12.3799 12.6668L14.9615 15.6787L13.8227 16.6549Z`,fill:`currentColor`})}),G=`/projects`;function K({label:e,entries:t,currentPath:n,onPick:r}){return t.length===0?null:(0,B.jsxs)(`div`,{className:`px-2 pb-3`,children:[(0,B.jsx)(`div`,{className:`px-2 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>{let t=n===e.path;return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>r(e.path),"data-testid":`folder-browser-sidebar-${e.label.toLowerCase()}`,className:p(`flex items-center gap-2 w-full px-2 py-1 rounded text-sm cursor-pointer`,t?`bg-tertiary text-white`:`text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,B.jsx)(k,{width:14,height:14,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.path)})})]})}function q(e){let t=Y(e);if(!t||t===`/`||J(t))return null;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}${t[n]}`:r}function J(e){return/^[A-Za-z]:[\\/]?$/.test(e)}function Y(e){let t=e.replace(/[\\/]+$/,``);return/^[A-Za-z]:$/.test(t)?`${t}${e.includes(`/`)&&!e.includes(`\\`)?`/`:`\\`}`:t}function X(e){return e?.home===`/home/openhands`}function oe({isOpen:e,onClose:t,onAdd:n,onAddParent:r}){let{t:i}=a(`openhands`),[o,s]=(0,j.useState)(null),c=d(),{data:l}=z();(0,j.useEffect)(()=>{e&&l?.home&&o===null&&s(X(l)?G:l.home),e||s(null)},[e,l?.home,o]),(0,j.useEffect)(()=>{s(null)},[c.backend.id,c.orgId]);let{data:u,isLoading:m,isError:h,error:g}=R(e?o:null),_=(0,j.useMemo)(()=>{if(!l?.home)return[];let e=[{label:`Home`,path:Y(l.home)||l.home},...l.favorites??[]];return X(l)&&!e.some(e=>e.path===G)&&e.push({label:G,path:G}),e},[l]),v=l?.locations??[];if(!e)return null;let y=u?.items??[],E=o?q(o):null,D=l?.home===`/home/openhands`&&(l?.favorites?.length??0)===0&&o===l?.home&&!m&&!h&&y.length===0,O=e=>{let t=Y(e);if(!t)return`/`;if(t===`/`||J(t))return t;let n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n>=0&&t.slice(n+1)||t};return(0,B.jsx)(b,{onClose:t,"aria-label":i(f.HOME$ADD_WORKSPACES_TITLE),children:(0,B.jsxs)(`div`,{"data-testid":`folder-browser-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`xl`),S,`h-[480px]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(C,{className:w,title:i(f.HOME$ADD_WORKSPACES_TITLE)})}),(0,B.jsxs)(`div`,{className:`flex flex-1 min-h-0`,children:[(0,B.jsxs)(`aside`,{"data-testid":`folder-browser-sidebar`,className:`w-[180px] shrink-0 border-r border-[var(--oh-border-input)] bg-[var(--oh-surface)] py-3 overflow-y-auto`,children:[(0,B.jsx)(K,{label:i(f.HOME$FAVORITES),entries:_,currentPath:o,onPick:s}),(0,B.jsx)(K,{label:i(f.HOME$LOCATIONS),entries:v,currentPath:o,onPick:s})]}),(0,B.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border-b border-[var(--oh-border-input)]`,children:[(0,B.jsx)(`button`,{type:`button`,"data-testid":`folder-browser-up`,onClick:()=>E&&s(E),disabled:!E,"aria-label":i(f.COMMON$UP),className:`p-1 rounded hover:bg-[var(--oh-interactive-hover)] text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,B.jsx)(W,{width:16,height:16})}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,"data-testid":`folder-browser-current-path`,children:o??``})]}),(0,B.jsxs)(`div`,{className:`grid grid-cols-[1fr_120px] px-4 py-1 border-b border-[var(--oh-border-input)] text-xs text-[var(--oh-text-secondary)] font-semibold`,children:[(0,B.jsx)(`span`,{children:i(f.HOME$NAME)}),(0,B.jsx)(`span`,{children:i(f.HOME$KIND)})]}),(0,B.jsxs)(`ul`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`folder-browser-list`,children:[m&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,children:i(f.HOME$LOADING)}),h&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-red-400`,"data-testid":`folder-browser-error`,children:g?.message??i(f.COMMON$FAILED_TO_LOAD)}),!m&&!h&&y.length===0&&(0,B.jsx)(`li`,{className:`px-4 py-2 text-sm text-[var(--oh-text-secondary)]`,"data-testid":D?`folder-browser-host-home-hint`:`folder-browser-empty`,children:i(D?f.HOME$HOST_HOME_NOT_MOUNTED_HINT:f.HOME$NO_WORKSPACES)}),y.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:`grid grid-cols-[1fr_120px] items-center w-full text-left px-4 py-1.5 text-sm text-white hover:bg-[var(--oh-interactive-hover)] cursor-pointer`,"data-testid":`folder-browser-entry-${e.name}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 min-w-0`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,B.jsx)(`span`,{className:`text-[var(--oh-text-secondary)] text-xs`,children:i(f.HOME$FOLDER)})]})},e.path))]})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:[(0,B.jsx)(T,{type:`button`,variant:`secondary`,onClick:t,testId:`folder-browser-cancel`,children:i(f.HOME$CANCEL)}),r&&(0,B.jsx)(T,{type:`button`,variant:`secondary`,onClick:()=>{!o||!r||(r([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||m,testId:`folder-browser-add-all-subdirs`,children:i(f.HOME$ADD_ALL_SUBDIRECTORIES)}),(0,B.jsx)(T,{type:`button`,variant:`primary`,onClick:()=>{o&&(n([{id:o,name:O(o),path:o}]),t())},isDisabled:!o||m,testId:`folder-browser-use`,children:i(f.HOME$ADD_THIS_DIRECTORY)})]})]})})}function Z({isOpen:e,workspaces:t,workspaceParents:n=[],onClose:r,onRemove:i,onRemoveParent:o}){let{t:s}=a(`openhands`),[c,l]=j.useState(null);if(!e)return null;let u=t.filter(e=>!e.parentPath),d=new Map;t.forEach(e=>{if(!e.parentPath)return;let t=d.get(e.parentPath)??[];t.push(e),d.set(e.parentPath,t)});let m=u.length>0||n.length>0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(b,{onClose:r,"aria-label":s(f.HOME$MANAGE_WORKSPACES),children:(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-modal`,className:p(`flex flex-col bg-[var(--oh-surface)] border border-[var(--oh-border-input)] rounded-xl`,x(`lg`),S,`max-h-[70vh]`),children:[(0,B.jsx)(`div`,{className:`flex items-center justify-between px-5 py-3 border-b border-[var(--oh-border-input)]`,children:(0,B.jsx)(C,{className:w,title:s(f.HOME$MANAGE_WORKSPACES)})}),(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto custom-scrollbar-always`,"data-testid":`manage-workspaces-list`,children:[!m&&(0,B.jsx)(`p`,{className:`px-5 py-6 text-sm text-[var(--oh-text-secondary)] text-center`,children:s(f.HOME$MANAGE_WORKSPACES_EMPTY)}),u.length>0&&(0,B.jsx)(`ul`,{children:u.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 py-2 border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-row-${e.name}`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`workspace`,path:e.path,text:s(f.HOME$REMOVE_WORKSPACE_CONFIRMATION,{name:e.name})}),"aria-label":s(f.HOME$REMOVE_WORKSPACE),"data-testid":`manage-workspaces-remove-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(A,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(f.HOME$REMOVE_WORKSPACE)})]})]},e.id))}),n.length>0&&(0,B.jsxs)(`div`,{"data-testid":`manage-workspaces-parents-section`,children:[(0,B.jsx)(`div`,{className:`px-5 pt-3 pb-1 text-[11px] uppercase tracking-wide text-[var(--oh-muted)] font-semibold`,children:s(f.HOME$WORKSPACE_PARENTS)}),(0,B.jsx)(`ul`,{children:n.map(e=>{let t=d.get(e.path)??[];return(0,B.jsxs)(`li`,{className:`border-b border-[var(--oh-border-subtle)] last:border-b-0`,"data-testid":`manage-workspaces-parent-row-${e.name}`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-2`,children:[(0,B.jsx)(k,{width:16,height:16,className:`shrink-0`}),(0,B.jsxs)(`div`,{className:`flex flex-col min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`text-sm text-white truncate`,children:e.name}),(0,B.jsx)(`span`,{className:`text-xs text-[var(--oh-muted)] truncate`,children:e.path})]}),o&&(0,B.jsxs)(`button`,{type:`button`,onClick:()=>l({type:`parent`,path:e.path,text:s(f.HOME$REMOVE_WORKSPACE_PARENT_CONFIRMATION,{name:e.name,count:t.length})}),"aria-label":s(f.HOME$REMOVE_WORKSPACE_PARENT),"data-testid":`manage-workspaces-remove-parent-${e.name}`,className:`flex items-center gap-1 px-2 py-1 rounded text-xs text-[var(--oh-text-tertiary)] hover:bg-[var(--oh-interactive-hover)] hover:text-white cursor-pointer`,children:[(0,B.jsx)(A,{width:12,height:12}),(0,B.jsx)(`span`,{children:s(f.HOME$REMOVE_WORKSPACE_PARENT)})]})]}),t.length>0&&(0,B.jsx)(`ul`,{className:`pb-2`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`flex items-center gap-3 px-5 pl-10 py-1 text-xs text-[var(--oh-text-secondary)]`,"data-testid":`manage-workspaces-child-${e.name}`,children:[(0,B.jsx)(k,{width:12,height:12,className:`shrink-0 opacity-70`}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id))})]},e.id)})})]})]}),(0,B.jsx)(`div`,{className:`flex justify-end gap-2 px-5 py-3 border-t border-[var(--oh-border-input)]`,children:(0,B.jsx)(T,{type:`button`,variant:`primary`,onClick:r,testId:`manage-workspaces-done`,children:s(f.HOME$DONE)})})]})}),c&&(0,B.jsx)(D,{text:c.text,onConfirm:()=>{c&&(c.type===`workspace`?i(c.path):o?.(c.path),l(null))},onCancel:()=>l(null)})]})}var se=`previewOnboardingStep`,ce=3;function Q(e=typeof window<`u`?window.location.search:``){let t=new URLSearchParams(e).get(se);if(t==null)return null;let n=Number.parseInt(t,10);return!Number.isFinite(n)||n<0||n>ce?null:n}function $(e=typeof window<`u`?window.location.search:``){return Q(e)!=null}function le(e){let t=e?.agent_settings?.llm,n=typeof t?.model==`string`&&t.model.trim().length>0,r=e?.llm_api_key_set===!0||O(t);return n&&r}function ue(){let e=r(),t=Q(e.search),n=$(e.search),{isCompleted:i,markCompleted:a}=v(),{backend:o}=d(),s=y(),c=o.kind===`cloud`||o.id!==`default-local`;return!n&&(i||c&&s.isLoading||c&&le(s.data))?null:(0,B.jsx)(ee,{onClose:()=>{n||a()},initialStep:t??0,isPreview:n})}export{U as a,ae as c,ne as d,F as f,oe as i,H as l,$ as n,V as o,te as p,Z as r,ie as s,ue as t,re as u};