@frontmcp/ui 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +140 -362
  2. package/bridge/runtime/index.d.ts +2 -1
  3. package/bridge/runtime/index.d.ts.map +1 -1
  4. package/bundler/file-cache/component-builder.d.ts +1 -1
  5. package/bundler/file-cache/component-builder.d.ts.map +1 -1
  6. package/bundler/file-cache/hash-calculator.d.ts +1 -1
  7. package/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  8. package/bundler/file-cache/storage/filesystem.d.ts +1 -1
  9. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  10. package/bundler/file-cache/storage/interface.d.ts +1 -1
  11. package/bundler/file-cache/storage/interface.d.ts.map +1 -1
  12. package/bundler/file-cache/storage/redis.d.ts +1 -1
  13. package/bundler/file-cache/storage/redis.d.ts.map +1 -1
  14. package/bundler/index.js +10 -1057
  15. package/components/alert.schema.d.ts +6 -6
  16. package/components/avatar.schema.d.ts +9 -9
  17. package/components/badge.schema.d.ts +9 -9
  18. package/components/button.schema.d.ts +9 -9
  19. package/components/card.schema.d.ts +7 -7
  20. package/components/form.schema.d.ts +24 -24
  21. package/components/index.js +128 -198
  22. package/components/modal.schema.d.ts +8 -8
  23. package/components/table.schema.d.ts +6 -6
  24. package/esm/bridge/runtime/index.d.ts +2 -1
  25. package/esm/bridge/runtime/index.d.ts.map +1 -1
  26. package/esm/bundler/file-cache/component-builder.d.ts +1 -1
  27. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -1
  28. package/esm/bundler/file-cache/hash-calculator.d.ts +1 -1
  29. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  30. package/esm/bundler/file-cache/storage/filesystem.d.ts +1 -1
  31. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  32. package/esm/bundler/file-cache/storage/interface.d.ts +1 -1
  33. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -1
  34. package/esm/bundler/file-cache/storage/redis.d.ts +1 -1
  35. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -1
  36. package/esm/bundler/index.js +3 -1050
  37. package/esm/components/alert.schema.d.ts +6 -6
  38. package/esm/components/avatar.schema.d.ts +9 -9
  39. package/esm/components/badge.schema.d.ts +9 -9
  40. package/esm/components/button.schema.d.ts +9 -9
  41. package/esm/components/card.schema.d.ts +7 -7
  42. package/esm/components/form.schema.d.ts +24 -24
  43. package/esm/components/index.js +136 -196
  44. package/esm/components/modal.schema.d.ts +8 -8
  45. package/esm/components/table.schema.d.ts +6 -6
  46. package/esm/index.d.ts +23 -39
  47. package/esm/index.d.ts.map +1 -1
  48. package/esm/index.js +4256 -16441
  49. package/esm/layouts/base.d.ts +2 -2
  50. package/esm/layouts/base.d.ts.map +1 -1
  51. package/esm/layouts/index.js +33 -516
  52. package/esm/package.json +8 -26
  53. package/esm/pages/index.js +100 -627
  54. package/esm/react/Alert.d.ts +1 -2
  55. package/esm/react/Alert.d.ts.map +1 -1
  56. package/esm/react/Badge.d.ts +1 -2
  57. package/esm/react/Badge.d.ts.map +1 -1
  58. package/esm/react/Button.d.ts +1 -2
  59. package/esm/react/Button.d.ts.map +1 -1
  60. package/esm/react/Card.d.ts +1 -2
  61. package/esm/react/Card.d.ts.map +1 -1
  62. package/esm/react/hooks/context.d.ts +1 -1
  63. package/esm/react/hooks/context.d.ts.map +1 -1
  64. package/esm/react/index.d.ts +5 -6
  65. package/esm/react/index.d.ts.map +1 -1
  66. package/esm/react/index.js +2074 -322
  67. package/esm/react/types.d.ts +1 -2
  68. package/esm/react/types.d.ts.map +1 -1
  69. package/esm/renderers/index.d.ts +10 -25
  70. package/esm/renderers/index.d.ts.map +1 -1
  71. package/esm/renderers/index.js +171 -1617
  72. package/esm/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  73. package/esm/renderers/react.adapter.d.ts.map +1 -0
  74. package/esm/renderers/react.renderer.d.ts +3 -3
  75. package/esm/renderers/react.renderer.d.ts.map +1 -1
  76. package/esm/universal/index.js +1755 -0
  77. package/esm/web-components/index.js +232 -287
  78. package/esm/widgets/index.js +89 -147
  79. package/index.d.ts +23 -39
  80. package/index.d.ts.map +1 -1
  81. package/index.js +6123 -18539
  82. package/layouts/base.d.ts +2 -2
  83. package/layouts/base.d.ts.map +1 -1
  84. package/layouts/index.js +43 -536
  85. package/package.json +8 -26
  86. package/pages/index.js +111 -648
  87. package/react/Alert.d.ts +1 -2
  88. package/react/Alert.d.ts.map +1 -1
  89. package/react/Badge.d.ts +1 -2
  90. package/react/Badge.d.ts.map +1 -1
  91. package/react/Button.d.ts +1 -2
  92. package/react/Button.d.ts.map +1 -1
  93. package/react/Card.d.ts +1 -2
  94. package/react/Card.d.ts.map +1 -1
  95. package/react/hooks/context.d.ts +1 -1
  96. package/react/hooks/context.d.ts.map +1 -1
  97. package/react/index.d.ts +5 -6
  98. package/react/index.d.ts.map +1 -1
  99. package/react/index.js +2065 -335
  100. package/react/types.d.ts +1 -2
  101. package/react/types.d.ts.map +1 -1
  102. package/renderers/index.d.ts +10 -25
  103. package/renderers/index.d.ts.map +1 -1
  104. package/renderers/index.js +175 -1641
  105. package/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  106. package/renderers/react.adapter.d.ts.map +1 -0
  107. package/renderers/react.renderer.d.ts +3 -3
  108. package/renderers/react.renderer.d.ts.map +1 -1
  109. package/universal/index.js +1841 -0
  110. package/web-components/index.js +224 -289
  111. package/widgets/index.js +80 -148
  112. package/adapters/index.d.ts +0 -13
  113. package/adapters/index.d.ts.map +0 -1
  114. package/adapters/index.js +0 -462
  115. package/adapters/platform-meta.d.ts +0 -166
  116. package/adapters/platform-meta.d.ts.map +0 -1
  117. package/adapters/response-builder.d.ts +0 -108
  118. package/adapters/response-builder.d.ts.map +0 -1
  119. package/adapters/serving-mode.d.ts +0 -107
  120. package/adapters/serving-mode.d.ts.map +0 -1
  121. package/base-template/bridge.d.ts +0 -90
  122. package/base-template/bridge.d.ts.map +0 -1
  123. package/base-template/default-base-template.d.ts +0 -92
  124. package/base-template/default-base-template.d.ts.map +0 -1
  125. package/base-template/index.d.ts +0 -15
  126. package/base-template/index.d.ts.map +0 -1
  127. package/base-template/index.js +0 -1398
  128. package/base-template/polyfills.d.ts +0 -31
  129. package/base-template/polyfills.d.ts.map +0 -1
  130. package/base-template/theme-styles.d.ts +0 -74
  131. package/base-template/theme-styles.d.ts.map +0 -1
  132. package/build/cdn-resources.d.ts +0 -243
  133. package/build/cdn-resources.d.ts.map +0 -1
  134. package/build/index.d.ts +0 -295
  135. package/build/index.d.ts.map +0 -1
  136. package/build/index.js +0 -7096
  137. package/build/widget-manifest.d.ts +0 -362
  138. package/build/widget-manifest.d.ts.map +0 -1
  139. package/dependency/cdn-registry.d.ts +0 -98
  140. package/dependency/cdn-registry.d.ts.map +0 -1
  141. package/dependency/import-map.d.ts +0 -186
  142. package/dependency/import-map.d.ts.map +0 -1
  143. package/dependency/import-parser.d.ts +0 -82
  144. package/dependency/import-parser.d.ts.map +0 -1
  145. package/dependency/index.d.ts +0 -17
  146. package/dependency/index.d.ts.map +0 -1
  147. package/dependency/resolver.d.ts +0 -164
  148. package/dependency/resolver.d.ts.map +0 -1
  149. package/dependency/schemas.d.ts +0 -486
  150. package/dependency/schemas.d.ts.map +0 -1
  151. package/dependency/template-loader.d.ts +0 -204
  152. package/dependency/template-loader.d.ts.map +0 -1
  153. package/dependency/template-processor.d.ts +0 -118
  154. package/dependency/template-processor.d.ts.map +0 -1
  155. package/dependency/types.d.ts +0 -739
  156. package/dependency/types.d.ts.map +0 -1
  157. package/esm/adapters/index.d.ts +0 -13
  158. package/esm/adapters/index.d.ts.map +0 -1
  159. package/esm/adapters/index.js +0 -427
  160. package/esm/adapters/platform-meta.d.ts +0 -166
  161. package/esm/adapters/platform-meta.d.ts.map +0 -1
  162. package/esm/adapters/response-builder.d.ts +0 -108
  163. package/esm/adapters/response-builder.d.ts.map +0 -1
  164. package/esm/adapters/serving-mode.d.ts +0 -107
  165. package/esm/adapters/serving-mode.d.ts.map +0 -1
  166. package/esm/base-template/bridge.d.ts +0 -90
  167. package/esm/base-template/bridge.d.ts.map +0 -1
  168. package/esm/base-template/default-base-template.d.ts +0 -92
  169. package/esm/base-template/default-base-template.d.ts.map +0 -1
  170. package/esm/base-template/index.d.ts +0 -15
  171. package/esm/base-template/index.d.ts.map +0 -1
  172. package/esm/base-template/index.js +0 -1364
  173. package/esm/base-template/polyfills.d.ts +0 -31
  174. package/esm/base-template/polyfills.d.ts.map +0 -1
  175. package/esm/base-template/theme-styles.d.ts +0 -74
  176. package/esm/base-template/theme-styles.d.ts.map +0 -1
  177. package/esm/build/cdn-resources.d.ts +0 -243
  178. package/esm/build/cdn-resources.d.ts.map +0 -1
  179. package/esm/build/index.d.ts +0 -295
  180. package/esm/build/index.d.ts.map +0 -1
  181. package/esm/build/index.js +0 -7021
  182. package/esm/build/widget-manifest.d.ts +0 -362
  183. package/esm/build/widget-manifest.d.ts.map +0 -1
  184. package/esm/dependency/cdn-registry.d.ts +0 -98
  185. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  186. package/esm/dependency/import-map.d.ts +0 -186
  187. package/esm/dependency/import-map.d.ts.map +0 -1
  188. package/esm/dependency/import-parser.d.ts +0 -82
  189. package/esm/dependency/import-parser.d.ts.map +0 -1
  190. package/esm/dependency/index.d.ts +0 -17
  191. package/esm/dependency/index.d.ts.map +0 -1
  192. package/esm/dependency/resolver.d.ts +0 -164
  193. package/esm/dependency/resolver.d.ts.map +0 -1
  194. package/esm/dependency/schemas.d.ts +0 -486
  195. package/esm/dependency/schemas.d.ts.map +0 -1
  196. package/esm/dependency/template-loader.d.ts +0 -204
  197. package/esm/dependency/template-loader.d.ts.map +0 -1
  198. package/esm/dependency/template-processor.d.ts +0 -118
  199. package/esm/dependency/template-processor.d.ts.map +0 -1
  200. package/esm/dependency/types.d.ts +0 -739
  201. package/esm/dependency/types.d.ts.map +0 -1
  202. package/esm/handlebars/expression-extractor.d.ts +0 -147
  203. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  204. package/esm/handlebars/helpers.d.ts +0 -339
  205. package/esm/handlebars/helpers.d.ts.map +0 -1
  206. package/esm/handlebars/index.d.ts +0 -195
  207. package/esm/handlebars/index.d.ts.map +0 -1
  208. package/esm/handlebars/index.js +0 -587
  209. package/esm/registry/index.d.ts +0 -46
  210. package/esm/registry/index.d.ts.map +0 -1
  211. package/esm/registry/index.js +0 -6422
  212. package/esm/registry/render-template.d.ts +0 -91
  213. package/esm/registry/render-template.d.ts.map +0 -1
  214. package/esm/registry/tool-ui.registry.d.ts +0 -294
  215. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  216. package/esm/registry/uri-utils.d.ts +0 -56
  217. package/esm/registry/uri-utils.d.ts.map +0 -1
  218. package/esm/renderers/cache.d.ts +0 -145
  219. package/esm/renderers/cache.d.ts.map +0 -1
  220. package/esm/renderers/html.renderer.d.ts +0 -123
  221. package/esm/renderers/html.renderer.d.ts.map +0 -1
  222. package/esm/renderers/mdx.renderer.d.ts +0 -120
  223. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  224. package/esm/renderers/registry.d.ts +0 -134
  225. package/esm/renderers/registry.d.ts.map +0 -1
  226. package/esm/renderers/types.d.ts +0 -342
  227. package/esm/renderers/types.d.ts.map +0 -1
  228. package/esm/renderers/utils/detect.d.ts +0 -107
  229. package/esm/renderers/utils/detect.d.ts.map +0 -1
  230. package/esm/renderers/utils/hash.d.ts +0 -40
  231. package/esm/renderers/utils/hash.d.ts.map +0 -1
  232. package/esm/renderers/utils/index.d.ts +0 -9
  233. package/esm/renderers/utils/index.d.ts.map +0 -1
  234. package/esm/renderers/utils/transpiler.d.ts +0 -89
  235. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  236. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  237. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  238. package/esm/runtime/adapters/index.d.ts +0 -26
  239. package/esm/runtime/adapters/index.d.ts.map +0 -1
  240. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  241. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  242. package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
  243. package/esm/runtime/adapters/types.d.ts +0 -95
  244. package/esm/runtime/adapters/types.d.ts.map +0 -1
  245. package/esm/runtime/csp.d.ts +0 -48
  246. package/esm/runtime/csp.d.ts.map +0 -1
  247. package/esm/runtime/index.d.ts +0 -17
  248. package/esm/runtime/index.d.ts.map +0 -1
  249. package/esm/runtime/index.js +0 -5186
  250. package/esm/runtime/mcp-bridge.d.ts +0 -101
  251. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  252. package/esm/runtime/renderer-runtime.d.ts +0 -133
  253. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  254. package/esm/runtime/sanitizer.d.ts +0 -172
  255. package/esm/runtime/sanitizer.d.ts.map +0 -1
  256. package/esm/runtime/types.d.ts +0 -415
  257. package/esm/runtime/types.d.ts.map +0 -1
  258. package/esm/runtime/wrapper.d.ts +0 -421
  259. package/esm/runtime/wrapper.d.ts.map +0 -1
  260. package/esm/styles/index.d.ts +0 -8
  261. package/esm/styles/index.d.ts.map +0 -1
  262. package/esm/styles/index.js +0 -171
  263. package/esm/styles/variants.d.ts +0 -51
  264. package/esm/styles/variants.d.ts.map +0 -1
  265. package/esm/theme/cdn.d.ts +0 -195
  266. package/esm/theme/cdn.d.ts.map +0 -1
  267. package/esm/theme/index.d.ts +0 -18
  268. package/esm/theme/index.d.ts.map +0 -1
  269. package/esm/theme/index.js +0 -700
  270. package/esm/theme/platforms.d.ts +0 -107
  271. package/esm/theme/platforms.d.ts.map +0 -1
  272. package/esm/theme/presets/github-openai.d.ts +0 -50
  273. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  274. package/esm/theme/presets/index.d.ts +0 -11
  275. package/esm/theme/presets/index.d.ts.map +0 -1
  276. package/esm/theme/theme.d.ts +0 -396
  277. package/esm/theme/theme.d.ts.map +0 -1
  278. package/esm/tool-template/builder.d.ts +0 -213
  279. package/esm/tool-template/builder.d.ts.map +0 -1
  280. package/esm/tool-template/index.d.ts +0 -16
  281. package/esm/tool-template/index.d.ts.map +0 -1
  282. package/esm/tool-template/index.js +0 -3515
  283. package/esm/types/index.d.ts +0 -14
  284. package/esm/types/index.d.ts.map +0 -1
  285. package/esm/types/index.js +0 -75
  286. package/esm/types/ui-config.d.ts +0 -639
  287. package/esm/types/ui-config.d.ts.map +0 -1
  288. package/esm/types/ui-runtime.d.ts +0 -1007
  289. package/esm/types/ui-runtime.d.ts.map +0 -1
  290. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  291. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  292. package/esm/typings/cache/index.d.ts +0 -10
  293. package/esm/typings/cache/index.d.ts.map +0 -1
  294. package/esm/typings/cache/memory-cache.d.ts +0 -92
  295. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  296. package/esm/typings/dts-parser.d.ts +0 -90
  297. package/esm/typings/dts-parser.d.ts.map +0 -1
  298. package/esm/typings/index.d.ts +0 -48
  299. package/esm/typings/index.d.ts.map +0 -1
  300. package/esm/typings/schemas.d.ts +0 -232
  301. package/esm/typings/schemas.d.ts.map +0 -1
  302. package/esm/typings/type-fetcher.d.ts +0 -89
  303. package/esm/typings/type-fetcher.d.ts.map +0 -1
  304. package/esm/typings/types.d.ts +0 -320
  305. package/esm/typings/types.d.ts.map +0 -1
  306. package/esm/utils/escape-html.d.ts +0 -58
  307. package/esm/utils/escape-html.d.ts.map +0 -1
  308. package/esm/utils/index.d.ts +0 -10
  309. package/esm/utils/index.d.ts.map +0 -1
  310. package/esm/utils/index.js +0 -40
  311. package/esm/utils/safe-stringify.d.ts +0 -30
  312. package/esm/utils/safe-stringify.d.ts.map +0 -1
  313. package/esm/validation/error-box.d.ts +0 -56
  314. package/esm/validation/error-box.d.ts.map +0 -1
  315. package/esm/validation/index.d.ts +0 -13
  316. package/esm/validation/index.d.ts.map +0 -1
  317. package/esm/validation/index.js +0 -562
  318. package/esm/validation/schema-paths.d.ts +0 -118
  319. package/esm/validation/schema-paths.d.ts.map +0 -1
  320. package/esm/validation/template-validator.d.ts +0 -143
  321. package/esm/validation/template-validator.d.ts.map +0 -1
  322. package/esm/validation/wrapper.d.ts +0 -97
  323. package/esm/validation/wrapper.d.ts.map +0 -1
  324. package/handlebars/expression-extractor.d.ts +0 -147
  325. package/handlebars/expression-extractor.d.ts.map +0 -1
  326. package/handlebars/helpers.d.ts +0 -339
  327. package/handlebars/helpers.d.ts.map +0 -1
  328. package/handlebars/index.d.ts +0 -195
  329. package/handlebars/index.d.ts.map +0 -1
  330. package/handlebars/index.js +0 -666
  331. package/registry/index.d.ts +0 -46
  332. package/registry/index.d.ts.map +0 -1
  333. package/registry/index.js +0 -6465
  334. package/registry/render-template.d.ts +0 -91
  335. package/registry/render-template.d.ts.map +0 -1
  336. package/registry/tool-ui.registry.d.ts +0 -294
  337. package/registry/tool-ui.registry.d.ts.map +0 -1
  338. package/registry/uri-utils.d.ts +0 -56
  339. package/registry/uri-utils.d.ts.map +0 -1
  340. package/renderers/cache.d.ts +0 -145
  341. package/renderers/cache.d.ts.map +0 -1
  342. package/renderers/html.renderer.d.ts +0 -123
  343. package/renderers/html.renderer.d.ts.map +0 -1
  344. package/renderers/mdx.renderer.d.ts +0 -120
  345. package/renderers/mdx.renderer.d.ts.map +0 -1
  346. package/renderers/registry.d.ts +0 -134
  347. package/renderers/registry.d.ts.map +0 -1
  348. package/renderers/types.d.ts +0 -342
  349. package/renderers/types.d.ts.map +0 -1
  350. package/renderers/utils/detect.d.ts +0 -107
  351. package/renderers/utils/detect.d.ts.map +0 -1
  352. package/renderers/utils/hash.d.ts +0 -40
  353. package/renderers/utils/hash.d.ts.map +0 -1
  354. package/renderers/utils/index.d.ts +0 -9
  355. package/renderers/utils/index.d.ts.map +0 -1
  356. package/renderers/utils/transpiler.d.ts +0 -89
  357. package/renderers/utils/transpiler.d.ts.map +0 -1
  358. package/runtime/adapters/html.adapter.d.ts +0 -59
  359. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  360. package/runtime/adapters/index.d.ts +0 -26
  361. package/runtime/adapters/index.d.ts.map +0 -1
  362. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  363. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  364. package/runtime/adapters/react.adapter.d.ts.map +0 -1
  365. package/runtime/adapters/types.d.ts +0 -95
  366. package/runtime/adapters/types.d.ts.map +0 -1
  367. package/runtime/csp.d.ts +0 -48
  368. package/runtime/csp.d.ts.map +0 -1
  369. package/runtime/index.d.ts +0 -17
  370. package/runtime/index.d.ts.map +0 -1
  371. package/runtime/index.js +0 -5264
  372. package/runtime/mcp-bridge.d.ts +0 -101
  373. package/runtime/mcp-bridge.d.ts.map +0 -1
  374. package/runtime/renderer-runtime.d.ts +0 -133
  375. package/runtime/renderer-runtime.d.ts.map +0 -1
  376. package/runtime/sanitizer.d.ts +0 -172
  377. package/runtime/sanitizer.d.ts.map +0 -1
  378. package/runtime/types.d.ts +0 -415
  379. package/runtime/types.d.ts.map +0 -1
  380. package/runtime/wrapper.d.ts +0 -421
  381. package/runtime/wrapper.d.ts.map +0 -1
  382. package/styles/index.d.ts +0 -8
  383. package/styles/index.d.ts.map +0 -1
  384. package/styles/index.js +0 -222
  385. package/styles/variants.d.ts +0 -51
  386. package/styles/variants.d.ts.map +0 -1
  387. package/theme/cdn.d.ts +0 -195
  388. package/theme/cdn.d.ts.map +0 -1
  389. package/theme/index.d.ts +0 -18
  390. package/theme/index.d.ts.map +0 -1
  391. package/theme/index.js +0 -757
  392. package/theme/platforms.d.ts +0 -107
  393. package/theme/platforms.d.ts.map +0 -1
  394. package/theme/presets/github-openai.d.ts +0 -50
  395. package/theme/presets/github-openai.d.ts.map +0 -1
  396. package/theme/presets/index.d.ts +0 -11
  397. package/theme/presets/index.d.ts.map +0 -1
  398. package/theme/theme.d.ts +0 -396
  399. package/theme/theme.d.ts.map +0 -1
  400. package/tool-template/builder.d.ts +0 -213
  401. package/tool-template/builder.d.ts.map +0 -1
  402. package/tool-template/index.d.ts +0 -16
  403. package/tool-template/index.d.ts.map +0 -1
  404. package/tool-template/index.js +0 -3559
  405. package/types/index.d.ts +0 -14
  406. package/types/index.d.ts.map +0 -1
  407. package/types/index.js +0 -108
  408. package/types/ui-config.d.ts +0 -639
  409. package/types/ui-config.d.ts.map +0 -1
  410. package/types/ui-runtime.d.ts +0 -1007
  411. package/types/ui-runtime.d.ts.map +0 -1
  412. package/typings/cache/cache-adapter.d.ts +0 -125
  413. package/typings/cache/cache-adapter.d.ts.map +0 -1
  414. package/typings/cache/index.d.ts +0 -10
  415. package/typings/cache/index.d.ts.map +0 -1
  416. package/typings/cache/memory-cache.d.ts +0 -92
  417. package/typings/cache/memory-cache.d.ts.map +0 -1
  418. package/typings/dts-parser.d.ts +0 -90
  419. package/typings/dts-parser.d.ts.map +0 -1
  420. package/typings/index.d.ts +0 -48
  421. package/typings/index.d.ts.map +0 -1
  422. package/typings/schemas.d.ts +0 -232
  423. package/typings/schemas.d.ts.map +0 -1
  424. package/typings/type-fetcher.d.ts +0 -89
  425. package/typings/type-fetcher.d.ts.map +0 -1
  426. package/typings/types.d.ts +0 -320
  427. package/typings/types.d.ts.map +0 -1
  428. package/utils/escape-html.d.ts +0 -58
  429. package/utils/escape-html.d.ts.map +0 -1
  430. package/utils/index.d.ts +0 -10
  431. package/utils/index.d.ts.map +0 -1
  432. package/utils/index.js +0 -70
  433. package/utils/safe-stringify.d.ts +0 -30
  434. package/utils/safe-stringify.d.ts.map +0 -1
  435. package/validation/error-box.d.ts +0 -56
  436. package/validation/error-box.d.ts.map +0 -1
  437. package/validation/index.d.ts +0 -13
  438. package/validation/index.d.ts.map +0 -1
  439. package/validation/index.js +0 -603
  440. package/validation/schema-paths.d.ts +0 -118
  441. package/validation/schema-paths.d.ts.map +0 -1
  442. package/validation/template-validator.d.ts +0 -143
  443. package/validation/template-validator.d.ts.map +0 -1
  444. package/validation/wrapper.d.ts +0 -97
  445. package/validation/wrapper.d.ts.map +0 -1
