@astrale-os/sdk 0.6.0-beta.2 → 0.6.0-beta.20
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 +74 -0
- package/dist/tooling/cli/publish/index.js +364 -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 +127 -0
- package/dist/tooling/cli/registry/client.js +351 -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
|
@@ -2,8 +2,14 @@ import type { Domain } from '../../platform/schema/index.js';
|
|
|
2
2
|
import type { ActionContext, ResolvedCallable } from '../action/index.js';
|
|
3
3
|
import type { DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
|
|
4
4
|
import type { Integrations } from '../integration/index.js';
|
|
5
|
+
import type { DurableCallable, DurableWorkflowContext } from './durable.js';
|
|
5
6
|
import type { WorkflowStep } from './step/index.js';
|
|
6
|
-
/**
|
|
7
|
-
export type
|
|
7
|
+
/** Multi-step context of one authenticated value-output callable run inside its invocation. */
|
|
8
|
+
export type InlineWorkflowContext<Callable extends ResolvedCallable, DomainValue extends Domain = Domain, Definitions extends Integrations = Readonly<Record<never, never>>, Errors extends DeclaredErrors = NoDeclaredErrors> = ActionContext<Callable, DomainValue, Definitions, Errors> & {
|
|
8
9
|
readonly step: WorkflowStep;
|
|
9
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Exact Workflow context for one callable: engine-journaled when its Schema declares
|
|
13
|
+
* `execution: { durable: true }`, otherwise run inside its invocation.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkflowContext<Callable extends ResolvedCallable, DomainValue extends Domain = Domain, Definitions extends Integrations = Readonly<Record<never, never>>, Errors extends DeclaredErrors = NoDeclaredErrors> = Callable extends DurableCallable ? DurableWorkflowContext<Callable, DomainValue, Errors> : InlineWorkflowContext<Callable, DomainValue, Definitions, Errors>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { schema } from '../../platform/schema/index.js';
|
|
2
2
|
import type { ResolvedDomainOf } from '../action/index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
|
|
4
4
|
import type { Integrations } from '../integration/index.js';
|
|
5
|
-
import type { CallableAtWorkflowAddress, Workflow, WorkflowAddress, WorkflowDefinition } from './workflow.js';
|
|
5
|
+
import type { CallableAtWorkflowAddress, Workflow, WorkflowAddress, WorkflowDefinition, WorkflowOptions } from './workflow.js';
|
|
6
6
|
/** Define one authenticated multi-step value-output implementation by its SDK Action address. */
|
|
7
7
|
export declare function defineWorkflow<Schema extends schema.DomainSchema, Definitions extends Integrations = Readonly<Record<never, never>>>(): {
|
|
8
8
|
<const Address extends WorkflowAddress<Schema>>(address: Address, run: Workflow<CallableAtWorkflowAddress<Schema, Address>, Definitions, ResolvedDomainOf<Schema>, NoDeclaredErrors>): WorkflowDefinition<Schema, Address, Definitions, NoDeclaredErrors>;
|
|
9
|
-
<const Address extends WorkflowAddress<Schema>, const Errors extends DeclaredErrors>(address: Address, options:
|
|
9
|
+
<const Address extends WorkflowAddress<Schema>, const Errors extends DeclaredErrors = NoDeclaredErrors>(address: Address, options: WorkflowOptions<Errors>, run: Workflow<CallableAtWorkflowAddress<Schema, Address>, Definitions, ResolvedDomainOf<Schema>, Errors>): WorkflowDefinition<Schema, Address, Definitions, Errors>;
|
|
10
10
|
};
|
|
11
11
|
export declare function isWorkflow(input: unknown): input is WorkflowDefinition;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { rememberDeclaredErrors } from '../error/index.js';
|
|
3
3
|
const admittedWorkflows = new WeakSet();
|
|
4
|
+
const COMPAT_TOKEN = /^[A-Za-z0-9._~-]{1,64}$/u;
|
|
4
5
|
/** Define one authenticated multi-step value-output implementation by its SDK Action address. */
|
|
5
6
|
export function defineWorkflow() {
|
|
6
7
|
return function define(address, optionsOrRun, possibleRun) {
|
|
7
8
|
acceptWorkflowAddress(address);
|
|
8
|
-
const options = possibleRun === undefined ? undefined : optionsOrRun;
|
|
9
|
+
const options = possibleRun === undefined ? undefined : acceptOptions(optionsOrRun);
|
|
9
10
|
const run = possibleRun ?? optionsOrRun;
|
|
10
11
|
if (typeof run !== 'function')
|
|
11
12
|
throw new TypeError('Workflow run must be a function.');
|
|
@@ -13,13 +14,28 @@ export function defineWorkflow() {
|
|
|
13
14
|
kind: 'workflow',
|
|
14
15
|
address,
|
|
15
16
|
run,
|
|
17
|
+
...(options?.compat === undefined ? {} : { compat: options.compat }),
|
|
16
18
|
});
|
|
17
|
-
if (options !== undefined)
|
|
18
|
-
rememberDeclaredErrors(workflow, options);
|
|
19
|
+
if (options?.errors !== undefined)
|
|
20
|
+
rememberDeclaredErrors(workflow, { errors: options.errors });
|
|
19
21
|
admittedWorkflows.add(workflow);
|
|
20
22
|
return workflow;
|
|
21
23
|
};
|
|
22
24
|
}
|
|
25
|
+
function acceptOptions(input) {
|
|
26
|
+
if (input === null ||
|
|
27
|
+
typeof input !== 'object' ||
|
|
28
|
+
Array.isArray(input) ||
|
|
29
|
+
Reflect.ownKeys(input).some((key) => key !== 'errors' && key !== 'compat')) {
|
|
30
|
+
throw new TypeError('Workflow options accept only errors and compat.');
|
|
31
|
+
}
|
|
32
|
+
const options = input;
|
|
33
|
+
if (options.compat !== undefined &&
|
|
34
|
+
(typeof options.compat !== 'string' || !COMPAT_TOKEN.test(options.compat))) {
|
|
35
|
+
throw new TypeError(`Invalid Workflow compat token: ${JSON.stringify(options.compat)}.`);
|
|
36
|
+
}
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
23
39
|
export function isWorkflow(input) {
|
|
24
40
|
return input !== null && typeof input === 'object' && admittedWorkflows.has(input);
|
|
25
41
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { IssuerId } from '../../platform/auth/index.js';
|
|
2
|
+
import type { BoundClientSession, ExecutionOutcome, ExecutionRef } from '../../platform/client/session/index.js';
|
|
3
|
+
import type { NodeId } from '../../platform/graph/node/index.js';
|
|
4
|
+
import type { CallableInputOf, Domain, ResolvedMethod } from '../../platform/schema/index.js';
|
|
5
|
+
import type { Value } from '../../platform/value/index.js';
|
|
6
|
+
import type { DeclaredErrorFactory, DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
|
|
7
|
+
import type { Mutation, MutationExecutor } from '../mutation/index.js';
|
|
8
|
+
import type { QueryExecutor } from '../query/index.js';
|
|
9
|
+
/** A callable whose Schema declares `execution: { durable: true }`. */
|
|
10
|
+
export interface DurableCallable {
|
|
11
|
+
readonly execution: {
|
|
12
|
+
readonly durable: true;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Attested facts of the running Execution. They are data, never authority. */
|
|
16
|
+
export interface DurableExecution {
|
|
17
|
+
/** The `K.Execution` node recording this call. */
|
|
18
|
+
readonly id: NodeId;
|
|
19
|
+
readonly function: {
|
|
20
|
+
readonly id: NodeId;
|
|
21
|
+
readonly version: `sha256:${string}`;
|
|
22
|
+
};
|
|
23
|
+
/** Kernel that recorded the Execution; every Step calls it back as the Domain. */
|
|
24
|
+
readonly kernel: IssuerId;
|
|
25
|
+
/** Who started the Execution. The Workflow never receives their credential. */
|
|
26
|
+
readonly initiator: {
|
|
27
|
+
readonly principal: NodeId;
|
|
28
|
+
readonly caller: NodeId;
|
|
29
|
+
};
|
|
30
|
+
/** Receiver of a durable instance Method. */
|
|
31
|
+
readonly receiver?: NodeId;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The Domain's own authority inside one Step. Kernel access exists only here, so every Kernel call
|
|
35
|
+
* belongs to a journaled Step and a replay never repeats it.
|
|
36
|
+
*/
|
|
37
|
+
export interface DurableStepAuthority<DomainValue extends Domain = Domain> {
|
|
38
|
+
/**
|
|
39
|
+
* Kernel Session acting as the Domain. Each `invoke` without an explicit `idempotencyKey` carries
|
|
40
|
+
* one derived from the Execution, the Step and its position, so a retried Step reaches the same
|
|
41
|
+
* durable child Execution.
|
|
42
|
+
*/
|
|
43
|
+
readonly kernel: BoundClientSession;
|
|
44
|
+
readonly query: QueryExecutor<DomainValue>;
|
|
45
|
+
/** Each Mutation carries a key derived from the Execution, the Step and its position. */
|
|
46
|
+
readonly mutate: MutationExecutor<DomainValue>;
|
|
47
|
+
}
|
|
48
|
+
export interface DurableStep<DomainValue extends Domain = Domain> {
|
|
49
|
+
/**
|
|
50
|
+
* Run `execute` once and journal its portable output; a replay returns the journaled output. A
|
|
51
|
+
* Step may run again when its outcome was not journaled, so its effects must be idempotent.
|
|
52
|
+
*/
|
|
53
|
+
run<Output>(id: string, execute: (authority: DurableStepAuthority<DomainValue>) => Output | Promise<Output>): Promise<Output>;
|
|
54
|
+
/**
|
|
55
|
+
* One journaled Mutation. Give it a zero-match precondition on a natural key (for example the
|
|
56
|
+
* Execution id) and map that failure in `reject`, so a Step replayed after its commit finds its
|
|
57
|
+
* own effect instead of repeating it.
|
|
58
|
+
*/
|
|
59
|
+
mutate<Input, Output>(id: string, mutation: Mutation<DomainValue, Input, Output>, input: Input): Promise<Output>;
|
|
60
|
+
}
|
|
61
|
+
type DurableSelfOf<Callable> = Callable extends ResolvedMethod<unknown, unknown, false> ? {
|
|
62
|
+
readonly self: NodeId;
|
|
63
|
+
} : {
|
|
64
|
+
readonly self?: never;
|
|
65
|
+
};
|
|
66
|
+
/** Context of a durable Workflow: engine-journaled, acting as its Domain. */
|
|
67
|
+
export type DurableWorkflowContext<Callable, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = {
|
|
68
|
+
readonly domain: DomainValue;
|
|
69
|
+
readonly input: CallableInputOf<Callable>;
|
|
70
|
+
readonly execution: DurableExecution;
|
|
71
|
+
/** Construct one implementation-declared safe business error for `throw error(...)`. */
|
|
72
|
+
readonly error: DeclaredErrorFactory<Errors>;
|
|
73
|
+
readonly step: DurableStep<DomainValue>;
|
|
74
|
+
/** Durable timer kept by the engine, even while the Domain is idle or down. */
|
|
75
|
+
sleep(durationMs: number): Promise<void>;
|
|
76
|
+
/** Resolve once `Execution.signal({ name, value })` delivers `name`, before or during the wait. */
|
|
77
|
+
promise<Signal extends Value = Value>(name: string): Promise<Signal>;
|
|
78
|
+
/** Whether `error` is the engine's cooperative cancellation, which the Workflow may compensate. */
|
|
79
|
+
cancelled(error: unknown): boolean;
|
|
80
|
+
/** Wait durably for another Execution to end, by journaled polling of its `result`. */
|
|
81
|
+
awaitExecution<Output>(execution: ExecutionRef<Output>): Promise<ExecutionOutcome<Output>>;
|
|
82
|
+
} & DurableSelfOf<Callable>;
|
|
83
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { defineWorkflow, isWorkflow } from './define.js';
|
|
2
|
-
export type { WorkflowContext } from './context.js';
|
|
3
|
-
export type {
|
|
2
|
+
export type { InlineWorkflowContext, WorkflowContext } from './context.js';
|
|
3
|
+
export type { DurableCallable, DurableExecution, DurableStep, DurableStepAuthority, DurableWorkflowContext, } from './durable.js';
|
|
4
|
+
export type { CallableAtWorkflowAddress, Workflow, WorkflowAddress, WorkflowCallable, WorkflowDefinition, WorkflowOptions, } from './workflow.js';
|
|
4
5
|
export * as step from './step/index.js';
|
|
5
6
|
export * as runner from './runner/index.js';
|
|
6
7
|
export type { DeclaredErrorDefinition, DeclaredErrorFactory, DeclaredErrorFamily, DeclaredErrorOptions, DeclaredErrors, } from '../error/index.js';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import * as value from '../../../platform/value/index.js';
|
|
2
1
|
import { acceptStepId } from '../step/index.js';
|
|
2
|
+
import { acceptStepOutput } from '../step/output.js';
|
|
3
3
|
/** Process-local runner for tests and explicitly non-durable embeddings. */
|
|
4
4
|
export function createInlineWorkflowRunner() {
|
|
5
5
|
async function run(workflow, context) {
|
|
6
6
|
const execution = createInlineStep(context.execution.signal);
|
|
7
7
|
const complete = Object.freeze({ ...context, step: execution.step });
|
|
8
8
|
try {
|
|
9
|
+
// Runtime dispatches only non-durable Workflows inline; durable ones run on the engine.
|
|
9
10
|
return await workflow.run(complete);
|
|
10
11
|
}
|
|
11
12
|
finally {
|
|
@@ -37,10 +38,8 @@ function createInlineStep(signal) {
|
|
|
37
38
|
started.add(accepted);
|
|
38
39
|
execution = (async () => {
|
|
39
40
|
const output = await execute();
|
|
40
|
-
if (output === undefined)
|
|
41
|
-
return output;
|
|
42
41
|
try {
|
|
43
|
-
return
|
|
42
|
+
return acceptStepOutput(output);
|
|
44
43
|
}
|
|
45
44
|
catch (cause) {
|
|
46
45
|
throw new TypeError(`Workflow Step ${accepted} output must be portable.`, {
|
|
@@ -2,9 +2,9 @@ import type { Domain, schema } from '../../../platform/schema/index.js';
|
|
|
2
2
|
import type { ActionOutputOf, ResolvedCallable, ResolvedDomainOf } from '../../action/index.js';
|
|
3
3
|
import type { DeclaredErrors, NoDeclaredErrors } from '../../error/index.js';
|
|
4
4
|
import type { Integrations } from '../../integration/index.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { InlineWorkflowContext } from '../context.js';
|
|
6
6
|
import type { CallableAtWorkflowAddress, WorkflowAddress, WorkflowDefinition } from '../workflow.js';
|
|
7
|
-
export type WorkflowExecutionContext<Callable extends ResolvedCallable, Definitions extends Integrations, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = Omit<
|
|
7
|
+
export type WorkflowExecutionContext<Callable extends ResolvedCallable, Definitions extends Integrations, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = Omit<InlineWorkflowContext<Callable, DomainValue, Definitions, Errors>, 'step'>;
|
|
8
8
|
export interface WorkflowRunner {
|
|
9
9
|
run<Schema extends schema.DomainSchema, Address extends WorkflowAddress<Schema>, Definitions extends Integrations, Errors extends DeclaredErrors, Callable extends CallableAtWorkflowAddress<Schema, Address> = CallableAtWorkflowAddress<Schema, Address>>(workflow: WorkflowDefinition<Schema, Address, Definitions, Errors>, context: WorkflowExecutionContext<Callable, Definitions, ResolvedDomainOf<Schema>, Errors>): Promise<ActionOutputOf<Callable>>;
|
|
10
10
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as value from '../../../platform/value/index.js';
|
|
2
|
+
/** Capture optional Object fields as absence without changing portable Array or scalar semantics. */
|
|
3
|
+
export function acceptStepOutput(input) {
|
|
4
|
+
if (input === undefined)
|
|
5
|
+
return input;
|
|
6
|
+
const captured = new WeakMap();
|
|
7
|
+
const omitted = new WeakMap();
|
|
8
|
+
const pending = [];
|
|
9
|
+
let members = 0;
|
|
10
|
+
function capture(source, depth) {
|
|
11
|
+
if (source === null || typeof source !== 'object')
|
|
12
|
+
return source;
|
|
13
|
+
const retained = captured.get(source);
|
|
14
|
+
if (retained !== undefined)
|
|
15
|
+
return retained;
|
|
16
|
+
if (depth >= value.defaultLimits.maxDepth) {
|
|
17
|
+
throw new value.BoundaryError('VALUE_LIMIT', 'Workflow Step container depth exceeds the portable limit', '');
|
|
18
|
+
}
|
|
19
|
+
const array = Array.isArray(source);
|
|
20
|
+
const snapshot = array ? [] : Object.create(Object.getPrototypeOf(source));
|
|
21
|
+
captured.set(source, snapshot);
|
|
22
|
+
pending.push({ source, snapshot, depth, array });
|
|
23
|
+
return snapshot;
|
|
24
|
+
}
|
|
25
|
+
const snapshot = capture(input, 0);
|
|
26
|
+
for (let index = 0; index < pending.length; index += 1) {
|
|
27
|
+
const { source, snapshot: container, depth, array } = pending[index];
|
|
28
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
29
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
30
|
+
// Bound this preparatory capture too; canonical admission subsequently checks each path.
|
|
31
|
+
members += keys.length - (array ? 1 : 0);
|
|
32
|
+
if (members > value.defaultLimits.maxMembers) {
|
|
33
|
+
throw new value.BoundaryError('VALUE_LIMIT', 'Workflow Step member count exceeds the portable limit', '');
|
|
34
|
+
}
|
|
35
|
+
const absent = new Set();
|
|
36
|
+
for (const key of keys) {
|
|
37
|
+
const descriptor = Object.getOwnPropertyDescriptor(descriptors, key)
|
|
38
|
+
.value;
|
|
39
|
+
if ('value' in descriptor) {
|
|
40
|
+
if (!array &&
|
|
41
|
+
typeof key === 'string' &&
|
|
42
|
+
descriptor.enumerable &&
|
|
43
|
+
descriptor.value === undefined) {
|
|
44
|
+
// Validate this member's key, descriptor and budget before interpreting its absence.
|
|
45
|
+
descriptor.value = null;
|
|
46
|
+
absent.add(key);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
descriptor.value = capture(descriptor.value, depth + 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
Object.defineProperty(container, key, descriptor);
|
|
53
|
+
}
|
|
54
|
+
if (absent.size > 0)
|
|
55
|
+
omitted.set(container, absent);
|
|
56
|
+
}
|
|
57
|
+
// The canonical owner still rejects cycles, invalid descriptors/prototypes/keys and lossy values.
|
|
58
|
+
const output = value.accept(snapshot);
|
|
59
|
+
const pruning = [{ snapshot, output }];
|
|
60
|
+
for (let index = 0; index < pruning.length; index += 1) {
|
|
61
|
+
const pair = pruning[index];
|
|
62
|
+
if (pair.output === null || typeof pair.output !== 'object')
|
|
63
|
+
continue;
|
|
64
|
+
const source = pair.snapshot;
|
|
65
|
+
const target = pair.output;
|
|
66
|
+
for (const key of omitted.get(source) ?? [])
|
|
67
|
+
delete target[key];
|
|
68
|
+
for (const key of Object.keys(target)) {
|
|
69
|
+
pruning.push({ snapshot: source[key], output: target[key] });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return output;
|
|
73
|
+
}
|
|
@@ -12,11 +12,23 @@ export type WorkflowAddress<Schema extends schema.DomainSchema> = ActionAddressO
|
|
|
12
12
|
export type CallableAtWorkflowAddress<Schema extends schema.DomainSchema, Address extends WorkflowAddress<Schema>> = WorkflowCallable<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>>;
|
|
13
13
|
export type Workflow<Callable extends ResolvedCallable, Definitions extends Integrations = Readonly<Record<never, never>>, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = (context: WorkflowContext<Callable, DomainValue, Definitions, Errors>) => Promise<ActionOutputOf<Callable>>;
|
|
14
14
|
declare const WORKFLOW_SCHEMA: unique symbol;
|
|
15
|
+
/** Options of one Workflow implementation. */
|
|
16
|
+
export interface WorkflowOptions<out Errors extends DeclaredErrors = DeclaredErrors> {
|
|
17
|
+
readonly errors?: Errors;
|
|
18
|
+
/**
|
|
19
|
+
* Durable only. Compatibility token journaled first by every run: keep it while a redeployment
|
|
20
|
+
* can replay the journals of running Executions, change it when it cannot, and those runs pause
|
|
21
|
+
* until they are resumed on compatible code or cancelled.
|
|
22
|
+
*/
|
|
23
|
+
readonly compat?: string;
|
|
24
|
+
}
|
|
15
25
|
/** Sealed multi-step Workflow awaiting canonical callable association by Runtime admission. */
|
|
16
26
|
export interface WorkflowDefinition<Schema extends schema.DomainSchema = schema.DomainSchema, Address extends WorkflowAddress<Schema> = WorkflowAddress<Schema>, Definitions extends Integrations = Readonly<Record<never, never>>, Errors extends DeclaredErrors = NoDeclaredErrors> {
|
|
17
27
|
readonly kind: 'workflow';
|
|
18
28
|
readonly address: Address;
|
|
19
29
|
readonly run: Workflow<CallableAtWorkflowAddress<Schema, Address>, Definitions, ResolvedDomainOf<Schema>, Errors>;
|
|
30
|
+
/** Durable compatibility token; absent means the default token. */
|
|
31
|
+
readonly compat?: string;
|
|
20
32
|
/** Invariant type-only Schema witness; absent from emitted JavaScript. */
|
|
21
33
|
readonly [WORKFLOW_SCHEMA]: (schema: Schema) => Schema;
|
|
22
34
|
}
|
|
@@ -1,27 +1,75 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import type { FrozenConfigurationV1 } from '../address/index.js';
|
|
2
|
+
import type { Bundler } from './bundle/index.js';
|
|
3
|
+
import type { ArtifactSource, DeployContext, DeployResult, PrepareContext } from './legacy/index.js';
|
|
4
|
+
import type { ConfigureContext, ListContext, ListedDeployment, Placement, PlacementContext, ReleaseDeployContext, ReleaseDeployResult, RetainContext } from './release/index.js';
|
|
5
|
+
/** What `admit` receives when `defineProject` binds an adapter to one Environment. */
|
|
7
6
|
export interface AdapterEnvironmentContext {
|
|
8
7
|
readonly environment: string;
|
|
9
|
-
readonly installation?: InstallationTarget;
|
|
10
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A provider adapter (adapter interface v2). It bundles a Build without any Environment, freezes
|
|
11
|
+
* an Environment's configuration, says where the host places that Environment's deployments, and
|
|
12
|
+
* deploys one sealed release as one immutable deployment, created or reused. It never installs:
|
|
13
|
+
* `astrale domain install <url>` installs a deployment by its URL.
|
|
14
|
+
*
|
|
15
|
+
* `prepare` and `deploy` remain only for an adapter that also serves Environments on the legacy
|
|
16
|
+
* direct-mode path (CT33); an adapter declares both or neither.
|
|
17
|
+
*/
|
|
11
18
|
export interface Adapter<Parameters extends object = object> {
|
|
12
19
|
readonly kind: 'adapter';
|
|
13
20
|
readonly name: string;
|
|
14
21
|
readonly version: string;
|
|
22
|
+
/**
|
|
23
|
+
* Produces the environment-free bytes `astrale-domain build` identifies by their build digest
|
|
24
|
+
* and `deployRelease` receives as its Bundle. Adapters that share one bundler share one build.
|
|
25
|
+
*/
|
|
26
|
+
readonly bundler: Bundler;
|
|
27
|
+
/** Refuse parameters that cannot serve this Environment, before any effect. */
|
|
15
28
|
admit?(parameters: Parameters, context: AdapterEnvironmentContext): void;
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
/** Freeze what a deployment of this Environment binds beside its build. Pure. */
|
|
30
|
+
configure(parameters: Parameters, context: ConfigureContext): FrozenConfigurationV1;
|
|
31
|
+
/** Where the host places this Environment's deployments. No effect at the host. */
|
|
32
|
+
placement(parameters: Parameters, context: PlacementContext): Promise<Placement>;
|
|
33
|
+
/** Create, or reuse, the immutable deployment of one sealed release. */
|
|
34
|
+
deployRelease(parameters: Parameters, context: ReleaseDeployContext): Promise<ReleaseDeployResult>;
|
|
35
|
+
/**
|
|
36
|
+
* The deployments of one Environment of one origin the host keeps for the caller, each with
|
|
37
|
+
* where it is called. No effect at the host.
|
|
38
|
+
*/
|
|
39
|
+
list?(parameters: Parameters, context: ListContext): Promise<readonly ListedDeployment[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Keep one published deployment where the host has no registry principal to mark it (a platform
|
|
42
|
+
* namespace). Called only after its Publication commits. Rejects with a `RetainRefusal` when the
|
|
43
|
+
* host can no longer keep it (absent or retired), which no rerun changes; any other rejection is
|
|
44
|
+
* transient. Absent: the registry marks it (Admin's Services).
|
|
45
|
+
*/
|
|
46
|
+
retain?(parameters: Parameters, context: RetainContext): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Legacy direct-mode path (CT33) only: place a build at a stable target. Replacement:
|
|
49
|
+
* `bundler`, `configure` and `placement`. Deleted with the legacy path (D10).
|
|
50
|
+
*/
|
|
51
|
+
prepare?(parameters: Parameters, context: PrepareContext): Promise<ArtifactSource>;
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Legacy direct-mode path (CT33) only: replace a stable target's code in place.
|
|
54
|
+
* Replacement: `deployRelease`. Deleted with the legacy path (D10).
|
|
55
|
+
*/
|
|
56
|
+
deploy?(parameters: Parameters, context: DeployContext): Promise<DeployResult>;
|
|
18
57
|
readonly secretsFile?: (parameters: Parameters) => string | undefined;
|
|
19
58
|
}
|
|
59
|
+
/** What `defineAdapter` admits for an `Adapter` (adapter interface v2). */
|
|
20
60
|
export interface AdapterInput<Parameters extends object> {
|
|
21
61
|
readonly name: string;
|
|
22
62
|
readonly version: string;
|
|
63
|
+
readonly bundler: Bundler;
|
|
23
64
|
admit?(parameters: Parameters, context: AdapterEnvironmentContext): void;
|
|
24
|
-
|
|
25
|
-
|
|
65
|
+
configure(parameters: Parameters, context: ConfigureContext): FrozenConfigurationV1;
|
|
66
|
+
placement(parameters: Parameters, context: PlacementContext): Promise<Placement>;
|
|
67
|
+
deployRelease(parameters: Parameters, context: ReleaseDeployContext): Promise<ReleaseDeployResult>;
|
|
68
|
+
list?(parameters: Parameters, context: ListContext): Promise<readonly ListedDeployment[]>;
|
|
69
|
+
retain?(parameters: Parameters, context: RetainContext): Promise<void>;
|
|
70
|
+
/** @deprecated Legacy direct-mode path (CT33) only. Replacement: `configure`, `placement`. */
|
|
71
|
+
prepare?(parameters: Parameters, context: PrepareContext): Promise<ArtifactSource>;
|
|
72
|
+
/** @deprecated Legacy direct-mode path (CT33) only. Replacement: `deployRelease`. */
|
|
73
|
+
deploy?(parameters: Parameters, context: DeployContext): Promise<DeployResult>;
|
|
26
74
|
readonly secretsFile?: (parameters: Parameters) => string | undefined;
|
|
27
75
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Build, BuildDigest, BuildManifestV1 } from '../../build/index.js';
|
|
2
|
+
import type { ResolvedRuntimeReference } from '../../runtime/index.js';
|
|
3
|
+
import type { ArtifactFile, PreparedArtifactFile } from './file.js';
|
|
4
|
+
/**
|
|
5
|
+
* Produces the environment-free bytes of one Build. It takes no Environment, address, key or
|
|
6
|
+
* secret, which is what makes its build digest identical in every Environment. Adapters that share
|
|
7
|
+
* a bundler share their build.
|
|
8
|
+
*/
|
|
9
|
+
export interface Bundler {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly version: string;
|
|
12
|
+
bundle(context: BundleContext): Promise<BundleSource>;
|
|
13
|
+
}
|
|
14
|
+
export interface BundleContext<BuildValue extends Build = Build> {
|
|
15
|
+
readonly projectDir: string;
|
|
16
|
+
readonly build: BuildValue;
|
|
17
|
+
readonly runtime: ResolvedRuntimeReference;
|
|
18
|
+
/** Parent-owned lifecycle cancellation shared by every bundling process. */
|
|
19
|
+
readonly signal: AbortSignal;
|
|
20
|
+
/** Optional observer of authored paths read outside the Domain/Runtime module graph. */
|
|
21
|
+
readonly recordSource?: (path: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/** Untrusted bundler output admitted by verify/preflight. */
|
|
24
|
+
export interface BundleSource {
|
|
25
|
+
readonly entrypoint: string;
|
|
26
|
+
readonly files: readonly ArtifactFile[];
|
|
27
|
+
}
|
|
28
|
+
/** Exact environment-free bytes of one Build, identified by their build digest. */
|
|
29
|
+
export interface Bundle<BuildValue extends Build = Build> {
|
|
30
|
+
readonly kind: 'bundle';
|
|
31
|
+
readonly build: BuildValue;
|
|
32
|
+
readonly manifest: BuildManifestV1;
|
|
33
|
+
readonly digest: BuildDigest;
|
|
34
|
+
readonly entrypoint: string;
|
|
35
|
+
readonly files: readonly PreparedArtifactFile[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** One file a bundler or a legacy preparation produced, before admission. */
|
|
2
|
+
export interface ArtifactFile {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly content: Uint8Array;
|
|
5
|
+
}
|
|
6
|
+
/** One admitted file: a detached copy of its bytes on every read. */
|
|
7
|
+
export interface PreparedArtifactFile {
|
|
8
|
+
readonly path: string;
|
|
9
|
+
bytes(): Uint8Array;
|
|
10
|
+
}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import type { Deployment } from '../deployment.js';
|
|
2
2
|
import type { Adapter, AdapterInput } from './adapter.js';
|
|
3
|
-
|
|
3
|
+
import type { LegacyAdapter, LegacyAdapterInput } from './legacy/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Capture one receiver-bound provider adapter (adapter interface v2): a required `bundler`,
|
|
6
|
+
* `configure`, `placement` and `deployRelease`, optionally `list` and `retain`, and `prepare` with
|
|
7
|
+
* `deploy` only while it also serves the legacy direct-mode path.
|
|
8
|
+
*/
|
|
4
9
|
export declare function defineAdapter<Parameters extends object>(input: AdapterInput<Parameters>): Adapter<Parameters>;
|
|
10
|
+
/**
|
|
11
|
+
* Capture one receiver-bound adapter on the contract before interface v2: its required `bundler`,
|
|
12
|
+
* `prepare` and `deploy`.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Every Environment such an adapter deploys is on the legacy direct-mode path (CT33).
|
|
15
|
+
* Declare adapter interface v2 instead: `configure`, `placement` and `deployRelease` beside the
|
|
16
|
+
* same `bundler`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function defineAdapter<Parameters extends object>(input: LegacyAdapterInput<Parameters>): LegacyAdapter<Parameters>;
|
|
5
19
|
/** Bind one provider adapter to the parameters of one Project Environment. */
|
|
6
|
-
export declare function defineDeployment<const Parameters extends object>(adapter: Adapter<Parameters>, parameters: Parameters): Deployment<Parameters
|
|
7
|
-
|
|
20
|
+
export declare function defineDeployment<const Parameters extends object>(adapter: Adapter<Parameters>, parameters: Parameters): Deployment<Parameters, Adapter<Parameters>>;
|
|
21
|
+
/**
|
|
22
|
+
* Bind one adapter on the contract before interface v2 to the parameters of one Environment.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated The Environment is on the legacy direct-mode path (CT33). Replacement: an adapter
|
|
25
|
+
* that implements adapter interface v2.
|
|
26
|
+
*/
|
|
27
|
+
export declare function defineDeployment<const Parameters extends object>(adapter: LegacyAdapter<Parameters>, parameters: Parameters): Deployment<Parameters, LegacyAdapter<Parameters>>;
|
|
28
|
+
/** Whether `defineAdapter` admitted this value, on either contract. */
|
|
29
|
+
export declare function isAdapter(input: unknown): input is Adapter | LegacyAdapter;
|