@frontmcp/ui 0.5.1 → 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 (805) hide show
  1. package/README.md +140 -362
  2. package/bridge/adapters/base-adapter.d.ts +104 -0
  3. package/bridge/adapters/base-adapter.d.ts.map +1 -0
  4. package/bridge/adapters/claude.adapter.d.ts +67 -0
  5. package/bridge/adapters/claude.adapter.d.ts.map +1 -0
  6. package/bridge/adapters/ext-apps.adapter.d.ts +143 -0
  7. package/bridge/adapters/ext-apps.adapter.d.ts.map +1 -0
  8. package/bridge/adapters/gemini.adapter.d.ts +64 -0
  9. package/bridge/adapters/gemini.adapter.d.ts.map +1 -0
  10. package/bridge/adapters/generic.adapter.d.ts +56 -0
  11. package/bridge/adapters/generic.adapter.d.ts.map +1 -0
  12. package/bridge/adapters/index.d.ts +26 -0
  13. package/bridge/adapters/index.d.ts.map +1 -0
  14. package/bridge/adapters/openai.adapter.d.ts +65 -0
  15. package/bridge/adapters/openai.adapter.d.ts.map +1 -0
  16. package/bridge/core/adapter-registry.d.ts +122 -0
  17. package/bridge/core/adapter-registry.d.ts.map +1 -0
  18. package/bridge/core/bridge-factory.d.ts +199 -0
  19. package/bridge/core/bridge-factory.d.ts.map +1 -0
  20. package/bridge/core/index.d.ts +10 -0
  21. package/bridge/core/index.d.ts.map +1 -0
  22. package/bridge/index.d.ts +62 -0
  23. package/bridge/index.d.ts.map +1 -0
  24. package/bridge/index.js +2540 -0
  25. package/bridge/runtime/iife-generator.d.ts +62 -0
  26. package/bridge/runtime/iife-generator.d.ts.map +1 -0
  27. package/bridge/runtime/index.d.ts +10 -0
  28. package/bridge/runtime/index.d.ts.map +1 -0
  29. package/bridge/types.d.ts +386 -0
  30. package/bridge/types.d.ts.map +1 -0
  31. package/bundler/bundler.d.ts +208 -0
  32. package/bundler/bundler.d.ts.map +1 -0
  33. package/bundler/cache.d.ts +173 -0
  34. package/bundler/cache.d.ts.map +1 -0
  35. package/bundler/file-cache/component-builder.d.ts +167 -0
  36. package/bundler/file-cache/component-builder.d.ts.map +1 -0
  37. package/bundler/file-cache/hash-calculator.d.ts +155 -0
  38. package/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  39. package/bundler/file-cache/index.d.ts +12 -0
  40. package/bundler/file-cache/index.d.ts.map +1 -0
  41. package/bundler/file-cache/storage/filesystem.d.ts +149 -0
  42. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  43. package/bundler/file-cache/storage/index.d.ts +11 -0
  44. package/bundler/file-cache/storage/index.d.ts.map +1 -0
  45. package/bundler/file-cache/storage/interface.d.ts +152 -0
  46. package/bundler/file-cache/storage/interface.d.ts.map +1 -0
  47. package/bundler/file-cache/storage/redis.d.ts +139 -0
  48. package/bundler/file-cache/storage/redis.d.ts.map +1 -0
  49. package/bundler/index.d.ts +43 -0
  50. package/bundler/index.d.ts.map +1 -0
  51. package/bundler/index.js +3707 -0
  52. package/bundler/sandbox/enclave-adapter.d.ts +121 -0
  53. package/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  54. package/bundler/sandbox/executor.d.ts +14 -0
  55. package/bundler/sandbox/executor.d.ts.map +1 -0
  56. package/bundler/sandbox/policy.d.ts +62 -0
  57. package/bundler/sandbox/policy.d.ts.map +1 -0
  58. package/bundler/types.d.ts +702 -0
  59. package/bundler/types.d.ts.map +1 -0
  60. package/components/alert.d.ts +66 -0
  61. package/components/alert.d.ts.map +1 -0
  62. package/components/alert.schema.d.ts +98 -0
  63. package/components/alert.schema.d.ts.map +1 -0
  64. package/components/avatar.d.ts +77 -0
  65. package/components/avatar.d.ts.map +1 -0
  66. package/components/avatar.schema.d.ts +170 -0
  67. package/components/avatar.schema.d.ts.map +1 -0
  68. package/components/badge.d.ts +64 -0
  69. package/components/badge.d.ts.map +1 -0
  70. package/components/badge.schema.d.ts +91 -0
  71. package/components/badge.schema.d.ts.map +1 -0
  72. package/components/button.d.ts +100 -0
  73. package/components/button.d.ts.map +1 -0
  74. package/components/button.schema.d.ts +120 -0
  75. package/components/button.schema.d.ts.map +1 -0
  76. package/components/card.d.ts +53 -0
  77. package/components/card.d.ts.map +1 -0
  78. package/components/card.schema.d.ts +93 -0
  79. package/components/card.schema.d.ts.map +1 -0
  80. package/components/form.d.ts +212 -0
  81. package/components/form.d.ts.map +1 -0
  82. package/components/form.schema.d.ts +365 -0
  83. package/components/form.schema.d.ts.map +1 -0
  84. package/components/index.d.ts +29 -0
  85. package/components/index.d.ts.map +1 -0
  86. package/components/index.js +2525 -0
  87. package/components/list.d.ts +121 -0
  88. package/components/list.d.ts.map +1 -0
  89. package/components/list.schema.d.ts +129 -0
  90. package/components/list.schema.d.ts.map +1 -0
  91. package/components/modal.d.ts +100 -0
  92. package/components/modal.d.ts.map +1 -0
  93. package/components/modal.schema.d.ts +151 -0
  94. package/components/modal.schema.d.ts.map +1 -0
  95. package/components/table.d.ts +91 -0
  96. package/components/table.d.ts.map +1 -0
  97. package/components/table.schema.d.ts +123 -0
  98. package/components/table.schema.d.ts.map +1 -0
  99. package/esm/bridge/adapters/base-adapter.d.ts +104 -0
  100. package/esm/bridge/adapters/base-adapter.d.ts.map +1 -0
  101. package/esm/bridge/adapters/claude.adapter.d.ts +67 -0
  102. package/esm/bridge/adapters/claude.adapter.d.ts.map +1 -0
  103. package/esm/bridge/adapters/ext-apps.adapter.d.ts +143 -0
  104. package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +1 -0
  105. package/esm/bridge/adapters/gemini.adapter.d.ts +64 -0
  106. package/esm/bridge/adapters/gemini.adapter.d.ts.map +1 -0
  107. package/esm/bridge/adapters/generic.adapter.d.ts +56 -0
  108. package/esm/bridge/adapters/generic.adapter.d.ts.map +1 -0
  109. package/esm/bridge/adapters/index.d.ts +26 -0
  110. package/esm/bridge/adapters/index.d.ts.map +1 -0
  111. package/esm/bridge/adapters/openai.adapter.d.ts +65 -0
  112. package/esm/bridge/adapters/openai.adapter.d.ts.map +1 -0
  113. package/esm/bridge/core/adapter-registry.d.ts +122 -0
  114. package/esm/bridge/core/adapter-registry.d.ts.map +1 -0
  115. package/esm/bridge/core/bridge-factory.d.ts +199 -0
  116. package/esm/bridge/core/bridge-factory.d.ts.map +1 -0
  117. package/esm/bridge/core/index.d.ts +10 -0
  118. package/esm/bridge/core/index.d.ts.map +1 -0
  119. package/esm/bridge/index.d.ts +62 -0
  120. package/esm/bridge/index.d.ts.map +1 -0
  121. package/esm/bridge/index.js +2487 -0
  122. package/esm/bridge/runtime/iife-generator.d.ts +62 -0
  123. package/esm/bridge/runtime/iife-generator.d.ts.map +1 -0
  124. package/esm/bridge/runtime/index.d.ts +10 -0
  125. package/esm/bridge/runtime/index.d.ts.map +1 -0
  126. package/esm/bridge/types.d.ts +386 -0
  127. package/esm/bridge/types.d.ts.map +1 -0
  128. package/esm/bundler/bundler.d.ts +208 -0
  129. package/esm/bundler/bundler.d.ts.map +1 -0
  130. package/esm/bundler/cache.d.ts +173 -0
  131. package/esm/bundler/cache.d.ts.map +1 -0
  132. package/esm/bundler/file-cache/component-builder.d.ts +167 -0
  133. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -0
  134. package/esm/bundler/file-cache/hash-calculator.d.ts +155 -0
  135. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  136. package/esm/bundler/file-cache/index.d.ts +12 -0
  137. package/esm/bundler/file-cache/index.d.ts.map +1 -0
  138. package/esm/bundler/file-cache/storage/filesystem.d.ts +149 -0
  139. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  140. package/esm/bundler/file-cache/storage/index.d.ts +11 -0
  141. package/esm/bundler/file-cache/storage/index.d.ts.map +1 -0
  142. package/esm/bundler/file-cache/storage/interface.d.ts +152 -0
  143. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -0
  144. package/esm/bundler/file-cache/storage/redis.d.ts +139 -0
  145. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -0
  146. package/esm/bundler/index.d.ts +43 -0
  147. package/esm/bundler/index.d.ts.map +1 -0
  148. package/esm/bundler/index.js +3640 -0
  149. package/esm/bundler/sandbox/enclave-adapter.d.ts +121 -0
  150. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  151. package/esm/bundler/sandbox/executor.d.ts +14 -0
  152. package/esm/bundler/sandbox/executor.d.ts.map +1 -0
  153. package/esm/bundler/sandbox/policy.d.ts +62 -0
  154. package/esm/bundler/sandbox/policy.d.ts.map +1 -0
  155. package/esm/bundler/types.d.ts +702 -0
  156. package/esm/bundler/types.d.ts.map +1 -0
  157. package/esm/components/alert.d.ts +66 -0
  158. package/esm/components/alert.d.ts.map +1 -0
  159. package/esm/components/alert.schema.d.ts +98 -0
  160. package/esm/components/alert.schema.d.ts.map +1 -0
  161. package/esm/components/avatar.d.ts +77 -0
  162. package/esm/components/avatar.d.ts.map +1 -0
  163. package/esm/components/avatar.schema.d.ts +170 -0
  164. package/esm/components/avatar.schema.d.ts.map +1 -0
  165. package/esm/components/badge.d.ts +64 -0
  166. package/esm/components/badge.d.ts.map +1 -0
  167. package/esm/components/badge.schema.d.ts +91 -0
  168. package/esm/components/badge.schema.d.ts.map +1 -0
  169. package/esm/components/button.d.ts +100 -0
  170. package/esm/components/button.d.ts.map +1 -0
  171. package/esm/components/button.schema.d.ts +120 -0
  172. package/esm/components/button.schema.d.ts.map +1 -0
  173. package/esm/components/card.d.ts +53 -0
  174. package/esm/components/card.d.ts.map +1 -0
  175. package/esm/components/card.schema.d.ts +93 -0
  176. package/esm/components/card.schema.d.ts.map +1 -0
  177. package/esm/components/form.d.ts +212 -0
  178. package/esm/components/form.d.ts.map +1 -0
  179. package/esm/components/form.schema.d.ts +365 -0
  180. package/esm/components/form.schema.d.ts.map +1 -0
  181. package/esm/components/index.d.ts +29 -0
  182. package/esm/components/index.d.ts.map +1 -0
  183. package/esm/components/index.js +2396 -0
  184. package/esm/components/list.d.ts +121 -0
  185. package/esm/components/list.d.ts.map +1 -0
  186. package/esm/components/list.schema.d.ts +129 -0
  187. package/esm/components/list.schema.d.ts.map +1 -0
  188. package/esm/components/modal.d.ts +100 -0
  189. package/esm/components/modal.d.ts.map +1 -0
  190. package/esm/components/modal.schema.d.ts +151 -0
  191. package/esm/components/modal.schema.d.ts.map +1 -0
  192. package/esm/components/table.d.ts +91 -0
  193. package/esm/components/table.d.ts.map +1 -0
  194. package/esm/components/table.schema.d.ts +123 -0
  195. package/esm/components/table.schema.d.ts.map +1 -0
  196. package/esm/index.d.ts +40 -0
  197. package/esm/index.d.ts.map +1 -0
  198. package/esm/index.js +8326 -0
  199. package/esm/layouts/base.d.ts +86 -0
  200. package/esm/layouts/base.d.ts.map +1 -0
  201. package/esm/layouts/index.d.ts +8 -0
  202. package/esm/layouts/index.d.ts.map +1 -0
  203. package/esm/layouts/index.js +409 -0
  204. package/esm/layouts/presets.d.ts +134 -0
  205. package/esm/layouts/presets.d.ts.map +1 -0
  206. package/esm/package.json +72 -0
  207. package/esm/pages/consent.d.ts +117 -0
  208. package/esm/pages/consent.d.ts.map +1 -0
  209. package/esm/pages/error.d.ts +101 -0
  210. package/esm/pages/error.d.ts.map +1 -0
  211. package/esm/pages/index.d.ts +9 -0
  212. package/esm/pages/index.d.ts.map +1 -0
  213. package/esm/pages/index.js +1036 -0
  214. package/esm/react/Alert.d.ts +101 -0
  215. package/esm/react/Alert.d.ts.map +1 -0
  216. package/esm/react/Badge.d.ts +100 -0
  217. package/esm/react/Badge.d.ts.map +1 -0
  218. package/esm/react/Button.d.ts +108 -0
  219. package/esm/react/Button.d.ts.map +1 -0
  220. package/esm/react/Card.d.ts +103 -0
  221. package/esm/react/Card.d.ts.map +1 -0
  222. package/esm/react/hooks/context.d.ts +179 -0
  223. package/esm/react/hooks/context.d.ts.map +1 -0
  224. package/esm/react/hooks/index.d.ts +42 -0
  225. package/esm/react/hooks/index.d.ts.map +1 -0
  226. package/esm/react/hooks/tools.d.ts +284 -0
  227. package/esm/react/hooks/tools.d.ts.map +1 -0
  228. package/esm/react/index.d.ts +80 -0
  229. package/esm/react/index.d.ts.map +1 -0
  230. package/esm/react/index.js +3124 -0
  231. package/esm/react/types.d.ts +105 -0
  232. package/esm/react/types.d.ts.map +1 -0
  233. package/esm/react/utils.d.ts +43 -0
  234. package/esm/react/utils.d.ts.map +1 -0
  235. package/esm/render/index.d.ts +8 -0
  236. package/esm/render/index.d.ts.map +1 -0
  237. package/esm/render/index.js +45 -0
  238. package/esm/render/prerender.d.ts +57 -0
  239. package/esm/render/prerender.d.ts.map +1 -0
  240. package/esm/renderers/index.d.ts +21 -0
  241. package/esm/renderers/index.d.ts.map +1 -0
  242. package/esm/renderers/index.js +381 -0
  243. package/esm/renderers/react.adapter.d.ts +70 -0
  244. package/esm/renderers/react.adapter.d.ts.map +1 -0
  245. package/esm/renderers/react.renderer.d.ts +96 -0
  246. package/esm/renderers/react.renderer.d.ts.map +1 -0
  247. package/esm/universal/UniversalApp.d.ts +108 -0
  248. package/esm/universal/UniversalApp.d.ts.map +1 -0
  249. package/esm/universal/cached-runtime.d.ts +115 -0
  250. package/esm/universal/cached-runtime.d.ts.map +1 -0
  251. package/esm/universal/context.d.ts +122 -0
  252. package/esm/universal/context.d.ts.map +1 -0
  253. package/esm/universal/index.d.ts +57 -0
  254. package/esm/universal/index.d.ts.map +1 -0
  255. package/esm/universal/index.js +1755 -0
  256. package/esm/universal/renderers/html.renderer.d.ts +37 -0
  257. package/esm/universal/renderers/html.renderer.d.ts.map +1 -0
  258. package/esm/universal/renderers/index.d.ts +112 -0
  259. package/esm/universal/renderers/index.d.ts.map +1 -0
  260. package/esm/universal/renderers/markdown.renderer.d.ts +33 -0
  261. package/esm/universal/renderers/markdown.renderer.d.ts.map +1 -0
  262. package/esm/universal/renderers/mdx.renderer.d.ts +38 -0
  263. package/esm/universal/renderers/mdx.renderer.d.ts.map +1 -0
  264. package/esm/universal/renderers/react.renderer.d.ts +46 -0
  265. package/esm/universal/renderers/react.renderer.d.ts.map +1 -0
  266. package/esm/universal/runtime-builder.d.ts +33 -0
  267. package/esm/universal/runtime-builder.d.ts.map +1 -0
  268. package/esm/universal/store.d.ts +135 -0
  269. package/esm/universal/store.d.ts.map +1 -0
  270. package/esm/universal/types.d.ts +199 -0
  271. package/esm/universal/types.d.ts.map +1 -0
  272. package/esm/web-components/core/attribute-parser.d.ts +82 -0
  273. package/esm/web-components/core/attribute-parser.d.ts.map +1 -0
  274. package/esm/web-components/core/base-element.d.ts +197 -0
  275. package/esm/web-components/core/base-element.d.ts.map +1 -0
  276. package/esm/web-components/core/index.d.ts +9 -0
  277. package/esm/web-components/core/index.d.ts.map +1 -0
  278. package/esm/web-components/elements/fmcp-alert.d.ts +46 -0
  279. package/esm/web-components/elements/fmcp-alert.d.ts.map +1 -0
  280. package/esm/web-components/elements/fmcp-badge.d.ts +47 -0
  281. package/esm/web-components/elements/fmcp-badge.d.ts.map +1 -0
  282. package/esm/web-components/elements/fmcp-button.d.ts +117 -0
  283. package/esm/web-components/elements/fmcp-button.d.ts.map +1 -0
  284. package/esm/web-components/elements/fmcp-card.d.ts +53 -0
  285. package/esm/web-components/elements/fmcp-card.d.ts.map +1 -0
  286. package/esm/web-components/elements/fmcp-input.d.ts +96 -0
  287. package/esm/web-components/elements/fmcp-input.d.ts.map +1 -0
  288. package/esm/web-components/elements/fmcp-select.d.ts +100 -0
  289. package/esm/web-components/elements/fmcp-select.d.ts.map +1 -0
  290. package/esm/web-components/elements/index.d.ts +13 -0
  291. package/esm/web-components/elements/index.d.ts.map +1 -0
  292. package/esm/web-components/index.d.ts +50 -0
  293. package/esm/web-components/index.d.ts.map +1 -0
  294. package/esm/web-components/index.js +1993 -0
  295. package/esm/web-components/register.d.ts +57 -0
  296. package/esm/web-components/register.d.ts.map +1 -0
  297. package/esm/web-components/types.d.ts +122 -0
  298. package/esm/web-components/types.d.ts.map +1 -0
  299. package/esm/widgets/index.d.ts +8 -0
  300. package/esm/widgets/index.d.ts.map +1 -0
  301. package/esm/widgets/index.js +883 -0
  302. package/esm/widgets/progress.d.ts +133 -0
  303. package/esm/widgets/progress.d.ts.map +1 -0
  304. package/esm/widgets/resource.d.ts +163 -0
  305. package/esm/widgets/resource.d.ts.map +1 -0
  306. package/index.d.ts +40 -0
  307. package/index.d.ts.map +1 -0
  308. package/index.js +8526 -0
  309. package/layouts/base.d.ts +86 -0
  310. package/layouts/base.d.ts.map +1 -0
  311. package/layouts/index.d.ts +8 -0
  312. package/layouts/index.d.ts.map +1 -0
  313. package/layouts/index.js +437 -0
  314. package/layouts/presets.d.ts +134 -0
  315. package/layouts/presets.d.ts.map +1 -0
  316. package/package.json +33 -110
  317. package/pages/consent.d.ts +117 -0
  318. package/pages/consent.d.ts.map +1 -0
  319. package/pages/error.d.ts +101 -0
  320. package/pages/error.d.ts.map +1 -0
  321. package/pages/index.d.ts +9 -0
  322. package/pages/index.d.ts.map +1 -0
  323. package/pages/index.js +1065 -0
  324. package/react/Alert.d.ts +101 -0
  325. package/react/Alert.d.ts.map +1 -0
  326. package/react/Badge.d.ts +100 -0
  327. package/react/Badge.d.ts.map +1 -0
  328. package/react/Button.d.ts +108 -0
  329. package/react/Button.d.ts.map +1 -0
  330. package/react/Card.d.ts +103 -0
  331. package/react/Card.d.ts.map +1 -0
  332. package/react/hooks/context.d.ts +179 -0
  333. package/react/hooks/context.d.ts.map +1 -0
  334. package/react/hooks/index.d.ts +42 -0
  335. package/react/hooks/index.d.ts.map +1 -0
  336. package/react/hooks/tools.d.ts +284 -0
  337. package/react/hooks/tools.d.ts.map +1 -0
  338. package/react/index.d.ts +80 -0
  339. package/react/index.d.ts.map +1 -0
  340. package/react/index.js +3160 -0
  341. package/react/types.d.ts +105 -0
  342. package/react/types.d.ts.map +1 -0
  343. package/react/utils.d.ts +43 -0
  344. package/react/utils.d.ts.map +1 -0
  345. package/render/index.d.ts +8 -0
  346. package/render/index.d.ts.map +1 -0
  347. package/render/index.js +77 -0
  348. package/render/prerender.d.ts +57 -0
  349. package/render/prerender.d.ts.map +1 -0
  350. package/renderers/index.d.ts +21 -0
  351. package/renderers/index.d.ts.map +1 -0
  352. package/renderers/index.js +416 -0
  353. package/renderers/react.adapter.d.ts +70 -0
  354. package/renderers/react.adapter.d.ts.map +1 -0
  355. package/renderers/react.renderer.d.ts +96 -0
  356. package/renderers/react.renderer.d.ts.map +1 -0
  357. package/universal/UniversalApp.d.ts +108 -0
  358. package/universal/UniversalApp.d.ts.map +1 -0
  359. package/universal/cached-runtime.d.ts +115 -0
  360. package/universal/cached-runtime.d.ts.map +1 -0
  361. package/universal/context.d.ts +122 -0
  362. package/universal/context.d.ts.map +1 -0
  363. package/universal/index.d.ts +57 -0
  364. package/universal/index.d.ts.map +1 -0
  365. package/universal/index.js +1841 -0
  366. package/universal/renderers/html.renderer.d.ts +37 -0
  367. package/universal/renderers/html.renderer.d.ts.map +1 -0
  368. package/universal/renderers/index.d.ts +112 -0
  369. package/universal/renderers/index.d.ts.map +1 -0
  370. package/universal/renderers/markdown.renderer.d.ts +33 -0
  371. package/universal/renderers/markdown.renderer.d.ts.map +1 -0
  372. package/universal/renderers/mdx.renderer.d.ts +38 -0
  373. package/universal/renderers/mdx.renderer.d.ts.map +1 -0
  374. package/universal/renderers/react.renderer.d.ts +46 -0
  375. package/universal/renderers/react.renderer.d.ts.map +1 -0
  376. package/universal/runtime-builder.d.ts +33 -0
  377. package/universal/runtime-builder.d.ts.map +1 -0
  378. package/universal/store.d.ts +135 -0
  379. package/universal/store.d.ts.map +1 -0
  380. package/universal/types.d.ts +199 -0
  381. package/universal/types.d.ts.map +1 -0
  382. package/web-components/core/attribute-parser.d.ts +82 -0
  383. package/web-components/core/attribute-parser.d.ts.map +1 -0
  384. package/web-components/core/base-element.d.ts +197 -0
  385. package/web-components/core/base-element.d.ts.map +1 -0
  386. package/web-components/core/index.d.ts +9 -0
  387. package/web-components/core/index.d.ts.map +1 -0
  388. package/web-components/elements/fmcp-alert.d.ts +46 -0
  389. package/web-components/elements/fmcp-alert.d.ts.map +1 -0
  390. package/web-components/elements/fmcp-badge.d.ts +47 -0
  391. package/web-components/elements/fmcp-badge.d.ts.map +1 -0
  392. package/web-components/elements/fmcp-button.d.ts +117 -0
  393. package/web-components/elements/fmcp-button.d.ts.map +1 -0
  394. package/web-components/elements/fmcp-card.d.ts +53 -0
  395. package/web-components/elements/fmcp-card.d.ts.map +1 -0
  396. package/web-components/elements/fmcp-input.d.ts +96 -0
  397. package/web-components/elements/fmcp-input.d.ts.map +1 -0
  398. package/web-components/elements/fmcp-select.d.ts +100 -0
  399. package/web-components/elements/fmcp-select.d.ts.map +1 -0
  400. package/web-components/elements/index.d.ts +13 -0
  401. package/web-components/elements/index.d.ts.map +1 -0
  402. package/web-components/index.d.ts +50 -0
  403. package/web-components/index.d.ts.map +1 -0
  404. package/web-components/index.js +2028 -0
  405. package/web-components/register.d.ts +57 -0
  406. package/web-components/register.d.ts.map +1 -0
  407. package/web-components/types.d.ts +122 -0
  408. package/web-components/types.d.ts.map +1 -0
  409. package/widgets/index.d.ts +8 -0
  410. package/widgets/index.d.ts.map +1 -0
  411. package/widgets/index.js +910 -0
  412. package/widgets/progress.d.ts +133 -0
  413. package/widgets/progress.d.ts.map +1 -0
  414. package/widgets/resource.d.ts +163 -0
  415. package/widgets/resource.d.ts.map +1 -0
  416. package/src/adapters/index.d.ts +0 -10
  417. package/src/adapters/index.js +0 -18
  418. package/src/adapters/index.js.map +0 -1
  419. package/src/adapters/platform-meta.d.ts +0 -165
  420. package/src/adapters/platform-meta.js +0 -310
  421. package/src/adapters/platform-meta.js.map +0 -1
  422. package/src/base-template/bridge.d.ts +0 -89
  423. package/src/base-template/bridge.js +0 -452
  424. package/src/base-template/bridge.js.map +0 -1
  425. package/src/base-template/default-base-template.d.ts +0 -91
  426. package/src/base-template/default-base-template.js +0 -435
  427. package/src/base-template/default-base-template.js.map +0 -1
  428. package/src/base-template/index.d.ts +0 -14
  429. package/src/base-template/index.js +0 -30
  430. package/src/base-template/index.js.map +0 -1
  431. package/src/base-template/polyfills.d.ts +0 -30
  432. package/src/base-template/polyfills.js +0 -190
  433. package/src/base-template/polyfills.js.map +0 -1
  434. package/src/base-template/theme-styles.d.ts +0 -73
  435. package/src/base-template/theme-styles.js +0 -95
  436. package/src/base-template/theme-styles.js.map +0 -1
  437. package/src/bridge/adapters/base-adapter.d.ts +0 -103
  438. package/src/bridge/adapters/base-adapter.js +0 -314
  439. package/src/bridge/adapters/base-adapter.js.map +0 -1
  440. package/src/bridge/adapters/claude.adapter.d.ts +0 -66
  441. package/src/bridge/adapters/claude.adapter.js +0 -145
  442. package/src/bridge/adapters/claude.adapter.js.map +0 -1
  443. package/src/bridge/adapters/ext-apps.adapter.d.ts +0 -142
  444. package/src/bridge/adapters/ext-apps.adapter.js +0 -416
  445. package/src/bridge/adapters/ext-apps.adapter.js.map +0 -1
  446. package/src/bridge/adapters/gemini.adapter.d.ts +0 -63
  447. package/src/bridge/adapters/gemini.adapter.js +0 -160
  448. package/src/bridge/adapters/gemini.adapter.js.map +0 -1
  449. package/src/bridge/adapters/generic.adapter.d.ts +0 -55
  450. package/src/bridge/adapters/generic.adapter.js +0 -108
  451. package/src/bridge/adapters/generic.adapter.js.map +0 -1
  452. package/src/bridge/adapters/index.d.ts +0 -25
  453. package/src/bridge/adapters/index.js +0 -65
  454. package/src/bridge/adapters/index.js.map +0 -1
  455. package/src/bridge/adapters/openai.adapter.d.ts +0 -64
  456. package/src/bridge/adapters/openai.adapter.js +0 -194
  457. package/src/bridge/adapters/openai.adapter.js.map +0 -1
  458. package/src/bridge/core/adapter-registry.d.ts +0 -121
  459. package/src/bridge/core/adapter-registry.js +0 -271
  460. package/src/bridge/core/adapter-registry.js.map +0 -1
  461. package/src/bridge/core/bridge-factory.d.ts +0 -198
  462. package/src/bridge/core/bridge-factory.js +0 -428
  463. package/src/bridge/core/bridge-factory.js.map +0 -1
  464. package/src/bridge/core/index.d.ts +0 -9
  465. package/src/bridge/core/index.js +0 -22
  466. package/src/bridge/core/index.js.map +0 -1
  467. package/src/bridge/index.d.ts +0 -61
  468. package/src/bridge/index.js +0 -94
  469. package/src/bridge/index.js.map +0 -1
  470. package/src/bridge/runtime/iife-generator.d.ts +0 -61
  471. package/src/bridge/runtime/iife-generator.js +0 -940
  472. package/src/bridge/runtime/iife-generator.js.map +0 -1
  473. package/src/bridge/runtime/index.d.ts +0 -8
  474. package/src/bridge/runtime/index.js +0 -16
  475. package/src/bridge/runtime/index.js.map +0 -1
  476. package/src/bridge/types.d.ts +0 -385
  477. package/src/bridge/types.js +0 -11
  478. package/src/bridge/types.js.map +0 -1
  479. package/src/build/cdn-resources.d.ts +0 -140
  480. package/src/build/cdn-resources.js +0 -314
  481. package/src/build/cdn-resources.js.map +0 -1
  482. package/src/build/index.d.ts +0 -294
  483. package/src/build/index.js +0 -325
  484. package/src/build/index.js.map +0 -1
  485. package/src/build/widget-manifest.d.ts +0 -212
  486. package/src/build/widget-manifest.js +0 -652
  487. package/src/build/widget-manifest.js.map +0 -1
  488. package/src/bundler/bundler.d.ts +0 -110
  489. package/src/bundler/bundler.js +0 -432
  490. package/src/bundler/bundler.js.map +0 -1
  491. package/src/bundler/cache.d.ts +0 -172
  492. package/src/bundler/cache.js +0 -250
  493. package/src/bundler/cache.js.map +0 -1
  494. package/src/bundler/index.d.ts +0 -41
  495. package/src/bundler/index.js +0 -73
  496. package/src/bundler/index.js.map +0 -1
  497. package/src/bundler/sandbox/enclave-adapter.d.ts +0 -120
  498. package/src/bundler/sandbox/enclave-adapter.js +0 -339
  499. package/src/bundler/sandbox/enclave-adapter.js.map +0 -1
  500. package/src/bundler/sandbox/executor.d.ts +0 -13
  501. package/src/bundler/sandbox/executor.js +0 -22
  502. package/src/bundler/sandbox/executor.js.map +0 -1
  503. package/src/bundler/sandbox/policy.d.ts +0 -61
  504. package/src/bundler/sandbox/policy.js +0 -238
  505. package/src/bundler/sandbox/policy.js.map +0 -1
  506. package/src/bundler/types.d.ts +0 -347
  507. package/src/bundler/types.js +0 -132
  508. package/src/bundler/types.js.map +0 -1
  509. package/src/components/alert.d.ts +0 -71
  510. package/src/components/alert.js +0 -189
  511. package/src/components/alert.js.map +0 -1
  512. package/src/components/alert.schema.d.ts +0 -114
  513. package/src/components/alert.schema.js +0 -105
  514. package/src/components/alert.schema.js.map +0 -1
  515. package/src/components/avatar.d.ts +0 -76
  516. package/src/components/avatar.js +0 -176
  517. package/src/components/avatar.js.map +0 -1
  518. package/src/components/avatar.schema.d.ts +0 -169
  519. package/src/components/avatar.schema.js +0 -103
  520. package/src/components/avatar.schema.js.map +0 -1
  521. package/src/components/badge.d.ts +0 -70
  522. package/src/components/badge.js +0 -149
  523. package/src/components/badge.js.map +0 -1
  524. package/src/components/badge.schema.d.ts +0 -109
  525. package/src/components/badge.schema.js +0 -96
  526. package/src/components/badge.schema.js.map +0 -1
  527. package/src/components/button.d.ts +0 -111
  528. package/src/components/button.js +0 -336
  529. package/src/components/button.js.map +0 -1
  530. package/src/components/button.schema.d.ts +0 -148
  531. package/src/components/button.schema.js +0 -121
  532. package/src/components/button.schema.js.map +0 -1
  533. package/src/components/card.d.ts +0 -60
  534. package/src/components/card.js +0 -117
  535. package/src/components/card.js.map +0 -1
  536. package/src/components/card.schema.d.ts +0 -113
  537. package/src/components/card.schema.js +0 -98
  538. package/src/components/card.schema.js.map +0 -1
  539. package/src/components/form.d.ts +0 -239
  540. package/src/components/form.js +0 -420
  541. package/src/components/form.js.map +0 -1
  542. package/src/components/form.schema.d.ts +0 -441
  543. package/src/components/form.schema.js +0 -406
  544. package/src/components/form.schema.js.map +0 -1
  545. package/src/components/index.d.ts +0 -29
  546. package/src/components/index.js +0 -98
  547. package/src/components/index.js.map +0 -1
  548. package/src/components/list.d.ts +0 -127
  549. package/src/components/list.js +0 -279
  550. package/src/components/list.js.map +0 -1
  551. package/src/components/list.schema.d.ts +0 -134
  552. package/src/components/list.schema.js +0 -168
  553. package/src/components/list.schema.js.map +0 -1
  554. package/src/components/modal.d.ts +0 -111
  555. package/src/components/modal.js +0 -260
  556. package/src/components/modal.js.map +0 -1
  557. package/src/components/modal.schema.d.ts +0 -186
  558. package/src/components/modal.schema.js +0 -167
  559. package/src/components/modal.schema.js.map +0 -1
  560. package/src/components/table.d.ts +0 -105
  561. package/src/components/table.js +0 -283
  562. package/src/components/table.js.map +0 -1
  563. package/src/components/table.schema.d.ts +0 -159
  564. package/src/components/table.schema.js +0 -173
  565. package/src/components/table.schema.js.map +0 -1
  566. package/src/handlebars/helpers.d.ts +0 -348
  567. package/src/handlebars/helpers.js +0 -605
  568. package/src/handlebars/helpers.js.map +0 -1
  569. package/src/handlebars/index.d.ts +0 -193
  570. package/src/handlebars/index.js +0 -350
  571. package/src/handlebars/index.js.map +0 -1
  572. package/src/index.d.ts +0 -50
  573. package/src/index.js +0 -192
  574. package/src/index.js.map +0 -1
  575. package/src/layouts/base.d.ts +0 -88
  576. package/src/layouts/base.js +0 -227
  577. package/src/layouts/base.js.map +0 -1
  578. package/src/layouts/index.d.ts +0 -7
  579. package/src/layouts/index.js +0 -25
  580. package/src/layouts/index.js.map +0 -1
  581. package/src/layouts/presets.d.ts +0 -133
  582. package/src/layouts/presets.js +0 -277
  583. package/src/layouts/presets.js.map +0 -1
  584. package/src/pages/consent.d.ts +0 -116
  585. package/src/pages/consent.js +0 -218
  586. package/src/pages/consent.js.map +0 -1
  587. package/src/pages/error.d.ts +0 -100
  588. package/src/pages/error.js +0 -263
  589. package/src/pages/error.js.map +0 -1
  590. package/src/pages/index.d.ts +0 -8
  591. package/src/pages/index.js +0 -27
  592. package/src/pages/index.js.map +0 -1
  593. package/src/react/Alert.d.ts +0 -101
  594. package/src/react/Alert.js +0 -51
  595. package/src/react/Alert.js.map +0 -1
  596. package/src/react/Badge.d.ts +0 -100
  597. package/src/react/Badge.js +0 -55
  598. package/src/react/Badge.js.map +0 -1
  599. package/src/react/Button.d.ts +0 -108
  600. package/src/react/Button.js +0 -52
  601. package/src/react/Button.js.map +0 -1
  602. package/src/react/Card.d.ts +0 -103
  603. package/src/react/Card.js +0 -55
  604. package/src/react/Card.js.map +0 -1
  605. package/src/react/hooks/context.d.ts +0 -178
  606. package/src/react/hooks/context.js +0 -287
  607. package/src/react/hooks/context.js.map +0 -1
  608. package/src/react/hooks/index.d.ts +0 -41
  609. package/src/react/hooks/index.js +0 -61
  610. package/src/react/hooks/index.js.map +0 -1
  611. package/src/react/hooks/tools.d.ts +0 -283
  612. package/src/react/hooks/tools.js +0 -465
  613. package/src/react/hooks/tools.js.map +0 -1
  614. package/src/react/index.d.ts +0 -80
  615. package/src/react/index.js +0 -113
  616. package/src/react/index.js.map +0 -1
  617. package/src/react/types.d.ts +0 -105
  618. package/src/react/types.js +0 -12
  619. package/src/react/types.js.map +0 -1
  620. package/src/react/utils.d.ts +0 -42
  621. package/src/react/utils.js +0 -99
  622. package/src/react/utils.js.map +0 -1
  623. package/src/registry/index.d.ts +0 -45
  624. package/src/registry/index.js +0 -67
  625. package/src/registry/index.js.map +0 -1
  626. package/src/registry/render-template.d.ts +0 -86
  627. package/src/registry/render-template.js +0 -239
  628. package/src/registry/render-template.js.map +0 -1
  629. package/src/registry/tool-ui.registry.d.ts +0 -260
  630. package/src/registry/tool-ui.registry.js +0 -438
  631. package/src/registry/tool-ui.registry.js.map +0 -1
  632. package/src/registry/uri-utils.d.ts +0 -55
  633. package/src/registry/uri-utils.js +0 -97
  634. package/src/registry/uri-utils.js.map +0 -1
  635. package/src/render/index.d.ts +0 -7
  636. package/src/render/index.js +0 -14
  637. package/src/render/index.js.map +0 -1
  638. package/src/render/prerender.d.ts +0 -56
  639. package/src/render/prerender.js +0 -98
  640. package/src/render/prerender.js.map +0 -1
  641. package/src/renderers/cache.d.ts +0 -144
  642. package/src/renderers/cache.js +0 -240
  643. package/src/renderers/cache.js.map +0 -1
  644. package/src/renderers/html.renderer.d.ts +0 -122
  645. package/src/renderers/html.renderer.js +0 -204
  646. package/src/renderers/html.renderer.js.map +0 -1
  647. package/src/renderers/index.d.ts +0 -35
  648. package/src/renderers/index.js +0 -70
  649. package/src/renderers/index.js.map +0 -1
  650. package/src/renderers/mdx.renderer.d.ts +0 -119
  651. package/src/renderers/mdx.renderer.js +0 -305
  652. package/src/renderers/mdx.renderer.js.map +0 -1
  653. package/src/renderers/react.renderer.d.ts +0 -95
  654. package/src/renderers/react.renderer.js +0 -260
  655. package/src/renderers/react.renderer.js.map +0 -1
  656. package/src/renderers/registry.d.ts +0 -133
  657. package/src/renderers/registry.js +0 -232
  658. package/src/renderers/registry.js.map +0 -1
  659. package/src/renderers/types.d.ts +0 -341
  660. package/src/renderers/types.js +0 -9
  661. package/src/renderers/types.js.map +0 -1
  662. package/src/renderers/utils/detect.d.ts +0 -106
  663. package/src/renderers/utils/detect.js +0 -267
  664. package/src/renderers/utils/detect.js.map +0 -1
  665. package/src/renderers/utils/hash.d.ts +0 -39
  666. package/src/renderers/utils/hash.js +0 -75
  667. package/src/renderers/utils/hash.js.map +0 -1
  668. package/src/renderers/utils/index.d.ts +0 -8
  669. package/src/renderers/utils/index.js +0 -28
  670. package/src/renderers/utils/index.js.map +0 -1
  671. package/src/renderers/utils/transpiler.d.ts +0 -88
  672. package/src/renderers/utils/transpiler.js +0 -215
  673. package/src/renderers/utils/transpiler.js.map +0 -1
  674. package/src/runtime/adapters/html.adapter.d.ts +0 -58
  675. package/src/runtime/adapters/html.adapter.js +0 -131
  676. package/src/runtime/adapters/html.adapter.js.map +0 -1
  677. package/src/runtime/adapters/index.d.ts +0 -25
  678. package/src/runtime/adapters/index.js +0 -54
  679. package/src/runtime/adapters/index.js.map +0 -1
  680. package/src/runtime/adapters/mdx.adapter.d.ts +0 -72
  681. package/src/runtime/adapters/mdx.adapter.js +0 -241
  682. package/src/runtime/adapters/mdx.adapter.js.map +0 -1
  683. package/src/runtime/adapters/react.adapter.d.ts +0 -69
  684. package/src/runtime/adapters/react.adapter.js +0 -245
  685. package/src/runtime/adapters/react.adapter.js.map +0 -1
  686. package/src/runtime/adapters/types.d.ts +0 -94
  687. package/src/runtime/adapters/types.js +0 -11
  688. package/src/runtime/adapters/types.js.map +0 -1
  689. package/src/runtime/csp.d.ts +0 -37
  690. package/src/runtime/csp.js +0 -140
  691. package/src/runtime/csp.js.map +0 -1
  692. package/src/runtime/index.d.ts +0 -16
  693. package/src/runtime/index.js +0 -72
  694. package/src/runtime/index.js.map +0 -1
  695. package/src/runtime/mcp-bridge.d.ts +0 -100
  696. package/src/runtime/mcp-bridge.js +0 -581
  697. package/src/runtime/mcp-bridge.js.map +0 -1
  698. package/src/runtime/renderer-runtime.d.ts +0 -132
  699. package/src/runtime/renderer-runtime.js +0 -389
  700. package/src/runtime/renderer-runtime.js.map +0 -1
  701. package/src/runtime/sanitizer.d.ts +0 -171
  702. package/src/runtime/sanitizer.js +0 -318
  703. package/src/runtime/sanitizer.js.map +0 -1
  704. package/src/runtime/types.d.ts +0 -414
  705. package/src/runtime/types.js +0 -12
  706. package/src/runtime/types.js.map +0 -1
  707. package/src/runtime/wrapper.d.ts +0 -375
  708. package/src/runtime/wrapper.js +0 -1793
  709. package/src/runtime/wrapper.js.map +0 -1
  710. package/src/styles/index.d.ts +0 -7
  711. package/src/styles/index.js +0 -11
  712. package/src/styles/index.js.map +0 -1
  713. package/src/styles/variants.d.ts +0 -50
  714. package/src/styles/variants.js +0 -175
  715. package/src/styles/variants.js.map +0 -1
  716. package/src/theme/cdn.d.ts +0 -194
  717. package/src/theme/cdn.js +0 -375
  718. package/src/theme/cdn.js.map +0 -1
  719. package/src/theme/index.d.ts +0 -17
  720. package/src/theme/index.js +0 -57
  721. package/src/theme/index.js.map +0 -1
  722. package/src/theme/platforms.d.ts +0 -106
  723. package/src/theme/platforms.js +0 -161
  724. package/src/theme/platforms.js.map +0 -1
  725. package/src/theme/presets/github-openai.d.ts +0 -49
  726. package/src/theme/presets/github-openai.js +0 -189
  727. package/src/theme/presets/github-openai.js.map +0 -1
  728. package/src/theme/presets/index.d.ts +0 -10
  729. package/src/theme/presets/index.js +0 -17
  730. package/src/theme/presets/index.js.map +0 -1
  731. package/src/theme/theme.d.ts +0 -395
  732. package/src/theme/theme.js +0 -332
  733. package/src/theme/theme.js.map +0 -1
  734. package/src/tool-template/builder.d.ts +0 -212
  735. package/src/tool-template/builder.js +0 -397
  736. package/src/tool-template/builder.js.map +0 -1
  737. package/src/tool-template/index.d.ts +0 -15
  738. package/src/tool-template/index.js +0 -38
  739. package/src/tool-template/index.js.map +0 -1
  740. package/src/types/index.d.ts +0 -13
  741. package/src/types/index.js +0 -26
  742. package/src/types/index.js.map +0 -1
  743. package/src/types/ui-config.d.ts +0 -357
  744. package/src/types/ui-config.js +0 -12
  745. package/src/types/ui-config.js.map +0 -1
  746. package/src/types/ui-runtime.d.ts +0 -965
  747. package/src/types/ui-runtime.js +0 -117
  748. package/src/types/ui-runtime.js.map +0 -1
  749. package/src/validation/error-box.d.ts +0 -55
  750. package/src/validation/error-box.js +0 -75
  751. package/src/validation/error-box.js.map +0 -1
  752. package/src/validation/index.d.ts +0 -12
  753. package/src/validation/index.js +0 -21
  754. package/src/validation/index.js.map +0 -1
  755. package/src/validation/wrapper.d.ts +0 -96
  756. package/src/validation/wrapper.js +0 -117
  757. package/src/validation/wrapper.js.map +0 -1
  758. package/src/web-components/core/attribute-parser.d.ts +0 -85
  759. package/src/web-components/core/attribute-parser.js +0 -189
  760. package/src/web-components/core/attribute-parser.js.map +0 -1
  761. package/src/web-components/core/base-element.d.ts +0 -197
  762. package/src/web-components/core/base-element.js +0 -289
  763. package/src/web-components/core/base-element.js.map +0 -1
  764. package/src/web-components/core/index.d.ts +0 -8
  765. package/src/web-components/core/index.js +0 -18
  766. package/src/web-components/core/index.js.map +0 -1
  767. package/src/web-components/elements/fmcp-alert.d.ts +0 -45
  768. package/src/web-components/elements/fmcp-alert.js +0 -93
  769. package/src/web-components/elements/fmcp-alert.js.map +0 -1
  770. package/src/web-components/elements/fmcp-badge.d.ts +0 -46
  771. package/src/web-components/elements/fmcp-badge.js +0 -99
  772. package/src/web-components/elements/fmcp-badge.js.map +0 -1
  773. package/src/web-components/elements/fmcp-button.d.ts +0 -124
  774. package/src/web-components/elements/fmcp-button.js +0 -233
  775. package/src/web-components/elements/fmcp-button.js.map +0 -1
  776. package/src/web-components/elements/fmcp-card.d.ts +0 -52
  777. package/src/web-components/elements/fmcp-card.js +0 -115
  778. package/src/web-components/elements/fmcp-card.js.map +0 -1
  779. package/src/web-components/elements/fmcp-input.d.ts +0 -95
  780. package/src/web-components/elements/fmcp-input.js +0 -248
  781. package/src/web-components/elements/fmcp-input.js.map +0 -1
  782. package/src/web-components/elements/fmcp-select.d.ts +0 -99
  783. package/src/web-components/elements/fmcp-select.js +0 -243
  784. package/src/web-components/elements/fmcp-select.js.map +0 -1
  785. package/src/web-components/elements/index.d.ts +0 -12
  786. package/src/web-components/elements/index.js +0 -34
  787. package/src/web-components/elements/index.js.map +0 -1
  788. package/src/web-components/index.d.ts +0 -49
  789. package/src/web-components/index.js +0 -75
  790. package/src/web-components/index.js.map +0 -1
  791. package/src/web-components/register.d.ts +0 -56
  792. package/src/web-components/register.js +0 -80
  793. package/src/web-components/register.js.map +0 -1
  794. package/src/web-components/types.d.ts +0 -121
  795. package/src/web-components/types.js +0 -25
  796. package/src/web-components/types.js.map +0 -1
  797. package/src/widgets/index.d.ts +0 -7
  798. package/src/widgets/index.js +0 -24
  799. package/src/widgets/index.js.map +0 -1
  800. package/src/widgets/progress.d.ts +0 -132
  801. package/src/widgets/progress.js +0 -303
  802. package/src/widgets/progress.js.map +0 -1
  803. package/src/widgets/resource.d.ts +0 -162
  804. package/src/widgets/resource.js +0 -340
  805. package/src/widgets/resource.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler.js","sourceRoot":"","sources":["../../../src/bundler/bundler.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAkeH,sCAEC;AAxdD,mCAAmG;AACnG,mCAAoE;AACpE,6CAA+G;AAC/G,iDAAiF;AAEjF;;GAEG;AACH,IAAI,gBAAgB,GAA0F,IAAI,CAAC;AAEnH;;GAEG;AACH,KAAK,UAAU,WAAW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BAAsB,CAAC,GAAG;gBAC7B,GAAG,OAAO,CAAC,GAAG;aACf;YACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,8BAAsB,CAAC,MAAM;YACvD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,8BAAsB,CAAC,UAAU;YACnE,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,8BAAsB,CAAC,SAAS;SACjE,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,WAAmB,EAAE,OAAiC;QACjF,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE7D,OAAO;;kBAEO,WAAW;;;;;;MAMvB,WAAW;;;;;;;;;;;;;;KAcZ,CAAC,IAAI,EAAE,CAAC;IACX,CAAC;CACF;AAjXD,0CAiXC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACpD,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED,mCAAmC;AACnC,2CAAiD;AAAxC,uGAAA,aAAa,OAAA;AACtB,+CAAoD;AAA3C,0GAAA,cAAc,OAAA","sourcesContent":["/**\n * In-Memory Bundler\n *\n * Fast, secure bundler for JSX/TSX/MDX sources using esbuild.\n * Provides caching, security validation, and SSR support.\n *\n * @packageDocumentation\n */\n\nimport type {\n BundleOptions,\n BundleResult,\n SSRBundleOptions,\n SSRResult,\n BundlerOptions,\n SecurityPolicy,\n SourceType,\n OutputFormat,\n} from './types';\nimport { DEFAULT_BUNDLE_OPTIONS, DEFAULT_BUNDLER_OPTIONS, DEFAULT_SECURITY_POLICY } from './types';\nimport { BundlerCache, createCacheKey, hashContent } from './cache';\nimport { validateSource, validateSize, mergePolicy, throwOnViolations, SecurityError } from './sandbox/policy';\nimport { executeCode, executeDefault, ExecutionError } from './sandbox/executor';\n\n/**\n * Lazy-loaded esbuild transform function.\n */\nlet esbuildTransform: ((source: string, options: object) => Promise<{ code: string; map?: string }>) | null = null;\n\n/**\n * Load esbuild transform function.\n */\nasync function loadEsbuild(): Promise<typeof esbuildTransform> {\n if (esbuildTransform !== null) {\n return esbuildTransform;\n }\n\n try {\n const esbuild = await import('esbuild');\n esbuildTransform = esbuild.transform;\n return esbuildTransform;\n } catch {\n // Fallback: try @swc/core\n try {\n const swc = await import('@swc/core');\n esbuildTransform = async (source: string, options: object) => {\n const opts = options as { loader?: string; minify?: boolean; sourcemap?: boolean | 'inline' };\n const result = await swc.transform(source, {\n jsc: {\n parser: {\n syntax: 'typescript',\n tsx: opts.loader === 'tsx' || opts.loader === 'jsx',\n },\n transform: {\n react: {\n runtime: 'automatic',\n development: false,\n },\n },\n target: 'es2020',\n minify: opts.minify ? { compress: true, mangle: true } : undefined,\n },\n module: {\n type: 'commonjs',\n },\n sourceMaps: opts.sourcemap ? true : false,\n });\n return { code: result.code, map: result.map };\n };\n return esbuildTransform;\n } catch {\n console.warn(\n '[@frontmcp/ui/bundler] Neither esbuild nor @swc/core available. ' +\n 'Install esbuild for best performance: npm install esbuild',\n );\n return null;\n }\n }\n}\n\n/**\n * In-memory bundler for JSX/TSX/MDX sources.\n *\n * Features:\n * - Fast transformation using esbuild (fallback to SWC)\n * - Content-addressable caching\n * - Security validation (blocked imports, eval, etc.)\n * - SSR support for React components\n *\n * @example\n * ```typescript\n * const bundler = new InMemoryBundler();\n *\n * // Bundle JSX source\n * const result = await bundler.bundle({\n * source: 'const App = () => <div>Hello</div>; export default App;',\n * sourceType: 'jsx',\n * });\n *\n * console.log(result.code); // Bundled JavaScript\n * console.log(result.cached); // Whether from cache\n *\n * // SSR rendering\n * const ssrResult = await bundler.bundleSSR({\n * source: 'export default ({ data }) => <div>{data.message}</div>',\n * sourceType: 'jsx',\n * context: { data: { message: 'Hello' } },\n * });\n *\n * console.log(ssrResult.html); // Rendered HTML\n * ```\n */\nexport class InMemoryBundler {\n private readonly cache: BundlerCache;\n private readonly options: Required<BundlerOptions>;\n private readonly defaultSecurity: SecurityPolicy;\n\n constructor(options: BundlerOptions = {}) {\n this.options = {\n ...DEFAULT_BUNDLER_OPTIONS,\n ...options,\n cache: {\n ...DEFAULT_BUNDLER_OPTIONS.cache,\n ...options.cache,\n },\n };\n\n this.cache = new BundlerCache({\n maxSize: this.options.cache.maxSize,\n ttl: this.options.cache.ttl,\n });\n\n this.defaultSecurity = mergePolicy(options.defaultSecurity);\n }\n\n /**\n * Bundle source code.\n *\n * @param options - Bundle options\n * @returns Bundle result\n */\n async bundle(options: BundleOptions): Promise<BundleResult> {\n const startTime = performance.now();\n\n // Merge options with defaults\n const opts = this.mergeOptions(options);\n\n // Check cache first\n if (!opts.skipCache && !this.options.cache.disabled) {\n const cacheKey = options.cacheKey ?? createCacheKey(options.source, opts);\n const cached = this.cache.get(cacheKey);\n if (cached) {\n return {\n ...cached,\n cached: true,\n metrics: {\n ...cached.metrics,\n cacheTime: performance.now() - startTime,\n },\n };\n }\n }\n\n // Validate security\n const security = mergePolicy(options.security ?? this.defaultSecurity);\n const violations = validateSource(options.source, security);\n throwOnViolations(violations);\n\n // Detect source type\n const sourceType = opts.sourceType === 'auto' ? this.detectSourceType(options.source) : opts.sourceType;\n\n // Transform\n const transformStart = performance.now();\n const transformed = await this.transform(options.source, sourceType, opts);\n const transformTime = performance.now() - transformStart;\n\n // Validate size\n const sizeViolation = validateSize(transformed.code.length, security);\n if (sizeViolation) {\n throwOnViolations([sizeViolation]);\n }\n\n // Build result\n const hash = hashContent(transformed.code);\n const result: BundleResult = {\n code: transformed.code,\n hash,\n cached: false,\n size: transformed.code.length,\n map: transformed.map,\n metrics: {\n transformTime,\n bundleTime: 0, // No separate bundle step for transform-only\n totalTime: performance.now() - startTime,\n },\n sourceType,\n format: opts.format,\n };\n\n // Cache result\n if (!this.options.cache.disabled) {\n const cacheKey = options.cacheKey ?? createCacheKey(options.source, opts);\n this.cache.set(cacheKey, result);\n }\n\n return result;\n }\n\n /**\n * Bundle and execute for SSR.\n *\n * @param options - SSR bundle options\n * @returns SSR result with rendered HTML\n */\n async bundleSSR(options: SSRBundleOptions): Promise<SSRResult> {\n const startTime = performance.now();\n\n // First, bundle the source\n const bundleResult = await this.bundle({\n ...options,\n format: 'cjs', // CommonJS for execution\n });\n\n // Load React for SSR\n let React;\n let ReactDOMServer;\n\n try {\n React = await import('react');\n ReactDOMServer = await import('react-dom/server');\n } catch {\n throw new Error('React and react-dom/server are required for SSR. Install them: npm install react react-dom');\n }\n\n // Execute the bundled code\n const renderStart = performance.now();\n const Component = await executeDefault<React.ComponentType<unknown>>(bundleResult.code, {\n React,\n security: mergePolicy(options.security ?? this.defaultSecurity),\n });\n\n // Render to HTML\n let html: string;\n try {\n const element = React.createElement(Component, options.context ?? {});\n html = ReactDOMServer.renderToString(element);\n } catch (error) {\n throw new ExecutionError(\n `SSR rendering failed: ${error instanceof Error ? error.message : String(error)}`,\n error,\n );\n }\n\n const renderTime = performance.now() - renderStart;\n\n // Build hydration script if requested\n let hydrationScript: string | undefined;\n if (options.includeHydration) {\n hydrationScript = this.buildHydrationScript(bundleResult.code, options.context);\n }\n\n return {\n ...bundleResult,\n html,\n hydrationScript,\n metrics: {\n ...bundleResult.metrics,\n totalTime: performance.now() - startTime,\n },\n ssrMetrics: {\n renderTime,\n },\n };\n }\n\n /**\n * Bundle and execute code, returning the exports.\n *\n * @param options - Bundle options\n * @param context - Execution context\n * @returns Exported value\n */\n async bundleAndExecute<T = unknown>(options: BundleOptions, context?: Record<string, unknown>): Promise<T> {\n // Bundle first\n const result = await this.bundle({\n ...options,\n format: 'cjs', // CommonJS for execution\n });\n\n // Load React if available\n let React;\n try {\n React = await import('react');\n } catch {\n // React not available, that's okay\n }\n\n // Execute\n return executeDefault<T>(result.code, {\n React,\n globals: context,\n security: mergePolicy(options.security ?? this.defaultSecurity),\n });\n }\n\n /**\n * Get cache statistics.\n */\n getCacheStats() {\n return this.cache.getStats();\n }\n\n /**\n * Clear the cache.\n */\n clearCache(): void {\n this.cache.clear();\n }\n\n /**\n * Clean up expired cache entries.\n */\n cleanupCache(): number {\n return this.cache.cleanup();\n }\n\n /**\n * Transform source code using esbuild/SWC.\n */\n private async transform(\n source: string,\n sourceType: SourceType,\n options: Required<Pick<BundleOptions, 'format' | 'minify' | 'sourceMaps' | 'target' | 'jsx'>>,\n ): Promise<{ code: string; map?: string }> {\n const transform = await loadEsbuild();\n\n if (!transform) {\n throw new Error('No bundler available. Install esbuild or @swc/core: npm install esbuild');\n }\n\n // Map source type to loader\n const loader = this.getLoader(sourceType);\n\n // Build esbuild options\n const esbuildOptions: Record<string, unknown> = {\n loader,\n minify: options.minify,\n sourcemap: options.sourceMaps,\n target: options.target,\n format: options.format === 'cjs' ? 'cjs' : options.format === 'esm' ? 'esm' : 'iife',\n jsx: 'automatic',\n jsxImportSource: options.jsx.importSource,\n };\n\n try {\n const result = await transform(source, esbuildOptions);\n return {\n code: result.code,\n map: result.map,\n };\n } catch (error) {\n throw new Error(`Transform failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Get esbuild loader for source type.\n */\n private getLoader(sourceType: SourceType): string {\n switch (sourceType) {\n case 'jsx':\n return 'jsx';\n case 'tsx':\n return 'tsx';\n case 'mdx':\n return 'tsx'; // MDX compiles to JSX/TSX\n case 'html':\n return 'text';\n default:\n return 'tsx';\n }\n }\n\n /**\n * Detect source type from content.\n */\n private detectSourceType(source: string): SourceType {\n // Check for TypeScript types\n const hasTypeScript =\n /:\\s*(string|number|boolean|any|unknown|void|never|object)\\b/.test(source) ||\n /interface\\s+\\w+/.test(source) ||\n /type\\s+\\w+\\s*=/.test(source) ||\n /<\\w+>/.test(source); // Generic syntax\n\n // Check for JSX\n const hasJSX =\n /<[A-Z][a-zA-Z]*/.test(source) || // Component tags\n /<[a-z]+\\s/.test(source) || // HTML tags with attributes\n /<[a-z]+>/.test(source) || // Self-closing HTML tags\n /<\\/[a-z]+>/.test(source); // Closing tags\n\n // Check for MDX\n const hasMDX =\n /^#\\s+/.test(source) || // Markdown heading\n /^-\\s+/.test(source) || // Markdown list\n /\\*\\*\\w+\\*\\*/.test(source) || // Bold\n /```\\w*\\n/.test(source); // Code block\n\n if (hasMDX && hasJSX) {\n return 'mdx';\n }\n if (hasTypeScript && hasJSX) {\n return 'tsx';\n }\n if (hasJSX) {\n return 'jsx';\n }\n if (hasTypeScript) {\n return 'tsx';\n }\n\n return 'jsx';\n }\n\n /**\n * Merge bundle options with defaults.\n */\n private mergeOptions(\n options: BundleOptions,\n ): Required<\n Pick<\n BundleOptions,\n 'sourceType' | 'format' | 'minify' | 'sourceMaps' | 'externals' | 'jsx' | 'target' | 'globalName' | 'skipCache'\n >\n > {\n return {\n sourceType: options.sourceType ?? DEFAULT_BUNDLE_OPTIONS.sourceType,\n format: options.format ?? DEFAULT_BUNDLE_OPTIONS.format,\n minify: options.minify ?? DEFAULT_BUNDLE_OPTIONS.minify,\n sourceMaps: options.sourceMaps ?? DEFAULT_BUNDLE_OPTIONS.sourceMaps,\n externals: options.externals ?? DEFAULT_BUNDLE_OPTIONS.externals,\n jsx: {\n ...DEFAULT_BUNDLE_OPTIONS.jsx,\n ...options.jsx,\n },\n target: options.target ?? DEFAULT_BUNDLE_OPTIONS.target,\n globalName: options.globalName ?? DEFAULT_BUNDLE_OPTIONS.globalName,\n skipCache: options.skipCache ?? DEFAULT_BUNDLE_OPTIONS.skipCache,\n };\n }\n\n /**\n * Build hydration script for client-side React.\n */\n private buildHydrationScript(bundledCode: string, context?: Record<string, unknown>): string {\n const contextJson = context ? JSON.stringify(context) : '{}';\n\n return `\n(function() {\n var context = ${contextJson};\n var exports = {};\n var module = { exports: exports };\n\n // Execute bundled code\n (function(exports, module) {\n ${bundledCode}\n })(exports, module);\n\n // Get component\n var Component = module.exports.default || module.exports;\n\n // Hydrate\n if (typeof ReactDOM !== 'undefined' && ReactDOM.hydrateRoot) {\n var container = document.getElementById('root') || document.body.firstElementChild;\n if (container) {\n ReactDOM.hydrateRoot(container, React.createElement(Component, context));\n }\n }\n})();\n `.trim();\n }\n}\n\n/**\n * Create a bundler instance with default options.\n *\n * @param options - Bundler configuration\n * @returns New bundler instance\n */\nexport function createBundler(options?: BundlerOptions): InMemoryBundler {\n return new InMemoryBundler(options);\n}\n\n// Re-export errors for convenience\nexport { SecurityError } from './sandbox/policy';\nexport { ExecutionError } from './sandbox/executor';\n"]}
@@ -1,172 +0,0 @@
1
- /**
2
- * Bundler Cache
3
- *
4
- * LRU cache implementation for bundled results.
5
- * Provides content-addressable caching with TTL expiration.
6
- *
7
- * @packageDocumentation
8
- */
9
- import type { BundleResult } from './types';
10
- /**
11
- * Cache configuration options.
12
- */
13
- export interface CacheOptions {
14
- /**
15
- * Maximum number of entries in the cache.
16
- * @default 100
17
- */
18
- maxSize: number;
19
- /**
20
- * Time-to-live for cache entries in milliseconds.
21
- * @default 300000 (5 minutes)
22
- */
23
- ttl: number;
24
- }
25
- /**
26
- * Cache statistics.
27
- */
28
- export interface CacheStats {
29
- /**
30
- * Number of entries in the cache.
31
- */
32
- size: number;
33
- /**
34
- * Number of cache hits.
35
- */
36
- hits: number;
37
- /**
38
- * Number of cache misses.
39
- */
40
- misses: number;
41
- /**
42
- * Hit rate (0-1).
43
- */
44
- hitRate: number;
45
- /**
46
- * Number of expired entries removed.
47
- */
48
- evictions: number;
49
- /**
50
- * Total memory used by cache (approximate).
51
- */
52
- memoryUsage: number;
53
- }
54
- /**
55
- * LRU cache for bundled results.
56
- *
57
- * Features:
58
- * - Content-addressable by hash
59
- * - TTL-based expiration
60
- * - LRU eviction when at capacity
61
- * - Statistics tracking
62
- *
63
- * @example
64
- * ```typescript
65
- * const cache = new BundlerCache({ maxSize: 100, ttl: 300000 });
66
- *
67
- * // Store a result
68
- * cache.set('abc123', bundleResult);
69
- *
70
- * // Retrieve a result
71
- * const cached = cache.get('abc123');
72
- * if (cached) {
73
- * console.log('Cache hit!', cached);
74
- * }
75
- *
76
- * // Get statistics
77
- * console.log(cache.getStats());
78
- * ```
79
- */
80
- export declare class BundlerCache {
81
- private readonly cache;
82
- private readonly options;
83
- private stats;
84
- constructor(options?: Partial<CacheOptions>);
85
- /**
86
- * Get a cached bundle result.
87
- *
88
- * @param key - Cache key (typically content hash)
89
- * @returns Cached result or undefined if not found/expired
90
- */
91
- get(key: string): BundleResult | undefined;
92
- /**
93
- * Store a bundle result in the cache.
94
- *
95
- * @param key - Cache key (typically content hash)
96
- * @param result - Bundle result to cache
97
- */
98
- set(key: string, result: BundleResult): void;
99
- /**
100
- * Check if a key exists in the cache (and is not expired).
101
- *
102
- * @param key - Cache key to check
103
- * @returns true if key exists and is not expired
104
- */
105
- has(key: string): boolean;
106
- /**
107
- * Delete a specific entry from the cache.
108
- *
109
- * @param key - Cache key to delete
110
- * @returns true if the key was found and deleted
111
- */
112
- delete(key: string): boolean;
113
- /**
114
- * Clear all entries from the cache.
115
- */
116
- clear(): void;
117
- /**
118
- * Get cache statistics.
119
- *
120
- * @returns Current cache statistics
121
- */
122
- getStats(): CacheStats;
123
- /**
124
- * Remove expired entries from the cache.
125
- *
126
- * @returns Number of entries removed
127
- */
128
- cleanup(): number;
129
- /**
130
- * Get all cache keys.
131
- *
132
- * @returns Array of cache keys
133
- */
134
- keys(): string[];
135
- /**
136
- * Get the number of entries in the cache.
137
- */
138
- get size(): number;
139
- /**
140
- * Check if an entry is expired.
141
- */
142
- private isExpired;
143
- /**
144
- * Evict the oldest (least recently used) entry.
145
- */
146
- private evictOldest;
147
- }
148
- /**
149
- * Create a hash from source content.
150
- *
151
- * Uses a simple but fast hashing algorithm suitable for cache keys.
152
- *
153
- * @param content - Content to hash
154
- * @returns Hash string
155
- */
156
- export declare function hashContent(content: string): string;
157
- /**
158
- * Create a hash from bundle options.
159
- *
160
- * Used to differentiate bundles of the same source with different options.
161
- *
162
- * @param source - Source content
163
- * @param options - Bundle options that affect output
164
- * @returns Combined hash string
165
- */
166
- export declare function createCacheKey(source: string, options: {
167
- sourceType?: string;
168
- format?: string;
169
- minify?: boolean;
170
- externals?: string[];
171
- target?: string;
172
- }): string;
@@ -1,250 +0,0 @@
1
- "use strict";
2
- /**
3
- * Bundler Cache
4
- *
5
- * LRU cache implementation for bundled results.
6
- * Provides content-addressable caching with TTL expiration.
7
- *
8
- * @packageDocumentation
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.BundlerCache = void 0;
12
- exports.hashContent = hashContent;
13
- exports.createCacheKey = createCacheKey;
14
- /**
15
- * LRU cache for bundled results.
16
- *
17
- * Features:
18
- * - Content-addressable by hash
19
- * - TTL-based expiration
20
- * - LRU eviction when at capacity
21
- * - Statistics tracking
22
- *
23
- * @example
24
- * ```typescript
25
- * const cache = new BundlerCache({ maxSize: 100, ttl: 300000 });
26
- *
27
- * // Store a result
28
- * cache.set('abc123', bundleResult);
29
- *
30
- * // Retrieve a result
31
- * const cached = cache.get('abc123');
32
- * if (cached) {
33
- * console.log('Cache hit!', cached);
34
- * }
35
- *
36
- * // Get statistics
37
- * console.log(cache.getStats());
38
- * ```
39
- */
40
- class BundlerCache {
41
- cache = new Map();
42
- options;
43
- stats = {
44
- hits: 0,
45
- misses: 0,
46
- evictions: 0,
47
- };
48
- constructor(options = {}) {
49
- this.options = {
50
- maxSize: options.maxSize ?? 100,
51
- ttl: options.ttl ?? 300000,
52
- };
53
- }
54
- /**
55
- * Get a cached bundle result.
56
- *
57
- * @param key - Cache key (typically content hash)
58
- * @returns Cached result or undefined if not found/expired
59
- */
60
- get(key) {
61
- const entry = this.cache.get(key);
62
- if (!entry) {
63
- this.stats.misses++;
64
- return undefined;
65
- }
66
- // Check TTL
67
- if (this.isExpired(entry)) {
68
- this.cache.delete(key);
69
- this.stats.misses++;
70
- this.stats.evictions++;
71
- return undefined;
72
- }
73
- // Update access tracking
74
- entry.lastAccessedAt = Date.now();
75
- entry.accessCount++;
76
- this.stats.hits++;
77
- // Move to end (most recently used) by re-inserting
78
- this.cache.delete(key);
79
- this.cache.set(key, entry);
80
- return entry.result;
81
- }
82
- /**
83
- * Store a bundle result in the cache.
84
- *
85
- * @param key - Cache key (typically content hash)
86
- * @param result - Bundle result to cache
87
- */
88
- set(key, result) {
89
- // Enforce capacity limit
90
- while (this.cache.size >= this.options.maxSize) {
91
- this.evictOldest();
92
- }
93
- const now = Date.now();
94
- const entry = {
95
- result,
96
- createdAt: now,
97
- lastAccessedAt: now,
98
- accessCount: 1,
99
- };
100
- this.cache.set(key, entry);
101
- }
102
- /**
103
- * Check if a key exists in the cache (and is not expired).
104
- *
105
- * @param key - Cache key to check
106
- * @returns true if key exists and is not expired
107
- */
108
- has(key) {
109
- const entry = this.cache.get(key);
110
- if (!entry)
111
- return false;
112
- if (this.isExpired(entry)) {
113
- this.cache.delete(key);
114
- this.stats.evictions++;
115
- return false;
116
- }
117
- return true;
118
- }
119
- /**
120
- * Delete a specific entry from the cache.
121
- *
122
- * @param key - Cache key to delete
123
- * @returns true if the key was found and deleted
124
- */
125
- delete(key) {
126
- return this.cache.delete(key);
127
- }
128
- /**
129
- * Clear all entries from the cache.
130
- */
131
- clear() {
132
- this.cache.clear();
133
- this.stats = {
134
- hits: 0,
135
- misses: 0,
136
- evictions: 0,
137
- };
138
- }
139
- /**
140
- * Get cache statistics.
141
- *
142
- * @returns Current cache statistics
143
- */
144
- getStats() {
145
- const total = this.stats.hits + this.stats.misses;
146
- const hitRate = total > 0 ? this.stats.hits / total : 0;
147
- let memoryUsage = 0;
148
- for (const entry of this.cache.values()) {
149
- memoryUsage += entry.result.size;
150
- if (entry.result.map) {
151
- memoryUsage += entry.result.map.length;
152
- }
153
- }
154
- return {
155
- size: this.cache.size,
156
- hits: this.stats.hits,
157
- misses: this.stats.misses,
158
- hitRate,
159
- evictions: this.stats.evictions,
160
- memoryUsage,
161
- };
162
- }
163
- /**
164
- * Remove expired entries from the cache.
165
- *
166
- * @returns Number of entries removed
167
- */
168
- cleanup() {
169
- let removed = 0;
170
- for (const [key, entry] of this.cache.entries()) {
171
- if (this.isExpired(entry)) {
172
- this.cache.delete(key);
173
- removed++;
174
- }
175
- }
176
- this.stats.evictions += removed;
177
- return removed;
178
- }
179
- /**
180
- * Get all cache keys.
181
- *
182
- * @returns Array of cache keys
183
- */
184
- keys() {
185
- return Array.from(this.cache.keys());
186
- }
187
- /**
188
- * Get the number of entries in the cache.
189
- */
190
- get size() {
191
- return this.cache.size;
192
- }
193
- /**
194
- * Check if an entry is expired.
195
- */
196
- isExpired(entry) {
197
- return Date.now() - entry.createdAt > this.options.ttl;
198
- }
199
- /**
200
- * Evict the oldest (least recently used) entry.
201
- */
202
- evictOldest() {
203
- // Map maintains insertion order, so first key is oldest
204
- const oldestKey = this.cache.keys().next().value;
205
- if (oldestKey !== undefined) {
206
- this.cache.delete(oldestKey);
207
- this.stats.evictions++;
208
- }
209
- }
210
- }
211
- exports.BundlerCache = BundlerCache;
212
- /**
213
- * Create a hash from source content.
214
- *
215
- * Uses a simple but fast hashing algorithm suitable for cache keys.
216
- *
217
- * @param content - Content to hash
218
- * @returns Hash string
219
- */
220
- function hashContent(content) {
221
- // FNV-1a hash - fast and good distribution
222
- let hash = 2166136261;
223
- for (let i = 0; i < content.length; i++) {
224
- hash ^= content.charCodeAt(i);
225
- hash = Math.imul(hash, 16777619);
226
- }
227
- // Convert to hex string
228
- return (hash >>> 0).toString(16).padStart(8, '0');
229
- }
230
- /**
231
- * Create a hash from bundle options.
232
- *
233
- * Used to differentiate bundles of the same source with different options.
234
- *
235
- * @param source - Source content
236
- * @param options - Bundle options that affect output
237
- * @returns Combined hash string
238
- */
239
- function createCacheKey(source, options) {
240
- const sourceHash = hashContent(source);
241
- const optionsHash = hashContent(JSON.stringify({
242
- sourceType: options.sourceType,
243
- format: options.format,
244
- minify: options.minify,
245
- externals: options.externals?.sort(),
246
- target: options.target,
247
- }));
248
- return `${sourceHash}-${optionsHash}`;
249
- }
250
- //# sourceMappingURL=cache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/bundler/cache.ts"],"names":[],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SAAgB,cAAc,CAC5B,MAAc,EACd,OAMC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,WAAW,GAAG,WAAW,CAC7B,IAAI,CAAC,SAAS,CAAC;QACb,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CACH,CAAC;IAEF,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Bundler Cache\n *\n * LRU cache implementation for bundled results.\n * Provides content-addressable caching with TTL expiration.\n *\n * @packageDocumentation\n */\n\nimport type { BundleResult, CacheEntry } from './types';\n\n/**\n * Cache configuration options.\n */\nexport interface CacheOptions {\n /**\n * Maximum number of entries in the cache.\n * @default 100\n */\n maxSize: number;\n\n /**\n * Time-to-live for cache entries in milliseconds.\n * @default 300000 (5 minutes)\n */\n ttl: number;\n}\n\n/**\n * Cache statistics.\n */\nexport interface CacheStats {\n /**\n * Number of entries in the cache.\n */\n size: number;\n\n /**\n * Number of cache hits.\n */\n hits: number;\n\n /**\n * Number of cache misses.\n */\n misses: number;\n\n /**\n * Hit rate (0-1).\n */\n hitRate: number;\n\n /**\n * Number of expired entries removed.\n */\n evictions: number;\n\n /**\n * Total memory used by cache (approximate).\n */\n memoryUsage: number;\n}\n\n/**\n * LRU cache for bundled results.\n *\n * Features:\n * - Content-addressable by hash\n * - TTL-based expiration\n * - LRU eviction when at capacity\n * - Statistics tracking\n *\n * @example\n * ```typescript\n * const cache = new BundlerCache({ maxSize: 100, ttl: 300000 });\n *\n * // Store a result\n * cache.set('abc123', bundleResult);\n *\n * // Retrieve a result\n * const cached = cache.get('abc123');\n * if (cached) {\n * console.log('Cache hit!', cached);\n * }\n *\n * // Get statistics\n * console.log(cache.getStats());\n * ```\n */\nexport class BundlerCache {\n private readonly cache = new Map<string, CacheEntry>();\n private readonly options: CacheOptions;\n private stats = {\n hits: 0,\n misses: 0,\n evictions: 0,\n };\n\n constructor(options: Partial<CacheOptions> = {}) {\n this.options = {\n maxSize: options.maxSize ?? 100,\n ttl: options.ttl ?? 300000,\n };\n }\n\n /**\n * Get a cached bundle result.\n *\n * @param key - Cache key (typically content hash)\n * @returns Cached result or undefined if not found/expired\n */\n get(key: string): BundleResult | undefined {\n const entry = this.cache.get(key);\n\n if (!entry) {\n this.stats.misses++;\n return undefined;\n }\n\n // Check TTL\n if (this.isExpired(entry)) {\n this.cache.delete(key);\n this.stats.misses++;\n this.stats.evictions++;\n return undefined;\n }\n\n // Update access tracking\n entry.lastAccessedAt = Date.now();\n entry.accessCount++;\n this.stats.hits++;\n\n // Move to end (most recently used) by re-inserting\n this.cache.delete(key);\n this.cache.set(key, entry);\n\n return entry.result;\n }\n\n /**\n * Store a bundle result in the cache.\n *\n * @param key - Cache key (typically content hash)\n * @param result - Bundle result to cache\n */\n set(key: string, result: BundleResult): void {\n // Enforce capacity limit\n while (this.cache.size >= this.options.maxSize) {\n this.evictOldest();\n }\n\n const now = Date.now();\n const entry: CacheEntry = {\n result,\n createdAt: now,\n lastAccessedAt: now,\n accessCount: 1,\n };\n\n this.cache.set(key, entry);\n }\n\n /**\n * Check if a key exists in the cache (and is not expired).\n *\n * @param key - Cache key to check\n * @returns true if key exists and is not expired\n */\n has(key: string): boolean {\n const entry = this.cache.get(key);\n if (!entry) return false;\n if (this.isExpired(entry)) {\n this.cache.delete(key);\n this.stats.evictions++;\n return false;\n }\n return true;\n }\n\n /**\n * Delete a specific entry from the cache.\n *\n * @param key - Cache key to delete\n * @returns true if the key was found and deleted\n */\n delete(key: string): boolean {\n return this.cache.delete(key);\n }\n\n /**\n * Clear all entries from the cache.\n */\n clear(): void {\n this.cache.clear();\n this.stats = {\n hits: 0,\n misses: 0,\n evictions: 0,\n };\n }\n\n /**\n * Get cache statistics.\n *\n * @returns Current cache statistics\n */\n getStats(): CacheStats {\n const total = this.stats.hits + this.stats.misses;\n const hitRate = total > 0 ? this.stats.hits / total : 0;\n\n let memoryUsage = 0;\n for (const entry of this.cache.values()) {\n memoryUsage += entry.result.size;\n if (entry.result.map) {\n memoryUsage += entry.result.map.length;\n }\n }\n\n return {\n size: this.cache.size,\n hits: this.stats.hits,\n misses: this.stats.misses,\n hitRate,\n evictions: this.stats.evictions,\n memoryUsage,\n };\n }\n\n /**\n * Remove expired entries from the cache.\n *\n * @returns Number of entries removed\n */\n cleanup(): number {\n let removed = 0;\n\n for (const [key, entry] of this.cache.entries()) {\n if (this.isExpired(entry)) {\n this.cache.delete(key);\n removed++;\n }\n }\n\n this.stats.evictions += removed;\n return removed;\n }\n\n /**\n * Get all cache keys.\n *\n * @returns Array of cache keys\n */\n keys(): string[] {\n return Array.from(this.cache.keys());\n }\n\n /**\n * Get the number of entries in the cache.\n */\n get size(): number {\n return this.cache.size;\n }\n\n /**\n * Check if an entry is expired.\n */\n private isExpired(entry: CacheEntry): boolean {\n return Date.now() - entry.createdAt > this.options.ttl;\n }\n\n /**\n * Evict the oldest (least recently used) entry.\n */\n private evictOldest(): void {\n // Map maintains insertion order, so first key is oldest\n const oldestKey = this.cache.keys().next().value;\n if (oldestKey !== undefined) {\n this.cache.delete(oldestKey);\n this.stats.evictions++;\n }\n }\n}\n\n/**\n * Create a hash from source content.\n *\n * Uses a simple but fast hashing algorithm suitable for cache keys.\n *\n * @param content - Content to hash\n * @returns Hash string\n */\nexport function hashContent(content: string): string {\n // FNV-1a hash - fast and good distribution\n let hash = 2166136261;\n for (let i = 0; i < content.length; i++) {\n hash ^= content.charCodeAt(i);\n hash = Math.imul(hash, 16777619);\n }\n\n // Convert to hex string\n return (hash >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * Create a hash from bundle options.\n *\n * Used to differentiate bundles of the same source with different options.\n *\n * @param source - Source content\n * @param options - Bundle options that affect output\n * @returns Combined hash string\n */\nexport function createCacheKey(\n source: string,\n options: {\n sourceType?: string;\n format?: string;\n minify?: boolean;\n externals?: string[];\n target?: string;\n },\n): string {\n const sourceHash = hashContent(source);\n const optionsHash = hashContent(\n JSON.stringify({\n sourceType: options.sourceType,\n format: options.format,\n minify: options.minify,\n externals: options.externals?.sort(),\n target: options.target,\n }),\n );\n\n return `${sourceHash}-${optionsHash}`;\n}\n"]}
@@ -1,41 +0,0 @@
1
- /**
2
- * In-Memory Bundler Module
3
- *
4
- * Provides fast, secure bundling for JSX/TSX/MDX sources.
5
- * Used for building widget templates at both build-time and runtime.
6
- *
7
- * Features:
8
- * - esbuild-based transformation (fallback to SWC)
9
- * - Content-addressable caching
10
- * - Security validation and sandboxing
11
- * - SSR support for React components
12
- *
13
- * @example
14
- * ```typescript
15
- * import { createBundler } from '@frontmcp/ui/bundler';
16
- *
17
- * const bundler = createBundler();
18
- *
19
- * // Bundle JSX source
20
- * const result = await bundler.bundle({
21
- * source: 'const App = () => <div>Hello</div>; export default App;',
22
- * sourceType: 'jsx',
23
- * });
24
- *
25
- * // SSR rendering
26
- * const ssrResult = await bundler.bundleSSR({
27
- * source: 'export default ({ data }) => <div>{data.message}</div>',
28
- * context: { data: { message: 'Hello' } },
29
- * });
30
- * ```
31
- *
32
- * @packageDocumentation
33
- */
34
- export { InMemoryBundler, createBundler, SecurityError, ExecutionError } from './bundler';
35
- export type { SourceType, OutputFormat, BundleOptions, SSRBundleOptions, BundlerOptions, BundleResult, SSRResult, BundleMetrics, SecurityPolicy, SecurityViolation, CacheEntry, TransformContext, } from './types';
36
- export { DEFAULT_SECURITY_POLICY, DEFAULT_BUNDLE_OPTIONS, DEFAULT_BUNDLER_OPTIONS, } from './types';
37
- export { BundlerCache, hashContent, createCacheKey } from './cache';
38
- export type { CacheOptions, CacheStats } from './cache';
39
- export { validateSource, validateImports, validateSize, mergePolicy, throwOnViolations } from './sandbox/policy';
40
- export { executeCode, executeDefault, isExecutionError } from './sandbox/executor';
41
- export type { ExecutionContext, ExecutionResult } from './sandbox/executor';
@@ -1,73 +0,0 @@
1
- "use strict";
2
- /**
3
- * In-Memory Bundler Module
4
- *
5
- * Provides fast, secure bundling for JSX/TSX/MDX sources.
6
- * Used for building widget templates at both build-time and runtime.
7
- *
8
- * Features:
9
- * - esbuild-based transformation (fallback to SWC)
10
- * - Content-addressable caching
11
- * - Security validation and sandboxing
12
- * - SSR support for React components
13
- *
14
- * @example
15
- * ```typescript
16
- * import { createBundler } from '@frontmcp/ui/bundler';
17
- *
18
- * const bundler = createBundler();
19
- *
20
- * // Bundle JSX source
21
- * const result = await bundler.bundle({
22
- * source: 'const App = () => <div>Hello</div>; export default App;',
23
- * sourceType: 'jsx',
24
- * });
25
- *
26
- * // SSR rendering
27
- * const ssrResult = await bundler.bundleSSR({
28
- * source: 'export default ({ data }) => <div>{data.message}</div>',
29
- * context: { data: { message: 'Hello' } },
30
- * });
31
- * ```
32
- *
33
- * @packageDocumentation
34
- */
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.isExecutionError = exports.executeDefault = exports.executeCode = exports.throwOnViolations = exports.mergePolicy = exports.validateSize = exports.validateImports = exports.validateSource = exports.createCacheKey = exports.hashContent = exports.BundlerCache = exports.DEFAULT_BUNDLER_OPTIONS = exports.DEFAULT_BUNDLE_OPTIONS = exports.DEFAULT_SECURITY_POLICY = exports.ExecutionError = exports.SecurityError = exports.createBundler = exports.InMemoryBundler = void 0;
37
- // ============================================
38
- // Main Bundler
39
- // ============================================
40
- var bundler_1 = require("./bundler");
41
- Object.defineProperty(exports, "InMemoryBundler", { enumerable: true, get: function () { return bundler_1.InMemoryBundler; } });
42
- Object.defineProperty(exports, "createBundler", { enumerable: true, get: function () { return bundler_1.createBundler; } });
43
- Object.defineProperty(exports, "SecurityError", { enumerable: true, get: function () { return bundler_1.SecurityError; } });
44
- Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return bundler_1.ExecutionError; } });
45
- var types_1 = require("./types");
46
- // Default values
47
- Object.defineProperty(exports, "DEFAULT_SECURITY_POLICY", { enumerable: true, get: function () { return types_1.DEFAULT_SECURITY_POLICY; } });
48
- Object.defineProperty(exports, "DEFAULT_BUNDLE_OPTIONS", { enumerable: true, get: function () { return types_1.DEFAULT_BUNDLE_OPTIONS; } });
49
- Object.defineProperty(exports, "DEFAULT_BUNDLER_OPTIONS", { enumerable: true, get: function () { return types_1.DEFAULT_BUNDLER_OPTIONS; } });
50
- // ============================================
51
- // Cache Utilities
52
- // ============================================
53
- var cache_1 = require("./cache");
54
- Object.defineProperty(exports, "BundlerCache", { enumerable: true, get: function () { return cache_1.BundlerCache; } });
55
- Object.defineProperty(exports, "hashContent", { enumerable: true, get: function () { return cache_1.hashContent; } });
56
- Object.defineProperty(exports, "createCacheKey", { enumerable: true, get: function () { return cache_1.createCacheKey; } });
57
- // ============================================
58
- // Security Utilities
59
- // ============================================
60
- var policy_1 = require("./sandbox/policy");
61
- Object.defineProperty(exports, "validateSource", { enumerable: true, get: function () { return policy_1.validateSource; } });
62
- Object.defineProperty(exports, "validateImports", { enumerable: true, get: function () { return policy_1.validateImports; } });
63
- Object.defineProperty(exports, "validateSize", { enumerable: true, get: function () { return policy_1.validateSize; } });
64
- Object.defineProperty(exports, "mergePolicy", { enumerable: true, get: function () { return policy_1.mergePolicy; } });
65
- Object.defineProperty(exports, "throwOnViolations", { enumerable: true, get: function () { return policy_1.throwOnViolations; } });
66
- // ============================================
67
- // Execution Utilities
68
- // ============================================
69
- var executor_1 = require("./sandbox/executor");
70
- Object.defineProperty(exports, "executeCode", { enumerable: true, get: function () { return executor_1.executeCode; } });
71
- Object.defineProperty(exports, "executeDefault", { enumerable: true, get: function () { return executor_1.executeDefault; } });
72
- Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return executor_1.isExecutionError; } });
73
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bundler/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAEH,+CAA+C;AAC/C,eAAe;AACf,+CAA+C;AAE/C,qCAA0F;AAAjF,0GAAA,eAAe,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,wGAAA,aAAa,OAAA;AAAE,yGAAA,cAAc,OAAA;AA2BtE,iCAKiB;AAJf,iBAAiB;AACjB,gHAAA,uBAAuB,OAAA;AACvB,+GAAA,sBAAsB,OAAA;AACtB,gHAAA,uBAAuB,OAAA;AAGzB,+CAA+C;AAC/C,kBAAkB;AAClB,+CAA+C;AAE/C,iCAAoE;AAA3D,qGAAA,YAAY,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,uGAAA,cAAc,OAAA;AAIlD,+CAA+C;AAC/C,qBAAqB;AACrB,+CAA+C;AAE/C,2CAAiH;AAAxG,wGAAA,cAAc,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAEtF,+CAA+C;AAC/C,sBAAsB;AACtB,+CAA+C;AAE/C,+CAAmF;AAA1E,uGAAA,WAAW,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,4GAAA,gBAAgB,OAAA","sourcesContent":["/**\n * In-Memory Bundler Module\n *\n * Provides fast, secure bundling for JSX/TSX/MDX sources.\n * Used for building widget templates at both build-time and runtime.\n *\n * Features:\n * - esbuild-based transformation (fallback to SWC)\n * - Content-addressable caching\n * - Security validation and sandboxing\n * - SSR support for React components\n *\n * @example\n * ```typescript\n * import { createBundler } from '@frontmcp/ui/bundler';\n *\n * const bundler = createBundler();\n *\n * // Bundle JSX source\n * const result = await bundler.bundle({\n * source: 'const App = () => <div>Hello</div>; export default App;',\n * sourceType: 'jsx',\n * });\n *\n * // SSR rendering\n * const ssrResult = await bundler.bundleSSR({\n * source: 'export default ({ data }) => <div>{data.message}</div>',\n * context: { data: { message: 'Hello' } },\n * });\n * ```\n *\n * @packageDocumentation\n */\n\n// ============================================\n// Main Bundler\n// ============================================\n\nexport { InMemoryBundler, createBundler, SecurityError, ExecutionError } from './bundler';\n\n// ============================================\n// Types\n// ============================================\n\nexport type {\n // Source types\n SourceType,\n OutputFormat,\n // Bundle options\n BundleOptions,\n SSRBundleOptions,\n BundlerOptions,\n // Results\n BundleResult,\n SSRResult,\n BundleMetrics,\n // Security\n SecurityPolicy,\n SecurityViolation,\n // Cache\n CacheEntry,\n // Context\n TransformContext,\n} from './types';\n\nexport {\n // Default values\n DEFAULT_SECURITY_POLICY,\n DEFAULT_BUNDLE_OPTIONS,\n DEFAULT_BUNDLER_OPTIONS,\n} from './types';\n\n// ============================================\n// Cache Utilities\n// ============================================\n\nexport { BundlerCache, hashContent, createCacheKey } from './cache';\n\nexport type { CacheOptions, CacheStats } from './cache';\n\n// ============================================\n// Security Utilities\n// ============================================\n\nexport { validateSource, validateImports, validateSize, mergePolicy, throwOnViolations } from './sandbox/policy';\n\n// ============================================\n// Execution Utilities\n// ============================================\n\nexport { executeCode, executeDefault, isExecutionError } from './sandbox/executor';\n\nexport type { ExecutionContext, ExecutionResult } from './sandbox/executor';\n"]}