@ak--47/dungeon-master 1.3.0 → 1.4.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 (98) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dungeons/technical/array-of-object-lookup.js +0 -2
  3. package/dungeons/technical/hook-helpers-verify.js +89 -0
  4. package/dungeons/technical/identity-model-verify.js +47 -0
  5. package/dungeons/technical/pattern-aggregate-by-bin.js +41 -0
  6. package/dungeons/technical/pattern-attributed-by-source.js +42 -0
  7. package/dungeons/technical/pattern-frequency-by-frequency.js +40 -0
  8. package/dungeons/technical/pattern-funnel-frequency.js +54 -0
  9. package/dungeons/technical/pattern-ttc-by-segment.js +45 -0
  10. package/dungeons/technical/simple.js +3 -4
  11. package/dungeons/technical/simplest-schema.json +5 -0
  12. package/dungeons/technical/text-generation.js +1 -1
  13. package/dungeons/vertical/ai-platform.js +216 -164
  14. package/dungeons/vertical/community.js +74 -41
  15. package/dungeons/vertical/crypto.js +343 -233
  16. package/dungeons/vertical/dating.js +246 -292
  17. package/dungeons/vertical/devtools.js +179 -70
  18. package/dungeons/vertical/ecommerce.js +275 -122
  19. package/dungeons/vertical/education.js +345 -312
  20. package/dungeons/vertical/fintech.js +445 -314
  21. package/dungeons/vertical/fitness.js +199 -165
  22. package/dungeons/vertical/food-delivery.js +309 -330
  23. package/dungeons/vertical/gaming.js +387 -241
  24. package/dungeons/vertical/healthcare.js +149 -66
  25. package/dungeons/vertical/insurance-application.js +173 -75
  26. package/dungeons/vertical/logistics.js +107 -12
  27. package/dungeons/vertical/marketplace.js +171 -76
  28. package/dungeons/vertical/media.js +259 -402
  29. package/dungeons/vertical/real-estate.js +336 -318
  30. package/dungeons/vertical/sass.js +294 -288
  31. package/dungeons/vertical/social.js +289 -234
  32. package/dungeons/vertical/travel.js +66 -20
  33. package/index.js +17 -17
  34. package/lib/core/config-validator.js +226 -175
  35. package/lib/core/context.js +10 -24
  36. package/lib/core/storage.js +6 -1
  37. package/lib/generators/events.js +57 -104
  38. package/lib/generators/funnels.js +212 -93
  39. package/lib/generators/mirror.js +3 -2
  40. package/lib/generators/product-names.js +1 -1
  41. package/lib/generators/scd.js +2 -1
  42. package/lib/generators/text.js +1 -1
  43. package/lib/hook-helpers/_internal.js +23 -0
  44. package/lib/hook-helpers/cohort.js +124 -0
  45. package/lib/hook-helpers/identity.js +56 -0
  46. package/lib/hook-helpers/index.js +44 -0
  47. package/lib/hook-helpers/inject.js +99 -0
  48. package/lib/hook-helpers/mutate.js +151 -0
  49. package/lib/hook-helpers/timing.js +99 -0
  50. package/lib/hook-patterns/aggregate-per-user-by-bin.js +38 -0
  51. package/lib/hook-patterns/attributed-by-source.js +72 -0
  52. package/lib/hook-patterns/frequency-by-frequency.js +46 -0
  53. package/lib/hook-patterns/funnel-frequency-breakdown.js +73 -0
  54. package/lib/hook-patterns/index.js +14 -0
  55. package/lib/hook-patterns/time-to-convert-by-segment.js +41 -0
  56. package/lib/orchestrators/user-loop.js +143 -293
  57. package/lib/utils/utils.js +97 -52
  58. package/lib/verify/emulate-breakdown.js +281 -0
  59. package/lib/verify/index.js +12 -0
  60. package/lib/verify/verify-dungeon.js +61 -0
  61. package/package.json +6 -4
  62. package/scripts/smoke-test-all.mjs +162 -0
  63. package/scripts/verify-runner.mjs +72 -24
  64. package/types.d.ts +434 -225
  65. package/dungeons/technical/ad-spend-schema.json +0 -128
  66. package/dungeons/technical/anonymous-users-schema.json +0 -92
  67. package/dungeons/technical/array-of-object-lookup-schema.json +0 -191
  68. package/dungeons/technical/experiments-schema.json +0 -203
  69. package/dungeons/technical/foobar-schema.json +0 -362
  70. package/dungeons/technical/group-analytics-schema.json +0 -241
  71. package/dungeons/technical/mirror-strategies-schema.json +0 -84
  72. package/dungeons/technical/nested-objects-schema.json +0 -145
  73. package/dungeons/technical/retention-cadence-schema.json +0 -37
  74. package/dungeons/technical/sanity-schema.json +0 -185
  75. package/dungeons/technical/scale-test-schema.json +0 -70
  76. package/dungeons/technical/scd-schema.json +0 -467
  77. package/dungeons/technical/simple-schema.json +0 -362
  78. package/dungeons/technical/text-generation-schema.json +0 -1062
  79. package/dungeons/vertical/ai-platform-schema.json +0 -617
  80. package/dungeons/vertical/community-schema.json +0 -579
  81. package/dungeons/vertical/crypto-schema.json +0 -546
  82. package/dungeons/vertical/dating-schema.json +0 -401
  83. package/dungeons/vertical/devtools-schema.json +0 -601
  84. package/dungeons/vertical/ecommerce-schema.json +0 -604
  85. package/dungeons/vertical/education-schema.json +0 -5686
  86. package/dungeons/vertical/fintech-schema.json +0 -630
  87. package/dungeons/vertical/fitness-schema.json +0 -530
  88. package/dungeons/vertical/food-delivery-schema.json +0 -36728
  89. package/dungeons/vertical/gaming-schema.json +0 -2703
  90. package/dungeons/vertical/healthcare-schema.json +0 -549
  91. package/dungeons/vertical/insurance-application-schema.json +0 -485
  92. package/dungeons/vertical/logistics-schema.json +0 -574
  93. package/dungeons/vertical/marketplace-schema.json +0 -533
  94. package/dungeons/vertical/media-schema.json +0 -4749
  95. package/dungeons/vertical/real-estate-schema.json +0 -527
  96. package/dungeons/vertical/sass-schema.json +0 -3128
  97. package/dungeons/vertical/social-schema.json +0 -620
  98. package/dungeons/vertical/travel-schema.json +0 -580
