@openhands/agent-canvas 1.0.0-rc.1 → 1.0.0-rc.3

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 (460) hide show
  1. package/README.md +2 -2
  2. package/README.windows.md +2 -2
  3. package/build/assets/{QueryClientProvider-w1cZWY41.js → QueryClientProvider-7oLZ1RtQ.js} +1 -1
  4. package/build/assets/{Trans-BJeYqz2A.js → Trans-rF21Jwln.js} +1 -1
  5. package/build/assets/acp-providers-C55k29rf.js +1 -0
  6. package/build/assets/active-backend-context-CQTk4wD8.js +1 -0
  7. package/build/assets/add-backend-modal-BdYxoUdL.js +1 -0
  8. package/build/assets/agent-server-client-options-Dvgeb3x4.js +1 -0
  9. package/build/assets/agent-server-compatibility-BANjmMTo.js +1 -0
  10. package/build/assets/agent-server-conversation-service.api-js3oYcdU.js +5 -0
  11. package/build/assets/{agent-settings-BXBaybB_.js → agent-settings-BNrffu3I.js} +1 -1
  12. package/build/assets/{alert-banner-NeUl1-PQ.js → alert-banner-BzU93oDh.js} +1 -1
  13. package/build/assets/{analytics-consent-form-modal-DxkThW4K.js → analytics-consent-form-modal-Ce-_Skcd.js} +1 -1
  14. package/build/assets/api-key-entry-screen-CGyS-Cna.js +1 -0
  15. package/build/assets/{app-settings-C-U6jONZ.js → app-settings-DmOs4oik.js} +1 -1
  16. package/build/assets/automation-detail-DLbCVJCw.js +1 -0
  17. package/build/assets/{automations-list-BLJzAd-p.js → automations-list-Ces5shz5.js} +1 -1
  18. package/build/assets/{back-nav-button-DgkK0Ka6.js → back-nav-button-BDM9vr_o.js} +1 -1
  19. package/build/assets/backend-form-modal-BUy-PzZN.js +1 -0
  20. package/build/assets/{backend-synced-settings-badge-BktJcGgH.js → backend-synced-settings-badge-1A63yxGs.js} +1 -1
  21. package/build/assets/{base-modal-DZCNv0A4.js → base-modal-Ba5WcNb6.js} +1 -1
  22. package/build/assets/{brand-button-LBFNic99.js → brand-button-BoiPxAGm.js} +1 -1
  23. package/build/assets/browser-B8bp1IqT.js +5 -0
  24. package/build/assets/browser-store-C5uQbbIi.js +1 -0
  25. package/build/assets/{browser-tab-be3QvXg9.js → browser-tab-CiBRWB4X.js} +1 -1
  26. package/build/assets/chat-send-button-qKFZuB9E.js +1 -0
  27. package/build/assets/check-BDAbW7je.js +1 -0
  28. package/build/assets/{checkmark-Rmpruj7q.js → checkmark-SEZPnU2I.js} +1 -1
  29. package/build/assets/{chevron-down-KhWYEjeW.js → chevron-down-DUxWwzTm.js} +1 -1
  30. package/build/assets/{chevron-left-small-6nyFCWVQ.js → chevron-left-small-x9_-ucHG.js} +1 -1
  31. package/build/assets/{circle-plus-check-toggle-DquBwJ_6.js → circle-plus-check-toggle-CboDp7XB.js} +1 -1
  32. package/build/assets/{close-D_o3d8QM.js → close-CbOsKMRg.js} +1 -1
  33. package/build/assets/{code-tag-DhsjDB-v.js → code-tag-C0vR_IQH.js} +1 -1
  34. package/build/assets/{color-themes-0biOprdo.js → color-themes-B9n7pBQl.js} +1 -1
  35. package/build/assets/{combobox-caret-CO7eozIY.js → combobox-caret-DwMmhrrA.js} +1 -1
  36. package/build/assets/{command-store-UzKGSUC2.js → command-store-BUWgE-vZ.js} +1 -1
  37. package/build/assets/{condenser-settings-BulzYEuW.js → condenser-settings-FCBjvqSo.js} +1 -1
  38. package/build/assets/{confirmation-modal-CMAtd9R0.js → confirmation-modal-BPgWqWRI.js} +1 -1
  39. package/build/assets/{context-menu-list-item-D0swnhFt.js → context-menu-list-item-CHWCx1Mc.js} +1 -1
  40. package/build/assets/conversation-CT8AvxEH.js +1 -0
  41. package/build/assets/conversation-panel-DqDDs4WZ.js +1 -0
  42. package/build/assets/conversation-service.api-y_eB_43m.js +1 -0
  43. package/build/assets/conversation-state-store-DpgQaK_O.js +1 -0
  44. package/build/assets/conversation-store-CiYGBud3.js +6 -0
  45. package/build/assets/{conversation-tab-empty-state-DYjKsg_c.js → conversation-tab-empty-state-Ba5hbJhn.js} +1 -1
  46. package/build/assets/conversation-vNuLKgz6.js +19 -0
  47. package/build/assets/conversation-websocket-context-Bb4XBXoc.js +3 -0
  48. package/build/assets/{copy-BM0RpLez.js → copy-CAxUvM-U.js} +1 -1
  49. package/build/assets/{custom-toast-handlers-BohXx7uh.js → custom-toast-handlers-fgD4IYsu.js} +1 -1
  50. package/build/assets/{declaration-DaUdB2Wg.js → declaration-IA661TBv.js} +1 -1
  51. package/build/assets/{device-verify-DiEJqpJb.js → device-verify-BOQz2LJQ.js} +1 -1
  52. package/build/assets/{dist-xtCm0O6P.js → dist-B-SKiGDl.js} +1 -1
  53. package/build/assets/dist-CeJSjcAI.js +1 -0
  54. package/build/assets/{dropdown-classes-Vqz86I0R.js → dropdown-classes-lT1LUsbO.js} +1 -1
  55. package/build/assets/edit-automation-modal-C-oC5tis.js +1 -0
  56. package/build/assets/ellipsis-button-CiLx8dqc.js +1 -0
  57. package/build/assets/{entry.client-BvKgdCQ9.js → entry.client-Db3BpFL_.js} +2 -2
  58. package/build/assets/{enum-filter-dropdown-DdFgk0EM.js → enum-filter-dropdown-DFwoVtOw.js} +1 -1
  59. package/build/assets/{environment-switch-overlay-CuBuZOaa.js → environment-switch-overlay-Cow6h62p.js} +1 -1
  60. package/build/assets/{extensions-hub-Dayqvv0n.js → extensions-hub-BxZbAtjP.js} +1 -1
  61. package/build/assets/extensions-navigation-BIb-vAa2.js +1 -0
  62. package/build/assets/{file-DwHCkWZT.js → file-BJCSojij.js} +1 -1
  63. package/build/assets/files-tab-DpulQlIo.js +1 -0
  64. package/build/assets/files-tab-store-CZAEwv3x.js +1 -0
  65. package/build/assets/{folder-2h1hR1Qb.js → folder-wShAU0y7.js} +1 -1
  66. package/build/assets/git-control-bar-branch-button-D1uam-nI.js +27 -0
  67. package/build/assets/{globe-qFjFNG6J.js → globe-CQ_5xwpo.js} +1 -1
  68. package/build/assets/home-sJAFzI6v.js +1 -0
  69. package/build/assets/{i18n-zDndR1Ne.js → i18n-CyvU1o95.js} +1 -1
  70. package/build/assets/install-server-modal-BjEzlLF5.js +1 -0
  71. package/build/assets/{launch-I00QV8YT.js → launch-DgtB1JTX.js} +1 -1
  72. package/build/assets/{lesson-plan-C18uB_56.js → lesson-plan-B607buca.js} +1 -1
  73. package/build/assets/{link-external-DtcdPFbw.js → link-external-DCsHkAj4.js} +1 -1
  74. package/build/assets/llm-client-BnqeDPua.js +1 -0
  75. package/build/assets/llm-settings-B8kPJ0Of.js +1 -0
  76. package/build/assets/llm-settings-CjUpPsvA.js +1 -0
  77. package/build/assets/{loading-spinner-DNwR4--Z.js → loading-spinner-CFuA0UNt.js} +1 -1
  78. package/build/assets/manage-backends-modal-CTA-2x4F.js +1 -0
  79. package/build/assets/manifest-d3e8504d.js +1 -0
  80. package/build/assets/{markdown-renderer-D6B-u2nM.js → markdown-renderer-oOUs3tw5.js} +1 -1
  81. package/build/assets/mcp-client-xEdbDxOL.js +1 -0
  82. package/build/assets/mcp-kJYdM8aJ.js +9 -0
  83. package/build/assets/messages-BFJXB6MW.js +36 -0
  84. package/build/assets/{modal-backdrop-BDqI1zBV.js → modal-backdrop-B1si6TUd.js} +1 -1
  85. package/build/assets/{modal-body-CCLCqX1J.js → modal-body-2Po2nl1e.js} +1 -1
  86. package/build/assets/{modal-classes-DwTdT3IK.js → modal-classes-9XTtWCtF.js} +1 -1
  87. package/build/assets/{modal-close-button-gQgKqUf-.js → modal-close-button-DY-rVmld.js} +1 -1
  88. package/build/assets/model-selector-z_QOzaRV.js +1 -0
  89. package/build/assets/{navigation-context-aNGUUtdq.js → navigation-context-CszaA-CJ.js} +1 -1
  90. package/build/assets/{navigation-link-CYkF2y3K.js → navigation-link-DXg4oo29.js} +1 -1
  91. package/build/assets/onboarding-CZ_7nd-M.js +1 -0
  92. package/build/assets/{openhands-logo-CHmtDV-t.js → openhands-logo-B-IDE1ER.js} +1 -1
  93. package/build/assets/{option-service.api-CGNANEcT.js → option-service.api-DHOGfYKh.js} +1 -1
  94. package/build/assets/organization-service.api-D79cdERN.js +1 -0
  95. package/build/assets/path-utils-0KWEiRs9.js +1 -0
  96. package/build/assets/{pencil-Dr0b2jL1.js → pencil-COslZGUC.js} +1 -1
  97. package/build/assets/{plan-components--aLlpASH.js → plan-components-DsiDjcDi.js} +1 -1
  98. package/build/assets/{planner-tab-B-5EeCEm.js → planner-tab-CNmJiZ22.js} +1 -1
  99. package/build/assets/plus-D8aJZRkD.js +1 -0
  100. package/build/assets/profiles-client-CesbAK-7.js +1 -0
  101. package/build/assets/{providers-DknP6O2g.js → providers-Bpq3xFRA.js} +1 -1
  102. package/build/assets/proxy-wIasY2Po.js +1 -0
  103. package/build/assets/{query-client-config-CWWGQWvw.js → query-client-config-CITeuHD7.js} +1 -1
  104. package/build/assets/{recommended-automations-launcher-BIul0osB.js → recommended-automations-launcher-B1kfmFTQ.js} +8 -10
  105. package/build/assets/root-CIZ7Rv1X.js +2 -0
  106. package/build/assets/root-layout-B5ijp9At.js +2 -0
  107. package/build/assets/{sdk-section-page-VmtJWH3A.js → sdk-section-page-DTyvCc52.js} +1 -1
  108. package/build/assets/{sdk-settings-schema-DFievvEK.js → sdk-settings-schema-B0KrqqPX.js} +1 -1
  109. package/build/assets/{search-BeVRXvX7.js → search-BqXT2Ied.js} +1 -1
  110. package/build/assets/secrets-service-rJqZtDmI.js +1 -0
  111. package/build/assets/{secrets-settings-BLMvCkKm.js → secrets-settings-BQNSDLKS.js} +1 -1
  112. package/build/assets/server-client-Cz8PyIbN.js +1 -0
  113. package/build/assets/settings-BUlJrO_h.js +1 -0
  114. package/build/assets/settings-client-BUlG0Gzq.js +1 -0
  115. package/build/assets/{settings-dropdown-input-DA_pzHWE.js → settings-dropdown-input-BUk4m23x.js} +1 -1
  116. package/build/assets/{settings-gear-aNebYlCy.js → settings-gear-DFmoMp-6.js} +1 -1
  117. package/build/assets/{settings-index-CycvkOoq.js → settings-index-DE91Eahc.js} +1 -1
  118. package/build/assets/{settings-input-8y5p4kze.js → settings-input-DsoZj8Dm.js} +1 -1
  119. package/build/assets/{settings-list-classes-Qk7zl0Wu.js → settings-list-classes-D8VAVZmi.js} +1 -1
  120. package/build/assets/{settings-modal-DdntdOGP.js → settings-modal-CCaPYVqW.js} +1 -1
  121. package/build/assets/{settings-section-header-context-B77tsYlx.js → settings-section-header-context-D61smD-W.js} +1 -1
  122. package/build/assets/settings-service.api-4u2RKC8k.js +1 -0
  123. package/build/assets/{settings-switch-ba4DuiNO.js → settings-switch-BQiAS9ga.js} +1 -1
  124. package/build/assets/{settings-utils-BxzHqLmZ.js → settings-utils-chxTa1vn.js} +1 -1
  125. package/build/assets/shared-conversation-sBPLAawM.js +1 -0
  126. package/build/assets/{sidebar-mobile-menu-toggle-C0mmabKj.js → sidebar-mobile-menu-toggle-BDXWzhyB.js} +1 -1
  127. package/build/assets/{sidebar-nav-link-BsYdDFfb.js → sidebar-nav-link-Bhlzlhp8.js} +1 -1
  128. package/build/assets/{skill-card-pill-row-BhUlGcYB.js → skill-card-pill-row-Bg5joQf6.js} +1 -1
  129. package/build/assets/{skills-TYjOUQ2d.js → skills-BDOWVle-.js} +1 -1
  130. package/build/assets/skills-client-Cr9F5306.js +1 -0
  131. package/build/assets/{skills-plugins-D0pdqgKa.js → skills-plugins-fihjo1KZ.js} +1 -1
  132. package/build/assets/{skills-settings-VqKTkmVl.js → skills-settings-NQnuMwZP.js} +1 -1
  133. package/build/assets/{styled-tooltip-TCp7svY3.js → styled-tooltip-GXy1qxsO.js} +1 -1
  134. package/build/assets/suspense-C9MBE_9N.js +1 -0
  135. package/build/assets/{switch-skeleton-cKrdaYGj.js → switch-skeleton-QpdcdxRP.js} +1 -1
  136. package/build/assets/{task-list-tab-BiizRsY3.js → task-list-tab-Hl9BuVfq.js} +1 -1
  137. package/build/assets/telemetry-j9SLrtY7.js +2 -0
  138. package/build/assets/{terminal-BSYITdM0.js → terminal-BUww3Ssl.js} +1 -1
  139. package/build/assets/{terminal-CpgZx6go.js → terminal-DRwe8--D.js} +1 -1
  140. package/build/assets/{toggle-switch-CUgOZqZu.js → toggle-switch-DDr-DnEc.js} +1 -1
  141. package/build/assets/{trash-2-CbVljPko.js → trash-2-DAKXV2Wm.js} +1 -1
  142. package/build/assets/{typography-Bvw0IxaN.js → typography-Cx7uw7z3.js} +1 -1
  143. package/build/assets/{u-check-circle-u9QiS4Fr.js → u-check-circle-CftRwky1.js} +1 -1
  144. package/build/assets/{u-check-circle-half-DjpjzWu3.js → u-check-circle-half-sGVk0BtL.js} +1 -1
  145. package/build/assets/{u-circuit-DlBlOwx9.js → u-circuit-Cg9tH5qb.js} +1 -1
  146. package/build/assets/{u-edit-BIYzjs3v.js → u-edit-foF02hwH.js} +1 -1
  147. package/build/assets/{use-active-conversation-q1wT8LI5.js → use-active-conversation-DJGoI9Mc.js} +1 -1
  148. package/build/assets/use-agent-settings-schema-DtusObuC.js +1 -0
  149. package/build/assets/{use-agent-state-CCHlVqvY.js → use-agent-state-BXgWhFh6.js} +1 -1
  150. package/build/assets/{use-cloud-current-user-id-BAKf91Zx.js → use-cloud-current-user-id-e1Pk7NxQ.js} +1 -1
  151. package/build/assets/use-config-DSzkljTq.js +1 -0
  152. package/build/assets/use-create-conversation-CzvaVA5A.js +1 -0
  153. package/build/assets/use-event-store-DSpvASbC.js +1 -0
  154. package/build/assets/use-get-secrets-DiLgP147.js +1 -0
  155. package/build/assets/use-handle-plan-click-CUZwmKIk.js +1 -0
  156. package/build/assets/use-is-authed-fNsj-Adj.js +1 -0
  157. package/build/assets/{use-launch-skill-in-chat-3ydwpi_M.js → use-launch-skill-in-chat-ClRJlIx7.js} +1 -1
  158. package/build/assets/use-llm-profiles-CyNVoVqm.js +1 -0
  159. package/build/assets/use-runtime-is-ready-CWkGQFsb.js +1 -0
  160. package/build/assets/{use-save-settings-rE9aA29R.js → use-save-settings-CP23emUY.js} +1 -1
  161. package/build/assets/use-settings-0qFqC-r6.js +1 -0
  162. package/build/assets/{use-settings-nav-items-C7MOWj09.js → use-settings-nav-items-C6YxUn4h.js} +1 -1
  163. package/build/assets/use-skills-BWHATXK-.js +1 -0
  164. package/build/assets/{use-task-list-YMkSzdDv.js → use-task-list-JPudBRv3.js} +1 -1
  165. package/build/assets/{use-tracking-DQYdZpxi.js → use-tracking-CjLZgh8X.js} +1 -1
  166. package/build/assets/use-unified-vscode-url-DSn2tT08.js +1 -0
  167. package/build/assets/use-user-conversation-CQ5IwnZk.js +1 -0
  168. package/build/assets/{useMutation-DDo48A8t.js → useMutation-7hG0GuPx.js} +1 -1
  169. package/build/assets/useQuery-JDs8UaWj.js +1 -0
  170. package/build/assets/{useTranslation-CEcjrme-.js → useTranslation-CbJtty1g.js} +1 -1
  171. package/build/assets/{utils-CdgBzLA7.js → utils-CVcuFUYj.js} +1 -1
  172. package/build/assets/{vendor~browser-DWk6fNtJ.js → vendor~browser-Dwwc84Zf.js} +1 -1
  173. package/build/assets/{vendor~browser-tab-NZdVoI2Z.js → vendor~browser-tab-Bhohe29F.js} +1 -1
  174. package/build/assets/{vendor~conversation-panel~conversation-gp03cWZW.js → vendor~conversation-panel~conversation-DYHL7QoY.js} +1 -1
  175. package/build/assets/{vendor~conversation-panel~conversation~index-BZ5C6Xpz.js → vendor~conversation-panel~conversation~index-Be58Romv.js} +1 -1
  176. package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-BodGsxSf.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js} +1 -1
  177. package/build/assets/{vendor~files-tab-Buz36Y-q.js → vendor~files-tab-B447_Zns.js} +1 -1
  178. package/build/assets/{vendor~home~conversation-panel~conversation-DG0H5SkJ.js → vendor~home~conversation-panel~conversation-DZ-F7J6T.js} +1 -1
  179. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CXivI4Ym.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B4oeCCli.js} +1 -1
  180. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-9Il_wz8U.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-CQQAW8hY.js} +1 -1
  181. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-1pTajrpX.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DFsI4CLy.js} +1 -1
  182. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Ceeqkj0k.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-DcvlNgbn.js} +1 -1
  183. package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-B7I1ZxCx.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-ojk_J4bB.js} +1 -1
  184. package/build/assets/{vendor~launch-DXL78kBf.js → vendor~launch-BdXJCmwc.js} +1 -1
  185. package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-CfAc3nMS.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js} +1 -1
  186. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation-DkwcKRtv.js → vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js} +1 -1
  187. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-DSqEbr0N.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Dr8Ly0at.js} +1 -1
  188. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-BC9XTECT.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-DveauQfg.js} +1 -1
  189. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-D0XUSHNN.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js} +2 -2
  190. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~settings~settings-index~agen~jxrvuot9-BaCzvZac.js +48 -0
  191. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-CcFtthyg.js → vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js} +1 -1
  192. package/build/assets/{vendor~root-layout~home~mcp~automations-list-cNHi83v_.js → vendor~root-layout~home~mcp~automations-list-CtdIEhjQ.js} +1 -1
  193. package/build/assets/{vendor~root-layout~home~mcp~automations-list-BnIlGhjl.js → vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js} +1 -1
  194. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BGWUbqUq.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-CbuXadI-.js} +1 -1
  195. package/build/assets/{vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-BuCSnjsW.js → vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js} +2 -2
  196. package/build/assets/{verification-settings-CIqtxWat.js → verification-settings-Cm02KmeI.js} +1 -1
  197. package/build/assets/{vscode-tab-DEt72yJX.js → vscode-tab-AF70Yke0.js} +1 -1
  198. package/build/assets/{waiting-for-runtime-message-DSjJfeoj.js → waiting-for-runtime-message-Bg27u9JB.js} +1 -1
  199. package/build/assets/x-8AbJWTbX.js +1 -0
  200. package/build/assets/{x-mark-DsJ9tDD0.js → x-mark-Cn-YJVbN.js} +1 -1
  201. package/build/index.html +4 -4
  202. package/build/locales/ar/openhands.json +2 -1
  203. package/build/locales/ca/openhands.json +2 -1
  204. package/build/locales/de/openhands.json +2 -1
  205. package/build/locales/en/openhands.json +2 -1
  206. package/build/locales/es/openhands.json +2 -1
  207. package/build/locales/fr/openhands.json +2 -1
  208. package/build/locales/it/openhands.json +2 -1
  209. package/build/locales/ja/openhands.json +2 -1
  210. package/build/locales/ko-KR/openhands.json +2 -1
  211. package/build/locales/no/openhands.json +2 -1
  212. package/build/locales/pt/openhands.json +2 -1
  213. package/build/locales/tr/openhands.json +2 -1
  214. package/build/locales/uk/openhands.json +2 -1
  215. package/build/locales/zh-CN/openhands.json +2 -1
  216. package/build/locales/zh-TW/openhands.json +2 -1
  217. package/config/defaults.json +1 -1
  218. package/dist/api/agent-server-adapter.cjs +3 -3
  219. package/dist/api/agent-server-adapter.cjs.map +1 -1
  220. package/dist/api/agent-server-adapter.js +94 -86
  221. package/dist/api/agent-server-adapter.js.map +1 -1
  222. package/dist/api/app-preferences-store.cjs.map +1 -1
  223. package/dist/api/app-preferences-store.d.ts +6 -2
  224. package/dist/api/app-preferences-store.js.map +1 -1
  225. package/dist/api/cloud/proxy.cjs +1 -1
  226. package/dist/api/cloud/proxy.cjs.map +1 -1
  227. package/dist/api/cloud/proxy.d.ts +18 -6
  228. package/dist/api/cloud/proxy.js +1 -1
  229. package/dist/api/cloud/proxy.js.map +1 -1
  230. package/dist/api/conversation-metadata-store.cjs.map +1 -1
  231. package/dist/api/conversation-metadata-store.d.ts +8 -0
  232. package/dist/api/conversation-metadata-store.js.map +1 -1
  233. package/dist/api/conversation-service/agent-server-conversation-service.types.d.ts +9 -0
  234. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +1 -1
  235. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
  236. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +9 -9
  237. package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
  238. package/dist/components/conversation-events/chat/event-message.cjs +1 -1
  239. package/dist/components/conversation-events/chat/event-message.cjs.map +1 -1
  240. package/dist/components/conversation-events/chat/event-message.js +80 -71
  241. package/dist/components/conversation-events/chat/event-message.js.map +1 -1
  242. package/dist/components/features/automations/recommended-automations-launcher.d.ts +7 -1
  243. package/dist/components/features/chat/switch-profile-button.cjs +1 -1
  244. package/dist/components/features/chat/switch-profile-button.cjs.map +1 -1
  245. package/dist/components/features/chat/switch-profile-button.js +5 -5
  246. package/dist/components/features/chat/switch-profile-button.js.map +1 -1
  247. package/dist/components/features/conversation-panel/skills-modal.cjs +1 -1
  248. package/dist/components/features/conversation-panel/skills-modal.cjs.map +1 -1
  249. package/dist/components/features/conversation-panel/skills-modal.js +34 -37
  250. package/dist/components/features/conversation-panel/skills-modal.js.map +1 -1
  251. package/dist/components/features/home/workspace-selection-form.d.ts +1 -0
  252. package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +8 -0
  253. package/dist/components/features/settings/llm-profiles/profile-actions-menu.cjs +1 -1
  254. package/dist/components/features/settings/llm-profiles/profile-actions-menu.js +1 -0
  255. package/dist/components/features/sidebar/sidebar.cjs +1 -1
  256. package/dist/components/features/sidebar/sidebar.js +6 -6
  257. package/dist/components/features/skills/extensions-navigation.cjs +1 -1
  258. package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
  259. package/dist/components/features/skills/extensions-navigation.d.ts +1 -9
  260. package/dist/components/features/skills/extensions-navigation.js +31 -50
  261. package/dist/components/features/skills/extensions-navigation.js.map +1 -1
  262. package/dist/constants/acp-providers.cjs +1 -1
  263. package/dist/constants/acp-providers.js +1 -1
  264. package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
  265. package/dist/hooks/mutation/use-create-conversation.cjs.map +1 -1
  266. package/dist/hooks/mutation/use-create-conversation.js +26 -14
  267. package/dist/hooks/mutation/use-create-conversation.js.map +1 -1
  268. package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs +1 -1
  269. package/dist/hooks/mutation/use-switch-llm-profile-and-log.cjs.map +1 -1
  270. package/dist/hooks/mutation/use-switch-llm-profile-and-log.js +26 -15
  271. package/dist/hooks/mutation/use-switch-llm-profile-and-log.js.map +1 -1
  272. package/dist/i18n/declaration.cjs +1 -1
  273. package/dist/i18n/declaration.cjs.map +1 -1
  274. package/dist/i18n/declaration.d.ts +1 -0
  275. package/dist/i18n/declaration.js +1 -1
  276. package/dist/i18n/declaration.js.map +1 -1
  277. package/dist/i18n/translation.cjs +1 -1
  278. package/dist/i18n/translation.cjs.map +1 -1
  279. package/dist/i18n/translation.js +32 -15
  280. package/dist/i18n/translation.js.map +1 -1
  281. package/dist/index.cjs +1 -1
  282. package/dist/index.js +10 -10
  283. package/dist/lib/index.cjs +1 -1
  284. package/dist/lib/index.js +1 -1
  285. package/dist/locales/ar/openhands.json +2 -1
  286. package/dist/locales/ca/openhands.json +2 -1
  287. package/dist/locales/de/openhands.json +2 -1
  288. package/dist/locales/en/openhands.json +2 -1
  289. package/dist/locales/es/openhands.json +2 -1
  290. package/dist/locales/fr/openhands.json +2 -1
  291. package/dist/locales/it/openhands.json +2 -1
  292. package/dist/locales/ja/openhands.json +2 -1
  293. package/dist/locales/ko-KR/openhands.json +2 -1
  294. package/dist/locales/no/openhands.json +2 -1
  295. package/dist/locales/pt/openhands.json +2 -1
  296. package/dist/locales/tr/openhands.json +2 -1
  297. package/dist/locales/uk/openhands.json +2 -1
  298. package/dist/locales/zh-CN/openhands.json +2 -1
  299. package/dist/locales/zh-TW/openhands.json +2 -1
  300. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs +1 -1
  301. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.cjs.map +1 -1
  302. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js +10 -1
  303. package/dist/node_modules/@openhands/typescript-client/dist/models/acp.js.map +1 -1
  304. package/dist/package.cjs +1 -1
  305. package/dist/package.cjs.map +1 -1
  306. package/dist/package.js +2 -2
  307. package/dist/package.js.map +1 -1
  308. package/dist/routes/llm-settings.cjs +1 -1
  309. package/dist/routes/llm-settings.cjs.map +1 -1
  310. package/dist/routes/llm-settings.js +21 -21
  311. package/dist/routes/llm-settings.js.map +1 -1
  312. package/dist/routes/mcp.cjs +1 -1
  313. package/dist/routes/mcp.cjs.map +1 -1
  314. package/dist/routes/mcp.d.ts +0 -1
  315. package/dist/routes/mcp.js +0 -1
  316. package/dist/routes/mcp.js.map +1 -1
  317. package/dist/types/agent-server/core/events/index.d.ts +1 -0
  318. package/dist/types/agent-server/core/events/streaming-delta-event.d.ts +7 -0
  319. package/dist/types/agent-server/core/openhands-event.d.ts +2 -2
  320. package/dist/types/agent-server/type-guards.cjs +1 -1
  321. package/dist/types/agent-server/type-guards.cjs.map +1 -1
  322. package/dist/types/agent-server/type-guards.d.ts +2 -0
  323. package/dist/types/agent-server/type-guards.js +3 -3
  324. package/dist/types/agent-server/type-guards.js.map +1 -1
  325. package/dist/utils/handle-event-for-ui.cjs +1 -1
  326. package/dist/utils/handle-event-for-ui.cjs.map +1 -1
  327. package/dist/utils/handle-event-for-ui.js +69 -13
  328. package/dist/utils/handle-event-for-ui.js.map +1 -1
  329. package/dist/utils/mcp-config.cjs +1 -1
  330. package/dist/utils/mcp-config.cjs.map +1 -1
  331. package/dist/utils/mcp-config.js +27 -19
  332. package/dist/utils/mcp-config.js.map +1 -1
  333. package/dist/utils/mcp-marketplace-utils.cjs +1 -1
  334. package/dist/utils/mcp-marketplace-utils.cjs.map +1 -1
  335. package/dist/utils/mcp-marketplace-utils.js +38 -18
  336. package/dist/utils/mcp-marketplace-utils.js.map +1 -1
  337. package/dist/utils/normalize-display-model.cjs +1 -1
  338. package/dist/utils/normalize-display-model.cjs.map +1 -1
  339. package/dist/utils/normalize-display-model.js +8 -7
  340. package/dist/utils/normalize-display-model.js.map +1 -1
  341. package/dist/utils/openhands-llm.cjs +1 -1
  342. package/dist/utils/openhands-llm.cjs.map +1 -1
  343. package/dist/utils/openhands-llm.d.ts +13 -0
  344. package/dist/utils/openhands-llm.js +9 -3
  345. package/dist/utils/openhands-llm.js.map +1 -1
  346. package/package.json +2 -2
  347. package/scripts/check-sdk-version-sync.mjs +6 -6
  348. package/scripts/dev-safe.mjs +71 -120
  349. package/scripts/dev-with-automation.mjs +58 -4
  350. package/scripts/runtime-services-info.mjs +199 -0
  351. package/scripts/static-server.mjs +42 -4
  352. package/build/assets/acp-providers-DJr8DlNG.js +0 -1
  353. package/build/assets/acp-route-guard-A__sWgbc.js +0 -1
  354. package/build/assets/active-backend-context-I2w666XY.js +0 -1
  355. package/build/assets/add-backend-modal-BDBDBXsJ.js +0 -1
  356. package/build/assets/agent-server-client-options-9agOSarV.js +0 -1
  357. package/build/assets/agent-server-compatibility-B7QStIcH.js +0 -1
  358. package/build/assets/agent-server-conversation-service.api-Cagoqq1V.js +0 -5
  359. package/build/assets/api-key-entry-screen-ByXA4hXH.js +0 -1
  360. package/build/assets/automation-detail-Dbmgt974.js +0 -1
  361. package/build/assets/backend-form-modal-CeB983Sj.js +0 -1
  362. package/build/assets/browser-D08Sp3ZY.js +0 -5
  363. package/build/assets/browser-store-JRrcGdlk.js +0 -1
  364. package/build/assets/chat-send-button-5qz0zj6R.js +0 -1
  365. package/build/assets/check-CZhEL6rP.js +0 -1
  366. package/build/assets/conversation-BrjF2-Ky.js +0 -1
  367. package/build/assets/conversation-HgR_TTPE.js +0 -19
  368. package/build/assets/conversation-panel-BlRcO5AC.js +0 -1
  369. package/build/assets/conversation-service.api-B_Pdmwsa.js +0 -1
  370. package/build/assets/conversation-state-store-D-w0uurj.js +0 -1
  371. package/build/assets/conversation-store-CC-isCnP.js +0 -1
  372. package/build/assets/conversation-websocket-context-G95yfL81.js +0 -3
  373. package/build/assets/dist-Bl-1K5Tv.js +0 -1
  374. package/build/assets/edit-automation-modal-CNZgSSiH.js +0 -1
  375. package/build/assets/extensions-navigation-yFLAU06N.js +0 -1
  376. package/build/assets/files-tab-CMredyYX.js +0 -1
  377. package/build/assets/files-tab-store-DLU28g8C.js +0 -1
  378. package/build/assets/git-control-bar-branch-button-D8blTNXh.js +0 -27
  379. package/build/assets/home-CWw845Rz.js +0 -1
  380. package/build/assets/install-server-modal-D8Q0xZcN.js +0 -1
  381. package/build/assets/llm-client-BqyLKgUN.js +0 -1
  382. package/build/assets/llm-settings-CAnFYAEG.js +0 -1
  383. package/build/assets/llm-settings-DotqpmCF.js +0 -1
  384. package/build/assets/manage-backends-modal-Ceo_SOcf.js +0 -1
  385. package/build/assets/manifest-61ec2d68.js +0 -1
  386. package/build/assets/mcp-EvrLVTla.js +0 -9
  387. package/build/assets/messages-Bz9TWjlh.js +0 -36
  388. package/build/assets/middleware-CfatjPYZ.js +0 -6
  389. package/build/assets/model-selector-CZOi4V7r.js +0 -1
  390. package/build/assets/onboarding-CPCKYvFh.js +0 -1
  391. package/build/assets/organization-service.api-Dn74hBTH.js +0 -1
  392. package/build/assets/path-utils-BjxzIGLp.js +0 -1
  393. package/build/assets/plus-DT-M0FA1.js +0 -1
  394. package/build/assets/profiles-client-BrqNmaDV.js +0 -1
  395. package/build/assets/proxy-sRh0WKI7.js +0 -1
  396. package/build/assets/root-CklXEh3W.js +0 -2
  397. package/build/assets/root-layout-BCA_X8XL.js +0 -2
  398. package/build/assets/secrets-service-DVtlLWY8.js +0 -1
  399. package/build/assets/server-client-DYv_GHPl.js +0 -1
  400. package/build/assets/settings-CXvJUx_j.js +0 -1
  401. package/build/assets/settings-service.api-DxIEtvx6.js +0 -1
  402. package/build/assets/shared-conversation-x41nZQi7.js +0 -1
  403. package/build/assets/sidebar-store-DnQAJAE5.js +0 -1
  404. package/build/assets/telemetry-fQFd-8V3.js +0 -2
  405. package/build/assets/use-agent-settings-schema-Yxf7KGyG.js +0 -1
  406. package/build/assets/use-config-DwfigQ_Y.js +0 -1
  407. package/build/assets/use-create-conversation-BEzddjXn.js +0 -1
  408. package/build/assets/use-event-store-Cxqc45Sw.js +0 -1
  409. package/build/assets/use-get-secrets-BlO1BfUo.js +0 -1
  410. package/build/assets/use-handle-plan-click-Bfl0zIBr.js +0 -1
  411. package/build/assets/use-is-authed-hHndEep7.js +0 -1
  412. package/build/assets/use-llm-profiles-E-jjZMZw.js +0 -1
  413. package/build/assets/use-runtime-is-ready-DBWzvAmc.js +0 -1
  414. package/build/assets/use-settings-BPTbE7lg.js +0 -1
  415. package/build/assets/use-skills-QhoaIYGF.js +0 -1
  416. package/build/assets/use-unified-vscode-url-DFtNIC1Q.js +0 -1
  417. package/build/assets/use-user-conversation-BRAseenw.js +0 -1
  418. package/build/assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js +0 -48
  419. package/build/assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~jaomi49z-Cw89stA6.js +0 -1
  420. package/build/assets/x-JOBEVLW0.js +0 -1
  421. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs +0 -2
  422. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.cjs.map +0 -1
  423. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.d.ts +0 -1
  424. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js +0 -21
  425. package/dist/components/features/conversation-panel/skills-runtime-waiting-state.js.map +0 -1
  426. package/dist/utils/acp-route-guard.cjs +0 -1
  427. package/dist/utils/acp-route-guard.d.ts +0 -26
  428. package/dist/utils/acp-route-guard.js +0 -4
  429. /package/build/assets/{agent-server-ui-style-scope-BwIZYdC1.js → agent-server-ui-style-scope-Bhc5vpWO.js} +0 -0
  430. /package/build/assets/{automation-DJ_3GeXD.js → automation-BzmydDjr.js} +0 -0
  431. /package/build/assets/{common-DqjLSBOt.js → common-Cfviy7yT.js} +0 -0
  432. /package/build/assets/{context-CEQZwATj.js → context-BBqptpXX.js} +0 -0
  433. /package/build/assets/{conversation-local-storage-YmOVXxxW.js → conversation-local-storage-D5Tre_GA.js} +0 -0
  434. /package/build/assets/{createLucideIcon-Ddu8jDOQ.js → createLucideIcon-C9OEnwvX.js} +0 -0
  435. /package/build/assets/{environment-switch-store-CiurvTtK.js → environment-switch-store-BpKxp6Xq.js} +0 -0
  436. /package/build/assets/{git-status-mapper-DnL9OC8_.js → git-status-mapper-C3rfzUex.js} +0 -0
  437. /package/build/assets/{handle-capture-consent-3XrjZ8wi.js → handle-capture-consent-DDnXMC9Y.js} +0 -0
  438. /package/build/assets/{health-store-B5f0S2FY.js → health-store-d-d2ssv4.js} +0 -0
  439. /package/build/assets/{iconBase-BVhFI-0E.js → iconBase-1A_WRQ4E.js} +0 -0
  440. /package/build/assets/{map-provider-C3Z5Dx2J.js → map-provider-XSFHmdDs.js} +0 -0
  441. /package/build/assets/{objectWithoutPropertiesLoose-DSQKyRhw.js → objectWithoutPropertiesLoose-B-IA9dU9.js} +0 -0
  442. /package/build/assets/{query-keys-tAsQcc_9.js → query-keys-CQaji0wJ.js} +0 -0
  443. /package/build/assets/{react-Dy05vyj5.js → react-CuAHzoGi.js} +0 -0
  444. /package/build/assets/{retrieve-axios-error-message-BY-yIkIq.js → retrieve-axios-error-message-DbnSBc_1.js} +0 -0
  445. /package/build/assets/{sdk-settings-field-metadata-C6KMD-jZ.js → sdk-settings-field-metadata-CETNItbo.js} +0 -0
  446. /package/build/assets/{settings-DGY6n4J2.js → settings-BgL2HUsU.js} +0 -0
  447. /package/build/assets/{settings-like-page-layout-classes-DNg2vKSM.js → settings-like-page-layout-classes-DENKlZpD.js} +0 -0
  448. /package/build/assets/{use-breakpoint-DpxHDmuH.js → use-breakpoint-Dt2knceC.js} +0 -0
  449. /package/build/assets/{use-click-outside-element-DhxCUyWl.js → use-click-outside-element-Bu2A3s59.js} +0 -0
  450. /package/build/assets/{v4-khGvL7i2.js → v4-BygpdDmc.js} +0 -0
  451. /package/build/assets/{vendor~browser-BDNLFng6.js → vendor~browser-BYEwwJqV.js} +0 -0
  452. /package/build/assets/{vendor~conversation-panel~conversation~alert-banner-D_hRW_zc.js → vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js} +0 -0
  453. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-OFpe9fX_.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js} +0 -0
  454. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-BPuuVEqr.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js} +0 -0
  455. /package/build/assets/{vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-D44TR8hL.js → vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-87v-LliW.js} +0 -0
  456. /package/build/assets/{vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-Dr3Ow7Ms.js → vendor~home~conversation-panel~conversation~shared-conversation~planner-tab~files-tab-D8cqyq4k.js} +0 -0
  457. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-B1TKKuuH.js → vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js} +0 -0
  458. /package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-Fa-nXZ4M.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js} +0 -0
  459. /package/build/assets/{vendor~terminal-0ObOedYm.js → vendor~terminal-aeP3PnKf.js} +0 -0
  460. /package/build/assets/{vscode-url-helper-BMq8JBhB.js → vscode-url-helper-DOCkV_-G.js} +0 -0
