@astrale-os/kernel-dsl 0.1.4 → 0.2.0-beta.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 (763) hide show
  1. package/dist/index.d.ts +1 -52
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -29
  4. package/dist/index.js.map +1 -0
  5. package/dist/upgrade/contract.d.ts +32 -0
  6. package/dist/upgrade/contract.d.ts.map +1 -0
  7. package/dist/upgrade/contract.js +2 -0
  8. package/dist/upgrade/contract.js.map +1 -0
  9. package/dist/upgrade/index.d.ts +2 -0
  10. package/dist/upgrade/index.d.ts.map +1 -0
  11. package/dist/upgrade/index.js +2 -0
  12. package/dist/upgrade/index.js.map +1 -0
  13. package/dist/v1/addressing/index.d.ts +6 -0
  14. package/dist/v1/addressing/index.d.ts.map +1 -0
  15. package/dist/v1/addressing/index.js +5 -0
  16. package/dist/v1/addressing/index.js.map +1 -0
  17. package/dist/v1/addressing/key.d.ts +21 -0
  18. package/dist/v1/addressing/key.d.ts.map +1 -0
  19. package/dist/v1/addressing/key.js +49 -0
  20. package/dist/v1/addressing/key.js.map +1 -0
  21. package/dist/v1/addressing/patterns.d.ts +18 -0
  22. package/dist/v1/addressing/patterns.d.ts.map +1 -0
  23. package/dist/v1/addressing/patterns.js +20 -0
  24. package/dist/v1/addressing/patterns.js.map +1 -0
  25. package/dist/v1/addressing/property-key.d.ts +18 -0
  26. package/dist/v1/addressing/property-key.d.ts.map +1 -0
  27. package/dist/v1/addressing/property-key.js +30 -0
  28. package/dist/v1/addressing/property-key.js.map +1 -0
  29. package/dist/v1/addressing/ref.d.ts +35 -0
  30. package/dist/v1/addressing/ref.d.ts.map +1 -0
  31. package/dist/v1/addressing/ref.js +94 -0
  32. package/dist/v1/addressing/ref.js.map +1 -0
  33. package/dist/v1/addressing/schema-ref.d.ts +8 -0
  34. package/dist/v1/addressing/schema-ref.d.ts.map +1 -0
  35. package/dist/v1/addressing/schema-ref.js +2 -0
  36. package/dist/v1/addressing/schema-ref.js.map +1 -0
  37. package/dist/v1/builder/callable.d.ts +81 -0
  38. package/dist/v1/builder/callable.d.ts.map +1 -0
  39. package/dist/v1/builder/callable.js +44 -0
  40. package/dist/v1/builder/callable.js.map +1 -0
  41. package/dist/v1/builder/compiler/callable.d.ts +20 -0
  42. package/dist/v1/builder/compiler/callable.d.ts.map +1 -0
  43. package/dist/v1/builder/compiler/callable.js +139 -0
  44. package/dist/v1/builder/compiler/callable.js.map +1 -0
  45. package/dist/v1/builder/compiler/core.d.ts +6 -0
  46. package/dist/v1/builder/compiler/core.d.ts.map +1 -0
  47. package/dist/v1/builder/compiler/core.js +44 -0
  48. package/dist/v1/builder/compiler/core.js.map +1 -0
  49. package/dist/v1/builder/compiler/core.properties.d.ts +6 -0
  50. package/dist/v1/builder/compiler/core.properties.d.ts.map +1 -0
  51. package/dist/v1/builder/compiler/core.properties.js +70 -0
  52. package/dist/v1/builder/compiler/core.properties.js.map +1 -0
  53. package/dist/v1/builder/compiler/definition.d.ts +26 -0
  54. package/dist/v1/builder/compiler/definition.d.ts.map +1 -0
  55. package/dist/v1/builder/compiler/definition.js +154 -0
  56. package/dist/v1/builder/compiler/definition.js.map +1 -0
  57. package/dist/v1/builder/compiler/policy.d.ts +17 -0
  58. package/dist/v1/builder/compiler/policy.d.ts.map +1 -0
  59. package/dist/v1/builder/compiler/policy.js +54 -0
  60. package/dist/v1/builder/compiler/policy.js.map +1 -0
  61. package/dist/v1/builder/compiler/schema.capture.d.ts +5 -0
  62. package/dist/v1/builder/compiler/schema.capture.d.ts.map +1 -0
  63. package/dist/v1/builder/compiler/schema.capture.js +85 -0
  64. package/dist/v1/builder/compiler/schema.capture.js.map +1 -0
  65. package/dist/v1/builder/compiler/schema.context.d.ts +45 -0
  66. package/dist/v1/builder/compiler/schema.context.d.ts.map +1 -0
  67. package/dist/v1/builder/compiler/schema.context.js +255 -0
  68. package/dist/v1/builder/compiler/schema.context.js.map +1 -0
  69. package/dist/v1/builder/compiler/schema.d.ts +10 -0
  70. package/dist/v1/builder/compiler/schema.d.ts.map +1 -0
  71. package/dist/v1/builder/compiler/schema.js +90 -0
  72. package/dist/v1/builder/compiler/schema.js.map +1 -0
  73. package/dist/v1/builder/compiler/schema.ownership.d.ts +9 -0
  74. package/dist/v1/builder/compiler/schema.ownership.d.ts.map +1 -0
  75. package/dist/v1/builder/compiler/schema.ownership.js +30 -0
  76. package/dist/v1/builder/compiler/schema.ownership.js.map +1 -0
  77. package/dist/v1/builder/compiler/value.d.ts +22 -0
  78. package/dist/v1/builder/compiler/value.d.ts.map +1 -0
  79. package/dist/v1/builder/compiler/value.js +149 -0
  80. package/dist/v1/builder/compiler/value.js.map +1 -0
  81. package/dist/v1/builder/compiler/value.path.d.ts +4 -0
  82. package/dist/v1/builder/compiler/value.path.d.ts.map +1 -0
  83. package/dist/v1/builder/compiler/value.path.js +21 -0
  84. package/dist/v1/builder/compiler/value.path.js.map +1 -0
  85. package/dist/v1/builder/compiler/value.zod.d.ts +33 -0
  86. package/dist/v1/builder/compiler/value.zod.d.ts.map +1 -0
  87. package/dist/v1/builder/compiler/value.zod.js +343 -0
  88. package/dist/v1/builder/compiler/value.zod.js.map +1 -0
  89. package/dist/v1/builder/compiler/view.d.ts +12 -0
  90. package/dist/v1/builder/compiler/view.d.ts.map +1 -0
  91. package/dist/v1/builder/compiler/view.js +27 -0
  92. package/dist/v1/builder/compiler/view.js.map +1 -0
  93. package/dist/v1/builder/core.d.ts +27 -0
  94. package/dist/v1/builder/core.d.ts.map +1 -0
  95. package/dist/v1/builder/core.js +21 -0
  96. package/dist/v1/builder/core.js.map +1 -0
  97. package/dist/v1/builder/definition.d.ts +105 -0
  98. package/dist/v1/builder/definition.d.ts.map +1 -0
  99. package/dist/v1/builder/definition.js +97 -0
  100. package/dist/v1/builder/definition.js.map +1 -0
  101. package/dist/v1/builder/full-match.d.ts +12 -0
  102. package/dist/v1/builder/full-match.d.ts.map +1 -0
  103. package/dist/v1/builder/full-match.js +21 -0
  104. package/dist/v1/builder/full-match.js.map +1 -0
  105. package/dist/v1/builder/index.d.ts +22 -0
  106. package/dist/v1/builder/index.d.ts.map +1 -0
  107. package/dist/v1/builder/index.js +11 -0
  108. package/dist/v1/builder/index.js.map +1 -0
  109. package/dist/v1/builder/internal/authoring.d.ts +8 -0
  110. package/dist/v1/builder/internal/authoring.d.ts.map +1 -0
  111. package/dist/v1/builder/internal/authoring.js +15 -0
  112. package/dist/v1/builder/internal/authoring.js.map +1 -0
  113. package/dist/v1/builder/internal/authoring.lazy.d.ts +3 -0
  114. package/dist/v1/builder/internal/authoring.lazy.d.ts.map +1 -0
  115. package/dist/v1/builder/internal/authoring.lazy.js +14 -0
  116. package/dist/v1/builder/internal/authoring.lazy.js.map +1 -0
  117. package/dist/v1/builder/internal/diagnostic.d.ts +4 -0
  118. package/dist/v1/builder/internal/diagnostic.d.ts.map +1 -0
  119. package/dist/v1/builder/internal/diagnostic.js +16 -0
  120. package/dist/v1/builder/internal/diagnostic.js.map +1 -0
  121. package/dist/v1/builder/internal/path.metadata.d.ts +5 -0
  122. package/dist/v1/builder/internal/path.metadata.d.ts.map +1 -0
  123. package/dist/v1/builder/internal/path.metadata.js +8 -0
  124. package/dist/v1/builder/internal/path.metadata.js.map +1 -0
  125. package/dist/v1/builder/path.d.ts +9 -0
  126. package/dist/v1/builder/path.d.ts.map +1 -0
  127. package/dist/v1/builder/path.js +12 -0
  128. package/dist/v1/builder/path.js.map +1 -0
  129. package/dist/v1/builder/policy.d.ts +50 -0
  130. package/dist/v1/builder/policy.d.ts.map +1 -0
  131. package/dist/v1/builder/policy.js +79 -0
  132. package/dist/v1/builder/policy.js.map +1 -0
  133. package/dist/v1/builder/property.d.ts +23 -0
  134. package/dist/v1/builder/property.d.ts.map +1 -0
  135. package/dist/v1/builder/property.js +12 -0
  136. package/dist/v1/builder/property.js.map +1 -0
  137. package/dist/v1/builder/schema.d.ts +6 -0
  138. package/dist/v1/builder/schema.d.ts.map +1 -0
  139. package/dist/v1/builder/schema.input.d.ts +19 -0
  140. package/dist/v1/builder/schema.input.d.ts.map +1 -0
  141. package/dist/v1/builder/schema.input.js +2 -0
  142. package/dist/v1/builder/schema.input.js.map +1 -0
  143. package/dist/v1/builder/schema.js +6 -0
  144. package/dist/v1/builder/schema.js.map +1 -0
  145. package/dist/v1/builder/value-schema.d.ts +17 -0
  146. package/dist/v1/builder/value-schema.d.ts.map +1 -0
  147. package/dist/v1/builder/value-schema.js +11 -0
  148. package/dist/v1/builder/value-schema.js.map +1 -0
  149. package/dist/v1/builder/view.d.ts +19 -0
  150. package/dist/v1/builder/view.d.ts.map +1 -0
  151. package/dist/v1/builder/view.js +7 -0
  152. package/dist/v1/builder/view.js.map +1 -0
  153. package/dist/v1/builder.d.ts +3 -0
  154. package/dist/v1/builder.d.ts.map +1 -0
  155. package/dist/v1/builder.js +2 -0
  156. package/dist/v1/builder.js.map +1 -0
  157. package/dist/v1/bundle/codec.d.ts +6 -0
  158. package/dist/v1/bundle/codec.d.ts.map +1 -0
  159. package/dist/v1/bundle/codec.js +151 -0
  160. package/dist/v1/bundle/codec.js.map +1 -0
  161. package/dist/v1/bundle/index.d.ts +17 -0
  162. package/dist/v1/bundle/index.d.ts.map +1 -0
  163. package/dist/v1/bundle/index.js +20 -0
  164. package/dist/v1/bundle/index.js.map +1 -0
  165. package/dist/v1/bundle/model.d.ts +19 -0
  166. package/dist/v1/bundle/model.d.ts.map +1 -0
  167. package/dist/v1/bundle/model.js +17 -0
  168. package/dist/v1/bundle/model.js.map +1 -0
  169. package/dist/v1/bundle/structure.d.ts +8 -0
  170. package/dist/v1/bundle/structure.d.ts.map +1 -0
  171. package/dist/v1/bundle/structure.js +71 -0
  172. package/dist/v1/bundle/structure.js.map +1 -0
  173. package/dist/v1/bundle.d.ts +3 -0
  174. package/dist/v1/bundle.d.ts.map +1 -0
  175. package/dist/v1/bundle.js +3 -0
  176. package/dist/v1/bundle.js.map +1 -0
  177. package/dist/v1/index.d.ts +9 -0
  178. package/dist/v1/index.d.ts.map +1 -0
  179. package/dist/v1/index.js +6 -0
  180. package/dist/v1/index.js.map +1 -0
  181. package/dist/v1/schema/callable.d.ts +29 -0
  182. package/dist/v1/schema/callable.d.ts.map +1 -0
  183. package/dist/v1/schema/callable.js +2 -0
  184. package/dist/v1/schema/callable.js.map +1 -0
  185. package/dist/v1/schema/canonical/domain.d.ts +3 -0
  186. package/dist/v1/schema/canonical/domain.d.ts.map +1 -0
  187. package/dist/v1/schema/canonical/domain.digest.d.ts +4 -0
  188. package/dist/v1/schema/canonical/domain.digest.d.ts.map +1 -0
  189. package/dist/v1/schema/canonical/domain.digest.js +9 -0
  190. package/dist/v1/schema/canonical/domain.digest.js.map +1 -0
  191. package/dist/v1/schema/canonical/domain.js +193 -0
  192. package/dist/v1/schema/canonical/domain.js.map +1 -0
  193. package/dist/v1/schema/canonical/freeze.d.ts +2 -0
  194. package/dist/v1/schema/canonical/freeze.d.ts.map +1 -0
  195. package/dist/v1/schema/canonical/freeze.js +10 -0
  196. package/dist/v1/schema/canonical/freeze.js.map +1 -0
  197. package/dist/v1/schema/core/declaration.d.ts +17 -0
  198. package/dist/v1/schema/core/declaration.d.ts.map +1 -0
  199. package/dist/v1/schema/core/declaration.js +2 -0
  200. package/dist/v1/schema/core/declaration.js.map +1 -0
  201. package/dist/v1/schema/core/validate.d.ts +6 -0
  202. package/dist/v1/schema/core/validate.d.ts.map +1 -0
  203. package/dist/v1/schema/core/validate.js +237 -0
  204. package/dist/v1/schema/core/validate.js.map +1 -0
  205. package/dist/v1/schema/definition/analysis.d.ts +41 -0
  206. package/dist/v1/schema/definition/analysis.d.ts.map +1 -0
  207. package/dist/v1/schema/definition/analysis.js +188 -0
  208. package/dist/v1/schema/definition/analysis.js.map +1 -0
  209. package/dist/v1/schema/definition/class.d.ts +28 -0
  210. package/dist/v1/schema/definition/class.d.ts.map +1 -0
  211. package/dist/v1/schema/definition/class.js +2 -0
  212. package/dist/v1/schema/definition/class.js.map +1 -0
  213. package/dist/v1/schema/definition/data.d.ts +12 -0
  214. package/dist/v1/schema/definition/data.d.ts.map +1 -0
  215. package/dist/v1/schema/definition/data.js +3 -0
  216. package/dist/v1/schema/definition/data.js.map +1 -0
  217. package/dist/v1/schema/definition/edge.d.ts +22 -0
  218. package/dist/v1/schema/definition/edge.d.ts.map +1 -0
  219. package/dist/v1/schema/definition/edge.js +2 -0
  220. package/dist/v1/schema/definition/edge.js.map +1 -0
  221. package/dist/v1/schema/definition/interface.d.ts +22 -0
  222. package/dist/v1/schema/definition/interface.d.ts.map +1 -0
  223. package/dist/v1/schema/definition/interface.js +2 -0
  224. package/dist/v1/schema/definition/interface.js.map +1 -0
  225. package/dist/v1/schema/definition/property.d.ts +11 -0
  226. package/dist/v1/schema/definition/property.d.ts.map +1 -0
  227. package/dist/v1/schema/definition/property.js +2 -0
  228. package/dist/v1/schema/definition/property.js.map +1 -0
  229. package/dist/v1/schema/definition/validate.d.ts +5 -0
  230. package/dist/v1/schema/definition/validate.d.ts.map +1 -0
  231. package/dist/v1/schema/definition/validate.js +152 -0
  232. package/dist/v1/schema/definition/validate.js.map +1 -0
  233. package/dist/v1/schema/dependency.meaning.d.ts +30 -0
  234. package/dist/v1/schema/dependency.meaning.d.ts.map +1 -0
  235. package/dist/v1/schema/dependency.meaning.js +608 -0
  236. package/dist/v1/schema/dependency.meaning.js.map +1 -0
  237. package/dist/v1/schema/diagnostic.d.ts +12 -0
  238. package/dist/v1/schema/diagnostic.d.ts.map +1 -0
  239. package/dist/v1/schema/diagnostic.js +21 -0
  240. package/dist/v1/schema/diagnostic.js.map +1 -0
  241. package/dist/v1/schema/domain.accept.d.ts +4 -0
  242. package/dist/v1/schema/domain.accept.d.ts.map +1 -0
  243. package/dist/v1/schema/domain.accept.js +27 -0
  244. package/dist/v1/schema/domain.accept.js.map +1 -0
  245. package/dist/v1/schema/domain.codec.d.ts +6 -0
  246. package/dist/v1/schema/domain.codec.d.ts.map +1 -0
  247. package/dist/v1/schema/domain.codec.js +22 -0
  248. package/dist/v1/schema/domain.codec.js.map +1 -0
  249. package/dist/v1/schema/domain.header.d.ts +15 -0
  250. package/dist/v1/schema/domain.header.d.ts.map +1 -0
  251. package/dist/v1/schema/domain.header.js +21 -0
  252. package/dist/v1/schema/domain.header.js.map +1 -0
  253. package/dist/v1/schema/domain.ir.d.ts +40 -0
  254. package/dist/v1/schema/domain.ir.d.ts.map +1 -0
  255. package/dist/v1/schema/domain.ir.js +5 -0
  256. package/dist/v1/schema/domain.ir.js.map +1 -0
  257. package/dist/v1/schema/domain.lookup.d.ts +19 -0
  258. package/dist/v1/schema/domain.lookup.d.ts.map +1 -0
  259. package/dist/v1/schema/domain.lookup.js +32 -0
  260. package/dist/v1/schema/domain.lookup.js.map +1 -0
  261. package/dist/v1/schema/domain.resolve.d.ts +26 -0
  262. package/dist/v1/schema/domain.resolve.d.ts.map +1 -0
  263. package/dist/v1/schema/domain.resolve.js +43 -0
  264. package/dist/v1/schema/domain.resolve.js.map +1 -0
  265. package/dist/v1/schema/domain.revision.d.ts +12 -0
  266. package/dist/v1/schema/domain.revision.d.ts.map +1 -0
  267. package/dist/v1/schema/domain.revision.js +18 -0
  268. package/dist/v1/schema/domain.revision.js.map +1 -0
  269. package/dist/v1/schema/domain.validate.d.ts +12 -0
  270. package/dist/v1/schema/domain.validate.d.ts.map +1 -0
  271. package/dist/v1/schema/domain.validate.js +36 -0
  272. package/dist/v1/schema/domain.validate.js.map +1 -0
  273. package/dist/v1/schema/index.d.ts +36 -0
  274. package/dist/v1/schema/index.d.ts.map +1 -0
  275. package/dist/v1/schema/index.js +16 -0
  276. package/dist/v1/schema/index.js.map +1 -0
  277. package/dist/v1/schema/metadata.d.ts +13 -0
  278. package/dist/v1/schema/metadata.d.ts.map +1 -0
  279. package/dist/v1/schema/metadata.js +13 -0
  280. package/dist/v1/schema/metadata.js.map +1 -0
  281. package/dist/v1/schema/policy/ast.d.ts +77 -0
  282. package/dist/v1/schema/policy/ast.d.ts.map +1 -0
  283. package/dist/v1/schema/policy/ast.js +2 -0
  284. package/dist/v1/schema/policy/ast.js.map +1 -0
  285. package/dist/v1/schema/policy/normalize.d.ts +5 -0
  286. package/dist/v1/schema/policy/normalize.d.ts.map +1 -0
  287. package/dist/v1/schema/policy/normalize.js +230 -0
  288. package/dist/v1/schema/policy/normalize.js.map +1 -0
  289. package/dist/v1/schema/policy/validation/branches.d.ts +21 -0
  290. package/dist/v1/schema/policy/validation/branches.d.ts.map +1 -0
  291. package/dist/v1/schema/policy/validation/branches.js +155 -0
  292. package/dist/v1/schema/policy/validation/branches.js.map +1 -0
  293. package/dist/v1/schema/policy/validation/budgets.d.ts +19 -0
  294. package/dist/v1/schema/policy/validation/budgets.d.ts.map +1 -0
  295. package/dist/v1/schema/policy/validation/budgets.js +132 -0
  296. package/dist/v1/schema/policy/validation/budgets.js.map +1 -0
  297. package/dist/v1/schema/policy/validation/context.d.ts +28 -0
  298. package/dist/v1/schema/policy/validation/context.d.ts.map +1 -0
  299. package/dist/v1/schema/policy/validation/context.js +99 -0
  300. package/dist/v1/schema/policy/validation/context.js.map +1 -0
  301. package/dist/v1/schema/policy/validation/references.d.ts +3 -0
  302. package/dist/v1/schema/policy/validation/references.d.ts.map +1 -0
  303. package/dist/v1/schema/policy/validation/references.js +136 -0
  304. package/dist/v1/schema/policy/validation/references.js.map +1 -0
  305. package/dist/v1/schema/policy/validation/typing.d.ts +23 -0
  306. package/dist/v1/schema/policy/validation/typing.d.ts.map +1 -0
  307. package/dist/v1/schema/policy/validation/typing.js +357 -0
  308. package/dist/v1/schema/policy/validation/typing.js.map +1 -0
  309. package/dist/v1/schema/policy/validation/uses.d.ts +6 -0
  310. package/dist/v1/schema/policy/validation/uses.d.ts.map +1 -0
  311. package/dist/v1/schema/policy/validation/uses.js +269 -0
  312. package/dist/v1/schema/policy/validation/uses.js.map +1 -0
  313. package/dist/v1/schema/policy/validation/validate.d.ts +12 -0
  314. package/dist/v1/schema/policy/validation/validate.d.ts.map +1 -0
  315. package/dist/v1/schema/policy/validation/validate.js +24 -0
  316. package/dist/v1/schema/policy/validation/validate.js.map +1 -0
  317. package/dist/v1/schema/reference.d.ts +43 -0
  318. package/dist/v1/schema/reference.d.ts.map +1 -0
  319. package/dist/v1/schema/reference.js +31 -0
  320. package/dist/v1/schema/reference.js.map +1 -0
  321. package/dist/v1/schema/resolution/closure.d.ts +10 -0
  322. package/dist/v1/schema/resolution/closure.d.ts.map +1 -0
  323. package/dist/v1/schema/resolution/closure.js +50 -0
  324. package/dist/v1/schema/resolution/closure.js.map +1 -0
  325. package/dist/v1/schema/resolution/context.d.ts +18 -0
  326. package/dist/v1/schema/resolution/context.d.ts.map +1 -0
  327. package/dist/v1/schema/resolution/context.js +126 -0
  328. package/dist/v1/schema/resolution/context.js.map +1 -0
  329. package/dist/v1/schema/resolution/definition.index.d.ts +43 -0
  330. package/dist/v1/schema/resolution/definition.index.d.ts.map +1 -0
  331. package/dist/v1/schema/resolution/definition.index.js +27 -0
  332. package/dist/v1/schema/resolution/definition.index.js.map +1 -0
  333. package/dist/v1/schema/resolution/origins.d.ts +17 -0
  334. package/dist/v1/schema/resolution/origins.d.ts.map +1 -0
  335. package/dist/v1/schema/resolution/origins.js +129 -0
  336. package/dist/v1/schema/resolution/origins.js.map +1 -0
  337. package/dist/v1/schema/resolution/value.registry.d.ts +8 -0
  338. package/dist/v1/schema/resolution/value.registry.d.ts.map +1 -0
  339. package/dist/v1/schema/resolution/value.registry.js +46 -0
  340. package/dist/v1/schema/resolution/value.registry.js.map +1 -0
  341. package/dist/v1/schema/validation/domain.route.d.ts +5 -0
  342. package/dist/v1/schema/validation/domain.route.d.ts.map +1 -0
  343. package/dist/v1/schema/validation/domain.route.js +33 -0
  344. package/dist/v1/schema/validation/domain.route.js.map +1 -0
  345. package/dist/v1/schema/validation/domain.structure.d.ts +5 -0
  346. package/dist/v1/schema/validation/domain.structure.d.ts.map +1 -0
  347. package/dist/v1/schema/validation/domain.structure.js +422 -0
  348. package/dist/v1/schema/validation/domain.structure.js.map +1 -0
  349. package/dist/v1/schema/validation/value.d.ts +5 -0
  350. package/dist/v1/schema/validation/value.d.ts.map +1 -0
  351. package/dist/v1/schema/validation/value.js +44 -0
  352. package/dist/v1/schema/validation/value.js.map +1 -0
  353. package/dist/v1/schema/value/extensions/node-path/schema.d.ts +6 -0
  354. package/dist/v1/schema/value/extensions/node-path/schema.d.ts.map +1 -0
  355. package/dist/v1/schema/value/extensions/node-path/schema.js +19 -0
  356. package/dist/v1/schema/value/extensions/node-path/schema.js.map +1 -0
  357. package/dist/v1/schema/value/extensions/node-path/validate.d.ts +5 -0
  358. package/dist/v1/schema/value/extensions/node-path/validate.d.ts.map +1 -0
  359. package/dist/v1/schema/value/extensions/node-path/validate.js +80 -0
  360. package/dist/v1/schema/value/extensions/node-path/validate.js.map +1 -0
  361. package/dist/v1/schema/value/index.d.ts +14 -0
  362. package/dist/v1/schema/value/index.d.ts.map +1 -0
  363. package/dist/v1/schema/value/index.js +24 -0
  364. package/dist/v1/schema/value/index.js.map +1 -0
  365. package/dist/v1/schema/value/instance/assertions.d.ts +7 -0
  366. package/dist/v1/schema/value/instance/assertions.d.ts.map +1 -0
  367. package/dist/v1/schema/value/instance/assertions.js +59 -0
  368. package/dist/v1/schema/value/instance/assertions.js.map +1 -0
  369. package/dist/v1/schema/value/instance/compiler.d.ts +13 -0
  370. package/dist/v1/schema/value/instance/compiler.d.ts.map +1 -0
  371. package/dist/v1/schema/value/instance/compiler.js +69 -0
  372. package/dist/v1/schema/value/instance/compiler.js.map +1 -0
  373. package/dist/v1/schema/value/instance/evaluator.d.ts +5 -0
  374. package/dist/v1/schema/value/instance/evaluator.d.ts.map +1 -0
  375. package/dist/v1/schema/value/instance/evaluator.js +373 -0
  376. package/dist/v1/schema/value/instance/evaluator.js.map +1 -0
  377. package/dist/v1/schema/value/instance/types.d.ts +33 -0
  378. package/dist/v1/schema/value/instance/types.d.ts.map +1 -0
  379. package/dist/v1/schema/value/instance/types.js +10 -0
  380. package/dist/v1/schema/value/instance/types.js.map +1 -0
  381. package/dist/v1/schema/value/instance.validate.d.ts +13 -0
  382. package/dist/v1/schema/value/instance.validate.d.ts.map +1 -0
  383. package/dist/v1/schema/value/instance.validate.js +44 -0
  384. package/dist/v1/schema/value/instance.validate.js.map +1 -0
  385. package/dist/v1/schema/value/instant.d.ts +9 -0
  386. package/dist/v1/schema/value/instant.d.ts.map +1 -0
  387. package/dist/v1/schema/value/instant.js +37 -0
  388. package/dist/v1/schema/value/instant.js.map +1 -0
  389. package/dist/v1/schema/value/location/keywords.d.ts +4 -0
  390. package/dist/v1/schema/value/location/keywords.d.ts.map +1 -0
  391. package/dist/v1/schema/value/location/keywords.js +21 -0
  392. package/dist/v1/schema/value/location/keywords.js.map +1 -0
  393. package/dist/v1/schema/value/location/pointer.d.ts +5 -0
  394. package/dist/v1/schema/value/location/pointer.d.ts.map +1 -0
  395. package/dist/v1/schema/value/location/pointer.js +50 -0
  396. package/dist/v1/schema/value/location/pointer.js.map +1 -0
  397. package/dist/v1/schema/value/location/walk.d.ts +11 -0
  398. package/dist/v1/schema/value/location/walk.d.ts.map +1 -0
  399. package/dist/v1/schema/value/location/walk.js +54 -0
  400. package/dist/v1/schema/value/location/walk.js.map +1 -0
  401. package/dist/v1/schema/value/object.d.ts +5 -0
  402. package/dist/v1/schema/value/object.d.ts.map +1 -0
  403. package/dist/v1/schema/value/object.js +4 -0
  404. package/dist/v1/schema/value/object.js.map +1 -0
  405. package/dist/v1/schema/value/ordering.d.ts +11 -0
  406. package/dist/v1/schema/value/ordering.d.ts.map +1 -0
  407. package/dist/v1/schema/value/ordering.js +172 -0
  408. package/dist/v1/schema/value/ordering.js.map +1 -0
  409. package/dist/v1/schema/value/profile/canonicalize.d.ts +5 -0
  410. package/dist/v1/schema/value/profile/canonicalize.d.ts.map +1 -0
  411. package/dist/v1/schema/value/profile/canonicalize.js +133 -0
  412. package/dist/v1/schema/value/profile/canonicalize.js.map +1 -0
  413. package/dist/v1/schema/value/profile/dialect.d.ts +5 -0
  414. package/dist/v1/schema/value/profile/dialect.d.ts.map +1 -0
  415. package/dist/v1/schema/value/profile/dialect.js +36 -0
  416. package/dist/v1/schema/value/profile/dialect.js.map +1 -0
  417. package/dist/v1/schema/value/profile/json.validate.d.ts +3 -0
  418. package/dist/v1/schema/value/profile/json.validate.d.ts.map +1 -0
  419. package/dist/v1/schema/value/profile/json.validate.js +15 -0
  420. package/dist/v1/schema/value/profile/json.validate.js.map +1 -0
  421. package/dist/v1/schema/value/profile/meta-schema.validate.d.ts +4 -0
  422. package/dist/v1/schema/value/profile/meta-schema.validate.d.ts.map +1 -0
  423. package/dist/v1/schema/value/profile/meta-schema.validate.js +25 -0
  424. package/dist/v1/schema/value/profile/meta-schema.validate.js.map +1 -0
  425. package/dist/v1/schema/value/profile/rules.d.ts +5 -0
  426. package/dist/v1/schema/value/profile/rules.d.ts.map +1 -0
  427. package/dist/v1/schema/value/profile/rules.js +152 -0
  428. package/dist/v1/schema/value/profile/rules.js.map +1 -0
  429. package/dist/v1/schema/value/profile/validate.d.ts +5 -0
  430. package/dist/v1/schema/value/profile/validate.d.ts.map +1 -0
  431. package/dist/v1/schema/value/profile/validate.js +47 -0
  432. package/dist/v1/schema/value/profile/validate.js.map +1 -0
  433. package/dist/v1/schema/value/profile/vocabulary.d.ts +3 -0
  434. package/dist/v1/schema/value/profile/vocabulary.d.ts.map +1 -0
  435. package/dist/v1/schema/value/profile/vocabulary.js +69 -0
  436. package/dist/v1/schema/value/profile/vocabulary.js.map +1 -0
  437. package/dist/v1/schema/value/regexp/linear.d.ts +20 -0
  438. package/dist/v1/schema/value/regexp/linear.d.ts.map +1 -0
  439. package/dist/v1/schema/value/regexp/linear.js +24 -0
  440. package/dist/v1/schema/value/regexp/linear.js.map +1 -0
  441. package/dist/v1/schema/value/regexp/lower.d.ts +4 -0
  442. package/dist/v1/schema/value/regexp/lower.d.ts.map +1 -0
  443. package/dist/v1/schema/value/regexp/lower.js +27 -0
  444. package/dist/v1/schema/value/regexp/lower.js.map +1 -0
  445. package/dist/v1/schema/value/regexp/pattern.d.ts +3 -0
  446. package/dist/v1/schema/value/regexp/pattern.d.ts.map +1 -0
  447. package/dist/v1/schema/value/regexp/pattern.js +39 -0
  448. package/dist/v1/schema/value/regexp/pattern.js.map +1 -0
  449. package/dist/v1/schema/value/regexp/syntax.d.ts +3 -0
  450. package/dist/v1/schema/value/regexp/syntax.d.ts.map +1 -0
  451. package/dist/v1/schema/value/regexp/syntax.js +219 -0
  452. package/dist/v1/schema/value/regexp/syntax.js.map +1 -0
  453. package/dist/v1/schema/value/registry.d.ts +22 -0
  454. package/dist/v1/schema/value/registry.d.ts.map +1 -0
  455. package/dist/v1/schema/value/registry.js +2 -0
  456. package/dist/v1/schema/value/registry.js.map +1 -0
  457. package/dist/v1/schema/value/resources/closure.d.ts +12 -0
  458. package/dist/v1/schema/value/resources/closure.d.ts.map +1 -0
  459. package/dist/v1/schema/value/resources/closure.js +59 -0
  460. package/dist/v1/schema/value/resources/closure.js.map +1 -0
  461. package/dist/v1/schema/value/resources/recursion.d.ts +6 -0
  462. package/dist/v1/schema/value/resources/recursion.d.ts.map +1 -0
  463. package/dist/v1/schema/value/resources/recursion.js +96 -0
  464. package/dist/v1/schema/value/resources/recursion.js.map +1 -0
  465. package/dist/v1/schema/value/resources/references.d.ts +25 -0
  466. package/dist/v1/schema/value/resources/references.d.ts.map +1 -0
  467. package/dist/v1/schema/value/resources/references.js +93 -0
  468. package/dist/v1/schema/value/resources/references.js.map +1 -0
  469. package/dist/v1/schema/value/resources/registry.index.d.ts +22 -0
  470. package/dist/v1/schema/value/resources/registry.index.d.ts.map +1 -0
  471. package/dist/v1/schema/value/resources/registry.index.js +114 -0
  472. package/dist/v1/schema/value/resources/registry.index.js.map +1 -0
  473. package/dist/v1/schema/value/schema.d.ts +26 -0
  474. package/dist/v1/schema/value/schema.d.ts.map +1 -0
  475. package/dist/v1/schema/value/schema.js +13 -0
  476. package/dist/v1/schema/value/schema.js.map +1 -0
  477. package/dist/v1/schema/view/declaration.d.ts +14 -0
  478. package/dist/v1/schema/view/declaration.d.ts.map +1 -0
  479. package/dist/v1/schema/view/declaration.js +2 -0
  480. package/dist/v1/schema/view/declaration.js.map +1 -0
  481. package/dist/v1/schema/view/validate.d.ts +4 -0
  482. package/dist/v1/schema/view/validate.d.ts.map +1 -0
  483. package/dist/v1/schema/view/validate.js +22 -0
  484. package/dist/v1/schema/view/validate.js.map +1 -0
  485. package/dist/v1/schema.d.ts +3 -0
  486. package/dist/v1/schema.d.ts.map +1 -0
  487. package/dist/v1/schema.js +3 -0
  488. package/dist/v1/schema.js.map +1 -0
  489. package/dist/v1.d.ts +3 -0
  490. package/dist/v1.d.ts.map +1 -0
  491. package/dist/v1.js +3 -0
  492. package/dist/v1.js.map +1 -0
  493. package/dist/value/accept.d.ts +9 -0
  494. package/dist/value/accept.d.ts.map +1 -0
  495. package/dist/value/accept.js +133 -0
  496. package/dist/value/accept.js.map +1 -0
  497. package/dist/value/canonical.d.ts +5 -0
  498. package/dist/value/canonical.d.ts.map +1 -0
  499. package/dist/value/canonical.js +42 -0
  500. package/dist/value/canonical.js.map +1 -0
  501. package/dist/value/decode.d.ts +5 -0
  502. package/dist/value/decode.d.ts.map +1 -0
  503. package/dist/value/decode.js +109 -0
  504. package/dist/value/decode.js.map +1 -0
  505. package/dist/value/equal.d.ts +4 -0
  506. package/dist/value/equal.d.ts.map +1 -0
  507. package/dist/value/equal.js +6 -0
  508. package/dist/value/equal.js.map +1 -0
  509. package/dist/value/error.d.ts +13 -0
  510. package/dist/value/error.d.ts.map +1 -0
  511. package/dist/value/error.js +22 -0
  512. package/dist/value/error.js.map +1 -0
  513. package/dist/value/index.d.ts +10 -0
  514. package/dist/value/index.d.ts.map +1 -0
  515. package/dist/value/index.js +7 -0
  516. package/dist/value/index.js.map +1 -0
  517. package/dist/value/json.d.ts +4 -0
  518. package/dist/value/json.d.ts.map +1 -0
  519. package/dist/value/json.js +4 -0
  520. package/dist/value/json.js.map +1 -0
  521. package/dist/value/limits.d.ts +22 -0
  522. package/dist/value/limits.d.ts.map +1 -0
  523. package/dist/value/limits.js +16 -0
  524. package/dist/value/limits.js.map +1 -0
  525. package/dist/value/types.d.ts +7 -0
  526. package/dist/value/types.d.ts.map +1 -0
  527. package/dist/value/types.js +2 -0
  528. package/dist/value/types.js.map +1 -0
  529. package/dist/value/unicode.d.ts +5 -0
  530. package/dist/value/unicode.d.ts.map +1 -0
  531. package/dist/value/unicode.js +65 -0
  532. package/dist/value/unicode.js.map +1 -0
  533. package/dist/version/dispatch.d.ts +25 -0
  534. package/dist/version/dispatch.d.ts.map +1 -0
  535. package/dist/version/dispatch.js +48 -0
  536. package/dist/version/dispatch.js.map +1 -0
  537. package/dist/version/index.d.ts +3 -0
  538. package/dist/version/index.d.ts.map +1 -0
  539. package/dist/version/index.js +2 -0
  540. package/dist/version/index.js.map +1 -0
  541. package/package.json +19 -8
  542. package/dist/builders/bitmask.d.ts +0 -5
  543. package/dist/builders/bitmask.d.ts.map +0 -1
  544. package/dist/builders/bitmask.js +0 -11
  545. package/dist/builders/data.d.ts +0 -7
  546. package/dist/builders/data.d.ts.map +0 -1
  547. package/dist/builders/data.js +0 -17
  548. package/dist/builders/definition/base.d.ts +0 -13
  549. package/dist/builders/definition/base.d.ts.map +0 -1
  550. package/dist/builders/definition/base.js +0 -23
  551. package/dist/builders/definition/edge-class.d.ts +0 -8
  552. package/dist/builders/definition/edge-class.d.ts.map +0 -1
  553. package/dist/builders/definition/edge-class.js +0 -8
  554. package/dist/builders/definition/edge-interface.d.ts +0 -8
  555. package/dist/builders/definition/edge-interface.d.ts.map +0 -1
  556. package/dist/builders/definition/edge-interface.js +0 -8
  557. package/dist/builders/definition/node-class.d.ts +0 -7
  558. package/dist/builders/definition/node-class.d.ts.map +0 -1
  559. package/dist/builders/definition/node-class.js +0 -8
  560. package/dist/builders/definition/node-interface.d.ts +0 -7
  561. package/dist/builders/definition/node-interface.d.ts.map +0 -1
  562. package/dist/builders/definition/node-interface.js +0 -8
  563. package/dist/builders/function.d.ts +0 -20
  564. package/dist/builders/function.d.ts.map +0 -1
  565. package/dist/builders/function.js +0 -8
  566. package/dist/builders/prop.d.ts +0 -7
  567. package/dist/builders/prop.d.ts.map +0 -1
  568. package/dist/builders/prop.js +0 -8
  569. package/dist/builders/ref.d.ts +0 -12
  570. package/dist/builders/ref.d.ts.map +0 -1
  571. package/dist/builders/ref.js +0 -26
  572. package/dist/grammar/definition/base.d.ts +0 -13
  573. package/dist/grammar/definition/base.d.ts.map +0 -1
  574. package/dist/grammar/definition/base.js +0 -1
  575. package/dist/grammar/definition/discriminants.d.ts +0 -31
  576. package/dist/grammar/definition/discriminants.d.ts.map +0 -1
  577. package/dist/grammar/definition/discriminants.js +0 -32
  578. package/dist/grammar/definition/edge-class.d.ts +0 -19
  579. package/dist/grammar/definition/edge-class.d.ts.map +0 -1
  580. package/dist/grammar/definition/edge-class.js +0 -1
  581. package/dist/grammar/definition/edge-interface.d.ts +0 -18
  582. package/dist/grammar/definition/edge-interface.d.ts.map +0 -1
  583. package/dist/grammar/definition/edge-interface.js +0 -1
  584. package/dist/grammar/definition/node-class.d.ts +0 -21
  585. package/dist/grammar/definition/node-class.d.ts.map +0 -1
  586. package/dist/grammar/definition/node-class.js +0 -1
  587. package/dist/grammar/definition/node-interface.d.ts +0 -14
  588. package/dist/grammar/definition/node-interface.d.ts.map +0 -1
  589. package/dist/grammar/definition/node-interface.js +0 -1
  590. package/dist/grammar/facets/constraints.d.ts +0 -8
  591. package/dist/grammar/facets/constraints.d.ts.map +0 -1
  592. package/dist/grammar/facets/constraints.js +0 -1
  593. package/dist/grammar/facets/content.d.ts +0 -4
  594. package/dist/grammar/facets/content.d.ts.map +0 -1
  595. package/dist/grammar/facets/content.js +0 -1
  596. package/dist/grammar/facets/endpoints.d.ts +0 -14
  597. package/dist/grammar/facets/endpoints.d.ts.map +0 -1
  598. package/dist/grammar/facets/endpoints.js +0 -2
  599. package/dist/grammar/facets/indexes.d.ts +0 -12
  600. package/dist/grammar/facets/indexes.d.ts.map +0 -1
  601. package/dist/grammar/facets/indexes.js +0 -8
  602. package/dist/grammar/facets/properties.d.ts +0 -26
  603. package/dist/grammar/facets/properties.d.ts.map +0 -1
  604. package/dist/grammar/facets/properties.js +0 -44
  605. package/dist/grammar/function/config.d.ts +0 -14
  606. package/dist/grammar/function/config.d.ts.map +0 -1
  607. package/dist/grammar/function/config.js +0 -1
  608. package/dist/grammar/function/def.d.ts +0 -55
  609. package/dist/grammar/function/def.d.ts.map +0 -1
  610. package/dist/grammar/function/def.js +0 -1
  611. package/dist/grammar/function/inheritance.d.ts +0 -3
  612. package/dist/grammar/function/inheritance.d.ts.map +0 -1
  613. package/dist/grammar/function/inheritance.js +0 -1
  614. package/dist/grammar/function/output.d.ts +0 -3
  615. package/dist/grammar/function/output.d.ts.map +0 -1
  616. package/dist/grammar/function/output.js +0 -1
  617. package/dist/grammar/values/bitmask.d.ts +0 -7
  618. package/dist/grammar/values/bitmask.d.ts.map +0 -1
  619. package/dist/grammar/values/bitmask.js +0 -1
  620. package/dist/grammar/values/data.d.ts +0 -30
  621. package/dist/grammar/values/data.d.ts.map +0 -1
  622. package/dist/grammar/values/data.js +0 -1
  623. package/dist/grammar/values/ref.d.ts +0 -26
  624. package/dist/grammar/values/ref.d.ts.map +0 -1
  625. package/dist/grammar/values/ref.js +0 -1
  626. package/dist/grammar/values/self.d.ts +0 -12
  627. package/dist/grammar/values/self.d.ts.map +0 -1
  628. package/dist/grammar/values/self.js +0 -5
  629. package/dist/inference/content.d.ts +0 -27
  630. package/dist/inference/content.d.ts.map +0 -1
  631. package/dist/inference/content.js +0 -1
  632. package/dist/inference/index.d.ts +0 -7
  633. package/dist/inference/index.d.ts.map +0 -1
  634. package/dist/inference/index.js +0 -1
  635. package/dist/inference/inheritance.d.ts +0 -48
  636. package/dist/inference/inheritance.d.ts.map +0 -1
  637. package/dist/inference/inheritance.js +0 -1
  638. package/dist/inference/input.d.ts +0 -30
  639. package/dist/inference/input.d.ts.map +0 -1
  640. package/dist/inference/input.js +0 -1
  641. package/dist/inference/methods.d.ts +0 -69
  642. package/dist/inference/methods.d.ts.map +0 -1
  643. package/dist/inference/methods.js +0 -1
  644. package/dist/inference/properties.d.ts +0 -37
  645. package/dist/inference/properties.d.ts.map +0 -1
  646. package/dist/inference/properties.js +0 -1
  647. package/dist/inference/schema.d.ts +0 -37
  648. package/dist/inference/schema.d.ts.map +0 -1
  649. package/dist/inference/schema.js +0 -1
  650. package/dist/instance/core/define.d.ts +0 -13
  651. package/dist/instance/core/define.d.ts.map +0 -1
  652. package/dist/instance/core/define.js +0 -62
  653. package/dist/instance/core/edge.d.ts +0 -9
  654. package/dist/instance/core/edge.d.ts.map +0 -1
  655. package/dist/instance/core/edge.js +0 -10
  656. package/dist/instance/core/endpoint.d.ts +0 -11
  657. package/dist/instance/core/endpoint.d.ts.map +0 -1
  658. package/dist/instance/core/endpoint.js +0 -18
  659. package/dist/instance/core/node.d.ts +0 -7
  660. package/dist/instance/core/node.d.ts.map +0 -1
  661. package/dist/instance/core/node.js +0 -8
  662. package/dist/instance/core/path.d.ts +0 -21
  663. package/dist/instance/core/path.d.ts.map +0 -1
  664. package/dist/instance/core/path.js +0 -20
  665. package/dist/instance/core/self.d.ts +0 -15
  666. package/dist/instance/core/self.d.ts.map +0 -1
  667. package/dist/instance/core/self.js +0 -7
  668. package/dist/instance/core/types.d.ts +0 -45
  669. package/dist/instance/core/types.d.ts.map +0 -1
  670. package/dist/instance/core/types.js +0 -1
  671. package/dist/instance/seed/define.d.ts +0 -12
  672. package/dist/instance/seed/define.d.ts.map +0 -1
  673. package/dist/instance/seed/define.js +0 -33
  674. package/dist/instance/seed/types.d.ts +0 -12
  675. package/dist/instance/seed/types.d.ts.map +0 -1
  676. package/dist/instance/seed/types.js +0 -1
  677. package/dist/ir/classes.d.ts +0 -72
  678. package/dist/ir/classes.d.ts.map +0 -1
  679. package/dist/ir/classes.js +0 -1
  680. package/dist/ir/domain.d.ts +0 -13
  681. package/dist/ir/domain.d.ts.map +0 -1
  682. package/dist/ir/domain.js +0 -1
  683. package/dist/ir/endpoints.d.ts +0 -27
  684. package/dist/ir/endpoints.d.ts.map +0 -1
  685. package/dist/ir/endpoints.js +0 -1
  686. package/dist/ir/functions.d.ts +0 -19
  687. package/dist/ir/functions.d.ts.map +0 -1
  688. package/dist/ir/functions.js +0 -1
  689. package/dist/ir/index.d.ts +0 -8
  690. package/dist/ir/index.d.ts.map +0 -1
  691. package/dist/ir/index.js +0 -1
  692. package/dist/ir/ir.d.ts +0 -63
  693. package/dist/ir/ir.d.ts.map +0 -1
  694. package/dist/ir/ir.js +0 -4
  695. package/dist/ir/json-schema.d.ts +0 -20
  696. package/dist/ir/json-schema.d.ts.map +0 -1
  697. package/dist/ir/json-schema.js +0 -1
  698. package/dist/schema/classify.d.ts +0 -8
  699. package/dist/schema/classify.d.ts.map +0 -1
  700. package/dist/schema/classify.js +0 -19
  701. package/dist/schema/define.d.ts +0 -21
  702. package/dist/schema/define.d.ts.map +0 -1
  703. package/dist/schema/define.js +0 -40
  704. package/dist/schema/error.d.ts +0 -8
  705. package/dist/schema/error.d.ts.map +0 -1
  706. package/dist/schema/error.js +0 -13
  707. package/dist/schema/refs.d.ts +0 -77
  708. package/dist/schema/refs.d.ts.map +0 -1
  709. package/dist/schema/refs.js +0 -99
  710. package/dist/schema/resolve/index.d.ts +0 -5
  711. package/dist/schema/resolve/index.d.ts.map +0 -1
  712. package/dist/schema/resolve/index.js +0 -4
  713. package/dist/schema/resolve/methods.d.ts +0 -8
  714. package/dist/schema/resolve/methods.d.ts.map +0 -1
  715. package/dist/schema/resolve/methods.js +0 -17
  716. package/dist/schema/resolve/properties.d.ts +0 -13
  717. package/dist/schema/resolve/properties.d.ts.map +0 -1
  718. package/dist/schema/resolve/properties.js +0 -36
  719. package/dist/schema/resolve/self.d.ts +0 -7
  720. package/dist/schema/resolve/self.d.ts.map +0 -1
  721. package/dist/schema/resolve/self.js +0 -32
  722. package/dist/schema/resolve/thunks.d.ts +0 -12
  723. package/dist/schema/resolve/thunks.d.ts.map +0 -1
  724. package/dist/schema/resolve/thunks.js +0 -36
  725. package/dist/schema/schema.d.ts +0 -22
  726. package/dist/schema/schema.d.ts.map +0 -1
  727. package/dist/schema/schema.js +0 -1
  728. package/dist/schema/validators/context.d.ts +0 -13
  729. package/dist/schema/validators/context.d.ts.map +0 -1
  730. package/dist/schema/validators/context.js +0 -1
  731. package/dist/schema/validators/endpoints.d.ts +0 -4
  732. package/dist/schema/validators/endpoints.d.ts.map +0 -1
  733. package/dist/schema/validators/endpoints.js +0 -26
  734. package/dist/schema/validators/index.d.ts +0 -11
  735. package/dist/schema/validators/index.d.ts.map +0 -1
  736. package/dist/schema/validators/index.js +0 -21
  737. package/dist/schema/validators/indexes.d.ts +0 -4
  738. package/dist/schema/validators/indexes.d.ts.map +0 -1
  739. package/dist/schema/validators/indexes.js +0 -18
  740. package/dist/schema/validators/inheritance.d.ts +0 -4
  741. package/dist/schema/validators/inheritance.d.ts.map +0 -1
  742. package/dist/schema/validators/inheritance.js +0 -26
  743. package/dist/schema/validators/methods.d.ts +0 -9
  744. package/dist/schema/validators/methods.d.ts.map +0 -1
  745. package/dist/schema/validators/methods.js +0 -43
  746. package/dist/schema/validators/names.d.ts +0 -4
  747. package/dist/schema/validators/names.d.ts.map +0 -1
  748. package/dist/schema/validators/names.js +0 -18
  749. package/dist/schema/validators/ref-targets.d.ts +0 -4
  750. package/dist/schema/validators/ref-targets.d.ts.map +0 -1
  751. package/dist/schema/validators/ref-targets.js +0 -53
  752. package/dist/serializer/context.d.ts +0 -32
  753. package/dist/serializer/context.d.ts.map +0 -1
  754. package/dist/serializer/context.js +0 -308
  755. package/dist/serializer/helpers.d.ts +0 -34
  756. package/dist/serializer/helpers.d.ts.map +0 -1
  757. package/dist/serializer/helpers.js +0 -115
  758. package/dist/serializer/index.d.ts +0 -2
  759. package/dist/serializer/index.d.ts.map +0 -1
  760. package/dist/serializer/index.js +0 -1
  761. package/dist/serializer/serialize.d.ts +0 -12
  762. package/dist/serializer/serialize.d.ts.map +0 -1
  763. package/dist/serializer/serialize.js +0 -5
