make-mp-data 3.0.1 → 3.0.2

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 (50) hide show
  1. package/dungeons/adspend.js +35 -1
  2. package/dungeons/anon.js +25 -1
  3. package/dungeons/{array-of-object-loopup.js → array-of-object-lookup.js} +28 -8
  4. package/dungeons/benchmark-heavy.js +2 -2
  5. package/dungeons/benchmark-light.js +2 -2
  6. package/dungeons/big.js +2 -2
  7. package/dungeons/business.js +59 -12
  8. package/dungeons/complex.js +34 -1
  9. package/dungeons/copilot.js +1 -1
  10. package/dungeons/{harness/harness-education.js → education.js} +29 -12
  11. package/dungeons/experiments.js +15 -2
  12. package/dungeons/{harness/harness-fintech.js → fintech.js} +8 -8
  13. package/dungeons/foobar.js +33 -1
  14. package/dungeons/{harness/harness-food.js → food.js} +7 -4
  15. package/dungeons/funnels.js +38 -1
  16. package/dungeons/gaming.js +25 -5
  17. package/dungeons/media.js +861 -271
  18. package/dungeons/mil.js +29 -2
  19. package/dungeons/mirror.js +33 -1
  20. package/dungeons/{kurby.js → retention-cadence.js} +1 -1
  21. package/dungeons/{harness/harness-gaming.js → rpg.js} +5 -5
  22. package/dungeons/sanity.js +31 -2
  23. package/dungeons/{harness/harness-sass.js → sass.js} +2 -2
  24. package/dungeons/scd.js +46 -1
  25. package/dungeons/simple.js +1 -1
  26. package/dungeons/{harness/harness-social.js → social.js} +2 -2
  27. package/dungeons/streaming.js +373 -0
  28. package/dungeons/strict-event-test.js +1 -1
  29. package/dungeons/student-teacher.js +18 -5
  30. package/dungeons/text-generation.js +38 -1
  31. package/dungeons/too-big-events.js +38 -1
  32. package/dungeons/{userAgent.js → user-agent.js} +21 -1
  33. package/entry.js +5 -4
  34. package/lib/utils/logger.js +0 -4
  35. package/package.json +1 -4
  36. package/dungeons/ai-chat-analytics-ed.js +0 -275
  37. package/dungeons/clinch-agi.js +0 -632
  38. package/dungeons/ecommerce-store.js +0 -0
  39. package/dungeons/harness/harness-media.js +0 -961
  40. package/dungeons/money2020-ed-also.js +0 -277
  41. package/dungeons/money2020-ed.js +0 -580
  42. package/dungeons/uday-schema.json +0 -220
  43. package/lib/templates/funnels-instructions.txt +0 -272
  44. package/lib/templates/hook-examples.json +0 -187
  45. package/lib/templates/hooks-instructions.txt +0 -721
  46. package/lib/templates/refine-instructions.txt +0 -485
  47. package/lib/templates/schema-instructions.txt +0 -285
  48. package/lib/utils/ai.js +0 -896
  49. package/lib/utils/mixpanel.js +0 -101
  50. package/lib/utils/project.js +0 -167
