@astrale-os/kernel-core 0.9.0-beta.9 → 1.0.0-beta.2
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.
- package/dist/auth/authority/accept.js +4 -0
- package/dist/auth/authority/admission/admission.d.ts +4 -1
- package/dist/auth/authority/admission/admission.js +46 -147
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/auth/authority/canonical.d.ts +2 -0
- package/dist/auth/authority/canonical.js +15 -0
- package/dist/auth/authority/index.d.ts +9 -2
- package/dist/auth/authority/index.js +6 -1
- package/dist/auth/authority/language/index.d.ts +3 -1
- package/dist/auth/authority/language/index.js +1 -0
- package/dist/auth/authority/language/predicate.d.ts +31 -16
- package/dist/auth/authority/language/predicate.js +1 -1
- package/dist/auth/authority/language/program.d.ts +21 -0
- package/dist/auth/authority/language/program.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +38 -16
- package/dist/auth/authority/ownership.optimization.d.ts +8 -0
- package/dist/auth/authority/ownership.optimization.js +83 -0
- package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
- package/dist/auth/authority/prepare-binder-body.js +31 -0
- package/dist/auth/authority/program.d.ts +28 -0
- package/dist/auth/authority/program.js +191 -0
- package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
- package/dist/auth/authority/semantics/class-authority.js +26 -0
- package/dist/auth/authority/semantics/composition.d.ts +39 -0
- package/dist/auth/authority/semantics/composition.js +112 -0
- package/dist/auth/authority/semantics/failure.d.ts +21 -0
- package/dist/auth/authority/semantics/failure.js +10 -0
- package/dist/auth/authority/semantics/index.d.ts +11 -0
- package/dist/auth/authority/semantics/index.js +5 -0
- package/dist/auth/authority/semantics/interpret.d.ts +41 -0
- package/dist/auth/authority/semantics/interpret.js +388 -0
- package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
- package/dist/auth/authority/semantics/terms.d.ts +20 -0
- package/dist/auth/authority/semantics/terms.js +96 -0
- package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
- package/dist/auth/context/context.d.ts +4 -3
- package/dist/auth/expression/authoring/builder.d.ts +2 -11
- package/dist/auth/expression/authoring/builder.js +1 -45
- package/dist/auth/expression/authoring/index.d.ts +1 -1
- package/dist/auth/expression/authoring/index.js +1 -1
- package/dist/auth/expression/index.d.ts +1 -2
- package/dist/auth/expression/index.js +1 -2
- package/dist/auth/expression/language/identity-expression.d.ts +2 -22
- package/dist/auth/grant/index.d.ts +1 -1
- package/dist/auth/grant/index.js +1 -1
- package/dist/auth/grant/resolved/admission.d.ts +4 -3
- package/dist/auth/grant/resolved/admission.js +23 -13
- package/dist/auth/grant/resolved/grant.d.ts +1 -1
- package/dist/auth/grant/resolved/index.d.ts +1 -1
- package/dist/auth/grant/resolved/index.js +1 -1
- package/dist/auth/grant/unresolved/admission.d.ts +4 -1
- package/dist/auth/grant/unresolved/admission.js +27 -67
- package/dist/auth/grant/unresolved/limits.d.ts +2 -4
- package/dist/auth/grant/unresolved/limits.js +1 -5
- package/dist/auth/identity/admission.js +11 -3
- package/dist/auth/identity/identity.d.ts +15 -3
- package/dist/auth/identity/index.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +1 -1
- package/dist/auth/jwk/index.d.ts +1 -1
- package/dist/auth/jwk/index.js +1 -1
- package/dist/auth/jwk/thumbprint.d.ts +2 -0
- package/dist/auth/jwk/thumbprint.js +12 -6
- package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
- package/dist/auth/register/fingerprint/fingerprint.js +31 -0
- package/dist/auth/register/fingerprint/index.d.ts +2 -0
- package/dist/auth/register/index.d.ts +5 -0
- package/dist/auth/register/request/admission.d.ts +3 -0
- package/dist/auth/register/request/admission.js +103 -0
- package/dist/auth/register/request/index.d.ts +3 -0
- package/dist/auth/register/request/limits.d.ts +6 -0
- package/dist/auth/register/request/limits.js +6 -0
- package/dist/auth/register/request/request.d.ts +19 -0
- package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
- package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
- package/dist/auth/register/result/index.d.ts +1 -0
- package/dist/auth/register/result/result.d.ts +10 -0
- package/dist/auth/register/result/result.js +1 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +18 -2
- package/dist/callable/index.d.ts +3 -2
- package/dist/callable/index.js +2 -1
- package/dist/callable/invocation/call.d.ts +16 -2
- package/dist/callable/invocation/call.js +41 -1
- package/dist/callable/invocation/index.d.ts +1 -1
- package/dist/callable/invocation/index.js +1 -1
- package/dist/callable/invocation/result.d.ts +2 -2
- package/dist/dns-label.d.ts +1 -2
- package/dist/dns-label.js +2 -3
- package/dist/graph/graph/graph.d.ts +1 -5
- package/dist/graph/graph/graph.js +3 -27
- package/dist/graph/graph/index.d.ts +2 -4
- package/dist/graph/graph/index.js +2 -3
- package/dist/graph/graph/model/codec.js +4 -4
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +58 -78
- package/dist/graph/graph/model/wire.js +18 -19
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/authoring/create.js +13 -5
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/language/wire.d.ts +226 -215
- package/dist/graph/mutate/language/wire.js +42 -47
- package/dist/graph/mutate/result/index.d.ts +4 -3
- package/dist/graph/mutate/result/index.js +8 -6
- package/dist/graph/mutate/result/wire.d.ts +4 -4
- package/dist/graph/mutate/result/wire.js +7 -4
- package/dist/graph/node/identity/id.d.ts +0 -4
- package/dist/graph/node/identity/id.js +0 -5
- package/dist/graph/node/identity/order.js +20 -0
- package/dist/graph/path/authoring/path.d.ts +8 -5
- package/dist/graph/path/authoring/path.js +21 -3
- package/dist/graph/path/language/model.d.ts +8 -3
- package/dist/graph/path/language/syntax.js +23 -8
- package/dist/graph/query/authoring/builder.js +37 -5
- package/dist/graph/query/authoring/model.d.ts +20 -1
- package/dist/graph/query/index.d.ts +4 -2
- package/dist/graph/query/index.js +1 -0
- package/dist/graph/query/language/codec.js +18 -3
- package/dist/graph/query/language/fingerprint.js +8 -0
- package/dist/graph/query/language/model.d.ts +22 -4
- package/dist/graph/query/language/wire.d.ts +124 -114
- package/dist/graph/query/language/wire.js +54 -47
- package/dist/graph/query/order/index.d.ts +53 -0
- package/dist/graph/query/order/index.js +79 -0
- package/dist/graph/query/reference/evaluate.d.ts +1 -0
- package/dist/graph/query/reference/evaluate.js +39 -52
- package/dist/graph/query/result/index.js +1 -1
- package/dist/graph/query/result/wire.d.ts +93 -94
- package/dist/graph/query/result/wire.js +20 -20
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
- package/dist/graph/reconcile/planning/canonical.js +28 -0
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +8 -4
- package/dist/graph/reconcile/planning/plan.js +2 -1
- package/dist/schema/authority/authority-relation.js +3 -0
- package/dist/schema/authority/claims.d.ts +24 -25
- package/dist/schema/authority/claims.js +8 -8
- package/dist/schema/authority/governed-by.d.ts +16 -91
- package/dist/schema/authority/governed-by.js +1 -1
- package/dist/schema/authority/operation-node.d.ts +27 -13
- package/dist/schema/authority/operations.d.ts +8 -168
- package/dist/schema/authority/policy.d.ts +27 -15
- package/dist/schema/authority/vocabulary.d.ts +3 -0
- package/dist/schema/authority/vocabulary.js +25 -0
- package/dist/schema/callables/entrypoint.d.ts +32 -0
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/execution.d.ts +269 -0
- package/dist/schema/callables/execution.js +32 -0
- package/dist/schema/callables/function.d.ts +3400 -55
- package/dist/schema/callables/function.js +4 -3
- package/dist/schema/callables/index.d.ts +2 -1
- package/dist/schema/callables/index.js +2 -1
- package/dist/schema/callables/method-of.d.ts +18 -143
- package/dist/schema/callables/method-of.js +2 -2
- package/dist/schema/callables/view.d.ts +83 -51
- package/dist/schema/definitions/class.d.ts +45 -33
- package/dist/schema/definitions/extends.d.ts +16 -110
- package/dist/schema/definitions/instance-of.d.ts +17 -69
- package/dist/schema/domain/domain.d.ts +3343 -148
- package/dist/schema/domain/domain.js +6 -3
- package/dist/schema/domain/of-domain.d.ts +18 -192
- package/dist/schema/domain/of-domain.js +1 -1
- package/dist/schema/identity/composition.d.ts +5 -0
- package/dist/schema/identity/composition.js +5 -0
- package/dist/schema/identity/identity.d.ts +225 -122
- package/dist/schema/identity/identity.js +3 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/installation/operation-id.d.ts +1 -2
- package/dist/schema/installation/operation-id.js +2 -4
- package/dist/schema/introspection/index.d.ts +1 -1
- package/dist/schema/introspection/language.d.ts +12 -28
- package/dist/schema/kernel/projection/callables.js +2 -3
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/index.d.ts +3 -3
- package/dist/schema/kernel/projection/index.js +2 -2
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
- package/dist/schema/kernel/projection/project.d.ts +4 -2
- package/dist/schema/kernel/projection/project.js +33 -258
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +61 -0
- package/dist/schema/kernel/projection/types.d.ts +28 -2
- package/dist/schema/kernel/schema.d.ts +8737 -5086
- package/dist/schema/kernel/schema.js +12 -8
- package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
- package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
- package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/execution.d.ts +60 -0
- package/dist/schema/kernel/syscalls/contracts/execution.js +46 -0
- package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
- package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
- package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
- package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
- package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
- package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
- package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +149 -217
- package/dist/schema/kernel/syscalls/contracts/install.js +22 -26
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +65 -351
- package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
- package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
- package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
- package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
- package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
- package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
- package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +232 -222
- package/dist/schema/kernel/syscalls/contracts/query.js +10 -15
- package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
- package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +54 -148
- package/dist/schema/kernel/syscalls/contracts/uninstall.js +6 -5
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
- package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
- package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
- package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
- package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
- package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
- package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/execution.d.ts +105 -0
- package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +870 -1323
- package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +29 -172
- package/dist/schema/kernel/syscalls/declarations/install.js +7 -5
- package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
- package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
- package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
- package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
- package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
- package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +235 -260
- package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +49 -153
- package/dist/schema/kernel/syscalls/declarations/uninstall.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
- package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
- package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
- package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
- package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
- package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +153 -0
- package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
- package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
- package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
- package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
- package/dist/schema/kernel/syscalls/index.d.ts +2 -2
- package/dist/schema/kernel/syscalls/index.js +2 -2
- package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
- package/dist/schema/kernel/syscalls/references/execution.js +13 -0
- package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
- package/dist/schema/kernel/syscalls/references/functions.js +3 -1
- package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
- package/dist/schema/kernel/syscalls/references/identity.js +1 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/references/index.js +2 -1
- package/dist/schema/meta/created-by.d.ts +32 -0
- package/dist/schema/meta/created-by.js +17 -0
- package/dist/schema/meta/descriptable.d.ts +13 -11
- package/dist/schema/meta/edge.d.ts +5 -9
- package/dist/schema/meta/iconable.d.ts +13 -11
- package/dist/schema/meta/index.d.ts +1 -0
- package/dist/schema/meta/index.js +1 -0
- package/dist/schema/meta/named.d.ts +13 -9
- package/dist/schema/meta/node.d.ts +9 -1
- package/dist/schema/meta/remotable.d.ts +15 -22
- package/dist/schema/meta/statused.d.ts +13 -7
- package/dist/schema/meta/timestamped.d.ts +14 -12
- package/package.json +9 -7
- package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
- package/dist/auth/expression/normalization/canonicalize.js +0 -102
- package/dist/auth/expression/normalization/index.d.ts +0 -2
- package/dist/auth/expression/normalization/index.js +0 -2
- package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
- package/dist/auth/expression/normalization/raise-denials.js +0 -59
- package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
- package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
- package/dist/auth/provision/fingerprint/index.d.ts +0 -2
- package/dist/auth/provision/index.d.ts +0 -5
- package/dist/auth/provision/request/admission.d.ts +0 -3
- package/dist/auth/provision/request/admission.js +0 -125
- package/dist/auth/provision/request/index.d.ts +0 -3
- package/dist/auth/provision/request/request.d.ts +0 -29
- package/dist/auth/provision/result/index.d.ts +0 -1
- package/dist/auth/provision/result/result.d.ts +0 -12
- package/dist/graph/graph/navigation/error.d.ts +0 -12
- package/dist/graph/graph/navigation/error.js +0 -20
- package/dist/graph/graph/navigation/index.d.ts +0 -2
- package/dist/graph/graph/navigation/index.js +0 -1
- package/dist/graph/graph/navigation/model.d.ts +0 -15
- package/dist/schema/callables/view-for.d.ts +0 -296
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/projection/path.d.ts +0 -2
- package/dist/schema/kernel/projection/path.js +0 -140
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
- package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
- package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
- package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
- package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
- package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
- /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
- /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
- /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
- /package/dist/auth/{provision → register}/index.js +0 -0
- /package/dist/auth/{provision → register}/request/index.js +0 -0
- /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
- /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
|
@@ -3,8 +3,12 @@ import { AuthValueError } from '../error.js';
|
|
|
3
3
|
import { admitAuthorityExpr } from './admission/index.js';
|
|
4
4
|
import { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
5
5
|
import { canonicalizeAdmitted } from './normalization/index.js';
|
|
6
|
+
import { ownsCanonical } from './ownership.optimization.js';
|
|
6
7
|
/** Re-admit one persisted or crossing canonical authority predicate. */
|
|
7
8
|
export function accept(input) {
|
|
9
|
+
// The owner retains only deeply immutable, detached canonical predicates.
|
|
10
|
+
if (ownsCanonical(input))
|
|
11
|
+
return input;
|
|
8
12
|
try {
|
|
9
13
|
const admitted = portable.accept(input);
|
|
10
14
|
if (admitted === null || Array.isArray(admitted) || typeof admitted !== 'object') {
|
|
@@ -4,7 +4,10 @@ export declare const limits: {
|
|
|
4
4
|
readonly expressionDepth: 64;
|
|
5
5
|
readonly operandsPerExpression: 512;
|
|
6
6
|
readonly localsPerExpression: 64;
|
|
7
|
+
readonly classesPerLocal: 1024;
|
|
8
|
+
readonly classesPerRelation: 1024;
|
|
7
9
|
readonly repeatMaximum: 16;
|
|
8
10
|
};
|
|
9
|
-
export declare const MAX_BOOLEAN_OPERANDS: 512;
|
|
10
11
|
export declare function admitAuthorityExpr(input: portable.Value): AuthorityExpr;
|
|
12
|
+
/** Internal constructor admission: the outer identity binder binds subject; no local escapes into it. */
|
|
13
|
+
export declare function admitBinderBody(input: portable.Value): AuthorityExpr;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
1
|
import { isNodeId } from '../../../graph/node/index.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { ownsExpression } from '../ownership.optimization.js';
|
|
3
|
+
import { classRef } from './references.js';
|
|
4
|
+
import { localId, term } from './term.js';
|
|
5
|
+
import { array, exact, invalid, record, required } from './wire.js';
|
|
5
6
|
export const limits = Object.freeze({
|
|
6
7
|
expressionDepth: 64,
|
|
7
8
|
operandsPerExpression: 512,
|
|
8
9
|
localsPerExpression: 64,
|
|
10
|
+
classesPerLocal: 1024,
|
|
11
|
+
classesPerRelation: 1024,
|
|
9
12
|
repeatMaximum: 16,
|
|
10
13
|
});
|
|
11
|
-
|
|
14
|
+
const MAX_BOOLEAN_OPERANDS = limits.operandsPerExpression;
|
|
12
15
|
export function admitAuthorityExpr(input) {
|
|
13
16
|
return admit(input, '/predicate', new Set(), false, 0);
|
|
14
17
|
}
|
|
18
|
+
/** Internal constructor admission: the outer identity binder binds subject; no local escapes into it. */
|
|
19
|
+
export function admitBinderBody(input) {
|
|
20
|
+
return admit(input, '/predicate/where', new Set(), true, 1);
|
|
21
|
+
}
|
|
15
22
|
function admit(input, path, locals, subjectBound, depth) {
|
|
16
23
|
if (depth > limits.expressionDepth)
|
|
17
24
|
invalid(path, 'Authority expression exceeds its depth limit');
|
|
25
|
+
if (locals.size === 0 && ownsExpression(input, limits.expressionDepth - depth))
|
|
26
|
+
return input;
|
|
18
27
|
const value = record(input, path);
|
|
19
28
|
switch (value.op) {
|
|
20
29
|
case 'true':
|
|
@@ -36,22 +45,30 @@ function admit(input, path, locals, subjectBound, depth) {
|
|
|
36
45
|
op: 'not',
|
|
37
46
|
predicate: admit(required(value.predicate, `${path}/predicate`), `${path}/predicate`, locals, subjectBound, depth + 1),
|
|
38
47
|
};
|
|
39
|
-
case '
|
|
40
|
-
exact(value, ['
|
|
48
|
+
case 'as':
|
|
49
|
+
exact(value, ['identity', 'op', 'where'], path);
|
|
50
|
+
if (typeof value.identity !== 'string' || !isNodeId(value.identity)) {
|
|
51
|
+
invalid(`${path}/identity`, 'Expected one canonical IdentityId');
|
|
52
|
+
}
|
|
41
53
|
return {
|
|
42
|
-
op: '
|
|
43
|
-
|
|
54
|
+
op: 'as',
|
|
55
|
+
identity: value.identity,
|
|
44
56
|
where: admit(required(value.where, `${path}/where`), `${path}/where`, locals, true, depth + 1),
|
|
45
57
|
};
|
|
58
|
+
case 'same-node':
|
|
59
|
+
exact(value, ['op', 'left', 'right'], path);
|
|
60
|
+
return {
|
|
61
|
+
op: 'same-node',
|
|
62
|
+
left: term(value.left, `${path}/left`, locals, subjectBound),
|
|
63
|
+
right: term(value.right, `${path}/right`, locals, subjectBound),
|
|
64
|
+
};
|
|
46
65
|
case 'related': {
|
|
47
66
|
const hasRepeat = Object.hasOwn(value, 'repeat');
|
|
48
|
-
exact(value, hasRepeat
|
|
49
|
-
? ['class', 'op', 'repeat', 'source', 'target']
|
|
50
|
-
: ['class', 'op', 'source', 'target'], path);
|
|
67
|
+
exact(value, hasRepeat ? ['via', 'op', 'repeat', 'source', 'target'] : ['via', 'op', 'source', 'target'], path);
|
|
51
68
|
return {
|
|
52
69
|
op: 'related',
|
|
53
70
|
source: term(value.source, `${path}/source`, locals, subjectBound),
|
|
54
|
-
|
|
71
|
+
via: array(value.via, `${path}/via`, 1, limits.classesPerRelation).map((entry, index) => classRef(entry, `${path}/via/${index}`)),
|
|
55
72
|
target: term(value.target, `${path}/target`, locals, subjectBound),
|
|
56
73
|
...(hasRepeat ? { repeat: repeat(value.repeat, `${path}/repeat`) } : {}),
|
|
57
74
|
};
|
|
@@ -80,11 +97,11 @@ function admit(input, path, locals, subjectBound, depth) {
|
|
|
80
97
|
return {
|
|
81
98
|
op: 'instance-of',
|
|
82
99
|
node: term(value.node, `${path}/node`, locals, subjectBound),
|
|
83
|
-
class:
|
|
100
|
+
class: classRef(value.class, `${path}/class`),
|
|
84
101
|
};
|
|
85
102
|
case 'edge-class':
|
|
86
103
|
exact(value, ['class', 'op'], path);
|
|
87
|
-
return { op: 'edge-class', class:
|
|
104
|
+
return { op: 'edge-class', class: classRef(value.class, `${path}/class`) };
|
|
88
105
|
case 'class-authority':
|
|
89
106
|
exact(value, ['class', 'evidence', 'identity', 'op', 'operation'], path);
|
|
90
107
|
return {
|
|
@@ -94,60 +111,27 @@ function admit(input, path, locals, subjectBound, depth) {
|
|
|
94
111
|
class: classRef(value.class, `${path}/class`),
|
|
95
112
|
evidence: evidence(value.evidence, `${path}/evidence`),
|
|
96
113
|
};
|
|
97
|
-
case 'domain-control':
|
|
98
|
-
exact(value, ['identity', 'op', 'origin'], path);
|
|
99
|
-
return {
|
|
100
|
-
op: 'domain-control',
|
|
101
|
-
identity: term(value.identity, `${path}/identity`, locals, subjectBound),
|
|
102
|
-
origin: domainOrigin(value.origin, `${path}/origin`),
|
|
103
|
-
};
|
|
104
114
|
default:
|
|
105
115
|
invalid(`${path}/op`, 'Unsupported authority operation');
|
|
106
116
|
}
|
|
107
117
|
}
|
|
108
|
-
function term(input, path, locals, subjectBound) {
|
|
109
|
-
const value = record(input, path);
|
|
110
|
-
switch (value.kind) {
|
|
111
|
-
case 'input':
|
|
112
|
-
exact(value, ['input', 'kind'], path);
|
|
113
|
-
if (value.input !== 'object' && value.input !== 'source' && value.input !== 'target') {
|
|
114
|
-
invalid(`${path}/input`, 'Expected object, source, or target');
|
|
115
|
-
}
|
|
116
|
-
return { kind: 'input', input: value.input };
|
|
117
|
-
case 'node':
|
|
118
|
-
exact(value, ['id', 'kind'], path);
|
|
119
|
-
if (!isNodeId(value.id))
|
|
120
|
-
invalid(`${path}/id`, 'Expected a canonical NodeId');
|
|
121
|
-
return { kind: 'node', id: value.id };
|
|
122
|
-
case 'class':
|
|
123
|
-
exact(value, ['kind', 'ref'], path);
|
|
124
|
-
return { kind: 'class', ref: classRef(value.ref, `${path}/ref`) };
|
|
125
|
-
case 'domain':
|
|
126
|
-
exact(value, ['kind', 'origin'], path);
|
|
127
|
-
return { kind: 'domain', origin: domainOrigin(value.origin, `${path}/origin`) };
|
|
128
|
-
case 'core':
|
|
129
|
-
exact(value, ['kind', 'ref'], path);
|
|
130
|
-
return { kind: 'core', ref: coreRef(value.ref, `${path}/ref`) };
|
|
131
|
-
case 'local': {
|
|
132
|
-
exact(value, ['id', 'kind'], path);
|
|
133
|
-
const id = localId(value.id, `${path}/id`);
|
|
134
|
-
if (!locals.has(id))
|
|
135
|
-
invalid(`${path}/id`, `Local ${id} is outside its lexical scope`);
|
|
136
|
-
return { kind: 'local', id };
|
|
137
|
-
}
|
|
138
|
-
case 'subject':
|
|
139
|
-
exact(value, ['kind'], path);
|
|
140
|
-
if (!subjectBound)
|
|
141
|
-
invalid(path, 'Grant subject is outside its lexical scope');
|
|
142
|
-
return { kind: 'subject' };
|
|
143
|
-
default:
|
|
144
|
-
invalid(`${path}/kind`, 'Unsupported authority term');
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
118
|
function localDeclaration(input, path) {
|
|
148
119
|
const value = record(input, path);
|
|
149
|
-
|
|
150
|
-
|
|
120
|
+
const id = localId(value.id, `${path}/id`);
|
|
121
|
+
if (value.kind === 'any') {
|
|
122
|
+
exact(value, ['id', 'kind'], path);
|
|
123
|
+
return { id, kind: 'any' };
|
|
124
|
+
}
|
|
125
|
+
if (value.kind === 'classes') {
|
|
126
|
+
exact(value, ['classes', 'id', 'kind'], path);
|
|
127
|
+
const classes = array(value.classes, `${path}/classes`, 1, limits.classesPerLocal).map((entry, index) => classRef(entry, `${path}/classes/${index}`));
|
|
128
|
+
return {
|
|
129
|
+
id,
|
|
130
|
+
kind: 'classes',
|
|
131
|
+
classes: classes,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
invalid(`${path}/kind`, 'Expected any or classes local selector');
|
|
151
135
|
}
|
|
152
136
|
function repeat(input, path) {
|
|
153
137
|
const value = record(input, path);
|
|
@@ -161,61 +145,6 @@ function repeat(input, path) {
|
|
|
161
145
|
}
|
|
162
146
|
return { min, max };
|
|
163
147
|
}
|
|
164
|
-
function classRef(input, path) {
|
|
165
|
-
const value = absoluteRef(input, path);
|
|
166
|
-
if (value.kind !== 'class')
|
|
167
|
-
invalid(`${path}/kind`, 'Expected class');
|
|
168
|
-
definitionName(value.name, `${path}/name`);
|
|
169
|
-
return value;
|
|
170
|
-
}
|
|
171
|
-
function nodeClassRef(input, path) {
|
|
172
|
-
const value = absoluteRef(input, path);
|
|
173
|
-
if (value.kind !== 'class')
|
|
174
|
-
invalid(`${path}/kind`, 'Expected class');
|
|
175
|
-
definitionName(value.name, `${path}/name`);
|
|
176
|
-
return value;
|
|
177
|
-
}
|
|
178
|
-
function edgeClassRef(input, path) {
|
|
179
|
-
const value = absoluteRef(input, path);
|
|
180
|
-
if (value.kind !== 'class')
|
|
181
|
-
invalid(`${path}/kind`, 'Expected class');
|
|
182
|
-
definitionName(value.name, `${path}/name`);
|
|
183
|
-
return value;
|
|
184
|
-
}
|
|
185
|
-
function absoluteRef(input, path) {
|
|
186
|
-
const value = record(input, path);
|
|
187
|
-
exact(value, ['kind', 'name', 'origin'], path);
|
|
188
|
-
const origin = domainOrigin(value.origin, `${path}/origin`);
|
|
189
|
-
if (typeof value.kind !== 'string')
|
|
190
|
-
invalid(`${path}/kind`, 'Expected a reference kind');
|
|
191
|
-
if (typeof value.name !== 'string')
|
|
192
|
-
invalid(`${path}/name`, 'Expected a reference name');
|
|
193
|
-
return { origin, kind: value.kind, name: value.name };
|
|
194
|
-
}
|
|
195
|
-
function definitionName(input, path) {
|
|
196
|
-
if (!patterns.memberName.test(input))
|
|
197
|
-
invalid(path, 'Expected a Definition member name');
|
|
198
|
-
}
|
|
199
|
-
function coreRef(input, path) {
|
|
200
|
-
const value = absoluteRef(input, path);
|
|
201
|
-
if (value.kind !== 'core')
|
|
202
|
-
invalid(`${path}/kind`, 'Expected core');
|
|
203
|
-
if (!patterns.coreSlug.test(value.name))
|
|
204
|
-
invalid(`${path}/name`, 'Expected a Core slug');
|
|
205
|
-
return value;
|
|
206
|
-
}
|
|
207
|
-
function domainOrigin(input, path) {
|
|
208
|
-
if (typeof input !== 'string' || !patterns.origin.test(input)) {
|
|
209
|
-
invalid(path, 'Expected a canonical Domain origin');
|
|
210
|
-
}
|
|
211
|
-
return input;
|
|
212
|
-
}
|
|
213
|
-
function localId(input, path) {
|
|
214
|
-
if (!Number.isSafeInteger(input) || input < 0) {
|
|
215
|
-
invalid(path, 'Expected a non-negative safe integer');
|
|
216
|
-
}
|
|
217
|
-
return input;
|
|
218
|
-
}
|
|
219
148
|
function operation(input, path) {
|
|
220
149
|
if (input !== 'create' &&
|
|
221
150
|
input !== 'read' &&
|
|
@@ -231,33 +160,3 @@ function evidence(input, path) {
|
|
|
231
160
|
invalid(path, 'Expected allowed or owner');
|
|
232
161
|
return input;
|
|
233
162
|
}
|
|
234
|
-
function record(input, path) {
|
|
235
|
-
if (input === undefined || input === null || Array.isArray(input) || typeof input !== 'object') {
|
|
236
|
-
invalid(path, 'Expected an object');
|
|
237
|
-
}
|
|
238
|
-
return input;
|
|
239
|
-
}
|
|
240
|
-
function array(input, path, minimum, maximum) {
|
|
241
|
-
if (!Array.isArray(input) || input.length < minimum || input.length > maximum) {
|
|
242
|
-
invalid(path, `Expected ${minimum}-${maximum} entries`);
|
|
243
|
-
}
|
|
244
|
-
return input;
|
|
245
|
-
}
|
|
246
|
-
function required(input, path) {
|
|
247
|
-
if (input === undefined)
|
|
248
|
-
invalid(path, 'Expected a value');
|
|
249
|
-
return input;
|
|
250
|
-
}
|
|
251
|
-
function exact(value, expected, path) {
|
|
252
|
-
const actual = Object.keys(value).sort(compare);
|
|
253
|
-
const wanted = [...expected].sort(compare);
|
|
254
|
-
if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) {
|
|
255
|
-
invalid(path, `Expected exactly ${expected.join(', ')}`);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function compare(left, right) {
|
|
259
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
260
|
-
}
|
|
261
|
-
function invalid(path, message) {
|
|
262
|
-
throw new AuthValueError('AUTHORITY_PREDICATE_INVALID', message, path);
|
|
263
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { admitAuthorityExpr, limits } from './admission.js';
|
|
1
|
+
export { admitAuthorityExpr, admitBinderBody, limits } from './admission.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { admitAuthorityExpr, limits } from './admission.js';
|
|
1
|
+
export { admitAuthorityExpr, admitBinderBody, limits } from './admission.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Key } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import type { ClassRef, CoreRef } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
4
|
+
/** One `{ origin, kind, name }` reference with a canonical origin and an unchecked kind and name. */
|
|
5
|
+
export declare function absoluteRef(input: portable.Value | undefined, path: string): {
|
|
6
|
+
readonly origin: Key.Origin;
|
|
7
|
+
readonly kind: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function classRef(input: portable.Value | undefined, path: string): ClassRef;
|
|
11
|
+
export declare function coreRef(input: portable.Value | undefined, path: string): CoreRef;
|
|
12
|
+
export declare function definitionName(input: string, path: string): void;
|
|
13
|
+
export declare function domainOrigin(input: portable.Value | undefined, path: string): Key.Origin;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { exact, invalid, record } from './wire.js';
|
|
3
|
+
/** One `{ origin, kind, name }` reference with a canonical origin and an unchecked kind and name. */
|
|
4
|
+
export function absoluteRef(input, path) {
|
|
5
|
+
const value = record(input, path);
|
|
6
|
+
exact(value, ['kind', 'name', 'origin'], path);
|
|
7
|
+
const origin = domainOrigin(value.origin, `${path}/origin`);
|
|
8
|
+
if (typeof value.kind !== 'string')
|
|
9
|
+
invalid(`${path}/kind`, 'Expected a reference kind');
|
|
10
|
+
if (typeof value.name !== 'string')
|
|
11
|
+
invalid(`${path}/name`, 'Expected a reference name');
|
|
12
|
+
return { origin, kind: value.kind, name: value.name };
|
|
13
|
+
}
|
|
14
|
+
export function classRef(input, path) {
|
|
15
|
+
const value = absoluteRef(input, path);
|
|
16
|
+
if (value.kind !== 'class')
|
|
17
|
+
invalid(`${path}/kind`, 'Expected class');
|
|
18
|
+
definitionName(value.name, `${path}/name`);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
export function coreRef(input, path) {
|
|
22
|
+
const value = absoluteRef(input, path);
|
|
23
|
+
if (value.kind !== 'core')
|
|
24
|
+
invalid(`${path}/kind`, 'Expected core');
|
|
25
|
+
if (!patterns.coreSlug.test(value.name))
|
|
26
|
+
invalid(`${path}/name`, 'Expected a Core slug');
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
export function definitionName(input, path) {
|
|
30
|
+
if (!patterns.memberName.test(input))
|
|
31
|
+
invalid(path, 'Expected a Definition member name');
|
|
32
|
+
}
|
|
33
|
+
export function domainOrigin(input, path) {
|
|
34
|
+
if (typeof input !== 'string' || !patterns.origin.test(input)) {
|
|
35
|
+
invalid(path, 'Expected a canonical Domain origin');
|
|
36
|
+
}
|
|
37
|
+
return input;
|
|
38
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import type { Term } from '../language/index.js';
|
|
3
|
+
/** Admit one term; `locals` and `subjectBound` are the lexical scope it may reference. */
|
|
4
|
+
export declare function term(input: portable.Value | undefined, path: string, locals: ReadonlySet<number>, subjectBound: boolean): Term;
|
|
5
|
+
/** A local id or repeat bound: a non-negative safe integer. */
|
|
6
|
+
export declare function localId(input: portable.Value | undefined, path: string): number;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isNodeId } from '../../../graph/node/index.js';
|
|
2
|
+
import { absoluteRef, classRef, coreRef, definitionName, domainOrigin } from './references.js';
|
|
3
|
+
import { exact, invalid, record } from './wire.js';
|
|
4
|
+
/** Admit one term; `locals` and `subjectBound` are the lexical scope it may reference. */
|
|
5
|
+
export function term(input, path, locals, subjectBound) {
|
|
6
|
+
const value = record(input, path);
|
|
7
|
+
switch (value.kind) {
|
|
8
|
+
case 'input':
|
|
9
|
+
exact(value, ['input', 'kind'], path);
|
|
10
|
+
if (value.input !== 'object' && value.input !== 'source' && value.input !== 'target') {
|
|
11
|
+
invalid(`${path}/input`, 'Expected object, source, or target');
|
|
12
|
+
}
|
|
13
|
+
return { kind: 'input', input: value.input };
|
|
14
|
+
case 'node':
|
|
15
|
+
exact(value, ['id', 'kind'], path);
|
|
16
|
+
if (!isNodeId(value.id))
|
|
17
|
+
invalid(`${path}/id`, 'Expected a canonical NodeId');
|
|
18
|
+
return { kind: 'node', id: value.id };
|
|
19
|
+
case 'class':
|
|
20
|
+
exact(value, ['kind', 'ref'], path);
|
|
21
|
+
return { kind: 'class', ref: classRef(value.ref, `${path}/ref`) };
|
|
22
|
+
case 'domain':
|
|
23
|
+
exact(value, ['kind', 'origin'], path);
|
|
24
|
+
return { kind: 'domain', origin: domainOrigin(value.origin, `${path}/origin`) };
|
|
25
|
+
case 'ref': {
|
|
26
|
+
exact(value, ['kind', 'ref'], path);
|
|
27
|
+
const ref = absoluteRef(value.ref, `${path}/ref`);
|
|
28
|
+
if (ref.kind === 'core')
|
|
29
|
+
return { kind: 'ref', ref: coreRef(value.ref, `${path}/ref`) };
|
|
30
|
+
if (!['class', 'function', 'policy', 'view'].includes(ref.kind))
|
|
31
|
+
invalid(`${path}/ref/kind`, 'Expected a projected Schema member');
|
|
32
|
+
definitionName(ref.name, `${path}/ref/name`);
|
|
33
|
+
return { kind: 'ref', ref: ref };
|
|
34
|
+
}
|
|
35
|
+
case 'core':
|
|
36
|
+
exact(value, ['kind', 'ref'], path);
|
|
37
|
+
return { kind: 'core', ref: coreRef(value.ref, `${path}/ref`) };
|
|
38
|
+
case 'local': {
|
|
39
|
+
exact(value, ['id', 'kind'], path);
|
|
40
|
+
const id = localId(value.id, `${path}/id`);
|
|
41
|
+
if (!locals.has(id))
|
|
42
|
+
invalid(`${path}/id`, `Local ${id} is outside its lexical scope`);
|
|
43
|
+
return { kind: 'local', id };
|
|
44
|
+
}
|
|
45
|
+
case 'subject':
|
|
46
|
+
exact(value, ['kind'], path);
|
|
47
|
+
if (!subjectBound)
|
|
48
|
+
invalid(path, 'Binder subject is outside its lexical scope');
|
|
49
|
+
return { kind: 'subject' };
|
|
50
|
+
default:
|
|
51
|
+
invalid(`${path}/kind`, 'Unsupported authority term');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** A local id or repeat bound: a non-negative safe integer. */
|
|
55
|
+
export function localId(input, path) {
|
|
56
|
+
if (!Number.isSafeInteger(input) || input < 0) {
|
|
57
|
+
invalid(path, 'Expected a non-negative safe integer');
|
|
58
|
+
}
|
|
59
|
+
return input;
|
|
60
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
/** Fail admission at one JSON-pointer path with the stable Authority predicate code. */
|
|
3
|
+
export declare function invalid(path: string, message: string): never;
|
|
4
|
+
export declare function record(input: portable.Value | undefined, path: string): portable.Object;
|
|
5
|
+
export declare function array(input: portable.Value | undefined, path: string, minimum: number, maximum: number): readonly portable.Value[];
|
|
6
|
+
export declare function required(input: portable.Value | undefined, path: string): portable.Value;
|
|
7
|
+
/** Reject a record whose own keys differ from `expected`, in any order. */
|
|
8
|
+
export declare function exact(value: portable.Object, expected: readonly string[], path: string): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AuthValueError } from '../../error.js';
|
|
2
|
+
/** Fail admission at one JSON-pointer path with the stable Authority predicate code. */
|
|
3
|
+
export function invalid(path, message) {
|
|
4
|
+
throw new AuthValueError('AUTHORITY_PREDICATE_INVALID', message, path);
|
|
5
|
+
}
|
|
6
|
+
export function record(input, path) {
|
|
7
|
+
if (input === undefined || input === null || Array.isArray(input) || typeof input !== 'object') {
|
|
8
|
+
invalid(path, 'Expected an object');
|
|
9
|
+
}
|
|
10
|
+
return input;
|
|
11
|
+
}
|
|
12
|
+
export function array(input, path, minimum, maximum) {
|
|
13
|
+
if (!Array.isArray(input) || input.length < minimum || input.length > maximum) {
|
|
14
|
+
invalid(path, `Expected ${minimum}-${maximum} entries`);
|
|
15
|
+
}
|
|
16
|
+
return input;
|
|
17
|
+
}
|
|
18
|
+
export function required(input, path) {
|
|
19
|
+
if (input === undefined)
|
|
20
|
+
invalid(path, 'Expected a value');
|
|
21
|
+
return input;
|
|
22
|
+
}
|
|
23
|
+
/** Reject a record whose own keys differ from `expected`, in any order. */
|
|
24
|
+
export function exact(value, expected, path) {
|
|
25
|
+
const actual = Object.keys(value).sort(compare);
|
|
26
|
+
const wanted = [...expected].sort(compare);
|
|
27
|
+
if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) {
|
|
28
|
+
invalid(path, `Expected exactly ${expected.join(', ')}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function compare(left, right) {
|
|
32
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { accept } from './accept.js';
|
|
3
|
+
import { ownsCanonical } from './ownership.optimization.js';
|
|
4
|
+
/** Canonical form, not an authorization decision. Crossing values still require admission. */
|
|
5
|
+
export function isCanonical(input) {
|
|
6
|
+
if (ownsCanonical(input))
|
|
7
|
+
return true;
|
|
8
|
+
try {
|
|
9
|
+
const canonical = accept(input);
|
|
10
|
+
return portable.json.serialize(canonical) === portable.json.serialize(input);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export { accept } from './accept.js';
|
|
2
|
+
export { isCanonical } from './canonical.js';
|
|
3
|
+
export { ownsCanonical } from './ownership.optimization.js';
|
|
4
|
+
export { prepareBinderBody } from './prepare-binder-body.js';
|
|
5
|
+
export { acceptProgram, createAuthorityProgram, isPredicateRef } from './program.js';
|
|
6
|
+
export type { AuthorityProgramBuilder, ClosedAuthorityProgram } from './program.js';
|
|
2
7
|
export { limits } from './admission/index.js';
|
|
3
8
|
export { canonicalize } from './normalization/index.js';
|
|
4
|
-
export { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
5
|
-
export type { AuthorityExpr, AuthorityPredicate, ClassRef, Input, LocalDeclaration, Operation, Repeat, Requirement, Term, } from './language/index.js';
|
|
9
|
+
export { AUTHORITY_PREDICATE_VERSION, AUTHORITY_PROGRAM_VERSION } from './language/index.js';
|
|
10
|
+
export type { AuthorityExpr, AuthorityPredicate, AuthorityProgram, ClassRef, ClosedEdgeExtent, Input, LocalDeclaration, Operation, PredicateRef, Repeat, Requirement, Term, } from './language/index.js';
|
|
11
|
+
export { AuthorityFailure, allowed, binderRoots, classAuthorityMeaning, closeComposition, createAuthorityEvaluator, fixedPaths, isFixedTerm, requiredInputs, termPath, } from './semantics/index.js';
|
|
12
|
+
export type { AuthorityAtom, AuthorityEvaluationOptions, AuthorityEvaluator, AuthorityFailureCode, AuthorityInputs, AuthorityNode, AuthoritySnapshot, AuthorityVocabulary, CompositionClosure, CompositionLimits, CompositionStatus, FixedTerm, } from './semantics/index.js';
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { accept } from './accept.js';
|
|
2
|
+
export { isCanonical } from './canonical.js';
|
|
3
|
+
export { ownsCanonical } from './ownership.optimization.js';
|
|
4
|
+
export { prepareBinderBody } from './prepare-binder-body.js';
|
|
5
|
+
export { acceptProgram, createAuthorityProgram, isPredicateRef } from './program.js';
|
|
2
6
|
export { limits } from './admission/index.js';
|
|
3
7
|
export { canonicalize } from './normalization/index.js';
|
|
4
|
-
export { AUTHORITY_PREDICATE_VERSION } from './language/index.js';
|
|
8
|
+
export { AUTHORITY_PREDICATE_VERSION, AUTHORITY_PROGRAM_VERSION } from './language/index.js';
|
|
9
|
+
export { AuthorityFailure, allowed, binderRoots, classAuthorityMeaning, closeComposition, createAuthorityEvaluator, fixedPaths, isFixedTerm, requiredInputs, termPath, } from './semantics/index.js';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { AUTHORITY_PREDICATE_VERSION } from './predicate.js';
|
|
2
|
-
export
|
|
2
|
+
export { AUTHORITY_PROGRAM_VERSION } from './program.js';
|
|
3
|
+
export type { AuthorityExpr, AuthorityPredicate, ClassRef, ClosedEdgeExtent, Input, LocalDeclaration, Operation, Repeat, Requirement, Term, } from './predicate.js';
|
|
4
|
+
export type { AuthorityProgram, PredicateRef } from './program.js';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ClassRef, CoreRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
1
|
+
import type { ClassRef, CoreRef, FunctionRef, PolicyRef, ViewRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import type { NodeId } from '../../../graph/node/index.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const AUTHORITY_PREDICATE_VERSION:
|
|
3
|
+
import type { IdentityId } from '../../identity/index.js';
|
|
4
|
+
export declare const AUTHORITY_PREDICATE_VERSION: 11;
|
|
5
|
+
/** Concrete Edge Classes selected by Runtime closure, reused at every bounded hop. */
|
|
6
|
+
export type ClosedEdgeExtent = readonly [ClassRef, ...ClassRef[]];
|
|
5
7
|
export type Operation = 'create' | 'read' | 'traverse' | 'update' | 'delete';
|
|
6
8
|
export type Input = 'object' | 'source' | 'target';
|
|
7
9
|
export type { ClassRef } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
@@ -20,6 +22,9 @@ export type Term = {
|
|
|
20
22
|
} | {
|
|
21
23
|
readonly kind: 'core';
|
|
22
24
|
readonly ref: CoreRef;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'ref';
|
|
27
|
+
readonly ref: ClassRef | FunctionRef | PolicyRef | ViewRef | CoreRef;
|
|
23
28
|
} | {
|
|
24
29
|
readonly kind: 'local';
|
|
25
30
|
readonly id: number;
|
|
@@ -30,22 +35,26 @@ export interface Repeat {
|
|
|
30
35
|
readonly min: number;
|
|
31
36
|
readonly max: number;
|
|
32
37
|
}
|
|
33
|
-
export
|
|
38
|
+
export type LocalDeclaration = {
|
|
34
39
|
readonly id: number;
|
|
35
|
-
readonly
|
|
36
|
-
}
|
|
37
|
-
|
|
40
|
+
readonly kind: 'any';
|
|
41
|
+
} | {
|
|
42
|
+
readonly id: number;
|
|
43
|
+
readonly kind: 'classes';
|
|
44
|
+
readonly classes: readonly [ClassRef, ...ClassRef[]];
|
|
45
|
+
};
|
|
46
|
+
export interface Requirement {
|
|
38
47
|
readonly op: 'class-authority';
|
|
39
48
|
readonly identity: Term;
|
|
40
49
|
readonly operation: Operation;
|
|
41
50
|
readonly class: ClassRef;
|
|
42
51
|
readonly evidence: 'allowed' | 'owner';
|
|
43
|
-
}
|
|
44
|
-
readonly op: 'domain-control';
|
|
45
|
-
readonly identity: Term;
|
|
46
|
-
readonly origin: Key.Origin;
|
|
47
|
-
};
|
|
52
|
+
}
|
|
48
53
|
export type AuthorityExpr = {
|
|
54
|
+
readonly op: 'same-node';
|
|
55
|
+
readonly left: Term;
|
|
56
|
+
readonly right: Term;
|
|
57
|
+
} | {
|
|
49
58
|
readonly op: 'true';
|
|
50
59
|
} | {
|
|
51
60
|
readonly op: 'false';
|
|
@@ -58,14 +67,20 @@ export type AuthorityExpr = {
|
|
|
58
67
|
} | {
|
|
59
68
|
readonly op: 'not';
|
|
60
69
|
readonly predicate: AuthorityExpr;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Bind one Identity as the lexical subject of `where`. The Identity is evaluated through its live
|
|
73
|
+
* composition (extensions, constraints, exclusions; deny wins). Two binders are never fused.
|
|
74
|
+
*/
|
|
75
|
+
| {
|
|
76
|
+
readonly op: 'as';
|
|
77
|
+
readonly identity: IdentityId;
|
|
64
78
|
readonly where: AuthorityExpr;
|
|
65
79
|
} | {
|
|
80
|
+
/** One closed Edge extent, reused at every bounded hop. */
|
|
66
81
|
readonly op: 'related';
|
|
67
82
|
readonly source: Term;
|
|
68
|
-
readonly
|
|
83
|
+
readonly via: ClosedEdgeExtent;
|
|
69
84
|
readonly target: Term;
|
|
70
85
|
readonly repeat?: Repeat;
|
|
71
86
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AUTHORITY_PREDICATE_VERSION =
|
|
1
|
+
export const AUTHORITY_PREDICATE_VERSION = 11;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ClassRef } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import type { AuthorityExpr } from './predicate.js';
|
|
3
|
+
/** Program coordinate; its predicates are AuthorityPredicate V11 expressions. */
|
|
4
|
+
export declare const AUTHORITY_PROGRAM_VERSION: 1;
|
|
5
|
+
declare const PREDICATE_REF: unique symbol;
|
|
6
|
+
/** Ordinal of one predicate inside the `AuthorityProgram` carried by the same plan. */
|
|
7
|
+
export type PredicateRef = number & {
|
|
8
|
+
readonly [PREDICATE_REF]: true;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The one authority representation carried by a closed plan. Every authority position of the plan
|
|
12
|
+
* is a `PredicateRef` into `predicates`.
|
|
13
|
+
*/
|
|
14
|
+
export interface AuthorityProgram {
|
|
15
|
+
readonly version: typeof AUTHORITY_PROGRAM_VERSION;
|
|
16
|
+
/** Concrete Identity Classes, closed by Runtime from the pinned Registry; sorted and unique. */
|
|
17
|
+
readonly identities: readonly ClassRef[];
|
|
18
|
+
/** Canonical, sorted by canonical JSON text, unique; every member referenced by the plan. */
|
|
19
|
+
readonly predicates: readonly AuthorityExpr[];
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { canonicalize, canonicalizeAdmitted } from './normalize.js';
|
|
1
|
+
export { canonicalize, canonicalizeAdmitted, normalizeBinderBodyAdmitted } from './normalize.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { canonicalize, canonicalizeAdmitted } from './normalize.js';
|
|
1
|
+
export { canonicalize, canonicalizeAdmitted, normalizeBinderBodyAdmitted } from './normalize.js';
|
|
@@ -2,3 +2,5 @@ import type { AuthorityExpr, AuthorityPredicate } from '../language/index.js';
|
|
|
2
2
|
/** Validate and canonicalize one authority expression into its versioned crossing envelope. */
|
|
3
3
|
export declare function canonicalize(expr: AuthorityExpr): AuthorityPredicate;
|
|
4
4
|
export declare function canonicalizeAdmitted(expr: AuthorityExpr): AuthorityPredicate;
|
|
5
|
+
/** Internal scoped normalization; this body is not a closed owned authority expression. */
|
|
6
|
+
export declare function normalizeBinderBodyAdmitted(expr: AuthorityExpr): AuthorityExpr;
|