@wundr.io/langgraph-orchestrator 1.0.3

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.
Files changed (57) hide show
  1. package/README.md +842 -0
  2. package/dist/checkpointing.d.ts +265 -0
  3. package/dist/checkpointing.d.ts.map +1 -0
  4. package/dist/checkpointing.js +577 -0
  5. package/dist/checkpointing.js.map +1 -0
  6. package/dist/edges/conditional-edge.d.ts +230 -0
  7. package/dist/edges/conditional-edge.d.ts.map +1 -0
  8. package/dist/edges/conditional-edge.js +439 -0
  9. package/dist/edges/conditional-edge.js.map +1 -0
  10. package/dist/edges/loop-edge.d.ts +290 -0
  11. package/dist/edges/loop-edge.d.ts.map +1 -0
  12. package/dist/edges/loop-edge.js +503 -0
  13. package/dist/edges/loop-edge.js.map +1 -0
  14. package/dist/index.d.ts +125 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +269 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/nodes/decision-node.d.ts +276 -0
  19. package/dist/nodes/decision-node.d.ts.map +1 -0
  20. package/dist/nodes/decision-node.js +403 -0
  21. package/dist/nodes/decision-node.js.map +1 -0
  22. package/dist/nodes/human-node.d.ts +272 -0
  23. package/dist/nodes/human-node.d.ts.map +1 -0
  24. package/dist/nodes/human-node.js +394 -0
  25. package/dist/nodes/human-node.js.map +1 -0
  26. package/dist/nodes/llm-node.d.ts +173 -0
  27. package/dist/nodes/llm-node.d.ts.map +1 -0
  28. package/dist/nodes/llm-node.js +325 -0
  29. package/dist/nodes/llm-node.js.map +1 -0
  30. package/dist/nodes/tool-node.d.ts +151 -0
  31. package/dist/nodes/tool-node.d.ts.map +1 -0
  32. package/dist/nodes/tool-node.js +373 -0
  33. package/dist/nodes/tool-node.js.map +1 -0
  34. package/dist/prebuilt-graphs/plan-execute-refine.d.ts +149 -0
  35. package/dist/prebuilt-graphs/plan-execute-refine.d.ts.map +1 -0
  36. package/dist/prebuilt-graphs/plan-execute-refine.js +600 -0
  37. package/dist/prebuilt-graphs/plan-execute-refine.js.map +1 -0
  38. package/dist/state-graph.d.ts +158 -0
  39. package/dist/state-graph.d.ts.map +1 -0
  40. package/dist/state-graph.js +756 -0
  41. package/dist/state-graph.js.map +1 -0
  42. package/dist/types.d.ts +762 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/types.js +73 -0
  45. package/dist/types.js.map +1 -0
  46. package/package.json +57 -0
  47. package/src/checkpointing.ts +702 -0
  48. package/src/edges/conditional-edge.ts +518 -0
  49. package/src/edges/loop-edge.ts +623 -0
  50. package/src/index.ts +416 -0
  51. package/src/nodes/decision-node.ts +538 -0
  52. package/src/nodes/human-node.ts +572 -0
  53. package/src/nodes/llm-node.ts +448 -0
  54. package/src/nodes/tool-node.ts +525 -0
  55. package/src/prebuilt-graphs/plan-execute-refine.ts +769 -0
  56. package/src/state-graph.ts +990 -0
  57. package/src/types.ts +729 -0
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Conditional Edge - Routing based on state conditions
3
+ * @module @wundr.io/langgraph-orchestrator
4
+ */
5
+ import { z } from 'zod';
6
+ import type { AgentState, EdgeDefinition, EdgeCondition, EdgeConditionEvaluator } from '../types';
7
+ /**
8
+ * Builder for conditional edges with fluent API
9
+ */
10
+ export declare class ConditionalEdgeBuilder<TState extends AgentState = AgentState> {
11
+ private readonly from;
12
+ private readonly conditions;
13
+ private defaultTarget?;
14
+ /**
15
+ * Create a new conditional edge builder
16
+ * @param from - Source node name
17
+ */
18
+ constructor(from: string);
19
+ /**
20
+ * Add a condition branch
21
+ * @param condition - Condition to evaluate
22
+ * @param target - Target node if condition matches
23
+ * @returns this for chaining
24
+ */
25
+ when(condition: EdgeCondition, target: string): this;
26
+ /**
27
+ * Add an equals condition
28
+ * @param field - Field path to check
29
+ * @param value - Value to compare
30
+ * @param target - Target node if matches
31
+ * @returns this for chaining
32
+ */
33
+ whenEquals(field: string, value: unknown, target: string): this;
34
+ /**
35
+ * Add a not-equals condition
36
+ * @param field - Field path to check
37
+ * @param value - Value to compare
38
+ * @param target - Target node if doesn't match
39
+ * @returns this for chaining
40
+ */
41
+ whenNotEquals(field: string, value: unknown, target: string): this;
42
+ /**
43
+ * Add a contains condition
44
+ * @param field - Field path to check (array or string)
45
+ * @param value - Value to look for
46
+ * @param target - Target node if contains
47
+ * @returns this for chaining
48
+ */
49
+ whenContains(field: string, value: unknown, target: string): this;
50
+ /**
51
+ * Add a greater-than condition
52
+ * @param field - Field path to check
53
+ * @param value - Value to compare
54
+ * @param target - Target node if greater
55
+ * @returns this for chaining
56
+ */
57
+ whenGreaterThan(field: string, value: number, target: string): this;
58
+ /**
59
+ * Add a less-than condition
60
+ * @param field - Field path to check
61
+ * @param value - Value to compare
62
+ * @param target - Target node if less
63
+ * @returns this for chaining
64
+ */
65
+ whenLessThan(field: string, value: number, target: string): this;
66
+ /**
67
+ * Add an exists condition
68
+ * @param field - Field path to check
69
+ * @param target - Target node if field exists
70
+ * @returns this for chaining
71
+ */
72
+ whenExists(field: string, target: string): this;
73
+ /**
74
+ * Add a not-exists condition
75
+ * @param field - Field path to check
76
+ * @param target - Target node if field doesn't exist
77
+ * @returns this for chaining
78
+ */
79
+ whenNotExists(field: string, target: string): this;
80
+ /**
81
+ * Add a custom condition
82
+ * @param evaluate - Custom evaluator function
83
+ * @param target - Target node if evaluator returns true
84
+ * @returns this for chaining
85
+ */
86
+ whenCustom(evaluate: EdgeConditionEvaluator<TState>, target: string): this;
87
+ /**
88
+ * Set the default target if no conditions match
89
+ * @param target - Default target node
90
+ * @returns this for chaining
91
+ */
92
+ otherwise(target: string): this;
93
+ /**
94
+ * Build the edge definitions
95
+ * @returns Array of EdgeDefinition
96
+ */
97
+ build(): EdgeDefinition[];
98
+ }
99
+ /**
100
+ * Create a conditional edge builder
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * const edges = conditionalEdge('router')
105
+ * .whenEquals('data.action', 'search', 'search-node')
106
+ * .whenEquals('data.action', 'answer', 'answer-node')
107
+ * .whenGreaterThan('data.confidence', 0.9, 'direct-answer')
108
+ * .otherwise('fallback')
109
+ * .build();
110
+ *
111
+ * for (const edge of edges) {
112
+ * graph.addConditionalEdge(edge.from, edge.to, edge.condition!);
113
+ * }
114
+ * ```
115
+ *
116
+ * @param from - Source node name
117
+ * @returns ConditionalEdgeBuilder
118
+ */
119
+ export declare function conditionalEdge<TState extends AgentState = AgentState>(from: string): ConditionalEdgeBuilder<TState>;
120
+ /**
121
+ * Create a router function for LLM-based routing
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * const router = createRouter({
126
+ * routes: {
127
+ * 'search': 'search-node',
128
+ * 'calculate': 'calculator-node',
129
+ * 'answer': 'answer-node'
130
+ * },
131
+ * routeExtractor: (state) => state.data.nextAction as string,
132
+ * defaultRoute: 'answer'
133
+ * });
134
+ * ```
135
+ *
136
+ * @param options - Router configuration
137
+ * @returns Router function
138
+ */
139
+ export declare function createRouter<TState extends AgentState = AgentState>(options: {
140
+ routes: Record<string, string>;
141
+ routeExtractor: (state: TState) => string;
142
+ defaultRoute?: string;
143
+ validator?: (route: string) => boolean;
144
+ }): (state: TState) => string;
145
+ /**
146
+ * Condition factory functions
147
+ */
148
+ export declare const conditions: {
149
+ /**
150
+ * Create an equals condition
151
+ */
152
+ equals(field: string, value: unknown): EdgeCondition;
153
+ /**
154
+ * Create a not-equals condition
155
+ */
156
+ notEquals(field: string, value: unknown): EdgeCondition;
157
+ /**
158
+ * Create a contains condition
159
+ */
160
+ contains(field: string, value: unknown): EdgeCondition;
161
+ /**
162
+ * Create a greater-than condition
163
+ */
164
+ greaterThan(field: string, value: number): EdgeCondition;
165
+ /**
166
+ * Create a less-than condition
167
+ */
168
+ lessThan(field: string, value: number): EdgeCondition;
169
+ /**
170
+ * Create an exists condition
171
+ */
172
+ exists(field: string): EdgeCondition;
173
+ /**
174
+ * Create a not-exists condition
175
+ */
176
+ notExists(field: string): EdgeCondition;
177
+ /**
178
+ * Create a custom condition
179
+ */
180
+ custom<TState extends AgentState = AgentState>(evaluate: EdgeConditionEvaluator<TState>): EdgeCondition;
181
+ /**
182
+ * Create an AND condition (all must be true)
183
+ */
184
+ and(...conditionList: EdgeCondition[]): EdgeCondition;
185
+ /**
186
+ * Create an OR condition (any must be true)
187
+ */
188
+ or(...conditionList: EdgeCondition[]): EdgeCondition;
189
+ /**
190
+ * Create a NOT condition (negate result)
191
+ */
192
+ not(condition: EdgeCondition): EdgeCondition;
193
+ /**
194
+ * Create a range condition (value between min and max)
195
+ */
196
+ inRange(field: string, min: number, max: number): EdgeCondition;
197
+ /**
198
+ * Create a regex match condition
199
+ */
200
+ matches(field: string, pattern: RegExp): EdgeCondition;
201
+ /**
202
+ * Create an "in array" condition
203
+ */
204
+ isIn(field: string, values: unknown[]): EdgeCondition;
205
+ /**
206
+ * Create a type check condition
207
+ */
208
+ isType(field: string, type: "string" | "number" | "boolean" | "object" | "array"): EdgeCondition;
209
+ };
210
+ /**
211
+ * Schema for edge condition validation
212
+ */
213
+ export declare const EdgeConditionSchema: z.ZodObject<{
214
+ type: z.ZodEnum<["equals", "not_equals", "contains", "greater_than", "less_than", "exists", "not_exists", "custom"]>;
215
+ field: z.ZodOptional<z.ZodString>;
216
+ value: z.ZodOptional<z.ZodUnknown>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ type: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "exists" | "not_exists" | "custom";
219
+ value?: unknown;
220
+ field?: string | undefined;
221
+ }, {
222
+ type: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "exists" | "not_exists" | "custom";
223
+ value?: unknown;
224
+ field?: string | undefined;
225
+ }>;
226
+ /**
227
+ * Validate an edge condition
228
+ */
229
+ export declare function validateCondition(condition: EdgeCondition): boolean;
230
+ //# sourceMappingURL=conditional-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-edge.d.ts","sourceRoot":"","sources":["../../src/edges/conditional-edge.ts"],"names":[],"mappings":"AAAA;;;GA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,aAAa;IAerD;;OAEG;yBACkB,aAAa,EAAE,GAAG,aAAa;IAepD;;OAEG;mBACY,aAAa,GAAG,aAAa;IAU5C;;OAEG;mBACY,MAAM,OAAO,MAAM,OAAO,MAAM,GAAG,aAAa;IAU/D;;OAEG;mBACY,MAAM,WAAW,MAAM,GAAG,aAAa;IAUtD;;OAEG;gBACS,MAAM,UAAU,OAAO,EAAE,GAAG,aAAa;IAUrD;;OAEG;kBAEM,MAAM,QACP,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GACzD,aAAa;CAYjB,CAAC;AA8EF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAa9B,CAAC;AAEH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAOnE"}
@@ -0,0 +1,439 @@
1
+ "use strict";
2
+ /**
3
+ * Conditional Edge - Routing based on state conditions
4
+ * @module @wundr.io/langgraph-orchestrator
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.EdgeConditionSchema = exports.conditions = exports.ConditionalEdgeBuilder = void 0;
8
+ exports.conditionalEdge = conditionalEdge;
9
+ exports.createRouter = createRouter;
10
+ exports.validateCondition = validateCondition;
11
+ const zod_1 = require("zod");
12
+ /**
13
+ * Builder for conditional edges with fluent API
14
+ */
15
+ class ConditionalEdgeBuilder {
16
+ from;
17
+ conditions = [];
18
+ defaultTarget;
19
+ /**
20
+ * Create a new conditional edge builder
21
+ * @param from - Source node name
22
+ */
23
+ constructor(from) {
24
+ this.from = from;
25
+ }
26
+ /**
27
+ * Add a condition branch
28
+ * @param condition - Condition to evaluate
29
+ * @param target - Target node if condition matches
30
+ * @returns this for chaining
31
+ */
32
+ when(condition, target) {
33
+ this.conditions.push({ condition, target });
34
+ return this;
35
+ }
36
+ /**
37
+ * Add an equals condition
38
+ * @param field - Field path to check
39
+ * @param value - Value to compare
40
+ * @param target - Target node if matches
41
+ * @returns this for chaining
42
+ */
43
+ whenEquals(field, value, target) {
44
+ return this.when({ type: 'equals', field, value }, target);
45
+ }
46
+ /**
47
+ * Add a not-equals condition
48
+ * @param field - Field path to check
49
+ * @param value - Value to compare
50
+ * @param target - Target node if doesn't match
51
+ * @returns this for chaining
52
+ */
53
+ whenNotEquals(field, value, target) {
54
+ return this.when({ type: 'not_equals', field, value }, target);
55
+ }
56
+ /**
57
+ * Add a contains condition
58
+ * @param field - Field path to check (array or string)
59
+ * @param value - Value to look for
60
+ * @param target - Target node if contains
61
+ * @returns this for chaining
62
+ */
63
+ whenContains(field, value, target) {
64
+ return this.when({ type: 'contains', field, value }, target);
65
+ }
66
+ /**
67
+ * Add a greater-than condition
68
+ * @param field - Field path to check
69
+ * @param value - Value to compare
70
+ * @param target - Target node if greater
71
+ * @returns this for chaining
72
+ */
73
+ whenGreaterThan(field, value, target) {
74
+ return this.when({ type: 'greater_than', field, value }, target);
75
+ }
76
+ /**
77
+ * Add a less-than condition
78
+ * @param field - Field path to check
79
+ * @param value - Value to compare
80
+ * @param target - Target node if less
81
+ * @returns this for chaining
82
+ */
83
+ whenLessThan(field, value, target) {
84
+ return this.when({ type: 'less_than', field, value }, target);
85
+ }
86
+ /**
87
+ * Add an exists condition
88
+ * @param field - Field path to check
89
+ * @param target - Target node if field exists
90
+ * @returns this for chaining
91
+ */
92
+ whenExists(field, target) {
93
+ return this.when({ type: 'exists', field }, target);
94
+ }
95
+ /**
96
+ * Add a not-exists condition
97
+ * @param field - Field path to check
98
+ * @param target - Target node if field doesn't exist
99
+ * @returns this for chaining
100
+ */
101
+ whenNotExists(field, target) {
102
+ return this.when({ type: 'not_exists', field }, target);
103
+ }
104
+ /**
105
+ * Add a custom condition
106
+ * @param evaluate - Custom evaluator function
107
+ * @param target - Target node if evaluator returns true
108
+ * @returns this for chaining
109
+ */
110
+ whenCustom(evaluate, target) {
111
+ return this.when({ type: 'custom', evaluate: evaluate }, target);
112
+ }
113
+ /**
114
+ * Set the default target if no conditions match
115
+ * @param target - Default target node
116
+ * @returns this for chaining
117
+ */
118
+ otherwise(target) {
119
+ this.defaultTarget = target;
120
+ return this;
121
+ }
122
+ /**
123
+ * Build the edge definitions
124
+ * @returns Array of EdgeDefinition
125
+ */
126
+ build() {
127
+ const edges = this.conditions.map(({ condition, target }) => ({
128
+ from: this.from,
129
+ to: target,
130
+ type: 'conditional',
131
+ condition,
132
+ }));
133
+ if (this.defaultTarget) {
134
+ edges.push({
135
+ from: this.from,
136
+ to: this.defaultTarget,
137
+ type: 'direct',
138
+ });
139
+ }
140
+ return edges;
141
+ }
142
+ }
143
+ exports.ConditionalEdgeBuilder = ConditionalEdgeBuilder;
144
+ /**
145
+ * Create a conditional edge builder
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * const edges = conditionalEdge('router')
150
+ * .whenEquals('data.action', 'search', 'search-node')
151
+ * .whenEquals('data.action', 'answer', 'answer-node')
152
+ * .whenGreaterThan('data.confidence', 0.9, 'direct-answer')
153
+ * .otherwise('fallback')
154
+ * .build();
155
+ *
156
+ * for (const edge of edges) {
157
+ * graph.addConditionalEdge(edge.from, edge.to, edge.condition!);
158
+ * }
159
+ * ```
160
+ *
161
+ * @param from - Source node name
162
+ * @returns ConditionalEdgeBuilder
163
+ */
164
+ function conditionalEdge(from) {
165
+ return new ConditionalEdgeBuilder(from);
166
+ }
167
+ /**
168
+ * Create a router function for LLM-based routing
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * const router = createRouter({
173
+ * routes: {
174
+ * 'search': 'search-node',
175
+ * 'calculate': 'calculator-node',
176
+ * 'answer': 'answer-node'
177
+ * },
178
+ * routeExtractor: (state) => state.data.nextAction as string,
179
+ * defaultRoute: 'answer'
180
+ * });
181
+ * ```
182
+ *
183
+ * @param options - Router configuration
184
+ * @returns Router function
185
+ */
186
+ function createRouter(options) {
187
+ return (state) => {
188
+ const extractedRoute = options.routeExtractor(state);
189
+ if (options.validator && !options.validator(extractedRoute)) {
190
+ if (options.defaultRoute) {
191
+ return options.defaultRoute;
192
+ }
193
+ throw new Error(`Invalid route: ${extractedRoute}`);
194
+ }
195
+ const target = options.routes[extractedRoute];
196
+ if (target) {
197
+ return target;
198
+ }
199
+ if (options.defaultRoute) {
200
+ return options.defaultRoute;
201
+ }
202
+ throw new Error(`No route found for: ${extractedRoute}`);
203
+ };
204
+ }
205
+ /**
206
+ * Condition factory functions
207
+ */
208
+ exports.conditions = {
209
+ /**
210
+ * Create an equals condition
211
+ */
212
+ equals(field, value) {
213
+ return { type: 'equals', field, value };
214
+ },
215
+ /**
216
+ * Create a not-equals condition
217
+ */
218
+ notEquals(field, value) {
219
+ return { type: 'not_equals', field, value };
220
+ },
221
+ /**
222
+ * Create a contains condition
223
+ */
224
+ contains(field, value) {
225
+ return { type: 'contains', field, value };
226
+ },
227
+ /**
228
+ * Create a greater-than condition
229
+ */
230
+ greaterThan(field, value) {
231
+ return { type: 'greater_than', field, value };
232
+ },
233
+ /**
234
+ * Create a less-than condition
235
+ */
236
+ lessThan(field, value) {
237
+ return { type: 'less_than', field, value };
238
+ },
239
+ /**
240
+ * Create an exists condition
241
+ */
242
+ exists(field) {
243
+ return { type: 'exists', field };
244
+ },
245
+ /**
246
+ * Create a not-exists condition
247
+ */
248
+ notExists(field) {
249
+ return { type: 'not_exists', field };
250
+ },
251
+ /**
252
+ * Create a custom condition
253
+ */
254
+ custom(evaluate) {
255
+ return { type: 'custom', evaluate: evaluate };
256
+ },
257
+ /**
258
+ * Create an AND condition (all must be true)
259
+ */
260
+ and(...conditionList) {
261
+ return {
262
+ type: 'custom',
263
+ evaluate: async (state, context) => {
264
+ for (const condition of conditionList) {
265
+ const result = await evaluateCondition(condition, state, context);
266
+ if (!result) {
267
+ return false;
268
+ }
269
+ }
270
+ return true;
271
+ },
272
+ };
273
+ },
274
+ /**
275
+ * Create an OR condition (any must be true)
276
+ */
277
+ or(...conditionList) {
278
+ return {
279
+ type: 'custom',
280
+ evaluate: async (state, context) => {
281
+ for (const condition of conditionList) {
282
+ const result = await evaluateCondition(condition, state, context);
283
+ if (result) {
284
+ return true;
285
+ }
286
+ }
287
+ return false;
288
+ },
289
+ };
290
+ },
291
+ /**
292
+ * Create a NOT condition (negate result)
293
+ */
294
+ not(condition) {
295
+ return {
296
+ type: 'custom',
297
+ evaluate: async (state, context) => {
298
+ const result = await evaluateCondition(condition, state, context);
299
+ return !result;
300
+ },
301
+ };
302
+ },
303
+ /**
304
+ * Create a range condition (value between min and max)
305
+ */
306
+ inRange(field, min, max) {
307
+ return {
308
+ type: 'custom',
309
+ evaluate: async (state) => {
310
+ const value = getFieldValue(state, field);
311
+ return typeof value === 'number' && value >= min && value <= max;
312
+ },
313
+ };
314
+ },
315
+ /**
316
+ * Create a regex match condition
317
+ */
318
+ matches(field, pattern) {
319
+ return {
320
+ type: 'custom',
321
+ evaluate: async (state) => {
322
+ const value = getFieldValue(state, field);
323
+ return typeof value === 'string' && pattern.test(value);
324
+ },
325
+ };
326
+ },
327
+ /**
328
+ * Create an "in array" condition
329
+ */
330
+ isIn(field, values) {
331
+ return {
332
+ type: 'custom',
333
+ evaluate: async (state) => {
334
+ const value = getFieldValue(state, field);
335
+ return values.includes(value);
336
+ },
337
+ };
338
+ },
339
+ /**
340
+ * Create a type check condition
341
+ */
342
+ isType(field, type) {
343
+ return {
344
+ type: 'custom',
345
+ evaluate: async (state) => {
346
+ const value = getFieldValue(state, field);
347
+ if (type === 'array') {
348
+ return Array.isArray(value);
349
+ }
350
+ return typeof value === type;
351
+ },
352
+ };
353
+ },
354
+ };
355
+ /**
356
+ * Evaluate a condition against state
357
+ */
358
+ async function evaluateCondition(condition, state, context) {
359
+ const fieldValue = condition.field
360
+ ? getFieldValue(state, condition.field)
361
+ : undefined;
362
+ switch (condition.type) {
363
+ case 'equals':
364
+ return fieldValue === condition.value;
365
+ case 'not_equals':
366
+ return fieldValue !== condition.value;
367
+ case 'contains':
368
+ if (Array.isArray(fieldValue)) {
369
+ return fieldValue.includes(condition.value);
370
+ }
371
+ if (typeof fieldValue === 'string') {
372
+ return fieldValue.includes(String(condition.value));
373
+ }
374
+ return false;
375
+ case 'greater_than':
376
+ return (typeof fieldValue === 'number' &&
377
+ typeof condition.value === 'number' &&
378
+ fieldValue > condition.value);
379
+ case 'less_than':
380
+ return (typeof fieldValue === 'number' &&
381
+ typeof condition.value === 'number' &&
382
+ fieldValue < condition.value);
383
+ case 'exists':
384
+ return fieldValue !== undefined && fieldValue !== null;
385
+ case 'not_exists':
386
+ return fieldValue === undefined || fieldValue === null;
387
+ case 'custom':
388
+ if (condition.evaluate) {
389
+ return await condition.evaluate(state, context);
390
+ }
391
+ return false;
392
+ default:
393
+ return false;
394
+ }
395
+ }
396
+ /**
397
+ * Get a nested field value from state
398
+ */
399
+ function getFieldValue(state, field) {
400
+ const parts = field.split('.');
401
+ let current = state;
402
+ for (const part of parts) {
403
+ if (current === null || current === undefined) {
404
+ return undefined;
405
+ }
406
+ current = current[part];
407
+ }
408
+ return current;
409
+ }
410
+ /**
411
+ * Schema for edge condition validation
412
+ */
413
+ exports.EdgeConditionSchema = zod_1.z.object({
414
+ type: zod_1.z.enum([
415
+ 'equals',
416
+ 'not_equals',
417
+ 'contains',
418
+ 'greater_than',
419
+ 'less_than',
420
+ 'exists',
421
+ 'not_exists',
422
+ 'custom',
423
+ ]),
424
+ field: zod_1.z.string().optional(),
425
+ value: zod_1.z.unknown().optional(),
426
+ });
427
+ /**
428
+ * Validate an edge condition
429
+ */
430
+ function validateCondition(condition) {
431
+ try {
432
+ exports.EdgeConditionSchema.parse(condition);
433
+ return true;
434
+ }
435
+ catch {
436
+ return false;
437
+ }
438
+ }
439
+ //# sourceMappingURL=conditional-edge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditional-edge.js","sourceRoot":"","sources":["../../src/edges/conditional-edge.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0LH,0CAIC;AAqBD,oCA2BC;AA6QD,8CAOC;AAhgBD,6BAAwB;AAUxB;;GAEG;AACH,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