@vertesia/ui 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z

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 (502) hide show
  1. package/README.md +1 -7
  2. package/lib/core/components/FormItem.d.ts.map +1 -1
  3. package/lib/core/components/FormItem.js +2 -3
  4. package/lib/core/components/FormItem.js.map +1 -1
  5. package/lib/core/components/InfoTip.d.ts +20 -0
  6. package/lib/core/components/InfoTip.d.ts.map +1 -0
  7. package/lib/core/components/InfoTip.js +18 -0
  8. package/lib/core/components/InfoTip.js.map +1 -0
  9. package/lib/core/components/index.d.ts +1 -0
  10. package/lib/core/components/index.d.ts.map +1 -1
  11. package/lib/core/components/index.js +1 -0
  12. package/lib/core/components/index.js.map +1 -1
  13. package/lib/core/components/shadcn/Panel.d.ts.map +1 -1
  14. package/lib/core/components/shadcn/Panel.js +3 -3
  15. package/lib/core/components/shadcn/Panel.js.map +1 -1
  16. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js +1 -1
  17. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -1
  18. package/lib/core/components/shadcn/filters/filter/dateFilter.d.ts.map +1 -1
  19. package/lib/core/components/shadcn/filters/filter/dateFilter.js +1 -1
  20. package/lib/core/components/shadcn/filters/filter/dateFilter.js.map +1 -1
  21. package/lib/core/components/shadcn/filters/filters.d.ts.map +1 -1
  22. package/lib/core/components/shadcn/filters/filters.js +1 -1
  23. package/lib/core/components/shadcn/filters/filters.js.map +1 -1
  24. package/lib/core/components/shadcn/index.d.ts +1 -0
  25. package/lib/core/components/shadcn/index.d.ts.map +1 -1
  26. package/lib/core/components/shadcn/index.js +1 -0
  27. package/lib/core/components/shadcn/index.js.map +1 -1
  28. package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
  29. package/lib/core/components/shadcn/modal/dialog.js +1 -3
  30. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  31. package/lib/core/components/shadcn/overflowTabs.d.ts +59 -0
  32. package/lib/core/components/shadcn/overflowTabs.d.ts.map +1 -0
  33. package/lib/core/components/shadcn/overflowTabs.js +173 -0
  34. package/lib/core/components/shadcn/overflowTabs.js.map +1 -0
  35. package/lib/core/components/shadcn/selectBox.js +2 -2
  36. package/lib/core/components/shadcn/selectBox.js.map +1 -1
  37. package/lib/core/components/shadcn/theme/ThemeProvider.d.ts +3 -1
  38. package/lib/core/components/shadcn/theme/ThemeProvider.d.ts.map +1 -1
  39. package/lib/core/components/shadcn/theme/ThemeProvider.js +8 -9
  40. package/lib/core/components/shadcn/theme/ThemeProvider.js.map +1 -1
  41. package/lib/core/utils/dayjs.d.ts +12 -0
  42. package/lib/core/utils/dayjs.d.ts.map +1 -0
  43. package/lib/core/utils/dayjs.js +16 -0
  44. package/lib/core/utils/dayjs.js.map +1 -0
  45. package/lib/env/index.d.ts +17 -0
  46. package/lib/env/index.d.ts.map +1 -1
  47. package/lib/env/index.js +18 -1
  48. package/lib/env/index.js.map +1 -1
  49. package/lib/features/agent/PayloadBuilder.d.ts +1 -0
  50. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  51. package/lib/features/agent/PayloadBuilder.js +22 -5
  52. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  53. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  54. package/lib/features/agent/chat/AgentRightPanel.js +3 -135
  55. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  56. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  57. package/lib/features/agent/chat/ArtifactsTab.js +1 -1
  58. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  59. package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  60. package/lib/features/agent/chat/AskUserWidget.js +19 -4
  61. package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
  62. package/lib/features/agent/chat/ModernAgentConversation.d.ts +6 -0
  63. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  64. package/lib/features/agent/chat/ModernAgentConversation.js +99 -29
  65. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  66. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -1
  67. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +10 -9
  68. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -1
  69. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  70. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +5 -8
  71. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  72. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  73. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +45 -4
  74. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  75. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +1 -1
  76. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
  77. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  78. package/lib/features/agent/chat/ModernAgentOutput/Header.js +3 -3
  79. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  81. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  83. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js +1 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
  86. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +1 -1
  87. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  88. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -1
  89. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +9 -121
  90. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  91. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +6 -0
  92. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  93. package/lib/features/agent/chat/ModernAgentOutput/utils.js +19 -11
  94. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  95. package/lib/features/agent/chat/VegaLiteChart.d.ts.map +1 -1
  96. package/lib/features/agent/chat/VegaLiteChart.js +11 -3
  97. package/lib/features/agent/chat/VegaLiteChart.js.map +1 -1
  98. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  99. package/lib/features/agent/chat/hooks/useAgentStream.js +3 -0
  100. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  101. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +1 -1
  102. package/lib/features/document-viewer/UniversalDocumentViewer.js +1 -1
  103. package/lib/features/document-viewer/UniversalDocumentViewer.js.map +1 -1
  104. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +14 -2
  105. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  106. package/lib/features/facets/AgentRunnerFacetsNav.js +20 -2
  107. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  108. package/lib/features/facets/CollectionsFacetsNav.d.ts +3 -3
  109. package/lib/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  110. package/lib/features/facets/CollectionsFacetsNav.js +6 -1
  111. package/lib/features/facets/CollectionsFacetsNav.js.map +1 -1
  112. package/lib/features/facets/DocumentsFacetsNav.d.ts +3 -3
  113. package/lib/features/facets/DocumentsFacetsNav.d.ts.map +1 -1
  114. package/lib/features/facets/DocumentsFacetsNav.js +20 -8
  115. package/lib/features/facets/DocumentsFacetsNav.js.map +1 -1
  116. package/lib/features/facets/InteractionsFacetsNav.d.ts +3 -3
  117. package/lib/features/facets/InteractionsFacetsNav.d.ts.map +1 -1
  118. package/lib/features/facets/InteractionsFacetsNav.js +11 -1
  119. package/lib/features/facets/InteractionsFacetsNav.js.map +1 -1
  120. package/lib/features/facets/PromptsFacetsNav.d.ts +3 -3
  121. package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
  122. package/lib/features/facets/PromptsFacetsNav.js +6 -1
  123. package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
  124. package/lib/features/facets/RunsFacetsNav.d.ts +4 -14
  125. package/lib/features/facets/RunsFacetsNav.d.ts.map +1 -1
  126. package/lib/features/facets/RunsFacetsNav.js +26 -15
  127. package/lib/features/facets/RunsFacetsNav.js.map +1 -1
  128. package/lib/features/facets/WorkflowExecutionsFacetsNav.d.ts +4 -3
  129. package/lib/features/facets/WorkflowExecutionsFacetsNav.d.ts.map +1 -1
  130. package/lib/features/facets/WorkflowExecutionsFacetsNav.js +18 -10
  131. package/lib/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -1
  132. package/lib/features/facets/index.d.ts +1 -1
  133. package/lib/features/facets/index.d.ts.map +1 -1
  134. package/lib/features/facets/index.js.map +1 -1
  135. package/lib/features/facets/utils/SearchInterface.d.ts +4 -3
  136. package/lib/features/facets/utils/SearchInterface.d.ts.map +1 -1
  137. package/lib/features/facets/utils/SearchInterface.js +4 -0
  138. package/lib/features/facets/utils/SearchInterface.js.map +1 -1
  139. package/lib/features/layout/GenericPageNavHeader.d.ts +8 -1
  140. package/lib/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  141. package/lib/features/layout/GenericPageNavHeader.js +9 -1
  142. package/lib/features/layout/GenericPageNavHeader.js.map +1 -1
  143. package/lib/features/magic-pdf/DownloadPopover.d.ts +3 -2
  144. package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
  145. package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
  146. package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -1
  147. package/lib/features/magic-pdf/GroundedExtractionView.js +51 -64
  148. package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
  149. package/lib/features/oauth/McpConnectionsButton.d.ts +1 -1
  150. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
  151. package/lib/features/oauth/McpConnectionsButton.js +2 -2
  152. package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
  153. package/lib/features/oauth/McpConnectionsDialog.d.ts +1 -1
  154. package/lib/features/oauth/McpConnectionsDialog.js +2 -2
  155. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
  156. package/lib/features/oauth/useMcpConnections.d.ts +4 -5
  157. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
  158. package/lib/features/oauth/useMcpConnections.js +20 -4
  159. package/lib/features/oauth/useMcpConnections.js.map +1 -1
  160. package/lib/features/pdf-viewer/PdfPageRenderer.d.ts.map +1 -1
  161. package/lib/features/pdf-viewer/PdfPageRenderer.js +9 -11
  162. package/lib/features/pdf-viewer/PdfPageRenderer.js.map +1 -1
  163. package/lib/features/pdf-viewer/lazyReactPdf.d.ts +10 -0
  164. package/lib/features/pdf-viewer/lazyReactPdf.d.ts.map +1 -0
  165. package/lib/features/pdf-viewer/lazyReactPdf.js +25 -0
  166. package/lib/features/pdf-viewer/lazyReactPdf.js.map +1 -0
  167. package/lib/features/store/collections/CollectionsTable.d.ts.map +1 -1
  168. package/lib/features/store/collections/CollectionsTable.js +1 -3
  169. package/lib/features/store/collections/CollectionsTable.js.map +1 -1
  170. package/lib/features/store/collections/EditCollectionView.js +1 -1
  171. package/lib/features/store/collections/EditCollectionView.js.map +1 -1
  172. package/lib/features/store/objects/ExportPropertiesModal.d.ts +3 -1
  173. package/lib/features/store/objects/ExportPropertiesModal.d.ts.map +1 -1
  174. package/lib/features/store/objects/ExportPropertiesModal.js +5 -5
  175. package/lib/features/store/objects/ExportPropertiesModal.js.map +1 -1
  176. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  177. package/lib/features/store/objects/components/ContentOverview.js +4 -10
  178. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  179. package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
  180. package/lib/features/store/objects/components/TextEditorPanel.js +8 -3
  181. package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
  182. package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
  183. package/lib/features/store/objects/layout/renderers.js +1 -5
  184. package/lib/features/store/objects/layout/renderers.js.map +1 -1
  185. package/lib/features/store/objects/search/DocumentSearchContext.d.ts +44 -62
  186. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  187. package/lib/features/store/objects/search/DocumentSearchContext.js +47 -2
  188. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  189. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
  190. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js +5 -0
  191. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  192. package/lib/features/store/objects/upload/DocumentUploadModal.d.ts +6 -1
  193. package/lib/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
  194. package/lib/features/store/objects/upload/DocumentUploadModal.js +4 -3
  195. package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  196. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
  197. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.js +2 -2
  198. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
  199. package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  200. package/lib/features/store/types/ContentObjectTypesTable.js +1 -3
  201. package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
  202. package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
  203. package/lib/features/store/types/IntakePolicyEditor.js +12 -2
  204. package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
  205. package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
  206. package/lib/features/store/types/IntakePolicyForm.js +15 -15
  207. package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
  208. package/lib/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
  209. package/lib/features/store/types/ObjectSchemaEditor.js +6 -2
  210. package/lib/features/store/types/ObjectSchemaEditor.js.map +1 -1
  211. package/lib/features/store/types/TableLayoutEditor.d.ts.map +1 -1
  212. package/lib/features/store/types/TableLayoutEditor.js +2 -0
  213. package/lib/features/store/types/TableLayoutEditor.js.map +1 -1
  214. package/lib/features/store/types/TypeRegistry.d.ts +282 -0
  215. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  216. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +281 -0
  217. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  218. package/lib/features/user/UserInfo.d.ts.map +1 -1
  219. package/lib/features/user/UserInfo.js +2 -4
  220. package/lib/features/user/UserInfo.js.map +1 -1
  221. package/lib/features/views/ViewActions.d.ts +32 -0
  222. package/lib/features/views/ViewActions.d.ts.map +1 -0
  223. package/lib/features/views/ViewActions.js +186 -0
  224. package/lib/features/views/ViewActions.js.map +1 -0
  225. package/lib/features/views/ViewDropTarget.d.ts +15 -0
  226. package/lib/features/views/ViewDropTarget.d.ts.map +1 -0
  227. package/lib/features/views/ViewDropTarget.js +79 -0
  228. package/lib/features/views/ViewDropTarget.js.map +1 -0
  229. package/lib/features/views/ViewExperience.d.ts +3 -2
  230. package/lib/features/views/ViewExperience.d.ts.map +1 -1
  231. package/lib/features/views/ViewExperience.js +103 -12
  232. package/lib/features/views/ViewExperience.js.map +1 -1
  233. package/lib/features/views/ViewNavigation.d.ts +1 -1
  234. package/lib/features/views/ViewNavigation.d.ts.map +1 -1
  235. package/lib/features/views/ViewNavigation.js +14 -5
  236. package/lib/features/views/ViewNavigation.js.map +1 -1
  237. package/lib/features/views/ViewResults.d.ts +1 -1
  238. package/lib/features/views/ViewResults.d.ts.map +1 -1
  239. package/lib/features/views/ViewResults.js +124 -34
  240. package/lib/features/views/ViewResults.js.map +1 -1
  241. package/lib/features/views/index.d.ts +1 -0
  242. package/lib/features/views/index.d.ts.map +1 -1
  243. package/lib/features/views/index.js +1 -0
  244. package/lib/features/views/index.js.map +1 -1
  245. package/lib/features/views/types.d.ts +46 -1
  246. package/lib/features/views/types.d.ts.map +1 -1
  247. package/lib/features/views/viewState.d.ts.map +1 -1
  248. package/lib/features/views/viewState.js +34 -0
  249. package/lib/features/views/viewState.js.map +1 -1
  250. package/lib/i18n/LanguageProvider.d.ts +3 -1
  251. package/lib/i18n/LanguageProvider.d.ts.map +1 -1
  252. package/lib/i18n/LanguageProvider.js +9 -7
  253. package/lib/i18n/LanguageProvider.js.map +1 -1
  254. package/lib/i18n/instance.d.ts +2 -0
  255. package/lib/i18n/instance.d.ts.map +1 -1
  256. package/lib/i18n/instance.js +45 -26
  257. package/lib/i18n/instance.js.map +1 -1
  258. package/lib/i18n/locales/ar.json +296 -15
  259. package/lib/i18n/locales/de.json +294 -13
  260. package/lib/i18n/locales/en.json +65 -4
  261. package/lib/i18n/locales/es.json +295 -14
  262. package/lib/i18n/locales/fr.json +294 -13
  263. package/lib/i18n/locales/it.json +294 -13
  264. package/lib/i18n/locales/ja.json +292 -10
  265. package/lib/i18n/locales/ko.json +292 -10
  266. package/lib/i18n/locales/pt.json +294 -13
  267. package/lib/i18n/locales/ru.json +291 -10
  268. package/lib/i18n/locales/tr.json +291 -10
  269. package/lib/i18n/locales/zh-TW.json +292 -10
  270. package/lib/i18n/locales/zh.json +292 -10
  271. package/lib/router/RouteComponent.d.ts +8 -0
  272. package/lib/router/RouteComponent.d.ts.map +1 -1
  273. package/lib/router/RouteComponent.js +41 -9
  274. package/lib/router/RouteComponent.js.map +1 -1
  275. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  276. package/lib/session/UserSessionProvider.js +20 -29
  277. package/lib/session/UserSessionProvider.js.map +1 -1
  278. package/lib/session/auth/composable.d.ts.map +1 -1
  279. package/lib/session/auth/composable.js +25 -19
  280. package/lib/session/auth/composable.js.map +1 -1
  281. package/lib/session/auth/domainRouting.d.ts +11 -0
  282. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  283. package/lib/session/auth/domainRouting.js +13 -0
  284. package/lib/session/auth/domainRouting.js.map +1 -1
  285. package/lib/session/auth/firebase.js +1 -1
  286. package/lib/session/auth/firebase.js.map +1 -1
  287. package/lib/session/useUXTracking.d.ts.map +1 -1
  288. package/lib/session/useUXTracking.js +6 -1
  289. package/lib/session/useUXTracking.js.map +1 -1
  290. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  291. package/lib/shell/VertesiaShell.js +2 -1
  292. package/lib/shell/VertesiaShell.js.map +1 -1
  293. package/lib/shell/apps/AppInstallationProvider.d.ts +4 -2
  294. package/lib/shell/apps/AppInstallationProvider.d.ts.map +1 -1
  295. package/lib/shell/apps/IframeAppContextSync.d.ts +3 -0
  296. package/lib/shell/apps/IframeAppContextSync.d.ts.map +1 -0
  297. package/lib/shell/apps/IframeAppContextSync.js +95 -0
  298. package/lib/shell/apps/IframeAppContextSync.js.map +1 -0
  299. package/lib/shell/apps/iframe-auth.d.ts +55 -0
  300. package/lib/shell/apps/iframe-auth.d.ts.map +1 -0
  301. package/lib/shell/apps/iframe-auth.js +154 -0
  302. package/lib/shell/apps/iframe-auth.js.map +1 -0
  303. package/lib/shell/apps/index.d.ts +2 -0
  304. package/lib/shell/apps/index.d.ts.map +1 -1
  305. package/lib/shell/apps/index.js +2 -0
  306. package/lib/shell/apps/index.js.map +1 -1
  307. package/lib/vertesia-ui-core.js +199 -4
  308. package/lib/vertesia-ui-core.js.map +1 -1
  309. package/lib/vertesia-ui-env.js +1 -1
  310. package/lib/vertesia-ui-env.js.map +1 -1
  311. package/lib/vertesia-ui-features.js +975 -35
  312. package/lib/vertesia-ui-features.js.map +1 -1
  313. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js +5 -0
  314. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js.map +1 -0
  315. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js +5 -0
  316. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js.map +1 -0
  317. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js +5 -0
  318. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js.map +1 -0
  319. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js +5 -0
  320. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js.map +1 -0
  321. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js +5 -0
  322. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js.map +1 -0
  323. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js +5 -0
  324. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js.map +1 -0
  325. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js +5 -0
  326. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js.map +1 -0
  327. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js +5 -0
  328. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js.map +1 -0
  329. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js +5 -0
  330. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js.map +1 -0
  331. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js +5 -0
  332. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js.map +1 -0
  333. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js +5 -0
  334. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js.map +1 -0
  335. package/lib/vertesia-ui-i18n.js +2 -38
  336. package/lib/vertesia-ui-i18n.js.map +1 -1
  337. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js +5 -0
  338. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js.map +1 -0
  339. package/lib/vertesia-ui-layout.js +80 -1
  340. package/lib/vertesia-ui-layout.js.map +1 -1
  341. package/lib/vertesia-ui-rich-text.js +278 -4
  342. package/lib/vertesia-ui-rich-text.js.map +1 -1
  343. package/lib/vertesia-ui-router.js +1 -1
  344. package/lib/vertesia-ui-router.js.map +1 -1
  345. package/lib/vertesia-ui-session.js +1 -1
  346. package/lib/vertesia-ui-session.js.map +1 -1
  347. package/lib/vertesia-ui-shell.js +118 -1
  348. package/lib/vertesia-ui-shell.js.map +1 -1
  349. package/lib/vertesia-ui-widgets.js +336 -20
  350. package/lib/vertesia-ui-widgets.js.map +1 -1
  351. package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  352. package/lib/widgets/markdown/MarkdownRenderer.js +43 -2
  353. package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
  354. package/lib/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
  355. package/lib/widgets/markdown/MermaidDiagram.js +35 -22
  356. package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
  357. package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
  358. package/lib/widgets/monacoEditor/MonacoEditor.js +14 -10
  359. package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
  360. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  361. package/package.json +24 -29
  362. package/src/core/components/FormItem.tsx +2 -5
  363. package/src/core/components/InfoTip.test.tsx +33 -0
  364. package/src/core/components/InfoTip.tsx +32 -0
  365. package/src/core/components/index.ts +1 -0
  366. package/src/core/components/shadcn/Panel.tsx +3 -7
  367. package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +1 -1
  368. package/src/core/components/shadcn/filters/filter/dateFilter.tsx +1 -1
  369. package/src/core/components/shadcn/filters/filters.tsx +1 -1
  370. package/src/core/components/shadcn/index.ts +1 -0
  371. package/src/core/components/shadcn/modal/dialog.test.tsx +35 -0
  372. package/src/core/components/shadcn/modal/dialog.tsx +0 -4
  373. package/src/core/components/shadcn/overflowTabs.tsx +320 -0
  374. package/src/core/components/shadcn/selectBox.tsx +2 -2
  375. package/src/core/components/shadcn/theme/ThemeProvider.tsx +10 -9
  376. package/src/core/utils/dayjs.ts +17 -0
  377. package/src/css/base.css +78 -0
  378. package/src/env/index.test.ts +94 -0
  379. package/src/env/index.ts +36 -1
  380. package/src/features/agent/PayloadBuilder.test.ts +68 -0
  381. package/src/features/agent/PayloadBuilder.tsx +28 -4
  382. package/src/features/agent/chat/AgentRightPanel.tsx +2 -252
  383. package/src/features/agent/chat/ArtifactsTab.tsx +1 -0
  384. package/src/features/agent/chat/AskUserWidget.test.tsx +20 -1
  385. package/src/features/agent/chat/AskUserWidget.tsx +22 -6
  386. package/src/features/agent/chat/ModernAgentConversation.test.tsx +160 -0
  387. package/src/features/agent/chat/ModernAgentConversation.tsx +111 -31
  388. package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +86 -67
  389. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +90 -7
  390. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +4 -6
  391. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.test.ts +103 -1
  392. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +50 -4
  393. package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +1 -1
  394. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +18 -1
  395. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +1 -1
  396. package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +1 -1
  397. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +1 -1
  398. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +37 -167
  399. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +94 -0
  400. package/src/features/agent/chat/ModernAgentOutput/utils.ts +19 -10
  401. package/src/features/agent/chat/VegaLiteChart.tsx +32 -14
  402. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +18 -0
  403. package/src/features/agent/chat/hooks/useAgentStream.ts +3 -0
  404. package/src/features/document-viewer/UniversalDocumentViewer.tsx +1 -1
  405. package/src/features/facets/AgentRunnerFacetsNav.tsx +44 -4
  406. package/src/features/facets/CollectionsFacetsNav.tsx +15 -4
  407. package/src/features/facets/DocumentsFacetsNav.tsx +25 -8
  408. package/src/features/facets/FacetQueryHandlers.test.ts +84 -0
  409. package/src/features/facets/InteractionsFacetsNav.tsx +20 -4
  410. package/src/features/facets/PromptsFacetsNav.tsx +15 -4
  411. package/src/features/facets/RunsFacetsNav.test.ts +59 -0
  412. package/src/features/facets/RunsFacetsNav.tsx +40 -30
  413. package/src/features/facets/WorkflowExecutionsFacetsNav.test.ts +57 -0
  414. package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +36 -16
  415. package/src/features/facets/index.ts +1 -0
  416. package/src/features/facets/utils/SearchInterface.tsx +12 -3
  417. package/src/features/layout/GenericPageNavHeader.tsx +16 -0
  418. package/src/features/magic-pdf/DownloadPopover.tsx +1 -2
  419. package/src/features/magic-pdf/GroundedExtractionView.test.tsx +7 -1
  420. package/src/features/magic-pdf/GroundedExtractionView.tsx +162 -242
  421. package/src/features/oauth/McpConnectionsButton.test.tsx +18 -1
  422. package/src/features/oauth/McpConnectionsButton.tsx +6 -2
  423. package/src/features/oauth/McpConnectionsDialog.tsx +3 -3
  424. package/src/features/oauth/useMcpConnections.test.ts +1 -0
  425. package/src/features/oauth/useMcpConnections.ts +24 -7
  426. package/src/features/pdf-viewer/PdfPageRenderer.tsx +76 -71
  427. package/src/features/pdf-viewer/lazyReactPdf.ts +33 -0
  428. package/src/features/store/collections/CollectionsTable.tsx +1 -4
  429. package/src/features/store/collections/EditCollectionView.tsx +1 -1
  430. package/src/features/store/objects/ExportPropertiesModal.tsx +25 -16
  431. package/src/features/store/objects/components/ContentOverview.tsx +2 -28
  432. package/src/features/store/objects/components/TextEditorPanel.tsx +13 -3
  433. package/src/features/store/objects/layout/renderers.tsx +1 -6
  434. package/src/features/store/objects/search/DocumentSearchContext.test.ts +45 -0
  435. package/src/features/store/objects/search/DocumentSearchContext.ts +54 -4
  436. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +5 -0
  437. package/src/features/store/objects/upload/DocumentUploadModal.tsx +10 -3
  438. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +15 -6
  439. package/src/features/store/types/ContentObjectTypesTable.tsx +1 -4
  440. package/src/features/store/types/IntakePolicyEditor.tsx +14 -5
  441. package/src/features/store/types/IntakePolicyForm.tsx +120 -20
  442. package/src/features/store/types/ObjectSchemaEditor.tsx +6 -2
  443. package/src/features/store/types/TableLayoutEditor.tsx +2 -0
  444. package/src/features/user/UserInfo.test.tsx +10 -0
  445. package/src/features/user/UserInfo.tsx +2 -7
  446. package/src/features/views/ViewActions.test.tsx +80 -0
  447. package/src/features/views/ViewActions.tsx +352 -0
  448. package/src/features/views/ViewDropTarget.test.tsx +150 -0
  449. package/src/features/views/ViewDropTarget.tsx +140 -0
  450. package/src/features/views/ViewExperience.test.tsx +72 -0
  451. package/src/features/views/ViewExperience.tsx +189 -22
  452. package/src/features/views/ViewMedia.test.tsx +180 -0
  453. package/src/features/views/ViewNavigation.test.tsx +42 -0
  454. package/src/features/views/ViewNavigation.tsx +43 -5
  455. package/src/features/views/ViewResults.tsx +243 -26
  456. package/src/features/views/index.ts +1 -0
  457. package/src/features/views/types.ts +50 -0
  458. package/src/features/views/viewState.test.ts +7 -1
  459. package/src/features/views/viewState.ts +32 -0
  460. package/src/i18n/LanguageProvider.tsx +15 -8
  461. package/src/i18n/instance.test.ts +30 -0
  462. package/src/i18n/instance.ts +67 -40
  463. package/src/i18n/locales/ar.json +1192 -911
  464. package/src/i18n/locales/de.json +1148 -867
  465. package/src/i18n/locales/en.json +65 -4
  466. package/src/i18n/locales/es.json +1159 -878
  467. package/src/i18n/locales/fr.json +1159 -878
  468. package/src/i18n/locales/it.json +1159 -878
  469. package/src/i18n/locales/ja.json +1148 -866
  470. package/src/i18n/locales/ko.json +1148 -866
  471. package/src/i18n/locales/pt.json +1159 -878
  472. package/src/i18n/locales/ru.json +1170 -889
  473. package/src/i18n/locales/tr.json +1148 -867
  474. package/src/i18n/locales/zh-TW.json +1148 -866
  475. package/src/i18n/locales/zh.json +1148 -866
  476. package/src/i18n/rtl.test.ts +16 -7
  477. package/src/rich-text/VertesiaRichTextEditor.test.tsx +33 -1
  478. package/src/router/RouteComponent.test.tsx +139 -0
  479. package/src/router/RouteComponent.tsx +54 -9
  480. package/src/session/UserSessionProvider.tsx +20 -31
  481. package/src/session/auth/composable.scope.test.ts +1 -1
  482. package/src/session/auth/composable.test.ts +61 -1
  483. package/src/session/auth/composable.ts +29 -23
  484. package/src/session/auth/domainRouting.test.ts +24 -1
  485. package/src/session/auth/domainRouting.ts +29 -0
  486. package/src/session/auth/firebase.ts +1 -1
  487. package/src/session/useUXTracking.tsx +6 -1
  488. package/src/shell/VertesiaShell.tsx +2 -0
  489. package/src/shell/apps/IframeAppContextSync.test.tsx +196 -0
  490. package/src/shell/apps/IframeAppContextSync.tsx +101 -0
  491. package/src/shell/apps/iframe-auth.test.ts +118 -0
  492. package/src/shell/apps/iframe-auth.ts +193 -0
  493. package/src/shell/apps/index.ts +2 -0
  494. package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +12 -3
  495. package/src/widgets/markdown/MarkdownRenderer.tsx +50 -2
  496. package/src/widgets/markdown/MermaidDiagram.tsx +38 -22
  497. package/src/widgets/monacoEditor/MonacoEditor.tsx +27 -20
  498. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +0 -25
  499. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +0 -1
  500. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +0 -42
  501. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +0 -1
  502. package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +0 -86
