@astrale-os/kernel-client 0.5.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 +18 -0
- package/dist/auth/auth.js +15 -0
- package/dist/auth/authorization.d.ts +13 -0
- package/dist/auth/authorization.js +17 -0
- package/dist/auth/credential.d.ts +19 -0
- package/dist/auth/credential.js +21 -0
- package/dist/auth/identity.d.ts +14 -0
- package/dist/auth/identity.js +15 -0
- package/dist/auth/index.d.ts +6 -16
- package/dist/auth/index.js +5 -10
- package/dist/auth/provision.d.ts +8 -0
- package/dist/auth/provision.js +10 -0
- package/dist/client/admission.d.ts +4 -0
- package/dist/client/admission.js +34 -0
- package/dist/client/client.d.ts +24 -109
- package/dist/client/client.js +80 -381
- package/dist/client/credential.d.ts +12 -0
- package/dist/client/credential.js +51 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +4 -0
- package/dist/client/request.d.ts +26 -0
- package/dist/client/request.js +100 -0
- package/dist/client/result.d.ts +35 -0
- package/dist/client/result.js +28 -0
- package/dist/client/routing-control.d.ts +10 -0
- package/dist/client/routing-control.js +23 -0
- package/dist/errors/client-error.d.ts +3 -0
- package/dist/errors/client-error.js +8 -0
- package/dist/errors/index.d.ts +7 -6
- package/dist/errors/index.js +7 -4
- package/dist/errors/miss-error.d.ts +8 -0
- package/dist/errors/miss-error.js +10 -0
- package/dist/errors/protocol-error.d.ts +9 -0
- package/dist/errors/protocol-error.js +9 -0
- package/dist/errors/response-error.d.ts +11 -0
- package/dist/errors/response-error.js +16 -0
- package/dist/errors/session-error.d.ts +8 -20
- package/dist/errors/session-error.js +6 -22
- package/dist/errors/stale-route-error.d.ts +9 -0
- package/dist/errors/stale-route-error.js +12 -0
- package/dist/errors/transport-error.d.ts +30 -0
- package/dist/errors/transport-error.js +18 -0
- 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 +8 -0
- package/dist/graph/errors.js +14 -0
- package/dist/graph/graph.d.ts +26 -0
- package/dist/graph/graph.js +18 -0
- package/dist/graph/index.d.ts +8 -26
- package/dist/graph/index.js +6 -21
- package/dist/graph/mutation.d.ts +5 -0
- package/dist/graph/mutation.js +17 -0
- package/dist/graph/page/index.d.ts +2 -0
- package/dist/graph/page/index.js +1 -0
- package/dist/graph/page/neighbors.d.ts +9 -0
- package/dist/graph/page/neighbors.js +34 -0
- package/dist/graph/page/page.d.ts +37 -0
- package/dist/graph/page/page.js +55 -0
- 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 +4 -0
- package/dist/graph/query.js +69 -0
- package/dist/graph/read.d.ts +6 -0
- package/dist/graph/read.js +17 -0
- package/dist/index.d.ts +6 -25
- package/dist/index.js +6 -21
- package/dist/pacer/batcher/batcher.d.ts +7 -0
- package/dist/pacer/batcher/batcher.js +13 -0
- package/dist/pacer/batcher/defaults.d.ts +2 -0
- package/dist/pacer/batcher/defaults.js +2 -0
- package/dist/pacer/batcher/index.d.ts +1 -0
- package/dist/pacer/batcher/index.js +1 -0
- package/dist/pacer/index.d.ts +4 -10
- package/dist/pacer/index.js +4 -11
- package/dist/pacer/limiter/defaults.d.ts +2 -0
- package/dist/pacer/limiter/defaults.js +2 -0
- package/dist/pacer/limiter/index.d.ts +1 -0
- package/dist/pacer/limiter/index.js +1 -0
- package/dist/pacer/limiter/limiter.d.ts +7 -0
- package/dist/pacer/limiter/limiter.js +14 -0
- package/dist/pacer/queue/defaults.d.ts +1 -0
- package/dist/pacer/queue/defaults.js +1 -0
- package/dist/pacer/queue/index.d.ts +1 -0
- package/dist/pacer/queue/index.js +1 -0
- package/dist/pacer/queue/queue.d.ts +6 -0
- package/dist/pacer/queue/queue.js +12 -0
- package/dist/pacer/retry/defaults.d.ts +6 -0
- package/dist/pacer/retry/defaults.js +16 -0
- package/dist/pacer/retry/index.d.ts +1 -0
- package/dist/pacer/retry/index.js +1 -0
- package/dist/pacer/retry/retry.d.ts +9 -0
- package/dist/pacer/retry/retry.js +55 -0
- package/dist/pool/index.d.ts +2 -4
- package/dist/pool/index.js +0 -2
- package/dist/pool/pool.d.ts +19 -59
- package/dist/pool/pool.js +46 -64
- package/dist/pool/target.d.ts +15 -0
- package/dist/pool/target.js +49 -0
- 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 -16
- package/dist/schema/index.js +2 -12
- 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 +42 -9
- package/dist/session/bound.js +70 -37
- package/dist/session/context/control.d.ts +5 -0
- package/dist/session/context/control.js +17 -0
- package/dist/session/context/index.d.ts +4 -0
- package/dist/session/context/index.js +4 -0
- package/dist/session/context/limits.d.ts +7 -0
- package/dist/session/context/limits.js +18 -0
- package/dist/session/context/operation.d.ts +19 -0
- package/dist/session/context/operation.js +72 -0
- package/dist/session/context/policy.d.ts +11 -0
- package/dist/session/context/policy.js +69 -0
- package/dist/session/discovery/bundle.d.ts +17 -0
- package/dist/session/discovery/bundle.js +55 -0
- package/dist/session/discovery/discovery.d.ts +19 -0
- package/dist/session/discovery/discovery.js +55 -0
- package/dist/session/discovery/index.d.ts +20 -0
- package/dist/session/discovery/index.js +15 -0
- package/dist/session/discovery/publication.d.ts +23 -0
- package/dist/session/discovery/publication.js +123 -0
- package/dist/session/discovery/snapshot.d.ts +12 -0
- package/dist/session/discovery/snapshot.js +3 -0
- package/dist/session/discovery/transport.d.ts +6 -0
- package/dist/session/discovery/transport.js +13 -0
- package/dist/session/index.d.ts +10 -16
- package/dist/session/index.js +3 -9
- package/dist/session/reference.d.ts +36 -0
- package/dist/session/reference.js +74 -0
- package/dist/session/routing/auth.d.ts +18 -0
- package/dist/session/routing/auth.js +39 -0
- package/dist/session/routing/cache.d.ts +20 -0
- package/dist/session/routing/cache.js +115 -0
- package/dist/session/routing/dispatch.d.ts +34 -0
- package/dist/session/routing/dispatch.js +137 -0
- package/dist/session/routing/envelope.d.ts +13 -0
- package/dist/session/routing/envelope.js +35 -0
- package/dist/session/routing/expectation.d.ts +6 -0
- package/dist/session/routing/expectation.js +1 -0
- package/dist/session/routing/index.d.ts +6 -0
- package/dist/session/routing/index.js +5 -0
- package/dist/session/routing/request.d.ts +8 -0
- package/dist/session/routing/request.js +25 -0
- package/dist/session/session.d.ts +67 -0
- package/dist/session/session.js +257 -0
- package/dist/session/session.typecheck.d.ts +1 -0
- package/dist/session/session.typecheck.js +31 -0
- package/dist/session/views/catalog.d.ts +15 -0
- package/dist/session/views/catalog.js +70 -0
- package/dist/session/views/index.d.ts +2 -0
- package/dist/session/views/index.js +2 -0
- package/dist/session/views/resolve.d.ts +11 -0
- package/dist/session/views/resolve.js +13 -0
- package/dist/store/entity-index.d.ts +22 -0
- package/dist/store/entity-index.js +94 -0
- package/dist/store/index.d.ts +1 -26
- package/dist/store/index.js +1 -19
- package/dist/store/memory.d.ts +46 -97
- package/dist/store/memory.js +346 -763
- package/dist/store/mutation.d.ts +5 -0
- package/dist/store/mutation.js +34 -0
- package/dist/store/observe.d.ts +3 -0
- package/dist/store/observe.js +17 -0
- package/dist/store/optimistic.d.ts +12 -0
- package/dist/store/optimistic.js +43 -0
- package/dist/store/query-key.d.ts +5 -0
- package/dist/store/query-key.js +22 -0
- package/dist/store/shape.d.ts +25 -0
- package/dist/store/shape.js +29 -0
- package/dist/store/store.d.ts +68 -0
- package/dist/store/store.js +144 -0
- package/dist/store/store.typecheck.d.ts +1 -0
- package/dist/store/store.typecheck.js +40 -0
- package/dist/transport/auto/decision.d.ts +22 -0
- package/dist/transport/auto/decision.js +48 -0
- package/dist/transport/auto/fallback.d.ts +16 -0
- package/dist/transport/auto/fallback.js +75 -0
- package/dist/transport/auto/index.d.ts +2 -0
- package/dist/transport/auto/index.js +2 -0
- package/dist/transport/auto/transport.d.ts +37 -0
- package/dist/transport/auto/transport.js +140 -0
- package/dist/transport/auto/warning.d.ts +13 -0
- package/dist/transport/auto/warning.js +18 -0
- package/dist/transport/deadline.d.ts +11 -0
- package/dist/transport/deadline.js +39 -0
- package/dist/transport/failure.d.ts +7 -0
- package/dist/transport/failure.js +9 -0
- package/dist/transport/http/index.d.ts +1 -0
- package/dist/transport/http/index.js +1 -0
- package/dist/transport/http/response.d.ts +8 -0
- package/dist/transport/http/response.js +79 -0
- package/dist/transport/http/stream.d.ts +26 -0
- package/dist/transport/http/stream.js +214 -0
- package/dist/transport/http/transport.d.ts +32 -0
- package/dist/transport/http/transport.js +343 -0
- package/dist/transport/index.d.ts +2 -8
- package/dist/transport/index.js +1 -6
- package/dist/transport/transport.d.ts +34 -0
- package/dist/transport/transport.js +1 -0
- package/dist/transport/websocket/connection.d.ts +38 -0
- package/dist/transport/websocket/connection.js +284 -0
- package/dist/transport/websocket/exchange.d.ts +46 -0
- package/dist/transport/websocket/exchange.js +300 -0
- package/dist/transport/websocket/index.d.ts +1 -0
- package/dist/transport/websocket/index.js +1 -0
- package/dist/transport/websocket/transport.d.ts +46 -0
- package/dist/transport/websocket/transport.js +164 -0
- package/package.json +41 -35
- package/dist/auth/addressing.d.ts +0 -32
- package/dist/auth/addressing.d.ts.map +0 -1
- package/dist/auth/addressing.js +0 -36
- package/dist/auth/addressing.js.map +0 -1
- package/dist/auth/api.d.ts +0 -70
- package/dist/auth/api.d.ts.map +0 -1
- package/dist/auth/api.js +0 -36
- package/dist/auth/api.js.map +0 -1
- package/dist/auth/batch.d.ts +0 -18
- package/dist/auth/batch.d.ts.map +0 -1
- package/dist/auth/batch.js +0 -25
- package/dist/auth/batch.js.map +0 -1
- package/dist/auth/composition.d.ts +0 -27
- package/dist/auth/composition.d.ts.map +0 -1
- package/dist/auth/composition.js +0 -83
- package/dist/auth/composition.js.map +0 -1
- package/dist/auth/defaults.d.ts +0 -3
- package/dist/auth/defaults.d.ts.map +0 -1
- package/dist/auth/defaults.js +0 -3
- package/dist/auth/defaults.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/minting.d.ts +0 -35
- package/dist/auth/minting.d.ts.map +0 -1
- package/dist/auth/minting.js +0 -31
- package/dist/auth/minting.js.map +0 -1
- package/dist/auth/permissions.d.ts +0 -55
- package/dist/auth/permissions.d.ts.map +0 -1
- package/dist/auth/permissions.js +0 -47
- package/dist/auth/permissions.js.map +0 -1
- package/dist/auth/principal.d.ts +0 -19
- package/dist/auth/principal.d.ts.map +0 -1
- package/dist/auth/principal.js +0 -46
- package/dist/auth/principal.js.map +0 -1
- package/dist/auth/shorthands.d.ts +0 -19
- package/dist/auth/shorthands.d.ts.map +0 -1
- package/dist/auth/shorthands.js +0 -27
- package/dist/auth/shorthands.js.map +0 -1
- package/dist/client/batch.d.ts +0 -26
- package/dist/client/batch.d.ts.map +0 -1
- package/dist/client/batch.js +0 -8
- package/dist/client/batch.js.map +0 -1
- package/dist/client/bound.d.ts +0 -27
- package/dist/client/bound.d.ts.map +0 -1
- package/dist/client/bound.js +0 -14
- package/dist/client/bound.js.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js.map +0 -1
- package/dist/client/config.d.ts +0 -112
- package/dist/client/config.d.ts.map +0 -1
- package/dist/client/config.js +0 -10
- package/dist/client/config.js.map +0 -1
- package/dist/client/fn-map.d.ts +0 -61
- package/dist/client/fn-map.d.ts.map +0 -1
- package/dist/client/fn-map.js +0 -2
- package/dist/client/fn-map.js.map +0 -1
- package/dist/client/freeze.d.ts +0 -32
- package/dist/client/freeze.d.ts.map +0 -1
- package/dist/client/freeze.js +0 -42
- package/dist/client/freeze.js.map +0 -1
- package/dist/client/hooks.d.ts +0 -49
- package/dist/client/hooks.d.ts.map +0 -1
- package/dist/client/hooks.js +0 -2
- package/dist/client/hooks.js.map +0 -1
- package/dist/errors/errors.d.ts +0 -156
- package/dist/errors/errors.d.ts.map +0 -1
- package/dist/errors/errors.js +0 -238
- package/dist/errors/errors.js.map +0 -1
- package/dist/errors/guards.d.ts +0 -39
- package/dist/errors/guards.d.ts.map +0 -1
- package/dist/errors/guards.js +0 -127
- package/dist/errors/guards.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.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/graph/api.d.ts +0 -85
- package/dist/graph/api.d.ts.map +0 -1
- package/dist/graph/api.js +0 -66
- package/dist/graph/api.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/mutate/builder.d.ts +0 -108
- package/dist/graph/mutate/builder.d.ts.map +0 -1
- package/dist/graph/mutate/builder.js +0 -127
- package/dist/graph/mutate/builder.js.map +0 -1
- package/dist/graph/mutate/index.d.ts +0 -5
- package/dist/graph/mutate/index.d.ts.map +0 -1
- package/dist/graph/mutate/index.js +0 -3
- package/dist/graph/mutate/index.js.map +0 -1
- package/dist/graph/mutate/shorthands.d.ts +0 -42
- package/dist/graph/mutate/shorthands.d.ts.map +0 -1
- package/dist/graph/mutate/shorthands.js +0 -65
- package/dist/graph/mutate/shorthands.js.map +0 -1
- package/dist/graph/named.d.ts +0 -38
- package/dist/graph/named.d.ts.map +0 -1
- package/dist/graph/named.js +0 -47
- package/dist/graph/named.js.map +0 -1
- package/dist/graph/query/builder.d.ts +0 -116
- package/dist/graph/query/builder.d.ts.map +0 -1
- package/dist/graph/query/builder.js +0 -136
- package/dist/graph/query/builder.js.map +0 -1
- package/dist/graph/query/edge-ref.d.ts +0 -13
- package/dist/graph/query/edge-ref.d.ts.map +0 -1
- package/dist/graph/query/edge-ref.js +0 -56
- package/dist/graph/query/edge-ref.js.map +0 -1
- package/dist/graph/query/edges.d.ts +0 -10
- package/dist/graph/query/edges.d.ts.map +0 -1
- package/dist/graph/query/edges.js +0 -11
- package/dist/graph/query/edges.js.map +0 -1
- package/dist/graph/query/errors.d.ts +0 -31
- package/dist/graph/query/errors.d.ts.map +0 -1
- package/dist/graph/query/errors.js +0 -28
- package/dist/graph/query/errors.js.map +0 -1
- package/dist/graph/query/filter.d.ts +0 -50
- package/dist/graph/query/filter.d.ts.map +0 -1
- package/dist/graph/query/filter.js +0 -32
- package/dist/graph/query/filter.js.map +0 -1
- package/dist/graph/query/index.d.ts +0 -12
- package/dist/graph/query/index.d.ts.map +0 -1
- package/dist/graph/query/index.js +0 -7
- package/dist/graph/query/index.js.map +0 -1
- package/dist/graph/query/lower.d.ts +0 -30
- package/dist/graph/query/lower.d.ts.map +0 -1
- package/dist/graph/query/lower.js +0 -171
- package/dist/graph/query/lower.js.map +0 -1
- package/dist/graph/query/shorthands.d.ts +0 -34
- package/dist/graph/query/shorthands.d.ts.map +0 -1
- package/dist/graph/query/shorthands.js +0 -71
- package/dist/graph/query/shorthands.js.map +0 -1
- package/dist/graph/query/traverse.d.ts +0 -59
- package/dist/graph/query/traverse.d.ts.map +0 -1
- package/dist/graph/query/traverse.js +0 -144
- package/dist/graph/query/traverse.js.map +0 -1
- package/dist/graph/reconcile/execute.d.ts +0 -8
- package/dist/graph/reconcile/execute.d.ts.map +0 -1
- package/dist/graph/reconcile/execute.js +0 -56
- package/dist/graph/reconcile/execute.js.map +0 -1
- package/dist/graph/reconcile/index.d.ts +0 -5
- package/dist/graph/reconcile/index.d.ts.map +0 -1
- package/dist/graph/reconcile/index.js +0 -3
- package/dist/graph/reconcile/index.js.map +0 -1
- package/dist/graph/reconcile/input.d.ts +0 -80
- package/dist/graph/reconcile/input.d.ts.map +0 -1
- package/dist/graph/reconcile/input.js +0 -5
- package/dist/graph/reconcile/input.js.map +0 -1
- package/dist/graph/reconcile/normalize.d.ts +0 -3
- package/dist/graph/reconcile/normalize.d.ts.map +0 -1
- package/dist/graph/reconcile/normalize.js +0 -144
- package/dist/graph/reconcile/normalize.js.map +0 -1
- package/dist/graph/reconcile/result.d.ts +0 -19
- package/dist/graph/reconcile/result.d.ts.map +0 -1
- package/dist/graph/reconcile/result.js +0 -95
- package/dist/graph/reconcile/result.js.map +0 -1
- package/dist/graph/reconcile/scope.d.ts +0 -6
- package/dist/graph/reconcile/scope.d.ts.map +0 -1
- package/dist/graph/reconcile/scope.js +0 -69
- package/dist/graph/reconcile/scope.js.map +0 -1
- package/dist/graph/result/envelope.d.ts +0 -37
- package/dist/graph/result/envelope.d.ts.map +0 -1
- package/dist/graph/result/envelope.js +0 -59
- package/dist/graph/result/envelope.js.map +0 -1
- package/dist/graph/result/index.d.ts +0 -6
- package/dist/graph/result/index.d.ts.map +0 -1
- package/dist/graph/result/index.js +0 -4
- package/dist/graph/result/index.js.map +0 -1
- package/dist/graph/result/next.d.ts +0 -16
- package/dist/graph/result/next.d.ts.map +0 -1
- package/dist/graph/result/next.js +0 -77
- package/dist/graph/result/next.js.map +0 -1
- package/dist/graph/result/paged.d.ts +0 -30
- package/dist/graph/result/paged.d.ts.map +0 -1
- package/dist/graph/result/paged.js +0 -41
- package/dist/graph/result/paged.js.map +0 -1
- package/dist/graph/wire.d.ts +0 -33
- package/dist/graph/wire.d.ts.map +0 -1
- package/dist/graph/wire.js +0 -16
- package/dist/graph/wire.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pacer/batcher.d.ts +0 -11
- package/dist/pacer/batcher.d.ts.map +0 -1
- package/dist/pacer/batcher.js +0 -15
- package/dist/pacer/batcher.js.map +0 -1
- package/dist/pacer/defaults.d.ts +0 -18
- package/dist/pacer/defaults.d.ts.map +0 -1
- package/dist/pacer/defaults.js +0 -18
- package/dist/pacer/defaults.js.map +0 -1
- package/dist/pacer/index.d.ts.map +0 -1
- package/dist/pacer/index.js.map +0 -1
- package/dist/pacer/queue.d.ts +0 -11
- package/dist/pacer/queue.d.ts.map +0 -1
- package/dist/pacer/queue.js +0 -15
- package/dist/pacer/queue.js.map +0 -1
- package/dist/pacer/rate-limiter.d.ts +0 -11
- package/dist/pacer/rate-limiter.d.ts.map +0 -1
- package/dist/pacer/rate-limiter.js +0 -15
- package/dist/pacer/rate-limiter.js.map +0 -1
- package/dist/pacer/retry.d.ts +0 -14
- package/dist/pacer/retry.d.ts.map +0 -1
- package/dist/pacer/retry.js +0 -50
- package/dist/pacer/retry.js.map +0 -1
- package/dist/pool/errors.d.ts +0 -13
- package/dist/pool/errors.d.ts.map +0 -1
- package/dist/pool/errors.js +0 -16
- package/dist/pool/errors.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/schema/bound/binder.d.ts +0 -49
- package/dist/schema/bound/binder.d.ts.map +0 -1
- package/dist/schema/bound/binder.js +0 -195
- package/dist/schema/bound/binder.js.map +0 -1
- package/dist/schema/bound/bound-node.d.ts +0 -105
- package/dist/schema/bound/bound-node.d.ts.map +0 -1
- package/dist/schema/bound/bound-node.js +0 -128
- package/dist/schema/bound/bound-node.js.map +0 -1
- package/dist/schema/bound/index.d.ts +0 -10
- package/dist/schema/bound/index.d.ts.map +0 -1
- package/dist/schema/bound/index.js +0 -5
- package/dist/schema/bound/index.js.map +0 -1
- package/dist/schema/bound/view.d.ts +0 -44
- package/dist/schema/bound/view.d.ts.map +0 -1
- package/dist/schema/bound/view.js +0 -117
- package/dist/schema/bound/view.js.map +0 -1
- package/dist/schema/bound/write-props.d.ts +0 -38
- package/dist/schema/bound/write-props.d.ts.map +0 -1
- package/dist/schema/bound/write-props.js +0 -2
- package/dist/schema/bound/write-props.js.map +0 -1
- package/dist/schema/call-args.d.ts +0 -6
- package/dist/schema/call-args.d.ts.map +0 -1
- package/dist/schema/call-args.js +0 -21
- package/dist/schema/call-args.js.map +0 -1
- package/dist/schema/class-proxy.d.ts +0 -11
- package/dist/schema/class-proxy.d.ts.map +0 -1
- package/dist/schema/class-proxy.js +0 -46
- package/dist/schema/class-proxy.js.map +0 -1
- package/dist/schema/extract.d.ts +0 -24
- package/dist/schema/extract.d.ts.map +0 -1
- package/dist/schema/extract.js +0 -45
- package/dist/schema/extract.js.map +0 -1
- package/dist/schema/from-entries.d.ts +0 -12
- package/dist/schema/from-entries.d.ts.map +0 -1
- package/dist/schema/from-entries.js +0 -39
- package/dist/schema/from-entries.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/known-dispatch.d.ts +0 -6
- package/dist/schema/known-dispatch.d.ts.map +0 -1
- package/dist/schema/known-dispatch.js +0 -39
- package/dist/schema/known-dispatch.js.map +0 -1
- package/dist/schema/node-proxy.d.ts +0 -21
- package/dist/schema/node-proxy.d.ts.map +0 -1
- package/dist/schema/node-proxy.js +0 -75
- package/dist/schema/node-proxy.js.map +0 -1
- package/dist/schema/persistence.d.ts +0 -31
- package/dist/schema/persistence.d.ts.map +0 -1
- package/dist/schema/persistence.js +0 -2
- package/dist/schema/persistence.js.map +0 -1
- package/dist/schema/proxy-types.d.ts +0 -131
- package/dist/schema/proxy-types.d.ts.map +0 -1
- package/dist/schema/proxy-types.js +0 -2
- package/dist/schema/proxy-types.js.map +0 -1
- package/dist/schema/registry.d.ts +0 -50
- package/dist/schema/registry.d.ts.map +0 -1
- package/dist/schema/registry.js +0 -110
- package/dist/schema/registry.js.map +0 -1
- package/dist/schema/resolve.d.ts +0 -26
- package/dist/schema/resolve.d.ts.map +0 -1
- package/dist/schema/resolve.js +0 -27
- package/dist/schema/resolve.js.map +0 -1
- package/dist/schema/typed-client.d.ts +0 -10
- package/dist/schema/typed-client.d.ts.map +0 -1
- package/dist/schema/typed-client.js +0 -26
- package/dist/schema/typed-client.js.map +0 -1
- package/dist/schema/types.d.ts +0 -9
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js +0 -2
- package/dist/schema/types.js.map +0 -1
- package/dist/session/bound.d.ts.map +0 -1
- package/dist/session/bound.js.map +0 -1
- package/dist/session/client-session.d.ts +0 -72
- package/dist/session/client-session.d.ts.map +0 -1
- package/dist/session/client-session.js +0 -673
- package/dist/session/client-session.js.map +0 -1
- package/dist/session/config.d.ts +0 -168
- package/dist/session/config.d.ts.map +0 -1
- package/dist/session/config.js +0 -2
- package/dist/session/config.js.map +0 -1
- package/dist/session/delegation/cache.d.ts +0 -139
- package/dist/session/delegation/cache.d.ts.map +0 -1
- package/dist/session/delegation/cache.js +0 -256
- package/dist/session/delegation/cache.js.map +0 -1
- package/dist/session/delegation/errors.d.ts +0 -44
- package/dist/session/delegation/errors.d.ts.map +0 -1
- package/dist/session/delegation/errors.js +0 -62
- package/dist/session/delegation/errors.js.map +0 -1
- package/dist/session/delegation/policy.d.ts +0 -183
- package/dist/session/delegation/policy.d.ts.map +0 -1
- package/dist/session/delegation/policy.js +0 -114
- package/dist/session/delegation/policy.js.map +0 -1
- package/dist/session/delegation/utils.d.ts +0 -4
- package/dist/session/delegation/utils.d.ts.map +0 -1
- package/dist/session/delegation/utils.js +0 -12
- package/dist/session/delegation/utils.js.map +0 -1
- package/dist/session/delegation-mint.d.ts +0 -13
- package/dist/session/delegation-mint.d.ts.map +0 -1
- package/dist/session/delegation-mint.js +0 -39
- package/dist/session/delegation-mint.js.map +0 -1
- package/dist/session/dispatch-routes.d.ts +0 -27
- package/dist/session/dispatch-routes.d.ts.map +0 -1
- package/dist/session/dispatch-routes.js +0 -77
- package/dist/session/dispatch-routes.js.map +0 -1
- package/dist/session/errors/index.d.ts +0 -6
- package/dist/session/errors/index.d.ts.map +0 -1
- package/dist/session/errors/index.js +0 -8
- package/dist/session/errors/index.js.map +0 -1
- package/dist/session/errors/session-errors.d.ts +0 -52
- package/dist/session/errors/session-errors.d.ts.map +0 -1
- package/dist/session/errors/session-errors.js +0 -70
- package/dist/session/errors/session-errors.js.map +0 -1
- package/dist/session/forward.d.ts +0 -15
- package/dist/session/forward.d.ts.map +0 -1
- package/dist/session/forward.js +0 -40
- package/dist/session/forward.js.map +0 -1
- package/dist/session/helpers.d.ts +0 -23
- package/dist/session/helpers.d.ts.map +0 -1
- package/dist/session/helpers.js +0 -56
- package/dist/session/helpers.js.map +0 -1
- package/dist/session/hooks.d.ts +0 -140
- package/dist/session/hooks.d.ts.map +0 -1
- package/dist/session/hooks.js +0 -2
- package/dist/session/hooks.js.map +0 -1
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js.map +0 -1
- package/dist/session/redirect/errors.d.ts +0 -45
- package/dist/session/redirect/errors.d.ts.map +0 -1
- package/dist/session/redirect/errors.js +0 -52
- package/dist/session/redirect/errors.js.map +0 -1
- package/dist/session/redirect/policy.d.ts +0 -79
- package/dist/session/redirect/policy.d.ts.map +0 -1
- package/dist/session/redirect/policy.js +0 -69
- package/dist/session/redirect/policy.js.map +0 -1
- package/dist/session/types.d.ts +0 -54
- package/dist/session/types.d.ts.map +0 -1
- package/dist/session/types.js +0 -2
- package/dist/session/types.js.map +0 -1
- package/dist/store/canonicalize.d.ts +0 -44
- package/dist/store/canonicalize.d.ts.map +0 -1
- package/dist/store/canonicalize.js +0 -0
- package/dist/store/canonicalize.js.map +0 -1
- package/dist/store/entities.d.ts +0 -81
- package/dist/store/entities.d.ts.map +0 -1
- package/dist/store/entities.js +0 -202
- package/dist/store/entities.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/invalidate.d.ts +0 -66
- package/dist/store/invalidate.d.ts.map +0 -1
- package/dist/store/invalidate.js +0 -117
- package/dist/store/invalidate.js.map +0 -1
- package/dist/store/memory.d.ts.map +0 -1
- package/dist/store/memory.js.map +0 -1
- package/dist/store/overlay.d.ts +0 -118
- package/dist/store/overlay.d.ts.map +0 -1
- package/dist/store/overlay.js +0 -237
- package/dist/store/overlay.js.map +0 -1
- package/dist/store/schedule.d.ts +0 -31
- package/dist/store/schedule.d.ts.map +0 -1
- package/dist/store/schedule.js +0 -76
- package/dist/store/schedule.js.map +0 -1
- package/dist/store/shapes.d.ts +0 -92
- package/dist/store/shapes.d.ts.map +0 -1
- package/dist/store/shapes.js +0 -369
- package/dist/store/shapes.js.map +0 -1
- package/dist/store/types.d.ts +0 -168
- package/dist/store/types.d.ts.map +0 -1
- package/dist/store/types.js +0 -7
- package/dist/store/types.js.map +0 -1
- package/dist/transport/binary.d.ts +0 -15
- package/dist/transport/binary.d.ts.map +0 -1
- package/dist/transport/binary.js +0 -2
- package/dist/transport/binary.js.map +0 -1
- package/dist/transport/contract.d.ts +0 -58
- package/dist/transport/contract.d.ts.map +0 -1
- package/dist/transport/contract.js +0 -11
- package/dist/transport/contract.js.map +0 -1
- package/dist/transport/fetch.d.ts +0 -31
- package/dist/transport/fetch.d.ts.map +0 -1
- package/dist/transport/fetch.js +0 -78
- package/dist/transport/fetch.js.map +0 -1
- package/dist/transport/http-envelope.d.ts +0 -49
- package/dist/transport/http-envelope.d.ts.map +0 -1
- package/dist/transport/http-envelope.js +0 -418
- package/dist/transport/http-envelope.js.map +0 -1
- package/dist/transport/http-routed.d.ts +0 -61
- package/dist/transport/http-routed.d.ts.map +0 -1
- package/dist/transport/http-routed.js +0 -409
- package/dist/transport/http-routed.js.map +0 -1
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/request-id.d.ts +0 -9
- package/dist/transport/request-id.d.ts.map +0 -1
- package/dist/transport/request-id.js +0 -12
- package/dist/transport/request-id.js.map +0 -1
- package/dist/transport/ws-envelope.d.ts +0 -74
- package/dist/transport/ws-envelope.d.ts.map +0 -1
- package/dist/transport/ws-envelope.js +0 -567
- package/dist/transport/ws-envelope.js.map +0 -1
- package/dist/util/race-signal.d.ts +0 -12
- package/dist/util/race-signal.d.ts.map +0 -1
- package/dist/util/race-signal.js +0 -34
- package/dist/util/race-signal.js.map +0 -1
- package/dist/wire/controller.d.ts +0 -38
- package/dist/wire/controller.d.ts.map +0 -1
- package/dist/wire/controller.js +0 -38
- package/dist/wire/controller.js.map +0 -1
- package/dist/wire/index.d.ts +0 -7
- package/dist/wire/index.d.ts.map +0 -1
- package/dist/wire/index.js +0 -4
- package/dist/wire/index.js.map +0 -1
- package/dist/wire/meta.d.ts +0 -81
- package/dist/wire/meta.d.ts.map +0 -1
- package/dist/wire/meta.js +0 -44
- package/dist/wire/meta.js.map +0 -1
- package/dist/wire/sse.d.ts +0 -67
- package/dist/wire/sse.d.ts.map +0 -1
- package/dist/wire/sse.js +0 -170
- package/dist/wire/sse.js.map +0 -1
package/dist/pool/pool.d.ts
CHANGED
|
@@ -1,63 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* `ClientPool` configuration. Spec §9.1.
|
|
15
|
-
*/
|
|
16
|
-
export type ClientPoolConfig<M extends FnMap = FnMap> = {
|
|
17
|
-
/** How to build a `KernelClient` for a URL the pool hasn't seen. */
|
|
18
|
-
clientFactory: ClientFactory<M>;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum cached clients. Least-recently-used is evicted when
|
|
21
|
-
* exceeded. Default: `32`.
|
|
22
|
-
*/
|
|
23
|
-
maxSize?: number;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* URL → `KernelClient` map with bounded LRU eviction. Spec §9.1.
|
|
27
|
-
*
|
|
28
|
-
* Invariants:
|
|
29
|
-
* - Idempotent `disconnect()` — subsequent calls are no-ops.
|
|
30
|
-
* - Post-disconnect `clientFor` throws `PoolClosedError`.
|
|
31
|
-
* - Eviction cascades `disconnect()` to the evicted client.
|
|
32
|
-
* - Calls to `clientFor(url)` return the same instance for the same
|
|
33
|
-
* URL (until eviction), so pooled-client hook registration is stable.
|
|
34
|
-
*/
|
|
35
|
-
export declare class ClientPool<M extends FnMap = FnMap> {
|
|
36
|
-
private readonly entries;
|
|
37
|
-
private readonly factory;
|
|
38
|
-
private readonly maxSize;
|
|
1
|
+
import type { Client } from '../client/index.js';
|
|
2
|
+
import type { ClientTarget } from './target.js';
|
|
3
|
+
export type ClientFactory = (target: ClientTarget) => Client;
|
|
4
|
+
export interface ClientPoolOptions {
|
|
5
|
+
readonly client: ClientFactory;
|
|
6
|
+
/** Maximum retained endpoint/transport Clients. Default: 32. */
|
|
7
|
+
readonly maximumSize?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Bounded LRU pool for shareable one-hop Clients; eviction closes the selected Client. */
|
|
10
|
+
export declare class ClientPool {
|
|
11
|
+
private readonly clients;
|
|
12
|
+
private readonly createClient;
|
|
13
|
+
private readonly maximumSize;
|
|
39
14
|
private closed;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* the pool has been disconnected.
|
|
45
|
-
*/
|
|
46
|
-
clientFor(url: string): KernelClient<M>;
|
|
47
|
-
/**
|
|
48
|
-
* Evict a specific URL and call its client's `disconnect()`.
|
|
49
|
-
* Idempotent — no-op for unknown URLs.
|
|
50
|
-
*/
|
|
51
|
-
evict(url: string): void;
|
|
52
|
-
/**
|
|
53
|
-
* Tear down every cached client. Idempotent. After disconnect,
|
|
54
|
-
* `clientFor` throws `PoolClosedError`.
|
|
55
|
-
*/
|
|
56
|
-
disconnect(): void;
|
|
57
|
-
/** Current number of cached clients — pool introspection helper. */
|
|
15
|
+
constructor(options: ClientPoolOptions);
|
|
16
|
+
clientFor(target: ClientTarget): Client;
|
|
17
|
+
evict(target: ClientTarget): void;
|
|
18
|
+
close(): void;
|
|
58
19
|
get size(): number;
|
|
59
|
-
/** Whether `disconnect()` has been called. */
|
|
60
20
|
get isClosed(): boolean;
|
|
61
|
-
private
|
|
21
|
+
private evictOldest;
|
|
22
|
+
private requireOpen;
|
|
62
23
|
}
|
|
63
|
-
//# sourceMappingURL=pool.d.ts.map
|
package/dist/pool/pool.js
CHANGED
|
@@ -1,87 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Invariants:
|
|
6
|
-
* - Idempotent `disconnect()` — subsequent calls are no-ops.
|
|
7
|
-
* - Post-disconnect `clientFor` throws `PoolClosedError`.
|
|
8
|
-
* - Eviction cascades `disconnect()` to the evicted client.
|
|
9
|
-
* - Calls to `clientFor(url)` return the same instance for the same
|
|
10
|
-
* URL (until eviction), so pooled-client hook registration is stable.
|
|
11
|
-
*/
|
|
1
|
+
import { ClientError } from '../errors/index.js';
|
|
2
|
+
import { admitTarget, targetKey } from './target.js';
|
|
3
|
+
/** Bounded LRU pool for shareable one-hop Clients; eviction closes the selected Client. */
|
|
12
4
|
export class ClientPool {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
clients = new Map();
|
|
6
|
+
createClient;
|
|
7
|
+
maximumSize;
|
|
16
8
|
closed = false;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
constructor(options) {
|
|
10
|
+
if (typeof options?.client !== 'function') {
|
|
11
|
+
throw new TypeError('ClientPool client factory is invalid.');
|
|
12
|
+
}
|
|
13
|
+
this.createClient = options.client;
|
|
14
|
+
this.maximumSize = options.maximumSize ?? 32;
|
|
15
|
+
if (!Number.isSafeInteger(this.maximumSize) || this.maximumSize < 1) {
|
|
16
|
+
throw new TypeError('ClientPool maximumSize must be a positive safe integer.');
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (this.closed)
|
|
31
|
-
throw new PoolClosedError();
|
|
32
|
-
const existing = this.entries.get(url);
|
|
19
|
+
clientFor(target) {
|
|
20
|
+
this.requireOpen();
|
|
21
|
+
const admitted = admitTarget(target);
|
|
22
|
+
const key = targetKey(admitted);
|
|
23
|
+
const existing = this.clients.get(key);
|
|
33
24
|
if (existing) {
|
|
34
|
-
|
|
25
|
+
this.clients.delete(key);
|
|
26
|
+
this.clients.set(key, existing);
|
|
35
27
|
return existing.client;
|
|
36
28
|
}
|
|
37
|
-
if (this.
|
|
38
|
-
this.
|
|
39
|
-
const client = this.
|
|
40
|
-
this.
|
|
29
|
+
if (this.clients.size === this.maximumSize)
|
|
30
|
+
this.evictOldest();
|
|
31
|
+
const client = this.createClient(admitted);
|
|
32
|
+
this.clients.set(key, { target: admitted, client });
|
|
41
33
|
return client;
|
|
42
34
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
evict(url) {
|
|
48
|
-
const entry = this.entries.get(url);
|
|
35
|
+
evict(target) {
|
|
36
|
+
const admitted = admitTarget(target);
|
|
37
|
+
const key = targetKey(admitted);
|
|
38
|
+
const entry = this.clients.get(key);
|
|
49
39
|
if (!entry)
|
|
50
40
|
return;
|
|
51
|
-
this.
|
|
52
|
-
entry.client.
|
|
41
|
+
this.clients.delete(key);
|
|
42
|
+
entry.client.close();
|
|
53
43
|
}
|
|
54
|
-
|
|
55
|
-
* Tear down every cached client. Idempotent. After disconnect,
|
|
56
|
-
* `clientFor` throws `PoolClosedError`.
|
|
57
|
-
*/
|
|
58
|
-
disconnect() {
|
|
44
|
+
close() {
|
|
59
45
|
if (this.closed)
|
|
60
46
|
return;
|
|
61
47
|
this.closed = true;
|
|
62
|
-
for (const { client } of this.
|
|
63
|
-
client.
|
|
64
|
-
this.
|
|
48
|
+
for (const { client } of this.clients.values())
|
|
49
|
+
client.close();
|
|
50
|
+
this.clients.clear();
|
|
65
51
|
}
|
|
66
|
-
/** Current number of cached clients — pool introspection helper. */
|
|
67
52
|
get size() {
|
|
68
|
-
return this.
|
|
53
|
+
return this.clients.size;
|
|
69
54
|
}
|
|
70
|
-
/** Whether `disconnect()` has been called. */
|
|
71
55
|
get isClosed() {
|
|
72
56
|
return this.closed;
|
|
73
57
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.evict(oldestUrl);
|
|
58
|
+
evictOldest() {
|
|
59
|
+
const oldest = this.clients.entries().next().value;
|
|
60
|
+
if (!oldest)
|
|
61
|
+
return;
|
|
62
|
+
this.clients.delete(oldest[0]);
|
|
63
|
+
oldest[1].client.close();
|
|
64
|
+
}
|
|
65
|
+
requireOpen() {
|
|
66
|
+
if (this.closed)
|
|
67
|
+
throw new ClientError('ClientPool is closed.');
|
|
85
68
|
}
|
|
86
69
|
}
|
|
87
|
-
//# sourceMappingURL=pool.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ClientTarget = {
|
|
2
|
+
readonly transport: 'http';
|
|
3
|
+
readonly url: string;
|
|
4
|
+
} | {
|
|
5
|
+
readonly transport: 'websocket';
|
|
6
|
+
readonly url: string;
|
|
7
|
+
} | {
|
|
8
|
+
readonly transport: 'auto';
|
|
9
|
+
readonly endpoints: {
|
|
10
|
+
readonly http: string;
|
|
11
|
+
readonly websocket: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare function admitTarget(input: ClientTarget): ClientTarget;
|
|
15
|
+
export declare function targetKey(target: ClientTarget): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function admitTarget(input) {
|
|
2
|
+
if (input === null || typeof input !== 'object') {
|
|
3
|
+
throw new TypeError('Client target must be an object.');
|
|
4
|
+
}
|
|
5
|
+
if (input.transport === 'http') {
|
|
6
|
+
return Object.freeze({ transport: 'http', url: endpoint(input.url, ['http:', 'https:']) });
|
|
7
|
+
}
|
|
8
|
+
if (input.transport === 'websocket') {
|
|
9
|
+
const url = new URL(endpoint(input.url, ['http:', 'https:', 'ws:', 'wss:']));
|
|
10
|
+
if (url.protocol === 'http:')
|
|
11
|
+
url.protocol = 'ws:';
|
|
12
|
+
if (url.protocol === 'https:')
|
|
13
|
+
url.protocol = 'wss:';
|
|
14
|
+
return Object.freeze({ transport: 'websocket', url: url.toString() });
|
|
15
|
+
}
|
|
16
|
+
if (input.transport === 'auto' && input.endpoints && typeof input.endpoints === 'object') {
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
transport: 'auto',
|
|
19
|
+
endpoints: Object.freeze({
|
|
20
|
+
http: endpoint(input.endpoints.http, ['http:', 'https:']),
|
|
21
|
+
websocket: endpoint(input.endpoints.websocket, ['http:', 'https:', 'ws:', 'wss:']),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
throw new TypeError('Client target transport is invalid.');
|
|
26
|
+
}
|
|
27
|
+
export function targetKey(target) {
|
|
28
|
+
return target.transport === 'auto'
|
|
29
|
+
? `auto\u0000${target.endpoints.http}\u0000${target.endpoints.websocket}`
|
|
30
|
+
: `${target.transport}\u0000${target.url}`;
|
|
31
|
+
}
|
|
32
|
+
function endpoint(input, protocols) {
|
|
33
|
+
if (typeof input !== 'string')
|
|
34
|
+
throw new TypeError('Client target URL must be a string.');
|
|
35
|
+
let url;
|
|
36
|
+
try {
|
|
37
|
+
url = new URL(input);
|
|
38
|
+
}
|
|
39
|
+
catch (cause) {
|
|
40
|
+
throw new TypeError('Client target URL is invalid.', { cause });
|
|
41
|
+
}
|
|
42
|
+
if (!protocols.includes(url.protocol) ||
|
|
43
|
+
url.username !== '' ||
|
|
44
|
+
url.password !== '' ||
|
|
45
|
+
url.hash !== '') {
|
|
46
|
+
throw new TypeError('Client target URL is invalid.');
|
|
47
|
+
}
|
|
48
|
+
return url.toString();
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Value } from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
interface OutputContract {
|
|
3
|
+
safeParse(input: unknown): {
|
|
4
|
+
readonly success: true;
|
|
5
|
+
readonly data: Value;
|
|
6
|
+
} | {
|
|
7
|
+
readonly success: false;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** Admit one value result through its Core-owned syscall contract. */
|
|
11
|
+
export declare function acceptOutput<T>(contract: OutputContract, input: unknown): T;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
/** Admit one value result through its Core-owned syscall contract. */
|
|
3
|
+
export function acceptOutput(contract, input) {
|
|
4
|
+
const value = portable.accept(input);
|
|
5
|
+
const parsed = contract.safeParse(value);
|
|
6
|
+
if (!parsed.success)
|
|
7
|
+
throw new TypeError('Kernel returned an invalid Schema result.');
|
|
8
|
+
return freeze(parsed.data);
|
|
9
|
+
}
|
|
10
|
+
function freeze(input) {
|
|
11
|
+
if (input !== null && typeof input === 'object' && !Object.isFrozen(input)) {
|
|
12
|
+
for (const value of Object.values(input))
|
|
13
|
+
freeze(value);
|
|
14
|
+
Object.freeze(input);
|
|
15
|
+
}
|
|
16
|
+
return input;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { installation } from '@astrale-os/kernel-core/schema';
|
|
2
|
+
import type { DesiredInstallation as CoreDesiredInstallation, InstallInput, InstallOutput, UninstallInput, UninstallOutput } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
3
|
+
export type OperationId = installation.OperationId;
|
|
4
|
+
/** Canonical caller input accepted by the Kernel install syscall. */
|
|
5
|
+
export type DesiredInstallation = CoreDesiredInstallation;
|
|
6
|
+
export type InstallRequest = InstallInput;
|
|
7
|
+
/** Admitted terminal install receipt returned by the Kernel. */
|
|
8
|
+
export type InstallReceipt = InstallOutput;
|
|
9
|
+
/** Canonical caller input accepted by the Kernel uninstall syscall. */
|
|
10
|
+
export type UninstallRequest = UninstallInput;
|
|
11
|
+
/** Admitted terminal uninstall receipt returned by the Kernel. */
|
|
12
|
+
export type UninstallReceipt = UninstallOutput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { createNodeProxy, createInstanceProxy } from './node-proxy.js';
|
|
5
|
-
export { resolveMethodKey } from './resolve.js';
|
|
6
|
-
export { resolveCallArgs } from './call-args.js';
|
|
7
|
-
export { createKnownInstanceDispatch, createKnownStaticDispatch } from './known-dispatch.js';
|
|
8
|
-
export { extractMethodsByClass, extractMethodsByType } from './extract.js';
|
|
9
|
-
export type { TypeMethods } from './extract.js';
|
|
10
|
-
export { toFunctionSchemas } from './from-entries.js';
|
|
11
|
-
export type { FunctionSchema } from './types.js';
|
|
12
|
-
export type { SchemaPersistence } from './persistence.js';
|
|
13
|
-
export type { ClassNames, ClassProxy, DefOf, InstanceDispatch, NodeProxy, ProxyCallOptions, ProxyCaller, SchemaTypedClient, StaticDispatch, TypeNames, } from './proxy-types.js';
|
|
14
|
-
export { BindTypeMismatchError, createBoundNode, createNodeBinder, createSchemaBoundView, defaultCaller, resolveNeighbors, normalizeRef, } from './bound/index.js';
|
|
15
|
-
export type { AnyBoundNode, BindCtx, BindOptions, BoundLinks, BoundNode, BoundNodeOperations, BoundPaged, BoundSnapshot, ClassHandle, CreatableClassNames, CreateProps, CreateSchemaBoundViewOpts, EdgeNames, EndpointsOf, NodeBinder, NodeRefInput, SchemaBoundView, SchemaClasses, } from './bound/index.js';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { createSchema, type SchemaApi, type SchemaCall, type SchemaOptions, type ReadyInstallation, } from './schema.js';
|
|
2
|
+
export { acceptOperationId, createOperationId } from './operation.js';
|
|
3
|
+
export type { DesiredInstallation, InstallReceipt, InstallRequest, OperationId, UninstallReceipt, UninstallRequest, } from './contracts.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { createClassProxy } from './class-proxy.js';
|
|
4
|
-
export { createNodeProxy, createInstanceProxy } from './node-proxy.js';
|
|
5
|
-
export { resolveMethodKey } from './resolve.js';
|
|
6
|
-
export { resolveCallArgs } from './call-args.js';
|
|
7
|
-
export { createKnownInstanceDispatch, createKnownStaticDispatch } from './known-dispatch.js';
|
|
8
|
-
export { extractMethodsByClass, extractMethodsByType } from './extract.js';
|
|
9
|
-
export { toFunctionSchemas } from './from-entries.js';
|
|
10
|
-
// ─── Schema-bound surface (SchemaBoundView / BoundNode / binder) ────────────
|
|
11
|
-
export { BindTypeMismatchError, createBoundNode, createNodeBinder, createSchemaBoundView, defaultCaller, resolveNeighbors, normalizeRef, } from './bound/index.js';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { createSchema, } from './schema.js';
|
|
2
|
+
export { acceptOperationId, createOperationId } from './operation.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { introspection as language } from '@astrale-os/kernel-core/schema';
|
|
2
|
+
import type * as protocol from '@astrale-os/kernel-protocol/schema';
|
|
3
|
+
import type { RequestOptions } from '../transport/index.js';
|
|
4
|
+
import type { SchemaCall, SchemaOptions } from './schema.js';
|
|
5
|
+
export declare function introspect<InputType extends language.Introspection>(invoke: SchemaCall, limits: SchemaOptions, request: InputType, options?: RequestOptions): Promise<protocol.installation.introspection.ResultFor<InputType>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { introspect as introspectRef } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
import * as schema from '@astrale-os/kernel-protocol/schema';
|
|
4
|
+
import { call } from '../client/index.js';
|
|
5
|
+
const INTROSPECT_PATH = Path.project(introspectRef).raw;
|
|
6
|
+
export async function introspect(invoke, limits, request, options) {
|
|
7
|
+
const result = await invoke(call(INTROSPECT_PATH, request), options);
|
|
8
|
+
if (result.kind !== 'binary') {
|
|
9
|
+
throw new TypeError('Schema introspection returned a non-binary result.');
|
|
10
|
+
}
|
|
11
|
+
if (result.value.mediaType !== schema.installation.introspection.MEDIA_TYPE) {
|
|
12
|
+
throw new TypeError('Schema introspection returned an unsupported media type.');
|
|
13
|
+
}
|
|
14
|
+
return schema.installation.introspection.decode(request, result.value.body, limits);
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OperationId } from './contracts.js';
|
|
2
|
+
/** Accept one canonical lowercase RFC 9562 UUIDv4 operation identity. */
|
|
3
|
+
export declare function acceptOperationId(input: unknown): OperationId;
|
|
4
|
+
/** Allocate one cryptographically generated operation identity for a new lifecycle request. */
|
|
5
|
+
export declare function createOperationId(): OperationId;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as installation from '@astrale-os/kernel-core/schema/installation';
|
|
2
|
+
/** Accept one canonical lowercase RFC 9562 UUIDv4 operation identity. */
|
|
3
|
+
export function acceptOperationId(input) {
|
|
4
|
+
return installation.acceptOperationId(input);
|
|
5
|
+
}
|
|
6
|
+
/** Allocate one cryptographically generated operation identity for a new lifecycle request. */
|
|
7
|
+
export function createOperationId() {
|
|
8
|
+
return acceptOperationId(globalThis.crypto.randomUUID());
|
|
9
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { introspection } from '@astrale-os/kernel-core/schema';
|
|
2
|
+
import type * as protocolSchema from '@astrale-os/kernel-protocol/schema';
|
|
3
|
+
import type { Call, Result } from '../client/index.js';
|
|
4
|
+
import type { RequestOptions } from '../transport/index.js';
|
|
5
|
+
import type { InstallReceipt, InstallRequest, UninstallReceipt, UninstallRequest } from './contracts.js';
|
|
6
|
+
export type SchemaCall = (call: Call, options?: RequestOptions) => Promise<Result>;
|
|
7
|
+
export interface SchemaOptions extends protocolSchema.installation.introspection.Limits {
|
|
8
|
+
}
|
|
9
|
+
export type ReadyInstallation = protocolSchema.installation.introspection.Installation & {
|
|
10
|
+
readonly state: 'ready';
|
|
11
|
+
readonly readiness: protocolSchema.installation.introspection.Digest;
|
|
12
|
+
};
|
|
13
|
+
export interface SchemaApi {
|
|
14
|
+
install(request: InstallRequest, options?: RequestOptions): Promise<InstallReceipt>;
|
|
15
|
+
uninstall(request: UninstallRequest, options?: RequestOptions): Promise<UninstallReceipt>;
|
|
16
|
+
introspect<Input extends introspection.Introspection>(request: Input, options?: RequestOptions): Promise<protocolSchema.installation.introspection.ResultFor<Input>>;
|
|
17
|
+
}
|
|
18
|
+
/** Bind the canonical Schema lifecycle syscalls to one caller-scoped value-call capability. */
|
|
19
|
+
export declare function createSchema(call: SchemaCall, limits: SchemaOptions): SchemaApi;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { installOutput, uninstallOutput, } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
3
|
+
import { install, uninstall } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
4
|
+
import { call as invocation } from '../client/index.js';
|
|
5
|
+
import { acceptOutput } from './admission.js';
|
|
6
|
+
import { introspect as inspect } from './introspection.js';
|
|
7
|
+
const INSTALL_PATH = Path.project(install).raw;
|
|
8
|
+
const UNINSTALL_PATH = Path.project(uninstall).raw;
|
|
9
|
+
/** Bind the canonical Schema lifecycle syscalls to one caller-scoped value-call capability. */
|
|
10
|
+
export function createSchema(call, limits) {
|
|
11
|
+
if (typeof call !== 'function')
|
|
12
|
+
throw new TypeError('Schema call capability is invalid.');
|
|
13
|
+
const admittedLimits = admitLimits(limits);
|
|
14
|
+
return Object.freeze({
|
|
15
|
+
async install(request, options) {
|
|
16
|
+
const output = value(await call(invocation(INSTALL_PATH, request), options));
|
|
17
|
+
return acceptOutput(installOutput, output);
|
|
18
|
+
},
|
|
19
|
+
async uninstall(request, options) {
|
|
20
|
+
const output = value(await call(invocation(UNINSTALL_PATH, request), options));
|
|
21
|
+
return acceptOutput(uninstallOutput, output);
|
|
22
|
+
},
|
|
23
|
+
async introspect(request, options) {
|
|
24
|
+
return inspect(call, admittedLimits, request, options);
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function value(result) {
|
|
29
|
+
if (result.kind !== 'value')
|
|
30
|
+
throw new TypeError('Schema syscall returned a non-value result.');
|
|
31
|
+
return result.value;
|
|
32
|
+
}
|
|
33
|
+
function admitLimits(input) {
|
|
34
|
+
if (input === null ||
|
|
35
|
+
typeof input !== 'object' ||
|
|
36
|
+
!Number.isSafeInteger(input.maximumPublicationBytes) ||
|
|
37
|
+
input.maximumPublicationBytes < 1 ||
|
|
38
|
+
!Number.isSafeInteger(input.maximumBundleBytes) ||
|
|
39
|
+
input.maximumBundleBytes < 1) {
|
|
40
|
+
throw new TypeError('Schema introspection limits are invalid.');
|
|
41
|
+
}
|
|
42
|
+
return Object.freeze({ ...input });
|
|
43
|
+
}
|
package/dist/session/bound.d.ts
CHANGED
|
@@ -1,11 +1,44 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { IssuerId } from '@astrale-os/kernel-core/auth';
|
|
2
|
+
import type { ReadyInstallation } from '../schema/index.js';
|
|
3
|
+
import type { SessionControlOptions } from './context/index.js';
|
|
4
|
+
import type { CallableReference, InputOfReference, OutputOfReference } from './reference.js';
|
|
5
|
+
import type { SessionRequestOptions } from './routing/index.js';
|
|
6
|
+
import type { ViewCatalog } from './views/index.js';
|
|
7
|
+
import { type AuthApi } from '../auth/index.js';
|
|
8
|
+
import { type Binary, type Call, type Input, type Result, type Stream } from '../client/index.js';
|
|
9
|
+
import { type GraphApi } from '../graph/index.js';
|
|
10
|
+
/** Exact live Session surface captured by one credential-bound Kernel view. */
|
|
11
|
+
export interface BoundSessionSource {
|
|
12
|
+
readonly kernel: IssuerId;
|
|
13
|
+
dispatch(call: Call, options?: SessionRequestOptions): Promise<Result>;
|
|
14
|
+
call(call: Call, options?: SessionRequestOptions): Promise<Input>;
|
|
15
|
+
invoke<const Reference extends CallableReference>(reference: Reference, input: InputOfReference<Reference>, options?: SessionRequestOptions): Promise<OutputOfReference<Reference>>;
|
|
16
|
+
stream(call: Call, options?: SessionRequestOptions): Promise<Stream>;
|
|
17
|
+
binary(call: Call, options?: SessionRequestOptions): Promise<Binary>;
|
|
18
|
+
installation(origin: string, options?: SessionControlOptions): Promise<ReadyInstallation>;
|
|
19
|
+
viewsFor(target: Parameters<import('./session.js').ClientSession['viewsFor']>[0], options?: SessionControlOptions): Promise<ViewCatalog>;
|
|
20
|
+
}
|
|
21
|
+
export interface BoundSessionControls {
|
|
22
|
+
readonly signal: AbortSignal;
|
|
23
|
+
/** Absolute Unix time in milliseconds. */
|
|
24
|
+
readonly deadline: number;
|
|
25
|
+
}
|
|
5
26
|
/**
|
|
6
|
-
* Credential-bound
|
|
7
|
-
*
|
|
8
|
-
* credential
|
|
27
|
+
* Credential-bound Kernel operations over one caller-owned ClientSession.
|
|
28
|
+
*
|
|
29
|
+
* The view owns no credential, transport, route cache, or lifecycle. Its source Session owns all of
|
|
30
|
+
* those concerns and closing that Session invalidates every operation exposed here.
|
|
9
31
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
32
|
+
export interface BoundClientSession extends GraphApi {
|
|
33
|
+
readonly kernel: IssuerId;
|
|
34
|
+
readonly auth: AuthApi;
|
|
35
|
+
dispatch(call: Call, options?: SessionRequestOptions): Promise<Result>;
|
|
36
|
+
call(call: Call, options?: SessionRequestOptions): Promise<Input>;
|
|
37
|
+
invoke<const Reference extends CallableReference>(reference: Reference, input: InputOfReference<Reference>, options?: SessionRequestOptions): Promise<OutputOfReference<Reference>>;
|
|
38
|
+
stream(call: Call, options?: SessionRequestOptions): Promise<Stream>;
|
|
39
|
+
binary(call: Call, options?: SessionRequestOptions): Promise<Binary>;
|
|
40
|
+
installation(origin: string, options?: SessionControlOptions): Promise<ReadyInstallation>;
|
|
41
|
+
viewsFor: BoundSessionSource['viewsFor'];
|
|
42
|
+
}
|
|
43
|
+
/** Capture one Session into the ordinary graph, auth, and invocation Kernel journey. */
|
|
44
|
+
export declare function bindSession(source: BoundSessionSource, controls?: BoundSessionControls): BoundClientSession;
|