@miragon/mcp-toolkit-ui 2.7.0 → 2.8.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 (388) hide show
  1. package/README.md +7 -4
  2. package/dist/app/adapt-data-widget.d.ts +1 -22
  3. package/dist/app/adapt-data-widget.d.ts.map +1 -1
  4. package/dist/app/adapt-data-widget.js +1 -35
  5. package/dist/app/adapt-data-widget.js.map +1 -1
  6. package/dist/app/builder/BuilderBanners.js +1 -1
  7. package/dist/app/builder/BuilderBanners.js.map +1 -1
  8. package/dist/app/builder/CanvasRow.d.ts +4 -2
  9. package/dist/app/builder/CanvasRow.d.ts.map +1 -1
  10. package/dist/app/builder/CanvasRow.js +21 -7
  11. package/dist/app/builder/CanvasRow.js.map +1 -1
  12. package/dist/app/builder/CatalogueSheet.d.ts.map +1 -1
  13. package/dist/app/builder/CatalogueSheet.js +11 -4
  14. package/dist/app/builder/CatalogueSheet.js.map +1 -1
  15. package/dist/app/builder/CellPropsSheet.d.ts +7 -3
  16. package/dist/app/builder/CellPropsSheet.d.ts.map +1 -1
  17. package/dist/app/builder/CellPropsSheet.js +10 -3
  18. package/dist/app/builder/CellPropsSheet.js.map +1 -1
  19. package/dist/app/builder/DiscardDialog.d.ts +18 -0
  20. package/dist/app/builder/DiscardDialog.d.ts.map +1 -0
  21. package/dist/app/builder/DiscardDialog.js +18 -0
  22. package/dist/app/builder/DiscardDialog.js.map +1 -0
  23. package/dist/app/builder/LayoutSurface.d.ts +33 -9
  24. package/dist/app/builder/LayoutSurface.d.ts.map +1 -1
  25. package/dist/app/builder/LayoutSurface.js +74 -23
  26. package/dist/app/builder/LayoutSurface.js.map +1 -1
  27. package/dist/app/builder/PipelineStrip.d.ts +2 -1
  28. package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
  29. package/dist/app/builder/PipelineStrip.js +26 -13
  30. package/dist/app/builder/PipelineStrip.js.map +1 -1
  31. package/dist/app/builder/SaveDialog.d.ts +9 -1
  32. package/dist/app/builder/SaveDialog.d.ts.map +1 -1
  33. package/dist/app/builder/SaveDialog.js +8 -2
  34. package/dist/app/builder/SaveDialog.js.map +1 -1
  35. package/dist/app/builder/Toolbar.d.ts +12 -4
  36. package/dist/app/builder/Toolbar.d.ts.map +1 -1
  37. package/dist/app/builder/Toolbar.js +18 -7
  38. package/dist/app/builder/Toolbar.js.map +1 -1
  39. package/dist/app/builder/Workspace.d.ts +23 -3
  40. package/dist/app/builder/Workspace.d.ts.map +1 -1
  41. package/dist/app/builder/Workspace.js +58 -8
  42. package/dist/app/builder/Workspace.js.map +1 -1
  43. package/dist/app/builder/builder-model.d.ts +143 -1
  44. package/dist/app/builder/builder-model.d.ts.map +1 -1
  45. package/dist/app/builder/builder-model.js +191 -1
  46. package/dist/app/builder/builder-model.js.map +1 -1
  47. package/dist/app/builder/reveal.d.ts +10 -0
  48. package/dist/app/builder/reveal.d.ts.map +1 -0
  49. package/dist/app/builder/reveal.js +10 -0
  50. package/dist/app/builder/reveal.js.map +1 -0
  51. package/dist/app/builder/use-builder-catalogue.d.ts +4 -1
  52. package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
  53. package/dist/app/builder/use-builder-catalogue.js +44 -17
  54. package/dist/app/builder/use-builder-catalogue.js.map +1 -1
  55. package/dist/app/builder/use-builder-session.d.ts +30 -0
  56. package/dist/app/builder/use-builder-session.d.ts.map +1 -0
  57. package/dist/app/builder/use-builder-session.js +58 -0
  58. package/dist/app/builder/use-builder-session.js.map +1 -0
  59. package/dist/app/builder/use-display-resolver.d.ts +17 -0
  60. package/dist/app/builder/use-display-resolver.d.ts.map +1 -0
  61. package/dist/app/builder/use-display-resolver.js +16 -0
  62. package/dist/app/builder/use-display-resolver.js.map +1 -0
  63. package/dist/app/index.d.ts +8 -3
  64. package/dist/app/index.d.ts.map +1 -1
  65. package/dist/app/index.js +8 -2
  66. package/dist/app/index.js.map +1 -1
  67. package/dist/app/layout-builder.d.ts +13 -25
  68. package/dist/app/layout-builder.d.ts.map +1 -1
  69. package/dist/app/layout-builder.js +75 -81
  70. package/dist/app/layout-builder.js.map +1 -1
  71. package/dist/app/mcp-app-view-chrome.d.ts +12 -3
  72. package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
  73. package/dist/app/mcp-app-view-chrome.js +21 -5
  74. package/dist/app/mcp-app-view-chrome.js.map +1 -1
  75. package/dist/app/mcp-app-view-states.d.ts +11 -3
  76. package/dist/app/mcp-app-view-states.d.ts.map +1 -1
  77. package/dist/app/mcp-app-view-states.js +29 -8
  78. package/dist/app/mcp-app-view-states.js.map +1 -1
  79. package/dist/app/mcp-app-view.d.ts +33 -1
  80. package/dist/app/mcp-app-view.d.ts.map +1 -1
  81. package/dist/app/mcp-app-view.js +181 -127
  82. package/dist/app/mcp-app-view.js.map +1 -1
  83. package/dist/app/mcp-toolkit-app.d.ts +6 -1
  84. package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
  85. package/dist/app/mcp-toolkit-app.js +8 -1
  86. package/dist/app/mcp-toolkit-app.js.map +1 -1
  87. package/dist/app/mcp-use-host-bridge.d.ts +15 -6
  88. package/dist/app/mcp-use-host-bridge.d.ts.map +1 -1
  89. package/dist/app/mcp-use-host-bridge.js +51 -22
  90. package/dist/app/mcp-use-host-bridge.js.map +1 -1
  91. package/dist/app/model-context.d.ts +71 -0
  92. package/dist/app/model-context.d.ts.map +1 -0
  93. package/dist/app/model-context.js +101 -0
  94. package/dist/app/model-context.js.map +1 -0
  95. package/dist/app/use-build-mode-focus.d.ts +33 -0
  96. package/dist/app/use-build-mode-focus.d.ts.map +1 -0
  97. package/dist/app/use-build-mode-focus.js +59 -0
  98. package/dist/app/use-build-mode-focus.js.map +1 -0
  99. package/dist/app/use-view-actions.d.ts +31 -0
  100. package/dist/app/use-view-actions.d.ts.map +1 -0
  101. package/dist/app/use-view-actions.js +81 -0
  102. package/dist/app/use-view-actions.js.map +1 -0
  103. package/dist/app/use-view-lifecycle.d.ts +4 -0
  104. package/dist/app/use-view-lifecycle.d.ts.map +1 -1
  105. package/dist/app/use-view-lifecycle.js +2 -0
  106. package/dist/app/use-view-lifecycle.js.map +1 -1
  107. package/dist/app/view-lifecycle.d.ts +80 -4
  108. package/dist/app/view-lifecycle.d.ts.map +1 -1
  109. package/dist/app/view-lifecycle.js +90 -3
  110. package/dist/app/view-lifecycle.js.map +1 -1
  111. package/dist/app/widget-fixture.d.ts +10 -3
  112. package/dist/app/widget-fixture.d.ts.map +1 -1
  113. package/dist/app/widget-fixture.js +21 -8
  114. package/dist/app/widget-fixture.js.map +1 -1
  115. package/dist/app/widget-props-sheet.d.ts +3 -1
  116. package/dist/app/widget-props-sheet.d.ts.map +1 -1
  117. package/dist/app/widget-props-sheet.js +22 -10
  118. package/dist/app/widget-props-sheet.js.map +1 -1
  119. package/dist/app/widget-renderer.js +1 -1
  120. package/dist/app/widget-renderer.js.map +1 -1
  121. package/dist/components/DrillButton.d.ts +14 -6
  122. package/dist/components/DrillButton.d.ts.map +1 -1
  123. package/dist/components/DrillButton.js +14 -7
  124. package/dist/components/DrillButton.js.map +1 -1
  125. package/dist/components/EmptyState.d.ts.map +1 -1
  126. package/dist/components/EmptyState.js +4 -2
  127. package/dist/components/EmptyState.js.map +1 -1
  128. package/dist/components/ErrorState.d.ts +5 -2
  129. package/dist/components/ErrorState.d.ts.map +1 -1
  130. package/dist/components/ErrorState.js +25 -8
  131. package/dist/components/ErrorState.js.map +1 -1
  132. package/dist/components/FilterBar.d.ts +15 -4
  133. package/dist/components/FilterBar.d.ts.map +1 -1
  134. package/dist/components/FilterBar.js +11 -6
  135. package/dist/components/FilterBar.js.map +1 -1
  136. package/dist/components/KpiGrid.d.ts +66 -21
  137. package/dist/components/KpiGrid.d.ts.map +1 -1
  138. package/dist/components/KpiGrid.js +101 -34
  139. package/dist/components/KpiGrid.js.map +1 -1
  140. package/dist/components/ListFooter.d.ts +31 -4
  141. package/dist/components/ListFooter.d.ts.map +1 -1
  142. package/dist/components/ListFooter.js +30 -11
  143. package/dist/components/ListFooter.js.map +1 -1
  144. package/dist/components/PagedListFooter.d.ts +57 -0
  145. package/dist/components/PagedListFooter.d.ts.map +1 -0
  146. package/dist/components/PagedListFooter.js +27 -0
  147. package/dist/components/PagedListFooter.js.map +1 -0
  148. package/dist/components/Pills.d.ts +27 -7
  149. package/dist/components/Pills.d.ts.map +1 -1
  150. package/dist/components/Pills.js +21 -6
  151. package/dist/components/Pills.js.map +1 -1
  152. package/dist/components/SectionHeading.d.ts +3 -1
  153. package/dist/components/SectionHeading.d.ts.map +1 -1
  154. package/dist/components/SectionHeading.js +6 -2
  155. package/dist/components/SectionHeading.js.map +1 -1
  156. package/dist/components/Toast.d.ts +9 -3
  157. package/dist/components/Toast.d.ts.map +1 -1
  158. package/dist/components/Toast.js +31 -16
  159. package/dist/components/Toast.js.map +1 -1
  160. package/dist/components/WidgetHeader.d.ts +34 -10
  161. package/dist/components/WidgetHeader.d.ts.map +1 -1
  162. package/dist/components/WidgetHeader.js +11 -6
  163. package/dist/components/WidgetHeader.js.map +1 -1
  164. package/dist/hooks/index.d.ts +4 -4
  165. package/dist/hooks/index.d.ts.map +1 -1
  166. package/dist/hooks/index.js +1 -1
  167. package/dist/hooks/index.js.map +1 -1
  168. package/dist/hooks/tool-result-recovery-model.d.ts +155 -0
  169. package/dist/hooks/tool-result-recovery-model.d.ts.map +1 -0
  170. package/dist/hooks/tool-result-recovery-model.js +273 -0
  171. package/dist/hooks/tool-result-recovery-model.js.map +1 -0
  172. package/dist/hooks/use-tool-query.d.ts +56 -14
  173. package/dist/hooks/use-tool-query.d.ts.map +1 -1
  174. package/dist/hooks/use-tool-query.js +102 -25
  175. package/dist/hooks/use-tool-query.js.map +1 -1
  176. package/dist/hooks/use-tool-result-recovery.d.ts +47 -52
  177. package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
  178. package/dist/hooks/use-tool-result-recovery.js +58 -120
  179. package/dist/hooks/use-tool-result-recovery.js.map +1 -1
  180. package/dist/hooks/use-view-data.d.ts +52 -10
  181. package/dist/hooks/use-view-data.d.ts.map +1 -1
  182. package/dist/hooks/use-view-data.js +81 -16
  183. package/dist/hooks/use-view-data.js.map +1 -1
  184. package/dist/hooks/use-view-tool-query.d.ts +12 -7
  185. package/dist/hooks/use-view-tool-query.d.ts.map +1 -1
  186. package/dist/hooks/use-view-tool-query.js +15 -14
  187. package/dist/hooks/use-view-tool-query.js.map +1 -1
  188. package/dist/index.d.ts +17 -10
  189. package/dist/index.d.ts.map +1 -1
  190. package/dist/index.js +18 -6
  191. package/dist/index.js.map +1 -1
  192. package/dist/lib/focus-return.d.ts +61 -0
  193. package/dist/lib/focus-return.d.ts.map +1 -0
  194. package/dist/lib/focus-return.js +46 -0
  195. package/dist/lib/focus-return.js.map +1 -0
  196. package/dist/lib/parse-tool-result.d.ts +23 -1
  197. package/dist/lib/parse-tool-result.d.ts.map +1 -1
  198. package/dist/lib/parse-tool-result.js +38 -2
  199. package/dist/lib/parse-tool-result.js.map +1 -1
  200. package/dist/lib/toast-model.d.ts +41 -1
  201. package/dist/lib/toast-model.d.ts.map +1 -1
  202. package/dist/lib/toast-model.js +67 -1
  203. package/dist/lib/toast-model.js.map +1 -1
  204. package/dist/lib/tone-utils.d.ts +58 -6
  205. package/dist/lib/tone-utils.d.ts.map +1 -1
  206. package/dist/lib/tone-utils.js +66 -4
  207. package/dist/lib/tone-utils.js.map +1 -1
  208. package/dist/lib/tool-query.d.ts +107 -0
  209. package/dist/lib/tool-query.d.ts.map +1 -0
  210. package/dist/lib/tool-query.js +182 -0
  211. package/dist/lib/tool-query.js.map +1 -0
  212. package/dist/lib/tool-result-observer.d.ts +108 -0
  213. package/dist/lib/tool-result-observer.d.ts.map +1 -0
  214. package/dist/lib/tool-result-observer.js +158 -0
  215. package/dist/lib/tool-result-observer.js.map +1 -0
  216. package/dist/lib/typography.d.ts +37 -0
  217. package/dist/lib/typography.d.ts.map +1 -0
  218. package/dist/lib/typography.js +41 -0
  219. package/dist/lib/typography.js.map +1 -0
  220. package/dist/lib/utils.d.ts.map +1 -1
  221. package/dist/lib/utils.js +11 -1
  222. package/dist/lib/utils.js.map +1 -1
  223. package/dist/locale/index.d.ts +1 -1
  224. package/dist/locale/index.d.ts.map +1 -1
  225. package/dist/locale/message-types.d.ts +117 -4
  226. package/dist/locale/message-types.d.ts.map +1 -1
  227. package/dist/locale/messages-de.d.ts.map +1 -1
  228. package/dist/locale/messages-de.js +44 -10
  229. package/dist/locale/messages-de.js.map +1 -1
  230. package/dist/locale/messages-en.d.ts.map +1 -1
  231. package/dist/locale/messages-en.js +44 -10
  232. package/dist/locale/messages-en.js.map +1 -1
  233. package/dist/locale/toolkit-messages.d.ts +19 -1
  234. package/dist/locale/toolkit-messages.d.ts.map +1 -1
  235. package/dist/locale/toolkit-messages.js +54 -1
  236. package/dist/locale/toolkit-messages.js.map +1 -1
  237. package/dist/primitives/alert.d.ts +1 -1
  238. package/dist/primitives/alert.d.ts.map +1 -1
  239. package/dist/primitives/alert.js +2 -0
  240. package/dist/primitives/alert.js.map +1 -1
  241. package/dist/primitives/badge.d.ts +1 -1
  242. package/dist/primitives/badge.d.ts.map +1 -1
  243. package/dist/primitives/badge.js +9 -4
  244. package/dist/primitives/badge.js.map +1 -1
  245. package/dist/primitives/button.d.ts +1 -1
  246. package/dist/primitives/button.js +1 -1
  247. package/dist/primitives/button.js.map +1 -1
  248. package/dist/primitives/dialog.d.ts +1 -1
  249. package/dist/primitives/dialog.d.ts.map +1 -1
  250. package/dist/primitives/dialog.js +10 -3
  251. package/dist/primitives/dialog.js.map +1 -1
  252. package/dist/primitives/select.js +1 -1
  253. package/dist/primitives/select.js.map +1 -1
  254. package/dist/primitives/sheet.d.ts +1 -1
  255. package/dist/primitives/sheet.d.ts.map +1 -1
  256. package/dist/primitives/sheet.js +6 -2
  257. package/dist/primitives/sheet.js.map +1 -1
  258. package/dist/providers/query-provider.d.ts +32 -1
  259. package/dist/providers/query-provider.d.ts.map +1 -1
  260. package/dist/providers/query-provider.js +53 -4
  261. package/dist/providers/query-provider.js.map +1 -1
  262. package/dist/render-cases-primitives.js +1 -1
  263. package/dist/render-cases-primitives.js.map +1 -1
  264. package/dist/render-cases.d.ts.map +1 -1
  265. package/dist/render-cases.js +30 -6
  266. package/dist/render-cases.js.map +1 -1
  267. package/dist/render-effects.d.ts +42 -0
  268. package/dist/render-effects.d.ts.map +1 -0
  269. package/dist/render-effects.js +81 -0
  270. package/dist/render-effects.js.map +1 -0
  271. package/dist/theme/create-theme.d.ts +19 -1
  272. package/dist/theme/create-theme.d.ts.map +1 -1
  273. package/dist/theme/create-theme.js +15 -0
  274. package/dist/theme/create-theme.js.map +1 -1
  275. package/package.json +5 -4
  276. package/src/app/adapt-data-widget.tsx +2 -42
  277. package/src/app/builder/BuilderBanners.tsx +1 -1
  278. package/src/app/builder/CanvasRow.tsx +63 -17
  279. package/src/app/builder/CatalogueSheet.tsx +50 -29
  280. package/src/app/builder/CellPropsSheet.tsx +17 -2
  281. package/src/app/builder/DiscardDialog.tsx +59 -0
  282. package/src/app/builder/LayoutSurface.tsx +206 -66
  283. package/src/app/builder/PipelineStrip.tsx +253 -153
  284. package/src/app/builder/SaveDialog.tsx +14 -2
  285. package/src/app/builder/Toolbar.tsx +144 -59
  286. package/src/app/builder/Workspace.tsx +226 -58
  287. package/src/app/builder/builder-model.ts +341 -2
  288. package/src/app/builder/builder-model.ux.test.ts +456 -0
  289. package/src/app/builder/builder-ux.test.tsx +844 -0
  290. package/src/app/builder/reveal.ts +10 -0
  291. package/src/app/builder/use-builder-catalogue.ts +56 -19
  292. package/src/app/builder/use-builder-session.ts +68 -0
  293. package/src/app/builder/use-display-resolver.ts +24 -0
  294. package/src/app/index.ts +12 -2
  295. package/src/app/layout-builder.tsx +178 -191
  296. package/src/app/mcp-app-view-chrome.test.tsx +141 -1
  297. package/src/app/mcp-app-view-chrome.tsx +56 -6
  298. package/src/app/mcp-app-view-states.tsx +51 -11
  299. package/src/app/mcp-app-view.effects.test.tsx +292 -0
  300. package/src/app/mcp-app-view.test.tsx +222 -2
  301. package/src/app/mcp-app-view.tsx +267 -117
  302. package/src/app/mcp-toolkit-app.test.tsx +40 -0
  303. package/src/app/mcp-toolkit-app.tsx +8 -1
  304. package/src/app/mcp-use-host-bridge.test.tsx +180 -0
  305. package/src/app/mcp-use-host-bridge.tsx +67 -24
  306. package/src/app/model-context.test.tsx +116 -0
  307. package/src/app/model-context.tsx +125 -0
  308. package/src/app/use-build-mode-focus.ts +62 -0
  309. package/src/app/use-view-actions.ts +89 -0
  310. package/src/app/use-view-lifecycle.ts +6 -0
  311. package/src/app/view-lifecycle.test.ts +216 -0
  312. package/src/app/view-lifecycle.ts +165 -5
  313. package/src/app/widget-fixture.effects.test.tsx +51 -0
  314. package/src/app/widget-fixture.render.test.tsx +81 -0
  315. package/src/app/widget-fixture.tsx +34 -11
  316. package/src/app/widget-props-sheet.tsx +57 -16
  317. package/src/app/widget-renderer.tsx +1 -1
  318. package/src/components/DrillButton.test.tsx +48 -0
  319. package/src/components/DrillButton.tsx +26 -11
  320. package/src/components/EmptyState.tsx +6 -4
  321. package/src/components/ErrorState.tsx +31 -9
  322. package/src/components/FilterBar.test.tsx +82 -0
  323. package/src/components/FilterBar.tsx +52 -26
  324. package/src/components/KpiGrid.test.tsx +279 -0
  325. package/src/components/KpiGrid.tsx +297 -90
  326. package/src/components/ListFooter.test.tsx +116 -0
  327. package/src/components/ListFooter.tsx +102 -15
  328. package/src/components/PagedListFooter.test.tsx +140 -0
  329. package/src/components/PagedListFooter.tsx +107 -0
  330. package/src/components/Pills.test.tsx +77 -0
  331. package/src/components/Pills.tsx +63 -10
  332. package/src/components/SectionHeading.tsx +9 -3
  333. package/src/components/Toast.tsx +37 -19
  334. package/src/components/WidgetHeader.test.tsx +78 -0
  335. package/src/components/WidgetHeader.tsx +63 -16
  336. package/src/components/feedback-states.test.tsx +98 -9
  337. package/src/components/tone-figures.test.tsx +8 -4
  338. package/src/hooks/index.ts +6 -3
  339. package/src/hooks/tool-result-recovery-model.test.ts +744 -0
  340. package/src/hooks/tool-result-recovery-model.ts +418 -0
  341. package/src/hooks/use-tool-query.effects.test.tsx +205 -0
  342. package/src/hooks/use-tool-query.ts +156 -33
  343. package/src/hooks/use-tool-result-recovery.effects.test.tsx +141 -0
  344. package/src/hooks/use-tool-result-recovery.test.ts +3 -4
  345. package/src/hooks/use-tool-result-recovery.ts +84 -142
  346. package/src/hooks/use-view-data.test.tsx +118 -9
  347. package/src/hooks/use-view-data.ts +128 -18
  348. package/src/hooks/use-view-tool-query.ts +25 -19
  349. package/src/i18n-coverage.test.tsx +104 -2
  350. package/src/index.ts +48 -11
  351. package/src/lib/focus-return.test.ts +288 -0
  352. package/src/lib/focus-return.ts +96 -0
  353. package/src/lib/parse-tool-result.test.ts +46 -1
  354. package/src/lib/parse-tool-result.ts +40 -2
  355. package/src/lib/toast-model.test.ts +166 -1
  356. package/src/lib/toast-model.ts +104 -2
  357. package/src/lib/tone-utils.test.ts +86 -10
  358. package/src/lib/tone-utils.ts +89 -8
  359. package/src/lib/tool-query.test.ts +569 -0
  360. package/src/lib/tool-query.ts +253 -0
  361. package/src/lib/tool-result-observer.test.ts +296 -0
  362. package/src/lib/tool-result-observer.ts +211 -0
  363. package/src/lib/typography.test.ts +45 -0
  364. package/src/lib/typography.ts +47 -0
  365. package/src/lib/utils.ts +12 -1
  366. package/src/locale/index.ts +1 -0
  367. package/src/locale/message-types.ts +118 -2
  368. package/src/locale/messages-de.ts +49 -10
  369. package/src/locale/messages-en.ts +49 -10
  370. package/src/locale/toolkit-messages.test.ts +133 -0
  371. package/src/locale/toolkit-messages.ts +63 -2
  372. package/src/primitives/alert.tsx +3 -0
  373. package/src/primitives/badge.tsx +9 -4
  374. package/src/primitives/button.tsx +1 -1
  375. package/src/primitives/dialog.tsx +10 -1
  376. package/src/primitives/select.tsx +1 -1
  377. package/src/primitives/sheet.tsx +7 -0
  378. package/src/providers/query-provider.test.tsx +154 -0
  379. package/src/providers/query-provider.tsx +66 -5
  380. package/src/render-cases-primitives.tsx +1 -1
  381. package/src/render-cases.tsx +38 -6
  382. package/src/render-effects.tsx +96 -0
  383. package/src/theme/cd-tokens.test.ts +3 -1
  384. package/src/theme/create-theme.test.ts +10 -0
  385. package/src/theme/create-theme.ts +28 -0
  386. package/src/theme/theme-css.test.ts +51 -0
  387. package/src/theme.css +31 -1
  388. package/ui-catalog.json +448 -41
