@astrale-os/sdk 0.5.0-beta.13 → 0.5.0-beta.131
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/README.md +128 -20
- package/dist/application/action/action.d.ts +43 -0
- package/dist/application/action/action.js +1 -0
- package/dist/application/action/authoring.d.ts +5 -0
- package/dist/application/action/authoring.js +1 -0
- package/dist/application/action/context.d.ts +87 -0
- package/dist/application/action/context.js +1 -0
- package/dist/application/action/define.d.ts +12 -0
- package/dist/application/action/define.js +34 -0
- package/dist/application/action/index.d.ts +5 -0
- package/dist/application/action/index.js +1 -0
- package/dist/application/action/output.d.ts +6 -0
- package/dist/application/action/output.js +1 -0
- package/dist/application/application.d.ts +28 -0
- package/dist/application/application.js +1 -0
- package/dist/application/define.d.ts +16 -0
- package/dist/application/define.js +40 -0
- package/dist/application/dependency/index.d.ts +1 -0
- package/dist/application/dependency/index.js +1 -0
- package/dist/application/dependency/invoker.d.ts +26 -0
- package/dist/application/dependency/invoker.js +1 -0
- package/dist/application/error/error.d.ts +23 -0
- package/dist/application/error/error.js +87 -0
- package/dist/application/error/index.d.ts +2 -0
- package/dist/application/error/index.js +1 -0
- package/dist/application/index.d.ts +9 -0
- package/dist/application/index.js +4 -0
- package/dist/application/integration/admission.d.ts +9 -0
- package/dist/application/integration/admission.js +21 -0
- package/dist/application/integration/authentication.d.ts +10 -0
- package/dist/application/integration/authentication.js +1 -0
- package/dist/application/integration/authentication.typecheck.d.ts +1 -0
- package/dist/application/integration/authentication.typecheck.js +18 -0
- package/dist/application/integration/client.d.ts +27 -0
- package/dist/application/integration/client.js +117 -0
- package/dist/application/integration/define.d.ts +24 -0
- package/dist/application/integration/define.js +101 -0
- package/dist/application/integration/index.d.ts +8 -0
- package/dist/application/integration/index.js +2 -0
- package/dist/application/integration/integration.d.ts +19 -0
- package/dist/application/integration/integration.js +1 -0
- package/dist/application/integration/operation.d.ts +38 -0
- package/dist/application/integration/operation.js +1 -0
- package/dist/application/integration/provider.d.ts +14 -0
- package/dist/application/integration/provider.js +1 -0
- package/dist/application/integration/replay.d.ts +3 -0
- package/dist/application/integration/replay.js +37 -0
- package/dist/application/mutation/authoring/builder.d.ts +55 -0
- package/dist/application/mutation/authoring/builder.js +102 -0
- package/dist/application/mutation/authoring/endpoint.d.ts +16 -0
- package/dist/application/mutation/authoring/endpoint.js +22 -0
- package/dist/application/mutation/authoring/index.d.ts +4 -0
- package/dist/application/mutation/authoring/index.js +1 -0
- package/dist/application/mutation/authoring/precondition.d.ts +7 -0
- package/dist/application/mutation/authoring/precondition.js +8 -0
- package/dist/application/mutation/authoring/properties.d.ts +22 -0
- package/dist/application/mutation/authoring/properties.js +29 -0
- package/dist/application/mutation/authoring/transition.d.ts +26 -0
- package/dist/application/mutation/authoring/transition.js +63 -0
- package/dist/application/mutation/define.d.ts +12 -0
- package/dist/application/mutation/define.js +56 -0
- package/dist/application/mutation/execution/execute.d.ts +9 -0
- package/dist/application/mutation/execution/execute.js +21 -0
- package/dist/application/mutation/execution/executor.d.ts +13 -0
- package/dist/application/mutation/execution/executor.js +7 -0
- package/dist/application/mutation/execution/index.d.ts +2 -0
- package/dist/application/mutation/execution/index.js +1 -0
- package/dist/application/mutation/execution/projection.d.ts +3 -0
- package/dist/application/mutation/execution/projection.js +3 -0
- package/dist/application/mutation/failure.d.ts +13 -0
- package/dist/application/mutation/failure.js +51 -0
- package/dist/application/mutation/index.d.ts +8 -0
- package/dist/application/mutation/index.js +4 -0
- package/dist/application/mutation/mutation.d.ts +24 -0
- package/dist/application/mutation/mutation.js +1 -0
- package/dist/application/query/collection/identity.d.ts +4 -0
- package/dist/application/query/collection/identity.js +15 -0
- package/dist/application/query/collection/limits.d.ts +5 -0
- package/dist/application/query/collection/limits.js +5 -0
- package/dist/application/query/collection/metadata.d.ts +11 -0
- package/dist/application/query/collection/metadata.js +62 -0
- package/dist/application/query/collection/union.d.ts +19 -0
- package/dist/application/query/collection/union.js +157 -0
- package/dist/application/query/composite/builder.d.ts +46 -0
- package/dist/application/query/composite/builder.js +176 -0
- package/dist/application/query/composite/errors.d.ts +7 -0
- package/dist/application/query/composite/errors.js +8 -0
- package/dist/application/query/composite/index.d.ts +4 -0
- package/dist/application/query/composite/index.js +3 -0
- package/dist/application/query/composite/plan.d.ts +24 -0
- package/dist/application/query/composite/plan.js +85 -0
- package/dist/application/query/composite/query.d.ts +44 -0
- package/dist/application/query/composite/query.js +1 -0
- package/dist/application/query/define.d.ts +48 -0
- package/dist/application/query/define.js +162 -0
- package/dist/application/query/execution/execute.d.ts +14 -0
- package/dist/application/query/execution/execute.js +74 -0
- package/dist/application/query/execution/executor.d.ts +14 -0
- package/dist/application/query/execution/executor.js +7 -0
- package/dist/application/query/execution/index.d.ts +2 -0
- package/dist/application/query/execution/index.js +1 -0
- package/dist/application/query/execution/pages.d.ts +1 -0
- package/dist/application/query/execution/pages.js +1 -0
- package/dist/application/query/execution/projection.d.ts +3 -0
- package/dist/application/query/execution/projection.js +3 -0
- package/dist/application/query/failure.d.ts +10 -0
- package/dist/application/query/failure.js +14 -0
- package/dist/application/query/index.d.ts +10 -0
- package/dist/application/query/index.js +6 -0
- package/dist/application/query/query.d.ts +35 -0
- package/dist/application/query/query.js +1 -0
- package/dist/application/query/single/index.d.ts +4 -0
- package/dist/application/query/single/index.js +3 -0
- package/dist/application/query/single/node.d.ts +18 -0
- package/dist/application/query/single/node.js +86 -0
- package/dist/application/query/single/pagination.d.ts +9 -0
- package/dist/application/query/single/pagination.js +24 -0
- package/dist/application/query/single/query.d.ts +47 -0
- package/dist/application/query/single/query.js +1 -0
- package/dist/application/query/single/selection.d.ts +2 -0
- package/dist/application/query/single/selection.js +23 -0
- package/dist/application/requirements/authority.d.ts +7 -0
- package/dist/application/requirements/authority.js +38 -0
- package/dist/application/requirements/classes.d.ts +9 -0
- package/dist/application/requirements/classes.js +52 -0
- package/dist/application/requirements/core.d.ts +14 -0
- package/dist/application/requirements/core.js +41 -0
- package/dist/application/requirements/functions.d.ts +4 -0
- package/dist/application/requirements/functions.js +30 -0
- package/dist/application/requirements/index.d.ts +19 -0
- package/dist/application/requirements/index.js +32 -0
- package/dist/application/requirements/requirement.d.ts +25 -0
- package/dist/application/requirements/requirement.js +1 -0
- package/dist/application/routes/admission.d.ts +5 -0
- package/dist/application/routes/admission.js +15 -0
- package/dist/application/routes/collection.d.ts +8 -0
- package/dist/application/routes/collection.js +23 -0
- package/dist/application/routes/index.d.ts +9 -0
- package/dist/application/routes/index.js +45 -0
- package/dist/application/routes/route.d.ts +10 -0
- package/dist/application/routes/route.js +1 -0
- package/dist/application/runtime/actions.d.ts +10 -0
- package/dist/application/runtime/actions.js +27 -0
- package/dist/application/runtime/authoring.d.ts +6 -0
- package/dist/application/runtime/authoring.js +1 -0
- package/dist/application/runtime/callables.d.ts +11 -0
- package/dist/application/runtime/callables.js +40 -0
- package/dist/application/runtime/declarations.d.ts +43 -0
- package/dist/application/runtime/declarations.js +1 -0
- package/dist/application/runtime/define.d.ts +28 -0
- package/dist/application/runtime/define.js +42 -0
- package/dist/application/runtime/index.d.ts +6 -0
- package/dist/application/runtime/index.js +2 -0
- package/dist/application/runtime/initialize.d.ts +10 -0
- package/dist/application/runtime/initialize.js +1 -0
- package/dist/application/runtime/integrations.d.ts +3 -0
- package/dist/application/runtime/integrations.js +1 -0
- package/dist/application/runtime/runtime.d.ts +30 -0
- package/dist/application/runtime/runtime.js +37 -0
- package/dist/application/runtime/workflows.d.ts +11 -0
- package/dist/application/runtime/workflows.js +33 -0
- package/dist/application/state/index.d.ts +2 -0
- package/dist/application/state/index.js +1 -0
- package/dist/application/view/admission.d.ts +3 -0
- package/dist/application/view/admission.js +8 -0
- package/dist/application/view/define.d.ts +4 -0
- package/dist/application/view/define.js +52 -0
- package/dist/application/view/frontend.d.ts +19 -0
- package/dist/application/view/frontend.js +1 -0
- package/dist/application/view/index.d.ts +6 -0
- package/dist/application/view/index.js +3 -0
- package/dist/application/view/route.d.ts +19 -0
- package/dist/application/view/route.js +131 -0
- package/dist/application/view/source.d.ts +16 -0
- package/dist/application/view/source.js +55 -0
- package/dist/application/workflow/authoring.d.ts +4 -0
- package/dist/application/workflow/authoring.js +1 -0
- package/dist/application/workflow/context.d.ts +9 -0
- package/dist/application/workflow/context.js +1 -0
- package/dist/application/workflow/define.d.ts +11 -0
- package/dist/application/workflow/define.js +37 -0
- package/dist/application/workflow/index.d.ts +6 -0
- package/dist/application/workflow/index.js +3 -0
- package/dist/application/workflow/runner/index.d.ts +2 -0
- package/dist/application/workflow/runner/index.js +1 -0
- package/dist/application/workflow/runner/inline.d.ts +3 -0
- package/dist/application/workflow/runner/inline.js +55 -0
- package/dist/application/workflow/runner/runner.d.ts +10 -0
- package/dist/application/workflow/runner/runner.js +1 -0
- package/dist/application/workflow/step/index.d.ts +2 -0
- package/dist/application/workflow/step/index.js +1 -0
- package/dist/application/workflow/step/run.d.ts +2 -0
- package/dist/application/workflow/step/run.js +10 -0
- package/dist/application/workflow/step/step.d.ts +4 -0
- package/dist/application/workflow/step/step.js +1 -0
- package/dist/application/workflow/workflow.d.ts +23 -0
- package/dist/application/workflow/workflow.js +1 -0
- package/dist/deployment/adapter/adapter.d.ts +27 -0
- package/dist/deployment/adapter/adapter.js +1 -0
- package/dist/deployment/adapter/define.d.ts +7 -0
- package/dist/deployment/adapter/define.js +66 -0
- package/dist/deployment/adapter/deploy/context.d.ts +15 -0
- package/dist/deployment/adapter/deploy/context.js +1 -0
- package/dist/deployment/adapter/deploy/index.d.ts +2 -0
- package/dist/deployment/adapter/deploy/index.js +1 -0
- package/dist/deployment/adapter/deploy/result.d.ts +50 -0
- package/dist/deployment/adapter/deploy/result.js +1 -0
- package/dist/deployment/adapter/index.d.ts +4 -0
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/prepare/artifact.d.ts +33 -0
- package/dist/deployment/adapter/prepare/artifact.js +1 -0
- package/dist/deployment/adapter/prepare/context.d.ts +23 -0
- package/dist/deployment/adapter/prepare/context.js +1 -0
- package/dist/deployment/adapter/prepare/index.d.ts +2 -0
- package/dist/deployment/adapter/prepare/index.js +1 -0
- package/dist/deployment/authoring.d.ts +5 -0
- package/dist/deployment/authoring.js +2 -0
- package/dist/deployment/build/admission.d.ts +12 -0
- package/dist/deployment/build/admission.js +15 -0
- package/dist/deployment/build/build.d.ts +13 -0
- package/dist/deployment/build/build.js +1 -0
- package/dist/deployment/build/compile.d.ts +9 -0
- package/dist/deployment/build/compile.js +114 -0
- package/dist/deployment/build/frontend/compilation.d.ts +18 -0
- package/dist/deployment/build/frontend/compilation.js +29 -0
- package/dist/deployment/build/frontend/digest.d.ts +4 -0
- package/dist/deployment/build/frontend/digest.js +23 -0
- package/dist/deployment/build/frontend/files.d.ts +13 -0
- package/dist/deployment/build/frontend/files.js +61 -0
- package/dist/deployment/build/frontend/index.d.ts +6 -0
- package/dist/deployment/build/frontend/index.js +4 -0
- package/dist/deployment/build/frontend/provenance.d.ts +7 -0
- package/dist/deployment/build/frontend/provenance.js +12 -0
- package/dist/deployment/build/index.d.ts +6 -0
- package/dist/deployment/build/index.js +4 -0
- package/dist/deployment/build/material.d.ts +42 -0
- package/dist/deployment/build/material.js +201 -0
- package/dist/deployment/build/schema.d.ts +10 -0
- package/dist/deployment/build/schema.js +1 -0
- package/dist/deployment/deploy.d.ts +20 -0
- package/dist/deployment/deploy.js +31 -0
- package/dist/deployment/deployment.d.ts +9 -0
- package/dist/deployment/deployment.js +10 -0
- package/dist/deployment/index.d.ts +14 -7
- package/dist/deployment/index.js +7 -4
- package/dist/deployment/release/addressing.d.ts +7 -0
- package/dist/deployment/release/addressing.js +27 -0
- package/dist/deployment/release/admission.d.ts +3 -0
- package/dist/deployment/release/admission.js +8 -0
- package/dist/deployment/release/assemble.d.ts +5 -0
- package/dist/deployment/release/assemble.js +20 -0
- package/dist/deployment/release/index.d.ts +5 -0
- package/dist/deployment/release/index.js +4 -0
- package/dist/deployment/release/invocation.d.ts +2 -0
- package/dist/deployment/release/invocation.js +5 -0
- package/dist/deployment/release/publication/callables.d.ts +4 -0
- package/dist/deployment/release/publication/callables.js +8 -0
- package/dist/deployment/release/publication/index.d.ts +6 -0
- package/dist/deployment/release/publication/index.js +6 -0
- package/dist/deployment/release/publication/manifest.d.ts +3 -0
- package/dist/deployment/release/publication/manifest.js +5 -0
- package/dist/deployment/release/publication/requirements.d.ts +3 -0
- package/dist/deployment/release/publication/requirements.js +3 -0
- package/dist/deployment/release/publication/routes.d.ts +4 -0
- package/dist/deployment/release/publication/routes.js +4 -0
- package/dist/deployment/release/publication/seal.d.ts +11 -0
- package/dist/deployment/release/publication/seal.js +40 -0
- package/dist/deployment/release/publication/views.d.ts +4 -0
- package/dist/deployment/release/publication/views.js +13 -0
- package/dist/deployment/release/release.d.ts +11 -0
- package/dist/deployment/release/release.js +1 -0
- package/dist/deployment/release/runtime.d.ts +2 -0
- package/dist/deployment/release/runtime.js +2 -0
- package/dist/deployment/runtime/admission.d.ts +5 -0
- package/dist/deployment/runtime/admission.js +11 -0
- package/dist/deployment/runtime/index.d.ts +3 -0
- package/dist/deployment/runtime/index.js +3 -0
- package/dist/deployment/runtime/reference.d.ts +7 -0
- package/dist/deployment/runtime/reference.js +16 -0
- package/dist/deployment/runtime/resolve.d.ts +10 -0
- package/dist/deployment/runtime/resolve.js +29 -0
- package/dist/deployment/verify/index.d.ts +4 -0
- package/dist/deployment/verify/index.js +3 -0
- package/dist/deployment/verify/preflight/artifact.d.ts +6 -0
- package/dist/deployment/verify/preflight/artifact.js +122 -0
- package/dist/deployment/verify/preflight/build.d.ts +2 -0
- package/dist/deployment/verify/preflight/build.js +6 -0
- package/dist/deployment/verify/preflight/index.d.ts +13 -0
- package/dist/deployment/verify/preflight/index.js +13 -0
- package/dist/deployment/verify/preflight/publication.d.ts +4 -0
- package/dist/deployment/verify/preflight/publication.js +14 -0
- package/dist/deployment/verify/readiness/deployment.d.ts +3 -0
- package/dist/deployment/verify/readiness/deployment.js +150 -0
- package/dist/deployment/verify/readiness/identity.d.ts +7 -0
- package/dist/deployment/verify/readiness/identity.js +29 -0
- package/dist/deployment/verify/readiness/index.d.ts +10 -0
- package/dist/deployment/verify/readiness/index.js +10 -0
- package/dist/deployment/verify/readiness/publication.d.ts +11 -0
- package/dist/deployment/verify/readiness/publication.js +41 -0
- package/dist/execution/identity/authentication.d.ts +21 -0
- package/dist/execution/identity/authentication.js +161 -0
- package/dist/execution/identity/callback.d.ts +44 -0
- package/dist/execution/identity/callback.js +105 -0
- package/dist/execution/identity/delivery.d.ts +6 -0
- package/dist/execution/identity/delivery.js +34 -0
- package/dist/execution/identity/errors.d.ts +22 -0
- package/dist/execution/identity/errors.js +61 -0
- package/dist/execution/identity/exchange.d.ts +10 -0
- package/dist/execution/identity/exchange.js +115 -0
- package/dist/execution/identity/identity.d.ts +24 -0
- package/dist/execution/identity/identity.js +99 -0
- package/dist/execution/identity/index.d.ts +2 -0
- package/dist/execution/identity/index.js +2 -0
- package/dist/execution/identity/jwks.d.ts +29 -0
- package/dist/execution/identity/jwks.js +252 -0
- package/dist/execution/identity/signing.d.ts +9 -0
- package/dist/execution/identity/signing.js +28 -0
- package/dist/execution/index.d.ts +5 -0
- package/dist/execution/index.js +3 -0
- package/dist/execution/invocation/admission/authentication.d.ts +17 -0
- package/dist/execution/invocation/admission/authentication.js +153 -0
- package/dist/execution/invocation/admission/authority.d.ts +34 -0
- package/dist/execution/invocation/admission/authority.js +23 -0
- package/dist/execution/invocation/admission/index.d.ts +5 -0
- package/dist/execution/invocation/admission/index.js +4 -0
- package/dist/execution/invocation/admission/input.d.ts +2 -0
- package/dist/execution/invocation/admission/input.js +4 -0
- package/dist/execution/invocation/admission/target.d.ts +8 -0
- package/dist/execution/invocation/admission/target.js +30 -0
- package/dist/execution/invocation/dependency/bind.d.ts +5 -0
- package/dist/execution/invocation/dependency/bind.js +68 -0
- package/dist/execution/invocation/dependency/index.d.ts +1 -0
- package/dist/execution/invocation/dependency/index.js +1 -0
- package/dist/execution/invocation/dispatch/action.d.ts +3 -0
- package/dist/execution/invocation/dispatch/action.js +20 -0
- package/dist/execution/invocation/dispatch/context.d.ts +23 -0
- package/dist/execution/invocation/dispatch/context.js +64 -0
- package/dist/execution/invocation/dispatch/index.d.ts +5 -0
- package/dist/execution/invocation/dispatch/index.js +5 -0
- package/dist/execution/invocation/dispatch/receiver.d.ts +4 -0
- package/dist/execution/invocation/dispatch/receiver.js +18 -0
- package/dist/execution/invocation/dispatch/select.d.ts +10 -0
- package/dist/execution/invocation/dispatch/select.js +20 -0
- package/dist/execution/invocation/dispatch/workflow.d.ts +4 -0
- package/dist/execution/invocation/dispatch/workflow.js +24 -0
- package/dist/execution/invocation/handler.d.ts +7 -0
- package/dist/execution/invocation/handler.js +37 -0
- package/dist/execution/invocation/index.d.ts +5 -0
- package/dist/execution/invocation/index.js +3 -0
- package/dist/execution/invocation/integration/authentication.d.ts +5 -0
- package/dist/execution/invocation/integration/authentication.js +53 -0
- package/dist/execution/invocation/integration/call.d.ts +11 -0
- package/dist/execution/invocation/integration/call.js +24 -0
- package/dist/execution/invocation/integration/clients.d.ts +5 -0
- package/dist/execution/invocation/integration/clients.js +4 -0
- package/dist/execution/invocation/integration/index.d.ts +2 -0
- package/dist/execution/invocation/integration/index.js +2 -0
- package/dist/execution/invocation/invocation.d.ts +10 -0
- package/dist/execution/invocation/invocation.js +53 -0
- package/dist/execution/invocation/lifecycle/active.d.ts +4 -0
- package/dist/execution/invocation/lifecycle/active.js +86 -0
- package/dist/execution/invocation/lifecycle/index.d.ts +1 -0
- package/dist/execution/invocation/lifecycle/index.js +1 -0
- package/dist/execution/invocation/result/errors.d.ts +23 -0
- package/dist/execution/invocation/result/errors.js +97 -0
- package/dist/execution/invocation/result/index.d.ts +4 -0
- package/dist/execution/invocation/result/index.js +3 -0
- package/dist/execution/invocation/result/project.d.ts +3 -0
- package/dist/execution/invocation/result/project.js +186 -0
- package/dist/execution/invocation/result/validate.d.ts +4 -0
- package/dist/execution/invocation/result/validate.js +25 -0
- package/dist/execution/node/index.d.ts +2 -0
- package/dist/execution/node/index.js +1 -0
- package/dist/execution/node/listener.d.ts +10 -0
- package/dist/execution/node/listener.js +25 -0
- package/dist/execution/node/serve.d.ts +9 -0
- package/dist/execution/node/serve.js +44 -0
- package/dist/execution/runtime/admission.d.ts +3 -0
- package/dist/execution/runtime/admission.js +8 -0
- package/dist/execution/runtime/index.d.ts +5 -0
- package/dist/execution/runtime/index.js +5 -0
- package/dist/execution/runtime/initialize.d.ts +11 -0
- package/dist/execution/runtime/initialize.js +13 -0
- package/dist/execution/runtime/integrations.d.ts +3 -0
- package/dist/execution/runtime/integrations.js +5 -0
- package/dist/execution/runtime/load.d.ts +14 -0
- package/dist/execution/runtime/load.js +12 -0
- package/dist/execution/runtime/providers.d.ts +3 -0
- package/dist/execution/runtime/providers.js +12 -0
- package/dist/execution/serve.d.ts +27 -0
- package/dist/execution/serve.js +61 -0
- package/dist/execution/service/create.d.ts +4 -0
- package/dist/execution/service/create.js +113 -0
- package/dist/execution/service/errors.d.ts +3 -0
- package/dist/execution/service/errors.js +3 -0
- package/dist/execution/service/index.d.ts +3 -0
- package/dist/execution/service/index.js +1 -0
- package/dist/execution/service/initialization.d.ts +6 -0
- package/dist/execution/service/initialization.js +18 -0
- package/dist/execution/service/lifecycle.d.ts +7 -0
- package/dist/execution/service/lifecycle.js +25 -0
- package/dist/execution/service/publication/delivery.d.ts +2 -0
- package/dist/execution/service/publication/delivery.js +9 -0
- package/dist/execution/service/publication/index.d.ts +3 -0
- package/dist/execution/service/publication/index.js +3 -0
- package/dist/execution/service/publication/installation.d.ts +3 -0
- package/dist/execution/service/publication/installation.js +8 -0
- package/dist/execution/service/publication/source.d.ts +3 -0
- package/dist/execution/service/publication/source.js +11 -0
- package/dist/execution/service/release.d.ts +7 -0
- package/dist/execution/service/release.js +12 -0
- package/dist/execution/service/service.d.ts +23 -0
- package/dist/execution/service/service.js +1 -0
- package/dist/index.d.ts +21 -23
- package/dist/index.js +11 -12
- package/dist/platform/auth/exchange/configuration.d.ts +3 -0
- package/dist/platform/auth/exchange/configuration.js +3 -0
- package/dist/platform/auth/exchange/index.d.ts +2 -0
- package/dist/platform/auth/exchange/index.js +2 -0
- package/dist/platform/auth/exchange/response.d.ts +2 -0
- package/dist/platform/auth/exchange/response.js +2 -0
- package/dist/platform/auth/index.d.ts +4 -0
- package/dist/platform/auth/index.js +4 -0
- package/dist/platform/client/index.d.ts +5 -0
- package/dist/platform/client/index.js +4 -0
- package/dist/platform/client/schema/index.d.ts +2 -0
- package/dist/platform/client/schema/index.js +2 -0
- package/dist/platform/client/session/index.d.ts +2 -0
- package/dist/platform/client/session/index.js +2 -0
- package/dist/platform/client/store/index.d.ts +2 -0
- package/dist/platform/client/store/index.js +2 -0
- package/dist/platform/graph/alias.d.ts +6 -0
- package/dist/platform/graph/alias.js +6 -0
- package/dist/platform/graph/class/index.d.ts +4 -0
- package/dist/platform/graph/class/index.js +2 -0
- package/dist/platform/graph/document/index.d.ts +3 -0
- package/dist/platform/graph/document/index.js +3 -0
- package/dist/platform/graph/edge/index.d.ts +2 -0
- package/dist/platform/graph/edge/index.js +2 -0
- package/dist/platform/graph/index.d.ts +14 -0
- package/dist/platform/graph/index.js +13 -0
- package/dist/platform/graph/node/index.d.ts +2 -0
- package/dist/platform/graph/node/index.js +2 -0
- package/dist/platform/graph/path/index.d.ts +2 -0
- package/dist/platform/graph/path/index.js +2 -0
- package/dist/platform/graph/properties/index.d.ts +2 -0
- package/dist/platform/graph/properties/index.js +2 -0
- package/dist/platform/invocation/index.d.ts +2 -0
- package/dist/platform/invocation/index.js +2 -0
- package/dist/platform/publication/index.d.ts +2 -0
- package/dist/platform/publication/index.js +2 -0
- package/dist/platform/result/index.d.ts +2 -0
- package/dist/platform/result/index.js +1 -0
- package/dist/platform/result/result.d.ts +10 -0
- package/dist/platform/result/result.js +6 -0
- package/dist/platform/schema/addressing/index.d.ts +3 -0
- package/dist/platform/schema/addressing/index.js +2 -0
- package/dist/platform/schema/class-authoring.d.ts +37 -0
- package/dist/platform/schema/class-authoring.js +20 -0
- package/dist/platform/schema/class-icon.d.ts +15 -0
- package/dist/platform/schema/class-icon.js +46 -0
- package/dist/platform/schema/error.d.ts +11 -0
- package/dist/platform/schema/error.js +34 -0
- package/dist/platform/schema/errors/index.d.ts +3 -0
- package/dist/platform/schema/errors/index.js +2 -0
- package/dist/platform/schema/icons/index.d.ts +2 -0
- package/dist/platform/schema/icons/index.js +2 -0
- package/dist/platform/schema/index.d.ts +23 -0
- package/dist/platform/schema/index.js +12 -0
- package/dist/platform/schema/kernel.d.ts +22 -0
- package/dist/platform/schema/kernel.js +5 -0
- package/dist/platform/schema/node-id.d.ts +3 -0
- package/dist/platform/schema/node-id.js +6 -0
- package/dist/platform/schema/schema-authoring.d.ts +48 -0
- package/dist/platform/schema/schema-authoring.js +3 -0
- package/dist/platform/schema/state-property.d.ts +11 -0
- package/dist/platform/schema/state-property.js +3 -0
- package/dist/platform/value/index.d.ts +3 -0
- package/dist/platform/value/index.js +3 -0
- package/dist/project/admit.d.ts +4 -0
- package/dist/project/admit.js +22 -0
- package/dist/project/define.d.ts +12 -0
- package/dist/project/define.js +106 -0
- package/dist/project/index.d.ts +4 -0
- package/dist/project/index.js +2 -0
- package/dist/project/project.d.ts +24 -0
- package/dist/project/project.js +1 -0
- package/dist/testing/dataset/admission.d.ts +13 -0
- package/dist/testing/dataset/admission.js +107 -0
- package/dist/testing/dataset/builder.d.ts +42 -0
- package/dist/testing/dataset/builder.js +127 -0
- package/dist/testing/dataset/codec.d.ts +6 -0
- package/dist/testing/dataset/codec.js +113 -0
- package/dist/testing/dataset/dataset.d.ts +58 -0
- package/dist/testing/dataset/dataset.js +2 -0
- package/dist/testing/dataset/define.d.ts +33 -0
- package/dist/testing/dataset/define.js +105 -0
- package/dist/testing/dataset/index.d.ts +8 -0
- package/dist/testing/dataset/index.js +4 -0
- package/dist/testing/dataset/references.d.ts +14 -0
- package/dist/testing/dataset/references.js +56 -0
- package/dist/testing/index.d.ts +9 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/load.d.ts +14 -0
- package/dist/testing/load.js +44 -0
- package/dist/testing/reference.d.ts +11 -0
- package/dist/testing/reference.js +19 -0
- package/dist/testing/tests.d.ts +12 -0
- package/dist/testing/tests.js +31 -0
- package/dist/tooling/cli/arguments.d.ts +17 -0
- package/dist/tooling/cli/arguments.js +162 -0
- package/dist/tooling/cli/astrale/authority.d.ts +5 -0
- package/dist/tooling/cli/astrale/authority.js +11 -0
- package/dist/tooling/cli/astrale/executable.d.ts +2 -0
- package/dist/tooling/cli/astrale/executable.js +47 -0
- package/dist/tooling/cli/astrale/failure.d.ts +6 -0
- package/dist/tooling/cli/astrale/failure.js +48 -0
- package/dist/tooling/cli/astrale/instance.d.ts +11 -0
- package/dist/tooling/cli/astrale/instance.js +52 -0
- package/dist/tooling/cli/astrale/process.d.ts +13 -0
- package/dist/tooling/cli/astrale/process.js +94 -0
- package/dist/tooling/cli/astrale/version.d.ts +18 -0
- package/dist/tooling/cli/astrale/version.js +55 -0
- package/dist/tooling/cli/bin.d.ts +6 -0
- package/dist/tooling/cli/bin.js +36 -0
- package/dist/tooling/cli/bun.d.ts +15 -0
- package/dist/tooling/cli/bun.js +108 -0
- package/dist/tooling/cli/credential.d.ts +2 -0
- package/dist/tooling/cli/credential.js +57 -0
- package/dist/tooling/cli/development/candidate.d.ts +25 -0
- package/dist/tooling/cli/development/candidate.js +176 -0
- package/dist/tooling/cli/development/deployment.d.ts +16 -0
- package/dist/tooling/cli/development/deployment.js +39 -0
- package/dist/tooling/cli/development/develop.d.ts +11 -0
- package/dist/tooling/cli/development/develop.js +240 -0
- package/dist/tooling/cli/development/lease.d.ts +18 -0
- package/dist/tooling/cli/development/lease.js +163 -0
- package/dist/tooling/cli/development/lifecycle.d.ts +9 -0
- package/dist/tooling/cli/development/lifecycle.js +43 -0
- package/dist/tooling/cli/development/project-imports.d.ts +22 -0
- package/dist/tooling/cli/development/project-imports.js +39 -0
- package/dist/tooling/cli/development/project-lock.d.ts +16 -0
- package/dist/tooling/cli/development/project-lock.js +41 -0
- package/dist/tooling/cli/development/rebuild.d.ts +13 -0
- package/dist/tooling/cli/development/rebuild.js +58 -0
- package/dist/tooling/cli/development/release-evidence.d.ts +4 -0
- package/dist/tooling/cli/development/release-evidence.js +10 -0
- package/dist/tooling/cli/development/report.d.ts +6 -0
- package/dist/tooling/cli/development/report.js +14 -0
- package/dist/tooling/cli/development/session-file.d.ts +53 -0
- package/dist/tooling/cli/development/session-file.js +337 -0
- package/dist/tooling/cli/development/source-watch.d.ts +14 -0
- package/dist/tooling/cli/development/source-watch.js +140 -0
- package/dist/tooling/cli/development/sources.d.ts +7 -0
- package/dist/tooling/cli/development/sources.js +48 -0
- package/dist/tooling/cli/development/target-lock.d.ts +16 -0
- package/dist/tooling/cli/development/target-lock.js +68 -0
- package/dist/tooling/cli/development/view.d.ts +28 -0
- package/dist/tooling/cli/development/view.js +151 -0
- package/dist/tooling/cli/dotenv.d.ts +19 -0
- package/dist/tooling/cli/dotenv.js +85 -0
- package/dist/tooling/cli/environment-release.d.ts +21 -0
- package/dist/tooling/cli/environment-release.js +46 -0
- package/dist/tooling/cli/evidence.d.ts +11 -0
- package/dist/tooling/cli/evidence.js +52 -0
- package/dist/tooling/cli/failure.d.ts +2 -0
- package/dist/tooling/cli/failure.js +13 -0
- package/dist/tooling/cli/help.d.ts +8 -0
- package/dist/tooling/cli/help.js +152 -0
- package/dist/tooling/cli/index.d.ts +16 -0
- package/dist/tooling/cli/index.js +15 -0
- package/dist/tooling/cli/installation/index.d.ts +2 -0
- package/dist/tooling/cli/installation/index.js +1 -0
- package/dist/tooling/cli/installation/observation.d.ts +10 -0
- package/dist/tooling/cli/installation/observation.js +44 -0
- package/dist/tooling/cli/installation/reconcile.d.ts +32 -0
- package/dist/tooling/cli/installation/reconcile.js +122 -0
- package/dist/tooling/cli/log.d.ts +10 -0
- package/dist/tooling/cli/log.js +16 -0
- package/dist/tooling/cli/orchestrate.d.ts +7 -0
- package/dist/tooling/cli/orchestrate.js +198 -0
- package/dist/tooling/cli/project.d.ts +17 -0
- package/dist/tooling/cli/project.js +18 -0
- package/dist/tooling/cli/run.d.ts +1 -0
- package/dist/tooling/cli/run.js +1 -0
- package/dist/tooling/cli/source.d.ts +2 -0
- package/dist/tooling/cli/source.js +2 -0
- package/dist/tooling/cli/test.d.ts +12 -0
- package/dist/tooling/cli/test.js +47 -0
- package/dist/tooling/linter/adapters/typescript/discover.d.ts +3 -0
- package/dist/tooling/linter/adapters/typescript/discover.js +424 -0
- package/dist/tooling/linter/adapters/typescript/evidence-admission.d.ts +4 -0
- package/dist/tooling/linter/adapters/typescript/evidence-admission.js +21 -0
- package/dist/tooling/linter/adapters/typescript/imports.d.ts +6 -0
- package/dist/tooling/linter/adapters/typescript/imports.js +172 -0
- package/dist/tooling/linter/adapters/typescript/index.d.ts +49 -0
- package/dist/tooling/linter/adapters/typescript/index.js +9 -0
- package/dist/tooling/linter/adapters/typescript/query-collection-type.d.ts +4 -0
- package/dist/tooling/linter/adapters/typescript/query-collection-type.js +47 -0
- package/dist/tooling/linter/adapters/typescript/query-observation.d.ts +3 -0
- package/dist/tooling/linter/adapters/typescript/query-observation.js +228 -0
- package/dist/tooling/linter/adapters/typescript/suppression-directives.d.ts +4 -0
- package/dist/tooling/linter/adapters/typescript/suppression-directives.js +84 -0
- package/dist/tooling/linter/adapters/typescript/syntax.d.ts +38 -0
- package/dist/tooling/linter/adapters/typescript/syntax.js +182 -0
- package/dist/tooling/linter/adapters/typescript/type-analysis.d.ts +9 -0
- package/dist/tooling/linter/adapters/typescript/type-analysis.js +55 -0
- package/dist/tooling/linter/adapters/typescript/type-universe.d.ts +1 -0
- package/dist/tooling/linter/adapters/typescript/type-universe.js +264 -0
- package/dist/tooling/linter/analysis/query/decision.d.ts +4 -0
- package/dist/tooling/linter/analysis/query/decision.js +73 -0
- package/dist/tooling/linter/analysis/query/index.d.ts +3 -0
- package/dist/tooling/linter/analysis/query/index.js +2 -0
- package/dist/tooling/linter/analysis/query/observation.d.ts +35 -0
- package/dist/tooling/linter/analysis/query/observation.js +12 -0
- package/dist/tooling/linter/catalog/compile.d.ts +2 -0
- package/dist/tooling/linter/catalog/compile.js +110 -0
- package/dist/tooling/linter/catalog/index.d.ts +18 -0
- package/dist/tooling/linter/catalog/index.js +2 -0
- package/dist/tooling/linter/catalog/revision.d.ts +6 -0
- package/dist/tooling/linter/catalog/revision.js +12 -0
- package/dist/tooling/linter/diagnostics/error.d.ts +9 -0
- package/dist/tooling/linter/diagnostics/error.js +9 -0
- package/dist/tooling/linter/diagnostics/index.d.ts +28 -0
- package/dist/tooling/linter/diagnostics/index.js +2 -0
- package/dist/tooling/linter/diagnostics/sort.d.ts +2 -0
- package/dist/tooling/linter/diagnostics/sort.js +26 -0
- package/dist/tooling/linter/evaluation/binding/bind.d.ts +4 -0
- package/dist/tooling/linter/evaluation/binding/bind.js +384 -0
- package/dist/tooling/linter/evaluation/binding/diagnostic.d.ts +4 -0
- package/dist/tooling/linter/evaluation/binding/diagnostic.js +16 -0
- package/dist/tooling/linter/evaluation/binding/index.d.ts +1 -0
- package/dist/tooling/linter/evaluation/binding/index.js +1 -0
- package/dist/tooling/linter/evaluation/contract/availability.d.ts +30 -0
- package/dist/tooling/linter/evaluation/contract/availability.js +1 -0
- package/dist/tooling/linter/evaluation/contract/decision.d.ts +25 -0
- package/dist/tooling/linter/evaluation/contract/decision.js +1 -0
- package/dist/tooling/linter/evaluation/contract/evidence.d.ts +11 -0
- package/dist/tooling/linter/evaluation/contract/evidence.js +1 -0
- package/dist/tooling/linter/evaluation/contract/implementation.d.ts +21 -0
- package/dist/tooling/linter/evaluation/contract/implementation.js +1 -0
- package/dist/tooling/linter/evaluation/contract/index.d.ts +4 -0
- package/dist/tooling/linter/evaluation/contract/index.js +1 -0
- package/dist/tooling/linter/evaluation/index.d.ts +2 -0
- package/dist/tooling/linter/evaluation/index.js +1 -0
- package/dist/tooling/linter/implementations/source/actions.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/actions.js +184 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +28 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.js +234 -0
- package/dist/tooling/linter/implementations/source/dependencies.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/dependencies.js +219 -0
- package/dist/tooling/linter/implementations/source/global.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/global.js +1002 -0
- package/dist/tooling/linter/implementations/source/index.d.ts +3 -0
- package/dist/tooling/linter/implementations/source/index.js +3 -0
- package/dist/tooling/linter/implementations/source/integrations.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/integrations.js +40 -0
- package/dist/tooling/linter/implementations/source/migrations.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/migrations.js +113 -0
- package/dist/tooling/linter/implementations/source/mutations.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/mutations.js +1404 -0
- package/dist/tooling/linter/implementations/source/providers.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/providers.js +230 -0
- package/dist/tooling/linter/implementations/source/queries.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/queries.js +1176 -0
- package/dist/tooling/linter/implementations/source/rules.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/rules.js +139 -0
- package/dist/tooling/linter/implementations/source/schema.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/schema.js +826 -0
- package/dist/tooling/linter/implementations/source/shared.d.ts +44 -0
- package/dist/tooling/linter/implementations/source/shared.js +319 -0
- package/dist/tooling/linter/implementations/source/state-machine.d.ts +24 -0
- package/dist/tooling/linter/implementations/source/state-machine.js +381 -0
- package/dist/tooling/linter/implementations/source/states.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/states.js +361 -0
- package/dist/tooling/linter/implementations/source/tests.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/tests.js +35 -0
- package/dist/tooling/linter/implementations/source/ui.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/ui.js +20 -0
- package/dist/tooling/linter/implementations/source/utility-rules.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/utility-rules.js +28 -0
- package/dist/tooling/linter/implementations/source/verifier.d.ts +16 -0
- package/dist/tooling/linter/implementations/source/verifier.js +52 -0
- package/dist/tooling/linter/implementations/source/verifiers.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/verifiers.js +34 -0
- package/dist/tooling/linter/implementations/source/views.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/views.js +57 -0
- package/dist/tooling/linter/implementations/source/workflows.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/workflows.js +240 -0
- package/dist/tooling/linter/index.d.ts +9 -0
- package/dist/tooling/linter/index.js +3 -0
- package/dist/tooling/linter/lint.d.ts +25 -0
- package/dist/tooling/linter/lint.js +70 -0
- package/dist/tooling/linter/oxlint/index.d.ts +3 -0
- package/dist/tooling/linter/oxlint/index.js +1 -0
- package/dist/tooling/linter/oxlint/process.d.ts +18 -0
- package/dist/tooling/linter/oxlint/process.js +169 -0
- package/dist/tooling/linter/oxlint/run.d.ts +7 -0
- package/dist/tooling/linter/oxlint/run.js +253 -0
- package/dist/tooling/linter/oxlint-config/ignore-patterns.d.ts +5 -0
- package/dist/tooling/linter/oxlint-config/ignore-patterns.js +10 -0
- package/dist/tooling/linter/oxlint-config/index.d.ts +4 -0
- package/dist/tooling/linter/oxlint-config/index.js +38 -0
- package/dist/tooling/linter/packs/domain.d.ts +2 -0
- package/dist/tooling/linter/packs/domain.js +7 -0
- package/dist/tooling/linter/packs/index.d.ts +8 -0
- package/dist/tooling/linter/packs/index.js +1 -0
- package/dist/tooling/linter/policy/compile.d.ts +2 -0
- package/dist/tooling/linter/policy/compile.js +271 -0
- package/dist/tooling/linter/policy/configuration.d.ts +21 -0
- package/dist/tooling/linter/policy/configuration.js +149 -0
- package/dist/tooling/linter/policy/generated.d.ts +4 -0
- package/dist/tooling/linter/policy/generated.js +716 -0
- package/dist/tooling/linter/policy/index.d.ts +45 -0
- package/dist/tooling/linter/policy/index.js +3 -0
- package/dist/tooling/linter/qualification/index.d.ts +10 -0
- package/dist/tooling/linter/qualification/index.js +2 -0
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +2 -0
- package/dist/tooling/linter/qualification/query-fixtures.js +68 -0
- package/dist/tooling/linter/qualification/runner.d.ts +3 -0
- package/dist/tooling/linter/qualification/runner.js +6 -0
- package/dist/tooling/linter/report/format.d.ts +3 -0
- package/dist/tooling/linter/report/format.js +46 -0
- package/dist/tooling/linter/report/index.d.ts +2 -0
- package/dist/tooling/linter/report/index.js +1 -0
- package/dist/tooling/linter/requirements/index.d.ts +2 -0
- package/dist/tooling/linter/requirements/index.js +1 -0
- package/dist/tooling/linter/requirements/registry.d.ts +3 -0
- package/dist/tooling/linter/requirements/registry.js +197 -0
- package/dist/tooling/linter/requirements/requirement.d.ts +8 -0
- package/dist/tooling/linter/requirements/requirement.js +1 -0
- package/dist/tooling/linter/suppression/apply.d.ts +3 -0
- package/dist/tooling/linter/suppression/apply.js +47 -0
- package/dist/tooling/linter/suppression/directive.d.ts +10 -0
- package/dist/tooling/linter/suppression/directive.js +1 -0
- package/dist/tooling/linter/suppression/index.d.ts +13 -0
- package/dist/tooling/linter/suppression/index.js +1 -0
- package/dist/tooling/packaging/admission.d.ts +9 -0
- package/dist/tooling/packaging/admission.js +93 -0
- package/dist/tooling/packaging/compile.d.ts +10 -0
- package/dist/tooling/packaging/compile.js +311 -0
- package/dist/tooling/packaging/declarations/admission.d.ts +7 -0
- package/dist/tooling/packaging/declarations/admission.js +56 -0
- package/dist/tooling/packaging/declarations/admission.typecheck.d.ts +7 -0
- package/dist/tooling/packaging/declarations/admission.typecheck.js +1 -0
- package/dist/tooling/packaging/declarations/imports.d.ts +16 -0
- package/dist/tooling/packaging/declarations/imports.js +50 -0
- package/dist/tooling/packaging/declarations/index.d.ts +7 -0
- package/dist/tooling/packaging/declarations/index.js +9 -0
- package/dist/tooling/packaging/declarations/normalize.d.ts +13 -0
- package/dist/tooling/packaging/declarations/normalize.js +135 -0
- package/dist/tooling/packaging/declarations/ownership.d.ts +9 -0
- package/dist/tooling/packaging/declarations/ownership.js +85 -0
- package/dist/tooling/packaging/declarations/references.d.ts +5 -0
- package/dist/tooling/packaging/declarations/references.js +38 -0
- package/dist/tooling/packaging/declarations/transform.d.ts +11 -0
- package/dist/tooling/packaging/declarations/transform.js +76 -0
- package/dist/tooling/packaging/declarations/verify.d.ts +11 -0
- package/dist/tooling/packaging/declarations/verify.js +44 -0
- package/dist/tooling/packaging/exports.d.ts +11 -0
- package/dist/tooling/packaging/exports.js +61 -0
- package/dist/tooling/packaging/index.d.ts +2 -0
- package/dist/tooling/packaging/index.js +1 -0
- package/dist/tooling/packaging/javascript.d.ts +3 -0
- package/dist/tooling/packaging/javascript.js +71 -0
- package/dist/tooling/packaging/packaging.d.ts +10 -0
- package/dist/tooling/packaging/packaging.js +195 -0
- package/dist/tooling/packaging/self.d.ts +9 -0
- package/dist/tooling/packaging/self.js +25 -0
- package/package.json +203 -108
- package/dist/auth/exchange.d.ts +0 -11
- package/dist/auth/exchange.d.ts.map +0 -1
- package/dist/auth/exchange.js +0 -8
- package/dist/auth/exchange.js.map +0 -1
- package/dist/auth/index.d.ts +0 -5
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -4
- package/dist/auth/index.js.map +0 -1
- package/dist/capability/client.d.ts +0 -25
- package/dist/capability/client.d.ts.map +0 -1
- package/dist/capability/client.js +0 -147
- package/dist/capability/client.js.map +0 -1
- package/dist/capability/contract.d.ts +0 -70
- package/dist/capability/contract.d.ts.map +0 -1
- package/dist/capability/contract.js +0 -3
- package/dist/capability/contract.js.map +0 -1
- package/dist/capability/define.d.ts +0 -14
- package/dist/capability/define.d.ts.map +0 -1
- package/dist/capability/define.js +0 -145
- package/dist/capability/define.js.map +0 -1
- package/dist/capability/index.d.ts +0 -3
- package/dist/capability/index.d.ts.map +0 -1
- package/dist/capability/index.js +0 -2
- package/dist/capability/index.js.map +0 -1
- package/dist/cli/arguments.d.ts +0 -21
- package/dist/cli/arguments.d.ts.map +0 -1
- package/dist/cli/arguments.js +0 -220
- package/dist/cli/arguments.js.map +0 -1
- package/dist/cli/bin.d.ts +0 -7
- package/dist/cli/bin.d.ts.map +0 -1
- package/dist/cli/bin.js +0 -15
- package/dist/cli/bin.js.map +0 -1
- package/dist/cli/dotenv.d.ts +0 -18
- package/dist/cli/dotenv.d.ts.map +0 -1
- package/dist/cli/dotenv.js +0 -55
- package/dist/cli/dotenv.js.map +0 -1
- package/dist/cli/index.d.ts +0 -14
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -14
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/log.d.ts +0 -11
- package/dist/cli/log.d.ts.map +0 -1
- package/dist/cli/log.js +0 -17
- package/dist/cli/log.js.map +0 -1
- package/dist/cli/publish.d.ts +0 -35
- package/dist/cli/publish.d.ts.map +0 -1
- package/dist/cli/publish.js +0 -271
- package/dist/cli/publish.js.map +0 -1
- package/dist/cli/run.d.ts +0 -51
- package/dist/cli/run.d.ts.map +0 -1
- package/dist/cli/run.js +0 -519
- package/dist/cli/run.js.map +0 -1
- package/dist/deployment/artifact/bindings.d.ts +0 -7
- package/dist/deployment/artifact/bindings.d.ts.map +0 -1
- package/dist/deployment/artifact/bindings.js +0 -44
- package/dist/deployment/artifact/bindings.js.map +0 -1
- package/dist/deployment/artifact/deployment.d.ts +0 -50
- package/dist/deployment/artifact/deployment.d.ts.map +0 -1
- package/dist/deployment/artifact/deployment.js +0 -132
- package/dist/deployment/artifact/deployment.js.map +0 -1
- package/dist/deployment/artifact/index.d.ts +0 -5
- package/dist/deployment/artifact/index.d.ts.map +0 -1
- package/dist/deployment/artifact/index.js +0 -4
- package/dist/deployment/artifact/index.js.map +0 -1
- package/dist/deployment/check/check.d.ts +0 -9
- package/dist/deployment/check/check.d.ts.map +0 -1
- package/dist/deployment/check/check.js +0 -96
- package/dist/deployment/check/check.js.map +0 -1
- package/dist/deployment/check/contract.d.ts +0 -34
- package/dist/deployment/check/contract.d.ts.map +0 -1
- package/dist/deployment/check/contract.js +0 -2
- package/dist/deployment/check/contract.js.map +0 -1
- package/dist/deployment/check/index.d.ts +0 -3
- package/dist/deployment/check/index.d.ts.map +0 -1
- package/dist/deployment/check/index.js +0 -2
- package/dist/deployment/check/index.js.map +0 -1
- package/dist/deployment/index.d.ts.map +0 -1
- package/dist/deployment/index.js.map +0 -1
- package/dist/deployment/provider/adapter.d.ts +0 -59
- package/dist/deployment/provider/adapter.d.ts.map +0 -1
- package/dist/deployment/provider/adapter.js +0 -84
- package/dist/deployment/provider/adapter.js.map +0 -1
- package/dist/deployment/provider/config.d.ts +0 -10
- package/dist/deployment/provider/config.d.ts.map +0 -1
- package/dist/deployment/provider/config.js +0 -8
- package/dist/deployment/provider/config.js.map +0 -1
- package/dist/deployment/provider/index.d.ts +0 -5
- package/dist/deployment/provider/index.d.ts.map +0 -1
- package/dist/deployment/provider/index.js +0 -3
- package/dist/deployment/provider/index.js.map +0 -1
- package/dist/domain/app.d.ts +0 -34
- package/dist/domain/app.d.ts.map +0 -1
- package/dist/domain/app.js +0 -2
- package/dist/domain/app.js.map +0 -1
- package/dist/domain/context.d.ts +0 -68
- package/dist/domain/context.d.ts.map +0 -1
- package/dist/domain/context.js +0 -2
- package/dist/domain/context.js.map +0 -1
- package/dist/domain/define.d.ts +0 -109
- package/dist/domain/define.d.ts.map +0 -1
- package/dist/domain/define.js +0 -102
- package/dist/domain/define.js.map +0 -1
- package/dist/domain/handlers.d.ts +0 -51
- package/dist/domain/handlers.d.ts.map +0 -1
- package/dist/domain/handlers.js +0 -88
- package/dist/domain/handlers.js.map +0 -1
- package/dist/domain/implement.d.ts +0 -5
- package/dist/domain/implement.d.ts.map +0 -1
- package/dist/domain/implement.js +0 -23
- package/dist/domain/implement.js.map +0 -1
- package/dist/domain/index.d.ts +0 -14
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js +0 -8
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/requirements.d.ts +0 -26
- package/dist/domain/requirements.d.ts.map +0 -1
- package/dist/domain/requirements.js +0 -98
- package/dist/domain/requirements.js.map +0 -1
- package/dist/graph/class/index.d.ts +0 -3
- package/dist/graph/class/index.d.ts.map +0 -1
- package/dist/graph/class/index.js +0 -3
- package/dist/graph/class/index.js.map +0 -1
- package/dist/graph/edge/index.d.ts +0 -3
- package/dist/graph/edge/index.d.ts.map +0 -1
- package/dist/graph/edge/index.js +0 -3
- package/dist/graph/edge/index.js.map +0 -1
- package/dist/graph/index.d.ts +0 -10
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -9
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/model/index.d.ts +0 -3
- package/dist/graph/model/index.d.ts.map +0 -1
- package/dist/graph/model/index.js +0 -3
- package/dist/graph/model/index.js.map +0 -1
- package/dist/graph/node/index.d.ts +0 -3
- package/dist/graph/node/index.d.ts.map +0 -1
- package/dist/graph/node/index.js +0 -3
- package/dist/graph/node/index.js.map +0 -1
- package/dist/graph/path/index.d.ts +0 -3
- package/dist/graph/path/index.d.ts.map +0 -1
- package/dist/graph/path/index.js +0 -3
- package/dist/graph/path/index.js.map +0 -1
- package/dist/graph/properties/index.d.ts +0 -3
- package/dist/graph/properties/index.d.ts.map +0 -1
- package/dist/graph/properties/index.js +0 -3
- package/dist/graph/properties/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/invocation/error.d.ts +0 -47
- package/dist/invocation/error.d.ts.map +0 -1
- package/dist/invocation/error.js +0 -93
- package/dist/invocation/error.js.map +0 -1
- package/dist/invocation/handler.d.ts +0 -51
- package/dist/invocation/handler.d.ts.map +0 -1
- package/dist/invocation/handler.js +0 -323
- package/dist/invocation/handler.js.map +0 -1
- package/dist/invocation/index.d.ts +0 -7
- package/dist/invocation/index.d.ts.map +0 -1
- package/dist/invocation/index.js +0 -3
- package/dist/invocation/index.js.map +0 -1
- package/dist/invocation/receiver.d.ts +0 -5
- package/dist/invocation/receiver.d.ts.map +0 -1
- package/dist/invocation/receiver.js +0 -70
- package/dist/invocation/receiver.js.map +0 -1
- package/dist/invocation/result.d.ts +0 -5
- package/dist/invocation/result.d.ts.map +0 -1
- package/dist/invocation/result.js +0 -142
- package/dist/invocation/result.js.map +0 -1
- package/dist/invocation/selection.d.ts +0 -27
- package/dist/invocation/selection.d.ts.map +0 -1
- package/dist/invocation/selection.js +0 -100
- package/dist/invocation/selection.js.map +0 -1
- package/dist/invocation/target.d.ts +0 -10
- package/dist/invocation/target.d.ts.map +0 -1
- package/dist/invocation/target.js +0 -48
- package/dist/invocation/target.js.map +0 -1
- package/dist/linter/adapters/typescript/discover.d.ts +0 -4
- package/dist/linter/adapters/typescript/discover.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/discover.js +0 -412
- package/dist/linter/adapters/typescript/discover.js.map +0 -1
- package/dist/linter/adapters/typescript/evidence-admission.d.ts +0 -5
- package/dist/linter/adapters/typescript/evidence-admission.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/evidence-admission.js +0 -22
- package/dist/linter/adapters/typescript/evidence-admission.js.map +0 -1
- package/dist/linter/adapters/typescript/imports.d.ts +0 -7
- package/dist/linter/adapters/typescript/imports.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/imports.js +0 -171
- package/dist/linter/adapters/typescript/imports.js.map +0 -1
- package/dist/linter/adapters/typescript/index.d.ts +0 -48
- package/dist/linter/adapters/typescript/index.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/index.js +0 -8
- package/dist/linter/adapters/typescript/index.js.map +0 -1
- package/dist/linter/adapters/typescript/query-observation.d.ts +0 -4
- package/dist/linter/adapters/typescript/query-observation.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/query-observation.js +0 -172
- package/dist/linter/adapters/typescript/query-observation.js.map +0 -1
- package/dist/linter/adapters/typescript/suppression-directives.d.ts +0 -5
- package/dist/linter/adapters/typescript/suppression-directives.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/suppression-directives.js +0 -85
- package/dist/linter/adapters/typescript/suppression-directives.js.map +0 -1
- package/dist/linter/adapters/typescript/syntax.d.ts +0 -39
- package/dist/linter/adapters/typescript/syntax.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/syntax.js +0 -183
- package/dist/linter/adapters/typescript/syntax.js.map +0 -1
- package/dist/linter/adapters/typescript/type-universe.d.ts +0 -2
- package/dist/linter/adapters/typescript/type-universe.d.ts.map +0 -1
- package/dist/linter/adapters/typescript/type-universe.js +0 -265
- package/dist/linter/adapters/typescript/type-universe.js.map +0 -1
- package/dist/linter/catalog/compile.d.ts +0 -3
- package/dist/linter/catalog/compile.d.ts.map +0 -1
- package/dist/linter/catalog/compile.js +0 -111
- package/dist/linter/catalog/compile.js.map +0 -1
- package/dist/linter/catalog/index.d.ts +0 -19
- package/dist/linter/catalog/index.d.ts.map +0 -1
- package/dist/linter/catalog/index.js +0 -3
- package/dist/linter/catalog/index.js.map +0 -1
- package/dist/linter/catalog/revision.d.ts +0 -7
- package/dist/linter/catalog/revision.d.ts.map +0 -1
- package/dist/linter/catalog/revision.js +0 -13
- package/dist/linter/catalog/revision.js.map +0 -1
- package/dist/linter/diagnostics/error.d.ts +0 -10
- package/dist/linter/diagnostics/error.d.ts.map +0 -1
- package/dist/linter/diagnostics/error.js +0 -10
- package/dist/linter/diagnostics/error.js.map +0 -1
- package/dist/linter/diagnostics/index.d.ts +0 -29
- package/dist/linter/diagnostics/index.d.ts.map +0 -1
- package/dist/linter/diagnostics/index.js +0 -3
- package/dist/linter/diagnostics/index.js.map +0 -1
- package/dist/linter/diagnostics/sort.d.ts +0 -3
- package/dist/linter/diagnostics/sort.d.ts.map +0 -1
- package/dist/linter/diagnostics/sort.js +0 -27
- package/dist/linter/diagnostics/sort.js.map +0 -1
- package/dist/linter/evaluation/binding/bind.d.ts +0 -5
- package/dist/linter/evaluation/binding/bind.d.ts.map +0 -1
- package/dist/linter/evaluation/binding/bind.js +0 -356
- package/dist/linter/evaluation/binding/bind.js.map +0 -1
- package/dist/linter/evaluation/binding/diagnostic.d.ts +0 -5
- package/dist/linter/evaluation/binding/diagnostic.d.ts.map +0 -1
- package/dist/linter/evaluation/binding/diagnostic.js +0 -17
- package/dist/linter/evaluation/binding/diagnostic.js.map +0 -1
- package/dist/linter/evaluation/binding/index.d.ts +0 -2
- package/dist/linter/evaluation/binding/index.d.ts.map +0 -1
- package/dist/linter/evaluation/binding/index.js +0 -2
- package/dist/linter/evaluation/binding/index.js.map +0 -1
- package/dist/linter/evaluation/contract/availability.d.ts +0 -28
- package/dist/linter/evaluation/contract/availability.d.ts.map +0 -1
- package/dist/linter/evaluation/contract/availability.js +0 -2
- package/dist/linter/evaluation/contract/availability.js.map +0 -1
- package/dist/linter/evaluation/contract/decision.d.ts +0 -26
- package/dist/linter/evaluation/contract/decision.d.ts.map +0 -1
- package/dist/linter/evaluation/contract/decision.js +0 -2
- package/dist/linter/evaluation/contract/decision.js.map +0 -1
- package/dist/linter/evaluation/contract/evidence.d.ts +0 -12
- package/dist/linter/evaluation/contract/evidence.d.ts.map +0 -1
- package/dist/linter/evaluation/contract/evidence.js +0 -2
- package/dist/linter/evaluation/contract/evidence.js.map +0 -1
- package/dist/linter/evaluation/contract/implementation.d.ts +0 -22
- package/dist/linter/evaluation/contract/implementation.d.ts.map +0 -1
- package/dist/linter/evaluation/contract/implementation.js +0 -2
- package/dist/linter/evaluation/contract/implementation.js.map +0 -1
- package/dist/linter/evaluation/contract/index.d.ts +0 -5
- package/dist/linter/evaluation/contract/index.d.ts.map +0 -1
- package/dist/linter/evaluation/contract/index.js +0 -2
- package/dist/linter/evaluation/contract/index.js.map +0 -1
- package/dist/linter/evaluation/index.d.ts +0 -3
- package/dist/linter/evaluation/index.d.ts.map +0 -1
- package/dist/linter/evaluation/index.js +0 -2
- package/dist/linter/evaluation/index.js.map +0 -1
- package/dist/linter/implementations/source/capabilities.d.ts +0 -3
- package/dist/linter/implementations/source/capabilities.d.ts.map +0 -1
- package/dist/linter/implementations/source/capabilities.js +0 -41
- package/dist/linter/implementations/source/capabilities.js.map +0 -1
- package/dist/linter/implementations/source/contract.d.ts +0 -17
- package/dist/linter/implementations/source/contract.d.ts.map +0 -1
- package/dist/linter/implementations/source/contract.js +0 -53
- package/dist/linter/implementations/source/contract.js.map +0 -1
- package/dist/linter/implementations/source/functions.d.ts +0 -3
- package/dist/linter/implementations/source/functions.d.ts.map +0 -1
- package/dist/linter/implementations/source/functions.js +0 -102
- package/dist/linter/implementations/source/functions.js.map +0 -1
- package/dist/linter/implementations/source/global.d.ts +0 -3
- package/dist/linter/implementations/source/global.d.ts.map +0 -1
- package/dist/linter/implementations/source/global.js +0 -814
- package/dist/linter/implementations/source/global.js.map +0 -1
- package/dist/linter/implementations/source/index.d.ts +0 -4
- package/dist/linter/implementations/source/index.d.ts.map +0 -1
- package/dist/linter/implementations/source/index.js +0 -4
- package/dist/linter/implementations/source/index.js.map +0 -1
- package/dist/linter/implementations/source/integrations.d.ts +0 -3
- package/dist/linter/implementations/source/integrations.d.ts.map +0 -1
- package/dist/linter/implementations/source/integrations.js +0 -186
- package/dist/linter/implementations/source/integrations.js.map +0 -1
- package/dist/linter/implementations/source/migrations.d.ts +0 -3
- package/dist/linter/implementations/source/migrations.d.ts.map +0 -1
- package/dist/linter/implementations/source/migrations.js +0 -115
- package/dist/linter/implementations/source/migrations.js.map +0 -1
- package/dist/linter/implementations/source/mutations.d.ts +0 -3
- package/dist/linter/implementations/source/mutations.d.ts.map +0 -1
- package/dist/linter/implementations/source/mutations.js +0 -185
- package/dist/linter/implementations/source/mutations.js.map +0 -1
- package/dist/linter/implementations/source/queries.d.ts +0 -3
- package/dist/linter/implementations/source/queries.d.ts.map +0 -1
- package/dist/linter/implementations/source/queries.js +0 -1000
- package/dist/linter/implementations/source/queries.js.map +0 -1
- package/dist/linter/implementations/source/rules.d.ts +0 -3
- package/dist/linter/implementations/source/rules.d.ts.map +0 -1
- package/dist/linter/implementations/source/rules.js +0 -141
- package/dist/linter/implementations/source/rules.js.map +0 -1
- package/dist/linter/implementations/source/schema.d.ts +0 -3
- package/dist/linter/implementations/source/schema.d.ts.map +0 -1
- package/dist/linter/implementations/source/schema.js +0 -105
- package/dist/linter/implementations/source/schema.js.map +0 -1
- package/dist/linter/implementations/source/shared.d.ts +0 -42
- package/dist/linter/implementations/source/shared.d.ts.map +0 -1
- package/dist/linter/implementations/source/shared.js +0 -239
- package/dist/linter/implementations/source/shared.js.map +0 -1
- package/dist/linter/implementations/source/states.d.ts +0 -3
- package/dist/linter/implementations/source/states.d.ts.map +0 -1
- package/dist/linter/implementations/source/states.js +0 -2
- package/dist/linter/implementations/source/states.js.map +0 -1
- package/dist/linter/implementations/source/tests.d.ts +0 -3
- package/dist/linter/implementations/source/tests.d.ts.map +0 -1
- package/dist/linter/implementations/source/tests.js +0 -32
- package/dist/linter/implementations/source/tests.js.map +0 -1
- package/dist/linter/implementations/source/ui.d.ts +0 -3
- package/dist/linter/implementations/source/ui.d.ts.map +0 -1
- package/dist/linter/implementations/source/ui.js +0 -21
- package/dist/linter/implementations/source/ui.js.map +0 -1
- package/dist/linter/implementations/source/utils.d.ts +0 -3
- package/dist/linter/implementations/source/utils.d.ts.map +0 -1
- package/dist/linter/implementations/source/utils.js +0 -29
- package/dist/linter/implementations/source/utils.js.map +0 -1
- package/dist/linter/implementations/source/verifiers.d.ts +0 -3
- package/dist/linter/implementations/source/verifiers.d.ts.map +0 -1
- package/dist/linter/implementations/source/verifiers.js +0 -33
- package/dist/linter/implementations/source/verifiers.js.map +0 -1
- package/dist/linter/implementations/source/views.d.ts +0 -3
- package/dist/linter/implementations/source/views.d.ts.map +0 -1
- package/dist/linter/implementations/source/views.js +0 -36
- package/dist/linter/implementations/source/views.js.map +0 -1
- package/dist/linter/implementations/source/workflows.d.ts +0 -3
- package/dist/linter/implementations/source/workflows.d.ts.map +0 -1
- package/dist/linter/implementations/source/workflows.js +0 -308
- package/dist/linter/implementations/source/workflows.js.map +0 -1
- package/dist/linter/index.d.ts +0 -10
- package/dist/linter/index.d.ts.map +0 -1
- package/dist/linter/index.js +0 -4
- package/dist/linter/index.js.map +0 -1
- package/dist/linter/lint.d.ts +0 -24
- package/dist/linter/lint.d.ts.map +0 -1
- package/dist/linter/lint.js +0 -70
- package/dist/linter/lint.js.map +0 -1
- package/dist/linter/oxlint/index.d.ts +0 -4
- package/dist/linter/oxlint/index.d.ts.map +0 -1
- package/dist/linter/oxlint/index.js +0 -2
- package/dist/linter/oxlint/index.js.map +0 -1
- package/dist/linter/oxlint/process.d.ts +0 -19
- package/dist/linter/oxlint/process.d.ts.map +0 -1
- package/dist/linter/oxlint/process.js +0 -170
- package/dist/linter/oxlint/process.js.map +0 -1
- package/dist/linter/oxlint/run.d.ts +0 -8
- package/dist/linter/oxlint/run.d.ts.map +0 -1
- package/dist/linter/oxlint/run.js +0 -252
- package/dist/linter/oxlint/run.js.map +0 -1
- package/dist/linter/oxlint-config/ignore-patterns.d.ts +0 -6
- package/dist/linter/oxlint-config/ignore-patterns.d.ts.map +0 -1
- package/dist/linter/oxlint-config/ignore-patterns.js +0 -10
- package/dist/linter/oxlint-config/ignore-patterns.js.map +0 -1
- package/dist/linter/oxlint-config/index.d.ts +0 -5
- package/dist/linter/oxlint-config/index.d.ts.map +0 -1
- package/dist/linter/oxlint-config/index.js +0 -18
- package/dist/linter/oxlint-config/index.js.map +0 -1
- package/dist/linter/packs/domain.d.ts +0 -3
- package/dist/linter/packs/domain.d.ts.map +0 -1
- package/dist/linter/packs/domain.js +0 -8
- package/dist/linter/packs/domain.js.map +0 -1
- package/dist/linter/packs/index.d.ts +0 -9
- package/dist/linter/packs/index.d.ts.map +0 -1
- package/dist/linter/packs/index.js +0 -2
- package/dist/linter/packs/index.js.map +0 -1
- package/dist/linter/policy/compile.d.ts +0 -3
- package/dist/linter/policy/compile.d.ts.map +0 -1
- package/dist/linter/policy/compile.js +0 -258
- package/dist/linter/policy/compile.js.map +0 -1
- package/dist/linter/policy/configuration.d.ts +0 -12
- package/dist/linter/policy/configuration.d.ts.map +0 -1
- package/dist/linter/policy/configuration.js +0 -119
- package/dist/linter/policy/configuration.js.map +0 -1
- package/dist/linter/policy/generated.d.ts +0 -5
- package/dist/linter/policy/generated.d.ts.map +0 -1
- package/dist/linter/policy/generated.js +0 -782
- package/dist/linter/policy/generated.js.map +0 -1
- package/dist/linter/policy/index.d.ts +0 -45
- package/dist/linter/policy/index.d.ts.map +0 -1
- package/dist/linter/policy/index.js +0 -4
- package/dist/linter/policy/index.js.map +0 -1
- package/dist/linter/qualification/index.d.ts +0 -11
- package/dist/linter/qualification/index.d.ts.map +0 -1
- package/dist/linter/qualification/index.js +0 -3
- package/dist/linter/qualification/index.js.map +0 -1
- package/dist/linter/qualification/query-fixtures.d.ts +0 -3
- package/dist/linter/qualification/query-fixtures.d.ts.map +0 -1
- package/dist/linter/qualification/query-fixtures.js +0 -69
- package/dist/linter/qualification/query-fixtures.js.map +0 -1
- package/dist/linter/qualification/runner.d.ts +0 -4
- package/dist/linter/qualification/runner.d.ts.map +0 -1
- package/dist/linter/qualification/runner.js +0 -7
- package/dist/linter/qualification/runner.js.map +0 -1
- package/dist/linter/report/format.d.ts +0 -4
- package/dist/linter/report/format.d.ts.map +0 -1
- package/dist/linter/report/format.js +0 -33
- package/dist/linter/report/format.js.map +0 -1
- package/dist/linter/report/index.d.ts +0 -3
- package/dist/linter/report/index.d.ts.map +0 -1
- package/dist/linter/report/index.js +0 -2
- package/dist/linter/report/index.js.map +0 -1
- package/dist/linter/requirements/index.d.ts +0 -3
- package/dist/linter/requirements/index.d.ts.map +0 -1
- package/dist/linter/requirements/index.js +0 -2
- package/dist/linter/requirements/index.js.map +0 -1
- package/dist/linter/requirements/model.d.ts +0 -9
- package/dist/linter/requirements/model.d.ts.map +0 -1
- package/dist/linter/requirements/model.js +0 -2
- package/dist/linter/requirements/model.js.map +0 -1
- package/dist/linter/requirements/registry.d.ts +0 -4
- package/dist/linter/requirements/registry.d.ts.map +0 -1
- package/dist/linter/requirements/registry.js +0 -188
- package/dist/linter/requirements/registry.js.map +0 -1
- package/dist/linter/semantics/query/decision.d.ts +0 -5
- package/dist/linter/semantics/query/decision.d.ts.map +0 -1
- package/dist/linter/semantics/query/decision.js +0 -74
- package/dist/linter/semantics/query/decision.js.map +0 -1
- package/dist/linter/semantics/query/index.d.ts +0 -4
- package/dist/linter/semantics/query/index.d.ts.map +0 -1
- package/dist/linter/semantics/query/index.js +0 -3
- package/dist/linter/semantics/query/index.js.map +0 -1
- package/dist/linter/semantics/query/observation.d.ts +0 -36
- package/dist/linter/semantics/query/observation.d.ts.map +0 -1
- package/dist/linter/semantics/query/observation.js +0 -13
- package/dist/linter/semantics/query/observation.js.map +0 -1
- package/dist/linter/suppression/apply.d.ts +0 -4
- package/dist/linter/suppression/apply.d.ts.map +0 -1
- package/dist/linter/suppression/apply.js +0 -48
- package/dist/linter/suppression/apply.js.map +0 -1
- package/dist/linter/suppression/directive.d.ts +0 -11
- package/dist/linter/suppression/directive.d.ts.map +0 -1
- package/dist/linter/suppression/directive.js +0 -2
- package/dist/linter/suppression/directive.js.map +0 -1
- package/dist/linter/suppression/index.d.ts +0 -14
- package/dist/linter/suppression/index.d.ts.map +0 -1
- package/dist/linter/suppression/index.js +0 -2
- package/dist/linter/suppression/index.js.map +0 -1
- package/dist/mutation/contract.d.ts +0 -134
- package/dist/mutation/contract.d.ts.map +0 -1
- package/dist/mutation/contract.js +0 -2
- package/dist/mutation/contract.js.map +0 -1
- package/dist/mutation/define.d.ts +0 -9
- package/dist/mutation/define.d.ts.map +0 -1
- package/dist/mutation/define.js +0 -24
- package/dist/mutation/define.js.map +0 -1
- package/dist/mutation/errors.d.ts +0 -3
- package/dist/mutation/errors.d.ts.map +0 -1
- package/dist/mutation/errors.js +0 -30
- package/dist/mutation/errors.js.map +0 -1
- package/dist/mutation/execute.d.ts +0 -11
- package/dist/mutation/execute.d.ts.map +0 -1
- package/dist/mutation/execute.js +0 -24
- package/dist/mutation/execute.js.map +0 -1
- package/dist/mutation/index.d.ts +0 -8
- package/dist/mutation/index.d.ts.map +0 -1
- package/dist/mutation/index.js +0 -5
- package/dist/mutation/index.js.map +0 -1
- package/dist/mutation/rich.d.ts +0 -4
- package/dist/mutation/rich.d.ts.map +0 -1
- package/dist/mutation/rich.js +0 -147
- package/dist/mutation/rich.js.map +0 -1
- package/dist/query/composite/contract.d.ts +0 -37
- package/dist/query/composite/contract.d.ts.map +0 -1
- package/dist/query/composite/contract.js +0 -2
- package/dist/query/composite/contract.js.map +0 -1
- package/dist/query/composite/errors.d.ts +0 -8
- package/dist/query/composite/errors.d.ts.map +0 -1
- package/dist/query/composite/errors.js +0 -9
- package/dist/query/composite/errors.js.map +0 -1
- package/dist/query/composite/index.d.ts +0 -6
- package/dist/query/composite/index.d.ts.map +0 -1
- package/dist/query/composite/index.js +0 -3
- package/dist/query/composite/index.js.map +0 -1
- package/dist/query/composite/plan.d.ts +0 -38
- package/dist/query/composite/plan.d.ts.map +0 -1
- package/dist/query/composite/plan.js +0 -225
- package/dist/query/composite/plan.js.map +0 -1
- package/dist/query/contract.d.ts +0 -58
- package/dist/query/contract.d.ts.map +0 -1
- package/dist/query/contract.js +0 -2
- package/dist/query/contract.js.map +0 -1
- package/dist/query/define.d.ts +0 -3
- package/dist/query/define.d.ts.map +0 -1
- package/dist/query/define.js +0 -90
- package/dist/query/define.js.map +0 -1
- package/dist/query/definition.d.ts +0 -29
- package/dist/query/definition.d.ts.map +0 -1
- package/dist/query/definition.js +0 -2
- package/dist/query/definition.js.map +0 -1
- package/dist/query/errors.d.ts +0 -9
- package/dist/query/errors.d.ts.map +0 -1
- package/dist/query/errors.js +0 -15
- package/dist/query/errors.js.map +0 -1
- package/dist/query/execute.d.ts +0 -20
- package/dist/query/execute.d.ts.map +0 -1
- package/dist/query/execute.js +0 -97
- package/dist/query/execute.js.map +0 -1
- package/dist/query/index.d.ts +0 -15
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -8
- package/dist/query/index.js.map +0 -1
- package/dist/query/node.d.ts +0 -109
- package/dist/query/node.d.ts.map +0 -1
- package/dist/query/node.js +0 -166
- package/dist/query/node.js.map +0 -1
- package/dist/query/result/contract.d.ts +0 -23
- package/dist/query/result/contract.d.ts.map +0 -1
- package/dist/query/result/contract.js +0 -2
- package/dist/query/result/contract.js.map +0 -1
- package/dist/query/result/index.d.ts +0 -3
- package/dist/query/result/index.d.ts.map +0 -1
- package/dist/query/result/index.js +0 -2
- package/dist/query/result/index.js.map +0 -1
- package/dist/query/result/projection.d.ts +0 -3
- package/dist/query/result/projection.d.ts.map +0 -1
- package/dist/query/result/projection.js +0 -100
- package/dist/query/result/projection.js.map +0 -1
- package/dist/query/selection.d.ts +0 -4
- package/dist/query/selection.d.ts.map +0 -1
- package/dist/query/selection.js +0 -25
- package/dist/query/selection.js.map +0 -1
- package/dist/result/index.d.ts +0 -3
- package/dist/result/index.d.ts.map +0 -1
- package/dist/result/index.js +0 -2
- package/dist/result/index.js.map +0 -1
- package/dist/result/result.d.ts +0 -10
- package/dist/result/result.d.ts.map +0 -1
- package/dist/result/result.js +0 -7
- package/dist/result/result.js.map +0 -1
- package/dist/schema/index.d.ts +0 -3
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -3
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/kernel/index.d.ts +0 -3
- package/dist/schema/kernel/index.d.ts.map +0 -1
- package/dist/schema/kernel/index.js +0 -3
- package/dist/schema/kernel/index.js.map +0 -1
- package/dist/schema/v1/index.d.ts +0 -3
- package/dist/schema/v1/index.d.ts.map +0 -1
- package/dist/schema/v1/index.js +0 -3
- package/dist/schema/v1/index.js.map +0 -1
- package/dist/server/application.d.ts +0 -36
- package/dist/server/application.d.ts.map +0 -1
- package/dist/server/application.js +0 -128
- package/dist/server/application.js.map +0 -1
- package/dist/server/index.d.ts +0 -6
- package/dist/server/index.d.ts.map +0 -1
- package/dist/server/index.js +0 -3
- package/dist/server/index.js.map +0 -1
- package/dist/server/node/index.d.ts +0 -3
- package/dist/server/node/index.d.ts.map +0 -1
- package/dist/server/node/index.js +0 -2
- package/dist/server/node/index.js.map +0 -1
- package/dist/server/node/server.d.ts +0 -14
- package/dist/server/node/server.d.ts.map +0 -1
- package/dist/server/node/server.js +0 -71
- package/dist/server/node/server.js.map +0 -1
- package/dist/server/remote.d.ts +0 -57
- package/dist/server/remote.d.ts.map +0 -1
- package/dist/server/remote.js +0 -795
- package/dist/server/remote.js.map +0 -1
- package/dist/server/source.d.ts +0 -13
- package/dist/server/source.d.ts.map +0 -1
- package/dist/server/source.js +0 -40
- package/dist/server/source.js.map +0 -1
- package/dist/state/index.d.ts +0 -4
- package/dist/state/index.d.ts.map +0 -1
- package/dist/state/index.js +0 -2
- package/dist/state/index.js.map +0 -1
- package/dist/state/machine.d.ts +0 -28
- package/dist/state/machine.d.ts.map +0 -1
- package/dist/state/machine.js +0 -32
- package/dist/state/machine.js.map +0 -1
- package/dist/state/relation.d.ts +0 -28
- package/dist/state/relation.d.ts.map +0 -1
- package/dist/state/relation.js +0 -48
- package/dist/state/relation.js.map +0 -1
- package/dist/value/index.d.ts +0 -3
- package/dist/value/index.d.ts.map +0 -1
- package/dist/value/index.js +0 -3
- package/dist/value/index.js.map +0 -1
- package/dist/view/admission.d.ts +0 -6
- package/dist/view/admission.d.ts.map +0 -1
- package/dist/view/admission.js +0 -43
- package/dist/view/admission.js.map +0 -1
- package/dist/view/compile.d.ts +0 -15
- package/dist/view/compile.d.ts.map +0 -1
- package/dist/view/compile.js +0 -186
- package/dist/view/compile.js.map +0 -1
- package/dist/view/define.d.ts +0 -11
- package/dist/view/define.d.ts.map +0 -1
- package/dist/view/define.js +0 -173
- package/dist/view/define.js.map +0 -1
- package/dist/view/definition.d.ts +0 -89
- package/dist/view/definition.d.ts.map +0 -1
- package/dist/view/definition.js +0 -2
- package/dist/view/definition.js.map +0 -1
- package/dist/view/index.d.ts +0 -4
- package/dist/view/index.d.ts.map +0 -1
- package/dist/view/index.js +0 -3
- package/dist/view/index.js.map +0 -1
- package/dist/workflow/binding.d.ts +0 -43
- package/dist/workflow/binding.d.ts.map +0 -1
- package/dist/workflow/binding.js +0 -32
- package/dist/workflow/binding.js.map +0 -1
- package/dist/workflow/contract.d.ts +0 -57
- package/dist/workflow/contract.d.ts.map +0 -1
- package/dist/workflow/contract.js +0 -2
- package/dist/workflow/contract.js.map +0 -1
- package/dist/workflow/define.d.ts +0 -4
- package/dist/workflow/define.d.ts.map +0 -1
- package/dist/workflow/define.js +0 -57
- package/dist/workflow/define.js.map +0 -1
- package/dist/workflow/index.d.ts +0 -7
- package/dist/workflow/index.d.ts.map +0 -1
- package/dist/workflow/index.js +0 -4
- package/dist/workflow/index.js.map +0 -1
- package/dist/workflow/runner.d.ts +0 -4
- package/dist/workflow/runner.d.ts.map +0 -1
- package/dist/workflow/runner.js +0 -24
- package/dist/workflow/runner.js.map +0 -1
- package/dist/workflow/step/index.d.ts +0 -3
- package/dist/workflow/step/index.d.ts.map +0 -1
- package/dist/workflow/step/index.js +0 -2
- package/dist/workflow/step/index.js.map +0 -1
- package/dist/workflow/step/inline.d.ts +0 -6
- package/dist/workflow/step/inline.d.ts.map +0 -1
- package/dist/workflow/step/inline.js +0 -44
- package/dist/workflow/step/inline.js.map +0 -1
- package/dist/workflow/step/step.d.ts +0 -5
- package/dist/workflow/step/step.d.ts.map +0 -1
- package/dist/workflow/step/step.js +0 -2
- package/dist/workflow/step/step.js.map +0 -1
|
@@ -0,0 +1,1404 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { expressionType, importedSymbol, propertyChain, staticText, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
3
|
+
import { ambiguity, callback, calls, DSL_MODULES, definitionOriginAmbiguity, definitionObjects, domainProjectorEvidence, forbiddenIoImport, hasForbiddenGlobalCall, production, violation, } from './shared.js';
|
|
4
|
+
import { stateMachineIdentity, statePropertyIdentity } from './state-machine.js';
|
|
5
|
+
const FORBIDDEN_LAYERS = new Set(['integrations', 'functions', 'providers', 'queries']);
|
|
6
|
+
const FORBIDDEN_CALLS = new Set(['invoke', 'query', 'retry', 'run', 'submit']);
|
|
7
|
+
export const mutationRules = [
|
|
8
|
+
{
|
|
9
|
+
id: 'MUT-PLAN-REQ',
|
|
10
|
+
ruleRevision: '9201a4e5799f62cc8df37d281d1f02516132632e33b4a82187c399780bdfe340',
|
|
11
|
+
evaluate(project) {
|
|
12
|
+
const evidence = [];
|
|
13
|
+
const targets = [];
|
|
14
|
+
for (const file of production(project, 'mutations')) {
|
|
15
|
+
const builderScopes = mutationBuilderScopes(file);
|
|
16
|
+
visit(file.source, (node) => {
|
|
17
|
+
if (!ts.isCallExpression(node))
|
|
18
|
+
return;
|
|
19
|
+
const operation = mutationBuilderOperation(node, builderScopes);
|
|
20
|
+
if (operation === undefined)
|
|
21
|
+
return;
|
|
22
|
+
const classOperation = classOperationForBuilder(operation);
|
|
23
|
+
if (classOperation === undefined)
|
|
24
|
+
return;
|
|
25
|
+
const input = staticObject(node.arguments[0]);
|
|
26
|
+
const selectedClass = input && assignedValue(input, 'class');
|
|
27
|
+
const target = selectedClass && dependencyClassTarget(selectedClass);
|
|
28
|
+
if (selectedClass !== undefined && target !== undefined) {
|
|
29
|
+
targets.push({ file, node: selectedClass, ...target, operation: classOperation });
|
|
30
|
+
}
|
|
31
|
+
else if (selectedClass && expressionSelectsDependency(selectedClass)) {
|
|
32
|
+
evidence.push(ambiguity(file, selectedClass, 'Mutation plan selects a foreign Class dynamically, so its Application requirement cannot be proven.'));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const identityCalls = [];
|
|
37
|
+
for (const file of production(project, 'functions')) {
|
|
38
|
+
visit(file.source, (node) => {
|
|
39
|
+
if (ts.isCallExpression(node) && kernelProvisionCall(node)) {
|
|
40
|
+
identityCalls.push({ file, node, syscall: 'provision' });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
for (const node of kernelRegisterCalls(file))
|
|
44
|
+
identityCalls.push({ file, node, syscall: 'register' });
|
|
45
|
+
}
|
|
46
|
+
if (targets.length === 0 && identityCalls.length === 0)
|
|
47
|
+
return evidence;
|
|
48
|
+
const requirements = applicationPlanRequirements(project);
|
|
49
|
+
for (const target of targets) {
|
|
50
|
+
const key = classRequirementKey(target.dependency, target.className, target.operation);
|
|
51
|
+
if (requirements.classes.has(key))
|
|
52
|
+
continue;
|
|
53
|
+
evidence.push(requirements.indeterminate
|
|
54
|
+
? ambiguity(target.file, target.node, `Application Class requirements are opaque for dependency ${target.dependency} Class ${target.className}.`)
|
|
55
|
+
: violation(target.file, target.node, `Mutation plan dependency ${target.dependency} Class ${target.className} lacks Application ${target.operation} authority.`));
|
|
56
|
+
}
|
|
57
|
+
for (const invocation of identityCalls) {
|
|
58
|
+
if (!requirements.functions.has(invocation.syscall)) {
|
|
59
|
+
const name = invocation.syscall === 'register' ? 'Register' : 'Provision';
|
|
60
|
+
evidence.push(requirements.indeterminate
|
|
61
|
+
? ambiguity(invocation.file, invocation.node, `Application Function requirements are opaque for Kernel ${name}.`)
|
|
62
|
+
: violation(invocation.file, invocation.node, `Kernel ${name} invocation lacks the exact Application Function requirement.`));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return evidence;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'MUT-STATE-INITIAL',
|
|
70
|
+
ruleRevision: 'd88f178994e9ad56d14f50ad5ffdff398413e42a690985c5ddc669c0f293d9bb',
|
|
71
|
+
evaluate(project) {
|
|
72
|
+
const evidence = [];
|
|
73
|
+
const machineProperties = machinePropertiesByClass(project);
|
|
74
|
+
for (const file of production(project, 'mutations')) {
|
|
75
|
+
const builderScopes = mutationBuilderScopes(file);
|
|
76
|
+
visit(file.source, (node) => {
|
|
77
|
+
if (!ts.isCallExpression(node) ||
|
|
78
|
+
mutationBuilderMember(node, builderScopes) !== 'createNode') {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const input = staticObject(node.arguments[0]);
|
|
82
|
+
if (!input) {
|
|
83
|
+
if (hasMachineCandidates(machineProperties)) {
|
|
84
|
+
evidence.push(ambiguity(file, node, 'Mutation createNode input is dynamic, so machine-state initialization cannot be proven.'));
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const selectedClass = propertiesForClass(input, machineProperties);
|
|
89
|
+
if (selectedClass.kind === 'ambiguous') {
|
|
90
|
+
evidence.push(ambiguity(file, assignedValue(input, 'class') ?? input, 'Mutation createNode Class has no statically resolvable Schema owner.'));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (selectedClass.kind === 'absent')
|
|
94
|
+
return;
|
|
95
|
+
const selected = selectedClass.properties;
|
|
96
|
+
const propsValue = assignedValue(input, 'props');
|
|
97
|
+
const props = staticObject(propsValue);
|
|
98
|
+
if (!props) {
|
|
99
|
+
evidence.push(propsValue === undefined
|
|
100
|
+
? violation(file, input, 'Mutation creates a StateMachine-backed node without its initial state.')
|
|
101
|
+
: ambiguity(file, propsValue, 'Mutation createNode properties are dynamic, so machine-state initialization cannot be proven.'));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const assignments = machineAssignments(props, selected);
|
|
105
|
+
const uncertain = [...selected.keys()].filter((name) => spreadMaySet(props, name));
|
|
106
|
+
if (uncertain.length > 0) {
|
|
107
|
+
evidence.push(ambiguity(file, props, `Mutation createNode properties contain a spread that may determine machine-backed ${uncertain.join(', ')}.`));
|
|
108
|
+
}
|
|
109
|
+
for (const name of selected.keys()) {
|
|
110
|
+
if (assignments.some((property) => staticPropertyName(property) === name))
|
|
111
|
+
continue;
|
|
112
|
+
if (uncertain.includes(name))
|
|
113
|
+
continue;
|
|
114
|
+
evidence.push(violation(file, props, `Mutation creates a StateMachine-backed node without initial property ${name}.`));
|
|
115
|
+
}
|
|
116
|
+
for (const property of assignments) {
|
|
117
|
+
const name = staticPropertyName(property) ?? '<dynamic>';
|
|
118
|
+
if (uncertain.includes(name))
|
|
119
|
+
continue;
|
|
120
|
+
const expectedIdentity = selected.get(name);
|
|
121
|
+
const value = assignedPropertyValue(property);
|
|
122
|
+
const initial = initialIdentity(project, file, value);
|
|
123
|
+
if (initial.kind === 'resolved' && initial.identity === expectedIdentity)
|
|
124
|
+
continue;
|
|
125
|
+
if (initial.kind === 'resolved') {
|
|
126
|
+
evidence.push(violation(file, value, `Mutation initializes machine-backed property ${name} from a different StateMachine authority.`));
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (staticText(value) !== undefined) {
|
|
130
|
+
evidence.push(violation(file, value, `Mutation initializes machine-backed property ${name} with a copied state instead of machine.initial.`));
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
evidence.push(ambiguity(file, value, `Mutation StateMachine initializer for ${name} has no resolvable machine.initial source.`));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return evidence;
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'MUT-STATE-ATOMIC',
|
|
143
|
+
ruleRevision: 'c734069c35bab09f47b4fcd6b3f207fccceb69a9da4f1fb1c50d9fd2711bf6dd',
|
|
144
|
+
evaluate(project) {
|
|
145
|
+
const evidence = [];
|
|
146
|
+
const machineProperties = machinePropertiesByClass(project);
|
|
147
|
+
for (const file of production(project, 'mutations')) {
|
|
148
|
+
const builderScopes = mutationBuilderScopes(file);
|
|
149
|
+
visit(file.source, (node) => {
|
|
150
|
+
if (!ts.isCallExpression(node))
|
|
151
|
+
return;
|
|
152
|
+
const member = mutationBuilderMember(node, builderScopes);
|
|
153
|
+
if (member === undefined)
|
|
154
|
+
return;
|
|
155
|
+
if (member === 'updateNode') {
|
|
156
|
+
if (!hasMachineCandidates(machineProperties))
|
|
157
|
+
return;
|
|
158
|
+
const input = staticObject(node.arguments[0]);
|
|
159
|
+
if (!input) {
|
|
160
|
+
evidence.push(ambiguity(file, node, 'Mutation updateNode input is dynamic and may bypass a StateMachine transition.'));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const selectedClass = propertiesForClass(input, machineProperties);
|
|
164
|
+
if (selectedClass.kind === 'ambiguous') {
|
|
165
|
+
evidence.push(ambiguity(file, assignedValue(input, 'class') ?? input, 'Mutation updateNode Class has no statically resolvable Schema owner.'));
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (selectedClass.kind === 'absent')
|
|
169
|
+
return;
|
|
170
|
+
const selected = selectedClass.properties;
|
|
171
|
+
const propsValue = assignedValue(input, 'props');
|
|
172
|
+
const props = staticObject(propsValue);
|
|
173
|
+
if (!props) {
|
|
174
|
+
evidence.push(ambiguity(file, propsValue ?? input, 'Mutation updateNode properties are dynamic and may bypass a StateMachine transition.'));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (hasSpread(props)) {
|
|
178
|
+
evidence.push(ambiguity(file, props, 'Mutation updateNode properties contain a spread that may bypass a StateMachine transition.'));
|
|
179
|
+
}
|
|
180
|
+
const setValue = assignedValue(props, 'set');
|
|
181
|
+
const set = staticObject(setValue);
|
|
182
|
+
if (setValue !== undefined && !set) {
|
|
183
|
+
const typed = typedPatchMachineProperties(project, file, setValue, selected);
|
|
184
|
+
if (typed === undefined) {
|
|
185
|
+
evidence.push(ambiguity(file, setValue, 'Mutation updateNode set patch is dynamic and may bypass a StateMachine transition.'));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
for (const property of typed) {
|
|
189
|
+
evidence.push(violation(file, setValue, `Mutation updateNode patch type permits machine-backed property ${property}; use transition for one atomic compare-and-set.`));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (set && hasSpread(set)) {
|
|
194
|
+
evidence.push(ambiguity(file, set, 'Mutation updateNode set patch contains a spread that may bypass a StateMachine transition.'));
|
|
195
|
+
}
|
|
196
|
+
for (const property of set ? machineAssignments(set, selected) : []) {
|
|
197
|
+
evidence.push(violation(file, property, `Mutation writes machine-backed property ${String(staticPropertyName(property))} through updateNode; use transition for one atomic compare-and-set.`));
|
|
198
|
+
}
|
|
199
|
+
const unsetValue = assignedValue(props, 'unset');
|
|
200
|
+
const unset = unsetValue && staticStringArray(unsetValue);
|
|
201
|
+
if (unsetValue !== undefined && unset === undefined) {
|
|
202
|
+
evidence.push(ambiguity(file, unsetValue, 'Mutation updateNode unset patch is dynamic and may bypass a StateMachine transition.'));
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
for (const property of unset ?? []) {
|
|
206
|
+
if (!selected.has(property.value))
|
|
207
|
+
continue;
|
|
208
|
+
evidence.push(violation(file, property.node, `Mutation unsets machine-backed property ${property.value} through updateNode; StateMachine changes require transition.`));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (member !== 'transition')
|
|
213
|
+
return;
|
|
214
|
+
if (!hasMachineCandidates(machineProperties))
|
|
215
|
+
return;
|
|
216
|
+
const input = staticObject(node.arguments[0]);
|
|
217
|
+
if (!input) {
|
|
218
|
+
evidence.push(ambiguity(file, node, 'StateMachine transition input is not one static object.'));
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const removed = [
|
|
222
|
+
'machine',
|
|
223
|
+
'lifecycle',
|
|
224
|
+
'decision',
|
|
225
|
+
'to',
|
|
226
|
+
'transition',
|
|
227
|
+
'witness',
|
|
228
|
+
'step',
|
|
229
|
+
].filter((name) => assignedValue(input, name) !== undefined);
|
|
230
|
+
if (removed.length > 0) {
|
|
231
|
+
evidence.push(violation(file, input, `StateMachine transition derives authority and target from StateProperty; remove ${removed.join(', ')}.`));
|
|
232
|
+
}
|
|
233
|
+
const spread = hasSpread(input);
|
|
234
|
+
if (spread) {
|
|
235
|
+
evidence.push(ambiguity(file, input, 'StateMachine transition input contains a spread that may override or add governed fields.'));
|
|
236
|
+
}
|
|
237
|
+
if (!spread) {
|
|
238
|
+
for (const required of ['from', 'event']) {
|
|
239
|
+
if (assignedValue(input, required) !== undefined)
|
|
240
|
+
continue;
|
|
241
|
+
evidence.push(violation(file, input, `StateMachine transition has no ${required} intent.`));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const selectedClass = propertiesForClass(input, machineProperties);
|
|
245
|
+
if (selectedClass.kind === 'ambiguous') {
|
|
246
|
+
evidence.push(ambiguity(file, assignedValue(input, 'class') ?? input, 'StateMachine transition Class has no statically resolvable Schema owner.'));
|
|
247
|
+
}
|
|
248
|
+
const property = staticTextValue(assignedValue(input, 'property'));
|
|
249
|
+
if (property === undefined) {
|
|
250
|
+
evidence.push(ambiguity(file, assignedValue(input, 'property') ?? input, 'StateMachine transition property is not static text.'));
|
|
251
|
+
}
|
|
252
|
+
else if (selectedClass.kind === 'absent' ||
|
|
253
|
+
(selectedClass.kind === 'resolved' && !selectedClass.properties.has(property))) {
|
|
254
|
+
evidence.push(violation(file, assignedValue(input, 'property') ?? input, `StateMachine transition property ${property} is not a machine-backed Property of the selected Class.`));
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return evidence;
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: 'MUT-CANON',
|
|
263
|
+
ruleRevision: '238b94e9c936fc7c8cd2e1b1d5b61e59f32069ff9974dc366de6633717f38756',
|
|
264
|
+
evaluate(project) {
|
|
265
|
+
const evidence = [];
|
|
266
|
+
for (const file of production(project, 'mutations')) {
|
|
267
|
+
evidence.push(...domainProjectorEvidence(file, 'defineMutation', 'Mutation'));
|
|
268
|
+
for (const definition of definitionObjects(file, 'defineMutation')) {
|
|
269
|
+
const uncertain = definitionOriginAmbiguity(file, definition, 'Mutation definition');
|
|
270
|
+
if (uncertain) {
|
|
271
|
+
evidence.push(uncertain);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
const { call, object } = definition;
|
|
275
|
+
if (!object) {
|
|
276
|
+
evidence.push(ambiguity(file, call, 'Mutation definition is not a static object literal.'));
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
const build = callback(object, 'build');
|
|
280
|
+
if (!build) {
|
|
281
|
+
evidence.push(violation(file, object, 'Mutation definition has no build callback.'));
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (build.parameters.length < 2) {
|
|
285
|
+
evidence.push(violation(file, build, 'Mutation build has no callback-scoped builder as its second parameter.'));
|
|
286
|
+
}
|
|
287
|
+
if (returnedValues(build) > 0) {
|
|
288
|
+
evidence.push(violation(file, build, 'Mutation build returns a value.'));
|
|
289
|
+
}
|
|
290
|
+
if (build.modifiers?.some(({ kind }) => kind === ts.SyntaxKind.AsyncKeyword)) {
|
|
291
|
+
evidence.push(violation(file, build, 'Mutation build callback is async.'));
|
|
292
|
+
}
|
|
293
|
+
let nestedBuilds = 0;
|
|
294
|
+
if (build.body)
|
|
295
|
+
visit(build.body, (node) => {
|
|
296
|
+
if (!ts.isCallExpression(node))
|
|
297
|
+
return;
|
|
298
|
+
const symbol = importedSymbol(file, node.expression);
|
|
299
|
+
const chain = propertyChain(node.expression);
|
|
300
|
+
if (symbol?.name === 'MutationAST' ||
|
|
301
|
+
(chain?.includes('MutationAST') && chain.at(-1) === 'build')) {
|
|
302
|
+
nestedBuilds += 1;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
if (nestedBuilds > 0) {
|
|
306
|
+
evidence.push(violation(file, build, 'Mutation definition constructs a nested MutationAST.'));
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return evidence;
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
id: 'MUT-FRAGMENTS',
|
|
315
|
+
ruleRevision: '6102ea4dbe2e461ef38b98afcfbe28639f4f472ee6a83e44ce6aad7de3c3c7ef',
|
|
316
|
+
evaluate(project) {
|
|
317
|
+
const evidence = [];
|
|
318
|
+
for (const file of production(project, 'mutations')) {
|
|
319
|
+
for (const definition of definitionObjects(file, 'defineMutation')) {
|
|
320
|
+
const uncertain = definitionOriginAmbiguity(file, definition, 'Mutation definition');
|
|
321
|
+
if (uncertain) {
|
|
322
|
+
evidence.push(uncertain);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
const { object } = definition;
|
|
326
|
+
const build = object && callback(object, 'build');
|
|
327
|
+
if (!build)
|
|
328
|
+
continue;
|
|
329
|
+
const builderName = build.parameters[1]?.name;
|
|
330
|
+
if (!builderName || !ts.isIdentifier(builderName)) {
|
|
331
|
+
evidence.push(ambiguity(file, build, 'Mutation build builder parameter is not an identifier.'));
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
visitOwnBody(build, (node) => {
|
|
335
|
+
if (ts.isReturnStatement(node) && node.expression) {
|
|
336
|
+
evidence.push(violation(file, node, 'Mutation build returns a value or escaped builder.'));
|
|
337
|
+
}
|
|
338
|
+
if (!ts.isCallExpression(node))
|
|
339
|
+
return;
|
|
340
|
+
const chain = propertyChain(node.expression);
|
|
341
|
+
if (chain?.[0] === builderName.text)
|
|
342
|
+
return;
|
|
343
|
+
if (!referencesIdentifier(node.arguments, builderName.text))
|
|
344
|
+
return;
|
|
345
|
+
const first = node.arguments[0];
|
|
346
|
+
if (!first ||
|
|
347
|
+
!ts.isIdentifier(unwrap(first)) ||
|
|
348
|
+
unwrap(first).text !== builderName.text) {
|
|
349
|
+
evidence.push(violation(file, node, `Mutation fragment must receive ${builderName.text} as its first argument.`));
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return evidence;
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: 'MUT-PURE',
|
|
359
|
+
ruleRevision: '0101d7edd7d34e69338aaec7129a14df40d3395b6a58b40265ccb5448e739170',
|
|
360
|
+
evaluate(project) {
|
|
361
|
+
const evidence = [];
|
|
362
|
+
for (const file of production(project, 'mutations')) {
|
|
363
|
+
for (const sourceImport of file.imports) {
|
|
364
|
+
const targetLayer = sourceImport.specifier.match(/^#([^/]+)\//)?.[1];
|
|
365
|
+
if ((targetLayer && FORBIDDEN_LAYERS.has(targetLayer)) ||
|
|
366
|
+
forbiddenIoImport(sourceImport.specifier) ||
|
|
367
|
+
sourceImport.specifier.startsWith('@astrale-os/adapter-')) {
|
|
368
|
+
evidence.push(violation(file, sourceImport.node, `Mutation imports effect boundary ${sourceImport.specifier}.`));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
for (const { node, name } of hasForbiddenGlobalCall(file)) {
|
|
372
|
+
evidence.push(violation(file, node, `Mutation definition calls effectful global ${name}.`));
|
|
373
|
+
}
|
|
374
|
+
for (const definition of definitionObjects(file, 'defineMutation')) {
|
|
375
|
+
const uncertain = definitionOriginAmbiguity(file, definition, 'Mutation definition');
|
|
376
|
+
if (uncertain) {
|
|
377
|
+
evidence.push(uncertain);
|
|
378
|
+
continue;
|
|
379
|
+
}
|
|
380
|
+
const { object } = definition;
|
|
381
|
+
const build = object && callback(object, 'build');
|
|
382
|
+
if (!build)
|
|
383
|
+
continue;
|
|
384
|
+
const builderName = build.parameters[1]?.name;
|
|
385
|
+
visitOwnBody(build, (node) => {
|
|
386
|
+
if (!ts.isCallExpression(node))
|
|
387
|
+
return;
|
|
388
|
+
const symbol = importedSymbol(file, node.expression);
|
|
389
|
+
const chain = propertyChain(node.expression);
|
|
390
|
+
if (builderName && ts.isIdentifier(builderName) && chain?.[0] === builderName.text) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const name = symbol?.name;
|
|
394
|
+
if (name && FORBIDDEN_CALLS.has(name)) {
|
|
395
|
+
evidence.push(violation(file, node, `Mutation definition invokes ${name}.`));
|
|
396
|
+
}
|
|
397
|
+
else if (!symbol &&
|
|
398
|
+
chain &&
|
|
399
|
+
chain.length > 1 &&
|
|
400
|
+
FORBIDDEN_CALLS.has(chain.at(-1) ?? '')) {
|
|
401
|
+
evidence.push(ambiguity(file, node, `Mutation call ${chain.join('.')} resembles an excluded operation but its receiver is opaque.`));
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return evidence;
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
];
|
|
410
|
+
function machineAssignments(object, machineProperties) {
|
|
411
|
+
return object.properties.filter((property) => (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property)) &&
|
|
412
|
+
machineProperties.has(staticPropertyName(property) ?? ''));
|
|
413
|
+
}
|
|
414
|
+
function assignedPropertyValue(property) {
|
|
415
|
+
return ts.isPropertyAssignment(property) ? property.initializer : property.name;
|
|
416
|
+
}
|
|
417
|
+
function hasSpread(object) {
|
|
418
|
+
return object.properties.some((property) => ts.isSpreadAssignment(property));
|
|
419
|
+
}
|
|
420
|
+
function spreadMaySet(object, name) {
|
|
421
|
+
let explicit = -1;
|
|
422
|
+
for (let index = 0; index < object.properties.length; index += 1) {
|
|
423
|
+
if (staticPropertyName(object.properties[index]) === name)
|
|
424
|
+
explicit = index;
|
|
425
|
+
}
|
|
426
|
+
return object.properties.some((property, index) => ts.isSpreadAssignment(property) && index > explicit);
|
|
427
|
+
}
|
|
428
|
+
function staticStringArray(expression) {
|
|
429
|
+
const value = unwrap(expression);
|
|
430
|
+
if (!ts.isArrayLiteralExpression(value))
|
|
431
|
+
return undefined;
|
|
432
|
+
const strings = [];
|
|
433
|
+
for (const element of value.elements) {
|
|
434
|
+
if (ts.isSpreadElement(element))
|
|
435
|
+
return undefined;
|
|
436
|
+
const text = staticText(element);
|
|
437
|
+
if (text === undefined)
|
|
438
|
+
return undefined;
|
|
439
|
+
strings.push({ value: text, node: element });
|
|
440
|
+
}
|
|
441
|
+
return strings;
|
|
442
|
+
}
|
|
443
|
+
function typedPatchMachineProperties(project, file, expression, machineProperties) {
|
|
444
|
+
const resolved = expressionType(project, file, expression);
|
|
445
|
+
if (resolved === undefined)
|
|
446
|
+
return undefined;
|
|
447
|
+
const properties = typePropertyNames(resolved.checker, resolved.type);
|
|
448
|
+
if (properties === undefined)
|
|
449
|
+
return undefined;
|
|
450
|
+
return [...machineProperties.keys()].filter((name) => properties.has(name));
|
|
451
|
+
}
|
|
452
|
+
function typePropertyNames(checker, type) {
|
|
453
|
+
if (type.flags &
|
|
454
|
+
(ts.TypeFlags.Any |
|
|
455
|
+
ts.TypeFlags.Unknown |
|
|
456
|
+
ts.TypeFlags.Never |
|
|
457
|
+
ts.TypeFlags.Null |
|
|
458
|
+
ts.TypeFlags.Undefined)) {
|
|
459
|
+
return undefined;
|
|
460
|
+
}
|
|
461
|
+
if (type.isUnionOrIntersection()) {
|
|
462
|
+
const properties = new Set();
|
|
463
|
+
for (const member of type.types) {
|
|
464
|
+
const names = typePropertyNames(checker, member);
|
|
465
|
+
if (names === undefined)
|
|
466
|
+
return undefined;
|
|
467
|
+
for (const name of names)
|
|
468
|
+
properties.add(name);
|
|
469
|
+
}
|
|
470
|
+
return properties;
|
|
471
|
+
}
|
|
472
|
+
const apparent = checker.getApparentType(type);
|
|
473
|
+
if (apparent.getStringIndexType() !== undefined ||
|
|
474
|
+
apparent.getNumberIndexType() !== undefined ||
|
|
475
|
+
!(apparent.flags & ts.TypeFlags.Object)) {
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
return new Set(apparent.getProperties().map(({ name }) => name));
|
|
479
|
+
}
|
|
480
|
+
function mutationBuilderScopes(file) {
|
|
481
|
+
const mutable = new Map();
|
|
482
|
+
const pending = [];
|
|
483
|
+
const add = (fn, binding) => {
|
|
484
|
+
const bindings = mutable.get(fn) ?? new Set();
|
|
485
|
+
if (bindings.has(binding))
|
|
486
|
+
return;
|
|
487
|
+
bindings.add(binding);
|
|
488
|
+
mutable.set(fn, bindings);
|
|
489
|
+
pending.push([fn, binding]);
|
|
490
|
+
};
|
|
491
|
+
for (const definition of definitionObjects(file, 'defineMutation')) {
|
|
492
|
+
if (definition.origin !== 'resolved')
|
|
493
|
+
continue;
|
|
494
|
+
const build = definition.object && callback(definition.object, 'build');
|
|
495
|
+
const builder = build?.parameters[1]?.name;
|
|
496
|
+
if (build && builder && ts.isIdentifier(builder))
|
|
497
|
+
add(build, builder);
|
|
498
|
+
}
|
|
499
|
+
visit(file.source, (node) => {
|
|
500
|
+
if (!ts.isCallExpression(node) || !mutationAstBuild(file, node))
|
|
501
|
+
return;
|
|
502
|
+
const build = node.arguments[0] && unwrap(node.arguments[0]);
|
|
503
|
+
if (build &&
|
|
504
|
+
(ts.isArrowFunction(build) || ts.isFunctionExpression(build)) &&
|
|
505
|
+
ts.isIdentifier(build.parameters[0]?.name)) {
|
|
506
|
+
add(build, build.parameters[0].name);
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
const richBuilderTypes = new Set();
|
|
510
|
+
for (const sourceImport of file.imports) {
|
|
511
|
+
if (sourceImport.specifier !== '@astrale-os/sdk' &&
|
|
512
|
+
sourceImport.specifier !== '@astrale-os/sdk/mutation') {
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
for (const [imported, local] of sourceImport.bindings) {
|
|
516
|
+
if (imported === 'RichMutationBuilder')
|
|
517
|
+
richBuilderTypes.add(local);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
visit(file.source, (node) => {
|
|
521
|
+
if (!ts.isFunctionLike(node) || !('body' in node))
|
|
522
|
+
return;
|
|
523
|
+
for (const parameter of node.parameters) {
|
|
524
|
+
if (ts.isIdentifier(parameter.name) &&
|
|
525
|
+
parameter.type !== undefined &&
|
|
526
|
+
ts.isTypeReferenceNode(parameter.type) &&
|
|
527
|
+
ts.isIdentifier(parameter.type.typeName) &&
|
|
528
|
+
richBuilderTypes.has(parameter.type.typeName.text)) {
|
|
529
|
+
add(node, parameter.name);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
const localFunctions = localFunctionBindings(file);
|
|
534
|
+
for (let index = 0; index < pending.length; index += 1) {
|
|
535
|
+
const [owner, builder] = pending[index];
|
|
536
|
+
visitOwnBody(owner, (node) => {
|
|
537
|
+
if (ts.isVariableDeclaration(node) &&
|
|
538
|
+
ts.isIdentifier(node.name) &&
|
|
539
|
+
node.initializer !== undefined &&
|
|
540
|
+
ts.isIdentifier(unwrap(node.initializer)) &&
|
|
541
|
+
identifierDeclaration(unwrap(node.initializer)) === builder &&
|
|
542
|
+
(node.parent.flags & ts.NodeFlags.Const) !== 0) {
|
|
543
|
+
add(owner, node.name);
|
|
544
|
+
}
|
|
545
|
+
if (!ts.isCallExpression(node))
|
|
546
|
+
return;
|
|
547
|
+
const callee = unwrap(node.expression);
|
|
548
|
+
if (!ts.isIdentifier(callee))
|
|
549
|
+
return;
|
|
550
|
+
const declaration = identifierDeclaration(callee);
|
|
551
|
+
const target = declaration && localFunctions.get(declaration);
|
|
552
|
+
if (!target)
|
|
553
|
+
return;
|
|
554
|
+
for (let argumentIndex = 0; argumentIndex < node.arguments.length; argumentIndex += 1) {
|
|
555
|
+
const argument = unwrap(node.arguments[argumentIndex]);
|
|
556
|
+
const parameter = target.parameters[argumentIndex]?.name;
|
|
557
|
+
if (ts.isIdentifier(argument) &&
|
|
558
|
+
identifierDeclaration(argument) === builder &&
|
|
559
|
+
parameter &&
|
|
560
|
+
ts.isIdentifier(parameter)) {
|
|
561
|
+
add(target, parameter);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
return mutable;
|
|
567
|
+
}
|
|
568
|
+
function mutationAstBuild(file, call) {
|
|
569
|
+
const expression = unwrap(call.expression);
|
|
570
|
+
if (!ts.isPropertyAccessExpression(expression) || expression.name.text !== 'build')
|
|
571
|
+
return false;
|
|
572
|
+
const owner = unwrap(expression.expression);
|
|
573
|
+
const symbol = importedSymbol(file, owner);
|
|
574
|
+
return (symbol?.name === 'MutationAST' &&
|
|
575
|
+
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/mutation'));
|
|
576
|
+
}
|
|
577
|
+
function mutationBuilderMember(call, scopes) {
|
|
578
|
+
const owner = containingFunction(call);
|
|
579
|
+
const builders = owner && scopes.get(owner);
|
|
580
|
+
if (!owner || !builders)
|
|
581
|
+
return undefined;
|
|
582
|
+
const expression = unwrap(call.expression);
|
|
583
|
+
if (ts.isPropertyAccessExpression(expression)) {
|
|
584
|
+
const receiver = unwrap(expression.expression);
|
|
585
|
+
return ts.isIdentifier(receiver) && builders.has(identifierDeclaration(receiver))
|
|
586
|
+
? expression.name.text
|
|
587
|
+
: undefined;
|
|
588
|
+
}
|
|
589
|
+
if (ts.isElementAccessExpression(expression)) {
|
|
590
|
+
const receiver = unwrap(expression.expression);
|
|
591
|
+
return ts.isIdentifier(receiver) && builders.has(identifierDeclaration(receiver))
|
|
592
|
+
? staticText(expression.argumentExpression)
|
|
593
|
+
: undefined;
|
|
594
|
+
}
|
|
595
|
+
if (!ts.isIdentifier(expression))
|
|
596
|
+
return undefined;
|
|
597
|
+
return destructuredBuilderMember(expression, builders);
|
|
598
|
+
}
|
|
599
|
+
function mutationBuilderOperation(call, scopes) {
|
|
600
|
+
const owner = containingFunction(call);
|
|
601
|
+
const builders = owner && scopes.get(owner);
|
|
602
|
+
if (!owner || !builders)
|
|
603
|
+
return undefined;
|
|
604
|
+
const chain = propertyChain(call.expression);
|
|
605
|
+
if (!chain || chain.length < 2)
|
|
606
|
+
return mutationBuilderMember(call, scopes);
|
|
607
|
+
const root = firstIdentifier(unwrap(call.expression));
|
|
608
|
+
if (!root || !builders.has(identifierDeclaration(root)))
|
|
609
|
+
return undefined;
|
|
610
|
+
return chain.slice(1).join('.');
|
|
611
|
+
}
|
|
612
|
+
function firstIdentifier(expression) {
|
|
613
|
+
let current = expression;
|
|
614
|
+
while (ts.isPropertyAccessExpression(current) || ts.isElementAccessExpression(current)) {
|
|
615
|
+
current = unwrap(current.expression);
|
|
616
|
+
}
|
|
617
|
+
return ts.isIdentifier(current) ? current : undefined;
|
|
618
|
+
}
|
|
619
|
+
function classOperationForBuilder(operation) {
|
|
620
|
+
switch (operation) {
|
|
621
|
+
case 'createNode':
|
|
622
|
+
case 'createEdge':
|
|
623
|
+
return 'create';
|
|
624
|
+
case 'expect.node':
|
|
625
|
+
case 'expect.edge':
|
|
626
|
+
return 'read';
|
|
627
|
+
case 'updateNode':
|
|
628
|
+
case 'updateEdge':
|
|
629
|
+
case 'transition':
|
|
630
|
+
return 'update';
|
|
631
|
+
case 'deleteNode':
|
|
632
|
+
case 'deleteEdge':
|
|
633
|
+
return 'delete';
|
|
634
|
+
default:
|
|
635
|
+
return undefined;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
function dependencyClassTarget(expression) {
|
|
639
|
+
const chain = staticPropertyChain(expression);
|
|
640
|
+
if (!chain)
|
|
641
|
+
return undefined;
|
|
642
|
+
const dependency = chain.indexOf('dependencies');
|
|
643
|
+
const suffix = chain.at(-1) === 'key' ? chain.slice(0, -1) : chain;
|
|
644
|
+
if (dependency < 0 || suffix.length !== dependency + 4 || suffix[dependency + 2] !== 'classes') {
|
|
645
|
+
return undefined;
|
|
646
|
+
}
|
|
647
|
+
return { dependency: suffix[dependency + 1], className: suffix[dependency + 3] };
|
|
648
|
+
}
|
|
649
|
+
function expressionSelectsDependency(expression) {
|
|
650
|
+
const chain = staticPropertyChain(expression);
|
|
651
|
+
return chain?.includes('dependencies') ?? false;
|
|
652
|
+
}
|
|
653
|
+
function kernelProvisionCall(call) {
|
|
654
|
+
const chain = propertyChain(call.expression);
|
|
655
|
+
if (chain?.length === 4 &&
|
|
656
|
+
chain[0] === 'kernel' &&
|
|
657
|
+
chain[1] === 'self' &&
|
|
658
|
+
chain[2] === 'auth' &&
|
|
659
|
+
chain[3] === 'provision') {
|
|
660
|
+
const root = firstIdentifier(unwrap(call.expression));
|
|
661
|
+
return root !== undefined && parameterProperty(root, 'kernel');
|
|
662
|
+
}
|
|
663
|
+
return false;
|
|
664
|
+
}
|
|
665
|
+
/** Only context-owned Client calls in publicly resolved SDK handlers, not lookalike objects. */
|
|
666
|
+
function kernelRegisterCalls(file) {
|
|
667
|
+
const result = [];
|
|
668
|
+
for (const { call: factory, origin } of [
|
|
669
|
+
...calls(file, 'defineAction'),
|
|
670
|
+
...calls(file, 'defineWorkflow'),
|
|
671
|
+
]) {
|
|
672
|
+
if (origin !== 'resolved')
|
|
673
|
+
continue;
|
|
674
|
+
const definition = ts.isCallExpression(factory.parent) && factory.parent.expression === factory
|
|
675
|
+
? factory.parent
|
|
676
|
+
: factory;
|
|
677
|
+
const argument = definition.arguments.at(-1);
|
|
678
|
+
const handler = argument && unwrap(argument);
|
|
679
|
+
if (!handler || (!ts.isArrowFunction(handler) && !ts.isFunctionExpression(handler)))
|
|
680
|
+
continue;
|
|
681
|
+
const parameter = handler.parameters[0]?.name;
|
|
682
|
+
if (!parameter)
|
|
683
|
+
continue;
|
|
684
|
+
const roots = [];
|
|
685
|
+
if (ts.isIdentifier(parameter))
|
|
686
|
+
roots.push({ declaration: parameter, prefix: [parameter.text, 'client'] });
|
|
687
|
+
else if (ts.isObjectBindingPattern(parameter)) {
|
|
688
|
+
for (const element of parameter.elements) {
|
|
689
|
+
const property = element.propertyName ?? element.name;
|
|
690
|
+
if (ts.isIdentifier(element.name) &&
|
|
691
|
+
ts.isIdentifier(property) &&
|
|
692
|
+
property.text === 'client')
|
|
693
|
+
roots.push({ declaration: element.name, prefix: [element.name.text] });
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
visit(handler, (node) => {
|
|
697
|
+
if (!ts.isCallExpression(node))
|
|
698
|
+
return;
|
|
699
|
+
const chain = propertyChain(node.expression);
|
|
700
|
+
const root = firstIdentifier(unwrap(node.expression));
|
|
701
|
+
if (!chain || !root)
|
|
702
|
+
return;
|
|
703
|
+
if (roots.some(({ declaration, prefix }) => identifierDeclaration(root) === declaration &&
|
|
704
|
+
chain.join('.') === [...prefix, 'auth', 'register'].join('.')))
|
|
705
|
+
result.push(node);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
return result;
|
|
709
|
+
}
|
|
710
|
+
function parameterProperty(use, sourceName) {
|
|
711
|
+
const binding = identifierDeclaration(use);
|
|
712
|
+
if (binding === undefined)
|
|
713
|
+
return false;
|
|
714
|
+
if (ts.isParameter(binding.parent) && binding.parent.name === binding) {
|
|
715
|
+
return binding.text === sourceName;
|
|
716
|
+
}
|
|
717
|
+
const element = binding.parent;
|
|
718
|
+
if (!ts.isBindingElement(element) ||
|
|
719
|
+
element.name !== binding ||
|
|
720
|
+
!ts.isObjectBindingPattern(element.parent) ||
|
|
721
|
+
!ts.isParameter(element.parent.parent)) {
|
|
722
|
+
return false;
|
|
723
|
+
}
|
|
724
|
+
const property = element.propertyName ?? element.name;
|
|
725
|
+
return (ts.isIdentifier(property) || ts.isStringLiteral(property)) && property.text === sourceName;
|
|
726
|
+
}
|
|
727
|
+
function applicationPlanRequirements(project) {
|
|
728
|
+
const applicationPath = project.policy.rootFiles.find(({ id }) => id === 'application')?.sourcePath;
|
|
729
|
+
const file = applicationPath && project.filesByPath.get(applicationPath);
|
|
730
|
+
if (!file)
|
|
731
|
+
return emptyPlanRequirements(true);
|
|
732
|
+
const applications = [];
|
|
733
|
+
visit(file.source, (node) => {
|
|
734
|
+
if (!ts.isCallExpression(node))
|
|
735
|
+
return;
|
|
736
|
+
const symbol = importedSymbol(file, node.expression);
|
|
737
|
+
if (symbol?.name === 'defineApplication' &&
|
|
738
|
+
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/application')) {
|
|
739
|
+
applications.push(node);
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
if (applications.length !== 1)
|
|
743
|
+
return emptyPlanRequirements(true);
|
|
744
|
+
const input = staticObject(applications[0].arguments[0]);
|
|
745
|
+
const requirementValue = input && assignedValue(input, 'requirements');
|
|
746
|
+
if (requirementValue === undefined)
|
|
747
|
+
return emptyPlanRequirements(false);
|
|
748
|
+
const requirementCall = staticCall(requirementValue);
|
|
749
|
+
const requirementSymbol = requirementCall && importedSymbol(file, requirementCall.expression);
|
|
750
|
+
if (!requirementCall ||
|
|
751
|
+
requirementSymbol?.name !== 'requirements' ||
|
|
752
|
+
(requirementSymbol.module !== '@astrale-os/sdk' &&
|
|
753
|
+
requirementSymbol.module !== '@astrale-os/sdk/application')) {
|
|
754
|
+
return emptyPlanRequirements(true);
|
|
755
|
+
}
|
|
756
|
+
const definition = staticObject(requirementCall.arguments[0]);
|
|
757
|
+
if (!definition)
|
|
758
|
+
return emptyPlanRequirements(requirementCall.arguments[0] !== undefined);
|
|
759
|
+
const functions = new Set();
|
|
760
|
+
const classes = new Set();
|
|
761
|
+
let indeterminate = false;
|
|
762
|
+
const functionValues = staticArray(assignedValue(definition, 'functions'));
|
|
763
|
+
if (assignedValue(definition, 'functions') !== undefined && !functionValues)
|
|
764
|
+
indeterminate = true;
|
|
765
|
+
for (const value of functionValues?.elements ?? []) {
|
|
766
|
+
if (!ts.isExpression(value)) {
|
|
767
|
+
indeterminate = true;
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
const chain = staticPropertyChain(value);
|
|
771
|
+
if (chain?.at(-2) !== 'functions' || chain.at(-1) === undefined)
|
|
772
|
+
indeterminate = true;
|
|
773
|
+
else
|
|
774
|
+
functions.add(chain.at(-1));
|
|
775
|
+
}
|
|
776
|
+
const classValues = staticArray(assignedValue(definition, 'classes'));
|
|
777
|
+
if (assignedValue(definition, 'classes') !== undefined && !classValues)
|
|
778
|
+
indeterminate = true;
|
|
779
|
+
for (const value of classValues?.elements ?? []) {
|
|
780
|
+
if (!ts.isExpression(value)) {
|
|
781
|
+
indeterminate = true;
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
const object = staticObject(value);
|
|
785
|
+
const selected = object && assignedValue(object, 'class');
|
|
786
|
+
const target = selected && resolvedDependencyClassTarget(file, selected);
|
|
787
|
+
const operationValue = object && assignedValue(object, 'operations');
|
|
788
|
+
const operations = operationValue && staticStringArray(operationValue);
|
|
789
|
+
if (!target || !operations || operations.length === 0) {
|
|
790
|
+
indeterminate = true;
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
for (const { value: operation } of operations) {
|
|
794
|
+
if (operation === 'create' ||
|
|
795
|
+
operation === 'read' ||
|
|
796
|
+
operation === 'update' ||
|
|
797
|
+
operation === 'delete') {
|
|
798
|
+
classes.add(classRequirementKey(target.dependency, target.className, operation));
|
|
799
|
+
}
|
|
800
|
+
else if (operation !== 'traverse') {
|
|
801
|
+
indeterminate = true;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return { functions, classes, indeterminate };
|
|
806
|
+
}
|
|
807
|
+
function emptyPlanRequirements(indeterminate) {
|
|
808
|
+
return { functions: new Set(), classes: new Set(), indeterminate };
|
|
809
|
+
}
|
|
810
|
+
function staticCall(expression) {
|
|
811
|
+
const value = unwrap(expression);
|
|
812
|
+
if (ts.isIdentifier(value)) {
|
|
813
|
+
const initializer = visibleConstInitializer(value);
|
|
814
|
+
return initializer && staticCall(initializer);
|
|
815
|
+
}
|
|
816
|
+
return ts.isCallExpression(value) ? value : undefined;
|
|
817
|
+
}
|
|
818
|
+
function resolvedDependencyClassTarget(file, expression) {
|
|
819
|
+
let current = unwrap(expression);
|
|
820
|
+
const selector = [];
|
|
821
|
+
while (ts.isPropertyAccessExpression(current)) {
|
|
822
|
+
selector.unshift(current.name.text);
|
|
823
|
+
current = unwrap(current.expression);
|
|
824
|
+
}
|
|
825
|
+
if (selector.length !== 4 ||
|
|
826
|
+
selector[0] !== 'dependencies' ||
|
|
827
|
+
selector[2] !== 'classes' ||
|
|
828
|
+
!ts.isCallExpression(current)) {
|
|
829
|
+
return undefined;
|
|
830
|
+
}
|
|
831
|
+
const resolve = unwrap(current.expression);
|
|
832
|
+
if (!ts.isPropertyAccessExpression(resolve) || resolve.name.text !== 'resolve')
|
|
833
|
+
return undefined;
|
|
834
|
+
const schema = importedSymbol(file, resolve.expression);
|
|
835
|
+
if (schema?.name !== 'schema' || schema.module !== '@astrale-os/sdk/schema')
|
|
836
|
+
return undefined;
|
|
837
|
+
return { dependency: selector[1], className: selector[3] };
|
|
838
|
+
}
|
|
839
|
+
function classRequirementKey(dependency, className, operation) {
|
|
840
|
+
return `${dependency}\0${className}\0${operation}`;
|
|
841
|
+
}
|
|
842
|
+
function destructuredBuilderMember(callee, builders) {
|
|
843
|
+
const calleeBinding = identifierDeclaration(callee);
|
|
844
|
+
const element = calleeBinding?.parent;
|
|
845
|
+
if (!element ||
|
|
846
|
+
!ts.isBindingElement(element) ||
|
|
847
|
+
element.dotDotDotToken !== undefined ||
|
|
848
|
+
element.name !== calleeBinding ||
|
|
849
|
+
!ts.isObjectBindingPattern(element.parent)) {
|
|
850
|
+
return undefined;
|
|
851
|
+
}
|
|
852
|
+
const declaration = element.parent.parent;
|
|
853
|
+
if (!ts.isVariableDeclaration(declaration))
|
|
854
|
+
return undefined;
|
|
855
|
+
const initializer = declaration.initializer && unwrap(declaration.initializer);
|
|
856
|
+
if (!initializer ||
|
|
857
|
+
!ts.isIdentifier(initializer) ||
|
|
858
|
+
!builders.has(identifierDeclaration(initializer))) {
|
|
859
|
+
return undefined;
|
|
860
|
+
}
|
|
861
|
+
const member = element.propertyName ?? element.name;
|
|
862
|
+
return ts.isIdentifier(member) || ts.isStringLiteral(member) ? member.text : undefined;
|
|
863
|
+
}
|
|
864
|
+
function localFunctionBindings(file) {
|
|
865
|
+
const functions = new Map();
|
|
866
|
+
const record = (binding, fn) => {
|
|
867
|
+
functions.set(binding, fn);
|
|
868
|
+
};
|
|
869
|
+
visit(file.source, (node) => {
|
|
870
|
+
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
871
|
+
record(node.name, node);
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name) || !node.initializer)
|
|
875
|
+
return;
|
|
876
|
+
const value = unwrap(node.initializer);
|
|
877
|
+
if (ts.isArrowFunction(value) || ts.isFunctionExpression(value)) {
|
|
878
|
+
record(node.name, value);
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
return functions;
|
|
882
|
+
}
|
|
883
|
+
function identifierDeclaration(use) {
|
|
884
|
+
let current = use.parent;
|
|
885
|
+
while (current !== undefined) {
|
|
886
|
+
if (ts.isBlock(current) || ts.isSourceFile(current)) {
|
|
887
|
+
const binding = directBlockBinding(current, use.text);
|
|
888
|
+
if (binding !== undefined)
|
|
889
|
+
return binding;
|
|
890
|
+
}
|
|
891
|
+
if (ts.isFunctionLike(current)) {
|
|
892
|
+
for (const parameter of current.parameters) {
|
|
893
|
+
const binding = bindingIdentifier(parameter.name, use.text);
|
|
894
|
+
if (binding !== undefined)
|
|
895
|
+
return binding;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
if (ts.isCatchClause(current) && current.variableDeclaration !== undefined) {
|
|
899
|
+
const binding = bindingIdentifier(current.variableDeclaration.name, use.text);
|
|
900
|
+
if (binding !== undefined)
|
|
901
|
+
return binding;
|
|
902
|
+
}
|
|
903
|
+
current = current.parent;
|
|
904
|
+
}
|
|
905
|
+
return undefined;
|
|
906
|
+
}
|
|
907
|
+
function directBlockBinding(block, name) {
|
|
908
|
+
for (const statement of block.statements) {
|
|
909
|
+
if (ts.isFunctionDeclaration(statement) && statement.name?.text === name) {
|
|
910
|
+
return statement.name;
|
|
911
|
+
}
|
|
912
|
+
if (!ts.isVariableStatement(statement))
|
|
913
|
+
continue;
|
|
914
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
915
|
+
const binding = bindingIdentifier(declaration.name, name);
|
|
916
|
+
if (binding !== undefined)
|
|
917
|
+
return binding;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
return undefined;
|
|
921
|
+
}
|
|
922
|
+
function bindingIdentifier(binding, name) {
|
|
923
|
+
if (ts.isIdentifier(binding))
|
|
924
|
+
return binding.text === name ? binding : undefined;
|
|
925
|
+
for (const element of binding.elements) {
|
|
926
|
+
if (ts.isOmittedExpression(element))
|
|
927
|
+
continue;
|
|
928
|
+
const identifier = bindingIdentifier(element.name, name);
|
|
929
|
+
if (identifier !== undefined)
|
|
930
|
+
return identifier;
|
|
931
|
+
}
|
|
932
|
+
return undefined;
|
|
933
|
+
}
|
|
934
|
+
function containingFunction(node) {
|
|
935
|
+
let current = node.parent;
|
|
936
|
+
while (current) {
|
|
937
|
+
if (ts.isFunctionLike(current) && 'body' in current) {
|
|
938
|
+
return current;
|
|
939
|
+
}
|
|
940
|
+
current = current.parent;
|
|
941
|
+
}
|
|
942
|
+
return undefined;
|
|
943
|
+
}
|
|
944
|
+
function machinePropertiesByClass(project) {
|
|
945
|
+
const all = new Map();
|
|
946
|
+
const mutableByClass = new Map();
|
|
947
|
+
const ambiguousByClass = new Map();
|
|
948
|
+
const ownerSources = new Map();
|
|
949
|
+
const record = (file, owner, name, value) => {
|
|
950
|
+
const machine = statePropertyIdentity(project, file, value);
|
|
951
|
+
if (machine.kind === 'resolved') {
|
|
952
|
+
const identities = all.get(name) ?? new Set();
|
|
953
|
+
identities.add(machine.identity);
|
|
954
|
+
all.set(name, identities);
|
|
955
|
+
if (owner !== undefined) {
|
|
956
|
+
const sources = ownerSources.get(owner) ?? new Set();
|
|
957
|
+
sources.add(`${file.path}#${owner}`);
|
|
958
|
+
ownerSources.set(owner, sources);
|
|
959
|
+
const properties = mutableByClass.get(owner) ?? new Map();
|
|
960
|
+
properties.set(name, machine.identity);
|
|
961
|
+
mutableByClass.set(owner, properties);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
else if (machine.kind === 'ambiguous' && owner !== undefined) {
|
|
965
|
+
const sources = ownerSources.get(owner) ?? new Set();
|
|
966
|
+
sources.add(`${file.path}#${owner}`);
|
|
967
|
+
ownerSources.set(owner, sources);
|
|
968
|
+
const names = ambiguousByClass.get(owner) ?? new Set();
|
|
969
|
+
names.add(name);
|
|
970
|
+
ambiguousByClass.set(owner, names);
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
for (const file of production(project, 'schema')) {
|
|
974
|
+
visit(file.source, (node) => {
|
|
975
|
+
if (ts.isPropertyAssignment(node) || ts.isShorthandPropertyAssignment(node)) {
|
|
976
|
+
const name = staticPropertyName(node);
|
|
977
|
+
if (name === undefined || !isPropertiesMember(node))
|
|
978
|
+
return;
|
|
979
|
+
const value = ts.isPropertyAssignment(node) ? node.initializer : node.name;
|
|
980
|
+
record(file, containingVariableName(node), name, value);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (ts.isSpreadAssignment(node) && isPropertiesObject(node.parent)) {
|
|
984
|
+
const owner = containingVariableName(node);
|
|
985
|
+
const spread = staticObject(node.expression);
|
|
986
|
+
if (spread !== undefined) {
|
|
987
|
+
for (const entry of spread.properties) {
|
|
988
|
+
if (!ts.isPropertyAssignment(entry) && !ts.isShorthandPropertyAssignment(entry)) {
|
|
989
|
+
continue;
|
|
990
|
+
}
|
|
991
|
+
const name = staticPropertyName(entry);
|
|
992
|
+
if (name === undefined)
|
|
993
|
+
continue;
|
|
994
|
+
record(file, owner, name, ts.isPropertyAssignment(entry) ? entry.initializer : entry.name);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
else if (owner !== undefined) {
|
|
998
|
+
const machine = statePropertyIdentity(project, file, node.expression);
|
|
999
|
+
if (machine.kind !== 'absent') {
|
|
1000
|
+
const names = ambiguousByClass.get(owner) ?? new Set();
|
|
1001
|
+
names.add('<spread>');
|
|
1002
|
+
ambiguousByClass.set(owner, names);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
for (const [owner, sources] of ownerSources) {
|
|
1009
|
+
if (sources.size <= 1)
|
|
1010
|
+
continue;
|
|
1011
|
+
const names = ambiguousByClass.get(owner) ?? new Set();
|
|
1012
|
+
for (const name of mutableByClass.get(owner)?.keys() ?? [])
|
|
1013
|
+
names.add(name);
|
|
1014
|
+
ambiguousByClass.set(owner, names);
|
|
1015
|
+
mutableByClass.delete(owner);
|
|
1016
|
+
}
|
|
1017
|
+
const topology = classTopology(project);
|
|
1018
|
+
inheritMachineProperties(topology.parents, mutableByClass, ambiguousByClass);
|
|
1019
|
+
for (const file of production(project, 'schema')) {
|
|
1020
|
+
for (const definition of definitionObjects(file, 'defineSchema', undefined, DSL_MODULES, 1)) {
|
|
1021
|
+
if (definition.origin !== 'resolved')
|
|
1022
|
+
continue;
|
|
1023
|
+
const classesValue = definition.object && assignedValue(definition.object, 'classes');
|
|
1024
|
+
const classes = staticObject(classesValue);
|
|
1025
|
+
if (!classes)
|
|
1026
|
+
continue;
|
|
1027
|
+
for (const entry of classes.properties) {
|
|
1028
|
+
if (!ts.isPropertyAssignment(entry) && !ts.isShorthandPropertyAssignment(entry))
|
|
1029
|
+
continue;
|
|
1030
|
+
const publicName = staticPropertyName(entry);
|
|
1031
|
+
const value = ts.isPropertyAssignment(entry) ? unwrap(entry.initializer) : entry.name;
|
|
1032
|
+
if (publicName === undefined || !ts.isIdentifier(value))
|
|
1033
|
+
continue;
|
|
1034
|
+
const sourceName = value.text;
|
|
1035
|
+
const ambiguous = ambiguousByClass.get(sourceName);
|
|
1036
|
+
if (ambiguous !== undefined) {
|
|
1037
|
+
const names = ambiguousByClass.get(publicName) ?? new Set();
|
|
1038
|
+
for (const name of ambiguous)
|
|
1039
|
+
names.add(name);
|
|
1040
|
+
ambiguousByClass.set(publicName, names);
|
|
1041
|
+
}
|
|
1042
|
+
const source = mutableByClass.get(sourceName);
|
|
1043
|
+
if (source === undefined || sourceName === publicName)
|
|
1044
|
+
continue;
|
|
1045
|
+
const target = mutableByClass.get(publicName);
|
|
1046
|
+
if (target === undefined) {
|
|
1047
|
+
mutableByClass.set(publicName, new Map(source));
|
|
1048
|
+
continue;
|
|
1049
|
+
}
|
|
1050
|
+
for (const [name, identity] of source) {
|
|
1051
|
+
const prior = target.get(name);
|
|
1052
|
+
if (prior === undefined || prior === identity) {
|
|
1053
|
+
target.set(name, identity);
|
|
1054
|
+
}
|
|
1055
|
+
else {
|
|
1056
|
+
const names = ambiguousByClass.get(publicName) ?? new Set();
|
|
1057
|
+
names.add(name);
|
|
1058
|
+
ambiguousByClass.set(publicName, names);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
return {
|
|
1065
|
+
all,
|
|
1066
|
+
byClass: mutableByClass,
|
|
1067
|
+
ambiguousByClass,
|
|
1068
|
+
...topology,
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
function inheritMachineProperties(parents, byClass, ambiguousByClass) {
|
|
1072
|
+
let changed = true;
|
|
1073
|
+
while (changed) {
|
|
1074
|
+
changed = false;
|
|
1075
|
+
for (const [owner, inherited] of parents) {
|
|
1076
|
+
for (const parent of inherited) {
|
|
1077
|
+
const ambiguous = ambiguousByClass.get(parent);
|
|
1078
|
+
if (ambiguous !== undefined) {
|
|
1079
|
+
const target = ambiguousByClass.get(owner) ?? new Set();
|
|
1080
|
+
const before = target.size;
|
|
1081
|
+
for (const name of ambiguous)
|
|
1082
|
+
target.add(name);
|
|
1083
|
+
ambiguousByClass.set(owner, target);
|
|
1084
|
+
if (target.size !== before)
|
|
1085
|
+
changed = true;
|
|
1086
|
+
}
|
|
1087
|
+
const source = byClass.get(parent);
|
|
1088
|
+
if (source === undefined)
|
|
1089
|
+
continue;
|
|
1090
|
+
const target = byClass.get(owner) ?? new Map();
|
|
1091
|
+
const before = target.size;
|
|
1092
|
+
for (const [name, identity] of source) {
|
|
1093
|
+
const prior = target.get(name);
|
|
1094
|
+
if (prior === undefined || prior === identity) {
|
|
1095
|
+
target.set(name, identity);
|
|
1096
|
+
}
|
|
1097
|
+
else {
|
|
1098
|
+
const names = ambiguousByClass.get(owner) ?? new Set();
|
|
1099
|
+
const beforeAmbiguous = names.size;
|
|
1100
|
+
names.add(name);
|
|
1101
|
+
ambiguousByClass.set(owner, names);
|
|
1102
|
+
if (names.size !== beforeAmbiguous)
|
|
1103
|
+
changed = true;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
byClass.set(owner, target);
|
|
1107
|
+
if (target.size !== before)
|
|
1108
|
+
changed = true;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
function classTopology(project) {
|
|
1114
|
+
const classes = new Set();
|
|
1115
|
+
const abstractClasses = new Set();
|
|
1116
|
+
const parents = new Map();
|
|
1117
|
+
for (const file of production(project, 'schema')) {
|
|
1118
|
+
visit(file.source, (node) => {
|
|
1119
|
+
if (!ts.isCallExpression(node))
|
|
1120
|
+
return;
|
|
1121
|
+
const symbol = importedSymbol(file, node.expression);
|
|
1122
|
+
if (symbol?.name !== 'nodeClass' || !DSL_MODULES.has(symbol.module))
|
|
1123
|
+
return;
|
|
1124
|
+
const owner = containingVariableName(node);
|
|
1125
|
+
const object = staticObject(node.arguments[0]);
|
|
1126
|
+
if (owner === undefined || object === undefined)
|
|
1127
|
+
return;
|
|
1128
|
+
classes.add(owner);
|
|
1129
|
+
if (assignedValue(object, 'abstract')?.kind === ts.SyntaxKind.TrueKeyword) {
|
|
1130
|
+
abstractClasses.add(owner);
|
|
1131
|
+
}
|
|
1132
|
+
const extended = staticArray(assignedValue(object, 'extends'));
|
|
1133
|
+
if (extended === undefined)
|
|
1134
|
+
return;
|
|
1135
|
+
const names = parents.get(owner) ?? new Set();
|
|
1136
|
+
for (const expression of extended.elements) {
|
|
1137
|
+
if (!ts.isExpression(expression))
|
|
1138
|
+
continue;
|
|
1139
|
+
const chain = propertyChain(expression) ?? staticPropertyChain(expression);
|
|
1140
|
+
const name = chain?.at(-1);
|
|
1141
|
+
if (name !== undefined)
|
|
1142
|
+
names.add(name);
|
|
1143
|
+
}
|
|
1144
|
+
parents.set(owner, names);
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
return { classes, abstractClasses, parents };
|
|
1148
|
+
}
|
|
1149
|
+
function containingVariableName(node) {
|
|
1150
|
+
let current = node;
|
|
1151
|
+
while (current && !ts.isSourceFile(current)) {
|
|
1152
|
+
if (ts.isVariableDeclaration(current) && ts.isIdentifier(current.name)) {
|
|
1153
|
+
return current.name.text;
|
|
1154
|
+
}
|
|
1155
|
+
current = current.parent;
|
|
1156
|
+
}
|
|
1157
|
+
return undefined;
|
|
1158
|
+
}
|
|
1159
|
+
function propertiesForClass(input, properties) {
|
|
1160
|
+
const selectedClass = assignedValue(input, 'class');
|
|
1161
|
+
const selection = selectedClass && selectedClassNames(selectedClass);
|
|
1162
|
+
if (selection === undefined || !closedClassSelection(selection, properties)) {
|
|
1163
|
+
return { kind: 'ambiguous' };
|
|
1164
|
+
}
|
|
1165
|
+
const resolved = new Map();
|
|
1166
|
+
let hasMachineProperty = false;
|
|
1167
|
+
for (const className of selection) {
|
|
1168
|
+
if ((properties.ambiguousByClass.get(className)?.size ?? 0) > 0) {
|
|
1169
|
+
return { kind: 'ambiguous' };
|
|
1170
|
+
}
|
|
1171
|
+
const selected = properties.byClass.get(className);
|
|
1172
|
+
if (selected === undefined)
|
|
1173
|
+
continue;
|
|
1174
|
+
hasMachineProperty = true;
|
|
1175
|
+
for (const [name, identity] of selected) {
|
|
1176
|
+
const prior = resolved.get(name);
|
|
1177
|
+
if (prior !== undefined && prior !== identity)
|
|
1178
|
+
return { kind: 'ambiguous' };
|
|
1179
|
+
resolved.set(name, identity);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
return hasMachineProperty ? { kind: 'resolved', properties: resolved } : { kind: 'absent' };
|
|
1183
|
+
}
|
|
1184
|
+
function selectedClassNames(expression, seen = new Set()) {
|
|
1185
|
+
const value = unwrap(expression);
|
|
1186
|
+
if (ts.isConditionalExpression(value)) {
|
|
1187
|
+
const whenTrue = selectedClassNames(value.whenTrue, seen);
|
|
1188
|
+
const whenFalse = selectedClassNames(value.whenFalse, seen);
|
|
1189
|
+
return whenTrue && whenFalse ? new Set([...whenTrue, ...whenFalse]) : undefined;
|
|
1190
|
+
}
|
|
1191
|
+
if (ts.isIdentifier(value)) {
|
|
1192
|
+
if (seen.has(value.text))
|
|
1193
|
+
return undefined;
|
|
1194
|
+
const initializer = visibleConstInitializer(value);
|
|
1195
|
+
if (initializer !== undefined) {
|
|
1196
|
+
const next = new Set(seen);
|
|
1197
|
+
next.add(value.text);
|
|
1198
|
+
return selectedClassNames(initializer, next);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
const chain = staticPropertyChain(value);
|
|
1202
|
+
if (!chain || chain.length < 2)
|
|
1203
|
+
return undefined;
|
|
1204
|
+
const className = chain.at(-1) === 'key' ? chain.at(-2) : chain.at(-1);
|
|
1205
|
+
return className === undefined ? undefined : new Set([className]);
|
|
1206
|
+
}
|
|
1207
|
+
function closedClassSelection(selection, topology) {
|
|
1208
|
+
if (selection.size === 0)
|
|
1209
|
+
return false;
|
|
1210
|
+
if (selection.size === 1)
|
|
1211
|
+
return true;
|
|
1212
|
+
if ([...selection].some((name) => !topology.classes.has(name)))
|
|
1213
|
+
return false;
|
|
1214
|
+
if ([...selection].some((name) => topology.abstractClasses.has(name)))
|
|
1215
|
+
return false;
|
|
1216
|
+
for (const ancestor of topology.abstractClasses) {
|
|
1217
|
+
if (![...selection].every((name) => ancestorsOf(name, topology.parents).has(ancestor))) {
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1220
|
+
const descendants = [...topology.classes].filter((name) => !topology.abstractClasses.has(name) && ancestorsOf(name, topology.parents).has(ancestor));
|
|
1221
|
+
if (descendants.length === selection.size && descendants.every((name) => selection.has(name))) {
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
return false;
|
|
1226
|
+
}
|
|
1227
|
+
function ancestorsOf(className, parents) {
|
|
1228
|
+
const ancestors = new Set();
|
|
1229
|
+
const pending = [...(parents.get(className) ?? [])];
|
|
1230
|
+
while (pending.length > 0) {
|
|
1231
|
+
const parent = pending.pop();
|
|
1232
|
+
if (ancestors.has(parent))
|
|
1233
|
+
continue;
|
|
1234
|
+
ancestors.add(parent);
|
|
1235
|
+
pending.push(...(parents.get(parent) ?? []));
|
|
1236
|
+
}
|
|
1237
|
+
return ancestors;
|
|
1238
|
+
}
|
|
1239
|
+
function hasMachineCandidates(properties) {
|
|
1240
|
+
return properties.all.size > 0 || properties.ambiguousByClass.size > 0;
|
|
1241
|
+
}
|
|
1242
|
+
function isPropertiesMember(node) {
|
|
1243
|
+
return isPropertiesObject(node.parent);
|
|
1244
|
+
}
|
|
1245
|
+
function isPropertiesObject(node) {
|
|
1246
|
+
const owner = node.parent;
|
|
1247
|
+
return ts.isPropertyAssignment(owner) && staticPropertyName(owner) === 'properties';
|
|
1248
|
+
}
|
|
1249
|
+
function staticObject(expression, seen = new Set()) {
|
|
1250
|
+
if (!expression)
|
|
1251
|
+
return undefined;
|
|
1252
|
+
const value = unwrap(expression);
|
|
1253
|
+
if (ts.isIdentifier(value)) {
|
|
1254
|
+
if (seen.has(value.text))
|
|
1255
|
+
return undefined;
|
|
1256
|
+
const initializer = visibleConstInitializer(value);
|
|
1257
|
+
if (initializer !== undefined) {
|
|
1258
|
+
const next = new Set(seen);
|
|
1259
|
+
next.add(value.text);
|
|
1260
|
+
return staticObject(initializer, next);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
return ts.isObjectLiteralExpression(value) ? value : undefined;
|
|
1264
|
+
}
|
|
1265
|
+
function staticArray(expression) {
|
|
1266
|
+
const value = expression && unwrap(expression);
|
|
1267
|
+
return value && ts.isArrayLiteralExpression(value) ? value : undefined;
|
|
1268
|
+
}
|
|
1269
|
+
function assignedValue(object, name) {
|
|
1270
|
+
const property = object.properties.find((candidate) => staticPropertyName(candidate) === name);
|
|
1271
|
+
if (property && ts.isPropertyAssignment(property))
|
|
1272
|
+
return property.initializer;
|
|
1273
|
+
return property && ts.isShorthandPropertyAssignment(property) ? property.name : undefined;
|
|
1274
|
+
}
|
|
1275
|
+
function staticPropertyName(property) {
|
|
1276
|
+
if (!('name' in property) || property.name === undefined)
|
|
1277
|
+
return undefined;
|
|
1278
|
+
if (ts.isIdentifier(property.name) ||
|
|
1279
|
+
ts.isStringLiteral(property.name) ||
|
|
1280
|
+
ts.isNumericLiteral(property.name)) {
|
|
1281
|
+
return property.name.text;
|
|
1282
|
+
}
|
|
1283
|
+
if (!ts.isComputedPropertyName(property.name))
|
|
1284
|
+
return undefined;
|
|
1285
|
+
const literal = staticText(property.name.expression);
|
|
1286
|
+
if (literal !== undefined)
|
|
1287
|
+
return literal;
|
|
1288
|
+
const chain = staticPropertyChain(property.name.expression);
|
|
1289
|
+
return chain?.at(-1) === 'key' ? chain.at(-2) : undefined;
|
|
1290
|
+
}
|
|
1291
|
+
function initialIdentity(project, file, expression, seen = new Set()) {
|
|
1292
|
+
const value = unwrap(expression);
|
|
1293
|
+
const initialOwner = ts.isPropertyAccessExpression(value) && value.name.text === 'initial'
|
|
1294
|
+
? value.expression
|
|
1295
|
+
: ts.isElementAccessExpression(value) && staticText(value.argumentExpression) === 'initial'
|
|
1296
|
+
? value.expression
|
|
1297
|
+
: undefined;
|
|
1298
|
+
if (initialOwner !== undefined) {
|
|
1299
|
+
return stateMachineIdentity(project, file, initialOwner);
|
|
1300
|
+
}
|
|
1301
|
+
if (ts.isIdentifier(value)) {
|
|
1302
|
+
if (seen.has(value.text))
|
|
1303
|
+
return { kind: 'ambiguous' };
|
|
1304
|
+
const initializer = visibleConstInitializer(value);
|
|
1305
|
+
if (initializer !== undefined) {
|
|
1306
|
+
const next = new Set(seen);
|
|
1307
|
+
next.add(value.text);
|
|
1308
|
+
return initialIdentity(project, file, initializer, next);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return { kind: 'absent' };
|
|
1312
|
+
}
|
|
1313
|
+
function staticTextValue(expression, seen = new Set()) {
|
|
1314
|
+
const text = staticText(expression);
|
|
1315
|
+
if (text !== undefined || expression === undefined)
|
|
1316
|
+
return text;
|
|
1317
|
+
const value = unwrap(expression);
|
|
1318
|
+
if (!ts.isIdentifier(value) || seen.has(value.text))
|
|
1319
|
+
return undefined;
|
|
1320
|
+
const initializer = visibleConstInitializer(value);
|
|
1321
|
+
if (initializer === undefined)
|
|
1322
|
+
return undefined;
|
|
1323
|
+
const next = new Set(seen);
|
|
1324
|
+
next.add(value.text);
|
|
1325
|
+
return staticTextValue(initializer, next);
|
|
1326
|
+
}
|
|
1327
|
+
function staticPropertyChain(expression, seen = new Set()) {
|
|
1328
|
+
const chain = propertyChain(expression);
|
|
1329
|
+
if (chain !== undefined && chain.length > 1)
|
|
1330
|
+
return chain;
|
|
1331
|
+
const value = unwrap(expression);
|
|
1332
|
+
if (!ts.isIdentifier(value) || seen.has(value.text))
|
|
1333
|
+
return chain;
|
|
1334
|
+
const initializer = visibleConstInitializer(value);
|
|
1335
|
+
if (initializer === undefined)
|
|
1336
|
+
return chain;
|
|
1337
|
+
const next = new Set(seen);
|
|
1338
|
+
next.add(value.text);
|
|
1339
|
+
return staticPropertyChain(initializer, next);
|
|
1340
|
+
}
|
|
1341
|
+
function visibleConstInitializer(identifier) {
|
|
1342
|
+
let current = identifier.parent;
|
|
1343
|
+
while (current) {
|
|
1344
|
+
if (ts.isBlock(current) || ts.isSourceFile(current)) {
|
|
1345
|
+
let match;
|
|
1346
|
+
for (const statement of current.statements) {
|
|
1347
|
+
if (statement.getStart() >= identifier.getStart())
|
|
1348
|
+
break;
|
|
1349
|
+
if (!ts.isVariableStatement(statement))
|
|
1350
|
+
continue;
|
|
1351
|
+
if ((statement.declarationList.flags & ts.NodeFlags.Const) === 0)
|
|
1352
|
+
continue;
|
|
1353
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
1354
|
+
if (ts.isIdentifier(declaration.name) &&
|
|
1355
|
+
declaration.name.text === identifier.text &&
|
|
1356
|
+
declaration.initializer !== undefined) {
|
|
1357
|
+
match = declaration.initializer;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
if (match !== undefined)
|
|
1362
|
+
return match;
|
|
1363
|
+
}
|
|
1364
|
+
current = current.parent;
|
|
1365
|
+
}
|
|
1366
|
+
return undefined;
|
|
1367
|
+
}
|
|
1368
|
+
function referencesIdentifier(arguments_, name) {
|
|
1369
|
+
let found = false;
|
|
1370
|
+
for (const argument of arguments_) {
|
|
1371
|
+
visit(argument, (node) => {
|
|
1372
|
+
if (ts.isIdentifier(node) && node.text === name)
|
|
1373
|
+
found = true;
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
return found;
|
|
1377
|
+
}
|
|
1378
|
+
function visitOwnBody(fn, callback) {
|
|
1379
|
+
if (!fn.body)
|
|
1380
|
+
return;
|
|
1381
|
+
const walk = (node) => {
|
|
1382
|
+
callback(node);
|
|
1383
|
+
if (node !== fn.body && ts.isFunctionLike(node))
|
|
1384
|
+
return;
|
|
1385
|
+
node.forEachChild(walk);
|
|
1386
|
+
};
|
|
1387
|
+
walk(fn.body);
|
|
1388
|
+
}
|
|
1389
|
+
function returnedValues(fn) {
|
|
1390
|
+
if (!fn.body)
|
|
1391
|
+
return 0;
|
|
1392
|
+
if (!ts.isBlock(fn.body))
|
|
1393
|
+
return 1;
|
|
1394
|
+
let count = 0;
|
|
1395
|
+
const walk = (node) => {
|
|
1396
|
+
if (node !== fn && ts.isFunctionLike(node))
|
|
1397
|
+
return;
|
|
1398
|
+
if (ts.isReturnStatement(node) && node.expression)
|
|
1399
|
+
count += 1;
|
|
1400
|
+
node.forEachChild(walk);
|
|
1401
|
+
};
|
|
1402
|
+
fn.body.forEachChild(walk);
|
|
1403
|
+
return count;
|
|
1404
|
+
}
|