@vertesia/ui 1.4.0-dev.20260615.051508Z → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/lib/core/components/shadcn/dropdown.d.ts.map +1 -1
  2. package/lib/core/components/shadcn/dropdown.js +6 -2
  3. package/lib/core/components/shadcn/dropdown.js.map +1 -1
  4. package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  5. package/lib/core/components/shadcn/filters/filterBar.js +9 -2
  6. package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
  7. package/lib/core/components/shadcn/modal/ConfirmModal.d.ts +16 -1
  8. package/lib/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -1
  9. package/lib/core/components/shadcn/modal/ConfirmModal.js +25 -3
  10. package/lib/core/components/shadcn/modal/ConfirmModal.js.map +1 -1
  11. package/lib/core/components/shadcn/modal/dialog.js +1 -1
  12. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  13. package/lib/core/components/shadcn/popover.d.ts.map +1 -1
  14. package/lib/core/components/shadcn/popover.js +3 -1
  15. package/lib/core/components/shadcn/popover.js.map +1 -1
  16. package/lib/core/components/shadcn/switch.js +3 -3
  17. package/lib/core/components/shadcn/switch.js.map +1 -1
  18. package/lib/core/components/shadcn/tabs.js +1 -1
  19. package/lib/core/components/shadcn/tabs.js.map +1 -1
  20. package/lib/core/components/shadcn/tooltip.d.ts.map +1 -1
  21. package/lib/core/components/shadcn/tooltip.js +3 -1
  22. package/lib/core/components/shadcn/tooltip.js.map +1 -1
  23. package/lib/env/index.d.ts +0 -19
  24. package/lib/env/index.d.ts.map +1 -1
  25. package/lib/env/index.js +0 -6
  26. package/lib/env/index.js.map +1 -1
  27. package/lib/features/agent/PayloadBuilder.d.ts +4 -0
  28. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  29. package/lib/features/agent/PayloadBuilder.js +16 -0
  30. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  31. package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts +10 -0
  32. package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts.map +1 -0
  33. package/lib/features/agent/chat/AgentApprovalModeSelector.js +50 -0
  34. package/lib/features/agent/chat/AgentApprovalModeSelector.js.map +1 -0
  35. package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts +2 -1
  36. package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts.map +1 -1
  37. package/lib/features/agent/chat/AgentChatFixtureReplay.js +3 -3
  38. package/lib/features/agent/chat/AgentChatFixtureReplay.js.map +1 -1
  39. package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts +5 -2
  40. package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
  41. package/lib/features/agent/chat/AgentRequestInputOverlay.js +41 -7
  42. package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
  43. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  44. package/lib/features/agent/chat/AgentRightPanel.js +133 -12
  45. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  46. package/lib/features/agent/chat/AnimatedThinkingDots.js +1 -1
  47. package/lib/features/agent/chat/AnimatedThinkingDots.js.map +1 -1
  48. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  49. package/lib/features/agent/chat/ArtifactsTab.js +11 -65
  50. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  51. package/lib/features/agent/chat/AskUserWidget.d.ts +3 -1
  52. package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  53. package/lib/features/agent/chat/AskUserWidget.js +4 -3
  54. package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
  55. package/lib/features/agent/chat/ModernAgentConversation.d.ts +10 -2
  56. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  57. package/lib/features/agent/chat/ModernAgentConversation.js +526 -117
  58. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  59. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts +8 -0
  60. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -0
  61. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +19 -0
  62. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -0
  63. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +8 -2
  64. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  65. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +551 -92
  66. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  67. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  68. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +7 -6
  69. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  70. package/lib/features/agent/chat/ModernAgentOutput/Header.js +2 -2
  71. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  72. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts +8 -0
  73. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts.map +1 -0
  74. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js +61 -0
  75. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js.map +1 -0
  76. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +15 -2
  77. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  78. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +28 -38
  79. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +1 -1
  81. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +3 -2
  83. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js +2 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -1
  86. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js +1 -1
  87. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
  88. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts +5 -0
  89. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  90. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +59 -4
  91. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  92. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +2 -2
  93. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  94. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +9 -0
  95. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
  96. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +180 -0
  97. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
  98. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +6 -0
  99. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  100. package/lib/features/agent/chat/ModernAgentOutput/utils.js +92 -2
  101. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  102. package/lib/features/agent/chat/clipboardFiles.d.ts +15 -0
  103. package/lib/features/agent/chat/clipboardFiles.d.ts.map +1 -0
  104. package/lib/features/agent/chat/clipboardFiles.js +35 -0
  105. package/lib/features/agent/chat/clipboardFiles.js.map +1 -0
  106. package/lib/features/agent/chat/hooks/useAgentStream.d.ts +6 -0
  107. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  108. package/lib/features/agent/chat/hooks/useAgentStream.js +218 -37
  109. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  110. package/lib/features/agent/chat/hooks/useArtifacts.d.ts +1 -8
  111. package/lib/features/agent/chat/hooks/useArtifacts.d.ts.map +1 -1
  112. package/lib/features/agent/chat/hooks/useArtifacts.js +10 -28
  113. package/lib/features/agent/chat/hooks/useArtifacts.js.map +1 -1
  114. package/lib/features/agent/chat/index.d.ts +2 -1
  115. package/lib/features/agent/chat/index.d.ts.map +1 -1
  116. package/lib/features/agent/chat/index.js +2 -1
  117. package/lib/features/agent/chat/index.js.map +1 -1
  118. package/lib/features/agent/chat/workstreams.d.ts +1 -0
  119. package/lib/features/agent/chat/workstreams.d.ts.map +1 -1
  120. package/lib/features/agent/chat/workstreams.js +28 -0
  121. package/lib/features/agent/chat/workstreams.js.map +1 -1
  122. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +10 -1
  123. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  124. package/lib/features/facets/AgentRunnerFacetsNav.js +6 -3
  125. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  126. package/lib/features/facets/CollectionsFacetsNav.d.ts +10 -1
  127. package/lib/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  128. package/lib/features/facets/CollectionsFacetsNav.js +14 -5
  129. package/lib/features/facets/CollectionsFacetsNav.js.map +1 -1
  130. package/lib/features/facets/PromptsFacetsNav.d.ts +10 -1
  131. package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
  132. package/lib/features/facets/PromptsFacetsNav.js +14 -5
  133. package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
  134. package/lib/features/facets/RunsFacetsNav.d.ts +10 -1
  135. package/lib/features/facets/RunsFacetsNav.d.ts.map +1 -1
  136. package/lib/features/facets/RunsFacetsNav.js +14 -5
  137. package/lib/features/facets/RunsFacetsNav.js.map +1 -1
  138. package/lib/features/index.d.ts +0 -1
  139. package/lib/features/index.d.ts.map +1 -1
  140. package/lib/features/index.js +0 -1
  141. package/lib/features/index.js.map +1 -1
  142. package/lib/features/oauth/McpConnectionsButton.d.ts +30 -0
  143. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -0
  144. package/lib/features/oauth/McpConnectionsButton.js +70 -0
  145. package/lib/features/oauth/McpConnectionsButton.js.map +1 -0
  146. package/lib/features/oauth/McpConnectionsDialog.d.ts +25 -0
  147. package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -0
  148. package/lib/features/oauth/McpConnectionsDialog.js +26 -0
  149. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -0
  150. package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
  151. package/lib/features/oauth/RemoteMcpConnectionButton.js +14 -6
  152. package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
  153. package/lib/features/oauth/index.d.ts +3 -0
  154. package/lib/features/oauth/index.d.ts.map +1 -1
  155. package/lib/features/oauth/index.js +3 -0
  156. package/lib/features/oauth/index.js.map +1 -1
  157. package/lib/features/oauth/useMcpConnections.d.ts +44 -0
  158. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -0
  159. package/lib/features/oauth/useMcpConnections.js +168 -0
  160. package/lib/features/oauth/useMcpConnections.js.map +1 -0
  161. package/lib/features/permissions/UserPermissionsProvider.d.ts +4 -6
  162. package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  163. package/lib/features/permissions/UserPermissionsProvider.js +40 -42
  164. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  165. package/lib/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
  166. package/lib/features/store/objects/DocumentPreviewPanel.js +2 -1
  167. package/lib/features/store/objects/DocumentPreviewPanel.js.map +1 -1
  168. package/lib/features/store/objects/DocumentQuickFilter.d.ts +23 -0
  169. package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -0
  170. package/lib/features/store/objects/DocumentQuickFilter.js +30 -0
  171. package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -0
  172. package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  173. package/lib/features/store/objects/DocumentSearchResults.js +17 -1
  174. package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
  175. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  176. package/lib/features/store/objects/components/ContentOverview.js +17 -74
  177. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  178. package/lib/features/store/objects/layout/DocumentTableColumn.d.ts +7 -1
  179. package/lib/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
  180. package/lib/features/store/objects/layout/DocumentTableColumn.js +27 -3
  181. package/lib/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
  182. package/lib/features/store/objects/layout/documentLayout.js +1 -1
  183. package/lib/features/store/objects/layout/renderers.d.ts +2 -1
  184. package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
  185. package/lib/features/store/objects/layout/renderers.js +27 -20
  186. package/lib/features/store/objects/layout/renderers.js.map +1 -1
  187. package/lib/features/store/types/ContentObjectTypesSearch.d.ts.map +1 -1
  188. package/lib/features/store/types/ContentObjectTypesSearch.js +4 -1
  189. package/lib/features/store/types/ContentObjectTypesSearch.js.map +1 -1
  190. package/lib/features/store/types/ContentObjectTypesTable.d.ts +2 -1
  191. package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  192. package/lib/features/store/types/ContentObjectTypesTable.js +8 -3
  193. package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
  194. package/lib/i18n/instance.d.ts.map +1 -1
  195. package/lib/i18n/instance.js +1 -0
  196. package/lib/i18n/instance.js.map +1 -1
  197. package/lib/i18n/locales/ar.json +72 -45
  198. package/lib/i18n/locales/de.json +65 -34
  199. package/lib/i18n/locales/en.json +63 -47
  200. package/lib/i18n/locales/es.json +65 -35
  201. package/lib/i18n/locales/fr.json +65 -35
  202. package/lib/i18n/locales/it.json +72 -42
  203. package/lib/i18n/locales/ja.json +72 -41
  204. package/lib/i18n/locales/ko.json +72 -41
  205. package/lib/i18n/locales/pt.json +72 -42
  206. package/lib/i18n/locales/ru.json +72 -43
  207. package/lib/i18n/locales/tr.json +72 -41
  208. package/lib/i18n/locales/zh-TW.json +72 -41
  209. package/lib/i18n/locales/zh.json +72 -41
  210. package/lib/session/UserSession.d.ts +0 -6
  211. package/lib/session/UserSession.d.ts.map +1 -1
  212. package/lib/session/UserSession.js +0 -15
  213. package/lib/session/UserSession.js.map +1 -1
  214. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  215. package/lib/session/UserSessionProvider.js +39 -98
  216. package/lib/session/UserSessionProvider.js.map +1 -1
  217. package/lib/session/auth/composable.d.ts.map +1 -1
  218. package/lib/session/auth/composable.js +3 -33
  219. package/lib/session/auth/composable.js.map +1 -1
  220. package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
  221. package/lib/shell/login/SignInPrimitives.js +3 -2
  222. package/lib/shell/login/SignInPrimitives.js.map +1 -1
  223. package/lib/vertesia-ui-core.js +1 -1
  224. package/lib/vertesia-ui-core.js.map +1 -1
  225. package/lib/vertesia-ui-env.js +1 -1
  226. package/lib/vertesia-ui-env.js.map +1 -1
  227. package/lib/vertesia-ui-features.js +1 -1
  228. package/lib/vertesia-ui-features.js.map +1 -1
  229. package/lib/vertesia-ui-i18n.js +1 -1
  230. package/lib/vertesia-ui-i18n.js.map +1 -1
  231. package/lib/vertesia-ui-session.js +1 -1
  232. package/lib/vertesia-ui-session.js.map +1 -1
  233. package/lib/vertesia-ui-shell.js +1 -1
  234. package/lib/vertesia-ui-shell.js.map +1 -1
  235. package/lib/vertesia-ui-widgets.js +1 -1
  236. package/lib/vertesia-ui-widgets.js.map +1 -1
  237. package/lib/widgets/schema-editor/editor/Editable.js +1 -1
  238. package/lib/widgets/schema-editor/editor/Editable.js.map +1 -1
  239. package/llms.txt +70 -70
  240. package/package.json +35 -32
  241. package/src/core/components/shadcn/dropdown.tsx +2 -0
  242. package/src/core/components/shadcn/filters/filterBar.tsx +9 -2
  243. package/src/core/components/shadcn/modal/ConfirmModal.tsx +65 -3
  244. package/src/core/components/shadcn/modal/dialog.tsx +1 -1
  245. package/src/core/components/shadcn/popover.tsx +1 -0
  246. package/src/core/components/shadcn/switch.tsx +4 -4
  247. package/src/core/components/shadcn/tabs.tsx +1 -1
  248. package/src/core/components/shadcn/tooltip.tsx +1 -0
  249. package/src/env/index.ts +0 -24
  250. package/src/features/agent/PayloadBuilder.tsx +18 -0
  251. package/src/features/agent/chat/AgentApprovalModeSelector.tsx +130 -0
  252. package/src/features/agent/chat/AgentChatFixtureReplay.test.tsx +22 -2
  253. package/src/features/agent/chat/AgentChatFixtureReplay.tsx +33 -27
  254. package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +122 -0
  255. package/src/features/agent/chat/AgentRequestInputOverlay.tsx +91 -17
  256. package/src/features/agent/chat/AgentRightPanel.tsx +238 -50
  257. package/src/features/agent/chat/AnimatedThinkingDots.tsx +1 -1
  258. package/src/features/agent/chat/ArtifactsTab.tsx +21 -155
  259. package/src/features/agent/chat/AskUserWidget.tsx +6 -2
  260. package/src/features/agent/chat/ModernAgentConversation.test.tsx +1157 -47
  261. package/src/features/agent/chat/ModernAgentConversation.tsx +703 -136
  262. package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +74 -0
  263. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +1420 -126
  264. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +934 -111
  265. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +31 -40
  266. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +28 -28
  267. package/src/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.tsx +83 -0
  268. package/src/features/agent/chat/ModernAgentOutput/MessageInput.test.tsx +38 -2
  269. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +121 -98
  270. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +7 -1
  271. package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +3 -3
  272. package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +1 -1
  273. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +82 -2
  274. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +2 -2
  275. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +216 -0
  276. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +149 -0
  277. package/src/features/agent/chat/ModernAgentOutput/utils.ts +103 -2
  278. package/src/features/agent/chat/clipboardFiles.ts +33 -0
  279. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +355 -4
  280. package/src/features/agent/chat/hooks/useAgentStream.ts +270 -43
  281. package/src/features/agent/chat/hooks/useArtifacts.ts +11 -44
  282. package/src/features/agent/chat/index.ts +10 -1
  283. package/src/features/agent/chat/workstreams.ts +42 -0
  284. package/src/features/facets/AgentRunnerFacetsNav.tsx +23 -3
  285. package/src/features/facets/CollectionsFacetsNav.tsx +30 -5
  286. package/src/features/facets/PromptsFacetsNav.tsx +30 -5
  287. package/src/features/facets/RunsFacetsNav.tsx +32 -5
  288. package/src/features/index.ts +0 -1
  289. package/src/features/oauth/McpConnectionsButton.test.tsx +248 -0
  290. package/src/features/oauth/McpConnectionsButton.tsx +269 -0
  291. package/src/features/oauth/McpConnectionsDialog.tsx +142 -0
  292. package/src/features/oauth/RemoteMcpConnectionButton.tsx +37 -14
  293. package/src/features/oauth/index.ts +3 -0
  294. package/src/features/oauth/useMcpConnections.test.ts +94 -0
  295. package/src/features/oauth/useMcpConnections.ts +210 -0
  296. package/src/features/permissions/UserPermissionsProvider.tsx +41 -59
  297. package/src/features/store/objects/DocumentPreviewPanel.tsx +4 -2
  298. package/src/features/store/objects/DocumentQuickFilter.tsx +72 -0
  299. package/src/features/store/objects/DocumentSearchResults.tsx +30 -11
  300. package/src/features/store/objects/components/ContentOverview.tsx +30 -99
  301. package/src/features/store/objects/layout/DocumentTableColumn.tsx +29 -4
  302. package/src/features/store/objects/layout/documentLayout.tsx +1 -1
  303. package/src/features/store/objects/layout/renderers.tsx +80 -20
  304. package/src/features/store/types/ContentObjectTypesSearch.tsx +7 -1
  305. package/src/features/store/types/ContentObjectTypesTable.tsx +34 -4
  306. package/src/i18n/instance.ts +1 -0
  307. package/src/i18n/locales/ar.json +72 -45
  308. package/src/i18n/locales/de.json +65 -34
  309. package/src/i18n/locales/en.json +63 -47
  310. package/src/i18n/locales/es.json +65 -35
  311. package/src/i18n/locales/fr.json +65 -35
  312. package/src/i18n/locales/it.json +72 -42
  313. package/src/i18n/locales/ja.json +72 -41
  314. package/src/i18n/locales/ko.json +72 -41
  315. package/src/i18n/locales/pt.json +72 -42
  316. package/src/i18n/locales/ru.json +72 -43
  317. package/src/i18n/locales/tr.json +72 -41
  318. package/src/i18n/locales/zh-TW.json +72 -41
  319. package/src/i18n/locales/zh.json +72 -41
  320. package/src/i18n/rtl.test.ts +57 -1
  321. package/src/session/UserSession.ts +0 -16
  322. package/src/session/UserSessionProvider.tsx +51 -123
  323. package/src/session/auth/composable.ts +3 -34
  324. package/src/shell/login/SignInPrimitives.tsx +3 -2
  325. package/src/widgets/schema-editor/editor/Editable.tsx +1 -1
  326. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts +0 -73
  327. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +0 -1
  328. package/lib/features/document-viewer/UniversalDocumentViewer.js +0 -415
  329. package/lib/features/document-viewer/UniversalDocumentViewer.js.map +0 -1
  330. package/lib/features/document-viewer/index.d.ts +0 -2
  331. package/lib/features/document-viewer/index.d.ts.map +0 -1
  332. package/lib/features/document-viewer/index.js +0 -2
  333. package/lib/features/document-viewer/index.js.map +0 -1
  334. package/src/features/document-viewer/UniversalDocumentViewer.test.tsx +0 -123
  335. package/src/features/document-viewer/UniversalDocumentViewer.tsx +0 -746
  336. package/src/features/document-viewer/index.ts +0 -1
  337. package/src/session/auth/composable.test.ts +0 -79
