@syntrologie/adapt-gamification 2.8.0-canary.267 → 2.8.0-canary.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema.d.ts +44 -44
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +4 -6
- package/dist/schema.js.map +2 -2
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -293,7 +293,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
293
293
|
count: z.ZodNumber;
|
|
294
294
|
withinMs: z.ZodOptional<z.ZodNumber>;
|
|
295
295
|
counter: z.ZodOptional<z.ZodObject<{
|
|
296
|
-
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "
|
|
296
|
+
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "ui.hesitate", "ui.rage_click", "nav.page_view", "nav.page_leave"]>, "many">;
|
|
297
297
|
match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
298
298
|
equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
299
299
|
contains: z.ZodOptional<z.ZodString>;
|
|
@@ -305,13 +305,13 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
305
305
|
contains?: string | undefined;
|
|
306
306
|
}>>>;
|
|
307
307
|
}, "strip", z.ZodTypeAny, {
|
|
308
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
308
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
309
309
|
match?: Record<string, {
|
|
310
310
|
equals?: string | number | boolean | undefined;
|
|
311
311
|
contains?: string | undefined;
|
|
312
312
|
}> | undefined;
|
|
313
313
|
}, {
|
|
314
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
314
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
315
315
|
match?: Record<string, {
|
|
316
316
|
equals?: string | number | boolean | undefined;
|
|
317
317
|
contains?: string | undefined;
|
|
@@ -324,7 +324,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
324
324
|
count: number;
|
|
325
325
|
withinMs?: number | undefined;
|
|
326
326
|
counter?: {
|
|
327
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
327
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
328
328
|
match?: Record<string, {
|
|
329
329
|
equals?: string | number | boolean | undefined;
|
|
330
330
|
contains?: string | undefined;
|
|
@@ -337,7 +337,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
337
337
|
count: number;
|
|
338
338
|
withinMs?: number | undefined;
|
|
339
339
|
counter?: {
|
|
340
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
340
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
341
341
|
match?: Record<string, {
|
|
342
342
|
equals?: string | number | boolean | undefined;
|
|
343
343
|
contains?: string | undefined;
|
|
@@ -395,7 +395,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
395
395
|
count: number;
|
|
396
396
|
withinMs?: number | undefined;
|
|
397
397
|
counter?: {
|
|
398
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
398
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
399
399
|
match?: Record<string, {
|
|
400
400
|
equals?: string | number | boolean | undefined;
|
|
401
401
|
contains?: string | undefined;
|
|
@@ -453,7 +453,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
453
453
|
count: number;
|
|
454
454
|
withinMs?: number | undefined;
|
|
455
455
|
counter?: {
|
|
456
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
456
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
457
457
|
match?: Record<string, {
|
|
458
458
|
equals?: string | number | boolean | undefined;
|
|
459
459
|
contains?: string | undefined;
|
|
@@ -515,7 +515,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
515
515
|
count: number;
|
|
516
516
|
withinMs?: number | undefined;
|
|
517
517
|
counter?: {
|
|
518
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
518
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
519
519
|
match?: Record<string, {
|
|
520
520
|
equals?: string | number | boolean | undefined;
|
|
521
521
|
contains?: string | undefined;
|
|
@@ -577,7 +577,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
577
577
|
count: number;
|
|
578
578
|
withinMs?: number | undefined;
|
|
579
579
|
counter?: {
|
|
580
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
580
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
581
581
|
match?: Record<string, {
|
|
582
582
|
equals?: string | number | boolean | undefined;
|
|
583
583
|
contains?: string | undefined;
|
|
@@ -710,7 +710,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
710
710
|
count: number;
|
|
711
711
|
withinMs?: number | undefined;
|
|
712
712
|
counter?: {
|
|
713
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
713
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
714
714
|
match?: Record<string, {
|
|
715
715
|
equals?: string | number | boolean | undefined;
|
|
716
716
|
contains?: string | undefined;
|
|
@@ -803,7 +803,7 @@ export declare const AwardBadgeSchema: z.ZodObject<{
|
|
|
803
803
|
count: number;
|
|
804
804
|
withinMs?: number | undefined;
|
|
805
805
|
counter?: {
|
|
806
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
806
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
807
807
|
match?: Record<string, {
|
|
808
808
|
equals?: string | number | boolean | undefined;
|
|
809
809
|
contains?: string | undefined;
|
|
@@ -979,7 +979,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
979
979
|
count: z.ZodNumber;
|
|
980
980
|
withinMs: z.ZodOptional<z.ZodNumber>;
|
|
981
981
|
counter: z.ZodOptional<z.ZodObject<{
|
|
982
|
-
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "
|
|
982
|
+
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "ui.hesitate", "ui.rage_click", "nav.page_view", "nav.page_leave"]>, "many">;
|
|
983
983
|
match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
984
984
|
equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
985
985
|
contains: z.ZodOptional<z.ZodString>;
|
|
@@ -991,13 +991,13 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
991
991
|
contains?: string | undefined;
|
|
992
992
|
}>>>;
|
|
993
993
|
}, "strip", z.ZodTypeAny, {
|
|
994
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
994
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
995
995
|
match?: Record<string, {
|
|
996
996
|
equals?: string | number | boolean | undefined;
|
|
997
997
|
contains?: string | undefined;
|
|
998
998
|
}> | undefined;
|
|
999
999
|
}, {
|
|
1000
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1000
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1001
1001
|
match?: Record<string, {
|
|
1002
1002
|
equals?: string | number | boolean | undefined;
|
|
1003
1003
|
contains?: string | undefined;
|
|
@@ -1010,7 +1010,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1010
1010
|
count: number;
|
|
1011
1011
|
withinMs?: number | undefined;
|
|
1012
1012
|
counter?: {
|
|
1013
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1013
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1014
1014
|
match?: Record<string, {
|
|
1015
1015
|
equals?: string | number | boolean | undefined;
|
|
1016
1016
|
contains?: string | undefined;
|
|
@@ -1023,7 +1023,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1023
1023
|
count: number;
|
|
1024
1024
|
withinMs?: number | undefined;
|
|
1025
1025
|
counter?: {
|
|
1026
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1026
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1027
1027
|
match?: Record<string, {
|
|
1028
1028
|
equals?: string | number | boolean | undefined;
|
|
1029
1029
|
contains?: string | undefined;
|
|
@@ -1081,7 +1081,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1081
1081
|
count: number;
|
|
1082
1082
|
withinMs?: number | undefined;
|
|
1083
1083
|
counter?: {
|
|
1084
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1084
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1085
1085
|
match?: Record<string, {
|
|
1086
1086
|
equals?: string | number | boolean | undefined;
|
|
1087
1087
|
contains?: string | undefined;
|
|
@@ -1139,7 +1139,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1139
1139
|
count: number;
|
|
1140
1140
|
withinMs?: number | undefined;
|
|
1141
1141
|
counter?: {
|
|
1142
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1142
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1143
1143
|
match?: Record<string, {
|
|
1144
1144
|
equals?: string | number | boolean | undefined;
|
|
1145
1145
|
contains?: string | undefined;
|
|
@@ -1201,7 +1201,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1201
1201
|
count: number;
|
|
1202
1202
|
withinMs?: number | undefined;
|
|
1203
1203
|
counter?: {
|
|
1204
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1204
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1205
1205
|
match?: Record<string, {
|
|
1206
1206
|
equals?: string | number | boolean | undefined;
|
|
1207
1207
|
contains?: string | undefined;
|
|
@@ -1263,7 +1263,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1263
1263
|
count: number;
|
|
1264
1264
|
withinMs?: number | undefined;
|
|
1265
1265
|
counter?: {
|
|
1266
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1266
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1267
1267
|
match?: Record<string, {
|
|
1268
1268
|
equals?: string | number | boolean | undefined;
|
|
1269
1269
|
contains?: string | undefined;
|
|
@@ -1393,7 +1393,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1393
1393
|
count: number;
|
|
1394
1394
|
withinMs?: number | undefined;
|
|
1395
1395
|
counter?: {
|
|
1396
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1396
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1397
1397
|
match?: Record<string, {
|
|
1398
1398
|
equals?: string | number | boolean | undefined;
|
|
1399
1399
|
contains?: string | undefined;
|
|
@@ -1483,7 +1483,7 @@ export declare const AddPointsSchema: z.ZodObject<{
|
|
|
1483
1483
|
count: number;
|
|
1484
1484
|
withinMs?: number | undefined;
|
|
1485
1485
|
counter?: {
|
|
1486
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1486
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1487
1487
|
match?: Record<string, {
|
|
1488
1488
|
equals?: string | number | boolean | undefined;
|
|
1489
1489
|
contains?: string | undefined;
|
|
@@ -1672,7 +1672,7 @@ export declare const actionStepSchemas: ({
|
|
|
1672
1672
|
count: z.ZodNumber;
|
|
1673
1673
|
withinMs: z.ZodOptional<z.ZodNumber>;
|
|
1674
1674
|
counter: z.ZodOptional<z.ZodObject<{
|
|
1675
|
-
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "
|
|
1675
|
+
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "ui.hesitate", "ui.rage_click", "nav.page_view", "nav.page_leave"]>, "many">;
|
|
1676
1676
|
match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1677
1677
|
equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1678
1678
|
contains: z.ZodOptional<z.ZodString>;
|
|
@@ -1684,13 +1684,13 @@ export declare const actionStepSchemas: ({
|
|
|
1684
1684
|
contains?: string | undefined;
|
|
1685
1685
|
}>>>;
|
|
1686
1686
|
}, "strip", z.ZodTypeAny, {
|
|
1687
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1687
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1688
1688
|
match?: Record<string, {
|
|
1689
1689
|
equals?: string | number | boolean | undefined;
|
|
1690
1690
|
contains?: string | undefined;
|
|
1691
1691
|
}> | undefined;
|
|
1692
1692
|
}, {
|
|
1693
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1693
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1694
1694
|
match?: Record<string, {
|
|
1695
1695
|
equals?: string | number | boolean | undefined;
|
|
1696
1696
|
contains?: string | undefined;
|
|
@@ -1703,7 +1703,7 @@ export declare const actionStepSchemas: ({
|
|
|
1703
1703
|
count: number;
|
|
1704
1704
|
withinMs?: number | undefined;
|
|
1705
1705
|
counter?: {
|
|
1706
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1706
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1707
1707
|
match?: Record<string, {
|
|
1708
1708
|
equals?: string | number | boolean | undefined;
|
|
1709
1709
|
contains?: string | undefined;
|
|
@@ -1716,7 +1716,7 @@ export declare const actionStepSchemas: ({
|
|
|
1716
1716
|
count: number;
|
|
1717
1717
|
withinMs?: number | undefined;
|
|
1718
1718
|
counter?: {
|
|
1719
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1719
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1720
1720
|
match?: Record<string, {
|
|
1721
1721
|
equals?: string | number | boolean | undefined;
|
|
1722
1722
|
contains?: string | undefined;
|
|
@@ -1774,7 +1774,7 @@ export declare const actionStepSchemas: ({
|
|
|
1774
1774
|
count: number;
|
|
1775
1775
|
withinMs?: number | undefined;
|
|
1776
1776
|
counter?: {
|
|
1777
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1777
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1778
1778
|
match?: Record<string, {
|
|
1779
1779
|
equals?: string | number | boolean | undefined;
|
|
1780
1780
|
contains?: string | undefined;
|
|
@@ -1832,7 +1832,7 @@ export declare const actionStepSchemas: ({
|
|
|
1832
1832
|
count: number;
|
|
1833
1833
|
withinMs?: number | undefined;
|
|
1834
1834
|
counter?: {
|
|
1835
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1835
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1836
1836
|
match?: Record<string, {
|
|
1837
1837
|
equals?: string | number | boolean | undefined;
|
|
1838
1838
|
contains?: string | undefined;
|
|
@@ -1894,7 +1894,7 @@ export declare const actionStepSchemas: ({
|
|
|
1894
1894
|
count: number;
|
|
1895
1895
|
withinMs?: number | undefined;
|
|
1896
1896
|
counter?: {
|
|
1897
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1897
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1898
1898
|
match?: Record<string, {
|
|
1899
1899
|
equals?: string | number | boolean | undefined;
|
|
1900
1900
|
contains?: string | undefined;
|
|
@@ -1956,7 +1956,7 @@ export declare const actionStepSchemas: ({
|
|
|
1956
1956
|
count: number;
|
|
1957
1957
|
withinMs?: number | undefined;
|
|
1958
1958
|
counter?: {
|
|
1959
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
1959
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
1960
1960
|
match?: Record<string, {
|
|
1961
1961
|
equals?: string | number | boolean | undefined;
|
|
1962
1962
|
contains?: string | undefined;
|
|
@@ -2089,7 +2089,7 @@ export declare const actionStepSchemas: ({
|
|
|
2089
2089
|
count: number;
|
|
2090
2090
|
withinMs?: number | undefined;
|
|
2091
2091
|
counter?: {
|
|
2092
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2092
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2093
2093
|
match?: Record<string, {
|
|
2094
2094
|
equals?: string | number | boolean | undefined;
|
|
2095
2095
|
contains?: string | undefined;
|
|
@@ -2182,7 +2182,7 @@ export declare const actionStepSchemas: ({
|
|
|
2182
2182
|
count: number;
|
|
2183
2183
|
withinMs?: number | undefined;
|
|
2184
2184
|
counter?: {
|
|
2185
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2185
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2186
2186
|
match?: Record<string, {
|
|
2187
2187
|
equals?: string | number | boolean | undefined;
|
|
2188
2188
|
contains?: string | undefined;
|
|
@@ -2357,7 +2357,7 @@ export declare const actionStepSchemas: ({
|
|
|
2357
2357
|
count: z.ZodNumber;
|
|
2358
2358
|
withinMs: z.ZodOptional<z.ZodNumber>;
|
|
2359
2359
|
counter: z.ZodOptional<z.ZodObject<{
|
|
2360
|
-
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "
|
|
2360
|
+
events: z.ZodArray<z.ZodEnum<["ui.click", "ui.scroll", "ui.input", "ui.change", "ui.submit", "ui.hover", "ui.idle", "ui.scroll_thrash", "ui.focus_bounce", "ui.hesitate", "ui.rage_click", "nav.page_view", "nav.page_leave"]>, "many">;
|
|
2361
2361
|
match: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
2362
2362
|
equals: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
2363
2363
|
contains: z.ZodOptional<z.ZodString>;
|
|
@@ -2369,13 +2369,13 @@ export declare const actionStepSchemas: ({
|
|
|
2369
2369
|
contains?: string | undefined;
|
|
2370
2370
|
}>>>;
|
|
2371
2371
|
}, "strip", z.ZodTypeAny, {
|
|
2372
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2372
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2373
2373
|
match?: Record<string, {
|
|
2374
2374
|
equals?: string | number | boolean | undefined;
|
|
2375
2375
|
contains?: string | undefined;
|
|
2376
2376
|
}> | undefined;
|
|
2377
2377
|
}, {
|
|
2378
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2378
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2379
2379
|
match?: Record<string, {
|
|
2380
2380
|
equals?: string | number | boolean | undefined;
|
|
2381
2381
|
contains?: string | undefined;
|
|
@@ -2388,7 +2388,7 @@ export declare const actionStepSchemas: ({
|
|
|
2388
2388
|
count: number;
|
|
2389
2389
|
withinMs?: number | undefined;
|
|
2390
2390
|
counter?: {
|
|
2391
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2391
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2392
2392
|
match?: Record<string, {
|
|
2393
2393
|
equals?: string | number | boolean | undefined;
|
|
2394
2394
|
contains?: string | undefined;
|
|
@@ -2401,7 +2401,7 @@ export declare const actionStepSchemas: ({
|
|
|
2401
2401
|
count: number;
|
|
2402
2402
|
withinMs?: number | undefined;
|
|
2403
2403
|
counter?: {
|
|
2404
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2404
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2405
2405
|
match?: Record<string, {
|
|
2406
2406
|
equals?: string | number | boolean | undefined;
|
|
2407
2407
|
contains?: string | undefined;
|
|
@@ -2459,7 +2459,7 @@ export declare const actionStepSchemas: ({
|
|
|
2459
2459
|
count: number;
|
|
2460
2460
|
withinMs?: number | undefined;
|
|
2461
2461
|
counter?: {
|
|
2462
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2462
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2463
2463
|
match?: Record<string, {
|
|
2464
2464
|
equals?: string | number | boolean | undefined;
|
|
2465
2465
|
contains?: string | undefined;
|
|
@@ -2517,7 +2517,7 @@ export declare const actionStepSchemas: ({
|
|
|
2517
2517
|
count: number;
|
|
2518
2518
|
withinMs?: number | undefined;
|
|
2519
2519
|
counter?: {
|
|
2520
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2520
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2521
2521
|
match?: Record<string, {
|
|
2522
2522
|
equals?: string | number | boolean | undefined;
|
|
2523
2523
|
contains?: string | undefined;
|
|
@@ -2579,7 +2579,7 @@ export declare const actionStepSchemas: ({
|
|
|
2579
2579
|
count: number;
|
|
2580
2580
|
withinMs?: number | undefined;
|
|
2581
2581
|
counter?: {
|
|
2582
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2582
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2583
2583
|
match?: Record<string, {
|
|
2584
2584
|
equals?: string | number | boolean | undefined;
|
|
2585
2585
|
contains?: string | undefined;
|
|
@@ -2641,7 +2641,7 @@ export declare const actionStepSchemas: ({
|
|
|
2641
2641
|
count: number;
|
|
2642
2642
|
withinMs?: number | undefined;
|
|
2643
2643
|
counter?: {
|
|
2644
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2644
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2645
2645
|
match?: Record<string, {
|
|
2646
2646
|
equals?: string | number | boolean | undefined;
|
|
2647
2647
|
contains?: string | undefined;
|
|
@@ -2771,7 +2771,7 @@ export declare const actionStepSchemas: ({
|
|
|
2771
2771
|
count: number;
|
|
2772
2772
|
withinMs?: number | undefined;
|
|
2773
2773
|
counter?: {
|
|
2774
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2774
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2775
2775
|
match?: Record<string, {
|
|
2776
2776
|
equals?: string | number | boolean | undefined;
|
|
2777
2777
|
contains?: string | undefined;
|
|
@@ -2861,7 +2861,7 @@ export declare const actionStepSchemas: ({
|
|
|
2861
2861
|
count: number;
|
|
2862
2862
|
withinMs?: number | undefined;
|
|
2863
2863
|
counter?: {
|
|
2864
|
-
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "
|
|
2864
|
+
events: ("ui.click" | "ui.scroll" | "ui.input" | "ui.change" | "ui.submit" | "ui.hover" | "ui.idle" | "ui.scroll_thrash" | "ui.focus_bounce" | "ui.hesitate" | "ui.rage_click" | "nav.page_view" | "nav.page_leave")[];
|
|
2865
2865
|
match?: Record<string, {
|
|
2866
2866
|
equals?: string | number | boolean | undefined;
|
|
2867
2867
|
contains?: string | undefined;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAStB,CAAC;AAUH;;GAEG;AACH,eAAO,MAAM,YA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;;;;;;;IADp64E,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -22,15 +22,13 @@ var COUNTABLE_EVENTS = [
|
|
|
22
22
|
"ui.idle",
|
|
23
23
|
"ui.scroll_thrash",
|
|
24
24
|
"ui.focus_bounce",
|
|
25
|
+
"ui.hesitate",
|
|
26
|
+
"ui.rage_click",
|
|
25
27
|
// Navigation
|
|
26
28
|
"nav.page_view",
|
|
27
|
-
"nav.page_leave"
|
|
28
|
-
// Derived behavioral signals
|
|
29
|
-
"behavior.rage_click",
|
|
30
|
-
"behavior.hesitation",
|
|
31
|
-
"behavior.confusion"
|
|
29
|
+
"nav.page_leave"
|
|
32
30
|
];
|
|
33
|
-
var CountableEventZ = z.enum(COUNTABLE_EVENTS).describe("Event name to count. ui.* = user interactions and behavioral detectors,
|
|
31
|
+
var CountableEventZ = z.enum(COUNTABLE_EVENTS).describe("Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.");
|
|
34
32
|
var SESSION_METRIC_KEYS = ["time_on_page", "page_views", "scroll_depth"];
|
|
35
33
|
var SessionMetricKeyZ = z.enum(SESSION_METRIC_KEYS).describe("Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.");
|
|
36
34
|
var PageUrlConditionZ = z.object({
|
package/dist/schema.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../sdk-contracts/dist/schemas.js", "../src/schema.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 id / title / description / validation\n//\n// Shared fields every action carries. `id` is the action identifier the\n// runtime uses to dispatch, dedupe, and drop/replace actions \u2014 it is NOT\n// stripped before serving. `title` / `description` / `validation` are\n// authoring-only metadata stripped server-side in `to_runtime_config`\n// (platform/backend/app/domains/experiments/helpers.py).\n//\n// They all appear in the JSON Schema (and therefore in the tactician's\n// prompt) because the LLM needs to know they are valid action properties \u2014\n// otherwise schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n id: z.string().optional().describe('Stable action identifier (e.g. \"act_3db6a14d2ab0\").'),\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions. */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n // Derived behavioral signals\n 'behavior.rage_click',\n 'behavior.hesitation',\n 'behavior.confusion',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors, nav.* = page navigation, behavior.* = derived behavioral signals.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Adaptive Gamification - Config Schema\n *\n * Zod schema for validating gamification app configuration.\n */\n\nimport { AnchorIdZ, AuthoringFieldsZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';\nimport { z } from 'zod';\n\n/**\n * Conditional execution for actions.\n * Actions use `triggerWhen` (DecisionStrategy) exclusively \u2014 `activation`\n * (routes/strategy) is for TILES only and is never evaluated by ActionEngine.\n */\nconst ActionTriggerZ = { triggerWhen: TriggerWhenZ };\n\n/**\n * Badge definition schema.\n */\nexport const badgeSchema = z.object({\n id: z.string(),\n name: z.string(),\n icon: z.string(),\n description: z.string().optional(),\n trigger: z.object({\n event: z.string(),\n conditions: z.array(z.unknown()).optional(),\n }),\n});\n\n/**\n * Leaderboard configuration schema.\n */\nconst leaderboardConfigSchema = z.object({\n enabled: z.boolean().default(false),\n refreshInterval: z.number().default(60000),\n});\n\n/**\n * Gamification app config schema.\n */\nexport const configSchema = z.object({\n badges: z.array(badgeSchema).default([]),\n leaderboard: leaderboardConfigSchema.optional(),\n points: z\n .object({\n enabled: z.boolean().default(false),\n multiplier: z.number().default(1),\n })\n .optional(),\n});\n\nexport type GamificationConfig = z.infer<typeof configSchema>;\n\n// ============================================================================\n// Executor Action Schemas\n// ============================================================================\n\n/**\n * Schema for awarding a badge to a user.\n */\nexport const AwardBadgeSchema = z\n .object({\n kind: z.literal('gamification:awardBadge'),\n badgeId: z.string(),\n anchorId: AnchorIdZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n/**\n * Schema for adding points to a user's score.\n */\nexport const AddPointsSchema = z\n .object({\n kind: z.literal('gamification:addPoints'),\n points: z.number(),\n reason: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n// ============================================================================\n// Unified Schema Export\n// ============================================================================\n\n/**\n * Action step schemas for unified JSON Schema generation.\n * The build script reads this array to merge adaptive actions into the\n * unified canvas-config.schema.json.\n */\nexport const actionStepSchemas = [\n { defName: 'awardBadge', schema: AwardBadgeSchema },\n { defName: 'addPoints', schema: AddPointsSchema },\n];\n"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,SAAS;AAIX,IAAM,YAAY,EACpB,OAAO;AAAA,EACR,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,EACI,OAAO;AAiBL,IAAM,mBAAmB;AAAA,EAC5B,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,qDAAqD;AAAA,EACxF,OAAO,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,6GAA6G;AAAA,EAC3H,aAAa,EACR,OAAO,EACP,IAAI,GAAI,EACR,SAAS,EACT,SAAS,wHAAwH;AAAA,EACtI,YAAY,EACP,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EACzB,IAAI,EAAE,EACN,SAAS,EACT,SAAS,+KAA+K;AACjM;
|
|
4
|
+
"sourcesContent": ["/**\n * Shared Zod schemas for decision strategies, conditions, and event scoping.\n *\n * These are the canonical definitions \u2014 runtime-sdk and all adaptive packages\n * should import from here instead of duplicating.\n */\nimport { z } from 'zod';\n// =============================================================================\n// ANCHOR ID SCHEMA\n// =============================================================================\nexport const AnchorIdZ = z\n .object({\n selector: z.string(),\n route: z.union([z.string(), z.array(z.string())]),\n})\n .strict();\n// =============================================================================\n// AUTHORING FIELDS \u2014 id / title / description / validation\n//\n// Shared fields every action carries. `id` is the action identifier the\n// runtime uses to dispatch, dedupe, and drop/replace actions \u2014 it is NOT\n// stripped before serving. `title` / `description` / `validation` are\n// authoring-only metadata stripped server-side in `to_runtime_config`\n// (platform/backend/app/domains/experiments/helpers.py).\n//\n// They all appear in the JSON Schema (and therefore in the tactician's\n// prompt) because the LLM needs to know they are valid action properties \u2014\n// otherwise schema validation would reject what the prompt commands.\n//\n// Each action variant should `.extend(AuthoringFieldsZ)` alongside any\n// triggerWhen/condition extensions.\n// =============================================================================\nexport const AuthoringFieldsZ = {\n id: z.string().optional().describe('Stable action identifier (e.g. \"act_3db6a14d2ab0\").'),\n title: z\n .string()\n .max(200)\n .optional()\n .describe('Authoring-only: short label shown on the action plan dashboard. Stripped before serving to the runtime SDK.'),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe('Authoring-only: one-sentence explanation of what this action does and why. Stripped before serving to the runtime SDK.'),\n validation: z\n .array(z.string().max(500))\n .max(10)\n .optional()\n .describe('Authoring-only: ordered steps a reviewer can follow to trigger this action and visually confirm it works. Each entry is one step. Stripped before serving to the runtime SDK.'),\n};\n// =============================================================================\n// TRIGGER VOCABULARY \u2014 canonical lists of valid event names, metric keys, etc.\n// These flow through to the JSON schema as enums and are used by the LLM prompt.\n// =============================================================================\n/** Events that can be counted in event_count conditions.\n *\n * Every value here must be an event the runtime actually emits \u2014 either a\n * PostHog-autocapture normalization (ui.click/scroll/input/change/submit) or\n * an event-processor detector (ui.hover/idle/scroll_thrash/focus_bounce/\n * hesitate/rage_click). Do not add aspirational names; a trigger counting an\n * event nothing emits never fires.\n */\nexport const COUNTABLE_EVENTS = [\n // User interactions (from PostHog autocapture normalization)\n 'ui.click',\n 'ui.scroll',\n 'ui.input',\n 'ui.change',\n 'ui.submit',\n // Behavioral detectors (from event-processor)\n 'ui.hover',\n 'ui.idle',\n 'ui.scroll_thrash',\n 'ui.focus_bounce',\n 'ui.hesitate',\n 'ui.rage_click',\n // Navigation\n 'nav.page_view',\n 'nav.page_leave',\n];\nexport const CountableEventZ = z\n .enum(COUNTABLE_EVENTS)\n .describe('Event name to count. ui.* = user interactions and behavioral detectors (hesitate, rage_click, scroll_thrash, focus_bounce, idle, hover); nav.* = page navigation.');\n/** Valid session metric keys. */\nexport const SESSION_METRIC_KEYS = ['time_on_page', 'page_views', 'scroll_depth'];\nexport const SessionMetricKeyZ = z\n .enum(SESSION_METRIC_KEYS)\n .describe('Session metric key. time_on_page = seconds on current page, page_views = pages visited this session, scroll_depth = 0-100 percentage.');\n/** Element chain match field prefixes for counter filters. */\nexport const ELEMENT_MATCH_FIELDS = ['tag_name', '$el_text'];\n// Note: attr__* is a dynamic prefix (attr__data-id, attr__class, attr__href, etc.)\n// and cannot be enumerated. The match key is either one of ELEMENT_MATCH_FIELDS\n// or starts with \"attr__\".\n// =============================================================================\n// CONDITION SCHEMAS\n// =============================================================================\nexport const PageUrlConditionZ = z\n .object({\n type: z.literal('page_url'),\n url: z.string().describe('URL path to match (e.g. \"/pricing\", \"/dashboard\")'),\n})\n .describe('Fires when the current page URL matches. Use for page-specific actions. ' +\n 'Example: {\"type\": \"page_url\", \"url\": \"/pricing\"}');\nexport const RouteConditionZ = z\n .object({\n type: z.literal('route'),\n routeId: z.string().describe('Named route ID from the route filter'),\n})\n .describe('Fires when the current route matches a named route ID.');\nexport const AnchorVisibleConditionZ = z\n .object({\n type: z.literal('anchor_visible'),\n anchorId: z.string().describe('CSS selector of the anchor element'),\n state: z\n .enum(['visible', 'present', 'absent'])\n .describe('\"visible\" = in viewport, \"present\" = in DOM, \"absent\" = not in DOM'),\n})\n .describe(\"Fires based on a DOM element's visibility state. \" +\n 'Example: {\"type\": \"anchor_visible\", \"anchorId\": \"#cta-button\", \"state\": \"visible\"}');\nexport const EventOccurredConditionZ = z\n .object({\n type: z.literal('event_occurred'),\n eventName: z.string().describe('Event name (e.g. \"ui.click\", \"$pageview\")'),\n withinMs: z.number().optional().describe('Time window in ms. Omit = any time this session.'),\n})\n .describe('Fires when a specific event has occurred during this session. ' +\n 'Example: {\"type\": \"event_occurred\", \"eventName\": \"ui.click\", \"withinMs\": 5000}');\nexport const StateEqualsConditionZ = z\n .object({\n type: z.literal('state_equals'),\n key: z\n .string()\n .describe('Key in the SDK persistent state store (localStorage). Only valid for keys the host app explicitly sets via syntro.state.set().'),\n value: z.unknown().describe('Expected value to match against'),\n})\n .describe('Checks the SDK persistent state store (localStorage). ONLY for host-app state set via syntro.state.set() \u2014 ' +\n 'NOT for user attributes like region, device, or UTM params (those are handled by segment targeting). ' +\n 'Do NOT use this for targeting. If you do not know the valid state keys, do not use this condition type.');\nexport const ViewportConditionZ = z\n .object({\n type: z.literal('viewport'),\n minWidth: z.number().optional().describe('Minimum viewport width in pixels'),\n maxWidth: z.number().optional().describe('Maximum viewport width in pixels'),\n minHeight: z.number().optional().describe('Minimum viewport height in pixels'),\n maxHeight: z.number().optional().describe('Maximum viewport height in pixels'),\n})\n .describe('Fires based on viewport (screen) size. Use for responsive behavior. ' +\n 'Example: {\"type\": \"viewport\", \"minWidth\": 768} \u2014 fires on tablet and larger.');\nexport const SessionMetricConditionZ = z\n .object({\n type: z.literal('session_metric'),\n key: SessionMetricKeyZ,\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n threshold: z.number().describe('Numeric threshold to compare against'),\n})\n .describe('Fires when a session metric crosses a threshold. Valid keys: \"time_on_page\" (seconds), ' +\n '\"page_views\" (count), \"scroll_depth\" (0-100). ' +\n 'Example: {\"type\": \"session_metric\", \"key\": \"time_on_page\", \"operator\": \"gte\", \"threshold\": 30}');\nexport const DismissedConditionZ = z\n .object({\n type: z.literal('dismissed'),\n key: z.string().describe('Dismissal key (usually a tile or action ID)'),\n inverted: z\n .boolean()\n .optional()\n .describe('When true, fires if NOT dismissed (default behavior)'),\n})\n .describe('Checks if an item has been dismissed by the user. Use with inverted: true to show only if not dismissed.');\nexport const CooldownActiveConditionZ = z\n .object({\n type: z.literal('cooldown_active'),\n key: z.string().describe('Cooldown key'),\n inverted: z.boolean().optional().describe('When true, fires if cooldown is NOT active'),\n})\n .describe('Checks if a cooldown timer is currently active. Use to prevent showing the same intervention too frequently.');\nexport const FrequencyLimitConditionZ = z\n .object({\n type: z.literal('frequency_limit'),\n key: z.string().describe('Frequency counter key'),\n limit: z.number().describe('Maximum allowed count'),\n inverted: z.boolean().optional().describe('When true, fires if limit NOT reached'),\n})\n .describe('Checks if a frequency limit has been reached. Use to cap how many times an action fires per session.');\nexport const MatchOpZ = z\n .object({\n equals: z.union([z.string(), z.number(), z.boolean()]).optional(),\n contains: z.string().optional(),\n})\n .describe('Match operator for counter filters. Exactly one of equals or contains must be specified.');\nexport const CounterDefZ = z\n .object({\n events: z\n .array(CountableEventZ)\n .min(1)\n .describe('Event names to count. Use values from the countable events enum.'),\n match: z\n .record(z.string(), MatchOpZ)\n .optional()\n .describe('Property filters. Keys are event prop names or element-chain fields ' +\n '(tag_name, $el_text, attr__*). All entries AND together.'),\n})\n .describe('Defines what events to count. Registered as an accumulator predicate at config-load time.');\nexport const EventCountConditionZ = z\n .object({\n type: z.literal('event_count'),\n key: z.string().describe('Unique key for this counter (used for accumulator registration)'),\n operator: z.enum(['gte', 'lte', 'eq', 'gt', 'lt']),\n count: z.number().int().min(0).describe('Target count threshold'),\n withinMs: z\n .number()\n .positive()\n .optional()\n .describe('Time window in ms. Omit = count across entire session.'),\n counter: CounterDefZ.optional().describe('Inline counter definition. Defines what events to count.'),\n})\n .describe('Fires when accumulated event count crosses a threshold. Most powerful trigger type. ' +\n 'Example: {\"type\": \"event_count\", \"key\": \"pricing-clicks\", \"operator\": \"gte\", \"count\": 3, ' +\n '\"counter\": {\"events\": [\"ui.click\"], \"match\": {\"attr__data-cta\": {\"contains\": \"pricing\"}}}}');\nexport const ConditionZ = z.discriminatedUnion('type', [\n PageUrlConditionZ,\n RouteConditionZ,\n AnchorVisibleConditionZ,\n EventOccurredConditionZ,\n StateEqualsConditionZ,\n ViewportConditionZ,\n SessionMetricConditionZ,\n DismissedConditionZ,\n CooldownActiveConditionZ,\n FrequencyLimitConditionZ,\n EventCountConditionZ,\n]);\n// =============================================================================\n// STRATEGY SCHEMAS\n// =============================================================================\nexport const RuleZ = z\n .object({\n conditions: z\n .array(ConditionZ)\n .describe('Array of conditions \u2014 ALL must match (AND logic) for this rule to fire.'),\n value: z\n .unknown()\n .describe('Value returned when all conditions match. For triggerWhen: true = fire the action.'),\n})\n .describe('A single rule. ALL conditions must match (AND logic). Rules in a strategy are evaluated ' +\n 'top-to-bottom \u2014 first rule where all conditions match wins and returns its value.');\nexport const RuleStrategyZ = z\n .object({\n type: z.literal('rules'),\n rules: z\n .array(RuleZ)\n .describe('Ordered list of rules. Evaluated top-to-bottom \u2014 first match wins.'),\n default: z\n .unknown()\n .describe('Fallback value when no rule matches. For triggerWhen: false = do not fire by default.'),\n})\n .describe('Rule-based strategy. Evaluates rules top-to-bottom. First rule where ALL conditions match ' +\n 'returns its value. If no rule matches, returns default. ' +\n 'For triggerWhen: set value=true on matching rules, default=false.');\nexport const ScoreStrategyZ = z\n .object({\n type: z.literal('score'),\n field: z.string(),\n threshold: z.number(),\n above: z.unknown(),\n below: z.unknown(),\n})\n .describe('Score-based strategy. Compares a field value against a threshold.');\nexport const ModelStrategyZ = z\n .object({\n type: z.literal('model'),\n modelId: z.string(),\n inputs: z.array(z.string()),\n outputMapping: z.record(z.string(), z.unknown()),\n default: z.unknown(),\n})\n .describe('ML model strategy. Sends inputs to a model and maps outputs.');\nexport const ExternalStrategyZ = z\n .object({\n type: z.literal('external'),\n endpoint: z.string(),\n method: z.enum(['GET', 'POST']).optional(),\n default: z.unknown(),\n timeoutMs: z.number().optional(),\n})\n .describe('External API strategy. Calls an endpoint to determine the value.');\nexport const DecisionStrategyZ = z.discriminatedUnion('type', [\n RuleStrategyZ,\n ScoreStrategyZ,\n ModelStrategyZ,\n ExternalStrategyZ,\n]);\n/** Canonical Zod schema for the optional triggerWhen field on actions and adaptive items. */\nexport const TriggerWhenZ = DecisionStrategyZ.nullable().optional();\n// =============================================================================\n// TRIGGER DOCUMENTATION \u2014 examples and match field docs\n// Exported as constants so the schema generator can inject them into the\n// JSON schema. The Python prompt builder reads them from the schema.\n// =============================================================================\n/** Complete triggerWhen examples showing the full rules wrapper structure. */\nexport const TRIGGER_EXAMPLES = [\n {\n name: 'Click count on a specific element',\n description: 'Fire when user clicks an element with data-id=\"hero-cta\" 2+ times',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'event_count',\n key: 'cta-clicks',\n operator: 'gte',\n count: 2,\n counter: {\n events: ['ui.click'],\n match: { 'attr__data-id': { equals: 'hero-cta' } },\n },\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Time on page threshold',\n description: 'Fire after user spends 30+ seconds on the page',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'session_metric',\n key: 'time_on_page',\n operator: 'gte',\n threshold: 30,\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'Element visible in viewport',\n description: 'Fire when a DOM element becomes visible',\n triggerWhen: {\n type: 'rules',\n rules: [\n {\n conditions: [\n {\n type: 'anchor_visible',\n anchorId: '#pricing-section',\n state: 'visible',\n },\n ],\n value: true,\n },\n ],\n default: false,\n },\n },\n {\n name: 'No trigger (fire immediately)',\n description: 'Action fires as soon as the segment matches \u2014 no in-session condition needed',\n triggerWhen: null,\n },\n];\n/** Documentation for counter.match field keys. */\nexport const MATCH_FIELD_DOCS = {\n tag_name: 'HTML tag name (e.g. \"button\", \"a\", \"input\")',\n $el_text: 'Visible text content of the element',\n 'attr__*': 'HTML attribute prefixed with attr__. Example: attr__data-id matches the data-id attribute, ' +\n 'attr__class matches the class attribute, attr__href matches the href attribute.',\n};\n// =============================================================================\n// EVENT SCOPE SCHEMA\n// =============================================================================\n/** Scopes a widget to specific events/URLs. */\nexport const EventScopeZ = z.object({\n events: z.array(z.string()),\n urlContains: z.string().optional(),\n props: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),\n});\n// =============================================================================\n// NOTIFY SCHEMA\n// =============================================================================\n/** Toast notification config for triggerWhen transitions. */\nexport const NotifyZ = z\n .object({\n title: z.string().optional(),\n body: z.string().optional(),\n icon: z.string().optional(),\n})\n .nullable()\n .optional();\n", "/**\n * Adaptive Gamification - Config Schema\n *\n * Zod schema for validating gamification app configuration.\n */\n\nimport { AnchorIdZ, AuthoringFieldsZ, TriggerWhenZ } from '@syntrologie/sdk-contracts';\nimport { z } from 'zod';\n\n/**\n * Conditional execution for actions.\n * Actions use `triggerWhen` (DecisionStrategy) exclusively \u2014 `activation`\n * (routes/strategy) is for TILES only and is never evaluated by ActionEngine.\n */\nconst ActionTriggerZ = { triggerWhen: TriggerWhenZ };\n\n/**\n * Badge definition schema.\n */\nexport const badgeSchema = z.object({\n id: z.string(),\n name: z.string(),\n icon: z.string(),\n description: z.string().optional(),\n trigger: z.object({\n event: z.string(),\n conditions: z.array(z.unknown()).optional(),\n }),\n});\n\n/**\n * Leaderboard configuration schema.\n */\nconst leaderboardConfigSchema = z.object({\n enabled: z.boolean().default(false),\n refreshInterval: z.number().default(60000),\n});\n\n/**\n * Gamification app config schema.\n */\nexport const configSchema = z.object({\n badges: z.array(badgeSchema).default([]),\n leaderboard: leaderboardConfigSchema.optional(),\n points: z\n .object({\n enabled: z.boolean().default(false),\n multiplier: z.number().default(1),\n })\n .optional(),\n});\n\nexport type GamificationConfig = z.infer<typeof configSchema>;\n\n// ============================================================================\n// Executor Action Schemas\n// ============================================================================\n\n/**\n * Schema for awarding a badge to a user.\n */\nexport const AwardBadgeSchema = z\n .object({\n kind: z.literal('gamification:awardBadge'),\n badgeId: z.string(),\n anchorId: AnchorIdZ.optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n/**\n * Schema for adding points to a user's score.\n */\nexport const AddPointsSchema = z\n .object({\n kind: z.literal('gamification:addPoints'),\n points: z.number(),\n reason: z.string().optional(),\n label: z.string().optional(),\n })\n .extend(ActionTriggerZ)\n .extend(AuthoringFieldsZ);\n\n// ============================================================================\n// Unified Schema Export\n// ============================================================================\n\n/**\n * Action step schemas for unified JSON Schema generation.\n * The build script reads this array to merge adaptive actions into the\n * unified canvas-config.schema.json.\n */\nexport const actionStepSchemas = [\n { defName: 'awardBadge', schema: AwardBadgeSchema },\n { defName: 'addPoints', schema: AddPointsSchema },\n];\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,SAAS;AAIX,IAAM,YAAY,EACpB,OAAO;AAAA,EACR,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC,EACI,OAAO;AAiBL,IAAM,mBAAmB;AAAA,EAC5B,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,qDAAqD;AAAA,EACxF,OAAO,EACF,OAAO,EACP,IAAI,GAAG,EACP,SAAS,EACT,SAAS,6GAA6G;AAAA,EAC3H,aAAa,EACR,OAAO,EACP,IAAI,GAAI,EACR,SAAS,EACT,SAAS,wHAAwH;AAAA,EACtI,YAAY,EACP,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EACzB,IAAI,EAAE,EACN,SAAS,EACT,SAAS,+KAA+K;AACjM;AAaO,IAAM,mBAAmB;AAAA;AAAA,EAE5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AACJ;AACO,IAAM,kBAAkB,EAC1B,KAAK,gBAAgB,EACrB,SAAS,mKAAmK;AAE1K,IAAM,sBAAsB,CAAC,gBAAgB,cAAc,cAAc;AACzE,IAAM,oBAAoB,EAC5B,KAAK,mBAAmB,EACxB,SAAS,uIAAuI;AAS9I,IAAM,oBAAoB,EAC5B,OAAO;AAAA,EACR,MAAM,EAAE,QAAQ,UAAU;AAAA,EAC1B,KAAK,EAAE,OAAO,EAAE,SAAS,mDAAmD;AAChF,CAAC,EACI,SAAS,0HACwC;AAC/C,IAAM,kBAAkB,EAC1B,OAAO;AAAA,EACR,MAAM,EAA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