@astrale-os/sdk 0.6.0-beta.4 → 0.6.0-beta.41
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 +191 -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 +47 -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 +21 -10
- 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/define.d.ts +8 -1
- package/dist/application/integration/index.d.ts +2 -2
- package/dist/application/integration/integration.d.ts +13 -1
- package/dist/application/integration/operation.d.ts +16 -3
- 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/execution/execute.js +1 -1
- package/dist/application/mutation/failure.d.ts +6 -0
- package/dist/application/mutation/failure.js +24 -18
- package/dist/application/mutation/index.d.ts +1 -1
- package/dist/application/query/collection/union.js +11 -4
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- package/dist/application/query/conformance.d.ts +15 -0
- package/dist/application/query/conformance.js +46 -0
- package/dist/application/query/define.js +4 -3
- package/dist/application/query/execution/execute.d.ts +0 -1
- package/dist/application/query/execution/execute.js +7 -1
- package/dist/application/query/failure.d.ts +8 -0
- package/dist/application/query/failure.js +8 -0
- package/dist/application/query/index.d.ts +1 -1
- package/dist/application/query/index.js +1 -1
- package/dist/application/routes/admission.d.ts +2 -2
- package/dist/application/routes/admission.js +1 -1
- package/dist/application/routes/route.d.ts +2 -2
- package/dist/application/runtime/actions.js +3 -0
- package/dist/application/runtime/workflows.d.ts +3 -1
- package/dist/application/runtime/workflows.js +3 -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 +14 -9
- package/dist/application/workflow/durable.d.ts +197 -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 +5 -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 +96 -0
- package/dist/deployment/address/configuration.js +274 -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/cache/cache.d.ts +17 -0
- package/dist/execution/cache/cache.js +11 -0
- package/dist/execution/cache/index.d.ts +2 -0
- package/dist/execution/cache/index.js +2 -0
- package/dist/execution/cache/memory.d.ts +13 -0
- package/dist/execution/cache/memory.js +48 -0
- package/dist/execution/identity/authentication.d.ts +33 -3
- package/dist/execution/identity/authentication.js +90 -36
- package/dist/execution/identity/callback.d.ts +20 -20
- package/dist/execution/identity/callback.js +34 -26
- 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 +6 -4
- package/dist/execution/index.js +4 -2
- package/dist/execution/invocation/admission/age.d.ts +57 -0
- package/dist/execution/invocation/admission/age.js +208 -0
- package/dist/execution/invocation/admission/authentication.d.ts +13 -13
- package/dist/execution/invocation/admission/authentication.js +52 -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 +4 -3
- package/dist/execution/invocation/admission/index.js +3 -2
- package/dist/execution/invocation/admission/input.d.ts +2 -2
- package/dist/execution/invocation/admission/input.js +16 -2
- package/dist/execution/invocation/admission/target.d.ts +11 -0
- package/dist/execution/invocation/admission/target.js +22 -3
- package/dist/execution/invocation/capabilities/bind.d.ts +11 -0
- package/dist/execution/invocation/capabilities/bind.js +25 -0
- package/dist/execution/invocation/capabilities/index.d.ts +1 -0
- package/dist/execution/invocation/capabilities/index.js +1 -0
- 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 +11 -44
- package/dist/execution/invocation/dispatch/workflow.js +0 -4
- package/dist/execution/invocation/handler.js +8 -2
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/integration/authentication.d.ts +3 -3
- package/dist/execution/invocation/integration/authentication.js +7 -7
- package/dist/execution/invocation/integration/call.d.ts +2 -1
- package/dist/execution/invocation/integration/call.js +3 -3
- package/dist/execution/invocation/integration/clients.d.ts +1 -1
- package/dist/execution/invocation/integration/index.d.ts +1 -0
- package/dist/execution/invocation/integration/index.js +1 -0
- package/dist/execution/invocation/invocation.d.ts +6 -0
- package/dist/execution/invocation/invocation.js +129 -21
- package/dist/execution/invocation/lifecycle/active.d.ts +8 -2
- package/dist/execution/invocation/lifecycle/active.js +3 -3
- package/dist/execution/invocation/lifecycle/index.d.ts +1 -1
- 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 +18 -4
- package/dist/execution/serve.js +10 -0
- package/dist/execution/service/create.js +43 -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 +20 -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/attempts.d.ts +87 -0
- package/dist/execution/workflows/attempts.js +205 -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 +83 -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 +39 -0
- package/dist/execution/workflows/failure.js +143 -0
- package/dist/execution/workflows/index.d.ts +4 -0
- package/dist/execution/workflows/index.js +3 -0
- package/dist/execution/workflows/integrations.d.ts +13 -0
- package/dist/execution/workflows/integrations.js +25 -0
- package/dist/execution/workflows/options.d.ts +81 -0
- package/dist/execution/workflows/options.js +158 -0
- package/dist/execution/workflows/receiver.d.ts +24 -0
- package/dist/execution/workflows/receiver.js +99 -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 +23 -0
- package/dist/execution/workflows/run.js +365 -0
- package/dist/execution/workflows/steps.d.ts +48 -0
- package/dist/execution/workflows/steps.js +93 -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/durable/engine.d.ts +128 -0
- package/dist/testing/durable/engine.js +619 -0
- package/dist/testing/durable/index.d.ts +3 -0
- package/dist/testing/durable/index.js +1 -0
- package/dist/testing/durable/steps.d.ts +30 -0
- package/dist/testing/durable/steps.js +45 -0
- package/dist/testing/index.d.ts +6 -1
- package/dist/testing/index.js +5 -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 +5 -5
- package/dist/tooling/cli/dotenv.js +6 -36
- 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 -2
- package/dist/tooling/cli/log.js +9 -2
- 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/adapters/typescript/imports.d.ts +0 -1
- package/dist/tooling/linter/adapters/typescript/imports.js +1 -5
- package/dist/tooling/linter/adapters/typescript/index.d.ts +1 -1
- package/dist/tooling/linter/adapters/typescript/index.js +1 -1
- package/dist/tooling/linter/adapters/typescript/syntax.d.ts +3 -3
- package/dist/tooling/linter/adapters/typescript/syntax.js +13 -25
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -2
- package/dist/tooling/linter/implementations/source/callable-requirements.js +11 -16
- package/dist/tooling/linter/implementations/source/dependencies.js +13 -72
- package/dist/tooling/linter/implementations/source/global.js +1 -2
- package/dist/tooling/linter/implementations/source/mutations.js +18 -29
- package/dist/tooling/linter/implementations/source/providers.js +5 -5
- package/dist/tooling/linter/implementations/source/queries.js +1 -17
- package/dist/tooling/linter/implementations/source/shared.d.ts +12 -4
- package/dist/tooling/linter/implementations/source/shared.js +101 -46
- package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
- package/dist/tooling/linter/implementations/source/views.js +2 -2
- package/dist/tooling/linter/implementations/source/workflows.js +499 -17
- package/dist/tooling/linter/policy/generated.js +14 -63
- package/dist/tooling/linter/requirements/registry.js +6 -8
- 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/docs/admission-age.md +88 -0
- package/docs/auth-api-migration.md +55 -0
- package/docs/business-errors.md +42 -0
- package/docs/domain-definition-migration.md +44 -0
- package/docs/domain-schema-migration.md +36 -0
- package/docs/durable-workflows.md +445 -0
- package/docs/handler-dependencies.md +213 -0
- package/docs/release.md +155 -0
- package/docs/schema-cost.md +124 -0
- package/package.json +45 -16
- 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,108 @@
|
|
|
1
|
+
import { RegistryCliError } from './error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decode one `astrale.installed-list` v1 document: the instance Kernel that answered, whether the
|
|
4
|
+
* listing may omit installations (`partial`, required) and the deployment URL of each
|
|
5
|
+
* installation. Anything else is refused.
|
|
6
|
+
*/
|
|
7
|
+
export function decodeInstanceListing(document) {
|
|
8
|
+
if (document.format !== 'astrale.installed-list' ||
|
|
9
|
+
document.version !== 1 ||
|
|
10
|
+
!httpUrl(document.kernel) ||
|
|
11
|
+
typeof document.partial !== 'boolean' ||
|
|
12
|
+
!Array.isArray(document.domains)) {
|
|
13
|
+
throw protocolError('Astrale CLI answered no installed list of the instance.');
|
|
14
|
+
}
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
kind: 'listed',
|
|
17
|
+
kernel: document.kernel,
|
|
18
|
+
partial: document.partial,
|
|
19
|
+
installations: Object.freeze(document.domains.map((entry) => {
|
|
20
|
+
if (!isRecord(entry) || !text(entry.origin) || !httpUrl(entry.url)) {
|
|
21
|
+
throw protocolError('Astrale CLI answered a malformed installation of the instance.');
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze({ origin: entry.origin, url: entry.url });
|
|
24
|
+
})),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Why an instance listing failed, from the machine error the CLI printed on stderr (the last line
|
|
29
|
+
* that is a JSON object with an `error` code): only that code is read, never its message, since
|
|
30
|
+
* stderr may name the caller's credential. A Kernel without the listing is `unsupported`; a timeout
|
|
31
|
+
* at any phase is `timeout`; a Kernel refusal is `refused`; anything else, a command that printed
|
|
32
|
+
* no machine error and a failed read of Admin's registry (`isAdminFailure`) included, is
|
|
33
|
+
* `unavailable`.
|
|
34
|
+
*/
|
|
35
|
+
export function instanceRefusal(stderr) {
|
|
36
|
+
const failure = machineError(stderr);
|
|
37
|
+
if (failure === undefined) {
|
|
38
|
+
return unknown('unavailable', 'REGISTRY_CLI_FAILED');
|
|
39
|
+
}
|
|
40
|
+
const code = admittedCode(failure.error);
|
|
41
|
+
if (code === 'KERNEL_RELEASE_UNSUPPORTED')
|
|
42
|
+
return unknown('unsupported', code);
|
|
43
|
+
if (failure.phase === 'timeout')
|
|
44
|
+
return unknown('timeout', code);
|
|
45
|
+
if (code === 'RESPONSE_ERROR')
|
|
46
|
+
return unknown('refused', code);
|
|
47
|
+
return unknown('unavailable', code);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Whether an instance listing failed on Admin's side, not the instance's: the listing also reads
|
|
51
|
+
* Admin's registry to name what runs there, and fails as a whole when that read fails (CT24, C7).
|
|
52
|
+
* Its codes are Admin's (`REGISTRY_*`, `ADMIN_*`), never the SDK's own `REGISTRY_CLI_*`.
|
|
53
|
+
*/
|
|
54
|
+
export function isAdminFailure(code) {
|
|
55
|
+
return ((code.startsWith('REGISTRY_') && !code.startsWith('REGISTRY_CLI_')) || code.startsWith('ADMIN_'));
|
|
56
|
+
}
|
|
57
|
+
/** The instance did not answer within the probe's time. */
|
|
58
|
+
export function instanceTimeout() {
|
|
59
|
+
return unknown('timeout', 'REGISTRY_CLI_TIMEOUT');
|
|
60
|
+
}
|
|
61
|
+
/** The CLI answered the instance listing with something this SDK cannot read. */
|
|
62
|
+
export function instanceUnreadable() {
|
|
63
|
+
return unknown('unavailable', 'REGISTRY_CLI_PROTOCOL');
|
|
64
|
+
}
|
|
65
|
+
function unknown(reason, code) {
|
|
66
|
+
return Object.freeze({ kind: 'unknown', reason, code });
|
|
67
|
+
}
|
|
68
|
+
function machineError(stderr) {
|
|
69
|
+
const lines = stderr.split('\n').map((line) => line.trim());
|
|
70
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
71
|
+
const line = lines[index];
|
|
72
|
+
if (!line.startsWith('{'))
|
|
73
|
+
continue;
|
|
74
|
+
try {
|
|
75
|
+
const value = JSON.parse(line);
|
|
76
|
+
if (isRecord(value) && typeof value.error === 'string') {
|
|
77
|
+
return { error: value.error, phase: value.phase };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// A human line that happens to start with a brace: keep looking upwards.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
function protocolError(message) {
|
|
87
|
+
return new RegistryCliError('REGISTRY_CLI_PROTOCOL', message);
|
|
88
|
+
}
|
|
89
|
+
function admittedCode(input) {
|
|
90
|
+
return /^[A-Z][A-Z0-9_]{0,63}$/u.test(input) ? input : 'REGISTRY_CLI_FAILED';
|
|
91
|
+
}
|
|
92
|
+
function httpUrl(input) {
|
|
93
|
+
if (typeof input !== 'string')
|
|
94
|
+
return false;
|
|
95
|
+
try {
|
|
96
|
+
const url = new URL(input);
|
|
97
|
+
return url.protocol === 'https:' || url.protocol === 'http:';
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function text(input) {
|
|
104
|
+
return typeof input === 'string' && input.length > 0;
|
|
105
|
+
}
|
|
106
|
+
function isRecord(input) {
|
|
107
|
+
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
108
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface RegistryProcessInput {
|
|
2
|
+
readonly executable: string;
|
|
3
|
+
readonly args: readonly string[];
|
|
4
|
+
readonly projectDir: string;
|
|
5
|
+
readonly signal: AbortSignal;
|
|
6
|
+
readonly timeoutMs: number;
|
|
7
|
+
/** Bytes of stdout kept before the child is stopped; a registry index can be large. */
|
|
8
|
+
readonly stdoutLimit: number;
|
|
9
|
+
/** One document written to the child's stdin, such as a publish request; none by default. */
|
|
10
|
+
readonly stdin?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Bytes of stderr kept, for a caller that reads the machine error code a command without a
|
|
13
|
+
* stdout refusal document prints there (`astrale domain list -i --json`). The CLI prints that
|
|
14
|
+
* error last, after any human lines, so the last bytes are kept and older ones dropped. Absent,
|
|
15
|
+
* stderr is never kept.
|
|
16
|
+
*/
|
|
17
|
+
readonly stderrLimit?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface RegistryProcessResult {
|
|
20
|
+
readonly code: number;
|
|
21
|
+
readonly stdout: string;
|
|
22
|
+
/** The kept tail of stderr, present exactly when the input set `stderrLimit`. */
|
|
23
|
+
readonly stderr?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The command did not end within its `timeoutMs`; the child was stopped. */
|
|
26
|
+
export declare class RegistryProcessTimeoutError extends Error {
|
|
27
|
+
constructor();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run one Astrale CLI registry command with bounded output and time. Stderr is drained and dropped:
|
|
31
|
+
* the CLI prints its human diagnostics there, which may name the caller's credential, and every
|
|
32
|
+
* registry command already answers with one document on stdout, its refusals included (CT29). A
|
|
33
|
+
* caller that sets `stderrLimit` gets the bounded tail back, to read a machine error code from; it
|
|
34
|
+
* never relays it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function runRegistryProcess(input: RegistryProcessInput): Promise<RegistryProcessResult>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
const TERMINATION_GRACE_MS = 1_000;
|
|
3
|
+
/** The command did not end within its `timeoutMs`; the child was stopped. */
|
|
4
|
+
export class RegistryProcessTimeoutError extends Error {
|
|
5
|
+
constructor() {
|
|
6
|
+
super('Astrale CLI command timed out.');
|
|
7
|
+
this.name = 'RegistryProcessTimeoutError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Run one Astrale CLI registry command with bounded output and time. Stderr is drained and dropped:
|
|
12
|
+
* the CLI prints its human diagnostics there, which may name the caller's credential, and every
|
|
13
|
+
* registry command already answers with one document on stdout, its refusals included (CT29). A
|
|
14
|
+
* caller that sets `stderrLimit` gets the bounded tail back, to read a machine error code from; it
|
|
15
|
+
* never relays it.
|
|
16
|
+
*/
|
|
17
|
+
export function runRegistryProcess(input) {
|
|
18
|
+
if (input.signal.aborted)
|
|
19
|
+
return Promise.reject(interruption(input.signal));
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
let child;
|
|
22
|
+
try {
|
|
23
|
+
child = spawn(input.executable, [...input.args], {
|
|
24
|
+
cwd: input.projectDir,
|
|
25
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
26
|
+
shell: false,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (cause) {
|
|
30
|
+
reject(new Error('Astrale CLI could not be started.', { cause }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const chunks = [];
|
|
34
|
+
const errors = [];
|
|
35
|
+
let stdoutBytes = 0;
|
|
36
|
+
let stderrBytes = 0;
|
|
37
|
+
let settled = false;
|
|
38
|
+
let termination;
|
|
39
|
+
let escalation;
|
|
40
|
+
const terminate = (cause) => {
|
|
41
|
+
if (settled || termination !== undefined)
|
|
42
|
+
return;
|
|
43
|
+
termination = cause;
|
|
44
|
+
child.stdin.destroy();
|
|
45
|
+
child.kill('SIGTERM');
|
|
46
|
+
escalation = setTimeout(() => {
|
|
47
|
+
if (child.exitCode === null && child.signalCode === null)
|
|
48
|
+
child.kill('SIGKILL');
|
|
49
|
+
}, TERMINATION_GRACE_MS);
|
|
50
|
+
};
|
|
51
|
+
const abort = () => terminate(interruption(input.signal));
|
|
52
|
+
const timeout = setTimeout(() => terminate(new RegistryProcessTimeoutError()), input.timeoutMs);
|
|
53
|
+
input.signal.addEventListener('abort', abort, { once: true });
|
|
54
|
+
const finish = () => {
|
|
55
|
+
settled = true;
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
if (escalation !== undefined)
|
|
58
|
+
clearTimeout(escalation);
|
|
59
|
+
input.signal.removeEventListener('abort', abort);
|
|
60
|
+
};
|
|
61
|
+
child.stdout.on('data', (chunk) => {
|
|
62
|
+
stdoutBytes += chunk.byteLength;
|
|
63
|
+
if (stdoutBytes > input.stdoutLimit) {
|
|
64
|
+
terminate(new Error('Astrale CLI stdout exceeded the supported limit.'));
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
chunks.push(chunk);
|
|
68
|
+
});
|
|
69
|
+
const stderrLimit = input.stderrLimit;
|
|
70
|
+
if (stderrLimit === undefined)
|
|
71
|
+
child.stderr.resume();
|
|
72
|
+
else {
|
|
73
|
+
// Keep the last `stderrLimit` bytes: drop whole chunks from the front once the rest covers it.
|
|
74
|
+
child.stderr.on('data', (chunk) => {
|
|
75
|
+
errors.push(chunk);
|
|
76
|
+
stderrBytes += chunk.byteLength;
|
|
77
|
+
while (errors.length > 1 && stderrBytes - errors[0].byteLength >= stderrLimit) {
|
|
78
|
+
stderrBytes -= errors.shift().byteLength;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// A child that exits before reading its stdin closes the pipe; its exit code still answers.
|
|
83
|
+
child.stdin.on('error', () => undefined);
|
|
84
|
+
child.once('error', (cause) => {
|
|
85
|
+
if (settled)
|
|
86
|
+
return;
|
|
87
|
+
finish();
|
|
88
|
+
reject(termination ?? new Error('Astrale CLI could not be started.', { cause }));
|
|
89
|
+
});
|
|
90
|
+
child.once('close', (code) => {
|
|
91
|
+
if (settled)
|
|
92
|
+
return;
|
|
93
|
+
finish();
|
|
94
|
+
if (termination !== undefined) {
|
|
95
|
+
reject(termination);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
resolve(Object.freeze({
|
|
99
|
+
code: code ?? 1,
|
|
100
|
+
stdout: Buffer.concat(chunks).toString('utf8'),
|
|
101
|
+
...(stderrLimit === undefined ? {} : { stderr: stderrTail(errors, stderrLimit) }),
|
|
102
|
+
}));
|
|
103
|
+
});
|
|
104
|
+
child.stdin.end(input.stdin);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The last `limit` bytes of stderr as text. A cut through a multi-byte character only spoils the
|
|
109
|
+
* first kept line, never the machine error the CLI prints last.
|
|
110
|
+
*/
|
|
111
|
+
function stderrTail(chunks, limit) {
|
|
112
|
+
const kept = Buffer.concat(chunks);
|
|
113
|
+
return kept.subarray(Math.max(0, kept.byteLength - limit)).toString('utf8');
|
|
114
|
+
}
|
|
115
|
+
function interruption(signal) {
|
|
116
|
+
return signal.reason instanceof Error
|
|
117
|
+
? signal.reason
|
|
118
|
+
: new Error('Project operation interrupted.');
|
|
119
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Runtime } from '../../application/runtime/index.js';
|
|
2
|
+
import type { Adapter } from '../../deployment/adapter/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The secrets one Environment's deployment binds: the values of the secrets file its adapter
|
|
5
|
+
* declares. An Integration-free Runtime has no Providers and therefore no author-owned secrets, so
|
|
6
|
+
* its file may be absent; adapter-owned secrets, such as a signing identity, are the adapter's to
|
|
7
|
+
* resolve and never make this file required.
|
|
8
|
+
*/
|
|
9
|
+
export declare function environmentSecrets(adapter: Adapter<object>, parameters: object, projectDir: string, runtime: Runtime): Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { isAbsolute, join } from 'node:path';
|
|
3
|
+
import { loadDeclaredSecrets } from './dotenv.js';
|
|
4
|
+
/**
|
|
5
|
+
* The secrets one Environment's deployment binds: the values of the secrets file its adapter
|
|
6
|
+
* declares. An Integration-free Runtime has no Providers and therefore no author-owned secrets, so
|
|
7
|
+
* its file may be absent; adapter-owned secrets, such as a signing identity, are the adapter's to
|
|
8
|
+
* resolve and never make this file required.
|
|
9
|
+
*/
|
|
10
|
+
export function environmentSecrets(adapter, parameters, projectDir, runtime) {
|
|
11
|
+
const file = adapter.secretsFile?.(parameters);
|
|
12
|
+
if (file === undefined)
|
|
13
|
+
return Object.freeze({});
|
|
14
|
+
const path = isAbsolute(file) ? file : join(projectDir, file);
|
|
15
|
+
if (Object.keys(runtime.integrations).length === 0 && !existsSync(path)) {
|
|
16
|
+
return Object.freeze({});
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(loadDeclaredSecrets(path, file));
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Version } from '../../platform/versioning/index.js';
|
|
2
|
+
import type { DomainRegistry } from './registry/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* `astrale-domain yank <version> [--undo] --json` on stdout (CT30): the yank state Admin now holds
|
|
5
|
+
* for one published version of the Project's Domain. `changed` when this call yanked or restored
|
|
6
|
+
* it, `unchanged` when it already was in that state.
|
|
7
|
+
*/
|
|
8
|
+
export interface YankReportV1 {
|
|
9
|
+
readonly format: 'astrale.yank-report';
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
readonly origin: string;
|
|
12
|
+
readonly publication: {
|
|
13
|
+
readonly version: string;
|
|
14
|
+
readonly yanked: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly status: 'changed' | 'unchanged';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Yank one published version of `origin`, or restore it with `undo`, in the Admin registry. A
|
|
20
|
+
* yank only takes the version out of resolution: its installations keep running and its
|
|
21
|
+
* deployment keeps serving (tech [.72368]). Idempotent: a rerun answers `unchanged`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function yankPublication(input: {
|
|
24
|
+
readonly origin: string;
|
|
25
|
+
readonly version: Version;
|
|
26
|
+
readonly undo: boolean;
|
|
27
|
+
readonly projectDir: string;
|
|
28
|
+
readonly signal: AbortSignal;
|
|
29
|
+
}, open?: (input: {
|
|
30
|
+
readonly projectDir: string;
|
|
31
|
+
readonly signal: AbortSignal;
|
|
32
|
+
}) => Promise<Pick<DomainRegistry, 'yank'>>): Promise<YankReportV1>;
|
|
33
|
+
/** The one line a person reads for a report. */
|
|
34
|
+
export declare function yankSummary(report: YankReportV1): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { openDomainRegistry } from './registry/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Yank one published version of `origin`, or restore it with `undo`, in the Admin registry. A
|
|
4
|
+
* yank only takes the version out of resolution: its installations keep running and its
|
|
5
|
+
* deployment keeps serving (tech [.72368]). Idempotent: a rerun answers `unchanged`.
|
|
6
|
+
*/
|
|
7
|
+
export async function yankPublication(input, open = openDomainRegistry) {
|
|
8
|
+
const registry = await open({ projectDir: input.projectDir, signal: input.signal });
|
|
9
|
+
const outcome = await registry.yank(input.origin, input.version, { undo: input.undo });
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
format: 'astrale.yank-report',
|
|
12
|
+
version: 1,
|
|
13
|
+
origin: input.origin,
|
|
14
|
+
publication: Object.freeze({
|
|
15
|
+
version: outcome.publication.version,
|
|
16
|
+
yanked: outcome.publication.yanked,
|
|
17
|
+
}),
|
|
18
|
+
status: outcome.status,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** The one line a person reads for a report. */
|
|
22
|
+
export function yankSummary(report) {
|
|
23
|
+
const name = `${report.origin}@${report.publication.version}`;
|
|
24
|
+
if (report.publication.yanked) {
|
|
25
|
+
return report.status === 'changed'
|
|
26
|
+
? `Yanked ${name}: line references no longer choose it; its installations and its deployment keep running.`
|
|
27
|
+
: `${name} was already yanked.`;
|
|
28
|
+
}
|
|
29
|
+
return report.status === 'changed'
|
|
30
|
+
? `Restored ${name}: line references can choose it again.`
|
|
31
|
+
: `${name} was not yanked.`;
|
|
32
|
+
}
|
|
@@ -3,4 +3,3 @@ import type { SourceProject, SourceDependencyIssue, SourceFile, SourceImport } f
|
|
|
3
3
|
export declare function collectImports(source: ts.SourceFile): SourceImport[];
|
|
4
4
|
export declare function collectDependencyIssues(source: ts.SourceFile): SourceDependencyIssue[];
|
|
5
5
|
export declare function resolveProjectImport(project: SourceProject, importer: SourceFile, specifier: string): SourceFile | undefined;
|
|
6
|
-
export declare function isWithin(directory: string, path: string): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dirname, extname,
|
|
1
|
+
import { dirname, extname, join, relative, resolve } from 'node:path';
|
|
2
2
|
import ts from 'typescript';
|
|
3
3
|
import { isLocallyDeclared } from './syntax.js';
|
|
4
4
|
export function collectImports(source) {
|
|
@@ -166,7 +166,3 @@ function visit(node, callback) {
|
|
|
166
166
|
callback(node);
|
|
167
167
|
node.forEachChild((child) => visit(child, callback));
|
|
168
168
|
}
|
|
169
|
-
export function isWithin(directory, path) {
|
|
170
|
-
const child = relative(directory, path);
|
|
171
|
-
return child === '' || (!child.startsWith('..') && !isAbsolute(child));
|
|
172
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { discoverProject } from './discover.js';
|
|
2
2
|
export { sourceEvidenceAdmission } from './evidence-admission.js';
|
|
3
3
|
export { collectDependencyIssues, resolveProjectImport } from './imports.js';
|
|
4
|
-
export { importedSymbol, isLocallyDeclared, resolveImportedSymbol, location, objectProperty, propertyChain, staticText, unwrap, visit, } from './syntax.js';
|
|
4
|
+
export { bindingContains, importedSymbol, isLocallyDeclared, resolveImportedSymbol, location, objectProperty, propertyChain, staticText, unwrap, visit, visitOwnBody, } from './syntax.js';
|
|
5
5
|
export { assertSingleTypeUniverse } from './type-universe.js';
|
|
6
6
|
export { observeQueryDefinitions } from './query-observation.js';
|
|
7
7
|
export { queryCollectionKind } from './query-collection-type.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { discoverProject } from './discover.js';
|
|
2
2
|
export { sourceEvidenceAdmission } from './evidence-admission.js';
|
|
3
3
|
export { collectDependencyIssues, resolveProjectImport } from './imports.js';
|
|
4
|
-
export { importedSymbol, isLocallyDeclared, resolveImportedSymbol, location, objectProperty, propertyChain, staticText, unwrap, visit, } from './syntax.js';
|
|
4
|
+
export { bindingContains, importedSymbol, isLocallyDeclared, resolveImportedSymbol, location, objectProperty, propertyChain, staticText, unwrap, visit, visitOwnBody, } from './syntax.js';
|
|
5
5
|
export { assertSingleTypeUniverse } from './type-universe.js';
|
|
6
6
|
export { observeQueryDefinitions } from './query-observation.js';
|
|
7
7
|
export { queryCollectionKind } from './query-collection-type.js';
|
|
@@ -27,12 +27,12 @@ export type ImportedSymbolResolution = Readonly<{
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function resolveImportedSymbol(file: SourceFile, expression: ts.Expression): ImportedSymbolResolution;
|
|
29
29
|
export declare function isLocallyDeclared(identifier: ts.Identifier): boolean;
|
|
30
|
+
export declare function bindingContains(binding: ts.BindingName, name: string): boolean;
|
|
31
|
+
/** Visit a function body, without descending into the functions nested in it. */
|
|
32
|
+
export declare function visitOwnBody(fn: ts.FunctionLikeDeclaration, callback: (node: ts.Node) => void): void;
|
|
30
33
|
export declare function unwrap(expression: ts.Expression): ts.Expression;
|
|
31
34
|
export declare function staticText(expression: ts.Expression | undefined): string | undefined;
|
|
32
35
|
export declare function objectProperty(object: ts.ObjectLiteralExpression | undefined, name: string): ts.ObjectLiteralElementLike | undefined;
|
|
33
36
|
export declare function propertyName(name: ts.PropertyName): string | undefined;
|
|
34
|
-
export declare function callbackOf(property: ts.ObjectLiteralElementLike | undefined): ts.FunctionLikeDeclaration | undefined;
|
|
35
|
-
export declare function objectArgument(call: ts.CallExpression): ts.ObjectLiteralExpression | undefined;
|
|
36
|
-
export declare function isImportedCall(file: SourceFile, node: ts.Node, modules: ReadonlySet<string>, name: string): node is ts.CallExpression;
|
|
37
37
|
export declare function propertyChain(expression: ts.Expression): readonly string[] | undefined;
|
|
38
38
|
export declare function containingFunction(node: ts.Node): ts.FunctionLikeDeclaration | undefined;
|
|
@@ -103,11 +103,23 @@ function statementDeclares(statement, name) {
|
|
|
103
103
|
}
|
|
104
104
|
return false;
|
|
105
105
|
}
|
|
106
|
-
function bindingContains(binding, name) {
|
|
106
|
+
export function bindingContains(binding, name) {
|
|
107
107
|
if (ts.isIdentifier(binding))
|
|
108
108
|
return binding.text === name;
|
|
109
109
|
return binding.elements.some((element) => !ts.isOmittedExpression(element) && bindingContains(element.name, name));
|
|
110
110
|
}
|
|
111
|
+
/** Visit a function body, without descending into the functions nested in it. */
|
|
112
|
+
export function visitOwnBody(fn, callback) {
|
|
113
|
+
if (!fn.body)
|
|
114
|
+
return;
|
|
115
|
+
const walk = (node) => {
|
|
116
|
+
callback(node);
|
|
117
|
+
if (node !== fn.body && ts.isFunctionLike(node))
|
|
118
|
+
return;
|
|
119
|
+
node.forEachChild(walk);
|
|
120
|
+
};
|
|
121
|
+
walk(fn.body);
|
|
122
|
+
}
|
|
111
123
|
export function unwrap(expression) {
|
|
112
124
|
let current = expression;
|
|
113
125
|
while (ts.isParenthesizedExpression(current) ||
|
|
@@ -138,30 +150,6 @@ export function propertyName(name) {
|
|
|
138
150
|
return name.text;
|
|
139
151
|
return ts.isComputedPropertyName(name) ? staticText(name.expression) : undefined;
|
|
140
152
|
}
|
|
141
|
-
export function callbackOf(property) {
|
|
142
|
-
if (!property)
|
|
143
|
-
return undefined;
|
|
144
|
-
if (ts.isMethodDeclaration(property))
|
|
145
|
-
return property;
|
|
146
|
-
if (ts.isPropertyAssignment(property)) {
|
|
147
|
-
const value = unwrap(property.initializer);
|
|
148
|
-
if (ts.isArrowFunction(value) || ts.isFunctionExpression(value))
|
|
149
|
-
return value;
|
|
150
|
-
}
|
|
151
|
-
return undefined;
|
|
152
|
-
}
|
|
153
|
-
export function objectArgument(call) {
|
|
154
|
-
const value = call.arguments[0];
|
|
155
|
-
return value && ts.isObjectLiteralExpression(unwrap(value))
|
|
156
|
-
? unwrap(value)
|
|
157
|
-
: undefined;
|
|
158
|
-
}
|
|
159
|
-
export function isImportedCall(file, node, modules, name) {
|
|
160
|
-
if (!ts.isCallExpression(node))
|
|
161
|
-
return false;
|
|
162
|
-
const symbol = importedSymbol(file, node.expression);
|
|
163
|
-
return symbol?.name === name && modules.has(symbol.module);
|
|
164
|
-
}
|
|
165
153
|
export function propertyChain(expression) {
|
|
166
154
|
const target = unwrap(expression);
|
|
167
155
|
if (ts.isIdentifier(target))
|
|
@@ -10,7 +10,7 @@ export interface FunctionRequirements {
|
|
|
10
10
|
readonly keys: ReadonlySet<string>;
|
|
11
11
|
readonly indeterminate: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function domainFunctionRequirements(project: SourceProject): FunctionRequirements;
|
|
14
14
|
export declare function requiredCallable(project: SourceProject, file: SourceFile, input: ts.Expression): Pick<RemoteCallable, 'module' | 'selector'> | undefined;
|
|
15
15
|
export declare function declaredDomainDependencies(project: SourceProject): {
|
|
16
16
|
readonly aliases: ReadonlyMap<string, string>;
|
|
@@ -25,4 +25,3 @@ export declare function callableReference(expression: ts.Expression): {
|
|
|
25
25
|
};
|
|
26
26
|
/** Resolve only one immutable lexical alias; the linter does not emulate program execution. */
|
|
27
27
|
export declare function lexicalConstInitializer(identifier: ts.Identifier): ts.Expression | undefined;
|
|
28
|
-
export declare function bindingContains(binding: ts.BindingName, name: string): boolean;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import { objectProperty, resolveImportedSymbol, resolveProjectImport, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
2
|
+
import { bindingContains, objectProperty, resolveImportedSymbol, resolveProjectImport, unwrap, visit, } from '../../adapters/typescript/index.js';
|
|
3
3
|
import { definitionObjects, DSL_MODULES, production, propertyExpression } from './shared.js';
|
|
4
|
-
export function
|
|
5
|
-
const
|
|
6
|
-
const file =
|
|
4
|
+
export function domainFunctionRequirements(project) {
|
|
5
|
+
const domainPath = project.policy.rootFiles.find(({ id }) => id === 'domain')?.sourcePath;
|
|
6
|
+
const file = domainPath && project.filesByPath.get(domainPath);
|
|
7
7
|
if (!file)
|
|
8
8
|
return { keys: new Set(), indeterminate: true };
|
|
9
|
-
const
|
|
9
|
+
const definitions = [];
|
|
10
10
|
visit(file.source, (node) => {
|
|
11
11
|
if (!ts.isCallExpression(node))
|
|
12
12
|
return;
|
|
13
13
|
const symbol = resolveImportedSymbol(file, node.expression);
|
|
14
14
|
if (symbol.kind === 'resolved' &&
|
|
15
|
-
symbol.name === '
|
|
16
|
-
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/
|
|
17
|
-
|
|
15
|
+
symbol.name === 'defineDomain' &&
|
|
16
|
+
(symbol.module === '@astrale-os/sdk' || symbol.module === '@astrale-os/sdk/domain')) {
|
|
17
|
+
definitions.push(node);
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
if (
|
|
20
|
+
if (definitions.length !== 1)
|
|
21
21
|
return { keys: new Set(), indeterminate: true };
|
|
22
|
-
const input =
|
|
22
|
+
const input = definitions[0].arguments[0];
|
|
23
23
|
if (!input || !ts.isObjectLiteralExpression(unwrap(input))) {
|
|
24
24
|
return { keys: new Set(), indeterminate: true };
|
|
25
25
|
}
|
|
@@ -40,7 +40,7 @@ export function applicationFunctionRequirements(project) {
|
|
|
40
40
|
if (requirementsSymbol.kind !== 'resolved' ||
|
|
41
41
|
requirementsSymbol.name !== 'requirements' ||
|
|
42
42
|
(requirementsSymbol.module !== '@astrale-os/sdk' &&
|
|
43
|
-
requirementsSymbol.module !== '@astrale-os/sdk/
|
|
43
|
+
requirementsSymbol.module !== '@astrale-os/sdk/domain')) {
|
|
44
44
|
return { keys: new Set(), indeterminate: true };
|
|
45
45
|
}
|
|
46
46
|
const definition = requirementsCall.arguments[0];
|
|
@@ -227,8 +227,3 @@ export function lexicalConstInitializer(identifier) {
|
|
|
227
227
|
}
|
|
228
228
|
return undefined;
|
|
229
229
|
}
|
|
230
|
-
export function bindingContains(binding, name) {
|
|
231
|
-
if (ts.isIdentifier(binding))
|
|
232
|
-
return binding.text === name;
|
|
233
|
-
return binding.elements.some((element) => !ts.isOmittedExpression(element) && bindingContains(element.name, name));
|
|
234
|
-
}
|