@@ -1,2 +1,2 @@
1
- require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/axios/lib/axios.cjs`),r=require(`../agent-server-client-options.cjs`),i=require(`../backend-registry/auth.cjs`);function a(e){let t=e.authMode??`bearer`;return t===`bearer`?i.buildAuthHeaders(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function o(i){let o=t.getActiveBackend(),s=o.backend.id===i.backend.id&&o.orgId?{"X-Org-Id":o.orgId}:{},c={...a(i),...s,...i.headers??{}},l=i.hostOverride??i.backend.host;if(!i.hostOverride)return(await n.default.request({url:`${l.replace(/\/+$/,``)}${i.path}`,method:i.method,headers:c,...i.body===void 0?{}:{data:i.body},timeout:(i.timeoutSeconds??30)*1e3,...i.responseType?{responseType:i.responseType}:{}})).data;let u=e.getAgentServerBaseUrl();if(!u)throw new r.NoBackendAvailableError;let d=e.getAgentServerHeaders();return(await n.default.post(`${u.replace(/\/+$/,``)}/api/cloud-proxy`,{host:l,method:i.method,path:i.path,headers:c,body:i.body??null,...i.timeoutSeconds?{timeout_seconds:i.timeoutSeconds}:{}},{headers:d,timeout:3e4,...i.responseType?{responseType:i.responseType}:{}})).data}exports.callCloudProxy=o;
1
+ require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../agent-server-config.cjs`),t=require(`../backend-registry/active-store.cjs`),n=require(`../../node_modules/axios/lib/axios.cjs`),r=require(`../agent-server-client-options.cjs`),i=require(`../backend-registry/auth.cjs`);function a(e){let t=e.authMode??`bearer`;return t===`bearer`?i.buildAuthHeaders(e.backend):t===`session-api-key`&&e.sessionApiKey?{"X-Session-API-Key":e.sessionApiKey}:{}}async function o(i){let o=t.getActiveBackend(),s=o.backend.id===i.backend.id&&o.orgId?{"X-Org-Id":o.orgId}:{},c={...a(i),...s,...i.headers??{}},l=i.hostOverride??i.backend.host;if(!i.hostOverride&&!i.forceProxy)return(await n.default.request({url:`${l.replace(/\/+$/,``)}${i.path}`,method:i.method,headers:c,...i.body===void 0?{}:{data:i.body},timeout:(i.timeoutSeconds??30)*1e3,...i.responseType?{responseType:i.responseType}:{}})).data;let u=e.getAgentServerBaseUrl();if(!u)throw new r.NoBackendAvailableError;let d=e.getAgentServerHeaders();return(await n.default.post(`${u.replace(/\/+$/,``)}/api/cloud-proxy`,{host:l,method:i.method,path:i.path,headers:c,body:i.body??null,...i.timeoutSeconds?{timeout_seconds:i.timeoutSeconds}:{}},{headers:d,timeout:3e4,...i.responseType?{responseType:i.responseType}:{}})).data}exports.callCloudProxy=o;
2
2
  //# sourceMappingURL=proxy.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.cjs","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass\n * `hostOverride`, and those still go through `/api/cloud-proxy` because the\n * per-conversation runtime hosts are not the configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Runtime auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":"8RAqDA,SAAS,EACP,EACwB,CACxB,IAAM,EAAO,EAAI,UAAY,SAK7B,OAJI,IAAS,SAAiB,EAAA,iBAAiB,EAAI,QAAQ,CACvD,IAAS,mBACJ,EAAI,cAAgB,CAAE,oBAAqB,EAAI,cAAe,CAAG,EAAE,CAc9E,eAAsB,EACpB,EACoB,CAQpB,IAAM,EAAS,EAAA,kBAAkB,CAC3B,EACJ,EAAO,QAAQ,KAAO,EAAI,QAAQ,IAAM,EAAO,MAC3C,CAAE,WAAY,EAAO,MAAO,CAC5B,EAAE,CACF,EAAkB,CACtB,GAAG,EAAyB,EAAI,CAChC,GAAG,EACH,GAAI,EAAI,SAAW,EAAE,CACtB,CACK,EAAe,EAAI,cAAgB,EAAI,QAAQ,KAErD,GAAI,CAAC,EAAI,aAUP,OAAO,MATgB,EAAA,QAAM,QAAmB,CAC9C,IAAK,GAAG,EAAa,QAAQ,OAAQ,GAAG,GAAG,EAAI,OAC/C,OAAQ,EAAI,OACZ,QAAS,EACT,GAAI,EAAI,OAAS,IAAA,GAAiC,EAAE,CAAvB,CAAE,KAAM,EAAI,KAAM,CAC/C,SAAU,EAAI,gBAAkB,IAAM,IACtC,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CAAC,EAEc,KAGlB,IAAM,EAAe,EAAA,uBAAuB,CAC5C,GAAI,CAAC,EAAc,MAAM,IAAI,EAAA,wBAC7B,IAAM,EAAmB,EAAA,uBAAuB,CAuBhD,OAAO,MAjBgB,EAAA,QAAM,KAC3B,GAAG,EAAa,QAAQ,OAAQ,GAAG,CAAC,kBACpC,CACE,KAAM,EACN,OAAQ,EAAI,OACZ,KAAM,EAAI,KACV,QAAS,EACT,KAAM,EAAI,MAAQ,KAClB,GAAI,EAAI,eAAiB,CAAE,gBAAiB,EAAI,eAAgB,CAAG,EAAE,CACtE,CACD,CACE,QAAS,EACT,QAAS,IACT,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CACF,EAEe"}