@@ -0,0 +1,193 @@
1
+ import { SUPPORTED_LANGUAGES, type SupportedLanguage } from '../../i18n/rtl.js';
2
+
3
+ export const IFRAME_AUTH_REQUEST = 'vertesia:iframe-auth-request';
4
+ export const IFRAME_AUTH_RESPONSE = 'vertesia:iframe-auth-response';
5
+ export const IFRAME_APP_CONTEXT_REQUEST = 'vertesia:iframe-context-request';
6
+ export const IFRAME_APP_CONTEXT = 'vertesia:iframe-context';
7
+ export const IFRAME_APP_NAVIGATE = 'vertesia:iframe-navigate';
8
+ export const IFRAME_APP_LOCATION_CHANGE = 'vertesia:iframe-location-change';
9
+ export const IFRAME_APP_SLOT_PARAM = '__vertesia_slot';
10
+ export const IFRAME_APP_HOST_ORIGIN_PARAM = '__vertesia_host_origin';
11
+ export const IFRAME_APP_CONTENT_SLOT = 'content';
12
+
13
+ export interface IframeAuthRequest {
14
+ type: typeof IFRAME_AUTH_REQUEST;
15
+ requestId: string;
16
+ }
17
+
18
+ export interface IframeAuthResponse {
19
+ type: typeof IFRAME_AUTH_RESPONSE;
20
+ requestId: string;
21
+ token?: string;
22
+ }
23
+
24
+ export interface IframeAppContextRequest {
25
+ type: typeof IFRAME_APP_CONTEXT_REQUEST;
26
+ }
27
+
28
+ export interface IframeAppContext {
29
+ type: typeof IFRAME_APP_CONTEXT;
30
+ theme: 'dark' | 'light' | 'system';
31
+ language: SupportedLanguage;
32
+ }
33
+
34
+ export interface IframeAppNavigate {
35
+ type: typeof IFRAME_APP_NAVIGATE;
36
+ url: string;
37
+ }
38
+
39
+ export interface IframeAppLocationChange {
40
+ type: typeof IFRAME_APP_LOCATION_CHANGE;
41
+ url: string;
42
+ }
43
+
44
+ export function isIframeAuthRequest(value: unknown): value is IframeAuthRequest {
45
+ if (!value || typeof value !== 'object') return false;
46
+ const message = value as Partial<IframeAuthRequest>;
47
+ return message.type === IFRAME_AUTH_REQUEST && typeof message.requestId === 'string' && !!message.requestId;
48
+ }
49
+
50
+ export function isIframeAuthResponse(value: unknown): value is IframeAuthResponse {
51
+ if (!value || typeof value !== 'object') return false;
52
+ const message = value as Partial<IframeAuthResponse>;
53
+ return (
54
+ message.type === IFRAME_AUTH_RESPONSE &&
55
+ typeof message.requestId === 'string' &&
56
+ !!message.requestId &&
57
+ (message.token === undefined || typeof message.token === 'string')
58
+ );
59
+ }
60
+
61
+ export function isIframeAppContextRequest(value: unknown): value is IframeAppContextRequest {
62
+ if (!value || typeof value !== 'object') return false;
63
+ return (value as Partial<IframeAppContextRequest>).type === IFRAME_APP_CONTEXT_REQUEST;
64
+ }
65
+
66
+ export function isIframeAppContext(value: unknown): value is IframeAppContext {
67
+ if (!value || typeof value !== 'object') return false;
68
+ const message = value as Partial<IframeAppContext>;
69
+ return (
70
+ message.type === IFRAME_APP_CONTEXT &&
71
+ (message.theme === 'dark' || message.theme === 'light' || message.theme === 'system') &&
72
+ typeof message.language === 'string' &&
73
+ (SUPPORTED_LANGUAGES as readonly string[]).includes(message.language)
74
+ );
75
+ }
76
+
77
+ export function isIframeAppNavigate(value: unknown): value is IframeAppNavigate {
78
+ if (!value || typeof value !== 'object') return false;
79
+ const message = value as Partial<IframeAppNavigate>;
80
+ return message.type === IFRAME_APP_NAVIGATE && typeof message.url === 'string' && !!message.url;
81
+ }
82
+
83
+ export function isIframeAppLocationChange(value: unknown): value is IframeAppLocationChange {
84
+ if (!value || typeof value !== 'object') return false;
85
+ const message = value as Partial<IframeAppLocationChange>;
86
+ return message.type === IFRAME_APP_LOCATION_CHANGE && typeof message.url === 'string' && !!message.url;
87
+ }
88
+
89
+ const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);
90
+
91
+ function parseHttpOrigin(value: string | null | undefined): URL | undefined {
92
+ if (!value) return undefined;
93
+ try {
94
+ const url = new URL(value);
95
+ const isLoopback = LOOPBACK_HOSTS.has(url.hostname);
96
+ return url.protocol === 'https:' || (url.protocol === 'http:' && isLoopback) ? url : undefined;
97
+ } catch {
98
+ return undefined;
99
+ }
100
+ }
101
+
102
+ function hasEmbeddedCredentials(value: string | null | undefined): boolean {
103
+ if (!value) return false;
104
+ const normalized = value.trim();
105
+ const schemeEnd = normalized.indexOf('://');
106
+ if (schemeEnd < 0) return false;
107
+
108
+ const authorityStart = schemeEnd + 3;
109
+ const authoritySuffix = normalized.slice(authorityStart);
110
+ const authorityEnd = authoritySuffix.search(/[/?#]/);
111
+ const authority = authorityEnd < 0 ? authoritySuffix : authoritySuffix.slice(0, authorityEnd);
112
+ return authority.includes('@');
113
+ }
114
+
115
+ function isVertesiaStudioHost(host: string): boolean {
116
+ if (host === 'studio.vertesia.io') return true;
117
+
118
+ const labels = host.split('.');
119
+ if (labels.at(-2) !== 'vertesia' || labels.at(-1) !== 'io') return false;
120
+
121
+ const platformLabels = labels.slice(0, -2);
122
+ const cloudIndex = platformLabels.lastIndexOf('cloud');
123
+ if (cloudIndex >= 0 && platformLabels.length - cloudIndex <= 2) return true;
124
+
125
+ const uiIndex = platformLabels.lastIndexOf('ui');
126
+ return uiIndex >= 0 && platformLabels.length - uiIndex === 2;
127
+ }
128
+
129
+ function parseTrustedIframeHostOrigin(value: string | null | undefined): string | undefined {
130
+ if (hasEmbeddedCredentials(value)) return undefined;
131
+ const url = parseHttpOrigin(value);
132
+ if (!url) return undefined;
133
+
134
+ const host = url.hostname;
135
+ const isStudioHost = isVertesiaStudioHost(host);
136
+ const isLocalDevelopment = LOOPBACK_HOSTS.has(host) && LOOPBACK_HOSTS.has(window.location.hostname);
137
+ return (url.protocol === 'https:' && isStudioHost) || isLocalDevelopment ? url.origin : undefined;
138
+ }
139
+
140
+ /**
141
+ * Resolve a trusted embedding Studio origin without relying on referrer surviving a reload or auth redirect.
142
+ * The URL value is a continuity hint rather than a trust anchor: only Studio UI host patterns are accepted, and
143
+ * loopback parents are accepted only when the child app is also running on loopback.
144
+ */
145
+ export function resolveIframeHostOrigin(): string | undefined {
146
+ if (window.parent === window) return undefined;
147
+
148
+ const explicitOrigin = parseTrustedIframeHostOrigin(
149
+ new URL(window.location.href).searchParams.get(IFRAME_APP_HOST_ORIGIN_PARAM),
150
+ );
151
+ if (explicitOrigin) return explicitOrigin;
152
+
153
+ return parseTrustedIframeHostOrigin(document.referrer);
154
+ }
155
+
156
+ /**
157
+ * Ask an embedding Studio window for a fresh Vertesia token. Both sides validate the request nonce,
158
+ * source window, and exact origin. The explicit host-origin parameter survives framed redirects and
159
+ * hard navigations; referrer remains a compatibility fallback for older hosts.
160
+ * Standalone/top-level apps return undefined and continue through the normal sign-in flow.
161
+ */
162
+ export function requestIframeHostAuthToken(timeoutMs = 5000): Promise<string | undefined> {
163
+ const parentOrigin = resolveIframeHostOrigin();
164
+ if (!parentOrigin) return Promise.resolve(undefined);
165
+
166
+ const requestId = crypto.randomUUID();
167
+ return new Promise((resolve) => {
168
+ let timeout: number;
169
+ let retry: number;
170
+ let retryDelay = 250;
171
+ const finish = (token?: string) => {
172
+ window.removeEventListener('message', onMessage);
173
+ clearTimeout(timeout);
174
+ clearTimeout(retry);
175
+ resolve(token);
176
+ };
177
+ const onMessage = (event: MessageEvent<unknown>) => {
178
+ if (event.source !== window.parent || event.origin !== parentOrigin || !isIframeAuthResponse(event.data)) {
179
+ return;
180
+ }
181
+ if (event.data.requestId === requestId && event.data.token) finish(event.data.token);
182
+ };
183
+ const request = { type: IFRAME_AUTH_REQUEST, requestId } satisfies IframeAuthRequest;
184
+ const sendRequest = () => {
185
+ window.parent.postMessage(request, parentOrigin);
186
+ retry = window.setTimeout(sendRequest, retryDelay);
187
+ retryDelay = Math.min(retryDelay * 2, 1000);
188
+ };
189
+ timeout = window.setTimeout(() => finish(), timeoutMs);
190
+ window.addEventListener('message', onMessage);
191
+ sendRequest();
192
+ });
193
+ }
@@ -1,3 +1,5 @@
1
1
  export * from './AppInstallationProvider';
2
2
  export * from './AppProjectSelector';
3
+ export * from './IframeAppContextSync';
4
+ export * from './iframe-auth';
3
5
  export * from './StandaloneApp';
@@ -44,6 +44,7 @@ function renderSurface(props?: {
44
44
  onSendChangesToAgent?: () => void;
45
45
  hasUnsentChanges?: boolean;
46
46
  toolbarStatus?: React.ReactNode;
47
+ onContentChange?: (content: string, generation?: string) => void;
47
48
  flushChangesRef?: React.MutableRefObject<(() => Promise<false | ArtifactEditingSurfaceDocumentEdit>) | null>;
48
49
  }) {
49
50
  return render(
@@ -61,6 +62,7 @@ function renderSurface(props?: {
61
62
  onSendChangesToAgent={props?.onSendChangesToAgent}
62
63
  hasUnsentChanges={props?.hasUnsentChanges}
63
64
  toolbarStatus={props?.toolbarStatus}
65
+ onContentChange={props?.onContentChange}
64
66
  flushChangesRef={props?.flushChangesRef}
65
67
  />
66
68
  </I18nProvider>,
@@ -292,6 +294,7 @@ describe('ArtifactEditingSurface', () => {
292
294
 
293
295
  it('rebases focused full-document edits over a non-overlapping agent change after 412', async () => {
294
296
  const user = userEvent.setup();
297
+ const onContentChange = vi.fn();
295
298
  const baseContent = 'First paragraph.\n\nSecond paragraph.';
296
299
  const remoteContent = 'First paragraph updated remotely.\n\nSecond paragraph.';
297
300
  mocks.getArtifactContent
@@ -314,16 +317,22 @@ describe('ArtifactEditingSurface', () => {
314
317
  .mockRejectedValueOnce({ status: 412 })
315
318
  .mockResolvedValueOnce({ path: 'drafts/document.md', generation: 'generation-merged' });
316
319
 
317
- const view = renderSurface({ viewMode: 'document' });
320
+ const view = renderSurface({ viewMode: 'document', onContentChange });
318
321
  const editor = await screen.findByRole('textbox', { name: 'Markdown document editor' }, LAZY_EDITOR_WAIT);
319
322
  await user.click(editor);
320
323
 
321
324
  view.rerender(
322
325
  <I18nProvider lng="en">
323
- <ArtifactEditingSurface runId="run-1" path="drafts/document.md" refreshKey={1} viewMode="document" />
326
+ <ArtifactEditingSurface
327
+ runId="run-1"
328
+ path="drafts/document.md"
329
+ refreshKey={1}
330
+ viewMode="document"
331
+ onContentChange={onContentChange}
332
+ />
324
333
  </I18nProvider>,
325
334
  );
326
- await waitFor(() => expect(mocks.getArtifactContent).toHaveBeenCalledTimes(2));
335
+ await waitFor(() => expect(onContentChange).toHaveBeenCalledWith(remoteContent, 'generation-agent'));
327
336
 
328
337
  editor.focus();
329
338
  const secondParagraphText = editor.querySelectorAll('p')[1]?.firstChild;
@@ -1,7 +1,6 @@
1
1
  import type { Element } from 'hast';
2
2
  import React from 'react';
3
3
  import Markdown, { type Components, defaultUrlTransform } from 'react-markdown';
4
- import rehypeKatex from 'rehype-katex';
5
4
  import { defListHastHandlers, remarkDefinitionList } from 'remark-definition-list';
6
5
  import remarkDirective from 'remark-directive';
7
6
  import remarkGfm from 'remark-gfm';
@@ -24,6 +23,55 @@ type MarkdownTree = Parameters<typeof visit>[0];
24
23
  type MarkdownNode = { value?: unknown };
25
24
  type MarkdownParent = { children?: unknown[] };
26
25
  type RemarkPluginList = NonNullable<React.ComponentProps<typeof Markdown>['remarkPlugins']>;
26
+ type RehypePluginList = NonNullable<React.ComponentProps<typeof Markdown>['rehypePlugins']>;
27
+ type RehypePlugin = RehypePluginList[number];
28
+
29
+ // A `$` that the math preprocessor left unescaped — the only way remark-math can produce a math
30
+ // node. Currency is escaped to `\$` by `preprocessMathDelimiters`, so it does not match.
31
+ const MATH_DELIMITER_REGEX = /(?:^|[^\\])\$/;
32
+ const NO_REHYPE_PLUGINS: RehypePluginList = [];
33
+
34
+ let rehypeKatex: RehypePlugin | undefined;
35
+ let rehypeKatexPromise: Promise<RehypePlugin> | undefined;
36
+
37
+ function loadRehypeKatex(): Promise<RehypePlugin> {
38
+ if (!rehypeKatexPromise) {
39
+ rehypeKatexPromise = import('rehype-katex').then(({ default: plugin }) => {
40
+ rehypeKatex = plugin;
41
+ return plugin;
42
+ });
43
+ }
44
+ return rehypeKatexPromise;
45
+ }
46
+
47
+ /**
48
+ * KaTeX is ~250 KB and most markdown has no math in it, so it is fetched the first time a document
49
+ * containing math delimiters is rendered. Until it resolves, math renders unstyled; once loaded it
50
+ * stays loaded for the rest of the session and later renderers pick it up without a second pass.
51
+ */
52
+ function useRehypePlugins(markdown: string): RehypePluginList {
53
+ const hasMath = React.useMemo(() => MATH_DELIMITER_REGEX.test(markdown), [markdown]);
54
+ const [plugin, setPlugin] = React.useState(() => rehypeKatex);
55
+
56
+ React.useEffect(() => {
57
+ if (!hasMath || plugin) return;
58
+ let cancelled = false;
59
+ loadRehypeKatex()
60
+ .then((loaded) => {
61
+ if (!cancelled) {
62
+ setPlugin(() => loaded);
63
+ }
64
+ })
65
+ .catch((err: unknown) => {
66
+ console.error('Failed to load KaTeX; math will render unstyled', err);
67
+ });
68
+ return () => {
69
+ cancelled = true;
70
+ };
71
+ }, [hasMath, plugin]);
72
+
73
+ return React.useMemo(() => (plugin ? [plugin] : NO_REHYPE_PLUGINS), [plugin]);
74
+ }
27
75
 
28
76
  // Custom URL schemes that we handle in our components
29
77
  const ALLOWED_CUSTOM_SCHEMES = [
@@ -151,7 +199,7 @@ export function MarkdownRenderer({
151
199
  }, [remarkPlugins, removeComments]);
152
200
 
153
201
  // Rehype plugins (HTML processing, including KaTeX for math)
154
- const rehypePluginsArray = React.useMemo(() => [rehypeKatex], []);
202
+ const rehypePluginsArray = useRehypePlugins(normalizedMarkdown);
155
203
 
156
204
  // Remark-rehype bridge options (custom AST handlers for definition lists)
157
205
  const remarkRehypeOptions = React.useMemo(
@@ -1,6 +1,7 @@
1
- import mermaid from 'mermaid';
2
1
  import { useEffect, useId, useRef, useState } from 'react';
3
2
 
3
+ type Mermaid = typeof import('mermaid').default;
4
+
4
5
  const MERMAID_FONT_FAMILY =
5
6
  'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
6
7
 
@@ -78,27 +79,41 @@ export function makeSvgResponsive(svg: string): string {
78
79
  });
79
80
  }
80
81
 
81
- // Initialize mermaid with a browser-focused config close to Mermaid Playground defaults.
82
- mermaid.initialize({
83
- startOnLoad: false,
84
- theme: 'default',
85
- securityLevel: 'loose',
86
- fontFamily: MERMAID_FONT_FAMILY,
87
- suppressErrorRendering: true,
88
- flowchart: {
89
- htmlLabels: true,
90
- useMaxWidth: true,
91
- nodeSpacing: 40,
92
- rankSpacing: 50,
93
- padding: 12,
94
- },
95
- sequence: {
96
- useMaxWidth: true,
97
- },
98
- themeVariables: {
99
- fontFamily: MERMAID_FONT_FAMILY,
100
- },
101
- });
82
+ let mermaidPromise: Promise<Mermaid> | undefined;
83
+
84
+ /**
85
+ * Load Mermaid on first render of a diagram, initialized with a browser-focused config close to
86
+ * Mermaid Playground defaults. Mermaid is several hundred KB and most pages never render a diagram,
87
+ * so it is imported dynamically to keep it out of the eager bundle of every consuming app.
88
+ */
89
+ function loadMermaid(): Promise<Mermaid> {
90
+ if (!mermaidPromise) {
91
+ mermaidPromise = import('mermaid').then(({ default: mermaid }) => {
92
+ mermaid.initialize({
93
+ startOnLoad: false,
94
+ theme: 'default',
95
+ securityLevel: 'loose',
96
+ fontFamily: MERMAID_FONT_FAMILY,
97
+ suppressErrorRendering: true,
98
+ flowchart: {
99
+ htmlLabels: true,
100
+ useMaxWidth: true,
101
+ nodeSpacing: 40,
102
+ rankSpacing: 50,
103
+ padding: 12,
104
+ },
105
+ sequence: {
106
+ useMaxWidth: true,
107
+ },
108
+ themeVariables: {
109
+ fontFamily: MERMAID_FONT_FAMILY,
110
+ },
111
+ });
112
+ return mermaid;
113
+ });
114
+ }
115
+ return mermaidPromise;
116
+ }
102
117
 
103
118
  export interface MermaidDiagramProps {
104
119
  /** The mermaid diagram code */
@@ -147,6 +162,7 @@ export function MermaidDiagram({ code, className }: MermaidDiagramProps) {
147
162
  const normalizedCode = normalizeMermaidCodeForBrowser(code);
148
163
 
149
164
  // Render the diagram
165
+ const mermaid = await loadMermaid();
150
166
  const { svg: renderedSvg } = await mermaid.render(id, normalizedCode);
151
167
  const responsiveSvg = makeSvgResponsive(renderedSvg);
152
168
 
@@ -1,11 +1,16 @@
1
- import { Editor } from '@monaco-editor/react';
2
1
  import { useTheme } from '@vertesia/ui/core';
3
2
  import clsx from 'clsx';
4
3
  import debounce from 'debounce';
5
4
  import type * as monaco from 'monaco-editor';
6
- import { type RefObject, useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
+ import { lazy, type RefObject, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
6
  import { registerCustomFoldingProviders } from './foldingProviders.js';
8
7
 
8
+ /**
9
+ * The Monaco React wrapper drags in the Monaco loader (and, once mounted, the editor itself) on
10
+ * import. Most screens never open an editor, so it is fetched on first render instead.
11
+ */
12
+ const Editor = lazy(() => import('@monaco-editor/react').then(({ Editor: component }) => ({ default: component })));
13
+
9
14
  export type Monaco = typeof monaco;
10
15
 
11
16
  /**
@@ -343,24 +348,26 @@ export function MonacoEditor({
343
348
 
344
349
  return (
345
350
  <div className={clsx(className, 'w-full h-full!')}>
346
- <Editor
347
- className="h-full w-full"
348
- height="100%"
349
- theme={resolvedTheme === 'dark' ? 'vs-dark' : 'light'}
350
- language={language}
351
- path={modelPath}
352
- onChange={handleEditorChange}
353
- onMount={handleEditorDidMount}
354
- beforeMount={beforeMount}
355
- options={defaultOptions}
356
- // Uncontrolled: seed the initial content once via `defaultValue` and never bind a
357
- // reactive `value`. @monaco-editor/react re-applies a changed `value` prop through
358
- // `executeEdits(..., forceMoveMarkers: true)` whenever it differs from the live
359
- // model, snapping the caret to the END of the content — the cursor jump we are
360
- // eliminating whenever a caller feeds its own onChange output back into `value`.
361
- // All external updates instead flow through the focus-guarded sync effect above.
362
- defaultValue={effectiveValue}
363
- />
351
+ <Suspense fallback={<div className="h-full w-full" />}>
352
+ <Editor
353
+ className="h-full w-full"
354
+ height="100%"
355
+ theme={resolvedTheme === 'dark' ? 'vs-dark' : 'light'}
356
+ language={language}
357
+ path={modelPath}
358
+ onChange={handleEditorChange}
359
+ onMount={handleEditorDidMount}
360
+ beforeMount={beforeMount}
361
+ options={defaultOptions}
362
+ // Uncontrolled: seed the initial content once via `defaultValue` and never bind a
363
+ // reactive `value`. @monaco-editor/react re-applies a changed `value` prop through
364
+ // `executeEdits(..., forceMoveMarkers: true)` whenever it differs from the live
365
+ // model, snapping the caret to the END of the content — the cursor jump we are
366
+ // eliminating whenever a caller feeds its own onChange output back into `value`.
367
+ // All external updates instead flow through the focus-guarded sync effect above.
368
+ defaultValue={effectiveValue}
369
+ />
370
+ </Suspense>
364
371
  </div>
365
372
  );
366
373
  }
@@ -1,25 +0,0 @@
1
- interface GroundedExtractionAssistantPanelProps {
2
- objectId: string;
3
- /**
4
- * Called after the assistant finishes a turn (which may have applied a grounded
5
- * edit) so the grounded view can re-fetch and re-render the data + citation boxes.
6
- */
7
- onExtractionChanged?: () => void;
8
- /**
9
- * The field path currently selected in the view. When set (before the
10
- * conversation starts), it seeds the assistant: the first message is scoped to
11
- * this field so "click a field, say what's wrong" reaches the model.
12
- */
13
- selectedField?: string;
14
- onClose?: () => void;
15
- }
16
- /**
17
- * Interactive assistant embedded in the grounded-extraction view. Starts the
18
- * server-side GroundedExtractionAssistant conversation (recordRun -> stage the
19
- * document into the agent space -> launch interactive), then renders the live
20
- * conversation. Each completed turn triggers `onExtractionChanged` so an operator's
21
- * grounded edits appear in the data tree + citation overlay without a manual reload.
22
- */
23
- export declare function GroundedExtractionAssistantPanel({ objectId, onExtractionChanged, selectedField, onClose, }: GroundedExtractionAssistantPanelProps): import("react").JSX.Element;
24
- export {};
25
- //# sourceMappingURL=GroundedExtractionAssistantPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroundedExtractionAssistantPanel.d.ts","sourceRoot":"","sources":["../../../src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx"],"names":[],"mappings":"AAKA,UAAU,qCAAqC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,EAC7C,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,OAAO,GACV,EAAE,qCAAqC,+BAoDvC"}
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useUITranslation } from '@vertesia/ui/i18n';
3
- import { useUserSession } from '@vertesia/ui/session';
4
- import { useCallback, useRef, useState } from 'react';
5
- import { ModernAgentConversation } from '../agent/chat';
6
- /**
7
- * Interactive assistant embedded in the grounded-extraction view. Starts the
8
- * server-side GroundedExtractionAssistant conversation (recordRun -> stage the
9
- * document into the agent space -> launch interactive), then renders the live
10
- * conversation. Each completed turn triggers `onExtractionChanged` so an operator's
11
- * grounded edits appear in the data tree + citation overlay without a manual reload.
12
- */
13
- export function GroundedExtractionAssistantPanel({ objectId, onExtractionChanged, selectedField, onClose, }) {
14
- const { t } = useUITranslation();
15
- const { client } = useUserSession();
16
- const [agentRunId, setAgentRunId] = useState(undefined);
17
- // Keep the latest callback/selection without re-creating the handlers each render.
18
- const changedRef = useRef(onExtractionChanged);
19
- changedRef.current = onExtractionChanged;
20
- const selectedRef = useRef(selectedField);
21
- selectedRef.current = selectedField;
22
- const startWorkflow = useCallback(async (initialMessage) => {
23
- const field = selectedRef.current;
24
- // Scope the opening message to the field the operator had selected, so
25
- // "click a field, say what's wrong" reaches the model with the target.
26
- const prompt = field && initialMessage ? `Regarding the field "${field}": ${initialMessage}` : initialMessage;
27
- const res = await client.store.objects
28
- .analyze(objectId)
29
- .startGroundedAssistant(prompt ? { user_prompt: prompt } : {});
30
- setAgentRunId(res.agent_run_id);
31
- return { agent_run_id: res.agent_run_id };
32
- }, [client, objectId]);
33
- // The agent re-enables the follow-up input when a turn completes; that turn may
34
- // have applied a grounded edit, so refresh the extraction at that point.
35
- const handleShowInputChange = useCallback((canSendFollowUp) => {
36
- if (canSendFollowUp) {
37
- changedRef.current?.();
38
- }
39
- }, []);
40
- return (_jsxs("div", { className: "flex h-full flex-col", children: [selectedField && !agentRunId && (_jsxs("div", { className: "shrink-0 border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground", children: [t('grounded.assistantField'), " ", _jsx("span", { className: "font-mono text-foreground", children: selectedField })] })), _jsx(ModernAgentConversation, { agentRunId: agentRunId, startWorkflow: startWorkflow, interactive: true, fullWidth: true, hideObjectLinking: true, onShowInputChange: handleShowInputChange, onClose: onClose })] }));
41
- }
42
- //# sourceMappingURL=GroundedExtractionAssistantPanel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroundedExtractionAssistantPanel.js","sourceRoot":"","sources":["../../../src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAwB,MAAM,eAAe,CAAC;AAkB9E;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAAC,EAC7C,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,OAAO,GAC6B;IACpC,MAAM,EAAE,CAAC,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IACpC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAC5E,mFAAmF;IACnF,MAAM,UAAU,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAC/C,UAAU,CAAC,OAAO,GAAG,mBAAmB,CAAC;IACzC,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;IAC1C,WAAW,CAAC,OAAO,GAAG,aAAa,CAAC;IAEpC,MAAM,aAAa,GAAoB,WAAW,CAC9C,KAAK,EAAE,cAAc,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC;QAClC,uEAAuE;QACvE,uEAAuE;QACvE,MAAM,MAAM,GACR,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,wBAAwB,KAAK,MAAM,cAAc,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QACnG,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO;aACjC,OAAO,CAAC,QAAQ,CAAC;aACjB,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACnE,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAChC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;IAC9C,CAAC,EACD,CAAC,MAAM,EAAE,QAAQ,CAAC,CACrB,CAAC;IAEF,gFAAgF;IAChF,yEAAyE;IACzE,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,eAAwB,EAAE,EAAE;QACnE,IAAI,eAAe,EAAE,CAAC;YAClB,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;QAC3B,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,eAAK,SAAS,EAAC,sBAAsB,aAChC,aAAa,IAAI,CAAC,UAAU,IAAI,CAC7B,eAAK,SAAS,EAAC,uFAAuF,aACjG,CAAC,CAAC,yBAAyB,CAAC,OAAE,eAAM,SAAS,EAAC,2BAA2B,YAAE,aAAa,GAAQ,IAC/F,CACT,EACD,KAAC,uBAAuB,IACpB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,WAAW,QACX,SAAS,QACT,iBAAiB,QACjB,iBAAiB,EAAE,qBAAqB,EACxC,OAAO,EAAE,OAAO,GAClB,IACA,CACT,CAAC;AACN,CAAC"}
@@ -1,86 +0,0 @@
1
- import { useUITranslation } from '@vertesia/ui/i18n';
2
- import { useUserSession } from '@vertesia/ui/session';
3
- import { useCallback, useRef, useState } from 'react';
4
- import { ModernAgentConversation, type StartWorkflowFn } from '../agent/chat';
5
-
6
- interface GroundedExtractionAssistantPanelProps {
7
- objectId: string;
8
- /**
9
- * Called after the assistant finishes a turn (which may have applied a grounded
10
- * edit) so the grounded view can re-fetch and re-render the data + citation boxes.
11
- */
12
- onExtractionChanged?: () => void;
13
- /**
14
- * The field path currently selected in the view. When set (before the
15
- * conversation starts), it seeds the assistant: the first message is scoped to
16
- * this field so "click a field, say what's wrong" reaches the model.
17
- */
18
- selectedField?: string;
19
- onClose?: () => void;
20
- }
21
-
22
- /**
23
- * Interactive assistant embedded in the grounded-extraction view. Starts the
24
- * server-side GroundedExtractionAssistant conversation (recordRun -> stage the
25
- * document into the agent space -> launch interactive), then renders the live
26
- * conversation. Each completed turn triggers `onExtractionChanged` so an operator's
27
- * grounded edits appear in the data tree + citation overlay without a manual reload.
28
- */
29
- export function GroundedExtractionAssistantPanel({
30
- objectId,
31
- onExtractionChanged,
32
- selectedField,
33
- onClose,
34
- }: GroundedExtractionAssistantPanelProps) {
35
- const { t } = useUITranslation();
36
- const { client } = useUserSession();
37
- const [agentRunId, setAgentRunId] = useState<string | undefined>(undefined);
38
- // Keep the latest callback/selection without re-creating the handlers each render.
39
- const changedRef = useRef(onExtractionChanged);
40
- changedRef.current = onExtractionChanged;
41
- const selectedRef = useRef(selectedField);
42
- selectedRef.current = selectedField;
43
-
44
- const startWorkflow: StartWorkflowFn = useCallback(
45
- async (initialMessage) => {
46
- const field = selectedRef.current;
47
- // Scope the opening message to the field the operator had selected, so
48
- // "click a field, say what's wrong" reaches the model with the target.
49
- const prompt =
50
- field && initialMessage ? `Regarding the field "${field}": ${initialMessage}` : initialMessage;
51
- const res = await client.store.objects
52
- .analyze(objectId)
53
- .startGroundedAssistant(prompt ? { user_prompt: prompt } : {});
54
- setAgentRunId(res.agent_run_id);
55
- return { agent_run_id: res.agent_run_id };
56
- },
57
- [client, objectId],
58
- );
59
-
60
- // The agent re-enables the follow-up input when a turn completes; that turn may
61
- // have applied a grounded edit, so refresh the extraction at that point.
62
- const handleShowInputChange = useCallback((canSendFollowUp: boolean) => {
63
- if (canSendFollowUp) {
64
- changedRef.current?.();
65
- }
66
- }, []);
67
-
68
- return (
69
- <div className="flex h-full flex-col">
70
- {selectedField && !agentRunId && (
71
- <div className="shrink-0 border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground">
72
- {t('grounded.assistantField')} <span className="font-mono text-foreground">{selectedField}</span>
73
- </div>
74
- )}
75
- <ModernAgentConversation
76
- agentRunId={agentRunId}
77
- startWorkflow={startWorkflow}
78
- interactive
79
- fullWidth
80
- hideObjectLinking
81
- onShowInputChange={handleShowInputChange}
82
- onClose={onClose}
83
- />
84
- </div>
85
- );
86
- }