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