@astrale-os/kernel-dsl 0.1.5 → 0.2.0-beta.10
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/index.d.ts +1 -57
- package/dist/index.js +1 -31
- package/dist/upgrade/contract.d.ts +31 -0
- package/dist/upgrade/contract.js +1 -0
- package/dist/upgrade/index.d.ts +1 -0
- package/dist/upgrade/index.js +1 -0
- package/dist/v1/addressing/class-key.d.ts +12 -0
- package/dist/v1/addressing/class-key.js +39 -0
- package/dist/v1/addressing/definition-ref.d.ts +28 -0
- package/dist/v1/addressing/definition-ref.js +63 -0
- package/dist/v1/addressing/domain-dependency.d.ts +18 -0
- package/dist/v1/addressing/domain-dependency.js +6 -0
- package/dist/v1/addressing/index.d.ts +12 -0
- package/dist/v1/addressing/index.js +7 -0
- package/dist/v1/addressing/key.d.ts +19 -0
- package/dist/v1/addressing/key.js +39 -0
- package/dist/v1/addressing/method-address.d.ts +9 -0
- package/dist/v1/addressing/method-address.js +1 -0
- package/dist/v1/addressing/method-key.d.ts +15 -0
- package/dist/v1/addressing/method-key.js +60 -0
- package/dist/v1/addressing/ordering.d.ts +6 -0
- package/dist/v1/addressing/ordering.js +20 -0
- package/dist/v1/addressing/patterns.d.ts +27 -0
- package/dist/v1/addressing/patterns.js +29 -0
- package/dist/v1/addressing/property-key.d.ts +13 -0
- package/dist/v1/addressing/property-key.js +39 -0
- package/dist/v1/addressing/revision.d.ts +8 -0
- package/dist/v1/addressing/revision.js +8 -0
- package/dist/v1/builder/callable/authoring.d.ts +117 -0
- package/dist/v1/builder/callable/authoring.js +67 -0
- package/dist/v1/builder/class/authoring.d.ts +367 -0
- package/dist/v1/builder/class/authoring.js +134 -0
- package/dist/v1/builder/class/property.d.ts +52 -0
- package/dist/v1/builder/class/property.js +49 -0
- package/dist/v1/builder/core/authoring.d.ts +42 -0
- package/dist/v1/builder/core/authoring.js +39 -0
- package/dist/v1/builder/index.d.ts +26 -0
- package/dist/v1/builder/index.js +11 -0
- package/dist/v1/builder/lowering/callable.d.ts +24 -0
- package/dist/v1/builder/lowering/callable.js +135 -0
- package/dist/v1/builder/lowering/class.d.ts +22 -0
- package/dist/v1/builder/lowering/class.js +129 -0
- package/dist/v1/builder/lowering/core-properties.d.ts +10 -0
- package/dist/v1/builder/lowering/core-properties.js +76 -0
- package/dist/v1/builder/lowering/core.d.ts +22 -0
- package/dist/v1/builder/lowering/core.js +50 -0
- package/dist/v1/builder/lowering/policy.d.ts +16 -0
- package/dist/v1/builder/lowering/policy.js +59 -0
- package/dist/v1/builder/lowering/schema/capture.d.ts +4 -0
- package/dist/v1/builder/lowering/schema/capture.js +70 -0
- package/dist/v1/builder/lowering/schema/compile.d.ts +10 -0
- package/dist/v1/builder/lowering/schema/compile.js +80 -0
- package/dist/v1/builder/lowering/schema/context.d.ts +44 -0
- package/dist/v1/builder/lowering/schema/context.js +247 -0
- package/dist/v1/builder/lowering/schema/ownership.d.ts +8 -0
- package/dist/v1/builder/lowering/schema/ownership.js +29 -0
- package/dist/v1/builder/lowering/value/compile.d.ts +15 -0
- package/dist/v1/builder/lowering/value/compile.js +136 -0
- package/dist/v1/builder/lowering/value/path.d.ts +3 -0
- package/dist/v1/builder/lowering/value/path.js +20 -0
- package/dist/v1/builder/lowering/value/zod.d.ts +32 -0
- package/dist/v1/builder/lowering/value/zod.js +342 -0
- package/dist/v1/builder/lowering/view.d.ts +11 -0
- package/dist/v1/builder/lowering/view.js +27 -0
- package/dist/v1/builder/policy/authoring.d.ts +52 -0
- package/dist/v1/builder/policy/authoring.js +90 -0
- package/dist/v1/builder/schema/define.d.ts +11 -0
- package/dist/v1/builder/schema/define.js +5 -0
- package/dist/v1/builder/schema/diagnostic.d.ts +16 -0
- package/dist/v1/builder/schema/diagnostic.js +31 -0
- package/dist/v1/builder/schema/handle.d.ts +7 -0
- package/dist/v1/builder/schema/handle.js +14 -0
- package/dist/v1/builder/schema/input.d.ts +15 -0
- package/dist/v1/builder/schema/input.js +1 -0
- package/dist/v1/builder/schema/lazy.d.ts +2 -0
- package/dist/v1/builder/schema/lazy.js +13 -0
- package/dist/v1/builder/schema/projection.d.ts +364 -0
- package/dist/v1/builder/schema/projection.js +1 -0
- package/dist/v1/builder/value/full-match.d.ts +4 -0
- package/dist/v1/builder/value/full-match.js +11 -0
- package/dist/v1/builder/value/path-metadata.d.ts +4 -0
- package/dist/v1/builder/value/path-metadata.js +7 -0
- package/dist/v1/builder/value/path.d.ts +8 -0
- package/dist/v1/builder/value/path.js +11 -0
- package/dist/v1/builder/value/schema.d.ts +16 -0
- package/dist/v1/builder/value/schema.js +10 -0
- package/dist/v1/builder/view/authoring.d.ts +17 -0
- package/dist/v1/builder/view/authoring.js +16 -0
- package/dist/v1/bundle/codec.d.ts +5 -0
- package/dist/v1/bundle/codec.js +168 -0
- package/dist/v1/bundle/create.d.ts +3 -0
- package/dist/v1/bundle/create.js +5 -0
- package/dist/v1/bundle/diagnostic.d.ts +10 -0
- package/dist/v1/bundle/diagnostic.js +17 -0
- package/dist/v1/bundle/index.d.ts +18 -0
- package/dist/v1/bundle/index.js +20 -0
- package/dist/v1/bundle/model.d.ts +16 -0
- package/dist/v1/bundle/model.js +11 -0
- package/dist/v1/bundle/structure.d.ts +7 -0
- package/dist/v1/bundle/structure.js +71 -0
- package/dist/v1/bundle/transport.d.ts +8 -0
- package/dist/v1/bundle/transport.js +7 -0
- package/dist/v1/compiled/admission/accept.d.ts +3 -0
- package/dist/v1/compiled/admission/accept.js +881 -0
- package/dist/v1/compiled/admission/revision.d.ts +4 -0
- package/dist/v1/compiled/admission/revision.js +73 -0
- package/dist/v1/compiled/admission/semantics.d.ts +7 -0
- package/dist/v1/compiled/admission/semantics.js +1091 -0
- package/dist/v1/compiled/codec/json.d.ts +3 -0
- package/dist/v1/compiled/codec/json.js +9 -0
- package/dist/v1/compiled/compiler/compile.d.ts +4 -0
- package/dist/v1/compiled/compiler/compile.js +113 -0
- package/dist/v1/compiled/diagnostic.d.ts +11 -0
- package/dist/v1/compiled/diagnostic.js +13 -0
- package/dist/v1/compiled/index.d.ts +7 -0
- package/dist/v1/compiled/index.js +5 -0
- package/dist/v1/compiled/loader/index.d.ts +1 -0
- package/dist/v1/compiled/loader/index.js +1 -0
- package/dist/v1/compiled/loader/load.d.ts +4 -0
- package/dist/v1/compiled/loader/load.js +141 -0
- package/dist/v1/compiled/model/schema.d.ts +73 -0
- package/dist/v1/compiled/model/schema.js +1 -0
- package/dist/v1/domain/create.d.ts +8 -0
- package/dist/v1/domain/create.js +264 -0
- package/dist/v1/domain/index.d.ts +2 -0
- package/dist/v1/domain/index.js +1 -0
- package/dist/v1/domain/model/domain.d.ts +59 -0
- package/dist/v1/domain/model/domain.js +1 -0
- package/dist/v1/domain/model/input.d.ts +31 -0
- package/dist/v1/domain/model/input.js +1 -0
- package/dist/v1/domain/namespace/member-collection.d.ts +5 -0
- package/dist/v1/domain/namespace/member-collection.js +81 -0
- package/dist/v1/domain/projection/classes.d.ts +4 -0
- package/dist/v1/domain/projection/classes.js +200 -0
- package/dist/v1/domain/validation/create.d.ts +18 -0
- package/dist/v1/domain/validation/create.js +75 -0
- package/dist/v1/index.d.ts +16 -0
- package/dist/v1/index.js +8 -0
- package/dist/v1/language/callable/index.d.ts +2 -0
- package/dist/v1/language/callable/index.js +1 -0
- package/dist/v1/language/callable/model/callable.d.ts +33 -0
- package/dist/v1/language/callable/model/callable.js +1 -0
- package/dist/v1/language/callable/resolved.d.ts +68 -0
- package/dist/v1/language/callable/resolved.js +1 -0
- package/dist/v1/language/class/facets.d.ts +58 -0
- package/dist/v1/language/class/facets.js +1 -0
- package/dist/v1/language/class/index.d.ts +8 -0
- package/dist/v1/language/class/index.js +1 -0
- package/dist/v1/language/class/model/class.d.ts +36 -0
- package/dist/v1/language/class/model/class.js +1 -0
- package/dist/v1/language/class/model/data.d.ts +11 -0
- package/dist/v1/language/class/model/data.js +2 -0
- package/dist/v1/language/class/model/edge.d.ts +38 -0
- package/dist/v1/language/class/model/edge.js +1 -0
- package/dist/v1/language/class/model/property.d.ts +18 -0
- package/dist/v1/language/class/model/property.js +1 -0
- package/dist/v1/language/class/property-values.d.ts +15 -0
- package/dist/v1/language/class/property-values.js +30 -0
- package/dist/v1/language/class/resolved.d.ts +123 -0
- package/dist/v1/language/class/resolved.js +1 -0
- package/dist/v1/language/core/index.d.ts +2 -0
- package/dist/v1/language/core/index.js +1 -0
- package/dist/v1/language/core/model/core.d.ts +20 -0
- package/dist/v1/language/core/model/core.js +1 -0
- package/dist/v1/language/core/resolved.d.ts +21 -0
- package/dist/v1/language/core/resolved.js +1 -0
- package/dist/v1/language/definition/metadata.d.ts +12 -0
- package/dist/v1/language/definition/metadata.js +12 -0
- package/dist/v1/language/definition.d.ts +7 -0
- package/dist/v1/language/definition.js +1 -0
- package/dist/v1/language/index.d.ts +23 -0
- package/dist/v1/language/index.js +1 -0
- package/dist/v1/language/policy/analysis/branches.d.ts +19 -0
- package/dist/v1/language/policy/analysis/branches.js +132 -0
- package/dist/v1/language/policy/analysis/budgets.d.ts +16 -0
- package/dist/v1/language/policy/analysis/budgets.js +25 -0
- package/dist/v1/language/policy/index.d.ts +3 -0
- package/dist/v1/language/policy/index.js +1 -0
- package/dist/v1/language/policy/model/policy.d.ts +77 -0
- package/dist/v1/language/policy/model/policy.js +1 -0
- package/dist/v1/language/policy/normalization/normalize.d.ts +4 -0
- package/dist/v1/language/policy/normalization/normalize.js +226 -0
- package/dist/v1/language/policy/resolved.d.ts +9 -0
- package/dist/v1/language/policy/resolved.js +1 -0
- package/dist/v1/language/resolved.d.ts +10 -0
- package/dist/v1/language/resolved.js +1 -0
- package/dist/v1/language/validation/diagnostic.d.ts +8 -0
- package/dist/v1/language/validation/diagnostic.js +3 -0
- package/dist/v1/language/value/compile/fields.d.ts +3 -0
- package/dist/v1/language/value/compile/fields.js +60 -0
- package/dist/v1/language/value/compile/load.d.ts +4 -0
- package/dist/v1/language/value/compile/load.js +41 -0
- package/dist/v1/language/value/compile/model.d.ts +27 -0
- package/dist/v1/language/value/compile/model.js +1 -0
- package/dist/v1/language/value/evaluate/assertions.d.ts +6 -0
- package/dist/v1/language/value/evaluate/assertions.js +58 -0
- package/dist/v1/language/value/evaluate/evaluator.d.ts +4 -0
- package/dist/v1/language/value/evaluate/evaluator.js +361 -0
- package/dist/v1/language/value/evaluate/preparation.d.ts +13 -0
- package/dist/v1/language/value/evaluate/preparation.js +135 -0
- package/dist/v1/language/value/evaluate/program.d.ts +3 -0
- package/dist/v1/language/value/evaluate/program.js +16 -0
- package/dist/v1/language/value/evaluate/types.d.ts +36 -0
- package/dist/v1/language/value/evaluate/types.js +9 -0
- package/dist/v1/language/value/evaluate/validate.d.ts +12 -0
- package/dist/v1/language/value/evaluate/validate.js +43 -0
- package/dist/v1/language/value/index.d.ts +11 -0
- package/dist/v1/language/value/index.js +8 -0
- package/dist/v1/language/value/model/instant.d.ts +9 -0
- package/dist/v1/language/value/model/instant.js +37 -0
- package/dist/v1/language/value/model/object.d.ts +5 -0
- package/dist/v1/language/value/model/object.js +3 -0
- package/dist/v1/language/value/model/schema.d.ts +25 -0
- package/dist/v1/language/value/model/schema.js +11 -0
- package/dist/v1/language/value/ordering.d.ts +13 -0
- package/dist/v1/language/value/ordering.js +174 -0
- package/dist/v1/language/value/profile/canonicalize.d.ts +4 -0
- package/dist/v1/language/value/profile/canonicalize.js +130 -0
- package/dist/v1/language/value/profile/json.validate.d.ts +2 -0
- package/dist/v1/language/value/profile/json.validate.js +14 -0
- package/dist/v1/language/value/profile/meta-schema.compiled.d.ts +78 -0
- package/dist/v1/language/value/profile/meta-schema.compiled.js +2079 -0
- package/dist/v1/language/value/profile/meta-schema.d.ts +4 -0
- package/dist/v1/language/value/profile/meta-schema.js +19 -0
- package/dist/v1/language/value/profile/rules.d.ts +3 -0
- package/dist/v1/language/value/profile/rules.js +109 -0
- package/dist/v1/language/value/profile/validate.d.ts +4 -0
- package/dist/v1/language/value/profile/validate.js +39 -0
- package/dist/v1/language/value/profile/vocabulary.d.ts +2 -0
- package/dist/v1/language/value/profile/vocabulary.js +68 -0
- package/dist/v1/language/value/reference/closure.d.ts +11 -0
- package/dist/v1/language/value/reference/closure.js +51 -0
- package/dist/v1/language/value/reference/recursion.d.ts +5 -0
- package/dist/v1/language/value/reference/recursion.js +95 -0
- package/dist/v1/language/value/reference/references.d.ts +17 -0
- package/dist/v1/language/value/reference/references.js +45 -0
- package/dist/v1/language/value/reference/registry.d.ts +24 -0
- package/dist/v1/language/value/reference/registry.index.d.ts +14 -0
- package/dist/v1/language/value/reference/registry.index.js +76 -0
- package/dist/v1/language/value/reference/registry.js +1 -0
- package/dist/v1/language/value/regexp/ast.d.ts +21 -0
- package/dist/v1/language/value/regexp/ast.js +326 -0
- package/dist/v1/language/value/regexp/compile.d.ts +3 -0
- package/dist/v1/language/value/regexp/compile.js +96 -0
- package/dist/v1/language/value/regexp/lower.d.ts +3 -0
- package/dist/v1/language/value/regexp/lower.js +26 -0
- package/dist/v1/language/value/regexp/matcher.d.ts +7 -0
- package/dist/v1/language/value/regexp/matcher.js +50 -0
- package/dist/v1/language/value/regexp/pattern.d.ts +2 -0
- package/dist/v1/language/value/regexp/pattern.js +38 -0
- package/dist/v1/language/value/regexp/syntax.d.ts +2 -0
- package/dist/v1/language/value/regexp/syntax.js +5 -0
- package/dist/v1/language/value/syntax/full-match.d.ts +6 -0
- package/dist/v1/language/value/syntax/full-match.js +20 -0
- package/dist/v1/language/value/syntax/keywords.d.ts +3 -0
- package/dist/v1/language/value/syntax/keywords.js +20 -0
- package/dist/v1/language/value/syntax/node-path/schema.d.ts +5 -0
- package/dist/v1/language/value/syntax/node-path/schema.js +18 -0
- package/dist/v1/language/value/syntax/node-path/validate.d.ts +4 -0
- package/dist/v1/language/value/syntax/node-path/validate.js +80 -0
- package/dist/v1/language/value/syntax/pointer.d.ts +4 -0
- package/dist/v1/language/value/syntax/pointer.js +49 -0
- package/dist/v1/language/value/syntax/walk.d.ts +10 -0
- package/dist/v1/language/value/syntax/walk.js +53 -0
- package/dist/v1/language/view/index.d.ts +2 -0
- package/dist/v1/language/view/index.js +1 -0
- package/dist/v1/language/view/model/view.d.ts +11 -0
- package/dist/v1/language/view/model/view.js +1 -0
- package/dist/v1/language/view/resolved.d.ts +9 -0
- package/dist/v1/language/view/resolved.js +1 -0
- package/dist/v1/schema/admission/accept.d.ts +3 -0
- package/dist/v1/schema/admission/accept.js +26 -0
- package/dist/v1/schema/analysis/class.d.ts +41 -0
- package/dist/v1/schema/analysis/class.js +181 -0
- package/dist/v1/schema/canonical/domain.d.ts +3 -0
- package/dist/v1/schema/canonical/domain.digest.d.ts +3 -0
- package/dist/v1/schema/canonical/domain.digest.js +5 -0
- package/dist/v1/schema/canonical/domain.js +5 -0
- package/dist/v1/schema/canonical/freeze.d.ts +1 -0
- package/dist/v1/schema/canonical/freeze.js +9 -0
- package/dist/v1/schema/canonical/revision.d.ts +11 -0
- package/dist/v1/schema/canonical/revision.js +17 -0
- package/dist/v1/schema/codec/header.d.ts +17 -0
- package/dist/v1/schema/codec/header.js +26 -0
- package/dist/v1/schema/codec/schema.d.ts +5 -0
- package/dist/v1/schema/codec/schema.js +21 -0
- package/dist/v1/schema/compatibility/meaning.d.ts +29 -0
- package/dist/v1/schema/compatibility/meaning.js +605 -0
- package/dist/v1/schema/dependency/lookup.d.ts +18 -0
- package/dist/v1/schema/dependency/lookup.js +31 -0
- package/dist/v1/schema/diagnostic.d.ts +12 -0
- package/dist/v1/schema/diagnostic.js +21 -0
- package/dist/v1/schema/index.d.ts +26 -0
- package/dist/v1/schema/index.js +13 -0
- package/dist/v1/schema/model/format.d.ts +2 -0
- package/dist/v1/schema/model/format.js +2 -0
- package/dist/v1/schema/model/schema.d.ts +30 -0
- package/dist/v1/schema/model/schema.js +4 -0
- package/dist/v1/schema/normalization/domain.d.ts +2 -0
- package/dist/v1/schema/normalization/domain.js +207 -0
- package/dist/v1/schema/resolution/closure.d.ts +9 -0
- package/dist/v1/schema/resolution/closure.js +49 -0
- package/dist/v1/schema/resolution/context.d.ts +17 -0
- package/dist/v1/schema/resolution/context.js +158 -0
- package/dist/v1/schema/resolution/definition.index.d.ts +21 -0
- package/dist/v1/schema/resolution/definition.index.js +17 -0
- package/dist/v1/schema/resolution/domain.d.ts +4 -0
- package/dist/v1/schema/resolution/domain.js +112 -0
- package/dist/v1/schema/resolution/origins.d.ts +14 -0
- package/dist/v1/schema/resolution/origins.js +121 -0
- package/dist/v1/schema/resolution/value.registry.d.ts +7 -0
- package/dist/v1/schema/resolution/value.registry.js +39 -0
- package/dist/v1/schema/revision.d.ts +1 -0
- package/dist/v1/schema/revision.js +1 -0
- package/dist/v1/schema/validation/class.d.ts +5 -0
- package/dist/v1/schema/validation/class.js +208 -0
- package/dist/v1/schema/validation/core.d.ts +5 -0
- package/dist/v1/schema/validation/core.js +264 -0
- package/dist/v1/schema/validation/domain.d.ts +11 -0
- package/dist/v1/schema/validation/domain.js +36 -0
- package/dist/v1/schema/validation/domain.route.d.ts +4 -0
- package/dist/v1/schema/validation/domain.route.js +32 -0
- package/dist/v1/schema/validation/domain.structure.d.ts +4 -0
- package/dist/v1/schema/validation/domain.structure.js +427 -0
- package/dist/v1/schema/validation/policy/budgets.d.ts +4 -0
- package/dist/v1/schema/validation/policy/budgets.js +102 -0
- package/dist/v1/schema/validation/policy/context.d.ts +28 -0
- package/dist/v1/schema/validation/policy/context.js +89 -0
- package/dist/v1/schema/validation/policy/references.d.ts +2 -0
- package/dist/v1/schema/validation/policy/references.js +143 -0
- package/dist/v1/schema/validation/policy/typing.d.ts +19 -0
- package/dist/v1/schema/validation/policy/typing.js +318 -0
- package/dist/v1/schema/validation/policy/uses.d.ts +5 -0
- package/dist/v1/schema/validation/policy/uses.js +258 -0
- package/dist/v1/schema/validation/policy/validate.d.ts +11 -0
- package/dist/v1/schema/validation/policy/validate.js +23 -0
- package/dist/v1/schema/validation/value-api.d.ts +13 -0
- package/dist/v1/schema/validation/value-api.js +23 -0
- package/dist/v1/schema/validation/value.d.ts +4 -0
- package/dist/v1/schema/validation/value.js +39 -0
- package/dist/v1/schema/validation/view.d.ts +3 -0
- package/dist/v1/schema/validation/view.js +29 -0
- package/dist/v1/value/full-match.d.ts +2 -0
- package/dist/v1/value/full-match.js +2 -0
- package/dist/v1.d.ts +2 -0
- package/dist/v1.js +2 -0
- package/dist/value/accept.d.ts +8 -0
- package/dist/value/accept.js +132 -0
- package/dist/value/canonical.d.ts +4 -0
- package/dist/value/canonical.js +41 -0
- package/dist/value/decode.d.ts +4 -0
- package/dist/value/decode.js +108 -0
- package/dist/value/equal.d.ts +3 -0
- package/dist/value/equal.js +5 -0
- package/dist/value/error.d.ts +12 -0
- package/dist/value/error.js +21 -0
- package/dist/value/index.d.ts +9 -0
- package/dist/value/index.js +6 -0
- package/dist/value/json.d.ts +3 -0
- package/dist/value/json.js +3 -0
- package/dist/value/limits.d.ts +21 -0
- package/dist/value/limits.js +15 -0
- package/dist/value/types.d.ts +6 -0
- package/dist/value/types.js +1 -0
- package/dist/value/unicode.d.ts +4 -0
- package/dist/value/unicode.js +64 -0
- package/dist/version/dispatch.d.ts +24 -0
- package/dist/version/dispatch.js +47 -0
- package/dist/version/index.d.ts +2 -0
- package/dist/version/index.js +1 -0
- package/package.json +75 -15
- package/dist/builders/bitmask.d.ts +0 -5
- package/dist/builders/bitmask.d.ts.map +0 -1
- package/dist/builders/bitmask.js +0 -12
- package/dist/builders/bitmask.js.map +0 -1
- package/dist/builders/data.d.ts +0 -7
- package/dist/builders/data.d.ts.map +0 -1
- package/dist/builders/data.js +0 -18
- package/dist/builders/data.js.map +0 -1
- package/dist/builders/definition/base.d.ts +0 -13
- package/dist/builders/definition/base.d.ts.map +0 -1
- package/dist/builders/definition/base.js +0 -24
- package/dist/builders/definition/base.js.map +0 -1
- package/dist/builders/definition/edge-class.d.ts +0 -8
- package/dist/builders/definition/edge-class.d.ts.map +0 -1
- package/dist/builders/definition/edge-class.js +0 -9
- package/dist/builders/definition/edge-class.js.map +0 -1
- package/dist/builders/definition/edge-interface.d.ts +0 -8
- package/dist/builders/definition/edge-interface.d.ts.map +0 -1
- package/dist/builders/definition/edge-interface.js +0 -9
- package/dist/builders/definition/edge-interface.js.map +0 -1
- package/dist/builders/definition/node-class.d.ts +0 -7
- package/dist/builders/definition/node-class.d.ts.map +0 -1
- package/dist/builders/definition/node-class.js +0 -9
- package/dist/builders/definition/node-class.js.map +0 -1
- package/dist/builders/definition/node-interface.d.ts +0 -7
- package/dist/builders/definition/node-interface.d.ts.map +0 -1
- package/dist/builders/definition/node-interface.js +0 -9
- package/dist/builders/definition/node-interface.js.map +0 -1
- package/dist/builders/function.d.ts +0 -34
- package/dist/builders/function.d.ts.map +0 -1
- package/dist/builders/function.js +0 -8
- package/dist/builders/function.js.map +0 -1
- package/dist/builders/policy.d.ts +0 -10
- package/dist/builders/policy.d.ts.map +0 -1
- package/dist/builders/policy.js +0 -28
- package/dist/builders/policy.js.map +0 -1
- package/dist/builders/prop.d.ts +0 -7
- package/dist/builders/prop.d.ts.map +0 -1
- package/dist/builders/prop.js +0 -9
- package/dist/builders/prop.js.map +0 -1
- package/dist/builders/ref.d.ts +0 -12
- package/dist/builders/ref.d.ts.map +0 -1
- package/dist/builders/ref.js +0 -27
- package/dist/builders/ref.js.map +0 -1
- package/dist/grammar/definition/base.d.ts +0 -13
- package/dist/grammar/definition/base.d.ts.map +0 -1
- package/dist/grammar/definition/base.js +0 -2
- package/dist/grammar/definition/base.js.map +0 -1
- package/dist/grammar/definition/discriminants.d.ts +0 -31
- package/dist/grammar/definition/discriminants.d.ts.map +0 -1
- package/dist/grammar/definition/discriminants.js +0 -33
- package/dist/grammar/definition/discriminants.js.map +0 -1
- package/dist/grammar/definition/edge-class.d.ts +0 -19
- package/dist/grammar/definition/edge-class.d.ts.map +0 -1
- package/dist/grammar/definition/edge-class.js +0 -2
- package/dist/grammar/definition/edge-class.js.map +0 -1
- package/dist/grammar/definition/edge-interface.d.ts +0 -18
- package/dist/grammar/definition/edge-interface.d.ts.map +0 -1
- package/dist/grammar/definition/edge-interface.js +0 -2
- package/dist/grammar/definition/edge-interface.js.map +0 -1
- package/dist/grammar/definition/node-class.d.ts +0 -26
- package/dist/grammar/definition/node-class.d.ts.map +0 -1
- package/dist/grammar/definition/node-class.js +0 -2
- package/dist/grammar/definition/node-class.js.map +0 -1
- package/dist/grammar/definition/node-interface.d.ts +0 -14
- package/dist/grammar/definition/node-interface.d.ts.map +0 -1
- package/dist/grammar/definition/node-interface.js +0 -2
- package/dist/grammar/definition/node-interface.js.map +0 -1
- package/dist/grammar/facets/constraints.d.ts +0 -8
- package/dist/grammar/facets/constraints.d.ts.map +0 -1
- package/dist/grammar/facets/constraints.js +0 -2
- package/dist/grammar/facets/constraints.js.map +0 -1
- package/dist/grammar/facets/content.d.ts +0 -4
- package/dist/grammar/facets/content.d.ts.map +0 -1
- package/dist/grammar/facets/content.js +0 -2
- package/dist/grammar/facets/content.js.map +0 -1
- package/dist/grammar/facets/endpoints.d.ts +0 -14
- package/dist/grammar/facets/endpoints.d.ts.map +0 -1
- package/dist/grammar/facets/endpoints.js +0 -3
- package/dist/grammar/facets/endpoints.js.map +0 -1
- package/dist/grammar/facets/indexes.d.ts +0 -12
- package/dist/grammar/facets/indexes.d.ts.map +0 -1
- package/dist/grammar/facets/indexes.js +0 -9
- package/dist/grammar/facets/indexes.js.map +0 -1
- package/dist/grammar/facets/properties.d.ts +0 -26
- package/dist/grammar/facets/properties.d.ts.map +0 -1
- package/dist/grammar/facets/properties.js +0 -45
- package/dist/grammar/facets/properties.js.map +0 -1
- package/dist/grammar/function/config.d.ts +0 -16
- package/dist/grammar/function/config.d.ts.map +0 -1
- package/dist/grammar/function/config.js +0 -2
- package/dist/grammar/function/config.js.map +0 -1
- package/dist/grammar/function/def.d.ts +0 -58
- package/dist/grammar/function/def.d.ts.map +0 -1
- package/dist/grammar/function/def.js +0 -2
- package/dist/grammar/function/def.js.map +0 -1
- package/dist/grammar/function/inheritance.d.ts +0 -3
- package/dist/grammar/function/inheritance.d.ts.map +0 -1
- package/dist/grammar/function/inheritance.js +0 -2
- package/dist/grammar/function/inheritance.js.map +0 -1
- package/dist/grammar/function/output.d.ts +0 -3
- package/dist/grammar/function/output.d.ts.map +0 -1
- package/dist/grammar/function/output.js +0 -2
- package/dist/grammar/function/output.js.map +0 -1
- package/dist/grammar/policy/callable.d.ts +0 -40
- package/dist/grammar/policy/callable.d.ts.map +0 -1
- package/dist/grammar/policy/callable.js +0 -2
- package/dist/grammar/policy/callable.js.map +0 -1
- package/dist/grammar/policy/def.d.ts +0 -27
- package/dist/grammar/policy/def.d.ts.map +0 -1
- package/dist/grammar/policy/def.js +0 -2
- package/dist/grammar/policy/def.js.map +0 -1
- package/dist/grammar/policy/pattern.d.ts +0 -34
- package/dist/grammar/policy/pattern.d.ts.map +0 -1
- package/dist/grammar/policy/pattern.js +0 -2
- package/dist/grammar/policy/pattern.js.map +0 -1
- package/dist/grammar/values/bitmask.d.ts +0 -7
- package/dist/grammar/values/bitmask.d.ts.map +0 -1
- package/dist/grammar/values/bitmask.js +0 -2
- package/dist/grammar/values/bitmask.js.map +0 -1
- package/dist/grammar/values/data.d.ts +0 -30
- package/dist/grammar/values/data.d.ts.map +0 -1
- package/dist/grammar/values/data.js +0 -2
- package/dist/grammar/values/data.js.map +0 -1
- package/dist/grammar/values/ref.d.ts +0 -26
- package/dist/grammar/values/ref.d.ts.map +0 -1
- package/dist/grammar/values/ref.js +0 -2
- package/dist/grammar/values/ref.js.map +0 -1
- package/dist/grammar/values/self.d.ts +0 -12
- package/dist/grammar/values/self.d.ts.map +0 -1
- package/dist/grammar/values/self.js +0 -6
- package/dist/grammar/values/self.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inference/content.d.ts +0 -27
- package/dist/inference/content.d.ts.map +0 -1
- package/dist/inference/content.js +0 -2
- package/dist/inference/content.js.map +0 -1
- package/dist/inference/index.d.ts +0 -7
- package/dist/inference/index.d.ts.map +0 -1
- package/dist/inference/index.js +0 -2
- package/dist/inference/index.js.map +0 -1
- package/dist/inference/inheritance.d.ts +0 -48
- package/dist/inference/inheritance.d.ts.map +0 -1
- package/dist/inference/inheritance.js +0 -2
- package/dist/inference/inheritance.js.map +0 -1
- package/dist/inference/input.d.ts +0 -30
- package/dist/inference/input.d.ts.map +0 -1
- package/dist/inference/input.js +0 -2
- package/dist/inference/input.js.map +0 -1
- package/dist/inference/methods.d.ts +0 -69
- package/dist/inference/methods.d.ts.map +0 -1
- package/dist/inference/methods.js +0 -2
- package/dist/inference/methods.js.map +0 -1
- package/dist/inference/properties.d.ts +0 -37
- package/dist/inference/properties.d.ts.map +0 -1
- package/dist/inference/properties.js +0 -2
- package/dist/inference/properties.js.map +0 -1
- package/dist/inference/schema.d.ts +0 -37
- package/dist/inference/schema.d.ts.map +0 -1
- package/dist/inference/schema.js +0 -2
- package/dist/inference/schema.js.map +0 -1
- package/dist/instance/core/define.d.ts +0 -13
- package/dist/instance/core/define.d.ts.map +0 -1
- package/dist/instance/core/define.js +0 -63
- package/dist/instance/core/define.js.map +0 -1
- package/dist/instance/core/edge.d.ts +0 -9
- package/dist/instance/core/edge.d.ts.map +0 -1
- package/dist/instance/core/edge.js +0 -11
- package/dist/instance/core/edge.js.map +0 -1
- package/dist/instance/core/endpoint.d.ts +0 -11
- package/dist/instance/core/endpoint.d.ts.map +0 -1
- package/dist/instance/core/endpoint.js +0 -19
- package/dist/instance/core/endpoint.js.map +0 -1
- package/dist/instance/core/node.d.ts +0 -7
- package/dist/instance/core/node.d.ts.map +0 -1
- package/dist/instance/core/node.js +0 -9
- package/dist/instance/core/node.js.map +0 -1
- package/dist/instance/core/path.d.ts +0 -21
- package/dist/instance/core/path.d.ts.map +0 -1
- package/dist/instance/core/path.js +0 -21
- package/dist/instance/core/path.js.map +0 -1
- package/dist/instance/core/self.d.ts +0 -15
- package/dist/instance/core/self.d.ts.map +0 -1
- package/dist/instance/core/self.js +0 -8
- package/dist/instance/core/self.js.map +0 -1
- package/dist/instance/core/types.d.ts +0 -45
- package/dist/instance/core/types.d.ts.map +0 -1
- package/dist/instance/core/types.js +0 -2
- package/dist/instance/core/types.js.map +0 -1
- package/dist/instance/seed/define.d.ts +0 -12
- package/dist/instance/seed/define.d.ts.map +0 -1
- package/dist/instance/seed/define.js +0 -34
- package/dist/instance/seed/define.js.map +0 -1
- package/dist/instance/seed/types.d.ts +0 -12
- package/dist/instance/seed/types.d.ts.map +0 -1
- package/dist/instance/seed/types.js +0 -2
- package/dist/instance/seed/types.js.map +0 -1
- package/dist/ir/classes.d.ts +0 -78
- package/dist/ir/classes.d.ts.map +0 -1
- package/dist/ir/classes.js +0 -2
- package/dist/ir/classes.js.map +0 -1
- package/dist/ir/domain.d.ts +0 -13
- package/dist/ir/domain.d.ts.map +0 -1
- package/dist/ir/domain.js +0 -2
- package/dist/ir/domain.js.map +0 -1
- package/dist/ir/endpoints.d.ts +0 -27
- package/dist/ir/endpoints.d.ts.map +0 -1
- package/dist/ir/endpoints.js +0 -2
- package/dist/ir/endpoints.js.map +0 -1
- package/dist/ir/functions.d.ts +0 -34
- package/dist/ir/functions.d.ts.map +0 -1
- package/dist/ir/functions.js +0 -2
- package/dist/ir/functions.js.map +0 -1
- package/dist/ir/index.d.ts +0 -9
- package/dist/ir/index.d.ts.map +0 -1
- package/dist/ir/index.js +0 -2
- package/dist/ir/index.js.map +0 -1
- package/dist/ir/ir.d.ts +0 -75
- package/dist/ir/ir.d.ts.map +0 -1
- package/dist/ir/ir.js +0 -5
- package/dist/ir/ir.js.map +0 -1
- package/dist/ir/json-schema.d.ts +0 -20
- package/dist/ir/json-schema.d.ts.map +0 -1
- package/dist/ir/json-schema.js +0 -2
- package/dist/ir/json-schema.js.map +0 -1
- package/dist/ir/policies.d.ts +0 -74
- package/dist/ir/policies.d.ts.map +0 -1
- package/dist/ir/policies.js +0 -2
- package/dist/ir/policies.js.map +0 -1
- package/dist/schema/classify.d.ts +0 -8
- package/dist/schema/classify.d.ts.map +0 -1
- package/dist/schema/classify.js +0 -20
- package/dist/schema/classify.js.map +0 -1
- package/dist/schema/define.d.ts +0 -23
- package/dist/schema/define.d.ts.map +0 -1
- package/dist/schema/define.js +0 -58
- package/dist/schema/define.js.map +0 -1
- package/dist/schema/error.d.ts +0 -8
- package/dist/schema/error.d.ts.map +0 -1
- package/dist/schema/error.js +0 -14
- package/dist/schema/error.js.map +0 -1
- package/dist/schema/refs.d.ts +0 -77
- package/dist/schema/refs.d.ts.map +0 -1
- package/dist/schema/refs.js +0 -100
- package/dist/schema/refs.js.map +0 -1
- package/dist/schema/resolve/index.d.ts +0 -5
- package/dist/schema/resolve/index.d.ts.map +0 -1
- package/dist/schema/resolve/index.js +0 -5
- package/dist/schema/resolve/index.js.map +0 -1
- package/dist/schema/resolve/methods.d.ts +0 -8
- package/dist/schema/resolve/methods.d.ts.map +0 -1
- package/dist/schema/resolve/methods.js +0 -18
- package/dist/schema/resolve/methods.js.map +0 -1
- package/dist/schema/resolve/properties.d.ts +0 -13
- package/dist/schema/resolve/properties.d.ts.map +0 -1
- package/dist/schema/resolve/properties.js +0 -37
- package/dist/schema/resolve/properties.js.map +0 -1
- package/dist/schema/resolve/self.d.ts +0 -7
- package/dist/schema/resolve/self.d.ts.map +0 -1
- package/dist/schema/resolve/self.js +0 -33
- package/dist/schema/resolve/self.js.map +0 -1
- package/dist/schema/resolve/thunks.d.ts +0 -12
- package/dist/schema/resolve/thunks.d.ts.map +0 -1
- package/dist/schema/resolve/thunks.js +0 -37
- package/dist/schema/resolve/thunks.js.map +0 -1
- package/dist/schema/schema.d.ts +0 -25
- package/dist/schema/schema.d.ts.map +0 -1
- package/dist/schema/schema.js +0 -2
- package/dist/schema/schema.js.map +0 -1
- package/dist/schema/validators/context.d.ts +0 -17
- package/dist/schema/validators/context.d.ts.map +0 -1
- package/dist/schema/validators/context.js +0 -2
- package/dist/schema/validators/context.js.map +0 -1
- package/dist/schema/validators/endpoints.d.ts +0 -4
- package/dist/schema/validators/endpoints.d.ts.map +0 -1
- package/dist/schema/validators/endpoints.js +0 -27
- package/dist/schema/validators/endpoints.js.map +0 -1
- package/dist/schema/validators/index.d.ts +0 -12
- package/dist/schema/validators/index.d.ts.map +0 -1
- package/dist/schema/validators/index.js +0 -25
- package/dist/schema/validators/index.js.map +0 -1
- package/dist/schema/validators/indexes.d.ts +0 -4
- package/dist/schema/validators/indexes.d.ts.map +0 -1
- package/dist/schema/validators/indexes.js +0 -19
- package/dist/schema/validators/indexes.js.map +0 -1
- package/dist/schema/validators/inheritance.d.ts +0 -4
- package/dist/schema/validators/inheritance.d.ts.map +0 -1
- package/dist/schema/validators/inheritance.js +0 -27
- package/dist/schema/validators/inheritance.js.map +0 -1
- package/dist/schema/validators/methods.d.ts +0 -9
- package/dist/schema/validators/methods.d.ts.map +0 -1
- package/dist/schema/validators/methods.js +0 -44
- package/dist/schema/validators/methods.js.map +0 -1
- package/dist/schema/validators/names.d.ts +0 -4
- package/dist/schema/validators/names.d.ts.map +0 -1
- package/dist/schema/validators/names.js +0 -19
- package/dist/schema/validators/names.js.map +0 -1
- package/dist/schema/validators/policies.d.ts +0 -4
- package/dist/schema/validators/policies.d.ts.map +0 -1
- package/dist/schema/validators/policies.js +0 -61
- package/dist/schema/validators/policies.js.map +0 -1
- package/dist/schema/validators/ref-targets.d.ts +0 -4
- package/dist/schema/validators/ref-targets.d.ts.map +0 -1
- package/dist/schema/validators/ref-targets.js +0 -54
- package/dist/schema/validators/ref-targets.js.map +0 -1
- package/dist/serializer/context.d.ts +0 -35
- package/dist/serializer/context.d.ts.map +0 -1
- package/dist/serializer/context.js +0 -359
- package/dist/serializer/context.js.map +0 -1
- package/dist/serializer/helpers.d.ts +0 -34
- package/dist/serializer/helpers.d.ts.map +0 -1
- package/dist/serializer/helpers.js +0 -116
- package/dist/serializer/helpers.js.map +0 -1
- package/dist/serializer/index.d.ts +0 -2
- package/dist/serializer/index.d.ts.map +0 -1
- package/dist/serializer/index.js +0 -2
- package/dist/serializer/index.js.map +0 -1
- package/dist/serializer/policies.d.ts +0 -34
- package/dist/serializer/policies.d.ts.map +0 -1
- package/dist/serializer/policies.js +0 -837
- package/dist/serializer/policies.js.map +0 -1
- package/dist/serializer/policy-typing.d.ts +0 -56
- package/dist/serializer/policy-typing.d.ts.map +0 -1
- package/dist/serializer/policy-typing.js +0 -490
- package/dist/serializer/policy-typing.js.map +0 -1
- package/dist/serializer/serialize.d.ts +0 -12
- package/dist/serializer/serialize.d.ts.map +0 -1
- package/dist/serializer/serialize.js +0 -6
- package/dist/serializer/serialize.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { json } from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { acceptCompiledSchema } from '../admission/accept.js';
|
|
3
|
+
export function encode(schema) {
|
|
4
|
+
return new TextEncoder().encode(json.serialize(schema));
|
|
5
|
+
}
|
|
6
|
+
export function decode(input) {
|
|
7
|
+
const text = typeof input === 'string' ? input : new TextDecoder().decode(input);
|
|
8
|
+
return acceptCompiledSchema(json.decode(text));
|
|
9
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DomainOfSchema, DomainSchema } from '../../schema/model/schema.js';
|
|
2
|
+
import type { CompiledSchema } from '../model/schema.js';
|
|
3
|
+
/** Compile one admitted source closure into deterministic, dependency-closed Domain data. */
|
|
4
|
+
export declare function compile<const Schema extends DomainSchema>(schema: Schema): CompiledSchema<DomainOfSchema<Schema>>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { inputFieldNodes } from '../../language/value/compile/fields.js';
|
|
2
|
+
import { prepareValueSchema } from '../../language/value/evaluate/preparation.js';
|
|
3
|
+
import { classifyOrdering } from '../../language/value/ordering.js';
|
|
4
|
+
import { revisionOfDomainSchema } from '../../schema/canonical/revision.js';
|
|
5
|
+
import { lookupForDomainClosure, requireDomainClosure } from '../../schema/resolution/closure.js';
|
|
6
|
+
import { createDomainValueSchemaRegistry } from '../../schema/resolution/value.registry.js';
|
|
7
|
+
/** Compile one admitted source closure into deterministic, dependency-closed Domain data. */
|
|
8
|
+
export function compile(schema) {
|
|
9
|
+
const lookup = lookupForDomainClosure(schema);
|
|
10
|
+
const sources = [
|
|
11
|
+
schema,
|
|
12
|
+
...requireDomainClosure(schema).map(({ schema: dependency }) => dependency),
|
|
13
|
+
]
|
|
14
|
+
.filter((value, index, all) => all.findIndex(({ origin }) => origin === value.origin) === index)
|
|
15
|
+
.sort((left, right) => compare(left.origin, right.origin));
|
|
16
|
+
const closure = Object.freeze(sources.map((source) => compileEntry(source, lookup)));
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
format: 'astrale.dsl.compiled-schema',
|
|
19
|
+
version: 1,
|
|
20
|
+
root: Object.freeze({ origin: schema.origin, revision: revisionOfDomainSchema(schema) }),
|
|
21
|
+
closure,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function compileEntry(schema, lookup) {
|
|
25
|
+
const registry = createDomainValueSchemaRegistry(schema, lookup);
|
|
26
|
+
const values = [];
|
|
27
|
+
const add = (contract, pointer) => {
|
|
28
|
+
const result = prepareValueSchema(contract, registry, pointer);
|
|
29
|
+
if (!result.compiled)
|
|
30
|
+
throw new TypeError(`Cannot compile ValueSchema: ${result.message}`);
|
|
31
|
+
return values.push(result.value.program()) - 1;
|
|
32
|
+
};
|
|
33
|
+
const properties = (definition, pointer) => Object.entries(definition.properties)
|
|
34
|
+
.sort(([left], [right]) => compare(left, right))
|
|
35
|
+
.map(([name, property]) => {
|
|
36
|
+
const ordering = classifyOrdering(property.schema, registry);
|
|
37
|
+
return {
|
|
38
|
+
name,
|
|
39
|
+
required: property.required,
|
|
40
|
+
visibility: property.visibility,
|
|
41
|
+
...(property.auto === undefined ? {} : { auto: property.auto }),
|
|
42
|
+
...(property.description === undefined ? {} : { description: property.description }),
|
|
43
|
+
...(ordering === undefined ? {} : { ordering }),
|
|
44
|
+
value: add(property.schema, `${pointer}/properties/${name}/schema`),
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
const output = (value, pointer) => value.mode === 'binary'
|
|
48
|
+
? { mode: 'binary' }
|
|
49
|
+
: {
|
|
50
|
+
mode: value.mode,
|
|
51
|
+
value: add(value.mode === 'value' ? value.schema : value.item, pointer),
|
|
52
|
+
};
|
|
53
|
+
const classes = Object.values(schema.classes)
|
|
54
|
+
.sort((left, right) => compare(left.ref.name, right.ref.name))
|
|
55
|
+
.map((definition) => {
|
|
56
|
+
const pointer = `/classes/${definition.ref.name}`;
|
|
57
|
+
if (definition.kind === 'edge') {
|
|
58
|
+
const { properties: _, ...rest } = definition;
|
|
59
|
+
return { ...rest, properties: properties(definition, pointer) };
|
|
60
|
+
}
|
|
61
|
+
const { properties: _, methods: __, ...rest } = definition;
|
|
62
|
+
const methods = Object.entries(definition.methods)
|
|
63
|
+
.sort(([left], [right]) => compare(left, right))
|
|
64
|
+
.map(([name, method]) => {
|
|
65
|
+
const input = add(method.input, `${pointer}/methods/${name}/input`);
|
|
66
|
+
const fields = inputFieldNodes(values[input]);
|
|
67
|
+
return {
|
|
68
|
+
name,
|
|
69
|
+
auth: method.auth,
|
|
70
|
+
...(method.policy === undefined ? {} : { policy: method.policy }),
|
|
71
|
+
...(method.description === undefined ? {} : { description: method.description }),
|
|
72
|
+
static: method.static,
|
|
73
|
+
inheritance: method.inheritance,
|
|
74
|
+
input,
|
|
75
|
+
...(fields === undefined ? {} : { fields }),
|
|
76
|
+
output: output(method.output, `${pointer}/methods/${name}/output`),
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
return { ...rest, properties: properties(definition, pointer), methods };
|
|
80
|
+
});
|
|
81
|
+
const functions = Object.values(schema.functions)
|
|
82
|
+
.sort((left, right) => compare(left.ref.name, right.ref.name))
|
|
83
|
+
.map((definition) => {
|
|
84
|
+
const input = add(definition.input, `/functions/${definition.ref.name}/input`);
|
|
85
|
+
const fields = inputFieldNodes(values[input]);
|
|
86
|
+
return {
|
|
87
|
+
ref: definition.ref,
|
|
88
|
+
auth: definition.auth,
|
|
89
|
+
...(definition.policy === undefined ? {} : { policy: definition.policy }),
|
|
90
|
+
...(definition.description === undefined ? {} : { description: definition.description }),
|
|
91
|
+
input,
|
|
92
|
+
...(fields === undefined ? {} : { fields }),
|
|
93
|
+
output: output(definition.output, `/functions/${definition.ref.name}/output`),
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
return Object.freeze({
|
|
97
|
+
origin: schema.origin,
|
|
98
|
+
revision: revisionOfDomainSchema(schema),
|
|
99
|
+
dependencies: schema.dependencies,
|
|
100
|
+
definitions: Object.freeze({
|
|
101
|
+
classes: Object.freeze(classes),
|
|
102
|
+
functions: Object.freeze(functions),
|
|
103
|
+
policies: Object.freeze(Object.values(schema.policies)),
|
|
104
|
+
views: Object.freeze(Object.values(schema.views)),
|
|
105
|
+
core: Object.freeze(Object.values(schema.core.nodes)),
|
|
106
|
+
}),
|
|
107
|
+
facts: Object.freeze({ core: schema.core.edges }),
|
|
108
|
+
values: Object.freeze(values),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function compare(left, right) {
|
|
112
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
113
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type CompiledDiagnosticCode = 'COMPILED_CANONICAL_MISMATCH' | 'COMPILED_DEPENDENCY_CYCLE' | 'COMPILED_DEPENDENCY_LIMITS' | 'COMPILED_SOURCE_INVALID' | 'COMPILED_STRUCTURE_INVALID';
|
|
2
|
+
export interface CompiledDiagnostic<out Code extends CompiledDiagnosticCode = CompiledDiagnosticCode> {
|
|
3
|
+
readonly code: Code;
|
|
4
|
+
readonly pointer: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class CompiledSchemaError extends Error {
|
|
8
|
+
readonly diagnostics: readonly CompiledDiagnostic[];
|
|
9
|
+
constructor(diagnostics: readonly CompiledDiagnostic[], options?: ErrorOptions);
|
|
10
|
+
}
|
|
11
|
+
export declare function invalidCompiled(code: CompiledDiagnosticCode, message: string, pointer: string, options?: ErrorOptions): never;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class CompiledSchemaError extends Error {
|
|
2
|
+
diagnostics;
|
|
3
|
+
constructor(diagnostics, options) {
|
|
4
|
+
super(diagnostics
|
|
5
|
+
.map(({ code, pointer, message }) => `${pointer || '/'} [${code}] ${message}`)
|
|
6
|
+
.join('\n'), options);
|
|
7
|
+
this.name = 'CompiledSchemaError';
|
|
8
|
+
this.diagnostics = Object.freeze([...diagnostics]);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function invalidCompiled(code, message, pointer, options) {
|
|
12
|
+
throw new CompiledSchemaError([Object.freeze({ code, pointer, message })], options);
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { acceptCompiledSchema as accept } from './admission/accept.js';
|
|
2
|
+
export { compile } from './compiler/compile.js';
|
|
3
|
+
export { decode, encode } from './codec/json.js';
|
|
4
|
+
export { load } from './loader/load.js';
|
|
5
|
+
export { CompiledSchemaError as Error } from './diagnostic.js';
|
|
6
|
+
export type { CompiledDiagnostic as Diagnostic, CompiledDiagnosticCode as DiagnosticCode, } from './diagnostic.js';
|
|
7
|
+
export type * from './model/schema.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { acceptCompiledSchema as accept } from './admission/accept.js';
|
|
2
|
+
export { compile } from './compiler/compile.js';
|
|
3
|
+
export { decode, encode } from './codec/json.js';
|
|
4
|
+
export { load } from './loader/load.js';
|
|
5
|
+
export { CompiledSchemaError as Error } from './diagnostic.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { load } from './load.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { load } from './load.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CompiledSchema, DomainOfCompiled } from '../model/schema.js';
|
|
2
|
+
/** Load admitted compiled data through the one resolved Domain constructor. */
|
|
3
|
+
export declare function load<const Input extends CompiledSchema>(input: Input): DomainOfCompiled<Input>;
|
|
4
|
+
export declare function load(input: unknown): import('../../domain/model/domain.js').Domain;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Key, MethodKey, PropertyKey as PropertyKeyValue } from '../../addressing/index.js';
|
|
2
|
+
import { compareUnicode } from '../../addressing/ordering.js';
|
|
3
|
+
import { createDomain } from '../../domain/create.js';
|
|
4
|
+
import { combineDomainValidation, createDomainValidation, unknownInputField, } from '../../domain/validation/create.js';
|
|
5
|
+
import { validateValueProgram } from '../../language/value/evaluate/program.js';
|
|
6
|
+
import { acceptCompiledSchema } from '../admission/accept.js';
|
|
7
|
+
export function load(input) {
|
|
8
|
+
const compiled = acceptCompiledSchema(input);
|
|
9
|
+
const entries = new Map(compiled.closure.map((entry) => [entry.origin, loadEntry(entry)]));
|
|
10
|
+
const root = entries.get(compiled.root.origin);
|
|
11
|
+
if (root === undefined || root.entry.revision !== compiled.root.revision) {
|
|
12
|
+
throw new TypeError('Compiled root is absent or has the wrong revision.');
|
|
13
|
+
}
|
|
14
|
+
return createDomain({
|
|
15
|
+
root: compiled.root,
|
|
16
|
+
entries: Object.freeze([...entries.values()]
|
|
17
|
+
.map(({ entry, definitions }) => Object.freeze({
|
|
18
|
+
origin: entry.origin,
|
|
19
|
+
revision: entry.revision,
|
|
20
|
+
dependencies: entry.dependencies,
|
|
21
|
+
definitions,
|
|
22
|
+
coreEdges: entry.facts.core,
|
|
23
|
+
}))
|
|
24
|
+
.sort((left, right) => compareUnicode(left.origin, right.origin))),
|
|
25
|
+
validation: combineDomainValidation([...entries.values()].map(({ validation }) => validation)),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function loadEntry(entry) {
|
|
29
|
+
const propertyPrograms = new Map();
|
|
30
|
+
const propertyOrdering = new Map();
|
|
31
|
+
const callablePrograms = new Map();
|
|
32
|
+
const classes = entry.definitions.classes.map((compiled) => {
|
|
33
|
+
const properties = Object.fromEntries(compiled.properties.map(({ name, value, ordering, ...definition }) => {
|
|
34
|
+
const key = PropertyKeyValue.of(compiled.ref, name);
|
|
35
|
+
propertyPrograms.set(key, value);
|
|
36
|
+
if (ordering !== undefined)
|
|
37
|
+
propertyOrdering.set(key, ordering);
|
|
38
|
+
return [name, { ...definition, schema: schemaOf(entry, value) }];
|
|
39
|
+
}));
|
|
40
|
+
if (compiled.kind === 'edge') {
|
|
41
|
+
const { properties: _, ...definition } = compiled;
|
|
42
|
+
return Object.freeze({ ...definition, properties });
|
|
43
|
+
}
|
|
44
|
+
const { properties: _, methods: __, ...definition } = compiled;
|
|
45
|
+
const methods = Object.fromEntries(compiled.methods.map((method) => {
|
|
46
|
+
const key = MethodKey.of(compiled.ref, method.name);
|
|
47
|
+
callablePrograms.set(key, callableProgram(method));
|
|
48
|
+
return [method.name, loadMethod(entry, method)];
|
|
49
|
+
}));
|
|
50
|
+
return Object.freeze({ ...definition, properties, methods });
|
|
51
|
+
});
|
|
52
|
+
const functions = entry.definitions.functions.map((compiled) => {
|
|
53
|
+
callablePrograms.set(Key.of(compiled.ref), callableProgram(compiled));
|
|
54
|
+
return loadFunction(entry, compiled);
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
entry,
|
|
58
|
+
definitions: Object.freeze([
|
|
59
|
+
...classes,
|
|
60
|
+
...functions,
|
|
61
|
+
...entry.definitions.policies,
|
|
62
|
+
...entry.definitions.views,
|
|
63
|
+
...entry.definitions.core,
|
|
64
|
+
]),
|
|
65
|
+
validation: programValidation(entry.values, propertyPrograms, propertyOrdering, callablePrograms),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function loadMethod(entry, value) {
|
|
69
|
+
const { name: _, input, fields: __, output, ...definition } = value;
|
|
70
|
+
return Object.freeze({
|
|
71
|
+
...definition,
|
|
72
|
+
input: schemaOf(entry, input),
|
|
73
|
+
output: loadOutput(entry, output),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function loadFunction(entry, value) {
|
|
77
|
+
const { input, fields: _, output, ...definition } = value;
|
|
78
|
+
return Object.freeze({
|
|
79
|
+
...definition,
|
|
80
|
+
input: schemaOf(entry, input),
|
|
81
|
+
output: loadOutput(entry, output),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function loadOutput(entry, output) {
|
|
85
|
+
if (output.mode === 'binary')
|
|
86
|
+
return output;
|
|
87
|
+
const schema = schemaOf(entry, output.value);
|
|
88
|
+
return output.mode === 'value'
|
|
89
|
+
? { mode: 'value', schema }
|
|
90
|
+
: { mode: 'stream', item: schema };
|
|
91
|
+
}
|
|
92
|
+
function schemaOf(entry, index) {
|
|
93
|
+
const program = entry.values[index];
|
|
94
|
+
const root = program?.nodes[program.root];
|
|
95
|
+
if (root === undefined)
|
|
96
|
+
throw new TypeError(`Compiled Value program ${index} is absent.`);
|
|
97
|
+
return root.schema;
|
|
98
|
+
}
|
|
99
|
+
function callableProgram(value) {
|
|
100
|
+
return {
|
|
101
|
+
input: value.input,
|
|
102
|
+
...(value.fields === undefined ? {} : { fields: value.fields }),
|
|
103
|
+
...(value.output.mode === 'binary' ? {} : { output: value.output.value }),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function programValidation(programs, properties, propertyOrdering, callables) {
|
|
107
|
+
const propertyValidation = new Map();
|
|
108
|
+
for (const [key, index] of properties) {
|
|
109
|
+
const program = programs[index];
|
|
110
|
+
if (program === undefined)
|
|
111
|
+
throw new TypeError(`Compiled Property program ${index} is absent.`);
|
|
112
|
+
propertyValidation.set(key, Object.freeze({
|
|
113
|
+
ordering: propertyOrdering.get(key),
|
|
114
|
+
validate: (value) => validateValueProgram(program, value),
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
const callableValidation = new Map();
|
|
118
|
+
for (const [key, callable] of callables) {
|
|
119
|
+
const input = programs[callable.input];
|
|
120
|
+
if (input === undefined)
|
|
121
|
+
throw new TypeError(`Compiled Callable input ${callable.input} is absent.`);
|
|
122
|
+
const output = callable.output === undefined ? undefined : programs[callable.output];
|
|
123
|
+
if (callable.output !== undefined && output === undefined) {
|
|
124
|
+
throw new TypeError(`Compiled Callable output ${callable.output} is absent.`);
|
|
125
|
+
}
|
|
126
|
+
callableValidation.set(key, Object.freeze({
|
|
127
|
+
...(callable.fields === undefined
|
|
128
|
+
? {}
|
|
129
|
+
: { fields: Object.freeze(Object.keys(callable.fields)) }),
|
|
130
|
+
validateInput: (value) => validateValueProgram(input, value),
|
|
131
|
+
validateInputField(field, value) {
|
|
132
|
+
const nodes = callable.fields?.[field];
|
|
133
|
+
return nodes === undefined
|
|
134
|
+
? unknownInputField(field)
|
|
135
|
+
: validateValueProgram(input, value, nodes);
|
|
136
|
+
},
|
|
137
|
+
validateOutput: (value) => output === undefined ? [] : validateValueProgram(output, value),
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
return createDomainValidation(propertyValidation, callableValidation);
|
|
141
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Key } from '../../addressing/index.js';
|
|
2
|
+
import type { DomainDependency, DomainDependencyMap, Revision } from '../../addressing/index.js';
|
|
3
|
+
import type { Domain } from '../../domain/model/domain.js';
|
|
4
|
+
import type { MethodDefinition } from '../../language/callable/model/callable.js';
|
|
5
|
+
import type { ClassDefinition } from '../../language/class/model/class.js';
|
|
6
|
+
import type { PropertyDefinition } from '../../language/class/model/property.js';
|
|
7
|
+
import type { CoreDefinition, CoreEdge } from '../../language/core/model/core.js';
|
|
8
|
+
import type { PolicyDefinition } from '../../language/policy/model/policy.js';
|
|
9
|
+
import type { ValueProgram } from '../../language/value/compile/model.js';
|
|
10
|
+
import type { OrderingKind } from '../../language/value/ordering.js';
|
|
11
|
+
import type { ViewDefinition } from '../../language/view/model/view.js';
|
|
12
|
+
export type { Pattern, PatternState, PatternTransition, ScalarRange, ValueNode, ValueProgram, } from '../../language/value/compile/model.js';
|
|
13
|
+
export interface CompiledProperty extends Omit<PropertyDefinition, 'schema'> {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly value: number;
|
|
16
|
+
readonly ordering?: OrderingKind;
|
|
17
|
+
}
|
|
18
|
+
export interface CompiledMethod extends Omit<MethodDefinition, 'input' | 'output'> {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly input: number;
|
|
21
|
+
readonly fields?: Readonly<Record<string, readonly number[]>>;
|
|
22
|
+
readonly output: CompiledOutput;
|
|
23
|
+
}
|
|
24
|
+
export type CompiledOutput = {
|
|
25
|
+
readonly mode: 'value' | 'stream';
|
|
26
|
+
readonly value: number;
|
|
27
|
+
} | {
|
|
28
|
+
readonly mode: 'binary';
|
|
29
|
+
};
|
|
30
|
+
export type CompiledClass = (Omit<Extract<ClassDefinition, {
|
|
31
|
+
readonly kind: 'node';
|
|
32
|
+
}>, 'properties' | 'methods'> & {
|
|
33
|
+
readonly properties: readonly CompiledProperty[];
|
|
34
|
+
readonly methods: readonly CompiledMethod[];
|
|
35
|
+
}) | (Omit<Extract<ClassDefinition, {
|
|
36
|
+
readonly kind: 'edge';
|
|
37
|
+
}>, 'properties'> & {
|
|
38
|
+
readonly properties: readonly CompiledProperty[];
|
|
39
|
+
});
|
|
40
|
+
export interface CompiledFunction extends Omit<import('../../language/callable/model/callable.js').FunctionDefinition, 'input' | 'output'> {
|
|
41
|
+
readonly input: number;
|
|
42
|
+
readonly fields?: Readonly<Record<string, readonly number[]>>;
|
|
43
|
+
readonly output: CompiledOutput;
|
|
44
|
+
}
|
|
45
|
+
export type CompiledPolicy = PolicyDefinition;
|
|
46
|
+
export type CompiledView = ViewDefinition;
|
|
47
|
+
export type CompiledCoreDefinition = CoreDefinition;
|
|
48
|
+
export type CompiledCoreEdge = CoreEdge;
|
|
49
|
+
export interface CompiledSchemaEntry {
|
|
50
|
+
readonly origin: Key.Origin;
|
|
51
|
+
readonly revision: Revision;
|
|
52
|
+
readonly dependencies: DomainDependencyMap;
|
|
53
|
+
readonly definitions: {
|
|
54
|
+
readonly classes: readonly CompiledClass[];
|
|
55
|
+
readonly functions: readonly CompiledFunction[];
|
|
56
|
+
readonly policies: readonly PolicyDefinition[];
|
|
57
|
+
readonly views: readonly ViewDefinition[];
|
|
58
|
+
readonly core: readonly CoreDefinition[];
|
|
59
|
+
};
|
|
60
|
+
readonly facts: {
|
|
61
|
+
readonly core: readonly CoreEdge[];
|
|
62
|
+
};
|
|
63
|
+
readonly values: readonly ValueProgram[];
|
|
64
|
+
}
|
|
65
|
+
declare const COMPILED_DOMAIN: unique symbol;
|
|
66
|
+
export interface CompiledSchema<Resolved = Domain> {
|
|
67
|
+
readonly format: 'astrale.dsl.compiled-schema';
|
|
68
|
+
readonly version: 1;
|
|
69
|
+
readonly root: DomainDependency;
|
|
70
|
+
readonly closure: readonly CompiledSchemaEntry[];
|
|
71
|
+
readonly [COMPILED_DOMAIN]?: Resolved;
|
|
72
|
+
}
|
|
73
|
+
export type DomainOfCompiled<Value extends CompiledSchema> = Value extends CompiledSchema<infer Resolved> ? Resolved : Domain;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Domain, SourceDomain } from './model/domain.js';
|
|
2
|
+
import type { DomainInput } from './model/input.js';
|
|
3
|
+
/** True only for an immutable Domain created by DSL resolution or compiled loading. */
|
|
4
|
+
export declare function isDomain(input: unknown): input is Domain;
|
|
5
|
+
/** Retain source provenance without losing the admitted root Domain identity. */
|
|
6
|
+
export declare function createSourceDomain<Source, Resolved extends Domain>(domain: Resolved, source: Source): SourceDomain<Source, Resolved>;
|
|
7
|
+
/** Construct one resolved Definition universe and one memoized facade per closure Domain. */
|
|
8
|
+
export declare function createDomain(input: DomainInput): Domain;
|