@frontmcp/ui 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +140 -362
  2. package/bridge/runtime/index.d.ts +2 -1
  3. package/bridge/runtime/index.d.ts.map +1 -1
  4. package/bundler/file-cache/component-builder.d.ts +1 -1
  5. package/bundler/file-cache/component-builder.d.ts.map +1 -1
  6. package/bundler/file-cache/hash-calculator.d.ts +1 -1
  7. package/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  8. package/bundler/file-cache/storage/filesystem.d.ts +1 -1
  9. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  10. package/bundler/file-cache/storage/interface.d.ts +1 -1
  11. package/bundler/file-cache/storage/interface.d.ts.map +1 -1
  12. package/bundler/file-cache/storage/redis.d.ts +1 -1
  13. package/bundler/file-cache/storage/redis.d.ts.map +1 -1
  14. package/bundler/index.js +10 -1057
  15. package/components/alert.schema.d.ts +6 -6
  16. package/components/avatar.schema.d.ts +9 -9
  17. package/components/badge.schema.d.ts +9 -9
  18. package/components/button.schema.d.ts +9 -9
  19. package/components/card.schema.d.ts +7 -7
  20. package/components/form.schema.d.ts +24 -24
  21. package/components/index.js +128 -198
  22. package/components/modal.schema.d.ts +8 -8
  23. package/components/table.schema.d.ts +6 -6
  24. package/esm/bridge/runtime/index.d.ts +2 -1
  25. package/esm/bridge/runtime/index.d.ts.map +1 -1
  26. package/esm/bundler/file-cache/component-builder.d.ts +1 -1
  27. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -1
  28. package/esm/bundler/file-cache/hash-calculator.d.ts +1 -1
  29. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  30. package/esm/bundler/file-cache/storage/filesystem.d.ts +1 -1
  31. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  32. package/esm/bundler/file-cache/storage/interface.d.ts +1 -1
  33. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -1
  34. package/esm/bundler/file-cache/storage/redis.d.ts +1 -1
  35. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -1
  36. package/esm/bundler/index.js +3 -1050
  37. package/esm/components/alert.schema.d.ts +6 -6
  38. package/esm/components/avatar.schema.d.ts +9 -9
  39. package/esm/components/badge.schema.d.ts +9 -9
  40. package/esm/components/button.schema.d.ts +9 -9
  41. package/esm/components/card.schema.d.ts +7 -7
  42. package/esm/components/form.schema.d.ts +24 -24
  43. package/esm/components/index.js +136 -196
  44. package/esm/components/modal.schema.d.ts +8 -8
  45. package/esm/components/table.schema.d.ts +6 -6
  46. package/esm/index.d.ts +23 -39
  47. package/esm/index.d.ts.map +1 -1
  48. package/esm/index.js +4256 -16441
  49. package/esm/layouts/base.d.ts +2 -2
  50. package/esm/layouts/base.d.ts.map +1 -1
  51. package/esm/layouts/index.js +33 -516
  52. package/esm/package.json +8 -26
  53. package/esm/pages/index.js +100 -627
  54. package/esm/react/Alert.d.ts +1 -2
  55. package/esm/react/Alert.d.ts.map +1 -1
  56. package/esm/react/Badge.d.ts +1 -2
  57. package/esm/react/Badge.d.ts.map +1 -1
  58. package/esm/react/Button.d.ts +1 -2
  59. package/esm/react/Button.d.ts.map +1 -1
  60. package/esm/react/Card.d.ts +1 -2
  61. package/esm/react/Card.d.ts.map +1 -1
  62. package/esm/react/hooks/context.d.ts +1 -1
  63. package/esm/react/hooks/context.d.ts.map +1 -1
  64. package/esm/react/index.d.ts +5 -6
  65. package/esm/react/index.d.ts.map +1 -1
  66. package/esm/react/index.js +2074 -322
  67. package/esm/react/types.d.ts +1 -2
  68. package/esm/react/types.d.ts.map +1 -1
  69. package/esm/renderers/index.d.ts +10 -25
  70. package/esm/renderers/index.d.ts.map +1 -1
  71. package/esm/renderers/index.js +171 -1617
  72. package/esm/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  73. package/esm/renderers/react.adapter.d.ts.map +1 -0
  74. package/esm/renderers/react.renderer.d.ts +3 -3
  75. package/esm/renderers/react.renderer.d.ts.map +1 -1
  76. package/esm/universal/index.js +1755 -0
  77. package/esm/web-components/index.js +232 -287
  78. package/esm/widgets/index.js +89 -147
  79. package/index.d.ts +23 -39
  80. package/index.d.ts.map +1 -1
  81. package/index.js +6123 -18539
  82. package/layouts/base.d.ts +2 -2
  83. package/layouts/base.d.ts.map +1 -1
  84. package/layouts/index.js +43 -536
  85. package/package.json +8 -26
  86. package/pages/index.js +111 -648
  87. package/react/Alert.d.ts +1 -2
  88. package/react/Alert.d.ts.map +1 -1
  89. package/react/Badge.d.ts +1 -2
  90. package/react/Badge.d.ts.map +1 -1
  91. package/react/Button.d.ts +1 -2
  92. package/react/Button.d.ts.map +1 -1
  93. package/react/Card.d.ts +1 -2
  94. package/react/Card.d.ts.map +1 -1
  95. package/react/hooks/context.d.ts +1 -1
  96. package/react/hooks/context.d.ts.map +1 -1
  97. package/react/index.d.ts +5 -6
  98. package/react/index.d.ts.map +1 -1
  99. package/react/index.js +2065 -335
  100. package/react/types.d.ts +1 -2
  101. package/react/types.d.ts.map +1 -1
  102. package/renderers/index.d.ts +10 -25
  103. package/renderers/index.d.ts.map +1 -1
  104. package/renderers/index.js +175 -1641
  105. package/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  106. package/renderers/react.adapter.d.ts.map +1 -0
  107. package/renderers/react.renderer.d.ts +3 -3
  108. package/renderers/react.renderer.d.ts.map +1 -1
  109. package/universal/index.js +1841 -0
  110. package/web-components/index.js +224 -289
  111. package/widgets/index.js +80 -148
  112. package/adapters/index.d.ts +0 -13
  113. package/adapters/index.d.ts.map +0 -1
  114. package/adapters/index.js +0 -462
  115. package/adapters/platform-meta.d.ts +0 -166
  116. package/adapters/platform-meta.d.ts.map +0 -1
  117. package/adapters/response-builder.d.ts +0 -108
  118. package/adapters/response-builder.d.ts.map +0 -1
  119. package/adapters/serving-mode.d.ts +0 -107
  120. package/adapters/serving-mode.d.ts.map +0 -1
  121. package/base-template/bridge.d.ts +0 -90
  122. package/base-template/bridge.d.ts.map +0 -1
  123. package/base-template/default-base-template.d.ts +0 -92
  124. package/base-template/default-base-template.d.ts.map +0 -1
  125. package/base-template/index.d.ts +0 -15
  126. package/base-template/index.d.ts.map +0 -1
  127. package/base-template/index.js +0 -1398
  128. package/base-template/polyfills.d.ts +0 -31
  129. package/base-template/polyfills.d.ts.map +0 -1
  130. package/base-template/theme-styles.d.ts +0 -74
  131. package/base-template/theme-styles.d.ts.map +0 -1
  132. package/build/cdn-resources.d.ts +0 -243
  133. package/build/cdn-resources.d.ts.map +0 -1
  134. package/build/index.d.ts +0 -295
  135. package/build/index.d.ts.map +0 -1
  136. package/build/index.js +0 -7096
  137. package/build/widget-manifest.d.ts +0 -362
  138. package/build/widget-manifest.d.ts.map +0 -1
  139. package/dependency/cdn-registry.d.ts +0 -98
  140. package/dependency/cdn-registry.d.ts.map +0 -1
  141. package/dependency/import-map.d.ts +0 -186
  142. package/dependency/import-map.d.ts.map +0 -1
  143. package/dependency/import-parser.d.ts +0 -82
  144. package/dependency/import-parser.d.ts.map +0 -1
  145. package/dependency/index.d.ts +0 -17
  146. package/dependency/index.d.ts.map +0 -1
  147. package/dependency/resolver.d.ts +0 -164
  148. package/dependency/resolver.d.ts.map +0 -1
  149. package/dependency/schemas.d.ts +0 -486
  150. package/dependency/schemas.d.ts.map +0 -1
  151. package/dependency/template-loader.d.ts +0 -204
  152. package/dependency/template-loader.d.ts.map +0 -1
  153. package/dependency/template-processor.d.ts +0 -118
  154. package/dependency/template-processor.d.ts.map +0 -1
  155. package/dependency/types.d.ts +0 -739
  156. package/dependency/types.d.ts.map +0 -1
  157. package/esm/adapters/index.d.ts +0 -13
  158. package/esm/adapters/index.d.ts.map +0 -1
  159. package/esm/adapters/index.js +0 -427
  160. package/esm/adapters/platform-meta.d.ts +0 -166
  161. package/esm/adapters/platform-meta.d.ts.map +0 -1
  162. package/esm/adapters/response-builder.d.ts +0 -108
  163. package/esm/adapters/response-builder.d.ts.map +0 -1
  164. package/esm/adapters/serving-mode.d.ts +0 -107
  165. package/esm/adapters/serving-mode.d.ts.map +0 -1
  166. package/esm/base-template/bridge.d.ts +0 -90
  167. package/esm/base-template/bridge.d.ts.map +0 -1
  168. package/esm/base-template/default-base-template.d.ts +0 -92
  169. package/esm/base-template/default-base-template.d.ts.map +0 -1
  170. package/esm/base-template/index.d.ts +0 -15
  171. package/esm/base-template/index.d.ts.map +0 -1
  172. package/esm/base-template/index.js +0 -1364
  173. package/esm/base-template/polyfills.d.ts +0 -31
  174. package/esm/base-template/polyfills.d.ts.map +0 -1
  175. package/esm/base-template/theme-styles.d.ts +0 -74
  176. package/esm/base-template/theme-styles.d.ts.map +0 -1
  177. package/esm/build/cdn-resources.d.ts +0 -243
  178. package/esm/build/cdn-resources.d.ts.map +0 -1
  179. package/esm/build/index.d.ts +0 -295
  180. package/esm/build/index.d.ts.map +0 -1
  181. package/esm/build/index.js +0 -7021
  182. package/esm/build/widget-manifest.d.ts +0 -362
  183. package/esm/build/widget-manifest.d.ts.map +0 -1
  184. package/esm/dependency/cdn-registry.d.ts +0 -98
  185. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  186. package/esm/dependency/import-map.d.ts +0 -186
  187. package/esm/dependency/import-map.d.ts.map +0 -1
  188. package/esm/dependency/import-parser.d.ts +0 -82
  189. package/esm/dependency/import-parser.d.ts.map +0 -1
  190. package/esm/dependency/index.d.ts +0 -17
  191. package/esm/dependency/index.d.ts.map +0 -1
  192. package/esm/dependency/resolver.d.ts +0 -164
  193. package/esm/dependency/resolver.d.ts.map +0 -1
  194. package/esm/dependency/schemas.d.ts +0 -486
  195. package/esm/dependency/schemas.d.ts.map +0 -1
  196. package/esm/dependency/template-loader.d.ts +0 -204
  197. package/esm/dependency/template-loader.d.ts.map +0 -1
  198. package/esm/dependency/template-processor.d.ts +0 -118
  199. package/esm/dependency/template-processor.d.ts.map +0 -1
  200. package/esm/dependency/types.d.ts +0 -739
  201. package/esm/dependency/types.d.ts.map +0 -1
  202. package/esm/handlebars/expression-extractor.d.ts +0 -147
  203. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  204. package/esm/handlebars/helpers.d.ts +0 -339
  205. package/esm/handlebars/helpers.d.ts.map +0 -1
  206. package/esm/handlebars/index.d.ts +0 -195
  207. package/esm/handlebars/index.d.ts.map +0 -1
  208. package/esm/handlebars/index.js +0 -587
  209. package/esm/registry/index.d.ts +0 -46
  210. package/esm/registry/index.d.ts.map +0 -1
  211. package/esm/registry/index.js +0 -6422
  212. package/esm/registry/render-template.d.ts +0 -91
  213. package/esm/registry/render-template.d.ts.map +0 -1
  214. package/esm/registry/tool-ui.registry.d.ts +0 -294
  215. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  216. package/esm/registry/uri-utils.d.ts +0 -56
  217. package/esm/registry/uri-utils.d.ts.map +0 -1
  218. package/esm/renderers/cache.d.ts +0 -145
  219. package/esm/renderers/cache.d.ts.map +0 -1
  220. package/esm/renderers/html.renderer.d.ts +0 -123
  221. package/esm/renderers/html.renderer.d.ts.map +0 -1
  222. package/esm/renderers/mdx.renderer.d.ts +0 -120
  223. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  224. package/esm/renderers/registry.d.ts +0 -134
  225. package/esm/renderers/registry.d.ts.map +0 -1
  226. package/esm/renderers/types.d.ts +0 -342
  227. package/esm/renderers/types.d.ts.map +0 -1
  228. package/esm/renderers/utils/detect.d.ts +0 -107
  229. package/esm/renderers/utils/detect.d.ts.map +0 -1
  230. package/esm/renderers/utils/hash.d.ts +0 -40
  231. package/esm/renderers/utils/hash.d.ts.map +0 -1
  232. package/esm/renderers/utils/index.d.ts +0 -9
  233. package/esm/renderers/utils/index.d.ts.map +0 -1
  234. package/esm/renderers/utils/transpiler.d.ts +0 -89
  235. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  236. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  237. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  238. package/esm/runtime/adapters/index.d.ts +0 -26
  239. package/esm/runtime/adapters/index.d.ts.map +0 -1
  240. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  241. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  242. package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
  243. package/esm/runtime/adapters/types.d.ts +0 -95
  244. package/esm/runtime/adapters/types.d.ts.map +0 -1
  245. package/esm/runtime/csp.d.ts +0 -48
  246. package/esm/runtime/csp.d.ts.map +0 -1
  247. package/esm/runtime/index.d.ts +0 -17
  248. package/esm/runtime/index.d.ts.map +0 -1
  249. package/esm/runtime/index.js +0 -5186
  250. package/esm/runtime/mcp-bridge.d.ts +0 -101
  251. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  252. package/esm/runtime/renderer-runtime.d.ts +0 -133
  253. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  254. package/esm/runtime/sanitizer.d.ts +0 -172
  255. package/esm/runtime/sanitizer.d.ts.map +0 -1
  256. package/esm/runtime/types.d.ts +0 -415
  257. package/esm/runtime/types.d.ts.map +0 -1
  258. package/esm/runtime/wrapper.d.ts +0 -421
  259. package/esm/runtime/wrapper.d.ts.map +0 -1
  260. package/esm/styles/index.d.ts +0 -8
  261. package/esm/styles/index.d.ts.map +0 -1
  262. package/esm/styles/index.js +0 -171
  263. package/esm/styles/variants.d.ts +0 -51
  264. package/esm/styles/variants.d.ts.map +0 -1
  265. package/esm/theme/cdn.d.ts +0 -195
  266. package/esm/theme/cdn.d.ts.map +0 -1
  267. package/esm/theme/index.d.ts +0 -18
  268. package/esm/theme/index.d.ts.map +0 -1
  269. package/esm/theme/index.js +0 -700
  270. package/esm/theme/platforms.d.ts +0 -107
  271. package/esm/theme/platforms.d.ts.map +0 -1
  272. package/esm/theme/presets/github-openai.d.ts +0 -50
  273. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  274. package/esm/theme/presets/index.d.ts +0 -11
  275. package/esm/theme/presets/index.d.ts.map +0 -1
  276. package/esm/theme/theme.d.ts +0 -396
  277. package/esm/theme/theme.d.ts.map +0 -1
  278. package/esm/tool-template/builder.d.ts +0 -213
  279. package/esm/tool-template/builder.d.ts.map +0 -1
  280. package/esm/tool-template/index.d.ts +0 -16
  281. package/esm/tool-template/index.d.ts.map +0 -1
  282. package/esm/tool-template/index.js +0 -3515
  283. package/esm/types/index.d.ts +0 -14
  284. package/esm/types/index.d.ts.map +0 -1
  285. package/esm/types/index.js +0 -75
  286. package/esm/types/ui-config.d.ts +0 -639
  287. package/esm/types/ui-config.d.ts.map +0 -1
  288. package/esm/types/ui-runtime.d.ts +0 -1007
  289. package/esm/types/ui-runtime.d.ts.map +0 -1
  290. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  291. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  292. package/esm/typings/cache/index.d.ts +0 -10
  293. package/esm/typings/cache/index.d.ts.map +0 -1
  294. package/esm/typings/cache/memory-cache.d.ts +0 -92
  295. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  296. package/esm/typings/dts-parser.d.ts +0 -90
  297. package/esm/typings/dts-parser.d.ts.map +0 -1
  298. package/esm/typings/index.d.ts +0 -48
  299. package/esm/typings/index.d.ts.map +0 -1
  300. package/esm/typings/schemas.d.ts +0 -232
  301. package/esm/typings/schemas.d.ts.map +0 -1
  302. package/esm/typings/type-fetcher.d.ts +0 -89
  303. package/esm/typings/type-fetcher.d.ts.map +0 -1
  304. package/esm/typings/types.d.ts +0 -320
  305. package/esm/typings/types.d.ts.map +0 -1
  306. package/esm/utils/escape-html.d.ts +0 -58
  307. package/esm/utils/escape-html.d.ts.map +0 -1
  308. package/esm/utils/index.d.ts +0 -10
  309. package/esm/utils/index.d.ts.map +0 -1
  310. package/esm/utils/index.js +0 -40
  311. package/esm/utils/safe-stringify.d.ts +0 -30
  312. package/esm/utils/safe-stringify.d.ts.map +0 -1
  313. package/esm/validation/error-box.d.ts +0 -56
  314. package/esm/validation/error-box.d.ts.map +0 -1
  315. package/esm/validation/index.d.ts +0 -13
  316. package/esm/validation/index.d.ts.map +0 -1
  317. package/esm/validation/index.js +0 -562
  318. package/esm/validation/schema-paths.d.ts +0 -118
  319. package/esm/validation/schema-paths.d.ts.map +0 -1
  320. package/esm/validation/template-validator.d.ts +0 -143
  321. package/esm/validation/template-validator.d.ts.map +0 -1
  322. package/esm/validation/wrapper.d.ts +0 -97
  323. package/esm/validation/wrapper.d.ts.map +0 -1
  324. package/handlebars/expression-extractor.d.ts +0 -147
  325. package/handlebars/expression-extractor.d.ts.map +0 -1
  326. package/handlebars/helpers.d.ts +0 -339
  327. package/handlebars/helpers.d.ts.map +0 -1
  328. package/handlebars/index.d.ts +0 -195
  329. package/handlebars/index.d.ts.map +0 -1
  330. package/handlebars/index.js +0 -666
  331. package/registry/index.d.ts +0 -46
  332. package/registry/index.d.ts.map +0 -1
  333. package/registry/index.js +0 -6465
  334. package/registry/render-template.d.ts +0 -91
  335. package/registry/render-template.d.ts.map +0 -1
  336. package/registry/tool-ui.registry.d.ts +0 -294
  337. package/registry/tool-ui.registry.d.ts.map +0 -1
  338. package/registry/uri-utils.d.ts +0 -56
  339. package/registry/uri-utils.d.ts.map +0 -1
  340. package/renderers/cache.d.ts +0 -145
  341. package/renderers/cache.d.ts.map +0 -1
  342. package/renderers/html.renderer.d.ts +0 -123
  343. package/renderers/html.renderer.d.ts.map +0 -1
  344. package/renderers/mdx.renderer.d.ts +0 -120
  345. package/renderers/mdx.renderer.d.ts.map +0 -1
  346. package/renderers/registry.d.ts +0 -134
  347. package/renderers/registry.d.ts.map +0 -1
  348. package/renderers/types.d.ts +0 -342
  349. package/renderers/types.d.ts.map +0 -1
  350. package/renderers/utils/detect.d.ts +0 -107
  351. package/renderers/utils/detect.d.ts.map +0 -1
  352. package/renderers/utils/hash.d.ts +0 -40
  353. package/renderers/utils/hash.d.ts.map +0 -1
  354. package/renderers/utils/index.d.ts +0 -9
  355. package/renderers/utils/index.d.ts.map +0 -1
  356. package/renderers/utils/transpiler.d.ts +0 -89
  357. package/renderers/utils/transpiler.d.ts.map +0 -1
  358. package/runtime/adapters/html.adapter.d.ts +0 -59
  359. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  360. package/runtime/adapters/index.d.ts +0 -26
  361. package/runtime/adapters/index.d.ts.map +0 -1
  362. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  363. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  364. package/runtime/adapters/react.adapter.d.ts.map +0 -1
  365. package/runtime/adapters/types.d.ts +0 -95
  366. package/runtime/adapters/types.d.ts.map +0 -1
  367. package/runtime/csp.d.ts +0 -48
  368. package/runtime/csp.d.ts.map +0 -1
  369. package/runtime/index.d.ts +0 -17
  370. package/runtime/index.d.ts.map +0 -1
  371. package/runtime/index.js +0 -5264
  372. package/runtime/mcp-bridge.d.ts +0 -101
  373. package/runtime/mcp-bridge.d.ts.map +0 -1
  374. package/runtime/renderer-runtime.d.ts +0 -133
  375. package/runtime/renderer-runtime.d.ts.map +0 -1
  376. package/runtime/sanitizer.d.ts +0 -172
  377. package/runtime/sanitizer.d.ts.map +0 -1
  378. package/runtime/types.d.ts +0 -415
  379. package/runtime/types.d.ts.map +0 -1
  380. package/runtime/wrapper.d.ts +0 -421
  381. package/runtime/wrapper.d.ts.map +0 -1
  382. package/styles/index.d.ts +0 -8
  383. package/styles/index.d.ts.map +0 -1
  384. package/styles/index.js +0 -222
  385. package/styles/variants.d.ts +0 -51
  386. package/styles/variants.d.ts.map +0 -1
  387. package/theme/cdn.d.ts +0 -195
  388. package/theme/cdn.d.ts.map +0 -1
  389. package/theme/index.d.ts +0 -18
  390. package/theme/index.d.ts.map +0 -1
  391. package/theme/index.js +0 -757
  392. package/theme/platforms.d.ts +0 -107
  393. package/theme/platforms.d.ts.map +0 -1
  394. package/theme/presets/github-openai.d.ts +0 -50
  395. package/theme/presets/github-openai.d.ts.map +0 -1
  396. package/theme/presets/index.d.ts +0 -11
  397. package/theme/presets/index.d.ts.map +0 -1
  398. package/theme/theme.d.ts +0 -396
  399. package/theme/theme.d.ts.map +0 -1
  400. package/tool-template/builder.d.ts +0 -213
  401. package/tool-template/builder.d.ts.map +0 -1
  402. package/tool-template/index.d.ts +0 -16
  403. package/tool-template/index.d.ts.map +0 -1
  404. package/tool-template/index.js +0 -3559
  405. package/types/index.d.ts +0 -14
  406. package/types/index.d.ts.map +0 -1
  407. package/types/index.js +0 -108
  408. package/types/ui-config.d.ts +0 -639
  409. package/types/ui-config.d.ts.map +0 -1
  410. package/types/ui-runtime.d.ts +0 -1007
  411. package/types/ui-runtime.d.ts.map +0 -1
  412. package/typings/cache/cache-adapter.d.ts +0 -125
  413. package/typings/cache/cache-adapter.d.ts.map +0 -1
  414. package/typings/cache/index.d.ts +0 -10
  415. package/typings/cache/index.d.ts.map +0 -1
  416. package/typings/cache/memory-cache.d.ts +0 -92
  417. package/typings/cache/memory-cache.d.ts.map +0 -1
  418. package/typings/dts-parser.d.ts +0 -90
  419. package/typings/dts-parser.d.ts.map +0 -1
  420. package/typings/index.d.ts +0 -48
  421. package/typings/index.d.ts.map +0 -1
  422. package/typings/schemas.d.ts +0 -232
  423. package/typings/schemas.d.ts.map +0 -1
  424. package/typings/type-fetcher.d.ts +0 -89
  425. package/typings/type-fetcher.d.ts.map +0 -1
  426. package/typings/types.d.ts +0 -320
  427. package/typings/types.d.ts.map +0 -1
  428. package/utils/escape-html.d.ts +0 -58
  429. package/utils/escape-html.d.ts.map +0 -1
  430. package/utils/index.d.ts +0 -10
  431. package/utils/index.d.ts.map +0 -1
  432. package/utils/index.js +0 -70
  433. package/utils/safe-stringify.d.ts +0 -30
  434. package/utils/safe-stringify.d.ts.map +0 -1
  435. package/validation/error-box.d.ts +0 -56
  436. package/validation/error-box.d.ts.map +0 -1
  437. package/validation/index.d.ts +0 -13
  438. package/validation/index.d.ts.map +0 -1
  439. package/validation/index.js +0 -603
  440. package/validation/schema-paths.d.ts +0 -118
  441. package/validation/schema-paths.d.ts.map +0 -1
  442. package/validation/template-validator.d.ts +0 -143
  443. package/validation/template-validator.d.ts.map +0 -1
  444. package/validation/wrapper.d.ts +0 -97
  445. package/validation/wrapper.d.ts.map +0 -1
