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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dungeons/technical/ad-spend-schema.json +2 -2
  2. package/dungeons/technical/ad-spend.js +16 -5
  3. package/dungeons/technical/anonymous-users-schema.json +4 -3
  4. package/dungeons/technical/anonymous-users.js +16 -6
  5. package/dungeons/technical/array-of-object-lookup-schema.json +1 -1
  6. package/dungeons/technical/array-of-object-lookup.js +22 -6
  7. package/dungeons/technical/experiments-schema.json +25 -19
  8. package/dungeons/technical/experiments.js +24 -6
  9. package/dungeons/technical/foobar.js +29 -13
  10. package/dungeons/technical/group-analytics-schema.json +92 -0
  11. package/dungeons/technical/group-analytics.js +16 -6
  12. package/dungeons/technical/mirror-strategies-schema.json +4 -4
  13. package/dungeons/technical/mirror-strategies.js +16 -6
  14. package/dungeons/technical/nested-objects.js +16 -5
  15. package/dungeons/technical/retention-cadence.js +14 -9
  16. package/dungeons/technical/sanity-schema.json +22 -22
  17. package/dungeons/technical/sanity.js +26 -6
  18. package/dungeons/technical/scale-test.js +16 -5
  19. package/dungeons/technical/scd-schema.json +230 -33
  20. package/dungeons/technical/scd.js +25 -5
  21. package/dungeons/technical/simple-schema.json +132 -48
  22. package/dungeons/technical/simple.js +21 -6
  23. package/dungeons/technical/simplest-schema.json +168 -79
  24. package/dungeons/technical/simplest.js +24 -7
  25. package/dungeons/technical/text-generation-schema.json +7 -4
  26. package/dungeons/technical/text-generation.js +23 -8
  27. package/dungeons/user/.gitkeep +0 -0
  28. package/dungeons/user/shalini.js +847 -0
  29. package/dungeons/vertical/community-schema.json +71 -49
  30. package/dungeons/vertical/community.js +57 -30
  31. package/dungeons/vertical/devtools-schema.json +69 -48
  32. package/dungeons/vertical/devtools.js +58 -31
  33. package/dungeons/vertical/ecommerce-schema.json +126 -108
  34. package/dungeons/vertical/ecommerce.js +32 -8
  35. package/dungeons/vertical/education-schema.json +5261 -272
  36. package/dungeons/vertical/education.js +45 -22
  37. package/dungeons/vertical/fintech-schema.json +165 -98
  38. package/dungeons/vertical/fintech.js +43 -11
  39. package/dungeons/vertical/fitness-schema.json +69 -47
  40. package/dungeons/vertical/fitness.js +56 -24
  41. package/dungeons/vertical/food-delivery-schema.json +36237 -187
  42. package/dungeons/vertical/food-delivery.js +67 -15
  43. package/dungeons/vertical/gaming-schema.json +104 -60
  44. package/dungeons/vertical/gaming.js +61 -16
  45. package/dungeons/vertical/healthcare-schema.json +70 -48
  46. package/dungeons/vertical/healthcare.js +77 -42
  47. package/dungeons/vertical/insurance-application-schema.json +66 -47
  48. package/dungeons/vertical/insurance-application.js +34 -10
  49. package/dungeons/vertical/logistics-schema.json +60 -38
  50. package/dungeons/vertical/logistics.js +77 -43
  51. package/dungeons/vertical/marketplace-schema.json +65 -43
  52. package/dungeons/vertical/marketplace.js +52 -21
  53. package/dungeons/vertical/media-schema.json +4085 -123
  54. package/dungeons/vertical/media.js +65 -18
  55. package/dungeons/vertical/rpg-schema.json +1984 -147
  56. package/dungeons/vertical/rpg.js +47 -11
  57. package/dungeons/vertical/sass-schema.json +2622 -147
  58. package/dungeons/vertical/sass.js +40 -10
  59. package/dungeons/vertical/social-schema.json +146 -78
  60. package/dungeons/vertical/social.js +39 -10
  61. package/dungeons/vertical/travel-schema.json +57 -35
  62. package/dungeons/vertical/travel.js +58 -21
  63. package/index.js +4 -1
  64. package/lib/core/config-validator.js +13 -2
  65. package/lib/core/context.js +9 -0
  66. package/lib/core/storage.js +2 -0
  67. package/lib/generators/events.js +3 -5
  68. package/lib/orchestrators/user-loop.js +24 -1
  69. package/lib/utils/utils.js +129 -9
  70. package/package.json +1 -1
  71. package/scripts/extract-dungeon-schema.mjs +64 -18
  72. package/types.d.ts +8 -3
