@astrale-os/kernel-core 0.9.0-beta.9 → 0.9.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 (380) hide show
  1. package/dist/auth/authority/accept.js +4 -0
  2. package/dist/auth/authority/admission/admission.d.ts +4 -1
  3. package/dist/auth/authority/admission/admission.js +46 -147
  4. package/dist/auth/authority/admission/index.d.ts +1 -1
  5. package/dist/auth/authority/admission/index.js +1 -1
  6. package/dist/auth/authority/admission/references.d.ts +13 -0
  7. package/dist/auth/authority/admission/references.js +38 -0
  8. package/dist/auth/authority/admission/term.d.ts +6 -0
  9. package/dist/auth/authority/admission/term.js +60 -0
  10. package/dist/auth/authority/admission/wire.d.ts +8 -0
  11. package/dist/auth/authority/admission/wire.js +33 -0
  12. package/dist/auth/authority/canonical.d.ts +2 -0
  13. package/dist/auth/authority/canonical.js +15 -0
  14. package/dist/auth/authority/index.d.ts +9 -2
  15. package/dist/auth/authority/index.js +6 -1
  16. package/dist/auth/authority/language/index.d.ts +3 -1
  17. package/dist/auth/authority/language/index.js +1 -0
  18. package/dist/auth/authority/language/predicate.d.ts +31 -16
  19. package/dist/auth/authority/language/predicate.js +1 -1
  20. package/dist/auth/authority/language/program.d.ts +21 -0
  21. package/dist/auth/authority/language/program.js +2 -0
  22. package/dist/auth/authority/normalization/index.d.ts +1 -1
  23. package/dist/auth/authority/normalization/index.js +1 -1
  24. package/dist/auth/authority/normalization/normalize.d.ts +2 -0
  25. package/dist/auth/authority/normalization/normalize.js +38 -16
  26. package/dist/auth/authority/ownership.optimization.d.ts +8 -0
  27. package/dist/auth/authority/ownership.optimization.js +83 -0
  28. package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
  29. package/dist/auth/authority/prepare-binder-body.js +31 -0
  30. package/dist/auth/authority/program.d.ts +28 -0
  31. package/dist/auth/authority/program.js +191 -0
  32. package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
  33. package/dist/auth/authority/semantics/class-authority.js +26 -0
  34. package/dist/auth/authority/semantics/composition.d.ts +46 -0
  35. package/dist/auth/authority/semantics/composition.js +150 -0
  36. package/dist/auth/authority/semantics/failure.d.ts +21 -0
  37. package/dist/auth/authority/semantics/failure.js +10 -0
  38. package/dist/auth/authority/semantics/index.d.ts +13 -0
  39. package/dist/auth/authority/semantics/index.js +6 -0
  40. package/dist/auth/authority/semantics/interpret.d.ts +41 -0
  41. package/dist/auth/authority/semantics/interpret.js +388 -0
  42. package/dist/auth/authority/semantics/residual.d.ts +32 -0
  43. package/dist/auth/authority/semantics/residual.js +166 -0
  44. package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
  45. package/dist/auth/authority/semantics/terms.d.ts +22 -0
  46. package/dist/auth/authority/semantics/terms.js +96 -0
  47. package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
  48. package/dist/auth/context/context.d.ts +4 -3
  49. package/dist/auth/expression/authoring/builder.d.ts +2 -11
  50. package/dist/auth/expression/authoring/builder.js +1 -45
  51. package/dist/auth/expression/authoring/index.d.ts +1 -1
  52. package/dist/auth/expression/authoring/index.js +1 -1
  53. package/dist/auth/expression/index.d.ts +1 -2
  54. package/dist/auth/expression/index.js +1 -2
  55. package/dist/auth/expression/language/identity-expression.d.ts +2 -22
  56. package/dist/auth/grant/index.d.ts +1 -1
  57. package/dist/auth/grant/index.js +1 -1
  58. package/dist/auth/grant/resolved/admission.d.ts +4 -3
  59. package/dist/auth/grant/resolved/admission.js +23 -13
  60. package/dist/auth/grant/resolved/grant.d.ts +1 -1
  61. package/dist/auth/grant/resolved/index.d.ts +1 -1
  62. package/dist/auth/grant/resolved/index.js +1 -1
  63. package/dist/auth/grant/unresolved/admission.d.ts +4 -1
  64. package/dist/auth/grant/unresolved/admission.js +27 -67
  65. package/dist/auth/grant/unresolved/limits.d.ts +2 -4
  66. package/dist/auth/grant/unresolved/limits.js +1 -5
  67. package/dist/auth/identity/admission.js +11 -3
  68. package/dist/auth/identity/identity.d.ts +15 -3
  69. package/dist/auth/identity/index.d.ts +1 -1
  70. package/dist/auth/index.d.ts +4 -4
  71. package/dist/auth/index.js +1 -1
  72. package/dist/auth/jwk/index.d.ts +1 -1
  73. package/dist/auth/jwk/index.js +1 -1
  74. package/dist/auth/jwk/thumbprint.d.ts +2 -0
  75. package/dist/auth/jwk/thumbprint.js +12 -6
  76. package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
  77. package/dist/auth/register/fingerprint/fingerprint.js +31 -0
  78. package/dist/auth/register/fingerprint/index.d.ts +2 -0
  79. package/dist/auth/register/index.d.ts +5 -0
  80. package/dist/auth/register/request/admission.d.ts +3 -0
  81. package/dist/auth/register/request/admission.js +103 -0
  82. package/dist/auth/register/request/index.d.ts +3 -0
  83. package/dist/auth/register/request/limits.d.ts +6 -0
  84. package/dist/auth/register/request/limits.js +6 -0
  85. package/dist/auth/register/request/request.d.ts +19 -0
  86. package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
  87. package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
  88. package/dist/auth/register/result/index.d.ts +1 -0
  89. package/dist/auth/register/result/result.d.ts +10 -0
  90. package/dist/auth/register/result/result.js +1 -0
  91. package/dist/callable/contract/body.d.ts +10 -0
  92. package/dist/callable/contract/body.js +7 -0
  93. package/dist/callable/contract/index.d.ts +2 -1
  94. package/dist/callable/contract/index.js +1 -1
  95. package/dist/callable/contract/output.d.ts +18 -2
  96. package/dist/callable/index.d.ts +3 -2
  97. package/dist/callable/index.js +2 -1
  98. package/dist/callable/invocation/call.d.ts +16 -2
  99. package/dist/callable/invocation/call.js +41 -1
  100. package/dist/callable/invocation/index.d.ts +1 -1
  101. package/dist/callable/invocation/index.js +1 -1
  102. package/dist/callable/invocation/result.d.ts +10 -3
  103. package/dist/dns-label.d.ts +1 -2
  104. package/dist/dns-label.js +2 -3
  105. package/dist/graph/graph/graph.d.ts +1 -5
  106. package/dist/graph/graph/graph.js +3 -27
  107. package/dist/graph/graph/index.d.ts +2 -4
  108. package/dist/graph/graph/index.js +2 -3
  109. package/dist/graph/graph/model/codec.js +4 -4
  110. package/dist/graph/graph/model/index.d.ts +1 -1
  111. package/dist/graph/graph/model/index.js +1 -1
  112. package/dist/graph/graph/model/model.d.ts +7 -7
  113. package/dist/graph/graph/model/model.js +6 -6
  114. package/dist/graph/graph/model/wire.d.ts +58 -78
  115. package/dist/graph/graph/model/wire.js +18 -19
  116. package/dist/graph/mutate/authoring/builder.d.ts +2 -2
  117. package/dist/graph/mutate/authoring/builder.js +2 -2
  118. package/dist/graph/mutate/authoring/create.js +13 -5
  119. package/dist/graph/mutate/index.d.ts +1 -1
  120. package/dist/graph/mutate/language/codec.js +3 -3
  121. package/dist/graph/mutate/language/model.d.ts +4 -4
  122. package/dist/graph/mutate/language/wire.d.ts +226 -215
  123. package/dist/graph/mutate/language/wire.js +42 -47
  124. package/dist/graph/mutate/result/index.d.ts +4 -3
  125. package/dist/graph/mutate/result/index.js +8 -6
  126. package/dist/graph/mutate/result/wire.d.ts +4 -4
  127. package/dist/graph/mutate/result/wire.js +7 -4
  128. package/dist/graph/node/identity/id.d.ts +0 -4
  129. package/dist/graph/node/identity/id.js +0 -5
  130. package/dist/graph/node/identity/order.js +20 -0
  131. package/dist/graph/path/authoring/path.d.ts +8 -5
  132. package/dist/graph/path/authoring/path.js +21 -3
  133. package/dist/graph/path/language/model.d.ts +8 -3
  134. package/dist/graph/path/language/syntax.js +23 -8
  135. package/dist/graph/query/authoring/builder.js +37 -5
  136. package/dist/graph/query/authoring/model.d.ts +20 -1
  137. package/dist/graph/query/index.d.ts +4 -2
  138. package/dist/graph/query/index.js +1 -0
  139. package/dist/graph/query/language/codec.js +18 -3
  140. package/dist/graph/query/language/fingerprint.js +8 -0
  141. package/dist/graph/query/language/model.d.ts +22 -4
  142. package/dist/graph/query/language/wire.d.ts +124 -114
  143. package/dist/graph/query/language/wire.js +54 -47
  144. package/dist/graph/query/order/index.d.ts +53 -0
  145. package/dist/graph/query/order/index.js +79 -0
  146. package/dist/graph/query/reference/evaluate.d.ts +1 -0
  147. package/dist/graph/query/reference/evaluate.js +39 -52
  148. package/dist/graph/query/result/index.js +1 -1
  149. package/dist/graph/query/result/wire.d.ts +93 -94
  150. package/dist/graph/query/result/wire.js +20 -20
  151. package/dist/graph/reconcile/condition/model.d.ts +2 -2
  152. package/dist/graph/reconcile/condition/references.d.ts +0 -1
  153. package/dist/graph/reconcile/condition/references.js +4 -4
  154. package/dist/graph/reconcile/correspondence.d.ts +9 -8
  155. package/dist/graph/reconcile/evidence.d.ts +2 -2
  156. package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
  157. package/dist/graph/reconcile/observation.d.ts +4 -3
  158. package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
  159. package/dist/graph/reconcile/planning/canonical.js +28 -0
  160. package/dist/graph/reconcile/planning/context.d.ts +3 -3
  161. package/dist/graph/reconcile/planning/model.d.ts +8 -4
  162. package/dist/graph/reconcile/planning/plan.js +2 -1
  163. package/dist/schema/authority/authority-relation.js +3 -0
  164. package/dist/schema/authority/claims.d.ts +24 -25
  165. package/dist/schema/authority/claims.js +8 -8
  166. package/dist/schema/authority/governed-by.d.ts +16 -91
  167. package/dist/schema/authority/governed-by.js +1 -1
  168. package/dist/schema/authority/operation-node.d.ts +27 -13
  169. package/dist/schema/authority/operations.d.ts +8 -168
  170. package/dist/schema/authority/policy.d.ts +27 -15
  171. package/dist/schema/authority/vocabulary.d.ts +3 -0
  172. package/dist/schema/authority/vocabulary.js +25 -0
  173. package/dist/schema/callables/entrypoint.d.ts +32 -0
  174. package/dist/schema/callables/entrypoint.js +12 -0
  175. package/dist/schema/callables/execution.d.ts +569 -0
  176. package/dist/schema/callables/execution.js +32 -0
  177. package/dist/schema/callables/function.d.ts +3400 -55
  178. package/dist/schema/callables/function.js +6 -4
  179. package/dist/schema/callables/index.d.ts +2 -1
  180. package/dist/schema/callables/index.js +2 -1
  181. package/dist/schema/callables/method-of.d.ts +18 -143
  182. package/dist/schema/callables/method-of.js +2 -2
  183. package/dist/schema/callables/view.d.ts +83 -51
  184. package/dist/schema/definitions/class.d.ts +45 -33
  185. package/dist/schema/definitions/extends.d.ts +16 -110
  186. package/dist/schema/definitions/instance-of.d.ts +17 -69
  187. package/dist/schema/domain/domain.d.ts +3343 -148
  188. package/dist/schema/domain/domain.js +6 -3
  189. package/dist/schema/domain/of-domain.d.ts +18 -192
  190. package/dist/schema/domain/of-domain.js +1 -1
  191. package/dist/schema/identity/composition.d.ts +5 -0
  192. package/dist/schema/identity/composition.js +5 -0
  193. package/dist/schema/identity/identity.d.ts +225 -122
  194. package/dist/schema/identity/identity.js +3 -4
  195. package/dist/schema/index.d.ts +1 -0
  196. package/dist/schema/index.js +1 -0
  197. package/dist/schema/installation/operation-id.d.ts +1 -2
  198. package/dist/schema/installation/operation-id.js +2 -4
  199. package/dist/schema/introspection/index.d.ts +1 -1
  200. package/dist/schema/introspection/language.d.ts +12 -28
  201. package/dist/schema/kernel/projection/callables.js +2 -3
  202. package/dist/schema/kernel/projection/core.d.ts +7 -0
  203. package/dist/schema/kernel/projection/core.js +51 -0
  204. package/dist/schema/kernel/projection/definitions.d.ts +13 -0
  205. package/dist/schema/kernel/projection/definitions.js +71 -0
  206. package/dist/schema/kernel/projection/index.d.ts +3 -3
  207. package/dist/schema/kernel/projection/index.js +2 -2
  208. package/dist/schema/kernel/projection/methods.d.ts +5 -0
  209. package/dist/schema/kernel/projection/methods.js +41 -0
  210. package/dist/schema/kernel/projection/part.d.ts +34 -0
  211. package/dist/schema/kernel/projection/part.js +42 -0
  212. package/dist/schema/kernel/projection/paths.d.ts +6 -0
  213. package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
  214. package/dist/schema/kernel/projection/project.d.ts +4 -2
  215. package/dist/schema/kernel/projection/project.js +33 -258
  216. package/dist/schema/kernel/projection/properties.d.ts +11 -0
  217. package/dist/schema/kernel/projection/properties.js +36 -0
  218. package/dist/schema/kernel/projection/relations.d.ts +7 -0
  219. package/dist/schema/kernel/projection/relations.js +61 -0
  220. package/dist/schema/kernel/projection/types.d.ts +28 -2
  221. package/dist/schema/kernel/schema.d.ts +9008 -4939
  222. package/dist/schema/kernel/schema.js +12 -8
  223. package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
  224. package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
  225. package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
  226. package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
  227. package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
  228. package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
  229. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
  230. package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
  231. package/dist/schema/kernel/syscalls/contracts/execution.d.ts +300 -0
  232. package/dist/schema/kernel/syscalls/contracts/execution.js +116 -0
  233. package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
  234. package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
  235. package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
  236. package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
  237. package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
  238. package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
  239. package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
  240. package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
  241. package/dist/schema/kernel/syscalls/contracts/install.d.ts +309 -217
  242. package/dist/schema/kernel/syscalls/contracts/install.js +68 -26
  243. package/dist/schema/kernel/syscalls/contracts/installation.d.ts +70 -351
  244. package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
  245. package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
  246. package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
  247. package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
  248. package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
  249. package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
  250. package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
  251. package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
  252. package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
  253. package/dist/schema/kernel/syscalls/contracts/query.d.ts +239 -222
  254. package/dist/schema/kernel/syscalls/contracts/query.js +17 -15
  255. package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
  256. package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
  257. package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +55 -148
  258. package/dist/schema/kernel/syscalls/contracts/uninstall.js +7 -5
  259. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
  260. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
  261. package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
  262. package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
  263. package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
  264. package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
  265. package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
  266. package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
  267. package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
  268. package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
  269. package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
  270. package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
  271. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
  272. package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
  273. package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
  274. package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
  275. package/dist/schema/kernel/syscalls/declarations/execution.d.ts +255 -0
  276. package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
  277. package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
  278. package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
  279. package/dist/schema/kernel/syscalls/declarations/index.d.ts +1079 -1323
  280. package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
  281. package/dist/schema/kernel/syscalls/declarations/install.d.ts +85 -172
  282. package/dist/schema/kernel/syscalls/declarations/install.js +7 -3
  283. package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
  284. package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
  285. package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
  286. package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
  287. package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
  288. package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
  289. package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
  290. package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
  291. package/dist/schema/kernel/syscalls/declarations/query.d.ts +236 -260
  292. package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
  293. package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
  294. package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
  295. package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +51 -153
  296. package/dist/schema/kernel/syscalls/declarations/uninstall.js +6 -2
  297. package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
  298. package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
  299. package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
  300. package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
  301. package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
  302. package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
  303. package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
  304. package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
  305. package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
  306. package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
  307. package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +303 -0
  308. package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
  309. package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
  310. package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
  311. package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
  312. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
  313. package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
  314. package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
  315. package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
  316. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
  317. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
  318. package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
  319. package/dist/schema/kernel/syscalls/index.d.ts +2 -2
  320. package/dist/schema/kernel/syscalls/index.js +2 -2
  321. package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
  322. package/dist/schema/kernel/syscalls/references/execution.js +13 -0
  323. package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
  324. package/dist/schema/kernel/syscalls/references/functions.js +3 -1
  325. package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
  326. package/dist/schema/kernel/syscalls/references/identity.js +1 -0
  327. package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
  328. package/dist/schema/kernel/syscalls/references/index.js +2 -1
  329. package/dist/schema/meta/created-by.d.ts +32 -0
  330. package/dist/schema/meta/created-by.js +17 -0
  331. package/dist/schema/meta/descriptable.d.ts +13 -11
  332. package/dist/schema/meta/edge.d.ts +5 -9
  333. package/dist/schema/meta/iconable.d.ts +13 -11
  334. package/dist/schema/meta/index.d.ts +1 -0
  335. package/dist/schema/meta/index.js +1 -0
  336. package/dist/schema/meta/named.d.ts +13 -9
  337. package/dist/schema/meta/node.d.ts +9 -1
  338. package/dist/schema/meta/remotable.d.ts +15 -22
  339. package/dist/schema/meta/statused.d.ts +13 -7
  340. package/dist/schema/meta/timestamped.d.ts +14 -12
  341. package/package.json +9 -7
  342. package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
  343. package/dist/auth/expression/normalization/canonicalize.js +0 -102
  344. package/dist/auth/expression/normalization/index.d.ts +0 -2
  345. package/dist/auth/expression/normalization/index.js +0 -2
  346. package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
  347. package/dist/auth/expression/normalization/raise-denials.js +0 -59
  348. package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
  349. package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
  350. package/dist/auth/provision/fingerprint/index.d.ts +0 -2
  351. package/dist/auth/provision/index.d.ts +0 -5
  352. package/dist/auth/provision/request/admission.d.ts +0 -3
  353. package/dist/auth/provision/request/admission.js +0 -125
  354. package/dist/auth/provision/request/index.d.ts +0 -3
  355. package/dist/auth/provision/request/request.d.ts +0 -29
  356. package/dist/auth/provision/result/index.d.ts +0 -1
  357. package/dist/auth/provision/result/result.d.ts +0 -12
  358. package/dist/graph/graph/navigation/error.d.ts +0 -12
  359. package/dist/graph/graph/navigation/error.js +0 -20
  360. package/dist/graph/graph/navigation/index.d.ts +0 -2
  361. package/dist/graph/graph/navigation/index.js +0 -1
  362. package/dist/graph/graph/navigation/model.d.ts +0 -15
  363. package/dist/schema/callables/view-for.d.ts +0 -296
  364. package/dist/schema/callables/view-for.js +0 -12
  365. package/dist/schema/kernel/projection/keys.d.ts +0 -3
  366. package/dist/schema/kernel/projection/path.d.ts +0 -2
  367. package/dist/schema/kernel/projection/path.js +0 -140
  368. package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
  369. package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
  370. package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
  371. package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
  372. package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
  373. package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
  374. /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
  375. /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
  376. /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
  377. /package/dist/auth/{provision → register}/index.js +0 -0
  378. /package/dist/auth/{provision → register}/request/index.js +0 -0
  379. /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
  380. /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
