@antheo/morph 0.0.0-stage → 0.3.0

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 (464) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -2
  3. package/SKILL.md +61 -0
  4. package/dist/ai/cli-provider.d.ts +80 -0
  5. package/dist/ai/cli-provider.js +250 -0
  6. package/dist/ai/gate.d.ts +39 -0
  7. package/dist/ai/gate.js +124 -0
  8. package/dist/ai/provider.d.ts +36 -0
  9. package/dist/ai/provider.js +168 -0
  10. package/dist/ai/repair.d.ts +90 -0
  11. package/dist/ai/repair.js +172 -0
  12. package/dist/analyzer/deps.d.ts +30 -0
  13. package/dist/analyzer/deps.js +265 -0
  14. package/dist/analyzer/manifest.d.ts +5 -0
  15. package/dist/analyzer/manifest.js +119 -0
  16. package/dist/analyzer/parse.d.ts +21 -0
  17. package/dist/analyzer/parse.js +29 -0
  18. package/dist/batch-worker.d.ts +16 -0
  19. package/dist/batch-worker.js +10 -0
  20. package/dist/batch.d.ts +26 -0
  21. package/dist/batch.js +227 -0
  22. package/dist/bridge/index.d.ts +26 -0
  23. package/dist/bridge/index.js +138 -0
  24. package/dist/bridge/props.d.ts +56 -0
  25. package/dist/bridge/props.js +191 -0
  26. package/dist/bridge/wrappers.d.ts +24 -0
  27. package/dist/bridge/wrappers.js +276 -0
  28. package/dist/cli/format.d.ts +7 -0
  29. package/dist/cli/format.js +30 -0
  30. package/dist/cli.d.ts +2 -0
  31. package/dist/cli.js +492 -0
  32. package/dist/fonts/carry.d.ts +34 -0
  33. package/dist/fonts/carry.js +113 -0
  34. package/dist/fonts/fallback.d.ts +11 -0
  35. package/dist/fonts/fallback.js +21 -0
  36. package/dist/fonts/google.d.ts +65 -0
  37. package/dist/fonts/google.js +343 -0
  38. package/dist/fonts/index.d.ts +27 -0
  39. package/dist/fonts/index.js +48 -0
  40. package/dist/fonts/local.d.ts +46 -0
  41. package/dist/fonts/local.js +150 -0
  42. package/dist/fonts/sfnt.d.ts +19 -0
  43. package/dist/fonts/sfnt.js +174 -0
  44. package/dist/fonts/shim.d.ts +14 -0
  45. package/dist/fonts/shim.js +96 -0
  46. package/dist/gate.d.ts +105 -0
  47. package/dist/gate.js +157 -0
  48. package/dist/index.d.ts +55 -0
  49. package/dist/index.js +74 -0
  50. package/dist/ir/annotate.d.ts +16 -0
  51. package/dist/ir/annotate.js +145 -0
  52. package/dist/ir/as-child.d.ts +18 -0
  53. package/dist/ir/as-child.js +239 -0
  54. package/dist/ir/compounds.d.ts +27 -0
  55. package/dist/ir/compounds.js +183 -0
  56. package/dist/ir/contexts.d.ts +26 -0
  57. package/dist/ir/contexts.js +185 -0
  58. package/dist/ir/dom.d.ts +11 -0
  59. package/dist/ir/dom.js +60 -0
  60. package/dist/ir/effect-returns.d.ts +10 -0
  61. package/dist/ir/effect-returns.js +25 -0
  62. package/dist/ir/extract-ui-types.d.ts +33 -0
  63. package/dist/ir/extract-ui-types.js +224 -0
  64. package/dist/ir/extract-ui.d.ts +34 -0
  65. package/dist/ir/extract-ui.js +567 -0
  66. package/dist/ir/falsy.d.ts +13 -0
  67. package/dist/ir/falsy.js +66 -0
  68. package/dist/ir/forward-refs.d.ts +11 -0
  69. package/dist/ir/forward-refs.js +155 -0
  70. package/dist/ir/fragment-source.d.ts +4 -0
  71. package/dist/ir/fragment-source.js +13 -0
  72. package/dist/ir/fragments.d.ts +32 -0
  73. package/dist/ir/fragments.js +192 -0
  74. package/dist/ir/helper-snippets.d.ts +30 -0
  75. package/dist/ir/helper-snippets.js +550 -0
  76. package/dist/ir/latest-refs.d.ts +11 -0
  77. package/dist/ir/latest-refs.js +187 -0
  78. package/dist/ir/live-args.d.ts +26 -0
  79. package/dist/ir/live-args.js +335 -0
  80. package/dist/ir/lower.d.ts +83 -0
  81. package/dist/ir/lower.js +6016 -0
  82. package/dist/ir/markup-values.d.ts +16 -0
  83. package/dist/ir/markup-values.js +188 -0
  84. package/dist/ir/model.d.ts +605 -0
  85. package/dist/ir/model.js +1 -0
  86. package/dist/ir/oracle.d.ts +91 -0
  87. package/dist/ir/oracle.js +610 -0
  88. package/dist/ir/radix.d.ts +122 -0
  89. package/dist/ir/radix.js +344 -0
  90. package/dist/ir/rename.d.ts +15 -0
  91. package/dist/ir/rename.js +151 -0
  92. package/dist/ir/render-props.d.ts +31 -0
  93. package/dist/ir/render-props.js +67 -0
  94. package/dist/ir/rewrite.d.ts +44 -0
  95. package/dist/ir/rewrite.js +381 -0
  96. package/dist/ir/running-index.d.ts +11 -0
  97. package/dist/ir/running-index.js +217 -0
  98. package/dist/ir/snapshots.d.ts +12 -0
  99. package/dist/ir/snapshots.js +140 -0
  100. package/dist/ir/style.d.ts +19 -0
  101. package/dist/ir/style.js +76 -0
  102. package/dist/ir/types.d.ts +42 -0
  103. package/dist/ir/types.js +271 -0
  104. package/dist/ir/walk.d.ts +11 -0
  105. package/dist/ir/walk.js +18 -0
  106. package/dist/mcp/server.d.ts +81 -0
  107. package/dist/mcp/server.js +518 -0
  108. package/dist/pipeline.d.ts +26 -0
  109. package/dist/pipeline.js +750 -0
  110. package/dist/registry/add.d.ts +91 -0
  111. package/dist/registry/add.js +273 -0
  112. package/dist/registry/fetch.d.ts +40 -0
  113. package/dist/registry/fetch.js +186 -0
  114. package/dist/registry/ip.d.ts +18 -0
  115. package/dist/registry/ip.js +153 -0
  116. package/dist/registry/item.d.ts +39 -0
  117. package/dist/registry/item.js +131 -0
  118. package/dist/registry/load.d.ts +35 -0
  119. package/dist/registry/load.js +106 -0
  120. package/dist/registry/paths.d.ts +8 -0
  121. package/dist/registry/paths.js +43 -0
  122. package/dist/registry/publish.d.ts +119 -0
  123. package/dist/registry/publish.js +439 -0
  124. package/dist/targets/angular/bank/bank.d.ts +39 -0
  125. package/dist/targets/angular/bank/bank.js +61 -0
  126. package/dist/targets/angular/bank/helpers.d.ts +64 -0
  127. package/dist/targets/angular/bank/helpers.js +246 -0
  128. package/dist/targets/angular/bank/kept.d.ts +98 -0
  129. package/dist/targets/angular/bank/kept.js +791 -0
  130. package/dist/targets/angular/bank/plan-helpers.d.ts +17 -0
  131. package/dist/targets/angular/bank/plan-helpers.js +286 -0
  132. package/dist/targets/angular/bank/plan.d.ts +22 -0
  133. package/dist/targets/angular/bank/plan.js +152 -0
  134. package/dist/targets/angular/bank/receivers.d.ts +66 -0
  135. package/dist/targets/angular/bank/receivers.js +293 -0
  136. package/dist/targets/angular/bank/runtime.d.ts +14 -0
  137. package/dist/targets/angular/bank/runtime.js +152 -0
  138. package/dist/targets/angular/controlled.d.ts +7 -0
  139. package/dist/targets/angular/controlled.js +37 -0
  140. package/dist/targets/angular/dynamic-tags.d.ts +34 -0
  141. package/dist/targets/angular/dynamic-tags.js +192 -0
  142. package/dist/targets/angular/emit.d.ts +41 -0
  143. package/dist/targets/angular/emit.js +5970 -0
  144. package/dist/targets/angular/exports.d.ts +48 -0
  145. package/dist/targets/angular/exports.js +243 -0
  146. package/dist/targets/angular/helpers.d.ts +15 -0
  147. package/dist/targets/angular/helpers.js +33 -0
  148. package/dist/targets/angular/host-boundary.d.ts +5 -0
  149. package/dist/targets/angular/host-boundary.js +166 -0
  150. package/dist/targets/angular/host-form.d.ts +150 -0
  151. package/dist/targets/angular/host-form.js +727 -0
  152. package/dist/targets/angular/markup-values.d.ts +58 -0
  153. package/dist/targets/angular/markup-values.js +661 -0
  154. package/dist/targets/angular/motion-directive.d.ts +12 -0
  155. package/dist/targets/angular/motion-directive.js +257 -0
  156. package/dist/targets/angular/motion-hooks.d.ts +73 -0
  157. package/dist/targets/angular/motion-hooks.js +293 -0
  158. package/dist/targets/angular/motion-layout.d.ts +14 -0
  159. package/dist/targets/angular/motion-layout.js +74 -0
  160. package/dist/targets/angular/motion-templates.d.ts +10 -0
  161. package/dist/targets/angular/motion-templates.js +65 -0
  162. package/dist/targets/angular/motion.d.ts +57 -0
  163. package/dist/targets/angular/motion.js +202 -0
  164. package/dist/targets/angular/narrowing.d.ts +24 -0
  165. package/dist/targets/angular/narrowing.js +205 -0
  166. package/dist/targets/angular/ngc.d.ts +23 -0
  167. package/dist/targets/angular/ngc.js +134 -0
  168. package/dist/targets/angular/passed-handle.d.ts +39 -0
  169. package/dist/targets/angular/passed-handle.js +154 -0
  170. package/dist/targets/angular/projected.d.ts +9 -0
  171. package/dist/targets/angular/projected.js +63 -0
  172. package/dist/targets/angular/radix/cores/alert-dialog.d.ts +13 -0
  173. package/dist/targets/angular/radix/cores/alert-dialog.js +388 -0
  174. package/dist/targets/angular/radix/cores/index.d.ts +17 -0
  175. package/dist/targets/angular/radix/cores/index.js +50 -0
  176. package/dist/targets/angular/radix/cores/slider.d.ts +8 -0
  177. package/dist/targets/angular/radix/cores/slider.js +202 -0
  178. package/dist/targets/angular/radix/index.d.ts +21 -0
  179. package/dist/targets/angular/radix/index.js +35 -0
  180. package/dist/targets/angular/radix/packages.d.ts +3 -0
  181. package/dist/targets/angular/radix/packages.js +558 -0
  182. package/dist/targets/angular/radix/part.d.ts +236 -0
  183. package/dist/targets/angular/radix/part.js +71 -0
  184. package/dist/targets/angular/radix/prepare.d.ts +66 -0
  185. package/dist/targets/angular/radix/prepare.js +548 -0
  186. package/dist/targets/angular/radix/template.d.ts +43 -0
  187. package/dist/targets/angular/radix/template.js +172 -0
  188. package/dist/targets/angular/refs.d.ts +68 -0
  189. package/dist/targets/angular/refs.js +443 -0
  190. package/dist/targets/angular/slots.d.ts +22 -0
  191. package/dist/targets/angular/slots.js +60 -0
  192. package/dist/targets/angular/source-types.d.ts +10 -0
  193. package/dist/targets/angular/source-types.js +45 -0
  194. package/dist/targets/angular/spread-forward.d.ts +24 -0
  195. package/dist/targets/angular/spread-forward.js +72 -0
  196. package/dist/targets/angular/spread.d.ts +32 -0
  197. package/dist/targets/angular/spread.js +182 -0
  198. package/dist/targets/angular/svg-hosts.d.ts +25 -0
  199. package/dist/targets/angular/svg-hosts.js +107 -0
  200. package/dist/targets/angular/template-expr.d.ts +36 -0
  201. package/dist/targets/angular/template-expr.js +287 -0
  202. package/dist/targets/angular/types.d.ts +9 -0
  203. package/dist/targets/angular/types.js +63 -0
  204. package/dist/targets/angular/walk.d.ts +11 -0
  205. package/dist/targets/angular/walk.js +26 -0
  206. package/dist/targets/react-native/emit.d.ts +14 -0
  207. package/dist/targets/react-native/emit.js +585 -0
  208. package/dist/targets/react-native/fidelity.d.ts +5 -0
  209. package/dist/targets/react-native/fidelity.js +43 -0
  210. package/dist/targets/react-native/motion.d.ts +10 -0
  211. package/dist/targets/react-native/motion.js +290 -0
  212. package/dist/targets/react-native/skia.d.ts +30 -0
  213. package/dist/targets/react-native/skia.js +358 -0
  214. package/dist/targets/shared/context.d.ts +47 -0
  215. package/dist/targets/shared/context.js +195 -0
  216. package/dist/targets/shared/foreign.d.ts +10 -0
  217. package/dist/targets/shared/foreign.js +72 -0
  218. package/dist/targets/shared/fragments.d.ts +21 -0
  219. package/dist/targets/shared/fragments.js +309 -0
  220. package/dist/targets/shared/handles.d.ts +65 -0
  221. package/dist/targets/shared/handles.js +299 -0
  222. package/dist/targets/shared/inline.d.ts +53 -0
  223. package/dist/targets/shared/inline.js +524 -0
  224. package/dist/targets/shared/layout.d.ts +70 -0
  225. package/dist/targets/shared/layout.js +224 -0
  226. package/dist/targets/shared/markup.d.ts +26 -0
  227. package/dist/targets/shared/markup.js +65 -0
  228. package/dist/targets/shared/module.d.ts +84 -0
  229. package/dist/targets/shared/module.js +468 -0
  230. package/dist/targets/shared/motion-hooks.d.ts +37 -0
  231. package/dist/targets/shared/motion-hooks.js +87 -0
  232. package/dist/targets/shared/motion-layout.d.ts +70 -0
  233. package/dist/targets/shared/motion-layout.js +392 -0
  234. package/dist/targets/shared/portal.d.ts +10 -0
  235. package/dist/targets/shared/portal.js +23 -0
  236. package/dist/targets/shared/prop-writes.d.ts +11 -0
  237. package/dist/targets/shared/prop-writes.js +32 -0
  238. package/dist/targets/shared/prune.d.ts +54 -0
  239. package/dist/targets/shared/prune.js +405 -0
  240. package/dist/targets/shared/react-libs.d.ts +25 -0
  241. package/dist/targets/shared/react-libs.js +142 -0
  242. package/dist/targets/shared/react-types.d.ts +16 -0
  243. package/dist/targets/shared/react-types.js +374 -0
  244. package/dist/targets/shared/react-values.d.ts +20 -0
  245. package/dist/targets/shared/react-values.js +145 -0
  246. package/dist/targets/shared/ref-callback.d.ts +16 -0
  247. package/dist/targets/shared/ref-callback.js +114 -0
  248. package/dist/targets/shared/script.d.ts +65 -0
  249. package/dist/targets/shared/script.js +406 -0
  250. package/dist/targets/shared/unused.d.ts +12 -0
  251. package/dist/targets/shared/unused.js +146 -0
  252. package/dist/targets/svelte/dom-spread.d.ts +27 -0
  253. package/dist/targets/svelte/dom-spread.js +146 -0
  254. package/dist/targets/svelte/emit.d.ts +15 -0
  255. package/dist/targets/svelte/emit.js +3784 -0
  256. package/dist/targets/svelte/handle-branches.d.ts +22 -0
  257. package/dist/targets/svelte/handle-branches.js +146 -0
  258. package/dist/targets/svelte/html-keys.d.ts +9 -0
  259. package/dist/targets/svelte/html-keys.js +40 -0
  260. package/dist/targets/svelte/markup-data/data.d.ts +51 -0
  261. package/dist/targets/svelte/markup-data/data.js +305 -0
  262. package/dist/targets/svelte/markup-data/helper.d.ts +12 -0
  263. package/dist/targets/svelte/markup-data/helper.js +81 -0
  264. package/dist/targets/svelte/markup-data/module-data.d.ts +21 -0
  265. package/dist/targets/svelte/markup-data/module-data.js +473 -0
  266. package/dist/targets/svelte/markup-data/sites.d.ts +52 -0
  267. package/dist/targets/svelte/markup-data/sites.js +303 -0
  268. package/dist/targets/svelte/motion-layout.d.ts +13 -0
  269. package/dist/targets/svelte/motion-layout.js +70 -0
  270. package/dist/targets/svelte/motion-table.d.ts +14 -0
  271. package/dist/targets/svelte/motion-table.js +308 -0
  272. package/dist/targets/svelte/motion.d.ts +46 -0
  273. package/dist/targets/svelte/motion.js +405 -0
  274. package/dist/targets/svelte/presence.d.ts +71 -0
  275. package/dist/targets/svelte/presence.js +318 -0
  276. package/dist/targets/svelte/radix/accordion.d.ts +9 -0
  277. package/dist/targets/svelte/radix/accordion.js +24 -0
  278. package/dist/targets/svelte/radix/aspect-ratio.d.ts +6 -0
  279. package/dist/targets/svelte/radix/aspect-ratio.js +8 -0
  280. package/dist/targets/svelte/radix/avatar.d.ts +6 -0
  281. package/dist/targets/svelte/radix/avatar.js +10 -0
  282. package/dist/targets/svelte/radix/checkbox.d.ts +10 -0
  283. package/dist/targets/svelte/radix/checkbox.js +24 -0
  284. package/dist/targets/svelte/radix/collapsible.d.ts +7 -0
  285. package/dist/targets/svelte/radix/collapsible.js +16 -0
  286. package/dist/targets/svelte/radix/context-menu.d.ts +8 -0
  287. package/dist/targets/svelte/radix/context-menu.js +49 -0
  288. package/dist/targets/svelte/radix/cores/alert-dialog.d.ts +17 -0
  289. package/dist/targets/svelte/radix/cores/alert-dialog.js +449 -0
  290. package/dist/targets/svelte/radix/cores/collapsible.d.ts +12 -0
  291. package/dist/targets/svelte/radix/cores/collapsible.js +214 -0
  292. package/dist/targets/svelte/radix/cores/core.d.ts +32 -0
  293. package/dist/targets/svelte/radix/cores/core.js +80 -0
  294. package/dist/targets/svelte/radix/cores/direction.d.ts +10 -0
  295. package/dist/targets/svelte/radix/cores/direction.js +64 -0
  296. package/dist/targets/svelte/radix/cores/index.d.ts +19 -0
  297. package/dist/targets/svelte/radix/cores/index.js +85 -0
  298. package/dist/targets/svelte/radix/cores/modal-layer.d.ts +11 -0
  299. package/dist/targets/svelte/radix/cores/modal-layer.js +244 -0
  300. package/dist/targets/svelte/radix/cores/presence.d.ts +12 -0
  301. package/dist/targets/svelte/radix/cores/presence.js +129 -0
  302. package/dist/targets/svelte/radix/cores/slider-logic.d.ts +10 -0
  303. package/dist/targets/svelte/radix/cores/slider-logic.js +287 -0
  304. package/dist/targets/svelte/radix/cores/slider.d.ts +13 -0
  305. package/dist/targets/svelte/radix/cores/slider.js +267 -0
  306. package/dist/targets/svelte/radix/dialog.d.ts +8 -0
  307. package/dist/targets/svelte/radix/dialog.js +20 -0
  308. package/dist/targets/svelte/radix/dropdown-menu.d.ts +9 -0
  309. package/dist/targets/svelte/radix/dropdown-menu.js +38 -0
  310. package/dist/targets/svelte/radix/emit.d.ts +12 -0
  311. package/dist/targets/svelte/radix/emit.js +1339 -0
  312. package/dist/targets/svelte/radix/hover-card.d.ts +7 -0
  313. package/dist/targets/svelte/radix/hover-card.js +22 -0
  314. package/dist/targets/svelte/radix/index.d.ts +12 -0
  315. package/dist/targets/svelte/radix/index.js +28 -0
  316. package/dist/targets/svelte/radix/label.d.ts +3 -0
  317. package/dist/targets/svelte/radix/label.js +5 -0
  318. package/dist/targets/svelte/radix/menubar.d.ts +7 -0
  319. package/dist/targets/svelte/radix/menubar.js +34 -0
  320. package/dist/targets/svelte/radix/navigation-menu.d.ts +8 -0
  321. package/dist/targets/svelte/radix/navigation-menu.js +25 -0
  322. package/dist/targets/svelte/radix/packages.d.ts +34 -0
  323. package/dist/targets/svelte/radix/packages.js +100 -0
  324. package/dist/targets/svelte/radix/part.d.ts +161 -0
  325. package/dist/targets/svelte/radix/part.js +85 -0
  326. package/dist/targets/svelte/radix/popover.d.ts +7 -0
  327. package/dist/targets/svelte/radix/popover.js +15 -0
  328. package/dist/targets/svelte/radix/progress.d.ts +11 -0
  329. package/dist/targets/svelte/radix/progress.js +27 -0
  330. package/dist/targets/svelte/radix/radio-group.d.ts +9 -0
  331. package/dist/targets/svelte/radix/radio-group.js +26 -0
  332. package/dist/targets/svelte/radix/scroll-area.d.ts +7 -0
  333. package/dist/targets/svelte/radix/scroll-area.js +19 -0
  334. package/dist/targets/svelte/radix/select.d.ts +13 -0
  335. package/dist/targets/svelte/radix/select.js +81 -0
  336. package/dist/targets/svelte/radix/separator.d.ts +3 -0
  337. package/dist/targets/svelte/radix/separator.js +5 -0
  338. package/dist/targets/svelte/radix/slider.d.ts +6 -0
  339. package/dist/targets/svelte/radix/slider.js +8 -0
  340. package/dist/targets/svelte/radix/switch.d.ts +6 -0
  341. package/dist/targets/svelte/radix/switch.js +10 -0
  342. package/dist/targets/svelte/radix/tabs.d.ts +8 -0
  343. package/dist/targets/svelte/radix/tabs.js +15 -0
  344. package/dist/targets/svelte/radix/toggle-group.d.ts +9 -0
  345. package/dist/targets/svelte/radix/toggle-group.js +17 -0
  346. package/dist/targets/svelte/radix/toggle.d.ts +6 -0
  347. package/dist/targets/svelte/radix/toggle.js +9 -0
  348. package/dist/targets/svelte/radix/tooltip.d.ts +6 -0
  349. package/dist/targets/svelte/radix/tooltip.js +24 -0
  350. package/dist/targets/svelte/strip.d.ts +2 -0
  351. package/dist/targets/svelte/strip.js +5 -0
  352. package/dist/targets/vue/emit.d.ts +15 -0
  353. package/dist/targets/vue/emit.js +4092 -0
  354. package/dist/targets/vue/events.d.ts +11 -0
  355. package/dist/targets/vue/events.js +13 -0
  356. package/dist/targets/vue/module-builders.d.ts +28 -0
  357. package/dist/targets/vue/module-builders.js +258 -0
  358. package/dist/targets/vue/motion-layout.d.ts +19 -0
  359. package/dist/targets/vue/motion-layout.js +79 -0
  360. package/dist/targets/vue/motion.d.ts +12 -0
  361. package/dist/targets/vue/motion.js +46 -0
  362. package/dist/targets/vue/radix/accordion.d.ts +3 -0
  363. package/dist/targets/vue/radix/accordion.js +12 -0
  364. package/dist/targets/vue/radix/alert-dialog.d.ts +6 -0
  365. package/dist/targets/vue/radix/alert-dialog.js +18 -0
  366. package/dist/targets/vue/radix/aspect-ratio.d.ts +6 -0
  367. package/dist/targets/vue/radix/aspect-ratio.js +8 -0
  368. package/dist/targets/vue/radix/avatar.d.ts +3 -0
  369. package/dist/targets/vue/radix/avatar.js +7 -0
  370. package/dist/targets/vue/radix/checkbox.d.ts +3 -0
  371. package/dist/targets/vue/radix/checkbox.js +9 -0
  372. package/dist/targets/vue/radix/collapsible.d.ts +7 -0
  373. package/dist/targets/vue/radix/collapsible.js +11 -0
  374. package/dist/targets/vue/radix/context-menu.d.ts +3 -0
  375. package/dist/targets/vue/radix/context-menu.js +30 -0
  376. package/dist/targets/vue/radix/dialog.d.ts +3 -0
  377. package/dist/targets/vue/radix/dialog.js +12 -0
  378. package/dist/targets/vue/radix/direction.d.ts +7 -0
  379. package/dist/targets/vue/radix/direction.js +9 -0
  380. package/dist/targets/vue/radix/dropdown-menu.d.ts +3 -0
  381. package/dist/targets/vue/radix/dropdown-menu.js +29 -0
  382. package/dist/targets/vue/radix/hover-card.d.ts +3 -0
  383. package/dist/targets/vue/radix/hover-card.js +11 -0
  384. package/dist/targets/vue/radix/index.d.ts +65 -0
  385. package/dist/targets/vue/radix/index.js +225 -0
  386. package/dist/targets/vue/radix/label.d.ts +3 -0
  387. package/dist/targets/vue/radix/label.js +5 -0
  388. package/dist/targets/vue/radix/menubar.d.ts +6 -0
  389. package/dist/targets/vue/radix/menubar.js +29 -0
  390. package/dist/targets/vue/radix/navigation-menu.d.ts +6 -0
  391. package/dist/targets/vue/radix/navigation-menu.js +21 -0
  392. package/dist/targets/vue/radix/part.d.ts +41 -0
  393. package/dist/targets/vue/radix/part.js +46 -0
  394. package/dist/targets/vue/radix/popover.d.ts +3 -0
  395. package/dist/targets/vue/radix/popover.js +11 -0
  396. package/dist/targets/vue/radix/progress.d.ts +3 -0
  397. package/dist/targets/vue/radix/progress.js +6 -0
  398. package/dist/targets/vue/radix/radio-group.d.ts +3 -0
  399. package/dist/targets/vue/radix/radio-group.js +10 -0
  400. package/dist/targets/vue/radix/scroll-area.d.ts +3 -0
  401. package/dist/targets/vue/radix/scroll-area.js +11 -0
  402. package/dist/targets/vue/radix/select.d.ts +3 -0
  403. package/dist/targets/vue/radix/select.js +29 -0
  404. package/dist/targets/vue/radix/separator.d.ts +3 -0
  405. package/dist/targets/vue/radix/separator.js +5 -0
  406. package/dist/targets/vue/radix/slider.d.ts +3 -0
  407. package/dist/targets/vue/radix/slider.js +13 -0
  408. package/dist/targets/vue/radix/switch.d.ts +3 -0
  409. package/dist/targets/vue/radix/switch.js +9 -0
  410. package/dist/targets/vue/radix/tabs.d.ts +3 -0
  411. package/dist/targets/vue/radix/tabs.js +12 -0
  412. package/dist/targets/vue/radix/toggle-group.d.ts +3 -0
  413. package/dist/targets/vue/radix/toggle-group.js +10 -0
  414. package/dist/targets/vue/radix/toggle.d.ts +3 -0
  415. package/dist/targets/vue/radix/toggle.js +8 -0
  416. package/dist/targets/vue/radix/tooltip.d.ts +3 -0
  417. package/dist/targets/vue/radix/tooltip.js +14 -0
  418. package/dist/targets/vue/render-fn/h.d.ts +52 -0
  419. package/dist/targets/vue/render-fn/h.js +442 -0
  420. package/dist/targets/vue/render-fn.d.ts +21 -0
  421. package/dist/targets/vue/render-fn.js +357 -0
  422. package/dist/targets/vue/slot.d.ts +9 -0
  423. package/dist/targets/vue/slot.js +57 -0
  424. package/dist/typecheck/host.d.ts +45 -0
  425. package/dist/typecheck/host.js +309 -0
  426. package/dist/typecheck/index.d.ts +16 -0
  427. package/dist/typecheck/index.js +17 -0
  428. package/dist/typecheck/lucide.d.ts +8 -0
  429. package/dist/typecheck/lucide.js +45 -0
  430. package/dist/typecheck/sourcemap.d.ts +9 -0
  431. package/dist/typecheck/sourcemap.js +54 -0
  432. package/dist/typecheck/svelte.d.ts +9 -0
  433. package/dist/typecheck/svelte.js +116 -0
  434. package/dist/typecheck/vue.d.ts +8 -0
  435. package/dist/typecheck/vue.js +78 -0
  436. package/dist/types.d.ts +446 -0
  437. package/dist/types.js +11 -0
  438. package/dist/utils/cleanup.d.ts +32 -0
  439. package/dist/utils/cleanup.js +119 -0
  440. package/dist/utils/errors.d.ts +7 -0
  441. package/dist/utils/errors.js +15 -0
  442. package/dist/utils/fs-safe.d.ts +14 -0
  443. package/dist/utils/fs-safe.js +64 -0
  444. package/dist/validate.d.ts +16 -0
  445. package/dist/validate.js +204 -0
  446. package/dist/verify/auto-steps.d.ts +107 -0
  447. package/dist/verify/auto-steps.js +471 -0
  448. package/dist/verify/bundle.d.ts +68 -0
  449. package/dist/verify/bundle.js +548 -0
  450. package/dist/verify/diff.d.ts +31 -0
  451. package/dist/verify/diff.js +133 -0
  452. package/dist/verify/leaks.d.ts +25 -0
  453. package/dist/verify/leaks.js +261 -0
  454. package/dist/verify/link-worker.d.ts +1 -0
  455. package/dist/verify/link-worker.js +27 -0
  456. package/dist/verify/runner.d.ts +57 -0
  457. package/dist/verify/runner.js +867 -0
  458. package/dist/verify/sandbox.d.ts +40 -0
  459. package/dist/verify/sandbox.js +496 -0
  460. package/dist/verify/steps.d.ts +42 -0
  461. package/dist/verify/steps.js +475 -0
  462. package/dist/verify/verdict.d.ts +15 -0
  463. package/dist/verify/verdict.js +19 -0
  464. package/package.json +118 -4
