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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/lib/core/components/shadcn/dropdown.d.ts.map +1 -1
  2. package/lib/core/components/shadcn/dropdown.js +6 -2
  3. package/lib/core/components/shadcn/dropdown.js.map +1 -1
  4. package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  5. package/lib/core/components/shadcn/filters/filterBar.js +9 -2
  6. package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
  7. package/lib/core/components/shadcn/modal/ConfirmModal.d.ts +16 -1
  8. package/lib/core/components/shadcn/modal/ConfirmModal.d.ts.map +1 -1
  9. package/lib/core/components/shadcn/modal/ConfirmModal.js +25 -3
  10. package/lib/core/components/shadcn/modal/ConfirmModal.js.map +1 -1
  11. package/lib/core/components/shadcn/modal/dialog.js +1 -1
  12. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  13. package/lib/core/components/shadcn/popover.d.ts.map +1 -1
  14. package/lib/core/components/shadcn/popover.js +3 -1
  15. package/lib/core/components/shadcn/popover.js.map +1 -1
  16. package/lib/core/components/shadcn/switch.js +3 -3
  17. package/lib/core/components/shadcn/switch.js.map +1 -1
  18. package/lib/core/components/shadcn/tabs.js +1 -1
  19. package/lib/core/components/shadcn/tabs.js.map +1 -1
  20. package/lib/core/components/shadcn/tooltip.d.ts.map +1 -1
  21. package/lib/core/components/shadcn/tooltip.js +3 -1
  22. package/lib/core/components/shadcn/tooltip.js.map +1 -1
  23. package/lib/env/index.d.ts +0 -19
  24. package/lib/env/index.d.ts.map +1 -1
  25. package/lib/env/index.js +0 -6
  26. package/lib/env/index.js.map +1 -1
  27. package/lib/features/agent/PayloadBuilder.d.ts +4 -0
  28. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  29. package/lib/features/agent/PayloadBuilder.js +16 -0
  30. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  31. package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts +10 -0
  32. package/lib/features/agent/chat/AgentApprovalModeSelector.d.ts.map +1 -0
  33. package/lib/features/agent/chat/AgentApprovalModeSelector.js +50 -0
  34. package/lib/features/agent/chat/AgentApprovalModeSelector.js.map +1 -0
  35. package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts +2 -1
  36. package/lib/features/agent/chat/AgentChatFixtureReplay.d.ts.map +1 -1
  37. package/lib/features/agent/chat/AgentChatFixtureReplay.js +3 -3
  38. package/lib/features/agent/chat/AgentChatFixtureReplay.js.map +1 -1
  39. package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts +5 -2
  40. package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
  41. package/lib/features/agent/chat/AgentRequestInputOverlay.js +41 -7
  42. package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
  43. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  44. package/lib/features/agent/chat/AgentRightPanel.js +133 -12
  45. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  46. package/lib/features/agent/chat/AnimatedThinkingDots.js +1 -1
  47. package/lib/features/agent/chat/AnimatedThinkingDots.js.map +1 -1
  48. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  49. package/lib/features/agent/chat/ArtifactsTab.js +11 -65
  50. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  51. package/lib/features/agent/chat/AskUserWidget.d.ts +3 -1
  52. package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  53. package/lib/features/agent/chat/AskUserWidget.js +4 -3
  54. package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
  55. package/lib/features/agent/chat/ModernAgentConversation.d.ts +10 -2
  56. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  57. package/lib/features/agent/chat/ModernAgentConversation.js +526 -117
  58. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  59. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts +8 -0
  60. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -0
  61. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +19 -0
  62. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -0
  63. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +8 -2
  64. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  65. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +551 -92
  66. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  67. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  68. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +7 -6
  69. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  70. package/lib/features/agent/chat/ModernAgentOutput/Header.js +2 -2
  71. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  72. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts +8 -0
  73. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.d.ts.map +1 -0
  74. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js +61 -0
  75. package/lib/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.js.map +1 -0
  76. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +15 -2
  77. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  78. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +28 -38
  79. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +1 -1
  81. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +3 -2
  83. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js +2 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -1
  86. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js +1 -1
  87. package/lib/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
  88. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts +5 -0
  89. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  90. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +59 -4
  91. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  92. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +2 -2
  93. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  94. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +9 -0
  95. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
  96. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +180 -0
  97. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
  98. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +6 -0
  99. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  100. package/lib/features/agent/chat/ModernAgentOutput/utils.js +92 -2
  101. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  102. package/lib/features/agent/chat/clipboardFiles.d.ts +15 -0
  103. package/lib/features/agent/chat/clipboardFiles.d.ts.map +1 -0
  104. package/lib/features/agent/chat/clipboardFiles.js +35 -0
  105. package/lib/features/agent/chat/clipboardFiles.js.map +1 -0
  106. package/lib/features/agent/chat/hooks/useAgentStream.d.ts +6 -0
  107. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  108. package/lib/features/agent/chat/hooks/useAgentStream.js +218 -37
  109. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  110. package/lib/features/agent/chat/hooks/useArtifacts.d.ts +1 -8
  111. package/lib/features/agent/chat/hooks/useArtifacts.d.ts.map +1 -1
  112. package/lib/features/agent/chat/hooks/useArtifacts.js +10 -28
  113. package/lib/features/agent/chat/hooks/useArtifacts.js.map +1 -1
  114. package/lib/features/agent/chat/index.d.ts +2 -1
  115. package/lib/features/agent/chat/index.d.ts.map +1 -1
  116. package/lib/features/agent/chat/index.js +2 -1
  117. package/lib/features/agent/chat/index.js.map +1 -1
  118. package/lib/features/agent/chat/workstreams.d.ts +1 -0
  119. package/lib/features/agent/chat/workstreams.d.ts.map +1 -1
  120. package/lib/features/agent/chat/workstreams.js +28 -0
  121. package/lib/features/agent/chat/workstreams.js.map +1 -1
  122. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +10 -1
  123. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  124. package/lib/features/facets/AgentRunnerFacetsNav.js +6 -3
  125. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  126. package/lib/features/facets/CollectionsFacetsNav.d.ts +10 -1
  127. package/lib/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  128. package/lib/features/facets/CollectionsFacetsNav.js +14 -5
  129. package/lib/features/facets/CollectionsFacetsNav.js.map +1 -1
  130. package/lib/features/facets/PromptsFacetsNav.d.ts +10 -1
  131. package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
  132. package/lib/features/facets/PromptsFacetsNav.js +14 -5
  133. package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
  134. package/lib/features/facets/RunsFacetsNav.d.ts +10 -1
  135. package/lib/features/facets/RunsFacetsNav.d.ts.map +1 -1
  136. package/lib/features/facets/RunsFacetsNav.js +14 -5
  137. package/lib/features/facets/RunsFacetsNav.js.map +1 -1
  138. package/lib/features/index.d.ts +0 -1
  139. package/lib/features/index.d.ts.map +1 -1
  140. package/lib/features/index.js +0 -1
  141. package/lib/features/index.js.map +1 -1
  142. package/lib/features/oauth/McpConnectionsButton.d.ts +30 -0
  143. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -0
  144. package/lib/features/oauth/McpConnectionsButton.js +70 -0
  145. package/lib/features/oauth/McpConnectionsButton.js.map +1 -0
  146. package/lib/features/oauth/McpConnectionsDialog.d.ts +25 -0
  147. package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -0
  148. package/lib/features/oauth/McpConnectionsDialog.js +26 -0
  149. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -0
  150. package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
  151. package/lib/features/oauth/RemoteMcpConnectionButton.js +14 -6
  152. package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
  153. package/lib/features/oauth/index.d.ts +3 -0
  154. package/lib/features/oauth/index.d.ts.map +1 -1
  155. package/lib/features/oauth/index.js +3 -0
  156. package/lib/features/oauth/index.js.map +1 -1
  157. package/lib/features/oauth/useMcpConnections.d.ts +44 -0
  158. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -0
  159. package/lib/features/oauth/useMcpConnections.js +168 -0
  160. package/lib/features/oauth/useMcpConnections.js.map +1 -0
  161. package/lib/features/permissions/UserPermissionsProvider.d.ts +4 -6
  162. package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  163. package/lib/features/permissions/UserPermissionsProvider.js +40 -42
  164. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  165. package/lib/features/store/objects/DocumentPreviewPanel.d.ts.map +1 -1
  166. package/lib/features/store/objects/DocumentPreviewPanel.js +2 -1
  167. package/lib/features/store/objects/DocumentPreviewPanel.js.map +1 -1
  168. package/lib/features/store/objects/DocumentQuickFilter.d.ts +23 -0
  169. package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -0
  170. package/lib/features/store/objects/DocumentQuickFilter.js +30 -0
  171. package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -0
  172. package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  173. package/lib/features/store/objects/DocumentSearchResults.js +17 -1
  174. package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
  175. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  176. package/lib/features/store/objects/components/ContentOverview.js +17 -74
  177. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  178. package/lib/features/store/objects/layout/DocumentTableColumn.d.ts +7 -1
  179. package/lib/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
  180. package/lib/features/store/objects/layout/DocumentTableColumn.js +27 -3
  181. package/lib/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
  182. package/lib/features/store/objects/layout/documentLayout.js +1 -1
  183. package/lib/features/store/objects/layout/renderers.d.ts +2 -1
  184. package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
  185. package/lib/features/store/objects/layout/renderers.js +27 -20
  186. package/lib/features/store/objects/layout/renderers.js.map +1 -1
  187. package/lib/features/store/types/ContentObjectTypesSearch.d.ts.map +1 -1
  188. package/lib/features/store/types/ContentObjectTypesSearch.js +4 -1
  189. package/lib/features/store/types/ContentObjectTypesSearch.js.map +1 -1
  190. package/lib/features/store/types/ContentObjectTypesTable.d.ts +2 -1
  191. package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  192. package/lib/features/store/types/ContentObjectTypesTable.js +8 -3
  193. package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
  194. package/lib/i18n/instance.d.ts.map +1 -1
  195. package/lib/i18n/instance.js +1 -0
  196. package/lib/i18n/instance.js.map +1 -1
  197. package/lib/i18n/locales/ar.json +72 -45
  198. package/lib/i18n/locales/de.json +65 -34
  199. package/lib/i18n/locales/en.json +63 -47
  200. package/lib/i18n/locales/es.json +65 -35
  201. package/lib/i18n/locales/fr.json +65 -35
  202. package/lib/i18n/locales/it.json +72 -42
  203. package/lib/i18n/locales/ja.json +72 -41
  204. package/lib/i18n/locales/ko.json +72 -41
  205. package/lib/i18n/locales/pt.json +72 -42
  206. package/lib/i18n/locales/ru.json +72 -43
  207. package/lib/i18n/locales/tr.json +72 -41
  208. package/lib/i18n/locales/zh-TW.json +72 -41
  209. package/lib/i18n/locales/zh.json +72 -41
  210. package/lib/session/UserSession.d.ts +0 -6
  211. package/lib/session/UserSession.d.ts.map +1 -1
  212. package/lib/session/UserSession.js +0 -15
  213. package/lib/session/UserSession.js.map +1 -1
  214. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  215. package/lib/session/UserSessionProvider.js +39 -98
  216. package/lib/session/UserSessionProvider.js.map +1 -1
  217. package/lib/session/auth/composable.d.ts.map +1 -1
  218. package/lib/session/auth/composable.js +3 -33
  219. package/lib/session/auth/composable.js.map +1 -1
  220. package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
  221. package/lib/shell/login/SignInPrimitives.js +3 -2
  222. package/lib/shell/login/SignInPrimitives.js.map +1 -1
  223. package/lib/vertesia-ui-core.js +1 -1
  224. package/lib/vertesia-ui-core.js.map +1 -1
  225. package/lib/vertesia-ui-env.js +1 -1
  226. package/lib/vertesia-ui-env.js.map +1 -1
  227. package/lib/vertesia-ui-features.js +1 -1
  228. package/lib/vertesia-ui-features.js.map +1 -1
  229. package/lib/vertesia-ui-i18n.js +1 -1
  230. package/lib/vertesia-ui-i18n.js.map +1 -1
  231. package/lib/vertesia-ui-session.js +1 -1
  232. package/lib/vertesia-ui-session.js.map +1 -1
  233. package/lib/vertesia-ui-shell.js +1 -1
  234. package/lib/vertesia-ui-shell.js.map +1 -1
  235. package/lib/vertesia-ui-widgets.js +1 -1
  236. package/lib/vertesia-ui-widgets.js.map +1 -1
  237. package/lib/widgets/schema-editor/editor/Editable.js +1 -1
  238. package/lib/widgets/schema-editor/editor/Editable.js.map +1 -1
  239. package/llms.txt +70 -70
  240. package/package.json +35 -32
  241. package/src/core/components/shadcn/dropdown.tsx +2 -0
  242. package/src/core/components/shadcn/filters/filterBar.tsx +9 -2
  243. package/src/core/components/shadcn/modal/ConfirmModal.tsx +65 -3
  244. package/src/core/components/shadcn/modal/dialog.tsx +1 -1
  245. package/src/core/components/shadcn/popover.tsx +1 -0
  246. package/src/core/components/shadcn/switch.tsx +4 -4
  247. package/src/core/components/shadcn/tabs.tsx +1 -1
  248. package/src/core/components/shadcn/tooltip.tsx +1 -0
  249. package/src/env/index.ts +0 -24
  250. package/src/features/agent/PayloadBuilder.tsx +18 -0
  251. package/src/features/agent/chat/AgentApprovalModeSelector.tsx +130 -0
  252. package/src/features/agent/chat/AgentChatFixtureReplay.test.tsx +22 -2
  253. package/src/features/agent/chat/AgentChatFixtureReplay.tsx +33 -27
  254. package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +122 -0
  255. package/src/features/agent/chat/AgentRequestInputOverlay.tsx +91 -17
  256. package/src/features/agent/chat/AgentRightPanel.tsx +238 -50
  257. package/src/features/agent/chat/AnimatedThinkingDots.tsx +1 -1
  258. package/src/features/agent/chat/ArtifactsTab.tsx +21 -155
  259. package/src/features/agent/chat/AskUserWidget.tsx +6 -2
  260. package/src/features/agent/chat/ModernAgentConversation.test.tsx +1157 -47
  261. package/src/features/agent/chat/ModernAgentConversation.tsx +703 -136
  262. package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +74 -0
  263. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +1420 -126
  264. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +934 -111
  265. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +31 -40
  266. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +28 -28
  267. package/src/features/agent/chat/ModernAgentOutput/MessageDeliveryStatus.tsx +83 -0
  268. package/src/features/agent/chat/ModernAgentOutput/MessageInput.test.tsx +38 -2
  269. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +121 -98
  270. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +7 -1
  271. package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +3 -3
  272. package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +1 -1
  273. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +82 -2
  274. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +2 -2
  275. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +216 -0
  276. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +149 -0
  277. package/src/features/agent/chat/ModernAgentOutput/utils.ts +103 -2
  278. package/src/features/agent/chat/clipboardFiles.ts +33 -0
  279. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +355 -4
  280. package/src/features/agent/chat/hooks/useAgentStream.ts +270 -43
  281. package/src/features/agent/chat/hooks/useArtifacts.ts +11 -44
  282. package/src/features/agent/chat/index.ts +10 -1
  283. package/src/features/agent/chat/workstreams.ts +42 -0
  284. package/src/features/facets/AgentRunnerFacetsNav.tsx +23 -3
  285. package/src/features/facets/CollectionsFacetsNav.tsx +30 -5
  286. package/src/features/facets/PromptsFacetsNav.tsx +30 -5
  287. package/src/features/facets/RunsFacetsNav.tsx +32 -5
  288. package/src/features/index.ts +0 -1
  289. package/src/features/oauth/McpConnectionsButton.test.tsx +248 -0
  290. package/src/features/oauth/McpConnectionsButton.tsx +269 -0
  291. package/src/features/oauth/McpConnectionsDialog.tsx +142 -0
  292. package/src/features/oauth/RemoteMcpConnectionButton.tsx +37 -14
  293. package/src/features/oauth/index.ts +3 -0
  294. package/src/features/oauth/useMcpConnections.test.ts +94 -0
  295. package/src/features/oauth/useMcpConnections.ts +210 -0
  296. package/src/features/permissions/UserPermissionsProvider.tsx +41 -59
  297. package/src/features/store/objects/DocumentPreviewPanel.tsx +4 -2
  298. package/src/features/store/objects/DocumentQuickFilter.tsx +72 -0
  299. package/src/features/store/objects/DocumentSearchResults.tsx +30 -11
  300. package/src/features/store/objects/components/ContentOverview.tsx +30 -99
  301. package/src/features/store/objects/layout/DocumentTableColumn.tsx +29 -4
  302. package/src/features/store/objects/layout/documentLayout.tsx +1 -1
  303. package/src/features/store/objects/layout/renderers.tsx +80 -20
  304. package/src/features/store/types/ContentObjectTypesSearch.tsx +7 -1
  305. package/src/features/store/types/ContentObjectTypesTable.tsx +34 -4
  306. package/src/i18n/instance.ts +1 -0
  307. package/src/i18n/locales/ar.json +72 -45
  308. package/src/i18n/locales/de.json +65 -34
  309. package/src/i18n/locales/en.json +63 -47
  310. package/src/i18n/locales/es.json +65 -35
  311. package/src/i18n/locales/fr.json +65 -35
  312. package/src/i18n/locales/it.json +72 -42
  313. package/src/i18n/locales/ja.json +72 -41
  314. package/src/i18n/locales/ko.json +72 -41
  315. package/src/i18n/locales/pt.json +72 -42
  316. package/src/i18n/locales/ru.json +72 -43
  317. package/src/i18n/locales/tr.json +72 -41
  318. package/src/i18n/locales/zh-TW.json +72 -41
  319. package/src/i18n/locales/zh.json +72 -41
  320. package/src/i18n/rtl.test.ts +57 -1
  321. package/src/session/UserSession.ts +0 -16
  322. package/src/session/UserSessionProvider.tsx +51 -123
  323. package/src/session/auth/composable.ts +3 -34
  324. package/src/shell/login/SignInPrimitives.tsx +3 -2
  325. package/src/widgets/schema-editor/editor/Editable.tsx +1 -1
  326. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts +0 -73
  327. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +0 -1
  328. package/lib/features/document-viewer/UniversalDocumentViewer.js +0 -415
  329. package/lib/features/document-viewer/UniversalDocumentViewer.js.map +0 -1
  330. package/lib/features/document-viewer/index.d.ts +0 -2
  331. package/lib/features/document-viewer/index.d.ts.map +0 -1
  332. package/lib/features/document-viewer/index.js +0 -2
  333. package/lib/features/document-viewer/index.js.map +0 -1
  334. package/src/features/document-viewer/UniversalDocumentViewer.test.tsx +0 -123
  335. package/src/features/document-viewer/UniversalDocumentViewer.tsx +0 -746
  336. package/src/features/document-viewer/index.ts +0 -1
  337. package/src/session/auth/composable.test.ts +0 -79
