@syntrologie/adapt-content 2.3.0 → 2.4.0-canary.2

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.
@@ -0,0 +1,1428 @@
1
+ /**
2
+ * Shared Zod schemas for decision strategies, conditions, and event scoping.
3
+ *
4
+ * These are the canonical definitions — runtime-sdk and all adaptive packages
5
+ * should import from here instead of duplicating.
6
+ */
7
+ import { z } from 'zod';
8
+ export declare const PageUrlConditionZ: z.ZodObject<{
9
+ type: z.ZodLiteral<"page_url">;
10
+ url: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ type: "page_url";
13
+ url: string;
14
+ }, {
15
+ type: "page_url";
16
+ url: string;
17
+ }>;
18
+ export declare const RouteConditionZ: z.ZodObject<{
19
+ type: z.ZodLiteral<"route">;
20
+ routeId: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ type: "route";
23
+ routeId: string;
24
+ }, {
25
+ type: "route";
26
+ routeId: string;
27
+ }>;
28
+ export declare const AnchorVisibleConditionZ: z.ZodObject<{
29
+ type: z.ZodLiteral<"anchor_visible">;
30
+ anchorId: z.ZodString;
31
+ state: z.ZodEnum<["visible", "present", "absent"]>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: "anchor_visible";
34
+ anchorId: string;
35
+ state: "visible" | "present" | "absent";
36
+ }, {
37
+ type: "anchor_visible";
38
+ anchorId: string;
39
+ state: "visible" | "present" | "absent";
40
+ }>;
41
+ export declare const EventOccurredConditionZ: z.ZodObject<{
42
+ type: z.ZodLiteral<"event_occurred">;
43
+ eventName: z.ZodString;
44
+ withinMs: z.ZodOptional<z.ZodNumber>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ type: "event_occurred";
47
+ eventName: string;
48
+ withinMs?: number | undefined;
49
+ }, {
50
+ type: "event_occurred";
51
+ eventName: string;
52
+ withinMs?: number | undefined;
53
+ }>;
54
+ export declare const StateEqualsConditionZ: z.ZodObject<{
55
+ type: z.ZodLiteral<"state_equals">;
56
+ key: z.ZodString;
57
+ value: z.ZodUnknown;
58
+ }, "strip", z.ZodTypeAny, {
59
+ type: "state_equals";
60
+ key: string;
61
+ value?: unknown;
62
+ }, {
63
+ type: "state_equals";
64
+ key: string;
65
+ value?: unknown;
66
+ }>;
67
+ export declare const ViewportConditionZ: z.ZodObject<{
68
+ type: z.ZodLiteral<"viewport">;
69
+ minWidth: z.ZodOptional<z.ZodNumber>;
70
+ maxWidth: z.ZodOptional<z.ZodNumber>;
71
+ minHeight: z.ZodOptional<z.ZodNumber>;
72
+ maxHeight: z.ZodOptional<z.ZodNumber>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ type: "viewport";
75
+ minWidth?: number | undefined;
76
+ maxWidth?: number | undefined;
77
+ minHeight?: number | undefined;
78
+ maxHeight?: number | undefined;
79
+ }, {
80
+ type: "viewport";
81
+ minWidth?: number | undefined;
82
+ maxWidth?: number | undefined;
83
+ minHeight?: number | undefined;
84
+ maxHeight?: number | undefined;
85
+ }>;
86
+ export declare const SessionMetricConditionZ: z.ZodObject<{
87
+ type: z.ZodLiteral<"session_metric">;
88
+ key: z.ZodString;
89
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
90
+ threshold: z.ZodNumber;
91
+ }, "strip", z.ZodTypeAny, {
92
+ type: "session_metric";
93
+ key: string;
94
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
95
+ threshold: number;
96
+ }, {
97
+ type: "session_metric";
98
+ key: string;
99
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
100
+ threshold: number;
101
+ }>;
102
+ export declare const DismissedConditionZ: z.ZodObject<{
103
+ type: z.ZodLiteral<"dismissed">;
104
+ key: z.ZodString;
105
+ inverted: z.ZodOptional<z.ZodBoolean>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ type: "dismissed";
108
+ key: string;
109
+ inverted?: boolean | undefined;
110
+ }, {
111
+ type: "dismissed";
112
+ key: string;
113
+ inverted?: boolean | undefined;
114
+ }>;
115
+ export declare const CooldownActiveConditionZ: z.ZodObject<{
116
+ type: z.ZodLiteral<"cooldown_active">;
117
+ key: z.ZodString;
118
+ inverted: z.ZodOptional<z.ZodBoolean>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ type: "cooldown_active";
121
+ key: string;
122
+ inverted?: boolean | undefined;
123
+ }, {
124
+ type: "cooldown_active";
125
+ key: string;
126
+ inverted?: boolean | undefined;
127
+ }>;
128
+ export declare const FrequencyLimitConditionZ: z.ZodObject<{
129
+ type: z.ZodLiteral<"frequency_limit">;
130
+ key: z.ZodString;
131
+ limit: z.ZodNumber;
132
+ inverted: z.ZodOptional<z.ZodBoolean>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ type: "frequency_limit";
135
+ key: string;
136
+ limit: number;
137
+ inverted?: boolean | undefined;
138
+ }, {
139
+ type: "frequency_limit";
140
+ key: string;
141
+ limit: number;
142
+ inverted?: boolean | undefined;
143
+ }>;
144
+ export declare const EventCountConditionZ: z.ZodObject<{
145
+ type: z.ZodLiteral<"event_count">;
146
+ key: z.ZodString;
147
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
148
+ count: z.ZodNumber;
149
+ withinMs: z.ZodOptional<z.ZodNumber>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ type: "event_count";
152
+ key: string;
153
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
154
+ count: number;
155
+ withinMs?: number | undefined;
156
+ }, {
157
+ type: "event_count";
158
+ key: string;
159
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
160
+ count: number;
161
+ withinMs?: number | undefined;
162
+ }>;
163
+ export declare const ConditionZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
164
+ type: z.ZodLiteral<"page_url">;
165
+ url: z.ZodString;
166
+ }, "strip", z.ZodTypeAny, {
167
+ type: "page_url";
168
+ url: string;
169
+ }, {
170
+ type: "page_url";
171
+ url: string;
172
+ }>, z.ZodObject<{
173
+ type: z.ZodLiteral<"route">;
174
+ routeId: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "route";
177
+ routeId: string;
178
+ }, {
179
+ type: "route";
180
+ routeId: string;
181
+ }>, z.ZodObject<{
182
+ type: z.ZodLiteral<"anchor_visible">;
183
+ anchorId: z.ZodString;
184
+ state: z.ZodEnum<["visible", "present", "absent"]>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ type: "anchor_visible";
187
+ anchorId: string;
188
+ state: "visible" | "present" | "absent";
189
+ }, {
190
+ type: "anchor_visible";
191
+ anchorId: string;
192
+ state: "visible" | "present" | "absent";
193
+ }>, z.ZodObject<{
194
+ type: z.ZodLiteral<"event_occurred">;
195
+ eventName: z.ZodString;
196
+ withinMs: z.ZodOptional<z.ZodNumber>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ type: "event_occurred";
199
+ eventName: string;
200
+ withinMs?: number | undefined;
201
+ }, {
202
+ type: "event_occurred";
203
+ eventName: string;
204
+ withinMs?: number | undefined;
205
+ }>, z.ZodObject<{
206
+ type: z.ZodLiteral<"state_equals">;
207
+ key: z.ZodString;
208
+ value: z.ZodUnknown;
209
+ }, "strip", z.ZodTypeAny, {
210
+ type: "state_equals";
211
+ key: string;
212
+ value?: unknown;
213
+ }, {
214
+ type: "state_equals";
215
+ key: string;
216
+ value?: unknown;
217
+ }>, z.ZodObject<{
218
+ type: z.ZodLiteral<"viewport">;
219
+ minWidth: z.ZodOptional<z.ZodNumber>;
220
+ maxWidth: z.ZodOptional<z.ZodNumber>;
221
+ minHeight: z.ZodOptional<z.ZodNumber>;
222
+ maxHeight: z.ZodOptional<z.ZodNumber>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ type: "viewport";
225
+ minWidth?: number | undefined;
226
+ maxWidth?: number | undefined;
227
+ minHeight?: number | undefined;
228
+ maxHeight?: number | undefined;
229
+ }, {
230
+ type: "viewport";
231
+ minWidth?: number | undefined;
232
+ maxWidth?: number | undefined;
233
+ minHeight?: number | undefined;
234
+ maxHeight?: number | undefined;
235
+ }>, z.ZodObject<{
236
+ type: z.ZodLiteral<"session_metric">;
237
+ key: z.ZodString;
238
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
239
+ threshold: z.ZodNumber;
240
+ }, "strip", z.ZodTypeAny, {
241
+ type: "session_metric";
242
+ key: string;
243
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
244
+ threshold: number;
245
+ }, {
246
+ type: "session_metric";
247
+ key: string;
248
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
249
+ threshold: number;
250
+ }>, z.ZodObject<{
251
+ type: z.ZodLiteral<"dismissed">;
252
+ key: z.ZodString;
253
+ inverted: z.ZodOptional<z.ZodBoolean>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ type: "dismissed";
256
+ key: string;
257
+ inverted?: boolean | undefined;
258
+ }, {
259
+ type: "dismissed";
260
+ key: string;
261
+ inverted?: boolean | undefined;
262
+ }>, z.ZodObject<{
263
+ type: z.ZodLiteral<"cooldown_active">;
264
+ key: z.ZodString;
265
+ inverted: z.ZodOptional<z.ZodBoolean>;
266
+ }, "strip", z.ZodTypeAny, {
267
+ type: "cooldown_active";
268
+ key: string;
269
+ inverted?: boolean | undefined;
270
+ }, {
271
+ type: "cooldown_active";
272
+ key: string;
273
+ inverted?: boolean | undefined;
274
+ }>, z.ZodObject<{
275
+ type: z.ZodLiteral<"frequency_limit">;
276
+ key: z.ZodString;
277
+ limit: z.ZodNumber;
278
+ inverted: z.ZodOptional<z.ZodBoolean>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ type: "frequency_limit";
281
+ key: string;
282
+ limit: number;
283
+ inverted?: boolean | undefined;
284
+ }, {
285
+ type: "frequency_limit";
286
+ key: string;
287
+ limit: number;
288
+ inverted?: boolean | undefined;
289
+ }>, z.ZodObject<{
290
+ type: z.ZodLiteral<"event_count">;
291
+ key: z.ZodString;
292
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
293
+ count: z.ZodNumber;
294
+ withinMs: z.ZodOptional<z.ZodNumber>;
295
+ }, "strip", z.ZodTypeAny, {
296
+ type: "event_count";
297
+ key: string;
298
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
299
+ count: number;
300
+ withinMs?: number | undefined;
301
+ }, {
302
+ type: "event_count";
303
+ key: string;
304
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
305
+ count: number;
306
+ withinMs?: number | undefined;
307
+ }>]>;
308
+ export declare const RuleZ: z.ZodObject<{
309
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
310
+ type: z.ZodLiteral<"page_url">;
311
+ url: z.ZodString;
312
+ }, "strip", z.ZodTypeAny, {
313
+ type: "page_url";
314
+ url: string;
315
+ }, {
316
+ type: "page_url";
317
+ url: string;
318
+ }>, z.ZodObject<{
319
+ type: z.ZodLiteral<"route">;
320
+ routeId: z.ZodString;
321
+ }, "strip", z.ZodTypeAny, {
322
+ type: "route";
323
+ routeId: string;
324
+ }, {
325
+ type: "route";
326
+ routeId: string;
327
+ }>, z.ZodObject<{
328
+ type: z.ZodLiteral<"anchor_visible">;
329
+ anchorId: z.ZodString;
330
+ state: z.ZodEnum<["visible", "present", "absent"]>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ type: "anchor_visible";
333
+ anchorId: string;
334
+ state: "visible" | "present" | "absent";
335
+ }, {
336
+ type: "anchor_visible";
337
+ anchorId: string;
338
+ state: "visible" | "present" | "absent";
339
+ }>, z.ZodObject<{
340
+ type: z.ZodLiteral<"event_occurred">;
341
+ eventName: z.ZodString;
342
+ withinMs: z.ZodOptional<z.ZodNumber>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ type: "event_occurred";
345
+ eventName: string;
346
+ withinMs?: number | undefined;
347
+ }, {
348
+ type: "event_occurred";
349
+ eventName: string;
350
+ withinMs?: number | undefined;
351
+ }>, z.ZodObject<{
352
+ type: z.ZodLiteral<"state_equals">;
353
+ key: z.ZodString;
354
+ value: z.ZodUnknown;
355
+ }, "strip", z.ZodTypeAny, {
356
+ type: "state_equals";
357
+ key: string;
358
+ value?: unknown;
359
+ }, {
360
+ type: "state_equals";
361
+ key: string;
362
+ value?: unknown;
363
+ }>, z.ZodObject<{
364
+ type: z.ZodLiteral<"viewport">;
365
+ minWidth: z.ZodOptional<z.ZodNumber>;
366
+ maxWidth: z.ZodOptional<z.ZodNumber>;
367
+ minHeight: z.ZodOptional<z.ZodNumber>;
368
+ maxHeight: z.ZodOptional<z.ZodNumber>;
369
+ }, "strip", z.ZodTypeAny, {
370
+ type: "viewport";
371
+ minWidth?: number | undefined;
372
+ maxWidth?: number | undefined;
373
+ minHeight?: number | undefined;
374
+ maxHeight?: number | undefined;
375
+ }, {
376
+ type: "viewport";
377
+ minWidth?: number | undefined;
378
+ maxWidth?: number | undefined;
379
+ minHeight?: number | undefined;
380
+ maxHeight?: number | undefined;
381
+ }>, z.ZodObject<{
382
+ type: z.ZodLiteral<"session_metric">;
383
+ key: z.ZodString;
384
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
385
+ threshold: z.ZodNumber;
386
+ }, "strip", z.ZodTypeAny, {
387
+ type: "session_metric";
388
+ key: string;
389
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
390
+ threshold: number;
391
+ }, {
392
+ type: "session_metric";
393
+ key: string;
394
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
395
+ threshold: number;
396
+ }>, z.ZodObject<{
397
+ type: z.ZodLiteral<"dismissed">;
398
+ key: z.ZodString;
399
+ inverted: z.ZodOptional<z.ZodBoolean>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ type: "dismissed";
402
+ key: string;
403
+ inverted?: boolean | undefined;
404
+ }, {
405
+ type: "dismissed";
406
+ key: string;
407
+ inverted?: boolean | undefined;
408
+ }>, z.ZodObject<{
409
+ type: z.ZodLiteral<"cooldown_active">;
410
+ key: z.ZodString;
411
+ inverted: z.ZodOptional<z.ZodBoolean>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ type: "cooldown_active";
414
+ key: string;
415
+ inverted?: boolean | undefined;
416
+ }, {
417
+ type: "cooldown_active";
418
+ key: string;
419
+ inverted?: boolean | undefined;
420
+ }>, z.ZodObject<{
421
+ type: z.ZodLiteral<"frequency_limit">;
422
+ key: z.ZodString;
423
+ limit: z.ZodNumber;
424
+ inverted: z.ZodOptional<z.ZodBoolean>;
425
+ }, "strip", z.ZodTypeAny, {
426
+ type: "frequency_limit";
427
+ key: string;
428
+ limit: number;
429
+ inverted?: boolean | undefined;
430
+ }, {
431
+ type: "frequency_limit";
432
+ key: string;
433
+ limit: number;
434
+ inverted?: boolean | undefined;
435
+ }>, z.ZodObject<{
436
+ type: z.ZodLiteral<"event_count">;
437
+ key: z.ZodString;
438
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
439
+ count: z.ZodNumber;
440
+ withinMs: z.ZodOptional<z.ZodNumber>;
441
+ }, "strip", z.ZodTypeAny, {
442
+ type: "event_count";
443
+ key: string;
444
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
445
+ count: number;
446
+ withinMs?: number | undefined;
447
+ }, {
448
+ type: "event_count";
449
+ key: string;
450
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
451
+ count: number;
452
+ withinMs?: number | undefined;
453
+ }>]>, "many">;
454
+ value: z.ZodUnknown;
455
+ }, "strip", z.ZodTypeAny, {
456
+ conditions: ({
457
+ type: "page_url";
458
+ url: string;
459
+ } | {
460
+ type: "route";
461
+ routeId: string;
462
+ } | {
463
+ type: "anchor_visible";
464
+ anchorId: string;
465
+ state: "visible" | "present" | "absent";
466
+ } | {
467
+ type: "event_occurred";
468
+ eventName: string;
469
+ withinMs?: number | undefined;
470
+ } | {
471
+ type: "state_equals";
472
+ key: string;
473
+ value?: unknown;
474
+ } | {
475
+ type: "viewport";
476
+ minWidth?: number | undefined;
477
+ maxWidth?: number | undefined;
478
+ minHeight?: number | undefined;
479
+ maxHeight?: number | undefined;
480
+ } | {
481
+ type: "session_metric";
482
+ key: string;
483
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
484
+ threshold: number;
485
+ } | {
486
+ type: "dismissed";
487
+ key: string;
488
+ inverted?: boolean | undefined;
489
+ } | {
490
+ type: "cooldown_active";
491
+ key: string;
492
+ inverted?: boolean | undefined;
493
+ } | {
494
+ type: "frequency_limit";
495
+ key: string;
496
+ limit: number;
497
+ inverted?: boolean | undefined;
498
+ } | {
499
+ type: "event_count";
500
+ key: string;
501
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
502
+ count: number;
503
+ withinMs?: number | undefined;
504
+ })[];
505
+ value?: unknown;
506
+ }, {
507
+ conditions: ({
508
+ type: "page_url";
509
+ url: string;
510
+ } | {
511
+ type: "route";
512
+ routeId: string;
513
+ } | {
514
+ type: "anchor_visible";
515
+ anchorId: string;
516
+ state: "visible" | "present" | "absent";
517
+ } | {
518
+ type: "event_occurred";
519
+ eventName: string;
520
+ withinMs?: number | undefined;
521
+ } | {
522
+ type: "state_equals";
523
+ key: string;
524
+ value?: unknown;
525
+ } | {
526
+ type: "viewport";
527
+ minWidth?: number | undefined;
528
+ maxWidth?: number | undefined;
529
+ minHeight?: number | undefined;
530
+ maxHeight?: number | undefined;
531
+ } | {
532
+ type: "session_metric";
533
+ key: string;
534
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
535
+ threshold: number;
536
+ } | {
537
+ type: "dismissed";
538
+ key: string;
539
+ inverted?: boolean | undefined;
540
+ } | {
541
+ type: "cooldown_active";
542
+ key: string;
543
+ inverted?: boolean | undefined;
544
+ } | {
545
+ type: "frequency_limit";
546
+ key: string;
547
+ limit: number;
548
+ inverted?: boolean | undefined;
549
+ } | {
550
+ type: "event_count";
551
+ key: string;
552
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
553
+ count: number;
554
+ withinMs?: number | undefined;
555
+ })[];
556
+ value?: unknown;
557
+ }>;
558
+ export declare const RuleStrategyZ: z.ZodObject<{
559
+ type: z.ZodLiteral<"rules">;
560
+ rules: z.ZodArray<z.ZodObject<{
561
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
562
+ type: z.ZodLiteral<"page_url">;
563
+ url: z.ZodString;
564
+ }, "strip", z.ZodTypeAny, {
565
+ type: "page_url";
566
+ url: string;
567
+ }, {
568
+ type: "page_url";
569
+ url: string;
570
+ }>, z.ZodObject<{
571
+ type: z.ZodLiteral<"route">;
572
+ routeId: z.ZodString;
573
+ }, "strip", z.ZodTypeAny, {
574
+ type: "route";
575
+ routeId: string;
576
+ }, {
577
+ type: "route";
578
+ routeId: string;
579
+ }>, z.ZodObject<{
580
+ type: z.ZodLiteral<"anchor_visible">;
581
+ anchorId: z.ZodString;
582
+ state: z.ZodEnum<["visible", "present", "absent"]>;
583
+ }, "strip", z.ZodTypeAny, {
584
+ type: "anchor_visible";
585
+ anchorId: string;
586
+ state: "visible" | "present" | "absent";
587
+ }, {
588
+ type: "anchor_visible";
589
+ anchorId: string;
590
+ state: "visible" | "present" | "absent";
591
+ }>, z.ZodObject<{
592
+ type: z.ZodLiteral<"event_occurred">;
593
+ eventName: z.ZodString;
594
+ withinMs: z.ZodOptional<z.ZodNumber>;
595
+ }, "strip", z.ZodTypeAny, {
596
+ type: "event_occurred";
597
+ eventName: string;
598
+ withinMs?: number | undefined;
599
+ }, {
600
+ type: "event_occurred";
601
+ eventName: string;
602
+ withinMs?: number | undefined;
603
+ }>, z.ZodObject<{
604
+ type: z.ZodLiteral<"state_equals">;
605
+ key: z.ZodString;
606
+ value: z.ZodUnknown;
607
+ }, "strip", z.ZodTypeAny, {
608
+ type: "state_equals";
609
+ key: string;
610
+ value?: unknown;
611
+ }, {
612
+ type: "state_equals";
613
+ key: string;
614
+ value?: unknown;
615
+ }>, z.ZodObject<{
616
+ type: z.ZodLiteral<"viewport">;
617
+ minWidth: z.ZodOptional<z.ZodNumber>;
618
+ maxWidth: z.ZodOptional<z.ZodNumber>;
619
+ minHeight: z.ZodOptional<z.ZodNumber>;
620
+ maxHeight: z.ZodOptional<z.ZodNumber>;
621
+ }, "strip", z.ZodTypeAny, {
622
+ type: "viewport";
623
+ minWidth?: number | undefined;
624
+ maxWidth?: number | undefined;
625
+ minHeight?: number | undefined;
626
+ maxHeight?: number | undefined;
627
+ }, {
628
+ type: "viewport";
629
+ minWidth?: number | undefined;
630
+ maxWidth?: number | undefined;
631
+ minHeight?: number | undefined;
632
+ maxHeight?: number | undefined;
633
+ }>, z.ZodObject<{
634
+ type: z.ZodLiteral<"session_metric">;
635
+ key: z.ZodString;
636
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
637
+ threshold: z.ZodNumber;
638
+ }, "strip", z.ZodTypeAny, {
639
+ type: "session_metric";
640
+ key: string;
641
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
642
+ threshold: number;
643
+ }, {
644
+ type: "session_metric";
645
+ key: string;
646
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
647
+ threshold: number;
648
+ }>, z.ZodObject<{
649
+ type: z.ZodLiteral<"dismissed">;
650
+ key: z.ZodString;
651
+ inverted: z.ZodOptional<z.ZodBoolean>;
652
+ }, "strip", z.ZodTypeAny, {
653
+ type: "dismissed";
654
+ key: string;
655
+ inverted?: boolean | undefined;
656
+ }, {
657
+ type: "dismissed";
658
+ key: string;
659
+ inverted?: boolean | undefined;
660
+ }>, z.ZodObject<{
661
+ type: z.ZodLiteral<"cooldown_active">;
662
+ key: z.ZodString;
663
+ inverted: z.ZodOptional<z.ZodBoolean>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ type: "cooldown_active";
666
+ key: string;
667
+ inverted?: boolean | undefined;
668
+ }, {
669
+ type: "cooldown_active";
670
+ key: string;
671
+ inverted?: boolean | undefined;
672
+ }>, z.ZodObject<{
673
+ type: z.ZodLiteral<"frequency_limit">;
674
+ key: z.ZodString;
675
+ limit: z.ZodNumber;
676
+ inverted: z.ZodOptional<z.ZodBoolean>;
677
+ }, "strip", z.ZodTypeAny, {
678
+ type: "frequency_limit";
679
+ key: string;
680
+ limit: number;
681
+ inverted?: boolean | undefined;
682
+ }, {
683
+ type: "frequency_limit";
684
+ key: string;
685
+ limit: number;
686
+ inverted?: boolean | undefined;
687
+ }>, z.ZodObject<{
688
+ type: z.ZodLiteral<"event_count">;
689
+ key: z.ZodString;
690
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
691
+ count: z.ZodNumber;
692
+ withinMs: z.ZodOptional<z.ZodNumber>;
693
+ }, "strip", z.ZodTypeAny, {
694
+ type: "event_count";
695
+ key: string;
696
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
697
+ count: number;
698
+ withinMs?: number | undefined;
699
+ }, {
700
+ type: "event_count";
701
+ key: string;
702
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
703
+ count: number;
704
+ withinMs?: number | undefined;
705
+ }>]>, "many">;
706
+ value: z.ZodUnknown;
707
+ }, "strip", z.ZodTypeAny, {
708
+ conditions: ({
709
+ type: "page_url";
710
+ url: string;
711
+ } | {
712
+ type: "route";
713
+ routeId: string;
714
+ } | {
715
+ type: "anchor_visible";
716
+ anchorId: string;
717
+ state: "visible" | "present" | "absent";
718
+ } | {
719
+ type: "event_occurred";
720
+ eventName: string;
721
+ withinMs?: number | undefined;
722
+ } | {
723
+ type: "state_equals";
724
+ key: string;
725
+ value?: unknown;
726
+ } | {
727
+ type: "viewport";
728
+ minWidth?: number | undefined;
729
+ maxWidth?: number | undefined;
730
+ minHeight?: number | undefined;
731
+ maxHeight?: number | undefined;
732
+ } | {
733
+ type: "session_metric";
734
+ key: string;
735
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
736
+ threshold: number;
737
+ } | {
738
+ type: "dismissed";
739
+ key: string;
740
+ inverted?: boolean | undefined;
741
+ } | {
742
+ type: "cooldown_active";
743
+ key: string;
744
+ inverted?: boolean | undefined;
745
+ } | {
746
+ type: "frequency_limit";
747
+ key: string;
748
+ limit: number;
749
+ inverted?: boolean | undefined;
750
+ } | {
751
+ type: "event_count";
752
+ key: string;
753
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
754
+ count: number;
755
+ withinMs?: number | undefined;
756
+ })[];
757
+ value?: unknown;
758
+ }, {
759
+ conditions: ({
760
+ type: "page_url";
761
+ url: string;
762
+ } | {
763
+ type: "route";
764
+ routeId: string;
765
+ } | {
766
+ type: "anchor_visible";
767
+ anchorId: string;
768
+ state: "visible" | "present" | "absent";
769
+ } | {
770
+ type: "event_occurred";
771
+ eventName: string;
772
+ withinMs?: number | undefined;
773
+ } | {
774
+ type: "state_equals";
775
+ key: string;
776
+ value?: unknown;
777
+ } | {
778
+ type: "viewport";
779
+ minWidth?: number | undefined;
780
+ maxWidth?: number | undefined;
781
+ minHeight?: number | undefined;
782
+ maxHeight?: number | undefined;
783
+ } | {
784
+ type: "session_metric";
785
+ key: string;
786
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
787
+ threshold: number;
788
+ } | {
789
+ type: "dismissed";
790
+ key: string;
791
+ inverted?: boolean | undefined;
792
+ } | {
793
+ type: "cooldown_active";
794
+ key: string;
795
+ inverted?: boolean | undefined;
796
+ } | {
797
+ type: "frequency_limit";
798
+ key: string;
799
+ limit: number;
800
+ inverted?: boolean | undefined;
801
+ } | {
802
+ type: "event_count";
803
+ key: string;
804
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
805
+ count: number;
806
+ withinMs?: number | undefined;
807
+ })[];
808
+ value?: unknown;
809
+ }>, "many">;
810
+ default: z.ZodUnknown;
811
+ }, "strip", z.ZodTypeAny, {
812
+ type: "rules";
813
+ rules: {
814
+ conditions: ({
815
+ type: "page_url";
816
+ url: string;
817
+ } | {
818
+ type: "route";
819
+ routeId: string;
820
+ } | {
821
+ type: "anchor_visible";
822
+ anchorId: string;
823
+ state: "visible" | "present" | "absent";
824
+ } | {
825
+ type: "event_occurred";
826
+ eventName: string;
827
+ withinMs?: number | undefined;
828
+ } | {
829
+ type: "state_equals";
830
+ key: string;
831
+ value?: unknown;
832
+ } | {
833
+ type: "viewport";
834
+ minWidth?: number | undefined;
835
+ maxWidth?: number | undefined;
836
+ minHeight?: number | undefined;
837
+ maxHeight?: number | undefined;
838
+ } | {
839
+ type: "session_metric";
840
+ key: string;
841
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
842
+ threshold: number;
843
+ } | {
844
+ type: "dismissed";
845
+ key: string;
846
+ inverted?: boolean | undefined;
847
+ } | {
848
+ type: "cooldown_active";
849
+ key: string;
850
+ inverted?: boolean | undefined;
851
+ } | {
852
+ type: "frequency_limit";
853
+ key: string;
854
+ limit: number;
855
+ inverted?: boolean | undefined;
856
+ } | {
857
+ type: "event_count";
858
+ key: string;
859
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
860
+ count: number;
861
+ withinMs?: number | undefined;
862
+ })[];
863
+ value?: unknown;
864
+ }[];
865
+ default?: unknown;
866
+ }, {
867
+ type: "rules";
868
+ rules: {
869
+ conditions: ({
870
+ type: "page_url";
871
+ url: string;
872
+ } | {
873
+ type: "route";
874
+ routeId: string;
875
+ } | {
876
+ type: "anchor_visible";
877
+ anchorId: string;
878
+ state: "visible" | "present" | "absent";
879
+ } | {
880
+ type: "event_occurred";
881
+ eventName: string;
882
+ withinMs?: number | undefined;
883
+ } | {
884
+ type: "state_equals";
885
+ key: string;
886
+ value?: unknown;
887
+ } | {
888
+ type: "viewport";
889
+ minWidth?: number | undefined;
890
+ maxWidth?: number | undefined;
891
+ minHeight?: number | undefined;
892
+ maxHeight?: number | undefined;
893
+ } | {
894
+ type: "session_metric";
895
+ key: string;
896
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
897
+ threshold: number;
898
+ } | {
899
+ type: "dismissed";
900
+ key: string;
901
+ inverted?: boolean | undefined;
902
+ } | {
903
+ type: "cooldown_active";
904
+ key: string;
905
+ inverted?: boolean | undefined;
906
+ } | {
907
+ type: "frequency_limit";
908
+ key: string;
909
+ limit: number;
910
+ inverted?: boolean | undefined;
911
+ } | {
912
+ type: "event_count";
913
+ key: string;
914
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
915
+ count: number;
916
+ withinMs?: number | undefined;
917
+ })[];
918
+ value?: unknown;
919
+ }[];
920
+ default?: unknown;
921
+ }>;
922
+ export declare const ScoreStrategyZ: z.ZodObject<{
923
+ type: z.ZodLiteral<"score">;
924
+ field: z.ZodString;
925
+ threshold: z.ZodNumber;
926
+ above: z.ZodUnknown;
927
+ below: z.ZodUnknown;
928
+ }, "strip", z.ZodTypeAny, {
929
+ type: "score";
930
+ threshold: number;
931
+ field: string;
932
+ above?: unknown;
933
+ below?: unknown;
934
+ }, {
935
+ type: "score";
936
+ threshold: number;
937
+ field: string;
938
+ above?: unknown;
939
+ below?: unknown;
940
+ }>;
941
+ export declare const ModelStrategyZ: z.ZodObject<{
942
+ type: z.ZodLiteral<"model">;
943
+ modelId: z.ZodString;
944
+ inputs: z.ZodArray<z.ZodString, "many">;
945
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
946
+ default: z.ZodUnknown;
947
+ }, "strip", z.ZodTypeAny, {
948
+ type: "model";
949
+ modelId: string;
950
+ inputs: string[];
951
+ outputMapping: Record<string, unknown>;
952
+ default?: unknown;
953
+ }, {
954
+ type: "model";
955
+ modelId: string;
956
+ inputs: string[];
957
+ outputMapping: Record<string, unknown>;
958
+ default?: unknown;
959
+ }>;
960
+ export declare const ExternalStrategyZ: z.ZodObject<{
961
+ type: z.ZodLiteral<"external">;
962
+ endpoint: z.ZodString;
963
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
964
+ default: z.ZodUnknown;
965
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
966
+ }, "strip", z.ZodTypeAny, {
967
+ type: "external";
968
+ endpoint: string;
969
+ default?: unknown;
970
+ method?: "GET" | "POST" | undefined;
971
+ timeoutMs?: number | undefined;
972
+ }, {
973
+ type: "external";
974
+ endpoint: string;
975
+ default?: unknown;
976
+ method?: "GET" | "POST" | undefined;
977
+ timeoutMs?: number | undefined;
978
+ }>;
979
+ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
980
+ type: z.ZodLiteral<"rules">;
981
+ rules: z.ZodArray<z.ZodObject<{
982
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
983
+ type: z.ZodLiteral<"page_url">;
984
+ url: z.ZodString;
985
+ }, "strip", z.ZodTypeAny, {
986
+ type: "page_url";
987
+ url: string;
988
+ }, {
989
+ type: "page_url";
990
+ url: string;
991
+ }>, z.ZodObject<{
992
+ type: z.ZodLiteral<"route">;
993
+ routeId: z.ZodString;
994
+ }, "strip", z.ZodTypeAny, {
995
+ type: "route";
996
+ routeId: string;
997
+ }, {
998
+ type: "route";
999
+ routeId: string;
1000
+ }>, z.ZodObject<{
1001
+ type: z.ZodLiteral<"anchor_visible">;
1002
+ anchorId: z.ZodString;
1003
+ state: z.ZodEnum<["visible", "present", "absent"]>;
1004
+ }, "strip", z.ZodTypeAny, {
1005
+ type: "anchor_visible";
1006
+ anchorId: string;
1007
+ state: "visible" | "present" | "absent";
1008
+ }, {
1009
+ type: "anchor_visible";
1010
+ anchorId: string;
1011
+ state: "visible" | "present" | "absent";
1012
+ }>, z.ZodObject<{
1013
+ type: z.ZodLiteral<"event_occurred">;
1014
+ eventName: z.ZodString;
1015
+ withinMs: z.ZodOptional<z.ZodNumber>;
1016
+ }, "strip", z.ZodTypeAny, {
1017
+ type: "event_occurred";
1018
+ eventName: string;
1019
+ withinMs?: number | undefined;
1020
+ }, {
1021
+ type: "event_occurred";
1022
+ eventName: string;
1023
+ withinMs?: number | undefined;
1024
+ }>, z.ZodObject<{
1025
+ type: z.ZodLiteral<"state_equals">;
1026
+ key: z.ZodString;
1027
+ value: z.ZodUnknown;
1028
+ }, "strip", z.ZodTypeAny, {
1029
+ type: "state_equals";
1030
+ key: string;
1031
+ value?: unknown;
1032
+ }, {
1033
+ type: "state_equals";
1034
+ key: string;
1035
+ value?: unknown;
1036
+ }>, z.ZodObject<{
1037
+ type: z.ZodLiteral<"viewport">;
1038
+ minWidth: z.ZodOptional<z.ZodNumber>;
1039
+ maxWidth: z.ZodOptional<z.ZodNumber>;
1040
+ minHeight: z.ZodOptional<z.ZodNumber>;
1041
+ maxHeight: z.ZodOptional<z.ZodNumber>;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ type: "viewport";
1044
+ minWidth?: number | undefined;
1045
+ maxWidth?: number | undefined;
1046
+ minHeight?: number | undefined;
1047
+ maxHeight?: number | undefined;
1048
+ }, {
1049
+ type: "viewport";
1050
+ minWidth?: number | undefined;
1051
+ maxWidth?: number | undefined;
1052
+ minHeight?: number | undefined;
1053
+ maxHeight?: number | undefined;
1054
+ }>, z.ZodObject<{
1055
+ type: z.ZodLiteral<"session_metric">;
1056
+ key: z.ZodString;
1057
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1058
+ threshold: z.ZodNumber;
1059
+ }, "strip", z.ZodTypeAny, {
1060
+ type: "session_metric";
1061
+ key: string;
1062
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1063
+ threshold: number;
1064
+ }, {
1065
+ type: "session_metric";
1066
+ key: string;
1067
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1068
+ threshold: number;
1069
+ }>, z.ZodObject<{
1070
+ type: z.ZodLiteral<"dismissed">;
1071
+ key: z.ZodString;
1072
+ inverted: z.ZodOptional<z.ZodBoolean>;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ type: "dismissed";
1075
+ key: string;
1076
+ inverted?: boolean | undefined;
1077
+ }, {
1078
+ type: "dismissed";
1079
+ key: string;
1080
+ inverted?: boolean | undefined;
1081
+ }>, z.ZodObject<{
1082
+ type: z.ZodLiteral<"cooldown_active">;
1083
+ key: z.ZodString;
1084
+ inverted: z.ZodOptional<z.ZodBoolean>;
1085
+ }, "strip", z.ZodTypeAny, {
1086
+ type: "cooldown_active";
1087
+ key: string;
1088
+ inverted?: boolean | undefined;
1089
+ }, {
1090
+ type: "cooldown_active";
1091
+ key: string;
1092
+ inverted?: boolean | undefined;
1093
+ }>, z.ZodObject<{
1094
+ type: z.ZodLiteral<"frequency_limit">;
1095
+ key: z.ZodString;
1096
+ limit: z.ZodNumber;
1097
+ inverted: z.ZodOptional<z.ZodBoolean>;
1098
+ }, "strip", z.ZodTypeAny, {
1099
+ type: "frequency_limit";
1100
+ key: string;
1101
+ limit: number;
1102
+ inverted?: boolean | undefined;
1103
+ }, {
1104
+ type: "frequency_limit";
1105
+ key: string;
1106
+ limit: number;
1107
+ inverted?: boolean | undefined;
1108
+ }>, z.ZodObject<{
1109
+ type: z.ZodLiteral<"event_count">;
1110
+ key: z.ZodString;
1111
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1112
+ count: z.ZodNumber;
1113
+ withinMs: z.ZodOptional<z.ZodNumber>;
1114
+ }, "strip", z.ZodTypeAny, {
1115
+ type: "event_count";
1116
+ key: string;
1117
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1118
+ count: number;
1119
+ withinMs?: number | undefined;
1120
+ }, {
1121
+ type: "event_count";
1122
+ key: string;
1123
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1124
+ count: number;
1125
+ withinMs?: number | undefined;
1126
+ }>]>, "many">;
1127
+ value: z.ZodUnknown;
1128
+ }, "strip", z.ZodTypeAny, {
1129
+ conditions: ({
1130
+ type: "page_url";
1131
+ url: string;
1132
+ } | {
1133
+ type: "route";
1134
+ routeId: string;
1135
+ } | {
1136
+ type: "anchor_visible";
1137
+ anchorId: string;
1138
+ state: "visible" | "present" | "absent";
1139
+ } | {
1140
+ type: "event_occurred";
1141
+ eventName: string;
1142
+ withinMs?: number | undefined;
1143
+ } | {
1144
+ type: "state_equals";
1145
+ key: string;
1146
+ value?: unknown;
1147
+ } | {
1148
+ type: "viewport";
1149
+ minWidth?: number | undefined;
1150
+ maxWidth?: number | undefined;
1151
+ minHeight?: number | undefined;
1152
+ maxHeight?: number | undefined;
1153
+ } | {
1154
+ type: "session_metric";
1155
+ key: string;
1156
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1157
+ threshold: number;
1158
+ } | {
1159
+ type: "dismissed";
1160
+ key: string;
1161
+ inverted?: boolean | undefined;
1162
+ } | {
1163
+ type: "cooldown_active";
1164
+ key: string;
1165
+ inverted?: boolean | undefined;
1166
+ } | {
1167
+ type: "frequency_limit";
1168
+ key: string;
1169
+ limit: number;
1170
+ inverted?: boolean | undefined;
1171
+ } | {
1172
+ type: "event_count";
1173
+ key: string;
1174
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1175
+ count: number;
1176
+ withinMs?: number | undefined;
1177
+ })[];
1178
+ value?: unknown;
1179
+ }, {
1180
+ conditions: ({
1181
+ type: "page_url";
1182
+ url: string;
1183
+ } | {
1184
+ type: "route";
1185
+ routeId: string;
1186
+ } | {
1187
+ type: "anchor_visible";
1188
+ anchorId: string;
1189
+ state: "visible" | "present" | "absent";
1190
+ } | {
1191
+ type: "event_occurred";
1192
+ eventName: string;
1193
+ withinMs?: number | undefined;
1194
+ } | {
1195
+ type: "state_equals";
1196
+ key: string;
1197
+ value?: unknown;
1198
+ } | {
1199
+ type: "viewport";
1200
+ minWidth?: number | undefined;
1201
+ maxWidth?: number | undefined;
1202
+ minHeight?: number | undefined;
1203
+ maxHeight?: number | undefined;
1204
+ } | {
1205
+ type: "session_metric";
1206
+ key: string;
1207
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1208
+ threshold: number;
1209
+ } | {
1210
+ type: "dismissed";
1211
+ key: string;
1212
+ inverted?: boolean | undefined;
1213
+ } | {
1214
+ type: "cooldown_active";
1215
+ key: string;
1216
+ inverted?: boolean | undefined;
1217
+ } | {
1218
+ type: "frequency_limit";
1219
+ key: string;
1220
+ limit: number;
1221
+ inverted?: boolean | undefined;
1222
+ } | {
1223
+ type: "event_count";
1224
+ key: string;
1225
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1226
+ count: number;
1227
+ withinMs?: number | undefined;
1228
+ })[];
1229
+ value?: unknown;
1230
+ }>, "many">;
1231
+ default: z.ZodUnknown;
1232
+ }, "strip", z.ZodTypeAny, {
1233
+ type: "rules";
1234
+ rules: {
1235
+ conditions: ({
1236
+ type: "page_url";
1237
+ url: string;
1238
+ } | {
1239
+ type: "route";
1240
+ routeId: string;
1241
+ } | {
1242
+ type: "anchor_visible";
1243
+ anchorId: string;
1244
+ state: "visible" | "present" | "absent";
1245
+ } | {
1246
+ type: "event_occurred";
1247
+ eventName: string;
1248
+ withinMs?: number | undefined;
1249
+ } | {
1250
+ type: "state_equals";
1251
+ key: string;
1252
+ value?: unknown;
1253
+ } | {
1254
+ type: "viewport";
1255
+ minWidth?: number | undefined;
1256
+ maxWidth?: number | undefined;
1257
+ minHeight?: number | undefined;
1258
+ maxHeight?: number | undefined;
1259
+ } | {
1260
+ type: "session_metric";
1261
+ key: string;
1262
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1263
+ threshold: number;
1264
+ } | {
1265
+ type: "dismissed";
1266
+ key: string;
1267
+ inverted?: boolean | undefined;
1268
+ } | {
1269
+ type: "cooldown_active";
1270
+ key: string;
1271
+ inverted?: boolean | undefined;
1272
+ } | {
1273
+ type: "frequency_limit";
1274
+ key: string;
1275
+ limit: number;
1276
+ inverted?: boolean | undefined;
1277
+ } | {
1278
+ type: "event_count";
1279
+ key: string;
1280
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1281
+ count: number;
1282
+ withinMs?: number | undefined;
1283
+ })[];
1284
+ value?: unknown;
1285
+ }[];
1286
+ default?: unknown;
1287
+ }, {
1288
+ type: "rules";
1289
+ rules: {
1290
+ conditions: ({
1291
+ type: "page_url";
1292
+ url: string;
1293
+ } | {
1294
+ type: "route";
1295
+ routeId: string;
1296
+ } | {
1297
+ type: "anchor_visible";
1298
+ anchorId: string;
1299
+ state: "visible" | "present" | "absent";
1300
+ } | {
1301
+ type: "event_occurred";
1302
+ eventName: string;
1303
+ withinMs?: number | undefined;
1304
+ } | {
1305
+ type: "state_equals";
1306
+ key: string;
1307
+ value?: unknown;
1308
+ } | {
1309
+ type: "viewport";
1310
+ minWidth?: number | undefined;
1311
+ maxWidth?: number | undefined;
1312
+ minHeight?: number | undefined;
1313
+ maxHeight?: number | undefined;
1314
+ } | {
1315
+ type: "session_metric";
1316
+ key: string;
1317
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1318
+ threshold: number;
1319
+ } | {
1320
+ type: "dismissed";
1321
+ key: string;
1322
+ inverted?: boolean | undefined;
1323
+ } | {
1324
+ type: "cooldown_active";
1325
+ key: string;
1326
+ inverted?: boolean | undefined;
1327
+ } | {
1328
+ type: "frequency_limit";
1329
+ key: string;
1330
+ limit: number;
1331
+ inverted?: boolean | undefined;
1332
+ } | {
1333
+ type: "event_count";
1334
+ key: string;
1335
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1336
+ count: number;
1337
+ withinMs?: number | undefined;
1338
+ })[];
1339
+ value?: unknown;
1340
+ }[];
1341
+ default?: unknown;
1342
+ }>, z.ZodObject<{
1343
+ type: z.ZodLiteral<"score">;
1344
+ field: z.ZodString;
1345
+ threshold: z.ZodNumber;
1346
+ above: z.ZodUnknown;
1347
+ below: z.ZodUnknown;
1348
+ }, "strip", z.ZodTypeAny, {
1349
+ type: "score";
1350
+ threshold: number;
1351
+ field: string;
1352
+ above?: unknown;
1353
+ below?: unknown;
1354
+ }, {
1355
+ type: "score";
1356
+ threshold: number;
1357
+ field: string;
1358
+ above?: unknown;
1359
+ below?: unknown;
1360
+ }>, z.ZodObject<{
1361
+ type: z.ZodLiteral<"model">;
1362
+ modelId: z.ZodString;
1363
+ inputs: z.ZodArray<z.ZodString, "many">;
1364
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1365
+ default: z.ZodUnknown;
1366
+ }, "strip", z.ZodTypeAny, {
1367
+ type: "model";
1368
+ modelId: string;
1369
+ inputs: string[];
1370
+ outputMapping: Record<string, unknown>;
1371
+ default?: unknown;
1372
+ }, {
1373
+ type: "model";
1374
+ modelId: string;
1375
+ inputs: string[];
1376
+ outputMapping: Record<string, unknown>;
1377
+ default?: unknown;
1378
+ }>, z.ZodObject<{
1379
+ type: z.ZodLiteral<"external">;
1380
+ endpoint: z.ZodString;
1381
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1382
+ default: z.ZodUnknown;
1383
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1384
+ }, "strip", z.ZodTypeAny, {
1385
+ type: "external";
1386
+ endpoint: string;
1387
+ default?: unknown;
1388
+ method?: "GET" | "POST" | undefined;
1389
+ timeoutMs?: number | undefined;
1390
+ }, {
1391
+ type: "external";
1392
+ endpoint: string;
1393
+ default?: unknown;
1394
+ method?: "GET" | "POST" | undefined;
1395
+ timeoutMs?: number | undefined;
1396
+ }>]>;
1397
+ /** Scopes a widget to specific events/URLs. */
1398
+ export declare const EventScopeZ: z.ZodObject<{
1399
+ events: z.ZodArray<z.ZodString, "many">;
1400
+ urlContains: z.ZodOptional<z.ZodString>;
1401
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1402
+ }, "strip", z.ZodTypeAny, {
1403
+ events: string[];
1404
+ urlContains?: string | undefined;
1405
+ props?: Record<string, string | number | boolean> | undefined;
1406
+ }, {
1407
+ events: string[];
1408
+ urlContains?: string | undefined;
1409
+ props?: Record<string, string | number | boolean> | undefined;
1410
+ }>;
1411
+ /** Toast notification config for showWhen transitions. */
1412
+ export declare const NotifyZ: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1413
+ title: z.ZodOptional<z.ZodString>;
1414
+ body: z.ZodOptional<z.ZodString>;
1415
+ icon: z.ZodOptional<z.ZodString>;
1416
+ }, "strip", z.ZodTypeAny, {
1417
+ title?: string | undefined;
1418
+ body?: string | undefined;
1419
+ icon?: string | undefined;
1420
+ }, {
1421
+ title?: string | undefined;
1422
+ body?: string | undefined;
1423
+ icon?: string | undefined;
1424
+ }>>>;
1425
+ export type ConditionSchema = z.infer<typeof ConditionZ>;
1426
+ export type RuleSchema = z.infer<typeof RuleZ>;
1427
+ export type DecisionStrategySchema = z.infer<typeof DecisionStrategyZ>;
1428
+ export type EventScopeSchema = z.infer<typeof EventScopeZ>;