@syntrologie/runtime-sdk 2.4.1 → 2.6.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CAPABILITIES.md +66 -1
  2. package/dist/SmartCanvasApp.d.ts +5 -3
  3. package/dist/actions/executors/index.d.ts +1 -2
  4. package/dist/actions/index.d.ts +2 -2
  5. package/dist/actions/schema.d.ts +19111 -20709
  6. package/dist/actions/schema.js +5 -2
  7. package/dist/actions/types.d.ts +45 -48
  8. package/dist/anchor/AnchorResolver.d.ts +18 -0
  9. package/dist/anchor/index.d.ts +2 -0
  10. package/dist/api.d.ts +3 -8
  11. package/dist/apps/examples/gamification-app.example.d.ts +8 -8
  12. package/dist/{chunk-4NYS7GAW.js → chunk-BU4Z6PD7.js} +45 -7
  13. package/dist/chunk-BU4Z6PD7.js.map +7 -0
  14. package/dist/{chunk-QGWATS3Z.js → chunk-Q4WGXNKC.js} +2775 -1052
  15. package/dist/chunk-Q4WGXNKC.js.map +7 -0
  16. package/dist/{chunk-OGTCFYR3.js → chunk-R5DNAIRI.js} +45 -34
  17. package/dist/chunk-R5DNAIRI.js.map +7 -0
  18. package/dist/chunk-XDYJ64IN.js +178 -0
  19. package/dist/chunk-XDYJ64IN.js.map +7 -0
  20. package/dist/components/ShadowCanvasOverlay.d.ts +2 -20
  21. package/dist/components/TileIcon.d.ts +14 -0
  22. package/dist/config/schema.d.ts +5529 -3620
  23. package/dist/config/schema.js +21 -61
  24. package/dist/config/schema.js.map +3 -3
  25. package/dist/context/schema.d.ts +16 -16
  26. package/dist/decisions/schema.d.ts +357 -2789
  27. package/dist/decisions/schema.js +7 -1
  28. package/dist/decisions/types.d.ts +24 -2
  29. package/dist/events/registerConfigPredicates.d.ts +7 -10
  30. package/dist/events/schema.d.ts +12 -12
  31. package/dist/experiments/adapters/growthbook.d.ts +2 -0
  32. package/dist/experiments/types.d.ts +7 -0
  33. package/dist/hooks/useShadowCanvasConfig.d.ts +6 -4
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +154 -186
  36. package/dist/index.js.map +3 -3
  37. package/dist/overlays/schema.d.ts +70 -70
  38. package/dist/react.js +4 -3
  39. package/dist/react.js.map +1 -1
  40. package/dist/runtime.d.ts +3 -0
  41. package/dist/smart-canvas.esm.js +123 -84
  42. package/dist/smart-canvas.esm.js.map +4 -4
  43. package/dist/smart-canvas.js +3271 -1210
  44. package/dist/smart-canvas.js.map +4 -4
  45. package/dist/smart-canvas.min.js +123 -84
  46. package/dist/smart-canvas.min.js.map +4 -4
  47. package/dist/surfaces/types.d.ts +2 -1
  48. package/dist/theme/ThemeProvider.d.ts +11 -16
  49. package/dist/theme/defaultTheme.d.ts +6 -1
  50. package/dist/theme/index.d.ts +3 -4
  51. package/dist/theme/types.d.ts +11 -0
  52. package/dist/version.d.ts +1 -1
  53. package/dist/widgets/WidgetRegistry.d.ts +1 -0
  54. package/package.json +9 -8
  55. package/schema/canvas-config.schema.json +10583 -1049
  56. package/scripts/validate-config.mjs +180 -0
  57. package/dist/actions/executors/tour.d.ts +0 -18
  58. package/dist/chunk-4NYS7GAW.js.map +0 -7
  59. package/dist/chunk-OGTCFYR3.js.map +0 -7
  60. package/dist/chunk-QGWATS3Z.js.map +0 -7
  61. package/dist/hooks/useHostPatches.d.ts +0 -9
  62. package/dist/theme/extractHostTheme.d.ts +0 -14
