@miragon/mcp-toolkit-ui 2.5.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/README.md +8 -2
  2. package/dist/app/builder/BuilderBanners.d.ts +7 -2
  3. package/dist/app/builder/BuilderBanners.d.ts.map +1 -1
  4. package/dist/app/builder/BuilderBanners.js +8 -3
  5. package/dist/app/builder/BuilderBanners.js.map +1 -1
  6. package/dist/app/builder/CanvasRow.d.ts.map +1 -1
  7. package/dist/app/builder/CanvasRow.js +12 -14
  8. package/dist/app/builder/CanvasRow.js.map +1 -1
  9. package/dist/app/builder/CatalogueSheet.d.ts.map +1 -1
  10. package/dist/app/builder/CatalogueSheet.js +6 -5
  11. package/dist/app/builder/CatalogueSheet.js.map +1 -1
  12. package/dist/app/builder/EmptyHint.d.ts +4 -0
  13. package/dist/app/builder/EmptyHint.d.ts.map +1 -1
  14. package/dist/app/builder/EmptyHint.js +6 -1
  15. package/dist/app/builder/EmptyHint.js.map +1 -1
  16. package/dist/app/builder/LayoutSurface.js +3 -3
  17. package/dist/app/builder/LayoutSurface.js.map +1 -1
  18. package/dist/app/builder/PipelineStrip.d.ts +3 -1
  19. package/dist/app/builder/PipelineStrip.d.ts.map +1 -1
  20. package/dist/app/builder/PipelineStrip.js +11 -6
  21. package/dist/app/builder/PipelineStrip.js.map +1 -1
  22. package/dist/app/builder/SaveDialog.d.ts.map +1 -1
  23. package/dist/app/builder/SaveDialog.js +2 -2
  24. package/dist/app/builder/SaveDialog.js.map +1 -1
  25. package/dist/app/builder/Toolbar.d.ts +3 -1
  26. package/dist/app/builder/Toolbar.d.ts.map +1 -1
  27. package/dist/app/builder/Toolbar.js +9 -3
  28. package/dist/app/builder/Toolbar.js.map +1 -1
  29. package/dist/app/builder/Workspace.js +2 -2
  30. package/dist/app/builder/Workspace.js.map +1 -1
  31. package/dist/app/builder/builder-model.d.ts +3 -2
  32. package/dist/app/builder/builder-model.d.ts.map +1 -1
  33. package/dist/app/builder/builder-model.js +5 -4
  34. package/dist/app/builder/builder-model.js.map +1 -1
  35. package/dist/app/builder/labels.d.ts +13 -62
  36. package/dist/app/builder/labels.d.ts.map +1 -1
  37. package/dist/app/builder/labels.js +9 -58
  38. package/dist/app/builder/labels.js.map +1 -1
  39. package/dist/app/builder/status-chip.d.ts.map +1 -1
  40. package/dist/app/builder/status-chip.js +3 -2
  41. package/dist/app/builder/status-chip.js.map +1 -1
  42. package/dist/app/builder/use-builder-catalogue.d.ts +1 -0
  43. package/dist/app/builder/use-builder-catalogue.d.ts.map +1 -1
  44. package/dist/app/builder/use-builder-catalogue.js +6 -0
  45. package/dist/app/builder/use-builder-catalogue.js.map +1 -1
  46. package/dist/app/builder/use-save-dashboard.d.ts +3 -1
  47. package/dist/app/builder/use-save-dashboard.d.ts.map +1 -1
  48. package/dist/app/builder/use-save-dashboard.js +3 -1
  49. package/dist/app/builder/use-save-dashboard.js.map +1 -1
  50. package/dist/app/index.d.ts +1 -1
  51. package/dist/app/index.d.ts.map +1 -1
  52. package/dist/app/index.js.map +1 -1
  53. package/dist/app/layout-builder.d.ts +7 -2
  54. package/dist/app/layout-builder.d.ts.map +1 -1
  55. package/dist/app/layout-builder.js +17 -5
  56. package/dist/app/layout-builder.js.map +1 -1
  57. package/dist/app/mcp-app-view-chrome.d.ts +94 -20
  58. package/dist/app/mcp-app-view-chrome.d.ts.map +1 -1
  59. package/dist/app/mcp-app-view-chrome.js +109 -40
  60. package/dist/app/mcp-app-view-chrome.js.map +1 -1
  61. package/dist/app/mcp-app-view-states.d.ts +15 -0
  62. package/dist/app/mcp-app-view-states.d.ts.map +1 -0
  63. package/dist/app/mcp-app-view-states.js +34 -0
  64. package/dist/app/mcp-app-view-states.js.map +1 -0
  65. package/dist/app/mcp-app-view.d.ts +40 -5
  66. package/dist/app/mcp-app-view.d.ts.map +1 -1
  67. package/dist/app/mcp-app-view.js +174 -128
  68. package/dist/app/mcp-app-view.js.map +1 -1
  69. package/dist/app/mcp-toolkit-app.d.ts +2 -1
  70. package/dist/app/mcp-toolkit-app.d.ts.map +1 -1
  71. package/dist/app/mcp-toolkit-app.js +25 -3
  72. package/dist/app/mcp-toolkit-app.js.map +1 -1
  73. package/dist/app/use-view-lifecycle.d.ts +38 -0
  74. package/dist/app/use-view-lifecycle.d.ts.map +1 -0
  75. package/dist/app/use-view-lifecycle.js +79 -0
  76. package/dist/app/use-view-lifecycle.js.map +1 -0
  77. package/dist/app/view-lifecycle.d.ts +109 -0
  78. package/dist/app/view-lifecycle.d.ts.map +1 -0
  79. package/dist/app/view-lifecycle.js +120 -0
  80. package/dist/app/view-lifecycle.js.map +1 -0
  81. package/dist/app/widget-props-sheet.d.ts +3 -9
  82. package/dist/app/widget-props-sheet.d.ts.map +1 -1
  83. package/dist/app/widget-props-sheet.js +6 -13
  84. package/dist/app/widget-props-sheet.js.map +1 -1
  85. package/dist/app/widget-renderer.d.ts +41 -1
  86. package/dist/app/widget-renderer.d.ts.map +1 -1
  87. package/dist/app/widget-renderer.js +82 -31
  88. package/dist/app/widget-renderer.js.map +1 -1
  89. package/dist/components/DrillButton.d.ts.map +1 -1
  90. package/dist/components/DrillButton.js +2 -1
  91. package/dist/components/DrillButton.js.map +1 -1
  92. package/dist/components/EmptyState.d.ts +33 -0
  93. package/dist/components/EmptyState.d.ts.map +1 -0
  94. package/dist/components/EmptyState.js +17 -0
  95. package/dist/components/EmptyState.js.map +1 -0
  96. package/dist/components/ErrorState.d.ts +50 -0
  97. package/dist/components/ErrorState.d.ts.map +1 -0
  98. package/dist/components/ErrorState.js +60 -0
  99. package/dist/components/ErrorState.js.map +1 -0
  100. package/dist/components/FilterBar.d.ts +1 -1
  101. package/dist/components/FilterBar.d.ts.map +1 -1
  102. package/dist/components/FilterBar.js +7 -4
  103. package/dist/components/FilterBar.js.map +1 -1
  104. package/dist/components/GroupCard.d.ts.map +1 -1
  105. package/dist/components/GroupCard.js +2 -1
  106. package/dist/components/GroupCard.js.map +1 -1
  107. package/dist/components/KpiGrid.d.ts +10 -3
  108. package/dist/components/KpiGrid.d.ts.map +1 -1
  109. package/dist/components/KpiGrid.js +31 -9
  110. package/dist/components/KpiGrid.js.map +1 -1
  111. package/dist/components/ListFooter.d.ts +3 -2
  112. package/dist/components/ListFooter.d.ts.map +1 -1
  113. package/dist/components/ListFooter.js +14 -4
  114. package/dist/components/ListFooter.js.map +1 -1
  115. package/dist/components/Pills.d.ts +10 -6
  116. package/dist/components/Pills.d.ts.map +1 -1
  117. package/dist/components/Pills.js +12 -6
  118. package/dist/components/Pills.js.map +1 -1
  119. package/dist/components/Toast.d.ts +37 -0
  120. package/dist/components/Toast.d.ts.map +1 -0
  121. package/dist/components/Toast.js +91 -0
  122. package/dist/components/Toast.js.map +1 -0
  123. package/dist/components/WidgetHeader.js +1 -1
  124. package/dist/hooks/use-tool-result-recovery.d.ts +23 -1
  125. package/dist/hooks/use-tool-result-recovery.d.ts.map +1 -1
  126. package/dist/hooks/use-tool-result-recovery.js +21 -7
  127. package/dist/hooks/use-tool-result-recovery.js.map +1 -1
  128. package/dist/hooks/use-view-data.d.ts +6 -0
  129. package/dist/hooks/use-view-data.d.ts.map +1 -1
  130. package/dist/hooks/use-view-data.js +6 -1
  131. package/dist/hooks/use-view-data.js.map +1 -1
  132. package/dist/index.d.ts +12 -5
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +14 -4
  135. package/dist/index.js.map +1 -1
  136. package/dist/lib/focus-ring.d.ts +18 -0
  137. package/dist/lib/focus-ring.d.ts.map +1 -0
  138. package/dist/lib/focus-ring.js +18 -0
  139. package/dist/lib/focus-ring.js.map +1 -0
  140. package/dist/lib/icon-stroke.d.ts +12 -0
  141. package/dist/lib/icon-stroke.d.ts.map +1 -0
  142. package/dist/lib/icon-stroke.js +12 -0
  143. package/dist/lib/icon-stroke.js.map +1 -0
  144. package/dist/lib/toast-model.d.ts +46 -0
  145. package/dist/lib/toast-model.d.ts.map +1 -0
  146. package/dist/lib/toast-model.js +36 -0
  147. package/dist/lib/toast-model.js.map +1 -0
  148. package/dist/lib/tone-utils.d.ts +43 -9
  149. package/dist/lib/tone-utils.d.ts.map +1 -1
  150. package/dist/lib/tone-utils.js +36 -7
  151. package/dist/lib/tone-utils.js.map +1 -1
  152. package/dist/locale/index.d.ts +3 -1
  153. package/dist/locale/index.d.ts.map +1 -1
  154. package/dist/locale/index.js +2 -1
  155. package/dist/locale/index.js.map +1 -1
  156. package/dist/locale/locale-provider.d.ts +42 -1
  157. package/dist/locale/locale-provider.d.ts.map +1 -1
  158. package/dist/locale/locale-provider.js +44 -3
  159. package/dist/locale/locale-provider.js.map +1 -1
  160. package/dist/locale/message-types.d.ts +223 -0
  161. package/dist/locale/message-types.d.ts.map +1 -0
  162. package/dist/locale/message-types.js +7 -0
  163. package/dist/locale/message-types.js.map +1 -0
  164. package/dist/locale/messages-de.d.ts +9 -0
  165. package/dist/locale/messages-de.d.ts.map +1 -0
  166. package/dist/locale/messages-de.js +151 -0
  167. package/dist/locale/messages-de.js.map +1 -0
  168. package/dist/locale/messages-en.d.ts +8 -0
  169. package/dist/locale/messages-en.d.ts.map +1 -0
  170. package/dist/locale/messages-en.js +150 -0
  171. package/dist/locale/messages-en.js.map +1 -0
  172. package/dist/locale/toolkit-messages.d.ts +39 -0
  173. package/dist/locale/toolkit-messages.d.ts.map +1 -0
  174. package/dist/locale/toolkit-messages.js +50 -0
  175. package/dist/locale/toolkit-messages.js.map +1 -0
  176. package/dist/primitives/alert.d.ts.map +1 -1
  177. package/dist/primitives/alert.js +4 -2
  178. package/dist/primitives/alert.js.map +1 -1
  179. package/dist/primitives/badge.d.ts +1 -1
  180. package/dist/primitives/badge.d.ts.map +1 -1
  181. package/dist/primitives/badge.js +14 -6
  182. package/dist/primitives/badge.js.map +1 -1
  183. package/dist/primitives/button.d.ts.map +1 -1
  184. package/dist/primitives/button.js +12 -8
  185. package/dist/primitives/button.js.map +1 -1
  186. package/dist/primitives/card.js +4 -4
  187. package/dist/primitives/card.js.map +1 -1
  188. package/dist/primitives/dialog.d.ts +7 -3
  189. package/dist/primitives/dialog.d.ts.map +1 -1
  190. package/dist/primitives/dialog.js +14 -7
  191. package/dist/primitives/dialog.js.map +1 -1
  192. package/dist/primitives/input.d.ts.map +1 -1
  193. package/dist/primitives/input.js +4 -1
  194. package/dist/primitives/input.js.map +1 -1
  195. package/dist/primitives/scroll-area.js +1 -1
  196. package/dist/primitives/scroll-area.js.map +1 -1
  197. package/dist/primitives/select.d.ts.map +1 -1
  198. package/dist/primitives/select.js +5 -2
  199. package/dist/primitives/select.js.map +1 -1
  200. package/dist/primitives/sheet.d.ts +3 -1
  201. package/dist/primitives/sheet.d.ts.map +1 -1
  202. package/dist/primitives/sheet.js +12 -6
  203. package/dist/primitives/sheet.js.map +1 -1
  204. package/dist/primitives/skeleton.js +1 -1
  205. package/dist/primitives/skeleton.js.map +1 -1
  206. package/dist/primitives/switch.d.ts.map +1 -1
  207. package/dist/primitives/switch.js +2 -1
  208. package/dist/primitives/switch.js.map +1 -1
  209. package/dist/primitives/tabs.d.ts.map +1 -1
  210. package/dist/primitives/tabs.js +5 -3
  211. package/dist/primitives/tabs.js.map +1 -1
  212. package/dist/render-cases.d.ts.map +1 -1
  213. package/dist/render-cases.js +20 -2
  214. package/dist/render-cases.js.map +1 -1
  215. package/dist/render-scan.d.ts +25 -0
  216. package/dist/render-scan.d.ts.map +1 -0
  217. package/dist/render-scan.js +66 -0
  218. package/dist/render-scan.js.map +1 -0
  219. package/dist/theme/cd-tokens.d.ts +66 -0
  220. package/dist/theme/cd-tokens.d.ts.map +1 -0
  221. package/dist/theme/cd-tokens.js +64 -0
  222. package/dist/theme/cd-tokens.js.map +1 -0
  223. package/dist/theme/create-theme.d.ts +196 -39
  224. package/dist/theme/create-theme.d.ts.map +1 -1
  225. package/dist/theme/create-theme.js +189 -13
  226. package/dist/theme/create-theme.js.map +1 -1
  227. package/dist/theme/fonts.d.ts +38 -0
  228. package/dist/theme/fonts.d.ts.map +1 -0
  229. package/dist/theme/fonts.js +56 -0
  230. package/dist/theme/fonts.js.map +1 -0
  231. package/dist/theme/host-fonts.d.ts +39 -0
  232. package/dist/theme/host-fonts.d.ts.map +1 -0
  233. package/dist/theme/host-fonts.js +44 -0
  234. package/dist/theme/host-fonts.js.map +1 -0
  235. package/dist/theme/index.d.ts +8 -1
  236. package/dist/theme/index.d.ts.map +1 -1
  237. package/dist/theme/index.js +5 -1
  238. package/dist/theme/index.js.map +1 -1
  239. package/dist/theme/portal-container.d.ts +16 -0
  240. package/dist/theme/portal-container.d.ts.map +1 -0
  241. package/dist/theme/portal-container.js +19 -0
  242. package/dist/theme/portal-container.js.map +1 -0
  243. package/dist/theme/presets.d.ts +24 -9
  244. package/dist/theme/presets.d.ts.map +1 -1
  245. package/dist/theme/presets.js +44 -11
  246. package/dist/theme/presets.js.map +1 -1
  247. package/dist/theme/theme-provider.d.ts +27 -9
  248. package/dist/theme/theme-provider.d.ts.map +1 -1
  249. package/dist/theme/theme-provider.js +42 -20
  250. package/dist/theme/theme-provider.js.map +1 -1
  251. package/package.json +13 -8
  252. package/src/app/builder/BuilderBanners.tsx +26 -13
  253. package/src/app/builder/CanvasRow.tsx +22 -21
  254. package/src/app/builder/CatalogueSheet.tsx +16 -14
  255. package/src/app/builder/EmptyHint.tsx +16 -11
  256. package/src/app/builder/LayoutSurface.tsx +7 -7
  257. package/src/app/builder/PipelineStrip.tsx +26 -17
  258. package/src/app/builder/SaveDialog.tsx +11 -12
  259. package/src/app/builder/Toolbar.tsx +19 -7
  260. package/src/app/builder/Workspace.tsx +5 -3
  261. package/src/app/builder/builder-feedback.test.tsx +75 -0
  262. package/src/app/builder/builder-model.test.ts +5 -0
  263. package/src/app/builder/builder-model.ts +5 -4
  264. package/src/app/builder/labels.ts +15 -121
  265. package/src/app/builder/status-chip.tsx +8 -4
  266. package/src/app/builder/use-builder-catalogue.ts +6 -0
  267. package/src/app/builder/use-save-dashboard.ts +5 -0
  268. package/src/app/index.ts +8 -1
  269. package/src/app/layout-builder.tsx +23 -3
  270. package/src/app/mcp-app-view-chrome.test.tsx +347 -14
  271. package/src/app/mcp-app-view-chrome.tsx +278 -100
  272. package/src/app/mcp-app-view-states.tsx +100 -0
  273. package/src/app/mcp-app-view.test.tsx +258 -0
  274. package/src/app/mcp-app-view.tsx +292 -185
  275. package/src/app/mcp-toolkit-app.tsx +31 -7
  276. package/src/app/use-view-lifecycle.ts +116 -0
  277. package/src/app/view-lifecycle.test.ts +227 -0
  278. package/src/app/view-lifecycle.ts +174 -0
  279. package/src/app/widget-props-sheet.tsx +13 -26
  280. package/src/app/widget-renderer.render.test.tsx +131 -0
  281. package/src/app/widget-renderer.tsx +136 -38
  282. package/src/components/DrillButton.tsx +2 -1
  283. package/src/components/EmptyState.tsx +81 -0
  284. package/src/components/ErrorState.tsx +182 -0
  285. package/src/components/FilterBar.tsx +9 -6
  286. package/src/components/GroupCard.tsx +3 -2
  287. package/src/components/KpiGrid.tsx +75 -44
  288. package/src/components/ListFooter.tsx +17 -6
  289. package/src/components/Pills.tsx +20 -11
  290. package/src/components/Toast.tsx +188 -0
  291. package/src/components/WidgetHeader.tsx +1 -1
  292. package/src/components/feedback-states.test.tsx +225 -0
  293. package/src/components/tone-figures.test.tsx +54 -0
  294. package/src/fonts.css +19 -0
  295. package/src/globals.css +9 -165
  296. package/src/hooks/use-tool-result-recovery.test.ts +25 -1
  297. package/src/hooks/use-tool-result-recovery.ts +34 -6
  298. package/src/hooks/use-view-data.test.tsx +60 -0
  299. package/src/hooks/use-view-data.ts +12 -1
  300. package/src/i18n-coverage.test.tsx +323 -0
  301. package/src/index.ts +57 -5
  302. package/src/lib/focus-ring.ts +20 -0
  303. package/src/lib/icon-stroke.test.ts +59 -0
  304. package/src/lib/icon-stroke.ts +13 -0
  305. package/src/lib/toast-model.test.ts +68 -0
  306. package/src/lib/toast-model.ts +63 -0
  307. package/src/lib/tone-utils.test.ts +47 -14
  308. package/src/lib/tone-utils.ts +61 -13
  309. package/src/locale/index.ts +13 -1
  310. package/src/locale/locale-provider.test.tsx +87 -0
  311. package/src/locale/locale-provider.tsx +90 -3
  312. package/src/locale/message-types.ts +221 -0
  313. package/src/locale/messages-de.ts +159 -0
  314. package/src/locale/messages-en.ts +157 -0
  315. package/src/locale/toolkit-messages.test.ts +216 -0
  316. package/src/locale/toolkit-messages.ts +82 -0
  317. package/src/no-hardcoded-copy.test.ts +432 -0
  318. package/src/primitives/alert.tsx +4 -2
  319. package/src/primitives/badge.tsx +14 -7
  320. package/src/primitives/button.tsx +13 -8
  321. package/src/primitives/card.tsx +4 -4
  322. package/src/primitives/dialog.tsx +32 -7
  323. package/src/primitives/input.tsx +5 -3
  324. package/src/primitives/scroll-area.tsx +1 -1
  325. package/src/primitives/select.tsx +6 -3
  326. package/src/primitives/sheet.tsx +26 -6
  327. package/src/primitives/skeleton.tsx +1 -1
  328. package/src/primitives/switch.tsx +4 -2
  329. package/src/primitives/tabs.tsx +9 -6
  330. package/src/render-cases.tsx +45 -1
  331. package/src/render-scan.ts +75 -0
  332. package/src/theme/cd-tokens.generated.css +48 -0
  333. package/src/theme/cd-tokens.test.ts +107 -0
  334. package/src/theme/cd-tokens.ts +67 -0
  335. package/src/theme/create-theme.test.ts +243 -5
  336. package/src/theme/create-theme.ts +313 -41
  337. package/src/theme/fonts.test.ts +85 -0
  338. package/src/theme/fonts.ts +72 -0
  339. package/src/theme/host-fonts.test.ts +135 -0
  340. package/src/theme/host-fonts.ts +52 -0
  341. package/src/theme/index.ts +15 -1
  342. package/src/theme/portal-container.ts +20 -0
  343. package/src/theme/presets.ts +44 -11
  344. package/src/theme/theme-css.test.ts +568 -0
  345. package/src/theme/theme-provider.test.tsx +82 -0
  346. package/src/theme/theme-provider.tsx +60 -24
  347. package/src/theme.css +314 -0
  348. package/ui-catalog.json +344 -17