@@ -0,0 +1,153 @@
1
+ import { isIP } from 'node:net';
2
+ const V4_BLOCKED = [
3
+ ['0.0.0.0', 8, 'unspecified or "this network" (0.0.0.0/8)'],
4
+ ['10.0.0.0', 8, 'private (10.0.0.0/8)'],
5
+ ['100.64.0.0', 10, 'shared carrier-grade NAT (100.64.0.0/10)'],
6
+ ['169.254.0.0', 16, 'link-local, cloud metadata (169.254.0.0/16)'],
7
+ ['172.16.0.0', 12, 'private (172.16.0.0/12)'],
8
+ ['192.0.0.0', 24, 'IETF protocol assignments (192.0.0.0/24)'],
9
+ ['192.0.2.0', 24, 'documentation (192.0.2.0/24)'],
10
+ ['192.88.99.0', 24, '6to4 relay anycast (192.88.99.0/24)'],
11
+ ['192.168.0.0', 16, 'private (192.168.0.0/16)'],
12
+ ['198.18.0.0', 15, 'benchmarking (198.18.0.0/15)'],
13
+ ['198.51.100.0', 24, 'documentation (198.51.100.0/24)'],
14
+ ['203.0.113.0', 24, 'documentation (203.0.113.0/24)'],
15
+ ['224.0.0.0', 4, 'multicast (224.0.0.0/4)'],
16
+ ['240.0.0.0', 4, 'reserved or broadcast (240.0.0.0/4)'],
17
+ ];
18
+ function v4ToInt(address) {
19
+ const parts = address.split('.');
20
+ if (parts.length !== 4)
21
+ return null;
22
+ let n = 0;
23
+ for (const p of parts) {
24
+ if (!/^\d{1,3}$/.test(p))
25
+ return null;
26
+ const v = Number(p);
27
+ if (v > 255)
28
+ return null;
29
+ n = n * 256 + v;
30
+ }
31
+ return n;
32
+ }
33
+ function inV4(ip, base, bits) {
34
+ const b = v4ToInt(base) ?? 0;
35
+ const size = 2 ** (32 - bits);
36
+ return Math.floor(ip / size) === Math.floor(b / size);
37
+ }
38
+ function classifyV4(address) {
39
+ const ip = v4ToInt(address);
40
+ if (ip === null)
41
+ return { kind: 'blocked', reason: `"${address}" is not an IPv4 address` };
42
+ if (inV4(ip, '127.0.0.0', 8))
43
+ return { kind: 'loopback' };
44
+ for (const [base, bits, reason] of V4_BLOCKED)
45
+ if (inV4(ip, base, bits))
46
+ return { kind: 'blocked', reason };
47
+ return { kind: 'public' };
48
+ }
49
+ /** The eight 16-bit groups of an IPv6 address (an embedded IPv4 tail is read too), or null. */
50
+ export function ipv6Groups(address) {
51
+ let text = address.toLowerCase();
52
+ if (text.includes('%'))
53
+ return null;
54
+ // an IPv4 tail (`::ffff:127.0.0.1`) becomes its two hex groups (`::ffff:7f00:1`)
55
+ const lastColon = text.lastIndexOf(':');
56
+ const last = text.slice(lastColon + 1);
57
+ if (last.includes('.')) {
58
+ const v4 = v4ToInt(last);
59
+ if (v4 === null)
60
+ return null;
61
+ text = `${text.slice(0, lastColon + 1)}${Math.floor(v4 / 65536).toString(16)}:${(v4 % 65536).toString(16)}`;
62
+ }
63
+ const halves = text.split('::');
64
+ if (halves.length > 2)
65
+ return null;
66
+ const read = (s) => {
67
+ if (!s)
68
+ return [];
69
+ const out = [];
70
+ for (const g of s.split(':')) {
71
+ if (!/^[0-9a-f]{1,4}$/.test(g))
72
+ return null;
73
+ out.push(parseInt(g, 16));
74
+ }
75
+ return out;
76
+ };
77
+ const head = read(halves[0] ?? '');
78
+ const rest = halves.length === 2 ? read(halves[1] ?? '') : [];
79
+ if (!head || !rest)
80
+ return null;
81
+ const known = head.length + rest.length;
82
+ if (halves.length === 1) {
83
+ if (known !== 8)
84
+ return null;
85
+ return head;
86
+ }
87
+ if (known > 7)
88
+ return null;
89
+ return [...head, ...new Array(8 - known).fill(0), ...rest];
90
+ }
91
+ const v4Of = (hi, lo) => `${hi >> 8}.${hi & 255}.${lo >> 8}.${lo & 255}`;
92
+ function classifyV6(address) {
93
+ if (address.includes('%'))
94
+ return { kind: 'blocked', reason: 'an IPv6 address with a zone (link-scoped)' };
95
+ const g = ipv6Groups(address);
96
+ if (!g)
97
+ return { kind: 'blocked', reason: `"${address}" is not an IPv6 address` };
98
+ const [g0 = 0, g1 = 0, g2 = 0, g3 = 0, g4 = 0, g5 = 0, g6 = 0, g7 = 0] = g;
99
+ const zeroTo = (n) => g.slice(0, n).every((x) => x === 0);
100
+ if (zeroTo(8))
101
+ return { kind: 'blocked', reason: 'unspecified (::)' };
102
+ if (zeroTo(7) && g7 === 1)
103
+ return { kind: 'loopback' };
104
+ // an IPv4 address carried in IPv6: judged as that IPv4 address
105
+ const carried = (v4, form) => {
106
+ const inner = classifyV4(v4);
107
+ return inner.kind === 'blocked' ? { kind: 'blocked', reason: `${form} of ${v4}: ${inner.reason}` } : inner;
108
+ };
109
+ if (zeroTo(5) && g5 === 0xffff)
110
+ return carried(v4Of(g6, g7), 'IPv4-mapped IPv6');
111
+ if (zeroTo(6))
112
+ return carried(v4Of(g6, g7), 'IPv4-compatible IPv6');
113
+ if (g0 === 0x64 && g1 === 0xff9b && g2 === 0 && g3 === 0 && g4 === 0 && g5 === 0)
114
+ return carried(v4Of(g6, g7), 'NAT64 (64:ff9b::/96)');
115
+ if (g0 === 0x64 && g1 === 0xff9b && g2 === 1)
116
+ return { kind: 'blocked', reason: 'local-use NAT64 (64:ff9b:1::/48)' };
117
+ if (g0 === 0x2002)
118
+ return carried(v4Of(g1, g2), '6to4 (2002::/16)');
119
+ if (g0 === 0x2001 && g1 === 0)
120
+ return { kind: 'blocked', reason: 'Teredo tunnel (2001::/32)' };
121
+ if (g0 === 0x2001 && g1 === 0xdb8)
122
+ return { kind: 'blocked', reason: 'documentation (2001:db8::/32)' };
123
+ if (g0 === 0x2001 && (g1 & 0xfff0) === 0x10)
124
+ return { kind: 'blocked', reason: 'ORCHID (2001:10::/28)' };
125
+ if (g0 === 0x2001 && (g1 & 0xfff0) === 0x20)
126
+ return { kind: 'blocked', reason: 'ORCHIDv2 (2001:20::/28)' };
127
+ if (g0 === 0x100 && g1 === 0 && g2 === 0 && g3 === 0)
128
+ return { kind: 'blocked', reason: 'discard-only (100::/64)' };
129
+ if ((g0 & 0xfff0) === 0x3ff0 && g0 <= 0x3fff)
130
+ return { kind: 'blocked', reason: 'documentation (3fff::/20)' };
131
+ if ((g0 & 0xfe00) === 0xfc00)
132
+ return { kind: 'blocked', reason: 'unique-local (fc00::/7)' };
133
+ if ((g0 & 0xffc0) === 0xfe80)
134
+ return { kind: 'blocked', reason: 'link-local (fe80::/10)' };
135
+ if ((g0 & 0xffc0) === 0xfec0)
136
+ return { kind: 'blocked', reason: 'site-local (fec0::/10)' };
137
+ if ((g0 & 0xff00) === 0xff00)
138
+ return { kind: 'blocked', reason: 'multicast (ff00::/8)' };
139
+ // only global unicast (2000::/3) is public
140
+ if ((g0 & 0xe000) !== 0x2000)
141
+ return { kind: 'blocked', reason: 'outside global unicast (2000::/3)' };
142
+ return { kind: 'public' };
143
+ }
144
+ /** Classifies an IP address (IPv4 dotted, or IPv6 with or without brackets); anything else is `blocked`. */
145
+ export function classifyAddress(address) {
146
+ const bare = address.startsWith('[') && address.endsWith(']') ? address.slice(1, -1) : address;
147
+ const family = isIP(bare.split('%')[0] ?? '');
148
+ if (family === 4)
149
+ return classifyV4(bare);
150
+ if (family === 6)
151
+ return classifyV6(bare);
152
+ return { kind: 'blocked', reason: `"${address.slice(0, 64)}" is not an IP address` };
153
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * A shadcn-format registry item (https://ui.shadcn.com/schema/registry-item.json, read 4 Dec 2026), parsed from
3
+ * untrusted JSON by morph's own checks: every field it uses is typed and length-checked; fields it does not use are
4
+ * named in `notes`, never acted on. Facts: `name` and `type` are required; `files[]` has `path`, `content`, `type` and,
5
+ * for `registry:file` and `registry:page`, `target`; the `tailwind` field is deprecated (Tailwind v4 uses
6
+ * `cssVars.theme`); newer items import `cn` from an npm package named `cn` and list it in `dependencies`.
7
+ */
8
+ export declare const ITEM_TYPES: readonly ["registry:lib", "registry:block", "registry:component", "registry:ui", "registry:hook", "registry:theme", "registry:page", "registry:file", "registry:style", "registry:base", "registry:font", "registry:item"];
9
+ export type ItemType = (typeof ITEM_TYPES)[number];
10
+ /** `files[].type`: the item types minus `registry:font`. */
11
+ export type FileType = Exclude<ItemType, 'registry:font'>;
12
+ /** At most this many files across an item and every item it depends on. */
13
+ export declare const MAX_FILES = 30;
14
+ export interface RegistryFile {
15
+ /** the path as checked (relative, forward slashes) */
16
+ path: string;
17
+ content: string;
18
+ type: FileType;
19
+ /** the checked target path (relative to the project root), when given */
20
+ target?: string;
21
+ }
22
+ export interface RegistryItem {
23
+ name: string;
24
+ type: ItemType;
25
+ title?: string;
26
+ description?: string;
27
+ /** npm packages, `name` or `name@version` */
28
+ dependencies: string[];
29
+ devDependencies: string[];
30
+ /** other items: names, `@namespace/name`, URLs, `owner/repo/item`, local paths (not yet resolved) */
31
+ registryDependencies: string[];
32
+ files: RegistryFile[];
33
+ /** the item's install message (control characters removed) */
34
+ docs?: string;
35
+ /** what morph read but does not act on (`cssVars`, `css`, the deprecated `tailwind`, `envVars`, a font) */
36
+ notes: string[];
37
+ }
38
+ /** Parses one registry item from JSON text. `where` names it in errors (its URL or file). */
39
+ export declare function parseRegistryItem(json: string, where: string): RegistryItem;
@@ -0,0 +1,131 @@
1
+ import { MorphError } from '../utils/errors.js';
2
+ import { MAX_INPUT_BYTES } from '../utils/fs-safe.js';
3
+ import { safeRelativePath } from './paths.js';
4
+ /**
5
+ * A shadcn-format registry item (https://ui.shadcn.com/schema/registry-item.json, read 4 Dec 2026), parsed from
6
+ * untrusted JSON by morph's own checks: every field it uses is typed and length-checked; fields it does not use are
7
+ * named in `notes`, never acted on. Facts: `name` and `type` are required; `files[]` has `path`, `content`, `type` and,
8
+ * for `registry:file` and `registry:page`, `target`; the `tailwind` field is deprecated (Tailwind v4 uses
9
+ * `cssVars.theme`); newer items import `cn` from an npm package named `cn` and list it in `dependencies`.
10
+ */
11
+ export const ITEM_TYPES = ['registry:lib', 'registry:block', 'registry:component', 'registry:ui', 'registry:hook', 'registry:theme', 'registry:page', 'registry:file', 'registry:style', 'registry:base', 'registry:font', 'registry:item'];
12
+ /** At most this many files across an item and every item it depends on. */
13
+ export const MAX_FILES = 30;
14
+ const MAX_NAME = 128;
15
+ const MAX_TEXT = 2000;
16
+ const MAX_DOCS = 4000;
17
+ const MAX_LIST = 50;
18
+ const MAX_DEP_REF = 512;
19
+ const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
20
+ /** an npm package name, optionally with a version or range after `@` */
21
+ const NPM_SPEC = /^(@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*(@[A-Za-z0-9.^~<>=*|+ -]{1,64})?$/;
22
+ const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
23
+ // control characters other than tab and newline are dropped from text that is printed
24
+ const printable = (s, max) => s.replace(/[\u0000-\u0008\u000b-\u001f\u007f\u001b]/g, '').slice(0, max);
25
+ function text(o, key, max, where) {
26
+ const v = o[key];
27
+ if (v === undefined || v === null)
28
+ return undefined;
29
+ if (typeof v !== 'string')
30
+ throw new MorphError('registry-item', `${where}: "${key}" must be a string.`);
31
+ if (v.length > max)
32
+ throw new MorphError('registry-item', `${where}: "${key}" is over ${max} characters.`);
33
+ return v;
34
+ }
35
+ function list(o, key, where, check) {
36
+ const v = o[key];
37
+ if (v === undefined || v === null)
38
+ return [];
39
+ if (!Array.isArray(v))
40
+ throw new MorphError('registry-item', `${where}: "${key}" must be a list of strings.`);
41
+ if (v.length > MAX_LIST)
42
+ throw new MorphError('registry-item', `${where}: "${key}" has more than ${MAX_LIST} entries.`);
43
+ const out = [];
44
+ v.forEach((s, i) => {
45
+ if (typeof s !== 'string' || !s.length)
46
+ throw new MorphError('registry-item', `${where}: "${key}"[${i}] must be a non-empty string.`);
47
+ check(s, i);
48
+ out.push(s);
49
+ });
50
+ return out;
51
+ }
52
+ const isItemType = (v) => typeof v === 'string' && ITEM_TYPES.includes(v);
53
+ /** Parses one registry item from JSON text. `where` names it in errors (its URL or file). */
54
+ export function parseRegistryItem(json, where) {
55
+ let raw;
56
+ try {
57
+ raw = JSON.parse(json);
58
+ }
59
+ catch (error) {
60
+ throw new MorphError('registry-json', `${where} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
61
+ }
62
+ if (!isRecord(raw))
63
+ throw new MorphError('registry-item', `${where} is not a registry item (a JSON object).`);
64
+ const name = text(raw, 'name', MAX_NAME, where);
65
+ if (!name || !NAME.test(name))
66
+ throw new MorphError('registry-item', `${where}: "name" is required: letters, digits, ".", "_" and "-", at most ${MAX_NAME} characters.`);
67
+ const type = raw['type'];
68
+ if (!isItemType(type))
69
+ throw new MorphError('registry-item', `${where}: "type" must be one of ${ITEM_TYPES.join(', ')}.`);
70
+ const title = text(raw, 'title', MAX_TEXT, where);
71
+ const description = text(raw, 'description', MAX_TEXT, where);
72
+ const docs = text(raw, 'docs', MAX_DOCS, where);
73
+ const npm = (key) => (s, i) => {
74
+ if (s.length > 214 + 65 || !NPM_SPEC.test(s))
75
+ throw new MorphError('registry-item', `${where}: "${key}"[${i}] "${s.slice(0, 80)}" is not an npm package name.`);
76
+ };
77
+ const dependencies = list(raw, 'dependencies', where, npm('dependencies'));
78
+ const devDependencies = list(raw, 'devDependencies', where, npm('devDependencies'));
79
+ const registryDependencies = list(raw, 'registryDependencies', where, (s, i) => {
80
+ if (s.length > MAX_DEP_REF || /[\u0000-\u001f\u007f\s]/.test(s))
81
+ throw new MorphError('registry-item', `${where}: "registryDependencies"[${i}] is not a valid reference.`);
82
+ });
83
+ const rawFiles = raw['files'] ?? [];
84
+ if (!Array.isArray(rawFiles))
85
+ throw new MorphError('registry-item', `${where}: "files" must be a list.`);
86
+ if (rawFiles.length > MAX_FILES)
87
+ throw new MorphError('registry-too-many-files', `${where} has ${rawFiles.length} files; at most ${MAX_FILES} are taken.`);
88
+ const files = rawFiles.map((f, i) => {
89
+ const at = `${where}: files[${i}]`;
90
+ if (!isRecord(f))
91
+ throw new MorphError('registry-item', `${at} must be an object.`);
92
+ const path = text(f, 'path', 1000, at);
93
+ if (!path)
94
+ throw new MorphError('registry-item', `${at}: "path" is required.`);
95
+ const content = f['content'];
96
+ if (typeof content !== 'string')
97
+ throw new MorphError('registry-item', `${at}: "content" must be a string (an item without file contents cannot be added).`);
98
+ if (Buffer.byteLength(content, 'utf8') > MAX_INPUT_BYTES)
99
+ throw new MorphError('input-too-large', `${at}: "content" is over ${MAX_INPUT_BYTES / 1024} KB.`);
100
+ const ft = f['type'];
101
+ if (!isItemType(ft) || ft === 'registry:font')
102
+ throw new MorphError('registry-item', `${at}: "type" must be a file type (${ITEM_TYPES.filter((t) => t !== 'registry:font').join(', ')}).`);
103
+ const target = text(f, 'target', 1000, at);
104
+ if ((ft === 'registry:file' || ft === 'registry:page') && !target)
105
+ throw new MorphError('registry-item', `${at}: a ${ft} file needs a "target".`);
106
+ return { path: safeRelativePath(path, `${at} path`), content, type: ft, ...(target ? { target: safeRelativePath(target, `${at} target`) } : {}) };
107
+ });
108
+ const notes = [];
109
+ if (isRecord(raw['cssVars']))
110
+ notes.push(`${name}: "cssVars" (theme variables) was not applied; add them to your CSS yourself.`);
111
+ if (raw['css'] !== undefined)
112
+ notes.push(`${name}: "css" (extra CSS rules) was not applied; add it to your CSS yourself.`);
113
+ if (raw['tailwind'] !== undefined)
114
+ notes.push(`${name}: "tailwind" is deprecated in the registry format (Tailwind v4 uses cssVars.theme) and was ignored.`);
115
+ if (raw['envVars'] !== undefined)
116
+ notes.push(`${name}: "envVars" were not written; morph writes no .env file.`);
117
+ if (raw['font'] !== undefined)
118
+ notes.push(`${name}: the font was not installed.`);
119
+ return {
120
+ name,
121
+ type,
122
+ ...(title !== undefined ? { title: printable(title, MAX_TEXT) } : {}),
123
+ ...(description !== undefined ? { description: printable(description, MAX_TEXT) } : {}),
124
+ dependencies,
125
+ devDependencies,
126
+ registryDependencies,
127
+ files,
128
+ ...(docs !== undefined ? { docs: printable(docs, MAX_DOCS) } : {}),
129
+ notes,
130
+ };
131
+ }
@@ -0,0 +1,35 @@
1
+ import { type RegistryFetchOptions } from './fetch.js';
2
+ import { type RegistryItem } from './item.js';
3
+ /** At most this many `registryDependencies` are followed (fetched or read) for one `add`. */
4
+ export declare const MAX_DEPENDENCIES = 10;
5
+ /**
6
+ * The shadcn registry's built-in items. Facts (notes v03/web-facts.md, 4 Dec 2026): the docs' `/r/{name}.json` gave 404
7
+ * for a plain component; the CLI's own source uses `https://ui.shadcn.com/r/styles/{style}/{name}.json` with the
8
+ * fallback style `new-york-v4`, and both were verified live there.
9
+ */
10
+ export declare const BUILTIN_REGISTRY = "https://ui.shadcn.com/r/styles/{style}/{name}.json";
11
+ export declare const DEFAULT_STYLE = "new-york-v4";
12
+ export interface LoadOptions extends RegistryFetchOptions {
13
+ /** the `{style}` of built-in item URLs (default new-york-v4) */
14
+ style?: string;
15
+ /** TESTS ONLY, programmatic: the URL template for plain names and `@shadcn/<name>` (default BUILTIN_REGISTRY) */
16
+ builtinUrl?: string;
17
+ }
18
+ export interface LoadedItem {
19
+ item: RegistryItem;
20
+ /** the URL or absolute file path it came from */
21
+ source: string;
22
+ /** the item the user named (false for a dependency) */
23
+ root: boolean;
24
+ }
25
+ export interface LoadResult {
26
+ items: LoadedItem[];
27
+ /** dependencies not followed, each with the reason */
28
+ skipped: string[];
29
+ }
30
+ /**
31
+ * Reads the item the user named (an https URL or a local .json file) and the items it depends on, breadth first:
32
+ * at most 10 dependencies followed, each URL or file once (so a cycle ends), at most 30 files in all. Every URL goes
33
+ * through the SSRF guard (fetch.ts).
34
+ */
35
+ export declare function loadRegistryItems(input: string, options?: LoadOptions): Promise<LoadResult>;
@@ -0,0 +1,106 @@
1
+ import { existsSync, readFileSync, statSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { MorphError } from '../utils/errors.js';
4
+ import { resolveInside } from '../utils/fs-safe.js';
5
+ import { MAX_REGISTRY_BYTES, fetchRegistryText } from './fetch.js';
6
+ import { MAX_FILES, parseRegistryItem } from './item.js';
7
+ /** At most this many `registryDependencies` are followed (fetched or read) for one `add`. */
8
+ export const MAX_DEPENDENCIES = 10;
9
+ /**
10
+ * The shadcn registry's built-in items. Facts (notes v03/web-facts.md, 4 Dec 2026): the docs' `/r/{name}.json` gave 404
11
+ * for a plain component; the CLI's own source uses `https://ui.shadcn.com/r/styles/{style}/{name}.json` with the
12
+ * fallback style `new-york-v4`, and both were verified live there.
13
+ */
14
+ export const BUILTIN_REGISTRY = 'https://ui.shadcn.com/r/styles/{style}/{name}.json';
15
+ export const DEFAULT_STYLE = 'new-york-v4';
16
+ const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
17
+ const NAMESPACED = /^(@[a-zA-Z0-9](?:[a-zA-Z0-9-_]*[a-zA-Z0-9])?)\/(.+)$/;
18
+ const GITHUB = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(#[A-Za-z0-9_.-]+)?$/;
19
+ const STYLE = /^[a-z0-9][a-z0-9-]{0,63}$/;
20
+ const isUrl = (s) => /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(s);
21
+ function readLocal(path) {
22
+ const full = resolve(path);
23
+ if (!existsSync(full) || !statSync(full).isFile())
24
+ throw new MorphError('not-found', `Registry item not found: ${path}`);
25
+ const size = statSync(full).size;
26
+ if (size > MAX_REGISTRY_BYTES)
27
+ throw new MorphError('registry-too-large', `${path} is ${size} bytes; the limit is ${MAX_REGISTRY_BYTES}.`);
28
+ return { source: full, text: readFileSync(full, 'utf8') };
29
+ }
30
+ /** Where a `registryDependencies` entry points, judged against the item that names it. */
31
+ function refFor(dep, from, options) {
32
+ const builtin = (name) => {
33
+ if (!NAME.test(name) || name.length > 128)
34
+ return { kind: 'skip', reason: `"${dep.slice(0, 80)}" is not an item name` };
35
+ const style = options.style ?? DEFAULT_STYLE;
36
+ if (!STYLE.test(style))
37
+ throw new MorphError('registry-url', `"${style}" is not a registry style name.`);
38
+ return { kind: 'url', url: (options.builtinUrl ?? BUILTIN_REGISTRY).replace('{style}', encodeURIComponent(style)).replace('{name}', encodeURIComponent(name)) };
39
+ };
40
+ if (isUrl(dep))
41
+ return { kind: 'url', url: dep };
42
+ const ns = NAMESPACED.exec(dep);
43
+ if (ns) {
44
+ if (ns[1] === '@shadcn')
45
+ return builtin(ns[2] ?? '');
46
+ return { kind: 'skip', reason: `"${dep.slice(0, 80)}": the ${ns[1]} namespace is configured in a project's components.json, which morph does not read; add that item by its URL` };
47
+ }
48
+ if (dep.startsWith('./') || dep.startsWith('../') || dep.endsWith('.json')) {
49
+ // registry content from the network never makes morph read a local file
50
+ if (isUrl(from.source))
51
+ return { kind: 'skip', reason: `"${dep.slice(0, 80)}": a local path named by an item fetched from a URL is not read` };
52
+ return { kind: 'file', path: resolveInside(dirname(from.source), dep) };
53
+ }
54
+ if (GITHUB.test(dep))
55
+ return { kind: 'skip', reason: `"${dep.slice(0, 80)}": GitHub registry references are not followed; add that item by its URL` };
56
+ if (NAME.test(dep))
57
+ return builtin(dep);
58
+ return { kind: 'skip', reason: `"${dep.slice(0, 80)}" is not a reference morph follows` };
59
+ }
60
+ /**
61
+ * Reads the item the user named (an https URL or a local .json file) and the items it depends on, breadth first:
62
+ * at most 10 dependencies followed, each URL or file once (so a cycle ends), at most 30 files in all. Every URL goes
63
+ * through the SSRF guard (fetch.ts).
64
+ */
65
+ export async function loadRegistryItems(input, options = {}) {
66
+ const first = isUrl(input) ? await fetchRegistryText(input, options).then((r) => ({ source: r.url, text: r.text })) : readLocal(input);
67
+ const root = { item: parseRegistryItem(first.text, first.source), source: first.source, root: true };
68
+ const items = [root];
69
+ const skipped = [];
70
+ const visited = new Set([first.source, isUrl(input) ? input : resolve(input)]);
71
+ let followed = 0;
72
+ let files = root.item.files.length;
73
+ const queue = [root];
74
+ while (queue.length) {
75
+ const from = queue.shift();
76
+ if (!from)
77
+ break;
78
+ for (const dep of from.item.registryDependencies) {
79
+ const ref = refFor(dep, from, options);
80
+ if (ref.kind === 'skip') {
81
+ skipped.push(`${from.item.name} -> ${ref.reason}`);
82
+ continue;
83
+ }
84
+ const key = ref.kind === 'url' ? ref.url : ref.path;
85
+ if (visited.has(key))
86
+ continue;
87
+ visited.add(key);
88
+ if (followed >= MAX_DEPENDENCIES) {
89
+ skipped.push(`${from.item.name} -> "${dep.slice(0, 80)}": not followed, at most ${MAX_DEPENDENCIES} dependencies are followed`);
90
+ continue;
91
+ }
92
+ followed++;
93
+ const got = ref.kind === 'url' ? await fetchRegistryText(ref.url, options).then((r) => ({ source: r.url, text: r.text })) : readLocal(ref.path);
94
+ if (visited.has(got.source) && got.source !== key)
95
+ continue;
96
+ visited.add(got.source);
97
+ const loaded = { item: parseRegistryItem(got.text, got.source), source: got.source, root: false };
98
+ files += loaded.item.files.length;
99
+ if (files > MAX_FILES)
100
+ throw new MorphError('registry-too-many-files', `The item and its dependencies have more than ${MAX_FILES} files; at most ${MAX_FILES} are taken.`);
101
+ items.push(loaded);
102
+ queue.push(loaded);
103
+ }
104
+ }
105
+ return { items, skipped };
106
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A file path from registry content (untrusted), normalised to forward slashes and checked: refused when empty,
3
+ * absolute (`/x`, `\x`), with a drive letter or a scheme (`C:`, `file:`), a `~` home path other than the documented
4
+ * `~/` project root prefix, a `.` or `..` segment, NUL or another control character, a reserved Windows name, a
5
+ * segment ending in a dot or a space (Windows drops those), or more than 300 characters or 12 folders. Returns the
6
+ * relative path (`components/ui/button.tsx`).
7
+ */
8
+ export declare function safeRelativePath(raw: string, what: string): string;
@@ -0,0 +1,43 @@
1
+ import { MorphError } from '../utils/errors.js';
2
+ /** Windows device names: refused as a path segment with or without an extension (`con`, `nul.tsx`, `COM1.json`). */
3
+ const RESERVED = /^(con|prn|aux|nul|com[0-9¹²³]|lpt[0-9¹²³]|conin\$|conout\$)(\..*)?$/i;
4
+ const MAX_PATH = 300;
5
+ const MAX_DEPTH = 12;
6
+ /**
7
+ * A file path from registry content (untrusted), normalised to forward slashes and checked: refused when empty,
8
+ * absolute (`/x`, `\x`), with a drive letter or a scheme (`C:`, `file:`), a `~` home path other than the documented
9
+ * `~/` project root prefix, a `.` or `..` segment, NUL or another control character, a reserved Windows name, a
10
+ * segment ending in a dot or a space (Windows drops those), or more than 300 characters or 12 folders. Returns the
11
+ * relative path (`components/ui/button.tsx`).
12
+ */
13
+ export function safeRelativePath(raw, what) {
14
+ if (typeof raw !== 'string' || !raw.length)
15
+ throw new MorphError('registry-path', `${what}: the path is empty.`);
16
+ if (raw.length > MAX_PATH)
17
+ throw new MorphError('registry-path', `${what}: the path is over ${MAX_PATH} characters.`);
18
+ if (/[\u0000-\u001f\u007f]/.test(raw))
19
+ throw new MorphError('registry-path', `${what}: the path holds a control character.`);
20
+ let p = raw.replace(/\\/g, '/');
21
+ if (p.startsWith('~/'))
22
+ p = p.slice(2);
23
+ if (p.startsWith('/') || p.startsWith('~'))
24
+ throw new MorphError('registry-path', `${what}: "${raw.slice(0, 120)}" is an absolute path.`);
25
+ if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(p) || p.includes(':'))
26
+ throw new MorphError('registry-path', `${what}: "${raw.slice(0, 120)}" holds a drive letter, a scheme or a colon.`);
27
+ const segments = p.split('/').filter((s) => s.length);
28
+ if (!segments.length)
29
+ throw new MorphError('registry-path', `${what}: the path is empty.`);
30
+ if (segments.length > MAX_DEPTH + 1)
31
+ throw new MorphError('registry-path', `${what}: the path is more than ${MAX_DEPTH} folders deep.`);
32
+ for (const s of segments) {
33
+ if (s === '.' || s === '..')
34
+ throw new MorphError('registry-path', `${what}: "${raw.slice(0, 120)}" holds a "${s}" segment.`);
35
+ if (RESERVED.test(s))
36
+ throw new MorphError('registry-path', `${what}: "${s}" is a reserved Windows name.`);
37
+ if (/[. ]$/.test(s))
38
+ throw new MorphError('registry-path', `${what}: the segment "${s.slice(0, 60)}" ends in a dot or a space.`);
39
+ if (/[<>"|?*]/.test(s))
40
+ throw new MorphError('registry-path', `${what}: the segment "${s.slice(0, 60)}" holds a character Windows does not allow in a file name.`);
41
+ }
42
+ return segments.join('/');
43
+ }
@@ -0,0 +1,119 @@
1
+ import type { BatchReport, Status, StatusCounts, WebTarget } from '../types.js';
2
+ /**
3
+ * `antheo-morph publish <folder> --out <dir>` (v0.3 Milestone C): a folder of React components becomes one shadcn-format
4
+ * registry per web target, `<out>/<target>/registry.json` (the index) and one `<name>.json` item per converted
5
+ * component, plus `<out>/SCORECARD.md` and `<out>/scorecard.json`.
6
+ *
7
+ * The folder goes through the existing `batch` (so the statuses are exactly batch's: a worker thread per file, a
8
+ * timeout, validation by the targets' real compilers, the strict type check). `batch` returns statuses, not files, so
9
+ * each file that came out clean or partial is compiled once more, in this process, for the files that go into its
10
+ * item; a file whose second compile does not give the status `batch` gave is not published. Every item is parsed back
11
+ * through `parseRegistryItem`, the parser `antheo-morph add` reads items with, before it is written: an item that
12
+ * parser would refuse (a file over its size limit, a path it does not accept) is not written, and says why in the
13
+ * scorecard. An unsupported component gets no item. Every write goes through `writeInside` under `--out`.
14
+ */
15
+ /** The targets a registry is published for, in the order they are written. */
16
+ export declare const PUBLISH_TARGETS: readonly WebTarget[];
17
+ export interface PublishOptions {
18
+ /** the folder the registries and the scorecard are written under (`<out>/vue/registry.json`, `<out>/SCORECARD.md`, ...) */
19
+ out: string;
20
+ /** default: vue, svelte and angular */
21
+ targets?: WebTarget[];
22
+ /** where the registry will be served from (https): a shared file becomes the dependency `<baseUrl>/<target>/<name>.json`; without it, `./<name>.json` */
23
+ baseUrl?: string;
24
+ /** run `verify` (auto-steps and unmount) on every component that is clean, one at a time, and record the lowest match and the leak status */
25
+ verify?: boolean;
26
+ include?: string[];
27
+ exclude?: string[];
28
+ /** project root (default: the nearest folder with a tsconfig.json or package.json, as batch finds it) */
29
+ root?: string;
30
+ /** run the strict type check (default true) */
31
+ typecheck?: boolean;
32
+ /** Chrome or Chromium executable for `verify` */
33
+ chrome?: string;
34
+ /** the longest one file may take in the batch, ms */
35
+ fileTimeoutMs?: number;
36
+ signal?: AbortSignal;
37
+ /** a line of progress ("compiling 3/12 ui/button.tsx", "verifying button") */
38
+ onProgress?: (message: string) => void;
39
+ }
40
+ /** What `verify` found for one component on one target. */
41
+ export interface VerifyCard {
42
+ /** the lowest pixel match over every state and step, 0 to 1 */
43
+ lowestMatch: number;
44
+ /** nothing left running after unmount that React does not leave; null when it was not measured */
45
+ leakFree: boolean | null;
46
+ pageErrors: number;
47
+ /** verify itself failed on this component (the message); the other fields are then 0, null and 0 */
48
+ error?: string;
49
+ }
50
+ export interface TargetCard {
51
+ status: Status;
52
+ validated: boolean;
53
+ /** the strict type check ran and found nothing, or (Angular) the Angular compiler's strict pass accepted it */
54
+ typechecked: boolean;
55
+ published: boolean;
56
+ /** the item's file under the out folder (`vue/press-button.json`) when it was published */
57
+ item?: string;
58
+ /** why there is no item, when there is none */
59
+ reason?: string;
60
+ /** the codes of the compile's warnings and errors */
61
+ codes: string[];
62
+ verify?: VerifyCard;
63
+ }
64
+ export interface ComponentCard {
65
+ /** the source file, relative to the project root */
66
+ file: string;
67
+ /** the item name */
68
+ name: string;
69
+ targets: Partial<Record<WebTarget, TargetCard>>;
70
+ }
71
+ export interface TargetTotals {
72
+ files: number;
73
+ counts: StatusCounts;
74
+ published: number;
75
+ /** with `verify`: components verified, and how many of those matched 99% everywhere and left nothing running */
76
+ verified?: {
77
+ run: number;
78
+ passed: number;
79
+ };
80
+ }
81
+ export interface Scorecard {
82
+ generatedAt: string;
83
+ /** the name of the folder that was published (never its path) */
84
+ folder: string;
85
+ targets: WebTarget[];
86
+ verify: boolean;
87
+ baseUrl: string | null;
88
+ totals: Partial<Record<WebTarget, TargetTotals>>;
89
+ components: ComponentCard[];
90
+ /** the most common causes batch found */
91
+ causes: BatchReport['topCauses'];
92
+ /** things worth knowing that are not one component's: shared files that differ between components, and the like */
93
+ notes: string[];
94
+ }
95
+ export interface PublishedRegistry {
96
+ target: WebTarget;
97
+ /** `vue/registry.json`, relative to the out folder */
98
+ index: string;
99
+ /** the component items written, as `vue/<name>.json` */
100
+ items: string[];
101
+ /** the shared files written as items of their own, as `vue/<name>.json` */
102
+ shared: string[];
103
+ }
104
+ export interface PublishResult {
105
+ /** the out folder, absolute */
106
+ out: string;
107
+ registries: PublishedRegistry[];
108
+ scorecard: Scorecard;
109
+ /** every file written, relative to the out folder */
110
+ written: string[];
111
+ }
112
+ /** `PressButton` to `press-button`; a path's slashes and dots become dashes. */
113
+ export declare function kebab(raw: string): string;
114
+ /** One item name per source file: its file name, kebab-cased; a name two files share is taken from the whole path, and a name still taken gets a number. */
115
+ export declare function itemNames(files: readonly string[]): Map<string, string>;
116
+ /** SCORECARD.md: the same facts as scorecard.json, for people. */
117
+ export declare function scorecardMarkdown(card: Scorecard): string;
118
+ /** Publishes a folder of React components as shadcn-format registries. See the module comment. */
119
+ export declare function publishFolder(input: string, options: PublishOptions): Promise<PublishResult>;