@vertesia/ui 1.5.0-dev.20260722.120446Z → 1.5.0-dev.20260725.083715Z

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 (307) hide show
  1. package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  2. package/lib/core/components/shadcn/filters/filterBar.js +1 -1
  3. package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
  4. package/lib/core/components/shadcn/modal/dialog.d.ts +1 -1
  5. package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
  6. package/lib/core/components/shadcn/modal/dialog.js +2 -0
  7. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  8. package/lib/core/components/shadcn/tabs.d.ts +12 -1
  9. package/lib/core/components/shadcn/tabs.d.ts.map +1 -1
  10. package/lib/core/components/shadcn/tabs.js +12 -4
  11. package/lib/core/components/shadcn/tabs.js.map +1 -1
  12. package/lib/features/agent/chat/AgentRightPanel.d.ts +5 -1
  13. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  14. package/lib/features/agent/chat/AgentRightPanel.js +2 -2
  15. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  16. package/lib/features/agent/chat/ArtifactsTab.d.ts +5 -1
  17. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  18. package/lib/features/agent/chat/ArtifactsTab.js +48 -11
  19. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  20. package/lib/features/agent/chat/DocumentEditingActionCard.d.ts +6 -0
  21. package/lib/features/agent/chat/DocumentEditingActionCard.d.ts.map +1 -0
  22. package/lib/features/agent/chat/DocumentEditingActionCard.js +129 -0
  23. package/lib/features/agent/chat/DocumentEditingActionCard.js.map +1 -0
  24. package/lib/features/agent/chat/ModernAgentConversation.d.ts +19 -1
  25. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  26. package/lib/features/agent/chat/ModernAgentConversation.js +125 -27
  27. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  28. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts +45 -0
  29. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts.map +1 -0
  30. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js +40 -0
  31. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js.map +1 -0
  32. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
  33. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  34. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +94 -49
  35. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  36. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts +2 -1
  37. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  38. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +9 -5
  39. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  40. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts +25 -0
  41. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts.map +1 -0
  42. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js +33 -0
  43. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js.map +1 -0
  44. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
  45. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  46. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +22 -24
  47. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  48. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts +14 -0
  49. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts.map +1 -0
  50. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js +21 -0
  51. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js.map +1 -0
  52. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts +30 -0
  53. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts.map +1 -0
  54. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js +53 -0
  55. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js.map +1 -0
  56. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
  57. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +21 -2
  58. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  59. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts +6 -0
  60. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts.map +1 -0
  61. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js +29 -0
  62. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js.map +1 -0
  63. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts +33 -0
  64. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts.map +1 -0
  65. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js +129 -0
  66. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js.map +1 -0
  67. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +7 -0
  68. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  69. package/lib/features/agent/chat/ModernAgentOutput/utils.js +11 -1
  70. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  71. package/lib/features/agent/chat/hooks/useAgentStream.d.ts +1 -1
  72. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  73. package/lib/features/agent/chat/hooks/useAgentStream.js +24 -9
  74. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  75. package/lib/features/agent/chat/index.d.ts +2 -1
  76. package/lib/features/agent/chat/index.d.ts.map +1 -1
  77. package/lib/features/agent/chat/index.js +3 -0
  78. package/lib/features/agent/chat/index.js.map +1 -1
  79. package/lib/features/store/objects/DocumentSearchResults.js +2 -2
  80. package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
  81. package/lib/features/store/objects/components/ContentOverview.d.ts +2 -1
  82. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  83. package/lib/features/store/objects/components/ContentOverview.js +86 -15
  84. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  85. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts +16 -0
  86. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts.map +1 -0
  87. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js +116 -0
  88. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js.map +1 -0
  89. package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts +7 -0
  90. package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts.map +1 -0
  91. package/lib/features/store/objects/components/DocumentEditingLockStatus.js +13 -0
  92. package/lib/features/store/objects/components/DocumentEditingLockStatus.js.map +1 -0
  93. package/lib/features/store/objects/components/DocumentEditingPanel.d.ts +48 -0
  94. package/lib/features/store/objects/components/DocumentEditingPanel.d.ts.map +1 -0
  95. package/lib/features/store/objects/components/DocumentEditingPanel.js +720 -0
  96. package/lib/features/store/objects/components/DocumentEditingPanel.js.map +1 -0
  97. package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
  98. package/lib/features/store/objects/components/TextEditorPanel.js +22 -9
  99. package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
  100. package/lib/features/store/objects/components/documentArtifactRefs.d.ts +26 -0
  101. package/lib/features/store/objects/components/documentArtifactRefs.d.ts.map +1 -0
  102. package/lib/features/store/objects/components/documentArtifactRefs.js +52 -0
  103. package/lib/features/store/objects/components/documentArtifactRefs.js.map +1 -0
  104. package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts +4 -0
  105. package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts.map +1 -0
  106. package/lib/features/store/objects/components/documentEditingAgentConfig.js +40 -0
  107. package/lib/features/store/objects/components/documentEditingAgentConfig.js.map +1 -0
  108. package/lib/features/store/objects/components/documentEditingPrompts.d.ts +3 -0
  109. package/lib/features/store/objects/components/documentEditingPrompts.d.ts.map +1 -0
  110. package/lib/features/store/objects/components/documentEditingPrompts.js +13 -0
  111. package/lib/features/store/objects/components/documentEditingPrompts.js.map +1 -0
  112. package/lib/features/store/objects/components/documentEditingRun.d.ts +27 -0
  113. package/lib/features/store/objects/components/documentEditingRun.d.ts.map +1 -0
  114. package/lib/features/store/objects/components/documentEditingRun.js +126 -0
  115. package/lib/features/store/objects/components/documentEditingRun.js.map +1 -0
  116. package/lib/features/store/objects/components/documentEditingTarget.d.ts +20 -0
  117. package/lib/features/store/objects/components/documentEditingTarget.d.ts.map +1 -0
  118. package/lib/features/store/objects/components/documentEditingTarget.js +40 -0
  119. package/lib/features/store/objects/components/documentEditingTarget.js.map +1 -0
  120. package/lib/features/store/objects/components/index.d.ts +1 -0
  121. package/lib/features/store/objects/components/index.d.ts.map +1 -1
  122. package/lib/features/store/objects/components/index.js +1 -0
  123. package/lib/features/store/objects/components/index.js.map +1 -1
  124. package/lib/features/store/objects/components/useContentPanelHooks.d.ts +5 -1
  125. package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
  126. package/lib/features/store/objects/components/useContentPanelHooks.js +53 -29
  127. package/lib/features/store/objects/components/useContentPanelHooks.js.map +1 -1
  128. package/lib/features/store/objects/components/useDownloadFile.d.ts +2 -1
  129. package/lib/features/store/objects/components/useDownloadFile.d.ts.map +1 -1
  130. package/lib/features/store/objects/components/useDownloadFile.js +3 -0
  131. package/lib/features/store/objects/components/useDownloadFile.js.map +1 -1
  132. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +1 -1
  133. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +1 -1
  134. package/lib/i18n/locales/ar.json +118 -1
  135. package/lib/i18n/locales/de.json +118 -1
  136. package/lib/i18n/locales/en.json +118 -0
  137. package/lib/i18n/locales/es.json +118 -1
  138. package/lib/i18n/locales/fr.json +118 -1
  139. package/lib/i18n/locales/it.json +118 -1
  140. package/lib/i18n/locales/ja.json +118 -1
  141. package/lib/i18n/locales/ko.json +118 -1
  142. package/lib/i18n/locales/pt.json +118 -1
  143. package/lib/i18n/locales/ru.json +118 -1
  144. package/lib/i18n/locales/tr.json +118 -1
  145. package/lib/i18n/locales/zh-TW.json +118 -1
  146. package/lib/i18n/locales/zh.json +118 -1
  147. package/lib/rich-text/EditorToolbar.d.ts +37 -0
  148. package/lib/rich-text/EditorToolbar.d.ts.map +1 -0
  149. package/lib/rich-text/EditorToolbar.js +215 -0
  150. package/lib/rich-text/EditorToolbar.js.map +1 -0
  151. package/lib/rich-text/VertesiaRichTextEditor.d.ts +26 -0
  152. package/lib/rich-text/VertesiaRichTextEditor.d.ts.map +1 -0
  153. package/lib/rich-text/VertesiaRichTextEditor.js +67 -0
  154. package/lib/rich-text/VertesiaRichTextEditor.js.map +1 -0
  155. package/lib/rich-text/index.d.ts +2 -0
  156. package/lib/rich-text/index.d.ts.map +1 -0
  157. package/lib/rich-text/index.js +2 -0
  158. package/lib/rich-text/index.js.map +1 -0
  159. package/lib/vertesia-ui-core.js +2 -2
  160. package/lib/vertesia-ui-core.js.map +1 -1
  161. package/lib/vertesia-ui-features.js +35 -30
  162. package/lib/vertesia-ui-features.js.map +1 -1
  163. package/lib/vertesia-ui-i18n.js +14 -14
  164. package/lib/vertesia-ui-i18n.js.map +1 -1
  165. package/lib/vertesia-ui-rich-text.js +5 -0
  166. package/lib/vertesia-ui-rich-text.js.map +1 -0
  167. package/lib/vertesia-ui-widgets.js +25 -7
  168. package/lib/vertesia-ui-widgets.js.map +1 -1
  169. package/lib/widgets/markdown/AgentResourceResolver.d.ts +31 -0
  170. package/lib/widgets/markdown/AgentResourceResolver.d.ts.map +1 -0
  171. package/lib/widgets/markdown/AgentResourceResolver.js +39 -0
  172. package/lib/widgets/markdown/AgentResourceResolver.js.map +1 -0
  173. package/lib/widgets/markdown/ArtifactEditingSurface.d.ts +63 -0
  174. package/lib/widgets/markdown/ArtifactEditingSurface.d.ts.map +1 -0
  175. package/lib/widgets/markdown/ArtifactEditingSurface.js +582 -0
  176. package/lib/widgets/markdown/ArtifactEditingSurface.js.map +1 -0
  177. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts +69 -0
  178. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts.map +1 -0
  179. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js +374 -0
  180. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js.map +1 -0
  181. package/lib/widgets/markdown/MarkdownLink.d.ts +3 -1
  182. package/lib/widgets/markdown/MarkdownLink.d.ts.map +1 -1
  183. package/lib/widgets/markdown/MarkdownLink.js +41 -14
  184. package/lib/widgets/markdown/MarkdownLink.js.map +1 -1
  185. package/lib/widgets/markdown/MarkdownRenderer.d.ts +8 -1
  186. package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  187. package/lib/widgets/markdown/MarkdownRenderer.js +20 -4
  188. package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
  189. package/lib/widgets/markdown/index.d.ts +5 -1
  190. package/lib/widgets/markdown/index.d.ts.map +1 -1
  191. package/lib/widgets/markdown/index.js +5 -1
  192. package/lib/widgets/markdown/index.js.map +1 -1
  193. package/lib/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -1
  194. package/lib/widgets/markdown/normalizeCustomSchemeLinks.js +14 -2
  195. package/lib/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -1
  196. package/lib/widgets/markdown/textDiff.d.ts +52 -0
  197. package/lib/widgets/markdown/textDiff.d.ts.map +1 -0
  198. package/lib/widgets/markdown/textDiff.js +362 -0
  199. package/lib/widgets/markdown/textDiff.js.map +1 -0
  200. package/lib/widgets/markdown/useArtifactContent.d.ts +5 -3
  201. package/lib/widgets/markdown/useArtifactContent.d.ts.map +1 -1
  202. package/lib/widgets/markdown/useArtifactContent.js +6 -3
  203. package/lib/widgets/markdown/useArtifactContent.js.map +1 -1
  204. package/lib/widgets/markdown/useResolvedUrl.d.ts +1 -5
  205. package/lib/widgets/markdown/useResolvedUrl.d.ts.map +1 -1
  206. package/lib/widgets/markdown/useResolvedUrl.js +19 -31
  207. package/lib/widgets/markdown/useResolvedUrl.js.map +1 -1
  208. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts +9 -0
  209. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -1
  210. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js +20 -17
  211. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -1
  212. package/package.json +13 -9
  213. package/src/__tests__/a11y.test.tsx +4 -1
  214. package/src/__tests__/axe-helper.ts +17 -7
  215. package/src/__tests__/setup.ts +25 -0
  216. package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
  217. package/src/core/components/shadcn/modal/dialog.tsx +3 -1
  218. package/src/core/components/shadcn/tabs.test.tsx +65 -0
  219. package/src/core/components/shadcn/tabs.tsx +25 -3
  220. package/src/features/agent/chat/AgentRightPanel.tsx +16 -1
  221. package/src/features/agent/chat/ArtifactsTab.test.tsx +55 -0
  222. package/src/features/agent/chat/ArtifactsTab.tsx +203 -52
  223. package/src/features/agent/chat/DocumentEditingActionCard.test.tsx +105 -0
  224. package/src/features/agent/chat/DocumentEditingActionCard.tsx +210 -0
  225. package/src/features/agent/chat/ModernAgentConversation.test.tsx +237 -40
  226. package/src/features/agent/chat/ModernAgentConversation.tsx +247 -75
  227. package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.test.tsx +79 -0
  228. package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.tsx +94 -0
  229. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +257 -34
  230. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +217 -105
  231. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +17 -0
  232. package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.test.tsx +44 -0
  233. package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.tsx +88 -0
  234. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +30 -46
  235. package/src/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.tsx +40 -0
  236. package/src/features/agent/chat/ModernAgentOutput/ResourceChip.test.tsx +148 -0
  237. package/src/features/agent/chat/ModernAgentOutput/ResourceChip.tsx +141 -0
  238. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +33 -1
  239. package/src/features/agent/chat/ModernAgentOutput/resourceLinks.tsx +43 -0
  240. package/src/features/agent/chat/ModernAgentOutput/resourceSummary.test.ts +229 -0
  241. package/src/features/agent/chat/ModernAgentOutput/resourceSummary.ts +152 -0
  242. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +17 -0
  243. package/src/features/agent/chat/ModernAgentOutput/utils.ts +14 -1
  244. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +188 -0
  245. package/src/features/agent/chat/hooks/useAgentStream.ts +28 -8
  246. package/src/features/agent/chat/index.ts +11 -0
  247. package/src/features/store/objects/DocumentSearchResults.tsx +2 -2
  248. package/src/features/store/objects/components/ContentOverview.tsx +216 -65
  249. package/src/features/store/objects/components/DocumentEditingConfigurationSelector.test.ts +34 -0
  250. package/src/features/store/objects/components/DocumentEditingConfigurationSelector.tsx +211 -0
  251. package/src/features/store/objects/components/DocumentEditingLockStatus.test.tsx +32 -0
  252. package/src/features/store/objects/components/DocumentEditingLockStatus.tsx +45 -0
  253. package/src/features/store/objects/components/DocumentEditingPanel.test.tsx +336 -0
  254. package/src/features/store/objects/components/DocumentEditingPanel.tsx +1236 -0
  255. package/src/features/store/objects/components/TextEditorPanel.test.tsx +48 -0
  256. package/src/features/store/objects/components/TextEditorPanel.tsx +41 -20
  257. package/src/features/store/objects/components/documentArtifactRefs.test.ts +65 -0
  258. package/src/features/store/objects/components/documentArtifactRefs.ts +72 -0
  259. package/src/features/store/objects/components/documentEditingAgentConfig.test.ts +28 -0
  260. package/src/features/store/objects/components/documentEditingAgentConfig.ts +41 -0
  261. package/src/features/store/objects/components/documentEditingPrompts.test.ts +26 -0
  262. package/src/features/store/objects/components/documentEditingPrompts.ts +12 -0
  263. package/src/features/store/objects/components/documentEditingRun.test.ts +176 -0
  264. package/src/features/store/objects/components/documentEditingRun.ts +184 -0
  265. package/src/features/store/objects/components/documentEditingTarget.test.ts +96 -0
  266. package/src/features/store/objects/components/documentEditingTarget.ts +63 -0
  267. package/src/features/store/objects/components/index.ts +1 -0
  268. package/src/features/store/objects/components/useContentPanelHooks.ts +52 -27
  269. package/src/features/store/objects/components/useDownloadFile.test.ts +20 -0
  270. package/src/features/store/objects/components/useDownloadFile.ts +5 -1
  271. package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +2 -2
  272. package/src/i18n/locales/ar.json +118 -1
  273. package/src/i18n/locales/de.json +118 -1
  274. package/src/i18n/locales/en.json +118 -0
  275. package/src/i18n/locales/es.json +118 -1
  276. package/src/i18n/locales/fr.json +118 -1
  277. package/src/i18n/locales/it.json +118 -1
  278. package/src/i18n/locales/ja.json +118 -1
  279. package/src/i18n/locales/ko.json +118 -1
  280. package/src/i18n/locales/pt.json +118 -1
  281. package/src/i18n/locales/ru.json +118 -1
  282. package/src/i18n/locales/tr.json +118 -1
  283. package/src/i18n/locales/zh-TW.json +118 -1
  284. package/src/i18n/locales/zh.json +118 -1
  285. package/src/rich-text/EditorToolbar.tsx +708 -0
  286. package/src/rich-text/VertesiaRichTextEditor.test.tsx +211 -0
  287. package/src/rich-text/VertesiaRichTextEditor.tsx +241 -0
  288. package/src/rich-text/index.ts +9 -0
  289. package/src/session/UserSession.test.ts +11 -11
  290. package/src/widgets/markdown/AgentResourceResolver.test.ts +24 -0
  291. package/src/widgets/markdown/AgentResourceResolver.tsx +70 -0
  292. package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +537 -0
  293. package/src/widgets/markdown/ArtifactEditingSurface.tsx +878 -0
  294. package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +484 -0
  295. package/src/widgets/markdown/CollaborativeMarkdownRenderer.tsx +825 -0
  296. package/src/widgets/markdown/MarkdownLink.test.tsx +122 -0
  297. package/src/widgets/markdown/MarkdownLink.tsx +102 -17
  298. package/src/widgets/markdown/MarkdownRenderer.tsx +30 -3
  299. package/src/widgets/markdown/index.ts +39 -1
  300. package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +15 -2
  301. package/src/widgets/markdown/textDiff.test.ts +156 -0
  302. package/src/widgets/markdown/textDiff.ts +399 -0
  303. package/src/widgets/markdown/useArtifactContent.ts +9 -3
  304. package/src/widgets/markdown/useResolvedUrl.test.ts +29 -40
  305. package/src/widgets/markdown/useResolvedUrl.ts +33 -35
  306. package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
  307. package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