@@ -1,91 +0,0 @@
1
- /**
2
- * Template Rendering
3
- *
4
- * Executes tool UI templates with proper context and helpers.
5
- * Supports sync rendering for HTML strings/template functions,
6
- * async rendering for React components via SSR, and MDX rendering.
7
- *
8
- * @packageDocumentation
9
- */
10
- import type { UITemplateConfig, TemplateBuilderFn } from '../types';
11
- /**
12
- * Check if a string contains MDX syntax (Markdown + JSX).
13
- *
14
- * Looks for:
15
- * - JSX component tags (PascalCase): `<Component />`
16
- * - JS expressions: `{variable}` or `{items.map(...)}`
17
- * - Import/export statements
18
- * - Frontmatter: `---\n...\n---`
19
- */
20
- export declare function containsMdxSyntax(source: string): boolean;
21
- /**
22
- * Check if a template is a React component (not a template builder function).
23
- *
24
- * React components are distinguished from template builder functions by:
25
- * - Having $$typeof symbol (React.memo, forwardRef, etc.)
26
- * - Having prototype.isReactComponent (class components)
27
- * - PascalCase naming convention (function components)
28
- *
29
- * Template builder functions take (ctx) and return a string, while
30
- * React components take props and return JSX.Element.
31
- */
32
- export declare function isReactComponent(template: unknown): boolean;
33
- /**
34
- * Options for rendering a tool template.
35
- */
36
- export interface RenderTemplateOptions {
37
- /** The template configuration from the tool */
38
- template: TemplateBuilderFn<unknown, unknown> | string | ((props: any) => any);
39
- /** Tool input arguments */
40
- input: Record<string, unknown>;
41
- /** Tool output (raw result from execute) */
42
- output: unknown;
43
- /** Structured content parsed from output */
44
- structuredContent?: unknown;
45
- /** Custom MDX components to use in MDX templates */
46
- mdxComponents?: Record<string, any>;
47
- }
48
- /**
49
- * Render a tool UI template.
50
- *
51
- * @param options - Template and context data
52
- * @returns Rendered HTML string
53
- * @throws Error if template execution fails
54
- */
55
- export declare function renderToolTemplate(options: RenderTemplateOptions): string;
56
- /**
57
- * Check if a tool has UI configuration.
58
- * Uses loose typing to handle variance issues with generic tool metadata.
59
- */
60
- export declare function hasUIConfig(metadata: {
61
- ui?: unknown;
62
- }): metadata is {
63
- ui: UITemplateConfig<unknown, unknown>;
64
- };
65
- /**
66
- * Render a tool UI template asynchronously.
67
- *
68
- * This version supports:
69
- * - React components via SSR
70
- * - MDX strings (Markdown + JSX) via @mdx-js/mdx
71
- * - HTML strings and template builder functions
72
- *
73
- * For React components:
74
- * - Dynamically imports react and react-dom/server
75
- * - Uses renderToString for SSR
76
- * - React components receive the template context as props
77
- *
78
- * For MDX templates:
79
- * - Detects MDX syntax (Markdown headers, JSX components, expressions)
80
- * - Compiles and renders via @frontmcp/ui's MDX renderer
81
- *
82
- * Error handling behavior by environment:
83
- * - **Production**: Logs warning and returns `null` for graceful degradation (no UI)
84
- * - **Development/Test**: Logs error and throws for visibility and debugging
85
- *
86
- * @param options - Template and context data
87
- * @returns Promise resolving to rendered HTML string, or `null` in production on error
88
- * @throws Error if template execution or rendering fails (development/test only)
89
- */
90
- export declare function renderToolTemplateAsync(options: RenderTemplateOptions): Promise<string | null>;
91
- //# sourceMappingURL=render-template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-template.d.ts","sourceRoot":"","sources":["../../../src/registry/render-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAmB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGrF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAsCzD;AAkCD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAyB3D;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAE/C,QAAQ,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;IAC/E,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oDAAoD;IAEpD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAuBzE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE;IAAE,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,QAAQ,IAAI;IAAE,EAAE,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;CAAE,CAG9G;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4FpG"}
@@ -1,294 +0,0 @@
1
- /**
2
- * Tool UI Registry
3
- *
4
- * Manages UI template rendering for tool responses.
5
- * Provides platform-specific metadata generation for MCP clients.
6
- *
7
- * Three serving modes:
8
- * - **inline**: HTML is rendered per-request and embedded in _meta['ui/html']
9
- * - **static**: Static widget is pre-compiled at startup, client fetches via resources/read
10
- * - **hybrid**: Shell (React + renderer) cached at startup, component + data in response
11
- *
12
- * @packageDocumentation
13
- */
14
- import type { UITemplateConfig, WidgetManifest, BuildManifestResult } from '../types';
15
- import type { AIPlatformType, UIMetadata } from '../adapters';
16
- /**
17
- * Options for renderAndRegisterAsync (inline mode).
18
- */
19
- export interface RenderOptions {
20
- /** Tool name */
21
- toolName: string;
22
- /** Unique request identifier */
23
- requestId: string;
24
- /** Tool input arguments */
25
- input: Record<string, unknown>;
26
- /** Raw tool output */
27
- output: unknown;
28
- /** Structured content (parsed from output) */
29
- structuredContent?: unknown;
30
- /** Tool UI configuration */
31
- uiConfig: UITemplateConfig;
32
- /** Detected platform type */
33
- platformType: AIPlatformType;
34
- /** Widget access token (optional) */
35
- token?: string;
36
- /** Direct URL for widget serving (optional) */
37
- directUrl?: string;
38
- }
39
- /**
40
- * Result of rendering UI for inline mode.
41
- */
42
- export interface UIRenderResult {
43
- /** Rendered HTML content */
44
- html: string;
45
- /** Platform-specific metadata for _meta field */
46
- meta: UIMetadata;
47
- }
48
- /**
49
- * Result when UI rendering fails in production (graceful degradation).
50
- * The caller should proceed without UI metadata.
51
- */
52
- export interface UIRenderFailure {
53
- /** Indicates rendering failed */
54
- success: false;
55
- /** Reason for failure (for logging, not exposed to client) */
56
- reason: string;
57
- }
58
- /**
59
- * Type guard to check if a render result is a failure.
60
- *
61
- * @param result - The result to check
62
- * @returns true if the result is a UIRenderFailure
63
- *
64
- * @example
65
- * ```typescript
66
- * const result = await registry.renderAndRegisterAsync(options);
67
- * if (isUIRenderFailure(result)) {
68
- * // Handle graceful degradation - proceed without UI
69
- * console.log('UI rendering failed:', result.reason);
70
- * return;
71
- * }
72
- * // result is UIRenderResult, has html and meta
73
- * const { html, meta } = result;
74
- * ```
75
- */
76
- export declare function isUIRenderFailure(result: UIRenderResult | UIRenderFailure): result is UIRenderFailure;
77
- /**
78
- * ToolUIRegistry manages UI template rendering for tool responses.
79
- *
80
- * It provides:
81
- * - Static widget compilation for static mode (pre-compiled at startup)
82
- * - Per-request HTML rendering for inline mode (embedded in _meta)
83
- * - Platform-specific _meta generation
84
- * - Widget manifest management
85
- *
86
- * @example
87
- * ```typescript
88
- * const registry = new ToolUIRegistry();
89
- *
90
- * // For inline mode: render HTML per-request
91
- * const result = await registry.renderAndRegisterAsync({
92
- * toolName: 'get_weather',
93
- * requestId: 'abc123',
94
- * input: { location: 'London' },
95
- * output: { temp: 72, conditions: 'Sunny' },
96
- * uiConfig: tool.metadata.ui,
97
- * platformType: 'openai',
98
- * });
99
- *
100
- * // result.meta can be spread into tool result _meta
101
- * return { content: [...], _meta: { ...result.meta } };
102
- * ```
103
- */
104
- /**
105
- * Options for compiling a static widget.
106
- */
107
- export interface CompileStaticWidgetOptions {
108
- /** Tool name (used for cache key and URI) */
109
- toolName: string;
110
- /** The template to compile (React component, HTML string, or builder function) */
111
- template: UITemplateConfig['template'];
112
- /** Tool UI configuration */
113
- uiConfig: UITemplateConfig;
114
- }
115
- /**
116
- * Payload for hybrid mode component delivery.
117
- * Sent in `_meta['ui/component']` at tool call time.
118
- */
119
- export interface HybridComponentPayload {
120
- /** Transpiled component JavaScript code (ES module format) */
121
- code: string;
122
- /** Renderer type for the component */
123
- type: 'react' | 'mdx' | 'html';
124
- /** Tool name for identification */
125
- toolName: string;
126
- /** Content hash for cache validation */
127
- hash: string;
128
- }
129
- /**
130
- * Options for building a hybrid component payload.
131
- */
132
- export interface BuildHybridComponentPayloadOptions {
133
- /** Tool name */
134
- toolName: string;
135
- /** The template to transpile */
136
- template: UITemplateConfig['template'];
137
- /** Tool UI configuration */
138
- uiConfig: UITemplateConfig;
139
- }
140
- export declare class ToolUIRegistry {
141
- /**
142
- * Cache for static widgets (keyed by tool name).
143
- * Static widgets are pre-compiled at server startup for tools with servingMode: 'static'.
144
- * These widgets read data from the FrontMCP Bridge at runtime (window.openai.toolOutput).
145
- */
146
- private readonly staticWidgetCache;
147
- /**
148
- * Cache for widget manifests (keyed by tool name).
149
- * Manifests describe the widget's renderer type, CSP, and other metadata.
150
- */
151
- private readonly manifestCache;
152
- /**
153
- * Cache for build results (keyed by tool name).
154
- * Includes HTML, manifest, and hash for cache validation.
155
- */
156
- private readonly buildResultCache;
157
- /**
158
- * Compile a static widget template for a tool at server startup.
159
- *
160
- * For tools with `servingMode: 'static'`, the widget HTML is pre-compiled
161
- * WITHOUT embedded data. The widget reads data from the FrontMCP Bridge at runtime
162
- * (via window.openai.toolOutput or window.__frontmcp.toolOutput).
163
- *
164
- * This is called during tool registration, not during tool calls.
165
- *
166
- * @param options - Static widget compilation options
167
- */
168
- compileStaticWidgetAsync(options: CompileStaticWidgetOptions): Promise<void>;
169
- /**
170
- * Compile a lean widget shell for inline mode tools at server startup.
171
- *
172
- * For tools with `servingMode: 'inline'`, we create a minimal HTML shell that:
173
- * - Contains only HTML structure, theme CSS, and fonts
174
- * - NO React runtime, NO component code, NO bridge
175
- * - OpenAI caches this at discovery time
176
- * - The actual React widget comes in each tool response with embedded data
177
- *
178
- * @param options - Options for lean widget compilation
179
- */
180
- compileLeanWidgetAsync(options: {
181
- toolName: string;
182
- uiConfig: UITemplateConfig;
183
- }): void;
184
- /**
185
- * Compile a hybrid widget shell at server startup.
186
- *
187
- * For tools with `servingMode: 'hybrid'`, we create a shell that:
188
- * - Contains React 19 runtime from esm.sh CDN
189
- * - Contains FrontMCP Bridge (universal)
190
- * - Contains all FrontMCP hooks (useMcpBridgeContext, useToolOutput, etc.)
191
- * - Contains all FrontMCP UI components (Card, Badge, Button)
192
- * - Contains dynamic renderer script that imports components via blob URL
193
- * - NO component code (comes at tool call time via `_meta['ui/component']`)
194
- *
195
- * The shell listens for `ui/component` in tool response metadata and dynamically
196
- * imports the transpiled component code, then renders it with tool output data.
197
- *
198
- * @param options - Options for hybrid widget compilation
199
- */
200
- compileHybridWidgetAsync(options: {
201
- toolName: string;
202
- uiConfig: UITemplateConfig;
203
- }): void;
204
- /**
205
- * Build a component payload for hybrid mode tool responses.
206
- *
207
- * For tools with `servingMode: 'hybrid'`, this method is called at tool call time
208
- * to build the transpiled component code that gets delivered in `_meta['ui/component']`.
209
- *
210
- * The component code is in ES module format so it can be dynamically imported
211
- * via blob URL in the hybrid shell's renderer.
212
- *
213
- * @param options - Options for building the component payload
214
- * @returns The hybrid component payload, or undefined if template is not a function
215
- */
216
- buildHybridComponentPayload(options: BuildHybridComponentPayloadOptions): HybridComponentPayload | undefined;
217
- /**
218
- * Get the pre-compiled static widget HTML for a tool.
219
- *
220
- * @param toolName - The tool name to look up
221
- * @returns Pre-compiled widget HTML, or undefined if not cached
222
- */
223
- getStaticWidget(toolName: string): string | undefined;
224
- /**
225
- * Check if a tool has a pre-compiled static widget.
226
- *
227
- * @param toolName - The tool name to check
228
- * @returns true if the tool has a cached static widget
229
- */
230
- hasStaticWidget(toolName: string): boolean;
231
- /**
232
- * Get the widget manifest for a tool.
233
- *
234
- * @param toolName - The tool name to look up
235
- * @returns Widget manifest, or undefined if not cached
236
- */
237
- getManifest(toolName: string): WidgetManifest | undefined;
238
- /**
239
- * Check if a tool has a cached manifest.
240
- *
241
- * @param toolName - The tool name to check
242
- * @returns true if the tool has a cached manifest
243
- */
244
- hasManifest(toolName: string): boolean;
245
- /**
246
- * Get the full build result for a tool.
247
- *
248
- * @param toolName - The tool name to look up
249
- * @returns Build result, or undefined if not cached
250
- */
251
- getBuildResult(toolName: string): BuildManifestResult | undefined;
252
- /**
253
- * Detect the UI type for a template.
254
- *
255
- * @param template - The template to analyze
256
- * @returns Detected UI type
257
- */
258
- detectUIType(template: UITemplateConfig['template']): string;
259
- /**
260
- * Render a tool's UI template for inline mode.
261
- *
262
- * This version supports all template types including React components.
263
- * The rendered HTML is embedded directly in _meta['ui/html'] for the client.
264
- *
265
- * For React/MDX components, the output is wrapped using wrapStaticWidgetUniversal
266
- * which includes the React 19 CDN, client-side rendering script, and all the
267
- * FrontMCP hooks/components. This provides the same rendering capability as
268
- * static mode, but with data embedded in each response.
269
- *
270
- * Error handling:
271
- * - **Production**: Returns `UIRenderFailure` on error (graceful degradation)
272
- * - **Development/Test**: Throws error for visibility and debugging
273
- *
274
- * @param options - Rendering options
275
- * @returns Promise resolving to render result with HTML and metadata, or failure on error
276
- */
277
- renderAndRegisterAsync(options: RenderOptions): Promise<UIRenderResult | UIRenderFailure>;
278
- /**
279
- * Build component code string for embedding in widget HTML.
280
- *
281
- * @param template - The React component
282
- * @param toolName - Tool name for naming the component
283
- * @returns JavaScript code string that defines and registers the component
284
- */
285
- private buildComponentCode;
286
- /**
287
- * Check if a template requires async rendering (e.g., React components).
288
- *
289
- * @param template - The template to check
290
- * @returns true if the template requires async rendering
291
- */
292
- requiresAsyncRendering(template: UITemplateConfig['template']): boolean;
293
- }
294
- //# sourceMappingURL=tool-ui.registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-ui.registry.d.ts","sourceRoot":"","sources":["../../../src/registry/tool-ui.registry.ts"],"names":[],"mappings":"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"}
@@ -1,56 +0,0 @@
1
- /**
2
- * UI Resource URI Utilities
3
- *
4
- * Standalone utilities for parsing and building ui:// resource URIs.
5
- * Used for static widget serving mode where widgets are pre-compiled
6
- * at startup and fetched via resources/read.
7
- *
8
- * @packageDocumentation
9
- */
10
- import type { AIPlatformType } from '../adapters';
11
- /**
12
- * UI resource URI scheme
13
- */
14
- export declare const UI_RESOURCE_SCHEME = "ui://";
15
- /**
16
- * Parsed static widget URI
17
- */
18
- export interface ParsedWidgetUri {
19
- toolName: string;
20
- fullUri: string;
21
- }
22
- /**
23
- * Check if a URI is a UI resource URI
24
- *
25
- * @param uri - URI to check
26
- * @returns True if the URI starts with ui://
27
- */
28
- export declare function isUIResourceUri(uri: string): boolean;
29
- /**
30
- * Parse a static widget URI into its components
31
- *
32
- * @param uri - URI to parse (format: ui://widget/{toolName}.html)
33
- * @returns Parsed components or undefined if invalid
34
- */
35
- export declare function parseWidgetUri(uri: string): ParsedWidgetUri | undefined;
36
- /**
37
- * Check if URI is a static widget URI (ui://widget/{toolName}.html)
38
- */
39
- export declare function isStaticWidgetUri(uri: string): boolean;
40
- /**
41
- * Build a static widget URI from tool name
42
- *
43
- * @param toolName - Name of the tool
44
- * @returns Static widget URI (ui://widget/{toolName}.html)
45
- */
46
- export declare function buildStaticWidgetUri(toolName: string): string;
47
- /**
48
- * Get the MIME type for UI resources based on platform.
49
- *
50
- * Per user requirement: OpenAI or default uses 'text/html+skybridge'
51
- *
52
- * @param platformType - The detected platform type
53
- * @returns The appropriate MIME type
54
- */
55
- export declare function getUIResourceMimeType(platformType?: AIPlatformType): string;
56
- //# sourceMappingURL=uri-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uri-utils.d.ts","sourceRoot":"","sources":["../../../src/registry/uri-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAQ1C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAUvE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,CAAC,EAAE,cAAc,GAAG,MAAM,CAqB3E"}
@@ -1,145 +0,0 @@
1
- /**
2
- * LRU Cache for Renderer Transpilation Results
3
- *
4
- * Provides fast, memory-bounded caching for transpiled templates.
5
- * Uses content-addressable keys (hash of source) for deduplication.
6
- */
7
- import type { TranspileResult } from './types';
8
- /**
9
- * Options for the transpile cache.
10
- */
11
- export interface TranspileCacheOptions {
12
- /** Maximum number of entries (default: 500) */
13
- maxSize?: number;
14
- /** TTL in milliseconds, 0 = infinite (default: 0 for transpile cache) */
15
- ttl?: number;
16
- }
17
- /**
18
- * LRU Cache for transpiled template results.
19
- *
20
- * Features:
21
- * - Content-addressable keys via hash
22
- * - LRU eviction when max size reached
23
- * - Optional TTL for time-based expiration
24
- * - Access statistics
25
- *
26
- * @example
27
- * ```typescript
28
- * const cache = new TranspileCache({ maxSize: 500 });
29
- *
30
- * // Store a transpiled result
31
- * const hash = cache.set(sourceCode, transpileResult);
32
- *
33
- * // Retrieve it later
34
- * const result = cache.get(sourceCode);
35
- * if (result) {
36
- * console.log('Cache hit!', result.code);
37
- * }
38
- * ```
39
- */
40
- export declare class TranspileCache {
41
- private cache;
42
- private readonly maxSize;
43
- private readonly ttl;
44
- /** Cache statistics */
45
- private stats;
46
- constructor(options?: TranspileCacheOptions);
47
- /**
48
- * Get a cached transpile result by source content.
49
- *
50
- * @param source - Source code to look up
51
- * @returns Cached result or undefined if not found/expired
52
- */
53
- get(source: string): TranspileResult | undefined;
54
- /**
55
- * Get a cached transpile result by hash key.
56
- *
57
- * @param key - Hash key
58
- * @returns Cached result or undefined if not found/expired
59
- */
60
- getByKey(key: string): TranspileResult | undefined;
61
- /**
62
- * Store a transpile result.
63
- *
64
- * @param source - Source code (used to generate key)
65
- * @param value - Transpile result to cache
66
- * @returns The hash key used for storage
67
- */
68
- set(source: string, value: TranspileResult): string;
69
- /**
70
- * Store a transpile result by hash key.
71
- *
72
- * @param key - Hash key
73
- * @param value - Transpile result to cache
74
- */
75
- setByKey(key: string, value: TranspileResult): void;
76
- /**
77
- * Check if a source is cached.
78
- *
79
- * @param source - Source code to check
80
- * @returns True if cached and not expired
81
- */
82
- has(source: string): boolean;
83
- /**
84
- * Check if a key is cached.
85
- *
86
- * @param key - Hash key to check
87
- * @returns True if cached and not expired
88
- */
89
- hasByKey(key: string): boolean;
90
- /**
91
- * Delete a cached entry by source.
92
- *
93
- * @param source - Source code to delete
94
- * @returns True if entry was deleted
95
- */
96
- delete(source: string): boolean;
97
- /**
98
- * Clear all cached entries.
99
- */
100
- clear(): void;
101
- /**
102
- * Get current cache size.
103
- */
104
- get size(): number;
105
- /**
106
- * Get cache statistics.
107
- */
108
- getStats(): {
109
- hits: number;
110
- misses: number;
111
- evictions: number;
112
- size: number;
113
- hitRate: number;
114
- };
115
- }
116
- /**
117
- * Global transpile cache instance.
118
- * Shared across all renderers for deduplication.
119
- */
120
- export declare const transpileCache: TranspileCache;
121
- /**
122
- * Render cache for full HTML output.
123
- * Uses shorter TTL since outputs depend on input/output data.
124
- */
125
- export declare const renderCache: TranspileCache;
126
- /**
127
- * Simple LRU cache for storing any type of values.
128
- * Used for caching compiled components (React/MDX).
129
- */
130
- export declare class ComponentCache<T = unknown> {
131
- private cache;
132
- private readonly maxSize;
133
- constructor(maxSize?: number);
134
- get(key: string): T | undefined;
135
- set(key: string, value: T): void;
136
- has(key: string): boolean;
137
- delete(key: string): boolean;
138
- clear(): void;
139
- get size(): number;
140
- }
141
- /**
142
- * Global component cache for storing compiled React/MDX components.
143
- */
144
- export declare const componentCache: ComponentCache<unknown>;
145
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/renderers/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAc/C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAkD;IAC/D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAE7B,uBAAuB;IACvB,OAAO,CAAC,KAAK,CAIX;gBAEU,OAAO,GAAE,qBAA0B;IAK/C;;;;;OAKG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKhD;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAwBlD;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,MAAM;IAMnD;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI;IAkBnD;;;;;OAKG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAK5B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAa9B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAK/B;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,QAAQ,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAQ/F;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,gBAAuC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,WAAW,gBAGtB,CAAC;AAEH;;;GAGG;AACH,qBAAa,cAAc,CAAC,CAAC,GAAG,OAAO;IACrC,OAAO,CAAC,KAAK,CAAsD;IACnE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,SAAM;IAIzB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAU/B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAYhC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,yBAAuB,CAAC"}