@@ -1,617 +0,0 @@
1
- {
2
- "events": [
3
- {
4
- "event": "organization created",
5
- "isFirstEvent": true,
6
- "properties": {
7
- "org_size": [
8
- "solo",
9
- "startup",
10
- "growth",
11
- "enterprise"
12
- ],
13
- "referral_source": [
14
- "docs",
15
- "blog",
16
- "github",
17
- "word_of_mouth",
18
- "search",
19
- "conference"
20
- ]
21
- }
22
- },
23
- {
24
- "event": "api key created",
25
- "weight": 2,
26
- "properties": {
27
- "key_type": [
28
- "development",
29
- "production",
30
- "staging"
31
- ],
32
- "key_scope": [
33
- "full_access",
34
- "read_only",
35
- "completions_only"
36
- ]
37
- }
38
- },
39
- {
40
- "event": "api key rotated",
41
- "properties": {
42
- "rotation_reason": [
43
- "scheduled",
44
- "compromised",
45
- "policy",
46
- "manual"
47
- ]
48
- }
49
- },
50
- {
51
- "event": "api call",
52
- "weight": 10,
53
- "properties": {
54
- "model": [
55
- "sonnet-4",
56
- "haiku-4",
57
- "opus-4-6"
58
- ],
59
- "input_tokens": {
60
- "$range": [
61
- 973,
62
- 6840
63
- ]
64
- },
65
- "output_tokens": {
66
- "$range": [
67
- 516,
68
- 3532
69
- ]
70
- },
71
- "tokens_used": {
72
- "$range": [
73
- 1096,
74
- 10452
75
- ]
76
- },
77
- "cost_usd": {
78
- "$range": [
79
- 0,
80
- 0.05
81
- ]
82
- },
83
- "cost_per_token": {
84
- "$range": [
85
- 0,
86
- 0
87
- ]
88
- },
89
- "latency_ms": {
90
- "$range": [
91
- 2065,
92
- 12940
93
- ]
94
- },
95
- "cache_enabled": [
96
- false
97
- ],
98
- "is_error": [
99
- false
100
- ],
101
- "error_type": [
102
- "none"
103
- ],
104
- "multi_turn": [
105
- false,
106
- true
107
- ],
108
- "context_window": [
109
- 200000
110
- ],
111
- "is_agentic_user": [
112
- false
113
- ],
114
- "is_batch_user": [
115
- false
116
- ],
117
- "stream": [
118
- true,
119
- false
120
- ],
121
- "stop_reason": [
122
- "end_turn",
123
- "max_tokens",
124
- "tool_use"
125
- ]
126
- }
127
- },
128
- {
129
- "event": "tool use call",
130
- "weight": 4,
131
- "properties": {
132
- "tool_name": [
133
- "web_search",
134
- "code_interpreter",
135
- "file_reader",
136
- "calculator",
137
- "database_query",
138
- "api_connector"
139
- ],
140
- "execution_time_ms": {
141
- "$range": [
142
- 1459,
143
- 8950
144
- ]
145
- },
146
- "success": [
147
- true,
148
- false
149
- ],
150
- "tool_input_tokens": {
151
- "$range": [
152
- 290,
153
- 1704
154
- ]
155
- },
156
- "tool_output_tokens": {
157
- "$range": [
158
- 555,
159
- 4337
160
- ]
161
- }
162
- }
163
- },
164
- {
165
- "event": "batch job submitted",
166
- "weight": 2,
167
- "properties": {
168
- "batch_size": {
169
- "$range": [
170
- 1738,
171
- 8397
172
- ]
173
- },
174
- "model": [
175
- "sonnet-4",
176
- "haiku-4",
177
- "opus-4-6"
178
- ],
179
- "estimated_tokens": {
180
- "$range": [
181
- 748532,
182
- 4091804
183
- ]
184
- },
185
- "priority": [
186
- "standard",
187
- "express"
188
- ]
189
- }
190
- },
191
- {
192
- "event": "batch job completed",
193
- "weight": 2,
194
- "properties": {
195
- "batch_size": {
196
- "$range": [
197
- 1252,
198
- 8017
199
- ]
200
- },
201
- "processing_time_sec": {
202
- "$range": [
203
- 1091,
204
- 6287
205
- ]
206
- },
207
- "total_tokens": {
208
- "$range": [
209
- 787782,
210
- 4190266
211
- ]
212
- },
213
- "success_rate": {
214
- "$range": [
215
- 91,
216
- 98
217
- ]
218
- }
219
- }
220
- },
221
- {
222
- "event": "eval job",
223
- "weight": 3,
224
- "properties": {
225
- "eval_type": [
226
- "accuracy",
227
- "relevance",
228
- "safety",
229
- "latency",
230
- "cost",
231
- "custom"
232
- ],
233
- "num_test_cases": {
234
- "$range": [
235
- 216,
236
- 829
237
- ]
238
- },
239
- "model": [
240
- "sonnet-4",
241
- "haiku-4",
242
- "opus-4-6"
243
- ],
244
- "dataset_name": [
245
- "prod_prompts",
246
- "safety_suite",
247
- "regression_set",
248
- "benchmark_v2",
249
- "custom_eval"
250
- ]
251
- }
252
- },
253
- {
254
- "event": "eval result",
255
- "weight": 3,
256
- "properties": {
257
- "eval_type": [
258
- "accuracy",
259
- "relevance",
260
- "safety",
261
- "latency",
262
- "cost",
263
- "custom"
264
- ],
265
- "score": {
266
- "$range": [
267
- 6,
268
- 80
269
- ]
270
- },
271
- "pass_rate": {
272
- "$range": [
273
- 52,
274
- 93
275
- ]
276
- },
277
- "model": [
278
- "sonnet-4",
279
- "haiku-4",
280
- "opus-4-6"
281
- ],
282
- "regression_detected": [
283
- false,
284
- true
285
- ]
286
- }
287
- },
288
- {
289
- "event": "rate limit error",
290
- "weight": 3,
291
- "properties": {
292
- "error_code": [
293
- 429
294
- ],
295
- "retry_after_ms": {
296
- "$range": [
297
- 9376,
298
- 50147
299
- ]
300
- },
301
- "requests_per_minute": {
302
- "$range": [
303
- 264,
304
- 1689
305
- ]
306
- },
307
- "tier_limit": [
308
- "Free",
309
- "Build",
310
- "Enterprise"
311
- ]
312
- }
313
- },
314
- {
315
- "event": "billing payment",
316
- "weight": 2,
317
- "properties": {
318
- "amount_usd": {
319
- "$range": [
320
- 9326,
321
- 39495
322
- ]
323
- },
324
- "payment_method": [
325
- "credit_card",
326
- "invoice",
327
- "wire_transfer"
328
- ],
329
- "billing_period": [
330
- "monthly",
331
- "annual"
332
- ],
333
- "tokens_consumed": {
334
- "$range": [
335
- 7977898,
336
- 43456125
337
- ]
338
- }
339
- }
340
- },
341
- {
342
- "event": "model selected",
343
- "weight": 3,
344
- "properties": {
345
- "model": [
346
- "sonnet-4",
347
- "haiku-4",
348
- "opus-4-6"
349
- ],
350
- "is_default": [
351
- true,
352
- false
353
- ],
354
- "selection_context": [
355
- "playground",
356
- "api_config",
357
- "eval_setup",
358
- "batch_config"
359
- ]
360
- }
361
- },
362
- {
363
- "event": "dashboard viewed",
364
- "weight": 5,
365
- "properties": {
366
- "dashboard_section": [
367
- "usage",
368
- "billing",
369
- "api_keys",
370
- "models",
371
- "evals",
372
- "logs"
373
- ],
374
- "time_range": [
375
- "1h",
376
- "24h",
377
- "7d",
378
- "30d"
379
- ]
380
- }
381
- },
382
- {
383
- "event": "docs searched",
384
- "weight": 4,
385
- "properties": {
386
- "search_query_category": [
387
- "api_reference",
388
- "quickstart",
389
- "pricing",
390
- "models",
391
- "tool_use",
392
- "batch_api",
393
- "caching",
394
- "errors"
395
- ],
396
- "results_found": [
397
- 17,
398
- 11,
399
- 37,
400
- 9,
401
- 13,
402
- 16,
403
- 28
404
- ],
405
- "clicked_result": [
406
- true,
407
- false
408
- ]
409
- }
410
- },
411
- {
412
- "event": "member invited",
413
- "weight": 2,
414
- "properties": {
415
- "invite_role": [
416
- "admin",
417
- "developer",
418
- "billing",
419
- "viewer"
420
- ],
421
- "invite_method": [
422
- "email",
423
- "sso",
424
- "link"
425
- ]
426
- }
427
- },
428
- {
429
- "event": "webhook configured",
430
- "properties": {
431
- "webhook_event": [
432
- "usage_alert",
433
- "rate_limit",
434
- "batch_complete",
435
- "eval_complete",
436
- "billing_threshold"
437
- ],
438
- "delivery_method": [
439
- "https",
440
- "slack",
441
- "email"
442
- ]
443
- }
444
- },
445
- {
446
- "event": "playground session",
447
- "weight": 4,
448
- "properties": {
449
- "model": [
450
- "sonnet-4",
451
- "haiku-4",
452
- "opus-4-6"
453
- ],
454
- "turns": [
455
- 9,
456
- 17,
457
- 21,
458
- 18
459
- ],
460
- "shared": [
461
- false,
462
- true
463
- ],
464
- "tokens_used": {
465
- "$range": [
466
- 3057,
467
- 16592
468
- ]
469
- }
470
- }
471
- },
472
- {
473
- "event": "account deactivated",
474
- "isChurnEvent": true,
475
- "returnLikelihood": 0.1,
476
- "isStrictEvent": true,
477
- "properties": {
478
- "reason": [
479
- "cost",
480
- "switched_provider",
481
- "project_ended",
482
- "rate_limits",
483
- "no_longer_needed",
484
- "performance"
485
- ]
486
- }
487
- }
488
- ],
489
- "funnels": [
490
- {
491
- "sequence": [
492
- "organization created",
493
- "api key created",
494
- "api call"
495
- ],
496
- "name": "Onboarding",
497
- "isFirstFunnel": true,
498
- "conversionRate": 70,
499
- "timeToConvert": 48,
500
- "weight": 3
501
- },
502
- {
503
- "sequence": [
504
- "api call",
505
- "tool use call",
506
- "eval job"
507
- ],
508
- "name": "API to Eval Pipeline",
509
- "conversionRate": 45,
510
- "timeToConvert": 168,
511
- "weight": 5
512
- },
513
- {
514
- "sequence": [
515
- "api call",
516
- "billing payment"
517
- ],
518
- "name": "Usage to Billing",
519
- "conversionRate": 30,
520
- "timeToConvert": 336,
521
- "weight": 2
522
- }
523
- ],
524
- "superProps": {
525
- "api_tier": [
526
- "Free",
527
- "Build",
528
- "Enterprise"
529
- ],
530
- "primary_use_case": [
531
- "chatbot",
532
- "code_generation",
533
- "data_extraction",
534
- "content_creation",
535
- "agents"
536
- ],
537
- "sdk_language": [
538
- "python",
539
- "typescript",
540
- "java",
541
- "go",
542
- "curl"
543
- ]
544
- },
545
- "userProps": {
546
- "api_tier": [
547
- "Free",
548
- "Build",
549
- "Enterprise"
550
- ],
551
- "primary_use_case": [
552
- "chatbot",
553
- "code_generation",
554
- "data_extraction",
555
- "content_creation",
556
- "agents"
557
- ],
558
- "sdk_language": [
559
- "python",
560
- "typescript",
561
- "java",
562
- "go",
563
- "curl"
564
- ],
565
- "monthly_spend": {
566
- "$range": [
567
- 10343,
568
- 40702
569
- ]
570
- },
571
- "total_api_calls": {
572
- "$range": [
573
- 87308,
574
- 404355
575
- ]
576
- },
577
- "preferred_model": [
578
- "sonnet-4",
579
- "haiku-4",
580
- "opus-4-6"
581
- ],
582
- "has_eval_pipeline": [
583
- false
584
- ],
585
- "hit_rate_limit_early": [
586
- false
587
- ],
588
- "has_early_eval": [
589
- false
590
- ]
591
- },
592
- "scdProps": {
593
- "monthly_api_usage": {
594
- "type": "user",
595
- "frequency": "week",
596
- "timing": "fuzzy",
597
- "max": 20,
598
- "values": {
599
- "$range": [
600
- 213492,
601
- 839597
602
- ]
603
- }
604
- },
605
- "api_tier_history": {
606
- "type": "user",
607
- "frequency": "month",
608
- "timing": "fixed",
609
- "max": 6,
610
- "values": [
611
- "Free",
612
- "Build",
613
- "Enterprise"
614
- ]
615
- }
616
- }
617
- }