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/sanity.js
CHANGED
|
@@ -13,7 +13,7 @@ const chance = new Chance();
|
|
|
13
13
|
import dayjs from 'dayjs';
|
|
14
14
|
import utc from 'dayjs/plugin/utc.js';
|
|
15
15
|
dayjs.extend(utc);
|
|
16
|
-
import { weighNumRange, integer } from
|
|
16
|
+
import { weighNumRange, integer } from "../lib/utils/utils.js";
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
/** @type {import('../types.js').Dungeon} */
|
|
@@ -28,7 +28,8 @@ const config = {
|
|
|
28
28
|
hasAnonIds: false, //if true, anonymousIds are created for each user
|
|
29
29
|
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
30
30
|
alsoInferFunnels: true, //if true, infer funnels from events
|
|
31
|
-
|
|
31
|
+
makeChart: true,
|
|
32
|
+
writeToDisk: false,
|
|
32
33
|
concurrency: 25,
|
|
33
34
|
funnels: [
|
|
34
35
|
{
|
|
@@ -103,6 +104,35 @@ const config = {
|
|
|
103
104
|
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
104
105
|
},
|
|
105
106
|
hook: function (record, type, meta) {
|
|
107
|
+
// --- user hook: tag power users based on luckyNumber ---
|
|
108
|
+
if (type === "user") {
|
|
109
|
+
record.userTier = record.luckyNumber > 300 ? "power" : "regular";
|
|
110
|
+
return record;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// --- event hook: add an engagement score based on event type ---
|
|
114
|
+
if (type === "event") {
|
|
115
|
+
const highEngagement = ["fonk", "crumn", "yak"];
|
|
116
|
+
const midEngagement = ["garply", "durtle", "linny"];
|
|
117
|
+
if (highEngagement.includes(record.event)) {
|
|
118
|
+
record.engagement_score = chance.integer({ min: 70, max: 100 });
|
|
119
|
+
} else if (midEngagement.includes(record.event)) {
|
|
120
|
+
record.engagement_score = chance.integer({ min: 30, max: 69 });
|
|
121
|
+
} else {
|
|
122
|
+
record.engagement_score = chance.integer({ min: 1, max: 29 });
|
|
123
|
+
}
|
|
124
|
+
return record;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// --- everything hook: low-activity users lose their last few events (churn simulation) ---
|
|
128
|
+
if (type === "everything") {
|
|
129
|
+
if (record.length > 3 && record.length < 8) {
|
|
130
|
+
// users with few events lose the tail end — simulates churn
|
|
131
|
+
return record.slice(0, Math.ceil(record.length * 0.6));
|
|
132
|
+
}
|
|
133
|
+
return record;
|
|
134
|
+
}
|
|
135
|
+
|
|
106
136
|
return record;
|
|
107
137
|
}
|
|
108
138
|
};
|