@frontmcp/ui 0.6.0 → 0.6.2

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 (650) hide show
  1. package/README.md +140 -362
  2. package/bridge/core/bridge-factory.d.ts +1 -0
  3. package/bridge/core/bridge-factory.d.ts.map +1 -1
  4. package/bridge/index.d.ts +1 -1
  5. package/bridge/index.d.ts.map +1 -1
  6. package/bridge/index.js +39 -881
  7. package/bridge/runtime/index.d.ts +2 -1
  8. package/bridge/runtime/index.d.ts.map +1 -1
  9. package/bundler/browser-components.d.ts +42 -0
  10. package/bundler/browser-components.d.ts.map +1 -0
  11. package/bundler/bundler.d.ts +78 -4
  12. package/bundler/bundler.d.ts.map +1 -1
  13. package/bundler/index.d.ts +8 -8
  14. package/bundler/index.d.ts.map +1 -1
  15. package/bundler/index.js +1411 -2997
  16. package/bundler/types.d.ts +188 -7
  17. package/bundler/types.d.ts.map +1 -1
  18. package/components/alert.schema.d.ts +6 -6
  19. package/components/avatar.schema.d.ts +9 -9
  20. package/components/badge.schema.d.ts +9 -9
  21. package/components/button.schema.d.ts +9 -9
  22. package/components/card.schema.d.ts +7 -7
  23. package/components/form.schema.d.ts +24 -24
  24. package/components/index.js +128 -198
  25. package/components/modal.schema.d.ts +8 -8
  26. package/components/table.schema.d.ts +6 -6
  27. package/esm/bridge/{index.js → index.mjs} +40 -877
  28. package/esm/bundler/index.mjs +3136 -0
  29. package/esm/components/{index.js → index.mjs} +136 -196
  30. package/esm/index.mjs +5450 -0
  31. package/esm/layouts/index.mjs +409 -0
  32. package/esm/package.json +15 -32
  33. package/esm/react/{index.js → index.mjs} +71 -260
  34. package/esm/renderers/index.mjs +611 -0
  35. package/esm/universal/index.mjs +1951 -0
  36. package/esm/web-components/{index.js → index.mjs} +232 -287
  37. package/index.d.ts +22 -41
  38. package/index.d.ts.map +1 -1
  39. package/index.js +4286 -19607
  40. package/layouts/base.d.ts +2 -2
  41. package/layouts/base.d.ts.map +1 -1
  42. package/layouts/index.js +46 -539
  43. package/layouts/presets.d.ts.map +1 -1
  44. package/package.json +15 -32
  45. package/react/Alert.d.ts +1 -2
  46. package/react/Alert.d.ts.map +1 -1
  47. package/react/Badge.d.ts +1 -2
  48. package/react/Badge.d.ts.map +1 -1
  49. package/react/Button.d.ts +1 -2
  50. package/react/Button.d.ts.map +1 -1
  51. package/react/Card.d.ts +1 -2
  52. package/react/Card.d.ts.map +1 -1
  53. package/react/hooks/context.d.ts +1 -1
  54. package/react/hooks/context.d.ts.map +1 -1
  55. package/react/index.d.ts +5 -7
  56. package/react/index.d.ts.map +1 -1
  57. package/react/index.js +55 -269
  58. package/react/types.d.ts +1 -2
  59. package/react/types.d.ts.map +1 -1
  60. package/renderers/index.d.ts +15 -25
  61. package/renderers/index.d.ts.map +1 -1
  62. package/renderers/index.js +393 -1619
  63. package/renderers/mdx.renderer.d.ts +13 -34
  64. package/renderers/mdx.renderer.d.ts.map +1 -1
  65. package/{esm/runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  66. package/renderers/react.adapter.d.ts.map +1 -0
  67. package/renderers/react.renderer.d.ts +25 -16
  68. package/renderers/react.renderer.d.ts.map +1 -1
  69. package/renderers/transpiler.d.ts +49 -0
  70. package/renderers/transpiler.d.ts.map +1 -0
  71. package/universal/cached-runtime.d.ts +25 -1
  72. package/universal/cached-runtime.d.ts.map +1 -1
  73. package/universal/index.js +2037 -0
  74. package/universal/runtime-builder.d.ts.map +1 -1
  75. package/universal/types.d.ts.map +1 -1
  76. package/web-components/elements/fmcp-input.d.ts.map +1 -1
  77. package/web-components/elements/fmcp-select.d.ts.map +1 -1
  78. package/web-components/index.d.ts +0 -1
  79. package/web-components/index.d.ts.map +1 -1
  80. package/web-components/index.js +224 -289
  81. package/adapters/index.d.ts +0 -13
  82. package/adapters/index.d.ts.map +0 -1
  83. package/adapters/index.js +0 -462
  84. package/adapters/platform-meta.d.ts +0 -166
  85. package/adapters/platform-meta.d.ts.map +0 -1
  86. package/adapters/response-builder.d.ts +0 -108
  87. package/adapters/response-builder.d.ts.map +0 -1
  88. package/adapters/serving-mode.d.ts +0 -107
  89. package/adapters/serving-mode.d.ts.map +0 -1
  90. package/base-template/bridge.d.ts +0 -90
  91. package/base-template/bridge.d.ts.map +0 -1
  92. package/base-template/default-base-template.d.ts +0 -92
  93. package/base-template/default-base-template.d.ts.map +0 -1
  94. package/base-template/index.d.ts +0 -15
  95. package/base-template/index.d.ts.map +0 -1
  96. package/base-template/index.js +0 -1398
  97. package/base-template/polyfills.d.ts +0 -31
  98. package/base-template/polyfills.d.ts.map +0 -1
  99. package/base-template/theme-styles.d.ts +0 -74
  100. package/base-template/theme-styles.d.ts.map +0 -1
  101. package/build/cdn-resources.d.ts +0 -243
  102. package/build/cdn-resources.d.ts.map +0 -1
  103. package/build/index.d.ts +0 -295
  104. package/build/index.d.ts.map +0 -1
  105. package/build/index.js +0 -7096
  106. package/build/widget-manifest.d.ts +0 -362
  107. package/build/widget-manifest.d.ts.map +0 -1
  108. package/bundler/cache.d.ts +0 -173
  109. package/bundler/cache.d.ts.map +0 -1
  110. package/bundler/file-cache/component-builder.d.ts +0 -167
  111. package/bundler/file-cache/component-builder.d.ts.map +0 -1
  112. package/bundler/file-cache/hash-calculator.d.ts +0 -155
  113. package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  114. package/bundler/file-cache/index.d.ts +0 -12
  115. package/bundler/file-cache/index.d.ts.map +0 -1
  116. package/bundler/file-cache/storage/filesystem.d.ts +0 -149
  117. package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  118. package/bundler/file-cache/storage/index.d.ts +0 -11
  119. package/bundler/file-cache/storage/index.d.ts.map +0 -1
  120. package/bundler/file-cache/storage/interface.d.ts +0 -152
  121. package/bundler/file-cache/storage/interface.d.ts.map +0 -1
  122. package/bundler/file-cache/storage/redis.d.ts +0 -139
  123. package/bundler/file-cache/storage/redis.d.ts.map +0 -1
  124. package/bundler/sandbox/enclave-adapter.d.ts +0 -121
  125. package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  126. package/bundler/sandbox/executor.d.ts +0 -14
  127. package/bundler/sandbox/executor.d.ts.map +0 -1
  128. package/bundler/sandbox/policy.d.ts +0 -62
  129. package/bundler/sandbox/policy.d.ts.map +0 -1
  130. package/dependency/cdn-registry.d.ts +0 -98
  131. package/dependency/cdn-registry.d.ts.map +0 -1
  132. package/dependency/import-map.d.ts +0 -186
  133. package/dependency/import-map.d.ts.map +0 -1
  134. package/dependency/import-parser.d.ts +0 -82
  135. package/dependency/import-parser.d.ts.map +0 -1
  136. package/dependency/index.d.ts +0 -17
  137. package/dependency/index.d.ts.map +0 -1
  138. package/dependency/resolver.d.ts +0 -164
  139. package/dependency/resolver.d.ts.map +0 -1
  140. package/dependency/schemas.d.ts +0 -486
  141. package/dependency/schemas.d.ts.map +0 -1
  142. package/dependency/template-loader.d.ts +0 -204
  143. package/dependency/template-loader.d.ts.map +0 -1
  144. package/dependency/template-processor.d.ts +0 -118
  145. package/dependency/template-processor.d.ts.map +0 -1
  146. package/dependency/types.d.ts +0 -739
  147. package/dependency/types.d.ts.map +0 -1
  148. package/esm/adapters/index.d.ts +0 -13
  149. package/esm/adapters/index.d.ts.map +0 -1
  150. package/esm/adapters/index.js +0 -427
  151. package/esm/adapters/platform-meta.d.ts +0 -166
  152. package/esm/adapters/platform-meta.d.ts.map +0 -1
  153. package/esm/adapters/response-builder.d.ts +0 -108
  154. package/esm/adapters/response-builder.d.ts.map +0 -1
  155. package/esm/adapters/serving-mode.d.ts +0 -107
  156. package/esm/adapters/serving-mode.d.ts.map +0 -1
  157. package/esm/base-template/bridge.d.ts +0 -90
  158. package/esm/base-template/bridge.d.ts.map +0 -1
  159. package/esm/base-template/default-base-template.d.ts +0 -92
  160. package/esm/base-template/default-base-template.d.ts.map +0 -1
  161. package/esm/base-template/index.d.ts +0 -15
  162. package/esm/base-template/index.d.ts.map +0 -1
  163. package/esm/base-template/index.js +0 -1364
  164. package/esm/base-template/polyfills.d.ts +0 -31
  165. package/esm/base-template/polyfills.d.ts.map +0 -1
  166. package/esm/base-template/theme-styles.d.ts +0 -74
  167. package/esm/base-template/theme-styles.d.ts.map +0 -1
  168. package/esm/bridge/adapters/base-adapter.d.ts +0 -104
  169. package/esm/bridge/adapters/base-adapter.d.ts.map +0 -1
  170. package/esm/bridge/adapters/claude.adapter.d.ts +0 -67
  171. package/esm/bridge/adapters/claude.adapter.d.ts.map +0 -1
  172. package/esm/bridge/adapters/ext-apps.adapter.d.ts +0 -143
  173. package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +0 -1
  174. package/esm/bridge/adapters/gemini.adapter.d.ts +0 -64
  175. package/esm/bridge/adapters/gemini.adapter.d.ts.map +0 -1
  176. package/esm/bridge/adapters/generic.adapter.d.ts +0 -56
  177. package/esm/bridge/adapters/generic.adapter.d.ts.map +0 -1
  178. package/esm/bridge/adapters/index.d.ts +0 -26
  179. package/esm/bridge/adapters/index.d.ts.map +0 -1
  180. package/esm/bridge/adapters/openai.adapter.d.ts +0 -65
  181. package/esm/bridge/adapters/openai.adapter.d.ts.map +0 -1
  182. package/esm/bridge/core/adapter-registry.d.ts +0 -122
  183. package/esm/bridge/core/adapter-registry.d.ts.map +0 -1
  184. package/esm/bridge/core/bridge-factory.d.ts +0 -199
  185. package/esm/bridge/core/bridge-factory.d.ts.map +0 -1
  186. package/esm/bridge/core/index.d.ts +0 -10
  187. package/esm/bridge/core/index.d.ts.map +0 -1
  188. package/esm/bridge/index.d.ts +0 -62
  189. package/esm/bridge/index.d.ts.map +0 -1
  190. package/esm/bridge/runtime/iife-generator.d.ts +0 -62
  191. package/esm/bridge/runtime/iife-generator.d.ts.map +0 -1
  192. package/esm/bridge/runtime/index.d.ts +0 -9
  193. package/esm/bridge/runtime/index.d.ts.map +0 -1
  194. package/esm/bridge/types.d.ts +0 -386
  195. package/esm/bridge/types.d.ts.map +0 -1
  196. package/esm/build/cdn-resources.d.ts +0 -243
  197. package/esm/build/cdn-resources.d.ts.map +0 -1
  198. package/esm/build/index.d.ts +0 -295
  199. package/esm/build/index.d.ts.map +0 -1
  200. package/esm/build/index.js +0 -7021
  201. package/esm/build/widget-manifest.d.ts +0 -362
  202. package/esm/build/widget-manifest.d.ts.map +0 -1
  203. package/esm/bundler/bundler.d.ts +0 -208
  204. package/esm/bundler/bundler.d.ts.map +0 -1
  205. package/esm/bundler/cache.d.ts +0 -173
  206. package/esm/bundler/cache.d.ts.map +0 -1
  207. package/esm/bundler/file-cache/component-builder.d.ts +0 -167
  208. package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
  209. package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
  210. package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  211. package/esm/bundler/file-cache/index.d.ts +0 -12
  212. package/esm/bundler/file-cache/index.d.ts.map +0 -1
  213. package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
  214. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  215. package/esm/bundler/file-cache/storage/index.d.ts +0 -11
  216. package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
  217. package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
  218. package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
  219. package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
  220. package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
  221. package/esm/bundler/index.d.ts +0 -43
  222. package/esm/bundler/index.d.ts.map +0 -1
  223. package/esm/bundler/index.js +0 -4687
  224. package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
  225. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  226. package/esm/bundler/sandbox/executor.d.ts +0 -14
  227. package/esm/bundler/sandbox/executor.d.ts.map +0 -1
  228. package/esm/bundler/sandbox/policy.d.ts +0 -62
  229. package/esm/bundler/sandbox/policy.d.ts.map +0 -1
  230. package/esm/bundler/types.d.ts +0 -702
  231. package/esm/bundler/types.d.ts.map +0 -1
  232. package/esm/components/alert.d.ts +0 -66
  233. package/esm/components/alert.d.ts.map +0 -1
  234. package/esm/components/alert.schema.d.ts +0 -98
  235. package/esm/components/alert.schema.d.ts.map +0 -1
  236. package/esm/components/avatar.d.ts +0 -77
  237. package/esm/components/avatar.d.ts.map +0 -1
  238. package/esm/components/avatar.schema.d.ts +0 -170
  239. package/esm/components/avatar.schema.d.ts.map +0 -1
  240. package/esm/components/badge.d.ts +0 -64
  241. package/esm/components/badge.d.ts.map +0 -1
  242. package/esm/components/badge.schema.d.ts +0 -91
  243. package/esm/components/badge.schema.d.ts.map +0 -1
  244. package/esm/components/button.d.ts +0 -100
  245. package/esm/components/button.d.ts.map +0 -1
  246. package/esm/components/button.schema.d.ts +0 -120
  247. package/esm/components/button.schema.d.ts.map +0 -1
  248. package/esm/components/card.d.ts +0 -53
  249. package/esm/components/card.d.ts.map +0 -1
  250. package/esm/components/card.schema.d.ts +0 -93
  251. package/esm/components/card.schema.d.ts.map +0 -1
  252. package/esm/components/form.d.ts +0 -212
  253. package/esm/components/form.d.ts.map +0 -1
  254. package/esm/components/form.schema.d.ts +0 -365
  255. package/esm/components/form.schema.d.ts.map +0 -1
  256. package/esm/components/index.d.ts +0 -29
  257. package/esm/components/index.d.ts.map +0 -1
  258. package/esm/components/list.d.ts +0 -121
  259. package/esm/components/list.d.ts.map +0 -1
  260. package/esm/components/list.schema.d.ts +0 -129
  261. package/esm/components/list.schema.d.ts.map +0 -1
  262. package/esm/components/modal.d.ts +0 -100
  263. package/esm/components/modal.d.ts.map +0 -1
  264. package/esm/components/modal.schema.d.ts +0 -151
  265. package/esm/components/modal.schema.d.ts.map +0 -1
  266. package/esm/components/table.d.ts +0 -91
  267. package/esm/components/table.d.ts.map +0 -1
  268. package/esm/components/table.schema.d.ts +0 -123
  269. package/esm/components/table.schema.d.ts.map +0 -1
  270. package/esm/dependency/cdn-registry.d.ts +0 -98
  271. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  272. package/esm/dependency/import-map.d.ts +0 -186
  273. package/esm/dependency/import-map.d.ts.map +0 -1
  274. package/esm/dependency/import-parser.d.ts +0 -82
  275. package/esm/dependency/import-parser.d.ts.map +0 -1
  276. package/esm/dependency/index.d.ts +0 -17
  277. package/esm/dependency/index.d.ts.map +0 -1
  278. package/esm/dependency/resolver.d.ts +0 -164
  279. package/esm/dependency/resolver.d.ts.map +0 -1
  280. package/esm/dependency/schemas.d.ts +0 -486
  281. package/esm/dependency/schemas.d.ts.map +0 -1
  282. package/esm/dependency/template-loader.d.ts +0 -204
  283. package/esm/dependency/template-loader.d.ts.map +0 -1
  284. package/esm/dependency/template-processor.d.ts +0 -118
  285. package/esm/dependency/template-processor.d.ts.map +0 -1
  286. package/esm/dependency/types.d.ts +0 -739
  287. package/esm/dependency/types.d.ts.map +0 -1
  288. package/esm/handlebars/expression-extractor.d.ts +0 -147
  289. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  290. package/esm/handlebars/helpers.d.ts +0 -339
  291. package/esm/handlebars/helpers.d.ts.map +0 -1
  292. package/esm/handlebars/index.d.ts +0 -195
  293. package/esm/handlebars/index.d.ts.map +0 -1
  294. package/esm/handlebars/index.js +0 -587
  295. package/esm/index.d.ts +0 -56
  296. package/esm/index.d.ts.map +0 -1
  297. package/esm/index.js +0 -20511
  298. package/esm/layouts/base.d.ts +0 -86
  299. package/esm/layouts/base.d.ts.map +0 -1
  300. package/esm/layouts/index.d.ts +0 -8
  301. package/esm/layouts/index.d.ts.map +0 -1
  302. package/esm/layouts/index.js +0 -892
  303. package/esm/layouts/presets.d.ts +0 -134
  304. package/esm/layouts/presets.d.ts.map +0 -1
  305. package/esm/pages/consent.d.ts +0 -117
  306. package/esm/pages/consent.d.ts.map +0 -1
  307. package/esm/pages/error.d.ts +0 -101
  308. package/esm/pages/error.d.ts.map +0 -1
  309. package/esm/pages/index.d.ts +0 -9
  310. package/esm/pages/index.d.ts.map +0 -1
  311. package/esm/pages/index.js +0 -1563
  312. package/esm/react/Alert.d.ts +0 -102
  313. package/esm/react/Alert.d.ts.map +0 -1
  314. package/esm/react/Badge.d.ts +0 -101
  315. package/esm/react/Badge.d.ts.map +0 -1
  316. package/esm/react/Button.d.ts +0 -109
  317. package/esm/react/Button.d.ts.map +0 -1
  318. package/esm/react/Card.d.ts +0 -104
  319. package/esm/react/Card.d.ts.map +0 -1
  320. package/esm/react/hooks/context.d.ts +0 -179
  321. package/esm/react/hooks/context.d.ts.map +0 -1
  322. package/esm/react/hooks/index.d.ts +0 -42
  323. package/esm/react/hooks/index.d.ts.map +0 -1
  324. package/esm/react/hooks/tools.d.ts +0 -284
  325. package/esm/react/hooks/tools.d.ts.map +0 -1
  326. package/esm/react/index.d.ts +0 -81
  327. package/esm/react/index.d.ts.map +0 -1
  328. package/esm/react/types.d.ts +0 -106
  329. package/esm/react/types.d.ts.map +0 -1
  330. package/esm/react/utils.d.ts +0 -43
  331. package/esm/react/utils.d.ts.map +0 -1
  332. package/esm/registry/index.d.ts +0 -46
  333. package/esm/registry/index.d.ts.map +0 -1
  334. package/esm/registry/index.js +0 -6422
  335. package/esm/registry/render-template.d.ts +0 -91
  336. package/esm/registry/render-template.d.ts.map +0 -1
  337. package/esm/registry/tool-ui.registry.d.ts +0 -294
  338. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  339. package/esm/registry/uri-utils.d.ts +0 -56
  340. package/esm/registry/uri-utils.d.ts.map +0 -1
  341. package/esm/render/index.d.ts +0 -8
  342. package/esm/render/index.d.ts.map +0 -1
  343. package/esm/render/prerender.d.ts +0 -57
  344. package/esm/render/prerender.d.ts.map +0 -1
  345. package/esm/renderers/cache.d.ts +0 -145
  346. package/esm/renderers/cache.d.ts.map +0 -1
  347. package/esm/renderers/html.renderer.d.ts +0 -123
  348. package/esm/renderers/html.renderer.d.ts.map +0 -1
  349. package/esm/renderers/index.d.ts +0 -36
  350. package/esm/renderers/index.d.ts.map +0 -1
  351. package/esm/renderers/index.js +0 -1827
  352. package/esm/renderers/mdx.renderer.d.ts +0 -120
  353. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  354. package/esm/renderers/react.renderer.d.ts +0 -96
  355. package/esm/renderers/react.renderer.d.ts.map +0 -1
  356. package/esm/renderers/registry.d.ts +0 -134
  357. package/esm/renderers/registry.d.ts.map +0 -1
  358. package/esm/renderers/types.d.ts +0 -342
  359. package/esm/renderers/types.d.ts.map +0 -1
  360. package/esm/renderers/utils/detect.d.ts +0 -107
  361. package/esm/renderers/utils/detect.d.ts.map +0 -1
  362. package/esm/renderers/utils/hash.d.ts +0 -40
  363. package/esm/renderers/utils/hash.d.ts.map +0 -1
  364. package/esm/renderers/utils/index.d.ts +0 -9
  365. package/esm/renderers/utils/index.d.ts.map +0 -1
  366. package/esm/renderers/utils/transpiler.d.ts +0 -89
  367. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  368. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  369. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  370. package/esm/runtime/adapters/index.d.ts +0 -26
  371. package/esm/runtime/adapters/index.d.ts.map +0 -1
  372. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  373. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  374. package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
  375. package/esm/runtime/adapters/types.d.ts +0 -95
  376. package/esm/runtime/adapters/types.d.ts.map +0 -1
  377. package/esm/runtime/csp.d.ts +0 -48
  378. package/esm/runtime/csp.d.ts.map +0 -1
  379. package/esm/runtime/index.d.ts +0 -17
  380. package/esm/runtime/index.d.ts.map +0 -1
  381. package/esm/runtime/index.js +0 -5186
  382. package/esm/runtime/mcp-bridge.d.ts +0 -101
  383. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  384. package/esm/runtime/renderer-runtime.d.ts +0 -133
  385. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  386. package/esm/runtime/sanitizer.d.ts +0 -172
  387. package/esm/runtime/sanitizer.d.ts.map +0 -1
  388. package/esm/runtime/types.d.ts +0 -415
  389. package/esm/runtime/types.d.ts.map +0 -1
  390. package/esm/runtime/wrapper.d.ts +0 -421
  391. package/esm/runtime/wrapper.d.ts.map +0 -1
  392. package/esm/styles/index.d.ts +0 -8
  393. package/esm/styles/index.d.ts.map +0 -1
  394. package/esm/styles/index.js +0 -171
  395. package/esm/styles/variants.d.ts +0 -51
  396. package/esm/styles/variants.d.ts.map +0 -1
  397. package/esm/theme/cdn.d.ts +0 -195
  398. package/esm/theme/cdn.d.ts.map +0 -1
  399. package/esm/theme/index.d.ts +0 -18
  400. package/esm/theme/index.d.ts.map +0 -1
  401. package/esm/theme/index.js +0 -700
  402. package/esm/theme/platforms.d.ts +0 -107
  403. package/esm/theme/platforms.d.ts.map +0 -1
  404. package/esm/theme/presets/github-openai.d.ts +0 -50
  405. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  406. package/esm/theme/presets/index.d.ts +0 -11
  407. package/esm/theme/presets/index.d.ts.map +0 -1
  408. package/esm/theme/theme.d.ts +0 -396
  409. package/esm/theme/theme.d.ts.map +0 -1
  410. package/esm/tool-template/builder.d.ts +0 -213
  411. package/esm/tool-template/builder.d.ts.map +0 -1
  412. package/esm/tool-template/index.d.ts +0 -16
  413. package/esm/tool-template/index.d.ts.map +0 -1
  414. package/esm/tool-template/index.js +0 -3515
  415. package/esm/types/index.d.ts +0 -14
  416. package/esm/types/index.d.ts.map +0 -1
  417. package/esm/types/index.js +0 -75
  418. package/esm/types/ui-config.d.ts +0 -639
  419. package/esm/types/ui-config.d.ts.map +0 -1
  420. package/esm/types/ui-runtime.d.ts +0 -1007
  421. package/esm/types/ui-runtime.d.ts.map +0 -1
  422. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  423. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  424. package/esm/typings/cache/index.d.ts +0 -10
  425. package/esm/typings/cache/index.d.ts.map +0 -1
  426. package/esm/typings/cache/memory-cache.d.ts +0 -92
  427. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  428. package/esm/typings/dts-parser.d.ts +0 -90
  429. package/esm/typings/dts-parser.d.ts.map +0 -1
  430. package/esm/typings/index.d.ts +0 -48
  431. package/esm/typings/index.d.ts.map +0 -1
  432. package/esm/typings/schemas.d.ts +0 -232
  433. package/esm/typings/schemas.d.ts.map +0 -1
  434. package/esm/typings/type-fetcher.d.ts +0 -89
  435. package/esm/typings/type-fetcher.d.ts.map +0 -1
  436. package/esm/typings/types.d.ts +0 -320
  437. package/esm/typings/types.d.ts.map +0 -1
  438. package/esm/universal/UniversalApp.d.ts +0 -108
  439. package/esm/universal/UniversalApp.d.ts.map +0 -1
  440. package/esm/universal/cached-runtime.d.ts +0 -115
  441. package/esm/universal/cached-runtime.d.ts.map +0 -1
  442. package/esm/universal/context.d.ts +0 -122
  443. package/esm/universal/context.d.ts.map +0 -1
  444. package/esm/universal/index.d.ts +0 -57
  445. package/esm/universal/index.d.ts.map +0 -1
  446. package/esm/universal/renderers/html.renderer.d.ts +0 -37
  447. package/esm/universal/renderers/html.renderer.d.ts.map +0 -1
  448. package/esm/universal/renderers/index.d.ts +0 -112
  449. package/esm/universal/renderers/index.d.ts.map +0 -1
  450. package/esm/universal/renderers/markdown.renderer.d.ts +0 -33
  451. package/esm/universal/renderers/markdown.renderer.d.ts.map +0 -1
  452. package/esm/universal/renderers/mdx.renderer.d.ts +0 -38
  453. package/esm/universal/renderers/mdx.renderer.d.ts.map +0 -1
  454. package/esm/universal/renderers/react.renderer.d.ts +0 -46
  455. package/esm/universal/renderers/react.renderer.d.ts.map +0 -1
  456. package/esm/universal/runtime-builder.d.ts +0 -33
  457. package/esm/universal/runtime-builder.d.ts.map +0 -1
  458. package/esm/universal/store.d.ts +0 -135
  459. package/esm/universal/store.d.ts.map +0 -1
  460. package/esm/universal/types.d.ts +0 -199
  461. package/esm/universal/types.d.ts.map +0 -1
  462. package/esm/utils/escape-html.d.ts +0 -58
  463. package/esm/utils/escape-html.d.ts.map +0 -1
  464. package/esm/utils/index.d.ts +0 -10
  465. package/esm/utils/index.d.ts.map +0 -1
  466. package/esm/utils/index.js +0 -40
  467. package/esm/utils/safe-stringify.d.ts +0 -30
  468. package/esm/utils/safe-stringify.d.ts.map +0 -1
  469. package/esm/validation/error-box.d.ts +0 -56
  470. package/esm/validation/error-box.d.ts.map +0 -1
  471. package/esm/validation/index.d.ts +0 -13
  472. package/esm/validation/index.d.ts.map +0 -1
  473. package/esm/validation/index.js +0 -562
  474. package/esm/validation/schema-paths.d.ts +0 -118
  475. package/esm/validation/schema-paths.d.ts.map +0 -1
  476. package/esm/validation/template-validator.d.ts +0 -143
  477. package/esm/validation/template-validator.d.ts.map +0 -1
  478. package/esm/validation/wrapper.d.ts +0 -97
  479. package/esm/validation/wrapper.d.ts.map +0 -1
  480. package/esm/web-components/core/attribute-parser.d.ts +0 -82
  481. package/esm/web-components/core/attribute-parser.d.ts.map +0 -1
  482. package/esm/web-components/core/base-element.d.ts +0 -197
  483. package/esm/web-components/core/base-element.d.ts.map +0 -1
  484. package/esm/web-components/core/index.d.ts +0 -9
  485. package/esm/web-components/core/index.d.ts.map +0 -1
  486. package/esm/web-components/elements/fmcp-alert.d.ts +0 -46
  487. package/esm/web-components/elements/fmcp-alert.d.ts.map +0 -1
  488. package/esm/web-components/elements/fmcp-badge.d.ts +0 -47
  489. package/esm/web-components/elements/fmcp-badge.d.ts.map +0 -1
  490. package/esm/web-components/elements/fmcp-button.d.ts +0 -117
  491. package/esm/web-components/elements/fmcp-button.d.ts.map +0 -1
  492. package/esm/web-components/elements/fmcp-card.d.ts +0 -53
  493. package/esm/web-components/elements/fmcp-card.d.ts.map +0 -1
  494. package/esm/web-components/elements/fmcp-input.d.ts +0 -96
  495. package/esm/web-components/elements/fmcp-input.d.ts.map +0 -1
  496. package/esm/web-components/elements/fmcp-select.d.ts +0 -100
  497. package/esm/web-components/elements/fmcp-select.d.ts.map +0 -1
  498. package/esm/web-components/elements/index.d.ts +0 -13
  499. package/esm/web-components/elements/index.d.ts.map +0 -1
  500. package/esm/web-components/index.d.ts +0 -50
  501. package/esm/web-components/index.d.ts.map +0 -1
  502. package/esm/web-components/register.d.ts +0 -57
  503. package/esm/web-components/register.d.ts.map +0 -1
  504. package/esm/web-components/types.d.ts +0 -122
  505. package/esm/web-components/types.d.ts.map +0 -1
  506. package/esm/widgets/index.d.ts +0 -8
  507. package/esm/widgets/index.d.ts.map +0 -1
  508. package/esm/widgets/index.js +0 -941
  509. package/esm/widgets/progress.d.ts +0 -133
  510. package/esm/widgets/progress.d.ts.map +0 -1
  511. package/esm/widgets/resource.d.ts +0 -163
  512. package/esm/widgets/resource.d.ts.map +0 -1
  513. package/handlebars/expression-extractor.d.ts +0 -147
  514. package/handlebars/expression-extractor.d.ts.map +0 -1
  515. package/handlebars/helpers.d.ts +0 -339
  516. package/handlebars/helpers.d.ts.map +0 -1
  517. package/handlebars/index.d.ts +0 -195
  518. package/handlebars/index.d.ts.map +0 -1
  519. package/handlebars/index.js +0 -666
  520. package/pages/consent.d.ts +0 -117
  521. package/pages/consent.d.ts.map +0 -1
  522. package/pages/error.d.ts +0 -101
  523. package/pages/error.d.ts.map +0 -1
  524. package/pages/index.d.ts +0 -9
  525. package/pages/index.d.ts.map +0 -1
  526. package/pages/index.js +0 -1602
  527. package/react/utils.d.ts +0 -43
  528. package/react/utils.d.ts.map +0 -1
  529. package/registry/index.d.ts +0 -46
  530. package/registry/index.d.ts.map +0 -1
  531. package/registry/index.js +0 -6465
  532. package/registry/render-template.d.ts +0 -91
  533. package/registry/render-template.d.ts.map +0 -1
  534. package/registry/tool-ui.registry.d.ts +0 -294
  535. package/registry/tool-ui.registry.d.ts.map +0 -1
  536. package/registry/uri-utils.d.ts +0 -56
  537. package/registry/uri-utils.d.ts.map +0 -1
  538. package/renderers/cache.d.ts +0 -145
  539. package/renderers/cache.d.ts.map +0 -1
  540. package/renderers/html.renderer.d.ts +0 -123
  541. package/renderers/html.renderer.d.ts.map +0 -1
  542. package/renderers/registry.d.ts +0 -134
  543. package/renderers/registry.d.ts.map +0 -1
  544. package/renderers/types.d.ts +0 -342
  545. package/renderers/types.d.ts.map +0 -1
  546. package/renderers/utils/detect.d.ts +0 -107
  547. package/renderers/utils/detect.d.ts.map +0 -1
  548. package/renderers/utils/hash.d.ts +0 -40
  549. package/renderers/utils/hash.d.ts.map +0 -1
  550. package/renderers/utils/index.d.ts +0 -9
  551. package/renderers/utils/index.d.ts.map +0 -1
  552. package/renderers/utils/transpiler.d.ts +0 -89
  553. package/renderers/utils/transpiler.d.ts.map +0 -1
  554. package/runtime/adapters/html.adapter.d.ts +0 -59
  555. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  556. package/runtime/adapters/index.d.ts +0 -26
  557. package/runtime/adapters/index.d.ts.map +0 -1
  558. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  559. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  560. package/runtime/adapters/react.adapter.d.ts +0 -70
  561. package/runtime/adapters/react.adapter.d.ts.map +0 -1
  562. package/runtime/adapters/types.d.ts +0 -95
  563. package/runtime/adapters/types.d.ts.map +0 -1
  564. package/runtime/csp.d.ts +0 -48
  565. package/runtime/csp.d.ts.map +0 -1
  566. package/runtime/index.d.ts +0 -17
  567. package/runtime/index.d.ts.map +0 -1
  568. package/runtime/index.js +0 -5264
  569. package/runtime/mcp-bridge.d.ts +0 -101
  570. package/runtime/mcp-bridge.d.ts.map +0 -1
  571. package/runtime/renderer-runtime.d.ts +0 -133
  572. package/runtime/renderer-runtime.d.ts.map +0 -1
  573. package/runtime/sanitizer.d.ts +0 -172
  574. package/runtime/sanitizer.d.ts.map +0 -1
  575. package/runtime/types.d.ts +0 -415
  576. package/runtime/types.d.ts.map +0 -1
  577. package/runtime/wrapper.d.ts +0 -421
  578. package/runtime/wrapper.d.ts.map +0 -1
  579. package/styles/index.d.ts +0 -8
  580. package/styles/index.d.ts.map +0 -1
  581. package/styles/index.js +0 -222
  582. package/styles/variants.d.ts +0 -51
  583. package/styles/variants.d.ts.map +0 -1
  584. package/theme/cdn.d.ts +0 -195
  585. package/theme/cdn.d.ts.map +0 -1
  586. package/theme/index.d.ts +0 -18
  587. package/theme/index.d.ts.map +0 -1
  588. package/theme/index.js +0 -757
  589. package/theme/platforms.d.ts +0 -107
  590. package/theme/platforms.d.ts.map +0 -1
  591. package/theme/presets/github-openai.d.ts +0 -50
  592. package/theme/presets/github-openai.d.ts.map +0 -1
  593. package/theme/presets/index.d.ts +0 -11
  594. package/theme/presets/index.d.ts.map +0 -1
  595. package/theme/theme.d.ts +0 -396
  596. package/theme/theme.d.ts.map +0 -1
  597. package/tool-template/builder.d.ts +0 -213
  598. package/tool-template/builder.d.ts.map +0 -1
  599. package/tool-template/index.d.ts +0 -16
  600. package/tool-template/index.d.ts.map +0 -1
  601. package/tool-template/index.js +0 -3559
  602. package/types/index.d.ts +0 -14
  603. package/types/index.d.ts.map +0 -1
  604. package/types/index.js +0 -108
  605. package/types/ui-config.d.ts +0 -639
  606. package/types/ui-config.d.ts.map +0 -1
  607. package/types/ui-runtime.d.ts +0 -1007
  608. package/types/ui-runtime.d.ts.map +0 -1
  609. package/typings/cache/cache-adapter.d.ts +0 -125
  610. package/typings/cache/cache-adapter.d.ts.map +0 -1
  611. package/typings/cache/index.d.ts +0 -10
  612. package/typings/cache/index.d.ts.map +0 -1
  613. package/typings/cache/memory-cache.d.ts +0 -92
  614. package/typings/cache/memory-cache.d.ts.map +0 -1
  615. package/typings/dts-parser.d.ts +0 -90
  616. package/typings/dts-parser.d.ts.map +0 -1
  617. package/typings/index.d.ts +0 -48
  618. package/typings/index.d.ts.map +0 -1
  619. package/typings/schemas.d.ts +0 -232
  620. package/typings/schemas.d.ts.map +0 -1
  621. package/typings/type-fetcher.d.ts +0 -89
  622. package/typings/type-fetcher.d.ts.map +0 -1
  623. package/typings/types.d.ts +0 -320
  624. package/typings/types.d.ts.map +0 -1
  625. package/utils/escape-html.d.ts +0 -58
  626. package/utils/escape-html.d.ts.map +0 -1
  627. package/utils/index.d.ts +0 -10
  628. package/utils/index.d.ts.map +0 -1
  629. package/utils/index.js +0 -70
  630. package/utils/safe-stringify.d.ts +0 -30
  631. package/utils/safe-stringify.d.ts.map +0 -1
  632. package/validation/error-box.d.ts +0 -56
  633. package/validation/error-box.d.ts.map +0 -1
  634. package/validation/index.d.ts +0 -13
  635. package/validation/index.d.ts.map +0 -1
  636. package/validation/index.js +0 -603
  637. package/validation/schema-paths.d.ts +0 -118
  638. package/validation/schema-paths.d.ts.map +0 -1
  639. package/validation/template-validator.d.ts +0 -143
  640. package/validation/template-validator.d.ts.map +0 -1
  641. package/validation/wrapper.d.ts +0 -97
  642. package/validation/wrapper.d.ts.map +0 -1
  643. package/widgets/index.d.ts +0 -8
  644. package/widgets/index.d.ts.map +0 -1
  645. package/widgets/index.js +0 -978
  646. package/widgets/progress.d.ts +0 -133
  647. package/widgets/progress.d.ts.map +0 -1
  648. package/widgets/resource.d.ts +0 -163
  649. package/widgets/resource.d.ts.map +0 -1
  650. /package/esm/render/{index.js → index.mjs} +0 -0
@@ -1,362 +0,0 @@
1
- /**
2
- * Widget Manifest Builder
3
- *
4
- * Builds static widget wrappers with embedded manifests for tool UIs.
5
- * Produces complete HTML documents with FrontMCP Bridge runtime.
6
- *
7
- * @packageDocumentation
8
- */
9
- import type { UIType, ResourceMode, OutputMode, CSPDirectives, RendererAssets, WidgetConfig, BuildManifestResult, BuildManifestOptions, ToolResponseMeta } from '../types/ui-runtime';
10
- import type { ThemeConfig } from '../theme';
11
- import type { CDNPlatformType, ComponentBuildManifest } from '../dependency/types';
12
- /**
13
- * Check if a template is a file path.
14
- *
15
- * @param template - Widget template
16
- * @returns true if the template is a file path
17
- */
18
- export declare function isFilePathTemplate(template: unknown): template is string;
19
- /**
20
- * Check if a template is a URL.
21
- *
22
- * @param template - Widget template
23
- * @returns true if the template is a URL
24
- */
25
- export declare function isUrlTemplate(template: unknown): template is string;
26
- /**
27
- * Check if a template is file-based (either file path or URL).
28
- *
29
- * @param template - Widget template
30
- * @returns true if the template is file-based
31
- */
32
- export declare function isFileBasedTemplate(template: unknown): template is string;
33
- /**
34
- * Detect the UI type from a template.
35
- *
36
- * @param template - Widget template
37
- * @returns Detected UI type
38
- */
39
- export declare function detectUIType(template: WidgetConfig['template']): UIType;
40
- /**
41
- * Build CSP directives for a UI type.
42
- *
43
- * @param uiType - UI renderer type
44
- * @param userCsp - User-provided CSP overrides
45
- * @returns Complete CSP directives
46
- */
47
- export declare function buildCSPForType(uiType: UIType, userCsp?: Partial<CSPDirectives>): CSPDirectives;
48
- /**
49
- * Build CSP meta tag content.
50
- */
51
- export declare function buildCSPMetaContent(csp: CSPDirectives): string;
52
- /**
53
- * Get renderer assets for a UI type.
54
- *
55
- * @param uiType - UI renderer type
56
- * @param resourceMode - Resource loading mode (cdn or inline)
57
- * @returns Required renderer assets with CDN URLs or inline placeholders
58
- *
59
- * @example
60
- * ```typescript
61
- * // Get CDN-based assets for React
62
- * const assets = getRendererAssets('react', 'cdn');
63
- * console.log(assets.react?.url);
64
- * // "https://unpkg.com/react@18/umd/react.production.min.js"
65
- *
66
- * // Get inline-mode assets
67
- * const inlineAssets = getRendererAssets('react', 'inline');
68
- * // inlineAssets.mode === 'inline'
69
- * ```
70
- */
71
- export declare function getRendererAssets(uiType: UIType, resourceMode?: ResourceMode): RendererAssets;
72
- /**
73
- * Build a widget manifest for a tool.
74
- *
75
- * Creates a static widget wrapper with embedded manifest.
76
- * The widget can be cached and reused across tool invocations.
77
- *
78
- * @param options - Build options
79
- * @returns Build result with HTML, manifest, and metadata
80
- *
81
- * @example
82
- * ```typescript
83
- * import { buildToolWidgetManifest } from '@frontmcp/ui/build';
84
- *
85
- * const result = await buildToolWidgetManifest({
86
- * toolName: 'weather.get',
87
- * uiConfig: {
88
- * template: WeatherWidget,
89
- * uiType: 'react',
90
- * displayMode: 'inline',
91
- * widgetAccessible: true,
92
- * },
93
- * schema: { type: 'object', properties: { ... } },
94
- * });
95
- *
96
- * // Cache the HTML
97
- * cache.set(`ui://widget/${result.manifest.tool}.html`, result.html);
98
- * ```
99
- */
100
- export declare function buildToolWidgetManifest<Input = Record<string, unknown>, Output = unknown>(options: BuildManifestOptions<Input, Output>): Promise<BuildManifestResult>;
101
- /**
102
- * Options for batch building multiple widgets.
103
- */
104
- export interface BatchBuildOptions {
105
- /**
106
- * Array of tool configurations to build.
107
- */
108
- tools: Array<{
109
- toolName: string;
110
- uiConfig: WidgetConfig;
111
- schema?: object;
112
- }>;
113
- /**
114
- * Theme configuration to apply to all widgets.
115
- */
116
- theme?: ThemeConfig;
117
- /**
118
- * Enable parallel building.
119
- * @default true
120
- */
121
- parallel?: boolean;
122
- }
123
- /**
124
- * Result of batch building.
125
- */
126
- export interface BatchBuildResult {
127
- /**
128
- * Individual build results keyed by tool name.
129
- */
130
- results: Map<string, BuildManifestResult>;
131
- /**
132
- * Total build time in ms.
133
- */
134
- totalTime: number;
135
- /**
136
- * Number of successful builds.
137
- */
138
- successCount: number;
139
- /**
140
- * Errors encountered (keyed by tool name).
141
- */
142
- errors: Map<string, Error>;
143
- }
144
- /**
145
- * Build multiple widget manifests in batch.
146
- *
147
- * @param options - Batch build options
148
- * @returns Batch build results
149
- *
150
- * @example
151
- * ```typescript
152
- * const { results, errors } = await batchBuildWidgets({
153
- * tools: [
154
- * { toolName: 'weather.get', uiConfig: weatherConfig },
155
- * { toolName: 'stock.quote', uiConfig: stockConfig },
156
- * ],
157
- * });
158
- *
159
- * for (const [name, result] of results) {
160
- * cache.set(result.manifest.uri, result.html);
161
- * }
162
- * ```
163
- */
164
- export declare function batchBuildWidgets(options: BatchBuildOptions): Promise<BatchBuildResult>;
165
- /**
166
- * Options for building tool response _meta fields.
167
- */
168
- export interface BuildMetaOptions {
169
- /**
170
- * Build result from buildToolWidgetManifest.
171
- */
172
- buildResult: BuildManifestResult;
173
- /**
174
- * Output mode - determines which content to include.
175
- * - 'code-only': Include ui/content (transpiled code only)
176
- * - 'full-ssr': Include ui/html (complete HTML document)
177
- *
178
- * @default 'code-only'
179
- */
180
- outputMode?: OutputMode;
181
- /**
182
- * Include OpenAI-specific meta fields.
183
- * @default true
184
- */
185
- includeOpenAI?: boolean;
186
- }
187
- /**
188
- * Build _meta fields for a tool response.
189
- *
190
- * This function generates the proper _meta structure for UI widgets.
191
- * All UI-related data goes in _meta, NOT in the content array.
192
- *
193
- * @param options - Build options
194
- * @returns _meta fields object to spread into tool response
195
- *
196
- * @example
197
- * ```typescript
198
- * const buildResult = await buildToolWidgetManifest({...});
199
- *
200
- * // For OpenAI (code-only mode)
201
- * const meta = buildToolResponseMeta({
202
- * buildResult,
203
- * outputMode: 'code-only',
204
- * });
205
- *
206
- * return {
207
- * content: [{ type: 'text', text: 'Weather retrieved' }],
208
- * _meta: meta,
209
- * };
210
- *
211
- * // For unknown clients (full-ssr mode)
212
- * const meta = buildToolResponseMeta({
213
- * buildResult,
214
- * outputMode: 'full-ssr',
215
- * });
216
- * ```
217
- */
218
- export declare function buildToolResponseMeta(options: BuildMetaOptions): ToolResponseMeta;
219
- /**
220
- * Determine the appropriate output mode based on client info.
221
- *
222
- * Platform capabilities:
223
- * - OpenAI/ChatGPT/Cursor: Can load CDN scripts, use 'code-only' (smaller payload)
224
- * - Claude: Sandboxed artifacts block ALL external requests, MUST use 'full-ssr' (embedded HTML)
225
- * - Unknown: Default to 'full-ssr' for maximum compatibility
226
- *
227
- * @param clientInfo - MCP client information
228
- * @returns Recommended output mode
229
- *
230
- * @example
231
- * ```typescript
232
- * const outputMode = getOutputModeForClient(request.clientInfo);
233
- * const meta = buildToolResponseMeta({ buildResult, outputMode });
234
- * ```
235
- */
236
- export declare function getOutputModeForClient(clientInfo?: {
237
- name?: string;
238
- version?: string;
239
- }): OutputMode;
240
- /**
241
- * Options for building a file-based UI component.
242
- */
243
- export interface FileComponentBuildOptions {
244
- /**
245
- * File path to the component entry point.
246
- * @example './widgets/chart.tsx'
247
- */
248
- entryPath: string;
249
- /**
250
- * Tool name for this component.
251
- */
252
- toolName: string;
253
- /**
254
- * Packages to load from CDN.
255
- */
256
- externals?: string[];
257
- /**
258
- * Explicit CDN dependency overrides.
259
- */
260
- dependencies?: Record<string, import('../dependency/types').CDNDependency>;
261
- /**
262
- * Bundle options.
263
- */
264
- bundleOptions?: import('../dependency/types').FileBundleOptions;
265
- /**
266
- * Target platform for CDN selection.
267
- * @default 'unknown'
268
- */
269
- platform?: CDNPlatformType;
270
- /**
271
- * Whether to skip cache lookup.
272
- * @default false
273
- */
274
- skipCache?: boolean;
275
- }
276
- /**
277
- * Result of a file-based component build.
278
- */
279
- export interface FileComponentBuildResult {
280
- /**
281
- * The build manifest.
282
- */
283
- manifest: ComponentBuildManifest;
284
- /**
285
- * Complete HTML with dependencies and component code.
286
- */
287
- html: string;
288
- /**
289
- * Whether the result came from cache.
290
- */
291
- cached: boolean;
292
- /**
293
- * Build time in milliseconds.
294
- */
295
- buildTimeMs: number;
296
- }
297
- /**
298
- * Build a file-based UI component.
299
- *
300
- * This function handles the complete build pipeline for file-based templates:
301
- * 1. Check cache for existing build
302
- * 2. Parse entry file for imports
303
- * 3. Resolve external dependencies to CDN URLs
304
- * 4. Bundle the component with esbuild
305
- * 5. Generate import map for CDN dependencies
306
- * 6. Store result in cache
307
- *
308
- * @param options - Build options
309
- * @returns Build result with manifest and HTML
310
- *
311
- * @example
312
- * ```typescript
313
- * const result = await buildFileComponent({
314
- * entryPath: './widgets/chart.tsx',
315
- * toolName: 'chart_display',
316
- * externals: ['chart.js', 'react-chartjs-2'],
317
- * platform: 'claude',
318
- * });
319
- *
320
- * // Use the HTML in tool response
321
- * return {
322
- * content: [{ type: 'text', text: 'Chart rendered' }],
323
- * _meta: {
324
- * 'ui/html': result.html,
325
- * 'ui/hash': result.manifest.contentHash,
326
- * },
327
- * };
328
- * ```
329
- */
330
- export declare function buildFileComponent(options: FileComponentBuildOptions): Promise<FileComponentBuildResult>;
331
- /**
332
- * Build multiple file-based components.
333
- *
334
- * @param options - Array of build options
335
- * @returns Array of build results
336
- */
337
- export declare function buildFileComponents(options: FileComponentBuildOptions[]): Promise<FileComponentBuildResult[]>;
338
- /**
339
- * Check if a file-based component needs rebuilding.
340
- *
341
- * @param options - Build options (without skipCache)
342
- * @returns true if the component needs rebuilding
343
- */
344
- export declare function needsFileComponentRebuild(options: Omit<FileComponentBuildOptions, 'skipCache'>): Promise<boolean>;
345
- /**
346
- * Get a cached file-based component build.
347
- *
348
- * @param options - Build options
349
- * @returns Cached manifest or undefined
350
- */
351
- export declare function getCachedFileComponent(options: Omit<FileComponentBuildOptions, 'skipCache' | 'toolName'>): Promise<ComponentBuildManifest | undefined>;
352
- /**
353
- * Map MCP client info to platform type.
354
- *
355
- * @param clientInfo - MCP client information
356
- * @returns Platform type for CDN selection
357
- */
358
- export declare function getPlatformFromClientInfo(clientInfo?: {
359
- name?: string;
360
- version?: string;
361
- }): CDNPlatformType;
362
- //# sourceMappingURL=widget-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-manifest.d.ts","sourceRoot":"","sources":["../../../src/build/widget-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,MAAM,EAGN,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EAEd,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EAGpB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAU5C,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EAGvB,MAAM,qBAAqB,CAAC;AAS7B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAEnE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OA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H,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAkBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAoCnC;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,yBAAyB,EAAE,GACnC,OAAO,CAAC,wBAAwB,EAAE,CAAC,CAErC;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,WAAW,CAAC,GACpD,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,WAAW,GAAG,UAAU,CAAC,GACjE,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAQ7C;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,CAAC,EAAE;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,eAAe,CAelB"}
@@ -1,208 +0,0 @@
1
- /**
2
- * In-Memory Bundler
3
- *
4
- * Fast, secure bundler for JSX/TSX/MDX sources using esbuild.
5
- * Provides caching, security validation, and SSR support.
6
- *
7
- * @packageDocumentation
8
- */
9
- import type { BundleOptions, BundleResult, SSRBundleOptions, SSRResult, BundlerOptions, StaticHTMLOptions, StaticHTMLResult } from './types';
10
- /**
11
- * In-memory bundler for JSX/TSX/MDX sources.
12
- *
13
- * Features:
14
- * - Fast transformation using esbuild (fallback to SWC)
15
- * - Content-addressable caching
16
- * - Security validation (blocked imports, eval, etc.)
17
- * - SSR support for React components
18
- *
19
- * @example
20
- * ```typescript
21
- * const bundler = new InMemoryBundler();
22
- *
23
- * // Bundle JSX source
24
- * const result = await bundler.bundle({
25
- * source: 'const App = () => <div>Hello</div>; export default App;',
26
- * sourceType: 'jsx',
27
- * });
28
- *
29
- * console.log(result.code); // Bundled JavaScript
30
- * console.log(result.cached); // Whether from cache
31
- *
32
- * // SSR rendering
33
- * const ssrResult = await bundler.bundleSSR({
34
- * source: 'export default ({ data }) => <div>{data.message}</div>',
35
- * sourceType: 'jsx',
36
- * context: { data: { message: 'Hello' } },
37
- * });
38
- *
39
- * console.log(ssrResult.html); // Rendered HTML
40
- * ```
41
- */
42
- export declare class InMemoryBundler {
43
- private readonly cache;
44
- private readonly options;
45
- private readonly defaultSecurity;
46
- constructor(options?: BundlerOptions);
47
- /**
48
- * Bundle source code.
49
- *
50
- * @param options - Bundle options
51
- * @returns Bundle result
52
- */
53
- bundle(options: BundleOptions): Promise<BundleResult>;
54
- /**
55
- * Bundle and execute for SSR.
56
- *
57
- * @param options - SSR bundle options
58
- * @returns SSR result with rendered HTML
59
- */
60
- bundleSSR(options: SSRBundleOptions): Promise<SSRResult>;
61
- /**
62
- * Bundle and execute code, returning the exports.
63
- *
64
- * @param options - Bundle options
65
- * @param context - Execution context
66
- * @returns Exported value
67
- */
68
- bundleAndExecute<T = unknown>(options: BundleOptions, context?: Record<string, unknown>): Promise<T>;
69
- /**
70
- * Bundle a component to a self-contained static HTML document.
71
- *
72
- * Creates a complete HTML page with:
73
- * - React runtime (CDN or inline based on platform)
74
- * - FrontMCP UI hooks and components (always inline)
75
- * - Tool data injection (input/output)
76
- * - Transpiled component code
77
- * - Client-side rendering via createRoot
78
- *
79
- * @param options - Static HTML options
80
- * @returns Static HTML result with complete document
81
- *
82
- * @example
83
- * ```typescript
84
- * const result = await bundler.bundleToStaticHTML({
85
- * source: `
86
- * import { Card, useToolOutput } from '@frontmcp/ui/react';
87
- * export default function Weather() {
88
- * const output = useToolOutput();
89
- * return <Card title="Weather">{output?.temperature}°F</Card>;
90
- * }
91
- * `,
92
- * toolName: 'get_weather',
93
- * output: { temperature: 72 },
94
- * });
95
- *
96
- * // result.html contains the complete HTML document
97
- * ```
98
- */
99
- bundleToStaticHTML(options: StaticHTMLOptions): Promise<StaticHTMLResult>;
100
- /**
101
- * Bundle to static HTML with universal rendering mode.
102
- * Uses the universal renderer that can handle multiple content types.
103
- *
104
- * Optimization: Uses cached runtime (vendor chunk) to avoid rebuilding
105
- * static code on every request. Only the user's component is transpiled.
106
- */
107
- private bundleToStaticHTMLUniversal;
108
- /**
109
- * Assemble the complete universal static HTML document using cached runtime.
110
- *
111
- * For ESM mode (OpenAI), scripts must wait for React to load asynchronously.
112
- * For UMD mode (Claude), scripts can execute synchronously.
113
- */
114
- private assembleUniversalStaticHTMLCached;
115
- /**
116
- * Build the component script for transpiled React/MDX content.
117
- * Wraps CommonJS code with module/exports shim to capture the component.
118
- */
119
- private buildUniversalComponentScript;
120
- /**
121
- * Build the universal runtime script section.
122
- */
123
- private buildUniversalRuntimeScript;
124
- /**
125
- * Build data injection script for universal mode.
126
- */
127
- private buildUniversalDataScript;
128
- /**
129
- * Build the universal render script.
130
- */
131
- private buildUniversalRenderScript;
132
- /**
133
- * Assemble the complete universal static HTML document.
134
- */
135
- private assembleUniversalStaticHTML;
136
- /**
137
- * Get cache statistics.
138
- */
139
- getCacheStats(): import("./cache").CacheStats;
140
- /**
141
- * Clear the cache.
142
- */
143
- clearCache(): void;
144
- /**
145
- * Clean up expired cache entries.
146
- */
147
- cleanupCache(): number;
148
- /**
149
- * Transform source code using esbuild/SWC.
150
- */
151
- private transform;
152
- /**
153
- * Get esbuild loader for source type.
154
- */
155
- private getLoader;
156
- /**
157
- * Detect source type from content.
158
- */
159
- private detectSourceType;
160
- /**
161
- * Merge bundle options with defaults.
162
- */
163
- private mergeOptions;
164
- /**
165
- * Build hydration script for client-side React.
166
- */
167
- private buildHydrationScript;
168
- /**
169
- * Merge static HTML options with defaults.
170
- */
171
- private mergeStaticHTMLOptions;
172
- /**
173
- * Build the <head> section for static HTML.
174
- */
175
- private buildStaticHTMLHead;
176
- /**
177
- * Build React runtime scripts for static HTML.
178
- */
179
- private buildReactRuntimeScripts;
180
- /**
181
- * Build FrontMCP runtime (hooks and UI components).
182
- * Always inlined for reliability across platforms.
183
- */
184
- private buildFrontMCPRuntime;
185
- /**
186
- * Build data injection script for tool input/output.
187
- */
188
- private buildDataInjectionScript;
189
- /**
190
- * Build component render script.
191
- * Wraps CommonJS code with module/exports shim to capture the component.
192
- */
193
- private buildComponentRenderScript;
194
- /**
195
- * Assemble the complete static HTML document.
196
- */
197
- private assembleStaticHTML;
198
- }
199
- /**
200
- * Create a bundler instance with default options.
201
- *
202
- * @param options - Bundler configuration
203
- * @returns New bundler instance
204
- */
205
- export declare function createBundler(options?: BundlerOptions): InMemoryBundler;
206
- export { SecurityError } from './sandbox/policy';
207
- export { ExecutionError } from './sandbox/executor';
208
- //# sourceMappingURL=bundler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../src/bundler/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,cAAc,EAId,iBAAiB,EACjB,gBAAgB,EAIjB,MAAM,SAAS,CAAC;AAkGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;gBAErC,OAAO,GAAE,cAAmB;IAkBxC;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAmE3D;;;;;OAKG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IA6D9D;;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