package/ui-catalog.json CHANGED
@@ -46,9 +46,9 @@
46
46
  "props": [
47
47
  {
48
48
  "name": "variant",
49
- "type": "\"default\" | \"secondary\" | \"destructive\" | \"success\" | \"warning\" | \"info\" | \"outline\" | \"ghost\" | \"link\"",
49
+ "type": "\"default\" | \"secondary\" | \"danger\" | \"success\" | \"warning\" | \"info\" | \"outline\" | \"ghost\" | \"link\" | \"destructive\"",
50
50
  "required": false,
51
- "description": "Visual style. Default 'default'. destructive/success/warning/info follow the tone model: tint + foreground text, rim in the tone (TONE_SOFT + TONE_BORDER)."
51
+ "description": "Visual style. Default 'default'. danger/success/warning/info follow the tone model: tint + foreground text, rim in the tone (TONE_SOFT + TONE_BORDER). 'destructive' is the deprecated name of 'danger'."
52
52
  },
53
53
  {
54
54
  "name": "className",
@@ -285,9 +285,9 @@
285
285
  "props": [
286
286
  {
287
287
  "name": "variant",
288
- "type": "\"default\" | \"destructive\"",
288
+ "type": "\"default\" | \"danger\" | \"destructive\"",
289
289
  "required": false,
290
- "description": "Visual style."
290
+ "description": "Visual style. 'danger': tint, rim and icon in the danger colour, foreground text. 'destructive' is its deprecated name. For a failed fetch prefer ErrorState (title, next step, Details, retry)."
291
291
  }
292
292
  ],
293
293
  "whenToUse": "Inline notice or error message inside a widget body."
@@ -396,7 +396,13 @@
396
396
  "name": "cells",
397
397
  "type": "KpiCell[]",
398
398
  "required": true,
399
- "description": "Metric cells flowed as columns (1–6, clamped). Each: { label, value, fraction?, trend?, trendDirection?, tone?, onClick?, ariaLabel? }. A cell with onClick renders as a button (drill into a detail view)."
399
+ "description": "Metric cells: { label, value, fraction?, trend?, trendDirection?: 'up'|'down'|'flat', trendTone?, tone?, onClick?, actionHint? }. Flows 1–6 columns (4+ fall back to 2 in narrow frames). A cell with onClick is a button named by its visible label and value; actionHint ('Opens the incidents dashboard') becomes its aria-describedby. ariaLabel is deprecated (it hides the visible label from voice control, WCAG 2.5.3)."
400
+ },
401
+ {
402
+ "name": "variant",
403
+ "type": "'strip' | 'soft'",
404
+ "required": false,
405
+ "description": "'strip' (default): one bordered strip, tone as a dot next to the label. 'soft': a card per cell in its tone's tint and edge (boxed/header don't apply)."
400
406
  },
401
407
  {
402
408
  "name": "boxed",
@@ -408,10 +414,56 @@
408
414
  "name": "header",
409
415
  "type": "KpiGridHeader",
410
416
  "required": false,
411
- "description": "Group header shown above the strip when boxed: { label, badge? }."
417
+ "description": "Group header above the strip: { label, badge? } (13 px semibold, normal case)."
418
+ },
419
+ {
420
+ "name": "ariaLabel",
421
+ "type": "string",
422
+ "required": false,
423
+ "description": "Names the group of metrics (role=group); omit when a heading right above names it."
424
+ },
425
+ {
426
+ "name": "className",
427
+ "type": "string",
428
+ "required": false,
429
+ "description": "Merged onto the root element."
430
+ }
431
+ ],
432
+ "whenToUse": "Show a row of headline metrics in a widget (replaces the old single-metric KPICard). Pre-format values for locale/currency. Figures stay in the foreground at the page-title size; a cell tone shows as a dot next to its label, a trend as a Lucide direction icon (or a dot with trendTone) next to neutral words. Set onClick + actionHint to make a metric a drill target. Pair with KpiGridSkeleton while loading."
433
+ },
434
+ {
435
+ "name": "KpiGridSkeleton",
436
+ "export": "KpiGridSkeleton",
437
+ "importPath": "@miragon/mcp-toolkit-ui",
438
+ "kind": "component",
439
+ "group": "composed",
440
+ "props": [
441
+ {
442
+ "name": "cells",
443
+ "type": "number",
444
+ "required": true,
445
+ "description": "How many cells the loaded grid will have."
446
+ },
447
+ {
448
+ "name": "variant",
449
+ "type": "'strip' | 'soft'",
450
+ "required": false,
451
+ "description": "The loaded grid's variant. Default 'strip'."
452
+ },
453
+ {
454
+ "name": "boxed",
455
+ "type": "boolean",
456
+ "required": false,
457
+ "description": "The loaded grid's boxed. Default false."
458
+ },
459
+ {
460
+ "name": "className",
461
+ "type": "string",
462
+ "required": false,
463
+ "description": "Merged onto the root element."
412
464
  }
413
465
  ],
414
- "whenToUse": "Show a row of headline metrics in a widget (replaces the old single-metric KPICard). Pre-format values for locale/currency. A cell tone (e.g. 'danger') shows as a status dot next to its label — figures stay in the foreground colour; set onClick to make a metric a drill target."
466
+ "whenToUse": "Loading placeholder with KpiGrid's geometry (same wrapper, grid and cell padding), so the layout doesn't jump when the data arrives. Marked aria-busy."
415
467
  },
