@astrale-os/sdk 0.4.19 → 0.5.0-beta.2
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 +5 -3
- package/dist/auth/exchange.d.ts +11 -0
- package/dist/auth/exchange.d.ts.map +1 -0
- package/dist/auth/exchange.js +8 -0
- package/dist/auth/exchange.js.map +1 -0
- package/dist/auth/index.d.ts +4 -15
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +3 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/capability/client.d.ts +25 -0
- package/dist/capability/client.d.ts.map +1 -0
- package/dist/capability/client.js +147 -0
- package/dist/capability/client.js.map +1 -0
- package/dist/capability/contract.d.ts +70 -0
- package/dist/capability/contract.d.ts.map +1 -0
- package/dist/capability/contract.js +3 -0
- package/dist/capability/contract.js.map +1 -0
- package/dist/capability/define.d.ts +14 -0
- package/dist/capability/define.d.ts.map +1 -0
- package/dist/capability/define.js +145 -0
- package/dist/capability/define.js.map +1 -0
- package/dist/capability/index.d.ts +3 -0
- package/dist/capability/index.d.ts.map +1 -0
- package/dist/capability/index.js +2 -0
- package/dist/capability/index.js.map +1 -0
- package/dist/cli/arguments.d.ts +21 -0
- package/dist/cli/arguments.d.ts.map +1 -0
- package/dist/cli/arguments.js +220 -0
- package/dist/cli/arguments.js.map +1 -0
- package/dist/cli/dotenv.d.ts +1 -4
- package/dist/cli/dotenv.d.ts.map +1 -1
- package/dist/cli/dotenv.js +6 -15
- package/dist/cli/dotenv.js.map +1 -1
- package/dist/cli/index.d.ts +4 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/run.d.ts +4 -79
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +47 -326
- package/dist/cli/run.js.map +1 -1
- package/dist/deployment/artifact/bindings.d.ts +7 -0
- package/dist/deployment/artifact/bindings.d.ts.map +1 -0
- package/dist/deployment/artifact/bindings.js +44 -0
- package/dist/deployment/artifact/bindings.js.map +1 -0
- package/dist/deployment/artifact/deployment.d.ts +35 -0
- package/dist/deployment/artifact/deployment.d.ts.map +1 -0
- package/dist/deployment/artifact/deployment.js +91 -0
- package/dist/deployment/artifact/deployment.js.map +1 -0
- package/dist/deployment/artifact/index.d.ts +5 -0
- package/dist/deployment/artifact/index.d.ts.map +1 -0
- package/dist/deployment/artifact/index.js +4 -0
- package/dist/deployment/artifact/index.js.map +1 -0
- package/dist/deployment/check/check.d.ts +8 -0
- package/dist/deployment/check/check.d.ts.map +1 -0
- package/dist/deployment/check/check.js +94 -0
- package/dist/deployment/check/check.js.map +1 -0
- package/dist/deployment/check/contract.d.ts +29 -0
- package/dist/deployment/check/contract.d.ts.map +1 -0
- package/dist/deployment/check/contract.js +2 -0
- package/dist/deployment/check/contract.js.map +1 -0
- package/dist/deployment/check/index.d.ts +3 -0
- package/dist/deployment/check/index.d.ts.map +1 -0
- package/dist/deployment/check/index.js +2 -0
- package/dist/deployment/check/index.js.map +1 -0
- package/dist/deployment/index.d.ts +7 -0
- package/dist/deployment/index.d.ts.map +1 -0
- package/dist/deployment/index.js +4 -0
- package/dist/deployment/index.js.map +1 -0
- package/dist/deployment/provider/adapter.d.ts +56 -0
- package/dist/deployment/provider/adapter.d.ts.map +1 -0
- package/dist/deployment/provider/adapter.js +84 -0
- package/dist/deployment/provider/adapter.js.map +1 -0
- package/dist/deployment/provider/config.d.ts +10 -0
- package/dist/deployment/provider/config.d.ts.map +1 -0
- package/dist/deployment/provider/config.js +8 -0
- package/dist/deployment/provider/config.js.map +1 -0
- package/dist/deployment/provider/index.d.ts +5 -0
- package/dist/deployment/provider/index.d.ts.map +1 -0
- package/dist/deployment/provider/index.js +3 -0
- package/dist/deployment/provider/index.js.map +1 -0
- package/dist/domain/app.d.ts +34 -0
- package/dist/domain/app.d.ts.map +1 -0
- package/dist/domain/app.js +2 -0
- package/dist/domain/app.js.map +1 -0
- package/dist/domain/context.d.ts +68 -0
- package/dist/domain/context.d.ts.map +1 -0
- package/dist/domain/context.js +2 -0
- package/dist/domain/context.js.map +1 -0
- package/dist/domain/define.d.ts +99 -65
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +78 -60
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/handlers.d.ts +53 -0
- package/dist/domain/handlers.d.ts.map +1 -0
- package/dist/domain/handlers.js +88 -0
- package/dist/domain/handlers.js.map +1 -0
- package/dist/domain/implement.d.ts +5 -0
- package/dist/domain/implement.d.ts.map +1 -0
- package/dist/domain/implement.js +23 -0
- package/dist/domain/implement.js.map +1 -0
- package/dist/domain/index.d.ts +13 -4
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +7 -3
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/requirements.d.ts +26 -0
- package/dist/domain/requirements.d.ts.map +1 -0
- package/dist/domain/requirements.js +98 -0
- package/dist/domain/requirements.js.map +1 -0
- package/dist/graph/class/index.d.ts +3 -0
- package/dist/graph/class/index.d.ts.map +1 -0
- package/dist/graph/class/index.js +3 -0
- package/dist/graph/class/index.js.map +1 -0
- package/dist/graph/edge/index.d.ts +3 -0
- package/dist/graph/edge/index.d.ts.map +1 -0
- package/dist/graph/edge/index.js +3 -0
- package/dist/graph/edge/index.js.map +1 -0
- package/dist/graph/index.d.ts +10 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +9 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model/index.d.ts +3 -0
- package/dist/graph/model/index.d.ts.map +1 -0
- package/dist/graph/model/index.js +3 -0
- package/dist/graph/model/index.js.map +1 -0
- package/dist/graph/node/index.d.ts +3 -0
- package/dist/graph/node/index.d.ts.map +1 -0
- package/dist/graph/node/index.js +3 -0
- package/dist/graph/node/index.js.map +1 -0
- package/dist/graph/path/index.d.ts +3 -0
- package/dist/graph/path/index.d.ts.map +1 -0
- package/dist/graph/path/index.js +3 -0
- package/dist/graph/path/index.js.map +1 -0
- package/dist/graph/properties/index.d.ts +3 -0
- package/dist/graph/properties/index.d.ts.map +1 -0
- package/dist/graph/properties/index.js +3 -0
- package/dist/graph/properties/index.js.map +1 -0
- package/dist/index.d.ts +20 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -47
- package/dist/index.js.map +1 -1
- package/dist/invocation/handler.d.ts +51 -0
- package/dist/invocation/handler.d.ts.map +1 -0
- package/dist/invocation/handler.js +289 -0
- package/dist/invocation/handler.js.map +1 -0
- package/dist/invocation/index.d.ts +3 -0
- package/dist/invocation/index.d.ts.map +1 -0
- package/dist/invocation/index.js +2 -0
- package/dist/invocation/index.js.map +1 -0
- package/dist/invocation/receiver.d.ts +5 -0
- package/dist/invocation/receiver.d.ts.map +1 -0
- package/dist/invocation/receiver.js +70 -0
- package/dist/invocation/receiver.js.map +1 -0
- package/dist/invocation/result.d.ts +5 -0
- package/dist/invocation/result.d.ts.map +1 -0
- package/dist/invocation/result.js +146 -0
- package/dist/invocation/result.js.map +1 -0
- package/dist/invocation/selection.d.ts +21 -0
- package/dist/invocation/selection.d.ts.map +1 -0
- package/dist/invocation/selection.js +107 -0
- package/dist/invocation/selection.js.map +1 -0
- package/dist/linter/adapters/typescript/discover.d.ts +4 -0
- package/dist/linter/adapters/typescript/discover.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/discover.js +412 -0
- package/dist/linter/adapters/typescript/discover.js.map +1 -0
- package/dist/linter/adapters/typescript/evidence-admission.d.ts +5 -0
- package/dist/linter/adapters/typescript/evidence-admission.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/evidence-admission.js +22 -0
- package/dist/linter/adapters/typescript/evidence-admission.js.map +1 -0
- package/dist/linter/adapters/typescript/imports.d.ts +7 -0
- package/dist/linter/adapters/typescript/imports.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/imports.js +171 -0
- package/dist/linter/adapters/typescript/imports.js.map +1 -0
- package/dist/linter/adapters/typescript/index.d.ts +48 -0
- package/dist/linter/adapters/typescript/index.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/index.js +8 -0
- package/dist/linter/adapters/typescript/index.js.map +1 -0
- package/dist/linter/adapters/typescript/query-observation.d.ts +4 -0
- package/dist/linter/adapters/typescript/query-observation.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/query-observation.js +172 -0
- package/dist/linter/adapters/typescript/query-observation.js.map +1 -0
- package/dist/linter/adapters/typescript/suppression-directives.d.ts +5 -0
- package/dist/linter/adapters/typescript/suppression-directives.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/suppression-directives.js +85 -0
- package/dist/linter/adapters/typescript/suppression-directives.js.map +1 -0
- package/dist/linter/adapters/typescript/syntax.d.ts +39 -0
- package/dist/linter/adapters/typescript/syntax.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/syntax.js +183 -0
- package/dist/linter/adapters/typescript/syntax.js.map +1 -0
- package/dist/linter/adapters/typescript/type-universe.d.ts +2 -0
- package/dist/linter/adapters/typescript/type-universe.d.ts.map +1 -0
- package/dist/linter/adapters/typescript/type-universe.js +265 -0
- package/dist/linter/adapters/typescript/type-universe.js.map +1 -0
- package/dist/linter/catalog/compile.d.ts +3 -0
- package/dist/linter/catalog/compile.d.ts.map +1 -0
- package/dist/linter/catalog/compile.js +111 -0
- package/dist/linter/catalog/compile.js.map +1 -0
- package/dist/linter/catalog/index.d.ts +19 -0
- package/dist/linter/catalog/index.d.ts.map +1 -0
- package/dist/linter/catalog/index.js +3 -0
- package/dist/linter/catalog/index.js.map +1 -0
- package/dist/linter/catalog/revision.d.ts +7 -0
- package/dist/linter/catalog/revision.d.ts.map +1 -0
- package/dist/linter/catalog/revision.js +13 -0
- package/dist/linter/catalog/revision.js.map +1 -0
- package/dist/linter/diagnostics/error.d.ts +10 -0
- package/dist/linter/diagnostics/error.d.ts.map +1 -0
- package/dist/linter/diagnostics/error.js +10 -0
- package/dist/linter/diagnostics/error.js.map +1 -0
- package/dist/linter/diagnostics/index.d.ts +29 -0
- package/dist/linter/diagnostics/index.d.ts.map +1 -0
- package/dist/linter/diagnostics/index.js +3 -0
- package/dist/linter/diagnostics/index.js.map +1 -0
- package/dist/linter/diagnostics/sort.d.ts +3 -0
- package/dist/linter/diagnostics/sort.d.ts.map +1 -0
- package/dist/linter/diagnostics/sort.js +27 -0
- package/dist/linter/diagnostics/sort.js.map +1 -0
- package/dist/linter/evaluation/binding/bind.d.ts +5 -0
- package/dist/linter/evaluation/binding/bind.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/bind.js +356 -0
- package/dist/linter/evaluation/binding/bind.js.map +1 -0
- package/dist/linter/evaluation/binding/diagnostic.d.ts +5 -0
- package/dist/linter/evaluation/binding/diagnostic.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/diagnostic.js +17 -0
- package/dist/linter/evaluation/binding/diagnostic.js.map +1 -0
- package/dist/linter/evaluation/binding/index.d.ts +2 -0
- package/dist/linter/evaluation/binding/index.d.ts.map +1 -0
- package/dist/linter/evaluation/binding/index.js +2 -0
- package/dist/linter/evaluation/binding/index.js.map +1 -0
- package/dist/linter/evaluation/contract/availability.d.ts +28 -0
- package/dist/linter/evaluation/contract/availability.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/availability.js +2 -0
- package/dist/linter/evaluation/contract/availability.js.map +1 -0
- package/dist/linter/evaluation/contract/decision.d.ts +26 -0
- package/dist/linter/evaluation/contract/decision.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/decision.js +2 -0
- package/dist/linter/evaluation/contract/decision.js.map +1 -0
- package/dist/linter/evaluation/contract/evidence.d.ts +12 -0
- package/dist/linter/evaluation/contract/evidence.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/evidence.js +2 -0
- package/dist/linter/evaluation/contract/evidence.js.map +1 -0
- package/dist/linter/evaluation/contract/implementation.d.ts +22 -0
- package/dist/linter/evaluation/contract/implementation.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/implementation.js +2 -0
- package/dist/linter/evaluation/contract/implementation.js.map +1 -0
- package/dist/linter/evaluation/contract/index.d.ts +5 -0
- package/dist/linter/evaluation/contract/index.d.ts.map +1 -0
- package/dist/linter/evaluation/contract/index.js +2 -0
- package/dist/linter/evaluation/contract/index.js.map +1 -0
- package/dist/linter/evaluation/index.d.ts +3 -0
- package/dist/linter/evaluation/index.d.ts.map +1 -0
- package/dist/linter/evaluation/index.js +2 -0
- package/dist/linter/evaluation/index.js.map +1 -0
- package/dist/linter/implementations/source/capabilities.d.ts +3 -0
- package/dist/linter/implementations/source/capabilities.d.ts.map +1 -0
- package/dist/linter/implementations/source/capabilities.js +41 -0
- package/dist/linter/implementations/source/capabilities.js.map +1 -0
- package/dist/linter/implementations/source/contract.d.ts +17 -0
- package/dist/linter/implementations/source/contract.d.ts.map +1 -0
- package/dist/linter/implementations/source/contract.js +53 -0
- package/dist/linter/implementations/source/contract.js.map +1 -0
- package/dist/linter/implementations/source/functions.d.ts +3 -0
- package/dist/linter/implementations/source/functions.d.ts.map +1 -0
- package/dist/linter/implementations/source/functions.js +102 -0
- package/dist/linter/implementations/source/functions.js.map +1 -0
- package/dist/linter/implementations/source/global.d.ts +3 -0
- package/dist/linter/implementations/source/global.d.ts.map +1 -0
- package/dist/linter/implementations/source/global.js +812 -0
- package/dist/linter/implementations/source/global.js.map +1 -0
- package/dist/linter/implementations/source/index.d.ts +4 -0
- package/dist/linter/implementations/source/index.d.ts.map +1 -0
- package/dist/linter/implementations/source/index.js +4 -0
- package/dist/linter/implementations/source/index.js.map +1 -0
- package/dist/linter/implementations/source/integrations.d.ts +3 -0
- package/dist/linter/implementations/source/integrations.d.ts.map +1 -0
- package/dist/linter/implementations/source/integrations.js +186 -0
- package/dist/linter/implementations/source/integrations.js.map +1 -0
- package/dist/linter/implementations/source/migrations.d.ts +3 -0
- package/dist/linter/implementations/source/migrations.d.ts.map +1 -0
- package/dist/linter/implementations/source/migrations.js +115 -0
- package/dist/linter/implementations/source/migrations.js.map +1 -0
- package/dist/linter/implementations/source/mutations.d.ts +3 -0
- package/dist/linter/implementations/source/mutations.d.ts.map +1 -0
- package/dist/linter/implementations/source/mutations.js +185 -0
- package/dist/linter/implementations/source/mutations.js.map +1 -0
- package/dist/linter/implementations/source/queries.d.ts +3 -0
- package/dist/linter/implementations/source/queries.d.ts.map +1 -0
- package/dist/linter/implementations/source/queries.js +1000 -0
- package/dist/linter/implementations/source/queries.js.map +1 -0
- package/dist/linter/implementations/source/rules.d.ts +3 -0
- package/dist/linter/implementations/source/rules.d.ts.map +1 -0
- package/dist/linter/implementations/source/rules.js +141 -0
- package/dist/linter/implementations/source/rules.js.map +1 -0
- package/dist/linter/implementations/source/schema.d.ts +3 -0
- package/dist/linter/implementations/source/schema.d.ts.map +1 -0
- package/dist/linter/implementations/source/schema.js +105 -0
- package/dist/linter/implementations/source/schema.js.map +1 -0
- package/dist/linter/implementations/source/shared.d.ts +42 -0
- package/dist/linter/implementations/source/shared.d.ts.map +1 -0
- package/dist/linter/implementations/source/shared.js +239 -0
- package/dist/linter/implementations/source/shared.js.map +1 -0
- package/dist/linter/implementations/source/states.d.ts +3 -0
- package/dist/linter/implementations/source/states.d.ts.map +1 -0
- package/dist/linter/implementations/source/states.js +2 -0
- package/dist/linter/implementations/source/states.js.map +1 -0
- package/dist/linter/implementations/source/tests.d.ts +3 -0
- package/dist/linter/implementations/source/tests.d.ts.map +1 -0
- package/dist/linter/implementations/source/tests.js +28 -0
- package/dist/linter/implementations/source/tests.js.map +1 -0
- package/dist/linter/implementations/source/ui.d.ts +3 -0
- package/dist/linter/implementations/source/ui.d.ts.map +1 -0
- package/dist/linter/implementations/source/ui.js +21 -0
- package/dist/linter/implementations/source/ui.js.map +1 -0
- package/dist/linter/implementations/source/utils.d.ts +3 -0
- package/dist/linter/implementations/source/utils.d.ts.map +1 -0
- package/dist/linter/implementations/source/utils.js +29 -0
- package/dist/linter/implementations/source/utils.js.map +1 -0
- package/dist/linter/implementations/source/verifiers.d.ts +3 -0
- package/dist/linter/implementations/source/verifiers.d.ts.map +1 -0
- package/dist/linter/implementations/source/verifiers.js +33 -0
- package/dist/linter/implementations/source/verifiers.js.map +1 -0
- package/dist/linter/implementations/source/views.d.ts +3 -0
- package/dist/linter/implementations/source/views.d.ts.map +1 -0
- package/dist/linter/implementations/source/views.js +36 -0
- package/dist/linter/implementations/source/views.js.map +1 -0
- package/dist/linter/implementations/source/workflows.d.ts +3 -0
- package/dist/linter/implementations/source/workflows.d.ts.map +1 -0
- package/dist/linter/implementations/source/workflows.js +308 -0
- package/dist/linter/implementations/source/workflows.js.map +1 -0
- package/dist/linter/index.d.ts +7 -8
- package/dist/linter/index.d.ts.map +1 -1
- package/dist/linter/index.js +2 -4
- package/dist/linter/index.js.map +1 -1
- package/dist/linter/lint.d.ts +22 -8
- package/dist/linter/lint.d.ts.map +1 -1
- package/dist/linter/lint.js +58 -15
- package/dist/linter/lint.js.map +1 -1
- package/dist/linter/oxlint/index.d.ts +4 -0
- package/dist/linter/oxlint/index.d.ts.map +1 -0
- package/dist/linter/oxlint/index.js +2 -0
- package/dist/linter/oxlint/index.js.map +1 -0
- package/dist/linter/oxlint/process.d.ts +6 -6
- package/dist/linter/oxlint/process.d.ts.map +1 -1
- package/dist/linter/oxlint/process.js +1 -1
- package/dist/linter/oxlint/process.js.map +1 -1
- package/dist/linter/oxlint/run.d.ts +5 -5
- package/dist/linter/oxlint/run.d.ts.map +1 -1
- package/dist/linter/oxlint/run.js +140 -20
- package/dist/linter/oxlint/run.js.map +1 -1
- package/dist/linter/oxlint-config/ignore-patterns.d.ts +6 -0
- package/dist/linter/oxlint-config/ignore-patterns.d.ts.map +1 -0
- package/dist/linter/oxlint-config/ignore-patterns.js +10 -0
- package/dist/linter/oxlint-config/ignore-patterns.js.map +1 -0
- package/dist/linter/oxlint-config/index.d.ts +5 -0
- package/dist/linter/oxlint-config/index.d.ts.map +1 -0
- package/dist/linter/oxlint-config/index.js +18 -0
- package/dist/linter/oxlint-config/index.js.map +1 -0
- package/dist/linter/packs/domain.d.ts +3 -0
- package/dist/linter/packs/domain.d.ts.map +1 -0
- package/dist/linter/packs/domain.js +8 -0
- package/dist/linter/packs/domain.js.map +1 -0
- package/dist/linter/packs/index.d.ts +9 -0
- package/dist/linter/packs/index.d.ts.map +1 -0
- package/dist/linter/packs/index.js +2 -0
- package/dist/linter/packs/index.js.map +1 -0
- package/dist/linter/policy/compile.d.ts +3 -0
- package/dist/linter/policy/compile.d.ts.map +1 -0
- package/dist/linter/policy/compile.js +256 -0
- package/dist/linter/policy/compile.js.map +1 -0
- package/dist/linter/policy/generated.d.ts +5 -0
- package/dist/linter/policy/generated.d.ts.map +1 -0
- package/dist/linter/policy/generated.js +764 -0
- package/dist/linter/policy/generated.js.map +1 -0
- package/dist/linter/policy/index.d.ts +43 -0
- package/dist/linter/policy/index.d.ts.map +1 -0
- package/dist/linter/policy/index.js +3 -0
- package/dist/linter/policy/index.js.map +1 -0
- package/dist/linter/qualification/index.d.ts +11 -0
- package/dist/linter/qualification/index.d.ts.map +1 -0
- package/dist/linter/qualification/index.js +3 -0
- package/dist/linter/qualification/index.js.map +1 -0
- package/dist/linter/qualification/query-fixtures.d.ts +3 -0
- package/dist/linter/qualification/query-fixtures.d.ts.map +1 -0
- package/dist/linter/qualification/query-fixtures.js +69 -0
- package/dist/linter/qualification/query-fixtures.js.map +1 -0
- package/dist/linter/qualification/runner.d.ts +4 -0
- package/dist/linter/qualification/runner.d.ts.map +1 -0
- package/dist/linter/qualification/runner.js +7 -0
- package/dist/linter/qualification/runner.js.map +1 -0
- package/dist/linter/report/format.d.ts +4 -0
- package/dist/linter/report/format.d.ts.map +1 -0
- package/dist/linter/report/format.js +33 -0
- package/dist/linter/report/format.js.map +1 -0
- package/dist/linter/report/index.d.ts +3 -0
- package/dist/linter/report/index.d.ts.map +1 -0
- package/dist/linter/report/index.js +2 -0
- package/dist/linter/report/index.js.map +1 -0
- package/dist/linter/requirements/index.d.ts +3 -0
- package/dist/linter/requirements/index.d.ts.map +1 -0
- package/dist/linter/requirements/index.js +2 -0
- package/dist/linter/requirements/index.js.map +1 -0
- package/dist/linter/requirements/model.d.ts +9 -0
- package/dist/linter/requirements/model.d.ts.map +1 -0
- package/dist/linter/requirements/model.js +2 -0
- package/dist/linter/requirements/model.js.map +1 -0
- package/dist/linter/requirements/registry.d.ts +4 -0
- package/dist/linter/requirements/registry.d.ts.map +1 -0
- package/dist/linter/requirements/registry.js +188 -0
- package/dist/linter/requirements/registry.js.map +1 -0
- package/dist/linter/semantics/query/decision.d.ts +5 -0
- package/dist/linter/semantics/query/decision.d.ts.map +1 -0
- package/dist/linter/semantics/query/decision.js +74 -0
- package/dist/linter/semantics/query/decision.js.map +1 -0
- package/dist/linter/semantics/query/index.d.ts +4 -0
- package/dist/linter/semantics/query/index.d.ts.map +1 -0
- package/dist/linter/semantics/query/index.js +3 -0
- package/dist/linter/semantics/query/index.js.map +1 -0
- package/dist/linter/semantics/query/observation.d.ts +36 -0
- package/dist/linter/semantics/query/observation.d.ts.map +1 -0
- package/dist/linter/semantics/query/observation.js +13 -0
- package/dist/linter/semantics/query/observation.js.map +1 -0
- package/dist/linter/suppression/apply.d.ts +4 -0
- package/dist/linter/suppression/apply.d.ts.map +1 -0
- package/dist/linter/suppression/apply.js +48 -0
- package/dist/linter/suppression/apply.js.map +1 -0
- package/dist/linter/suppression/directive.d.ts +11 -0
- package/dist/linter/suppression/directive.d.ts.map +1 -0
- package/dist/linter/suppression/directive.js +2 -0
- package/dist/linter/suppression/directive.js.map +1 -0
- package/dist/linter/suppression/index.d.ts +14 -0
- package/dist/linter/suppression/index.d.ts.map +1 -0
- package/dist/linter/suppression/index.js +2 -0
- package/dist/linter/suppression/index.js.map +1 -0
- package/dist/mutation/contract.d.ts +134 -0
- package/dist/mutation/contract.d.ts.map +1 -0
- package/dist/mutation/contract.js +2 -0
- package/dist/mutation/contract.js.map +1 -0
- package/dist/mutation/define.d.ts +9 -0
- package/dist/mutation/define.d.ts.map +1 -0
- package/dist/mutation/define.js +24 -0
- package/dist/mutation/define.js.map +1 -0
- package/dist/mutation/errors.d.ts +3 -0
- package/dist/mutation/errors.d.ts.map +1 -0
- package/dist/mutation/errors.js +30 -0
- package/dist/mutation/errors.js.map +1 -0
- package/dist/mutation/execute.d.ts +11 -0
- package/dist/mutation/execute.d.ts.map +1 -0
- package/dist/mutation/execute.js +24 -0
- package/dist/mutation/execute.js.map +1 -0
- package/dist/mutation/index.d.ts +8 -0
- package/dist/mutation/index.d.ts.map +1 -0
- package/dist/mutation/index.js +5 -0
- package/dist/mutation/index.js.map +1 -0
- package/dist/mutation/rich.d.ts +4 -0
- package/dist/mutation/rich.d.ts.map +1 -0
- package/dist/mutation/rich.js +147 -0
- package/dist/mutation/rich.js.map +1 -0
- package/dist/query/composite/contract.d.ts +37 -0
- package/dist/query/composite/contract.d.ts.map +1 -0
- package/dist/query/composite/contract.js +2 -0
- package/dist/query/composite/contract.js.map +1 -0
- package/dist/query/composite/errors.d.ts +8 -0
- package/dist/query/composite/errors.d.ts.map +1 -0
- package/dist/query/composite/errors.js +9 -0
- package/dist/query/composite/errors.js.map +1 -0
- package/dist/query/composite/index.d.ts +6 -0
- package/dist/query/composite/index.d.ts.map +1 -0
- package/dist/query/composite/index.js +3 -0
- package/dist/query/composite/index.js.map +1 -0
- package/dist/query/composite/plan.d.ts +38 -0
- package/dist/query/composite/plan.d.ts.map +1 -0
- package/dist/query/composite/plan.js +225 -0
- package/dist/query/composite/plan.js.map +1 -0
- package/dist/query/contract.d.ts +58 -0
- package/dist/query/contract.d.ts.map +1 -0
- package/dist/query/contract.js +2 -0
- package/dist/query/contract.js.map +1 -0
- package/dist/query/define.d.ts +3 -0
- package/dist/query/define.d.ts.map +1 -0
- package/dist/query/define.js +90 -0
- package/dist/query/define.js.map +1 -0
- package/dist/query/definition.d.ts +29 -0
- package/dist/query/definition.d.ts.map +1 -0
- package/dist/query/definition.js +2 -0
- package/dist/query/definition.js.map +1 -0
- package/dist/query/errors.d.ts +9 -0
- package/dist/query/errors.d.ts.map +1 -0
- package/dist/query/errors.js +15 -0
- package/dist/query/errors.js.map +1 -0
- package/dist/query/execute.d.ts +20 -0
- package/dist/query/execute.d.ts.map +1 -0
- package/dist/query/execute.js +97 -0
- package/dist/query/execute.js.map +1 -0
- package/dist/query/index.d.ts +15 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +8 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/node.d.ts +109 -0
- package/dist/query/node.d.ts.map +1 -0
- package/dist/query/node.js +164 -0
- package/dist/query/node.js.map +1 -0
- package/dist/query/result/contract.d.ts +23 -0
- package/dist/query/result/contract.d.ts.map +1 -0
- package/dist/query/result/contract.js +2 -0
- package/dist/query/result/contract.js.map +1 -0
- package/dist/query/result/index.d.ts +3 -0
- package/dist/query/result/index.d.ts.map +1 -0
- package/dist/query/result/index.js +2 -0
- package/dist/query/result/index.js.map +1 -0
- package/dist/query/result/projection.d.ts +3 -0
- package/dist/query/result/projection.d.ts.map +1 -0
- package/dist/query/result/projection.js +100 -0
- package/dist/query/result/projection.js.map +1 -0
- package/dist/query/selection.d.ts +4 -0
- package/dist/query/selection.d.ts.map +1 -0
- package/dist/query/selection.js +25 -0
- package/dist/query/selection.js.map +1 -0
- package/dist/react/compile.d.ts +9 -0
- package/dist/react/compile.d.ts.map +1 -0
- package/dist/react/compile.js +64 -0
- package/dist/react/compile.js.map +1 -0
- package/dist/react/define.d.ts +8 -0
- package/dist/react/define.d.ts.map +1 -0
- package/dist/react/define.js +89 -0
- package/dist/react/define.js.map +1 -0
- package/dist/react/definition.d.ts +69 -0
- package/dist/react/definition.d.ts.map +1 -0
- package/dist/react/definition.js +2 -0
- package/dist/react/definition.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -0
- package/dist/result/index.d.ts +3 -0
- package/dist/result/index.d.ts.map +1 -0
- package/dist/result/index.js +2 -0
- package/dist/result/index.js.map +1 -0
- package/dist/result/result.d.ts +10 -0
- package/dist/result/result.d.ts.map +1 -0
- package/dist/result/result.js +7 -0
- package/dist/result/result.js.map +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/kernel/index.d.ts +3 -0
- package/dist/schema/kernel/index.d.ts.map +1 -0
- package/dist/schema/kernel/index.js +3 -0
- package/dist/schema/kernel/index.js.map +1 -0
- package/dist/schema/v1/index.d.ts +3 -0
- package/dist/schema/v1/index.d.ts.map +1 -0
- package/dist/schema/v1/index.js +3 -0
- package/dist/schema/v1/index.js.map +1 -0
- package/dist/server/application.d.ts +36 -0
- package/dist/server/application.d.ts.map +1 -0
- package/dist/server/application.js +126 -0
- package/dist/server/application.js.map +1 -0
- package/dist/server/index.d.ts +4 -13
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -8
- package/dist/server/index.js.map +1 -1
- package/dist/server/node/index.d.ts +3 -0
- package/dist/server/node/index.d.ts.map +1 -0
- package/dist/server/node/index.js +2 -0
- package/dist/server/node/index.js.map +1 -0
- package/dist/server/node/server.d.ts +14 -0
- package/dist/server/node/server.d.ts.map +1 -0
- package/dist/server/node/server.js +71 -0
- package/dist/server/node/server.js.map +1 -0
- package/dist/server/remote.d.ts +56 -0
- package/dist/server/remote.d.ts.map +1 -0
- package/dist/server/remote.js +798 -0
- package/dist/server/remote.js.map +1 -0
- package/dist/server/source.d.ts +13 -0
- package/dist/server/source.d.ts.map +1 -0
- package/dist/server/source.js +38 -0
- package/dist/server/source.js.map +1 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +2 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/machine.d.ts +28 -0
- package/dist/state/machine.d.ts.map +1 -0
- package/dist/state/machine.js +32 -0
- package/dist/state/machine.js.map +1 -0
- package/dist/state/relation.d.ts +28 -0
- package/dist/state/relation.d.ts.map +1 -0
- package/dist/state/relation.js +48 -0
- package/dist/state/relation.js.map +1 -0
- package/dist/value/index.d.ts +3 -0
- package/dist/value/index.d.ts.map +1 -0
- package/dist/value/index.js +3 -0
- package/dist/value/index.js.map +1 -0
- package/dist/view/admission.d.ts +6 -0
- package/dist/view/admission.d.ts.map +1 -0
- package/dist/view/admission.js +43 -0
- package/dist/view/admission.js.map +1 -0
- package/dist/view/compile.d.ts +15 -0
- package/dist/view/compile.d.ts.map +1 -0
- package/dist/view/compile.js +189 -0
- package/dist/view/compile.js.map +1 -0
- package/dist/view/define.d.ts +20 -0
- package/dist/view/define.d.ts.map +1 -0
- package/dist/view/define.js +236 -0
- package/dist/view/define.js.map +1 -0
- package/dist/view/definition.d.ts +96 -0
- package/dist/view/definition.d.ts.map +1 -0
- package/dist/view/definition.js +2 -0
- package/dist/view/definition.js.map +1 -0
- package/dist/view/index.d.ts +4 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +3 -0
- package/dist/view/index.js.map +1 -0
- package/dist/workflow/binding.d.ts +43 -0
- package/dist/workflow/binding.d.ts.map +1 -0
- package/dist/workflow/binding.js +32 -0
- package/dist/workflow/binding.js.map +1 -0
- package/dist/workflow/contract.d.ts +57 -0
- package/dist/workflow/contract.d.ts.map +1 -0
- package/dist/workflow/contract.js +2 -0
- package/dist/workflow/contract.js.map +1 -0
- package/dist/workflow/define.d.ts +4 -0
- package/dist/workflow/define.d.ts.map +1 -0
- package/dist/workflow/define.js +57 -0
- package/dist/workflow/define.js.map +1 -0
- package/dist/workflow/index.d.ts +7 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +4 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/runner.d.ts +4 -0
- package/dist/workflow/runner.d.ts.map +1 -0
- package/dist/workflow/runner.js +24 -0
- package/dist/workflow/runner.js.map +1 -0
- package/dist/workflow/step/index.d.ts +3 -0
- package/dist/workflow/step/index.d.ts.map +1 -0
- package/dist/workflow/step/index.js +2 -0
- package/dist/workflow/step/index.js.map +1 -0
- package/dist/workflow/step/inline.d.ts +6 -0
- package/dist/workflow/step/inline.d.ts.map +1 -0
- package/dist/workflow/step/inline.js +44 -0
- package/dist/workflow/step/inline.js.map +1 -0
- package/dist/workflow/step/step.d.ts +5 -0
- package/dist/workflow/step/step.d.ts.map +1 -0
- package/dist/workflow/step/step.js +2 -0
- package/dist/workflow/step/step.js.map +1 -0
- package/package.json +117 -24
- package/dist/auth/authenticate.d.ts +0 -24
- package/dist/auth/authenticate.d.ts.map +0 -1
- package/dist/auth/authenticate.js +0 -29
- package/dist/auth/authenticate.js.map +0 -1
- package/dist/auth/check.d.ts +0 -38
- package/dist/auth/check.d.ts.map +0 -1
- package/dist/auth/check.js +0 -50
- package/dist/auth/check.js.map +0 -1
- package/dist/auth/compose.d.ts +0 -41
- package/dist/auth/compose.d.ts.map +0 -1
- package/dist/auth/compose.js +0 -45
- package/dist/auth/compose.js.map +0 -1
- package/dist/auth/errors.d.ts +0 -16
- package/dist/auth/errors.d.ts.map +0 -1
- package/dist/auth/errors.js +0 -26
- package/dist/auth/errors.js.map +0 -1
- package/dist/auth/function-context.d.ts +0 -28
- package/dist/auth/function-context.d.ts.map +0 -1
- package/dist/auth/function-context.js +0 -47
- package/dist/auth/function-context.js.map +0 -1
- package/dist/auth/identity.d.ts +0 -18
- package/dist/auth/identity.d.ts.map +0 -1
- package/dist/auth/identity.js +0 -2
- package/dist/auth/identity.js.map +0 -1
- package/dist/auth/issuer-mint.d.ts +0 -53
- package/dist/auth/issuer-mint.d.ts.map +0 -1
- package/dist/auth/issuer-mint.js +0 -35
- package/dist/auth/issuer-mint.js.map +0 -1
- package/dist/auth/kernel-client.d.ts +0 -37
- package/dist/auth/kernel-client.d.ts.map +0 -1
- package/dist/auth/kernel-client.js +0 -111
- package/dist/auth/kernel-client.js.map +0 -1
- package/dist/auth/resolve.d.ts +0 -19
- package/dist/auth/resolve.d.ts.map +0 -1
- package/dist/auth/resolve.js +0 -43
- package/dist/auth/resolve.js.map +0 -1
- package/dist/auth/sign.d.ts +0 -15
- package/dist/auth/sign.d.ts.map +0 -1
- package/dist/auth/sign.js +0 -24
- package/dist/auth/sign.js.map +0 -1
- package/dist/auth/verify.d.ts +0 -28
- package/dist/auth/verify.d.ts.map +0 -1
- package/dist/auth/verify.js +0 -151
- package/dist/auth/verify.js.map +0 -1
- package/dist/cli/spec.d.ts +0 -19
- package/dist/cli/spec.d.ts.map +0 -1
- package/dist/cli/spec.js +0 -33
- package/dist/cli/spec.js.map +0 -1
- package/dist/config/adapter.d.ts +0 -148
- package/dist/config/adapter.d.ts.map +0 -1
- package/dist/config/adapter.js +0 -40
- package/dist/config/adapter.js.map +0 -1
- package/dist/config/define-domain.d.ts +0 -177
- package/dist/config/define-domain.d.ts.map +0 -1
- package/dist/config/define-domain.js +0 -145
- package/dist/config/define-domain.js.map +0 -1
- package/dist/config/deploy.d.ts +0 -28
- package/dist/config/deploy.d.ts.map +0 -1
- package/dist/config/deploy.js +0 -24
- package/dist/config/deploy.js.map +0 -1
- package/dist/config/index.d.ts +0 -21
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -18
- package/dist/config/index.js.map +0 -1
- package/dist/define/index.d.ts +0 -5
- package/dist/define/index.d.ts.map +0 -1
- package/dist/define/index.js +0 -3
- package/dist/define/index.js.map +0 -1
- package/dist/define/remote-function.d.ts +0 -120
- package/dist/define/remote-function.d.ts.map +0 -1
- package/dist/define/remote-function.js +0 -26
- package/dist/define/remote-function.js.map +0 -1
- package/dist/define/view.d.ts +0 -104
- package/dist/define/view.d.ts.map +0 -1
- package/dist/define/view.js +0 -30
- package/dist/define/view.js.map +0 -1
- package/dist/deploy/check.d.ts +0 -30
- package/dist/deploy/check.d.ts.map +0 -1
- package/dist/deploy/check.js +0 -82
- package/dist/deploy/check.js.map +0 -1
- package/dist/deploy/index.d.ts +0 -3
- package/dist/deploy/index.d.ts.map +0 -1
- package/dist/deploy/index.js +0 -3
- package/dist/deploy/index.js.map +0 -1
- package/dist/deploy/meta.d.ts +0 -29
- package/dist/deploy/meta.d.ts.map +0 -1
- package/dist/deploy/meta.js +0 -45
- package/dist/deploy/meta.js.map +0 -1
- package/dist/dispatch/authorize.d.ts +0 -14
- package/dist/dispatch/authorize.d.ts.map +0 -1
- package/dist/dispatch/authorize.js +0 -24
- package/dist/dispatch/authorize.js.map +0 -1
- package/dist/dispatch/dispatcher.d.ts +0 -59
- package/dist/dispatch/dispatcher.d.ts.map +0 -1
- package/dist/dispatch/dispatcher.js +0 -237
- package/dist/dispatch/dispatcher.js.map +0 -1
- package/dist/dispatch/errors.d.ts +0 -47
- package/dist/dispatch/errors.d.ts.map +0 -1
- package/dist/dispatch/errors.js +0 -76
- package/dist/dispatch/errors.js.map +0 -1
- package/dist/dispatch/execute.d.ts +0 -44
- package/dist/dispatch/execute.d.ts.map +0 -1
- package/dist/dispatch/execute.js +0 -29
- package/dist/dispatch/execute.js.map +0 -1
- package/dist/dispatch/identity.d.ts +0 -75
- package/dist/dispatch/identity.d.ts.map +0 -1
- package/dist/dispatch/identity.js +0 -101
- package/dist/dispatch/identity.js.map +0 -1
- package/dist/dispatch/index.d.ts +0 -7
- package/dist/dispatch/index.d.ts.map +0 -1
- package/dist/dispatch/index.js +0 -7
- package/dist/dispatch/index.js.map +0 -1
- package/dist/dispatch/resolve.d.ts +0 -27
- package/dist/dispatch/resolve.d.ts.map +0 -1
- package/dist/dispatch/resolve.js +0 -65
- package/dist/dispatch/resolve.js.map +0 -1
- package/dist/dispatch/self.d.ts +0 -51
- package/dist/dispatch/self.d.ts.map +0 -1
- package/dist/dispatch/self.js +0 -116
- package/dist/dispatch/self.js.map +0 -1
- package/dist/dispatch/validate.d.ts +0 -35
- package/dist/dispatch/validate.d.ts.map +0 -1
- package/dist/dispatch/validate.js +0 -27
- package/dist/dispatch/validate.js.map +0 -1
- package/dist/domain/binding.d.ts +0 -18
- package/dist/domain/binding.d.ts.map +0 -1
- package/dist/domain/binding.js +0 -29
- package/dist/domain/binding.js.map +0 -1
- package/dist/domain/build-spec.d.ts +0 -37
- package/dist/domain/build-spec.d.ts.map +0 -1
- package/dist/domain/build-spec.js +0 -114
- package/dist/domain/build-spec.js.map +0 -1
- package/dist/domain/contract.d.ts +0 -17
- package/dist/domain/contract.d.ts.map +0 -1
- package/dist/domain/contract.js +0 -26
- package/dist/domain/contract.js.map +0 -1
- package/dist/domain/extend-functions.d.ts +0 -48
- package/dist/domain/extend-functions.d.ts.map +0 -1
- package/dist/domain/extend-functions.js +0 -85
- package/dist/domain/extend-functions.js.map +0 -1
- package/dist/domain/extend-views.d.ts +0 -45
- package/dist/domain/extend-views.d.ts.map +0 -1
- package/dist/domain/extend-views.js +0 -116
- package/dist/domain/extend-views.js.map +0 -1
- package/dist/linter/analyze.d.ts +0 -6
- package/dist/linter/analyze.d.ts.map +0 -1
- package/dist/linter/analyze.js +0 -12
- package/dist/linter/analyze.js.map +0 -1
- package/dist/linter/diagnostic.d.ts +0 -38
- package/dist/linter/diagnostic.d.ts.map +0 -1
- package/dist/linter/diagnostic.js +0 -37
- package/dist/linter/diagnostic.js.map +0 -1
- package/dist/linter/oxlint/config.d.ts +0 -15
- package/dist/linter/oxlint/config.d.ts.map +0 -1
- package/dist/linter/oxlint/config.js +0 -23
- package/dist/linter/oxlint/config.js.map +0 -1
- package/dist/linter/oxlint/ignore-patterns.d.ts +0 -9
- package/dist/linter/oxlint/ignore-patterns.d.ts.map +0 -1
- package/dist/linter/oxlint/ignore-patterns.js +0 -18
- package/dist/linter/oxlint/ignore-patterns.js.map +0 -1
- package/dist/linter/oxlint/plugin.d.ts +0 -13
- package/dist/linter/oxlint/plugin.d.ts.map +0 -1
- package/dist/linter/oxlint/plugin.js +0 -14
- package/dist/linter/oxlint/plugin.js.map +0 -1
- package/dist/linter/preflight.d.ts +0 -2
- package/dist/linter/preflight.d.ts.map +0 -1
- package/dist/linter/preflight.js +0 -162
- package/dist/linter/preflight.js.map +0 -1
- package/dist/linter/project.d.ts +0 -18
- package/dist/linter/project.d.ts.map +0 -1
- package/dist/linter/project.js +0 -150
- package/dist/linter/project.js.map +0 -1
- package/dist/linter/report.d.ts +0 -4
- package/dist/linter/report.d.ts.map +0 -1
- package/dist/linter/report.js +0 -22
- package/dist/linter/report.js.map +0 -1
- package/dist/linter/rules/catalog.d.ts +0 -56
- package/dist/linter/rules/catalog.d.ts.map +0 -1
- package/dist/linter/rules/catalog.js +0 -53
- package/dist/linter/rules/catalog.js.map +0 -1
- package/dist/linter/rules/core-has-no-async.d.ts +0 -3
- package/dist/linter/rules/core-has-no-async.d.ts.map +0 -1
- package/dist/linter/rules/core-has-no-async.js +0 -43
- package/dist/linter/rules/core-has-no-async.js.map +0 -1
- package/dist/linter/rules/core-is-pure.d.ts +0 -3
- package/dist/linter/rules/core-is-pure.d.ts.map +0 -1
- package/dist/linter/rules/core-is-pure.js +0 -74
- package/dist/linter/rules/core-is-pure.js.map +0 -1
- package/dist/linter/rules/no-nested-steps.d.ts +0 -3
- package/dist/linter/rules/no-nested-steps.d.ts.map +0 -1
- package/dist/linter/rules/no-nested-steps.js +0 -32
- package/dist/linter/rules/no-nested-steps.js.map +0 -1
- package/dist/linter/rules/no-read-inside-mutate.d.ts +0 -3
- package/dist/linter/rules/no-read-inside-mutate.d.ts.map +0 -1
- package/dist/linter/rules/no-read-inside-mutate.js +0 -64
- package/dist/linter/rules/no-read-inside-mutate.js.map +0 -1
- package/dist/linter/rules/one-remote-definition-per-file.d.ts +0 -3
- package/dist/linter/rules/one-remote-definition-per-file.d.ts.map +0 -1
- package/dist/linter/rules/one-remote-definition-per-file.js +0 -23
- package/dist/linter/rules/one-remote-definition-per-file.js.map +0 -1
- package/dist/linter/rules/oxlint-ast.d.ts +0 -30
- package/dist/linter/rules/oxlint-ast.d.ts.map +0 -1
- package/dist/linter/rules/oxlint-ast.js +0 -104
- package/dist/linter/rules/oxlint-ast.js.map +0 -1
- package/dist/linter/rules/oxlint-rule.d.ts +0 -45
- package/dist/linter/rules/oxlint-rule.d.ts.map +0 -1
- package/dist/linter/rules/oxlint-rule.js +0 -2
- package/dist/linter/rules/oxlint-rule.js.map +0 -1
- package/dist/linter/rules/project-rule.d.ts +0 -10
- package/dist/linter/rules/project-rule.d.ts.map +0 -1
- package/dist/linter/rules/project-rule.js +0 -24
- package/dist/linter/rules/project-rule.js.map +0 -1
- package/dist/linter/rules/thin-schema-composition-root.d.ts +0 -3
- package/dist/linter/rules/thin-schema-composition-root.d.ts.map +0 -1
- package/dist/linter/rules/thin-schema-composition-root.js +0 -23
- package/dist/linter/rules/thin-schema-composition-root.js.map +0 -1
- package/dist/linter/source.d.ts +0 -24
- package/dist/linter/source.d.ts.map +0 -1
- package/dist/linter/source.js +0 -279
- package/dist/linter/source.js.map +0 -1
- package/dist/linter/suppression.d.ts +0 -3
- package/dist/linter/suppression.d.ts.map +0 -1
- package/dist/linter/suppression.js +0 -11
- package/dist/linter/suppression.js.map +0 -1
- package/dist/method/class.d.ts +0 -71
- package/dist/method/class.d.ts.map +0 -1
- package/dist/method/class.js +0 -26
- package/dist/method/class.js.map +0 -1
- package/dist/method/context.d.ts +0 -99
- package/dist/method/context.d.ts.map +0 -1
- package/dist/method/context.js +0 -11
- package/dist/method/context.js.map +0 -1
- package/dist/method/index.d.ts +0 -6
- package/dist/method/index.d.ts.map +0 -1
- package/dist/method/index.js +0 -3
- package/dist/method/index.js.map +0 -1
- package/dist/method/single.d.ts +0 -81
- package/dist/method/single.d.ts.map +0 -1
- package/dist/method/single.js +0 -8
- package/dist/method/single.js.map +0 -1
- package/dist/server/auxiliary-routes.d.ts +0 -48
- package/dist/server/auxiliary-routes.d.ts.map +0 -1
- package/dist/server/auxiliary-routes.js +0 -322
- package/dist/server/auxiliary-routes.js.map +0 -1
- package/dist/server/config.d.ts +0 -83
- package/dist/server/config.d.ts.map +0 -1
- package/dist/server/config.js +0 -8
- package/dist/server/config.js.map +0 -1
- package/dist/server/create.d.ts +0 -8
- package/dist/server/create.d.ts.map +0 -1
- package/dist/server/create.js +0 -171
- package/dist/server/create.js.map +0 -1
- package/dist/server/domain-entry.d.ts +0 -77
- package/dist/server/domain-entry.d.ts.map +0 -1
- package/dist/server/domain-entry.js +0 -60
- package/dist/server/domain-entry.js.map +0 -1
- package/dist/server/handle.d.ts +0 -35
- package/dist/server/handle.d.ts.map +0 -1
- package/dist/server/handle.js +0 -9
- package/dist/server/handle.js.map +0 -1
- package/dist/server/jwks.d.ts +0 -11
- package/dist/server/jwks.d.ts.map +0 -1
- package/dist/server/jwks.js +0 -15
- package/dist/server/jwks.js.map +0 -1
- package/dist/server/require-env.d.ts +0 -15
- package/dist/server/require-env.d.ts.map +0 -1
- package/dist/server/require-env.js +0 -21
- package/dist/server/require-env.js.map +0 -1
- package/dist/server/service-entry.d.ts +0 -32
- package/dist/server/service-entry.d.ts.map +0 -1
- package/dist/server/service-entry.js +0 -150
- package/dist/server/service-entry.js.map +0 -1
- package/dist/server/serving-url.d.ts +0 -14
- package/dist/server/serving-url.d.ts.map +0 -1
- package/dist/server/serving-url.js +0 -28
- package/dist/server/serving-url.js.map +0 -1
- package/dist/server/start.d.ts +0 -11
- package/dist/server/start.d.ts.map +0 -1
- package/dist/server/start.js +0 -34
- package/dist/server/start.js.map +0 -1
- package/dist/server/worker-entry.d.ts +0 -157
- package/dist/server/worker-entry.d.ts.map +0 -1
- package/dist/server/worker-entry.js +0 -201
- package/dist/server/worker-entry.js.map +0 -1
- package/dist/service/functions.d.ts +0 -148
- package/dist/service/functions.d.ts.map +0 -1
- package/dist/service/functions.js +0 -115
- package/dist/service/functions.js.map +0 -1
- package/dist/service/index.d.ts +0 -3
- package/dist/service/index.d.ts.map +0 -1
- package/dist/service/index.js +0 -2
- package/dist/service/index.js.map +0 -1
- package/dist/step/index.d.ts +0 -5
- package/dist/step/index.d.ts.map +0 -1
- package/dist/step/index.js +0 -3
- package/dist/step/index.js.map +0 -1
- package/dist/step/inline.d.ts +0 -8
- package/dist/step/inline.d.ts.map +0 -1
- package/dist/step/inline.js +0 -22
- package/dist/step/inline.js.map +0 -1
- package/dist/step/step.d.ts +0 -28
- package/dist/step/step.d.ts.map +0 -1
- package/dist/step/step.js +0 -53
- package/dist/step/step.js.map +0 -1
- package/src/auth/authenticate.ts +0 -51
- package/src/auth/check.ts +0 -69
- package/src/auth/compose.ts +0 -56
- package/src/auth/errors.ts +0 -32
- package/src/auth/function-context.ts +0 -108
- package/src/auth/identity.ts +0 -17
- package/src/auth/index.ts +0 -19
- package/src/auth/issuer-mint.ts +0 -76
- package/src/auth/kernel-client.ts +0 -153
- package/src/auth/resolve.ts +0 -63
- package/src/auth/sign.ts +0 -36
- package/src/auth/verify.ts +0 -199
- package/src/cli/bin.ts +0 -15
- package/src/cli/dotenv.ts +0 -65
- package/src/cli/index.ts +0 -15
- package/src/cli/log.ts +0 -18
- package/src/cli/publish.ts +0 -341
- package/src/cli/run.ts +0 -769
- package/src/cli/spec.ts +0 -44
- package/src/config/adapter.ts +0 -177
- package/src/config/define-domain.ts +0 -354
- package/src/config/deploy.ts +0 -35
- package/src/config/index.ts +0 -31
- package/src/define/index.ts +0 -10
- package/src/define/remote-function.ts +0 -184
- package/src/define/view.ts +0 -112
- package/src/deploy/check.ts +0 -124
- package/src/deploy/index.ts +0 -2
- package/src/deploy/meta.ts +0 -50
- package/src/dispatch/authorize.ts +0 -29
- package/src/dispatch/dispatcher.ts +0 -321
- package/src/dispatch/errors.ts +0 -94
- package/src/dispatch/execute.ts +0 -67
- package/src/dispatch/identity.ts +0 -143
- package/src/dispatch/index.ts +0 -16
- package/src/dispatch/resolve.ts +0 -78
- package/src/dispatch/self.ts +0 -198
- package/src/dispatch/validate.ts +0 -41
- package/src/domain/binding.ts +0 -37
- package/src/domain/build-spec.ts +0 -156
- package/src/domain/contract.ts +0 -41
- package/src/domain/define.ts +0 -162
- package/src/domain/extend-functions.ts +0 -110
- package/src/domain/extend-views.ts +0 -151
- package/src/domain/index.ts +0 -4
- package/src/index.ts +0 -165
- package/src/linter/analyze.ts +0 -17
- package/src/linter/diagnostic.ts +0 -85
- package/src/linter/docs/DIAGNOSTICS.md +0 -47
- package/src/linter/docs/JUDGMENT.md +0 -81
- package/src/linter/docs/PRINCIPLES.md +0 -97
- package/src/linter/docs/README.md +0 -38
- package/src/linter/docs/RULE-AUTHORING.md +0 -144
- package/src/linter/docs/RULES.md +0 -153
- package/src/linter/index.ts +0 -15
- package/src/linter/lint.ts +0 -34
- package/src/linter/oxlint/astrale-ox.d.ts +0 -5
- package/src/linter/oxlint/config.ts +0 -24
- package/src/linter/oxlint/ignore-patterns.ts +0 -17
- package/src/linter/oxlint/plugin.js +0 -16
- package/src/linter/oxlint/process.ts +0 -219
- package/src/linter/oxlint/run.ts +0 -175
- package/src/linter/preflight.ts +0 -182
- package/src/linter/project.ts +0 -190
- package/src/linter/report.ts +0 -25
- package/src/linter/rules/catalog.ts +0 -67
- package/src/linter/rules/core-has-no-async.js +0 -43
- package/src/linter/rules/core-is-pure.ts +0 -103
- package/src/linter/rules/no-nested-steps.js +0 -37
- package/src/linter/rules/no-read-inside-mutate.js +0 -72
- package/src/linter/rules/one-remote-definition-per-file.ts +0 -29
- package/src/linter/rules/oxlint-ast.js +0 -110
- package/src/linter/rules/oxlint-rule.ts +0 -35
- package/src/linter/rules/project-rule.ts +0 -37
- package/src/linter/rules/thin-schema-composition-root.ts +0 -26
- package/src/linter/source.ts +0 -323
- package/src/linter/suppression.ts +0 -11
- package/src/method/class.ts +0 -163
- package/src/method/context.ts +0 -135
- package/src/method/index.ts +0 -19
- package/src/method/single.ts +0 -166
- package/src/server/auxiliary-routes.ts +0 -456
- package/src/server/config.ts +0 -85
- package/src/server/create.ts +0 -210
- package/src/server/domain-entry.ts +0 -125
- package/src/server/handle.ts +0 -37
- package/src/server/index.ts +0 -19
- package/src/server/jwks.ts +0 -18
- package/src/server/require-env.ts +0 -19
- package/src/server/service-entry.ts +0 -209
- package/src/server/serving-url.ts +0 -28
- package/src/server/start.ts +0 -42
- package/src/server/worker-entry.ts +0 -286
- package/src/service/functions.ts +0 -164
- package/src/service/index.ts +0 -18
- package/src/step/index.ts +0 -4
- package/src/step/inline.ts +0 -38
- package/src/step/step.ts +0 -95
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
import { call, Client } from '@astrale-os/kernel-client';
|
|
2
|
+
import { createAuth } from '@astrale-os/kernel-client/auth';
|
|
3
|
+
import { createGraph } from '@astrale-os/kernel-client/graph';
|
|
4
|
+
import { ClientSession } from '@astrale-os/kernel-client/session';
|
|
5
|
+
import { AuthValueError, credential, delegation, grant, issuer, jwk, } from '@astrale-os/kernel-core/auth';
|
|
6
|
+
import { Domain } from '@astrale-os/kernel-core/domain';
|
|
7
|
+
import { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
8
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
9
|
+
import { syscalls } from '@astrale-os/kernel-core/schema';
|
|
10
|
+
import { AuthenticationError } from '@astrale-os/kernel-ports/authentication';
|
|
11
|
+
import { FunctionError } from '@astrale-os/kernel-ports/functions';
|
|
12
|
+
import { errors as protocolErrors, issuer as issuerProtocol, publication as publicationProtocol, } from '@astrale-os/kernel-protocol';
|
|
13
|
+
import { errors as joseErrors, importJWK, jwtVerify, SignJWT } from 'jose';
|
|
14
|
+
import { bindCallables, createDeployment } from '../deployment/index.js';
|
|
15
|
+
import { createApplication } from './application.js';
|
|
16
|
+
const CALLBACK_TTL_SECONDS = 120;
|
|
17
|
+
const MAXIMUM_DISCOVERY_DOCUMENT_BYTES = 256 * 1024;
|
|
18
|
+
const DEFAULT_ROUTE_AGE_MS = 60_000;
|
|
19
|
+
const DEFAULT_TOKEN_EXCHANGE_TTL_SECONDS = 300;
|
|
20
|
+
/**
|
|
21
|
+
* Compose the portable V2 Deployment/Application pair for one remotely hosted Domain.
|
|
22
|
+
* The helper owns only generic remote identity, installation attestation, and callback authority;
|
|
23
|
+
* provider routing and lifecycle remain adapter capabilities.
|
|
24
|
+
*/
|
|
25
|
+
export function createRemoteApplication(input) {
|
|
26
|
+
const issuerId = httpIssuer(input.identity.issuer, input.identity.allowInsecureHttp === true);
|
|
27
|
+
if (input.identity.subject !== input.definition.schema.origin) {
|
|
28
|
+
throw new TypeError('Remote identity subject must equal the Domain origin.');
|
|
29
|
+
}
|
|
30
|
+
const delivery = input.deployment;
|
|
31
|
+
const deploymentInput = {
|
|
32
|
+
definition: input.definition,
|
|
33
|
+
issuer: issuerId,
|
|
34
|
+
bundleHref: delivery.bundleHref,
|
|
35
|
+
bindings: {
|
|
36
|
+
callables: bindCallables(input.definition, delivery.endpoint),
|
|
37
|
+
},
|
|
38
|
+
...(delivery.frontendBaseHref === undefined
|
|
39
|
+
? {}
|
|
40
|
+
: { frontendBaseHref: delivery.frontendBaseHref }),
|
|
41
|
+
...(delivery.frontendCacheKey === undefined
|
|
42
|
+
? {}
|
|
43
|
+
: { frontendCacheKey: delivery.frontendCacheKey }),
|
|
44
|
+
...(delivery.protocolViewBindings === undefined
|
|
45
|
+
? {}
|
|
46
|
+
: { protocolViewBindings: delivery.protocolViewBindings }),
|
|
47
|
+
...(delivery.routes === undefined ? {} : { routes: delivery.routes }),
|
|
48
|
+
...(delivery.manifest === undefined ? {} : { manifest: delivery.manifest }),
|
|
49
|
+
...(delivery.delivery === undefined ? {} : { delivery: delivery.delivery }),
|
|
50
|
+
servingEndpoint: delivery.endpoint,
|
|
51
|
+
};
|
|
52
|
+
const deployed = createDeployment(deploymentInput);
|
|
53
|
+
const signing = signingMaterial(input.identity.privateKey);
|
|
54
|
+
let current = deployed;
|
|
55
|
+
const applicationInput = {
|
|
56
|
+
deployment: deployed,
|
|
57
|
+
environment: input.environment,
|
|
58
|
+
identity: remoteIdentity({ ...input.identity, issuer: issuerId }, signing),
|
|
59
|
+
server: input.server,
|
|
60
|
+
...(input.workflowRunner === undefined ? {} : { workflowRunner: input.workflowRunner }),
|
|
61
|
+
...(delivery.delivery === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { delivery: publicDeliveryProvider(() => current, signing) }),
|
|
64
|
+
...(input.app === undefined ? {} : { app: input.app }),
|
|
65
|
+
};
|
|
66
|
+
const application = createApplication(applicationInput);
|
|
67
|
+
return Object.freeze({
|
|
68
|
+
app: application.app,
|
|
69
|
+
get publication() {
|
|
70
|
+
return application.publication;
|
|
71
|
+
},
|
|
72
|
+
replace(candidate) {
|
|
73
|
+
const replaced = application.replace(candidate);
|
|
74
|
+
current = candidate;
|
|
75
|
+
return replaced;
|
|
76
|
+
},
|
|
77
|
+
drain: application.drain,
|
|
78
|
+
close: application.close,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Build one immutable Application identity backed by an asymmetric private JWK. */
|
|
82
|
+
export function createRemoteIdentity(input) {
|
|
83
|
+
return remoteIdentity(input, signingMaterial(input.privateKey));
|
|
84
|
+
}
|
|
85
|
+
function remoteIdentity(input, signing) {
|
|
86
|
+
const selfIssuer = httpIssuer(input.issuer, input.allowInsecureHttp === true);
|
|
87
|
+
const fetchImpl = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
88
|
+
if (typeof fetchImpl !== 'function')
|
|
89
|
+
throw new TypeError('Remote identity requires Fetch.');
|
|
90
|
+
if (typeof input.subject !== 'string' || input.subject.length === 0) {
|
|
91
|
+
throw new TypeError('Remote identity subject must not be empty.');
|
|
92
|
+
}
|
|
93
|
+
if (input.allowEndpoint !== undefined && typeof input.allowEndpoint !== 'function') {
|
|
94
|
+
throw new TypeError('Remote identity endpoint policy is invalid.');
|
|
95
|
+
}
|
|
96
|
+
const maximumExchangeTtlSeconds = admitExchangeOptions(input.tokenExchange);
|
|
97
|
+
return Object.freeze({
|
|
98
|
+
issuer: selfIssuer,
|
|
99
|
+
signingAlgorithm: signing.algorithm,
|
|
100
|
+
loadPublicKeys: async () => [signing.publicKey],
|
|
101
|
+
tokenExchange: exchangeProvider(selfIssuer, input.subject, signing, fetchImpl, input, maximumExchangeTtlSeconds),
|
|
102
|
+
admit: (request) => admitAttempt(request, signing, selfIssuer, fetchImpl, input),
|
|
103
|
+
authenticate: async (request) => {
|
|
104
|
+
const established = await establishCaller(request.credential, selfIssuer, fetchImpl, request.context.execution.signal, input);
|
|
105
|
+
if (established.verified.iss !== request.via.issuer) {
|
|
106
|
+
throw new AuthenticationError('INVALID_CREDENTIAL', 'Destination carrier issuer differs from the admitted Via Kernel.');
|
|
107
|
+
}
|
|
108
|
+
const context = request.context.execution;
|
|
109
|
+
const callbackAudience = established.verified.iss;
|
|
110
|
+
const composed = composedIdentity(established.delegation.credential);
|
|
111
|
+
const composedCredential = await signCallback(signing, selfIssuer, input.subject, callbackAudience, composed, established.verified, context);
|
|
112
|
+
const fetch = boundedFetch(fetchImpl, context.signal);
|
|
113
|
+
const session = new ClientSession({
|
|
114
|
+
kernel: callbackAudience,
|
|
115
|
+
fetch,
|
|
116
|
+
auth: {
|
|
117
|
+
ttlSeconds: callbackTtl(context.deadline),
|
|
118
|
+
resolve: () => ({ credential: composedCredential }),
|
|
119
|
+
},
|
|
120
|
+
policy: {
|
|
121
|
+
maximumRouteAgeMs: DEFAULT_ROUTE_AGE_MS,
|
|
122
|
+
...(input.allowEndpoint === undefined ? {} : { allowEndpoint: input.allowEndpoint }),
|
|
123
|
+
...(input.allowInsecureHttp === true ? { allowInsecureHttp: true } : {}),
|
|
124
|
+
},
|
|
125
|
+
timeoutMs: Math.max(1, context.deadline - Date.now()),
|
|
126
|
+
});
|
|
127
|
+
const dispatch = (call, options) => session.dispatch(call, boundedSessionOptions(context, options));
|
|
128
|
+
const kernel = kernelCapability(session, dispatch, context);
|
|
129
|
+
const app = domainHandle(request.domain, dispatch);
|
|
130
|
+
return Object.freeze({
|
|
131
|
+
caller: established.caller,
|
|
132
|
+
app,
|
|
133
|
+
kernel,
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function admitExchangeOptions(input) {
|
|
139
|
+
if (input === undefined)
|
|
140
|
+
return DEFAULT_TOKEN_EXCHANGE_TTL_SECONDS;
|
|
141
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
142
|
+
throw new TypeError('Remote identity tokenExchange options are invalid.');
|
|
143
|
+
}
|
|
144
|
+
const fields = Reflect.ownKeys(input);
|
|
145
|
+
if (fields.some((field) => field !== 'maximumTtlSeconds')) {
|
|
146
|
+
throw new TypeError('Remote identity tokenExchange options contain an unknown field.');
|
|
147
|
+
}
|
|
148
|
+
const maximumTtlSeconds = input.maximumTtlSeconds ?? DEFAULT_TOKEN_EXCHANGE_TTL_SECONDS;
|
|
149
|
+
if (!Number.isSafeInteger(maximumTtlSeconds) || maximumTtlSeconds < 1) {
|
|
150
|
+
throw new TypeError('tokenExchange.maximumTtlSeconds must be a positive safe integer.');
|
|
151
|
+
}
|
|
152
|
+
return maximumTtlSeconds;
|
|
153
|
+
}
|
|
154
|
+
function signingMaterial(input) {
|
|
155
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
156
|
+
throw new TypeError('Remote identity private key must be a JWK object.');
|
|
157
|
+
}
|
|
158
|
+
const algorithm = input.alg;
|
|
159
|
+
if (typeof algorithm !== 'string' || algorithm.length === 0) {
|
|
160
|
+
throw new TypeError('Remote identity private JWK requires alg.');
|
|
161
|
+
}
|
|
162
|
+
const keyId = input.kid;
|
|
163
|
+
if (keyId !== undefined && (typeof keyId !== 'string' || keyId.length === 0)) {
|
|
164
|
+
throw new TypeError('Remote identity private JWK kid is invalid.');
|
|
165
|
+
}
|
|
166
|
+
const value = input;
|
|
167
|
+
const { d: _d, p: _p, q: _q, dp: _dp, dq: _dq, qi: _qi, oth: _oth, k: _k,
|
|
168
|
+
// A WebCrypto-exported private JWK can be restricted to signing. That
|
|
169
|
+
// operation does not apply to the derived public verification key and
|
|
170
|
+
// makes strict JOSE consumers reject it when retained in JWKS.
|
|
171
|
+
key_ops: _keyOperations, ...publicValue } = value;
|
|
172
|
+
const publicKey = jwk.acceptPublic({
|
|
173
|
+
...publicValue,
|
|
174
|
+
alg: algorithm,
|
|
175
|
+
...(keyId ? { kid: keyId } : {}),
|
|
176
|
+
});
|
|
177
|
+
return Object.freeze({
|
|
178
|
+
algorithm,
|
|
179
|
+
...(keyId === undefined ? {} : { keyId }),
|
|
180
|
+
privateKey: importJWK(input, algorithm),
|
|
181
|
+
publicKey,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function exchangeProvider(domainIssuer, subject, signing, fetch, policy, maximumTtlSeconds) {
|
|
185
|
+
return Object.freeze({
|
|
186
|
+
async exchange(request, context) {
|
|
187
|
+
try {
|
|
188
|
+
const outer = await verifyCredential(request.token, domainIssuer, fetch, context.signal, policy);
|
|
189
|
+
requireExchangeProfile(outer.verified, 'outer');
|
|
190
|
+
const carried = delegation.accept(outer.verified.claims.delegation);
|
|
191
|
+
if (typeof carried.credential !== 'string')
|
|
192
|
+
exchangeInvalid();
|
|
193
|
+
const inner = await verifyCredentialAgainst(carried.credential, outer.verified.iss, outer.basis);
|
|
194
|
+
requireExchangeProfile(inner.verified, 'inner');
|
|
195
|
+
requireExchangeCoherence(outer.verified, inner.verified);
|
|
196
|
+
acceptResolvedDelegation(inner.verified.claims.delegation);
|
|
197
|
+
const now = Math.floor(Date.now() / 1_000);
|
|
198
|
+
const expiresAt = Math.min(outer.verified.exp, inner.verified.exp, now + maximumTtlSeconds);
|
|
199
|
+
if (expiresAt <= now)
|
|
200
|
+
exchangeExpired();
|
|
201
|
+
const token = await new SignJWT({
|
|
202
|
+
grant: {
|
|
203
|
+
v: 1,
|
|
204
|
+
expr: { kind: 'identity', credential: carried.credential },
|
|
205
|
+
},
|
|
206
|
+
})
|
|
207
|
+
.setProtectedHeader({
|
|
208
|
+
alg: signing.algorithm,
|
|
209
|
+
...(signing.keyId === undefined ? {} : { kid: signing.keyId }),
|
|
210
|
+
})
|
|
211
|
+
.setIssuer(domainIssuer)
|
|
212
|
+
.setSubject(subject)
|
|
213
|
+
.setAudience(outer.verified.iss)
|
|
214
|
+
.setIssuedAt(now)
|
|
215
|
+
.setExpirationTime(expiresAt)
|
|
216
|
+
.sign(await signing.privateKey);
|
|
217
|
+
return issuerProtocol.exchange.response(token, expiresAt);
|
|
218
|
+
}
|
|
219
|
+
catch (cause) {
|
|
220
|
+
if (cause instanceof protocolErrors.ProtocolError)
|
|
221
|
+
throw cause;
|
|
222
|
+
if (context.signal.aborted)
|
|
223
|
+
throw context.signal.reason;
|
|
224
|
+
if (cause instanceof joseErrors.JWTExpired)
|
|
225
|
+
exchangeExpired();
|
|
226
|
+
if (cause instanceof IssuerUnavailable)
|
|
227
|
+
exchangeUnavailable();
|
|
228
|
+
if (cause instanceof CredentialRejected ||
|
|
229
|
+
cause instanceof joseErrors.JOSEError ||
|
|
230
|
+
cause instanceof AuthenticationError ||
|
|
231
|
+
cause instanceof AuthValueError) {
|
|
232
|
+
exchangeInvalid();
|
|
233
|
+
}
|
|
234
|
+
throw cause;
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
function requireExchangeProfile(input, profile) {
|
|
240
|
+
const expected = ['aud', 'delegation', 'exp', 'iat', 'iss', 'sub'];
|
|
241
|
+
const actual = Object.keys(input.claims).sort();
|
|
242
|
+
if (actual.length !== expected.length ||
|
|
243
|
+
actual.some((field, index) => field !== expected[index]) ||
|
|
244
|
+
typeof input.iat !== 'number' ||
|
|
245
|
+
!Number.isSafeInteger(input.iat) ||
|
|
246
|
+
input.iat < 1 ||
|
|
247
|
+
typeof input.exp !== 'number' ||
|
|
248
|
+
!Number.isSafeInteger(input.exp) ||
|
|
249
|
+
input.exp < 1 ||
|
|
250
|
+
typeof input.aud !== 'string') {
|
|
251
|
+
exchangeInvalid();
|
|
252
|
+
}
|
|
253
|
+
if (profile === 'outer')
|
|
254
|
+
delegation.accept(input.claims.delegation);
|
|
255
|
+
else
|
|
256
|
+
acceptResolvedDelegation(input.claims.delegation);
|
|
257
|
+
}
|
|
258
|
+
function requireExchangeCoherence(outer, inner) {
|
|
259
|
+
if (inner.iss !== outer.iss || inner.sub !== outer.sub || inner.aud !== outer.iss) {
|
|
260
|
+
exchangeInvalid();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function acceptResolvedDelegation(input) {
|
|
264
|
+
if (input === null ||
|
|
265
|
+
typeof input !== 'object' ||
|
|
266
|
+
Array.isArray(input) ||
|
|
267
|
+
Reflect.ownKeys(input).length !== 2 ||
|
|
268
|
+
!Object.hasOwn(input, 'v') ||
|
|
269
|
+
!Object.hasOwn(input, 'expr') ||
|
|
270
|
+
Reflect.get(input, 'v') !== 1) {
|
|
271
|
+
exchangeInvalid();
|
|
272
|
+
}
|
|
273
|
+
return grant.accept({ expr: Reflect.get(input, 'expr') });
|
|
274
|
+
}
|
|
275
|
+
function exchangeInvalid() {
|
|
276
|
+
throw new protocolErrors.ProtocolError({
|
|
277
|
+
code: protocolErrors.CODES.AUTH_INVALID,
|
|
278
|
+
message: 'Token is invalid.',
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
function exchangeExpired() {
|
|
282
|
+
throw new protocolErrors.ProtocolError({
|
|
283
|
+
code: protocolErrors.CODES.AUTH_EXPIRED,
|
|
284
|
+
message: 'Token is expired.',
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function exchangeUnavailable() {
|
|
288
|
+
throw new protocolErrors.ProtocolError({
|
|
289
|
+
code: protocolErrors.CODES.BACKEND_UNAVAILABLE,
|
|
290
|
+
message: 'Token exchange is unavailable.',
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
async function establishCaller(input, audience, fetch, signal, policy) {
|
|
294
|
+
try {
|
|
295
|
+
const context = await verifyCredential(input, audience, fetch, signal, policy);
|
|
296
|
+
const carried = delegation.accept(context.verified.claims.delegation);
|
|
297
|
+
if (typeof carried.credential !== 'string') {
|
|
298
|
+
throw new CredentialRejected('Destination carrier has no Kernel authority proof.');
|
|
299
|
+
}
|
|
300
|
+
const proof = await verifyCredentialAgainst(carried.credential, context.verified.iss, context.basis);
|
|
301
|
+
if (proof.verified.sub !== context.verified.sub) {
|
|
302
|
+
throw new CredentialRejected('Destination carrier and authority proof subjects differ.');
|
|
303
|
+
}
|
|
304
|
+
const authority = acceptResolvedDelegation(proof.verified.claims.delegation);
|
|
305
|
+
let principal;
|
|
306
|
+
try {
|
|
307
|
+
principal = NodeId(context.verified.sub);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
throw new CredentialRejected('Credential subject is not a Kernel IdentityId.');
|
|
311
|
+
}
|
|
312
|
+
return Object.freeze({
|
|
313
|
+
verified: context.verified,
|
|
314
|
+
delegation: carried,
|
|
315
|
+
caller: Object.freeze({
|
|
316
|
+
kind: 'authenticated',
|
|
317
|
+
principal,
|
|
318
|
+
authority,
|
|
319
|
+
authentication: credential.evidence(context),
|
|
320
|
+
}),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
catch (cause) {
|
|
324
|
+
if (cause instanceof AuthenticationError)
|
|
325
|
+
throw cause;
|
|
326
|
+
if (cause instanceof IssuerUnavailable) {
|
|
327
|
+
throw new AuthenticationError('AUTHENTICATION_BACKEND_FAILED', cause.message, {
|
|
328
|
+
cause: cause.cause,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
if (cause instanceof CredentialRejected ||
|
|
332
|
+
cause instanceof joseErrors.JOSEError ||
|
|
333
|
+
cause instanceof protocolErrors.ProtocolError) {
|
|
334
|
+
throw new AuthenticationError('INVALID_CREDENTIAL', 'Credential is invalid.');
|
|
335
|
+
}
|
|
336
|
+
throw cause;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
async function verifyCredential(input, audience, fetch, signal, policy) {
|
|
340
|
+
let inspected;
|
|
341
|
+
try {
|
|
342
|
+
inspected = credential.inspect(input);
|
|
343
|
+
}
|
|
344
|
+
catch (cause) {
|
|
345
|
+
throw new CredentialRejected('Credential is malformed.', cause);
|
|
346
|
+
}
|
|
347
|
+
if (inspected.iss === undefined)
|
|
348
|
+
throw new CredentialRejected('Credential issuer is missing.');
|
|
349
|
+
let admittedIssuer;
|
|
350
|
+
try {
|
|
351
|
+
admittedIssuer = httpIssuer(inspected.iss, policy.allowInsecureHttp === true);
|
|
352
|
+
}
|
|
353
|
+
catch (cause) {
|
|
354
|
+
throw new CredentialRejected('Credential issuer is invalid.', cause);
|
|
355
|
+
}
|
|
356
|
+
const basis = await discoverVerificationBasis(admittedIssuer, fetch, signal, policy);
|
|
357
|
+
const verified = await verifyCredentialAgainst(input, audience, basis, inspected);
|
|
358
|
+
admitEndpoint(invocationUrl(admittedIssuer), policy);
|
|
359
|
+
return Object.freeze({ raw: input, verified: verified.verified, basis });
|
|
360
|
+
}
|
|
361
|
+
async function discoverVerificationBasis(admittedIssuer, fetch, signal, policy) {
|
|
362
|
+
const paths = issuerProtocol.paths(admittedIssuer);
|
|
363
|
+
const configurationUrl = new URL(paths.configuration, admittedIssuer).toString();
|
|
364
|
+
admitEndpoint(configurationUrl, policy);
|
|
365
|
+
const configurationResponse = await fetchDiscovery(fetch, configurationUrl, signal);
|
|
366
|
+
const configuration = issuerProtocol.acceptConfiguration(await boundedJson(configurationResponse, signal), admittedIssuer);
|
|
367
|
+
admitEndpoint(configuration.jwks_uri, policy);
|
|
368
|
+
const keysResponse = await fetchDiscovery(fetch, configuration.jwks_uri, signal);
|
|
369
|
+
const keys = issuerProtocol.acceptKeySet(await boundedJson(keysResponse, signal), configuration.id_token_signing_alg_values_supported).keys;
|
|
370
|
+
return Object.freeze({
|
|
371
|
+
issuer: admittedIssuer,
|
|
372
|
+
algorithms: configuration.id_token_signing_alg_values_supported,
|
|
373
|
+
keys,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
async function verifyCredentialAgainst(input, audience, basis, preinspected) {
|
|
377
|
+
let inspected;
|
|
378
|
+
try {
|
|
379
|
+
inspected = preinspected ?? credential.inspect(input);
|
|
380
|
+
}
|
|
381
|
+
catch (cause) {
|
|
382
|
+
throw new CredentialRejected('Credential is malformed.', cause);
|
|
383
|
+
}
|
|
384
|
+
if (inspected.iss !== basis.issuer) {
|
|
385
|
+
throw new CredentialRejected('Credential issuer differs from the captured verification basis.');
|
|
386
|
+
}
|
|
387
|
+
const compact = typeof input === 'string' ? input : new TextDecoder().decode(input);
|
|
388
|
+
const candidates = basis.keys.filter((candidate) => inspected.kid === undefined || candidate.kid === inspected.kid);
|
|
389
|
+
const matches = [];
|
|
390
|
+
let expired;
|
|
391
|
+
for (const candidate of candidates) {
|
|
392
|
+
try {
|
|
393
|
+
const imported = await importJWK(candidate, candidate.alg ?? basis.algorithms[0]);
|
|
394
|
+
matches.push(await jwtVerify(compact, imported, {
|
|
395
|
+
issuer: basis.issuer,
|
|
396
|
+
audience,
|
|
397
|
+
algorithms: [...basis.algorithms],
|
|
398
|
+
}));
|
|
399
|
+
}
|
|
400
|
+
catch (cause) {
|
|
401
|
+
if (cause instanceof joseErrors.JWTExpired)
|
|
402
|
+
expired = cause;
|
|
403
|
+
if (cause instanceof joseErrors.JOSEError)
|
|
404
|
+
continue;
|
|
405
|
+
throw cause;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (matches.length === 0 && expired !== undefined)
|
|
409
|
+
throw expired;
|
|
410
|
+
if (matches.length !== 1) {
|
|
411
|
+
throw new CredentialRejected('Credential signature is not uniquely verified.');
|
|
412
|
+
}
|
|
413
|
+
const match = matches[0];
|
|
414
|
+
let verified;
|
|
415
|
+
try {
|
|
416
|
+
verified = credential.acceptVerified({
|
|
417
|
+
method: 'jwt',
|
|
418
|
+
iss: match.payload.iss,
|
|
419
|
+
sub: match.payload.sub,
|
|
420
|
+
aud: match.payload.aud,
|
|
421
|
+
kid: match.protectedHeader.kid,
|
|
422
|
+
iat: match.payload.iat,
|
|
423
|
+
nbf: match.payload.nbf,
|
|
424
|
+
exp: match.payload.exp,
|
|
425
|
+
claims: match.payload,
|
|
426
|
+
});
|
|
427
|
+
credential.verifyAudience(verified, audience);
|
|
428
|
+
}
|
|
429
|
+
catch (cause) {
|
|
430
|
+
throw new CredentialRejected('Credential claims are invalid.', cause);
|
|
431
|
+
}
|
|
432
|
+
return Object.freeze({ raw: input, verified });
|
|
433
|
+
}
|
|
434
|
+
async function fetchDiscovery(fetch, url, signal) {
|
|
435
|
+
let response;
|
|
436
|
+
try {
|
|
437
|
+
response = await fetch(url, { method: 'GET', redirect: 'error', signal });
|
|
438
|
+
}
|
|
439
|
+
catch (cause) {
|
|
440
|
+
if (signal.aborted)
|
|
441
|
+
throw signal.reason;
|
|
442
|
+
throw new IssuerUnavailable('Issuer discovery request failed.', cause);
|
|
443
|
+
}
|
|
444
|
+
if (!response.ok) {
|
|
445
|
+
await response.body?.cancel();
|
|
446
|
+
throw new IssuerUnavailable(`Issuer discovery returned HTTP ${response.status}.`);
|
|
447
|
+
}
|
|
448
|
+
return response;
|
|
449
|
+
}
|
|
450
|
+
async function boundedJson(response, signal) {
|
|
451
|
+
const declared = response.headers.get('content-length');
|
|
452
|
+
if (declared !== null && Number(declared) > MAXIMUM_DISCOVERY_DOCUMENT_BYTES) {
|
|
453
|
+
await response.body?.cancel();
|
|
454
|
+
throw new CredentialRejected('Issuer discovery document exceeds the byte limit.');
|
|
455
|
+
}
|
|
456
|
+
if (response.body === null)
|
|
457
|
+
throw new CredentialRejected('Issuer discovery response is empty.');
|
|
458
|
+
const reader = response.body.getReader();
|
|
459
|
+
const chunks = [];
|
|
460
|
+
let size = 0;
|
|
461
|
+
try {
|
|
462
|
+
for (;;) {
|
|
463
|
+
const read = await reader.read();
|
|
464
|
+
if (read.done)
|
|
465
|
+
break;
|
|
466
|
+
size += read.value.byteLength;
|
|
467
|
+
if (size > MAXIMUM_DISCOVERY_DOCUMENT_BYTES) {
|
|
468
|
+
await reader.cancel();
|
|
469
|
+
throw new CredentialRejected('Issuer discovery document exceeds the byte limit.');
|
|
470
|
+
}
|
|
471
|
+
chunks.push(read.value);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
catch (cause) {
|
|
475
|
+
if (signal.aborted)
|
|
476
|
+
throw signal.reason;
|
|
477
|
+
throw cause;
|
|
478
|
+
}
|
|
479
|
+
finally {
|
|
480
|
+
reader.releaseLock();
|
|
481
|
+
}
|
|
482
|
+
if (signal.aborted)
|
|
483
|
+
throw signal.reason;
|
|
484
|
+
const bytes = new Uint8Array(size);
|
|
485
|
+
let offset = 0;
|
|
486
|
+
for (const chunk of chunks) {
|
|
487
|
+
bytes.set(chunk, offset);
|
|
488
|
+
offset += chunk.byteLength;
|
|
489
|
+
}
|
|
490
|
+
try {
|
|
491
|
+
return JSON.parse(new TextDecoder().decode(bytes));
|
|
492
|
+
}
|
|
493
|
+
catch (cause) {
|
|
494
|
+
throw new CredentialRejected('Issuer discovery document is not JSON.', cause);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
function identityLeaf(nested) {
|
|
498
|
+
return Object.freeze({ kind: 'identity', credential: nested });
|
|
499
|
+
}
|
|
500
|
+
function composedIdentity(nested) {
|
|
501
|
+
return Object.freeze({
|
|
502
|
+
kind: 'union',
|
|
503
|
+
operands: Object.freeze([
|
|
504
|
+
Object.freeze({ kind: 'identity', self: true }),
|
|
505
|
+
identityLeaf(nested),
|
|
506
|
+
]),
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
async function signDomainCallback(signing, callbackIssuer, subject, audience, execution) {
|
|
510
|
+
requireLive(execution);
|
|
511
|
+
const now = Math.floor(Date.now() / 1_000);
|
|
512
|
+
const expiresAt = Math.min(Math.floor(execution.deadline / 1_000), now + CALLBACK_TTL_SECONDS);
|
|
513
|
+
if (expiresAt <= now) {
|
|
514
|
+
throw new AuthenticationError('INVALID_CREDENTIAL', 'Callback credential would be expired.');
|
|
515
|
+
}
|
|
516
|
+
return new SignJWT({
|
|
517
|
+
grant: { v: 1, expr: { kind: 'identity', self: true } },
|
|
518
|
+
})
|
|
519
|
+
.setProtectedHeader({
|
|
520
|
+
alg: signing.algorithm,
|
|
521
|
+
...(signing.keyId === undefined ? {} : { kid: signing.keyId }),
|
|
522
|
+
})
|
|
523
|
+
.setIssuer(callbackIssuer)
|
|
524
|
+
.setSubject(subject)
|
|
525
|
+
.setAudience(audience)
|
|
526
|
+
.setIssuedAt(now)
|
|
527
|
+
.setExpirationTime(expiresAt)
|
|
528
|
+
.sign(await signing.privateKey);
|
|
529
|
+
}
|
|
530
|
+
async function signCallback(signing, callbackIssuer, subject, audience, expression, carrier, execution) {
|
|
531
|
+
requireLive(execution);
|
|
532
|
+
const now = Math.floor(Date.now() / 1_000);
|
|
533
|
+
const expiresAt = Math.min(carrier.exp ?? Number.POSITIVE_INFINITY, Math.floor(execution.deadline / 1_000), now + CALLBACK_TTL_SECONDS);
|
|
534
|
+
if (!Number.isFinite(expiresAt) || expiresAt <= now) {
|
|
535
|
+
throw new AuthenticationError('INVALID_CREDENTIAL', 'Credential proof has expired.');
|
|
536
|
+
}
|
|
537
|
+
return new SignJWT({ grant: { v: 1, expr: expression } })
|
|
538
|
+
.setProtectedHeader({
|
|
539
|
+
alg: signing.algorithm,
|
|
540
|
+
...(signing.keyId === undefined ? {} : { kid: signing.keyId }),
|
|
541
|
+
})
|
|
542
|
+
.setIssuer(callbackIssuer)
|
|
543
|
+
.setSubject(subject)
|
|
544
|
+
.setAudience(audience)
|
|
545
|
+
.setIssuedAt(now)
|
|
546
|
+
.setExpirationTime(expiresAt)
|
|
547
|
+
.sign(await signing.privateKey);
|
|
548
|
+
}
|
|
549
|
+
function kernelCapability(session, dispatch, execution) {
|
|
550
|
+
const value = (call, options) => session.call(call, boundedSessionOptions(execution, options));
|
|
551
|
+
const graph = createGraph(value);
|
|
552
|
+
const auth = createAuth((target, input, options) => value(call(target, input), boundedRequestOptions(execution, options)));
|
|
553
|
+
return Object.freeze({
|
|
554
|
+
...graph,
|
|
555
|
+
auth,
|
|
556
|
+
dispatch: (call, options) => dispatch(call, options),
|
|
557
|
+
call: (call, options) => session.call(call, boundedSessionOptions(execution, options)),
|
|
558
|
+
stream: (call, options) => session.stream(call, boundedSessionOptions(execution, options)),
|
|
559
|
+
binary: (call, options) => session.binary(call, boundedSessionOptions(execution, options)),
|
|
560
|
+
snapshot: (options) => session.snapshot(boundedSessionOptions(execution, options)),
|
|
561
|
+
viewsFor: (target, options) => session.viewsFor(target, boundedSessionOptions(execution, options)),
|
|
562
|
+
domain: async (domainSchema) => domainHandle(Domain.fromSchema(domainSchema), dispatch),
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
function domainHandle(domain, dispatch) {
|
|
566
|
+
const callables = concreteCallables(domain);
|
|
567
|
+
const invokeCallable = async (callable, receiver, input, options) => {
|
|
568
|
+
if (!callables.has(callable)) {
|
|
569
|
+
throw new FunctionError('FUNCTION_BINDING_INVALID', 'Callable is not a concrete member of the Domain.');
|
|
570
|
+
}
|
|
571
|
+
const target = 'on' in callable ? Path.instanceMethod(Path.from(receiver), callable.name) : callable.path;
|
|
572
|
+
if (target === undefined) {
|
|
573
|
+
throw new FunctionError('FUNCTION_BINDING_INVALID', 'Callable has no canonical Path.');
|
|
574
|
+
}
|
|
575
|
+
const result = await dispatch(call(target, input), options);
|
|
576
|
+
return callableOutput(callable, result);
|
|
577
|
+
};
|
|
578
|
+
const methodBinder = (method, receiver) => (input) => invokeCallable(method, Path.id(receiver.id), input);
|
|
579
|
+
const invoke = ((callable, receiverOrInput, inputOrOptions, options) => 'on' in callable
|
|
580
|
+
? invokeCallable(callable, receiverOrInput, inputOrOptions, options)
|
|
581
|
+
: invokeCallable(callable, undefined, receiverOrInput, inputOrOptions));
|
|
582
|
+
const bind = ((definitionOrValue, value) => value === undefined
|
|
583
|
+
? domain.$.wrap(definitionOrValue, methodBinder)
|
|
584
|
+
: domain.$.wrap(definitionOrValue, value, methodBinder));
|
|
585
|
+
return Object.freeze({
|
|
586
|
+
...domain,
|
|
587
|
+
$: Object.freeze({ ...domain.$, invoke, bind }),
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
function concreteCallables(domain) {
|
|
591
|
+
const result = new Set();
|
|
592
|
+
for (const definition of domain.$.definitions.values()) {
|
|
593
|
+
if (definition.kind === 'function') {
|
|
594
|
+
result.add(definition);
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if ((definition.kind !== 'class' && definition.kind !== 'interface') ||
|
|
598
|
+
definition.family !== 'node') {
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
for (const method of definition.methods.values()) {
|
|
602
|
+
if (method.definition.inheritance !== 'abstract') {
|
|
603
|
+
result.add(method);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return result;
|
|
608
|
+
}
|
|
609
|
+
function callableOutput(callable, result) {
|
|
610
|
+
switch (callable.definition.output.mode) {
|
|
611
|
+
case 'value':
|
|
612
|
+
if (result.kind === 'value')
|
|
613
|
+
return result.value;
|
|
614
|
+
break;
|
|
615
|
+
case 'stream':
|
|
616
|
+
if (result.kind === 'stream')
|
|
617
|
+
return result.stream;
|
|
618
|
+
break;
|
|
619
|
+
case 'binary':
|
|
620
|
+
if (result.kind === 'binary')
|
|
621
|
+
return result.value;
|
|
622
|
+
break;
|
|
623
|
+
}
|
|
624
|
+
if (result.kind === 'stream')
|
|
625
|
+
void result.stream.cancel('Remote callable output kind changed.');
|
|
626
|
+
throw new FunctionError('FUNCTION_OUTPUT_INVALID', `Remote callable returned ${result.kind} for ${callable.definition.output.mode} output.`);
|
|
627
|
+
}
|
|
628
|
+
async function admitAttempt(request, signing, domainIssuer, fetch, policy) {
|
|
629
|
+
const execution = request.context.execution;
|
|
630
|
+
const kernel = request.via.issuer;
|
|
631
|
+
const url = invocationUrl(kernel);
|
|
632
|
+
admitEndpoint(url, policy);
|
|
633
|
+
const callback = await signDomainCallback(signing, domainIssuer, request.domain.$.origin, kernel, execution);
|
|
634
|
+
const owner = Path.project(syscalls.function.admit.ref.owner);
|
|
635
|
+
const target = Path.staticMethod(owner, syscalls.function.admit.ref.name);
|
|
636
|
+
const client = new Client({ url, fetch: boundedFetch(fetch, execution.signal) });
|
|
637
|
+
try {
|
|
638
|
+
const portableRequest = {
|
|
639
|
+
call: request.call,
|
|
640
|
+
...(request.credential === undefined ? {} : { credential: request.credential }),
|
|
641
|
+
};
|
|
642
|
+
const value = await client.as(callback).call(call(target, portableRequest), {
|
|
643
|
+
...boundedRequestOptions(execution),
|
|
644
|
+
delegate: {
|
|
645
|
+
ttlSeconds: callbackTtl(execution.deadline),
|
|
646
|
+
attenuation: { kind: 'identity', self: true },
|
|
647
|
+
},
|
|
648
|
+
});
|
|
649
|
+
if (!isTarget(value)) {
|
|
650
|
+
throw new FunctionError('FUNCTION_EXECUTION_FAILED', 'Kernel returned an invalid Function admission Target.');
|
|
651
|
+
}
|
|
652
|
+
return Object.freeze({
|
|
653
|
+
callable: value.callable,
|
|
654
|
+
...(value.receiver === undefined ? {} : { receiver: value.receiver }),
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
finally {
|
|
658
|
+
client.close();
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function isTarget(input) {
|
|
662
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
663
|
+
return false;
|
|
664
|
+
const fields = Reflect.ownKeys(input);
|
|
665
|
+
return (fields.every((field) => field === 'callable' || field === 'receiver') &&
|
|
666
|
+
fields.includes('callable') &&
|
|
667
|
+
typeof Reflect.get(input, 'callable') === 'string' &&
|
|
668
|
+
(Reflect.get(input, 'receiver') === undefined ||
|
|
669
|
+
typeof Reflect.get(input, 'receiver') === 'string'));
|
|
670
|
+
}
|
|
671
|
+
function publicDeliveryProvider(current, signing) {
|
|
672
|
+
if (current().publication.delivery?.authentication.kind !== 'public') {
|
|
673
|
+
throw new TypeError('Remote application helper currently requires a public delivery endpoint.');
|
|
674
|
+
}
|
|
675
|
+
return Object.freeze({
|
|
676
|
+
async create(request) {
|
|
677
|
+
const deployed = current();
|
|
678
|
+
if (deployed.publication.delivery?.authentication.kind !== 'public') {
|
|
679
|
+
throw new FunctionError('FUNCTION_CONFLICT', 'Delivery endpoint changed.');
|
|
680
|
+
}
|
|
681
|
+
if (request.etag !== deployed.publication.etag) {
|
|
682
|
+
throw new FunctionError('FUNCTION_CONFLICT', 'Delivery Publication changed.');
|
|
683
|
+
}
|
|
684
|
+
const now = Math.floor(Date.now() / 1_000);
|
|
685
|
+
const attestation = await new SignJWT({
|
|
686
|
+
purpose: publicationProtocol.delivery.PURPOSE,
|
|
687
|
+
nonce: request.nonce,
|
|
688
|
+
etag: deployed.publication.etag,
|
|
689
|
+
schemaRevision: deployed.publication.schema.revision,
|
|
690
|
+
})
|
|
691
|
+
.setProtectedHeader({
|
|
692
|
+
alg: signing.algorithm,
|
|
693
|
+
...(signing.keyId === undefined ? {} : { kid: signing.keyId }),
|
|
694
|
+
})
|
|
695
|
+
.setIssuer(deployed.publication.identity.issuer)
|
|
696
|
+
.setSubject(deployed.publication.origin)
|
|
697
|
+
.setAudience(request.kernel)
|
|
698
|
+
.setExpirationTime(now + CALLBACK_TTL_SECONDS)
|
|
699
|
+
.sign(await signing.privateKey);
|
|
700
|
+
return publicationProtocol.delivery.accept({
|
|
701
|
+
format: 'astrale.domain.delivery',
|
|
702
|
+
version: 1,
|
|
703
|
+
publication: deployed.publication,
|
|
704
|
+
attestation,
|
|
705
|
+
});
|
|
706
|
+
},
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
function boundedFetch(fetch, lifecycle) {
|
|
710
|
+
return (input, init = {}) => fetch(input, {
|
|
711
|
+
...init,
|
|
712
|
+
signal: init.signal === undefined || init.signal === null
|
|
713
|
+
? lifecycle
|
|
714
|
+
: AbortSignal.any([lifecycle, init.signal]),
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function boundedRequestOptions(execution, options = {}) {
|
|
718
|
+
return boundedOptions(execution, options);
|
|
719
|
+
}
|
|
720
|
+
function boundedSessionOptions(execution, options) {
|
|
721
|
+
return boundedOptions(execution, options ?? {});
|
|
722
|
+
}
|
|
723
|
+
function boundedOptions(execution, options) {
|
|
724
|
+
requireLive(execution);
|
|
725
|
+
const remaining = Math.max(1, execution.deadline - Date.now());
|
|
726
|
+
return {
|
|
727
|
+
...options,
|
|
728
|
+
signal: options.signal === undefined
|
|
729
|
+
? execution.signal
|
|
730
|
+
: AbortSignal.any([execution.signal, options.signal]),
|
|
731
|
+
timeoutMs: Math.min(options.timeoutMs ?? remaining, remaining),
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
function requireLive(execution) {
|
|
735
|
+
if (execution.signal.aborted) {
|
|
736
|
+
throw new FunctionError('FUNCTION_CANCELLED', 'Remote invocation was cancelled.');
|
|
737
|
+
}
|
|
738
|
+
if (execution.deadline <= Date.now()) {
|
|
739
|
+
throw new FunctionError('FUNCTION_DEADLINE_EXCEEDED', 'Remote invocation deadline was exceeded.');
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
function callbackTtl(deadline) {
|
|
743
|
+
return Math.max(1, Math.min(CALLBACK_TTL_SECONDS, Math.floor((deadline - Date.now()) / 1_000)));
|
|
744
|
+
}
|
|
745
|
+
function httpIssuer(input, allowInsecureHttp) {
|
|
746
|
+
const admitted = issuer.accept(input);
|
|
747
|
+
let url;
|
|
748
|
+
try {
|
|
749
|
+
url = new URL(admitted);
|
|
750
|
+
}
|
|
751
|
+
catch (cause) {
|
|
752
|
+
throw new TypeError('Remote identity issuer must be an absolute HTTP(S) URL.', { cause });
|
|
753
|
+
}
|
|
754
|
+
if (url.username !== '' ||
|
|
755
|
+
url.password !== '' ||
|
|
756
|
+
url.search !== '' ||
|
|
757
|
+
url.hash !== '' ||
|
|
758
|
+
(url.protocol !== 'https:' && !(allowInsecureHttp && url.protocol === 'http:'))) {
|
|
759
|
+
throw new TypeError(allowInsecureHttp
|
|
760
|
+
? 'Remote identity issuer must be an absolute HTTP(S) URL without credentials, query, or fragment.'
|
|
761
|
+
: 'Remote identity issuer must be an absolute HTTPS URL without credentials, query, or fragment.');
|
|
762
|
+
}
|
|
763
|
+
return admitted;
|
|
764
|
+
}
|
|
765
|
+
function admitEndpoint(input, policy) {
|
|
766
|
+
let url;
|
|
767
|
+
try {
|
|
768
|
+
url = new URL(input);
|
|
769
|
+
}
|
|
770
|
+
catch (cause) {
|
|
771
|
+
throw new CredentialRejected('Credential issuer endpoint is invalid.', cause);
|
|
772
|
+
}
|
|
773
|
+
if (url.username !== '' ||
|
|
774
|
+
url.password !== '' ||
|
|
775
|
+
url.hash !== '' ||
|
|
776
|
+
(url.protocol !== 'https:' && !(policy.allowInsecureHttp === true && url.protocol === 'http:'))) {
|
|
777
|
+
throw new CredentialRejected('Credential issuer endpoint is not allowed.');
|
|
778
|
+
}
|
|
779
|
+
if (policy.allowEndpoint?.(url.toString()) === false) {
|
|
780
|
+
throw new CredentialRejected('Credential issuer endpoint is denied by policy.');
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function invocationUrl(input) {
|
|
784
|
+
return `${input.replace(/\/+$/u, '')}/invoke`;
|
|
785
|
+
}
|
|
786
|
+
class CredentialRejected extends Error {
|
|
787
|
+
constructor(message, cause) {
|
|
788
|
+
super(message, { cause });
|
|
789
|
+
this.name = 'CredentialRejected';
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
class IssuerUnavailable extends Error {
|
|
793
|
+
constructor(message, cause) {
|
|
794
|
+
super(message, { cause });
|
|
795
|
+
this.name = 'IssuerUnavailable';
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
//# sourceMappingURL=remote.js.map
|