@handlebar/governance-schema 0.2.0 → 0.3.0-dev.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.
@@ -1,693 +1,12 @@
1
1
  import { z } from "zod";
2
- declare const AndConditionSchema: z.ZodObject<{
3
- kind: z.ZodLiteral<"and">;
4
- all: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
5
- kind: z.ZodLiteral<"toolName">;
6
- op: z.ZodEnum<{
7
- eq: "eq";
8
- neq: "neq";
9
- contains: "contains";
10
- startsWith: "startsWith";
11
- endsWith: "endsWith";
12
- glob: "glob";
13
- }>;
14
- value: z.ZodString;
15
- }, z.core.$strict>, z.ZodObject<{
16
- kind: z.ZodLiteral<"toolName">;
17
- op: z.ZodLiteral<"in">;
18
- value: z.ZodArray<z.ZodString>;
19
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
20
- kind: z.ZodLiteral<"toolTag">;
21
- op: z.ZodLiteral<"has">;
22
- tag: z.ZodString;
23
- }, z.core.$strict>, z.ZodObject<{
24
- kind: z.ZodLiteral<"toolTag">;
25
- op: z.ZodLiteral<"anyOf">;
26
- tags: z.ZodArray<z.ZodString>;
27
- }, z.core.$strict>, z.ZodObject<{
28
- kind: z.ZodLiteral<"toolTag">;
29
- op: z.ZodLiteral<"allOf">;
30
- tags: z.ZodArray<z.ZodString>;
31
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
32
- kind: z.ZodLiteral<"toolArg">;
33
- type: z.ZodLiteral<"string">;
34
- op: z.ZodEnum<{
35
- in: "in";
36
- eq: "eq";
37
- neq: "neq";
38
- contains: "contains";
39
- startsWith: "startsWith";
40
- endsWith: "endsWith";
41
- }>;
42
- path: z.ZodString;
43
- value: z.ZodString;
44
- }, z.core.$strip>, z.ZodObject<{
45
- kind: z.ZodLiteral<"toolArg">;
46
- type: z.ZodLiteral<"number">;
47
- op: z.ZodEnum<{
48
- gt: "gt";
49
- gte: "gte";
50
- lt: "lt";
51
- lte: "lte";
52
- eq: "eq";
53
- neq: "neq";
54
- }>;
55
- path: z.ZodString;
56
- value: z.ZodNumber;
57
- }, z.core.$strip>, z.ZodObject<{
58
- kind: z.ZodLiteral<"toolArg">;
59
- type: z.ZodLiteral<"boolean">;
60
- op: z.ZodLiteral<"eq">;
61
- path: z.ZodString;
62
- value: z.ZodBoolean;
63
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
64
- kind: z.ZodLiteral<"enduserTag">;
65
- op: z.ZodLiteral<"has">;
66
- tag: z.ZodString;
67
- }, z.core.$strict>, z.ZodObject<{
68
- kind: z.ZodLiteral<"enduserTag">;
69
- op: z.ZodLiteral<"hasValue">;
70
- tag: z.ZodString;
71
- value: z.ZodString;
72
- }, z.core.$strict>, z.ZodObject<{
73
- kind: z.ZodLiteral<"enduserTag">;
74
- op: z.ZodLiteral<"hasValueAny">;
75
- tag: z.ZodString;
76
- values: z.ZodArray<z.ZodString>;
77
- }, z.core.$strict>], "op">, z.ZodObject<{
78
- kind: z.ZodLiteral<"executionTime">;
79
- scope: z.ZodEnum<{
80
- tool: "tool";
81
- total: "total";
82
- }>;
83
- op: z.ZodEnum<{
84
- gt: "gt";
85
- gte: "gte";
86
- lt: "lt";
87
- lte: "lte";
88
- eq: "eq";
89
- neq: "neq";
90
- }>;
91
- ms: z.ZodNumber;
92
- }, z.core.$strict>, z.ZodObject<{
93
- kind: z.ZodLiteral<"sequence">;
94
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
- }, z.core.$strict>, z.ZodObject<{
97
- kind: z.ZodLiteral<"maxCalls">;
98
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
99
- by: z.ZodLiteral<"toolName">;
100
- patterns: z.ZodArray<z.ZodString>;
101
- }, z.core.$strict>, z.ZodObject<{
102
- by: z.ZodLiteral<"toolTag">;
103
- tags: z.ZodArray<z.ZodString>;
104
- }, z.core.$strict>], "by">;
105
- max: z.ZodNumber;
106
- }, z.core.$strict>, z.ZodObject<{
107
- kind: z.ZodLiteral<"custom">;
108
- name: z.ZodString;
109
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
110
- }, z.core.$strict>, z.ZodObject<{
111
- kind: z.ZodLiteral<"metricWindow">;
112
- scope: z.ZodEnum<{
113
- agent: "agent";
114
- agent_user: "agent_user";
115
- }>;
116
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
117
- kind: z.ZodLiteral<"inbuilt">;
118
- key: z.ZodEnum<{
119
- bytes_in: "bytes_in";
120
- bytes_out: "bytes_out";
121
- duration_ms: "duration_ms";
122
- records_in: "records_in";
123
- records_out: "records_out";
124
- llm_tokens_in: "llm_tokens_in";
125
- llm_tokens_out: "llm_tokens_out";
126
- llm_cost_usd: "llm_cost_usd";
127
- }>;
128
- }, z.core.$strict>, z.ZodObject<{
129
- kind: z.ZodLiteral<"custom">;
130
- key: z.ZodString;
131
- }, z.core.$strict>], "kind">;
132
- aggregate: z.ZodEnum<{
133
- sum: "sum";
134
- avg: "avg";
135
- max: "max";
136
- min: "min";
137
- count: "count";
138
- }>;
139
- windowSeconds: z.ZodNumber;
140
- filter: z.ZodOptional<z.ZodObject<{
141
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
142
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
143
- }, z.core.$strict>>;
144
- op: z.ZodEnum<{
145
- gt: "gt";
146
- gte: "gte";
147
- lt: "lt";
148
- lte: "lte";
149
- eq: "eq";
150
- neq: "neq";
151
- }>;
152
- value: z.ZodNumber;
153
- onMissing: z.ZodOptional<z.ZodEnum<{
154
- hitl: "hitl";
155
- allow: "allow";
156
- block: "block";
157
- }>>;
158
- }, z.core.$strict>, z.ZodObject<{
159
- kind: z.ZodLiteral<"timeGate">;
160
- timezone: z.ZodObject<{
161
- source: z.ZodLiteral<"enduserTag">;
162
- tag: z.ZodString;
163
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
164
- }, z.core.$strict>;
165
- windows: z.ZodArray<z.ZodObject<{
166
- days: z.ZodArray<z.ZodEnum<{
167
- mon: "mon";
168
- tue: "tue";
169
- wed: "wed";
170
- thu: "thu";
171
- fri: "fri";
172
- sat: "sat";
173
- sun: "sun";
174
- }>>;
175
- start: z.ZodString;
176
- end: z.ZodString;
177
- }, z.core.$strict>>;
178
- }, z.core.$strict>, z.ZodObject<{
179
- kind: z.ZodLiteral<"requireSubject">;
180
- subjectType: z.ZodString;
181
- idSystem: z.ZodOptional<z.ZodString>;
182
- }, z.core.$strict>, z.ZodObject<{
183
- kind: z.ZodLiteral<"signal">;
184
- key: z.ZodString;
185
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
186
- from: z.ZodLiteral<"enduserId">;
187
- }, z.core.$strict>, z.ZodObject<{
188
- from: z.ZodLiteral<"enduserTag">;
189
- tag: z.ZodString;
190
- }, z.core.$strict>, z.ZodObject<{
191
- from: z.ZodLiteral<"toolName">;
192
- }, z.core.$strict>, z.ZodObject<{
193
- from: z.ZodLiteral<"toolTag">;
194
- tag: z.ZodString;
195
- }, z.core.$strict>, z.ZodObject<{
196
- from: z.ZodLiteral<"toolArg">;
197
- path: z.ZodString;
198
- }, z.core.$strict>, z.ZodObject<{
199
- from: z.ZodLiteral<"subject">;
200
- subjectType: z.ZodString;
201
- role: z.ZodOptional<z.ZodString>;
202
- field: z.ZodOptional<z.ZodEnum<{
203
- idSystem: "idSystem";
204
- id: "id";
205
- }>>;
206
- }, z.core.$strict>, z.ZodObject<{
207
- from: z.ZodLiteral<"const">;
208
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
209
- }, z.core.$strict>], "from">>;
210
- op: z.ZodEnum<{
211
- in: "in";
212
- gt: "gt";
213
- gte: "gte";
214
- lt: "lt";
215
- lte: "lte";
216
- eq: "eq";
217
- neq: "neq";
218
- nin: "nin";
219
- }>;
220
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
221
- onMissing: z.ZodOptional<z.ZodEnum<{
222
- hitl: "hitl";
223
- allow: "allow";
224
- block: "block";
225
- }>>;
226
- }, z.core.$strict>]>>;
227
- }, z.core.$strict>;
228
- declare const OrConditionSchema: z.ZodObject<{
229
- kind: z.ZodLiteral<"or">;
230
- any: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
231
- kind: z.ZodLiteral<"toolName">;
232
- op: z.ZodEnum<{
233
- eq: "eq";
234
- neq: "neq";
235
- contains: "contains";
236
- startsWith: "startsWith";
237
- endsWith: "endsWith";
238
- glob: "glob";
239
- }>;
240
- value: z.ZodString;
241
- }, z.core.$strict>, z.ZodObject<{
242
- kind: z.ZodLiteral<"toolName">;
243
- op: z.ZodLiteral<"in">;
244
- value: z.ZodArray<z.ZodString>;
245
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
246
- kind: z.ZodLiteral<"toolTag">;
247
- op: z.ZodLiteral<"has">;
248
- tag: z.ZodString;
249
- }, z.core.$strict>, z.ZodObject<{
250
- kind: z.ZodLiteral<"toolTag">;
251
- op: z.ZodLiteral<"anyOf">;
252
- tags: z.ZodArray<z.ZodString>;
253
- }, z.core.$strict>, z.ZodObject<{
254
- kind: z.ZodLiteral<"toolTag">;
255
- op: z.ZodLiteral<"allOf">;
256
- tags: z.ZodArray<z.ZodString>;
257
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
258
- kind: z.ZodLiteral<"toolArg">;
259
- type: z.ZodLiteral<"string">;
260
- op: z.ZodEnum<{
261
- in: "in";
262
- eq: "eq";
263
- neq: "neq";
264
- contains: "contains";
265
- startsWith: "startsWith";
266
- endsWith: "endsWith";
267
- }>;
268
- path: z.ZodString;
269
- value: z.ZodString;
270
- }, z.core.$strip>, z.ZodObject<{
271
- kind: z.ZodLiteral<"toolArg">;
272
- type: z.ZodLiteral<"number">;
273
- op: z.ZodEnum<{
274
- gt: "gt";
275
- gte: "gte";
276
- lt: "lt";
277
- lte: "lte";
278
- eq: "eq";
279
- neq: "neq";
280
- }>;
281
- path: z.ZodString;
282
- value: z.ZodNumber;
283
- }, z.core.$strip>, z.ZodObject<{
284
- kind: z.ZodLiteral<"toolArg">;
285
- type: z.ZodLiteral<"boolean">;
286
- op: z.ZodLiteral<"eq">;
287
- path: z.ZodString;
288
- value: z.ZodBoolean;
289
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
290
- kind: z.ZodLiteral<"enduserTag">;
291
- op: z.ZodLiteral<"has">;
292
- tag: z.ZodString;
293
- }, z.core.$strict>, z.ZodObject<{
294
- kind: z.ZodLiteral<"enduserTag">;
295
- op: z.ZodLiteral<"hasValue">;
296
- tag: z.ZodString;
297
- value: z.ZodString;
298
- }, z.core.$strict>, z.ZodObject<{
299
- kind: z.ZodLiteral<"enduserTag">;
300
- op: z.ZodLiteral<"hasValueAny">;
301
- tag: z.ZodString;
302
- values: z.ZodArray<z.ZodString>;
303
- }, z.core.$strict>], "op">, z.ZodObject<{
304
- kind: z.ZodLiteral<"executionTime">;
305
- scope: z.ZodEnum<{
306
- tool: "tool";
307
- total: "total";
308
- }>;
309
- op: z.ZodEnum<{
310
- gt: "gt";
311
- gte: "gte";
312
- lt: "lt";
313
- lte: "lte";
314
- eq: "eq";
315
- neq: "neq";
316
- }>;
317
- ms: z.ZodNumber;
318
- }, z.core.$strict>, z.ZodObject<{
319
- kind: z.ZodLiteral<"sequence">;
320
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
321
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
322
- }, z.core.$strict>, z.ZodObject<{
323
- kind: z.ZodLiteral<"maxCalls">;
324
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
325
- by: z.ZodLiteral<"toolName">;
326
- patterns: z.ZodArray<z.ZodString>;
327
- }, z.core.$strict>, z.ZodObject<{
328
- by: z.ZodLiteral<"toolTag">;
329
- tags: z.ZodArray<z.ZodString>;
330
- }, z.core.$strict>], "by">;
331
- max: z.ZodNumber;
332
- }, z.core.$strict>, z.ZodObject<{
333
- kind: z.ZodLiteral<"custom">;
334
- name: z.ZodString;
335
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
336
- }, z.core.$strict>, z.ZodObject<{
337
- kind: z.ZodLiteral<"metricWindow">;
338
- scope: z.ZodEnum<{
339
- agent: "agent";
340
- agent_user: "agent_user";
341
- }>;
342
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
343
- kind: z.ZodLiteral<"inbuilt">;
344
- key: z.ZodEnum<{
345
- bytes_in: "bytes_in";
346
- bytes_out: "bytes_out";
347
- duration_ms: "duration_ms";
348
- records_in: "records_in";
349
- records_out: "records_out";
350
- llm_tokens_in: "llm_tokens_in";
351
- llm_tokens_out: "llm_tokens_out";
352
- llm_cost_usd: "llm_cost_usd";
353
- }>;
354
- }, z.core.$strict>, z.ZodObject<{
355
- kind: z.ZodLiteral<"custom">;
356
- key: z.ZodString;
357
- }, z.core.$strict>], "kind">;
358
- aggregate: z.ZodEnum<{
359
- sum: "sum";
360
- avg: "avg";
361
- max: "max";
362
- min: "min";
363
- count: "count";
364
- }>;
365
- windowSeconds: z.ZodNumber;
366
- filter: z.ZodOptional<z.ZodObject<{
367
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
368
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
369
- }, z.core.$strict>>;
370
- op: z.ZodEnum<{
371
- gt: "gt";
372
- gte: "gte";
373
- lt: "lt";
374
- lte: "lte";
375
- eq: "eq";
376
- neq: "neq";
377
- }>;
378
- value: z.ZodNumber;
379
- onMissing: z.ZodOptional<z.ZodEnum<{
380
- hitl: "hitl";
381
- allow: "allow";
382
- block: "block";
383
- }>>;
384
- }, z.core.$strict>, z.ZodObject<{
385
- kind: z.ZodLiteral<"timeGate">;
386
- timezone: z.ZodObject<{
387
- source: z.ZodLiteral<"enduserTag">;
388
- tag: z.ZodString;
389
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
390
- }, z.core.$strict>;
391
- windows: z.ZodArray<z.ZodObject<{
392
- days: z.ZodArray<z.ZodEnum<{
393
- mon: "mon";
394
- tue: "tue";
395
- wed: "wed";
396
- thu: "thu";
397
- fri: "fri";
398
- sat: "sat";
399
- sun: "sun";
400
- }>>;
401
- start: z.ZodString;
402
- end: z.ZodString;
403
- }, z.core.$strict>>;
404
- }, z.core.$strict>, z.ZodObject<{
405
- kind: z.ZodLiteral<"requireSubject">;
406
- subjectType: z.ZodString;
407
- idSystem: z.ZodOptional<z.ZodString>;
408
- }, z.core.$strict>, z.ZodObject<{
409
- kind: z.ZodLiteral<"signal">;
410
- key: z.ZodString;
411
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
412
- from: z.ZodLiteral<"enduserId">;
413
- }, z.core.$strict>, z.ZodObject<{
414
- from: z.ZodLiteral<"enduserTag">;
415
- tag: z.ZodString;
416
- }, z.core.$strict>, z.ZodObject<{
417
- from: z.ZodLiteral<"toolName">;
418
- }, z.core.$strict>, z.ZodObject<{
419
- from: z.ZodLiteral<"toolTag">;
420
- tag: z.ZodString;
421
- }, z.core.$strict>, z.ZodObject<{
422
- from: z.ZodLiteral<"toolArg">;
423
- path: z.ZodString;
424
- }, z.core.$strict>, z.ZodObject<{
425
- from: z.ZodLiteral<"subject">;
426
- subjectType: z.ZodString;
427
- role: z.ZodOptional<z.ZodString>;
428
- field: z.ZodOptional<z.ZodEnum<{
429
- idSystem: "idSystem";
430
- id: "id";
431
- }>>;
432
- }, z.core.$strict>, z.ZodObject<{
433
- from: z.ZodLiteral<"const">;
434
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
435
- }, z.core.$strict>], "from">>;
436
- op: z.ZodEnum<{
437
- in: "in";
438
- gt: "gt";
439
- gte: "gte";
440
- lt: "lt";
441
- lte: "lte";
442
- eq: "eq";
443
- neq: "neq";
444
- nin: "nin";
445
- }>;
446
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
447
- onMissing: z.ZodOptional<z.ZodEnum<{
448
- hitl: "hitl";
449
- allow: "allow";
450
- block: "block";
451
- }>>;
452
- }, z.core.$strict>]>>;
453
- }, z.core.$strict>;
454
- declare const NotConditionSchema: z.ZodObject<{
455
- kind: z.ZodLiteral<"not">;
456
- not: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
457
- kind: z.ZodLiteral<"toolName">;
458
- op: z.ZodEnum<{
459
- eq: "eq";
460
- neq: "neq";
461
- contains: "contains";
462
- startsWith: "startsWith";
463
- endsWith: "endsWith";
464
- glob: "glob";
465
- }>;
466
- value: z.ZodString;
467
- }, z.core.$strict>, z.ZodObject<{
468
- kind: z.ZodLiteral<"toolName">;
469
- op: z.ZodLiteral<"in">;
470
- value: z.ZodArray<z.ZodString>;
471
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
472
- kind: z.ZodLiteral<"toolTag">;
473
- op: z.ZodLiteral<"has">;
474
- tag: z.ZodString;
475
- }, z.core.$strict>, z.ZodObject<{
476
- kind: z.ZodLiteral<"toolTag">;
477
- op: z.ZodLiteral<"anyOf">;
478
- tags: z.ZodArray<z.ZodString>;
479
- }, z.core.$strict>, z.ZodObject<{
480
- kind: z.ZodLiteral<"toolTag">;
481
- op: z.ZodLiteral<"allOf">;
482
- tags: z.ZodArray<z.ZodString>;
483
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
484
- kind: z.ZodLiteral<"toolArg">;
485
- type: z.ZodLiteral<"string">;
486
- op: z.ZodEnum<{
487
- in: "in";
488
- eq: "eq";
489
- neq: "neq";
490
- contains: "contains";
491
- startsWith: "startsWith";
492
- endsWith: "endsWith";
493
- }>;
494
- path: z.ZodString;
495
- value: z.ZodString;
496
- }, z.core.$strip>, z.ZodObject<{
497
- kind: z.ZodLiteral<"toolArg">;
498
- type: z.ZodLiteral<"number">;
499
- op: z.ZodEnum<{
500
- gt: "gt";
501
- gte: "gte";
502
- lt: "lt";
503
- lte: "lte";
504
- eq: "eq";
505
- neq: "neq";
506
- }>;
507
- path: z.ZodString;
508
- value: z.ZodNumber;
509
- }, z.core.$strip>, z.ZodObject<{
510
- kind: z.ZodLiteral<"toolArg">;
511
- type: z.ZodLiteral<"boolean">;
512
- op: z.ZodLiteral<"eq">;
513
- path: z.ZodString;
514
- value: z.ZodBoolean;
515
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
516
- kind: z.ZodLiteral<"enduserTag">;
517
- op: z.ZodLiteral<"has">;
518
- tag: z.ZodString;
519
- }, z.core.$strict>, z.ZodObject<{
520
- kind: z.ZodLiteral<"enduserTag">;
521
- op: z.ZodLiteral<"hasValue">;
522
- tag: z.ZodString;
523
- value: z.ZodString;
524
- }, z.core.$strict>, z.ZodObject<{
525
- kind: z.ZodLiteral<"enduserTag">;
526
- op: z.ZodLiteral<"hasValueAny">;
527
- tag: z.ZodString;
528
- values: z.ZodArray<z.ZodString>;
529
- }, z.core.$strict>], "op">, z.ZodObject<{
530
- kind: z.ZodLiteral<"executionTime">;
531
- scope: z.ZodEnum<{
532
- tool: "tool";
533
- total: "total";
534
- }>;
535
- op: z.ZodEnum<{
536
- gt: "gt";
537
- gte: "gte";
538
- lt: "lt";
539
- lte: "lte";
540
- eq: "eq";
541
- neq: "neq";
542
- }>;
543
- ms: z.ZodNumber;
544
- }, z.core.$strict>, z.ZodObject<{
545
- kind: z.ZodLiteral<"sequence">;
546
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
547
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
548
- }, z.core.$strict>, z.ZodObject<{
549
- kind: z.ZodLiteral<"maxCalls">;
550
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
551
- by: z.ZodLiteral<"toolName">;
552
- patterns: z.ZodArray<z.ZodString>;
553
- }, z.core.$strict>, z.ZodObject<{
554
- by: z.ZodLiteral<"toolTag">;
555
- tags: z.ZodArray<z.ZodString>;
556
- }, z.core.$strict>], "by">;
557
- max: z.ZodNumber;
558
- }, z.core.$strict>, z.ZodObject<{
559
- kind: z.ZodLiteral<"custom">;
560
- name: z.ZodString;
561
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
562
- }, z.core.$strict>, z.ZodObject<{
563
- kind: z.ZodLiteral<"metricWindow">;
564
- scope: z.ZodEnum<{
565
- agent: "agent";
566
- agent_user: "agent_user";
567
- }>;
568
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
569
- kind: z.ZodLiteral<"inbuilt">;
570
- key: z.ZodEnum<{
571
- bytes_in: "bytes_in";
572
- bytes_out: "bytes_out";
573
- duration_ms: "duration_ms";
574
- records_in: "records_in";
575
- records_out: "records_out";
576
- llm_tokens_in: "llm_tokens_in";
577
- llm_tokens_out: "llm_tokens_out";
578
- llm_cost_usd: "llm_cost_usd";
579
- }>;
580
- }, z.core.$strict>, z.ZodObject<{
581
- kind: z.ZodLiteral<"custom">;
582
- key: z.ZodString;
583
- }, z.core.$strict>], "kind">;
584
- aggregate: z.ZodEnum<{
585
- sum: "sum";
586
- avg: "avg";
587
- max: "max";
588
- min: "min";
589
- count: "count";
590
- }>;
591
- windowSeconds: z.ZodNumber;
592
- filter: z.ZodOptional<z.ZodObject<{
593
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
594
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
595
- }, z.core.$strict>>;
596
- op: z.ZodEnum<{
597
- gt: "gt";
598
- gte: "gte";
599
- lt: "lt";
600
- lte: "lte";
601
- eq: "eq";
602
- neq: "neq";
603
- }>;
604
- value: z.ZodNumber;
605
- onMissing: z.ZodOptional<z.ZodEnum<{
606
- hitl: "hitl";
607
- allow: "allow";
608
- block: "block";
609
- }>>;
610
- }, z.core.$strict>, z.ZodObject<{
611
- kind: z.ZodLiteral<"timeGate">;
612
- timezone: z.ZodObject<{
613
- source: z.ZodLiteral<"enduserTag">;
614
- tag: z.ZodString;
615
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
616
- }, z.core.$strict>;
617
- windows: z.ZodArray<z.ZodObject<{
618
- days: z.ZodArray<z.ZodEnum<{
619
- mon: "mon";
620
- tue: "tue";
621
- wed: "wed";
622
- thu: "thu";
623
- fri: "fri";
624
- sat: "sat";
625
- sun: "sun";
626
- }>>;
627
- start: z.ZodString;
628
- end: z.ZodString;
629
- }, z.core.$strict>>;
630
- }, z.core.$strict>, z.ZodObject<{
631
- kind: z.ZodLiteral<"requireSubject">;
632
- subjectType: z.ZodString;
633
- idSystem: z.ZodOptional<z.ZodString>;
634
- }, z.core.$strict>, z.ZodObject<{
635
- kind: z.ZodLiteral<"signal">;
636
- key: z.ZodString;
637
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
638
- from: z.ZodLiteral<"enduserId">;
639
- }, z.core.$strict>, z.ZodObject<{
640
- from: z.ZodLiteral<"enduserTag">;
641
- tag: z.ZodString;
642
- }, z.core.$strict>, z.ZodObject<{
643
- from: z.ZodLiteral<"toolName">;
644
- }, z.core.$strict>, z.ZodObject<{
645
- from: z.ZodLiteral<"toolTag">;
646
- tag: z.ZodString;
647
- }, z.core.$strict>, z.ZodObject<{
648
- from: z.ZodLiteral<"toolArg">;
649
- path: z.ZodString;
650
- }, z.core.$strict>, z.ZodObject<{
651
- from: z.ZodLiteral<"subject">;
652
- subjectType: z.ZodString;
653
- role: z.ZodOptional<z.ZodString>;
654
- field: z.ZodOptional<z.ZodEnum<{
655
- idSystem: "idSystem";
656
- id: "id";
657
- }>>;
658
- }, z.core.$strict>, z.ZodObject<{
659
- from: z.ZodLiteral<"const">;
660
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
661
- }, z.core.$strict>], "from">>;
662
- op: z.ZodEnum<{
663
- in: "in";
664
- gt: "gt";
665
- gte: "gte";
666
- lt: "lt";
667
- lte: "lte";
668
- eq: "eq";
669
- neq: "neq";
670
- nin: "nin";
671
- }>;
672
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
673
- onMissing: z.ZodOptional<z.ZodEnum<{
674
- hitl: "hitl";
675
- allow: "allow";
676
- block: "block";
677
- }>>;
678
- }, z.core.$strict>]>;
679
- }, z.core.$strict>;
680
- export type AndCondition = z.infer<typeof AndConditionSchema>;
681
- export type OrCondition = z.infer<typeof OrConditionSchema>;
682
- export type NotCondition = z.infer<typeof NotConditionSchema>;
683
- export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
2
+ declare const BaseRuleConditionSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
684
3
  kind: z.ZodLiteral<"toolName">;