@@ -1,16 +1,23 @@
1
+ // ── TWEAK THESE ──
2
+ const SEED = "harness-gaming";
3
+ const num_days = 100;
4
+ const num_users = 5_000;
5
+ const avg_events_per_user = 120;
6
+ let token = "your-mixpanel-token";
7
+
8
+ // ── env overrides ──
9
+ if (process.env.MP_TOKEN) token = process.env.MP_TOKEN;
10
+
1
11
  import dayjs from "dayjs";
2
12
  import utc from "dayjs/plugin/utc.js";
3
13
  import "dotenv/config";
4
14
  import * as u from "../../lib/utils/utils.js";
5
15
  import * as v from "ak-tools";
6
16
 
7
- const SEED = "harness-gaming";
8
17
  dayjs.extend(utc);
9
18
  const chance = u.initChance(SEED);
10
- const num_users = 5_000;
11
- const days = 100;
12
19
 
13
- /** @typedef {import("../types.d.ts").Dungeon} Config */
20
+ /** @typedef {import("../../types").Dungeon} Config */
14
21
 
15
22
  /*
16
23
  * ═══════════════════════════════════════════════════════════════════════════════
@@ -164,10 +171,10 @@ const itemIds = v.range(1, 301).map(n => `item_${v.uid(7)}`);
164
171
 
165
172
  /** @type {Config} */
166
173
  const config = {
167
- token: "",
174
+ token,
168
175
  seed: SEED,
169
- numDays: days,
170
- numEvents: num_users * 120,
176
+ numDays: num_days,
177
+ numEvents: num_users * avg_events_per_user,
171
178
  numUsers: num_users,
172
179
  hasAnonIds: false,
173
180
  hasSessionIds: true,
@@ -186,7 +193,6 @@ const config = {
186
193
 
187
194
  hasAvatar: true,
188
195
 
189
- batchSize: 2_500_000,
190
196
  concurrency: 1,
191
197
  writeToDisk: false,
192
198
 
@@ -520,7 +526,7 @@ const config = {
520
526
  ],
521
527
 
522
528
  superProps: {
523
- platform: [
529
+ Platform: [
524
530
  "PC",
525
531
  "Mac",
526
532
  "PlayStation",
@@ -536,7 +542,14 @@ const config = {
536
542
  subscription_tier: ["Free", "Free", "Free", "Premium", "Elite"],
537
543
  },
538
544
 
539
- scdProps: {},
545
+ scdProps: {
546
+ player_rank: {
547
+ values: ["recruit", "veteran", "elite", "legend"],
548
+ frequency: "week",
549
+ timing: "fuzzy",
550
+ max: 20
551
+ }
552
+ },
540
553
 
541
554
  userProps: {
542
555
  "preferred_playstyle": [
@@ -556,6 +569,20 @@ const config = {
556
569
  "Ranger",
557
570
  "Paladin"
558
571
  ],
572
+ Platform: [
573
+ "PC",
574
+ "Mac",
575
+ "PlayStation",
576
+ "Xbox",
577
+ "Switch"
578
+ ],
579
+ graphics_quality: [
580
+ "Low",
581
+ "Medium",
582
+ "High",
583
+ "Ultra"
584
+ ],
585
+ subscription_tier: ["Free", "Free", "Free", "Premium", "Elite"],
559
586
  },
560
587
 
561
588
  groupKeys: [
@@ -589,7 +616,7 @@ const config = {
589
616
  */
590
617
  hook: function (record, type, meta) {
591
618
  const NOW = dayjs();
592
- const DATASET_START = NOW.subtract(days, 'days');
619
+ const DATASET_START = NOW.subtract(num_days, 'days');
593
620
  const CURSED_WEEK_START = DATASET_START.add(40, 'days');
594
621
  const CURSED_WEEK_END = DATASET_START.add(47, 'days');
595
622
  const LEGENDARY_WEAPON_RELEASE = DATASET_START.add(45, 'days');
@@ -636,6 +663,15 @@ const config = {
636
663
  // Hook #3, #4, #5, #6, #1: EVERYTHING - Complex behavioral patterns
637
664
  if (type === "everything") {
638
665
  const userEvents = record;
666
+ const profile = meta.profile;
667
+
668
+ // Stamp superProps from profile for consistency
669
+ userEvents.forEach(e => {
670
+ e.Platform = profile.Platform;
671
+ e.graphics_quality = profile.graphics_quality;
672
+ e.subscription_tier = profile.subscription_tier;
673
+ });
674
+
639
675
  const firstEventTime = userEvents.length > 0 ? dayjs(userEvents[0].time) : null;
640
676
 
641
677
  // Track user behaviors