@astrale-os/kernel-core 0.9.0-beta.25 → 0.9.0-beta.27
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/CHANGELOG.md +23 -0
- package/dist/dns-label.d.ts +1 -2
- package/dist/dns-label.js +2 -3
- package/dist/graph/graph/model/wire.d.ts +78 -78
- package/dist/graph/graph/model/wire.js +18 -19
- package/dist/graph/mutate/language/wire.d.ts +215 -215
- package/dist/graph/mutate/language/wire.js +42 -47
- package/dist/graph/mutate/result/wire.d.ts +3 -4
- package/dist/graph/mutate/result/wire.js +4 -4
- package/dist/graph/node/identity/id.d.ts +1 -2
- package/dist/graph/node/identity/id.js +2 -3
- package/dist/graph/query/language/wire.d.ts +113 -114
- package/dist/graph/query/language/wire.js +47 -47
- package/dist/graph/query/result/wire.d.ts +93 -94
- package/dist/graph/query/result/wire.js +20 -20
- package/dist/schema/authority/claims.d.ts +24 -25
- package/dist/schema/authority/claims.js +8 -8
- package/dist/schema/installation/operation-id.d.ts +1 -2
- package/dist/schema/installation/operation-id.js +2 -4
- package/dist/schema/kernel/schema.d.ts +255 -255
- package/dist/schema/kernel/syscalls/contracts/admit.d.ts +11 -12
- package/dist/schema/kernel/syscalls/contracts/admit.js +9 -9
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +7 -8
- package/dist/schema/kernel/syscalls/contracts/can.js +4 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/expected.d.ts +4 -5
- package/dist/schema/kernel/syscalls/contracts/expected.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
- package/dist/schema/kernel/syscalls/contracts/identity.js +6 -6
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +67 -68
- package/dist/schema/kernel/syscalls/contracts/install.js +9 -9
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +72 -73
- package/dist/schema/kernel/syscalls/contracts/installation.js +12 -12
- package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +4 -5
- package/dist/schema/kernel/syscalls/contracts/introspect.js +4 -4
- package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
- package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/mint.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +223 -224
- package/dist/schema/kernel/syscalls/contracts/mutate.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +267 -268
- package/dist/schema/kernel/syscalls/contracts/provision.js +15 -17
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +221 -222
- package/dist/schema/kernel/syscalls/contracts/query.js +7 -7
- package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +36 -37
- package/dist/schema/kernel/syscalls/contracts/uninstall.js +3 -3
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +31 -32
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +23 -23
- package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
- package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
- package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
declare const NODE_ID_BRAND: unique symbol;
|
|
3
2
|
/** Stable opaque identity: 1-255 ASCII characters from [A-Za-z0-9._-]. */
|
|
4
3
|
export type NodeId = string & {
|
|
@@ -12,7 +11,7 @@ export declare class NodeIdError extends TypeError {
|
|
|
12
11
|
/** Admit opaque 1-255 character ASCII NodeId text without repair or format-specific semantics. */
|
|
13
12
|
export declare function NodeId(input: string): NodeId;
|
|
14
13
|
export declare function isNodeId(input: unknown): input is NodeId;
|
|
15
|
-
export declare const nodeIdSchema:
|
|
14
|
+
export declare const nodeIdSchema: import("zod").ZodPipe<import("zod").ZodString & import("zod").ZodType<NodeId, string, import("zod/v4/core").$ZodTypeInternals<NodeId, string>>, import("zod").ZodTransform<NodeId, string & {
|
|
16
15
|
readonly [NODE_ID_BRAND]: true;
|
|
17
16
|
}>>;
|
|
18
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { string } from 'zod';
|
|
2
2
|
const NODE_ID_MAX_LENGTH = 255;
|
|
3
3
|
const NODE_ID_INVALID_CHARACTER = /[^A-Za-z0-9._-]/u;
|
|
4
4
|
const NODE_ID_ERROR_MESSAGE = 'NodeId must be 1-255 ASCII characters drawn from [A-Za-z0-9._-].';
|
|
@@ -23,7 +23,6 @@ export function isNodeId(input) {
|
|
|
23
23
|
input.length <= NODE_ID_MAX_LENGTH &&
|
|
24
24
|
!NODE_ID_INVALID_CHARACTER.test(input));
|
|
25
25
|
}
|
|
26
|
-
export const nodeIdSchema =
|
|
27
|
-
.string()
|
|
26
|
+
export const nodeIdSchema = string()
|
|
28
27
|
.refine(isNodeId, NODE_ID_ERROR_MESSAGE)
|
|
29
28
|
.transform((value) => value);
|
|
@@ -1,149 +1,148 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/** Structural JSON contract; decodeQueryAST owns canonical identities and binding dependencies. */
|
|
3
|
-
export declare const queryAstSchema:
|
|
4
|
-
format:
|
|
5
|
-
version:
|
|
6
|
-
source:
|
|
7
|
-
kind:
|
|
8
|
-
terms:
|
|
9
|
-
kind:
|
|
10
|
-
path:
|
|
11
|
-
},
|
|
12
|
-
kind:
|
|
13
|
-
class:
|
|
14
|
-
origin:
|
|
15
|
-
kind:
|
|
16
|
-
name:
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
binding:
|
|
20
|
-
},
|
|
21
|
-
kind:
|
|
22
|
-
terms:
|
|
23
|
-
kind:
|
|
24
|
-
class:
|
|
25
|
-
origin:
|
|
26
|
-
kind:
|
|
27
|
-
name:
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
bindings:
|
|
31
|
-
source:
|
|
32
|
-
edge:
|
|
33
|
-
target:
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
steps:
|
|
37
|
-
op:
|
|
38
|
-
binding:
|
|
39
|
-
predicate:
|
|
40
|
-
kind:
|
|
41
|
-
class:
|
|
42
|
-
origin:
|
|
43
|
-
kind:
|
|
44
|
-
name:
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
kind:
|
|
48
|
-
class:
|
|
49
|
-
origin:
|
|
50
|
-
kind:
|
|
51
|
-
name:
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
kind:
|
|
55
|
-
property:
|
|
56
|
-
value:
|
|
57
|
-
},
|
|
58
|
-
kind:
|
|
59
|
-
property:
|
|
60
|
-
},
|
|
61
|
-
kind:
|
|
62
|
-
identity:
|
|
63
|
-
source:
|
|
64
|
-
target:
|
|
65
|
-
class:
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
op:
|
|
70
|
-
from:
|
|
71
|
-
via:
|
|
72
|
-
origin:
|
|
73
|
-
kind:
|
|
74
|
-
name:
|
|
75
|
-
},
|
|
76
|
-
direction:
|
|
2
|
+
export declare const queryAstSchema: import("zod").ZodObject<{
|
|
3
|
+
format: import("zod").ZodLiteral<"astrale.graph.query">;
|
|
4
|
+
version: import("zod").ZodLiteral<"v6">;
|
|
5
|
+
source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
6
|
+
kind: import("zod").ZodLiteral<"node">;
|
|
7
|
+
terms: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
8
|
+
kind: import("zod").ZodLiteral<"path">;
|
|
9
|
+
path: import("zod").ZodString;
|
|
10
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
11
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
12
|
+
class: import("zod").ZodObject<{
|
|
13
|
+
origin: import("zod").ZodString;
|
|
14
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
15
|
+
name: import("zod").ZodString;
|
|
16
|
+
}, import("zod/v4/core").$strict>;
|
|
17
|
+
}, import("zod/v4/core").$strict>], "kind">>;
|
|
18
|
+
binding: import("zod").ZodString;
|
|
19
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
20
|
+
kind: import("zod").ZodLiteral<"edge">;
|
|
21
|
+
terms: import("zod").ZodArray<import("zod").ZodObject<{
|
|
22
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
23
|
+
class: import("zod").ZodObject<{
|
|
24
|
+
origin: import("zod").ZodString;
|
|
25
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
26
|
+
name: import("zod").ZodString;
|
|
27
|
+
}, import("zod/v4/core").$strict>;
|
|
28
|
+
}, import("zod/v4/core").$strict>>;
|
|
29
|
+
bindings: import("zod").ZodObject<{
|
|
30
|
+
source: import("zod").ZodString;
|
|
31
|
+
edge: import("zod").ZodString;
|
|
32
|
+
target: import("zod").ZodString;
|
|
33
|
+
}, import("zod/v4/core").$strict>;
|
|
34
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
35
|
+
steps: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
36
|
+
op: import("zod").ZodLiteral<"filter">;
|
|
37
|
+
binding: import("zod").ZodString;
|
|
38
|
+
predicate: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
39
|
+
kind: import("zod").ZodLiteral<"class.satisfies">;
|
|
40
|
+
class: import("zod").ZodObject<{
|
|
41
|
+
origin: import("zod").ZodString;
|
|
42
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
43
|
+
name: import("zod").ZodString;
|
|
44
|
+
}, import("zod/v4/core").$strict>;
|
|
45
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
46
|
+
kind: import("zod").ZodLiteral<"class.equal">;
|
|
47
|
+
class: import("zod").ZodObject<{
|
|
48
|
+
origin: import("zod").ZodString;
|
|
49
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
50
|
+
name: import("zod").ZodString;
|
|
51
|
+
}, import("zod/v4/core").$strict>;
|
|
52
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
53
|
+
kind: import("zod").ZodLiteral<"property.equal">;
|
|
54
|
+
property: import("zod").ZodString;
|
|
55
|
+
value: import("zod").ZodUnknown;
|
|
56
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
57
|
+
kind: import("zod").ZodLiteral<"property.present">;
|
|
58
|
+
property: import("zod").ZodString;
|
|
59
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
60
|
+
kind: import("zod").ZodLiteral<"identity.equal">;
|
|
61
|
+
identity: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
62
|
+
source: import("zod").ZodString;
|
|
63
|
+
target: import("zod").ZodString;
|
|
64
|
+
class: import("zod").ZodString;
|
|
65
|
+
}, import("zod/v4/core").$strict>]>;
|
|
66
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
67
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
68
|
+
op: import("zod").ZodLiteral<"expand">;
|
|
69
|
+
from: import("zod").ZodString;
|
|
70
|
+
via: import("zod").ZodArray<import("zod").ZodObject<{
|
|
71
|
+
origin: import("zod").ZodString;
|
|
72
|
+
kind: import("zod").ZodLiteral<"class">;
|
|
73
|
+
name: import("zod").ZodString;
|
|
74
|
+
}, import("zod/v4/core").$strict>>;
|
|
75
|
+
direction: import("zod").ZodEnum<{
|
|
77
76
|
incident: "incident";
|
|
78
77
|
incoming: "incoming";
|
|
79
78
|
outgoing: "outgoing";
|
|
80
79
|
}>;
|
|
81
|
-
bindings:
|
|
82
|
-
edge:
|
|
83
|
-
node:
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
select:
|
|
87
|
-
kind:
|
|
88
|
-
binding:
|
|
89
|
-
order:
|
|
90
|
-
property:
|
|
91
|
-
direction:
|
|
80
|
+
bindings: import("zod").ZodObject<{
|
|
81
|
+
edge: import("zod").ZodString;
|
|
82
|
+
node: import("zod").ZodString;
|
|
83
|
+
}, import("zod/v4/core").$strict>;
|
|
84
|
+
}, import("zod/v4/core").$strict>], "op">>;
|
|
85
|
+
select: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
86
|
+
kind: import("zod").ZodLiteral<"graph">;
|
|
87
|
+
binding: import("zod").ZodString;
|
|
88
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
89
|
+
property: import("zod").ZodString;
|
|
90
|
+
direction: import("zod").ZodEnum<{
|
|
92
91
|
asc: "asc";
|
|
93
92
|
desc: "desc";
|
|
94
93
|
}>;
|
|
95
|
-
unranked:
|
|
94
|
+
unranked: import("zod").ZodEnum<{
|
|
96
95
|
first: "first";
|
|
97
96
|
last: "last";
|
|
98
97
|
}>;
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
kind:
|
|
102
|
-
binding:
|
|
103
|
-
projection:
|
|
104
|
-
kind:
|
|
98
|
+
}, import("zod/v4/core").$strict>>;
|
|
99
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
100
|
+
kind: import("zod").ZodLiteral<"nodes">;
|
|
101
|
+
binding: import("zod").ZodString;
|
|
102
|
+
projection: import("zod").ZodObject<{
|
|
103
|
+
kind: import("zod").ZodEnum<{
|
|
105
104
|
reference: "reference";
|
|
106
105
|
value: "value";
|
|
107
106
|
}>;
|
|
108
|
-
},
|
|
109
|
-
order:
|
|
110
|
-
property:
|
|
111
|
-
direction:
|
|
107
|
+
}, import("zod/v4/core").$strict>;
|
|
108
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
109
|
+
property: import("zod").ZodString;
|
|
110
|
+
direction: import("zod").ZodEnum<{
|
|
112
111
|
asc: "asc";
|
|
113
112
|
desc: "desc";
|
|
114
113
|
}>;
|
|
115
|
-
unranked:
|
|
114
|
+
unranked: import("zod").ZodEnum<{
|
|
116
115
|
first: "first";
|
|
117
116
|
last: "last";
|
|
118
117
|
}>;
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
kind:
|
|
122
|
-
binding:
|
|
123
|
-
projection:
|
|
124
|
-
edge:
|
|
118
|
+
}, import("zod/v4/core").$strict>>;
|
|
119
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
120
|
+
kind: import("zod").ZodLiteral<"edges">;
|
|
121
|
+
binding: import("zod").ZodString;
|
|
122
|
+
projection: import("zod").ZodObject<{
|
|
123
|
+
edge: import("zod").ZodEnum<{
|
|
125
124
|
reference: "reference";
|
|
126
125
|
value: "value";
|
|
127
126
|
}>;
|
|
128
|
-
source:
|
|
127
|
+
source: import("zod").ZodEnum<{
|
|
129
128
|
reference: "reference";
|
|
130
129
|
value: "value";
|
|
131
130
|
}>;
|
|
132
|
-
target:
|
|
131
|
+
target: import("zod").ZodEnum<{
|
|
133
132
|
reference: "reference";
|
|
134
133
|
value: "value";
|
|
135
134
|
}>;
|
|
136
|
-
},
|
|
137
|
-
order:
|
|
138
|
-
property:
|
|
139
|
-
direction:
|
|
135
|
+
}, import("zod/v4/core").$strict>;
|
|
136
|
+
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
137
|
+
property: import("zod").ZodString;
|
|
138
|
+
direction: import("zod").ZodEnum<{
|
|
140
139
|
asc: "asc";
|
|
141
140
|
desc: "desc";
|
|
142
141
|
}>;
|
|
143
|
-
unranked:
|
|
142
|
+
unranked: import("zod").ZodEnum<{
|
|
144
143
|
first: "first";
|
|
145
144
|
last: "last";
|
|
146
145
|
}>;
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
146
|
+
}, import("zod/v4/core").$strict>>;
|
|
147
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
148
|
+
}, import("zod/v4/core").$strict>;
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array, discriminatedUnion, enum as enumeration, literal, strictObject, string, union, unknown as unknownSchema, } from 'zod';
|
|
2
2
|
import { QUERY_AST_FORMAT, QUERY_AST_LIMITS, QUERY_AST_VERSION } from './model.js';
|
|
3
|
-
const text =
|
|
3
|
+
const text = string().min(1);
|
|
4
4
|
const binding = text.max(64);
|
|
5
|
-
const classRef =
|
|
5
|
+
const classRef = strictObject({
|
|
6
6
|
origin: text.max(253),
|
|
7
|
-
kind:
|
|
7
|
+
kind: literal('class'),
|
|
8
8
|
name: text,
|
|
9
9
|
});
|
|
10
|
-
const nodeSourceTerm =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const nodeSourceTerm = discriminatedUnion('kind', [
|
|
11
|
+
strictObject({ kind: literal('path'), path: text }),
|
|
12
|
+
strictObject({ kind: literal('class'), class: classRef }),
|
|
13
13
|
]);
|
|
14
|
-
const classSourceTerm =
|
|
15
|
-
const source =
|
|
16
|
-
|
|
17
|
-
kind:
|
|
18
|
-
terms:
|
|
14
|
+
const classSourceTerm = strictObject({ kind: literal('class'), class: classRef });
|
|
15
|
+
const source = discriminatedUnion('kind', [
|
|
16
|
+
strictObject({
|
|
17
|
+
kind: literal('node'),
|
|
18
|
+
terms: array(nodeSourceTerm).min(1).max(QUERY_AST_LIMITS.sourceTerms),
|
|
19
19
|
binding,
|
|
20
20
|
}),
|
|
21
|
-
|
|
22
|
-
kind:
|
|
23
|
-
terms:
|
|
24
|
-
bindings:
|
|
21
|
+
strictObject({
|
|
22
|
+
kind: literal('edge'),
|
|
23
|
+
terms: array(classSourceTerm).min(1).max(QUERY_AST_LIMITS.sourceTerms),
|
|
24
|
+
bindings: strictObject({ source: binding, edge: binding, target: binding }),
|
|
25
25
|
}),
|
|
26
26
|
]);
|
|
27
|
-
const predicate =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
kind:
|
|
34
|
-
identity:
|
|
27
|
+
const predicate = discriminatedUnion('kind', [
|
|
28
|
+
strictObject({ kind: literal('class.satisfies'), class: classRef }),
|
|
29
|
+
strictObject({ kind: literal('class.equal'), class: classRef }),
|
|
30
|
+
strictObject({ kind: literal('property.equal'), property: text, value: unknownSchema() }),
|
|
31
|
+
strictObject({ kind: literal('property.present'), property: text }),
|
|
32
|
+
strictObject({
|
|
33
|
+
kind: literal('identity.equal'),
|
|
34
|
+
identity: union([text, strictObject({ source: text, target: text, class: text })]),
|
|
35
35
|
}),
|
|
36
36
|
]);
|
|
37
|
-
const filter =
|
|
38
|
-
const expand =
|
|
39
|
-
op:
|
|
37
|
+
const filter = strictObject({ op: literal('filter'), binding, predicate });
|
|
38
|
+
const expand = strictObject({
|
|
39
|
+
op: literal('expand'),
|
|
40
40
|
from: binding,
|
|
41
|
-
via:
|
|
42
|
-
direction:
|
|
43
|
-
bindings:
|
|
41
|
+
via: array(classRef).min(1).max(QUERY_AST_LIMITS.expansionClassesPerStep),
|
|
42
|
+
direction: enumeration(['outgoing', 'incoming', 'incident']),
|
|
43
|
+
bindings: strictObject({ edge: binding, node: binding }),
|
|
44
44
|
});
|
|
45
|
-
const propertyOrder =
|
|
45
|
+
const propertyOrder = strictObject({
|
|
46
46
|
property: text,
|
|
47
|
-
direction:
|
|
48
|
-
unranked:
|
|
47
|
+
direction: enumeration(['asc', 'desc']),
|
|
48
|
+
unranked: enumeration(['first', 'last']),
|
|
49
49
|
});
|
|
50
|
-
const projectionShape =
|
|
51
|
-
const graphSelect =
|
|
52
|
-
kind:
|
|
50
|
+
const projectionShape = enumeration(['reference', 'value']);
|
|
51
|
+
const graphSelect = strictObject({
|
|
52
|
+
kind: literal('graph'),
|
|
53
53
|
binding,
|
|
54
54
|
order: propertyOrder.optional(),
|
|
55
55
|
});
|
|
56
|
-
const nodeSelect =
|
|
57
|
-
kind:
|
|
56
|
+
const nodeSelect = strictObject({
|
|
57
|
+
kind: literal('nodes'),
|
|
58
58
|
binding,
|
|
59
|
-
projection:
|
|
59
|
+
projection: strictObject({ kind: projectionShape }),
|
|
60
60
|
order: propertyOrder.optional(),
|
|
61
61
|
});
|
|
62
|
-
const edgeSelect =
|
|
63
|
-
kind:
|
|
62
|
+
const edgeSelect = strictObject({
|
|
63
|
+
kind: literal('edges'),
|
|
64
64
|
binding,
|
|
65
|
-
projection:
|
|
65
|
+
projection: strictObject({
|
|
66
66
|
edge: projectionShape,
|
|
67
67
|
source: projectionShape,
|
|
68
68
|
target: projectionShape,
|
|
@@ -70,10 +70,10 @@ const edgeSelect = z.strictObject({
|
|
|
70
70
|
order: propertyOrder.optional(),
|
|
71
71
|
});
|
|
72
72
|
/** Structural JSON contract; decodeQueryAST owns canonical identities and binding dependencies. */
|
|
73
|
-
export const queryAstSchema =
|
|
74
|
-
format:
|
|
75
|
-
version:
|
|
73
|
+
export const queryAstSchema = strictObject({
|
|
74
|
+
format: literal(QUERY_AST_FORMAT),
|
|
75
|
+
version: literal(QUERY_AST_VERSION),
|
|
76
76
|
source,
|
|
77
|
-
steps:
|
|
78
|
-
select:
|
|
77
|
+
steps: array(discriminatedUnion('op', [filter, expand])).max(QUERY_AST_LIMITS.steps),
|
|
78
|
+
select: discriminatedUnion('kind', [graphSelect, nodeSelect, edgeSelect]),
|
|
79
79
|
});
|
|
@@ -1,95 +1,94 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
/** Exact discriminated structural result; Runtime owns Query-relative closure and order. */
|
|
3
|
-
export declare const queryResultSchema:
|
|
4
|
-
kind:
|
|
5
|
-
graph:
|
|
6
|
-
nodes:
|
|
7
|
-
id:
|
|
8
|
-
class:
|
|
9
|
-
props:
|
|
10
|
-
},
|
|
11
|
-
edges:
|
|
12
|
-
source:
|
|
13
|
-
target:
|
|
14
|
-
class:
|
|
15
|
-
slug:
|
|
16
|
-
props:
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
selection:
|
|
20
|
-
kind:
|
|
21
|
-
ids:
|
|
22
|
-
},
|
|
23
|
-
kind:
|
|
24
|
-
keys:
|
|
25
|
-
source:
|
|
26
|
-
target:
|
|
27
|
-
class:
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
kind:
|
|
32
|
-
nodes:
|
|
33
|
-
kind:
|
|
34
|
-
value:
|
|
35
|
-
id:
|
|
36
|
-
class:
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
kind:
|
|
40
|
-
value:
|
|
41
|
-
id:
|
|
42
|
-
class:
|
|
43
|
-
props:
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
kind:
|
|
48
|
-
edges:
|
|
49
|
-
edge:
|
|
50
|
-
kind:
|
|
51
|
-
value:
|
|
52
|
-
source:
|
|
53
|
-
target:
|
|
54
|
-
class:
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
kind:
|
|
58
|
-
value:
|
|
59
|
-
source:
|
|
60
|
-
target:
|
|
61
|
-
class:
|
|
62
|
-
slug:
|
|
63
|
-
props:
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
source:
|
|
67
|
-
kind:
|
|
68
|
-
value:
|
|
69
|
-
id:
|
|
70
|
-
class:
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
kind:
|
|
74
|
-
value:
|
|
75
|
-
id:
|
|
76
|
-
class:
|
|
77
|
-
props:
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
target:
|
|
81
|
-
kind:
|
|
82
|
-
value:
|
|
83
|
-
id:
|
|
84
|
-
class:
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
kind:
|
|
88
|
-
value:
|
|
89
|
-
id:
|
|
90
|
-
class:
|
|
91
|
-
props:
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
2
|
+
export declare const queryResultSchema: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
3
|
+
kind: import("zod").ZodLiteral<"graph">;
|
|
4
|
+
graph: import("zod").ZodObject<{
|
|
5
|
+
nodes: import("zod").ZodArray<import("zod").ZodObject<{
|
|
6
|
+
id: import("zod").ZodString;
|
|
7
|
+
class: import("zod").ZodString;
|
|
8
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
9
|
+
}, import("zod/v4/core").$strict>>;
|
|
10
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
11
|
+
source: import("zod").ZodString;
|
|
12
|
+
target: import("zod").ZodString;
|
|
13
|
+
class: import("zod").ZodString;
|
|
14
|
+
slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
|
|
15
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
16
|
+
}, import("zod/v4/core").$strict>>;
|
|
17
|
+
}, import("zod/v4/core").$strict>;
|
|
18
|
+
selection: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
19
|
+
kind: import("zod").ZodLiteral<"node">;
|
|
20
|
+
ids: import("zod").ZodArray<import("zod").ZodString>;
|
|
21
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
22
|
+
kind: import("zod").ZodLiteral<"edge">;
|
|
23
|
+
keys: import("zod").ZodArray<import("zod").ZodObject<{
|
|
24
|
+
source: import("zod").ZodString;
|
|
25
|
+
target: import("zod").ZodString;
|
|
26
|
+
class: import("zod").ZodString;
|
|
27
|
+
}, import("zod/v4/core").$strict>>;
|
|
28
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
29
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
30
|
+
kind: import("zod").ZodLiteral<"nodes">;
|
|
31
|
+
nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
32
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
33
|
+
value: import("zod").ZodObject<{
|
|
34
|
+
id: import("zod").ZodString;
|
|
35
|
+
class: import("zod").ZodString;
|
|
36
|
+
}, import("zod/v4/core").$strict>;
|
|
37
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
38
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
39
|
+
value: import("zod").ZodObject<{
|
|
40
|
+
id: import("zod").ZodString;
|
|
41
|
+
class: import("zod").ZodString;
|
|
42
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
43
|
+
}, import("zod/v4/core").$strict>;
|
|
44
|
+
}, import("zod/v4/core").$strict>], "kind">>;
|
|
45
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
46
|
+
kind: import("zod").ZodLiteral<"edges">;
|
|
47
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
48
|
+
edge: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
49
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
50
|
+
value: import("zod").ZodObject<{
|
|
51
|
+
source: import("zod").ZodString;
|
|
52
|
+
target: import("zod").ZodString;
|
|
53
|
+
class: import("zod").ZodString;
|
|
54
|
+
}, import("zod/v4/core").$strict>;
|
|
55
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
56
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
57
|
+
value: import("zod").ZodObject<{
|
|
58
|
+
source: import("zod").ZodString;
|
|
59
|
+
target: import("zod").ZodString;
|
|
60
|
+
class: import("zod").ZodString;
|
|
61
|
+
slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
|
|
62
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
63
|
+
}, import("zod/v4/core").$strict>;
|
|
64
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
65
|
+
source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
66
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
67
|
+
value: import("zod").ZodObject<{
|
|
68
|
+
id: import("zod").ZodString;
|
|
69
|
+
class: import("zod").ZodString;
|
|
70
|
+
}, import("zod/v4/core").$strict>;
|
|
71
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
72
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
73
|
+
value: import("zod").ZodObject<{
|
|
74
|
+
id: import("zod").ZodString;
|
|
75
|
+
class: import("zod").ZodString;
|
|
76
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
77
|
+
}, import("zod/v4/core").$strict>;
|
|
78
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
79
|
+
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
80
|
+
kind: import("zod").ZodLiteral<"reference">;
|
|
81
|
+
value: import("zod").ZodObject<{
|
|
82
|
+
id: import("zod").ZodString;
|
|
83
|
+
class: import("zod").ZodString;
|
|
84
|
+
}, import("zod/v4/core").$strict>;
|
|
85
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
86
|
+
kind: import("zod").ZodLiteral<"value">;
|
|
87
|
+
value: import("zod").ZodObject<{
|
|
88
|
+
id: import("zod").ZodString;
|
|
89
|
+
class: import("zod").ZodString;
|
|
90
|
+
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
91
|
+
}, import("zod/v4/core").$strict>;
|
|
92
|
+
}, import("zod/v4/core").$strict>], "kind">;
|
|
93
|
+
}, import("zod/v4/core").$strict>>;
|
|
94
|
+
}, import("zod/v4/core").$strict>], "kind">;
|