@astrale-os/kernel-client 0.2.4 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/addressing.d.ts +32 -0
- package/dist/auth/addressing.d.ts.map +1 -0
- package/dist/auth/addressing.js +36 -0
- package/dist/auth/addressing.js.map +1 -0
- package/dist/auth/api.d.ts +69 -0
- package/dist/auth/api.d.ts.map +1 -0
- package/dist/auth/api.js +24 -0
- package/dist/auth/api.js.map +1 -0
- package/dist/auth/batch.d.ts +18 -0
- package/dist/auth/batch.d.ts.map +1 -0
- package/dist/auth/batch.js +25 -0
- package/dist/auth/batch.js.map +1 -0
- package/dist/auth/composition.d.ts +27 -0
- package/dist/auth/composition.d.ts.map +1 -0
- package/dist/auth/composition.js +83 -0
- package/dist/auth/composition.js.map +1 -0
- package/dist/auth/index.d.ts +14 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +9 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/minting.d.ts +35 -0
- package/dist/auth/minting.d.ts.map +1 -0
- package/dist/auth/minting.js +35 -0
- package/dist/auth/minting.js.map +1 -0
- package/dist/auth/permissions.d.ts +55 -0
- package/dist/auth/permissions.d.ts.map +1 -0
- package/dist/auth/permissions.js +47 -0
- package/dist/auth/permissions.js.map +1 -0
- package/dist/auth/principal.d.ts +19 -0
- package/dist/auth/principal.d.ts.map +1 -0
- package/dist/auth/principal.js +46 -0
- package/dist/auth/principal.js.map +1 -0
- package/dist/errors/errors.d.ts +53 -0
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/errors.js +69 -1
- package/dist/errors/errors.js.map +1 -1
- package/dist/errors/guards.d.ts +39 -0
- package/dist/errors/guards.d.ts.map +1 -0
- package/dist/errors/guards.js +127 -0
- package/dist/errors/guards.js.map +1 -0
- package/dist/errors/index.d.ts +4 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +2 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/graph/api.d.ts +82 -0
- package/dist/graph/api.d.ts.map +1 -0
- package/dist/graph/api.js +64 -0
- package/dist/graph/api.js.map +1 -0
- package/dist/graph/index.d.ts +24 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +20 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/mutate/builder.d.ts +108 -0
- package/dist/graph/mutate/builder.d.ts.map +1 -0
- package/dist/graph/mutate/builder.js +127 -0
- package/dist/graph/mutate/builder.js.map +1 -0
- package/dist/graph/mutate/index.d.ts +5 -0
- package/dist/graph/mutate/index.d.ts.map +1 -0
- package/dist/graph/mutate/index.js +3 -0
- package/dist/graph/mutate/index.js.map +1 -0
- package/dist/graph/mutate/shorthands.d.ts +42 -0
- package/dist/graph/mutate/shorthands.d.ts.map +1 -0
- package/dist/graph/mutate/shorthands.js +65 -0
- package/dist/graph/mutate/shorthands.js.map +1 -0
- package/dist/graph/named.d.ts +38 -0
- package/dist/graph/named.d.ts.map +1 -0
- package/dist/graph/named.js +47 -0
- package/dist/graph/named.js.map +1 -0
- package/dist/graph/query/builder.d.ts +116 -0
- package/dist/graph/query/builder.d.ts.map +1 -0
- package/dist/graph/query/builder.js +136 -0
- package/dist/graph/query/builder.js.map +1 -0
- package/dist/graph/query/edge-ref.d.ts +13 -0
- package/dist/graph/query/edge-ref.d.ts.map +1 -0
- package/dist/graph/query/edge-ref.js +56 -0
- package/dist/graph/query/edge-ref.js.map +1 -0
- package/dist/graph/query/edges.d.ts +10 -0
- package/dist/graph/query/edges.d.ts.map +1 -0
- package/dist/graph/query/edges.js +11 -0
- package/dist/graph/query/edges.js.map +1 -0
- package/dist/graph/query/errors.d.ts +31 -0
- package/dist/graph/query/errors.d.ts.map +1 -0
- package/dist/graph/query/errors.js +28 -0
- package/dist/graph/query/errors.js.map +1 -0
- package/dist/graph/query/filter.d.ts +50 -0
- package/dist/graph/query/filter.d.ts.map +1 -0
- package/dist/graph/query/filter.js +32 -0
- package/dist/graph/query/filter.js.map +1 -0
- package/dist/graph/query/index.d.ts +12 -0
- package/dist/graph/query/index.d.ts.map +1 -0
- package/dist/graph/query/index.js +7 -0
- package/dist/graph/query/index.js.map +1 -0
- package/dist/graph/query/lower.d.ts +30 -0
- package/dist/graph/query/lower.d.ts.map +1 -0
- package/dist/graph/query/lower.js +171 -0
- package/dist/graph/query/lower.js.map +1 -0
- package/dist/graph/query/shorthands.d.ts +34 -0
- package/dist/graph/query/shorthands.d.ts.map +1 -0
- package/dist/graph/query/shorthands.js +71 -0
- package/dist/graph/query/shorthands.js.map +1 -0
- package/dist/graph/query/traverse.d.ts +59 -0
- package/dist/graph/query/traverse.d.ts.map +1 -0
- package/dist/graph/query/traverse.js +144 -0
- package/dist/graph/query/traverse.js.map +1 -0
- package/dist/graph/result/envelope.d.ts +37 -0
- package/dist/graph/result/envelope.d.ts.map +1 -0
- package/dist/graph/result/envelope.js +59 -0
- package/dist/graph/result/envelope.js.map +1 -0
- package/dist/graph/result/index.d.ts +6 -0
- package/dist/graph/result/index.d.ts.map +1 -0
- package/dist/graph/result/index.js +4 -0
- package/dist/graph/result/index.js.map +1 -0
- package/dist/graph/result/next.d.ts +16 -0
- package/dist/graph/result/next.d.ts.map +1 -0
- package/dist/graph/result/next.js +77 -0
- package/dist/graph/result/next.js.map +1 -0
- package/dist/graph/result/paged.d.ts +30 -0
- package/dist/graph/result/paged.d.ts.map +1 -0
- package/dist/graph/result/paged.js +41 -0
- package/dist/graph/result/paged.js.map +1 -0
- package/dist/graph/wire.d.ts +33 -0
- package/dist/graph/wire.d.ts.map +1 -0
- package/dist/graph/wire.js +16 -0
- package/dist/graph/wire.js.map +1 -0
- package/dist/index.d.ts +11 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/bound/binder.d.ts +49 -0
- package/dist/schema/bound/binder.d.ts.map +1 -0
- package/dist/schema/bound/binder.js +192 -0
- package/dist/schema/bound/binder.js.map +1 -0
- package/dist/schema/bound/bound-node.d.ts +89 -0
- package/dist/schema/bound/bound-node.d.ts.map +1 -0
- package/dist/schema/bound/bound-node.js +77 -0
- package/dist/schema/bound/bound-node.js.map +1 -0
- package/dist/schema/bound/index.d.ts +10 -0
- package/dist/schema/bound/index.d.ts.map +1 -0
- package/dist/schema/bound/index.js +5 -0
- package/dist/schema/bound/index.js.map +1 -0
- package/dist/schema/bound/view.d.ts +48 -0
- package/dist/schema/bound/view.d.ts.map +1 -0
- package/dist/schema/bound/view.js +90 -0
- package/dist/schema/bound/view.js.map +1 -0
- package/dist/schema/bound/write-props.d.ts +38 -0
- package/dist/schema/bound/write-props.d.ts.map +1 -0
- package/dist/schema/bound/write-props.js +2 -0
- package/dist/schema/bound/write-props.js.map +1 -0
- package/dist/schema/extract.d.ts +12 -0
- package/dist/schema/extract.d.ts.map +1 -1
- package/dist/schema/extract.js +16 -0
- package/dist/schema/extract.js.map +1 -1
- package/dist/schema/index.d.ts +7 -3
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +4 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/node-proxy.d.ts +9 -0
- package/dist/schema/node-proxy.d.ts.map +1 -1
- package/dist/schema/node-proxy.js +31 -1
- package/dist/schema/node-proxy.js.map +1 -1
- package/dist/{persistence → schema}/persistence.d.ts +1 -22
- package/dist/schema/persistence.d.ts.map +1 -0
- package/dist/schema/persistence.js +2 -0
- package/dist/schema/persistence.js.map +1 -0
- package/dist/schema/proxy-types.d.ts +28 -22
- package/dist/schema/proxy-types.d.ts.map +1 -1
- package/dist/schema/registry.d.ts +1 -2
- package/dist/schema/registry.d.ts.map +1 -1
- package/dist/schema/registry.js +1 -2
- package/dist/schema/registry.js.map +1 -1
- package/dist/session/bound.d.ts.map +1 -1
- package/dist/session/bound.js +15 -2
- package/dist/session/bound.js.map +1 -1
- package/dist/session/client-session.d.ts +1 -1
- package/dist/session/client-session.d.ts.map +1 -1
- package/dist/session/client-session.js +5 -5
- package/dist/session/client-session.js.map +1 -1
- package/dist/session/config.d.ts +8 -4
- package/dist/session/config.d.ts.map +1 -1
- package/dist/{delegation → session/delegation}/cache.d.ts +3 -4
- package/dist/session/delegation/cache.d.ts.map +1 -0
- package/dist/session/delegation/cache.js.map +1 -0
- package/dist/{delegation → session/delegation}/errors.d.ts +1 -1
- package/dist/session/delegation/errors.d.ts.map +1 -0
- package/dist/{delegation → session/delegation}/errors.js +1 -1
- package/dist/session/delegation/errors.js.map +1 -0
- package/dist/session/delegation/policy.d.ts.map +1 -0
- package/dist/{delegation → session/delegation}/policy.js +1 -1
- package/dist/session/delegation/policy.js.map +1 -0
- package/dist/session/delegation-mint.d.ts +13 -0
- package/dist/session/delegation-mint.d.ts.map +1 -0
- package/dist/session/delegation-mint.js +31 -0
- package/dist/session/delegation-mint.js.map +1 -0
- package/dist/session/errors/index.d.ts +2 -2
- package/dist/session/errors/index.d.ts.map +1 -1
- package/dist/session/errors/index.js +2 -2
- package/dist/session/errors/index.js.map +1 -1
- package/dist/session/helpers.js +2 -2
- package/dist/session/helpers.js.map +1 -1
- package/dist/session/index.d.ts +9 -1
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +6 -1
- package/dist/session/index.js.map +1 -1
- package/dist/{redirect → session/redirect}/errors.d.ts +1 -1
- package/dist/session/redirect/errors.d.ts.map +1 -0
- package/dist/{redirect → session/redirect}/errors.js +1 -1
- package/dist/session/redirect/errors.js.map +1 -0
- package/dist/session/redirect/policy.d.ts.map +1 -0
- package/dist/{redirect → session/redirect}/policy.js +1 -1
- package/dist/session/redirect/policy.js.map +1 -0
- package/dist/session/types.d.ts +13 -2
- package/dist/session/types.d.ts.map +1 -1
- package/dist/store/canonicalize.d.ts +44 -0
- package/dist/store/canonicalize.d.ts.map +1 -0
- package/dist/store/canonicalize.js +0 -0
- package/dist/store/canonicalize.js.map +1 -0
- package/dist/store/entities.d.ts +81 -0
- package/dist/store/entities.d.ts.map +1 -0
- package/dist/store/entities.js +202 -0
- package/dist/store/entities.js.map +1 -0
- package/dist/store/index.d.ts +26 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +19 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/invalidate.d.ts +66 -0
- package/dist/store/invalidate.d.ts.map +1 -0
- package/dist/store/invalidate.js +117 -0
- package/dist/store/invalidate.js.map +1 -0
- package/dist/store/memory.d.ts +97 -0
- package/dist/store/memory.d.ts.map +1 -0
- package/dist/store/memory.js +790 -0
- package/dist/store/memory.js.map +1 -0
- package/dist/store/overlay.d.ts +118 -0
- package/dist/store/overlay.d.ts.map +1 -0
- package/dist/store/overlay.js +237 -0
- package/dist/store/overlay.js.map +1 -0
- package/dist/store/schedule.d.ts +31 -0
- package/dist/store/schedule.d.ts.map +1 -0
- package/dist/store/schedule.js +76 -0
- package/dist/store/schedule.js.map +1 -0
- package/dist/store/shapes.d.ts +92 -0
- package/dist/store/shapes.d.ts.map +1 -0
- package/dist/store/shapes.js +369 -0
- package/dist/store/shapes.js.map +1 -0
- package/dist/store/types.d.ts +168 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +7 -0
- package/dist/store/types.js.map +1 -0
- package/dist/transport/fetch.d.ts +1 -1
- package/dist/transport/fetch.js +1 -1
- package/package.json +17 -33
- package/dist/delegation/cache.d.ts.map +0 -1
- package/dist/delegation/cache.js.map +0 -1
- package/dist/delegation/errors.d.ts.map +0 -1
- package/dist/delegation/errors.js.map +0 -1
- package/dist/delegation/index.d.ts +0 -6
- package/dist/delegation/index.d.ts.map +0 -1
- package/dist/delegation/index.js +0 -4
- package/dist/delegation/index.js.map +0 -1
- package/dist/delegation/policy.d.ts.map +0 -1
- package/dist/delegation/policy.js.map +0 -1
- package/dist/persistence/index.d.ts +0 -3
- package/dist/persistence/index.d.ts.map +0 -1
- package/dist/persistence/index.js +0 -2
- package/dist/persistence/index.js.map +0 -1
- package/dist/persistence/persistence.d.ts.map +0 -1
- package/dist/persistence/persistence.js +0 -32
- package/dist/persistence/persistence.js.map +0 -1
- package/dist/redirect/errors.d.ts.map +0 -1
- package/dist/redirect/errors.js.map +0 -1
- package/dist/redirect/index.d.ts +0 -4
- package/dist/redirect/index.d.ts.map +0 -1
- package/dist/redirect/index.js +0 -3
- package/dist/redirect/index.js.map +0 -1
- package/dist/redirect/policy.d.ts.map +0 -1
- package/dist/redirect/policy.js.map +0 -1
- /package/dist/{delegation → session/delegation}/cache.js +0 -0
- /package/dist/{delegation → session/delegation}/policy.d.ts +0 -0
- /package/dist/{redirect → session/redirect}/policy.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { IdentityPickerError, PersistenceLoadFailedError, RegistryWriteFailedError, SchemaOwnershipConflictError, UnresolvedIdentityError, } from './session-errors';
|
|
2
2
|
export { ClientSessionError } from '../../errors/session-error';
|
|
3
|
-
export { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from '
|
|
3
|
+
export { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from '../delegation/errors';
|
|
4
4
|
export { PoolClosedError } from '../../pool/errors';
|
|
5
|
-
export { HopLimitExceededError, RedirectPolicyError, RedirectRefusedError, } from '
|
|
5
|
+
export { HopLimitExceededError, RedirectPolicyError, RedirectRefusedError, } from '../redirect/errors';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/session/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/session/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA"}
|
|
@@ -2,7 +2,7 @@ export { IdentityPickerError, PersistenceLoadFailedError, RegistryWriteFailedErr
|
|
|
2
2
|
// Re-exports so consumers catching every ClientSession-thrown shape have one
|
|
3
3
|
// import surface — each still ships from its owning subpath.
|
|
4
4
|
export { ClientSessionError } from '../../errors/session-error';
|
|
5
|
-
export { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from '
|
|
5
|
+
export { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from '../delegation/errors';
|
|
6
6
|
export { PoolClosedError } from '../../pool/errors';
|
|
7
|
-
export { HopLimitExceededError, RedirectPolicyError, RedirectRefusedError, } from '
|
|
7
|
+
export { HopLimitExceededError, RedirectPolicyError, RedirectRefusedError, } from '../redirect/errors';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/session/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AAEzB,6EAA6E;AAC7E,6DAA6D;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/session/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AAEzB,6EAA6E;AAC7E,6DAA6D;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA"}
|
package/dist/session/helpers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from '../delegation/errors';
|
|
2
1
|
import { ClientSessionError } from '../errors/session-error';
|
|
3
2
|
import { PoolClosedError } from '../pool/errors';
|
|
4
|
-
import {
|
|
3
|
+
import { DelegationMintError, DelegationPolicyError, DelegationRefusedError, } from './delegation/errors';
|
|
5
4
|
import { IdentityPickerError, PersistenceLoadFailedError, RegistryWriteFailedError, UnresolvedIdentityError, } from './errors/session-errors';
|
|
5
|
+
import { RedirectPolicyError } from './redirect/errors';
|
|
6
6
|
/**
|
|
7
7
|
* Unwrap a successful `SendResult` / `SendStreamResult` / `SendBinaryResult`
|
|
8
8
|
* to the post-orchestration shape ClientSession hands back to the caller. Redirect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/session/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/session/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EA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IACxE,IAAI,GAAG,YAAY,mBAAmB;QAAE,OAAO,iBAAiB,CAAA;IAChE,IAAI,GAAG,YAAY,qBAAqB;QAAE,OAAO,mBAAmB,CAAA;IACpE,IAAI,GAAG,YAAY,mBAAmB;QAAE,OAAO,iBAAiB,CAAA;IAChE,IAAI,GAAG,YAAY,sBAAsB;QAAE,OAAO,oBAAoB,CAAA;IACtE,IAAI,GAAG,YAAY,uBAAuB,IAAI,GAAG,YAAY,mBAAmB;QAC9E,OAAO,UAAU,CAAA;IACnB,IAAI,GAAG,YAAY,eAAe;QAAE,OAAO,SAAS,CAAA;IACpD,IAAI,GAAG,YAAY,kBAAkB;QAAE,OAAO,SAAS,CAAA;IACvD,OAAO,WAAW,CAAA;AACpB,CAAC"}
|
package/dist/session/index.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
export { ClientSession } from './client-session';
|
|
2
|
+
export { delegationMintVia } from './delegation-mint';
|
|
2
3
|
export type { IdentityInput, ClientSessionCallOptions, ClientSessionConfig } from './config';
|
|
3
4
|
export type { BoundClientSessionView, SchemaTypedClientSession } from './types';
|
|
4
5
|
export type { AfterCallCtx, AfterSignalCtx, BeforeCallCtx, DelegationMintCtx, DelegationRefusedCtx, RedirectFollowCtx, RedirectRefusedCtx, ClientSessionErrorCtx, ClientSessionHooks, ClientSessionHop, } from './hooks';
|
|
5
|
-
export {
|
|
6
|
+
export type { RedirectDecision, RedirectHop, RedirectPolicy } from './redirect/policy';
|
|
7
|
+
export { allowAllPolicy, allowlistPolicy, promptPolicy, strictPolicy } from './redirect/policy';
|
|
8
|
+
export type { DelegationContext, DelegationDecision, DelegationPolicy } from './delegation/policy';
|
|
9
|
+
export { allowAllDelegations, allowlistDelegations, promptDelegations, scopedSelf, } from './delegation/policy';
|
|
10
|
+
export { DelegationCache } from './delegation/cache';
|
|
11
|
+
export type { DelegationCacheConfig, DelegationMintFn, DelegationMintResult, } from './delegation/cache';
|
|
12
|
+
export type { SchemaPersistence } from '../schema/persistence';
|
|
13
|
+
export { ClientSessionError, DelegationMintError, DelegationPolicyError, DelegationRefusedError, HopLimitExceededError, IdentityPickerError, PersistenceLoadFailedError, PoolClosedError, RedirectPolicyError, RedirectRefusedError, RegistryWriteFailedError, SchemaOwnershipConflictError, UnresolvedIdentityError, } from './errors';
|
|
6
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC5F,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAC/E,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC5F,YAAY,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAC/E,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,SAAS,CAAA;AAKhB,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC/F,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,YAAY,EACV,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAG9D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,UAAU,CAAA"}
|
package/dist/session/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export { ClientSession } from './client-session';
|
|
2
|
-
export {
|
|
2
|
+
export { delegationMintVia } from './delegation-mint';
|
|
3
|
+
export { allowAllPolicy, allowlistPolicy, promptPolicy, strictPolicy } from './redirect/policy';
|
|
4
|
+
export { allowAllDelegations, allowlistDelegations, promptDelegations, scopedSelf, } from './delegation/policy';
|
|
5
|
+
export { DelegationCache } from './delegation/cache';
|
|
6
|
+
// Every ClientSession-thrown error shape, one import surface.
|
|
7
|
+
export { ClientSessionError, DelegationMintError, DelegationPolicyError, DelegationRefusedError, HopLimitExceededError, IdentityPickerError, PersistenceLoadFailedError, PoolClosedError, RedirectPolicyError, RedirectRefusedError, RegistryWriteFailedError, SchemaOwnershipConflictError, UnresolvedIdentityError, } from './errors';
|
|
3
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAoBrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE/F,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAQpD,8DAA8D;AAC9D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/session/redirect/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;aAExC,WAAW,EAAE,eAAe;aAC5B,MAAM,EAAE,MAAM;IAFhC,YACkB,WAAW,EAAE,eAAe,EAC5B,MAAM,EAAE,MAAM,EAC9B,OAAO,CAAC,EAAE,YAAY,E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CAAE,GAAG,cAAc,CAOzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,QAAQ,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9F,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;CACjC,GAAG,cAAc,CAajB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { raceAgainstSignal } from '
|
|
1
|
+
import { raceAgainstSignal } from '../../util/race-signal';
|
|
2
2
|
// ─── Factories ───────────────────────────────────────────────────────────────
|
|
3
3
|
/**
|
|
4
4
|
* Follow every redirect. Default when `ClientSessionConfig.redirect` is absent.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../src/session/redirect/policy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAuC1D,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;KACjC,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,qCAAqC,EAAE,CAAC;KACjF,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAAyC;IACvE,OAAO;QACL,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE;YACtB,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;gBAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;YACxD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,yBAAyB,WAAW,CAAC,GAAG,EAAE,EAAE,CAAA;QAC9E,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,IAG5B;IACC,OAAO;QACL,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE;YAC1D,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC;gBAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;YAC1D,iEAAiE;YACjE,+EAA+E;YAC/E,IAAI,MAAM,EAAE,OAAO;gBACjB,MAAM,MAAM,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAA;YAC7E,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;YAClF,IAAI,QAAQ;gBAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;YACrC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gCAAgC,WAAW,CAAC,GAAG,EAAE,EAAE,CAAA;QACrF,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/session/types.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CredentialInput } from '@astrale-os/kernel-core';
|
|
2
2
|
import type { Schema } from '@astrale-os/kernel-dsl';
|
|
3
|
+
import type { AuthApi } from '../auth';
|
|
3
4
|
import type { BinaryFns, CallFns, FnMap, SignalFns, StreamFns } from '../client/fn-map';
|
|
5
|
+
import type { GraphApi } from '../graph';
|
|
6
|
+
import type { SchemaBoundView } from '../schema/bound';
|
|
4
7
|
import type { ClassNames, ClassProxy, NodeProxy } from '../schema/proxy-types';
|
|
5
8
|
import type { SchemaRegistry } from '../schema/registry';
|
|
6
9
|
import type { FunctionSchema } from '../schema/types';
|
|
@@ -10,16 +13,24 @@ import type { ClientSessionCallOptions } from './config';
|
|
|
10
13
|
* Credential-bound view over a `ClientSession`. Mirrors `BoundClientView` but over
|
|
11
14
|
* the orchestration surface — dispatch primitives return the unwrapped
|
|
12
15
|
* post-orchestration shape, not the discriminated `Send*Result` union.
|
|
16
|
+
*
|
|
17
|
+
* The `GraphApi` read/write sugar is flattened directly onto the view — the
|
|
18
|
+
* surface the shell/SDK previously reached via `.graph` — bound to this view's
|
|
19
|
+
* credential.
|
|
20
|
+
*
|
|
21
|
+
* The control plane rides alongside as the namespaced `auth` ({@link AuthApi}),
|
|
22
|
+
* dispatched with this same credential.
|
|
13
23
|
*/
|
|
14
|
-
export type BoundClientSessionView<M extends FnMap> = {
|
|
24
|
+
export type BoundClientSessionView<M extends FnMap> = GraphApi & {
|
|
15
25
|
readonly default: string;
|
|
16
26
|
readonly registry: SchemaRegistry;
|
|
27
|
+
readonly auth: AuthApi;
|
|
17
28
|
call<K extends CallFns<M>>(method: K, params: M[K]['params'], opts?: ClientSessionCallOptions): Promise<M[K]['result']>;
|
|
18
29
|
stream<K extends StreamFns<M>>(method: K, params: M[K]['params'], opts?: ClientSessionCallOptions): Promise<AsyncIterable<M[K]['result']>>;
|
|
19
30
|
binary<K extends BinaryFns<M>>(method: K, params: M[K]['params'], opts?: ClientSessionCallOptions): Promise<BinaryResponse>;
|
|
20
31
|
signal<K extends SignalFns<M>>(method: K, params: M[K]['params'], opts?: ClientSessionCallOptions): void;
|
|
21
32
|
describe(method: string): FunctionSchema | undefined;
|
|
22
|
-
withSchema<S extends Schema>(schema: S):
|
|
33
|
+
withSchema<S extends Schema>(schema: S): SchemaBoundView<S, M>;
|
|
23
34
|
as(credential: CredentialInput | (() => CredentialInput)): BoundClientSessionView<M>;
|
|
24
35
|
};
|
|
25
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAExD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAA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C,CAAC,CAAC,CAAC,QAAQ,CAAC,EACtB,IAAI,CAAC,EAAE,wBAAwB,GAC9B,IAAI,CAAA;IACP,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAA;IACpD,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9D,EAAE,CAAC,UAAU,EAAE,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;CACrF,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,MAAM;IACxD,IAAI,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC5E,MAAM,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC/D,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CACnB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape keying (FRONTEND §5.4).
|
|
3
|
+
*
|
|
4
|
+
* A shape's identity is the canonical form of its query AST, scoped to a
|
|
5
|
+
* principal. `canonicalizeAST` strips page cursors, normalizes defaults, and
|
|
6
|
+
* fixes field order so two spellings of the same read collapse to one key;
|
|
7
|
+
* `shapeKey` additionally re-anchors roots to resolved node ids so a relative
|
|
8
|
+
* path and an `@<id>` addressing the same root never fragment the cache.
|
|
9
|
+
*/
|
|
10
|
+
import type { PathLike, QueryASTInput } from '@astrale-os/kernel-core';
|
|
11
|
+
import type { GatherBuilder, QuerySource } from '../graph';
|
|
12
|
+
/** The inputs the replica accepts for a read — the same the raw floor takes. */
|
|
13
|
+
export type ShapeInput = QueryASTInput | ((q: QuerySource) => GatherBuilder) | PathLike;
|
|
14
|
+
/** Resolve a raw root address to a node id, or `undefined` when unresolved. */
|
|
15
|
+
export type RootResolver = (raw: string) => string | undefined;
|
|
16
|
+
/** Normalize any {@link ShapeInput} to a raw-string AST value (page state intact). */
|
|
17
|
+
export declare function shapeInputToAST(input: ShapeInput): QueryASTInput;
|
|
18
|
+
/**
|
|
19
|
+
* Canonicalize an AST (FRONTEND §5.4 steps 1–2): drop every `page.cursor`
|
|
20
|
+
* (keep `limit`), default an omitted move `depth` to 1, drop a redundant
|
|
21
|
+
* single-hop gather `depth`, dedupe + sort roots, and rebuild every object in
|
|
22
|
+
* a fixed field order. The result is a re-runnable, comparison-stable AST.
|
|
23
|
+
*/
|
|
24
|
+
export declare function canonicalizeAST(ast: QueryASTInput): QueryASTInput;
|
|
25
|
+
/**
|
|
26
|
+
* The scoped, re-anchored shape key. Roots resolvable through `resolveRoot`
|
|
27
|
+
* collapse to their `@<id>` form (input-form and id-form share one key);
|
|
28
|
+
* unresolved roots stay in raw input form (a provisional identity until a
|
|
29
|
+
* first evaluation resolves them, per §5.4 step 3).
|
|
30
|
+
*/
|
|
31
|
+
export declare function shapeKey(ast: QueryASTInput, scope: string, resolveRoot?: RootResolver): string;
|
|
32
|
+
/**
|
|
33
|
+
* Drop every page `cursor` from an AST's expands (keeping `limit`), leaving the
|
|
34
|
+
* page-1 base. A shape's `baseAst` must be cursor-free so a refetch replays from
|
|
35
|
+
* the start; the continuation lives exclusively in the shape's `contAst`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function stripCursors(ast: QueryASTInput): QueryASTInput;
|
|
38
|
+
/**
|
|
39
|
+
* JSON with object keys sorted recursively — a stable serialization regardless
|
|
40
|
+
* of insertion order, so the canonical AST hashes identically however it was
|
|
41
|
+
* assembled. Arrays keep their (already-canonicalized) order.
|
|
42
|
+
*/
|
|
43
|
+
export declare function stableStringify(value: unknown): string;
|
|
44
|
+
//# sourceMappingURL=canonicalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalize.d.ts","sourceRoot":"","sources":["../../src/store/canonicalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAItE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAI1D,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,KAAK,aAAa,CAAC,GAAG,QAAQ,CAAA;AAEvF,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAA;AAM9D,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,aAAa,CAIhE;AAMD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAOjE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,YAAY,GAAG,MAAM,CAU9F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAa9D;AAyCD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAUtD"}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalize.js","sourceRoot":"","sources":["../../src/store/canonicalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAI/C,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAY5B,sFAA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AAC;AAED,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAA;IACvF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAA;IAC5E,MAAM,GAAG,GAAG,KAAgC,CAAA;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IACpC,MAAM,IAAI,GAAG,IAAI;SACd,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;SACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7D,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,IAAI,IAAI,GAAG,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EntityStore (FRONTEND §5.1) — the normalized confirmed store.
|
|
3
|
+
*
|
|
4
|
+
* Nodes keyed by `NodeId`, edges by `toEdgeKey`, with secondary indexes (path
|
|
5
|
+
* incl. alias sidecar, class, endpoint) mirroring kernel-core's `Graph`. Deletes
|
|
6
|
+
* leave a TOMBSTONE so a stale overlapping read cannot resurrect them. Merge
|
|
7
|
+
* ordering is by an integer `seq` — an INTERIM local logical clock stamped by
|
|
8
|
+
* the memory (result-arrival order), since the wire carries no journal seq /
|
|
9
|
+
* entity rev yet (§6.1/§6.2 blockers); `seq`-wins with the delete carve-out.
|
|
10
|
+
*/
|
|
11
|
+
import type { EdgeKey, GraphEdgeWire, GraphNodeWire } from '../graph';
|
|
12
|
+
/** A confirmed node record: the wire plus the `seq` of the result that delivered it. */
|
|
13
|
+
export interface NodeRecord {
|
|
14
|
+
readonly wire: GraphNodeWire;
|
|
15
|
+
readonly seq: number;
|
|
16
|
+
}
|
|
17
|
+
/** A confirmed edge record: the wire plus its delivering `seq`. */
|
|
18
|
+
export interface EdgeRecord {
|
|
19
|
+
readonly wire: GraphEdgeWire;
|
|
20
|
+
readonly seq: number;
|
|
21
|
+
}
|
|
22
|
+
type NodeId = GraphNodeWire['id'];
|
|
23
|
+
/** A `function.get` result as the store integrates it. */
|
|
24
|
+
export interface ResultLike {
|
|
25
|
+
readonly nodes: readonly GraphNodeWire[];
|
|
26
|
+
readonly edges: readonly GraphEdgeWire[];
|
|
27
|
+
readonly aliases?: ReadonlyArray<readonly [NodeId, string]>;
|
|
28
|
+
}
|
|
29
|
+
export declare class EntityStore {
|
|
30
|
+
private readonly nodes;
|
|
31
|
+
private readonly edges;
|
|
32
|
+
private readonly nodeTombstones;
|
|
33
|
+
private readonly edgeTombstones;
|
|
34
|
+
private readonly byPath;
|
|
35
|
+
private readonly byClass;
|
|
36
|
+
private readonly byEndpoint;
|
|
37
|
+
/** Alias paths sidecar-indexed per node id, so deindex/gc can undo them. */
|
|
38
|
+
private readonly aliasPaths;
|
|
39
|
+
private _version;
|
|
40
|
+
/** Bumps on every mutation — a cheap change signal for snapshot caches. */
|
|
41
|
+
get version(): number;
|
|
42
|
+
/** The live record for `id`, or `undefined` when absent or tombstoned. */
|
|
43
|
+
node(id: NodeId): NodeRecord | undefined;
|
|
44
|
+
edge(key: EdgeKey): EdgeRecord | undefined;
|
|
45
|
+
isNodeTombstoned(id: NodeId): boolean;
|
|
46
|
+
isEdgeTombstoned(key: EdgeKey): boolean;
|
|
47
|
+
/** All live node ids reachable at the given path (primary + alias forms). */
|
|
48
|
+
nodeIdsByPath(raw: string): NodeId[];
|
|
49
|
+
/** First live node id at `raw`, or `undefined`. The store's root resolver. */
|
|
50
|
+
resolvePathToId(raw: string): NodeId | undefined;
|
|
51
|
+
nodeIdsByClass(raw: string): NodeId[];
|
|
52
|
+
/** Live edge keys incident to a node at path `raw` (either endpoint). */
|
|
53
|
+
edgeKeysByEndpoint(raw: string): EdgeKey[];
|
|
54
|
+
/**
|
|
55
|
+
* Fold a read result into the confirmed store at `seq`. Tombstoned entities
|
|
56
|
+
* are NOT resurrected (the delete carve-out); everything else upserts under
|
|
57
|
+
* `seq`-wins. Aliases from the sidecar extend the path index (multi-key).
|
|
58
|
+
*/
|
|
59
|
+
integrate(result: ResultLike, seq: number): void;
|
|
60
|
+
/** Confirm a created/updated node: clear any tombstone and set the record. */
|
|
61
|
+
confirmNode(wire: GraphNodeWire, seq: number): void;
|
|
62
|
+
confirmEdge(wire: GraphEdgeWire, seq: number): void;
|
|
63
|
+
/** Tombstone a node (remembered so a stale read cannot resurrect it). */
|
|
64
|
+
tombstoneNode(id: NodeId, now: number): void;
|
|
65
|
+
tombstoneEdge(key: EdgeKey, now: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* Drop entities unreachable from every retained shape, and sweep tombstones
|
|
68
|
+
* older than `tombstoneTtlMs`. Reachability is supplied by the ShapeStore.
|
|
69
|
+
*/
|
|
70
|
+
gc(reachableNodes: ReadonlySet<NodeId>, reachableEdges: ReadonlySet<EdgeKey>, now: number, tombstoneTtlMs: number): void;
|
|
71
|
+
private upsertNode;
|
|
72
|
+
private upsertEdge;
|
|
73
|
+
private indexNode;
|
|
74
|
+
private deindexNode;
|
|
75
|
+
private indexEdge;
|
|
76
|
+
private deindexEdge;
|
|
77
|
+
private addToIndex;
|
|
78
|
+
private removeFromIndex;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRo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OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,eAAe;CAMxB"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EntityStore (FRONTEND §5.1) — the normalized confirmed store.
|
|
3
|
+
*
|
|
4
|
+
* Nodes keyed by `NodeId`, edges by `toEdgeKey`, with secondary indexes (path
|
|
5
|
+
* incl. alias sidecar, class, endpoint) mirroring kernel-core's `Graph`. Deletes
|
|
6
|
+
* leave a TOMBSTONE so a stale overlapping read cannot resurrect them. Merge
|
|
7
|
+
* ordering is by an integer `seq` — an INTERIM local logical clock stamped by
|
|
8
|
+
* the memory (result-arrival order), since the wire carries no journal seq /
|
|
9
|
+
* entity rev yet (§6.1/§6.2 blockers); `seq`-wins with the delete carve-out.
|
|
10
|
+
*/
|
|
11
|
+
import { edgeKey } from '../graph';
|
|
12
|
+
export class EntityStore {
|
|
13
|
+
nodes = new Map();
|
|
14
|
+
edges = new Map();
|
|
15
|
+
nodeTombstones = new Map();
|
|
16
|
+
edgeTombstones = new Map();
|
|
17
|
+
byPath = new Map();
|
|
18
|
+
byClass = new Map();
|
|
19
|
+
byEndpoint = new Map();
|
|
20
|
+
/** Alias paths sidecar-indexed per node id, so deindex/gc can undo them. */
|
|
21
|
+
aliasPaths = new Map();
|
|
22
|
+
_version = 0;
|
|
23
|
+
/** Bumps on every mutation — a cheap change signal for snapshot caches. */
|
|
24
|
+
get version() {
|
|
25
|
+
return this._version;
|
|
26
|
+
}
|
|
27
|
+
// ── Reads ──────────────────────────────────────────────────────────────────
|
|
28
|
+
/** The live record for `id`, or `undefined` when absent or tombstoned. */
|
|
29
|
+
node(id) {
|
|
30
|
+
return this.nodeTombstones.has(id) ? undefined : this.nodes.get(id);
|
|
31
|
+
}
|
|
32
|
+
edge(key) {
|
|
33
|
+
return this.edgeTombstones.has(key) ? undefined : this.edges.get(key);
|
|
34
|
+
}
|
|
35
|
+
isNodeTombstoned(id) {
|
|
36
|
+
return this.nodeTombstones.has(id);
|
|
37
|
+
}
|
|
38
|
+
isEdgeTombstoned(key) {
|
|
39
|
+
return this.edgeTombstones.has(key);
|
|
40
|
+
}
|
|
41
|
+
/** All live node ids reachable at the given path (primary + alias forms). */
|
|
42
|
+
nodeIdsByPath(raw) {
|
|
43
|
+
return [...(this.byPath.get(raw) ?? [])].filter((id) => !this.nodeTombstones.has(id));
|
|
44
|
+
}
|
|
45
|
+
/** First live node id at `raw`, or `undefined`. The store's root resolver. */
|
|
46
|
+
resolvePathToId(raw) {
|
|
47
|
+
return this.nodeIdsByPath(raw)[0];
|
|
48
|
+
}
|
|
49
|
+
nodeIdsByClass(raw) {
|
|
50
|
+
return [...(this.byClass.get(raw) ?? [])].filter((id) => !this.nodeTombstones.has(id));
|
|
51
|
+
}
|
|
52
|
+
/** Live edge keys incident to a node at path `raw` (either endpoint). */
|
|
53
|
+
edgeKeysByEndpoint(raw) {
|
|
54
|
+
return [...(this.byEndpoint.get(raw) ?? [])].filter((k) => !this.edgeTombstones.has(k));
|
|
55
|
+
}
|
|
56
|
+
// ── Integration (reads) ──────────────────────────────────────────────────────
|
|
57
|
+
/**
|
|
58
|
+
* Fold a read result into the confirmed store at `seq`. Tombstoned entities
|
|
59
|
+
* are NOT resurrected (the delete carve-out); everything else upserts under
|
|
60
|
+
* `seq`-wins. Aliases from the sidecar extend the path index (multi-key).
|
|
61
|
+
*/
|
|
62
|
+
integrate(result, seq) {
|
|
63
|
+
for (const wire of result.nodes) {
|
|
64
|
+
if (this.nodeTombstones.has(wire.id))
|
|
65
|
+
continue;
|
|
66
|
+
this.upsertNode(wire, seq);
|
|
67
|
+
}
|
|
68
|
+
for (const [id, path] of result.aliases ?? []) {
|
|
69
|
+
if (this.nodeTombstones.has(id) || path === this.nodes.get(id)?.wire.path)
|
|
70
|
+
continue;
|
|
71
|
+
this.addToIndex(this.byPath, path, id);
|
|
72
|
+
let paths = this.aliasPaths.get(id);
|
|
73
|
+
if (paths === undefined)
|
|
74
|
+
this.aliasPaths.set(id, (paths = new Set()));
|
|
75
|
+
paths.add(path);
|
|
76
|
+
}
|
|
77
|
+
for (const wire of result.edges) {
|
|
78
|
+
const key = edgeKey(wire);
|
|
79
|
+
if (this.edgeTombstones.has(key))
|
|
80
|
+
continue;
|
|
81
|
+
this.upsertEdge(key, wire, seq);
|
|
82
|
+
}
|
|
83
|
+
this._version++;
|
|
84
|
+
}
|
|
85
|
+
// ── Confirmation (committed mutation deltas — §6.3 future path) ───────────────
|
|
86
|
+
// NOT on the Tier-0 write path: SAFE MODE (§5.7) writes confirmed state ONLY
|
|
87
|
+
// from server read responses (`integrate`), reconciling every write by
|
|
88
|
+
// refetch. These land a real server delta once the wire carries one (§6.3).
|
|
89
|
+
/** Confirm a created/updated node: clear any tombstone and set the record. */
|
|
90
|
+
confirmNode(wire, seq) {
|
|
91
|
+
this.nodeTombstones.delete(wire.id);
|
|
92
|
+
this.upsertNode(wire, seq);
|
|
93
|
+
this._version++;
|
|
94
|
+
}
|
|
95
|
+
confirmEdge(wire, seq) {
|
|
96
|
+
const key = edgeKey(wire);
|
|
97
|
+
this.edgeTombstones.delete(key);
|
|
98
|
+
this.upsertEdge(key, wire, seq);
|
|
99
|
+
this._version++;
|
|
100
|
+
}
|
|
101
|
+
/** Tombstone a node (remembered so a stale read cannot resurrect it). */
|
|
102
|
+
tombstoneNode(id, now) {
|
|
103
|
+
const existing = this.nodes.get(id);
|
|
104
|
+
if (existing)
|
|
105
|
+
this.deindexNode(id, existing.wire);
|
|
106
|
+
this.nodes.delete(id);
|
|
107
|
+
this.nodeTombstones.set(id, now);
|
|
108
|
+
this._version++;
|
|
109
|
+
}
|
|
110
|
+
tombstoneEdge(key, now) {
|
|
111
|
+
const existing = this.edges.get(key);
|
|
112
|
+
if (existing)
|
|
113
|
+
this.deindexEdge(key, existing.wire);
|
|
114
|
+
this.edges.delete(key);
|
|
115
|
+
this.edgeTombstones.set(key, now);
|
|
116
|
+
this._version++;
|
|
117
|
+
}
|
|
118
|
+
// ── GC ───────────────────────────────────────────────────────────────────────
|
|
119
|
+
/**
|
|
120
|
+
* Drop entities unreachable from every retained shape, and sweep tombstones
|
|
121
|
+
* older than `tombstoneTtlMs`. Reachability is supplied by the ShapeStore.
|
|
122
|
+
*/
|
|
123
|
+
gc(reachableNodes, reachableEdges, now, tombstoneTtlMs) {
|
|
124
|
+
for (const [id, rec] of this.nodes) {
|
|
125
|
+
if (!reachableNodes.has(id)) {
|
|
126
|
+
this.deindexNode(id, rec.wire);
|
|
127
|
+
this.nodes.delete(id);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const [key, rec] of this.edges) {
|
|
131
|
+
if (!reachableEdges.has(key)) {
|
|
132
|
+
this.deindexEdge(key, rec.wire);
|
|
133
|
+
this.edges.delete(key);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (const [id, at] of this.nodeTombstones) {
|
|
137
|
+
if (now - at > tombstoneTtlMs)
|
|
138
|
+
this.nodeTombstones.delete(id);
|
|
139
|
+
}
|
|
140
|
+
for (const [key, at] of this.edgeTombstones) {
|
|
141
|
+
if (now - at > tombstoneTtlMs)
|
|
142
|
+
this.edgeTombstones.delete(key);
|
|
143
|
+
}
|
|
144
|
+
this._version++;
|
|
145
|
+
}
|
|
146
|
+
// ── Internals ────────────────────────────────────────────────────────────────
|
|
147
|
+
upsertNode(wire, seq) {
|
|
148
|
+
const existing = this.nodes.get(wire.id);
|
|
149
|
+
if (existing && seq < existing.seq)
|
|
150
|
+
return;
|
|
151
|
+
if (existing)
|
|
152
|
+
this.deindexNode(wire.id, existing.wire);
|
|
153
|
+
this.nodes.set(wire.id, { wire, seq });
|
|
154
|
+
this.indexNode(wire.id, wire);
|
|
155
|
+
}
|
|
156
|
+
upsertEdge(key, wire, seq) {
|
|
157
|
+
const existing = this.edges.get(key);
|
|
158
|
+
if (existing && seq < existing.seq)
|
|
159
|
+
return;
|
|
160
|
+
if (existing)
|
|
161
|
+
this.deindexEdge(key, existing.wire);
|
|
162
|
+
this.edges.set(key, { wire, seq });
|
|
163
|
+
this.indexEdge(key, wire);
|
|
164
|
+
}
|
|
165
|
+
indexNode(id, wire) {
|
|
166
|
+
this.addToIndex(this.byPath, wire.path, id);
|
|
167
|
+
this.addToIndex(this.byClass, wire.class, id);
|
|
168
|
+
}
|
|
169
|
+
deindexNode(id, wire) {
|
|
170
|
+
this.removeFromIndex(this.byPath, wire.path, id);
|
|
171
|
+
this.removeFromIndex(this.byClass, wire.class, id);
|
|
172
|
+
const aliases = this.aliasPaths.get(id);
|
|
173
|
+
if (aliases !== undefined) {
|
|
174
|
+
for (const path of aliases)
|
|
175
|
+
this.removeFromIndex(this.byPath, path, id);
|
|
176
|
+
this.aliasPaths.delete(id);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
indexEdge(key, wire) {
|
|
180
|
+
this.addToIndex(this.byEndpoint, wire.source, key);
|
|
181
|
+
this.addToIndex(this.byEndpoint, wire.target, key);
|
|
182
|
+
}
|
|
183
|
+
deindexEdge(key, wire) {
|
|
184
|
+
this.removeFromIndex(this.byEndpoint, wire.source, key);
|
|
185
|
+
this.removeFromIndex(this.byEndpoint, wire.target, key);
|
|
186
|
+
}
|
|
187
|
+
addToIndex(index, at, value) {
|
|
188
|
+
let set = index.get(at);
|
|
189
|
+
if (!set)
|
|
190
|
+
index.set(at, (set = new Set()));
|
|
191
|
+
set.add(value);
|
|
192
|
+
}
|
|
193
|
+
removeFromIndex(index, at, value) {
|
|
194
|
+
const set = index.get(at);
|
|
195
|
+
if (!set)
|
|
196
|
+
return;
|
|
197
|
+
set.delete(value);
|
|
198
|
+
if (set.size === 0)
|
|
199
|
+
index.delete(at);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/store/entities.ts"],"names":[],"m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jB,IAAI,GAAG,CAAC,IAAI,KAAK,CAAC;YAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACtC,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client-side graph memory (FRONTEND_GRAPH_DX_SPEC / SHELL_REACT_API).
|
|
3
|
+
*
|
|
4
|
+
* A partial, normalized client copy of the graph kept correct by shapes
|
|
5
|
+
* (standing queries): entity store + shape store + optimistic overlay, over a
|
|
6
|
+
* `GraphApi`. Framework-free — the React bindings layer over `createMemory`.
|
|
7
|
+
* Tier 0 (client self-invalidation) — see `memory.ts` for the interim-ordering
|
|
8
|
+
* caveats until the wire amendments (§6) land.
|
|
9
|
+
*
|
|
10
|
+
* Layout: `canonicalize` (shape keying), `entities`, `shapes`, `overlay`,
|
|
11
|
+
* `invalidate` (§5.6 matching), `memory` (the facade).
|
|
12
|
+
*/
|
|
13
|
+
export { createMemory } from './memory';
|
|
14
|
+
export type { GraphMemory } from './memory';
|
|
15
|
+
export { canonicalizeAST, shapeInputToAST, shapeKey, stableStringify, stripCursors, } from './canonicalize';
|
|
16
|
+
export type { RootResolver, ShapeInput } from './canonicalize';
|
|
17
|
+
export { EntityStore } from './entities';
|
|
18
|
+
export type { EdgeRecord, NodeRecord, ResultLike } from './entities';
|
|
19
|
+
export { ShapeStore } from './shapes';
|
|
20
|
+
export type { ShapeEntry } from './shapes';
|
|
21
|
+
export { Overlay, normalizePatch } from './overlay';
|
|
22
|
+
export type { NormalPatch, OverlayEffects, OverlayUnit } from './overlay';
|
|
23
|
+
export { affectedShapes, matchesEdge, matchesNodeStructural, subtreeDelta } from './invalidate';
|
|
24
|
+
export type { GatherSpec, InvalidateCtx, ShapeView } from './invalidate';
|
|
25
|
+
export type { GatherMeta, LiveResult, MaterializedShape, MutateOptions, ReadOptions, MemoryError, MemoryEvent, MemoryOptions, ShapeMeta, Windowed, } from './types';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,EACL,eAAe,EACf,eAAe,EACf,QAAQ,EACR,eAAe,EACf,YAAY,GACb,MAAM,gBAAgB,CAAA;AACvB,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACnD,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEzE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC/F,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExE,YAAY,EACV,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,GACT,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The client-side graph memory (FRONTEND_GRAPH_DX_SPEC / SHELL_REACT_API).
|
|
3
|
+
*
|
|
4
|
+
* A partial, normalized client copy of the graph kept correct by shapes
|
|
5
|
+
* (standing queries): entity store + shape store + optimistic overlay, over a
|
|
6
|
+
* `GraphApi`. Framework-free — the React bindings layer over `createMemory`.
|
|
7
|
+
* Tier 0 (client self-invalidation) — see `memory.ts` for the interim-ordering
|
|
8
|
+
* caveats until the wire amendments (§6) land.
|
|
9
|
+
*
|
|
10
|
+
* Layout: `canonicalize` (shape keying), `entities`, `shapes`, `overlay`,
|
|
11
|
+
* `invalidate` (§5.6 matching), `memory` (the facade).
|
|
12
|
+
*/
|
|
13
|
+
export { createMemory } from './memory';
|
|
14
|
+
export { canonicalizeAST, shapeInputToAST, shapeKey, stableStringify, stripCursors, } from './canonicalize';
|
|
15
|
+
export { EntityStore } from './entities';
|
|
16
|
+
export { ShapeStore } from './shapes';
|
|
17
|
+
export { Overlay, normalizePatch } from './overlay';
|
|
18
|
+
export { affectedShapes, matchesEdge, matchesNodeStructural, subtreeDelta } from './invalidate';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|