685
4
  op: z.ZodEnum<{
686
5
  eq: "eq";
687
6
  neq: "neq";
7
+ endsWith: "endsWith";
688
8
  contains: "contains";
689
9
  startsWith: "startsWith";
690
- endsWith: "endsWith";
691
10
  glob: "glob";
692
11
  }>;
693
12
  value: z.ZodString;
@@ -707,18 +26,19 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
707
26
  kind: z.ZodLiteral<"toolTag">;
708
27
  op: z.ZodLiteral<"allOf">;
709
28
  tags: z.ZodArray<z.ZodString>;
710
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
29
+ }, z.core.$strict>], "op">, z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
711
30
  kind: z.ZodLiteral<"toolArg">;
712
31
  type: z.ZodLiteral<"string">;
713
32
  op: z.ZodEnum<{
714
33
  in: "in";
715
34
  eq: "eq";
716
35
  neq: "neq";
36
+ endsWith: "endsWith";
717
37
  contains: "contains";
718
38
  startsWith: "startsWith";
719
- endsWith: "endsWith";
39
+ regex: "regex";
720
40
  }>;
721
- path: z.ZodString;
41
+ path: z.ZodOptional<z.ZodString>;
722
42
  value: z.ZodString;
723
43
  }, z.core.$strip>, z.ZodObject<{
724
44
  kind: z.ZodLiteral<"toolArg">;
@@ -731,15 +51,22 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
731
51
  eq: "eq";
732
52
  neq: "neq";
733
53
  }>;
