mcp-event-intelligence 0.1.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 +80 -0
- package/LICENSE +201 -0
- package/README.md +298 -0
- package/SECURITY.md +42 -0
- package/bin/mcp-event-intelligence.mjs +52 -0
- package/dist/src/composite/engine.d.ts +87 -0
- package/dist/src/composite/engine.js +667 -0
- package/dist/src/composite/temporal.d.ts +32 -0
- package/dist/src/composite/temporal.js +317 -0
- package/dist/src/intelligenceProtocol/audit.d.ts +19 -0
- package/dist/src/intelligenceProtocol/audit.js +56 -0
- package/dist/src/intelligenceProtocol/canonical.d.ts +2 -0
- package/dist/src/intelligenceProtocol/canonical.js +21 -0
- package/dist/src/intelligenceProtocol/index.d.ts +12 -0
- package/dist/src/intelligenceProtocol/index.js +8 -0
- package/dist/src/intelligenceProtocol/invariants.d.ts +3 -0
- package/dist/src/intelligenceProtocol/invariants.js +36 -0
- package/dist/src/intelligenceProtocol/lifecycle.d.ts +4 -0
- package/dist/src/intelligenceProtocol/lifecycle.js +24 -0
- package/dist/src/intelligenceProtocol/mapper.d.ts +14 -0
- package/dist/src/intelligenceProtocol/mapper.js +28 -0
- package/dist/src/intelligenceProtocol/schemas.d.ts +325 -0
- package/dist/src/intelligenceProtocol/schemas.js +182 -0
- package/dist/src/intelligenceProtocol/triggerSchemas.d.ts +488 -0
- package/dist/src/intelligenceProtocol/triggerSchemas.js +379 -0
- package/dist/src/intelligenceProtocol/version.d.ts +7 -0
- package/dist/src/intelligenceProtocol/version.js +7 -0
- package/dist/src/mcpEvents/consumer.d.ts +7 -0
- package/dist/src/mcpEvents/consumer.js +14 -0
- package/dist/src/mcpEvents/server.d.ts +41 -0
- package/dist/src/mcpEvents/server.js +122 -0
- package/dist/src/protocol/types.d.ts +37 -0
- package/dist/src/protocol/types.js +1 -0
- package/dist/src/semantic/conditionEngine.d.ts +7 -0
- package/dist/src/semantic/conditionEngine.js +65 -0
- package/dist/src/semantic/types.d.ts +31 -0
- package/dist/src/semantic/types.js +1 -0
- package/dist/src/semantic/typesafeJevEvaluator.d.ts +23 -0
- package/dist/src/semantic/typesafeJevEvaluator.js +95 -0
- package/package.json +85 -0
- package/scripts/host-integration.d.mts +86 -0
- package/scripts/host-integration.mjs +216 -0
- package/scripts/lib/composite-event-consumer.mjs +172 -0
- package/scripts/lib/composite-wake-coordinator.mjs +185 -0
- package/scripts/lib/derived-contract-registry.mjs +210 -0
- package/scripts/lib/derived-event-coordinator.mjs +242 -0
- package/scripts/lib/event-processor.mjs +409 -0
- package/scripts/lib/generic-runtime-wake.mjs +76 -0
- package/scripts/lib/github-mcp-events-adapter.mjs +66 -0
- package/scripts/lib/github-webhook.mjs +88 -0
- package/scripts/lib/http-wake-deliverer.mjs +31 -0
- package/scripts/lib/local-event-intelligence-runtime.mjs +193 -0
- package/scripts/lib/mcp-events-client.mjs +519 -0
- package/scripts/lib/persistent-event-store.mjs +769 -0
- package/scripts/lib/temporal-deadline-scheduler.mjs +111 -0
- package/scripts/lib/trigger-control-plane.mjs +939 -0
- package/scripts/lib/trigger-inspector.mjs +631 -0
- package/scripts/lib/wake-signature.mjs +10 -0
- package/scripts/mcp-stdio-server.mjs +380 -0
- package/scripts/mcp-stdio.mjs +3 -0
- package/scripts/run-tests.mjs +51 -0
- package/scripts/service.mjs +756 -0
- package/server.json +68 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const COMPOSITE_TRIGGER_PROTOCOL_VERSION: "0.1.0";
|
|
3
|
+
export declare const COMPOSITE_TRIGGER_SCHEMA_VERSION: "trigger.v0.1";
|
|
4
|
+
export declare const StructuredPredicateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
op: z.ZodLiteral<"eq">;
|
|
7
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
path: z.ZodString;
|
|
10
|
+
op: z.ZodLiteral<"neq">;
|
|
11
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
path: z.ZodString;
|
|
14
|
+
op: z.ZodLiteral<"contains">;
|
|
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<"in">;
|
|
19
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
op: z.ZodLiteral<"exists">;
|
|
23
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$strip>], "op">;
|
|
25
|
+
export declare const TriggerClauseSchema: z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
event: z.ZodString;
|
|
28
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
contractVersion: z.ZodOptional<z.ZodString>;
|
|
30
|
+
where: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
op: z.ZodLiteral<"eq">;
|
|
33
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
34
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
35
|
+
path: z.ZodString;
|
|
36
|
+
op: z.ZodLiteral<"neq">;
|
|
37
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
path: z.ZodString;
|
|
40
|
+
op: z.ZodLiteral<"contains">;
|
|
41
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
path: z.ZodString;
|
|
44
|
+
op: z.ZodLiteral<"in">;
|
|
45
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
path: z.ZodString;
|
|
48
|
+
op: z.ZodLiteral<"exists">;
|
|
49
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strip>], "op">>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const CalendarTemporalConditionSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
kind: z.ZodLiteral<"calendar">;
|
|
55
|
+
ref: z.ZodString;
|
|
56
|
+
timezone: z.ZodString;
|
|
57
|
+
before: z.ZodOptional<z.ZodString>;
|
|
58
|
+
after: z.ZodOptional<z.ZodString>;
|
|
59
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
60
|
+
dates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
dateRange: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
start: z.ZodString;
|
|
63
|
+
end: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
dayOfMonth: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export declare const AbsenceTemporalConditionSchema: z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
kind: z.ZodLiteral<"absence">;
|
|
70
|
+
ref: z.ZodString;
|
|
71
|
+
afterRef: z.ZodString;
|
|
72
|
+
forMs: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
untilLocalTime: z.ZodOptional<z.ZodString>;
|
|
74
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const TemporalConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
kind: z.ZodLiteral<"calendar">;
|
|
79
|
+
ref: z.ZodString;
|
|
80
|
+
timezone: z.ZodString;
|
|
81
|
+
before: z.ZodOptional<z.ZodString>;
|
|
82
|
+
after: z.ZodOptional<z.ZodString>;
|
|
83
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
84
|
+
dates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
dateRange: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
start: z.ZodString;
|
|
87
|
+
end: z.ZodString;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
dayOfMonth: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
90
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
kind: z.ZodLiteral<"absence">;
|
|
93
|
+
ref: z.ZodString;
|
|
94
|
+
afterRef: z.ZodString;
|
|
95
|
+
forMs: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
untilLocalTime: z.ZodOptional<z.ZodString>;
|
|
97
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
kind: z.ZodLiteral<"not">;
|
|
101
|
+
ref: z.ZodString;
|
|
102
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
kind: z.ZodLiteral<"unless">;
|
|
105
|
+
ref: z.ZodString;
|
|
106
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
kind: z.ZodLiteral<"after">;
|
|
109
|
+
ref: z.ZodString;
|
|
110
|
+
afterRef: z.ZodString;
|
|
111
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
112
|
+
id: z.ZodString;
|
|
113
|
+
kind: z.ZodLiteral<"until">;
|
|
114
|
+
ref: z.ZodString;
|
|
115
|
+
beforeRef: z.ZodString;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
kind: z.ZodLiteral<"debounce">;
|
|
119
|
+
ref: z.ZodString;
|
|
120
|
+
forMs: z.ZodNumber;
|
|
121
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
kind: z.ZodLiteral<"threshold">;
|
|
124
|
+
ref: z.ZodString;
|
|
125
|
+
atLeast: z.ZodNumber;
|
|
126
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
kind: z.ZodLiteral<"rate">;
|
|
129
|
+
ref: z.ZodString;
|
|
130
|
+
atLeast: z.ZodNumber;
|
|
131
|
+
perMs: z.ZodNumber;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
kind: z.ZodLiteral<"distinct">;
|
|
135
|
+
ref: z.ZodString;
|
|
136
|
+
path: z.ZodString;
|
|
137
|
+
atLeast: z.ZodNumber;
|
|
138
|
+
}, z.core.$strip>], "kind">;
|
|
139
|
+
export declare const DerivedEventProjectionSchema: z.ZodObject<{
|
|
140
|
+
key: z.ZodString;
|
|
141
|
+
ref: z.ZodString;
|
|
142
|
+
path: z.ZodString;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
export declare const DerivedEventDefinitionSchema: z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
contractVersion: z.ZodString;
|
|
147
|
+
projections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
148
|
+
key: z.ZodString;
|
|
149
|
+
ref: z.ZodString;
|
|
150
|
+
path: z.ZodString;
|
|
151
|
+
}, z.core.$strict>>>;
|
|
152
|
+
constants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
export declare const DerivedEventEvidenceRefSchema: z.ZodObject<{
|
|
155
|
+
serverId: z.ZodNullable<z.ZodString>;
|
|
156
|
+
eventName: z.ZodString;
|
|
157
|
+
sourceEventId: z.ZodString;
|
|
158
|
+
traceId: z.ZodString;
|
|
159
|
+
occurredAt: z.ZodString;
|
|
160
|
+
payloadHash: z.ZodNullable<z.ZodString>;
|
|
161
|
+
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
162
|
+
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export declare const TriggerLifecyclePolicySchema: z.ZodObject<{
|
|
165
|
+
oneShot: z.ZodDefault<z.ZodBoolean>;
|
|
166
|
+
maxFirings: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
cooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
168
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
169
|
+
leaseUntil: z.ZodOptional<z.ZodString>;
|
|
170
|
+
completeOnGoal: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
export declare const DeterministicCorrelationSchema: z.ZodObject<{
|
|
173
|
+
kind: z.ZodLiteral<"same_value">;
|
|
174
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
175
|
+
ref: z.ZodString;
|
|
176
|
+
path: z.ZodString;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
export declare const SemanticCorrelationSchema: z.ZodObject<{
|
|
180
|
+
instruction: z.ZodString;
|
|
181
|
+
input: z.ZodArray<z.ZodString>;
|
|
182
|
+
matchThreshold: z.ZodNumber;
|
|
183
|
+
rejectThreshold: z.ZodNumber;
|
|
184
|
+
uncertain: z.ZodDefault<z.ZodEnum<{
|
|
185
|
+
escalate: "escalate";
|
|
186
|
+
reject: "reject";
|
|
187
|
+
match: "match";
|
|
188
|
+
}>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export declare const CompositeTriggerDefinitionSchema: z.ZodObject<{
|
|
191
|
+
protocolVersion: z.ZodDefault<z.ZodLiteral<"0.1.0">>;
|
|
192
|
+
schemaVersion: z.ZodDefault<z.ZodLiteral<"trigger.v0.1">>;
|
|
193
|
+
triggerId: z.ZodString;
|
|
194
|
+
version: z.ZodString;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
clauses: z.ZodArray<z.ZodObject<{
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
event: z.ZodString;
|
|
199
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
200
|
+
contractVersion: z.ZodOptional<z.ZodString>;
|
|
201
|
+
where: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
202
|
+
path: z.ZodString;
|
|
203
|
+
op: z.ZodLiteral<"eq">;
|
|
204
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
205
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
206
|
+
path: z.ZodString;
|
|
207
|
+
op: z.ZodLiteral<"neq">;
|
|
208
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
path: z.ZodString;
|
|
211
|
+
op: z.ZodLiteral<"contains">;
|
|
212
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
path: z.ZodString;
|
|
215
|
+
op: z.ZodLiteral<"in">;
|
|
216
|
+
value: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
217
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
218
|
+
path: z.ZodString;
|
|
219
|
+
op: z.ZodLiteral<"exists">;
|
|
220
|
+
value: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
+
}, z.core.$strip>], "op">>>;
|
|
222
|
+
}, z.core.$strip>>;
|
|
223
|
+
expression: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
224
|
+
kind: z.ZodLiteral<"allOf">;
|
|
225
|
+
refs: z.ZodArray<z.ZodString>;
|
|
226
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
227
|
+
kind: z.ZodLiteral<"anyOf">;
|
|
228
|
+
refs: z.ZodArray<z.ZodString>;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
kind: z.ZodLiteral<"sequence">;
|
|
231
|
+
refs: z.ZodArray<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
kind: z.ZodLiteral<"count">;
|
|
234
|
+
ref: z.ZodString;
|
|
235
|
+
atLeast: z.ZodNumber;
|
|
236
|
+
}, z.core.$strip>], "kind">;
|
|
237
|
+
temporal: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
238
|
+
id: z.ZodString;
|
|
239
|
+
kind: z.ZodLiteral<"calendar">;
|
|
240
|
+
ref: z.ZodString;
|
|
241
|
+
timezone: z.ZodString;
|
|
242
|
+
before: z.ZodOptional<z.ZodString>;
|
|
243
|
+
after: z.ZodOptional<z.ZodString>;
|
|
244
|
+
weekdays: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
245
|
+
dates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
246
|
+
dateRange: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
start: z.ZodString;
|
|
248
|
+
end: z.ZodString;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
dayOfMonth: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
251
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
kind: z.ZodLiteral<"absence">;
|
|
254
|
+
ref: z.ZodString;
|
|
255
|
+
afterRef: z.ZodString;
|
|
256
|
+
forMs: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
untilLocalTime: z.ZodOptional<z.ZodString>;
|
|
258
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
kind: z.ZodLiteral<"not">;
|
|
262
|
+
ref: z.ZodString;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
kind: z.ZodLiteral<"unless">;
|
|
266
|
+
ref: z.ZodString;
|
|
267
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
268
|
+
id: z.ZodString;
|
|
269
|
+
kind: z.ZodLiteral<"after">;
|
|
270
|
+
ref: z.ZodString;
|
|
271
|
+
afterRef: z.ZodString;
|
|
272
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
273
|
+
id: z.ZodString;
|
|
274
|
+
kind: z.ZodLiteral<"until">;
|
|
275
|
+
ref: z.ZodString;
|
|
276
|
+
beforeRef: z.ZodString;
|
|
277
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
278
|
+
id: z.ZodString;
|
|
279
|
+
kind: z.ZodLiteral<"debounce">;
|
|
280
|
+
ref: z.ZodString;
|
|
281
|
+
forMs: z.ZodNumber;
|
|
282
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
283
|
+
id: z.ZodString;
|
|
284
|
+
kind: z.ZodLiteral<"threshold">;
|
|
285
|
+
ref: z.ZodString;
|
|
286
|
+
atLeast: z.ZodNumber;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
kind: z.ZodLiteral<"rate">;
|
|
290
|
+
ref: z.ZodString;
|
|
291
|
+
atLeast: z.ZodNumber;
|
|
292
|
+
perMs: z.ZodNumber;
|
|
293
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
294
|
+
id: z.ZodString;
|
|
295
|
+
kind: z.ZodLiteral<"distinct">;
|
|
296
|
+
ref: z.ZodString;
|
|
297
|
+
path: z.ZodString;
|
|
298
|
+
atLeast: z.ZodNumber;
|
|
299
|
+
}, z.core.$strip>], "kind">>>;
|
|
300
|
+
lifecycle: z.ZodDefault<z.ZodObject<{
|
|
301
|
+
oneShot: z.ZodDefault<z.ZodBoolean>;
|
|
302
|
+
maxFirings: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
cooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
304
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
305
|
+
leaseUntil: z.ZodOptional<z.ZodString>;
|
|
306
|
+
completeOnGoal: z.ZodDefault<z.ZodBoolean>;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
withinMs: z.ZodNumber;
|
|
309
|
+
correlation: z.ZodOptional<z.ZodObject<{
|
|
310
|
+
deterministic: z.ZodOptional<z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"same_value">;
|
|
312
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
313
|
+
ref: z.ZodString;
|
|
314
|
+
path: z.ZodString;
|
|
315
|
+
}, z.core.$strip>>;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
semantic: z.ZodOptional<z.ZodObject<{
|
|
318
|
+
instruction: z.ZodString;
|
|
319
|
+
input: z.ZodArray<z.ZodString>;
|
|
320
|
+
matchThreshold: z.ZodNumber;
|
|
321
|
+
rejectThreshold: z.ZodNumber;
|
|
322
|
+
uncertain: z.ZodDefault<z.ZodEnum<{
|
|
323
|
+
escalate: "escalate";
|
|
324
|
+
reject: "reject";
|
|
325
|
+
match: "match";
|
|
326
|
+
}>>;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
}, z.core.$strip>>;
|
|
329
|
+
target: z.ZodOptional<z.ZodObject<{
|
|
330
|
+
runtime: z.ZodString;
|
|
331
|
+
kind: z.ZodEnum<{
|
|
332
|
+
goal: "goal";
|
|
333
|
+
session: "session";
|
|
334
|
+
conversation: "conversation";
|
|
335
|
+
task: "task";
|
|
336
|
+
spawn_template: "spawn_template";
|
|
337
|
+
}>;
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
}, z.core.$strip>>;
|
|
340
|
+
derivedEvent: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
name: z.ZodString;
|
|
342
|
+
contractVersion: z.ZodString;
|
|
343
|
+
projections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
344
|
+
key: z.ZodString;
|
|
345
|
+
ref: z.ZodString;
|
|
346
|
+
path: z.ZodString;
|
|
347
|
+
}, z.core.$strict>>>;
|
|
348
|
+
constants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
349
|
+
}, z.core.$strict>>;
|
|
350
|
+
}, z.core.$strip>;
|
|
351
|
+
export declare const CorrelatableEventSchema: z.ZodObject<{
|
|
352
|
+
traceId: z.ZodString;
|
|
353
|
+
sourceEventId: z.ZodString;
|
|
354
|
+
name: z.ZodString;
|
|
355
|
+
occurredAt: z.ZodString;
|
|
356
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
357
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
358
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
359
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
export declare const DerivedEventRecordSchema: z.ZodObject<{
|
|
362
|
+
event: z.ZodObject<{
|
|
363
|
+
traceId: z.ZodString;
|
|
364
|
+
sourceEventId: z.ZodString;
|
|
365
|
+
name: z.ZodString;
|
|
366
|
+
occurredAt: z.ZodString;
|
|
367
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
368
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
369
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
370
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
371
|
+
}, z.core.$strip>;
|
|
372
|
+
triggerId: z.ZodString;
|
|
373
|
+
triggerVersion: z.ZodString;
|
|
374
|
+
matchId: z.ZodString;
|
|
375
|
+
directParents: z.ZodArray<z.ZodObject<{
|
|
376
|
+
serverId: z.ZodNullable<z.ZodString>;
|
|
377
|
+
eventName: z.ZodString;
|
|
378
|
+
sourceEventId: z.ZodString;
|
|
379
|
+
traceId: z.ZodString;
|
|
380
|
+
occurredAt: z.ZodString;
|
|
381
|
+
payloadHash: z.ZodNullable<z.ZodString>;
|
|
382
|
+
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
383
|
+
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
384
|
+
}, z.core.$strict>>;
|
|
385
|
+
rootEvidence: z.ZodArray<z.ZodObject<{
|
|
386
|
+
serverId: z.ZodNullable<z.ZodString>;
|
|
387
|
+
eventName: z.ZodString;
|
|
388
|
+
sourceEventId: z.ZodString;
|
|
389
|
+
traceId: z.ZodString;
|
|
390
|
+
occurredAt: z.ZodString;
|
|
391
|
+
payloadHash: z.ZodNullable<z.ZodString>;
|
|
392
|
+
contractVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
393
|
+
schemaFingerprint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
394
|
+
}, z.core.$strict>>;
|
|
395
|
+
createdAt: z.ZodString;
|
|
396
|
+
}, z.core.$strict>;
|
|
397
|
+
export declare const TriggerSourceEventSchema: z.ZodObject<{
|
|
398
|
+
clauseId: z.ZodString;
|
|
399
|
+
traceId: z.ZodString;
|
|
400
|
+
sourceEventId: z.ZodString;
|
|
401
|
+
eventName: z.ZodString;
|
|
402
|
+
occurredAt: z.ZodString;
|
|
403
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
404
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
405
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
406
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
407
|
+
}, z.core.$strip>;
|
|
408
|
+
export declare const CompositeCorrelationDecisionSchema: z.ZodObject<{
|
|
409
|
+
evaluator: z.ZodString;
|
|
410
|
+
outcome: z.ZodEnum<{
|
|
411
|
+
reject: "reject";
|
|
412
|
+
match: "match";
|
|
413
|
+
uncertain: "uncertain";
|
|
414
|
+
}>;
|
|
415
|
+
probability: z.ZodNumber;
|
|
416
|
+
matched: z.ZodBoolean;
|
|
417
|
+
shouldEscalate: z.ZodBoolean;
|
|
418
|
+
inputFields: z.ZodArray<z.ZodString>;
|
|
419
|
+
providerEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
420
|
+
evaluatedAt: z.ZodString;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
export declare const TriggerMatchStatusSchema: z.ZodEnum<{
|
|
423
|
+
matched: "matched";
|
|
424
|
+
partial: "partial";
|
|
425
|
+
emitted: "emitted";
|
|
426
|
+
fired: "fired";
|
|
427
|
+
expired: "expired";
|
|
428
|
+
}>;
|
|
429
|
+
export declare const TriggerMatchRecordSchema: z.ZodObject<{
|
|
430
|
+
protocolVersion: z.ZodLiteral<"0.1.0">;
|
|
431
|
+
schemaVersion: z.ZodLiteral<"trigger.v0.1">;
|
|
432
|
+
matchId: z.ZodString;
|
|
433
|
+
triggerId: z.ZodString;
|
|
434
|
+
triggerVersion: z.ZodString;
|
|
435
|
+
status: z.ZodEnum<{
|
|
436
|
+
matched: "matched";
|
|
437
|
+
partial: "partial";
|
|
438
|
+
emitted: "emitted";
|
|
439
|
+
fired: "fired";
|
|
440
|
+
expired: "expired";
|
|
441
|
+
}>;
|
|
442
|
+
correlationKey: z.ZodNullable<z.ZodString>;
|
|
443
|
+
openedAt: z.ZodString;
|
|
444
|
+
expiresAt: z.ZodString;
|
|
445
|
+
updatedAt: z.ZodString;
|
|
446
|
+
sourceEvents: z.ZodArray<z.ZodObject<{
|
|
447
|
+
clauseId: z.ZodString;
|
|
448
|
+
traceId: z.ZodString;
|
|
449
|
+
sourceEventId: z.ZodString;
|
|
450
|
+
eventName: z.ZodString;
|
|
451
|
+
occurredAt: z.ZodString;
|
|
452
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
453
|
+
serverId: z.ZodOptional<z.ZodString>;
|
|
454
|
+
payloadHash: z.ZodOptional<z.ZodString>;
|
|
455
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
456
|
+
}, z.core.$strip>>;
|
|
457
|
+
correlationDecision: z.ZodNullable<z.ZodObject<{
|
|
458
|
+
evaluator: z.ZodString;
|
|
459
|
+
outcome: z.ZodEnum<{
|
|
460
|
+
reject: "reject";
|
|
461
|
+
match: "match";
|
|
462
|
+
uncertain: "uncertain";
|
|
463
|
+
}>;
|
|
464
|
+
probability: z.ZodNumber;
|
|
465
|
+
matched: z.ZodBoolean;
|
|
466
|
+
shouldEscalate: z.ZodBoolean;
|
|
467
|
+
inputFields: z.ZodArray<z.ZodString>;
|
|
468
|
+
providerEvidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
469
|
+
evaluatedAt: z.ZodString;
|
|
470
|
+
}, z.core.$strip>>;
|
|
471
|
+
firedWakeId: z.ZodNullable<z.ZodString>;
|
|
472
|
+
derivedEventIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
export type StructuredPredicate = z.infer<typeof StructuredPredicateSchema>;
|
|
475
|
+
export type TriggerClause = z.infer<typeof TriggerClauseSchema>;
|
|
476
|
+
export type TemporalCondition = z.infer<typeof TemporalConditionSchema>;
|
|
477
|
+
export type TriggerLifecyclePolicy = z.infer<typeof TriggerLifecyclePolicySchema>;
|
|
478
|
+
export type DerivedEventDefinition = z.infer<typeof DerivedEventDefinitionSchema>;
|
|
479
|
+
export type DerivedEventRecord = z.infer<typeof DerivedEventRecordSchema>;
|
|
480
|
+
export type CompositeTriggerDefinition = z.infer<typeof CompositeTriggerDefinitionSchema>;
|
|
481
|
+
export type CorrelatableEvent = z.infer<typeof CorrelatableEventSchema>;
|
|
482
|
+
export type TriggerSourceEvent = z.infer<typeof TriggerSourceEventSchema>;
|
|
483
|
+
export type TriggerMatchRecord = z.infer<typeof TriggerMatchRecordSchema>;
|
|
484
|
+
export type CompositeCorrelationDecision = z.infer<typeof CompositeCorrelationDecisionSchema>;
|
|
485
|
+
export declare function parseCompositeTriggerDefinition(value: unknown): CompositeTriggerDefinition;
|
|
486
|
+
export declare function parseCorrelatableEvent(value: unknown): CorrelatableEvent;
|
|
487
|
+
export declare function parseTriggerMatchRecord(value: unknown): TriggerMatchRecord;
|
|
488
|
+
export declare function parseDerivedEventRecord(value: unknown): DerivedEventRecord;
|