@frontmcp/uipack 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/CLAUDE.md +246 -0
  2. package/LICENSE +201 -0
  3. package/README.md +150 -0
  4. package/adapters/index.d.ts +13 -0
  5. package/adapters/index.d.ts.map +1 -0
  6. package/adapters/index.js +462 -0
  7. package/adapters/platform-meta.d.ts +166 -0
  8. package/adapters/platform-meta.d.ts.map +1 -0
  9. package/adapters/response-builder.d.ts +108 -0
  10. package/adapters/response-builder.d.ts.map +1 -0
  11. package/adapters/serving-mode.d.ts +107 -0
  12. package/adapters/serving-mode.d.ts.map +1 -0
  13. package/base-template/bridge.d.ts +90 -0
  14. package/base-template/bridge.d.ts.map +1 -0
  15. package/base-template/default-base-template.d.ts +92 -0
  16. package/base-template/default-base-template.d.ts.map +1 -0
  17. package/base-template/index.d.ts +15 -0
  18. package/base-template/index.d.ts.map +1 -0
  19. package/base-template/index.js +1398 -0
  20. package/base-template/polyfills.d.ts +31 -0
  21. package/base-template/polyfills.d.ts.map +1 -0
  22. package/base-template/theme-styles.d.ts +74 -0
  23. package/base-template/theme-styles.d.ts.map +1 -0
  24. package/bridge-runtime/iife-generator.d.ts +62 -0
  25. package/bridge-runtime/iife-generator.d.ts.map +1 -0
  26. package/bridge-runtime/index.d.ts +10 -0
  27. package/bridge-runtime/index.d.ts.map +1 -0
  28. package/bridge-runtime/index.js +883 -0
  29. package/build/cdn-resources.d.ts +243 -0
  30. package/build/cdn-resources.d.ts.map +1 -0
  31. package/build/index.d.ts +295 -0
  32. package/build/index.d.ts.map +1 -0
  33. package/build/index.js +6861 -0
  34. package/build/widget-manifest.d.ts +362 -0
  35. package/build/widget-manifest.d.ts.map +1 -0
  36. package/bundler/cache.d.ts +173 -0
  37. package/bundler/cache.d.ts.map +1 -0
  38. package/bundler/file-cache/component-builder.d.ts +167 -0
  39. package/bundler/file-cache/component-builder.d.ts.map +1 -0
  40. package/bundler/file-cache/hash-calculator.d.ts +155 -0
  41. package/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  42. package/bundler/file-cache/index.d.ts +12 -0
  43. package/bundler/file-cache/index.d.ts.map +1 -0
  44. package/bundler/file-cache/storage/filesystem.d.ts +149 -0
  45. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  46. package/bundler/file-cache/storage/index.d.ts +11 -0
  47. package/bundler/file-cache/storage/index.d.ts.map +1 -0
  48. package/bundler/file-cache/storage/interface.d.ts +152 -0
  49. package/bundler/file-cache/storage/interface.d.ts.map +1 -0
  50. package/bundler/file-cache/storage/redis.d.ts +139 -0
  51. package/bundler/file-cache/storage/redis.d.ts.map +1 -0
  52. package/bundler/index.d.ts +35 -0
  53. package/bundler/index.d.ts.map +1 -0
  54. package/bundler/index.js +2947 -0
  55. package/bundler/sandbox/enclave-adapter.d.ts +121 -0
  56. package/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  57. package/bundler/sandbox/executor.d.ts +14 -0
  58. package/bundler/sandbox/executor.d.ts.map +1 -0
  59. package/bundler/sandbox/policy.d.ts +62 -0
  60. package/bundler/sandbox/policy.d.ts.map +1 -0
  61. package/bundler/types.d.ts +702 -0
  62. package/bundler/types.d.ts.map +1 -0
  63. package/dependency/cdn-registry.d.ts +98 -0
  64. package/dependency/cdn-registry.d.ts.map +1 -0
  65. package/dependency/import-map.d.ts +186 -0
  66. package/dependency/import-map.d.ts.map +1 -0
  67. package/dependency/import-parser.d.ts +82 -0
  68. package/dependency/import-parser.d.ts.map +1 -0
  69. package/dependency/index.d.ts +17 -0
  70. package/dependency/index.d.ts.map +1 -0
  71. package/dependency/index.js +3215 -0
  72. package/dependency/resolver.d.ts +164 -0
  73. package/dependency/resolver.d.ts.map +1 -0
  74. package/dependency/schemas.d.ts +486 -0
  75. package/dependency/schemas.d.ts.map +1 -0
  76. package/dependency/template-loader.d.ts +204 -0
  77. package/dependency/template-loader.d.ts.map +1 -0
  78. package/dependency/template-processor.d.ts +118 -0
  79. package/dependency/template-processor.d.ts.map +1 -0
  80. package/dependency/types.d.ts +739 -0
  81. package/dependency/types.d.ts.map +1 -0
  82. package/esm/adapters/index.d.ts +13 -0
  83. package/esm/adapters/index.d.ts.map +1 -0
  84. package/esm/adapters/index.js +427 -0
  85. package/esm/adapters/platform-meta.d.ts +166 -0
  86. package/esm/adapters/platform-meta.d.ts.map +1 -0
  87. package/esm/adapters/response-builder.d.ts +108 -0
  88. package/esm/adapters/response-builder.d.ts.map +1 -0
  89. package/esm/adapters/serving-mode.d.ts +107 -0
  90. package/esm/adapters/serving-mode.d.ts.map +1 -0
  91. package/esm/base-template/bridge.d.ts +90 -0
  92. package/esm/base-template/bridge.d.ts.map +1 -0
  93. package/esm/base-template/default-base-template.d.ts +92 -0
  94. package/esm/base-template/default-base-template.d.ts.map +1 -0
  95. package/esm/base-template/index.d.ts +15 -0
  96. package/esm/base-template/index.d.ts.map +1 -0
  97. package/esm/base-template/index.js +1364 -0
  98. package/esm/base-template/polyfills.d.ts +31 -0
  99. package/esm/base-template/polyfills.d.ts.map +1 -0
  100. package/esm/base-template/theme-styles.d.ts +74 -0
  101. package/esm/base-template/theme-styles.d.ts.map +1 -0
  102. package/esm/bridge-runtime/iife-generator.d.ts +62 -0
  103. package/esm/bridge-runtime/iife-generator.d.ts.map +1 -0
  104. package/esm/bridge-runtime/index.d.ts +10 -0
  105. package/esm/bridge-runtime/index.d.ts.map +1 -0
  106. package/esm/bridge-runtime/index.js +853 -0
  107. package/esm/build/cdn-resources.d.ts +243 -0
  108. package/esm/build/cdn-resources.d.ts.map +1 -0
  109. package/esm/build/index.d.ts +295 -0
  110. package/esm/build/index.d.ts.map +1 -0
  111. package/esm/build/index.js +6786 -0
  112. package/esm/build/widget-manifest.d.ts +362 -0
  113. package/esm/build/widget-manifest.d.ts.map +1 -0
  114. package/esm/bundler/cache.d.ts +173 -0
  115. package/esm/bundler/cache.d.ts.map +1 -0
  116. package/esm/bundler/file-cache/component-builder.d.ts +167 -0
  117. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -0
  118. package/esm/bundler/file-cache/hash-calculator.d.ts +155 -0
  119. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -0
  120. package/esm/bundler/file-cache/index.d.ts +12 -0
  121. package/esm/bundler/file-cache/index.d.ts.map +1 -0
  122. package/esm/bundler/file-cache/storage/filesystem.d.ts +149 -0
  123. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -0
  124. package/esm/bundler/file-cache/storage/index.d.ts +11 -0
  125. package/esm/bundler/file-cache/storage/index.d.ts.map +1 -0
  126. package/esm/bundler/file-cache/storage/interface.d.ts +152 -0
  127. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -0
  128. package/esm/bundler/file-cache/storage/redis.d.ts +139 -0
  129. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -0
  130. package/esm/bundler/index.d.ts +35 -0
  131. package/esm/bundler/index.d.ts.map +1 -0
  132. package/esm/bundler/index.js +2882 -0
  133. package/esm/bundler/sandbox/enclave-adapter.d.ts +121 -0
  134. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +1 -0
  135. package/esm/bundler/sandbox/executor.d.ts +14 -0
  136. package/esm/bundler/sandbox/executor.d.ts.map +1 -0
  137. package/esm/bundler/sandbox/policy.d.ts +62 -0
  138. package/esm/bundler/sandbox/policy.d.ts.map +1 -0
  139. package/esm/bundler/types.d.ts +702 -0
  140. package/esm/bundler/types.d.ts.map +1 -0
  141. package/esm/dependency/cdn-registry.d.ts +98 -0
  142. package/esm/dependency/cdn-registry.d.ts.map +1 -0
  143. package/esm/dependency/import-map.d.ts +186 -0
  144. package/esm/dependency/import-map.d.ts.map +1 -0
  145. package/esm/dependency/import-parser.d.ts +82 -0
  146. package/esm/dependency/import-parser.d.ts.map +1 -0
  147. package/esm/dependency/index.d.ts +17 -0
  148. package/esm/dependency/index.d.ts.map +1 -0
  149. package/esm/dependency/index.js +3096 -0
  150. package/esm/dependency/resolver.d.ts +164 -0
  151. package/esm/dependency/resolver.d.ts.map +1 -0
  152. package/esm/dependency/schemas.d.ts +486 -0
  153. package/esm/dependency/schemas.d.ts.map +1 -0
  154. package/esm/dependency/template-loader.d.ts +204 -0
  155. package/esm/dependency/template-loader.d.ts.map +1 -0
  156. package/esm/dependency/template-processor.d.ts +118 -0
  157. package/esm/dependency/template-processor.d.ts.map +1 -0
  158. package/esm/dependency/types.d.ts +739 -0
  159. package/esm/dependency/types.d.ts.map +1 -0
  160. package/esm/handlebars/expression-extractor.d.ts +147 -0
  161. package/esm/handlebars/expression-extractor.d.ts.map +1 -0
  162. package/esm/handlebars/helpers.d.ts +339 -0
  163. package/esm/handlebars/helpers.d.ts.map +1 -0
  164. package/esm/handlebars/index.d.ts +195 -0
  165. package/esm/handlebars/index.d.ts.map +1 -0
  166. package/esm/handlebars/index.js +587 -0
  167. package/esm/index.d.ts +50 -0
  168. package/esm/index.d.ts.map +1 -0
  169. package/esm/index.js +12434 -0
  170. package/esm/package.json +68 -0
  171. package/esm/registry/index.d.ts +46 -0
  172. package/esm/registry/index.d.ts.map +1 -0
  173. package/esm/registry/index.js +6237 -0
  174. package/esm/registry/render-template.d.ts +91 -0
  175. package/esm/registry/render-template.d.ts.map +1 -0
  176. package/esm/registry/tool-ui.registry.d.ts +294 -0
  177. package/esm/registry/tool-ui.registry.d.ts.map +1 -0
  178. package/esm/registry/uri-utils.d.ts +56 -0
  179. package/esm/registry/uri-utils.d.ts.map +1 -0
  180. package/esm/renderers/cache.d.ts +145 -0
  181. package/esm/renderers/cache.d.ts.map +1 -0
  182. package/esm/renderers/html.renderer.d.ts +123 -0
  183. package/esm/renderers/html.renderer.d.ts.map +1 -0
  184. package/esm/renderers/index.d.ts +36 -0
  185. package/esm/renderers/index.d.ts.map +1 -0
  186. package/esm/renderers/index.js +1654 -0
  187. package/esm/renderers/mdx.renderer.d.ts +120 -0
  188. package/esm/renderers/mdx.renderer.d.ts.map +1 -0
  189. package/esm/renderers/registry.d.ts +133 -0
  190. package/esm/renderers/registry.d.ts.map +1 -0
  191. package/esm/renderers/types.d.ts +342 -0
  192. package/esm/renderers/types.d.ts.map +1 -0
  193. package/esm/renderers/utils/detect.d.ts +107 -0
  194. package/esm/renderers/utils/detect.d.ts.map +1 -0
  195. package/esm/renderers/utils/hash.d.ts +40 -0
  196. package/esm/renderers/utils/hash.d.ts.map +1 -0
  197. package/esm/renderers/utils/index.d.ts +9 -0
  198. package/esm/renderers/utils/index.d.ts.map +1 -0
  199. package/esm/renderers/utils/transpiler.d.ts +89 -0
  200. package/esm/renderers/utils/transpiler.d.ts.map +1 -0
  201. package/esm/runtime/adapters/html.adapter.d.ts +59 -0
  202. package/esm/runtime/adapters/html.adapter.d.ts.map +1 -0
  203. package/esm/runtime/adapters/index.d.ts +26 -0
  204. package/esm/runtime/adapters/index.d.ts.map +1 -0
  205. package/esm/runtime/adapters/mdx.adapter.d.ts +73 -0
  206. package/esm/runtime/adapters/mdx.adapter.d.ts.map +1 -0
  207. package/esm/runtime/adapters/types.d.ts +95 -0
  208. package/esm/runtime/adapters/types.d.ts.map +1 -0
  209. package/esm/runtime/csp.d.ts +48 -0
  210. package/esm/runtime/csp.d.ts.map +1 -0
  211. package/esm/runtime/index.d.ts +17 -0
  212. package/esm/runtime/index.d.ts.map +1 -0
  213. package/esm/runtime/index.js +4976 -0
  214. package/esm/runtime/mcp-bridge.d.ts +101 -0
  215. package/esm/runtime/mcp-bridge.d.ts.map +1 -0
  216. package/esm/runtime/renderer-runtime.d.ts +133 -0
  217. package/esm/runtime/renderer-runtime.d.ts.map +1 -0
  218. package/esm/runtime/sanitizer.d.ts +172 -0
  219. package/esm/runtime/sanitizer.d.ts.map +1 -0
  220. package/esm/runtime/types.d.ts +415 -0
  221. package/esm/runtime/types.d.ts.map +1 -0
  222. package/esm/runtime/wrapper.d.ts +421 -0
  223. package/esm/runtime/wrapper.d.ts.map +1 -0
  224. package/esm/styles/index.d.ts +8 -0
  225. package/esm/styles/index.d.ts.map +1 -0
  226. package/esm/styles/index.js +171 -0
  227. package/esm/styles/variants.d.ts +51 -0
  228. package/esm/styles/variants.d.ts.map +1 -0
  229. package/esm/theme/cdn.d.ts +195 -0
  230. package/esm/theme/cdn.d.ts.map +1 -0
  231. package/esm/theme/index.d.ts +18 -0
  232. package/esm/theme/index.d.ts.map +1 -0
  233. package/esm/theme/index.js +700 -0
  234. package/esm/theme/platforms.d.ts +107 -0
  235. package/esm/theme/platforms.d.ts.map +1 -0
  236. package/esm/theme/presets/github-openai.d.ts +50 -0
  237. package/esm/theme/presets/github-openai.d.ts.map +1 -0
  238. package/esm/theme/presets/index.d.ts +11 -0
  239. package/esm/theme/presets/index.d.ts.map +1 -0
  240. package/esm/theme/theme.d.ts +396 -0
  241. package/esm/theme/theme.d.ts.map +1 -0
  242. package/esm/tool-template/builder.d.ts +213 -0
  243. package/esm/tool-template/builder.d.ts.map +1 -0
  244. package/esm/tool-template/index.d.ts +16 -0
  245. package/esm/tool-template/index.d.ts.map +1 -0
  246. package/esm/tool-template/index.js +3518 -0
  247. package/esm/types/index.d.ts +14 -0
  248. package/esm/types/index.d.ts.map +1 -0
  249. package/esm/types/index.js +75 -0
  250. package/esm/types/ui-config.d.ts +641 -0
  251. package/esm/types/ui-config.d.ts.map +1 -0
  252. package/esm/types/ui-runtime.d.ts +1008 -0
  253. package/esm/types/ui-runtime.d.ts.map +1 -0
  254. package/esm/typings/cache/cache-adapter.d.ts +125 -0
  255. package/esm/typings/cache/cache-adapter.d.ts.map +1 -0
  256. package/esm/typings/cache/index.d.ts +10 -0
  257. package/esm/typings/cache/index.d.ts.map +1 -0
  258. package/esm/typings/cache/memory-cache.d.ts +92 -0
  259. package/esm/typings/cache/memory-cache.d.ts.map +1 -0
  260. package/esm/typings/dts-parser.d.ts +90 -0
  261. package/esm/typings/dts-parser.d.ts.map +1 -0
  262. package/esm/typings/index.d.ts +48 -0
  263. package/esm/typings/index.d.ts.map +1 -0
  264. package/esm/typings/index.js +812 -0
  265. package/esm/typings/schemas.d.ts +232 -0
  266. package/esm/typings/schemas.d.ts.map +1 -0
  267. package/esm/typings/type-fetcher.d.ts +89 -0
  268. package/esm/typings/type-fetcher.d.ts.map +1 -0
  269. package/esm/typings/types.d.ts +320 -0
  270. package/esm/typings/types.d.ts.map +1 -0
  271. package/esm/utils/escape-html.d.ts +58 -0
  272. package/esm/utils/escape-html.d.ts.map +1 -0
  273. package/esm/utils/index.d.ts +10 -0
  274. package/esm/utils/index.d.ts.map +1 -0
  275. package/esm/utils/index.js +40 -0
  276. package/esm/utils/safe-stringify.d.ts +30 -0
  277. package/esm/utils/safe-stringify.d.ts.map +1 -0
  278. package/esm/validation/error-box.d.ts +56 -0
  279. package/esm/validation/error-box.d.ts.map +1 -0
  280. package/esm/validation/index.d.ts +13 -0
  281. package/esm/validation/index.d.ts.map +1 -0
  282. package/esm/validation/index.js +542 -0
  283. package/esm/validation/schema-paths.d.ts +118 -0
  284. package/esm/validation/schema-paths.d.ts.map +1 -0
  285. package/esm/validation/template-validator.d.ts +143 -0
  286. package/esm/validation/template-validator.d.ts.map +1 -0
  287. package/esm/validation/wrapper.d.ts +97 -0
  288. package/esm/validation/wrapper.d.ts.map +1 -0
  289. package/handlebars/expression-extractor.d.ts +147 -0
  290. package/handlebars/expression-extractor.d.ts.map +1 -0
  291. package/handlebars/helpers.d.ts +339 -0
  292. package/handlebars/helpers.d.ts.map +1 -0
  293. package/handlebars/index.d.ts +195 -0
  294. package/handlebars/index.d.ts.map +1 -0
  295. package/handlebars/index.js +666 -0
  296. package/index.d.ts +50 -0
  297. package/index.d.ts.map +1 -0
  298. package/index.js +12683 -0
  299. package/package.json +66 -0
  300. package/registry/index.d.ts +46 -0
  301. package/registry/index.d.ts.map +1 -0
  302. package/registry/index.js +6280 -0
  303. package/registry/render-template.d.ts +91 -0
  304. package/registry/render-template.d.ts.map +1 -0
  305. package/registry/tool-ui.registry.d.ts +294 -0
  306. package/registry/tool-ui.registry.d.ts.map +1 -0
  307. package/registry/uri-utils.d.ts +56 -0
  308. package/registry/uri-utils.d.ts.map +1 -0
  309. package/renderers/cache.d.ts +145 -0
  310. package/renderers/cache.d.ts.map +1 -0
  311. package/renderers/html.renderer.d.ts +123 -0
  312. package/renderers/html.renderer.d.ts.map +1 -0
  313. package/renderers/index.d.ts +36 -0
  314. package/renderers/index.d.ts.map +1 -0
  315. package/renderers/index.js +1706 -0
  316. package/renderers/mdx.renderer.d.ts +120 -0
  317. package/renderers/mdx.renderer.d.ts.map +1 -0
  318. package/renderers/registry.d.ts +133 -0
  319. package/renderers/registry.d.ts.map +1 -0
  320. package/renderers/types.d.ts +342 -0
  321. package/renderers/types.d.ts.map +1 -0
  322. package/renderers/utils/detect.d.ts +107 -0
  323. package/renderers/utils/detect.d.ts.map +1 -0
  324. package/renderers/utils/hash.d.ts +40 -0
  325. package/renderers/utils/hash.d.ts.map +1 -0
  326. package/renderers/utils/index.d.ts +9 -0
  327. package/renderers/utils/index.d.ts.map +1 -0
  328. package/renderers/utils/transpiler.d.ts +89 -0
  329. package/renderers/utils/transpiler.d.ts.map +1 -0
  330. package/runtime/adapters/html.adapter.d.ts +59 -0
  331. package/runtime/adapters/html.adapter.d.ts.map +1 -0
  332. package/runtime/adapters/index.d.ts +26 -0
  333. package/runtime/adapters/index.d.ts.map +1 -0
  334. package/runtime/adapters/mdx.adapter.d.ts +73 -0
  335. package/runtime/adapters/mdx.adapter.d.ts.map +1 -0
  336. package/runtime/adapters/types.d.ts +95 -0
  337. package/runtime/adapters/types.d.ts.map +1 -0
  338. package/runtime/csp.d.ts +48 -0
  339. package/runtime/csp.d.ts.map +1 -0
  340. package/runtime/index.d.ts +17 -0
  341. package/runtime/index.d.ts.map +1 -0
  342. package/runtime/index.js +5052 -0
  343. package/runtime/mcp-bridge.d.ts +101 -0
  344. package/runtime/mcp-bridge.d.ts.map +1 -0
  345. package/runtime/renderer-runtime.d.ts +133 -0
  346. package/runtime/renderer-runtime.d.ts.map +1 -0
  347. package/runtime/sanitizer.d.ts +172 -0
  348. package/runtime/sanitizer.d.ts.map +1 -0
  349. package/runtime/types.d.ts +415 -0
  350. package/runtime/types.d.ts.map +1 -0
  351. package/runtime/wrapper.d.ts +421 -0
  352. package/runtime/wrapper.d.ts.map +1 -0
  353. package/styles/index.d.ts +8 -0
  354. package/styles/index.d.ts.map +1 -0
  355. package/styles/index.js +222 -0
  356. package/styles/variants.d.ts +51 -0
  357. package/styles/variants.d.ts.map +1 -0
  358. package/theme/cdn.d.ts +195 -0
  359. package/theme/cdn.d.ts.map +1 -0
  360. package/theme/index.d.ts +18 -0
  361. package/theme/index.d.ts.map +1 -0
  362. package/theme/index.js +757 -0
  363. package/theme/platforms.d.ts +107 -0
  364. package/theme/platforms.d.ts.map +1 -0
  365. package/theme/presets/github-openai.d.ts +50 -0
  366. package/theme/presets/github-openai.d.ts.map +1 -0
  367. package/theme/presets/index.d.ts +11 -0
  368. package/theme/presets/index.d.ts.map +1 -0
  369. package/theme/theme.d.ts +396 -0
  370. package/theme/theme.d.ts.map +1 -0
  371. package/tool-template/builder.d.ts +213 -0
  372. package/tool-template/builder.d.ts.map +1 -0
  373. package/tool-template/index.d.ts +16 -0
  374. package/tool-template/index.d.ts.map +1 -0
  375. package/tool-template/index.js +3562 -0
  376. package/types/index.d.ts +14 -0
  377. package/types/index.d.ts.map +1 -0
  378. package/types/index.js +108 -0
  379. package/types/ui-config.d.ts +641 -0
  380. package/types/ui-config.d.ts.map +1 -0
  381. package/types/ui-runtime.d.ts +1008 -0
  382. package/types/ui-runtime.d.ts.map +1 -0
  383. package/typings/cache/cache-adapter.d.ts +125 -0
  384. package/typings/cache/cache-adapter.d.ts.map +1 -0
  385. package/typings/cache/index.d.ts +10 -0
  386. package/typings/cache/index.d.ts.map +1 -0
  387. package/typings/cache/memory-cache.d.ts +92 -0
  388. package/typings/cache/memory-cache.d.ts.map +1 -0
  389. package/typings/dts-parser.d.ts +90 -0
  390. package/typings/dts-parser.d.ts.map +1 -0
  391. package/typings/index.d.ts +48 -0
  392. package/typings/index.d.ts.map +1 -0
  393. package/typings/index.js +868 -0
  394. package/typings/schemas.d.ts +232 -0
  395. package/typings/schemas.d.ts.map +1 -0
  396. package/typings/type-fetcher.d.ts +89 -0
  397. package/typings/type-fetcher.d.ts.map +1 -0
  398. package/typings/types.d.ts +320 -0
  399. package/typings/types.d.ts.map +1 -0
  400. package/utils/escape-html.d.ts +58 -0
  401. package/utils/escape-html.d.ts.map +1 -0
  402. package/utils/index.d.ts +10 -0
  403. package/utils/index.d.ts.map +1 -0
  404. package/utils/index.js +70 -0
  405. package/utils/safe-stringify.d.ts +30 -0
  406. package/utils/safe-stringify.d.ts.map +1 -0
  407. package/validation/error-box.d.ts +56 -0
  408. package/validation/error-box.d.ts.map +1 -0
  409. package/validation/index.d.ts +13 -0
  410. package/validation/index.d.ts.map +1 -0
  411. package/validation/index.js +583 -0
  412. package/validation/schema-paths.d.ts +118 -0
  413. package/validation/schema-paths.d.ts.map +1 -0
  414. package/validation/template-validator.d.ts +143 -0
  415. package/validation/template-validator.d.ts.map +1 -0
  416. package/validation/wrapper.d.ts +97 -0
  417. package/validation/wrapper.d.ts.map +1 -0
