@ak--47/dungeon-master 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +7 -7
  2. package/dungeons/technical/ad-spend-schema.json +128 -0
  3. package/dungeons/technical/ad-spend.js +116 -0
  4. package/dungeons/technical/anonymous-users-schema.json +91 -0
  5. package/dungeons/technical/anonymous-users.js +102 -0
  6. package/dungeons/technical/array-of-object-lookup-schema.json +191 -0
  7. package/dungeons/{array-of-object-lookup.js → technical/array-of-object-lookup.js} +11 -4
  8. package/dungeons/technical/experiments-schema.json +197 -0
  9. package/dungeons/technical/experiments.js +168 -0
  10. package/dungeons/technical/foobar-schema.json +362 -0
  11. package/dungeons/{foobar.js → technical/foobar.js} +2 -2
  12. package/dungeons/technical/group-analytics-schema.json +149 -0
  13. package/dungeons/technical/group-analytics.js +151 -0
  14. package/dungeons/technical/mirror-strategies-schema.json +84 -0
  15. package/dungeons/technical/mirror-strategies.js +126 -0
  16. package/dungeons/technical/nested-objects-schema.json +145 -0
  17. package/dungeons/technical/nested-objects.js +207 -0
  18. package/dungeons/technical/retention-cadence-schema.json +37 -0
  19. package/dungeons/{retention-cadence.js → technical/retention-cadence.js} +1 -1
  20. package/dungeons/technical/sanity-schema.json +185 -0
  21. package/dungeons/{sanity.js → technical/sanity.js} +3 -2
  22. package/dungeons/technical/scale-test-schema.json +70 -0
  23. package/dungeons/technical/scale-test.js +90 -0
  24. package/dungeons/technical/scd-schema.json +270 -0
  25. package/dungeons/{scd.js → technical/scd.js} +19 -10
  26. package/dungeons/technical/simple-schema.json +278 -0
  27. package/dungeons/{simple.js → technical/simple.js} +6 -6
  28. package/dungeons/technical/simplest-schema.json +635 -0
  29. package/dungeons/{simplest.js → technical/simplest.js} +6 -6
  30. package/dungeons/technical/text-generation-schema.json +1059 -0
  31. package/dungeons/{text-generation.js → technical/text-generation.js} +23 -9
  32. package/dungeons/vertical/community-schema.json +557 -0
  33. package/dungeons/vertical/community.js +788 -0
  34. package/dungeons/vertical/devtools-schema.json +580 -0
  35. package/dungeons/vertical/devtools.js +837 -0
  36. package/dungeons/vertical/ecommerce-schema.json +586 -0
  37. package/dungeons/{ecommerce.js → vertical/ecommerce.js} +34 -3
  38. package/dungeons/vertical/education-schema.json +697 -0
  39. package/dungeons/{education.js → vertical/education.js} +54 -36
  40. package/dungeons/vertical/fintech-schema.json +563 -0
  41. package/dungeons/{fintech.js → vertical/fintech.js} +91 -53
  42. package/dungeons/vertical/fitness-schema.json +508 -0
  43. package/dungeons/vertical/fitness.js +802 -0
  44. package/dungeons/vertical/food-delivery-schema.json +678 -0
  45. package/dungeons/{food.js → vertical/food-delivery.js} +51 -23
  46. package/dungeons/vertical/gaming-schema.json +394 -0
  47. package/dungeons/{gaming.js → vertical/gaming.js} +9 -7
  48. package/dungeons/vertical/healthcare-schema.json +527 -0
  49. package/dungeons/vertical/healthcare.js +769 -0
  50. package/dungeons/vertical/insurance-application-schema.json +466 -0
  51. package/dungeons/{insurance-application.js → vertical/insurance-application.js} +33 -29
  52. package/dungeons/vertical/logistics-schema.json +552 -0
  53. package/dungeons/vertical/logistics.js +793 -0
  54. package/dungeons/vertical/marketplace-schema.json +511 -0
  55. package/dungeons/vertical/marketplace.js +844 -0
  56. package/dungeons/vertical/media-schema.json +787 -0
  57. package/dungeons/{media.js → vertical/media.js} +94 -16
  58. package/dungeons/vertical/rpg-schema.json +654 -0
  59. package/dungeons/{rpg.js → vertical/rpg.js} +78 -57
  60. package/dungeons/vertical/sass-schema.json +653 -0
  61. package/dungeons/{sass.js → vertical/sass.js} +49 -23
  62. package/dungeons/vertical/social-schema.json +552 -0
  63. package/dungeons/{social.js → vertical/social.js} +60 -14
  64. package/dungeons/vertical/travel-schema.json +558 -0
  65. package/dungeons/vertical/travel.js +736 -0
  66. package/index.js +19 -15
  67. package/lib/core/config-validator.js +286 -1
  68. package/lib/core/context.js +7 -5
  69. package/lib/generators/adspend.js +3 -3
  70. package/lib/generators/events.js +141 -14
  71. package/lib/generators/funnels.js +67 -7
  72. package/lib/generators/text.js +2 -2
  73. package/lib/orchestrators/user-loop.js +441 -22
  74. package/lib/templates/soup-presets.js +2 -2
  75. package/lib/utils/utils.js +4 -5
  76. package/package.json +4 -3
  77. package/scripts/dungeon-to-json.mjs +163 -0
  78. package/scripts/extract-dungeon-schema.mjs +297 -0
  79. package/scripts/json-to-dungeon.mjs +200 -0
  80. package/scripts/run-dungeon.mjs +76 -0
  81. package/scripts/run-many.mjs +118 -0
  82. package/scripts/verify-runner.mjs +42 -0
  83. package/types.d.ts +313 -1
  84. package/dungeons/array-of-object-lookup-schema.json +0 -327
  85. package/dungeons/ecommerce-schema.json +0 -462
  86. package/dungeons/education-schema.json +0 -2409
  87. package/dungeons/fintech-schema.json +0 -14034
  88. package/dungeons/foobar-schema.json +0 -403
  89. package/dungeons/food-delivery-schema.json +0 -192
  90. package/dungeons/food-delivery.js +0 -602
  91. package/dungeons/food-schema.json +0 -1152
  92. package/dungeons/gaming-schema.json +0 -1270
  93. package/dungeons/insurance-application-schema.json +0 -204
  94. package/dungeons/media-schema.json +0 -906
  95. package/dungeons/retention-cadence-schema.json +0 -78
  96. package/dungeons/rpg-schema.json +0 -4526
  97. package/dungeons/sanity-schema.json +0 -255
  98. package/dungeons/sass-schema.json +0 -1291
  99. package/dungeons/scd-schema.json +0 -919
  100. package/dungeons/simple-schema.json +0 -608
  101. package/dungeons/simplest-schema.json +0 -1418
  102. package/dungeons/social-schema.json +0 -1118
  103. package/dungeons/text-generation-schema.json +0 -3096
