@astrale-os/kernel-protocol 0.5.0-beta.8 → 1.0.0-beta.1
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/dist/artifact/index.d.ts +1 -2
- package/dist/artifact/index.js +1 -2
- package/dist/artifact/ref.d.ts +2 -1
- package/dist/artifact/ref.js +4 -4
- package/dist/codecs/codec.d.ts +0 -1
- package/dist/codecs/codec.js +0 -1
- package/dist/codecs/index.d.ts +1 -3
- package/dist/codecs/index.js +1 -3
- package/dist/codecs/json.d.ts +0 -1
- package/dist/codecs/json.js +0 -1
- package/dist/codecs/media-types.d.ts +0 -2
- package/dist/codecs/media-types.js +0 -2
- package/dist/errors/codes.d.ts +0 -1
- package/dist/errors/codes.js +0 -1
- package/dist/errors/http-status.d.ts +0 -1
- package/dist/errors/http-status.js +0 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/payload.d.ts +0 -1
- package/dist/errors/payload.js +0 -1
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +0 -1
- package/dist/errors/reason.d.ts +0 -1
- package/dist/errors/reason.js +0 -1
- package/dist/errors/retry.d.ts +23 -0
- package/dist/errors/retry.js +44 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/invocation/admission.d.ts +2 -3
- package/dist/invocation/admission.js +5 -6
- package/dist/invocation/binary.d.ts +1 -1
- package/dist/invocation/binary.js +21 -5
- package/dist/invocation/binding-codecs.d.ts +3 -3
- package/dist/invocation/binding-codecs.js +1 -7
- package/dist/invocation/cancellation.d.ts +0 -1
- package/dist/invocation/cancellation.js +0 -1
- package/dist/invocation/correlation.d.ts +0 -1
- package/dist/invocation/correlation.js +0 -1
- package/dist/invocation/delegate.d.ts +0 -21
- package/dist/invocation/delegate.js +2 -35
- package/dist/invocation/http/binary.d.ts +3 -2
- package/dist/invocation/http/binary.js +6 -2
- package/dist/invocation/http/index.d.ts +2 -2
- package/dist/invocation/http/index.js +2 -2
- package/dist/invocation/http/negotiation.d.ts +0 -1
- package/dist/invocation/http/negotiation.js +3 -11
- package/dist/invocation/http/request.d.ts +11 -0
- package/dist/invocation/http/request.js +69 -0
- package/dist/invocation/http/stream.d.ts +0 -1
- package/dist/invocation/http/stream.js +0 -1
- package/dist/invocation/http/trace.d.ts +0 -1
- package/dist/invocation/http/trace.js +0 -1
- package/dist/invocation/idempotency.d.ts +0 -1
- package/dist/invocation/idempotency.js +0 -1
- package/dist/invocation/identity.d.ts +0 -1
- package/dist/invocation/identity.js +0 -1
- package/dist/invocation/index.d.ts +3 -4
- package/dist/invocation/index.js +3 -4
- package/dist/invocation/miss.d.ts +0 -1
- package/dist/invocation/miss.js +0 -1
- package/dist/invocation/redirect.d.ts +10 -13
- package/dist/invocation/redirect.js +10 -23
- package/dist/invocation/request.d.ts +0 -1
- package/dist/invocation/request.js +2 -3
- package/dist/invocation/response.d.ts +0 -1
- package/dist/invocation/response.js +0 -1
- package/dist/invocation/routing.d.ts +14 -5
- package/dist/invocation/routing.js +35 -21
- package/dist/invocation/schema.d.ts +6 -5
- package/dist/invocation/schema.js +5 -12
- package/dist/invocation/service-reason.d.ts +20 -16
- package/dist/invocation/service-reason.js +27 -20
- package/dist/invocation/stale-route.d.ts +3 -4
- package/dist/invocation/stale-route.js +0 -1
- package/dist/invocation/stream.d.ts +0 -1
- package/dist/invocation/stream.js +0 -1
- package/dist/invocation/target.d.ts +5 -3
- package/dist/invocation/target.js +25 -4
- package/dist/invocation/trace.d.ts +0 -1
- package/dist/invocation/trace.js +0 -1
- package/dist/invocation/version.d.ts +0 -1
- package/dist/invocation/version.js +0 -1
- package/dist/invocation/websocket/binary.d.ts +0 -1
- package/dist/invocation/websocket/binary.js +1 -1
- package/dist/invocation/websocket/index.d.ts +1 -2
- package/dist/invocation/websocket/index.js +1 -2
- package/dist/invocation/websocket/subprotocol.d.ts +1 -3
- package/dist/invocation/websocket/subprotocol.js +3 -5
- package/dist/issuer/claims.d.ts +7 -0
- package/dist/issuer/claims.js +7 -0
- package/dist/issuer/configuration.d.ts +0 -1
- package/dist/issuer/configuration.js +0 -1
- package/dist/issuer/error.d.ts +0 -1
- package/dist/issuer/error.js +0 -1
- package/dist/issuer/exchange.d.ts +0 -1
- package/dist/issuer/exchange.js +0 -1
- package/dist/issuer/hosted.d.ts +0 -1
- package/dist/issuer/hosted.js +0 -1
- package/dist/issuer/index.d.ts +2 -1
- package/dist/issuer/index.js +2 -1
- package/dist/issuer/key-set.d.ts +0 -1
- package/dist/issuer/key-set.js +0 -1
- package/dist/issuer/paths.d.ts +2 -1
- package/dist/issuer/paths.js +1 -1
- package/dist/issuer/url.d.ts +0 -1
- package/dist/issuer/url.js +0 -1
- package/dist/issuer/workflow-engine.d.ts +18 -0
- package/dist/issuer/workflow-engine.js +59 -0
- package/dist/{publication → release}/bindings/callable.d.ts +0 -1
- package/dist/{publication → release}/bindings/callable.js +6 -7
- package/dist/{publication → release}/bindings/index.d.ts +0 -1
- package/dist/{publication → release}/bindings/index.js +0 -1
- package/dist/{publication → release}/bindings/invocation.d.ts +0 -1
- package/dist/release/bindings/invocation.js +13 -0
- package/dist/release/bindings/view.d.ts +11 -0
- package/dist/release/bindings/view.js +54 -0
- package/dist/release/build.d.ts +6 -0
- package/dist/release/build.js +7 -0
- package/dist/release/bundle-admission.d.ts +21 -0
- package/dist/{publication → release}/bundle-admission.js +15 -21
- package/dist/{publication → release}/bundle-descriptor.d.ts +0 -1
- package/dist/release/bundle-descriptor.js +19 -0
- package/dist/release/bundle-evidence.d.ts +3 -0
- package/dist/release/bundle-evidence.js +13 -0
- package/dist/{publication → release}/bundle.d.ts +5 -3
- package/dist/{publication → release}/bundle.js +13 -8
- package/dist/{publication → release}/declaration.d.ts +0 -1
- package/dist/release/declaration.js +1 -0
- package/dist/{publication → release}/delivery/attestation.d.ts +1 -1
- package/dist/{publication → release}/delivery/attestation.js +0 -1
- package/dist/{publication → release}/delivery/claims.d.ts +7 -3
- package/dist/{publication → release}/delivery/claims.js +20 -14
- package/dist/release/delivery/delivery.d.ts +11 -0
- package/dist/{publication → release}/delivery/delivery.js +7 -13
- package/dist/{publication → release}/delivery/error.d.ts +2 -1
- package/dist/{publication → release}/delivery/error.js +1 -1
- package/dist/{publication → release}/delivery/index.d.ts +5 -2
- package/dist/{publication → release}/delivery/index.js +4 -1
- package/dist/{publication → release}/delivery/limits.d.ts +2 -2
- package/dist/release/delivery/limits.js +5 -0
- package/dist/{publication → release}/delivery/request.d.ts +10 -10
- package/dist/{publication → release}/delivery/request.js +9 -11
- package/dist/{publication → release}/delivery-declaration.d.ts +0 -1
- package/dist/{publication → release}/delivery-declaration.js +4 -5
- package/dist/{publication → release}/delivery-endpoint.d.ts +0 -1
- package/dist/release/delivery-endpoint.js +22 -0
- package/dist/release/digest.d.ts +13 -0
- package/dist/{publication/etag.js → release/digest.js} +1 -7
- package/dist/release/error.d.ts +7 -0
- package/dist/release/error.js +11 -0
- package/dist/release/index.d.ts +17 -0
- package/dist/release/index.js +10 -0
- package/dist/release/issuer.d.ts +5 -0
- package/dist/release/issuer.js +34 -0
- package/dist/release/manifest.d.ts +6 -0
- package/dist/release/manifest.js +22 -0
- package/dist/release/reference.d.ts +26 -0
- package/dist/release/reference.js +70 -0
- package/dist/release/release.d.ts +60 -0
- package/dist/release/release.js +125 -0
- package/dist/release/requirements.d.ts +41 -0
- package/dist/release/requirements.js +306 -0
- package/dist/{publication → release}/route.d.ts +0 -1
- package/dist/{publication → release}/route.js +24 -25
- package/dist/{publication → release}/schema.d.ts +0 -1
- package/dist/{publication → release}/schema.js +4 -5
- package/dist/release/served.d.ts +27 -0
- package/dist/release/served.js +56 -0
- package/dist/release/shape.d.ts +8 -0
- package/dist/{publication/content.js → release/shape.js} +0 -1
- package/dist/routes/admission.d.ts +1 -2
- package/dist/routes/admission.js +7 -86
- package/dist/routes/binding.d.ts +3 -4
- package/dist/routes/binding.js +11 -22
- package/dist/routes/collision.d.ts +0 -1
- package/dist/routes/collision.js +0 -1
- package/dist/routes/compiler.d.ts +2 -3
- package/dist/routes/compiler.js +7 -4
- package/dist/routes/credential.d.ts +12 -3
- package/dist/routes/credential.js +9 -5
- package/dist/routes/decode.d.ts +5 -3
- package/dist/routes/decode.js +24 -18
- package/dist/routes/deployment-retired.d.ts +30 -0
- package/dist/routes/deployment-retired.js +96 -0
- package/dist/routes/encode.d.ts +0 -1
- package/dist/routes/encode.js +12 -6
- package/dist/routes/entries.d.ts +23 -0
- package/dist/routes/entries.js +150 -0
- package/dist/routes/error-response.d.ts +0 -1
- package/dist/routes/error-response.js +0 -1
- package/dist/routes/error.d.ts +0 -1
- package/dist/routes/error.js +0 -1
- package/dist/routes/evidence.d.ts +3 -4
- package/dist/routes/evidence.js +7 -34
- package/dist/routes/header.d.ts +9 -0
- package/dist/routes/header.js +34 -0
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.js +2 -3
- package/dist/routes/mapping.d.ts +1 -2
- package/dist/routes/mapping.js +4 -5
- package/dist/routes/match.d.ts +1 -2
- package/dist/routes/match.js +0 -1
- package/dist/routes/placement.d.ts +2 -3
- package/dist/routes/placement.js +0 -1
- package/dist/routes/plan.d.ts +1 -2
- package/dist/routes/plan.js +0 -1
- package/dist/routes/request.d.ts +3 -2
- package/dist/routes/request.js +0 -1
- package/dist/routes/reservation.d.ts +4 -3
- package/dist/routes/reservation.js +14 -9
- package/dist/routes/routing.d.ts +18 -7
- package/dist/routes/routing.js +28 -50
- package/dist/routes/scalar.d.ts +0 -1
- package/dist/routes/scalar.js +0 -1
- package/dist/routes/select.d.ts +1 -2
- package/dist/routes/select.js +0 -1
- package/dist/routes/stream.d.ts +0 -1
- package/dist/routes/stream.js +0 -1
- package/dist/routes/table.d.ts +3 -3
- package/dist/routes/table.js +0 -1
- package/dist/routes/target.d.ts +5 -1
- package/dist/routes/target.js +16 -1
- package/dist/routes/template.d.ts +0 -2
- package/dist/routes/template.js +0 -4
- package/dist/runtime/artifact.d.ts +5 -5
- package/dist/runtime/artifact.js +7 -5
- package/dist/runtime/index.d.ts +1 -2
- package/dist/runtime/index.js +1 -2
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.js +0 -1
- package/dist/schema/installation/codec.d.ts +4 -0
- package/dist/schema/installation/codec.js +70 -0
- package/dist/schema/installation/index.d.ts +2 -1
- package/dist/schema/installation/index.js +1 -1
- package/dist/schema/installation/introspection/codec.d.ts +5 -3
- package/dist/schema/installation/introspection/codec.js +307 -196
- package/dist/schema/installation/introspection/index.d.ts +2 -3
- package/dist/schema/installation/introspection/index.js +1 -2
- package/dist/schema/installation/introspection/result.d.ts +72 -26
- package/dist/schema/installation/introspection/result.js +0 -1
- package/dist/schema/installation/result.d.ts +9 -0
- package/dist/schema/installation/result.js +1 -0
- package/package.json +23 -78
- package/dist/artifact/index.d.ts.map +0 -1
- package/dist/artifact/index.js.map +0 -1
- package/dist/artifact/ref.d.ts.map +0 -1
- package/dist/artifact/ref.js.map +0 -1
- package/dist/codecs/codec.d.ts.map +0 -1
- package/dist/codecs/codec.js.map +0 -1
- package/dist/codecs/index.d.ts.map +0 -1
- package/dist/codecs/index.js.map +0 -1
- package/dist/codecs/json.d.ts.map +0 -1
- package/dist/codecs/json.js.map +0 -1
- package/dist/codecs/media-types.d.ts.map +0 -1
- package/dist/codecs/media-types.js.map +0 -1
- package/dist/codecs/msgpack.d.ts +0 -5
- package/dist/codecs/msgpack.d.ts.map +0 -1
- package/dist/codecs/msgpack.js +0 -51
- package/dist/codecs/msgpack.js.map +0 -1
- package/dist/errors/codes.d.ts.map +0 -1
- package/dist/errors/codes.js.map +0 -1
- package/dist/errors/http-status.d.ts.map +0 -1
- package/dist/errors/http-status.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/payload.d.ts.map +0 -1
- package/dist/errors/payload.js.map +0 -1
- package/dist/errors/protocol-error.d.ts.map +0 -1
- package/dist/errors/protocol-error.js.map +0 -1
- package/dist/errors/reason.d.ts.map +0 -1
- package/dist/errors/reason.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/invocation/admission.d.ts.map +0 -1
- package/dist/invocation/admission.js.map +0 -1
- package/dist/invocation/binary.d.ts.map +0 -1
- package/dist/invocation/binary.js.map +0 -1
- package/dist/invocation/binding-codecs.d.ts.map +0 -1
- package/dist/invocation/binding-codecs.js.map +0 -1
- package/dist/invocation/cancellation.d.ts.map +0 -1
- package/dist/invocation/cancellation.js.map +0 -1
- package/dist/invocation/correlation.d.ts.map +0 -1
- package/dist/invocation/correlation.js.map +0 -1
- package/dist/invocation/delegate.d.ts.map +0 -1
- package/dist/invocation/delegate.js.map +0 -1
- package/dist/invocation/http/binary.d.ts.map +0 -1
- package/dist/invocation/http/binary.js.map +0 -1
- package/dist/invocation/http/index.d.ts.map +0 -1
- package/dist/invocation/http/index.js.map +0 -1
- package/dist/invocation/http/negotiation.d.ts.map +0 -1
- package/dist/invocation/http/negotiation.js.map +0 -1
- package/dist/invocation/http/stream.d.ts.map +0 -1
- package/dist/invocation/http/stream.js.map +0 -1
- package/dist/invocation/http/trace.d.ts.map +0 -1
- package/dist/invocation/http/trace.js.map +0 -1
- package/dist/invocation/idempotency.d.ts.map +0 -1
- package/dist/invocation/idempotency.js.map +0 -1
- package/dist/invocation/identity.d.ts.map +0 -1
- package/dist/invocation/identity.js.map +0 -1
- package/dist/invocation/index.d.ts.map +0 -1
- package/dist/invocation/index.js.map +0 -1
- package/dist/invocation/miss.d.ts.map +0 -1
- package/dist/invocation/miss.js.map +0 -1
- package/dist/invocation/redirect.d.ts.map +0 -1
- package/dist/invocation/redirect.js.map +0 -1
- package/dist/invocation/request.d.ts.map +0 -1
- package/dist/invocation/request.js.map +0 -1
- package/dist/invocation/response.d.ts.map +0 -1
- package/dist/invocation/response.js.map +0 -1
- package/dist/invocation/routing.d.ts.map +0 -1
- package/dist/invocation/routing.js.map +0 -1
- package/dist/invocation/schema.d.ts.map +0 -1
- package/dist/invocation/schema.js.map +0 -1
- package/dist/invocation/service-reason.d.ts.map +0 -1
- package/dist/invocation/service-reason.js.map +0 -1
- package/dist/invocation/stale-route.d.ts.map +0 -1
- package/dist/invocation/stale-route.js.map +0 -1
- package/dist/invocation/stream.d.ts.map +0 -1
- package/dist/invocation/stream.js.map +0 -1
- package/dist/invocation/target.d.ts.map +0 -1
- package/dist/invocation/target.js.map +0 -1
- package/dist/invocation/trace.d.ts.map +0 -1
- package/dist/invocation/trace.js.map +0 -1
- package/dist/invocation/version.d.ts.map +0 -1
- package/dist/invocation/version.js.map +0 -1
- package/dist/invocation/websocket/binary.d.ts.map +0 -1
- package/dist/invocation/websocket/binary.js.map +0 -1
- package/dist/invocation/websocket/index.d.ts.map +0 -1
- package/dist/invocation/websocket/index.js.map +0 -1
- package/dist/invocation/websocket/subprotocol.d.ts.map +0 -1
- package/dist/invocation/websocket/subprotocol.js.map +0 -1
- package/dist/issuer/configuration.d.ts.map +0 -1
- package/dist/issuer/configuration.js.map +0 -1
- package/dist/issuer/error.d.ts.map +0 -1
- package/dist/issuer/error.js.map +0 -1
- package/dist/issuer/exchange.d.ts.map +0 -1
- package/dist/issuer/exchange.js.map +0 -1
- package/dist/issuer/hosted.d.ts.map +0 -1
- package/dist/issuer/hosted.js.map +0 -1
- package/dist/issuer/index.d.ts.map +0 -1
- package/dist/issuer/index.js.map +0 -1
- package/dist/issuer/key-set.d.ts.map +0 -1
- package/dist/issuer/key-set.js.map +0 -1
- package/dist/issuer/paths.d.ts.map +0 -1
- package/dist/issuer/paths.js.map +0 -1
- package/dist/issuer/url.d.ts.map +0 -1
- package/dist/issuer/url.js.map +0 -1
- package/dist/publication/bindings/callable.d.ts.map +0 -1
- package/dist/publication/bindings/callable.js.map +0 -1
- package/dist/publication/bindings/index.d.ts.map +0 -1
- package/dist/publication/bindings/index.js.map +0 -1
- package/dist/publication/bindings/invocation.d.ts.map +0 -1
- package/dist/publication/bindings/invocation.js +0 -14
- package/dist/publication/bindings/invocation.js.map +0 -1
- package/dist/publication/bindings/view.d.ts +0 -8
- package/dist/publication/bindings/view.d.ts.map +0 -1
- package/dist/publication/bindings/view.js +0 -29
- package/dist/publication/bindings/view.js.map +0 -1
- package/dist/publication/bundle-admission.d.ts +0 -5
- package/dist/publication/bundle-admission.d.ts.map +0 -1
- package/dist/publication/bundle-admission.js.map +0 -1
- package/dist/publication/bundle-descriptor.d.ts.map +0 -1
- package/dist/publication/bundle-descriptor.js +0 -20
- package/dist/publication/bundle-descriptor.js.map +0 -1
- package/dist/publication/bundle-evidence.d.ts +0 -4
- package/dist/publication/bundle-evidence.d.ts.map +0 -1
- package/dist/publication/bundle-evidence.js +0 -14
- package/dist/publication/bundle-evidence.js.map +0 -1
- package/dist/publication/bundle.d.ts.map +0 -1
- package/dist/publication/bundle.js.map +0 -1
- package/dist/publication/content.d.ts +0 -11
- package/dist/publication/content.d.ts.map +0 -1
- package/dist/publication/content.js.map +0 -1
- package/dist/publication/declaration.d.ts.map +0 -1
- package/dist/publication/declaration.js +0 -2
- package/dist/publication/declaration.js.map +0 -1
- package/dist/publication/delivery/attestation.d.ts.map +0 -1
- package/dist/publication/delivery/attestation.js.map +0 -1
- package/dist/publication/delivery/claims.d.ts.map +0 -1
- package/dist/publication/delivery/claims.js.map +0 -1
- package/dist/publication/delivery/delivery.d.ts +0 -10
- package/dist/publication/delivery/delivery.d.ts.map +0 -1
- package/dist/publication/delivery/delivery.js.map +0 -1
- package/dist/publication/delivery/error.d.ts.map +0 -1
- package/dist/publication/delivery/error.js.map +0 -1
- package/dist/publication/delivery/index.d.ts.map +0 -1
- package/dist/publication/delivery/index.js.map +0 -1
- package/dist/publication/delivery/limits.d.ts.map +0 -1
- package/dist/publication/delivery/limits.js +0 -5
- package/dist/publication/delivery/limits.js.map +0 -1
- package/dist/publication/delivery/request.d.ts.map +0 -1
- package/dist/publication/delivery/request.js.map +0 -1
- package/dist/publication/delivery-declaration.d.ts.map +0 -1
- package/dist/publication/delivery-declaration.js.map +0 -1
- package/dist/publication/delivery-endpoint.d.ts.map +0 -1
- package/dist/publication/delivery-endpoint.js +0 -23
- package/dist/publication/delivery-endpoint.js.map +0 -1
- package/dist/publication/error.d.ts +0 -8
- package/dist/publication/error.d.ts.map +0 -1
- package/dist/publication/error.js +0 -12
- package/dist/publication/error.js.map +0 -1
- package/dist/publication/etag.d.ts +0 -7
- package/dist/publication/etag.d.ts.map +0 -1
- package/dist/publication/etag.js.map +0 -1
- package/dist/publication/index.d.ts +0 -18
- package/dist/publication/index.d.ts.map +0 -1
- package/dist/publication/index.js +0 -11
- package/dist/publication/index.js.map +0 -1
- package/dist/publication/manifest.d.ts +0 -7
- package/dist/publication/manifest.d.ts.map +0 -1
- package/dist/publication/manifest.js +0 -31
- package/dist/publication/manifest.js.map +0 -1
- package/dist/publication/publication.d.ts +0 -37
- package/dist/publication/publication.d.ts.map +0 -1
- package/dist/publication/publication.js +0 -134
- package/dist/publication/publication.js.map +0 -1
- package/dist/publication/reference.d.ts +0 -18
- package/dist/publication/reference.d.ts.map +0 -1
- package/dist/publication/reference.js +0 -69
- package/dist/publication/reference.js.map +0 -1
- package/dist/publication/requirements.d.ts +0 -27
- package/dist/publication/requirements.d.ts.map +0 -1
- package/dist/publication/requirements.js +0 -181
- package/dist/publication/requirements.js.map +0 -1
- package/dist/publication/route.d.ts.map +0 -1
- package/dist/publication/route.js.map +0 -1
- package/dist/publication/schema.d.ts.map +0 -1
- package/dist/publication/schema.js.map +0 -1
- package/dist/routes/admission.d.ts.map +0 -1
- package/dist/routes/admission.js.map +0 -1
- package/dist/routes/binding.d.ts.map +0 -1
- package/dist/routes/binding.js.map +0 -1
- package/dist/routes/collision.d.ts.map +0 -1
- package/dist/routes/collision.js.map +0 -1
- package/dist/routes/compiler.d.ts.map +0 -1
- package/dist/routes/compiler.js.map +0 -1
- package/dist/routes/credential.d.ts.map +0 -1
- package/dist/routes/credential.js.map +0 -1
- package/dist/routes/decode.d.ts.map +0 -1
- package/dist/routes/decode.js.map +0 -1
- package/dist/routes/encode.d.ts.map +0 -1
- package/dist/routes/encode.js.map +0 -1
- package/dist/routes/error-response.d.ts.map +0 -1
- package/dist/routes/error-response.js.map +0 -1
- package/dist/routes/error.d.ts.map +0 -1
- package/dist/routes/error.js.map +0 -1
- package/dist/routes/evidence.d.ts.map +0 -1
- package/dist/routes/evidence.js.map +0 -1
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/index.js.map +0 -1
- package/dist/routes/mapping.d.ts.map +0 -1
- package/dist/routes/mapping.js.map +0 -1
- package/dist/routes/match.d.ts.map +0 -1
- package/dist/routes/match.js.map +0 -1
- package/dist/routes/placement.d.ts.map +0 -1
- package/dist/routes/placement.js.map +0 -1
- package/dist/routes/plan.d.ts.map +0 -1
- package/dist/routes/plan.js.map +0 -1
- package/dist/routes/release-unavailable.d.ts +0 -9
- package/dist/routes/release-unavailable.d.ts.map +0 -1
- package/dist/routes/release-unavailable.js +0 -33
- package/dist/routes/release-unavailable.js.map +0 -1
- package/dist/routes/request.d.ts.map +0 -1
- package/dist/routes/request.js.map +0 -1
- package/dist/routes/reservation.d.ts.map +0 -1
- package/dist/routes/reservation.js.map +0 -1
- package/dist/routes/routing.d.ts.map +0 -1
- package/dist/routes/routing.js.map +0 -1
- package/dist/routes/scalar.d.ts.map +0 -1
- package/dist/routes/scalar.js.map +0 -1
- package/dist/routes/select.d.ts.map +0 -1
- package/dist/routes/select.js.map +0 -1
- package/dist/routes/stream.d.ts.map +0 -1
- package/dist/routes/stream.js.map +0 -1
- package/dist/routes/table.d.ts.map +0 -1
- package/dist/routes/table.js.map +0 -1
- package/dist/routes/target.d.ts.map +0 -1
- package/dist/routes/target.js.map +0 -1
- package/dist/routes/template.d.ts.map +0 -1
- package/dist/routes/template.js.map +0 -1
- package/dist/runtime/artifact.d.ts.map +0 -1
- package/dist/runtime/artifact.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/installation/index.d.ts.map +0 -1
- package/dist/schema/installation/index.js.map +0 -1
- package/dist/schema/installation/introspection/codec.d.ts.map +0 -1
- package/dist/schema/installation/introspection/codec.js.map +0 -1
- package/dist/schema/installation/introspection/index.d.ts.map +0 -1
- package/dist/schema/installation/introspection/index.js.map +0 -1
- package/dist/schema/installation/introspection/result.d.ts.map +0 -1
- package/dist/schema/installation/introspection/result.js.map +0 -1
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
|
|
2
2
|
import { accept as acceptIssuer } from '@astrale-os/kernel-core/auth/issuer';
|
|
3
|
-
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
import { Key, patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
4
4
|
import { CODES, reasonOf } from '../errors/index.js';
|
|
5
|
-
export const
|
|
6
|
-
export const SCHEMA_REVISION_MISMATCH = 'SCHEMA_REVISION_MISMATCH';
|
|
5
|
+
export const CALLABLE_FINGERPRINT_MISMATCH = 'CALLABLE_FINGERPRINT_MISMATCH';
|
|
7
6
|
export const SERVICE_TRUST_REQUIRED = 'SERVICE_TRUST_REQUIRED';
|
|
8
7
|
export const SERVICE_UNAVAILABLE = 'SERVICE_UNAVAILABLE';
|
|
9
8
|
export const SERVICE_CANDIDATE_INVALID = 'SERVICE_CANDIDATE_INVALID';
|
|
9
|
+
/** A deployment answers that it no longer serves: it runs no other code in its place. */
|
|
10
|
+
export const DEPLOYMENT_RETIRED = 'DEPLOYMENT_RETIRED';
|
|
10
11
|
/** Recognize only exact outer-code, reason-code, and detail-shape combinations. */
|
|
11
12
|
export function serviceErrorOf(input) {
|
|
12
13
|
const reason = reasonOf(input.data);
|
|
13
14
|
if (reason === undefined)
|
|
14
15
|
return undefined;
|
|
15
16
|
switch (reason.code) {
|
|
16
|
-
case
|
|
17
|
-
return input.code === CODES.CONFLICT &&
|
|
18
|
-
? input
|
|
19
|
-
: undefined;
|
|
20
|
-
case SCHEMA_UPGRADE_REQUIRED:
|
|
21
|
-
return input.code === CODES.CONFLICT && schemaUpgradeDetails(reason.details)
|
|
17
|
+
case CALLABLE_FINGERPRINT_MISMATCH:
|
|
18
|
+
return input.code === CODES.CONFLICT && callableFingerprintMismatchDetails(reason.details)
|
|
22
19
|
? input
|
|
23
20
|
: undefined;
|
|
24
21
|
case SERVICE_TRUST_REQUIRED:
|
|
@@ -33,21 +30,22 @@ export function serviceErrorOf(input) {
|
|
|
33
30
|
return input.code === CODES.BACKEND_UNAVAILABLE && candidateInvalidDetails(reason.details)
|
|
34
31
|
? input
|
|
35
32
|
: undefined;
|
|
33
|
+
case DEPLOYMENT_RETIRED:
|
|
34
|
+
return input.code === CODES.NOT_FOUND && deploymentRetiredDetails(reason.details)
|
|
35
|
+
? input
|
|
36
|
+
: undefined;
|
|
36
37
|
default:
|
|
37
38
|
return undefined;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
return (exact(input, ['origin', '
|
|
41
|
+
function callableFingerprintMismatchDetails(input) {
|
|
42
|
+
return (exact(input, ['origin', 'callable', 'expectedFingerprint', 'installedFingerprint']) &&
|
|
42
43
|
isOrigin(input.origin) &&
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
isOrigin(input.origin) &&
|
|
49
|
-
isRevision(input.installedRevision) &&
|
|
50
|
-
isRevision(input.candidateRevision));
|
|
44
|
+
typeof input.callable === 'string' &&
|
|
45
|
+
Key.is(input.callable) &&
|
|
46
|
+
Key.origin(input.callable) === input.origin &&
|
|
47
|
+
isDigest(input.expectedFingerprint) &&
|
|
48
|
+
isDigest(input.installedFingerprint));
|
|
51
49
|
}
|
|
52
50
|
function serviceTrustDetails(input) {
|
|
53
51
|
return (exact(input, ['origin', 'installedIssuer', 'candidateIssuer']) &&
|
|
@@ -61,6 +59,13 @@ function serviceUnavailableDetails(input) {
|
|
|
61
59
|
function candidateInvalidDetails(input) {
|
|
62
60
|
return exact(input, ['origin']) && isOrigin(input.origin);
|
|
63
61
|
}
|
|
62
|
+
function deploymentRetiredDetails(input) {
|
|
63
|
+
return Object.hasOwn(input, 'release')
|
|
64
|
+
? exact(input, ['deployment', 'release']) &&
|
|
65
|
+
isIssuer(input.deployment) &&
|
|
66
|
+
isDigest(input.release)
|
|
67
|
+
: exact(input, ['deployment']) && isIssuer(input.deployment);
|
|
68
|
+
}
|
|
64
69
|
function exact(input, fields) {
|
|
65
70
|
return (Object.keys(input).length === fields.length &&
|
|
66
71
|
fields.every((field) => Object.hasOwn(input, field)));
|
|
@@ -71,6 +76,9 @@ function isOrigin(input) {
|
|
|
71
76
|
function isRevision(input) {
|
|
72
77
|
return typeof input === 'string' && patterns.revision.test(input);
|
|
73
78
|
}
|
|
79
|
+
function isDigest(input) {
|
|
80
|
+
return typeof input === 'string' && /^sha256:[0-9a-f]{64}$/u.test(input);
|
|
81
|
+
}
|
|
74
82
|
function isIssuer(input) {
|
|
75
83
|
if (typeof input !== 'string')
|
|
76
84
|
return false;
|
|
@@ -83,4 +91,3 @@ function isIssuer(input) {
|
|
|
83
91
|
throw cause;
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
|
-
//# sourceMappingURL=service-reason.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReleaseDigest } from '../release/digest.js';
|
|
2
2
|
import type { RequestId } from './correlation.js';
|
|
3
3
|
import type { InvocationId } from './identity.js';
|
|
4
4
|
/** Reserved pre-handler routing control; never an application ErrorResponse. */
|
|
@@ -6,8 +6,7 @@ export interface Stale {
|
|
|
6
6
|
readonly kind: 'stale';
|
|
7
7
|
readonly requestId: RequestId;
|
|
8
8
|
readonly invocation: InvocationId;
|
|
9
|
-
readonly current:
|
|
9
|
+
readonly current: ReleaseDigest;
|
|
10
10
|
}
|
|
11
11
|
export declare function decodeStale(input: unknown): Stale;
|
|
12
|
-
export declare function stale(requestId: RequestId, assigned: InvocationId, current:
|
|
13
|
-
//# sourceMappingURL=stale-route.d.ts.map
|
|
12
|
+
export declare function stale(requestId: RequestId, assigned: InvocationId, current: ReleaseDigest): Stale;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Value } from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { type Call } from '@astrale-os/kernel-core/callable';
|
|
3
|
+
export { Target, targetPath, type Call } from '@astrale-os/kernel-core/callable';
|
|
3
4
|
export declare function acceptCall(input: unknown): Call;
|
|
4
|
-
|
|
5
|
+
/** Package-private: consume the detached portable subtree captured by request admission. */
|
|
6
|
+
export declare function callFromSnapshot(input: Value): Call;
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Target } from '@astrale-os/kernel-core/callable';
|
|
2
|
+
import { PathError } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import { exactFields, invalid, nodePath, portableObject, required } from './admission.js';
|
|
4
|
+
export { Target, targetPath } from '@astrale-os/kernel-core/callable';
|
|
2
5
|
const CALL_FIELDS = new Set(['target', 'input']);
|
|
3
6
|
export function acceptCall(input) {
|
|
4
|
-
|
|
7
|
+
return callFromSnapshot(portableObject(input, 'call'));
|
|
8
|
+
}
|
|
9
|
+
/** Package-private: consume the detached portable subtree captured by request admission. */
|
|
10
|
+
export function callFromSnapshot(input) {
|
|
11
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
12
|
+
invalid('call must be an object');
|
|
13
|
+
}
|
|
14
|
+
const object = input;
|
|
5
15
|
exactFields(object, CALL_FIELDS, 'call');
|
|
6
16
|
required(object, ['target', 'input'], 'call');
|
|
7
17
|
return Object.freeze({
|
|
8
|
-
target:
|
|
18
|
+
target: acceptTarget(object.target),
|
|
9
19
|
input: object.input,
|
|
10
20
|
});
|
|
11
21
|
}
|
|
12
|
-
|
|
22
|
+
function acceptTarget(input) {
|
|
23
|
+
if (typeof input === 'string')
|
|
24
|
+
return nodePath(input, 'call.target');
|
|
25
|
+
try {
|
|
26
|
+
return Target(input);
|
|
27
|
+
}
|
|
28
|
+
catch (cause) {
|
|
29
|
+
if (cause instanceof TypeError || cause instanceof PathError)
|
|
30
|
+
return invalid('call.target must be a canonical NodePath or declaration Target');
|
|
31
|
+
throw cause;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/dist/invocation/trace.js
CHANGED
|
@@ -14,6 +14,7 @@ export function encodeBinary(response) {
|
|
|
14
14
|
requestId: response.requestId,
|
|
15
15
|
invocation: response.invocation,
|
|
16
16
|
mediaType: response.mediaType,
|
|
17
|
+
status: response.status,
|
|
17
18
|
...(headers === undefined ? {} : { headers }),
|
|
18
19
|
}));
|
|
19
20
|
if (metadata.byteLength > MAXIMUM_METADATA_BYTES)
|
|
@@ -69,4 +70,3 @@ function invalid() {
|
|
|
69
70
|
message: 'WebSocket binary response is invalid.',
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
//# sourceMappingURL=binary.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { decodeBinary, encodeBinary } from './binary.js';
|
|
2
|
-
export { JSON_SUBPROTOCOL,
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
export { JSON_SUBPROTOCOL, selectSubprotocol, subprotocolFor, type Subprotocol, type SubprotocolSelection, } from './subprotocol.js';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { decodeBinary, encodeBinary } from './binary.js';
|
|
2
|
-
export { JSON_SUBPROTOCOL,
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
export { JSON_SUBPROTOCOL, selectSubprotocol, subprotocolFor, } from './subprotocol.js';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Codec } from '../../codecs/index.js';
|
|
2
2
|
export declare const JSON_SUBPROTOCOL: 'astrale.invocation.v2.json';
|
|
3
|
-
export
|
|
4
|
-
export type Subprotocol = typeof JSON_SUBPROTOCOL | typeof MSGPACK_SUBPROTOCOL;
|
|
3
|
+
export type Subprotocol = typeof JSON_SUBPROTOCOL;
|
|
5
4
|
export interface SubprotocolSelection {
|
|
6
5
|
readonly subprotocol: Subprotocol;
|
|
7
6
|
readonly codec: Codec;
|
|
8
7
|
}
|
|
9
8
|
export declare function subprotocolFor(codec: Codec): Subprotocol;
|
|
10
9
|
export declare function selectSubprotocol(offered: string | null, supported: readonly Codec[]): SubprotocolSelection | undefined;
|
|
11
|
-
//# sourceMappingURL=subprotocol.d.ts.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { admitSupportedCodecs, codecProfile } from '../binding-codecs.js';
|
|
2
2
|
export const JSON_SUBPROTOCOL = 'astrale.invocation.v2.json';
|
|
3
|
-
export const MSGPACK_SUBPROTOCOL = 'astrale.invocation.v2.msgpack';
|
|
4
3
|
const TOKEN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u;
|
|
5
4
|
export function subprotocolFor(codec) {
|
|
6
|
-
|
|
7
|
-
if (profile === undefined)
|
|
5
|
+
if (codecProfile(codec) === undefined) {
|
|
8
6
|
throw new TypeError('codec is not a canonical Invocation codec.');
|
|
9
|
-
|
|
7
|
+
}
|
|
8
|
+
return JSON_SUBPROTOCOL;
|
|
10
9
|
}
|
|
11
10
|
export function selectSubprotocol(offered, supported) {
|
|
12
11
|
const admitted = admitSupportedCodecs(supported);
|
|
@@ -27,4 +26,3 @@ export function selectSubprotocol(offered, supported) {
|
|
|
27
26
|
}
|
|
28
27
|
return undefined;
|
|
29
28
|
}
|
|
30
|
-
//# sourceMappingURL=subprotocol.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Private JWT claim of the self credential a durable step's Domain signs for the Kernel: the id of
|
|
3
|
+
* the Execution the step belongs to. After a consented issuer change, the Kernel accepts the
|
|
4
|
+
* replaced issuer past its window only for a credential naming an unfinished run of its Domain
|
|
5
|
+
* that was in flight at that change.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EXECUTION_CLAIM = "execution";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Private JWT claim of the self credential a durable step's Domain signs for the Kernel: the id of
|
|
3
|
+
* the Execution the step belongs to. After a consented issuer change, the Kernel accepts the
|
|
4
|
+
* replaced issuer past its window only for a credential naming an unfinished run of its Domain
|
|
5
|
+
* that was in flight at that change.
|
|
6
|
+
*/
|
|
7
|
+
export const EXECUTION_CLAIM = 'execution';
|
|
@@ -12,4 +12,3 @@ export interface ConfigurationOptions {
|
|
|
12
12
|
export declare function configuration(issuer: string, algorithms: readonly [string, ...string[]], options?: ConfigurationOptions): Configuration;
|
|
13
13
|
export declare function acceptConfiguration(input: unknown, expectedIssuer?: string): Configuration;
|
|
14
14
|
export declare function acceptAlgorithms(input: unknown): readonly [string, ...string[]];
|
|
15
|
-
//# sourceMappingURL=configuration.d.ts.map
|
package/dist/issuer/error.d.ts
CHANGED
package/dist/issuer/error.js
CHANGED
|
@@ -23,4 +23,3 @@ export declare function acceptResponse(input: unknown): Response;
|
|
|
23
23
|
export declare function acceptErrorResponse(input: unknown): ErrorResponse;
|
|
24
24
|
export declare function acceptHttpRequest(input: HttpRequest): Request;
|
|
25
25
|
export declare function responseHeaders(): Readonly<Record<string, string>>;
|
|
26
|
-
//# sourceMappingURL=exchange.d.ts.map
|
package/dist/issuer/exchange.js
CHANGED
package/dist/issuer/hosted.d.ts
CHANGED
package/dist/issuer/hosted.js
CHANGED
package/dist/issuer/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
export { EXECUTION_CLAIM } from './claims.js';
|
|
1
2
|
export { acceptConfiguration, configuration, type Configuration, type ConfigurationOptions, } from './configuration.js';
|
|
2
3
|
export { DiscoveryError, type DiscoveryErrorCode } from './error.js';
|
|
3
4
|
export { hosted } from './hosted.js';
|
|
4
5
|
export { acceptKeySet, keySet, type KeySet } from './key-set.js';
|
|
5
6
|
export { paths, type Paths } from './paths.js';
|
|
7
|
+
export { acceptWorkflowEngine, acceptWorkflowEngineIdentityKey, workflowEngine, type WorkflowEngine, } from './workflow-engine.js';
|
|
6
8
|
export * as exchange from './exchange.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/issuer/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
export { EXECUTION_CLAIM } from './claims.js';
|
|
1
2
|
export { acceptConfiguration, configuration, } from './configuration.js';
|
|
2
3
|
export { DiscoveryError } from './error.js';
|
|
3
4
|
export { hosted } from './hosted.js';
|
|
4
5
|
export { acceptKeySet, keySet } from './key-set.js';
|
|
5
6
|
export { paths } from './paths.js';
|
|
7
|
+
export { acceptWorkflowEngine, acceptWorkflowEngineIdentityKey, workflowEngine, } from './workflow-engine.js';
|
|
6
8
|
export * as exchange from './exchange.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/issuer/key-set.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export interface KeySet {
|
|
|
4
4
|
}
|
|
5
5
|
export declare function keySet(keys: readonly JsonWebKey[], algorithms: readonly [string, ...string[]]): KeySet;
|
|
6
6
|
export declare function acceptKeySet(input: unknown, algorithms: readonly [string, ...string[]]): KeySet;
|
|
7
|
-
//# sourceMappingURL=key-set.d.ts.map
|
package/dist/issuer/key-set.js
CHANGED
package/dist/issuer/paths.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export interface Paths {
|
|
|
2
2
|
readonly configuration: string;
|
|
3
3
|
readonly keys: string;
|
|
4
4
|
readonly tokenExchange: string;
|
|
5
|
+
/** Where Domains discover the workflow engine of a Kernel that drives one. */
|
|
6
|
+
readonly workflowEngine: string;
|
|
5
7
|
}
|
|
6
8
|
export declare function paths(issuer: string): Paths;
|
|
7
|
-
//# sourceMappingURL=paths.d.ts.map
|
package/dist/issuer/paths.js
CHANGED
|
@@ -6,6 +6,6 @@ export function paths(issuer) {
|
|
|
6
6
|
configuration: `${pathname}/.well-known/openid-configuration`,
|
|
7
7
|
keys: `${pathname}/.well-known/jwks.json`,
|
|
8
8
|
tokenExchange: `${pathname}/.well-known/astrale/token`,
|
|
9
|
+
workflowEngine: `${pathname}/.well-known/astrale/workflow-engine.json`,
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
|
-
//# sourceMappingURL=paths.js.map
|
package/dist/issuer/url.d.ts
CHANGED
package/dist/issuer/url.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
+
/**
|
|
3
|
+
* The workflow engine a Kernel drives, as Domains discover it at
|
|
4
|
+
* `<issuer>/.well-known/astrale/workflow-engine.json`: the engine signs every request to a Domain with
|
|
5
|
+
* one of these Restate request identity keys. Several keys let the Host rotate without a gap.
|
|
6
|
+
*/
|
|
7
|
+
export interface WorkflowEngine {
|
|
8
|
+
readonly issuer: IssuerId;
|
|
9
|
+
readonly identity_keys: readonly [string, ...string[]];
|
|
10
|
+
}
|
|
11
|
+
/** Admit one Restate request identity key without imposing a key-set policy. */
|
|
12
|
+
export declare function acceptWorkflowEngineIdentityKey(input: unknown): string;
|
|
13
|
+
export declare function workflowEngine(issuer: string, identityKeys: readonly string[]): WorkflowEngine;
|
|
14
|
+
/**
|
|
15
|
+
* Admit a discovered engine for the expected issuer. Unlike issuer configuration, unknown fields are
|
|
16
|
+
* ignored: the Kernel may add some without breaking deployed Domains.
|
|
17
|
+
*/
|
|
18
|
+
export declare function acceptWorkflowEngine(input: unknown, expectedIssuer?: string): WorkflowEngine;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { fail } from './error.js';
|
|
2
|
+
import { acceptIssuer } from './url.js';
|
|
3
|
+
/** Restate's `publickeyv1_` id: base58btc of a raw Ed25519 public key. */
|
|
4
|
+
const IDENTITY_KEY = /^publickeyv1_[1-9A-HJ-NP-Za-km-z]{32,64}$/u;
|
|
5
|
+
const BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
6
|
+
const MAXIMUM_IDENTITY_KEYS = 8;
|
|
7
|
+
/** Admit one Restate request identity key without imposing a key-set policy. */
|
|
8
|
+
export function acceptWorkflowEngineIdentityKey(input) {
|
|
9
|
+
if (typeof input !== 'string' || !IDENTITY_KEY.test(input) || decodedKeyBytes(input) !== 32) {
|
|
10
|
+
fail('ISSUER_DISCOVERY_INVALID', 'Workflow engine identity keys are invalid.');
|
|
11
|
+
}
|
|
12
|
+
return input;
|
|
13
|
+
}
|
|
14
|
+
export function workflowEngine(issuer, identityKeys) {
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
issuer: acceptIssuer(issuer),
|
|
17
|
+
identity_keys: acceptIdentityKeys(identityKeys),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Admit a discovered engine for the expected issuer. Unlike issuer configuration, unknown fields are
|
|
22
|
+
* ignored: the Kernel may add some without breaking deployed Domains.
|
|
23
|
+
*/
|
|
24
|
+
export function acceptWorkflowEngine(input, expectedIssuer) {
|
|
25
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
26
|
+
fail('ISSUER_DISCOVERY_INVALID', 'Workflow engine discovery is invalid.');
|
|
27
|
+
}
|
|
28
|
+
const value = input;
|
|
29
|
+
const admitted = acceptIssuer(value.issuer);
|
|
30
|
+
if (expectedIssuer !== undefined && admitted !== acceptIssuer(expectedIssuer)) {
|
|
31
|
+
fail('ISSUER_DISCOVERY_MISMATCH', 'Workflow engine discovery does not match the issuer.');
|
|
32
|
+
}
|
|
33
|
+
return Object.freeze({ issuer: admitted, identity_keys: acceptIdentityKeys(value.identity_keys) });
|
|
34
|
+
}
|
|
35
|
+
function acceptIdentityKeys(input) {
|
|
36
|
+
if (!Array.isArray(input) ||
|
|
37
|
+
input.length === 0 ||
|
|
38
|
+
input.length > MAXIMUM_IDENTITY_KEYS ||
|
|
39
|
+
new Set(input).size !== input.length) {
|
|
40
|
+
fail('ISSUER_DISCOVERY_INVALID', 'Workflow engine identity keys are invalid.');
|
|
41
|
+
}
|
|
42
|
+
return Object.freeze(Array.from(input, acceptWorkflowEngineIdentityKey));
|
|
43
|
+
}
|
|
44
|
+
/** Base58 leading '1' digits represent zero bytes omitted by the integer value. */
|
|
45
|
+
function decodedKeyBytes(key) {
|
|
46
|
+
const encoded = key.slice('publickeyv1_'.length);
|
|
47
|
+
let value = 0n;
|
|
48
|
+
for (const digit of encoded)
|
|
49
|
+
value = value * 58n + BigInt(BASE58.indexOf(digit));
|
|
50
|
+
let bytes = 0;
|
|
51
|
+
for (; value > 0n; value >>= 8n)
|
|
52
|
+
bytes++;
|
|
53
|
+
for (const digit of encoded) {
|
|
54
|
+
if (digit !== '1')
|
|
55
|
+
break;
|
|
56
|
+
bytes++;
|
|
57
|
+
}
|
|
58
|
+
return bytes;
|
|
59
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { callableAddress, Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
-
import { exact, record } from '../content.js';
|
|
3
2
|
import { fail } from '../error.js';
|
|
3
|
+
import { exact, record } from '../shape.js';
|
|
4
4
|
import { acceptInvocationEndpoints } from './invocation.js';
|
|
5
5
|
export function admitCallableBinding(input, origin) {
|
|
6
|
-
const value = record(input, '
|
|
7
|
-
exact(value, ['callable', 'endpoint'], '
|
|
6
|
+
const value = record(input, 'RELEASE_BINDING_INVALID', 'Callable binding is invalid.');
|
|
7
|
+
exact(value, ['callable', 'endpoint'], 'RELEASE_BINDING_INVALID');
|
|
8
8
|
return Object.freeze({
|
|
9
9
|
callable: admitCallableKey(value.callable, origin),
|
|
10
10
|
endpoint: acceptInvocationEndpoints(value.endpoint),
|
|
@@ -17,19 +17,18 @@ export function admitCallableKey(input, origin) {
|
|
|
17
17
|
}
|
|
18
18
|
catch (cause) {
|
|
19
19
|
if (cause instanceof TypeError) {
|
|
20
|
-
return fail('
|
|
20
|
+
return fail('RELEASE_BINDING_INVALID', 'Callable key is invalid.', cause);
|
|
21
21
|
}
|
|
22
22
|
throw cause;
|
|
23
23
|
}
|
|
24
24
|
if (Key.origin(callable) !== origin) {
|
|
25
|
-
fail('
|
|
25
|
+
fail('RELEASE_BINDING_INVALID', 'Binding must name one callable owned by the root Domain.');
|
|
26
26
|
}
|
|
27
27
|
try {
|
|
28
28
|
callableAddress(callable);
|
|
29
29
|
}
|
|
30
30
|
catch (cause) {
|
|
31
|
-
return fail('
|
|
31
|
+
return fail('RELEASE_BINDING_INVALID', 'Binding must name one callable owned by the root Domain.', cause);
|
|
32
32
|
}
|
|
33
33
|
return callable;
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=callable.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { admitCallableBinding, admitCallableKey, type CallableBinding } from './callable.js';
|
|
2
2
|
export { acceptInvocationEndpoints, type InvocationEndpoints } from './invocation.js';
|
|
3
3
|
export { admitViewBinding, type ViewBinding } from './view.js';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { absoluteHttpUrl, absoluteUrl, exact, record } from '../shape.js';
|
|
2
|
+
export function acceptInvocationEndpoints(input) {
|
|
3
|
+
const value = record(input, 'RELEASE_BINDING_INVALID', 'Invocation endpoints are invalid.');
|
|
4
|
+
exact(value, ['http', 'websocket'], 'RELEASE_BINDING_INVALID');
|
|
5
|
+
const http = absoluteHttpUrl(value.http, true, 'RELEASE_BINDING_INVALID');
|
|
6
|
+
const websocket = value.websocket === undefined
|
|
7
|
+
? undefined
|
|
8
|
+
: absoluteUrl(value.websocket, ['ws:', 'wss:'], true, 'RELEASE_BINDING_INVALID');
|
|
9
|
+
return Object.freeze({
|
|
10
|
+
http,
|
|
11
|
+
...(websocket === undefined ? {} : { websocket }),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ViewHostRequirements } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
2
|
+
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
export interface ViewBinding {
|
|
4
|
+
readonly view: Key.View;
|
|
5
|
+
readonly href: string;
|
|
6
|
+
readonly handshake: 'shell' | 'none';
|
|
7
|
+
readonly host?: ViewHostRequirements;
|
|
8
|
+
}
|
|
9
|
+
export declare function admitViewBinding(input: unknown, origin: string): ViewBinding;
|
|
10
|
+
/** Authoring-only normalization used before a release document is sealed. */
|
|
11
|
+
export declare function canonicalizeViewBinding(input: unknown, origin: string): ViewBinding;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { acceptViewHostRequirements, } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
2
|
+
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
import { fail } from '../error.js';
|
|
4
|
+
import { absoluteHttpUrl, exact, record } from '../shape.js';
|
|
5
|
+
export function admitViewBinding(input, origin) {
|
|
6
|
+
return readViewBinding(input, origin, false);
|
|
7
|
+
}
|
|
8
|
+
/** Authoring-only normalization used before a release document is sealed. */
|
|
9
|
+
export function canonicalizeViewBinding(input, origin) {
|
|
10
|
+
return readViewBinding(input, origin, true);
|
|
11
|
+
}
|
|
12
|
+
function readViewBinding(input, origin, canonicalize) {
|
|
13
|
+
const value = record(input, 'RELEASE_VIEW_INVALID', 'Release View binding is invalid.');
|
|
14
|
+
exact(value, ['view', 'href', 'handshake', 'host'], 'RELEASE_VIEW_INVALID');
|
|
15
|
+
let view;
|
|
16
|
+
try {
|
|
17
|
+
view = Key(String(value.view));
|
|
18
|
+
}
|
|
19
|
+
catch (cause) {
|
|
20
|
+
if (cause instanceof TypeError) {
|
|
21
|
+
return fail('RELEASE_VIEW_INVALID', 'View key is invalid.', cause);
|
|
22
|
+
}
|
|
23
|
+
throw cause;
|
|
24
|
+
}
|
|
25
|
+
if (Key.origin(view) !== origin || !view.slice(view.indexOf(':') + 1).startsWith('view.')) {
|
|
26
|
+
fail('RELEASE_VIEW_INVALID', 'View binding must name a root View.');
|
|
27
|
+
}
|
|
28
|
+
if (value.handshake !== 'shell' && value.handshake !== 'none') {
|
|
29
|
+
fail('RELEASE_VIEW_INVALID', 'View handshake is invalid.');
|
|
30
|
+
}
|
|
31
|
+
let host;
|
|
32
|
+
try {
|
|
33
|
+
host = acceptViewHostRequirements(dataValue(value, 'host'), value.handshake, canonicalize);
|
|
34
|
+
}
|
|
35
|
+
catch (cause) {
|
|
36
|
+
if (cause instanceof TypeError)
|
|
37
|
+
return fail('RELEASE_VIEW_INVALID', 'View host requirements are invalid.', cause);
|
|
38
|
+
throw cause;
|
|
39
|
+
}
|
|
40
|
+
return Object.freeze({
|
|
41
|
+
view,
|
|
42
|
+
href: absoluteHttpUrl(value.href, true, 'RELEASE_VIEW_INVALID'),
|
|
43
|
+
handshake: value.handshake,
|
|
44
|
+
...(host === undefined ? {} : { host }),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function dataValue(input, key) {
|
|
48
|
+
const descriptor = Object.getOwnPropertyDescriptor(input, key);
|
|
49
|
+
if (descriptor === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (!('value' in descriptor))
|
|
52
|
+
fail('RELEASE_VIEW_INVALID', 'View requirements must be data fields.');
|
|
53
|
+
return descriptor.value;
|
|
54
|
+
}
|