@vertesia/ui 1.0.0-dev.20260128.144200 → 1.0.0-dev.20260225.024852Z

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 (500) hide show
  1. package/lib/esm/core/components/InputList.js +1 -1
  2. package/lib/esm/core/components/InputList.js.map +1 -1
  3. package/lib/esm/core/components/Overlay.js +1 -1
  4. package/lib/esm/core/components/Overlay.js.map +1 -1
  5. package/lib/esm/core/components/SidePanel.js +8 -2
  6. package/lib/esm/core/components/SidePanel.js.map +1 -1
  7. package/lib/esm/core/components/Switch.js +1 -1
  8. package/lib/esm/core/components/Switch.js.map +1 -1
  9. package/lib/esm/core/components/index.js +0 -8
  10. package/lib/esm/core/components/index.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/MessageBox.js.map +1 -0
  12. package/lib/esm/core/components/shadcn/Panel.js +13 -0
  13. package/lib/esm/core/components/shadcn/Panel.js.map +1 -0
  14. package/lib/esm/core/components/{Badge.js → shadcn/badge.js} +2 -2
  15. package/lib/esm/core/components/shadcn/badge.js.map +1 -0
  16. package/lib/esm/core/components/shadcn/command.js +1 -1
  17. package/lib/esm/core/components/shadcn/command.js.map +1 -1
  18. package/lib/esm/core/components/shadcn/filters/filterBar.js +73 -83
  19. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  20. package/lib/esm/core/components/shadcn/index.js +4 -2
  21. package/lib/esm/core/components/shadcn/index.js.map +1 -1
  22. package/lib/esm/core/components/shadcn/modal/ConfirmModal.js +10 -0
  23. package/lib/esm/core/components/shadcn/modal/ConfirmModal.js.map +1 -0
  24. package/lib/esm/core/components/{DeleteModal.js → shadcn/modal/DeleteModal.js} +1 -1
  25. package/lib/esm/core/components/shadcn/modal/DeleteModal.js.map +1 -0
  26. package/lib/esm/core/components/shadcn/{dialog.js → modal/dialog.js} +19 -15
  27. package/lib/esm/core/components/shadcn/modal/dialog.js.map +1 -0
  28. package/lib/esm/core/components/shadcn/modal/index.js +4 -0
  29. package/lib/esm/core/components/shadcn/modal/index.js.map +1 -0
  30. package/lib/esm/core/components/shadcn/popover.js +4 -2
  31. package/lib/esm/core/components/shadcn/popover.js.map +1 -1
  32. package/lib/esm/core/components/shadcn/selectBox.js +19 -15
  33. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  34. package/lib/esm/core/components/shadcn/tabs.js +16 -14
  35. package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
  36. package/lib/esm/core/components/shadcn/textarea.js +30 -2
  37. package/lib/esm/core/components/shadcn/textarea.js.map +1 -1
  38. package/lib/esm/core/components/shadcn/tooltip.js +5 -1
  39. package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
  40. package/lib/esm/features/agent/PayloadBuilder.js +45 -0
  41. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  42. package/lib/esm/features/agent/chat/AgentChart.js +12 -232
  43. package/lib/esm/features/agent/chat/AgentChart.js.map +1 -1
  44. package/lib/esm/features/agent/chat/AskUserWidget.js +2 -1
  45. package/lib/esm/features/agent/chat/AskUserWidget.js.map +1 -1
  46. package/lib/esm/features/agent/chat/DocumentPanel.js +46 -0
  47. package/lib/esm/features/agent/chat/DocumentPanel.js.map +1 -0
  48. package/lib/esm/features/agent/chat/DocumentTabBar.js +17 -0
  49. package/lib/esm/features/agent/chat/DocumentTabBar.js.map +1 -0
  50. package/lib/esm/features/agent/chat/ModernAgentConversation.js +159 -402
  51. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  52. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +99 -57
  53. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  54. package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +4 -4
  55. package/lib/esm/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
  56. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +4 -4
  57. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  58. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +3 -3
  59. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
  60. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +25 -22
  61. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  62. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +110 -55
  63. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  64. package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js +2 -2
  65. package/lib/esm/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
  66. package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +146 -55
  67. package/lib/esm/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  68. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +5 -6
  69. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  70. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +110 -2
  71. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  72. package/lib/esm/features/agent/chat/SkillWidgetProvider.js +28 -15
  73. package/lib/esm/features/agent/chat/SkillWidgetProvider.js.map +1 -1
  74. package/lib/esm/features/agent/chat/hooks/useAgentPlans.js +146 -0
  75. package/lib/esm/features/agent/chat/hooks/useAgentPlans.js.map +1 -0
  76. package/lib/esm/features/agent/chat/hooks/useAgentStream.js +180 -0
  77. package/lib/esm/features/agent/chat/hooks/useAgentStream.js.map +1 -0
  78. package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js +100 -0
  79. package/lib/esm/features/agent/chat/hooks/useDocumentPanel.js.map +1 -0
  80. package/lib/esm/features/agent/chat/hooks/useFileProcessing.js +90 -0
  81. package/lib/esm/features/agent/chat/hooks/useFileProcessing.js.map +1 -0
  82. package/lib/esm/features/agent/chat/index.js +6 -5
  83. package/lib/esm/features/agent/chat/index.js.map +1 -1
  84. package/lib/esm/features/agent/chat/types/document.js +2 -0
  85. package/lib/esm/features/agent/chat/types/document.js.map +1 -0
  86. package/lib/esm/features/agent/index.js +0 -2
  87. package/lib/esm/features/agent/index.js.map +1 -1
  88. package/lib/esm/features/store/collections/BrowseCollectionView.js +4 -6
  89. package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
  90. package/lib/esm/features/store/collections/CreateCollection.js +4 -4
  91. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  92. package/lib/esm/features/store/collections/EditCollectionView.js +1 -1
  93. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  94. package/lib/esm/features/store/objects/DocumentSearchResults.js +5 -5
  95. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  96. package/lib/esm/features/store/objects/ExportPropertiesModal.js +3 -3
  97. package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -1
  98. package/lib/esm/features/store/objects/components/ContentOverview.js +19 -120
  99. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  100. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +1 -1
  101. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
  102. package/lib/esm/features/store/objects/components/SelectDocumentModal.js +2 -2
  103. package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -1
  104. package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
  105. package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
  106. package/lib/esm/features/store/objects/components/index.js +1 -1
  107. package/lib/esm/features/store/objects/components/index.js.map +1 -1
  108. package/lib/esm/features/store/objects/components/useDownloadFile.js +192 -0
  109. package/lib/esm/features/store/objects/components/useDownloadFile.js.map +1 -0
  110. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +1 -2
  111. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  112. package/lib/esm/features/store/objects/selection/SelectionActions.js +5 -8
  113. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
  114. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +4 -4
  115. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  116. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +2 -2
  117. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -1
  118. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +1 -1
  119. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -1
  120. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +3 -3
  121. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -1
  122. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +13 -13
  123. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  124. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +15 -8
  125. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
  126. package/lib/esm/features/store/types/ObjectSchemaEditor.js +6 -5
  127. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  128. package/lib/esm/features/store/types/SelectContentType.js +3 -3
  129. package/lib/esm/features/store/types/SelectContentType.js.map +1 -1
  130. package/lib/esm/features/store/types/SelectContentTypeModal.js +5 -4
  131. package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -1
  132. package/lib/esm/features/store/types/TableLayoutEditor.js +4 -4
  133. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
  134. package/lib/esm/features/user/UserInfo.js +73 -9
  135. package/lib/esm/features/user/UserInfo.js.map +1 -1
  136. package/lib/esm/features/utils/print.js +0 -1
  137. package/lib/esm/features/utils/print.js.map +1 -1
  138. package/lib/esm/layout/AppLayout.js +3 -4
  139. package/lib/esm/layout/AppLayout.js.map +1 -1
  140. package/lib/esm/layout/Sidebar.js +5 -5
  141. package/lib/esm/layout/Sidebar.js.map +1 -1
  142. package/lib/esm/router/HistoryNavigator.js +7 -1
  143. package/lib/esm/router/HistoryNavigator.js.map +1 -1
  144. package/lib/esm/router/Nav.js +2 -2
  145. package/lib/esm/router/Nav.js.map +1 -1
  146. package/lib/esm/session/UserSession.js +35 -9
  147. package/lib/esm/session/UserSession.js.map +1 -1
  148. package/lib/esm/session/UserSessionProvider.js +3 -2
  149. package/lib/esm/session/UserSessionProvider.js.map +1 -1
  150. package/lib/esm/shell/apps/AppProjectSelector.js +2 -2
  151. package/lib/esm/shell/apps/AppProjectSelector.js.map +1 -1
  152. package/lib/esm/shell/apps/StandaloneApp.js +2 -2
  153. package/lib/esm/shell/apps/StandaloneApp.js.map +1 -1
  154. package/lib/esm/shell/login/InviteAcceptModal.js +2 -2
  155. package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -1
  156. package/lib/esm/shell/login/SignInModal.js +1 -1
  157. package/lib/esm/shell/login/SignInModal.js.map +1 -1
  158. package/lib/esm/shell/login/SignupForm.js +2 -2
  159. package/lib/esm/shell/login/SignupForm.js.map +1 -1
  160. package/lib/esm/shell/login/UserInfo.js +2 -2
  161. package/lib/esm/shell/login/UserInfo.js.map +1 -1
  162. package/lib/esm/widgets/json-view/JSONCode.js +1 -1
  163. package/lib/esm/widgets/json-view/JSONCode.js.map +1 -1
  164. package/lib/esm/widgets/json-view/JSONDisplay.js +1 -1
  165. package/lib/esm/widgets/json-view/JSONDisplay.js.map +1 -1
  166. package/lib/esm/widgets/markdown/ArtifactContentRenderer.js +84 -13
  167. package/lib/esm/widgets/markdown/ArtifactContentRenderer.js.map +1 -1
  168. package/lib/esm/widgets/markdown/MarkdownFigure.js +40 -0
  169. package/lib/esm/widgets/markdown/MarkdownFigure.js.map +1 -0
  170. package/lib/esm/widgets/markdown/MarkdownRenderer.js +42 -7
  171. package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -1
  172. package/lib/esm/widgets/markdown/MermaidDiagram.js +80 -5
  173. package/lib/esm/widgets/markdown/MermaidDiagram.js.map +1 -1
  174. package/lib/esm/widgets/markdown/codeBlockHandlers.js +33 -33
  175. package/lib/esm/widgets/markdown/codeBlockHandlers.js.map +1 -1
  176. package/lib/esm/widgets/markdown/codeBlockHandlers.test.js +2 -29
  177. package/lib/esm/widgets/markdown/codeBlockHandlers.test.js.map +1 -1
  178. package/lib/esm/widgets/markdown/index.js +1 -0
  179. package/lib/esm/widgets/markdown/index.js.map +1 -1
  180. package/lib/esm/widgets/markdown/normalizeCustomSchemeLinks.js +77 -0
  181. package/lib/esm/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -0
  182. package/lib/esm/widgets/markdown/normalizeDirectives.js +45 -0
  183. package/lib/esm/widgets/markdown/normalizeDirectives.js.map +1 -0
  184. package/lib/esm/widgets/markdown/remarkDirectiveHandler.js +96 -0
  185. package/lib/esm/widgets/markdown/remarkDirectiveHandler.js.map +1 -0
  186. package/lib/esm/widgets/monacoEditor/MonacoEditor.js +8 -14
  187. package/lib/esm/widgets/monacoEditor/MonacoEditor.js.map +1 -1
  188. package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -1
  189. package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js +3 -3
  190. package/lib/esm/widgets/schema-editor/editor/PropertyEditor.js.map +1 -1
  191. package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -1
  192. package/lib/tsconfig.tsbuildinfo +1 -1
  193. package/lib/types/core/components/SidePanel.d.ts +4 -1
  194. package/lib/types/core/components/SidePanel.d.ts.map +1 -1
  195. package/lib/types/core/components/index.d.ts +0 -8
  196. package/lib/types/core/components/index.d.ts.map +1 -1
  197. package/lib/types/core/components/shadcn/MessageBox.d.ts.map +1 -0
  198. package/lib/types/core/components/{Panel.d.ts → shadcn/Panel.d.ts} +3 -1
  199. package/lib/types/core/components/shadcn/Panel.d.ts.map +1 -0
  200. package/lib/types/core/components/{Badge.d.ts → shadcn/badge.d.ts} +4 -4
  201. package/lib/types/core/components/shadcn/badge.d.ts.map +1 -0
  202. package/lib/types/core/components/shadcn/button.d.ts +1 -1
  203. package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  204. package/lib/types/core/components/shadcn/index.d.ts +4 -2
  205. package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
  206. package/lib/types/core/components/shadcn/input.d.ts +1 -1
  207. package/lib/types/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -0
  208. package/lib/types/core/components/shadcn/modal/DeleteModal.d.ts.map +1 -0
  209. package/lib/types/core/components/shadcn/{dialog.d.ts → modal/dialog.d.ts} +7 -4
  210. package/lib/types/core/components/shadcn/modal/dialog.d.ts.map +1 -0
  211. package/lib/types/core/components/shadcn/modal/index.d.ts +4 -0
  212. package/lib/types/core/components/shadcn/modal/index.d.ts.map +1 -0
  213. package/lib/types/core/components/shadcn/popover.d.ts.map +1 -1
  214. package/lib/types/core/components/shadcn/selectBox.d.ts +9 -5
  215. package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
  216. package/lib/types/core/components/shadcn/tabs.d.ts +14 -5
  217. package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
  218. package/lib/types/core/components/shadcn/textarea.d.ts +6 -2
  219. package/lib/types/core/components/shadcn/textarea.d.ts.map +1 -1
  220. package/lib/types/core/components/shadcn/tooltip.d.ts.map +1 -1
  221. package/lib/types/features/agent/PayloadBuilder.d.ts +22 -4
  222. package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
  223. package/lib/types/features/agent/chat/AgentChart.d.ts +3 -44
  224. package/lib/types/features/agent/chat/AgentChart.d.ts.map +1 -1
  225. package/lib/types/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  226. package/lib/types/features/agent/chat/DocumentPanel.d.ts +16 -0
  227. package/lib/types/features/agent/chat/DocumentPanel.d.ts.map +1 -0
  228. package/lib/types/features/agent/chat/DocumentTabBar.d.ts +10 -0
  229. package/lib/types/features/agent/chat/DocumentTabBar.d.ts.map +1 -0
  230. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +69 -1
  231. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  232. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +36 -1
  233. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  234. package/lib/types/features/agent/chat/ModernAgentOutput/BatchProgressPanel.d.ts +18 -2
  235. package/lib/types/features/agent/chat/ModernAgentOutput/BatchProgressPanel.d.ts.map +1 -1
  236. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +4 -7
  237. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  238. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +2 -1
  239. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  240. package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +35 -7
  241. package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  242. package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts +11 -1
  243. package/lib/types/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts.map +1 -1
  244. package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts +20 -2
  245. package/lib/types/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
  246. package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -1
  247. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +18 -1
  248. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  249. package/lib/types/features/agent/chat/SkillWidgetProvider.d.ts.map +1 -1
  250. package/lib/types/features/agent/chat/hooks/useAgentPlans.d.ts +22 -0
  251. package/lib/types/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -0
  252. package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts +42 -0
  253. package/lib/types/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -0
  254. package/lib/types/features/agent/chat/hooks/useDocumentPanel.d.ts +22 -0
  255. package/lib/types/features/agent/chat/hooks/useDocumentPanel.d.ts.map +1 -0
  256. package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts +27 -0
  257. package/lib/types/features/agent/chat/hooks/useFileProcessing.d.ts.map +1 -0
  258. package/lib/types/features/agent/chat/index.d.ts +12 -8
  259. package/lib/types/features/agent/chat/index.d.ts.map +1 -1
  260. package/lib/types/features/agent/chat/types/document.d.ts +5 -0
  261. package/lib/types/features/agent/chat/types/document.d.ts.map +1 -0
  262. package/lib/types/features/agent/index.d.ts +0 -2
  263. package/lib/types/features/agent/index.d.ts.map +1 -1
  264. package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
  265. package/lib/types/features/store/objects/ExportPropertiesModal.d.ts.map +1 -1
  266. package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  267. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -1
  268. package/lib/types/features/store/objects/components/index.d.ts +1 -1
  269. package/lib/types/features/store/objects/components/index.d.ts.map +1 -1
  270. package/lib/types/features/store/objects/components/useDownloadFile.d.ts +35 -0
  271. package/lib/types/features/store/objects/components/useDownloadFile.d.ts.map +1 -0
  272. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  273. package/lib/types/features/store/objects/selection/SelectionActions.d.ts +1 -1
  274. package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
  275. package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts.map +1 -1
  276. package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts.map +1 -1
  277. package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
  278. package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +2 -1
  279. package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
  280. package/lib/types/features/store/types/SelectContentTypeModal.d.ts +1 -1
  281. package/lib/types/features/store/types/SelectContentTypeModal.d.ts.map +1 -1
  282. package/lib/types/features/store/types/TableLayoutEditor.d.ts +2 -1
  283. package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -1
  284. package/lib/types/features/user/UserInfo.d.ts +12 -1
  285. package/lib/types/features/user/UserInfo.d.ts.map +1 -1
  286. package/lib/types/features/utils/print.d.ts.map +1 -1
  287. package/lib/types/layout/AppLayout.d.ts.map +1 -1
  288. package/lib/types/layout/Sidebar.d.ts +4 -2
  289. package/lib/types/layout/Sidebar.d.ts.map +1 -1
  290. package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
  291. package/lib/types/router/Nav.d.ts +6 -1
  292. package/lib/types/router/Nav.d.ts.map +1 -1
  293. package/lib/types/session/UserSession.d.ts.map +1 -1
  294. package/lib/types/session/UserSessionProvider.d.ts +1 -0
  295. package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
  296. package/lib/types/widgets/json-view/JSONCode.d.ts.map +1 -1
  297. package/lib/types/widgets/markdown/ArtifactContentRenderer.d.ts +10 -1
  298. package/lib/types/widgets/markdown/ArtifactContentRenderer.d.ts.map +1 -1
  299. package/lib/types/widgets/markdown/MarkdownFigure.d.ts +15 -0
  300. package/lib/types/widgets/markdown/MarkdownFigure.d.ts.map +1 -0
  301. package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  302. package/lib/types/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
  303. package/lib/types/widgets/markdown/codeBlockHandlers.d.ts +5 -2
  304. package/lib/types/widgets/markdown/codeBlockHandlers.d.ts.map +1 -1
  305. package/lib/types/widgets/markdown/index.d.ts +1 -0
  306. package/lib/types/widgets/markdown/index.d.ts.map +1 -1
  307. package/lib/types/widgets/markdown/normalizeCustomSchemeLinks.d.ts +9 -0
  308. package/lib/types/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -0
  309. package/lib/types/widgets/markdown/normalizeDirectives.d.ts +20 -0
  310. package/lib/types/widgets/markdown/normalizeDirectives.d.ts.map +1 -0
  311. package/lib/types/widgets/markdown/remarkDirectiveHandler.d.ts +2 -0
  312. package/lib/types/widgets/markdown/remarkDirectiveHandler.d.ts.map +1 -0
  313. package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts +1 -3
  314. package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
  315. package/lib/types/widgets/schema-editor/ManagedSchema.d.ts +1 -1
  316. package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
  317. package/lib/vertesia-ui-core.js +1 -1
  318. package/lib/vertesia-ui-core.js.map +1 -1
  319. package/lib/vertesia-ui-features.js +1 -1
  320. package/lib/vertesia-ui-features.js.map +1 -1
  321. package/lib/vertesia-ui-layout.js +1 -1
  322. package/lib/vertesia-ui-layout.js.map +1 -1
  323. package/lib/vertesia-ui-router.js +1 -1
  324. package/lib/vertesia-ui-router.js.map +1 -1
  325. package/lib/vertesia-ui-session.js +1 -1
  326. package/lib/vertesia-ui-session.js.map +1 -1
  327. package/lib/vertesia-ui-shell.js +1 -1
  328. package/lib/vertesia-ui-shell.js.map +1 -1
  329. package/lib/vertesia-ui-widgets.js +1 -1
  330. package/lib/vertesia-ui-widgets.js.map +1 -1
  331. package/package.json +14 -10
  332. package/src/core/components/InputList.tsx +1 -1
  333. package/src/core/components/Overlay.tsx +1 -1
  334. package/src/core/components/SidePanel.tsx +29 -15
  335. package/src/core/components/Switch.tsx +1 -1
  336. package/src/core/components/index.ts +0 -8
  337. package/src/core/components/shadcn/Panel.tsx +50 -0
  338. package/src/core/components/{Badge.tsx → shadcn/badge.tsx} +3 -3
  339. package/src/core/components/shadcn/command.tsx +1 -1
  340. package/src/core/components/shadcn/filters/filterBar.tsx +76 -87
  341. package/src/core/components/shadcn/index.ts +5 -3
  342. package/src/core/components/{ConfirmModal.tsx → shadcn/modal/ConfirmModal.tsx} +8 -8
  343. package/src/core/components/{DeleteModal.tsx → shadcn/modal/DeleteModal.tsx} +1 -1
  344. package/src/core/components/shadcn/{dialog.tsx → modal/dialog.tsx} +43 -32
  345. package/src/core/components/shadcn/modal/index.ts +3 -0
  346. package/src/core/components/shadcn/popover.tsx +4 -2
  347. package/src/core/components/shadcn/selectBox.tsx +71 -52
  348. package/src/core/components/shadcn/tabs.tsx +36 -19
  349. package/src/core/components/shadcn/textarea.tsx +43 -2
  350. package/src/core/components/shadcn/tooltip.tsx +23 -17
  351. package/src/features/agent/PayloadBuilder.tsx +70 -9
  352. package/src/features/agent/chat/AgentChart.tsx +46 -678
  353. package/src/features/agent/chat/AskUserWidget.tsx +4 -3
  354. package/src/features/agent/chat/DocumentPanel.tsx +120 -0
  355. package/src/features/agent/chat/DocumentTabBar.tsx +49 -0
  356. package/src/features/agent/chat/ModernAgentConversation.tsx +403 -549
  357. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +162 -55
  358. package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +40 -10
  359. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +12 -16
  360. package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +3 -3
  361. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +68 -75
  362. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +206 -94
  363. package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +22 -5
  364. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +295 -113
  365. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +11 -8
  366. package/src/features/agent/chat/ModernAgentOutput/utils.ts +133 -4
  367. package/src/features/agent/chat/SkillWidgetProvider.tsx +32 -15
  368. package/src/features/agent/chat/hooks/useAgentPlans.ts +190 -0
  369. package/src/features/agent/chat/hooks/useAgentStream.ts +239 -0
  370. package/src/features/agent/chat/hooks/useDocumentPanel.ts +118 -0
  371. package/src/features/agent/chat/hooks/useFileProcessing.ts +126 -0
  372. package/src/features/agent/chat/index.ts +18 -17
  373. package/src/features/agent/chat/types/document.ts +4 -0
  374. package/src/features/agent/index.ts +0 -2
  375. package/src/features/store/collections/BrowseCollectionView.tsx +5 -8
  376. package/src/features/store/collections/CreateCollection.tsx +8 -8
  377. package/src/features/store/collections/EditCollectionView.tsx +1 -1
  378. package/src/features/store/objects/DocumentSearchResults.tsx +9 -13
  379. package/src/features/store/objects/ExportPropertiesModal.tsx +9 -7
  380. package/src/features/store/objects/components/ContentOverview.tsx +29 -155
  381. package/src/features/store/objects/components/PropertiesEditorModal.tsx +0 -1
  382. package/src/features/store/objects/components/SelectDocumentModal.tsx +6 -6
  383. package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
  384. package/src/features/store/objects/components/index.ts +1 -1
  385. package/src/features/store/objects/components/useDownloadFile.ts +237 -0
  386. package/src/features/store/objects/search/DocumentSearchContext.ts +1 -2
  387. package/src/features/store/objects/selection/SelectionActions.tsx +0 -4
  388. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +13 -13
  389. package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +2 -6
  390. package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +1 -3
  391. package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +8 -8
  392. package/src/features/store/objects/upload/DocumentUploadModal.tsx +25 -25
  393. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +16 -10
  394. package/src/features/store/types/ObjectSchemaEditor.tsx +32 -29
  395. package/src/features/store/types/SelectContentType.tsx +3 -3
  396. package/src/features/store/types/SelectContentTypeModal.tsx +17 -30
  397. package/src/features/store/types/TableLayoutEditor.tsx +14 -18
  398. package/src/features/user/UserInfo.tsx +176 -10
  399. package/src/features/utils/print.ts +0 -1
  400. package/src/layout/AppLayout.tsx +16 -44
  401. package/src/layout/Sidebar.tsx +7 -5
  402. package/src/router/HistoryNavigator.ts +9 -1
  403. package/src/router/Nav.tsx +7 -2
  404. package/src/session/UserSession.ts +38 -9
  405. package/src/session/UserSessionProvider.tsx +3 -2
  406. package/src/shell/apps/AppProjectSelector.tsx +2 -2
  407. package/src/shell/apps/StandaloneApp.tsx +3 -3
  408. package/src/shell/login/InviteAcceptModal.tsx +6 -6
  409. package/src/shell/login/SignInModal.tsx +1 -1
  410. package/src/shell/login/SignupForm.tsx +3 -3
  411. package/src/shell/login/UserInfo.tsx +5 -5
  412. package/src/widgets/json-view/JSONCode.tsx +1 -3
  413. package/src/widgets/json-view/JSONDisplay.tsx +1 -1
  414. package/src/widgets/markdown/ArtifactContentRenderer.tsx +115 -14
  415. package/src/widgets/markdown/MarkdownFigure.tsx +100 -0
  416. package/src/widgets/markdown/MarkdownRenderer.tsx +62 -9
  417. package/src/widgets/markdown/MermaidDiagram.tsx +97 -5
  418. package/src/widgets/markdown/codeBlockHandlers.test.tsx +3 -34
  419. package/src/widgets/markdown/codeBlockHandlers.tsx +47 -42
  420. package/src/widgets/markdown/index.ts +1 -0
  421. package/src/widgets/markdown/markdown.css +192 -0
  422. package/src/widgets/markdown/normalizeCustomSchemeLinks.test.ts +86 -0
  423. package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +91 -0
  424. package/src/widgets/markdown/normalizeDirectives.ts +50 -0
  425. package/src/widgets/markdown/remarkDirectiveHandler.ts +119 -0
  426. package/src/widgets/monacoEditor/MonacoEditor.tsx +8 -22
  427. package/src/widgets/schema-editor/ManagedSchema.ts +1 -1
  428. package/src/widgets/schema-editor/editor/PropertyEditor.tsx +5 -5
  429. package/src/widgets/schema-editor/json-schema4-utils.ts +1 -1
  430. package/lib/esm/core/components/Badge.js.map +0 -1
  431. package/lib/esm/core/components/Button.js +0 -32
  432. package/lib/esm/core/components/Button.js.map +0 -1
  433. package/lib/esm/core/components/ConfirmModal.js +0 -10
  434. package/lib/esm/core/components/ConfirmModal.js.map +0 -1
  435. package/lib/esm/core/components/DeleteModal.js.map +0 -1
  436. package/lib/esm/core/components/MessageBox.js.map +0 -1
  437. package/lib/esm/core/components/Modal.js +0 -26
  438. package/lib/esm/core/components/Modal.js.map +0 -1
  439. package/lib/esm/core/components/Panel.js +0 -8
  440. package/lib/esm/core/components/Panel.js.map +0 -1
  441. package/lib/esm/core/components/SelectBox.js +0 -67
  442. package/lib/esm/core/components/SelectBox.js.map +0 -1
  443. package/lib/esm/core/components/shadcn/dialog.js.map +0 -1
  444. package/lib/esm/core/components/tabs/Tabs.js +0 -78
  445. package/lib/esm/core/components/tabs/Tabs.js.map +0 -1
  446. package/lib/esm/core/components/tabs/TabsContext.js +0 -7
  447. package/lib/esm/core/components/tabs/TabsContext.js.map +0 -1
  448. package/lib/esm/core/components/tabs/index.js +0 -3
  449. package/lib/esm/core/components/tabs/index.js.map +0 -1
  450. package/lib/esm/features/agent/createChartTool.js +0 -632
  451. package/lib/esm/features/agent/createChartTool.js.map +0 -1
  452. package/lib/esm/features/agent/examples.js +0 -295
  453. package/lib/esm/features/agent/examples.js.map +0 -1
  454. package/lib/esm/features/agent/visualization.js +0 -165
  455. package/lib/esm/features/agent/visualization.js.map +0 -1
  456. package/lib/esm/features/store/objects/components/useDownloadObject.js +0 -21
  457. package/lib/esm/features/store/objects/components/useDownloadObject.js.map +0 -1
  458. package/lib/types/core/components/Badge.d.ts.map +0 -1
  459. package/lib/types/core/components/Button.d.ts +0 -14
  460. package/lib/types/core/components/Button.d.ts.map +0 -1
  461. package/lib/types/core/components/ConfirmModal.d.ts.map +0 -1
  462. package/lib/types/core/components/DeleteModal.d.ts.map +0 -1
  463. package/lib/types/core/components/MessageBox.d.ts.map +0 -1
  464. package/lib/types/core/components/Modal.d.ts +0 -30
  465. package/lib/types/core/components/Modal.d.ts.map +0 -1
  466. package/lib/types/core/components/Panel.d.ts.map +0 -1
  467. package/lib/types/core/components/SelectBox.d.ts +0 -36
  468. package/lib/types/core/components/SelectBox.d.ts.map +0 -1
  469. package/lib/types/core/components/shadcn/dialog.d.ts.map +0 -1
  470. package/lib/types/core/components/tabs/Tabs.d.ts +0 -25
  471. package/lib/types/core/components/tabs/Tabs.d.ts.map +0 -1
  472. package/lib/types/core/components/tabs/TabsContext.d.ts +0 -17
  473. package/lib/types/core/components/tabs/TabsContext.d.ts.map +0 -1
  474. package/lib/types/core/components/tabs/index.d.ts +0 -3
  475. package/lib/types/core/components/tabs/index.d.ts.map +0 -1
  476. package/lib/types/features/agent/createChartTool.d.ts +0 -178
  477. package/lib/types/features/agent/createChartTool.d.ts.map +0 -1
  478. package/lib/types/features/agent/examples.d.ts +0 -59
  479. package/lib/types/features/agent/examples.d.ts.map +0 -1
  480. package/lib/types/features/agent/visualization.d.ts +0 -95
  481. package/lib/types/features/agent/visualization.d.ts.map +0 -1
  482. package/lib/types/features/store/objects/components/useDownloadObject.d.ts +0 -4
  483. package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +0 -1
  484. package/src/core/components/Button.tsx +0 -63
  485. package/src/core/components/Modal.tsx +0 -144
  486. package/src/core/components/Panel.tsx +0 -34
  487. package/src/core/components/SelectBox.tsx +0 -188
  488. package/src/core/components/tabs/Tabs.tsx +0 -132
  489. package/src/core/components/tabs/TabsContext.ts +0 -25
  490. package/src/core/components/tabs/index.ts +0 -2
  491. package/src/features/agent/CHART_INSTRUCTIONS.md +0 -228
  492. package/src/features/agent/createChartTool.ts +0 -643
  493. package/src/features/agent/examples.ts +0 -321
  494. package/src/features/agent/visualization.ts +0 -227
  495. package/src/features/store/objects/components/useDownloadObject.ts +0 -29
  496. /package/lib/esm/core/components/{MessageBox.js → shadcn/MessageBox.js} +0 -0
  497. /package/lib/types/core/components/{MessageBox.d.ts → shadcn/MessageBox.d.ts} +0 -0
  498. /package/lib/types/core/components/{ConfirmModal.d.ts → shadcn/modal/ConfirmModal.d.ts} +0 -0
  499. /package/lib/types/core/components/{DeleteModal.d.ts → shadcn/modal/DeleteModal.d.ts} +0 -0
  500. /package/src/core/components/{MessageBox.tsx → shadcn/MessageBox.tsx} +0 -0
