@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
@@ -7,13 +7,12 @@ export const Identity = nodeClass({
7
7
  description: 'A principal that can be authenticated and can originate persistent authority facts.',
8
8
  extends: [Node],
9
9
  properties: {
10
- frozen: property({ type: 'boolean' }, { required: false, visibility: 'private' }),
11
- iss: { type: 'string', minLength: 1 },
10
+ iss: property({ type: 'string', minLength: 1 }, { required: false }),
11
+ sub: property({ type: 'string', minLength: 1 }, { required: false }),
12
+ frozen: property({ type: 'boolean' }, { required: false }),
12
13
  requiredClaims: property(requiredClaimsSchema, {
13
14
  required: false,
14
- visibility: 'private',
15
15
  }),
16
- sub: { type: 'string', minLength: 1 },
17
16
  },
18
17
  methods: IdentityMethods,
19
18
  });
@@ -5,3 +5,4 @@ export * as graph from './kernel/projection/index.js';
5
5
  export * as introspection from './introspection/index.js';
6
6
  export * as installation from './installation/index.js';
7
7
  export { OperationCore } from './core/index.js';
8
+ export { authorityVocabulary } from './authority/vocabulary.js';
@@ -4,3 +4,4 @@ export * as graph from './kernel/projection/index.js';
4
4
  export * as introspection from './introspection/index.js';
5
5
  export * as installation from './installation/index.js';
6
6
  export { OperationCore } from './core/index.js';
7
+ export { authorityVocabulary } from './authority/vocabulary.js';
@@ -1,4 +1,3 @@
1
- import { z } from 'zod';
2
1
  declare const OPERATION_ID: unique symbol;
3
2
  /** Caller-selected identity for one retryable Schema installation operation. */
