@astrale-os/kernel-client 0.2.4 → 0.3.0
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 +15 -31
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/result/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure cursor fold — turn a result's resume cursors back into the AST that
|
|
3
|
+
* fetches the next page. Single-root only: per-root cursors don't collapse into
|
|
4
|
+
* one AST, so multi-root continuation is the caller's.
|
|
5
|
+
*/
|
|
6
|
+
import type { QueryASTInput } from '@astrale-os/kernel-core';
|
|
7
|
+
import type { GetResultWire } from '../wire';
|
|
8
|
+
/**
|
|
9
|
+
* Fold a query result's cursors back into a continuation AST: the children
|
|
10
|
+
* cursor advances the MOVE's page, each per-`as` edge cursor advances the
|
|
11
|
+
* matching GATHER's — the same `(root × as)` keying the wire uses. Returns
|
|
12
|
+
* `null` on true exhaustion; THROWS when a cursor has no matching step (an
|
|
13
|
+
* AST/wire mismatch — dropping it would masquerade as exhaustion).
|
|
14
|
+
*/
|
|
15
|
+
export declare function nextQuery(ast: QueryASTInput, wire: GetResultWire): QueryASTInput | null;
|
|
16
|
+
//# sourceMappingURL=next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/graph/result/next.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5C;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,IAAI,CAmDvF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure cursor fold — turn a result's resume cursors back into the AST that
|
|
3
|
+
* fetches the next page. Single-root only: per-root cursors don't collapse into
|
|
4
|
+
* one AST, so multi-root continuation is the caller's.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Fold a query result's cursors back into a continuation AST: the children
|
|
8
|
+
* cursor advances the MOVE's page, each per-`as` edge cursor advances the
|
|
9
|
+
* matching GATHER's — the same `(root × as)` keying the wire uses. Returns
|
|
10
|
+
* `null` on true exhaustion; THROWS when a cursor has no matching step (an
|
|
11
|
+
* AST/wire mismatch — dropping it would masquerade as exhaustion).
|
|
12
|
+
*/
|
|
13
|
+
export function nextQuery(ast, wire) {
|
|
14
|
+
if (ast.from.length !== 1) {
|
|
15
|
+
throw new Error('nextQuery supports single-root queries only — fold multi-root cursors manually');
|
|
16
|
+
}
|
|
17
|
+
const cursors = singleRootCursors(wire.next);
|
|
18
|
+
if (cursors === undefined)
|
|
19
|
+
return null;
|
|
20
|
+
const steps = ast.steps ?? [];
|
|
21
|
+
// A `children` cursor needs an unnamed MOVE to attach to; an edge cursor
|
|
22
|
+
// needs a step whose `as` matches. Orphans only arise from a hand-built AST
|
|
23
|
+
// that doesn't match its result, or a function.get bug.
|
|
24
|
+
const aliases = new Set();
|
|
25
|
+
let hasMove = false;
|
|
26
|
+
for (const step of steps) {
|
|
27
|
+
if (!('expand' in step))
|
|
28
|
+
continue;
|
|
29
|
+
if (step.expand.as === undefined)
|
|
30
|
+
hasMove = true;
|
|
31
|
+
else
|
|
32
|
+
aliases.add(step.expand.as);
|
|
33
|
+
}
|
|
34
|
+
const orphans = [];
|
|
35
|
+
if (cursors.children !== undefined && !hasMove)
|
|
36
|
+
orphans.push('children');
|
|
37
|
+
for (const alias of Object.keys(cursors.edges ?? {})) {
|
|
38
|
+
if (!aliases.has(alias))
|
|
39
|
+
orphans.push(alias);
|
|
40
|
+
}
|
|
41
|
+
if (orphans.length > 0) {
|
|
42
|
+
throw new Error(`nextQuery: result cursor(s) [${orphans.join(', ')}] have no matching step in the ` +
|
|
43
|
+
'originating AST — the result wire and the query are out of sync. Refusing to ' +
|
|
44
|
+
'silently drop them.');
|
|
45
|
+
}
|
|
46
|
+
let advanced = false;
|
|
47
|
+
const nextSteps = steps.map((step) => {
|
|
48
|
+
if (!('expand' in step))
|
|
49
|
+
return step;
|
|
50
|
+
const expand = step.expand;
|
|
51
|
+
if (expand.as === undefined) {
|
|
52
|
+
if (cursors.children === undefined)
|
|
53
|
+
return step;
|
|
54
|
+
advanced = true;
|
|
55
|
+
return { expand: withCursor(expand, cursors.children) };
|
|
56
|
+
}
|
|
57
|
+
const cursor = cursors.edges?.[expand.as];
|
|
58
|
+
if (cursor === undefined)
|
|
59
|
+
return step;
|
|
60
|
+
advanced = true;
|
|
61
|
+
return { expand: withCursor(expand, cursor) };
|
|
62
|
+
});
|
|
63
|
+
if (!advanced)
|
|
64
|
+
return null;
|
|
65
|
+
return { ...ast, version: 1, steps: nextSteps };
|
|
66
|
+
}
|
|
67
|
+
/** Splice a fresh cursor onto an expand's page, preserving other page fields. */
|
|
68
|
+
function withCursor(expand, cursor) {
|
|
69
|
+
return { ...expand, page: { ...expand.page, cursor } };
|
|
70
|
+
}
|
|
71
|
+
/** The cursors of a single-root result — whatever raw key function.get used. */
|
|
72
|
+
function singleRootCursors(next) {
|
|
73
|
+
if (next === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
return Object.values(next)[0];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=next.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/graph/result/next.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,GAAkB,EAAE,IAAmB;IAC/D,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAA;IACH,CAAC;IACD,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IAEtC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAA;IAE7B,yEAAyE;IACzE,4EAA4E;IAC5E,wDAAwD;IACxD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAA;IACjC,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC;YAAE,SAAQ;QACjC,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,SAAS;YAAE,OAAO,GAAG,IAAI,CAAA;;YAC3C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAClC,CAAC;IACD,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACxE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC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AE,SAAS,EAAE,CAAA;AACjD,CAAC;AAED,iFAAiF;AACjF,SAAS,UAAU,CAAC,MAAkB,EAAE,MAAc;IACpD,OAAO,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;AACxD,CAAC;AAED,gFAAgF;AAChF,SAAS,iBAAiB,CAAC,IAA2B;IACpD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Node } from '@astrale-os/kernel-core';
|
|
2
|
+
/**
|
|
3
|
+
* A lazily-paged node collection — what `children`/`neighbors` resolve to.
|
|
4
|
+
* Holds the runner, so it self-drives; `cursor()` is the portable resume token.
|
|
5
|
+
*/
|
|
6
|
+
export interface Paged {
|
|
7
|
+
/** This page's nodes — hydrated, deduped, order-preserving. */
|
|
8
|
+
readonly nodes: Node[];
|
|
9
|
+
/** `nodes[0]` — the sole result of a to-one read, or `null`. */
|
|
10
|
+
readonly first: Node | null;
|
|
11
|
+
/** The next page, or `null` when exhausted. Live: fetches. */
|
|
12
|
+
next(): Promise<Paged | null>;
|
|
13
|
+
/** Drain every remaining page (this one included) into one deduped array. */
|
|
14
|
+
all(): Promise<Node[]>;
|
|
15
|
+
/** Portable resume token — opaque; feed back via the shorthand's `opts.cursor`. `null` when exhausted. */
|
|
16
|
+
cursor(): string | null;
|
|
17
|
+
/** Iterate nodes across all pages, lazily (deduped). */
|
|
18
|
+
[Symbol.asyncIterator](): AsyncIterator<Node>;
|
|
19
|
+
}
|
|
20
|
+
/** One resolved page: its nodes + the opaque cursor for the following page. */
|
|
21
|
+
export interface Page {
|
|
22
|
+
nodes: Node[];
|
|
23
|
+
cursor: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build the live paging surface over a first page + a `fetchNext` that resolves
|
|
27
|
+
* the page at a given cursor.
|
|
28
|
+
*/
|
|
29
|
+
export declare function makePaged(first: Page, fetchNext: (cursor: string) => Promise<Page>): Paged;
|
|
30
|
+
//# sourceMappingURL=paged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paged.d.ts","sourceRoot":"","sources":["../../../src/graph/result/paged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAA;IACtB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAA;IAC3B,8DAA8D;IAC9D,IAAI,IAAI,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;IAC7B,6EAA6E;IAC7E,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IACtB,0GAA0G;IAC1G,MAAM,IAAI,MAAM,GAAG,IAAI,CAAA;IACvB,wDAAwD;IACxD,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAA;CAC9C;AAED,+EAA+E;AAC/E,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAgC1F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the live paging surface over a first page + a `fetchNext` that resolves
|
|
3
|
+
* the page at a given cursor.
|
|
4
|
+
*/
|
|
5
|
+
export function makePaged(first, fetchNext) {
|
|
6
|
+
const self = {
|
|
7
|
+
nodes: first.nodes,
|
|
8
|
+
get first() {
|
|
9
|
+
return first.nodes[0] ?? null;
|
|
10
|
+
},
|
|
11
|
+
async next() {
|
|
12
|
+
return first.cursor === null ? null : makePaged(await fetchNext(first.cursor), fetchNext);
|
|
13
|
+
},
|
|
14
|
+
async all() {
|
|
15
|
+
const out = [];
|
|
16
|
+
for await (const n of self)
|
|
17
|
+
out.push(n);
|
|
18
|
+
return out;
|
|
19
|
+
},
|
|
20
|
+
cursor() {
|
|
21
|
+
return first.cursor;
|
|
22
|
+
},
|
|
23
|
+
async *[Symbol.asyncIterator]() {
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
let cur = self;
|
|
26
|
+
while (cur !== null) {
|
|
27
|
+
for (const n of cur.nodes) {
|
|
28
|
+
const key = nodeKey(n);
|
|
29
|
+
if (seen.has(key))
|
|
30
|
+
continue;
|
|
31
|
+
seen.add(key);
|
|
32
|
+
yield n;
|
|
33
|
+
}
|
|
34
|
+
cur = await cur.next();
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
return self;
|
|
39
|
+
}
|
|
40
|
+
const nodeKey = (n) => n.id ?? n.path.raw;
|
|
41
|
+
//# sourceMappingURL=paged.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paged.js","sourceRoot":"","sources":["../../../src/graph/result/paged.ts"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAW,EAAE,SAA4C;IACjF,MAAM,IAAI,GAAU;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,KAAK;YACP,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA;QAC/B,CAAC;QACD,KAAK,CAAC,IAAI;YACR,OAAO,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAA;QAC3F,CAAC;QACD,KAAK,CAAC,GAAG;YACP,MAAM,GAAG,GAAW,EAAE,CAAA;YACtB,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACvC,OAAO,GAAG,CAAA;QACZ,CAAC;QACD,MAAM;YACJ,OAAO,KAAK,CAAC,MAAM,CAAA;QACrB,CAAC;QACD,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;YAC3B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;YAC9B,IAAI,GAAG,GAAiB,IAAI,CAAA;YAC5B,OAAO,GAAG,KAAK,IAAI,EAAE,CAAC;gBACpB,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;oBAC1B,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;oBACtB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;wBAAE,SAAQ;oBAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;oBACb,MAAM,CAAC,CAAA;gBACT,CAAC;gBACD,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;YACxB,CAAC;QACH,CAAC;KACF,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,CAAO,EAAU,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-facing views of the graph payloads — every shape and helper here is
|
|
3
|
+
* kernel-core's, re-exported under this module's public names. Nothing is
|
|
4
|
+
* mirrored: kernel-core owns the wire vocabulary (`core/graph/wire.ts`), the
|
|
5
|
+
* mint-map key (`toEdgeKey`), and the edge identity.
|
|
6
|
+
*
|
|
7
|
+
* To hydrate a result back into typed navigation (multi-key path index,
|
|
8
|
+
* typed `Path` endpoints), pass it to kernel-core's `Graph.fromWire`.
|
|
9
|
+
*/
|
|
10
|
+
import type { EdgeWire, GetOutputWire, MutationResult, NodeWire } from '@astrale-os/kernel-core';
|
|
11
|
+
/** Node record as it crosses the wire. */
|
|
12
|
+
export type GraphNodeWire = NodeWire;
|
|
13
|
+
/** Edge record as it crosses the wire. */
|
|
14
|
+
export type GraphEdgeWire = EdgeWire;
|
|
15
|
+
/** `function.get` result — GraphData plus per-root cursors, wire-shaped. */
|
|
16
|
+
export type GetResultWire = GetOutputWire;
|
|
17
|
+
/** Per-root pagination cursors of a `function.get` result. */
|
|
18
|
+
export type GetNextCursors = NonNullable<GetOutputWire['next']>;
|
|
19
|
+
/**
|
|
20
|
+
* `function.mutate` result. Identical to kernel-core's `MutationResult`: both
|
|
21
|
+
* id maps carry branded string ids, which cross the wire verbatim.
|
|
22
|
+
*/
|
|
23
|
+
export type MutationResultWire = MutationResult;
|
|
24
|
+
/** Structural edge identity — `PathLike` fields, one type for both wire sides. */
|
|
25
|
+
export type { EdgeIdentity } from '@astrale-os/kernel-core';
|
|
26
|
+
/**
|
|
27
|
+
* Edge-identity key of `MutationResultWire.createdEdges` — kernel-core's
|
|
28
|
+
* `toEdgeKey`, the exact encoding the mint map is written with.
|
|
29
|
+
*/
|
|
30
|
+
export { toEdgeKey as edgeKey } from '@astrale-os/kernel-core';
|
|
31
|
+
export { prop, rawOf } from '@astrale-os/kernel-core';
|
|
32
|
+
export type { PathLike } from '@astrale-os/kernel-core';
|
|
33
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/graph/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAEhG,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAA;AAEpC,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAA;AAEpC,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG,aAAa,CAAA;AAEzC,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAA;AAE/D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAE/C,kFAAkF;AAClF,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D;;;GAGG;AACH,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACrD,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-facing views of the graph payloads — every shape and helper here is
|
|
3
|
+
* kernel-core's, re-exported under this module's public names. Nothing is
|
|
4
|
+
* mirrored: kernel-core owns the wire vocabulary (`core/graph/wire.ts`), the
|
|
5
|
+
* mint-map key (`toEdgeKey`), and the edge identity.
|
|
6
|
+
*
|
|
7
|
+
* To hydrate a result back into typed navigation (multi-key path index,
|
|
8
|
+
* typed `Path` endpoints), pass it to kernel-core's `Graph.fromWire`.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Edge-identity key of `MutationResultWire.createdEdges` — kernel-core's
|
|
12
|
+
* `toEdgeKey`, the exact encoding the mint map is written with.
|
|
13
|
+
*/
|
|
14
|
+
export { toEdgeKey as edgeKey } from '@astrale-os/kernel-core';
|
|
15
|
+
export { prop, rawOf } from '@astrale-os/kernel-core';
|
|
16
|
+
//# sourceMappingURL=wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/graph/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyBH;;;GAGG;AACH,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,11 +7,19 @@ export type { BatchResults, TypedBatchRequest } from './client/batch';
|
|
|
7
7
|
export type { TransportName, WireMeta, WireProtocolMeta } from './wire/meta';
|
|
8
8
|
export { RETRY_DEFAULTS, QUEUE_DEFAULTS, BATCH_DEFAULTS, RATE_LIMIT_DEFAULTS, kernelRetry, createQueue, createBatcher, createRateLimiter, } from './pacer';
|
|
9
9
|
export type { KernelRetryOptions, KernelQueueOptions, KernelBatchOptions, KernelRateLimitOptions, } from './pacer';
|
|
10
|
-
export { AuthenticationError, ConnectionError, DisconnectedError, InvalidTransportError, InvariantViolationError, KernelError, NotFoundError, PermissionDeniedError, TimeoutError, UnsupportedTransportError, ValidationError, WebOSError, mapServerError, withDetails, } from './errors/errors';
|
|
11
|
-
export type { AuthReason, ClientErrorDetails } from './errors/errors';
|
|
10
|
+
export { AuthBatchError, AuthenticationError, ConnectionError, DisconnectedError, InvalidTransportError, InvariantViolationError, KernelError, NodeUnavailableError, NotFoundError, PermissionDeniedError, TimeoutError, UnsupportedTransportError, ValidationError, WebOSError, mapServerError, withDetails, } from './errors/errors';
|
|
11
|
+
export type { AuthBatchOutcome, AuthReason, ClientErrorDetails } from './errors/errors';
|
|
12
|
+
export { classifyKernelError, isAuthBatchError, isAuthenticationError, isClientSessionError, isDelegationMintError, isDelegationPolicyError, isDelegationRefusedError, isHopLimitExceededError, isIdentityError, isInternalKernelError, isInvalidRequestError, isInvalidTransportError, isInvariantViolationError, isKernelError, isNodeUnavailableError, isNotFoundError, isParseError, isPermissionDeniedError, isPersistenceLoadFailedError, isPoolClosedError, isRedirectPolicyError, isRedirectRefusedError, isRegistryWriteFailedError, isSchemaOwnershipConflictError, isTransportError, isUnsupportedTransportError, isValidationError, isWebOSError, } from './errors/guards';
|
|
13
|
+
export type { IdentityError, KernelErrorKind, TransportError } from './errors/guards';
|
|
14
|
+
export { ClientSessionError } from './errors/session-error';
|
|
12
15
|
export { SchemaRegistry } from './schema/registry';
|
|
13
16
|
export { toFunctionSchemas } from './schema/from-entries';
|
|
14
17
|
export type { FunctionSchema } from './schema/types';
|
|
15
|
-
export type { ClassProxy, NodeProxy, ProxyCallOptions, SchemaTypedClient, } from './schema/proxy-types';
|
|
18
|
+
export type { ClassProxy, DefOf, InstanceDispatch, NodeProxy, ProxyCallOptions, SchemaTypedClient, StaticDispatch, TypeNames, } from './schema/proxy-types';
|
|
19
|
+
export { BindTypeMismatchError, createBoundNode, createNodeBinder, createSchemaBoundView, defaultCaller, resolveNeighbors, normalizeRef, } from './schema/bound';
|
|
20
|
+
export type { AnyBoundNode, BindCtx, BindOptions, BoundNode, BoundSnapshot, EdgeNames, EndpointsOf, NodeBinder, NodeRefInput, SchemaBoundView, } from './schema/bound';
|
|
21
|
+
export type { CreatableClassNames, CreateProps } from './schema/bound';
|
|
22
|
+
export { DESCRIPTION_KEY, NAME_KEY, STATUS_KEY, descriptionOf, nameOf, statusOf, } from './graph/named';
|
|
23
|
+
export type { NamedNodeLike } from './graph/named';
|
|
16
24
|
export type { CredentialInput } from '@astrale-os/kernel-core';
|
|
17
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGrD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,aAAa,GACd,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,eAAe,EACf,cAAc,EACd,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,GACf,MAAM,gBAAgB,CAAA;AAGvB,YAAY,EACV,SAAS,EACT,OAAO,EACP,OAAO,EACP,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,SAAS,GACV,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAGrE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAG5E,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGrD,YAAY,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,aAAa,GACd,MAAM,iBAAiB,CAAA;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,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,8BAA8B,EAC9B,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,YAAY,GACb,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAM3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,YAAY,EACV,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,SAAS,GACV,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,YAAY,EACZ,OAAO,EACP,WAAW,EACX,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAEvB,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAGtE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,aAAa,EACb,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAA;AACtB,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAGlD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,17 @@ export { KernelClient } from './client/client';
|
|
|
3
3
|
// ─── Pacer (retry / queue / batcher / rate-limiter) ────
|
|
4
4
|
export { RETRY_DEFAULTS, QUEUE_DEFAULTS, BATCH_DEFAULTS, RATE_LIMIT_DEFAULTS, kernelRetry, createQueue, createBatcher, createRateLimiter, } from './pacer';
|
|
5
5
|
// ─── Errors ─────────────────────────────────────────────
|
|
6
|
-
export { AuthenticationError, ConnectionError, DisconnectedError, InvalidTransportError, InvariantViolationError, KernelError, NotFoundError, PermissionDeniedError, TimeoutError, UnsupportedTransportError, ValidationError, WebOSError, mapServerError, withDetails, } from './errors/errors';
|
|
6
|
+
export { AuthBatchError, AuthenticationError, ConnectionError, DisconnectedError, InvalidTransportError, InvariantViolationError, KernelError, NodeUnavailableError, NotFoundError, PermissionDeniedError, TimeoutError, UnsupportedTransportError, ValidationError, WebOSError, mapServerError, withDetails, } from './errors/errors';
|
|
7
|
+
// ─── Error guards (typed narrowing for error-UX) ───────
|
|
8
|
+
export { classifyKernelError, isAuthBatchError, isAuthenticationError, isClientSessionError, isDelegationMintError, isDelegationPolicyError, isDelegationRefusedError, isHopLimitExceededError, isIdentityError, isInternalKernelError, isInvalidRequestError, isInvalidTransportError, isInvariantViolationError, isKernelError, isNodeUnavailableError, isNotFoundError, isParseError, isPermissionDeniedError, isPersistenceLoadFailedError, isPoolClosedError, isRedirectPolicyError, isRedirectRefusedError, isRegistryWriteFailedError, isSchemaOwnershipConflictError, isTransportError, isUnsupportedTransportError, isValidationError, isWebOSError, } from './errors/guards';
|
|
9
|
+
export { ClientSessionError } from './errors/session-error';
|
|
10
|
+
// Auth control plane lives on the `./auth` subpath, session delegation on
|
|
11
|
+
// `./session` — the root re-exports neither (parity with `./graph`).
|
|
7
12
|
// ─── Schema ─────────────────────────────────────────────
|
|
8
13
|
export { SchemaRegistry } from './schema/registry';
|
|
9
14
|
export { toFunctionSchemas } from './schema/from-entries';
|
|
15
|
+
// ─── Schema-bound surface (SchemaBoundView / BoundNode) ──
|
|
16
|
+
export { BindTypeMismatchError, createBoundNode, createNodeBinder, createSchemaBoundView, defaultCaller, resolveNeighbors, normalizeRef, } from './schema/bound';
|
|
17
|
+
// ─── Universal-prop helpers (blessed; single-sourced from K) ──
|
|
18
|
+
export { DESCRIPTION_KEY, NAME_KEY, STATUS_KEY, descriptionOf, nameOf, statusOf, } from './graph/named';
|
|
10
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAqC9C,0DAA0D;AAC1D,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAQhB,2DAA2D;AAC3D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,iBAAiB,CAAA;AAGxB,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAqC9C,0DAA0D;AAC1D,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAA;AAQhB,2DAA2D;AAC3D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,yBAAyB,EACzB,eAAe,EACf,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,iBAAiB,CAAA;AAGxB,0DAA0D;AAC1D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC5B,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,8BAA8B,EAC9B,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,EACjB,YAAY,GACb,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,0EAA0E;AAC1E,qEAAqE;AAErE,2DAA2D;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAazD,4DAA4D;AAC5D,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,gBAAgB,CAAA;AAgBvB,iEAAiE;AACjE,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,aAAa,EACb,MAAM,EACN,QAAQ,GACT,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Graph, Node } from '@astrale-os/kernel-core';
|
|
2
|
+
import type { ClassPath } from '@astrale-os/kernel-core/domain';
|
|
3
|
+
import type { Schema } from '@astrale-os/kernel-dsl';
|
|
4
|
+
import type { GraphApi } from '../../graph';
|
|
5
|
+
import type { DefOf, ProxyCaller, TypeNames } from '../proxy-types';
|
|
6
|
+
import type { AnyBoundNode, BoundNode } from './bound-node';
|
|
7
|
+
import { WebOSError } from '../../errors/errors';
|
|
8
|
+
/** Validation policy for a bind. `'warn'` (default) types + `console.warn`s a missing required prop. */
|
|
9
|
+
export type BindOptions = {
|
|
10
|
+
validate?: 'warn' | 'throw';
|
|
11
|
+
};
|
|
12
|
+
/** Raised when a `Node`'s concrete class does not satisfy the bound type. A program bug, not absence. */
|
|
13
|
+
export declare class BindTypeMismatchError extends WebOSError {
|
|
14
|
+
constructor(expected: string, actualClass: string, ref: string);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The capabilities a BoundNode binds against — injected, session-free. `null`
|
|
18
|
+
* slots degrade honestly: no caller/read/write means that member rejects.
|
|
19
|
+
*/
|
|
20
|
+
export interface BindCtx {
|
|
21
|
+
caller: ProxyCaller | null;
|
|
22
|
+
read: Pick<GraphApi, 'get' | 'query'> | null;
|
|
23
|
+
write?: Pick<GraphApi, 'createNode' | 'updateNode'> | null;
|
|
24
|
+
/** Minting envelope for in-envelope (0-RT) traversal. */
|
|
25
|
+
envelope?: Graph;
|
|
26
|
+
/** Edge `ClassPath.raw`s the mint's `GetInput` gathered — the exact 0-RT signal. */
|
|
27
|
+
gathered?: ReadonlySet<string>;
|
|
28
|
+
}
|
|
29
|
+
export interface NodeBinder<S extends Schema> {
|
|
30
|
+
readonly schema: S;
|
|
31
|
+
bind<T extends TypeNames<S>>(type: T, node: Node, ctx: BindCtx, opts?: BindOptions): BoundNode<DefOf<S, T>, S>;
|
|
32
|
+
bindAny(node: Node, ctx: BindCtx): AnyBoundNode<S>;
|
|
33
|
+
implementsType(nodeClass: ClassPath, type: string): boolean;
|
|
34
|
+
/** Concrete node-class name -> ClassPath; throws for interfaces/edge classes. */
|
|
35
|
+
nodeClassPath(type: string): ClassPath;
|
|
36
|
+
/** Short-keyed props -> shortest unambiguous write keys plus FQN read keys. */
|
|
37
|
+
resolveWriteProps(nodeClass: ClassPath, props: Readonly<Record<string, unknown>>): {
|
|
38
|
+
readonly write: Record<string, unknown>;
|
|
39
|
+
readonly wire: Record<string, unknown>;
|
|
40
|
+
};
|
|
41
|
+
/** Own-schema edge name → its `ClassPath`; throws on unknown. */
|
|
42
|
+
edgeClassPath(edge: string): ClassPath;
|
|
43
|
+
/** @internal — bind a traversal endpoint by its concrete class (foreign ⇒ classless). */
|
|
44
|
+
bindEndpoint(node: Node, ctx: BindCtx): AnyBoundNode<S>;
|
|
45
|
+
/** @internal — single-cardinality edge side (`'1'`/`'0..1'`). */
|
|
46
|
+
isSingle(edge: string, direction: 'out' | 'in'): boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare function createNodeBinder<S extends Schema>(schema: S): NodeBinder<S>;
|
|
49
|
+
//# sourceMappingURL=binder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../src/schema/bound/binder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EACV,SAAS,EAGV,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAK5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAa,SAAS,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAIhD,wGAAwG;AACxG,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAA;AAEzD,yGAAyG;AACzG,qBAA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AE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAA;IACtF,iEAAiE;IACjE,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,yFAAyF;IACzF,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;IACvD,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,GAAG,OAAO,CAAA;CACzD;AAID,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAqN3E"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { compileDomain } from '@astrale-os/kernel-core/domain';
|
|
2
|
+
import { defRef } from '@astrale-os/kernel-dsl';
|
|
3
|
+
import { WebOSError } from '../../errors/errors';
|
|
4
|
+
import { extractMethodsByType } from '../extract';
|
|
5
|
+
import { createBoundNode } from './bound-node';
|
|
6
|
+
/** Raised when a `Node`'s concrete class does not satisfy the bound type. A program bug, not absence. */
|
|
7
|
+
export class BindTypeMismatchError extends WebOSError {
|
|
8
|
+
constructor(expected, actualClass, ref) {
|
|
9
|
+
super(`Cannot bind ${ref} as '${expected}': its class '${actualClass}' is not '${expected}'`);
|
|
10
|
+
this.name = 'BindTypeMismatchError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const EMPTY_METHODS = { kind: 'class', methods: new Set() };
|
|
14
|
+
export function createNodeBinder(schema) {
|
|
15
|
+
const domain = schema.domain;
|
|
16
|
+
if (!domain || typeof domain !== 'string') {
|
|
17
|
+
throw new Error('Schema must have a non-empty domain string');
|
|
18
|
+
}
|
|
19
|
+
const compiled = compileDomain(schema);
|
|
20
|
+
const classPaths = compiled.$.paths.class;
|
|
21
|
+
const properties = compiled.$.properties;
|
|
22
|
+
const chains = compiled.$.inheritanceChain;
|
|
23
|
+
const methodsByType = extractMethodsByType(schema);
|
|
24
|
+
// className ↔ qualified ClassPath.raw — the raw compare that keeps `is()`
|
|
25
|
+
// honest across foreign homonyms.
|
|
26
|
+
const classNameByRaw = new Map();
|
|
27
|
+
for (const name of Object.keys(schema.classes)) {
|
|
28
|
+
const path = classPaths[defRef('class', name)];
|
|
29
|
+
if (path)
|
|
30
|
+
classNameByRaw.set(path.raw, name);
|
|
31
|
+
}
|
|
32
|
+
const implementsType = (nodeClass, type) => {
|
|
33
|
+
const concrete = classNameByRaw.get(nodeClass.raw);
|
|
34
|
+
if (concrete === undefined)
|
|
35
|
+
return false;
|
|
36
|
+
if (concrete === type)
|
|
37
|
+
return true;
|
|
38
|
+
const chain = chains[defRef('class', concrete)] ?? [];
|
|
39
|
+
return chain.includes(type);
|
|
40
|
+
};
|
|
41
|
+
const edgeClassPath = (edge) => {
|
|
42
|
+
const path = classPaths[defRef('class', edge)];
|
|
43
|
+
if (!path)
|
|
44
|
+
throw new Error(`Unknown edge '${edge}' in schema '${domain}'`);
|
|
45
|
+
return path;
|
|
46
|
+
};
|
|
47
|
+
const nodeClassPath = (type) => {
|
|
48
|
+
const def = schema.classes[type];
|
|
49
|
+
const path = classPaths[defRef('class', type)];
|
|
50
|
+
if (!def || !path || def.__kind === 'edge-class') {
|
|
51
|
+
throw new Error(`Cannot create '${type}' in schema '${domain}': expected a concrete node class`);
|
|
52
|
+
}
|
|
53
|
+
return path;
|
|
54
|
+
};
|
|
55
|
+
const isSingle = (edge, direction) => {
|
|
56
|
+
const def = schema.classes[edge];
|
|
57
|
+
if (!def || def.__kind !== 'edge-class')
|
|
58
|
+
return false;
|
|
59
|
+
const card = (direction === 'out' ? def.to : def.from)?.cardinality;
|
|
60
|
+
return card === '1' || card === '0..1';
|
|
61
|
+
};
|
|
62
|
+
/** Short-key remap from a node's qualified wire props, plus the missing-required set. */
|
|
63
|
+
const remap = (concrete, node) => {
|
|
64
|
+
const props = {};
|
|
65
|
+
const missing = [];
|
|
66
|
+
const flat = concrete !== undefined ? properties.flat[concrete] : undefined;
|
|
67
|
+
if (flat === undefined) {
|
|
68
|
+
return { props: { ...node.props }, missing };
|
|
69
|
+
}
|
|
70
|
+
for (const [short, mapping] of Object.entries(flat)) {
|
|
71
|
+
const value = node.props[mapping.key] ?? node.props[short];
|
|
72
|
+
if (value !== undefined)
|
|
73
|
+
props[short] = value;
|
|
74
|
+
else if (mapping.required)
|
|
75
|
+
missing.push(short);
|
|
76
|
+
}
|
|
77
|
+
return { props, missing };
|
|
78
|
+
};
|
|
79
|
+
const mappingsFor = (className, propName) => {
|
|
80
|
+
const out = [];
|
|
81
|
+
const byClass = properties.byClass[className] ?? {};
|
|
82
|
+
for (const byOwner of Object.values(byClass)) {
|
|
83
|
+
for (const byProp of Object.values(byOwner)) {
|
|
84
|
+
const mapping = byProp[propName];
|
|
85
|
+
if (mapping)
|
|
86
|
+
out.push(mapping);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
};
|
|
91
|
+
const ownerMatches = (className, mapping) => {
|
|
92
|
+
const out = [];
|
|
93
|
+
const byClass = properties.byClass[className] ?? {};
|
|
94
|
+
for (const byOwner of Object.values(byClass)) {
|
|
95
|
+
const candidate = byOwner[mapping.owner]?.[mapping.propName];
|
|
96
|
+
if (candidate)
|
|
97
|
+
out.push(candidate);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
};
|
|
101
|
+
const resolveWriteKey = (className, propName) => {
|
|
102
|
+
const own = properties.byClass[className]?.[domain]?.[className]?.[propName];
|
|
103
|
+
if (own)
|
|
104
|
+
return { writeKey: propName, mapping: own };
|
|
105
|
+
const matches = mappingsFor(className, propName);
|
|
106
|
+
if (matches.length === 0) {
|
|
107
|
+
throw new Error(`Unknown property '${propName}' on class '${className}' in schema '${domain}'`);
|
|
108
|
+
}
|
|
109
|
+
if (matches.length > 1) {
|
|
110
|
+
const selected = properties.flat[className]?.[propName];
|
|
111
|
+
if (selected && matches.some((m) => m.key === selected.key)) {
|
|
112
|
+
return { writeKey: `${selected.domain}:${selected.owner}.${propName}`, mapping: selected };
|
|
113
|
+
}
|
|
114
|
+
const owners = matches.map((m) => `${m.domain}:${m.owner}.${m.propName}`).join(', ');
|
|
115
|
+
throw new Error(`Cannot resolve short property '${propName}' on class '${className}': declared by ${owners}`);
|
|
116
|
+
}
|
|
117
|
+
const mapping = matches[0];
|
|
118
|
+
const prefix = ownerMatches(className, mapping).length > 1
|
|
119
|
+
? `${mapping.domain}:${mapping.owner}`
|
|
120
|
+
: mapping.owner;
|
|
121
|
+
return { writeKey: `${prefix}.${propName}`, mapping };
|
|
122
|
+
};
|
|
123
|
+
const resolveWriteProps = (nodeClass, input) => {
|
|
124
|
+
const className = classNameByRaw.get(nodeClass.raw);
|
|
125
|
+
if (className === undefined) {
|
|
126
|
+
throw new Error(`Cannot write '${nodeClass.raw}' through schema '${domain}'`);
|
|
127
|
+
}
|
|
128
|
+
const write = {};
|
|
129
|
+
const wire = {};
|
|
130
|
+
for (const [propName, value] of Object.entries(input)) {
|
|
131
|
+
const { writeKey, mapping } = resolveWriteKey(className, propName);
|
|
132
|
+
write[writeKey] = value;
|
|
133
|
+
wire[mapping.key] = value;
|
|
134
|
+
}
|
|
135
|
+
return { write, wire };
|
|
136
|
+
};
|
|
137
|
+
const validate = (node, typeName, missing, mode) => {
|
|
138
|
+
if (missing.length === 0)
|
|
139
|
+
return;
|
|
140
|
+
const msg = `Node ${node.path.raw} bound as '${typeName}' is missing required prop(s): ` +
|
|
141
|
+
`${missing.join(', ')} (schema drift — or these props are masked for this principal)`;
|
|
142
|
+
if (mode === 'throw')
|
|
143
|
+
throw new Error(msg);
|
|
144
|
+
// eslint-disable-next-line no-console -- 'warn' validation is loud-by-design (spec F7)
|
|
145
|
+
console.warn(msg);
|
|
146
|
+
};
|
|
147
|
+
const binder = {
|
|
148
|
+
schema,
|
|
149
|
+
implementsType,
|
|
150
|
+
nodeClassPath,
|
|
151
|
+
resolveWriteProps,
|
|
152
|
+
edgeClassPath,
|
|
153
|
+
isSingle,
|
|
154
|
+
bind(type, node, ctx, opts) {
|
|
155
|
+
if (!implementsType(node.class, type)) {
|
|
156
|
+
throw new BindTypeMismatchError(type, node.class.raw, node.path.raw);
|
|
157
|
+
}
|
|
158
|
+
const concrete = classNameByRaw.get(node.class.raw);
|
|
159
|
+
const { props, missing } = remap(concrete, node);
|
|
160
|
+
validate(node, type, missing, opts?.validate ?? 'warn');
|
|
161
|
+
const tm = methodsByType.get(type) ?? EMPTY_METHODS;
|
|
162
|
+
const entry = {
|
|
163
|
+
typeName: type,
|
|
164
|
+
kind: tm.kind,
|
|
165
|
+
methods: tm.methods,
|
|
166
|
+
props,
|
|
167
|
+
};
|
|
168
|
+
return createBoundNode(binder, entry, node, ctx);
|
|
169
|
+
},
|
|
170
|
+
bindAny(node, ctx) {
|
|
171
|
+
const concrete = classNameByRaw.get(node.class.raw);
|
|
172
|
+
const typeName = concrete ?? node.class.className;
|
|
173
|
+
const { props } = remap(concrete, node);
|
|
174
|
+
const tm = concrete !== undefined ? methodsByType.get(concrete) : undefined;
|
|
175
|
+
const entry = {
|
|
176
|
+
typeName,
|
|
177
|
+
kind: 'class',
|
|
178
|
+
methods: tm?.methods ?? EMPTY_METHODS.methods,
|
|
179
|
+
props,
|
|
180
|
+
};
|
|
181
|
+
return createBoundNode(binder, entry, node, ctx);
|
|
182
|
+
},
|
|
183
|
+
bindEndpoint(node, ctx) {
|
|
184
|
+
const concrete = classNameByRaw.get(node.class.raw);
|
|
185
|
+
return concrete !== undefined
|
|
186
|
+
? binder.bind(concrete, node, ctx)
|
|
187
|
+
: binder.bindAny(node, ctx);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
return binder;
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=binder.js.map
|
|
@@ -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