@@ -1,79 +1,75 @@
1
1
  import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import { fullMatch } from '@astrale-os/kernel-dsl/v1/value/full-match';
3
- import { z } from 'zod';
3
+ import { array, discriminatedUnion, literal, record, strictObject, string, union, unknown as unknownSchema, } from 'zod';
4
4
  import { edgeSlugSchema } from '../../edge/index.js';
5
5
  import { queryAstSchema } from '../../query/language/index.js';
6
6
  import { MUTATION_AST_FORMAT, MUTATION_AST_LIMITS, MUTATION_AST_VERSION } from './model.js';
7
- const text = z.string().min(1);
8
- const binding = z.string().min(1).max(64);
9
- const propertyKey = z.string().check(fullMatch(patterns.propertyKeyFullMatch));
10
- const props = z.record(propertyKey, z.unknown());
11
- const patch = z.strictObject({ set: props, unset: z.array(propertyKey) });
12
- const endpoint = z.union([text, z.strictObject({ created: binding })]);
13
- const edgeSelector = z.strictObject({ source: text, target: text, class: text });
14
- const edgeSlug = z
15
- .string()
7
+ const text = string().min(1);
8
+ const binding = string().min(1).max(64);
9
+ const propertyKey = string().check(fullMatch(patterns.propertyKeyFullMatch));
10
+ const props = record(propertyKey, unknownSchema());
11
+ const patch = strictObject({ set: props, unset: array(propertyKey) });
12
+ const endpoint = union([text, strictObject({ created: binding })]);
13
+ const edgeSelector = strictObject({ source: text, target: text, class: text });
14
+ const edgeSlug = string()
16
15
  .min(edgeSlugSchema.minLength)
