@frontmcp/ui 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +140 -362
  2. package/bridge/runtime/index.d.ts +2 -1
  3. package/bridge/runtime/index.d.ts.map +1 -1
  4. package/bundler/file-cache/component-builder.d.ts +1 -1
  5. package/bundler/file-cache/component-builder.d.ts.map +1 -1
  6. package/bundler/file-cache/hash-calculator.d.ts +1 -1
  7. package/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  8. package/bundler/file-cache/storage/filesystem.d.ts +1 -1
  9. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  10. package/bundler/file-cache/storage/interface.d.ts +1 -1
  11. package/bundler/file-cache/storage/interface.d.ts.map +1 -1
  12. package/bundler/file-cache/storage/redis.d.ts +1 -1
  13. package/bundler/file-cache/storage/redis.d.ts.map +1 -1
  14. package/bundler/index.js +10 -1057
  15. package/components/alert.schema.d.ts +6 -6
  16. package/components/avatar.schema.d.ts +9 -9
  17. package/components/badge.schema.d.ts +9 -9
  18. package/components/button.schema.d.ts +9 -9
  19. package/components/card.schema.d.ts +7 -7
  20. package/components/form.schema.d.ts +24 -24
  21. package/components/index.js +128 -198
  22. package/components/modal.schema.d.ts +8 -8
  23. package/components/table.schema.d.ts +6 -6
  24. package/esm/bridge/runtime/index.d.ts +2 -1
  25. package/esm/bridge/runtime/index.d.ts.map +1 -1
  26. package/esm/bundler/file-cache/component-builder.d.ts +1 -1
  27. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -1
  28. package/esm/bundler/file-cache/hash-calculator.d.ts +1 -1
  29. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  30. package/esm/bundler/file-cache/storage/filesystem.d.ts +1 -1
  31. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  32. package/esm/bundler/file-cache/storage/interface.d.ts +1 -1
  33. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -1
  34. package/esm/bundler/file-cache/storage/redis.d.ts +1 -1
  35. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -1
  36. package/esm/bundler/index.js +3 -1050
  37. package/esm/components/alert.schema.d.ts +6 -6
  38. package/esm/components/avatar.schema.d.ts +9 -9
  39. package/esm/components/badge.schema.d.ts +9 -9
  40. package/esm/components/button.schema.d.ts +9 -9
  41. package/esm/components/card.schema.d.ts +7 -7
  42. package/esm/components/form.schema.d.ts +24 -24
  43. package/esm/components/index.js +136 -196
  44. package/esm/components/modal.schema.d.ts +8 -8
  45. package/esm/components/table.schema.d.ts +6 -6
  46. package/esm/index.d.ts +23 -39
  47. package/esm/index.d.ts.map +1 -1
  48. package/esm/index.js +4256 -16441
  49. package/esm/layouts/base.d.ts +2 -2
  50. package/esm/layouts/base.d.ts.map +1 -1
  51. package/esm/layouts/index.js +33 -516
  52. package/esm/package.json +8 -26
  53. package/esm/pages/index.js +100 -627
  54. package/esm/react/Alert.d.ts +1 -2
  55. package/esm/react/Alert.d.ts.map +1 -1
  56. package/esm/react/Badge.d.ts +1 -2
  57. package/esm/react/Badge.d.ts.map +1 -1
  58. package/esm/react/Button.d.ts +1 -2
  59. package/esm/react/Button.d.ts.map +1 -1
  60. package/esm/react/Card.d.ts +1 -2
  61. package/esm/react/Card.d.ts.map +1 -1
  62. package/esm/react/hooks/context.d.ts +1 -1
  63. package/esm/react/hooks/context.d.ts.map +1 -1
  64. package/esm/react/index.d.ts +5 -6
  65. package/esm/react/index.d.ts.map +1 -1
  66. package/esm/react/index.js +2074 -322
  67. package/esm/react/types.d.ts +1 -2
  68. package/esm/react/types.d.ts.map +1 -1
  69. package/esm/renderers/index.d.ts +10 -25
  70. package/esm/renderers/index.d.ts.map +1 -1
  71. package/esm/renderers/index.js +171 -1617
  72. package/esm/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  73. package/esm/renderers/react.adapter.d.ts.map +1 -0
  74. package/esm/renderers/react.renderer.d.ts +3 -3
  75. package/esm/renderers/react.renderer.d.ts.map +1 -1
  76. package/esm/universal/index.js +1755 -0
  77. package/esm/web-components/index.js +232 -287
  78. package/esm/widgets/index.js +89 -147
  79. package/index.d.ts +23 -39
  80. package/index.d.ts.map +1 -1
  81. package/index.js +6123 -18539
  82. package/layouts/base.d.ts +2 -2
  83. package/layouts/base.d.ts.map +1 -1
  84. package/layouts/index.js +43 -536
  85. package/package.json +8 -26
  86. package/pages/index.js +111 -648
  87. package/react/Alert.d.ts +1 -2
  88. package/react/Alert.d.ts.map +1 -1
  89. package/react/Badge.d.ts +1 -2
  90. package/react/Badge.d.ts.map +1 -1
  91. package/react/Button.d.ts +1 -2
  92. package/react/Button.d.ts.map +1 -1
  93. package/react/Card.d.ts +1 -2
  94. package/react/Card.d.ts.map +1 -1
  95. package/react/hooks/context.d.ts +1 -1
  96. package/react/hooks/context.d.ts.map +1 -1
  97. package/react/index.d.ts +5 -6
  98. package/react/index.d.ts.map +1 -1
  99. package/react/index.js +2065 -335
  100. package/react/types.d.ts +1 -2
  101. package/react/types.d.ts.map +1 -1
  102. package/renderers/index.d.ts +10 -25
  103. package/renderers/index.d.ts.map +1 -1
  104. package/renderers/index.js +175 -1641
  105. package/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  106. package/renderers/react.adapter.d.ts.map +1 -0
  107. package/renderers/react.renderer.d.ts +3 -3
  108. package/renderers/react.renderer.d.ts.map +1 -1
  109. package/universal/index.js +1841 -0
  110. package/web-components/index.js +224 -289
  111. package/widgets/index.js +80 -148
  112. package/adapters/index.d.ts +0 -13
  113. package/adapters/index.d.ts.map +0 -1
  114. package/adapters/index.js +0 -462
  115. package/adapters/platform-meta.d.ts +0 -166
  116. package/adapters/platform-meta.d.ts.map +0 -1
  117. package/adapters/response-builder.d.ts +0 -108
  118. package/adapters/response-builder.d.ts.map +0 -1
  119. package/adapters/serving-mode.d.ts +0 -107
  120. package/adapters/serving-mode.d.ts.map +0 -1
  121. package/base-template/bridge.d.ts +0 -90
  122. package/base-template/bridge.d.ts.map +0 -1
  123. package/base-template/default-base-template.d.ts +0 -92
  124. package/base-template/default-base-template.d.ts.map +0 -1
  125. package/base-template/index.d.ts +0 -15
  126. package/base-template/index.d.ts.map +0 -1
  127. package/base-template/index.js +0 -1398
  128. package/base-template/polyfills.d.ts +0 -31
  129. package/base-template/polyfills.d.ts.map +0 -1
  130. package/base-template/theme-styles.d.ts +0 -74
  131. package/base-template/theme-styles.d.ts.map +0 -1
  132. package/build/cdn-resources.d.ts +0 -243
  133. package/build/cdn-resources.d.ts.map +0 -1
  134. package/build/index.d.ts +0 -295
  135. package/build/index.d.ts.map +0 -1
  136. package/build/index.js +0 -7096
  137. package/build/widget-manifest.d.ts +0 -362
  138. package/build/widget-manifest.d.ts.map +0 -1
  139. package/dependency/cdn-registry.d.ts +0 -98
  140. package/dependency/cdn-registry.d.ts.map +0 -1
  141. package/dependency/import-map.d.ts +0 -186
  142. package/dependency/import-map.d.ts.map +0 -1
  143. package/dependency/import-parser.d.ts +0 -82
  144. package/dependency/import-parser.d.ts.map +0 -1
  145. package/dependency/index.d.ts +0 -17
  146. package/dependency/index.d.ts.map +0 -1
  147. package/dependency/resolver.d.ts +0 -164
  148. package/dependency/resolver.d.ts.map +0 -1
  149. package/dependency/schemas.d.ts +0 -486
  150. package/dependency/schemas.d.ts.map +0 -1
  151. package/dependency/template-loader.d.ts +0 -204
  152. package/dependency/template-loader.d.ts.map +0 -1
  153. package/dependency/template-processor.d.ts +0 -118
  154. package/dependency/template-processor.d.ts.map +0 -1
  155. package/dependency/types.d.ts +0 -739
  156. package/dependency/types.d.ts.map +0 -1
  157. package/esm/adapters/index.d.ts +0 -13
  158. package/esm/adapters/index.d.ts.map +0 -1
  159. package/esm/adapters/index.js +0 -427
  160. package/esm/adapters/platform-meta.d.ts +0 -166
  161. package/esm/adapters/platform-meta.d.ts.map +0 -1
  162. package/esm/adapters/response-builder.d.ts +0 -108
  163. package/esm/adapters/response-builder.d.ts.map +0 -1
  164. package/esm/adapters/serving-mode.d.ts +0 -107
  165. package/esm/adapters/serving-mode.d.ts.map +0 -1
  166. package/esm/base-template/bridge.d.ts +0 -90
  167. package/esm/base-template/bridge.d.ts.map +0 -1
  168. package/esm/base-template/default-base-template.d.ts +0 -92
  169. package/esm/base-template/default-base-template.d.ts.map +0 -1
  170. package/esm/base-template/index.d.ts +0 -15
  171. package/esm/base-template/index.d.ts.map +0 -1
  172. package/esm/base-template/index.js +0 -1364
  173. package/esm/base-template/polyfills.d.ts +0 -31
  174. package/esm/base-template/polyfills.d.ts.map +0 -1
  175. package/esm/base-template/theme-styles.d.ts +0 -74
  176. package/esm/base-template/theme-styles.d.ts.map +0 -1
  177. package/esm/build/cdn-resources.d.ts +0 -243
  178. package/esm/build/cdn-resources.d.ts.map +0 -1
  179. package/esm/build/index.d.ts +0 -295
  180. package/esm/build/index.d.ts.map +0 -1
  181. package/esm/build/index.js +0 -7021
  182. package/esm/build/widget-manifest.d.ts +0 -362
  183. package/esm/build/widget-manifest.d.ts.map +0 -1
  184. package/esm/dependency/cdn-registry.d.ts +0 -98
  185. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  186. package/esm/dependency/import-map.d.ts +0 -186
  187. package/esm/dependency/import-map.d.ts.map +0 -1
  188. package/esm/dependency/import-parser.d.ts +0 -82
  189. package/esm/dependency/import-parser.d.ts.map +0 -1
  190. package/esm/dependency/index.d.ts +0 -17
  191. package/esm/dependency/index.d.ts.map +0 -1
  192. package/esm/dependency/resolver.d.ts +0 -164
  193. package/esm/dependency/resolver.d.ts.map +0 -1
  194. package/esm/dependency/schemas.d.ts +0 -486
  195. package/esm/dependency/schemas.d.ts.map +0 -1
  196. package/esm/dependency/template-loader.d.ts +0 -204
  197. package/esm/dependency/template-loader.d.ts.map +0 -1
  198. package/esm/dependency/template-processor.d.ts +0 -118
  199. package/esm/dependency/template-processor.d.ts.map +0 -1
  200. package/esm/dependency/types.d.ts +0 -739
  201. package/esm/dependency/types.d.ts.map +0 -1
  202. package/esm/handlebars/expression-extractor.d.ts +0 -147
  203. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  204. package/esm/handlebars/helpers.d.ts +0 -339
  205. package/esm/handlebars/helpers.d.ts.map +0 -1
  206. package/esm/handlebars/index.d.ts +0 -195
  207. package/esm/handlebars/index.d.ts.map +0 -1
  208. package/esm/handlebars/index.js +0 -587
  209. package/esm/registry/index.d.ts +0 -46
  210. package/esm/registry/index.d.ts.map +0 -1
  211. package/esm/registry/index.js +0 -6422
  212. package/esm/registry/render-template.d.ts +0 -91
  213. package/esm/registry/render-template.d.ts.map +0 -1
  214. package/esm/registry/tool-ui.registry.d.ts +0 -294
  215. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  216. package/esm/registry/uri-utils.d.ts +0 -56
  217. package/esm/registry/uri-utils.d.ts.map +0 -1
  218. package/esm/renderers/cache.d.ts +0 -145
  219. package/esm/renderers/cache.d.ts.map +0 -1
  220. package/esm/renderers/html.renderer.d.ts +0 -123
  221. package/esm/renderers/html.renderer.d.ts.map +0 -1
  222. package/esm/renderers/mdx.renderer.d.ts +0 -120
  223. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  224. package/esm/renderers/registry.d.ts +0 -134
  225. package/esm/renderers/registry.d.ts.map +0 -1
  226. package/esm/renderers/types.d.ts +0 -342
  227. package/esm/renderers/types.d.ts.map +0 -1
  228. package/esm/renderers/utils/detect.d.ts +0 -107
  229. package/esm/renderers/utils/detect.d.ts.map +0 -1
  230. package/esm/renderers/utils/hash.d.ts +0 -40
  231. package/esm/renderers/utils/hash.d.ts.map +0 -1
  232. package/esm/renderers/utils/index.d.ts +0 -9
  233. package/esm/renderers/utils/index.d.ts.map +0 -1
  234. package/esm/renderers/utils/transpiler.d.ts +0 -89
  235. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  236. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  237. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  238. package/esm/runtime/adapters/index.d.ts +0 -26
  239. package/esm/runtime/adapters/index.d.ts.map +0 -1
  240. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  241. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  242. package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
  243. package/esm/runtime/adapters/types.d.ts +0 -95
  244. package/esm/runtime/adapters/types.d.ts.map +0 -1
  245. package/esm/runtime/csp.d.ts +0 -48
  246. package/esm/runtime/csp.d.ts.map +0 -1
  247. package/esm/runtime/index.d.ts +0 -17
  248. package/esm/runtime/index.d.ts.map +0 -1
  249. package/esm/runtime/index.js +0 -5186
  250. package/esm/runtime/mcp-bridge.d.ts +0 -101
  251. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  252. package/esm/runtime/renderer-runtime.d.ts +0 -133
  253. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  254. package/esm/runtime/sanitizer.d.ts +0 -172
  255. package/esm/runtime/sanitizer.d.ts.map +0 -1
  256. package/esm/runtime/types.d.ts +0 -415
  257. package/esm/runtime/types.d.ts.map +0 -1
  258. package/esm/runtime/wrapper.d.ts +0 -421
  259. package/esm/runtime/wrapper.d.ts.map +0 -1
  260. package/esm/styles/index.d.ts +0 -8
  261. package/esm/styles/index.d.ts.map +0 -1
  262. package/esm/styles/index.js +0 -171
  263. package/esm/styles/variants.d.ts +0 -51
  264. package/esm/styles/variants.d.ts.map +0 -1
  265. package/esm/theme/cdn.d.ts +0 -195
  266. package/esm/theme/cdn.d.ts.map +0 -1
  267. package/esm/theme/index.d.ts +0 -18
  268. package/esm/theme/index.d.ts.map +0 -1
  269. package/esm/theme/index.js +0 -700
  270. package/esm/theme/platforms.d.ts +0 -107
  271. package/esm/theme/platforms.d.ts.map +0 -1
  272. package/esm/theme/presets/github-openai.d.ts +0 -50
  273. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  274. package/esm/theme/presets/index.d.ts +0 -11
  275. package/esm/theme/presets/index.d.ts.map +0 -1
  276. package/esm/theme/theme.d.ts +0 -396
  277. package/esm/theme/theme.d.ts.map +0 -1
  278. package/esm/tool-template/builder.d.ts +0 -213
  279. package/esm/tool-template/builder.d.ts.map +0 -1
  280. package/esm/tool-template/index.d.ts +0 -16
  281. package/esm/tool-template/index.d.ts.map +0 -1
  282. package/esm/tool-template/index.js +0 -3515
  283. package/esm/types/index.d.ts +0 -14
  284. package/esm/types/index.d.ts.map +0 -1
  285. package/esm/types/index.js +0 -75
  286. package/esm/types/ui-config.d.ts +0 -639
  287. package/esm/types/ui-config.d.ts.map +0 -1
  288. package/esm/types/ui-runtime.d.ts +0 -1007
  289. package/esm/types/ui-runtime.d.ts.map +0 -1
  290. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  291. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  292. package/esm/typings/cache/index.d.ts +0 -10
  293. package/esm/typings/cache/index.d.ts.map +0 -1
  294. package/esm/typings/cache/memory-cache.d.ts +0 -92
  295. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  296. package/esm/typings/dts-parser.d.ts +0 -90
  297. package/esm/typings/dts-parser.d.ts.map +0 -1
  298. package/esm/typings/index.d.ts +0 -48
  299. package/esm/typings/index.d.ts.map +0 -1
  300. package/esm/typings/schemas.d.ts +0 -232
  301. package/esm/typings/schemas.d.ts.map +0 -1
  302. package/esm/typings/type-fetcher.d.ts +0 -89
  303. package/esm/typings/type-fetcher.d.ts.map +0 -1
  304. package/esm/typings/types.d.ts +0 -320
  305. package/esm/typings/types.d.ts.map +0 -1
  306. package/esm/utils/escape-html.d.ts +0 -58
  307. package/esm/utils/escape-html.d.ts.map +0 -1
  308. package/esm/utils/index.d.ts +0 -10
  309. package/esm/utils/index.d.ts.map +0 -1
  310. package/esm/utils/index.js +0 -40
  311. package/esm/utils/safe-stringify.d.ts +0 -30
  312. package/esm/utils/safe-stringify.d.ts.map +0 -1
  313. package/esm/validation/error-box.d.ts +0 -56
  314. package/esm/validation/error-box.d.ts.map +0 -1
  315. package/esm/validation/index.d.ts +0 -13
  316. package/esm/validation/index.d.ts.map +0 -1
  317. package/esm/validation/index.js +0 -562
  318. package/esm/validation/schema-paths.d.ts +0 -118
  319. package/esm/validation/schema-paths.d.ts.map +0 -1
  320. package/esm/validation/template-validator.d.ts +0 -143
  321. package/esm/validation/template-validator.d.ts.map +0 -1
  322. package/esm/validation/wrapper.d.ts +0 -97
  323. package/esm/validation/wrapper.d.ts.map +0 -1
  324. package/handlebars/expression-extractor.d.ts +0 -147
  325. package/handlebars/expression-extractor.d.ts.map +0 -1
  326. package/handlebars/helpers.d.ts +0 -339
  327. package/handlebars/helpers.d.ts.map +0 -1
  328. package/handlebars/index.d.ts +0 -195
  329. package/handlebars/index.d.ts.map +0 -1
  330. package/handlebars/index.js +0 -666
  331. package/registry/index.d.ts +0 -46
  332. package/registry/index.d.ts.map +0 -1
  333. package/registry/index.js +0 -6465
  334. package/registry/render-template.d.ts +0 -91
  335. package/registry/render-template.d.ts.map +0 -1
  336. package/registry/tool-ui.registry.d.ts +0 -294
  337. package/registry/tool-ui.registry.d.ts.map +0 -1
  338. package/registry/uri-utils.d.ts +0 -56
  339. package/registry/uri-utils.d.ts.map +0 -1
  340. package/renderers/cache.d.ts +0 -145
  341. package/renderers/cache.d.ts.map +0 -1
  342. package/renderers/html.renderer.d.ts +0 -123
  343. package/renderers/html.renderer.d.ts.map +0 -1
  344. package/renderers/mdx.renderer.d.ts +0 -120
  345. package/renderers/mdx.renderer.d.ts.map +0 -1
  346. package/renderers/registry.d.ts +0 -134
  347. package/renderers/registry.d.ts.map +0 -1
  348. package/renderers/types.d.ts +0 -342
  349. package/renderers/types.d.ts.map +0 -1
  350. package/renderers/utils/detect.d.ts +0 -107
  351. package/renderers/utils/detect.d.ts.map +0 -1
  352. package/renderers/utils/hash.d.ts +0 -40
  353. package/renderers/utils/hash.d.ts.map +0 -1
  354. package/renderers/utils/index.d.ts +0 -9
  355. package/renderers/utils/index.d.ts.map +0 -1
  356. package/renderers/utils/transpiler.d.ts +0 -89
  357. package/renderers/utils/transpiler.d.ts.map +0 -1
  358. package/runtime/adapters/html.adapter.d.ts +0 -59
  359. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  360. package/runtime/adapters/index.d.ts +0 -26
  361. package/runtime/adapters/index.d.ts.map +0 -1
  362. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  363. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  364. package/runtime/adapters/react.adapter.d.ts.map +0 -1
  365. package/runtime/adapters/types.d.ts +0 -95
  366. package/runtime/adapters/types.d.ts.map +0 -1
  367. package/runtime/csp.d.ts +0 -48
  368. package/runtime/csp.d.ts.map +0 -1
  369. package/runtime/index.d.ts +0 -17
  370. package/runtime/index.d.ts.map +0 -1
  371. package/runtime/index.js +0 -5264
  372. package/runtime/mcp-bridge.d.ts +0 -101
  373. package/runtime/mcp-bridge.d.ts.map +0 -1
  374. package/runtime/renderer-runtime.d.ts +0 -133
  375. package/runtime/renderer-runtime.d.ts.map +0 -1
  376. package/runtime/sanitizer.d.ts +0 -172
  377. package/runtime/sanitizer.d.ts.map +0 -1
  378. package/runtime/types.d.ts +0 -415
  379. package/runtime/types.d.ts.map +0 -1
  380. package/runtime/wrapper.d.ts +0 -421
  381. package/runtime/wrapper.d.ts.map +0 -1
  382. package/styles/index.d.ts +0 -8
  383. package/styles/index.d.ts.map +0 -1
  384. package/styles/index.js +0 -222
  385. package/styles/variants.d.ts +0 -51
  386. package/styles/variants.d.ts.map +0 -1
  387. package/theme/cdn.d.ts +0 -195
  388. package/theme/cdn.d.ts.map +0 -1
  389. package/theme/index.d.ts +0 -18
  390. package/theme/index.d.ts.map +0 -1
  391. package/theme/index.js +0 -757
  392. package/theme/platforms.d.ts +0 -107
  393. package/theme/platforms.d.ts.map +0 -1
  394. package/theme/presets/github-openai.d.ts +0 -50
  395. package/theme/presets/github-openai.d.ts.map +0 -1
  396. package/theme/presets/index.d.ts +0 -11
  397. package/theme/presets/index.d.ts.map +0 -1
  398. package/theme/theme.d.ts +0 -396
  399. package/theme/theme.d.ts.map +0 -1
  400. package/tool-template/builder.d.ts +0 -213
  401. package/tool-template/builder.d.ts.map +0 -1
  402. package/tool-template/index.d.ts +0 -16
  403. package/tool-template/index.d.ts.map +0 -1
  404. package/tool-template/index.js +0 -3559
  405. package/types/index.d.ts +0 -14
  406. package/types/index.d.ts.map +0 -1
  407. package/types/index.js +0 -108
  408. package/types/ui-config.d.ts +0 -639
  409. package/types/ui-config.d.ts.map +0 -1
  410. package/types/ui-runtime.d.ts +0 -1007
  411. package/types/ui-runtime.d.ts.map +0 -1
  412. package/typings/cache/cache-adapter.d.ts +0 -125
  413. package/typings/cache/cache-adapter.d.ts.map +0 -1
  414. package/typings/cache/index.d.ts +0 -10
  415. package/typings/cache/index.d.ts.map +0 -1
  416. package/typings/cache/memory-cache.d.ts +0 -92
  417. package/typings/cache/memory-cache.d.ts.map +0 -1
  418. package/typings/dts-parser.d.ts +0 -90
  419. package/typings/dts-parser.d.ts.map +0 -1
  420. package/typings/index.d.ts +0 -48
  421. package/typings/index.d.ts.map +0 -1
  422. package/typings/schemas.d.ts +0 -232
  423. package/typings/schemas.d.ts.map +0 -1
  424. package/typings/type-fetcher.d.ts +0 -89
  425. package/typings/type-fetcher.d.ts.map +0 -1
  426. package/typings/types.d.ts +0 -320
  427. package/typings/types.d.ts.map +0 -1
  428. package/utils/escape-html.d.ts +0 -58
  429. package/utils/escape-html.d.ts.map +0 -1
  430. package/utils/index.d.ts +0 -10
  431. package/utils/index.d.ts.map +0 -1
  432. package/utils/index.js +0 -70
  433. package/utils/safe-stringify.d.ts +0 -30
  434. package/utils/safe-stringify.d.ts.map +0 -1
  435. package/validation/error-box.d.ts +0 -56
  436. package/validation/error-box.d.ts.map +0 -1
  437. package/validation/index.d.ts +0 -13
  438. package/validation/index.d.ts.map +0 -1
  439. package/validation/index.js +0 -603
  440. package/validation/schema-paths.d.ts +0 -118
  441. package/validation/schema-paths.d.ts.map +0 -1
  442. package/validation/template-validator.d.ts +0 -143
  443. package/validation/template-validator.d.ts.map +0 -1
  444. package/validation/wrapper.d.ts +0 -97
  445. package/validation/wrapper.d.ts.map +0 -1