@@ -1,702 +1,70 @@
1
- import { Component, memo, useState, useRef, useCallback, type ReactNode, type ErrorInfo } from 'react';
2
- import { toPng } from 'html-to-image';
3
- import { Download, Copy, Check } from 'lucide-react';
1
+ import { memo } from 'react';
4
2
  import { VegaLiteChart } from './VegaLiteChart';
5
- import {
6
- Area,
7
- AreaChart,
8
- Bar,
9
- BarChart,
10
- CartesianGrid,
11
- Cell,
12
- ComposedChart,
13
- Funnel,
14
- FunnelChart,
15
- LabelList,
16
- Legend,
17
- Line,
18
- LineChart,
19
- Pie,
20
- PieChart,
21
- PolarAngleAxis,
22
- PolarGrid,
23
- PolarRadiusAxis,
24
- Radar,
25
- RadarChart,
26
- RadialBar,
27
- RadialBarChart,
28
- ReferenceLine,
29
- ResponsiveContainer,
30
- Scatter,
31
- ScatterChart,
32
- Tooltip,
33
- Treemap,
34
- XAxis,
35
- YAxis,
36
- } from 'recharts';
37
3
 
38
- // Default color palette for charts
39
- const COLORS = ['#4f46e5', '#06b6d4', '#22c55e', '#f59e0b', '#ef4444', '#8b5cf6', '#ec4899', '#14b8a6'];
40
-
41
- // Error boundary for chart rendering
42
- type ChartErrorBoundaryProps = {
43
- chartType: string;
44
- children: ReactNode;
45
- };
46
-
47
- type ChartErrorBoundaryState = {
48
- hasError: boolean;
49
- error: Error | null;
50
- };
51
-
52
- class ChartErrorBoundary extends Component<ChartErrorBoundaryProps, ChartErrorBoundaryState> {
53
- constructor(props: ChartErrorBoundaryProps) {
54
- super(props);
55
- this.state = { hasError: false, error: null };
56
- }
57
-
58
- static getDerivedStateFromError(error: Error): ChartErrorBoundaryState {
59
- return { hasError: true, error };
60
- }
61
-
62
- componentDidCatch(error: Error, errorInfo: ErrorInfo) {
63
- console.error(`Chart rendering error (${this.props.chartType}):`, error, errorInfo);
64
- }
65
-
66
- render() {
67
- if (this.state.hasError) {
68
- return (
69
- <div className="flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4">
70
- <div className="text-center">
71
- <p className="text-sm font-medium text-red-600 dark:text-red-400">
72
- Cannot render {this.props.chartType} chart
73
- </p>
74
- <p className="text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate">
75
- {this.state.error?.message || 'Unknown error'}
76
- </p>
77
- </div>
78
- </div>
79
- );
80
- }
81
-
82
- return this.props.children;
83
- }
84
- }
85
-
86
- // Recharts-based chart specification (default)
4
+ // Legacy Recharts chart specification.
5
+ // Recharts rendering has been retired; this type is kept for backward-compatibility.
87
6
  export type RechartsChartSpec = {
88
- version?: '1.0';
89
- library?: 'recharts';
90
- chart: 'bar' | 'line' | 'composed' | 'area' | 'pie' | 'scatter' | 'radar' | 'radialBar' | 'funnel' | 'treemap';
91
- title?: string;
92
- description?: string;
93
- data: Record<string, any>[];
94
- xKey: string;
95
- series: Array<{
96
- key: string;
97
- label?: string;
98
- type?: 'bar' | 'line' | 'area';
99
- color?: string;
100
- yAxisId?: 'left' | 'right';
101
- stackId?: string;
102
- dot?: boolean;
103
- }>;
104
- // For pie/radialBar charts
105
- nameKey?: string;
106
- valueKey?: string;
107
- // For scatter charts
108
- yKey?: string;
109
- zKey?: string; // optional size dimension
110
- // For radar charts
111
- axisKey?: string;
112
- // For treemap
113
- dataKey?: string;
114
- yAxis?: {
115
- left?: { label?: string };
116
- right?: { label?: string };
117
- };
118
- options?: {
119
- stacked?: boolean;
120
- referenceZero?: boolean;
121
- collapsible?: boolean;
122
- collapseInitially?: boolean;
123
- innerRadius?: number; // for pie/radialBar (donut style)
124
- showLabels?: boolean; // for pie/funnel
125
- startAngle?: number; // for radialBar
126
- endAngle?: number; // for radialBar
127
- };
7
+ version?: '1.0';
8
+ library?: 'recharts';
9
+ [key: string]: unknown;
128
10
  };
