@miragon/mcp-toolkit-ui 0.10.1

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 (320) hide show
  1. package/README.md +36 -0
  2. package/dist/app/adapt-data-widget.d.ts +33 -0
  3. package/dist/app/adapt-data-widget.d.ts.map +1 -0
  4. package/dist/app/adapt-data-widget.js +35 -0
  5. package/dist/app/adapt-data-widget.js.map +1 -0
  6. package/dist/app/builder/CatalogueSheet.d.ts +13 -0
  7. package/dist/app/builder/CatalogueSheet.d.ts.map +1 -0
  8. package/dist/app/builder/CatalogueSheet.js +33 -0
  9. package/dist/app/builder/CatalogueSheet.js.map +1 -0
  10. package/dist/app/builder/PipelineStrip.d.ts +22 -0
  11. package/dist/app/builder/PipelineStrip.d.ts.map +1 -0
  12. package/dist/app/builder/PipelineStrip.js +31 -0
  13. package/dist/app/builder/PipelineStrip.js.map +1 -0
  14. package/dist/app/builder/PreviewPane.d.ts +13 -0
  15. package/dist/app/builder/PreviewPane.d.ts.map +1 -0
  16. package/dist/app/builder/PreviewPane.js +21 -0
  17. package/dist/app/builder/PreviewPane.js.map +1 -0
  18. package/dist/app/builder/SaveDialog.d.ts +14 -0
  19. package/dist/app/builder/SaveDialog.d.ts.map +1 -0
  20. package/dist/app/builder/SaveDialog.js +14 -0
  21. package/dist/app/builder/SaveDialog.js.map +1 -0
  22. package/dist/app/builder/Toolbar.d.ts +17 -0
  23. package/dist/app/builder/Toolbar.d.ts.map +1 -0
  24. package/dist/app/builder/Toolbar.js +15 -0
  25. package/dist/app/builder/Toolbar.js.map +1 -0
  26. package/dist/app/builder/Workspace.d.ts +28 -0
  27. package/dist/app/builder/Workspace.d.ts.map +1 -0
  28. package/dist/app/builder/Workspace.js +117 -0
  29. package/dist/app/builder/Workspace.js.map +1 -0
  30. package/dist/app/builder/builder-model.d.ts +86 -0
  31. package/dist/app/builder/builder-model.d.ts.map +1 -0
  32. package/dist/app/builder/builder-model.js +174 -0
  33. package/dist/app/builder/builder-model.js.map +1 -0
  34. package/dist/app/builder/builder-reducer.d.ts +71 -0
  35. package/dist/app/builder/builder-reducer.d.ts.map +1 -0
  36. package/dist/app/builder/builder-reducer.js +201 -0
  37. package/dist/app/builder/builder-reducer.js.map +1 -0
  38. package/dist/app/builder/labels.d.ts +78 -0
  39. package/dist/app/builder/labels.d.ts.map +1 -0
  40. package/dist/app/builder/labels.js +71 -0
  41. package/dist/app/builder/labels.js.map +1 -0
  42. package/dist/app/builder/status-chip.d.ts +10 -0
  43. package/dist/app/builder/status-chip.d.ts.map +1 -0
  44. package/dist/app/builder/status-chip.js +16 -0
  45. package/dist/app/builder/status-chip.js.map +1 -0
  46. package/dist/app/host-bridge.d.ts +211 -0
  47. package/dist/app/host-bridge.d.ts.map +1 -0
  48. package/dist/app/host-bridge.js +247 -0
  49. package/dist/app/host-bridge.js.map +1 -0
  50. package/dist/app/index.d.ts +16 -0
  51. package/dist/app/index.d.ts.map +1 -0
  52. package/dist/app/index.js +18 -0
  53. package/dist/app/index.js.map +1 -0
  54. package/dist/app/layout-builder.d.ts +48 -0
  55. package/dist/app/layout-builder.d.ts.map +1 -0
  56. package/dist/app/layout-builder.js +418 -0
  57. package/dist/app/layout-builder.js.map +1 -0
  58. package/dist/app/mcp-app-view.d.ts +43 -0
  59. package/dist/app/mcp-app-view.d.ts.map +1 -0
  60. package/dist/app/mcp-app-view.js +169 -0
  61. package/dist/app/mcp-app-view.js.map +1 -0
  62. package/dist/app/mcp-toolkit-app.d.ts +18 -0
  63. package/dist/app/mcp-toolkit-app.d.ts.map +1 -0
  64. package/dist/app/mcp-toolkit-app.js +22 -0
  65. package/dist/app/mcp-toolkit-app.js.map +1 -0
  66. package/dist/app/use-host-actions.d.ts +57 -0
  67. package/dist/app/use-host-actions.d.ts.map +1 -0
  68. package/dist/app/use-host-actions.js +42 -0
  69. package/dist/app/use-host-actions.js.map +1 -0
  70. package/dist/app/widget-fixture.d.ts +180 -0
  71. package/dist/app/widget-fixture.d.ts.map +1 -0
  72. package/dist/app/widget-fixture.js +273 -0
  73. package/dist/app/widget-fixture.js.map +1 -0
  74. package/dist/app/widget-props-sheet.d.ts +20 -0
  75. package/dist/app/widget-props-sheet.d.ts.map +1 -0
  76. package/dist/app/widget-props-sheet.js +87 -0
  77. package/dist/app/widget-props-sheet.js.map +1 -0
  78. package/dist/app/widget-renderer.d.ts +87 -0
  79. package/dist/app/widget-renderer.d.ts.map +1 -0
  80. package/dist/app/widget-renderer.js +105 -0
  81. package/dist/app/widget-renderer.js.map +1 -0
  82. package/dist/components/DrillButton.d.ts +22 -0
  83. package/dist/components/DrillButton.d.ts.map +1 -0
  84. package/dist/components/DrillButton.js +13 -0
  85. package/dist/components/DrillButton.js.map +1 -0
  86. package/dist/components/FilterBar.d.ts +28 -0
  87. package/dist/components/FilterBar.d.ts.map +1 -0
  88. package/dist/components/FilterBar.js +12 -0
  89. package/dist/components/FilterBar.js.map +1 -0
  90. package/dist/components/GridLayout.d.ts +26 -0
  91. package/dist/components/GridLayout.d.ts.map +1 -0
  92. package/dist/components/GridLayout.js +31 -0
  93. package/dist/components/GridLayout.js.map +1 -0
  94. package/dist/components/GroupCard.d.ts +21 -0
  95. package/dist/components/GroupCard.d.ts.map +1 -0
  96. package/dist/components/GroupCard.js +24 -0
  97. package/dist/components/GroupCard.js.map +1 -0
  98. package/dist/components/KpiGrid.d.ts +43 -0
  99. package/dist/components/KpiGrid.d.ts.map +1 -0
  100. package/dist/components/KpiGrid.js +35 -0
  101. package/dist/components/KpiGrid.js.map +1 -0
  102. package/dist/components/ListFooter.d.ts +22 -0
  103. package/dist/components/ListFooter.d.ts.map +1 -0
  104. package/dist/components/ListFooter.js +13 -0
  105. package/dist/components/ListFooter.js.map +1 -0
  106. package/dist/components/Pills.d.ts +25 -0
  107. package/dist/components/Pills.d.ts.map +1 -0
  108. package/dist/components/Pills.js +17 -0
  109. package/dist/components/Pills.js.map +1 -0
  110. package/dist/components/SectionHeading.d.ts +16 -0
  111. package/dist/components/SectionHeading.d.ts.map +1 -0
  112. package/dist/components/SectionHeading.js +10 -0
  113. package/dist/components/SectionHeading.js.map +1 -0
  114. package/dist/components/WidgetHeader.d.ts +21 -0
  115. package/dist/components/WidgetHeader.d.ts.map +1 -0
  116. package/dist/components/WidgetHeader.js +11 -0
  117. package/dist/components/WidgetHeader.js.map +1 -0
  118. package/dist/hooks/index.d.ts +11 -0
  119. package/dist/hooks/index.d.ts.map +1 -0
  120. package/dist/hooks/index.js +7 -0
  121. package/dist/hooks/index.js.map +1 -0
  122. package/dist/hooks/use-debounced-value.d.ts +7 -0
  123. package/dist/hooks/use-debounced-value.d.ts.map +1 -0
  124. package/dist/hooks/use-debounced-value.js +15 -0
  125. package/dist/hooks/use-debounced-value.js.map +1 -0
  126. package/dist/hooks/use-mobile.d.ts +6 -0
  127. package/dist/hooks/use-mobile.d.ts.map +1 -0
  128. package/dist/hooks/use-mobile.js +19 -0
  129. package/dist/hooks/use-mobile.js.map +1 -0
  130. package/dist/hooks/use-tool-query.d.ts +21 -0
  131. package/dist/hooks/use-tool-query.d.ts.map +1 -0
  132. package/dist/hooks/use-tool-query.js +47 -0
  133. package/dist/hooks/use-tool-query.js.map +1 -0
  134. package/dist/hooks/use-tool-result-recovery.d.ts +54 -0
  135. package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -0
  136. package/dist/hooks/use-tool-result-recovery.js +93 -0
  137. package/dist/hooks/use-tool-result-recovery.js.map +1 -0
  138. package/dist/hooks/use-view-data.d.ts +19 -0
  139. package/dist/hooks/use-view-data.d.ts.map +1 -0
  140. package/dist/hooks/use-view-data.js +18 -0
  141. package/dist/hooks/use-view-data.js.map +1 -0
  142. package/dist/hooks/use-view-tool-query.d.ts +18 -0
  143. package/dist/hooks/use-view-tool-query.d.ts.map +1 -0
  144. package/dist/hooks/use-view-tool-query.js +29 -0
  145. package/dist/hooks/use-view-tool-query.js.map +1 -0
  146. package/dist/index.d.ts +47 -0
  147. package/dist/index.d.ts.map +1 -0
  148. package/dist/index.js +56 -0
  149. package/dist/index.js.map +1 -0
  150. package/dist/lib/parse-tool-result.d.ts +39 -0
  151. package/dist/lib/parse-tool-result.d.ts.map +1 -0
  152. package/dist/lib/parse-tool-result.js +66 -0
  153. package/dist/lib/parse-tool-result.js.map +1 -0
  154. package/dist/lib/tone-utils.d.ts +18 -0
  155. package/dist/lib/tone-utils.d.ts.map +1 -0
  156. package/dist/lib/tone-utils.js +25 -0
  157. package/dist/lib/tone-utils.js.map +1 -0
  158. package/dist/lib/utils.d.ts +3 -0
  159. package/dist/lib/utils.d.ts.map +1 -0
  160. package/dist/lib/utils.js +6 -0
  161. package/dist/lib/utils.js.map +1 -0
  162. package/dist/locale/index.d.ts +3 -0
  163. package/dist/locale/index.d.ts.map +1 -0
  164. package/dist/locale/index.js +7 -0
  165. package/dist/locale/index.js.map +1 -0
  166. package/dist/locale/locale-provider.d.ts +50 -0
  167. package/dist/locale/locale-provider.d.ts.map +1 -0
  168. package/dist/locale/locale-provider.js +47 -0
  169. package/dist/locale/locale-provider.js.map +1 -0
  170. package/dist/primitives/alert.d.ts +10 -0
  171. package/dist/primitives/alert.d.ts.map +1 -0
  172. package/dist/primitives/alert.js +25 -0
  173. package/dist/primitives/alert.js.map +1 -0
  174. package/dist/primitives/badge.d.ts +8 -0
  175. package/dist/primitives/badge.d.ts.map +1 -0
  176. package/dist/primitives/badge.js +34 -0
  177. package/dist/primitives/badge.js.map +1 -0
  178. package/dist/primitives/button.d.ts +11 -0
  179. package/dist/primitives/button.d.ts.map +1 -0
  180. package/dist/primitives/button.js +36 -0
  181. package/dist/primitives/button.js.map +1 -0
  182. package/dist/primitives/card.d.ts +12 -0
  183. package/dist/primitives/card.d.ts.map +1 -0
  184. package/dist/primitives/card.js +25 -0
  185. package/dist/primitives/card.js.map +1 -0
  186. package/dist/primitives/dialog.d.ts +18 -0
  187. package/dist/primitives/dialog.d.ts.map +1 -0
  188. package/dist/primitives/dialog.js +38 -0
  189. package/dist/primitives/dialog.js.map +1 -0
  190. package/dist/primitives/input.d.ts +4 -0
  191. package/dist/primitives/input.d.ts.map +1 -0
  192. package/dist/primitives/input.js +7 -0
  193. package/dist/primitives/input.js.map +1 -0
  194. package/dist/primitives/scroll-area.d.ts +6 -0
  195. package/dist/primitives/scroll-area.d.ts.map +1 -0
  196. package/dist/primitives/scroll-area.js +11 -0
  197. package/dist/primitives/scroll-area.js.map +1 -0
  198. package/dist/primitives/select.d.ts +16 -0
  199. package/dist/primitives/select.d.ts.map +1 -0
  200. package/dist/primitives/select.js +38 -0
  201. package/dist/primitives/select.js.map +1 -0
  202. package/dist/primitives/separator.d.ts +4 -0
  203. package/dist/primitives/separator.d.ts.map +1 -0
  204. package/dist/primitives/separator.js +9 -0
  205. package/dist/primitives/separator.js.map +1 -0
  206. package/dist/primitives/sheet.d.ts +15 -0
  207. package/dist/primitives/sheet.d.ts.map +1 -0
  208. package/dist/primitives/sheet.js +41 -0
  209. package/dist/primitives/sheet.js.map +1 -0
  210. package/dist/primitives/skeleton.d.ts +3 -0
  211. package/dist/primitives/skeleton.d.ts.map +1 -0
  212. package/dist/primitives/skeleton.js +7 -0
  213. package/dist/primitives/skeleton.js.map +1 -0
  214. package/dist/primitives/switch.d.ts +5 -0
  215. package/dist/primitives/switch.d.ts.map +1 -0
  216. package/dist/primitives/switch.js +8 -0
  217. package/dist/primitives/switch.js.map +1 -0
  218. package/dist/primitives/table.d.ts +11 -0
  219. package/dist/primitives/table.d.ts.map +1 -0
  220. package/dist/primitives/table.js +28 -0
  221. package/dist/primitives/table.js.map +1 -0
  222. package/dist/primitives/tabs.d.ts +12 -0
  223. package/dist/primitives/tabs.d.ts.map +1 -0
  224. package/dist/primitives/tabs.js +29 -0
  225. package/dist/primitives/tabs.js.map +1 -0
  226. package/dist/providers/query-provider.d.ts +11 -0
  227. package/dist/providers/query-provider.d.ts.map +1 -0
  228. package/dist/providers/query-provider.js +20 -0
  229. package/dist/providers/query-provider.js.map +1 -0
  230. package/dist/theme/create-theme.d.ts +130 -0
  231. package/dist/theme/create-theme.d.ts.map +1 -0
  232. package/dist/theme/create-theme.js +65 -0
  233. package/dist/theme/create-theme.js.map +1 -0
  234. package/dist/theme/index.d.ts +7 -0
  235. package/dist/theme/index.d.ts.map +1 -0
  236. package/dist/theme/index.js +7 -0
  237. package/dist/theme/index.js.map +1 -0
  238. package/dist/theme/presets.d.ts +25 -0
  239. package/dist/theme/presets.d.ts.map +1 -0
  240. package/dist/theme/presets.js +68 -0
  241. package/dist/theme/presets.js.map +1 -0
  242. package/dist/theme/theme-provider.d.ts +69 -0
  243. package/dist/theme/theme-provider.d.ts.map +1 -0
  244. package/dist/theme/theme-provider.js +79 -0
  245. package/dist/theme/theme-provider.js.map +1 -0
  246. package/package.json +71 -0
  247. package/src/app/adapt-data-widget.tsx +51 -0
  248. package/src/app/builder/CatalogueSheet.tsx +230 -0
  249. package/src/app/builder/PipelineStrip.tsx +260 -0
  250. package/src/app/builder/PreviewPane.tsx +72 -0
  251. package/src/app/builder/SaveDialog.tsx +95 -0
  252. package/src/app/builder/Toolbar.tsx +95 -0
  253. package/src/app/builder/Workspace.tsx +483 -0
  254. package/src/app/builder/builder-model.test.ts +351 -0
  255. package/src/app/builder/builder-model.ts +213 -0
  256. package/src/app/builder/builder-reducer.test.ts +441 -0
  257. package/src/app/builder/builder-reducer.ts +289 -0
  258. package/src/app/builder/labels.ts +139 -0
  259. package/src/app/builder/status-chip.tsx +37 -0
  260. package/src/app/host-bridge.test.ts +206 -0
  261. package/src/app/host-bridge.tsx +371 -0
  262. package/src/app/index.ts +51 -0
  263. package/src/app/layout-builder.tsx +872 -0
  264. package/src/app/mcp-app-view.tsx +367 -0
  265. package/src/app/mcp-toolkit-app.tsx +25 -0
  266. package/src/app/use-host-actions.test.ts +16 -0
  267. package/src/app/use-host-actions.tsx +88 -0
  268. package/src/app/widget-fixture.test.ts +108 -0
  269. package/src/app/widget-fixture.tsx +441 -0
  270. package/src/app/widget-props-sheet.tsx +285 -0
  271. package/src/app/widget-renderer.test.ts +42 -0
  272. package/src/app/widget-renderer.tsx +200 -0
  273. package/src/components/DrillButton.tsx +37 -0
  274. package/src/components/FilterBar.tsx +68 -0
  275. package/src/components/GridLayout.tsx +49 -0
  276. package/src/components/GroupCard.tsx +52 -0
  277. package/src/components/KpiGrid.tsx +134 -0
  278. package/src/components/ListFooter.tsx +48 -0
  279. package/src/components/Pills.tsx +45 -0
  280. package/src/components/SectionHeading.tsx +26 -0
  281. package/src/components/WidgetHeader.tsx +51 -0
  282. package/src/globals.css +168 -0
  283. package/src/hooks/index.ts +17 -0
  284. package/src/hooks/use-debounced-value.ts +15 -0
  285. package/src/hooks/use-mobile.ts +24 -0
  286. package/src/hooks/use-tool-query.ts +63 -0
  287. package/src/hooks/use-tool-result-recovery.test.ts +65 -0
  288. package/src/hooks/use-tool-result-recovery.ts +144 -0
  289. package/src/hooks/use-view-data.ts +31 -0
  290. package/src/hooks/use-view-tool-query.ts +38 -0
  291. package/src/index.ts +134 -0
  292. package/src/lib/parse-tool-result.test.ts +139 -0
  293. package/src/lib/parse-tool-result.ts +89 -0
  294. package/src/lib/tone-utils.test.ts +35 -0
  295. package/src/lib/tone-utils.ts +38 -0
  296. package/src/lib/utils.ts +6 -0
  297. package/src/locale/index.ts +7 -0
  298. package/src/locale/locale-provider.tsx +81 -0
  299. package/src/primitives/alert.tsx +60 -0
  300. package/src/primitives/badge.tsx +49 -0
  301. package/src/primitives/button.tsx +62 -0
  302. package/src/primitives/card.tsx +92 -0
  303. package/src/primitives/dialog.tsx +144 -0
  304. package/src/primitives/input.tsx +21 -0
  305. package/src/primitives/scroll-area.tsx +54 -0
  306. package/src/primitives/select.tsx +173 -0
  307. package/src/primitives/separator.tsx +21 -0
  308. package/src/primitives/sheet.tsx +134 -0
  309. package/src/primitives/skeleton.tsx +13 -0
  310. package/src/primitives/switch.tsx +24 -0
  311. package/src/primitives/table.tsx +87 -0
  312. package/src/primitives/tabs.tsx +79 -0
  313. package/src/providers/query-provider.tsx +38 -0
  314. package/src/theme/create-theme.test.ts +108 -0
  315. package/src/theme/create-theme.ts +158 -0
  316. package/src/theme/index.ts +9 -0
  317. package/src/theme/presets.ts +82 -0
  318. package/src/theme/theme-provider.tsx +152 -0
  319. package/src/ui-catalog.test.ts +112 -0
  320. package/ui-catalog.json +1280 -0
