@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,421 +0,0 @@
1
- /**
2
- * Tool UI Wrapper
3
- *
4
- * Wraps tool UI templates with the MCP Bridge runtime and
5
- * integrates with the existing layout system for consistent styling.
6
- */
7
- import type { WrapToolUIOptions, HostContext } from './types';
8
- import { type ThemeConfig, type PlatformCapabilities, type DeepPartial } from '../theme';
9
- import { escapeHtml } from '../layouts/base';
10
- import { type SanitizerFn } from './sanitizer';
11
- /**
12
- * Extended options for wrapToolUI that include theme and platform
13
- */
14
- export interface WrapToolUIFullOptions extends WrapToolUIOptions {
15
- /** Theme configuration */
16
- theme?: DeepPartial<ThemeConfig>;
17
- /** Target platform capabilities */
18
- platform?: PlatformCapabilities;
19
- /** Initial host context */
20
- hostContext?: Partial<HostContext>;
21
- /**
22
- * Sanitize input before exposing to widget.
23
- * This protects sensitive data from being exposed in client-side widgets.
24
- *
25
- * - `true`: Auto-detect and redact PII patterns (email, phone, SSN, credit card)
26
- * - `string[]`: Redact values in fields with these names
27
- * - `SanitizerFn`: Custom sanitizer function
28
- * - `false` or `undefined`: No sanitization (default)
29
- *
30
- * @example
31
- * ```typescript
32
- * // Auto-detect PII
33
- * wrapToolUI({ sanitizeInput: true, ... });
34
- *
35
- * // Redact specific fields
36
- * wrapToolUI({ sanitizeInput: ['password', 'token', 'api_key'], ... });
37
- *
38
- * // Custom sanitizer
39
- * wrapToolUI({
40
- * sanitizeInput: (key, value) => key === 'secret' ? '[HIDDEN]' : value,
41
- * ...
42
- * });
43
- * ```
44
- */
45
- sanitizeInput?: boolean | string[] | SanitizerFn;
46
- /**
47
- * The type of renderer used (for framework runtime injection).
48
- * Auto-detected by renderToolTemplateAsync.
49
- */
50
- rendererType?: string;
51
- /**
52
- * Enable client-side hydration for React/MDX components.
53
- */
54
- hydrate?: boolean;
55
- /**
56
- * Skip CSP meta tag generation.
57
- *
58
- * OpenAI handles CSP through `_meta['openai/widgetCSP']` in the MCP response,
59
- * not through HTML meta tags. When true, the CSP meta tag is omitted from the
60
- * HTML output to avoid browser warnings about CSP meta tags outside <head>.
61
- *
62
- * @default false
63
- */
64
- skipCspMeta?: boolean;
65
- }
66
- /**
67
- * Create template helpers for use in template builder functions
68
- */
69
- export declare function createTemplateHelpers(): {
70
- /**
71
- * Escape HTML special characters to prevent XSS
72
- */
73
- escapeHtml: typeof escapeHtml;
74
- /**
75
- * Format a date for display
76
- */
77
- formatDate: (date: Date | string, format?: string) => string;
78
- /**
79
- * Format a number as currency
80
- */
81
- formatCurrency: (amount: number, currency?: string) => string;
82
- /**
83
- * Generate a unique ID for DOM elements
84
- */
85
- uniqueId: (prefix?: string) => string;
86
- /**
87
- * Safely embed JSON data in HTML
88
- * Escapes characters that could break out of script tags or HTML
89
- */
90
- jsonEmbed: (data: unknown) => string;
91
- };
92
- /**
93
- * Wrap tool UI content in a complete HTML document with MCP Bridge runtime.
94
- *
95
- * This function creates a standalone HTML document that:
96
- * - Includes the MCP Bridge runtime for cross-platform compatibility
97
- * - Applies Content Security Policy meta tags
98
- * - Injects tool input/output data
99
- * - Uses the FrontMCP theme system for consistent styling
100
- *
101
- * @param options - Options for wrapping the template
102
- * @returns Complete HTML document string
103
- *
104
- * @example
105
- * ```typescript
106
- * const html = wrapToolUI({
107
- * content: '<div class="p-4">Weather: 72°F</div>',
108
- * toolName: 'get_weather',
109
- * input: { location: 'San Francisco' },
110
- * output: { temperature: 72, conditions: 'sunny' },
111
- * csp: { connectDomains: ['https://api.weather.com'] },
112
- * });
113
- * ```
114
- */
115
- export declare function wrapToolUI(options: WrapToolUIFullOptions): string;
116
- /**
117
- * Resource loading mode for widget scripts.
118
- * - 'cdn': Load React/MDX from CDN URLs (lightweight HTML, requires network)
119
- * - 'inline': Embed all scripts in HTML (larger, works offline)
120
- */
121
- export type ResourceMode = 'cdn' | 'inline';
122
- /**
123
- * Options for the universal wrapper.
124
- */
125
- export interface WrapToolUIUniversalOptions {
126
- /** Rendered template content (HTML) */
127
- content: string;
128
- /** Tool name */
129
- toolName: string;
130
- /** Tool input arguments */
131
- input?: Record<string, unknown>;
132
- /** Tool output/result */
133
- output?: unknown;
134
- /** Structured content */
135
- structuredContent?: unknown;
136
- /** CSP configuration */
137
- csp?: WrapToolUIOptions['csp'];
138
- /** Widget accessibility flag */
139
- widgetAccessible?: boolean;
140
- /** Page title */
141
- title?: string;
142
- /** Theme configuration */
143
- theme?: DeepPartial<ThemeConfig>;
144
- /** Whether to include the FrontMCP Bridge */
145
- includeBridge?: boolean;
146
- /** Whether to inline all scripts (for blocked-network environments) */
147
- inlineScripts?: boolean;
148
- /** Renderer type used */
149
- rendererType?: string;
150
- /** Enable hydration */
151
- hydrate?: boolean;
152
- /**
153
- * Skip CSP meta tag generation.
154
- *
155
- * OpenAI handles CSP through `_meta['openai/widgetCSP']` in the MCP response,
156
- * not through HTML meta tags. When true, the CSP meta tag is omitted from the
157
- * HTML output to avoid browser warnings about CSP meta tags outside <head>.
158
- *
159
- * @default false
160
- */
161
- skipCspMeta?: boolean;
162
- /**
163
- * Resource loading mode for widget scripts.
164
- *
165
- * - 'cdn': Load React, MDX, Handlebars from CDN URLs (smaller HTML, requires network)
166
- * - 'inline': Embed all scripts directly in HTML (larger, works in blocked-network environments)
167
- *
168
- * When `inlineScripts` is true, this is automatically set to 'inline'.
169
- *
170
- * @default 'cdn'
171
- */
172
- resourceMode?: ResourceMode;
173
- }
174
- /**
175
- * Wrap tool UI content in a universal HTML document.
176
- *
177
- * This wrapper produces HTML that works on ALL platforms:
178
- * - OpenAI ChatGPT (Apps SDK)
179
- * - Anthropic Claude
180
- * - MCP Apps (ext-apps / SEP-1865)
181
- * - Google Gemini
182
- * - Any MCP-compatible host
183
- *
184
- * The FrontMCP Bridge auto-detects the host at runtime and adapts
185
- * its communication protocol accordingly.
186
- *
187
- * @param options - Universal wrapper options
188
- * @returns Complete HTML document string
189
- *
190
- * @example
191
- * ```typescript
192
- * const html = wrapToolUIUniversal({
193
- * content: '<div class="p-4">Weather: 72°F</div>',
194
- * toolName: 'get_weather',
195
- * output: { temperature: 72 },
196
- * });
197
- * ```
198
- */
199
- export declare function wrapToolUIUniversal(options: WrapToolUIUniversalOptions): string;
200
- /**
201
- * Wrap tool UI content with minimal boilerplate.
202
- * Use this when you need to control all styling yourself.
203
- *
204
- * @param options - Minimal wrapper options
205
- * @returns HTML document string
206
- */
207
- export declare function wrapToolUIMinimal(options: Pick<WrapToolUIOptions, 'content' | 'toolName' | 'input' | 'output' | 'structuredContent' | 'csp' | 'widgetAccessible' | 'title'> & {
208
- skipCspMeta?: boolean;
209
- }): string;
210
- /**
211
- * Options for wrapping a static widget.
212
- */
213
- export interface WrapStaticWidgetOptions {
214
- /** Tool name */
215
- toolName: string;
216
- /** SSR'd template content (rendered WITHOUT data) */
217
- ssrContent: string;
218
- /** Tool UI configuration */
219
- uiConfig: {
220
- csp?: WrapToolUIOptions['csp'];
221
- widgetAccessible?: boolean;
222
- };
223
- /** Page title */
224
- title?: string;
225
- /** Theme configuration */
226
- theme?: DeepPartial<ThemeConfig>;
227
- /**
228
- * Renderer type (react, mdx, html, etc).
229
- * When 'react' or 'mdx', includes React runtime for client-side rendering.
230
- */
231
- rendererType?: string;
232
- /**
233
- * Transpiled component code to include for client-side rendering.
234
- * Required for React components to re-render with actual data.
235
- */
236
- componentCode?: string;
237
- /**
238
- * Embedded data for inline mode (servingMode: 'inline').
239
- * When provided, the data is embedded in the HTML and the component renders immediately
240
- * instead of waiting for window.openai.toolOutput.
241
- *
242
- * This enables inline mode to use the same React renderer as static mode,
243
- * but with data embedded in each response.
244
- */
245
- embeddedData?: {
246
- input?: Record<string, unknown>;
247
- output?: unknown;
248
- structuredContent?: unknown;
249
- };
250
- /**
251
- * Self-contained mode for inline serving.
252
- * When true:
253
- * - Skips the FrontMCP Bridge entirely (no wrapper interference)
254
- * - Renders React immediately with embedded data
255
- * - React component manages its own state via hooks
256
- * - No global state updates that could trigger platform wrappers
257
- *
258
- * This is used for `servingMode: 'inline'` to prevent OpenAI's wrapper
259
- * from overwriting the React component on data changes.
260
- */
261
- selfContained?: boolean;
262
- }
263
- /**
264
- * Options for lean widget shell (inline mode resourceTemplate).
265
- */
266
- export interface WrapLeanWidgetShellOptions {
267
- /** Tool name */
268
- toolName: string;
269
- /** UI configuration */
270
- uiConfig: {
271
- widgetAccessible?: boolean;
272
- };
273
- /** Optional page title */
274
- title?: string;
275
- /** Optional theme overrides */
276
- theme?: Partial<ThemeConfig>;
277
- }
278
- /**
279
- * Create a lean widget shell for inline mode resourceTemplate.
280
- *
281
- * This is a minimal HTML document with:
282
- * - HTML structure with theme CSS and fonts
283
- * - A placeholder/loading message while waiting for tool response
284
- * - FrontMCP Bridge for platform-agnostic communication
285
- * - Injector script that detects ui/html in tool response and replaces the document
286
- *
287
- * NO React runtime, NO component code - the actual React widget comes
288
- * in each tool response via _meta['ui/html'] and is injected by this shell.
289
- *
290
- * OpenAI caches this at discovery time. When a tool executes:
291
- * 1. Tool returns full widget HTML in _meta['ui/html']
292
- * 2. OpenAI injects this into window.openai.toolResponseMetadata['ui/html']
293
- * 3. The bridge detects this and calls the injector callback
294
- * 4. Injector replaces the entire document with the full React widget
295
- *
296
- * @param options - Lean widget options
297
- * @returns Minimal HTML document string with bridge and injector
298
- */
299
- export declare function wrapLeanWidgetShell(options: WrapLeanWidgetShellOptions): string;
300
- /**
301
- * Options for hybrid widget shell (hybrid mode resourceTemplate).
302
- */
303
- export interface WrapHybridWidgetShellOptions {
304
- /** Tool name */
305
- toolName: string;
306
- /** UI configuration */
307
- uiConfig: {
308
- widgetAccessible?: boolean;
309
- csp?: WrapToolUIOptions['csp'];
310
- };
311
- /** Optional page title */
312
- title?: string;
313
- /** Optional theme overrides */
314
- theme?: Partial<ThemeConfig>;
315
- }
316
- /**
317
- * Create a hybrid widget shell for hybrid serving mode.
318
- *
319
- * This shell contains:
320
- * - React 19 runtime from esm.sh CDN
321
- * - FrontMCP Bridge for platform-agnostic communication
322
- * - All FrontMCP hooks (useMcpBridgeContext, useToolOutput, useCallTool, etc.)
323
- * - All FrontMCP UI components (Card, Badge, Button)
324
- * - Dynamic renderer that imports and renders component code at runtime
325
- *
326
- * NO component code is included - it comes in the tool response via `_meta['ui/component']`.
327
- *
328
- * Flow:
329
- * 1. Shell is cached at tools/list (OpenAI caches outputTemplate)
330
- * 2. Tool response contains component code + structured data
331
- * 3. Shell imports component via blob URL and renders with data
332
- * 4. Re-renders on data updates via bridge notifications
333
- *
334
- * @param options - Hybrid widget shell options
335
- * @returns Complete HTML document string with dynamic renderer
336
- */
337
- export declare function wrapHybridWidgetShell(options: WrapHybridWidgetShellOptions): string;
338
- /**
339
- * Wrap a static widget template for MCP resource mode.
340
- *
341
- * Unlike `wrapToolUIUniversal`, this function creates a widget that:
342
- * - Does NOT embed data (input/output/structuredContent)
343
- * - Reads data at runtime from the FrontMCP Bridge (window.openai.toolOutput)
344
- * - Is cached at server startup and returned for all requests
345
- *
346
- * This is used for `servingMode: 'static'` where OpenAI caches the
347
- * outputTemplate HTML and injects data via window.openai.toolOutput.
348
- *
349
- * @param options - Static widget options
350
- * @returns Complete HTML document string
351
- *
352
- * @example
353
- * ```typescript
354
- * const html = wrapStaticWidgetUniversal({
355
- * toolName: 'get_weather',
356
- * ssrContent: '<div class="weather-card"><!-- Template without data --></div>',
357
- * uiConfig: { widgetAccessible: true },
358
- * });
359
- * ```
360
- */
361
- export declare function wrapStaticWidgetUniversal(options: WrapStaticWidgetOptions): string;
362
- /**
363
- * Build OpenAI Apps SDK specific meta annotations.
364
- * These are placed in _meta field of the tool response.
365
- */
366
- export declare function buildOpenAIMeta(options: {
367
- csp?: WrapToolUIOptions['csp'];
368
- widgetAccessible?: boolean;
369
- widgetDescription?: string;
370
- displayMode?: 'inline' | 'fullscreen' | 'pip';
371
- }): Record<string, unknown>;
372
- /**
373
- * Get the MIME type for tool UI responses based on target platform
374
- */
375
- export declare function getToolUIMimeType(platform?: 'openai' | 'ext-apps' | 'generic'): string;
376
- /**
377
- * Options for Claude-specific wrapper.
378
- */
379
- export interface WrapToolUIForClaudeOptions {
380
- /** Rendered template content (HTML body) */
381
- content: string;
382
- /** Tool name */
383
- toolName: string;
384
- /** Tool input arguments */
385
- input?: Record<string, unknown>;
386
- /** Tool output/result */
387
- output?: unknown;
388
- /** Page title */
389
- title?: string;
390
- /** Include HTMX for dynamic interactions */
391
- includeHtmx?: boolean;
392
- /** Include Alpine.js for reactive components */
393
- includeAlpine?: boolean;
394
- }
395
- /**
396
- * Wrap tool UI content for Claude Artifacts.
397
- *
398
- * Creates a complete HTML document using Cloudflare CDN resources
399
- * which are trusted by Claude's sandbox environment.
400
- *
401
- * Key differences from standard wrapper:
402
- * - Uses pre-built Tailwind CSS from cloudflare (not JIT compiler)
403
- * - No esm.sh imports (Claude blocks non-cloudflare CDNs)
404
- * - No React runtime (SSR-only, static HTML)
405
- * - Self-contained with embedded data
406
- *
407
- * @param options - Claude wrapper options
408
- * @returns Complete HTML document string
409
- *
410
- * @example
411
- * ```typescript
412
- * const html = wrapToolUIForClaude({
413
- * content: '<div class="p-4 bg-gray-100">Weather: 72°F</div>',
414
- * toolName: 'get_weather',
415
- * output: { temperature: 72 },
416
- * });
417
- * // Returns full HTML with Tailwind CSS from cloudflare CDN
418
- * ```
419
- */
420
- export declare function wrapToolUIForClaude(options: WrapToolUIForClaudeOptions): string;
421
- //# sourceMappingURL=wrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/runtime/wrapper.ts"],"names":[],"mappings":"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"}
package/styles/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @file styles/index.ts
3
- * @description Centralized CSS class definitions for UI components.
4
- *
5
- * @module @frontmcp/ui/styles
6
- */
7
- export * from './variants';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC"}
package/styles/index.js DELETED
@@ -1,222 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // libs/ui/src/styles/index.ts
21
- var styles_exports = {};
22
- __export(styles_exports, {
23
- ALERT_BASE_CLASSES: () => ALERT_BASE_CLASSES,
24
- ALERT_ICONS: () => ALERT_ICONS,
25
- ALERT_VARIANTS: () => ALERT_VARIANTS,
26
- BADGE_DOT_SIZES: () => BADGE_DOT_SIZES,
27
- BADGE_DOT_VARIANTS: () => BADGE_DOT_VARIANTS,
28
- BADGE_SIZES: () => BADGE_SIZES,
29
- BADGE_VARIANTS: () => BADGE_VARIANTS,
30
- BUTTON_BASE_CLASSES: () => BUTTON_BASE_CLASSES,
31
- BUTTON_ICON_SIZES: () => BUTTON_ICON_SIZES,
32
- BUTTON_SIZES: () => BUTTON_SIZES,
33
- BUTTON_VARIANTS: () => BUTTON_VARIANTS,
34
- CARD_SIZES: () => CARD_SIZES,
35
- CARD_VARIANTS: () => CARD_VARIANTS,
36
- CLOSE_ICON: () => CLOSE_ICON,
37
- LOADING_SPINNER: () => LOADING_SPINNER,
38
- cn: () => cn,
39
- getAlertVariantClasses: () => getAlertVariantClasses,
40
- getBadgeDotSizeClasses: () => getBadgeDotSizeClasses,
41
- getBadgeDotVariantClasses: () => getBadgeDotVariantClasses,
42
- getBadgeSizeClasses: () => getBadgeSizeClasses,
43
- getBadgeVariantClasses: () => getBadgeVariantClasses,
44
- getButtonSizeClasses: () => getButtonSizeClasses,
45
- getButtonVariantClasses: () => getButtonVariantClasses,
46
- getCardSizeClasses: () => getCardSizeClasses,
47
- getCardVariantClasses: () => getCardVariantClasses
48
- });
49
- module.exports = __toCommonJS(styles_exports);
50
-
51
- // libs/ui/src/styles/variants.ts
52
- var CARD_VARIANTS = {
53
- default: "bg-white border border-border rounded-xl shadow-sm",
54
- outlined: "bg-transparent border-2 border-border rounded-xl",
55
- elevated: "bg-white rounded-xl shadow-lg",
56
- filled: "bg-gray-50 rounded-xl",
57
- ghost: "bg-transparent"
58
- };
59
- var CARD_SIZES = {
60
- sm: "p-4",
61
- md: "p-6",
62
- lg: "p-8"
63
- };
64
- function getCardVariantClasses(variant) {
65
- return CARD_VARIANTS[variant];
66
- }
67
- function getCardSizeClasses(size) {
68
- return CARD_SIZES[size];
69
- }
70
- var BADGE_VARIANTS = {
71
- default: "bg-gray-100 text-gray-800",
72
- primary: "bg-primary/10 text-primary",
73
- secondary: "bg-secondary/10 text-secondary",
74
- success: "bg-success/10 text-success",
75
- warning: "bg-warning/10 text-warning",
76
- danger: "bg-danger/10 text-danger",
77
- info: "bg-blue-100 text-blue-800",
78
- outline: "border border-border text-text-primary bg-transparent"
79
- };
80
- var BADGE_SIZES = {
81
- sm: "px-2 py-0.5 text-xs",
82
- md: "px-2.5 py-1 text-xs",
83
- lg: "px-3 py-1.5 text-sm"
84
- };
85
- var BADGE_DOT_SIZES = {
86
- sm: "w-2 h-2",
87
- md: "w-2.5 h-2.5",
88
- lg: "w-3 h-3"
89
- };
90
- var BADGE_DOT_VARIANTS = {
91
- default: "bg-gray-400",
92
- primary: "bg-primary",
93
- secondary: "bg-secondary",
94
- success: "bg-success",
95
- warning: "bg-warning",
96
- danger: "bg-danger",
97
- info: "bg-blue-500",
98
- outline: "border border-current"
99
- };
100
- function getBadgeVariantClasses(variant) {
101
- return BADGE_VARIANTS[variant];
102
- }
103
- function getBadgeSizeClasses(size) {
104
- return BADGE_SIZES[size];
105
- }
106
- function getBadgeDotSizeClasses(size) {
107
- return BADGE_DOT_SIZES[size];
108
- }
109
- function getBadgeDotVariantClasses(variant) {
110
- return BADGE_DOT_VARIANTS[variant];
111
- }
112
- var BUTTON_VARIANTS = {
113
- primary: "bg-primary hover:bg-primary/90 text-white shadow-sm",
114
- secondary: "bg-secondary hover:bg-secondary/90 text-white shadow-sm",
115
- outline: "border-2 border-primary text-primary hover:bg-primary/10",
116
- ghost: "text-text-primary hover:bg-gray-100",
117
- danger: "bg-danger hover:bg-danger/90 text-white shadow-sm",
118
- success: "bg-success hover:bg-success/90 text-white shadow-sm",
119
- link: "text-primary hover:text-primary/80 hover:underline"
120
- };
121
- var BUTTON_SIZES = {
122
- xs: "px-2.5 py-1.5 text-xs",
123
- sm: "px-3 py-2 text-sm",
124
- md: "px-4 py-2.5 text-sm",
125
- lg: "px-5 py-3 text-base",
126
- xl: "px-6 py-3.5 text-lg"
127
- };
128
- var BUTTON_ICON_SIZES = {
129
- xs: "p-1.5",
130
- sm: "p-2",
131
- md: "p-2.5",
132
- lg: "p-3",
133
- xl: "p-4"
134
- };
135
- var BUTTON_BASE_CLASSES = "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2";
136
- function getButtonVariantClasses(variant) {
137
- return BUTTON_VARIANTS[variant];
138
- }
139
- function getButtonSizeClasses(size, iconOnly) {
140
- return iconOnly ? BUTTON_ICON_SIZES[size] : BUTTON_SIZES[size];
141
- }
142
- var ALERT_VARIANTS = {
143
- info: {
144
- container: "bg-blue-50 border-blue-200 text-blue-800",
145
- icon: "text-blue-500"
146
- },
147
- success: {
148
- container: "bg-success/10 border-success/30 text-success",
149
- icon: "text-success"
150
- },
151
- warning: {
152
- container: "bg-warning/10 border-warning/30 text-warning",
153
- icon: "text-warning"
154
- },
155
- danger: {
156
- container: "bg-danger/10 border-danger/30 text-danger",
157
- icon: "text-danger"
158
- },
159
- neutral: {
160
- container: "bg-gray-50 border-gray-200 text-gray-800",
161
- icon: "text-gray-500"
162
- }
163
- };
164
- var ALERT_BASE_CLASSES = "rounded-lg border p-4";
165
- function getAlertVariantClasses(variant) {
166
- return ALERT_VARIANTS[variant];
167
- }
168
- var ALERT_ICONS = {
169
- info: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
170
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
171
- </svg>`,
172
- success: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
173
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
174
- </svg>`,
175
- warning: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
176
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
177
- </svg>`,
178
- danger: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
179
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"/>
180
- </svg>`,
181
- neutral: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
182
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
183
- </svg>`
184
- };
185
- var CLOSE_ICON = `<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
186
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
187
- </svg>`;
188
- var LOADING_SPINNER = `<svg class="animate-spin -ml-1 mr-2 h-4 w-4" fill="none" viewBox="0 0 24 24">
189
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
190
- <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
191
- </svg>`;
192
- function cn(...classes) {
193
- return classes.filter(Boolean).join(" ");
194
- }
195
- // Annotate the CommonJS export names for ESM import in node:
196
- 0 && (module.exports = {
197
- ALERT_BASE_CLASSES,
198
- ALERT_ICONS,
199
- ALERT_VARIANTS,
200
- BADGE_DOT_SIZES,
201
- BADGE_DOT_VARIANTS,
202
- BADGE_SIZES,
203
- BADGE_VARIANTS,
204
- BUTTON_BASE_CLASSES,
205
- BUTTON_ICON_SIZES,
206
- BUTTON_SIZES,
207
- BUTTON_VARIANTS,
208
- CARD_SIZES,
209
- CARD_VARIANTS,
210
- CLOSE_ICON,
211
- LOADING_SPINNER,
212
- cn,
213
- getAlertVariantClasses,
214
- getBadgeDotSizeClasses,
215
- getBadgeDotVariantClasses,
216
- getBadgeSizeClasses,
217
- getBadgeVariantClasses,
218
- getButtonSizeClasses,
219
- getButtonVariantClasses,
220
- getCardSizeClasses,
221
- getCardVariantClasses
222
- });