@astrale-os/kernel-client 0.6.0-beta.1 → 0.6.0-beta.10
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 +1 -2
- package/dist/auth/auth.js +0 -1
- package/dist/auth/authorization.d.ts +2 -3
- package/dist/auth/authorization.js +3 -4
- package/dist/auth/credential.d.ts +2 -3
- package/dist/auth/credential.js +5 -6
- package/dist/auth/identity.d.ts +2 -3
- package/dist/auth/identity.js +4 -5
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.js +0 -1
- package/dist/auth/provision.d.ts +0 -1
- package/dist/auth/provision.js +2 -3
- package/dist/client/admission.d.ts +0 -1
- package/dist/client/admission.js +0 -1
- package/dist/client/client.d.ts +7 -5
- package/dist/client/client.js +13 -5
- package/dist/client/credential.d.ts +4 -5
- package/dist/client/credential.js +0 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -2
- package/dist/client/request.d.ts +6 -4
- package/dist/client/request.js +20 -3
- package/dist/client/result.d.ts +35 -5
- package/dist/client/result.js +3 -4
- package/dist/client/routing-control.d.ts +3 -4
- package/dist/client/routing-control.js +4 -5
- package/dist/errors/client-error.d.ts +0 -1
- package/dist/errors/client-error.js +2 -1
- package/dist/errors/index.d.ts +7 -7
- package/dist/errors/index.js +7 -7
- package/dist/errors/miss-error.d.ts +3 -2
- package/dist/errors/miss-error.js +3 -2
- package/dist/errors/protocol-error.d.ts +6 -2
- package/dist/errors/protocol-error.js +2 -1
- package/dist/errors/response-error.d.ts +4 -3
- package/dist/errors/response-error.js +4 -3
- package/dist/errors/session-error.d.ts +9 -0
- package/dist/errors/session-error.js +9 -0
- package/dist/errors/stale-route-error.d.ts +3 -3
- package/dist/errors/stale-route-error.js +3 -2
- package/dist/errors/transport-error.d.ts +20 -5
- package/dist/errors/transport-error.js +11 -5
- package/dist/graph/domain/binding.d.ts +22 -0
- package/dist/graph/domain/binding.js +123 -0
- package/dist/graph/domain/domain.typecheck.d.ts +1 -0
- package/dist/graph/domain/domain.typecheck.js +139 -0
- package/dist/graph/domain/index.d.ts +3 -0
- package/dist/graph/domain/index.js +1 -0
- package/dist/graph/domain/model.d.ts +18 -0
- package/dist/graph/domain/model.js +1 -0
- package/dist/graph/domain/page.d.ts +23 -0
- package/dist/graph/domain/page.js +42 -0
- package/dist/graph/domain/project.d.ts +8 -0
- package/dist/graph/domain/project.js +120 -0
- package/dist/graph/domain/provenance.d.ts +6 -0
- package/dist/graph/domain/provenance.js +11 -0
- package/dist/graph/errors.d.ts +2 -3
- package/dist/graph/errors.js +2 -2
- package/dist/graph/graph.d.ts +9 -9
- package/dist/graph/graph.js +0 -1
- package/dist/graph/index.d.ts +2 -1
- package/dist/graph/index.js +1 -1
- package/dist/graph/mutation.d.ts +0 -1
- package/dist/graph/mutation.js +2 -3
- package/dist/graph/page/index.d.ts +0 -1
- package/dist/graph/page/index.js +0 -1
- package/dist/graph/page/neighbors.d.ts +4 -5
- package/dist/graph/page/neighbors.js +6 -7
- package/dist/graph/page/page.d.ts +6 -3
- package/dist/graph/page/page.js +0 -1
- package/dist/graph/page-contract.d.ts +13 -0
- package/dist/graph/page-contract.js +1 -0
- package/dist/graph/provenance.d.ts +12 -0
- package/dist/graph/provenance.js +37 -0
- package/dist/graph/query.d.ts +1 -2
- package/dist/graph/query.js +25 -13
- package/dist/graph/read.d.ts +3 -4
- package/dist/graph/read.js +1 -2
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -2
- 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 +12 -0
- package/dist/schema/admission.js +17 -0
- package/dist/schema/contracts.d.ts +12 -0
- package/dist/schema/contracts.js +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.js +2 -0
- package/dist/schema/introspection.d.ts +5 -0
- package/dist/schema/introspection.js +15 -0
- package/dist/schema/operation.d.ts +5 -0
- package/dist/schema/operation.js +9 -0
- package/dist/schema/schema.d.ts +19 -0
- package/dist/schema/schema.js +43 -0
- package/dist/session/bound.d.ts +44 -0
- package/dist/session/bound.js +75 -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 +1 -2
- package/dist/session/context/index.js +1 -2
- package/dist/session/context/limits.d.ts +0 -1
- package/dist/session/context/limits.js +0 -1
- package/dist/session/context/operation.d.ts +0 -1
- package/dist/session/context/operation.js +19 -17
- package/dist/session/context/policy.d.ts +3 -2
- package/dist/session/context/policy.js +12 -6
- package/dist/session/discovery/bundle.d.ts +0 -1
- package/dist/session/discovery/bundle.js +11 -11
- package/dist/session/discovery/discovery.d.ts +3 -11
- package/dist/session/discovery/discovery.js +6 -20
- package/dist/session/discovery/index.d.ts +3 -7
- package/dist/session/discovery/index.js +2 -2
- package/dist/session/discovery/publication.d.ts +7 -6
- package/dist/session/discovery/publication.js +25 -26
- package/dist/session/discovery/snapshot.d.ts +3 -3
- package/dist/session/discovery/snapshot.js +2 -3
- package/dist/session/discovery/transport.d.ts +6 -0
- package/dist/session/discovery/transport.js +13 -0
- package/dist/session/index.d.ts +6 -2
- package/dist/session/index.js +3 -2
- package/dist/session/reference.d.ts +36 -0
- package/dist/session/reference.js +74 -0
- package/dist/session/routing/auth.d.ts +1 -2
- package/dist/session/routing/auth.js +2 -6
- package/dist/session/routing/cache.d.ts +2 -2
- package/dist/session/routing/cache.js +9 -4
- package/dist/session/routing/dispatch.d.ts +6 -7
- package/dist/session/routing/dispatch.js +54 -18
- package/dist/session/routing/envelope.d.ts +0 -1
- package/dist/session/routing/envelope.js +0 -1
- package/dist/session/routing/expectation.d.ts +6 -0
- package/dist/session/routing/expectation.js +1 -0
- package/dist/session/routing/index.d.ts +1 -1
- package/dist/session/routing/index.js +0 -1
- package/dist/session/routing/request.d.ts +1 -2
- package/dist/session/routing/request.js +1 -2
- package/dist/session/session.d.ts +26 -15
- package/dist/session/session.js +87 -13
- package/dist/session/session.typecheck.d.ts +0 -1
- package/dist/session/session.typecheck.js +23 -2
- package/dist/session/views/catalog.d.ts +2 -3
- package/dist/session/views/catalog.js +14 -7
- package/dist/session/views/index.d.ts +0 -1
- package/dist/session/views/index.js +0 -1
- package/dist/session/views/resolve.d.ts +1 -3
- package/dist/session/views/resolve.js +4 -3
- package/dist/store/entity-index.d.ts +0 -1
- package/dist/store/entity-index.js +0 -1
- package/dist/store/index.d.ts +0 -1
- package/dist/store/index.js +0 -1
- package/dist/store/memory.d.ts +1 -2
- package/dist/store/memory.js +0 -1
- package/dist/store/mutation.d.ts +0 -1
- package/dist/store/mutation.js +0 -1
- 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 +1 -2
- package/dist/store/query-key.js +0 -1
- package/dist/store/shape.d.ts +1 -2
- package/dist/store/shape.js +0 -1
- package/dist/store/store.d.ts +1 -2
- package/dist/store/store.js +0 -1
- package/dist/store/store.typecheck.d.ts +0 -1
- package/dist/store/store.typecheck.js +3 -4
- package/dist/transport/auto/decision.d.ts +0 -1
- package/dist/transport/auto/decision.js +0 -1
- package/dist/transport/auto/fallback.d.ts +0 -1
- package/dist/transport/auto/fallback.js +8 -10
- 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 -1
- package/dist/transport/auto/transport.js +5 -6
- package/dist/transport/auto/warning.d.ts +0 -1
- package/dist/transport/auto/warning.js +0 -1
- package/dist/transport/deadline.d.ts +0 -1
- package/dist/transport/deadline.js +0 -1
- package/dist/transport/failure.d.ts +7 -0
- package/dist/transport/failure.js +9 -0
- package/dist/transport/http/index.d.ts +0 -1
- package/dist/transport/http/index.js +0 -1
- package/dist/transport/http/response.d.ts +2 -2
- package/dist/transport/http/response.js +2 -2
- package/dist/transport/http/stream.d.ts +6 -5
- package/dist/transport/http/stream.js +29 -12
- package/dist/transport/http/transport.d.ts +0 -1
- package/dist/transport/http/transport.js +46 -36
- package/dist/transport/index.d.ts +0 -1
- package/dist/transport/index.js +0 -1
- package/dist/transport/transport.d.ts +7 -2
- package/dist/transport/transport.js +0 -1
- package/dist/transport/websocket/connection.d.ts +3 -3
- package/dist/transport/websocket/connection.js +21 -34
- package/dist/transport/websocket/exchange.d.ts +7 -7
- package/dist/transport/websocket/exchange.js +50 -38
- 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 -1
- package/dist/transport/websocket/transport.js +9 -21
- package/package.json +25 -16
- 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.map +0 -1
- 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/domain/binding.d.ts +0 -25
- package/dist/domain/binding.d.ts.map +0 -1
- package/dist/domain/binding.js +0 -50
- package/dist/domain/binding.js.map +0 -1
- package/dist/domain/callable.d.ts +0 -23
- package/dist/domain/callable.d.ts.map +0 -1
- package/dist/domain/callable.js +0 -66
- package/dist/domain/callable.js.map +0 -1
- package/dist/domain/domain.typecheck.d.ts +0 -2
- package/dist/domain/domain.typecheck.d.ts.map +0 -1
- package/dist/domain/domain.typecheck.js +0 -69
- package/dist/domain/domain.typecheck.js.map +0 -1
- package/dist/domain/index.d.ts +0 -4
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js +0 -2
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/node.d.ts +0 -10
- package/dist/domain/node.d.ts.map +0 -1
- package/dist/domain/node.js +0 -6
- package/dist/domain/node.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/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/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/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/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.map +0 -1
- 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/index.d.ts.map +0 -1
- package/dist/session/index.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/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/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
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import type { IssuerId } from '@astrale-os/kernel-core/auth';
|
|
1
|
+
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
2
|
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Key } from '@astrale-os/kernel-dsl/v1';
|
|
4
|
+
import type { Domain } from '@astrale-os/kernel-dsl/v1/domain';
|
|
5
|
+
import type { Call, Input, Result } from '../client/index.js';
|
|
6
|
+
import type { DomainBinding, GraphApi } from '../graph/index.js';
|
|
5
7
|
import type { ClientFactory, ClientPool as ClientPoolType } from '../pool/index.js';
|
|
8
|
+
import type { ReadyInstallation, SchemaApi } from '../schema/index.js';
|
|
6
9
|
import type { ClientWarning } from '../transport/auto/index.js';
|
|
7
10
|
import type { Fetch } from '../transport/http/index.js';
|
|
8
11
|
import type { WebSocketConstructor } from '../transport/websocket/index.js';
|
|
9
12
|
import type { SessionControlOptions, SessionPolicy } from './context/index.js';
|
|
10
13
|
import type { SessionSnapshot } from './discovery/index.js';
|
|
14
|
+
import type { CallableReference, InputOfReference, OutputOfReference } from './reference.js';
|
|
11
15
|
import type { SessionAuth, SessionEnvelopeTransport, SessionRequestOptions } from './routing/index.js';
|
|
12
16
|
import type { ViewCatalog } from './views/index.js';
|
|
13
17
|
export interface ClientSessionOptions {
|
|
14
|
-
/**
|
|
15
|
-
readonly
|
|
16
|
-
/**
|
|
17
|
-
* Exact source Kernel identity when it is not represented by the root Publication discovered at
|
|
18
|
-
* the endpoint origin, as for a path-multiplexed managed child.
|
|
19
|
-
*/
|
|
20
|
-
readonly sourceIssuer?: IssuerId;
|
|
18
|
+
/** Exact canonical source Kernel identity; its invocation and discovery endpoints are derived. */
|
|
19
|
+
readonly kernel: string;
|
|
21
20
|
readonly fetch?: Fetch;
|
|
22
21
|
readonly client?: ClientFactory;
|
|
23
22
|
readonly pool?: Pick<ClientPoolType, 'clientFor'>;
|
|
@@ -31,9 +30,15 @@ export interface ClientSessionOptions {
|
|
|
31
30
|
readonly maximumResponseBytes?: number;
|
|
32
31
|
readonly timeoutMs?: number;
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
export declare class ClientSession {
|
|
33
|
+
export type ConnectOptions = Omit<ClientSessionOptions, 'kernel' | 'policy'> & {
|
|
36
34
|
readonly url: string;
|
|
35
|
+
readonly policy?: SessionPolicy;
|
|
36
|
+
};
|
|
37
|
+
/** Caller-owned discovery and redirect-following conversation with one exact source Kernel. */
|
|
38
|
+
export declare class ClientSession {
|
|
39
|
+
readonly kernel: IssuerId;
|
|
40
|
+
readonly schema: SchemaApi;
|
|
41
|
+
readonly graph: GraphApi;
|
|
37
42
|
private readonly ownedPool?;
|
|
38
43
|
private readonly discovery;
|
|
39
44
|
private readonly dispatcher;
|
|
@@ -43,14 +48,20 @@ export declare class ClientSession {
|
|
|
43
48
|
private readonly admitTargetViews;
|
|
44
49
|
private closed;
|
|
45
50
|
constructor(options: ClientSessionOptions);
|
|
51
|
+
/** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
|
|
52
|
+
bind<const DomainValue extends Domain>(domain: DomainValue): DomainBinding<DomainValue>;
|
|
46
53
|
snapshot(options?: SessionControlOptions): Promise<SessionSnapshot>;
|
|
47
54
|
viewsFor(target: PathLike, options?: SessionControlOptions): Promise<ViewCatalog>;
|
|
55
|
+
installation(origin: Key.Origin, options?: SessionControlOptions): Promise<ReadyInstallation>;
|
|
48
56
|
dispatch(call: Call, options?: SessionRequestOptions): Promise<Result>;
|
|
49
57
|
call(call: Call, options?: SessionRequestOptions): Promise<Input>;
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
invoke<const Reference extends CallableReference>(reference: Reference, input: InputOfReference<Reference>, options?: SessionRequestOptions): Promise<OutputOfReference<Reference>>;
|
|
59
|
+
stream(call: Call, options?: SessionRequestOptions): Promise<import("../client/result.js").Stream>;
|
|
60
|
+
binary(call: Call, options?: SessionRequestOptions): Promise<import("@astrale-os/kernel-core/callable").BinaryResult>;
|
|
52
61
|
close(): void;
|
|
53
62
|
private requireOpen;
|
|
63
|
+
private invokeDomainMethod;
|
|
54
64
|
private operation;
|
|
55
65
|
}
|
|
56
|
-
|
|
66
|
+
/** Open one caller-owned conversation with a Kernel using secure defaults. */
|
|
67
|
+
export declare function connect(options: ConnectOptions): ClientSession;
|
package/dist/session/session.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
2
|
import { Client } from '../client/index.js';
|
|
3
|
-
import { ClientError } from '../errors/index.js';
|
|
3
|
+
import { ClientError, SessionError } from '../errors/index.js';
|
|
4
|
+
import { createDomainBinding } from '../graph/domain/binding.js';
|
|
5
|
+
import { createGraph } from '../graph/index.js';
|
|
4
6
|
import { ClientPool } from '../pool/index.js';
|
|
7
|
+
import { createSchema } from '../schema/index.js';
|
|
5
8
|
import { AutoTransport } from '../transport/auto/index.js';
|
|
6
9
|
import { HttpTransport } from '../transport/http/index.js';
|
|
7
10
|
import { WebSocketTransport } from '../transport/websocket/index.js';
|
|
8
|
-
import { admitControlOptions, admitPolicy, createSessionOperation, DEFAULT_MAXIMUM_BUNDLE_BYTES, DEFAULT_MAXIMUM_PUBLICATION_BYTES, DEFAULT_MAXIMUM_RESPONSE_BYTES, DEFAULT_TIMEOUT_MS,
|
|
11
|
+
import { admitControlOptions, admitPolicy, createSessionOperation, DEFAULT_MAXIMUM_BUNDLE_BYTES, DEFAULT_MAXIMUM_PUBLICATION_BYTES, DEFAULT_MAXIMUM_RESPONSE_BYTES, DEFAULT_TIMEOUT_MS, admitKernel, kernelInvocationEndpoint, platformDuration, positive, } from './context/index.js';
|
|
9
12
|
import { createSessionDiscovery } from './discovery/index.js';
|
|
13
|
+
import { admitReference } from './reference.js';
|
|
10
14
|
import { admitEnvelopeTransport, admitRequestOptions, admitSessionAuth, requireResultKind, RouteCache, SessionDispatcher, } from './routing/index.js';
|
|
11
15
|
import { resolveViewsFor, targetViewCatalog } from './views/index.js';
|
|
12
|
-
|
|
16
|
+
const DEFAULT_SESSION_POLICY = Object.freeze({ maximumRouteAgeMs: 60_000 });
|
|
17
|
+
/** Caller-owned discovery and redirect-following conversation with one exact source Kernel. */
|
|
13
18
|
export class ClientSession {
|
|
14
|
-
|
|
19
|
+
kernel;
|
|
20
|
+
schema;
|
|
21
|
+
graph;
|
|
15
22
|
ownedPool;
|
|
16
23
|
discovery;
|
|
17
24
|
dispatcher;
|
|
@@ -26,8 +33,8 @@ export class ClientSession {
|
|
|
26
33
|
}
|
|
27
34
|
const policy = admitPolicy(options.policy);
|
|
28
35
|
this.admitTargetViews = (input) => targetViewCatalog(input, policy);
|
|
29
|
-
this.
|
|
30
|
-
const
|
|
36
|
+
this.kernel = admitKernel(options.kernel, policy.allowInsecureHttp === true);
|
|
37
|
+
const sourceEndpoint = kernelInvocationEndpoint(this.kernel);
|
|
31
38
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
32
39
|
if (typeof fetch !== 'function')
|
|
33
40
|
throw new TypeError('ClientSession requires Fetch.');
|
|
@@ -62,7 +69,7 @@ export class ClientSession {
|
|
|
62
69
|
pool = admitClientPool(options.pool);
|
|
63
70
|
}
|
|
64
71
|
this.discovery = createSessionDiscovery({
|
|
65
|
-
|
|
72
|
+
kernel: this.kernel,
|
|
66
73
|
fetch: fetchImpl,
|
|
67
74
|
policy,
|
|
68
75
|
maximumPublicationBytes,
|
|
@@ -72,8 +79,8 @@ export class ClientSession {
|
|
|
72
79
|
});
|
|
73
80
|
this.routes = new RouteCache(policy.maximumRouteAgeMs);
|
|
74
81
|
this.dispatcher = new SessionDispatcher({
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
kernel: this.kernel,
|
|
83
|
+
sourceEndpoint,
|
|
77
84
|
pool,
|
|
78
85
|
websocketAvailable,
|
|
79
86
|
auth: admitSessionAuth(options.auth),
|
|
@@ -83,6 +90,15 @@ export class ClientSession {
|
|
|
83
90
|
discovery: this.discovery,
|
|
84
91
|
requireOpen: () => this.requireOpen(),
|
|
85
92
|
});
|
|
93
|
+
this.schema = createSchema((request, options) => this.dispatch(request, options), {
|
|
94
|
+
maximumPublicationBytes,
|
|
95
|
+
maximumBundleBytes,
|
|
96
|
+
});
|
|
97
|
+
this.graph = createGraph((call, options) => this.call(call, options));
|
|
98
|
+
}
|
|
99
|
+
/** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
|
|
100
|
+
bind(domain) {
|
|
101
|
+
return createDomainBinding(domain, this.graph, (node, method, input) => this.invokeDomainMethod(domain, node, method, input));
|
|
86
102
|
}
|
|
87
103
|
snapshot(options) {
|
|
88
104
|
return this.discovery.snapshot(this.operation(admitControlOptions(options)));
|
|
@@ -91,6 +107,23 @@ export class ClientSession {
|
|
|
91
107
|
this.requireOpen();
|
|
92
108
|
return resolveViewsFor(async (call, operation) => requireResultKind('value', await this.dispatcher.dispatch(call, {}, operation)).value, this.admitTargetViews, target, this.operation(admitControlOptions(options)));
|
|
93
109
|
}
|
|
110
|
+
async installation(origin, options) {
|
|
111
|
+
const result = await this.schema.introspect({
|
|
112
|
+
from: { kind: 'installation', origin },
|
|
113
|
+
select: {
|
|
114
|
+
state: true,
|
|
115
|
+
target: true,
|
|
116
|
+
source: true,
|
|
117
|
+
bundle: true,
|
|
118
|
+
readiness: true,
|
|
119
|
+
capabilities: true,
|
|
120
|
+
},
|
|
121
|
+
}, options);
|
|
122
|
+
if (result?.state !== 'ready' || result.readiness === null) {
|
|
123
|
+
throw new ClientError(`Domain ${origin} is not ready on this Kernel.`);
|
|
124
|
+
}
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
94
127
|
dispatch(call, options) {
|
|
95
128
|
const admitted = admitRequestOptions(options);
|
|
96
129
|
return this.dispatcher.dispatch(call, admitted, this.operation(admitted));
|
|
@@ -99,6 +132,21 @@ export class ClientSession {
|
|
|
99
132
|
const result = await this.dispatch(call, options);
|
|
100
133
|
return requireResultKind('value', result).value;
|
|
101
134
|
}
|
|
135
|
+
async invoke(reference, input, options) {
|
|
136
|
+
const admittedReference = admitReference(reference);
|
|
137
|
+
const admittedOptions = admitRequestOptions(options);
|
|
138
|
+
const expected = Object.freeze({
|
|
139
|
+
origin: admittedReference.origin,
|
|
140
|
+
revision: admittedReference.revision,
|
|
141
|
+
});
|
|
142
|
+
const result = await this.dispatcher.dispatch({ target: admittedReference.target, input }, admittedOptions, this.operation(admittedOptions), expected);
|
|
143
|
+
const narrowed = requireResultKind(admittedReference.outputMode, result);
|
|
144
|
+
return (narrowed.kind === 'value'
|
|
145
|
+
? narrowed.value
|
|
146
|
+
: narrowed.kind === 'stream'
|
|
147
|
+
? narrowed.stream
|
|
148
|
+
: narrowed.value);
|
|
149
|
+
}
|
|
102
150
|
async stream(call, options) {
|
|
103
151
|
const result = await this.dispatch(call, options);
|
|
104
152
|
return requireResultKind('stream', result).stream;
|
|
@@ -111,20 +159,47 @@ export class ClientSession {
|
|
|
111
159
|
if (this.closed)
|
|
112
160
|
return;
|
|
113
161
|
this.closed = true;
|
|
114
|
-
this.lifecycle.abort(new
|
|
162
|
+
this.lifecycle.abort(new SessionError('ClientSession is closed.', { failure: 'closed' }));
|
|
115
163
|
this.ownedPool?.close();
|
|
116
164
|
this.routes.clear();
|
|
117
165
|
this.discovery.clear();
|
|
118
166
|
}
|
|
119
167
|
requireOpen() {
|
|
120
168
|
if (this.closed)
|
|
121
|
-
throw new
|
|
169
|
+
throw new SessionError('ClientSession is closed.', { failure: 'closed' });
|
|
170
|
+
}
|
|
171
|
+
invokeDomainMethod(domain, node, method, input) {
|
|
172
|
+
const diagnostics = method.validateInput(input);
|
|
173
|
+
if (diagnostics.length > 0)
|
|
174
|
+
throw new TypeError(`Method ${method.key} input is invalid.`);
|
|
175
|
+
const owner = domain.closure.find(({ origin }) => origin === method.owner.ref.origin);
|
|
176
|
+
if (owner === undefined)
|
|
177
|
+
throw new TypeError(`Method owner ${method.owner.ref.origin} is absent.`);
|
|
178
|
+
return this.invoke({
|
|
179
|
+
origin: owner.origin,
|
|
180
|
+
revision: owner.revision,
|
|
181
|
+
callable: method.key,
|
|
182
|
+
target: Path.instanceMethod(Path.id(node.id), method.name),
|
|
183
|
+
outputMode: method.output.mode,
|
|
184
|
+
}, input);
|
|
122
185
|
}
|
|
123
186
|
operation(options) {
|
|
124
187
|
this.requireOpen();
|
|
125
188
|
return createSessionOperation(this.lifecycle.signal, options, this.timeoutMs);
|
|
126
189
|
}
|
|
127
190
|
}
|
|
191
|
+
/** Open one caller-owned conversation with a Kernel using secure defaults. */
|
|
192
|
+
export function connect(options) {
|
|
193
|
+
if (options === null || typeof options !== 'object') {
|
|
194
|
+
throw new TypeError('Connect options are invalid.');
|
|
195
|
+
}
|
|
196
|
+
const { url, ...rest } = options;
|
|
197
|
+
return new ClientSession({
|
|
198
|
+
...rest,
|
|
199
|
+
kernel: url,
|
|
200
|
+
policy: options.policy ?? DEFAULT_SESSION_POLICY,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
128
203
|
function admitClientPool(input) {
|
|
129
204
|
if (input === null ||
|
|
130
205
|
typeof input !== 'object' ||
|
|
@@ -180,4 +255,3 @@ function defaultClientFactory(options) {
|
|
|
180
255
|
}
|
|
181
256
|
};
|
|
182
257
|
}
|
|
183
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import { defineSchema, method, nodeClass, schema } from '@astrale-os/kernel-dsl/v1';
|
|
4
|
+
import { ClientSession, reference } from './index.js';
|
|
2
5
|
void new ClientSession(options);
|
|
3
6
|
void auth;
|
|
4
7
|
void control;
|
|
@@ -6,5 +9,23 @@ void envelope;
|
|
|
6
9
|
void policy;
|
|
7
10
|
void request;
|
|
8
11
|
void snapshot;
|
|
12
|
+
const dynamicReference = reference(dynamicDomain, dynamicMethod)(Path.id(NodeId('dynamic-node')));
|
|
13
|
+
void session.invoke(dynamicReference, dynamicInput);
|
|
14
|
+
const dynamicInputIsClientInput = true;
|
|
15
|
+
const dynamicOutputIsUnknown = true;
|
|
16
|
+
void dynamicInputIsClientInput;
|
|
17
|
+
void dynamicOutputIsUnknown;
|
|
18
|
+
const abstractMethod = method({
|
|
19
|
+
auth: 'authenticated',
|
|
20
|
+
input: { type: 'null' },
|
|
21
|
+
output: { type: 'null' },
|
|
22
|
+
inheritance: 'abstract',
|
|
23
|
+
});
|
|
24
|
+
const abstractDomain = schema.resolve(defineSchema('client.reference.typecheck', {
|
|
25
|
+
classes: {
|
|
26
|
+
AbstractItem: nodeClass({ abstract: true, methods: { abstractMethod } }),
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
// @ts-expect-error Abstract Methods are declarations and cannot become Client references.
|
|
30
|
+
reference(abstractDomain, abstractDomain.classes.AbstractItem.methods.abstractMethod);
|
|
9
31
|
void {};
|
|
10
|
-
//# sourceMappingURL=session.typecheck.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Key, bundle } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import type { publication } from '@astrale-os/kernel-protocol';
|
|
3
|
-
import {
|
|
3
|
+
import { type ResolvedView } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
4
|
+
export type { ResolvedView } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
4
5
|
import type { SessionPolicy } from '../context/index.js';
|
|
5
6
|
/** One verified View declaration joined with its owning Publication and provenance. */
|
|
6
|
-
export type ResolvedView = syscalls.view.ResolvedView;
|
|
7
7
|
/** Immutable canonical-key-ordered inventory of Views resolved under one Session revision. */
|
|
8
8
|
export interface ViewCatalog {
|
|
9
9
|
readonly entrypoint?: ResolvedView;
|
|
@@ -13,4 +13,3 @@ export declare function rootViewCatalog(publication: publication.Publication, ar
|
|
|
13
13
|
export declare function catalogFromKeys(root: ViewCatalog, keys: readonly Key.View[]): ViewCatalog;
|
|
14
14
|
/** Re-admit one Runtime-resolved heterogeneous View catalog at the Client trust boundary. */
|
|
15
15
|
export declare function targetViewCatalog(input: unknown, policy: Readonly<SessionPolicy>): ViewCatalog;
|
|
16
|
-
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Key as ViewKey
|
|
1
|
+
import { acceptViewResolution, } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
2
|
+
import { Key as ViewKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import { ClientError } from '../../errors/index.js';
|
|
4
4
|
import { allowEndpoint } from '../context/index.js';
|
|
5
5
|
export function rootViewCatalog(publication, artifact, policy) {
|
|
6
6
|
const views = publication.bindings.views
|
|
7
7
|
.map((binding) => {
|
|
8
8
|
allowEndpoint(binding.href, policy);
|
|
9
|
-
const declaration = artifact.root.views[
|
|
9
|
+
const declaration = artifact.root.views[viewName(binding.view)];
|
|
10
10
|
if (declaration === undefined) {
|
|
11
11
|
throw new ClientError('Published View has no verified root declaration.');
|
|
12
12
|
}
|
|
13
|
+
const { ref: _ref, ...viewDeclaration } = declaration;
|
|
13
14
|
return Object.freeze({
|
|
14
15
|
key: binding.view,
|
|
15
|
-
declaration,
|
|
16
|
+
declaration: Object.freeze(viewDeclaration),
|
|
16
17
|
href: binding.href,
|
|
17
18
|
handshake: binding.handshake,
|
|
18
19
|
issuer: publication.identity.issuer,
|
|
@@ -25,7 +26,7 @@ export function rootViewCatalog(publication, artifact, policy) {
|
|
|
25
26
|
const entrypointRef = publication.manifest?.entrypoint;
|
|
26
27
|
const entrypoint = entrypointRef === undefined
|
|
27
28
|
? undefined
|
|
28
|
-
: catalogViews.find(({ key }) => key === ViewKey.of(
|
|
29
|
+
: catalogViews.find(({ key }) => key === ViewKey.of(entrypointRef));
|
|
29
30
|
if (entrypointRef !== undefined && entrypoint === undefined) {
|
|
30
31
|
throw new ClientError('Published View entrypoint has no verified Publication binding.');
|
|
31
32
|
}
|
|
@@ -48,7 +49,7 @@ export function catalogFromKeys(root, keys) {
|
|
|
48
49
|
export function targetViewCatalog(input, policy) {
|
|
49
50
|
let resolution;
|
|
50
51
|
try {
|
|
51
|
-
resolution =
|
|
52
|
+
resolution = acceptViewResolution(input);
|
|
52
53
|
}
|
|
53
54
|
catch (cause) {
|
|
54
55
|
throw new ClientError('Resolved View catalog is invalid.', { cause });
|
|
@@ -60,4 +61,10 @@ export function targetViewCatalog(input, policy) {
|
|
|
60
61
|
function compareKeys(left, right) {
|
|
61
62
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
function viewName(input) {
|
|
65
|
+
const coordinate = input.slice(input.indexOf(':') + 1);
|
|
66
|
+
const match = /^view\.([A-Za-z][A-Za-z0-9_]*)$/u.exec(coordinate);
|
|
67
|
+
if (match === null)
|
|
68
|
+
throw new ClientError('Published View key is invalid.');
|
|
69
|
+
return match[1];
|
|
70
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
2
|
-
import type { Input } from '
|
|
3
|
-
import type { Call } from '../../client/index.js';
|
|
2
|
+
import type { Call, Input } from '../../client/index.js';
|
|
4
3
|
import type { SessionOperation } from '../context/index.js';
|
|
5
4
|
import type { ViewCatalog } from './catalog.js';
|
|
6
5
|
export type ViewInvoker = (call: Call, operation: SessionOperation) => Promise<Input>;
|
|
@@ -10,4 +9,3 @@ export type ViewCatalogAdmission = (input: unknown) => ViewCatalog;
|
|
|
10
9
|
* its heterogeneous installed-Publication projection.
|
|
11
10
|
*/
|
|
12
11
|
export declare function resolveViewsFor(invoke: ViewInvoker, admitCatalog: ViewCatalogAdmission, target: PathLike, operation: SessionOperation): Promise<ViewCatalog>;
|
|
13
|
-
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
-
import {
|
|
2
|
+
import { view } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
3
|
import { call } from '../../client/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Invoke Runtime-owned target View resolution through the canonical source Kernel call, then admit
|
|
@@ -7,6 +7,7 @@ import { call } from '../../client/index.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export async function resolveViewsFor(invoke, admitCatalog, target, operation) {
|
|
9
9
|
const path = Path.from(target).raw;
|
|
10
|
-
|
|
10
|
+
const owner = Path.project(view.resolve.owner);
|
|
11
|
+
const targetView = Path.staticMethod(owner, view.resolve.name);
|
|
12
|
+
return admitCatalog(await invoke(call(targetView, { target: path }), operation));
|
|
11
13
|
}
|
|
12
|
-
//# sourceMappingURL=resolve.js.map
|
package/dist/store/index.d.ts
CHANGED
package/dist/store/index.js
CHANGED
package/dist/store/memory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QueryAST } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
-
import type { QueryPageRequest } from '
|
|
2
|
+
import type { QueryPageRequest } from '../graph/index.js';
|
|
3
3
|
import type { GraphApi } from '../graph/index.js';
|
|
4
4
|
import type { StoreQueryResponse, StoreReadOptions, StoreSnapshot } from './store.js';
|
|
5
5
|
import { ClientError } from '../errors/index.js';
|
|
@@ -46,4 +46,3 @@ export declare class GraphMemory {
|
|
|
46
46
|
private drain;
|
|
47
47
|
private report;
|
|
48
48
|
}
|
|
49
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/dist/store/memory.js
CHANGED
package/dist/store/mutation.d.ts
CHANGED
|
@@ -3,4 +3,3 @@ import type { GraphApi, MutationAuthor } from '../graph/index.js';
|
|
|
3
3
|
import type { GraphMemory } from './memory.js';
|
|
4
4
|
import type { StoreMutationOptions } from './store.js';
|
|
5
5
|
export declare function mutateStore(graph: GraphApi, memory: GraphMemory, input: MutationAuthor | MutationASTValue | MutationInput, options?: StoreMutationOptions): Promise<MutationResult>;
|
|
6
|
-
//# sourceMappingURL=mutation.d.ts.map
|
package/dist/store/mutation.js
CHANGED
package/dist/store/observe.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { StoreQuery, StoreReadOptions, StoreSnapshot } from './store.js';
|
|
2
2
|
import type { GraphStore } from './store.js';
|
|
3
3
|
export declare function observeStore<Query extends StoreQuery>(store: GraphStore, query: Query, listener: (snapshot: StoreSnapshot<Query>) => void, options: StoreReadOptions): () => void;
|
|
4
|
-
//# sourceMappingURL=observe.d.ts.map
|
package/dist/store/observe.js
CHANGED
package/dist/store/optimistic.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { QueryAST as QueryASTValue } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
-
import type { QueryPageRequest } from '
|
|
2
|
+
import type { QueryPageRequest } from '../graph/index.js';
|
|
3
3
|
export declare function admitQuery(input: QueryASTValue): QueryASTValue;
|
|
4
4
|
export declare function admitPage(input: QueryPageRequest): QueryPageRequest;
|
|
5
5
|
export declare function queryKey(ast: QueryASTValue, page: QueryPageRequest): string;
|
|
6
|
-
//# sourceMappingURL=query-key.d.ts.map
|
package/dist/store/query-key.js
CHANGED
package/dist/store/shape.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
2
|
import type { QueryAST } from '@astrale-os/kernel-core/graph/query';
|
|
3
|
-
import type { QueryPageRequest } from '
|
|
3
|
+
import type { QueryPageRequest } from '../graph/index.js';
|
|
4
4
|
import type { FactReferences } from './entity-index.js';
|
|
5
5
|
import type { StoreQueryResponse, StoreSnapshot } from './store.js';
|
|
6
6
|
export type ShapeState = StoreSnapshot['state'];
|
|
@@ -23,4 +23,3 @@ export declare class QueryShape {
|
|
|
23
23
|
referencesAny(nodes: ReadonlySet<NodeId>, edges: ReadonlySet<string>): boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare const COLD_SNAPSHOT: StoreSnapshot;
|
|
26
|
-
//# sourceMappingURL=shape.d.ts.map
|
package/dist/store/shape.js
CHANGED
package/dist/store/store.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MutationAST, MutationInput, MutationResult } from '@astrale-os/kernel-core/graph/mutate';
|
|
2
2
|
import type { QueryAST, QueryResultFor } from '@astrale-os/kernel-core/graph/query';
|
|
3
|
-
import type { QueryResponse } from '
|
|
3
|
+
import type { QueryResponse } from '../graph/index.js';
|
|
4
4
|
import type { GraphApi, GraphQueryOptions, MutationAuthor } from '../graph/index.js';
|
|
5
5
|
import type { RequestOptions } from '../transport/index.js';
|
|
6
6
|
export type StoreQuery = QueryAST;
|
|
@@ -66,4 +66,3 @@ export declare class GraphStore {
|
|
|
66
66
|
private identity;
|
|
67
67
|
private requireOpen;
|
|
68
68
|
}
|
|
69
|
-
//# sourceMappingURL=store.d.ts.map
|
package/dist/store/store.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Query } from '../graph/index.js';
|
|
2
2
|
const options = { page: { size: 32 } };
|
|
3
|
-
const nodeGraph = Query.from({
|
|
4
|
-
const nodeProjection = Query.from({
|
|
3
|
+
const nodeGraph = Query.from({ nodes: [path] }).select({ kind: 'graph' });
|
|
4
|
+
const nodeProjection = Query.from({ nodes: [path] }).select({
|
|
5
5
|
kind: 'nodes',
|
|
6
6
|
projection: { kind: 'reference' },
|
|
7
7
|
});
|
|
8
|
-
const edgeSource = Query.from({
|
|
8
|
+
const edgeSource = Query.from({ edges: [edge] });
|
|
9
9
|
const edgeProjection = edgeSource.select({
|
|
10
10
|
kind: 'edges',
|
|
11
11
|
projection: { edge: 'reference', source: 'value', target: 'reference' },
|
|
@@ -38,4 +38,3 @@ store.observe(nodeGraph, () => undefined);
|
|
|
38
38
|
// @ts-expect-error watch is reserved for a future remote-liveness protocol.
|
|
39
39
|
store.watch(nodeGraph, () => undefined, options);
|
|
40
40
|
void {};
|
|
41
|
-
//# sourceMappingURL=store.typecheck.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransportError } from '../../errors/index.js';
|
|
2
|
+
import { invocationFailure } from '../failure.js';
|
|
2
3
|
import { positiveInteger } from '../index.js';
|
|
3
4
|
const MAXIMUM_TIMEOUT_MS = 2_147_483_647;
|
|
4
5
|
/** One invocation-owned total timeout budget shared by selection and fallback. */
|
|
@@ -33,10 +34,7 @@ export class InvocationBudget {
|
|
|
33
34
|
let timer;
|
|
34
35
|
let abort;
|
|
35
36
|
const interrupted = new Promise((_resolve, reject) => {
|
|
36
|
-
timer = setTimeout(() => reject(
|
|
37
|
-
phase: 'timeout',
|
|
38
|
-
delivery: 'not-sent',
|
|
39
|
-
})), remaining);
|
|
37
|
+
timer = setTimeout(() => reject(invocationFailure('Automatic transport decision exceeded its timeout.', 'timeout')), remaining);
|
|
40
38
|
if (this.input?.signal) {
|
|
41
39
|
abort = () => reject(abortReason(this.input.signal));
|
|
42
40
|
this.input.signal.addEventListener('abort', abort, { once: true });
|
|
@@ -55,16 +53,17 @@ export class InvocationBudget {
|
|
|
55
53
|
remaining() {
|
|
56
54
|
const remaining = Math.min(MAXIMUM_TIMEOUT_MS, this.timeoutMs - (Date.now() - this.started));
|
|
57
55
|
if (remaining < 1) {
|
|
58
|
-
throw
|
|
59
|
-
phase: 'timeout',
|
|
60
|
-
delivery: 'not-sent',
|
|
61
|
-
});
|
|
56
|
+
throw invocationFailure('Automatic transport invocation exceeded its timeout.', 'timeout');
|
|
62
57
|
}
|
|
63
58
|
return remaining;
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
61
|
export function mayFallback(error) {
|
|
67
|
-
return error instanceof TransportError &&
|
|
62
|
+
return (error instanceof TransportError &&
|
|
63
|
+
error.context.kind === 'invocation' &&
|
|
64
|
+
error.context.delivery === 'not-sent' &&
|
|
65
|
+
error.phase !== 'closed' &&
|
|
66
|
+
error.phase !== 'timeout');
|
|
68
67
|
}
|
|
69
68
|
export function warningTarget(input) {
|
|
70
69
|
return input.call.target;
|
|
@@ -74,4 +73,3 @@ function abortReason(signal) {
|
|
|
74
73
|
? signal.reason
|
|
75
74
|
: new Error(signal.reason === undefined ? 'request was cancelled' : String(signal.reason));
|
|
76
75
|
}
|
|
77
|
-
//# sourceMappingURL=fallback.js.map
|