@seed-ship/mcp-ui-solid 6.24.0 → 7.0.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 (353) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +61 -0
  3. package/dist/adapters/connector.cjs +3 -3
  4. package/dist/adapters/connector.cjs.map +1 -1
  5. package/dist/adapters/connector.d.cts +108 -0
  6. package/dist/adapters/connector.d.ts +1 -2
  7. package/dist/adapters/connector.js +3 -3
  8. package/dist/adapters/connector.js.map +1 -1
  9. package/dist/adapters/index.d.cts +21 -0
  10. package/dist/adapters/index.d.ts +6 -7
  11. package/dist/adapters/macro-run.d.cts +99 -0
  12. package/dist/adapters/macro-run.d.ts +1 -2
  13. package/dist/adapters/presentation.d.cts +1 -2
  14. package/dist/adapters/presentation.d.ts +1 -2
  15. package/dist/adapters.d.cts +1 -1
  16. package/dist/adapters.d.ts +1 -1
  17. package/dist/components/ActionGroupRenderer.cjs +6 -6
  18. package/dist/components/ActionGroupRenderer.cjs.map +1 -1
  19. package/dist/components/ActionGroupRenderer.d.cts +38 -0
  20. package/dist/components/ActionGroupRenderer.d.ts +1 -2
  21. package/dist/components/ActionGroupRenderer.js +6 -6
  22. package/dist/components/ActionGroupRenderer.js.map +1 -1
  23. package/dist/components/ActionRenderer.d.cts +9 -0
  24. package/dist/components/ActionRenderer.d.ts +0 -1
  25. package/dist/components/AgentCard.d.cts +19 -0
  26. package/dist/components/AgentCard.d.ts +1 -2
  27. package/dist/components/AgentHandoff.d.cts +11 -0
  28. package/dist/components/AgentHandoff.d.ts +1 -2
  29. package/dist/components/ArtifactRenderer.d.cts +11 -0
  30. package/dist/components/ArtifactRenderer.d.ts +0 -1
  31. package/dist/components/AutocompleteDropdown.cjs +6 -6
  32. package/dist/components/AutocompleteDropdown.cjs.map +1 -1
  33. package/dist/components/AutocompleteDropdown.d.cts +70 -0
  34. package/dist/components/AutocompleteDropdown.d.ts +1 -2
  35. package/dist/components/AutocompleteDropdown.js +6 -6
  36. package/dist/components/AutocompleteDropdown.js.map +1 -1
  37. package/dist/components/AutocompleteFormField.cjs +6 -5
  38. package/dist/components/AutocompleteFormField.cjs.map +1 -1
  39. package/dist/components/AutocompleteFormField.d.cts +51 -0
  40. package/dist/components/AutocompleteFormField.d.ts +1 -2
  41. package/dist/components/AutocompleteFormField.d.ts.map +1 -1
  42. package/dist/components/AutocompleteFormField.js +6 -5
  43. package/dist/components/AutocompleteFormField.js.map +1 -1
  44. package/dist/components/BriefingDiff.d.cts +11 -0
  45. package/dist/components/BriefingDiff.d.ts +1 -2
  46. package/dist/components/CarouselRenderer.d.cts +12 -0
  47. package/dist/components/CarouselRenderer.d.ts +1 -2
  48. package/dist/components/ChartJSRenderer.cjs +216 -6
  49. package/dist/components/ChartJSRenderer.cjs.map +1 -1
  50. package/dist/components/ChartJSRenderer.d.cts +62 -0
  51. package/dist/components/ChartJSRenderer.d.ts +1 -2
  52. package/dist/components/ChartJSRenderer.d.ts.map +1 -1
  53. package/dist/components/ChartJSRenderer.js +217 -7
  54. package/dist/components/ChartJSRenderer.js.map +1 -1
  55. package/dist/components/ChatPrompt.cjs +5 -5
  56. package/dist/components/ChatPrompt.cjs.map +1 -1
  57. package/dist/components/ChatPrompt.d.cts +69 -0
  58. package/dist/components/ChatPrompt.d.ts +1 -2
  59. package/dist/components/ChatPrompt.js +5 -5
  60. package/dist/components/ChatPrompt.js.map +1 -1
  61. package/dist/components/CodeBlockRenderer.d.cts +23 -0
  62. package/dist/components/CodeBlockRenderer.d.ts +1 -2
  63. package/dist/components/ComponentToolbar.cjs +5 -5
  64. package/dist/components/ComponentToolbar.cjs.map +1 -1
  65. package/dist/components/ComponentToolbar.d.cts +46 -0
  66. package/dist/components/ComponentToolbar.d.ts +0 -1
  67. package/dist/components/ComponentToolbar.js +5 -5
  68. package/dist/components/ComponentToolbar.js.map +1 -1
  69. package/dist/components/DataPreviewSection.d.cts +11 -0
  70. package/dist/components/DataPreviewSection.d.ts +1 -2
  71. package/dist/components/DegradedFallback.cjs +1 -1
  72. package/dist/components/DegradedFallback.cjs.map +1 -1
  73. package/dist/components/DegradedFallback.d.cts +43 -0
  74. package/dist/components/DegradedFallback.d.ts +0 -1
  75. package/dist/components/DegradedFallback.js +1 -1
  76. package/dist/components/DegradedFallback.js.map +1 -1
  77. package/dist/components/DraggableGridItem.d.cts +94 -0
  78. package/dist/components/DraggableGridItem.d.ts +1 -2
  79. package/dist/components/EditableLayoutContext.d.cts +4 -0
  80. package/dist/components/EditableLayoutContext.d.ts +0 -1
  81. package/dist/components/EditableUIResourceRenderer.d.cts +42 -0
  82. package/dist/components/EditableUIResourceRenderer.d.ts +1 -2
  83. package/dist/components/ElicitationForm.d.cts +67 -0
  84. package/dist/components/ElicitationForm.d.ts +1 -2
  85. package/dist/components/ExpandableWrapper.cjs +10 -7
  86. package/dist/components/ExpandableWrapper.cjs.map +1 -1
  87. package/dist/components/ExpandableWrapper.d.cts +49 -0
  88. package/dist/components/ExpandableWrapper.d.ts +0 -1
  89. package/dist/components/ExpandableWrapper.d.ts.map +1 -1
  90. package/dist/components/ExpandableWrapper.js +10 -7
  91. package/dist/components/ExpandableWrapper.js.map +1 -1
  92. package/dist/components/FeedbackInline.d.cts +70 -0
  93. package/dist/components/FeedbackInline.d.ts +0 -1
  94. package/dist/components/FooterRenderer.d.cts +15 -0
  95. package/dist/components/FooterRenderer.d.ts +0 -1
  96. package/dist/components/FormFieldRenderer.cjs +13 -12
  97. package/dist/components/FormFieldRenderer.cjs.map +1 -1
  98. package/dist/components/FormFieldRenderer.d.cts +19 -0
  99. package/dist/components/FormFieldRenderer.d.ts +1 -2
  100. package/dist/components/FormFieldRenderer.d.ts.map +1 -1
  101. package/dist/components/FormFieldRenderer.js +13 -12
  102. package/dist/components/FormFieldRenderer.js.map +1 -1
  103. package/dist/components/FormRenderer.cjs +1 -1
  104. package/dist/components/FormRenderer.cjs.map +1 -1
  105. package/dist/components/FormRenderer.d.cts +14 -0
  106. package/dist/components/FormRenderer.d.ts +1 -2
  107. package/dist/components/FormRenderer.js +1 -1
  108. package/dist/components/FormRenderer.js.map +1 -1
  109. package/dist/components/GenerativeUIErrorBoundary.cjs +1 -1
  110. package/dist/components/GenerativeUIErrorBoundary.cjs.map +1 -1
  111. package/dist/components/GenerativeUIErrorBoundary.d.cts +58 -0
  112. package/dist/components/GenerativeUIErrorBoundary.d.ts +1 -2
  113. package/dist/components/GenerativeUIErrorBoundary.default.d.cts +1 -0
  114. package/dist/components/GenerativeUIErrorBoundary.default.d.ts +1 -2
  115. package/dist/components/GenerativeUIErrorBoundary.js +1 -1
  116. package/dist/components/GenerativeUIErrorBoundary.js.map +1 -1
  117. package/dist/components/GhostText.cjs +2 -2
  118. package/dist/components/GhostText.cjs.map +1 -1
  119. package/dist/components/GhostText.d.cts +112 -0
  120. package/dist/components/GhostText.d.ts +0 -1
  121. package/dist/components/GhostText.js +2 -2
  122. package/dist/components/GhostText.js.map +1 -1
  123. package/dist/components/GraphRenderer.cjs +100 -29
  124. package/dist/components/GraphRenderer.cjs.map +1 -1
  125. package/dist/components/GraphRenderer.d.cts +66 -0
  126. package/dist/components/GraphRenderer.d.ts +2 -3
  127. package/dist/components/GraphRenderer.d.ts.map +1 -1
  128. package/dist/components/GraphRenderer.js +100 -29
  129. package/dist/components/GraphRenderer.js.map +1 -1
  130. package/dist/components/GridRenderer.d.cts +49 -0
  131. package/dist/components/GridRenderer.d.ts +1 -2
  132. package/dist/components/IframeFallbackLink.d.cts +22 -0
  133. package/dist/components/IframeFallbackLink.d.ts +0 -1
  134. package/dist/components/ImageGalleryRenderer.d.cts +22 -0
  135. package/dist/components/ImageGalleryRenderer.d.ts +1 -2
  136. package/dist/components/LightboxOverlay.d.cts +31 -0
  137. package/dist/components/LightboxOverlay.d.ts +1 -2
  138. package/dist/components/MapRenderer.d.cts +77 -0
  139. package/dist/components/MapRenderer.d.ts +1 -2
  140. package/dist/components/MissingValue.cjs +2 -2
  141. package/dist/components/MissingValue.cjs.map +1 -1
  142. package/dist/components/MissingValue.d.cts +26 -0
  143. package/dist/components/MissingValue.d.ts +0 -1
  144. package/dist/components/MissingValue.js +2 -2
  145. package/dist/components/MissingValue.js.map +1 -1
  146. package/dist/components/ModalRenderer.cjs +39 -31
  147. package/dist/components/ModalRenderer.cjs.map +1 -1
  148. package/dist/components/ModalRenderer.d.cts +66 -0
  149. package/dist/components/ModalRenderer.d.ts +1 -2
  150. package/dist/components/ModalRenderer.d.ts.map +1 -1
  151. package/dist/components/ModalRenderer.js +40 -32
  152. package/dist/components/ModalRenderer.js.map +1 -1
  153. package/dist/components/PortalDropdownMenu.cjs +6 -3
  154. package/dist/components/PortalDropdownMenu.cjs.map +1 -1
  155. package/dist/components/PortalDropdownMenu.d.cts +55 -0
  156. package/dist/components/PortalDropdownMenu.d.ts +0 -1
  157. package/dist/components/PortalDropdownMenu.d.ts.map +1 -1
  158. package/dist/components/PortalDropdownMenu.js +7 -4
  159. package/dist/components/PortalDropdownMenu.js.map +1 -1
  160. package/dist/components/PresentationFeedback.d.cts +112 -0
  161. package/dist/components/PresentationFeedback.d.ts +0 -1
  162. package/dist/components/RenderContext.d.cts +41 -0
  163. package/dist/components/RenderContext.d.ts +1 -2
  164. package/dist/components/ResizeHandle.d.cts +49 -0
  165. package/dist/components/ResizeHandle.d.ts +0 -1
  166. package/dist/components/SafeHtml.d.cts +45 -0
  167. package/dist/components/SafeHtml.d.ts +0 -1
  168. package/dist/components/ScratchpadPanel.cjs +38 -44
  169. package/dist/components/ScratchpadPanel.cjs.map +1 -1
  170. package/dist/components/ScratchpadPanel.d.cts +34 -0
  171. package/dist/components/ScratchpadPanel.d.ts +1 -2
  172. package/dist/components/ScratchpadPanel.d.ts.map +1 -1
  173. package/dist/components/ScratchpadPanel.js +38 -44
  174. package/dist/components/ScratchpadPanel.js.map +1 -1
  175. package/dist/components/SplitStepper.d.cts +11 -0
  176. package/dist/components/SplitStepper.d.ts +1 -2
  177. package/dist/components/StreamingUIRenderer.d.cts +58 -0
  178. package/dist/components/StreamingUIRenderer.d.ts +3 -4
  179. package/dist/components/UIResourceRenderer.cjs +20 -20
  180. package/dist/components/UIResourceRenderer.cjs.map +1 -1
  181. package/dist/components/UIResourceRenderer.d.cts +181 -0
  182. package/dist/components/UIResourceRenderer.d.ts +3 -4
  183. package/dist/components/UIResourceRenderer.default.d.cts +1 -0
  184. package/dist/components/UIResourceRenderer.default.d.ts +1 -2
  185. package/dist/components/UIResourceRenderer.js +20 -20
  186. package/dist/components/UIResourceRenderer.js.map +1 -1
  187. package/dist/components/VerifiedText.d.cts +22 -0
  188. package/dist/components/VerifiedText.d.ts +1 -2
  189. package/dist/components/VideoRenderer.d.cts +41 -0
  190. package/dist/components/VideoRenderer.d.ts +1 -2
  191. package/dist/components/chart-data-table.d.cts +68 -0
  192. package/dist/components/chart-data-table.d.ts +0 -1
  193. package/dist/components/chart-missing-plugin.cjs +4 -4
  194. package/dist/components/chart-missing-plugin.cjs.map +1 -1
  195. package/dist/components/chart-missing-plugin.d.cts +128 -0
  196. package/dist/components/chart-missing-plugin.d.ts +4 -3
  197. package/dist/components/chart-missing-plugin.d.ts.map +1 -1
  198. package/dist/components/chart-missing-plugin.js +4 -4
  199. package/dist/components/chart-missing-plugin.js.map +1 -1
  200. package/dist/components/index.d.cts +62 -0
  201. package/dist/components/index.d.ts +57 -58
  202. package/dist/components.d.cts +2 -2
  203. package/dist/components.d.ts +2 -2
  204. package/dist/context/AutocompleteContext.d.cts +76 -0
  205. package/dist/context/AutocompleteContext.d.ts +1 -2
  206. package/dist/context/MCPActionContext.d.cts +169 -0
  207. package/dist/context/MCPActionContext.d.ts +0 -1
  208. package/dist/context/MCPUIConfigContext.d.cts +201 -0
  209. package/dist/context/MCPUIConfigContext.d.ts +1 -2
  210. package/dist/context/MCPUIMathContext.d.cts +17 -0
  211. package/dist/context/MCPUIMathContext.d.ts +0 -1
  212. package/dist/context/MCPUIStringsContext.d.cts +802 -0
  213. package/dist/context/MCPUIStringsContext.d.ts +1 -2
  214. package/dist/context/MCPUITelemetryContext.d.cts +35 -0
  215. package/dist/context/MCPUITelemetryContext.d.ts +1 -2
  216. package/dist/context/index.d.cts +7 -0
  217. package/dist/context/index.d.ts +2 -3
  218. package/dist/hooks/createResponsiveGrid.d.cts +5 -0
  219. package/dist/hooks/createResponsiveGrid.d.ts +0 -1
  220. package/dist/hooks/index.d.cts +25 -0
  221. package/dist/hooks/index.d.ts +20 -21
  222. package/dist/hooks/useAction.d.cts +164 -0
  223. package/dist/hooks/useAction.d.ts +2 -3
  224. package/dist/hooks/useAutocomplete.d.cts +118 -0
  225. package/dist/hooks/useAutocomplete.d.ts +1 -2
  226. package/dist/hooks/useChatBus.d.cts +55 -0
  227. package/dist/hooks/useChatBus.d.ts +1 -2
  228. package/dist/hooks/useConditionalField.d.cts +34 -0
  229. package/dist/hooks/useConditionalField.d.ts +1 -2
  230. package/dist/hooks/useDataValidator.d.cts +41 -0
  231. package/dist/hooks/useDataValidator.d.ts +1 -2
  232. package/dist/hooks/useDragDrop.d.cts +99 -0
  233. package/dist/hooks/useDragDrop.d.ts +1 -2
  234. package/dist/hooks/useFormPersistence.d.cts +80 -0
  235. package/dist/hooks/useFormPersistence.d.ts +0 -1
  236. package/dist/hooks/useModal.d.cts +106 -0
  237. package/dist/hooks/useModal.d.ts +0 -1
  238. package/dist/hooks/useResize.d.cts +86 -0
  239. package/dist/hooks/useResize.d.ts +1 -2
  240. package/dist/hooks/useStreamingUI.d.cts +117 -0
  241. package/dist/hooks/useStreamingUI.d.ts +1 -2
  242. package/dist/hooks.d.cts +1 -1
  243. package/dist/hooks.d.ts +1 -1
  244. package/dist/index.d.cts +91 -92
  245. package/dist/index.d.ts +91 -92
  246. package/dist/plugins/duckdb.d.cts +1 -2
  247. package/dist/plugins/duckdb.d.ts +1 -2
  248. package/dist/plugins/groq.d.cts +12 -0
  249. package/dist/plugins/groq.d.ts +1 -2
  250. package/dist/plugins/index.d.cts +9 -0
  251. package/dist/plugins/index.d.ts +3 -4
  252. package/dist/plugins/katex.d.cts +1 -2
  253. package/dist/plugins/katex.d.ts +1 -2
  254. package/dist/plugins/rest.d.cts +12 -0
  255. package/dist/plugins/rest.d.ts +1 -2
  256. package/dist/plugins/supabase.d.cts +12 -0
  257. package/dist/plugins/supabase.d.ts +1 -2
  258. package/dist/services/chat-bus.d.cts +100 -0
  259. package/dist/services/chat-bus.d.ts +1 -2
  260. package/dist/services/chat-prompt-controller.d.cts +92 -0
  261. package/dist/services/chat-prompt-controller.d.ts +1 -2
  262. package/dist/services/component-registry.d.cts +119 -0
  263. package/dist/services/component-registry.d.ts +1 -2
  264. package/dist/services/data-validator.d.cts +27 -0
  265. package/dist/services/data-validator.d.ts +1 -2
  266. package/dist/services/index.d.cts +9 -0
  267. package/dist/services/index.d.ts +4 -5
  268. package/dist/services/telemetry.d.cts +86 -0
  269. package/dist/services/telemetry.d.ts +1 -2
  270. package/dist/services/validation.d.cts +169 -0
  271. package/dist/services/validation.d.ts +1 -2
  272. package/dist/stores/scratchpad-store.d.cts +109 -0
  273. package/dist/stores/scratchpad-store.d.ts +1 -2
  274. package/dist/stores/server-capabilities-store.d.cts +171 -0
  275. package/dist/stores/server-capabilities-store.d.ts +0 -1
  276. package/dist/test-setup.d.cts +5 -0
  277. package/dist/test-setup.d.ts +0 -1
  278. package/dist/testing/index.d.cts +34 -0
  279. package/dist/testing/index.d.ts +1 -2
  280. package/dist/types/chat-bus.d.cts +783 -0
  281. package/dist/types/chat-bus.d.ts +4 -5
  282. package/dist/types/index.d.cts +1616 -0
  283. package/dist/types/index.d.ts +0 -1
  284. package/dist/types-export.d.cts +1 -2
  285. package/dist/types-export.d.ts +1 -2
  286. package/dist/types.d.cts +1 -1
  287. package/dist/types.d.ts +1 -1
  288. package/dist/utils/degraded-projections.d.cts +119 -0
  289. package/dist/utils/degraded-projections.d.ts +0 -1
  290. package/dist/utils/duplicate-mount-registry.d.cts +83 -0
  291. package/dist/utils/duplicate-mount-registry.d.ts +0 -1
  292. package/dist/utils/escape-html.d.cts +12 -0
  293. package/dist/utils/escape-html.d.ts +0 -1
  294. package/dist/utils/format-string.d.cts +25 -0
  295. package/dist/utils/format-string.d.ts +0 -1
  296. package/dist/utils/iframe-coep.d.cts +53 -0
  297. package/dist/utils/iframe-coep.d.ts +1 -2
  298. package/dist/utils/logger.d.cts +57 -0
  299. package/dist/utils/logger.d.ts +0 -1
  300. package/dist/utils/math-markdown.cjs +1 -1
  301. package/dist/utils/math-markdown.cjs.map +1 -1
  302. package/dist/utils/math-markdown.d.cts +15 -0
  303. package/dist/utils/math-markdown.d.ts +1 -2
  304. package/dist/utils/math-markdown.js +1 -1
  305. package/dist/utils/math-markdown.js.map +1 -1
  306. package/dist/utils/missing-value.d.cts +78 -0
  307. package/dist/utils/missing-value.d.ts +0 -1
  308. package/dist/utils/pan-zoom.d.cts +234 -0
  309. package/dist/utils/pan-zoom.d.ts +0 -1
  310. package/dist/utils/perf.d.cts +18 -0
  311. package/dist/utils/perf.d.ts +0 -1
  312. package/dist/utils/safe-url.d.cts +33 -0
  313. package/dist/utils/safe-url.d.ts +0 -1
  314. package/dist/utils/sanitize-html.d.cts +142 -0
  315. package/dist/utils/sanitize-html.d.ts +0 -1
  316. package/dist/utils/stable-key.d.cts +32 -0
  317. package/dist/utils/stable-key.d.ts +0 -1
  318. package/dist/utils/theme.cjs +91 -0
  319. package/dist/utils/theme.cjs.map +1 -0
  320. package/dist/utils/theme.d.cts +10 -0
  321. package/dist/utils/theme.d.ts +10 -0
  322. package/dist/utils/theme.d.ts.map +1 -0
  323. package/dist/utils/theme.js +91 -0
  324. package/dist/utils/theme.js.map +1 -0
  325. package/dist/validation.d.cts +3 -4
  326. package/dist/validation.d.ts +3 -4
  327. package/docs/SECURITY-DEPENDENCIES.md +209 -0
  328. package/docs/THEMING.md +205 -0
  329. package/docs/ZOD4-STABLE-MIGRATION-2026-10-26.md +181 -0
  330. package/package.json +12 -9
  331. package/src/adapters/connector.ts +3 -3
  332. package/src/components/ActionGroupRenderer.tsx +6 -6
  333. package/src/components/AutocompleteDropdown.tsx +17 -17
  334. package/src/components/AutocompleteFormField.tsx +10 -9
  335. package/src/components/ChartJSRenderer.tsx +483 -239
  336. package/src/components/ChatPrompt.tsx +16 -16
  337. package/src/components/ComponentToolbar.tsx +5 -5
  338. package/src/components/DegradedFallback.tsx +9 -9
  339. package/src/components/ExpandableWrapper.tsx +15 -11
  340. package/src/components/FormFieldRenderer.tsx +52 -51
  341. package/src/components/FormRenderer.tsx +12 -12
  342. package/src/components/GenerativeUIErrorBoundary.tsx +6 -6
  343. package/src/components/GhostText.tsx +7 -7
  344. package/src/components/GraphRenderer.tsx +83 -67
  345. package/src/components/MissingValue.tsx +2 -2
  346. package/src/components/ModalRenderer.tsx +11 -5
  347. package/src/components/PortalDropdownMenu.tsx +6 -2
  348. package/src/components/ScratchpadPanel.tsx +144 -141
  349. package/src/components/UIResourceRenderer.tsx +101 -101
  350. package/src/components/chart-missing-plugin.ts +5 -3
  351. package/src/styles/autocomplete.css +53 -53
  352. package/src/utils/math-markdown.ts +1 -1
  353. package/src/utils/theme.ts +101 -0
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Chat Bus — Event Emitter + Command Handler
3
+ * v2.4.0: Core primitives for the chat event/command bus
4
+ *
5
+ * @experimental — This API may change without major bump until v2.5.0.
6
+ */
7
+ import type { ChatEventEmitter, ChatCommandHandler, ChatBus, ScratchpadSection, ClarificationEvent, ElicitationEvent, ChatPromptConfig } from "../types/chat-bus.cjs";
8
+ /**
9
+ * Create a typed event emitter with throttle and streamKey filtering support.
10
+ *
11
+ * @experimental
12
+ *
13
+ * @example
14
+ * const emitter = createEventEmitter<ChatEvents>()
15
+ * const unsub = emitter.on('onToken', (event) => console.log(event.token), { throttle: 100 })
16
+ * emitter.emit('onToken', { streamKey: 'abc', token: 'hello' })
17
+ * unsub()
18
+ */
19
+ export declare function createEventEmitter(): ChatEventEmitter;
20
+ /**
21
+ * Create a typed command handler. The host app registers handlers,
22
+ * agents execute commands.
23
+ *
24
+ * @experimental
25
+ *
26
+ * @example
27
+ * const commands = createCommandHandler<ChatCommands>()
28
+ * commands.handle('injectPrompt', (text) => setInputValue(text))
29
+ * commands.exec('injectPrompt', 'Hello world')
30
+ */
31
+ export declare function createCommandHandler(): ChatCommandHandler;
32
+ /**
33
+ * Create a complete ChatBus with events + commands.
34
+ *
35
+ * @experimental
36
+ *
37
+ * @example
38
+ * const bus = createChatBus()
39
+ * bus.events.on('onStreamEnd', (event) => { ... })
40
+ * bus.commands.handle('sendPrompt', (text) => { ... })
41
+ */
42
+ export declare function createChatBus(): ChatBus;
43
+ /**
44
+ * Merge sections from a ScratchpadEvent into existing state sections.
45
+ * Handles replace/append/upsert modes.
46
+ *
47
+ * @example
48
+ * const newSections = mergeScratchpadSections(
49
+ * currentState.sections,
50
+ * event.sections,
51
+ * event.sectionMode
52
+ * )
53
+ */
54
+ export declare function mergeScratchpadSections(existing: ScratchpadSection[], incoming: ScratchpadSection[] | undefined, mode?: 'replace' | 'append' | 'upsert'): ScratchpadSection[];
55
+ /**
56
+ * Convert a ClarificationEvent into a ChatPromptConfig.
57
+ * Universal bridge for apps receiving clarification events via SSE.
58
+ *
59
+ * Legacy runtime `file_id` (removed from the type in v5.0.0) is still
60
+ * transparently migrated into `metadata.file_id` when present, so payloads
61
+ * from older servers continue to work without upgrade pressure.
62
+ *
63
+ * @experimental
64
+ * @since v4.3.9
65
+ * @example
66
+ * bus.events.on('onClarificationNeeded', ({ clarification }) => {
67
+ * bus.commands.exec('showChatPrompt', clarificationToPromptConfig(clarification))
68
+ * })
69
+ */
70
+ /**
71
+ * Convert an MCP `elicitation/create` payload into a `ChatPromptConfig`.
72
+ *
73
+ * Mapping rules :
74
+ * - Single `boolean` property → `type: 'confirm'`
75
+ * - Single property with `enum` of ≤4 values → `type: 'choice'` (one option per enum value)
76
+ * - Anything else → `type: 'form'` with one field per schema property
77
+ *
78
+ * JSON Schema primitive types map to mcp-ui form field types :
79
+ *
80
+ * | JSON Schema | mcp-ui FormFieldType |
81
+ * |---|---|
82
+ * | `type: 'string'` | `'text'` |
83
+ * | `type: 'string', format: 'email'` | `'email'` |
84
+ * | `type: 'string', format: 'date'` or `'date-time'` | `'date'` |
85
+ * | `type: 'string', enum: [...]` | `'select'` |
86
+ * | `type: 'number' \| 'integer'` | `'number'` |
87
+ * | `type: 'boolean'` | `'checkbox'` |
88
+ *
89
+ * Unknown shapes fall through to plain text with a `helpText` warning.
90
+ *
91
+ * @experimental
92
+ * @since v5.2.0
93
+ *
94
+ * @example
95
+ * bus.events.on('onElicitation', ({ elicitation }) => {
96
+ * bus.commands.exec('showChatPrompt', elicitationToPromptConfig(elicitation))
97
+ * })
98
+ */
99
+ export declare function elicitationToPromptConfig(event: ElicitationEvent): ChatPromptConfig;
100
+ export declare function clarificationToPromptConfig(event: ClarificationEvent): ChatPromptConfig;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @experimental — This API may change without major bump until v2.5.0.
6
6
  */
