@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,1616 @@
1
+ /**
2
+ * Generative MCP UI - Type Definitions
3
+ * Phase 0-3 Implementation
4
+ *
5
+ * Defines the contract for LLM-generated UI components
6
+ */
7
+ /**
8
+ * Component types supported by the renderer.
9
+ *
10
+ * Re-exported from `@seed-ship/mcp-ui-spec` (`ComponentTypeSchema`) — the spec
11
+ * is the single source of truth for the enum. Solid used to hand-maintain a
12
+ * parallel union here, which drifted (it had silently dropped `composite`).
13
+ * Re-exporting keeps this type and the spec enum in lockstep by construction.
14
+ */
15
+ import type { ComponentType, LatLngPoint } from '@seed-ship/mcp-ui-spec';
16
+ export type { ComponentType, LatLngPoint };
17
+ /**
18
+ * Chart types rendered natively with Chart.js.
19
+ */
20
+ export type ChartType = 'bar' | 'line' | 'pie' | 'doughnut' | 'radar' | 'scatter' | 'bubble' | 'polarArea';
21
+ /**
22
+ * Grid layout specification (12-column system)
23
+ */
24
+ export interface GridPosition {
25
+ /**
26
+ * Column start (1-12)
27
+ */
28
+ colStart: number;
29
+ /**
30
+ * Column span (1-12)
31
+ */
32
+ colSpan: number;
33
+ /**
34
+ * Row start (1-based, auto-increment if not specified)
35
+ */
36
+ rowStart?: number;
37
+ /**
38
+ * Row span (default: 1)
39
+ */
40
+ rowSpan?: number;
41
+ }
42
+ /**
43
+ * Component resource limits (SECURITY)
44
+ */
45
+ export interface ResourceLimits {
46
+ /**
47
+ * Max data points per chart (default: 1000)
48
+ */
49
+ maxDataPoints: number;
50
+ /**
51
+ * Max table rows (default: 100, pagination required)
52
+ */
53
+ maxTableRows: number;
54
+ /**
55
+ * Max payload size in bytes (default: 512KB)
56
+ */
57
+ maxPayloadSize: number;
58
+ /**
59
+ * Iframe render timeout in ms (default: 5000ms)
60
+ */
61
+ renderTimeout: number;
62
+ }
63
+ /**
64
+ * Chart component parameters
65
+ */
66
+ export interface ChartComponentParams {
67
+ type: ChartType;
68
+ title?: string;
69
+ data: {
70
+ labels: string[];
71
+ datasets: Array<{
72
+ label: string;
73
+ /**
74
+ * `null` is an explicit missing value (v6.24.0): its label keeps its
75
+ * slot, a line breaks there, a bar shows a dashed outline — never a
76
+ * zero. Pie, doughnut and polar-area charts reject it, since they
77
+ * would draw it as a zero share.
78
+ */
79
+ data: Array<number | null> | Array<{
80
+ x: string | number;
81
+ y: number | null;
82
+ r?: number;
83
+ }>;
84
+ backgroundColor?: string | string[];
85
+ borderColor?: string | string[];
86
+ borderWidth?: number;
87
+ /** Fill area under line (useful for time-series) */
88
+ fill?: boolean | string;
89
+ /** Line tension (0 = straight, 0.4 = smooth) */
90
+ tension?: number;
91
+ }>;
92
+ };
93
+ options?: {
94
+ responsive?: boolean;
95
+ maintainAspectRatio?: boolean;
96
+ tension?: number;
97
+ scales?: any;
98
+ plugins?: any;
99
+ };
100
+ /**
101
+ * Force renderer type (Sprint 4)
102
+ * - 'native': Use Chart.js directly (requires chart.js peer dependency)
103
+ * - 'iframe': Request the external QuickChart renderer (requires host opt-in)
104
+ * - 'auto': Use native Chart.js when available; otherwise degrade locally
105
+ * unless the host explicitly enables the external fallback (default)
106
+ */
107
+ renderer?: 'native' | 'iframe' | 'auto';
108
+ /**
109
+ * Enable PNG export button (v2.2.0)
110
+ */
111
+ exportable?: boolean;
112
+ /**
113
+ * Time-series axis configuration (v3.1.0).
114
+ * When set, x-axis labels are parsed as dates.
115
+ * The host must install and register a compatible Chart.js date adapter.
116
+ */
117
+ timeAxis?: {
118
+ /** Date format for parsing labels (Chart.js adapter format, e.g. 'yyyy-MM-dd') */
119
+ parser?: string;
120
+ /** Display unit for x-axis ticks */
121
+ unit?: 'day' | 'week' | 'month' | 'quarter' | 'year';
122
+ /** Date format for tooltip display */
123
+ tooltipFormat?: string;
124
+ /** Min date (ISO string) */
125
+ min?: string;
126
+ /** Max date (ISO string) */
127
+ max?: string;
128
+ };
129
+ /**
130
+ * Chart container height as CSS value (v2.2.0, default '250px')
131
+ */
132
+ height?: string;
133
+ /**
134
+ * Custom CSS class (Sprint 7)
135
+ */
136
+ className?: string;
137
+ /**
138
+ * Unit of every value in the chart (`'mm'`, `'km/h'`), shown as the value
139
+ * axis title (unless `options.scales` already sets one), after each tooltip
140
+ * value, and in the data-view column headers (v6.24.0). One unit per chart.
141
+ */
142
+ unit?: string;
143
+ }
144
+ /**
145
+ * Table virtualization options (Sprint Ultimate U.3)
146
+ */
147
+ export interface TableVirtualizeOptions {
148
+ /**
149
+ * Enable virtualization explicitly (auto-enabled if rows > threshold)
150
+ */
151
+ enabled?: boolean;
152
+ /**
153
+ * Row height in pixels (default: 48)
154
+ */
155
+ rowHeight?: number;
156
+ /**
157
+ * Number of rows to render outside viewport (default: 5)
158
+ */
159
+ overscan?: number;
160
+ /**
161
+ * Auto-enable threshold - virtualize if rows exceed this count (default: 100)
162
+ */
163
+ threshold?: number;
164
+ }
165
+ /**
166
+ * Citation map entry — source of a `[N]` citation marker rendered inline
167
+ * inside table cells (v5.7.0). See
168
+ * `mcp-ui-solid/docs/briefs/BRIEF-citations-in-table-cells.md`.
169
+ */
170
+ export interface CitationEntry {
171
+ page: number | string;
172
+ file?: string;
173
+ file_id?: number | string;
174
+ }
175
+ /**
176
+ * Table component parameters
177
+ * Updated Sprint Ultimate U.3: Added virtualization support
178
+ * Updated v5.7.0: Optional citationMap + citationRender for chip rendering
179
+ */
180
+ export interface TableComponentParams {
181
+ title?: string;
182
+ columns: Array<{
183
+ key: string;
184
+ label: string;
185
+ sortable?: boolean;
186
+ width?: string;
187
+ }>;
188
+ rows: Array<Record<string, any>>;
189
+ pagination?: {
190
+ currentPage: number;
191
+ pageSize: number;
192
+ totalRows: number;
193
+ };
194
+ /** Show the accent-insensitive client-side search field (default: true). */
195
+ searchable?: boolean;
196
+ /** Placeholder displayed in the client-side search field. */
197
+ searchPlaceholder?: string;
198
+ /** Rows per page in expanded mode (default: 25). Set 0 to disable paging. */
199
+ pageSize?: number;
200
+ /** Rows per page in chat mode (default: min(10, pageSize)). Set 0 to disable paging. */
201
+ chatPageSize?: number;
202
+ /** Initial zero-based page for client-side paging. */
203
+ initialPage?: number;
204
+ /**
205
+ * Enable table virtualization for large datasets (Sprint Ultimate U.3)
206
+ * - true: Enable with default options
207
+ * - false: Disable virtualization
208
+ * - TableVirtualizeOptions: Enable with custom options
209
+ */
210
+ virtualize?: boolean | TableVirtualizeOptions;
211
+ /**
212
+ * Enable table export (v2.2.0)
213
+ * - true: Enable all formats (csv, tsv, json)
214
+ * - object: Configure formats and filename
215
+ */
216
+ exportable?: boolean | {
217
+ formats?: ('csv' | 'tsv' | 'json')[];
218
+ filename?: string;
219
+ };
220
+ /**
221
+ * Custom CSS class (Sprint 7)
222
+ */
223
+ className?: string;
224
+ /**
225
+ * Opt-in citation chip rendering (v5.7.0). Maps marker id (e.g. `1` from
226
+ * `[1]` or `[📄 CITATION 1]` in cell text) to its source. When set,
227
+ * `<TableRenderer>` replaces markers in cell strings with clickable
228
+ * chips carrying `data-citation-page` / `data-citation-doc` /
229
+ * `data-citation-verified` attributes that a host's delegated click
230
+ * handler can route. JSON-serializable — safe to send from MCP servers.
231
+ */
232
+ citationMap?: Record<string | number, CitationEntry>;
233
+ /**
234
+ * Optional override for the chip HTML (v5.7.0). When supplied, wins over
235
+ * the default chip shape. NOT JSON-serializable — must be wired by the
236
+ * consumer at render time, not from a server payload.
237
+ */
238
+ citationRender?: (id: number, mapping: CitationEntry | undefined) => string;
239
+ /**
240
+ * Opt-out for the inline-mode max-height cap (v6.3.0).
241
+ * - `'auto'` → no cap, parent container handles overflow
242
+ * - number → `${n}px`
243
+ * - string → CSS length as-is
244
+ * - undefined → existing behavior (400px when > 8 rows, 500px virtualizing)
245
+ *
246
+ * Ignored in expanded (fullscreen) mode — the modal uses
247
+ * `flex-1 min-h-0` regardless.
248
+ */
249
+ maxHeight?: 'auto' | number | string;
250
+ }
251
+ /**
252
+ * Metric card component parameters
253
+ */
254
+ export interface MetricComponentParams {
255
+ title: string;
256
+ value: string | number;
257
+ unit?: string;
258
+ trend?: {
259
+ value: number;
260
+ direction: 'up' | 'down' | 'neutral';
261
+ };
262
+ subtitle?: string;
263
+ icon?: string;
264
+ /**
265
+ * Custom CSS class (Sprint 7)
266
+ */
267
+ className?: string;
268
+ }
269
+ /**
270
+ * Text component parameters
271
+ */
272
+ export interface TextComponentParams {
273
+ content: string;
274
+ markdown?: boolean;
275
+ className?: string;
276
+ }
277
+ /**
278
+ * Action component parameters
279
+ */
280
+ export interface ActionComponentParams {
281
+ label: string;
282
+ type: 'button' | 'link';
283
+ action: 'tool-call' | 'link' | 'submit';
284
+ toolName?: string;
285
+ params?: Record<string, any>;
286
+ url?: string;
287
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
288
+ size?: 'sm' | 'md' | 'lg';
289
+ icon?: string;
290
+ disabled?: boolean;
291
+ /**
292
+ * Custom CSS class (Sprint 7)
293
+ */
294
+ className?: string;
295
+ /**
296
+ * Accessible label for screen readers (Sprint 7)
297
+ */
298
+ ariaLabel?: string;
299
+ }
300
+ /**
301
+ * Form field option (for select, radio)
302
+ */
303
+ export interface FormFieldOption {
304
+ label: string;
305
+ value: string;
306
+ disabled?: boolean;
307
+ }
308
+ /**
309
+ * Form field type
310
+ */
311
+ export type FormFieldType = 'text' | 'email' | 'password' | 'number' | 'date' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'autocomplete' | 'range' | 'tags' | 'toggle' | 'fieldset';
312
+ /**
313
+ * Operators for conditional field display
314
+ */
315
+ export type ShowWhenOperator = 'equals' | 'notEquals' | 'in' | 'notIn' | 'contains' | 'startsWith' | 'endsWith' | 'greaterThan' | 'lessThan' | 'isEmpty' | 'isNotEmpty' | 'isTrue' | 'isFalse';
316
+ /**
317
+ * Condition for conditional field visibility
318
+ */
319
+ export interface ShowWhenCondition {
320
+ field: string;
321
+ operator: ShowWhenOperator;
322
+ value?: any;
323
+ }
324
+ /**
325
+ * Form field parameters
326
+ */
327
+ /** How a prefilled value was obtained */
328
+ export type PrefillSource = 'user' | 'detected' | 'inferred' | 'default';
329
+ export interface FormFieldParams {
330
+ name: string;
331
+ type: FormFieldType;
332
+ label?: string;
333
+ placeholder?: string;
334
+ helpText?: string;
335
+ required?: boolean;
336
+ disabled?: boolean;
337
+ defaultValue?: any;
338
+ /** Pre-filled value. Field renders with this value instead of empty. */
339
+ prefill?: string | string[];
340
+ /** Human-readable display for prefilled value (e.g. "Rhône — déduit de Lyon") */
341
+ displayHint?: string;
342
+ /** How this value was obtained. Drives visual treatment. */
343
+ source?: PrefillSource;
344
+ /** If true, field is visually muted (but still editable on click/focus). */
345
+ muted?: boolean;
346
+ /** How to handle prefill for autocomplete fields.
347
+ * - "exact" (default): prefill is the final value (code), use as-is
348
+ * - "resolve": prefill is a display name, call apiUrl to resolve to valueField */
349
+ prefillMode?: 'exact' | 'resolve';
350
+ /** Regex pattern the submitted value MUST match. Prevents submit if invalid. */
351
+ valueFormat?: string;
352
+ /** Human-readable hint shown when valueFormat validation fails. */
353
+ valueFormatHint?: string;
354
+ minLength?: number;
355
+ maxLength?: number;
356
+ pattern?: string;
357
+ min?: number;
358
+ max?: number;
359
+ step?: number;
360
+ minDate?: string;
361
+ maxDate?: string;
362
+ options?: FormFieldOption[];
363
+ /** Enable multi-select (returns array of values) */
364
+ multiple?: boolean;
365
+ /** API URL for autocomplete suggestions */
366
+ apiUrl?: string;
367
+ /** Query parameter name (e.g. 'nom', 'q') */
368
+ searchParam?: string;
369
+ /** Field in API response to display */
370
+ labelField?: string;
371
+ /** Field in API response to use as value */
372
+ valueField?: string;
373
+ /** Extra query parameters */
374
+ extraParams?: Record<string, string>;
375
+ /** Min characters before triggering (default: 2) */
376
+ minChars?: number;
377
+ /** Debounce delay in ms (default: 300) */
378
+ debounceMs?: number;
379
+ /** Field dependency configuration */
380
+ dependsOn?: {
381
+ /** Name of the parent field */
382
+ field: string;
383
+ /** API URL template — use {value} for parent value (e.g. '/departements/{value}/communes') */
384
+ apiUrl: string;
385
+ /** Field in API response to display */
386
+ labelField: string;
387
+ /** Field in API response for value */
388
+ valueField: string;
389
+ /** Extra query parameters */
390
+ extraParams?: Record<string, string>;
391
+ };
392
+ /** Whether this field is supported by the target API/dataset */
393
+ fieldStatus?: 'required' | 'optional' | 'unsupported' | 'unknown';
394
+ /** Human-readable explanation of the status */
395
+ statusReason?: string;
396
+ checkboxLabel?: string;
397
+ rows?: number;
398
+ showWhen?: ShowWhenCondition;
399
+ }
400
+ /**
401
+ * Form component parameters
402
+ */
403
+ export interface FormComponentParams {
404
+ title?: string;
405
+ fields: FormFieldParams[];
406
+ submitLabel?: string;
407
+ showReset?: boolean;
408
+ submitAction?: {
409
+ toolName: string;
410
+ params?: Record<string, any>;
411
+ };
412
+ /**
413
+ * Unique key for persisting form data to localStorage (Sprint 4)
414
+ */
415
+ persistKey?: string;
416
+ /**
417
+ * Fields to exclude from persistence (e.g., passwords) (Sprint 4)
418
+ */
419
+ excludeFromPersistence?: string[];
420
+ /**
421
+ * Expiry time in milliseconds for persisted data (Sprint 4)
422
+ */
423
+ persistExpiresIn?: number;
424
+ layout?: 'vertical' | 'horizontal' | 'inline';
425
+ /**
426
+ * Custom CSS class (Sprint 7)
427
+ */
428
+ className?: string;
429
+ /**
430
+ * Auto-submit countdown in ms when all required fields are prefilled (v4.2.0).
431
+ * Shows a countdown with cancel button. Stops if user interacts.
432
+ */
433
+ autoSubmitDelay?: number;
434
+ }
435
+ /**
436
+ * Modal size options
437
+ */
438
+ export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
439
+ /**
440
+ * Modal component parameters (Sprint 3)
441
+ */
442
+ export interface ModalComponentParams {
443
+ /**
444
+ * Modal title displayed in header
445
+ */
446
+ title?: string;
447
+ /**
448
+ * Modal size (default: 'md')
449
+ */
450
+ size?: ModalSize;
451
+ /**
452
+ * Show close button in header (default: true)
453
+ */
454
+ showClose?: boolean;
455
+ /**
456
+ * Close on Escape key (default: true)
457
+ */
458
+ closeOnEscape?: boolean;
459
+ /**
460
+ * Close on backdrop click (default: true)
461
+ */
462
+ closeOnBackdrop?: boolean;
463
+ /**
464
+ * Max height for content area (CSS value)
465
+ */
466
+ maxHeight?: string;
467
+ /**
468
+ * Content component to render inside modal
469
+ */
470
+ content?: UIComponent;
471
+ /**
472
+ * Footer component (typically action buttons)
473
+ */
474
+ footer?: UIComponent;
475
+ /**
476
+ * Trigger component that opens the modal
477
+ */
478
+ trigger?: UIComponent;
479
+ /**
480
+ * Custom CSS class (Sprint 7)
481
+ */
482
+ className?: string;
483
+ }
484
+ /**
485
+ * Action group layout options
486
+ */
487
+ export type ActionGroupLayout = 'horizontal' | 'vertical' | 'space-between' | 'end' | 'center';
488
+ /**
489
+ * Action group gap options
490
+ */
491
+ export type ActionGroupGap = 'none' | 'sm' | 'md' | 'lg';
492
+ /**
493
+ * Action group parameters (Sprint 3)
494
+ */
495
+ export interface ActionGroupParams {
496
+ /**
497
+ * Array of action configurations
498
+ */
499
+ actions: ActionComponentParams[];
500
+ /**
501
+ * Layout direction (default: 'horizontal')
502
+ */
503
+ layout?: ActionGroupLayout;
504
+ /**
505
+ * Gap between actions (default: 'md')
506
+ */
507
+ gap?: ActionGroupGap;
508
+ /**
509
+ * Make actions fill full width
510
+ */
511
+ fullWidth?: boolean;
512
+ /**
513
+ * Accessible label for the group
514
+ */
515
+ label?: string;
516
+ /**
517
+ * Custom CSS class (Sprint 7)
518
+ */
519
+ className?: string;
520
+ }
521
+ /**
522
+ * Single image in gallery (Sprint 5)
523
+ */
524
+ export interface GalleryImage {
525
+ /**
526
+ * Full-size image URL
527
+ */
528
+ url: string;
529
+ /**
530
+ * Optional thumbnail URL (smaller version for grid)
531
+ */
532
+ thumbnail?: string;
533
+ /**
534
+ * Alt text for accessibility
535
+ */
536
+ alt?: string;
537
+ /**
538
+ * Image caption
539
+ */
540
+ caption?: string;
541
+ /**
542
+ * Responsive srcset
543
+ */
544
+ srcset?: string;
545
+ /**
546
+ * Responsive sizes
547
+ */
548
+ sizes?: string;
549
+ }
550
+ /**
551
+ * Image gallery component parameters (Sprint 5)
552
+ */
553
+ export interface ImageGalleryParams {
554
+ /**
555
+ * Gallery title
556
+ */
557
+ title?: string;
558
+ /**
559
+ * Array of images to display
560
+ */
561
+ images: GalleryImage[];
562
+ /**
563
+ * Number of columns (default: 3)
564
+ */
565
+ columns?: 2 | 3 | 4 | 5;
566
+ /**
567
+ * Gap between images
568
+ */
569
+ gap?: 'none' | 'sm' | 'md' | 'lg';
570
+ /**
571
+ * Aspect ratio for thumbnails
572
+ */
573
+ aspectRatio?: '1:1' | '16:9' | '4:3' | 'auto';
574
+ /**
575
+ * Enable lightbox on click (default: true)
576
+ */
577
+ lightbox?: boolean;
578
+ /**
579
+ * Show captions below thumbnails
580
+ */
581
+ showCaptions?: boolean;
582
+ /**
583
+ * Custom CSS class (Sprint 7)
584
+ */
585
+ className?: string;
586
+ }
587
+ /**
588
+ * Video component parameters (Sprint 5)
589
+ */
590
+ export interface VideoComponentParams {
591
+ /**
592
+ * Video URL (YouTube, Vimeo, or direct video file)
593
+ */
594
+ url: string;
595
+ /**
596
+ * Video title
597
+ */
598
+ title?: string;
599
+ /**
600
+ * Video caption/description
601
+ */
602
+ caption?: string;
603
+ /**
604
+ * Poster image URL (thumbnail before play)
605
+ */
606
+ poster?: string;
607
+ /**
608
+ * Aspect ratio (default: '16:9')
609
+ */
610
+ aspectRatio?: '16:9' | '4:3' | '1:1' | '21:9';
611
+ /**
612
+ * Auto-play video (requires muted for most browsers)
613
+ */
614
+ autoplay?: boolean;
615
+ /**
616
+ * Show video controls (default: true)
617
+ */
618
+ controls?: boolean;
619
+ /**
620
+ * Loop video playback
621
+ */
622
+ loop?: boolean;
623
+ /**
624
+ * Mute video (required for autoplay)
625
+ */
626
+ muted?: boolean;
627
+ /**
628
+ * Start time in seconds (YouTube only)
629
+ */
630
+ startTime?: number;
631
+ /**
632
+ * Custom CSS class (Sprint 7)
633
+ */
634
+ className?: string;
635
+ }
636
+ /**
637
+ * Code component parameters (Sprint 6)
638
+ */
639
+ export interface CodeComponentParams {
640
+ /**
641
+ * Code content
642
+ */
643
+ code: string;
644
+ /**
645
+ * Language (e.g., 'typescript', 'python', 'json')
646
+ */
647
+ language?: string;
648
+ /**
649
+ * Filename or title
650
+ */
651
+ filename?: string;
652
+ /**
653
+ * Show line numbers (default: true)
654
+ */
655
+ showLineNumbers?: boolean;
656
+ /**
657
+ * Starting line number (default: 1)
658
+ */
659
+ startLine?: number;
660
+ /**
661
+ * Lines to highlight (1-indexed)
662
+ */
663
+ highlightLines?: number[];
664
+ /**
665
+ * Max height for code block (CSS value)
666
+ */
667
+ maxHeight?: string;
668
+ /**
669
+ * Color theme
670
+ */
671
+ theme?: 'light' | 'dark';
672
+ /**
673
+ * Custom CSS class (Sprint 7)
674
+ */
675
+ className?: string;
676
+ }
677
+ /**
678
+ * Map marker definition (Sprint 6)
679
+ */
680
+ export interface MapMarker {
681
+ /**
682
+ * Position as a [latitude, longitude] tuple or { lat, lng } object
683
+ */
684
+ position: LatLngPoint;
685
+ /**
686
+ * Tooltip text (shown on hover)
687
+ */
688
+ tooltip?: string;
689
+ /**
690
+ * Popup content (shown on click)
691
+ */
692
+ popup?: string;
693
+ }
694
+ /**
695
+ * Map clustering options (Sprint Ultimate U.2)
696
+ */
697
+ export interface MapClusterOptions {
698
+ /**
699
+ * Maximum cluster radius in pixels (default: 80)
700
+ */
701
+ maxClusterRadius?: number;
702
+ /**
703
+ * Spiderfy clusters at max zoom (default: true)
704
+ */
705
+ spiderfyOnMaxZoom?: boolean;
706
+ /**
707
+ * Show coverage polygon on hover (default: true)
708
+ */
709
+ showCoverageOnHover?: boolean;
710
+ /**
711
+ * Disable clustering at this zoom level
712
+ */
713
+ disableClusteringAtZoom?: number;
714
+ /**
715
+ * Animation duration in ms (default: 200)
716
+ */
717
+ animateAddingMarkers?: boolean;
718
+ }
719
+ /**
720
+ * GeoJSON feature popup configuration (v3.1.0)
721
+ */
722
+ export interface MapPopupConfig {
723
+ /** Property key used as popup title */
724
+ titleField?: string;
725
+ /** Property keys to display in popup body */
726
+ fields?: string[];
727
+ /** Custom HTML template (use {{property}} placeholders) */
728
+ template?: string;
729
+ }
730
+ /**
731
+ * GeoJSON style configuration (v3.1.0)
732
+ * Supports static styles and choropleth (data-driven) coloring.
733
+ */
734
+ export interface MapGeoJSONStyle {
735
+ /** Fill color (CSS color or choropleth config) */
736
+ fillColor?: string;
737
+ /** Fill opacity (0-1, default: 0.6) */
738
+ fillOpacity?: number;
739
+ /** Stroke color (default: '#333') */
740
+ strokeColor?: string;
741
+ /** Stroke width (default: 1) */
742
+ strokeWeight?: number;
743
+ /** Stroke opacity (0-1, default: 1) */
744
+ strokeOpacity?: number;
745
+ /** Choropleth: property key for data-driven coloring */
746
+ choroplethField?: string;
747
+ /** Choropleth: color scale stops [value, color][] sorted ascending */
748
+ choroplethScale?: Array<[number, string]>;
749
+ /** Choropleth: color for features with missing/null values */
750
+ choroplethFallback?: string;
751
+ }
752
+ /**
753
+ * Named GeoJSON layer for multi-layer maps (v3.1.0)
754
+ */
755
+ export interface MapLayer {
756
+ /** Layer name (shown in layer control) */
757
+ name: string;
758
+ /** Is this layer visible by default? */
759
+ visible?: boolean;
760
+ /** GeoJSON FeatureCollection (inline or from API) */
761
+ geojson: unknown;
762
+ /** Per-layer style override */
763
+ style?: MapGeoJSONStyle;
764
+ /** Per-layer popup config */
765
+ popup?: MapPopupConfig;
766
+ }
767
+ /**
768
+ * Map component parameters (Sprint 6)
769
+ * Updated v3.1.0: GeoJSON, choropleth, popups, layers
770
+ */
771
+ export interface MapComponentParams {
772
+ /**
773
+ * Initial center as [lat, lng] or { lat, lng }
774
+ */
775
+ center?: LatLngPoint;
776
+ /**
777
+ * Initial zoom level (default: 13)
778
+ */
779
+ zoom?: number;
780
+ /**
781
+ * Array of markers to display
782
+ */
783
+ markers?: MapMarker[];
784
+ /**
785
+ * Map height (CSS value, default: '400px')
786
+ */
787
+ height?: string;
788
+ /**
789
+ * Auto-fit bounds to show all markers/features (default: false)
790
+ */
791
+ fitBounds?: boolean;
792
+ /**
793
+ * Show zoom controls (default: true)
794
+ */
795
+ zoomControl?: boolean;
796
+ /**
797
+ * Allow scroll wheel zoom (default: true)
798
+ */
799
+ scrollWheelZoom?: boolean;
800
+ /**
801
+ * Custom tile layer URL (default: OpenStreetMap)
802
+ */
803
+ tileLayer?: string;
804
+ /**
805
+ * Attribution text (set to empty string to hide)
806
+ */
807
+ attribution?: string;
808
+ /**
809
+ * Enable marker clustering (Sprint Ultimate U.2)
810
+ */
811
+ clustering?: boolean | MapClusterOptions;
812
+ /**
813
+ * Custom CSS class (Sprint 7)
814
+ */
815
+ className?: string;
816
+ /**
817
+ * GeoJSON FeatureCollection to render on the map.
818
+ * Use this for polygons, lines, points from structured data.
819
+ */
820
+ geojson?: unknown;
821
+ /**
822
+ * Style for the GeoJSON layer.
823
+ * Supports static colors and choropleth (data-driven) coloring.
824
+ */
825
+ geojsonStyle?: MapGeoJSONStyle;
826
+ /**
827
+ * Popup configuration for GeoJSON features.
828
+ * Shown on feature click.
829
+ */
830
+ popup?: MapPopupConfig;
831
+ /**
832
+ * Named layers for multi-layer maps.
833
+ * Each layer has its own GeoJSON, style, and popup config.
834
+ * A Leaflet layer control is added when layers are present.
835
+ */
836
+ layers?: MapLayer[];
837
+ /**
838
+ * PMTiles vector tile source for large datasets (>5000 features).
839
+ * Requires protomaps-leaflet peer dependency.
840
+ * Pipeline: GeoParquet -> Tippecanoe -> PMTiles (static file on S3/CDN).
841
+ */
842
+ pmtiles?: MapPMTilesConfig;
843
+ }
844
+ /**
845
+ * PMTiles configuration for large vector tile datasets (v3.1.0)
846
+ */
847
+ export interface MapPMTilesConfig {
848
+ /** URL to the .pmtiles file (S3, CDN, local) */
849
+ url: string;
850
+ /** Attribution text for this tile source */
851
+ attribution?: string;
852
+ /** Style rules for vector features */
853
+ paintRules?: Array<{
854
+ /** Layer name in the PMTiles source */
855
+ dataLayer: string;
856
+ /** Symbol type */
857
+ symbolizer: 'polygon' | 'line' | 'circle';
858
+ /** Fill/stroke color (CSS color or function name) */
859
+ color?: string;
860
+ /** Stroke width */
861
+ width?: number;
862
+ /** Fill opacity */
863
+ opacity?: number;
864
+ }>;
865
+ /** Label rules for text labels */
866
+ labelRules?: Array<{
867
+ dataLayer: string;
868
+ /** Property key for label text */
869
+ textField: string;
870
+ /** Font size */
871
+ fontSize?: number;
872
+ }>;
873
+ /** Max zoom level */
874
+ maxZoom?: number;
875
+ /** Min zoom level */
876
+ minZoom?: number;
877
+ }
878
+ /**
879
+ * Node-link graph params (v6.13.0 — audit follow-up to P1.4/P1.5).
880
+ *
881
+ * Mirrors `GraphComponentParamsSchema` in `@seed-ship/mcp-ui-spec`. The
882
+ * `<GraphRenderer>` reads these loosely (and the spec schema accepts
883
+ * passthrough node/edge props), so an index signature keeps the type
884
+ * permissive — matching the runtime behaviour without over-constraining.
885
+ */
886
+ export interface GraphNode {
887
+ /** Stable node id — referenced by edges. */
888
+ id: string;
889
+ label?: string;
890
+ type?: string;
891
+ size?: number | [number, number];
892
+ style?: Record<string, unknown>;
893
+ data?: Record<string, unknown>;
894
+ /** @deprecated Compatibility field outside the canonical graph spec. */
895
+ group?: string;
896
+ /** Generic ranking/importance signal (opaque to the lib). */
897
+ weight?: number;
898
+ /** Passthrough G6 node props (type, size, style, data, …). */
899
+ [key: string]: unknown;
900
+ }
901
+ export interface GraphEdge {
902
+ /** Must match a `GraphNode.id`. */
903
+ source: string;
904
+ /** Must match a `GraphNode.id`. */
905
+ target: string;
906
+ label?: string;
907
+ type?: string;
908
+ weight?: number;
909
+ style?: Record<string, unknown>;
910
+ data?: Record<string, unknown>;
911
+ /** Passthrough G6 edge props (style, data, …). */
912
+ [key: string]: unknown;
913
+ }
914
+ /** Canonical layout names shared with `GraphLayoutNameSchema`. */
915
+ export type GraphLayoutName = 'force' | 'dagre' | 'mindmap' | 'tree' | 'circular' | 'grid' | 'concentric';
916
+ export type GraphLayout = GraphLayoutName | {
917
+ type: GraphLayoutName;
918
+ options?: Record<string, unknown>;
919
+ }
920
+ /** @deprecated `radial` predates the public spec; retained for source compatibility. */
921
+ | 'radial';
922
+ /**
923
+ * Generic node-link graph component params. Domain-neutral by design — the
924
+ * meaning of `weight`/`group` is decided by the consumer.
925
+ */
926
+ export interface GraphComponentParams {
927
+ title?: string;
928
+ /** Nodes (at least one expected at runtime). */
929
+ nodes: GraphNode[];
930
+ edges?: GraphEdge[];
931
+ layout?: GraphLayout;
932
+ /** @deprecated Accepted for source compatibility but not used by the renderer. */
933
+ directed?: boolean;
934
+ /**
935
+ * Rendering hint only — NOT wired; the renderer always uses the G6 canvas
936
+ * default (cf. audit P0). Kept for forward-compat with the spec.
937
+ */
938
+ rendererPref?: 'canvas' | 'svg';
939
+ /** CSS length in the canonical spec; numeric values remain for source compatibility. */
940
+ height?: string | number;
941
+ /** CSS length in the canonical spec; numeric values remain for source compatibility. */
942
+ width?: string | number;
943
+ fitView?: boolean;
944
+ enableZoom?: boolean;
945
+ enableDrag?: boolean;
946
+ enableSelect?: boolean;
947
+ tooltip?: boolean;
948
+ /** Custom CSS class. */
949
+ className?: string;
950
+ /** Passthrough for forward-compat graph options. */
951
+ [key: string]: unknown;
952
+ }
953
+ /**
954
+ * Grid component parameters (Phase 5.0)
955
+ * Enables nested CSS Grid layouts for template builder
956
+ */
957
+ export interface GridComponentParams {
958
+ /**
959
+ * Number of columns (default: 12)
960
+ */
961
+ columns?: number;
962
+ /**
963
+ * Gap between grid items (default: '1rem')
964
+ */
965
+ gap?: string;
966
+ /**
967
+ * Minimum row height (optional)
968
+ */
969
+ minRowHeight?: string;
970
+ /**
971
+ * CSS Grid template areas for named regions
972
+ * Example: [['header', 'header'], ['sidebar', 'main'], ['footer', 'footer']]
973
+ */
974
+ areas?: string[][];
975
+ /**
976
+ * Child components to render within the grid
977
+ */
978
+ children: UIComponent[];
979
+ /**
980
+ * Custom CSS class (Sprint 7)
981
+ */
982
+ className?: string;
983
+ }
984
+ /**
985
+ * UI Component definition (generated by LLM)
986
+ */
987
+ export interface UIComponent {
988
+ /**
989
+ * Unique component ID
990
+ */
991
+ id: string;
992
+ /**
993
+ * Component type
994
+ */
995
+ type: ComponentType;
996
+ /**
997
+ * Grid position
998
+ */
999
+ position: GridPosition;
1000
+ /**
1001
+ * Component parameters (type-specific)
1002
+ */
1003
+ params: ChartComponentParams | TableComponentParams | MetricComponentParams | TextComponentParams | ActionComponentParams | GridComponentParams | FormComponentParams | ModalComponentParams | ActionGroupParams | ImageGalleryParams | VideoComponentParams | CodeComponentParams | MapComponentParams | GraphComponentParams;
1004
+ /**
1005
+ * Metadata for observability
1006
+ */
1007
+ metadata?: {
1008
+ generatedAt: string;
1009
+ llmModel?: string;
1010
+ confidence?: number;
1011
+ toolsUsed?: string[];
1012
+ };
1013
+ }
1014
+ /**
1015
+ * UI Layout (collection of components)
1016
+ */
1017
+ export interface UILayout {
1018
+ /**
1019
+ * Layout ID
1020
+ */
1021
+ id: string;
1022
+ /**
1023
+ * Components in the layout
1024
+ */
1025
+ components: UIComponent[];
1026
+ /**
1027
+ * Grid configuration
1028
+ */
1029
+ grid: {
1030
+ columns: number;
1031
+ gap: string;
1032
+ minRowHeight?: string;
1033
+ };
1034
+ /**
1035
+ * Layout metadata
1036
+ */
1037
+ metadata?: {
1038
+ query: string;
1039
+ generatedAt: string;
1040
+ llmModel?: string;
1041
+ totalComponents: number;
1042
+ /**
1043
+ * Execution time in milliseconds (Phase 5.0)
1044
+ */
1045
+ executionTime?: number;
1046
+ /**
1047
+ * Number of sources used (Phase 5.0)
1048
+ */
1049
+ sourceCount?: number;
1050
+ /**
1051
+ * Hide auto-injected footer (Phase 5.0)
1052
+ */
1053
+ hideFooter?: boolean;
1054
+ };
1055
+ }
1056
+ /**
1057
+ * Component registry entry
1058
+ */
1059
+ export interface ComponentRegistryEntry {
1060
+ /**
1061
+ * Component type identifier
1062
+ */
1063
+ type: ComponentType;
1064
+ /**
1065
+ * Component name
1066
+ */
1067
+ name: string;
1068
+ /**
1069
+ * Component description (for LLM context)
1070
+ */
1071
+ description: string;
1072
+ /**
1073
+ * JSON schema for validation
1074
+ */
1075
+ schema: any;
1076
+ /**
1077
+ * Example usage (for LLM few-shot prompting)
1078
+ */
1079
+ examples: Array<{
1080
+ query: string;
1081
+ component: UIComponent;
1082
+ }>;
1083
+ /**
1084
+ * Resource limits
1085
+ */
1086
+ limits: ResourceLimits;
1087
+ }
1088
+ /**
1089
+ * Component validation result
1090
+ */
1091
+ export interface ValidationResult {
1092
+ valid: boolean;
1093
+ errors?: Array<{
1094
+ path: string;
1095
+ message: string;
1096
+ code: string;
1097
+ }>;
1098
+ }
1099
+ /**
1100
+ * Renderer error types
1101
+ */
1102
+ export type RendererErrorType = 'validation' | 'render' | 'timeout' | 'resource_limit' | 'network' | 'security';
1103
+ /**
1104
+ * Renderer error
1105
+ */
1106
+ export interface RendererError {
1107
+ type: RendererErrorType;
1108
+ message: string;
1109
+ componentId?: string;
1110
+ details?: any;
1111
+ }
1112
+ /**
1113
+ * Streaming event types (Phase 2)
1114
+ */
1115
+ export type StreamEventType = 'status' | 'component-start' | 'component' | 'component-complete' | 'error' | 'complete';
1116
+ /**
1117
+ * Streaming event (Phase 2)
1118
+ */
1119
+ export interface StreamEvent {
1120
+ event: StreamEventType;
1121
+ data: any;
1122
+ sequenceId?: number;
1123
+ timestamp: string;
1124
+ }
1125
+ /**
1126
+ * Action request (for lifecycle callbacks)
1127
+ */
1128
+ export interface ActionRequestBase {
1129
+ toolName: string;
1130
+ params?: Record<string, any>;
1131
+ }
1132
+ /**
1133
+ * Action result (for lifecycle callbacks)
1134
+ */
1135
+ export interface ActionResultBase {
1136
+ success: boolean;
1137
+ data?: any;
1138
+ error?: string;
1139
+ timestamp: string;
1140
+ toolName: string;
1141
+ }
1142
+ /**
1143
+ * Lifecycle callbacks for action execution
1144
+ */
1145
+ export interface ActionLifecycleCallbacks {
1146
+ /**
1147
+ * Called before action executes (can cancel by returning false)
1148
+ */
1149
+ onBefore?: (request: ActionRequestBase) => boolean | Promise<boolean>;
1150
+ /**
1151
+ * Called after successful action
1152
+ */
1153
+ onSuccess?: (result: ActionResultBase) => void;
1154
+ /**
1155
+ * Called after failed action
1156
+ */
1157
+ onError?: (error: string, request: ActionRequestBase) => void;
1158
+ /**
1159
+ * Called after action completes (success or failure)
1160
+ */
1161
+ onComplete?: (result: ActionResultBase) => void;
1162
+ }
1163
+ /**
1164
+ * Iframe validation policy
1165
+ * - 'strict': Only allow domains in the default whitelist
1166
+ * - 'extend': Allow default whitelist + custom domains
1167
+ * - 'allow-all': Skip domain validation entirely (use with caution)
1168
+ */
1169
+ export type IframePolicy = 'strict' | 'extend' | 'allow-all';
1170
+ /**
1171
+ * Validation options for component validation
1172
+ */
1173
+ export interface ValidationOptions {
1174
+ /**
1175
+ * Resource limits for component validation
1176
+ */
1177
+ limits?: ResourceLimits;
1178
+ /**
1179
+ * Iframe domain validation policy (default: 'strict')
1180
+ */
1181
+ iframePolicy?: IframePolicy;
1182
+ /**
1183
+ * Custom domains to allow when iframePolicy is 'extend'
1184
+ */
1185
+ customIframeDomains?: string[];
1186
+ }
1187
+ /**
1188
+ * Resize constraints for grid items
1189
+ */
1190
+ export interface ResizeConstraints {
1191
+ /**
1192
+ * Minimum column span (default: 1)
1193
+ */
1194
+ minColSpan?: number;
1195
+ /**
1196
+ * Maximum column span (default: 12)
1197
+ */
1198
+ maxColSpan?: number;
1199
+ /**
1200
+ * Minimum row span (default: 1)
1201
+ */
1202
+ minRowSpan?: number;
1203
+ /**
1204
+ * Maximum row span
1205
+ */
1206
+ maxRowSpan?: number;
1207
+ /**
1208
+ * Lock horizontal resizing
1209
+ */
1210
+ lockHorizontal?: boolean;
1211
+ /**
1212
+ * Lock vertical resizing
1213
+ */
1214
+ lockVertical?: boolean;
1215
+ }
1216
+ /**
1217
+ * Drag-Drop configuration for UIResourceRenderer
1218
+ */
1219
+ export interface DragDropConfig {
1220
+ /**
1221
+ * Enable drag-drop functionality (default: false)
1222
+ */
1223
+ enabled?: boolean;
1224
+ /**
1225
+ * Enable reordering via drag (default: true when enabled)
1226
+ */
1227
+ reorder?: boolean;
1228
+ /**
1229
+ * Enable resize handles (default: true when enabled)
1230
+ */
1231
+ resize?: boolean;
1232
+ /**
1233
+ * Resize constraints
1234
+ */
1235
+ constraints?: ResizeConstraints;
1236
+ /**
1237
+ * Callback when components are reordered
1238
+ */
1239
+ onReorder?: (components: UIComponent[]) => void;
1240
+ /**
1241
+ * Callback when a component is resized
1242
+ */
1243
+ onResize?: (componentId: string, newPosition: GridPosition) => void;
1244
+ /**
1245
+ * Callback when layout changes (reorder or resize)
1246
+ */
1247
+ onChange?: (layout: UILayout) => void;
1248
+ /**
1249
+ * Show grid lines during drag (default: true)
1250
+ */
1251
+ showGridLines?: boolean;
1252
+ /**
1253
+ * Animation duration in ms (default: 200)
1254
+ */
1255
+ animationDuration?: number;
1256
+ }
1257
+ /**
1258
+ * Drag event data for internal use
1259
+ */
1260
+ export interface DragEventData {
1261
+ /**
1262
+ * Component being dragged
1263
+ */
1264
+ componentId: string;
1265
+ /**
1266
+ * Original position
1267
+ */
1268
+ originalPosition: GridPosition;
1269
+ /**
1270
+ * Current drag position (in grid coordinates)
1271
+ */
1272
+ currentPosition?: GridPosition;
1273
+ /**
1274
+ * Drag type
1275
+ */
1276
+ type: 'reorder' | 'resize';
1277
+ /**
1278
+ * For resize: which edge is being dragged
1279
+ */
1280
+ resizeEdge?: 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
1281
+ }
1282
+ /**
1283
+ * Props for draggable grid items
1284
+ */
1285
+ export interface DraggableGridItemProps {
1286
+ /**
1287
+ * Component ID
1288
+ */
1289
+ id: string;
1290
+ /**
1291
+ * Grid position
1292
+ */
1293
+ position: GridPosition;
1294
+ /**
1295
+ * Enable dragging
1296
+ */
1297
+ draggable?: boolean;
1298
+ /**
1299
+ * Enable resize handles
1300
+ */
1301
+ resizable?: boolean;
1302
+ /**
1303
+ * Resize constraints
1304
+ */
1305
+ constraints?: ResizeConstraints;
1306
+ /**
1307
+ * Is this item currently being dragged
1308
+ */
1309
+ isDragging?: boolean;
1310
+ /**
1311
+ * Is this item a drop target
1312
+ */
1313
+ isDropTarget?: boolean;
1314
+ /**
1315
+ * Children to render
1316
+ */
1317
+ children?: any;
1318
+ /**
1319
+ * Custom class
1320
+ */
1321
+ class?: string;
1322
+ }
1323
+ /**
1324
+ * Autocomplete result type
1325
+ */
1326
+ export type AutocompleteResultType = 'completion' | 'options';
1327
+ /**
1328
+ * Single autocomplete option (for dropdown)
1329
+ */
1330
+ export interface AutocompleteOption {
1331
+ /**
1332
+ * Option value
1333
+ */
1334
+ value: string;
1335
+ /**
1336
+ * Display label (defaults to value)
1337
+ */
1338
+ label?: string;
1339
+ /**
1340
+ * Optional description
1341
+ */
1342
+ description?: string;
1343
+ /**
1344
+ * Optional icon
1345
+ */
1346
+ icon?: string;
1347
+ /**
1348
+ * Additional metadata from the source
1349
+ */
1350
+ metadata?: Record<string, any>;
1351
+ /**
1352
+ * Whether this option is disabled
1353
+ */
1354
+ disabled?: boolean;
1355
+ }
1356
+ /**
1357
+ * Result from autocomplete plugin
1358
+ */
1359
+ export interface AutocompleteResult {
1360
+ /**
1361
+ * Result type:
1362
+ * - 'completion': Ghost text (LLM-style)
1363
+ * - 'options': Dropdown options (data source)
1364
+ */
1365
+ type: AutocompleteResultType;
1366
+ /**
1367
+ * For type: 'completion' - the suggested text to complete
1368
+ */
1369
+ completion?: string;
1370
+ /**
1371
+ * For type: 'options' - list of suggestions
1372
+ */
1373
+ options?: AutocompleteOption[];
1374
+ /**
1375
+ * Plugin ID that generated this result
1376
+ */
1377
+ pluginId?: string;
1378
+ /**
1379
+ * Whether result is from cache
1380
+ */
1381
+ cached?: boolean;
1382
+ }
1383
+ /**
1384
+ * Context passed to autocomplete plugins
1385
+ */
1386
+ export interface AutocompleteContext {
1387
+ /**
1388
+ * Field name/identifier
1389
+ */
1390
+ fieldName: string;
1391
+ /**
1392
+ * Current form data (other fields)
1393
+ */
1394
+ formData?: Record<string, any>;
1395
+ /**
1396
+ * Cursor position in input
1397
+ */
1398
+ cursorPosition?: number;
1399
+ /**
1400
+ * Previous user inputs (for context)
1401
+ */
1402
+ history?: string[];
1403
+ /**
1404
+ * Custom context data
1405
+ */
1406
+ custom?: Record<string, any>;
1407
+ }
1408
+ /**
1409
+ * Plugin interface for autocomplete sources
1410
+ */
1411
+ export interface AutocompletePlugin {
1412
+ /**
1413
+ * Unique plugin identifier
1414
+ */
1415
+ id: string;
1416
+ /**
1417
+ * Human-readable name
1418
+ */
1419
+ name: string;
1420
+ /**
1421
+ * Configure the plugin
1422
+ */
1423
+ configure?: (config: Record<string, any>) => void;
1424
+ /**
1425
+ * Get suggestions for input
1426
+ */
1427
+ getSuggestions: (input: string, context?: AutocompleteContext) => Promise<AutocompleteResult>;
1428
+ /**
1429
+ * Cleanup resources
1430
+ */
1431
+ dispose?: () => void;
1432
+ /**
1433
+ * Whether plugin is ready
1434
+ */
1435
+ isReady?: () => boolean;
1436
+ }
1437
+ /**
1438
+ * Groq LLM plugin configuration
1439
+ */
1440
+ export interface GroqPluginConfig {
1441
+ /**
1442
+ * Groq API key (VITE_GROQ_API_KEY)
1443
+ */
1444
+ apiKey: string;
1445
+ /**
1446
+ * Model to use (default: 'mixtral-8x7b-32768')
1447
+ */
1448
+ model?: string;
1449
+ /**
1450
+ * System prompt for completion
1451
+ */
1452
+ systemPrompt?: string;
1453
+ /**
1454
+ * Max tokens to generate (default: 50)
1455
+ */
1456
+ maxTokens?: number;
1457
+ /**
1458
+ * Temperature (default: 0.3)
1459
+ */
1460
+ temperature?: number;
1461
+ }
1462
+ /**
1463
+ * Supabase plugin configuration
1464
+ */
1465
+ export interface SupabasePluginConfig {
1466
+ /**
1467
+ * Supabase project URL
1468
+ */
1469
+ url: string;
1470
+ /**
1471
+ * Supabase anonymous key
1472
+ */
1473
+ anonKey: string;
1474
+ /**
1475
+ * Table to search
1476
+ */
1477
+ table: string;
1478
+ /**
1479
+ * Column to return as value
1480
+ */
1481
+ column: string;
1482
+ /**
1483
+ * Column to search (defaults to column)
1484
+ */
1485
+ searchColumn?: string;
1486
+ /**
1487
+ * Label column (defaults to column)
1488
+ */
1489
+ labelColumn?: string;
1490
+ /**
1491
+ * Max results (default: 10)
1492
+ */
1493
+ limit?: number;
1494
+ /**
1495
+ * Filter expression
1496
+ */
1497
+ filter?: Record<string, any>;
1498
+ }
1499
+ /**
1500
+ * DuckDB WASM plugin configuration
1501
+ */
1502
+ export interface DuckDBPluginConfig {
1503
+ /**
1504
+ * SQL query with :search placeholder
1505
+ * Example: "SELECT name FROM cities WHERE name ILIKE :search || '%' LIMIT 10"
1506
+ */
1507
+ query: string;
1508
+ /**
1509
+ * Optional data to load into DuckDB
1510
+ */
1511
+ data?: {
1512
+ tableName: string;
1513
+ source: string | ArrayBuffer | File;
1514
+ format?: 'csv' | 'json' | 'parquet';
1515
+ };
1516
+ }
1517
+ /**
1518
+ * Generic REST API plugin configuration
1519
+ */
1520
+ export interface RestPluginConfig {
1521
+ /**
1522
+ * API endpoint with {search} placeholder
1523
+ * Example: '/api/search?q={search}'
1524
+ */
1525
+ endpoint: string;
1526
+ /**
1527
+ * HTTP method (default: 'GET')
1528
+ */
1529
+ method?: 'GET' | 'POST';
1530
+ /**
1531
+ * Request headers
1532
+ */
1533
+ headers?: Record<string, string>;
1534
+ /**
1535
+ * For POST: body template with {search} placeholder
1536
+ */
1537
+ bodyTemplate?: string;
1538
+ /**
1539
+ * Transform response to options
1540
+ */
1541
+ transform?: (response: any) => AutocompleteOption[];
1542
+ /**
1543
+ * Path to results array in response (e.g., 'data.results')
1544
+ */
1545
+ resultPath?: string;
1546
+ /**
1547
+ * Field name for value (default: 'value' or 'id')
1548
+ */
1549
+ valueField?: string;
1550
+ /**
1551
+ * Field name for label (default: 'label' or 'name')
1552
+ */
1553
+ labelField?: string;
1554
+ }
1555
+ /**
1556
+ * Field-level autocomplete configuration
1557
+ */
1558
+ export interface FieldAutocompleteConfig {
1559
+ /**
1560
+ * Enable autocomplete for this field
1561
+ */
1562
+ enabled: boolean;
1563
+ /**
1564
+ * Plugin ID to use (defaults to provider default)
1565
+ */
1566
+ plugin?: string;
1567
+ /**
1568
+ * Plugin-specific configuration
1569
+ */
1570
+ config?: Record<string, any>;
1571
+ /**
1572
+ * Other form fields to include as context
1573
+ */
1574
+ contextFields?: string[];
1575
+ /**
1576
+ * Minimum characters before triggering (default: 1)
1577
+ */
1578
+ minChars?: number;
1579
+ /**
1580
+ * Debounce delay in ms (default: 150)
1581
+ */
1582
+ debounceMs?: number;
1583
+ /**
1584
+ * Custom placeholder when loading
1585
+ */
1586
+ loadingPlaceholder?: string;
1587
+ }
1588
+ /**
1589
+ * Autocomplete provider configuration
1590
+ */
1591
+ export interface AutocompleteProviderConfig {
1592
+ /**
1593
+ * Registered plugins
1594
+ */
1595
+ plugins: AutocompletePlugin[];
1596
+ /**
1597
+ * Default plugin ID
1598
+ */
1599
+ defaultPlugin?: string;
1600
+ /**
1601
+ * Global debounce delay (default: 150ms)
1602
+ */
1603
+ debounceMs?: number;
1604
+ /**
1605
+ * Global minimum characters (default: 1)
1606
+ */
1607
+ minChars?: number;
1608
+ /**
1609
+ * Cache TTL in ms (default: 60000)
1610
+ */
1611
+ cacheTtl?: number;
1612
+ /**
1613
+ * Enable caching (default: true)
1614
+ */
1615
+ cacheEnabled?: boolean;
1616
+ }