416
468
  {
417
469
  "name": "LivePill",
@@ -422,7 +474,7 @@
422
474
  "props": [
423
475
  {
424
476
  "name": "tone",
425
- "type": "ToneVariant",
477
+ "type": "ToneName",
426
478
  "required": false,
427
479
  "description": "Status tone driving the dot, tint and border ('neutral'|'info'|'success'|'warning'|'danger'): tint + foreground text, rim in the tone (TONE_SOFT + TONE_BORDER). Default 'info'."
428
480
  },
@@ -431,6 +483,12 @@
431
483
  "type": "ReactNode",
432
484
  "required": false,
433
485
  "description": "Pill label. Defaults to 'Live'."
486
+ },
487
+ {
488
+ "name": "className",
489
+ "type": "string",
490
+ "required": false,
491
+ "description": "Merged onto the root element."
434
492
  }
435
493
  ],
436
494
  "whenToUse": "Signal live/real-time data in a widget header — a tinted pill with a pulsing dot."
@@ -444,19 +502,53 @@
444
502
  "props": [
445
503
  {
446
504
  "name": "tone",
447
- "type": "ToneVariant",
505
+ "type": "ToneName",
448
506
  "required": false,
449
- "description": "Status tone driving the tint and border: tint + foreground text, rim in the tone (TONE_SOFT + TONE_BORDER); the number never takes a tone colour. Default 'neutral'."
507
+ "description": "Status tone driving the tint and border: tint + foreground text, rim in the tone (TONE_SOFT + TONE_BORDER); the number never takes a tone colour, also on the neutral tint. Default 'neutral'."
450
508
  },
451
509
  {
452
510
  "name": "children",
453
511
  "type": "ReactNode",
454
512
  "required": true,
455
513
  "description": "The count/value (rendered with tabular numbers)."
514
+ },
515
+ {
516
+ "name": "className",
517
+ "type": "string",
518
+ "required": false,
519
+ "description": "Merged onto the root element."
456
520
  }
457
521
  ],