7
- import type { ChatEventEmitter, ChatCommandHandler, ChatBus, ScratchpadSection, ClarificationEvent, ElicitationEvent, ChatPromptConfig } from '../types/chat-bus';
7
+ import type { ChatEventEmitter, ChatCommandHandler, ChatBus, ScratchpadSection, ClarificationEvent, ElicitationEvent, ChatPromptConfig } from "../types/chat-bus.js";
8
8
  /**
9
9
  * Create a typed event emitter with throttle and streamKey filtering support.
10
10
  *
@@ -98,4 +98,3 @@ export declare function mergeScratchpadSections(existing: ScratchpadSection[], i
98
98
  */
99
99
  export declare function elicitationToPromptConfig(event: ElicitationEvent): ChatPromptConfig;
100
100
  export declare function clarificationToPromptConfig(event: ClarificationEvent): ChatPromptConfig;
101
- //# sourceMappingURL=chat-bus.d.ts.map
@@ -0,0 +1,92 @@
1
+ /**
2
+ * createChatPromptController — centralised lifecycle for `showChatPrompt`
3
+ *
4
+ * @experimental
5
+ * @since v5.2.0
6
+ *
7
+ * The controller owns the resolver closure, AbortSignal wiring, and
8
+ * re-entrance policy in one primitive. Consumers go from ~20 LOC of manual
9
+ * wiring per app to :
10
+ *
11
+ * ```ts
12
+ * const ctrl = createChatPromptController()
13
+ * bus.commands.handle('showChatPrompt', ctrl.handle)
14
+ * // ...
15
+ * <Show when={ctrl.activePrompt()}>
16
+ * {(cfg) => (
17
+ * <ChatPrompt
18
+ * config={cfg()}
19
+ * onSubmit={ctrl.resolveActive}
20
+ * onDismiss={ctrl.dismissActive}
21
+ * />
22
+ * )}
23
+ * </Show>
24
+ * ```
25
+ *
26
+ * ## Re-entrance policy
27
+ *
28
+ * If a new `showChatPrompt` arrives while a previous Promise is still
29
+ * pending, the previous Promise rejects **synchronously** with a
30
+ * `PromptReplacedError` before the new prompt is installed. Callers that
31
+ * care can branch on `err instanceof PromptReplacedError` or `err.name ===
32
+ * 'PromptReplacedError'`.
33
+ *
34
+ * ## Abort semantics
35
+ *
36
+ * `handle(config, signal?)` honours `AbortSignal` :
37
+ *
38
+ * - If `signal.aborted === true` on entry → returns a rejected Promise with
39
+ * `new DOMException('Prompt aborted', 'AbortError')`, does NOT set
40
+ * `activePrompt`.
41
+ * - Otherwise registers a once-only listener that rejects with the same
42
+ * `DOMException` on abort, clearing the active state.
43
+ *
44
+ * `AbortError` is the Web Platform convention (matches `fetch()`,
45
+ * `Response.body.cancel()`, etc.) — callers can branch on `err.name ===
46
+ * 'AbortError'` without importing any mcp-ui type.
47
+ */
48
+ import { type Accessor } from 'solid-js';
49
+ import type { ChatPromptConfig, ChatPromptResponse } from "../types/chat-bus.cjs";
50
+ /**
51
+ * Thrown when an active `showChatPrompt` Promise is rejected because a new
52
+ * prompt arrived before the previous one resolved. Consumers can use
53
+ * `instanceof PromptReplacedError` or `err.name === 'PromptReplacedError'` to
54
+ * branch (retry, bail, log).
55
+ *
56
+ * @experimental
57
+ * @since v5.2.0
58
+ */
59
+ export declare class PromptReplacedError extends Error {
60
+ readonly name: "PromptReplacedError";
61
+ constructor(message?: string);
62
+ }
63
+ export interface ChatPromptController {
64
+ /**
65
+ * Register as the bus handler :
66
+ * `bus.commands.handle('showChatPrompt', ctrl.handle)`
67
+ */
68
+ handle: (config: ChatPromptConfig, signal?: AbortSignal) => Promise<ChatPromptResponse>;
69
+ /**
70
+ * Reactive accessor for the currently active prompt config (null when no
71
+ * prompt is pending). Use in JSX to drive `<ChatPrompt>` rendering.
72
+ */
73
+ activePrompt: Accessor<ChatPromptConfig | null>;
74
+ /** Call this from `<ChatPrompt>`'s `onSubmit` prop. */
75
+ resolveActive: (response: ChatPromptResponse) => void;
76
+ /** Call this from `<ChatPrompt>`'s `onDismiss` prop. */
77
+ dismissActive: () => void;
78
+ /**
79
+ * Cancel the active prompt programmatically (e.g. on route change). Rejects
80
+ * the pending Promise with the supplied reason or an `AbortError`.
81
+ */
82
+ abort: (reason?: string) => void;
83
+ }
84
+ /**
85
+ * Create a stateful controller that owns the active prompt Promise, the
86
+ * AbortSignal listener, and the re-entrance policy. See module JSDoc for
87
+ * full usage.
88
+ *
89
+ * @experimental
90
+ * @since v5.2.0
91
+ */
92
+ export declare function createChatPromptController(): ChatPromptController;
@@ -46,7 +46,7 @@
46
46
  * 'AbortError'` without importing any mcp-ui type.
47
47
  */
48
48
  import { type Accessor } from 'solid-js';
49
- import type { ChatPromptConfig, ChatPromptResponse } from '../types/chat-bus';
49
+ import type { ChatPromptConfig, ChatPromptResponse } from "../types/chat-bus.js";
50
50
  /**
51
51
  * Thrown when an active `showChatPrompt` Promise is rejected because a new
52
52
  * prompt arrived before the previous one resolved. Consumers can use
@@ -90,4 +90,3 @@ export interface ChatPromptController {
90
90
  * @since v5.2.0
91
91
  */
92
92
  export declare function createChatPromptController(): ChatPromptController;
93
- //# sourceMappingURL=chat-prompt-controller.d.ts.map
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Component Registry Service
3
+ * Phase 0: Static registry with Chart and Table definitions
4
+ * Phase 1: Dynamic registry populated from /api/mcp/tools/list
5
+ *
6
+ * Provides component schemas for LLM prompt engineering
7
+ */
8
+ import type { ComponentRegistryEntry, ComponentType } from "../types.cjs";
9
+ /**
10
+ * Chart Component Registry Entry
11
+ *
12
+ * The historical export name is retained for source compatibility. The
13
+ * renderer is local-first: Chart.js is the native implementation, while the
14
+ * external QuickChart fallback is a host-level opt-in.
15
+ */
16
+ export declare const QuickchartRegistry: ComponentRegistryEntry;
17
+ /**
18
+ * Table Component Registry Entry
19
+ */
20
+ export declare const TableRegistry: ComponentRegistryEntry;
21
+ /**
22
+ * Metric Card Component Registry Entry
23
+ */
24
+ export declare const MetricRegistry: ComponentRegistryEntry;
25
+ /**
26
+ * Text Component Registry Entry
27
+ */
28
+ export declare const TextRegistry: ComponentRegistryEntry;
29
+ /**
30
+ * Grid Component Registry Entry
31
+ * Nested CSS Grid layout for organizing multiple components
32
+ */
33
+ export declare const GridRegistry: ComponentRegistryEntry;
34
+ /**
35
+ * Action Component Registry Entry
36
+ * Interactive button or link that triggers tool calls
37
+ */
38
+ export declare const ActionRegistry: ComponentRegistryEntry;
39
+ /**
40
+ * Footer Component Registry Entry
41
+ * Display execution metadata like timing and source count
42
+ */
43
+ export declare const FooterRegistry: ComponentRegistryEntry;
44
+ /**
45
+ * Carousel Component Registry Entry
46
+ * Display multiple items with horizontal scrolling
47
+ */
48
+ export declare const CarouselRegistry: ComponentRegistryEntry;
49
+ /**
50
+ * Artifact Component Registry Entry
51
+ * Display downloadable artifacts like generated files
52
+ */
53
+ export declare const ArtifactRegistry: ComponentRegistryEntry;
54
+ /**
55
+ * Code Block Registry Entry
56
+ */
57
+ export declare const CodeRegistry: ComponentRegistryEntry;
58
+ export declare const MapRegistry: ComponentRegistryEntry;
59
+ /**
60
+ * Graph Registry Entry (v6.12.0 — audit P1.5)
61
+ */
62
+ export declare const GraphRegistry: ComponentRegistryEntry;
63
+ /**
64
+ * Form Registry Entry
65
+ */
66
+ export declare const FormRegistry: ComponentRegistryEntry;
67
+ /**
68
+ * Modal Registry Entry
69
+ */
70
+ export declare const ModalRegistry: ComponentRegistryEntry;
71
+ /**
72
+ * Action Group Registry Entry
73
+ */
74
+ export declare const ActionGroupRegistry: ComponentRegistryEntry;
75
+ /**
76
+ * Image Gallery Registry Entry
77
+ */
78
+ export declare const ImageGalleryRegistry: ComponentRegistryEntry;
79
+ /**
80
+ * Video Registry Entry
81
+ */
82
+ export declare const VideoRegistry: ComponentRegistryEntry;
83
+ /**
84
+ * Iframe Registry Entry
85
+ */
86
+ export declare const IframeRegistry: ComponentRegistryEntry;
87
+ /**
88
+ * Image Registry Entry
89
+ */
90
+ export declare const ImageRegistry: ComponentRegistryEntry;
91
+ /**
92
+ * Link Registry Entry
93
+ */
94
+ export declare const LinkRegistry: ComponentRegistryEntry;
95
+ /**
96
+ * Component Registry - All components indexed by type
97
+ */
98
+ export declare const ComponentRegistry: Map<ComponentType, ComponentRegistryEntry>;
99
+ /**
100
+ * Get component registry entry by type
101
+ */
102
+ export declare function getComponentEntry(type: ComponentType): ComponentRegistryEntry | undefined;
103
+ /**
104
+ * Get all component types
105
+ */
106
+ export declare function getAllComponentTypes(): ComponentType[];
107
+ /**
108
+ * Get registry as JSON for LLM context
109
+ */
110
+ export declare function getRegistryForLLM(): string;
111
+ /**
112
+ * Validate component against registry schema
113
+ * (Future: Use Zod for runtime validation)
114
+ */
115
+ export declare function validateAgainstRegistry(componentType: ComponentType, params: any): {
116
+ valid: boolean;
117
+ errors?: string[];
118
+ warnings?: string[];
119
+ };
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Provides component schemas for LLM prompt engineering
7
7
  */
8
- import type { ComponentRegistryEntry, ComponentType } from '../types';
8
+ import type { ComponentRegistryEntry, ComponentType } from "../types.js";
9
9
  /**
10
10
  * Chart Component Registry Entry
11
11
  *
@@ -117,4 +117,3 @@ export declare function validateAgainstRegistry(componentType: ComponentType, pa
117
117
  errors?: string[];
118
118
  warnings?: string[];
119
119
  };
120
- //# sourceMappingURL=component-registry.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Data Validator — anti-hallucination for LLM-generated text
3
+ * v3.1.0: Pure regex-based number verification against source data
4
+ *
5
+ * Compares numbers in LLM text to numbers in source data rows.
6
+ * Detects ~90% of numerical hallucinations with zero LLM cost, <1ms latency.
7
+ */
8
+ import type { DataValidation, DataValidationOptions } from "../types/chat-bus.cjs";
9
+ /**
10
+ * Validate LLM-generated text against source data rows.
11
+ *
12
+ * Pure function — no IO, no LLM calls, no side effects.
13
+ * Returns which numbers in the text are verified vs hallucinated.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const rows = [{ type: 'Appartement', ventes: 22306, prix_m2: 3337 }]
18
+ * const result = validateAgainstSource(
19
+ * "On observe 22 306 ventes à 3 337 EUR/m². En 2023, 18 245 ventes.",
20
+ * rows
21
+ * )
22
+ * // result.valid === false
23
+ * // result.hallucinated === [{ value: 18245, ... }]
24
+ * // result.confidence === 0.67
25
+ * ```
26
+ */
27
+ export declare function validateAgainstSource(text: string, sourceRows: Record<string, unknown>[], options?: DataValidationOptions): DataValidation;
@@ -5,7 +5,7 @@
5
5
  * Compares numbers in LLM text to numbers in source data rows.