129
11
 
130
- // Vega-Lite chart specification for advanced visualizations
12
+ // Vega-Lite chart specification for supported visualizations.
131
13
  export type VegaLiteChartSpec = {
132
- version?: '1.0';
133
- library: 'vega-lite';
134
- title?: string;
135
- description?: string;
136
- // Native Vega-Lite specification object
137
- spec: Record<string, any>;
138
- options?: {
139
- collapsible?: boolean;
140
- collapseInitially?: boolean;
141
- theme?: 'default' | 'dark';
142
- renderer?: 'canvas' | 'svg';
143
- // Dashboard mode options
144
- mode?: 'chart' | 'dashboard';
145
- height?: number; // Explicit height override (default: 280 for chart, 500 for dashboard)
146
- enableFullscreen?: boolean; // Show fullscreen button (default: true for dashboard, false for chart)
147
- // Interactive features
148
- enableTooltips?: boolean; // Enable Vega tooltips (default: true)
149
- enableSignalListeners?: boolean; // Enable external signal listeners (default: false)
150
- // Parameter values - set initial values for Vega-Lite params (sliders, dropdowns, etc.)
151
- parameterValues?: Record<string, any>;
152
- };
14
+ version?: '1.0';
15
+ library: 'vega-lite';
16
+ title?: string;
17
+ description?: string;
18
+ spec: Record<string, unknown>;
19
+ options?: {
20
+ collapsible?: boolean;
21
+ collapseInitially?: boolean;
22
+ theme?: 'default' | 'dark';
23
+ renderer?: 'canvas' | 'svg';
24
+ mode?: 'chart' | 'dashboard';
25
+ height?: number;
26
+ enableFullscreen?: boolean;
27
+ enableTooltips?: boolean;
28
+ enableSignalListeners?: boolean;
29
+ parameterValues?: Record<string, unknown>;
30
+ };
153
31
  };
