make-mp-data 2.1.11 → 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.
- package/README.md +31 -0
- package/dungeons/adspend.js +35 -1
- package/dungeons/anon.js +25 -1
- package/dungeons/array-of-object-lookup.js +201 -0
- package/dungeons/benchmark-heavy.js +241 -0
- package/dungeons/benchmark-light.js +141 -0
- package/dungeons/big.js +10 -9
- package/dungeons/business.js +60 -12
- package/dungeons/complex.js +35 -1
- package/dungeons/copilot.js +383 -0
- package/dungeons/education.js +1005 -0
- package/dungeons/experiments.js +18 -4
- package/dungeons/fintech.js +976 -0
- package/dungeons/foobar.js +32 -0
- package/dungeons/food.js +988 -0
- package/dungeons/funnels.js +38 -1
- package/dungeons/gaming.js +26 -5
- package/dungeons/media.js +861 -270
- package/dungeons/mil.js +31 -3
- package/dungeons/mirror.js +33 -1
- package/dungeons/retention-cadence.js +211 -0
- package/dungeons/rpg.js +1178 -0
- package/dungeons/sanity.js +32 -2
- package/dungeons/sass.js +923 -0
- package/dungeons/scd.js +47 -1
- package/dungeons/simple.js +29 -14
- package/dungeons/social.js +928 -0
- package/dungeons/streaming.js +373 -0
- package/dungeons/strict-event-test.js +30 -0
- package/dungeons/student-teacher.js +19 -5
- package/dungeons/text-generation.js +120 -84
- package/dungeons/too-big-events.js +203 -0
- package/dungeons/{userAgent.js → user-agent.js} +23 -2
- package/entry.js +5 -4
- package/index.js +41 -54
- package/lib/core/config-validator.js +122 -7
- package/lib/core/context.js +7 -14
- package/lib/core/storage.js +57 -25
- package/lib/generators/adspend.js +12 -12
- package/lib/generators/events.js +6 -5
- package/lib/generators/funnels.js +32 -10
- package/lib/generators/product-lookup.js +262 -0
- package/lib/generators/product-names.js +195 -0
- package/lib/generators/profiles.js +3 -3
- package/lib/generators/scd.js +13 -3
- package/lib/generators/text.js +17 -4
- package/lib/orchestrators/mixpanel-sender.js +244 -204
- package/lib/orchestrators/user-loop.js +54 -16
- package/lib/templates/phrases.js +473 -16
- package/lib/templates/schema.d.ts +173 -0
- package/lib/templates/verbose-schema.js +140 -206
- package/lib/utils/chart.js +210 -0
- package/lib/utils/function-registry.js +285 -0
- package/lib/utils/json-evaluator.js +172 -0
- package/lib/utils/logger.js +34 -0
- package/lib/utils/utils.js +41 -4
- package/package.json +12 -21
- package/types.d.ts +15 -5
- package/dungeons/ai-chat-analytics-ed.js +0 -274
- package/dungeons/money2020-ed-also.js +0 -277
- package/dungeons/money2020-ed.js +0 -579
- package/lib/generators/text-bak-old.js +0 -1121
- package/lib/orchestrators/worker-manager.js +0 -203
- package/lib/templates/hooks-instructions.txt +0 -434
- package/lib/templates/phrases-bak.js +0 -925
- package/lib/templates/prompt (old).txt +0 -98
- package/lib/templates/schema-instructions.txt +0 -155
- package/lib/templates/scratch-dungeon-template.js +0 -116
- package/lib/templates/textQuickTest.js +0 -172
- package/lib/utils/ai.js +0 -120
- package/lib/utils/project.js +0 -166
package/dungeons/funnels.js
CHANGED
|
@@ -14,7 +14,7 @@ import dayjs from "dayjs";
|
|
|
14
14
|
import utc from "dayjs/plugin/utc.js";
|
|
15
15
|
dayjs.extend(utc);
|
|
16
16
|
import { uid, comma } from 'ak-tools';
|
|
17
|
-
import { pickAWinner, weighNumRange, date, integer } from
|
|
17
|
+
import { pickAWinner, weighNumRange, date, integer } from "../lib/utils/utils.js";
|
|
18
18
|
|
|
19
19
|
const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
|
|
20
20
|
|
|
@@ -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
|
};
|
package/dungeons/gaming.js
CHANGED
|
@@ -35,10 +35,11 @@ const config = {
|
|
|
35
35
|
percentUsersBornInDataset: 25,
|
|
36
36
|
|
|
37
37
|
hasAvatar: true,
|
|
38
|
+
makeChart: false,
|
|
38
39
|
|
|
39
|
-
batchSize:
|
|
40
|
+
batchSize: 2_500_000,
|
|
40
41
|
concurrency: 1,
|
|
41
|
-
writeToDisk:
|
|
42
|
+
writeToDisk: false,
|
|
42
43
|
funnels: [
|
|
43
44
|
{
|
|
44
45
|
"sequence": ["app install", "character creation", "join party"],
|
|
@@ -315,14 +316,34 @@ const config = {
|
|
|
315
316
|
"subscription MRR": u.weighNumRange(0, 250, 1, 200)
|
|
316
317
|
},
|
|
317
318
|
hook: function (record, type, meta) {
|
|
318
|
-
// const NOW = dayjs();
|
|
319
319
|
|
|
320
320
|
if (type === "event") {
|
|
321
|
-
//
|
|
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
|
+
}
|
|
322
336
|
}
|
|
323
337
|
|
|
324
338
|
if (type === "user") {
|
|
325
|
-
|
|
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
|
+
}
|
|
326
347
|
}
|
|
327
348
|
|
|
328
349
|
if (type === "funnel-post") {
|