458
522
  "whenToUse": "Right-aligned count indicator on a list/group row (e.g. a per-group item count)."
459
523
  },
524
+ {
525
+ "name": "StatusBadge",
526
+ "export": "StatusBadge",
527
+ "importPath": "@miragon/mcp-toolkit-ui",
528
+ "kind": "component",
529
+ "group": "composed",
530
+ "props": [
531
+ {
532
+ "name": "children",
533
+ "type": "string | number | ReactElement | (string | number | ReactElement)[]",
534
+ "required": true,
535
+ "description": "The state in words ('Suspended', '3 open incidents'). Required: colour is never the only signal."
536
+ },
537
+ {
538
+ "name": "tone",
539
+ "type": "ToneName",
540
+ "required": true,
541
+ "description": "The state's tone: tint, edge and a static dot ('danger'|'warning'|'success'|'info'|'neutral'; retired names map through resolveTone)."
542
+ },
543
+ {
544
+ "name": "className",
545
+ "type": "string",
546
+ "required": false,
547
+ "description": "Merged onto the root element."
548
+ }
549
+ ],
550
+ "whenToUse": "Say a state in words, marked in its tone: a detail-page header (WidgetHeader badge) or a table cell. Foreground text on the tint, never coloured words. For live data use LivePill, for a count CountPill."
551
+ },
460
552
  {
461
553
  "name": "SectionHeading",
462
554
  "export": "SectionHeading",
@@ -499,16 +591,28 @@
499
591
  "description": "The widget title."
500
592
  },
