@astrale-os/sdk 0.6.0-beta.3 → 0.6.0-beta.31
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 +181 -58
- 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 +44 -31
- package/dist/application/action/define.d.ts +3 -3
- package/dist/application/action/index.d.ts +1 -1
- package/dist/application/define.d.ts +8 -6
- package/dist/application/define.js +28 -14
- package/dist/application/dependency/index.d.ts +1 -1
- package/dist/application/dependency/invoker.d.ts +14 -9
- package/dist/application/domain.d.ts +30 -0
- package/dist/application/index.d.ts +4 -4
- package/dist/application/index.js +1 -1
- package/dist/application/integration/operation.d.ts +2 -2
- 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/mutation/index.d.ts +1 -1
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- 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 +3 -1
- package/dist/application/runtime/workflows.js +6 -4
- package/dist/application/view/define.js +4 -6
- package/dist/application/view/frontend.d.ts +2 -2
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +0 -14
- package/dist/application/view/route.js +1 -64
- 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 +4 -4
- package/dist/application/workflow/define.js +20 -4
- package/dist/application/workflow/durable.d.ts +87 -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 +13 -3
- package/dist/deployment/adapter/adapter.d.ts +55 -13
- 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 +4 -3
- package/dist/deployment/adapter/define.js +107 -23
- package/dist/deployment/adapter/index.d.ts +4 -3
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/release/command.d.ts +33 -0
- package/dist/deployment/adapter/release/context.d.ts +94 -0
- package/dist/deployment/adapter/release/index.d.ts +4 -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 +95 -0
- package/dist/deployment/address/configuration.js +273 -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 +4 -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 +73 -0
- package/dist/deployment/address/record.js +138 -0
- package/dist/deployment/address/summary.d.ts +30 -0
- package/dist/deployment/address/summary.js +1 -0
- package/dist/deployment/address/vectors.d.ts +60 -0
- package/dist/deployment/address/vectors.js +517 -0
- package/dist/deployment/authoring.d.ts +0 -2
- package/dist/deployment/authoring.js +0 -1
- package/dist/deployment/build/build.d.ts +8 -2
- package/dist/deployment/build/compile.d.ts +4 -4
- package/dist/deployment/build/compile.js +19 -17
- package/dist/deployment/build/frontend/compilation.d.ts +2 -4
- package/dist/deployment/build/frontend/compilation.js +0 -5
- package/dist/deployment/build/frontend/digest.js +1 -5
- 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.d.ts +2 -2
- package/dist/deployment/build/material.js +28 -13
- package/dist/deployment/build/schema.d.ts +2 -2
- package/dist/deployment/deployment.d.ts +3 -2
- package/dist/deployment/environment.d.ts +6 -0
- package/dist/deployment/environment.js +6 -0
- package/dist/deployment/index.d.ts +4 -6
- package/dist/deployment/index.js +1 -2
- package/dist/deployment/release/addressing.d.ts +6 -5
- package/dist/deployment/release/addressing.js +2 -3
- package/dist/deployment/release/assemble.d.ts +6 -3
- package/dist/deployment/release/assemble.js +12 -10
- package/dist/deployment/release/release.d.ts +16 -5
- 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 +11 -0
- package/dist/deployment/release/served/index.js +26 -0
- package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/views.js +0 -1
- package/dist/deployment/runtime/admission.d.ts +2 -2
- package/dist/deployment/runtime/admission.js +5 -5
- package/dist/deployment/verify/index.d.ts +3 -4
- package/dist/deployment/verify/index.js +2 -3
- 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 +1 -12
- package/dist/deployment/verify/preflight/index.js +1 -12
- 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 +15 -8
- package/dist/deployment/verify/readiness/index.js +25 -6
- package/dist/deployment/verify/readiness/release.d.ts +8 -0
- package/dist/deployment/verify/readiness/release.js +22 -0
- package/dist/deployment/worker/address.d.ts +26 -0
- package/dist/deployment/worker/address.js +43 -0
- package/dist/deployment/worker/build.d.ts +60 -0
- package/dist/deployment/worker/build.js +172 -0
- package/dist/deployment/worker/configuration.d.ts +73 -0
- package/dist/deployment/worker/configuration.js +165 -0
- package/dist/deployment/worker/content.d.ts +38 -0
- package/dist/deployment/worker/content.js +169 -0
- package/dist/deployment/worker/index.d.ts +29 -0
- package/dist/deployment/worker/index.js +29 -0
- package/dist/deployment/worker/limits.d.ts +30 -0
- package/dist/deployment/worker/limits.js +30 -0
- package/dist/deployment/worker/record.d.ts +29 -0
- package/dist/deployment/worker/record.js +69 -0
- package/dist/deployment/worker/request.d.ts +118 -0
- package/dist/deployment/worker/request.js +280 -0
- package/dist/deployment/worker/response.d.ts +101 -0
- package/dist/deployment/worker/response.js +207 -0
- package/dist/execution/identity/authentication.d.ts +33 -3
- package/dist/execution/identity/authentication.js +85 -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 +6 -4
- package/dist/execution/identity/delivery.js +25 -20
- package/dist/execution/identity/identity.d.ts +17 -3
- package/dist/execution/identity/identity.js +12 -4
- package/dist/execution/identity/jwks.d.ts +5 -0
- package/dist/execution/identity/jwks.js +92 -102
- package/dist/execution/index.d.ts +4 -4
- package/dist/execution/index.js +2 -2
- package/dist/execution/invocation/admission/authentication.d.ts +11 -13
- package/dist/execution/invocation/admission/authentication.js +48 -44
- package/dist/execution/invocation/admission/authority.d.ts +28 -6
- package/dist/execution/invocation/admission/authority.js +9 -2
- package/dist/execution/invocation/admission/index.d.ts +2 -2
- package/dist/execution/invocation/admission/index.js +1 -1
- 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 +3 -1
- package/dist/execution/invocation/dependency/bind.js +36 -16
- package/dist/execution/invocation/dispatch/context.d.ts +7 -6
- package/dist/execution/invocation/dispatch/context.js +17 -31
- package/dist/execution/invocation/dispatch/workflow.js +0 -4
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/integration/call.d.ts +2 -1
- package/dist/execution/invocation/integration/call.js +1 -1
- package/dist/execution/invocation/integration/clients.d.ts +1 -1
- package/dist/execution/invocation/invocation.js +49 -16
- package/dist/execution/invocation/result/errors.d.ts +0 -10
- package/dist/execution/invocation/result/errors.js +0 -17
- package/dist/execution/invocation/result/index.d.ts +2 -2
- package/dist/execution/invocation/result/index.js +1 -1
- 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 +17 -0
- package/dist/execution/runtime/release.js +7 -0
- package/dist/execution/serve.d.ts +10 -4
- package/dist/execution/serve.js +3 -0
- package/dist/execution/service/create.js +41 -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 +14 -5
- package/dist/execution/service/serving/delivery.d.ts +5 -0
- package/dist/execution/service/{publication → serving}/delivery.js +4 -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/source.d.ts +11 -0
- package/dist/execution/service/serving/source.js +15 -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 +34 -0
- package/dist/execution/workflows/options.js +65 -0
- package/dist/execution/workflows/receiver.d.ts +21 -0
- package/dist/execution/workflows/receiver.js +92 -0
- package/dist/execution/workflows/route.d.ts +12 -0
- package/dist/execution/workflows/route.js +35 -0
- package/dist/execution/workflows/run.d.ts +22 -0
- package/dist/execution/workflows/run.js +223 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/platform/graph/alias.d.ts +1 -5
- package/dist/platform/graph/alias.js +1 -5
- package/dist/platform/graph/document/index.d.ts +1 -1
- package/dist/platform/graph/document/index.js +1 -1
- package/dist/platform/graph/index.d.ts +1 -1
- package/dist/platform/graph/index.js +1 -1
- package/dist/platform/release/index.d.ts +2 -0
- package/dist/platform/release/index.js +2 -0
- package/dist/platform/schema/callable-authoring.d.ts +21 -0
- package/dist/platform/schema/callable-authoring.js +27 -0
- package/dist/platform/schema/class-authoring.d.ts +61 -11
- package/dist/platform/schema/class-authoring.js +37 -4
- package/dist/platform/schema/class-icon-svg.d.ts +9 -0
- package/dist/platform/schema/class-icon-svg.js +29 -0
- package/dist/platform/schema/class-icon.d.ts +3 -8
- package/dist/platform/schema/class-icon.js +2 -29
- package/dist/platform/schema/index.d.ts +6 -4
- package/dist/platform/schema/index.js +2 -1
- package/dist/platform/schema/property.d.ts +5 -0
- package/dist/platform/schema/schema-authoring.d.ts +14 -7
- package/dist/platform/schema/schema-authoring.js +5 -1
- 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 +1 -5
- 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 +6 -0
- package/dist/project/install-command.js +9 -0
- package/dist/project/project.d.ts +10 -8
- package/dist/testing/dataset/define.d.ts +1 -1
- package/dist/testing/load.js +1 -1
- package/dist/tooling/cli/adapter-command.d.ts +35 -0
- package/dist/tooling/cli/adapter-command.js +66 -0
- package/dist/tooling/cli/arguments.d.ts +17 -6
- package/dist/tooling/cli/arguments.js +175 -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 +26 -0
- package/dist/tooling/cli/deploy-mode.js +59 -0
- package/dist/tooling/cli/deploy-result.d.ts +80 -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 +173 -60
- 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 +12 -4
- package/dist/tooling/cli/index.js +6 -3
- package/dist/tooling/cli/installed-on.d.ts +83 -0
- package/dist/tooling/cli/installed-on.js +156 -0
- package/dist/tooling/cli/list.d.ts +152 -0
- package/dist/tooling/cli/list.js +331 -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 +246 -90
- package/dist/tooling/cli/project.d.ts +3 -3
- package/dist/tooling/cli/publish/index.d.ts +81 -0
- package/dist/tooling/cli/publish/index.js +383 -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 +121 -0
- package/dist/tooling/cli/registry/client.js +354 -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 +35 -0
- package/dist/tooling/cli/registry/executable.js +96 -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 -2
- 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/verifiers.js +0 -2
- package/dist/tooling/linter/implementations/source/views.js +2 -2
- package/dist/tooling/linter/policy/generated.js +14 -63
- package/dist/tooling/linter/requirements/registry.js +1 -6
- 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 +39 -13
- package/dist/application/application.d.ts +0 -28
- package/dist/application/query/execution/projection.d.ts +0 -3
- package/dist/application/query/execution/projection.js +0 -3
- package/dist/deployment/adapter/deploy/context.d.ts +0 -15
- 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/deploy.d.ts +0 -20
- package/dist/deployment/deploy.js +0 -31
- 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.d.ts +0 -10
- package/dist/deployment/release/publication/seal.js +0 -39
- package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
- package/dist/deployment/verify/preflight/artifact.js +0 -122
- package/dist/deployment/verify/preflight/publication.d.ts +0 -4
- package/dist/deployment/verify/preflight/publication.js +0 -14
- package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
- package/dist/deployment/verify/readiness/deployment.js +0 -151
- package/dist/deployment/verify/readiness/publication.d.ts +0 -11
- package/dist/deployment/verify/readiness/publication.js +0 -41
- package/dist/execution/service/errors.d.ts +0 -3
- package/dist/execution/service/errors.js +0 -3
- 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/deprecations.d.ts +0 -9
- package/dist/tooling/cli/deprecations.js +0 -15
- 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/tooling/linter/implementations/source/migrations.d.ts +0 -2
- package/dist/tooling/linter/implementations/source/migrations.js +0 -113
- package/dist/tooling/linter/qualification/index.d.ts +0 -10
- package/dist/tooling/linter/qualification/index.js +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
- package/dist/tooling/linter/qualification/runner.d.ts +0 -3
- package/dist/tooling/linter/qualification/runner.js +0 -6
- /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 → release/command.js} +0 -0
- /package/dist/deployment/adapter/{prepare → release}/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/execution/service/{publication → serving}/index.js +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { DeploymentCommitV1, DeploymentConfiguration, LineAddressing } from '../../address/index.js';
|
|
2
|
+
import type { Release } from '../../release/index.js';
|
|
3
|
+
import type { Bundle } from '../bundle/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* What `configure` receives: the Environment whose configuration it freezes, and the names of the
|
|
6
|
+
* secrets its deployment binds. Never a secret value: a rotated value is not another configuration,
|
|
7
|
+
* a name added or removed is.
|
|
8
|
+
*/
|
|
9
|
+
export interface ConfigureContext {
|
|
10
|
+
readonly environment: string;
|
|
11
|
+
/**
|
|
12
|
+
* The names of the Environment's current secrets (the adapter's `secretsFile`), sorted and
|
|
13
|
+
* unique: exactly the secrets `deployRelease` receives, which the configuration declares.
|
|
14
|
+
*/
|
|
15
|
+
readonly secrets: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Where the host places the deployments of one Environment. `routingDomain` is the DNS name every
|
|
19
|
+
* deployment URL ends with, `https://<label>.<routingDomain>`; `addressing` is how its line reads:
|
|
20
|
+
* `readable` for platform lines, `opaque` (the fingerprint alone) for tenant lines.
|
|
21
|
+
*/
|
|
22
|
+
export interface Placement {
|
|
23
|
+
readonly addressing: LineAddressing;
|
|
24
|
+
readonly routingDomain: string;
|
|
25
|
+
}
|
|
26
|
+
/** What `placement` receives. It answers without any effect at the host. */
|
|
27
|
+
export interface PlacementContext {
|
|
28
|
+
readonly environment: string;
|
|
29
|
+
/** Parent-owned lifecycle cancellation. */
|
|
30
|
+
readonly signal: AbortSignal;
|
|
31
|
+
/** Optional command-scoped identity override (`--as`). */
|
|
32
|
+
readonly identity?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Everything `deployRelease` deploys: one sealed release as one immutable deployment at
|
|
36
|
+
* `release.url`, which is `deploymentUrl(label, placement.routingDomain)` and the release's issuer.
|
|
37
|
+
* The SDK computes each value before the call, from the Build, `configure` and `placement`, so the
|
|
38
|
+
* adapter never derives an address or seals anything itself.
|
|
39
|
+
*/
|
|
40
|
+
export interface ReleaseDeployContext {
|
|
41
|
+
readonly projectDir: string;
|
|
42
|
+
readonly environment: string;
|
|
43
|
+
/** Optional command-scoped identity override (`--as`). */
|
|
44
|
+
readonly identity?: string;
|
|
45
|
+
/** Optional command-scoped credential; trusted adapters must neither retain nor disclose it. */
|
|
46
|
+
readonly credential?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The Environment's current secrets. A new deployment binds them; a reused deployment has its
|
|
49
|
+
* own declared secrets rewritten in place. A deploy never writes another deployment's secrets.
|
|
50
|
+
*/
|
|
51
|
+
readonly secrets: Readonly<Record<string, string>>;
|
|
52
|
+
/** The environment-free bytes of the adapter's `bundler`, identified by `bundle.digest`. */
|
|
53
|
+
readonly bundle: Bundle;
|
|
54
|
+
/** What `configure` froze for this Environment. */
|
|
55
|
+
readonly configuration: DeploymentConfiguration;
|
|
56
|
+
/** Where `placement` said the host places the deployment. */
|
|
57
|
+
readonly placement: Placement;
|
|
58
|
+
/**
|
|
59
|
+
* `<line>-<content>`: the DNS label of the deployment, which is also its provider script. Its
|
|
60
|
+
* content covers `bundle.digest` and `configuration`, so one label serves one release.
|
|
61
|
+
*/
|
|
62
|
+
readonly label: string;
|
|
63
|
+
/**
|
|
64
|
+
* The release the SDK sealed for this deployment before the call: its `document` is the
|
|
65
|
+
* `DomainRelease` v4 the deployment serves at `release.json`, its `url` the deployment URL.
|
|
66
|
+
*/
|
|
67
|
+
readonly release: Release;
|
|
68
|
+
/**
|
|
69
|
+
* The commit this deploy runs from, which the record of a deployment it creates declares. The
|
|
70
|
+
* label does not cover it: a reused deployment keeps the record, and so the commit, of the deploy
|
|
71
|
+
* that created it, and an adapter never refuses a reuse for another commit.
|
|
72
|
+
*/
|
|
73
|
+
readonly commit: DeploymentCommitV1 | null;
|
|
74
|
+
/** Parent-owned lifecycle cancellation shared by every provider effect. */
|
|
75
|
+
readonly signal: AbortSignal;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* What `list` receives: the origin and the Environment whose deployments the host lists for the
|
|
79
|
+
* caller. It answers without any effect at the host.
|
|
80
|
+
*/
|
|
81
|
+
export interface ListContext {
|
|
82
|
+
readonly origin: string;
|
|
83
|
+
readonly environment: string;
|
|
84
|
+
/** Parent-owned lifecycle cancellation. */
|
|
85
|
+
readonly signal: AbortSignal;
|
|
86
|
+
/** Optional command-scoped identity override (`--as`). */
|
|
87
|
+
readonly identity?: string;
|
|
88
|
+
}
|
|
89
|
+
/** What `retain` receives: the label of the published deployment to keep. */
|
|
90
|
+
export interface RetainContext {
|
|
91
|
+
readonly label: string;
|
|
92
|
+
readonly signal: AbortSignal;
|
|
93
|
+
readonly identity?: string;
|
|
94
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ConfigureContext, ListContext, Placement, PlacementContext, ReleaseDeployContext, RetainContext, } from './context.js';
|
|
2
|
+
export type { AdapterCommand, AdapterCommandContext, AdapterCommandResult } from './command.js';
|
|
3
|
+
export type { DeploymentCallTarget, ListedDeployment } from './list.js';
|
|
4
|
+
export type { DeploymentSecretsState, FailedReleaseDeployResult, MutationKnowledge, ReadyReleaseDeployResult, ReleaseDeploymentPhase, ReleaseDeployResult, } from './result.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { DeploymentSummaryV1 } from '../../address/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where one listed deployment is called on its host, so that an operator can act on it:
|
|
4
|
+
*
|
|
5
|
+
* - `services`: a deployment Admin's Services hosts, called on the Admin instance with
|
|
6
|
+
* `astrale call "<node>.method.<method>" --admin` (`--admin=<admin>` when `admin` names the
|
|
7
|
+
* Admin bookmark). `path` is the deployment's node, `@<id>`, qualified by its class,
|
|
8
|
+
* `@<id>::services.astrale.ai:class.CloudflareDeployment`, whose only Method is `retire`.
|
|
9
|
+
* `service` is the node of the Service it is a version of,
|
|
10
|
+
* `@<serviceId>::services.astrale.ai:class.CloudflareService`, whose Methods act on the Service
|
|
11
|
+
* and the deployment it currently serves: `promote` (this deployment's label rolls the Service
|
|
12
|
+
* back or forward to it), `setSecret` and `secrets`, `setSchedule` and `schedules`, `logs`,
|
|
13
|
+
* `transfer` and `delete`.
|
|
14
|
+
* - `namespace`: a deployment of a Cloudflare dispatch namespace (adapter-cloudflare's namespace
|
|
15
|
+
* mode), which has no Services node: the namespace and the script, which the hosting kit
|
|
16
|
+
* (`@astrale-os/adapter-cloudflare/hosting`) retires, points a name at or schedules.
|
|
17
|
+
*/
|
|
18
|
+
export type DeploymentCallTarget = {
|
|
19
|
+
readonly kind: 'services';
|
|
20
|
+
readonly path: string;
|
|
21
|
+
readonly service: string;
|
|
22
|
+
/** The Admin bookmark the deployment is reached through; the CLI's own Admin target when absent. */
|
|
23
|
+
readonly admin?: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'namespace';
|
|
26
|
+
readonly namespace: string;
|
|
27
|
+
readonly script: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* One deployment as an adapter's `list` returns it: what its host knows of it, its record as the
|
|
31
|
+
* host stores it, and where it is called. Admin's Services keeps every deployment until it is
|
|
32
|
+
* retired and counts no call: its deployments are `published` and `withdrawn` once retiring. A
|
|
33
|
+
* Cloudflare dispatch namespace keeps no retention: its rows carry none, and carry their creation
|
|
34
|
+
* instant and key only while their script exists. Deployments have no last-call or expiry clock.
|
|
35
|
+
*
|
|
36
|
+
* The adapter does not admit the record. The listing admits it with `acceptDeploymentRecord`, and a
|
|
37
|
+
* record it refuses (one a host on an older SDK still admits, say) never fails the listing: that
|
|
38
|
+
* deployment is listed from the facts its host owns.
|
|
39
|
+
*/
|
|
40
|
+
export interface ListedDeployment extends Omit<DeploymentSummaryV1, 'record'> {
|
|
41
|
+
/**
|
|
42
|
+
* The record as the host stores it, unadmitted, whatever value that is (JSON `null` included).
|
|
43
|
+
* Absent when the host keeps no record of the deployment: a dispatch namespace keeps none for a
|
|
44
|
+
* label it only retired.
|
|
45
|
+
*/
|
|
46
|
+
readonly record?: unknown;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the stable URL of the deployment's Service serves it. Present only where the host has
|
|
49
|
+
* Services (Admin's Services); a dispatch namespace has none.
|
|
50
|
+
*/
|
|
51
|
+
readonly current?: boolean;
|
|
52
|
+
readonly callTarget: DeploymentCallTarget;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why the host can no longer keep one published deployment (`Adapter.retain`): it is `absent`
|
|
3
|
+
* (the host holds no deployment of that label, or it was deleted) or `retired` (withdrawn, never
|
|
4
|
+
* served again). No rerun keeps it; a new version publishes a new deployment. Any other rejection
|
|
5
|
+
* of `retain` is transient: once it has passed, a rerun keeps the deployment.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RetainRefusal extends Error {
|
|
8
|
+
readonly reason: 'absent' | 'retired';
|
|
9
|
+
constructor(reason: RetainRefusal['reason'], message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why the host can no longer keep one published deployment (`Adapter.retain`): it is `absent`
|
|
3
|
+
* (the host holds no deployment of that label, or it was deleted) or `retired` (withdrawn, never
|
|
4
|
+
* served again). No rerun keeps it; a new version publishes a new deployment. Any other rejection
|
|
5
|
+
* of `retain` is transient: once it has passed, a rerun keeps the deployment.
|
|
6
|
+
*/
|
|
7
|
+
export class RetainRefusal extends Error {
|
|
8
|
+
reason;
|
|
9
|
+
constructor(reason, message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'RetainRefusal';
|
|
12
|
+
this.reason = reason;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { DeploymentRecordV1 } from '../../address/index.js';
|
|
2
|
+
/** What one operation knows it changed at a provider. */
|
|
3
|
+
export type MutationKnowledge<Evidence = unknown> = {
|
|
4
|
+
readonly kind: 'none';
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: 'partial';
|
|
7
|
+
readonly evidence?: Evidence;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'applied';
|
|
10
|
+
readonly evidence: Evidence;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'unknown';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* How a deploy left the Environment's secrets on the deployment it made or reused: `bound` to a
|
|
16
|
+
* new deployment, or `updated` or left `unchanged` in place on the reused one.
|
|
17
|
+
*/
|
|
18
|
+
export type DeploymentSecretsState = 'bound' | 'updated' | 'unchanged';
|
|
19
|
+
/**
|
|
20
|
+
* The immutable deployment of one release, ready at its URL.
|
|
21
|
+
*
|
|
22
|
+
* - `created`: a new deployment now serves the release, and the Environment's secrets are `bound`
|
|
23
|
+
* to it.
|
|
24
|
+
* - `reused`: the deployment of this exact release (same label, build and configuration) already
|
|
25
|
+
* existed; its own declared secrets were `updated` or left `unchanged` in place.
|
|
26
|
+
*/
|
|
27
|
+
export interface ReadyReleaseDeployResult {
|
|
28
|
+
readonly status: 'ready';
|
|
29
|
+
readonly state: 'created' | 'reused';
|
|
30
|
+
/** The record the deployment declares, as the host stored it. */
|
|
31
|
+
readonly record: DeploymentRecordV1;
|
|
32
|
+
/** The deployment URL, which is also the issuer of the release it serves. */
|
|
33
|
+
readonly url: string;
|
|
34
|
+
readonly secrets: {
|
|
35
|
+
readonly state: DeploymentSecretsState;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Where a deploy of one release stopped:
|
|
40
|
+
* - `prerequisite`: before any effect at the host (a missing tool, credential or hosting answer);
|
|
41
|
+
* - `provider`: at the host, while it created or reused the deployment;
|
|
42
|
+
* - `readiness`: the deployment exists but did not serve its release before the deadline.
|
|
43
|
+
*/
|
|
44
|
+
export type ReleaseDeploymentPhase = 'prerequisite' | 'provider' | 'readiness';
|
|
45
|
+
/**
|
|
46
|
+
* A deploy of one release that did not reach a ready deployment. Rerunning the same deploy
|
|
47
|
+
* converges: the deployment's label is its content, so a partial or applied deployment is reused.
|
|
48
|
+
*/
|
|
49
|
+
export interface FailedReleaseDeployResult {
|
|
50
|
+
readonly status: 'failed';
|
|
51
|
+
readonly phase: ReleaseDeploymentPhase;
|
|
52
|
+
/** What the host may now hold of the deployment. */
|
|
53
|
+
readonly provider: MutationKnowledge;
|
|
54
|
+
readonly error: Error;
|
|
55
|
+
}
|
|
56
|
+
export type ReleaseDeployResult = ReadyReleaseDeployResult | FailedReleaseDeployResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { Digest } from '@astrale-os/kernel-protocol/artifact';
|
|
2
|
+
import type { WorkerConfigurationV1 } from '../worker/configuration.js';
|
|
3
|
+
export declare const FROZEN_CONFIGURATION_FORMAT = "astrale.deployment.configuration";
|
|
4
|
+
export declare const FROZEN_CONFIGURATION_VERSION = 1;
|
|
5
|
+
/**
|
|
6
|
+
* What a deploy freezes into one deployment beside its build: the author's plain variables and the
|
|
7
|
+
* execution settings, defaults resolved, the durable Workflow options it declares, and the services
|
|
8
|
+
* and dispatch namespaces it binds. It names the secrets a deployment binds, never their values,
|
|
9
|
+
* and leaves out what the host derives (the deployment URL, the build digest, the signing key). A
|
|
10
|
+
* changed variable, setting or binding is another configuration, so another address; a rotated
|
|
11
|
+
* secret is not.
|
|
12
|
+
*
|
|
13
|
+
* Its admission is canonical form only. Whether a Worker can run under it stays with the host that
|
|
14
|
+
* binds it: `encodeWorkerSettings` (`@astrale-os/adapter-cloudflare/worker`) refuses settings past
|
|
15
|
+
* the Worker bounds when the host writes `ASTRALE_SETTINGS`, before anything is uploaded, and the
|
|
16
|
+
* host's binding namespace admits the binding names.
|
|
17
|
+
*/
|
|
18
|
+
export interface FrozenConfigurationV1 {
|
|
19
|
+
readonly format: typeof FROZEN_CONFIGURATION_FORMAT;
|
|
20
|
+
readonly version: typeof FROZEN_CONFIGURATION_VERSION;
|
|
21
|
+
/** The author's plain variables, never secrets. */
|
|
22
|
+
readonly vars: Readonly<Record<string, string>>;
|
|
23
|
+
readonly settings: {
|
|
24
|
+
readonly maximumRequestBytes: number;
|
|
25
|
+
readonly invocationTimeoutMs: number;
|
|
26
|
+
readonly tokenExchange: false | {
|
|
27
|
+
readonly maximumLifetimeSeconds: number;
|
|
28
|
+
};
|
|
29
|
+
/** The durable Workflow options the Environment declares; absent when it declares none. */
|
|
30
|
+
readonly durableOptions?: FrozenDurableOptions;
|
|
31
|
+
};
|
|
32
|
+
readonly runtime: {
|
|
33
|
+
readonly compatibilityDate: string;
|
|
34
|
+
/** Sorted, unique. */
|
|
35
|
+
readonly compatibilityFlags: readonly string[];
|
|
36
|
+
};
|
|
37
|
+
readonly bindings: {
|
|
38
|
+
/** Sorted by name, unique; never the `ROUTER` binding, which `router` describes. */
|
|
39
|
+
readonly services: readonly {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly service: string;
|
|
42
|
+
}[];
|
|
43
|
+
/**
|
|
44
|
+
* Dispatch namespaces the deployment binds, sorted by binding name, unique; empty when it binds
|
|
45
|
+
* none. A binding name is a Worker binding name other than `ROUTER`, a namespace a Cloudflare
|
|
46
|
+
* dispatch namespace name. Which namespaces a deployment may bind is the host's to decide.
|
|
47
|
+
*/
|
|
48
|
+
readonly dispatchNamespaces: readonly {
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly namespace: string;
|
|
51
|
+
}[];
|
|
52
|
+
/** Names of the secrets the deployment binds, sorted, unique. */
|
|
53
|
+
readonly secrets: readonly string[];
|
|
54
|
+
};
|
|
55
|
+
readonly router: false | {
|
|
56
|
+
readonly service: string;
|
|
57
|
+
readonly hostSuffix: string;
|
|
58
|
+
readonly minLabels: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The durable Workflow options of one deployment, as declared: every field optional, each a
|
|
63
|
+
* positive integer. The SDK's durable serving bounds and defaults them when the Worker runs.
|
|
64
|
+
*/
|
|
65
|
+
export interface FrozenDurableOptions {
|
|
66
|
+
readonly retentionMs?: number;
|
|
67
|
+
readonly retry?: {
|
|
68
|
+
readonly initialIntervalMs?: number;
|
|
69
|
+
readonly maxAttempts?: number;
|
|
70
|
+
readonly maxIntervalMs?: number;
|
|
71
|
+
};
|
|
72
|
+
readonly stepTimeoutMs?: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* What one deployment freezes beside its build, as its adapter's `configure` returns it: a
|
|
76
|
+
* `FrozenConfigurationV1`, which a Cloudflare dispatch namespace binds (namespace mode), or a
|
|
77
|
+
* `WorkerConfigurationV1` (`@astrale-os/sdk/deployment/worker`), which a Worker host binds
|
|
78
|
+
* (Admin's Services). Its digest and the build digest make the deployment's label.
|
|
79
|
+
*/
|
|
80
|
+
export type DeploymentConfiguration = FrozenConfigurationV1 | WorkerConfigurationV1;
|
|
81
|
+
/** The digest of one frozen configuration of either format, as the deployment's label keeps it. */
|
|
82
|
+
export declare function deploymentConfigurationDigest(configuration: DeploymentConfiguration): Digest;
|
|
83
|
+
/** Whether a configuration is a `FrozenConfigurationV1`, by its format alone (not admitted). */
|
|
84
|
+
export declare function isFrozenConfiguration(configuration: DeploymentConfiguration): configuration is FrozenConfigurationV1;
|
|
85
|
+
/** A configuration before its canonical order: lists in any order, no format header. */
|
|
86
|
+
export type FrozenConfigurationInput = Omit<FrozenConfigurationV1, 'format' | 'version'>;
|
|
87
|
+
/** Freeze one deployment configuration in the one canonical order its digest is taken in. */
|
|
88
|
+
export declare function frozenConfiguration(input: FrozenConfigurationInput): FrozenConfigurationV1;
|
|
89
|
+
/**
|
|
90
|
+
* `sha256` of the canonical JSON (RFC 8785) of one exact, canonical frozen configuration. A
|
|
91
|
+
* deployment record keeps it whole; the deployment address keeps 80 bits of it with the build.
|
|
92
|
+
* It refuses a configuration that is not canonical, and checks nothing past that: a configuration
|
|
93
|
+
* it digests may still be one no Worker runs under (see `FrozenConfigurationV1`).
|
|
94
|
+
*/
|
|
95
|
+
export declare function configurationDigest(configuration: FrozenConfigurationV1): Digest;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { json } from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { identify } from '@astrale-os/kernel-protocol/artifact';
|
|
3
|
+
import { isWorkerConfiguration, workerConfigurationDigest } from '../worker/configuration.js';
|
|
4
|
+
export const FROZEN_CONFIGURATION_FORMAT = 'astrale.deployment.configuration';
|
|
5
|
+
export const FROZEN_CONFIGURATION_VERSION = 1;
|
|
6
|
+
/** Service binding through which an immutable deployment reaches the instance router. */
|
|
7
|
+
const ROUTER_BINDING = 'ROUTER';
|
|
8
|
+
const MEDIA_TYPE = 'application/vnd.astrale.deployment-configuration+json;v=1';
|
|
9
|
+
const COMPATIBILITY_DATE = /^\d{4}-\d{2}-\d{2}$/u;
|
|
10
|
+
/** A Cloudflare Worker binding name. */
|
|
11
|
+
const BINDING_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/u;
|
|
12
|
+
/** A Cloudflare dispatch namespace name. */
|
|
13
|
+
const NAMESPACE_NAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u;
|
|
14
|
+
/** The digest of one frozen configuration of either format, as the deployment's label keeps it. */
|
|
15
|
+
export function deploymentConfigurationDigest(configuration) {
|
|
16
|
+
return isWorkerConfiguration(configuration)
|
|
17
|
+
? workerConfigurationDigest(configuration)
|
|
18
|
+
: configurationDigest(configuration);
|
|
19
|
+
}
|
|
20
|
+
/** Whether a configuration is a `FrozenConfigurationV1`, by its format alone (not admitted). */
|
|
21
|
+
export function isFrozenConfiguration(configuration) {
|
|
22
|
+
return configuration?.format === FROZEN_CONFIGURATION_FORMAT;
|
|
23
|
+
}
|
|
24
|
+
/** Freeze one deployment configuration in the one canonical order its digest is taken in. */
|
|
25
|
+
export function frozenConfiguration(input) {
|
|
26
|
+
if (input === null || typeof input !== 'object')
|
|
27
|
+
invalid();
|
|
28
|
+
const { settings, runtime, bindings } = input;
|
|
29
|
+
if (settings === null || typeof settings !== 'object')
|
|
30
|
+
invalid();
|
|
31
|
+
if (runtime === null || typeof runtime !== 'object')
|
|
32
|
+
invalid();
|
|
33
|
+
if (bindings === null || typeof bindings !== 'object')
|
|
34
|
+
invalid();
|
|
35
|
+
if (!Array.isArray(runtime.compatibilityFlags))
|
|
36
|
+
invalid();
|
|
37
|
+
if (!Array.isArray(bindings.services) ||
|
|
38
|
+
!Array.isArray(bindings.dispatchNamespaces) ||
|
|
39
|
+
!Array.isArray(bindings.secrets)) {
|
|
40
|
+
invalid();
|
|
41
|
+
}
|
|
42
|
+
return admit({
|
|
43
|
+
format: FROZEN_CONFIGURATION_FORMAT,
|
|
44
|
+
version: FROZEN_CONFIGURATION_VERSION,
|
|
45
|
+
vars: input.vars,
|
|
46
|
+
settings: declaredSettings(settings),
|
|
47
|
+
runtime: {
|
|
48
|
+
compatibilityDate: runtime.compatibilityDate,
|
|
49
|
+
compatibilityFlags: [...runtime.compatibilityFlags].sort(compare),
|
|
50
|
+
},
|
|
51
|
+
bindings: {
|
|
52
|
+
services: [...bindings.services].sort(byName),
|
|
53
|
+
dispatchNamespaces: [...bindings.dispatchNamespaces].sort(byName),
|
|
54
|
+
secrets: [...bindings.secrets].sort(compare),
|
|
55
|
+
},
|
|
56
|
+
router: input.router,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* `sha256` of the canonical JSON (RFC 8785) of one exact, canonical frozen configuration. A
|
|
61
|
+
* deployment record keeps it whole; the deployment address keeps 80 bits of it with the build.
|
|
62
|
+
* It refuses a configuration that is not canonical, and checks nothing past that: a configuration
|
|
63
|
+
* it digests may still be one no Worker runs under (see `FrozenConfigurationV1`).
|
|
64
|
+
*/
|
|
65
|
+
export function configurationDigest(configuration) {
|
|
66
|
+
return identify(json.encode(admit(configuration)), MEDIA_TYPE).digest;
|
|
67
|
+
}
|
|
68
|
+
function admit(input) {
|
|
69
|
+
exact(input, ['format', 'version', 'vars', 'settings', 'runtime', 'bindings', 'router']);
|
|
70
|
+
if (input.format !== FROZEN_CONFIGURATION_FORMAT ||
|
|
71
|
+
input.version !== FROZEN_CONFIGURATION_VERSION) {
|
|
72
|
+
invalid();
|
|
73
|
+
}
|
|
74
|
+
const vars = variables(input.vars);
|
|
75
|
+
exact(input.settings, ['maximumRequestBytes', 'invocationTimeoutMs', 'tokenExchange'], ['durableOptions']);
|
|
76
|
+
const { tokenExchange } = input.settings;
|
|
77
|
+
if (tokenExchange !== false)
|
|
78
|
+
exact(tokenExchange, ['maximumLifetimeSeconds']);
|
|
79
|
+
exact(input.runtime, ['compatibilityDate', 'compatibilityFlags']);
|
|
80
|
+
const { compatibilityDate } = input.runtime;
|
|
81
|
+
if (!isDate(compatibilityDate))
|
|
82
|
+
invalid();
|
|
83
|
+
exact(input.bindings, ['services', 'dispatchNamespaces', 'secrets']);
|
|
84
|
+
if (!Array.isArray(input.bindings.services))
|
|
85
|
+
invalid();
|
|
86
|
+
if (!Array.isArray(input.bindings.dispatchNamespaces))
|
|
87
|
+
invalid();
|
|
88
|
+
const services = input.bindings.services.map((binding) => {
|
|
89
|
+
exact(binding, ['name', 'service']);
|
|
90
|
+
if (binding.name === ROUTER_BINDING) {
|
|
91
|
+
throw new TypeError('Frozen configuration service bindings never include ROUTER.');
|
|
92
|
+
}
|
|
93
|
+
return Object.freeze({
|
|
94
|
+
name: stable(binding.name, 'Service binding name'),
|
|
95
|
+
service: stable(binding.service, 'Service binding target'),
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
ordered(services.map((binding) => binding.name), 'Service bindings');
|
|
99
|
+
const dispatchNamespaces = input.bindings.dispatchNamespaces.map((binding) => {
|
|
100
|
+
exact(binding, ['name', 'namespace']);
|
|
101
|
+
if (binding.name === ROUTER_BINDING) {
|
|
102
|
+
throw new TypeError('Frozen configuration dispatch namespace bindings never include ROUTER.');
|
|
103
|
+
}
|
|
104
|
+
if (typeof binding.name !== 'string' || !BINDING_NAME.test(binding.name)) {
|
|
105
|
+
throw new TypeError('Dispatch namespace binding name must be a Worker binding name.');
|
|
106
|
+
}
|
|
107
|
+
if (typeof binding.namespace !== 'string' || !NAMESPACE_NAME.test(binding.namespace)) {
|
|
108
|
+
throw new TypeError('Dispatch namespace must be a Cloudflare dispatch namespace name.');
|
|
109
|
+
}
|
|
110
|
+
return Object.freeze({ name: binding.name, namespace: binding.namespace });
|
|
111
|
+
});
|
|
112
|
+
ordered(dispatchNamespaces.map((binding) => binding.name), 'Dispatch namespace bindings');
|
|
113
|
+
const secrets = names(input.bindings.secrets, 'Secret names');
|
|
114
|
+
const router = input.router === false ? false : routerOf(input.router);
|
|
115
|
+
const bound = [
|
|
116
|
+
...Object.keys(vars),
|
|
117
|
+
...services.map((binding) => binding.name),
|
|
118
|
+
...dispatchNamespaces.map((binding) => binding.name),
|
|
119
|
+
...secrets,
|
|
120
|
+
...(router === false ? [] : [ROUTER_BINDING]),
|
|
121
|
+
];
|
|
122
|
+
if (new Set(bound).size !== bound.length) {
|
|
123
|
+
throw new TypeError('Frozen configuration binding names must be unique.');
|
|
124
|
+
}
|
|
125
|
+
return Object.freeze({
|
|
126
|
+
format: FROZEN_CONFIGURATION_FORMAT,
|
|
127
|
+
version: FROZEN_CONFIGURATION_VERSION,
|
|
128
|
+
vars,
|
|
129
|
+
settings: Object.freeze({
|
|
130
|
+
maximumRequestBytes: positive(input.settings.maximumRequestBytes),
|
|
131
|
+
invocationTimeoutMs: positive(input.settings.invocationTimeoutMs),
|
|
132
|
+
tokenExchange: tokenExchange === false
|
|
133
|
+
? false
|
|
134
|
+
: Object.freeze({
|
|
135
|
+
maximumLifetimeSeconds: positive(tokenExchange.maximumLifetimeSeconds),
|
|
136
|
+
}),
|
|
137
|
+
...(Object.hasOwn(input.settings, 'durableOptions')
|
|
138
|
+
? { durableOptions: durableOptionsOf(input.settings.durableOptions) }
|
|
139
|
+
: {}),
|
|
140
|
+
}),
|
|
141
|
+
runtime: Object.freeze({
|
|
142
|
+
compatibilityDate,
|
|
143
|
+
compatibilityFlags: names(input.runtime.compatibilityFlags, 'Compatibility flags'),
|
|
144
|
+
}),
|
|
145
|
+
bindings: Object.freeze({
|
|
146
|
+
services: Object.freeze(services),
|
|
147
|
+
dispatchNamespaces: Object.freeze(dispatchNamespaces),
|
|
148
|
+
secrets,
|
|
149
|
+
}),
|
|
150
|
+
router,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** A calendar date written `YYYY-MM-DD`, as a Worker compatibility date is. */
|
|
154
|
+
function isDate(input) {
|
|
155
|
+
if (typeof input !== 'string' || !COMPATIBILITY_DATE.test(input))
|
|
156
|
+
return false;
|
|
157
|
+
const time = Date.parse(`${input}T00:00:00Z`);
|
|
158
|
+
return !Number.isNaN(time) && new Date(time).toISOString().slice(0, 10) === input;
|
|
159
|
+
}
|
|
160
|
+
function variables(input) {
|
|
161
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
162
|
+
invalid();
|
|
163
|
+
const entries = Reflect.ownKeys(input).map((name) => {
|
|
164
|
+
if (typeof name !== 'string')
|
|
165
|
+
invalid();
|
|
166
|
+
const value = input[name];
|
|
167
|
+
if (typeof value !== 'string')
|
|
168
|
+
invalid();
|
|
169
|
+
return [stable(name, 'Variable name'), value];
|
|
170
|
+
});
|
|
171
|
+
return Object.freeze(Object.fromEntries(entries));
|
|
172
|
+
}
|
|
173
|
+
/** The settings as written, without a `durableOptions` or durable field left `undefined`. */
|
|
174
|
+
function declaredSettings(settings) {
|
|
175
|
+
const { durableOptions, ...rest } = settings;
|
|
176
|
+
if (durableOptions === undefined)
|
|
177
|
+
return rest;
|
|
178
|
+
const { retry, ...options } = defined(durableOptions);
|
|
179
|
+
return {
|
|
180
|
+
...rest,
|
|
181
|
+
durableOptions: {
|
|
182
|
+
...options,
|
|
183
|
+
...(retry === undefined ? {} : { retry: defined(retry) }),
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function defined(input) {
|
|
188
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
189
|
+
invalid();
|
|
190
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined));
|
|
191
|
+
}
|
|
192
|
+
/** The declared durable options in their canonical form: sorted keys, positive integers. */
|
|
193
|
+
function durableOptionsOf(input) {
|
|
194
|
+
exact(input, [], ['retentionMs', 'retry', 'stepTimeoutMs']);
|
|
195
|
+
const options = input;
|
|
196
|
+
let retry;
|
|
197
|
+
if (Object.hasOwn(options, 'retry')) {
|
|
198
|
+
exact(options.retry, [], ['initialIntervalMs', 'maxAttempts', 'maxIntervalMs']);
|
|
199
|
+
const value = options.retry;
|
|
200
|
+
retry = Object.freeze({
|
|
201
|
+
...optional(value, 'initialIntervalMs'),
|
|
202
|
+
...optional(value, 'maxAttempts'),
|
|
203
|
+
...optional(value, 'maxIntervalMs'),
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return Object.freeze({
|
|
207
|
+
...optional(options, 'retentionMs'),
|
|
208
|
+
...(retry === undefined ? {} : { retry }),
|
|
209
|
+
...optional(options, 'stepTimeoutMs'),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
function optional(input, key) {
|
|
213
|
+
return Object.hasOwn(input, key)
|
|
214
|
+
? { [key]: positive(input[key]) }
|
|
215
|
+
: {};
|
|
216
|
+
}
|
|
217
|
+
function routerOf(input) {
|
|
218
|
+
exact(input, ['service', 'hostSuffix', 'minLabels']);
|
|
219
|
+
const router = input;
|
|
220
|
+
if (typeof router.hostSuffix !== 'string')
|
|
221
|
+
invalid();
|
|
222
|
+
if (!Number.isSafeInteger(router.minLabels) || router.minLabels < 0)
|
|
223
|
+
invalid();
|
|
224
|
+
return Object.freeze({
|
|
225
|
+
service: stable(router.service, 'Router service'),
|
|
226
|
+
hostSuffix: router.hostSuffix,
|
|
227
|
+
minLabels: router.minLabels,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function names(input, label) {
|
|
231
|
+
if (!Array.isArray(input))
|
|
232
|
+
invalid();
|
|
233
|
+
const values = input.map((value) => stable(value, label));
|
|
234
|
+
ordered(values, label);
|
|
235
|
+
return Object.freeze(values);
|
|
236
|
+
}
|
|
237
|
+
function ordered(values, label) {
|
|
238
|
+
for (let index = 1; index < values.length; index += 1) {
|
|
239
|
+
if (compare(values[index - 1], values[index]) >= 0) {
|
|
240
|
+
throw new TypeError(`${label} must be unique and sorted.`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** Exactly `keys`, plus any of `optional`, and nothing else. */
|
|
245
|
+
function exact(input, keys, optionalKeys = []) {
|
|
246
|
+
if (input === null ||
|
|
247
|
+
typeof input !== 'object' ||
|
|
248
|
+
Array.isArray(input) ||
|
|
249
|
+
Reflect.ownKeys(input).some((key) => typeof key !== 'string' || (!keys.includes(key) && !optionalKeys.includes(key))) ||
|
|
250
|
+
keys.some((key) => !Object.hasOwn(input, key))) {
|
|
251
|
+
invalid();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function positive(input) {
|
|
255
|
+
if (!Number.isSafeInteger(input) || input < 1)
|
|
256
|
+
invalid();
|
|
257
|
+
return input;
|
|
258
|
+
}
|
|
259
|
+
function stable(input, label) {
|
|
260
|
+
if (typeof input !== 'string' || input.length === 0 || input.trim() !== input) {
|
|
261
|
+
throw new TypeError(`${label} must be non-empty stable text.`);
|
|
262
|
+
}
|
|
263
|
+
return input;
|
|
264
|
+
}
|
|
265
|
+
function byName(left, right) {
|
|
266
|
+
return compare(String(left?.name), String(right?.name));
|
|
267
|
+
}
|
|
268
|
+
function compare(left, right) {
|
|
269
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
270
|
+
}
|
|
271
|
+
function invalid() {
|
|
272
|
+
throw new TypeError('Frozen configuration is invalid.');
|
|
273
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first 80 bits of `sha256(utf8(parts[0]) ‖ 0x00 ‖ utf8(parts[1]) ‖ …)` as 16 characters of
|
|
3
|
+
* RFC 4648 base32, lower case and unpadded. Callers admit every part first, so no part holds 0x00.
|
|
4
|
+
*/
|
|
5
|
+
export declare function first80(...parts: readonly string[]): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { identify } from '@astrale-os/kernel-protocol/artifact';
|
|
2
|
+
const encoder = new TextEncoder();
|
|
3
|
+
const ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567';
|
|
4
|
+
const PREIMAGE_MEDIA_TYPE = 'application/octet-stream';
|
|
5
|
+
/**
|
|
6
|
+
* The first 80 bits of `sha256(utf8(parts[0]) ‖ 0x00 ‖ utf8(parts[1]) ‖ …)` as 16 characters of
|
|
7
|
+
* RFC 4648 base32, lower case and unpadded. Callers admit every part first, so no part holds 0x00.
|
|
8
|
+
*/
|
|
9
|
+
export function first80(...parts) {
|
|
10
|
+
const encoded = parts.map((part) => encoder.encode(part));
|
|
11
|
+
const preimage = new Uint8Array(encoded.reduce((size, part) => size + part.byteLength, encoded.length - 1));
|
|
12
|
+
let offset = 0;
|
|
13
|
+
for (const [index, part] of encoded.entries()) {
|
|
14
|
+
if (index > 0)
|
|
15
|
+
offset += 1;
|
|
16
|
+
preimage.set(part, offset);
|
|
17
|
+
offset += part.byteLength;
|
|
18
|
+
}
|
|
19
|
+
// `sha256:` then 20 hexadecimal digits: the first 10 bytes of the hash.
|
|
20
|
+
let bits = BigInt(`0x${identify(preimage, PREIMAGE_MEDIA_TYPE).digest.slice(7, 27)}`);
|
|
21
|
+
let text = '';
|
|
22
|
+
for (let index = 0; index < 16; index += 1) {
|
|
23
|
+
text = ALPHABET[Number(bits & 31n)] + text;
|
|
24
|
+
bits >>= 5n;
|
|
25
|
+
}
|
|
26
|
+
return text;
|
|
27
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { configurationDigest, deploymentConfigurationDigest, frozenConfiguration, FROZEN_CONFIGURATION_FORMAT, FROZEN_CONFIGURATION_VERSION, isFrozenConfiguration, type DeploymentConfiguration, type FrozenConfigurationInput, type FrozenDurableOptions, type FrozenConfigurationV1, } from './configuration.js';
|
|
2
|
+
export { DEPLOYMENT_LABEL, deploymentContent, deploymentLabel, deploymentUrl, parseDeploymentLabel, type DeploymentLabelParts, } from './label.js';
|
|
3
|
+
export { deploymentLine, lineFingerprint, readablePart, type DeploymentLineInput, type LineAddressing, } from './line.js';
|
|
4
|
+
export { acceptDeploymentRecord, decodeDeploymentRecord, DEPLOYMENT_RECORD_FORMAT, DEPLOYMENT_RECORD_MEDIA_TYPE, DEPLOYMENT_RECORD_VERSION, encodeDeploymentRecord, type DeploymentCommitV1, type DeploymentRecordDocument, type DeploymentRecordV1, } from './record.js';
|
|
5
|
+
export type { DeploymentSummaryV1 } from './summary.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { configurationDigest, deploymentConfigurationDigest, frozenConfiguration, FROZEN_CONFIGURATION_FORMAT, FROZEN_CONFIGURATION_VERSION, isFrozenConfiguration, } from './configuration.js';
|
|
2
|
+
export { DEPLOYMENT_LABEL, deploymentContent, deploymentLabel, deploymentUrl, parseDeploymentLabel, } from './label.js';
|
|
3
|
+
export { deploymentLine, lineFingerprint, readablePart, } from './line.js';
|
|
4
|
+
export { acceptDeploymentRecord, decodeDeploymentRecord, DEPLOYMENT_RECORD_FORMAT, DEPLOYMENT_RECORD_MEDIA_TYPE, DEPLOYMENT_RECORD_VERSION, encodeDeploymentRecord, } from './record.js';
|