@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
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert BoundMethod[] to FunctionSchema[] for the client SchemaRegistry.
|
|
3
|
-
*
|
|
4
|
-
* Extracts the routing + shape metadata from bound methods so the client can
|
|
5
|
-
* resolve target URLs and transport modes at call time. `code` is emitted as
|
|
6
|
-
* empty strings — the client never executes handler bodies, it only dispatches
|
|
7
|
-
* to the server or follows a redirect.
|
|
8
|
-
*/
|
|
9
|
-
import { zodToJsonSchema } from '@astrale-os/kernel-core/domain';
|
|
10
|
-
export function toFunctionSchemas(methods) {
|
|
11
|
-
return methods.map((method) => {
|
|
12
|
-
const handler = method.handler;
|
|
13
|
-
const binding = extractBinding(handler);
|
|
14
|
-
const schema = {
|
|
15
|
-
ref: method.ref,
|
|
16
|
-
inputSchema: zodToJsonSchema(method.inputSchema),
|
|
17
|
-
outputSchema: zodToJsonSchema(method.outputSchema),
|
|
18
|
-
output: method.output,
|
|
19
|
-
// Client-side schemas carry no code bodies — the client only dispatches,
|
|
20
|
-
// it never hydrates a sandbox. Empty strings satisfy the canonical shape.
|
|
21
|
-
code: { authorize: '', execute: '' },
|
|
22
|
-
};
|
|
23
|
-
if (binding)
|
|
24
|
-
schema.binding = binding;
|
|
25
|
-
return schema;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function extractBinding(handler) {
|
|
29
|
-
const { route, remoteUrl } = handler;
|
|
30
|
-
if (route === undefined && remoteUrl === undefined)
|
|
31
|
-
return undefined;
|
|
32
|
-
const binding = {};
|
|
33
|
-
if (remoteUrl !== undefined)
|
|
34
|
-
binding.remoteUrl = remoteUrl;
|
|
35
|
-
if (route !== undefined)
|
|
36
|
-
binding.route = route;
|
|
37
|
-
return binding;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=from-entries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"from-entries.js","sourceRoot":"","sources":["../../src/schema/from-entries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,MAAM,UAAU,iBAAiB,CAAC,OAAsB;IACtD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAuD,CAAA;QAC9E,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,MAAM,GAAmB;YAC7B,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,WAAW,EAAE,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC;YAChD,YAAY,EAAE,eAAe,CAAC,MAAM,CAAC,YAAY,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A;AAC1E,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,YAAY,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,WAAW,EAGX,iBAAiB,EACjB,cAAc,EACd,SAAS,GACV,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,YAAY,EACZ,OAAO,EACP,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAA"}
|
package/dist/schema/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC5F,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAkBrD,+EAA+E;AAC/E,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { InstanceDispatch, ProxyCaller, StaticDispatch } from './proxy-types.js';
|
|
2
|
-
/** Known instance methods as an ordinary object — no property proxy. */
|
|
3
|
-
export declare function createKnownInstanceDispatch<D>(caller: ProxyCaller, selfRaw: string, methods: ReadonlySet<string>, classHint?: string): InstanceDispatch<D>;
|
|
4
|
-
/** Known static methods as an ordinary object — no prototype proxy. */
|
|
5
|
-
export declare function createKnownStaticDispatch<D>(caller: ProxyCaller, domain: string, memberKind: 'class' | 'interface', memberName: string, methods: ReadonlySet<string>): StaticDispatch<D>;
|
|
6
|
-
//# sourceMappingURL=known-dispatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"known-dispatch.d.ts","sourceRoot":"","sources":["../../src/schema/known-dispatch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,cAAc,EACf,MAAM,kBAAkB,CAAA;AAmCzB,wEAAwE;AACxE,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,SAAS,CAAC,EAAE,MAAM,GACjB,gBAAgB,CAAC,CAAC,CAAC,CAQrB;AAED,uEAAuE;AACvE,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,GAAG,WAAW,EACjC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAC3B,cAAc,CAAC,CAAC,CAAC,CAYnB"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { toPath } from '@astrale-os/kernel-core';
|
|
2
|
-
import { InstanceMethodPath, MethodPath, Ref } from '@astrale-os/kernel-core/domain';
|
|
3
|
-
import { resolveCallArgs } from './call-args.js';
|
|
4
|
-
/** Materialize the finite method record described by a schema definition. */
|
|
5
|
-
function createDispatch(caller, methods, pathFor, classHint) {
|
|
6
|
-
return Object.fromEntries([...methods].map((method) => [
|
|
7
|
-
method,
|
|
8
|
-
(paramsOrOpts, maybeOpts) => {
|
|
9
|
-
const [params, opts] = resolveCallArgs(paramsOrOpts, maybeOpts);
|
|
10
|
-
return caller(pathFor(method), params, opts?.credential, {
|
|
11
|
-
timeout: opts?.timeout,
|
|
12
|
-
signal: opts?.signal,
|
|
13
|
-
...(classHint !== undefined ? { class: classHint } : {}),
|
|
14
|
-
correlationId: opts?.correlationId,
|
|
15
|
-
url: opts?.url,
|
|
16
|
-
delegation: opts?.delegation,
|
|
17
|
-
attestation: opts?.attestation,
|
|
18
|
-
skipDelegation: opts?.skipDelegation,
|
|
19
|
-
maxHops: opts?.maxHops,
|
|
20
|
-
self: opts?.self,
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
]));
|
|
24
|
-
}
|
|
25
|
-
/** Known instance methods as an ordinary object — no property proxy. */
|
|
26
|
-
export function createKnownInstanceDispatch(caller, selfRaw, methods, classHint) {
|
|
27
|
-
const source = toPath(selfRaw);
|
|
28
|
-
return createDispatch(caller, methods, (method) => InstanceMethodPath.from(source, method).raw, classHint);
|
|
29
|
-
}
|
|
30
|
-
/** Known static methods as an ordinary object — no prototype proxy. */
|
|
31
|
-
export function createKnownStaticDispatch(caller, domain, memberKind, memberName, methods) {
|
|
32
|
-
return createDispatch(caller, methods, (method) => MethodPath.from({
|
|
33
|
-
domain,
|
|
34
|
-
member: Ref.member(memberKind, memberName).toString(),
|
|
35
|
-
memberKind,
|
|
36
|
-
method,
|
|
37
|
-
}).raw);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=known-dispatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"known-dispatch.js","sourceRoot":"","sources":["../../src/schema/known-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAA;AASpF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIhD,6EAA6E;AAC7E,SAAS,cAAc,CACrB,MAAmB,EACnB,OAA4B,EAC5B,OAAmC,EACnC,SAAkB;IAElB,OAAO,MAAM,CAAC,WAAW,CACvB,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3B,MAAM;QACN,CAAC,YAAsB,EAAE,SAA4B,EAAE,EAAE;YACvD,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,eAAe,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;YAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE;gBACvD,OAAO,EAAE,IAAI,EAAE,OAAO;gBACtB,MAAM,EAAE,IAAI,EAAE,MAAM;gBACpB,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxD,aAAa,EAAE,IAAI,EAAE,aAAa;gBAClC,GAAG,EAAE,IAAI,EAAE,GAAG;gBACd,UAAU,EAAE,IAAI,EAAE,UAAU;gBAC5B,WAAW,EAAE,IAAI,EAAE,WAAW;gBAC9B,cAAc,EAAE,IAAI,EAAE,cAAc;gBACpC,OAAO,EAAE,IAAI,EAAE,OAAO;gBACtB,IAAI,EAAE,IAAI,EAAE,IAAI;aACjB,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CACH,CAAA;AACH,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,2BAA2B,CACzC,MAAmB,EACnB,OAAe,EACf,OAA4B,EAC5B,SAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAC9B,OAAO,cAAc,CACnB,MAAM,EACN,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,EACvD,SAAS,CACa,CAAA;AAC1B,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,yBAAyB,CACvC,MAAmB,EACnB,MAAc,EACd,UAAiC,EACjC,UAAkB,EAClB,OAA4B;IAE5B,OAAO,cAAc,CACnB,MAAM,EACN,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CACT,UAAU,CAAC,IAAI,CAAC;QACd,MAAM;QACN,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,QAAQ,EAAE;QACrD,UAAU;QACV,MAAM;KACP,CAAC,CAAC,GAAG,CACY,CAAA;AACxB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ProxyCaller } from './proxy-types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Create a typed Proxy for a node instance.
|
|
4
|
-
*
|
|
5
|
-
* Uses an allow-list (knownMethods) — only properties that are actual methods
|
|
6
|
-
* on the class produce call thunks. Everything else returns undefined.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createNodeProxy(caller: ProxyCaller, className: string, nodeId: string, knownMethods?: Set<string>): unknown;
|
|
9
|
-
/**
|
|
10
|
-
* Create a typed Proxy for instance methods addressed by a resolved ref raw
|
|
11
|
-
* (`@id`, a tree path, or any parseable `Path`). The wire address is
|
|
12
|
-
* `<selfRaw>::method` — class-free, so interface-keyed dispatch is legal.
|
|
13
|
-
*
|
|
14
|
-
* Used for address-only dispatch (t.classes.Type(ref)) and mixed onto BoundNode
|
|
15
|
-
* for direct method calls (node.method()).
|
|
16
|
-
*
|
|
17
|
-
* `classHint` is threaded onto the call opts only when known (concrete class);
|
|
18
|
-
* interface dispatch omits it, exactly as the wire allows.
|
|
19
|
-
*/
|
|
20
|
-
export declare function createInstanceProxy(caller: ProxyCaller, selfRaw: string, knownMethods?: ReadonlySet<string>, classHint?: string): unknown;
|
|
21
|
-
//# sourceMappingURL=node-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-proxy.d.ts","sourceRoot":"","sources":["../../src/schema/node-proxy.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAIrE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GACzB,OAAO,CA2BT;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EAClC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CA2BT"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { IdPath, toPath } from '@astrale-os/kernel-core';
|
|
2
|
-
import { InstanceMethodPath } from '@astrale-os/kernel-core/domain';
|
|
3
|
-
import { resolveCallArgs } from './call-args.js';
|
|
4
|
-
/**
|
|
5
|
-
* Create a typed Proxy for a node instance.
|
|
6
|
-
*
|
|
7
|
-
* Uses an allow-list (knownMethods) — only properties that are actual methods
|
|
8
|
-
* on the class produce call thunks. Everything else returns undefined.
|
|
9
|
-
*/
|
|
10
|
-
export function createNodeProxy(caller, className, nodeId, knownMethods) {
|
|
11
|
-
const source = IdPath.from(nodeId);
|
|
12
|
-
return new Proxy(Object.create(null), {
|
|
13
|
-
get(_target, prop) {
|
|
14
|
-
if (typeof prop !== 'string')
|
|
15
|
-
return undefined;
|
|
16
|
-
if (knownMethods && !knownMethods.has(prop))
|
|
17
|
-
return undefined;
|
|
18
|
-
return (paramsOrOpts, maybeOpts) => {
|
|
19
|
-
const wirePath = InstanceMethodPath.from(source, prop).raw;
|
|
20
|
-
const [params, opts] = resolveCallArgs(paramsOrOpts, maybeOpts);
|
|
21
|
-
return caller(wirePath, params, opts?.credential, {
|
|
22
|
-
timeout: opts?.timeout,
|
|
23
|
-
signal: opts?.signal,
|
|
24
|
-
class: className,
|
|
25
|
-
correlationId: opts?.correlationId,
|
|
26
|
-
url: opts?.url,
|
|
27
|
-
delegation: opts?.delegation,
|
|
28
|
-
attestation: opts?.attestation,
|
|
29
|
-
skipDelegation: opts?.skipDelegation,
|
|
30
|
-
maxHops: opts?.maxHops,
|
|
31
|
-
self: opts?.self,
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Create a typed Proxy for instance methods addressed by a resolved ref raw
|
|
39
|
-
* (`@id`, a tree path, or any parseable `Path`). The wire address is
|
|
40
|
-
* `<selfRaw>::method` — class-free, so interface-keyed dispatch is legal.
|
|
41
|
-
*
|
|
42
|
-
* Used for address-only dispatch (t.classes.Type(ref)) and mixed onto BoundNode
|
|
43
|
-
* for direct method calls (node.method()).
|
|
44
|
-
*
|
|
45
|
-
* `classHint` is threaded onto the call opts only when known (concrete class);
|
|
46
|
-
* interface dispatch omits it, exactly as the wire allows.
|
|
47
|
-
*/
|
|
48
|
-
export function createInstanceProxy(caller, selfRaw, knownMethods, classHint) {
|
|
49
|
-
const source = toPath(selfRaw);
|
|
50
|
-
return new Proxy(Object.create(null), {
|
|
51
|
-
get(_target, prop) {
|
|
52
|
-
if (typeof prop !== 'string')
|
|
53
|
-
return undefined;
|
|
54
|
-
if (knownMethods && !knownMethods.has(prop))
|
|
55
|
-
return undefined;
|
|
56
|
-
return (paramsOrOpts, maybeOpts) => {
|
|
57
|
-
const wirePath = InstanceMethodPath.from(source, prop).raw;
|
|
58
|
-
const [params, opts] = resolveCallArgs(paramsOrOpts, maybeOpts);
|
|
59
|
-
return caller(wirePath, params, opts?.credential, {
|
|
60
|
-
timeout: opts?.timeout,
|
|
61
|
-
signal: opts?.signal,
|
|
62
|
-
...(classHint !== undefined ? { class: classHint } : {}),
|
|
63
|
-
correlationId: opts?.correlationId,
|
|
64
|
-
url: opts?.url,
|
|
65
|
-
delegation: opts?.delegation,
|
|
66
|
-
attestation: opts?.attestation,
|
|
67
|
-
skipDelegation: opts?.skipDelegation,
|
|
68
|
-
maxHops: opts?.maxHops,
|
|
69
|
-
self: opts?.self,
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=node-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-proxy.js","sourceRoot":"","sources":["../../src/schema/node-proxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAInE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,SAAiB,EACjB,MAAc,EACd,YAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAgB,CAAC,CAAA;IAE5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,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ACf,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,SAAS,CAAA;YAC9C,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,OAAO,SAAS,CAAA;YAE7D,OAAO,CAAC,YAAsB,EAAE,SAA4B,EAAE,EAAE;gBAC9D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAA;gBAC1D,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,eAAe,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;gBAE/D,OAAO,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE;oBAChD,OAAO,EAAE,IAAI,EAAE,OAAO;oBACtB,MAAM,EAAE,IAAI,EAAE,MAAM;oBACpB,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACxD,aAAa,EAAE,IAAI,EAAE,aAAa;oBAClC,GAAG,EAAE,IAAI,EAAE,GAAG;oBACd,UAAU,EAAE,IAAI,EAAE,UAAU;oBAC5B,WAAW,EAAE,IAAI,EAAE,WAAW;oBAC9B,cAAc,EAAE,IAAI,EAAE,cAAc;oBACpC,OAAO,EAAE,IAAI,EAAE,OAAO;oBACtB,IAAI,EAAE,IAAI,EAAE,IAAI;iBACjB,CAAC,CAAA;YACJ,CAAC,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { FunctionSchema } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Storage adapter for learned schemas. Pure I/O — the `SchemaRegistry`
|
|
4
|
-
* handles dedupe and contract-drift detection internally; persistence
|
|
5
|
-
* just moves opaque `FunctionSchema` records between memory and a
|
|
6
|
-
* durable medium.
|
|
7
|
-
*
|
|
8
|
-
* Spec §9.5.
|
|
9
|
-
*/
|
|
10
|
-
export interface SchemaPersistence {
|
|
11
|
-
/**
|
|
12
|
-
* Load every persisted schema. Called once at ClientSession construction
|
|
13
|
-
* (when `ClientSessionConfig.schemaStore` is configured). Throws wrap as
|
|
14
|
-
* `PersistenceLoadFailedError` at the ClientSession boundary.
|
|
15
|
-
*/
|
|
16
|
-
load(): Promise<FunctionSchema[]>;
|
|
17
|
-
/**
|
|
18
|
-
* Persist one schema. Called from ClientSession's registry-save path after a
|
|
19
|
-
* redirect learns a new entry. The implementation decides durability
|
|
20
|
-
* (write-through, debounced, etc.); ClientSession awaits it only to surface
|
|
21
|
-
* errors through the hook surface.
|
|
22
|
-
*/
|
|
23
|
-
save(schema: FunctionSchema): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Drop every persisted schema. Rarely the right answer — provided
|
|
26
|
-
* for test fixtures and explicit "reset" flows. ClientSession's
|
|
27
|
-
* `disconnect()` does NOT call this (spec §13.6).
|
|
28
|
-
*/
|
|
29
|
-
clear(): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/schema/persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;IAEjC;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE3C;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../src/schema/persistence.ts"],"names":[],"mappings":""}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import type { CredentialInput, z } from '@astrale-os/kernel-core';
|
|
2
|
-
import type { SelfIdentityExpr, UnresolvedIdentityExpr } from '@astrale-os/kernel-core/expression';
|
|
3
|
-
import type { AllMethods, ExtractMethodNames, ExtractMethodParams, ExtractMethodReturnValue, Schema } from '@astrale-os/kernel-dsl';
|
|
4
|
-
/**
|
|
5
|
-
* Def lookup by type name — the def-keyed surface. Classes shadow same-named
|
|
6
|
-
* interfaces (homonyms, e.g. kernel `Function`): deterministic, and mirrors the
|
|
7
|
-
* runtime insertion order in `extractMethodsByType`. Every existing consumer
|
|
8
|
-
* keys with `ClassNames<S>`, which always hits the class branch — bit-identical.
|
|
9
|
-
*/
|
|
10
|
-
export type DefOf<S extends Schema, T extends string> = T extends keyof S['classes'] ? S['classes'][T] : T extends keyof S['interfaces'] ? S['interfaces'][T] : never;
|
|
11
|
-
/** All class names in a Schema. */
|
|
12
|
-
export type ClassNames<S extends Schema> = keyof S['classes'] & string;
|
|
13
|
-
/** All dispatchable/bindable type names — classes AND interfaces (def-keyed surface). */
|
|
14
|
-
export type TypeNames<S extends Schema> = (keyof S['classes'] | keyof S['interfaces']) & string;
|
|
15
|
-
/** True if method M on def D is static. */
|
|
16
|
-
type IsStaticMethod<D, M extends string> = M extends keyof AllMethods<D> ? AllMethods<D>[M] extends {
|
|
17
|
-
config: {
|
|
18
|
-
static: true;
|
|
19
|
-
};
|
|
20
|
-
} ? true : false : false;
|
|
21
|
-
/** Instance method names (non-static). */
|
|
22
|
-
type InstanceMethodNames<D> = {
|
|
23
|
-
[M in ExtractMethodNames<D>]: IsStaticMethod<D, M> extends true ? never : M;
|
|
24
|
-
}[ExtractMethodNames<D>];
|
|
25
|
-
/** Static method names. */
|
|
26
|
-
type StaticMethodNames<D> = {
|
|
27
|
-
[M in ExtractMethodNames<D>]: IsStaticMethod<D, M> extends true ? M : never;
|
|
28
|
-
}[ExtractMethodNames<D>];
|
|
29
|
-
/**
|
|
30
|
-
* Infer caller input types from a Zod ParamShape.
|
|
31
|
-
*
|
|
32
|
-
* Preserves optionality: keys whose Zod schema is `z.optional()` or
|
|
33
|
-
* `z.default()` become TypeScript-optional, so callers can omit them. Using
|
|
34
|
-
* `z.input` is load-bearing for coercing schemas such as `pathSchema()`: a
|
|
35
|
-
* caller may provide the wire string even though handlers receive a parsed
|
|
36
|
-
* `Path` output after validation.
|
|
37
|
-
*/
|
|
38
|
-
type OptionalKeys<P> = {
|
|
39
|
-
[K in keyof P]: P[K] extends z.ZodOptional<any> | z.ZodDefault<any> ? K : never;
|
|
40
|
-
}[keyof P];
|
|
41
|
-
type RequiredKeys<P> = Exclude<keyof P, OptionalKeys<P>>;
|
|
42
|
-
type InferParams<P> = {
|
|
43
|
-
[K in RequiredKeys<P>]: P[K] extends z.ZodType ? z.input<P[K]> : never;
|
|
44
|
-
} & {
|
|
45
|
-
[K in OptionalKeys<P>]?: P[K] extends z.ZodType ? z.input<P[K]> : never;
|
|
46
|
-
};
|
|
47
|
-
/** Flatten intersections into one object (drops the empty-optional `& {}`). */
|
|
48
|
-
type Simplify<T> = {
|
|
49
|
-
[K in keyof T]: T[K];
|
|
50
|
-
};
|
|
51
|
-
/** Infer runtime param type from a method's params. */
|
|
52
|
-
type MethodParams<D, M extends string> = Simplify<InferParams<ExtractMethodParams<D, M>>>;
|
|
53
|
-
/** True when the method declares no parameters at all. */
|
|
54
|
-
type HasNoParams<P> = keyof P extends never ? true : false;
|
|
55
|
-
/** True when every declared parameter is optional. */
|
|
56
|
-
type HasOnlyOptionalParams<P> = {} extends P ? true : false;
|
|
57
|
-
/**
|
|
58
|
-
* Call signature for a single method.
|
|
59
|
-
* Empty-params: (opts?) => Promise<R>
|
|
60
|
-
* With params: (params, opts?) => Promise<R>
|
|
61
|
-
*/
|
|
62
|
-
type MethodCall<D, M extends string> = HasNoParams<MethodParams<D, M>> extends true ? (opts?: ProxyCallOptions) => Promise<ExtractMethodReturnValue<D, M>> : HasOnlyOptionalParams<MethodParams<D, M>> extends true ? (paramsOrOpts?: MethodParams<D, M> | ProxyCallOptions, opts?: ProxyCallOptions) => Promise<ExtractMethodReturnValue<D, M>> : (params: MethodParams<D, M>, opts?: ProxyCallOptions) => Promise<ExtractMethodReturnValue<D, M>>;
|
|
63
|
-
/** Instance-method proxy over a def — the unit `view(type, ref)` and `BoundNode.call` return. */
|
|
64
|
-
export type InstanceDispatch<D> = {
|
|
65
|
-
[M in InstanceMethodNames<D>]: MethodCall<D, M & string>;
|
|
66
|
-
};
|
|
67
|
-
/** Static-method proxy over a def — the unit `view(type)` returns. */
|
|
68
|
-
export type StaticDispatch<D> = {
|
|
69
|
-
[M in StaticMethodNames<D>]: MethodCall<D, M & string>;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Typed proxy for a node instance — exposes non-static methods.
|
|
73
|
-
* Legacy alias, now derived from {@link InstanceDispatch}.
|
|
74
|
-
* @deprecated prefer the .classes surface and direct methods on BoundNode
|
|
75
|
-
*/
|
|
76
|
-
export type NodeProxy<S extends Schema, K extends string> = InstanceDispatch<DefOf<S, K>>;
|
|
77
|
-
/**
|
|
78
|
-
* Typed proxy for static methods — no node instance needed.
|
|
79
|
-
* Legacy alias, now derived from {@link StaticDispatch}.
|
|
80
|
-
* @deprecated prefer the .classes surface
|
|
81
|
-
*/
|
|
82
|
-
export type ClassProxy<S extends Schema, K extends string> = StaticDispatch<DefOf<S, K>>;
|
|
83
|
-
export type ProxyCallOptions = {
|
|
84
|
-
timeout?: number;
|
|
85
|
-
signal?: AbortSignal;
|
|
86
|
-
credential?: CredentialInput;
|
|
87
|
-
/**
|
|
88
|
-
* Caller-provided correlation id — threaded into every `ClientHooks`
|
|
89
|
-
* context and onto any thrown error's `.details.correlationId`.
|
|
90
|
-
*/
|
|
91
|
-
correlationId?: string;
|
|
92
|
-
/**
|
|
93
|
-
* Override target URL for this call only. Used by orchestrators
|
|
94
|
-
* (layer D) to retarget after a redirect.
|
|
95
|
-
*/
|
|
96
|
-
url?: string;
|
|
97
|
-
class?: string;
|
|
98
|
-
delegation?: UnresolvedIdentityExpr;
|
|
99
|
-
attestation?: SelfIdentityExpr;
|
|
100
|
-
skipDelegation?: boolean;
|
|
101
|
-
maxHops?: number;
|
|
102
|
-
self?: string;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* A function that sends a method call through the client.
|
|
106
|
-
*
|
|
107
|
-
* Created at withSchema() time — closes over the client and its
|
|
108
|
-
* credential strategy. Proxies call this without knowing which
|
|
109
|
-
* client type they're working with.
|
|
110
|
-
*/
|
|
111
|
-
export type ProxyCaller = (method: string, params: Record<string, unknown>, credential?: CredentialInput, callOpts?: ProxyCallOptions) => Promise<unknown>;
|
|
112
|
-
/**
|
|
113
|
-
* A KernelClient view bound to a specific schema.
|
|
114
|
-
* Provides typed `node()` and `static()` without repeating the schema.
|
|
115
|
-
*/
|
|
116
|
-
export interface SchemaTypedClient<S extends Schema> {
|
|
117
|
-
/**
|
|
118
|
-
* Create a typed proxy for a node instance.
|
|
119
|
-
* Exposes non-static methods. CallTransport format: @nodeId::method
|
|
120
|
-
*/
|
|
121
|
-
node<K extends ClassNames<S>>(className: K, nodeId: string): NodeProxy<S, K>;
|
|
122
|
-
/**
|
|
123
|
-
* Create a typed proxy for static methods.
|
|
124
|
-
* CallTransport format: /:domain:ClassName:method
|
|
125
|
-
*/
|
|
126
|
-
static<K extends ClassNames<S>>(className: K): ClassProxy<S, K>;
|
|
127
|
-
/** The bound schema (runtime value). */
|
|
128
|
-
readonly schema: S;
|
|
129
|
-
}
|
|
130
|
-
export {};
|
|
131
|
-
//# sourceMappingURL=proxy-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-types.d.ts","sourceRoot":"","sources":["../../src/schema/proxy-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,yB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CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE5E;;;OAGG;IACH,MAAM,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAE/D,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-types.js","sourceRoot":"","sources":["../../src/schema/proxy-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { FunctionSchema } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Cross-realm brand so `isSchemaRegistry(x)` works even when two copies
|
|
4
|
-
* of `@astrale-os/kernel-client` end up in the same process (peer-dep
|
|
5
|
-
* drift, iframe + parent page, etc). `instanceof SchemaRegistry` fails
|
|
6
|
-
* in that case; the Symbol.for-based check does not.
|
|
7
|
-
*/
|
|
8
|
-
export declare const SCHEMA_REGISTRY_BRAND: unique symbol;
|
|
9
|
-
/**
|
|
10
|
-
* Client-side cache of function schemas keyed by canonical ref.
|
|
11
|
-
*
|
|
12
|
-
* Two ways to populate it:
|
|
13
|
-
* - `load(schemas)` — one-shot, rejects duplicates. Used when the caller
|
|
14
|
-
* brings the schemas with them (static domain imports).
|
|
15
|
-
* - `save(schema)` — upsert learned from a redirect response. Strict:
|
|
16
|
-
* input/output/output-mode must match any existing entry; only `binding`
|
|
17
|
-
* is allowed to change (URL relocation is legitimate, contract drift is
|
|
18
|
-
* not).
|
|
19
|
-
*/
|
|
20
|
-
export declare class SchemaRegistry {
|
|
21
|
-
readonly [SCHEMA_REGISTRY_BRAND] = true;
|
|
22
|
-
private methods;
|
|
23
|
-
load(schemas: FunctionSchema[]): void;
|
|
24
|
-
/**
|
|
25
|
-
* Upsert a schema — typically one learned from a `redirect` response.
|
|
26
|
-
*
|
|
27
|
-
* If no entry exists for the ref, inserts verbatim. If an entry exists,
|
|
28
|
-
* asserts that the contract shape (input / output / output mode) matches
|
|
29
|
-
* and updates only the `binding`. Contract drift throws — a server that
|
|
30
|
-
* ships a mismatched schema is either misconfigured or malicious.
|
|
31
|
-
*/
|
|
32
|
-
save(schema: FunctionSchema): void;
|
|
33
|
-
get(ref: string): FunctionSchema | undefined;
|
|
34
|
-
has(ref: string): boolean;
|
|
35
|
-
clear(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Type guard for `SchemaRegistry | FunctionSchema[]` unions. Works
|
|
38
|
-
* across package-duplicate realms, unlike `instanceof`.
|
|
39
|
-
*/
|
|
40
|
-
static is(value: unknown): value is SchemaRegistry;
|
|
41
|
-
/**
|
|
42
|
-
* Resolve a wire method address to its schema entry.
|
|
43
|
-
*
|
|
44
|
-
* Delegates normalization to `resolveMethodKey`. When the input lacks a
|
|
45
|
-
* namespace (an instance dispatch or a `:member:method` path), probes the
|
|
46
|
-
* `class` and `interface` namespaces in that order.
|
|
47
|
-
*/
|
|
48
|
-
resolve(method: string, classHint?: string): FunctionSchema | undefined;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/schema/registry.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMhD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,eAAuC,CAAA;AAEzE;;;;;;;;;;GAUG;AACH,qBAAa,cAAc;IACzB,QAAQ,CAAC,CAAC,qBAAqB,CAAC,QAAO;IACvC,OAAO,CAAC,OAAO,CAAoC;IAEnD,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAWpC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAcjC;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE3C;IAED,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAExB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAMjD;IAED;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAUtE;CACF"}
|
package/dist/schema/registry.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Ref } from '@astrale-os/kernel-core/domain';
|
|
2
|
-
import { dequal } from 'dequal';
|
|
3
|
-
import { resolveMethodKey } from './resolve.js';
|
|
4
|
-
const OWNER_NAMESPACES = ['class', 'interface'];
|
|
5
|
-
/**
|
|
6
|
-
* Cross-realm brand so `isSchemaRegistry(x)` works even when two copies
|
|
7
|
-
* of `@astrale-os/kernel-client` end up in the same process (peer-dep
|
|
8
|
-
* drift, iframe + parent page, etc). `instanceof SchemaRegistry` fails
|
|
9
|
-
* in that case; the Symbol.for-based check does not.
|
|
10
|
-
*/
|
|
11
|
-
export const SCHEMA_REGISTRY_BRAND = Symbol.for('astrale.SchemaRegistry');
|
|
12
|
-
/**
|
|
13
|
-
* Client-side cache of function schemas keyed by canonical ref.
|
|
14
|
-
*
|
|
15
|
-
* Two ways to populate it:
|
|
16
|
-
* - `load(schemas)` — one-shot, rejects duplicates. Used when the caller
|
|
17
|
-
* brings the schemas with them (static domain imports).
|
|
18
|
-
* - `save(schema)` — upsert learned from a redirect response. Strict:
|
|
19
|
-
* input/output/output-mode must match any existing entry; only `binding`
|
|
20
|
-
* is allowed to change (URL relocation is legitimate, contract drift is
|
|
21
|
-
* not).
|
|
22
|
-
*/
|
|
23
|
-
export class SchemaRegistry {
|
|
24
|
-
[SCHEMA_REGISTRY_BRAND] = true;
|
|
25
|
-
methods = new Map();
|
|
26
|
-
load(schemas) {
|
|
27
|
-
for (const schema of schemas) {
|
|
28
|
-
if (this.methods.has(schema.ref)) {
|
|
29
|
-
throw new Error(`SchemaRegistry: duplicate method ref "${schema.ref}". ` +
|
|
30
|
-
`A schema with this ref is already registered. ` +
|
|
31
|
-
`This can happen when two domains define the same class and method name.`);
|
|
32
|
-
}
|
|
33
|
-
this.methods.set(schema.ref, schema);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Upsert a schema — typically one learned from a `redirect` response.
|
|
38
|
-
*
|
|
39
|
-
* If no entry exists for the ref, inserts verbatim. If an entry exists,
|
|
40
|
-
* asserts that the contract shape (input / output / output mode) matches
|
|
41
|
-
* and updates only the `binding`. Contract drift throws — a server that
|
|
42
|
-
* ships a mismatched schema is either misconfigured or malicious.
|
|
43
|
-
*/
|
|
44
|
-
save(schema) {
|
|
45
|
-
const existing = this.methods.get(schema.ref);
|
|
46
|
-
if (!existing) {
|
|
47
|
-
this.methods.set(schema.ref, schema);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (!sameContract(existing, schema)) {
|
|
51
|
-
throw new Error(`SchemaRegistry.save: contract mismatch for "${schema.ref}". ` +
|
|
52
|
-
`The saved schema's input/output or output mode differs from the ` +
|
|
53
|
-
`previously registered version. Refusing to clobber a registered contract.`);
|
|
54
|
-
}
|
|
55
|
-
this.methods.set(schema.ref, { ...existing, binding: schema.binding });
|
|
56
|
-
}
|
|
57
|
-
get(ref) {
|
|
58
|
-
return this.methods.get(ref);
|
|
59
|
-
}
|
|
60
|
-
has(ref) {
|
|
61
|
-
return this.methods.has(ref);
|
|
62
|
-
}
|
|
63
|
-
clear() {
|
|
64
|
-
this.methods.clear();
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Type guard for `SchemaRegistry | FunctionSchema[]` unions. Works
|
|
68
|
-
* across package-duplicate realms, unlike `instanceof`.
|
|
69
|
-
*/
|
|
70
|
-
static is(value) {
|
|
71
|
-
return (typeof value === 'object' &&
|
|
72
|
-
value !== null &&
|
|
73
|
-
value[SCHEMA_REGISTRY_BRAND] === true);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Resolve a wire method address to its schema entry.
|
|
77
|
-
*
|
|
78
|
-
* Delegates normalization to `resolveMethodKey`. When the input lacks a
|
|
79
|
-
* namespace (an instance dispatch or a `:member:method` path), probes the
|
|
80
|
-
* `class` and `interface` namespaces in that order.
|
|
81
|
-
*/
|
|
82
|
-
resolve(method, classHint) {
|
|
83
|
-
const key = resolveMethodKey(method, classHint);
|
|
84
|
-
if (!key)
|
|
85
|
-
return undefined;
|
|
86
|
-
if (key.kind === 'ref')
|
|
87
|
-
return this.methods.get(key.ref);
|
|
88
|
-
for (const ns of OWNER_NAMESPACES) {
|
|
89
|
-
const ref = Ref.method(ns, key.owner, key.method).toString();
|
|
90
|
-
const schema = this.methods.get(ref);
|
|
91
|
-
if (schema)
|
|
92
|
-
return schema;
|
|
93
|
-
}
|
|
94
|
-
return undefined;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
98
|
-
/**
|
|
99
|
-
* Structural equality over the fields that define a contract — the pieces a
|
|
100
|
-
* client legitimately depends on matching across redirects. Uses a recursive
|
|
101
|
-
* compare (rather than `JSON.stringify`) so key-order permutations between
|
|
102
|
-
* serializers don't trigger false negatives.
|
|
103
|
-
*/
|
|
104
|
-
function sameContract(a, b) {
|
|
105
|
-
return (a.output === b.output &&
|
|
106
|
-
dequal(a.inputSchema, b.inputSchema) &&
|
|
107
|
-
dequal(a.outputSchema, b.outputSchema) &&
|
|
108
|
-
dequal(a.code, b.code));
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/schema/registry.ts"],"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AAA;YACpC,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAA;QAC3B,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAED,+EAA+E;AAE/E;;;;;GAKG;AACH,SAAS,YAAY,CAAC,CAAiB,EAAE,CAAiB;IACxD,OAAO,CACL,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC;QACpC,MAAM,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC;QACtC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CACvB,CAAA;AACH,CAAC"}
|
package/dist/schema/resolve.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A method key that hasn't been narrowed to a namespace yet.
|
|
3
|
-
* The registry probes `class` then `interface` to resolve it.
|
|
4
|
-
*/
|
|
5
|
-
export type OwnerMethod = {
|
|
6
|
-
kind: 'owner-method';
|
|
7
|
-
owner: string;
|
|
8
|
-
method: string;
|
|
9
|
-
};
|
|
10
|
-
export type ResolvedMethodKey = {
|
|
11
|
-
kind: 'ref';
|
|
12
|
-
ref: string;
|
|
13
|
-
} | OwnerMethod;
|
|
14
|
-
/**
|
|
15
|
-
* Normalize a wire method address to a registry-lookup key.
|
|
16
|
-
*
|
|
17
|
-
* Accepts any of:
|
|
18
|
-
* - A canonical `Ref` string (`class.Author.method.deactivate`) — returned as-is.
|
|
19
|
-
* - A typed `MethodPath` (`/:domain:Class:method`) — yields `{ owner, method }`.
|
|
20
|
-
* - A typed `InstanceMethodPath` (`@id::method`) — yields `{ owner, method }`
|
|
21
|
-
* using `classHint` as the owner.
|
|
22
|
-
*
|
|
23
|
-
* Returns `undefined` when the input is not a recognized method reference.
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveMethodKey(method: string, classHint?: string): ResolvedMethodKey | undefined;
|
|
26
|
-
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/schema/resolve.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjF,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAA;AAE1E;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,iBAAiB,GAAG,SAAS,CAY/B"}
|