501
593
  {
502
- "name": "icon",
594
+ "name": "as",
595
+ "type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
596
+ "required": false,
597
+ "description": "Heading element. Default 'h1'. Pick the level that keeps one outline per view: below a toolbar title (an h2) use 'h3'. The size follows `size`, not the level."
598
+ },
599
+ {
600
+ "name": "size",
601
+ "type": "'default' | 'detail'",
602
+ "required": false,
603
+ "description": "'default': page title (28 px / 700); 'detail': compact detail-page title (21 px / 600)."
604
+ },
605
+ {
606
+ "name": "badge",
503
607
  "type": "ReactNode",
504
608
  "required": false,
505
- "description": "Icon/glyph rendered in a tinted tile above the title."
609
+ "description": "Above the title: a StatusBadge that says the state in words."
506
610
  },
507
611
  {
508
- "name": "iconTone",
509
- "type": "ToneVariant",
612
+ "name": "titleSuffix",
613
+ "type": "ReactNode",
510
614
  "required": false,
511
- "description": "Tone for the icon tile. Default 'neutral'."
615
+ "description": "Inline after the title inside the heading (e.g. a version chip)."
512
616
  },
513
617
  {
514
618
  "name": "sub",
@@ -521,9 +625,27 @@
521
625
  "type": "ReactNode",
522
626
  "required": false,
523
627
  "description": "Right-aligned actions slot (buttons, drill controls)."
628
+ },
629
+ {
630
+ "name": "icon",
631
+ "type": "ReactNode",
632
+ "required": false,
633
+ "description": "Deprecated: the icon tile above the title is the anti-slop U2 pattern; use badge. Still rendered (aria-hidden)."
634
+ },
635
+ {
636
+ "name": "iconTone",
637
+ "type": "ToneName",
638
+ "required": false,
639
+ "description": "Deprecated: tone of the icon tile."
640
+ },
641
+ {
642
+ "name": "className",
643
+ "type": "string",
644
+ "required": false,
645
+ "description": "Merged onto the root element."
524
646
  }
525
647
  ],
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."
648
+ "whenToUse": "Anchor the top of a widget surface: optional state badge, the title at a configurable heading level, a meta row and an actions slot. Use once per widget; with McpAppView's toolbar title shown, set titleMode='hide' or as='h3' so the view keeps one title and one outline."
527
649
  },
528
650
  {
529
651
  "name": "GroupCard",
@@ -582,7 +704,7 @@
582
704
  "name": "chips",
583
705
  "type": "FilterChip[]",
584
706
  "required": true,
585
- "description": "Toggleable filter chips: { id, label, count?, active? }."
707
+ "description": "Toggle chips: { id, label, count?, active? }. Each is a button with aria-pressed; an active chip is the info tint and edge around foreground text."
586
708
  },
587
709
  {
588
710
  "name": "onChipToggle",
@@ -595,9 +717,27 @@
595
717
  "type": "string",
596
718
  "required": false,
597
719
  "description": "Placeholder for the search input. Default 'Filter…'."
720
+ },
721
+ {
722
+ "name": "searchAriaLabel",
723
+ "type": "string",
724
+ "required": false,
725
+ "description": "Accessible name of the search input. Default: the locale's 'Filter' (a placeholder is no label)."
726
+ },
727
+ {
728
+ "name": "chipsAriaLabel",
729
+ "type": "string",
730
+ "required": false,
731
+ "description": "Names the chip group (role=group). Default: the locale's 'Filters'."
732
+ },
733
+ {
734
+ "name": "className",
735
+ "type": "string",
736
+ "required": false,
737
+ "description": "Merged onto the root element."
598
738
  }
599
739
  ],
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."
740
+ "whenToUse": "Filter a list/table of widget items with a labelled search box + a row of toggle chips (aria-pressed). Pair with useDebouncedValue so a server-side filter only re-queries once typing pauses."
601
741
  },
602
742
  {
603
743
  "name": "DrillButton",
@@ -622,7 +762,7 @@
622
762
  "name": "icon",
623
763
  "type": "ReactNode",
624
764
  "required": false,
625
- "description": "Optional leading glyph; the trailing → is always rendered."
765
+ "description": "Optional leading Lucide icon (decorative, never a typed glyph); the trailing Lucide arrow is always rendered."
626
766
  },
627
767
  {
628
768
  "name": "size",
@@ -634,7 +774,7 @@
634
774
  "name": "ariaLabel",
635
775
  "type": "string",
636
776
  "required": false,
637
- "description": "Accessible label when the visible text is terse."
777
+ "description": "Accessible label when the visible text is terse; keep the visible text in it (WCAG 2.5.3)."
638
778
  }
639
779
  ],
640
780
  "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."
@@ -681,9 +821,73 @@
681
821
  "type": "string",
682
822
  "required": false,
683
823
  "description": "Plural noun for the count, e.g. 'instances'. Default: the locale's word for rows."
824
+ },
825
+ {
826
+ "name": "refreshing",
827
+ "type": "boolean",
828
+ "required": false,
829
+ "description": "A first page is in flight while these rows stay on screen: the status line adds a visible 'Updating…'."
830
+ },
831
+ {
832
+ "name": "stale",
833
+ "type": "boolean",
834
+ "required": false,
835
+ "description": "The rows on screen are the previous result: count and Load more hide, so the old count never reads as the new search's answer."
836
+ },
837
+ {
838
+ "name": "labels",
839
+ "type": "Partial<ListFooterMessages>",
840
+ "required": false,
841
+ "description": "Override strings of the active catalog's listFooter section."
842
+ },
843
+ {
844
+ "name": "announce",
845
+ "type": "boolean",
846
+ "required": false,
847
+ "description": "Make the count line a polite live region (role=status). Default true; false only where the caller announces the count in a live region of its own."
848
+ },
849
+ {
850
+ "name": "className",
851
+ "type": "string",
852
+ "required": false,
853
+ "description": "Merged onto the root element."
854
+ }
855
+ ],
856
+ "whenToUse": "Footer for a paginated list: an honest 'Showing X of Y' total + an explicit 'Load more' (not infinite scroll). The count is a polite live region (role=status), so the new total is announced after Load more or a filter change. At zero rows it shows nothing but keeps the region mounted (visually hidden) with 'No entries', so a search that finds nothing is announced too. Text and number format follow the active locale. For a paged query with failures use PagedListFooter."
857
+ },
858
+ {
859
+ "name": "PagedListFooter",
860
+ "export": "PagedListFooter",
861
+ "importPath": "@miragon/mcp-toolkit-ui",
862
+ "kind": "component",
863
+ "group": "composed",
864
+ "props": [
865
+ {
866
+ "name": "paged",
867
+ "type": "PagedListState",
868
+ "required": true,
869
+ "description": "{ items, total, hasMore, loadMore, loadingMore?, refreshing?, stale?, firstPage?, error?, retry?, loadMoreError? } — a paged-query hook's result passes as is."
870
+ },
871
+ {
872
+ "name": "noun",
873
+ "type": "string",
874
+ "required": false,
875
+ "description": "Plural noun for the count. Default: the locale's word for rows."
876
+ },
877
+ {
878
+ "name": "labels",
879
+ "type": "Partial<ListFooterMessages>",
880
+ "required": false,
881
+ "description": "Override strings of the active catalog's listFooter section."
882
+ },
883
+ {
884
+ "name": "retryLabel",
885
+ "type": "string",
886
+ "required": false,
887
+ "description": "Retry button label of both error lines. Default: the locale's 'Try again'."
684
888
  }
685
889
  ],
686
- "whenToUse": "Footer for a paginated list: an honest 'Showing X of Y' total + an explicit 'Load more' (not infinite scroll). Text and number format follow the active locale."
890
+ "whenToUse": "The tail of a paged list: a failed first page over the previous rows (warning alert, retry re-runs page 0) and a failed load-more (danger alert, retry fetches the next offset) stay apart, each with the raw reason under Details; then the ListFooter with 'Updating…' while page 0 is in flight and no count while the rows are stale."
687
891
  },
