@frontmcp/uipack 0.6.1

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