734
- path: z.ZodString;
54
+ path: z.ZodOptional<z.ZodString>;
735
55
  value: z.ZodNumber;
736
56
  }, z.core.$strip>, z.ZodObject<{
737
57
  kind: z.ZodLiteral<"toolArg">;
738
58
  type: z.ZodLiteral<"boolean">;
739
59
  op: z.ZodLiteral<"eq">;
740
- path: z.ZodString;
60
+ path: z.ZodOptional<z.ZodString>;
741
61
  value: z.ZodBoolean;
742
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
62
+ }, z.core.$strip>], "type">, z.ZodObject<{
63
+ kind: z.ZodLiteral<"toolArg">;
64
+ op: z.ZodEnum<{
65
+ exists: "exists";
66
+ notExists: "notExists";
67
+ }>;
68
+ path: z.ZodString;
69
+ }, z.core.$strict>]>, z.ZodDiscriminatedUnion<[z.ZodObject<{
743
70
  kind: z.ZodLiteral<"enduserTag">;
744
71
  op: z.ZodLiteral<"has">;
745
72
  tag: z.ZodString;
@@ -770,8 +97,28 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
770
97
  ms: z.ZodNumber;
771
98
  }, z.core.$strict>, z.ZodObject<{
772
99
  kind: z.ZodLiteral<"sequence">;
773
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
774
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
101
+ by: z.ZodLiteral<"toolName">;
102
+ patterns: z.ZodArray<z.ZodString>;
103
+ }, z.core.$strict>, z.ZodObject<{
104
+ by: z.ZodLiteral<"toolTag">;
105
+ tags: z.ZodArray<z.ZodString>;
106
+ op: z.ZodOptional<z.ZodEnum<{
107
+ anyOf: "anyOf";
108
+ allOf: "allOf";
109
+ }>>;
110
+ }, z.core.$strict>]>>>;
111
+ mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
112
+ by: z.ZodLiteral<"toolName">;
113
+ patterns: z.ZodArray<z.ZodString>;
114
+ }, z.core.$strict>, z.ZodObject<{
115
+ by: z.ZodLiteral<"toolTag">;
116
+ tags: z.ZodArray<z.ZodString>;
117
+ op: z.ZodOptional<z.ZodEnum<{
118
+ anyOf: "anyOf";
119
+ allOf: "allOf";
120
+ }>>;
121
+ }, z.core.$strict>]>>>;
775
122
  }, z.core.$strict>, z.ZodObject<{
776
123
  kind: z.ZodLiteral<"maxCalls">;
777
124
  selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -782,6 +129,12 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
782
129
  tags: z.ZodArray<z.ZodString>;
783
130
  }, z.core.$strict>], "by">;