package/adapters/index.js DELETED
@@ -1,462 +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/adapters/index.ts
21
- var adapters_exports = {};
22
- __export(adapters_exports, {
23
- buildOpenAICSP: () => buildOpenAICSP,
24
- buildToolDiscoveryMeta: () => buildToolDiscoveryMeta,
25
- buildToolResponseContent: () => buildToolResponseContent,
26
- buildUIMeta: () => buildUIMeta,
27
- getDefaultServingMode: () => getDefaultServingMode,
28
- isPlatformModeSupported: () => isPlatformModeSupported,
29
- platformSupportsWidgets: () => platformSupportsWidgets,
30
- platformUsesStructuredContent: () => platformUsesStructuredContent,
31
- resolveServingMode: () => resolveServingMode
32
- });
33
- module.exports = __toCommonJS(adapters_exports);
34
-
35
- // libs/ui/src/adapters/platform-meta.ts
36
- function buildUIMeta(options) {
37
- const { uiConfig, platformType, html, token, directUrl, rendererType, contentHash, manifestUri } = options;
38
- const meta = {};
39
- switch (platformType) {
40
- case "openai":
41
- meta["openai/html"] = html;
42
- meta["openai/mimeType"] = "text/html+skybridge";
43
- if (rendererType) meta["openai/type"] = rendererType;
44
- if (contentHash) meta["openai/contentHash"] = contentHash;
45
- if (manifestUri) meta["openai/manifestUri"] = manifestUri;
46
- if (token) meta["openai/widgetToken"] = token;
47
- if (directUrl) meta["openai/directUrl"] = directUrl;
48
- return buildOpenAIMeta(meta, uiConfig);
49
- case "ext-apps":
50
- meta["ui/html"] = html;
51
- meta["ui/mimeType"] = "text/html+mcp";
52
- if (rendererType) meta["ui/type"] = rendererType;
53
- if (contentHash) meta["ui/contentHash"] = contentHash;
54
- if (manifestUri) meta["ui/manifestUri"] = manifestUri;
55
- if (token) meta["ui/widgetToken"] = token;
56
- if (directUrl) meta["ui/directUrl"] = directUrl;
57
- return buildExtAppsMeta(meta, uiConfig);
58
- case "claude":
59
- case "cursor":
60
- case "continue":
61
- case "cody":
62
- case "generic-mcp":
63
- case "gemini":
64
- default:
65
- meta["frontmcp/html"] = html;
66
- meta["frontmcp/mimeType"] = "text/html+mcp";
67
- if (rendererType) meta["frontmcp/type"] = rendererType;
68
- if (contentHash) meta["frontmcp/contentHash"] = contentHash;
69
- if (manifestUri) meta["frontmcp/manifestUri"] = manifestUri;
70
- if (token) meta["frontmcp/widgetToken"] = token;
71
- if (directUrl) meta["frontmcp/directUrl"] = directUrl;
72
- meta["ui/html"] = html;
73
- meta["ui/mimeType"] = "text/html+mcp";
74
- if (rendererType) meta["ui/type"] = rendererType;
75
- if (platformType === "claude") {
76
- return buildClaudeMeta(meta, uiConfig);
77
- } else if (platformType === "gemini") {
78
- return buildGeminiMeta(meta, uiConfig);
79
- } else if (platformType === "cursor" || platformType === "continue" || platformType === "cody") {
80
- return buildIDEMeta(meta, uiConfig);
81
- } else if (platformType === "generic-mcp") {
82
- return buildGenericMeta(meta, uiConfig);
83
- }
84
- return meta;
85
- }
86
- }
87
- function buildOpenAIMeta(meta, uiConfig) {
88
- if (uiConfig.invocationStatus?.invoking) {
89
- meta["openai/toolInvocation/invoking"] = uiConfig.invocationStatus.invoking;
90
- }
91
- if (uiConfig.invocationStatus?.invoked) {
92
- meta["openai/toolInvocation/invoked"] = uiConfig.invocationStatus.invoked;
93
- }
94
- return meta;
95
- }
96
- function buildOpenAICSP(csp) {
97
- const result = {};
98
- if (csp.connectDomains?.length) {
99
- result.connect_domains = csp.connectDomains;
100
- }
101
- if (csp.resourceDomains?.length) {
102
- result.resource_domains = csp.resourceDomains;
103
- }
104
- return result;
105
- }
106
- function buildClaudeMeta(meta, uiConfig) {
107
- if (uiConfig.widgetDescription) {
108
- meta["claude/widgetDescription"] = uiConfig.widgetDescription;
109
- }
110
- return meta;
111
- }
112
- function buildGeminiMeta(meta, uiConfig) {
113
- if (uiConfig.widgetDescription) {
114
- meta["gemini/widgetDescription"] = uiConfig.widgetDescription;
115
- }
116
- return meta;
117
- }
118
- function buildIDEMeta(meta, uiConfig) {
119
- if (uiConfig.widgetDescription) {
120
- meta["ide/widgetDescription"] = uiConfig.widgetDescription;
121
- }
122
- return meta;
123
- }
124
- function buildGenericMeta(meta, uiConfig) {
125
- if (uiConfig.widgetAccessible) {
126
- meta["openai/widgetAccessible"] = true;
127
- }
128
- if (uiConfig.csp) {
129
- meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
130
- }
131
- return meta;
132
- }
133
- function buildExtAppsMeta(meta, uiConfig) {
134
- meta["ui/mimeType"] = "text/html+mcp";
135
- if (uiConfig.csp) {
136
- const csp = {};
137
- if (uiConfig.csp.connectDomains?.length) {
138
- csp.connectDomains = uiConfig.csp.connectDomains;
139
- }
140
- if (uiConfig.csp.resourceDomains?.length) {
141
- csp.resourceDomains = uiConfig.csp.resourceDomains;
142
- }
143
- if (Object.keys(csp).length > 0) {
144
- meta["ui/csp"] = csp;
145
- }
146
- }
147
- if (uiConfig.displayMode) {
148
- const displayModeMap = {
149
- inline: "inline",
150
- fullscreen: "fullscreen",
151
- pip: "pip",
152
- // Map OpenAI-style values
153
- widget: "inline",
154
- panel: "fullscreen"
155
- };
156
- const mappedMode = displayModeMap[uiConfig.displayMode];
157
- if (mappedMode) {
158
- meta["ui/displayMode"] = mappedMode;
159
- }
160
- }
161
- if (uiConfig.prefersBorder !== void 0) {
162
- meta["ui/prefersBorder"] = uiConfig.prefersBorder;
163
- }
164
- if (uiConfig.sandboxDomain) {
165
- meta["ui/domain"] = uiConfig.sandboxDomain;
166
- }
167
- return meta;
168
- }
169
- function buildToolDiscoveryMeta(options) {
170
- const { uiConfig, platformType, staticWidgetUri } = options;
171
- const meta = {};
172
- switch (platformType) {
173
- case "openai":
174
- meta["openai/outputTemplate"] = staticWidgetUri;
175
- meta["openai/resultCanProduceWidget"] = true;
176
- if (uiConfig.widgetAccessible) {
177
- meta["openai/widgetAccessible"] = true;
178
- }
179
- if (uiConfig.csp) {
180
- meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
181
- }
182
- if (uiConfig.displayMode) {
183
- meta["openai/displayMode"] = uiConfig.displayMode;
184
- }
185
- if (uiConfig.widgetDescription) {
186
- meta["openai/widgetDescription"] = uiConfig.widgetDescription;
187
- }
188
- break;
189
- case "generic-mcp":
190
- meta["openai/outputTemplate"] = staticWidgetUri;
191
- meta["openai/resultCanProduceWidget"] = true;
192
- if (uiConfig.widgetAccessible) {
193
- meta["openai/widgetAccessible"] = true;
194
- }
195
- if (uiConfig.csp) {
196
- meta["openai/widgetCSP"] = buildOpenAICSP(uiConfig.csp);
197
- }
198
- break;
199
- case "ext-apps":
200
- meta["ui/resourceUri"] = staticWidgetUri;
201
- meta["ui/mimeType"] = "text/html+mcp";
202
- if (uiConfig.csp) {
203
- const csp = {};
204
- if (uiConfig.csp.connectDomains?.length) {
205
- csp.connectDomains = uiConfig.csp.connectDomains;
206
- }
207
- if (uiConfig.csp.resourceDomains?.length) {
208
- csp.resourceDomains = uiConfig.csp.resourceDomains;
209
- }
210
- if (Object.keys(csp).length > 0) {
211
- meta["ui/csp"] = csp;
212
- }
213
- }
214
- if (uiConfig.displayMode) {
215
- const displayModeMap = {
216
- inline: "inline",
217
- fullscreen: "fullscreen",
218
- pip: "pip"
219
- };
220
- const mappedMode = displayModeMap[uiConfig.displayMode];
221
- if (mappedMode) {
222
- meta["ui/displayMode"] = mappedMode;
223
- }
224
- }
225
- if (uiConfig.prefersBorder !== void 0) {
226
- meta["ui/prefersBorder"] = uiConfig.prefersBorder;
227
- }
228
- if (uiConfig.sandboxDomain) {
229
- meta["ui/domain"] = uiConfig.sandboxDomain;
230
- }
231
- break;
232
- // Claude, Gemini, IDEs don't need discovery metadata
233
- // They use inline HTML at call time
234
- default:
235
- break;
236
- }
237
- return meta;
238
- }
239
-
240
- // libs/ui/src/adapters/serving-mode.ts
241
- var PLATFORM_CAPABILITIES = {
242
- openai: {
243
- supportsWidgets: true,
244
- useStructuredContent: true,
245
- supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
246
- defaultMode: "inline"
247
- },
248
- "ext-apps": {
249
- supportsWidgets: true,
250
- useStructuredContent: true,
251
- supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
252
- defaultMode: "inline"
253
- },
254
- claude: {
255
- supportsWidgets: true,
256
- useStructuredContent: true,
257
- // Claude supports inline only (no resource fetching for static)
258
- supportedModes: ["inline"],
259
- defaultMode: "inline"
260
- },
261
- cursor: {
262
- // Cursor (IDE) - similar to OpenAI, supports widgets
263
- supportsWidgets: true,
264
- useStructuredContent: true,
265
- supportedModes: ["inline", "static", "hybrid", "direct-url", "custom-url"],
266
- defaultMode: "inline"
267
- },
268
- continue: {
269
- // Continue (IDE extension) - basic widget support
270
- supportsWidgets: true,
271
- useStructuredContent: true,
272
- supportedModes: ["inline"],
273
- defaultMode: "inline"
274
- },
275
- cody: {
276
- // Sourcegraph Cody - basic widget support
277
- supportsWidgets: true,
278
- useStructuredContent: true,
279
- supportedModes: ["inline"],
280
- defaultMode: "inline"
281
- },
282
- "generic-mcp": {
283
- // Generic MCP clients - assume widget support
284
- supportsWidgets: true,
285
- useStructuredContent: true,
286
- supportedModes: ["inline", "static"],
287
- defaultMode: "inline"
288
- },
289
- gemini: {
290
- supportsWidgets: false,
291
- useStructuredContent: false,
292
- supportedModes: [],
293
- defaultMode: "inline"
294
- // Not used since supportsWidgets is false
295
- },
296
- unknown: {
297
- // Unknown clients: assume widget support, return ui/html + text/html+mcp
298
- // This allows generic MCP clients to receive and render widget UI
299
- supportsWidgets: true,
300
- useStructuredContent: true,
301
- supportedModes: ["inline"],
302
- defaultMode: "inline"
303
- }
304
- };
305
- function resolveServingMode(options) {
306
- const { configuredMode = "auto", platformType } = options;
307
- const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
308
- if (!capabilities.supportsWidgets) {
309
- return {
310
- effectiveMode: null,
311
- useStructuredContent: false,
312
- supportsUI: false,
313
- reason: `Platform '${platformType}' does not support widget UI`
314
- };
315
- }
316
- if (configuredMode === "auto") {
317
- return {
318
- effectiveMode: capabilities.defaultMode,
319
- useStructuredContent: capabilities.useStructuredContent,
320
- supportsUI: true,
321
- reason: `Auto-selected '${capabilities.defaultMode}' for platform '${platformType}'`
322
- };
323
- }
324
- if (capabilities.supportedModes.includes(configuredMode)) {
325
- return {
326
- effectiveMode: configuredMode,
327
- useStructuredContent: capabilities.useStructuredContent,
328
- supportsUI: true,
329
- reason: `Using configured mode '${configuredMode}' (supported by '${platformType}')`
330
- };
331
- }
332
- return {
333
- effectiveMode: null,
334
- useStructuredContent: false,
335
- supportsUI: false,
336
- reason: `Mode '${configuredMode}' not supported by platform '${platformType}'. Supported: ${capabilities.supportedModes.join(", ") || "none"}`
337
- };
338
- }
339
- function isPlatformModeSupported(platformType, mode) {
340
- const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
341
- if (mode === "auto") {
342
- return capabilities.supportsWidgets;
343
- }
344
- return capabilities.supportedModes.includes(mode);
345
- }
346
- function getDefaultServingMode(platformType) {
347
- const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
348
- return capabilities.supportsWidgets ? capabilities.defaultMode : null;
349
- }
350
- function platformUsesStructuredContent(platformType) {
351
- const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
352
- return capabilities.useStructuredContent;
353
- }
354
- function platformSupportsWidgets(platformType) {
355
- const capabilities = PLATFORM_CAPABILITIES[platformType] || PLATFORM_CAPABILITIES.unknown;
356
- return capabilities.supportsWidgets;
357
- }
358
-
359
- // libs/ui/src/utils/safe-stringify.ts
360
- function safeStringify(value, space) {
361
- const seen = /* @__PURE__ */ new WeakSet();
362
- try {
363
- return JSON.stringify(
364
- value,
365
- (_key, val) => {
366
- if (typeof val === "object" && val !== null) {
367
- if (seen.has(val)) return "[Circular]";
368
- seen.add(val);
369
- }
370
- return val;
371
- },
372
- space
373
- );
374
- } catch {
375
- return JSON.stringify({ error: "Output could not be serialized" });
376
- }
377
- }
378
-
379
- // libs/ui/src/adapters/response-builder.ts
380
- function buildToolResponseContent(options) {
381
- const { rawOutput, htmlContent, servingMode, useStructuredContent, platformType } = options;
382
- if (servingMode === "static") {
383
- return {
384
- content: [{ type: "text", text: safeStringify(rawOutput) }],
385
- structuredContent: useStructuredContent ? rawOutput : void 0,
386
- contentCleared: false,
387
- format: "json-only"
388
- };
389
- }
390
- if (servingMode === "hybrid") {
391
- return {
392
- content: [{ type: "text", text: safeStringify(rawOutput) }],
393
- structuredContent: useStructuredContent ? rawOutput : void 0,
394
- contentCleared: false,
395
- format: "json-only"
396
- };
397
- }
398
- if (useStructuredContent) {
399
- if (htmlContent) {
400
- return {
401
- content: [{ type: "text", text: htmlContent }],
402
- structuredContent: rawOutput,
403
- contentCleared: false,
404
- format: "structured-content"
405
- };
406
- }
407
- return {
408
- content: [{ type: "text", text: safeStringify(rawOutput) }],
409
- structuredContent: rawOutput,
410
- contentCleared: false,
411
- format: "json-only"
412
- };
413
- }
414
- const supportsWidgets = platformSupportsWidgets(platformType);
415
- if (supportsWidgets) {
416
- return {
417
- content: [],
418
- contentCleared: true,
419
- format: "widget"
420
- };
421
- }
422
- if (htmlContent) {
423
- return {
424
- content: [
425
- {
426
- type: "text",
427
- text: `## Data
428
- \`\`\`json
429
- ${safeStringify(
430
- rawOutput,
431
- 2
432
- )}
433
- \`\`\`
434
-
435
- ## Visual Template (for artifact rendering)
436
- \`\`\`html
437
- ${htmlContent}
438
- \`\`\``
439
- }
440
- ],
441
- contentCleared: false,
442
- format: "markdown"
443
- };
444
- }
445
- return {
446
- content: [{ type: "text", text: safeStringify(rawOutput, 2) }],
447
- contentCleared: false,
448
- format: "json-only"
449
- };
450
- }
451
- // Annotate the CommonJS export names for ESM import in node:
452
- 0 && (module.exports = {
453
- buildOpenAICSP,
454
- buildToolDiscoveryMeta,
455
- buildToolResponseContent,
456
- buildUIMeta,
457
- getDefaultServingMode,
458
- isPlatformModeSupported,
459
- platformSupportsWidgets,
460
- platformUsesStructuredContent,
461
- resolveServingMode
462
- });
@@ -1,166 +0,0 @@
1
- /**
2
- * Platform Metadata Adapters
3
- *
4
- * Build platform-specific _meta fields for tool UI responses.
5
- * Adapts the UI configuration to the format expected by each
6
- * AI platform (OpenAI, Claude, Gemini, etc.).
7
- *
8
- * This module is SDK-independent and can be used by external systems
9
- * like AgentLink without requiring @frontmcp/sdk.
10
- *
11
- * @packageDocumentation
12
- */
13
- import type { UITemplateConfig, UIContentSecurityPolicy } from '../types';
14
- /**
15
- * Supported AI platform types.
16
- * Used to determine which metadata format to generate.
17
- */
18
- export type AIPlatformType = 'openai' | 'claude' | 'gemini' | 'cursor' | 'continue' | 'cody' | 'generic-mcp' | 'ext-apps' | 'unknown';
19
- /**
20
- * UI metadata to include in tool response _meta field.
21
- * Contains both universal fields and platform-specific annotations.
22
- */
23
- export interface UIMetadata {
24
- /** Inline rendered HTML (universal) */
25
- 'ui/html'?: string;
26
- /** MIME type for the HTML content */
27
- 'ui/mimeType'?: string;
28
- /** Widget token for authenticated operations */
29
- 'ui/widgetToken'?: string;
30
- /** Direct URL to widget (for direct-url serving mode) */
31
- 'ui/directUrl'?: string;
32
- /** Renderer type for the widget (html, react, mdx, markdown, auto) */
33
- 'ui/type'?: string;
34
- /** Manifest URI for accessing widget configuration */
35
- 'ui/manifestUri'?: string;
36
- /** Hash of the widget content for cache validation */
37
- 'ui/contentHash'?: string;
38
- /** Required renderer assets for lazy loading */
39
- 'ui/requiredRenderers'?: string[];
40
- /** OpenAI: Resource URI for widget template */
41
- 'openai/outputTemplate'?: string;
42
- /** OpenAI: Whether widget can invoke tools */
43
- 'openai/widgetAccessible'?: boolean;
44
- /** OpenAI: Whether tool result can produce a widget (CRITICAL for ChatGPT) */
45
- 'openai/resultCanProduceWidget'?: boolean;
46
- /** OpenAI: CSP configuration */
47
- 'openai/widgetCSP'?: {
48
- connect_domains?: string[];
49
- resource_domains?: string[];
50
- };
51
- /** OpenAI: Display mode preference */
52
- 'openai/displayMode'?: string;
53
- /** OpenAI: Widget description */
54
- 'openai/widgetDescription'?: string;
55
- /** OpenAI: Status text while tool is executing */
56
- 'openai/toolInvocation/invoking'?: string;
57
- /** OpenAI: Status text after tool execution completes */
58
- 'openai/toolInvocation/invoked'?: string;
59
- /** Claude: Widget description */
60
- 'claude/widgetDescription'?: string;
61
- /** Gemini: Widget description */
62
- 'gemini/widgetDescription'?: string;
63
- /** IDE: Resource URI for widget template */
64
- 'ide/outputTemplate'?: string;
65
- /** IDE: Widget description */
66
- 'ide/widgetDescription'?: string;
67
- /** MCP Apps: Resource URI for UI template */
68
- 'ui/resourceUri'?: string;
69
- /** MCP Apps: CSP configuration */
70
- 'ui/csp'?: {
71
- connectDomains?: string[];
72
- resourceDomains?: string[];
73
- };
74
- /** MCP Apps: Dedicated sandbox domain */
75
- 'ui/domain'?: string;
76
- /** MCP Apps: Whether to show border around UI */
77
- 'ui/prefersBorder'?: boolean;
78
- /** MCP Apps: Display mode */
79
- 'ui/displayMode'?: 'inline' | 'fullscreen' | 'pip';
80
- /** Allow additional platform-specific fields */
81
- [key: string]: unknown;
82
- }
83
- /**
84
- * Options for building UI metadata.
85
- */
86
- export interface BuildUIMetaOptions<In = unknown, Out = unknown> {
87
- /** Tool UI configuration */
88
- uiConfig: UITemplateConfig<In, Out>;
89
- /** Detected platform type */
90
- platformType: AIPlatformType;
91
- /** Rendered HTML content */
92
- html: string;
93
- /** Widget access token */
94
- token?: string;
95
- /** Direct URL for widget serving */
96
- directUrl?: string;
97
- /** Renderer type for the widget (html, react, mdx, markdown, auto) */
98
- rendererType?: string;
99
- /** Hash of the widget content for cache validation */
100
- contentHash?: string;
101
- /** Manifest URI for accessing widget configuration */
102
- manifestUri?: string;
103
- }
104
- /**
105
- * Build platform-specific UI metadata for tool response.
106
- *
107
- * For inline serving mode (default), HTML is embedded directly in `_meta['ui/html']`.
108
- * For static mode, the static widget URI is provided in tools/list
109
- * and the tool response contains only structured data.
110
- *
111
- * @example
112
- * ```typescript
113
- * import { buildUIMeta } from '@frontmcp/ui/adapters';
114
- *
115
- * const meta = buildUIMeta({
116
- * uiConfig: { template: (ctx) => `<div>${ctx.output.value}</div>` },
117
- * platformType: 'openai',
118
- * html: '<div>Hello World</div>',
119
- * });
120
- * ```
121
- */
122
- export declare function buildUIMeta<In = unknown, Out = unknown>(options: BuildUIMetaOptions<In, Out>): UIMetadata;
123
- /**
124
- * Build OpenAI CSP format.
125
- */
126
- export declare function buildOpenAICSP(csp: UIContentSecurityPolicy): {
127
- connect_domains?: string[];
128
- resource_domains?: string[];
129
- };
130
- /**
131
- * Build metadata for tool discovery (tools/list response).
132
- * This includes fields that should be present at discovery time,
133
- * not in individual tool call responses.
134
- *
135
- * @example
136
- * ```typescript
137
- * import { buildToolDiscoveryMeta } from '@frontmcp/ui/adapters';
138
- *
139
- * const toolMeta = buildToolDiscoveryMeta({
140
- * uiConfig: { template: MyWidget, widgetAccessible: true },
141
- * platformType: 'openai',
142
- * staticWidgetUri: 'ui://widget/my_tool.html',
143
- * });
144
- *
145
- * // Use in tools/list response
146
- * const tool = {
147
- * name: 'my_tool',
148
- * description: '...',
149
- * inputSchema: {...},
150
- * _meta: toolMeta,
151
- * };
152
- * ```
153
- */
154
- export interface BuildToolDiscoveryMetaOptions<In = unknown, Out = unknown> {
155
- /** Tool UI configuration */
156
- uiConfig: UITemplateConfig<In, Out>;
157
- /** Detected platform type */
158
- platformType: AIPlatformType;
159
- /** Static widget URI (e.g., ui://widget/my_tool.html) */
160
- staticWidgetUri: string;
161
- }
162
- /**
163
- * Build tool discovery metadata (for tools/list response).
164
- */
165
- export declare function buildToolDiscoveryMeta<In = unknown, Out = unknown>(options: BuildToolDiscoveryMetaOptions<In, Out>): UIMetadata;
166
- //# sourceMappingURL=platform-meta.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-meta.d.ts","sourceRoot":"","sources":["../../src/adapters/platform-meta.ts"],"names":[],"mappings":"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"}