1
+ {"version":3,"file":"proxy.cjs","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\nexport interface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n /**\n * Force this app-host call through the bundled agent-server's\n * `/api/cloud-proxy` instead of calling the cloud host directly from the\n * browser. App-host calls normally go direct because the main cloud API\n * loosens CORS for bearer-token requests (ApiKeyAwareCORSMiddleware →\n * `Access-Control-Allow-Origin: *`). The standalone automation service\n * (`/api/automation/*`) uses a strict origin allowlist instead, so direct\n * browser requests fail CORS preflight; the same-origin proxy hop avoids\n * cross-origin entirely while attaching the same auth and `X-Org-Id`\n * headers server-side.\n */\n forceProxy?: boolean;\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers, unless `forceProxy` is\n * set. Runtime-sandbox calls pass `hostOverride`, and those still go through\n * `/api/cloud-proxy` because the per-conversation runtime hosts are not the\n * configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Proxied auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride && !req.forceProxy) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":"8RAiEA,SAAS,EACP,EACwB,CACxB,IAAM,EAAO,EAAI,UAAY,SAK7B,OAJI,IAAS,SAAiB,EAAA,iBAAiB,EAAI,QAAQ,CACvD,IAAS,mBACJ,EAAI,cAAgB,CAAE,oBAAqB,EAAI,cAAe,CAAG,EAAE,CAe9E,eAAsB,EACpB,EACoB,CAQpB,IAAM,EAAS,EAAA,kBAAkB,CAC3B,EACJ,EAAO,QAAQ,KAAO,EAAI,QAAQ,IAAM,EAAO,MAC3C,CAAE,WAAY,EAAO,MAAO,CAC5B,EAAE,CACF,EAAkB,CACtB,GAAG,EAAyB,EAAI,CAChC,GAAG,EACH,GAAI,EAAI,SAAW,EAAE,CACtB,CACK,EAAe,EAAI,cAAgB,EAAI,QAAQ,KAErD,GAAI,CAAC,EAAI,cAAgB,CAAC,EAAI,WAU5B,OAAO,MATgB,EAAA,QAAM,QAAmB,CAC9C,IAAK,GAAG,EAAa,QAAQ,OAAQ,GAAG,GAAG,EAAI,OAC/C,OAAQ,EAAI,OACZ,QAAS,EACT,GAAI,EAAI,OAAS,IAAA,GAAiC,EAAE,CAAvB,CAAE,KAAM,EAAI,KAAM,CAC/C,SAAU,EAAI,gBAAkB,IAAM,IACtC,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CAAC,EAEc,KAGlB,IAAM,EAAe,EAAA,uBAAuB,CAC5C,GAAI,CAAC,EAAc,MAAM,IAAI,EAAA,wBAC7B,IAAM,EAAmB,EAAA,uBAAuB,CAuBhD,OAAO,MAjBgB,EAAA,QAAM,KAC3B,GAAG,EAAa,QAAQ,OAAQ,GAAG,CAAC,kBACpC,CACE,KAAM,EACN,OAAQ,EAAI,OACZ,KAAM,EAAI,KACV,QAAS,EACT,KAAM,EAAI,MAAQ,KAClB,GAAI,EAAI,eAAiB,CAAE,gBAAiB,EAAI,eAAgB,CAAG,EAAE,CACtE,CACD,CACE,QAAS,EACT,QAAS,IACT,GAAI,EAAI,aAAe,CAAE,aAAc,EAAI,aAAc,CAAG,EAAE,CAC/D,CACF,EAEe"}
@@ -1,5 +1,5 @@
1
1
  import type { Backend } from "../backend-registry/types";