@@ -22,7 +22,7 @@ const videoCategories = ["funny", "educational", "inspirational", "music", "news
22
22
 
23
23
  /** @type {import('../types').Dungeon} */
24
24
  const config = {
25
- token: process.env.MASTER_PROJECT_TOKEN || "",
25
+ token: "",
26
26
  seed: "simple is best",
27
27
  numDays: 30, //how many days worth of data
28
28
  numEvents: 50000, //how many events
@@ -263,6 +263,43 @@ const config = {
263
263
  },
264
264
  lookupTables: [],
265
265
  hook: function (record, type, meta) {
266
+ // user hook: classify users as creators vs viewers based on upload count
267
+ if (type === "user") {
268
+ record.user_type = record.upload_count >= 5 ? "creator" : "viewer";
269
+ }
270
+
271
+ // event hook: premium users get higher quality video and longer watch times
272
+ if (type === "event") {
273
+ if (record.event === "watch video") {
274
+ const day = dayjs(record.time).day();
275
+ // weekend binge: 2x watch time on weekends
276
+ if (day === 0 || day === 6) {
277
+ record["watch time"] = Math.round((record["watch time"] || 10) * 2);
278
+ record.is_weekend = true;
279
+ }
280
+ }
281
+ // failed logins get a security_flag
282
+ if (record.event === "account login" && record.success === false) {
283
+ record.security_flag = true;
284
+ }
285
+ }
286
+
287
+ // everything hook: binge-watchers (>30 watch events) get a "binge session" bonus event
288
+ if (type === "everything") {
289
+ const watchEvents = record.filter(e => e.event === "watch video");
290
+ if (watchEvents.length > 30) {
291
+ const lastWatch = watchEvents[watchEvents.length - 1];
292
+ record.push({
293
+ event: "binge session",
294
+ time: lastWatch.time,
295
+ user_id: lastWatch.user_id,
296
+ videos_watched: watchEvents.length,
297
+ total_watch_time: watchEvents.reduce((sum, e) => sum + (e["watch time"] || 0), 0),
298
+ });
299
+ }
300
+ return record;
301
+ }
302
+
266
303
  return record;
267
304
  }
268
305
  };
@@ -15,7 +15,7 @@ const days = 180;
15
15
 
16
16
  /** @type {Config} */
17
17
  const config = {
18
- token: process.env.MASTER_PROJECT_TOKEN || "",
18
+ token: "",
19
19
  seed: "i am gamer face",
20
20
  numDays: days,
21
21
  numEvents: num_users * 90,
@@ -39,7 +39,7 @@ const config = {
39
39
 
40
40
  batchSize: 2_500_000,
41
41
  concurrency: 1,
42
- writeToDisk: true,
42
+ writeToDisk: false,
43
43
  funnels: [
44
44
  {
45
45
  "sequence": ["app install", "character creation", "join party"],
@@ -316,14 +316,34 @@ const config = {
316
316
  "subscription MRR": u.weighNumRange(0, 250, 1, 200)
317
317
  },
318
318
  hook: function (record, type, meta) {
319
- // const NOW = dayjs();
320
319
 
321
320
  if (type === "event") {
322
- // const EVENT_TIME = dayjs(record.time);
321
+ // Pattern 1: Higher-level players earn more gold and defeat more enemies
322
+ if (record.event === "complete quest") {
323
+ const level = record["level at end"] || 1;
324
+ record["quest reward (gold)"] = Math.round((record["quest reward (gold)"] || 50) * (1 + level * 0.1));
325
+ }
326
+
327
+ // Pattern 2: In-game purchases are bigger for "free trial" experiment users
328
+ if (record.event === "in-game purchase") {
329
+ // We don't have profile here, so use a hash-based approach
330
+ const uid = record.user_id || record.distinct_id || "";
331
+ if (uid.charCodeAt(0) % 3 === 0) {
332
+ record["purchase amount"] = Math.round((record["purchase amount"] || 10) * 1.8);
333
+ record.is_whale = true;
334
+ }
335
+ }
323
336
  }
324
337
 
325
338
  if (type === "user") {
326
-
339
+ // Pattern 3: Chaotic Evil players get a "villain" tag; Lawful Good get "hero"
340
+ if (record.alignment === "Chaotic Evil" || record.alignment === "Neutral Evil") {
341
+ record.archetype = "villain";
342
+ } else if (record.alignment === "Lawful Good" || record.alignment === "Neutral Good") {
343
+ record.archetype = "hero";
344
+ } else {
345
+ record.archetype = "neutral";
346
+ }
327
347
  }
328
348
 
329
349
  if (type === "funnel-post") {