4
3
  export type OperationId = string & {
@@ -7,5 +6,5 @@ export type OperationId = string & {
7
6
  /** Accept one canonical lowercase UUIDv4 without repair or case folding. */
8
7
  export declare function acceptOperationId(input: unknown): OperationId;
9
8
  /** Internal schema shared by Kernel-owned callable contracts. */
10
- export declare const operationIdSchema: z.ZodString;
9
+ export declare const operationIdSchema: import("zod").ZodString;
11
10
  export {};
@@ -1,5 +1,5 @@
1
1
  import { fullMatch } from '@astrale-os/kernel-dsl/v1/value/full-match';
2
- import { z } from 'zod';
2
+ import { string } from 'zod';
3
3
  const OPERATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
4
4
  const OPERATION_ID_MESSAGE = 'OperationId must be a canonical lowercase RFC 9562 UUIDv4.';
5
5
  /** Accept one canonical lowercase UUIDv4 without repair or case folding. */
@@ -10,6 +10,4 @@ export function acceptOperationId(input) {
10
10
  return input;
11
11
  }
12
12
  /** Internal schema shared by Kernel-owned callable contracts. */
13
- export const operationIdSchema = z
14
- .string()
15
- .check(fullMatch('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'));
13
+ export const operationIdSchema = string().check(fullMatch('[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}'));
@@ -1 +1 @@
1
- export type { InstallationIntrospection, InstallationSelection, Introspection } from './language.js';
1
+ export type { Introspection } from './language.js';
@@ -1,30 +1,14 @@
1
1
  import type { Key } from '@astrale-os/kernel-dsl/v1';
2
- type Fields = {
3
- readonly state?: true;
4
- readonly target?: true;
5
- readonly source?: true;
6
- readonly bundle?: true;
7
- readonly readiness?: true;
8
- readonly capabilities?: true;
9
- };
10
- type AtLeastOne<Value extends object> = {
11
- [Field in keyof Value]-?: Required<Pick<Value, Field>> & Partial<Omit<Value, Field>>;
12
- }[keyof Value];
13
- type BundleWithSource = (AtLeastOne<Omit<Fields, 'bundle'>> & {
14
- readonly bundle?: never;
15
- }) | (AtLeastOne<Fields> & {
16
- readonly bundle: true;
17
- readonly source: true;
18
- });
19
- /** Closed version-one field selection for one installed Domain origin. */
20
- export type InstallationSelection = BundleWithSource;
21
- export interface InstallationIntrospection<out Selection extends InstallationSelection = InstallationSelection> {
22
- readonly from: {
23
- readonly kind: 'installation';
24
- readonly origin: Key.Origin;
25
- };
26
- readonly select: Selection;
27
- }
28
2
  /** One admitted read-only Schema control-plane request. */
29
- export type Introspection<Selection extends InstallationSelection = InstallationSelection> = InstallationIntrospection<Selection>;
30
- export {};
3
+ export type Introspection = {
4
+ readonly kind: 'inspect';
5
+ readonly origin: Key.Origin;
6
+ } | {
7
+ readonly kind: 'bundle';
8
+ readonly origin: Key.Origin;
9
+ } | {
10
+ readonly kind: 'dependencies';
11
+ readonly origin: Key.Origin;
12
+ } | {
13
+ readonly kind: 'installed';
14
+ };
@@ -12,8 +12,7 @@ export function projectedCallables(domain) {
12
12
  if (!('methods' in definition) || definition.kind !== 'node')
13
13
  continue;
14
14
  for (const method of [...definition.methods, ...definition.static.methods]) {
15
- if (method.owner.ref.origin !== domain.origin ||
16
- method.definition.inheritance === 'abstract') {
15
+ if (method.owner.ref.origin !== domain.origin || !method.executable) {
17
16
  continue;
18
17
  }
19
18
  result.set(projectedMethodPath(domain, method), method.key);
@@ -29,5 +28,5 @@ export function projectedMethodPath(domain, method) {
29
28
  const owner = Path.project(method.owner.ref);
30
29
  return (method.definition.static
31
30
  ? Path.staticMethod(owner, method.name)
32
- : Path.instanceMethod(owner, method.name)).raw;
31
+ : Path.instanceMethod(owner, method.key)).raw;
33
32
  }
@@ -0,0 +1,7 @@
1
+ import type { SourceDomain, schema } from '@astrale-os/kernel-dsl/v1';
2
+ import { type Edge, type Part, type Payload } from './part.js';
3
+ /**
4
+ * Declare each authored Core Node, then each authored Core Edge, and return the locators that
5
+ * associate every Core Node with its Domain.
6
+ */
7
+ export declare function projectCore<Extra extends object>(domain: SourceDomain<schema.DomainSchema>, core: Part<Extra>, payload: Payload<Extra>): Edge<Extra>[];
@@ -0,0 +1,51 @@
1
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { Path } from '#graph/path';
3
+ import { K } from '../index.js';
4
+ import { projectedMethodPath } from './callables.js';
5
+ import { ProjectionError } from './diagnostics.js';
6
+ import { edge } from './part.js';
7
+ import { memberProperties } from './properties.js';
8
+ /**
9
+ * Declare each authored Core Node, then each authored Core Edge, and return the locators that
10
+ * associate every Core Node with its Domain.
11
+ */
12
+ export function projectCore(domain, core, payload) {
13
+ // The Domain Node is persisted before its Core part, so locators address it by its Path.
14
+ const domainEndpoint = Object.freeze({ path: Path.domain(domain.origin).raw });
15
+ const locators = [];
16
+ for (const [slug, declaration] of Object.entries(domain.source.core.nodes)) {
17
+ assertAuthenticationUnowned(domain, declaration.class, declaration.properties, slug);
18
+ const created = core.node(Path.project({ origin: domain.origin, kind: 'core', name: slug }).raw, ClassKey.of(declaration.class), payload(() => declaration.properties));
19
+ locators.push(edge(created, domainEndpoint, K.classes.of_domain.ref, payload(() => memberProperties(`core.${slug}`))));
20
+ }
21
+ // Resolved edges carry each endpoint's own identity; the source IR only names it.
22
+ for (const authored of domain.core.edges) {
23
+ core.edges.push(edge(endpoint(authored.source, domain, core, domainEndpoint), endpoint(authored.target, domain, core, domainEndpoint), authored.class.ref, payload(() => authored.properties)));
24
+ }
25
+ return locators;
26
+ }
27
+ /** Authentication of a Core Identity is established only by the credential-evidenced lifecycle. */
28
+ function assertAuthenticationUnowned(domain, classRef, properties, slug) {
29
+ const definition = domain.definition(classRef);
30
+ if (definition?.ref.kind !== 'class' ||
31
+ definition.kind !== 'node' ||
32
+ !definition.satisfies(K.classes.Identity)) {
33
+ return;
34
+ }
35
+ const hasIssuer = Object.hasOwn(properties, K.classes.Identity.properties.iss.key);
36
+ const hasSubject = Object.hasOwn(properties, K.classes.Identity.properties.sub.key);
37
+ if (hasIssuer || hasSubject) {
38
+ throw new ProjectionError('PROJECTION_INVALID', `Core Identity ${domain.origin}:core.${slug} cannot declare protected Authentication properties iss or sub.`);
39
+ }
40
+ }
41
+ /**
42
+ * A Core Node binds inside the Core part; every other local Definition is already projected as a
43
+ * managed declaration, so it is addressed by its canonical Path exactly like the owning Domain.
44
+ */
45
+ function endpoint(value, domain, core, domainEndpoint) {
46
+ if ('ref' in value)
47
+ return core.endpoint(Path.project(value.ref).raw);
48
+ if ('owner' in value)
49
+ return core.endpoint(projectedMethodPath(domain, value));
50
+ return domainEndpoint;
51
+ }
@@ -0,0 +1,13 @@
1
+ import type { SourceDomain, schema } from '@astrale-os/kernel-dsl/v1';
2
+ import type { ResolvedDefinition, ResolvedDefinitionOf } from '@astrale-os/kernel-dsl/v1/language';
3
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
4
+ import type { GraphSpecEndpoint } from '#graph/graph';
5
+ import { type Part, type Payload } from './part.js';
6
+ /** Declare the Domain Node, the target of every of_domain locator. */
7
+ export declare function projectDomain<Extra extends object>(domain: SourceDomain<schema.DomainSchema>, managed: Part<Extra>, payload: Payload<Extra>): GraphSpecEndpoint;
8
+ /** Declare each local Definition's Node and its of_domain locator. */
9
+ export declare function projectDefinitions<Extra extends object>(domain: SourceDomain<schema.DomainSchema>, managed: Part<Extra>, domainEndpoint: GraphSpecEndpoint, payload: Payload<Extra>): void;
10
+ /** Each local Definition projected as a managed declaration, with the Kernel Class it projects to. */
11
+ export declare function projectedDefinitions(domain: SourceDomain<schema.DomainSchema>): Generator<readonly [ResolvedDefinition, ClassKey]>;
12
+ /** Whether a resolved Definition is of the given kind. */
13
+ export declare function is<Kind extends ResolvedDefinition['ref']['kind']>(definition: ResolvedDefinition, kind: Kind): definition is ResolvedDefinitionOf<Kind>;
@@ -0,0 +1,71 @@
1
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { Path } from '#graph/path';
3
+ import { normalizeProperties } from '#graph/properties';
4
+ import { K } from '../index.js';
5
+ import { edge } from './part.js';
6
+ import { EMPTY_PROPERTIES, callableProperties, descriptionProperties, memberProperties, } from './properties.js';
7
+ /** Declare the Domain Node, the target of every of_domain locator. */
8
+ export function projectDomain(domain, managed, payload) {
9
+ return managed.node(Path.domain(domain.origin).raw, ClassKey.of(K.classes.Domain.ref), payload(() => domainProperties(domain)));
10
+ }
11
+ /** Declare each local Definition's Node and its of_domain locator. */
12
+ export function projectDefinitions(domain, managed, domainEndpoint, payload) {
13
+ for (const [definition, projectedClass] of projectedDefinitions(domain)) {
14
+ const definitionEndpoint = managed.node(Path.project(definition.ref).raw, projectedClass, payload(() => definitionProperties(definition)));
15
+ managed.edges.push(edge(definitionEndpoint, domainEndpoint, K.classes.of_domain.ref, payload(() => memberProperties(`${definition.ref.kind}.${definition.ref.name}`))));
16
+ }
17
+ }
18
+ /** Each local Definition projected as a managed declaration, with the Kernel Class it projects to. */
19
+ export function* projectedDefinitions(domain) {
20
+ for (const definition of domain.definitions()) {
21
+ if (definition.ref.origin !== domain.origin)
22
+ continue;
23
+ const projectedClass = classOf(definition);
24
+ if (projectedClass !== undefined)
25
+ yield [definition, projectedClass];
26
+ }
27
+ }
28
+ /** Whether a resolved Definition is of the given kind. */
29
+ export function is(definition, kind) {
30
+ return definition.ref.kind === kind;
31
+ }
32
+ function classOf(definition) {
33
+ switch (definition.ref.kind) {
34
+ case 'class':
35
+ return ClassKey.of(K.classes.Class.ref);
36
+ case 'function':
37
+ return ClassKey.of(K.classes.Function.ref);
38
+ case 'policy':
39
+ return ClassKey.of(K.classes.Policy.ref);
40
+ case 'view':
41
+ return ClassKey.of(K.classes.View.ref);
42
+ default:
43
+ return undefined;
44
+ }
45
+ }
46
+ /** Identity properties are supplied atomically by trusted lifecycle materialization. */
47
+ function domainProperties(domain) {
48
+ return normalizeProperties({
49
+ [K.classes.Domain.self.properties.origin.key]: domain.origin,
50
+ [K.classes.Domain.self.properties.name.key]: domain.source.name,
51
+ [K.classes.Domain.self.properties.schema.key]: domain.source,
52
+ [K.classes.Domain.self.properties.schemaRevision.key]: domain.revision,
53
+ });
54
+ }
55
+ function definitionProperties(definition) {
56
+ if (is(definition, 'function'))
57
+ return callableProperties(definition.definition);
58
+ if (is(definition, 'core'))
59
+ return EMPTY_PROPERTIES;
60
+ const metadata = descriptionProperties(definition.definition.description);
61
+ if (!is(definition, 'class'))
62
+ return normalizeProperties(metadata);
63
+ const declaration = definition.definition;
64
+ const icon = declaration.kind === 'node' ? declaration.icon : undefined;
65
+ return normalizeProperties({
66
+ ...metadata,
67
+ [K.classes.Class.self.properties.kind.key]: declaration.kind,
68
+ [K.classes.Class.self.properties.abstract.key]: declaration.abstract,
69
+ ...(icon !== undefined ? { [K.classes.Iconable.self.properties.icon.key]: icon } : {}),
70
+ });
71
+ }
@@ -1,6 +1,6 @@
1
- export { project } from './project.js';
1
+ export { project, projectTopology } from './project.js';
2
2
  export { compile } from './compile.js';
3
- export { projectedCallables } from './callables.js';
3
+ export { projectedCallables, projectedMethodPath } from './callables.js';
4
4
  export { ProjectionError } from './diagnostics.js';
5
5
  export type { ProjectionErrorCode } from './diagnostics.js';
6
- export type { CoreProjection, Projection, ProjectionPart } from './types.js';
6
+ export type { CoreProjection, CoreProjectionTopology, Projection, ProjectionPart, ProjectionTopology, ProjectionTopologyEdge, ProjectionTopologyNode, ProjectionTopologyPart, } from './types.js';
@@ -1,4 +1,4 @@
1
- export { project } from './project.js';
1
+ export { project, projectTopology } from './project.js';
2
2
  export { compile } from './compile.js';
3
- export { projectedCallables } from './callables.js';
3
+ export { projectedCallables, projectedMethodPath } from './callables.js';
4
4
  export { ProjectionError } from './diagnostics.js';
@@ -0,0 +1,5 @@
1
+ import type { SourceDomain, schema } from '@astrale-os/kernel-dsl/v1';
2
+ import type { GraphSpecEndpoint } from '#graph/graph';
3
+ import { type Part, type Payload } from './part.js';
4
+ /** Declare each executable local Method as a Function Node, with its method_of and of_domain Edges. */
5
+ export declare function projectMethods<Extra extends object>(domain: SourceDomain<schema.DomainSchema>, managed: Part<Extra>, domainEndpoint: GraphSpecEndpoint, payload: Payload<Extra>): void;
@@ -0,0 +1,41 @@
1
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { Path } from '#graph/path';
3
+ import { normalizeProperties } from '#graph/properties';
4
+ import { K } from '../index.js';
5
+ import { projectedMethodPath } from './callables.js';
6
+ import { ProjectionError } from './diagnostics.js';
7
+ import { edge } from './part.js';
8
+ import { callableProperties, memberProperties } from './properties.js';
9
+ /** Declare each executable local Method as a Function Node, with its method_of and of_domain Edges. */
10
+ export function projectMethods(domain, managed, domainEndpoint, payload) {
11
+ for (const method of executableMethods(domain)) {
12
+ const methodEndpoint = managed.node(projectedMethodPath(domain, method), ClassKey.of(K.classes.Function.ref), payload(() => callableProperties(method.definition)));
13
+ managed.edges.push(edge(methodEndpoint, managed.endpoint(Path.project(method.owner.ref).raw), K.classes.method_of.ref, payload(() => normalizeProperties({
14
+ [K.classes.method_of.self.properties.name.key]: method.name,
15
+ [K.classes.method_of.self.properties.static.key]: method.definition.static,
16
+ }))));
17
+ // This structural check must also execute when no Property payload is requested.
18
+ const member = memberOf(domain, method);
19
+ managed.edges.push(edge(methodEndpoint, domainEndpoint, K.classes.of_domain.ref, payload(() => memberProperties(member))));
20
+ }
21
+ }
22
+ /** Each local executable Method once, instance and static, across every Class of the Domain. */
23
+ function executableMethods(domain) {
24
+ const methods = new Map();
25
+ for (const definition of Object.values(domain.classes)) {
26
+ for (const method of [...definition.methods, ...definition.static.methods]) {
27
+ if (method.owner.ref.origin === domain.origin && method.executable) {
28
+ methods.set(method.key, method);
29
+ }
30
+ }
31
+ }
32
+ return methods.values();
33
+ }
34
+ /** The Method's member name within its Domain. */
35
+ function memberOf(domain, method) {
36
+ const prefix = `${domain.origin}:`;
37
+ if (!method.key.startsWith(prefix)) {
38
+ throw new ProjectionError('PROJECTION_INVALID', 'Method key belongs to another Domain.');
39
+ }
40
+ return method.key.slice(prefix.length);
41
+ }
@@ -0,0 +1,34 @@
1
+ import type { ClassRef } from '@astrale-os/kernel-dsl/v1';
2
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
3
+ import type { GraphSpecEndpoint } from '#graph/graph';
4
+ import type { NodePath } from '#graph/path';
5
+ import type { Properties } from '#graph/properties';
6
+ import { LocalAlias } from '#graph/graph';
7
+ import type { ProjectionTopologyEdge, ProjectionTopologyNode } from './types.js';
8
+ /**
9
+ * What each declaration carries besides its identity: full projection evaluates the Property
10
+ * factory, topology projection never does. Call it in argument position, before `node` or `edge`
11
+ * runs its own checks, so both projections throw the same error first.
12
+ */
13
+ export type Payload<Extra extends object> = (properties: () => Properties) => Extra;
14
+ export type Node<Extra extends object> = ProjectionTopologyNode & Extra;
15
+ export type Edge<Extra extends object> = ProjectionTopologyEdge & Extra;
16
+ /** One graph part under construction: its local bindings, its declared Nodes and its Edges. */
17
+ export declare class Part<Extra extends object> {
18
+ #private;
19
+ readonly edges: Edge<Extra>[];
20
+ /** Bind each Path, in the given order, to the next local binding `n0`, `n1`, ... */
21
+ constructor(paths: readonly NodePath[]);
22
+ /** A Path declared in this part is addressed by its binding, any other by the Path itself. */
23
+ endpoint(path: NodePath): GraphSpecEndpoint;
24
+ /** Declare the Node at a bound Path once; declaring it again returns the first binding. */
25
+ node(path: NodePath, classKey: ClassKey, payload: Extra): GraphSpecEndpoint;
26
+ /** The declared Nodes and Edges in declaration order, with each binding's Path. */
27
+ done(): Readonly<{
28
+ nodes: readonly Node<Extra>[];
29
+ edges: readonly Edge<Extra>[];
30
+ paths: Map<LocalAlias, import("../../../graph/path/language/model.js").NodePath>;
31
+ }>;
32
+ }
33
+ /** One projected Edge. */
34
+ export declare function edge<Extra extends object>(source: GraphSpecEndpoint, target: GraphSpecEndpoint, classRef: ClassRef, payload: Extra): Edge<Extra>;
@@ -0,0 +1,42 @@
1
+ import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
+ import { LocalAlias } from '#graph/graph';
3
+ import { ProjectionError } from './diagnostics.js';
4
+ /** One graph part under construction: its local bindings, its declared Nodes and its Edges. */
5
+ export class Part {
6
+ edges = [];
7
+ #bindings;
8
+ #nodes = new Map();
9
+ /** Bind each Path, in the given order, to the next local binding `n0`, `n1`, ... */
10
+ constructor(paths) {
11
+ this.#bindings = new Map(paths.map((path, index) => [path, LocalAlias(`n${index}`)]));
12
+ }
13
+ /** A Path declared in this part is addressed by its binding, any other by the Path itself. */
14
+ endpoint(path) {
15
+ const created = this.#bindings.get(path);
16
+ return created === undefined ? Object.freeze({ path }) : Object.freeze({ created });
17
+ }
18
+ /** Declare the Node at a bound Path once; declaring it again returns the first binding. */
19
+ node(path, classKey, payload) {
20
+ const existing = this.#nodes.get(path);
21
+ if (existing !== undefined)
22
+ return Object.freeze({ created: existing.as });
23
+ const as = this.#bindings.get(path);
24
+ if (as === undefined) {
25
+ throw new ProjectionError('PROJECTION_INVALID', `Projection has no binding for ${path}.`);
26
+ }
27
+ this.#nodes.set(path, Object.freeze({ as, class: classKey, ...payload }));
28
+ return Object.freeze({ created: as });
29
+ }
30
+ /** The declared Nodes and Edges in declaration order, with each binding's Path. */
31
+ done() {
32
+ return Object.freeze({
33
+ nodes: Object.freeze([...this.#nodes.values()]),
34
+ edges: Object.freeze(this.edges),
35
+ paths: new Map([...this.#bindings].map(([path, binding]) => [binding, path])),
36
+ });
37
+ }
38
+ }
39
+ /** One projected Edge. */
40
+ export function edge(source, target, classRef, payload) {
41
+ return Object.freeze({ source, target, class: ClassKey.of(classRef), ...payload });
42
+ }
@@ -0,0 +1,6 @@
1
+ import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
+ import type { NodePath } from '#graph/path';
3
+ /** Sorted Paths of the Domain Node, its local Definitions and their executable Methods. */
4
+ export declare function managedPaths(domain: Domain): readonly NodePath[];
5
+ /** Sorted Paths of the Domain's authored Core Nodes. */
6
+ export declare function corePaths(domain: Domain): readonly NodePath[];
@@ -1,34 +1,32 @@
1
1
  import { Path } from '#graph/path';
2
2
  import { projectedMethodPath } from './callables.js';
3
3
  const encoder = new TextEncoder();
4
- export function managedKeys(domain) {
5
- const keys = new Map();
6
- add(keys, Path.domain(domain.origin).raw);
4
+ /** Sorted Paths of the Domain Node, its local Definitions and their executable Methods. */
5
+ export function managedPaths(domain) {
6
+ const paths = new Set([Path.domain(domain.origin).raw]);
7
7
  for (const definition of domain.definitions()) {
8
8
  if (definition.ref.origin !== domain.origin || definition.ref.kind === 'core')
9
9
  continue;
10
- add(keys, Path.project(definition.ref).raw);
10
+ paths.add(Path.project(definition.ref).raw);
11
11
  if (!('methods' in definition) || definition.kind !== 'node')
12
12
  continue;
13
13
  for (const method of [...definition.methods, ...definition.static.methods]) {
14
- if (method.owner.ref.origin !== domain.origin ||
15
- method.definition.inheritance === 'abstract') {
14
+ if (method.owner.ref.origin !== domain.origin || !method.executable) {
16
15
  continue;
17
16
  }
18
- add(keys, projectedMethodPath(domain, method));
17
+ paths.add(projectedMethodPath(domain, method));
19
18
  }
20
19
  }
21
- return Object.freeze([...keys.values()].sort(compareNodePaths));
20
+ return Object.freeze([...paths].sort(compare));
22
21
  }
23
- export function coreKeys(domain) {
22
+ /** Sorted Paths of the Domain's authored Core Nodes. */
23
+ export function corePaths(domain) {
24
24
  return Object.freeze(Object.values(domain.core.nodes)
25
25
  .map((definition) => Path.project(definition.ref).raw)
26
- .sort(compareNodePaths));
26
+ .sort(compare));
27
27
  }
28
- function add(keys, key) {
29
- keys.set(key, key);
30
- }
31
- function compareNodePaths(left, right) {
28
+ /** Byte order of the UTF-8 encodings, independent of the host's string collation. */
29
+ function compare(left, right) {
32
30
  const a = encoder.encode(left);
33
31
  const b = encoder.encode(right);
34
32
  const length = Math.min(a.length, b.length);
@@ -1,4 +1,6 @@
1
- import { type SourceDomain, type schema } from '@astrale-os/kernel-dsl/v1';
2
- import type { Projection } from './types.js';
1
+ import type { SourceDomain, schema } from '@astrale-os/kernel-dsl/v1';
2
+ import type { Projection, ProjectionTopology } from './types.js';
3
3
  /** Project a Domain into an installation-independent symbolic graph. */
4
4
  export declare function project(domain: SourceDomain<schema.DomainSchema>): Projection;
5
+ /** Project only symbolic ownership, retaining every declaration and structural check. */
6
+ export declare function projectTopology(domain: SourceDomain<schema.DomainSchema>): ProjectionTopology;