2
- interface CloudProxyRequest {
2
+ export interface CloudProxyRequest {
3
3
  /**
4
4
  * Cloud backend whose bearer token authenticates the upstream call.
5
5
  * `backend.host` is also the default upstream host unless `hostOverride`
@@ -40,15 +40,27 @@ interface CloudProxyRequest {
40
40
  * payload (e.g. ZIP downloads); leave undefined for default JSON.
41
41
  */
42
42
  responseType?: "blob";
43
+ /**
44
+ * Force this app-host call through the bundled agent-server's
45
+ * `/api/cloud-proxy` instead of calling the cloud host directly from the
46
+ * browser. App-host calls normally go direct because the main cloud API
47
+ * loosens CORS for bearer-token requests (ApiKeyAwareCORSMiddleware →
48
+ * `Access-Control-Allow-Origin: *`). The standalone automation service
49
+ * (`/api/automation/*`) uses a strict origin allowlist instead, so direct
50
+ * browser requests fail CORS preflight; the same-origin proxy hop avoids
51
+ * cross-origin entirely while attaching the same auth and `X-Org-Id`
52
+ * headers server-side.
53
+ */
54
+ forceProxy?: boolean;
43
55
  }
44
56
  /**
45
57
  * Send a cloud request. App-host calls (`backend.host`) go directly to the
46
- * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass
47
- * `hostOverride`, and those still go through `/api/cloud-proxy` because the
48
- * per-conversation runtime hosts are not the configured cloud app origin.
58
+ * cloud API with the cloud backend's auth headers, unless `forceProxy` is
59
+ * set. Runtime-sandbox calls pass `hostOverride`, and those still go through
60
+ * `/api/cloud-proxy` because the per-conversation runtime hosts are not the
61
+ * configured cloud app origin.
49
62
  *
50
- * App-host auth headers are sent directly to the cloud host. Runtime auth
63
+ * App-host auth headers are sent directly to the cloud host. Proxied auth
51
64
  * headers are carried in the proxy envelope and attached server-side.
52
65
  */
53
66
  export declare function callCloudProxy<TResponse = unknown>(req: CloudProxyRequest): Promise<TResponse>;
54
- export {};
@@ -14,7 +14,7 @@ async function s(a) {
14
14
  ...c,
15
15
  ...a.headers ?? {}
16
16
  }, u = a.hostOverride ?? a.backend.host;
17
- if (!a.hostOverride) return (await r.request({
17
+ if (!a.hostOverride && !a.forceProxy) return (await r.request({
18
18
  url: `${u.replace(/\/+$/, "")}${a.path}`,
19
19
  method: a.method,
20
20
  headers: l,
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.js","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\ninterface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers. Runtime-sandbox calls pass\n * `hostOverride`, and those still go through `/api/cloud-proxy` because the\n * per-conversation runtime hosts are not the configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Runtime auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":";;;;;;AAqDA,SAAS,EACP,GACwB;CACxB,IAAM,IAAO,EAAI,YAAY;AAK7B,QAJI,MAAS,WAAiB,EAAiB,EAAI,QAAQ,GACvD,MAAS,qBACJ,EAAI,gBAAgB,EAAE,qBAAqB,EAAI,eAAe,GAAG,EAAE;;AAc9E,eAAsB,EACpB,GACoB;CAQpB,IAAM,IAAS,GAAkB,EAC3B,IACJ,EAAO,QAAQ,OAAO,EAAI,QAAQ,MAAM,EAAO,QAC3C,EAAE,YAAY,EAAO,OAAO,GAC5B,EAAE,EACF,IAAkB;EACtB,GAAG,EAAyB,EAAI;EAChC,GAAG;EACH,GAAI,EAAI,WAAW,EAAE;EACtB,EACK,IAAe,EAAI,gBAAgB,EAAI,QAAQ;AAErD,KAAI,CAAC,EAAI,aAUP,SAAO,MATgB,EAAM,QAAmB;EAC9C,KAAK,GAAG,EAAa,QAAQ,QAAQ,GAAG,GAAG,EAAI;EAC/C,QAAQ,EAAI;EACZ,SAAS;EACT,GAAI,EAAI,SAAS,KAAA,IAAiC,EAAE,GAAvB,EAAE,MAAM,EAAI,MAAM;EAC/C,UAAU,EAAI,kBAAkB,MAAM;EACtC,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CAAC,EAEc;CAGlB,IAAM,IAAe,GAAuB;AAC5C,KAAI,CAAC,EAAc,OAAM,IAAI,GAAyB;CACtD,IAAM,IAAmB,GAAuB;AAuBhD,SAAO,MAjBgB,EAAM,KAC3B,GAAG,EAAa,QAAQ,QAAQ,GAAG,CAAC,mBACpC;EACE,MAAM;EACN,QAAQ,EAAI;EACZ,MAAM,EAAI;EACV,SAAS;EACT,MAAM,EAAI,QAAQ;EAClB,GAAI,EAAI,iBAAiB,EAAE,iBAAiB,EAAI,gBAAgB,GAAG,EAAE;EACtE,EACD;EACE,SAAS;EACT,SAAS;EACT,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CACF,EAEe"}
1
+ {"version":3,"file":"proxy.js","names":[],"sources":["../../../src/api/cloud/proxy.ts"],"sourcesContent":["import axios from \"axios\";\nimport {\n getAgentServerBaseUrl,\n getAgentServerHeaders,\n} from \"../agent-server-config\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport { NoBackendAvailableError } from \"../agent-server-client-options\";\nimport { buildAuthHeaders } from \"../backend-registry/auth\";\nimport type { Backend } from \"../backend-registry/types\";\n\nexport interface CloudProxyRequest {\n /**\n * Cloud backend whose bearer token authenticates the upstream call.\n * `backend.host` is also the default upstream host unless `hostOverride`\n * is set.\n */\n backend: Backend;\n /** HTTP method against the upstream host. */\n method: \"GET\" | \"POST\" | \"PATCH\" | \"PUT\" | \"DELETE\";\n /** Path on the upstream host, e.g. \"/api/v1/conversation/123/events/search\". */\n path: string;\n /** Optional JSON body for non-GET methods. */\n body?: unknown;\n /** Extra headers merged with the auth header for the upstream call. */\n headers?: Record<string, string>;\n /** Override the upstream timeout, in seconds. */\n timeoutSeconds?: number;\n /**\n * Override the upstream host. When set, the proxy targets this host\n * instead of `backend.host`. Used for runtime-sandbox calls where the\n * upstream lives at the conversation's runtime URL (e.g.\n * `http://<id>.prod-runtime.all-hands.dev`) rather than the cloud API.\n * The host must still pass the proxy's allowlist server-side.\n */\n hostOverride?: string;\n /**\n * Auth strategy for the upstream call. Defaults to \"bearer\" (uses the\n * cloud backend's bearer token via `buildAuthHeaders`). For\n * runtime-sandbox calls, set to \"session-api-key\" and pass\n * `sessionApiKey` — those endpoints don't accept bearer tokens, only\n * `X-Session-API-Key`. \"none\" sends no auth header.\n */\n authMode?: \"bearer\" | \"session-api-key\" | \"none\";\n /** Required when `authMode === \"session-api-key\"`. */\n sessionApiKey?: string | null;\n /**\n * Axios responseType for the inner POST to the bundled agent-server.\n * Set to \"blob\" when the upstream cloud endpoint returns a binary\n * payload (e.g. ZIP downloads); leave undefined for default JSON.\n */\n responseType?: \"blob\";\n /**\n * Force this app-host call through the bundled agent-server's\n * `/api/cloud-proxy` instead of calling the cloud host directly from the\n * browser. App-host calls normally go direct because the main cloud API\n * loosens CORS for bearer-token requests (ApiKeyAwareCORSMiddleware →\n * `Access-Control-Allow-Origin: *`). The standalone automation service\n * (`/api/automation/*`) uses a strict origin allowlist instead, so direct\n * browser requests fail CORS preflight; the same-origin proxy hop avoids\n * cross-origin entirely while attaching the same auth and `X-Org-Id`\n * headers server-side.\n */\n forceProxy?: boolean;\n}\n\nfunction buildUpstreamAuthHeaders(\n req: CloudProxyRequest,\n): Record<string, string> {\n const mode = req.authMode ?? \"bearer\";\n if (mode === \"bearer\") return buildAuthHeaders(req.backend);\n if (mode === \"session-api-key\") {\n return req.sessionApiKey ? { \"X-Session-API-Key\": req.sessionApiKey } : {};\n }\n return {};\n}\n\n/**\n * Send a cloud request. App-host calls (`backend.host`) go directly to the\n * cloud API with the cloud backend's auth headers, unless `forceProxy` is\n * set. Runtime-sandbox calls pass `hostOverride`, and those still go through\n * `/api/cloud-proxy` because the per-conversation runtime hosts are not the\n * configured cloud app origin.\n *\n * App-host auth headers are sent directly to the cloud host. Proxied auth\n * headers are carried in the proxy envelope and attached server-side.\n */\nexport async function callCloudProxy<TResponse = unknown>(\n req: CloudProxyRequest,\n): Promise<TResponse> {\n // Send `X-Org-Id` so the upstream scopes per-request to the org the user\n // selected locally, instead of the user's globally-shared\n // `current_org_id` on the cloud backend. Restricted to calls against the active\n // backend: the selector also fans out per-backend bookkeeping calls\n // (e.g. `getCloudOrganizations(b)`) that would otherwise carry the\n // active backend's orgId across an unrelated API key, which the cloud backend\n // rejects when api_key_org_id and X-Org-Id disagree.\n const active = getActiveBackend();\n const orgIdHeader =\n active.backend.id === req.backend.id && active.orgId\n ? { \"X-Org-Id\": active.orgId }\n : {};\n const upstreamHeaders = {\n ...buildUpstreamAuthHeaders(req),\n ...orgIdHeader,\n ...(req.headers ?? {}),\n };\n const upstreamHost = req.hostOverride ?? req.backend.host;\n\n if (!req.hostOverride && !req.forceProxy) {\n const response = await axios.request<TResponse>({\n url: `${upstreamHost.replace(/\\/+$/, \"\")}${req.path}`,\n method: req.method,\n headers: upstreamHeaders,\n ...(req.body !== undefined ? { data: req.body } : {}),\n timeout: (req.timeoutSeconds ?? 30) * 1000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n });\n\n return response.data;\n }\n\n const proxyBaseUrl = getAgentServerBaseUrl();\n if (!proxyBaseUrl) throw new NoBackendAvailableError();\n const localAuthHeaders = getAgentServerHeaders();\n\n // Talk to the configured app/ingress origin that exposes /api/cloud-proxy.\n // Do not resolve this through the backend registry: when the active backend\n // is cloud, borrowing some other registered local backend would silently\n // route cloud traffic through the wrong user-configured server.\n const response = await axios.post<TResponse>(\n `${proxyBaseUrl.replace(/\\/+$/, \"\")}/api/cloud-proxy`,\n {\n host: upstreamHost,\n method: req.method,\n path: req.path,\n headers: upstreamHeaders,\n body: req.body ?? null,\n ...(req.timeoutSeconds ? { timeout_seconds: req.timeoutSeconds } : {}),\n },\n {\n headers: localAuthHeaders,\n timeout: 30_000,\n ...(req.responseType ? { responseType: req.responseType } : {}),\n },\n );\n\n return response.data;\n}\n"],"mappings":";;;;;;AAiEA,SAAS,EACP,GACwB;CACxB,IAAM,IAAO,EAAI,YAAY;AAK7B,QAJI,MAAS,WAAiB,EAAiB,EAAI,QAAQ,GACvD,MAAS,qBACJ,EAAI,gBAAgB,EAAE,qBAAqB,EAAI,eAAe,GAAG,EAAE;;AAe9E,eAAsB,EACpB,GACoB;CAQpB,IAAM,IAAS,GAAkB,EAC3B,IACJ,EAAO,QAAQ,OAAO,EAAI,QAAQ,MAAM,EAAO,QAC3C,EAAE,YAAY,EAAO,OAAO,GAC5B,EAAE,EACF,IAAkB;EACtB,GAAG,EAAyB,EAAI;EAChC,GAAG;EACH,GAAI,EAAI,WAAW,EAAE;EACtB,EACK,IAAe,EAAI,gBAAgB,EAAI,QAAQ;AAErD,KAAI,CAAC,EAAI,gBAAgB,CAAC,EAAI,WAU5B,SAAO,MATgB,EAAM,QAAmB;EAC9C,KAAK,GAAG,EAAa,QAAQ,QAAQ,GAAG,GAAG,EAAI;EAC/C,QAAQ,EAAI;EACZ,SAAS;EACT,GAAI,EAAI,SAAS,KAAA,IAAiC,EAAE,GAAvB,EAAE,MAAM,EAAI,MAAM;EAC/C,UAAU,EAAI,kBAAkB,MAAM;EACtC,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CAAC,EAEc;CAGlB,IAAM,IAAe,GAAuB;AAC5C,KAAI,CAAC,EAAc,OAAM,IAAI,GAAyB;CACtD,IAAM,IAAmB,GAAuB;AAuBhD,SAAO,MAjBgB,EAAM,KAC3B,GAAG,EAAa,QAAQ,QAAQ,GAAG,CAAC,mBACpC;EACE,MAAM;EACN,QAAQ,EAAI;EACZ,MAAM,EAAI;EACV,SAAS;EACT,MAAM,EAAI,QAAQ;EAClB,GAAI,EAAI,iBAAiB,EAAE,iBAAiB,EAAI,gBAAgB,GAAG,EAAE;EACtE,EACD;EACE,SAAS;EACT,SAAS;EACT,GAAI,EAAI,eAAe,EAAE,cAAc,EAAI,cAAc,GAAG,EAAE;EAC/D,CACF,EAEe"}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-metadata-store.cjs","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n}\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":"6CAEA,IAAM,EAAc,+CAmBd,MAAgC,CACpC,GAAI,OAAO,OAAW,IAAa,MAAO,EAAE,CAC5C,GAAI,CACF,IAAM,EAAM,OAAO,aAAa,QAAQ,EAAY,CACpD,GAAI,CAAC,EAAK,MAAO,EAAE,CACnB,IAAM,EAAS,KAAK,MAAM,EAAI,CAE9B,MADI,CAAC,GAAU,OAAO,GAAW,SAAiB,EAAE,CAC7C,OACD,CACN,MAAO,EAAE,GAIP,EAAY,GAA+B,CAC3C,YAAO,OAAW,KACtB,IAAI,OAAO,KAAK,EAAK,CAAC,SAAW,EAAG,CAClC,OAAO,aAAa,WAAW,EAAY,CAC3C,OAEF,OAAO,aAAa,QAAQ,EAAa,KAAK,UAAU,EAAK,CAAC,GAGnD,EACX,GACgC,GAAS,CAAC,IAAmB,KAElD,GACX,EACA,IACS,CACT,IAAM,EAAM,GAAS,CACrB,EAAI,GAAkB,EACtB,EAAS,EAAI,EAGF,EACX,GACS,CACT,IAAM,EAAM,GAAS,CACf,KAAkB,IACxB,OAAO,EAAI,GACX,EAAS,EAAI"}
1
+ {"version":3,"file":"conversation-metadata-store.cjs","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n /**\n * The LLM profile the conversation was created with (or last switched to).\n * Client-side only. Lets the chat-header switcher show the exact profile\n * name even when several profiles share the same underlying model — the\n * agent-server only round-trips the model string, so matching on it alone\n * is ambiguous (issue #1082).\n */\n active_profile?: string | null;\n}\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":"6CAEA,IAAM,EAAc,+CA2Bd,MAAgC,CACpC,GAAI,OAAO,OAAW,IAAa,MAAO,EAAE,CAC5C,GAAI,CACF,IAAM,EAAM,OAAO,aAAa,QAAQ,EAAY,CACpD,GAAI,CAAC,EAAK,MAAO,EAAE,CACnB,IAAM,EAAS,KAAK,MAAM,EAAI,CAE9B,MADI,CAAC,GAAU,OAAO,GAAW,SAAiB,EAAE,CAC7C,OACD,CACN,MAAO,EAAE,GAIP,EAAY,GAA+B,CAC3C,YAAO,OAAW,KACtB,IAAI,OAAO,KAAK,EAAK,CAAC,SAAW,EAAG,CAClC,OAAO,aAAa,WAAW,EAAY,CAC3C,OAEF,OAAO,aAAa,QAAQ,EAAa,KAAK,UAAU,EAAK,CAAC,GAGnD,EACX,GACgC,GAAS,CAAC,IAAmB,KAElD,GACX,EACA,IACS,CACT,IAAM,EAAM,GAAS,CACrB,EAAI,GAAkB,EACtB,EAAS,EAAI,EAGF,EACX,GACS,CACT,IAAM,EAAM,GAAS,CACf,KAAkB,IACxB,OAAO,EAAI,GACX,EAAS,EAAI"}
@@ -12,6 +12,14 @@ export interface ConversationMetadata {
12
12
  * git baseline to compare against.
13
13
  */
14
14
  selected_workspace?: string | null;
15
+ /**
16
+ * The LLM profile the conversation was created with (or last switched to).
17
+ * Client-side only. Lets the chat-header switcher show the exact profile
18
+ * name even when several profiles share the same underlying model — the
19
+ * agent-server only round-trips the model string, so matching on it alone
20
+ * is ambiguous (issue #1082).
21
+ */
22
+ active_profile?: string | null;
15
23
  }
16
24
  export declare const getStoredConversationMetadata: (conversationId: string) => ConversationMetadata | null;
17
25
  export declare const setStoredConversationMetadata: (conversationId: string, metadata: ConversationMetadata) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-metadata-store.js","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n}\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":";AAEA,IAAM,IAAc,gDAmBd,UAAgC;AACpC,KAAI,OAAO,SAAW,IAAa,QAAO,EAAE;AAC5C,KAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,EAAY;AACpD,MAAI,CAAC,EAAK,QAAO,EAAE;EACnB,IAAM,IAAS,KAAK,MAAM,EAAI;AAE9B,SADI,CAAC,KAAU,OAAO,KAAW,WAAiB,EAAE,GAC7C;SACD;AACN,SAAO,EAAE;;GAIP,KAAY,MAA+B;AAC3C,cAAO,SAAW,MACtB;MAAI,OAAO,KAAK,EAAK,CAAC,WAAW,GAAG;AAClC,UAAO,aAAa,WAAW,EAAY;AAC3C;;AAEF,SAAO,aAAa,QAAQ,GAAa,KAAK,UAAU,EAAK,CAAC;;GAGnD,KACX,MACgC,GAAS,CAAC,MAAmB,MAElD,KACX,GACA,MACS;CACT,IAAM,IAAM,GAAS;AAErB,CADA,EAAI,KAAkB,GACtB,EAAS,EAAI;GAGF,KACX,MACS;CACT,IAAM,IAAM,GAAS;AACf,MAAkB,MACxB,OAAO,EAAI,IACX,EAAS,EAAI"}
1
+ {"version":3,"file":"conversation-metadata-store.js","names":[],"sources":["../../src/api/conversation-metadata-store.ts"],"sourcesContent":["import { Provider } from \"#/types/settings\";\n\nconst STORAGE_KEY = \"openhands-agent-server-conversation-metadata\";\n\nexport interface ConversationMetadata {\n selected_repository: string | null;\n selected_branch: string | null;\n git_provider: Provider | null;\n /**\n * The local workspace path the user explicitly attached at conversation\n * creation time. Distinct from `selected_repository` (which is set by\n * the repo picker on the home page). Used by the Files tab to decide\n * whether to default to diff view: if the user attached *anything*\n * (repo or local workspace), we lean diff-first because there's a real\n * git baseline to compare against.\n */\n selected_workspace?: string | null;\n /**\n * The LLM profile the conversation was created with (or last switched to).\n * Client-side only. Lets the chat-header switcher show the exact profile\n * name even when several profiles share the same underlying model — the\n * agent-server only round-trips the model string, so matching on it alone\n * is ambiguous (issue #1082).\n */\n active_profile?: string | null;\n}\n\ntype StoredMetadata = Record<string, ConversationMetadata>;\n\nconst readAll = (): StoredMetadata => {\n if (typeof window === \"undefined\") return {};\n try {\n const raw = window.localStorage.getItem(STORAGE_KEY);\n if (!raw) return {};\n const parsed = JSON.parse(raw) as unknown;\n if (!parsed || typeof parsed !== \"object\") return {};\n return parsed as StoredMetadata;\n } catch {\n return {};\n }\n};\n\nconst writeAll = (next: StoredMetadata): void => {\n if (typeof window === \"undefined\") return;\n if (Object.keys(next).length === 0) {\n window.localStorage.removeItem(STORAGE_KEY);\n return;\n }\n window.localStorage.setItem(STORAGE_KEY, JSON.stringify(next));\n};\n\nexport const getStoredConversationMetadata = (\n conversationId: string,\n): ConversationMetadata | null => readAll()[conversationId] ?? null;\n\nexport const setStoredConversationMetadata = (\n conversationId: string,\n metadata: ConversationMetadata,\n): void => {\n const all = readAll();\n all[conversationId] = metadata;\n writeAll(all);\n};\n\nexport const removeStoredConversationMetadata = (\n conversationId: string,\n): void => {\n const all = readAll();\n if (!(conversationId in all)) return;\n delete all[conversationId];\n writeAll(all);\n};\n"],"mappings":";AAEA,IAAM,IAAc,gDA2Bd,UAAgC;AACpC,KAAI,OAAO,SAAW,IAAa,QAAO,EAAE;AAC5C,KAAI;EACF,IAAM,IAAM,OAAO,aAAa,QAAQ,EAAY;AACpD,MAAI,CAAC,EAAK,QAAO,EAAE;EACnB,IAAM,IAAS,KAAK,MAAM,EAAI;AAE9B,SADI,CAAC,KAAU,OAAO,KAAW,WAAiB,EAAE,GAC7C;SACD;AACN,SAAO,EAAE;;GAIP,KAAY,MAA+B;AAC3C,cAAO,SAAW,MACtB;MAAI,OAAO,KAAK,EAAK,CAAC,WAAW,GAAG;AAClC,UAAO,aAAa,WAAW,EAAY;AAC3C;;AAEF,SAAO,aAAa,QAAQ,GAAa,KAAK,UAAU,EAAK,CAAC;;GAGnD,KACX,MACgC,GAAS,CAAC,MAAmB,MAElD,KACX,GACA,MACS;CACT,IAAM,IAAM,GAAS;AAErB,CADA,EAAI,KAAkB,GACtB,EAAS,EAAI;GAGF,KACX,MACS;CACT,IAAM,IAAM,GAAS;AACf,MAAkB,MACxB,OAAO,EAAI,IACX,EAAS,EAAI"}
@@ -132,6 +132,15 @@ export interface AppConversation {
132
132
  * the runtime actually operates in).
133
133
  */
134
134
  selected_workspace?: string | null;
135
+ /**
136
+ * The LLM profile this conversation was created with / last switched to.
137
+ * Hydrated from client-side metadata (see
138
+ * `ConversationMetadata.active_profile`). Preferred over matching
139
+ * `llm_model` against the profile list, which is ambiguous when several
140
+ * profiles share a model (#1082). Null when unknown (e.g. created by an
141
+ * older client) — consumers fall back to model-matching.
142
+ */
143
+ active_profile?: string | null;
135
144
  public?: boolean;
136
145
  sub_conversation_ids: string[];
137
146
  }
@@ -1,2 +1,2 @@
1
- require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../../types/agent-server/type-guards.cjs`);var t=t=>{if(e.isConversationStateUpdateEvent(t))return!1;if(e.isActionEvent(t)){let e=t.action.kind;return!(!e||e===`ExecuteBashAction`&&t.source===`user`||e===`PlanningFileEditorAction`||e===`SwitchLLMAction`)}return e.isObservationEvent(t)?!(t.observation.kind===`SwitchLLMObservation`&&!t.observation.is_error):!!(e.isMessageEvent(t)||e.isAgentErrorEvent(t)||e.isHookExecutionEvent(t)||e.isACPToolCallEvent(t))},n=e=>e.some(e=>e.source===`user`);exports.hasUserEvent=n,exports.shouldRenderEvent=t;
1
+ require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../../../types/agent-server/type-guards.cjs`);var t=t=>{if(e.isConversationStateUpdateEvent(t))return!1;if(e.isActionEvent(t)){let e=t.action.kind;return!(!e||e===`ExecuteBashAction`&&t.source===`user`||e===`PlanningFileEditorAction`||e===`SwitchLLMAction`)}return e.isObservationEvent(t)?!(t.observation.kind===`SwitchLLMObservation`&&!t.observation.is_error):e.isMessageEvent(t)||e.isAgentErrorEvent(t)||e.isHookExecutionEvent(t)||e.isACPToolCallEvent(t)?!0:e.isStreamingDeltaEvent(t)?t.content!==null||t.reasoning_content!==null:!1},n=e=>e.some(e=>e.source===`user`);exports.hasUserEvent=n,exports.shouldRenderEvent=t;
2
2
  //# sourceMappingURL=should-render-event.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"should-render-event.cjs","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n} from \"#/types/agent-server/type-guards\";\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n // Explicitly exclude system events that should not be rendered in chat\n if (isConversationStateUpdateEvent(event)) {\n return false;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages)\n if (isMessageEvent(event)) {\n return true;\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":"wHAWA,IAAa,EAAqB,GAA0B,CAE1D,GAAI,EAAA,+BAA+B,EAAM,CACvC,MAAO,GAIT,GAAI,EAAA,cAAc,EAAM,CAAE,CAExB,IAAM,EAAa,EAAM,OAAO,KAsBhC,MAJA,EAhBI,CAAC,GAKD,IAAe,qBAAuB,EAAM,SAAW,QAKvD,IAAe,4BAMf,IAAe,mBAqDrB,OA7CI,EAAA,mBAAmB,EAAM,CAI3B,EACE,EAAM,YAAY,OAAS,wBAC3B,CAAC,EAAM,YAAY,UAkCvB,GAzBI,EAAA,eAAe,EAAM,EAKrB,EAAA,kBAAkB,EAAM,EAKxB,EAAA,qBAAqB,EAAM,EAe3B,EAAA,mBAAmB,EAAM,GAQlB,EAAgB,GAC3B,EAAO,KAAM,GAAU,EAAM,SAAW,OAAO"}
1
+ {"version":3,"file":"should-render-event.cjs","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n // Explicitly exclude system events that should not be rendered in chat\n if (isConversationStateUpdateEvent(event)) {\n return false;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages)\n if (isMessageEvent(event)) {\n return true;\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":"wHAYA,IAAa,EAAqB,GAA0B,CAE1D,GAAI,EAAA,+BAA+B,EAAM,CACvC,MAAO,GAIT,GAAI,EAAA,cAAc,EAAM,CAAE,CAExB,IAAM,EAAa,EAAM,OAAO,KAsBhC,MAJA,EAhBI,CAAC,GAKD,IAAe,qBAAuB,EAAM,SAAW,QAKvD,IAAe,4BAMf,IAAe,mBAyDrB,OAjDI,EAAA,mBAAmB,EAAM,CAI3B,EACE,EAAM,YAAY,OAAS,wBAC3B,CAAC,EAAM,YAAY,UASnB,EAAA,eAAe,EAAM,EAKrB,EAAA,kBAAkB,EAAM,EAKxB,EAAA,qBAAqB,EAAM,EAe3B,EAAA,mBAAmB,EAAM,CACpB,GAGL,EAAA,sBAAsB,EAAM,CACvB,EAAM,UAAY,MAAQ,EAAM,oBAAsB,KAIxD,IAGI,EAAgB,GAC3B,EAAO,KAAM,GAAU,EAAM,SAAW,OAAO"}
@@ -1,14 +1,14 @@
1
- import { isACPToolCallEvent as e, isActionEvent as t, isAgentErrorEvent as n, isConversationStateUpdateEvent as r, isHookExecutionEvent as i, isMessageEvent as a, isObservationEvent as o } from "../../../../types/agent-server/type-guards.js";
1
+ import { isACPToolCallEvent as e, isActionEvent as t, isAgentErrorEvent as n, isConversationStateUpdateEvent as r, isHookExecutionEvent as i, isMessageEvent as a, isObservationEvent as o, isStreamingDeltaEvent as s } from "../../../../types/agent-server/type-guards.js";
2
2
  //#region src/components/conversation-events/chat/event-content-helpers/should-render-event.ts
3
- var s = (s) => {
4
- if (r(s)) return !1;
5
- if (t(s)) {
6
- let e = s.action.kind;
7
- return !(!e || e === "ExecuteBashAction" && s.source === "user" || e === "PlanningFileEditorAction" || e === "SwitchLLMAction");
3
+ var c = (c) => {
4
+ if (r(c)) return !1;
5
+ if (t(c)) {
6
+ let e = c.action.kind;
7
+ return !(!e || e === "ExecuteBashAction" && c.source === "user" || e === "PlanningFileEditorAction" || e === "SwitchLLMAction");
8
8
  }
9
- return o(s) ? !(s.observation.kind === "SwitchLLMObservation" && !s.observation.is_error) : !!(a(s) || n(s) || i(s) || e(s));
10
- }, c = (e) => e.some((e) => e.source === "user");
9
+ return o(c) ? !(c.observation.kind === "SwitchLLMObservation" && !c.observation.is_error) : a(c) || n(c) || i(c) || e(c) ? !0 : s(c) ? c.content !== null || c.reasoning_content !== null : !1;
10
+ }, l = (e) => e.some((e) => e.source === "user");
11
11
  //#endregion
12
- export { c as hasUserEvent, s as shouldRenderEvent };
12
+ export { l as hasUserEvent, c as shouldRenderEvent };
13
13
 
14
14
  //# sourceMappingURL=should-render-event.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"should-render-event.js","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n} from \"#/types/agent-server/type-guards\";\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n // Explicitly exclude system events that should not be rendered in chat\n if (isConversationStateUpdateEvent(event)) {\n return false;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages)\n if (isMessageEvent(event)) {\n return true;\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":";;AAWA,IAAa,KAAqB,MAA0B;AAE1D,KAAI,EAA+B,EAAM,CACvC,QAAO;AAIT,KAAI,EAAc,EAAM,EAAE;EAExB,IAAM,IAAa,EAAM,OAAO;AAsBhC,SAJA,EAhBI,CAAC,KAKD,MAAe,uBAAuB,EAAM,WAAW,UAKvD,MAAe,8BAMf,MAAe;;AAqDrB,QA7CI,EAAmB,EAAM,GAI3B,EACE,EAAM,YAAY,SAAS,0BAC3B,CAAC,EAAM,YAAY,YAkCvB,GAzBI,EAAe,EAAM,IAKrB,EAAkB,EAAM,IAKxB,EAAqB,EAAM,IAe3B,EAAmB,EAAM;GAQlB,KAAgB,MAC3B,EAAO,MAAM,MAAU,EAAM,WAAW,OAAO"}
1
+ {"version":3,"file":"should-render-event.js","names":[],"sources":["../../../../../src/components/conversation-events/chat/event-content-helpers/should-render-event.ts"],"sourcesContent":["import { OpenHandsEvent } from \"#/types/agent-server/core\";\nimport {\n isActionEvent,\n isObservationEvent,\n isMessageEvent,\n isAgentErrorEvent,\n isConversationStateUpdateEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\n\nexport const shouldRenderEvent = (event: OpenHandsEvent) => {\n // Explicitly exclude system events that should not be rendered in chat\n if (isConversationStateUpdateEvent(event)) {\n return false;\n }\n\n // Render action events (with filtering)\n if (isActionEvent(event)) {\n // For V1, action is an object with kind property\n const actionType = event.action.kind;\n\n if (!actionType) {\n return false;\n }\n\n // Hide user commands from the chat interface\n if (actionType === \"ExecuteBashAction\" && event.source === \"user\") {\n return false;\n }\n\n // Hide PlanningFileEditorAction - handled separately with PlanPreview component\n if (actionType === \"PlanningFileEditorAction\") {\n return false;\n }\n\n // The model switch tool reuses the same inline model message UI as\n // `/model <profile>` once the observation arrives.\n if (actionType === \"SwitchLLMAction\") {\n return false;\n }\n\n return true;\n }\n\n // Render observation events\n if (isObservationEvent(event)) {\n // Successful model switches are rendered through ModelMessages so they\n // look identical to `/model <profile>` confirmations. Failed switches\n // still render as observations so the error remains visible in chat.\n if (\n event.observation.kind === \"SwitchLLMObservation\" &&\n !event.observation.is_error\n ) {\n return false;\n }\n\n return true;\n }\n\n // Render message events (user and assistant messages)\n if (isMessageEvent(event)) {\n return true;\n }\n\n // Render agent error events\n if (isAgentErrorEvent(event)) {\n return true;\n }\n\n // Render hook execution events\n if (isHookExecutionEvent(event)) {\n return true;\n }\n\n // Render ACP sub-agent tool call events at every lifecycle stage. The SDK\n // now persists exactly two events per ``tool_call_id`` — one early\n // ``started`` event (``pending`` / ``in_progress``) and one terminal\n // (``completed`` / ``failed``) event — the action->observation pair for a\n // tool call. The ``started`` event renders the card as \"running\" (no check\n // mark; see ``getACPToolCallResult``) and ``handleEventForUI`` replaces it\n // in place by ``tool_call_id`` once the terminal event arrives, mirroring\n // how an ObservationEvent supersedes its ActionEvent. The old terminal-only\n // gate existed because the source fanned out one cumulative-output frame per\n // ``ToolCallProgress``, which flashed half-formed cards mid-stream; that\n // fan-out is gone, so the running card is now a single clean event.\n if (isACPToolCallEvent(event)) {\n return true;\n }\n\n if (isStreamingDeltaEvent(event)) {\n return event.content !== null || event.reasoning_content !== null;\n }\n\n // Don't render any other event types (system events, etc.)\n return false;\n};\n\nexport const hasUserEvent = (events: OpenHandsEvent[]) =>\n events.some((event) => event.source === \"user\");\n"],"mappings":";;AAYA,IAAa,KAAqB,MAA0B;AAE1D,KAAI,EAA+B,EAAM,CACvC,QAAO;AAIT,KAAI,EAAc,EAAM,EAAE;EAExB,IAAM,IAAa,EAAM,OAAO;AAsBhC,SAJA,EAhBI,CAAC,KAKD,MAAe,uBAAuB,EAAM,WAAW,UAKvD,MAAe,8BAMf,MAAe;;AAyDrB,QAjDI,EAAmB,EAAM,GAI3B,EACE,EAAM,YAAY,SAAS,0BAC3B,CAAC,EAAM,YAAY,YASnB,EAAe,EAAM,IAKrB,EAAkB,EAAM,IAKxB,EAAqB,EAAM,IAe3B,EAAmB,EAAM,GACpB,KAGL,EAAsB,EAAM,GACvB,EAAM,YAAY,QAAQ,EAAM,sBAAsB,OAIxD;GAGI,KAAgB,MAC3B,EAAO,MAAM,MAAU,EAAM,WAAW,OAAO"}
@@ -1,2 +1,2 @@
1
- const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../types/agent-state.cjs`),n=require(`../../../stores/conversation-store.cjs`),r=require(`../../../types/agent-server/type-guards.cjs`),i=require(`../../../hooks/use-agent-state.cjs`),a=require(`../../../hooks/query/use-config.cjs`),o=require(`../../features/chat/plan-preview.cjs`),s=require(`./event-message-components/error-event-message.cjs`),c=require(`./event-message-components/user-assistant-event-message.cjs`),l=require(`./event-content-helpers/create-skill-ready-event.cjs`),u=require(`./event-message-components/finish-event-message.cjs`),d=require(`./event-message-components/generic-event-message-wrapper.cjs`),f=require(`./event-message-components/thought-event-message.cjs`),p=require(`./event-message-components/collapsible-thinking.cjs`),m=require(`../../shared/hook-execution-event-message.cjs`);require(`./event-message-components/hook-execution-event-message.cjs`);const h=require(`./hooks/use-plan-preview-events.cjs`),g=require(`./event-thought-helpers.cjs`);let _=require(`react`);_=e.__toESM(_,1);let v=require(`react/jsx-runtime`);var y=e=>e.activated_skills||e.activated_microagents||[],b=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),x=e=>{let t=y(e).length>0,n=b(e.extended_content);return t&&n},S=(e,t,n)=>{try{let r=l.createSkillReadyEvent(e);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(c.UserAssistantEventMessage,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,v.jsx)(d.GenericEventMessageWrapper,{event:r,isLastMessage:n})]})}catch{return(0,v.jsx)(c.UserAssistantEventMessage,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function C({event:e,messages:l,isLastMessage:_,isInLast10Actions:y,planPreviewEventIds:b,suppressThought:C=!1}){let{data:w}=a.useConfig(),{planContent:T}=n.useConversationStore(),{curAgentState:E}=i.useAgentState(),D=E===t.AgentState.RUNNING||E===t.AgentState.LOADING,O=e.isFromPlanningAgent||!1,k={isLastMessage:_,isInLast10Actions:y,config:w,isFromPlanningAgent:O};if(r.isAgentErrorEvent(e))return(0,v.jsx)(s.ErrorEventMessage,{event:e,...k});if(r.isHookExecutionEvent(e))return(0,v.jsx)(m.HookExecutionEventMessage,{event:e});if(r.isACPToolCallEvent(e))return(0,v.jsx)(d.GenericEventMessageWrapper,{event:e,isLastMessage:_});if(r.isActionEvent(e)&&e.action.kind===`FinishAction`)return(0,v.jsx)(u.FinishEventMessage,{event:e,...k});if(r.isActionEvent(e)&&e.action.kind===`ThinkAction`)return(0,v.jsx)(p.CollapsibleThinking,{content:e.action.thought});if(r.isActionEvent(e)){let t=g.getReasoningContent(e);return(0,v.jsxs)(v.Fragment,{children:[t&&(0,v.jsx)(p.CollapsibleThinking,{content:t}),!C&&(0,v.jsx)(f.ThoughtEventMessage,{event:e,isFromPlanningAgent:O}),(0,v.jsx)(d.GenericEventMessageWrapper,{event:e,isLastMessage:_})]})}if(r.isObservationEvent(e)){if(r.isPlanningFileEditorObservationEvent(e))return b&&h.shouldShowPlanPreview(e.id,b)?(0,v.jsx)(o.PlanPreview,{planContent:T,isStreaming:_&&E===t.AgentState.RUNNING,isBuildDisabled:D}):null;let n=l.find(t=>r.isActionEvent(t)&&t.id===e.action_id),i=!C&&n&&r.isActionEvent(n)&&n.action.kind!==`ThinkAction`,a=n&&r.isActionEvent(n)?g.getReasoningContent(n):``;return(0,v.jsxs)(v.Fragment,{children:[a&&(0,v.jsx)(p.CollapsibleThinking,{content:a}),i&&(0,v.jsx)(f.ThoughtEventMessage,{event:n,isFromPlanningAgent:O}),(0,v.jsx)(d.GenericEventMessageWrapper,{event:e,isLastMessage:_,correspondingAction:n&&r.isActionEvent(n)?n:void 0})]})}if(!r.isActionEvent(e)&&!r.isObservationEvent(e)){let t=e;return r.isUserMessageEvent(e)&&x(t)?S(t,k,_):(0,v.jsx)(c.UserAssistantEventMessage,{event:t,...k,isLastMessage:_})}return(0,v.jsx)(d.GenericEventMessageWrapper,{event:e,isLastMessage:_})}exports.EventMessage=C;
1
+ const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`../../../types/agent-state.cjs`),n=require(`../../../stores/conversation-store.cjs`),r=require(`../../../types/agent-server/type-guards.cjs`),i=require(`../../../hooks/use-agent-state.cjs`),a=require(`../../../hooks/query/use-config.cjs`),o=require(`../../features/chat/chat-message.cjs`),s=require(`../../features/chat/plan-preview.cjs`),c=require(`./event-message-components/error-event-message.cjs`),l=require(`./event-message-components/user-assistant-event-message.cjs`),u=require(`./event-content-helpers/create-skill-ready-event.cjs`),d=require(`./event-message-components/finish-event-message.cjs`),f=require(`./event-message-components/generic-event-message-wrapper.cjs`),p=require(`./event-message-components/thought-event-message.cjs`),m=require(`./event-message-components/collapsible-thinking.cjs`),h=require(`../../shared/hook-execution-event-message.cjs`);require(`./event-message-components/hook-execution-event-message.cjs`);const g=require(`./hooks/use-plan-preview-events.cjs`),_=require(`./event-thought-helpers.cjs`);let v=require(`react`);v=e.__toESM(v,1);let y=require(`react/jsx-runtime`);var b=e=>e.activated_skills||e.activated_microagents||[],x=e=>!e||e.length===0?!1:e.some(e=>e.type===`text`&&e.text.trim().length>0),S=e=>{let t=b(e).length>0,n=x(e.extended_content);return t&&n},C=(e,t,n)=>{try{let r=u.createSkillReadyEvent(e);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.UserAssistantEventMessage,{event:e,isLastMessage:!1,isFromPlanningAgent:t.isFromPlanningAgent}),(0,y.jsx)(f.GenericEventMessageWrapper,{event:r,isLastMessage:n})]})}catch{return(0,y.jsx)(l.UserAssistantEventMessage,{event:e,isLastMessage:n,isFromPlanningAgent:t.isFromPlanningAgent})}};function w({event:e,messages:u,isLastMessage:v,isInLast10Actions:b,planPreviewEventIds:x,suppressThought:w=!1}){let{data:T}=a.useConfig(),{planContent:E}=n.useConversationStore(),{curAgentState:D}=i.useAgentState(),O=D===t.AgentState.RUNNING||D===t.AgentState.LOADING,k=e.isFromPlanningAgent||!1,A={isLastMessage:v,isInLast10Actions:b,config:T,isFromPlanningAgent:k};if(r.isAgentErrorEvent(e))return(0,y.jsx)(c.ErrorEventMessage,{event:e,...A});if(r.isHookExecutionEvent(e))return(0,y.jsx)(h.HookExecutionEventMessage,{event:e});if(r.isACPToolCallEvent(e))return(0,y.jsx)(f.GenericEventMessageWrapper,{event:e,isLastMessage:v});if(r.isStreamingDeltaEvent(e)){let t=e.content??``,n=e.reasoning_content??``;return(0,y.jsxs)(y.Fragment,{children:[n&&(0,y.jsx)(m.CollapsibleThinking,{content:n}),t&&(0,y.jsx)(o.ChatMessage,{type:`agent`,message:t,isFromPlanningAgent:k})]})}if(r.isActionEvent(e)&&e.action.kind===`FinishAction`)return(0,y.jsx)(d.FinishEventMessage,{event:e,...A});if(r.isActionEvent(e)&&e.action.kind===`ThinkAction`)return(0,y.jsx)(m.CollapsibleThinking,{content:e.action.thought});if(r.isActionEvent(e)){let t=_.getReasoningContent(e);return(0,y.jsxs)(y.Fragment,{children:[t&&(0,y.jsx)(m.CollapsibleThinking,{content:t}),!w&&(0,y.jsx)(p.ThoughtEventMessage,{event:e,isFromPlanningAgent:k}),(0,y.jsx)(f.GenericEventMessageWrapper,{event:e,isLastMessage:v})]})}if(r.isObservationEvent(e)){if(r.isPlanningFileEditorObservationEvent(e))return x&&g.shouldShowPlanPreview(e.id,x)?(0,y.jsx)(s.PlanPreview,{planContent:E,isStreaming:v&&D===t.AgentState.RUNNING,isBuildDisabled:O}):null;let n=u.find(t=>r.isActionEvent(t)&&t.id===e.action_id),i=!w&&n&&r.isActionEvent(n)&&n.action.kind!==`ThinkAction`,a=n&&r.isActionEvent(n)?_.getReasoningContent(n):``;return(0,y.jsxs)(y.Fragment,{children:[a&&(0,y.jsx)(m.CollapsibleThinking,{content:a}),i&&(0,y.jsx)(p.ThoughtEventMessage,{event:n,isFromPlanningAgent:k}),(0,y.jsx)(f.GenericEventMessageWrapper,{event:e,isLastMessage:v,correspondingAction:n&&r.isActionEvent(n)?n:void 0})]})}if(!r.isActionEvent(e)&&!r.isObservationEvent(e)){let t=e;return r.isUserMessageEvent(e)&&S(t)?C(t,A,v):(0,y.jsx)(l.UserAssistantEventMessage,{event:t,...A,isLastMessage:v})}return(0,y.jsx)(f.GenericEventMessageWrapper,{event:e,isLastMessage:v})}exports.EventMessage=w;
2
2
  //# sourceMappingURL=event-message.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-message.cjs","names":[],"sources":["../../../../src/components/conversation-events/chat/event-message.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n OpenHandsEvent,\n MessageEvent,\n ActionEvent,\n} from \"#/types/agent-server/core\";\nimport {\n FinishAction,\n ThinkAction,\n} from \"#/types/agent-server/core/base/action\";\nimport {\n isActionEvent,\n isObservationEvent,\n isAgentErrorEvent,\n isUserMessageEvent,\n isPlanningFileEditorObservationEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n} from \"#/types/agent-server/type-guards\";\nimport { useConfig } from \"#/hooks/query/use-config\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { PlanPreview } from \"../../features/chat/plan-preview\";\nimport { ErrorEventMessage } from \"./event-message-components/error-event-message\";\nimport { UserAssistantEventMessage } from \"./event-message-components/user-assistant-event-message\";\nimport { FinishEventMessage } from \"./event-message-components/finish-event-message\";\nimport { GenericEventMessageWrapper } from \"./event-message-components/generic-event-message-wrapper\";\nimport { ThoughtEventMessage } from \"./event-message-components/thought-event-message\";\nimport { CollapsibleThinking } from \"./event-message-components/collapsible-thinking\";\nimport { HookExecutionEventMessage } from \"./event-message-components/hook-execution-event-message\";\nimport { createSkillReadyEvent } from \"./event-content-helpers/create-skill-ready-event\";\nimport { shouldShowPlanPreview } from \"./hooks/use-plan-preview-events\";\nimport { getReasoningContent } from \"./event-thought-helpers\";\n\ninterface EventMessageProps {\n event: OpenHandsEvent & { isFromPlanningAgent?: boolean };\n messages: OpenHandsEvent[];\n isLastMessage: boolean;\n isInLast10Actions: boolean;\n /** Set of event IDs that should render PlanPreview (one per user message phase) */\n planPreviewEventIds?: Set<string>;\n /**\n * When true, do not render the inline `ThoughtEventMessage` for action /\n * observation events. The caller is expected to render the thought\n * separately (e.g. via a hoisted \"thought\" rendered item) so the message\n * pane and the in-group rendering don't double up on the same content.\n * Has no effect on `ThinkAction`, whose thought IS its action body.\n */\n suppressThought?: boolean;\n}\n\n/**\n * Extracts activated skills from a MessageEvent, supporting both\n * activated_skills and activated_microagents field names.\n */\nconst getActivatedSkills = (event: MessageEvent): string[] =>\n (event as unknown as { activated_skills?: string[] }).activated_skills ||\n event.activated_microagents ||\n [];\n\n/**\n * Checks if extended content contains valid text content.\n */\nconst hasValidExtendedContent = (\n extendedContent: MessageEvent[\"extended_content\"],\n): boolean => {\n if (!extendedContent || extendedContent.length === 0) {\n return false;\n }\n\n return extendedContent.some(\n (content) => content.type === \"text\" && content.text.trim().length > 0,\n );\n};\n\n/**\n * Determines if a Skill Ready event should be displayed for the given message event.\n */\nconst shouldShowSkillReadyEvent = (messageEvent: MessageEvent): boolean => {\n const activatedSkills = getActivatedSkills(messageEvent);\n const hasActivatedSkills = activatedSkills.length > 0;\n const hasExtendedContent = hasValidExtendedContent(\n messageEvent.extended_content,\n );\n\n return hasActivatedSkills && hasExtendedContent;\n};\n\ninterface CommonProps {\n isLastMessage: boolean;\n isInLast10Actions: boolean;\n config: unknown;\n isFromPlanningAgent: boolean;\n}\n\n/**\n * Renders a user message with its corresponding Skill Ready event.\n */\nconst renderUserMessageWithSkillReady = (\n messageEvent: MessageEvent,\n commonProps: CommonProps,\n isLastMessage: boolean,\n): React.ReactElement => {\n try {\n const skillReadyEvent = createSkillReadyEvent(messageEvent);\n return (\n <>\n <UserAssistantEventMessage\n event={messageEvent}\n isLastMessage={false}\n isFromPlanningAgent={commonProps.isFromPlanningAgent}\n />\n <GenericEventMessageWrapper\n event={skillReadyEvent}\n isLastMessage={isLastMessage}\n />\n </>\n );\n } catch (error) {\n // If skill ready event creation fails, just render the user message\n return (\n <UserAssistantEventMessage\n event={messageEvent}\n isLastMessage={isLastMessage}\n isFromPlanningAgent={commonProps.isFromPlanningAgent}\n />\n );\n }\n};\n\nexport function EventMessage({\n event,\n messages,\n isLastMessage,\n isInLast10Actions,\n planPreviewEventIds,\n suppressThought = false,\n}: EventMessageProps) {\n const { data: config } = useConfig();\n const { planContent } = useConversationStore();\n const { curAgentState } = useAgentState();\n\n // Disable Build button while agent is running (streaming)\n const isAgentRunning =\n curAgentState === AgentState.RUNNING ||\n curAgentState === AgentState.LOADING;\n\n // Read isFromPlanningAgent directly from the event object\n const isFromPlanningAgent = event.isFromPlanningAgent || false;\n\n // Common props for components that need them\n const commonProps = {\n isLastMessage,\n isInLast10Actions,\n config,\n isFromPlanningAgent,\n };\n\n // Agent error events\n if (isAgentErrorEvent(event)) {\n return <ErrorEventMessage event={event} {...commonProps} />;\n }\n\n // Hook execution events\n if (isHookExecutionEvent(event)) {\n return <HookExecutionEventMessage event={event} />;\n }\n\n // ACP sub-agent tool call events (Claude Code, Codex, Gemini CLI, …)\n // render through the same generic wrapper used for observation events so\n // the card shape, success indicator and markdown rendering all match.\n if (isACPToolCallEvent(event)) {\n return (\n <GenericEventMessageWrapper event={event} isLastMessage={isLastMessage} />\n );\n }\n\n // Finish actions\n if (isActionEvent(event) && event.action.kind === \"FinishAction\") {\n return (\n <FinishEventMessage\n event={event as ActionEvent<FinishAction>}\n {...commonProps}\n />\n );\n }\n\n // ThinkAction - render the thought inside a collapsible section so it\n // doesn't dominate the chat, especially when the thinking language\n // (usually English) differs from the conversation language.\n if (isActionEvent(event) && event.action.kind === \"ThinkAction\") {\n const thinkAction = event as ActionEvent<ThinkAction>;\n return <CollapsibleThinking content={thinkAction.action.thought} />;\n }\n\n // Action events - render thought + action (will be replaced by thought + observation)\n if (isActionEvent(event)) {\n const reasoningContent = getReasoningContent(event);\n return (\n <>\n {reasoningContent && <CollapsibleThinking content={reasoningContent} />}\n {!suppressThought && (\n <ThoughtEventMessage\n event={event}\n isFromPlanningAgent={isFromPlanningAgent}\n />\n )}\n <GenericEventMessageWrapper\n event={event}\n isLastMessage={isLastMessage}\n />\n </>\n );\n }\n\n // Observation events - find the corresponding action and render thought + observation\n if (isObservationEvent(event)) {\n // Handle PlanningFileEditorObservation specially\n if (isPlanningFileEditorObservationEvent(event)) {\n // Only show PlanPreview if this event is marked as the one to display\n // (last PlanningFileEditorObservation in its phase)\n if (\n planPreviewEventIds &&\n shouldShowPlanPreview(event.id, planPreviewEventIds)\n ) {\n // Show shine effect only if this is the last message AND agent is running\n const isStreaming =\n isLastMessage && curAgentState === AgentState.RUNNING;\n return (\n <PlanPreview\n planContent={planContent}\n isStreaming={isStreaming}\n isBuildDisabled={isAgentRunning}\n />\n );\n }\n // Not the designated preview event for this phase - render nothing\n // This prevents duplicate previews within the same phase\n return null;\n }\n\n // Find the action that this observation is responding to\n const correspondingAction = messages.find(\n (msg) => isActionEvent(msg) && msg.id === event.action_id,\n );\n\n // Skip ThoughtEventMessage for ThinkAction (thought IS the action)\n const shouldShowThought =\n !suppressThought &&\n correspondingAction &&\n isActionEvent(correspondingAction) &&\n correspondingAction.action.kind !== \"ThinkAction\";\n\n const reasoningContent =\n correspondingAction && isActionEvent(correspondingAction)\n ? getReasoningContent(correspondingAction)\n : \"\";\n\n return (\n <>\n {reasoningContent && <CollapsibleThinking content={reasoningContent} />}\n {shouldShowThought && (\n <ThoughtEventMessage\n event={correspondingAction}\n isFromPlanningAgent={isFromPlanningAgent}\n />\n )}\n <GenericEventMessageWrapper\n event={event}\n isLastMessage={isLastMessage}\n correspondingAction={\n correspondingAction && isActionEvent(correspondingAction)\n ? correspondingAction\n : undefined\n }\n />\n </>\n );\n }\n\n // Message events (user and assistant messages)\n if (!isActionEvent(event) && !isObservationEvent(event)) {\n const messageEvent = event as MessageEvent;\n\n // Check if this is a user message that should display a Skill Ready event\n if (isUserMessageEvent(event) && shouldShowSkillReadyEvent(messageEvent)) {\n return renderUserMessageWithSkillReady(\n messageEvent,\n commonProps,\n isLastMessage,\n );\n }\n\n // Render normal message event (user or assistant)\n return (\n <UserAssistantEventMessage\n event={messageEvent}\n {...commonProps}\n isLastMessage={isLastMessage}\n />\n );\n }\n\n // Generic fallback for all other events\n return (\n <GenericEventMessageWrapper event={event} isLastMessage={isLastMessage} />\n );\n}\n"],"mappings":"6mCAwDA,IAAM,EAAsB,GACzB,EAAqD,kBACtD,EAAM,uBACN,EAAE,CAKE,EACJ,GAEI,CAAC,GAAmB,EAAgB,SAAW,EAC1C,GAGF,EAAgB,KACpB,GAAY,EAAQ,OAAS,QAAU,EAAQ,KAAK,MAAM,CAAC,OAAS,EACtE,CAMG,EAA6B,GAAwC,CAEzE,IAAM,EADkB,EAAmB,EAChB,CAAgB,OAAS,EAC9C,EAAqB,EACzB,EAAa,iBACd,CAED,OAAO,GAAsB,GAazB,GACJ,EACA,EACA,IACuB,CACvB,GAAI,CACF,IAAM,EAAkB,EAAA,sBAAsB,EAAa,CAC3D,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACP,cAAe,GACf,oBAAqB,EAAY,oBACjC,CAAA,EACF,EAAA,EAAA,KAAC,EAAA,2BAAD,CACE,MAAO,EACQ,gBACf,CAAA,CACD,CAAA,CAAA,MAES,CAEd,OACE,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACQ,gBACf,oBAAqB,EAAY,oBACjC,CAAA,GAKR,SAAgB,EAAa,CAC3B,QACA,WACA,gBACA,oBACA,sBACA,kBAAkB,IACE,CACpB,GAAM,CAAE,KAAM,GAAW,EAAA,WAAW,CAC9B,CAAE,eAAgB,EAAA,sBAAsB,CACxC,CAAE,iBAAkB,EAAA,eAAe,CAGnC,EACJ,IAAkB,EAAA,WAAW,SAC7B,IAAkB,EAAA,WAAW,QAGzB,EAAsB,EAAM,qBAAuB,GAGnD,EAAc,CAClB,gBACA,oBACA,SACA,sBACD,CAGD,GAAI,EAAA,kBAAkB,EAAM,CAC1B,OAAO,EAAA,EAAA,KAAC,EAAA,kBAAD,CAA0B,QAAO,GAAI,EAAe,CAAA,CAI7D,GAAI,EAAA,qBAAqB,EAAM,CAC7B,OAAO,EAAA,EAAA,KAAC,EAAA,0BAAD,CAAkC,QAAS,CAAA,CAMpD,GAAI,EAAA,mBAAmB,EAAM,CAC3B,OACE,EAAA,EAAA,KAAC,EAAA,2BAAD,CAAmC,QAAsB,gBAAiB,CAAA,CAK9E,GAAI,EAAA,cAAc,EAAM,EAAI,EAAM,OAAO,OAAS,eAChD,OACE,EAAA,EAAA,KAAC,EAAA,mBAAD,CACS,QACP,GAAI,EACJ,CAAA,CAON,GAAI,EAAA,cAAc,EAAM,EAAI,EAAM,OAAO,OAAS,cAEhD,OAAO,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAY,OAAO,QAAW,CAAA,CAIrE,GAAI,EAAA,cAAc,EAAM,CAAE,CACxB,IAAM,EAAmB,EAAA,oBAAoB,EAAM,CACnD,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAoB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAoB,CAAA,CACtE,CAAC,IACA,EAAA,EAAA,KAAC,EAAA,oBAAD,CACS,QACc,sBACrB,CAAA,EAEJ,EAAA,EAAA,KAAC,EAAA,2BAAD,CACS,QACQ,gBACf,CAAA,CACD,CAAA,CAAA,CAKP,GAAI,EAAA,mBAAmB,EAAM,CAAE,CAE7B,GAAI,EAAA,qCAAqC,EAAM,CAoB7C,OAhBE,GACA,EAAA,sBAAsB,EAAM,GAAI,EAAoB,EAMlD,EAAA,EAAA,KAAC,EAAA,YAAD,CACe,cACA,YAJf,GAAiB,IAAkB,EAAA,WAAW,QAK5C,gBAAiB,EACjB,CAAA,CAKC,KAIT,IAAM,EAAsB,EAAS,KAClC,GAAQ,EAAA,cAAc,EAAI,EAAI,EAAI,KAAO,EAAM,UACjD,CAGK,EACJ,CAAC,GACD,GACA,EAAA,cAAc,EAAoB,EAClC,EAAoB,OAAO,OAAS,cAEhC,EACJ,GAAuB,EAAA,cAAc,EAAoB,CACrD,EAAA,oBAAoB,EAAoB,CACxC,GAEN,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAoB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAoB,CAAA,CACtE,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,MAAO,EACc,sBACrB,CAAA,EAEJ,EAAA,EAAA,KAAC,EAAA,2BAAD,CACS,QACQ,gBACf,oBACE,GAAuB,EAAA,cAAc,EAAoB,CACrD,EACA,IAAA,GAEN,CAAA,CACD,CAAA,CAAA,CAKP,GAAI,CAAC,EAAA,cAAc,EAAM,EAAI,CAAC,EAAA,mBAAmB,EAAM,CAAE,CACvD,IAAM,EAAe,EAYrB,OATI,EAAA,mBAAmB,EAAM,EAAI,EAA0B,EAAa,CAC/D,EACL,EACA,EACA,EACD,EAKD,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACP,GAAI,EACW,gBACf,CAAA,CAKN,OACE,EAAA,EAAA,KAAC,EAAA,2BAAD,CAAmC,QAAsB,gBAAiB,CAAA"}
1
+ {"version":3,"file":"event-message.cjs","names":[],"sources":["../../../../src/components/conversation-events/chat/event-message.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n OpenHandsEvent,\n MessageEvent,\n ActionEvent,\n} from \"#/types/agent-server/core\";\nimport {\n FinishAction,\n ThinkAction,\n} from \"#/types/agent-server/core/base/action\";\nimport {\n isActionEvent,\n isObservationEvent,\n isAgentErrorEvent,\n isUserMessageEvent,\n isPlanningFileEditorObservationEvent,\n isHookExecutionEvent,\n isACPToolCallEvent,\n isStreamingDeltaEvent,\n} from \"#/types/agent-server/type-guards\";\nimport { useConfig } from \"#/hooks/query/use-config\";\nimport { useConversationStore } from \"#/stores/conversation-store\";\nimport { useAgentState } from \"#/hooks/use-agent-state\";\nimport { AgentState } from \"#/types/agent-state\";\nimport { ChatMessage } from \"#/components/features/chat/chat-message\";\nimport { PlanPreview } from \"../../features/chat/plan-preview\";\nimport { ErrorEventMessage } from \"./event-message-components/error-event-message\";\nimport { UserAssistantEventMessage } from \"./event-message-components/user-assistant-event-message\";\nimport { FinishEventMessage } from \"./event-message-components/finish-event-message\";\nimport { GenericEventMessageWrapper } from \"./event-message-components/generic-event-message-wrapper\";\nimport { ThoughtEventMessage } from \"./event-message-components/thought-event-message\";\nimport { CollapsibleThinking } from \"./event-message-components/collapsible-thinking\";\nimport { HookExecutionEventMessage } from \"./event-message-components/hook-execution-event-message\";\nimport { createSkillReadyEvent } from \"./event-content-helpers/create-skill-ready-event\";\nimport { shouldShowPlanPreview } from \"./hooks/use-plan-preview-events\";\nimport { getReasoningContent } from \"./event-thought-helpers\";\n\ninterface EventMessageProps {\n event: OpenHandsEvent & { isFromPlanningAgent?: boolean };\n messages: OpenHandsEvent[];\n isLastMessage: boolean;\n isInLast10Actions: boolean;\n /** Set of event IDs that should render PlanPreview (one per user message phase) */\n planPreviewEventIds?: Set<string>;\n /**\n * When true, do not render the inline `ThoughtEventMessage` for action /\n * observation events. The caller is expected to render the thought\n * separately (e.g. via a hoisted \"thought\" rendered item) so the message\n * pane and the in-group rendering don't double up on the same content.\n * Has no effect on `ThinkAction`, whose thought IS its action body.\n */\n suppressThought?: boolean;\n}\n\n/**\n * Extracts activated skills from a MessageEvent, supporting both\n * activated_skills and activated_microagents field names.\n */\nconst getActivatedSkills = (event: MessageEvent): string[] =>\n (event as unknown as { activated_skills?: string[] }).activated_skills ||\n event.activated_microagents ||\n [];\n\n/**\n * Checks if extended content contains valid text content.\n */\nconst hasValidExtendedContent = (\n extendedContent: MessageEvent[\"extended_content\"],\n): boolean => {\n if (!extendedContent || extendedContent.length === 0) {\n return false;\n }\n\n return extendedContent.some(\n (content) => content.type === \"text\" && content.text.trim().length > 0,\n );\n};\n\n/**\n * Determines if a Skill Ready event should be displayed for the given message event.\n */\nconst shouldShowSkillReadyEvent = (messageEvent: MessageEvent): boolean => {\n const activatedSkills = getActivatedSkills(messageEvent);\n const hasActivatedSkills = activatedSkills.length > 0;\n const hasExtendedContent = hasValidExtendedContent(\n messageEvent.extended_content,\n );\n\n return hasActivatedSkills && hasExtendedContent;\n};\n\ninterface CommonProps {\n isLastMessage: boolean;\n isInLast10Actions: boolean;\n config: unknown;\n isFromPlanningAgent: boolean;\n}\n\n/**\n * Renders a user message with its corresponding Skill Ready event.\n */\nconst renderUserMessageWithSkillReady = (\n messageEvent: MessageEvent,\n commonProps: CommonProps,\n isLastMessage: boolean,\n): React.ReactElement => {\n try {\n const skillReadyEvent = createSkillReadyEvent(messageEvent);\n return (\n <>\n <UserAssistantEventMessage\n event={messageEvent}\n isLastMessage={false}\n isFromPlanningAgent={commonProps.isFromPlanningAgent}\n />\n <GenericEventMessageWrapper\n event={skillReadyEvent}\n isLastMessage={isLastMessage}\n />\n </>\n );\n } catch (error) {\n // If skill ready event creation fails, just render the user message\n return (\n <UserAssistantEventMessage\n event={messageEvent}\n isLastMessage={isLastMessage}\n isFromPlanningAgent={commonProps.isFromPlanningAgent}\n />\n );\n }\n};\n\nexport function EventMessage({\n event,\n messages,\n isLastMessage,\n isInLast10Actions,\n planPreviewEventIds,\n suppressThought = false,\n}: EventMessageProps) {\n const { data: config } = useConfig();\n const { planContent } = useConversationStore();\n const { curAgentState } = useAgentState();\n\n // Disable Build button while agent is running (streaming)\n const isAgentRunning =\n curAgentState === AgentState.RUNNING ||\n curAgentState === AgentState.LOADING;\n\n // Read isFromPlanningAgent directly from the event object\n const isFromPlanningAgent = event.isFromPlanningAgent || false;\n\n // Common props for components that need them\n const commonProps = {\n isLastMessage,\n isInLast10Actions,\n config,\n isFromPlanningAgent,\n };\n\n // Agent error events\n if (isAgentErrorEvent(event)) {\n return <ErrorEventMessage event={event} {...commonProps} />;\n }\n\n // Hook execution events\n if (isHookExecutionEvent(event)) {\n return <HookExecutionEventMessage event={event} />;\n }\n\n // ACP sub-agent tool call events (Claude Code, Codex, Gemini CLI, …)\n // render through the same generic wrapper used for observation events so\n // the card shape, success indicator and markdown rendering all match.\n if (isACPToolCallEvent(event)) {\n return (\n <GenericEventMessageWrapper event={event} isLastMessage={isLastMessage} />\n );\n }\n\n if (isStreamingDeltaEvent(event)) {\n const content = event.content ?? \"\";\n const reasoningContent = event.reasoning_content ?? \"\";\n return (\n <>\n {reasoningContent && <CollapsibleThinking content={reasoningContent} />}\n {content && (\n <ChatMessage\n type=\"agent\"\n message={content}\n isFromPlanningAgent={isFromPlanningAgent}\n />\n )}\n </>\n );\n }\n\n // Finish actions\n if (isActionEvent(event) && event.action.kind === \"FinishAction\") {\n return (\n <FinishEventMessage\n event={event as ActionEvent<FinishAction>}\n {...commonProps}\n />\n );\n }\n\n // ThinkAction - render the thought inside a collapsible section so it\n // doesn't dominate the chat, especially when the thinking language\n // (usually English) differs from the conversation language.\n if (isActionEvent(event) && event.action.kind === \"ThinkAction\") {\n const thinkAction = event as ActionEvent<ThinkAction>;\n return <CollapsibleThinking content={thinkAction.action.thought} />;\n }\n\n // Action events - render thought + action (will be replaced by thought + observation)\n if (isActionEvent(event)) {\n const reasoningContent = getReasoningContent(event);\n return (\n <>\n {reasoningContent && <CollapsibleThinking content={reasoningContent} />}\n {!suppressThought && (\n <ThoughtEventMessage\n event={event}\n isFromPlanningAgent={isFromPlanningAgent}\n />\n )}\n <GenericEventMessageWrapper\n event={event}\n isLastMessage={isLastMessage}\n />\n </>\n );\n }\n\n // Observation events - find the corresponding action and render thought + observation\n if (isObservationEvent(event)) {\n // Handle PlanningFileEditorObservation specially\n if (isPlanningFileEditorObservationEvent(event)) {\n // Only show PlanPreview if this event is marked as the one to display\n // (last PlanningFileEditorObservation in its phase)\n if (\n planPreviewEventIds &&\n shouldShowPlanPreview(event.id, planPreviewEventIds)\n ) {\n // Show shine effect only if this is the last message AND agent is running\n const isStreaming =\n isLastMessage && curAgentState === AgentState.RUNNING;\n return (\n <PlanPreview\n planContent={planContent}\n isStreaming={isStreaming}\n isBuildDisabled={isAgentRunning}\n />\n );\n }\n // Not the designated preview event for this phase - render nothing\n // This prevents duplicate previews within the same phase\n return null;\n }\n\n // Find the action that this observation is responding to\n const correspondingAction = messages.find(\n (msg) => isActionEvent(msg) && msg.id === event.action_id,\n );\n\n // Skip ThoughtEventMessage for ThinkAction (thought IS the action)\n const shouldShowThought =\n !suppressThought &&\n correspondingAction &&\n isActionEvent(correspondingAction) &&\n correspondingAction.action.kind !== \"ThinkAction\";\n\n const reasoningContent =\n correspondingAction && isActionEvent(correspondingAction)\n ? getReasoningContent(correspondingAction)\n : \"\";\n\n return (\n <>\n {reasoningContent && <CollapsibleThinking content={reasoningContent} />}\n {shouldShowThought && (\n <ThoughtEventMessage\n event={correspondingAction}\n isFromPlanningAgent={isFromPlanningAgent}\n />\n )}\n <GenericEventMessageWrapper\n event={event}\n isLastMessage={isLastMessage}\n correspondingAction={\n correspondingAction && isActionEvent(correspondingAction)\n ? correspondingAction\n : undefined\n }\n />\n </>\n );\n }\n\n // Message events (user and assistant messages)\n if (!isActionEvent(event) && !isObservationEvent(event)) {\n const messageEvent = event as MessageEvent;\n\n // Check if this is a user message that should display a Skill Ready event\n if (isUserMessageEvent(event) && shouldShowSkillReadyEvent(messageEvent)) {\n return renderUserMessageWithSkillReady(\n messageEvent,\n commonProps,\n isLastMessage,\n );\n }\n\n // Render normal message event (user or assistant)\n return (\n <UserAssistantEventMessage\n event={messageEvent}\n {...commonProps}\n isLastMessage={isLastMessage}\n />\n );\n }\n\n // Generic fallback for all other events\n return (\n <GenericEventMessageWrapper event={event} isLastMessage={isLastMessage} />\n );\n}\n"],"mappings":"+pCA0DA,IAAM,EAAsB,GACzB,EAAqD,kBACtD,EAAM,uBACN,EAAE,CAKE,EACJ,GAEI,CAAC,GAAmB,EAAgB,SAAW,EAC1C,GAGF,EAAgB,KACpB,GAAY,EAAQ,OAAS,QAAU,EAAQ,KAAK,MAAM,CAAC,OAAS,EACtE,CAMG,EAA6B,GAAwC,CAEzE,IAAM,EADkB,EAAmB,EAChB,CAAgB,OAAS,EAC9C,EAAqB,EACzB,EAAa,iBACd,CAED,OAAO,GAAsB,GAazB,GACJ,EACA,EACA,IACuB,CACvB,GAAI,CACF,IAAM,EAAkB,EAAA,sBAAsB,EAAa,CAC3D,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,EACE,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACP,cAAe,GACf,oBAAqB,EAAY,oBACjC,CAAA,EACF,EAAA,EAAA,KAAC,EAAA,2BAAD,CACE,MAAO,EACQ,gBACf,CAAA,CACD,CAAA,CAAA,MAES,CAEd,OACE,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACQ,gBACf,oBAAqB,EAAY,oBACjC,CAAA,GAKR,SAAgB,EAAa,CAC3B,QACA,WACA,gBACA,oBACA,sBACA,kBAAkB,IACE,CACpB,GAAM,CAAE,KAAM,GAAW,EAAA,WAAW,CAC9B,CAAE,eAAgB,EAAA,sBAAsB,CACxC,CAAE,iBAAkB,EAAA,eAAe,CAGnC,EACJ,IAAkB,EAAA,WAAW,SAC7B,IAAkB,EAAA,WAAW,QAGzB,EAAsB,EAAM,qBAAuB,GAGnD,EAAc,CAClB,gBACA,oBACA,SACA,sBACD,CAGD,GAAI,EAAA,kBAAkB,EAAM,CAC1B,OAAO,EAAA,EAAA,KAAC,EAAA,kBAAD,CAA0B,QAAO,GAAI,EAAe,CAAA,CAI7D,GAAI,EAAA,qBAAqB,EAAM,CAC7B,OAAO,EAAA,EAAA,KAAC,EAAA,0BAAD,CAAkC,QAAS,CAAA,CAMpD,GAAI,EAAA,mBAAmB,EAAM,CAC3B,OACE,EAAA,EAAA,KAAC,EAAA,2BAAD,CAAmC,QAAsB,gBAAiB,CAAA,CAI9E,GAAI,EAAA,sBAAsB,EAAM,CAAE,CAChC,IAAM,EAAU,EAAM,SAAW,GAC3B,EAAmB,EAAM,mBAAqB,GACpD,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAoB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAoB,CAAA,CACtE,IACC,EAAA,EAAA,KAAC,EAAA,YAAD,CACE,KAAK,QACL,QAAS,EACY,sBACrB,CAAA,CAEH,CAAA,CAAA,CAKP,GAAI,EAAA,cAAc,EAAM,EAAI,EAAM,OAAO,OAAS,eAChD,OACE,EAAA,EAAA,KAAC,EAAA,mBAAD,CACS,QACP,GAAI,EACJ,CAAA,CAON,GAAI,EAAA,cAAc,EAAM,EAAI,EAAM,OAAO,OAAS,cAEhD,OAAO,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAY,OAAO,QAAW,CAAA,CAIrE,GAAI,EAAA,cAAc,EAAM,CAAE,CACxB,IAAM,EAAmB,EAAA,oBAAoB,EAAM,CACnD,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAoB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAoB,CAAA,CACtE,CAAC,IACA,EAAA,EAAA,KAAC,EAAA,oBAAD,CACS,QACc,sBACrB,CAAA,EAEJ,EAAA,EAAA,KAAC,EAAA,2BAAD,CACS,QACQ,gBACf,CAAA,CACD,CAAA,CAAA,CAKP,GAAI,EAAA,mBAAmB,EAAM,CAAE,CAE7B,GAAI,EAAA,qCAAqC,EAAM,CAoB7C,OAhBE,GACA,EAAA,sBAAsB,EAAM,GAAI,EAAoB,EAMlD,EAAA,EAAA,KAAC,EAAA,YAAD,CACe,cACA,YAJf,GAAiB,IAAkB,EAAA,WAAW,QAK5C,gBAAiB,EACjB,CAAA,CAKC,KAIT,IAAM,EAAsB,EAAS,KAClC,GAAQ,EAAA,cAAc,EAAI,EAAI,EAAI,KAAO,EAAM,UACjD,CAGK,EACJ,CAAC,GACD,GACA,EAAA,cAAc,EAAoB,EAClC,EAAoB,OAAO,OAAS,cAEhC,EACJ,GAAuB,EAAA,cAAc,EAAoB,CACrD,EAAA,oBAAoB,EAAoB,CACxC,GAEN,OACE,EAAA,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,CACG,IAAoB,EAAA,EAAA,KAAC,EAAA,oBAAD,CAAqB,QAAS,EAAoB,CAAA,CACtE,IACC,EAAA,EAAA,KAAC,EAAA,oBAAD,CACE,MAAO,EACc,sBACrB,CAAA,EAEJ,EAAA,EAAA,KAAC,EAAA,2BAAD,CACS,QACQ,gBACf,oBACE,GAAuB,EAAA,cAAc,EAAoB,CACrD,EACA,IAAA,GAEN,CAAA,CACD,CAAA,CAAA,CAKP,GAAI,CAAC,EAAA,cAAc,EAAM,EAAI,CAAC,EAAA,mBAAmB,EAAM,CAAE,CACvD,IAAM,EAAe,EAYrB,OATI,EAAA,mBAAmB,EAAM,EAAI,EAA0B,EAAa,CAC/D,EACL,EACA,EACA,EACD,EAKD,EAAA,EAAA,KAAC,EAAA,0BAAD,CACE,MAAO,EACP,GAAI,EACW,gBACf,CAAA,CAKN,OACE,EAAA,EAAA,KAAC,EAAA,2BAAD,CAAmC,QAAsB,gBAAiB,CAAA"}
@@ -1,114 +1,123 @@
1
1
  import { AgentState as e } from "../../../types/agent-state.js";
2
2
  import { useConversationStore as t } from "../../../stores/conversation-store.js";
3
- import { isACPToolCallEvent as n, isActionEvent as r, isAgentErrorEvent as i, isHookExecutionEvent as a, isObservationEvent as o, isPlanningFileEditorObservationEvent as s, isUserMessageEvent as c } from "../../../types/agent-server/type-guards.js";
4
- import { useAgentState as l } from "../../../hooks/use-agent-state.js";
5
- import { useConfig as u } from "../../../hooks/query/use-config.js";
6
- import { PlanPreview as d } from "../../features/chat/plan-preview.js";
7
- import { ErrorEventMessage as f } from "./event-message-components/error-event-message.js";
8
- import { UserAssistantEventMessage as p } from "./event-message-components/user-assistant-event-message.js";
9
- import { createSkillReadyEvent as m } from "./event-content-helpers/create-skill-ready-event.js";
10
- import { FinishEventMessage as h } from "./event-message-components/finish-event-message.js";
11
- import { GenericEventMessageWrapper as g } from "./event-message-components/generic-event-message-wrapper.js";
12
- import { ThoughtEventMessage as _ } from "./event-message-components/thought-event-message.js";
13
- import { CollapsibleThinking as v } from "./event-message-components/collapsible-thinking.js";
14
- import { HookExecutionEventMessage as y } from "../../shared/hook-execution-event-message.js";
3
+ import { isACPToolCallEvent as n, isActionEvent as r, isAgentErrorEvent as i, isHookExecutionEvent as a, isObservationEvent as o, isPlanningFileEditorObservationEvent as s, isStreamingDeltaEvent as c, isUserMessageEvent as l } from "../../../types/agent-server/type-guards.js";
4
+ import { useAgentState as u } from "../../../hooks/use-agent-state.js";
5
+ import { useConfig as d } from "../../../hooks/query/use-config.js";
6
+ import { ChatMessage as f } from "../../features/chat/chat-message.js";
7
+ import { PlanPreview as p } from "../../features/chat/plan-preview.js";
8
+ import { ErrorEventMessage as m } from "./event-message-components/error-event-message.js";
9
+ import { UserAssistantEventMessage as h } from "./event-message-components/user-assistant-event-message.js";
10
+ import { createSkillReadyEvent as g } from "./event-content-helpers/create-skill-ready-event.js";
11
+ import { FinishEventMessage as _ } from "./event-message-components/finish-event-message.js";
12
+ import { GenericEventMessageWrapper as v } from "./event-message-components/generic-event-message-wrapper.js";
13
+ import { ThoughtEventMessage as y } from "./event-message-components/thought-event-message.js";
14
+ import { CollapsibleThinking as b } from "./event-message-components/collapsible-thinking.js";
15
+ import { HookExecutionEventMessage as x } from "../../shared/hook-execution-event-message.js";
15
16
  import "./event-message-components/hook-execution-event-message.js";
16
- import { shouldShowPlanPreview as b } from "./hooks/use-plan-preview-events.js";
17
- import { getReasoningContent as x } from "./event-thought-helpers.js";
17
+ import { shouldShowPlanPreview as S } from "./hooks/use-plan-preview-events.js";
18
+ import { getReasoningContent as C } from "./event-thought-helpers.js";
18
19
  import "react";
19
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
20
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
20
21
  //#region src/components/conversation-events/chat/event-message.tsx
21
- var T = (e) => e.activated_skills || e.activated_microagents || [], E = (e) => !e || e.length === 0 ? !1 : e.some((e) => e.type === "text" && e.text.trim().length > 0), D = (e) => {
22
- let t = T(e).length > 0, n = E(e.extended_content);
22
+ var D = (e) => e.activated_skills || e.activated_microagents || [], O = (e) => !e || e.length === 0 ? !1 : e.some((e) => e.type === "text" && e.text.trim().length > 0), k = (e) => {
23
+ let t = D(e).length > 0, n = O(e.extended_content);
23
24
  return t && n;
24
- }, O = (e, t, n) => {
25
+ }, A = (e, t, n) => {
25
26
  try {
26
- let r = m(e);
27
- return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(p, {
27
+ let r = g(e);
28
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(h, {
28
29
  event: e,
29
30
  isLastMessage: !1,
30
31
  isFromPlanningAgent: t.isFromPlanningAgent
31
- }), /* @__PURE__ */ C(g, {
32
+ }), /* @__PURE__ */ T(v, {
32
33
  event: r,
33
34
  isLastMessage: n
34
35
  })] });
35
36
  } catch {
36
- return /* @__PURE__ */ C(p, {
37
+ return /* @__PURE__ */ T(h, {
37
38
  event: e,
38
39
  isLastMessage: n,
39
40
  isFromPlanningAgent: t.isFromPlanningAgent
40
41
  });
41
42
  }
42
43
  };
43
- function k({ event: m, messages: T, isLastMessage: E, isInLast10Actions: k, planPreviewEventIds: A, suppressThought: j = !1 }) {
44
- let { data: M } = u(), { planContent: N } = t(), { curAgentState: P } = l(), F = P === e.RUNNING || P === e.LOADING, I = m.isFromPlanningAgent || !1, L = {
45
- isLastMessage: E,
46
- isInLast10Actions: k,
47
- config: M,
48
- isFromPlanningAgent: I
44
+ function j({ event: g, messages: D, isLastMessage: O, isInLast10Actions: j, planPreviewEventIds: M, suppressThought: N = !1 }) {
45
+ let { data: P } = d(), { planContent: F } = t(), { curAgentState: I } = u(), L = I === e.RUNNING || I === e.LOADING, R = g.isFromPlanningAgent || !1, z = {
46
+ isLastMessage: O,
47
+ isInLast10Actions: j,
48
+ config: P,
49
+ isFromPlanningAgent: R
49
50
  };
50
- if (i(m)) return /* @__PURE__ */ C(f, {
51
- event: m,
52
- ...L
51
+ if (i(g)) return /* @__PURE__ */ T(m, {
52
+ event: g,
53
+ ...z
53
54
  });
54
- if (a(m)) return /* @__PURE__ */ C(y, { event: m });
55
- if (n(m)) return /* @__PURE__ */ C(g, {
56
- event: m,
57
- isLastMessage: E
55
+ if (a(g)) return /* @__PURE__ */ T(x, { event: g });
56
+ if (n(g)) return /* @__PURE__ */ T(v, {
57
+ event: g,
58
+ isLastMessage: O
58
59
  });
59
- if (r(m) && m.action.kind === "FinishAction") return /* @__PURE__ */ C(h, {
60
- event: m,
61
- ...L
60
+ if (c(g)) {
61
+ let e = g.content ?? "", t = g.reasoning_content ?? "";
62
+ return /* @__PURE__ */ E(w, { children: [t && /* @__PURE__ */ T(b, { content: t }), e && /* @__PURE__ */ T(f, {
63
+ type: "agent",
64
+ message: e,
65
+ isFromPlanningAgent: R
66
+ })] });
67
+ }
68
+ if (r(g) && g.action.kind === "FinishAction") return /* @__PURE__ */ T(_, {
69
+ event: g,
70
+ ...z
62
71
  });
63
- if (r(m) && m.action.kind === "ThinkAction") return /* @__PURE__ */ C(v, { content: m.action.thought });
64
- if (r(m)) {
65
- let e = x(m);
66
- return /* @__PURE__ */ w(S, { children: [
67
- e && /* @__PURE__ */ C(v, { content: e }),
68
- !j && /* @__PURE__ */ C(_, {
69
- event: m,
70
- isFromPlanningAgent: I
72
+ if (r(g) && g.action.kind === "ThinkAction") return /* @__PURE__ */ T(b, { content: g.action.thought });
73
+ if (r(g)) {
74
+ let e = C(g);
75
+ return /* @__PURE__ */ E(w, { children: [
76
+ e && /* @__PURE__ */ T(b, { content: e }),
77
+ !N && /* @__PURE__ */ T(y, {
78
+ event: g,
79
+ isFromPlanningAgent: R
71
80
  }),
72
- /* @__PURE__ */ C(g, {
73
- event: m,
74
- isLastMessage: E
81
+ /* @__PURE__ */ T(v, {
82
+ event: g,
83
+ isLastMessage: O
75
84
  })
76
85
  ] });
77
86
  }
78
- if (o(m)) {
79
- if (s(m)) return A && b(m.id, A) ? /* @__PURE__ */ C(d, {
80
- planContent: N,
81
- isStreaming: E && P === e.RUNNING,
82
- isBuildDisabled: F
87
+ if (o(g)) {
88
+ if (s(g)) return M && S(g.id, M) ? /* @__PURE__ */ T(p, {
89
+ planContent: F,
90
+ isStreaming: O && I === e.RUNNING,
91
+ isBuildDisabled: L
83
92
  }) : null;
84
- let t = T.find((e) => r(e) && e.id === m.action_id), n = !j && t && r(t) && t.action.kind !== "ThinkAction", i = t && r(t) ? x(t) : "";
85
- return /* @__PURE__ */ w(S, { children: [
86
- i && /* @__PURE__ */ C(v, { content: i }),
87
- n && /* @__PURE__ */ C(_, {
93
+ let t = D.find((e) => r(e) && e.id === g.action_id), n = !N && t && r(t) && t.action.kind !== "ThinkAction", i = t && r(t) ? C(t) : "";
94
+ return /* @__PURE__ */ E(w, { children: [
95
+ i && /* @__PURE__ */ T(b, { content: i }),
96
+ n && /* @__PURE__ */ T(y, {
88
97
  event: t,
89
- isFromPlanningAgent: I
98
+ isFromPlanningAgent: R
90
99
  }),
91
- /* @__PURE__ */ C(g, {
92
- event: m,
93
- isLastMessage: E,
100
+ /* @__PURE__ */ T(v, {
101
+ event: g,
102
+ isLastMessage: O,
94
103
  correspondingAction: t && r(t) ? t : void 0
95
104
  })
96
105
  ] });
97
106
  }
98
- if (!r(m) && !o(m)) {
99
- let e = m;
100
- return c(m) && D(e) ? O(e, L, E) : /* @__PURE__ */ C(p, {
107
+ if (!r(g) && !o(g)) {
108
+ let e = g;
109
+ return l(g) && k(e) ? A(e, z, O) : /* @__PURE__ */ T(h, {
101
110
  event: e,
102
- ...L,
103
- isLastMessage: E
111
+ ...z,
112
+ isLastMessage: O
104
113
  });
105
114
  }
106
- return /* @__PURE__ */ C(g, {
107
- event: m,
108
- isLastMessage: E
115
+ return /* @__PURE__ */ T(v, {
116
+ event: g,
117
+ isLastMessage: O
109
118
  });
110
119
  }
111
120
  //#endregion
112
- export { k as EventMessage };
121
+ export { j as EventMessage };
113
122
 
114
123
  //# sourceMappingURL=event-message.js.map