@@ -1,6 +1,11 @@
1
- import { type McpAppViewLabels } from "./mcp-app-view-chrome.js";
1
+ import { type ReactNode } from "react";
2
+ import { type DescribeStep, type McpAppViewLabels, type ViewTitleLevel, type ViewTitleMode } from "./mcp-app-view-chrome.js";
3
+ import { type DescribeViewError } from "./mcp-app-view-states.js";
4
+ import type { LayoutBuilderLabels } from "./layout-builder.js";
2
5
  import type { WidgetComponent } from "./widget-renderer.js";
3
- export type { McpAppViewLabels } from "./mcp-app-view-chrome.js";
6
+ export type { McpAppViewLabels, ViewTitleLevel, ViewTitleMode } from "./mcp-app-view-chrome.js";
7
+ export type { DescribeStep } from "./mcp-app-view-chrome.js";
8
+ export type { DescribeViewError } from "./mcp-app-view-states.js";
4
9
  export interface McpAppViewProps {
5
10
  /**
6
11
  * Map of widget ID to React component. The consumer aggregates this from
@@ -28,10 +33,40 @@ export interface McpAppViewProps {
28
33
  */
29
34
  builderEnabled?: boolean;
30
35
  /**
31
- * Override UI strings (loading, refresh, fullscreen, build).
32
- * Defaults to English.
36
+ * Override chrome strings (loading, error, refresh, fullscreen, edit, …).
37
+ * Defaults to the active locale's toolkit catalog: the nearest
38
+ * `LocaleProvider`, else the host's locale (`en`/`de`, English otherwise).
33
39
  */
34
40
  labels?: McpAppViewLabels;
41
+ /** Override strings of the embedded view builder (defaults: the locale's catalog). */
42
+ builderLabels?: LayoutBuilderLabels;
43
+ /**
44
+ * How the toolbar shows the view title, so a view carries ONE title:
45
+ * `"show"` (default) renders it as a heading, `"hide"` leaves the title to
46
+ * the widget's own header, `"slot"` renders {@link McpAppViewProps.renderTitle}.
47
+ */
48
+ titleMode?: ViewTitleMode;
49
+ /** Heading level of the toolbar title in `"show"` mode. Default `2`. */
50
+ titleLevel?: ViewTitleLevel;
51
+ /** Renders the toolbar title in `"slot"` mode; receives the view's title. */
52
+ renderTitle?: (title: string | undefined) => ReactNode;
53
+ /** Delay before the loading placeholder adds its "taking longer" hint. Default 8000 ms. */
54
+ slowHintAfterMs?: number;
55
+ /**
56
+ * Map a raw rendering error (the tool's `isError` text) onto human text.
57
+ * The raw reason always stays available under "Details".
58
+ */
59
+ describeError?: DescribeViewError;
60
+ /** Human title of a pipeline step in the failed-steps alert (default: the step id). */
61
+ describeStep?: DescribeStep;
35
62
  }
