mcp-event-intelligence 0.3.1 → 0.5.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/CHANGELOG.md +81 -0
- package/README.md +123 -23
- package/SECURITY.md +4 -4
- package/bin/mcp-event-intelligence.mjs +3 -3
- package/dist/src/composite/engine.d.ts +6 -0
- package/dist/src/composite/engine.js +599 -10
- package/dist/src/composite/matching.d.ts +1 -1
- package/dist/src/composite/matching.js +66 -1
- package/dist/src/intelligenceProtocol/activationSchemas.d.ts +2 -0
- package/dist/src/intelligenceProtocol/activationSchemas.js +1 -0
- package/dist/src/intelligenceProtocol/index.d.ts +9 -2
- package/dist/src/intelligenceProtocol/index.js +5 -1
- package/dist/src/intelligenceProtocol/operatorRegistry.d.ts +567 -0
- package/dist/src/intelligenceProtocol/operatorRegistry.js +477 -0
- package/dist/src/intelligenceProtocol/patternV2Schemas.d.ts +188 -0
- package/dist/src/intelligenceProtocol/patternV2Schemas.js +801 -0
- package/dist/src/intelligenceProtocol/schemas.d.ts +6 -0
- package/dist/src/intelligenceProtocol/schemas.js +3 -0
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.d.ts +179 -4
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.js +38 -4
- package/dist/src/intelligenceProtocol/triggerSchemas.d.ts +262 -0
- package/dist/src/intelligenceProtocol/triggerSchemas.js +164 -2
- package/dist/src/mcpEvents/consumer.d.ts +2 -0
- package/dist/src/mcpEvents/consumer.js +2 -0
- package/dist/src/mcpEvents/erpnextProvider.d.ts +0 -2
- package/dist/src/mcpEvents/erpnextProvider.js +0 -3
- package/dist/src/mcpEvents/provider.d.ts +24 -10
- package/dist/src/mcpEvents/provider.js +124 -55
- package/dist/src/mcpEvents/server.d.ts +3 -1
- package/dist/src/mcpEvents/server.js +20 -19
- package/dist/src/patternV2/evaluator.d.ts +43 -0
- package/dist/src/patternV2/evaluator.js +927 -0
- package/dist/src/patternV2/legacyCompiler.d.ts +3 -0
- package/dist/src/patternV2/legacyCompiler.js +184 -0
- package/dist/src/protocol/types.d.ts +1 -0
- package/package.json +5 -2
- package/scripts/host-integration.d.mts +47 -0
- package/scripts/host-integration.mjs +9 -0
- package/scripts/lib/activation-hydrator.mjs +1 -0
- package/scripts/lib/composite-event-consumer.mjs +4 -0
- package/scripts/lib/derived-event-coordinator.mjs +75 -1
- package/scripts/lib/json-schema.mjs +134 -0
- package/scripts/lib/local-event-intelligence-runtime.mjs +1 -0
- package/scripts/lib/mcp-events-client.mjs +798 -253
- package/scripts/lib/mcp-events-compatibility.mjs +54 -0
- package/scripts/lib/persistent-event-store.mjs +68 -9
- package/scripts/lib/trigger-control-plane.mjs +180 -0
- package/scripts/lib/trigger-inspector.mjs +15 -0
- package/scripts/lib/trigger-planner.mjs +213 -12
- package/scripts/mcp-stdio-server.mjs +38 -52
- package/server.json +4 -4
|
@@ -13,14 +13,50 @@ export declare const StructuredPredicateSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
13
13
|
path: z.ZodString;
|
|
14
14
|
op: z.ZodLiteral<"contains">;
|
|
15
15
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
op: z.ZodLiteral<"startsWith">;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
op: z.ZodLiteral<"endsWith">;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
path: z.ZodString;
|
|
26
|
+
op: z.ZodLiteral<"regex">;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
flags: z.ZodOptional<z.ZodString>;
|
|
16
29
|
}, z.core.$strip>, z.ZodObject<{
|
|
17
30
|
path: z.ZodString;
|
|
18
31
|
op: z.ZodLiteral<"in">;
|
|
19
32
|
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
path: z.ZodString;
|
|
35
|
+
op: z.ZodLiteral<"notIn">;
|
|
36
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
path: z.ZodString;
|
|
39
|
+
op: z.ZodLiteral<"between">;
|
|
40
|
+
value: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>], null>;
|
|
20
41
|
}, z.core.$strip>, z.ZodObject<{
|
|
21
42
|
path: z.ZodString;
|
|
22
43
|
op: z.ZodLiteral<"exists">;
|
|
23
44
|
value: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
+
path: z.ZodString;
|
|
47
|
+
op: z.ZodLiteral<"isNull">;
|
|
48
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
path: z.ZodString;
|
|
51
|
+
op: z.ZodLiteral<"type">;
|
|
52
|
+
value: z.ZodEnum<{
|
|
53
|
+
string: "string";
|
|
54
|
+
number: "number";
|
|
55
|
+
boolean: "boolean";
|
|
56
|
+
object: "object";
|
|
57
|
+
null: "null";
|
|
58
|
+
array: "array";
|
|
59
|
+
}>;
|
|
24
60
|
}, z.core.$strip>, z.ZodObject<{
|
|
25
61
|
path: z.ZodString;
|
|
26
62
|
op: z.ZodLiteral<"gt">;
|
|
@@ -43,6 +79,7 @@ export declare const TriggerClauseSchema: z.ZodObject<{
|
|
|
43
79
|
event: z.ZodString;
|
|
44
80
|
serverId: z.ZodOptional<z.ZodString>;
|
|
45
81
|
contractVersion: z.ZodOptional<z.ZodString>;
|
|
82
|
+
arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
83
|
where: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
84
|
path: z.ZodString;
|
|
48
85
|
op: z.ZodLiteral<"eq">;
|
|
@@ -55,14 +92,50 @@ export declare const TriggerClauseSchema: z.ZodObject<{
|
|
|
55
92
|
path: z.ZodString;
|
|
56
93
|
op: z.ZodLiteral<"contains">;
|
|
57
94
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
op: z.ZodLiteral<"startsWith">;
|
|
98
|
+
value: z.ZodString;
|
|
99
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
+
path: z.ZodString;
|
|
101
|
+
op: z.ZodLiteral<"endsWith">;
|
|
102
|
+
value: z.ZodString;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
path: z.ZodString;
|
|
105
|
+
op: z.ZodLiteral<"regex">;
|
|
106
|
+
value: z.ZodString;
|
|
107
|
+
flags: z.ZodOptional<z.ZodString>;
|
|
58
108
|
}, z.core.$strip>, z.ZodObject<{
|
|
59
109
|
path: z.ZodString;
|
|
60
110
|
op: z.ZodLiteral<"in">;
|
|
61
111
|
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
+
path: z.ZodString;
|
|
114
|
+
op: z.ZodLiteral<"notIn">;
|
|
115
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
path: z.ZodString;
|
|
118
|
+
op: z.ZodLiteral<"between">;
|
|
119
|
+
value: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>], null>;
|
|
62
120
|
}, z.core.$strip>, z.ZodObject<{
|
|
63
121
|
path: z.ZodString;
|
|
64
122
|
op: z.ZodLiteral<"exists">;
|
|
65
123
|
value: z.ZodDefault<z.ZodBoolean>;
|
|
124
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
125
|
+
path: z.ZodString;
|
|
126
|
+
op: z.ZodLiteral<"isNull">;
|
|
127
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
129
|
+
path: z.ZodString;
|
|
130
|
+
op: z.ZodLiteral<"type">;
|
|
131
|
+
value: z.ZodEnum<{
|
|
132
|
+
string: "string";
|
|
133
|
+
number: "number";
|
|
134
|
+
boolean: "boolean";
|
|
135
|
+
object: "object";
|
|
136
|
+
null: "null";
|
|
137
|
+
array: "array";
|
|
138
|
+
}>;
|
|
66
139
|
}, z.core.$strip>, z.ZodObject<{
|
|
67
140
|
path: z.ZodString;
|
|
68
141
|
op: z.ZodLiteral<"gt">;
|
|
@@ -182,6 +255,29 @@ export declare const DerivedEventDefinitionSchema: z.ZodObject<{
|
|
|
182
255
|
path: z.ZodString;
|
|
183
256
|
}, z.core.$strict>>>;
|
|
184
257
|
constants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
258
|
+
measures: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
259
|
+
key: z.ZodString;
|
|
260
|
+
expression: z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodObject<{
|
|
261
|
+
kind: z.ZodLiteral<"aggregate">;
|
|
262
|
+
function: z.ZodEnum<{
|
|
263
|
+
first: "first";
|
|
264
|
+
last: "last";
|
|
265
|
+
nth: "nth";
|
|
266
|
+
sum: "sum";
|
|
267
|
+
avg: "avg";
|
|
268
|
+
min: "min";
|
|
269
|
+
max: "max";
|
|
270
|
+
count: "count";
|
|
271
|
+
countDistinct: "countDistinct";
|
|
272
|
+
stddev: "stddev";
|
|
273
|
+
percentile: "percentile";
|
|
274
|
+
}>;
|
|
275
|
+
ref: z.ZodString;
|
|
276
|
+
path: z.ZodOptional<z.ZodString>;
|
|
277
|
+
nth: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
percentile: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
}, z.core.$strict>]>;
|
|
280
|
+
}, z.core.$strict>>>;
|
|
185
281
|
}, z.core.$strict>;
|
|
186
282
|
export declare const DerivedEventEvidenceRefSchema: z.ZodObject<{
|
|
187
283
|
serverId: z.ZodNullable<z.ZodString>;
|
|
@@ -189,10 +285,14 @@ export declare const DerivedEventEvidenceRefSchema: z.ZodObject<{
|
|
|
189
285
|
sourceEventId: z.ZodString;
|
|
190
286
|
traceId: z.ZodString;
|
|
191
287
|
occurredAt: z.ZodString;
|
|
288
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
192
289
|
payloadHash: z.ZodNullable<z.ZodString>;
|
|
193
290
|
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
291
|
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
292
|
}, z.core.$strict>;
|
|
293
|
+
export declare const EventTimePolicySchema: z.ZodObject<{
|
|
294
|
+
allowedLatenessMs: z.ZodNumber;
|
|
295
|
+
}, z.core.$strict>;
|
|
196
296
|
export declare const TriggerLifecyclePolicySchema: z.ZodObject<{
|
|
197
297
|
oneShot: z.ZodDefault<z.ZodBoolean>;
|
|
198
298
|
maxFirings: z.ZodOptional<z.ZodNumber>;
|
|
@@ -244,6 +344,7 @@ export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
|
244
344
|
triggerId: z.ZodString;
|
|
245
345
|
version: z.ZodString;
|
|
246
346
|
description: z.ZodOptional<z.ZodString>;
|
|
347
|
+
conditionOnly: z.ZodDefault<z.ZodBoolean>;
|
|
247
348
|
continuation: z.ZodOptional<z.ZodObject<{
|
|
248
349
|
instruction: z.ZodString;
|
|
249
350
|
contextPolicy: z.ZodDefault<z.ZodObject<{
|
|
@@ -260,6 +361,7 @@ export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
|
260
361
|
event: z.ZodString;
|
|
261
362
|
serverId: z.ZodOptional<z.ZodString>;
|
|
262
363
|
contractVersion: z.ZodOptional<z.ZodString>;
|
|
364
|
+
arguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
263
365
|
where: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
264
366
|
path: z.ZodString;
|
|
265
367
|
op: z.ZodLiteral<"eq">;
|
|
@@ -272,14 +374,50 @@ export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
|
272
374
|
path: z.ZodString;
|
|
273
375
|
op: z.ZodLiteral<"contains">;
|
|
274
376
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
377
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
378
|
+
path: z.ZodString;
|
|
379
|
+
op: z.ZodLiteral<"startsWith">;
|
|
380
|
+
value: z.ZodString;
|
|
381
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
382
|
+
path: z.ZodString;
|
|
383
|
+
op: z.ZodLiteral<"endsWith">;
|
|
384
|
+
value: z.ZodString;
|
|
385
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
386
|
+
path: z.ZodString;
|
|
387
|
+
op: z.ZodLiteral<"regex">;
|
|
388
|
+
value: z.ZodString;
|
|
389
|
+
flags: z.ZodOptional<z.ZodString>;
|
|
275
390
|
}, z.core.$strip>, z.ZodObject<{
|
|
276
391
|
path: z.ZodString;
|
|
277
392
|
op: z.ZodLiteral<"in">;
|
|
278
393
|
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
394
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
395
|
+
path: z.ZodString;
|
|
396
|
+
op: z.ZodLiteral<"notIn">;
|
|
397
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
398
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
399
|
+
path: z.ZodString;
|
|
400
|
+
op: z.ZodLiteral<"between">;
|
|
401
|
+
value: z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>], null>;
|
|
279
402
|
}, z.core.$strip>, z.ZodObject<{
|
|
280
403
|
path: z.ZodString;
|
|
281
404
|
op: z.ZodLiteral<"exists">;
|
|
282
405
|
value: z.ZodDefault<z.ZodBoolean>;
|
|
406
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
407
|
+
path: z.ZodString;
|
|
408
|
+
op: z.ZodLiteral<"isNull">;
|
|
409
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
410
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
411
|
+
path: z.ZodString;
|
|
412
|
+
op: z.ZodLiteral<"type">;
|
|
413
|
+
value: z.ZodEnum<{
|
|
414
|
+
string: "string";
|
|
415
|
+
number: "number";
|
|
416
|
+
boolean: "boolean";
|
|
417
|
+
object: "object";
|
|
418
|
+
null: "null";
|
|
419
|
+
array: "array";
|
|
420
|
+
}>;
|
|
283
421
|
}, z.core.$strip>, z.ZodObject<{
|
|
284
422
|
path: z.ZodString;
|
|
285
423
|
op: z.ZodLiteral<"gt">;
|
|
@@ -375,6 +513,43 @@ export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
|
375
513
|
path: z.ZodString;
|
|
376
514
|
atLeast: z.ZodNumber;
|
|
377
515
|
}, z.core.$strip>], "kind">>>;
|
|
516
|
+
patternV2: z.ZodOptional<z.ZodObject<{
|
|
517
|
+
version: z.ZodDefault<z.ZodLiteral<"2">>;
|
|
518
|
+
root: z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>;
|
|
519
|
+
partitionBy: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
520
|
+
key: z.ZodString;
|
|
521
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
522
|
+
ref: z.ZodString;
|
|
523
|
+
path: z.ZodString;
|
|
524
|
+
}, z.core.$strict>>;
|
|
525
|
+
}, z.core.$strict>>>;
|
|
526
|
+
selection: z.ZodDefault<z.ZodObject<{
|
|
527
|
+
overlap: z.ZodDefault<z.ZodEnum<{
|
|
528
|
+
allow: "allow";
|
|
529
|
+
disallow: "disallow";
|
|
530
|
+
}>>;
|
|
531
|
+
afterMatch: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<{
|
|
532
|
+
skipPastLast: "skipPastLast";
|
|
533
|
+
skipToNext: "skipToNext";
|
|
534
|
+
keepAll: "keepAll";
|
|
535
|
+
}>, z.ZodObject<{
|
|
536
|
+
kind: z.ZodEnum<{
|
|
537
|
+
skipToFirst: "skipToFirst";
|
|
538
|
+
skipToLast: "skipToLast";
|
|
539
|
+
}>;
|
|
540
|
+
ref: z.ZodString;
|
|
541
|
+
}, z.core.$strict>]>>;
|
|
542
|
+
maxMatchesPerEvent: z.ZodDefault<z.ZodNumber>;
|
|
543
|
+
}, z.core.$strict>>;
|
|
544
|
+
execution: z.ZodDefault<z.ZodObject<{
|
|
545
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
546
|
+
maxSemanticEvaluations: z.ZodDefault<z.ZodNumber>;
|
|
547
|
+
maxBufferedEvents: z.ZodDefault<z.ZodNumber>;
|
|
548
|
+
}, z.core.$strict>>;
|
|
549
|
+
}, z.core.$strict>>;
|
|
550
|
+
eventTime: z.ZodOptional<z.ZodObject<{
|
|
551
|
+
allowedLatenessMs: z.ZodNumber;
|
|
552
|
+
}, z.core.$strict>>;
|
|
378
553
|
lifecycle: z.ZodDefault<z.ZodObject<{
|
|
379
554
|
oneShot: z.ZodDefault<z.ZodBoolean>;
|
|
380
555
|
maxFirings: z.ZodOptional<z.ZodNumber>;
|
|
@@ -424,6 +599,29 @@ export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
|
424
599
|
path: z.ZodString;
|
|
425
600
|
}, z.core.$strict>>>;
|
|
426
601
|
constants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
602
|
+
measures: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
603
|
+
key: z.ZodString;
|
|
604
|
+
expression: z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodObject<{
|
|
605
|
+
kind: z.ZodLiteral<"aggregate">;
|
|
606
|
+
function: z.ZodEnum<{
|
|
607
|
+
first: "first";
|
|
608
|
+
last: "last";
|
|
609
|
+
nth: "nth";
|
|
610
|
+
sum: "sum";
|
|
611
|
+
avg: "avg";
|
|
612
|
+
min: "min";
|
|
613
|
+
max: "max";
|
|
614
|
+
count: "count";
|
|
615
|
+
countDistinct: "countDistinct";
|
|
616
|
+
stddev: "stddev";
|
|
617
|
+
percentile: "percentile";
|
|
618
|
+
}>;
|
|
619
|
+
ref: z.ZodString;
|
|
620
|
+
path: z.ZodOptional<z.ZodString>;
|
|
621
|
+
nth: z.ZodOptional<z.ZodNumber>;
|
|
622
|
+
percentile: z.ZodOptional<z.ZodNumber>;
|
|
623
|
+
}, z.core.$strict>]>;
|
|
624
|
+
}, z.core.$strict>>>;
|
|
427
625
|
}, z.core.$strict>>;
|
|
428
626
|
}, z.core.$strip>;
|
|
429
627
|
export declare const CorrelatableEventSchema: z.ZodObject<{
|
|
@@ -431,8 +629,10 @@ export declare const CorrelatableEventSchema: z.ZodObject<{
|
|
|
431
629
|
sourceEventId: z.ZodString;
|
|
432
630
|
name: z.ZodString;
|
|
433
631
|
occurredAt: z.ZodString;
|
|
632
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
434
633
|
provider: z.ZodOptional<z.ZodString>;
|
|
435
634
|
serverId: z.ZodOptional<z.ZodString>;
|
|
635
|
+
subscriptionArguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
436
636
|
payloadHash: z.ZodOptional<z.ZodString>;
|
|
437
637
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
438
638
|
}, z.core.$strip>;
|
|
@@ -442,8 +642,10 @@ export declare const DerivedEventRecordSchema: z.ZodObject<{
|
|
|
442
642
|
sourceEventId: z.ZodString;
|
|
443
643
|
name: z.ZodString;
|
|
444
644
|
occurredAt: z.ZodString;
|
|
645
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
445
646
|
provider: z.ZodOptional<z.ZodString>;
|
|
446
647
|
serverId: z.ZodOptional<z.ZodString>;
|
|
648
|
+
subscriptionArguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
447
649
|
payloadHash: z.ZodOptional<z.ZodString>;
|
|
448
650
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
449
651
|
}, z.core.$strip>;
|
|
@@ -456,6 +658,7 @@ export declare const DerivedEventRecordSchema: z.ZodObject<{
|
|
|
456
658
|
sourceEventId: z.ZodString;
|
|
457
659
|
traceId: z.ZodString;
|
|
458
660
|
occurredAt: z.ZodString;
|
|
661
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
459
662
|
payloadHash: z.ZodNullable<z.ZodString>;
|
|
460
663
|
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
461
664
|
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -466,6 +669,7 @@ export declare const DerivedEventRecordSchema: z.ZodObject<{
|
|
|
466
669
|
sourceEventId: z.ZodString;
|
|
467
670
|
traceId: z.ZodString;
|
|
468
671
|
occurredAt: z.ZodString;
|
|
672
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
469
673
|
payloadHash: z.ZodNullable<z.ZodString>;
|
|
470
674
|
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
471
675
|
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -478,8 +682,10 @@ export declare const TriggerSourceEventSchema: z.ZodObject<{
|
|
|
478
682
|
sourceEventId: z.ZodString;
|
|
479
683
|
eventName: z.ZodString;
|
|
480
684
|
occurredAt: z.ZodString;
|
|
685
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
481
686
|
provider: z.ZodOptional<z.ZodString>;
|
|
482
687
|
serverId: z.ZodOptional<z.ZodString>;
|
|
688
|
+
subscriptionArguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
483
689
|
payloadHash: z.ZodOptional<z.ZodString>;
|
|
484
690
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
485
691
|
}, z.core.$strip>;
|
|
@@ -504,6 +710,32 @@ export declare const TriggerMatchStatusSchema: z.ZodEnum<{
|
|
|
504
710
|
fired: "fired";
|
|
505
711
|
expired: "expired";
|
|
506
712
|
}>;
|
|
713
|
+
export declare const PatternMatchStateSchema: z.ZodObject<{
|
|
714
|
+
version: z.ZodLiteral<"2">;
|
|
715
|
+
role: z.ZodEnum<{
|
|
716
|
+
match: "match";
|
|
717
|
+
buffer: "buffer";
|
|
718
|
+
}>;
|
|
719
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
720
|
+
maxObservedOccurredAt: z.ZodOptional<z.ZodString>;
|
|
721
|
+
semanticDecisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
722
|
+
nodeId: z.ZodString;
|
|
723
|
+
decision: z.ZodObject<{
|
|
724
|
+
evaluator: z.ZodString;
|
|
725
|
+
outcome: z.ZodEnum<{
|
|
726
|
+
match: "match";
|
|
727
|
+
reject: "reject";
|
|
728
|
+
uncertain: "uncertain";
|
|
729
|
+
}>;
|
|
730
|
+
probability: z.ZodNumber;
|
|
731
|
+
matched: z.ZodBoolean;
|
|
732
|
+
shouldEscalate: z.ZodBoolean;
|
|
733
|
+
inputFields: z.ZodArray<z.ZodString>;
|
|
734
|
+
providerEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
735
|
+
evaluatedAt: z.ZodString;
|
|
736
|
+
}, z.core.$strip>;
|
|
737
|
+
}, z.core.$strict>>>;
|
|
738
|
+
}, z.core.$strict>;
|
|
507
739
|
export declare const TriggerMatchRecordSchema: z.ZodObject<{
|
|
508
740
|
protocolVersion: z.ZodLiteral<"0.1.0">;
|
|
509
741
|
schemaVersion: z.ZodLiteral<"trigger.v0.1">;
|
|
@@ -527,8 +759,10 @@ export declare const TriggerMatchRecordSchema: z.ZodObject<{
|
|
|
527
759
|
sourceEventId: z.ZodString;
|
|
528
760
|
eventName: z.ZodString;
|
|
529
761
|
occurredAt: z.ZodString;
|
|
762
|
+
receivedAt: z.ZodOptional<z.ZodString>;
|
|
530
763
|
provider: z.ZodOptional<z.ZodString>;
|
|
531
764
|
serverId: z.ZodOptional<z.ZodString>;
|
|
765
|
+
subscriptionArguments: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
532
766
|
payloadHash: z.ZodOptional<z.ZodString>;
|
|
533
767
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
534
768
|
}, z.core.$strip>>;
|
|
@@ -546,12 +780,39 @@ export declare const TriggerMatchRecordSchema: z.ZodObject<{
|
|
|
546
780
|
providerEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
547
781
|
evaluatedAt: z.ZodString;
|
|
548
782
|
}, z.core.$strip>>;
|
|
783
|
+
patternState: z.ZodOptional<z.ZodObject<{
|
|
784
|
+
version: z.ZodLiteral<"2">;
|
|
785
|
+
role: z.ZodEnum<{
|
|
786
|
+
match: "match";
|
|
787
|
+
buffer: "buffer";
|
|
788
|
+
}>;
|
|
789
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
790
|
+
maxObservedOccurredAt: z.ZodOptional<z.ZodString>;
|
|
791
|
+
semanticDecisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
792
|
+
nodeId: z.ZodString;
|
|
793
|
+
decision: z.ZodObject<{
|
|
794
|
+
evaluator: z.ZodString;
|
|
795
|
+
outcome: z.ZodEnum<{
|
|
796
|
+
match: "match";
|
|
797
|
+
reject: "reject";
|
|
798
|
+
uncertain: "uncertain";
|
|
799
|
+
}>;
|
|
800
|
+
probability: z.ZodNumber;
|
|
801
|
+
matched: z.ZodBoolean;
|
|
802
|
+
shouldEscalate: z.ZodBoolean;
|
|
803
|
+
inputFields: z.ZodArray<z.ZodString>;
|
|
804
|
+
providerEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
805
|
+
evaluatedAt: z.ZodString;
|
|
806
|
+
}, z.core.$strip>;
|
|
807
|
+
}, z.core.$strict>>>;
|
|
808
|
+
}, z.core.$strict>>;
|
|
549
809
|
firedWakeId: z.ZodNullable<z.ZodString>;
|
|
550
810
|
derivedEventIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
551
811
|
}, z.core.$strip>;
|
|
552
812
|
export type StructuredPredicate = z.infer<typeof StructuredPredicateSchema>;
|
|
553
813
|
export type TriggerClause = z.infer<typeof TriggerClauseSchema>;
|
|
554
814
|
export type TemporalCondition = z.infer<typeof TemporalConditionSchema>;
|
|
815
|
+
export type EventTimePolicy = z.infer<typeof EventTimePolicySchema>;
|
|
555
816
|
export type TriggerLifecyclePolicy = z.infer<typeof TriggerLifecyclePolicySchema>;
|
|
556
817
|
export type ContinuationContextPolicy = z.infer<typeof ContinuationContextPolicySchema>;
|
|
557
818
|
export type ContinuationContract = z.infer<typeof ContinuationContractSchema>;
|
|
@@ -560,6 +821,7 @@ export type DerivedEventRecord = z.infer<typeof DerivedEventRecordSchema>;
|
|
|
560
821
|
export type CompositeTriggerDefinition = z.infer<typeof CompositeTriggerDefinitionSchema>;
|
|
561
822
|
export type CorrelatableEvent = z.infer<typeof CorrelatableEventSchema>;
|
|
562
823
|
export type TriggerSourceEvent = z.infer<typeof TriggerSourceEventSchema>;
|
|
824
|
+
export type PatternMatchState = z.infer<typeof PatternMatchStateSchema>;
|
|
563
825
|
export type TriggerMatchRecord = z.infer<typeof TriggerMatchRecordSchema>;
|
|
564
826
|
export type CompositeCorrelationDecision = z.infer<typeof CompositeCorrelationDecisionSchema>;
|
|
565
827
|
export declare function parseCompositeTriggerDefinition(value: unknown): CompositeTriggerDefinition;
|