688
892
  {
689
893
  "name": "Tone tokens",
@@ -691,9 +895,40 @@
691
895
  "importPath": "@miragon/mcp-toolkit-ui",
692
896
  "kind": "object",
693
897
  "group": "composed",
694
- "parts": ["TONE_SOFT", "TONE_DOT", "TONE_TEXT", "TONE_BORDER", "TONE_ICON"],
898
+ "parts": [
899
+ "TONE_SOFT",
900
+ "TONE_TINT",
901
+ "TONE_DOT",
902
+ "TONE_INK",
903
+ "TONE_TEXT",
904
+ "TONE_BORDER",
905
+ "TONE_ICON"
906
+ ],
695
907
  "props": [],
696
- "whenToUse": "Record<ToneVariant, string> maps from a status tone ('neutral'|'info'|'success'|'warning'|'danger') to Tailwind class strings, three roles per tone (Miragon CI): the colour for fills, dots, borders and icons (TONE_DOT, TONE_BORDER, TONE_ICON), the tint (TONE_SOFT = tint + foreground text, rim in the tone via TONE_BORDER; never put TONE_TEXT/-ink on a tint) and the TEXT colour for a tone's words on a plain surface (TONE_TEXT = the tone's -ink role). Status is never text in its own colour: success and warning ink is the foreground, so show the tone as a dot, icon or border next to the text; figures (counts, KPI values) stay in the foreground. TONE_ICON is for SVG icons only. Use to colour a custom element by status without a tone === 'x' ? ... ternary; the tone-aware components (KpiGrid, LivePill, CountPill, Badge, WidgetHeader) consume these internally."
908
+ "whenToUse": "Record<ToneVariant, string> maps from a status tone ('neutral'|'info'|'success'|'warning'|'danger') to Tailwind class strings, three roles per tone (Miragon CI): the colour for fills, dots, borders and icons (TONE_DOT, TONE_BORDER, TONE_ICON), the tint (TONE_SOFT = tint + foreground text, rim in the tone via TONE_BORDER; TONE_TINT = the tint alone; never put TONE_INK on a tint) and the TEXT colour for a tone's words on a plain surface (TONE_INK = the tone's -ink role; TONE_TEXT is its deprecated name). Status is never text in its own colour: success and warning ink is the foreground, so show the tone as a dot, icon or border next to the text; figures (counts, KPI values) stay in the foreground. TONE_ICON is for SVG icons only. Use to colour a custom element by status without a tone === 'x' ? ... ternary; the tone-aware components (KpiGrid, LivePill, CountPill, StatusBadge, Badge) consume these internally."
909
+ },
910
+ {
911
+ "name": "Tone vocabulary",
912
+ "export": "resolveTone",
913
+ "importPath": "@miragon/mcp-toolkit-ui",
914
+ "kind": "function",
915
+ "group": "composed",
916
+ "parts": ["resolveTone", "isToneVariant", "TONE_VARIANTS", "TONE_ALIASES"],
917
+ "props": [
918
+ {
919
+ "name": "name",
920
+ "type": "unknown",
921
+ "required": true,
922
+ "description": "A tone name, possibly from data: a ToneVariant or a retired alias ('critical', 'error', 'destructive', 'warn', 'ok', …)."
923
+ },
924
+ {
925
+ "name": "fallback",
926
+ "type": "ToneVariant",
927
+ "required": false,
928
+ "description": "The tone for anything unknown. Default 'neutral'."
929
+ }
930
+ ],
931
+ "whenToUse": "ONE tone vocabulary: success | warning | danger | info | neutral (TONE_VARIANTS). resolveTone maps a retired or foreign name onto it (critical/error/destructive → danger; one red, one amber) and anything unknown onto the fallback, so a tone that arrives as data never renders colourless; isToneVariant is the type guard. The props typed ToneName resolve it this way (KpiCell tone/trendTone, LivePill, StatusBadge, CountPill, WidgetHeader iconTone). Toast, ErrorState and EmptyState keep their own tone subset in the types; an untyped name still resolves at runtime and anything outside the subset gets their default. Badge/Alert variants are cva keys: pass a resolved tone."
697
932
  },
698
933
  {
699
934
  "name": "ToastProvider",
@@ -709,7 +944,7 @@
709
944
  "description": "Subtree that raises toasts via useToast."
710
945
  }
711
946
  ],
712
- "whenToUse": "Provide toasts to a subtree and render their stack: bottom centre, status colour as left edge + icon next to plain text, ONE persistent live region (role=status, aria-live=polite), auto-dismiss after 2.8 s (errors 5 s), held while hovered or focused. Idempotent when nested. McpAppView mounts one, so widgets inside a view only call useToast. Toast icons follow the LucideProvider around the outermost ToastProvider (stroke 2.5 inside McpAppView)."
947
+ "whenToUse": "Provide toasts to a subtree and render their stack: bottom centre, status colour as left edge + icon next to plain text, ONE persistent live region (aria-live=polite, fixed attributes: no role or name, so the first toast is announced; tests find it by data-slot=toast-viewport), toast text at 16 px, auto-dismiss after 2.8 s (errors 5 s), held while hovered or focused. Idempotent when nested. McpAppView mounts one, so widgets inside a view only call useToast. Toast icons follow the LucideProvider around the outermost ToastProvider (stroke 2.5 inside McpAppView)."
713
948
  },
714
949
  {
715
950
  "name": "useToast",
@@ -873,9 +1108,9 @@
873
1108
  "props": [
874
1109
  {
875
1110
  "name": "queryKey",
876
- "type": "unknown[]",
1111
+ "type": "readonly unknown[]",
877
1112
  "required": true,
878
- "description": "Cache key. args is appended automatically so callers with different args get separate cache entries."
1113
+ "description": "Cache key prefix. The effective key is [...queryKey, args] (toolQueryKey): different args get separate entries. Two tools must not share a key and args (the hook warns when they do), unless AppQueryProvider / McpAppView toolNameInQueryKey puts the tool name into the key ([...queryKey, toolName, args])."
879
1114
  },
880
1115
  {
881
1116
  "name": "toolName",
@@ -891,12 +1126,12 @@
891
1126
  },
892
1127
  {
893
1128
  "name": "opts",
894
- "type": "{ enabled?: boolean; select?: (data) => selected }",
1129
+ "type": "UseToolQueryOptions<TData, TSelected>",
895
1130
  "required": false,
896
- "description": "Gate the query / transform data on read."
1131
+ "description": "TanStack query options (retry, retryDelay, staleTime, placeholderData / keepPreviousData, initialData + initialDataUpdatedAt, enabled, select, gcTime, …) — everything but queryKey/queryFn. retry defaults to the client's; retry: shouldRetryToolCall stops retrying a tool's own isError answer."
897
1132
  }
898
1133
  ],
899
- "whenToUse": "Self-fetch arbitrary data from a tool inside a cockpit-embedded widget. Result is decoded with parseToolResult (structured-first). Returns a TanStack UseQueryResult."
1134
+ "whenToUse": "Self-fetch arbitrary data from a tool inside a cockpit-embedded widget. Result is decoded with parseToolResult (structured-first). Returns a TanStack UseQueryResult (data, error, refetch, failureCount, failureReason, isFetching, isPlaceholderData, …). The tool goes through AppQueryProvider's callTool, else the nearest HostBridgeProvider; with neither the query fails with a 'no tool transport' error instead of idling, and fetches once a transport arrives. Keep a list on screen while a new search loads: { placeholderData: keepPreviousData }."
900
1135
  },