@@ -1,2007 +1,61 @@
1
1
  /**
2
2
  * Zod schemas for decision strategy validation.
3
- */
4
- import { z } from 'zod';
5
- export declare const PageUrlConditionZ: z.ZodObject<{
6
- type: z.ZodLiteral<"page_url">;
7
- url: z.ZodString;
8
- }, "strip", z.ZodTypeAny, {
9
- url: string;
10
- type: "page_url";
11
- }, {
12
- url: string;
13
- type: "page_url";
14
- }>;
15
- export declare const RouteConditionZ: z.ZodObject<{
16
- type: z.ZodLiteral<"route">;
17
- routeId: z.ZodString;
18
- }, "strip", z.ZodTypeAny, {
19
- type: "route";
20
- routeId: string;
21
- }, {
22
- type: "route";
23
- routeId: string;
24
- }>;
25
- export declare const AnchorVisibleConditionZ: z.ZodObject<{
26
- type: z.ZodLiteral<"anchor_visible">;
27
- anchorId: z.ZodString;
28
- state: z.ZodEnum<["visible", "present", "absent"]>;
29
- }, "strip", z.ZodTypeAny, {
30
- anchorId: string;
31
- state: "visible" | "present" | "absent";
32
- type: "anchor_visible";
33
- }, {
34
- anchorId: string;
35
- state: "visible" | "present" | "absent";
36
- type: "anchor_visible";
37
- }>;
38
- export declare const EventOccurredConditionZ: z.ZodObject<{
39
- type: z.ZodLiteral<"event_occurred">;
40
- eventName: z.ZodString;
41
- withinMs: z.ZodOptional<z.ZodNumber>;
42
- }, "strip", z.ZodTypeAny, {
43
- type: "event_occurred";
44
- eventName: string;
45
- withinMs?: number | undefined;
46
- }, {
47
- type: "event_occurred";
48
- eventName: string;
49
- withinMs?: number | undefined;
50
- }>;
51
- export declare const StateEqualsConditionZ: z.ZodObject<{
52
- type: z.ZodLiteral<"state_equals">;
53
- key: z.ZodString;
54
- value: z.ZodUnknown;
55
- }, "strip", z.ZodTypeAny, {
56
- type: "state_equals";
57
- key: string;
58
- value?: unknown;
59
- }, {
60
- type: "state_equals";
61
- key: string;
62
- value?: unknown;
63
- }>;
64
- export declare const ViewportConditionZ: z.ZodObject<{
65
- type: z.ZodLiteral<"viewport">;
66
- minWidth: z.ZodOptional<z.ZodNumber>;
67
- maxWidth: z.ZodOptional<z.ZodNumber>;
68
- minHeight: z.ZodOptional<z.ZodNumber>;
69
- maxHeight: z.ZodOptional<z.ZodNumber>;
70
- }, "strip", z.ZodTypeAny, {
71
- type: "viewport";
72
- minWidth?: number | undefined;
73
- maxWidth?: number | undefined;
74
- minHeight?: number | undefined;
75
- maxHeight?: number | undefined;
76
- }, {
77
- type: "viewport";
78
- minWidth?: number | undefined;
79
- maxWidth?: number | undefined;
80
- minHeight?: number | undefined;
81
- maxHeight?: number | undefined;
82
- }>;
83
- export declare const SessionMetricConditionZ: z.ZodObject<{
84
- type: z.ZodLiteral<"session_metric">;
85
- key: z.ZodString;
86
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
87
- threshold: z.ZodNumber;
88
- }, "strip", z.ZodTypeAny, {
89
- type: "session_metric";
90
- key: string;
91
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
92
- threshold: number;
93
- }, {
94
- type: "session_metric";
95
- key: string;
96
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
97
- threshold: number;
98
- }>;
99
- export declare const DismissedConditionZ: z.ZodObject<{
100
- type: z.ZodLiteral<"dismissed">;
101
- key: z.ZodString;
102
- inverted: z.ZodOptional<z.ZodBoolean>;
103
- }, "strip", z.ZodTypeAny, {
104
- type: "dismissed";
105
- key: string;
106
- inverted?: boolean | undefined;
107
- }, {
108
- type: "dismissed";
109
- key: string;
110
- inverted?: boolean | undefined;
111
- }>;
112
- export declare const CooldownActiveConditionZ: z.ZodObject<{
113
- type: z.ZodLiteral<"cooldown_active">;
114
- key: z.ZodString;
115
- inverted: z.ZodOptional<z.ZodBoolean>;
116
- }, "strip", z.ZodTypeAny, {
117
- type: "cooldown_active";
118
- key: string;
119
- inverted?: boolean | undefined;
120
- }, {
121
- type: "cooldown_active";
122
- key: string;
123
- inverted?: boolean | undefined;
124
- }>;
125
- export declare const FrequencyLimitConditionZ: z.ZodObject<{
126
- type: z.ZodLiteral<"frequency_limit">;
127
- key: z.ZodString;
128
- limit: z.ZodNumber;
129
- inverted: z.ZodOptional<z.ZodBoolean>;
130
- }, "strip", z.ZodTypeAny, {
131
- type: "frequency_limit";
132
- key: string;
133
- limit: number;
134
- inverted?: boolean | undefined;
135
- }, {
136
- type: "frequency_limit";
137
- key: string;
138
- limit: number;
139
- inverted?: boolean | undefined;
140
- }>;
141
- export declare const EventCountConditionZ: z.ZodObject<{
142
- type: z.ZodLiteral<"event_count">;
143
- key: z.ZodString;
144
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
145
- count: z.ZodNumber;
146
- withinMs: z.ZodOptional<z.ZodNumber>;
147
- }, "strip", z.ZodTypeAny, {
148
- type: "event_count";
149
- key: string;
150
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
151
- count: number;
152
- withinMs?: number | undefined;
153
- }, {
154
- type: "event_count";
155
- key: string;
156
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
157
- count: number;
158
- withinMs?: number | undefined;
159
- }>;
160
- export declare const ConditionZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
161
- type: z.ZodLiteral<"page_url">;
162
- url: z.ZodString;
163
- }, "strip", z.ZodTypeAny, {
164
- url: string;
165
- type: "page_url";
166
- }, {
167
- url: string;
168
- type: "page_url";
169
- }>, z.ZodObject<{
170
- type: z.ZodLiteral<"route">;
171
- routeId: z.ZodString;
172
- }, "strip", z.ZodTypeAny, {
173
- type: "route";
174
- routeId: string;
175
- }, {
176
- type: "route";
177
- routeId: string;
178
- }>, z.ZodObject<{
179
- type: z.ZodLiteral<"anchor_visible">;
180
- anchorId: z.ZodString;
181
- state: z.ZodEnum<["visible", "present", "absent"]>;
182
- }, "strip", z.ZodTypeAny, {
183
- anchorId: string;
184
- state: "visible" | "present" | "absent";
185
- type: "anchor_visible";
186
- }, {
187
- anchorId: string;
188
- state: "visible" | "present" | "absent";
189
- type: "anchor_visible";
190
- }>, z.ZodObject<{
191
- type: z.ZodLiteral<"event_occurred">;
192
- eventName: z.ZodString;
193
- withinMs: z.ZodOptional<z.ZodNumber>;
194
- }, "strip", z.ZodTypeAny, {
195
- type: "event_occurred";
196
- eventName: string;
197
- withinMs?: number | undefined;
198
- }, {
199
- type: "event_occurred";
200
- eventName: string;
201
- withinMs?: number | undefined;
202
- }>, z.ZodObject<{
203
- type: z.ZodLiteral<"state_equals">;
204
- key: z.ZodString;
205
- value: z.ZodUnknown;
206
- }, "strip", z.ZodTypeAny, {
207
- type: "state_equals";
208
- key: string;
209
- value?: unknown;
210
- }, {
211
- type: "state_equals";
212
- key: string;
213
- value?: unknown;
214
- }>, z.ZodObject<{
215
- type: z.ZodLiteral<"viewport">;
216
- minWidth: z.ZodOptional<z.ZodNumber>;
217
- maxWidth: z.ZodOptional<z.ZodNumber>;
218
- minHeight: z.ZodOptional<z.ZodNumber>;
219
- maxHeight: z.ZodOptional<z.ZodNumber>;
220
- }, "strip", z.ZodTypeAny, {
221
- type: "viewport";
222
- minWidth?: number | undefined;
223
- maxWidth?: number | undefined;
224
- minHeight?: number | undefined;
225
- maxHeight?: number | undefined;
226
- }, {
227
- type: "viewport";
228
- minWidth?: number | undefined;
229
- maxWidth?: number | undefined;
230
- minHeight?: number | undefined;
231
- maxHeight?: number | undefined;
232
- }>, z.ZodObject<{
233
- type: z.ZodLiteral<"session_metric">;
234
- key: z.ZodString;
235
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
236
- threshold: z.ZodNumber;
237
- }, "strip", z.ZodTypeAny, {
238
- type: "session_metric";
239
- key: string;
240
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
241
- threshold: number;
242
- }, {
243
- type: "session_metric";
244
- key: string;
245
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
246
- threshold: number;
247
- }>, z.ZodObject<{
248
- type: z.ZodLiteral<"dismissed">;
249
- key: z.ZodString;
250
- inverted: z.ZodOptional<z.ZodBoolean>;
251
- }, "strip", z.ZodTypeAny, {
252
- type: "dismissed";
253
- key: string;
254
- inverted?: boolean | undefined;
255
- }, {
256
- type: "dismissed";
257
- key: string;
258
- inverted?: boolean | undefined;
259
- }>, z.ZodObject<{
260
- type: z.ZodLiteral<"cooldown_active">;
261
- key: z.ZodString;
262
- inverted: z.ZodOptional<z.ZodBoolean>;
263
- }, "strip", z.ZodTypeAny, {
264
- type: "cooldown_active";
265
- key: string;
266
- inverted?: boolean | undefined;
267
- }, {
268
- type: "cooldown_active";
269
- key: string;
270
- inverted?: boolean | undefined;
271
- }>, z.ZodObject<{
272
- type: z.ZodLiteral<"frequency_limit">;
273
- key: z.ZodString;
274
- limit: z.ZodNumber;
275
- inverted: z.ZodOptional<z.ZodBoolean>;
276
- }, "strip", z.ZodTypeAny, {
277
- type: "frequency_limit";
278
- key: string;
279
- limit: number;
280
- inverted?: boolean | undefined;
281
- }, {
282
- type: "frequency_limit";
283
- key: string;
284
- limit: number;
285
- inverted?: boolean | undefined;
286
- }>, z.ZodObject<{
287
- type: z.ZodLiteral<"event_count">;
288
- key: z.ZodString;
289
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
290
- count: z.ZodNumber;
291
- withinMs: z.ZodOptional<z.ZodNumber>;
292
- }, "strip", z.ZodTypeAny, {
293
- type: "event_count";
294
- key: string;
295
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
296
- count: number;
297
- withinMs?: number | undefined;
298
- }, {
299
- type: "event_count";
300
- key: string;
301
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
302
- count: number;
303
- withinMs?: number | undefined;
304
- }>]>;
305
- export declare const RuleZ: z.ZodObject<{
306
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
307
- type: z.ZodLiteral<"page_url">;
308
- url: z.ZodString;
309
- }, "strip", z.ZodTypeAny, {
310
- url: string;
311
- type: "page_url";
312
- }, {
313
- url: string;
314
- type: "page_url";
315
- }>, z.ZodObject<{
316
- type: z.ZodLiteral<"route">;
317
- routeId: z.ZodString;
318
- }, "strip", z.ZodTypeAny, {
319
- type: "route";
320
- routeId: string;
321
- }, {
322
- type: "route";
323
- routeId: string;
324
- }>, z.ZodObject<{
325
- type: z.ZodLiteral<"anchor_visible">;
326
- anchorId: z.ZodString;
327
- state: z.ZodEnum<["visible", "present", "absent"]>;
328
- }, "strip", z.ZodTypeAny, {
329
- anchorId: string;
330
- state: "visible" | "present" | "absent";
331
- type: "anchor_visible";
332
- }, {
333
- anchorId: string;
334
- state: "visible" | "present" | "absent";
335
- type: "anchor_visible";
336
- }>, z.ZodObject<{
337
- type: z.ZodLiteral<"event_occurred">;
338
- eventName: z.ZodString;
339
- withinMs: z.ZodOptional<z.ZodNumber>;
340
- }, "strip", z.ZodTypeAny, {
341
- type: "event_occurred";
342
- eventName: string;
343
- withinMs?: number | undefined;
344
- }, {
345
- type: "event_occurred";
346
- eventName: string;
347
- withinMs?: number | undefined;
348
- }>, z.ZodObject<{
349
- type: z.ZodLiteral<"state_equals">;
350
- key: z.ZodString;
351
- value: z.ZodUnknown;
352
- }, "strip", z.ZodTypeAny, {
353
- type: "state_equals";
354
- key: string;
355
- value?: unknown;
356
- }, {
357
- type: "state_equals";
358
- key: string;
359
- value?: unknown;
360
- }>, z.ZodObject<{
361
- type: z.ZodLiteral<"viewport">;
362
- minWidth: z.ZodOptional<z.ZodNumber>;
363
- maxWidth: z.ZodOptional<z.ZodNumber>;
364
- minHeight: z.ZodOptional<z.ZodNumber>;
365
- maxHeight: z.ZodOptional<z.ZodNumber>;
366
- }, "strip", z.ZodTypeAny, {
367
- type: "viewport";
368
- minWidth?: number | undefined;
369
- maxWidth?: number | undefined;
370
- minHeight?: number | undefined;
371
- maxHeight?: number | undefined;
372
- }, {
373
- type: "viewport";
374
- minWidth?: number | undefined;
375
- maxWidth?: number | undefined;
376
- minHeight?: number | undefined;
377
- maxHeight?: number | undefined;
378
- }>, z.ZodObject<{
379
- type: z.ZodLiteral<"session_metric">;
380
- key: z.ZodString;
381
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
382
- threshold: z.ZodNumber;
383
- }, "strip", z.ZodTypeAny, {
384
- type: "session_metric";
385
- key: string;
386
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
387
- threshold: number;
388
- }, {
389
- type: "session_metric";
390
- key: string;
391
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
392
- threshold: number;
393
- }>, z.ZodObject<{
394
- type: z.ZodLiteral<"dismissed">;
395
- key: z.ZodString;
396
- inverted: z.ZodOptional<z.ZodBoolean>;
397
- }, "strip", z.ZodTypeAny, {
398
- type: "dismissed";
399
- key: string;
400
- inverted?: boolean | undefined;
401
- }, {
402
- type: "dismissed";
403
- key: string;
404
- inverted?: boolean | undefined;
405
- }>, z.ZodObject<{
406
- type: z.ZodLiteral<"cooldown_active">;
407
- key: z.ZodString;
408
- inverted: z.ZodOptional<z.ZodBoolean>;
409
- }, "strip", z.ZodTypeAny, {
410
- type: "cooldown_active";
411
- key: string;
412
- inverted?: boolean | undefined;
413
- }, {
414
- type: "cooldown_active";
415
- key: string;
416
- inverted?: boolean | undefined;
417
- }>, z.ZodObject<{
418
- type: z.ZodLiteral<"frequency_limit">;
419
- key: z.ZodString;
420
- limit: z.ZodNumber;
421
- inverted: z.ZodOptional<z.ZodBoolean>;
422
- }, "strip", z.ZodTypeAny, {
423
- type: "frequency_limit";
424
- key: string;
425
- limit: number;
426
- inverted?: boolean | undefined;
427
- }, {
428
- type: "frequency_limit";
429
- key: string;
430
- limit: number;
431
- inverted?: boolean | undefined;
432
- }>, z.ZodObject<{
433
- type: z.ZodLiteral<"event_count">;
434
- key: z.ZodString;
435
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
436
- count: z.ZodNumber;
437
- withinMs: z.ZodOptional<z.ZodNumber>;
438
- }, "strip", z.ZodTypeAny, {
439
- type: "event_count";
440
- key: string;
441
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
442
- count: number;
443
- withinMs?: number | undefined;
444
- }, {
445
- type: "event_count";
446
- key: string;
447
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
448
- count: number;
449
- withinMs?: number | undefined;
450
- }>]>, "many">;
451
- value: z.ZodUnknown;
452
- }, "strip", z.ZodTypeAny, {
453
- conditions: ({
454
- url: string;
455
- type: "page_url";
456
- } | {
457
- type: "route";
458
- routeId: string;
459
- } | {
460
- anchorId: string;
461
- state: "visible" | "present" | "absent";
462
- type: "anchor_visible";
463
- } | {
464
- type: "event_occurred";
465
- eventName: string;
466
- withinMs?: number | undefined;
467
- } | {
468
- type: "state_equals";
469
- key: string;
470
- value?: unknown;
471
- } | {
472
- type: "viewport";
473
- minWidth?: number | undefined;
474
- maxWidth?: number | undefined;
475
- minHeight?: number | undefined;
476
- maxHeight?: number | undefined;
477
- } | {
478
- type: "session_metric";
479
- key: string;
480
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
481
- threshold: number;
482
- } | {
483
- type: "dismissed";
484
- key: string;
485
- inverted?: boolean | undefined;
486
- } | {
487
- type: "cooldown_active";
488
- key: string;
489
- inverted?: boolean | undefined;
490
- } | {
491
- type: "frequency_limit";
492
- key: string;
493
- limit: number;
494
- inverted?: boolean | undefined;
495
- } | {
496
- type: "event_count";
497
- key: string;
498
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
499
- count: number;
500
- withinMs?: number | undefined;
501
- })[];
502
- value?: unknown;
503
- }, {
504
- conditions: ({
505
- url: string;
506
- type: "page_url";
507
- } | {
508
- type: "route";
509
- routeId: string;
510
- } | {
511
- anchorId: string;
512
- state: "visible" | "present" | "absent";
513
- type: "anchor_visible";
514
- } | {
515
- type: "event_occurred";
516
- eventName: string;
517
- withinMs?: number | undefined;
518
- } | {
519
- type: "state_equals";
520
- key: string;
521
- value?: unknown;
522
- } | {
523
- type: "viewport";
524
- minWidth?: number | undefined;
525
- maxWidth?: number | undefined;
526
- minHeight?: number | undefined;
527
- maxHeight?: number | undefined;
528
- } | {
529
- type: "session_metric";
530
- key: string;
531
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
532
- threshold: number;
533
- } | {
534
- type: "dismissed";
535
- key: string;
536
- inverted?: boolean | undefined;
537
- } | {
538
- type: "cooldown_active";
539
- key: string;
540
- inverted?: boolean | undefined;
541
- } | {
542
- type: "frequency_limit";
543
- key: string;
544
- limit: number;
545
- inverted?: boolean | undefined;
546
- } | {
547
- type: "event_count";
548
- key: string;
549
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
550
- count: number;
551
- withinMs?: number | undefined;
552
- })[];
553
- value?: unknown;
554
- }>;
555
- export declare const RuleStrategyZ: z.ZodObject<{
556
- type: z.ZodLiteral<"rules">;
557
- rules: z.ZodArray<z.ZodObject<{
558
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
559
- type: z.ZodLiteral<"page_url">;
560
- url: z.ZodString;
561
- }, "strip", z.ZodTypeAny, {
562
- url: string;
563
- type: "page_url";
564
- }, {
565
- url: string;
566
- type: "page_url";
567
- }>, z.ZodObject<{
568
- type: z.ZodLiteral<"route">;
569
- routeId: z.ZodString;
570
- }, "strip", z.ZodTypeAny, {
571
- type: "route";
572
- routeId: string;
573
- }, {
574
- type: "route";
575
- routeId: string;
576
- }>, z.ZodObject<{
577
- type: z.ZodLiteral<"anchor_visible">;
578
- anchorId: z.ZodString;
579
- state: z.ZodEnum<["visible", "present", "absent"]>;
580
- }, "strip", z.ZodTypeAny, {
581
- anchorId: string;
582
- state: "visible" | "present" | "absent";
583
- type: "anchor_visible";
584
- }, {
585
- anchorId: string;
586
- state: "visible" | "present" | "absent";
587
- type: "anchor_visible";
588
- }>, z.ZodObject<{
589
- type: z.ZodLiteral<"event_occurred">;
590
- eventName: z.ZodString;
591
- withinMs: z.ZodOptional<z.ZodNumber>;
592
- }, "strip", z.ZodTypeAny, {
593
- type: "event_occurred";
594
- eventName: string;
595
- withinMs?: number | undefined;
596
- }, {
597
- type: "event_occurred";
598
- eventName: string;
599
- withinMs?: number | undefined;
600
- }>, z.ZodObject<{
601
- type: z.ZodLiteral<"state_equals">;
602
- key: z.ZodString;
603
- value: z.ZodUnknown;
604
- }, "strip", z.ZodTypeAny, {
605
- type: "state_equals";
606
- key: string;
607
- value?: unknown;
608
- }, {
609
- type: "state_equals";
610
- key: string;
611
- value?: unknown;
612
- }>, z.ZodObject<{
613
- type: z.ZodLiteral<"viewport">;
614
- minWidth: z.ZodOptional<z.ZodNumber>;
615
- maxWidth: z.ZodOptional<z.ZodNumber>;
616
- minHeight: z.ZodOptional<z.ZodNumber>;
617
- maxHeight: z.ZodOptional<z.ZodNumber>;
618
- }, "strip", z.ZodTypeAny, {
619
- type: "viewport";
620
- minWidth?: number | undefined;
621
- maxWidth?: number | undefined;
622
- minHeight?: number | undefined;
623
- maxHeight?: number | undefined;
624
- }, {
625
- type: "viewport";
626
- minWidth?: number | undefined;
627
- maxWidth?: number | undefined;
628
- minHeight?: number | undefined;
629
- maxHeight?: number | undefined;
630
- }>, z.ZodObject<{
631
- type: z.ZodLiteral<"session_metric">;
632
- key: z.ZodString;
633
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
634
- threshold: z.ZodNumber;
635
- }, "strip", z.ZodTypeAny, {
636
- type: "session_metric";
637
- key: string;
638
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
639
- threshold: number;
640
- }, {
641
- type: "session_metric";
642
- key: string;
643
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
644
- threshold: number;
645
- }>, z.ZodObject<{
646
- type: z.ZodLiteral<"dismissed">;
647
- key: z.ZodString;
648
- inverted: z.ZodOptional<z.ZodBoolean>;
649
- }, "strip", z.ZodTypeAny, {
650
- type: "dismissed";
651
- key: string;
652
- inverted?: boolean | undefined;
653
- }, {
654
- type: "dismissed";
655
- key: string;
656
- inverted?: boolean | undefined;
657
- }>, z.ZodObject<{
658
- type: z.ZodLiteral<"cooldown_active">;
659
- key: z.ZodString;
660
- inverted: z.ZodOptional<z.ZodBoolean>;
661
- }, "strip", z.ZodTypeAny, {
662
- type: "cooldown_active";
663
- key: string;
664
- inverted?: boolean | undefined;
665
- }, {
666
- type: "cooldown_active";
667
- key: string;
668
- inverted?: boolean | undefined;
669
- }>, z.ZodObject<{
670
- type: z.ZodLiteral<"frequency_limit">;
671
- key: z.ZodString;
672
- limit: z.ZodNumber;
673
- inverted: z.ZodOptional<z.ZodBoolean>;
674
- }, "strip", z.ZodTypeAny, {
675
- type: "frequency_limit";
676
- key: string;
677
- limit: number;
678
- inverted?: boolean | undefined;
679
- }, {
680
- type: "frequency_limit";
681
- key: string;
682
- limit: number;
683
- inverted?: boolean | undefined;
684
- }>, z.ZodObject<{
685
- type: z.ZodLiteral<"event_count">;
686
- key: z.ZodString;
687
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
688
- count: z.ZodNumber;
689
- withinMs: z.ZodOptional<z.ZodNumber>;
690
- }, "strip", z.ZodTypeAny, {
691
- type: "event_count";
692
- key: string;
693
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
694
- count: number;
695
- withinMs?: number | undefined;
696
- }, {
697
- type: "event_count";
698
- key: string;
699
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
700
- count: number;
701
- withinMs?: number | undefined;
702
- }>]>, "many">;
703
- value: z.ZodUnknown;
704
- }, "strip", z.ZodTypeAny, {
705
- conditions: ({
706
- url: string;
707
- type: "page_url";
708
- } | {
709
- type: "route";
710
- routeId: string;
711
- } | {
712
- anchorId: string;
713
- state: "visible" | "present" | "absent";
714
- type: "anchor_visible";
715
- } | {
716
- type: "event_occurred";
717
- eventName: string;
718
- withinMs?: number | undefined;
719
- } | {
720
- type: "state_equals";
721
- key: string;
722
- value?: unknown;
723
- } | {
724
- type: "viewport";
725
- minWidth?: number | undefined;
726
- maxWidth?: number | undefined;
727
- minHeight?: number | undefined;
728
- maxHeight?: number | undefined;
729
- } | {
730
- type: "session_metric";
731
- key: string;
732
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
733
- threshold: number;
734
- } | {
735
- type: "dismissed";
736
- key: string;
737
- inverted?: boolean | undefined;
738
- } | {
739
- type: "cooldown_active";
740
- key: string;
741
- inverted?: boolean | undefined;
742
- } | {
743
- type: "frequency_limit";
744
- key: string;
745
- limit: number;
746
- inverted?: boolean | undefined;
747
- } | {
748
- type: "event_count";
749
- key: string;
750
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
751
- count: number;
752
- withinMs?: number | undefined;
753
- })[];
754
- value?: unknown;
755
- }, {
756
- conditions: ({
757
- url: string;
758
- type: "page_url";
759
- } | {
760
- type: "route";
761
- routeId: string;
762
- } | {
763
- anchorId: string;
764
- state: "visible" | "present" | "absent";
765
- type: "anchor_visible";
766
- } | {
767
- type: "event_occurred";
768
- eventName: string;
769
- withinMs?: number | undefined;
770
- } | {
771
- type: "state_equals";
772
- key: string;
773
- value?: unknown;
774
- } | {
775
- type: "viewport";
776
- minWidth?: number | undefined;
777
- maxWidth?: number | undefined;
778
- minHeight?: number | undefined;
779
- maxHeight?: number | undefined;
780
- } | {
781
- type: "session_metric";
782
- key: string;
783
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
784
- threshold: number;
785
- } | {
786
- type: "dismissed";
787
- key: string;
788
- inverted?: boolean | undefined;
789
- } | {
790
- type: "cooldown_active";
791
- key: string;
792
- inverted?: boolean | undefined;
793
- } | {
794
- type: "frequency_limit";
795
- key: string;
796
- limit: number;
797
- inverted?: boolean | undefined;
798
- } | {
799
- type: "event_count";
800
- key: string;
801
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
802
- count: number;
803
- withinMs?: number | undefined;
804
- })[];
805
- value?: unknown;
806
- }>, "many">;
807
- default: z.ZodUnknown;
808
- }, "strip", z.ZodTypeAny, {
809
- type: "rules";
810
- rules: {
811
- conditions: ({
812
- url: string;
813
- type: "page_url";
814
- } | {
815
- type: "route";
816
- routeId: string;
817
- } | {
818
- anchorId: string;
819
- state: "visible" | "present" | "absent";
820
- type: "anchor_visible";
821
- } | {
822
- type: "event_occurred";
823
- eventName: string;
824
- withinMs?: number | undefined;
825
- } | {
826
- type: "state_equals";
827
- key: string;
828
- value?: unknown;
829
- } | {
830
- type: "viewport";
831
- minWidth?: number | undefined;
832
- maxWidth?: number | undefined;
833
- minHeight?: number | undefined;
834
- maxHeight?: number | undefined;
835
- } | {
836
- type: "session_metric";
837
- key: string;
838
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
839
- threshold: number;
840
- } | {
841
- type: "dismissed";
842
- key: string;
843
- inverted?: boolean | undefined;
844
- } | {
845
- type: "cooldown_active";
846
- key: string;
847
- inverted?: boolean | undefined;
848
- } | {
849
- type: "frequency_limit";
850
- key: string;
851
- limit: number;
852
- inverted?: boolean | undefined;
853
- } | {
854
- type: "event_count";
855
- key: string;
856
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
857
- count: number;
858
- withinMs?: number | undefined;
859
- })[];
860
- value?: unknown;
861
- }[];
862
- default?: unknown;
863
- }, {
864
- type: "rules";
865
- rules: {
866
- conditions: ({
867
- url: string;
868
- type: "page_url";
869
- } | {
870
- type: "route";
871
- routeId: string;
872
- } | {
873
- anchorId: string;
874
- state: "visible" | "present" | "absent";
875
- type: "anchor_visible";
876
- } | {
877
- type: "event_occurred";
878
- eventName: string;
879
- withinMs?: number | undefined;
880
- } | {
881
- type: "state_equals";
882
- key: string;
883
- value?: unknown;
884
- } | {
885
- type: "viewport";
886
- minWidth?: number | undefined;
887
- maxWidth?: number | undefined;
888
- minHeight?: number | undefined;
889
- maxHeight?: number | undefined;
890
- } | {
891
- type: "session_metric";
892
- key: string;
893
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
894
- threshold: number;
895
- } | {
896
- type: "dismissed";
897
- key: string;
898
- inverted?: boolean | undefined;
899
- } | {
900
- type: "cooldown_active";
901
- key: string;
902
- inverted?: boolean | undefined;
903
- } | {
904
- type: "frequency_limit";
905
- key: string;
906
- limit: number;
907
- inverted?: boolean | undefined;
908
- } | {
909
- type: "event_count";
910
- key: string;
911
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
912
- count: number;
913
- withinMs?: number | undefined;
914
- })[];
915
- value?: unknown;
916
- }[];
917
- default?: unknown;
918
- }>;
919
- export declare const ScoreStrategyZ: z.ZodObject<{
920
- type: z.ZodLiteral<"score">;
921
- field: z.ZodString;
922
- threshold: z.ZodNumber;
923
- above: z.ZodUnknown;
924
- below: z.ZodUnknown;
925
- }, "strip", z.ZodTypeAny, {
926
- type: "score";
927
- threshold: number;
928
- field: string;
929
- above?: unknown;
930
- below?: unknown;
931
- }, {
932
- type: "score";
933
- threshold: number;
934
- field: string;
935
- above?: unknown;
936
- below?: unknown;
937
- }>;
938
- export declare const ModelStrategyZ: z.ZodObject<{
939
- type: z.ZodLiteral<"model">;
940
- modelId: z.ZodString;
941
- inputs: z.ZodArray<z.ZodString, "many">;
942
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
943
- default: z.ZodUnknown;
944
- }, "strip", z.ZodTypeAny, {
945
- type: "model";
946
- modelId: string;
947
- inputs: string[];
948
- outputMapping: Record<string, unknown>;
949
- default?: unknown;
950
- }, {
951
- type: "model";
952
- modelId: string;
953
- inputs: string[];
954
- outputMapping: Record<string, unknown>;
955
- default?: unknown;
956
- }>;
957
- export declare const ExternalStrategyZ: z.ZodObject<{
958
- type: z.ZodLiteral<"external">;
959
- endpoint: z.ZodString;
960
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
961
- default: z.ZodUnknown;
962
- timeoutMs: z.ZodOptional<z.ZodNumber>;
963
- }, "strip", z.ZodTypeAny, {
964
- type: "external";
965
- endpoint: string;
966
- default?: unknown;
967
- method?: "GET" | "POST" | undefined;
968
- timeoutMs?: number | undefined;
969
- }, {
970
- type: "external";
971
- endpoint: string;
972
- default?: unknown;
973
- method?: "GET" | "POST" | undefined;
974
- timeoutMs?: number | undefined;
975
- }>;
976
- export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
977
- type: z.ZodLiteral<"rules">;
978
- rules: z.ZodArray<z.ZodObject<{
979
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
980
- type: z.ZodLiteral<"page_url">;
981
- url: z.ZodString;
982
- }, "strip", z.ZodTypeAny, {
983
- url: string;
984
- type: "page_url";
985
- }, {
986
- url: string;
987
- type: "page_url";
988
- }>, z.ZodObject<{
989
- type: z.ZodLiteral<"route">;
990
- routeId: z.ZodString;
991
- }, "strip", z.ZodTypeAny, {
992
- type: "route";
993
- routeId: string;
994
- }, {
995
- type: "route";
996
- routeId: string;
997
- }>, z.ZodObject<{
998
- type: z.ZodLiteral<"anchor_visible">;
999
- anchorId: z.ZodString;
1000
- state: z.ZodEnum<["visible", "present", "absent"]>;
1001
- }, "strip", z.ZodTypeAny, {
1002
- anchorId: string;
1003
- state: "visible" | "present" | "absent";
1004
- type: "anchor_visible";
1005
- }, {
1006
- anchorId: string;
1007
- state: "visible" | "present" | "absent";
1008
- type: "anchor_visible";
1009
- }>, z.ZodObject<{
1010
- type: z.ZodLiteral<"event_occurred">;
1011
- eventName: z.ZodString;
1012
- withinMs: z.ZodOptional<z.ZodNumber>;
1013
- }, "strip", z.ZodTypeAny, {
1014
- type: "event_occurred";
1015
- eventName: string;
1016
- withinMs?: number | undefined;
1017
- }, {
1018
- type: "event_occurred";
1019
- eventName: string;
1020
- withinMs?: number | undefined;
1021
- }>, z.ZodObject<{
1022
- type: z.ZodLiteral<"state_equals">;
1023
- key: z.ZodString;
1024
- value: z.ZodUnknown;
1025
- }, "strip", z.ZodTypeAny, {
1026
- type: "state_equals";
1027
- key: string;
1028
- value?: unknown;
1029
- }, {
1030
- type: "state_equals";
1031
- key: string;
1032
- value?: unknown;
1033
- }>, z.ZodObject<{
1034
- type: z.ZodLiteral<"viewport">;
1035
- minWidth: z.ZodOptional<z.ZodNumber>;
1036
- maxWidth: z.ZodOptional<z.ZodNumber>;
1037
- minHeight: z.ZodOptional<z.ZodNumber>;
1038
- maxHeight: z.ZodOptional<z.ZodNumber>;
1039
- }, "strip", z.ZodTypeAny, {
1040
- type: "viewport";
1041
- minWidth?: number | undefined;
1042
- maxWidth?: number | undefined;
1043
- minHeight?: number | undefined;
1044
- maxHeight?: number | undefined;
1045
- }, {
1046
- type: "viewport";
1047
- minWidth?: number | undefined;
1048
- maxWidth?: number | undefined;
1049
- minHeight?: number | undefined;
1050
- maxHeight?: number | undefined;
1051
- }>, z.ZodObject<{
1052
- type: z.ZodLiteral<"session_metric">;
1053
- key: z.ZodString;
1054
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1055
- threshold: z.ZodNumber;
1056
- }, "strip", z.ZodTypeAny, {
1057
- type: "session_metric";
1058
- key: string;
1059
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1060
- threshold: number;
1061
- }, {
1062
- type: "session_metric";
1063
- key: string;
1064
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1065
- threshold: number;
1066
- }>, z.ZodObject<{
1067
- type: z.ZodLiteral<"dismissed">;
1068
- key: z.ZodString;
1069
- inverted: z.ZodOptional<z.ZodBoolean>;
1070
- }, "strip", z.ZodTypeAny, {
1071
- type: "dismissed";
1072
- key: string;
1073
- inverted?: boolean | undefined;
1074
- }, {
1075
- type: "dismissed";
1076
- key: string;
1077
- inverted?: boolean | undefined;
1078
- }>, z.ZodObject<{
1079
- type: z.ZodLiteral<"cooldown_active">;
1080
- key: z.ZodString;
1081
- inverted: z.ZodOptional<z.ZodBoolean>;
1082
- }, "strip", z.ZodTypeAny, {
1083
- type: "cooldown_active";
1084
- key: string;
1085
- inverted?: boolean | undefined;
1086
- }, {
1087
- type: "cooldown_active";
1088
- key: string;
1089
- inverted?: boolean | undefined;
1090
- }>, z.ZodObject<{
1091
- type: z.ZodLiteral<"frequency_limit">;
1092
- key: z.ZodString;
1093
- limit: z.ZodNumber;
1094
- inverted: z.ZodOptional<z.ZodBoolean>;
1095
- }, "strip", z.ZodTypeAny, {
1096
- type: "frequency_limit";
1097
- key: string;
1098
- limit: number;
1099
- inverted?: boolean | undefined;
1100
- }, {
1101
- type: "frequency_limit";
1102
- key: string;
1103
- limit: number;
1104
- inverted?: boolean | undefined;
1105
- }>, z.ZodObject<{
1106
- type: z.ZodLiteral<"event_count">;
1107
- key: z.ZodString;
1108
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1109
- count: z.ZodNumber;
1110
- withinMs: z.ZodOptional<z.ZodNumber>;
1111
- }, "strip", z.ZodTypeAny, {
1112
- type: "event_count";
1113
- key: string;
1114
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1115
- count: number;
1116
- withinMs?: number | undefined;
1117
- }, {
1118
- type: "event_count";
1119
- key: string;
1120
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1121
- count: number;
1122
- withinMs?: number | undefined;
1123
- }>]>, "many">;
1124
- value: z.ZodUnknown;
1125
- }, "strip", z.ZodTypeAny, {
1126
- conditions: ({
1127
- url: string;
1128
- type: "page_url";
1129
- } | {
1130
- type: "route";
1131
- routeId: string;
1132
- } | {
1133
- anchorId: string;
1134
- state: "visible" | "present" | "absent";
1135
- type: "anchor_visible";
1136
- } | {
1137
- type: "event_occurred";
1138
- eventName: string;
1139
- withinMs?: number | undefined;
1140
- } | {
1141
- type: "state_equals";
1142
- key: string;
1143
- value?: unknown;
1144
- } | {
1145
- type: "viewport";
1146
- minWidth?: number | undefined;
1147
- maxWidth?: number | undefined;
1148
- minHeight?: number | undefined;
1149
- maxHeight?: number | undefined;
1150
- } | {
1151
- type: "session_metric";
1152
- key: string;
1153
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1154
- threshold: number;
1155
- } | {
1156
- type: "dismissed";
1157
- key: string;
1158
- inverted?: boolean | undefined;
1159
- } | {
1160
- type: "cooldown_active";
1161
- key: string;
1162
- inverted?: boolean | undefined;
1163
- } | {
1164
- type: "frequency_limit";
1165
- key: string;
1166
- limit: number;
1167
- inverted?: boolean | undefined;
1168
- } | {
1169
- type: "event_count";
1170
- key: string;
1171
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1172
- count: number;
1173
- withinMs?: number | undefined;
1174
- })[];
1175
- value?: unknown;
1176
- }, {
1177
- conditions: ({
1178
- url: string;
1179
- type: "page_url";
1180
- } | {
1181
- type: "route";
1182
- routeId: string;
1183
- } | {
1184
- anchorId: string;
1185
- state: "visible" | "present" | "absent";
1186
- type: "anchor_visible";
1187
- } | {
1188
- type: "event_occurred";
1189
- eventName: string;
1190
- withinMs?: number | undefined;
1191
- } | {
1192
- type: "state_equals";
1193
- key: string;
1194
- value?: unknown;
1195
- } | {
1196
- type: "viewport";
1197
- minWidth?: number | undefined;
1198
- maxWidth?: number | undefined;
1199
- minHeight?: number | undefined;
1200
- maxHeight?: number | undefined;
1201
- } | {
1202
- type: "session_metric";
1203
- key: string;
1204
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1205
- threshold: number;
1206
- } | {
1207
- type: "dismissed";
1208
- key: string;
1209
- inverted?: boolean | undefined;
1210
- } | {
1211
- type: "cooldown_active";
1212
- key: string;
1213
- inverted?: boolean | undefined;
1214
- } | {
1215
- type: "frequency_limit";
1216
- key: string;
1217
- limit: number;
1218
- inverted?: boolean | undefined;
1219
- } | {
1220
- type: "event_count";
1221
- key: string;
1222
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1223
- count: number;
1224
- withinMs?: number | undefined;
1225
- })[];
1226
- value?: unknown;
1227
- }>, "many">;
1228
- default: z.ZodUnknown;
1229
- }, "strip", z.ZodTypeAny, {
1230
- type: "rules";
1231
- rules: {
1232
- conditions: ({
1233
- url: string;
1234
- type: "page_url";
1235
- } | {
1236
- type: "route";
1237
- routeId: string;
1238
- } | {
1239
- anchorId: string;
1240
- state: "visible" | "present" | "absent";
1241
- type: "anchor_visible";
1242
- } | {
1243
- type: "event_occurred";
1244
- eventName: string;
1245
- withinMs?: number | undefined;
1246
- } | {
1247
- type: "state_equals";
1248
- key: string;
1249
- value?: unknown;
1250
- } | {
1251
- type: "viewport";
1252
- minWidth?: number | undefined;
1253
- maxWidth?: number | undefined;
1254
- minHeight?: number | undefined;
1255
- maxHeight?: number | undefined;
1256
- } | {
1257
- type: "session_metric";
1258
- key: string;
1259
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1260
- threshold: number;
1261
- } | {
1262
- type: "dismissed";
1263
- key: string;
1264
- inverted?: boolean | undefined;
1265
- } | {
1266
- type: "cooldown_active";
1267
- key: string;
1268
- inverted?: boolean | undefined;
1269
- } | {
1270
- type: "frequency_limit";
1271
- key: string;
1272
- limit: number;
1273
- inverted?: boolean | undefined;
1274
- } | {
1275
- type: "event_count";
1276
- key: string;
1277
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1278
- count: number;
1279
- withinMs?: number | undefined;
1280
- })[];
1281
- value?: unknown;
1282
- }[];
1283
- default?: unknown;
1284
- }, {
1285
- type: "rules";
1286
- rules: {
1287
- conditions: ({
1288
- url: string;
1289
- type: "page_url";
1290
- } | {
1291
- type: "route";
1292
- routeId: string;
1293
- } | {
1294
- anchorId: string;
1295
- state: "visible" | "present" | "absent";
1296
- type: "anchor_visible";
1297
- } | {
1298
- type: "event_occurred";
1299
- eventName: string;
1300
- withinMs?: number | undefined;
1301
- } | {
1302
- type: "state_equals";
1303
- key: string;
1304
- value?: unknown;
1305
- } | {
1306
- type: "viewport";
1307
- minWidth?: number | undefined;
1308
- maxWidth?: number | undefined;
1309
- minHeight?: number | undefined;
1310
- maxHeight?: number | undefined;
1311
- } | {
1312
- type: "session_metric";
1313
- key: string;
1314
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1315
- threshold: number;
1316
- } | {
1317
- type: "dismissed";
1318
- key: string;
1319
- inverted?: boolean | undefined;
1320
- } | {
1321
- type: "cooldown_active";
1322
- key: string;
1323
- inverted?: boolean | undefined;
1324
- } | {
1325
- type: "frequency_limit";
1326
- key: string;
1327
- limit: number;
1328
- inverted?: boolean | undefined;
1329
- } | {
1330
- type: "event_count";
1331
- key: string;
1332
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1333
- count: number;
1334
- withinMs?: number | undefined;
1335
- })[];
1336
- value?: unknown;
1337
- }[];
1338
- default?: unknown;
1339
- }>, z.ZodObject<{
1340
- type: z.ZodLiteral<"score">;
1341
- field: z.ZodString;
1342
- threshold: z.ZodNumber;
1343
- above: z.ZodUnknown;
1344
- below: z.ZodUnknown;
1345
- }, "strip", z.ZodTypeAny, {
1346
- type: "score";
1347
- threshold: number;
1348
- field: string;
1349
- above?: unknown;
1350
- below?: unknown;
1351
- }, {
1352
- type: "score";
1353
- threshold: number;
1354
- field: string;
1355
- above?: unknown;
1356
- below?: unknown;
1357
- }>, z.ZodObject<{
1358
- type: z.ZodLiteral<"model">;
1359
- modelId: z.ZodString;
1360
- inputs: z.ZodArray<z.ZodString, "many">;
1361
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1362
- default: z.ZodUnknown;
1363
- }, "strip", z.ZodTypeAny, {
1364
- type: "model";
1365
- modelId: string;
1366
- inputs: string[];
1367
- outputMapping: Record<string, unknown>;
1368
- default?: unknown;
1369
- }, {
1370
- type: "model";
1371
- modelId: string;
1372
- inputs: string[];
1373
- outputMapping: Record<string, unknown>;
1374
- default?: unknown;
1375
- }>, z.ZodObject<{
1376
- type: z.ZodLiteral<"external">;
1377
- endpoint: z.ZodString;
1378
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1379
- default: z.ZodUnknown;
1380
- timeoutMs: z.ZodOptional<z.ZodNumber>;
1381
- }, "strip", z.ZodTypeAny, {
1382
- type: "external";
1383
- endpoint: string;
1384
- default?: unknown;
1385
- method?: "GET" | "POST" | undefined;
1386
- timeoutMs?: number | undefined;
1387
- }, {
1388
- type: "external";
1389
- endpoint: string;
1390
- default?: unknown;
1391
- method?: "GET" | "POST" | undefined;
1392
- timeoutMs?: number | undefined;
1393
- }>]>;
1394
- export declare const RouteFilterZ: z.ZodObject<{
1395
- include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1396
- exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1397
- }, "strip", z.ZodTypeAny, {
1398
- include?: string[] | undefined;
1399
- exclude?: string[] | undefined;
1400
- }, {
1401
- include?: string[] | undefined;
1402
- exclude?: string[] | undefined;
1403
- }>;
1404
- export declare const ActivationConfigZ: z.ZodObject<{
1405
- routes: z.ZodObject<{
1406
- include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1407
- exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1408
- }, "strip", z.ZodTypeAny, {
1409
- include?: string[] | undefined;
1410
- exclude?: string[] | undefined;
1411
- }, {
1412
- include?: string[] | undefined;
1413
- exclude?: string[] | undefined;
1414
- }>;
1415
- strategy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1416
- type: z.ZodLiteral<"rules">;
1417
- rules: z.ZodArray<z.ZodObject<{
1418
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1419
- type: z.ZodLiteral<"page_url">;
1420
- url: z.ZodString;
1421
- }, "strip", z.ZodTypeAny, {
1422
- url: string;
1423
- type: "page_url";
1424
- }, {
1425
- url: string;
1426
- type: "page_url";
1427
- }>, z.ZodObject<{
1428
- type: z.ZodLiteral<"route">;
1429
- routeId: z.ZodString;
1430
- }, "strip", z.ZodTypeAny, {
1431
- type: "route";
1432
- routeId: string;
1433
- }, {
1434
- type: "route";
1435
- routeId: string;
1436
- }>, z.ZodObject<{
1437
- type: z.ZodLiteral<"anchor_visible">;
1438
- anchorId: z.ZodString;
1439
- state: z.ZodEnum<["visible", "present", "absent"]>;
1440
- }, "strip", z.ZodTypeAny, {
1441
- anchorId: string;
1442
- state: "visible" | "present" | "absent";
1443
- type: "anchor_visible";
1444
- }, {
1445
- anchorId: string;
1446
- state: "visible" | "present" | "absent";
1447
- type: "anchor_visible";
1448
- }>, z.ZodObject<{
1449
- type: z.ZodLiteral<"event_occurred">;
1450
- eventName: z.ZodString;
1451
- withinMs: z.ZodOptional<z.ZodNumber>;
1452
- }, "strip", z.ZodTypeAny, {
1453
- type: "event_occurred";
1454
- eventName: string;
1455
- withinMs?: number | undefined;
1456
- }, {
1457
- type: "event_occurred";
1458
- eventName: string;
1459
- withinMs?: number | undefined;
1460
- }>, z.ZodObject<{
1461
- type: z.ZodLiteral<"state_equals">;
1462
- key: z.ZodString;
1463
- value: z.ZodUnknown;
1464
- }, "strip", z.ZodTypeAny, {
1465
- type: "state_equals";
1466
- key: string;
1467
- value?: unknown;
1468
- }, {
1469
- type: "state_equals";
1470
- key: string;
1471
- value?: unknown;
1472
- }>, z.ZodObject<{
1473
- type: z.ZodLiteral<"viewport">;
1474
- minWidth: z.ZodOptional<z.ZodNumber>;
1475
- maxWidth: z.ZodOptional<z.ZodNumber>;
1476
- minHeight: z.ZodOptional<z.ZodNumber>;
1477
- maxHeight: z.ZodOptional<z.ZodNumber>;
1478
- }, "strip", z.ZodTypeAny, {
1479
- type: "viewport";
1480
- minWidth?: number | undefined;
1481
- maxWidth?: number | undefined;
1482
- minHeight?: number | undefined;
1483
- maxHeight?: number | undefined;
1484
- }, {
1485
- type: "viewport";
1486
- minWidth?: number | undefined;
1487
- maxWidth?: number | undefined;
1488
- minHeight?: number | undefined;
1489
- maxHeight?: number | undefined;
1490
- }>, z.ZodObject<{
1491
- type: z.ZodLiteral<"session_metric">;
1492
- key: z.ZodString;
1493
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1494
- threshold: z.ZodNumber;
1495
- }, "strip", z.ZodTypeAny, {
1496
- type: "session_metric";
1497
- key: string;
1498
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1499
- threshold: number;
1500
- }, {
1501
- type: "session_metric";
1502
- key: string;
1503
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1504
- threshold: number;
1505
- }>, z.ZodObject<{
1506
- type: z.ZodLiteral<"dismissed">;
1507
- key: z.ZodString;
1508
- inverted: z.ZodOptional<z.ZodBoolean>;
1509
- }, "strip", z.ZodTypeAny, {
1510
- type: "dismissed";
1511
- key: string;
1512
- inverted?: boolean | undefined;
1513
- }, {
1514
- type: "dismissed";
1515
- key: string;
1516
- inverted?: boolean | undefined;
1517
- }>, z.ZodObject<{
1518
- type: z.ZodLiteral<"cooldown_active">;
1519
- key: z.ZodString;
1520
- inverted: z.ZodOptional<z.ZodBoolean>;
1521
- }, "strip", z.ZodTypeAny, {
1522
- type: "cooldown_active";
1523
- key: string;
1524
- inverted?: boolean | undefined;
1525
- }, {
1526
- type: "cooldown_active";
1527
- key: string;
1528
- inverted?: boolean | undefined;
1529
- }>, z.ZodObject<{
1530
- type: z.ZodLiteral<"frequency_limit">;
1531
- key: z.ZodString;
1532
- limit: z.ZodNumber;
1533
- inverted: z.ZodOptional<z.ZodBoolean>;
1534
- }, "strip", z.ZodTypeAny, {
1535
- type: "frequency_limit";
1536
- key: string;
1537
- limit: number;
1538
- inverted?: boolean | undefined;
1539
- }, {
1540
- type: "frequency_limit";
1541
- key: string;
1542
- limit: number;
1543
- inverted?: boolean | undefined;
1544
- }>, z.ZodObject<{
1545
- type: z.ZodLiteral<"event_count">;
1546
- key: z.ZodString;
1547
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1548
- count: z.ZodNumber;
1549
- withinMs: z.ZodOptional<z.ZodNumber>;
1550
- }, "strip", z.ZodTypeAny, {
1551
- type: "event_count";
1552
- key: string;
1553
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1554
- count: number;
1555
- withinMs?: number | undefined;
1556
- }, {
1557
- type: "event_count";
1558
- key: string;
1559
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1560
- count: number;
1561
- withinMs?: number | undefined;
1562
- }>]>, "many">;
1563
- value: z.ZodUnknown;
1564
- }, "strip", z.ZodTypeAny, {
1565
- conditions: ({
1566
- url: string;
1567
- type: "page_url";
1568
- } | {
1569
- type: "route";
1570
- routeId: string;
1571
- } | {
1572
- anchorId: string;
1573
- state: "visible" | "present" | "absent";
1574
- type: "anchor_visible";
1575
- } | {
1576
- type: "event_occurred";
1577
- eventName: string;
1578
- withinMs?: number | undefined;
1579
- } | {
1580
- type: "state_equals";
1581
- key: string;
1582
- value?: unknown;
1583
- } | {
1584
- type: "viewport";
1585
- minWidth?: number | undefined;
1586
- maxWidth?: number | undefined;
1587
- minHeight?: number | undefined;
1588
- maxHeight?: number | undefined;
1589
- } | {
1590
- type: "session_metric";
1591
- key: string;
1592
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1593
- threshold: number;
1594
- } | {
1595
- type: "dismissed";
1596
- key: string;
1597
- inverted?: boolean | undefined;
1598
- } | {
1599
- type: "cooldown_active";
1600
- key: string;
1601
- inverted?: boolean | undefined;
1602
- } | {
1603
- type: "frequency_limit";
1604
- key: string;
1605
- limit: number;
1606
- inverted?: boolean | undefined;
1607
- } | {
1608
- type: "event_count";
1609
- key: string;
1610
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1611
- count: number;
1612
- withinMs?: number | undefined;
1613
- })[];
1614
- value?: unknown;
1615
- }, {
1616
- conditions: ({
1617
- url: string;
1618
- type: "page_url";
1619
- } | {
1620
- type: "route";
1621
- routeId: string;
1622
- } | {
1623
- anchorId: string;
1624
- state: "visible" | "present" | "absent";
1625
- type: "anchor_visible";
1626
- } | {
1627
- type: "event_occurred";
1628
- eventName: string;
1629
- withinMs?: number | undefined;
1630
- } | {
1631
- type: "state_equals";
1632
- key: string;
1633
- value?: unknown;
1634
- } | {
1635
- type: "viewport";
1636
- minWidth?: number | undefined;
1637
- maxWidth?: number | undefined;
1638
- minHeight?: number | undefined;
1639
- maxHeight?: number | undefined;
1640
- } | {
1641
- type: "session_metric";
1642
- key: string;
1643
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1644
- threshold: number;
1645
- } | {
1646
- type: "dismissed";
1647
- key: string;
1648
- inverted?: boolean | undefined;
1649
- } | {
1650
- type: "cooldown_active";
1651
- key: string;
1652
- inverted?: boolean | undefined;
1653
- } | {
1654
- type: "frequency_limit";
1655
- key: string;
1656
- limit: number;
1657
- inverted?: boolean | undefined;
1658
- } | {
1659
- type: "event_count";
1660
- key: string;
1661
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1662
- count: number;
1663
- withinMs?: number | undefined;
1664
- })[];
1665
- value?: unknown;
1666
- }>, "many">;
1667
- default: z.ZodUnknown;
1668
- }, "strip", z.ZodTypeAny, {
1669
- type: "rules";
1670
- rules: {
1671
- conditions: ({
1672
- url: string;
1673
- type: "page_url";
1674
- } | {
1675
- type: "route";
1676
- routeId: string;
1677
- } | {
1678
- anchorId: string;
1679
- state: "visible" | "present" | "absent";
1680
- type: "anchor_visible";
1681
- } | {
1682
- type: "event_occurred";
1683
- eventName: string;
1684
- withinMs?: number | undefined;
1685
- } | {
1686
- type: "state_equals";
1687
- key: string;
1688
- value?: unknown;
1689
- } | {
1690
- type: "viewport";
1691
- minWidth?: number | undefined;
1692
- maxWidth?: number | undefined;
1693
- minHeight?: number | undefined;
1694
- maxHeight?: number | undefined;
1695
- } | {
1696
- type: "session_metric";
1697
- key: string;
1698
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1699
- threshold: number;
1700
- } | {
1701
- type: "dismissed";
1702
- key: string;
1703
- inverted?: boolean | undefined;
1704
- } | {
1705
- type: "cooldown_active";
1706
- key: string;
1707
- inverted?: boolean | undefined;
1708
- } | {
1709
- type: "frequency_limit";
1710
- key: string;
1711
- limit: number;
1712
- inverted?: boolean | undefined;
1713
- } | {
1714
- type: "event_count";
1715
- key: string;
1716
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1717
- count: number;
1718
- withinMs?: number | undefined;
1719
- })[];
1720
- value?: unknown;
1721
- }[];
1722
- default?: unknown;
1723
- }, {
1724
- type: "rules";
1725
- rules: {
1726
- conditions: ({
1727
- url: string;
1728
- type: "page_url";
1729
- } | {
1730
- type: "route";
1731
- routeId: string;
1732
- } | {
1733
- anchorId: string;
1734
- state: "visible" | "present" | "absent";
1735
- type: "anchor_visible";
1736
- } | {
1737
- type: "event_occurred";
1738
- eventName: string;
1739
- withinMs?: number | undefined;
1740
- } | {
1741
- type: "state_equals";
1742
- key: string;
1743
- value?: unknown;
1744
- } | {
1745
- type: "viewport";
1746
- minWidth?: number | undefined;
1747
- maxWidth?: number | undefined;
1748
- minHeight?: number | undefined;
1749
- maxHeight?: number | undefined;
1750
- } | {
1751
- type: "session_metric";
1752
- key: string;
1753
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1754
- threshold: number;
1755
- } | {
1756
- type: "dismissed";
1757
- key: string;
1758
- inverted?: boolean | undefined;
1759
- } | {
1760
- type: "cooldown_active";
1761
- key: string;
1762
- inverted?: boolean | undefined;
1763
- } | {
1764
- type: "frequency_limit";
1765
- key: string;
1766
- limit: number;
1767
- inverted?: boolean | undefined;
1768
- } | {
1769
- type: "event_count";
1770
- key: string;
1771
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1772
- count: number;
1773
- withinMs?: number | undefined;
1774
- })[];
1775
- value?: unknown;
1776
- }[];
1777
- default?: unknown;
1778
- }>, z.ZodObject<{
1779
- type: z.ZodLiteral<"score">;
1780
- field: z.ZodString;
1781
- threshold: z.ZodNumber;
1782
- above: z.ZodUnknown;
1783
- below: z.ZodUnknown;
1784
- }, "strip", z.ZodTypeAny, {
1785
- type: "score";
1786
- threshold: number;
1787
- field: string;
1788
- above?: unknown;
1789
- below?: unknown;
1790
- }, {
1791
- type: "score";
1792
- threshold: number;
1793
- field: string;
1794
- above?: unknown;
1795
- below?: unknown;
1796
- }>, z.ZodObject<{
1797
- type: z.ZodLiteral<"model">;
1798
- modelId: z.ZodString;
1799
- inputs: z.ZodArray<z.ZodString, "many">;
1800
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1801
- default: z.ZodUnknown;
1802
- }, "strip", z.ZodTypeAny, {
1803
- type: "model";
1804
- modelId: string;
1805
- inputs: string[];
1806
- outputMapping: Record<string, unknown>;
1807
- default?: unknown;
1808
- }, {
1809
- type: "model";
1810
- modelId: string;
1811
- inputs: string[];
1812
- outputMapping: Record<string, unknown>;
1813
- default?: unknown;
1814
- }>, z.ZodObject<{
1815
- type: z.ZodLiteral<"external">;
1816
- endpoint: z.ZodString;
1817
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1818
- default: z.ZodUnknown;
1819
- timeoutMs: z.ZodOptional<z.ZodNumber>;
1820
- }, "strip", z.ZodTypeAny, {
1821
- type: "external";
1822
- endpoint: string;
1823
- default?: unknown;
1824
- method?: "GET" | "POST" | undefined;
1825
- timeoutMs?: number | undefined;
1826
- }, {
1827
- type: "external";
1828
- endpoint: string;
1829
- default?: unknown;
1830
- method?: "GET" | "POST" | undefined;
1831
- timeoutMs?: number | undefined;
1832
- }>]>>;
1833
- }, "strip", z.ZodTypeAny, {
1834
- routes: {
1835
- include?: string[] | undefined;
1836
- exclude?: string[] | undefined;
1837
- };
1838
- strategy?: {
1839
- type: "rules";
1840
- rules: {
1841
- conditions: ({
1842
- url: string;
1843
- type: "page_url";
1844
- } | {
1845
- type: "route";
1846
- routeId: string;
1847
- } | {
1848
- anchorId: string;
1849
- state: "visible" | "present" | "absent";
1850
- type: "anchor_visible";
1851
- } | {
1852
- type: "event_occurred";
1853
- eventName: string;
1854
- withinMs?: number | undefined;
1855
- } | {
1856
- type: "state_equals";
1857
- key: string;
1858
- value?: unknown;
1859
- } | {
1860
- type: "viewport";
1861
- minWidth?: number | undefined;
1862
- maxWidth?: number | undefined;
1863
- minHeight?: number | undefined;
1864
- maxHeight?: number | undefined;
1865
- } | {
1866
- type: "session_metric";
1867
- key: string;
1868
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1869
- threshold: number;
1870
- } | {
1871
- type: "dismissed";
1872
- key: string;
1873
- inverted?: boolean | undefined;
1874
- } | {
1875
- type: "cooldown_active";
1876
- key: string;
1877
- inverted?: boolean | undefined;
1878
- } | {
1879
- type: "frequency_limit";
1880
- key: string;
1881
- limit: number;
1882
- inverted?: boolean | undefined;
1883
- } | {
1884
- type: "event_count";
1885
- key: string;
1886
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1887
- count: number;
1888
- withinMs?: number | undefined;
1889
- })[];
1890
- value?: unknown;
1891
- }[];
1892
- default?: unknown;
1893
- } | {
1894
- type: "score";
1895
- threshold: number;
1896
- field: string;
1897
- above?: unknown;
1898
- below?: unknown;
1899
- } | {
1900
- type: "model";
1901
- modelId: string;
1902
- inputs: string[];
1903
- outputMapping: Record<string, unknown>;
1904
- default?: unknown;
1905
- } | {
1906
- type: "external";
1907
- endpoint: string;
1908
- default?: unknown;
1909
- method?: "GET" | "POST" | undefined;
1910
- timeoutMs?: number | undefined;
1911
- } | undefined;
3
+ *
4
+ * Condition and strategy schemas are canonical in @syntrologie/sdk-contracts.
5
+ * This module re-exports them and adds runtime-specific schemas
6
+ * (ActivationConfig, RouteFilter) plus the decisionSchemas array for
7
+ * unified JSON Schema generation.
8
+ */
9
+ import { z } from 'zod';
10
+ export { AnchorVisibleConditionZ, type ConditionSchema, ConditionZ, CooldownActiveConditionZ, CounterDefZ, type DecisionStrategySchema, DecisionStrategyZ, DismissedConditionZ, EventCountConditionZ, EventOccurredConditionZ, ExternalStrategyZ, FrequencyLimitConditionZ, MatchOpZ, ModelStrategyZ, PageUrlConditionZ, RouteConditionZ, type RuleSchema, RuleStrategyZ, RuleZ, ScoreStrategyZ, SessionMetricConditionZ, StateEqualsConditionZ, TriggerWhenZ, ViewportConditionZ, } from '@syntrologie/sdk-contracts';
11
+ export declare const RouteFilterZ: z.ZodObject<{
12
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ include?: string[] | undefined;
16
+ exclude?: string[] | undefined;
1912
17
  }, {
18
+ include?: string[] | undefined;
19
+ exclude?: string[] | undefined;
20
+ }>;
21
+ export declare const ActivationConfigZ: z.ZodObject<{
22
+ routes: z.ZodObject<{
23
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ include?: string[] | undefined;
27
+ exclude?: string[] | undefined;
28
+ }, {
29
+ include?: string[] | undefined;
30
+ exclude?: string[] | undefined;
31
+ }>;
32
+ onlyIfPopulated: z.ZodOptional<z.ZodBoolean>;
33
+ }, "strip", z.ZodTypeAny, {
1913
34
  routes: {
1914
35
  include?: string[] | undefined;
1915
36
  exclude?: string[] | undefined;
1916
37
  };
1917
- strategy?: {
1918
- type: "rules";
1919
- rules: {
1920
- conditions: ({
1921
- url: string;
1922
- type: "page_url";
1923
- } | {
1924
- type: "route";
1925
- routeId: string;
1926
- } | {
1927
- anchorId: string;
1928
- state: "visible" | "present" | "absent";
1929
- type: "anchor_visible";
1930
- } | {
1931
- type: "event_occurred";
1932
- eventName: string;
1933
- withinMs?: number | undefined;
1934
- } | {
1935
- type: "state_equals";
1936
- key: string;
1937
- value?: unknown;
1938
- } | {
1939
- type: "viewport";
1940
- minWidth?: number | undefined;
1941
- maxWidth?: number | undefined;
1942
- minHeight?: number | undefined;
1943
- maxHeight?: number | undefined;
1944
- } | {
1945
- type: "session_metric";
1946
- key: string;
1947
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1948
- threshold: number;
1949
- } | {
1950
- type: "dismissed";
1951
- key: string;
1952
- inverted?: boolean | undefined;
1953
- } | {
1954
- type: "cooldown_active";
1955
- key: string;
1956
- inverted?: boolean | undefined;
1957
- } | {
1958
- type: "frequency_limit";
1959
- key: string;
1960
- limit: number;
1961
- inverted?: boolean | undefined;
1962
- } | {
1963
- type: "event_count";
1964
- key: string;
1965
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
1966
- count: number;
1967
- withinMs?: number | undefined;
1968
- })[];
1969
- value?: unknown;
1970
- }[];
1971
- default?: unknown;
1972
- } | {
1973
- type: "score";
1974
- threshold: number;
1975
- field: string;
1976
- above?: unknown;
1977
- below?: unknown;
1978
- } | {
1979
- type: "model";
1980
- modelId: string;
1981
- inputs: string[];
1982
- outputMapping: Record<string, unknown>;
1983
- default?: unknown;
1984
- } | {
1985
- type: "external";
1986
- endpoint: string;
1987
- default?: unknown;
1988
- method?: "GET" | "POST" | undefined;
1989
- timeoutMs?: number | undefined;
1990
- } | undefined;
38
+ onlyIfPopulated?: boolean | undefined;
39
+ }, {
40
+ routes: {
41
+ include?: string[] | undefined;
42
+ exclude?: string[] | undefined;
43
+ };
44
+ onlyIfPopulated?: boolean | undefined;
1991
45
  }>;
1992
46
  /**
1993
47
  * Validate a Condition object.
1994
48
  */
1995
49
  export declare function validateCondition(data: unknown): z.SafeParseReturnType<{
1996
- url: string;
1997
50
  type: "page_url";
51
+ url: string;
1998
52
  } | {
1999
53
  type: "route";
2000
54
  routeId: string;
2001
55
  } | {
56
+ type: "anchor_visible";
2002
57
  anchorId: string;
2003
58
  state: "visible" | "present" | "absent";
2004
- type: "anchor_visible";
2005
59
  } | {
2006
60
  type: "event_occurred";
2007
61
  eventName: string;
@@ -2040,16 +94,23 @@ export declare function validateCondition(data: unknown): z.SafeParseReturnType<
2040
94
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
2041
95
  count: number;
2042
96
  withinMs?: number | undefined;
97
+ counter?: {
98
+ events: string[];
99
+ match?: Record<string, {
100
+ equals?: string | number | boolean | undefined;
101
+ contains?: string | undefined;
102
+ }> | undefined;
103
+ } | undefined;
2043
104
  }, {
2044
- url: string;
2045
105
  type: "page_url";
106
+ url: string;
2046
107
  } | {
2047
108
  type: "route";
2048
109
  routeId: string;
2049
110
  } | {
111
+ type: "anchor_visible";
2050
112
  anchorId: string;
2051
113
  state: "visible" | "present" | "absent";
2052
- type: "anchor_visible";
2053
114
  } | {
2054
115
  type: "event_occurred";
2055
116
  eventName: string;
@@ -2088,6 +149,13 @@ export declare function validateCondition(data: unknown): z.SafeParseReturnType<
2088
149
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
2089
150
  count: number;
2090
151
  withinMs?: number | undefined;
152
+ counter?: {
153
+ events: string[];
154
+ match?: Record<string, {
155
+ equals?: string | number | boolean | undefined;
156
+ contains?: string | undefined;
157
+ }> | undefined;
158
+ } | undefined;
2091
159
  }>;
2092
160
  /**
2093
161
  * Validate a DecisionStrategy object.
@@ -2096,15 +164,15 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2096
164
  type: "rules";
2097
165
  rules: {
2098
166
  conditions: ({
2099
- url: string;
2100
167
  type: "page_url";
168
+ url: string;
2101
169
  } | {
2102
170
  type: "route";
2103
171
  routeId: string;
2104
172
  } | {
173
+ type: "anchor_visible";
2105
174
  anchorId: string;
2106
175
  state: "visible" | "present" | "absent";
2107
- type: "anchor_visible";
2108
176
  } | {
2109
177
  type: "event_occurred";
2110
178
  eventName: string;
@@ -2143,6 +211,13 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2143
211
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
2144
212
  count: number;
2145
213
  withinMs?: number | undefined;
214
+ counter?: {
215
+ events: string[];
216
+ match?: Record<string, {
217
+ equals?: string | number | boolean | undefined;
218
+ contains?: string | undefined;
219
+ }> | undefined;
220
+ } | undefined;
2146
221
  })[];
2147
222
  value?: unknown;
2148
223
  }[];
@@ -2169,15 +244,15 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2169
244
  type: "rules";
2170
245
  rules: {
2171
246
  conditions: ({
2172
- url: string;
2173
247
  type: "page_url";
248
+ url: string;
2174
249
  } | {
2175
250
  type: "route";
2176
251
  routeId: string;
2177
252
  } | {
253
+ type: "anchor_visible";
2178
254
  anchorId: string;
2179
255
  state: "visible" | "present" | "absent";
2180
- type: "anchor_visible";
2181
256
  } | {
2182
257
  type: "event_occurred";
2183
258
  eventName: string;
@@ -2190,216 +265,77 @@ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
2190
265
  type: "viewport";
2191
266
  minWidth?: number | undefined;
2192
267
  maxWidth?: number | undefined;
2193
- minHeight?: number | undefined;
2194
- maxHeight?: number | undefined;
2195
- } | {
2196
- type: "session_metric";
2197
- key: string;
2198
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2199
- threshold: number;
2200
- } | {
2201
- type: "dismissed";
2202
- key: string;
2203
- inverted?: boolean | undefined;
2204
- } | {
2205
- type: "cooldown_active";
2206
- key: string;
2207
- inverted?: boolean | undefined;
2208
- } | {
2209
- type: "frequency_limit";
2210
- key: string;
2211
- limit: number;
2212
- inverted?: boolean | undefined;
2213
- } | {
2214
- type: "event_count";
2215
- key: string;
2216
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2217
- count: number;
2218
- withinMs?: number | undefined;
2219
- })[];
2220
- value?: unknown;
2221
- }[];
2222
- default?: unknown;
2223
- } | {
2224
- type: "score";
2225
- threshold: number;
2226
- field: string;
2227
- above?: unknown;
2228
- below?: unknown;
2229
- } | {
2230
- type: "model";
2231
- modelId: string;
2232
- inputs: string[];
2233
- outputMapping: Record<string, unknown>;
2234
- default?: unknown;
2235
- } | {
2236
- type: "external";
2237
- endpoint: string;
2238
- default?: unknown;
2239
- method?: "GET" | "POST" | undefined;
2240
- timeoutMs?: number | undefined;
2241
- }>;
2242
- /**
2243
- * Validate an ActivationConfig object.
2244
- */
2245
- export declare function validateActivationConfig(data: unknown): z.SafeParseReturnType<{
2246
- routes: {
2247
- include?: string[] | undefined;
2248
- exclude?: string[] | undefined;
2249
- };
2250
- strategy?: {
2251
- type: "rules";
2252
- rules: {
2253
- conditions: ({
2254
- url: string;
2255
- type: "page_url";
2256
- } | {
2257
- type: "route";
2258
- routeId: string;
2259
- } | {
2260
- anchorId: string;
2261
- state: "visible" | "present" | "absent";
2262
- type: "anchor_visible";
2263
- } | {
2264
- type: "event_occurred";
2265
- eventName: string;
2266
- withinMs?: number | undefined;
2267
- } | {
2268
- type: "state_equals";
2269
- key: string;
2270
- value?: unknown;
2271
- } | {
2272
- type: "viewport";
2273
- minWidth?: number | undefined;
2274
- maxWidth?: number | undefined;
2275
- minHeight?: number | undefined;
2276
- maxHeight?: number | undefined;
2277
- } | {
2278
- type: "session_metric";
2279
- key: string;
2280
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2281
- threshold: number;
2282
- } | {
2283
- type: "dismissed";
2284
- key: string;
2285
- inverted?: boolean | undefined;
2286
- } | {
2287
- type: "cooldown_active";
2288
- key: string;
2289
- inverted?: boolean | undefined;
2290
- } | {
2291
- type: "frequency_limit";
2292
- key: string;
2293
- limit: number;
2294
- inverted?: boolean | undefined;
2295
- } | {
2296
- type: "event_count";
2297
- key: string;
2298
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2299
- count: number;
2300
- withinMs?: number | undefined;
2301
- })[];
2302
- value?: unknown;
2303
- }[];
2304
- default?: unknown;
2305
- } | {
2306
- type: "score";
2307
- threshold: number;
2308
- field: string;
2309
- above?: unknown;
2310
- below?: unknown;
2311
- } | {
2312
- type: "model";
2313
- modelId: string;
2314
- inputs: string[];
2315
- outputMapping: Record<string, unknown>;
2316
- default?: unknown;
2317
- } | {
2318
- type: "external";
2319
- endpoint: string;
2320
- default?: unknown;
2321
- method?: "GET" | "POST" | undefined;
2322
- timeoutMs?: number | undefined;
2323
- } | undefined;
268
+ minHeight?: number | undefined;
269
+ maxHeight?: number | undefined;
270
+ } | {
271
+ type: "session_metric";
272
+ key: string;
273
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
274
+ threshold: number;
275
+ } | {
276
+ type: "dismissed";
277
+ key: string;
278
+ inverted?: boolean | undefined;
279
+ } | {
280
+ type: "cooldown_active";
281
+ key: string;
282
+ inverted?: boolean | undefined;
283
+ } | {
284
+ type: "frequency_limit";
285
+ key: string;
286
+ limit: number;
287
+ inverted?: boolean | undefined;
288
+ } | {
289
+ type: "event_count";
290
+ key: string;
291
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
292
+ count: number;
293
+ withinMs?: number | undefined;
294
+ counter?: {
295
+ events: string[];
296
+ match?: Record<string, {
297
+ equals?: string | number | boolean | undefined;
298
+ contains?: string | undefined;
299
+ }> | undefined;
300
+ } | undefined;
301
+ })[];
302
+ value?: unknown;
303
+ }[];
304
+ default?: unknown;
305
+ } | {
306
+ type: "score";
307
+ threshold: number;
308
+ field: string;
309
+ above?: unknown;
310
+ below?: unknown;
311
+ } | {
312
+ type: "model";
313
+ modelId: string;
314
+ inputs: string[];
315
+ outputMapping: Record<string, unknown>;
316
+ default?: unknown;
317
+ } | {
318
+ type: "external";
319
+ endpoint: string;
320
+ default?: unknown;
321
+ method?: "GET" | "POST" | undefined;
322
+ timeoutMs?: number | undefined;
323
+ }>;
324
+ /**
325
+ * Validate an ActivationConfig object.
326
+ */
327
+ export declare function validateActivationConfig(data: unknown): z.SafeParseReturnType<{
328
+ routes: {
329
+ include?: string[] | undefined;
330
+ exclude?: string[] | undefined;
331
+ };
332
+ onlyIfPopulated?: boolean | undefined;
2324
333
  }, {
2325
334
  routes: {
2326
335
  include?: string[] | undefined;
2327
336
  exclude?: string[] | undefined;
2328
337
  };
2329
- strategy?: {
2330
- type: "rules";
2331
- rules: {
2332
- conditions: ({
2333
- url: string;
2334
- type: "page_url";
2335
- } | {
2336
- type: "route";
2337
- routeId: string;
2338
- } | {
2339
- anchorId: string;
2340
- state: "visible" | "present" | "absent";
2341
- type: "anchor_visible";
2342
- } | {
2343
- type: "event_occurred";
2344
- eventName: string;
2345
- withinMs?: number | undefined;
2346
- } | {
2347
- type: "state_equals";
2348
- key: string;
2349
- value?: unknown;
2350
- } | {
2351
- type: "viewport";
2352
- minWidth?: number | undefined;
2353
- maxWidth?: number | undefined;
2354
- minHeight?: number | undefined;
2355
- maxHeight?: number | undefined;
2356
- } | {
2357
- type: "session_metric";
2358
- key: string;
2359
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2360
- threshold: number;
2361
- } | {
2362
- type: "dismissed";
2363
- key: string;
2364
- inverted?: boolean | undefined;
2365
- } | {
2366
- type: "cooldown_active";
2367
- key: string;
2368
- inverted?: boolean | undefined;
2369
- } | {
2370
- type: "frequency_limit";
2371
- key: string;
2372
- limit: number;
2373
- inverted?: boolean | undefined;
2374
- } | {
2375
- type: "event_count";
2376
- key: string;
2377
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2378
- count: number;
2379
- withinMs?: number | undefined;
2380
- })[];
2381
- value?: unknown;
2382
- }[];
2383
- default?: unknown;
2384
- } | {
2385
- type: "score";
2386
- threshold: number;
2387
- field: string;
2388
- above?: unknown;
2389
- below?: unknown;
2390
- } | {
2391
- type: "model";
2392
- modelId: string;
2393
- inputs: string[];
2394
- outputMapping: Record<string, unknown>;
2395
- default?: unknown;
2396
- } | {
2397
- type: "external";
2398
- endpoint: string;
2399
- default?: unknown;
2400
- method?: "GET" | "POST" | undefined;
2401
- timeoutMs?: number | undefined;
2402
- } | undefined;
338
+ onlyIfPopulated?: boolean | undefined;
2403
339
  }>;