154
32
 
155
- // Union type for all chart specifications
156
33
  export type AgentChartSpec = RechartsChartSpec | VegaLiteChartSpec;
157
34
 
158
- // Type guard to check if spec is Vega-Lite
159
35
  export function isVegaLiteSpec(spec: AgentChartSpec): spec is VegaLiteChartSpec {
160
- return spec.library === 'vega-lite';
36
+ return spec.library === 'vega-lite' && typeof (spec as VegaLiteChartSpec).spec === 'object';
161
37
  }
162
38
 
163
- // Type guard to check if spec is Recharts (default)
164
39
  export function isRechartsSpec(spec: AgentChartSpec): spec is RechartsChartSpec {
165
- return (spec.library === 'recharts' || spec.library === undefined) && !('spec' in spec);
40
+ return spec.library === 'recharts' || spec.library === undefined;
166
41
  }
167
42
 
168
43
  type AgentChartProps = {
169
- spec: AgentChartSpec;
170
- /**
171
- * Optional workflow run id used to resolve artifact: URLs in Vega-Lite data references.
172
- * When provided, data URLs like "artifact:out/data.json" will be resolved to the actual data.
173
- */
174
- artifactRunId?: string;
44
+ spec: AgentChartSpec;
45
+ artifactRunId?: string;
175
46
  };