@@ -1,11 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- export type { SchemaContext } from './context.js';
3
- export { validateUniqueNames } from './names.js';
4
- export { validateInheritance } from './inheritance.js';
5
- export { validateEndpoints } from './endpoints.js';
6
- export { validateIndexes } from './indexes.js';
7
- export { validateRefTargets } from './ref-targets.js';
8
- export { validateMethods } from './methods.js';
9
- /** Run all schema validators in sequence */
10
- export declare function validateSchema(ctx: SchemaContext): void;
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AASjD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,4CAA4C;AAC5C,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAOvD"}
@@ -1,21 +0,0 @@
1
- import { validateEndpoints } from './endpoints.js';
2
- import { validateIndexes } from './indexes.js';
3
- import { validateInheritance } from './inheritance.js';
4
- import { validateMethods } from './methods.js';
5
- import { validateUniqueNames } from './names.js';
6
- import { validateRefTargets } from './ref-targets.js';
7
- export { validateUniqueNames } from './names.js';
8
- export { validateInheritance } from './inheritance.js';
9
- export { validateEndpoints } from './endpoints.js';
10
- export { validateIndexes } from './indexes.js';
11
- export { validateRefTargets } from './ref-targets.js';
12
- export { validateMethods } from './methods.js';
13
- /** Run all schema validators in sequence */
14
- export function validateSchema(ctx) {
15
- validateUniqueNames(ctx);
16
- validateInheritance(ctx);
17
- validateEndpoints(ctx);
18
- validateIndexes(ctx);
19
- validateRefTargets(ctx);
20
- validateMethods(ctx);
21
- }
@@ -1,4 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- /** Validate that all indexed properties exist on the definition or its ancestors */
3
- export declare function validateIndexes(ctx: SchemaContext): void;
4
- //# sourceMappingURL=indexes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexes.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/indexes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAMjD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAmBxD"}
@@ -1,18 +0,0 @@
1
- import { SchemaValidationError } from '../error.js';
2
- import { eachDef } from '../refs.js';
3
- import { resolveAllPropertyKeys } from '../resolve/properties.js';
4
- /** Validate that all indexed properties exist on the definition or its ancestors */
5
- export function validateIndexes(ctx) {
6
- for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
7
- const indexes = def.config.indexes;
8
- if (!indexes)
9
- continue;
10
- const available = resolveAllPropertyKeys(def);
11
- for (const idx of indexes) {
12
- const prop = typeof idx === 'string' ? idx : idx.property;
13
- if (!available.has(prop)) {
14
- throw new SchemaValidationError(`Index on '${name}' references unknown property '${prop}'`, `${name}.indexes`, [...available].join(', ') || '(no properties)', prop);
15
- }
16
- }
17
- }
18
- }
@@ -1,4 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- /** Validate inheritance rules for all definitions */
3
- export declare function validateInheritance(ctx: SchemaContext): void;
4
- //# sourceMappingURL=inheritance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inheritance.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/inheritance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAMjD,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsC5D"}
@@ -1,26 +0,0 @@
1
- import { isAbstract, isNode } from '../../grammar/definition/discriminants.js';
2
- import { SchemaValidationError } from '../error.js';
3
- import { eachDef, isKnownDef } from '../refs.js';
4
- /** Validate inheritance rules for all definitions */
5
- export function validateInheritance(ctx) {
6
- for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
7
- const parents = def.config.inherits;
8
- if (!parents)
9
- continue;
10
- for (const parent of parents) {
11
- // Rule 3: Inheritance targets exist
12
- if (!isKnownDef(parent, ctx.descriptorMap)) {
13
- throw new SchemaValidationError(`Definition '${name}' inherits from an unknown type`, `${name}.inherits`, 'a def in this schema or imported', 'unknown reference');
14
- }
15
- // Rule 5: No concrete inheritance — only abstract can be inherited
16
- if (!isAbstract(parent)) {
17
- throw new SchemaValidationError(`Definition '${name}' inherits from a concrete type (kind: '${parent.__kind}'). Only interfaces can be inherited.`, `${name}.inherits`, 'node-interface | edge-interface', parent.__kind);
18
- }
19
- // Rule 4: Kind match — node defs inherit node interfaces only;
20
- // edge defs can inherit from both edge interfaces and node interfaces (mixins)
21
- if (isNode(def) && !isNode(parent)) {
22
- throw new SchemaValidationError(`Node definition '${name}' inherits from an edge interface`, `${name}.inherits`, 'node-interface', parent.__kind);
23
- }
24
- }
25
- }
26
- }
@@ -1,9 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- /**
3
- * Validate method inheritance rules:
4
- * - Sealed methods are not overridden
5
- * - Concrete defs implement all inherited abstract methods
6
- * - Inheritance modifier only allowed on interfaces
7
- */
8
- export declare function validateMethods(ctx: SchemaContext): void;
9
- //# sourceMappingURL=methods.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/methods.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAOjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkDxD"}
@@ -1,43 +0,0 @@
1
- import { isConcrete } from '../../grammar/definition/discriminants.js';
2
- import { SchemaValidationError } from '../error.js';
3
- import { eachDef } from '../refs.js';
4
- import { resolveAllMethods } from '../resolve/methods.js';
5
- /**
6
- * Validate method inheritance rules:
7
- * - Sealed methods are not overridden
8
- * - Concrete defs implement all inherited abstract methods
9
- * - Inheritance modifier only allowed on interfaces
10
- */
11
- export function validateMethods(ctx) {
12
- for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
13
- const ownMethods = def.config.methods ?? {};
14
- // Concrete defs must not declare inheritance on own methods
15
- if (isConcrete(def)) {
16
- for (const [methodName, fnDef] of Object.entries(ownMethods)) {
17
- if (fnDef.config.inheritance) {
18
- throw new SchemaValidationError(`Concrete def '${name}' declares '${methodName}' with inheritance '${fnDef.config.inheritance}'. ` +
19
- `The 'inheritance' modifier is only allowed on interface methods.`, `${name}.${methodName}.inheritance`, 'undefined (no inheritance on concrete defs)', fnDef.config.inheritance);
20
- }
21
- }
22
- }
23
- // Check sealed override violations
24
- const parents = def.config.inherits ?? [];
25
- for (const parent of parents) {
26
- const parentMethods = resolveAllMethods(parent);
27
- for (const [methodName, parentFn] of Object.entries(parentMethods)) {
28
- if (parentFn.config.inheritance === 'sealed' && methodName in ownMethods) {
29
- throw new SchemaValidationError(`Definition '${name}' overrides sealed method '${methodName}'`, `${name}.${methodName}`, 'no override (method is sealed)', 'override declared');
30
- }
31
- }
32
- }
33
- // Concrete defs must implement all inherited abstract methods
34
- if (isConcrete(def)) {
35
- const allInherited = resolveAllMethods(def);
36
- for (const [methodName, fnDef] of Object.entries(allInherited)) {
37
- if (fnDef.config.inheritance === 'abstract' && !(methodName in ownMethods)) {
38
- throw new SchemaValidationError(`Concrete def '${name}' does not implement abstract method '${methodName}'`, `${name}.${methodName}`, 'method implementation', 'missing');
39
- }
40
- }
41
- }
42
- }
43
- }
@@ -1,4 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- /** Validate that no two definitions share a name within the same group */
3
- export declare function validateUniqueNames(ctx: SchemaContext): void;
4
- //# sourceMappingURL=names.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"names.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA0B5D"}
@@ -1,18 +0,0 @@
1
- import { SchemaValidationError } from '../error.js';
2
- /** Validate that no two definitions share a name within the same group */
3
- export function validateUniqueNames(ctx) {
4
- const interfaceNames = new Set();
5
- for (const name of Object.keys(ctx.interfaces)) {
6
- if (interfaceNames.has(name)) {
7
- throw new SchemaValidationError(`Duplicate interface name '${name}'`, 'interfaces', 'unique names', name);
8
- }
9
- interfaceNames.add(name);
10
- }
11
- const classNames = new Set();
12
- for (const name of Object.keys(ctx.classes)) {
13
- if (classNames.has(name)) {
14
- throw new SchemaValidationError(`Duplicate class name '${name}'`, 'classes', 'unique names', name);
15
- }
16
- classNames.add(name);
17
- }
18
- }
@@ -1,4 +0,0 @@
1
- import type { SchemaContext } from './context.js';
2
- /** Validate that all ref() targets in params/returns point to known definitions */
3
- export declare function validateRefTargets(ctx: SchemaContext): void;
4
- //# sourceMappingURL=ref-targets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ref-targets.d.ts","sourceRoot":"","sources":["../../../src/schema/validators/ref-targets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAiCjD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoC3D"}
@@ -1,53 +0,0 @@
1
- import { SchemaValidationError } from '../error.js';
2
- import { eachDef, isKnownDef } from '../refs.js';
3
- // Runtime symbol
4
- const REF_TAG_RUNTIME = Symbol.for('REF_TAG');
5
- /** Extract all ref targets from a Zod schema tree */
6
- function extractRefTargets(schema) {
7
- if (schema === null || typeof schema !== 'object')
8
- return [];
9
- const targets = [];
10
- const record = schema;
11
- // Check for our REF_TAG brand
12
- if (REF_TAG_RUNTIME in record) {
13
- const meta = record[REF_TAG_RUNTIME];
14
- if (meta.target && typeof meta.target === 'object') {
15
- targets.push(meta.target);
16
- }
17
- }
18
- // Walk into Zod internals to find nested refs
19
- const zod = record;
20
- const inner = zod.element ?? zod.innerType ?? zod._def?.innerType ?? zod._def?.type;
21
- if (inner && typeof inner === 'object') {
22
- targets.push(...extractRefTargets(inner));
23
- }
24
- return targets;
25
- }
26
- /** Validate that all ref() targets in params/returns point to known definitions */
27
- export function validateRefTargets(ctx) {
28
- const validateFnRefs = (path, fnDef) => {
29
- const params = fnDef.config.params;
30
- if (params && typeof params === 'object' && typeof params !== 'function') {
31
- for (const [paramName, paramSchema] of Object.entries(params)) {
32
- for (const target of extractRefTargets(paramSchema)) {
33
- if (!isKnownDef(target, ctx.descriptorMap)) {
34
- throw new SchemaValidationError(`'${path}' param '${paramName}' references an unknown def`, `${path}.params.${paramName}`, 'a def in this schema or imported', 'unknown reference');
35
- }
36
- }
37
- }
38
- }
39
- for (const target of extractRefTargets(fnDef.config.returns)) {
40
- if (!isKnownDef(target, ctx.descriptorMap)) {
41
- throw new SchemaValidationError(`'${path}' return type references an unknown def`, `${path}.returns`, 'a def in this schema or imported', 'unknown reference');
42
- }
43
- }
44
- };
45
- for (const [name, def] of eachDef(ctx.interfaces, ctx.classes)) {
46
- const methods = def.config.methods;
47
- if (!methods)
48
- continue;
49
- for (const [methodName, methodDef] of Object.entries(methods)) {
50
- validateFnRefs(`${name}.${methodName}`, methodDef);
51
- }
52
- }
53
- }
@@ -1,32 +0,0 @@
1
- import { z } from 'zod';
2
- import type { SchemaIR } from '../ir/index.js';
3
- import type { Schema } from '../schema/schema.js';
4
- export declare class SerializeContext {
5
- private schema;
6
- private descriptorMap;
7
- private importedMaps;
8
- private zodToTypeName;
9
- private types;
10
- private imports;
11
- constructor(schema: Schema, options?: {
12
- types?: Record<string, z.ZodType>;
13
- });
14
- run(): SchemaIR;
15
- private serializeInterface;
16
- private serializeNode;
17
- private serializeEdge;
18
- private resolveInherits;
19
- private serializeEndpoint;
20
- private serializeConstraints;
21
- private serializeProperties;
22
- private serializePropertySchema;
23
- private serializeMethods;
24
- private serializeFn;
25
- private serializeParams;
26
- private convertZodSchema;
27
- private zodToJsonSchemaRaw;
28
- private serializeData;
29
- private buildNodeRef;
30
- private getDefName;
31
- }
32
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/serializer/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,OAAO,KAAK,EACV,QAAQ,EAUT,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAkBjD,qBAAa,gBAAgB;IAQzB,OAAO,CAAC,MAAM;IAPhB,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,YAAY,CAAiE;IACrF,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,OAAO,CAAuC;IAEtD,YACU,MAAM,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;KAAE,EAkBhD;IAED,GAAG,IAAI,QAAQ,CA6Bd;IAED,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,uBAAuB;IAQ/B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,eAAe;IAiCvB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,UAAU;CA0CnB"}
@@ -1,308 +0,0 @@
1
- import { z } from 'zod';
2
- import { isEdge } from '../grammar/definition/discriminants.js';
3
- import { normalizeProperty } from '../grammar/facets/properties.js';
4
- import { buildDescriptorMap, findDefTransitive } from '../schema/refs.js';
5
- import { unwrapZod, getArrayElement, foldNullable, mapCardinality, hasRefTag, getRefMeta, getDataMeta, hasBitmaskTag, cleanJsonSchema, } from './helpers.js';
6
- export class SerializeContext {
7
- schema;
8
- descriptorMap;
9
- importedMaps = [];
10
- zodToTypeName = new WeakMap();
11
- types = {};
12
- imports = {};
13
- constructor(schema, options) {
14
- this.schema = schema;
15
- this.descriptorMap = buildDescriptorMap(schema);
16
- for (const imported of schema.imports ?? []) {
17
- const importedMap = buildDescriptorMap(imported);
18
- this.importedMaps.push({ origin: imported.domain, map: importedMap });
19
- for (const [def, descriptor] of importedMap) {
20
- this.descriptorMap.set(def, descriptor);
21
- }
22
- }
23
- if (options?.types) {
24
- for (const [name, zodSchema] of Object.entries(options.types)) {
25
- this.zodToTypeName.set(zodSchema, name);
26
- this.types[name] = this.zodToJsonSchemaRaw(zodSchema);
27
- }
28
- }
29
- }
30
- run() {
31
- const interfaces = {};
32
- const classes = {};
33
- for (const [name, def] of Object.entries(this.schema.interfaces)) {
34
- interfaces[name] = this.serializeInterface(name, def);
35
- }
36
- for (const [name, def] of Object.entries(this.schema.classes)) {
37
- if (isEdge(def)) {
38
- classes[name] = this.serializeEdge(name, def);
39
- }
40
- else {
41
- classes[name] = this.serializeNode(name, def);
42
- }
43
- }
44
- const result = {
45
- version: '1.0',
46
- domain: this.schema.domain,
47
- types: this.types,
48
- interfaces,
49
- classes,
50
- };
51
- if (Object.keys(this.imports).length > 0) {
52
- result.imports = this.imports;
53
- }
54
- return result;
55
- }
56
- serializeInterface(name, def) {
57
- const { config } = def;
58
- const result = {
59
- type: 'interface',
60
- name,
61
- extends: this.resolveInherits(config),
62
- properties: this.serializeProperties(config.properties),
63
- methods: this.serializeMethods(config.methods, name),
64
- };
65
- const content = config.content;
66
- const data = this.serializeData(content);
67
- if (data)
68
- result.data = data;
69
- return result;
70
- }
71
- serializeNode(name, def) {
72
- const { config } = def;
73
- const result = {
74
- type: 'node',
75
- name,
76
- implements: this.resolveInherits(config),
77
- properties: this.serializeProperties(config.properties),
78
- methods: this.serializeMethods(config.methods, name),
79
- };
80
- const content = config.content;
81
- const data = this.serializeData(content);
82
- if (data)
83
- result.data = data;
84
- const icon = config.icon;
85
- if (typeof icon === 'string' && icon.length > 0)
86
- result.icon = icon;
87
- return result;
88
- }
89
- serializeEdge(name, def) {
90
- const { config } = def;
91
- const edgeDef = def;
92
- const result = {
93
- type: 'edge',
94
- name,
95
- implements: this.resolveInherits(config),
96
- endpoints: [this.serializeEndpoint(edgeDef.from), this.serializeEndpoint(edgeDef.to)],
97
- properties: this.serializeProperties(config.properties),
98
- methods: this.serializeMethods(config.methods, name),
99
- };
100
- const constraints = this.serializeConstraints(config.constraints);
101
- if (constraints)
102
- result.constraints = constraints;
103
- return result;
104
- }
105
- resolveInherits(config) {
106
- const inherits = config.inherits;
107
- if (!inherits)
108
- return [];
109
- return inherits.map((e) => this.getDefName(e));
110
- }
111
- serializeEndpoint(endpoint) {
112
- const result = {
113
- name: endpoint.as,
114
- types: endpoint.types.map((t) => this.getDefName(t)),
115
- };
116
- if (endpoint.cardinality) {
117
- const mapped = mapCardinality(endpoint.cardinality);
118
- if (mapped)
119
- result.cardinality = mapped;
120
- }
121
- return result;
122
- }
123
- serializeConstraints(constraints) {
124
- if (!constraints)
125
- return undefined;
126
- const c = {};
127
- let has = false;
128
- if (constraints.unique) {
129
- c.unique = true;
130
- has = true;
131
- }
132
- if (constraints.noSelf) {
133
- c.noSelf = true;
134
- has = true;
135
- }
136
- if (constraints.acyclic) {
137
- c.acyclic = true;
138
- has = true;
139
- }
140
- if (constraints.symmetric) {
141
- c.symmetric = true;
142
- has = true;
143
- }
144
- return has ? c : undefined;
145
- }
146
- serializeProperties(attrs) {
147
- if (!attrs)
148
- return {};
149
- const result = {};
150
- for (const [name, input] of Object.entries(attrs)) {
151
- const normalized = normalizeProperty(input);
152
- const decl = this.serializePropertySchema(normalized.schema);
153
- if (normalized.private)
154
- decl.private = true;
155
- result[name] = decl;
156
- }
157
- return result;
158
- }
159
- serializePropertySchema(schema) {
160
- const { inner, nullable, defaultValue, hasDefault } = unwrapZod(schema);
161
- let jsonSchema = this.convertZodSchema(inner);
162
- if (nullable)
163
- jsonSchema = foldNullable(jsonSchema);
164
- if (hasDefault)
165
- jsonSchema = { ...jsonSchema, default: defaultValue };
166
- return jsonSchema;
167
- }
168
- serializeMethods(methods, _className) {
169
- if (!methods)
170
- return {};
171
- const result = {};
172
- for (const [name, def] of Object.entries(methods)) {
173
- result[name] = this.serializeFn(name, def);
174
- }
175
- return result;
176
- }
177
- serializeFn(name, def) {
178
- const { config } = def;
179
- const { inner: returnInner, nullable: returnNullable } = unwrapZod(config.returns);
180
- const fn = {
181
- name,
182
- params: this.serializeParams(config.params),
183
- returns: this.convertZodSchema(returnInner),
184
- static: config.static ?? false,
185
- inheritance: config.inheritance ?? 'default',
186
- };
187
- if (returnNullable)
188
- fn.returnsNullable = true;
189
- if (config.output && config.output !== 'value')
190
- fn.output = config.output;
191
- return fn;
192
- }
193
- serializeParams(params) {
194
- if (!params)
195
- return {};
196
- const resolved = typeof params === 'function' ? params() : params;
197
- const result = {};
198
- for (const [name, schema] of Object.entries(resolved)) {
199
- const zodSchema = schema;
200
- if (hasRefTag(zodSchema)) {
201
- result[name] = this.buildNodeRef(zodSchema);
202
- continue;
203
- }
204
- const { inner, nullable, defaultValue, hasDefault } = unwrapZod(zodSchema);
205
- if (hasRefTag(inner)) {
206
- let refSchema = this.buildNodeRef(inner);
207
- if (nullable)
208
- refSchema = foldNullable(refSchema);
209
- if (hasDefault)
210
- refSchema = { ...refSchema, default: defaultValue };
211
- result[name] = refSchema;
212
- continue;
213
- }
214
- let jsonSchema = this.convertZodSchema(inner);
215
- if (nullable)
216
- jsonSchema = foldNullable(jsonSchema);
217
- if (hasDefault)
218
- jsonSchema = { ...jsonSchema, default: defaultValue };
219
- result[name] = jsonSchema;
220
- }
221
- return result;
222
- }
223
- convertZodSchema(schema) {
224
- if (hasRefTag(schema))
225
- return this.buildNodeRef(schema);
226
- const dataMeta = getDataMeta(schema);
227
- if (dataMeta) {
228
- if (dataMeta.kind === 'self')
229
- return { $dataRef: 'self' };
230
- return { $dataRef: this.getDefName(dataMeta.target) };
231
- }
232
- if (hasBitmaskTag(schema))
233
- return { type: 'integer', format: 'bitmask' };
234
- const typeName = this.zodToTypeName.get(schema);
235
- if (typeName)
236
- return { $ref: `#/types/${typeName}` };
237
- const element = getArrayElement(schema);
238
- if (element) {
239
- const itemSchema = this.convertZodSchema(element);
240
- if (itemSchema.$nodeRef || itemSchema.$dataRef || itemSchema.$ref) {
241
- return { type: 'array', items: itemSchema };
242
- }
243
- }
244
- return this.zodToJsonSchemaRaw(schema);
245
- }
246
- zodToJsonSchemaRaw(schema) {
247
- try {
248
- const result = z.toJSONSchema(schema);
249
- return cleanJsonSchema(result);
250
- }
251
- catch {
252
- return {};
253
- }
254
- }
255
- serializeData(data) {
256
- if (!data || Object.keys(data).length === 0)
257
- return undefined;
258
- const objectSchema = z.object(data);
259
- const result = z.toJSONSchema(objectSchema);
260
- return cleanJsonSchema(result);
261
- }
262
- buildNodeRef(schema) {
263
- const meta = getRefMeta(schema);
264
- if (!meta)
265
- return {};
266
- const result = {
267
- $nodeRef: this.getDefName(meta.target),
268
- };
269
- if (meta.includeData)
270
- result.includeData = true;
271
- return result;
272
- }
273
- getDefName(def) {
274
- const descriptor = this.descriptorMap.get(def);
275
- if (!descriptor) {
276
- const transitive = findDefTransitive(this.schema, def);
277
- if (transitive) {
278
- throw new Error(`Serialization error: referenced def is declared in schema "${transitive.origin}" ` +
279
- `(reachable via ${transitive.path.join(' → ')}), but "${transitive.origin}" ` +
280
- `is not in the direct imports of "${this.schema.domain}". ` +
281
- `Add it to your schema's \`imports\` array.`);
282
- }
283
- throw new Error(`Serialization error: referenced def not found in schema "${this.schema.domain}" ` +
284
- `or any of its imports. Is the def from an unregistered schema?`);
285
- }
286
- // Already recorded — early-out doubles as cycle-guard for the recursion below.
287
- if (this.imports[descriptor.name])
288
- return descriptor.name;
289
- for (const { origin, map } of this.importedMaps) {
290
- const importedDescriptor = map.get(def);
291
- if (!importedDescriptor)
292
- continue;
293
- this.imports[descriptor.name] = { origin, definition: importedDescriptor.group };
294
- // Recurse on `inherits` so transitive ancestors are recorded too:
295
- // a method materialized via an indirect ancestor (e.g.
296
- // `View → UI → Function → Identity` where only Function is referenced
297
- // directly) must qualify to the ancestor's owning schema, not ours.
298
- // The early-out above keeps the recursion cycle-safe.
299
- const inherits = def.config.inherits;
300
- if (inherits) {
301
- for (const parent of inherits)
302
- this.getDefName(parent);
303
- }
304
- return descriptor.name;
305
- }
306
- return descriptor.name;
307
- }
308
- }
@@ -1,34 +0,0 @@
1
- import type { z } from 'zod';
2
- import type { Cardinality } from '../grammar/facets/endpoints.js';
3
- export declare function getZodDef(schema: z.ZodType): Record<string, any> | null;
4
- export declare function getZodTypeName(def: Record<string, any>): string | undefined;
5
- export declare function getZodInner(def: Record<string, any>): z.ZodType | null;
6
- export interface UnwrapResult {
7
- inner: z.ZodType;
8
- nullable: boolean;
9
- defaultValue: unknown;
10
- hasDefault: boolean;
11
- }
12
- export declare function unwrapZod(schema: z.ZodType): UnwrapResult;
13
- export declare function getArrayElement(schema: z.ZodType): z.ZodType | null;
14
- export declare function hasRefTag(schema: z.ZodType): boolean;
15
- export declare function getRefMeta(schema: z.ZodType): {
16
- target: object;
17
- includeData: boolean;
18
- } | null;
19
- export declare function hasDataTag(schema: z.ZodType): boolean;
20
- export declare function getDataMeta(schema: z.ZodType): {
21
- kind: 'self';
22
- } | {
23
- kind: 'grant';
24
- target: object;
25
- } | null;
26
- export declare function hasBitmaskTag(schema: z.ZodType): boolean;
27
- export type JsonSchema = Record<string, unknown>;
28
- export declare function foldNullable(schema: JsonSchema): JsonSchema;
29
- export declare function mapCardinality(c: Cardinality): {
30
- min: number;
31
- max: number | null;
32
- } | undefined;
33
- export declare function cleanJsonSchema(schema: Record<string, unknown>): JsonSchema;
34
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/serializer/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAYjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAEvE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,CAEtE;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,CAAC,CAAC,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,YAAY,CA0CzD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,CAQnE;AAID,wBAAgB,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAG7F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAErD;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,CAAC,CAAC,OAAO,GAChB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAG7D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAExD;AAID,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAS3D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAW9F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAO3E"}