@astrale-os/sdk 0.6.0-beta.2 → 0.6.0-beta.21
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 +74 -14
- package/dist/application/action/action.d.ts +6 -0
- package/dist/application/action/authoring.d.ts +1 -1
- package/dist/application/action/context.d.ts +17 -8
- package/dist/application/action/define.d.ts +3 -3
- package/dist/application/action/index.d.ts +1 -1
- package/dist/application/define.d.ts +5 -5
- package/dist/application/define.js +13 -13
- package/dist/application/dependency/index.d.ts +1 -1
- package/dist/application/dependency/invoker.d.ts +11 -6
- package/dist/application/domain.d.ts +28 -0
- package/dist/application/index.d.ts +3 -3
- package/dist/application/index.js +1 -1
- package/dist/application/mutation/authoring/properties.d.ts +5 -3
- package/dist/application/mutation/authoring/properties.js +35 -2
- package/dist/application/mutation/authoring/transition.js +4 -1
- package/dist/application/routes/admission.d.ts +2 -2
- package/dist/application/routes/admission.js +1 -1
- package/dist/application/routes/route.d.ts +2 -2
- package/dist/application/runtime/actions.js +3 -0
- package/dist/application/runtime/workflows.d.ts +2 -0
- package/dist/application/runtime/workflows.js +5 -0
- package/dist/application/workflow/authoring.d.ts +3 -2
- package/dist/application/workflow/context.d.ts +8 -2
- package/dist/application/workflow/define.d.ts +3 -3
- package/dist/application/workflow/define.js +19 -3
- package/dist/application/workflow/durable.d.ts +83 -0
- package/dist/application/workflow/index.d.ts +3 -2
- package/dist/application/workflow/runner/inline.js +3 -4
- package/dist/application/workflow/runner/runner.d.ts +2 -2
- package/dist/application/workflow/step/output.d.ts +2 -0
- package/dist/application/workflow/step/output.js +73 -0
- package/dist/application/workflow/workflow.d.ts +12 -0
- package/dist/deployment/adapter/adapter.d.ts +59 -11
- package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
- package/dist/deployment/adapter/bundle/file.d.ts +10 -0
- package/dist/deployment/adapter/bundle/index.d.ts +2 -0
- package/dist/deployment/adapter/define.d.ts +25 -3
- package/dist/deployment/adapter/define.js +101 -24
- package/dist/deployment/adapter/index.d.ts +6 -3
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/legacy/adapter.d.ts +40 -0
- package/dist/deployment/adapter/{deploy → legacy/deploy}/context.d.ts +6 -2
- package/dist/deployment/adapter/legacy/deploy/index.d.ts +2 -0
- package/dist/deployment/adapter/legacy/deploy/index.js +1 -0
- package/dist/deployment/adapter/legacy/deploy/result.d.ts +89 -0
- package/dist/deployment/adapter/legacy/deploy/result.js +1 -0
- package/dist/deployment/adapter/legacy/index.d.ts +24 -0
- package/dist/deployment/adapter/legacy/index.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +43 -0
- package/dist/deployment/adapter/legacy/prepare/artifact.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/context.d.ts +33 -0
- package/dist/deployment/adapter/legacy/prepare/context.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/index.d.ts +2 -0
- package/dist/deployment/adapter/legacy/prepare/index.js +1 -0
- package/dist/deployment/adapter/release/context.d.ts +95 -0
- package/dist/deployment/adapter/release/context.js +1 -0
- package/dist/deployment/adapter/release/index.d.ts +3 -0
- package/dist/deployment/adapter/release/index.js +1 -0
- package/dist/deployment/adapter/release/list.d.ts +53 -0
- package/dist/deployment/adapter/release/list.js +1 -0
- package/dist/deployment/adapter/release/refusal.d.ts +10 -0
- package/dist/deployment/adapter/release/refusal.js +14 -0
- package/dist/deployment/adapter/release/result.d.ts +56 -0
- package/dist/deployment/adapter/release/result.js +1 -0
- package/dist/deployment/address/configuration.d.ts +83 -0
- package/dist/deployment/address/configuration.js +262 -0
- package/dist/deployment/address/fingerprint.d.ts +5 -0
- package/dist/deployment/address/fingerprint.js +27 -0
- package/dist/deployment/address/index.d.ts +5 -0
- package/dist/deployment/address/index.js +5 -0
- package/dist/deployment/address/label.d.ts +42 -0
- package/dist/deployment/address/label.js +80 -0
- package/dist/deployment/address/line.d.ts +29 -0
- package/dist/deployment/address/line.js +53 -0
- package/dist/deployment/address/record.d.ts +52 -0
- package/dist/deployment/address/record.js +104 -0
- package/dist/deployment/address/summary.d.ts +57 -0
- package/dist/deployment/address/summary.js +117 -0
- package/dist/deployment/address/vectors.d.ts +60 -0
- package/dist/deployment/address/vectors.js +517 -0
- package/dist/deployment/build/build.d.ts +2 -2
- package/dist/deployment/build/compile.d.ts +4 -4
- package/dist/deployment/build/compile.js +17 -17
- package/dist/deployment/build/index.d.ts +1 -0
- package/dist/deployment/build/index.js +1 -0
- package/dist/deployment/build/manifest.d.ts +59 -0
- package/dist/deployment/build/manifest.js +118 -0
- package/dist/deployment/build/material.js +2 -2
- package/dist/deployment/build/schema.d.ts +2 -2
- package/dist/deployment/deploy.d.ts +10 -10
- package/dist/deployment/deploy.js +3 -3
- package/dist/deployment/deployment.d.ts +9 -4
- package/dist/deployment/environment.d.ts +6 -0
- package/dist/deployment/environment.js +6 -0
- package/dist/deployment/index.d.ts +4 -4
- package/dist/deployment/index.js +1 -1
- package/dist/deployment/release/addressing.d.ts +9 -1
- package/dist/deployment/release/assemble.d.ts +6 -3
- package/dist/deployment/release/assemble.js +12 -10
- package/dist/deployment/release/index.d.ts +2 -0
- package/dist/deployment/release/index.js +2 -0
- package/dist/deployment/release/legacy/admission.d.ts +3 -0
- package/dist/deployment/release/legacy/admission.js +8 -0
- package/dist/deployment/release/legacy/assemble.d.ts +5 -0
- package/dist/deployment/release/legacy/assemble.js +20 -0
- package/dist/deployment/release/legacy/index.d.ts +35 -0
- package/dist/deployment/release/legacy/index.js +34 -0
- package/dist/deployment/release/legacy/release.d.ts +12 -0
- package/dist/deployment/release/legacy/release.js +1 -0
- package/dist/deployment/release/{publication → legacy}/seal.d.ts +3 -3
- package/dist/deployment/release/legacy/seal.js +17 -0
- package/dist/deployment/release/release.d.ts +16 -5
- package/dist/deployment/release/runtime.d.ts +2 -0
- package/dist/deployment/release/runtime.js +2 -0
- package/dist/deployment/release/seal.d.ts +14 -0
- package/dist/deployment/release/seal.js +22 -0
- package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/callables.js +2 -2
- package/dist/deployment/release/served/index.d.ts +12 -0
- package/dist/deployment/release/served/index.js +22 -0
- package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
- package/dist/deployment/runtime/admission.d.ts +2 -2
- package/dist/deployment/runtime/admission.js +5 -5
- package/dist/deployment/verify/index.d.ts +2 -1
- package/dist/deployment/verify/index.js +1 -0
- package/dist/deployment/verify/preflight/artifact.d.ts +1 -1
- package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
- package/dist/deployment/verify/preflight/bundle.js +71 -0
- package/dist/deployment/verify/preflight/index.d.ts +2 -1
- package/dist/deployment/verify/preflight/index.js +1 -0
- package/dist/deployment/verify/preflight/publication.d.ts +2 -2
- package/dist/deployment/verify/preflight/publication.js +4 -3
- package/dist/deployment/verify/readiness/deployment.js +7 -15
- package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
- package/dist/deployment/verify/readiness/fetch.js +26 -0
- package/dist/deployment/verify/readiness/identity.d.ts +3 -6
- package/dist/deployment/verify/readiness/identity.js +3 -3
- package/dist/deployment/verify/readiness/index.d.ts +11 -7
- package/dist/deployment/verify/readiness/index.js +15 -4
- package/dist/deployment/verify/readiness/legacy/index.d.ts +2 -0
- package/dist/deployment/verify/readiness/legacy/index.js +2 -0
- package/dist/deployment/verify/readiness/legacy/publication.d.ts +12 -0
- package/dist/deployment/verify/readiness/legacy/publication.js +23 -0
- package/dist/deployment/verify/readiness/release.d.ts +8 -0
- package/dist/deployment/verify/readiness/release.js +22 -0
- package/dist/execution/identity/authentication.d.ts +23 -2
- package/dist/execution/identity/authentication.js +64 -40
- package/dist/execution/identity/callback.d.ts +16 -15
- package/dist/execution/identity/callback.js +21 -16
- package/dist/execution/identity/delivery.d.ts +11 -4
- package/dist/execution/identity/delivery.js +47 -20
- package/dist/execution/identity/identity.d.ts +18 -3
- package/dist/execution/identity/identity.js +8 -4
- package/dist/execution/identity/jwks.js +57 -12
- package/dist/execution/index.d.ts +4 -2
- package/dist/execution/index.js +2 -1
- package/dist/execution/invocation/admission/authentication.d.ts +3 -8
- package/dist/execution/invocation/admission/authentication.js +10 -24
- package/dist/execution/invocation/admission/authority.d.ts +15 -8
- package/dist/execution/invocation/admission/authority.js +5 -0
- package/dist/execution/invocation/admission/input.d.ts +2 -2
- package/dist/execution/invocation/admission/input.js +16 -2
- package/dist/execution/invocation/dependency/bind.d.ts +1 -1
- package/dist/execution/invocation/dependency/bind.js +35 -14
- package/dist/execution/invocation/dispatch/context.d.ts +2 -1
- package/dist/execution/invocation/dispatch/context.js +1 -1
- package/dist/execution/invocation/invocation.js +58 -16
- package/dist/execution/invocation/result/project.js +41 -1
- package/dist/execution/node/serve.d.ts +2 -2
- package/dist/execution/node/serve.js +1 -1
- package/dist/execution/runtime/index.d.ts +1 -0
- package/dist/execution/runtime/index.js +1 -0
- package/dist/execution/runtime/load.d.ts +3 -3
- package/dist/execution/runtime/load.js +3 -2
- package/dist/execution/runtime/release.d.ts +22 -0
- package/dist/execution/runtime/release.js +14 -0
- package/dist/execution/serve.d.ts +10 -4
- package/dist/execution/serve.js +3 -0
- package/dist/execution/service/create.js +39 -7
- package/dist/execution/service/initialization.d.ts +4 -4
- package/dist/execution/service/initialization.js +23 -14
- package/dist/execution/service/release.d.ts +2 -2
- package/dist/execution/service/release.js +3 -2
- package/dist/execution/service/service.d.ts +15 -5
- package/dist/execution/service/serving/delivery.d.ts +6 -0
- package/dist/execution/service/{publication → serving}/delivery.js +5 -1
- package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
- package/dist/execution/service/serving/installation.d.ts +4 -0
- package/dist/execution/service/serving/installation.js +9 -0
- package/dist/execution/service/serving/legacy/index.d.ts +15 -0
- package/dist/execution/service/serving/legacy/index.js +19 -0
- package/dist/execution/service/serving/source.d.ts +18 -0
- package/dist/execution/service/serving/source.js +19 -0
- package/dist/execution/workflows/discovery.d.ts +14 -0
- package/dist/execution/workflows/discovery.js +151 -0
- package/dist/execution/workflows/engine.d.ts +52 -0
- package/dist/execution/workflows/engine.js +1 -0
- package/dist/execution/workflows/envelope.d.ts +12 -0
- package/dist/execution/workflows/envelope.js +46 -0
- package/dist/execution/workflows/failure.d.ts +11 -0
- package/dist/execution/workflows/failure.js +43 -0
- package/dist/execution/workflows/index.d.ts +4 -0
- package/dist/execution/workflows/index.js +3 -0
- package/dist/execution/workflows/options.d.ts +40 -0
- package/dist/execution/workflows/options.js +83 -0
- package/dist/execution/workflows/receiver.d.ts +22 -0
- package/dist/execution/workflows/receiver.js +99 -0
- package/dist/execution/workflows/route.d.ts +14 -0
- package/dist/execution/workflows/route.js +40 -0
- package/dist/execution/workflows/run.d.ts +22 -0
- package/dist/execution/workflows/run.js +211 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/platform/release/index.d.ts +27 -0
- package/dist/platform/release/index.js +27 -0
- package/dist/platform/schema/index.d.ts +2 -1
- package/dist/platform/schema/property-input.d.ts +15 -0
- package/dist/platform/schema/property-input.js +1 -0
- package/dist/platform/schema/property.d.ts +5 -0
- package/dist/platform/versioning/dependents.d.ts +18 -0
- package/dist/platform/versioning/dependents.js +15 -0
- package/dist/platform/versioning/index.d.ts +5 -0
- package/dist/platform/versioning/index.js +5 -0
- package/dist/platform/versioning/name.d.ts +38 -0
- package/dist/platform/versioning/name.js +58 -0
- package/dist/platform/versioning/reference.d.ts +48 -0
- package/dist/platform/versioning/reference.js +95 -0
- package/dist/platform/versioning/version.d.ts +72 -0
- package/dist/platform/versioning/version.js +98 -0
- package/dist/project/admit.js +2 -2
- package/dist/project/define.d.ts +4 -4
- package/dist/project/define.js +55 -35
- package/dist/project/index.d.ts +1 -1
- package/dist/project/install-command.d.ts +10 -0
- package/dist/project/install-command.js +13 -0
- package/dist/project/project.d.ts +10 -8
- package/dist/testing/dataset/builder.d.ts +3 -3
- package/dist/testing/dataset/define.d.ts +1 -1
- package/dist/testing/load.js +1 -1
- package/dist/tooling/cli/arguments.d.ts +10 -5
- package/dist/tooling/cli/arguments.js +123 -52
- package/dist/tooling/cli/build.d.ts +55 -0
- package/dist/tooling/cli/build.js +77 -0
- package/dist/tooling/cli/bun.d.ts +0 -1
- package/dist/tooling/cli/bun.js +0 -7
- package/dist/tooling/cli/commit.d.ts +35 -0
- package/dist/tooling/cli/commit.js +235 -0
- package/dist/tooling/cli/deploy-mode.d.ts +82 -0
- package/dist/tooling/cli/deploy-mode.js +135 -0
- package/dist/tooling/cli/deploy-result.d.ts +85 -0
- package/dist/tooling/cli/deploy-result.js +64 -0
- package/dist/tooling/cli/diff/declared.d.ts +7 -0
- package/dist/tooling/cli/diff/declared.js +27 -0
- package/dist/tooling/cli/diff/index.d.ts +30 -0
- package/dist/tooling/cli/diff/index.js +58 -0
- package/dist/tooling/cli/diff/render.d.ts +15 -0
- package/dist/tooling/cli/diff/render.js +131 -0
- package/dist/tooling/cli/diff/report.d.ts +88 -0
- package/dist/tooling/cli/diff/report.js +154 -0
- package/dist/tooling/cli/dotenv.d.ts +2 -2
- package/dist/tooling/cli/dotenv.js +3 -33
- package/dist/tooling/cli/help.js +176 -59
- package/dist/tooling/cli/immutable-deployment.d.ts +83 -0
- package/dist/tooling/cli/immutable-deployment.js +135 -0
- package/dist/tooling/cli/index.d.ts +10 -4
- package/dist/tooling/cli/index.js +5 -3
- package/dist/tooling/cli/installed-on.d.ts +83 -0
- package/dist/tooling/cli/installed-on.js +156 -0
- package/dist/tooling/cli/legacy/deploy-result.d.ts +28 -0
- package/dist/tooling/cli/legacy/deploy-result.js +37 -0
- package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +21 -0
- package/dist/tooling/cli/legacy/stable-target-adapter.js +14 -0
- package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +40 -0
- package/dist/tooling/cli/legacy/stable-target-deploy.js +102 -0
- package/dist/tooling/cli/legacy/uploaded-build.d.ts +11 -0
- package/dist/tooling/cli/legacy/uploaded-build.js +22 -0
- package/dist/tooling/cli/list.d.ts +154 -0
- package/dist/tooling/cli/list.js +381 -0
- package/dist/tooling/cli/log.d.ts +5 -0
- package/dist/tooling/cli/log.js +9 -0
- package/dist/tooling/cli/orchestrate.d.ts +0 -6
- package/dist/tooling/cli/orchestrate.js +236 -88
- package/dist/tooling/cli/project.d.ts +3 -3
- package/dist/tooling/cli/publish/index.d.ts +73 -0
- package/dist/tooling/cli/publish/index.js +346 -0
- package/dist/tooling/cli/publish/report.d.ts +49 -0
- package/dist/tooling/cli/publish/report.js +15 -0
- package/dist/tooling/cli/registry/client.d.ts +114 -0
- package/dist/tooling/cli/registry/client.js +346 -0
- package/dist/tooling/cli/registry/error.d.ts +11 -0
- package/dist/tooling/cli/registry/error.js +17 -0
- package/dist/tooling/cli/registry/executable.d.ts +29 -0
- package/dist/tooling/cli/registry/executable.js +90 -0
- package/dist/tooling/cli/registry/index.d.ts +9 -0
- package/dist/tooling/cli/registry/index.js +8 -0
- package/dist/tooling/cli/registry/installations.d.ts +67 -0
- package/dist/tooling/cli/registry/installations.js +108 -0
- package/dist/tooling/cli/registry/process.d.ts +36 -0
- package/dist/tooling/cli/registry/process.js +119 -0
- package/dist/tooling/cli/secrets.d.ts +9 -0
- package/dist/tooling/cli/secrets.js +19 -0
- package/dist/tooling/cli/yank.d.ts +34 -0
- package/dist/tooling/cli/yank.js +32 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -1
- package/dist/tooling/linter/implementations/source/callable-requirements.js +10 -10
- package/dist/tooling/linter/implementations/source/dependencies.js +12 -10
- package/dist/tooling/linter/implementations/source/global.js +1 -1
- package/dist/tooling/linter/implementations/source/mutations.js +17 -17
- package/dist/tooling/linter/implementations/source/providers.js +5 -5
- package/dist/tooling/linter/implementations/source/views.js +2 -2
- package/dist/tooling/linter/policy/generated.js +16 -16
- package/dist/tooling/packaging/declarations/ownership.js +1 -1
- package/dist/tooling/packaging/finalize.d.ts +1 -1
- package/dist/tooling/packaging/finalize.js +1 -1
- package/package.json +32 -11
- package/dist/application/application.d.ts +0 -28
- package/dist/deployment/adapter/deploy/index.d.ts +0 -2
- package/dist/deployment/adapter/deploy/result.d.ts +0 -50
- package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
- package/dist/deployment/adapter/prepare/context.d.ts +0 -23
- package/dist/deployment/adapter/prepare/index.d.ts +0 -2
- package/dist/deployment/release/publication/index.d.ts +0 -6
- package/dist/deployment/release/publication/index.js +0 -6
- package/dist/deployment/release/publication/manifest.d.ts +0 -3
- package/dist/deployment/release/publication/manifest.js +0 -5
- package/dist/deployment/release/publication/requirements.d.ts +0 -3
- package/dist/deployment/release/publication/requirements.js +0 -3
- package/dist/deployment/release/publication/seal.js +0 -39
- package/dist/deployment/verify/readiness/publication.d.ts +0 -11
- package/dist/deployment/verify/readiness/publication.js +0 -41
- package/dist/execution/service/publication/delivery.d.ts +0 -2
- package/dist/execution/service/publication/installation.d.ts +0 -3
- package/dist/execution/service/publication/installation.js +0 -8
- package/dist/execution/service/publication/source.d.ts +0 -3
- package/dist/execution/service/publication/source.js +0 -11
- package/dist/platform/publication/index.d.ts +0 -2
- package/dist/platform/publication/index.js +0 -2
- package/dist/tooling/cli/astrale/authority.d.ts +0 -5
- package/dist/tooling/cli/astrale/authority.js +0 -11
- package/dist/tooling/cli/astrale/executable.d.ts +0 -2
- package/dist/tooling/cli/astrale/executable.js +0 -47
- package/dist/tooling/cli/astrale/failure.d.ts +0 -6
- package/dist/tooling/cli/astrale/failure.js +0 -48
- package/dist/tooling/cli/astrale/instance.d.ts +0 -11
- package/dist/tooling/cli/astrale/instance.js +0 -52
- package/dist/tooling/cli/astrale/process.d.ts +0 -13
- package/dist/tooling/cli/astrale/process.js +0 -94
- package/dist/tooling/cli/astrale/version.d.ts +0 -18
- package/dist/tooling/cli/astrale/version.js +0 -55
- package/dist/tooling/cli/credential.d.ts +0 -2
- package/dist/tooling/cli/credential.js +0 -57
- package/dist/tooling/cli/development/candidate.d.ts +0 -25
- package/dist/tooling/cli/development/candidate.js +0 -176
- package/dist/tooling/cli/development/deployment.d.ts +0 -16
- package/dist/tooling/cli/development/deployment.js +0 -39
- package/dist/tooling/cli/development/develop.d.ts +0 -11
- package/dist/tooling/cli/development/develop.js +0 -243
- package/dist/tooling/cli/development/lease.d.ts +0 -18
- package/dist/tooling/cli/development/lease.js +0 -163
- package/dist/tooling/cli/development/lifecycle.d.ts +0 -9
- package/dist/tooling/cli/development/lifecycle.js +0 -43
- package/dist/tooling/cli/development/project-imports.d.ts +0 -22
- package/dist/tooling/cli/development/project-imports.js +0 -39
- package/dist/tooling/cli/development/project-lock.d.ts +0 -16
- package/dist/tooling/cli/development/project-lock.js +0 -41
- package/dist/tooling/cli/development/rebuild.d.ts +0 -13
- package/dist/tooling/cli/development/rebuild.js +0 -58
- package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
- package/dist/tooling/cli/development/release-evidence.js +0 -10
- package/dist/tooling/cli/development/report.d.ts +0 -6
- package/dist/tooling/cli/development/report.js +0 -14
- package/dist/tooling/cli/development/session-file.d.ts +0 -53
- package/dist/tooling/cli/development/session-file.js +0 -337
- package/dist/tooling/cli/development/source-watch.d.ts +0 -14
- package/dist/tooling/cli/development/source-watch.js +0 -140
- package/dist/tooling/cli/development/sources.d.ts +0 -7
- package/dist/tooling/cli/development/sources.js +0 -48
- package/dist/tooling/cli/development/target-lock.d.ts +0 -16
- package/dist/tooling/cli/development/target-lock.js +0 -68
- package/dist/tooling/cli/development/view.d.ts +0 -28
- package/dist/tooling/cli/development/view.js +0 -151
- package/dist/tooling/cli/environment-release.d.ts +0 -21
- package/dist/tooling/cli/environment-release.js +0 -46
- package/dist/tooling/cli/evidence.d.ts +0 -11
- package/dist/tooling/cli/evidence.js +0 -53
- package/dist/tooling/cli/installation/index.d.ts +0 -2
- package/dist/tooling/cli/installation/index.js +0 -1
- package/dist/tooling/cli/installation/observation.d.ts +0 -10
- package/dist/tooling/cli/installation/observation.js +0 -44
- package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
- package/dist/tooling/cli/installation/reconcile.js +0 -122
- /package/dist/application/{application.js → domain.js} +0 -0
- /package/dist/{deployment/adapter/deploy/context.js → application/workflow/durable.js} +0 -0
- /package/dist/deployment/adapter/{deploy/index.js → bundle/bundle.js} +0 -0
- /package/dist/deployment/adapter/{deploy/result.js → bundle/file.js} +0 -0
- /package/dist/deployment/adapter/{prepare → bundle}/index.js +0 -0
- /package/dist/deployment/adapter/{prepare/artifact.js → legacy/adapter.js} +0 -0
- /package/dist/deployment/adapter/{prepare → legacy/deploy}/context.js +0 -0
- /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
- /package/dist/deployment/release/{publication → served}/routes.js +0 -0
- /package/dist/deployment/release/{publication → served}/views.js +0 -0
- /package/dist/execution/service/{publication → serving}/index.js +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { RegistryCliError } from './error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decode one `astrale.installed-list` v1 document: the instance Kernel that answered, whether the
|
|
4
|
+
* listing may omit installations (`partial`, required) and the deployment URL of each
|
|
5
|
+
* installation. Anything else is refused.
|
|
6
|
+
*/
|
|
7
|
+
export function decodeInstanceListing(document) {
|
|
8
|
+
if (document.format !== 'astrale.installed-list' ||
|
|
9
|
+
document.version !== 1 ||
|
|
10
|
+
!httpUrl(document.kernel) ||
|
|
11
|
+
typeof document.partial !== 'boolean' ||
|
|
12
|
+
!Array.isArray(document.domains)) {
|
|
13
|
+
throw protocolError('Astrale CLI answered no installed list of the instance.');
|
|
14
|
+
}
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
kind: 'listed',
|
|
17
|
+
kernel: document.kernel,
|
|
18
|
+
partial: document.partial,
|
|
19
|
+
installations: Object.freeze(document.domains.map((entry) => {
|
|
20
|
+
if (!isRecord(entry) || !text(entry.origin) || !httpUrl(entry.url)) {
|
|
21
|
+
throw protocolError('Astrale CLI answered a malformed installation of the instance.');
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze({ origin: entry.origin, url: entry.url });
|
|
24
|
+
})),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Why an instance listing failed, from the machine error the CLI printed on stderr (the last line
|
|
29
|
+
* that is a JSON object with an `error` code): only that code is read, never its message, since
|
|
30
|
+
* stderr may name the caller's credential. A Kernel without the listing is `unsupported`; a timeout
|
|
31
|
+
* at any phase is `timeout`; a Kernel refusal is `refused`; anything else, a command that printed
|
|
32
|
+
* no machine error and a failed read of Admin's registry (`isAdminFailure`) included, is
|
|
33
|
+
* `unavailable`.
|
|
34
|
+
*/
|
|
35
|
+
export function instanceRefusal(stderr) {
|
|
36
|
+
const failure = machineError(stderr);
|
|
37
|
+
if (failure === undefined) {
|
|
38
|
+
return unknown('unavailable', 'REGISTRY_CLI_FAILED');
|
|
39
|
+
}
|
|
40
|
+
const code = admittedCode(failure.error);
|
|
41
|
+
if (code === 'KERNEL_RELEASE_UNSUPPORTED')
|
|
42
|
+
return unknown('unsupported', code);
|
|
43
|
+
if (failure.phase === 'timeout')
|
|
44
|
+
return unknown('timeout', code);
|
|
45
|
+
if (code === 'RESPONSE_ERROR')
|
|
46
|
+
return unknown('refused', code);
|
|
47
|
+
return unknown('unavailable', code);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether an instance listing failed on Admin's side, not the instance's: the listing also reads
|
|
51
|
+
* Admin's registry to name what runs there, and fails as a whole when that read fails (CT24, C7).
|
|
52
|
+
* Its codes are Admin's (`REGISTRY_*`, `ADMIN_*`), never the SDK's own `REGISTRY_CLI_*`.
|
|
53
|
+
*/
|
|
54
|
+
export function isAdminFailure(code) {
|
|
55
|
+
return ((code.startsWith('REGISTRY_') && !code.startsWith('REGISTRY_CLI_')) || code.startsWith('ADMIN_'));
|
|
56
|
+
}
|
|
57
|
+
/** The instance did not answer within the probe's time. */
|
|
58
|
+
export function instanceTimeout() {
|
|
59
|
+
return unknown('timeout', 'REGISTRY_CLI_TIMEOUT');
|
|
60
|
+
}
|
|
61
|
+
/** The CLI answered the instance listing with something this SDK cannot read. */
|
|
62
|
+
export function instanceUnreadable() {
|
|
63
|
+
return unknown('unavailable', 'REGISTRY_CLI_PROTOCOL');
|
|
64
|
+
}
|
|
65
|
+
function unknown(reason, code) {
|
|
66
|
+
return Object.freeze({ kind: 'unknown', reason, code });
|
|
67
|
+
}
|
|
68
|
+
function machineError(stderr) {
|
|
69
|
+
const lines = stderr.split('\n').map((line) => line.trim());
|
|
70
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
71
|
+
const line = lines[index];
|
|
72
|
+
if (!line.startsWith('{'))
|
|
73
|
+
continue;
|
|
74
|
+
try {
|
|
75
|
+
const value = JSON.parse(line);
|
|
76
|
+
if (isRecord(value) && typeof value.error === 'string') {
|
|
77
|
+
return { error: value.error, phase: value.phase };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// A human line that happens to start with a brace: keep looking upwards.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
function protocolError(message) {
|
|
87
|
+
return new RegistryCliError('REGISTRY_CLI_PROTOCOL', message);
|
|
88
|
+
}
|
|
89
|
+
function admittedCode(input) {
|
|
90
|
+
return /^[A-Z][A-Z0-9_]{0,63}$/u.test(input) ? input : 'REGISTRY_CLI_FAILED';
|
|
91
|
+
}
|
|
92
|
+
function httpUrl(input) {
|
|
93
|
+
if (typeof input !== 'string')
|
|
94
|
+
return false;
|
|
95
|
+
try {
|
|
96
|
+
const url = new URL(input);
|
|
97
|
+
return url.protocol === 'https:' || url.protocol === 'http:';
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function text(input) {
|
|
104
|
+
return typeof input === 'string' && input.length > 0;
|
|
105
|
+
}
|
|
106
|
+
function isRecord(input) {
|
|
107
|
+
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
108
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface RegistryProcessInput {
|
|
2
|
+
readonly executable: string;
|
|
3
|
+
readonly args: readonly string[];
|
|
4
|
+
readonly projectDir: string;
|
|
5
|
+
readonly signal: AbortSignal;
|
|
6
|
+
readonly timeoutMs: number;
|
|
7
|
+
/** Bytes of stdout kept before the child is stopped; a registry index can be large. */
|
|
8
|
+
readonly stdoutLimit: number;
|
|
9
|
+
/** One document written to the child's stdin, such as a publish request; none by default. */
|
|
10
|
+
readonly stdin?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Bytes of stderr kept, for a caller that reads the machine error code a command without a
|
|
13
|
+
* stdout refusal document prints there (`astrale domain list -i --json`). The CLI prints that
|
|
14
|
+
* error last, after any human lines, so the last bytes are kept and older ones dropped. Absent,
|
|
15
|
+
* stderr is never kept.
|
|
16
|
+
*/
|
|
17
|
+
readonly stderrLimit?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface RegistryProcessResult {
|
|
20
|
+
readonly code: number;
|
|
21
|
+
readonly stdout: string;
|
|
22
|
+
/** The kept tail of stderr, present exactly when the input set `stderrLimit`. */
|
|
23
|
+
readonly stderr?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The command did not end within its `timeoutMs`; the child was stopped. */
|
|
26
|
+
export declare class RegistryProcessTimeoutError extends Error {
|
|
27
|
+
constructor();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run one Astrale CLI registry command with bounded output and time. Stderr is drained and dropped:
|
|
31
|
+
* the CLI prints its human diagnostics there, which may name the caller's credential, and every
|
|
32
|
+
* registry command already answers with one document on stdout, its refusals included (CT29). A
|
|
33
|
+
* caller that sets `stderrLimit` gets the bounded tail back, to read a machine error code from; it
|
|
34
|
+
* never relays it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function runRegistryProcess(input: RegistryProcessInput): Promise<RegistryProcessResult>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
const TERMINATION_GRACE_MS = 1_000;
|
|
3
|
+
/** The command did not end within its `timeoutMs`; the child was stopped. */
|
|
4
|
+
export class RegistryProcessTimeoutError extends Error {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('Astrale CLI command timed out.');
|
|
7
|
+
this.name = 'RegistryProcessTimeoutError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Run one Astrale CLI registry command with bounded output and time. Stderr is drained and dropped:
|
|
12
|
+
* the CLI prints its human diagnostics there, which may name the caller's credential, and every
|
|
13
|
+
* registry command already answers with one document on stdout, its refusals included (CT29). A
|
|
14
|
+
* caller that sets `stderrLimit` gets the bounded tail back, to read a machine error code from; it
|
|
15
|
+
* never relays it.
|
|
16
|
+
*/
|
|
17
|
+
export function runRegistryProcess(input) {
|
|
18
|
+
if (input.signal.aborted)
|
|
19
|
+
return Promise.reject(interruption(input.signal));
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
let child;
|
|
22
|
+
try {
|
|
23
|
+
child = spawn(input.executable, [...input.args], {
|
|
24
|
+
cwd: input.projectDir,
|
|
25
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
26
|
+
shell: false,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (cause) {
|
|
30
|
+
reject(new Error('Astrale CLI could not be started.', { cause }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const chunks = [];
|
|
34
|
+
const errors = [];
|
|
35
|
+
let stdoutBytes = 0;
|
|
36
|
+
let stderrBytes = 0;
|
|
37
|
+
let settled = false;
|
|
38
|
+
let termination;
|
|
39
|
+
let escalation;
|
|
40
|
+
const terminate = (cause) => {
|
|
41
|
+
if (settled || termination !== undefined)
|
|
42
|
+
return;
|
|
43
|
+
termination = cause;
|
|
44
|
+
child.stdin.destroy();
|
|
45
|
+
child.kill('SIGTERM');
|
|
46
|
+
escalation = setTimeout(() => {
|
|
47
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
48
|
+
child.kill('SIGKILL');
|
|
49
|
+
}, TERMINATION_GRACE_MS);
|
|
50
|
+
};
|
|
51
|
+
const abort = () => terminate(interruption(input.signal));
|
|
52
|
+
const timeout = setTimeout(() => terminate(new RegistryProcessTimeoutError()), input.timeoutMs);
|
|
53
|
+
input.signal.addEventListener('abort', abort, { once: true });
|
|
54
|
+
const finish = () => {
|
|
55
|
+
settled = true;
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
if (escalation !== undefined)
|
|
58
|
+
clearTimeout(escalation);
|
|
59
|
+
input.signal.removeEventListener('abort', abort);
|
|
60
|
+
};
|
|
61
|
+
child.stdout.on('data', (chunk) => {
|
|
62
|
+
stdoutBytes += chunk.byteLength;
|
|
63
|
+
if (stdoutBytes > input.stdoutLimit) {
|
|
64
|
+
terminate(new Error('Astrale CLI stdout exceeded the supported limit.'));
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
chunks.push(chunk);
|
|
68
|
+
});
|
|
69
|
+
const stderrLimit = input.stderrLimit;
|
|
70
|
+
if (stderrLimit === undefined)
|
|
71
|
+
child.stderr.resume();
|
|
72
|
+
else {
|
|
73
|
+
// Keep the last `stderrLimit` bytes: drop whole chunks from the front once the rest covers it.
|
|
74
|
+
child.stderr.on('data', (chunk) => {
|
|
75
|
+
errors.push(chunk);
|
|
76
|
+
stderrBytes += chunk.byteLength;
|
|
77
|
+
while (errors.length > 1 && stderrBytes - errors[0].byteLength >= stderrLimit) {
|
|
78
|
+
stderrBytes -= errors.shift().byteLength;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// A child that exits before reading its stdin closes the pipe; its exit code still answers.
|
|
83
|
+
child.stdin.on('error', () => undefined);
|
|
84
|
+
child.once('error', (cause) => {
|
|
85
|
+
if (settled)
|
|
86
|
+
return;
|
|
87
|
+
finish();
|
|
88
|
+
reject(termination ?? new Error('Astrale CLI could not be started.', { cause }));
|
|
89
|
+
});
|
|
90
|
+
child.once('close', (code) => {
|
|
91
|
+
if (settled)
|
|
92
|
+
return;
|
|
93
|
+
finish();
|
|
94
|
+
if (termination !== undefined) {
|
|
95
|
+
reject(termination);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
resolve(Object.freeze({
|
|
99
|
+
code: code ?? 1,
|
|
100
|
+
stdout: Buffer.concat(chunks).toString('utf8'),
|
|
101
|
+
...(stderrLimit === undefined ? {} : { stderr: stderrTail(errors, stderrLimit) }),
|
|
102
|
+
}));
|
|
103
|
+
});
|
|
104
|
+
child.stdin.end(input.stdin);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The last `limit` bytes of stderr as text. A cut through a multi-byte character only spoils the
|
|
109
|
+
* first kept line, never the machine error the CLI prints last.
|
|
110
|
+
*/
|
|
111
|
+
function stderrTail(chunks, limit) {
|
|
112
|
+
const kept = Buffer.concat(chunks);
|
|
113
|
+
return kept.subarray(Math.max(0, kept.byteLength - limit)).toString('utf8');
|
|
114
|
+
}
|
|
115
|
+
function interruption(signal) {
|
|
116
|
+
return signal.reason instanceof Error
|
|
117
|
+
? signal.reason
|
|
118
|
+
: new Error('Project operation interrupted.');
|
|
119
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Runtime } from '../../application/runtime/index.js';
|
|
2
|
+
import type { Adapter, LegacyAdapter } from '../../deployment/adapter/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The secrets one Environment's deployment binds: the values of the secrets file its adapter
|
|
5
|
+
* declares. An Integration-free Runtime has no Providers and therefore no author-owned secrets, so
|
|
6
|
+
* its file may be absent; adapter-owned secrets, such as a signing identity, are the adapter's to
|
|
7
|
+
* resolve and never make this file required.
|
|
8
|
+
*/
|
|
9
|
+
export declare function environmentSecrets(adapter: Adapter<object> | LegacyAdapter<object>, parameters: object, projectDir: string, runtime: Runtime): Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, join } from 'node:path';
|
|
3
|
+
import { loadDeclaredSecrets } from './dotenv.js';
|
|
4
|
+
/**
|
|
5
|
+
* The secrets one Environment's deployment binds: the values of the secrets file its adapter
|
|
6
|
+
* declares. An Integration-free Runtime has no Providers and therefore no author-owned secrets, so
|
|
7
|
+
* its file may be absent; adapter-owned secrets, such as a signing identity, are the adapter's to
|
|
8
|
+
* resolve and never make this file required.
|
|
9
|
+
*/
|
|
10
|
+
export function environmentSecrets(adapter, parameters, projectDir, runtime) {
|
|
11
|
+
const file = adapter.secretsFile?.(parameters);
|
|
12
|
+
if (file === undefined)
|
|
13
|
+
return Object.freeze({});
|
|
14
|
+
const path = isAbsolute(file) ? file : join(projectDir, file);
|
|
15
|
+
if (Object.keys(runtime.integrations).length === 0 && !existsSync(path)) {
|
|
16
|
+
return Object.freeze({});
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(loadDeclaredSecrets(path, file));
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Version } from '../../platform/versioning/index.js';
|
|
2
|
+
import type { DomainRegistry } from './registry/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* `astrale-domain yank <version> [--undo] --json` on stdout (CT30): the yank state Admin now holds
|
|
5
|
+
* for one published version of the Project's Domain. `changed` when this call yanked or restored
|
|
6
|
+
* it, `unchanged` when it already was in that state.
|
|
7
|
+
*/
|
|
8
|
+
export interface YankReportV1 {
|
|
9
|
+
readonly format: 'astrale.yank-report';
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
readonly origin: string;
|
|
12
|
+
readonly publication: {
|
|
13
|
+
readonly version: string;
|
|
14
|
+
readonly yanked: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly status: 'changed' | 'unchanged';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Yank one published version of `origin`, or restore it with `undo`, in the Admin registry. A
|
|
20
|
+
* yank only takes the version out of resolution: its installations keep running and its
|
|
21
|
+
* deployment keeps serving (tech [.72368]). Idempotent: a rerun answers `unchanged`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function yankPublication(input: {
|
|
24
|
+
readonly origin: string;
|
|
25
|
+
readonly version: Version;
|
|
26
|
+
readonly undo: boolean;
|
|
27
|
+
readonly projectDir: string;
|
|
28
|
+
readonly signal: AbortSignal;
|
|
29
|
+
}, open?: (input: {
|
|
30
|
+
readonly projectDir: string;
|
|
31
|
+
readonly signal: AbortSignal;
|
|
32
|
+
}) => Promise<Pick<DomainRegistry, 'yank'>>): Promise<YankReportV1>;
|
|
33
|
+
/** The one line a person reads for a report. */
|
|
34
|
+
export declare function yankSummary(report: YankReportV1): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { openDomainRegistry } from './registry/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Yank one published version of `origin`, or restore it with `undo`, in the Admin registry. A
|
|
4
|
+
* yank only takes the version out of resolution: its installations keep running and its
|
|
5
|
+
* deployment keeps serving (tech [.72368]). Idempotent: a rerun answers `unchanged`.
|
|
6
|
+
*/
|
|
7
|
+
export async function yankPublication(input, open = openDomainRegistry) {
|
|
8
|
+
const registry = await open({ projectDir: input.projectDir, signal: input.signal });
|
|
9
|
+
const outcome = await registry.yank(input.origin, input.version, { undo: input.undo });
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
format: 'astrale.yank-report',
|
|
12
|
+
version: 1,
|
|
13
|
+
origin: input.origin,
|
|
14
|
+
publication: Object.freeze({
|
|
15
|
+
version: outcome.publication.version,
|
|
16
|
+
yanked: outcome.publication.yanked,
|
|
17
|
+
}),
|
|
18
|
+
status: outcome.status,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** The one line a person reads for a report. */
|
|
22
|
+
export function yankSummary(report) {
|
|
23
|
+
const name = `${report.origin}@${report.publication.version}`;
|
|
24
|
+
if (report.publication.yanked) {
|
|
25
|
+
return report.status === 'changed'
|
|
26
|
+
? `Yanked ${name}: line references no longer choose it; its installations and its deployment keep running.`
|
|
27
|
+
: `${name} was already yanked.`;
|
|
28
|
+
}
|
|
29
|
+
return report.status === 'changed'
|
|
30
|
+
? `Restored ${name}: line references can choose it again.`
|
|
31
|
+
: `${name} was not yanked.`;
|
|
32
|
+
}
|
|
@@ -10,7 +10,7 @@ export interface FunctionRequirements {
|
|
|
10
10
|
readonly keys: ReadonlySet<string>;
|
|
11
11
|
readonly indeterminate: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function domainFunctionRequirements(project: SourceProject): FunctionRequirements;
|
|
14
14
|
export declare function requiredCallable(project: SourceProject, file: SourceFile, input: ts.Expression): Pick<RemoteCallable, 'module' | 'selector'> | undefined;
|
|
15
15
|
export declare function declaredDomainDependencies(project: SourceProject): {
|
|
16
16
|
readonly aliases: ReadonlyMap<string, string>;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { objectProperty, resolveImportedSymbol, resolveProjectImport, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
3
3
|
import { definitionObjects, DSL_MODULES, production, propertyExpression } from './shared.js';
|
|
4
|
-
export function
|
|
5
|
-
const
|
|
6
|
-
const file =
|
|
4
|
+
export function domainFunctionRequirements(project) {
|
|
5
|
+
const domainPath = project.policy.rootFiles.find(({ id }) => id === 'domain')?.sourcePath;
|
|
6
|
+
const file = domainPath && project.filesByPath.get(domainPath);
|
|
7
7
|
if (!file)
|
|
8
8
|
return { keys: new Set(), indeterminate: true };
|
|
9
|
-
const
|
|
9
|
+
const definitions = [];
|
|
10
10
|
visit(file.source, (node) => {
|
|
11
11
|
if (!ts.isCallExpression(node))
|
|
12
12
|
return;
|
|
13
13
|
const symbol = resolveImportedSymbol(file, node.expression);
|
|
14
14
|
if (symbol.kind === 'resolved' &&
|
|
15
|
-
symbol.name === '
|
|
16
|
-
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/
|
|
17
|
-
|
|
15
|
+
symbol.name === 'defineDomain' &&
|
|
16
|
+
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/domain')) {
|
|
17
|
+
definitions.push(node);
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
if (
|
|
20
|
+
if (definitions.length !== 1)
|
|
21
21
|
return { keys: new Set(), indeterminate: true };
|
|
22
|
-
const input =
|
|
22
|
+
const input = definitions[0].arguments[0];
|
|
23
23
|
if (!input || !ts.isObjectLiteralExpression(unwrap(input))) {
|
|
24
24
|
return { keys: new Set(), indeterminate: true };
|
|
25
25
|
}
|
|
@@ -40,7 +40,7 @@ export function applicationFunctionRequirements(project) {
|
|
|
40
40
|
if (requirementsSymbol.kind !== 'resolved' ||
|
|
41
41
|
requirementsSymbol.name !== 'requirements' ||
|
|
42
42
|
(requirementsSymbol.module !== '@astrale-os/sdk' &&
|
|
43
|
-
requirementsSymbol.module !== '@astrale-os/sdk/
|
|
43
|
+
requirementsSymbol.module !== '@astrale-os/sdk/domain')) {
|
|
44
44
|
return { keys: new Set(), indeterminate: true };
|
|
45
45
|
}
|
|
46
46
|
const definition = requirementsCall.arguments[0];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { propertyChain, resolveImportedSymbol, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { domainFunctionRequirements, callableReference, callableSelector, declaredDomainDependencies, remoteCallableKey, } from './callable-requirements.js';
|
|
4
4
|
import { ambiguity, calls, isForeignDomain, production, violation } from './shared.js';
|
|
5
5
|
export const dependencyRules = [
|
|
6
6
|
{
|
|
7
7
|
id: 'FNC-XDOM-DECLARED',
|
|
8
|
-
ruleRevision: '
|
|
8
|
+
ruleRevision: '72f960f87ac682695ea495925e31d15b9bd640b25d90ac1dcc6a1329a0be51b0',
|
|
9
9
|
evaluate(project) {
|
|
10
10
|
const evidence = [];
|
|
11
11
|
for (const file of production(project, 'functions')) {
|
|
@@ -19,15 +19,15 @@ export const dependencyRules = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: 'FNC-XDOM-REQ',
|
|
22
|
-
ruleRevision: '
|
|
22
|
+
ruleRevision: 'a4666ebb09b2027983edc2ffc6411692ade9877ee9c4f23c4b0a8d157a0cf385',
|
|
23
23
|
evaluate(project) {
|
|
24
24
|
const { targets, evidence } = observeInvocations(project);
|
|
25
|
-
const declared =
|
|
25
|
+
const declared = domainFunctionRequirements(project);
|
|
26
26
|
const results = evidence.filter(({ kind }) => kind === 'ambiguity');
|
|
27
27
|
for (const target of targets) {
|
|
28
28
|
if (declared.keys.has(remoteCallableKey(target)))
|
|
29
29
|
continue;
|
|
30
|
-
results.push((declared.indeterminate ? ambiguity : violation)(target.file, target.node, `Remote Domain callable ${target.module} ${target.selector.join('.')} lacks one provable exact
|
|
30
|
+
results.push((declared.indeterminate ? ambiguity : violation)(target.file, target.node, `Remote Domain callable ${target.module} ${target.selector.join('.')} lacks one provable exact Domain Function requirement.`));
|
|
31
31
|
}
|
|
32
32
|
return results;
|
|
33
33
|
},
|
|
@@ -70,16 +70,18 @@ function observeInvocations(project) {
|
|
|
70
70
|
let alias;
|
|
71
71
|
let selector;
|
|
72
72
|
if (path[0] === 'dependencies') {
|
|
73
|
-
if (path.length !== 4 || !['caller', 'self'
|
|
74
|
-
evidence.push(violation(file, node, 'Dependency invocation requires one direct alias and one explicit caller
|
|
73
|
+
if (path.length !== 4 || !['caller', 'self'].includes(path[2])) {
|
|
74
|
+
evidence.push(violation(file, node, 'Dependency invocation requires one direct alias and one explicit caller or self authority.'));
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
alias = path[1];
|
|
78
78
|
selector = selectedCallable(node.arguments[0]);
|
|
79
79
|
}
|
|
80
|
-
else if (path[0] === 'kernel'
|
|
81
|
-
(path.length
|
|
82
|
-
(
|
|
80
|
+
else if (path[0] === 'kernel') {
|
|
81
|
+
if (path.length !== 2 && (path.length !== 3 || !['caller', 'self'].includes(path[1]))) {
|
|
82
|
+
evidence.push(violation(file, node, 'Kernel invocation requires the default, caller, or self authority.'));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
83
85
|
const argument = node.arguments[0];
|
|
84
86
|
if (!argument) {
|
|
85
87
|
evidence.push(violation(file, node, 'Kernel invocation requires one canonical typed reference.'));
|
|
@@ -887,7 +887,7 @@ function isDomainDefinitionCall(file, call) {
|
|
|
887
887
|
const expression = unwrap(call.expression);
|
|
888
888
|
const direct = importedSymbol(file, expression);
|
|
889
889
|
if (direct?.module.startsWith('@astrale-os/sdk') &&
|
|
890
|
-
(direct.name === '
|
|
890
|
+
(direct.name === 'defineDomain' ||
|
|
891
891
|
direct.name === 'defineFrontend' ||
|
|
892
892
|
direct.name === 'defineRuntime' ||
|
|
893
893
|
direct.name === 'requirements')) {
|
|
@@ -8,7 +8,7 @@ const FORBIDDEN_CALLS = new Set(['invoke', 'query', 'retry', 'run', 'submit']);
|
|
|
8
8
|
export const mutationRules = [
|
|
9
9
|
{
|
|
10
10
|
id: 'MUT-PLAN-REQ',
|
|
11
|
-
ruleRevision: '
|
|
11
|
+
ruleRevision: '73f37ffa6b2fa4a1f236749696404d6b1fb399f1ea0e3947d8ac4df7073b3ceb',
|
|
12
12
|
evaluate(project) {
|
|
13
13
|
const evidence = [];
|
|
14
14
|
const targets = [];
|
|
@@ -30,7 +30,7 @@ export const mutationRules = [
|
|
|
30
30
|
targets.push({ file, node: selectedClass, ...target, operation: classOperation });
|
|
31
31
|
}
|
|
32
32
|
else if (selectedClass && expressionSelectsDependency(selectedClass)) {
|
|
33
|
-
evidence.push(ambiguity(file, selectedClass, 'Mutation plan selects a foreign Class dynamically, so its
|
|
33
|
+
evidence.push(ambiguity(file, selectedClass, 'Mutation plan selects a foreign Class dynamically, so its Domain requirement cannot be proven.'));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -46,21 +46,21 @@ export const mutationRules = [
|
|
|
46
46
|
}
|
|
47
47
|
if (targets.length === 0 && identityCalls.length === 0)
|
|
48
48
|
return evidence;
|
|
49
|
-
const requirements =
|
|
49
|
+
const requirements = domainPlanRequirements(project);
|
|
50
50
|
for (const target of targets) {
|
|
51
51
|
const key = classRequirementKey(target.dependency, target.className, target.operation);
|
|
52
52
|
if (requirements.classes.has(key))
|
|
53
53
|
continue;
|
|
54
54
|
evidence.push(requirements.indeterminate
|
|
55
|
-
? ambiguity(target.file, target.node, `
|
|
56
|
-
: violation(target.file, target.node, `Mutation plan dependency ${target.dependency} Class ${target.className} lacks
|
|
55
|
+
? ambiguity(target.file, target.node, `Domain Class requirements are opaque for dependency ${target.dependency} Class ${target.className}.`)
|
|
56
|
+
: violation(target.file, target.node, `Mutation plan dependency ${target.dependency} Class ${target.className} lacks Domain ${target.operation} authority.`));
|
|
57
57
|
}
|
|
58
58
|
for (const invocation of identityCalls) {
|
|
59
59
|
if (!requirements.functions.has(invocation.syscall)) {
|
|
60
60
|
const name = invocation.syscall === 'register' ? 'Register' : 'Provision';
|
|
61
61
|
evidence.push(requirements.indeterminate
|
|
62
|
-
? ambiguity(invocation.file, invocation.node, `
|
|
63
|
-
: violation(invocation.file, invocation.node, `Kernel ${name} invocation lacks the exact
|
|
62
|
+
? ambiguity(invocation.file, invocation.node, `Domain Function requirements are opaque for Kernel ${name}.`)
|
|
63
|
+
: violation(invocation.file, invocation.node, `Kernel ${name} invocation lacks the exact Domain Function requirement.`));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
return evidence;
|
|
@@ -748,24 +748,24 @@ function parameterProperty(use, sourceName) {
|
|
|
748
748
|
const property = element.propertyName ?? element.name;
|
|
749
749
|
return (ts.isIdentifier(property) || ts.isStringLiteral(property)) && property.text === sourceName;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
752
|
-
const
|
|
753
|
-
const file =
|
|
751
|
+
function domainPlanRequirements(project) {
|
|
752
|
+
const domainPath = project.policy.rootFiles.find(({ id }) => id === 'domain')?.sourcePath;
|
|
753
|
+
const file = domainPath && project.filesByPath.get(domainPath);
|
|
754
754
|
if (!file)
|
|
755
755
|
return emptyPlanRequirements(true);
|
|
756
|
-
const
|
|
756
|
+
const definitions = [];
|
|
757
757
|
visit(file.source, (node) => {
|
|
758
758
|
if (!ts.isCallExpression(node))
|
|
759
759
|
return;
|
|
760
760
|
const symbol = importedSymbol(file, node.expression);
|
|
761
|
-
if (symbol?.name === '
|
|
762
|
-
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/
|
|
763
|
-
|
|
761
|
+
if (symbol?.name === 'defineDomain' &&
|
|
762
|
+
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/domain')) {
|
|
763
|
+
definitions.push(node);
|
|
764
764
|
}
|
|
765
765
|
});
|
|
766
|
-
if (
|
|
766
|
+
if (definitions.length !== 1)
|
|
767
767
|
return emptyPlanRequirements(true);
|
|
768
|
-
const input = staticObject(
|
|
768
|
+
const input = staticObject(definitions[0].arguments[0]);
|
|
769
769
|
const requirementValue = input && assignedValue(input, 'requirements');
|
|
770
770
|
if (requirementValue === undefined)
|
|
771
771
|
return emptyPlanRequirements(false);
|
|
@@ -774,7 +774,7 @@ function applicationPlanRequirements(project) {
|
|
|
774
774
|
if (!requirementCall ||
|
|
775
775
|
requirementSymbol?.name !== 'requirements' ||
|
|
776
776
|
(requirementSymbol.module !== '@astrale-os/sdk' &&
|
|
777
|
-
requirementSymbol.module !== '@astrale-os/sdk/
|
|
777
|
+
requirementSymbol.module !== '@astrale-os/sdk/domain')) {
|
|
778
778
|
return emptyPlanRequirements(true);
|
|
779
779
|
}
|
|
780
780
|
const definition = staticObject(requirementCall.arguments[0]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { propertyChain, resolveImportedSymbol, resolveProjectImport, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { domainFunctionRequirements, callableReference, callableSelector, externalFacade, lexicalConstInitializer, remoteCallableKey, } from './callable-requirements.js';
|
|
4
4
|
import { ambiguity, production, violation } from './shared.js';
|
|
5
5
|
const LOCAL_DOMAIN_LAYERS = new Set([
|
|
6
6
|
'functions',
|
|
@@ -54,7 +54,7 @@ export const providerRules = [
|
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
id: 'PRV-XDOM-REQ',
|
|
57
|
-
ruleRevision: '
|
|
57
|
+
ruleRevision: 'b3fc6c409374b924b1b06c17f6d3702ec9d1e9e7a286bd955a151d0bf12c5b24',
|
|
58
58
|
evaluate(project) {
|
|
59
59
|
const targets = [];
|
|
60
60
|
const evidence = [];
|
|
@@ -71,14 +71,14 @@ export const providerRules = [
|
|
|
71
71
|
}
|
|
72
72
|
if (targets.length === 0)
|
|
73
73
|
return evidence;
|
|
74
|
-
const declared =
|
|
74
|
+
const declared = domainFunctionRequirements(project);
|
|
75
75
|
for (const target of targets) {
|
|
76
76
|
if (declared.keys.has(remoteCallableKey(target)))
|
|
77
77
|
continue;
|
|
78
78
|
const selector = target.selector.join('.');
|
|
79
79
|
evidence.push(declared.indeterminate
|
|
80
|
-
? ambiguity(target.file, target.node, `
|
|
81
|
-
: violation(target.file, target.node, `Remote Domain callable ${target.module} ${selector} lacks one exact
|
|
80
|
+
? ambiguity(target.file, target.node, `Domain Function requirements are opaque for ${target.module} ${selector}.`)
|
|
81
|
+
: violation(target.file, target.node, `Remote Domain callable ${target.module} ${selector} lacks one exact Domain Function requirement.`));
|
|
82
82
|
}
|
|
83
83
|
return evidence;
|
|
84
84
|
},
|
|
@@ -11,7 +11,7 @@ const DECLARATIONS = [
|
|
|
11
11
|
];
|
|
12
12
|
const FRONTEND_MODULES = new Set([
|
|
13
13
|
'@astrale-os/sdk',
|
|
14
|
-
'@astrale-os/sdk/
|
|
14
|
+
'@astrale-os/sdk/domain',
|
|
15
15
|
'@astrale-os/sdk/view',
|
|
16
16
|
]);
|
|
17
17
|
export const viewRules = [
|
|
@@ -48,7 +48,7 @@ export const viewRules = [
|
|
|
48
48
|
evidence.push(uncertain);
|
|
49
49
|
continue;
|
|
50
50
|
}
|
|
51
|
-
evidence.push(violation(file, definition.call, 'Views composes an SDK frontend; move defineFrontend beside
|
|
51
|
+
evidence.push(violation(file, definition.call, 'Views composes an SDK frontend; move defineFrontend beside defineDomain in domain.ts.'));
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
return evidence;
|