@syntrologie/runtime-sdk 0.2.20 → 0.2.21

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 (101) hide show
  1. package/CAPABILITIES.md +211 -0
  2. package/dist/api.js +7 -6
  3. package/dist/api.js.map +1 -1
  4. package/dist/bootstrap.d.ts +16 -2
  5. package/dist/bootstrap.js +63 -14
  6. package/dist/bootstrap.js.map +1 -1
  7. package/dist/context/ContextManager.d.ts +66 -0
  8. package/dist/context/ContextManager.js +268 -0
  9. package/dist/context/ContextManager.js.map +1 -0
  10. package/dist/context/index.d.ts +7 -0
  11. package/dist/context/index.js +7 -0
  12. package/dist/context/index.js.map +1 -0
  13. package/dist/context/schema.d.ts +360 -0
  14. package/dist/context/schema.js +50 -0
  15. package/dist/context/schema.js.map +1 -0
  16. package/dist/context/types.d.ts +101 -0
  17. package/dist/context/types.js +8 -0
  18. package/dist/context/types.js.map +1 -0
  19. package/dist/decisions/engine.d.ts +43 -0
  20. package/dist/decisions/engine.js +112 -0
  21. package/dist/decisions/engine.js.map +1 -0
  22. package/dist/decisions/index.d.ts +9 -0
  23. package/dist/decisions/index.js +10 -0
  24. package/dist/decisions/index.js.map +1 -0
  25. package/dist/decisions/schema.d.ts +2166 -0
  26. package/dist/decisions/schema.js +143 -0
  27. package/dist/decisions/schema.js.map +1 -0
  28. package/dist/decisions/strategies/rules.d.ts +24 -0
  29. package/dist/decisions/strategies/rules.js +152 -0
  30. package/dist/decisions/strategies/rules.js.map +1 -0
  31. package/dist/decisions/strategies/score.d.ts +10 -0
  32. package/dist/decisions/strategies/score.js +29 -0
  33. package/dist/decisions/strategies/score.js.map +1 -0
  34. package/dist/decisions/types.d.ts +242 -0
  35. package/dist/decisions/types.js +2 -0
  36. package/dist/decisions/types.js.map +1 -0
  37. package/dist/editorLoader.d.ts +10 -0
  38. package/dist/editorLoader.js +38 -0
  39. package/dist/editorLoader.js.map +1 -1
  40. package/dist/events/EventBus.d.ts +59 -0
  41. package/dist/events/EventBus.js +154 -0
  42. package/dist/events/EventBus.js.map +1 -0
  43. package/dist/events/index.d.ts +9 -0
  44. package/dist/events/index.js +10 -0
  45. package/dist/events/index.js.map +1 -0
  46. package/dist/events/normalizers/canvas.d.ts +67 -0
  47. package/dist/events/normalizers/canvas.js +116 -0
  48. package/dist/events/normalizers/canvas.js.map +1 -0
  49. package/dist/events/normalizers/posthog.d.ts +29 -0
  50. package/dist/events/normalizers/posthog.js +155 -0
  51. package/dist/events/normalizers/posthog.js.map +1 -0
  52. package/dist/events/schema.d.ts +70 -0
  53. package/dist/events/schema.js +30 -0
  54. package/dist/events/schema.js.map +1 -0
  55. package/dist/events/types.d.ts +73 -0
  56. package/dist/events/types.js +41 -0
  57. package/dist/events/types.js.map +1 -0
  58. package/dist/hooks/useShadowCanvasConfig.d.ts +5 -1
  59. package/dist/hooks/useShadowCanvasConfig.js +17 -3
  60. package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
  61. package/dist/index.d.ts +6 -0
  62. package/dist/index.js +15 -0
  63. package/dist/index.js.map +1 -1
  64. package/dist/overlays/schema.d.ts +48 -48
  65. package/dist/runtime.d.ts +86 -0
  66. package/dist/runtime.js +132 -0
  67. package/dist/runtime.js.map +1 -0
  68. package/dist/smart-canvas.esm.js +11 -11
  69. package/dist/smart-canvas.esm.js.map +4 -4
  70. package/dist/smart-canvas.js +1504 -17
  71. package/dist/smart-canvas.js.map +4 -4
  72. package/dist/smart-canvas.min.js +11 -11
  73. package/dist/smart-canvas.min.js.map +4 -4
  74. package/dist/state/StateStore.d.ts +41 -0
  75. package/dist/state/StateStore.js +170 -0
  76. package/dist/state/StateStore.js.map +1 -0
  77. package/dist/state/helpers/cooldowns.d.ts +7 -0
  78. package/dist/state/helpers/cooldowns.js +31 -0
  79. package/dist/state/helpers/cooldowns.js.map +1 -0
  80. package/dist/state/helpers/dismissals.d.ts +7 -0
  81. package/dist/state/helpers/dismissals.js +34 -0
  82. package/dist/state/helpers/dismissals.js.map +1 -0
  83. package/dist/state/helpers/frequency.d.ts +8 -0
  84. package/dist/state/helpers/frequency.js +43 -0
  85. package/dist/state/helpers/frequency.js.map +1 -0
  86. package/dist/state/index.d.ts +7 -0
  87. package/dist/state/index.js +7 -0
  88. package/dist/state/index.js.map +1 -0
  89. package/dist/state/schema.d.ts +49 -0
  90. package/dist/state/schema.js +25 -0
  91. package/dist/state/schema.js.map +1 -0
  92. package/dist/state/types.d.ts +137 -0
  93. package/dist/state/types.js +9 -0
  94. package/dist/state/types.js.map +1 -0
  95. package/dist/telemetry/adapters/posthog.d.ts +1 -1
  96. package/dist/telemetry/adapters/posthog.js +1 -1
  97. package/dist/telemetry/adapters/posthog.js.map +1 -1
  98. package/dist/types.d.ts +8 -0
  99. package/package.json +2 -2
  100. package/schema/canvas-config.schema.json +205 -0
  101. package/schema/runtime-context.schema.json +131 -0
