@manifesto-ai/core 2.8.0 → 2.9.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/README.md +1 -1
- package/dist/core/action-availability.d.ts +27 -0
- package/dist/core/apply.d.ts +11 -0
- package/dist/core/compute.d.ts +16 -0
- package/dist/core/explain.d.ts +13 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/system-delta.d.ts +8 -0
- package/dist/core/validate.d.ts +15 -0
- package/dist/core/validation-utils.d.ts +22 -0
- package/dist/errors.d.ts +29 -0
- package/dist/evaluator/computed.d.ts +13 -0
- package/dist/evaluator/context.d.ts +61 -0
- package/dist/evaluator/dag.d.ts +29 -0
- package/dist/evaluator/expr.d.ts +10 -0
- package/dist/evaluator/flow.d.ts +35 -0
- package/dist/evaluator/index.d.ts +5 -0
- package/dist/factories.d.ts +21 -0
- package/dist/index.d.ts +20 -1715
- package/dist/schema/action.d.ts +13 -0
- package/dist/schema/common.d.ts +36 -0
- package/dist/schema/computed.d.ts +22 -0
- package/dist/schema/defaults.d.ts +11 -0
- package/dist/schema/domain.d.ts +49 -0
- package/dist/schema/expr.d.ts +482 -0
- package/dist/schema/field.d.ts +47 -0
- package/dist/schema/flow.d.ts +108 -0
- package/dist/schema/host-context.d.ts +11 -0
- package/dist/schema/index.d.ts +14 -0
- package/dist/schema/patch.d.ts +105 -0
- package/dist/schema/result.d.ts +175 -0
- package/dist/schema/snapshot.d.ts +132 -0
- package/dist/schema/trace.d.ts +97 -0
- package/dist/schema/type-spec.d.ts +33 -0
- package/dist/utils/canonical.d.ts +37 -0
- package/dist/utils/hash.d.ts +54 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/patch-path.d.ts +15 -0
- package/dist/utils/path.d.ts +41 -0
- package/package.json +4 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FieldSpec } from "./field.js";
|
|
3
|
+
/**
|
|
4
|
+
* ActionSpec - Maps intents to flows
|
|
5
|
+
* An action defines what happens when a particular intent is dispatched.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ActionSpec: z.ZodObject<{
|
|
8
|
+
flow: z.ZodType<import("./flow.js").FlowNode, unknown, z.core.$ZodTypeInternals<import("./flow.js").FlowNode, unknown>>;
|
|
9
|
+
input: z.ZodOptional<z.ZodType<FieldSpec, unknown, z.core.$ZodTypeInternals<FieldSpec, unknown>>>;
|
|
10
|
+
available: z.ZodOptional<z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>>;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type ActionSpec = z.infer<typeof ActionSpec>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Dot-separated path for accessing values (e.g., "user.profile.name")
|
|
4
|
+
*/
|
|
5
|
+
export declare const SemanticPath: z.ZodString;
|
|
6
|
+
export type SemanticPath = z.infer<typeof SemanticPath>;
|
|
7
|
+
/**
|
|
8
|
+
* Result type for functions that can fail without throwing
|
|
9
|
+
*/
|
|
10
|
+
export declare const Result: <T extends z.ZodTypeAny, E extends z.ZodTypeAny>(valueSchema: T, errorSchema: E) => z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
ok: z.ZodLiteral<true>;
|
|
12
|
+
value: T;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
ok: z.ZodLiteral<false>;
|
|
15
|
+
error: E;
|
|
16
|
+
}, z.core.$strip>], "ok">;
|
|
17
|
+
export type Result<T, E> = {
|
|
18
|
+
ok: true;
|
|
19
|
+
value: T;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
error: E;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Helper functions for Result type
|
|
26
|
+
*/
|
|
27
|
+
export declare const ok: <T>(value: T) => Result<T, never>;
|
|
28
|
+
export declare const err: <E>(error: E) => Result<never, E>;
|
|
29
|
+
export declare const isOk: <T, E>(result: Result<T, E>) => result is {
|
|
30
|
+
ok: true;
|
|
31
|
+
value: T;
|
|
32
|
+
};
|
|
33
|
+
export declare const isErr: <T, E>(result: Result<T, E>) => result is {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: E;
|
|
36
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* ComputedFieldSpec - Definition of a single computed field
|
|
4
|
+
*/
|
|
5
|
+
export declare const ComputedFieldSpec: z.ZodObject<{
|
|
6
|
+
deps: z.ZodArray<z.ZodString>;
|
|
7
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type ComputedFieldSpec = z.infer<typeof ComputedFieldSpec>;
|
|
11
|
+
/**
|
|
12
|
+
* ComputedSpec - Collection of computed field definitions
|
|
13
|
+
* Computed values form a Directed Acyclic Graph (DAG).
|
|
14
|
+
*/
|
|
15
|
+
export declare const ComputedSpec: z.ZodObject<{
|
|
16
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
17
|
+
deps: z.ZodArray<z.ZodString>;
|
|
18
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type ComputedSpec = z.infer<typeof ComputedSpec>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StateSpec } from "./field.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extract top-level default values from a StateSpec.
|
|
4
|
+
*
|
|
5
|
+
* Iterates `stateSpec.fields` and collects fields with an explicit `default`.
|
|
6
|
+
* Returns a flat record of field names to default values.
|
|
7
|
+
*
|
|
8
|
+
* @param stateSpec - The state specification from a DomainSchema
|
|
9
|
+
* @returns Record of field names to their default values
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractDefaults(stateSpec: StateSpec): Record<string, unknown>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema metadata
|
|
4
|
+
*/
|
|
5
|
+
export declare const SchemaMeta: z.ZodObject<{
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SchemaMeta = z.infer<typeof SchemaMeta>;
|
|
11
|
+
/**
|
|
12
|
+
* DomainSchema - Complete schema definition
|
|
13
|
+
*
|
|
14
|
+
* Defines:
|
|
15
|
+
* - What the domain looks like (StateSpec)
|
|
16
|
+
* - What can be derived (ComputedSpec)
|
|
17
|
+
* - How state transitions occur (Actions → FlowSpec)
|
|
18
|
+
*/
|
|
19
|
+
export declare const DomainSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
version: z.ZodString;
|
|
22
|
+
hash: z.ZodString;
|
|
23
|
+
types: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
definition: z.ZodType<import("./type-spec.js").TypeDefinition, unknown, z.core.$ZodTypeInternals<import("./type-spec.js").TypeDefinition, unknown>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
state: z.ZodObject<{
|
|
28
|
+
fields: z.ZodRecord<z.ZodString, z.ZodType<import("./field.js").FieldSpec, unknown, z.core.$ZodTypeInternals<import("./field.js").FieldSpec, unknown>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
computed: z.ZodObject<{
|
|
31
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
deps: z.ZodArray<z.ZodString>;
|
|
33
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
34
|
+
description: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
actions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
38
|
+
flow: z.ZodType<import("./flow.js").FlowNode, unknown, z.core.$ZodTypeInternals<import("./flow.js").FlowNode, unknown>>;
|
|
39
|
+
input: z.ZodOptional<z.ZodType<import("./field.js").FieldSpec, unknown, z.core.$ZodTypeInternals<import("./field.js").FieldSpec, unknown>>>;
|
|
40
|
+
available: z.ZodOptional<z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
description: z.ZodOptional<z.ZodString>;
|
|
46
|
+
authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type DomainSchema = z.infer<typeof DomainSchema>;
|
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* ExprNode - Pure expression language for ComputedSpec and FlowSpec
|
|
4
|
+
* All expressions are deterministic and side-effect free
|
|
5
|
+
*/
|
|
6
|
+
export type ExprNode = LitExpr | GetExpr | EqExpr | NeqExpr | GtExpr | GteExpr | LtExpr | LteExpr | AndExpr | OrExpr | NotExpr | IfExpr | AddExpr | SubExpr | MulExpr | DivExpr | ModExpr | MinExpr | MaxExpr | AbsExpr | NegExpr | FloorExpr | CeilExpr | RoundExpr | SqrtExpr | PowExpr | SumArrayExpr | MinArrayExpr | MaxArrayExpr | ConcatExpr | SubstringExpr | TrimExpr | ToLowerCaseExpr | ToUpperCaseExpr | StrLenExpr | StartsWithExpr | EndsWithExpr | StrIncludesExpr | IndexOfExpr | ReplaceExpr | SplitExpr | LenExpr | AtExpr | FirstExpr | LastExpr | SliceExpr | IncludesExpr | FilterExpr | MapExpr | FindExpr | EveryExpr | SomeExpr | AppendExpr | ReverseExpr | UniqueExpr | FlatExpr | ObjectExpr | FieldExpr | KeysExpr | ValuesExpr | EntriesExpr | MergeExpr | HasKeyExpr | PickExpr | OmitExpr | FromEntriesExpr | TypeofExpr | IsNullExpr | CoalesceExpr | ToStringExpr | ToNumberExpr | ToBooleanExpr;
|
|
7
|
+
export declare const LitExpr: z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"lit">;
|
|
9
|
+
value: z.ZodUnknown;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type LitExpr = z.infer<typeof LitExpr>;
|
|
12
|
+
export declare const GetExpr: z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"get">;
|
|
14
|
+
path: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type GetExpr = z.infer<typeof GetExpr>;
|
|
17
|
+
export declare const EqExpr: z.ZodType<{
|
|
18
|
+
kind: "eq";
|
|
19
|
+
left: ExprNode;
|
|
20
|
+
right: ExprNode;
|
|
21
|
+
}>;
|
|
22
|
+
export type EqExpr = z.infer<typeof EqExpr>;
|
|
23
|
+
export declare const NeqExpr: z.ZodType<{
|
|
24
|
+
kind: "neq";
|
|
25
|
+
left: ExprNode;
|
|
26
|
+
right: ExprNode;
|
|
27
|
+
}>;
|
|
28
|
+
export type NeqExpr = z.infer<typeof NeqExpr>;
|
|
29
|
+
export declare const GtExpr: z.ZodType<{
|
|
30
|
+
kind: "gt";
|
|
31
|
+
left: ExprNode;
|
|
32
|
+
right: ExprNode;
|
|
33
|
+
}>;
|
|
34
|
+
export type GtExpr = z.infer<typeof GtExpr>;
|
|
35
|
+
export declare const GteExpr: z.ZodType<{
|
|
36
|
+
kind: "gte";
|
|
37
|
+
left: ExprNode;
|
|
38
|
+
right: ExprNode;
|
|
39
|
+
}>;
|
|
40
|
+
export type GteExpr = z.infer<typeof GteExpr>;
|
|
41
|
+
export declare const LtExpr: z.ZodType<{
|
|
42
|
+
kind: "lt";
|
|
43
|
+
left: ExprNode;
|
|
44
|
+
right: ExprNode;
|
|
45
|
+
}>;
|
|
46
|
+
export type LtExpr = z.infer<typeof LtExpr>;
|
|
47
|
+
export declare const LteExpr: z.ZodType<{
|
|
48
|
+
kind: "lte";
|
|
49
|
+
left: ExprNode;
|
|
50
|
+
right: ExprNode;
|
|
51
|
+
}>;
|
|
52
|
+
export type LteExpr = z.infer<typeof LteExpr>;
|
|
53
|
+
export declare const AndExpr: z.ZodType<{
|
|
54
|
+
kind: "and";
|
|
55
|
+
args: ExprNode[];
|
|
56
|
+
}>;
|
|
57
|
+
export type AndExpr = z.infer<typeof AndExpr>;
|
|
58
|
+
export declare const OrExpr: z.ZodType<{
|
|
59
|
+
kind: "or";
|
|
60
|
+
args: ExprNode[];
|
|
61
|
+
}>;
|
|
62
|
+
export type OrExpr = z.infer<typeof OrExpr>;
|
|
63
|
+
export declare const NotExpr: z.ZodType<{
|
|
64
|
+
kind: "not";
|
|
65
|
+
arg: ExprNode;
|
|
66
|
+
}>;
|
|
67
|
+
export type NotExpr = z.infer<typeof NotExpr>;
|
|
68
|
+
export declare const IfExpr: z.ZodType<{
|
|
69
|
+
kind: "if";
|
|
70
|
+
cond: ExprNode;
|
|
71
|
+
then: ExprNode;
|
|
72
|
+
else: ExprNode;
|
|
73
|
+
}>;
|
|
74
|
+
export type IfExpr = z.infer<typeof IfExpr>;
|
|
75
|
+
export declare const AddExpr: z.ZodType<{
|
|
76
|
+
kind: "add";
|
|
77
|
+
left: ExprNode;
|
|
78
|
+
right: ExprNode;
|
|
79
|
+
}>;
|
|
80
|
+
export type AddExpr = z.infer<typeof AddExpr>;
|
|
81
|
+
export declare const SubExpr: z.ZodType<{
|
|
82
|
+
kind: "sub";
|
|
83
|
+
left: ExprNode;
|
|
84
|
+
right: ExprNode;
|
|
85
|
+
}>;
|
|
86
|
+
export type SubExpr = z.infer<typeof SubExpr>;
|
|
87
|
+
export declare const MulExpr: z.ZodType<{
|
|
88
|
+
kind: "mul";
|
|
89
|
+
left: ExprNode;
|
|
90
|
+
right: ExprNode;
|
|
91
|
+
}>;
|
|
92
|
+
export type MulExpr = z.infer<typeof MulExpr>;
|
|
93
|
+
export declare const DivExpr: z.ZodType<{
|
|
94
|
+
kind: "div";
|
|
95
|
+
left: ExprNode;
|
|
96
|
+
right: ExprNode;
|
|
97
|
+
}>;
|
|
98
|
+
export type DivExpr = z.infer<typeof DivExpr>;
|
|
99
|
+
export declare const ModExpr: z.ZodType<{
|
|
100
|
+
kind: "mod";
|
|
101
|
+
left: ExprNode;
|
|
102
|
+
right: ExprNode;
|
|
103
|
+
}>;
|
|
104
|
+
export type ModExpr = z.infer<typeof ModExpr>;
|
|
105
|
+
export declare const MinExpr: z.ZodType<{
|
|
106
|
+
kind: "min";
|
|
107
|
+
args: ExprNode[];
|
|
108
|
+
}>;
|
|
109
|
+
export type MinExpr = z.infer<typeof MinExpr>;
|
|
110
|
+
export declare const MaxExpr: z.ZodType<{
|
|
111
|
+
kind: "max";
|
|
112
|
+
args: ExprNode[];
|
|
113
|
+
}>;
|
|
114
|
+
export type MaxExpr = z.infer<typeof MaxExpr>;
|
|
115
|
+
export declare const AbsExpr: z.ZodType<{
|
|
116
|
+
kind: "abs";
|
|
117
|
+
arg: ExprNode;
|
|
118
|
+
}>;
|
|
119
|
+
export type AbsExpr = z.infer<typeof AbsExpr>;
|
|
120
|
+
export declare const NegExpr: z.ZodType<{
|
|
121
|
+
kind: "neg";
|
|
122
|
+
arg: ExprNode;
|
|
123
|
+
}>;
|
|
124
|
+
export type NegExpr = z.infer<typeof NegExpr>;
|
|
125
|
+
export declare const FloorExpr: z.ZodType<{
|
|
126
|
+
kind: "floor";
|
|
127
|
+
arg: ExprNode;
|
|
128
|
+
}>;
|
|
129
|
+
export type FloorExpr = z.infer<typeof FloorExpr>;
|
|
130
|
+
export declare const CeilExpr: z.ZodType<{
|
|
131
|
+
kind: "ceil";
|
|
132
|
+
arg: ExprNode;
|
|
133
|
+
}>;
|
|
134
|
+
export type CeilExpr = z.infer<typeof CeilExpr>;
|
|
135
|
+
export declare const RoundExpr: z.ZodType<{
|
|
136
|
+
kind: "round";
|
|
137
|
+
arg: ExprNode;
|
|
138
|
+
}>;
|
|
139
|
+
export type RoundExpr = z.infer<typeof RoundExpr>;
|
|
140
|
+
export declare const SqrtExpr: z.ZodType<{
|
|
141
|
+
kind: "sqrt";
|
|
142
|
+
arg: ExprNode;
|
|
143
|
+
}>;
|
|
144
|
+
export type SqrtExpr = z.infer<typeof SqrtExpr>;
|
|
145
|
+
export declare const PowExpr: z.ZodType<{
|
|
146
|
+
kind: "pow";
|
|
147
|
+
base: ExprNode;
|
|
148
|
+
exponent: ExprNode;
|
|
149
|
+
}>;
|
|
150
|
+
export type PowExpr = z.infer<typeof PowExpr>;
|
|
151
|
+
export declare const SumArrayExpr: z.ZodType<{
|
|
152
|
+
kind: "sumArray";
|
|
153
|
+
array: ExprNode;
|
|
154
|
+
}>;
|
|
155
|
+
export type SumArrayExpr = z.infer<typeof SumArrayExpr>;
|
|
156
|
+
export declare const MinArrayExpr: z.ZodType<{
|
|
157
|
+
kind: "minArray";
|
|
158
|
+
array: ExprNode;
|
|
159
|
+
}>;
|
|
160
|
+
export type MinArrayExpr = z.infer<typeof MinArrayExpr>;
|
|
161
|
+
export declare const MaxArrayExpr: z.ZodType<{
|
|
162
|
+
kind: "maxArray";
|
|
163
|
+
array: ExprNode;
|
|
164
|
+
}>;
|
|
165
|
+
export type MaxArrayExpr = z.infer<typeof MaxArrayExpr>;
|
|
166
|
+
export declare const ConcatExpr: z.ZodType<{
|
|
167
|
+
kind: "concat";
|
|
168
|
+
args: ExprNode[];
|
|
169
|
+
}>;
|
|
170
|
+
export type ConcatExpr = z.infer<typeof ConcatExpr>;
|
|
171
|
+
export declare const SubstringExpr: z.ZodType<{
|
|
172
|
+
kind: "substring";
|
|
173
|
+
str: ExprNode;
|
|
174
|
+
start: ExprNode;
|
|
175
|
+
end?: ExprNode;
|
|
176
|
+
}>;
|
|
177
|
+
export type SubstringExpr = z.infer<typeof SubstringExpr>;
|
|
178
|
+
export declare const TrimExpr: z.ZodType<{
|
|
179
|
+
kind: "trim";
|
|
180
|
+
str: ExprNode;
|
|
181
|
+
}>;
|
|
182
|
+
export type TrimExpr = z.infer<typeof TrimExpr>;
|
|
183
|
+
export declare const ToLowerCaseExpr: z.ZodType<{
|
|
184
|
+
kind: "toLowerCase";
|
|
185
|
+
str: ExprNode;
|
|
186
|
+
}>;
|
|
187
|
+
export type ToLowerCaseExpr = z.infer<typeof ToLowerCaseExpr>;
|
|
188
|
+
export declare const ToUpperCaseExpr: z.ZodType<{
|
|
189
|
+
kind: "toUpperCase";
|
|
190
|
+
str: ExprNode;
|
|
191
|
+
}>;
|
|
192
|
+
export type ToUpperCaseExpr = z.infer<typeof ToUpperCaseExpr>;
|
|
193
|
+
export declare const StrLenExpr: z.ZodType<{
|
|
194
|
+
kind: "strLen";
|
|
195
|
+
str: ExprNode;
|
|
196
|
+
}>;
|
|
197
|
+
export type StrLenExpr = z.infer<typeof StrLenExpr>;
|
|
198
|
+
export declare const StartsWithExpr: z.ZodType<{
|
|
199
|
+
kind: "startsWith";
|
|
200
|
+
str: ExprNode;
|
|
201
|
+
prefix: ExprNode;
|
|
202
|
+
}>;
|
|
203
|
+
export type StartsWithExpr = z.infer<typeof StartsWithExpr>;
|
|
204
|
+
export declare const EndsWithExpr: z.ZodType<{
|
|
205
|
+
kind: "endsWith";
|
|
206
|
+
str: ExprNode;
|
|
207
|
+
suffix: ExprNode;
|
|
208
|
+
}>;
|
|
209
|
+
export type EndsWithExpr = z.infer<typeof EndsWithExpr>;
|
|
210
|
+
export declare const StrIncludesExpr: z.ZodType<{
|
|
211
|
+
kind: "strIncludes";
|
|
212
|
+
str: ExprNode;
|
|
213
|
+
search: ExprNode;
|
|
214
|
+
}>;
|
|
215
|
+
export type StrIncludesExpr = z.infer<typeof StrIncludesExpr>;
|
|
216
|
+
export declare const IndexOfExpr: z.ZodType<{
|
|
217
|
+
kind: "indexOf";
|
|
218
|
+
str: ExprNode;
|
|
219
|
+
search: ExprNode;
|
|
220
|
+
}>;
|
|
221
|
+
export type IndexOfExpr = z.infer<typeof IndexOfExpr>;
|
|
222
|
+
export declare const ReplaceExpr: z.ZodType<{
|
|
223
|
+
kind: "replace";
|
|
224
|
+
str: ExprNode;
|
|
225
|
+
search: ExprNode;
|
|
226
|
+
replacement: ExprNode;
|
|
227
|
+
}>;
|
|
228
|
+
export type ReplaceExpr = z.infer<typeof ReplaceExpr>;
|
|
229
|
+
export declare const SplitExpr: z.ZodType<{
|
|
230
|
+
kind: "split";
|
|
231
|
+
str: ExprNode;
|
|
232
|
+
delimiter: ExprNode;
|
|
233
|
+
}>;
|
|
234
|
+
export type SplitExpr = z.infer<typeof SplitExpr>;
|
|
235
|
+
export declare const LenExpr: z.ZodType<{
|
|
236
|
+
kind: "len";
|
|
237
|
+
arg: ExprNode;
|
|
238
|
+
}>;
|
|
239
|
+
export type LenExpr = z.infer<typeof LenExpr>;
|
|
240
|
+
export declare const AtExpr: z.ZodType<{
|
|
241
|
+
kind: "at";
|
|
242
|
+
array: ExprNode;
|
|
243
|
+
index: ExprNode;
|
|
244
|
+
}>;
|
|
245
|
+
export type AtExpr = z.infer<typeof AtExpr>;
|
|
246
|
+
export declare const FirstExpr: z.ZodType<{
|
|
247
|
+
kind: "first";
|
|
248
|
+
array: ExprNode;
|
|
249
|
+
}>;
|
|
250
|
+
export type FirstExpr = z.infer<typeof FirstExpr>;
|
|
251
|
+
export declare const LastExpr: z.ZodType<{
|
|
252
|
+
kind: "last";
|
|
253
|
+
array: ExprNode;
|
|
254
|
+
}>;
|
|
255
|
+
export type LastExpr = z.infer<typeof LastExpr>;
|
|
256
|
+
export declare const SliceExpr: z.ZodType<{
|
|
257
|
+
kind: "slice";
|
|
258
|
+
array: ExprNode;
|
|
259
|
+
start: ExprNode;
|
|
260
|
+
end?: ExprNode;
|
|
261
|
+
}>;
|
|
262
|
+
export type SliceExpr = z.infer<typeof SliceExpr>;
|
|
263
|
+
export declare const IncludesExpr: z.ZodType<{
|
|
264
|
+
kind: "includes";
|
|
265
|
+
array: ExprNode;
|
|
266
|
+
item: ExprNode;
|
|
267
|
+
}>;
|
|
268
|
+
export type IncludesExpr = z.infer<typeof IncludesExpr>;
|
|
269
|
+
export declare const FilterExpr: z.ZodType<{
|
|
270
|
+
kind: "filter";
|
|
271
|
+
array: ExprNode;
|
|
272
|
+
predicate: ExprNode;
|
|
273
|
+
}>;
|
|
274
|
+
export type FilterExpr = z.infer<typeof FilterExpr>;
|
|
275
|
+
export declare const MapExpr: z.ZodType<{
|
|
276
|
+
kind: "map";
|
|
277
|
+
array: ExprNode;
|
|
278
|
+
mapper: ExprNode;
|
|
279
|
+
}>;
|
|
280
|
+
export type MapExpr = z.infer<typeof MapExpr>;
|
|
281
|
+
export declare const FindExpr: z.ZodType<{
|
|
282
|
+
kind: "find";
|
|
283
|
+
array: ExprNode;
|
|
284
|
+
predicate: ExprNode;
|
|
285
|
+
}>;
|
|
286
|
+
export type FindExpr = z.infer<typeof FindExpr>;
|
|
287
|
+
export declare const EveryExpr: z.ZodType<{
|
|
288
|
+
kind: "every";
|
|
289
|
+
array: ExprNode;
|
|
290
|
+
predicate: ExprNode;
|
|
291
|
+
}>;
|
|
292
|
+
export type EveryExpr = z.infer<typeof EveryExpr>;
|
|
293
|
+
export declare const SomeExpr: z.ZodType<{
|
|
294
|
+
kind: "some";
|
|
295
|
+
array: ExprNode;
|
|
296
|
+
predicate: ExprNode;
|
|
297
|
+
}>;
|
|
298
|
+
export type SomeExpr = z.infer<typeof SomeExpr>;
|
|
299
|
+
export declare const AppendExpr: z.ZodType<{
|
|
300
|
+
kind: "append";
|
|
301
|
+
array: ExprNode;
|
|
302
|
+
items: ExprNode[];
|
|
303
|
+
}>;
|
|
304
|
+
export type AppendExpr = z.infer<typeof AppendExpr>;
|
|
305
|
+
export declare const ReverseExpr: z.ZodType<{
|
|
306
|
+
kind: "reverse";
|
|
307
|
+
array: ExprNode;
|
|
308
|
+
}>;
|
|
309
|
+
export type ReverseExpr = z.infer<typeof ReverseExpr>;
|
|
310
|
+
export declare const UniqueExpr: z.ZodType<{
|
|
311
|
+
kind: "unique";
|
|
312
|
+
array: ExprNode;
|
|
313
|
+
}>;
|
|
314
|
+
export type UniqueExpr = z.infer<typeof UniqueExpr>;
|
|
315
|
+
export declare const FlatExpr: z.ZodType<{
|
|
316
|
+
kind: "flat";
|
|
317
|
+
array: ExprNode;
|
|
318
|
+
}>;
|
|
319
|
+
export type FlatExpr = z.infer<typeof FlatExpr>;
|
|
320
|
+
export declare const ObjectExpr: z.ZodType<{
|
|
321
|
+
kind: "object";
|
|
322
|
+
fields: Record<string, ExprNode>;
|
|
323
|
+
}>;
|
|
324
|
+
export type ObjectExpr = z.infer<typeof ObjectExpr>;
|
|
325
|
+
export declare const FieldExpr: z.ZodType<{
|
|
326
|
+
kind: "field";
|
|
327
|
+
object: ExprNode;
|
|
328
|
+
property: string;
|
|
329
|
+
}>;
|
|
330
|
+
export type FieldExpr = z.infer<typeof FieldExpr>;
|
|
331
|
+
export declare const KeysExpr: z.ZodType<{
|
|
332
|
+
kind: "keys";
|
|
333
|
+
obj: ExprNode;
|
|
334
|
+
}>;
|
|
335
|
+
export type KeysExpr = z.infer<typeof KeysExpr>;
|
|
336
|
+
export declare const ValuesExpr: z.ZodType<{
|
|
337
|
+
kind: "values";
|
|
338
|
+
obj: ExprNode;
|
|
339
|
+
}>;
|
|
340
|
+
export type ValuesExpr = z.infer<typeof ValuesExpr>;
|
|
341
|
+
export declare const EntriesExpr: z.ZodType<{
|
|
342
|
+
kind: "entries";
|
|
343
|
+
obj: ExprNode;
|
|
344
|
+
}>;
|
|
345
|
+
export type EntriesExpr = z.infer<typeof EntriesExpr>;
|
|
346
|
+
export declare const MergeExpr: z.ZodType<{
|
|
347
|
+
kind: "merge";
|
|
348
|
+
objects: ExprNode[];
|
|
349
|
+
}>;
|
|
350
|
+
export type MergeExpr = z.infer<typeof MergeExpr>;
|
|
351
|
+
export declare const HasKeyExpr: z.ZodType<{
|
|
352
|
+
kind: "hasKey";
|
|
353
|
+
obj: ExprNode;
|
|
354
|
+
key: ExprNode;
|
|
355
|
+
}>;
|
|
356
|
+
export type HasKeyExpr = z.infer<typeof HasKeyExpr>;
|
|
357
|
+
export declare const PickExpr: z.ZodType<{
|
|
358
|
+
kind: "pick";
|
|
359
|
+
obj: ExprNode;
|
|
360
|
+
keys: ExprNode;
|
|
361
|
+
}>;
|
|
362
|
+
export type PickExpr = z.infer<typeof PickExpr>;
|
|
363
|
+
export declare const OmitExpr: z.ZodType<{
|
|
364
|
+
kind: "omit";
|
|
365
|
+
obj: ExprNode;
|
|
366
|
+
keys: ExprNode;
|
|
367
|
+
}>;
|
|
368
|
+
export type OmitExpr = z.infer<typeof OmitExpr>;
|
|
369
|
+
export declare const FromEntriesExpr: z.ZodType<{
|
|
370
|
+
kind: "fromEntries";
|
|
371
|
+
entries: ExprNode;
|
|
372
|
+
}>;
|
|
373
|
+
export type FromEntriesExpr = z.infer<typeof FromEntriesExpr>;
|
|
374
|
+
export declare const TypeofExpr: z.ZodType<{
|
|
375
|
+
kind: "typeof";
|
|
376
|
+
arg: ExprNode;
|
|
377
|
+
}>;
|
|
378
|
+
export type TypeofExpr = z.infer<typeof TypeofExpr>;
|
|
379
|
+
export declare const IsNullExpr: z.ZodType<{
|
|
380
|
+
kind: "isNull";
|
|
381
|
+
arg: ExprNode;
|
|
382
|
+
}>;
|
|
383
|
+
export type IsNullExpr = z.infer<typeof IsNullExpr>;
|
|
384
|
+
export declare const CoalesceExpr: z.ZodType<{
|
|
385
|
+
kind: "coalesce";
|
|
386
|
+
args: ExprNode[];
|
|
387
|
+
}>;
|
|
388
|
+
export type CoalesceExpr = z.infer<typeof CoalesceExpr>;
|
|
389
|
+
export declare const ToStringExpr: z.ZodType<{
|
|
390
|
+
kind: "toString";
|
|
391
|
+
arg: ExprNode;
|
|
392
|
+
}>;
|
|
393
|
+
export type ToStringExpr = z.infer<typeof ToStringExpr>;
|
|
394
|
+
export declare const ToNumberExpr: z.ZodType<{
|
|
395
|
+
kind: "toNumber";
|
|
396
|
+
arg: ExprNode;
|
|
397
|
+
}>;
|
|
398
|
+
export type ToNumberExpr = z.infer<typeof ToNumberExpr>;
|
|
399
|
+
export declare const ToBooleanExpr: z.ZodType<{
|
|
400
|
+
kind: "toBoolean";
|
|
401
|
+
arg: ExprNode;
|
|
402
|
+
}>;
|
|
403
|
+
export type ToBooleanExpr = z.infer<typeof ToBooleanExpr>;
|
|
404
|
+
export declare const ExprNodeSchema: z.ZodType<ExprNode>;
|
|
405
|
+
/**
|
|
406
|
+
* Expression kinds enum for pattern matching
|
|
407
|
+
*/
|
|
408
|
+
export declare const ExprKind: z.ZodEnum<{
|
|
409
|
+
object: "object";
|
|
410
|
+
map: "map";
|
|
411
|
+
values: "values";
|
|
412
|
+
merge: "merge";
|
|
413
|
+
keys: "keys";
|
|
414
|
+
toString: "toString";
|
|
415
|
+
concat: "concat";
|
|
416
|
+
reverse: "reverse";
|
|
417
|
+
slice: "slice";
|
|
418
|
+
indexOf: "indexOf";
|
|
419
|
+
every: "every";
|
|
420
|
+
some: "some";
|
|
421
|
+
filter: "filter";
|
|
422
|
+
find: "find";
|
|
423
|
+
entries: "entries";
|
|
424
|
+
includes: "includes";
|
|
425
|
+
flat: "flat";
|
|
426
|
+
at: "at";
|
|
427
|
+
replace: "replace";
|
|
428
|
+
split: "split";
|
|
429
|
+
substring: "substring";
|
|
430
|
+
toLowerCase: "toLowerCase";
|
|
431
|
+
toUpperCase: "toUpperCase";
|
|
432
|
+
trim: "trim";
|
|
433
|
+
endsWith: "endsWith";
|
|
434
|
+
startsWith: "startsWith";
|
|
435
|
+
sub: "sub";
|
|
436
|
+
lit: "lit";
|
|
437
|
+
get: "get";
|
|
438
|
+
eq: "eq";
|
|
439
|
+
neq: "neq";
|
|
440
|
+
gt: "gt";
|
|
441
|
+
gte: "gte";
|
|
442
|
+
lt: "lt";
|
|
443
|
+
lte: "lte";
|
|
444
|
+
and: "and";
|
|
445
|
+
or: "or";
|
|
446
|
+
not: "not";
|
|
447
|
+
if: "if";
|
|
448
|
+
add: "add";
|
|
449
|
+
mul: "mul";
|
|
450
|
+
div: "div";
|
|
451
|
+
mod: "mod";
|
|
452
|
+
min: "min";
|
|
453
|
+
max: "max";
|
|
454
|
+
abs: "abs";
|
|
455
|
+
neg: "neg";
|
|
456
|
+
floor: "floor";
|
|
457
|
+
ceil: "ceil";
|
|
458
|
+
round: "round";
|
|
459
|
+
sqrt: "sqrt";
|
|
460
|
+
pow: "pow";
|
|
461
|
+
sumArray: "sumArray";
|
|
462
|
+
minArray: "minArray";
|
|
463
|
+
maxArray: "maxArray";
|
|
464
|
+
strLen: "strLen";
|
|
465
|
+
strIncludes: "strIncludes";
|
|
466
|
+
len: "len";
|
|
467
|
+
first: "first";
|
|
468
|
+
last: "last";
|
|
469
|
+
append: "append";
|
|
470
|
+
unique: "unique";
|
|
471
|
+
field: "field";
|
|
472
|
+
hasKey: "hasKey";
|
|
473
|
+
pick: "pick";
|
|
474
|
+
omit: "omit";
|
|
475
|
+
fromEntries: "fromEntries";
|
|
476
|
+
typeof: "typeof";
|
|
477
|
+
isNull: "isNull";
|
|
478
|
+
coalesce: "coalesce";
|
|
479
|
+
toNumber: "toNumber";
|
|
480
|
+
toBoolean: "toBoolean";
|
|
481
|
+
}>;
|
|
482
|
+
export type ExprKind = z.infer<typeof ExprKind>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Field type definitions
|
|
4
|
+
*/
|
|
5
|
+
export declare const PrimitiveFieldType: z.ZodEnum<{
|
|
6
|
+
string: "string";
|
|
7
|
+
number: "number";
|
|
8
|
+
boolean: "boolean";
|
|
9
|
+
object: "object";
|
|
10
|
+
null: "null";
|
|
11
|
+
array: "array";
|
|
12
|
+
}>;
|
|
13
|
+
export type PrimitiveFieldType = z.infer<typeof PrimitiveFieldType>;
|
|
14
|
+
export declare const EnumFieldType: z.ZodObject<{
|
|
15
|
+
enum: z.ZodReadonly<z.ZodArray<z.ZodUnknown>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type EnumFieldType = z.infer<typeof EnumFieldType>;
|
|
18
|
+
export declare const FieldType: z.ZodUnion<readonly [z.ZodEnum<{
|
|
19
|
+
string: "string";
|
|
20
|
+
number: "number";
|
|
21
|
+
boolean: "boolean";
|
|
22
|
+
object: "object";
|
|
23
|
+
null: "null";
|
|
24
|
+
array: "array";
|
|
25
|
+
}>, z.ZodObject<{
|
|
26
|
+
enum: z.ZodReadonly<z.ZodArray<z.ZodUnknown>>;
|
|
27
|
+
}, z.core.$strip>]>;
|
|
28
|
+
export type FieldType = z.infer<typeof FieldType>;
|
|
29
|
+
/**
|
|
30
|
+
* Field specification (recursive for nested objects/arrays)
|
|
31
|
+
*/
|
|
32
|
+
export type FieldSpec = {
|
|
33
|
+
type: FieldType;
|
|
34
|
+
required: boolean;
|
|
35
|
+
default?: unknown;
|
|
36
|
+
description?: string;
|
|
37
|
+
fields?: Record<string, FieldSpec>;
|
|
38
|
+
items?: FieldSpec;
|
|
39
|
+
};
|
|
40
|
+
export declare const FieldSpec: z.ZodType<FieldSpec>;
|
|
41
|
+
/**
|
|
42
|
+
* State specification - defines the shape of domain state
|
|
43
|
+
*/
|
|
44
|
+
export declare const StateSpec: z.ZodObject<{
|
|
45
|
+
fields: z.ZodRecord<z.ZodString, z.ZodType<FieldSpec, unknown, z.core.$ZodTypeInternals<FieldSpec, unknown>>>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type StateSpec = z.infer<typeof StateSpec>;
|