@astrale-os/kernel-protocol 0.5.0-beta.8 → 0.5.0
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 +25 -0
- package/dist/errors/retry.js +46 -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 +5 -5
- package/dist/invocation/index.js +4 -4
- package/dist/invocation/maintenance.d.ts +14 -0
- package/dist/invocation/maintenance.js +18 -0
- 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 +3 -1
- package/dist/invocation/request.js +9 -3
- package/dist/invocation/response.d.ts +6 -2
- package/dist/invocation/response.js +26 -16
- 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 +9 -0
- package/dist/schema/installation/codec.js +82 -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 +319 -194
- 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 +84 -26
- package/dist/schema/installation/introspection/result.js +0 -1
- package/dist/schema/installation/result.d.ts +15 -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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Request } from '../request.js';
|
|
2
|
+
export declare const REQUEST_ENVELOPE_FIELD: 'x-astrale-request';
|
|
3
|
+
export declare const BINARY_LENGTH_FIELD: 'x-astrale-binary-length';
|
|
4
|
+
export declare const BINARY_REQUEST_CONTENT_TYPE: 'application/octet-stream';
|
|
5
|
+
export declare const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8192;
|
|
6
|
+
/** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
|
|
7
|
+
export declare function decodeBinaryLength(input: string): number | undefined;
|
|
8
|
+
/** Encode one canonical V2 Request into the binary-request HTTP field. */
|
|
9
|
+
export declare function encodeBinaryRequestEnvelope(input: Request): string;
|
|
10
|
+
/** Decode one bounded base64url JSON V2 Request from the binary-request HTTP field. */
|
|
11
|
+
export declare function decodeBinaryRequestEnvelope(input: string | null): Request;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { json } from '../../codecs/index.js';
|
|
2
|
+
import { CODES, ProtocolError } from '../../errors/index.js';
|
|
3
|
+
import { decodeRequest } from '../request.js';
|
|
4
|
+
export const REQUEST_ENVELOPE_FIELD = 'x-astrale-request';
|
|
5
|
+
export const BINARY_LENGTH_FIELD = 'x-astrale-binary-length';
|
|
6
|
+
export const BINARY_REQUEST_CONTENT_TYPE = 'application/octet-stream';
|
|
7
|
+
export const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8_192;
|
|
8
|
+
const BASE64URL = /^[A-Za-z0-9_-]+$/u;
|
|
9
|
+
const MAXIMUM_ENCODED_BYTES = Math.ceil(MAXIMUM_REQUEST_ENVELOPE_BYTES / 3) * 4;
|
|
10
|
+
const DECIMAL = /^(?:0|[1-9][0-9]*)$/u;
|
|
11
|
+
/** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
|
|
12
|
+
export function decodeBinaryLength(input) {
|
|
13
|
+
if (!DECIMAL.test(input))
|
|
14
|
+
return undefined;
|
|
15
|
+
const length = Number(input);
|
|
16
|
+
return Number.isSafeInteger(length) ? length : undefined;
|
|
17
|
+
}
|
|
18
|
+
/** Encode one canonical V2 Request into the binary-request HTTP field. */
|
|
19
|
+
export function encodeBinaryRequestEnvelope(input) {
|
|
20
|
+
const request = decodeRequest(input);
|
|
21
|
+
const encoded = json.encode(request);
|
|
22
|
+
if (typeof encoded !== 'string')
|
|
23
|
+
throw new TypeError('JSON Request codec returned non-text output.');
|
|
24
|
+
const bytes = new TextEncoder().encode(encoded);
|
|
25
|
+
if (bytes.byteLength > MAXIMUM_REQUEST_ENVELOPE_BYTES)
|
|
26
|
+
return invalid();
|
|
27
|
+
return btoa(String.fromCharCode(...bytes))
|
|
28
|
+
.replaceAll('+', '-')
|
|
29
|
+
.replaceAll('/', '_')
|
|
30
|
+
.replace(/=+$/u, '');
|
|
31
|
+
}
|
|
32
|
+
/** Decode one bounded base64url JSON V2 Request from the binary-request HTTP field. */
|
|
33
|
+
export function decodeBinaryRequestEnvelope(input) {
|
|
34
|
+
if (input === null ||
|
|
35
|
+
input.length === 0 ||
|
|
36
|
+
input.length > MAXIMUM_ENCODED_BYTES ||
|
|
37
|
+
!BASE64URL.test(input)) {
|
|
38
|
+
return invalid();
|
|
39
|
+
}
|
|
40
|
+
let bytes;
|
|
41
|
+
try {
|
|
42
|
+
const binary = atob(input.replaceAll('-', '+').replaceAll('_', '/') + '='.repeat((4 - (input.length % 4)) % 4));
|
|
43
|
+
bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return invalid();
|
|
47
|
+
}
|
|
48
|
+
if (bytes.byteLength > MAXIMUM_REQUEST_ENVELOPE_BYTES)
|
|
49
|
+
return invalid();
|
|
50
|
+
try {
|
|
51
|
+
// Require canonical base64url so alternate encodings cannot name the same envelope.
|
|
52
|
+
const canonical = btoa(String.fromCharCode(...bytes))
|
|
53
|
+
.replaceAll('+', '-')
|
|
54
|
+
.replaceAll('/', '_')
|
|
55
|
+
.replace(/=+$/u, '');
|
|
56
|
+
if (canonical !== input)
|
|
57
|
+
return invalid();
|
|
58
|
+
return decodeRequest(json.decode(bytes));
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return invalid();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function invalid() {
|
|
65
|
+
throw new ProtocolError({
|
|
66
|
+
code: CODES.INVALID_REQUEST,
|
|
67
|
+
message: 'HTTP binary Request envelope is invalid.',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -3,4 +3,3 @@ import type { StreamFrame } from '../stream.js';
|
|
|
3
3
|
export declare const STREAM_FRAMING_FIELD: 'x-astrale-stream-framing';
|
|
4
4
|
export declare const LENGTH_PREFIX_V1: 'length-prefix-v1';
|
|
5
5
|
export declare function encodeStreamFrame(codec: Codec, frame: StreamFrame): Uint8Array;
|
|
6
|
-
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare const TRACESTATE_FIELD = "tracestate";
|
|
|
4
4
|
export declare const BAGGAGE_FIELD = "baggage";
|
|
5
5
|
export declare function decodeTraceHeaders(traceparent: string | null, tracestate: string | null): Trace | undefined;
|
|
6
6
|
export declare function encodeTraceHeaders(carrier: Trace | undefined): Readonly<Record<string, string>>;
|
|
7
|
-
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -8,4 +8,3 @@ export declare const MAXIMUM_IDEMPOTENCY_KEY_LENGTH = 128;
|
|
|
8
8
|
/** Admit an opaque URL-safe ASCII key without assigning it semantic structure. */
|
|
9
9
|
export declare function acceptIdempotencyKey(input: unknown, label?: string): IdempotencyKey;
|
|
10
10
|
export {};
|
|
11
|
-
//# sourceMappingURL=idempotency.d.ts.map
|
|
@@ -14,4 +14,3 @@ export declare class InvocationError extends TypeError {
|
|
|
14
14
|
export declare function acceptInvocationId(input: unknown): InvocationId;
|
|
15
15
|
/** Compare both canonical coordinate fields exactly. */
|
|
16
16
|
export declare function sameInvocationId(left: InvocationId, right: InvocationId): boolean;
|
|
17
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -5,17 +5,17 @@ export { acceptIdempotencyKey, HTTP_IDEMPOTENCY_KEY, MAXIMUM_IDEMPOTENCY_KEY_LEN
|
|
|
5
5
|
export { acceptInvocationId, InvocationError, MAXIMUM_INVOCATION_ID_LENGTH, sameInvocationId, type InvocationId, } from './identity.js';
|
|
6
6
|
export * as http from './http/index.js';
|
|
7
7
|
export { acceptDelegate, type Delegate } from './delegate.js';
|
|
8
|
+
export { acceptMaintenance, MAXIMUM_MAINTENANCE_SESSION_LENGTH, type Maintenance, type MaintenanceSession, } from './maintenance.js';
|
|
8
9
|
export { decodeMiss, miss, type Miss } from './miss.js';
|
|
9
10
|
export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, type RemoteBindingInput, type Redirection, type RedirectResponse, type Route, } from './redirect.js';
|
|
10
11
|
export { decodeRequest, type Request } from './request.js';
|
|
11
12
|
export { admitTrace, MAXIMUM_TRACEPARENT_BYTES, MAXIMUM_TRACESTATE_BYTES, MAXIMUM_TRACESTATE_MEMBERS, type Trace, } from './trace.js';
|
|
12
|
-
export { acceptRouting, type Refresh, type Routing, type Via } from './routing.js';
|
|
13
|
+
export { acceptRouting, routedDigest, routedRevision, type Refresh, type Routing, type Via, } from './routing.js';
|
|
13
14
|
export { acceptSchemaTarget, type SchemaTarget } from './schema.js';
|
|
14
|
-
export { decodeResponse, type ErrorResponse, type Response, type ResponseContext, type SuccessResponse, } from './response.js';
|
|
15
|
-
export {
|
|
15
|
+
export { decodeResponse, type ErrorResponse, type ExecutionResponse, type Response, type ResponseContext, type SuccessResponse, } from './response.js';
|
|
16
|
+
export { CALLABLE_FINGERPRINT_MISMATCH, DEPLOYMENT_RETIRED, SERVICE_CANDIDATE_INVALID, SERVICE_TRUST_REQUIRED, SERVICE_UNAVAILABLE, serviceErrorOf, type CallableFingerprintMismatchDetails, type CallableFingerprintMismatchReason, type DeploymentRetiredDetails, type DeploymentRetiredReason, type ServiceCandidateInvalidDetails, type ServiceCandidateInvalidReason, type ServiceErrorPayload, type ServiceReason, type ServiceTrustRequiredDetails, type ServiceTrustRequiredReason, type ServiceUnavailableDetails, type ServiceUnavailableReason, } from './service-reason.js';
|
|
16
17
|
export { decodeStale, stale, type Stale } from './stale-route.js';
|
|
17
18
|
export { decodeStreamFrame, type StreamEndFrame, type StreamErrorFrame, type StreamFrame, type StreamItemFrame, type StreamStartFrame, } from './stream.js';
|
|
18
|
-
export { acceptCall, type Call } from './target.js';
|
|
19
|
+
export { Target, targetPath, acceptCall, type Call } from './target.js';
|
|
19
20
|
export { VERSION, type Version } from './version.js';
|
|
20
21
|
export * as websocket from './websocket/index.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/invocation/index.js
CHANGED
|
@@ -5,17 +5,17 @@ export { acceptIdempotencyKey, HTTP_IDEMPOTENCY_KEY, MAXIMUM_IDEMPOTENCY_KEY_LEN
|
|
|
5
5
|
export { acceptInvocationId, InvocationError, MAXIMUM_INVOCATION_ID_LENGTH, sameInvocationId, } from './identity.js';
|
|
6
6
|
export * as http from './http/index.js';
|
|
7
7
|
export { acceptDelegate } from './delegate.js';
|
|
8
|
+
export { acceptMaintenance, MAXIMUM_MAINTENANCE_SESSION_LENGTH, } from './maintenance.js';
|
|
8
9
|
export { decodeMiss, miss } from './miss.js';
|
|
9
10
|
export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, } from './redirect.js';
|
|
10
11
|
export { decodeRequest } from './request.js';
|
|
11
12
|
export { admitTrace, MAXIMUM_TRACEPARENT_BYTES, MAXIMUM_TRACESTATE_BYTES, MAXIMUM_TRACESTATE_MEMBERS, } from './trace.js';
|
|
12
|
-
export { acceptRouting } from './routing.js';
|
|
13
|
+
export { acceptRouting, routedDigest, routedRevision, } from './routing.js';
|
|
13
14
|
export { acceptSchemaTarget } from './schema.js';
|
|
14
15
|
export { decodeResponse, } from './response.js';
|
|
15
|
-
export {
|
|
16
|
+
export { CALLABLE_FINGERPRINT_MISMATCH, DEPLOYMENT_RETIRED, SERVICE_CANDIDATE_INVALID, SERVICE_TRUST_REQUIRED, SERVICE_UNAVAILABLE, serviceErrorOf, } from './service-reason.js';
|
|
16
17
|
export { decodeStale, stale } from './stale-route.js';
|
|
17
18
|
export { decodeStreamFrame, } from './stream.js';
|
|
18
|
-
export { acceptCall } from './target.js';
|
|
19
|
+
export { Target, targetPath, acceptCall } from './target.js';
|
|
19
20
|
export { VERSION } from './version.js';
|
|
20
21
|
export * as websocket from './websocket/index.js';
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const MAINTENANCE_SESSION: unique symbol;
|
|
2
|
+
/** Identity of the install Execution that owns one maintenance session; it grants no authority. */
|
|
3
|
+
export type MaintenanceSession = string & {
|
|
4
|
+
readonly [MAINTENANCE_SESSION]: true;
|
|
5
|
+
};
|
|
6
|
+
/** Source-Kernel guard naming the maintenance session a root request expects to act within. */
|
|
7
|
+
export interface Maintenance {
|
|
8
|
+
readonly session: MaintenanceSession;
|
|
9
|
+
}
|
|
10
|
+
/** An Execution identifier: 1-255 ASCII characters drawn from `[A-Za-z0-9._-]`. */
|
|
11
|
+
export declare const MAXIMUM_MAINTENANCE_SESSION_LENGTH = 255;
|
|
12
|
+
/** Admit one exact maintenance guard without deciding whether its session is active. */
|
|
13
|
+
export declare function acceptMaintenance(input: unknown): Maintenance;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isNodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
|
+
import { exactFields, invalid, portableObject, required } from './admission.js';
|
|
3
|
+
/** An Execution identifier: 1-255 ASCII characters drawn from `[A-Za-z0-9._-]`. */
|
|
4
|
+
export const MAXIMUM_MAINTENANCE_SESSION_LENGTH = 255;
|
|
5
|
+
const FIELDS = new Set(['session']);
|
|
6
|
+
/** Admit one exact maintenance guard without deciding whether its session is active. */
|
|
7
|
+
export function acceptMaintenance(input) {
|
|
8
|
+
const object = portableObject(input, 'maintenance');
|
|
9
|
+
exactFields(object, FIELDS, 'maintenance');
|
|
10
|
+
required(object, ['session'], 'maintenance');
|
|
11
|
+
// An Execution identifier shares the Core NodeId grammar; it names no graph Node.
|
|
12
|
+
const session = object.session;
|
|
13
|
+
if (!isNodeId(session)) {
|
|
14
|
+
invalid('maintenance.session must contain 1-255 ASCII characters drawn from [A-Za-z0-9._-]');
|
|
15
|
+
}
|
|
16
|
+
const admitted = session;
|
|
17
|
+
return Object.freeze({ session: admitted });
|
|
18
|
+
}
|
package/dist/invocation/miss.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type { Key } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
-
import type { InvocationEndpoints } from '../
|
|
4
|
-
import type {
|
|
5
|
-
import type { PublicationRef } from '../publication/reference.js';
|
|
2
|
+
import type { Key, Revision } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
+
import type { InvocationEndpoints } from '../release/bindings/invocation.js';
|
|
4
|
+
import type { ReleaseDigest } from '../release/digest.js';
|
|
6
5
|
import type { RequestId } from './correlation.js';
|
|
7
6
|
import type { InvocationId } from './identity.js';
|
|
7
|
+
import type { Via } from './routing.js';
|
|
8
8
|
import type { Trace } from './trace.js';
|
|
9
9
|
export interface Route {
|
|
10
10
|
readonly endpoint: InvocationEndpoints;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly publication: PublicationRef;
|
|
14
|
-
readonly issuer: IssuerId;
|
|
15
|
-
};
|
|
11
|
+
/** Routed witness of the exact installed release. */
|
|
12
|
+
readonly via: Via;
|
|
16
13
|
}
|
|
17
14
|
export interface Redirection {
|
|
18
15
|
readonly route: Route;
|
|
@@ -26,16 +23,16 @@ export interface RedirectResponse {
|
|
|
26
23
|
readonly invocation: InvocationId;
|
|
27
24
|
readonly redirect: Redirection;
|
|
28
25
|
}
|
|
26
|
+
/** Remote binding of one installed release: the endpoint and the release it routes to. */
|
|
29
27
|
export interface RemoteBindingInput {
|
|
30
28
|
readonly endpoint: InvocationEndpoints;
|
|
31
29
|
readonly issuer: IssuerId;
|
|
32
30
|
readonly subject: string;
|
|
33
|
-
readonly revision:
|
|
34
|
-
readonly
|
|
31
|
+
readonly revision: Revision;
|
|
32
|
+
readonly release: ReleaseDigest;
|
|
35
33
|
}
|
|
36
34
|
export declare function acceptRoute(input: unknown): Route;
|
|
37
|
-
/** Project one
|
|
35
|
+
/** Project one installed release binding into its routed witness. */
|
|
38
36
|
export declare function remoteRoute(origin: Key.Origin, binding: RemoteBindingInput, issuer: IssuerId): Route;
|
|
39
37
|
export declare function acceptRedirection(input: unknown): Redirection;
|
|
40
38
|
export declare function decodeRedirectResponse(input: unknown): RedirectResponse;
|
|
41
|
-
//# sourceMappingURL=redirect.d.ts.map
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
import { acceptInvocationEndpoints } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { acceptInvocationEndpoints } from '../release/bindings/index.js';
|
|
2
|
+
import { ReleaseError } from '../release/error.js';
|
|
3
|
+
import { exactFields, invalid, invocation, portableObject, requestId, required, string, } from './admission.js';
|
|
4
|
+
import { acceptVia } from './routing.js';
|
|
5
5
|
import { admitTrace } from './trace.js';
|
|
6
6
|
const ROUTE_FIELDS = new Set(['endpoint', 'via']);
|
|
7
|
-
const VIA_FIELDS = new Set(['kind', 'publication', 'issuer']);
|
|
8
7
|
const REDIRECTION_FIELDS = new Set(['route', 'credential', 'trace']);
|
|
9
8
|
const REDIRECT_RESPONSE_FIELDS = new Set(['kind', 'requestId', 'invocation', 'redirect']);
|
|
10
9
|
export function acceptRoute(input) {
|
|
11
10
|
const object = portableObject(input, 'route');
|
|
12
11
|
exactFields(object, ROUTE_FIELDS, 'route');
|
|
13
12
|
required(object, ['endpoint', 'via'], 'route');
|
|
13
|
+
const via = acceptVia(portableObject(object.via, 'route.via'), 'route.via');
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
exactFields(via, VIA_FIELDS, 'route.via');
|
|
17
|
-
required(via, ['kind', 'publication', 'issuer'], 'route.via');
|
|
18
|
-
if (via.kind !== 'via')
|
|
19
|
-
invalid('route.via.kind must be "via"');
|
|
20
|
-
return Object.freeze({
|
|
21
|
-
endpoint: acceptInvocationEndpoints(object.endpoint),
|
|
22
|
-
via: Object.freeze({
|
|
23
|
-
kind: 'via',
|
|
24
|
-
publication: acceptReference(via.publication),
|
|
25
|
-
issuer: issuerId(via.issuer, 'route.via.issuer'),
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
15
|
+
return Object.freeze({ endpoint: acceptInvocationEndpoints(object.endpoint), via });
|
|
28
16
|
}
|
|
29
17
|
catch (cause) {
|
|
30
|
-
if (cause instanceof
|
|
18
|
+
if (cause instanceof ReleaseError) {
|
|
31
19
|
return invalid(`route is invalid: ${cause.message}`);
|
|
32
20
|
}
|
|
33
21
|
throw cause;
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
|
-
/** Project one
|
|
24
|
+
/** Project one installed release binding into its routed witness. */
|
|
37
25
|
export function remoteRoute(origin, binding, issuer) {
|
|
38
26
|
return acceptRoute({
|
|
39
27
|
endpoint: binding.endpoint,
|
|
40
28
|
via: {
|
|
41
29
|
kind: 'via',
|
|
42
|
-
|
|
30
|
+
release: {
|
|
43
31
|
origin,
|
|
44
32
|
identity: { issuer: binding.issuer, subject: binding.subject },
|
|
45
33
|
revision: binding.revision,
|
|
46
|
-
|
|
34
|
+
digest: binding.release,
|
|
47
35
|
},
|
|
48
36
|
issuer,
|
|
49
37
|
},
|
|
@@ -79,4 +67,3 @@ export function decodeRedirectResponse(input) {
|
|
|
79
67
|
redirect: acceptRedirection(object.redirect),
|
|
80
68
|
});
|
|
81
69
|
}
|
|
82
|
-
//# sourceMappingURL=redirect.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RequestId } from './correlation.js';
|
|
2
2
|
import type { Delegate } from './delegate.js';
|
|
3
3
|
import type { IdempotencyKey } from './idempotency.js';
|
|
4
|
+
import type { Maintenance } from './maintenance.js';
|
|
4
5
|
import type { Routing } from './routing.js';
|
|
5
6
|
import type { SchemaTarget } from './schema.js';
|
|
6
7
|
import type { Call } from './target.js';
|
|
@@ -15,8 +16,9 @@ export interface Request {
|
|
|
15
16
|
readonly routing?: Routing;
|
|
16
17
|
/** Source-Kernel precondition; forbidden on an already-routed destination request. */
|
|
17
18
|
readonly schema?: SchemaTarget;
|
|
19
|
+
/** Source-Kernel maintenance session guard; forbidden on an already-routed destination request. */
|
|
20
|
+
readonly maintenance?: Maintenance;
|
|
18
21
|
readonly idempotencyKey?: IdempotencyKey;
|
|
19
22
|
readonly trace?: Trace;
|
|
20
23
|
}
|
|
21
24
|
export declare function decodeRequest(input: unknown): Request;
|
|
22
|
-
//# sourceMappingURL=request.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { exactFields, invalid, portableObject, requestId, required, string } from './admission.js';
|
|
2
2
|
import { acceptDelegate } from './delegate.js';
|
|
3
3
|
import { acceptIdempotencyKey } from './idempotency.js';
|
|
4
|
+
import { acceptMaintenance } from './maintenance.js';
|
|
4
5
|
import { acceptRouting } from './routing.js';
|
|
5
6
|
import { acceptSchemaTarget } from './schema.js';
|
|
6
|
-
import {
|
|
7
|
+
import { callFromSnapshot } from './target.js';
|
|
7
8
|
import { admitTrace } from './trace.js';
|
|
8
9
|
const REQUEST_FIELDS = new Set([
|
|
9
10
|
'version',
|
|
@@ -13,6 +14,7 @@ const REQUEST_FIELDS = new Set([
|
|
|
13
14
|
'delegate',
|
|
14
15
|
'routing',
|
|
15
16
|
'schema',
|
|
17
|
+
'maintenance',
|
|
16
18
|
'idempotencyKey',
|
|
17
19
|
'trace',
|
|
18
20
|
]);
|
|
@@ -26,12 +28,16 @@ export function decodeRequest(input) {
|
|
|
26
28
|
const delegate = object.delegate === undefined ? undefined : acceptDelegate(object.delegate);
|
|
27
29
|
const routing = object.routing === undefined ? undefined : acceptRouting(object.routing);
|
|
28
30
|
const schema = object.schema === undefined ? undefined : acceptSchemaTarget(object.schema);
|
|
31
|
+
const maintenance = object.maintenance === undefined ? undefined : acceptMaintenance(object.maintenance);
|
|
29
32
|
const trace = object.trace === undefined ? undefined : admitTrace(object.trace);
|
|
30
33
|
if (routing?.kind === 'via') {
|
|
31
34
|
if (delegate !== undefined)
|
|
32
35
|
invalid('destination requests with via routing forbid delegate');
|
|
33
36
|
if (schema !== undefined)
|
|
34
37
|
invalid('destination requests with via routing forbid schema target');
|
|
38
|
+
if (maintenance !== undefined) {
|
|
39
|
+
invalid('destination requests with via routing forbid maintenance');
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
else if ((credential === undefined) !== (delegate === undefined)) {
|
|
37
43
|
invalid('source requests require credential and delegate together');
|
|
@@ -39,11 +45,12 @@ export function decodeRequest(input) {
|
|
|
39
45
|
return Object.freeze({
|
|
40
46
|
version: 2,
|
|
41
47
|
requestId: requestId(object.requestId, 'request.requestId'),
|
|
42
|
-
call:
|
|
48
|
+
call: callFromSnapshot(object.call),
|
|
43
49
|
...(credential === undefined ? {} : { credential }),
|
|
44
50
|
...(delegate === undefined ? {} : { delegate }),
|
|
45
51
|
...(routing === undefined ? {} : { routing }),
|
|
46
52
|
...(schema === undefined ? {} : { schema }),
|
|
53
|
+
...(maintenance === undefined ? {} : { maintenance }),
|
|
47
54
|
...(object.idempotencyKey === undefined
|
|
48
55
|
? {}
|
|
49
56
|
: {
|
|
@@ -52,4 +59,3 @@ export function decodeRequest(input) {
|
|
|
52
59
|
...(trace === undefined ? {} : { trace }),
|
|
53
60
|
});
|
|
54
61
|
}
|
|
55
|
-
//# sourceMappingURL=request.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Value } from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { type NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
3
|
import type { ErrorPayload } from '../errors/index.js';
|
|
3
4
|
import type { RequestId } from './correlation.js';
|
|
4
5
|
import type { InvocationId } from './identity.js';
|
|
@@ -15,6 +16,9 @@ export interface SuccessResponse<Result extends Value = Value> extends ResponseC
|
|
|
15
16
|
export interface ErrorResponse extends ResponseContext {
|
|
16
17
|
readonly error: ErrorPayload;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/** A durable call's answer: the Execution it started or recovered, never a handler result. */
|
|
20
|
+
export interface ExecutionResponse extends ResponseContext {
|
|
21
|
+
readonly execution: NodeId;
|
|
22
|
+
}
|
|
23
|
+
export type Response<Result extends Value = Value> = SuccessResponse<Result> | ErrorResponse | ExecutionResponse | RedirectResponse | Stale | Miss;
|
|
19
24
|
export declare function decodeResponse(input: unknown): Response;
|
|
20
|
-
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { isNodeId } from '@astrale-os/kernel-core/graph/node';
|
|
1
2
|
import { errorPayload, exactFields, invalid, invocation, portableObject, requestId, required, } from './admission.js';
|
|
2
3
|
import { decodeMiss } from './miss.js';
|
|
3
4
|
import { decodeRedirectResponse } from './redirect.js';
|
|
4
5
|
import { decodeStale } from './stale-route.js';
|
|
5
6
|
const SUCCESS_FIELDS = new Set(['result', 'requestId', 'invocation']);
|
|
6
7
|
const ERROR_FIELDS = new Set(['error', 'requestId', 'invocation']);
|
|
8
|
+
const EXECUTION_FIELDS = new Set(['execution', 'requestId', 'invocation']);
|
|
7
9
|
export function decodeResponse(input) {
|
|
8
10
|
const object = portableObject(input, 'response');
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (hasResult) {
|
|
11
|
+
const outcomes = ['result', 'error', 'execution'].filter((field) => Object.hasOwn(object, field));
|
|
12
|
+
if (outcomes.length > 1)
|
|
13
|
+
invalid('response must contain exactly one of result, error or execution');
|
|
14
|
+
switch (outcomes[0]) {
|
|
15
|
+
case 'result':
|
|
15
16
|
exactFields(object, SUCCESS_FIELDS, 'response');
|
|
16
17
|
required(object, ['requestId', 'invocation'], 'response');
|
|
17
18
|
return Object.freeze({
|
|
@@ -19,14 +20,24 @@ export function decodeResponse(input) {
|
|
|
19
20
|
requestId: requestId(object.requestId, 'response.requestId'),
|
|
20
21
|
invocation: invocation(object.invocation, 'response.invocation'),
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
case 'error':
|
|
24
|
+
exactFields(object, ERROR_FIELDS, 'response');
|
|
25
|
+
required(object, ['requestId', 'error', 'invocation'], 'response');
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
error: errorPayload(object.error, 'response.error'),
|
|
28
|
+
requestId: requestId(object.requestId, 'response.requestId'),
|
|
29
|
+
invocation: invocation(object.invocation, 'response.invocation'),
|
|
30
|
+
});
|
|
31
|
+
case 'execution':
|
|
32
|
+
exactFields(object, EXECUTION_FIELDS, 'response');
|
|
33
|
+
required(object, ['requestId', 'execution', 'invocation'], 'response');
|
|
34
|
+
if (!isNodeId(object.execution))
|
|
35
|
+
invalid('response.execution must be a NodeId');
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
execution: object.execution,
|
|
38
|
+
requestId: requestId(object.requestId, 'response.requestId'),
|
|
39
|
+
invocation: invocation(object.invocation, 'response.invocation'),
|
|
40
|
+
});
|
|
30
41
|
}
|
|
31
42
|
if (object.kind === 'redirect')
|
|
32
43
|
return decodeRedirectResponse(object);
|
|
@@ -34,6 +45,5 @@ export function decodeResponse(input) {
|
|
|
34
45
|
return decodeStale(object);
|
|
35
46
|
if (object.kind === 'miss')
|
|
36
47
|
return decodeMiss(object);
|
|
37
|
-
return invalid('response must contain a result, error, redirect, stale, or miss control');
|
|
48
|
+
return invalid('response must contain a result, error, execution, redirect, stale, or miss control');
|
|
38
49
|
}
|
|
39
|
-
//# sourceMappingURL=response.js.map
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
import type { Object as ValueObject } from '@astrale-os/kernel-dsl/value';
|
|
4
|
+
import type { Sha256Digest } from '../release/digest.js';
|
|
5
|
+
import type { ReleaseRef } from '../release/reference.js';
|
|
6
|
+
/** Routed witness of one installed release: the Kernel routed this call to that exact release. */
|
|
4
7
|
export interface Via {
|
|
5
8
|
readonly kind: 'via';
|
|
6
|
-
readonly
|
|
9
|
+
readonly release: ReleaseRef;
|
|
7
10
|
readonly issuer: IssuerId;
|
|
8
11
|
}
|
|
9
12
|
export interface Refresh {
|
|
10
13
|
readonly kind: 'refresh';
|
|
11
|
-
readonly stale:
|
|
14
|
+
readonly stale: Sha256Digest;
|
|
12
15
|
}
|
|
16
|
+
/** A received `Via` names one exact `ReleaseRef`. */
|
|
13
17
|
export type Routing = Via | Refresh;
|
|
14
18
|
export declare function acceptRouting(input: unknown): Routing;
|
|
15
|
-
|
|
19
|
+
/** Admit one routed witness carrying one exact `release`. */
|
|
20
|
+
export declare function acceptVia(object: ValueObject, label: string): Via;
|
|
21
|
+
/** Schema revision of the release the witness routed the call to. */
|
|
22
|
+
export declare function routedRevision(via: Via): Revision;
|
|
23
|
+
/** Digest of the release the witness routed this call to. */
|
|
24
|
+
export declare function routedDigest(via: Via): Sha256Digest;
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { acceptReference } from '../
|
|
1
|
+
import { ReleaseError } from '../release/error.js';
|
|
2
|
+
import { acceptReference } from '../release/reference.js';
|
|
3
3
|
import { digest, exactFields, invalid, issuerId, portableObject, required } from './admission.js';
|
|
4
|
-
const VIA_FIELDS = new Set(['kind', '
|
|
4
|
+
const VIA_FIELDS = new Set(['kind', 'release', 'issuer']);
|
|
5
5
|
const REFRESH_FIELDS = new Set(['kind', 'stale']);
|
|
6
6
|
export function acceptRouting(input) {
|
|
7
7
|
const object = portableObject(input, 'routing');
|
|
8
|
-
if (object.kind === 'via')
|
|
9
|
-
|
|
10
|
-
required(object, ['kind', 'publication', 'issuer'], 'via routing');
|
|
11
|
-
try {
|
|
12
|
-
return Object.freeze({
|
|
13
|
-
kind: 'via',
|
|
14
|
-
publication: acceptReference(object.publication),
|
|
15
|
-
issuer: issuerId(object.issuer, 'via routing.issuer'),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
catch (cause) {
|
|
19
|
-
if (cause instanceof PublicationError) {
|
|
20
|
-
return invalid(`via routing.publication is invalid: ${cause.message}`);
|
|
21
|
-
}
|
|
22
|
-
throw cause;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
8
|
+
if (object.kind === 'via')
|
|
9
|
+
return acceptVia(object, 'via routing');
|
|
25
10
|
if (object.kind === 'refresh') {
|
|
26
11
|
exactFields(object, REFRESH_FIELDS, 'refresh routing');
|
|
27
12
|
required(object, ['kind', 'stale'], 'refresh routing');
|
|
@@ -32,4 +17,33 @@ export function acceptRouting(input) {
|
|
|
32
17
|
}
|
|
33
18
|
return invalid('routing.kind must be "via" or "refresh"');
|
|
34
19
|
}
|
|
35
|
-
|
|
20
|
+
/** Admit one routed witness carrying one exact `release`. */
|
|
21
|
+
export function acceptVia(object, label) {
|
|
22
|
+
exactFields(object, VIA_FIELDS, label);
|
|
23
|
+
if (object.kind !== 'via')
|
|
24
|
+
invalid(`${label}.kind must be "via"`);
|
|
25
|
+
required(object, ['release', 'issuer'], label);
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
kind: 'via',
|
|
28
|
+
release: acceptReleaseReference(object.release, `${label}.release`),
|
|
29
|
+
issuer: issuerId(object.issuer, `${label}.issuer`),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Schema revision of the release the witness routed the call to. */
|
|
33
|
+
export function routedRevision(via) {
|
|
34
|
+
return via.release.revision;
|
|
35
|
+
}
|
|
36
|
+
/** Digest of the release the witness routed this call to. */
|
|
37
|
+
export function routedDigest(via) {
|
|
38
|
+
return via.release.digest;
|
|
39
|
+
}
|
|
40
|
+
function acceptReleaseReference(input, label) {
|
|
41
|
+
try {
|
|
42
|
+
return acceptReference(input);
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
if (cause instanceof ReleaseError)
|
|
46
|
+
return invalid(`${label} is invalid: ${cause.message}`);
|
|
47
|
+
throw cause;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Sha256Digest } from '../release/digest.js';
|
|
2
|
+
/**
|
|
3
|
+
* Source-Kernel precondition for one invocation: the exact installed artifact target, or the
|
|
4
|
+
* fingerprint of the callable meaning the static consumer compiled against.
|
|
5
|
+
*/
|
|
4
6
|
export type SchemaTarget = {
|
|
5
7
|
readonly target: Sha256Digest;
|
|
6
8
|
} | {
|
|
7
|
-
readonly
|
|
9
|
+
readonly fingerprint: Sha256Digest;
|
|
8
10
|
};
|
|
9
11
|
export declare function acceptSchemaTarget(input: unknown): SchemaTarget;
|
|
10
|
-
//# sourceMappingURL=schema.d.ts.map
|