@@ -32,6 +32,7 @@ const TooltipContent: React.ForwardRefExoticComponent<
32
32
  style={{ zIndex: 100 }}
33
33
  className={cn(
34
34
  'max-w-[90vw]',
35
+ // rtl-ok: Radix data-side values are physical popper sides; slide direction follows the side.
35
36
  'z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
36
37
  className,
37
38
  )}
package/src/env/index.ts CHANGED
@@ -15,7 +15,6 @@ export interface EnvProps {
15
15
  zeno: string;
16
16
  studio: string;
17
17
  sts: string; // Security Token Service endpoint
18
- git?: string; // Smart HTTP app source git endpoint
19
18
  mcp?: string;
20
19
  };
21
20
  firebase?: {
@@ -28,21 +27,6 @@ export interface EnvProps {
28
27
  region?: string;
29
28
  datadogRum?: boolean;
30
29
  datadogLogs?: boolean;
31
- /**
32
- * Development-only Vertesia auth token.
33
- *
34
- * This is intended for sandbox/dev previews where the host process already
35
- * has a short-lived Vertesia token. Production apps must not set this.
36
- */
37
- devAuthToken?: string;
38
- /**
39
- * Optional host-provided Vertesia auth token bootstrap.
40
- *
41
- * Published generated apps use this to ask their same-origin app gateway for
42
- * the token backing the gateway session cookie, allowing UserSession to
43
- * initialize without redirecting through Central Auth.
44
- */
45
- authTokenProvider?: () => Promise<string | undefined>;
46
30
  logger?: {
47
31
  info: (msg: string, ...args: unknown[]) => void;
48
32
  warn: (msg: string, ...args: unknown[]) => void;
@@ -132,14 +116,6 @@ export class VertesiaEnvironment implements Readonly<EnvProps> {
132
116
  return this._props?.datadogLogs ?? false;
133
117
  }
134
118
 
135
- get devAuthToken() {
136
- return this._props?.devAuthToken;
137
- }
138
-
139
- get authTokenProvider() {
140
- return this._props?.authTokenProvider;
141
- }
142
-
143
119
  get logger() {
144
120
  return this._props?.logger ?? console;
145
121
  }
@@ -58,6 +58,7 @@ export class PayloadBuilder {
58
58
  _visibility: ConversationVisibility | undefined;
59
59
  _user_channels: UserChannel[] | undefined;
60
60
  _collection: string | undefined;
61
+ _disabled_mcp_collections: string[] | undefined;
61
62
  _start: boolean = false;
62
63
  _preserveRunValues: boolean = false;
63
64
  _interaction: InCodeInteraction | undefined;
@@ -110,6 +111,9 @@ export class PayloadBuilder {
110
111
  builder._inputValidator = this._inputValidator;
111
112
  builder._start = this._start;
112
113
  builder._collection = this._collection;
114
+ builder._disabled_mcp_collections = this._disabled_mcp_collections
115
+ ? [...this._disabled_mcp_collections]
116
+ : undefined;
113
117
  builder._preserveRunValues = this._preserveRunValues;
114
118
  builder._mode = this._mode;
115
119
  builder._scheduledWorkflowConfig = this._scheduledWorkflowConfig;
@@ -227,6 +231,15 @@ export class PayloadBuilder {
227
231
  }
228
232
  }
229
233
 
234
+ get disabled_mcp_collections(): string[] | undefined {
235
+ return this._disabled_mcp_collections;
236
+ }
237
+
238
+ set disabled_mcp_collections(value: string[] | undefined) {
239
+ this._disabled_mcp_collections = value && value.length > 0 ? value : undefined;
240
+ this.onStateChanged();
241
+ }
242
+
230
243
  get search_scope() {
231
244
  return this._collection ? AgentSearchScope.Collection : undefined;
232
245
  }
@@ -268,6 +281,7 @@ export class PayloadBuilder {
268
281
  this._non_blocking_subagents = context.non_blocking_subagents ?? true;
269
282
  this._checkpoint_tokens = context.checkpoint_tokens;
270
283
  this._user_channels = context.user_channels;
284
+ this._disabled_mcp_collections = context.disabled_mcp_collections;
271
285
  this._model_options = context.config?.model_options as ModelOptions | undefined;
272
286
  this.collection = context.collection_id ?? undefined;
273
287
  this._model_options = context.config?.model_options as InCodeInteraction['model_options'] | undefined;
@@ -400,6 +414,9 @@ export class PayloadBuilder {
400
414
  setCollection(collection: string | undefined) {
401
415
  this.collection = collection;
402
416
  }
417
+ setDisabledMcpCollections(collections: string[] | undefined) {
418
+ this.disabled_mcp_collections = collections;
419
+ }
403
420
  setInteractive(interactive: boolean) {
404
421
  this.interactive = interactive;
405
422
  }
@@ -484,6 +501,7 @@ export class PayloadBuilder {
484
501
  this._visibility = undefined;
485
502
  this._user_channels = undefined;
486
503
  this._collection = undefined;
504
+ this._disabled_mcp_collections = undefined;
487
505
  this._preserveRunValues = false;
488
506
  this._model = '';
489
507
  this._model_options = undefined;
@@ -0,0 +1,130 @@
1
+ import type { AgentToolApprovalMode } from '@vertesia/common';
2
+ import {
3
+ Button,
4
+ cn,
5
+ DropdownMenu,
6
+ DropdownMenuContent,
7
+ DropdownMenuRadioGroup,
8
+ DropdownMenuRadioItem,
9
+ DropdownMenuTrigger,
10
+ } from '@vertesia/ui/core';
11
+ import { useUITranslation } from '@vertesia/ui/i18n';
12
+ import { ChevronDownIcon, HandIcon, ShieldAlertIcon, ShieldCheckIcon } from 'lucide-react';
13
+ import type React from 'react';
14
+ import { useMemo } from 'react';
15
+
16
+ interface ApprovalModeOption {
17
+ mode: AgentToolApprovalMode;
18
+ label: string;
19
+ description: string;
20
+ icon: React.ReactNode;
21
+ }
22
+
23
+ export interface AgentApprovalModeSelectorProps {
24
+ mode: AgentToolApprovalMode;
25
+ onChange: (mode: AgentToolApprovalMode) => void;
26
+ disabled?: boolean;
27
+ className?: string;
28
+ }
29
+
30
+ function getModeIconClassName(mode: AgentToolApprovalMode) {
31
+ if (mode === 'full_control') return 'text-attention';
32
+ if (mode === 'auto_review') return 'text-info';
33
+ return 'text-muted';
34
+ }
35
+
36
+ function getModeIcon(mode: AgentToolApprovalMode) {
37
+ if (mode === 'full_control') return <ShieldAlertIcon className="size-4" />;
38
+ if (mode === 'ask') return <HandIcon className="size-4" />;
39
+ return <ShieldCheckIcon className="size-4" />;
40
+ }
41
+
42
+ export function AgentApprovalModeSelector({
43
+ mode,
44
+ onChange,
45
+ disabled = false,
46
+ className,
47
+ }: AgentApprovalModeSelectorProps) {
48
+ const { t } = useUITranslation();
49
+
50
+ const options = useMemo<ApprovalModeOption[]>(
51
+ () => [
52
+ {
53
+ mode: 'ask',
54
+ label: t('agent.approvalMode.ask'),
55
+ description: t('agent.approvalMode.askDescription'),
56
+ icon: <HandIcon className="size-4" />,
57
+ },
58
+ {
59
+ mode: 'auto_review',
60
+ label: t('agent.approvalMode.autoReview'),
61
+ description: t('agent.approvalMode.autoReviewDescription'),
62
+ icon: <ShieldCheckIcon className="size-4" />,
63
+ },
64
+ {
65
+ mode: 'full_control',
66
+ label: t('agent.approvalMode.fullControl'),
67
+ description: t('agent.approvalMode.fullControlDescription'),
68
+ icon: <ShieldAlertIcon className="size-4" />,
69
+ },
70
+ ],
71
+ [t],
72
+ );
73
+
74
+ const selected = options.find((option) => option.mode === mode) ?? options[2];
75
+
76
+ const selectMode = (nextMode: AgentToolApprovalMode) => {
77
+ if (nextMode === mode) return;
78
+ onChange(nextMode);
79
+ };
80
+
81
+ return (
82
+ <DropdownMenu>
83
+ <DropdownMenuTrigger asChild>
84
+ <Button
85
+ type="button"
86
+ variant="ghost"
87
+ size="sm"
88
+ disabled={disabled}
89
+ className={cn(
90
+ 'h-8 max-w-[13rem] rounded-full px-2.5 font-medium',
91
+ 'bg-mixer-muted/15 text-muted hover:bg-muted hover:text-foreground disabled:opacity-60',
92
+ className,
93
+ )}
94
+ aria-label={t('agent.approvalMode.selectorLabel')}
95
+ >
96
+ <span className={cn('shrink-0', getModeIconClassName(mode))}>{getModeIcon(mode)}</span>
97
+ <span className="min-w-0 truncate">{selected.label}</span>
98
+ <ChevronDownIcon className="size-4 shrink-0 opacity-70" />
99
+ </Button>
100
+ </DropdownMenuTrigger>
101
+ <DropdownMenuContent align="start" className="z-[1000000] w-[min(28rem,calc(100vw-1rem))] p-2">
102
+ <div className="px-2 pb-1.5 pt-1 text-sm font-medium text-foreground">
103
+ {t('agent.approvalMode.dropdownTitle')}
104
+ </div>
105
+ <DropdownMenuRadioGroup
106
+ value={mode}
107
+ onValueChange={(value) => selectMode(value as AgentToolApprovalMode)}
108
+ >
109
+ {options.map((option) => (
110
+ <DropdownMenuRadioItem
111
+ key={option.mode}
112
+ value={option.mode}
113
+ className="min-h-14 items-start gap-3 rounded-md py-2 pe-8 ps-2 text-start"
114
+ >
115
+ <span className={cn('mt-0.5 shrink-0', getModeIconClassName(option.mode))}>
116
+ {option.icon}
117
+ </span>
118
+ <span className="min-w-0 flex-1">
119
+ <span className="block text-sm font-medium text-foreground">{option.label}</span>
120
+ <span className="mt-0.5 block whitespace-normal text-sm leading-5 text-muted">
121
+ {option.description}
122
+ </span>
123
+ </span>
124
+ </DropdownMenuRadioItem>
125
+ ))}
126
+ </DropdownMenuRadioGroup>
127
+ </DropdownMenuContent>
128
+ </DropdownMenu>
129
+ );
130
+ }
@@ -1,5 +1,6 @@
1
1
  import { fireEvent, render, screen } from '@testing-library/react';
2
2
  import { type AgentMessage, AgentMessageType } from '@vertesia/common';
3
+ import type { ComponentProps } from 'react';
3
4
  import { describe, expect, it, vi } from 'vitest';
4
5
  import { I18nProvider } from '../../../i18n/index.js';
5
6
  import { AgentChatFixtureReplay, type AgentChatReplayFixture } from './AgentChatFixtureReplay';
@@ -38,10 +39,13 @@ function message(type: AgentMessageType, text: string, timestamp: number): Agent
38
39
  };
39
40
  }
40
41
 
41
- function renderReplay(fixture: AgentChatReplayFixture) {
42
+ function renderReplay(
43
+ fixture: AgentChatReplayFixture,
44
+ props: Omit<ComponentProps<typeof AgentChatFixtureReplay>, 'fixture'> = {},
45
+ ) {
42
46
  return render(
43
47
  <I18nProvider lng="en">
44
- <AgentChatFixtureReplay fixture={fixture} />
48
+ <AgentChatFixtureReplay fixture={fixture} {...props} />
45
49
  </I18nProvider>,
46
50
  );
47
51
  }
@@ -55,6 +59,22 @@ describe('AgentChatFixtureReplay', () => {
55
59
  expect(screen.getByTestId('all-messages-mixed').getAttribute('data-view-mode')).toBe('sliding');
56
60
  });
57
61
 
62
+ it('can hide the fixture replay header', () => {
63
+ renderReplay(
64
+ {
65
+ messages: [message(AgentMessageType.QUESTION, 'first', 1)],
66
+ metadata: {
67
+ title: 'Fixture title',
68
+ },
69
+ },
70
+ { showHeader: false },
71
+ );
72
+
73
+ expect(screen.queryByText('Fixture title')).toBeNull();
74
+ expect(screen.queryByRole('button', { name: 'Download Messages' })).toBeNull();
75
+ expect(screen.getByRole('slider', { name: 'Playback position' })).not.toBeNull();
76
+ });
77
+
58
78
  it('steps through fixture messages without mutating the source fixture', () => {
59
79
  const fixture: AgentChatReplayFixture = {
60
80
  messages: [
@@ -45,6 +45,7 @@ export interface AgentChatFixtureReplayProps {
45
45
  viewMode?: AgentConversationViewMode;
46
46
  className?: string;
47
47
  title?: string;
48
+ showHeader?: boolean;
48
49
  }
49
50
 
50
51
  function streamingFrameToMap(frame?: AgentChatReplayStreamingFrame): Map<string, StreamingData> {
@@ -105,6 +106,7 @@ export function AgentChatFixtureReplay({
105
106
  viewMode: controlledViewMode,
106
107
  className,
107
108
  title,
109
+ showHeader = true,
108
110
  }: AgentChatFixtureReplayProps) {
109
111
  const { t } = useUITranslation();
110
112
  const messages = fixture.messages;
@@ -196,37 +198,41 @@ export function AgentChatFixtureReplay({
196
198
  data-agent-replay-playing={isPlaying || undefined}
197
199
  data-agent-replay-loop={completedLoops}
198
200
  >
199
- <div className="flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-2">
200
- <div className="min-w-0">
201
- <div className="truncate text-sm font-medium">{resolvedTitle}</div>
202
- <div className="text-xs text-muted">
203
- {t('agent.rewind.fixtureMeta', {
204
- messageCount: messages.length,
205
- loops: completedLoops,
206
- })}
201
+ {showHeader && (
202
+ <div className="flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-2">
203
+ <div className="min-w-0">
204
+ <div className="truncate text-sm font-medium">{resolvedTitle}</div>
205
+ <div className="text-xs text-muted">
206
+ {t('agent.rewind.fixtureMeta', {
207
+ messageCount: messages.length,
208
+ loops: completedLoops,
209
+ })}
210
+ </div>
207
211
  </div>
208
- </div>
209
- <div className="flex items-center gap-2">
210
- <Button type="button" variant="secondary" size="sm" onClick={downloadFixture}>
211
- <DownloadCloudIcon className="size-4" />
212
- <span className="ms-1.5">{t('agent.rewind.exportFixture')}</span>
213
- </Button>
214
- {autoStepMs && autoStepMs > 0 && (
215
- <Button
216
- type="button"
217
- variant="secondary"
218
- size="sm"
219
- onClick={() => setIsPlaying((value) => !value)}
220
- >
221
- {isPlaying ? <Pause className="size-4" /> : <Play className="size-4" />}
222
- <span className="ms-1.5">
223
- {isPlaying ? t('agent.rewind.pause') : t('agent.rewind.resume')}
224
- </span>
212
+ <div className="flex items-center gap-2">
213
+ <Button type="button" variant="secondary" size="sm" onClick={downloadFixture}>
214
+ <DownloadCloudIcon className="size-4" />
215
+ <span className="ms-1.5">{t('agent.rewind.exportFixture')}</span>
225
216
  </Button>
226
- )}
217
+ {autoStepMs && autoStepMs > 0 && (
218
+ <Button
219
+ type="button"
220
+ variant="secondary"
221
+ size="sm"
222
+ onClick={() => setIsPlaying((value) => !value)}
223
+ >
224
+ {isPlaying ? <Pause className="size-4" /> : <Play className="size-4" />}
225
+ <span className="ms-1.5">
226
+ {isPlaying ? t('agent.rewind.pause') : t('agent.rewind.resume')}
227
+ </span>
228
+ </Button>
229
+ )}
230
+ </div>
227
231
  </div>
232
+ )}
233
+ <div className="flex flex-shrink-0 justify-end px-2 py-1.5">
234
+ <AgentChatPlaybackControls cursor={playback.cursor} messages={messages} onChangeCursor={setCursor} />
228
235
  </div>
229
- <AgentChatPlaybackControls cursor={playback.cursor} messages={messages} onChangeCursor={setCursor} />
230
236
  <AllMessagesMixed
231
237
  messages={displayedMessages}
232
238
  isCompleted={isCompleted}
@@ -0,0 +1,122 @@
1
+ import { fireEvent, screen } from '@testing-library/react';
2
+ import { AgentMessageType } from '@vertesia/common';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+ import { renderWithProviders } from '../../../__tests__/test-utils.js';
5
+ import { AgentRequestInputOverlay } from './AgentRequestInputOverlay';
6
+ import type { RequestInputMessageWithUx } from './ModernAgentOutput/requestInputMessages';
7
+
8
+ vi.mock('@vertesia/ui/session', () => ({
9
+ useUserSession: () => ({
10
+ client: {
11
+ remoteMcpConnections: {
12
+ getCollectionStatus: vi.fn(),
13
+ },
14
+ },
15
+ }),
16
+ }));
17
+
18
+ vi.mock('../../oauth/RemoteMcpConnectionButton.js', () => ({
19
+ RemoteMcpConnectionButton: () => <button type="button">Connect</button>,
20
+ }));
21
+
22
+ function createMcpRequestMessage(): RequestInputMessageWithUx {
23
+ return {
24
+ type: AgentMessageType.REQUEST_INPUT,
25
+ timestamp: 1,
26
+ workflow_run_id: 'run-1',
27
+ workstream_id: 'main',
28
+ message: 'Connect to Jira to continue.',
29
+ details: {
30
+ ux: {
31
+ mcp_connect: {
32
+ app_install_id: 'app1',
33
+ collection_id: 'jira',
34
+ name: 'Jira',
35
+ },
36
+ },
37
+ },
38
+ };
39
+ }
40
+
41
+ function createToolApprovalRequestMessage(): RequestInputMessageWithUx {
42
+ return {
43
+ type: AgentMessageType.REQUEST_INPUT,
44
+ timestamp: 1,
45
+ workflow_run_id: 'run-1',
46
+ workstream_id: 'main',
47
+ message: 'Approve Write Artifact: quotes.md?',
48
+ details: {
49
+ tool_approval: {
50
+ tool_name: 'write_artifact',
51
+ tool_title: 'Write Artifact',
52
+ target: 'name:quotes.md',
53
+ approval_key: 'write_artifact:name:quotes.md',
54
+ },
55
+ ux: {
56
+ options: [
57
+ { id: 'allow_once', label: 'Allow once' },
58
+ { id: 'allow_for_run', label: 'Allow this action for this run' },
59
+ { id: 'deny', label: 'Deny' },
60
+ ],
61
+ free_response: {
62
+ placeholder: 'No, and tell the agent what to do differently',
63
+ submit_label: 'Submit',
64
+ metadata: {
65
+ tool_approval_response: {
66
+ decision: 'deny_with_feedback',
67
+ approval_key: 'write_artifact:name:quotes.md',
68
+ },
69
+ },
70
+ },
71
+ },
72
+ },
73
+ };
74
+ }
75
+
76
+ describe('AgentRequestInputOverlay', () => {
77
+ it('lets the user decline an MCP connection request', () => {
78
+ const onSendMessage = vi.fn();
79
+
80
+ renderWithProviders(
81
+ <AgentRequestInputOverlay message={createMcpRequestMessage()} onSendMessage={onSendMessage} />,
82
+ );
83
+
84
+ expect(screen.getAllByRole('button').map((button) => button.textContent)).toEqual(['Connect', 'Decline']);
85
+
86
+ fireEvent.click(screen.getByRole('button', { name: /decline/i }));
87
+
88
+ expect(onSendMessage).toHaveBeenCalledTimes(1);
89
+ expect(onSendMessage).toHaveBeenCalledWith("I don't want to connect to Jira. Continue without it.");
90
+ });
91
+
92
+ it('sends a commented tool approval denial with structured metadata', () => {
93
+ const onSendMessage = vi.fn();
94
+
95
+ renderWithProviders(
96
+ <AgentRequestInputOverlay message={createToolApprovalRequestMessage()} onSendMessage={onSendMessage} />,
97
+ );
98
+
99
+ fireEvent.change(screen.getByPlaceholderText('No, and tell the agent what to do differently'), {
100
+ target: { value: 'Do not write a file. Put the summary in chat.' },
101
+ });
102
+ fireEvent.click(screen.getByRole('button', { name: 'Submit' }));
103
+
104
+ expect(onSendMessage).toHaveBeenCalledTimes(1);
105
+ expect(onSendMessage).toHaveBeenCalledWith('Do not write a file. Put the summary in chat.', {
106
+ tool_approval_response: {
107
+ decision: 'deny_with_feedback',
108
+ approval_key: 'write_artifact:name:quotes.md',
109
+ },
110
+ });
111
+ });
112
+
113
+ it('renders legacy field-prefixed tool approval prompts with a friendly target', () => {
114
+ const message = createToolApprovalRequestMessage();
115
+ message.message = 'Approve Write Artifact: name quotes.md?';
116
+
117
+ renderWithProviders(<AgentRequestInputOverlay message={message} onSendMessage={vi.fn()} />);
118
+
119
+ expect(screen.getByText('Approve Write Artifact: quotes.md?')).not.toBeNull();
120
+ expect(screen.queryByText('Approve Write Artifact: name quotes.md?')).toBeNull();
121
+ });
122
+ });
@@ -1,52 +1,126 @@
1
- import { cn } from '@vertesia/ui/core';
1
+ import type { McpConnectUxConfig } from '@vertesia/common';
2
+ import { Button, cn } from '@vertesia/ui/core';
3
+ import { useUITranslation } from '@vertesia/ui/i18n';
4
+ import { useUserSession } from '@vertesia/ui/session';
5
+ import { XIcon } from 'lucide-react';
6
+ import { RemoteMcpConnectionButton } from '../../oauth/RemoteMcpConnectionButton.js';
2
7
  import { AskUserWidget } from './AskUserWidget';
3
- import { getAgentMessageText, type RequestInputMessageWithUx } from './ModernAgentOutput/requestInputMessages';
8
+ import { getRequestInputDisplayText, type RequestInputMessageWithUx } from './ModernAgentOutput/requestInputMessages';
4
9
 
5
10
  export interface AgentRequestInputOverlayProps {
6
11
  message?: RequestInputMessageWithUx;
7
- onSendMessage?: (message: string) => void;
12
+ onSendMessage?: (message: string, metadata?: Record<string, unknown>) => void;
13
+ /** Called after the user connects the MCP server requested by request_mcp_connection. */
14
+ onMcpConnected?: (cfg: McpConnectUxConfig) => void;
8
15
  isLoading?: boolean;
9
16
  disabled?: boolean;
10
17
  className?: string;
11
18
  }
12
19
 
20
+ interface McpRequestInputControlsProps {
21
+ mcpConnect: McpConnectUxConfig;
22
+ onMcpConnected?: (cfg: McpConnectUxConfig) => void;
23
+ onDecline: () => void;
24
+ disabled: boolean;
25
+ }
26
+
27
+ function McpRequestInputControls({ mcpConnect, onMcpConnected, onDecline, disabled }: McpRequestInputControlsProps) {
28
+ const { client } = useUserSession();
29
+ const { t } = useUITranslation();
30
+
31
+ return (
32
+ <div className="flex shrink-0 items-center justify-end gap-2">
33
+ <RemoteMcpConnectionButton
34
+ appId={mcpConnect.app_install_id}
35
+ collectionId={mcpConnect.collection_id}
36
+ collectionName={mcpConnect.name}
37
+ variant="default"
38
+ onAuthChange={() => {
39
+ // useOAuthPopup fires onComplete even on cancel/popup-close, so only
40
+ // resume the agent once the connection is actually authenticated.
41
+ void client.remoteMcpConnections
42
+ .getCollectionStatus(mcpConnect.app_install_id, mcpConnect.collection_id)
43
+ .then((status) => {
44
+ if (status.authenticated) onMcpConnected?.(mcpConnect);
45
+ })
46
+ .catch(() => {
47
+ /* status check failed — do not resume */
48
+ });
49
+ }}
50
+ readOnly={disabled}
51
+ />
52
+ <Button variant="ghost" size="sm" onClick={onDecline} disabled={disabled}>
53
+ <XIcon className="size-4" />
54
+ <span>{t('mcpOAuth.decline')}</span>
55
+ </Button>
56
+ </div>
57
+ );
58
+ }
59
+
13
60
  export function AgentRequestInputOverlay({
14
61
  message,
15
62
  onSendMessage,
63
+ onMcpConnected,
16
64
  isLoading = false,
17
65
  disabled = false,
18
66
  className,
19
67
  }: AgentRequestInputOverlayProps) {
68
+ const { t } = useUITranslation();
69
+
20
70
  if (!message) return null;
21
71
 
22
72
  const uxConfig = message.details.ux;
23
73
  const options = uxConfig.options ?? [];
74
+ const mcpConnect = uxConfig.mcp_connect;
75
+ const freeResponse = uxConfig.free_response;
24
76
  const isDisabled = disabled || isLoading || !onSendMessage;
25
- const send = (value: string) => {
77
+ const displayText = getRequestInputDisplayText(message);
78
+ const send = (value: string, metadata?: Record<string, unknown>) => {
26
79
  if (isDisabled) return;
27
- onSendMessage?.(value);
80
+ if (metadata) {
81
+ onSendMessage?.(value, metadata);
82
+ } else {
83
+ onSendMessage?.(value);
84
+ }
28
85
  };
29
86
 
87
+ const wrapperClassName = cn(
88
+ 'flex-shrink-0 border-t border-border/70 bg-background/95 backdrop-blur',
89
+ 'fixed bottom-0 end-0 start-0 z-20 lg:sticky lg:start-auto lg:end-auto',
90
+ 'pb-safe-area',
91
+ className,
92
+ );
93
+
94
+ if (mcpConnect) {
95
+ return (
96
+ <div className={wrapperClassName} data-agent-request-input-overlay>
97
+ <div className="mx-auto flex w-full max-w-3xl flex-col gap-3 px-3 py-3 sm:flex-row sm:items-center sm:justify-between">
98
+ <div className="min-w-0 text-sm leading-6 text-foreground/85">{displayText}</div>
99
+ <McpRequestInputControls
100
+ mcpConnect={mcpConnect}
101
+ onMcpConnected={onMcpConnected}
102
+ onDecline={() => send(t('agent.mcpDeclinedMessage', { name: mcpConnect.name }))}
103
+ disabled={isDisabled}
104
+ />
105
+ </div>
106
+ </div>
107
+ );
108
+ }
109
+
30
110
  return (
31
- <div
32
- className={cn(
33
- 'flex-shrink-0 border-t border-border/70 bg-background/95 backdrop-blur',
34
- 'fixed bottom-0 end-0 start-0 z-20 lg:sticky lg:start-auto lg:end-auto',
35
- 'pb-safe-area',
36
- className,
37
- )}
38
- data-agent-request-input-overlay
39
- >
111
+ <div className={wrapperClassName} data-agent-request-input-overlay>
40
112
  <div className="mx-auto w-full max-w-3xl px-3 py-3">
41
113
  <AskUserWidget
42
- question={getAgentMessageText(message)}
114
+ question={displayText}
43
115
  options={options}
44
116
  variant={uxConfig.variant}
45
117
  multiSelect={uxConfig.multiSelect}
46
- allowFreeResponse={options.length === 0}
118
+ allowFreeResponse={options.length === 0 || !!freeResponse}
119
+ placeholder={freeResponse?.placeholder}
120
+ submitLabel={freeResponse?.submit_label}
47
121
  onSelect={send}
48
122
  onMultiSelect={(optionIds) => send(optionIds.join(', '))}
49
- onSubmit={send}
123
+ onSubmit={(value) => send(value, freeResponse?.metadata)}
50
124
  hideBorder
51
125
  compact
52
126
  isLoading={isDisabled}