176
47
 
177
- function formatNumber(n: number): string {
178
- if (!isFinite(n)) return String(n);
179
- const abs = Math.abs(n);
180
- if (abs >= 1_000_000_000) return (n / 1_000_000_000).toFixed(1) + 'B';
181
- if (abs >= 1_000_000) return (n / 1_000_000).toFixed(1) + 'M';
182
- if (abs >= 1_000) return (n / 1_000).toFixed(1) + 'K';
183
- return n.toLocaleString();
48
+ function isNativeVegaLiteSpec(spec: AgentChartSpec): spec is Record<string, unknown> {
49
+ return typeof (spec as Record<string, unknown>).$schema === 'string' &&
50
+ ((spec as Record<string, unknown>).$schema as string).includes('vega');
184
51
  }
185
52
 
186
- // Router component that delegates to the appropriate chart renderer
187
53
  export const AgentChart = memo(function AgentChart({ spec, artifactRunId }: AgentChartProps) {
188
- // Route to VegaLiteChart for Vega-Lite specs
189
- if (isVegaLiteSpec(spec)) {
190
- return <VegaLiteChart spec={spec} artifactRunId={artifactRunId} />;
191
- }
192
-
193
- // Route to RechartsChart for Recharts specs
194
- return <RechartsChart spec={spec as RechartsChartSpec} />;
195
- }, (prevProps, nextProps) => {
196
- // Deep compare the spec to prevent re-renders when data hasn't changed
197
- return JSON.stringify(prevProps.spec) === JSON.stringify(nextProps.spec) &&
198
- prevProps.artifactRunId === nextProps.artifactRunId;
199
- });
200
-
201
- // Map alternative chart type names to our standard names
202
- function normalizeChartType(spec: any): RechartsChartSpec['chart'] {
203
- // If 'chart' is provided, use it directly
204
- if (spec.chart) return spec.chart;
205
- // Map 'type' field (e.g., "BarChart" -> "bar")
206
- const typeMap: Record<string, RechartsChartSpec['chart']> = {
207
- 'BarChart': 'bar',
208
- 'LineChart': 'line',
209
- 'AreaChart': 'area',
210
- 'PieChart': 'pie',
211
- 'ScatterChart': 'scatter',
212
- 'RadarChart': 'radar',
213
- 'FunnelChart': 'funnel',
214
- 'Treemap': 'treemap',
215
- 'ComposedChart': 'composed',
216
- 'RadialBarChart': 'radialBar',
217
- };
218
- if (spec.type && typeMap[spec.type]) {
219
- return typeMap[spec.type];
220
- }
221
- return 'bar'; // default
222
- }
223
-
224
- // Recharts implementation component
225
- const RechartsChart = memo(function RechartsChart({ spec }: { spec: RechartsChartSpec }) {
226
- // Normalize spec to handle alternative formats from agents
227
- const normalizedSpec = {
228
- ...spec,
229
- chart: normalizeChartType(spec),
230
- // Handle x_axis.data_key -> xKey
231
- xKey: spec.xKey || (spec as any).x_axis?.data_key || 'name',
232
- // Handle bars/lines -> series
233
- series: spec.series || (spec as any).bars?.map((b: any) => ({
234
- key: b.data_key || b.dataKey,
235
- color: b.fill || b.color,
236
- label: b.name,
237
- })) || (spec as any).lines?.map((l: any) => ({
238
- key: l.data_key || l.dataKey,
239
- color: l.stroke || l.color,
240
- label: l.name,
241
- })) || [],
242
- };
243
-
244
- const {
245
- chart,
246
- title,
247
- description,
248
- data,
249
- xKey,
250
- series,
251
- yAxis,
252
- options,
253
- nameKey,
254
- valueKey,
255
- yKey,
256
- zKey: _zKey,
257
- axisKey,
258
- dataKey,
259
- } = normalizedSpec;
260
- const [isExporting, setIsExporting] = useState(false);
261
- const [isCopied, setIsCopied] = useState(false);
262
- const chartRef = useRef<HTMLDivElement>(null);
263
-
264
- const handleCopy = useCallback(async () => {
265
- if (!chartRef.current || isCopied) return;
266
-
267
- try {
268
- const dataUrl = await toPng(chartRef.current, {
269
- backgroundColor: '#ffffff',
270
- pixelRatio: 2,
271
- });
272
- const response = await fetch(dataUrl);
273
- const blob = await response.blob();
274
- await navigator.clipboard.write([
275
- new ClipboardItem({ 'image/png': blob })
276
- ]);
277
- setIsCopied(true);
278
- setTimeout(() => setIsCopied(false), 2000);
279
- } catch (err) {
280
- console.error('Failed to copy chart:', err);
281
- }
282
- }, [isCopied]);
283
-
284
- const handleExport = useCallback(async () => {
285
- if (!chartRef.current || isExporting) return;
286
-
287
- setIsExporting(true);
288
- try {
289
- const dataUrl = await toPng(chartRef.current, {
290
- backgroundColor: '#ffffff',
291
- pixelRatio: 2,
292
- });
293
- const link = document.createElement('a');
294
- link.download = `${title || 'chart'}.png`;
295
- link.href = dataUrl;
296
- link.click();
297
- } catch (err) {
298
- console.error('Failed to export chart:', err);
299
- } finally {
300
- setIsExporting(false);
301
- }
302
- }, [title, isExporting]);
303
-
304
- // Safe arrays - default to empty array if undefined
305
- const safeSeries = series || [];
306
- const safeData = data || [];
307
-
308
- const commonAxes = (
309
- <>
310
- <XAxis dataKey={xKey} tick={{ fontSize: 12 }} />
311
- <YAxis
312
- yAxisId="left"
313
- tickFormatter={formatNumber}
314
- label={yAxis?.left?.label ? { value: yAxis.left.label, angle: -90, position: 'insideLeft' } : undefined}
315
- />
316
- {safeSeries.some((s) => s.yAxisId === 'right') && (
317
- <YAxis
318
- yAxisId="right"
319
- orientation="right"
320
- tickFormatter={formatNumber}
321
- label={yAxis?.right?.label ? { value: yAxis.right.label, angle: -90, position: 'insideRight' } : undefined}
322
- />
323
- )}
324
- </>
325
- );
326
-
327
- const commonOverlays = (
328
- <>
329
- <CartesianGrid strokeDasharray="3 3" />
330
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
331
- <Legend />
332
- {options?.referenceZero && <ReferenceLine y={0} stroke="#999" strokeDasharray="3 3" />}
333
- </>
334
- );
335
-
336
- const renderSeries = () =>
337
- safeSeries.map((s, idx) => {
338
- const color = s.color || COLORS[idx % COLORS.length];
339
- const yAxisId = s.yAxisId || 'left';
340
- if (chart === 'line') {
341
- return (
342
- <Line
343
- key={s.key}
344
- type="monotone"
345
- dataKey={s.key}
346
- name={s.label || s.key}
347
- stroke={color}
348
- dot={s.dot ?? false}
349
- yAxisId={yAxisId}
350
- />
351
- );
352
- }
353
- if (chart === 'area') {
354
- return (
355
- <Area
356
- key={s.key}
357
- type="monotone"
358
- dataKey={s.key}
359
- name={s.label || s.key}
360
- stroke={color}
361
- fill={color}
362
- fillOpacity={0.3}
363
- stackId={options?.stacked ? (s.stackId || 'stack') : undefined}
364
- yAxisId={yAxisId}
365
- />
366
- );
367
- }
368
- if (chart === 'bar' || s.type === 'bar') {
369
- return (
370
- <Bar
371
- key={s.key}
372
- dataKey={s.key}
373
- name={s.label || s.key}
374
- fill={color}
375
- stackId={options?.stacked ? (s.stackId || 'stack') : undefined}
376
- yAxisId={yAxisId}
377
- />
378
- );
379
- }
380
- if (s.type === 'area') {
381
- return (
382
- <Area
383
- key={s.key}
384
- type="monotone"
385
- dataKey={s.key}
386
- name={s.label || s.key}
387
- stroke={color}
388
- fill={color}
389
- fillOpacity={0.3}
390
- stackId={options?.stacked ? (s.stackId || 'stack') : undefined}
391
- yAxisId={yAxisId}
392
- />
393
- );
394
- }
395
- // default to line in composed
396
- return (
397
- <Line
398
- key={s.key}
399
- type="monotone"
400
- dataKey={s.key}
401
- name={s.label || s.key}
402
- stroke={color}
403
- dot={s.dot ?? false}
404
- yAxisId={yAxisId}
405
- />
406
- );
407
- });
408
-
409
- // Render Pie Chart
410
- const renderPieChart = () => {
411
- const nKey = nameKey || 'name';
412
- const vKey = valueKey || 'value';
413
- const innerRadius = options?.innerRadius || 0;
414
- return (
415
- <PieChart>
416
- <Pie
417
- data={safeData}
418
- dataKey={vKey}
419
- nameKey={nKey}
420
- cx="50%"
421
- cy="50%"
422
- innerRadius={innerRadius}
423
- outerRadius={100}
424
- label={options?.showLabels !== false}
425
- >
426
- {safeData.map((_, index) => (
427
- <Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
428
- ))}
429
- </Pie>
430
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
431
- <Legend />
432
- </PieChart>
433
- );
434
- };
435
-
436
- // Render Scatter Chart
437
- const renderScatterChart = () => {
438
- const xDataKey = xKey;
439
- const yDataKey = yKey || 'y';
440
- return (
441
- <ScatterChart>
442
- <CartesianGrid strokeDasharray="3 3" />
443
- <XAxis dataKey={xDataKey} name={xDataKey} tick={{ fontSize: 12 }} />
444
- <YAxis dataKey={yDataKey} name={yDataKey} tickFormatter={formatNumber} />
445
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
446
- <Legend />
447
- {safeSeries.length > 0 ? (
448
- safeSeries.map((s, idx) => (
449
- <Scatter
450
- key={s.key}
451
- name={s.label || s.key}
452
- data={safeData}
453
- fill={s.color || COLORS[idx % COLORS.length]}
454
- />
455
- ))
456
- ) : (
457
- <Scatter name="Data" data={safeData} fill={COLORS[0]} />
458
- )}
459
- </ScatterChart>
460
- );
461
- };
462
-
463
- // Render Radar Chart
464
- const renderRadarChart = () => {
465
- const aKey = axisKey || xKey || 'axis';
466
- return (
467
- <RadarChart cx="50%" cy="50%" outerRadius={100} data={safeData}>
468
- <PolarGrid />
469
- <PolarAngleAxis dataKey={aKey} tick={{ fontSize: 11 }} />
470
- <PolarRadiusAxis tickFormatter={formatNumber} />
471
- {safeSeries.map((s, idx) => (
472
- <Radar
473
- key={s.key}
474
- name={s.label || s.key}
475
- dataKey={s.key}
476
- stroke={s.color || COLORS[idx % COLORS.length]}
477
- fill={s.color || COLORS[idx % COLORS.length]}
478
- fillOpacity={0.3}
479
- />
480
- ))}
481
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
482
- <Legend />
483
- </RadarChart>
484
- );
485
- };
486
-
487
- // Render RadialBar Chart
488
- const renderRadialBarChart = () => {
489
- const nKey = nameKey || 'name';
490
- const vKey = valueKey || 'value';
491
- const startAngle = options?.startAngle ?? 180;
492
- const endAngle = options?.endAngle ?? 0;
493
- const innerRadius = options?.innerRadius ?? 30;
494
- return (
495
- <RadialBarChart
496
- cx="50%"
497
- cy="50%"
498
- innerRadius={innerRadius}
499
- outerRadius={100}
500
- barSize={15}
501
- data={safeData}
502
- startAngle={startAngle}
503
- endAngle={endAngle}
504
- >
505
- <RadialBar
506
- label={{ position: 'insideStart', fill: '#fff', fontSize: 11 }}
507
- background
508
- dataKey={vKey}
509
- >
510
- {safeData.map((_, index) => (
511
- <Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
512
- ))}
513
- </RadialBar>
514
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
515
- <Legend
516
- iconSize={10}
517
- layout="vertical"
518
- verticalAlign="middle"
519
- align="right"
520
- formatter={(value, entry) => {
521
- const item = safeData.find((d) => d[nKey] === value || d[vKey] === entry.payload?.value);
522
- return item ? item[nKey] : value;
523
- }}
524
- />
525
- </RadialBarChart>
526
- );
527
- };
528
-
529
- // Render Funnel Chart
530
- const renderFunnelChart = () => {
531
- const nKey = nameKey || 'name';
532
- const vKey = valueKey || 'value';
533
- return (
534
- <FunnelChart>
535
- <Tooltip formatter={(value) => (typeof value === 'number' ? formatNumber(value) : String(value))} />
536
- <Funnel dataKey={vKey} data={safeData} isAnimationActive>
537
- {safeData.map((_, index) => (
538
- <Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
539
- ))}
540
- {options?.showLabels !== false && (
541
- <LabelList position="center" fill="#fff" stroke="none" dataKey={nKey} />
542
- )}
543
- </Funnel>
544
- </FunnelChart>
545
- );
546
- };
547
-
548
- // Render Treemap
549
- const renderTreemap = () => {
550
- const dKey = dataKey || valueKey || 'value';
551
- return (
552
- <Treemap
553
- data={safeData}
554
- dataKey={dKey}
555
- aspectRatio={4 / 3}
556
- stroke="#fff"
557
- fill="#4f46e5"
558
- content={({ x, y, width, height, name, value, index }) => {
559
- const fill = COLORS[(index as number) % COLORS.length];
560
- return (
561
- <g>
562
- <rect
563
- x={x}
564
- y={y}
565
- width={width}
566
- height={height}
567
- style={{ fill, stroke: '#fff', strokeWidth: 2 }}
568
- />
569
- {(width as number) > 50 && (height as number) > 30 && (
570
- <>
571
- <text
572
- x={(x as number) + (width as number) / 2}
573
- y={(y as number) + (height as number) / 2 - 7}
574
- textAnchor="middle"
575
- fill="#fff"
576
- fontSize={12}
577
- >
578
- {name}
579
- </text>
580
- <text
581
- x={(x as number) + (width as number) / 2}
582
- y={(y as number) + (height as number) / 2 + 10}
583
- textAnchor="middle"
584
- fill="#fff"
585
- fontSize={11}
586
- >
587
- {formatNumber(value as number)}
588
- </text>
589
- </>
590
- )}
591
- </g>
592
- );
593
- }}
594
- />
595
- );
596
- };
597
-
598
- // Render chart based on type
599
- const renderChart = () => {
600
- switch (chart) {
601
- case 'bar':
602
- return (
603
- <BarChart data={safeData}>
604
- {commonAxes}
605
- {commonOverlays}
606
- {renderSeries()}
607
- </BarChart>
608
- );
609
- case 'line':
610
- return (
611
- <LineChart data={safeData}>
612
- {commonAxes}
613
- {commonOverlays}
614
- {renderSeries()}
615
- </LineChart>
616
- );
617
- case 'area':
618
- return (
619
- <AreaChart data={safeData}>
620
- {commonAxes}
621
- {commonOverlays}
622
- {renderSeries()}
623
- </AreaChart>
624
- );
625
- case 'composed':
626
- return (
627
- <ComposedChart data={safeData}>
628
- {commonAxes}
629
- {commonOverlays}
630
- {renderSeries()}
631
- </ComposedChart>
632
- );
633
- case 'pie':
634
- return renderPieChart();
635
- case 'scatter':
636
- return renderScatterChart();
637
- case 'radar':
638
- return renderRadarChart();
639
- case 'radialBar':
640
- return renderRadialBarChart();
641
- case 'funnel':
642
- return renderFunnelChart();
643
- case 'treemap':
644
- return renderTreemap();
645
- default:
646
- return (
647
- <ComposedChart data={safeData}>
648
- {commonAxes}
649
- {commonOverlays}
650
- {renderSeries()}
651
- </ComposedChart>
652
- );
653
- }
654
- };
655
-
656
- return (
657
- <div className="bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm my-5">
658
- <div className="flex flex-col gap-2 p-4">
659
- <div className="flex items-center justify-between">
660
- <span className="font-medium text-sm text-gray-900 dark:text-gray-100">
661
- {title || 'Chart'}
662
- </span>
663
- <div className="flex items-center gap-2 print:hidden chart-actions">
664
- <button
665
- onClick={handleCopy}
666
- disabled={isCopied}
667
- className="text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1"
668
- title="Copy to clipboard"
669
- >
670
- {isCopied ? <Check className="w-3 h-3" /> : <Copy className="w-3 h-3" />}
671
- {isCopied ? 'Copied' : 'Copy'}
672
- </button>
673
- <button
674
- onClick={handleExport}
675
- disabled={isExporting}
676
- className="text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1"
677
- title="Export as PNG"
678
- >
679
- <Download className="w-3 h-3" />
680
- {isExporting ? 'Exporting...' : 'Export'}
681
- </button>
682
- </div>
683
- </div>
684
- {description && (
685
- <span className="text-xs text-gray-500 dark:text-gray-400">
686
- {description}
687
- </span>
688
- )}
689
- <div ref={chartRef} className="bg-white dark:bg-gray-900 rounded" style={{ width: '100%', height: 280, minWidth: 0 }}>
690
- <ChartErrorBoundary chartType={chart}>
691
- <ResponsiveContainer width="100%" height="100%">
692
- {renderChart()}
693
- </ResponsiveContainer>
694
- </ChartErrorBoundary>
695
- </div>
696
- </div>
697
- </div>
698
- );
54
+ if (isVegaLiteSpec(spec)) {
55
+ return <VegaLiteChart spec={spec} artifactRunId={artifactRunId} />;
56
+ }
57
+
58
+ if (isNativeVegaLiteSpec(spec)) {
59
+ return <VegaLiteChart spec={{ library: 'vega-lite', spec }} artifactRunId={artifactRunId} />;
60
+ }
61
+
62
+ return (
63
+ <div className="my-5 rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200">
64
+ Recharts chart rendering has been retired. Use a Vega-Lite chart spec (<code>library: &quot;vega-lite&quot;</code> with <code>spec</code>).
65
+ </div>
66
+ );
699
67
  }, (prevProps, nextProps) => {
700
- // Deep compare the spec to prevent re-renders when data hasn't changed
701
- return JSON.stringify(prevProps.spec) === JSON.stringify(nextProps.spec);
68
+ return JSON.stringify(prevProps.spec) === JSON.stringify(nextProps.spec)
69
+ && prevProps.artifactRunId === nextProps.artifactRunId;
702
70
  });