@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,346 @@
|
|
|
1
|
+
import * as bundle from '@astrale-os/kernel-dsl/v1/bundle/transport';
|
|
2
|
+
import { RetainRefusal } from '../../../deployment/adapter/index.js';
|
|
3
|
+
import { verifyRelease } from '../../../deployment/verify/readiness/index.js';
|
|
4
|
+
import { commitPushed } from '../commit.js';
|
|
5
|
+
import { declaredVersion } from '../diff/declared.js';
|
|
6
|
+
import { renderDiff } from '../diff/render.js';
|
|
7
|
+
import { diffReport, publishedSchema } from '../diff/report.js';
|
|
8
|
+
import { deployPlannedRelease, planImmutableDeployment, runtimeCommit, } from '../immutable-deployment.js';
|
|
9
|
+
import { DIM, RED, RESET, YELLOW } from '../log.js';
|
|
10
|
+
import { RegistryCliError, openDomainRegistry } from '../registry/index.js';
|
|
11
|
+
import { publishReport } from './report.js';
|
|
12
|
+
/**
|
|
13
|
+
* Step 5 reads the deployment's `release.json` (at most 1 MiB) and its Bundle (at most 16 MiB)
|
|
14
|
+
* once the adapter has seen it ready: a deployment that accepts the connection and never answers
|
|
15
|
+
* is refused after this long, never waited on until the CI job's own timeout.
|
|
16
|
+
*/
|
|
17
|
+
export const VERIFY_TIMEOUT_MS = 60_000;
|
|
18
|
+
const DEFAULT_DEPENDENCIES = Object.freeze({
|
|
19
|
+
open: openDomainRegistry,
|
|
20
|
+
verify: async (release, signal) => {
|
|
21
|
+
await verifyRelease(release, { signal });
|
|
22
|
+
},
|
|
23
|
+
pushed: commitPushed,
|
|
24
|
+
stdout: (text) => void process.stdout.write(text),
|
|
25
|
+
stderr: (text) => void process.stderr.write(text),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* `astrale-domain publish <environment> [--allow-dirty] [--as <identity>] [--json]`: give the
|
|
29
|
+
* release this tree deploys in one Environment the version `package.json` declares (tech
|
|
30
|
+
* Versioning [.73345], Registry [.122137]). It deploys bottom-up and names last: the Publication
|
|
31
|
+
* Admin creates under the Domain's lock is the only switch, so every failure before it leaves at
|
|
32
|
+
* most a deployment without a version, which a rerun reuses (Registry [.122407]).
|
|
33
|
+
*
|
|
34
|
+
* 0. Before any effect: provenance (a dirty tree or no git is refused unless `--allow-dirty`; the
|
|
35
|
+
* commit is recorded; an unpushed commit warns), then the plan of the deployment: build,
|
|
36
|
+
* configure, placement, label, URL and the sealed release digest.
|
|
37
|
+
* 1. Read the version from `package.json`.
|
|
38
|
+
* 2. Read the registry. The version exists: the same release succeeds without effect, another is
|
|
39
|
+
* refused. A Domain absent or unreadable, or a registry that does not answer, is refused.
|
|
40
|
+
* 3. Judge the version against the highest stable version below it (AM-23); refuse a version
|
|
41
|
+
* that is too low.
|
|
42
|
+
* 4. Deploy the release, or reuse its deployment.
|
|
43
|
+
* 5. Verify that the deployment serves the sealed release.
|
|
44
|
+
* 6. Ask Admin for the Publication; a version Admin gave another release meanwhile is refused,
|
|
45
|
+
* naming the winner's release, and this deployment stays a preview. Any other failure says
|
|
46
|
+
* what CT29 says of it: Admin may have created the Publication (a rerun settles it), Admin made
|
|
47
|
+
* none and a rerun can help, or Admin refused and a rerun meets the same refusal. Then, where
|
|
48
|
+
* the host has no registry principal to keep it (the platform namespace), `adapter.retain`
|
|
49
|
+
* keeps the published deployment (CT36). Admin keeps no mark on its Services' deployments:
|
|
50
|
+
* Services keeps every deployment until it is retired.
|
|
51
|
+
*
|
|
52
|
+
* Steps 0 to 3 make no deploy call. Never installs.
|
|
53
|
+
*/
|
|
54
|
+
export async function runPublish(input, dependencies = DEFAULT_DEPENDENCIES) {
|
|
55
|
+
const { build, environment, signal } = input;
|
|
56
|
+
const root = build.schema.compiled.root;
|
|
57
|
+
const origin = root.origin;
|
|
58
|
+
const progress = (line) => (input.json ? dependencies.stderr : dependencies.stdout)(`${DIM}›${RESET} ${line}\n`);
|
|
59
|
+
const warn = (...lines) => dependencies.stderr(`${YELLOW}!${RESET} ${lines.join('\n ')}\n`);
|
|
60
|
+
const refuse = (...lines) => {
|
|
61
|
+
dependencies.stderr(`${RED}✗${RESET} ${lines.join('\n ')}\n`);
|
|
62
|
+
return 1;
|
|
63
|
+
};
|
|
64
|
+
const identity = input.identity === undefined ? {} : { identity: input.identity };
|
|
65
|
+
// 0. Provenance, read before anything is built ([.73872], AM-25).
|
|
66
|
+
const commit = await runtimeCommit(input.projectDir, input.runtime, signal);
|
|
67
|
+
if (commit === null) {
|
|
68
|
+
if (!input.allowDirty) {
|
|
69
|
+
return refuse(`${origin} is not in a git repository: a Publication records the commit it was built from.`, 'Publish from a commit, or pass --allow-dirty to publish without one.');
|
|
70
|
+
}
|
|
71
|
+
warn('Publishing without a commit (--allow-dirty): the Publication is marked dirty.');
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (commit.dirty) {
|
|
75
|
+
if (!input.allowDirty) {
|
|
76
|
+
return refuse(`The working tree has changes that commit ${commit.sha.slice(0, 7)} does not hold.`, 'Commit them, or pass --allow-dirty to publish a build the commit does not reproduce.');
|
|
77
|
+
}
|
|
78
|
+
warn(`Publishing a dirty tree (--allow-dirty): the Publication is marked dirty.`);
|
|
79
|
+
}
|
|
80
|
+
if ((await dependencies.pushed({ projectDir: input.projectDir, sha: commit.sha, signal })) ===
|
|
81
|
+
false) {
|
|
82
|
+
warn(`Commit ${commit.sha.slice(0, 7)} is on no remote branch. Push it: release-please ` +
|
|
83
|
+
'computes the next version from the pushed history, and could compute this one again.');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// 0. The deployment this publish would make, planned without any effect.
|
|
87
|
+
const plan = await planImmutableDeployment({
|
|
88
|
+
projectDir: input.projectDir,
|
|
89
|
+
environment,
|
|
90
|
+
adapter: input.adapter,
|
|
91
|
+
parameters: input.parameters,
|
|
92
|
+
build,
|
|
93
|
+
runtime: input.runtime,
|
|
94
|
+
...identity,
|
|
95
|
+
commit,
|
|
96
|
+
signal,
|
|
97
|
+
});
|
|
98
|
+
const { release } = plan;
|
|
99
|
+
const releaseDigest = release.document.digest;
|
|
100
|
+
// 1. The version the author declares.
|
|
101
|
+
const declared = await declaredVersion(input.projectDir);
|
|
102
|
+
const name = `${origin}@${declared}`;
|
|
103
|
+
// 2. The registry: the version once written never changes; Admin down publishes nothing.
|
|
104
|
+
let registry;
|
|
105
|
+
let index;
|
|
106
|
+
try {
|
|
107
|
+
registry = await dependencies.open({ projectDir: input.projectDir, ...identity, signal });
|
|
108
|
+
index = await registry.index(origin);
|
|
109
|
+
}
|
|
110
|
+
catch (cause) {
|
|
111
|
+
if (!(cause instanceof RegistryCliError))
|
|
112
|
+
throw cause;
|
|
113
|
+
return refuse(`Domain registry: ${cause.code}: ${cause.message}`, 'Nothing was deployed or published.');
|
|
114
|
+
}
|
|
115
|
+
if (index === undefined) {
|
|
116
|
+
return refuse(`${origin} is not in the Domain registry, or you may not read it: nothing was deployed.`, 'An administrator of the Admin instance registers the Domain and names who may publish it.');
|
|
117
|
+
}
|
|
118
|
+
const existing = index.publications.find(({ version }) => version === declared);
|
|
119
|
+
if (existing !== undefined) {
|
|
120
|
+
if (existing.releaseDigest !== releaseDigest) {
|
|
121
|
+
return refuse(`${name} is already published with release ${existing.releaseDigest}, and this tree ` +
|
|
122
|
+
`deploys release ${releaseDigest} in ${environment}.`, 'A published version never changes: declare a higher version in package.json. Nothing was deployed.');
|
|
123
|
+
}
|
|
124
|
+
progress(`${name} already names this release: nothing to deploy or publish.`);
|
|
125
|
+
if (existing.yanked) {
|
|
126
|
+
warn(`${name} is yanked; astrale-domain yank ${declared} --undo makes it resolvable again.`);
|
|
127
|
+
}
|
|
128
|
+
// A rerun after the Publication but before the adapter's `retain` completes that retention.
|
|
129
|
+
const kept = await retain(plan, signal);
|
|
130
|
+
if (kept.state === 'failed')
|
|
131
|
+
return refuse(...notRetained(name, plan, kept.message));
|
|
132
|
+
if (kept.state === 'refused')
|
|
133
|
+
warn(...noLongerKept(name, plan, kept.message));
|
|
134
|
+
return emit(publishReport({
|
|
135
|
+
environment,
|
|
136
|
+
release,
|
|
137
|
+
version: declared,
|
|
138
|
+
status: 'unchanged',
|
|
139
|
+
deployment: 'none',
|
|
140
|
+
commit,
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
// 3. The version must reach the minimum its changes since the version below it require.
|
|
144
|
+
let verdict;
|
|
145
|
+
try {
|
|
146
|
+
verdict = await diffReport({
|
|
147
|
+
origin,
|
|
148
|
+
declared,
|
|
149
|
+
bound: '<',
|
|
150
|
+
revision: root.revision,
|
|
151
|
+
index,
|
|
152
|
+
current: () => bundle.decode(build.schema.bundle.bytes()).root,
|
|
153
|
+
builds: async () => [plan.bundle.digest],
|
|
154
|
+
published: async (publication) => publishedSchema(await registry.bundle(origin, publication), publication, origin),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (cause) {
|
|
158
|
+
if (!(cause instanceof RegistryCliError))
|
|
159
|
+
throw cause;
|
|
160
|
+
return refuse(`Domain registry: ${cause.code}: ${cause.message}`, 'Nothing was deployed or published.');
|
|
161
|
+
}
|
|
162
|
+
if (!verdict.accepted) {
|
|
163
|
+
dependencies.stderr(`${renderDiff(verdict).refusal.join('\n')}\n`);
|
|
164
|
+
return 1;
|
|
165
|
+
}
|
|
166
|
+
// 4. Deploy the release, or reuse its deployment.
|
|
167
|
+
const deployed = await deployPlannedRelease(plan, { signal, report: progress });
|
|
168
|
+
if (deployed === undefined)
|
|
169
|
+
return refuse(`Nothing was published: rerun publish once the deployment succeeds.`);
|
|
170
|
+
const deployment = deployed.deployment.state === 'created' ? 'created' : 'reused';
|
|
171
|
+
// 5. The deployment serves exactly the sealed release, within a deadline.
|
|
172
|
+
try {
|
|
173
|
+
await verifyWithin(dependencies, release, signal);
|
|
174
|
+
}
|
|
175
|
+
catch (cause) {
|
|
176
|
+
return refuse(`${release.url} does not serve release ${releaseDigest}: ${message(cause)}`, 'Nothing was published: the deployment stays a preview. Rerun publish, which reuses it.');
|
|
177
|
+
}
|
|
178
|
+
// 6. The Publication, under the Domain's lock in Admin: the only switch.
|
|
179
|
+
let published;
|
|
180
|
+
try {
|
|
181
|
+
published = await registry.publish({
|
|
182
|
+
origin,
|
|
183
|
+
version: declared,
|
|
184
|
+
url: release.url,
|
|
185
|
+
releaseDigest,
|
|
186
|
+
...(commit === null ? {} : { commit: commit.sha }),
|
|
187
|
+
dirty: commit === null || commit.dirty,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
catch (cause) {
|
|
191
|
+
if (cause instanceof RegistryCliError && cause.code === 'PUBLICATION_VERSION_CONFLICT') {
|
|
192
|
+
return refuse(`${name} was published meanwhile with release ${winnerDigest(cause) ?? 'unknown'}: a version is written once.`, `This deployment stays a preview at ${release.url}. Declare a higher version to publish it.`);
|
|
193
|
+
}
|
|
194
|
+
return refuse(...notPublished(name, origin, release.url, cause));
|
|
195
|
+
}
|
|
196
|
+
progress(`Published: ${name} · ${published.status}`);
|
|
197
|
+
const kept = await retain(plan, signal);
|
|
198
|
+
if (kept.state === 'failed')
|
|
199
|
+
return refuse(...notRetained(name, plan, kept.message));
|
|
200
|
+
if (kept.state === 'refused')
|
|
201
|
+
warn(...noLongerKept(name, plan, kept.message));
|
|
202
|
+
return emit(publishReport({
|
|
203
|
+
environment,
|
|
204
|
+
release,
|
|
205
|
+
version: declared,
|
|
206
|
+
status: published.status,
|
|
207
|
+
deployment,
|
|
208
|
+
commit,
|
|
209
|
+
}));
|
|
210
|
+
function emit(report) {
|
|
211
|
+
progress(`URL: ${report.url}`);
|
|
212
|
+
if (input.json)
|
|
213
|
+
dependencies.stdout(`${JSON.stringify(report, null, 2)}\n`);
|
|
214
|
+
return 0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/** Step 5 under its deadline: the lifecycle signal still interrupts it first. */
|
|
218
|
+
async function verifyWithin(dependencies, release, signal) {
|
|
219
|
+
const timeoutMs = dependencies.verifyTimeoutMs ?? VERIFY_TIMEOUT_MS;
|
|
220
|
+
const deadline = new AbortController();
|
|
221
|
+
const bound = timeoutMs % 1000 === 0 ? `${timeoutMs / 1000} s` : `${timeoutMs} ms`;
|
|
222
|
+
const timer = setTimeout(() => deadline.abort(new Error(`no answer within ${bound}`)), timeoutMs);
|
|
223
|
+
try {
|
|
224
|
+
await dependencies.verify(release, AbortSignal.any([signal, deadline.signal]));
|
|
225
|
+
}
|
|
226
|
+
catch (cause) {
|
|
227
|
+
if (deadline.signal.aborted && !signal.aborted)
|
|
228
|
+
throw deadline.signal.reason;
|
|
229
|
+
throw cause;
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
clearTimeout(timer);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* What a failed Publication request leaves, as CT29 says it (AM-216 (4)):
|
|
237
|
+
* - `unconfirmed`: Admin may have created it. A change whose delivery is unknown, an answer the
|
|
238
|
+
* Astrale CLI or the SDK could not read, or a command that did not finish (launch failure,
|
|
239
|
+
* time or output bound, interruption). Only a rerun tells, and it is safe: publish is
|
|
240
|
+
* idempotent and the rerun reuses the deployment.
|
|
241
|
+
* - `retryable`: Admin made none, and CT29 says a rerun can help (`details.retryable`).
|
|
242
|
+
* - `refused`: Admin made none, and the same request meets the same answer until its cause is
|
|
243
|
+
* fixed (a missing right, a release Admin will not name, a CLI error before Admin).
|
|
244
|
+
*/
|
|
245
|
+
function notPublished(name, origin, url, cause) {
|
|
246
|
+
if (!(cause instanceof RegistryCliError) || unconfirmed(cause)) {
|
|
247
|
+
return [
|
|
248
|
+
`Admin did not confirm the Publication of ${name} (${described(cause)}); it may have been created.`,
|
|
249
|
+
`Rerun publish: it reuses the deployment at ${url} and publishes nothing twice.`,
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
if (cause.details?.retryable === true) {
|
|
253
|
+
return [
|
|
254
|
+
`Admin made no Publication of ${name}: ${described(cause)}`,
|
|
255
|
+
`Rerun publish: it reuses the deployment at ${url}.`,
|
|
256
|
+
];
|
|
257
|
+
}
|
|
258
|
+
return [
|
|
259
|
+
`Admin refused the Publication of ${name}: ${described(cause)}`,
|
|
260
|
+
`Nothing was published: the deployment stays a preview at ${url}. A rerun meets the same ` +
|
|
261
|
+
`refusal until ${remedy(cause, origin)}.`,
|
|
262
|
+
];
|
|
263
|
+
}
|
|
264
|
+
/** CT29: a change may have applied, or the answer could not be read. */
|
|
265
|
+
function unconfirmed(error) {
|
|
266
|
+
const reason = error.details?.reason;
|
|
267
|
+
return (error.details?.delivery === 'unknown' ||
|
|
268
|
+
error.code === 'REGISTRY_CLI_FAILED' ||
|
|
269
|
+
error.code === 'REGISTRY_CLI_PROTOCOL' ||
|
|
270
|
+
(error.code === 'REGISTRY_UNAVAILABLE' &&
|
|
271
|
+
(reason === 'response-invalid' || reason === 'client')));
|
|
272
|
+
}
|
|
273
|
+
/** What has to change before the same Publication request can succeed. */
|
|
274
|
+
function remedy(error, origin) {
|
|
275
|
+
const reason = typeof error.details?.reason === 'string' ? ` (${error.details.reason})` : '';
|
|
276
|
+
switch (error.code) {
|
|
277
|
+
case 'REGISTRY_FORBIDDEN':
|
|
278
|
+
return error.details?.status === 2004
|
|
279
|
+
? `this identity holds domain_admin on ${origin} in the Domain registry, which an administrator of the Domain grants`
|
|
280
|
+
: 'Admin accepts the credential of this identity';
|
|
281
|
+
case 'REGISTRY_DOMAIN_NOT_FOUND':
|
|
282
|
+
return `${origin} is in the Domain registry and this identity may read it`;
|
|
283
|
+
case 'PUBLICATION_RELEASE_MISMATCH':
|
|
284
|
+
return `the deployment serves a release Admin names for ${origin}${reason}`;
|
|
285
|
+
case 'PUBLICATION_RELEASE_UNREACHABLE':
|
|
286
|
+
return `Admin reads the release at the deployment, which this run verified${reason}`;
|
|
287
|
+
case 'PUBLICATION_VERSION_INVALID':
|
|
288
|
+
return 'package.json declares a version Admin admits';
|
|
289
|
+
default:
|
|
290
|
+
return 'its cause is fixed';
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
function described(cause) {
|
|
294
|
+
return cause instanceof RegistryCliError ? `${cause.code}: ${cause.message}` : message(cause);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Keep the published deployment where its host has no registry principal to mark it: the adapter
|
|
298
|
+
* declares `retain` for the platform namespace only (CT36). Admin's Services keeps every
|
|
299
|
+
* deployment until it is retired, so adapter-astrale declares none. A `RetainRefusal` (absent or
|
|
300
|
+
* retired) is `refused`, which no rerun changes; any other rejection `failed`, which a rerun
|
|
301
|
+
* retries.
|
|
302
|
+
*/
|
|
303
|
+
async function retain(plan, signal) {
|
|
304
|
+
const { adapter } = plan;
|
|
305
|
+
if (adapter.retain === undefined)
|
|
306
|
+
return { state: 'kept' };
|
|
307
|
+
try {
|
|
308
|
+
await adapter.retain(plan.parameters, {
|
|
309
|
+
label: plan.label,
|
|
310
|
+
signal,
|
|
311
|
+
...(plan.identity === undefined ? {} : { identity: plan.identity }),
|
|
312
|
+
});
|
|
313
|
+
return { state: 'kept' };
|
|
314
|
+
}
|
|
315
|
+
catch (cause) {
|
|
316
|
+
return { state: cause instanceof RetainRefusal ? 'refused' : 'failed', message: message(cause) };
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
function notRetained(name, plan, cause) {
|
|
320
|
+
return [
|
|
321
|
+
`${name} is published, but its deployment ${plan.label} is not kept yet: ${cause}`,
|
|
322
|
+
'Rerun publish: it publishes nothing again and keeps the deployment.',
|
|
323
|
+
];
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* The version names a deployment its host can no longer keep (absent or retired): publishing has
|
|
327
|
+
* nothing left to do, a rerun cannot keep it, and installing the version fails, never silently.
|
|
328
|
+
*/
|
|
329
|
+
function noLongerKept(name, plan, cause) {
|
|
330
|
+
return [
|
|
331
|
+
`${name} names deployment ${plan.label}, which its host can no longer keep: ${cause}`,
|
|
332
|
+
'No rerun keeps it, and installing the version fails; declare a higher version to publish ' +
|
|
333
|
+
'a new deployment.',
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
/** The release digest of the Publication that won the version, from the CT29 conflict details. */
|
|
337
|
+
function winnerDigest(error) {
|
|
338
|
+
const existing = error.details?.existing;
|
|
339
|
+
const digest = typeof existing === 'object' && existing !== null
|
|
340
|
+
? existing.releaseDigest
|
|
341
|
+
: undefined;
|
|
342
|
+
return typeof digest === 'string' && /^sha256:[0-9a-f]{64}$/u.test(digest) ? digest : undefined;
|
|
343
|
+
}
|
|
344
|
+
function message(cause) {
|
|
345
|
+
return cause instanceof Error ? cause.message : String(cause);
|
|
346
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReleaseDigest } from '@astrale-os/kernel-protocol/release';
|
|
2
|
+
import type { DeploymentCommitV1 } from '../../../deployment/address/index.js';
|
|
3
|
+
import type { BuildDigest, Release } from '../../../deployment/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* `astrale-domain publish <environment> --json` on stdout (CT30): the version `package.json`
|
|
6
|
+
* declares, the Publication that now names it, and the immutable deployment whose release it
|
|
7
|
+
* names. Progress and warnings go to stderr. A publish installs nothing.
|
|
8
|
+
*/
|
|
9
|
+
export interface PublishReportV1 {
|
|
10
|
+
readonly format: 'astrale.publish-report';
|
|
11
|
+
readonly version: 1;
|
|
12
|
+
readonly origin: string;
|
|
13
|
+
readonly environment: string;
|
|
14
|
+
readonly publication: {
|
|
15
|
+
/** `package.json` `version`. */
|
|
16
|
+
readonly version: string;
|
|
17
|
+
/**
|
|
18
|
+
* `created` by this publish, or `unchanged`: the version already named this exact release,
|
|
19
|
+
* by an earlier run or a concurrent identical one.
|
|
20
|
+
*/
|
|
21
|
+
readonly status: 'created' | 'unchanged';
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* What this publish did to the deployment: `created` or `reused` it before asking for the
|
|
25
|
+
* Publication, or `none` when the version already named this release and nothing was deployed.
|
|
26
|
+
*/
|
|
27
|
+
readonly deployment: 'created' | 'reused' | 'none';
|
|
28
|
+
/** The deployment URL the Publication names, which `astrale domain install` takes. */
|
|
29
|
+
readonly url: string;
|
|
30
|
+
readonly releaseDigest: ReleaseDigest;
|
|
31
|
+
readonly buildDigest: BuildDigest;
|
|
32
|
+
/**
|
|
33
|
+
* The commit this run published from, as step 0 read it (`sha`, `dirty`, and `base` when a
|
|
34
|
+
* release tag precedes it), or `null` outside git (`--allow-dirty`). A Publication this run
|
|
35
|
+
* `created` records its `sha` and `dirty`. On `unchanged` the Publication may record another
|
|
36
|
+
* commit of the same release (an earlier run, or a concurrent identical publish), and a reused
|
|
37
|
+
* deployment's own record may name an earlier commit of the same build: `astrale domain
|
|
38
|
+
* versions` lists what the Publication records.
|
|
39
|
+
*/
|
|
40
|
+
readonly commit: DeploymentCommitV1 | null;
|
|
41
|
+
}
|
|
42
|
+
export declare function publishReport(input: {
|
|
43
|
+
readonly environment: string;
|
|
44
|
+
readonly release: Release;
|
|
45
|
+
readonly version: string;
|
|
46
|
+
readonly status: 'created' | 'unchanged';
|
|
47
|
+
readonly deployment: 'created' | 'reused' | 'none';
|
|
48
|
+
readonly commit: DeploymentCommitV1 | null;
|
|
49
|
+
}): PublishReportV1;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function publishReport(input) {
|
|
2
|
+
const { release } = input;
|
|
3
|
+
return Object.freeze({
|
|
4
|
+
format: 'astrale.publish-report',
|
|
5
|
+
version: 1,
|
|
6
|
+
origin: release.document.origin,
|
|
7
|
+
environment: input.environment,
|
|
8
|
+
publication: Object.freeze({ version: input.version, status: input.status }),
|
|
9
|
+
deployment: input.deployment,
|
|
10
|
+
url: release.url,
|
|
11
|
+
releaseDigest: release.document.digest,
|
|
12
|
+
buildDigest: release.buildDigest,
|
|
13
|
+
commit: input.commit,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Version } from '../../../platform/versioning/index.js';
|
|
2
|
+
import type { RegistryExecutableDependencies } from './executable.js';
|
|
3
|
+
import type { InstanceListing } from './installations.js';
|
|
4
|
+
import type { RegistryProcessInput, RegistryProcessResult } from './process.js';
|
|
5
|
+
export { RegistryCliError } from './error.js';
|
|
6
|
+
/** A `sha256:` digest as the registry stores it. */
|
|
7
|
+
export type RegistryDigest = `sha256:${string}`;
|
|
8
|
+
/**
|
|
9
|
+
* The Schema Bundle a Publication's deployment serves, as the Astrale CLI admitted it: Admin keeps
|
|
10
|
+
* no bundle, so the CLI reads it from the deployment's `release.json`, admitted with the
|
|
11
|
+
* Publication's release digest.
|
|
12
|
+
*/
|
|
13
|
+
export interface RegistryBundle {
|
|
14
|
+
readonly digest: RegistryDigest;
|
|
15
|
+
readonly mediaType: string;
|
|
16
|
+
readonly size: number;
|
|
17
|
+
}
|
|
18
|
+
/** The fields of one CT29 `PublicationSummaryV1` that version checks read. */
|
|
19
|
+
export interface RegistryPublication {
|
|
20
|
+
readonly version: string;
|
|
21
|
+
readonly yanked: boolean;
|
|
22
|
+
readonly releaseDigest: RegistryDigest;
|
|
23
|
+
readonly buildDigest: RegistryDigest;
|
|
24
|
+
readonly schemaRevision: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The Publication `publish` asks Admin to create (CT29 `PublishRequestV1`): a version for the
|
|
28
|
+
* release one deployment serves at its URL. The client never sends the bundle or its
|
|
29
|
+
* dependencies; Admin re-reads the release at `url` (tech Registry [.119544]).
|
|
30
|
+
*/
|
|
31
|
+
export interface RegistryPublishRequest {
|
|
32
|
+
readonly origin: string;
|
|
33
|
+
readonly version: string;
|
|
34
|
+
/** The deployment URL, which is also the issuer of the release it serves. */
|
|
35
|
+
readonly url: string;
|
|
36
|
+
readonly releaseDigest: RegistryDigest;
|
|
37
|
+
/** The commit the release was built from; absent outside git (`--allow-dirty`). */
|
|
38
|
+
readonly commit?: string;
|
|
39
|
+
/** The working tree held changes the commit does not, or no commit could be read. */
|
|
40
|
+
readonly dirty: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* What `astrale __domain-registry publish --json` answered (CT29 `PublishResultV1`): `created` by
|
|
44
|
+
* this call, or `unchanged` when the version already named this release.
|
|
45
|
+
*/
|
|
46
|
+
export interface RegistryPublishResult {
|
|
47
|
+
readonly status: 'created' | 'unchanged';
|
|
48
|
+
readonly publication: RegistryPublication & {
|
|
49
|
+
readonly url: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Every Publication of one Domain the caller may read, as `astrale domain versions` lists it. */
|
|
53
|
+
export interface RegistryIndex {
|
|
54
|
+
readonly origin: string;
|
|
55
|
+
readonly publications: readonly RegistryPublication[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* What `astrale __domain-registry yank <origin>@<version> [--undo] --json` answered (CT29
|
|
59
|
+
* `YankResultV1`): whether this call changed the yank state, and the state Admin now holds. The
|
|
60
|
+
* other `PublicationSummaryV1` fields are not read.
|
|
61
|
+
*/
|
|
62
|
+
export interface RegistryYank {
|
|
63
|
+
readonly status: 'changed' | 'unchanged';
|
|
64
|
+
readonly publication: {
|
|
65
|
+
readonly version: Version;
|
|
66
|
+
readonly yanked: boolean;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** The Admin registry, read and changed through the Astrale CLI with the caller's own credential. */
|
|
70
|
+
export interface DomainRegistry {
|
|
71
|
+
/** The Domain's index, or `undefined` when it is absent or not readable by the caller. */
|
|
72
|
+
index(origin: string): Promise<RegistryIndex | undefined>;
|
|
73
|
+
/** The bundle bytes of one Publication of the index, digest and Schema identity verified. */
|
|
74
|
+
bundle(origin: string, publication: RegistryPublication): Promise<Uint8Array>;
|
|
75
|
+
/**
|
|
76
|
+
* Ask Admin to name one deployed release with a version. Admin decides under the Domain's lock:
|
|
77
|
+
* an absent version is created, the same release digest answers `unchanged`, another is refused
|
|
78
|
+
* (`PUBLICATION_VERSION_CONFLICT`). Idempotent, so a rerun after a lost answer is safe.
|
|
79
|
+
*/
|
|
80
|
+
publish(request: RegistryPublishRequest): Promise<RegistryPublishResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Yank one published version, or restore it with `undo`. Idempotent: a version already in the
|
|
83
|
+
* requested state answers `unchanged`, so a rerun after a lost answer is safe.
|
|
84
|
+
*/
|
|
85
|
+
yank(origin: string, version: Version, options: {
|
|
86
|
+
readonly undo: boolean;
|
|
87
|
+
}): Promise<RegistryYank>;
|
|
88
|
+
/**
|
|
89
|
+
* What one instance the CLI knows by that name runs, as its Kernel lists it for the caller
|
|
90
|
+
* (`astrale domain list -i <instance> --json`, CT24), or why that is unknown. Never throws for a
|
|
91
|
+
* refusal of that instance: an instance that cannot tell is a partial answer (AM-198).
|
|
92
|
+
*/
|
|
93
|
+
instance(name: string): Promise<InstanceListing>;
|
|
94
|
+
}
|
|
95
|
+
export interface DomainRegistryDependencies {
|
|
96
|
+
readonly resolve: (input: {
|
|
97
|
+
readonly projectDir: string;
|
|
98
|
+
readonly signal: AbortSignal;
|
|
99
|
+
readonly minimum?: string;
|
|
100
|
+
}, dependencies?: RegistryExecutableDependencies) => Promise<string>;
|
|
101
|
+
readonly run: (input: RegistryProcessInput) => Promise<RegistryProcessResult>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Open the Domain registry through one admitted Astrale CLI (CT29 plumbing); the CLI's configured
|
|
105
|
+
* Admin target answers. Reads and publish run under `--as` when the caller names an identity, a
|
|
106
|
+
* yank under the CLI's default identity.
|
|
107
|
+
*/
|
|
108
|
+
export declare function openDomainRegistry(input: {
|
|
109
|
+
readonly projectDir: string;
|
|
110
|
+
readonly identity?: string;
|
|
111
|
+
readonly signal: AbortSignal;
|
|
112
|
+
/** The first CLI release serving every read the command makes (default: the registry). */
|
|
113
|
+
readonly minimum?: string;
|
|
114
|
+
}, dependencies?: DomainRegistryDependencies): Promise<DomainRegistry>;
|