@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,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { issuer } from '../../../platform/auth/index.js';
|
|
2
2
|
import { bindSession } from '../../../platform/client/session/index.js';
|
|
3
3
|
import { NodeId } from '../../../platform/graph/node/index.js';
|
|
4
4
|
import { protocolError } from '../result/index.js';
|
|
5
5
|
import { requireVia } from './authority.js';
|
|
6
|
-
const ANONYMOUS = Object.freeze({
|
|
7
|
-
|
|
8
|
-
kernel: null,
|
|
9
|
-
graph: null,
|
|
10
|
-
close() { },
|
|
11
|
-
});
|
|
12
|
-
export async function authentication(callable, request, release, domain, authority) {
|
|
6
|
+
const ANONYMOUS = Object.freeze({ kind: 'anonymous' });
|
|
7
|
+
export async function authentication(callable, request, domain, authority) {
|
|
13
8
|
const credential = request.credential;
|
|
14
|
-
if (callable.auth === 'anonymous' && credential === undefined)
|
|
15
|
-
return
|
|
9
|
+
if (callable.auth === 'anonymous' && credential === undefined) {
|
|
10
|
+
return anonymous(await authority.self({ via: requireVia(request), domain, context: request.context }));
|
|
11
|
+
}
|
|
16
12
|
if (credential === undefined) {
|
|
17
13
|
throw protocolError('AUTH_MISSING', 'Authentication is required.');
|
|
18
14
|
}
|
|
@@ -21,7 +17,6 @@ export async function authentication(callable, request, release, domain, authori
|
|
|
21
17
|
const authenticated = await authority.authenticate({
|
|
22
18
|
credential,
|
|
23
19
|
via: requireVia(request),
|
|
24
|
-
publication: release.publication,
|
|
25
20
|
domain,
|
|
26
21
|
context: request.context,
|
|
27
22
|
});
|
|
@@ -36,34 +31,54 @@ export async function authentication(callable, request, release, domain, authori
|
|
|
36
31
|
invalid();
|
|
37
32
|
}
|
|
38
33
|
const caller = admitCaller(authenticated.caller);
|
|
39
|
-
const graphInput = admitGraph(authenticated.graph);
|
|
34
|
+
const graphInput = admitGraph(authenticated.graph, ['caller', 'self']);
|
|
40
35
|
const graph = Object.freeze({
|
|
41
36
|
caller: bindSession(graphInput.caller),
|
|
42
37
|
self: bindSession(graphInput.self),
|
|
43
|
-
union: bindSession(graphInput.union),
|
|
44
38
|
});
|
|
45
39
|
return Object.freeze({ caller, graph, close });
|
|
46
40
|
}
|
|
47
41
|
catch (cause) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
rejectClosing(close, cause);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** Admit the Domain's own capabilities for a call that carries no credential. */
|
|
46
|
+
function anonymous(own) {
|
|
47
|
+
let close;
|
|
48
|
+
try {
|
|
49
|
+
close = captureClose(own);
|
|
50
|
+
if (own === null ||
|
|
51
|
+
typeof own !== 'object' ||
|
|
52
|
+
Array.isArray(own) ||
|
|
53
|
+
Reflect.ownKeys(own).some((key) => key !== 'graph' && key !== 'close') ||
|
|
54
|
+
close === undefined) {
|
|
55
|
+
invalid();
|
|
55
56
|
}
|
|
57
|
+
const graph = Object.freeze({ self: bindSession(admitGraph(own.graph, ['self']).self) });
|
|
58
|
+
return Object.freeze({ caller: ANONYMOUS, graph, close });
|
|
59
|
+
}
|
|
60
|
+
catch (cause) {
|
|
61
|
+
rejectClosing(close, cause);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Release whatever the authority opened before refusing its invalid capabilities. */
|
|
65
|
+
function rejectClosing(close, cause) {
|
|
66
|
+
if (close === undefined)
|
|
56
67
|
invalid(cause);
|
|
68
|
+
try {
|
|
69
|
+
close();
|
|
70
|
+
}
|
|
71
|
+
catch (cleanup) {
|
|
72
|
+
throw new AggregateError([cause, cleanup], 'Invocation authority returned invalid capabilities and cleanup failed.');
|
|
57
73
|
}
|
|
74
|
+
invalid(cause);
|
|
58
75
|
}
|
|
59
|
-
function admitGraph(input) {
|
|
76
|
+
function admitGraph(input, modes) {
|
|
60
77
|
if (input === null ||
|
|
61
78
|
typeof input !== 'object' ||
|
|
62
79
|
Array.isArray(input) ||
|
|
63
|
-
!Object.hasOwn(input,
|
|
64
|
-
|
|
65
|
-
!Object.hasOwn(input, 'union') ||
|
|
66
|
-
Reflect.ownKeys(input).some((key) => key !== 'caller' && key !== 'self' && key !== 'union')) {
|
|
80
|
+
modes.some((mode) => !Object.hasOwn(input, mode)) ||
|
|
81
|
+
Reflect.ownKeys(input).some((key) => !modes.includes(key))) {
|
|
67
82
|
invalid();
|
|
68
83
|
}
|
|
69
84
|
return input;
|
|
@@ -79,29 +94,18 @@ function admitCaller(input) {
|
|
|
79
94
|
invalid();
|
|
80
95
|
if (!Object.hasOwn(input, 'kind') ||
|
|
81
96
|
!Object.hasOwn(input, 'principal') ||
|
|
82
|
-
!Object.hasOwn(input, '
|
|
97
|
+
!Object.hasOwn(input, 'identity') ||
|
|
83
98
|
!Object.hasOwn(input, 'authentication') ||
|
|
84
|
-
Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== '
|
|
99
|
+
Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'principal' && key !== 'identity' && key !== 'authentication') ||
|
|
85
100
|
Reflect.get(input, 'kind') !== 'authenticated') {
|
|
86
101
|
invalid();
|
|
87
102
|
}
|
|
88
|
-
|
|
89
|
-
const authority = grant.accept(Reflect.get(input, 'authority'));
|
|
90
|
-
const authentication = admitEvidence(Reflect.get(input, 'authentication'));
|
|
91
|
-
const caller = {
|
|
103
|
+
return Object.freeze({
|
|
92
104
|
kind: 'authenticated',
|
|
93
|
-
get identity
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return authority.expr.id;
|
|
98
|
-
},
|
|
99
|
-
principal,
|
|
100
|
-
authority,
|
|
101
|
-
authentication,
|
|
102
|
-
};
|
|
103
|
-
Object.defineProperty(caller, 'identity', { enumerable: false });
|
|
104
|
-
return Object.freeze(caller);
|
|
105
|
+
identity: NodeId(Reflect.get(input, 'identity')),
|
|
106
|
+
principal: NodeId(Reflect.get(input, 'principal')),
|
|
107
|
+
authentication: admitEvidence(Reflect.get(input, 'authentication')),
|
|
108
|
+
});
|
|
105
109
|
}
|
|
106
110
|
function admitEvidence(input) {
|
|
107
111
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
@@ -148,6 +152,6 @@ function optionalTime(input) {
|
|
|
148
152
|
return input === undefined || (typeof input === 'number' && Number.isFinite(input));
|
|
149
153
|
}
|
|
150
154
|
function invalid(cause) {
|
|
151
|
-
const message = 'Invocation authority returned invalid
|
|
155
|
+
const message = 'Invocation authority returned invalid capabilities.';
|
|
152
156
|
throw cause === undefined ? new TypeError(message) : new TypeError(message, { cause });
|
|
153
157
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type * as invocation from '@astrale-os/kernel-protocol/invocation';
|
|
2
|
-
import type * as publication from '@astrale-os/kernel-protocol/publication';
|
|
3
2
|
import type { HandlerRequest, InvocationContext } from '@astrale-os/kernel-server';
|
|
4
3
|
import type { AuthenticatedCaller } from '../../../application/action/index.js';
|
|
5
4
|
import type { BoundClientSession } from '../../../platform/client/session/index.js';
|
|
@@ -8,27 +7,50 @@ export interface InvocationAdmissionInput {
|
|
|
8
7
|
readonly call: invocation.Call;
|
|
9
8
|
readonly credential?: string;
|
|
10
9
|
readonly via: invocation.Via;
|
|
11
|
-
readonly publication: publication.Publication;
|
|
12
10
|
readonly domain: Domain;
|
|
13
11
|
readonly context: InvocationContext;
|
|
14
12
|
}
|
|
15
13
|
export interface InvocationAuthenticationInput {
|
|
16
14
|
readonly credential: string;
|
|
17
15
|
readonly via: invocation.Via;
|
|
18
|
-
readonly
|
|
16
|
+
readonly domain: Domain;
|
|
17
|
+
readonly context: InvocationContext;
|
|
18
|
+
}
|
|
19
|
+
export interface InvocationSelfInput {
|
|
20
|
+
readonly via: invocation.Via;
|
|
19
21
|
readonly domain: Domain;
|
|
20
22
|
readonly context: InvocationContext;
|
|
21
23
|
}
|
|
22
24
|
/** Authenticated capabilities before the SDK admits and derives application caller context. */
|
|
23
25
|
export interface AuthenticatedInvocation {
|
|
24
|
-
readonly caller:
|
|
25
|
-
readonly graph: Readonly<Record<'caller' | 'self'
|
|
26
|
+
readonly caller: AuthenticatedCaller;
|
|
27
|
+
readonly graph: Readonly<Record<'caller' | 'self', BoundClientSession>>;
|
|
28
|
+
close(): void;
|
|
29
|
+
}
|
|
30
|
+
/** The Domain's own capabilities, before the SDK admits them for a call without a credential. */
|
|
31
|
+
export interface SelfInvocation {
|
|
32
|
+
readonly graph: Readonly<Record<'self', BoundClientSession>>;
|
|
26
33
|
close(): void;
|
|
27
34
|
}
|
|
28
35
|
export interface InvocationAuthority {
|
|
36
|
+
/**
|
|
37
|
+
* The source Kernel's `Function.admit` of a remote call: resolves to the admitted target, or
|
|
38
|
+
* rejects with the public refusal. A refusal whose reason is `FUNCTION_MISS` (the Kernel no longer
|
|
39
|
+
* places the call on this deployment) is answered as the reserved miss, never as an error.
|
|
40
|
+
*/
|
|
29
41
|
admit(input: InvocationAdmissionInput): Promise<unknown>;
|
|
30
42
|
authenticate(input: InvocationAuthenticationInput): Promise<AuthenticatedInvocation>;
|
|
43
|
+
/**
|
|
44
|
+
* The Domain's own authority toward the source Kernel, for an admitted call to an `anonymous`
|
|
45
|
+
* callable that carries no credential: its handler acts as the installed Domain, never as a
|
|
46
|
+
* caller.
|
|
47
|
+
*/
|
|
48
|
+
self(input: InvocationSelfInput): Promise<SelfInvocation>;
|
|
31
49
|
}
|
|
32
|
-
/** Capture the execution Identity capability and receiver-bind
|
|
50
|
+
/** Capture the execution Identity capability and receiver-bind its privileged operations. */
|
|
33
51
|
export declare function authority(input: InvocationAuthority): InvocationAuthority;
|
|
52
|
+
/**
|
|
53
|
+
* The routed witness of a remote call, already admitted by the Kernel Server against the served
|
|
54
|
+
* snapshot: the exact ReleaseRef of this immutable deployment.
|
|
55
|
+
*/
|
|
34
56
|
export declare function requireVia(request: HandlerRequest): invocation.Via;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { protocolError } from '../result/index.js';
|
|
2
|
-
/** Capture the execution Identity capability and receiver-bind
|
|
2
|
+
/** Capture the execution Identity capability and receiver-bind its privileged operations. */
|
|
3
3
|
export function authority(input) {
|
|
4
4
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
5
5
|
invalid();
|
|
6
|
-
if (typeof input.admit !== 'function' ||
|
|
6
|
+
if (typeof input.admit !== 'function' ||
|
|
7
|
+
typeof input.authenticate !== 'function' ||
|
|
8
|
+
typeof input.self !== 'function') {
|
|
7
9
|
invalid();
|
|
8
10
|
}
|
|
9
11
|
const receiver = Object.freeze({ ...input });
|
|
10
12
|
return Object.freeze({
|
|
11
13
|
admit: receiver.admit.bind(receiver),
|
|
12
14
|
authenticate: receiver.authenticate.bind(receiver),
|
|
15
|
+
self: receiver.self.bind(receiver),
|
|
13
16
|
});
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The routed witness of a remote call, already admitted by the Kernel Server against the served
|
|
20
|
+
* snapshot: the exact ReleaseRef of this immutable deployment.
|
|
21
|
+
*/
|
|
15
22
|
export function requireVia(request) {
|
|
16
23
|
if (request.via === undefined) {
|
|
17
24
|
throw protocolError('VALIDATION_ERROR', 'Remote invocation requires Via.');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { authority, requireVia } from './authority.js';
|
|
2
|
-
export type { AuthenticatedInvocation, InvocationAdmissionInput, InvocationAuthenticationInput, InvocationAuthority, } from './authority.js';
|
|
3
|
-
export { authentication, type InvocationAuthentication } from './authentication.js';
|
|
2
|
+
export type { AuthenticatedInvocation, InvocationAdmissionInput, InvocationAuthenticationInput, InvocationAuthority, InvocationSelfInput, SelfInvocation, } from './authority.js';
|
|
3
|
+
export { authentication, type AnonymousInvocation, type InvocationAuthentication, type InvocationSessions, } from './authentication.js';
|
|
4
4
|
export { input } from './input.js';
|
|
5
5
|
export { target, type InvocationTarget } from './target.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ResolvedCallable } from '../../../application/action/index.js';
|
|
2
|
-
export declare function input(callable: ResolvedCallable, value: unknown): void;
|
|
1
|
+
import type { ResolvedCallable, ActionBinaryInput } from '../../../application/action/index.js';
|
|
2
|
+
export declare function input(callable: ResolvedCallable, value: unknown, binary?: ActionBinaryInput): void;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { isBinaryInput } from '@astrale-os/kernel-dsl/v1/language';
|
|
2
|
+
import { validateInput, protocolError } from '../result/index.js';
|
|
3
|
+
export function input(callable, value, binary) {
|
|
4
|
+
if (isBinaryInput(callable.input)) {
|
|
5
|
+
if (binary === undefined) {
|
|
6
|
+
throw protocolError('VALIDATION_ERROR', 'Binary Function request body is required.');
|
|
7
|
+
}
|
|
8
|
+
if (!Number.isSafeInteger(binary.length) ||
|
|
9
|
+
binary.length < 0 ||
|
|
10
|
+
binary.length > callable.input.maximumBytes) {
|
|
11
|
+
throw protocolError('LIMIT_EXCEEDED', 'Binary Function request body exceeds its limit.');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
else if (binary !== undefined) {
|
|
15
|
+
throw protocolError('VALIDATION_ERROR', 'Callable does not accept a binary request body.');
|
|
16
|
+
}
|
|
3
17
|
validateInput(callable, value);
|
|
4
18
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { HandlerDependencies } from '../../../application/dependency/index.js';
|
|
2
2
|
import type { BoundClientSession } from '../../../platform/client/session/index.js';
|
|
3
3
|
import type { Domain } from '../../../platform/schema/index.js';
|
|
4
|
+
import type { InvocationSessions } from '../admission/index.js';
|
|
4
5
|
/** Bind each explicit authority to its admitted session; metadata remains inert. */
|
|
5
|
-
export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self'
|
|
6
|
+
export declare function bindDependencies<D extends Domain>(domain: D, sessions: Readonly<Record<'caller' | 'self', BoundClientSession>>): HandlerDependencies<D>;
|
|
7
|
+
export declare function bindDependencies<D extends Domain>(domain: D, sessions: InvocationSessions): HandlerDependencies<D> | HandlerDependencies<D, 'self'>;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { isBinaryInput } from '@astrale-os/kernel-dsl/v1/language';
|
|
2
3
|
import { reference } from '../../../platform/client/session/index.js';
|
|
3
4
|
import { NodeId } from '../../../platform/graph/node/index.js';
|
|
4
5
|
import { Path } from '../../../platform/graph/path/index.js';
|
|
5
|
-
/** Bind each explicit authority to its admitted session; metadata remains inert. */
|
|
6
6
|
export function bindDependencies(domain, sessions) {
|
|
7
7
|
const dependencies = Object.create(null);
|
|
8
8
|
for (const [alias, dependency] of Object.entries(domain.dependencies)) {
|
|
9
9
|
if (dependency.origin === 'kernel.astrale.ai')
|
|
10
10
|
continue;
|
|
11
11
|
dependencies[alias] = Object.freeze({
|
|
12
|
-
caller: bindDependency(dependency, sessions.caller),
|
|
12
|
+
...('caller' in sessions ? { caller: bindDependency(dependency, sessions.caller) } : {}),
|
|
13
13
|
self: bindDependency(dependency, sessions.self),
|
|
14
|
-
union: bindDependency(dependency, sessions.union),
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
16
|
return Object.freeze(dependencies);
|
|
@@ -20,19 +19,14 @@ function bindDependency(dependency, session) {
|
|
|
20
19
|
const invoke = session.invoke.bind(session);
|
|
21
20
|
return Object.freeze({
|
|
22
21
|
async invoke(select, ...args) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const callable = dependency.callable(selected.key);
|
|
32
|
-
if (callable !== selected || Key.origin(callable.key) !== dependency.origin)
|
|
33
|
-
invalid();
|
|
34
|
-
if ('owner' in callable && (!callable.executable || !ownMethod(dependency, callable)))
|
|
35
|
-
invalid();
|
|
22
|
+
const callable = selectedCallable(dependency, select);
|
|
23
|
+
if (isBinaryInput(callable.input)) {
|
|
24
|
+
if ('owner' in callable || args.length !== 2)
|
|
25
|
+
invalid();
|
|
26
|
+
// Runtime selection is wider than the authored Function; mode was checked above.
|
|
27
|
+
const binaryReference = reference(dependency, callable);
|
|
28
|
+
return invoke(binaryReference, args[0], binaryOptions(args[1]));
|
|
29
|
+
}
|
|
36
30
|
if ('owner' in callable && !callable.static) {
|
|
37
31
|
if (args.length < 2 || args.length > 3 || typeof args[0] !== 'string')
|
|
38
32
|
invalid();
|
|
@@ -45,6 +39,22 @@ function bindDependency(dependency, session) {
|
|
|
45
39
|
},
|
|
46
40
|
});
|
|
47
41
|
}
|
|
42
|
+
function selectedCallable(domain, select) {
|
|
43
|
+
if (typeof select !== 'function')
|
|
44
|
+
invalid();
|
|
45
|
+
const selected = select(domain);
|
|
46
|
+
if (selected === null ||
|
|
47
|
+
typeof selected !== 'object' ||
|
|
48
|
+
!('key' in selected) ||
|
|
49
|
+
typeof selected.key !== 'string')
|
|
50
|
+
invalid();
|
|
51
|
+
const callable = domain.callable(selected.key);
|
|
52
|
+
if (callable !== selected || Key.origin(callable.key) !== domain.origin)
|
|
53
|
+
invalid();
|
|
54
|
+
if ('owner' in callable && (!callable.executable || !ownMethod(domain, callable)))
|
|
55
|
+
invalid();
|
|
56
|
+
return callable;
|
|
57
|
+
}
|
|
48
58
|
function ownMethod(domain, callable) {
|
|
49
59
|
const owner = Object.values(domain.classes).find((value) => value === callable.owner);
|
|
50
60
|
if (owner === undefined)
|
|
@@ -63,6 +73,16 @@ function options(value) {
|
|
|
63
73
|
// Canonical ClientSession admits option values and clamps them to the parent lifetime.
|
|
64
74
|
return value;
|
|
65
75
|
}
|
|
76
|
+
function binaryOptions(value) {
|
|
77
|
+
if (value === null ||
|
|
78
|
+
typeof value !== 'object' ||
|
|
79
|
+
Array.isArray(value) ||
|
|
80
|
+
!Object.hasOwn(value, 'body') ||
|
|
81
|
+
!(value.body instanceof Blob) ||
|
|
82
|
+
Reflect.ownKeys(value).some((key) => key !== 'body' && key !== 'timeoutMs'))
|
|
83
|
+
invalid();
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
66
86
|
function invalid() {
|
|
67
87
|
throw new TypeError('Dependency invocation requires one owned executable callable, its input, and valid instance/options.');
|
|
68
88
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HandlerRequest } from '@astrale-os/kernel-server';
|
|
2
|
-
import type { ActionExecution, Caller, DomainGraphExecutors, DomainKernelSessions } from '../../../application/action/index.js';
|
|
2
|
+
import type { ActionExecution, ActionBinaryInput, Caller, DomainGraphExecutors, DomainKernelSessions } from '../../../application/action/index.js';
|
|
3
3
|
import type { HandlerDependencies } from '../../../application/dependency/index.js';
|
|
4
4
|
import type { MutationExecutor } from '../../../application/mutation/index.js';
|
|
5
5
|
import type { QueryExecutor } from '../../../application/query/index.js';
|
|
@@ -10,12 +10,13 @@ import type { InvocationAuthentication } from '../admission/index.js';
|
|
|
10
10
|
export interface DispatchContext {
|
|
11
11
|
readonly domain: Domain;
|
|
12
12
|
readonly input: unknown;
|
|
13
|
+
readonly body?: ActionBinaryInput;
|
|
13
14
|
readonly caller: Caller;
|
|
14
|
-
readonly dependencies: HandlerDependencies<Domain> |
|
|
15
|
-
readonly kernel: DomainKernelSessions |
|
|
16
|
-
readonly graph: DomainGraphExecutors |
|
|
17
|
-
readonly query
|
|
18
|
-
readonly mutate
|
|
15
|
+
readonly dependencies: HandlerDependencies<Domain> | HandlerDependencies<Domain, 'self'>;
|
|
16
|
+
readonly kernel: DomainKernelSessions | DomainKernelSessions<'self'>;
|
|
17
|
+
readonly graph: DomainGraphExecutors | DomainGraphExecutors<Domain, 'self'>;
|
|
18
|
+
readonly query: QueryExecutor;
|
|
19
|
+
readonly mutate: MutationExecutor;
|
|
19
20
|
readonly integrations: Readonly<Record<string, unknown>>;
|
|
20
21
|
readonly execution: ActionExecution;
|
|
21
22
|
readonly self?: NodeId;
|
|
@@ -3,7 +3,8 @@ import { bindQuery } from '../../../application/query/execution/executor.js';
|
|
|
3
3
|
import { bindDependencies } from '../dependency/index.js';
|
|
4
4
|
import { clients } from '../integration/index.js';
|
|
5
5
|
export function context(request, runtime, authentication, self) {
|
|
6
|
-
const
|
|
6
|
+
const sessions = authentication.graph;
|
|
7
|
+
const graph = bindGraph(sessions, runtime.loaded.domain);
|
|
7
8
|
const execution = Object.freeze({
|
|
8
9
|
signal: request.context.execution.signal,
|
|
9
10
|
deadline: request.context.execution.deadline,
|
|
@@ -17,48 +18,33 @@ export function context(request, runtime, authentication, self) {
|
|
|
17
18
|
return Object.freeze({
|
|
18
19
|
domain: runtime.loaded.domain,
|
|
19
20
|
input: request.call.input,
|
|
21
|
+
...(request.context.binary === undefined ? {} : { body: request.context.binary }),
|
|
20
22
|
caller: authentication.caller,
|
|
21
|
-
kernel:
|
|
22
|
-
|
|
23
|
-
: Object.freeze({
|
|
24
|
-
...authentication.graph.self,
|
|
25
|
-
...authentication.graph,
|
|
26
|
-
}),
|
|
27
|
-
dependencies: authentication.graph === null
|
|
28
|
-
? null
|
|
29
|
-
: bindDependencies(runtime.loaded.domain, authentication.graph),
|
|
23
|
+
kernel: Object.freeze({ ...sessions.self, ...sessions }),
|
|
24
|
+
dependencies: bindDependencies(runtime.loaded.domain, sessions),
|
|
30
25
|
graph,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
caller: authentication.graph.caller,
|
|
41
|
-
self: authentication.graph.self,
|
|
42
|
-
...(authentication.caller.authentication.expiresAt === undefined
|
|
43
|
-
? {}
|
|
44
|
-
: {
|
|
45
|
-
expiresAt: authentication.caller.authentication.expiresAt,
|
|
46
|
-
}),
|
|
47
|
-
}),
|
|
26
|
+
query: graph.self.query,
|
|
27
|
+
mutate: graph.self.mutate,
|
|
28
|
+
integrations: clients(runtime, request.context, {
|
|
29
|
+
...sessions,
|
|
30
|
+
...(authentication.caller.kind !== 'authenticated' ||
|
|
31
|
+
authentication.caller.authentication.expiresAt === undefined
|
|
32
|
+
? {}
|
|
33
|
+
: { expiresAt: authentication.caller.authentication.expiresAt }),
|
|
34
|
+
}),
|
|
48
35
|
execution,
|
|
49
36
|
...(self === undefined ? {} : { self }),
|
|
50
37
|
});
|
|
51
38
|
}
|
|
52
|
-
function bindGraph(
|
|
39
|
+
function bindGraph(sessions, domain) {
|
|
53
40
|
const bind = (client) => Object.freeze({
|
|
54
41
|
query: bindQuery(client, domain),
|
|
55
42
|
mutate: bindMutation(client, domain),
|
|
56
43
|
});
|
|
57
|
-
const self = bind(
|
|
44
|
+
const self = bind(sessions.self);
|
|
58
45
|
return Object.freeze({
|
|
59
46
|
...self,
|
|
60
|
-
caller: bind(
|
|
47
|
+
...('caller' in sessions ? { caller: bind(sessions.caller) } : {}),
|
|
61
48
|
self,
|
|
62
|
-
union: bind(clients.union),
|
|
63
49
|
});
|
|
64
50
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { declaredErrorFactory, declaredErrorOf } from '../../../application/error/index.js';
|
|
2
2
|
import { protocolError } from '../result/index.js';
|
|
3
3
|
export async function workflow(selected, context, runner) {
|
|
4
|
-
if (context.caller.kind !== 'authenticated' || context.kernel === null) {
|
|
5
|
-
throw protocolError('AUTH_MISSING', 'Workflow authentication is required.');
|
|
6
|
-
}
|
|
7
4
|
const complete = Object.freeze({
|
|
8
5
|
...context,
|
|
9
|
-
caller: context.caller,
|
|
10
6
|
error: declaredErrorFactory(selected.definition),
|
|
11
7
|
});
|
|
12
8
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createHandler, type HandlerInput } from './handler.js';
|
|
2
2
|
export { invoke, type InvocationInput } from './invocation.js';
|
|
3
3
|
export type * from './admission/index.js';
|
|
4
|
-
export { InvocationDefect
|
|
5
|
-
export type { InvocationDefectCode
|
|
4
|
+
export { InvocationDefect } from './result/index.js';
|
|
5
|
+
export type { InvocationDefectCode } from './result/index.js';
|
|
@@ -2,7 +2,8 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
|
|
|
2
2
|
import type { IntegrationInvocationOwner } from '../../../application/integration/index.js';
|
|
3
3
|
import type { BoundClientSession } from '../../../platform/client/session/index.js';
|
|
4
4
|
export interface IntegrationInvocationSessions {
|
|
5
|
-
|
|
5
|
+
/** Absent when the call carried no credential: there is no caller to invoke for. */
|
|
6
|
+
readonly caller?: BoundClientSession;
|
|
6
7
|
readonly self: BoundClientSession;
|
|
7
8
|
/** Verified incoming carrier expiry, in Unix seconds. */
|
|
8
9
|
readonly expiresAt?: number;
|
|
@@ -3,7 +3,7 @@ import { bindIntegrationAuthentication } from './authentication.js';
|
|
|
3
3
|
/** One invocation-owned logical Integration call sequence. */
|
|
4
4
|
export function calls(context, sessions = null) {
|
|
5
5
|
const prefix = context.idempotencyKey ?? JSON.stringify([context.invocation.source, context.invocation.id]);
|
|
6
|
-
const invoke = sessions?.caller
|
|
6
|
+
const invoke = sessions?.caller?.invoke.bind(sessions.caller);
|
|
7
7
|
const auth = sessions === null
|
|
8
8
|
? undefined
|
|
9
9
|
: bindIntegrationAuthentication(context, sessions.self, sessions.expiresAt);
|
|
@@ -2,4 +2,4 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
|
|
|
2
2
|
import type { IntegrationClients, Integrations } from '../../../application/integration/index.js';
|
|
3
3
|
import type { InitializedRuntime } from '../../runtime/index.js';
|
|
4
4
|
import type { IntegrationInvocationSessions } from './call.js';
|
|
5
|
-
export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions
|
|
5
|
+
export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions): IntegrationClients<Integrations>;
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as errors from '@astrale-os/kernel-protocol/errors';
|
|
2
|
+
import * as release from '@astrale-os/kernel-protocol/release';
|
|
2
3
|
import { authentication, input, requireVia, target } from './admission/index.js';
|
|
3
4
|
import { action, context, select, workflow } from './dispatch/index.js';
|
|
4
5
|
import { active, settle } from './lifecycle/index.js';
|
|
5
6
|
import { project, protocolError } from './result/index.js';
|
|
7
|
+
/** The reserved answer of a deployment that does not serve the call: its caller re-routes. */
|
|
8
|
+
const MISS = Object.freeze({ kind: 'miss' });
|
|
9
|
+
const FUNCTION_MISS = 'FUNCTION_MISS';
|
|
6
10
|
export async function invoke(request, inputConfig) {
|
|
7
11
|
active(request.context);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (snapshot === undefined ||
|
|
11
|
-
!publication.matchesReference(snapshot.publication, publication.reference(release.publication))) {
|
|
12
|
-
throw protocolError('CONFLICT', 'Invocation Publication differs from the running Release.');
|
|
12
|
+
if (!pinsRunningRelease(request, inputConfig.runtime.loaded.release)) {
|
|
13
|
+
throw protocolError('CONFLICT', 'Invocation release differs from the running Release.');
|
|
13
14
|
}
|
|
14
15
|
if (request.credential !== undefined && typeof request.credential !== 'string') {
|
|
15
16
|
throw protocolError('AUTH_INVALID', 'Credential is invalid.');
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
-
const selectedTarget = target(await inputConfig.authority.admit({
|
|
18
|
+
const admitted = await admit(inputConfig.authority, {
|
|
19
19
|
call: request.call,
|
|
20
20
|
...(request.credential === undefined ? {} : { credential: request.credential }),
|
|
21
|
-
via,
|
|
22
|
-
publication: release.publication,
|
|
21
|
+
via: requireVia(request),
|
|
23
22
|
domain: inputConfig.runtime.loaded.domain,
|
|
24
23
|
context: request.context,
|
|
25
|
-
})
|
|
26
|
-
|
|
24
|
+
});
|
|
25
|
+
if (admitted === undefined)
|
|
26
|
+
return MISS;
|
|
27
|
+
const selected = select(inputConfig.runtime.loaded.registry, admitted);
|
|
27
28
|
if (selected === undefined)
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
return MISS;
|
|
30
|
+
if (selected.implementation.kind === 'workflow' && selected.implementation.durable) {
|
|
31
|
+
// The Kernel records a durable call as an Execution and runs it on the engine; running it
|
|
32
|
+
// inline here would silently drop durability.
|
|
33
|
+
throw protocolError('UNSUPPORTED', 'A durable Workflow runs only as a Kernel Execution.');
|
|
34
|
+
}
|
|
35
|
+
input(selected.implementation.callable, request.call.input, request.context.binary);
|
|
36
|
+
const admittedAuthentication = await authentication(selected.implementation.callable, request, inputConfig.runtime.loaded.domain, inputConfig.authority);
|
|
31
37
|
const close = once(admittedAuthentication.close);
|
|
32
|
-
active(request.context);
|
|
33
38
|
try {
|
|
39
|
+
active(request.context);
|
|
34
40
|
const dispatchContext = context(request, inputConfig.runtime, admittedAuthentication, selected.self);
|
|
35
41
|
const output = selected.implementation.kind === 'action'
|
|
36
42
|
? await action(selected.implementation, dispatchContext)
|
|
@@ -42,6 +48,33 @@ export async function invoke(request, inputConfig) {
|
|
|
42
48
|
throw cause;
|
|
43
49
|
}
|
|
44
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* The source Kernel's `Function.admit` refuses `FUNCTION_MISS` when it no longer places the call on
|
|
53
|
+
* this deployment, as for a client whose learned route still names a deployment replaced by a
|
|
54
|
+
* consented install. That refusal is answered as the reserved miss, never as a public error, so
|
|
55
|
+
* the client re-routes through its source Kernel (AM-85). Every other refusal is unchanged.
|
|
56
|
+
*/
|
|
57
|
+
async function admit(authority, admission) {
|
|
58
|
+
let admitted;
|
|
59
|
+
try {
|
|
60
|
+
admitted = await authority.admit(admission);
|
|
61
|
+
}
|
|
62
|
+
catch (cause) {
|
|
63
|
+
if (refusedAsMiss(cause))
|
|
64
|
+
return undefined;
|
|
65
|
+
throw cause;
|
|
66
|
+
}
|
|
67
|
+
return target(admitted);
|
|
68
|
+
}
|
|
69
|
+
function refusedAsMiss(cause) {
|
|
70
|
+
return (cause instanceof errors.ProtocolError &&
|
|
71
|
+
errors.reasonOf(cause.payload.data)?.code === FUNCTION_MISS);
|
|
72
|
+
}
|
|
73
|
+
/** Execution answers only for the exact release pinned by the Kernel Server snapshot. */
|
|
74
|
+
function pinsRunningRelease(request, running) {
|
|
75
|
+
return (request.release !== undefined &&
|
|
76
|
+
release.matchesReference(request.release.release, release.reference(running.document)));
|
|
77
|
+
}
|
|
45
78
|
function once(operation) {
|
|
46
79
|
let called = false;
|
|
47
80
|
return () => {
|