@@ -0,0 +1,1280 @@
1
+ {
2
+ "$comment": "Machine-readable catalog of prompt-relevant @miragon/mcp-toolkit-ui building blocks. Hand-maintained, source of truth is packages/ui/src/. A Vitest drift-guard (src/ui-catalog.test.ts) asserts every `export` named here is actually exported from its `importPath` barrel, so this file cannot silently drift from the code. Consumed by the docs/reference/components.md page and the build-mcp-widget skill. Versioned by the @miragon/mcp-toolkit-ui tarball it ships in \u2014 it carries no version field of its own. `importPath` is one of: '@miragon/mcp-toolkit-ui' (root barrel, mcp-use/react-free), '@miragon/mcp-toolkit-ui/app' (MCP app shell, imports mcp-use/react), '@miragon/mcp-toolkit-ui/hooks' (view-tool hooks).",
3
+ "importPaths": {
4
+ "root": "@miragon/mcp-toolkit-ui",
5
+ "app": "@miragon/mcp-toolkit-ui/app",
6
+ "hooks": "@miragon/mcp-toolkit-ui/hooks"
7
+ },
8
+ "components": [
9
+ {
10
+ "name": "Card",
11
+ "export": "Card",
12
+ "importPath": "@miragon/mcp-toolkit-ui",
13
+ "kind": "primitive",
14
+ "group": "primitives",
15
+ "parts": [
16
+ "Card",
17
+ "CardHeader",
18
+ "CardFooter",
19
+ "CardTitle",
20
+ "CardAction",
21
+ "CardDescription",
22
+ "CardContent"
23
+ ],
24
+ "props": [
25
+ {
26
+ "name": "size",
27
+ "type": "\"default\" | \"sm\"",
28
+ "required": false,
29
+ "description": "Compact spacing when 'sm'. Default 'default'."
30
+ },
31
+ {
32
+ "name": "className",
33
+ "type": "string",
34
+ "required": false,
35
+ "description": "Merged onto the root div via cn()."
36
+ }
37
+ ],
38
+ "whenToUse": "The default container for any widget. Compose CardHeader/CardTitle/CardContent/CardFooter instead of building a bordered div by hand."
39
+ },
40
+ {
41
+ "name": "Badge",
42
+ "export": "Badge",
43
+ "importPath": "@miragon/mcp-toolkit-ui",
44
+ "kind": "primitive",
45
+ "group": "primitives",
46
+ "props": [
47
+ {
48
+ "name": "variant",
49
+ "type": "\"default\" | \"secondary\" | \"destructive\" | \"outline\" | \"ghost\" | \"link\"",
50
+ "required": false,
51
+ "description": "Visual style. Default 'default'."
52
+ },
53
+ {
54
+ "name": "className",
55
+ "type": "string",
56
+ "required": false,
57
+ "description": "Merged onto the badge."
58
+ }
59
+ ],
60
+ "whenToUse": "Inline status/label pill. For a tone-driven status dot or count, see LivePill/CountPill."
61
+ },
62
+ {
63
+ "name": "Button",
64
+ "export": "Button",
65
+ "importPath": "@miragon/mcp-toolkit-ui",
66
+ "kind": "primitive",
67
+ "group": "primitives",
68
+ "props": [
69
+ {
70
+ "name": "variant",
71
+ "type": "\"default\" | \"destructive\" | \"outline\" | \"secondary\" | \"ghost\" | \"link\"",
72
+ "required": false,
73
+ "description": "Visual style. Default 'default'."
74
+ },
75
+ {
76
+ "name": "size",
77
+ "type": "\"default\" | \"xs\" | \"sm\" | \"lg\" | \"icon\" | \"icon-xs\" | \"icon-sm\" | \"icon-lg\"",
78
+ "required": false,
79
+ "description": "Size token. Default 'default'."
80
+ },
81
+ {
82
+ "name": "asChild",
83
+ "type": "boolean",
84
+ "required": false,
85
+ "description": "Render the single child as the button (Radix Slot) instead of a <button>."
86
+ },
87
+ {
88
+ "name": "...buttonProps",
89
+ "type": "React.ComponentProps<\"button\">",
90
+ "required": false,
91
+ "description": "onClick, disabled, aria-*, etc."
92
+ }
93
+ ],
94
+ "whenToUse": "Any clickable action. Wire onClick to a host action (useHostBridge / useHostActions) or a mutation."
95
+ },
96
+ {
97
+ "name": "Input",
98
+ "export": "Input",
99
+ "importPath": "@miragon/mcp-toolkit-ui",
100
+ "kind": "primitive",
101
+ "group": "primitives",
102
+ "props": [
103
+ {
104
+ "name": "...inputProps",
105
+ "type": "React.ComponentProps<\"input\">",
106
+ "required": false,
107
+ "description": "value, onChange, placeholder, type, etc."
108
+ }
109
+ ],
110
+ "whenToUse": "Single-line text/number entry in interactive widgets."
111
+ },
112
+ {
113
+ "name": "Select",
114
+ "export": "Select",
115
+ "importPath": "@miragon/mcp-toolkit-ui",
116
+ "kind": "primitive",
117
+ "group": "primitives",
118
+ "parts": [
119
+ "Select",
120
+ "SelectTrigger",
121
+ "SelectValue",
122
+ "SelectContent",
123
+ "SelectItem",
124
+ "SelectGroup",
125
+ "SelectLabel",
126
+ "SelectSeparator"
127
+ ],
128
+ "props": [
129
+ {
130
+ "name": "value",
131
+ "type": "string",
132
+ "required": false,
133
+ "description": "Controlled value."
134
+ },
135
+ {
136
+ "name": "onValueChange",
137
+ "type": "(value: string) => void",
138
+ "required": false,
139
+ "description": "Selection callback."
140
+ }
141
+ ],
142
+ "whenToUse": "Pick one option from a list (e.g. a scope/period filter that drives a self-fetch)."
143
+ },
144
+ {
145
+ "name": "Switch",
146
+ "export": "Switch",
147
+ "importPath": "@miragon/mcp-toolkit-ui",
148
+ "kind": "primitive",
149
+ "group": "primitives",
150
+ "props": [
151
+ {
152
+ "name": "checked",
153
+ "type": "boolean",
154
+ "required": false,
155
+ "description": "Controlled on/off state."
156
+ },
157
+ {
158
+ "name": "onCheckedChange",
159
+ "type": "(checked: boolean) => void",
160
+ "required": false,
161
+ "description": "Toggle callback."
162
+ }
163
+ ],
164
+ "whenToUse": "Boolean toggle (e.g. include-resolved, live-refresh)."
165
+ },
166
+ {
167
+ "name": "Table",
168
+ "export": "Table",
169
+ "importPath": "@miragon/mcp-toolkit-ui",
170
+ "kind": "primitive",
171
+ "group": "primitives",
172
+ "parts": [
173
+ "Table",
174
+ "TableHeader",
175
+ "TableBody",
176
+ "TableFooter",
177
+ "TableRow",
178
+ "TableHead",
179
+ "TableCell",
180
+ "TableCaption"
181
+ ],
182
+ "props": [],
183
+ "whenToUse": "Tabular markup. Compose the parts for a list/array tool result; add a ListFooter for pagination."
184
+ },
185
+ {
186
+ "name": "Tabs",
187
+ "export": "Tabs",
188
+ "importPath": "@miragon/mcp-toolkit-ui",
189
+ "kind": "primitive",
190
+ "group": "primitives",
191
+ "parts": ["Tabs", "TabsList", "TabsTrigger", "TabsContent"],
192
+ "props": [
193
+ {
194
+ "name": "defaultValue",
195
+ "type": "string",
196
+ "required": false,
197
+ "description": "Initially active tab value."
198
+ },
199
+ {
200
+ "name": "value",
201
+ "type": "string",
202
+ "required": false,
203
+ "description": "Controlled active tab."
204
+ },
205
+ {
206
+ "name": "onValueChange",
207
+ "type": "(value: string) => void",
208
+ "required": false,
209
+ "description": "Active-tab callback."
210
+ }
211
+ ],
212
+ "whenToUse": "Split a busy widget into sections (e.g. one tab per process key). The WidgetRenderer also uses Tabs for tabbed layouts."
213
+ },
214
+ {
215
+ "name": "Dialog",
216
+ "export": "Dialog",
217
+ "importPath": "@miragon/mcp-toolkit-ui",
218
+ "kind": "primitive",
219
+ "group": "primitives",
220
+ "parts": [
221
+ "Dialog",
222
+ "DialogTrigger",
223
+ "DialogContent",
224
+ "DialogHeader",
225
+ "DialogTitle",
226
+ "DialogDescription",
227
+ "DialogFooter",
228
+ "DialogClose"
229
+ ],
230
+ "props": [
231
+ {
232
+ "name": "open",
233
+ "type": "boolean",
234
+ "required": false,
235
+ "description": "Controlled open state."
236
+ },
237
+ {
238
+ "name": "onOpenChange",
239
+ "type": "(open: boolean) => void",
240
+ "required": false,
241
+ "description": "Open-state callback."
242
+ }
243
+ ],
244
+ "whenToUse": "Confirm a destructive action or show detail in a modal."
245
+ },
246
+ {
247
+ "name": "Sheet",
248
+ "export": "Sheet",
249
+ "importPath": "@miragon/mcp-toolkit-ui",
250
+ "kind": "primitive",
251
+ "group": "primitives",
252
+ "parts": [
253
+ "Sheet",
254
+ "SheetTrigger",
255
+ "SheetContent",
256
+ "SheetHeader",
257
+ "SheetTitle",
258
+ "SheetDescription",
259
+ "SheetFooter",
260
+ "SheetClose"
261
+ ],
262
+ "props": [
263
+ {
264
+ "name": "open",
265
+ "type": "boolean",
266
+ "required": false,
267
+ "description": "Controlled open state."
268
+ },
269
+ {
270
+ "name": "onOpenChange",
271
+ "type": "(open: boolean) => void",
272
+ "required": false,
273
+ "description": "Open-state callback."
274
+ }
275
+ ],
276
+ "whenToUse": "Slide-in side panel for detail/edit without leaving the widget."
277
+ },
278
+ {
279
+ "name": "Alert",
280
+ "export": "Alert",
281
+ "importPath": "@miragon/mcp-toolkit-ui",
282
+ "kind": "primitive",
283
+ "group": "primitives",
284
+ "parts": ["Alert", "AlertTitle", "AlertDescription"],
285
+ "props": [
286
+ {
287
+ "name": "variant",
288
+ "type": "\"default\" | \"destructive\"",
289
+ "required": false,
290
+ "description": "Visual style."
291
+ }
292
+ ],
293
+ "whenToUse": "Inline notice or error message inside a widget body."
294
+ },
295
+ {
296
+ "name": "ScrollArea",
297
+ "export": "ScrollArea",
298
+ "importPath": "@miragon/mcp-toolkit-ui",
299
+ "kind": "primitive",
300
+ "group": "primitives",
301
+ "parts": ["ScrollArea", "ScrollBar"],
302
+ "props": [],
303
+ "whenToUse": "Constrain a long list to a fixed height with a styled scrollbar."
304
+ },
305
+ {
306
+ "name": "Skeleton",
307
+ "export": "Skeleton",
308
+ "importPath": "@miragon/mcp-toolkit-ui",
309
+ "kind": "primitive",
310
+ "group": "primitives",
311
+ "props": [
312
+ {
313
+ "name": "className",
314
+ "type": "string",
315
+ "required": false,
316
+ "description": "Size the placeholder (e.g. 'h-20 w-full')."
317
+ }
318
+ ],
319
+ "whenToUse": "Loading placeholder while a self-fetch is in flight \u2014 avoids layout shift on first paint."
320
+ },
321
+ {
322
+ "name": "Separator",
323
+ "export": "Separator",
324
+ "importPath": "@miragon/mcp-toolkit-ui",
325
+ "kind": "primitive",
326
+ "group": "primitives",
327
+ "props": [
328
+ {
329
+ "name": "orientation",
330
+ "type": "\"horizontal\" | \"vertical\"",
331
+ "required": false,
332
+ "description": "Default 'horizontal'."
333
+ }
334
+ ],
335
+ "whenToUse": "Visual divider between sections of a card."
336
+ },
337
+ {
338
+ "name": "GridLayout",
339
+ "export": "GridLayout",
340
+ "importPath": "@miragon/mcp-toolkit-ui",
341
+ "kind": "component",
342
+ "group": "composed",
343
+ "parts": ["GridLayout", "GridItem"],
344
+ "props": [
345
+ {
346
+ "name": "children",
347
+ "type": "ReactNode",
348
+ "required": true,
349
+ "description": "GridItem children."
350
+ },
351
+ {
352
+ "name": "className",
353
+ "type": "string",
354
+ "required": false,
355
+ "description": "Merged onto the grid container (e.g. to change the gap)."
356
+ }
357
+ ],
358
+ "whenToUse": "Lay out KPI tiles / sub-cards in a 12-column responsive grid. Wrap each cell in <GridItem span={n}>. Same grid WidgetRenderer uses internally."
359
+ },
360
+ {
361
+ "name": "GridItem",
362
+ "export": "GridItem",
363
+ "importPath": "@miragon/mcp-toolkit-ui",
364
+ "kind": "component",
365
+ "group": "composed",
366
+ "props": [
367
+ {
368
+ "name": "span",
369
+ "type": "number",
370
+ "required": false,
371
+ "description": "Column span 1\u201312. Default 12 (full width); out-of-range falls back to full width."
372
+ },
373
+ {
374
+ "name": "children",
375
+ "type": "ReactNode",
376
+ "required": true,
377
+ "description": "Cell content."
378
+ },
379
+ {
380
+ "name": "className",
381
+ "type": "string",
382
+ "required": false,
383
+ "description": "Merged onto the cell."
384
+ }
385
+ ],
386
+ "whenToUse": "A cell inside GridLayout. e.g. <GridItem span={4}> for a one-third-width tile."
387
+ },
388
+ {
389
+ "name": "KpiGrid",
390
+ "export": "KpiGrid",
391
+ "importPath": "@miragon/mcp-toolkit-ui",
392
+ "kind": "component",
393
+ "group": "composed",
394
+ "props": [
395
+ {
396
+ "name": "cells",
397
+ "type": "KpiCell[]",
398
+ "required": true,
399
+ "description": "Metric cells flowed as columns (1\u20136, clamped). Each: { label, value, fraction?, trend?, trendDirection?, tone?, onClick?, ariaLabel? }. A cell with onClick renders as a button (drill into a detail view)."
400
+ },
401
+ {
402
+ "name": "boxed",
403
+ "type": "boolean",
404
+ "required": false,
405
+ "description": "Wrap the strip in a bordered card with an optional header. Default false (lighter border-y strip)."
406
+ },
407
+ {
408
+ "name": "header",
409
+ "type": "KpiGridHeader",
410
+ "required": false,
411
+ "description": "Group header shown above the strip when boxed: { label, badge? }."
412
+ }
413
+ ],
414
+ "whenToUse": "Show a row of headline metrics in a widget (replaces the old single-metric KPICard). Pre-format values for locale/currency. Set a cell tone for emphasis (e.g. 'danger') and onClick to make a metric a drill target."
415
+ },
416
+ {
417
+ "name": "LivePill",
418
+ "export": "LivePill",
419
+ "importPath": "@miragon/mcp-toolkit-ui",
420
+ "kind": "component",
421
+ "group": "composed",
422
+ "props": [
423
+ {
424
+ "name": "tone",
425
+ "type": "ToneVariant",
426
+ "required": false,
427
+ "description": "Status tone driving the dot + tint ('neutral'|'info'|'success'|'warning'|'danger'). Default 'info'."
428
+ },
429
+ {
430
+ "name": "children",
431
+ "type": "ReactNode",
432
+ "required": false,
433
+ "description": "Pill label. Defaults to 'Live'."
434
+ }
435
+ ],
436
+ "whenToUse": "Signal live/real-time data in a widget header \u2014 a tinted pill with a pulsing dot."
437
+ },
438
+ {
439
+ "name": "CountPill",
440
+ "export": "CountPill",
441
+ "importPath": "@miragon/mcp-toolkit-ui",
442
+ "kind": "component",
443
+ "group": "composed",
444
+ "props": [
445
+ {
446
+ "name": "tone",
447
+ "type": "ToneVariant",
448
+ "required": false,
449
+ "description": "Status tone driving the tint. Default 'neutral'."
450
+ },
451
+ {
452
+ "name": "children",
453
+ "type": "ReactNode",
454
+ "required": true,
455
+ "description": "The count/value (rendered with tabular numbers)."
456
+ }
457
+ ],
458
+ "whenToUse": "Right-aligned count indicator on a list/group row (e.g. a per-group item count)."
459
+ },
460
+ {
461
+ "name": "SectionHeading",
462
+ "export": "SectionHeading",
463
+ "importPath": "@miragon/mcp-toolkit-ui",
464
+ "kind": "component",
465
+ "group": "composed",
466
+ "props": [
467
+ {
468
+ "name": "title",
469
+ "type": "ReactNode",
470
+ "required": true,
471
+ "description": "The section title."
472
+ },
473
+ {
474
+ "name": "hint",
475
+ "type": "ReactNode",
476
+ "required": false,
477
+ "description": "Muted hint shown on the right (e.g. a count)."
478
+ },
479
+ {
480
+ "name": "trailing",
481
+ "type": "ReactNode",
482
+ "required": false,
483
+ "description": "Right-aligned slot that overrides hint when set (e.g. a control)."
484
+ }
485
+ ],
486
+ "whenToUse": "Label a block inside a widget body (a list or sub-table) without the weight of a full card header."
487
+ },
488
+ {
489
+ "name": "WidgetHeader",
490
+ "export": "WidgetHeader",
491
+ "importPath": "@miragon/mcp-toolkit-ui",
492
+ "kind": "component",
493
+ "group": "composed",
494
+ "props": [
495
+ {
496
+ "name": "title",
497
+ "type": "ReactNode",
498
+ "required": true,
499
+ "description": "The widget title."
500
+ },
501
+ {
502
+ "name": "icon",
503
+ "type": "ReactNode",
504
+ "required": false,
505
+ "description": "Icon/glyph rendered in a tinted tile above the title."
506
+ },
507
+ {
508
+ "name": "iconTone",
509
+ "type": "ToneVariant",
510
+ "required": false,
511
+ "description": "Tone for the icon tile. Default 'neutral'."
512
+ },
513
+ {
514
+ "name": "sub",
515
+ "type": "ReactNode",
516
+ "required": false,
517
+ "description": "Subtitle/meta row under the title (e.g. a LivePill + counts)."
518
+ },
519
+ {
520
+ "name": "actions",
521
+ "type": "ReactNode",
522
+ "required": false,
523
+ "description": "Right-aligned actions slot (buttons, drill controls)."
524
+ }
525
+ ],
526
+ "whenToUse": "Anchor the top of a dashboard widget surface: tinted icon tile, large title, meta row, and an actions slot. Use once per widget."
527
+ },
528
+ {
529
+ "name": "GroupCard",
530
+ "export": "GroupCard",
531
+ "importPath": "@miragon/mcp-toolkit-ui",
532
+ "kind": "component",
533
+ "group": "composed",
534
+ "props": [
535
+ {
536
+ "name": "expanded",
537
+ "type": "boolean",
538
+ "required": true,
539
+ "description": "Whether the body is expanded."
540
+ },
541
+ {
542
+ "name": "onToggle",
543
+ "type": "() => void",
544
+ "required": true,
545
+ "description": "Toggle handler for the summary bar."
546
+ },
547
+ {
548
+ "name": "summary",
549
+ "type": "ReactNode",
550
+ "required": true,
551
+ "description": "Always-visible summary bar (may contain its own buttons/links; clicks on those don't toggle)."
552
+ },
553
+ {
554
+ "name": "children",
555
+ "type": "ReactNode",
556
+ "required": false,
557
+ "description": "Collapsible body, rendered only when expanded."
558
+ }
559
+ ],
560
+ "whenToUse": "Group related rows behind an expandable header (e.g. items grouped by a key). Replaces a hand-rolled Collapsible for list grouping."
561
+ },
562
+ {
563
+ "name": "FilterBar",
564
+ "export": "FilterBar",
565
+ "importPath": "@miragon/mcp-toolkit-ui",
566
+ "kind": "component",
567
+ "group": "composed",
568
+ "props": [
569
+ {
570
+ "name": "search",
571
+ "type": "string",
572
+ "required": true,
573
+ "description": "Current search text (controlled)."
574
+ },
575
+ {
576
+ "name": "onSearchChange",
577
+ "type": "(next: string) => void",
578
+ "required": true,
579
+ "description": "Called with the new search text on every keystroke."
580
+ },
581
+ {
582
+ "name": "chips",
583
+ "type": "FilterChip[]",
584
+ "required": true,
585
+ "description": "Toggleable filter chips: { id, label, count?, active? }."
586
+ },
587
+ {
588
+ "name": "onChipToggle",
589
+ "type": "(id: string) => void",
590
+ "required": true,
591
+ "description": "Called with a chip id when it is toggled."
592
+ },
593
+ {
594
+ "name": "searchPlaceholder",
595
+ "type": "string",
596
+ "required": false,
597
+ "description": "Placeholder for the search input. Default 'Filter\u2026'."
598
+ }
599
+ ],
600
+ "whenToUse": "Filter a list/table of widget items with a search box + chip row. Pair with useDebouncedValue so a server-side filter only re-queries once typing pauses."
601
+ },
602
+ {
603
+ "name": "DrillButton",
604
+ "export": "DrillButton",
605
+ "importPath": "@miragon/mcp-toolkit-ui",
606
+ "kind": "component",
607
+ "group": "composed",
608
+ "props": [
609
+ {
610
+ "name": "children",
611
+ "type": "ReactNode",
612
+ "required": true,
613
+ "description": "Button label."
614
+ },
615
+ {
616
+ "name": "onDrill",
617
+ "type": "() => void",
618
+ "required": true,
619
+ "description": "Drill/navigation handler \u2014 wire to in-widget navigation (e.g. useHostActions().showWidget)."
620
+ },
621
+ {
622
+ "name": "icon",
623
+ "type": "ReactNode",
624
+ "required": false,
625
+ "description": "Optional leading glyph; the trailing \u2192 is always rendered."
626
+ },
627
+ {
628
+ "name": "size",
629
+ "type": "\"sm\" | \"md\"",
630
+ "required": false,
631
+ "description": "'sm' for table rows, 'md' for surface headers. Default 'sm'."
632
+ },
633
+ {
634
+ "name": "ariaLabel",
635
+ "type": "string",
636
+ "required": false,
637
+ "description": "Accessible label when the visible text is terse."
638
+ }
639
+ ],
640
+ "whenToUse": "The single neutral in-widget navigation control (drill into a detail/sub-view). Use it for every drill so they read identically and stay visually quieter than primary/agentic actions."
641
+ },
642
+ {
643
+ "name": "ListFooter",
644
+ "export": "ListFooter",
645
+ "importPath": "@miragon/mcp-toolkit-ui",
646
+ "kind": "component",
647
+ "group": "composed",
648
+ "props": [
649
+ {
650
+ "name": "shown",
651
+ "type": "number",
652
+ "required": true,
653
+ "description": "How many rows are currently rendered."
654
+ },
655
+ {
656
+ "name": "total",
657
+ "type": "number",
658
+ "required": true,
659
+ "description": "Total rows available. Renders nothing when 0."
660
+ },
661
+ {
662
+ "name": "hasMore",
663
+ "type": "boolean",
664
+ "required": true,
665
+ "description": "Whether a 'Load more' button is shown."
666
+ },
667
+ {
668
+ "name": "onLoadMore",
669
+ "type": "() => void",
670
+ "required": true,
671
+ "description": "Called when the user asks for the next page."
672
+ },
673
+ {
674
+ "name": "loadingMore",
675
+ "type": "boolean",
676
+ "required": false,
677
+ "description": "Disables the button + shows a loading label while a fetch is in flight."
678
+ },
679
+ {
680
+ "name": "noun",
681
+ "type": "string",
682
+ "required": false,
683
+ "description": "Plural noun for the count, e.g. 'instances'. Default 'rows'."
684
+ }
685
+ ],
686
+ "whenToUse": "Footer for a paginated list: an honest 'Showing X of Y' total + an explicit 'Load more' (not infinite scroll)."
687
+ },
688
+ {
689
+ "name": "Tone tokens",
690
+ "export": "TONE_SOFT",
691
+ "importPath": "@miragon/mcp-toolkit-ui",
692
+ "kind": "object",
693
+ "group": "composed",
694
+ "parts": ["TONE_SOFT", "TONE_DOT", "TONE_TEXT"],
695
+ "props": [],
696
+ "whenToUse": "Record<ToneVariant, string> maps from a status tone ('neutral'|'info'|'success'|'warning'|'danger') to Tailwind class strings (TONE_SOFT = soft tint, TONE_DOT = dot colour, TONE_TEXT = text colour), backed by the semantic status tokens in globals.css and re-skinned by the theme. Use to colour a custom element by status without a tone === 'x' ? ... ternary; the tone-aware components (KpiGrid, LivePill, CountPill, WidgetHeader) consume these internally."
697
+ },
698
+ {
699
+ "name": "useDebouncedValue",
700
+ "export": "useDebouncedValue",
701
+ "importPath": "@miragon/mcp-toolkit-ui",
702
+ "kind": "hook",
703
+ "group": "data-hooks",
704
+ "props": [
705
+ {
706
+ "name": "value",
707
+ "type": "T",
708
+ "required": true,
709
+ "description": "The value to debounce."
710
+ },
711
+ {
712
+ "name": "delayMs",
713
+ "type": "number",
714
+ "required": false,
715
+ "description": "Debounce delay in ms. Default 300."
716
+ }
717
+ ],
718
+ "whenToUse": "Debounce a search box (e.g. FilterBar's search) so a server-side filter only re-queries once the user pauses typing. Returns the value delayed by delayMs."
719
+ },
720
+ {
721
+ "name": "useToolQuery",
722
+ "export": "useToolQuery",
723
+ "importPath": "@miragon/mcp-toolkit-ui",
724
+ "kind": "hook",
725
+ "group": "data-hooks",
726
+ "props": [
727
+ {
728
+ "name": "queryKey",
729
+ "type": "unknown[]",
730
+ "required": true,
731
+ "description": "Cache key. args is appended automatically so callers with different args get separate cache entries."
732
+ },
733
+ {
734
+ "name": "toolName",
735
+ "type": "string",
736
+ "required": true,
737
+ "description": "MCP tool to call (e.g. a generated *_data feed)."
738
+ },
739
+ {
740
+ "name": "args",
741
+ "type": "object",
742
+ "required": true,
743
+ "description": "Tool arguments."
744
+ },
745
+ {
746
+ "name": "opts",
747
+ "type": "{ enabled?: boolean; select?: (data) => selected }",
748
+ "required": false,
749
+ "description": "Gate the query / transform data on read."
750
+ }
751
+ ],
752
+ "whenToUse": "Self-fetch arbitrary data from a tool inside a cockpit-embedded widget. Result is decoded with parseToolResult (structured-first). Returns a TanStack UseQueryResult."
753
+ },
754
+ {
755
+ "name": "useToolMutation",
756
+ "export": "useToolMutation",
757
+ "importPath": "@miragon/mcp-toolkit-ui",
758
+ "kind": "hook",
759
+ "group": "data-hooks",
760
+ "props": [
761
+ {
762
+ "name": "toolName",
763
+ "type": "string",
764
+ "required": true,
765
+ "description": "MCP tool to invoke as the mutation."
766
+ },
767
+ {
768
+ "name": "opts",
769
+ "type": "{ invalidateKeys?: unknown[][] }",
770
+ "required": false,
771
+ "description": "Query keys to refetch on success."
772
+ }
773
+ ],
774
+ "whenToUse": "Run a write/action tool (e.g. retry-incident) and refetch dependent queries. Returns a TanStack UseMutationResult; call .mutate(args)."
775
+ },
776
+ {
777
+ "name": "useViewToolQuery",
778
+ "export": "useViewToolQuery",
779
+ "importPath": "@miragon/mcp-toolkit-ui/hooks",
780
+ "kind": "hook",
781
+ "group": "data-hooks",
782
+ "props": [
783
+ {
784
+ "name": "queryKey",
785
+ "type": "unknown[]",
786
+ "required": true,
787
+ "description": "Cache key; args appended automatically (sibling widgets dedupe)."
788
+ },
789
+ {
790
+ "name": "toolName",
791
+ "type": "string",
792
+ "required": true,
793
+ "description": "A *_show_* widget tool whose structuredContent is the full view envelope."
794
+ },
795
+ {
796
+ "name": "args",
797
+ "type": "object",
798
+ "required": true,
799
+ "description": "Tool arguments."
800
+ },
801
+ {
802
+ "name": "opts",
803
+ "type": "{ enabled?: boolean }",
804
+ "required": false,
805
+ "description": "Gate the query."
806
+ }
807
+ ],
808
+ "whenToUse": "Self-fetch from a *_show_* widget tool. Unwraps the McpAppView view envelope via parseViewToolResult (single-step \u2192 flat data, multi-step \u2192 keyed by step id) \u2014 the envelope-aware sibling of useToolQuery."
809
+ },
810
+ {
811
+ "name": "useViewData",
812
+ "export": "useViewData",
813
+ "importPath": "@miragon/mcp-toolkit-ui/hooks",
814
+ "kind": "hook",
815
+ "group": "data-hooks",
816
+ "props": [
817
+ {
818
+ "name": "initialData",
819
+ "type": "T | null | undefined",
820
+ "required": true,
821
+ "description": "Host-pushed data (e.g. from adaptDataWidget). Returned verbatim when present."
822
+ },
823
+ {
824
+ "name": "key",
825
+ "type": "ReadonlyArray<unknown>",
826
+ "required": true,
827
+ "description": "Cache key for the fallback self-fetch."
828
+ },
829
+ {
830
+ "name": "tool",
831
+ "type": "string",
832
+ "required": true,
833
+ "description": "Tool to call when initialData is absent."
834
+ },
835
+ {
836
+ "name": "args",
837
+ "type": "Record<string, unknown>",
838
+ "required": true,
839
+ "description": "Tool arguments for the fallback fetch."
840
+ },
841
+ {
842
+ "name": "ready",
843
+ "type": "boolean",
844
+ "required": true,
845
+ "description": "Whether the required id/key is present; fetch is disabled until ready and only when no initialData."
846
+ }
847
+ ],
848
+ "whenToUse": "The dual-mode seam: write ONE widget that renders host-pushed data when handed it (standalone *_show_* widget) AND self-fetches when embedded in a cockpit. Returns { data, loading, error }."
849
+ },
850
+ {
851
+ "name": "useIsMobile",
852
+ "export": "useIsMobile",
853
+ "importPath": "@miragon/mcp-toolkit-ui",
854
+ "kind": "hook",
855
+ "group": "data-hooks",
856
+ "props": [],
857
+ "whenToUse": "Switch a widget between compact and wide layouts below the 768px breakpoint. Returns boolean."
858
+ },
859
+ {
860
+ "name": "useHostBridge",
861
+ "export": "useHostBridge",
862
+ "importPath": "@miragon/mcp-toolkit-ui/app",
863
+ "kind": "hook",
864
+ "group": "host-hooks",
865
+ "props": [],
866
+ "whenToUse": "THE host seam for portable widgets. Returns a HostBridge { callTool, sendFollowup, openExternal, getWidgetData, setModelContext?, theme? }. Use this instead of mcp-use/react or window.openai directly so the same widget runs in the mcp-use host, ChatGPT, or standalone. Never returns null."
867
+ },
868
+ {
869
+ "name": "useHostActions",
870
+ "export": "useHostActions",
871
+ "importPath": "@miragon/mcp-toolkit-ui/app",
872
+ "kind": "hook",
873
+ "group": "host-hooks",
874
+ "props": [],
875
+ "whenToUse": "Named-affordance facade over useHostBridge: returns { openLink, showWidget, askAi }. Handy for in-widget navigation (showWidget) and handing open-ended tasks to the agent (askAi). New portable widgets can also use useHostBridge directly."
876
+ },
877
+ {
878
+ "name": "buildShowWidgetIntent",
879
+ "export": "buildShowWidgetIntent",
880
+ "importPath": "@miragon/mcp-toolkit-ui/app",
881
+ "kind": "function",
882
+ "group": "host-hooks",
883
+ "props": [
884
+ {
885
+ "name": "toolName",
886
+ "type": "string",
887
+ "required": true,
888
+ "description": "The *_show_* tool the agent should invoke."
889
+ },
890
+ {
891
+ "name": "description",
892
+ "type": "string",
893
+ "required": true,
894
+ "description": "Natural-language description of what to show."
895
+ }
896
+ ],
897
+ "whenToUse": "Build the intent string for host.showWidget(...) \u2014 appends a '(use <toolName>)' hint so the agent picks the right tool unambiguously."
898
+ },
899
+ {
900
+ "name": "HostBridgeProvider",
901
+ "export": "HostBridgeProvider",
902
+ "importPath": "@miragon/mcp-toolkit-ui/app",
903
+ "kind": "component",
904
+ "group": "host-hooks",
905
+ "props": [
906
+ {
907
+ "name": "bridge",
908
+ "type": "HostBridge",
909
+ "required": true,
910
+ "description": "The explicit bridge to provide (createChatGptHostBridge / createStandaloneHostBridge / createMcpUseHostBridge)."
911
+ },
912
+ {
913
+ "name": "children",
914
+ "type": "ReactNode",
915
+ "required": true,
916
+ "description": "Subtree whose useHostBridge() resolves to this bridge."
917
+ }
918
+ ],
919
+ "whenToUse": "Wrap a portable widget in the bridge for the host it runs in. Omit it inside the toolkit's own host (useHostBridge falls back to the mcp-use bridge)."
920
+ },
921
+ {
922
+ "name": "createStandaloneHostBridge",
923
+ "export": "createStandaloneHostBridge",
924
+ "importPath": "@miragon/mcp-toolkit-ui/app",
925
+ "kind": "function",
926
+ "group": "host-hooks",
927
+ "props": [
928
+ {
929
+ "name": "options",
930
+ "type": "StandaloneHostBridgeOptions",
931
+ "required": true,
932
+ "description": "{ callTool (required), getData?, onFollowup?, onOpenExternal?, onModelContext?, theme? }."
933
+ }
934
+ ],
935
+ "whenToUse": "Build a HostBridge for a standalone web app against any MCP server (callTool usually wraps a @modelcontextprotocol/sdk client). The WidgetFixtureHost builds on this too."
936
+ },
937
+ {
938
+ "name": "createChatGptHostBridge",
939
+ "export": "createChatGptHostBridge",
940
+ "importPath": "@miragon/mcp-toolkit-ui/app",
941
+ "kind": "function",
942
+ "group": "host-hooks",
943
+ "props": [
944
+ {
945
+ "name": "sdk",
946
+ "type": "OpenAiAppsSdk | null",
947
+ "required": false,
948
+ "description": "Explicit window.openai for testing; defaults to the real one."
949
+ }
950
+ ],
951
+ "whenToUse": "Build a HostBridge mapping the bridge verbs onto the OpenAI Apps SDK (ChatGPT). Defensive \u2014 missing host methods degrade to logged no-ops."
952
+ },
953
+ {
954
+ "name": "adaptDataWidget",
955
+ "export": "adaptDataWidget",
956
+ "importPath": "@miragon/mcp-toolkit-ui/app",
957
+ "kind": "function",
958
+ "group": "widget-authoring",
959
+ "props": [
960
+ {
961
+ "name": "Widget",
962
+ "type": "ComponentType<{ data: T | null } & Record<string, unknown>>",
963
+ "required": true,
964
+ "description": "A single-data widget \u2014 write it as ({ data }) and it stays host-agnostic."
965
+ },
966
+ {
967
+ "name": "dataType",
968
+ "type": "string",
969
+ "required": true,
970
+ "description": "The step _dataType to pull data from in context.steps."
971
+ },
972
+ {
973
+ "name": "describeForModel",
974
+ "type": "DescribeForModel<T>",
975
+ "required": false,
976
+ "description": "(data, props) => string. Wraps the widget in <ModelContext> so the model knows what the user is looking at."
977
+ }
978
+ ],
979
+ "whenToUse": "Register a hand-built ({ data }) widget as a framework WidgetComponent. The adapter finds the matching step in context.steps[_dataType].data and forwards result.data as the data prop, and spreads per-cell layout props. Lets render-view and *_show_* tools share one widget."
980
+ },
981
+ {
982
+ "name": "DescribeForModel",
983
+ "export": "DescribeForModel",
984
+ "importPath": "@miragon/mcp-toolkit-ui/app",
985
+ "kind": "type",
986
+ "group": "widget-authoring",
987
+ "props": [
988
+ {
989
+ "name": "(type)",
990
+ "type": "(data: NonNullable<T>, props: Readonly<Record<string, unknown>>) => string",
991
+ "required": true,
992
+ "description": "The describeForModel callback signature for adaptDataWidget."
993
+ }
994
+ ],
995
+ "whenToUse": "Type the model-context line builder you pass to adaptDataWidget \u2014 report view identity, active filters, and headline numbers so the agent has context on the next turn."
996
+ },
997
+ {
998
+ "name": "parseToolResult",
999
+ "export": "parseToolResult",
1000
+ "importPath": "@miragon/mcp-toolkit-ui",
1001
+ "kind": "function",
1002
+ "group": "widget-authoring",
1003
+ "props": [
1004
+ {
1005
+ "name": "result",
1006
+ "type": "unknown",
1007
+ "required": true,
1008
+ "description": "The raw MCP tool result."
1009
+ },
1010
+ {
1011
+ "name": "opts",
1012
+ "type": "{ prefer?: \"structured\" | \"text\" }",
1013
+ "required": false,
1014
+ "description": "Channel preference. Default 'structured' (structuredContent-first)."
1015
+ }
1016
+ ],
1017
+ "whenToUse": "Decode a raw callTool result to its data payload. Structured-first: isError \u2192 throw, then structuredContent, then JSON-decoded text, then raw. useToolQuery decodes through this for you."
1018
+ },
1019
+ {
1020
+ "name": "parseViewToolResult",
1021
+ "export": "parseViewToolResult",
1022
+ "importPath": "@miragon/mcp-toolkit-ui",
1023
+ "kind": "function",
1024
+ "group": "widget-authoring",
1025
+ "props": [
1026
+ {
1027
+ "name": "result",
1028
+ "type": "unknown",
1029
+ "required": true,
1030
+ "description": "The raw result of a *_show_* widget tool."
1031
+ }
1032
+ ],
1033
+ "whenToUse": "Unwrap a *_show_* view envelope (context.stepData) to the flat widget data: single-step \u2192 that step's data; multi-step \u2192 object keyed by step id. Non-envelope results pass through parseToolResult."
1034
+ },
1035
+ {
1036
+ "name": "cn",
1037
+ "export": "cn",
1038
+ "importPath": "@miragon/mcp-toolkit-ui",
1039
+ "kind": "function",
1040
+ "group": "widget-authoring",
1041
+ "props": [
1042
+ {
1043
+ "name": "...classes",
1044
+ "type": "ClassValue[]",
1045
+ "required": false,
1046
+ "description": "clsx inputs."
1047
+ }
1048
+ ],
1049
+ "whenToUse": "Merge Tailwind class strings (clsx + tailwind-merge). Use for conditional/override classes; later conflicting utilities win."
1050
+ },
1051
+ {
1052
+ "name": "createTheme",
1053
+ "export": "createTheme",
1054
+ "importPath": "@miragon/mcp-toolkit-ui",
1055
+ "kind": "function",
1056
+ "group": "theming",
1057
+ "props": [
1058
+ {
1059
+ "name": "tokens",
1060
+ "type": "ThemeTokens",
1061
+ "required": true,
1062
+ "description": "Curated brand tokens (all optional): primary, primaryForeground, accent, accentForeground, background, foreground, card, cardForeground, border, ring, radius, fontSans, fontHeading. Colors are any CSS color string (oklch/hex/hsl)."
1063
+ },
1064
+ {
1065
+ "name": "opts",
1066
+ "type": "{ dark?: ThemeTokens }",
1067
+ "required": false,
1068
+ "description": "Dark-mode token overrides, applied on top of the .dark defaults when the active mode is dark."
1069
+ }
1070
+ ],
1071
+ "whenToUse": "Define a white-label theme from a single set of brand tokens. Maps the curated fields onto the real CSS variables (--primary, --radius, ...) and returns a serializable ThemeDefinition { vars, darkVars?, toStyle() }. Apply it with ThemeProvider so every primitive re-skins to the client's brand."
1072
+ },
1073
+ {
1074
+ "name": "ThemeProvider",
1075
+ "export": "ThemeProvider",
1076
+ "importPath": "@miragon/mcp-toolkit-ui",
1077
+ "kind": "component",
1078
+ "group": "theming",
1079
+ "props": [
1080
+ {
1081
+ "name": "theme",
1082
+ "type": "ThemeDefinition",
1083
+ "required": false,
1084
+ "description": "The theme from createTheme/themePresets to apply. Omit to manage only the light/dark mode against the toolkit defaults."
1085
+ },
1086
+ {
1087
+ "name": "mode",
1088
+ "type": "\"light\" | \"dark\" | \"system\"",
1089
+ "required": false,
1090
+ "description": "Color-scheme mode. Default 'light'. Pass HostBridge.theme to follow the host, or 'system' to track prefers-color-scheme (SSR-safe)."
1091
+ },
1092
+ {
1093
+ "name": "as",
1094
+ "type": "\"div\" | \"span\" | \"section\" | \"main\"",
1095
+ "required": false,
1096
+ "description": "Scope wrapper element. Default 'div'."
1097
+ },
1098
+ {
1099
+ "name": "className",
1100
+ "type": "string",
1101
+ "required": false,
1102
+ "description": "Merged onto the scope wrapper."
1103
+ },
1104
+ {
1105
+ "name": "children",
1106
+ "type": "ReactNode",
1107
+ "required": true,
1108
+ "description": "Subtree that inherits the theme's CSS variables and dark class."
1109
+ }
1110
+ ],
1111
+ "whenToUse": "Wrap a widget (or a whole app) to apply a ThemeDefinition. Renders a wrapper carrying the theme's CSS variables inline (overriding :root) and toggles the .dark class on the scope per mode. React + DOM only \u2014 no host required."
1112
+ },
1113
+ {
1114
+ "name": "useTheme",
1115
+ "export": "useTheme",
1116
+ "importPath": "@miragon/mcp-toolkit-ui",
1117
+ "kind": "hook",
1118
+ "group": "theming",
1119
+ "props": [],
1120
+ "whenToUse": "Read the active theme/mode from the nearest ThemeProvider. Returns { theme, mode, resolvedMode } where resolvedMode is 'system' resolved to 'light'|'dark'. Throws outside a ThemeProvider."
1121
+ },
1122
+ {
1123
+ "name": "themePresets",
1124
+ "export": "themePresets",
1125
+ "importPath": "@miragon/mcp-toolkit-ui",
1126
+ "kind": "object",
1127
+ "group": "theming",
1128
+ "props": [],
1129
+ "whenToUse": "Ready-made white-label themes (themePresets.miragon, .violet, .emerald) \u2014 a demonstration of createTheme and a fork-able starting point. Pass one to ThemeProvider's theme prop."
1130
+ },
1131
+ {
1132
+ "name": "LocaleProvider",
1133
+ "export": "LocaleProvider",
1134
+ "importPath": "@miragon/mcp-toolkit-ui",
1135
+ "kind": "component",
1136
+ "group": "i18n",
1137
+ "props": [
1138
+ {
1139
+ "name": "locale",
1140
+ "type": "string",
1141
+ "required": true,
1142
+ "description": "The active locale tag (e.g. 'en', 'de'). Resolve it on the host/server (header, user profile, session store) and pass it in."
1143
+ },
1144
+ {
1145
+ "name": "translator",
1146
+ "type": "Translate",
1147
+ "required": false,
1148
+ "description": "A translator from createTranslator(catalogs) (@miragon/mcp-toolkit-core). Omit to provide the locale only (useTranslate echoes keys)."
1149
+ },
1150
+ {
1151
+ "name": "children",
1152
+ "type": "ReactNode",
1153
+ "required": true,
1154
+ "description": "Subtree whose widgets read the locale via useLocale/useTranslate."
1155
+ }
1156
+ ],
1157
+ "whenToUse": "Wrap a widget (or a whole app) to provide the active locale + an optional translator. Widgets read it with useLocale/useTranslate. Pure React (no host required), mirroring ThemeProvider \u2014 pairs with createTranslator from @miragon/mcp-toolkit-core."
1158
+ },
1159
+ {
1160
+ "name": "useLocale",
1161
+ "export": "useLocale",
1162
+ "importPath": "@miragon/mcp-toolkit-ui",
1163
+ "kind": "hook",
1164
+ "group": "i18n",
1165
+ "props": [],
1166
+ "whenToUse": "Read the active locale tag (e.g. 'de') from the nearest LocaleProvider. Returns 'en' outside a provider (does not throw), so unwrapped widgets keep rendering."
1167
+ },
1168
+ {
1169
+ "name": "useTranslate",
1170
+ "export": "useTranslate",
1171
+ "importPath": "@miragon/mcp-toolkit-ui",
1172
+ "kind": "hook",
1173
+ "group": "i18n",
1174
+ "props": [],
1175
+ "whenToUse": "Get a locale-bound translate (key, params?) => string from the nearest LocaleProvider. Outside a provider it echoes the key, so a missing wrapper degrades gracefully instead of crashing."
1176
+ },
1177
+ {
1178
+ "name": "McpToolkitApp",
1179
+ "export": "McpToolkitApp",
1180
+ "importPath": "@miragon/mcp-toolkit-ui/app",
1181
+ "kind": "component",
1182
+ "group": "app-shell",
1183
+ "props": [
1184
+ {
1185
+ "name": "widgets",
1186
+ "type": "Record<string, WidgetComponent>",
1187
+ "required": true,
1188
+ "description": "Host-bundled widget registry keyed by widget id."
1189
+ },
1190
+ {
1191
+ "name": "refreshToolName",
1192
+ "type": "string",
1193
+ "required": false,
1194
+ "description": "Tool the refresh button invokes. Default 'refresh-view'."
1195
+ },
1196
+ {
1197
+ "name": "labels",
1198
+ "type": "McpAppViewLabels",
1199
+ "required": false,
1200
+ "description": "Override UI strings (loading, refresh, fullscreen)."
1201
+ }
1202
+ ],
1203
+ "whenToUse": "The recommended consumer root for an mcp-app.html bundle. Wraps McpAppView in mcp-use's McpUseProvider (host auto-sizing, StrictMode, error boundary, theme). You usually do NOT write this when authoring a single widget \u2014 you write the widget and register it here."
1204
+ },
1205
+ {
1206
+ "name": "WidgetFixtureHost",
1207
+ "export": "WidgetFixtureHost",
1208
+ "importPath": "@miragon/mcp-toolkit-ui/app",
1209
+ "kind": "component",
1210
+ "group": "dev",
1211
+ "props": [
1212
+ {
1213
+ "name": "widget",
1214
+ "type": "FixtureWidget",
1215
+ "required": true,
1216
+ "description": "The widget component under development."
1217
+ },
1218
+ {
1219
+ "name": "data",
1220
+ "type": "Record<string, unknown>",
1221
+ "required": false,
1222
+ "description": "Fixture data: keys map for ({ keys }) widgets, forwarded as data for ({ data }) widgets."
1223
+ },
1224
+ {
1225
+ "name": "dataType",
1226
+ "type": "string",
1227
+ "required": false,
1228
+ "description": "For adaptDataWidget components: seeds a pipeline step whose _dataType matches so the adapter resolves data."
1229
+ },
1230
+ {
1231
+ "name": "tools",
1232
+ "type": "Record<string, FixtureToolEntry>",
1233
+ "required": false,
1234
+ "description": "Tool fixtures keyed by tool name. A static value or a (args) => result handler. Drives useToolQuery and callTool."
1235
+ },
1236
+ {
1237
+ "name": "globals",
1238
+ "type": "Record<string, unknown>",
1239
+ "required": false,
1240
+ "description": "Host-context overrides (theme, displayMode, locale...)."
1241
+ },
1242
+ {
1243
+ "name": "onModelContext",
1244
+ "type": "(text: string) => void",
1245
+ "required": false,
1246
+ "description": "Receives the serialized <ModelContext> the widget reports \u2014 see what the model would see."
1247
+ },
1248
+ {
1249
+ "name": "onHostAction",
1250
+ "type": "(action: HostActionLog) => void",
1251
+ "required": false,
1252
+ "description": "Receives every host action (tool call, link, follow-up)."
1253
+ }
1254
+ ],
1255
+ "whenToUse": "Storybook-style harness: render ONE widget with fixture data and a mocked host (no backend, no real host). This is the prompt \u2192 see \u2192 iterate loop; add a Story to examples/widget-playground/stories.ts."
1256
+ },
1257
+ {
1258
+ "name": "buildFixtureWidgetProps",
1259
+ "export": "buildFixtureWidgetProps",
1260
+ "importPath": "@miragon/mcp-toolkit-ui/app",
1261
+ "kind": "function",
1262
+ "group": "dev",
1263
+ "props": [
1264
+ {
1265
+ "name": "data",
1266
+ "type": "Record<string, unknown>",
1267
+ "required": true,
1268
+ "description": "Fixture data used as keys map and (when dataType set) the seeded step's data."
1269
+ },
1270
+ {
1271
+ "name": "dataType",
1272
+ "type": "string",
1273
+ "required": false,
1274
+ "description": "Seed the single pipeline step under this _dataType for adaptDataWidget components."
1275
+ }
1276
+ ],
1277
+ "whenToUse": "Build the WidgetProps envelope the fixture host passes to a widget \u2014 exported mainly for unit testing the envelope shape without rendering React."
1278
+ }
1279
+ ]
1280
+ }