@astrale-os/sdk 0.6.0-beta.3 → 0.6.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +181 -58
- package/dist/application/action/action.d.ts +6 -0
- package/dist/application/action/authoring.d.ts +1 -1
- package/dist/application/action/context.d.ts +44 -31
- package/dist/application/action/define.d.ts +3 -3
- package/dist/application/action/index.d.ts +1 -1
- package/dist/application/define.d.ts +8 -6
- package/dist/application/define.js +28 -14
- package/dist/application/dependency/index.d.ts +1 -1
- package/dist/application/dependency/invoker.d.ts +14 -9
- package/dist/application/domain.d.ts +30 -0
- package/dist/application/index.d.ts +4 -4
- package/dist/application/index.js +1 -1
- package/dist/application/integration/operation.d.ts +2 -2
- package/dist/application/mutation/authoring/properties.d.ts +5 -3
- package/dist/application/mutation/authoring/properties.js +35 -2
- package/dist/application/mutation/authoring/transition.js +4 -1
- package/dist/application/mutation/index.d.ts +1 -1
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- package/dist/application/routes/admission.d.ts +2 -2
- package/dist/application/routes/admission.js +1 -1
- package/dist/application/routes/route.d.ts +2 -2
- package/dist/application/runtime/actions.js +3 -0
- package/dist/application/runtime/workflows.d.ts +3 -1
- package/dist/application/runtime/workflows.js +6 -4
- package/dist/application/view/define.js +4 -6
- package/dist/application/view/frontend.d.ts +2 -2
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +0 -14
- package/dist/application/view/route.js +1 -64
- package/dist/application/workflow/authoring.d.ts +3 -2
- package/dist/application/workflow/context.d.ts +8 -2
- package/dist/application/workflow/define.d.ts +4 -4
- package/dist/application/workflow/define.js +20 -4
- package/dist/application/workflow/durable.d.ts +87 -0
- package/dist/application/workflow/index.d.ts +3 -2
- package/dist/application/workflow/runner/inline.js +3 -4
- package/dist/application/workflow/runner/runner.d.ts +2 -2
- package/dist/application/workflow/step/output.d.ts +2 -0
- package/dist/application/workflow/step/output.js +73 -0
- package/dist/application/workflow/workflow.d.ts +13 -3
- package/dist/deployment/adapter/adapter.d.ts +55 -13
- package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
- package/dist/deployment/adapter/bundle/file.d.ts +10 -0
- package/dist/deployment/adapter/bundle/index.d.ts +2 -0
- package/dist/deployment/adapter/define.d.ts +4 -3
- package/dist/deployment/adapter/define.js +107 -23
- package/dist/deployment/adapter/index.d.ts +4 -3
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/release/command.d.ts +33 -0
- package/dist/deployment/adapter/release/context.d.ts +94 -0
- package/dist/deployment/adapter/release/index.d.ts +4 -0
- package/dist/deployment/adapter/release/index.js +1 -0
- package/dist/deployment/adapter/release/list.d.ts +53 -0
- package/dist/deployment/adapter/release/list.js +1 -0
- package/dist/deployment/adapter/release/refusal.d.ts +10 -0
- package/dist/deployment/adapter/release/refusal.js +14 -0
- package/dist/deployment/adapter/release/result.d.ts +56 -0
- package/dist/deployment/adapter/release/result.js +1 -0
- package/dist/deployment/address/configuration.d.ts +95 -0
- package/dist/deployment/address/configuration.js +273 -0
- package/dist/deployment/address/fingerprint.d.ts +5 -0
- package/dist/deployment/address/fingerprint.js +27 -0
- package/dist/deployment/address/index.d.ts +5 -0
- package/dist/deployment/address/index.js +4 -0
- package/dist/deployment/address/label.d.ts +42 -0
- package/dist/deployment/address/label.js +80 -0
- package/dist/deployment/address/line.d.ts +29 -0
- package/dist/deployment/address/line.js +53 -0
- package/dist/deployment/address/record.d.ts +73 -0
- package/dist/deployment/address/record.js +138 -0
- package/dist/deployment/address/summary.d.ts +30 -0
- package/dist/deployment/address/summary.js +1 -0
- package/dist/deployment/address/vectors.d.ts +60 -0
- package/dist/deployment/address/vectors.js +517 -0
- package/dist/deployment/authoring.d.ts +0 -2
- package/dist/deployment/authoring.js +0 -1
- package/dist/deployment/build/build.d.ts +8 -2
- package/dist/deployment/build/compile.d.ts +4 -4
- package/dist/deployment/build/compile.js +19 -17
- package/dist/deployment/build/frontend/compilation.d.ts +2 -4
- package/dist/deployment/build/frontend/compilation.js +0 -5
- package/dist/deployment/build/frontend/digest.js +1 -5
- package/dist/deployment/build/index.d.ts +1 -0
- package/dist/deployment/build/index.js +1 -0
- package/dist/deployment/build/manifest.d.ts +59 -0
- package/dist/deployment/build/manifest.js +118 -0
- package/dist/deployment/build/material.d.ts +2 -2
- package/dist/deployment/build/material.js +28 -13
- package/dist/deployment/build/schema.d.ts +2 -2
- package/dist/deployment/deployment.d.ts +3 -2
- package/dist/deployment/environment.d.ts +6 -0
- package/dist/deployment/environment.js +6 -0
- package/dist/deployment/index.d.ts +4 -6
- package/dist/deployment/index.js +1 -2
- package/dist/deployment/release/addressing.d.ts +6 -5
- package/dist/deployment/release/addressing.js +2 -3
- package/dist/deployment/release/assemble.d.ts +6 -3
- package/dist/deployment/release/assemble.js +12 -10
- package/dist/deployment/release/release.d.ts +16 -5
- package/dist/deployment/release/seal.d.ts +14 -0
- package/dist/deployment/release/seal.js +22 -0
- package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/callables.js +2 -2
- package/dist/deployment/release/served/index.d.ts +11 -0
- package/dist/deployment/release/served/index.js +26 -0
- package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/views.js +0 -1
- package/dist/deployment/runtime/admission.d.ts +2 -2
- package/dist/deployment/runtime/admission.js +5 -5
- package/dist/deployment/verify/index.d.ts +3 -4
- package/dist/deployment/verify/index.js +2 -3
- package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
- package/dist/deployment/verify/preflight/bundle.js +71 -0
- package/dist/deployment/verify/preflight/index.d.ts +1 -12
- package/dist/deployment/verify/preflight/index.js +1 -12
- package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
- package/dist/deployment/verify/readiness/fetch.js +26 -0
- package/dist/deployment/verify/readiness/identity.d.ts +3 -6
- package/dist/deployment/verify/readiness/identity.js +3 -3
- package/dist/deployment/verify/readiness/index.d.ts +15 -8
- package/dist/deployment/verify/readiness/index.js +25 -6
- package/dist/deployment/verify/readiness/release.d.ts +8 -0
- package/dist/deployment/verify/readiness/release.js +22 -0
- package/dist/deployment/worker/address.d.ts +26 -0
- package/dist/deployment/worker/address.js +43 -0
- package/dist/deployment/worker/build.d.ts +60 -0
- package/dist/deployment/worker/build.js +172 -0
- package/dist/deployment/worker/configuration.d.ts +73 -0
- package/dist/deployment/worker/configuration.js +165 -0
- package/dist/deployment/worker/content.d.ts +38 -0
- package/dist/deployment/worker/content.js +169 -0
- package/dist/deployment/worker/index.d.ts +29 -0
- package/dist/deployment/worker/index.js +29 -0
- package/dist/deployment/worker/limits.d.ts +30 -0
- package/dist/deployment/worker/limits.js +30 -0
- package/dist/deployment/worker/record.d.ts +29 -0
- package/dist/deployment/worker/record.js +69 -0
- package/dist/deployment/worker/request.d.ts +118 -0
- package/dist/deployment/worker/request.js +280 -0
- package/dist/deployment/worker/response.d.ts +101 -0
- package/dist/deployment/worker/response.js +207 -0
- package/dist/execution/identity/authentication.d.ts +33 -3
- package/dist/execution/identity/authentication.js +85 -40
- package/dist/execution/identity/callback.d.ts +16 -15
- package/dist/execution/identity/callback.js +21 -16
- package/dist/execution/identity/delivery.d.ts +6 -4
- package/dist/execution/identity/delivery.js +25 -20
- package/dist/execution/identity/identity.d.ts +17 -3
- package/dist/execution/identity/identity.js +12 -4
- package/dist/execution/identity/jwks.d.ts +5 -0
- package/dist/execution/identity/jwks.js +92 -102
- package/dist/execution/index.d.ts +4 -4
- package/dist/execution/index.js +2 -2
- package/dist/execution/invocation/admission/authentication.d.ts +11 -13
- package/dist/execution/invocation/admission/authentication.js +48 -44
- package/dist/execution/invocation/admission/authority.d.ts +28 -6
- package/dist/execution/invocation/admission/authority.js +9 -2
- package/dist/execution/invocation/admission/index.d.ts +2 -2
- package/dist/execution/invocation/admission/index.js +1 -1
- package/dist/execution/invocation/admission/input.d.ts +2 -2
- package/dist/execution/invocation/admission/input.js +16 -2
- package/dist/execution/invocation/dependency/bind.d.ts +3 -1
- package/dist/execution/invocation/dependency/bind.js +36 -16
- package/dist/execution/invocation/dispatch/context.d.ts +7 -6
- package/dist/execution/invocation/dispatch/context.js +17 -31
- package/dist/execution/invocation/dispatch/workflow.js +0 -4
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/integration/call.d.ts +2 -1
- package/dist/execution/invocation/integration/call.js +1 -1
- package/dist/execution/invocation/integration/clients.d.ts +1 -1
- package/dist/execution/invocation/invocation.js +49 -16
- package/dist/execution/invocation/result/errors.d.ts +0 -10
- package/dist/execution/invocation/result/errors.js +0 -17
- package/dist/execution/invocation/result/index.d.ts +2 -2
- package/dist/execution/invocation/result/index.js +1 -1
- package/dist/execution/invocation/result/project.js +41 -1
- package/dist/execution/node/serve.d.ts +2 -2
- package/dist/execution/node/serve.js +1 -1
- package/dist/execution/runtime/index.d.ts +1 -0
- package/dist/execution/runtime/index.js +1 -0
- package/dist/execution/runtime/load.d.ts +3 -3
- package/dist/execution/runtime/load.js +3 -2
- package/dist/execution/runtime/release.d.ts +17 -0
- package/dist/execution/runtime/release.js +7 -0
- package/dist/execution/serve.d.ts +10 -4
- package/dist/execution/serve.js +3 -0
- package/dist/execution/service/create.js +41 -7
- package/dist/execution/service/initialization.d.ts +4 -4
- package/dist/execution/service/initialization.js +23 -14
- package/dist/execution/service/release.d.ts +2 -2
- package/dist/execution/service/release.js +3 -2
- package/dist/execution/service/service.d.ts +14 -5
- package/dist/execution/service/serving/delivery.d.ts +5 -0
- package/dist/execution/service/{publication → serving}/delivery.js +4 -1
- package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
- package/dist/execution/service/serving/installation.d.ts +4 -0
- package/dist/execution/service/serving/installation.js +9 -0
- package/dist/execution/service/serving/source.d.ts +11 -0
- package/dist/execution/service/serving/source.js +15 -0
- package/dist/execution/workflows/discovery.d.ts +14 -0
- package/dist/execution/workflows/discovery.js +151 -0
- package/dist/execution/workflows/engine.d.ts +52 -0
- package/dist/execution/workflows/engine.js +1 -0
- package/dist/execution/workflows/envelope.d.ts +12 -0
- package/dist/execution/workflows/envelope.js +46 -0
- package/dist/execution/workflows/failure.d.ts +11 -0
- package/dist/execution/workflows/failure.js +43 -0
- package/dist/execution/workflows/index.d.ts +4 -0
- package/dist/execution/workflows/index.js +3 -0
- package/dist/execution/workflows/options.d.ts +34 -0
- package/dist/execution/workflows/options.js +65 -0
- package/dist/execution/workflows/receiver.d.ts +21 -0
- package/dist/execution/workflows/receiver.js +92 -0
- package/dist/execution/workflows/route.d.ts +12 -0
- package/dist/execution/workflows/route.js +35 -0
- package/dist/execution/workflows/run.d.ts +22 -0
- package/dist/execution/workflows/run.js +223 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/platform/graph/alias.d.ts +1 -5
- package/dist/platform/graph/alias.js +1 -5
- package/dist/platform/graph/document/index.d.ts +1 -1
- package/dist/platform/graph/document/index.js +1 -1
- package/dist/platform/graph/index.d.ts +1 -1
- package/dist/platform/graph/index.js +1 -1
- package/dist/platform/release/index.d.ts +2 -0
- package/dist/platform/release/index.js +2 -0
- package/dist/platform/schema/callable-authoring.d.ts +21 -0
- package/dist/platform/schema/callable-authoring.js +27 -0
- package/dist/platform/schema/class-authoring.d.ts +61 -11
- package/dist/platform/schema/class-authoring.js +37 -4
- package/dist/platform/schema/class-icon-svg.d.ts +9 -0
- package/dist/platform/schema/class-icon-svg.js +29 -0
- package/dist/platform/schema/class-icon.d.ts +3 -8
- package/dist/platform/schema/class-icon.js +2 -29
- package/dist/platform/schema/index.d.ts +6 -4
- package/dist/platform/schema/index.js +2 -1
- package/dist/platform/schema/property.d.ts +5 -0
- package/dist/platform/schema/schema-authoring.d.ts +14 -7
- package/dist/platform/schema/schema-authoring.js +5 -1
- package/dist/platform/versioning/dependents.d.ts +18 -0
- package/dist/platform/versioning/dependents.js +15 -0
- package/dist/platform/versioning/index.d.ts +5 -0
- package/dist/platform/versioning/index.js +5 -0
- package/dist/platform/versioning/name.d.ts +38 -0
- package/dist/platform/versioning/name.js +58 -0
- package/dist/platform/versioning/reference.d.ts +48 -0
- package/dist/platform/versioning/reference.js +95 -0
- package/dist/platform/versioning/version.d.ts +72 -0
- package/dist/platform/versioning/version.js +98 -0
- package/dist/project/admit.js +1 -5
- package/dist/project/define.d.ts +4 -4
- package/dist/project/define.js +55 -35
- package/dist/project/index.d.ts +1 -1
- package/dist/project/install-command.d.ts +6 -0
- package/dist/project/install-command.js +9 -0
- package/dist/project/project.d.ts +10 -8
- package/dist/testing/dataset/define.d.ts +1 -1
- package/dist/testing/load.js +1 -1
- package/dist/tooling/cli/adapter-command.d.ts +35 -0
- package/dist/tooling/cli/adapter-command.js +66 -0
- package/dist/tooling/cli/arguments.d.ts +17 -6
- package/dist/tooling/cli/arguments.js +175 -52
- package/dist/tooling/cli/build.d.ts +55 -0
- package/dist/tooling/cli/build.js +77 -0
- package/dist/tooling/cli/bun.d.ts +0 -1
- package/dist/tooling/cli/bun.js +0 -7
- package/dist/tooling/cli/commit.d.ts +35 -0
- package/dist/tooling/cli/commit.js +235 -0
- package/dist/tooling/cli/deploy-mode.d.ts +26 -0
- package/dist/tooling/cli/deploy-mode.js +59 -0
- package/dist/tooling/cli/deploy-result.d.ts +80 -0
- package/dist/tooling/cli/deploy-result.js +64 -0
- package/dist/tooling/cli/diff/declared.d.ts +7 -0
- package/dist/tooling/cli/diff/declared.js +27 -0
- package/dist/tooling/cli/diff/index.d.ts +30 -0
- package/dist/tooling/cli/diff/index.js +58 -0
- package/dist/tooling/cli/diff/render.d.ts +15 -0
- package/dist/tooling/cli/diff/render.js +131 -0
- package/dist/tooling/cli/diff/report.d.ts +88 -0
- package/dist/tooling/cli/diff/report.js +154 -0
- package/dist/tooling/cli/dotenv.d.ts +2 -2
- package/dist/tooling/cli/dotenv.js +3 -33
- package/dist/tooling/cli/help.js +173 -60
- package/dist/tooling/cli/immutable-deployment.d.ts +83 -0
- package/dist/tooling/cli/immutable-deployment.js +135 -0
- package/dist/tooling/cli/index.d.ts +12 -4
- package/dist/tooling/cli/index.js +6 -3
- package/dist/tooling/cli/installed-on.d.ts +83 -0
- package/dist/tooling/cli/installed-on.js +156 -0
- package/dist/tooling/cli/list.d.ts +152 -0
- package/dist/tooling/cli/list.js +331 -0
- package/dist/tooling/cli/log.d.ts +5 -0
- package/dist/tooling/cli/log.js +9 -0
- package/dist/tooling/cli/orchestrate.d.ts +0 -6
- package/dist/tooling/cli/orchestrate.js +246 -90
- package/dist/tooling/cli/project.d.ts +3 -3
- package/dist/tooling/cli/publish/index.d.ts +81 -0
- package/dist/tooling/cli/publish/index.js +383 -0
- package/dist/tooling/cli/publish/report.d.ts +49 -0
- package/dist/tooling/cli/publish/report.js +15 -0
- package/dist/tooling/cli/registry/client.d.ts +121 -0
- package/dist/tooling/cli/registry/client.js +354 -0
- package/dist/tooling/cli/registry/error.d.ts +11 -0
- package/dist/tooling/cli/registry/error.js +17 -0
- package/dist/tooling/cli/registry/executable.d.ts +35 -0
- package/dist/tooling/cli/registry/executable.js +96 -0
- package/dist/tooling/cli/registry/index.d.ts +9 -0
- package/dist/tooling/cli/registry/index.js +8 -0
- package/dist/tooling/cli/registry/installations.d.ts +67 -0
- package/dist/tooling/cli/registry/installations.js +108 -0
- package/dist/tooling/cli/registry/process.d.ts +36 -0
- package/dist/tooling/cli/registry/process.js +119 -0
- package/dist/tooling/cli/secrets.d.ts +9 -0
- package/dist/tooling/cli/secrets.js +19 -0
- package/dist/tooling/cli/yank.d.ts +34 -0
- package/dist/tooling/cli/yank.js +32 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -1
- package/dist/tooling/linter/implementations/source/callable-requirements.js +10 -10
- package/dist/tooling/linter/implementations/source/dependencies.js +12 -10
- package/dist/tooling/linter/implementations/source/global.js +1 -2
- package/dist/tooling/linter/implementations/source/mutations.js +17 -17
- package/dist/tooling/linter/implementations/source/providers.js +5 -5
- package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
- package/dist/tooling/linter/implementations/source/views.js +2 -2
- package/dist/tooling/linter/policy/generated.js +14 -63
- package/dist/tooling/linter/requirements/registry.js +1 -6
- package/dist/tooling/packaging/declarations/ownership.js +1 -1
- package/dist/tooling/packaging/finalize.d.ts +1 -1
- package/dist/tooling/packaging/finalize.js +1 -1
- package/package.json +39 -13
- package/dist/application/application.d.ts +0 -28
- package/dist/application/query/execution/projection.d.ts +0 -3
- package/dist/application/query/execution/projection.js +0 -3
- package/dist/deployment/adapter/deploy/context.d.ts +0 -15
- package/dist/deployment/adapter/deploy/index.d.ts +0 -2
- package/dist/deployment/adapter/deploy/result.d.ts +0 -50
- package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
- package/dist/deployment/adapter/prepare/context.d.ts +0 -23
- package/dist/deployment/adapter/prepare/index.d.ts +0 -2
- package/dist/deployment/deploy.d.ts +0 -20
- package/dist/deployment/deploy.js +0 -31
- package/dist/deployment/release/publication/index.d.ts +0 -6
- package/dist/deployment/release/publication/index.js +0 -6
- package/dist/deployment/release/publication/manifest.d.ts +0 -3
- package/dist/deployment/release/publication/manifest.js +0 -5
- package/dist/deployment/release/publication/requirements.d.ts +0 -3
- package/dist/deployment/release/publication/requirements.js +0 -3
- package/dist/deployment/release/publication/seal.d.ts +0 -10
- package/dist/deployment/release/publication/seal.js +0 -39
- package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
- package/dist/deployment/verify/preflight/artifact.js +0 -122
- package/dist/deployment/verify/preflight/publication.d.ts +0 -4
- package/dist/deployment/verify/preflight/publication.js +0 -14
- package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
- package/dist/deployment/verify/readiness/deployment.js +0 -151
- package/dist/deployment/verify/readiness/publication.d.ts +0 -11
- package/dist/deployment/verify/readiness/publication.js +0 -41
- package/dist/execution/service/errors.d.ts +0 -3
- package/dist/execution/service/errors.js +0 -3
- package/dist/execution/service/publication/delivery.d.ts +0 -2
- package/dist/execution/service/publication/installation.d.ts +0 -3
- package/dist/execution/service/publication/installation.js +0 -8
- package/dist/execution/service/publication/source.d.ts +0 -3
- package/dist/execution/service/publication/source.js +0 -11
- package/dist/platform/publication/index.d.ts +0 -2
- package/dist/platform/publication/index.js +0 -2
- package/dist/tooling/cli/astrale/authority.d.ts +0 -5
- package/dist/tooling/cli/astrale/authority.js +0 -11
- package/dist/tooling/cli/astrale/executable.d.ts +0 -2
- package/dist/tooling/cli/astrale/executable.js +0 -47
- package/dist/tooling/cli/astrale/failure.d.ts +0 -6
- package/dist/tooling/cli/astrale/failure.js +0 -48
- package/dist/tooling/cli/astrale/instance.d.ts +0 -11
- package/dist/tooling/cli/astrale/instance.js +0 -52
- package/dist/tooling/cli/astrale/process.d.ts +0 -13
- package/dist/tooling/cli/astrale/process.js +0 -94
- package/dist/tooling/cli/astrale/version.d.ts +0 -18
- package/dist/tooling/cli/astrale/version.js +0 -55
- package/dist/tooling/cli/credential.d.ts +0 -2
- package/dist/tooling/cli/credential.js +0 -57
- package/dist/tooling/cli/deprecations.d.ts +0 -9
- package/dist/tooling/cli/deprecations.js +0 -15
- package/dist/tooling/cli/development/candidate.d.ts +0 -25
- package/dist/tooling/cli/development/candidate.js +0 -176
- package/dist/tooling/cli/development/deployment.d.ts +0 -16
- package/dist/tooling/cli/development/deployment.js +0 -39
- package/dist/tooling/cli/development/develop.d.ts +0 -11
- package/dist/tooling/cli/development/develop.js +0 -243
- package/dist/tooling/cli/development/lease.d.ts +0 -18
- package/dist/tooling/cli/development/lease.js +0 -163
- package/dist/tooling/cli/development/lifecycle.d.ts +0 -9
- package/dist/tooling/cli/development/lifecycle.js +0 -43
- package/dist/tooling/cli/development/project-imports.d.ts +0 -22
- package/dist/tooling/cli/development/project-imports.js +0 -39
- package/dist/tooling/cli/development/project-lock.d.ts +0 -16
- package/dist/tooling/cli/development/project-lock.js +0 -41
- package/dist/tooling/cli/development/rebuild.d.ts +0 -13
- package/dist/tooling/cli/development/rebuild.js +0 -58
- package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
- package/dist/tooling/cli/development/release-evidence.js +0 -10
- package/dist/tooling/cli/development/report.d.ts +0 -6
- package/dist/tooling/cli/development/report.js +0 -14
- package/dist/tooling/cli/development/session-file.d.ts +0 -53
- package/dist/tooling/cli/development/session-file.js +0 -337
- package/dist/tooling/cli/development/source-watch.d.ts +0 -14
- package/dist/tooling/cli/development/source-watch.js +0 -140
- package/dist/tooling/cli/development/sources.d.ts +0 -7
- package/dist/tooling/cli/development/sources.js +0 -48
- package/dist/tooling/cli/development/target-lock.d.ts +0 -16
- package/dist/tooling/cli/development/target-lock.js +0 -68
- package/dist/tooling/cli/development/view.d.ts +0 -28
- package/dist/tooling/cli/development/view.js +0 -151
- package/dist/tooling/cli/environment-release.d.ts +0 -21
- package/dist/tooling/cli/environment-release.js +0 -46
- package/dist/tooling/cli/evidence.d.ts +0 -11
- package/dist/tooling/cli/evidence.js +0 -53
- package/dist/tooling/cli/installation/index.d.ts +0 -2
- package/dist/tooling/cli/installation/index.js +0 -1
- package/dist/tooling/cli/installation/observation.d.ts +0 -10
- package/dist/tooling/cli/installation/observation.js +0 -44
- package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
- package/dist/tooling/cli/installation/reconcile.js +0 -122
- package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
- package/dist/tooling/linter/implementations/source/migrations.js +0 -113
- package/dist/tooling/linter/qualification/index.d.ts +0 -10
- package/dist/tooling/linter/qualification/index.js +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
- package/dist/tooling/linter/qualification/runner.d.ts +0 -3
- package/dist/tooling/linter/qualification/runner.js +0 -6
- /package/dist/application/{application.js → domain.js} +0 -0
- /package/dist/{deployment/adapter/deploy/context.js → application/workflow/durable.js} +0 -0
- /package/dist/deployment/adapter/{deploy/index.js → bundle/bundle.js} +0 -0
- /package/dist/deployment/adapter/{deploy/result.js → bundle/file.js} +0 -0
- /package/dist/deployment/adapter/{prepare → bundle}/index.js +0 -0
- /package/dist/deployment/adapter/{prepare/artifact.js → release/command.js} +0 -0
- /package/dist/deployment/adapter/{prepare → release}/context.js +0 -0
- /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
- /package/dist/deployment/release/{publication → served}/routes.js +0 -0
- /package/dist/execution/service/{publication → serving}/index.js +0 -0
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# SDK
|
|
2
2
|
|
|
3
|
-
Schema-first SDK for authoring and deploying Astrale
|
|
3
|
+
Schema-first SDK for authoring and deploying Astrale Domains. The public surface separates
|
|
4
4
|
single-step Actions, explicit multi-step Workflows, provider-neutral Integrations, concrete Providers, graph
|
|
5
|
-
authoring,
|
|
5
|
+
authoring, Domain composition, Deployment, and Execution without exposing DSL callable
|
|
6
6
|
topology in implementation files.
|
|
7
7
|
|
|
8
|
+
The Domain name and optional View entrypoint belong to its root Schema. See
|
|
9
|
+
[the Schema authoring contract](docs/domain-schema-migration.md).
|
|
10
|
+
|
|
8
11
|
[](https://github.com/astrale-os/sdk/actions/workflows/ci.yml)
|
|
9
12
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
10
13
|
|
|
@@ -17,7 +20,7 @@ npm install @astrale-os/sdk
|
|
|
17
20
|
```
|
|
18
21
|
|
|
19
22
|
Zod schemas cross the SDK and Kernel compiler boundary by runtime identity. The SDK therefore
|
|
20
|
-
declares one exact, non-optional Zod peer. If
|
|
23
|
+
declares one exact, non-optional Zod peer. If a Domain declares Zod directly, it must use the
|
|
21
24
|
same exact version rather than a range; a second physical Zod runtime is not an admitted authoring
|
|
22
25
|
environment.
|
|
23
26
|
|
|
@@ -42,41 +45,33 @@ The command covers the workspace root and its packages, pins exact versions, and
|
|
|
42
45
|
lockfile through pnpm. Use `--channel latest` to select that tag instead. Missing tags and local,
|
|
43
46
|
catalog, or aliased dependencies are left unchanged and reported; peers and overrides are not edited.
|
|
44
47
|
For an older SDK without this command, start with `pnpm dlx @astrale-os/sdk@beta upgrade`.
|
|
45
|
-
|
|
48
|
+
Run the project's checks and validate on development.
|
|
46
49
|
Nothing is committed or deployed. A Shell update also requires checking the installed Shell revision.
|
|
47
50
|
Rerunning an upgrade synchronizes installation even when the manifest versions are already current.
|
|
48
51
|
|
|
49
|
-
##
|
|
50
|
-
|
|
51
|
-
A Domain issuer is retained across installation upgrades. To deploy a new Cloudflare runtime for
|
|
52
|
-
selected instances, keep the existing signing identity and issuer while selecting a new public origin:
|
|
52
|
+
## Immutable deployments
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
identityIssuer: 'https://services.example.com',
|
|
59
|
-
signingIdentity: '.astrale/identity.json',
|
|
60
|
-
})
|
|
61
|
-
```
|
|
54
|
+
A deployment serves one `DomainRelease` v4 at its immutable URL, which is also its issuer.
|
|
55
|
+
`assemble(build, buildDigest, url)` seals the document from the exact Build and running bytes.
|
|
56
|
+
Cloudflare deployments require a dispatch namespace; `astrale()` hosts them on Admin's Services.
|
|
57
|
+
Install the URL printed by `astrale-domain deploy` on each intended instance.
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
Install that public URL on each intended instance. The Kernel verifies its Delivery against the
|
|
65
|
-
retained issuer's keys and preserves the Domain installation identity and owned data. Keep the
|
|
66
|
-
original issuer discovery endpoints and keys available; unadopted instances continue to use their
|
|
67
|
-
previous bindings. Deployment readiness checks the exact new Worker version separately from issuer
|
|
68
|
-
discovery. No uninstall or identity rotation is involved.
|
|
59
|
+
## Handler authority and dependencies
|
|
69
60
|
|
|
70
|
-
|
|
71
|
-
`
|
|
72
|
-
|
|
61
|
+
Handlers use Domain self authority for `kernel`, `graph`, `query`, and `mutate`.
|
|
62
|
+
`dependencies.directory.caller.invoke(d => d.functions.lookup, input)` calls a direct declared
|
|
63
|
+
dependency on behalf of the incoming caller Identity; `.self` calls it as the executing Domain.
|
|
64
|
+
Explicit `caller` or `self` authority is also available on `kernel` and `graph`; the former
|
|
65
|
+
handler `client` is removed. A call to an `auth: 'anonymous'` callable that carries no credential
|
|
66
|
+
has no caller: its handler acts as the Domain alone, without the `caller` selections. See
|
|
67
|
+
[the API and migration guide](docs/handler-dependencies.md).
|
|
73
68
|
|
|
74
|
-
##
|
|
69
|
+
## Durable Workflows
|
|
75
70
|
|
|
76
|
-
|
|
77
|
-
`
|
|
78
|
-
with
|
|
79
|
-
|
|
71
|
+
A callable declared with `execution: { durable: true }` is implemented by `defineWorkflow` and runs
|
|
72
|
+
on the Kernel's workflow engine: a call returns its `K.Execution` at once, and the run survives
|
|
73
|
+
restarts with journaled Steps, durable timers and signals. Serve it with `serve({ durable })`. See
|
|
74
|
+
[the durable Workflow guide](docs/durable-workflows.md).
|
|
80
75
|
|
|
81
76
|
## Node Class icons
|
|
82
77
|
|
|
@@ -100,6 +95,66 @@ valid; the linter emits a non-failing `SCH-ICON-NEUTRAL` warning. Bare names suc
|
|
|
100
95
|
non-canonical empty SVGs, external references, and executable SVG content are rejected during
|
|
101
96
|
Schema authoring.
|
|
102
97
|
|
|
98
|
+
## Read rules and caller rules
|
|
99
|
+
|
|
100
|
+
Every concrete Class authored through the SDK declares who may read it, and every executable
|
|
101
|
+
`authorized` callable declares who may call it. Omission is rejected by TypeScript and at the
|
|
102
|
+
runtime authoring boundary. A rule is a predicate on the caller: a Policy, or its constant value
|
|
103
|
+
`true` or `false`.
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import { classIcon, func, nodeClass } from '@astrale-os/sdk/schema'
|
|
107
|
+
import { FileText, Lock } from '@astrale-os/sdk/schema/icons'
|
|
108
|
+
import { z } from 'zod'
|
|
109
|
+
|
|
110
|
+
export const Article = nodeClass({
|
|
111
|
+
icon: classIcon.lucide(FileText),
|
|
112
|
+
policies: { read: true },
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
export const Secret = nodeClass({
|
|
116
|
+
icon: classIcon.lucide(Lock),
|
|
117
|
+
policies: { read: false, traverse: false },
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
export const purge = func({
|
|
121
|
+
auth: 'authorized',
|
|
122
|
+
policy: false,
|
|
123
|
+
input: z.strictObject({}),
|
|
124
|
+
output: z.boolean(),
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
A Class rule judges the caller, which passes by owning the Class's installation or by the rule,
|
|
129
|
+
never by a capability it holds. When a Domain acts for a caller, the Domain must also hold its own
|
|
130
|
+
right on the Class (the capability its requirements declare, or ownership), whatever the rule; an
|
|
131
|
+
Identity acting for itself delegates nothing and meets no such ceiling. A callable reads the same
|
|
132
|
+
way, with `can_use` (or ownership) as the right of its ceiling. `true` admits every Identity of the
|
|
133
|
+
instance, never an anonymous request.
|
|
134
|
+
|
|
135
|
+
| Declared | Caller is admitted when |
|
|
136
|
+
| --- | --- |
|
|
137
|
+
| Class `read: true` | always |
|
|
138
|
+
| Class `read: false` | it is the owning installation |
|
|
139
|
+
| Class `read: aPolicy` | ownership or the Policy |
|
|
140
|
+
| Callable `policy: false` | it is Root or the owning installation |
|
|
141
|
+
| Callable `policy: true` | always |
|
|
142
|
+
| Callable `policy: checks` | Root, ownership, or the checks |
|
|
143
|
+
|
|
144
|
+
- `read: true` and `policy: false` are what an absent rule already meant. Writing them changes
|
|
145
|
+
neither the compiled Schema nor its revision.
|
|
146
|
+
- An excluded caller stays denied: `true` holds only for a caller whose live composition is not
|
|
147
|
+
denied.
|
|
148
|
+
- `read` governs values, `traverse` governs reachability: a Node is reachable, and its reference
|
|
149
|
+
selectable, when either rule admits the caller. A Class whose `read` is not `true` must
|
|
150
|
+
therefore declare `traverse` as well: `traverse: false` hides that its Nodes exist,
|
|
151
|
+
`traverse: true` keeps them reachable for every caller. Beside `read: true`, `traverse` stays
|
|
152
|
+
optional.
|
|
153
|
+
- An abstract Class declares no rule. An abstract Method declares its caller rule only where a
|
|
154
|
+
concrete Class executes it.
|
|
155
|
+
- `read: false`, `traverse: false` and `policy: true` need a Kernel that knows the two constants.
|
|
156
|
+
Earlier Kernels refuse such a Schema at installation.
|
|
157
|
+
|
|
103
158
|
## Business-error declarations
|
|
104
159
|
|
|
105
160
|
Declare reusable business errors in `schema/modules/<module>/errors/` through the Schema facade:
|
|
@@ -128,15 +183,24 @@ Error declarations are not yet published in the installed Kernel Schema.
|
|
|
128
183
|
### Core Identity requirements
|
|
129
184
|
|
|
130
185
|
Use `requirements({ core: [{ subject, functions, classes, authority }] })` to declare capabilities
|
|
131
|
-
for an Identity in the
|
|
186
|
+
for an Identity in the Domain's local Core. `subject` is the resolved Core Node; each entry
|
|
132
187
|
must request at least one capability. The top-level `functions`, `classes`, and `authority` members
|
|
133
188
|
describe capabilities for the Domain principal.
|
|
134
189
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
190
|
+
Builds emit `requirements.capabilities.core`; the release declares those requirements for the
|
|
191
|
+
Domain principal and local Core identities. Installation verifies the Release and its exact Bundle.
|
|
192
|
+
|
|
193
|
+
### Durable schema installations
|
|
194
|
+
|
|
195
|
+
`schema.install()` and `schema.uninstall()` return an Execution id and its status; `result` is
|
|
196
|
+
present only after successful completion. They wait at most `waitMs` (110 s by default) for the
|
|
197
|
+
outcome; `waitMs: 0` returns at once. Keep the `execution` id to continue observing it through
|
|
198
|
+
`schema.installation.status()` or `schema.installation.result()` from a new Client session.
|
|
199
|
+
Uninstalls have the corresponding `schema.uninstallation` methods, and `session.execution` drives
|
|
200
|
+
any Execution, a durable call's included: `session.execution.result(run, { waitMs })` waits for
|
|
201
|
+
its outcome across as many requests as the wait takes.
|
|
202
|
+
The Client decodes the Kernel’s `kind: execution` call result before reading the durable status.
|
|
203
|
+
An admitted or pending Execution is not proof that the schema change completed.
|
|
140
204
|
|
|
141
205
|
### Prerequisites
|
|
142
206
|
|
|
@@ -253,13 +317,12 @@ NodePath and its Dataset Node ID through encoding and decoding. Matching propert
|
|
|
253
317
|
not create that association. Studio uses it when simulating `sameNode` and reference endpoints;
|
|
254
318
|
a missing association makes that simulation unavailable.
|
|
255
319
|
|
|
256
|
-
## Kernel
|
|
320
|
+
## Kernel release discovery
|
|
257
321
|
|
|
258
|
-
Use `session.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
coherent Publication, bundle, and View catalog observation.
|
|
322
|
+
Use `session.release()` for the intrinsic Kernel's Release without its schema bundle or Views.
|
|
323
|
+
It revalidates issuer, URL, size and ETag. Concurrent release and snapshot observations share
|
|
324
|
+
acquisition; cancelling one observer does not cancel another. `session.snapshot()` returns one
|
|
325
|
+
coherent Release, Bundle and View catalog observation.
|
|
263
326
|
|
|
264
327
|
## Headless scripts and Domain callables
|
|
265
328
|
|
|
@@ -272,30 +335,33 @@ evaluated against the caller. Kernel callables, including graph reads and writes
|
|
|
272
335
|
credential.
|
|
273
336
|
|
|
274
337
|
```ts
|
|
275
|
-
import { connect,
|
|
338
|
+
import { connect, credentials } from '@astrale-os/sdk/client/session'
|
|
276
339
|
|
|
277
340
|
const session = connect({
|
|
278
341
|
url: 'https://instance.example/api',
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}),
|
|
284
|
-
exchange: {},
|
|
342
|
+
// A fixed `astrale token`; pass a mint instead, `credentials((signal) => fetchToken(signal))`,
|
|
343
|
+
// for a script that outlives it.
|
|
344
|
+
auth: credentials(token),
|
|
345
|
+
exchange: { mode: 'auto' },
|
|
285
346
|
})
|
|
286
347
|
|
|
287
348
|
await session.call({ target: '/:orders.example:class.Order:create', input }) // Domain callable
|
|
288
349
|
await session.graph.get('@order-id') // Kernel callable: the source credential
|
|
289
350
|
```
|
|
290
351
|
|
|
291
|
-
- **Hold the source in
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
352
|
+
- **Hold the source in `credentials`.** It takes a fixed credential (a compact JWT whose `exp` is
|
|
353
|
+
its expiry), a mint returning a JWT or `{ credential, expiresAt }` in Unix milliseconds, or options
|
|
354
|
+
(`ttlSeconds`, default 60; `mint`; `initial`; `onChange`). Domain credentials are cached per source
|
|
355
|
+
credential, so a `resolve` that returns a new token on every call also exchanges on every call.
|
|
356
|
+
With a mint, `credentials` also lets the Session renew a source that is too close to expiry to
|
|
357
|
+
feed a Domain credential; a fixed credential fails once it no longer covers a call.
|
|
358
|
+
- **Lifetimes.** In `exchange: { mode: 'auto', ttlSeconds }`, `ttlSeconds` (default 300) must exceed
|
|
359
|
+
the `ttlSeconds` of `credentials` plus a 5-second settlement skew. A Domain credential never outlives its
|
|
360
|
+
source. `exchange: { mode: 'source' }` keeps the source credential for every Call and takes no
|
|
361
|
+
`ttlSeconds`; an empty `{}` or a bare `{ ttlSeconds }` is rejected.
|
|
296
362
|
- **Reading as a Domain.** To call Kernel callables as a Domain, for example to read Shell-owned
|
|
297
363
|
Classes, feed a second Session from an explicit exchange:
|
|
298
|
-
`
|
|
364
|
+
`credentials((signal) => session.exchange(shellIssuer, { signal }))`.
|
|
299
365
|
`session.exchange(issuer)` caches nothing.
|
|
300
366
|
- **Current identity.** Use `session.auth.whoami()`; `@self` is a CLI shorthand.
|
|
301
367
|
- **Failures.** A failed exchange raises `ExchangeError` from `@astrale-os/sdk/client`. Its
|
|
@@ -305,14 +371,68 @@ await session.graph.get('@order-id') // Kernel callable: the source credential
|
|
|
305
371
|
|
|
306
372
|
| Credential presented | Principal | Kernel callable | Domain callable reached by Policy |
|
|
307
373
|
| --- | --- | --- | --- |
|
|
308
|
-
| Source credential (minted or key) | the identity | ✅ |
|
|
374
|
+
| Source credential (minted or key) | the identity | ✅ | ✅ the identity acts for itself: the Policy alone decides |
|
|
309
375
|
| Session with `exchange` | the declaring Domain, for Domain callables | ✅ with the source credential | ✅ Policy evaluated against the identity |
|
|
310
376
|
| `session.exchange(issuer)` held by a second Session | that Domain | ✅ as that Domain | only what that Domain may use |
|
|
311
377
|
|
|
378
|
+
## Deployment addresses
|
|
379
|
+
|
|
380
|
+
`@astrale-os/sdk/deployment/address` derives the one immutable URL of a deployment,
|
|
381
|
+
`https://<line>-<content>.<routingDomain>`, from its inputs alone. Whoever deploys and whoever
|
|
382
|
+
hosts compute it with the same pure, runtime-safe functions, so a host can refuse an address it
|
|
383
|
+
did not derive.
|
|
384
|
+
|
|
385
|
+
- **Line.** `deploymentLine({ origin, environment, addressing })` is shared by every deployment of
|
|
386
|
+
an origin in an environment. Its 16-character fingerprint, the first 80 bits of
|
|
387
|
+
`sha256(origin ‖ 0x00 ‖ environment)` in base32, makes it unique. A `readable` line (platform
|
|
388
|
+
Domains) prefixes it with a cosmetic part, so `agencies.example.com` in `staging` gives
|
|
389
|
+
`agencies-staging-354iwg4avm6wdmrs`. An `opaque` line (tenant Domains) is the fingerprint alone.
|
|
390
|
+
- **Content.** `deploymentContent(buildDigest, configuration)` covers the build and the
|
|
391
|
+
`FrozenConfigurationV1`: the plain variables and execution settings (with the durable Workflow
|
|
392
|
+
options, when declared), the services and dispatch namespaces it binds, and the names of the
|
|
393
|
+
bound secrets, never their values. A changed variable or binding gives another URL, and a rotated
|
|
394
|
+
secret keeps the URL. `configurationDigest` gives the full digest that a deployment record keeps. It checks
|
|
395
|
+
canonical form only: the host refuses settings no Worker runs under when it encodes
|
|
396
|
+
`ASTRALE_SETTINGS` (`encodeWorkerSettings`), before it uploads anything.
|
|
397
|
+
- **Label.** `deploymentLabel(line, content)` is at most 57 characters. `DEPLOYMENT_LABEL`
|
|
398
|
+
recognizes it, never a legacy UUID or stable Worker name, and `parseDeploymentLabel` splits it
|
|
399
|
+
and refuses anything longer than 57 characters.
|
|
400
|
+
- **Record.** `acceptDeploymentRecord` admits a `DeploymentRecordV1` only when its provider
|
|
401
|
+
script is the label that its own fields derive. A host admits the record a deploy declares with
|
|
402
|
+
it before storing it, so every stored record decodes.
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
import {
|
|
406
|
+
deploymentContent,
|
|
407
|
+
deploymentLabel,
|
|
408
|
+
deploymentLine,
|
|
409
|
+
deploymentUrl,
|
|
410
|
+
} from '@astrale-os/sdk/deployment/address'
|
|
411
|
+
|
|
412
|
+
const line = deploymentLine({ origin, environment, addressing: 'opaque' })
|
|
413
|
+
const url = deploymentUrl(deploymentLabel(line, deploymentContent(build, configuration)), routingDomain)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
`@astrale-os/sdk/deployment/address/vectors` holds the conformance vectors: Worker uploads and
|
|
417
|
+
configurations with the manifest, build digest, label and URL each one gives. Every host that
|
|
418
|
+
recomputes an address tests against them.
|
|
419
|
+
|
|
312
420
|
## License
|
|
313
421
|
|
|
314
422
|
Apache License 2.0 — see [LICENSE](LICENSE) for details.
|
|
315
423
|
|
|
424
|
+
## Domain icon
|
|
425
|
+
|
|
426
|
+
```ts
|
|
427
|
+
import { classIcon } from '@astrale-os/sdk/schema'
|
|
428
|
+
import { Building2 } from '@astrale-os/sdk/schema/icons'
|
|
429
|
+
|
|
430
|
+
export const domain = defineDomain({ schema, runtime, icon: classIcon.lucide(Building2) })
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
The release publishes the icon as `manifest.logo`. Use `classIcon.svg(...)` for a self-contained
|
|
434
|
+
inline SVG, or omit `icon` and the release carries no manifest.
|
|
435
|
+
|
|
316
436
|
## View host requirements
|
|
317
437
|
|
|
318
438
|
A frontend route can declare the exact external origins its View needs to open:
|
|
@@ -330,11 +450,14 @@ routes: {
|
|
|
330
450
|
}
|
|
331
451
|
```
|
|
332
452
|
|
|
333
|
-
These requirements
|
|
334
|
-
changing the
|
|
453
|
+
These requirements belong to the Release, so changing them updates its digest without
|
|
454
|
+
changing the Domain's business Schema. They require the `shell` handshake. Origins must use
|
|
335
455
|
HTTPS without credentials, paths, queries, fragments, or wildcards; authoring normalizes and sorts
|
|
336
456
|
them. Supporting hosts admit them per mount and execute the existing `browser.openExternal`
|
|
337
457
|
intent. Nested Views cannot expand their parent's grant.
|
|
338
458
|
|
|
339
459
|
For the unified authentication facade and coordinated consumer update, see
|
|
340
460
|
[the Auth API migration guide](docs/auth-api-migration.md).
|
|
461
|
+
|
|
462
|
+
The authored composition formerly called an Application is now a Domain definition: see
|
|
463
|
+
[the Domain definition migration guide](docs/domain-definition-migration.md).
|
|
@@ -29,6 +29,12 @@ export type ActionAddressOf<Callable> = Callable extends {
|
|
|
29
29
|
export type ResolvedDomainOf<Schema extends schema.DomainSchema> = Extract<schema.DomainOf<Schema>, Domain>;
|
|
30
30
|
/** SDK Action address derived mechanically from the canonical local callable key. */
|
|
31
31
|
export type ActionAddress<Schema extends schema.DomainSchema> = ActionAddressOf<LocalCallable<ResolvedDomainOf<Schema>>>;
|
|
32
|
+
/** Address of a callable an Action may implement: a durable callable needs a Workflow. */
|
|
33
|
+
export type ImmediateActionAddress<Schema extends schema.DomainSchema> = ActionAddressOf<Exclude<LocalCallable<ResolvedDomainOf<Schema>>, {
|
|
34
|
+
readonly execution: {
|
|
35
|
+
readonly durable: true;
|
|
36
|
+
};
|
|
37
|
+
}>>;
|
|
32
38
|
export type CallableAtAddress<Schema extends schema.DomainSchema, Address extends string> = LocalCallable<ResolvedDomainOf<Schema>> extends infer Callable ? Callable extends unknown ? ActionAddressOf<Callable> extends Address ? Callable : never : never : never;
|
|
33
39
|
export type Action<Callable extends ResolvedCallable, Definitions extends Integrations = Readonly<Record<never, never>>, DomainValue extends Domain = Domain, Errors extends DeclaredErrors = NoDeclaredErrors> = (context: ActionContext<Callable, DomainValue, Definitions, Errors>) => Promise<ActionOutputOf<Callable>>;
|
|
34
40
|
declare const ACTION_SCHEMA: unique symbol;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { defineAction } from './define.js';
|
|
2
2
|
export type { Action, ActionDefinition } from './action.js';
|
|
3
|
-
export type { ActionContext, ActionExecution, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, } from './context.js';
|
|
3
|
+
export type { ActionContext, ActionBinaryInput, ActionExecution, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, } from './context.js';
|
|
4
4
|
export type { ActionBinary, ActionOutputOf } from './output.js';
|
|
5
5
|
export type { DeclaredErrorDefinition, DeclaredErrorFactory, DeclaredErrorFamily, DeclaredErrorOptions, DeclaredErrors, } from '../error/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AuthenticationEvidence,
|
|
1
|
+
import type { AuthenticationEvidence, IdentityId } from '../../platform/auth/index.js';
|
|
2
2
|
import type { BoundClientSession } from '../../platform/client/session/index.js';
|
|
3
3
|
import type { NodeId } from '../../platform/graph/node/index.js';
|
|
4
|
-
import type { CallableInputOf, Domain, ResolvedFunction, ResolvedMethod } from '../../platform/schema/index.js';
|
|
4
|
+
import type { CallableInputOf, CallableInputModeOf, Domain, ResolvedFunction, ResolvedMethod } from '../../platform/schema/index.js';
|
|
5
5
|
import type { HandlerDependencies } from '../dependency/index.js';
|
|
6
6
|
import type { DeclaredErrorFactory, DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
|
|
7
7
|
import type { IntegrationClients, Integrations } from '../integration/index.js';
|
|
@@ -11,11 +11,10 @@ export type ResolvedCallable = ResolvedFunction | ResolvedMethod;
|
|
|
11
11
|
/** Bearer-free caller evidence established before an Action or Workflow runs. */
|
|
12
12
|
export interface AuthenticatedCaller {
|
|
13
13
|
readonly kind: 'authenticated';
|
|
14
|
-
/**
|
|
14
|
+
/** The one Identity whose authority this invocation exercises: ownership and attribution. */
|
|
15
15
|
readonly identity: IdentityId;
|
|
16
|
-
/**
|
|
16
|
+
/** Executor whose credential directly authenticated this invocation (for example this Domain). */
|
|
17
17
|
readonly principal: IdentityId;
|
|
18
|
-
readonly authority: Grant;
|
|
19
18
|
readonly authentication: AuthenticationEvidence;
|
|
20
19
|
}
|
|
21
20
|
export interface AnonymousCaller {
|
|
@@ -34,41 +33,55 @@ export interface ActionExecution {
|
|
|
34
33
|
body(): Uint8Array;
|
|
35
34
|
};
|
|
36
35
|
}
|
|
36
|
+
/** One admitted, single-consumer binary Function request body. */
|
|
37
|
+
export interface ActionBinaryInput {
|
|
38
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
39
|
+
readonly length: number;
|
|
40
|
+
}
|
|
41
|
+
type BinaryInputOf<Callable> = CallableInputModeOf<Callable> extends 'binary' ? {
|
|
42
|
+
readonly body: ActionBinaryInput;
|
|
43
|
+
} : {
|
|
44
|
+
readonly body?: never;
|
|
45
|
+
};
|
|
37
46
|
export interface DomainGraphExecutor<DomainValue extends Domain = Domain> {
|
|
38
47
|
readonly query: QueryExecutor<DomainValue>;
|
|
39
48
|
readonly mutate: MutationExecutor<DomainValue>;
|
|
40
49
|
}
|
|
41
|
-
|
|
50
|
+
/** Whose authority one Kernel call exercises: the incoming caller's or the installed Domain's. */
|
|
51
|
+
export type AuthorityMode = 'caller' | 'self';
|
|
52
|
+
/**
|
|
53
|
+
* One value per selectable authority. `self` exists in every invocation; `caller` exists only when
|
|
54
|
+
* the call carried a credential, so it is absent from a call that carried none.
|
|
55
|
+
*/
|
|
56
|
+
export type AuthoritySelection<Value, Selectable extends AuthorityMode = AuthorityMode> = Readonly<Record<Selectable, Value> & {
|
|
57
|
+
readonly [Absent in Exclude<AuthorityMode, Selectable>]?: never;
|
|
58
|
+
}>;
|
|
59
|
+
export type DomainGraphExecutors<DomainValue extends Domain = Domain, Selectable extends AuthorityMode = AuthorityMode> = Readonly<DomainGraphExecutor<DomainValue> & AuthoritySelection<DomainGraphExecutor<DomainValue>, Selectable>>;
|
|
42
60
|
/** Self-default Kernel session with one level of explicit authority selection. */
|
|
43
|
-
export type DomainKernelSessions = Readonly<BoundClientSession &
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
readonly kernel: null;
|
|
50
|
-
readonly graph: null;
|
|
51
|
-
readonly query?: never;
|
|
52
|
-
readonly mutate?: never;
|
|
53
|
-
} | {
|
|
54
|
-
readonly caller: AuthenticatedCaller;
|
|
55
|
-
readonly dependencies: HandlerDependencies<DomainValue>;
|
|
56
|
-
readonly kernel: DomainKernelSessions;
|
|
57
|
-
readonly graph: DomainGraphExecutors<DomainValue>;
|
|
61
|
+
export type DomainKernelSessions<Selectable extends AuthorityMode = AuthorityMode> = Readonly<BoundClientSession & AuthoritySelection<BoundClientSession, Selectable>>;
|
|
62
|
+
/** What a handler holds toward the Kernel: the installed Domain authority by default. */
|
|
63
|
+
interface DomainCapabilities<DomainValue extends Domain, Selectable extends AuthorityMode> {
|
|
64
|
+
readonly dependencies: HandlerDependencies<DomainValue, Selectable>;
|
|
65
|
+
readonly kernel: DomainKernelSessions<Selectable>;
|
|
66
|
+
readonly graph: DomainGraphExecutors<DomainValue, Selectable>;
|
|
58
67
|
/** Convenience executor using the installed Domain authority (`graph.self`). */
|
|
59
68
|
readonly query: QueryExecutor<DomainValue>;
|
|
60
69
|
/** Convenience executor using the installed Domain authority (`graph.self`). */
|
|
61
70
|
readonly mutate: MutationExecutor<DomainValue>;
|
|
62
|
-
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A call to an `anonymous` callable that carries no credential has no caller, and its handler acts
|
|
74
|
+
* as the installed Domain alone. Every other call also selects its authenticated caller.
|
|
75
|
+
*/
|
|
76
|
+
type AuthorityOf<Callable, DomainValue extends Domain> = Callable extends {
|
|
77
|
+
readonly auth: 'anonymous';
|
|
78
|
+
} ? ({
|
|
79
|
+
readonly caller: AnonymousCaller;
|
|
80
|
+
} & DomainCapabilities<DomainValue, 'self'>) | ({
|
|
63
81
|
readonly caller: AuthenticatedCaller;
|
|
64
|
-
|
|
65
|
-
readonly
|
|
66
|
-
|
|
67
|
-
/** Convenience executor using the installed Domain authority (`graph.self`). */
|
|
68
|
-
readonly query: QueryExecutor<DomainValue>;
|
|
69
|
-
/** Convenience executor using the installed Domain authority (`graph.self`). */
|
|
70
|
-
readonly mutate: MutationExecutor<DomainValue>;
|
|
71
|
-
};
|
|
82
|
+
} & DomainCapabilities<DomainValue, AuthorityMode>) : {
|
|
83
|
+
readonly caller: AuthenticatedCaller;
|
|
84
|
+
} & DomainCapabilities<DomainValue, AuthorityMode>;
|
|
72
85
|
type SelfOf<Callable> = Callable extends ResolvedMethod<unknown, unknown, false> ? {
|
|
73
86
|
readonly self: NodeId;
|
|
74
87
|
} : {
|
|
@@ -83,5 +96,5 @@ export type ActionContext<Callable extends ResolvedCallable, DomainValue extends
|
|
|
83
96
|
readonly execution: ActionExecution;
|
|
84
97
|
/** Construct one implementation-declared safe business error for `throw error(...)`. */
|
|
85
98
|
readonly error: DeclaredErrorFactory<Errors>;
|
|
86
|
-
} & AuthorityOf<Callable, DomainValue> & SelfOf<Callable>;
|
|
99
|
+
} & AuthorityOf<Callable, DomainValue> & SelfOf<Callable> & BinaryInputOf<Callable>;
|
|
87
100
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { schema } from '../../platform/schema/index.js';
|
|
2
2
|
import type { DeclaredErrorOptions, DeclaredErrors, NoDeclaredErrors } from '../error/index.js';
|
|
3
3
|
import type { Integrations } from '../integration/index.js';
|
|
4
|
-
import type { Action,
|
|
4
|
+
import type { Action, ActionDefinition, CallableAtAddress, ImmediateActionAddress, ResolvedDomainOf } from './action.js';
|
|
5
5
|
import type { ResolvedCallable } from './context.js';
|
|
6
6
|
/** Define one simple single-step implementation by its SDK Action address. */
|
|
7
7
|
export declare function defineAction<Schema extends schema.DomainSchema, Definitions extends Integrations = Readonly<Record<never, never>>>(): {
|
|
8
|
-
<const Address extends
|
|
9
|
-
<const Address extends
|
|
8
|
+
<const Address extends ImmediateActionAddress<Schema>>(address: Address, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, NoDeclaredErrors>): ActionDefinition<Schema, Address, Definitions, NoDeclaredErrors>;
|
|
9
|
+
<const Address extends ImmediateActionAddress<Schema>, const Errors extends DeclaredErrors>(address: Address, options: DeclaredErrorOptions<Errors>, run: Action<Extract<CallableAtAddress<Schema, Address>, ResolvedCallable>, Definitions, ResolvedDomainOf<Schema>, Errors>): ActionDefinition<Schema, Address, Definitions, Errors>;
|
|
10
10
|
};
|
|
11
11
|
/** True only for an Action produced by defineAction in this SDK package root. */
|
|
12
12
|
export declare function isAction(input: unknown): input is ActionDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { defineAction, isAction } from './define.js';
|
|
2
2
|
export type { Action, ActionAddress, ActionAddressOf, ActionDefinition, CallableAtAddress, LocalCallable, ResolvedDomainOf, } from './action.js';
|
|
3
|
-
export type { ActionContext, ActionExecution, AnonymousCaller, AuthenticatedCaller, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, ResolvedCallable, } from './context.js';
|
|
3
|
+
export type { ActionContext, ActionBinaryInput, ActionExecution, AnonymousCaller, AuthenticatedCaller, AuthorityMode, AuthoritySelection, Caller, DomainGraphExecutor, DomainGraphExecutors, DomainKernelSessions, ResolvedCallable, } from './context.js';
|
|
4
4
|
export type { ActionBinary, ActionOutputOf } from './output.js';
|
|
5
5
|
export type { DeclaredErrorDefinition, DeclaredErrorFactory, DeclaredErrorFamily, DeclaredErrorOptions, DeclaredErrors, } from '../error/index.js';
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import type { schema } from '../platform/schema/index.js';
|
|
2
|
-
import type {
|
|
1
|
+
import type { ClassIcon, schema } from '../platform/schema/index.js';
|
|
2
|
+
import type { DomainDefinition } from './domain.js';
|
|
3
3
|
import type { Requirements } from './requirements/index.js';
|
|
4
4
|
import type { Routes } from './routes/index.js';
|
|
5
5
|
import type { Runtime } from './runtime/index.js';
|
|
6
6
|
import type { Frontend } from './view/index.js';
|
|
7
|
-
export interface
|
|
7
|
+
export interface DomainDefinitionInput<Schema extends schema.DomainSchema, RuntimeValue extends Runtime<Schema>, FrontendValue extends Frontend<Schema> | undefined, RoutesValue extends Routes | undefined, RequirementsValue extends Requirements | undefined> {
|
|
8
8
|
readonly schema: Schema;
|
|
9
9
|
readonly runtime: RuntimeValue;
|
|
10
10
|
readonly frontend?: FrontendValue;
|
|
11
11
|
readonly routes?: RoutesValue;
|
|
12
12
|
readonly requirements?: RequirementsValue;
|
|
13
|
+
/** The application's icon, made with `classIcon.svg(...)` or `classIcon.lucide(...)`. */
|
|
14
|
+
readonly icon?: ClassIcon;
|
|
13
15
|
}
|
|
14
|
-
/** Capture one inert authored
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
16
|
+
/** Capture one inert authored Domain without resolving, compiling, loading, or deploying it. */
|
|
17
|
+
export declare function defineDomain<const Schema extends schema.DomainSchema, const RuntimeValue extends Runtime<Schema>, const FrontendValue extends Frontend<Schema> | undefined = undefined, const RoutesValue extends Routes | undefined = undefined, const RequirementsValue extends Requirements | undefined = undefined>(input: DomainDefinitionInput<Schema, RuntimeValue, FrontendValue, RoutesValue, RequirementsValue>): DomainDefinition<Schema, RuntimeValue, FrontendValue, RoutesValue, RequirementsValue>;
|
|
18
|
+
export declare function isDomainDefinition(input: unknown): input is DomainDefinition;
|
|
@@ -1,40 +1,54 @@
|
|
|
1
|
+
import { admitClassIconSvg } from '../platform/schema/class-icon-svg.js';
|
|
1
2
|
import { isRequirements } from './requirements/index.js';
|
|
2
3
|
import { isRoutes } from './routes/index.js';
|
|
3
4
|
import { isRuntime } from './runtime/index.js';
|
|
4
5
|
import { isFrontend } from './view/index.js';
|
|
5
|
-
const
|
|
6
|
-
/** Capture one inert authored
|
|
7
|
-
export function
|
|
6
|
+
const admittedDomainDefinitions = new WeakSet();
|
|
7
|
+
/** Capture one inert authored Domain without resolving, compiling, loading, or deploying it. */
|
|
8
|
+
export function defineDomain(input) {
|
|
8
9
|
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
9
10
|
invalid();
|
|
10
|
-
const allowed = new Set([
|
|
11
|
+
const allowed = new Set([
|
|
12
|
+
'schema',
|
|
13
|
+
'runtime',
|
|
14
|
+
'frontend',
|
|
15
|
+
'routes',
|
|
16
|
+
'requirements',
|
|
17
|
+
'icon',
|
|
18
|
+
]);
|
|
11
19
|
if (Reflect.ownKeys(input).some((key) => !allowed.has(key)))
|
|
12
20
|
invalid();
|
|
21
|
+
if (typeof input.schema?.name !== 'string') {
|
|
22
|
+
throw new TypeError(`Domain Schema ${String(input.schema?.origin)} must declare its name: defineSchema(origin, { name, ... }).`);
|
|
23
|
+
}
|
|
13
24
|
if (!isRuntime(input.runtime))
|
|
14
|
-
throw new TypeError('
|
|
25
|
+
throw new TypeError('Domain Runtime is not admitted.');
|
|
15
26
|
if (input.frontend !== undefined &&
|
|
16
27
|
(!isFrontend(input.frontend) || input.frontend.schema !== input.schema)) {
|
|
17
|
-
throw new TypeError('
|
|
28
|
+
throw new TypeError('Domain Frontend is not admitted for its exact Schema.');
|
|
18
29
|
}
|
|
19
30
|
if (input.routes !== undefined && !isRoutes(input.routes)) {
|
|
20
|
-
throw new TypeError('
|
|
31
|
+
throw new TypeError('Domain routes are not admitted.');
|
|
21
32
|
}
|
|
22
33
|
if (input.requirements !== undefined && !isRequirements(input.requirements)) {
|
|
23
|
-
throw new TypeError('
|
|
34
|
+
throw new TypeError('Domain requirements are not admitted.');
|
|
24
35
|
}
|
|
25
|
-
|
|
36
|
+
// The same admission as a Node Class icon: one self-contained inline SVG.
|
|
37
|
+
const icon = input.icon === undefined ? undefined : admitClassIconSvg(input.icon);
|
|
38
|
+
const domain = Object.freeze({
|
|
26
39
|
schema: input.schema,
|
|
27
40
|
runtime: input.runtime,
|
|
28
41
|
...(input.frontend === undefined ? {} : { frontend: input.frontend }),
|
|
29
42
|
...(input.routes === undefined ? {} : { routes: input.routes }),
|
|
30
43
|
...(input.requirements === undefined ? {} : { requirements: input.requirements }),
|
|
44
|
+
...(icon === undefined ? {} : { icon }),
|
|
31
45
|
});
|
|
32
|
-
|
|
33
|
-
return
|
|
46
|
+
admittedDomainDefinitions.add(domain);
|
|
47
|
+
return domain;
|
|
34
48
|
}
|
|
35
|
-
export function
|
|
36
|
-
return input !== null && typeof input === 'object' &&
|
|
49
|
+
export function isDomainDefinition(input) {
|
|
50
|
+
return input !== null && typeof input === 'object' && admittedDomainDefinitions.has(input);
|
|
37
51
|
}
|
|
38
52
|
function invalid() {
|
|
39
|
-
throw new TypeError('
|
|
53
|
+
throw new TypeError('Domain definition may contain only schema, runtime, frontend, routes, requirements, and icon.');
|
|
40
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { DependencyCallOptions, DependencyInvoker, HandlerDependencies } from './invoker.js';
|
|
1
|
+
export type { DependencyBinaryCallOptions, DependencyCallOptions, DependencyInvoker, HandlerDependencies, } from './invoker.js';
|