784
131
  max: z.ZodNumber;
132
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
133
+ per: z.ZodOptional<z.ZodEnum<{
134
+ agent: "agent";
135
+ agent_user: "agent_user";
136
+ }>>;
137
+ tagFilter: z.ZodOptional<z.ZodArray<z.ZodString>>;
785
138
  }, z.core.$strict>, z.ZodObject<{
786
139
  kind: z.ZodLiteral<"custom">;
787
140
  name: z.ZodString;
@@ -790,6 +143,7 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
790
143
  kind: z.ZodLiteral<"metricWindow">;
791
144
  scope: z.ZodEnum<{
792
145
  agent: "agent";
146
+ run: "run";
793
147
  agent_user: "agent_user";
794
148
  }>;
795
149
  metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -815,7 +169,7 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
815
169
  min: "min";
816
170
  count: "count";
817
171
  }>;
818
- windowSeconds: z.ZodNumber;
172
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
819
173
  filter: z.ZodOptional<z.ZodObject<{
820
174
  toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
821
175
  toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
@@ -836,11 +190,14 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
836
190
  }>>;
837
191
  }, z.core.$strict>, z.ZodObject<{
838
192
  kind: z.ZodLiteral<"timeGate">;
839
- timezone: z.ZodObject<{
193
+ timezone: z.ZodDiscriminatedUnion<[z.ZodObject<{
840
194
  source: z.ZodLiteral<"enduserTag">;
841
195
  tag: z.ZodString;
842
196
  fallback: z.ZodOptional<z.ZodLiteral<"org">>;
843
- }, z.core.$strict>;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ source: z.ZodLiteral<"static">;
199
+ tz: z.ZodString;
200
+ }, z.core.$strict>], "source">;
844
201
  windows: z.ZodArray<z.ZodObject<{
845
202
  days: z.ZodArray<z.ZodEnum<{
846
203
  mon: "mon";
@@ -902,681 +259,78 @@ export declare const RuleConditionSchema: z.ZodUnion<readonly [z.ZodUnion<readon
902
259
  allow: "allow";
903
260
  block: "block";
904
261
  }>>;
905
- }, z.core.$strict>]>, z.ZodObject<{
906
- kind: z.ZodLiteral<"and">;
907
- all: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
908
- kind: z.ZodLiteral<"toolName">;
909
- op: z.ZodEnum<{
910
- eq: "eq";
911
- neq: "neq";
912
- contains: "contains";
913
- startsWith: "startsWith";
914
- endsWith: "endsWith";
915
- glob: "glob";
916
- }>;
917
- value: z.ZodString;
918
- }, z.core.$strict>, z.ZodObject<{
919
- kind: z.ZodLiteral<"toolName">;
920
- op: z.ZodLiteral<"in">;
921
- value: z.ZodArray<z.ZodString>;
922
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
923
- kind: z.ZodLiteral<"toolTag">;
924
- op: z.ZodLiteral<"has">;
925
- tag: z.ZodString;
926
- }, z.core.$strict>, z.ZodObject<{
927
- kind: z.ZodLiteral<"toolTag">;
928
- op: z.ZodLiteral<"anyOf">;
929
- tags: z.ZodArray<z.ZodString>;
930
- }, z.core.$strict>, z.ZodObject<{
931
- kind: z.ZodLiteral<"toolTag">;
932
- op: z.ZodLiteral<"allOf">;
933
- tags: z.ZodArray<z.ZodString>;
934
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
935
- kind: z.ZodLiteral<"toolArg">;
936
- type: z.ZodLiteral<"string">;
937
- op: z.ZodEnum<{
938
- in: "in";
939
- eq: "eq";
940
- neq: "neq";
941
- contains: "contains";
942
- startsWith: "startsWith";
943
- endsWith: "endsWith";
944
- }>;
945
- path: z.ZodString;
946
- value: z.ZodString;
947
- }, z.core.$strip>, z.ZodObject<{
948
- kind: z.ZodLiteral<"toolArg">;
949
- type: z.ZodLiteral<"number">;
950
- op: z.ZodEnum<{
951
- gt: "gt";
952
- gte: "gte";
953
- lt: "lt";
954
- lte: "lte";
955
- eq: "eq";
956
- neq: "neq";
957
- }>;
958
- path: z.ZodString;
959
- value: z.ZodNumber;
960
- }, z.core.$strip>, z.ZodObject<{
961
- kind: z.ZodLiteral<"toolArg">;
962
- type: z.ZodLiteral<"boolean">;
963
- op: z.ZodLiteral<"eq">;
964
- path: z.ZodString;
965
- value: z.ZodBoolean;
966
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
967
- kind: z.ZodLiteral<"enduserTag">;
968
- op: z.ZodLiteral<"has">;
969
- tag: z.ZodString;
970
- }, z.core.$strict>, z.ZodObject<{
971
- kind: z.ZodLiteral<"enduserTag">;
972
- op: z.ZodLiteral<"hasValue">;
973
- tag: z.ZodString;
974
- value: z.ZodString;
975
- }, z.core.$strict>, z.ZodObject<{
976
- kind: z.ZodLiteral<"enduserTag">;
977
- op: z.ZodLiteral<"hasValueAny">;
978
- tag: z.ZodString;
979
- values: z.ZodArray<z.ZodString>;
980
- }, z.core.$strict>], "op">, z.ZodObject<{
981
- kind: z.ZodLiteral<"executionTime">;
982
- scope: z.ZodEnum<{
983
- tool: "tool";
984
- total: "total";
985
- }>;
986
- op: z.ZodEnum<{
987
- gt: "gt";
988
- gte: "gte";
989
- lt: "lt";
990
- lte: "lte";
991
- eq: "eq";
992
- neq: "neq";
993
- }>;
994
- ms: z.ZodNumber;
995
- }, z.core.$strict>, z.ZodObject<{
996
- kind: z.ZodLiteral<"sequence">;
997
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
998
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
999
- }, z.core.$strict>, z.ZodObject<{
1000
- kind: z.ZodLiteral<"maxCalls">;
1001
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
1002
- by: z.ZodLiteral<"toolName">;
1003
- patterns: z.ZodArray<z.ZodString>;
1004
- }, z.core.$strict>, z.ZodObject<{
1005
- by: z.ZodLiteral<"toolTag">;
1006
- tags: z.ZodArray<z.ZodString>;
1007
- }, z.core.$strict>], "by">;
1008
- max: z.ZodNumber;
1009
- }, z.core.$strict>, z.ZodObject<{
1010
- kind: z.ZodLiteral<"custom">;
1011
- name: z.ZodString;
1012
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
1013
- }, z.core.$strict>, z.ZodObject<{
1014
- kind: z.ZodLiteral<"metricWindow">;
1015
- scope: z.ZodEnum<{
1016
- agent: "agent";
1017
- agent_user: "agent_user";
1018
- }>;
1019
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
1020
- kind: z.ZodLiteral<"inbuilt">;
1021
- key: z.ZodEnum<{
1022
- bytes_in: "bytes_in";
1023
- bytes_out: "bytes_out";
1024
- duration_ms: "duration_ms";
1025
- records_in: "records_in";
1026
- records_out: "records_out";
1027
- llm_tokens_in: "llm_tokens_in";
1028
- llm_tokens_out: "llm_tokens_out";
1029
- llm_cost_usd: "llm_cost_usd";
1030
- }>;
1031
- }, z.core.$strict>, z.ZodObject<{
1032
- kind: z.ZodLiteral<"custom">;
1033
- key: z.ZodString;
1034
- }, z.core.$strict>], "kind">;
1035
- aggregate: z.ZodEnum<{
1036
- sum: "sum";
1037
- avg: "avg";
1038
- max: "max";
1039
- min: "min";
1040
- count: "count";
1041
- }>;
1042
- windowSeconds: z.ZodNumber;
1043
- filter: z.ZodOptional<z.ZodObject<{
1044
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1045
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1046
- }, z.core.$strict>>;
1047
- op: z.ZodEnum<{
1048
- gt: "gt";
1049
- gte: "gte";
1050
- lt: "lt";
1051
- lte: "lte";
1052
- eq: "eq";
1053
- neq: "neq";
1054
- }>;
1055
- value: z.ZodNumber;
1056
- onMissing: z.ZodOptional<z.ZodEnum<{
1057
- hitl: "hitl";
1058
- allow: "allow";
1059
- block: "block";
1060
- }>>;
1061
- }, z.core.$strict>, z.ZodObject<{
1062
- kind: z.ZodLiteral<"timeGate">;
1063
- timezone: z.ZodObject<{
1064
- source: z.ZodLiteral<"enduserTag">;
1065
- tag: z.ZodString;
1066
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
1067
- }, z.core.$strict>;
1068
- windows: z.ZodArray<z.ZodObject<{
1069
- days: z.ZodArray<z.ZodEnum<{
1070
- mon: "mon";
1071
- tue: "tue";
1072
- wed: "wed";
1073
- thu: "thu";
1074
- fri: "fri";
1075
- sat: "sat";
1076
- sun: "sun";
1077
- }>>;
1078
- start: z.ZodString;
1079
- end: z.ZodString;
1080
- }, z.core.$strict>>;
1081
- }, z.core.$strict>, z.ZodObject<{
1082
- kind: z.ZodLiteral<"requireSubject">;
1083
- subjectType: z.ZodString;
1084
- idSystem: z.ZodOptional<z.ZodString>;
1085
- }, z.core.$strict>, z.ZodObject<{
1086
- kind: z.ZodLiteral<"signal">;
1087
- key: z.ZodString;
1088
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1089
- from: z.ZodLiteral<"enduserId">;
1090
- }, z.core.$strict>, z.ZodObject<{
1091
- from: z.ZodLiteral<"enduserTag">;
1092
- tag: z.ZodString;
1093
- }, z.core.$strict>, z.ZodObject<{
1094
- from: z.ZodLiteral<"toolName">;
1095
- }, z.core.$strict>, z.ZodObject<{
1096
- from: z.ZodLiteral<"toolTag">;
1097
- tag: z.ZodString;
1098
- }, z.core.$strict>, z.ZodObject<{
1099
- from: z.ZodLiteral<"toolArg">;
1100
- path: z.ZodString;
1101
- }, z.core.$strict>, z.ZodObject<{
1102
- from: z.ZodLiteral<"subject">;
1103
- subjectType: z.ZodString;
1104
- role: z.ZodOptional<z.ZodString>;
1105
- field: z.ZodOptional<z.ZodEnum<{
1106
- idSystem: "idSystem";
1107
- id: "id";
1108
- }>>;
1109
- }, z.core.$strict>, z.ZodObject<{
1110
- from: z.ZodLiteral<"const">;
1111
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1112
- }, z.core.$strict>], "from">>;
1113
- op: z.ZodEnum<{
1114
- in: "in";
1115
- gt: "gt";
1116
- gte: "gte";
1117
- lt: "lt";
1118
- lte: "lte";
1119
- eq: "eq";
1120
- neq: "neq";
1121
- nin: "nin";
1122
- }>;
1123
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1124
- onMissing: z.ZodOptional<z.ZodEnum<{
1125
- hitl: "hitl";
1126
- allow: "allow";
1127
- block: "block";
1128
- }>>;
1129
- }, z.core.$strict>]>>;
1130
262
  }, z.core.$strict>, z.ZodObject<{
1131
- kind: z.ZodLiteral<"or">;
1132
- any: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
1133
- kind: z.ZodLiteral<"toolName">;
1134
- op: z.ZodEnum<{
1135
- eq: "eq";
1136
- neq: "neq";
1137
- contains: "contains";
1138
- startsWith: "startsWith";
1139
- endsWith: "endsWith";
1140
- glob: "glob";
1141
- }>;
1142
- value: z.ZodString;
1143
- }, z.core.$strict>, z.ZodObject<{
1144
- kind: z.ZodLiteral<"toolName">;
1145
- op: z.ZodLiteral<"in">;
1146
- value: z.ZodArray<z.ZodString>;
1147
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1148
- kind: z.ZodLiteral<"toolTag">;
1149
- op: z.ZodLiteral<"has">;
1150
- tag: z.ZodString;
1151
- }, z.core.$strict>, z.ZodObject<{
1152
- kind: z.ZodLiteral<"toolTag">;
1153
- op: z.ZodLiteral<"anyOf">;
1154
- tags: z.ZodArray<z.ZodString>;
1155
- }, z.core.$strict>, z.ZodObject<{
1156
- kind: z.ZodLiteral<"toolTag">;
1157
- op: z.ZodLiteral<"allOf">;
1158
- tags: z.ZodArray<z.ZodString>;
1159
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1160
- kind: z.ZodLiteral<"toolArg">;
1161
- type: z.ZodLiteral<"string">;
1162
- op: z.ZodEnum<{
1163
- in: "in";
1164
- eq: "eq";
1165
- neq: "neq";
1166
- contains: "contains";
1167
- startsWith: "startsWith";
1168
- endsWith: "endsWith";
1169
- }>;
1170
- path: z.ZodString;
1171
- value: z.ZodString;
1172
- }, z.core.$strip>, z.ZodObject<{
1173
- kind: z.ZodLiteral<"toolArg">;
1174
- type: z.ZodLiteral<"number">;
1175
- op: z.ZodEnum<{
1176
- gt: "gt";
1177
- gte: "gte";
1178
- lt: "lt";
1179
- lte: "lte";
1180
- eq: "eq";
1181
- neq: "neq";
1182
- }>;
1183
- path: z.ZodString;
1184
- value: z.ZodNumber;
1185
- }, z.core.$strip>, z.ZodObject<{
1186
- kind: z.ZodLiteral<"toolArg">;
1187
- type: z.ZodLiteral<"boolean">;
1188
- op: z.ZodLiteral<"eq">;
1189
- path: z.ZodString;
1190
- value: z.ZodBoolean;
1191
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1192
- kind: z.ZodLiteral<"enduserTag">;
1193
- op: z.ZodLiteral<"has">;
1194
- tag: z.ZodString;
1195
- }, z.core.$strict>, z.ZodObject<{
1196
- kind: z.ZodLiteral<"enduserTag">;
1197
- op: z.ZodLiteral<"hasValue">;
1198
- tag: z.ZodString;
1199
- value: z.ZodString;
1200
- }, z.core.$strict>, z.ZodObject<{
1201
- kind: z.ZodLiteral<"enduserTag">;
1202
- op: z.ZodLiteral<"hasValueAny">;
1203
- tag: z.ZodString;
1204
- values: z.ZodArray<z.ZodString>;
1205
- }, z.core.$strict>], "op">, z.ZodObject<{
1206
- kind: z.ZodLiteral<"executionTime">;
1207
- scope: z.ZodEnum<{
1208
- tool: "tool";
1209
- total: "total";
1210
- }>;
1211
- op: z.ZodEnum<{
1212
- gt: "gt";
1213
- gte: "gte";
1214
- lt: "lt";
1215
- lte: "lte";
1216
- eq: "eq";
1217
- neq: "neq";
1218
- }>;
1219
- ms: z.ZodNumber;
1220
- }, z.core.$strict>, z.ZodObject<{
1221
- kind: z.ZodLiteral<"sequence">;
1222
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
1223
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
1224
- }, z.core.$strict>, z.ZodObject<{
1225
- kind: z.ZodLiteral<"maxCalls">;
1226
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
1227
- by: z.ZodLiteral<"toolName">;
1228
- patterns: z.ZodArray<z.ZodString>;
1229
- }, z.core.$strict>, z.ZodObject<{
1230
- by: z.ZodLiteral<"toolTag">;
1231
- tags: z.ZodArray<z.ZodString>;
1232
- }, z.core.$strict>], "by">;
1233
- max: z.ZodNumber;
1234
- }, z.core.$strict>, z.ZodObject<{
1235
- kind: z.ZodLiteral<"custom">;
1236
- name: z.ZodString;
1237
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
1238
- }, z.core.$strict>, z.ZodObject<{
1239
- kind: z.ZodLiteral<"metricWindow">;
1240
- scope: z.ZodEnum<{
1241
- agent: "agent";
1242
- agent_user: "agent_user";
1243
- }>;
1244
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
1245
- kind: z.ZodLiteral<"inbuilt">;
1246
- key: z.ZodEnum<{
1247
- bytes_in: "bytes_in";
1248
- bytes_out: "bytes_out";
1249
- duration_ms: "duration_ms";
1250
- records_in: "records_in";
1251
- records_out: "records_out";
1252
- llm_tokens_in: "llm_tokens_in";
1253
- llm_tokens_out: "llm_tokens_out";
1254
- llm_cost_usd: "llm_cost_usd";
263
+ kind: z.ZodLiteral<"sensitiveData">;
264
+ target: z.ZodLiteral<"toolArg">;
265
+ path: z.ZodOptional<z.ZodString>;
266
+ op: z.ZodDefault<z.ZodEnum<{
267
+ anyOf: "anyOf";
268
+ allOf: "allOf";
269
+ }>>;
270
+ detectors: z.ZodArray<z.ZodObject<{
271
+ detector: z.ZodEnum<{
272
+ email: "email";
273
+ email_domain: "email_domain";
274
+ phone: "phone";
275
+ credit_card: "credit_card";
276
+ iban: "iban";
277
+ uk_nino: "uk_nino";
278
+ ip_address: "ip_address";
279
+ url: "url";
280
+ jwt: "jwt";
281
+ private_key: "private_key";
282
+ secret_key: "secret_key";
283
+ }>;
284
+ subCondition: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
285
+ check: z.ZodLiteral<"domain">;
286
+ op: z.ZodEnum<{
287
+ in: "in";
288
+ eq: "eq";
289
+ neq: "neq";
290
+ endsWith: "endsWith";
1255
291
  }>;
292
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
1256
293
  }, z.core.$strict>, z.ZodObject<{
1257
- kind: z.ZodLiteral<"custom">;
1258
- key: z.ZodString;
1259
- }, z.core.$strict>], "kind">;
1260
- aggregate: z.ZodEnum<{
1261
- sum: "sum";
1262
- avg: "avg";
1263
- max: "max";
1264
- min: "min";
1265
- count: "count";
1266
- }>;
1267
- windowSeconds: z.ZodNumber;
1268
- filter: z.ZodOptional<z.ZodObject<{
1269
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1270
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1271
- }, z.core.$strict>>;
1272
- op: z.ZodEnum<{
1273
- gt: "gt";
1274
- gte: "gte";
1275
- lt: "lt";
1276
- lte: "lte";
1277
- eq: "eq";
1278
- neq: "neq";
1279
- }>;
1280
- value: z.ZodNumber;
1281
- onMissing: z.ZodOptional<z.ZodEnum<{
1282
- hitl: "hitl";
1283
- allow: "allow";
1284
- block: "block";
1285
- }>>;
1286
- }, z.core.$strict>, z.ZodObject<{
1287
- kind: z.ZodLiteral<"timeGate">;
1288
- timezone: z.ZodObject<{
1289
- source: z.ZodLiteral<"enduserTag">;
1290
- tag: z.ZodString;
1291
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
1292
- }, z.core.$strict>;
1293
- windows: z.ZodArray<z.ZodObject<{
1294
- days: z.ZodArray<z.ZodEnum<{
1295
- mon: "mon";
1296
- tue: "tue";
1297
- wed: "wed";
1298
- thu: "thu";
1299
- fri: "fri";
1300
- sat: "sat";
1301
- sun: "sun";
1302
- }>>;
1303
- start: z.ZodString;
1304
- end: z.ZodString;
1305
- }, z.core.$strict>>;
1306
- }, z.core.$strict>, z.ZodObject<{
1307
- kind: z.ZodLiteral<"requireSubject">;
1308
- subjectType: z.ZodString;
1309
- idSystem: z.ZodOptional<z.ZodString>;
1310
- }, z.core.$strict>, z.ZodObject<{
1311
- kind: z.ZodLiteral<"signal">;
1312
- key: z.ZodString;
1313
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1314
- from: z.ZodLiteral<"enduserId">;
1315
- }, z.core.$strict>, z.ZodObject<{
1316
- from: z.ZodLiteral<"enduserTag">;
1317
- tag: z.ZodString;
1318
- }, z.core.$strict>, z.ZodObject<{
1319
- from: z.ZodLiteral<"toolName">;
1320
- }, z.core.$strict>, z.ZodObject<{
1321
- from: z.ZodLiteral<"toolTag">;
1322
- tag: z.ZodString;
1323
- }, z.core.$strict>, z.ZodObject<{
1324
- from: z.ZodLiteral<"toolArg">;
1325
- path: z.ZodString;
1326
- }, z.core.$strict>, z.ZodObject<{
1327
- from: z.ZodLiteral<"subject">;
1328
- subjectType: z.ZodString;
1329
- role: z.ZodOptional<z.ZodString>;
1330
- field: z.ZodOptional<z.ZodEnum<{
1331
- idSystem: "idSystem";
1332
- id: "id";
1333
- }>>;
1334
- }, z.core.$strict>, z.ZodObject<{
1335
- from: z.ZodLiteral<"const">;
1336
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1337
- }, z.core.$strict>], "from">>;
1338
- op: z.ZodEnum<{
1339
- in: "in";
1340
- gt: "gt";
1341
- gte: "gte";
1342
- lt: "lt";
1343
- lte: "lte";
1344
- eq: "eq";
1345
- neq: "neq";
1346
- nin: "nin";
1347
- }>;
1348
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1349
- onMissing: z.ZodOptional<z.ZodEnum<{
1350
- hitl: "hitl";
1351
- allow: "allow";
1352
- block: "block";
1353
- }>>;
1354
- }, z.core.$strict>]>>;
1355
- }, z.core.$strict>, z.ZodObject<{
1356
- kind: z.ZodLiteral<"not">;
1357
- not: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
1358
- kind: z.ZodLiteral<"toolName">;
1359
- op: z.ZodEnum<{
1360
- eq: "eq";
1361
- neq: "neq";
1362
- contains: "contains";
1363
- startsWith: "startsWith";
1364
- endsWith: "endsWith";
1365
- glob: "glob";
1366
- }>;
1367
- value: z.ZodString;
1368
- }, z.core.$strict>, z.ZodObject<{
1369
- kind: z.ZodLiteral<"toolName">;
1370
- op: z.ZodLiteral<"in">;
1371
- value: z.ZodArray<z.ZodString>;
1372
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1373
- kind: z.ZodLiteral<"toolTag">;
1374
- op: z.ZodLiteral<"has">;
1375
- tag: z.ZodString;
1376
- }, z.core.$strict>, z.ZodObject<{
1377
- kind: z.ZodLiteral<"toolTag">;
1378
- op: z.ZodLiteral<"anyOf">;
1379
- tags: z.ZodArray<z.ZodString>;
1380
- }, z.core.$strict>, z.ZodObject<{
1381
- kind: z.ZodLiteral<"toolTag">;
1382
- op: z.ZodLiteral<"allOf">;
1383
- tags: z.ZodArray<z.ZodString>;
1384
- }, z.core.$strict>], "op">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1385
- kind: z.ZodLiteral<"toolArg">;
1386
- type: z.ZodLiteral<"string">;
1387
- op: z.ZodEnum<{
1388
- in: "in";
1389
- eq: "eq";
1390
- neq: "neq";
1391
- contains: "contains";
1392
- startsWith: "startsWith";
1393
- endsWith: "endsWith";
1394
- }>;
1395
- path: z.ZodString;
1396
- value: z.ZodString;
1397
- }, z.core.$strip>, z.ZodObject<{
1398
- kind: z.ZodLiteral<"toolArg">;
1399
- type: z.ZodLiteral<"number">;
1400
- op: z.ZodEnum<{
1401
- gt: "gt";
1402
- gte: "gte";
1403
- lt: "lt";
1404
- lte: "lte";
1405
- eq: "eq";
1406
- neq: "neq";
1407
- }>;
1408
- path: z.ZodString;
1409
- value: z.ZodNumber;
1410
- }, z.core.$strip>, z.ZodObject<{
1411
- kind: z.ZodLiteral<"toolArg">;
1412
- type: z.ZodLiteral<"boolean">;
1413
- op: z.ZodLiteral<"eq">;
1414
- path: z.ZodString;
1415
- value: z.ZodBoolean;
1416
- }, z.core.$strip>], "type">, z.ZodDiscriminatedUnion<[z.ZodObject<{
1417
- kind: z.ZodLiteral<"enduserTag">;
1418
- op: z.ZodLiteral<"has">;
1419
- tag: z.ZodString;
1420
- }, z.core.$strict>, z.ZodObject<{
1421
- kind: z.ZodLiteral<"enduserTag">;
1422
- op: z.ZodLiteral<"hasValue">;
1423
- tag: z.ZodString;
1424
- value: z.ZodString;
1425
- }, z.core.$strict>, z.ZodObject<{
1426
- kind: z.ZodLiteral<"enduserTag">;
1427
- op: z.ZodLiteral<"hasValueAny">;
1428
- tag: z.ZodString;
1429
- values: z.ZodArray<z.ZodString>;
1430
- }, z.core.$strict>], "op">, z.ZodObject<{
1431
- kind: z.ZodLiteral<"executionTime">;
1432
- scope: z.ZodEnum<{
1433
- tool: "tool";
1434
- total: "total";
1435
- }>;
1436
- op: z.ZodEnum<{
1437
- gt: "gt";
1438
- gte: "gte";
1439
- lt: "lt";
1440
- lte: "lte";
1441
- eq: "eq";
1442
- neq: "neq";
1443
- }>;
1444
- ms: z.ZodNumber;
1445
- }, z.core.$strict>, z.ZodObject<{
1446
- kind: z.ZodLiteral<"sequence">;
1447
- mustHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
1448
- mustNotHaveCalled: z.ZodOptional<z.ZodArray<z.ZodString>>;
1449
- }, z.core.$strict>, z.ZodObject<{
1450
- kind: z.ZodLiteral<"maxCalls">;
1451
- selector: z.ZodDiscriminatedUnion<[z.ZodObject<{
1452
- by: z.ZodLiteral<"toolName">;
1453
- patterns: z.ZodArray<z.ZodString>;
1454
- }, z.core.$strict>, z.ZodObject<{
1455
- by: z.ZodLiteral<"toolTag">;
1456
- tags: z.ZodArray<z.ZodString>;
1457
- }, z.core.$strict>], "by">;
1458
- max: z.ZodNumber;
1459
- }, z.core.$strict>, z.ZodObject<{
1460
- kind: z.ZodLiteral<"custom">;
1461
- name: z.ZodString;
1462
- args: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>>;
1463
- }, z.core.$strict>, z.ZodObject<{
1464
- kind: z.ZodLiteral<"metricWindow">;
1465
- scope: z.ZodEnum<{
1466
- agent: "agent";
1467
- agent_user: "agent_user";
1468
- }>;
1469
- metric: z.ZodDiscriminatedUnion<[z.ZodObject<{
1470
- kind: z.ZodLiteral<"inbuilt">;
1471
- key: z.ZodEnum<{
1472
- bytes_in: "bytes_in";
1473
- bytes_out: "bytes_out";
1474
- duration_ms: "duration_ms";
1475
- records_in: "records_in";
1476
- records_out: "records_out";
1477
- llm_tokens_in: "llm_tokens_in";
1478
- llm_tokens_out: "llm_tokens_out";
1479
- llm_cost_usd: "llm_cost_usd";
294
+ check: z.ZodLiteral<"tld">;
295
+ op: z.ZodEnum<{
296
+ in: "in";
297
+ eq: "eq";
298
+ neq: "neq";
1480
299
  }>;
300
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
1481
301
  }, z.core.$strict>, z.ZodObject<{
1482
- kind: z.ZodLiteral<"custom">;
1483
- key: z.ZodString;
1484
- }, z.core.$strict>], "kind">;
1485
- aggregate: z.ZodEnum<{
1486
- sum: "sum";
1487
- avg: "avg";
1488
- max: "max";
1489
- min: "min";
1490
- count: "count";
1491
- }>;
1492
- windowSeconds: z.ZodNumber;
1493
- filter: z.ZodOptional<z.ZodObject<{
1494
- toolName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1495
- toolTag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1496
- }, z.core.$strict>>;
1497
- op: z.ZodEnum<{
1498
- gt: "gt";
1499
- gte: "gte";
1500
- lt: "lt";
1501
- lte: "lte";
1502
- eq: "eq";
1503
- neq: "neq";
1504
- }>;
1505
- value: z.ZodNumber;
1506
- onMissing: z.ZodOptional<z.ZodEnum<{
1507
- hitl: "hitl";
1508
- allow: "allow";
1509
- block: "block";
1510
- }>>;
1511
- }, z.core.$strict>, z.ZodObject<{
1512
- kind: z.ZodLiteral<"timeGate">;
1513
- timezone: z.ZodObject<{
1514
- source: z.ZodLiteral<"enduserTag">;
1515
- tag: z.ZodString;
1516
- fallback: z.ZodOptional<z.ZodLiteral<"org">>;
1517
- }, z.core.$strict>;
1518
- windows: z.ZodArray<z.ZodObject<{
1519
- days: z.ZodArray<z.ZodEnum<{
1520
- mon: "mon";
1521
- tue: "tue";
1522
- wed: "wed";
1523
- thu: "thu";
1524
- fri: "fri";
1525
- sat: "sat";
1526
- sun: "sun";
1527
- }>>;
1528
- start: z.ZodString;
1529
- end: z.ZodString;
1530
- }, z.core.$strict>>;
1531
- }, z.core.$strict>, z.ZodObject<{
1532
- kind: z.ZodLiteral<"requireSubject">;
1533
- subjectType: z.ZodString;
1534
- idSystem: z.ZodOptional<z.ZodString>;
1535
- }, z.core.$strict>, z.ZodObject<{
1536
- kind: z.ZodLiteral<"signal">;
1537
- key: z.ZodString;
1538
- args: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1539
- from: z.ZodLiteral<"enduserId">;
1540
- }, z.core.$strict>, z.ZodObject<{
1541
- from: z.ZodLiteral<"enduserTag">;
1542
- tag: z.ZodString;
1543
- }, z.core.$strict>, z.ZodObject<{
1544
- from: z.ZodLiteral<"toolName">;
1545
- }, z.core.$strict>, z.ZodObject<{
1546
- from: z.ZodLiteral<"toolTag">;
1547
- tag: z.ZodString;
1548
- }, z.core.$strict>, z.ZodObject<{
1549
- from: z.ZodLiteral<"toolArg">;
1550
- path: z.ZodString;
1551
- }, z.core.$strict>, z.ZodObject<{
1552
- from: z.ZodLiteral<"subject">;
1553
- subjectType: z.ZodString;
1554
- role: z.ZodOptional<z.ZodString>;
1555
- field: z.ZodOptional<z.ZodEnum<{
1556
- idSystem: "idSystem";
1557
- id: "id";
1558
- }>>;
1559
- }, z.core.$strict>, z.ZodObject<{
1560
- from: z.ZodLiteral<"const">;
1561
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1562
- }, z.core.$strict>], "from">>;
1563
- op: z.ZodEnum<{
1564
- in: "in";
1565
- gt: "gt";
1566
- gte: "gte";
1567
- lt: "lt";
1568
- lte: "lte";
1569
- eq: "eq";
1570
- neq: "neq";
1571
- nin: "nin";
1572
- }>;
1573
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
1574
- onMissing: z.ZodOptional<z.ZodEnum<{
1575
- hitl: "hitl";
1576
- allow: "allow";
1577
- block: "block";
1578
- }>>;
1579
- }, z.core.$strict>]>;
302
+ check: z.ZodLiteral<"scheme">;
303
+ op: z.ZodEnum<{
304
+ in: "in";
305
+ eq: "eq";
306
+ neq: "neq";
307
+ }>;
308
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
309
+ }, z.core.$strict>], "check">>;
310
+ }, z.core.$strict>>;
1580
311
  }, z.core.$strict>]>;
1581
- export type RuleCondition = z.infer<typeof RuleConditionSchema>;
312
+ type BaseRuleCondition = z.infer<typeof BaseRuleConditionSchema>;
313
+ export type RuleCondition = BaseRuleCondition | {
314
+ kind: "and";
315
+ all: RuleCondition[];
316
+ } | {
317
+ kind: "or";
318
+ any: RuleCondition[];
319
+ } | {
320
+ kind: "not";
321
+ not: RuleCondition;
322
+ };
323
+ export type AndCondition = {
324
+ kind: "and";
325
+ all: RuleCondition[];
326
+ };
327
+ export type OrCondition = {
328
+ kind: "or";
329
+ any: RuleCondition[];
330
+ };
331
+ export type NotCondition = {
332
+ kind: "not";
333
+ not: RuleCondition;
334
+ };
335
+ export declare const RuleConditionSchema: z.ZodType<RuleCondition>;
1582
336
  export {};