@frontmcp/uipack 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 (417) hide show
  1. package/CLAUDE.md +246 -0
  2. package/LICENSE +201 -0
  3. package/README.md +150 -0
  4. package/adapters/index.d.ts +13 -0
  5. package/adapters/index.d.ts.map +1 -0
  6. package/adapters/index.js +462 -0
  7. package/adapters/platform-meta.d.ts +166 -0
  8. package/adapters/platform-meta.d.ts.map +1 -0
  9. package/adapters/response-builder.d.ts +108 -0
  10. package/adapters/response-builder.d.ts.map +1 -0
  11. package/adapters/serving-mode.d.ts +107 -0
  12. package/adapters/serving-mode.d.ts.map +1 -0
  13. package/base-template/bridge.d.ts +90 -0
  14. package/base-template/bridge.d.ts.map +1 -0
  15. package/base-template/default-base-template.d.ts +92 -0
  16. package/base-template/default-base-template.d.ts.map +1 -0
  17. package/base-template/index.d.ts +15 -0
  18. package/base-template/index.d.ts.map +1 -0
  19. package/base-template/index.js +1398 -0
  20. package/base-template/polyfills.d.ts +31 -0
  21. package/base-template/polyfills.d.ts.map +1 -0
  22. package/base-template/theme-styles.d.ts +74 -0
  23. package/base-template/theme-styles.d.ts.map +1 -0
  24. package/bridge-runtime/iife-generator.d.ts +62 -0
  25. package/bridge-runtime/iife-generator.d.ts.map +1 -0
  26. package/bridge-runtime/index.d.ts +10 -0
  27. package/bridge-runtime/index.d.ts.map +1 -0
  28. package/bridge-runtime/index.js +883 -0
  29. package/build/cdn-resources.d.ts +243 -0
  30. package/build/cdn-resources.d.ts.map +1 -0
  31. package/build/index.d.ts +295 -0
  32. package/build/index.d.ts.map +1 -0
  33. package/build/index.js +6861 -0
  34. package/build/widget-manifest.d.ts +362 -0
  35. package/build/widget-manifest.d.ts.map +1 -0
  36. package/bundler/cache.d.ts +173 -0
  37. package/bundler/cache.d.ts.map +1 -0
  38. package/bundler/file-cache/component-builder.d.ts +167 -0
  39. package/bundler/file-cache/component-builder.d.ts.map +1 -0
  40. package/bundler/file-cache/hash-calculator.d.ts +155 -0
  41. package/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  42. package/bundler/file-cache/index.d.ts +12 -0
  43. package/bundler/file-cache/index.d.ts.map +1 -0
  44. package/bundler/file-cache/storage/filesystem.d.ts +149 -0
  45. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  46. package/bundler/file-cache/storage/index.d.ts +11 -0
  47. package/bundler/file-cache/storage/index.d.ts.map +1 -0
  48. package/bundler/file-cache/storage/interface.d.ts +152 -0
  49. package/bundler/file-cache/storage/interface.d.ts.map +1 -0
  50. package/bundler/file-cache/storage/redis.d.ts +139 -0
  51. package/bundler/file-cache/storage/redis.d.ts.map +1 -0
  52. package/bundler/index.d.ts +35 -0
  53. package/bundler/index.d.ts.map +1 -0
  54. package/bundler/index.js +2947 -0
  55. package/bundler/sandbox/enclave-adapter.d.ts +121 -0
  56. package/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  57. package/bundler/sandbox/executor.d.ts +14 -0
  58. package/bundler/sandbox/executor.d.ts.map +1 -0
  59. package/bundler/sandbox/policy.d.ts +62 -0
  60. package/bundler/sandbox/policy.d.ts.map +1 -0
  61. package/bundler/types.d.ts +702 -0
  62. package/bundler/types.d.ts.map +1 -0
  63. package/dependency/cdn-registry.d.ts +98 -0
  64. package/dependency/cdn-registry.d.ts.map +1 -0
  65. package/dependency/import-map.d.ts +186 -0
  66. package/dependency/import-map.d.ts.map +1 -0
  67. package/dependency/import-parser.d.ts +82 -0
  68. package/dependency/import-parser.d.ts.map +1 -0
  69. package/dependency/index.d.ts +17 -0
  70. package/dependency/index.d.ts.map +1 -0
  71. package/dependency/index.js +3215 -0
  72. package/dependency/resolver.d.ts +164 -0
  73. package/dependency/resolver.d.ts.map +1 -0
  74. package/dependency/schemas.d.ts +486 -0
  75. package/dependency/schemas.d.ts.map +1 -0
  76. package/dependency/template-loader.d.ts +204 -0
  77. package/dependency/template-loader.d.ts.map +1 -0
  78. package/dependency/template-processor.d.ts +118 -0
  79. package/dependency/template-processor.d.ts.map +1 -0
  80. package/dependency/types.d.ts +739 -0
  81. package/dependency/types.d.ts.map +1 -0
  82. package/esm/adapters/index.d.ts +13 -0
  83. package/esm/adapters/index.d.ts.map +1 -0
  84. package/esm/adapters/index.js +427 -0
  85. package/esm/adapters/platform-meta.d.ts +166 -0
  86. package/esm/adapters/platform-meta.d.ts.map +1 -0
  87. package/esm/adapters/response-builder.d.ts +108 -0
  88. package/esm/adapters/response-builder.d.ts.map +1 -0
  89. package/esm/adapters/serving-mode.d.ts +107 -0
  90. package/esm/adapters/serving-mode.d.ts.map +1 -0
  91. package/esm/base-template/bridge.d.ts +90 -0
  92. package/esm/base-template/bridge.d.ts.map +1 -0
  93. package/esm/base-template/default-base-template.d.ts +92 -0
  94. package/esm/base-template/default-base-template.d.ts.map +1 -0
  95. package/esm/base-template/index.d.ts +15 -0
  96. package/esm/base-template/index.d.ts.map +1 -0
  97. package/esm/base-template/index.js +1364 -0
  98. package/esm/base-template/polyfills.d.ts +31 -0
  99. package/esm/base-template/polyfills.d.ts.map +1 -0
  100. package/esm/base-template/theme-styles.d.ts +74 -0
  101. package/esm/base-template/theme-styles.d.ts.map +1 -0
  102. package/esm/bridge-runtime/iife-generator.d.ts +62 -0
  103. package/esm/bridge-runtime/iife-generator.d.ts.map +1 -0
  104. package/esm/bridge-runtime/index.d.ts +10 -0
  105. package/esm/bridge-runtime/index.d.ts.map +1 -0
  106. package/esm/bridge-runtime/index.js +853 -0
  107. package/esm/build/cdn-resources.d.ts +243 -0
  108. package/esm/build/cdn-resources.d.ts.map +1 -0
  109. package/esm/build/index.d.ts +295 -0
  110. package/esm/build/index.d.ts.map +1 -0
  111. package/esm/build/index.js +6786 -0
  112. package/esm/build/widget-manifest.d.ts +362 -0
  113. package/esm/build/widget-manifest.d.ts.map +1 -0
  114. package/esm/bundler/cache.d.ts +173 -0
  115. package/esm/bundler/cache.d.ts.map +1 -0
  116. package/esm/bundler/file-cache/component-builder.d.ts +167 -0
  117. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -0
  118. package/esm/bundler/file-cache/hash-calculator.d.ts +155 -0
  119. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  120. package/esm/bundler/file-cache/index.d.ts +12 -0
  121. package/esm/bundler/file-cache/index.d.ts.map +1 -0
  122. package/esm/bundler/file-cache/storage/filesystem.d.ts +149 -0
  123. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  124. package/esm/bundler/file-cache/storage/index.d.ts +11 -0
  125. package/esm/bundler/file-cache/storage/index.d.ts.map +1 -0
  126. package/esm/bundler/file-cache/storage/interface.d.ts +152 -0
  127. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -0
  128. package/esm/bundler/file-cache/storage/redis.d.ts +139 -0
  129. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -0
  130. package/esm/bundler/index.d.ts +35 -0
  131. package/esm/bundler/index.d.ts.map +1 -0
  132. package/esm/bundler/index.js +2882 -0
  133. package/esm/bundler/sandbox/enclave-adapter.d.ts +121 -0
  134. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  135. package/esm/bundler/sandbox/executor.d.ts +14 -0
  136. package/esm/bundler/sandbox/executor.d.ts.map +1 -0
  137. package/esm/bundler/sandbox/policy.d.ts +62 -0
  138. package/esm/bundler/sandbox/policy.d.ts.map +1 -0
  139. package/esm/bundler/types.d.ts +702 -0
  140. package/esm/bundler/types.d.ts.map +1 -0
  141. package/esm/dependency/cdn-registry.d.ts +98 -0
  142. package/esm/dependency/cdn-registry.d.ts.map +1 -0
  143. package/esm/dependency/import-map.d.ts +186 -0
  144. package/esm/dependency/import-map.d.ts.map +1 -0
  145. package/esm/dependency/import-parser.d.ts +82 -0
  146. package/esm/dependency/import-parser.d.ts.map +1 -0
  147. package/esm/dependency/index.d.ts +17 -0
  148. package/esm/dependency/index.d.ts.map +1 -0
  149. package/esm/dependency/index.js +3096 -0
  150. package/esm/dependency/resolver.d.ts +164 -0
  151. package/esm/dependency/resolver.d.ts.map +1 -0
  152. package/esm/dependency/schemas.d.ts +486 -0
  153. package/esm/dependency/schemas.d.ts.map +1 -0
  154. package/esm/dependency/template-loader.d.ts +204 -0
  155. package/esm/dependency/template-loader.d.ts.map +1 -0
  156. package/esm/dependency/template-processor.d.ts +118 -0
  157. package/esm/dependency/template-processor.d.ts.map +1 -0
  158. package/esm/dependency/types.d.ts +739 -0
  159. package/esm/dependency/types.d.ts.map +1 -0
  160. package/esm/handlebars/expression-extractor.d.ts +147 -0
  161. package/esm/handlebars/expression-extractor.d.ts.map +1 -0
  162. package/esm/handlebars/helpers.d.ts +339 -0
  163. package/esm/handlebars/helpers.d.ts.map +1 -0
  164. package/esm/handlebars/index.d.ts +195 -0
  165. package/esm/handlebars/index.d.ts.map +1 -0
  166. package/esm/handlebars/index.js +587 -0
  167. package/esm/index.d.ts +50 -0
  168. package/esm/index.d.ts.map +1 -0
  169. package/esm/index.js +12434 -0
  170. package/esm/package.json +68 -0
  171. package/esm/registry/index.d.ts +46 -0
  172. package/esm/registry/index.d.ts.map +1 -0
  173. package/esm/registry/index.js +6237 -0
  174. package/esm/registry/render-template.d.ts +91 -0
  175. package/esm/registry/render-template.d.ts.map +1 -0
  176. package/esm/registry/tool-ui.registry.d.ts +294 -0
  177. package/esm/registry/tool-ui.registry.d.ts.map +1 -0
  178. package/esm/registry/uri-utils.d.ts +56 -0
  179. package/esm/registry/uri-utils.d.ts.map +1 -0
  180. package/esm/renderers/cache.d.ts +145 -0
  181. package/esm/renderers/cache.d.ts.map +1 -0
  182. package/esm/renderers/html.renderer.d.ts +123 -0
  183. package/esm/renderers/html.renderer.d.ts.map +1 -0
  184. package/esm/renderers/index.d.ts +36 -0
  185. package/esm/renderers/index.d.ts.map +1 -0
  186. package/esm/renderers/index.js +1654 -0
  187. package/esm/renderers/mdx.renderer.d.ts +120 -0
  188. package/esm/renderers/mdx.renderer.d.ts.map +1 -0
  189. package/esm/renderers/registry.d.ts +133 -0
  190. package/esm/renderers/registry.d.ts.map +1 -0
  191. package/esm/renderers/types.d.ts +342 -0
  192. package/esm/renderers/types.d.ts.map +1 -0
  193. package/esm/renderers/utils/detect.d.ts +107 -0
  194. package/esm/renderers/utils/detect.d.ts.map +1 -0
  195. package/esm/renderers/utils/hash.d.ts +40 -0
  196. package/esm/renderers/utils/hash.d.ts.map +1 -0
  197. package/esm/renderers/utils/index.d.ts +9 -0
  198. package/esm/renderers/utils/index.d.ts.map +1 -0
  199. package/esm/renderers/utils/transpiler.d.ts +89 -0
  200. package/esm/renderers/utils/transpiler.d.ts.map +1 -0
  201. package/esm/runtime/adapters/html.adapter.d.ts +59 -0
  202. package/esm/runtime/adapters/html.adapter.d.ts.map +1 -0
  203. package/esm/runtime/adapters/index.d.ts +26 -0
  204. package/esm/runtime/adapters/index.d.ts.map +1 -0
  205. package/esm/runtime/adapters/mdx.adapter.d.ts +73 -0
  206. package/esm/runtime/adapters/mdx.adapter.d.ts.map +1 -0
  207. package/esm/runtime/adapters/types.d.ts +95 -0
  208. package/esm/runtime/adapters/types.d.ts.map +1 -0
  209. package/esm/runtime/csp.d.ts +48 -0
  210. package/esm/runtime/csp.d.ts.map +1 -0
  211. package/esm/runtime/index.d.ts +17 -0
  212. package/esm/runtime/index.d.ts.map +1 -0
  213. package/esm/runtime/index.js +4976 -0
  214. package/esm/runtime/mcp-bridge.d.ts +101 -0
  215. package/esm/runtime/mcp-bridge.d.ts.map +1 -0
  216. package/esm/runtime/renderer-runtime.d.ts +133 -0
  217. package/esm/runtime/renderer-runtime.d.ts.map +1 -0
  218. package/esm/runtime/sanitizer.d.ts +172 -0
  219. package/esm/runtime/sanitizer.d.ts.map +1 -0
  220. package/esm/runtime/types.d.ts +415 -0
  221. package/esm/runtime/types.d.ts.map +1 -0
  222. package/esm/runtime/wrapper.d.ts +421 -0
  223. package/esm/runtime/wrapper.d.ts.map +1 -0
  224. package/esm/styles/index.d.ts +8 -0
  225. package/esm/styles/index.d.ts.map +1 -0
  226. package/esm/styles/index.js +171 -0
  227. package/esm/styles/variants.d.ts +51 -0
  228. package/esm/styles/variants.d.ts.map +1 -0
  229. package/esm/theme/cdn.d.ts +195 -0
  230. package/esm/theme/cdn.d.ts.map +1 -0
  231. package/esm/theme/index.d.ts +18 -0
  232. package/esm/theme/index.d.ts.map +1 -0
  233. package/esm/theme/index.js +700 -0
  234. package/esm/theme/platforms.d.ts +107 -0
  235. package/esm/theme/platforms.d.ts.map +1 -0
  236. package/esm/theme/presets/github-openai.d.ts +50 -0
  237. package/esm/theme/presets/github-openai.d.ts.map +1 -0
  238. package/esm/theme/presets/index.d.ts +11 -0
  239. package/esm/theme/presets/index.d.ts.map +1 -0
  240. package/esm/theme/theme.d.ts +396 -0
  241. package/esm/theme/theme.d.ts.map +1 -0
  242. package/esm/tool-template/builder.d.ts +213 -0
  243. package/esm/tool-template/builder.d.ts.map +1 -0
  244. package/esm/tool-template/index.d.ts +16 -0
  245. package/esm/tool-template/index.d.ts.map +1 -0
  246. package/esm/tool-template/index.js +3518 -0
  247. package/esm/types/index.d.ts +14 -0
  248. package/esm/types/index.d.ts.map +1 -0
  249. package/esm/types/index.js +75 -0
  250. package/esm/types/ui-config.d.ts +641 -0
  251. package/esm/types/ui-config.d.ts.map +1 -0
  252. package/esm/types/ui-runtime.d.ts +1008 -0
  253. package/esm/types/ui-runtime.d.ts.map +1 -0
  254. package/esm/typings/cache/cache-adapter.d.ts +125 -0
  255. package/esm/typings/cache/cache-adapter.d.ts.map +1 -0
  256. package/esm/typings/cache/index.d.ts +10 -0
  257. package/esm/typings/cache/index.d.ts.map +1 -0
  258. package/esm/typings/cache/memory-cache.d.ts +92 -0
  259. package/esm/typings/cache/memory-cache.d.ts.map +1 -0
  260. package/esm/typings/dts-parser.d.ts +90 -0
  261. package/esm/typings/dts-parser.d.ts.map +1 -0
  262. package/esm/typings/index.d.ts +48 -0
  263. package/esm/typings/index.d.ts.map +1 -0
  264. package/esm/typings/index.js +812 -0
  265. package/esm/typings/schemas.d.ts +232 -0
  266. package/esm/typings/schemas.d.ts.map +1 -0
  267. package/esm/typings/type-fetcher.d.ts +89 -0
  268. package/esm/typings/type-fetcher.d.ts.map +1 -0
  269. package/esm/typings/types.d.ts +320 -0
  270. package/esm/typings/types.d.ts.map +1 -0
  271. package/esm/utils/escape-html.d.ts +58 -0
  272. package/esm/utils/escape-html.d.ts.map +1 -0
  273. package/esm/utils/index.d.ts +10 -0
  274. package/esm/utils/index.d.ts.map +1 -0
  275. package/esm/utils/index.js +40 -0
  276. package/esm/utils/safe-stringify.d.ts +30 -0
  277. package/esm/utils/safe-stringify.d.ts.map +1 -0
  278. package/esm/validation/error-box.d.ts +56 -0
  279. package/esm/validation/error-box.d.ts.map +1 -0
  280. package/esm/validation/index.d.ts +13 -0
  281. package/esm/validation/index.d.ts.map +1 -0
  282. package/esm/validation/index.js +542 -0
  283. package/esm/validation/schema-paths.d.ts +118 -0
  284. package/esm/validation/schema-paths.d.ts.map +1 -0
  285. package/esm/validation/template-validator.d.ts +143 -0
  286. package/esm/validation/template-validator.d.ts.map +1 -0
  287. package/esm/validation/wrapper.d.ts +97 -0
  288. package/esm/validation/wrapper.d.ts.map +1 -0
  289. package/handlebars/expression-extractor.d.ts +147 -0
  290. package/handlebars/expression-extractor.d.ts.map +1 -0
  291. package/handlebars/helpers.d.ts +339 -0
  292. package/handlebars/helpers.d.ts.map +1 -0
  293. package/handlebars/index.d.ts +195 -0
  294. package/handlebars/index.d.ts.map +1 -0
  295. package/handlebars/index.js +666 -0
  296. package/index.d.ts +50 -0
  297. package/index.d.ts.map +1 -0
  298. package/index.js +12683 -0
  299. package/package.json +66 -0
  300. package/registry/index.d.ts +46 -0
  301. package/registry/index.d.ts.map +1 -0
  302. package/registry/index.js +6280 -0
  303. package/registry/render-template.d.ts +91 -0
  304. package/registry/render-template.d.ts.map +1 -0
  305. package/registry/tool-ui.registry.d.ts +294 -0
  306. package/registry/tool-ui.registry.d.ts.map +1 -0
  307. package/registry/uri-utils.d.ts +56 -0
  308. package/registry/uri-utils.d.ts.map +1 -0
  309. package/renderers/cache.d.ts +145 -0
  310. package/renderers/cache.d.ts.map +1 -0
  311. package/renderers/html.renderer.d.ts +123 -0
  312. package/renderers/html.renderer.d.ts.map +1 -0
  313. package/renderers/index.d.ts +36 -0
  314. package/renderers/index.d.ts.map +1 -0
  315. package/renderers/index.js +1706 -0
  316. package/renderers/mdx.renderer.d.ts +120 -0
  317. package/renderers/mdx.renderer.d.ts.map +1 -0
  318. package/renderers/registry.d.ts +133 -0
  319. package/renderers/registry.d.ts.map +1 -0
  320. package/renderers/types.d.ts +342 -0
  321. package/renderers/types.d.ts.map +1 -0
  322. package/renderers/utils/detect.d.ts +107 -0
  323. package/renderers/utils/detect.d.ts.map +1 -0
  324. package/renderers/utils/hash.d.ts +40 -0
  325. package/renderers/utils/hash.d.ts.map +1 -0
  326. package/renderers/utils/index.d.ts +9 -0
  327. package/renderers/utils/index.d.ts.map +1 -0
  328. package/renderers/utils/transpiler.d.ts +89 -0
  329. package/renderers/utils/transpiler.d.ts.map +1 -0
  330. package/runtime/adapters/html.adapter.d.ts +59 -0
  331. package/runtime/adapters/html.adapter.d.ts.map +1 -0
  332. package/runtime/adapters/index.d.ts +26 -0
  333. package/runtime/adapters/index.d.ts.map +1 -0
  334. package/runtime/adapters/mdx.adapter.d.ts +73 -0
  335. package/runtime/adapters/mdx.adapter.d.ts.map +1 -0
  336. package/runtime/adapters/types.d.ts +95 -0
  337. package/runtime/adapters/types.d.ts.map +1 -0
  338. package/runtime/csp.d.ts +48 -0
  339. package/runtime/csp.d.ts.map +1 -0
  340. package/runtime/index.d.ts +17 -0
  341. package/runtime/index.d.ts.map +1 -0
  342. package/runtime/index.js +5052 -0
  343. package/runtime/mcp-bridge.d.ts +101 -0
  344. package/runtime/mcp-bridge.d.ts.map +1 -0
  345. package/runtime/renderer-runtime.d.ts +133 -0
  346. package/runtime/renderer-runtime.d.ts.map +1 -0
  347. package/runtime/sanitizer.d.ts +172 -0
  348. package/runtime/sanitizer.d.ts.map +1 -0
  349. package/runtime/types.d.ts +415 -0
  350. package/runtime/types.d.ts.map +1 -0
  351. package/runtime/wrapper.d.ts +421 -0
  352. package/runtime/wrapper.d.ts.map +1 -0
  353. package/styles/index.d.ts +8 -0
  354. package/styles/index.d.ts.map +1 -0
  355. package/styles/index.js +222 -0
  356. package/styles/variants.d.ts +51 -0
  357. package/styles/variants.d.ts.map +1 -0
  358. package/theme/cdn.d.ts +195 -0
  359. package/theme/cdn.d.ts.map +1 -0
  360. package/theme/index.d.ts +18 -0
  361. package/theme/index.d.ts.map +1 -0
  362. package/theme/index.js +757 -0
  363. package/theme/platforms.d.ts +107 -0
  364. package/theme/platforms.d.ts.map +1 -0
  365. package/theme/presets/github-openai.d.ts +50 -0
  366. package/theme/presets/github-openai.d.ts.map +1 -0
  367. package/theme/presets/index.d.ts +11 -0
  368. package/theme/presets/index.d.ts.map +1 -0
  369. package/theme/theme.d.ts +396 -0
  370. package/theme/theme.d.ts.map +1 -0
  371. package/tool-template/builder.d.ts +213 -0
  372. package/tool-template/builder.d.ts.map +1 -0
  373. package/tool-template/index.d.ts +16 -0
  374. package/tool-template/index.d.ts.map +1 -0
  375. package/tool-template/index.js +3562 -0
  376. package/types/index.d.ts +14 -0
  377. package/types/index.d.ts.map +1 -0
  378. package/types/index.js +108 -0
  379. package/types/ui-config.d.ts +641 -0
  380. package/types/ui-config.d.ts.map +1 -0
  381. package/types/ui-runtime.d.ts +1008 -0
  382. package/types/ui-runtime.d.ts.map +1 -0
  383. package/typings/cache/cache-adapter.d.ts +125 -0
  384. package/typings/cache/cache-adapter.d.ts.map +1 -0
  385. package/typings/cache/index.d.ts +10 -0
  386. package/typings/cache/index.d.ts.map +1 -0
  387. package/typings/cache/memory-cache.d.ts +92 -0
  388. package/typings/cache/memory-cache.d.ts.map +1 -0
  389. package/typings/dts-parser.d.ts +90 -0
  390. package/typings/dts-parser.d.ts.map +1 -0
  391. package/typings/index.d.ts +48 -0
  392. package/typings/index.d.ts.map +1 -0
  393. package/typings/index.js +868 -0
  394. package/typings/schemas.d.ts +232 -0
  395. package/typings/schemas.d.ts.map +1 -0
  396. package/typings/type-fetcher.d.ts +89 -0
  397. package/typings/type-fetcher.d.ts.map +1 -0
  398. package/typings/types.d.ts +320 -0
  399. package/typings/types.d.ts.map +1 -0
  400. package/utils/escape-html.d.ts +58 -0
  401. package/utils/escape-html.d.ts.map +1 -0
  402. package/utils/index.d.ts +10 -0
  403. package/utils/index.d.ts.map +1 -0
  404. package/utils/index.js +70 -0
  405. package/utils/safe-stringify.d.ts +30 -0
  406. package/utils/safe-stringify.d.ts.map +1 -0
  407. package/validation/error-box.d.ts +56 -0
  408. package/validation/error-box.d.ts.map +1 -0
  409. package/validation/index.d.ts +13 -0
  410. package/validation/index.d.ts.map +1 -0
  411. package/validation/index.js +583 -0
  412. package/validation/schema-paths.d.ts +118 -0
  413. package/validation/schema-paths.d.ts.map +1 -0
  414. package/validation/template-validator.d.ts +143 -0
  415. package/validation/template-validator.d.ts.map +1 -0
  416. package/validation/wrapper.d.ts +97 -0
  417. package/validation/wrapper.d.ts.map +1 -0
@@ -0,0 +1,243 @@
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
@@ -0,0 +1 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9B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAoB,GACzB,cAAc,CAiDhB;AAMD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EACrB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,OAAO,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"}
@@ -0,0 +1,295 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/build/index.ts"],"names":[],"mappings":"AAAA;;;;;;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