@@ -0,0 +1,94 @@
1
+ import { NavLink } from '@vertesia/ui/router';
2
+ import type React from 'react';
3
+
4
+ /** Host-provided renderer for store/document links (e.g. to open a side panel instead of navigating). */
5
+ export type StoreLinkComponentType = React.ComponentType<{
6
+ href: string;
7
+ documentId: string;
8
+ children: React.ReactNode;
9
+ className?: string;
10
+ }>;
11
+
12
+ /** Host-provided renderer for store/collection links. */
13
+ export type CollectionLinkComponentType = React.ComponentType<{
14
+ href: string;
15
+ collectionId: string;
16
+ children: React.ReactNode;
17
+ className?: string;
18
+ }>;
19
+
20
+ export interface AgentMarkdownAnchorOptions {
21
+ /** Custom component to render store/document links instead of default NavLink navigation. */
22
+ StoreLinkComponent?: StoreLinkComponentType;
23
+ /** Custom component to render store/collection links instead of default NavLink navigation. */
24
+ CollectionLinkComponent?: CollectionLinkComponentType;
25
+ /**
26
+ * Applies tenant sticky params (account `a` / project `p`) to internal routes so copy-link and
27
+ * open-in-new-tab preserve the current tenant. Left undefined when no router is in scope.
28
+ */
29
+ addStickyParams?: (href: string) => string;
30
+ }
31
+
32
+ interface AnchorProps {
33
+ node?: unknown;
34
+ ref?: unknown;
35
+ href?: string;
36
+ children?: React.ReactNode;
37
+ className?: string;
38
+ }
39
+
40
+ function getInternalRouteId(href: string, routePrefix: string): string | undefined {
41
+ if (!href.startsWith(routePrefix)) {
42
+ return undefined;
43
+ }
44
+ return href.slice(routePrefix.length).split(/[/?#]/, 1)[0] || undefined;
45
+ }
46
+
47
+ /**
48
+ * Builds the markdown `a` renderer used across agent chat.
49
+ *
50
+ * Custom-scheme links (`store:`, `collection:`, `interaction:`, `prompt:`, ...) are resolved by the
51
+ * host's AgentResourceResolver upstream in MarkdownLink, so navigable targets reach this renderer as
52
+ * concrete paths. We route relative paths through NavLink (preserving tenant params); only document
53
+ * and collection paths get the optional host-provided link components. External URLs open in a new
54
+ * tab, matching prior behavior.
55
+ */
56
+ export function createAgentMarkdownAnchor(options: AgentMarkdownAnchorOptions = {}) {
57
+ const { StoreLinkComponent, CollectionLinkComponent, addStickyParams } = options;
58
+
59
+ return function AgentMarkdownAnchor({ node: _node, ref: _ref, ...props }: AnchorProps) {
60
+ const href = props.href || '';
61
+ const isInternal = href.startsWith('/') && !href.startsWith('//');
62
+ const withParams = isInternal && addStickyParams ? addStickyParams(href) : href;
63
+ const documentId = isInternal ? getInternalRouteId(href, '/store/objects/') : undefined;
64
+
65
+ if (documentId && StoreLinkComponent) {
66
+ return (
67
+ <StoreLinkComponent href={withParams} documentId={documentId} className={props.className}>
68
+ {props.children}
69
+ </StoreLinkComponent>
70
+ );
71
+ }
72
+
73
+ const collectionId = isInternal ? getInternalRouteId(href, '/store/collections/') : undefined;
74
+ if (collectionId && CollectionLinkComponent) {
75
+ return (
76
+ <CollectionLinkComponent href={withParams} collectionId={collectionId} className={props.className}>
77
+ {props.children}
78
+ </CollectionLinkComponent>
79
+ );
80
+ }
81
+
82
+ // Any other relative in-app path (e.g. /studio/interactions/:id, /store/workflows/:id)
83
+ // navigates internally so tenant params are preserved and the SPA is not reloaded.
84
+ if (isInternal) {
85
+ return (
86
+ <NavLink href={withParams} className={props.className} topLevelNav>
87
+ {props.children}
88
+ </NavLink>
89
+ );
90
+ }
91
+
92
+ return <a {...props} target="_blank" rel="noopener noreferrer" />;
93
+ };
94
+ }
@@ -1,4 +1,4 @@
1
- import { fireEvent, render, screen } from '@testing-library/react';
1
+ import { fireEvent, render, screen, within } from '@testing-library/react';
2
2
  import type { VertesiaClient } from '@vertesia/client';
3
3
  import { type AgentMessage, AgentMessageType } from '@vertesia/common';
4
4
  import React from 'react';
@@ -6,6 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
6
6
  import { I18nProvider } from '../../../../i18n/index.js';
7
7
  import { ReactRouterContext, type RouterContext } from '../../../../router/index.js';
8
8
  import { UserSession, UserSessionContext } from '../../../../session/index.js';
9
+ import { AgentResourceResolverProvider } from '../../../../widgets/markdown/AgentResourceResolver';
9
10
  import AllMessagesMixed from './AllMessagesMixed';
10
11
  import type { StreamingData } from './utils';
11
12
 
@@ -20,6 +21,30 @@ function makeMessage(overrides: Partial<AgentMessage>): AgentMessage {
20
21
  };
21
22
  }
22
23
 
24
+ function makeRouterContext(): RouterContext {
25
+ return {
26
+ location: window.location,
27
+ route: { path: '/', Component: () => null },
28
+ params: {},
29
+ state: null,
30
+ matchedRoutePath: '/',
31
+ navigate: vi.fn(),
32
+ router: {
33
+ navigate: vi.fn(),
34
+ getTopRouter: () => ({
35
+ navigator: {
36
+ addStickyParams: (href: string) => href,
37
+ },
38
+ }),
39
+ },
40
+ } as unknown as RouterContext;
41
+ }
42
+
43
+ const testResourceResolver = (resource: { type: string; id: string }) => ({
44
+ kind: 'navigate' as const,
45
+ href: `/resources/${resource.type}/${encodeURIComponent(resource.id)}`,
46
+ });
47
+
23
48
  function renderSummary(
24
49
  messages: AgentMessage[],
25
50
  isCompleted = false,
@@ -30,15 +55,19 @@ function renderSummary(
30
55
 
31
56
  return render(
32
57
  <I18nProvider lng="en">
33
- <AllMessagesMixed
34
- messages={messages}
35
- bottomRef={bottomRef}
36
- viewMode="sliding"
37
- isCompleted={isCompleted}
38
- artifactRunId="run-1"
39
- streamingMessages={streamingMessages}
40
- {...props}
41
- />
58
+ <ReactRouterContext.Provider value={makeRouterContext()}>
59
+ <AgentResourceResolverProvider value={testResourceResolver}>
60
+ <AllMessagesMixed
61
+ messages={messages}
62
+ bottomRef={bottomRef}
63
+ viewMode="sliding"
64
+ isCompleted={isCompleted}
65
+ artifactRunId="run-1"
66
+ streamingMessages={streamingMessages}
67
+ {...props}
68
+ />
69
+ </AgentResourceResolverProvider>
70
+ </ReactRouterContext.Provider>
42
71
  </I18nProvider>,
43
72
  );
44
73
  }
@@ -54,35 +83,22 @@ function renderStacked(
54
83
  getArtifactDownloadUrl: vi.fn(),
55
84
  },
56
85
  } as unknown as VertesiaClient);