2404
340
  /**
2405
341
  * Decision schemas for unified JSON Schema generation.
@@ -2409,6 +345,45 @@ export declare function validateActivationConfig(data: unknown): z.SafeParseRetu
2409
345
  * the generator builds from $refs to the four strategy defs.
2410
346
  */
2411
347
  export declare const decisionSchemas: ({
348
+ defName: string;
349
+ schema: z.ZodObject<{
350
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
351
+ contains: z.ZodOptional<z.ZodString>;
352
+ }, "strip", z.ZodTypeAny, {
353
+ equals?: string | number | boolean | undefined;
354
+ contains?: string | undefined;
355
+ }, {
356
+ equals?: string | number | boolean | undefined;
357
+ contains?: string | undefined;
358
+ }>;
359
+ } | {
360
+ defName: string;
361
+ schema: z.ZodObject<{
362
+ events: z.ZodArray<z.ZodString, "many">;
363
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
364
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
365
+ contains: z.ZodOptional<z.ZodString>;
366
+ }, "strip", z.ZodTypeAny, {
367
+ equals?: string | number | boolean | undefined;
368
+ contains?: string | undefined;
369
+ }, {
370
+ equals?: string | number | boolean | undefined;
371
+ contains?: string | undefined;
372
+ }>>>;
373
+ }, "strip", z.ZodTypeAny, {
374
+ events: string[];
375
+ match?: Record<string, {
376
+ equals?: string | number | boolean | undefined;
377
+ contains?: string | undefined;
378
+ }> | undefined;
379
+ }, {
380
+ events: string[];
381
+ match?: Record<string, {
382
+ equals?: string | number | boolean | undefined;
383
+ contains?: string | undefined;
384
+ }> | undefined;
385
+ }>;
386
+ } | {
2412
387
  defName: string;
2413
388
  schema: z.ZodObject<{
2414
389
  routes: z.ZodObject<{
@@ -2421,582 +396,19 @@ export declare const decisionSchemas: ({
2421
396
  include?: string[] | undefined;
2422
397
  exclude?: string[] | undefined;
2423
398
  }>;
2424
- strategy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2425
- type: z.ZodLiteral<"rules">;
2426
- rules: z.ZodArray<z.ZodObject<{
2427
- conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2428
- type: z.ZodLiteral<"page_url">;
2429
- url: z.ZodString;
2430
- }, "strip", z.ZodTypeAny, {
2431
- url: string;
2432
- type: "page_url";
2433
- }, {
2434
- url: string;
2435
- type: "page_url";
2436
- }>, z.ZodObject<{
2437
- type: z.ZodLiteral<"route">;
2438
- routeId: z.ZodString;
2439
- }, "strip", z.ZodTypeAny, {
2440
- type: "route";
2441
- routeId: string;
2442
- }, {
2443
- type: "route";
2444
- routeId: string;
2445
- }>, z.ZodObject<{
2446
- type: z.ZodLiteral<"anchor_visible">;
2447
- anchorId: z.ZodString;
2448
- state: z.ZodEnum<["visible", "present", "absent"]>;
2449
- }, "strip", z.ZodTypeAny, {
2450
- anchorId: string;
2451
- state: "visible" | "present" | "absent";
2452
- type: "anchor_visible";
2453
- }, {
2454
- anchorId: string;
2455
- state: "visible" | "present" | "absent";
2456
- type: "anchor_visible";
2457
- }>, z.ZodObject<{
2458
- type: z.ZodLiteral<"event_occurred">;
2459
- eventName: z.ZodString;
2460
- withinMs: z.ZodOptional<z.ZodNumber>;
2461
- }, "strip", z.ZodTypeAny, {
2462
- type: "event_occurred";
2463
- eventName: string;
2464
- withinMs?: number | undefined;
2465
- }, {
2466
- type: "event_occurred";
2467
- eventName: string;
2468
- withinMs?: number | undefined;
2469
- }>, z.ZodObject<{
2470
- type: z.ZodLiteral<"state_equals">;
2471
- key: z.ZodString;
2472
- value: z.ZodUnknown;
2473
- }, "strip", z.ZodTypeAny, {
2474
- type: "state_equals";
2475
- key: string;
2476
- value?: unknown;
2477
- }, {
2478
- type: "state_equals";
2479
- key: string;
2480
- value?: unknown;
2481
- }>, z.ZodObject<{
2482
- type: z.ZodLiteral<"viewport">;
2483
- minWidth: z.ZodOptional<z.ZodNumber>;
2484
- maxWidth: z.ZodOptional<z.ZodNumber>;
2485
- minHeight: z.ZodOptional<z.ZodNumber>;
2486
- maxHeight: z.ZodOptional<z.ZodNumber>;
2487
- }, "strip", z.ZodTypeAny, {
2488
- type: "viewport";
2489
- minWidth?: number | undefined;
2490
- maxWidth?: number | undefined;
2491
- minHeight?: number | undefined;
2492
- maxHeight?: number | undefined;
2493
- }, {
2494
- type: "viewport";
2495
- minWidth?: number | undefined;
2496
- maxWidth?: number | undefined;
2497
- minHeight?: number | undefined;
2498
- maxHeight?: number | undefined;
2499
- }>, z.ZodObject<{
2500
- type: z.ZodLiteral<"session_metric">;
2501
- key: z.ZodString;
2502
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
2503
- threshold: z.ZodNumber;
2504
- }, "strip", z.ZodTypeAny, {
2505
- type: "session_metric";
2506
- key: string;
2507
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2508
- threshold: number;
2509
- }, {
2510
- type: "session_metric";
2511
- key: string;
2512
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2513
- threshold: number;
2514
- }>, z.ZodObject<{
2515
- type: z.ZodLiteral<"dismissed">;
2516
- key: z.ZodString;
2517
- inverted: z.ZodOptional<z.ZodBoolean>;
2518
- }, "strip", z.ZodTypeAny, {
2519
- type: "dismissed";
2520
- key: string;
2521
- inverted?: boolean | undefined;
2522
- }, {
2523
- type: "dismissed";
2524
- key: string;
2525
- inverted?: boolean | undefined;
2526
- }>, z.ZodObject<{
2527
- type: z.ZodLiteral<"cooldown_active">;
2528
- key: z.ZodString;
2529
- inverted: z.ZodOptional<z.ZodBoolean>;
2530
- }, "strip", z.ZodTypeAny, {
2531
- type: "cooldown_active";
2532
- key: string;
2533
- inverted?: boolean | undefined;
2534
- }, {
2535
- type: "cooldown_active";
2536
- key: string;
2537
- inverted?: boolean | undefined;
2538
- }>, z.ZodObject<{
2539
- type: z.ZodLiteral<"frequency_limit">;
2540
- key: z.ZodString;
2541
- limit: z.ZodNumber;
2542
- inverted: z.ZodOptional<z.ZodBoolean>;
2543
- }, "strip", z.ZodTypeAny, {
2544
- type: "frequency_limit";
2545
- key: string;
2546
- limit: number;
2547
- inverted?: boolean | undefined;
2548
- }, {
2549
- type: "frequency_limit";
2550
- key: string;
2551
- limit: number;
2552
- inverted?: boolean | undefined;
2553
- }>, z.ZodObject<{
2554
- type: z.ZodLiteral<"event_count">;
2555
- key: z.ZodString;
2556
- operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
2557
- count: z.ZodNumber;
2558
- withinMs: z.ZodOptional<z.ZodNumber>;
2559
- }, "strip", z.ZodTypeAny, {
2560
- type: "event_count";
2561
- key: string;
2562
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2563
- count: number;
2564
- withinMs?: number | undefined;
2565
- }, {
2566
- type: "event_count";
2567
- key: string;
2568
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2569
- count: number;
2570
- withinMs?: number | undefined;
2571
- }>]>, "many">;
2572
- value: z.ZodUnknown;
2573
- }, "strip", z.ZodTypeAny, {
2574
- conditions: ({
2575
- url: string;
2576
- type: "page_url";
2577
- } | {
2578
- type: "route";
2579
- routeId: string;
2580
- } | {
2581
- anchorId: string;
2582
- state: "visible" | "present" | "absent";
2583
- type: "anchor_visible";
2584
- } | {
2585
- type: "event_occurred";
2586
- eventName: string;
2587
- withinMs?: number | undefined;
2588
- } | {
2589
- type: "state_equals";
2590
- key: string;
2591
- value?: unknown;
2592
- } | {
2593
- type: "viewport";
2594
- minWidth?: number | undefined;
2595
- maxWidth?: number | undefined;
2596
- minHeight?: number | undefined;
2597
- maxHeight?: number | undefined;
2598
- } | {
2599
- type: "session_metric";
2600
- key: string;
2601
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2602
- threshold: number;
2603
- } | {
2604
- type: "dismissed";
2605
- key: string;
2606
- inverted?: boolean | undefined;
2607
- } | {
2608
- type: "cooldown_active";
2609
- key: string;
2610
- inverted?: boolean | undefined;
2611
- } | {
2612
- type: "frequency_limit";
2613
- key: string;
2614
- limit: number;
2615
- inverted?: boolean | undefined;
2616
- } | {
2617
- type: "event_count";
2618
- key: string;
2619
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2620
- count: number;
2621
- withinMs?: number | undefined;
2622
- })[];
2623
- value?: unknown;
2624
- }, {
2625
- conditions: ({
2626
- url: string;
2627
- type: "page_url";
2628
- } | {
2629
- type: "route";
2630
- routeId: string;
2631
- } | {
2632
- anchorId: string;
2633
- state: "visible" | "present" | "absent";
2634
- type: "anchor_visible";
2635
- } | {
2636
- type: "event_occurred";
2637
- eventName: string;
2638
- withinMs?: number | undefined;
2639
- } | {
2640
- type: "state_equals";
2641
- key: string;
2642
- value?: unknown;
2643
- } | {
2644
- type: "viewport";
2645
- minWidth?: number | undefined;
2646
- maxWidth?: number | undefined;
2647
- minHeight?: number | undefined;
2648
- maxHeight?: number | undefined;
2649
- } | {
2650
- type: "session_metric";
2651
- key: string;
2652
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2653
- threshold: number;
2654
- } | {
2655
- type: "dismissed";
2656
- key: string;
2657
- inverted?: boolean | undefined;
2658
- } | {
2659
- type: "cooldown_active";
2660
- key: string;
2661
- inverted?: boolean | undefined;
2662
- } | {
2663
- type: "frequency_limit";
2664
- key: string;
2665
- limit: number;
2666
- inverted?: boolean | undefined;
2667
- } | {
2668
- type: "event_count";
2669
- key: string;
2670
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2671
- count: number;
2672
- withinMs?: number | undefined;
2673
- })[];
2674
- value?: unknown;
2675
- }>, "many">;
2676
- default: z.ZodUnknown;
2677
- }, "strip", z.ZodTypeAny, {
2678
- type: "rules";
2679
- rules: {
2680
- conditions: ({
2681
- url: string;
2682
- type: "page_url";
2683
- } | {
2684
- type: "route";
2685
- routeId: string;
2686
- } | {
2687
- anchorId: string;
2688
- state: "visible" | "present" | "absent";
2689
- type: "anchor_visible";
2690
- } | {
2691
- type: "event_occurred";
2692
- eventName: string;
2693
- withinMs?: number | undefined;
2694
- } | {
2695
- type: "state_equals";
2696
- key: string;
2697
- value?: unknown;
2698
- } | {
2699
- type: "viewport";
2700
- minWidth?: number | undefined;
2701
- maxWidth?: number | undefined;
2702
- minHeight?: number | undefined;
2703
- maxHeight?: number | undefined;
2704
- } | {
2705
- type: "session_metric";
2706
- key: string;
2707
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2708
- threshold: number;
2709
- } | {
2710
- type: "dismissed";
2711
- key: string;
2712
- inverted?: boolean | undefined;
2713
- } | {
2714
- type: "cooldown_active";
2715
- key: string;
2716
- inverted?: boolean | undefined;
2717
- } | {
2718
- type: "frequency_limit";
2719
- key: string;
2720
- limit: number;
2721
- inverted?: boolean | undefined;
2722
- } | {
2723
- type: "event_count";
2724
- key: string;
2725
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2726
- count: number;
2727
- withinMs?: number | undefined;
2728
- })[];
2729
- value?: unknown;
2730
- }[];
2731
- default?: unknown;
2732
- }, {
2733
- type: "rules";
2734
- rules: {
2735
- conditions: ({
2736
- url: string;
2737
- type: "page_url";
2738
- } | {
2739
- type: "route";
2740
- routeId: string;
2741
- } | {
2742
- anchorId: string;
2743
- state: "visible" | "present" | "absent";
2744
- type: "anchor_visible";
2745
- } | {
2746
- type: "event_occurred";
2747
- eventName: string;
2748
- withinMs?: number | undefined;
2749
- } | {
2750
- type: "state_equals";
2751
- key: string;
2752
- value?: unknown;
2753
- } | {
2754
- type: "viewport";
2755
- minWidth?: number | undefined;
2756
- maxWidth?: number | undefined;
2757
- minHeight?: number | undefined;
2758
- maxHeight?: number | undefined;
2759
- } | {
2760
- type: "session_metric";
2761
- key: string;
2762
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2763
- threshold: number;
2764
- } | {
2765
- type: "dismissed";
2766
- key: string;
2767
- inverted?: boolean | undefined;
2768
- } | {
2769
- type: "cooldown_active";
2770
- key: string;
2771
- inverted?: boolean | undefined;
2772
- } | {
2773
- type: "frequency_limit";
2774
- key: string;
2775
- limit: number;
2776
- inverted?: boolean | undefined;
2777
- } | {
2778
- type: "event_count";
2779
- key: string;
2780
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2781
- count: number;
2782
- withinMs?: number | undefined;
2783
- })[];
2784
- value?: unknown;
2785
- }[];
2786
- default?: unknown;
2787
- }>, z.ZodObject<{
2788
- type: z.ZodLiteral<"score">;
2789
- field: z.ZodString;
2790
- threshold: z.ZodNumber;
2791
- above: z.ZodUnknown;
2792
- below: z.ZodUnknown;
2793
- }, "strip", z.ZodTypeAny, {
2794
- type: "score";
2795
- threshold: number;
2796
- field: string;
2797
- above?: unknown;
2798
- below?: unknown;
2799
- }, {
2800
- type: "score";
2801
- threshold: number;
2802
- field: string;
2803
- above?: unknown;
2804
- below?: unknown;
2805
- }>, z.ZodObject<{
2806
- type: z.ZodLiteral<"model">;
2807
- modelId: z.ZodString;
2808
- inputs: z.ZodArray<z.ZodString, "many">;
2809
- outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2810
- default: z.ZodUnknown;
2811
- }, "strip", z.ZodTypeAny, {
2812
- type: "model";
2813
- modelId: string;
2814
- inputs: string[];
2815
- outputMapping: Record<string, unknown>;
2816
- default?: unknown;
2817
- }, {
2818
- type: "model";
2819
- modelId: string;
2820
- inputs: string[];
2821
- outputMapping: Record<string, unknown>;
2822
- default?: unknown;
2823
- }>, z.ZodObject<{
2824
- type: z.ZodLiteral<"external">;
2825
- endpoint: z.ZodString;
2826
- method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
2827
- default: z.ZodUnknown;
2828
- timeoutMs: z.ZodOptional<z.ZodNumber>;
2829
- }, "strip", z.ZodTypeAny, {
2830
- type: "external";
2831
- endpoint: string;
2832
- default?: unknown;
2833
- method?: "GET" | "POST" | undefined;
2834
- timeoutMs?: number | undefined;
2835
- }, {
2836
- type: "external";
2837
- endpoint: string;
2838
- default?: unknown;
2839
- method?: "GET" | "POST" | undefined;
2840
- timeoutMs?: number | undefined;
2841
- }>]>>;
399
+ onlyIfPopulated: z.ZodOptional<z.ZodBoolean>;
2842
400
  }, "strip", z.ZodTypeAny, {
2843
401
  routes: {
2844
402
  include?: string[] | undefined;
2845
403
  exclude?: string[] | undefined;
2846
404
  };
2847
- strategy?: {
2848
- type: "rules";
2849
- rules: {
2850
- conditions: ({
2851
- url: string;
2852
- type: "page_url";
2853
- } | {
2854
- type: "route";
2855
- routeId: string;
2856
- } | {
2857
- anchorId: string;
2858
- state: "visible" | "present" | "absent";
2859
- type: "anchor_visible";
2860
- } | {
2861
- type: "event_occurred";
2862
- eventName: string;
2863
- withinMs?: number | undefined;
2864
- } | {
2865
- type: "state_equals";
2866
- key: string;
2867
- value?: unknown;
2868
- } | {
2869
- type: "viewport";
2870
- minWidth?: number | undefined;
2871
- maxWidth?: number | undefined;
2872
- minHeight?: number | undefined;
2873
- maxHeight?: number | undefined;
2874
- } | {
2875
- type: "session_metric";
2876
- key: string;
2877
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2878
- threshold: number;
2879
- } | {
2880
- type: "dismissed";
2881
- key: string;
2882
- inverted?: boolean | undefined;
2883
- } | {
2884
- type: "cooldown_active";
2885
- key: string;
2886
- inverted?: boolean | undefined;
2887
- } | {
2888
- type: "frequency_limit";
2889
- key: string;
2890
- limit: number;
2891
- inverted?: boolean | undefined;
2892
- } | {
2893
- type: "event_count";
2894
- key: string;
2895
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2896
- count: number;
2897
- withinMs?: number | undefined;
2898
- })[];
2899
- value?: unknown;
2900
- }[];
2901
- default?: unknown;
2902
- } | {
2903
- type: "score";
2904
- threshold: number;
2905
- field: string;
2906
- above?: unknown;
2907
- below?: unknown;
2908
- } | {
2909
- type: "model";
2910
- modelId: string;
2911
- inputs: string[];
2912
- outputMapping: Record<string, unknown>;
2913
- default?: unknown;
2914
- } | {
2915
- type: "external";
2916
- endpoint: string;
2917
- default?: unknown;
2918
- method?: "GET" | "POST" | undefined;
2919
- timeoutMs?: number | undefined;
2920
- } | undefined;
405
+ onlyIfPopulated?: boolean | undefined;
2921
406
  }, {
2922
407
  routes: {
2923
408
  include?: string[] | undefined;
2924
409
  exclude?: string[] | undefined;
2925
410
  };
2926
- strategy?: {
2927
- type: "rules";
2928
- rules: {
2929
- conditions: ({
2930
- url: string;
2931
- type: "page_url";
2932
- } | {
2933
- type: "route";
2934
- routeId: string;
2935
- } | {
2936
- anchorId: string;
2937
- state: "visible" | "present" | "absent";
2938
- type: "anchor_visible";
2939
- } | {
2940
- type: "event_occurred";
2941
- eventName: string;
2942
- withinMs?: number | undefined;
2943
- } | {
2944
- type: "state_equals";
2945
- key: string;
2946
- value?: unknown;
2947
- } | {
2948
- type: "viewport";
2949
- minWidth?: number | undefined;
2950
- maxWidth?: number | undefined;
2951
- minHeight?: number | undefined;
2952
- maxHeight?: number | undefined;
2953
- } | {
2954
- type: "session_metric";
2955
- key: string;
2956
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2957
- threshold: number;
2958
- } | {
2959
- type: "dismissed";
2960
- key: string;
2961
- inverted?: boolean | undefined;
2962
- } | {
2963
- type: "cooldown_active";
2964
- key: string;
2965
- inverted?: boolean | undefined;
2966
- } | {
2967
- type: "frequency_limit";
2968
- key: string;
2969
- limit: number;
2970
- inverted?: boolean | undefined;
2971
- } | {
2972
- type: "event_count";
2973
- key: string;
2974
- operator: "gte" | "lte" | "eq" | "gt" | "lt";
2975
- count: number;
2976
- withinMs?: number | undefined;
2977
- })[];
2978
- value?: unknown;
2979
- }[];
2980
- default?: unknown;
2981
- } | {
2982
- type: "score";
2983
- threshold: number;
2984
- field: string;
2985
- above?: unknown;
2986
- below?: unknown;
2987
- } | {
2988
- type: "model";
2989
- modelId: string;
2990
- inputs: string[];
2991
- outputMapping: Record<string, unknown>;
2992
- default?: unknown;
2993
- } | {
2994
- type: "external";
2995
- endpoint: string;
2996
- default?: unknown;
2997
- method?: "GET" | "POST" | undefined;
2998
- timeoutMs?: number | undefined;
2999
- } | undefined;
411
+ onlyIfPopulated?: boolean | undefined;
3000
412
  }>;