@@ -0,0 +1,2166 @@
1
+ /**
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
+ type: "page_url";
10
+ url: string;
11
+ }, {
12
+ type: "page_url";
13
+ url: string;
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
+ type: "anchor_visible";
31
+ state: "visible" | "present" | "absent";
32
+ anchorId: string;
33
+ }, {
34
+ type: "anchor_visible";
35
+ state: "visible" | "present" | "absent";
36
+ anchorId: string;
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 ConditionZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
142
+ type: z.ZodLiteral<"page_url">;
143
+ url: z.ZodString;
144
+ }, "strip", z.ZodTypeAny, {
145
+ type: "page_url";
146
+ url: string;
147
+ }, {
148
+ type: "page_url";
149
+ url: string;
150
+ }>, z.ZodObject<{
151
+ type: z.ZodLiteral<"route">;
152
+ routeId: z.ZodString;
153
+ }, "strip", z.ZodTypeAny, {
154
+ type: "route";
155
+ routeId: string;
156
+ }, {
157
+ type: "route";
158
+ routeId: string;
159
+ }>, z.ZodObject<{
160
+ type: z.ZodLiteral<"anchor_visible">;
161
+ anchorId: z.ZodString;
162
+ state: z.ZodEnum<["visible", "present", "absent"]>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ type: "anchor_visible";
165
+ state: "visible" | "present" | "absent";
166
+ anchorId: string;
167
+ }, {
168
+ type: "anchor_visible";
169
+ state: "visible" | "present" | "absent";
170
+ anchorId: string;
171
+ }>, z.ZodObject<{
172
+ type: z.ZodLiteral<"event_occurred">;
173
+ eventName: z.ZodString;
174
+ withinMs: z.ZodOptional<z.ZodNumber>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "event_occurred";
177
+ eventName: string;
178
+ withinMs?: number | undefined;
179
+ }, {
180
+ type: "event_occurred";
181
+ eventName: string;
182
+ withinMs?: number | undefined;
183
+ }>, z.ZodObject<{
184
+ type: z.ZodLiteral<"state_equals">;
185
+ key: z.ZodString;
186
+ value: z.ZodUnknown;
187
+ }, "strip", z.ZodTypeAny, {
188
+ type: "state_equals";
189
+ key: string;
190
+ value?: unknown;
191
+ }, {
192
+ type: "state_equals";
193
+ key: string;
194
+ value?: unknown;
195
+ }>, z.ZodObject<{
196
+ type: z.ZodLiteral<"viewport">;
197
+ minWidth: z.ZodOptional<z.ZodNumber>;
198
+ maxWidth: z.ZodOptional<z.ZodNumber>;
199
+ minHeight: z.ZodOptional<z.ZodNumber>;
200
+ maxHeight: z.ZodOptional<z.ZodNumber>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ type: "viewport";
203
+ minWidth?: number | undefined;
204
+ maxWidth?: number | undefined;
205
+ minHeight?: number | undefined;
206
+ maxHeight?: number | undefined;
207
+ }, {
208
+ type: "viewport";
209
+ minWidth?: number | undefined;
210
+ maxWidth?: number | undefined;
211
+ minHeight?: number | undefined;
212
+ maxHeight?: number | undefined;
213
+ }>, z.ZodObject<{
214
+ type: z.ZodLiteral<"session_metric">;
215
+ key: z.ZodString;
216
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
217
+ threshold: z.ZodNumber;
218
+ }, "strip", z.ZodTypeAny, {
219
+ type: "session_metric";
220
+ key: string;
221
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
222
+ threshold: number;
223
+ }, {
224
+ type: "session_metric";
225
+ key: string;
226
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
227
+ threshold: number;
228
+ }>, z.ZodObject<{
229
+ type: z.ZodLiteral<"dismissed">;
230
+ key: z.ZodString;
231
+ inverted: z.ZodOptional<z.ZodBoolean>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ type: "dismissed";
234
+ key: string;
235
+ inverted?: boolean | undefined;
236
+ }, {
237
+ type: "dismissed";
238
+ key: string;
239
+ inverted?: boolean | undefined;
240
+ }>, z.ZodObject<{
241
+ type: z.ZodLiteral<"cooldown_active">;
242
+ key: z.ZodString;
243
+ inverted: z.ZodOptional<z.ZodBoolean>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ type: "cooldown_active";
246
+ key: string;
247
+ inverted?: boolean | undefined;
248
+ }, {
249
+ type: "cooldown_active";
250
+ key: string;
251
+ inverted?: boolean | undefined;
252
+ }>, z.ZodObject<{
253
+ type: z.ZodLiteral<"frequency_limit">;
254
+ key: z.ZodString;
255
+ limit: z.ZodNumber;
256
+ inverted: z.ZodOptional<z.ZodBoolean>;
257
+ }, "strip", z.ZodTypeAny, {
258
+ type: "frequency_limit";
259
+ key: string;
260
+ limit: number;
261
+ inverted?: boolean | undefined;
262
+ }, {
263
+ type: "frequency_limit";
264
+ key: string;
265
+ limit: number;
266
+ inverted?: boolean | undefined;
267
+ }>]>;
268
+ export declare const RuleZ: z.ZodObject<{
269
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
270
+ type: z.ZodLiteral<"page_url">;
271
+ url: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ type: "page_url";
274
+ url: string;
275
+ }, {
276
+ type: "page_url";
277
+ url: string;
278
+ }>, z.ZodObject<{
279
+ type: z.ZodLiteral<"route">;
280
+ routeId: z.ZodString;
281
+ }, "strip", z.ZodTypeAny, {
282
+ type: "route";
283
+ routeId: string;
284
+ }, {
285
+ type: "route";
286
+ routeId: string;
287
+ }>, z.ZodObject<{
288
+ type: z.ZodLiteral<"anchor_visible">;
289
+ anchorId: z.ZodString;
290
+ state: z.ZodEnum<["visible", "present", "absent"]>;
291
+ }, "strip", z.ZodTypeAny, {
292
+ type: "anchor_visible";
293
+ state: "visible" | "present" | "absent";
294
+ anchorId: string;
295
+ }, {
296
+ type: "anchor_visible";
297
+ state: "visible" | "present" | "absent";
298
+ anchorId: string;
299
+ }>, z.ZodObject<{
300
+ type: z.ZodLiteral<"event_occurred">;
301
+ eventName: z.ZodString;
302
+ withinMs: z.ZodOptional<z.ZodNumber>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ type: "event_occurred";
305
+ eventName: string;
306
+ withinMs?: number | undefined;
307
+ }, {
308
+ type: "event_occurred";
309
+ eventName: string;
310
+ withinMs?: number | undefined;
311
+ }>, z.ZodObject<{
312
+ type: z.ZodLiteral<"state_equals">;
313
+ key: z.ZodString;
314
+ value: z.ZodUnknown;
315
+ }, "strip", z.ZodTypeAny, {
316
+ type: "state_equals";
317
+ key: string;
318
+ value?: unknown;
319
+ }, {
320
+ type: "state_equals";
321
+ key: string;
322
+ value?: unknown;
323
+ }>, z.ZodObject<{
324
+ type: z.ZodLiteral<"viewport">;
325
+ minWidth: z.ZodOptional<z.ZodNumber>;
326
+ maxWidth: z.ZodOptional<z.ZodNumber>;
327
+ minHeight: z.ZodOptional<z.ZodNumber>;
328
+ maxHeight: z.ZodOptional<z.ZodNumber>;
329
+ }, "strip", z.ZodTypeAny, {
330
+ type: "viewport";
331
+ minWidth?: number | undefined;
332
+ maxWidth?: number | undefined;
333
+ minHeight?: number | undefined;
334
+ maxHeight?: number | undefined;
335
+ }, {
336
+ type: "viewport";
337
+ minWidth?: number | undefined;
338
+ maxWidth?: number | undefined;
339
+ minHeight?: number | undefined;
340
+ maxHeight?: number | undefined;
341
+ }>, z.ZodObject<{
342
+ type: z.ZodLiteral<"session_metric">;
343
+ key: z.ZodString;
344
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
345
+ threshold: z.ZodNumber;
346
+ }, "strip", z.ZodTypeAny, {
347
+ type: "session_metric";
348
+ key: string;
349
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
350
+ threshold: number;
351
+ }, {
352
+ type: "session_metric";
353
+ key: string;
354
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
355
+ threshold: number;
356
+ }>, z.ZodObject<{
357
+ type: z.ZodLiteral<"dismissed">;
358
+ key: z.ZodString;
359
+ inverted: z.ZodOptional<z.ZodBoolean>;
360
+ }, "strip", z.ZodTypeAny, {
361
+ type: "dismissed";
362
+ key: string;
363
+ inverted?: boolean | undefined;
364
+ }, {
365
+ type: "dismissed";
366
+ key: string;
367
+ inverted?: boolean | undefined;
368
+ }>, z.ZodObject<{
369
+ type: z.ZodLiteral<"cooldown_active">;
370
+ key: z.ZodString;
371
+ inverted: z.ZodOptional<z.ZodBoolean>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ type: "cooldown_active";
374
+ key: string;
375
+ inverted?: boolean | undefined;
376
+ }, {
377
+ type: "cooldown_active";
378
+ key: string;
379
+ inverted?: boolean | undefined;
380
+ }>, z.ZodObject<{
381
+ type: z.ZodLiteral<"frequency_limit">;
382
+ key: z.ZodString;
383
+ limit: z.ZodNumber;
384
+ inverted: z.ZodOptional<z.ZodBoolean>;
385
+ }, "strip", z.ZodTypeAny, {
386
+ type: "frequency_limit";
387
+ key: string;
388
+ limit: number;
389
+ inverted?: boolean | undefined;
390
+ }, {
391
+ type: "frequency_limit";
392
+ key: string;
393
+ limit: number;
394
+ inverted?: boolean | undefined;
395
+ }>]>, "many">;
396
+ value: z.ZodUnknown;
397
+ }, "strip", z.ZodTypeAny, {
398
+ conditions: ({
399
+ type: "page_url";
400
+ url: string;
401
+ } | {
402
+ type: "route";
403
+ routeId: string;
404
+ } | {
405
+ type: "anchor_visible";
406
+ state: "visible" | "present" | "absent";
407
+ anchorId: string;
408
+ } | {
409
+ type: "event_occurred";
410
+ eventName: string;
411
+ withinMs?: number | undefined;
412
+ } | {
413
+ type: "state_equals";
414
+ key: string;
415
+ value?: unknown;
416
+ } | {
417
+ type: "viewport";
418
+ minWidth?: number | undefined;
419
+ maxWidth?: number | undefined;
420
+ minHeight?: number | undefined;
421
+ maxHeight?: number | undefined;
422
+ } | {
423
+ type: "session_metric";
424
+ key: string;
425
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
426
+ threshold: number;
427
+ } | {
428
+ type: "dismissed";
429
+ key: string;
430
+ inverted?: boolean | undefined;
431
+ } | {
432
+ type: "cooldown_active";
433
+ key: string;
434
+ inverted?: boolean | undefined;
435
+ } | {
436
+ type: "frequency_limit";
437
+ key: string;
438
+ limit: number;
439
+ inverted?: boolean | undefined;
440
+ })[];
441
+ value?: unknown;
442
+ }, {
443
+ conditions: ({
444
+ type: "page_url";
445
+ url: string;
446
+ } | {
447
+ type: "route";
448
+ routeId: string;
449
+ } | {
450
+ type: "anchor_visible";
451
+ state: "visible" | "present" | "absent";
452
+ anchorId: string;
453
+ } | {
454
+ type: "event_occurred";
455
+ eventName: string;
456
+ withinMs?: number | undefined;
457
+ } | {
458
+ type: "state_equals";
459
+ key: string;
460
+ value?: unknown;
461
+ } | {
462
+ type: "viewport";
463
+ minWidth?: number | undefined;
464
+ maxWidth?: number | undefined;
465
+ minHeight?: number | undefined;
466
+ maxHeight?: number | undefined;
467
+ } | {
468
+ type: "session_metric";
469
+ key: string;
470
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
471
+ threshold: number;
472
+ } | {
473
+ type: "dismissed";
474
+ key: string;
475
+ inverted?: boolean | undefined;
476
+ } | {
477
+ type: "cooldown_active";
478
+ key: string;
479
+ inverted?: boolean | undefined;
480
+ } | {
481
+ type: "frequency_limit";
482
+ key: string;
483
+ limit: number;
484
+ inverted?: boolean | undefined;
485
+ })[];
486
+ value?: unknown;
487
+ }>;
488
+ export declare const RuleStrategyZ: z.ZodObject<{
489
+ type: z.ZodLiteral<"rules">;
490
+ rules: z.ZodArray<z.ZodObject<{
491
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
492
+ type: z.ZodLiteral<"page_url">;
493
+ url: z.ZodString;
494
+ }, "strip", z.ZodTypeAny, {
495
+ type: "page_url";
496
+ url: string;
497
+ }, {
498
+ type: "page_url";
499
+ url: string;
500
+ }>, z.ZodObject<{
501
+ type: z.ZodLiteral<"route">;
502
+ routeId: z.ZodString;
503
+ }, "strip", z.ZodTypeAny, {
504
+ type: "route";
505
+ routeId: string;
506
+ }, {
507
+ type: "route";
508
+ routeId: string;
509
+ }>, z.ZodObject<{
510
+ type: z.ZodLiteral<"anchor_visible">;
511
+ anchorId: z.ZodString;
512
+ state: z.ZodEnum<["visible", "present", "absent"]>;
513
+ }, "strip", z.ZodTypeAny, {
514
+ type: "anchor_visible";
515
+ state: "visible" | "present" | "absent";
516
+ anchorId: string;
517
+ }, {
518
+ type: "anchor_visible";
519
+ state: "visible" | "present" | "absent";
520
+ anchorId: string;
521
+ }>, z.ZodObject<{
522
+ type: z.ZodLiteral<"event_occurred">;
523
+ eventName: z.ZodString;
524
+ withinMs: z.ZodOptional<z.ZodNumber>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ type: "event_occurred";
527
+ eventName: string;
528
+ withinMs?: number | undefined;
529
+ }, {
530
+ type: "event_occurred";
531
+ eventName: string;
532
+ withinMs?: number | undefined;
533
+ }>, z.ZodObject<{
534
+ type: z.ZodLiteral<"state_equals">;
535
+ key: z.ZodString;
536
+ value: z.ZodUnknown;
537
+ }, "strip", z.ZodTypeAny, {
538
+ type: "state_equals";
539
+ key: string;
540
+ value?: unknown;
541
+ }, {
542
+ type: "state_equals";
543
+ key: string;
544
+ value?: unknown;
545
+ }>, z.ZodObject<{
546
+ type: z.ZodLiteral<"viewport">;
547
+ minWidth: z.ZodOptional<z.ZodNumber>;
548
+ maxWidth: z.ZodOptional<z.ZodNumber>;
549
+ minHeight: z.ZodOptional<z.ZodNumber>;
550
+ maxHeight: z.ZodOptional<z.ZodNumber>;
551
+ }, "strip", z.ZodTypeAny, {
552
+ type: "viewport";
553
+ minWidth?: number | undefined;
554
+ maxWidth?: number | undefined;
555
+ minHeight?: number | undefined;
556
+ maxHeight?: number | undefined;
557
+ }, {
558
+ type: "viewport";
559
+ minWidth?: number | undefined;
560
+ maxWidth?: number | undefined;
561
+ minHeight?: number | undefined;
562
+ maxHeight?: number | undefined;
563
+ }>, z.ZodObject<{
564
+ type: z.ZodLiteral<"session_metric">;
565
+ key: z.ZodString;
566
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
567
+ threshold: z.ZodNumber;
568
+ }, "strip", z.ZodTypeAny, {
569
+ type: "session_metric";
570
+ key: string;
571
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
572
+ threshold: number;
573
+ }, {
574
+ type: "session_metric";
575
+ key: string;
576
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
577
+ threshold: number;
578
+ }>, z.ZodObject<{
579
+ type: z.ZodLiteral<"dismissed">;
580
+ key: z.ZodString;
581
+ inverted: z.ZodOptional<z.ZodBoolean>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ type: "dismissed";
584
+ key: string;
585
+ inverted?: boolean | undefined;
586
+ }, {
587
+ type: "dismissed";
588
+ key: string;
589
+ inverted?: boolean | undefined;
590
+ }>, z.ZodObject<{
591
+ type: z.ZodLiteral<"cooldown_active">;
592
+ key: z.ZodString;
593
+ inverted: z.ZodOptional<z.ZodBoolean>;
594
+ }, "strip", z.ZodTypeAny, {
595
+ type: "cooldown_active";
596
+ key: string;
597
+ inverted?: boolean | undefined;
598
+ }, {
599
+ type: "cooldown_active";
600
+ key: string;
601
+ inverted?: boolean | undefined;
602
+ }>, z.ZodObject<{
603
+ type: z.ZodLiteral<"frequency_limit">;
604
+ key: z.ZodString;
605
+ limit: z.ZodNumber;
606
+ inverted: z.ZodOptional<z.ZodBoolean>;
607
+ }, "strip", z.ZodTypeAny, {
608
+ type: "frequency_limit";
609
+ key: string;
610
+ limit: number;
611
+ inverted?: boolean | undefined;
612
+ }, {
613
+ type: "frequency_limit";
614
+ key: string;
615
+ limit: number;
616
+ inverted?: boolean | undefined;
617
+ }>]>, "many">;
618
+ value: z.ZodUnknown;
619
+ }, "strip", z.ZodTypeAny, {
620
+ conditions: ({
621
+ type: "page_url";
622
+ url: string;
623
+ } | {
624
+ type: "route";
625
+ routeId: string;
626
+ } | {
627
+ type: "anchor_visible";
628
+ state: "visible" | "present" | "absent";
629
+ anchorId: string;
630
+ } | {
631
+ type: "event_occurred";
632
+ eventName: string;
633
+ withinMs?: number | undefined;
634
+ } | {
635
+ type: "state_equals";
636
+ key: string;
637
+ value?: unknown;
638
+ } | {
639
+ type: "viewport";
640
+ minWidth?: number | undefined;
641
+ maxWidth?: number | undefined;
642
+ minHeight?: number | undefined;
643
+ maxHeight?: number | undefined;
644
+ } | {
645
+ type: "session_metric";
646
+ key: string;
647
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
648
+ threshold: number;
649
+ } | {
650
+ type: "dismissed";
651
+ key: string;
652
+ inverted?: boolean | undefined;
653
+ } | {
654
+ type: "cooldown_active";
655
+ key: string;
656
+ inverted?: boolean | undefined;
657
+ } | {
658
+ type: "frequency_limit";
659
+ key: string;
660
+ limit: number;
661
+ inverted?: boolean | undefined;
662
+ })[];
663
+ value?: unknown;
664
+ }, {
665
+ conditions: ({
666
+ type: "page_url";
667
+ url: string;
668
+ } | {
669
+ type: "route";
670
+ routeId: string;
671
+ } | {
672
+ type: "anchor_visible";
673
+ state: "visible" | "present" | "absent";
674
+ anchorId: string;
675
+ } | {
676
+ type: "event_occurred";
677
+ eventName: string;
678
+ withinMs?: number | undefined;
679
+ } | {
680
+ type: "state_equals";
681
+ key: string;
682
+ value?: unknown;
683
+ } | {
684
+ type: "viewport";
685
+ minWidth?: number | undefined;
686
+ maxWidth?: number | undefined;
687
+ minHeight?: number | undefined;
688
+ maxHeight?: number | undefined;
689
+ } | {
690
+ type: "session_metric";
691
+ key: string;
692
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
693
+ threshold: number;
694
+ } | {
695
+ type: "dismissed";
696
+ key: string;
697
+ inverted?: boolean | undefined;
698
+ } | {
699
+ type: "cooldown_active";
700
+ key: string;
701
+ inverted?: boolean | undefined;
702
+ } | {
703
+ type: "frequency_limit";
704
+ key: string;
705
+ limit: number;
706
+ inverted?: boolean | undefined;
707
+ })[];
708
+ value?: unknown;
709
+ }>, "many">;
710
+ default: z.ZodUnknown;
711
+ }, "strip", z.ZodTypeAny, {
712
+ rules: {
713
+ conditions: ({
714
+ type: "page_url";
715
+ url: string;
716
+ } | {
717
+ type: "route";
718
+ routeId: string;
719
+ } | {
720
+ type: "anchor_visible";
721
+ state: "visible" | "present" | "absent";
722
+ anchorId: string;
723
+ } | {
724
+ type: "event_occurred";
725
+ eventName: string;
726
+ withinMs?: number | undefined;
727
+ } | {
728
+ type: "state_equals";
729
+ key: string;
730
+ value?: unknown;
731
+ } | {
732
+ type: "viewport";
733
+ minWidth?: number | undefined;
734
+ maxWidth?: number | undefined;
735
+ minHeight?: number | undefined;
736
+ maxHeight?: number | undefined;
737
+ } | {
738
+ type: "session_metric";
739
+ key: string;
740
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
741
+ threshold: number;
742
+ } | {
743
+ type: "dismissed";
744
+ key: string;
745
+ inverted?: boolean | undefined;
746
+ } | {
747
+ type: "cooldown_active";
748
+ key: string;
749
+ inverted?: boolean | undefined;
750
+ } | {
751
+ type: "frequency_limit";
752
+ key: string;
753
+ limit: number;
754
+ inverted?: boolean | undefined;
755
+ })[];
756
+ value?: unknown;
757
+ }[];
758
+ type: "rules";
759
+ default?: unknown;
760
+ }, {
761
+ rules: {
762
+ conditions: ({
763
+ type: "page_url";
764
+ url: string;
765
+ } | {
766
+ type: "route";
767
+ routeId: string;
768
+ } | {
769
+ type: "anchor_visible";
770
+ state: "visible" | "present" | "absent";
771
+ anchorId: string;
772
+ } | {
773
+ type: "event_occurred";
774
+ eventName: string;
775
+ withinMs?: number | undefined;
776
+ } | {
777
+ type: "state_equals";
778
+ key: string;
779
+ value?: unknown;
780
+ } | {
781
+ type: "viewport";
782
+ minWidth?: number | undefined;
783
+ maxWidth?: number | undefined;
784
+ minHeight?: number | undefined;
785
+ maxHeight?: number | undefined;
786
+ } | {
787
+ type: "session_metric";
788
+ key: string;
789
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
790
+ threshold: number;
791
+ } | {
792
+ type: "dismissed";
793
+ key: string;
794
+ inverted?: boolean | undefined;
795
+ } | {
796
+ type: "cooldown_active";
797
+ key: string;
798
+ inverted?: boolean | undefined;
799
+ } | {
800
+ type: "frequency_limit";
801
+ key: string;
802
+ limit: number;
803
+ inverted?: boolean | undefined;
804
+ })[];
805
+ value?: unknown;
806
+ }[];
807
+ type: "rules";
808
+ default?: unknown;
809
+ }>;
810
+ export declare const ScoreStrategyZ: z.ZodObject<{
811
+ type: z.ZodLiteral<"score">;
812
+ field: z.ZodString;
813
+ threshold: z.ZodNumber;
814
+ above: z.ZodUnknown;
815
+ below: z.ZodUnknown;
816
+ }, "strip", z.ZodTypeAny, {
817
+ type: "score";
818
+ threshold: number;
819
+ field: string;
820
+ above?: unknown;
821
+ below?: unknown;
822
+ }, {
823
+ type: "score";
824
+ threshold: number;
825
+ field: string;
826
+ above?: unknown;
827
+ below?: unknown;
828
+ }>;
829
+ export declare const ModelStrategyZ: z.ZodObject<{
830
+ type: z.ZodLiteral<"model">;
831
+ modelId: z.ZodString;
832
+ inputs: z.ZodArray<z.ZodString, "many">;
833
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
834
+ default: z.ZodUnknown;
835
+ }, "strip", z.ZodTypeAny, {
836
+ type: "model";
837
+ modelId: string;
838
+ inputs: string[];
839
+ outputMapping: Record<string, unknown>;
840
+ default?: unknown;
841
+ }, {
842
+ type: "model";
843
+ modelId: string;
844
+ inputs: string[];
845
+ outputMapping: Record<string, unknown>;
846
+ default?: unknown;
847
+ }>;
848
+ export declare const ExternalStrategyZ: z.ZodObject<{
849
+ type: z.ZodLiteral<"external">;
850
+ endpoint: z.ZodString;
851
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
852
+ default: z.ZodUnknown;
853
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
854
+ }, "strip", z.ZodTypeAny, {
855
+ type: "external";
856
+ endpoint: string;
857
+ timeoutMs?: number | undefined;
858
+ default?: unknown;
859
+ method?: "GET" | "POST" | undefined;
860
+ }, {
861
+ type: "external";
862
+ endpoint: string;
863
+ timeoutMs?: number | undefined;
864
+ default?: unknown;
865
+ method?: "GET" | "POST" | undefined;
866
+ }>;
867
+ export declare const DecisionStrategyZ: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
868
+ type: z.ZodLiteral<"rules">;
869
+ rules: z.ZodArray<z.ZodObject<{
870
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
871
+ type: z.ZodLiteral<"page_url">;
872
+ url: z.ZodString;
873
+ }, "strip", z.ZodTypeAny, {
874
+ type: "page_url";
875
+ url: string;
876
+ }, {
877
+ type: "page_url";
878
+ url: string;
879
+ }>, z.ZodObject<{
880
+ type: z.ZodLiteral<"route">;
881
+ routeId: z.ZodString;
882
+ }, "strip", z.ZodTypeAny, {
883
+ type: "route";
884
+ routeId: string;
885
+ }, {
886
+ type: "route";
887
+ routeId: string;
888
+ }>, z.ZodObject<{
889
+ type: z.ZodLiteral<"anchor_visible">;
890
+ anchorId: z.ZodString;
891
+ state: z.ZodEnum<["visible", "present", "absent"]>;
892
+ }, "strip", z.ZodTypeAny, {
893
+ type: "anchor_visible";
894
+ state: "visible" | "present" | "absent";
895
+ anchorId: string;
896
+ }, {
897
+ type: "anchor_visible";
898
+ state: "visible" | "present" | "absent";
899
+ anchorId: string;
900
+ }>, z.ZodObject<{
901
+ type: z.ZodLiteral<"event_occurred">;
902
+ eventName: z.ZodString;
903
+ withinMs: z.ZodOptional<z.ZodNumber>;
904
+ }, "strip", z.ZodTypeAny, {
905
+ type: "event_occurred";
906
+ eventName: string;
907
+ withinMs?: number | undefined;
908
+ }, {
909
+ type: "event_occurred";
910
+ eventName: string;
911
+ withinMs?: number | undefined;
912
+ }>, z.ZodObject<{
913
+ type: z.ZodLiteral<"state_equals">;
914
+ key: z.ZodString;
915
+ value: z.ZodUnknown;
916
+ }, "strip", z.ZodTypeAny, {
917
+ type: "state_equals";
918
+ key: string;
919
+ value?: unknown;
920
+ }, {
921
+ type: "state_equals";
922
+ key: string;
923
+ value?: unknown;
924
+ }>, z.ZodObject<{
925
+ type: z.ZodLiteral<"viewport">;
926
+ minWidth: z.ZodOptional<z.ZodNumber>;
927
+ maxWidth: z.ZodOptional<z.ZodNumber>;
928
+ minHeight: z.ZodOptional<z.ZodNumber>;
929
+ maxHeight: z.ZodOptional<z.ZodNumber>;
930
+ }, "strip", z.ZodTypeAny, {
931
+ type: "viewport";
932
+ minWidth?: number | undefined;
933
+ maxWidth?: number | undefined;
934
+ minHeight?: number | undefined;
935
+ maxHeight?: number | undefined;
936
+ }, {
937
+ type: "viewport";
938
+ minWidth?: number | undefined;
939
+ maxWidth?: number | undefined;
940
+ minHeight?: number | undefined;
941
+ maxHeight?: number | undefined;
942
+ }>, z.ZodObject<{
943
+ type: z.ZodLiteral<"session_metric">;
944
+ key: z.ZodString;
945
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
946
+ threshold: z.ZodNumber;
947
+ }, "strip", z.ZodTypeAny, {
948
+ type: "session_metric";
949
+ key: string;
950
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
951
+ threshold: number;
952
+ }, {
953
+ type: "session_metric";
954
+ key: string;
955
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
956
+ threshold: number;
957
+ }>, z.ZodObject<{
958
+ type: z.ZodLiteral<"dismissed">;
959
+ key: z.ZodString;
960
+ inverted: z.ZodOptional<z.ZodBoolean>;
961
+ }, "strip", z.ZodTypeAny, {
962
+ type: "dismissed";
963
+ key: string;
964
+ inverted?: boolean | undefined;
965
+ }, {
966
+ type: "dismissed";
967
+ key: string;
968
+ inverted?: boolean | undefined;
969
+ }>, z.ZodObject<{
970
+ type: z.ZodLiteral<"cooldown_active">;
971
+ key: z.ZodString;
972
+ inverted: z.ZodOptional<z.ZodBoolean>;
973
+ }, "strip", z.ZodTypeAny, {
974
+ type: "cooldown_active";
975
+ key: string;
976
+ inverted?: boolean | undefined;
977
+ }, {
978
+ type: "cooldown_active";
979
+ key: string;
980
+ inverted?: boolean | undefined;
981
+ }>, z.ZodObject<{
982
+ type: z.ZodLiteral<"frequency_limit">;
983
+ key: z.ZodString;
984
+ limit: z.ZodNumber;
985
+ inverted: z.ZodOptional<z.ZodBoolean>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ type: "frequency_limit";
988
+ key: string;
989
+ limit: number;
990
+ inverted?: boolean | undefined;
991
+ }, {
992
+ type: "frequency_limit";
993
+ key: string;
994
+ limit: number;
995
+ inverted?: boolean | undefined;
996
+ }>]>, "many">;
997
+ value: z.ZodUnknown;
998
+ }, "strip", z.ZodTypeAny, {
999
+ conditions: ({
1000
+ type: "page_url";
1001
+ url: string;
1002
+ } | {
1003
+ type: "route";
1004
+ routeId: string;
1005
+ } | {
1006
+ type: "anchor_visible";
1007
+ state: "visible" | "present" | "absent";
1008
+ anchorId: string;
1009
+ } | {
1010
+ type: "event_occurred";
1011
+ eventName: string;
1012
+ withinMs?: number | undefined;
1013
+ } | {
1014
+ type: "state_equals";
1015
+ key: string;
1016
+ value?: unknown;
1017
+ } | {
1018
+ type: "viewport";
1019
+ minWidth?: number | undefined;
1020
+ maxWidth?: number | undefined;
1021
+ minHeight?: number | undefined;
1022
+ maxHeight?: number | undefined;
1023
+ } | {
1024
+ type: "session_metric";
1025
+ key: string;
1026
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1027
+ threshold: number;
1028
+ } | {
1029
+ type: "dismissed";
1030
+ key: string;
1031
+ inverted?: boolean | undefined;
1032
+ } | {
1033
+ type: "cooldown_active";
1034
+ key: string;
1035
+ inverted?: boolean | undefined;
1036
+ } | {
1037
+ type: "frequency_limit";
1038
+ key: string;
1039
+ limit: number;
1040
+ inverted?: boolean | undefined;
1041
+ })[];
1042
+ value?: unknown;
1043
+ }, {
1044
+ conditions: ({
1045
+ type: "page_url";
1046
+ url: string;
1047
+ } | {
1048
+ type: "route";
1049
+ routeId: string;
1050
+ } | {
1051
+ type: "anchor_visible";
1052
+ state: "visible" | "present" | "absent";
1053
+ anchorId: string;
1054
+ } | {
1055
+ type: "event_occurred";
1056
+ eventName: string;
1057
+ withinMs?: number | undefined;
1058
+ } | {
1059
+ type: "state_equals";
1060
+ key: string;
1061
+ value?: unknown;
1062
+ } | {
1063
+ type: "viewport";
1064
+ minWidth?: number | undefined;
1065
+ maxWidth?: number | undefined;
1066
+ minHeight?: number | undefined;
1067
+ maxHeight?: number | undefined;
1068
+ } | {
1069
+ type: "session_metric";
1070
+ key: string;
1071
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1072
+ threshold: number;
1073
+ } | {
1074
+ type: "dismissed";
1075
+ key: string;
1076
+ inverted?: boolean | undefined;
1077
+ } | {
1078
+ type: "cooldown_active";
1079
+ key: string;
1080
+ inverted?: boolean | undefined;
1081
+ } | {
1082
+ type: "frequency_limit";
1083
+ key: string;
1084
+ limit: number;
1085
+ inverted?: boolean | undefined;
1086
+ })[];
1087
+ value?: unknown;
1088
+ }>, "many">;
1089
+ default: z.ZodUnknown;
1090
+ }, "strip", z.ZodTypeAny, {
1091
+ rules: {
1092
+ conditions: ({
1093
+ type: "page_url";
1094
+ url: string;
1095
+ } | {
1096
+ type: "route";
1097
+ routeId: string;
1098
+ } | {
1099
+ type: "anchor_visible";
1100
+ state: "visible" | "present" | "absent";
1101
+ anchorId: string;
1102
+ } | {
1103
+ type: "event_occurred";
1104
+ eventName: string;
1105
+ withinMs?: number | undefined;
1106
+ } | {
1107
+ type: "state_equals";
1108
+ key: string;
1109
+ value?: unknown;
1110
+ } | {
1111
+ type: "viewport";
1112
+ minWidth?: number | undefined;
1113
+ maxWidth?: number | undefined;
1114
+ minHeight?: number | undefined;
1115
+ maxHeight?: number | undefined;
1116
+ } | {
1117
+ type: "session_metric";
1118
+ key: string;
1119
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1120
+ threshold: number;
1121
+ } | {
1122
+ type: "dismissed";
1123
+ key: string;
1124
+ inverted?: boolean | undefined;
1125
+ } | {
1126
+ type: "cooldown_active";
1127
+ key: string;
1128
+ inverted?: boolean | undefined;
1129
+ } | {
1130
+ type: "frequency_limit";
1131
+ key: string;
1132
+ limit: number;
1133
+ inverted?: boolean | undefined;
1134
+ })[];
1135
+ value?: unknown;
1136
+ }[];
1137
+ type: "rules";
1138
+ default?: unknown;
1139
+ }, {
1140
+ rules: {
1141
+ conditions: ({
1142
+ type: "page_url";
1143
+ url: string;
1144
+ } | {
1145
+ type: "route";
1146
+ routeId: string;
1147
+ } | {
1148
+ type: "anchor_visible";
1149
+ state: "visible" | "present" | "absent";
1150
+ anchorId: string;
1151
+ } | {
1152
+ type: "event_occurred";
1153
+ eventName: string;
1154
+ withinMs?: number | undefined;
1155
+ } | {
1156
+ type: "state_equals";
1157
+ key: string;
1158
+ value?: unknown;
1159
+ } | {
1160
+ type: "viewport";
1161
+ minWidth?: number | undefined;
1162
+ maxWidth?: number | undefined;
1163
+ minHeight?: number | undefined;
1164
+ maxHeight?: number | undefined;
1165
+ } | {
1166
+ type: "session_metric";
1167
+ key: string;
1168
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1169
+ threshold: number;
1170
+ } | {
1171
+ type: "dismissed";
1172
+ key: string;
1173
+ inverted?: boolean | undefined;
1174
+ } | {
1175
+ type: "cooldown_active";
1176
+ key: string;
1177
+ inverted?: boolean | undefined;
1178
+ } | {
1179
+ type: "frequency_limit";
1180
+ key: string;
1181
+ limit: number;
1182
+ inverted?: boolean | undefined;
1183
+ })[];
1184
+ value?: unknown;
1185
+ }[];
1186
+ type: "rules";
1187
+ default?: unknown;
1188
+ }>, z.ZodObject<{
1189
+ type: z.ZodLiteral<"score">;
1190
+ field: z.ZodString;
1191
+ threshold: z.ZodNumber;
1192
+ above: z.ZodUnknown;
1193
+ below: z.ZodUnknown;
1194
+ }, "strip", z.ZodTypeAny, {
1195
+ type: "score";
1196
+ threshold: number;
1197
+ field: string;
1198
+ above?: unknown;
1199
+ below?: unknown;
1200
+ }, {
1201
+ type: "score";
1202
+ threshold: number;
1203
+ field: string;
1204
+ above?: unknown;
1205
+ below?: unknown;
1206
+ }>, z.ZodObject<{
1207
+ type: z.ZodLiteral<"model">;
1208
+ modelId: z.ZodString;
1209
+ inputs: z.ZodArray<z.ZodString, "many">;
1210
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1211
+ default: z.ZodUnknown;
1212
+ }, "strip", z.ZodTypeAny, {
1213
+ type: "model";
1214
+ modelId: string;
1215
+ inputs: string[];
1216
+ outputMapping: Record<string, unknown>;
1217
+ default?: unknown;
1218
+ }, {
1219
+ type: "model";
1220
+ modelId: string;
1221
+ inputs: string[];
1222
+ outputMapping: Record<string, unknown>;
1223
+ default?: unknown;
1224
+ }>, z.ZodObject<{
1225
+ type: z.ZodLiteral<"external">;
1226
+ endpoint: z.ZodString;
1227
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1228
+ default: z.ZodUnknown;
1229
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1230
+ }, "strip", z.ZodTypeAny, {
1231
+ type: "external";
1232
+ endpoint: string;
1233
+ timeoutMs?: number | undefined;
1234
+ default?: unknown;
1235
+ method?: "GET" | "POST" | undefined;
1236
+ }, {
1237
+ type: "external";
1238
+ endpoint: string;
1239
+ timeoutMs?: number | undefined;
1240
+ default?: unknown;
1241
+ method?: "GET" | "POST" | undefined;
1242
+ }>]>;
1243
+ export declare const RouteFilterZ: z.ZodObject<{
1244
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1245
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1246
+ }, "strip", z.ZodTypeAny, {
1247
+ include?: string[] | undefined;
1248
+ exclude?: string[] | undefined;
1249
+ }, {
1250
+ include?: string[] | undefined;
1251
+ exclude?: string[] | undefined;
1252
+ }>;
1253
+ export declare const ActivationConfigZ: z.ZodObject<{
1254
+ routes: z.ZodOptional<z.ZodObject<{
1255
+ include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1256
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1257
+ }, "strip", z.ZodTypeAny, {
1258
+ include?: string[] | undefined;
1259
+ exclude?: string[] | undefined;
1260
+ }, {
1261
+ include?: string[] | undefined;
1262
+ exclude?: string[] | undefined;
1263
+ }>>;
1264
+ strategy: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1265
+ type: z.ZodLiteral<"rules">;
1266
+ rules: z.ZodArray<z.ZodObject<{
1267
+ conditions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1268
+ type: z.ZodLiteral<"page_url">;
1269
+ url: z.ZodString;
1270
+ }, "strip", z.ZodTypeAny, {
1271
+ type: "page_url";
1272
+ url: string;
1273
+ }, {
1274
+ type: "page_url";
1275
+ url: string;
1276
+ }>, z.ZodObject<{
1277
+ type: z.ZodLiteral<"route">;
1278
+ routeId: z.ZodString;
1279
+ }, "strip", z.ZodTypeAny, {
1280
+ type: "route";
1281
+ routeId: string;
1282
+ }, {
1283
+ type: "route";
1284
+ routeId: string;
1285
+ }>, z.ZodObject<{
1286
+ type: z.ZodLiteral<"anchor_visible">;
1287
+ anchorId: z.ZodString;
1288
+ state: z.ZodEnum<["visible", "present", "absent"]>;
1289
+ }, "strip", z.ZodTypeAny, {
1290
+ type: "anchor_visible";
1291
+ state: "visible" | "present" | "absent";
1292
+ anchorId: string;
1293
+ }, {
1294
+ type: "anchor_visible";
1295
+ state: "visible" | "present" | "absent";
1296
+ anchorId: string;
1297
+ }>, z.ZodObject<{
1298
+ type: z.ZodLiteral<"event_occurred">;
1299
+ eventName: z.ZodString;
1300
+ withinMs: z.ZodOptional<z.ZodNumber>;
1301
+ }, "strip", z.ZodTypeAny, {
1302
+ type: "event_occurred";
1303
+ eventName: string;
1304
+ withinMs?: number | undefined;
1305
+ }, {
1306
+ type: "event_occurred";
1307
+ eventName: string;
1308
+ withinMs?: number | undefined;
1309
+ }>, z.ZodObject<{
1310
+ type: z.ZodLiteral<"state_equals">;
1311
+ key: z.ZodString;
1312
+ value: z.ZodUnknown;
1313
+ }, "strip", z.ZodTypeAny, {
1314
+ type: "state_equals";
1315
+ key: string;
1316
+ value?: unknown;
1317
+ }, {
1318
+ type: "state_equals";
1319
+ key: string;
1320
+ value?: unknown;
1321
+ }>, z.ZodObject<{
1322
+ type: z.ZodLiteral<"viewport">;
1323
+ minWidth: z.ZodOptional<z.ZodNumber>;
1324
+ maxWidth: z.ZodOptional<z.ZodNumber>;
1325
+ minHeight: z.ZodOptional<z.ZodNumber>;
1326
+ maxHeight: z.ZodOptional<z.ZodNumber>;
1327
+ }, "strip", z.ZodTypeAny, {
1328
+ type: "viewport";
1329
+ minWidth?: number | undefined;
1330
+ maxWidth?: number | undefined;
1331
+ minHeight?: number | undefined;
1332
+ maxHeight?: number | undefined;
1333
+ }, {
1334
+ type: "viewport";
1335
+ minWidth?: number | undefined;
1336
+ maxWidth?: number | undefined;
1337
+ minHeight?: number | undefined;
1338
+ maxHeight?: number | undefined;
1339
+ }>, z.ZodObject<{
1340
+ type: z.ZodLiteral<"session_metric">;
1341
+ key: z.ZodString;
1342
+ operator: z.ZodEnum<["gte", "lte", "eq", "gt", "lt"]>;
1343
+ threshold: z.ZodNumber;
1344
+ }, "strip", z.ZodTypeAny, {
1345
+ type: "session_metric";
1346
+ key: string;
1347
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1348
+ threshold: number;
1349
+ }, {
1350
+ type: "session_metric";
1351
+ key: string;
1352
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1353
+ threshold: number;
1354
+ }>, z.ZodObject<{
1355
+ type: z.ZodLiteral<"dismissed">;
1356
+ key: z.ZodString;
1357
+ inverted: z.ZodOptional<z.ZodBoolean>;
1358
+ }, "strip", z.ZodTypeAny, {
1359
+ type: "dismissed";
1360
+ key: string;
1361
+ inverted?: boolean | undefined;
1362
+ }, {
1363
+ type: "dismissed";
1364
+ key: string;
1365
+ inverted?: boolean | undefined;
1366
+ }>, z.ZodObject<{
1367
+ type: z.ZodLiteral<"cooldown_active">;
1368
+ key: z.ZodString;
1369
+ inverted: z.ZodOptional<z.ZodBoolean>;
1370
+ }, "strip", z.ZodTypeAny, {
1371
+ type: "cooldown_active";
1372
+ key: string;
1373
+ inverted?: boolean | undefined;
1374
+ }, {
1375
+ type: "cooldown_active";
1376
+ key: string;
1377
+ inverted?: boolean | undefined;
1378
+ }>, z.ZodObject<{
1379
+ type: z.ZodLiteral<"frequency_limit">;
1380
+ key: z.ZodString;
1381
+ limit: z.ZodNumber;
1382
+ inverted: z.ZodOptional<z.ZodBoolean>;
1383
+ }, "strip", z.ZodTypeAny, {
1384
+ type: "frequency_limit";
1385
+ key: string;
1386
+ limit: number;
1387
+ inverted?: boolean | undefined;
1388
+ }, {
1389
+ type: "frequency_limit";
1390
+ key: string;
1391
+ limit: number;
1392
+ inverted?: boolean | undefined;
1393
+ }>]>, "many">;
1394
+ value: z.ZodUnknown;
1395
+ }, "strip", z.ZodTypeAny, {
1396
+ conditions: ({
1397
+ type: "page_url";
1398
+ url: string;
1399
+ } | {
1400
+ type: "route";
1401
+ routeId: string;
1402
+ } | {
1403
+ type: "anchor_visible";
1404
+ state: "visible" | "present" | "absent";
1405
+ anchorId: string;
1406
+ } | {
1407
+ type: "event_occurred";
1408
+ eventName: string;
1409
+ withinMs?: number | undefined;
1410
+ } | {
1411
+ type: "state_equals";
1412
+ key: string;
1413
+ value?: unknown;
1414
+ } | {
1415
+ type: "viewport";
1416
+ minWidth?: number | undefined;
1417
+ maxWidth?: number | undefined;
1418
+ minHeight?: number | undefined;
1419
+ maxHeight?: number | undefined;
1420
+ } | {
1421
+ type: "session_metric";
1422
+ key: string;
1423
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1424
+ threshold: number;
1425
+ } | {
1426
+ type: "dismissed";
1427
+ key: string;
1428
+ inverted?: boolean | undefined;
1429
+ } | {
1430
+ type: "cooldown_active";
1431
+ key: string;
1432
+ inverted?: boolean | undefined;
1433
+ } | {
1434
+ type: "frequency_limit";
1435
+ key: string;
1436
+ limit: number;
1437
+ inverted?: boolean | undefined;
1438
+ })[];
1439
+ value?: unknown;
1440
+ }, {
1441
+ conditions: ({
1442
+ type: "page_url";
1443
+ url: string;
1444
+ } | {
1445
+ type: "route";
1446
+ routeId: string;
1447
+ } | {
1448
+ type: "anchor_visible";
1449
+ state: "visible" | "present" | "absent";
1450
+ anchorId: string;
1451
+ } | {
1452
+ type: "event_occurred";
1453
+ eventName: string;
1454
+ withinMs?: number | undefined;
1455
+ } | {
1456
+ type: "state_equals";
1457
+ key: string;
1458
+ value?: unknown;
1459
+ } | {
1460
+ type: "viewport";
1461
+ minWidth?: number | undefined;
1462
+ maxWidth?: number | undefined;
1463
+ minHeight?: number | undefined;
1464
+ maxHeight?: number | undefined;
1465
+ } | {
1466
+ type: "session_metric";
1467
+ key: string;
1468
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1469
+ threshold: number;
1470
+ } | {
1471
+ type: "dismissed";
1472
+ key: string;
1473
+ inverted?: boolean | undefined;
1474
+ } | {
1475
+ type: "cooldown_active";
1476
+ key: string;
1477
+ inverted?: boolean | undefined;
1478
+ } | {
1479
+ type: "frequency_limit";
1480
+ key: string;
1481
+ limit: number;
1482
+ inverted?: boolean | undefined;
1483
+ })[];
1484
+ value?: unknown;
1485
+ }>, "many">;
1486
+ default: z.ZodUnknown;
1487
+ }, "strip", z.ZodTypeAny, {
1488
+ rules: {
1489
+ conditions: ({
1490
+ type: "page_url";
1491
+ url: string;
1492
+ } | {
1493
+ type: "route";
1494
+ routeId: string;
1495
+ } | {
1496
+ type: "anchor_visible";
1497
+ state: "visible" | "present" | "absent";
1498
+ anchorId: string;
1499
+ } | {
1500
+ type: "event_occurred";
1501
+ eventName: string;
1502
+ withinMs?: number | undefined;
1503
+ } | {
1504
+ type: "state_equals";
1505
+ key: string;
1506
+ value?: unknown;
1507
+ } | {
1508
+ type: "viewport";
1509
+ minWidth?: number | undefined;
1510
+ maxWidth?: number | undefined;
1511
+ minHeight?: number | undefined;
1512
+ maxHeight?: number | undefined;
1513
+ } | {
1514
+ type: "session_metric";
1515
+ key: string;
1516
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1517
+ threshold: number;
1518
+ } | {
1519
+ type: "dismissed";
1520
+ key: string;
1521
+ inverted?: boolean | undefined;
1522
+ } | {
1523
+ type: "cooldown_active";
1524
+ key: string;
1525
+ inverted?: boolean | undefined;
1526
+ } | {
1527
+ type: "frequency_limit";
1528
+ key: string;
1529
+ limit: number;
1530
+ inverted?: boolean | undefined;
1531
+ })[];
1532
+ value?: unknown;
1533
+ }[];
1534
+ type: "rules";
1535
+ default?: unknown;
1536
+ }, {
1537
+ rules: {
1538
+ conditions: ({
1539
+ type: "page_url";
1540
+ url: string;
1541
+ } | {
1542
+ type: "route";
1543
+ routeId: string;
1544
+ } | {
1545
+ type: "anchor_visible";
1546
+ state: "visible" | "present" | "absent";
1547
+ anchorId: string;
1548
+ } | {
1549
+ type: "event_occurred";
1550
+ eventName: string;
1551
+ withinMs?: number | undefined;
1552
+ } | {
1553
+ type: "state_equals";
1554
+ key: string;
1555
+ value?: unknown;
1556
+ } | {
1557
+ type: "viewport";
1558
+ minWidth?: number | undefined;
1559
+ maxWidth?: number | undefined;
1560
+ minHeight?: number | undefined;
1561
+ maxHeight?: number | undefined;
1562
+ } | {
1563
+ type: "session_metric";
1564
+ key: string;
1565
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1566
+ threshold: number;
1567
+ } | {
1568
+ type: "dismissed";
1569
+ key: string;
1570
+ inverted?: boolean | undefined;
1571
+ } | {
1572
+ type: "cooldown_active";
1573
+ key: string;
1574
+ inverted?: boolean | undefined;
1575
+ } | {
1576
+ type: "frequency_limit";
1577
+ key: string;
1578
+ limit: number;
1579
+ inverted?: boolean | undefined;
1580
+ })[];
1581
+ value?: unknown;
1582
+ }[];
1583
+ type: "rules";
1584
+ default?: unknown;
1585
+ }>, z.ZodObject<{
1586
+ type: z.ZodLiteral<"score">;
1587
+ field: z.ZodString;
1588
+ threshold: z.ZodNumber;
1589
+ above: z.ZodUnknown;
1590
+ below: z.ZodUnknown;
1591
+ }, "strip", z.ZodTypeAny, {
1592
+ type: "score";
1593
+ threshold: number;
1594
+ field: string;
1595
+ above?: unknown;
1596
+ below?: unknown;
1597
+ }, {
1598
+ type: "score";
1599
+ threshold: number;
1600
+ field: string;
1601
+ above?: unknown;
1602
+ below?: unknown;
1603
+ }>, z.ZodObject<{
1604
+ type: z.ZodLiteral<"model">;
1605
+ modelId: z.ZodString;
1606
+ inputs: z.ZodArray<z.ZodString, "many">;
1607
+ outputMapping: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1608
+ default: z.ZodUnknown;
1609
+ }, "strip", z.ZodTypeAny, {
1610
+ type: "model";
1611
+ modelId: string;
1612
+ inputs: string[];
1613
+ outputMapping: Record<string, unknown>;
1614
+ default?: unknown;
1615
+ }, {
1616
+ type: "model";
1617
+ modelId: string;
1618
+ inputs: string[];
1619
+ outputMapping: Record<string, unknown>;
1620
+ default?: unknown;
1621
+ }>, z.ZodObject<{
1622
+ type: z.ZodLiteral<"external">;
1623
+ endpoint: z.ZodString;
1624
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST"]>>;
1625
+ default: z.ZodUnknown;
1626
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1627
+ }, "strip", z.ZodTypeAny, {
1628
+ type: "external";
1629
+ endpoint: string;
1630
+ timeoutMs?: number | undefined;
1631
+ default?: unknown;
1632
+ method?: "GET" | "POST" | undefined;
1633
+ }, {
1634
+ type: "external";
1635
+ endpoint: string;
1636
+ timeoutMs?: number | undefined;
1637
+ default?: unknown;
1638
+ method?: "GET" | "POST" | undefined;
1639
+ }>]>>;
1640
+ }, "strip", z.ZodTypeAny, {
1641
+ routes?: {
1642
+ include?: string[] | undefined;
1643
+ exclude?: string[] | undefined;
1644
+ } | undefined;
1645
+ strategy?: {
1646
+ rules: {
1647
+ conditions: ({
1648
+ type: "page_url";
1649
+ url: string;
1650
+ } | {
1651
+ type: "route";
1652
+ routeId: string;
1653
+ } | {
1654
+ type: "anchor_visible";
1655
+ state: "visible" | "present" | "absent";
1656
+ anchorId: string;
1657
+ } | {
1658
+ type: "event_occurred";
1659
+ eventName: string;
1660
+ withinMs?: number | undefined;
1661
+ } | {
1662
+ type: "state_equals";
1663
+ key: string;
1664
+ value?: unknown;
1665
+ } | {
1666
+ type: "viewport";
1667
+ minWidth?: number | undefined;
1668
+ maxWidth?: number | undefined;
1669
+ minHeight?: number | undefined;
1670
+ maxHeight?: number | undefined;
1671
+ } | {
1672
+ type: "session_metric";
1673
+ key: string;
1674
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1675
+ threshold: number;
1676
+ } | {
1677
+ type: "dismissed";
1678
+ key: string;
1679
+ inverted?: boolean | undefined;
1680
+ } | {
1681
+ type: "cooldown_active";
1682
+ key: string;
1683
+ inverted?: boolean | undefined;
1684
+ } | {
1685
+ type: "frequency_limit";
1686
+ key: string;
1687
+ limit: number;
1688
+ inverted?: boolean | undefined;
1689
+ })[];
1690
+ value?: unknown;
1691
+ }[];
1692
+ type: "rules";
1693
+ default?: unknown;
1694
+ } | {
1695
+ type: "score";
1696
+ threshold: number;
1697
+ field: string;
1698
+ above?: unknown;
1699
+ below?: unknown;
1700
+ } | {
1701
+ type: "model";
1702
+ modelId: string;
1703
+ inputs: string[];
1704
+ outputMapping: Record<string, unknown>;
1705
+ default?: unknown;
1706
+ } | {
1707
+ type: "external";
1708
+ endpoint: string;
1709
+ timeoutMs?: number | undefined;
1710
+ default?: unknown;
1711
+ method?: "GET" | "POST" | undefined;
1712
+ } | undefined;
1713
+ }, {
1714
+ routes?: {
1715
+ include?: string[] | undefined;
1716
+ exclude?: string[] | undefined;
1717
+ } | undefined;
1718
+ strategy?: {
1719
+ rules: {
1720
+ conditions: ({
1721
+ type: "page_url";
1722
+ url: string;
1723
+ } | {
1724
+ type: "route";
1725
+ routeId: string;
1726
+ } | {
1727
+ type: "anchor_visible";
1728
+ state: "visible" | "present" | "absent";
1729
+ anchorId: string;
1730
+ } | {
1731
+ type: "event_occurred";
1732
+ eventName: string;
1733
+ withinMs?: number | undefined;
1734
+ } | {
1735
+ type: "state_equals";
1736
+ key: string;
1737
+ value?: unknown;
1738
+ } | {
1739
+ type: "viewport";
1740
+ minWidth?: number | undefined;
1741
+ maxWidth?: number | undefined;
1742
+ minHeight?: number | undefined;
1743
+ maxHeight?: number | undefined;
1744
+ } | {
1745
+ type: "session_metric";
1746
+ key: string;
1747
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1748
+ threshold: number;
1749
+ } | {
1750
+ type: "dismissed";
1751
+ key: string;
1752
+ inverted?: boolean | undefined;
1753
+ } | {
1754
+ type: "cooldown_active";
1755
+ key: string;
1756
+ inverted?: boolean | undefined;
1757
+ } | {
1758
+ type: "frequency_limit";
1759
+ key: string;
1760
+ limit: number;
1761
+ inverted?: boolean | undefined;
1762
+ })[];
1763
+ value?: unknown;
1764
+ }[];
1765
+ type: "rules";
1766
+ default?: unknown;
1767
+ } | {
1768
+ type: "score";
1769
+ threshold: number;
1770
+ field: string;
1771
+ above?: unknown;
1772
+ below?: unknown;
1773
+ } | {
1774
+ type: "model";
1775
+ modelId: string;
1776
+ inputs: string[];
1777
+ outputMapping: Record<string, unknown>;
1778
+ default?: unknown;
1779
+ } | {
1780
+ type: "external";
1781
+ endpoint: string;
1782
+ timeoutMs?: number | undefined;
1783
+ default?: unknown;
1784
+ method?: "GET" | "POST" | undefined;
1785
+ } | undefined;
1786
+ }>;
1787
+ /**
1788
+ * Validate a Condition object.
1789
+ */
1790
+ export declare function validateCondition(data: unknown): z.SafeParseReturnType<{
1791
+ type: "page_url";
1792
+ url: string;
1793
+ } | {
1794
+ type: "route";
1795
+ routeId: string;
1796
+ } | {
1797
+ type: "anchor_visible";
1798
+ state: "visible" | "present" | "absent";
1799
+ anchorId: string;
1800
+ } | {
1801
+ type: "event_occurred";
1802
+ eventName: string;
1803
+ withinMs?: number | undefined;
1804
+ } | {
1805
+ type: "state_equals";
1806
+ key: string;
1807
+ value?: unknown;
1808
+ } | {
1809
+ type: "viewport";
1810
+ minWidth?: number | undefined;
1811
+ maxWidth?: number | undefined;
1812
+ minHeight?: number | undefined;
1813
+ maxHeight?: number | undefined;
1814
+ } | {
1815
+ type: "session_metric";
1816
+ key: string;
1817
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1818
+ threshold: number;
1819
+ } | {
1820
+ type: "dismissed";
1821
+ key: string;
1822
+ inverted?: boolean | undefined;
1823
+ } | {
1824
+ type: "cooldown_active";
1825
+ key: string;
1826
+ inverted?: boolean | undefined;
1827
+ } | {
1828
+ type: "frequency_limit";
1829
+ key: string;
1830
+ limit: number;
1831
+ inverted?: boolean | undefined;
1832
+ }, {
1833
+ type: "page_url";
1834
+ url: string;
1835
+ } | {
1836
+ type: "route";
1837
+ routeId: string;
1838
+ } | {
1839
+ type: "anchor_visible";
1840
+ state: "visible" | "present" | "absent";
1841
+ anchorId: string;
1842
+ } | {
1843
+ type: "event_occurred";
1844
+ eventName: string;
1845
+ withinMs?: number | undefined;
1846
+ } | {
1847
+ type: "state_equals";
1848
+ key: string;
1849
+ value?: unknown;
1850
+ } | {
1851
+ type: "viewport";
1852
+ minWidth?: number | undefined;
1853
+ maxWidth?: number | undefined;
1854
+ minHeight?: number | undefined;
1855
+ maxHeight?: number | undefined;
1856
+ } | {
1857
+ type: "session_metric";
1858
+ key: string;
1859
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1860
+ threshold: number;
1861
+ } | {
1862
+ type: "dismissed";
1863
+ key: string;
1864
+ inverted?: boolean | undefined;
1865
+ } | {
1866
+ type: "cooldown_active";
1867
+ key: string;
1868
+ inverted?: boolean | undefined;
1869
+ } | {
1870
+ type: "frequency_limit";
1871
+ key: string;
1872
+ limit: number;
1873
+ inverted?: boolean | undefined;
1874
+ }>;
1875
+ /**
1876
+ * Validate a DecisionStrategy object.
1877
+ */
1878
+ export declare function validateStrategy(data: unknown): z.SafeParseReturnType<{
1879
+ rules: {
1880
+ conditions: ({
1881
+ type: "page_url";
1882
+ url: string;
1883
+ } | {
1884
+ type: "route";
1885
+ routeId: string;
1886
+ } | {
1887
+ type: "anchor_visible";
1888
+ state: "visible" | "present" | "absent";
1889
+ anchorId: string;
1890
+ } | {
1891
+ type: "event_occurred";
1892
+ eventName: string;
1893
+ withinMs?: number | undefined;
1894
+ } | {
1895
+ type: "state_equals";
1896
+ key: string;
1897
+ value?: unknown;
1898
+ } | {
1899
+ type: "viewport";
1900
+ minWidth?: number | undefined;
1901
+ maxWidth?: number | undefined;
1902
+ minHeight?: number | undefined;
1903
+ maxHeight?: number | undefined;
1904
+ } | {
1905
+ type: "session_metric";
1906
+ key: string;
1907
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1908
+ threshold: number;
1909
+ } | {
1910
+ type: "dismissed";
1911
+ key: string;
1912
+ inverted?: boolean | undefined;
1913
+ } | {
1914
+ type: "cooldown_active";
1915
+ key: string;
1916
+ inverted?: boolean | undefined;
1917
+ } | {
1918
+ type: "frequency_limit";
1919
+ key: string;
1920
+ limit: number;
1921
+ inverted?: boolean | undefined;
1922
+ })[];
1923
+ value?: unknown;
1924
+ }[];
1925
+ type: "rules";
1926
+ default?: unknown;
1927
+ } | {
1928
+ type: "score";
1929
+ threshold: number;
1930
+ field: string;
1931
+ above?: unknown;
1932
+ below?: unknown;
1933
+ } | {
1934
+ type: "model";
1935
+ modelId: string;
1936
+ inputs: string[];
1937
+ outputMapping: Record<string, unknown>;
1938
+ default?: unknown;
1939
+ } | {
1940
+ type: "external";
1941
+ endpoint: string;
1942
+ timeoutMs?: number | undefined;
1943
+ default?: unknown;
1944
+ method?: "GET" | "POST" | undefined;
1945
+ }, {
1946
+ rules: {
1947
+ conditions: ({
1948
+ type: "page_url";
1949
+ url: string;
1950
+ } | {
1951
+ type: "route";
1952
+ routeId: string;
1953
+ } | {
1954
+ type: "anchor_visible";
1955
+ state: "visible" | "present" | "absent";
1956
+ anchorId: string;
1957
+ } | {
1958
+ type: "event_occurred";
1959
+ eventName: string;
1960
+ withinMs?: number | undefined;
1961
+ } | {
1962
+ type: "state_equals";
1963
+ key: string;
1964
+ value?: unknown;
1965
+ } | {
1966
+ type: "viewport";
1967
+ minWidth?: number | undefined;
1968
+ maxWidth?: number | undefined;
1969
+ minHeight?: number | undefined;
1970
+ maxHeight?: number | undefined;
1971
+ } | {
1972
+ type: "session_metric";
1973
+ key: string;
1974
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
1975
+ threshold: number;
1976
+ } | {
1977
+ type: "dismissed";
1978
+ key: string;
1979
+ inverted?: boolean | undefined;
1980
+ } | {
1981
+ type: "cooldown_active";
1982
+ key: string;
1983
+ inverted?: boolean | undefined;
1984
+ } | {
1985
+ type: "frequency_limit";
1986
+ key: string;
1987
+ limit: number;
1988
+ inverted?: boolean | undefined;
1989
+ })[];
1990
+ value?: unknown;
1991
+ }[];
1992
+ type: "rules";
1993
+ default?: unknown;
1994
+ } | {
1995
+ type: "score";
1996
+ threshold: number;
1997
+ field: string;
1998
+ above?: unknown;
1999
+ below?: unknown;
2000
+ } | {
2001
+ type: "model";
2002
+ modelId: string;
2003
+ inputs: string[];
2004
+ outputMapping: Record<string, unknown>;
2005
+ default?: unknown;
2006
+ } | {
2007
+ type: "external";
2008
+ endpoint: string;
2009
+ timeoutMs?: number | undefined;
2010
+ default?: unknown;
2011
+ method?: "GET" | "POST" | undefined;
2012
+ }>;
2013
+ /**
2014
+ * Validate an ActivationConfig object.
2015
+ */
2016
+ export declare function validateActivationConfig(data: unknown): z.SafeParseReturnType<{
2017
+ routes?: {
2018
+ include?: string[] | undefined;
2019
+ exclude?: string[] | undefined;
2020
+ } | undefined;
2021
+ strategy?: {
2022
+ rules: {
2023
+ conditions: ({
2024
+ type: "page_url";
2025
+ url: string;
2026
+ } | {
2027
+ type: "route";
2028
+ routeId: string;
2029
+ } | {
2030
+ type: "anchor_visible";
2031
+ state: "visible" | "present" | "absent";
2032
+ anchorId: string;
2033
+ } | {
2034
+ type: "event_occurred";
2035
+ eventName: string;
2036
+ withinMs?: number | undefined;
2037
+ } | {
2038
+ type: "state_equals";
2039
+ key: string;
2040
+ value?: unknown;
2041
+ } | {
2042
+ type: "viewport";
2043
+ minWidth?: number | undefined;
2044
+ maxWidth?: number | undefined;
2045
+ minHeight?: number | undefined;
2046
+ maxHeight?: number | undefined;
2047
+ } | {
2048
+ type: "session_metric";
2049
+ key: string;
2050
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2051
+ threshold: number;
2052
+ } | {
2053
+ type: "dismissed";
2054
+ key: string;
2055
+ inverted?: boolean | undefined;
2056
+ } | {
2057
+ type: "cooldown_active";
2058
+ key: string;
2059
+ inverted?: boolean | undefined;
2060
+ } | {
2061
+ type: "frequency_limit";
2062
+ key: string;
2063
+ limit: number;
2064
+ inverted?: boolean | undefined;
2065
+ })[];
2066
+ value?: unknown;
2067
+ }[];
2068
+ type: "rules";
2069
+ default?: unknown;
2070
+ } | {
2071
+ type: "score";
2072
+ threshold: number;
2073
+ field: string;
2074
+ above?: unknown;
2075
+ below?: unknown;
2076
+ } | {
2077
+ type: "model";
2078
+ modelId: string;
2079
+ inputs: string[];
2080
+ outputMapping: Record<string, unknown>;
2081
+ default?: unknown;
2082
+ } | {
2083
+ type: "external";
2084
+ endpoint: string;
2085
+ timeoutMs?: number | undefined;
2086
+ default?: unknown;
2087
+ method?: "GET" | "POST" | undefined;
2088
+ } | undefined;
2089
+ }, {
2090
+ routes?: {
2091
+ include?: string[] | undefined;
2092
+ exclude?: string[] | undefined;
2093
+ } | undefined;
2094
+ strategy?: {
2095
+ rules: {
2096
+ conditions: ({
2097
+ type: "page_url";
2098
+ url: string;
2099
+ } | {
2100
+ type: "route";
2101
+ routeId: string;
2102
+ } | {
2103
+ type: "anchor_visible";
2104
+ state: "visible" | "present" | "absent";
2105
+ anchorId: string;
2106
+ } | {
2107
+ type: "event_occurred";
2108
+ eventName: string;
2109
+ withinMs?: number | undefined;
2110
+ } | {
2111
+ type: "state_equals";
2112
+ key: string;
2113
+ value?: unknown;
2114
+ } | {
2115
+ type: "viewport";
2116
+ minWidth?: number | undefined;
2117
+ maxWidth?: number | undefined;
2118
+ minHeight?: number | undefined;
2119
+ maxHeight?: number | undefined;
2120
+ } | {
2121
+ type: "session_metric";
2122
+ key: string;
2123
+ operator: "gte" | "lte" | "eq" | "gt" | "lt";
2124
+ threshold: number;
2125
+ } | {
2126
+ type: "dismissed";
2127
+ key: string;
2128
+ inverted?: boolean | undefined;
2129
+ } | {
2130
+ type: "cooldown_active";
2131
+ key: string;
2132
+ inverted?: boolean | undefined;
2133
+ } | {
2134
+ type: "frequency_limit";
2135
+ key: string;
2136
+ limit: number;
2137
+ inverted?: boolean | undefined;
2138
+ })[];
2139
+ value?: unknown;
2140
+ }[];
2141
+ type: "rules";
2142
+ default?: unknown;
2143
+ } | {
2144
+ type: "score";
2145
+ threshold: number;
2146
+ field: string;
2147
+ above?: unknown;
2148
+ below?: unknown;
2149
+ } | {
2150
+ type: "model";
2151
+ modelId: string;
2152
+ inputs: string[];
2153
+ outputMapping: Record<string, unknown>;
2154
+ default?: unknown;
2155
+ } | {
2156
+ type: "external";
2157
+ endpoint: string;
2158
+ timeoutMs?: number | undefined;
2159
+ default?: unknown;
2160
+ method?: "GET" | "POST" | undefined;
2161
+ } | undefined;
2162
+ }>;
2163
+ export type ConditionSchema = z.infer<typeof ConditionZ>;
2164
+ export type RuleSchema = z.infer<typeof RuleZ>;
2165
+ export type DecisionStrategySchema = z.infer<typeof DecisionStrategyZ>;
2166
+ export type ActivationConfigSchema = z.infer<typeof ActivationConfigZ>;