@@ -1,7 +1,7 @@
1
1
  import dayjs from "dayjs";
2
2
  import utc from "dayjs/plugin/utc.js";
3
3
  import "dotenv/config";
4
- import * as u from "../lib/utils/utils.js";
4
+ import * as u from "../../lib/utils/utils.js";
5
5
  import * as v from "ak-tools";
6
6
 
7
7
  const SEED = "harness-media";
@@ -318,6 +318,10 @@ const config = {
318
318
  properties: {
319
319
  "signup_source": ["organic", "referral", "trial_offer", "ad"],
320
320
  "plan_selected": ["free", "standard", "premium"],
321
+ "weekend_viewing": [false],
322
+ "prime_time": [false],
323
+ "kids_profile": [false],
324
+ "ad_fatigue": [false],
321
325
  }
322
326
  },
323
327
  {
@@ -326,6 +330,10 @@ const config = {
326
330
  properties: {
327
331
  "browse_section": ["home", "trending", "new_releases", "genre", "continue_watching"],
328
332
  "genre": ["action", "comedy", "drama", "documentary", "horror", "sci_fi", "animation", "thriller", "romance"],
333
+ "weekend_viewing": [false],
334
+ "prime_time": [false],
335
+ "kids_profile": [false],
336
+ "ad_fatigue": [false],
329
337
  }
330
338
  },
331
339
  {
@@ -334,62 +342,96 @@ const config = {
334
342
  properties: {
335
343
  "content_type": ["movie", "series", "documentary", "special"],
336
344
  "genre": ["action", "comedy", "drama", "documentary", "horror", "sci_fi", "animation", "thriller", "romance"],
337
- "content_id": u.pickAWinner(contentIds),
345
+ "content_id": contentIds,
346
+ "blockbuster_release": [false],
347
+ "kids_profile": [false],
348
+ "weekend_viewing": [false],
349
+ "prime_time": [false],
350
+ "ad_fatigue": [false],
338
351
  }
339
352
  },
340
353
  {
341
354
  event: "playback started",
342
355
  weight: 18,
343
356
  properties: {
344
- "content_id": u.pickAWinner(contentIds),
357
+ "content_id": contentIds,
345
358
  "content_type": ["movie", "series", "documentary", "special"],
346
359
  "playback_quality": ["480p", "720p", "1080p", "4k"],
347
360
  "subtitle_language": ["none", "english", "spanish", "french", "japanese", "korean"],
348
- "playback_speed": u.pickAWinner(["0.5x", "1x", "1x", "1x", "1.25x", "1.5x", "2x"]),
361
+ "playback_speed": ["0.5x", "1x", "1x", "1x", "1.25x", "1.5x", "2x"],
362
+ "blockbuster_release": [false],
363
+ "kids_profile": [false],
364
+ "binge_session": [false],
365
+ "weekend_viewing": [false],
366
+ "prime_time": [false],
367
+ "ad_fatigue": [false],
349
368
  }
350
369
  },
351
370
  {
352
371
  event: "playback completed",
353
372
  weight: 12,
354
373
  properties: {
355
- "content_id": u.pickAWinner(contentIds),
374
+ "content_id": contentIds,
356
375
  "content_type": ["movie", "series", "documentary", "special"],
357
376
  "watch_duration_min": u.weighNumRange(5, 180, 0.5, 45),
358
377
  "completion_percent": u.weighNumRange(10, 100, 1.5, 85),
378
+ "binge_session": [false],
379
+ "subtitle_user": [false],
380
+ "weekend_viewing": [false],
381
+ "prime_time": [false],
382
+ "kids_profile": [false],
383
+ "ad_fatigue": [false],
359
384
  }
360
385
  },
361
386
  {
362
387
  event: "playback paused",
363
388
  weight: 10,
364
389
  properties: {
365
- "content_id": u.pickAWinner(contentIds),
390
+ "content_id": contentIds,
366
391
  "pause_reason": ["manual", "ad_break", "buffering", "notification"],
392
+ "weekend_viewing": [false],
393
+ "prime_time": [false],
394
+ "kids_profile": [false],
395
+ "ad_fatigue": [false],
367
396
  }
368
397
  },
369
398
  {
370
399
  event: "content rated",
371
400
  weight: 6,
372
401
  properties: {
373
- "content_id": u.pickAWinner(contentIds),
402
+ "content_id": contentIds,
374
403
  "rating": u.weighNumRange(1, 5, 2, 4),
375
404
  "review_text_length": u.weighNumRange(0, 500, 0.2, 0),
405
+ "blockbuster_release": [false],
406
+ "weekend_viewing": [false],
407
+ "prime_time": [false],
408
+ "kids_profile": [false],
409
+ "ad_fatigue": [false],
376
410
  }
377
411
  },
378
412
  {
379
413
  event: "watchlist added",
380
414
  weight: 8,
381
415
  properties: {
382
- "content_id": u.pickAWinner(contentIds),
416
+ "content_id": contentIds,
383
417
  "content_type": ["movie", "series", "documentary", "special"],
384
418
  "genre": ["action", "comedy", "drama", "documentary", "horror", "sci_fi", "animation", "thriller", "romance"],
419
+ "weekend_viewing": [false],
420
+ "prime_time": [false],
421
+ "kids_profile": [false],
422
+ "ad_fatigue": [false],
385
423
  }
386
424
  },
387
425
  {
388
426
  event: "watchlist removed",
389
427
  weight: 3,
390
428
  properties: {
391
- "content_id": u.pickAWinner(contentIds),
429
+ "content_id": contentIds,
392
430
  "reason": ["watched", "not_interested", "expired"],
431
+ "weekend_viewing": [false],
432
+ "prime_time": [false],
433
+ "kids_profile": [false],
434
+ "ad_fatigue": [false],
393
435
  }
394
436
  },
395
437
  {
@@ -399,6 +441,10 @@ const config = {
399
441
  "search_term": () => chance.word(),
400
442
  "results_count": u.weighNumRange(0, 50, 0.5, 15),
401
443
  "search_type": ["title", "actor", "director", "genre"],
444
+ "weekend_viewing": [false],
445
+ "prime_time": [false],
446
+ "kids_profile": [false],
447
+ "ad_fatigue": [false],
402
448
  }
403
449
  },
404
450
  {
@@ -407,6 +453,10 @@ const config = {
407
453
  properties: {
408
454
  "algorithm": ["collaborative_filtering", "content_based", "trending", "editorial"],
409
455
  "position": u.weighNumRange(1, 20),
456
+ "weekend_viewing": [false],
457
+ "prime_time": [false],
458
+ "kids_profile": [false],
459
+ "ad_fatigue": [false],
410
460
  }
411
461
  },
412
462
  {
@@ -414,6 +464,10 @@ const config = {
414
464
  weight: 4,
415
465
  properties: {
416
466
  "profile_type": ["main", "kids", "partner", "guest"],
467
+ "weekend_viewing": [false],
468
+ "prime_time": [false],
469
+ "kids_profile": [false],
470
+ "ad_fatigue": [false],
417
471
  }
418
472
  },
419
473
  {
@@ -422,7 +476,12 @@ const config = {
422
476
  properties: {
423
477
  "ad_type": ["pre_roll", "mid_roll", "banner", "interstitial"],
424
478
  "ad_duration_sec": u.weighNumRange(5, 30),
425
- "skipped": u.pickAWinner([true, false], 0.4),
479
+ "skipped": [false, false, false, true, true],
480
+ "ad_blocked": [false],
481
+ "kids_profile": [false],
482
+ "weekend_viewing": [false],
483
+ "prime_time": [false],
484
+ "ad_fatigue": [false],
426
485
  }
427
486
  },
428
487
  {
@@ -432,15 +491,23 @@ const config = {
432
491
  "old_plan": ["free", "standard", "premium"],
433
492
  "new_plan": ["free", "standard", "premium"],
434
493
  "change_reason": ["upgrade", "downgrade", "cancel", "resubscribe"],
494
+ "weekend_viewing": [false],
495
+ "prime_time": [false],
496
+ "kids_profile": [false],
497
+ "ad_fatigue": [false],
435
498
  }
436
499
  },
437
500
  {
438
501
  event: "download started",
439
502
  weight: 5,
440
503
  properties: {
441
- "content_id": u.pickAWinner(contentIds),
504
+ "content_id": contentIds,
442
505
  "content_type": ["movie", "series", "documentary", "special"],
443
506
  "download_quality": ["720p", "1080p", "4k"],
507
+ "weekend_viewing": [false],
508
+ "prime_time": [false],
509
+ "kids_profile": [false],
510
+ "ad_fatigue": [false],
444
511
  }
445
512
  },
446
513
  {
@@ -449,6 +516,10 @@ const config = {
449
516
  properties: {
450
517
  "share_method": ["link", "social", "dm", "email"],
451
518
  "content_type": ["movie", "series", "documentary", "special"],
519
+ "weekend_viewing": [false],
520
+ "prime_time": [false],
521
+ "kids_profile": [false],
522
+ "ad_fatigue": [false],
452
523
  }
453
524
  },
454
525
  {
@@ -457,12 +528,16 @@ const config = {
457
528
  properties: {
458
529
  "subtitle_language": ["none", "english", "spanish", "french", "japanese", "korean"],
459
530
  "action": ["enabled", "disabled", "changed"],
531
+ "weekend_viewing": [false],
532
+ "prime_time": [false],
533
+ "kids_profile": [false],
534
+ "ad_fatigue": [false],
460
535
  }
461
536
  },
462
537
  ],
463
538
 
464
539
  superProps: {
465
- subscription_plan: u.pickAWinner(["free", "free", "standard", "standard", "standard", "premium"]),
540
+ subscription_plan: ["free", "free", "standard", "standard", "standard", "premium"],
466
541
  device_type: ["smart_tv", "mobile", "tablet", "laptop", "desktop"],
467
542
  },
468
543
 
@@ -473,7 +548,7 @@ const config = {
473
548
  "avg_session_duration_min": u.weighNumRange(10, 180, 0.5, 45),
474
549
  "total_watch_hours": u.weighNumRange(0, 500, 0.8, 50),
475
550
  "profiles_count": u.weighNumRange(1, 5),
476
- "downloads_enabled": u.pickAWinner([true, false], 0.4),
551
+ "downloads_enabled": [false, false, false, true, true],
477
552
  },
478
553
 
479
554
  lookupTables: [],
@@ -497,7 +572,8 @@ const config = {
497
572
  const DATASET_START = NOW.subtract(days, 'days');
498
573
  // FIXED_START is the pre-shift time range start; needed because
499
574
  // meta.firstEventTime in funnel-pre is in the FIXED (pre-shift) timeframe
500
- const FIXED_START = dayjs.unix(global.FIXED_NOW).subtract(days, 'days');
575
+ const FIXED_NOW_UNIX = dayjs('2024-02-02').unix();
576
+ const FIXED_START = dayjs.unix(FIXED_NOW_UNIX).subtract(days, 'days');
501
577
 
502
578
  // ─────────────────────────────────────────────────────────────
503
579
  // Hook #1: GENRE FUNNEL CONVERSION (funnel-pre)
@@ -701,7 +777,9 @@ const config = {
701
777
  // Add extra viewing events after completions
702
778
  if (event.event === "playback completed" && chance.bool({ likelihood: 40 })) {
703
779
  const nextContentId = chance.pickone(contentIds);
780
+ const startTemplate = userEvents.find(e => e.event === "playback started");
704
781
  const extraStart = {
782
+ ...(startTemplate || event),
705
783
  event: "playback started",
706
784
  time: eventTime.add(chance.integer({ min: 1, max: 5 }), 'minutes').toISOString(),
707
785
  user_id: event.user_id,
@@ -711,7 +789,7 @@ const config = {
711
789
  binge_session: true,
712
790
  };
713
791
  const extraComplete = {
714
- event: "playback completed",
792
+ ...event,
715
793
  time: eventTime.add(chance.integer({ min: 25, max: 60 }), 'minutes').toISOString(),
716
794
  user_id: event.user_id,
717
795
  content_id: nextContentId,
@@ -767,7 +845,7 @@ const config = {
767
845
  const templateEvent = chance.pickone(completionEvents);
768
846
  const templateTime = dayjs(templateEvent.time);
769
847
  const extraCompletion = {
770
- event: "playback completed",
848
+ ...templateEvent,
771
849
  time: templateTime.add(chance.integer({ min: 30, max: 180 }), 'minutes').toISOString(),
772
850
  user_id: templateEvent.user_id,
773
851
  content_id: chance.pickone(contentIds),