@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
@@ -0,0 +1,166 @@
1
+ import { ownTerms, requiredInputs } from './terms.js';
2
+ /**
3
+ * The static atoms of the expressions, each once by structure, in depth-first order: the atoms
4
+ * `residualProgram` asks to decide. An `exists` that reads no input is one atom.
5
+ */
6
+ export function staticAtoms(expressions) {
7
+ const found = new Map();
8
+ const visit = (value) => {
9
+ switch (value.op) {
10
+ case 'true':
11
+ case 'false':
12
+ return;
13
+ case 'all':
14
+ case 'any':
15
+ value.predicates.forEach(visit);
16
+ return;
17
+ case 'not':
18
+ visit(value.predicate);
19
+ return;
20
+ case 'as':
21
+ visit(value.where);
22
+ return;
23
+ default: {
24
+ const subject = names(value);
25
+ const key = JSON.stringify(value);
26
+ if (subject !== undefined && !found.has(key))
27
+ found.set(key, { atom: value, subject });
28
+ }
29
+ }
30
+ };
31
+ expressions.forEach(visit);
32
+ return Object.freeze([...found.values()]);
33
+ }
34
+ /**
35
+ * The program specialized to one snapshot: each static atom replaced by the value `atom` gives it,
36
+ * and each expression those values decide folded into it, in Kleene's strong three-valued logic.
37
+ * `atom` receives the subject only for an atom that names it, and undefined leaves the atom in
38
+ * place. A binder whose composition decides it from its members' specialized leaves
39
+ * (`CompositionClosure.decide`) is folded too. Otherwise it keeps the leaf every member
40
+ * specializes to alike, or the leaf specialized without a subject. `closure` is the admitted
41
+ * composition of a binder root.
42
+ *
43
+ * Once the program is admitted in that snapshot (AUTH-FAILURE-ADMITTED-EAGERLY), the residual
44
+ * decides every input frame as the program does (`pe_sound` of `proofs/Authority.lean`). Each
45
+ * member keeps its ordinal, so the residual is not canonical, and an expression nothing decides
46
+ * stays the same object.
47
+ */
48
+ export function residualProgram(program, closure, atom) {
49
+ const subjects = new Map();
50
+ const binders = new Map();
51
+ const known = (value, subject) => {
52
+ let named = subjects.get(value);
53
+ if (named === undefined)
54
+ subjects.set(value, (named = names(value) ?? null));
55
+ if (named === null)
56
+ return undefined;
57
+ if (!named)
58
+ return atom(value, undefined);
59
+ return subject === undefined ? undefined : atom(value, subject);
60
+ };
61
+ const specialize = (value, subject) => {
62
+ switch (value.op) {
63
+ case 'true':
64
+ case 'false':
65
+ return value;
66
+ case 'all':
67
+ case 'any': {
68
+ // `all` is false once one member is, `any` true once one member is.
69
+ const absorbing = value.op === 'any';
70
+ const kept = [];
71
+ let changed = false;
72
+ for (const child of value.predicates) {
73
+ const residual = specialize(child, subject);
74
+ const decided = truth(residual);
75
+ if (decided === absorbing)
76
+ return constant(absorbing);
77
+ if (decided === undefined)
78
+ kept.push(residual);
79
+ if (residual !== child || decided !== undefined)
80
+ changed = true;
81
+ }
82
+ if (!changed)
83
+ return value;
84
+ if (kept.length === 0)
85
+ return constant(!absorbing);
86
+ return kept.length === 1 ? kept[0] : Object.freeze({ op: value.op, predicates: kept });
87
+ }
88
+ case 'not': {
89
+ const residual = specialize(value.predicate, subject);
90
+ const decided = truth(residual);
91
+ if (decided !== undefined)
92
+ return constant(!decided);
93
+ return residual === value.predicate
94
+ ? value
95
+ : Object.freeze({ op: 'not', predicate: residual });
96
+ }
97
+ case 'as': {
98
+ // A binder names its own subject: its residual is the same under every outer subject.
99
+ let residual = binders.get(value);
100
+ if (residual === undefined)
101
+ binders.set(value, (residual = binder(value)));
102
+ return residual;
103
+ }
104
+ default: {
105
+ const decided = known(value, subject);
106
+ return decided === undefined ? value : constant(decided);
107
+ }
108
+ }
109
+ };
110
+ const binder = (value) => {
111
+ const composed = closure(value.identity);
112
+ if (composed === undefined)
113
+ return value;
114
+ const leaves = new Map(composed.identities.map((member) => [member, specialize(value.where, member)]));
115
+ const decided = composed.decide((member) => truth(leaves.get(member)));
116
+ if (decided !== undefined)
117
+ return constant(decided);
118
+ const [first, ...others] = leaves.values();
119
+ // Each member's leaf decides as its own specialization: one shared by every member replaces
120
+ // the leaf; otherwise only what no subject decides is specialized.
121
+ const where = others.every((leaf) => same(leaf, first))
122
+ ? first
123
+ : specialize(value.where, undefined);
124
+ return where === value.where ? value : Object.freeze({ ...value, where });
125
+ };
126
+ const predicates = program.predicates.map((predicate) => specialize(predicate, undefined));
127
+ if (predicates.every((predicate, index) => predicate === program.predicates[index])) {
128
+ return program;
129
+ }
130
+ return Object.freeze({ ...program, predicates: Object.freeze(predicates) });
131
+ }
132
+ const TRUE = Object.freeze({ op: 'true' });
133
+ const FALSE = Object.freeze({ op: 'false' });
134
+ function constant(value) {
135
+ return value ? TRUE : FALSE;
136
+ }
137
+ function truth(value) {
138
+ return value.op === 'true' ? true : value.op === 'false' ? false : undefined;
139
+ }
140
+ function same(left, right) {
141
+ return left === right || JSON.stringify(left) === JSON.stringify(right);
142
+ }
143
+ /**
144
+ * Undefined when the atom reads a decision input (`requiredInputs`); otherwise whether it names the
145
+ * subject of its binder, outside the binders nested in it.
146
+ */
147
+ function names(atom) {
148
+ if (requiredInputs([atom]).size > 0)
149
+ return undefined;
150
+ const subject = (value) => {
151
+ switch (value.op) {
152
+ case 'all':
153
+ case 'any':
154
+ return value.predicates.some(subject);
155
+ case 'not':
156
+ return subject(value.predicate);
157
+ case 'as':
158
+ return false;
159
+ case 'exists':
160
+ return subject(value.where);
161
+ default:
162
+ return ownTerms(value).some((term) => term.kind === 'subject');
163
+ }
164
+ };
165
+ return subject(atom);
166
+ }
@@ -0,0 +1,40 @@
1
+ import type { NodeId } from '../../../graph/node/index.js';
2
+ import type { Path } from '../../../graph/path/index.js';
3
+ import type { ClassRef } from '../language/index.js';
4
+ /** One live Node as authority sees it: its exact concrete Class. */
5
+ export interface AuthorityNode {
6
+ readonly class: ClassRef;
7
+ }
8
+ /**
9
+ * One consistent graph state the interpreter reads. Every Node it exposes is live and has exactly
10
+ * one active concrete Class; every Edge connects two such Nodes.
11
+ */
12
+ export interface AuthoritySnapshot {
13
+ /** The live Node, or undefined when the id names none. */
14
+ node(id: NodeId): AuthorityNode | undefined;
15
+ /**
16
+ * Distinct Nodes one Edge of the exact Class away: `out` follows source to target, `in` target
17
+ * to source, `both` either orientation. The derived `instance_of` relation is never asked.
18
+ */
19
+ edges(from: NodeId, edge: ClassRef, direction: 'out' | 'in' | 'both'): readonly NodeId[];
20
+ /** Orientation the pinned Registry declares for one Edge Class. */
21
+ orientation(edge: ClassRef): 'directed' | 'undirected';
22
+ /** Every live Node the Path reaches; a fixed term requires exactly one. */
23
+ resolve(path: Path): readonly NodeId[];
24
+ /**
25
+ * Pinned Registry candidates for derived `instance_of`, admitted through `node` before use.
26
+ * An absent hook falls back to `resolve(Path.project(ref))`; an empty result never does.
27
+ * Fixed terms always use `resolve` independently of this projection.
28
+ */
29
+ classProjection?(ref: ClassRef): readonly NodeId[];
30
+ /** Every live Node, restricted to exact Classes when given. */
31
+ nodes(classes?: readonly ClassRef[]): readonly NodeId[];
32
+ }
33
+ /** The input frame of one decision; each bound Node must be live. */
34
+ export interface AuthorityInputs {
35
+ readonly object?: NodeId;
36
+ readonly source?: NodeId;
37
+ readonly target?: NodeId;
38
+ /** Exact Class of the bound Edge object, read only by `edge-class`. */
39
+ readonly edge?: ClassRef;
40
+ }
@@ -0,0 +1,22 @@
1
+ import type { AuthorityExpr, Term } from '../language/index.js';
2
+ import type { AuthorityInputs } from './snapshot.js';
3
+ import { Path } from '../../../graph/path/index.js';
4
+ /** A term that names one Node independently of any row, binder or local. */
5
+ export type FixedTerm = Extract<Term, {
6
+ readonly kind: 'node' | 'class' | 'domain' | 'core' | 'ref';
7
+ }>;
8
+ export declare function isFixedTerm(term: Term): term is FixedTerm;
9
+ /** The Path a fixed term denotes; the term holds when that Path reaches exactly one live Node. */
10
+ export declare function termPath(term: FixedTerm): Path;
11
+ /**
12
+ * Every fixed Path one expression depends on, sorted by raw text. `class-authority` depends on the
13
+ * projection of its Class and on the Domain of the Class origin.
14
+ */
15
+ export declare function fixedPaths(expressions: readonly AuthorityExpr[]): readonly Path[];
16
+ /**
17
+ * Every decision input the expressions read: each `input` term, and the bound Edge Class that
18
+ * `edge-class` reads. A decision whose frame leaves one of them unbound fails.
19
+ */
20
+ export declare function requiredInputs(expressions: readonly AuthorityExpr[]): ReadonlySet<keyof AuthorityInputs>;
21
+ /** The terms one expression reads itself, excluding those of its nested expressions. */
22
+ export declare function ownTerms(expression: AuthorityExpr): readonly Term[];
@@ -0,0 +1,96 @@
1
+ import { Path } from '../../../graph/path/index.js';
2
+ export function isFixedTerm(term) {
3
+ return term.kind !== 'input' && term.kind !== 'local' && term.kind !== 'subject';
4
+ }
5
+ /** The Path a fixed term denotes; the term holds when that Path reaches exactly one live Node. */
6
+ export function termPath(term) {
7
+ switch (term.kind) {
8
+ case 'node':
9
+ return Path.id(term.id);
10
+ case 'class':
11
+ return Path.project(term.ref);
12
+ case 'domain':
13
+ return Path.domain(term.origin);
14
+ case 'ref':
15
+ case 'core':
16
+ return Path.project(term.ref);
17
+ }
18
+ }
19
+ /**
20
+ * Every fixed Path one expression depends on, sorted by raw text. `class-authority` depends on the
21
+ * projection of its Class and on the Domain of the Class origin.
22
+ */
23
+ export function fixedPaths(expressions) {
24
+ const paths = new Map();
25
+ const add = (path) => {
26
+ paths.set(path.raw, path);
27
+ };
28
+ for (const expression of subexpressions(expressions)) {
29
+ for (const term of ownTerms(expression))
30
+ if (isFixedTerm(term))
31
+ add(termPath(term));
32
+ if (expression.op === 'class-authority') {
33
+ add(Path.project(expression.class));
34
+ add(Path.domain(expression.class.origin));
35
+ }
36
+ }
37
+ return Object.freeze([...paths.values()].sort((left, right) => compare(left.raw, right.raw)));
38
+ }
39
+ /**
40
+ * Every decision input the expressions read: each `input` term, and the bound Edge Class that
41
+ * `edge-class` reads. A decision whose frame leaves one of them unbound fails.
42
+ */
43
+ export function requiredInputs(expressions) {
44
+ const inputs = new Set();
45
+ for (const expression of subexpressions(expressions)) {
46
+ if (expression.op === 'edge-class')
47
+ inputs.add('edge');
48
+ for (const term of ownTerms(expression))
49
+ if (term.kind === 'input')
50
+ inputs.add(term.input);
51
+ }
52
+ return inputs;
53
+ }
54
+ /** Every expression and nested expression, depth first in syntax order. */
55
+ function* subexpressions(expressions) {
56
+ for (const expression of expressions) {
57
+ yield expression;
58
+ switch (expression.op) {
59
+ case 'all':
60
+ case 'any':
61
+ yield* subexpressions(expression.predicates);
62
+ break;
63
+ case 'not':
64
+ yield* subexpressions([expression.predicate]);
65
+ break;
66
+ case 'as':
67
+ case 'exists':
68
+ yield* subexpressions([expression.where]);
69
+ }
70
+ }
71
+ }
72
+ /** The terms one expression reads itself, excluding those of its nested expressions. */
73
+ export function ownTerms(expression) {
74
+ switch (expression.op) {
75
+ case 'same-node':
76
+ return [expression.left, expression.right];
77
+ case 'related':
78
+ return [expression.source, expression.target];
79
+ case 'instance-of':
80
+ return [expression.node];
81
+ case 'class-authority':
82
+ return [expression.identity];
83
+ case 'true':
84
+ case 'false':
85
+ case 'edge-class':
86
+ case 'all':
87
+ case 'any':
88
+ case 'not':
89
+ case 'as':
90
+ case 'exists':
91
+ return [];
92
+ }
93
+ }
94
+ function compare(left, right) {
95
+ return left < right ? -1 : left > right ? 1 : 0;
96
+ }
@@ -0,0 +1,19 @@
1
+ import type { ClassRef, Operation } from '../language/index.js';
2
+ /**
3
+ * The Kernel Classes that give authority its meaning. Core Schema publishes the Kernel instance;
4
+ * the interpreter and every lowering take it as a parameter instead of discovering it.
5
+ */
6
+ export interface AuthorityVocabulary {
7
+ /** Node Class whose concrete descendants an Identity binder may reach. */
8
+ readonly identity: ClassRef;
9
+ /** Outgoing composition Edges of one Identity. */
10
+ readonly composition: {
11
+ readonly extension: ClassRef;
12
+ readonly constraint: ClassRef;
13
+ readonly exclusion: ClassRef;
14
+ };
15
+ /** Edge from an Identity to a Class projection that delegates one Class operation. */
16
+ readonly capabilities: Readonly<Record<Operation, ClassRef>>;
17
+ /** The derived relation from a Node to the projection of its exact Class. */
18
+ readonly instanceOf: ClassRef;
19
+ }
@@ -2,7 +2,6 @@ import type { Attestation } from '../attestation/index.js';
2
2
  import type { CredentialInput } from '../credential/input/index.js';