901
1136
  {
902
1137
  "name": "useToolMutation",
@@ -913,12 +1148,105 @@
913
1148
  },
914
1149
  {
915
1150
  "name": "opts",
916
- "type": "{ invalidateKeys?: unknown[][] }",
1151
+ "type": "UseToolMutationOptions<TData>",
1152
+ "required": false,
1153
+ "description": "TanStack mutation options (onSuccess, onError, onSettled, retry, meta, mutationKey, …) plus invalidateKeys: query-key prefixes to invalidate after each successful call (active queries refetch, inactive ones turn stale)."
1154
+ }
1155
+ ],
1156
+ "whenToUse": "Run a write/action tool (e.g. retry-incident) and invalidate dependent queries. Returns a TanStack UseMutationResult; call .mutate(args, { onSuccess, onError, onSettled }). Unlike TanStack's own mutate, the per-call callbacks fire for EVERY call while the widget is mounted, so two quick calls each get their confirmation."
1157
+ },
1158
+ {
1159
+ "name": "toolQueryKey",
1160
+ "export": "toolQueryKey",
1161
+ "importPath": "@miragon/mcp-toolkit-ui",
1162
+ "kind": "function",
1163
+ "group": "data-hooks",
1164
+ "props": [
1165
+ {
1166
+ "name": "queryKey",
1167
+ "type": "readonly unknown[]",
1168
+ "required": true,
1169
+ "description": "The caller's key prefix."
1170
+ },
1171
+ {
1172
+ "name": "toolName",
1173
+ "type": "string",
1174
+ "required": true,
1175
+ "description": "The tool the query calls."
1176
+ },
1177
+ {
1178
+ "name": "args",
1179
+ "type": "object",
1180
+ "required": true,
1181
+ "description": "The tool arguments."
1182
+ },
1183
+ {
1184
+ "name": "toolNameInKey",
1185
+ "type": "boolean",
917
1186
  "required": false,
918
- "description": "Query keys to refetch on success."
1187
+ "description": "Put the tool name between the key and the args ([...queryKey, toolName, args]). Default false (the 2.x key); the default from the next major."
1188
+ }
1189
+ ],
1190
+ "whenToUse": "Build the exact cache key useToolQuery / useViewToolQuery / useViewData use for getQueryData, setQueryData or cancelQueries with exact: true, never by hand. Pass toolNameInKey when the provider sets toolNameInQueryKey, or use useToolQueryKey, which reads it. Prefix invalidation needs only your queryKey."
1191
+ },
1192
+ {
1193
+ "name": "useToolQueryKey",
1194
+ "export": "useToolQueryKey",
1195
+ "importPath": "@miragon/mcp-toolkit-ui",
1196
+ "kind": "hook",
1197
+ "group": "data-hooks",
1198
+ "props": [
1199
+ {
1200
+ "name": "queryKey",
1201
+ "type": "readonly unknown[]",
1202
+ "required": true,
1203
+ "description": "The caller's key prefix, as passed to useToolQuery."
1204
+ },
1205
+ {
1206
+ "name": "toolName",
1207
+ "type": "string",
1208
+ "required": true,
1209
+ "description": "The tool the query calls."
1210
+ },
1211
+ {
1212
+ "name": "args",
1213
+ "type": "object",
1214
+ "required": true,
1215
+ "description": "The tool arguments."
1216
+ }
1217
+ ],
1218
+ "whenToUse": "The exact cache key the data hooks use for this tool and args under the nearest AppQueryProvider (toolQueryKey with its toolNameInQueryKey setting), for getQueryData, setQueryData or cancelQueries with exact: true, e.g. for an optimistic update in a mutation's onMutate. Stays right when the next major puts the tool name into every key."
1219
+ },
1220
+ {
1221
+ "name": "shouldRetryToolCall",
1222
+ "export": "shouldRetryToolCall",
1223
+ "importPath": "@miragon/mcp-toolkit-ui",
1224
+ "kind": "function",
1225
+ "group": "data-hooks",
1226
+ "props": [
1227
+ {
1228
+ "name": "failureCount",
1229
+ "type": "number",
1230
+ "required": true,
1231
+ "description": "Failed attempts so far."
1232
+ },
1233
+ {
1234
+ "name": "error",
1235
+ "type": "unknown",
1236
+ "required": true,
1237
+ "description": "The last failure."
919
1238
  }
920
1239
  ],
921
- "whenToUse": "Run a write/action tool (e.g. retry-incident) and refetch dependent queries. Returns a TanStack UseMutationResult; call .mutate(args)."
1240
+ "whenToUse": "An opt-in retry policy for tool queries: no retry for a tool's own isError answer (isToolError) or a missing transport, up to 3 retries for a failed transport, so a deterministic tool error shows at once instead of after ~7 s. Pass retry: shouldRetryToolCall to a hook, or set it as the client's default. The hooks keep the client's retry by default."
1241
+ },
1242
+ {
1243
+ "name": "keepPreviousData",
1244
+ "export": "keepPreviousData",
1245
+ "importPath": "@miragon/mcp-toolkit-ui",
1246
+ "kind": "function",
1247
+ "group": "data-hooks",
1248
+ "props": [],
1249
+ "whenToUse": "TanStack's placeholder helper, re-exported so no direct @tanstack/react-query import is needed: { placeholderData: keepPreviousData } keeps the previous args' answer on screen (isPlaceholderData: true) while a changed search or filter loads — a list never unmounts mid-typing."
922
1250
  },
923
1251
  {
924
1252
  "name": "useViewToolQuery",
@@ -931,7 +1259,7 @@
931
1259
  "name": "queryKey",
932
1260
  "type": "unknown[]",
933
1261
  "required": true,
934
- "description": "Cache key; args appended automatically (sibling widgets dedupe)."
1262
+ "description": "Cache key prefix; the effective key is [...queryKey, args] (sibling widgets with equal args dedupe)."
935
1263
  },
936
1264
  {
937
1265
  "name": "toolName",
@@ -947,9 +1275,9 @@
947
1275
  },
948
1276
  {
949
1277
  "name": "opts",
950
- "type": "{ enabled?: boolean }",
1278
+ "type": "UseViewToolQueryOptions<T>",
951
1279
  "required": false,
952
- "description": "Gate the query."
1280
+ "description": "TanStack query options (retry, retryDelay, staleTime, placeholderData / keepPreviousData, initialData + initialDataUpdatedAt, enabled, select, gcTime, …) — everything but queryKey/queryFn, as useToolQuery."
953
1281
  }
954
1282
  ],
955
1283
  "whenToUse": "Self-fetch from a *_show_* widget tool. Unwraps the McpAppView view envelope via parseViewToolResult (single-step → flat data, multi-step → keyed by step id) — the envelope-aware sibling of useToolQuery."
@@ -965,7 +1293,7 @@
965
1293
  "name": "initialData",
966
1294
  "type": "T | null | undefined",
967
1295
  "required": true,
968
- "description": "Host-pushed data (e.g. from adaptDataWidget). Returned verbatim when present."
1296
+ "description": "Host-pushed data (e.g. from adaptDataWidget). Returned verbatim by default; with initialDataMode 'seed' it becomes the feed query's cached answer."
969
1297
  },