57
- const routerContext = {
58
- location: window.location,
59
- route: { path: '/', Component: () => null },
60
- params: {},
61
- state: null,
62
- matchedRoutePath: '/',
63
- navigate: vi.fn(),
64
- router: {
65
- navigate: vi.fn(),
66
- getTopRouter: () => ({
67
- navigator: {
68
- addStickyParams: (href: string) => href,
69
- },
70
- }),
71
- },
72
- } as unknown as RouterContext;
86
+ const routerContext = makeRouterContext();
73
87
 
74
88
  return render(
75
89
  <I18nProvider lng="en">
76
90
  <ReactRouterContext.Provider value={routerContext}>
77
91
  <UserSessionContext.Provider value={session}>
78
- <AllMessagesMixed
79
- messages={messages}
80
- bottomRef={bottomRef}
81
- viewMode="stacked"
82
- isCompleted={isCompleted}
83
- artifactRunId="run-1"
84
- {...props}
85
- />
92
+ <AgentResourceResolverProvider value={testResourceResolver}>
93
+ <AllMessagesMixed
94
+ messages={messages}
95
+ bottomRef={bottomRef}
96
+ viewMode="stacked"
97
+ isCompleted={isCompleted}
98
+ artifactRunId="run-1"
99
+ {...props}
100
+ />
101
+ </AgentResourceResolverProvider>
86
102
  </UserSessionContext.Provider>
87
103
  </ReactRouterContext.Provider>
88
104
  </I18nProvider>,
@@ -116,6 +132,33 @@ describe('AllMessagesMixed summary view', () => {
116
132
  expect(screen.getByLabelText('Message consumed')).not.toBeNull();
117
133
  });
118
134
 
135
+ it('renders structured document editing input as a compact card', () => {
136
+ renderSummary([
137
+ makeMessage({
138
+ timestamp: 1_000,
139
+ type: AgentMessageType.QUESTION,
140
+ message: 'Add one concrete example.',
141
+ details: {
142
+ editing_action: {
143
+ operation_id: 'operation-1',
144
+ resource: { kind: 'store_document', document_id: 'document-1', name: 'Launch plan' },
145
+ action: 'comment',
146
+ anchor: {
147
+ block_id: 'list_item:10:24',
148
+ block_type: 'list_item',
149
+ exact_text: '- Preserve unrelated sections.',
150
+ },
151
+ comment: 'Add one concrete example.',
152
+ },
153
+ },
154
+ }),
155
+ ]);
156
+
157
+ expect(document.querySelector('[data-document-edit-action="comment"]')).not.toBeNull();
158
+ expect(screen.getByText('Add one concrete example.')).not.toBeNull();
159
+ expect(screen.queryByText('operation-1')).toBeNull();
160
+ });
161
+
119
162
  it('renders delivery status on user messages in stacked view', () => {
120
163
  renderStacked([
121
164
  makeMessage({
@@ -215,6 +258,58 @@ describe('AllMessagesMixed summary view', () => {
215
258
  expect(screen.getByText('Found 5 results')).not.toBeNull();
216
259
  });
217
260
 
261
+ it('replaces a completed tool’s progress title with an immediately visible resource deep link', () => {
262
+ renderSummary(
263
+ [
264
+ makeMessage({
265
+ timestamp: 1_000,
266
+ type: AgentMessageType.QUESTION,
267
+ message: 'Create a market news agent.',
268
+ }),
269
+ makeMessage({
270
+ timestamp: 2_000,
271
+ message: 'Creating the Market Impact News agent...',
272
+ details: {
273
+ event_class: 'activity',
274
+ tool: 'create_interaction',
275
+ tool_status: 'completed',
276
+ tool_event: 'completed',
277
+ tool_run_id: 'tool-1',
278
+ duration_ms: 1_032,
279
+ resources: [
280
+ {
281
+ type: 'interaction',
282
+ id: 'interaction-1',
283
+ label: 'Daily Market Impact News Agent',
284
+ action: 'created',
285
+ },
286
+ ],
287
+ },
288
+ }),
289
+ ],
290
+ true,
291
+ );
292
+
293
+ fireEvent.click(screen.getByRole('button', { name: /Worked\s*for/ }));
294
+
295
+ const resourceActivity = document.querySelector('[data-agent-resource-activity]');
296
+ expect(resourceActivity).not.toBeNull();
297
+ expect(within(resourceActivity as HTMLElement).getByText('Created')).not.toBeNull();
298
+ const resourceLink = within(resourceActivity as HTMLElement).getByRole('link', {
299
+ name: /Daily Market Impact News Agent/,
300
+ });
301
+ expect(resourceLink.getAttribute('href')).toContain('/resources/interaction/interaction-1');
302
+ expect(resourceLink.textContent).toBe('Daily Market Impact News Agent');
303
+ expect(screen.queryByText('Creating the Market Impact News agent...')).toBeNull();
304
+
305
+ fireEvent.click(screen.getByRole('button', { name: /Show details: Daily Market Impact News Agent/ }));
306
+ expect(screen.getByText('create_interaction')).not.toBeNull();
307
+ expect(document.querySelector('[data-agent-tool-resources]')).toBeNull();
308
+ expect(screen.queryByText(/"type":\s*"interaction"/)).toBeNull();
309
+ expect(screen.queryByText(/"duration_ms":\s*1032/)).toBeNull();
310
+ expect(screen.queryByText('Details')).toBeNull();
311
+ });
312
+
218
313
  it('keeps same-iteration tool detail panels matched to their own tool identity', () => {
219
314
  renderSummary(
220
315
  [
@@ -2243,3 +2338,131 @@ describe('AllMessagesMixed summary view', () => {
2243
2338
  expect(screen.getByText('Prepared and saved artifact to files/US_News_Report_2026-06-22.md')).not.toBeNull();
2244
2339
  });
2245
2340
  });
2341
+
2342
+ describe('AllMessagesMixed resource summary — playback clipping', () => {
2343
+ const resourceMsg = (id: string, label: string, ts: number) =>
2344
+ makeMessage({
2345
+ timestamp: ts,
2346
+ type: AgentMessageType.THOUGHT,
2347
+ details: {
2348
+ event_class: 'activity',
2349
+ tool: 'create_document',
2350
+ tool_status: 'completed',
2351
+ tool_event: 'completed',
2352
+ resources: [{ type: 'document', id, label, action: 'created' }],
2353
+ },
2354
+ });
2355
+
2356
+ const fullHistory = [
2357
+ makeMessage({ timestamp: 1000, type: AgentMessageType.QUESTION, message: 'first' }),
2358
+ resourceMsg('doc-a', 'Doc A', 2000),
2359
+ makeMessage({ timestamp: 3000, type: AgentMessageType.COMPLETE, message: '' }),
2360
+ makeMessage({ timestamp: 4000, type: AgentMessageType.QUESTION, message: 'second' }),
2361
+ resourceMsg('doc-b', 'Doc B', 5000),
2362
+ makeMessage({ timestamp: 6000, type: AgentMessageType.COMPLETE, message: '' }),
2363
+ ];
2364
+
2365
+ it('shows resources up to the playback cursor but hides ones created later', () => {
2366
+ // Scrubbed to the end of the first turn: clipped view stops at t=3000; full history has more.
2367
+ renderStacked(fullHistory.slice(0, 3), false, { workstreamSourceMessages: fullHistory });
2368
+
2369
+ expect(screen.getByText('Doc A')).not.toBeNull();
2370
+ expect(screen.queryByText('Doc B')).toBeNull();
2371
+ });
2372
+
2373
+ it('shows all completed turns’ resources when live/at-latest', () => {
2374
+ renderStacked(fullHistory, true, { workstreamSourceMessages: fullHistory });
2375
+
2376
+ expect(screen.getByText('Doc A')).not.toBeNull();
2377
+ expect(screen.getByText('Doc B')).not.toBeNull();
2378
+ });
2379
+
2380
+ it('shows the latest turn summary after a final answer while the workflow remains interactive', () => {
2381
+ const answerEndedTurn = [
2382
+ makeMessage({ timestamp: 1000, type: AgentMessageType.QUESTION, message: 'Create a document.' }),
2383
+ resourceMsg('doc-a', 'Doc A', 2000),
2384
+ makeMessage({ timestamp: 3000, type: AgentMessageType.ANSWER, message: 'The document is ready.' }),
2385
+ ];
2386
+
2387
+ renderStacked(answerEndedTurn, false);
2388
+
2389
+ expect(screen.getByText('Doc A')).not.toBeNull();
2390
+ });
2391
+ });
2392
+
2393
+ describe('AllMessagesMixed — stopped duration with interleaved resource summary', () => {
2394
+ it('computes the stopped duration from the previous group, not the inserted summary', () => {
2395
+ const resourceMsg = makeMessage({
2396
+ timestamp: 2000,
2397
+ type: AgentMessageType.THOUGHT,
2398
+ details: {
2399
+ event_class: 'activity',
2400
+ tool: 'create_document',
2401
+ tool_status: 'completed',
2402
+ tool_event: 'completed',
2403
+ resources: [{ type: 'document', id: 'doc-a', label: 'Doc A', action: 'created' }],
2404
+ },
2405
+ });
2406
+ const messages = [
2407
+ makeMessage({ timestamp: 1000, type: AgentMessageType.QUESTION, message: 'first' }),
2408
+ resourceMsg,
2409
+ makeMessage({ timestamp: 4000, type: AgentMessageType.QUESTION, message: 'second' }),
2410
+ makeMessage({
2411
+ timestamp: 5000,
2412
+ type: AgentMessageType.THOUGHT,
2413
+ details: { event_class: 'activity', tool: 'search', tool_status: 'completed', tool_event: 'completed' },
2414
+ }),
2415
+ makeMessage({
2416
+ timestamp: 8000,
2417
+ type: AgentMessageType.IDLE,
2418
+ message: 'Stopped.',
2419
+ details: { status_reason: 'user_stopped' },
2420
+ }),
2421
+ ];
2422
+
2423
+ renderStacked(messages, true);
2424
+
2425
+ // Turn 1's summary is interleaved before turn 2, but the stopped duration must still be
2426
+ // measured from the previous *group* (the search tool at t=5000 → 3s), not the summary.
2427
+ expect(screen.getByText('Doc A')).not.toBeNull();
2428
+ expect(screen.getByText('You stopped after 3s')).not.toBeNull();
2429
+ });
2430
+ });
2431
+
2432
+ describe('AllMessagesMixed resource summary — same-timestamp cursor clipping', () => {
2433
+ it('excludes a later message sharing the cursor timestamp (position-based clip)', () => {
2434
+ const docA = makeMessage({
2435
+ timestamp: 2000,
2436
+ type: AgentMessageType.THOUGHT,
2437
+ details: {
2438
+ event_class: 'activity',
2439
+ tool: 'create_document',
2440
+ tool_status: 'completed',
2441
+ resources: [{ type: 'document', id: 'doc-a', label: 'Doc A', action: 'created' }],
2442
+ },
2443
+ });
2444
+ const cursor = makeMessage({ timestamp: 2000, type: AgentMessageType.COMPLETE, message: 'c1' });
2445
+ const docB = makeMessage({
2446
+ timestamp: 2000, // same millisecond as the cursor, but ordered AFTER it
2447
+ type: AgentMessageType.THOUGHT,
2448
+ details: {
2449
+ event_class: 'activity',
2450
+ tool: 'create_document',
2451
+ tool_status: 'completed',
2452
+ resources: [{ type: 'document', id: 'doc-b', label: 'Doc B', action: 'created' }],
2453
+ },
2454
+ });
2455
+ const fullHistory = [
2456
+ makeMessage({ timestamp: 1000, type: AgentMessageType.QUESTION, message: 'first' }),
2457
+ docA,
2458
+ cursor,
2459
+ docB,
2460
+ ];
2461
+
2462
+ // Scrubbed so the clipped view ends at the cursor (shares its timestamp with the later Doc B).
2463
+ renderStacked(fullHistory.slice(0, 3), false, { workstreamSourceMessages: fullHistory });
2464
+
2465
+ expect(screen.getByText('Doc A')).not.toBeNull();
2466
+ expect(screen.queryByText('Doc B')).toBeNull();
2467
+ });
2468
+ });