36
- export declare function McpAppView({ widgets, refreshToolName, builderEnabled, labels, }: McpAppViewProps): import("react").JSX.Element;
63
+ /**
64
+ * The toolkit's MCP App view: lifecycle placeholder (waiting / error /
65
+ * cancelled), toolbar, failed-steps alert and the rendered layout (or the
66
+ * builder). Mounts a `ToastProvider` and binds the toolkit's own strings to
67
+ * the host's locale unless a `LocaleProvider` sets one, so the chrome follows
68
+ * the host language; `useLocale()` in consumer widgets is unaffected. Lucide
69
+ * icons draw at the CI stroke (2.5) throughout, the toast stack included.
70
+ */
71
+ export declare function McpAppView(props: McpAppViewProps): import("react").JSX.Element;
37
72
  //# sourceMappingURL=mcp-app-view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-app-view.d.ts","sourceRoot":"","sources":["../../src/app/mcp-app-view.tsx"],"names":[],"mappings":"AAOA,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACxC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,eAAgC,EAChC,cAAc,EACd,MAAM,GACP,EAAE,eAAe,+BA+MjB"}
1
+ {"version":3,"file":"mcp-app-view.d.ts","sourceRoot":"","sources":["../../src/app/mcp-app-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK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E,eAAe,+BAYhD"}
@@ -1,159 +1,205 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useCallback } from "react";
2
+ import { useState, useCallback, useMemo } from "react";
3
+ import { LucideProvider } from "lucide-react";
3
4
  import { ToolCancelledError, useDisplayMode, useHostContext, useToolContext } from "mcp-use/react";
