@astrale-os/kernel-client 0.6.0-beta.9 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth.d.ts +22 -10
- package/dist/auth/auth.js +5 -7
- package/dist/auth/authorization.d.ts +4 -2
- package/dist/auth/authorization.js +25 -6
- package/dist/auth/credential.d.ts +7 -4
- package/dist/auth/credential.js +6 -3
- package/dist/auth/identity.d.ts +7 -9
- package/dist/auth/identity.js +0 -1
- package/dist/auth/index.d.ts +4 -5
- package/dist/auth/index.js +2 -4
- package/dist/auth/register.d.ts +24 -0
- package/dist/auth/register.js +10 -0
- package/dist/client/admission.d.ts +4 -2
- package/dist/client/admission.js +9 -11
- package/dist/client/client.d.ts +4 -3
- package/dist/client/client.js +16 -4
- package/dist/client/credential.d.ts +5 -3
- package/dist/client/credential.js +7 -3
- package/dist/client/index.d.ts +2 -3
- package/dist/client/index.js +2 -3
- package/dist/client/request.d.ts +10 -4
- package/dist/client/request.js +33 -6
- package/dist/client/result.d.ts +3 -4
- package/dist/client/result.js +3 -1
- package/dist/client/routing-control.d.ts +11 -4
- package/dist/client/routing-control.js +18 -4
- package/dist/errors/client-error.d.ts +0 -1
- package/dist/errors/client-error.js +0 -1
- package/dist/errors/exchange-error.d.ts +19 -0
- package/dist/errors/exchange-error.js +9 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/miss-error.d.ts +0 -1
- package/dist/errors/miss-error.js +0 -1
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +0 -1
- package/dist/errors/response-error.d.ts +0 -1
- package/dist/errors/response-error.js +0 -1
- package/dist/errors/session-error.d.ts +0 -1
- package/dist/errors/session-error.js +0 -1
- package/dist/errors/stale-route-error.d.ts +4 -4
- package/dist/errors/stale-route-error.js +5 -5
- package/dist/errors/transport-error.d.ts +3 -3
- package/dist/errors/transport-error.js +0 -1
- package/dist/graph/domain/binding.d.ts +0 -1
- package/dist/graph/domain/binding.js +0 -1
- package/dist/graph/domain/domain.typecheck.d.ts +0 -1
- package/dist/graph/domain/domain.typecheck.js +21 -1
- package/dist/graph/domain/index.d.ts +0 -1
- package/dist/graph/domain/index.js +0 -1
- package/dist/graph/domain/model.d.ts +0 -1
- package/dist/graph/domain/model.js +0 -1
- package/dist/graph/domain/page.d.ts +0 -1
- package/dist/graph/domain/page.js +0 -1
- package/dist/graph/domain/project.d.ts +0 -1
- package/dist/graph/domain/project.js +10 -7
- package/dist/graph/domain/provenance.d.ts +0 -1
- package/dist/graph/domain/provenance.js +0 -1
- package/dist/graph/errors.d.ts +0 -1
- package/dist/graph/errors.js +1 -3
- package/dist/graph/expectation.d.ts +3 -0
- package/dist/graph/expectation.js +6 -0
- package/dist/graph/graph.d.ts +6 -3
- package/dist/graph/graph.js +0 -1
- package/dist/graph/index.d.ts +2 -3
- package/dist/graph/index.js +1 -2
- package/dist/graph/mutation.d.ts +2 -4
- package/dist/graph/mutation.js +12 -2
- package/dist/graph/page/index.d.ts +0 -1
- package/dist/graph/page/index.js +0 -1
- package/dist/graph/page/neighbors.d.ts +0 -1
- package/dist/graph/page/neighbors.js +2 -2
- package/dist/graph/page/page.d.ts +0 -1
- package/dist/graph/page/page.js +0 -1
- package/dist/graph/page-contract.d.ts +0 -1
- package/dist/graph/page-contract.js +0 -1
- package/dist/graph/provenance.d.ts +2 -1
- package/dist/graph/provenance.js +5 -1
- package/dist/graph/query.d.ts +3 -1
- package/dist/graph/query.js +15 -8
- package/dist/graph/read.d.ts +0 -1
- package/dist/graph/read.js +6 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/pacer/batcher/batcher.d.ts +0 -1
- package/dist/pacer/batcher/batcher.js +0 -1
- package/dist/pacer/batcher/defaults.d.ts +0 -1
- package/dist/pacer/batcher/defaults.js +0 -1
- package/dist/pacer/batcher/index.d.ts +0 -1
- package/dist/pacer/batcher/index.js +0 -1
- package/dist/pacer/index.d.ts +0 -1
- package/dist/pacer/index.js +0 -1
- package/dist/pacer/limiter/defaults.d.ts +0 -1
- package/dist/pacer/limiter/defaults.js +0 -1
- package/dist/pacer/limiter/index.d.ts +0 -1
- package/dist/pacer/limiter/index.js +0 -1
- package/dist/pacer/limiter/limiter.d.ts +0 -1
- package/dist/pacer/limiter/limiter.js +0 -1
- package/dist/pacer/queue/defaults.d.ts +0 -1
- package/dist/pacer/queue/defaults.js +0 -1
- package/dist/pacer/queue/index.d.ts +0 -1
- package/dist/pacer/queue/index.js +0 -1
- package/dist/pacer/queue/queue.d.ts +0 -1
- package/dist/pacer/queue/queue.js +0 -1
- package/dist/pacer/retry/defaults.d.ts +0 -1
- package/dist/pacer/retry/defaults.js +0 -1
- package/dist/pacer/retry/index.d.ts +0 -1
- package/dist/pacer/retry/index.js +0 -1
- package/dist/pacer/retry/retry.d.ts +0 -1
- package/dist/pacer/retry/retry.js +0 -1
- package/dist/pool/index.d.ts +0 -1
- package/dist/pool/index.js +0 -1
- package/dist/pool/pool.d.ts +0 -1
- package/dist/pool/pool.js +0 -1
- package/dist/pool/target.d.ts +0 -1
- package/dist/pool/target.js +0 -1
- package/dist/schema/admission.d.ts +0 -1
- package/dist/schema/admission.js +0 -1
- package/dist/schema/contracts.d.ts +3 -4
- package/dist/schema/contracts.js +0 -1
- package/dist/schema/index.d.ts +2 -3
- package/dist/schema/index.js +1 -2
- package/dist/schema/introspection.d.ts +0 -1
- package/dist/schema/introspection.js +10 -3
- package/dist/schema/operation.d.ts +0 -1
- package/dist/schema/operation.js +1 -2
- package/dist/schema/schema.d.ts +16 -10
- package/dist/schema/schema.js +92 -13
- package/dist/session/admission.d.ts +6 -0
- package/dist/session/admission.js +52 -0
- package/dist/session/bound.d.ts +17 -14
- package/dist/session/bound.js +54 -10
- package/dist/session/content/api.d.ts +45 -0
- package/dist/session/content/api.js +28 -0
- package/dist/session/content/batch.d.ts +5 -0
- package/dist/session/content/batch.js +93 -0
- package/dist/session/content/index.d.ts +1 -0
- package/dist/session/content/index.js +1 -0
- package/dist/session/content/input.d.ts +9 -0
- package/dist/session/content/input.js +33 -0
- package/dist/session/content/parts.d.ts +36 -0
- package/dist/session/content/parts.js +154 -0
- package/dist/session/content/retry.d.ts +3 -0
- package/dist/session/content/retry.js +41 -0
- package/dist/session/content/wire.d.ts +12 -0
- package/dist/session/content/wire.js +60 -0
- package/dist/session/context/control.d.ts +0 -1
- package/dist/session/context/control.js +0 -1
- package/dist/session/context/index.d.ts +2 -3
- package/dist/session/context/index.js +2 -3
- package/dist/session/context/limits.d.ts +1 -2
- package/dist/session/context/limits.js +1 -2
- package/dist/session/context/operation.d.ts +5 -3
- package/dist/session/context/operation.js +1 -2
- package/dist/session/context/policy.d.ts +0 -2
- package/dist/session/context/policy.js +0 -17
- package/dist/session/credential/credentials.d.ts +65 -0
- package/dist/session/credential/credentials.js +296 -0
- package/dist/session/credential/index.d.ts +1 -0
- package/dist/session/credential/index.js +1 -0
- package/dist/session/credential/limits.d.ts +14 -0
- package/dist/session/credential/limits.js +14 -0
- package/dist/session/discovery/bundle.d.ts +9 -5
- package/dist/session/discovery/bundle.js +43 -26
- package/dist/session/discovery/discovery.d.ts +12 -5
- package/dist/session/discovery/discovery.js +42 -13
- package/dist/session/discovery/index.d.ts +6 -2
- package/dist/session/discovery/index.js +4 -8
- package/dist/session/discovery/release.d.ts +30 -0
- package/dist/session/discovery/release.js +81 -0
- package/dist/session/discovery/response.d.ts +3 -0
- package/dist/session/discovery/response.js +59 -0
- package/dist/session/discovery/snapshot.d.ts +4 -5
- package/dist/session/discovery/snapshot.js +2 -3
- package/dist/session/discovery/transport.d.ts +1 -4
- package/dist/session/discovery/transport.js +0 -1
- package/dist/session/exchange/domain.d.ts +27 -0
- package/dist/session/exchange/domain.js +63 -0
- package/dist/session/exchange/exchange.d.ts +48 -0
- package/dist/session/exchange/exchange.js +54 -0
- package/dist/session/exchange/index.d.ts +5 -0
- package/dist/session/exchange/index.js +5 -0
- package/dist/session/exchange/issuer.d.ts +18 -0
- package/dist/session/exchange/issuer.js +149 -0
- package/dist/session/exchange/limits.d.ts +10 -0
- package/dist/session/exchange/limits.js +10 -0
- package/dist/session/exchange/options.d.ts +37 -0
- package/dist/session/exchange/options.js +65 -0
- package/dist/session/exchange/presentation.d.ts +19 -0
- package/dist/session/exchange/presentation.js +72 -0
- package/dist/session/exchange/source.d.ts +33 -0
- package/dist/session/exchange/source.js +78 -0
- package/dist/session/execution.d.ts +65 -0
- package/dist/session/execution.js +34 -0
- package/dist/session/index.d.ts +9 -6
- package/dist/session/index.js +3 -2
- package/dist/session/options.d.ts +65 -0
- package/dist/session/options.js +132 -0
- package/dist/session/reference.d.ts +35 -20
- package/dist/session/reference.js +28 -11
- package/dist/session/routing/auth.d.ts +10 -1
- package/dist/session/routing/auth.js +8 -2
- package/dist/session/routing/cache.d.ts +21 -7
- package/dist/session/routing/cache.js +103 -73
- package/dist/session/routing/dispatch.d.ts +19 -11
- package/dist/session/routing/dispatch.js +113 -89
- package/dist/session/routing/envelope.d.ts +4 -3
- package/dist/session/routing/envelope.js +14 -10
- package/dist/session/routing/expiry.d.ts +4 -0
- package/dist/session/routing/expiry.js +32 -0
- package/dist/session/routing/index.d.ts +5 -5
- package/dist/session/routing/index.js +4 -3
- package/dist/session/routing/integrity.d.ts +7 -0
- package/dist/session/routing/integrity.js +44 -0
- package/dist/session/routing/recovery.d.ts +16 -0
- package/dist/session/routing/recovery.js +41 -0
- package/dist/session/routing/request.d.ts +9 -1
- package/dist/session/routing/request.js +17 -1
- package/dist/session/routing/result.d.ts +5 -0
- package/dist/session/routing/result.js +12 -0
- package/dist/session/routing/store.d.ts +23 -0
- package/dist/session/routing/store.js +99 -0
- package/dist/session/session.d.ts +37 -33
- package/dist/session/session.js +126 -152
- package/dist/session/session.typecheck.d.ts +0 -1
- package/dist/session/session.typecheck.js +183 -5
- package/dist/session/views/catalog.d.ts +9 -6
- package/dist/session/views/catalog.js +29 -23
- package/dist/session/views/index.d.ts +1 -2
- package/dist/session/views/index.js +1 -2
- package/dist/session/views/resolve.d.ts +6 -5
- package/dist/session/views/resolve.js +14 -7
- package/dist/store/entity-index.d.ts +1 -3
- package/dist/store/entity-index.js +0 -4
- package/dist/store/index.d.ts +0 -1
- package/dist/store/index.js +0 -1
- package/dist/store/memory.d.ts +2 -2
- package/dist/store/memory.js +40 -17
- package/dist/store/mutation.d.ts +1 -2
- package/dist/store/mutation.js +6 -4
- package/dist/store/observe.d.ts +0 -1
- package/dist/store/observe.js +0 -1
- package/dist/store/optimistic.d.ts +0 -1
- package/dist/store/optimistic.js +0 -1
- package/dist/store/query-key.d.ts +2 -2
- package/dist/store/query-key.js +7 -3
- package/dist/store/shape.d.ts +6 -3
- package/dist/store/shape.js +4 -2
- package/dist/store/store.d.ts +2 -4
- package/dist/store/store.js +6 -5
- package/dist/store/store.typecheck.d.ts +0 -1
- package/dist/store/store.typecheck.js +0 -6
- package/dist/transport/auto/decision.d.ts +3 -3
- package/dist/transport/auto/decision.js +0 -1
- package/dist/transport/auto/fallback.d.ts +2 -2
- package/dist/transport/auto/fallback.js +2 -2
- package/dist/transport/auto/index.d.ts +0 -1
- package/dist/transport/auto/index.js +0 -1
- package/dist/transport/auto/transport.d.ts +0 -2
- package/dist/transport/auto/transport.js +0 -3
- package/dist/transport/auto/warning.d.ts +0 -1
- package/dist/transport/auto/warning.js +5 -3
- package/dist/transport/deadline.d.ts +0 -1
- package/dist/transport/deadline.js +0 -1
- package/dist/transport/failure.d.ts +0 -1
- package/dist/transport/failure.js +0 -1
- package/dist/transport/http/admission.d.ts +5 -0
- package/dist/transport/http/admission.js +101 -0
- package/dist/transport/http/binary.d.ts +5 -0
- package/dist/transport/http/binary.js +70 -0
- package/dist/transport/http/byte-stream.d.ts +18 -0
- package/dist/transport/http/byte-stream.js +94 -0
- package/dist/transport/http/configuration.d.ts +24 -0
- package/dist/transport/http/configuration.js +116 -0
- package/dist/transport/http/index.d.ts +2 -2
- package/dist/transport/http/index.js +0 -1
- package/dist/transport/http/response.d.ts +8 -2
- package/dist/transport/http/response.js +11 -7
- package/dist/transport/http/retired.d.ts +8 -0
- package/dist/transport/http/retired.js +28 -0
- package/dist/transport/http/stream.d.ts +0 -1
- package/dist/transport/http/stream.js +0 -1
- package/dist/transport/http/transport.d.ts +4 -18
- package/dist/transport/http/transport.js +48 -252
- package/dist/transport/index.d.ts +1 -2
- package/dist/transport/index.js +0 -1
- package/dist/transport/transport.d.ts +10 -3
- package/dist/transport/transport.js +0 -1
- package/dist/transport/websocket/connection.d.ts +2 -2
- package/dist/transport/websocket/connection.js +5 -3
- package/dist/transport/websocket/exchange.d.ts +0 -1
- package/dist/transport/websocket/exchange.js +0 -1
- package/dist/transport/websocket/index.d.ts +0 -1
- package/dist/transport/websocket/index.js +0 -1
- package/dist/transport/websocket/transport.d.ts +0 -4
- package/dist/transport/websocket/transport.js +2 -18
- package/package.json +12 -15
- package/dist/auth/auth.d.ts.map +0 -1
- package/dist/auth/auth.js.map +0 -1
- package/dist/auth/authorization.d.ts.map +0 -1
- package/dist/auth/authorization.js.map +0 -1
- package/dist/auth/credential.d.ts.map +0 -1
- package/dist/auth/credential.js.map +0 -1
- package/dist/auth/identity.d.ts.map +0 -1
- package/dist/auth/identity.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/provision.d.ts +0 -9
- package/dist/auth/provision.d.ts.map +0 -1
- package/dist/auth/provision.js +0 -11
- package/dist/auth/provision.js.map +0 -1
- package/dist/client/admission.d.ts.map +0 -1
- package/dist/client/admission.js.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js.map +0 -1
- package/dist/client/credential.d.ts.map +0 -1
- package/dist/client/credential.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/request.d.ts.map +0 -1
- package/dist/client/request.js.map +0 -1
- package/dist/client/result.d.ts.map +0 -1
- package/dist/client/result.js.map +0 -1
- package/dist/client/routing-control.d.ts.map +0 -1
- package/dist/client/routing-control.js.map +0 -1
- package/dist/errors/client-error.d.ts.map +0 -1
- package/dist/errors/client-error.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/miss-error.d.ts.map +0 -1
- package/dist/errors/miss-error.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/response-error.d.ts.map +0 -1
- package/dist/errors/response-error.js.map +0 -1
- package/dist/errors/session-error.d.ts.map +0 -1
- package/dist/errors/session-error.js.map +0 -1
- package/dist/errors/stale-route-error.d.ts.map +0 -1
- package/dist/errors/stale-route-error.js.map +0 -1
- package/dist/errors/transport-error.d.ts.map +0 -1
- package/dist/errors/transport-error.js.map +0 -1
- package/dist/graph/domain/binding.d.ts.map +0 -1
- package/dist/graph/domain/binding.js.map +0 -1
- package/dist/graph/domain/domain.typecheck.d.ts.map +0 -1
- package/dist/graph/domain/domain.typecheck.js.map +0 -1
- package/dist/graph/domain/index.d.ts.map +0 -1
- package/dist/graph/domain/index.js.map +0 -1
- package/dist/graph/domain/model.d.ts.map +0 -1
- package/dist/graph/domain/model.js.map +0 -1
- package/dist/graph/domain/page.d.ts.map +0 -1
- package/dist/graph/domain/page.js.map +0 -1
- package/dist/graph/domain/project.d.ts.map +0 -1
- package/dist/graph/domain/project.js.map +0 -1
- package/dist/graph/domain/provenance.d.ts.map +0 -1
- package/dist/graph/domain/provenance.js.map +0 -1
- package/dist/graph/errors.d.ts.map +0 -1
- package/dist/graph/errors.js.map +0 -1
- package/dist/graph/graph.d.ts.map +0 -1
- package/dist/graph/graph.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/mutation.d.ts.map +0 -1
- package/dist/graph/mutation.js.map +0 -1
- package/dist/graph/page/index.d.ts.map +0 -1
- package/dist/graph/page/index.js.map +0 -1
- package/dist/graph/page/neighbors.d.ts.map +0 -1
- package/dist/graph/page/neighbors.js.map +0 -1
- package/dist/graph/page/page.d.ts.map +0 -1
- package/dist/graph/page/page.js.map +0 -1
- package/dist/graph/page-contract.d.ts.map +0 -1
- package/dist/graph/page-contract.js.map +0 -1
- package/dist/graph/provenance.d.ts.map +0 -1
- package/dist/graph/provenance.js.map +0 -1
- package/dist/graph/query.d.ts.map +0 -1
- package/dist/graph/query.js.map +0 -1
- package/dist/graph/read.d.ts.map +0 -1
- package/dist/graph/read.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pacer/batcher/batcher.d.ts.map +0 -1
- package/dist/pacer/batcher/batcher.js.map +0 -1
- package/dist/pacer/batcher/defaults.d.ts.map +0 -1
- package/dist/pacer/batcher/defaults.js.map +0 -1
- package/dist/pacer/batcher/index.d.ts.map +0 -1
- package/dist/pacer/batcher/index.js.map +0 -1
- package/dist/pacer/index.d.ts.map +0 -1
- package/dist/pacer/index.js.map +0 -1
- package/dist/pacer/limiter/defaults.d.ts.map +0 -1
- package/dist/pacer/limiter/defaults.js.map +0 -1
- package/dist/pacer/limiter/index.d.ts.map +0 -1
- package/dist/pacer/limiter/index.js.map +0 -1
- package/dist/pacer/limiter/limiter.d.ts.map +0 -1
- package/dist/pacer/limiter/limiter.js.map +0 -1
- package/dist/pacer/queue/defaults.d.ts.map +0 -1
- package/dist/pacer/queue/defaults.js.map +0 -1
- package/dist/pacer/queue/index.d.ts.map +0 -1
- package/dist/pacer/queue/index.js.map +0 -1
- package/dist/pacer/queue/queue.d.ts.map +0 -1
- package/dist/pacer/queue/queue.js.map +0 -1
- package/dist/pacer/retry/defaults.d.ts.map +0 -1
- package/dist/pacer/retry/defaults.js.map +0 -1
- package/dist/pacer/retry/index.d.ts.map +0 -1
- package/dist/pacer/retry/index.js.map +0 -1
- package/dist/pacer/retry/retry.d.ts.map +0 -1
- package/dist/pacer/retry/retry.js.map +0 -1
- package/dist/pool/index.d.ts.map +0 -1
- package/dist/pool/index.js.map +0 -1
- package/dist/pool/pool.d.ts.map +0 -1
- package/dist/pool/pool.js.map +0 -1
- package/dist/pool/target.d.ts.map +0 -1
- package/dist/pool/target.js.map +0 -1
- package/dist/schema/admission.d.ts.map +0 -1
- package/dist/schema/admission.js.map +0 -1
- package/dist/schema/contracts.d.ts.map +0 -1
- package/dist/schema/contracts.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/introspection.d.ts.map +0 -1
- package/dist/schema/introspection.js.map +0 -1
- package/dist/schema/operation.d.ts.map +0 -1
- package/dist/schema/operation.js.map +0 -1
- package/dist/schema/schema.d.ts.map +0 -1
- package/dist/schema/schema.js.map +0 -1
- package/dist/session/bound.d.ts.map +0 -1
- package/dist/session/bound.js.map +0 -1
- package/dist/session/context/control.d.ts.map +0 -1
- package/dist/session/context/control.js.map +0 -1
- package/dist/session/context/index.d.ts.map +0 -1
- package/dist/session/context/index.js.map +0 -1
- package/dist/session/context/limits.d.ts.map +0 -1
- package/dist/session/context/limits.js.map +0 -1
- package/dist/session/context/operation.d.ts.map +0 -1
- package/dist/session/context/operation.js.map +0 -1
- package/dist/session/context/policy.d.ts.map +0 -1
- package/dist/session/context/policy.js.map +0 -1
- package/dist/session/discovery/bundle.d.ts.map +0 -1
- package/dist/session/discovery/bundle.js.map +0 -1
- package/dist/session/discovery/discovery.d.ts.map +0 -1
- package/dist/session/discovery/discovery.js.map +0 -1
- package/dist/session/discovery/index.d.ts.map +0 -1
- package/dist/session/discovery/index.js.map +0 -1
- package/dist/session/discovery/publication.d.ts +0 -24
- package/dist/session/discovery/publication.d.ts.map +0 -1
- package/dist/session/discovery/publication.js +0 -124
- package/dist/session/discovery/publication.js.map +0 -1
- package/dist/session/discovery/snapshot.d.ts.map +0 -1
- package/dist/session/discovery/snapshot.js.map +0 -1
- package/dist/session/discovery/transport.d.ts.map +0 -1
- package/dist/session/discovery/transport.js.map +0 -1
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js.map +0 -1
- package/dist/session/reference.d.ts.map +0 -1
- package/dist/session/reference.js.map +0 -1
- package/dist/session/routing/auth.d.ts.map +0 -1
- package/dist/session/routing/auth.js.map +0 -1
- package/dist/session/routing/cache.d.ts.map +0 -1
- package/dist/session/routing/cache.js.map +0 -1
- package/dist/session/routing/dispatch.d.ts.map +0 -1
- package/dist/session/routing/dispatch.js.map +0 -1
- package/dist/session/routing/envelope.d.ts.map +0 -1
- package/dist/session/routing/envelope.js.map +0 -1
- package/dist/session/routing/expectation.d.ts +0 -7
- package/dist/session/routing/expectation.d.ts.map +0 -1
- package/dist/session/routing/expectation.js +0 -2
- package/dist/session/routing/expectation.js.map +0 -1
- package/dist/session/routing/index.d.ts.map +0 -1
- package/dist/session/routing/index.js.map +0 -1
- package/dist/session/routing/request.d.ts.map +0 -1
- package/dist/session/routing/request.js.map +0 -1
- package/dist/session/session.d.ts.map +0 -1
- package/dist/session/session.js.map +0 -1
- package/dist/session/session.typecheck.d.ts.map +0 -1
- package/dist/session/session.typecheck.js.map +0 -1
- package/dist/session/views/catalog.d.ts.map +0 -1
- package/dist/session/views/catalog.js.map +0 -1
- package/dist/session/views/index.d.ts.map +0 -1
- package/dist/session/views/index.js.map +0 -1
- package/dist/session/views/resolve.d.ts.map +0 -1
- package/dist/session/views/resolve.js.map +0 -1
- package/dist/store/entity-index.d.ts.map +0 -1
- package/dist/store/entity-index.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/memory.d.ts.map +0 -1
- package/dist/store/memory.js.map +0 -1
- package/dist/store/mutation.d.ts.map +0 -1
- package/dist/store/mutation.js.map +0 -1
- package/dist/store/observe.d.ts.map +0 -1
- package/dist/store/observe.js.map +0 -1
- package/dist/store/optimistic.d.ts.map +0 -1
- package/dist/store/optimistic.js.map +0 -1
- package/dist/store/query-key.d.ts.map +0 -1
- package/dist/store/query-key.js.map +0 -1
- package/dist/store/shape.d.ts.map +0 -1
- package/dist/store/shape.js.map +0 -1
- package/dist/store/store.d.ts.map +0 -1
- package/dist/store/store.js.map +0 -1
- package/dist/store/store.typecheck.d.ts.map +0 -1
- package/dist/store/store.typecheck.js.map +0 -1
- package/dist/transport/auto/decision.d.ts.map +0 -1
- package/dist/transport/auto/decision.js.map +0 -1
- package/dist/transport/auto/fallback.d.ts.map +0 -1
- package/dist/transport/auto/fallback.js.map +0 -1
- package/dist/transport/auto/index.d.ts.map +0 -1
- package/dist/transport/auto/index.js.map +0 -1
- package/dist/transport/auto/transport.d.ts.map +0 -1
- package/dist/transport/auto/transport.js.map +0 -1
- package/dist/transport/auto/warning.d.ts.map +0 -1
- package/dist/transport/auto/warning.js.map +0 -1
- package/dist/transport/deadline.d.ts.map +0 -1
- package/dist/transport/deadline.js.map +0 -1
- package/dist/transport/failure.d.ts.map +0 -1
- package/dist/transport/failure.js.map +0 -1
- package/dist/transport/http/index.d.ts.map +0 -1
- package/dist/transport/http/index.js.map +0 -1
- package/dist/transport/http/response.d.ts.map +0 -1
- package/dist/transport/http/response.js.map +0 -1
- package/dist/transport/http/stream.d.ts.map +0 -1
- package/dist/transport/http/stream.js.map +0 -1
- package/dist/transport/http/transport.d.ts.map +0 -1
- package/dist/transport/http/transport.js.map +0 -1
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/transport.d.ts.map +0 -1
- package/dist/transport/transport.js.map +0 -1
- package/dist/transport/websocket/connection.d.ts.map +0 -1
- package/dist/transport/websocket/connection.js.map +0 -1
- package/dist/transport/websocket/exchange.d.ts.map +0 -1
- package/dist/transport/websocket/exchange.js.map +0 -1
- package/dist/transport/websocket/index.d.ts.map +0 -1
- package/dist/transport/websocket/index.js.map +0 -1
- package/dist/transport/websocket/transport.d.ts.map +0 -1
- package/dist/transport/websocket/transport.js.map +0 -1
package/dist/graph/query.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { QueryAST as QueryASTValue, QueryResultFor } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import { Path, type NodeTarget } from '@astrale-os/kernel-core/path';
|
|
2
3
|
import type { GraphCall, GraphQueryOptions } from './graph.js';
|
|
3
4
|
import type { QueryResponse } from './page-contract.js';
|
|
5
|
+
/** Point/neighbor reads are exact targets, unlike Query's overloaded Class sources. */
|
|
6
|
+
export declare function queryNodePath(target: NodeTarget): Path;
|
|
4
7
|
export declare function queryGraph<Query extends QueryASTValue>(call: GraphCall, input: Query, options: GraphQueryOptions): Promise<QueryResponse<QueryResultFor<Query>>>;
|
|
5
|
-
//# sourceMappingURL=query.d.ts.map
|
package/dist/graph/query.js
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { QueryAST, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
-
import { Path } from '@astrale-os/kernel-core/path';
|
|
1
|
+
import { QueryAST, QueryASTDecodeError, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import { Path, PathError } from '@astrale-os/kernel-core/path';
|
|
3
3
|
import { query } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
4
4
|
import { call as invocation } from '../client/index.js';
|
|
5
|
+
import { captureExpected } from './expectation.js';
|
|
5
6
|
import { retainQueryProvenance } from './provenance.js';
|
|
6
7
|
const KERNEL_QUERY_PATH = Path.project(query).raw;
|
|
8
|
+
/** Point/neighbor reads are exact targets, unlike Query's overloaded Class sources. */
|
|
9
|
+
export function queryNodePath(target) {
|
|
10
|
+
try {
|
|
11
|
+
return Path.target(target);
|
|
12
|
+
}
|
|
13
|
+
catch (cause) {
|
|
14
|
+
// Preserve the graph-read Query error contract; do not relabel unexpected defects.
|
|
15
|
+
if (!(cause instanceof PathError))
|
|
16
|
+
throw cause;
|
|
17
|
+
throw new QueryASTDecodeError('/source/nodes/0', 'Invalid Node target', { cause });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
7
20
|
export async function queryGraph(call, input, options) {
|
|
8
21
|
const ast = QueryAST.decode(input);
|
|
9
22
|
const { expected, page, ...request } = options;
|
|
@@ -19,11 +32,6 @@ export async function queryGraph(call, input, options) {
|
|
|
19
32
|
? response
|
|
20
33
|
: retainQueryProvenance(response, capturedExpected);
|
|
21
34
|
}
|
|
22
|
-
function captureExpected(input) {
|
|
23
|
-
if (input === undefined)
|
|
24
|
-
return undefined;
|
|
25
|
-
return Object.freeze(input.map(({ origin, revision }) => Object.freeze({ origin, revision })));
|
|
26
|
-
}
|
|
27
35
|
function admitPage(input) {
|
|
28
36
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
29
37
|
throw new TypeError('Graph query page is invalid.');
|
|
@@ -67,4 +75,3 @@ function hasExactKeys(input, expected) {
|
|
|
67
75
|
const keys = Object.keys(input);
|
|
68
76
|
return keys.length === expected.length && keys.every((key) => expected.includes(key));
|
|
69
77
|
}
|
|
70
|
-
//# sourceMappingURL=query.js.map
|
package/dist/graph/read.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ import type { RequestOptions } from '../transport/index.js';
|
|
|
4
4
|
import type { GraphCall } from './graph.js';
|
|
5
5
|
export declare function getNode(call: GraphCall, path: NodeTarget, options?: RequestOptions): Promise<Node | null>;
|
|
6
6
|
export declare function requireNode(call: GraphCall, path: NodeTarget, options?: RequestOptions): Promise<Node>;
|
|
7
|
-
//# sourceMappingURL=read.d.ts.map
|
package/dist/graph/read.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Query } from '@astrale-os/kernel-core/graph/query';
|
|
2
2
|
import { NodeUnavailableError } from './errors.js';
|
|
3
|
-
import { queryGraph } from './query.js';
|
|
3
|
+
import { queryGraph, queryNodePath } from './query.js';
|
|
4
4
|
export async function getNode(call, path, options) {
|
|
5
|
-
const ast = Query.from({ nodes: [path] }).select({ kind: 'graph' });
|
|
5
|
+
const ast = Query.from({ nodes: [queryNodePath(path)] }).select({ kind: 'graph' });
|
|
6
6
|
const response = await queryGraph(call, ast, { ...options, page: { size: 1 } });
|
|
7
7
|
const { result } = response;
|
|
8
8
|
if (result.kind !== 'graph')
|
|
@@ -10,9 +10,10 @@ export async function getNode(call, path, options) {
|
|
|
10
10
|
return result.graph.nodes[0] ?? null;
|
|
11
11
|
}
|
|
12
12
|
export async function requireNode(call, path, options) {
|
|
13
|
-
|
|
13
|
+
// Retain one immutable target across I/O, including unavailable-error rendering.
|
|
14
|
+
const target = queryNodePath(path);
|
|
15
|
+
const node = await getNode(call, target, options);
|
|
14
16
|
if (node === null)
|
|
15
|
-
throw new NodeUnavailableError(
|
|
17
|
+
throw new NodeUnavailableError(target);
|
|
16
18
|
return node;
|
|
17
19
|
}
|
|
18
|
-
//# sourceMappingURL=read.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Target, targetPath } from '@astrale-os/kernel-core/callable';
|
|
2
|
+
export { Client, call, type AuthenticatedClient, type Call, type ClientDispatchOptions, type ClientDispatchOptionsWithBody, type ClientOptions, type Binary, type BinaryResponse, type Input, type RemoteCredential, type Result, type Stream, type StreamResult, type ValueResult, } from './client/index.js';
|
|
2
3
|
export * from './errors/index.js';
|
|
3
|
-
export { type RequestOptions, type MissControl, type StaleControl, type Transport, type TransportRequest, type TransportResult, } from './transport/index.js';
|
|
4
|
+
export { type RequestOptions, type DeploymentRetired, type MissControl, type StaleControl, type Transport, type TransportRequest, type TransportResult, } from './transport/index.js';
|
|
4
5
|
export { HttpTransport, type Fetch, type HttpTransportOptions } from './transport/http/index.js';
|
|
5
6
|
export { WebSocketTransport, type WebSocketConstructor, type WebSocketTransportOptions, } from './transport/websocket/index.js';
|
|
6
7
|
export { AutoTransport, formatClientWarning, type AutoTransportOptions, type ClientWarning, } from './transport/auto/index.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export { Target, targetPath } from '@astrale-os/kernel-core/callable';
|
|
1
2
|
export { Client, call, } from './client/index.js';
|
|
2
3
|
export * from './errors/index.js';
|
|
3
4
|
export {} from './transport/index.js';
|
|
4
5
|
export { HttpTransport } from './transport/http/index.js';
|
|
5
6
|
export { WebSocketTransport, } from './transport/websocket/index.js';
|
|
6
7
|
export { AutoTransport, formatClientWarning, } from './transport/auto/index.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,4 +5,3 @@ export type BatchOptions<Value> = Omit<AsyncBatcherOptions<Value>, 'maxSize' | '
|
|
|
5
5
|
readonly wait?: number;
|
|
6
6
|
};
|
|
7
7
|
export declare function createBatcher<Value>(consume: (values: Value[]) => Promise<unknown>, options?: BatchOptions<Value>): AsyncBatcher<Value>;
|
|
8
|
-
//# sourceMappingURL=batcher.d.ts.map
|
package/dist/pacer/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { retry, type RetryOptions } from './retry/index.js';
|
|
|
2
2
|
export { createQueue, type QueueOptions } from './queue/index.js';
|
|
3
3
|
export { createBatcher, type BatchOptions } from './batcher/index.js';
|
|
4
4
|
export { createRateLimiter, type RateLimitOptions } from './limiter/index.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/pacer/index.js
CHANGED
|
@@ -5,4 +5,3 @@ export type RateLimitOptions<Operation extends AnyAsyncFunction> = Omit<AsyncRat
|
|
|
5
5
|
readonly window?: number;
|
|
6
6
|
};
|
|
7
7
|
export declare function createRateLimiter<Operation extends AnyAsyncFunction>(operation: Operation, options?: RateLimitOptions<Operation>): AsyncRateLimiter<Operation>;
|
|
8
|
-
//# sourceMappingURL=limiter.d.ts.map
|
|
@@ -4,4 +4,3 @@ export type QueueOptions<Value> = Omit<AsyncQueuerOptions<Value>, 'concurrency'>
|
|
|
4
4
|
readonly concurrency?: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function createQueue<Value>(consume: (value: Value) => Promise<unknown>, options?: QueueOptions<Value>): AsyncQueuer<Value>;
|
|
7
|
-
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare const DEFAULT_RETRY_MAX_WAIT_MS = 5000;
|
|
|
4
4
|
export declare const DEFAULT_RETRY_JITTER = 0.2;
|
|
5
5
|
export declare function positive(input: number, label: string): number;
|
|
6
6
|
export declare function nonNegative(input: number, label: string): number;
|
|
7
|
-
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/pool/index.d.ts
CHANGED
package/dist/pool/index.js
CHANGED
package/dist/pool/pool.d.ts
CHANGED
package/dist/pool/pool.js
CHANGED
package/dist/pool/target.d.ts
CHANGED
package/dist/pool/target.js
CHANGED
package/dist/schema/admission.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { installation } from '@astrale-os/kernel-core/schema';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DomainRequest as CoreDomainRequest, InstallInput, InstallReceipt as CoreInstallReceipt, UninstallInput, UninstallOutput } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
3
3
|
export type OperationId = installation.OperationId;
|
|
4
4
|
/** Canonical caller input accepted by the Kernel install syscall. */
|
|
5
|
-
export type
|
|
5
|
+
export type DomainRequest = CoreDomainRequest;
|
|
6
6
|
export type InstallRequest = InstallInput;
|
|
7
7
|
/** Admitted terminal install receipt returned by the Kernel. */
|
|
8
|
-
export type InstallReceipt =
|
|
8
|
+
export type InstallReceipt = CoreInstallReceipt;
|
|
9
9
|
/** Canonical caller input accepted by the Kernel uninstall syscall. */
|
|
10
10
|
export type UninstallRequest = UninstallInput;
|
|
11
11
|
/** Admitted terminal uninstall receipt returned by the Kernel. */
|
|
12
12
|
export type UninstallReceipt = UninstallOutput;
|
|
13
|
-
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/schema/contracts.js
CHANGED
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { createSchema, type SchemaApi, type SchemaCall, type SchemaOptions, type
|
|
1
|
+
export { createSchema, DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS, type SchemaApi, type SchemaCall, type SchemaOptions, type DomainBundle, type DomainDependencies, type DomainInfo, type InstalledPin, type InstalledRelease, type InstallResult, } from './schema.js';
|
|
2
2
|
export { acceptOperationId, createOperationId } from './operation.js';
|
|
3
|
-
export type {
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
3
|
+
export type { DomainRequest, InstallReceipt, InstallRequest, OperationId, UninstallReceipt, UninstallRequest, } from './contracts.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -3,4 +3,3 @@ import type * as protocol from '@astrale-os/kernel-protocol/schema';
|
|
|
3
3
|
import type { RequestOptions } from '../transport/index.js';
|
|
4
4
|
import type { SchemaCall, SchemaOptions } from './schema.js';
|
|
5
5
|
export declare function introspect<InputType extends language.Introspection>(invoke: SchemaCall, limits: SchemaOptions, request: InputType, options?: RequestOptions): Promise<protocol.installation.introspection.ResultFor<InputType>>;
|
|
6
|
-
//# sourceMappingURL=introspection.d.ts.map
|
|
@@ -8,9 +8,16 @@ export async function introspect(invoke, limits, request, options) {
|
|
|
8
8
|
if (result.kind !== 'binary') {
|
|
9
9
|
throw new TypeError('Schema introspection returned a non-binary result.');
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
const { mediaType } = result.value;
|
|
12
|
+
const decode = mediaType === schema.installation.introspection.MEDIA_TYPE
|
|
13
|
+
? schema.installation.introspection.decode
|
|
14
|
+
: undefined;
|
|
15
|
+
if (decode === undefined) {
|
|
12
16
|
throw new TypeError('Schema introspection returned an unsupported media type.');
|
|
13
17
|
}
|
|
14
|
-
|
|
18
|
+
if (!(result.value.body instanceof Uint8Array)) {
|
|
19
|
+
await result.value.body[Symbol.asyncIterator]().return?.();
|
|
20
|
+
throw new TypeError('Schema introspection returned a streaming binary result.');
|
|
21
|
+
}
|
|
22
|
+
return decode(request, result.value.body, limits);
|
|
15
23
|
}
|
|
16
|
-
//# sourceMappingURL=introspection.js.map
|
|
@@ -3,4 +3,3 @@ import type { OperationId } from './contracts.js';
|
|
|
3
3
|
export declare function acceptOperationId(input: unknown): OperationId;
|
|
4
4
|
/** Allocate one cryptographically generated operation identity for a new lifecycle request. */
|
|
5
5
|
export declare function createOperationId(): OperationId;
|
|
6
|
-
//# sourceMappingURL=operation.d.ts.map
|
package/dist/schema/operation.js
CHANGED
|
@@ -5,6 +5,5 @@ export function acceptOperationId(input) {
|
|
|
5
5
|
}
|
|
6
6
|
/** Allocate one cryptographically generated operation identity for a new lifecycle request. */
|
|
7
7
|
export function createOperationId() {
|
|
8
|
-
return acceptOperationId(
|
|
8
|
+
return acceptOperationId(crypto.randomUUID());
|
|
9
9
|
}
|
|
10
|
-
//# sourceMappingURL=operation.js.map
|
package/dist/schema/schema.d.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { Key } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import * as protocolSchema from '@astrale-os/kernel-protocol/schema';
|
|
3
3
|
import type { Call, Result } from '../client/index.js';
|
|
4
4
|
import type { RequestOptions } from '../transport/index.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { InstallRequest, UninstallReceipt, UninstallRequest } from './contracts.js';
|
|
6
6
|
export type SchemaCall = (call: Call, options?: RequestOptions) => Promise<Result>;
|
|
7
7
|
export interface SchemaOptions extends protocolSchema.installation.introspection.Limits {
|
|
8
|
+
readonly lifecycleTimeoutMs?: number;
|
|
8
9
|
}
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export type DomainInfo = protocolSchema.installation.introspection.DomainInfo;
|
|
11
|
+
export type DomainBundle = protocolSchema.installation.introspection.DomainBundle;
|
|
12
|
+
export type DomainDependencies = protocolSchema.installation.introspection.DomainDependencies;
|
|
13
|
+
export type InstalledRelease = protocolSchema.installation.introspection.InstalledRelease;
|
|
14
|
+
export type InstalledPin = protocolSchema.installation.introspection.InstalledPin;
|
|
15
|
+
export type InstallResult = protocolSchema.installation.InstallResult;
|
|
13
16
|
export interface SchemaApi {
|
|
14
|
-
install(request: InstallRequest, options?: RequestOptions): Promise<
|
|
17
|
+
install(request: InstallRequest, options?: RequestOptions): Promise<InstallResult>;
|
|
15
18
|
uninstall(request: UninstallRequest, options?: RequestOptions): Promise<UninstallReceipt>;
|
|
16
|
-
|
|
19
|
+
inspect(origin: Key.Origin, options?: RequestOptions): Promise<DomainInfo>;
|
|
20
|
+
bundle(origin: Key.Origin, options?: RequestOptions): Promise<DomainBundle>;
|
|
21
|
+
dependencies(origin: Key.Origin, options?: RequestOptions): Promise<DomainDependencies>;
|
|
22
|
+
installed(options?: RequestOptions): Promise<readonly InstalledRelease[]>;
|
|
17
23
|
}
|
|
24
|
+
export declare const DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS = 110000;
|
|
18
25
|
/** Bind the canonical Schema lifecycle syscalls to one caller-scoped value-call capability. */
|
|
19
26
|
export declare function createSchema(call: SchemaCall, limits: SchemaOptions): SchemaApi;
|
|
20
|
-
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema/schema.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
-
import {
|
|
2
|
+
import { uninstallOutput } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
3
3
|
import { install, uninstall } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
4
|
+
import * as protocolSchema from '@astrale-os/kernel-protocol/schema';
|
|
4
5
|
import { call as invocation } from '../client/index.js';
|
|
5
6
|
import { acceptOutput } from './admission.js';
|
|
6
|
-
import { introspect
|
|
7
|
+
import { introspect } from './introspection.js';
|
|
7
8
|
const INSTALL_PATH = Path.project(install).raw;
|
|
8
9
|
const UNINSTALL_PATH = Path.project(uninstall).raw;
|
|
10
|
+
export const DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS = 110_000;
|
|
9
11
|
/** Bind the canonical Schema lifecycle syscalls to one caller-scoped value-call capability. */
|
|
10
12
|
export function createSchema(call, limits) {
|
|
11
13
|
if (typeof call !== 'function')
|
|
@@ -13,32 +15,109 @@ export function createSchema(call, limits) {
|
|
|
13
15
|
const admittedLimits = admitLimits(limits);
|
|
14
16
|
return Object.freeze({
|
|
15
17
|
async install(request, options) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
+
const result = await call(invocation(INSTALL_PATH, request), lifecycleOptions(options, admittedLimits.lifecycleTimeoutMs));
|
|
19
|
+
if (result.kind !== 'binary') {
|
|
20
|
+
throw new TypeError('Schema install returned a non-binary result.');
|
|
21
|
+
}
|
|
22
|
+
const { mediaType } = result.value;
|
|
23
|
+
const decode = mediaType === protocolSchema.installation.MEDIA_TYPE
|
|
24
|
+
? protocolSchema.installation.decode
|
|
25
|
+
: undefined;
|
|
26
|
+
if (decode === undefined) {
|
|
27
|
+
throw new TypeError('Schema install returned an unsupported media type.');
|
|
28
|
+
}
|
|
29
|
+
if (!(result.value.body instanceof Uint8Array)) {
|
|
30
|
+
await result.value.body[Symbol.asyncIterator]().return?.();
|
|
31
|
+
throw new TypeError('Schema install returned a streaming binary result.');
|
|
32
|
+
}
|
|
33
|
+
const decoded = await decode(result.value.body, installationResultLimit(admittedLimits.maximumReleaseBytes, request.domains.length));
|
|
34
|
+
proveInstallResult(request, decoded);
|
|
35
|
+
return decoded;
|
|
18
36
|
},
|
|
19
37
|
async uninstall(request, options) {
|
|
20
|
-
const
|
|
21
|
-
|
|
38
|
+
const snapshot = snapshotUninstallRequest(request);
|
|
39
|
+
const output = value(await call(invocation(UNINSTALL_PATH, snapshot), lifecycleOptions(options, admittedLimits.lifecycleTimeoutMs)));
|
|
40
|
+
const receipt = acceptOutput(uninstallOutput, output);
|
|
41
|
+
proveUninstallReceipt(snapshot, receipt);
|
|
42
|
+
return receipt;
|
|
22
43
|
},
|
|
23
|
-
async
|
|
24
|
-
return
|
|
44
|
+
async inspect(origin, options) {
|
|
45
|
+
return introspect(call, admittedLimits, { kind: 'inspect', origin }, options);
|
|
25
46
|
},
|
|
47
|
+
async bundle(origin, options) {
|
|
48
|
+
return introspect(call, admittedLimits, { kind: 'bundle', origin }, options);
|
|
49
|
+
},
|
|
50
|
+
async dependencies(origin, options) {
|
|
51
|
+
return introspect(call, admittedLimits, { kind: 'dependencies', origin }, options);
|
|
52
|
+
},
|
|
53
|
+
async installed(options) {
|
|
54
|
+
return introspect(call, admittedLimits, { kind: 'installed' }, options);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function snapshotUninstallRequest(request) {
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
operation: request.operation,
|
|
61
|
+
domains: Object.freeze([...new Set(request.domains)].sort(compare)),
|
|
62
|
+
data: Object.freeze({ mode: request.data.mode }),
|
|
26
63
|
});
|
|
27
64
|
}
|
|
65
|
+
function proveUninstallReceipt(request, receipt) {
|
|
66
|
+
if (receipt.operation !== request.operation) {
|
|
67
|
+
throw new TypeError('Schema uninstall result does not match the requested operation.');
|
|
68
|
+
}
|
|
69
|
+
const actual = receipt.transitions.map((transition) => transition.intent.origin);
|
|
70
|
+
if (actual.length !== request.domains.length ||
|
|
71
|
+
actual.some((origin, index) => origin !== request.domains[index])) {
|
|
72
|
+
throw new TypeError('Schema uninstall result does not match the requested Domains.');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function compare(left, right) {
|
|
76
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
77
|
+
}
|
|
78
|
+
function installationResultLimit(maximumDomainBytes, roots) {
|
|
79
|
+
const perDomain = maximumDomainBytes + 4_096;
|
|
80
|
+
if (roots > Math.floor((Number.MAX_SAFE_INTEGER - 4_096) / perDomain)) {
|
|
81
|
+
return Number.MAX_SAFE_INTEGER;
|
|
82
|
+
}
|
|
83
|
+
return perDomain * roots + 4_096;
|
|
84
|
+
}
|
|
85
|
+
function proveInstallResult(request, result) {
|
|
86
|
+
if (result.changed) {
|
|
87
|
+
if (result.receipt.operation !== request.operation) {
|
|
88
|
+
throw new TypeError('Schema install result does not match the requested operation.');
|
|
89
|
+
}
|
|
90
|
+
if (result.receipt.transitions.length > request.domains.length) {
|
|
91
|
+
throw new TypeError('Schema install result contains more transitions than requested Domains.');
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (result.domains.length !== request.domains.length) {
|
|
96
|
+
throw new TypeError('Schema unchanged result does not match the requested Domain count.');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
28
99
|
function value(result) {
|
|
29
100
|
if (result.kind !== 'value')
|
|
30
101
|
throw new TypeError('Schema syscall returned a non-value result.');
|
|
31
102
|
return result.value;
|
|
32
103
|
}
|
|
33
104
|
function admitLimits(input) {
|
|
105
|
+
const lifecycleTimeoutMs = input?.lifecycleTimeoutMs ?? DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS;
|
|
34
106
|
if (input === null ||
|
|
35
107
|
typeof input !== 'object' ||
|
|
36
|
-
!Number.isSafeInteger(input.
|
|
37
|
-
input.
|
|
108
|
+
!Number.isSafeInteger(input.maximumReleaseBytes) ||
|
|
109
|
+
input.maximumReleaseBytes < 1 ||
|
|
38
110
|
!Number.isSafeInteger(input.maximumBundleBytes) ||
|
|
39
|
-
input.maximumBundleBytes < 1
|
|
111
|
+
input.maximumBundleBytes < 1 ||
|
|
112
|
+
!Number.isSafeInteger(lifecycleTimeoutMs) ||
|
|
113
|
+
lifecycleTimeoutMs < 1 ||
|
|
114
|
+
lifecycleTimeoutMs > 2_147_483_647) {
|
|
40
115
|
throw new TypeError('Schema introspection limits are invalid.');
|
|
41
116
|
}
|
|
42
|
-
return Object.freeze({ ...input });
|
|
117
|
+
return Object.freeze({ ...input, lifecycleTimeoutMs });
|
|
118
|
+
}
|
|
119
|
+
function lifecycleOptions(options, timeoutMs) {
|
|
120
|
+
if (options?.timeoutMs !== undefined)
|
|
121
|
+
return options;
|
|
122
|
+
return Object.freeze({ ...options, timeoutMs });
|
|
43
123
|
}
|
|
44
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { invocation } from '@astrale-os/kernel-protocol';
|
|
2
|
+
import type { FunctionAdmission } from '../auth/index.js';
|
|
3
|
+
import type { SessionOperation } from './context/index.js';
|
|
4
|
+
import type { ExchangeDependencies } from './exchange/index.js';
|
|
5
|
+
/** Check a remote Call through the existing Domain exchange and Kernel admission protocols. */
|
|
6
|
+
export declare function admitFunction(dependencies: ExchangeDependencies, call: invocation.Call, operation: SessionOperation): Promise<FunctionAdmission>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { targetPath } from '@astrale-os/kernel-core/callable';
|
|
2
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import { admitOutput } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
4
|
+
import { function as functions } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
5
|
+
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
6
|
+
import { ClientError } from '../errors/index.js';
|
|
7
|
+
import { runSessionOperation, sessionTransportOptions } from './context/index.js';
|
|
8
|
+
import { callableOrigin, exchangeDomainCredential, installedIssuer, isAuthority, } from './exchange/index.js';
|
|
9
|
+
import { matchesCallable } from './reference.js';
|
|
10
|
+
import { requireResultKind, resolveAuth } from './routing/index.js';
|
|
11
|
+
const ADMIT = Path.staticMethod(Path.project(functions.admit.owner), functions.admit.name);
|
|
12
|
+
/** Check a remote Call through the existing Domain exchange and Kernel admission protocols. */
|
|
13
|
+
export async function admitFunction(dependencies, call, operation) {
|
|
14
|
+
const target = Path.parse(targetPath(call.target));
|
|
15
|
+
const origin = callableOrigin(target);
|
|
16
|
+
if (origin === undefined) {
|
|
17
|
+
throw new ClientError('Function admission requires a Domain-qualified callable target.');
|
|
18
|
+
}
|
|
19
|
+
const effective = await resolveAuth(dependencies.auth, call, operation);
|
|
20
|
+
if (!isAuthority(effective)) {
|
|
21
|
+
throw new ClientError('Function admission requires an authenticated session.');
|
|
22
|
+
}
|
|
23
|
+
// Resolve once for the intended Call, then retain that exact caller across every helper syscall.
|
|
24
|
+
const domain = await installedIssuer(dependencies, origin, effective, operation);
|
|
25
|
+
if (domain === undefined) {
|
|
26
|
+
throw new ClientError('Function admission through token exchange requires a remote Domain.');
|
|
27
|
+
}
|
|
28
|
+
// The Kernel preserves the session caller when issuing the delegation.
|
|
29
|
+
const exchanged = await exchangeDomainCredential(dependencies, effective, { issuer: domain, ttlSeconds: effective.delegate.ttlSeconds }, operation);
|
|
30
|
+
const result = await runSessionOperation(operation, () => dependencies
|
|
31
|
+
.source()
|
|
32
|
+
.as(exchanged.credential)
|
|
33
|
+
.dispatch({ target: ADMIT, input: { call, credential: exchanged.delegation } }, { ...sessionTransportOptions(operation), delegate: effective.delegate }));
|
|
34
|
+
const output = admitOutput.parse(requireResultKind('value', result).value);
|
|
35
|
+
const callable = Key(output.callable);
|
|
36
|
+
if (!matchesCallable(target, callable)) {
|
|
37
|
+
throw new ClientError('Function admission returned a different callable.');
|
|
38
|
+
}
|
|
39
|
+
const receiver = output.receiver === undefined ? undefined : Path.parse(output.receiver);
|
|
40
|
+
const method = target.ast.steps.at(-1);
|
|
41
|
+
const instance = method?.kind === 'method' && method.dispatch === 'instance';
|
|
42
|
+
if (instance !== (receiver !== undefined) ||
|
|
43
|
+
(receiver !== undefined &&
|
|
44
|
+
(receiver.ast.anchor.kind !== 'id' ||
|
|
45
|
+
receiver.ast.steps.length !== 0 ||
|
|
46
|
+
(target.ast.anchor.kind === 'id' &&
|
|
47
|
+
target.ast.steps.length === 1 &&
|
|
48
|
+
receiver.ast.anchor.id !== target.ast.anchor.id)))) {
|
|
49
|
+
throw new ClientError('Function admission returned a different receiver.');
|
|
50
|
+
}
|
|
51
|
+
return Object.freeze({ callable, ...(receiver === undefined ? {} : { receiver: receiver.raw }) });
|
|
52
|
+
}
|