17
16
  .max(edgeSlugSchema.maxLength)
18
17
  .check(fullMatch(edgeSlugSchema.fullMatch));
19
- const edgeUpdateWithSlug = z.strictObject({
20
- op: z.literal('edge.update'),
18
+ const edgeUpdateWithSlug = strictObject({
19
+ op: literal('edge.update'),
21
20
  edge: edgeSelector,
22
21
  slug: edgeSlug.nullable(),
23
22
  props: patch.optional(),
24
23
  });
25
- const edgeUpdateWithProperties = z.strictObject({
26
- op: z.literal('edge.update'),
24
+ const edgeUpdateWithProperties = strictObject({
25
+ op: literal('edge.update'),
27
26
  edge: edgeSelector,
28
27
  props: patch,
29
28
  });
30
- const propertyConditions = z.union([
31
- z.strictObject({ equals: props, absent: z.array(propertyKey).optional() }),
32
- z.strictObject({ absent: z.array(propertyKey).min(1) }),
29
+ const propertyConditions = union([
30
+ strictObject({ equals: props, absent: array(propertyKey).optional() }),
31
+ strictObject({ absent: array(propertyKey).min(1) }),
33
32
  ]);
34
- const expectedSelection = z.discriminatedUnion('kind', [
35
- z.strictObject({
36
- kind: z.literal('node'),
37
- ids: z.array(text).max(MUTATION_AST_LIMITS.queryExpectedIdentities),
33
+ const expectedSelection = discriminatedUnion('kind', [
34
+ strictObject({
35
+ kind: literal('node'),
36
+ ids: array(text).max(MUTATION_AST_LIMITS.queryExpectedIdentities),
38
37
  }),
39
- z.strictObject({
40
- kind: z.literal('edge'),
41
- keys: z
42
- .array(z.strictObject({ source: text, target: text, class: text }))
43
- .max(MUTATION_AST_LIMITS.queryExpectedIdentities),
38
+ strictObject({
39
+ kind: literal('edge'),
40
+ keys: array(strictObject({ source: text, target: text, class: text })).max(MUTATION_AST_LIMITS.queryExpectedIdentities),
44
41
  }),
45
42
  ]);
46
- const precondition = z.union([
47
- z.strictObject({
48
- kind: z.literal('node'),
43
+ const precondition = union([
44
+ strictObject({
45
+ kind: literal('node'),
49
46
  node: text,
50
47
  class: text,
51
48
  props: propertyConditions.optional(),
52
49
  }),
53
- z.strictObject({
54
- kind: z.literal('edge'),
50
+ strictObject({
51
+ kind: literal('edge'),
55
52
  edge: edgeSelector,
56
53
  slug: edgeSlug.nullable().optional(),
57
54
  props: propertyConditions.optional(),
58
55
  }),
59
- z.strictObject({
60
- kind: z.literal('query'),
56
+ strictObject({
57
+ kind: literal('query'),
61
58
  query: queryAstSchema,
62
59
  equals: expectedSelection,
63
60
  }),
64
61
  ]);
65
62
  /** Structural JSON contract; decodeMutationAST owns paths, bindings and atomic semantics. */
66
- export const mutationAstSchema = z.strictObject({
67
- format: z.literal(MUTATION_AST_FORMAT),
68
- version: z.literal(MUTATION_AST_VERSION),
69
- preconditions: z.array(precondition).max(MUTATION_AST_LIMITS.preconditions),
70
- operations: z
71
- .array(z.union([
72
- z.strictObject({ op: z.literal('node.create'), as: binding, class: text, props }),
73
- z.strictObject({ op: z.literal('node.update'), node: text, class: text, props: patch }),
74
- z.strictObject({ op: z.literal('node.delete'), node: text, class: text }),
75
- z.strictObject({
76
- op: z.literal('edge.create'),
63
+ export const mutationAstSchema = strictObject({
64
+ format: literal(MUTATION_AST_FORMAT),
65
+ version: literal(MUTATION_AST_VERSION),
66
+ preconditions: array(precondition).max(MUTATION_AST_LIMITS.preconditions),
67
+ operations: array(union([
68
+ strictObject({ op: literal('node.create'), as: binding, class: text, props }),
69
+ strictObject({ op: literal('node.update'), node: text, class: text, props: patch }),
70
+ strictObject({ op: literal('node.delete'), node: text, class: text }),
71
+ strictObject({
72
+ op: literal('edge.create'),
77
73
  class: text,
78
74
  source: endpoint,
79
75
  target: endpoint,
@@ -82,7 +78,6 @@ export const mutationAstSchema = z.strictObject({
82
78
  }),
83
79
  edgeUpdateWithSlug,
84
80
  edgeUpdateWithProperties,
85
- z.strictObject({ op: z.literal('edge.delete'), edge: edgeSelector }),
86
- ]))
87
- .min(1),
81
+ strictObject({ op: literal('edge.delete'), edge: edgeSelector }),
82
+ ])).min(1),
88
83
  });
@@ -1,7 +1,8 @@
1
1
  import type { NodeId } from '../../node/index.js';
2
- import type { LocalBinding } from '../language/index.js';
2
+ import type { LocalAlias } from '../language/index.js';
3
3
  export type MutationResult = {
4
- readonly createdNodes: Readonly<Record<LocalBinding, NodeId>>;
4
+ readonly createdNodes: Readonly<Record<LocalAlias, NodeId>>;
5
+ readonly replayed?: true;
5
6
  };
6
7
  export declare const MutationResult: {
7
8
  decode(input: unknown): MutationResult;
@@ -12,5 +13,5 @@ export { MutationResultDecodeError } from './error.js';
12
13
  export { mutationResultSchema } from './wire.js';
13
14
  /** Re-admit one mutation result before it crosses a trust or transport boundary. */
14
15
  export declare function encodeMutationResult(input: MutationResult): MutationResult;
15
- /** Decode unknown JSON into immutable admitted LocalBinding-to-NodeId results. */
16
+ /** Decode unknown JSON into immutable admitted LocalAlias-to-NodeId results. */
16
17
  export declare function decodeMutationResult(input: unknown): MutationResult;
@@ -1,5 +1,5 @@
1
1
  import * as portable from '@astrale-os/kernel-dsl/value';
2
- import { isLocalBinding, LocalBinding as LocalBindingValue } from '#graph/graph';
2
+ import { isLocalAlias, LocalAlias as LocalAliasValue } from '#graph/graph';
3
3
  import { NodeId as nodeId } from '../../node/index.js';
4
4
  import { decodeWire } from '../../wire.js';
5
5
  import { MutationResultDecodeError } from './error.js';
@@ -8,7 +8,7 @@ export const MutationResult = Object.freeze({
8
8
  decode: decodeMutationResult,
9
9
  encode: encodeMutationResult,
10
10
  createdNode(result, binding) {
11
- return result.createdNodes[LocalBindingValue(binding)];
11
+ return result.createdNodes[LocalAliasValue(binding)];
12
12
  },
13
13
  });
14
14
  export { MutationResultDecodeError } from './error.js';
@@ -17,10 +17,11 @@ export { mutationResultSchema } from './wire.js';
17
17
  export function encodeMutationResult(input) {
18
18
  return decodeMutationResult(input);
19
19
  }
20
- /** Decode unknown JSON into immutable admitted LocalBinding-to-NodeId results. */
20
+ /** Decode unknown JSON into immutable admitted LocalAlias-to-NodeId results. */
21
21
  export function decodeMutationResult(input) {
22
22
  try {
23
- const encoded = decodeWire(mutationResultSchema, portable.accept(input), invalid).createdNodes;
23
+ const admitted = decodeWire(mutationResultSchema, portable.accept(input), invalid);
24
+ const encoded = admitted.createdNodes;
24
25
  const createdNodes = {};
25
26
  for (const binding of Object.keys(encoded).sort()) {
26
27
  const path = `/createdNodes/${escapePointer(binding)}`;
@@ -35,6 +36,7 @@ export function decodeMutationResult(input) {
35
36
  }
36
37
  return Object.freeze({
37
38
  createdNodes: Object.freeze(createdNodes),
39
+ ...(admitted.replayed === true ? { replayed: true } : {}),
38
40
  });
39
41
  }
40
42
  catch (error) {
@@ -46,8 +48,8 @@ export function decodeMutationResult(input) {
46
48
  }
47
49
  }
48
50
  function requireBinding(value, path) {
49
- if (!isLocalBinding(value))
50
- invalid(path, 'Invalid LocalBinding');
51
+ if (!isLocalAlias(value))
52
+ invalid(path, 'Invalid LocalAlias');
51
53
  }
52
54
  function escapePointer(value) {
53
55
  return value.replaceAll('~', '~0').replaceAll('/', '~1');
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
2
- export declare const mutationResultSchema: z.ZodObject<{
3
- createdNodes: z.ZodRecord<z.ZodString, z.ZodString>;
4
- }, z.core.$strict>;
1
+ export declare const mutationResultSchema: import("zod").ZodObject<{
2
+ createdNodes: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
3
+ replayed: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
4
+ }, import("zod/v4/core").$strict>;
@@ -1,4 +1,7 @@
1
- import { z } from 'zod';
2
- const text = z.string().min(1);
3
- const binding = z.string().min(1).max(64);
4
- export const mutationResultSchema = z.strictObject({ createdNodes: z.record(binding, text) });
1
+ import { literal, record, strictObject, string } from 'zod';
2
+ const text = string().min(1);
3
+ const binding = string().min(1).max(64);
4
+ export const mutationResultSchema = strictObject({
5
+ createdNodes: record(binding, text),
6
+ replayed: literal(true).optional(),
7
+ });
@@ -1,4 +1,3 @@
1
- import { z } from 'zod';
2
1
  declare const NODE_ID_BRAND: unique symbol;
3
2
  /** Stable opaque identity: 1-255 ASCII characters from [A-Za-z0-9._-]. */
4
3
  export type NodeId = string & {
@@ -12,7 +11,4 @@ export declare class NodeIdError extends TypeError {
12
11
  /** Admit opaque 1-255 character ASCII NodeId text without repair or format-specific semantics. */
13
12
  export declare function NodeId(input: string): NodeId;
14
13
  export declare function isNodeId(input: unknown): input is NodeId;
15
- export declare const nodeIdSchema: z.ZodPipe<z.ZodString & z.ZodType<NodeId, string, z.core.$ZodTypeInternals<NodeId, string>>, z.ZodTransform<NodeId, string & {
16
- readonly [NODE_ID_BRAND]: true;
17
- }>>;
18
14
  export {};
@@ -1,4 +1,3 @@
1
- import { z } from 'zod';
2
1
  const NODE_ID_MAX_LENGTH = 255;
3
2
  const NODE_ID_INVALID_CHARACTER = /[^A-Za-z0-9._-]/u;
4
3
  const NODE_ID_ERROR_MESSAGE = 'NodeId must be 1-255 ASCII characters drawn from [A-Za-z0-9._-].';
@@ -23,7 +22,3 @@ export function isNodeId(input) {
23
22
  input.length <= NODE_ID_MAX_LENGTH &&
24
23
  !NODE_ID_INVALID_CHARACTER.test(input));
25
24
  }
26
- export const nodeIdSchema = z
27
- .string()
28
- .refine(isNodeId, NODE_ID_ERROR_MESSAGE)
29
- .transform((value) => value);
@@ -1,6 +1,26 @@
1
1
  const encoder = new TextEncoder();
2
2
  /** Compare canonical Node identity by unsigned lexicographic UTF-8 byte order. */
3
3
  export function compareNodeIds(left, right) {
4
+ // UTF-8 preserves code point order, and identical UTF-16 prefixes encode identically. Below the
5
+ // surrogate block, the first differing code unit therefore decides the UTF-8 byte order.
6
+ const length = Math.min(left.length, right.length);
7
+ let index = 0;
8
+ while (index < length && left.charCodeAt(index) === right.charCodeAt(index))
9
+ index++;
10
+ if (index < length) {
11
+ const a = left.charCodeAt(index);
12
+ const b = right.charCodeAt(index);
13
+ if (a < 0xd800 && b < 0xd800)
14
+ return a < b ? -1 : 1;
15
+ }
16
+ else {
17
+ const next = (left.length > right.length ? left : right).charCodeAt(index);
18
+ if (Number.isNaN(next) || next < 0xdc00 || next > 0xdfff)
19
+ return Math.sign(left.length - right.length);
20
+ }
21
+ return compareUtf8(left, right);
22
+ }
23
+ function compareUtf8(left, right) {
4
24
  const a = encoder.encode(left);
5
25
  const b = encoder.encode(right);
6
26
  const length = Math.min(a.length, b.length);
@@ -1,4 +1,5 @@
1
- import type { CoreRef, DefinitionRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
1
+ import type { DefinitionRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { MethodKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
3
  import { type ClassKey as ClassKeyValue } from '@astrale-os/kernel-dsl/v1/addressing';
3
4
  import type { NodeId } from '../../node/identity/index.js';
4
5
  import type { DomainAnchor as PathDomainAnchor, DomainProjection as PathDomainProjection, IdAnchor as PathIdAnchor, MethodStep as PathMethodStep, NodePath, PathAST, PathAnchor, PathDiagnostic, PathDiagnosticCode, PathStep, ProjectionKind as PathProjectionKind, ProjectionStep as PathProjectionStep, TraversalStep as PathTraversalStep } from '../language/index.js';
@@ -11,13 +12,15 @@ export declare class Path {
11
12
  private constructor();
12
13
  /** Retain an admitted rich Path or parse its canonical serialized form. */
13
14
  static from(input: PathLike): Path;
15
+ /** Normalize an exact graph target without resolving its installed Node identity. */
16
+ static target(input: NodeTarget): Path;
14
17
  static parse(input: string): Path;
15
18
  static fromAST(ast: Path.AST): Path;
16
19
  static id(id: NodeId): Path.Id;
17
20
  static domain(origin: Key.Origin): Path.Domain;
18
21
  static project(input: ClassKeyValue | Path.ProjectionRef): Path.Projection;
19
22
  static staticMethod(owner: Path.Projection, name: string): Path.Method;
20
- static instanceMethod(source: Path, name: string): Path.Method;
23
+ static instanceMethod(source: Path, callable: MethodKey): Path.Method;
21
24
  out(classKey: ClassKeyValue, options?: Path.TraversalOptions): Path;
22
25
  in(classKey: ClassKeyValue, options?: Path.TraversalOptions): Path;
23
26
  equals(other: Path): boolean;
@@ -27,8 +30,8 @@ export declare class Path {
27
30
  }
28
31
  /** Rich or already-admitted serialized Path accepted at in-process authoring boundaries. */
29
32
  export type PathLike = Path | NodePath;
30
- /** Exact existing Node accepted by ID-first graph authoring facades. */
31
- export type NodeTarget = NodeId | PathLike;
33
+ /** Exact existing Node; DefinitionRefs address their projected graph nodes, not Class extents. */
34
+ export type NodeTarget = NodeId | PathLike | DefinitionRef;
32
35
  /** Runtime-established proof that a Path addresses one callable Node. */
33
36
  export type CallablePath = Path & {
34
37
  readonly [CALLABLE_PATH]: true;
@@ -46,7 +49,7 @@ export declare namespace Path {
46
49
  type ProjectionKind = PathProjectionKind;
47
50
  type DomainProjection = PathDomainProjection;
48
51
  /** Structured coordinate accepted for a graph-projected Definition or Core object. */
49
- type ProjectionRef = DefinitionRef<'class' | 'function' | 'policy' | 'view'> | CoreRef;
52
+ type ProjectionRef = DefinitionRef;
50
53
  interface TraversalOptions {
51
54
  readonly slug?: EdgeSlugValue;
52
55
  }
@@ -1,5 +1,7 @@
1
- import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
1
+ import { MethodKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { ClassKey, isDefinitionRef, } from '@astrale-os/kernel-dsl/v1/addressing';
2
3
  import { EdgeSlug } from '../../edge/slug/index.js';
4
+ import { isNodeId } from '../../node/identity/index.js';
3
5
  import { normalizePathAST, parsePathAST, pathError, serializePathAST } from '../language/index.js';
4
6
  /** Immutable rich value for one admitted NodePath. */
5
7
  export class Path {
@@ -10,6 +12,18 @@ export class Path {
10
12
  static from(input) {
11
13
  return input instanceof Path ? input : Path.parse(input);
12
14
  }
15
+ /** Normalize an exact graph target without resolving its installed Node identity. */
16
+ static target(input) {
17
+ if (input instanceof Path)
18
+ return input;
19
+ if (isNodeId(input))
20
+ return Path.id(input);
21
+ if (typeof input === 'string')
22
+ return Path.parse(input);
23
+ if (isDefinitionRef(input))
24
+ return Path.project(input);
25
+ throw pathError(input, 'PATH_INVALID_PROJECTION', 'Node target requires an ID, Path, or DefinitionRef.');
26
+ }
13
27
  static parse(input) {
14
28
  return createPath(parsePathAST(input));
15
29
  }
@@ -38,10 +52,14 @@ export class Path {
38
52
  steps: [...owner.ast.steps, { kind: 'method', dispatch: 'static', name }],
39
53
  }));
40
54
  }
41
- static instanceMethod(source, name) {
55
+ static instanceMethod(source, callable) {
56
+ const { owner, name } = MethodKey.address(callable);
42
57
  return createPath(normalizePathAST({
43
58
  anchor: source.ast.anchor,
44
- steps: [...source.ast.steps, { kind: 'method', dispatch: 'instance', name }],
59
+ steps: [
60
+ ...source.ast.steps,
61
+ { kind: 'method', dispatch: 'instance', class: ClassKey.of(owner), name },
62
+ ],
45
63
  }));
46
64
  }
47
65
  out(classKey, options = {}) {
@@ -25,11 +25,16 @@ export interface ProjectionStep {
25
25
  readonly kind: 'projection';
26
26
  readonly projection: DomainProjection;
27
27
  }
28
- export interface MethodStep {
28
+ export type MethodStep = {
29
29
  readonly kind: 'method';
30
- readonly dispatch: 'static' | 'instance';
30
+ readonly dispatch: 'static';
31
31
  readonly name: string;
32
- }
32
+ } | {
33
+ readonly kind: 'method';
34
+ readonly dispatch: 'instance';
35
+ readonly class: ClassKey;
36
+ readonly name: string;
37
+ };
33
38
  export interface TraversalStep {
34
39
  readonly kind: 'traverse';
35
40
  readonly direction: 'out' | 'in';
@@ -1,4 +1,4 @@
1
- import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
1
+ import { patterns, MethodKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import { EdgeSlug, isEdgeSlug } from '../../edge/slug/index.js';
4
4
  import { isNodeId } from '../../node/identity/index.js';
@@ -34,7 +34,9 @@ export function normalizePathAST(input) {
34
34
  continue;
35
35
  }
36
36
  if (candidate.kind === 'method') {
37
- if (!hasExactKeys(candidate, ['kind', 'dispatch', 'name']))
37
+ if (!hasExactKeys(candidate, candidate.dispatch === 'instance'
38
+ ? ['kind', 'dispatch', 'class', 'name']
39
+ : ['kind', 'dispatch', 'name']))
38
40
  invalidAST();
39
41
  if (candidate.dispatch !== 'static' && candidate.dispatch !== 'instance')
40
42
  invalidAST();
@@ -49,7 +51,18 @@ export function normalizePathAST(input) {
49
51
  invalidAST();
50
52
  }
51
53
  }
52
- steps.push({ kind: 'method', dispatch: candidate.dispatch, name: candidate.name });
54
+ if (candidate.dispatch === 'instance') {
55
+ if (!ClassKey.is(candidate.class))
56
+ invalidAST();
57
+ steps.push({
58
+ kind: 'method',
59
+ dispatch: 'instance',
60
+ class: ClassKey(candidate.class),
61
+ name: candidate.name,
62
+ });
63
+ }
64
+ else
65
+ steps.push({ kind: 'method', dispatch: 'static', name: candidate.name });
53
66
  continue;
54
67
  }
55
68
  if (candidate.kind === 'traverse') {
@@ -111,11 +124,12 @@ function parseSteps(input, start, anchorKind) {
111
124
  let cursor = start;
112
125
  while (cursor < input.length) {
113
126
  if (input.startsWith('::', cursor)) {
114
- const name = input.slice(cursor + 2);
115
- if (!patterns.memberName.test(name)) {
116
- throw pathError(input, 'PATH_INVALID_METHOD', 'Invalid instance Method name.', cursor + 2);
127
+ const key = input.slice(cursor + 2);
128
+ if (!MethodKey.is(key)) {
129
+ throw pathError(input, 'PATH_INVALID_METHOD', 'Instance Method requires a complete domain-qualified Method key.', cursor + 2);
117
130
  }
118
- steps.push({ kind: 'method', dispatch: 'instance', name });
131
+ const { owner, name } = MethodKey.address(key);
132
+ steps.push({ kind: 'method', dispatch: 'instance', class: ClassKey.of(owner), name });
119
133
  cursor = input.length;
120
134
  continue;
121
135
  }
@@ -234,7 +248,8 @@ function serializeNormalizedPathAST(ast) {
234
248
  output += `:${step.projection.kind}.${step.projection.name}`;
235
249
  }
236
250
  else if (step.kind === 'method') {
237
- output += `${step.dispatch === 'instance' ? '::' : ':'}${step.name}`;
251
+ output +=
252
+ step.dispatch === 'instance' ? `::${step.class}.method.${step.name}` : `:${step.name}`;
238
253
  }
239
254
  else {
240
255
  output += `${step.direction === 'in' ? '<~' : '~'}"${step.class}"`;
@@ -1,6 +1,5 @@
1
1
  import { ClassKey, PropertyKey, } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import * as portable from '@astrale-os/kernel-dsl/value';
3
- import { isNodeId } from '../../node/index.js';
4
3
  import { Path } from '../../path/index.js';
5
4
  import { QueryAST as QueryASTBoundary, QueryASTDecodeError } from '../language/index.js';
6
5
  function from(input) {
@@ -41,6 +40,33 @@ export function Property(input) {
41
40
  isPresent() {
42
41
  return Object.freeze({ kind: 'property.present', property: key });
43
42
  },
43
+ greater: (value) => range(key, bound(value, false, 'lower'), undefined),
44
+ greaterOrEqual: (value) => range(key, bound(value, true, 'lower'), undefined),
45
+ less: (value) => range(key, undefined, bound(value, false, 'upper')),
46
+ lessOrEqual: (value) => range(key, undefined, bound(value, true, 'upper')),
47
+ between(lower, upper, bounds = {}) {
48
+ if (typeof lower !== typeof upper) {
49
+ invalid('/predicate/upper/value', 'Range bounds must have one kind');
50
+ }
51
+ return range(key, bound(lower, bounds.lower !== 'exclusive', 'lower'), bound(upper, bounds.upper !== 'exclusive', 'upper'));
52
+ },
53
+ });
54
+ }
55
+ function bound(value, inclusive, side) {
56
+ if (typeof value !== 'number' && typeof value !== 'string') {
57
+ invalid(`/predicate/${side}/value`, 'Range bound must be a number or a text');
58
+ }
59
+ return Object.freeze({
60
+ value: canonicalValue(value, `/predicate/${side}/value`),
61
+ inclusive,
62
+ });
63
+ }
64
+ function range(property, lower, upper) {
65
+ return Object.freeze({
66
+ kind: 'property.range',
67
+ property,
68
+ ...(lower === undefined ? {} : { lower }),
69
+ ...(upper === undefined ? {} : { upper }),
44
70
  });
45
71
  }
46
72
  /** Primary persistent Query V6 authoring entry point. */
@@ -191,12 +217,12 @@ function appendFilter(state, input, defaultBinding) {
191
217
  ...(state.edge === undefined ? {} : { edge: state.edge }),
192
218
  });
193
219
  }
194
- function canonicalValue(input) {
220
+ function canonicalValue(input, path = '/predicate/value') {
195
221
  try {
196
222
  return freezeValue(portable.json.decode(portable.json.encode(input)));
197
223
  }
198
224
  catch (cause) {
199
- invalid('/predicate/value', 'Invalid portable equality value', cause);
225
+ invalid(path, 'Invalid portable Property value', cause);
200
226
  }
201
227
  }
202
228
  function freezeValue(input) {
@@ -373,9 +399,15 @@ function lowerNodeSource(input, index) {
373
399
  if (ClassKey.is(input)) {
374
400
  return Object.freeze({ kind: 'class', class: ClassKey.ref(input) });
375
401
  }
376
- if (input instanceof Path || typeof input === 'string') {
402
+ if (input instanceof Path ||
403
+ typeof input === 'string' ||
404
+ (isRecord(input) &&
405
+ (input.kind === 'core' ||
406
+ input.kind === 'function' ||
407
+ input.kind === 'policy' ||
408
+ input.kind === 'view'))) {
377
409
  try {
378
- const target = input instanceof Path ? input : isNodeId(input) ? Path.id(input) : Path.parse(input);
410
+ const target = Path.target(input);
379
411
  return Object.freeze({ kind: 'path', path: target.raw });
380
412
  }
381
413
  catch (cause) {
@@ -1,7 +1,7 @@
1
1
  import type * as dslApi from '@astrale-os/kernel-dsl/v1';
2
2
  import type * as portable from '@astrale-os/kernel-dsl/value';
3
3
  import type { NodeTarget } from '../../path/index.js';
4
- import type { EdgeBinding, NodeBinding, QueryBinding, QueryDirection, QueryEdgeIdentityPredicate, QueryEdgeProjection, QueryNodeIdentityPredicate, QueryNodeProjection, QueryPropertyOrder, QueryPropertyPredicate, QueryPropertyEqualPredicate, QueryPropertyPresentPredicate } from '../language/index.js';
4
+ import type { EdgeBinding, NodeBinding, QueryBinding, QueryDirection, QueryEdgeIdentityPredicate, QueryEdgeProjection, QueryNodeIdentityPredicate, QueryNodeProjection, QueryPropertyOrder, QueryPropertyPredicate, QueryPropertyEqualPredicate, QueryPropertyPresentPredicate, QueryPropertyRangeOf } from '../language/index.js';
5
5
  type NonEmpty<Value> = readonly [Value, ...Value[]];
6
6
  export type QueryClassInput<Kind extends 'node' | 'edge' = 'node' | 'edge'> = dslApi.ClassRef | dslApi.ClassKey | Readonly<{
7
7
  readonly ref: dslApi.ClassRef;
@@ -55,9 +55,28 @@ export type QueryCurrentNodeFilterInput = (Omit<QueryClassFilterInput, 'binding'
55
55
  }) | Extract<QueryIdentityFilterInput, {
56
56
  readonly binding: EdgeBinding;
57
57
  }>;
58
+ /** Whether each end of `between` includes its bound; both are inclusive by default. */
59
+ export interface QueryRangeBoundsInput {
60
+ readonly lower?: 'inclusive' | 'exclusive';
61
+ readonly upper?: 'inclusive' | 'exclusive';
62
+ }
63
+ /**
64
+ * Property predicate leaves. The range forms are one canonical `property.range` predicate: a
65
+ * number range compares numerically, a text range in code-point order.
66
+ */
58
67
  export interface QueryPropertyPredicateBuilder {
59
68
  equals(value: portable.Value): QueryPropertyEqualPredicate;
60
69
  isPresent(): QueryPropertyPresentPredicate;
70
+ greater(value: number): QueryPropertyRangeOf<number>;
71
+ greater(value: string): QueryPropertyRangeOf<string>;
72
+ greaterOrEqual(value: number): QueryPropertyRangeOf<number>;
73
+ greaterOrEqual(value: string): QueryPropertyRangeOf<string>;
74
+ less(value: number): QueryPropertyRangeOf<number>;
75
+ less(value: string): QueryPropertyRangeOf<string>;
76
+ lessOrEqual(value: number): QueryPropertyRangeOf<number>;
77
+ lessOrEqual(value: string): QueryPropertyRangeOf<string>;
78
+ between(lower: number, upper: number, bounds?: QueryRangeBoundsInput): QueryPropertyRangeOf<number>;
79
+ between(lower: string, upper: string, bounds?: QueryRangeBoundsInput): QueryPropertyRangeOf<string>;
61
80
  }
62
81
  export interface QueryExpandInput {
63
82
  readonly from: NodeBinding;
@@ -1,9 +1,11 @@
1
1
  /** Stable flat facade over Query language, authoring, result, and reference semantics. */
2
2
  export { Property, Query } from './authoring/index.js';
3
- export type { EdgeQueryBuilder, ExpandedQueryBuilder, NodeQueryBuilder, QueryCurrentNodeExpandInput, QueryCurrentNodeFilterInput, QueryClassInput, QueryEdgeClassInput, QueryEdgeInput, QueryClassFilterInput, QueryEdgeSourceInput, QueryEdgeGraphSelectInput, QueryEdgeSelectInput, QueryExpandInput, QueryFilterInput, QueryIdentityFilterInput, QueryNodeClassInput, QueryNodeGraphSelectInput, QueryNodeInput, QueryNodeSelectInput, QueryNodeSourceInput, QueryPropertyFilterInput, QueryPropertyPredicateBuilder, QuerySelectInput, QuerySourceInput, } from './authoring/index.js';
3
+ export type { EdgeQueryBuilder, ExpandedQueryBuilder, NodeQueryBuilder, QueryCurrentNodeExpandInput, QueryCurrentNodeFilterInput, QueryClassInput, QueryEdgeClassInput, QueryEdgeInput, QueryClassFilterInput, QueryEdgeSourceInput, QueryEdgeGraphSelectInput, QueryEdgeSelectInput, QueryExpandInput, QueryFilterInput, QueryIdentityFilterInput, QueryNodeClassInput, QueryNodeGraphSelectInput, QueryNodeInput, QueryNodeSelectInput, QueryNodeSourceInput, QueryPropertyFilterInput, QueryPropertyPredicateBuilder, QueryRangeBoundsInput, QuerySelectInput, QuerySourceInput, } from './authoring/index.js';
4
4
  export { QueryAST, QueryASTDecodeError } from './language/index.js';
5
- export type { EdgeBinding, NodeBinding, QueryBinding, QueryClassFilter, QueryClassPredicate, QueryClassSourceTerm, QueryClassSatisfiesPredicate, QueryClassEqualPredicate, QueryDirection, QueryEdgeSource, QueryEdgeSourceTerm, QueryEdgeSelect, QueryEdgeAST, QueryEdgeIdentityPredicate, QueryEdgeProjection, QueryExpand, QueryFingerprint, QueryIdentityFilter, QueryIdentityPredicate, QueryGraphSelect, QueryNodeAST, QueryNodeIdentityPredicate, QueryNodeProjection, QueryNodeSelect, QueryNodeSource, QueryNodeSourceTerm, QueryNodeTerminalSelect, QueryEdgeTerminalSelect, QueryOrderDirection, QueryPathSourceTerm, QueryPredicate, QueryProjectionShape, QueryPropertyEqualPredicate, QueryPropertyFilter, QueryPropertyOrder, QueryPropertyPredicate, QueryPropertyPresentPredicate, QuerySelect, QuerySingleSourceClassOf, QuerySource, QuerySourceClassesOf, QuerySourceTerm, QueryStep, QueryStructuralLimits, QueryUnrankedPlacement, } from './language/index.js';
5
+ export type { EdgeBinding, NodeBinding, QueryBinding, QueryClassFilter, QueryClassPredicate, QueryClassSourceTerm, QueryClassSatisfiesPredicate, QueryClassEqualPredicate, QueryDirection, QueryEdgeSource, QueryEdgeSourceTerm, QueryEdgeSelect, QueryEdgeAST, QueryEdgeIdentityPredicate, QueryEdgeProjection, QueryExpand, QueryFingerprint, QueryIdentityFilter, QueryIdentityPredicate, QueryGraphSelect, QueryNodeAST, QueryNodeIdentityPredicate, QueryNodeProjection, QueryNodeSelect, QueryNodeSource, QueryNodeSourceTerm, QueryNodeTerminalSelect, QueryEdgeTerminalSelect, QueryOrderDirection, QueryPathSourceTerm, QueryPredicate, QueryProjectionShape, QueryPropertyEqualPredicate, QueryPropertyFilter, QueryPropertyOrder, QueryPropertyPredicate, QueryPropertyPresentPredicate, QueryPropertyRangeOf, QueryPropertyRangePredicate, QueryRangeBound, QueryRangeValue, QuerySelect, QuerySingleSourceClassOf, QuerySource, QuerySourceClassesOf, QuerySourceTerm, QueryStep, QueryStructuralLimits, QueryUnrankedPlacement, } from './language/index.js';
6
6
  export { QueryResult, QueryResultDecodeError } from './result/index.js';
7
7
  export type { QueryEdgeComponentFor, QueryEdgeGraphResult, QueryEdgeItemFor, QueryEdgeResult, QueryGraphResult, QueryNodeComponentFor, QueryNodeGraphResult, QueryNodeItemFor, QueryNodeReference, QueryNodeResult, QueryResultFor, QueryResultForSelect, QuerySelection, QuerySelectionFor, } from './result/index.js';
8
+ export { compareQueryIdentity, compareQueryRank, compareQueryText, compareQueryValue, queryRangeContains, } from './order/index.js';
9
+ export type { QueryRank, QueryRankIdentity, QueryRankOrder, QueryRankValue } from './order/index.js';
8
10
  export { QueryReference, QueryReferenceError } from './reference/index.js';
9
11
  export type { QueryReferenceContext, QueryReferenceClassClosure, QueryReferenceEvaluation, QueryReferenceFrontier, QueryReferenceIdentity, QueryReferenceOptions, QueryReferencePathWitness, QueryReferenceProperty, QueryReferenceTrace, } from './reference/index.js';
@@ -2,4 +2,5 @@
2
2
  export { Property, Query } from './authoring/index.js';
3
3
  export { QueryAST, QueryASTDecodeError } from './language/index.js';
4
4
  export { QueryResult, QueryResultDecodeError } from './result/index.js';
5
+ export { compareQueryIdentity, compareQueryRank, compareQueryText, compareQueryValue, queryRangeContains, } from './order/index.js';
5
6
  export { QueryReference, QueryReferenceError } from './reference/index.js';
@@ -1,7 +1,7 @@
1
1
  import { patterns, PropertyKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import * as portable from '@astrale-os/kernel-dsl/value';
4
- import { LocalBinding } from '../../graph/index.js';
4
+ import { LocalAlias } from '../../graph/index.js';
5
5
  import { NodeId } from '../../node/index.js';
6
6
  import { NodePath } from '../../path/index.js';
7
7
  import { decodeWire } from '../../wire.js';
@@ -194,6 +194,21 @@ function decodePredicate(input, path, binding) {
194
194
  if (input.kind === 'property.present') {
195
195
  return Object.freeze({ kind: 'property.present', property });
196
196
  }
197
+ if (input.kind === 'property.range') {
198
+ const lower = input.lower === undefined ? undefined : Object.freeze({ ...input.lower });
199
+ const upper = input.upper === undefined ? undefined : Object.freeze({ ...input.upper });
200
+ if (lower === undefined && upper === undefined)
201
+ invalid(path, 'Range requires a bound');
202
+ if (lower !== undefined && upper !== undefined && typeof lower.value !== typeof upper.value) {
203
+ invalid(`${path}/upper/value`, 'Range bounds must have one kind');
204
+ }
205
+ return Object.freeze({
206
+ kind: 'property.range',
207
+ property,
208
+ ...(lower === undefined ? {} : { lower }),
209
+ ...(upper === undefined ? {} : { upper }),
210
+ });
211
+ }
197
212
  return Object.freeze({
198
213
  kind: 'property.equal',
199
214
  property,
@@ -237,7 +252,7 @@ function decodeClass(input, path) {
237
252
  function introduce(input, kind, path, symbols) {
238
253
  let name;
239
254
  try {
240
- name = LocalBinding(input);
255
+ name = LocalAlias(input);
241
256
  }
242
257
  catch (cause) {
243
258
  invalid(path, 'Invalid binding name', cause);
@@ -250,7 +265,7 @@ function introduce(input, kind, path, symbols) {
250
265
  function reference(input, expected, path, symbols) {
251
266
  let name;
252
267
  try {
253
- name = LocalBinding(input);
268
+ name = LocalAlias(input);
254
269
  }
255
270
  catch (cause) {
256
271
  invalid(path, 'Invalid binding name', cause);