5
+ import { ToastProvider, useToast } from "../components/Toast.js";
6
+ import { ToolkitLocaleFallback, useToolkitMessages } from "../locale/locale-provider.js";
4
7
  import { AppQueryProvider, queryClient } from "../providers/query-provider.js";
5
- import { useToolResultRecovery } from "../hooks/use-tool-result-recovery.js";
6
- import { parseToolResult } from "../lib/parse-tool-result.js";
8
+ import { resolveRecoveryToolName, useToolResultRecovery, } from "../hooks/use-tool-result-recovery.js";
9
+ import { ICON_STROKE } from "../lib/icon-stroke.js";
7
10
  import { useHostBridge } from "./host-bridge.js";
8
- import { DEFAULT_LABELS, isCompleteViewData, StepErrors, ViewBody, ViewPlaceholder, ViewToolbar, } from "./mcp-app-view-chrome.js";
9
- export function McpAppView({ widgets, refreshToolName = "refresh-view", builderEnabled, labels, }) {
10
- const effectiveLabels = { ...DEFAULT_LABELS, ...labels };
11
- // Since mcp-use 2.x the shell reads the view channels through the dedicated
12
- // hooks (all require the surrounding `bootstrapView` mount that
13
- // `mountMcpToolkitApp` provides) and calls tools through the HostBridge that
14
- // `McpUseHostBridgeProvider` installs.
15
- const tool = useToolContext();
16
- const { displayMode, requestDisplayMode } = useDisplayMode();
17
- const { safeArea, hostContext } = useHostContext();
18
- const bridge = useHostBridge();
19
- const callTool = useCallback((name, args) => bridge.callTool(name, args), [bridge]);
20
- const isPending = tool.status === "pending";
21
- // Since mcp-use 2.7.1 a host cancellation of the rendering call latches as a
22
- // terminal `status: "error"` — show it instead of the skeleton, and never
23
- // let the recovery below re-run the call the user stopped.
24
- const isCancelled = tool.status === "error" && tool.error instanceof ToolCancelledError;
25
- const initialViewData = tool.status === "ready" ? tool.toolOutput : undefined;
26
- const toolInput = tool.toolInput;
11
+ import { applyBuilderCommit, fullscreenAvailable, isCompleteViewData, StepErrors, ViewBody, ViewToolbar, } from "./mcp-app-view-chrome.js";
12
+ import { ViewPlaceholder } from "./mcp-app-view-states.js";
13
+ import { useRetryFocus, useViewLifecycle } from "./use-view-lifecycle.js";
14
+ import { DEFAULT_SLOW_HINT_MS, decodeViewResult } from "./view-lifecycle.js";
15
+ /**
16
+ * The toolkit's MCP App view: lifecycle placeholder (waiting / error /
17
+ * cancelled), toolbar, failed-steps alert and the rendered layout (or the
18
+ * builder). Mounts a `ToastProvider` and binds the toolkit's own strings to
19
+ * the host's locale unless a `LocaleProvider` sets one, so the chrome follows
20
+ * the host language; `useLocale()` in consumer widgets is unaffected. Lucide
21
+ * icons draw at the CI stroke (2.5) throughout, the toast stack included.
22
+ */
23
+ export function McpAppView(props) {
24
+ const { locale } = useHostContext();
25
+ return (_jsx(ToolkitLocaleFallback, { locale: locale, children: _jsx(LucideProvider, { strokeWidth: ICON_STROKE, children: _jsx(ToastProvider, { children: _jsx(McpAppViewShell, { ...props }) }) }) }));
26
+ }
27
+ /**
28
+ * Host-delivered payload → local `viewData`, recovered payloads included.
29
+ * Render-phase setState (not an effect) so the React Compiler doesn't flag a
30
+ * cascading render.
31
+ */
32
+ function useHostViewData(initialViewData, isPending, recovered) {
27
33
  const [viewData, setViewData] = useState(null);
28
- const [isRefreshing, setIsRefreshing] = useState(false);
29
- // In-iframe build mode is purely a UI state — the LLM never sees the
30
- // catalogue, the user toggles into build by clicking the toolbar button.
31
- const [buildMode, setBuildMode] = useState(false);
32
- // Sync host-provided initialViewData → local viewData via render-phase
33
- // setState (rather than an effect) so the React Compiler doesn't flag a
34
- // cascading render. The guard against transient empty toolOutput stays:
35
- // widgetProps may briefly drop `context`/`layout` when displayMode toggles,
36
- // and we don't want that to clobber a valid viewData.
37
- //
38
34
  // `prev` MUST start as `null`, not `initialViewData`: hosts that expose the
39
35
  // complete tool output before the app's first render (e.g. window.openai
40
36
  // globals injected ahead of script execution) would otherwise never trip the
41
- // identity check — initialViewData never changes again, the sync never runs,
42
- // and the app idles on the loading skeleton forever.
43
- const [prevInitialViewData, setPrevInitialViewData] = useState(null);
44
- if (initialViewData !== prevInitialViewData) {
45
- setPrevInitialViewData(initialViewData);
46
- if (!isPending && isCompleteViewData(initialViewData)) {
37
+ // identity check — the sync never runs and the app idles on the skeleton.
38
+ // The completeness guard stays: widgetProps may briefly drop
39
+ // `context`/`layout` when displayMode toggles.
40
+ const [prevInitial, setPrevInitial] = useState(null);
41
+ if (initialViewData !== prevInitial) {
42
+ setPrevInitial(initialViewData);
43
+ if (!isPending && isCompleteViewData(initialViewData))
47
44
  setViewData(initialViewData);
48
- }
49
45
  }
50
- // Hosts that strip `structuredContent` from the tool-result notification
51
- // (claude.ai / Claude Desktop) never latch a result under mcp-use 2.x — the
52
- // `useToolContext` latch ignores content-only results, so `isPending` stays
53
- // true forever. The recovery therefore also arms itself on a grace timer
54
- // once the originating tool is known, re-executes it via `callTool`
55
- // (responses carry `structuredContent` intact), and fills the gap.
56
- // Conforming hosts deliver a valid payload up front, so it never fires
57
- // there.
58
- const recovery = useToolResultRecovery({
59
- resultReady: !isPending,
60
- cancelled: isCancelled,
61
- props: initialViewData,
62
- isValid: isCompleteViewData,
63
- toolInput,
64
- hostContext,
65
- callTool,
66
- });
67
46
  const [prevRecovered, setPrevRecovered] = useState(null);
68
- if (recovery.data !== prevRecovered) {
69
- setPrevRecovered(recovery.data);
47
+ if (recovered !== prevRecovered) {
48
+ setPrevRecovered(recovered);
70
49
  // The host-delivered payload always wins; recovery only fills the gap.
71
- if (recovery.data && !viewData)
72
- setViewData(recovery.data);
50
+ if (recovered && !viewData)
51
+ setViewData(recovered);
73
52
  }
74
- const toggleFullscreen = useCallback(async () => {
75
- const newMode = displayMode === "fullscreen" ? "inline" : "fullscreen";
76
- try {
77
- // Advisory since 2.x: the promise only confirms the host processed the
78
- // request. `displayMode` from `useDisplayMode` updates reactively when
79
- // (and only when) the host actually applies the change.
80
- await requestDisplayMode({ mode: newMode });
81
- }
82
- catch (e) {
83
- console.error("Failed to toggle display mode:", e);
84
- }
85
- }, [displayMode, requestDisplayMode]);
86
- // Stable callTool callback (avoids a new object reference on every render)
87
- const callToolFn = useCallback(async (name, args) => {
88
- return callTool(name, args);
89
- }, [callTool]);
53
+ return [viewData, setViewData];
54
+ }
55
+ /**
56
+ * Refresh via the refresh tool. A failure keeps the data and says so in a
57
+ * toast in catalog words only; the raw reason goes to the console, never to
58
+ * the user.
59
+ */
60
+ function useViewRefresh(options) {
61
+ const { viewData, setViewData, callTool, refreshToolName, labels } = options;
62
+ const toast = useToast();
63
+ const [isRefreshing, setIsRefreshing] = useState(false);
90
64
  const refreshView = useCallback(async () => {
91
65
  if (!viewData?._refreshParams)
92
66
  return;
93
67
  setIsRefreshing(true);
68
+ let failure = null;
94
69
  try {
95
70
  const result = await callTool(refreshToolName, viewData._refreshParams);
96
- // Decode through the shared structured-first parser (one convention with
97
- // `useToolQuery`); a refresh returns the view envelope as `structuredContent`.
98
- const refreshed = parseToolResult(result);
99
- if (refreshed?.context && refreshed?.layout) {
100
- setViewData(refreshed);
101
- }
102
- void queryClient.invalidateQueries();
71
+ // One decoding convention with `useToolQuery` (structured-first), with a
72
+ // typed outcome: an unusable payload is a failure, never exception text.
73
+ const outcome = decodeViewResult(result, isCompleteViewData);
74
+ if (outcome.ok)
75
+ setViewData(outcome.data);
76
+ else
77
+ failure = outcome.reason ?? "the refresh tool returned no view";
78
+ // The call went through, so self-fetching widgets refresh as well;
79
+ // a tool error refreshes nothing.
80
+ if (outcome.ok || !outcome.isError)
81
+ void queryClient.invalidateQueries();
103
82
  }
104
83
  catch (e) {
105
- console.error("Failed to refresh view:", e);
84
+ failure = e;
106
85
  }
107
86
  finally {
108
87
  setIsRefreshing(false);
109
88
  }
110
- }, [callTool, refreshToolName, viewData]);
111
- // Called by LayoutBuilder when the user clicks Done. Commits the draft
112
- // layout (and any keys/steps edits) into the parent viewData so the
113
- // WidgetRenderer takes over showing the just-built layout.
114
- const exitBuildMode = useCallback((commit) => {
115
- if (commit) {
116
- setViewData((prev) => prev
117
- ? {
118
- ...prev,
119
- layout: commit.layout,
120
- title: commit.title ?? prev.title,
121
- context: commit.context ?? prev.context,
122
- _refreshParams: {
123
- keys: commit.keys,
124
- steps: commit.steps,
125
- layout: commit.layout,
126
- title: commit.title ?? prev.title,
127
- },
128
- }
129
- : prev);
89
+ if (failure === null)
90
+ return;
91
+ console.warn("[mcp-toolkit] refresh failed:", failure);
92
+ toast.show({
93
+ tone: "danger",
94
+ title: labels.refreshFailed,
95
+ description: labels.refreshFailedHint,
96
+ });
97
+ }, [callTool, labels, refreshToolName, setViewData, toast, viewData]);
98
+ return { isRefreshing, refreshView };
99
+ }
100
+ /**
101
+ * The fullscreen toggle, gated on the host's offer. A rejected request shows
102
+ * a toast in catalog words; the raw reason goes to the console.
103
+ */
104
+ function useFullscreenToggle(labels) {
105
+ const { displayMode, availableDisplayModes, requestDisplayMode } = useDisplayMode();
106
+ const toast = useToast();
107
+ const toggle = useCallback(async () => {
108
+ const mode = displayMode === "fullscreen" ? "inline" : "fullscreen";
109
+ try {
110
+ // Advisory since 2.x: `displayMode` updates when the host applies it.
111
+ await requestDisplayMode({ mode });
112
+ }
113
+ catch (e) {
114
+ console.warn("[mcp-toolkit] display-mode request failed:", e);
115
+ toast.show({
116
+ tone: "danger",
117
+ title: labels.fullscreenFailed,
118
+ description: labels.fullscreenFailedHint,
119
+ });
130
120
  }
121
+ }, [displayMode, labels, requestDisplayMode, toast]);
122
+ return {
123
+ isFullscreen: displayMode === "fullscreen",
124
+ canFullscreen: fullscreenAvailable(displayMode, availableDisplayModes),
125
+ toggle,
126
+ };
127
+ }
128
+ function McpAppViewShell({ widgets, refreshToolName = "refresh-view", builderEnabled, labels, builderLabels, titleMode = "show", titleLevel = 2, renderTitle, slowHintAfterMs = DEFAULT_SLOW_HINT_MS, describeError, describeStep, }) {
129
+ const messages = useToolkitMessages();
130
+ const L = useMemo(() => ({ ...messages.view, ...labels }), [messages.view, labels]);
131
+ // The mcp-use 2.x view channels (all need the `bootstrapView` mount
132
+ // `mountMcpToolkitApp` provides); tools go through the HostBridge.
133
+ const tool = useToolContext();
134
+ const { safeArea, hostContext } = useHostContext();
135
+ const bridge = useHostBridge();
136
+ const callTool = useCallback((name, args) => bridge.callTool(name, args), [bridge]);
137
+ // The widget-facing shape (`args: object`, so generated input interfaces
138
+ // without an index signature pass straight through).
139
+ const callToolFn = useCallback((name, args) => bridge.callTool(name, args), [bridge]);
140
+ const isPending = tool.status === "pending";
141
+ // Since mcp-use 2.7.1 a host cancellation latches as `status: "error"`.
142
+ const isCancelled = tool.status === "error" && tool.error instanceof ToolCancelledError;
143
+ const isCallError = tool.status === "error" && !isCancelled;
144
+ const initialViewData = tool.status === "ready" ? tool.toolOutput : undefined;
145
+ // Hosts that strip `structuredContent` (claude.ai) never latch a result under
146
+ // mcp-use 2.x; the recovery re-executes the call once to fill the gap. It
147
+ // never fires on a cancelled or failed call (#176): those render their state.
148
+ const recovery = useToolResultRecovery({
149
+ resultReady: !isPending,
150
+ cancelled: isCancelled,
151
+ errored: isCallError,
152
+ props: initialViewData,
153
+ isValid: isCompleteViewData,
154
+ toolInput: tool.toolInput,
155
+ hostContext,
156
+ callTool,
157
+ });
158
+ const [viewData, setViewData] = useHostViewData(initialViewData, isPending, recovery.data);
159
+ const { lifecycle, retry: retryCall } = useViewLifecycle({
160
+ hasViewData: viewData !== null,
161
+ callStatus: tool.status,
162
+ cancelled: isCancelled,
163
+ callError: isCallError ? tool.error : undefined,
164
+ recoveryFailed: recovery.failed,
165
+ toolName: resolveRecoveryToolName(hostContext),
166
+ toolInput: tool.toolInput,
167
+ callTool,
168
+ isValid: isCompleteViewData,
169
+ onResult: setViewData,
170
+ slowHintAfterMs,
171
+ });
172
+ const { frameRef, retry } = useRetryFocus(lifecycle.phase, retryCall);
173
+ const { isRefreshing, refreshView } = useViewRefresh({
174
+ viewData,
175
+ setViewData,
176
+ callTool,
177
+ refreshToolName,
178
+ labels: L,
179
+ });
180
+ const fullscreen = useFullscreenToggle(L);
181
+ // In-iframe build mode is purely a UI state — the LLM never sees the catalogue.
182
+ const [buildMode, setBuildMode] = useState(false);
183
+ const exitBuildMode = useCallback((commit) => {
184
+ if (commit)
185
+ setViewData((prev) => (prev ? applyBuilderCommit(prev, commit) : prev));
131
186
  setBuildMode(false);
132
- }, []);
133
- // `isPending` must not gate the render: on hosts that strip
134
- // `structuredContent` the 2.x latch stays "pending" forever, and recovered
135
- // viewData still has to replace the skeleton.
187
+ }, [setViewData]);
188
+ // `isPending` must not gate the render: on stripping hosts the latch stays
189
+ // "pending" forever, and recovered viewData still has to replace it. The
190
+ // frame is the stable focus target of a retry (`useRetryFocus`).
136
191
  if (!viewData) {
137
- return _jsx(ViewPlaceholder, { cancelled: isCancelled, labels: effectiveLabels });
192
+ return (_jsx("div", { ref: frameRef, tabIndex: -1, "data-slot": "mcp-app-view", className: "outline-hidden", children: _jsx(ViewPlaceholder, { lifecycle: lifecycle, labels: L, onRetry: retry, describeError: describeError }) }));
138
193
  }
139
- const isFullscreen = displayMode === "fullscreen";
140
- // Follow the server's own signal by default: render-view reports
141
- // `builderAvailable` (derived from `app.builder`), so the Build button only
142
- // shows when the catalogue/dashboard tools are actually registered. An
143
- // explicit `builderEnabled` prop forces the affordance on or off.
144
- const builderAvailable = builderEnabled ?? viewData.builderAvailable ?? false;
145
- return (_jsxs("main", { style: {
146
- // Fullscreen: the widget owns the viewport, so we take the full window
147
- // and handle our own scrolling. Inline: the host (Claude, ChatGPT) owns
148
- // sizing + scrolling and observes our intrinsic height via
149
- // `bootstrapView`'s auto-resize, so we let content dictate height and
150
- // avoid setting overflowY (which would clip our own content inside a
151
- // host that's already auto-sized to us).
152
- ...(isFullscreen ? { minHeight: "100vh", overflowY: "auto" } : null),
153
- paddingTop: safeArea.top,
154
- paddingRight: safeArea.right,
155
- paddingBottom: safeArea.bottom,
156
- paddingLeft: safeArea.left,
157
- }, children: [_jsx(ViewToolbar, { hidden: buildMode, viewData: viewData, builderAvailable: builderAvailable, isFullscreen: isFullscreen, isRefreshing: isRefreshing, labels: effectiveLabels, onRefresh: refreshView, onEnterBuildMode: () => setBuildMode(true), onToggleFullscreen: toggleFullscreen }), _jsx(StepErrors, { hidden: buildMode, errors: viewData.context.errors }), _jsx(AppQueryProvider, { callTool: callToolFn, children: _jsx(ViewBody, { buildMode: buildMode, viewData: viewData, widgets: widgets, callTool: callToolFn, onExit: exitBuildMode }) })] }));
194
+ return (_jsx("div", { ref: frameRef, tabIndex: -1, "data-slot": "mcp-app-view", className: "outline-hidden", children: _jsxs("main", { style: {
195
+ // Fullscreen: the view owns the viewport and scrolls itself. Inline:
196
+ // the host sizes us from our intrinsic height (bootstrapView's
197
+ // auto-resize), so no overflow clipping there.
198
+ ...(fullscreen.isFullscreen ? { minHeight: "100vh", overflowY: "auto" } : null),
199
+ paddingTop: safeArea.top,
200
+ paddingRight: safeArea.right,
201
+ paddingBottom: safeArea.bottom,
202
+ paddingLeft: safeArea.left,
203
+ }, children: [_jsx(ViewToolbar, { hidden: buildMode, viewData: viewData, builderAvailable: builderEnabled ?? viewData.builderAvailable ?? false, isFullscreen: fullscreen.isFullscreen, canFullscreen: fullscreen.canFullscreen, isRefreshing: isRefreshing, labels: L, titleMode: titleMode, titleLevel: titleLevel, renderTitle: renderTitle, onRefresh: refreshView, onEnterBuildMode: () => setBuildMode(true), onToggleFullscreen: fullscreen.toggle }), _jsx(StepErrors, { hidden: buildMode, errors: viewData.context.errors, steps: viewData._refreshParams?.steps, labels: L, describeStep: describeStep, onRetry: viewData._refreshParams ? () => void refreshView() : undefined }), _jsx(AppQueryProvider, { callTool: callToolFn, children: _jsx(ViewBody, { buildMode: buildMode, viewData: viewData, widgets: widgets, callTool: callToolFn, builderLabels: builderLabels, onExit: exitBuildMode }) })] }) }));
158
204
  }
159
205
  //# sourceMappingURL=mcp-app-view.js.map
@@ -1 +1 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AQ,CAAC,gBAAgB,IAAI,KAAK,EACtE,YAAY,EAAE,UAAU,CAAC,YAAY,EACrC,aAAa,EAAE,UAAU,CAAC,aAAa,EACvC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,EACtB,gBAAgB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAC1C,kBAAkB,EAAE,UAAU,CAAC,MAAM,GACrC,EAEF,KAAC,UAAU,IACT,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,EAC/B,KAAK,EAAE,QAAQ,CAAC,cAAc,EAAE,KAAK,EACrC,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,GACvE,EAEF,KAAC,gBAAgB,IAAC,QAAQ,EAAE,UAAU,YACpC,KAAC,QAAQ,IACP,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,aAAa,GACrB,GACe,IACd,GACH,CACP,CAAA;AACH,CAAC"}
@@ -2,7 +2,8 @@ import { type McpAppViewProps } from "./mcp-app-view.js";
2
2
  /**
3
3
  * Consumer-facing root for a toolkit-rendered MCP App. Composes the mcp-use
4
4
  * 2.x view plumbing around `McpAppView`: `ThemeProvider` applies the host's
5
- * theme/style variables to the document, and `McpUseHostBridgeProvider`
5
+ * theme/style variables to the document (with the host's font kept behind
6
+ * Geist, see `adoptHostFontVariables`), and `McpUseHostBridgeProvider`
6
7
  * installs the `HostBridge` (and view-scope flag) every toolkit widget below
7
8
  * resolves through `useHostBridge()`.
8
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-toolkit-app.d.ts","sourceRoot":"","sources":["../../src/app/mcp-toolkit-app.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGpE;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,+BAQnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAE/D"}
1
+ {"version":3,"file":"mcp-toolkit-app.d.ts","sourceRoot":"","sources":["../../src/app/mcp-toolkit-app.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAsBpE;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,+BAUnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAE/D"}
@@ -1,11 +1,33 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ThemeProvider, bootstrapView } from "mcp-use/react";
2
+ import { useLayoutEffect } from "react";
3
+ import { ThemeProvider, bootstrapView, useHostContext } from "mcp-use/react";
4
+ import { adoptHostFontVariables } from "../theme/host-fonts.js";
3
5
  import { McpAppView } from "./mcp-app-view.js";
4
6
  import { McpUseHostBridgeProvider } from "./mcp-use-host-bridge.js";
7
+ /**
8
+ * Keeps Geist first when the host sends its font. mcp-use's `ThemeProvider`
9
+ * writes the host's SEP-1865 style variables inline on `<html>`, including
10
+ * `--font-sans`/`--font-mono`, which share their names with the toolkit's font
11
+ * roles and would replace the Geist-first stacks whole. This component sits
12
+ * ABOVE that provider on purpose: a parent's layout effect runs after its
13
+ * children's, so the host variables are already applied when it moves the
14
+ * font pair into the fallback slot (`adoptHostFontVariables`). Both effects
15
+ * key on the same host-context snapshot, so they run in the same commit.
16
+ */
17
+ function HostFontRoles({ children }) {
18
+ const { hostContext } = useHostContext();
19
+ useLayoutEffect(() => {
20
+ if (typeof document === "undefined")
21
+ return;
22
+ adoptHostFontVariables(document.documentElement.style, hostContext?.styles?.variables);
23
+ }, [hostContext]);
24
+ return children;
25
+ }
5
26
  /**
6
27
  * Consumer-facing root for a toolkit-rendered MCP App. Composes the mcp-use
7
28
  * 2.x view plumbing around `McpAppView`: `ThemeProvider` applies the host's
8
- * theme/style variables to the document, and `McpUseHostBridgeProvider`
29
+ * theme/style variables to the document (with the host's font kept behind
30
+ * Geist, see `adoptHostFontVariables`), and `McpUseHostBridgeProvider`
9
31
  * installs the `HostBridge` (and view-scope flag) every toolkit widget below
10
32
  * resolves through `useHostBridge()`.
11
33
  *
@@ -15,7 +37,7 @@ import { McpUseHostBridgeProvider } from "./mcp-use-host-bridge.js";
15
37
  * composing a custom view under your own `bootstrapView` call.
16
38
  */
17
39
  export function McpToolkitApp(props) {
18
- return (_jsx(ThemeProvider, { children: _jsx(McpUseHostBridgeProvider, { children: _jsx(McpAppView, { ...props }) }) }));
40
+ return (_jsx(HostFontRoles, { children: _jsx(ThemeProvider, { children: _jsx(McpUseHostBridgeProvider, { children: _jsx(McpAppView, { ...props }) }) }) }));
19
41
  }
20
42
  /**
21
43
  * Mount the toolkit app as the document's MCP App view — the bundle entry
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-toolkit-app.js","sourceRoot":"","sources":["../../src/app/mcp-toolkit-app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAwB,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAsB;IAClD,OAAO,CACL,KAAC,aAAa,cACZ,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;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAsB;IACvD,aAAa,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAC,aAAa,OAAK,KAAK,GAAI,EAAE,CAAC,CAAA;AAChE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { type RefObject } from "react";
2
+ import { type RenderCallStatus, type ViewLifecycle } from "./view-lifecycle.js";
3
+ export interface UseViewLifecycleOptions<T> {
4
+ hasViewData: boolean;
5
+ callStatus: RenderCallStatus;
6
+ cancelled: boolean;
7
+ callError: unknown;
8
+ recoveryFailed: boolean;
9
+ /** The originating tool (`hostContext.toolInfo`); a retry needs it. */
10
+ toolName: string | undefined;
11
+ toolInput: Record<string, unknown> | null | undefined;
12
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
13
+ isValid: (value: unknown) => value is T;
14
+ /** Receives the payload of a successful retry. */
15
+ onResult: (data: T) => void;
16
+ slowHintAfterMs: number;
17
+ }
18
+ /**
19
+ * Drives the {@link resolveViewLifecycle} state machine: owns the retry and
20
+ * the slow-hint timer, and returns the current phase plus `retry()`.
21
+ */
22
+ export declare function useViewLifecycle<T>(options: UseViewLifecycleOptions<T>): {
23
+ lifecycle: ViewLifecycle;
24
+ retry: () => void;
25
+ };
26
+ /**
27
+ * Keeps keyboard focus in the view across a user retry: the pressed button
28
+ * unmounts when the view starts waiting, so focus moves to the frame (a
29
+ * `tabIndex={-1}` container), then to the new retry button when the retry
30
+ * failed, or stays on the frame once the view rendered (see
31
+ * {@link retryFocusTarget}). Focus the user moved elsewhere meanwhile is left
32
+ * alone. Returns the frame ref and `retry` wrapped to start the hand-off.
33
+ */
34
+ export declare function useRetryFocus(phase: ViewLifecycle["phase"], retry: () => void): {
35
+ frameRef: RefObject<HTMLDivElement | null>;
36
+ retry: () => void;
37
+ };
38
+ //# sourceMappingURL=use-view-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-view-lifecycle.d.ts","sourceR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