@astrale-os/kernel-protocol 0.5.0-beta.5 → 0.5.0-beta.51
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 +0 -1
- package/dist/artifact/index.js +0 -1
- package/dist/artifact/ref.d.ts +0 -1
- package/dist/artifact/ref.js +0 -1
- package/dist/codecs/codec.d.ts +0 -1
- package/dist/codecs/codec.js +0 -1
- package/dist/codecs/index.d.ts +0 -1
- package/dist/codecs/index.js +0 -1
- package/dist/codecs/json.d.ts +0 -1
- package/dist/codecs/json.js +0 -1
- package/dist/codecs/media-types.d.ts +0 -1
- package/dist/codecs/media-types.js +0 -1
- package/dist/codecs/msgpack.d.ts +0 -1
- package/dist/codecs/msgpack.js +1 -5
- 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 +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/errors/payload.d.ts +0 -1
- package/dist/errors/payload.js +3 -3
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +4 -3
- package/dist/errors/reason.d.ts +0 -1
- package/dist/errors/reason.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/invocation/admission.d.ts +0 -1
- package/dist/invocation/admission.js +2 -6
- package/dist/invocation/binary.d.ts +1 -1
- package/dist/invocation/binary.js +14 -2
- package/dist/invocation/binding-codecs.d.ts +0 -1
- package/dist/invocation/binding-codecs.js +0 -1
- 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 -1
- package/dist/invocation/delegate.js +0 -1
- package/dist/invocation/http/binary.d.ts +3 -2
- package/dist/invocation/http/binary.js +4 -2
- package/dist/invocation/http/index.d.ts +1 -2
- package/dist/invocation/http/index.js +1 -2
- package/dist/invocation/http/negotiation.d.ts +0 -1
- package/dist/invocation/http/negotiation.js +0 -1
- 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 +2 -3
- package/dist/invocation/index.js +2 -3
- package/dist/invocation/miss.d.ts +0 -1
- package/dist/invocation/miss.js +0 -1
- package/dist/invocation/redirect.d.ts +0 -1
- package/dist/invocation/redirect.js +0 -1
- package/dist/invocation/request.d.ts +0 -1
- package/dist/invocation/request.js +0 -1
- package/dist/invocation/response.d.ts +0 -1
- package/dist/invocation/response.js +0 -1
- package/dist/invocation/routing.d.ts +0 -1
- package/dist/invocation/routing.js +0 -1
- package/dist/invocation/schema.d.ts +1 -2
- package/dist/invocation/schema.js +0 -1
- package/dist/invocation/service-reason.d.ts +3 -11
- package/dist/invocation/service-reason.js +0 -12
- package/dist/invocation/stale-route.d.ts +0 -1
- 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 +2 -3
- package/dist/invocation/target.js +17 -3
- 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 +2 -2
- package/dist/invocation/websocket/index.d.ts +0 -1
- package/dist/invocation/websocket/index.js +0 -1
- package/dist/invocation/websocket/subprotocol.d.ts +0 -1
- package/dist/invocation/websocket/subprotocol.js +0 -1
- 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 +0 -1
- package/dist/issuer/index.js +0 -1
- package/dist/issuer/key-set.d.ts +0 -1
- package/dist/issuer/key-set.js +0 -1
- package/dist/issuer/paths.d.ts +0 -1
- package/dist/issuer/paths.js +0 -1
- package/dist/issuer/url.d.ts +0 -1
- package/dist/issuer/url.js +0 -1
- package/dist/publication/bindings/callable.d.ts +0 -1
- package/dist/publication/bindings/callable.js +8 -6
- package/dist/publication/bindings/index.d.ts +1 -2
- package/dist/publication/bindings/index.js +0 -1
- package/dist/publication/bindings/invocation.d.ts +0 -1
- package/dist/publication/bindings/invocation.js +0 -1
- package/dist/publication/bindings/view.d.ts +7 -1
- package/dist/publication/bindings/view.js +111 -3
- package/dist/publication/bundle-admission.d.ts +0 -1
- package/dist/publication/bundle-admission.js +14 -14
- package/dist/publication/bundle-descriptor.d.ts +0 -1
- package/dist/publication/bundle-descriptor.js +0 -1
- package/dist/publication/bundle-evidence.d.ts +0 -1
- package/dist/publication/bundle-evidence.js +0 -1
- package/dist/publication/bundle.d.ts +4 -2
- package/dist/publication/bundle.js +9 -4
- package/dist/publication/content.d.ts +0 -1
- package/dist/publication/content.js +0 -1
- package/dist/publication/declaration.d.ts +0 -1
- package/dist/publication/declaration.js +0 -1
- package/dist/publication/delivery/attestation.d.ts +0 -1
- package/dist/publication/delivery/attestation.js +0 -1
- package/dist/publication/delivery/claims.d.ts +1 -2
- package/dist/publication/delivery/claims.js +0 -1
- package/dist/publication/delivery/delivery.d.ts +0 -1
- package/dist/publication/delivery/delivery.js +0 -1
- package/dist/publication/delivery/error.d.ts +0 -1
- package/dist/publication/delivery/error.js +0 -1
- package/dist/publication/delivery/index.d.ts +0 -1
- package/dist/publication/delivery/index.js +0 -1
- package/dist/publication/delivery/limits.d.ts +0 -1
- package/dist/publication/delivery/limits.js +0 -1
- package/dist/publication/delivery/request.d.ts +0 -1
- package/dist/publication/delivery/request.js +0 -1
- package/dist/publication/delivery-declaration.d.ts +0 -1
- package/dist/publication/delivery-declaration.js +0 -1
- package/dist/publication/delivery-endpoint.d.ts +0 -1
- package/dist/publication/delivery-endpoint.js +0 -1
- package/dist/publication/error.d.ts +0 -1
- package/dist/publication/error.js +0 -1
- package/dist/publication/etag.d.ts +0 -1
- package/dist/publication/etag.js +5 -2
- package/dist/publication/index.d.ts +4 -5
- package/dist/publication/index.js +2 -3
- package/dist/publication/legacy-requirements.d.ts +12 -0
- package/dist/publication/legacy-requirements.js +23 -0
- package/dist/publication/manifest.d.ts +2 -3
- package/dist/publication/manifest.js +10 -6
- package/dist/publication/publication.d.ts +4 -3
- package/dist/publication/publication.js +27 -12
- package/dist/publication/reference.d.ts +1 -2
- package/dist/publication/reference.js +0 -1
- package/dist/publication/requirements.d.ts +15 -8
- package/dist/publication/requirements.js +147 -45
- package/dist/publication/route.d.ts +0 -1
- package/dist/publication/route.js +0 -1
- package/dist/publication/schema.d.ts +1 -2
- package/dist/publication/schema.js +0 -1
- package/dist/routes/admission.d.ts +0 -1
- package/dist/routes/admission.js +5 -6
- package/dist/routes/binding.d.ts +3 -4
- package/dist/routes/binding.js +5 -6
- 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 +14 -12
- package/dist/routes/credential.d.ts +0 -1
- package/dist/routes/credential.js +0 -1
- package/dist/routes/decode.d.ts +2 -3
- package/dist/routes/decode.js +14 -25
- package/dist/routes/encode.d.ts +2 -3
- package/dist/routes/encode.js +18 -17
- 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 +15 -14
- package/dist/routes/index.d.ts +0 -1
- package/dist/routes/index.js +0 -1
- package/dist/routes/mapping.d.ts +0 -1
- package/dist/routes/mapping.js +0 -1
- package/dist/routes/match.d.ts +0 -1
- package/dist/routes/match.js +0 -1
- package/dist/routes/placement.d.ts +0 -1
- package/dist/routes/placement.js +1 -2
- package/dist/routes/plan.d.ts +5 -5
- package/dist/routes/plan.js +0 -1
- package/dist/routes/release-unavailable.d.ts +0 -1
- package/dist/routes/release-unavailable.js +0 -1
- package/dist/routes/request.d.ts +0 -1
- package/dist/routes/request.js +3 -2
- package/dist/routes/reservation.d.ts +0 -1
- package/dist/routes/reservation.js +7 -2
- package/dist/routes/routing.d.ts +0 -1
- package/dist/routes/routing.js +0 -1
- package/dist/routes/scalar.d.ts +3 -4
- package/dist/routes/scalar.js +5 -6
- package/dist/routes/select.d.ts +0 -1
- 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 +0 -1
- package/dist/routes/table.js +0 -1
- package/dist/routes/target.d.ts +0 -1
- package/dist/routes/target.js +0 -1
- package/dist/routes/template.d.ts +0 -1
- package/dist/routes/template.js +0 -1
- package/dist/runtime/artifact.d.ts +6 -5
- package/dist/runtime/artifact.js +22 -10
- 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 +3 -3
- package/dist/schema/installation/introspection/codec.js +144 -204
- 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 +18 -23
- 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 +27 -13
- 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.map +0 -1
- 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.map +0 -1
- package/dist/publication/bindings/view.d.ts.map +0 -1
- package/dist/publication/bindings/view.js.map +0 -1
- 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.map +0 -1
- package/dist/publication/bundle-evidence.d.ts.map +0 -1
- 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.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.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.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.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.map +0 -1
- package/dist/publication/error.d.ts.map +0 -1
- package/dist/publication/error.js.map +0 -1
- package/dist/publication/etag.d.ts.map +0 -1
- package/dist/publication/etag.js.map +0 -1
- package/dist/publication/index.d.ts.map +0 -1
- package/dist/publication/index.js.map +0 -1
- package/dist/publication/manifest.d.ts.map +0 -1
- package/dist/publication/manifest.js.map +0 -1
- package/dist/publication/publication.d.ts.map +0 -1
- package/dist/publication/publication.js.map +0 -1
- package/dist/publication/reference.d.ts.map +0 -1
- package/dist/publication/reference.js.map +0 -1
- package/dist/publication/requirements.d.ts.map +0 -1
- 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.map +0 -1
- 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,70 @@
|
|
|
1
|
+
import { installReceipt } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
2
|
+
import { acceptDomainInfo } from './introspection/index.js';
|
|
3
|
+
export const MEDIA_TYPE = 'application/vnd.astrale.schema-installation.v1+msgpack';
|
|
4
|
+
export async function encode(result) {
|
|
5
|
+
const { pack } = await import('msgpackr/pack');
|
|
6
|
+
return new Uint8Array(pack(accept(result)));
|
|
7
|
+
}
|
|
8
|
+
export async function decode(bytes, maximumBytes) {
|
|
9
|
+
if (!(bytes instanceof Uint8Array) ||
|
|
10
|
+
!Number.isSafeInteger(maximumBytes) ||
|
|
11
|
+
maximumBytes < 1 ||
|
|
12
|
+
bytes.byteLength > maximumBytes) {
|
|
13
|
+
throw new TypeError('Schema installation evidence is invalid or exceeds its bound.');
|
|
14
|
+
}
|
|
15
|
+
const { unpack } = await import('msgpackr');
|
|
16
|
+
let value;
|
|
17
|
+
try {
|
|
18
|
+
value = unpack(bytes);
|
|
19
|
+
}
|
|
20
|
+
catch (cause) {
|
|
21
|
+
throw new TypeError('Schema installation evidence is malformed.', { cause });
|
|
22
|
+
}
|
|
23
|
+
return accept(value);
|
|
24
|
+
}
|
|
25
|
+
function accept(input) {
|
|
26
|
+
const value = record(input);
|
|
27
|
+
if (value.changed === true) {
|
|
28
|
+
exact(value, ['changed', 'receipt']);
|
|
29
|
+
const receipt = installReceipt.parse(value.receipt);
|
|
30
|
+
if (receipt.transitions.some((transition) => transition.intent.operation !== receipt.operation)) {
|
|
31
|
+
throw new TypeError('Schema installation Transition belongs to another operation.');
|
|
32
|
+
}
|
|
33
|
+
uniqueOrigins(receipt.transitions.map((transition) => transition.intent.origin), 'Schema installation Transitions');
|
|
34
|
+
return Object.freeze({
|
|
35
|
+
changed: true,
|
|
36
|
+
receipt,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (value.changed === false) {
|
|
40
|
+
exact(value, ['changed', 'domains']);
|
|
41
|
+
if (!Array.isArray(value.domains) || value.domains.length === 0) {
|
|
42
|
+
throw new TypeError('Schema installation unchanged Domains are empty.');
|
|
43
|
+
}
|
|
44
|
+
const domains = value.domains.map(acceptDomainInfo);
|
|
45
|
+
uniqueOrigins(domains.map((domain) => domain.origin), 'Schema installation unchanged Domains');
|
|
46
|
+
return Object.freeze({
|
|
47
|
+
changed: false,
|
|
48
|
+
domains: Object.freeze(domains),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
throw new TypeError('Schema installation result kind is invalid.');
|
|
52
|
+
}
|
|
53
|
+
function uniqueOrigins(origins, label) {
|
|
54
|
+
if (new Set(origins).size !== origins.length) {
|
|
55
|
+
throw new TypeError(`${label} contain duplicate origins.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function record(input) {
|
|
59
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
60
|
+
throw new TypeError('Schema installation result is invalid.');
|
|
61
|
+
}
|
|
62
|
+
return input;
|
|
63
|
+
}
|
|
64
|
+
function exact(input, expected) {
|
|
65
|
+
const keys = Object.keys(input).sort();
|
|
66
|
+
const wanted = [...expected].sort();
|
|
67
|
+
if (keys.length !== wanted.length || keys.some((key, index) => key !== wanted[index])) {
|
|
68
|
+
throw new TypeError('Schema installation result fields are invalid.');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { introspection } from '@astrale-os/kernel-core/schema';
|
|
2
|
-
import type { Limits, ResultFor } from './result.js';
|
|
3
|
-
export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-introspection.
|
|
2
|
+
import type { DomainInfo, Limits, ResultFor } from './result.js';
|
|
3
|
+
export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-introspection.v2+msgpack';
|
|
4
4
|
export declare function encode<Input extends introspection.Introspection>(input: Input, result: ResultFor<Input>): Promise<Uint8Array>;
|
|
5
5
|
export declare function decode<Input extends introspection.Introspection>(input: Input, bytes: Uint8Array, limits: Limits): Promise<ResultFor<Input>>;
|
|
6
|
-
|
|
6
|
+
export declare function acceptDomainInfo(input: unknown): DomainInfo;
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import * as bundle from '@astrale-os/kernel-dsl/v1/bundle/transport';
|
|
3
|
+
import { revision as schemaRevision } from '@astrale-os/kernel-dsl/v1/schema/revision';
|
|
4
|
+
import { admitCallableBinding, admitViewBinding } from '../../../publication/bindings/index.js';
|
|
4
5
|
import * as publication from '../../../publication/index.js';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.v2+msgpack';
|
|
7
|
+
const encodedBundles = new WeakMap();
|
|
8
|
+
const admittedBundles = new Map();
|
|
9
|
+
const MAXIMUM_ADMITTED_BUNDLES = 128;
|
|
7
10
|
export async function encode(input, result) {
|
|
8
|
-
const
|
|
9
|
-
const wire =
|
|
10
|
-
|
|
11
|
+
const request = admitRequest(input);
|
|
12
|
+
const wire = request.kind === 'bundle'
|
|
13
|
+
? encodeDomainBundle(result)
|
|
14
|
+
: encodeDomainInfo(result);
|
|
15
|
+
proveRequestedOrigin(request, result);
|
|
16
|
+
const { pack } = await import('msgpackr/pack');
|
|
11
17
|
return new Uint8Array(pack(wire));
|
|
12
18
|
}
|
|
13
19
|
export async function decode(input, bytes, limits) {
|
|
20
|
+
const request = admitRequest(input);
|
|
14
21
|
if (!(bytes instanceof Uint8Array))
|
|
15
22
|
invalid('Schema introspection evidence must be binary.');
|
|
16
23
|
admitLimit(limits.maximumPublicationBytes, 'Publication');
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
if (request.kind === 'bundle')
|
|
25
|
+
admitLimit(limits.maximumBundleBytes, 'Bundle');
|
|
26
|
+
const maximumEvidenceBytes = limits.maximumPublicationBytes +
|
|
27
|
+
(request.kind === 'bundle' ? limits.maximumBundleBytes : 0) +
|
|
28
|
+
4_096;
|
|
29
|
+
if (bytes.byteLength > maximumEvidenceBytes) {
|
|
19
30
|
invalid('Schema introspection evidence exceeds its declared bounds.');
|
|
20
31
|
}
|
|
21
|
-
const { unpack } = await import(
|
|
32
|
+
const { unpack } = await import('msgpackr');
|
|
22
33
|
let decoded;
|
|
23
34
|
try {
|
|
24
35
|
decoded = unpack(bytes);
|
|
@@ -26,202 +37,147 @@ export async function decode(input, bytes, limits) {
|
|
|
26
37
|
catch (cause) {
|
|
27
38
|
throw new TypeError('Schema introspection evidence is malformed.', { cause });
|
|
28
39
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
output.capabilities = capabilities(result.capabilities);
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return Object.freeze(output);
|
|
65
|
-
}
|
|
66
|
-
function decodeResult(fields, input, limits) {
|
|
67
|
-
const source = fields.includes('source') ? decodeSource(input.source, limits) : undefined;
|
|
68
|
-
const output = {};
|
|
69
|
-
for (const field of fields) {
|
|
70
|
-
switch (field) {
|
|
71
|
-
case 'state':
|
|
72
|
-
output.state = state(input.state);
|
|
73
|
-
break;
|
|
74
|
-
case 'target':
|
|
75
|
-
output.target = digest(input.target, 'Installation target');
|
|
76
|
-
break;
|
|
77
|
-
case 'source':
|
|
78
|
-
output.source = source;
|
|
79
|
-
break;
|
|
80
|
-
case 'bundle':
|
|
81
|
-
output.bundle = decodeBundle(input.bundle, source, limits.maximumBundleBytes);
|
|
82
|
-
break;
|
|
83
|
-
case 'readiness':
|
|
84
|
-
output.readiness =
|
|
85
|
-
input.readiness === null ? null : digest(input.readiness, 'Installation readiness');
|
|
86
|
-
break;
|
|
87
|
-
case 'capabilities':
|
|
88
|
-
output.capabilities = capabilities(input.capabilities);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
40
|
+
const result = (request.kind === 'bundle'
|
|
41
|
+
? decodeDomainBundle(decoded, limits.maximumBundleBytes)
|
|
42
|
+
: acceptDomainInfo(decoded));
|
|
43
|
+
proveRequestedOrigin(request, result);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
function proveRequestedOrigin(request, result) {
|
|
47
|
+
const origin = request.kind === 'bundle'
|
|
48
|
+
? result.domain.origin
|
|
49
|
+
: result.origin;
|
|
50
|
+
if (origin !== request.origin)
|
|
51
|
+
invalid('Schema introspection evidence does not match the requested origin.');
|
|
52
|
+
}
|
|
53
|
+
function encodeDomainBundle(input) {
|
|
54
|
+
exact(input, ['bundle', 'domain'], 'Domain Bundle result');
|
|
55
|
+
const admittedDomain = acceptDomainInfo(input.domain);
|
|
56
|
+
const domain = encodeDomainInfo(admittedDomain);
|
|
57
|
+
proveBundle(input.bundle, admittedDomain);
|
|
58
|
+
const encoded = encodedBundles.get(input.bundle) ?? bundle.encode(input.bundle);
|
|
59
|
+
if (!encodedBundles.has(input.bundle))
|
|
60
|
+
encodedBundles.set(input.bundle, encoded);
|
|
61
|
+
return Object.freeze({ domain, bundle: encoded });
|
|
62
|
+
}
|
|
63
|
+
function decodeDomainBundle(input, maximum) {
|
|
64
|
+
const value = record(input, 'Domain Bundle result');
|
|
65
|
+
exact(value, ['bundle', 'domain'], 'Domain Bundle result');
|
|
66
|
+
const domain = acceptDomainInfo(value.domain);
|
|
67
|
+
const encoded = boundedBytes(value.bundle, maximum, 'Bundle');
|
|
68
|
+
const cached = admittedBundles.get(domain.generation);
|
|
69
|
+
if (cached !== undefined && sameBytes(cached.bytes, encoded)) {
|
|
70
|
+
return Object.freeze({ domain, bundle: cached.bundle });
|
|
91
71
|
}
|
|
92
|
-
|
|
93
|
-
|
|
72
|
+
let admitted;
|
|
73
|
+
try {
|
|
74
|
+
admitted = bundle.decode(encoded);
|
|
94
75
|
}
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
76
|
+
catch (cause) {
|
|
77
|
+
throw new TypeError('Installed Domain Bundle is invalid.', { cause });
|
|
78
|
+
}
|
|
79
|
+
proveBundle(admitted, domain);
|
|
80
|
+
admittedBundles.delete(domain.generation);
|
|
81
|
+
admittedBundles.set(domain.generation, Object.freeze({ bytes: encoded, bundle: admitted }));
|
|
82
|
+
if (admittedBundles.size > MAXIMUM_ADMITTED_BUNDLES) {
|
|
83
|
+
admittedBundles.delete(admittedBundles.keys().next().value);
|
|
84
|
+
}
|
|
85
|
+
return Object.freeze({ domain, bundle: admitted });
|
|
86
|
+
}
|
|
87
|
+
function sameBytes(left, right) {
|
|
88
|
+
if (left.byteLength !== right.byteLength)
|
|
89
|
+
return false;
|
|
90
|
+
for (let index = 0; index < left.byteLength; index += 1) {
|
|
91
|
+
if (left[index] !== right[index])
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
function encodeDomainInfo(input) {
|
|
97
|
+
return acceptDomainInfo(input);
|
|
98
|
+
}
|
|
99
|
+
export function acceptDomainInfo(input) {
|
|
100
|
+
const value = record(input, 'Domain info');
|
|
101
|
+
exact(value, ['bindings', 'capabilities', 'generation', 'origin', 'publication', 'readiness', 'revision'], 'Domain info');
|
|
102
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
103
|
+
invalid('Domain info origin is invalid.');
|
|
104
|
+
}
|
|
105
|
+
if (typeof value.revision !== 'string' || !patterns.revision.test(value.revision)) {
|
|
106
|
+
invalid('Domain info revision is invalid.');
|
|
107
|
+
}
|
|
108
|
+
const origin = value.origin;
|
|
109
|
+
const revision = value.revision;
|
|
110
|
+
const published = publicationReference(value.publication, origin, revision);
|
|
111
|
+
return Object.freeze({
|
|
112
|
+
origin,
|
|
113
|
+
revision,
|
|
114
|
+
generation: digest(value.generation, 'Domain generation'),
|
|
115
|
+
publication: published,
|
|
116
|
+
readiness: digest(value.readiness, 'Domain readiness'),
|
|
117
|
+
capabilities: capabilities(value.capabilities),
|
|
118
|
+
bindings: bindings(value.bindings, origin),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function publicationReference(input, origin, revision) {
|
|
122
|
+
if (input === null)
|
|
123
|
+
return null;
|
|
124
|
+
let admitted;
|
|
125
|
+
try {
|
|
126
|
+
admitted = publication.acceptReference(input);
|
|
103
127
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
kind: 'local',
|
|
107
|
-
artifact: ref(input.artifact, runtime.MEDIA_TYPE, 'Local Runtime Artifact'),
|
|
108
|
-
bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
|
|
109
|
-
});
|
|
128
|
+
catch (cause) {
|
|
129
|
+
throw new TypeError('Domain Publication metadata is invalid.', { cause });
|
|
110
130
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
kind: 'remote',
|
|
114
|
-
publication: publication.encode(publication.accept(input.publication)),
|
|
115
|
-
});
|
|
131
|
+
if (admitted.origin !== origin || admitted.revision !== revision) {
|
|
132
|
+
invalid('Domain Publication metadata does not match its Schema coordinate.');
|
|
116
133
|
}
|
|
117
|
-
return
|
|
134
|
+
return admitted;
|
|
118
135
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
return Object.freeze({
|
|
125
|
-
kind: 'builtin',
|
|
126
|
-
bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Builtin schema Bundle'),
|
|
127
|
-
});
|
|
136
|
+
function bindings(input, origin) {
|
|
137
|
+
const value = record(input, 'Domain bindings');
|
|
138
|
+
exact(value, ['callables', 'views'], 'Domain bindings');
|
|
139
|
+
if (!Array.isArray(value.callables) || !Array.isArray(value.views)) {
|
|
140
|
+
invalid('Domain bindings are invalid.');
|
|
128
141
|
}
|
|
129
|
-
|
|
130
|
-
exact(input, ['artifact', 'bundle', 'kind'], 'Local installation source');
|
|
142
|
+
try {
|
|
131
143
|
return Object.freeze({
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
|
|
144
|
+
callables: Object.freeze(value.callables.map((entry) => admitCallableBinding(entry, origin))),
|
|
145
|
+
views: Object.freeze(value.views.map((entry) => admitViewBinding(entry, origin))),
|
|
135
146
|
});
|
|
136
147
|
}
|
|
137
|
-
if (input.kind === 'remote') {
|
|
138
|
-
exact(input, ['kind', 'publication'], 'Remote installation source');
|
|
139
|
-
const encoded = boundedBytes(input.publication, limits.maximumPublicationBytes, 'Publication');
|
|
140
|
-
let admitted;
|
|
141
|
-
try {
|
|
142
|
-
admitted = publication.accept(json.decode(encoded));
|
|
143
|
-
}
|
|
144
|
-
catch (cause) {
|
|
145
|
-
throw new TypeError('Remote installed Publication is invalid.', { cause });
|
|
146
|
-
}
|
|
147
|
-
if (!equal(encoded, publication.encode(admitted))) {
|
|
148
|
-
invalid('Remote installed Publication is not canonical.');
|
|
149
|
-
}
|
|
150
|
-
return Object.freeze({ kind: 'remote', publication: admitted });
|
|
151
|
-
}
|
|
152
|
-
return invalid('Installation source kind is invalid.');
|
|
153
|
-
}
|
|
154
|
-
function encodeBundle(input, source) {
|
|
155
|
-
if (source === undefined || input === undefined)
|
|
156
|
-
invalid('Bundle source evidence is missing.');
|
|
157
|
-
const admitted = source.kind === 'remote'
|
|
158
|
-
? publication.acceptBundle(source.publication, input)
|
|
159
|
-
: bundle.accept(input);
|
|
160
|
-
const encoded = bundle.encode(admitted);
|
|
161
|
-
if (source.kind !== 'remote' &&
|
|
162
|
-
!same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
|
|
163
|
-
invalid('Local schema Bundle does not match its source Ref.');
|
|
164
|
-
}
|
|
165
|
-
return encoded;
|
|
166
|
-
}
|
|
167
|
-
function decodeBundle(input, source, maximum) {
|
|
168
|
-
const encoded = boundedBytes(input, maximum, 'Bundle');
|
|
169
|
-
let admitted;
|
|
170
|
-
try {
|
|
171
|
-
admitted =
|
|
172
|
-
source.kind === 'remote'
|
|
173
|
-
? publication.decodeBundle(source.publication, encoded)
|
|
174
|
-
: bundle.decode(encoded);
|
|
175
|
-
}
|
|
176
148
|
catch (cause) {
|
|
177
|
-
throw new TypeError('
|
|
178
|
-
}
|
|
179
|
-
if (!equal(encoded, bundle.encode(admitted)))
|
|
180
|
-
invalid('Installed schema Bundle is not canonical.');
|
|
181
|
-
if (source.kind !== 'remote' &&
|
|
182
|
-
!same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
|
|
183
|
-
invalid('Local schema Bundle does not match its source Ref.');
|
|
149
|
+
throw new TypeError('Domain bindings are invalid.', { cause });
|
|
184
150
|
}
|
|
185
|
-
return admitted;
|
|
186
151
|
}
|
|
187
|
-
function
|
|
188
|
-
if (input
|
|
189
|
-
|
|
190
|
-
input.from?.kind !== 'installation' ||
|
|
191
|
-
input.select === null ||
|
|
192
|
-
typeof input.select !== 'object') {
|
|
193
|
-
invalid('Schema introspection request is invalid.');
|
|
194
|
-
}
|
|
195
|
-
const allowed = ['state', 'target', 'source', 'bundle', 'readiness', 'capabilities'];
|
|
196
|
-
const fields = Object.keys(input.select);
|
|
197
|
-
if (fields.length === 0 ||
|
|
198
|
-
fields.some((field) => !allowed.includes(field) ||
|
|
199
|
-
input.select[field] !== true) ||
|
|
200
|
-
(input.select.bundle === true && input.select.source !== true)) {
|
|
201
|
-
invalid('Schema introspection selection is invalid.');
|
|
152
|
+
function proveBundle(input, domain) {
|
|
153
|
+
if (input.root.origin !== domain.origin || schemaRevision(input.root) !== domain.revision) {
|
|
154
|
+
invalid('Installed Bundle root does not match the ready Domain coordinate.');
|
|
202
155
|
}
|
|
203
|
-
return Object.freeze(allowed.filter((field) => input.select[field] === true));
|
|
204
156
|
}
|
|
205
157
|
function capabilities(input) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
exact(input, ['materialized', 'requested'], 'Installation capabilities');
|
|
158
|
+
const value = record(input, 'Domain capabilities');
|
|
159
|
+
exact(value, ['materialized', 'requested'], 'Domain capabilities');
|
|
209
160
|
try {
|
|
210
|
-
const requested = publication.admitRequirements({ capabilities:
|
|
161
|
+
const requested = publication.admitRequirements({ capabilities: value.requested }).capabilities;
|
|
211
162
|
const materialized = publication.admitRequirements({
|
|
212
|
-
capabilities:
|
|
163
|
+
capabilities: value.materialized,
|
|
213
164
|
}).capabilities;
|
|
214
165
|
return Object.freeze({ requested, materialized });
|
|
215
166
|
}
|
|
216
167
|
catch (cause) {
|
|
217
|
-
throw new TypeError('
|
|
168
|
+
throw new TypeError('Domain capabilities are invalid.', { cause });
|
|
218
169
|
}
|
|
219
170
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
222
|
-
|
|
171
|
+
function admitRequest(input) {
|
|
172
|
+
const value = record(input, 'Schema introspection request');
|
|
173
|
+
exact(value, ['kind', 'origin'], 'Schema introspection request');
|
|
174
|
+
if (value.kind !== 'inspect' && value.kind !== 'bundle') {
|
|
175
|
+
invalid('Schema introspection kind is invalid.');
|
|
223
176
|
}
|
|
224
|
-
|
|
177
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
178
|
+
invalid('Schema introspection origin is invalid.');
|
|
179
|
+
}
|
|
180
|
+
return Object.freeze({ kind: value.kind, origin: value.origin });
|
|
225
181
|
}
|
|
226
182
|
function digest(input, label) {
|
|
227
183
|
if (typeof input !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input)) {
|
|
@@ -229,21 +185,6 @@ function digest(input, label) {
|
|
|
229
185
|
}
|
|
230
186
|
return input;
|
|
231
187
|
}
|
|
232
|
-
function ref(input, mediaType, label) {
|
|
233
|
-
let admitted;
|
|
234
|
-
try {
|
|
235
|
-
admitted = artifact.accept(input);
|
|
236
|
-
}
|
|
237
|
-
catch (cause) {
|
|
238
|
-
throw new TypeError(`${label} Ref is invalid.`, { cause });
|
|
239
|
-
}
|
|
240
|
-
if (admitted.mediaType !== mediaType)
|
|
241
|
-
invalid(`${label} media type is invalid.`);
|
|
242
|
-
return admitted;
|
|
243
|
-
}
|
|
244
|
-
function same(left, right) {
|
|
245
|
-
return (left.digest === right.digest && left.mediaType === right.mediaType && left.size === right.size);
|
|
246
|
-
}
|
|
247
188
|
function boundedBytes(input, maximum, label) {
|
|
248
189
|
if (!(input instanceof Uint8Array) || input.byteLength === 0 || input.byteLength > maximum) {
|
|
249
190
|
invalid(`${label} evidence is invalid or exceeds its bound.`);
|
|
@@ -254,6 +195,12 @@ function admitLimit(input, label) {
|
|
|
254
195
|
if (!Number.isSafeInteger(input) || input < 1)
|
|
255
196
|
invalid(`${label} evidence bound is invalid.`);
|
|
256
197
|
}
|
|
198
|
+
function record(input, label) {
|
|
199
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
200
|
+
invalid(`${label} is invalid.`);
|
|
201
|
+
}
|
|
202
|
+
return input;
|
|
203
|
+
}
|
|
257
204
|
function exact(input, expected, label) {
|
|
258
205
|
const keys = Object.keys(input).sort();
|
|
259
206
|
const wanted = [...expected].sort();
|
|
@@ -261,13 +208,6 @@ function exact(input, expected, label) {
|
|
|
261
208
|
invalid(`${label} fields are invalid.`);
|
|
262
209
|
}
|
|
263
210
|
}
|
|
264
|
-
function equal(left, right) {
|
|
265
|
-
return left.byteLength === right.byteLength && left.every((byte, index) => byte === right[index]);
|
|
266
|
-
}
|
|
267
|
-
function isRecord(input) {
|
|
268
|
-
return input !== null && typeof input === 'object' && !Array.isArray(input);
|
|
269
|
-
}
|
|
270
211
|
function invalid(message) {
|
|
271
212
|
throw new TypeError(message);
|
|
272
213
|
}
|
|
273
|
-
//# sourceMappingURL=codec.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { MEDIA_TYPE, decode, encode } from './codec.js';
|
|
2
|
-
export type { Digest,
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { MEDIA_TYPE, acceptDomainInfo, decode, encode } from './codec.js';
|
|
2
|
+
export type { Digest, DomainBundle, DomainInfo, Limits, ResultFor } from './result.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { MEDIA_TYPE, decode, encode } from './codec.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { MEDIA_TYPE, acceptDomainInfo, decode, encode } from './codec.js';
|
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import type { introspection } from '@astrale-os/kernel-core/schema';
|
|
2
|
-
import type { bundle } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
-
import type {
|
|
4
|
-
import type { Publication } from '../../../publication/index.js';
|
|
5
|
-
import type { PublicationRequirements } from '../../../publication/index.js';
|
|
2
|
+
import type { bundle, Key, Revision } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
+
import type { Publication, PublicationRef, PublicationRequirements } from '../../../publication/index.js';
|
|
6
4
|
export type Digest = `sha256:${string}`;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: 'remote';
|
|
16
|
-
readonly publication: Publication;
|
|
17
|
-
};
|
|
18
|
-
export interface Installation {
|
|
19
|
-
readonly state: 'installed' | 'ready' | 'removing';
|
|
20
|
-
readonly target: Digest;
|
|
21
|
-
readonly source: Source;
|
|
22
|
-
readonly bundle: bundle.Bundle;
|
|
23
|
-
readonly readiness: Digest | null;
|
|
5
|
+
/** Lightweight proof of one exact ready installed Domain generation. */
|
|
6
|
+
export interface DomainInfo {
|
|
7
|
+
readonly origin: Key.Origin;
|
|
8
|
+
readonly revision: Revision;
|
|
9
|
+
readonly generation: Digest;
|
|
10
|
+
readonly publication: PublicationRef | null;
|
|
11
|
+
readonly readiness: Digest;
|
|
24
12
|
readonly capabilities: {
|
|
25
13
|
readonly requested: PublicationRequirements['capabilities'];
|
|
26
14
|
readonly materialized: PublicationRequirements['capabilities'];
|
|
27
15
|
};
|
|
16
|
+
readonly bindings: Publication['bindings'];
|
|
17
|
+
}
|
|
18
|
+
/** Explicit complete Bundle observed coherently with its ready Domain generation. */
|
|
19
|
+
export interface DomainBundle {
|
|
20
|
+
readonly domain: DomainInfo;
|
|
21
|
+
readonly bundle: bundle.Bundle;
|
|
28
22
|
}
|
|
29
|
-
export type ResultFor<Input extends introspection.Introspection> =
|
|
23
|
+
export type ResultFor<Input extends introspection.Introspection> = Input extends {
|
|
24
|
+
readonly kind: 'bundle';
|
|
25
|
+
} ? DomainBundle : DomainInfo;
|
|
30
26
|
export interface Limits {
|
|
31
27
|
readonly maximumPublicationBytes: number;
|
|
32
28
|
readonly maximumBundleBytes: number;
|
|
33
29
|
}
|
|
34
|
-
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InstallReceipt } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
2
|
+
import type { DomainInfo } from './introspection/index.js';
|
|
3
|
+
export type InstallResult = {
|
|
4
|
+
readonly changed: true;
|
|
5
|
+
readonly receipt: InstallReceipt;
|
|
6
|
+
} | {
|
|
7
|
+
readonly changed: false;
|
|
8
|
+
readonly domains: readonly [DomainInfo, ...DomainInfo[]];
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|