@@ -0,0 +1,700 @@
1
+ // libs/uipack/src/theme/cdn.ts
2
+ var CDN = {
3
+ /**
4
+ * Tailwind CSS v4 Browser CDN
5
+ * Generates styles on-the-fly with @theme support
6
+ * @see https://tailwindcss.com/docs/installation/play-cdn
7
+ */
8
+ tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
9
+ /**
10
+ * HTMX 2.x - High power tools for HTML
11
+ * Enables AJAX, WebSockets, Server Sent Events directly in HTML
12
+ * @see https://htmx.org
13
+ */
14
+ htmx: {
15
+ url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
16
+ integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
17
+ },
18
+ /**
19
+ * Alpine.js - Lightweight reactive framework
20
+ * Used for more complex client-side interactions
21
+ * @see https://alpinejs.dev
22
+ */
23
+ alpine: {
24
+ url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
25
+ integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
26
+ },
27
+ /**
28
+ * Google Fonts - Inter for modern UI typography
29
+ */
30
+ fonts: {
31
+ preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
32
+ inter: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
33
+ mono: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"
34
+ },
35
+ /**
36
+ * Lucide Icons - Beautiful & consistent icons
37
+ * @see https://lucide.dev
38
+ */
39
+ icons: {
40
+ url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js",
41
+ integrity: "sha384-wpLmHb7v7V1LsEuTmPQ9tXqWZvTtRWWVqJuE+Yz6X0I6O2T6bHJVeXH1lVWqF4qE"
42
+ }
43
+ };
44
+ var scriptCache = /* @__PURE__ */ new Map();
45
+ async function fetchScript(url) {
46
+ if (scriptCache.has(url)) {
47
+ return scriptCache.get(url);
48
+ }
49
+ const response = await fetch(url);
50
+ if (!response.ok) {
51
+ throw new Error(`Failed to fetch script: ${url} (${response.status})`);
52
+ }
53
+ const content = await response.text();
54
+ scriptCache.set(url, content);
55
+ return content;
56
+ }
57
+ async function fetchAndCacheScripts(options = {}) {
58
+ const { tailwind = true, htmx = true, alpine = false, icons = false } = options;
59
+ const urls = [];
60
+ if (tailwind) urls.push(CDN.tailwind);
61
+ if (htmx) urls.push(CDN.htmx.url);
62
+ if (alpine) urls.push(CDN.alpine.url);
63
+ if (icons) urls.push(CDN.icons.url);
64
+ await Promise.all(urls.map(fetchScript));
65
+ return scriptCache;
66
+ }
67
+ function getCachedScript(url) {
68
+ return scriptCache.get(url);
69
+ }
70
+ function isScriptCached(url) {
71
+ return scriptCache.has(url);
72
+ }
73
+ function clearScriptCache() {
74
+ scriptCache.clear();
75
+ }
76
+ function buildFontPreconnect() {
77
+ return CDN.fonts.preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
78
+ }
79
+ function buildFontStylesheets(options = {}) {
80
+ const { inter = true, mono = false } = options;
81
+ const links = [];
82
+ if (inter) {
83
+ links.push(`<link href="${CDN.fonts.inter}" rel="stylesheet">`);
84
+ }
85
+ if (mono) {
86
+ links.push(`<link href="${CDN.fonts.mono}" rel="stylesheet">`);
87
+ }
88
+ return links.join("\n ");
89
+ }
90
+ function buildScriptTag(url, integrity, options = {}) {
91
+ const attrs = [`src="${url}"`];
92
+ if (integrity) {
93
+ attrs.push(`integrity="${integrity}"`);
94
+ attrs.push('crossorigin="anonymous"');
95
+ }
96
+ if (options.defer) attrs.push("defer");
97
+ if (options.async) attrs.push("async");
98
+ return `<script ${attrs.join(" ")}></script>`;
99
+ }
100
+ function buildInlineScriptTag(content) {
101
+ return `<script>${content}</script>`;
102
+ }
103
+ function buildCdnScripts(options = {}) {
104
+ const { tailwind = true, htmx = true, alpine = false, icons = false, inline = false } = options;
105
+ const scripts = [];
106
+ if (inline) {
107
+ if (tailwind) {
108
+ if (isScriptCached(CDN.tailwind)) {
109
+ scripts.push(buildInlineScriptTag(getCachedScript(CDN.tailwind)));
110
+ } else {
111
+ console.warn(
112
+ "[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScripts() first."
113
+ );
114
+ }
115
+ }
116
+ if (htmx) {
117
+ if (isScriptCached(CDN.htmx.url)) {
118
+ scripts.push(buildInlineScriptTag(getCachedScript(CDN.htmx.url)));
119
+ } else {
120
+ console.warn(
121
+ "[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScripts() first."
122
+ );
123
+ }
124
+ }
125
+ if (alpine) {
126
+ if (isScriptCached(CDN.alpine.url)) {
127
+ scripts.push(buildInlineScriptTag(getCachedScript(CDN.alpine.url)));
128
+ } else {
129
+ console.warn(
130
+ "[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScripts() first."
131
+ );
132
+ }
133
+ }
134
+ if (icons) {
135
+ if (isScriptCached(CDN.icons.url)) {
136
+ scripts.push(buildInlineScriptTag(getCachedScript(CDN.icons.url)));
137
+ } else {
138
+ console.warn(
139
+ "[frontmcp/ui] Inline mode requested but Lucide icons script not cached. Call fetchAndCacheScripts() first."
140
+ );
141
+ }
142
+ }
143
+ } else {
144
+ if (tailwind) {
145
+ scripts.push(buildScriptTag(CDN.tailwind));
146
+ }
147
+ if (htmx) {
148
+ scripts.push(buildScriptTag(CDN.htmx.url, CDN.htmx.integrity));
149
+ }
150
+ if (alpine) {
151
+ scripts.push(buildScriptTag(CDN.alpine.url, CDN.alpine.integrity, { defer: true }));
152
+ }
153
+ if (icons) {
154
+ scripts.push(buildScriptTag(CDN.icons.url, CDN.icons.integrity));
155
+ }
156
+ }
157
+ return scripts.join("\n ");
158
+ }
159
+ function buildFontPreconnectFromTheme(theme) {
160
+ const preconnect = theme.cdn?.fonts?.preconnect ?? CDN.fonts.preconnect;
161
+ return preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
162
+ }
163
+ function buildFontStylesheetsFromTheme(theme) {
164
+ const stylesheets = theme.cdn?.fonts?.stylesheets ?? [CDN.fonts.inter];
165
+ return stylesheets.map((url) => `<link href="${url}" rel="stylesheet">`).join("\n ");
166
+ }
167
+ function buildCdnScriptsFromTheme(theme, options = {}) {
168
+ const { tailwind = true, htmx = true, alpine = false, icons = false, inline = false } = options;
169
+ const scripts = [];
170
+ const tailwindUrl = theme.cdn?.scripts?.tailwind ?? CDN.tailwind;
171
+ const htmxConfig = theme.cdn?.scripts?.htmx ?? CDN.htmx;
172
+ const alpineConfig = theme.cdn?.scripts?.alpine ?? CDN.alpine;
173
+ const iconsConfig = theme.cdn?.icons?.script ?? CDN.icons;
174
+ if (inline) {
175
+ if (tailwind) {
176
+ if (isScriptCached(tailwindUrl)) {
177
+ scripts.push(buildInlineScriptTag(getCachedScript(tailwindUrl)));
178
+ } else {
179
+ console.warn(
180
+ "[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScriptsFromTheme() first."
181
+ );
182
+ }
183
+ }
184
+ if (htmx) {
185
+ if (isScriptCached(htmxConfig.url)) {
186
+ scripts.push(buildInlineScriptTag(getCachedScript(htmxConfig.url)));
187
+ } else {
188
+ console.warn(
189
+ "[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScriptsFromTheme() first."
190
+ );
191
+ }
192
+ }
193
+ if (alpine) {
194
+ if (isScriptCached(alpineConfig.url)) {
195
+ scripts.push(buildInlineScriptTag(getCachedScript(alpineConfig.url)));
196
+ } else {
197
+ console.warn(
198
+ "[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScriptsFromTheme() first."
199
+ );
200
+ }
201
+ }
202
+ if (icons) {
203
+ if (isScriptCached(iconsConfig.url)) {
204
+ scripts.push(buildInlineScriptTag(getCachedScript(iconsConfig.url)));
205
+ } else {
206
+ console.warn(
207
+ "[frontmcp/ui] Inline mode requested but icons script not cached. Call fetchAndCacheScriptsFromTheme() first."
208
+ );
209
+ }
210
+ }
211
+ } else {
212
+ if (tailwind) {
213
+ scripts.push(buildScriptTag(tailwindUrl));
214
+ }
215
+ if (htmx) {
216
+ scripts.push(buildScriptTag(htmxConfig.url, htmxConfig.integrity));
217
+ }
218
+ if (alpine) {
219
+ scripts.push(buildScriptTag(alpineConfig.url, alpineConfig.integrity, { defer: true }));
220
+ }
221
+ if (icons) {
222
+ scripts.push(buildScriptTag(iconsConfig.url, iconsConfig.integrity));
223
+ }
224
+ }
225
+ return scripts.join("\n ");
226
+ }
227
+ async function fetchAndCacheScriptsFromTheme(theme, options = {}) {
228
+ const { tailwind = true, htmx = true, alpine = false, icons = false } = options;
229
+ const urls = [];
230
+ const tailwindUrl = theme.cdn?.scripts?.tailwind ?? CDN.tailwind;
231
+ const htmxConfig = theme.cdn?.scripts?.htmx ?? CDN.htmx;
232
+ const alpineConfig = theme.cdn?.scripts?.alpine ?? CDN.alpine;
233
+ const iconsConfig = theme.cdn?.icons?.script ?? CDN.icons;
234
+ if (tailwind) urls.push(tailwindUrl);
235
+ if (htmx) urls.push(htmxConfig.url);
236
+ if (alpine) urls.push(alpineConfig.url);
237
+ if (icons) urls.push(iconsConfig.url);
238
+ await Promise.all(urls.map(fetchScript));
239
+ return scriptCache;
240
+ }
241
+
242
+ // libs/uipack/src/theme/platforms.ts
243
+ var OPENAI_PLATFORM = {
244
+ id: "openai",
245
+ name: "OpenAI",
246
+ supportsWidgets: true,
247
+ supportsTailwind: true,
248
+ supportsHtmx: true,
249
+ networkMode: "full",
250
+ scriptStrategy: "cdn",
251
+ options: {
252
+ sdk: "apps-sdk",
253
+ version: "1.0"
254
+ }
255
+ };
256
+ var CLAUDE_PLATFORM = {
257
+ id: "claude",
258
+ name: "Claude (Artifacts)",
259
+ supportsWidgets: true,
260
+ supportsTailwind: true,
261
+ supportsHtmx: false,
262
+ // Network blocked, HTMX won't work for API calls
263
+ networkMode: "blocked",
264
+ scriptStrategy: "inline",
265
+ maxInlineSize: 100 * 1024,
266
+ // 100KB limit for artifacts
267
+ cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
268
+ options: {
269
+ mode: "artifacts",
270
+ framework: "react"
271
+ // Claude artifacts prefer React
272
+ }
273
+ };
274
+ var GEMINI_PLATFORM = {
275
+ id: "gemini",
276
+ name: "Gemini",
277
+ supportsWidgets: false,
278
+ supportsTailwind: false,
279
+ supportsHtmx: false,
280
+ networkMode: "blocked",
281
+ scriptStrategy: "inline",
282
+ options: {
283
+ fallback: "markdown"
284
+ // Fall back to markdown rendering
285
+ }
286
+ };
287
+ var NGROK_PLATFORM = {
288
+ id: "ngrok",
289
+ name: "Ngrok Tunnel",
290
+ supportsWidgets: true,
291
+ supportsTailwind: true,
292
+ supportsHtmx: true,
293
+ networkMode: "full",
294
+ scriptStrategy: "cdn",
295
+ options: {
296
+ tunnelRequired: true
297
+ }
298
+ };
299
+ var CUSTOM_PLATFORM = {
300
+ id: "custom",
301
+ name: "Custom MCP Client",
302
+ supportsWidgets: true,
303
+ supportsTailwind: true,
304
+ supportsHtmx: true,
305
+ networkMode: "full",
306
+ scriptStrategy: "cdn"
307
+ };
308
+ var PLATFORM_PRESETS = {
309
+ openai: OPENAI_PLATFORM,
310
+ claude: CLAUDE_PLATFORM,
311
+ gemini: GEMINI_PLATFORM,
312
+ ngrok: NGROK_PLATFORM,
313
+ custom: CUSTOM_PLATFORM
314
+ };
315
+ function getPlatform(id) {
316
+ return PLATFORM_PRESETS[id] ?? CUSTOM_PLATFORM;
317
+ }
318
+ function createPlatform(base) {
319
+ const preset = PLATFORM_PRESETS[base.id] ?? CUSTOM_PLATFORM;
320
+ return { ...preset, ...base };
321
+ }
322
+ function canUseCdn(platform) {
323
+ return platform.networkMode === "full" && platform.scriptStrategy === "cdn";
324
+ }
325
+ function needsInlineScripts(platform) {
326
+ return platform.scriptStrategy === "inline" || platform.networkMode === "blocked";
327
+ }
328
+ function supportsFullInteractivity(platform) {
329
+ return platform.supportsWidgets && platform.supportsHtmx && platform.networkMode === "full";
330
+ }
331
+ function getFallbackMode(platform) {
332
+ if (platform.supportsWidgets && platform.supportsTailwind) {
333
+ return "html";
334
+ }
335
+ if (platform.options?.["fallback"] === "markdown") {
336
+ return "markdown";
337
+ }
338
+ return "text";
339
+ }
340
+
341
+ // libs/uipack/src/theme/presets/github-openai.ts
342
+ var GITHUB_OPENAI_THEME = {
343
+ name: "github-openai",
344
+ colors: {
345
+ semantic: {
346
+ // Primary: Near-black for main actions and branding
347
+ primary: "#24292f",
348
+ // Secondary: Medium gray for secondary elements
349
+ secondary: "#57606a",
350
+ // Accent: Blue for links, focus states, and highlights
351
+ accent: "#0969da",
352
+ // Status colors
353
+ success: "#1a7f37",
354
+ // GitHub green
355
+ warning: "#9a6700",
356
+ // Amber warning
357
+ danger: "#cf222e",
358
+ // GitHub red
359
+ info: "#0969da"
360
+ // Blue info
361
+ },
362
+ surface: {
363
+ // Pure white background
364
+ background: "#ffffff",
365
+ // Light gray surface (GitHub code background style)
366
+ surface: "#f6f8fa",
367
+ // White elevated surfaces (modals, cards)
368
+ elevated: "#ffffff",
369
+ // Dark semi-transparent overlay
370
+ overlay: "rgba(27, 31, 36, 0.5)"
371
+ },
372
+ text: {
373
+ // Near-black for primary text
374
+ primary: "#24292f",
375
+ // Gray for secondary/muted text
376
+ secondary: "#57606a",
377
+ // Light gray for disabled text
378
+ disabled: "#8c959f",
379
+ // White for text on dark backgrounds
380
+ inverse: "#ffffff",
381
+ // Blue for links
382
+ link: "#0969da"
383
+ },
384
+ border: {
385
+ // Light gray border (GitHub style)
386
+ default: "#d0d7de",
387
+ // Medium gray on hover
388
+ hover: "#8c959f",
389
+ // Blue focus ring
390
+ focus: "#0969da",
391
+ // Subtle divider
392
+ divider: "#d8dee4"
393
+ }
394
+ },
395
+ typography: {
396
+ families: {
397
+ // System UI font stack (GitHub/Apple style)
398
+ sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
399
+ // Monospace stack
400
+ mono: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace'
401
+ },
402
+ sizes: {
403
+ xs: "0.75rem",
404
+ // 12px
405
+ sm: "0.875rem",
406
+ // 14px
407
+ base: "1rem",
408
+ // 16px
409
+ lg: "1.125rem",
410
+ // 18px
411
+ xl: "1.25rem",
412
+ // 20px
413
+ "2xl": "1.5rem",
414
+ // 24px
415
+ "3xl": "1.875rem",
416
+ // 30px
417
+ "4xl": "2.25rem"
418
+ // 36px
419
+ },
420
+ weights: {
421
+ normal: "400",
422
+ medium: "500",
423
+ semibold: "600",
424
+ bold: "700"
425
+ }
426
+ },
427
+ radius: {
428
+ none: "0",
429
+ sm: "3px",
430
+ // GitHub uses smaller radii
431
+ md: "6px",
432
+ lg: "8px",
433
+ xl: "12px",
434
+ "2xl": "16px",
435
+ full: "9999px"
436
+ },
437
+ shadows: {
438
+ // Subtle shadows with gray tones
439
+ sm: "0 1px 0 rgba(27, 31, 36, 0.04)",
440
+ md: "0 3px 6px rgba(140, 149, 159, 0.15)",
441
+ lg: "0 8px 24px rgba(140, 149, 159, 0.2)",
442
+ xl: "0 12px 28px rgba(140, 149, 159, 0.3)"
443
+ },
444
+ components: {
445
+ button: {
446
+ radius: "6px",
447
+ paddingX: "16px",
448
+ paddingY: "5px",
449
+ fontSize: "14px",
450
+ fontWeight: "500"
451
+ },
452
+ card: {
453
+ radius: "6px",
454
+ padding: "16px",
455
+ shadow: "0 1px 0 rgba(27, 31, 36, 0.04)",
456
+ borderWidth: "1px"
457
+ },
458
+ input: {
459
+ radius: "6px",
460
+ paddingX: "12px",
461
+ paddingY: "5px",
462
+ borderWidth: "1px",
463
+ focusRingWidth: "3px"
464
+ }
465
+ },
466
+ cdn: {
467
+ fonts: {
468
+ preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
469
+ stylesheets: [
470
+ // System UI fonts don't need external stylesheets, but we include
471
+ // Inter as an optional enhancement for consistent cross-platform rendering
472
+ "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
473
+ ]
474
+ },
475
+ icons: {
476
+ script: {
477
+ url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js"
478
+ }
479
+ },
480
+ scripts: {
481
+ tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
482
+ htmx: {
483
+ url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
484
+ integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
485
+ },
486
+ alpine: {
487
+ url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
488
+ integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
489
+ }
490
+ }
491
+ }
492
+ };
493
+ var DEFAULT_THEME = GITHUB_OPENAI_THEME;
494
+
495
+ // libs/uipack/src/theme/theme.ts
496
+ var DEFAULT_THEME2 = DEFAULT_THEME;
497
+ function mergeThemesCore(base, override) {
498
+ const baseColors = base.colors ?? { semantic: { primary: "#24292f" } };
499
+ const filterStrings = (arr) => arr.filter((s) => s !== void 0);
500
+ return {
501
+ ...base,
502
+ ...override,
503
+ colors: {
504
+ ...baseColors,
505
+ ...override.colors,
506
+ semantic: { ...baseColors.semantic, ...override.colors?.semantic },
507
+ surface: { ...baseColors.surface, ...override.colors?.surface },
508
+ text: { ...baseColors.text, ...override.colors?.text },
509
+ border: { ...baseColors.border, ...override.colors?.border },
510
+ custom: { ...baseColors.custom, ...override.colors?.custom }
511
+ },
512
+ typography: {
513
+ ...base.typography,
514
+ ...override.typography,
515
+ families: { ...base.typography?.families, ...override.typography?.families },
516
+ sizes: { ...base.typography?.sizes, ...override.typography?.sizes },
517
+ weights: { ...base.typography?.weights, ...override.typography?.weights },
518
+ lineHeight: { ...base.typography?.lineHeight, ...override.typography?.lineHeight }
519
+ },
520
+ spacing: { ...base.spacing, ...override.spacing },
521
+ radius: { ...base.radius, ...override.radius },
522
+ shadows: { ...base.shadows, ...override.shadows },
523
+ components: {
524
+ ...base.components,
525
+ ...override.components,
526
+ button: { ...base.components?.button, ...override.components?.button },
527
+ card: { ...base.components?.card, ...override.components?.card },
528
+ input: { ...base.components?.input, ...override.components?.input }
529
+ },
530
+ cdn: {
531
+ ...base.cdn,
532
+ ...override.cdn,
533
+ fonts: {
534
+ // Concatenate then dedupe so base entries are preserved without duplicates
535
+ preconnect: filterStrings(
536
+ Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.preconnect ?? [], ...override.cdn?.fonts?.preconnect ?? []]))
537
+ ),
538
+ stylesheets: filterStrings(
539
+ Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.stylesheets ?? [], ...override.cdn?.fonts?.stylesheets ?? []]))
540
+ )
541
+ },
542
+ icons: {
543
+ ...base.cdn?.icons,
544
+ ...override.cdn?.icons,
545
+ // Deep merge script to preserve integrity when only url is overridden
546
+ script: override.cdn?.icons?.script ? { ...base.cdn?.icons?.script, ...override.cdn?.icons?.script } : base.cdn?.icons?.script
547
+ },
548
+ scripts: {
549
+ // tailwind is a simple string, just use override or base
550
+ tailwind: override.cdn?.scripts?.tailwind ?? base.cdn?.scripts?.tailwind,
551
+ // Deep merge htmx/alpine to preserve integrity when only url is overridden
552
+ htmx: override.cdn?.scripts?.htmx ? { ...base.cdn?.scripts?.htmx, ...override.cdn?.scripts?.htmx } : base.cdn?.scripts?.htmx,
553
+ alpine: override.cdn?.scripts?.alpine ? { ...base.cdn?.scripts?.alpine, ...override.cdn?.scripts?.alpine } : base.cdn?.scripts?.alpine
554
+ }
555
+ },
556
+ customVars: { ...base.customVars, ...override.customVars },
557
+ customCss: [base.customCss, override.customCss].filter(Boolean).join("\n")
558
+ };
559
+ }
560
+ function mergeThemes(base, override) {
561
+ const merged = mergeThemesCore(base, override);
562
+ let darkVariant;
563
+ if (override.dark !== void 0) {
564
+ const darkBase = base.dark ?? base;
565
+ const { dark: _nestedDark, ...overrideDarkWithoutNested } = override.dark;
566
+ darkVariant = mergeThemesCore(darkBase, overrideDarkWithoutNested);
567
+ } else if (base.dark !== void 0) {
568
+ const { dark: _nestedDark, ...baseDarkWithoutNested } = base.dark;
569
+ darkVariant = baseDarkWithoutNested;
570
+ }
571
+ return {
572
+ ...merged,
573
+ dark: darkVariant
574
+ };
575
+ }
576
+ function createTheme(overrides) {
577
+ return mergeThemes(DEFAULT_THEME2, overrides);
578
+ }
579
+ function emitColorScale(lines, name, scale) {
580
+ for (const [shade, value] of Object.entries(scale)) {
581
+ if (value) lines.push(`--color-${name}-${shade}: ${value};`);
582
+ }
583
+ }
584
+ function buildThemeCss(theme) {
585
+ const lines = [];
586
+ const semantic = theme.colors.semantic;
587
+ if (typeof semantic.primary === "string") {
588
+ lines.push(`--color-primary: ${semantic.primary};`);
589
+ } else if (semantic.primary) {
590
+ emitColorScale(lines, "primary", semantic.primary);
591
+ }
592
+ if (semantic.secondary) {
593
+ if (typeof semantic.secondary === "string") {
594
+ lines.push(`--color-secondary: ${semantic.secondary};`);
595
+ } else {
596
+ emitColorScale(lines, "secondary", semantic.secondary);
597
+ }
598
+ }
599
+ if (semantic.accent) {
600
+ if (typeof semantic.accent === "string") {
601
+ lines.push(`--color-accent: ${semantic.accent};`);
602
+ } else {
603
+ emitColorScale(lines, "accent", semantic.accent);
604
+ }
605
+ }
606
+ if (semantic.neutral) {
607
+ if (typeof semantic.neutral === "string") {
608
+ lines.push(`--color-neutral: ${semantic.neutral};`);
609
+ } else {
610
+ emitColorScale(lines, "neutral", semantic.neutral);
611
+ }
612
+ }
613
+ if (semantic.success) lines.push(`--color-success: ${semantic.success};`);
614
+ if (semantic.warning) lines.push(`--color-warning: ${semantic.warning};`);
615
+ if (semantic.danger) lines.push(`--color-danger: ${semantic.danger};`);
616
+ if (semantic.info) lines.push(`--color-info: ${semantic.info};`);
617
+ const surface = theme.colors.surface;
618
+ if (surface?.background) lines.push(`--color-background: ${surface.background};`);
619
+ if (surface?.surface) lines.push(`--color-surface: ${surface.surface};`);
620
+ if (surface?.elevated) lines.push(`--color-elevated: ${surface.elevated};`);
621
+ if (surface?.overlay) lines.push(`--color-overlay: ${surface.overlay};`);
622
+ const text = theme.colors.text;
623
+ if (text?.primary) lines.push(`--color-text-primary: ${text.primary};`);
624
+ if (text?.secondary) lines.push(`--color-text-secondary: ${text.secondary};`);
625
+ if (text?.disabled) lines.push(`--color-text-disabled: ${text.disabled};`);
626
+ if (text?.inverse) lines.push(`--color-text-inverse: ${text.inverse};`);
627
+ if (text?.link) lines.push(`--color-text-link: ${text.link};`);
628
+ const border = theme.colors.border;
629
+ if (border?.default) lines.push(`--color-border: ${border.default};`);
630
+ if (border?.hover) lines.push(`--color-border-hover: ${border.hover};`);
631
+ if (border?.focus) lines.push(`--color-border-focus: ${border.focus};`);
632
+ if (border?.divider) lines.push(`--color-divider: ${border.divider};`);
633
+ if (theme.colors.custom) {
634
+ for (const [key, value] of Object.entries(theme.colors.custom)) {
635
+ lines.push(`--color-${key}: ${value};`);
636
+ }
637
+ }
638
+ const typography = theme.typography;
639
+ if (typography?.families?.sans) lines.push(`--font-sans: ${typography.families.sans};`);
640
+ if (typography?.families?.serif) lines.push(`--font-serif: ${typography.families.serif};`);
641
+ if (typography?.families?.mono) lines.push(`--font-mono: ${typography.families.mono};`);
642
+ if (typography?.families?.display) lines.push(`--font-display: ${typography.families.display};`);
643
+ const radius = theme.radius;
644
+ if (radius?.none) lines.push(`--radius-none: ${radius.none};`);
645
+ if (radius?.sm) lines.push(`--radius-sm: ${radius.sm};`);
646
+ if (radius?.md) lines.push(`--radius-md: ${radius.md};`);
647
+ if (radius?.lg) lines.push(`--radius-lg: ${radius.lg};`);
648
+ if (radius?.xl) lines.push(`--radius-xl: ${radius.xl};`);
649
+ if (radius?.["2xl"]) lines.push(`--radius-2xl: ${radius["2xl"]};`);
650
+ if (radius?.full) lines.push(`--radius-full: ${radius.full};`);
651
+ if (theme.customVars) {
652
+ for (const [key, value] of Object.entries(theme.customVars)) {
653
+ lines.push(`${key}: ${value};`);
654
+ }
655
+ }
656
+ return lines.join("\n ");
657
+ }
658
+ function buildStyleBlock(theme) {
659
+ const themeCss = buildThemeCss(theme);
660
+ const customCss = theme.customCss || "";
661
+ return `<style type="text/tailwindcss">
662
+ @theme {
663
+ ${themeCss}
664
+ }
665
+ ${customCss}
666
+ </style>`;
667
+ }
668
+ export {
669
+ CDN,
670
+ CLAUDE_PLATFORM,
671
+ CUSTOM_PLATFORM,
672
+ DEFAULT_THEME,
673
+ GEMINI_PLATFORM,
674
+ GITHUB_OPENAI_THEME,
675
+ NGROK_PLATFORM,
676
+ OPENAI_PLATFORM,
677
+ PLATFORM_PRESETS,
678
+ buildCdnScripts,
679
+ buildCdnScriptsFromTheme,
680
+ buildFontPreconnect,
681
+ buildFontPreconnectFromTheme,
682
+ buildFontStylesheets,
683
+ buildFontStylesheetsFromTheme,
684
+ buildStyleBlock,
685
+ buildThemeCss,
686
+ canUseCdn,
687
+ clearScriptCache,
688
+ createPlatform,
689
+ createTheme,
690
+ fetchAndCacheScripts,
691
+ fetchAndCacheScriptsFromTheme,
692
+ fetchScript,
693
+ getCachedScript,
694
+ getFallbackMode,
695
+ getPlatform,
696
+ isScriptCached,
697
+ mergeThemes,
698
+ needsInlineScripts,
699
+ supportsFullInteractivity
700
+ };