3001
413
  } | {
3002
414
  defName: string;
@@ -3019,11 +431,11 @@ export declare const decisionSchemas: ({
3019
431
  type: z.ZodLiteral<"page_url">;
3020
432
  url: z.ZodString;
3021
433
  }, "strip", z.ZodTypeAny, {
3022
- url: string;
3023
434
  type: "page_url";
3024
- }, {
3025
435
  url: string;
436
+ }, {
3026
437
  type: "page_url";
438
+ url: string;
3027
439
  }>, z.ZodObject<{
3028
440
  type: z.ZodLiteral<"route">;
3029
441
  routeId: z.ZodString;
@@ -3038,13 +450,13 @@ export declare const decisionSchemas: ({
3038
450
  anchorId: z.ZodString;
3039
451
  state: z.ZodEnum<["visible", "present", "absent"]>;
3040
452
  }, "strip", z.ZodTypeAny, {
453
+ type: "anchor_visible";
3041
454
  anchorId: string;
3042
455
  state: "visible" | "present" | "absent";
3043
- type: "anchor_visible";
3044
456
  }, {
457
+ type: "anchor_visible";
3045
458
  anchorId: string;
3046
459
  state: "visible" | "present" | "absent";
3047
- type: "anchor_visible";
3048
460
  }>, z.ZodObject<{
3049
461
  type: z.ZodLiteral<"event_occurred">;
3050
462
  eventName: z.ZodString;
@@ -3147,31 +559,70 @@ export declare const decisionSchemas: ({
3147
559
  operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
3148
560
  count: z.ZodNumber;
3149
561
  withinMs: z.ZodOptional<z.ZodNumber>;
562
+ counter: z.ZodOptional<z.ZodObject<{
563
+ events: z.ZodArray<z.ZodString, "many">;
564
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
565
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
566
+ contains: z.ZodOptional<z.ZodString>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ equals?: string | number | boolean | undefined;
569
+ contains?: string | undefined;
570
+ }, {
571
+ equals?: string | number | boolean | undefined;
572
+ contains?: string | undefined;
573
+ }>>>;
574
+ }, "strip", z.ZodTypeAny, {
575
+ events: string[];
576
+ match?: Record<string, {
577
+ equals?: string | number | boolean | undefined;
578
+ contains?: string | undefined;
579
+ }> | undefined;
580
+ }, {
581
+ events: string[];
582
+ match?: Record<string, {
583
+ equals?: string | number | boolean | undefined;
584
+ contains?: string | undefined;
585
+ }> | undefined;
586
+ }>>;
3150
587
  }, "strip", z.ZodTypeAny, {
3151
588
  type: "event_count";
3152
589
  key: string;
3153
590
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3154
591
  count: number;
3155
592
  withinMs?: number | undefined;
593
+ counter?: {
594
+ events: string[];
595
+ match?: Record<string, {
596
+ equals?: string | number | boolean | undefined;
597
+ contains?: string | undefined;
598
+ }> | undefined;
599
+ } | undefined;
3156
600
  }, {
3157
601
  type: "event_count";
3158
602
  key: string;
3159
603
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3160
604
  count: number;
3161
605
  withinMs?: number | undefined;
606
+ counter?: {
607
+ events: string[];
608
+ match?: Record<string, {
609
+ equals?: string | number | boolean | undefined;
610
+ contains?: string | undefined;
611
+ }> | undefined;
612
+ } | undefined;
3162
613
  }>]>, "many">;
3163
614
  value: z.ZodUnknown;
3164
615
  }, "strip", z.ZodTypeAny, {
3165
616
  conditions: ({
3166
- url: string;
3167
617
  type: "page_url";
618
+ url: string;
3168
619
  } | {
3169
620
  type: "route";
3170
621
  routeId: string;
3171
622
  } | {
623
+ type: "anchor_visible";
3172
624
  anchorId: string;
3173
625
  state: "visible" | "present" | "absent";
3174
- type: "anchor_visible";
3175
626
  } | {
3176
627
  type: "event_occurred";
3177
628
  eventName: string;
@@ -3210,19 +661,26 @@ export declare const decisionSchemas: ({
3210
661
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3211
662
  count: number;
3212
663
  withinMs?: number | undefined;
664
+ counter?: {
665
+ events: string[];
666
+ match?: Record<string, {
667
+ equals?: string | number | boolean | undefined;
668
+ contains?: string | undefined;
669
+ }> | undefined;
670
+ } | undefined;
3213
671
  })[];
3214
672
  value?: unknown;
3215
673
  }, {
3216
674
  conditions: ({
3217
- url: string;
3218
675
  type: "page_url";
676
+ url: string;
3219
677
  } | {
3220
678
  type: "route";
3221
679
  routeId: string;
3222
680
  } | {
681
+ type: "anchor_visible";
3223
682
  anchorId: string;
3224
683
  state: "visible" | "present" | "absent";
3225
- type: "anchor_visible";
3226
684
  } | {
3227
685
  type: "event_occurred";
3228
686
  eventName: string;
@@ -3261,6 +719,13 @@ export declare const decisionSchemas: ({
3261
719
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3262
720
  count: number;
3263
721
  withinMs?: number | undefined;
722
+ counter?: {
723
+ events: string[];
724
+ match?: Record<string, {
725
+ equals?: string | number | boolean | undefined;
726
+ contains?: string | undefined;
727
+ }> | undefined;
728
+ } | undefined;
3264
729
  })[];
3265
730
  value?: unknown;
3266
731
  }>, "many">;
@@ -3269,15 +734,15 @@ export declare const decisionSchemas: ({
3269
734
  type: "rules";
3270
735
  rules: {
3271
736
  conditions: ({
3272
- url: string;
3273
737
  type: "page_url";
738
+ url: string;
3274
739
  } | {
3275
740
  type: "route";
3276
741
  routeId: string;
3277
742
  } | {
743
+ type: "anchor_visible";
3278
744
  anchorId: string;
3279
745
  state: "visible" | "present" | "absent";
3280
- type: "anchor_visible";
3281
746
  } | {
3282
747
  type: "event_occurred";
3283
748
  eventName: string;
@@ -3316,6 +781,13 @@ export declare const decisionSchemas: ({
3316
781
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3317
782
  count: number;
3318
783
  withinMs?: number | undefined;
784
+ counter?: {
785
+ events: string[];
786
+ match?: Record<string, {
787
+ equals?: string | number | boolean | undefined;
788
+ contains?: string | undefined;
789
+ }> | undefined;
790
+ } | undefined;
3319
791
  })[];
3320
792
  value?: unknown;
3321
793
  }[];
@@ -3324,15 +796,15 @@ export declare const decisionSchemas: ({
3324
796
  type: "rules";
3325
797
  rules: {
3326
798
  conditions: ({
3327
- url: string;
3328
799
  type: "page_url";
800
+ url: string;
3329
801
  } | {
3330
802
  type: "route";
3331
803
  routeId: string;
3332
804
  } | {
805
+ type: "anchor_visible";
3333
806
  anchorId: string;
3334
807
  state: "visible" | "present" | "absent";
3335
- type: "anchor_visible";
3336
808
  } | {
3337
809
  type: "event_occurred";
3338
810
  eventName: string;
@@ -3371,6 +843,13 @@ export declare const decisionSchemas: ({
3371
843
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3372
844
  count: number;
3373
845
  withinMs?: number | undefined;
846
+ counter?: {
847
+ events: string[];
848
+ match?: Record<string, {
849
+ equals?: string | number | boolean | undefined;
850
+ contains?: string | undefined;
851
+ }> | undefined;
852
+ } | undefined;
3374
853
  })[];
3375
854
  value?: unknown;
3376
855
  }[];
@@ -3446,11 +925,11 @@ export declare const decisionSchemas: ({
3446
925
  type: z.ZodLiteral<"page_url">;
3447
926
  url: z.ZodString;
3448
927
  }, "strip", z.ZodTypeAny, {
3449
- url: string;
3450
928
  type: "page_url";
3451
- }, {
3452
929
  url: string;
930
+ }, {
3453
931
  type: "page_url";
932
+ url: string;
3454
933
  }>, z.ZodObject<{
3455
934
  type: z.ZodLiteral<"route">;
3456
935
  routeId: z.ZodString;
@@ -3465,13 +944,13 @@ export declare const decisionSchemas: ({
3465
944
  anchorId: z.ZodString;
3466
945
  state: z.ZodEnum<["visible", "present", "absent"]>;
3467
946
  }, "strip", z.ZodTypeAny, {
947
+ type: "anchor_visible";
3468
948
  anchorId: string;
3469
949
  state: "visible" | "present" | "absent";
3470
- type: "anchor_visible";
3471
950
  }, {
951
+ type: "anchor_visible";
3472
952
  anchorId: string;
3473
953
  state: "visible" | "present" | "absent";
3474
- type: "anchor_visible";
3475
954
  }>, z.ZodObject<{
3476
955
  type: z.ZodLiteral<"event_occurred">;
3477
956
  eventName: z.ZodString;
@@ -3574,31 +1053,70 @@ export declare const decisionSchemas: ({
3574
1053
  operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
3575
1054
  count: z.ZodNumber;
3576
1055
  withinMs: z.ZodOptional<z.ZodNumber>;
1056
+ counter: z.ZodOptional<z.ZodObject<{
1057
+ events: z.ZodArray<z.ZodString, "many">;
1058
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1059
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1060
+ contains: z.ZodOptional<z.ZodString>;
1061
+ }, "strip", z.ZodTypeAny, {
1062
+ equals?: string | number | boolean | undefined;
1063
+ contains?: string | undefined;
1064
+ }, {
1065
+ equals?: string | number | boolean | undefined;
1066
+ contains?: string | undefined;
1067
+ }>>>;
1068
+ }, "strip", z.ZodTypeAny, {
1069
+ events: string[];
1070
+ match?: Record<string, {
1071
+ equals?: string | number | boolean | undefined;
1072
+ contains?: string | undefined;
1073
+ }> | undefined;
1074
+ }, {
1075
+ events: string[];
1076
+ match?: Record<string, {
1077
+ equals?: string | number | boolean | undefined;
1078
+ contains?: string | undefined;
1079
+ }> | undefined;
1080
+ }>>;
3577
1081
  }, "strip", z.ZodTypeAny, {
3578
1082
  type: "event_count";
3579
1083
  key: string;
3580
1084
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3581
1085
  count: number;
3582
1086
  withinMs?: number | undefined;
1087
+ counter?: {
1088
+ events: string[];
1089
+ match?: Record<string, {
1090
+ equals?: string | number | boolean | undefined;
1091
+ contains?: string | undefined;
1092
+ }> | undefined;
1093
+ } | undefined;
3583
1094
  }, {
3584
1095
  type: "event_count";
3585
1096
  key: string;
3586
1097
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3587
1098
  count: number;
3588
1099
  withinMs?: number | undefined;
1100
+ counter?: {
1101
+ events: string[];
1102
+ match?: Record<string, {
1103
+ equals?: string | number | boolean | undefined;
1104
+ contains?: string | undefined;
1105
+ }> | undefined;
1106
+ } | undefined;
3589
1107
  }>]>, "many">;
3590
1108
  value: z.ZodUnknown;
3591
1109
  }, "strip", z.ZodTypeAny, {
3592
1110
  conditions: ({
3593
- url: string;
3594
1111
  type: "page_url";
1112
+ url: string;
3595
1113
  } | {
3596
1114
  type: "route";
3597
1115
  routeId: string;
3598
1116
  } | {
1117
+ type: "anchor_visible";
3599
1118
  anchorId: string;
3600
1119
  state: "visible" | "present" | "absent";
3601
- type: "anchor_visible";
3602
1120
  } | {
3603
1121
  type: "event_occurred";
3604
1122
  eventName: string;
@@ -3637,19 +1155,26 @@ export declare const decisionSchemas: ({
3637
1155
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3638
1156
  count: number;
3639
1157
  withinMs?: number | undefined;
1158
+ counter?: {
1159
+ events: string[];
1160
+ match?: Record<string, {
1161
+ equals?: string | number | boolean | undefined;
1162
+ contains?: string | undefined;
1163
+ }> | undefined;
1164
+ } | undefined;
3640
1165
  })[];
3641
1166
  value?: unknown;
3642
1167
  }, {
3643
1168
  conditions: ({
3644
- url: string;
3645
1169
  type: "page_url";
1170
+ url: string;
3646
1171
  } | {
3647
1172
  type: "route";
3648
1173
  routeId: string;
3649
1174
  } | {
1175
+ type: "anchor_visible";
3650
1176
  anchorId: string;
3651
1177
  state: "visible" | "present" | "absent";
3652
- type: "anchor_visible";
3653
1178
  } | {
3654
1179
  type: "event_occurred";
3655
1180
  eventName: string;
@@ -3688,6 +1213,13 @@ export declare const decisionSchemas: ({
3688
1213
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3689
1214
  count: number;
3690
1215
  withinMs?: number | undefined;
1216
+ counter?: {
1217
+ events: string[];
1218
+ match?: Record<string, {
1219
+ equals?: string | number | boolean | undefined;
1220
+ contains?: string | undefined;
1221
+ }> | undefined;
1222
+ } | undefined;
3691
1223
  })[];
3692
1224
  value?: unknown;
3693
1225
  }>;
@@ -3697,11 +1229,11 @@ export declare const decisionSchemas: ({
3697
1229
  type: z.ZodLiteral<"page_url">;
3698
1230
  url: z.ZodString;
3699
1231
  }, "strip", z.ZodTypeAny, {
3700
- url: string;
3701
1232
  type: "page_url";
3702
- }, {
3703
1233
  url: string;
1234
+ }, {
3704
1235
  type: "page_url";
1236
+ url: string;
3705
1237
  }>, z.ZodObject<{
3706
1238
  type: z.ZodLiteral<"route">;
3707
1239
  routeId: z.ZodString;
@@ -3716,13 +1248,13 @@ export declare const decisionSchemas: ({
3716
1248
  anchorId: z.ZodString;
3717
1249
  state: z.ZodEnum<["visible", "present", "absent"]>;
3718
1250
  }, "strip", z.ZodTypeAny, {
1251
+ type: "anchor_visible";
3719
1252
  anchorId: string;
3720
1253
  state: "visible" | "present" | "absent";
3721
- type: "anchor_visible";
3722
1254
  }, {
1255
+ type: "anchor_visible";
3723
1256
  anchorId: string;
3724
1257
  state: "visible" | "present" | "absent";
3725
- type: "anchor_visible";
3726
1258
  }>, z.ZodObject<{
3727
1259
  type: z.ZodLiteral<"event_occurred">;
3728
1260
  eventName: z.ZodString;
@@ -3825,21 +1357,57 @@ export declare const decisionSchemas: ({
3825
1357
  operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
3826
1358
  count: z.ZodNumber;
3827
1359
  withinMs: z.ZodOptional<z.ZodNumber>;
1360
+ counter: z.ZodOptional<z.ZodObject<{
1361
+ events: z.ZodArray<z.ZodString, "many">;
1362
+ match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1363
+ equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1364
+ contains: z.ZodOptional<z.ZodString>;
1365
+ }, "strip", z.ZodTypeAny, {
1366
+ equals?: string | number | boolean | undefined;
1367
+ contains?: string | undefined;
1368
+ }, {
1369
+ equals?: string | number | boolean | undefined;
1370
+ contains?: string | undefined;
1371
+ }>>>;
1372
+ }, "strip", z.ZodTypeAny, {
1373
+ events: string[];
1374
+ match?: Record<string, {
1375
+ equals?: string | number | boolean | undefined;
1376
+ contains?: string | undefined;
1377
+ }> | undefined;
1378
+ }, {
1379
+ events: string[];
1380
+ match?: Record<string, {
1381
+ equals?: string | number | boolean | undefined;
1382
+ contains?: string | undefined;
1383
+ }> | undefined;
1384
+ }>>;
3828
1385
  }, "strip", z.ZodTypeAny, {
3829
1386
  type: "event_count";
3830
1387
  key: string;
3831
1388
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3832
1389
  count: number;
3833
1390
  withinMs?: number | undefined;
1391
+ counter?: {
1392
+ events: string[];
1393
+ match?: Record<string, {
1394
+ equals?: string | number | boolean | undefined;
1395
+ contains?: string | undefined;
1396
+ }> | undefined;
1397
+ } | undefined;
3834
1398
  }, {
3835
1399
  type: "event_count";
3836
1400
  key: string;
3837
1401
  operator: "gte" | "lte" | "eq" | "gt" | "lt";
3838
1402
  count: number;
3839
1403
  withinMs?: number | undefined;
1404
+ counter?: {
1405
+ events: string[];
1406
+ match?: Record<string, {
1407
+ equals?: string | number | boolean | undefined;
1408
+ contains?: string | undefined;
1409
+ }> | undefined;
1410
+ } | undefined;
3840
1411
  }>]>;
3841
1412
  })[];
3842
- export type ConditionSchema = z.infer<typeof ConditionZ>;
3843
- export type RuleSchema = z.infer<typeof RuleZ>;
3844
- export type DecisionStrategySchema = z.infer<typeof DecisionStrategyZ>;
3845
1413
  export type ActivationConfigSchema = z.infer<typeof ActivationConfigZ>;