@astrale-os/sdk 0.6.0-beta.3 → 0.6.0-beta.30
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 +179 -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
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Project installed evidence projected into the stable development-session representation. */
|
|
2
|
-
export function developmentReleaseEvidence(installation) {
|
|
3
|
-
return Object.freeze({
|
|
4
|
-
origin: installation.origin,
|
|
5
|
-
revision: installation.revision,
|
|
6
|
-
issuer: installation.issuer,
|
|
7
|
-
etag: installation.etag,
|
|
8
|
-
generation: installation.generation,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Adapter, ReadyDeployResult } from '../../../deployment/adapter/index.js';
|
|
2
|
-
import type { InstallationEvidence } from '../installation/index.js';
|
|
3
|
-
export declare function reportDevelopmentDeployment(deployed: ReadyDeployResult, installation: InstallationEvidence | undefined, adapter: Adapter<object>, input: {
|
|
4
|
-
readonly environment: string;
|
|
5
|
-
readonly deployOnly: boolean;
|
|
6
|
-
}): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { info } from '../log.js';
|
|
2
|
-
export function reportDevelopmentDeployment(deployed, installation, adapter, input) {
|
|
3
|
-
info(`Environment: ${input.environment}`);
|
|
4
|
-
info(`Adapter: ${adapter.name}@${adapter.version}`);
|
|
5
|
-
info(`Deployment: ${deployed.progress.provider.evidence.deployment}`);
|
|
6
|
-
if (deployed.progress.provider.evidence.preflight !== undefined) {
|
|
7
|
-
info(`Preflight: ${deployed.progress.provider.evidence.preflight}; public readiness verified`);
|
|
8
|
-
}
|
|
9
|
-
info(`Public: ${deployed.release.addressing.publicUrl}`);
|
|
10
|
-
info(`Publication: ${deployed.release.publication.schema.revision} · ${deployed.release.publication.etag}`);
|
|
11
|
-
info(installation === undefined
|
|
12
|
-
? `Installation: skipped${input.deployOnly ? ' (--deploy-only)' : ''}`
|
|
13
|
-
: `Installation: ${installation.instance} · ${installation.status}`);
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export declare const DEVELOPMENT_SESSION_FILE_VERSION: 1;
|
|
2
|
-
export type DevelopmentSessionPhaseV1 = 'starting' | 'ready' | 'updating' | 'recovering' | 'stopping' | 'stopped' | 'failed';
|
|
3
|
-
export interface DevelopmentSessionProjectV1 {
|
|
4
|
-
readonly origin: string;
|
|
5
|
-
}
|
|
6
|
-
export interface DevelopmentSessionReleaseV1 {
|
|
7
|
-
readonly revision: string;
|
|
8
|
-
readonly issuer: string;
|
|
9
|
-
readonly etag: string;
|
|
10
|
-
readonly generation: string;
|
|
11
|
-
}
|
|
12
|
-
interface DevelopmentSessionFileBaseV1 {
|
|
13
|
-
readonly version: typeof DEVELOPMENT_SESSION_FILE_VERSION;
|
|
14
|
-
readonly sessionId: string;
|
|
15
|
-
readonly sequence: number;
|
|
16
|
-
readonly phase: DevelopmentSessionPhaseV1;
|
|
17
|
-
}
|
|
18
|
-
interface DevelopmentSessionStartingFileV1 extends DevelopmentSessionFileBaseV1 {
|
|
19
|
-
readonly phase: 'starting';
|
|
20
|
-
}
|
|
21
|
-
interface DevelopmentSessionActiveFileV1 extends DevelopmentSessionFileBaseV1 {
|
|
22
|
-
readonly phase: 'ready' | 'updating' | 'recovering';
|
|
23
|
-
readonly project: DevelopmentSessionProjectV1;
|
|
24
|
-
readonly release: DevelopmentSessionReleaseV1;
|
|
25
|
-
}
|
|
26
|
-
interface DevelopmentSessionTerminalFileBaseV1 extends DevelopmentSessionFileBaseV1 {
|
|
27
|
-
readonly phase: 'stopping' | 'stopped' | 'failed';
|
|
28
|
-
}
|
|
29
|
-
type DevelopmentSessionTerminalFileV1 = DevelopmentSessionTerminalFileBaseV1 & ({
|
|
30
|
-
readonly project: DevelopmentSessionProjectV1;
|
|
31
|
-
readonly release: DevelopmentSessionReleaseV1;
|
|
32
|
-
} | {
|
|
33
|
-
readonly project?: never;
|
|
34
|
-
readonly release?: never;
|
|
35
|
-
});
|
|
36
|
-
export type DevelopmentSessionFileV1 = DevelopmentSessionStartingFileV1 | DevelopmentSessionActiveFileV1 | DevelopmentSessionTerminalFileV1;
|
|
37
|
-
export interface DevelopmentSessionReleaseEvidenceV1 extends DevelopmentSessionProjectV1, DevelopmentSessionReleaseV1 {
|
|
38
|
-
}
|
|
39
|
-
export declare class DevelopmentSessionFileError extends Error {
|
|
40
|
-
readonly code: 'INVALID_SESSION_FILE_PATH' | 'SESSION_FILE_PATH_UNSAFE' | 'SESSION_FILE_EXISTS' | 'SESSION_FILE_TAMPERED' | 'SESSION_FILE_TRANSITION_INVALID' | 'SESSION_FILE_EVIDENCE_INCOHERENT';
|
|
41
|
-
readonly name = "DevelopmentSessionFileError";
|
|
42
|
-
constructor(code: 'INVALID_SESSION_FILE_PATH' | 'SESSION_FILE_PATH_UNSAFE' | 'SESSION_FILE_EXISTS' | 'SESSION_FILE_TAMPERED' | 'SESSION_FILE_TRANSITION_INVALID' | 'SESSION_FILE_EVIDENCE_INCOHERENT', message: string, options?: ErrorOptions);
|
|
43
|
-
}
|
|
44
|
-
export declare function acceptDevelopmentSessionFileV1(input: unknown): DevelopmentSessionFileV1;
|
|
45
|
-
/** SDK-private sole writer for one caller-selected machine-integration file. */
|
|
46
|
-
export declare class DevelopmentSessionFileWriter {
|
|
47
|
-
#private;
|
|
48
|
-
private constructor();
|
|
49
|
-
static create(path: string): Promise<DevelopmentSessionFileWriter>;
|
|
50
|
-
transition(phase: Exclude<DevelopmentSessionPhaseV1, 'starting'>, evidence?: DevelopmentSessionReleaseEvidenceV1): Promise<DevelopmentSessionFileV1>;
|
|
51
|
-
}
|
|
52
|
-
export declare function developmentSessionTransitionAllowed(previous: DevelopmentSessionPhaseV1, next: Exclude<DevelopmentSessionPhaseV1, 'starting'>): boolean;
|
|
53
|
-
export {};
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { link, lstat, open, readFile, realpath, rename, unlink } from 'node:fs/promises';
|
|
3
|
-
import { basename, dirname, isAbsolute, join, normalize, parse, sep } from 'node:path';
|
|
4
|
-
import { patterns } from '../../../platform/schema/index.js';
|
|
5
|
-
export const DEVELOPMENT_SESSION_FILE_VERSION = 1;
|
|
6
|
-
export class DevelopmentSessionFileError extends Error {
|
|
7
|
-
code;
|
|
8
|
-
name = 'DevelopmentSessionFileError';
|
|
9
|
-
constructor(code, message, options) {
|
|
10
|
-
super(message, options);
|
|
11
|
-
this.code = code;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export function acceptDevelopmentSessionFileV1(input) {
|
|
15
|
-
const value = record(input, 'Development session file');
|
|
16
|
-
if (value.metadata !== undefined ||
|
|
17
|
-
value.extensions !== undefined ||
|
|
18
|
-
value.vendor !== undefined) {
|
|
19
|
-
invalid('Development session file cannot contain a metadata, extensions, or vendor bag.');
|
|
20
|
-
}
|
|
21
|
-
if (value.version !== DEVELOPMENT_SESSION_FILE_VERSION) {
|
|
22
|
-
invalid(`Unsupported development session file version: ${String(value.version)}.`);
|
|
23
|
-
}
|
|
24
|
-
const sessionId = text(value.sessionId, 'Development session id');
|
|
25
|
-
const sequence = integer(value.sequence, 'Development session sequence');
|
|
26
|
-
const phase = admitPhase(value.phase);
|
|
27
|
-
const base = Object.freeze({ version: 1, sessionId, sequence, phase });
|
|
28
|
-
const hasProject = value.project !== undefined;
|
|
29
|
-
const hasRelease = value.release !== undefined;
|
|
30
|
-
if (phase === 'starting') {
|
|
31
|
-
if (hasProject || hasRelease) {
|
|
32
|
-
invalid('Development session starting phase cannot contain Release evidence.');
|
|
33
|
-
}
|
|
34
|
-
return Object.freeze({ ...base, phase: 'starting' });
|
|
35
|
-
}
|
|
36
|
-
if (phase === 'ready' || phase === 'updating' || phase === 'recovering') {
|
|
37
|
-
if (!hasProject || !hasRelease)
|
|
38
|
-
invalid(`Development session phase ${phase} requires a Release.`);
|
|
39
|
-
return Object.freeze({
|
|
40
|
-
...base,
|
|
41
|
-
phase,
|
|
42
|
-
project: project(value.project),
|
|
43
|
-
release: release(value.release),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
if (hasProject !== hasRelease) {
|
|
47
|
-
invalid('Development session terminal project and Release must be present together.');
|
|
48
|
-
}
|
|
49
|
-
if (!hasProject)
|
|
50
|
-
return Object.freeze({ ...base, phase });
|
|
51
|
-
return Object.freeze({
|
|
52
|
-
...base,
|
|
53
|
-
phase,
|
|
54
|
-
project: project(value.project),
|
|
55
|
-
release: release(value.release),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/** SDK-private sole writer for one caller-selected machine-integration file. */
|
|
59
|
-
export class DevelopmentSessionFileWriter {
|
|
60
|
-
#path;
|
|
61
|
-
#parent;
|
|
62
|
-
#sessionId;
|
|
63
|
-
#sequence = 0;
|
|
64
|
-
#phase = 'starting';
|
|
65
|
-
#last;
|
|
66
|
-
#tail = Promise.resolve();
|
|
67
|
-
constructor(path, parent, sessionId) {
|
|
68
|
-
this.#path = path;
|
|
69
|
-
this.#parent = parent;
|
|
70
|
-
this.#sessionId = sessionId;
|
|
71
|
-
}
|
|
72
|
-
static async create(path) {
|
|
73
|
-
const admitted = await admitSessionFilePath(path);
|
|
74
|
-
const writer = new DevelopmentSessionFileWriter(admitted.path, admitted.parent, randomUUID());
|
|
75
|
-
await writer.#create();
|
|
76
|
-
return writer;
|
|
77
|
-
}
|
|
78
|
-
transition(phase, evidence) {
|
|
79
|
-
const operation = this.#tail.then(async () => {
|
|
80
|
-
if (!developmentSessionTransitionAllowed(this.#phase, phase)) {
|
|
81
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_TRANSITION_INVALID', `Development session cannot transition from ${this.#phase} to ${phase}.`);
|
|
82
|
-
}
|
|
83
|
-
if (evidence !== undefined)
|
|
84
|
-
this.#last = admitEvidence(evidence);
|
|
85
|
-
if (['ready', 'updating', 'recovering'].includes(phase) && this.#last === undefined) {
|
|
86
|
-
throw new TypeError(`Development session phase ${phase} requires Release evidence.`);
|
|
87
|
-
}
|
|
88
|
-
const snapshot = this.#snapshot(phase, this.#sequence + 1);
|
|
89
|
-
await this.#replace(snapshot);
|
|
90
|
-
this.#sequence = snapshot.sequence;
|
|
91
|
-
this.#phase = snapshot.phase;
|
|
92
|
-
return snapshot;
|
|
93
|
-
});
|
|
94
|
-
this.#tail = operation.then(() => undefined, () => undefined);
|
|
95
|
-
return operation;
|
|
96
|
-
}
|
|
97
|
-
async #create() {
|
|
98
|
-
const snapshot = this.#snapshot('starting', 1);
|
|
99
|
-
const staging = await writeStaging(this.#parent, this.#path, this.#sessionId, snapshot);
|
|
100
|
-
try {
|
|
101
|
-
await link(staging, this.#path);
|
|
102
|
-
}
|
|
103
|
-
catch (cause) {
|
|
104
|
-
if (errorCode(cause) === 'EEXIST') {
|
|
105
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_EXISTS', `Development session file already exists: ${this.#path}`, { cause });
|
|
106
|
-
}
|
|
107
|
-
throw cause;
|
|
108
|
-
}
|
|
109
|
-
finally {
|
|
110
|
-
await unlink(staging).catch((cause) => {
|
|
111
|
-
if (errorCode(cause) !== 'ENOENT')
|
|
112
|
-
throw cause;
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
await syncDirectory(this.#parent);
|
|
116
|
-
this.#sequence = snapshot.sequence;
|
|
117
|
-
}
|
|
118
|
-
#snapshot(phase, sequence) {
|
|
119
|
-
const base = {
|
|
120
|
-
version: DEVELOPMENT_SESSION_FILE_VERSION,
|
|
121
|
-
sessionId: this.#sessionId,
|
|
122
|
-
sequence,
|
|
123
|
-
};
|
|
124
|
-
if (phase === 'starting')
|
|
125
|
-
return Object.freeze({ ...base, phase: 'starting' });
|
|
126
|
-
if (this.#last === undefined) {
|
|
127
|
-
if (phase === 'ready' || phase === 'updating' || phase === 'recovering') {
|
|
128
|
-
throw new TypeError(`Development session phase ${phase} requires Release evidence.`);
|
|
129
|
-
}
|
|
130
|
-
return Object.freeze({ ...base, phase });
|
|
131
|
-
}
|
|
132
|
-
return Object.freeze({
|
|
133
|
-
...base,
|
|
134
|
-
phase,
|
|
135
|
-
project: Object.freeze({ origin: this.#last.origin }),
|
|
136
|
-
release: Object.freeze({
|
|
137
|
-
revision: this.#last.revision,
|
|
138
|
-
issuer: this.#last.issuer,
|
|
139
|
-
etag: this.#last.etag,
|
|
140
|
-
generation: this.#last.generation,
|
|
141
|
-
}),
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
async #replace(snapshot) {
|
|
145
|
-
await assertParent(this.#parent);
|
|
146
|
-
const current = await readCurrent(this.#path);
|
|
147
|
-
if (current.sessionId !== this.#sessionId || current.sequence !== snapshot.sequence - 1) {
|
|
148
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_TAMPERED', `Development session file ownership changed: ${this.#path}`);
|
|
149
|
-
}
|
|
150
|
-
const staging = await writeStaging(this.#parent, this.#path, this.#sessionId, snapshot);
|
|
151
|
-
try {
|
|
152
|
-
await rename(staging, this.#path);
|
|
153
|
-
await syncDirectory(this.#parent);
|
|
154
|
-
}
|
|
155
|
-
finally {
|
|
156
|
-
await unlink(staging).catch((cause) => {
|
|
157
|
-
if (errorCode(cause) !== 'ENOENT')
|
|
158
|
-
throw cause;
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
function admitEvidence(input) {
|
|
164
|
-
const admittedProject = project({ origin: input.origin });
|
|
165
|
-
const admittedRelease = release(input);
|
|
166
|
-
return Object.freeze({ origin: admittedProject.origin, ...admittedRelease });
|
|
167
|
-
}
|
|
168
|
-
async function admitSessionFilePath(input) {
|
|
169
|
-
if (!isAbsolute(input) || normalize(input) !== input || basename(input).length === 0) {
|
|
170
|
-
throw new DevelopmentSessionFileError('INVALID_SESSION_FILE_PATH', '--session-file requires one normalized absolute file path.');
|
|
171
|
-
}
|
|
172
|
-
const parent = dirname(input);
|
|
173
|
-
await assertParent(parent);
|
|
174
|
-
try {
|
|
175
|
-
await lstat(input);
|
|
176
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_EXISTS', `Development session file path must not exist: ${input}`);
|
|
177
|
-
}
|
|
178
|
-
catch (cause) {
|
|
179
|
-
if (errorCode(cause) !== 'ENOENT')
|
|
180
|
-
throw cause;
|
|
181
|
-
}
|
|
182
|
-
return Object.freeze({ path: input, parent });
|
|
183
|
-
}
|
|
184
|
-
async function assertParent(parent) {
|
|
185
|
-
const root = parse(parent).root;
|
|
186
|
-
let cursor = root;
|
|
187
|
-
for (const segment of parent.slice(root.length).split(sep).filter(Boolean)) {
|
|
188
|
-
cursor = join(cursor, segment);
|
|
189
|
-
const entry = await lstat(cursor);
|
|
190
|
-
if (entry.isSymbolicLink())
|
|
191
|
-
unsafe(`Development session file path crosses a symlink: ${cursor}`);
|
|
192
|
-
}
|
|
193
|
-
const canonical = await realpath(parent);
|
|
194
|
-
if (canonical !== parent)
|
|
195
|
-
unsafe(`Development session file parent is not canonical: ${parent}`);
|
|
196
|
-
const entry = await lstat(parent);
|
|
197
|
-
if (!entry.isDirectory())
|
|
198
|
-
unsafe(`Development session file parent is not a directory: ${parent}`);
|
|
199
|
-
const uid = process.getuid?.();
|
|
200
|
-
if (uid !== undefined && entry.uid !== uid) {
|
|
201
|
-
unsafe(`Development session file parent is not owned by the current user: ${parent}`);
|
|
202
|
-
}
|
|
203
|
-
if ((entry.mode & 0o077) !== 0) {
|
|
204
|
-
unsafe(`Development session file parent must be owner-only: ${parent}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
async function writeStaging(parent, target, sessionId, snapshot) {
|
|
208
|
-
const path = join(parent, `.${basename(target)}.${sessionId}.${randomUUID()}.next`);
|
|
209
|
-
const file = await open(path, 'wx', 0o600);
|
|
210
|
-
try {
|
|
211
|
-
await file.writeFile(`${JSON.stringify(snapshot, null, 2)}\n`, 'utf8');
|
|
212
|
-
await file.sync();
|
|
213
|
-
}
|
|
214
|
-
catch (cause) {
|
|
215
|
-
await file.close();
|
|
216
|
-
await unlink(path).catch(() => undefined);
|
|
217
|
-
throw cause;
|
|
218
|
-
}
|
|
219
|
-
await file.close();
|
|
220
|
-
return path;
|
|
221
|
-
}
|
|
222
|
-
async function syncDirectory(path) {
|
|
223
|
-
const directory = await open(path, 'r');
|
|
224
|
-
try {
|
|
225
|
-
await directory.sync();
|
|
226
|
-
}
|
|
227
|
-
finally {
|
|
228
|
-
await directory.close();
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
async function readCurrent(path) {
|
|
232
|
-
const entry = await lstat(path);
|
|
233
|
-
if (!entry.isFile() || entry.isSymbolicLink() || (entry.mode & 0o077) !== 0) {
|
|
234
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_TAMPERED', `Development session file is no longer one owner-only regular file: ${path}`);
|
|
235
|
-
}
|
|
236
|
-
try {
|
|
237
|
-
return acceptDevelopmentSessionFileV1(JSON.parse(await readFile(path, 'utf8')));
|
|
238
|
-
}
|
|
239
|
-
catch (cause) {
|
|
240
|
-
if (cause instanceof DevelopmentSessionFileError)
|
|
241
|
-
throw cause;
|
|
242
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_TAMPERED', `Development session file is unreadable or invalid: ${path}`, { cause });
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
function project(input) {
|
|
246
|
-
const value = record(input, 'Development session project');
|
|
247
|
-
rejectBags(value, 'Development session project');
|
|
248
|
-
const origin = text(value.origin, 'Development session project origin');
|
|
249
|
-
if (!patterns.origin.test(origin))
|
|
250
|
-
invalid('Development session project origin is invalid.');
|
|
251
|
-
return Object.freeze({ origin });
|
|
252
|
-
}
|
|
253
|
-
function release(input) {
|
|
254
|
-
const value = record(input, 'Development session Release');
|
|
255
|
-
rejectBags(value, 'Development session Release');
|
|
256
|
-
const revision = digest(value.revision, 'Development session Release revision');
|
|
257
|
-
const etag = digest(value.etag, 'Development session Release etag');
|
|
258
|
-
const generation = digest(value.generation, 'Development session Release generation');
|
|
259
|
-
const issuer = origin(value.issuer);
|
|
260
|
-
return Object.freeze({ revision, issuer, etag, generation });
|
|
261
|
-
}
|
|
262
|
-
function origin(input) {
|
|
263
|
-
const value = text(input, 'Development session Release issuer');
|
|
264
|
-
let url;
|
|
265
|
-
try {
|
|
266
|
-
url = new URL(value);
|
|
267
|
-
}
|
|
268
|
-
catch (cause) {
|
|
269
|
-
throw new TypeError('Development session Release issuer must be an HTTP(S) origin.', { cause });
|
|
270
|
-
}
|
|
271
|
-
if (!['http:', 'https:'].includes(url.protocol) || url.href !== `${url.origin}/`) {
|
|
272
|
-
invalid('Development session Release issuer must be an HTTP(S) origin.');
|
|
273
|
-
}
|
|
274
|
-
return url.origin;
|
|
275
|
-
}
|
|
276
|
-
function digest(input, label) {
|
|
277
|
-
const value = text(input, label);
|
|
278
|
-
if (!/^sha256:[0-9a-f]{64}$/u.test(value))
|
|
279
|
-
invalid(`${label} must be a sha256 digest.`);
|
|
280
|
-
return value;
|
|
281
|
-
}
|
|
282
|
-
function admitPhase(input) {
|
|
283
|
-
if (input !== 'starting' &&
|
|
284
|
-
input !== 'ready' &&
|
|
285
|
-
input !== 'updating' &&
|
|
286
|
-
input !== 'recovering' &&
|
|
287
|
-
input !== 'stopping' &&
|
|
288
|
-
input !== 'stopped' &&
|
|
289
|
-
input !== 'failed') {
|
|
290
|
-
invalid(`Unknown development session phase: ${String(input)}.`);
|
|
291
|
-
}
|
|
292
|
-
return input;
|
|
293
|
-
}
|
|
294
|
-
export function developmentSessionTransitionAllowed(previous, next) {
|
|
295
|
-
if (previous === 'stopped' || previous === 'failed')
|
|
296
|
-
return false;
|
|
297
|
-
if (previous === 'stopping')
|
|
298
|
-
return next === 'stopped' || next === 'failed';
|
|
299
|
-
if (next === 'stopping' || next === 'failed')
|
|
300
|
-
return true;
|
|
301
|
-
if (previous === 'starting')
|
|
302
|
-
return next === 'ready';
|
|
303
|
-
return next === 'ready' || next === 'updating' || next === 'recovering';
|
|
304
|
-
}
|
|
305
|
-
function rejectBags(value, label) {
|
|
306
|
-
if (value.metadata !== undefined ||
|
|
307
|
-
value.extensions !== undefined ||
|
|
308
|
-
value.vendor !== undefined) {
|
|
309
|
-
invalid(`${label} cannot contain a metadata, extensions, or vendor bag.`);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
function record(input, label) {
|
|
313
|
-
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
314
|
-
invalid(`${label} must be an object.`);
|
|
315
|
-
return input;
|
|
316
|
-
}
|
|
317
|
-
function text(input, label) {
|
|
318
|
-
if (typeof input !== 'string' || input.length === 0)
|
|
319
|
-
invalid(`${label} must be text.`);
|
|
320
|
-
return input;
|
|
321
|
-
}
|
|
322
|
-
function integer(input, label) {
|
|
323
|
-
if (!Number.isSafeInteger(input) || Number(input) <= 0)
|
|
324
|
-
invalid(`${label} must be a positive integer.`);
|
|
325
|
-
return Number(input);
|
|
326
|
-
}
|
|
327
|
-
function invalid(message) {
|
|
328
|
-
throw new TypeError(message);
|
|
329
|
-
}
|
|
330
|
-
function unsafe(message) {
|
|
331
|
-
throw new DevelopmentSessionFileError('SESSION_FILE_PATH_UNSAFE', message);
|
|
332
|
-
}
|
|
333
|
-
function errorCode(input) {
|
|
334
|
-
return input !== null && typeof input === 'object' && 'code' in input
|
|
335
|
-
? String(Reflect.get(input, 'code'))
|
|
336
|
-
: undefined;
|
|
337
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface SourceWatch {
|
|
2
|
-
update(sources: ReadonlySet<string>): void;
|
|
3
|
-
stop(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
/** Observe only the admitted authored module closure and declared secrets. */
|
|
6
|
-
export declare function watchSources(input: {
|
|
7
|
-
readonly projectDir: string;
|
|
8
|
-
readonly configPath: string;
|
|
9
|
-
readonly sources: ReadonlySet<string>;
|
|
10
|
-
readonly onInvalidate: () => void;
|
|
11
|
-
readonly onRestartRequired: () => void;
|
|
12
|
-
readonly onError: (cause: unknown) => void;
|
|
13
|
-
readonly debounceMs?: number;
|
|
14
|
-
}): SourceWatch;
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { statSync, watch } from 'node:fs';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
/** Observe only the admitted authored module closure and declared secrets. */
|
|
4
|
-
export function watchSources(input) {
|
|
5
|
-
let sources = canonicalSources(input.sources);
|
|
6
|
-
let closed = false;
|
|
7
|
-
let timer;
|
|
8
|
-
let dirty = false;
|
|
9
|
-
let restart = false;
|
|
10
|
-
const config = resolve(input.configPath);
|
|
11
|
-
let configFingerprint = fingerprint(config);
|
|
12
|
-
let sourceFingerprints = fingerprints(sources);
|
|
13
|
-
const directoryWatchers = new Map();
|
|
14
|
-
const watcher = watch(input.projectDir, { recursive: true }, () => {
|
|
15
|
-
if (closed)
|
|
16
|
-
return;
|
|
17
|
-
let changed = false;
|
|
18
|
-
try {
|
|
19
|
-
const nextConfig = fingerprint(config);
|
|
20
|
-
if (nextConfig !== configFingerprint) {
|
|
21
|
-
configFingerprint = nextConfig;
|
|
22
|
-
restart = true;
|
|
23
|
-
changed = true;
|
|
24
|
-
}
|
|
25
|
-
for (const path of sources) {
|
|
26
|
-
const next = fingerprint(path);
|
|
27
|
-
if (next === sourceFingerprints.get(path))
|
|
28
|
-
continue;
|
|
29
|
-
sourceFingerprints.set(path, next);
|
|
30
|
-
dirty = true;
|
|
31
|
-
changed = true;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
catch (cause) {
|
|
35
|
-
input.onError(cause);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (!changed)
|
|
39
|
-
return;
|
|
40
|
-
schedule();
|
|
41
|
-
});
|
|
42
|
-
watcher.on('error', input.onError);
|
|
43
|
-
syncDirectoryWatchers();
|
|
44
|
-
function schedule() {
|
|
45
|
-
if (timer !== undefined)
|
|
46
|
-
clearTimeout(timer);
|
|
47
|
-
timer = setTimeout(flush, input.debounceMs ?? 80);
|
|
48
|
-
}
|
|
49
|
-
function syncDirectoryWatchers() {
|
|
50
|
-
const directories = new Set([...sourceFingerprints]
|
|
51
|
-
.filter(([, value]) => value.startsWith('directory:'))
|
|
52
|
-
.map(([path]) => path));
|
|
53
|
-
for (const [path, owned] of directoryWatchers) {
|
|
54
|
-
if (directories.has(path))
|
|
55
|
-
continue;
|
|
56
|
-
owned.off('error', input.onError);
|
|
57
|
-
owned.close();
|
|
58
|
-
directoryWatchers.delete(path);
|
|
59
|
-
}
|
|
60
|
-
for (const path of directories) {
|
|
61
|
-
if (directoryWatchers.has(path))
|
|
62
|
-
continue;
|
|
63
|
-
const owned = watch(path, () => {
|
|
64
|
-
if (closed)
|
|
65
|
-
return;
|
|
66
|
-
dirty = true;
|
|
67
|
-
schedule();
|
|
68
|
-
});
|
|
69
|
-
owned.on('error', input.onError);
|
|
70
|
-
directoryWatchers.set(path, owned);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function flush() {
|
|
74
|
-
timer = undefined;
|
|
75
|
-
if (closed)
|
|
76
|
-
return;
|
|
77
|
-
if (restart)
|
|
78
|
-
input.onRestartRequired();
|
|
79
|
-
else if (dirty)
|
|
80
|
-
input.onInvalidate();
|
|
81
|
-
restart = false;
|
|
82
|
-
dirty = false;
|
|
83
|
-
}
|
|
84
|
-
return Object.freeze({
|
|
85
|
-
update(next) {
|
|
86
|
-
const nextSources = canonicalSources(next);
|
|
87
|
-
const nextFingerprints = fingerprints(nextSources);
|
|
88
|
-
// A completed build does not prove it consumed the current file contents.
|
|
89
|
-
// Retain edits that raced its commit, even if the OS event is still queued.
|
|
90
|
-
let changed = false;
|
|
91
|
-
for (const [path, value] of nextFingerprints) {
|
|
92
|
-
if (sourceFingerprints.has(path) && sourceFingerprints.get(path) !== value) {
|
|
93
|
-
dirty = true;
|
|
94
|
-
changed = true;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
sources = nextSources;
|
|
98
|
-
sourceFingerprints = nextFingerprints;
|
|
99
|
-
syncDirectoryWatchers();
|
|
100
|
-
if (changed)
|
|
101
|
-
schedule();
|
|
102
|
-
},
|
|
103
|
-
async stop() {
|
|
104
|
-
if (closed)
|
|
105
|
-
return;
|
|
106
|
-
closed = true;
|
|
107
|
-
if (timer !== undefined)
|
|
108
|
-
clearTimeout(timer);
|
|
109
|
-
watcher.off('error', input.onError);
|
|
110
|
-
watcher.close();
|
|
111
|
-
for (const owned of directoryWatchers.values()) {
|
|
112
|
-
owned.off('error', input.onError);
|
|
113
|
-
owned.close();
|
|
114
|
-
}
|
|
115
|
-
directoryWatchers.clear();
|
|
116
|
-
},
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function canonicalSources(input) {
|
|
120
|
-
return new Set([...input].map((path) => resolve(path)));
|
|
121
|
-
}
|
|
122
|
-
function fingerprints(paths) {
|
|
123
|
-
return new Map([...paths].map((path) => [path, fingerprint(path)]));
|
|
124
|
-
}
|
|
125
|
-
function fingerprint(path) {
|
|
126
|
-
try {
|
|
127
|
-
const value = statSync(path, { bigint: true });
|
|
128
|
-
return `${value.isDirectory() ? 'directory' : 'file'}:${value.size}:${value.mtimeNs}:${value.ctimeNs}`;
|
|
129
|
-
}
|
|
130
|
-
catch (cause) {
|
|
131
|
-
if (errorCode(cause) === 'ENOENT')
|
|
132
|
-
return 'missing';
|
|
133
|
-
throw cause;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function errorCode(input) {
|
|
137
|
-
return input !== null && typeof input === 'object' && 'code' in input
|
|
138
|
-
? String(Reflect.get(input, 'code'))
|
|
139
|
-
: undefined;
|
|
140
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { realpathSync } from 'node:fs';
|
|
2
|
-
import { isAbsolute, relative, resolve, sep } from 'node:path';
|
|
3
|
-
/** Own the canonical project-local files and directories that invalidate a candidate. */
|
|
4
|
-
export class DevelopmentSources {
|
|
5
|
-
#declaredProjectDir;
|
|
6
|
-
#projectDir;
|
|
7
|
-
#sources = new Set();
|
|
8
|
-
constructor(projectDir) {
|
|
9
|
-
this.#declaredProjectDir = resolve(projectDir);
|
|
10
|
-
try {
|
|
11
|
-
this.#projectDir = realpathSync.native(this.#declaredProjectDir);
|
|
12
|
-
}
|
|
13
|
-
catch {
|
|
14
|
-
this.#projectDir = this.#declaredProjectDir;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
record = (path) => {
|
|
18
|
-
if (typeof path !== 'string' || path.length === 0 || path.includes('\0')) {
|
|
19
|
-
throw new TypeError('An adapter reported an invalid preparation source path.');
|
|
20
|
-
}
|
|
21
|
-
const declared = isAbsolute(path) ? resolve(path) : resolve(this.#declaredProjectDir, path);
|
|
22
|
-
let absolute;
|
|
23
|
-
try {
|
|
24
|
-
absolute = realpathSync.native(declared);
|
|
25
|
-
}
|
|
26
|
-
catch (cause) {
|
|
27
|
-
if (errorCode(cause) !== 'ENOENT')
|
|
28
|
-
throw cause;
|
|
29
|
-
absolute = declared.startsWith(`${this.#declaredProjectDir}${sep}`)
|
|
30
|
-
? resolve(this.#projectDir, relative(this.#declaredProjectDir, declared))
|
|
31
|
-
: declared;
|
|
32
|
-
}
|
|
33
|
-
if (!absolute.startsWith(`${this.#projectDir}${sep}`))
|
|
34
|
-
return;
|
|
35
|
-
const topLevel = relative(this.#projectDir, absolute).split(sep)[0];
|
|
36
|
-
if (topLevel === '.astrale' || topLevel === '.git' || topLevel === 'node_modules')
|
|
37
|
-
return;
|
|
38
|
-
this.#sources.add(absolute);
|
|
39
|
-
};
|
|
40
|
-
snapshot() {
|
|
41
|
-
return new Set(this.#sources);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function errorCode(input) {
|
|
45
|
-
return input !== null && typeof input === 'object' && 'code' in input
|
|
46
|
-
? String(Reflect.get(input, 'code'))
|
|
47
|
-
: undefined;
|
|
48
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DevelopmentLease } from './lease.js';
|
|
2
|
-
export declare class DevelopmentTargetLockError extends Error {
|
|
3
|
-
readonly code: 'DEVELOPMENT_TARGET_LOCKED' | 'DEVELOPMENT_TARGET_LOCK_LOST';
|
|
4
|
-
readonly name = "DevelopmentTargetLockError";
|
|
5
|
-
constructor(code: 'DEVELOPMENT_TARGET_LOCKED' | 'DEVELOPMENT_TARGET_LOCK_LOST', message: string, options?: ErrorOptions);
|
|
6
|
-
}
|
|
7
|
-
/** Exclude local sessions targeting one installed Domain across separate checkouts. */
|
|
8
|
-
export declare function acquireDevelopmentTargetLock(input: {
|
|
9
|
-
readonly issuer: string;
|
|
10
|
-
readonly origin: string;
|
|
11
|
-
}, dependencies?: {
|
|
12
|
-
readonly root?: string;
|
|
13
|
-
readonly pid?: number;
|
|
14
|
-
readonly sessionId?: string;
|
|
15
|
-
readonly processAlive?: (pid: number) => boolean;
|
|
16
|
-
}): Promise<DevelopmentLease>;
|