@@ -30,6 +30,8 @@ export default function SlideInPanel({ isOpen, onClose, title, children, width =
30
30
  return null;
31
31
  }
32
32
 
33
+ const panelTranslateClass = isOpen ? 'translate-x-0' : 'translate-x-full rtl:-translate-x-full'; // rtl-ok: mirrored inline-end transform
34
+
33
35
  return (
34
36
  <>
35
37
  {/* Backdrop overlay */}
@@ -46,9 +48,7 @@ export default function SlideInPanel({ isOpen, onClose, title, children, width =
46
48
 
47
49
  {/* Slide-in panel */}
48
50
  <div
49
- className={`fixed top-0 end-0 bottom-0 z-50 bg-white dark:bg-gray-900 shadow-lg border-s border-gray-200 dark:border-gray-800 transition-transform duration-300 ease-in-out ${
50
- isOpen ? 'translate-x-0' : 'translate-x-full rtl:-translate-x-full'
51
- }`}
51
+ className={`fixed top-0 end-0 bottom-0 z-50 bg-white dark:bg-gray-900 shadow-lg border-s border-gray-200 dark:border-gray-800 transition-transform duration-300 ease-in-out ${panelTranslateClass}`}
52
52
  style={{ width }}
53
53
  >
54
54
  {/* Header */}
@@ -82,7 +82,7 @@ export default function SlidingMessages({ messages, isCompleted }: SlidingMessag
82
82
  {/* If no messages and not completed, show a placeholder thinking message */}
83
83
  {messages.length === 0 && !isCompleted && (
84
84
  <div className="flex items-center justify-center flex-1 text-center py-8">
85
- <div className="flex items-center space-x-3 bg-blue-50 rounded-lg border border-blue-100 px-4 py-3">
85
+ <div className="flex items-center gap-3 bg-blue-50 rounded-lg border border-blue-100 px-4 py-3">
86
86
  <div className="text-sm text-blue-700 font-medium">
87
87
  {ThinkingMessages[thinkingMessageIndex]}
88
88
  </div>
@@ -1,19 +1,28 @@
1
1
  import { type AgentMessage, AgentMessageType } from '@vertesia/common';
2
2
  import {
3
+ getWorkstreamActivityDetails,
3
4
  getWorkstreamLaunchDetails,
4
5
  isWorkstreamInternalResultMessage,
5
6
  isWorkstreamInternalResultText,
6
7
  } from '../workstreams.js';
8
+ import { isToolApprovalRequestInput } from './requestInputMessages';
7
9
  import {
8
10
  isStreamReplacedByMessage,
9
11
  isToolActivityMessage,
10
12
  isToolPreambleMessage,
13
+ isUserStoppedMessage,
11
14
  type StreamingData,
12
15
  type ToolExecutionStatus,
13
16
  } from './utils';
14
17
 
15
18
  export type SummaryConversationItem =
16
19
  | { type: 'message'; message: AgentMessage }
20
+ | {
21
+ type: 'stopped';
22
+ message: AgentMessage;
23
+ startTimestamp: number | string;
24
+ endTimestamp: number | string;
25
+ }
17
26
  | {
18
27
  type: 'work';
19
28
  id: string;
@@ -154,14 +163,49 @@ function isToolScopedStatusMessage(message: AgentMessage): boolean {
154
163
  );
155
164
  }
156
165
 
166
+ function isLegacyAnalyzeConversationErrorMessage(message: AgentMessage): boolean {
167
+ if (message.type !== AgentMessageType.ERROR || isToolScopedStatusMessage(message)) return false;
168
+
169
+ const details = message.details as { error?: unknown } | undefined;
170
+ return getMessageText(message).startsWith('Error analyzing conversation:') && typeof details?.error === 'string';
171
+ }
172
+
173
+ function isWorkstreamActivityFailureMessage(message: AgentMessage): boolean {
174
+ if (message.type !== AgentMessageType.ERROR) return false;
175
+
176
+ const details = message.details as
177
+ | {
178
+ activity_group_id?: unknown;
179
+ event_class?: unknown;
180
+ tool?: unknown;
181
+ tool_event?: unknown;
182
+ tool_run_id?: unknown;
183
+ tool_status?: unknown;
184
+ workstream_event?: unknown;
185
+ }
186
+ | undefined;
187
+
188
+ if (details?.event_class !== 'activity') return false;
189
+ if (details.workstream_event) return false;
190
+
191
+ return !(
192
+ details.tool ||
193
+ details.tool_status ||
194
+ details.tool_run_id ||
195
+ details.activity_group_id ||
196
+ details.tool_event
197
+ );
198
+ }
199
+
157
200
  function isSummaryPrimaryMessage(message: AgentMessage): boolean {
158
201
  if (isWorkstreamInternalResultMessage(message)) return false;
202
+ if (isWorkstreamActivityFailureMessage(message)) return false;
159
203
 
160
204
  return (
161
205
  message.type === AgentMessageType.QUESTION ||
162
206
  Boolean(getWorkstreamLaunchDetails(message)) ||
163
207
  isSummaryAssistantProseMessage(message) ||
164
- message.type === AgentMessageType.REQUEST_INPUT ||
208
+ (message.type === AgentMessageType.REQUEST_INPUT && !isToolApprovalRequestInput(message)) ||
165
209
  message.type === AgentMessageType.TERMINATED ||
166
210
  ((message.type === AgentMessageType.ERROR || message.type === AgentMessageType.WARNING) &&
167
211
  !isToolScopedStatusMessage(message) &&
@@ -200,7 +244,9 @@ function isSummaryWorkMessage(message: AgentMessage): boolean {
200
244
  if (isWorkstreamInternalResultMessage(message)) return false;
201
245
  if (isSummaryAssistantProseMessage(message)) return false;
202
246
  if (getWorkstreamLaunchDetails(message)) return false;
247
+ if (isWorkstreamActivityFailureMessage(message)) return true;
203
248
  if (isTransientWorkStatusMessage(message)) return true;
249
+ if (isToolApprovalRequestInput(message)) return true;
204
250
  if (isToolScopedStatusMessage(message)) return true;
205
251
  if (isToolPreambleMessage(message)) return true;
206
252
  if (isToolActivityMessage(message)) return true;
@@ -216,6 +262,7 @@ export function buildSummaryConversationItems(
216
262
  ): SummaryConversationItem[] {
217
263
  const items: SummaryConversationItem[] = [];
218
264
  let pendingWork: AgentMessage[] = [];
265
+ const seenWorkstreamStartIds = new Set<string>();
219
266
 
220
267
  const flushWork = (isActive: boolean, endMessage?: AgentMessage) => {
221
268
  if (pendingWork.length === 0) return;
@@ -244,12 +291,45 @@ export function buildSummaryConversationItems(
244
291
  };
245
292
 
246
293
  for (const message of messages) {
294
+ const launchDetails = getWorkstreamLaunchDetails(message);
295
+ const activityStartDetails = launchDetails ? null : getWorkstreamActivityDetails(message);
296
+ const workstreamStartDetails = launchDetails ?? activityStartDetails;
297
+
298
+ if (workstreamStartDetails) {
299
+ const hasSeenWorkstream = seenWorkstreamStartIds.has(workstreamStartDetails.workstreamId);
300
+ seenWorkstreamStartIds.add(workstreamStartDetails.workstreamId);
301
+
302
+ if (launchDetails || !hasSeenWorkstream) {
303
+ flushWork(false, message);
304
+ items.push({ type: 'message', message });
305
+ continue;
306
+ }
307
+ }
308
+
247
309
  if (message.type === AgentMessageType.COMPLETE || message.type === AgentMessageType.IDLE) {
310
+ if (isUserStoppedMessage(message)) {
311
+ const pendingWorkStartTimestamp = pendingWork[0]?.timestamp;
312
+ flushWork(false, message);
313
+ const previousItem = items[items.length - 1];
314
+ items.push({
315
+ type: 'stopped',
316
+ message,
317
+ startTimestamp:
318
+ pendingWorkStartTimestamp !== undefined && previousItem?.type === 'work'
319
+ ? previousItem.startTimestamp
320
+ : (pendingWorkStartTimestamp ?? message.timestamp),
321
+ endTimestamp: message.timestamp,
322
+ });
323
+ continue;
324
+ }
248
325
  flushWork(false, message);
249
326
  continue;
250
327
  }
251
328
 
252
- if (isSummaryWorkMessage(message)) {
329
+ if (
330
+ isSummaryWorkMessage(message) ||
331
+ (pendingWork.length > 0 && isLegacyAnalyzeConversationErrorMessage(message))
332
+ ) {
253
333
  if (shouldResumeCompletedWorkForTool(message, pendingWork)) {
254
334
  const previousItem = items[items.length - 1];
255
335
  if (previousItem?.type === 'work' && !previousItem.isActive) {
@@ -58,7 +58,7 @@ export default function WorkstreamTabs({
58
58
  }
59
59
 
60
60
  return (
61
- <div className="flex overflow-x-auto space-x-1 mb-1 bg-muted border-b border-muted/20 sticky top-0 z-10">
61
+ <div className="flex overflow-x-auto gap-1 mb-1 bg-muted border-b border-muted/20 sticky top-0 z-10">
62
62
  {sortedWorkstreams.map(([id, name]) => (
63
63
  <Button
64
64
  variant="unstyled"
@@ -76,7 +76,7 @@ export default function WorkstreamTabs({
76
76
  {name.length > 20 ? `${name.substring(0, 18)}...` : name}
77
77
  {/* biome-ignore lint/style/noNonNullAssertion: intentional non-null assertion; TS can't prove narrowing here */}
78
78
  {count?.has(id) && count.get(id)! > 0 && (
79
- <div className="flex items-center space-x-1">
79
+ <div className="flex items-center gap-1">
80
80
  <span
81
81
  className={cn(
82
82
  'inline-flex items-center justify-center p-1 text-xs rounded-full',
@@ -11,6 +11,68 @@ export function getAgentMessageText(message: AgentMessage): string {
11
11
  return String(message.message).trim();
12
12
  }
13
13
 
14
+ export function getRequestInputDisplayText(message: AgentMessage): string {
15
+ const toolApproval = getRecord((message.details as Record<string, unknown> | undefined)?.tool_approval);
16
+ if (!toolApproval) return getAgentMessageText(message);
17
+
18
+ const title = getString(toolApproval.tool_title) ?? getString(toolApproval.tool_name);
19
+ const target = formatToolApprovalTargetForDisplay(getString(toolApproval.target));
20
+ if (title && target) return `Approve ${title}: ${target}?`;
21
+
22
+ const actionSummary = getString(toolApproval.action_summary);
23
+ if (actionSummary) return `Approve ${formatToolApprovalActionSummaryForDisplay(actionSummary)}?`;
24
+
25
+ return getAgentMessageText(message);
26
+ }
27
+
28
+ function getRecord(value: unknown): Record<string, unknown> | undefined {
29
+ return value && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
30
+ }
31
+
32
+ function getString(value: unknown): string | undefined {
33
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
34
+ }
35
+
36
+ function formatToolApprovalActionSummaryForDisplay(actionSummary: string): string {
37
+ return actionSummary.replace(/:\s*name(?::|\s+)/i, ': ');
38
+ }
39
+
40
+ function formatToolApprovalTargetForDisplay(target: string | undefined): string | undefined {
41
+ if (!target) return undefined;
42
+
43
+ const separatorIndex = target.indexOf(':');
44
+ if (separatorIndex < 0) return target;
45
+
46
+ const key = target.slice(0, separatorIndex);
47
+ const value = target.slice(separatorIndex + 1).trim();
48
+ if (!value) return target;
49
+
50
+ switch (key) {
51
+ case 'document_id':
52
+ return `document ${value}`;
53
+ case 'object_id':
54
+ return `object ${value}`;
55
+ case 'collection_id':
56
+ return `collection ${value}`;
57
+ case 'process_id':
58
+ return `process ${value}`;
59
+ case 'process_definition_id':
60
+ return `process definition ${value}`;
61
+ case 'interaction_id':
62
+ return `interaction ${value}`;
63
+ case 'prompt_id':
64
+ return `prompt ${value}`;
65
+ case 'dashboard_id':
66
+ return `dashboard ${value}`;
67
+ case 'database_id':
68
+ return `database ${value}`;
69
+ case 'table_id':
70
+ return `table ${value}`;
71
+ default:
72
+ return value;
73
+ }
74
+ }
75
+
14
76
  export function hasRequestInputUx(message: AgentMessage): message is RequestInputMessageWithUx {
15
77
  const details = message.details as AskUserMessageDetails | undefined;
16
78
  return message.type === AgentMessageType.REQUEST_INPUT && !!details?.ux;
@@ -34,6 +96,22 @@ export function getRequestInputMessageKey(message: AgentMessage): string {
34
96
  .join('|');
35
97
  }
36
98
 
99
+ export function getRequestInputAnswerMessageKey(message: AgentMessage): string {
100
+ const details = message.details as Record<string, unknown> | undefined;
101
+ const keyParts = [
102
+ details?.ack,
103
+ details?._messageId,
104
+ details?._deliveryStatus,
105
+ message.timestamp,
106
+ getWorkstreamId(message),
107
+ getAgentMessageText(message),
108
+ ];
109
+ return keyParts
110
+ .filter((value): value is string | number => typeof value === 'string' || typeof value === 'number')
111
+ .map(String)
112
+ .join('|');
113
+ }
114
+
37
115
  export function getAnsweredRequestInputKeys(messages: AgentMessage[]): Set<string> {
38
116
  const answered = new Set<string>();
39
117
 
@@ -56,6 +134,142 @@ export function getAnsweredRequestInputKeys(messages: AgentMessage[]): Set<strin
56
134
  return answered;
57
135
  }
58
136
 
137
+ export function getResolvedToolApprovalKeys(messages: AgentMessage[]): Set<string> {
138
+ const resolved = new Set<string>();
139
+
140
+ for (const message of messages) {
141
+ const details = getRecord(message.details);
142
+ const approvalRequest = getRecord(details?.approval_request);
143
+ const approvalKey = approvalRequest?.approval_key;
144
+ const decision = details?.approval_decision;
145
+
146
+ if (
147
+ typeof approvalKey === 'string' &&
148
+ (decision === 'denied' ||
149
+ decision === 'denied_with_feedback' ||
150
+ decision === 'timeout' ||
151
+ decision === 'reviewer_denied' ||
152
+ decision === 'cancelled_after_denial')
153
+ ) {
154
+ resolved.add(approvalKey);
155
+ }
156
+ }
157
+
158
+ return resolved;
159
+ }
160
+
161
+ function getToolApprovalKey(message: AgentMessage): string | undefined {
162
+ const details = getRecord(message.details);
163
+ const toolApproval = getRecord(details?.tool_approval);
164
+ const approvalKey = toolApproval?.approval_key;
165
+ return typeof approvalKey === 'string' ? approvalKey : undefined;
166
+ }
167
+
168
+ export function isToolApprovalRequestInput(message: AgentMessage): boolean {
169
+ return message.type === AgentMessageType.REQUEST_INPUT && getToolApprovalKey(message) !== undefined;
170
+ }
171
+
172
+ function isToolApprovalOptionResponse(message: AgentMessage): boolean {
173
+ if (message.type !== AgentMessageType.QUESTION) return false;
174
+ const normalized = getAgentMessageText(message).trim().toLowerCase();
175
+ return normalized === 'allow_once' || normalized === 'allow_for_run' || normalized === 'deny';
176
+ }
177
+
178
+ function isToolApprovalMetadataResponse(message: AgentMessage): boolean {
179
+ if (message.type !== AgentMessageType.QUESTION) return false;
180
+ const details = getRecord(message.details);
181
+ const metadata = getRecord(details?.metadata);
182
+ const toolApprovalResponse =
183
+ getRecord(details?.tool_approval_response) ?? getRecord(metadata?.tool_approval_response);
184
+ return toolApprovalResponse?.decision === 'deny_with_feedback';
185
+ }
186
+
187
+ function isToolApprovalResponse(message: AgentMessage): boolean {
188
+ return isToolApprovalOptionResponse(message) || isToolApprovalMetadataResponse(message);
189
+ }
190
+
191
+ export function isRequestInputResolvedByToolApprovalEvent(
192
+ message: AgentMessage,
193
+ resolvedToolApprovalKeys: Set<string>,
194
+ ): boolean {
195
+ if (message.type !== AgentMessageType.REQUEST_INPUT) return false;
196
+ const approvalKey = getToolApprovalKey(message);
197
+ return approvalKey ? resolvedToolApprovalKeys.has(approvalKey) : false;
198
+ }
199
+
200
+ export function getAnsweredToolApprovalRequestInputKeys(messages: AgentMessage[]): Set<string> {
201
+ const answered = new Set<string>();
202
+
203
+ messages.forEach((message, index) => {
204
+ if (!isToolApprovalRequestInput(message)) return;
205
+
206
+ const workstreamId = getWorkstreamId(message);
207
+ for (let nextIndex = index + 1; nextIndex < messages.length; nextIndex += 1) {
208
+ const nextMessage = messages[nextIndex];
209
+ if (getWorkstreamId(nextMessage) !== workstreamId) continue;
210
+ if (nextMessage.type === AgentMessageType.REQUEST_INPUT) break;
211
+ if (nextMessage.type === AgentMessageType.QUESTION) {
212
+ if (isToolApprovalResponse(nextMessage)) {
213
+ answered.add(getRequestInputMessageKey(message));
214
+ }
215
+ break;
216
+ }
217
+ }
218
+ });
219
+
220
+ return answered;
221
+ }
222
+
223
+ export function isToolApprovalRequestInputHidden(
224
+ message: AgentMessage,
225
+ answeredToolApprovalRequestInputKeys: Set<string>,
226
+ resolvedToolApprovalKeys: Set<string>,
227
+ ): boolean {
228
+ return (
229
+ isToolApprovalRequestInput(message) &&
230
+ (answeredToolApprovalRequestInputKeys.has(getRequestInputMessageKey(message)) ||
231
+ isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys))
232
+ );
233
+ }
234
+
235
+ export function getHiddenToolApprovalAnswerKeys(
236
+ messages: AgentMessage[],
237
+ resolvedToolApprovalKeys?: Set<string>,
238
+ ): Set<string> {
239
+ const hidden = new Set<string>();
240
+
241
+ messages.forEach((message, index) => {
242
+ if (
243
+ !isToolApprovalRequestInput(message) ||
244
+ (resolvedToolApprovalKeys && !isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys))
245
+ ) {
246
+ return;
247
+ }
248
+
249
+ const workstreamId = getWorkstreamId(message);
250
+ for (let nextIndex = index + 1; nextIndex < messages.length; nextIndex += 1) {
251
+ const nextMessage = messages[nextIndex];
252
+ if (getWorkstreamId(nextMessage) !== workstreamId) continue;
253
+ if (nextMessage.type === AgentMessageType.REQUEST_INPUT) break;
254
+ if (nextMessage.type === AgentMessageType.QUESTION) {
255
+ if (isToolApprovalOptionResponse(nextMessage)) {
256
+ hidden.add(getRequestInputAnswerMessageKey(nextMessage));
257
+ }
258
+ break;
259
+ }
260
+ }
261
+ });
262
+
263
+ return hidden;
264
+ }
265
+
266
+ export function isToolApprovalAnswerHidden(message: AgentMessage, hiddenToolApprovalAnswerKeys: Set<string>): boolean {
267
+ return (
268
+ message.type === AgentMessageType.QUESTION &&
269
+ hiddenToolApprovalAnswerKeys.has(getRequestInputAnswerMessageKey(message))
270
+ );
271
+ }
272
+
59
273
  export function isRequestInputAnswered(message: AgentMessage, answeredRequestInputKeys: Set<string>): boolean {
60
274
  return (
61
275
  message.type === AgentMessageType.REQUEST_INPUT &&
@@ -68,12 +282,14 @@ export function getPendingRequestInputMessage(
68
282
  workstreamId = 'main',
69
283
  ): RequestInputMessageWithUx | undefined {
70
284
  const answeredRequestInputKeys = getAnsweredRequestInputKeys(messages);
285
+ const resolvedToolApprovalKeys = getResolvedToolApprovalKeys(messages);
71
286
 
72
287
  for (let index = messages.length - 1; index >= 0; index -= 1) {
73
288
  const message = messages[index];
74
289
  if (!hasRequestInputUx(message)) continue;
75
290
  if (getWorkstreamId(message) !== workstreamId) continue;
76
291
  if (isRequestInputAnswered(message, answeredRequestInputKeys)) continue;
292
+ if (isRequestInputResolvedByToolApprovalEvent(message, resolvedToolApprovalKeys)) continue;
77
293
  return message;
78
294
  }
79
295
 
@@ -498,6 +498,67 @@ describe('ModernAgentOutput summary conversation items', () => {
498
498
  });
499
499
  });
500
500
 
501
+ it('keeps legacy analyze conversation errors inside the surrounding work block', () => {
502
+ const analyzeStart = makeMessage({
503
+ timestamp: 1000,
504
+ type: AgentMessageType.THOUGHT,
505
+ message: 'Running analyze_conversation',
506
+ details: {
507
+ activity_group_id: 'activity-10',
508
+ tool: 'analyze_conversation',
509
+ tool_run_id: 'analyze-run-1',
510
+ tool_status: 'running',
511
+ },
512
+ });
513
+ const legacyAnalyzeError = makeMessage({
514
+ timestamp: 1100,
515
+ type: AgentMessageType.ERROR,
516
+ message: 'Error analyzing conversation: Could not find conversation for workflow run ID: run-1',
517
+ details: {
518
+ error: 'Could not find conversation for workflow run ID: run-1',
519
+ },
520
+ });
521
+ const answer = makeMessage({
522
+ timestamp: 1200,
523
+ type: AgentMessageType.ANSWER,
524
+ message: 'Here is the analysis.',
525
+ });
526
+
527
+ const items = buildSummaryConversationItems([analyzeStart, legacyAnalyzeError, answer], true);
528
+
529
+ expect(items).toHaveLength(2);
530
+ expect(items[0]).toMatchObject({
531
+ type: 'work',
532
+ isActive: false,
533
+ status: 'error',
534
+ messages: [analyzeStart, legacyAnalyzeError],
535
+ });
536
+ expect(items[1]).toMatchObject({
537
+ type: 'message',
538
+ message: answer,
539
+ });
540
+ });
541
+
542
+ it('keeps legacy analyze conversation errors without surrounding work as primary messages', () => {
543
+ const legacyAnalyzeError = makeMessage({
544
+ timestamp: 1000,
545
+ type: AgentMessageType.ERROR,
546
+ message: 'Error analyzing conversation: Could not find conversation for workflow run ID: run-1',
547
+ details: {
548
+ error: 'Could not find conversation for workflow run ID: run-1',
549
+ },
550
+ });
551
+
552
+ const items = buildSummaryConversationItems([legacyAnalyzeError], true);
553
+
554
+ expect(items).toEqual([
555
+ {
556
+ type: 'message',
557
+ message: legacyAnalyzeError,
558
+ },
559
+ ]);
560
+ });
561
+
501
562
  it('hides transient thinking once the work segment completes', () => {
502
563
  const tool = makeMessage({
503
564
  timestamp: 1000,
@@ -785,6 +846,37 @@ describe('ModernAgentOutput summary conversation items', () => {
785
846
  expect(items).toEqual([]);
786
847
  });
787
848
 
849
+ it('creates a visible stopped item for a consumed user stop idle marker', () => {
850
+ const thinking = makeMessage({
851
+ timestamp: 1000,
852
+ type: AgentMessageType.THOUGHT,
853
+ message: 'Thinking...',
854
+ details: {
855
+ display_role: 'thinking',
856
+ activity_group_id: 'activity-1',
857
+ },
858
+ });
859
+ const idle = makeMessage({
860
+ timestamp: 2000,
861
+ type: AgentMessageType.IDLE,
862
+ message: 'Stopped. Waiting for your command...',
863
+ details: {
864
+ ack: 'stop-1',
865
+ status_reason: 'user_stopped',
866
+ },
867
+ });
868
+
869
+ const items = buildSummaryConversationItems([thinking, idle], true);
870
+
871
+ expect(items).toHaveLength(1);
872
+ expect(items[0]).toMatchObject({
873
+ type: 'stopped',
874
+ message: idle,
875
+ startTimestamp: 1000,
876
+ endTimestamp: 2000,
877
+ });
878
+ });
879
+
788
880
  it('closes pending work when an idle marker arrives even if parent completion lags', () => {
789
881
  const tool = makeMessage({
790
882
  timestamp: 1000,
@@ -1180,6 +1272,37 @@ describe('ModernAgentOutput summary conversation items', () => {
1180
1272
  expect(summaryMessages).toEqual([answer]);
1181
1273
  });
1182
1274
 
1275
+ it('does not duplicate completed tool preamble streams once persisted prose replaces them', () => {
1276
+ const preamble = makeMessage({
1277
+ timestamp: 3000,
1278
+ type: AgentMessageType.THOUGHT,
1279
+ message: 'Got my tools ready. Querying now!',
1280
+ details: {
1281
+ activity_id: 'activity-1',
1282
+ display_role: 'tool_preamble',
1283
+ tools: ['search_documents'],
1284
+ streamed: true,
1285
+ },
1286
+ });
1287
+
1288
+ const summaryMessages = buildSummaryDisplayMessages(
1289
+ [preamble],
1290
+ new Map([
1291
+ [
1292
+ 'activity-1',
1293
+ {
1294
+ text: 'Got my tools ready. Querying now!',
1295
+ startTimestamp: 2000,
1296
+ activityId: 'activity-1',
1297
+ isComplete: true,
1298
+ },
1299
+ ],
1300
+ ]),
1301
+ );
1302
+
1303
+ expect(summaryMessages).toEqual([preamble]);
1304
+ });
1305
+
1183
1306
  it('keeps completed answer streams as assistant prose when a later tool message follows', () => {
1184
1307
  const question = makeMessage({
1185
1308
  timestamp: 1000,
@@ -1287,6 +1410,32 @@ describe('ModernAgentOutput utils - streamed deduplication', () => {
1287
1410
  expect(grouped[0].type).toBe('single');
1288
1411
  });
1289
1412
 
1413
+ it('does not replace a run-scoped stream with a different stream using the same activity id', () => {
1414
+ const answer = makeMessage({
1415
+ timestamp: 2000,
1416
+ type: AgentMessageType.ANSWER,
1417
+ message: 'Different final text',
1418
+ details: {
1419
+ activity_id: 'activity-1',
1420
+ streaming_id: 'run-b-activity-1',
1421
+ streaming_id_scope: 'workflow_run',
1422
+ },
1423
+ });
1424
+
1425
+ expect(
1426
+ isStreamReplacedByMessage(
1427
+ {
1428
+ text: 'partial text',
1429
+ startTimestamp: 1000,
1430
+ workstreamId: 'main',
1431
+ activityId: 'activity-1',
1432
+ streamingId: 'run-a-activity-1',
1433
+ },
1434
+ [answer],
1435
+ ),
1436
+ ).toBe(false);
1437
+ });
1438
+
1290
1439
  it('does not treat a tool event with the same activity id as a replacement for streamed prose', () => {
1291
1440
  const tool = makeMessage({
1292
1441
  timestamp: 2000,