@@ -1,31 +0,0 @@
1
- /**
2
- * Platform Polyfills for Base Template
3
- *
4
- * Provides additional polyfills for MCP session detection and
5
- * direct HTTP fallback when not in an OpenAI or ext-apps environment.
6
- *
7
- * These polyfills complement the existing MCP_BRIDGE_RUNTIME.
8
- */
9
- /**
10
- * MCP Session information for HTTP fallback
11
- */
12
- export interface McpSession {
13
- /** MCP server URL */
14
- mcpUrl: string;
15
- /** Session ID for authentication */
16
- sessionId: string;
17
- }
18
- /**
19
- * Render the MCP session detection polyfill script.
20
- *
21
- * This provides auto-detection of MCP session info from:
22
- * 1. Explicit window.__frontmcp.mcpSession
23
- * 2. Meta tags (mcp-url, mcp-session-id)
24
- * 3. URL query parameters (mcpUrl, sessionId)
25
- * 4. Fallback values provided at render time
26
- *
27
- * @param mcpSession - Optional explicit session to bake into the template
28
- * @returns Script tag with polyfill code
29
- */
30
- export declare function renderMcpSessionPolyfill(mcpSession?: McpSession): string;
31
- //# sourceMappingURL=polyfills.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../../../src/base-template/polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,CAuJxE"}
@@ -1,74 +0,0 @@
1
- /**
2
- * Theme Styles for Base Template
3
- *
4
- * Composes theme configuration into complete HTML head content
5
- * including fonts, scripts, and CSS custom properties.
6
- *
7
- * Uses existing theme utilities from @frontmcp/ui/theme module.
8
- */
9
- import { type ThemeConfig } from '../theme';
10
- /**
11
- * Options for rendering theme styles.
12
- */
13
- export interface ThemeStylesOptions {
14
- /** Theme configuration (default: DEFAULT_THEME) */
15
- theme?: ThemeConfig;
16
- /** Include Tailwind CSS (default: true) */
17
- tailwind?: boolean;
18
- /** Include HTMX (default: false) */
19
- htmx?: boolean;
20
- /** Include Alpine.js (default: false) */
21
- alpine?: boolean;
22
- /** Include fonts (default: true) */
23
- fonts?: boolean;
24
- /** Use inline scripts from cache (for blocked network platforms) */
25
- inline?: boolean;
26
- }
27
- /**
28
- * Render complete theme styles for HTML head section.
29
- *
30
- * This function composes all theme-related HTML including:
31
- * 1. Font preconnect links (optional)
32
- * 2. Font stylesheets (optional)
33
- * 3. Tailwind CSS script (with @theme variables)
34
- * 4. Additional framework scripts (HTMX, Alpine.js)
35
- *
36
- * @param options - Theme styles configuration
37
- * @returns HTML string with all style/script tags
38
- *
39
- * @example
40
- * ```typescript
41
- * // Default theme with Tailwind only
42
- * const styles = renderThemeStyles();
43
- *
44
- * // Custom theme with HTMX
45
- * const styles = renderThemeStyles({
46
- * theme: customTheme,
47
- * htmx: true,
48
- * });
49
- *
50
- * // For blocked-network platforms (Claude Artifacts)
51
- * await fetchAndCacheScriptsFromTheme(theme);
52
- * const styles = renderThemeStyles({ inline: true });
53
- * ```
54
- */
55
- export declare function renderThemeStyles(options?: ThemeStylesOptions): string;
56
- /**
57
- * Render minimal theme styles (Tailwind + @theme only).
58
- *
59
- * Use this for lightweight widgets that don't need fonts or additional scripts.
60
- *
61
- * @param theme - Theme configuration (default: DEFAULT_THEME)
62
- * @returns HTML string with Tailwind script and @theme style block
63
- */
64
- export declare function renderMinimalThemeStyles(theme?: ThemeConfig): string;
65
- /**
66
- * Render theme CSS variables only (no scripts).
67
- *
68
- * Use this when Tailwind is already loaded elsewhere.
69
- *
70
- * @param theme - Theme configuration (default: DEFAULT_THEME)
71
- * @returns HTML style block with @theme CSS
72
- */
73
- export declare function renderThemeCssOnly(theme?: ThemeConfig): string;
74
- //# sourceMappingURL=theme-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-styles.d.ts","sourceRoot":"","sources":["../../../src/base-template/theme-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAML,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAmC1E;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,GAAE,WAA2B,GAAG,MAAM,CASnF;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,WAA2B,GAAG,MAAM,CAE7E"}
@@ -1,243 +0,0 @@
1
- /**
2
- * CDN Resource URLs
3
- *
4
- * Default CDN URLs for runtime dependencies (React, MDX, Handlebars, etc).
5
- * These URLs are used when resourceMode is 'cdn' (default).
6
- *
7
- * @packageDocumentation
8
- */
9
- import type { CDNResource, UIType, RendererAssets, ResourceMode } from '../types';
10
- /**
11
- * React 19 from esm.sh (ES module).
12
- *
13
- * React 19 removed UMD builds, so we use esm.sh which provides
14
- * ES module builds that work in modern browsers.
15
- */
16
- export declare const REACT_CDN: CDNResource;
17
- /**
18
- * ReactDOM 19 client from esm.sh (ES module).
19
- *
20
- * React 19 removed UMD builds, so we use esm.sh which provides
21
- * ES module builds that work in modern browsers.
22
- */
23
- export declare const REACT_DOM_CDN: CDNResource;
24
- /**
25
- * Marked markdown parser from unpkg.
26
- */
27
- export declare const MARKED_CDN: CDNResource;
28
- /**
29
- * Handlebars runtime from unpkg.
30
- */
31
- export declare const HANDLEBARS_CDN: CDNResource;
32
- /**
33
- * MDX runtime from esm.sh (for browser use).
34
- * Note: MDX compilation typically happens server-side.
35
- */
36
- export declare const MDX_RUNTIME_CDN: CDNResource;
37
- /**
38
- * Tailwind CSS Browser CDN (play.tailwindcss.com CDN).
39
- * This is a JIT compiler that generates CSS on-the-fly.
40
- * Supports all Tailwind classes including arbitrary values.
41
- *
42
- * Note: This CDN is NOT trusted by Claude Artifacts sandbox.
43
- * Use CLOUDFLARE_CDN.tailwindCss for Claude.
44
- */
45
- export declare const TAILWIND_CDN: CDNResource;
46
- /**
47
- * Platform type for CDN selection.
48
- */
49
- export type CDNPlatform = 'openai' | 'claude' | 'unknown';
50
- /**
51
- * Cloudflare CDN resources (trusted by Claude Artifacts).
52
- *
53
- * Claude's sandbox only allows resources from cdnjs.cloudflare.com.
54
- * These are pre-built files (not JIT compilers) and work in restricted environments.
55
- *
56
- * Note: Tailwind from cloudflare is pre-built CSS, not the JIT compiler.
57
- * This means arbitrary values like `w-[123px]` won't work - only standard classes.
58
- */
59
- export declare const CLOUDFLARE_CDN: {
60
- /**
61
- * Pre-built Tailwind CSS (standard classes only, no JIT).
62
- * Use this instead of TAILWIND_CDN for Claude Artifacts.
63
- */
64
- readonly tailwindCss: {
65
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css";
66
- readonly type: "stylesheet";
67
- };
68
- /**
69
- * HTMX for dynamic interactions.
70
- */
71
- readonly htmx: {
72
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.4/htmx.min.js";
73
- readonly integrity: "sha512-2kIcAizYXhIn5IyXrMC72f2nh0JAtESHRpOieVw5dYPYeHwLCC2eKCqvdZDYRSEgasKrPpEPpRFjL8gqwBZWAA==";
74
- readonly crossorigin: "anonymous";
75
- };
76
- /**
77
- * Alpine.js for reactive components.
78
- */
79
- readonly alpinejs: {
80
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.14.3/cdn.min.js";
81
- readonly integrity: "sha512-lrQ8FHgsWKFSuQFq8NKPJicjlvJFEIrCqEj8zeX7ZOUlHWltN/Iow4jND+x84jqTdDf9n+hvQpJjGDvOl/eDRA==";
82
- readonly crossorigin: "anonymous";
83
- readonly defer: true;
84
- };
85
- /**
86
- * Marked markdown parser.
87
- */
88
- readonly marked: {
89
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/marked/15.0.4/marked.min.js";
90
- readonly integrity: "sha512-Rn/d0sGeizGbk3VJEiYNDt/mMcfuzYoFkia3iBffv+HX8VUrHMo/0cKjZuxWGoZLPh/VxUcC9ais+RBFZW9EBg==";
91
- readonly crossorigin: "anonymous";
92
- };
93
- /**
94
- * Handlebars templating.
95
- */
96
- readonly handlebars: {
97
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js";
98
- readonly integrity: "sha512-E1dSFxg+wsfJ4HKjutk/WaCzK7S2wv1POn1RRPGh8ZK+ag9l244Vqxji3r6wgz9YBf6+vhQEYJZpSjqWFPg9gg==";
99
- readonly crossorigin: "anonymous";
100
- };
101
- };
102
- /**
103
- * Get the appropriate Tailwind tag for a platform.
104
- *
105
- * - OpenAI: Uses Play CDN (JIT compiler, all classes + arbitrary values)
106
- * - Claude: Uses pre-built CSS from Cloudflare (standard classes only)
107
- * - Unknown: Defaults to pre-built CSS for maximum compatibility
108
- *
109
- * @param platform - Target platform
110
- * @returns HTML tag string (script or link)
111
- *
112
- * @example
113
- * ```typescript
114
- * // For OpenAI (JIT compiler)
115
- * getTailwindForPlatform('openai');
116
- * // '<script src="https://cdn.tailwindcss.com" crossorigin="anonymous"></script>'
117
- *
118
- * // For Claude (pre-built CSS)
119
- * getTailwindForPlatform('claude');
120
- * // '<link href="https://cdnjs.cloudflare.com/.../tailwind.min.css" rel="stylesheet">'
121
- * ```
122
- */
123
- export declare function getTailwindForPlatform(platform: CDNPlatform): string;
124
- /**
125
- * Build a stylesheet link tag for Cloudflare CSS resources.
126
- *
127
- * @param url - CSS file URL
128
- * @returns HTML link tag string
129
- */
130
- export declare function buildCloudflareStylesheetTag(url: string): string;
131
- /**
132
- * Build a script tag for Cloudflare JS resources.
133
- *
134
- * @param resource - Cloudflare CDN resource
135
- * @returns HTML script tag string
136
- */
137
- export declare function buildCloudflareScriptTag(resource: {
138
- url: string;
139
- integrity?: string;
140
- crossorigin?: string;
141
- defer?: boolean;
142
- }): string;
143
- /**
144
- * Get default CDN resources for a UI type.
145
- *
146
- * @param uiType - The UI renderer type
147
- * @param mode - Resource loading mode (cdn or inline)
148
- * @returns RendererAssets with appropriate CDN URLs
149
- *
150
- * @example
151
- * ```typescript
152
- * // Get CDN assets for React
153
- * const assets = getDefaultAssets('react', 'cdn');
154
- * console.log(assets.react.url);
155
- * // "https://unpkg.com/react@18/umd/react.production.min.js"
156
- * ```
157
- */
158
- export declare function getDefaultAssets(uiType: UIType, mode?: ResourceMode): RendererAssets;
159
- /**
160
- * Build a script tag for a CDN resource.
161
- *
162
- * @param resource - CDN resource configuration
163
- * @param options - Additional script tag options
164
- * @returns HTML script tag string
165
- */
166
- export declare function buildCDNScriptTag(resource: CDNResource, options?: {
167
- async?: boolean;
168
- defer?: boolean;
169
- type?: string;
170
- }): string;
171
- /**
172
- * Build all required script tags for a UI type.
173
- *
174
- * @param uiType - The UI renderer type
175
- * @param mode - Resource mode (cdn or inline)
176
- * @returns Array of script tag strings
177
- *
178
- * @example
179
- * ```typescript
180
- * const scripts = buildScriptsForUIType('react', 'cdn');
181
- * // Returns:
182
- * // [
183
- * // '<script src="https://unpkg.com/react@18/..." crossorigin="anonymous"></script>',
184
- * // '<script src="https://unpkg.com/react-dom@18/..." crossorigin="anonymous"></script>',
185
- * // ]
186
- * ```
187
- */
188
- export declare function buildScriptsForUIType(uiType: UIType, mode?: ResourceMode): string[];
189
- /**
190
- * Build a Tailwind script tag.
191
- *
192
- * @param config - Optional Tailwind config to inline
193
- * @returns Tailwind script tag(s)
194
- */
195
- export declare function buildTailwindScriptTag(config?: string): string;
196
- /**
197
- * Check if inline scripts are available in cache.
198
- *
199
- * Inline scripts need to be pre-fetched and cached before use.
200
- * This is typically done at build time or server startup.
201
- */
202
- export declare function hasInlineScripts(): boolean;
203
- /**
204
- * Get all CDN URLs that need to be pre-fetched for inline mode.
205
- *
206
- * @param uiType - The UI renderer type
207
- * @returns Array of URLs to fetch
208
- */
209
- export declare function getURLsToPreFetch(uiType: UIType): string[];
210
- /**
211
- * CDN info structure for tools/list _meta['ui/cdn'].
212
- *
213
- * Contains CDN URLs for runtime dependencies needed to render the widget.
214
- */
215
- export interface CDNInfo {
216
- react?: string;
217
- reactDom?: string;
218
- handlebars?: string;
219
- marked?: string;
220
- mdxRuntime?: string;
221
- tailwind?: string;
222
- }
223
- /**
224
- * Build CDN info object for a UI type.
225
- *
226
- * This is used in tools/list response _meta to inform clients
227
- * which CDN resources are needed to render the widget.
228
- *
229
- * @param uiType - The UI renderer type
230
- * @returns CDN info object with URLs
231
- *
232
- * @example
233
- * ```typescript
234
- * // In tools/list response
235
- * item._meta = {
236
- * 'openai/outputTemplate': 'ui://widget/get_weather.html',
237
- * 'ui/cdn': buildCDNInfoForUIType('react'),
238
- * // { react: 'https://...', reactDom: 'https://...' }
239
- * };
240
- * ```
241
- */
242
- export declare function buildCDNInfoForUIType(uiType: UIType): CDNInfo;
243
- //# sourceMappingURL=cdn-resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdn-resources.d.ts","sourceRoot":"","sources":["../../../src/build/cdn-resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UA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,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GACA,MAAM,CAwBR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAoB,GACzB,MAAM,EAAE,CAkCV;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAW9D;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAW1D;AAMD;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAyC7D"}
@@ -1,295 +0,0 @@
1
- /**
2
- * Build-Time API for Tool UI
3
- *
4
- * Provides pre-compilation capabilities for tool UI templates.
5
- * Produces a **universal HTML document** that works across all platforms:
6
- * - OpenAI ChatGPT (Apps SDK)
7
- * - Anthropic Claude
8
- * - MCP Apps (ext-apps / SEP-1865)
9
- * - Google Gemini
10
- * - Any MCP-compatible host
11
- *
12
- * The build embeds the FrontMCP Bridge which auto-detects the host
13
- * at runtime and adapts its communication protocol accordingly.
14
- *
15
- * @packageDocumentation
16
- */
17
- import type { UITemplateConfig } from '../types';
18
- import type { ThemeConfig, DeepPartial } from '../theme';
19
- /**
20
- * Network access mode for the target environment.
21
- *
22
- * - `'open'`: Can fetch external resources (CDN scripts, fonts)
23
- * - `'blocked'`: Network is sandboxed, must inline everything
24
- */
25
- export type NetworkMode = 'open' | 'blocked';
26
- /**
27
- * Script loading strategy.
28
- *
29
- * - `'cdn'`: Load scripts from CDN (smaller HTML, requires network)
30
- * - `'inline'`: Embed scripts in HTML (larger, works offline)
31
- * - `'auto'`: Choose based on network mode
32
- */
33
- export type ScriptStrategy = 'cdn' | 'inline' | 'auto';
34
- /**
35
- * Build configuration options.
36
- * Capability-based rather than platform-specific.
37
- */
38
- export interface BuildConfig {
39
- /**
40
- * Network access mode.
41
- * @default 'open'
42
- */
43
- network?: NetworkMode;
44
- /**
45
- * Script loading strategy.
46
- * @default 'auto' (uses 'inline' if network is 'blocked')
47
- */
48
- scripts?: ScriptStrategy;
49
- /**
50
- * Whether to include the FrontMCP Bridge runtime.
51
- * The bridge auto-detects the host platform at runtime.
52
- * @default true
53
- */
54
- includeBridge?: boolean;
55
- /**
56
- * Whether to minify the output HTML.
57
- * @default false
58
- */
59
- minify?: boolean;
60
- }
61
- /**
62
- * Options for building a tool UI template.
63
- *
64
- * @example
65
- * ```typescript
66
- * const result = await buildToolUI({
67
- * template: {
68
- * template: (ctx) => `<div>${ctx.output.value}</div>`,
69
- * widgetAccessible: true,
70
- * },
71
- * toolName: 'my_tool',
72
- * input: { query: 'hello' },
73
- * output: { value: 'world' },
74
- * });
75
- *
76
- * // Universal HTML that works on any platform
77
- * console.log(result.html);
78
- * ```
79
- */
80
- export interface BuildOptions<In = unknown, Out = unknown> {
81
- /**
82
- * UI template configuration.
83
- */
84
- template: UITemplateConfig<In, Out>;
85
- /**
86
- * Name of the tool this UI is for.
87
- */
88
- toolName: string;
89
- /**
90
- * Tool input arguments.
91
- */
92
- input?: In;
93
- /**
94
- * Tool output/result data.
95
- */
96
- output?: Out;
97
- /**
98
- * Theme configuration override.
99
- */
100
- theme?: DeepPartial<ThemeConfig>;
101
- /**
102
- * Build configuration.
103
- * Controls network mode, script strategy, etc.
104
- */
105
- config?: BuildConfig;
106
- /**
107
- * Title for the HTML document.
108
- */
109
- title?: string;
110
- /** @deprecated Use `input` instead */
111
- sampleInput?: In;
112
- /** @deprecated Use `output` instead */
113
- sampleOutput?: Out;
114
- /** @deprecated Use `config.includeBridge` instead */
115
- injectAdapters?: boolean;
116
- /** @deprecated Use `config.minify` instead */
117
- minify?: boolean;
118
- /** @deprecated Platform is now auto-detected at runtime */
119
- platform?: string;
120
- }
121
- /**
122
- * MIME types for different host platforms.
123
- * Returned as suggestions - the MCP server response layer decides which to use.
124
- */
125
- export interface MimeTypes {
126
- /** For OpenAI ChatGPT Apps SDK */
127
- openai: 'text/html+skybridge';
128
- /** For Claude, MCP Apps, and standard MCP hosts */
129
- mcp: 'text/html+mcp';
130
- /** Generic HTML (fallback) */
131
- html: 'text/html';
132
- }
133
- /**
134
- * Result of building a tool UI template.
135
- */
136
- export interface BuildResult {
137
- /**
138
- * Complete HTML document string.
139
- * This is universal - works on all platforms.
140
- */
141
- html: string;
142
- /**
143
- * Size of the HTML in bytes.
144
- */
145
- size: number;
146
- /**
147
- * Size of the gzipped HTML in bytes (estimated).
148
- */
149
- gzipSize: number;
150
- /**
151
- * SHA-256 hash of the HTML content.
152
- */
153
- hash: string;
154
- /**
155
- * Suggested MIME types for different hosts.
156
- * The MCP server response layer should select based on detected client.
157
- */
158
- mimeTypes: MimeTypes;
159
- /**
160
- * Renderer type used (html, react, mdx).
161
- */
162
- rendererType: string;
163
- /**
164
- * Build timestamp (ISO 8601).
165
- */
166
- buildTime: string;
167
- /**
168
- * Build configuration used.
169
- */
170
- config: Required<BuildConfig>;
171
- }
172
- /**
173
- * Build a tool UI template into a universal HTML document.
174
- *
175
- * The output HTML:
176
- * - Works on ALL platforms (OpenAI, Claude, MCP Apps, Gemini, etc.)
177
- * - Includes FrontMCP Bridge that auto-detects the host at runtime
178
- * - Adapts communication protocol based on detected platform
179
- *
180
- * @example Basic usage
181
- * ```typescript
182
- * import { buildToolUI } from '@frontmcp/ui/build';
183
- *
184
- * const result = await buildToolUI({
185
- * template: { template: WeatherWidget },
186
- * toolName: 'get_weather',
187
- * output: { temperature: 72, conditions: 'sunny' },
188
- * });
189
- *
190
- * // Upload to CDN - works everywhere
191
- * await uploadToCDN('widgets/get_weather.html', result.html);
192
- * ```
193
- *
194
- * @example With blocked network (for Claude Artifacts)
195
- * ```typescript
196
- * const result = await buildToolUI({
197
- * template: { template: WeatherWidget },
198
- * toolName: 'get_weather',
199
- * config: { network: 'blocked' }, // Inlines all scripts
200
- * });
201
- * ```
202
- *
203
- * @example MCP server response
204
- * ```typescript
205
- * const result = await buildToolUI({ template, toolName, output });
206
- *
207
- * // In MCP server - choose MIME type based on client
208
- * const mimeType = isOpenAIClient(clientInfo)
209
- * ? result.mimeTypes.openai // 'text/html+skybridge'
210
- * : result.mimeTypes.mcp; // 'text/html+mcp'
211
- *
212
- * return { content: [{ type: mimeType, data: result.html }] };
213
- * ```
214
- */
215
- export declare function buildToolUI<In = unknown, Out = unknown>(options: BuildOptions<In, Out>): Promise<BuildResult>;
216
- /**
217
- * Options for building a static widget that reads from host at runtime.
218
- */
219
- export interface StaticWidgetOptions<In = unknown, Out = unknown> {
220
- /**
221
- * UI template configuration.
222
- */
223
- template: UITemplateConfig<In, Out>;
224
- /**
225
- * Name of the tool this UI is for.
226
- */
227
- toolName: string;
228
- /**
229
- * Theme configuration override.
230
- */
231
- theme?: DeepPartial<ThemeConfig>;
232
- /**
233
- * Build configuration.
234
- */
235
- config?: BuildConfig;
236
- /**
237
- * Title for the HTML document.
238
- */
239
- title?: string;
240
- }
241
- /**
242
- * Build a static widget that reads data from the host platform at runtime.
243
- *
244
- * Unlike buildToolUI which pre-renders with data, this creates a widget
245
- * that waits for data from the host platform via the FrontMCP Bridge.
246
- *
247
- * @example
248
- * ```typescript
249
- * import { buildStaticWidget } from '@frontmcp/ui/build';
250
- *
251
- * const widget = await buildStaticWidget({
252
- * template: {
253
- * template: (ctx) => `<div id="weather">${ctx.output?.temperature || 'Loading...'}</div>`,
254
- * },
255
- * toolName: 'get_weather',
256
- * });
257
- *
258
- * // This widget will receive data via FrontMCP Bridge
259
- * await uploadToCDN('widgets/get_weather.html', widget.html);
260
- * ```
261
- */
262
- export declare function buildStaticWidget<In = unknown, Out = unknown>(options: StaticWidgetOptions<In, Out>): Promise<BuildResult>;
263
- /**
264
- * @deprecated Use BuildConfig instead
265
- */
266
- export type BuildTargetPlatform = 'chatgpt' | 'claude' | 'mcp-apps' | 'universal';
267
- /**
268
- * @deprecated Use BuildOptions with config instead
269
- */
270
- export interface MultiBuildOptions<In = unknown, Out = unknown> extends Omit<BuildOptions<In, Out>, 'platform'> {
271
- platforms?: BuildTargetPlatform[];
272
- }
273
- /**
274
- * @deprecated Use BuildResult instead (same result for all platforms now)
275
- */
276
- export interface MultiBuildResult {
277
- bundles: Record<string, BuildResult>;
278
- totalTime: number;
279
- }
280
- /**
281
- * @deprecated Use buildToolUI with config.network instead
282
- */
283
- export declare function buildToolUIMulti<In = unknown, Out = unknown>(options: MultiBuildOptions<In, Out>): Promise<MultiBuildResult>;
284
- export { createTemplateHelpers } from '../runtime/wrapper';
285
- export type { UITemplateConfig, UITemplate, TemplateContext, TemplateHelpers, TemplateBuilderFn, UIContentSecurityPolicy, WidgetServingMode, WidgetDisplayMode, } from '../types';
286
- export type { ThemeConfig, PlatformCapabilities, DeepPartial } from '../theme';
287
- export { DEFAULT_THEME, OPENAI_PLATFORM, CLAUDE_PLATFORM } from '../theme';
288
- export { buildToolWidgetManifest, batchBuildWidgets, detectUIType, isFilePathTemplate, buildCSPForType, buildCSPMetaContent, getRendererAssets, buildToolResponseMeta, getOutputModeForClient, buildFileComponent, buildFileComponents, needsFileComponentRebuild, getCachedFileComponent, getPlatformFromClientInfo, } from './widget-manifest';
289
- export type { BatchBuildOptions, BatchBuildResult, BuildMetaOptions, FileComponentBuildOptions, FileComponentBuildResult, } from './widget-manifest';
290
- export type { UIType, BundlingMode, DisplayMode, OutputMode, CSPDirectives, RendererAssets, WidgetManifest, WidgetConfig, BuildManifestResult, BuildManifestOptions, UIMetaFields, OpenAIMetaFields, ToolResponseMeta, RuntimePayload, } from '../types/ui-runtime';
291
- export { DEFAULT_CSP_BY_TYPE, DEFAULT_RENDERER_ASSETS, isUIType, isBundlingMode, isDisplayMode, isResourceMode, isOutputMode, } from '../types/ui-runtime';
292
- export type { ResourceMode, CDNResource } from '../types/ui-runtime';
293
- export { REACT_CDN, REACT_DOM_CDN, MARKED_CDN, HANDLEBARS_CDN, MDX_RUNTIME_CDN, TAILWIND_CDN, CLOUDFLARE_CDN, getDefaultAssets, buildCDNScriptTag, buildScriptsForUIType, buildTailwindScriptTag, hasInlineScripts, getURLsToPreFetch, getTailwindForPlatform, buildCloudflareStylesheetTag, buildCloudflareScriptTag, buildCDNInfoForUIType, } from './cdn-resources';
294
- export type { CDNInfo, CDNPlatform } from './cdn-resources';
295
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/build/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAUzD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;C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