6
6
  * Detects ~90% of numerical hallucinations with zero LLM cost, <1ms latency.
7
7
  */
8
- import type { DataValidation, DataValidationOptions } from '../types/chat-bus';
8
+ import type { DataValidation, DataValidationOptions } from "../types/chat-bus.js";
9
9
  /**
10
10
  * Validate LLM-generated text against source data rows.
11
11
  *
@@ -25,4 +25,3 @@ import type { DataValidation, DataValidationOptions } from '../types/chat-bus';
25
25
  * ```
26
26
  */
27
27
  export declare function validateAgainstSource(text: string, sourceRows: Record<string, unknown>[], options?: DataValidationOptions): DataValidation;
28
- //# sourceMappingURL=data-validator.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * MCP UI Solid - Services
3
+ *
4
+ * Business logic for component validation and registry management
5
+ */
6
+ export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, } from "./validation.cjs";
7
+ export { ComponentRegistry } from "./component-registry.cjs";
8
+ export { createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections } from "./chat-bus.cjs";
9
+ export { validateAgainstSource } from "./data-validator.cjs";
@@ -3,8 +3,7 @@
3
3
  *
4
4
  * Business logic for component validation and registry management
5
5
  */
6
- export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, } from './validation';
7
- export { ComponentRegistry } from './component-registry';
8
- export { createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections } from './chat-bus';
9
- export { validateAgainstSource } from './data-validator';
10
- //# sourceMappingURL=index.d.ts.map
6
+ export { validateComponent, validateLayout, validateIframeDomain, getIframeSandbox, isTrustedIframeDomain, DEFAULT_RESOURCE_LIMITS, DEFAULT_IFRAME_DOMAINS, TRUSTED_IFRAME_DOMAINS, } from "./validation.js";
7
+ export { ComponentRegistry } from "./component-registry.js";
8
+ export { createEventEmitter, createCommandHandler, createChatBus, mergeScratchpadSections } from "./chat-bus.js";
9
+ export { validateAgainstSource } from "./data-validator.js";
@@ -0,0 +1,86 @@
1
+ /**
2
+ * UI telemetry sink (B.5 — v5.6.0)
3
+ *
4
+ * Minimal OpenTelemetry-like Provider that lets a consumer (e.g. deposium
5
+ * `/admin/ui-telemetry`) collect lifecycle + error + action events from
6
+ * mcp-ui components without imposing any API change on apps that don't use
7
+ * it. Spec'd in `MCP-UI-AUDIT-2026-04-26.md` §M.6.
8
+ *
9
+ * Three hard rules:
10
+ * 1. Provider is OPTIONAL. When absent, `useTelemetry()` returns `null`
11
+ * and dispatch sites no-op. Existing apps see zero behavior change.
12
+ * 2. Sink is FAIL-OPEN. A `sink()` throw or rejected promise is caught
13
+ * silently — telemetry never crashes the renderer.
14
+ * 3. Events carry NO payload data. Only meta (type + id + counts + timing)
15
+ * to avoid PII / data leaks in centralized logs.
16
+ */
17
+ import type { ComponentType } from "../types.cjs";
18
+ interface TelemetryEventBase {
19
+ /** Component instance id (from `UIComponent.id` or auto-generated). */
20
+ id: string;
21
+ /** ComponentType, e.g. 'chart' / 'metric' / 'iframe'. */
22
+ componentType: ComponentType;
23
+ /** Wall-clock timestamp (ms epoch) for cross-stack correlation. */
24
+ ts: number;
25
+ }
26
+ /**
27
+ * Discriminated union of all telemetry events emitted by mcp-ui.
28
+ * See §M.6.2 for field semantics + privacy rules.
29
+ */
30
+ export type TelemetryEvent = ({
31
+ type: 'component:mounted';
32
+ } & TelemetryEventBase) | ({
33
+ type: 'component:rendered';
34
+ durationMs: number;
35
+ } & TelemetryEventBase) | ({
36
+ type: 'component:unmounted';
37
+ } & TelemetryEventBase) | ({
38
+ type: 'validation:failed';
39
+ errorCount: number;
40
+ firstErrorCode: string | null;
41
+ } & TelemetryEventBase) | ({
42
+ type: 'render:error';
43
+ errorMessage: string;
44
+ } & TelemetryEventBase) | ({
45
+ type: 'action:dispatched';
46
+ actionName: string;
47
+ } & TelemetryEventBase);
48
+ /**
49
+ * Consumer-supplied sink. Receives a batch of events (always an array,
50
+ * even for `bufferMs: 0` — single-element array in that case). Errors
51
+ * and rejected promises are caught silently by the dispatcher.
52
+ */
53
+ export interface TelemetrySink {
54
+ (events: TelemetryEvent[]): void | Promise<void>;
55
+ }
56
+ export interface TelemetryOptions {
57
+ /** Per-event base sampling rate, 0..1, default 1.0 (all events). */
58
+ sampleRate?: number;
59
+ /** Buffer events and flush after N ms (default 100). 0 = no buffer. */
60
+ bufferMs?: number;
61
+ /** Max buffered events before forced flush (default 50). */
62
+ bufferMax?: number;
63
+ /** Per-event-type override on sampling (high-volume types can be lower). */
64
+ sampleByType?: Partial<Record<TelemetryEvent['type'], number>>;
65
+ }
66
+ /**
67
+ * Dispatcher returned by `createTelemetryDispatcher`. Used internally by
68
+ * the Provider, exposed only so tests can drive it without React/Solid.
69
+ */
70
+ export interface TelemetryDispatcher {
71
+ /**
72
+ * Push an event. Sampling + buffering applied transparently. Never throws.
73
+ */
74
+ dispatch(event: TelemetryEvent): void;
75
+ /**
76
+ * Force-flush the buffer. Useful on tab-hidden / unload, or for tests.
77
+ * Never throws.
78
+ */
79
+ flush(): void;
80
+ }
81
+ /**
82
+ * Create a telemetry dispatcher. Pure function, no Solid context — exists
83
+ * separately from the Provider so it can be unit-tested in isolation.
84
+ */
85
+ export declare function createTelemetryDispatcher(sink: TelemetrySink, options?: TelemetryOptions): TelemetryDispatcher;
86
+ export {};
@@ -14,7 +14,7 @@
14
14
  * 3. Events carry NO payload data. Only meta (type + id + counts + timing)
15
15
  * to avoid PII / data leaks in centralized logs.
16
16
  */
17
- import type { ComponentType } from '../types';
17
+ import type { ComponentType } from "../types.js";
18
18
  interface TelemetryEventBase {
19
19
  /** Component instance id (from `UIComponent.id` or auto-generated). */
20
20
  id: string;
@@ -84,4 +84,3 @@ export interface TelemetryDispatcher {
84
84
  */
85
85
  export declare function createTelemetryDispatcher(sink: TelemetrySink, options?: TelemetryOptions): TelemetryDispatcher;
86
86
  export {};
87
- //# sourceMappingURL=telemetry.d.ts.map