3
3
  import type { VerifiedCredential } from '../credential/verified/index.js';
4
4
  import type { Delegation } from '../delegation/index.js';
5
- import type { Grant } from '../grant/index.js';
6
5
  import type { IdentityId } from '../identity/index.js';
7
6
  /** The original credential together with the claims established by verification. */
8
7
  export interface CredentialContext {
@@ -12,15 +11,17 @@ export interface CredentialContext {
12
11
  /** Verified credential result before every runtime authority value is necessarily resolved. */
13
12
  export interface Authenticated {
14
13
  readonly credential: CredentialContext;
15
- readonly grant?: Grant;
14
+ readonly caller?: IdentityId;
16
15
  readonly attestation?: Attestation;
17
16
  readonly delegation?: Delegation;
18
17
  }
19
18
  /** Complete authenticated kernel context. */
20
19
  export interface AuthContext {
21
20
  readonly credential: CredentialContext;
21
+ /** Authenticated executor: ceiling, installed ownership, Root bypass, and audit. */
22
22
  readonly principal: IdentityId;
23
- readonly grant: Grant;
23
+ /** The one Identity whose authority the call exercises; equals principal for direct calls. */
24
+ readonly caller: IdentityId;
24
25
  /** Earliest expiry of all credential proofs from which this authority was derived. */
25
26
  readonly validUntil?: number;
26
27
  readonly attestation?: Attestation;
@@ -6,11 +6,8 @@ export type BuiltExpr = IdentityExpr | UnresolvedIdentityExpr;
6
6
  export interface ExprBuilder<E extends BuiltExpr = IdentityExpr> {
7
7
  build(): E;
8
8
  }
9
- /** Immutable fluent expression handle. */
9
+ /** Immutable handle for one Identity leaf; there is no Identity set algebra. */
10
10
  export interface Expr<E extends BuiltExpr = IdentityExpr> extends ExprBuilder<E> {
11
- union(other: Expr<E>): Expr<E>;
12
- intersect(other: Expr<E>): Expr<E>;
13
- exclude(other: Expr<E>): Expr<E>;
14
11
  }
15
12
  export declare function isExprBuilder(input: unknown): input is ExprBuilder<IdentityExpr> | ExprBuilder<UnresolvedIdentityExpr>;
16
13
  /** Build one resolved Identity leaf. */
@@ -19,11 +16,5 @@ export declare function identity(id: IdentityId): Expr<IdentityExpr>;
19
16
  export declare function self(): Expr<UnresolvedIdentityExpr>;
20
17
  /** Build one unresolved nested-credential leaf. */
21
18
  export declare function cred(credential: CredentialInput): Expr<UnresolvedIdentityExpr>;
22
- /** Re-enter the fluent algebra from an already trusted or separately admitted expression. */
19
+ /** Re-enter from an already trusted or separately admitted Identity leaf. */
23
20
  export declare function raw<E extends BuiltExpr>(expr: E): Expr<E>;
24
- /** Compose at least two expressions of the same resolved or unresolved phase. */
25
- export declare function union<E extends BuiltExpr>(first: Expr<E>, second: Expr<NoInfer<E>>, ...rest: Expr<NoInfer<E>>[]): Expr<E>;
26
- /** Intersect at least two expressions of the same resolved or unresolved phase. */
27
- export declare function intersect<E extends BuiltExpr>(first: Expr<E>, second: Expr<NoInfer<E>>, ...rest: Expr<NoInfer<E>>[]): Expr<E>;
28
- /** Exclude one expression from another expression of the same phase. */
29
- export declare function exclude<E extends BuiltExpr>(base: Expr<E>, excluded: Expr<NoInfer<E>>): Expr<E>;
@@ -13,27 +13,6 @@ class Expression {
13
13
  build() {
14
14
  return this.value;
15
15
  }
16
- union(other) {
17
- return compose('union', this, other);
18
- }
19
- intersect(other) {
20
- return compose('intersect', this, other);
21
- }
22
- exclude(other) {
23
- const current = this.value;
24
- if (current.kind === 'exclude') {
25
- return expression({
26
- kind: 'exclude',
27
- base: current.base,
28
- excluded: [...current.excluded, other.build()],
29
- });
30
- }
31
- return expression({
32
- kind: 'exclude',
33
- base: current,
34
- excluded: [other.build()],
35
- });
36
- }
37
16
  }
38
17
  /** Build one resolved Identity leaf. */
39
18
  export function identity(id) {
@@ -55,33 +34,10 @@ export function cred(credential) {
55
34
  }
56
35
  return expression(Object.freeze({ kind: 'identity', credential: credential.slice() }));
57
36
  }
58
- /** Re-enter the fluent algebra from an already trusted or separately admitted expression. */
37
+ /** Re-enter from an already trusted or separately admitted Identity leaf. */
59
38
  export function raw(expr) {
60
39
  return expression(expr);
61
40
  }
62
- /** Compose at least two expressions of the same resolved or unresolved phase. */
63
- export function union(first, second, ...rest) {
64
- return compose('union', first, second, ...rest);
65
- }
66
- /** Intersect at least two expressions of the same resolved or unresolved phase. */
67
- export function intersect(first, second, ...rest) {
68
- return compose('intersect', first, second, ...rest);
69
- }
70
- /** Exclude one expression from another expression of the same phase. */
71
- export function exclude(base, excluded) {
72
- return base.exclude(excluded);
73
- }
74
- function compose(kind, first, second, ...rest) {
75
- const operands = [];
76
- for (const builder of [first, second, ...rest]) {
77
- const value = builder.build();
78
- if (value.kind === kind)
79
- operands.push(...value.operands);
80
- else
81
- operands.push(value);
82
- }
83
- return expression({ kind, operands });
84
- }
85
41
  function expression(value) {
86
42
  return Object.freeze(new Expression(value));
87
43
  }
@@ -1,2 +1,2 @@
1
1
  export type { BuiltExpr, Expr, ExprBuilder } from './builder.js';
2
- export { cred, exclude, identity, intersect, isExprBuilder, raw, self, union } from './builder.js';
2
+ export { cred, identity, isExprBuilder, raw, self } from './builder.js';
@@ -1 +1 @@
1
- export { cred, exclude, identity, intersect, isExprBuilder, raw, self, union } from './builder.js';
1
+ export { cred, identity, isExprBuilder, raw, self } from './builder.js';
@@ -1,4 +1,3 @@
1
1
  export type { BuiltExpr, Expr, ExprBuilder } from './authoring/index.js';
2
- export { cred, exclude, identity, intersect, isExprBuilder, raw, self, union, } from './authoring/index.js';
2
+ export { cred, identity, isExprBuilder, raw, self } from './authoring/index.js';
3
3
  export type { IdentityExpr, SelfIdentityExpr, UnresolvedIdentityExpr } from './language/index.js';
4
- export { canonicalize, raiseDenials } from './normalization/index.js';
@@ -1,2 +1 @@
1
- export { cred, exclude, identity, intersect, isExprBuilder, raw, self, union, } from './authoring/index.js';
2
- export { canonicalize, raiseDenials } from './normalization/index.js';
1
+ export { cred, identity, isExprBuilder, raw, self } from './authoring/index.js';
@@ -5,33 +5,13 @@ export type SelfIdentityExpr = {
5
5
  readonly kind: 'identity';
6
6
  readonly self: true;
7
7
  };
8
- /** Resolved Identity set algebra. Every leaf is one stable IdentityId. */
8
+ /** The one resolved Identity leaf carried by Kernel bearer and delegation proof claims. */
9
9
  export type IdentityExpr = {
10
10
  readonly kind: 'identity';
11
11
  readonly id: IdentityId;
12
- } | {
13
- readonly kind: 'union';
14
- readonly operands: readonly IdentityExpr[];
15
- } | {
16
- readonly kind: 'intersect';
17
- readonly operands: readonly IdentityExpr[];
18
- } | {
19
- readonly kind: 'exclude';
20
- readonly base: IdentityExpr;
21
- readonly excluded: readonly IdentityExpr[];
22
12
  };
23
- /** Caller-authored expression accepted only inside a versioned credential claim. */
13
+ /** Caller-authored single leaf accepted only inside a versioned credential claim. */
24
14
  export type UnresolvedIdentityExpr = SelfIdentityExpr | {
25
15
  readonly kind: 'identity';
26
16
  readonly credential: CredentialInput;
27
- } | {
28
- readonly kind: 'union';
29
- readonly operands: readonly UnresolvedIdentityExpr[];
30
- } | {
31
- readonly kind: 'intersect';
32
- readonly operands: readonly UnresolvedIdentityExpr[];
33
- } | {
34
- readonly kind: 'exclude';
35
- readonly base: UnresolvedIdentityExpr;
36
- readonly excluded: readonly UnresolvedIdentityExpr[];
37
17
  };
@@ -1,4 +1,4 @@
1
- export { accept, canonicalize, self } from './resolved/index.js';
1
+ export { accept, self } from './resolved/index.js';
2
2
  export type { Grant } from './resolved/index.js';
3
3
  export { acceptUnresolved, limits } from './unresolved/index.js';
4
4
  export type { UnresolvedGrant } from './unresolved/index.js';
@@ -1,2 +1,2 @@
1
- export { accept, canonicalize, self } from './resolved/index.js';
1
+ export { accept, self } from './resolved/index.js';
2
2
  export { acceptUnresolved, limits } from './unresolved/index.js';
@@ -1,5 +1,6 @@
1
1
  import type { Grant } from './grant.js';
2
- /** Admit one exact resolved Grant. */
2
+ /**
3
+ * Admit one exact resolved claim value `{ expr: { kind: 'identity', id } }`. Compound structure
4
+ * keeps the unresolved claim's stable code, AUTH_GRANT_COMPOUND.
5
+ */
3
6
  export declare function accept(input: unknown): Grant;
4
- /** Re-canonicalize a trusted Grant value. */
5
- export declare function canonicalize(input: Grant): Grant;
@@ -1,30 +1,40 @@
1
1
  import * as portable from '@astrale-os/kernel-dsl/value';
2
+ import { isNodeId, NodeId } from '../../../graph/node/index.js';
2
3
  import { AuthValueError } from '../../error.js';
3
- import { admitResolvedExpression, canonicalize as canonicalizeExpression, } from '../../expression/normalization/index.js';
4
- /** Admit one exact resolved Grant. */
4
+ const COMPOUND = new Set(['union', 'intersect', 'exclude']);
5
+ /**
6
+ * Admit one exact resolved claim value `{ expr: { kind: 'identity', id } }`. Compound structure
7
+ * keeps the unresolved claim's stable code, AUTH_GRANT_COMPOUND.
8
+ */
5
9
  export function accept(input) {
6
10
  try {
7
11
  const value = portable.accept(input);
8
- if (value === null || Array.isArray(value) || typeof value !== 'object') {
9
- invalid('', 'Expected a Grant object');
10
- }
11
- const grant = value;
12
+ const grant = record(value, '', 'Expected a Grant object');
12
13
  exact(grant, ['expr'], '');
13
- if (grant.expr === undefined)
14
- invalid('/expr', 'Expected a resolved Identity expression');
15
- return Object.freeze({ expr: admitResolvedExpression(grant.expr, '/expr', 0) });
14
+ const expr = record(grant.expr, '/expr', 'Expected one resolved Identity leaf');
15
+ if (typeof expr.kind === 'string' && COMPOUND.has(expr.kind)) {
16
+ throw new AuthValueError('AUTH_GRANT_COMPOUND', 'Resolved Grant must name exactly one Identity', '/expr');
17
+ }
18
+ exact(expr, ['id', 'kind'], '/expr');
19
+ if (expr.kind !== 'identity')
20
+ invalid('/expr/kind', 'Expected one resolved Identity leaf');
21
+ if (typeof expr.id !== 'string' || !isNodeId(expr.id)) {
22
+ invalid('/expr/id', 'Expected one canonical IdentityId');
23
+ }
24
+ return Object.freeze({ expr: Object.freeze({ kind: 'identity', id: NodeId(expr.id) }) });
16
25
  }
17
26
  catch (cause) {
18
27
  if (cause instanceof AuthValueError)
19
28
  throw cause;
20
- throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected a canonical resolved Grant', '', {
29
+ throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected a resolved single-Identity Grant', '', {
21
30
  cause,
22
31
  });
23
32
  }
24
33
  }
25
- /** Re-canonicalize a trusted Grant value. */
26
- export function canonicalize(input) {
27
- return Object.freeze({ expr: canonicalizeExpression(input.expr) });
34
+ function record(value, path, message) {
35
+ if (value === null || Array.isArray(value) || typeof value !== 'object')
36
+ invalid(path, message);
37
+ return value;
28
38
  }
29
39
  function exact(value, expected, path) {
30
40
  const actual = Object.keys(value).sort(compare);
@@ -1,5 +1,5 @@
1
1
  import type { IdentityExpr } from '../../expression/language/index.js';
2
- /** One resolved, canonical authority expression. */
2
+ /** The resolved single-identity claim value carried by Kernel bearers and delegation proofs. */
3
3
  export interface Grant {
4
4
  readonly expr: IdentityExpr;
5
5
  }
@@ -1,3 +1,3 @@
1
- export { accept, canonicalize } from './admission.js';
1
+ export { accept } from './admission.js';
2
2
  export { self } from './self.js';
3
3
  export type { Grant } from './grant.js';
@@ -1,2 +1,2 @@
1
- export { accept, canonicalize } from './admission.js';
1
+ export { accept } from './admission.js';
2
2
  export { self } from './self.js';
@@ -1,3 +1,6 @@
1
1
  import type { UnresolvedGrant } from './grant.js';
2
- /** Admit the exact bounded unresolved Grant wire language. */
2
+ /**
3
+ * Admit the exact version-1 unresolved Grant claim: exactly one `self` or one credential leaf.
4
+ * Compound structure is refused before any nested credential could be verified.
5
+ */
3
6
  export declare function acceptUnresolved(input: unknown): UnresolvedGrant;