970
1298
  {
971
1299
  "name": "key",
@@ -989,10 +1317,16 @@
989
1317
  "name": "ready",
990
1318
  "type": "boolean",
991
1319
  "required": true,
992
- "description": "Whether the required id/key is present; fetch is disabled until ready and only when no initialData."
1320
+ "description": "Whether the required id/key is present; the feed stays off until ready (and, by default, while initialData is present)."
1321
+ },
1322
+ {
1323
+ "name": "options",
1324
+ "type": "UseViewDataOptions<T>",
1325
+ "required": false,
1326
+ "description": "TanStack query options (retry, retryDelay, staleTime, placeholderData / keepPreviousData, initialDataUpdatedAt, enabled, gcTime, …) — everything but queryKey/queryFn; enabled (a boolean or a function of the query) is an extra gate next to ready, and a closed gate is not loading. initialDataMode: 'static' (default) or 'seed' — seed keeps the feed live over host data, so a write's invalidation, a refetch or a retry re-reads it."
993
1327
  }
994
1328
  ],
995
- "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, refetch }; pass refetch as the error state's retry (<ErrorState onRetry={refetch} />)."
1329
+ "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, refetch, failureCount, failureReason, isFetching, isPlaceholderData }; pass refetch as the error state's retry (<ErrorState onRetry={refetch} />). Pass { initialDataMode: 'seed' } when a standalone view must stay live after writes, { placeholderData: keepPreviousData } to keep rows on screen while new args load."
996
1330
  },
997
1331
  {
998
1332
  "name": "useIsMobile",
@@ -1157,12 +1491,28 @@
1157
1491
  {
1158
1492
  "name": "children",
1159
1493
  "type": "ReactNode",
1160
- "required": true,
1161
- "description": "The widget subtree the description belongs to."
1494
+ "required": false,
1495
+ "description": "The widget subtree the description belongs to (nested below it). Omit it to report one line where it renders."
1162
1496
  }
1163
1497
  ],
1164
1498
  "whenToUse": "Report model context from a widget that self-fetches (cockpit views) — the host-portable replacement for mcp-use/react's ModelContext. Inside an mcp-use view it renders the native aggregating ModelContext; in every other mount (widget playground, ChatGPT, standalone) it routes through the HostBridge's setModelContext. NEVER import ModelContext from mcp-use/react in a widget: it throws outside a bootstrapView mount."
1165
1499
  },
1500
+ {
1501
+ "name": "useHostModelContext",
1502
+ "export": "useHostModelContext",
1503
+ "importPath": "@miragon/mcp-toolkit-ui/app",
1504
+ "kind": "hook",
1505
+ "group": "widget-authoring",
1506
+ "props": [
1507
+ {
1508
+ "name": "content",
1509
+ "type": "string | null | undefined",
1510
+ "required": true,
1511
+ "description": "One line for the model; blank or null reports nothing."
1512
+ }
1513
+ ],
1514
+ "whenToUse": "Report one line of model context from a component with nothing to wrap (a selection, a filter, an error the user sees) for as long as it is mounted. Inside an mcp-use view the line joins the view's one model-context tree with every HostModelContext and leaves it on unmount; elsewhere it goes through the HostBridge's setModelContext."
1515
+ },
1166
1516
  {
1167
1517
  "name": "DescribeForModel",
1168
1518
  "export": "DescribeForModel",
@@ -1201,6 +1551,44 @@
1201
1551
  ],
1202
1552
  "whenToUse": "Decode a raw callTool result to its data payload. Structured-first: isError → throw, then structuredContent, then JSON-decoded text, then raw. useToolQuery decodes through this for you."
1203
1553
  },
1554
+ {
1555
+ "name": "ToolResultError",
1556
+ "export": "ToolResultError",
1557
+ "importPath": "@miragon/mcp-toolkit-ui",
1558
+ "kind": "function",
1559
+ "group": "widget-authoring",
1560
+ "props": [
1561
+ {
1562
+ "name": "message",
1563
+ "type": "string",
1564
+ "required": true,
1565
+ "description": "The tool's first text block."
1566
+ },
1567
+ {
1568
+ "name": "result",
1569
+ "type": "unknown",
1570
+ "required": true,
1571
+ "description": "The isError result as the tool returned it."
1572
+ }
1573
+ ],
1574
+ "whenToUse": "The Error class parseToolResult throws for an isError result — a deterministic answer of the tool (validation error, engine 404), not a transport failure. The query hooks retry it like any failure by default (the client's retry); pass retry: shouldRetryToolCall to stop that. Check with isToolError (also matches mcp-use's ToolError)."
1575
+ },
1576
+ {
1577
+ "name": "isToolError",
1578
+ "export": "isToolError",
1579
+ "importPath": "@miragon/mcp-toolkit-ui",
1580
+ "kind": "function",
1581
+ "group": "widget-authoring",
1582
+ "props": [
1583
+ {
1584
+ "name": "error",
1585
+ "type": "unknown",
1586
+ "required": true,
1587
+ "description": "Anything a tool call rejected with."
1588
+ }
1589
+ ],
1590
+ "whenToUse": "Tell a tool's own isError answer (ToolResultError, or mcp-use's ToolError inside a view) from a transport failure — e.g. in a custom retry policy or to word an error state."
1591
+ },
1204
1592
  {
1205
1593
  "name": "parseViewToolResult",
1206
1594
  "export": "parseViewToolResult",
@@ -1425,6 +1813,16 @@
1425
1813
  "props": [],
1426
1814
  "whenToUse": "The kit's opaque focus ring as a class string (2px ring in --focus with an offset; FOCUS_RING_INSET draws it inside, for cells flush with a container edge). Spread it into a custom control's className so keyboard focus reads the same everywhere (3:1 or more in both modes)."
1427
1815
  },
1816
+ {
1817
+ "name": "Type scale",
1818
+ "export": "TYPE_SCALE",
1819
+ "importPath": "@miragon/mcp-toolkit-ui",
1820
+ "kind": "object",
1821
+ "group": "widget-authoring",
1822
+ "parts": ["TYPE_SCALE", "TYPE_STEPS", "TYPE_FLOOR_PX", "MICRO_LABEL"],
1823
+ "props": [],
1824
+ "whenToUse": "The CI type scale as role tokens and utilities: text-title (28/700, page title), text-section (21/600), text-body (16/400/1.6, running text incl. state and toast descriptions), text-dense (14, dense tables and controls such as inputs, chips, count pills and the inline alert box; never running text), text-small (13, the floor: captions, hints, meta rows). Nothing renders below 13 px: no text-xs, no text-[10px]; a former 10–11 px uppercase caption is MICRO_LABEL (13 px semibold, normal case). Combine with the kit's cn (plain tailwind-merge drops text-small next to a text colour). Brands resize via --text-* (ThemeTokens textTitle … textSmall)."
1825
+ },
1428
1826
  {
1429
1827
  "name": "LocaleProvider",
1430
1828
  "export": "LocaleProvider",
@@ -1583,6 +1981,15 @@
1583
1981
  ],
1584
1982
  "whenToUse": "The bundle entry point since mcp-use 2.x: mounts McpToolkitApp via bootstrapView (ext-apps handshake, error boundary, auto-resize). Call it once in main.tsx instead of createRoot().render()."
1585
1983
  },
1984
+ {
1985
+ "name": "installToolResultObserver",
1986
+ "export": "installToolResultObserver",
1987
+ "importPath": "@miragon/mcp-toolkit-ui/app",
1988
+ "kind": "function",
1989
+ "group": "app-shell",
1990
+ "props": [],
1991
+ "whenToUse": "Only for a custom shell under its own bootstrapView: call it before bootstrapView so McpAppView can tell a stripped tool result (claude.ai) from a slow tool and never re-runs a call the host is still answering. mountMcpToolkitApp and the bundle's first evaluation install it already; idempotent, null outside a framed browser document."
1992
+ },
1586
1993
  {
1587
1994
  "name": "WidgetFixtureHost",
1588
1995
  "export": "WidgetFixtureHost",
@@ -1618,7 +2025,7 @@
1618
2025
  "name": "globals",
1619
2026
  "type": "Record<string, unknown>",
1620
2027
  "required": false,
1621
- "description": "Host-context overrides (theme, displayMode, locale...)."
2028
+ "description": "Host context: theme (reported on the HostBridge) and locale (the toolkit's own strings and number format, as under McpAppView). Other keys are accepted for compatibility."
1622
2029
  },
1623
2030
  {
1624
2031
  "name": "onModelContext",