@idlekit/core 0.2.0 → 0.3.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 (82) hide show
  1. package/dist/index.d.ts +12 -0
  2. package/dist/index.js +12 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/scenario/compile.d.ts +25 -0
  5. package/dist/scenario/compile.js +60 -0
  6. package/dist/scenario/compile.js.map +1 -1
  7. package/dist/scenario/scenarioContract.d.ts +152 -0
  8. package/dist/scenario/scenarioContract.js +2815 -0
  9. package/dist/scenario/scenarioContract.js.map +1 -0
  10. package/dist/sim/analysis/analyzers.d.ts +245 -0
  11. package/dist/sim/analysis/analyzers.js +1076 -0
  12. package/dist/sim/analysis/analyzers.js.map +1 -0
  13. package/dist/sim/analysis/contracts.d.ts +147 -0
  14. package/dist/sim/analysis/contracts.js +1230 -0
  15. package/dist/sim/analysis/contracts.js.map +1 -0
  16. package/dist/sim/analysis/distribution.d.ts +199 -0
  17. package/dist/sim/analysis/distribution.js +1246 -0
  18. package/dist/sim/analysis/distribution.js.map +1 -0
  19. package/dist/sim/analysis/eta.d.ts +118 -0
  20. package/dist/sim/analysis/eta.js +968 -70
  21. package/dist/sim/analysis/eta.js.map +1 -1
  22. package/dist/sim/analysis/experiment.d.ts +300 -0
  23. package/dist/sim/analysis/experiment.js +2206 -0
  24. package/dist/sim/analysis/experiment.js.map +1 -0
  25. package/dist/sim/analysis/growth.d.ts +2 -0
  26. package/dist/sim/analysis/growth.js +5 -1
  27. package/dist/sim/analysis/growth.js.map +1 -1
  28. package/dist/sim/analysis/growthFit.d.ts +183 -0
  29. package/dist/sim/analysis/growthFit.js +1798 -0
  30. package/dist/sim/analysis/growthFit.js.map +1 -0
  31. package/dist/sim/analysis/inspect.d.ts +236 -0
  32. package/dist/sim/analysis/inspect.js +388 -0
  33. package/dist/sim/analysis/inspect.js.map +1 -0
  34. package/dist/sim/analysis/metrics.d.ts +91 -0
  35. package/dist/sim/analysis/metrics.js +266 -0
  36. package/dist/sim/analysis/metrics.js.map +1 -0
  37. package/dist/sim/analysis/prestigeCycle.d.ts +6 -0
  38. package/dist/sim/analysis/prestigeCycle.js +10 -1
  39. package/dist/sim/analysis/prestigeCycle.js.map +1 -1
  40. package/dist/sim/analysis/registry.d.ts +41 -0
  41. package/dist/sim/analysis/registry.js +54 -0
  42. package/dist/sim/analysis/registry.js.map +1 -0
  43. package/dist/sim/analysis/resetActions.d.ts +7 -0
  44. package/dist/sim/analysis/resetActions.js +45 -0
  45. package/dist/sim/analysis/resetActions.js.map +1 -0
  46. package/dist/sim/analysis/resetCycle.d.ts +175 -0
  47. package/dist/sim/analysis/resetCycle.js +1009 -0
  48. package/dist/sim/analysis/resetCycle.js.map +1 -0
  49. package/dist/sim/analysis/resetOptimization.d.ts +198 -0
  50. package/dist/sim/analysis/resetOptimization.js +2187 -0
  51. package/dist/sim/analysis/resetOptimization.js.map +1 -0
  52. package/dist/sim/analysis/sensitivity.d.ts +73 -0
  53. package/dist/sim/analysis/sensitivity.js +160 -0
  54. package/dist/sim/analysis/sensitivity.js.map +1 -0
  55. package/dist/sim/monteCarlo.d.ts +12 -0
  56. package/dist/sim/monteCarlo.js +33 -4
  57. package/dist/sim/monteCarlo.js.map +1 -1
  58. package/dist/sim/observation.d.ts +22 -0
  59. package/dist/sim/observation.js +33 -0
  60. package/dist/sim/observation.js.map +1 -1
  61. package/dist/sim/offline.js +9 -2
  62. package/dist/sim/offline.js.map +1 -1
  63. package/dist/sim/random.d.ts +15 -0
  64. package/dist/sim/random.js +28 -0
  65. package/dist/sim/random.js.map +1 -1
  66. package/dist/sim/session.d.ts +7 -0
  67. package/dist/sim/session.js +13 -0
  68. package/dist/sim/session.js.map +1 -1
  69. package/dist/sim/simulator.js +7 -1
  70. package/dist/sim/simulator.js.map +1 -1
  71. package/dist/sim/step.d.ts +67 -1
  72. package/dist/sim/step.js +100 -18
  73. package/dist/sim/step.js.map +1 -1
  74. package/dist/sim/strategy/opt/freshRun.d.ts +3 -0
  75. package/dist/sim/strategy/opt/freshRun.js +6 -0
  76. package/dist/sim/strategy/opt/freshRun.js.map +1 -0
  77. package/dist/sim/strategy/opt/runner.js +2 -2
  78. package/dist/sim/strategy/opt/runner.js.map +1 -1
  79. package/dist/sim/strategy/planner.d.ts +26 -0
  80. package/dist/sim/strategy/planner.js +30 -0
  81. package/dist/sim/strategy/planner.js.map +1 -1
  82. package/package.json +2 -2
@@ -0,0 +1,2815 @@
1
+ import * as _validateReport_1 from "typia/lib/internal/_validateReport";
2
+ import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSchema";
3
+ import { createHash } from "crypto";
4
+ import typia, { tags } from "typia";
5
+ /**
6
+ * Structural contract for ScenarioV1.
7
+ * Semantic checks stay in validateScenarioV1. This module does not replace them.
8
+ * PR-08 appends analysis DTOs to contractRegistry. PR-09 appends the ETA estimate.
9
+ * PR-10 appends the reset-cycle artifact. PR-12 appends the growth fit.
10
+ * PR-11 appends the reset-policy artifact.
11
+ * PR-13 appends the distribution artifact.
12
+ * PR-14 appends the experiment artifact.
13
+ * The registry does not migrate every existing DTO.
14
+ */
15
+ const CONTRACT_GENERATOR = "idlekit.contract-generator";
16
+ const CONTRACT_GENERATOR_VERSION = 1;
17
+ const JSON_SCHEMA_EXPORT = "typia.json.schema";
18
+ const JSON_SCHEMA_DIALECT = "openapi-3.1";
19
+ const TYPIA_VERSION = "14.0.6";
20
+ const SCENARIO_SCHEMA_ID = "https://idlekit.dev/schemas/scenario.v1.schema.json";
21
+ /**
22
+ * @evidence docs/requirements/active/typed-contract-generation.md#req-tc05-typed-contract-single-source ScenarioV1 is the generated structural contract. The registry starts with that id.
23
+ * @evidenceReview docs/requirements/active/typed-contract-generation.md#req-tc05-typed-contract-single-source #4326433 Re-read the section: the id is idlekit.scenario.v1 and the export is typia.json.schema 3.1. PR-08 appends the analysis artifact id.
24
+ */
25
+ export const typedContractSingleSource = "idlekit.scenario.v1";
26
+ /**
27
+ * @evidence docs/requirements/active/typed-contract-generation.md#req-tc05-semantic-validation-retained The runtime gate stays validateScenarioV1. Generated structure does not claim cross-field or parser checks.
28
+ * @evidenceReview docs/requirements/active/typed-contract-generation.md#req-tc05-semantic-validation-retained #ef40883 Re-read the section: a zero step fails the handwritten gate only, and both runtimes allow an unknown field.
29
+ */
30
+ export const semanticValidationRetained = "validateScenarioV1";
31
+ /**
32
+ * @evidence docs/requirements/active/typed-contract-generation.md#req-tc05-published-validator-transformed The published validator is createValidate of ScenarioV1, not an unresolved generic.
33
+ * @evidenceReview docs/requirements/active/typed-contract-generation.md#req-tc05-published-validator-transformed #fafe1c5 Re-read the section: the call is typia.createValidate of ScenarioV1.
34
+ */
35
+ export const publishedValidatorTransformed = "typia.createValidate<ScenarioV1>";
36
+ const contractRegistry = [
37
+ {
38
+ id: typedContractSingleSource,
39
+ kind: "scenario",
40
+ typeName: "ScenarioV1",
41
+ source: "packages/core/src/scenario/types.ts",
42
+ },
43
+ {
44
+ id: "idlekit.analysis.artifact.v1",
45
+ kind: "analysis-artifact",
46
+ typeName: "AnalysisArtifactV1",
47
+ source: "packages/core/src/sim/analysis/contracts.ts",
48
+ },
49
+ {
50
+ id: "idlekit.eta.estimate.v1",
51
+ kind: "eta-estimate",
52
+ typeName: "EtaEstimateV1",
53
+ source: "packages/core/src/sim/analysis/eta.ts",
54
+ },
55
+ {
56
+ id: "idlekit.reset-cycle.v1",
57
+ kind: "reset-cycle",
58
+ typeName: "ResetCycleArtifactV1",
59
+ source: "packages/core/src/sim/analysis/resetCycle.ts",
60
+ },
61
+ {
62
+ id: "idlekit.growth-fit.v1",
63
+ kind: "growth-fit",
64
+ typeName: "GrowthFitArtifactV1",
65
+ source: "packages/core/src/sim/analysis/growthFit.ts",
66
+ },
67
+ {
68
+ id: "idlekit.reset-policy.v1",
69
+ kind: "reset-policy",
70
+ typeName: "ResetPolicyArtifactV1",
71
+ source: "packages/core/src/sim/analysis/resetOptimization.ts",
72
+ },
73
+ {
74
+ id: "idlekit.distribution.v1",
75
+ kind: "distribution",
76
+ typeName: "DistributionArtifactV1",
77
+ source: "packages/core/src/sim/analysis/distribution.ts",
78
+ },
79
+ {
80
+ id: "idlekit.experiment.v1",
81
+ kind: "experiment",
82
+ typeName: "ExperimentArtifactV1",
83
+ source: "packages/core/src/sim/analysis/experiment.ts",
84
+ },
85
+ ];
86
+ /*
87
+ * The typia calls below run on first use, not at module load. A plugin that imports
88
+ * core source from a bundled CLI process loads this module without the transform.
89
+ */
90
+ let finiteUnitRateValidator;
91
+ export const validateFiniteUnitRate = (input) => (finiteUnitRateValidator ??= (() => {
92
+ const __is = input => "number" === typeof input && (0 <= input && input <= 1);
93
+ let errors;
94
+ let _report;
95
+ return _createStandardSchema_1._createStandardSchema(input => {
96
+ if (false === __is(input)) {
97
+ errors = [];
98
+ _report = _validateReport_1._validateReport(errors);
99
+ ((input, _path, _exceptionable = true) => "number" === typeof input && (0 <= input || _report(true, {
100
+ path: _path + "",
101
+ expected: "number & Minimum<0>",
102
+ value: input
103
+ })) && (input <= 1 || _report(true, {
104
+ path: _path + "",
105
+ expected: "number & Maximum<1>",
106
+ value: input
107
+ })) || _report(true, {
108
+ path: _path + "",
109
+ expected: "(number & Minimum<0> & Maximum<1>)",
110
+ value: input
111
+ }))(input, "$input", true);
112
+ const success = 0 === errors.length;
113
+ return success ? {
114
+ success,
115
+ data: input
116
+ } : {
117
+ success,
118
+ errors,
119
+ data: input
120
+ };
121
+ }
122
+ return {
123
+ success: true,
124
+ data: input
125
+ };
126
+ });
127
+ })())(input);
128
+ let scenarioStructureValidator;
129
+ /**
130
+ * Concrete structural validator. Unresolved typia.validate of a type parameter is not this path.
131
+ */
132
+ export const validateScenarioStructure = (input) => (scenarioStructureValidator ??= (() => {
133
+ const _ip0 = input => "string" === typeof input["id"];
134
+ const _ip1 = input => true;
135
+ const _ip2 = input => undefined === input["draws"] || "number" === typeof input["draws"];
136
+ const _ip3 = input => undefined === input["quantiles"] || Array.isArray(input["quantiles"]) && input["quantiles"].every(elem => "number" === typeof elem);
137
+ const _ip4 = input => undefined === input["enabled"] || "boolean" === typeof input["enabled"];
138
+ const _ve0 = "Readonly<{ schemaVersion: 1; meta?: Readonly<{ id?: string | undefined; title?: string | undefined; description?: string | undefined; tags?: string[] | undefined; }> | undefined; engine?: Readonly<...> | undefined; ... 11 more ...; outputs?: Readonly<...> | undefined; }>";
139
+ const _ve1 = "(Readonly<{ id?: string | undefined; title?: string | undefined; description?: string | undefined; tags?: string[] | undefined; }> | undefined)";
140
+ const _ve2 = "Readonly<{ t?: number | undefined; wallet: Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>; maxMoneyEver?: string | undefined; prestige?: Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined; vars?: unknown; }>";
141
+ const _ve3 = "(Readonly<{ intent?: \"frequent-progression\" | \"scale-fantasy\" | \"strategic-optimization\" | undefined; sessionPattern?: Readonly<{ id: \"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\"; days?: number | undefined; }> | undefined; }> | undefined)";
142
+ const _ve4 = "(Readonly<{ eta?: Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined; prestigeCycle?: Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined; growth?: Readonly<...> | undefined; experience?: Readonly<...> | undefined; }> | undefined)";
143
+ const _ve5 = "(Readonly<{ cohorts?: Readonly<{ baseUsers?: number | undefined; }> | undefined; retention?: Readonly<{ d1?: number | undefined; d7?: number | undefined; d30?: number | undefined; d90?: number | undefined; longTailDailyDecay?: number | undefined; }> | undefined; revenue?: Readonly<...> | undefined; acquisition?: Read... | undefined)";
144
+ const _ve6 = "(Readonly<{ fast?: boolean | undefined; eventLog?: Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined; offline?: Readonly<{ maxSec?: number | undefined; overflowPolicy?: \"clamp\" | ... 1 more ... | undefined; decay?: Readonly<...> | undefined; actions?: OfflineActionPolicy | undef... | undefined)";
145
+ const _ve7 = "(Readonly<{ format?: \"csv\" | \"json\" | \"md\" | undefined; outPath?: string | undefined; report?: Readonly<{ checkpointsSec?: number[] | undefined; includeTrace?: boolean | undefined; traceEverySteps?: number | undefined; includeGrowth?: boolean | undefined; includeUX?: boolean | undefined; }> | undefined; assertions?: ... | undefined)";
146
+ const _vp0 = (input, _path, _exceptionable = true) => "string" === typeof input["id"] || _report(_exceptionable, {
147
+ path: _path + ".id",
148
+ expected: "string",
149
+ value: input["id"]
150
+ });
151
+ const _vp1 = (input, _path, _exceptionable = true) => true;
152
+ const _ve8 = "(Readonly<{ id: \"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\"; days?: number | undefined; }> | undefined)";
153
+ const _ve9 = "(Readonly<{ series?: \"money\" | \"netWorth\" | undefined; draws?: number | undefined; quantiles?: number[] | undefined; }> | undefined)";
154
+ const _vp2 = (input, _path, _exceptionable = true) => undefined === input["draws"] || "number" === typeof input["draws"] || _report(_exceptionable, {
155
+ path: _path + ".draws",
156
+ expected: "(number | undefined)",
157
+ value: input["draws"]
158
+ });
159
+ const _vp3 = (input, _path, _exceptionable = true) => undefined === input["quantiles"] || (Array.isArray(input["quantiles"]) || _report(_exceptionable, {
160
+ path: _path + ".quantiles",
161
+ expected: "(Array<number> | undefined)",
162
+ value: input["quantiles"]
163
+ })) && input["quantiles"].map((elem, _index8) => "number" === typeof elem || _report(_exceptionable, {
164
+ path: _path + ".quantiles[" + _index8 + "]",
165
+ expected: "number",
166
+ value: elem
167
+ })).every(flag => flag) || _report(_exceptionable, {
168
+ path: _path + ".quantiles",
169
+ expected: "(Array<number> | undefined)",
170
+ value: input["quantiles"]
171
+ });
172
+ const _ve10 = "(Readonly<{ d1?: number | undefined; d7?: number | undefined; d30?: number | undefined; d90?: number | undefined; longTailDailyDecay?: number | undefined; }> | undefined)";
173
+ const _ve11 = "(Readonly<{ payerConversion?: number | undefined; arppuDaily?: number | undefined; adArpDau?: number | undefined; platformFeeRate?: number | undefined; grossMarginRate?: number | undefined; progressionRevenueLift?: number | undefined; progressionLogSpan?: number | undefined; }> | undefined)";
174
+ const _ve12 = "(Readonly<{ enabled?: boolean | undefined; draws?: number | undefined; quantiles?: number[] | undefined; seed?: number | undefined; sigma?: Readonly<{ retention?: number | undefined; conversion?: number | undefined; arppu?: number | undefined; ad?: number | undefined; }> | undefined; correlation?: Readonly<...> | und... | undefined)";
175
+ const _vp4 = (input, _path, _exceptionable = true) => undefined === input["enabled"] || "boolean" === typeof input["enabled"] || _report(_exceptionable, {
176
+ path: _path + ".enabled",
177
+ expected: "(boolean | undefined)",
178
+ value: input["enabled"]
179
+ });
180
+ const _ve13 = "(Readonly<{ retention?: number | undefined; conversion?: number | undefined; arppu?: number | undefined; ad?: number | undefined; }> | undefined)";
181
+ const _ve14 = "(Readonly<{ retentionConversion?: number | undefined; retentionArppu?: number | undefined; retentionAd?: number | undefined; conversionArppu?: number | undefined; conversionAd?: number | undefined; arppuAd?: number | undefined; }> | undefined)";
182
+ const _ve15 = "(Readonly<{ maxSec?: number | undefined; overflowPolicy?: \"clamp\" | \"reject\" | undefined; decay?: Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined; actions?: OfflineActionPolicy | undefined; }> | undefined)";
183
+ const _ve16 = "(Readonly<{ mode: \"allow\"; categories: readonly OfflineActionCategory[]; actors?: readonly OfflineActor[] | undefined; }> | Readonly<{ mode: \"legacy-all\"; }> | Readonly<{ mode: \"none\"; }> | undefined)";
184
+ const _ve17 = "(Readonly<{ checkpointsSec?: number[] | undefined; includeTrace?: boolean | undefined; traceEverySteps?: number | undefined; includeGrowth?: boolean | undefined; includeUX?: boolean | undefined; }> | undefined)";
185
+ const _ve18 = "(Readonly<{ mode: \"none\"; }> | Readonly<{ mode: \"legacy-all\"; }> | Readonly<{ mode: \"allow\"; categories: readonly OfflineActionCategory[]; actors?: readonly OfflineActor[] | undefined; }>)";
186
+ const _io0 = input => 1 === input.schemaVersion && (undefined === input.meta || "object" === typeof input.meta && null !== input.meta && false === Array.isArray(input.meta) && _io1(input.meta)) && (undefined === input.engine || "object" === typeof input.engine && null !== input.engine && _io2(input.engine)) && ("object" === typeof input.unit && null !== input.unit && _io3(input.unit)) && ("object" === typeof input.policy && null !== input.policy && _io4(input.policy)) && ("object" === typeof input.model && null !== input.model && _io5(input.model)) && ("object" === typeof input.initial && null !== input.initial && _io6(input.initial)) && ("object" === typeof input.clock && null !== input.clock && _io9(input.clock)) && (undefined === input.strategy || "object" === typeof input.strategy && null !== input.strategy && _io10(input.strategy)) && (undefined === input.design || "object" === typeof input.design && null !== input.design && false === Array.isArray(input.design) && _io11(input.design)) && (undefined === input.constraints || "object" === typeof input.constraints && null !== input.constraints && false === Array.isArray(input.constraints) && _io13(input.constraints)) && (undefined === input.analysis || "object" === typeof input.analysis && null !== input.analysis && false === Array.isArray(input.analysis) && _io14(input.analysis)) && (undefined === input.monetization || "object" === typeof input.monetization && null !== input.monetization && false === Array.isArray(input.monetization) && _io19(input.monetization)) && (undefined === input.sim || "object" === typeof input.sim && null !== input.sim && false === Array.isArray(input.sim) && _io27(input.sim)) && (undefined === input.outputs || "object" === typeof input.outputs && null !== input.outputs && false === Array.isArray(input.outputs) && _io34(input.outputs));
187
+ const _io1 = input => (undefined === input.id || "string" === typeof input.id) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
188
+ const _io10 = input => _ip0(input) && _ip1(input);
189
+ const _io11 = input => (undefined === input.intent || "frequent-progression" === input.intent || "scale-fantasy" === input.intent || "strategic-optimization" === input.intent) && (undefined === input.sessionPattern || "object" === typeof input.sessionPattern && null !== input.sessionPattern && _io12(input.sessionPattern));
190
+ const _io12 = input => ("always-on" === input.id || "offline-heavy" === input.id || "short-bursts" === input.id || "twice-daily" === input.id || "weekend-marathon" === input.id) && (undefined === input.days || "number" === typeof input.days);
191
+ const _io13 = input => (undefined === input.maxActionsPerStep || "number" === typeof input.maxActionsPerStep) && (undefined === input.minPrestigeIntervalSec || "number" === typeof input.minPrestigeIntervalSec);
192
+ const _io14 = input => (undefined === input.eta || "object" === typeof input.eta && null !== input.eta && false === Array.isArray(input.eta) && _io15(input.eta)) && (undefined === input.prestigeCycle || "object" === typeof input.prestigeCycle && null !== input.prestigeCycle && false === Array.isArray(input.prestigeCycle) && _io16(input.prestigeCycle)) && (undefined === input.growth || "object" === typeof input.growth && null !== input.growth && false === Array.isArray(input.growth) && _io17(input.growth)) && (undefined === input.experience || "object" === typeof input.experience && null !== input.experience && false === Array.isArray(input.experience) && _io18(input.experience));
193
+ const _io15 = input => undefined === input.mode || "analytic" === input.mode || "simulate" === input.mode;
194
+ const _io16 = input => (undefined === input.scan || "string" === typeof input.scan) && (undefined === input.stepSec || "number" === typeof input.stepSec) && (undefined === input.cycles || "number" === typeof input.cycles);
195
+ const _io17 = input => undefined === input.windowSec || "number" === typeof input.windowSec;
196
+ const _io18 = input => (undefined === input.series || "money" === input.series || "netWorth" === input.series) && _ip2(input) && _ip3(input);
197
+ const _io19 = input => (undefined === input.cohorts || "object" === typeof input.cohorts && null !== input.cohorts && false === Array.isArray(input.cohorts) && _io20(input.cohorts)) && (undefined === input.retention || "object" === typeof input.retention && null !== input.retention && false === Array.isArray(input.retention) && _io21(input.retention)) && (undefined === input.revenue || "object" === typeof input.revenue && null !== input.revenue && false === Array.isArray(input.revenue) && _io22(input.revenue)) && (undefined === input.acquisition || "object" === typeof input.acquisition && null !== input.acquisition && false === Array.isArray(input.acquisition) && _io23(input.acquisition)) && (undefined === input.uncertainty || "object" === typeof input.uncertainty && null !== input.uncertainty && false === Array.isArray(input.uncertainty) && _io24(input.uncertainty));
198
+ const _io2 = input => "string" === typeof input.name && (undefined === input.version || "string" === typeof input.version);
199
+ const _io20 = input => undefined === input.baseUsers || "number" === typeof input.baseUsers;
200
+ const _io21 = input => (undefined === input.d1 || "number" === typeof input.d1) && (undefined === input.d7 || "number" === typeof input.d7) && (undefined === input.d30 || "number" === typeof input.d30) && (undefined === input.d90 || "number" === typeof input.d90) && (undefined === input.longTailDailyDecay || "number" === typeof input.longTailDailyDecay);
201
+ const _io22 = input => (undefined === input.payerConversion || "number" === typeof input.payerConversion) && (undefined === input.arppuDaily || "number" === typeof input.arppuDaily) && (undefined === input.adArpDau || "number" === typeof input.adArpDau) && (undefined === input.platformFeeRate || "number" === typeof input.platformFeeRate) && (undefined === input.grossMarginRate || "number" === typeof input.grossMarginRate) && (undefined === input.progressionRevenueLift || "number" === typeof input.progressionRevenueLift) && (undefined === input.progressionLogSpan || "number" === typeof input.progressionLogSpan);
202
+ const _io23 = input => undefined === input.cpi || "number" === typeof input.cpi;
203
+ const _io24 = input => _ip4(input) && _ip2(input) && _ip3(input) && (undefined === input.seed || "number" === typeof input.seed) && (undefined === input.sigma || "object" === typeof input.sigma && null !== input.sigma && false === Array.isArray(input.sigma) && _io25(input.sigma)) && (undefined === input.correlation || "object" === typeof input.correlation && null !== input.correlation && false === Array.isArray(input.correlation) && _io26(input.correlation));
204
+ const _io25 = input => (undefined === input.retention || "number" === typeof input.retention) && (undefined === input.conversion || "number" === typeof input.conversion) && (undefined === input.arppu || "number" === typeof input.arppu) && (undefined === input.ad || "number" === typeof input.ad);
205
+ const _io26 = input => (undefined === input.retentionConversion || "number" === typeof input.retentionConversion) && (undefined === input.retentionArppu || "number" === typeof input.retentionArppu) && (undefined === input.retentionAd || "number" === typeof input.retentionAd) && (undefined === input.conversionArppu || "number" === typeof input.conversionArppu) && (undefined === input.conversionAd || "number" === typeof input.conversionAd) && (undefined === input.arppuAd || "number" === typeof input.arppuAd);
206
+ const _io27 = input => (undefined === input.fast || "boolean" === typeof input.fast) && (undefined === input.eventLog || "object" === typeof input.eventLog && null !== input.eventLog && false === Array.isArray(input.eventLog) && _io28(input.eventLog)) && (undefined === input.offline || "object" === typeof input.offline && null !== input.offline && false === Array.isArray(input.offline) && _io29(input.offline));
207
+ const _io28 = input => _ip4(input) && (undefined === input.maxEvents || "number" === typeof input.maxEvents);
208
+ const _io29 = input => (undefined === input.maxSec || "number" === typeof input.maxSec) && (undefined === input.overflowPolicy || "clamp" === input.overflowPolicy || "reject" === input.overflowPolicy) && (undefined === input.decay || "object" === typeof input.decay && null !== input.decay && _io30(input.decay)) && (undefined === input.actions || "object" === typeof input.actions && null !== input.actions && _iu0(input.actions));
209
+ const _io3 = input => "string" === typeof input.code && (undefined === input.symbol || "string" === typeof input.symbol);
210
+ const _io30 = input => ("linear" === input.kind || "none" === input.kind) && (undefined === input.floorRatio || "number" === typeof input.floorRatio);
211
+ const _io31 = input => "legacy-all" === input.mode;
212
+ const _io32 = input => "none" === input.mode;
213
+ const _io33 = input => "allow" === input.mode && (Array.isArray(input.categories) && input.categories.every(elem => "buy" === elem || "custom" === elem || "grant" === elem || "prestige" === elem)) && (undefined === input.actors || Array.isArray(input.actors) && input.actors.every(elem => "automation" === elem || "player" === elem));
214
+ const _io34 = input => (undefined === input.format || "csv" === input.format || "json" === input.format || "md" === input.format) && (undefined === input.outPath || "string" === typeof input.outPath) && (undefined === input.report || "object" === typeof input.report && null !== input.report && false === Array.isArray(input.report) && _io35(input.report)) && (undefined === input.assertions || Array.isArray(input.assertions) && input.assertions.every(elem => "object" === typeof elem && null !== elem && _io36(elem)));
215
+ const _io35 = input => (undefined === input.checkpointsSec || Array.isArray(input.checkpointsSec) && input.checkpointsSec.every(elem => "number" === typeof elem)) && (undefined === input.includeTrace || "boolean" === typeof input.includeTrace) && (undefined === input.traceEverySteps || "number" === typeof input.traceEverySteps) && (undefined === input.includeGrowth || "boolean" === typeof input.includeGrowth) && (undefined === input.includeUX || "boolean" === typeof input.includeUX);
216
+ const _io36 = input => "string" === typeof input.expr && (undefined === input.severity || "error" === input.severity || "warn" === input.severity);
217
+ const _io4 = input => ("accumulate" === input.mode || "drop" === input.mode) && (undefined === input.maxLogGap || "number" === typeof input.maxLogGap);
218
+ const _io5 = input => _ip0(input) && "number" === typeof input.version && _ip1(input);
219
+ const _io6 = input => (undefined === input.t || "number" === typeof input.t) && ("object" === typeof input.wallet && null !== input.wallet && _io7(input.wallet)) && (undefined === input.maxMoneyEver || "string" === typeof input.maxMoneyEver) && (undefined === input.prestige || "object" === typeof input.prestige && null !== input.prestige && false === Array.isArray(input.prestige) && _io8(input.prestige)) && true;
220
+ const _io7 = input => "string" === typeof input.unit && "string" === typeof input.amount && (undefined === input.bucket || "string" === typeof input.bucket);
221
+ const _io8 = input => (undefined === input.count || "number" === typeof input.count) && (undefined === input.points || "string" === typeof input.points) && (undefined === input.multiplier || "string" === typeof input.multiplier);
222
+ const _io9 = input => "number" === typeof input.stepSec && (undefined === input.durationSec || "number" === typeof input.durationSec) && (undefined === input.untilExpr || "string" === typeof input.untilExpr);
223
+ const _iu0 = input => (() => {
224
+ if ("none" === input.mode)
225
+ return _io32(input);
226
+ else if ("legacy-all" === input.mode)
227
+ return _io31(input);
228
+ else if ("allow" === input.mode)
229
+ return _io33(input);
230
+ else
231
+ return false;
232
+ })();
233
+ const _vo0 = (input, _path, _exceptionable = true) => [1 === input.schemaVersion || _report(_exceptionable, {
234
+ path: _path + ".schemaVersion",
235
+ expected: "1",
236
+ value: input.schemaVersion
237
+ }), undefined === input.meta || ("object" === typeof input.meta && null !== input.meta && false === Array.isArray(input.meta) || _report(_exceptionable, {
238
+ path: _path + ".meta",
239
+ expected: _ve1,
240
+ value: input.meta
241
+ })) && _vo1(input.meta, _path + ".meta", true && _exceptionable) || _report(_exceptionable, {
242
+ path: _path + ".meta",
243
+ expected: _ve1,
244
+ value: input.meta
245
+ }), undefined === input.engine || ("object" === typeof input.engine && null !== input.engine || _report(_exceptionable, {
246
+ path: _path + ".engine",
247
+ expected: "(Readonly<{ name: string; version?: string | undefined; }> | undefined)",
248
+ value: input.engine
249
+ })) && _vo2(input.engine, _path + ".engine", true && _exceptionable) || _report(_exceptionable, {
250
+ path: _path + ".engine",
251
+ expected: "(Readonly<{ name: string; version?: string | undefined; }> | undefined)",
252
+ value: input.engine
253
+ }), ("object" === typeof input.unit && null !== input.unit || _report(_exceptionable, {
254
+ path: _path + ".unit",
255
+ expected: "Readonly<{ code: string; symbol?: string | undefined; }>",
256
+ value: input.unit
257
+ })) && _vo3(input.unit, _path + ".unit", true && _exceptionable) || _report(_exceptionable, {
258
+ path: _path + ".unit",
259
+ expected: "Readonly<{ code: string; symbol?: string | undefined; }>",
260
+ value: input.unit
261
+ }), ("object" === typeof input.policy && null !== input.policy || _report(_exceptionable, {
262
+ path: _path + ".policy",
263
+ expected: "Readonly<{ mode: \"accumulate\" | \"drop\"; maxLogGap?: number | undefined; }>",
264
+ value: input.policy
265
+ })) && _vo4(input.policy, _path + ".policy", true && _exceptionable) || _report(_exceptionable, {
266
+ path: _path + ".policy",
267
+ expected: "Readonly<{ mode: \"accumulate\" | \"drop\"; maxLogGap?: number | undefined; }>",
268
+ value: input.policy
269
+ }), ("object" === typeof input.model && null !== input.model || _report(_exceptionable, {
270
+ path: _path + ".model",
271
+ expected: "Readonly<{ id: string; version: number; params?: unknown; }>",
272
+ value: input.model
273
+ })) && _vo5(input.model, _path + ".model", true && _exceptionable) || _report(_exceptionable, {
274
+ path: _path + ".model",
275
+ expected: "Readonly<{ id: string; version: number; params?: unknown; }>",
276
+ value: input.model
277
+ }), ("object" === typeof input.initial && null !== input.initial || _report(_exceptionable, {
278
+ path: _path + ".initial",
279
+ expected: _ve2,
280
+ value: input.initial
281
+ })) && _vo6(input.initial, _path + ".initial", true && _exceptionable) || _report(_exceptionable, {
282
+ path: _path + ".initial",
283
+ expected: _ve2,
284
+ value: input.initial
285
+ }), ("object" === typeof input.clock && null !== input.clock || _report(_exceptionable, {
286
+ path: _path + ".clock",
287
+ expected: "Readonly<{ stepSec: number; durationSec?: number | undefined; untilExpr?: string | undefined; }>",
288
+ value: input.clock
289
+ })) && _vo9(input.clock, _path + ".clock", true && _exceptionable) || _report(_exceptionable, {
290
+ path: _path + ".clock",
291
+ expected: "Readonly<{ stepSec: number; durationSec?: number | undefined; untilExpr?: string | undefined; }>",
292
+ value: input.clock
293
+ }), undefined === input.strategy || ("object" === typeof input.strategy && null !== input.strategy || _report(_exceptionable, {
294
+ path: _path + ".strategy",
295
+ expected: "(Readonly<{ id: string; params?: unknown; }> | undefined)",
296
+ value: input.strategy
297
+ })) && _vo10(input.strategy, _path + ".strategy", true && _exceptionable) || _report(_exceptionable, {
298
+ path: _path + ".strategy",
299
+ expected: "(Readonly<{ id: string; params?: unknown; }> | undefined)",
300
+ value: input.strategy
301
+ }), undefined === input.design || ("object" === typeof input.design && null !== input.design && false === Array.isArray(input.design) || _report(_exceptionable, {
302
+ path: _path + ".design",
303
+ expected: _ve3,
304
+ value: input.design
305
+ })) && _vo11(input.design, _path + ".design", true && _exceptionable) || _report(_exceptionable, {
306
+ path: _path + ".design",
307
+ expected: _ve3,
308
+ value: input.design
309
+ }), undefined === input.constraints || ("object" === typeof input.constraints && null !== input.constraints && false === Array.isArray(input.constraints) || _report(_exceptionable, {
310
+ path: _path + ".constraints",
311
+ expected: "(Readonly<{ maxActionsPerStep?: number | undefined; minPrestigeIntervalSec?: number | undefined; }> | undefined)",
312
+ value: input.constraints
313
+ })) && _vo13(input.constraints, _path + ".constraints", true && _exceptionable) || _report(_exceptionable, {
314
+ path: _path + ".constraints",
315
+ expected: "(Readonly<{ maxActionsPerStep?: number | undefined; minPrestigeIntervalSec?: number | undefined; }> | undefined)",
316
+ value: input.constraints
317
+ }), undefined === input.analysis || ("object" === typeof input.analysis && null !== input.analysis && false === Array.isArray(input.analysis) || _report(_exceptionable, {
318
+ path: _path + ".analysis",
319
+ expected: _ve4,
320
+ value: input.analysis
321
+ })) && _vo14(input.analysis, _path + ".analysis", true && _exceptionable) || _report(_exceptionable, {
322
+ path: _path + ".analysis",
323
+ expected: _ve4,
324
+ value: input.analysis
325
+ }), undefined === input.monetization || ("object" === typeof input.monetization && null !== input.monetization && false === Array.isArray(input.monetization) || _report(_exceptionable, {
326
+ path: _path + ".monetization",
327
+ expected: _ve5,
328
+ value: input.monetization
329
+ })) && _vo19(input.monetization, _path + ".monetization", true && _exceptionable) || _report(_exceptionable, {
330
+ path: _path + ".monetization",
331
+ expected: _ve5,
332
+ value: input.monetization
333
+ }), undefined === input.sim || ("object" === typeof input.sim && null !== input.sim && false === Array.isArray(input.sim) || _report(_exceptionable, {
334
+ path: _path + ".sim",
335
+ expected: _ve6,
336
+ value: input.sim
337
+ })) && _vo27(input.sim, _path + ".sim", true && _exceptionable) || _report(_exceptionable, {
338
+ path: _path + ".sim",
339
+ expected: _ve6,
340
+ value: input.sim
341
+ }), undefined === input.outputs || ("object" === typeof input.outputs && null !== input.outputs && false === Array.isArray(input.outputs) || _report(_exceptionable, {
342
+ path: _path + ".outputs",
343
+ expected: _ve7,
344
+ value: input.outputs
345
+ })) && _vo34(input.outputs, _path + ".outputs", true && _exceptionable) || _report(_exceptionable, {
346
+ path: _path + ".outputs",
347
+ expected: _ve7,
348
+ value: input.outputs
349
+ })].every(flag => flag);
350
+ const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.id || "string" === typeof input.id || _report(_exceptionable, {
351
+ path: _path + ".id",
352
+ expected: "(string | undefined)",
353
+ value: input.id
354
+ }), undefined === input.title || "string" === typeof input.title || _report(_exceptionable, {
355
+ path: _path + ".title",
356
+ expected: "(string | undefined)",
357
+ value: input.title
358
+ }), undefined === input.description || "string" === typeof input.description || _report(_exceptionable, {
359
+ path: _path + ".description",
360
+ expected: "(string | undefined)",
361
+ value: input.description
362
+ }), undefined === input.tags || (Array.isArray(input.tags) || _report(_exceptionable, {
363
+ path: _path + ".tags",
364
+ expected: "(Array<string> | undefined)",
365
+ value: input.tags
366
+ })) && input.tags.map((elem, _index7) => "string" === typeof elem || _report(_exceptionable, {
367
+ path: _path + ".tags[" + _index7 + "]",
368
+ expected: "string",
369
+ value: elem
370
+ })).every(flag => flag) || _report(_exceptionable, {
371
+ path: _path + ".tags",
372
+ expected: "(Array<string> | undefined)",
373
+ value: input.tags
374
+ })].every(flag => flag);
375
+ const _vo10 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
376
+ const _vo11 = (input, _path, _exceptionable = true) => [undefined === input.intent || "frequent-progression" === input.intent || "scale-fantasy" === input.intent || "strategic-optimization" === input.intent || _report(_exceptionable, {
377
+ path: _path + ".intent",
378
+ expected: "(\"frequent-progression\" | \"scale-fantasy\" | \"strategic-optimization\" | undefined)",
379
+ value: input.intent
380
+ }), undefined === input.sessionPattern || ("object" === typeof input.sessionPattern && null !== input.sessionPattern || _report(_exceptionable, {
381
+ path: _path + ".sessionPattern",
382
+ expected: _ve8,
383
+ value: input.sessionPattern
384
+ })) && _vo12(input.sessionPattern, _path + ".sessionPattern", true && _exceptionable) || _report(_exceptionable, {
385
+ path: _path + ".sessionPattern",
386
+ expected: _ve8,
387
+ value: input.sessionPattern
388
+ })].every(flag => flag);
389
+ const _vo12 = (input, _path, _exceptionable = true) => ["always-on" === input.id || "offline-heavy" === input.id || "short-bursts" === input.id || "twice-daily" === input.id || "weekend-marathon" === input.id || _report(_exceptionable, {
390
+ path: _path + ".id",
391
+ expected: "(\"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\")",
392
+ value: input.id
393
+ }), undefined === input.days || "number" === typeof input.days || _report(_exceptionable, {
394
+ path: _path + ".days",
395
+ expected: "(number | undefined)",
396
+ value: input.days
397
+ })].every(flag => flag);
398
+ const _vo13 = (input, _path, _exceptionable = true) => [undefined === input.maxActionsPerStep || "number" === typeof input.maxActionsPerStep || _report(_exceptionable, {
399
+ path: _path + ".maxActionsPerStep",
400
+ expected: "(number | undefined)",
401
+ value: input.maxActionsPerStep
402
+ }), undefined === input.minPrestigeIntervalSec || "number" === typeof input.minPrestigeIntervalSec || _report(_exceptionable, {
403
+ path: _path + ".minPrestigeIntervalSec",
404
+ expected: "(number | undefined)",
405
+ value: input.minPrestigeIntervalSec
406
+ })].every(flag => flag);
407
+ const _vo14 = (input, _path, _exceptionable = true) => [undefined === input.eta || ("object" === typeof input.eta && null !== input.eta && false === Array.isArray(input.eta) || _report(_exceptionable, {
408
+ path: _path + ".eta",
409
+ expected: "(Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined)",
410
+ value: input.eta
411
+ })) && _vo15(input.eta, _path + ".eta", true && _exceptionable) || _report(_exceptionable, {
412
+ path: _path + ".eta",
413
+ expected: "(Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined)",
414
+ value: input.eta
415
+ }), undefined === input.prestigeCycle || ("object" === typeof input.prestigeCycle && null !== input.prestigeCycle && false === Array.isArray(input.prestigeCycle) || _report(_exceptionable, {
416
+ path: _path + ".prestigeCycle",
417
+ expected: "(Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined)",
418
+ value: input.prestigeCycle
419
+ })) && _vo16(input.prestigeCycle, _path + ".prestigeCycle", true && _exceptionable) || _report(_exceptionable, {
420
+ path: _path + ".prestigeCycle",
421
+ expected: "(Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined)",
422
+ value: input.prestigeCycle
423
+ }), undefined === input.growth || ("object" === typeof input.growth && null !== input.growth && false === Array.isArray(input.growth) || _report(_exceptionable, {
424
+ path: _path + ".growth",
425
+ expected: "(Readonly<{ windowSec?: number | undefined; }> | undefined)",
426
+ value: input.growth
427
+ })) && _vo17(input.growth, _path + ".growth", true && _exceptionable) || _report(_exceptionable, {
428
+ path: _path + ".growth",
429
+ expected: "(Readonly<{ windowSec?: number | undefined; }> | undefined)",
430
+ value: input.growth
431
+ }), undefined === input.experience || ("object" === typeof input.experience && null !== input.experience && false === Array.isArray(input.experience) || _report(_exceptionable, {
432
+ path: _path + ".experience",
433
+ expected: _ve9,
434
+ value: input.experience
435
+ })) && _vo18(input.experience, _path + ".experience", true && _exceptionable) || _report(_exceptionable, {
436
+ path: _path + ".experience",
437
+ expected: _ve9,
438
+ value: input.experience
439
+ })].every(flag => flag);
440
+ const _vo15 = (input, _path, _exceptionable = true) => [undefined === input.mode || "analytic" === input.mode || "simulate" === input.mode || _report(_exceptionable, {
441
+ path: _path + ".mode",
442
+ expected: "(\"analytic\" | \"simulate\" | undefined)",
443
+ value: input.mode
444
+ })].every(flag => flag);
445
+ const _vo16 = (input, _path, _exceptionable = true) => [undefined === input.scan || "string" === typeof input.scan || _report(_exceptionable, {
446
+ path: _path + ".scan",
447
+ expected: "(string | undefined)",
448
+ value: input.scan
449
+ }), undefined === input.stepSec || "number" === typeof input.stepSec || _report(_exceptionable, {
450
+ path: _path + ".stepSec",
451
+ expected: "(number | undefined)",
452
+ value: input.stepSec
453
+ }), undefined === input.cycles || "number" === typeof input.cycles || _report(_exceptionable, {
454
+ path: _path + ".cycles",
455
+ expected: "(number | undefined)",
456
+ value: input.cycles
457
+ })].every(flag => flag);
458
+ const _vo17 = (input, _path, _exceptionable = true) => [undefined === input.windowSec || "number" === typeof input.windowSec || _report(_exceptionable, {
459
+ path: _path + ".windowSec",
460
+ expected: "(number | undefined)",
461
+ value: input.windowSec
462
+ })].every(flag => flag);
463
+ const _vo18 = (input, _path, _exceptionable = true) => [undefined === input.series || "money" === input.series || "netWorth" === input.series || _report(_exceptionable, {
464
+ path: _path + ".series",
465
+ expected: "(\"money\" | \"netWorth\" | undefined)",
466
+ value: input.series
467
+ }), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable)].every(flag => flag);
468
+ const _vo19 = (input, _path, _exceptionable = true) => [undefined === input.cohorts || ("object" === typeof input.cohorts && null !== input.cohorts && false === Array.isArray(input.cohorts) || _report(_exceptionable, {
469
+ path: _path + ".cohorts",
470
+ expected: "(Readonly<{ baseUsers?: number | undefined; }> | undefined)",
471
+ value: input.cohorts
472
+ })) && _vo20(input.cohorts, _path + ".cohorts", true && _exceptionable) || _report(_exceptionable, {
473
+ path: _path + ".cohorts",
474
+ expected: "(Readonly<{ baseUsers?: number | undefined; }> | undefined)",
475
+ value: input.cohorts
476
+ }), undefined === input.retention || ("object" === typeof input.retention && null !== input.retention && false === Array.isArray(input.retention) || _report(_exceptionable, {
477
+ path: _path + ".retention",
478
+ expected: _ve10,
479
+ value: input.retention
480
+ })) && _vo21(input.retention, _path + ".retention", true && _exceptionable) || _report(_exceptionable, {
481
+ path: _path + ".retention",
482
+ expected: _ve10,
483
+ value: input.retention
484
+ }), undefined === input.revenue || ("object" === typeof input.revenue && null !== input.revenue && false === Array.isArray(input.revenue) || _report(_exceptionable, {
485
+ path: _path + ".revenue",
486
+ expected: _ve11,
487
+ value: input.revenue
488
+ })) && _vo22(input.revenue, _path + ".revenue", true && _exceptionable) || _report(_exceptionable, {
489
+ path: _path + ".revenue",
490
+ expected: _ve11,
491
+ value: input.revenue
492
+ }), undefined === input.acquisition || ("object" === typeof input.acquisition && null !== input.acquisition && false === Array.isArray(input.acquisition) || _report(_exceptionable, {
493
+ path: _path + ".acquisition",
494
+ expected: "(Readonly<{ cpi?: number | undefined; }> | undefined)",
495
+ value: input.acquisition
496
+ })) && _vo23(input.acquisition, _path + ".acquisition", true && _exceptionable) || _report(_exceptionable, {
497
+ path: _path + ".acquisition",
498
+ expected: "(Readonly<{ cpi?: number | undefined; }> | undefined)",
499
+ value: input.acquisition
500
+ }), undefined === input.uncertainty || ("object" === typeof input.uncertainty && null !== input.uncertainty && false === Array.isArray(input.uncertainty) || _report(_exceptionable, {
501
+ path: _path + ".uncertainty",
502
+ expected: _ve12,
503
+ value: input.uncertainty
504
+ })) && _vo24(input.uncertainty, _path + ".uncertainty", true && _exceptionable) || _report(_exceptionable, {
505
+ path: _path + ".uncertainty",
506
+ expected: _ve12,
507
+ value: input.uncertainty
508
+ })].every(flag => flag);
509
+ const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
510
+ path: _path + ".name",
511
+ expected: "string",
512
+ value: input.name
513
+ }), undefined === input.version || "string" === typeof input.version || _report(_exceptionable, {
514
+ path: _path + ".version",
515
+ expected: "(string | undefined)",
516
+ value: input.version
517
+ })].every(flag => flag);
518
+ const _vo20 = (input, _path, _exceptionable = true) => [undefined === input.baseUsers || "number" === typeof input.baseUsers || _report(_exceptionable, {
519
+ path: _path + ".baseUsers",
520
+ expected: "(number | undefined)",
521
+ value: input.baseUsers
522
+ })].every(flag => flag);
523
+ const _vo21 = (input, _path, _exceptionable = true) => [undefined === input.d1 || "number" === typeof input.d1 || _report(_exceptionable, {
524
+ path: _path + ".d1",
525
+ expected: "(number | undefined)",
526
+ value: input.d1
527
+ }), undefined === input.d7 || "number" === typeof input.d7 || _report(_exceptionable, {
528
+ path: _path + ".d7",
529
+ expected: "(number | undefined)",
530
+ value: input.d7
531
+ }), undefined === input.d30 || "number" === typeof input.d30 || _report(_exceptionable, {
532
+ path: _path + ".d30",
533
+ expected: "(number | undefined)",
534
+ value: input.d30
535
+ }), undefined === input.d90 || "number" === typeof input.d90 || _report(_exceptionable, {
536
+ path: _path + ".d90",
537
+ expected: "(number | undefined)",
538
+ value: input.d90
539
+ }), undefined === input.longTailDailyDecay || "number" === typeof input.longTailDailyDecay || _report(_exceptionable, {
540
+ path: _path + ".longTailDailyDecay",
541
+ expected: "(number | undefined)",
542
+ value: input.longTailDailyDecay
543
+ })].every(flag => flag);
544
+ const _vo22 = (input, _path, _exceptionable = true) => [undefined === input.payerConversion || "number" === typeof input.payerConversion || _report(_exceptionable, {
545
+ path: _path + ".payerConversion",
546
+ expected: "(number | undefined)",
547
+ value: input.payerConversion
548
+ }), undefined === input.arppuDaily || "number" === typeof input.arppuDaily || _report(_exceptionable, {
549
+ path: _path + ".arppuDaily",
550
+ expected: "(number | undefined)",
551
+ value: input.arppuDaily
552
+ }), undefined === input.adArpDau || "number" === typeof input.adArpDau || _report(_exceptionable, {
553
+ path: _path + ".adArpDau",
554
+ expected: "(number | undefined)",
555
+ value: input.adArpDau
556
+ }), undefined === input.platformFeeRate || "number" === typeof input.platformFeeRate || _report(_exceptionable, {
557
+ path: _path + ".platformFeeRate",
558
+ expected: "(number | undefined)",
559
+ value: input.platformFeeRate
560
+ }), undefined === input.grossMarginRate || "number" === typeof input.grossMarginRate || _report(_exceptionable, {
561
+ path: _path + ".grossMarginRate",
562
+ expected: "(number | undefined)",
563
+ value: input.grossMarginRate
564
+ }), undefined === input.progressionRevenueLift || "number" === typeof input.progressionRevenueLift || _report(_exceptionable, {
565
+ path: _path + ".progressionRevenueLift",
566
+ expected: "(number | undefined)",
567
+ value: input.progressionRevenueLift
568
+ }), undefined === input.progressionLogSpan || "number" === typeof input.progressionLogSpan || _report(_exceptionable, {
569
+ path: _path + ".progressionLogSpan",
570
+ expected: "(number | undefined)",
571
+ value: input.progressionLogSpan
572
+ })].every(flag => flag);
573
+ const _vo23 = (input, _path, _exceptionable = true) => [undefined === input.cpi || "number" === typeof input.cpi || _report(_exceptionable, {
574
+ path: _path + ".cpi",
575
+ expected: "(number | undefined)",
576
+ value: input.cpi
577
+ })].every(flag => flag);
578
+ const _vo24 = (input, _path, _exceptionable = true) => [_vp4(input, _path, true && _exceptionable), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), undefined === input.seed || "number" === typeof input.seed || _report(_exceptionable, {
579
+ path: _path + ".seed",
580
+ expected: "(number | undefined)",
581
+ value: input.seed
582
+ }), undefined === input.sigma || ("object" === typeof input.sigma && null !== input.sigma && false === Array.isArray(input.sigma) || _report(_exceptionable, {
583
+ path: _path + ".sigma",
584
+ expected: _ve13,
585
+ value: input.sigma
586
+ })) && _vo25(input.sigma, _path + ".sigma", true && _exceptionable) || _report(_exceptionable, {
587
+ path: _path + ".sigma",
588
+ expected: _ve13,
589
+ value: input.sigma
590
+ }), undefined === input.correlation || ("object" === typeof input.correlation && null !== input.correlation && false === Array.isArray(input.correlation) || _report(_exceptionable, {
591
+ path: _path + ".correlation",
592
+ expected: _ve14,
593
+ value: input.correlation
594
+ })) && _vo26(input.correlation, _path + ".correlation", true && _exceptionable) || _report(_exceptionable, {
595
+ path: _path + ".correlation",
596
+ expected: _ve14,
597
+ value: input.correlation
598
+ })].every(flag => flag);
599
+ const _vo25 = (input, _path, _exceptionable = true) => [undefined === input.retention || "number" === typeof input.retention || _report(_exceptionable, {
600
+ path: _path + ".retention",
601
+ expected: "(number | undefined)",
602
+ value: input.retention
603
+ }), undefined === input.conversion || "number" === typeof input.conversion || _report(_exceptionable, {
604
+ path: _path + ".conversion",
605
+ expected: "(number | undefined)",
606
+ value: input.conversion
607
+ }), undefined === input.arppu || "number" === typeof input.arppu || _report(_exceptionable, {
608
+ path: _path + ".arppu",
609
+ expected: "(number | undefined)",
610
+ value: input.arppu
611
+ }), undefined === input.ad || "number" === typeof input.ad || _report(_exceptionable, {
612
+ path: _path + ".ad",
613
+ expected: "(number | undefined)",
614
+ value: input.ad
615
+ })].every(flag => flag);
616
+ const _vo26 = (input, _path, _exceptionable = true) => [undefined === input.retentionConversion || "number" === typeof input.retentionConversion || _report(_exceptionable, {
617
+ path: _path + ".retentionConversion",
618
+ expected: "(number | undefined)",
619
+ value: input.retentionConversion
620
+ }), undefined === input.retentionArppu || "number" === typeof input.retentionArppu || _report(_exceptionable, {
621
+ path: _path + ".retentionArppu",
622
+ expected: "(number | undefined)",
623
+ value: input.retentionArppu
624
+ }), undefined === input.retentionAd || "number" === typeof input.retentionAd || _report(_exceptionable, {
625
+ path: _path + ".retentionAd",
626
+ expected: "(number | undefined)",
627
+ value: input.retentionAd
628
+ }), undefined === input.conversionArppu || "number" === typeof input.conversionArppu || _report(_exceptionable, {
629
+ path: _path + ".conversionArppu",
630
+ expected: "(number | undefined)",
631
+ value: input.conversionArppu
632
+ }), undefined === input.conversionAd || "number" === typeof input.conversionAd || _report(_exceptionable, {
633
+ path: _path + ".conversionAd",
634
+ expected: "(number | undefined)",
635
+ value: input.conversionAd
636
+ }), undefined === input.arppuAd || "number" === typeof input.arppuAd || _report(_exceptionable, {
637
+ path: _path + ".arppuAd",
638
+ expected: "(number | undefined)",
639
+ value: input.arppuAd
640
+ })].every(flag => flag);
641
+ const _vo27 = (input, _path, _exceptionable = true) => [undefined === input.fast || "boolean" === typeof input.fast || _report(_exceptionable, {
642
+ path: _path + ".fast",
643
+ expected: "(boolean | undefined)",
644
+ value: input.fast
645
+ }), undefined === input.eventLog || ("object" === typeof input.eventLog && null !== input.eventLog && false === Array.isArray(input.eventLog) || _report(_exceptionable, {
646
+ path: _path + ".eventLog",
647
+ expected: "(Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined)",
648
+ value: input.eventLog
649
+ })) && _vo28(input.eventLog, _path + ".eventLog", true && _exceptionable) || _report(_exceptionable, {
650
+ path: _path + ".eventLog",
651
+ expected: "(Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined)",
652
+ value: input.eventLog
653
+ }), undefined === input.offline || ("object" === typeof input.offline && null !== input.offline && false === Array.isArray(input.offline) || _report(_exceptionable, {
654
+ path: _path + ".offline",
655
+ expected: _ve15,
656
+ value: input.offline
657
+ })) && _vo29(input.offline, _path + ".offline", true && _exceptionable) || _report(_exceptionable, {
658
+ path: _path + ".offline",
659
+ expected: _ve15,
660
+ value: input.offline
661
+ })].every(flag => flag);
662
+ const _vo28 = (input, _path, _exceptionable = true) => [_vp4(input, _path, true && _exceptionable), undefined === input.maxEvents || "number" === typeof input.maxEvents || _report(_exceptionable, {
663
+ path: _path + ".maxEvents",
664
+ expected: "(number | undefined)",
665
+ value: input.maxEvents
666
+ })].every(flag => flag);
667
+ const _vo29 = (input, _path, _exceptionable = true) => [undefined === input.maxSec || "number" === typeof input.maxSec || _report(_exceptionable, {
668
+ path: _path + ".maxSec",
669
+ expected: "(number | undefined)",
670
+ value: input.maxSec
671
+ }), undefined === input.overflowPolicy || "clamp" === input.overflowPolicy || "reject" === input.overflowPolicy || _report(_exceptionable, {
672
+ path: _path + ".overflowPolicy",
673
+ expected: "(\"clamp\" | \"reject\" | undefined)",
674
+ value: input.overflowPolicy
675
+ }), undefined === input.decay || ("object" === typeof input.decay && null !== input.decay || _report(_exceptionable, {
676
+ path: _path + ".decay",
677
+ expected: "(Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined)",
678
+ value: input.decay
679
+ })) && _vo30(input.decay, _path + ".decay", true && _exceptionable) || _report(_exceptionable, {
680
+ path: _path + ".decay",
681
+ expected: "(Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined)",
682
+ value: input.decay
683
+ }), undefined === input.actions || ("object" === typeof input.actions && null !== input.actions || _report(_exceptionable, {
684
+ path: _path + ".actions",
685
+ expected: _ve16,
686
+ value: input.actions
687
+ })) && _vu0(input.actions, _path + ".actions", true && _exceptionable) || _report(_exceptionable, {
688
+ path: _path + ".actions",
689
+ expected: _ve16,
690
+ value: input.actions
691
+ })].every(flag => flag);
692
+ const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.code || _report(_exceptionable, {
693
+ path: _path + ".code",
694
+ expected: "string",
695
+ value: input.code
696
+ }), undefined === input.symbol || "string" === typeof input.symbol || _report(_exceptionable, {
697
+ path: _path + ".symbol",
698
+ expected: "(string | undefined)",
699
+ value: input.symbol
700
+ })].every(flag => flag);
701
+ const _vo30 = (input, _path, _exceptionable = true) => ["linear" === input.kind || "none" === input.kind || _report(_exceptionable, {
702
+ path: _path + ".kind",
703
+ expected: "(\"linear\" | \"none\")",
704
+ value: input.kind
705
+ }), undefined === input.floorRatio || "number" === typeof input.floorRatio || _report(_exceptionable, {
706
+ path: _path + ".floorRatio",
707
+ expected: "(number | undefined)",
708
+ value: input.floorRatio
709
+ })].every(flag => flag);
710
+ const _vo31 = (input, _path, _exceptionable = true) => ["legacy-all" === input.mode || _report(_exceptionable, {
711
+ path: _path + ".mode",
712
+ expected: "\"legacy-all\"",
713
+ value: input.mode
714
+ })].every(flag => flag);
715
+ const _vo32 = (input, _path, _exceptionable = true) => ["none" === input.mode || _report(_exceptionable, {
716
+ path: _path + ".mode",
717
+ expected: "\"none\"",
718
+ value: input.mode
719
+ })].every(flag => flag);
720
+ const _vo33 = (input, _path, _exceptionable = true) => ["allow" === input.mode || _report(_exceptionable, {
721
+ path: _path + ".mode",
722
+ expected: "\"allow\"",
723
+ value: input.mode
724
+ }), (Array.isArray(input.categories) || _report(_exceptionable, {
725
+ path: _path + ".categories",
726
+ expected: "ReadonlyArray<OfflineActionCategory>",
727
+ value: input.categories
728
+ })) && input.categories.map((elem, _index9) => "buy" === elem || "custom" === elem || "grant" === elem || "prestige" === elem || _report(_exceptionable, {
729
+ path: _path + ".categories[" + _index9 + "]",
730
+ expected: "(\"buy\" | \"custom\" | \"grant\" | \"prestige\")",
731
+ value: elem
732
+ })).every(flag => flag) || _report(_exceptionable, {
733
+ path: _path + ".categories",
734
+ expected: "ReadonlyArray<OfflineActionCategory>",
735
+ value: input.categories
736
+ }), undefined === input.actors || (Array.isArray(input.actors) || _report(_exceptionable, {
737
+ path: _path + ".actors",
738
+ expected: "(ReadonlyArray<OfflineActor> | undefined)",
739
+ value: input.actors
740
+ })) && input.actors.map((elem, _index10) => "automation" === elem || "player" === elem || _report(_exceptionable, {
741
+ path: _path + ".actors[" + _index10 + "]",
742
+ expected: "(\"automation\" | \"player\")",
743
+ value: elem
744
+ })).every(flag => flag) || _report(_exceptionable, {
745
+ path: _path + ".actors",
746
+ expected: "(ReadonlyArray<OfflineActor> | undefined)",
747
+ value: input.actors
748
+ })].every(flag => flag);
749
+ const _vo34 = (input, _path, _exceptionable = true) => [undefined === input.format || "csv" === input.format || "json" === input.format || "md" === input.format || _report(_exceptionable, {
750
+ path: _path + ".format",
751
+ expected: "(\"csv\" | \"json\" | \"md\" | undefined)",
752
+ value: input.format
753
+ }), undefined === input.outPath || "string" === typeof input.outPath || _report(_exceptionable, {
754
+ path: _path + ".outPath",
755
+ expected: "(string | undefined)",
756
+ value: input.outPath
757
+ }), undefined === input.report || ("object" === typeof input.report && null !== input.report && false === Array.isArray(input.report) || _report(_exceptionable, {
758
+ path: _path + ".report",
759
+ expected: _ve17,
760
+ value: input.report
761
+ })) && _vo35(input.report, _path + ".report", true && _exceptionable) || _report(_exceptionable, {
762
+ path: _path + ".report",
763
+ expected: _ve17,
764
+ value: input.report
765
+ }), undefined === input.assertions || (Array.isArray(input.assertions) || _report(_exceptionable, {
766
+ path: _path + ".assertions",
767
+ expected: "(readonly { expr: string; severity?: \"error\" | \"warn\" | undefined; }[] | undefined)",
768
+ value: input.assertions
769
+ })) && input.assertions.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
770
+ path: _path + ".assertions[" + _index11 + "]",
771
+ expected: "{ expr: string; severity?: \"error\" | \"warn\" | undefined; }",
772
+ value: elem
773
+ })) && _vo36(elem, _path + ".assertions[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
774
+ path: _path + ".assertions[" + _index11 + "]",
775
+ expected: "{ expr: string; severity?: \"error\" | \"warn\" | undefined; }",
776
+ value: elem
777
+ })).every(flag => flag) || _report(_exceptionable, {
778
+ path: _path + ".assertions",
779
+ expected: "(readonly { expr: string; severity?: \"error\" | \"warn\" | undefined; }[] | undefined)",
780
+ value: input.assertions
781
+ })].every(flag => flag);
782
+ const _vo35 = (input, _path, _exceptionable = true) => [undefined === input.checkpointsSec || (Array.isArray(input.checkpointsSec) || _report(_exceptionable, {
783
+ path: _path + ".checkpointsSec",
784
+ expected: "(Array<number> | undefined)",
785
+ value: input.checkpointsSec
786
+ })) && input.checkpointsSec.map((elem, _index12) => "number" === typeof elem || _report(_exceptionable, {
787
+ path: _path + ".checkpointsSec[" + _index12 + "]",
788
+ expected: "number",
789
+ value: elem
790
+ })).every(flag => flag) || _report(_exceptionable, {
791
+ path: _path + ".checkpointsSec",
792
+ expected: "(Array<number> | undefined)",
793
+ value: input.checkpointsSec
794
+ }), undefined === input.includeTrace || "boolean" === typeof input.includeTrace || _report(_exceptionable, {
795
+ path: _path + ".includeTrace",
796
+ expected: "(boolean | undefined)",
797
+ value: input.includeTrace
798
+ }), undefined === input.traceEverySteps || "number" === typeof input.traceEverySteps || _report(_exceptionable, {
799
+ path: _path + ".traceEverySteps",
800
+ expected: "(number | undefined)",
801
+ value: input.traceEverySteps
802
+ }), undefined === input.includeGrowth || "boolean" === typeof input.includeGrowth || _report(_exceptionable, {
803
+ path: _path + ".includeGrowth",
804
+ expected: "(boolean | undefined)",
805
+ value: input.includeGrowth
806
+ }), undefined === input.includeUX || "boolean" === typeof input.includeUX || _report(_exceptionable, {
807
+ path: _path + ".includeUX",
808
+ expected: "(boolean | undefined)",
809
+ value: input.includeUX
810
+ })].every(flag => flag);
811
+ const _vo36 = (input, _path, _exceptionable = true) => ["string" === typeof input.expr || _report(_exceptionable, {
812
+ path: _path + ".expr",
813
+ expected: "string",
814
+ value: input.expr
815
+ }), undefined === input.severity || "error" === input.severity || "warn" === input.severity || _report(_exceptionable, {
816
+ path: _path + ".severity",
817
+ expected: "(\"error\" | \"warn\" | undefined)",
818
+ value: input.severity
819
+ })].every(flag => flag);
820
+ const _vo4 = (input, _path, _exceptionable = true) => ["accumulate" === input.mode || "drop" === input.mode || _report(_exceptionable, {
821
+ path: _path + ".mode",
822
+ expected: "(\"accumulate\" | \"drop\")",
823
+ value: input.mode
824
+ }), undefined === input.maxLogGap || "number" === typeof input.maxLogGap || _report(_exceptionable, {
825
+ path: _path + ".maxLogGap",
826
+ expected: "(number | undefined)",
827
+ value: input.maxLogGap
828
+ })].every(flag => flag);
829
+ const _vo5 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), "number" === typeof input.version || _report(_exceptionable, {
830
+ path: _path + ".version",
831
+ expected: "number",
832
+ value: input.version
833
+ }), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
834
+ const _vo6 = (input, _path, _exceptionable = true) => [undefined === input.t || "number" === typeof input.t || _report(_exceptionable, {
835
+ path: _path + ".t",
836
+ expected: "(number | undefined)",
837
+ value: input.t
838
+ }), ("object" === typeof input.wallet && null !== input.wallet || _report(_exceptionable, {
839
+ path: _path + ".wallet",
840
+ expected: "Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>",
841
+ value: input.wallet
842
+ })) && _vo7(input.wallet, _path + ".wallet", true && _exceptionable) || _report(_exceptionable, {
843
+ path: _path + ".wallet",
844
+ expected: "Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>",
845
+ value: input.wallet
846
+ }), undefined === input.maxMoneyEver || "string" === typeof input.maxMoneyEver || _report(_exceptionable, {
847
+ path: _path + ".maxMoneyEver",
848
+ expected: "(string | undefined)",
849
+ value: input.maxMoneyEver
850
+ }), undefined === input.prestige || ("object" === typeof input.prestige && null !== input.prestige && false === Array.isArray(input.prestige) || _report(_exceptionable, {
851
+ path: _path + ".prestige",
852
+ expected: "(Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined)",
853
+ value: input.prestige
854
+ })) && _vo8(input.prestige, _path + ".prestige", true && _exceptionable) || _report(_exceptionable, {
855
+ path: _path + ".prestige",
856
+ expected: "(Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined)",
857
+ value: input.prestige
858
+ }), true].every(flag => flag);
859
+ const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.unit || _report(_exceptionable, {
860
+ path: _path + ".unit",
861
+ expected: "string",
862
+ value: input.unit
863
+ }), "string" === typeof input.amount || _report(_exceptionable, {
864
+ path: _path + ".amount",
865
+ expected: "string",
866
+ value: input.amount
867
+ }), undefined === input.bucket || "string" === typeof input.bucket || _report(_exceptionable, {
868
+ path: _path + ".bucket",
869
+ expected: "(string | undefined)",
870
+ value: input.bucket
871
+ })].every(flag => flag);
872
+ const _vo8 = (input, _path, _exceptionable = true) => [undefined === input.count || "number" === typeof input.count || _report(_exceptionable, {
873
+ path: _path + ".count",
874
+ expected: "(number | undefined)",
875
+ value: input.count
876
+ }), undefined === input.points || "string" === typeof input.points || _report(_exceptionable, {
877
+ path: _path + ".points",
878
+ expected: "(string | undefined)",
879
+ value: input.points
880
+ }), undefined === input.multiplier || "string" === typeof input.multiplier || _report(_exceptionable, {
881
+ path: _path + ".multiplier",
882
+ expected: "(string | undefined)",
883
+ value: input.multiplier
884
+ })].every(flag => flag);
885
+ const _vo9 = (input, _path, _exceptionable = true) => ["number" === typeof input.stepSec || _report(_exceptionable, {
886
+ path: _path + ".stepSec",
887
+ expected: "number",
888
+ value: input.stepSec
889
+ }), undefined === input.durationSec || "number" === typeof input.durationSec || _report(_exceptionable, {
890
+ path: _path + ".durationSec",
891
+ expected: "(number | undefined)",
892
+ value: input.durationSec
893
+ }), undefined === input.untilExpr || "string" === typeof input.untilExpr || _report(_exceptionable, {
894
+ path: _path + ".untilExpr",
895
+ expected: "(string | undefined)",
896
+ value: input.untilExpr
897
+ })].every(flag => flag);
898
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
899
+ if ("none" === input.mode)
900
+ return _vo32(input, _path, true && _exceptionable);
901
+ else if ("legacy-all" === input.mode)
902
+ return _vo31(input, _path, true && _exceptionable);
903
+ else if ("allow" === input.mode)
904
+ return _vo33(input, _path, true && _exceptionable);
905
+ else
906
+ return _report(_exceptionable, {
907
+ path: _path,
908
+ expected: _ve18,
909
+ value: input
910
+ });
911
+ })();
912
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
913
+ let errors;
914
+ let _report;
915
+ return _createStandardSchema_1._createStandardSchema(input => {
916
+ if (false === __is(input)) {
917
+ errors = [];
918
+ _report = _validateReport_1._validateReport(errors);
919
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
920
+ path: _path + "",
921
+ expected: _ve0,
922
+ value: input
923
+ })) && _vo0(input, _path + "", true) || _report(true, {
924
+ path: _path + "",
925
+ expected: _ve0,
926
+ value: input
927
+ }))(input, "$input", true);
928
+ const success = 0 === errors.length;
929
+ return success ? {
930
+ success,
931
+ data: input
932
+ } : {
933
+ success,
934
+ errors,
935
+ data: input
936
+ };
937
+ }
938
+ return {
939
+ success: true,
940
+ data: input
941
+ };
942
+ });
943
+ })())(input);
944
+ export function parseScenarioStructure(input) {
945
+ return (() => {
946
+ const _ip0 = input => "string" === typeof input["id"];
947
+ const _ip1 = input => true;
948
+ const _ip2 = input => undefined === input["draws"] || "number" === typeof input["draws"];
949
+ const _ip3 = input => undefined === input["quantiles"] || Array.isArray(input["quantiles"]) && input["quantiles"].every(elem => "number" === typeof elem);
950
+ const _ip4 = input => undefined === input["enabled"] || "boolean" === typeof input["enabled"];
951
+ const _ve0 = "Readonly<{ schemaVersion: 1; meta?: Readonly<{ id?: string | undefined; title?: string | undefined; description?: string | undefined; tags?: string[] | undefined; }> | undefined; engine?: Readonly<...> | undefined; ... 11 more ...; outputs?: Readonly<...> | undefined; }>";
952
+ const _ve1 = "(Readonly<{ id?: string | undefined; title?: string | undefined; description?: string | undefined; tags?: string[] | undefined; }> | undefined)";
953
+ const _ve2 = "Readonly<{ t?: number | undefined; wallet: Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>; maxMoneyEver?: string | undefined; prestige?: Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined; vars?: unknown; }>";
954
+ const _ve3 = "(Readonly<{ intent?: \"frequent-progression\" | \"scale-fantasy\" | \"strategic-optimization\" | undefined; sessionPattern?: Readonly<{ id: \"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\"; days?: number | undefined; }> | undefined; }> | undefined)";
955
+ const _ve4 = "(Readonly<{ eta?: Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined; prestigeCycle?: Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined; growth?: Readonly<...> | undefined; experience?: Readonly<...> | undefined; }> | undefined)";
956
+ const _ve5 = "(Readonly<{ cohorts?: Readonly<{ baseUsers?: number | undefined; }> | undefined; retention?: Readonly<{ d1?: number | undefined; d7?: number | undefined; d30?: number | undefined; d90?: number | undefined; longTailDailyDecay?: number | undefined; }> | undefined; revenue?: Readonly<...> | undefined; acquisition?: Read... | undefined)";
957
+ const _ve6 = "(Readonly<{ fast?: boolean | undefined; eventLog?: Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined; offline?: Readonly<{ maxSec?: number | undefined; overflowPolicy?: \"clamp\" | ... 1 more ... | undefined; decay?: Readonly<...> | undefined; actions?: OfflineActionPolicy | undef... | undefined)";
958
+ const _ve7 = "(Readonly<{ format?: \"csv\" | \"json\" | \"md\" | undefined; outPath?: string | undefined; report?: Readonly<{ checkpointsSec?: number[] | undefined; includeTrace?: boolean | undefined; traceEverySteps?: number | undefined; includeGrowth?: boolean | undefined; includeUX?: boolean | undefined; }> | undefined; assertions?: ... | undefined)";
959
+ const _vp0 = (input, _path, _exceptionable = true) => "string" === typeof input["id"] || _report(_exceptionable, {
960
+ path: _path + ".id",
961
+ expected: "string",
962
+ value: input["id"]
963
+ });
964
+ const _vp1 = (input, _path, _exceptionable = true) => true;
965
+ const _ve8 = "(Readonly<{ id: \"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\"; days?: number | undefined; }> | undefined)";
966
+ const _ve9 = "(Readonly<{ series?: \"money\" | \"netWorth\" | undefined; draws?: number | undefined; quantiles?: number[] | undefined; }> | undefined)";
967
+ const _vp2 = (input, _path, _exceptionable = true) => undefined === input["draws"] || "number" === typeof input["draws"] || _report(_exceptionable, {
968
+ path: _path + ".draws",
969
+ expected: "(number | undefined)",
970
+ value: input["draws"]
971
+ });
972
+ const _vp3 = (input, _path, _exceptionable = true) => undefined === input["quantiles"] || (Array.isArray(input["quantiles"]) || _report(_exceptionable, {
973
+ path: _path + ".quantiles",
974
+ expected: "(Array<number> | undefined)",
975
+ value: input["quantiles"]
976
+ })) && input["quantiles"].map((elem, _index8) => "number" === typeof elem || _report(_exceptionable, {
977
+ path: _path + ".quantiles[" + _index8 + "]",
978
+ expected: "number",
979
+ value: elem
980
+ })).every(flag => flag) || _report(_exceptionable, {
981
+ path: _path + ".quantiles",
982
+ expected: "(Array<number> | undefined)",
983
+ value: input["quantiles"]
984
+ });
985
+ const _ve10 = "(Readonly<{ d1?: number | undefined; d7?: number | undefined; d30?: number | undefined; d90?: number | undefined; longTailDailyDecay?: number | undefined; }> | undefined)";
986
+ const _ve11 = "(Readonly<{ payerConversion?: number | undefined; arppuDaily?: number | undefined; adArpDau?: number | undefined; platformFeeRate?: number | undefined; grossMarginRate?: number | undefined; progressionRevenueLift?: number | undefined; progressionLogSpan?: number | undefined; }> | undefined)";
987
+ const _ve12 = "(Readonly<{ enabled?: boolean | undefined; draws?: number | undefined; quantiles?: number[] | undefined; seed?: number | undefined; sigma?: Readonly<{ retention?: number | undefined; conversion?: number | undefined; arppu?: number | undefined; ad?: number | undefined; }> | undefined; correlation?: Readonly<...> | und... | undefined)";
988
+ const _vp4 = (input, _path, _exceptionable = true) => undefined === input["enabled"] || "boolean" === typeof input["enabled"] || _report(_exceptionable, {
989
+ path: _path + ".enabled",
990
+ expected: "(boolean | undefined)",
991
+ value: input["enabled"]
992
+ });
993
+ const _ve13 = "(Readonly<{ retention?: number | undefined; conversion?: number | undefined; arppu?: number | undefined; ad?: number | undefined; }> | undefined)";
994
+ const _ve14 = "(Readonly<{ retentionConversion?: number | undefined; retentionArppu?: number | undefined; retentionAd?: number | undefined; conversionArppu?: number | undefined; conversionAd?: number | undefined; arppuAd?: number | undefined; }> | undefined)";
995
+ const _ve15 = "(Readonly<{ maxSec?: number | undefined; overflowPolicy?: \"clamp\" | \"reject\" | undefined; decay?: Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined; actions?: OfflineActionPolicy | undefined; }> | undefined)";
996
+ const _ve16 = "(Readonly<{ mode: \"allow\"; categories: readonly OfflineActionCategory[]; actors?: readonly OfflineActor[] | undefined; }> | Readonly<{ mode: \"legacy-all\"; }> | Readonly<{ mode: \"none\"; }> | undefined)";
997
+ const _ve17 = "(Readonly<{ checkpointsSec?: number[] | undefined; includeTrace?: boolean | undefined; traceEverySteps?: number | undefined; includeGrowth?: boolean | undefined; includeUX?: boolean | undefined; }> | undefined)";
998
+ const _ve18 = "(Readonly<{ mode: \"none\"; }> | Readonly<{ mode: \"legacy-all\"; }> | Readonly<{ mode: \"allow\"; categories: readonly OfflineActionCategory[]; actors?: readonly OfflineActor[] | undefined; }>)";
999
+ const _io0 = input => 1 === input.schemaVersion && (undefined === input.meta || "object" === typeof input.meta && null !== input.meta && false === Array.isArray(input.meta) && _io1(input.meta)) && (undefined === input.engine || "object" === typeof input.engine && null !== input.engine && _io2(input.engine)) && ("object" === typeof input.unit && null !== input.unit && _io3(input.unit)) && ("object" === typeof input.policy && null !== input.policy && _io4(input.policy)) && ("object" === typeof input.model && null !== input.model && _io5(input.model)) && ("object" === typeof input.initial && null !== input.initial && _io6(input.initial)) && ("object" === typeof input.clock && null !== input.clock && _io9(input.clock)) && (undefined === input.strategy || "object" === typeof input.strategy && null !== input.strategy && _io10(input.strategy)) && (undefined === input.design || "object" === typeof input.design && null !== input.design && false === Array.isArray(input.design) && _io11(input.design)) && (undefined === input.constraints || "object" === typeof input.constraints && null !== input.constraints && false === Array.isArray(input.constraints) && _io13(input.constraints)) && (undefined === input.analysis || "object" === typeof input.analysis && null !== input.analysis && false === Array.isArray(input.analysis) && _io14(input.analysis)) && (undefined === input.monetization || "object" === typeof input.monetization && null !== input.monetization && false === Array.isArray(input.monetization) && _io19(input.monetization)) && (undefined === input.sim || "object" === typeof input.sim && null !== input.sim && false === Array.isArray(input.sim) && _io27(input.sim)) && (undefined === input.outputs || "object" === typeof input.outputs && null !== input.outputs && false === Array.isArray(input.outputs) && _io34(input.outputs));
1000
+ const _io1 = input => (undefined === input.id || "string" === typeof input.id) && (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem));
1001
+ const _io10 = input => _ip0(input) && _ip1(input);
1002
+ const _io11 = input => (undefined === input.intent || "frequent-progression" === input.intent || "scale-fantasy" === input.intent || "strategic-optimization" === input.intent) && (undefined === input.sessionPattern || "object" === typeof input.sessionPattern && null !== input.sessionPattern && _io12(input.sessionPattern));
1003
+ const _io12 = input => ("always-on" === input.id || "offline-heavy" === input.id || "short-bursts" === input.id || "twice-daily" === input.id || "weekend-marathon" === input.id) && (undefined === input.days || "number" === typeof input.days);
1004
+ const _io13 = input => (undefined === input.maxActionsPerStep || "number" === typeof input.maxActionsPerStep) && (undefined === input.minPrestigeIntervalSec || "number" === typeof input.minPrestigeIntervalSec);
1005
+ const _io14 = input => (undefined === input.eta || "object" === typeof input.eta && null !== input.eta && false === Array.isArray(input.eta) && _io15(input.eta)) && (undefined === input.prestigeCycle || "object" === typeof input.prestigeCycle && null !== input.prestigeCycle && false === Array.isArray(input.prestigeCycle) && _io16(input.prestigeCycle)) && (undefined === input.growth || "object" === typeof input.growth && null !== input.growth && false === Array.isArray(input.growth) && _io17(input.growth)) && (undefined === input.experience || "object" === typeof input.experience && null !== input.experience && false === Array.isArray(input.experience) && _io18(input.experience));
1006
+ const _io15 = input => undefined === input.mode || "analytic" === input.mode || "simulate" === input.mode;
1007
+ const _io16 = input => (undefined === input.scan || "string" === typeof input.scan) && (undefined === input.stepSec || "number" === typeof input.stepSec) && (undefined === input.cycles || "number" === typeof input.cycles);
1008
+ const _io17 = input => undefined === input.windowSec || "number" === typeof input.windowSec;
1009
+ const _io18 = input => (undefined === input.series || "money" === input.series || "netWorth" === input.series) && _ip2(input) && _ip3(input);
1010
+ const _io19 = input => (undefined === input.cohorts || "object" === typeof input.cohorts && null !== input.cohorts && false === Array.isArray(input.cohorts) && _io20(input.cohorts)) && (undefined === input.retention || "object" === typeof input.retention && null !== input.retention && false === Array.isArray(input.retention) && _io21(input.retention)) && (undefined === input.revenue || "object" === typeof input.revenue && null !== input.revenue && false === Array.isArray(input.revenue) && _io22(input.revenue)) && (undefined === input.acquisition || "object" === typeof input.acquisition && null !== input.acquisition && false === Array.isArray(input.acquisition) && _io23(input.acquisition)) && (undefined === input.uncertainty || "object" === typeof input.uncertainty && null !== input.uncertainty && false === Array.isArray(input.uncertainty) && _io24(input.uncertainty));
1011
+ const _io2 = input => "string" === typeof input.name && (undefined === input.version || "string" === typeof input.version);
1012
+ const _io20 = input => undefined === input.baseUsers || "number" === typeof input.baseUsers;
1013
+ const _io21 = input => (undefined === input.d1 || "number" === typeof input.d1) && (undefined === input.d7 || "number" === typeof input.d7) && (undefined === input.d30 || "number" === typeof input.d30) && (undefined === input.d90 || "number" === typeof input.d90) && (undefined === input.longTailDailyDecay || "number" === typeof input.longTailDailyDecay);
1014
+ const _io22 = input => (undefined === input.payerConversion || "number" === typeof input.payerConversion) && (undefined === input.arppuDaily || "number" === typeof input.arppuDaily) && (undefined === input.adArpDau || "number" === typeof input.adArpDau) && (undefined === input.platformFeeRate || "number" === typeof input.platformFeeRate) && (undefined === input.grossMarginRate || "number" === typeof input.grossMarginRate) && (undefined === input.progressionRevenueLift || "number" === typeof input.progressionRevenueLift) && (undefined === input.progressionLogSpan || "number" === typeof input.progressionLogSpan);
1015
+ const _io23 = input => undefined === input.cpi || "number" === typeof input.cpi;
1016
+ const _io24 = input => _ip4(input) && _ip2(input) && _ip3(input) && (undefined === input.seed || "number" === typeof input.seed) && (undefined === input.sigma || "object" === typeof input.sigma && null !== input.sigma && false === Array.isArray(input.sigma) && _io25(input.sigma)) && (undefined === input.correlation || "object" === typeof input.correlation && null !== input.correlation && false === Array.isArray(input.correlation) && _io26(input.correlation));
1017
+ const _io25 = input => (undefined === input.retention || "number" === typeof input.retention) && (undefined === input.conversion || "number" === typeof input.conversion) && (undefined === input.arppu || "number" === typeof input.arppu) && (undefined === input.ad || "number" === typeof input.ad);
1018
+ const _io26 = input => (undefined === input.retentionConversion || "number" === typeof input.retentionConversion) && (undefined === input.retentionArppu || "number" === typeof input.retentionArppu) && (undefined === input.retentionAd || "number" === typeof input.retentionAd) && (undefined === input.conversionArppu || "number" === typeof input.conversionArppu) && (undefined === input.conversionAd || "number" === typeof input.conversionAd) && (undefined === input.arppuAd || "number" === typeof input.arppuAd);
1019
+ const _io27 = input => (undefined === input.fast || "boolean" === typeof input.fast) && (undefined === input.eventLog || "object" === typeof input.eventLog && null !== input.eventLog && false === Array.isArray(input.eventLog) && _io28(input.eventLog)) && (undefined === input.offline || "object" === typeof input.offline && null !== input.offline && false === Array.isArray(input.offline) && _io29(input.offline));
1020
+ const _io28 = input => _ip4(input) && (undefined === input.maxEvents || "number" === typeof input.maxEvents);
1021
+ const _io29 = input => (undefined === input.maxSec || "number" === typeof input.maxSec) && (undefined === input.overflowPolicy || "clamp" === input.overflowPolicy || "reject" === input.overflowPolicy) && (undefined === input.decay || "object" === typeof input.decay && null !== input.decay && _io30(input.decay)) && (undefined === input.actions || "object" === typeof input.actions && null !== input.actions && _iu0(input.actions));
1022
+ const _io3 = input => "string" === typeof input.code && (undefined === input.symbol || "string" === typeof input.symbol);
1023
+ const _io30 = input => ("linear" === input.kind || "none" === input.kind) && (undefined === input.floorRatio || "number" === typeof input.floorRatio);
1024
+ const _io31 = input => "legacy-all" === input.mode;
1025
+ const _io32 = input => "none" === input.mode;
1026
+ const _io33 = input => "allow" === input.mode && (Array.isArray(input.categories) && input.categories.every(elem => "buy" === elem || "custom" === elem || "grant" === elem || "prestige" === elem)) && (undefined === input.actors || Array.isArray(input.actors) && input.actors.every(elem => "automation" === elem || "player" === elem));
1027
+ const _io34 = input => (undefined === input.format || "csv" === input.format || "json" === input.format || "md" === input.format) && (undefined === input.outPath || "string" === typeof input.outPath) && (undefined === input.report || "object" === typeof input.report && null !== input.report && false === Array.isArray(input.report) && _io35(input.report)) && (undefined === input.assertions || Array.isArray(input.assertions) && input.assertions.every(elem => "object" === typeof elem && null !== elem && _io36(elem)));
1028
+ const _io35 = input => (undefined === input.checkpointsSec || Array.isArray(input.checkpointsSec) && input.checkpointsSec.every(elem => "number" === typeof elem)) && (undefined === input.includeTrace || "boolean" === typeof input.includeTrace) && (undefined === input.traceEverySteps || "number" === typeof input.traceEverySteps) && (undefined === input.includeGrowth || "boolean" === typeof input.includeGrowth) && (undefined === input.includeUX || "boolean" === typeof input.includeUX);
1029
+ const _io36 = input => "string" === typeof input.expr && (undefined === input.severity || "error" === input.severity || "warn" === input.severity);
1030
+ const _io4 = input => ("accumulate" === input.mode || "drop" === input.mode) && (undefined === input.maxLogGap || "number" === typeof input.maxLogGap);
1031
+ const _io5 = input => _ip0(input) && "number" === typeof input.version && _ip1(input);
1032
+ const _io6 = input => (undefined === input.t || "number" === typeof input.t) && ("object" === typeof input.wallet && null !== input.wallet && _io7(input.wallet)) && (undefined === input.maxMoneyEver || "string" === typeof input.maxMoneyEver) && (undefined === input.prestige || "object" === typeof input.prestige && null !== input.prestige && false === Array.isArray(input.prestige) && _io8(input.prestige)) && true;
1033
+ const _io7 = input => "string" === typeof input.unit && "string" === typeof input.amount && (undefined === input.bucket || "string" === typeof input.bucket);
1034
+ const _io8 = input => (undefined === input.count || "number" === typeof input.count) && (undefined === input.points || "string" === typeof input.points) && (undefined === input.multiplier || "string" === typeof input.multiplier);
1035
+ const _io9 = input => "number" === typeof input.stepSec && (undefined === input.durationSec || "number" === typeof input.durationSec) && (undefined === input.untilExpr || "string" === typeof input.untilExpr);
1036
+ const _iu0 = input => (() => {
1037
+ if ("none" === input.mode)
1038
+ return _io32(input);
1039
+ else if ("legacy-all" === input.mode)
1040
+ return _io31(input);
1041
+ else if ("allow" === input.mode)
1042
+ return _io33(input);
1043
+ else
1044
+ return false;
1045
+ })();
1046
+ const _vo0 = (input, _path, _exceptionable = true) => [1 === input.schemaVersion || _report(_exceptionable, {
1047
+ path: _path + ".schemaVersion",
1048
+ expected: "1",
1049
+ value: input.schemaVersion
1050
+ }), undefined === input.meta || ("object" === typeof input.meta && null !== input.meta && false === Array.isArray(input.meta) || _report(_exceptionable, {
1051
+ path: _path + ".meta",
1052
+ expected: _ve1,
1053
+ value: input.meta
1054
+ })) && _vo1(input.meta, _path + ".meta", true && _exceptionable) || _report(_exceptionable, {
1055
+ path: _path + ".meta",
1056
+ expected: _ve1,
1057
+ value: input.meta
1058
+ }), undefined === input.engine || ("object" === typeof input.engine && null !== input.engine || _report(_exceptionable, {
1059
+ path: _path + ".engine",
1060
+ expected: "(Readonly<{ name: string; version?: string | undefined; }> | undefined)",
1061
+ value: input.engine
1062
+ })) && _vo2(input.engine, _path + ".engine", true && _exceptionable) || _report(_exceptionable, {
1063
+ path: _path + ".engine",
1064
+ expected: "(Readonly<{ name: string; version?: string | undefined; }> | undefined)",
1065
+ value: input.engine
1066
+ }), ("object" === typeof input.unit && null !== input.unit || _report(_exceptionable, {
1067
+ path: _path + ".unit",
1068
+ expected: "Readonly<{ code: string; symbol?: string | undefined; }>",
1069
+ value: input.unit
1070
+ })) && _vo3(input.unit, _path + ".unit", true && _exceptionable) || _report(_exceptionable, {
1071
+ path: _path + ".unit",
1072
+ expected: "Readonly<{ code: string; symbol?: string | undefined; }>",
1073
+ value: input.unit
1074
+ }), ("object" === typeof input.policy && null !== input.policy || _report(_exceptionable, {
1075
+ path: _path + ".policy",
1076
+ expected: "Readonly<{ mode: \"accumulate\" | \"drop\"; maxLogGap?: number | undefined; }>",
1077
+ value: input.policy
1078
+ })) && _vo4(input.policy, _path + ".policy", true && _exceptionable) || _report(_exceptionable, {
1079
+ path: _path + ".policy",
1080
+ expected: "Readonly<{ mode: \"accumulate\" | \"drop\"; maxLogGap?: number | undefined; }>",
1081
+ value: input.policy
1082
+ }), ("object" === typeof input.model && null !== input.model || _report(_exceptionable, {
1083
+ path: _path + ".model",
1084
+ expected: "Readonly<{ id: string; version: number; params?: unknown; }>",
1085
+ value: input.model
1086
+ })) && _vo5(input.model, _path + ".model", true && _exceptionable) || _report(_exceptionable, {
1087
+ path: _path + ".model",
1088
+ expected: "Readonly<{ id: string; version: number; params?: unknown; }>",
1089
+ value: input.model
1090
+ }), ("object" === typeof input.initial && null !== input.initial || _report(_exceptionable, {
1091
+ path: _path + ".initial",
1092
+ expected: _ve2,
1093
+ value: input.initial
1094
+ })) && _vo6(input.initial, _path + ".initial", true && _exceptionable) || _report(_exceptionable, {
1095
+ path: _path + ".initial",
1096
+ expected: _ve2,
1097
+ value: input.initial
1098
+ }), ("object" === typeof input.clock && null !== input.clock || _report(_exceptionable, {
1099
+ path: _path + ".clock",
1100
+ expected: "Readonly<{ stepSec: number; durationSec?: number | undefined; untilExpr?: string | undefined; }>",
1101
+ value: input.clock
1102
+ })) && _vo9(input.clock, _path + ".clock", true && _exceptionable) || _report(_exceptionable, {
1103
+ path: _path + ".clock",
1104
+ expected: "Readonly<{ stepSec: number; durationSec?: number | undefined; untilExpr?: string | undefined; }>",
1105
+ value: input.clock
1106
+ }), undefined === input.strategy || ("object" === typeof input.strategy && null !== input.strategy || _report(_exceptionable, {
1107
+ path: _path + ".strategy",
1108
+ expected: "(Readonly<{ id: string; params?: unknown; }> | undefined)",
1109
+ value: input.strategy
1110
+ })) && _vo10(input.strategy, _path + ".strategy", true && _exceptionable) || _report(_exceptionable, {
1111
+ path: _path + ".strategy",
1112
+ expected: "(Readonly<{ id: string; params?: unknown; }> | undefined)",
1113
+ value: input.strategy
1114
+ }), undefined === input.design || ("object" === typeof input.design && null !== input.design && false === Array.isArray(input.design) || _report(_exceptionable, {
1115
+ path: _path + ".design",
1116
+ expected: _ve3,
1117
+ value: input.design
1118
+ })) && _vo11(input.design, _path + ".design", true && _exceptionable) || _report(_exceptionable, {
1119
+ path: _path + ".design",
1120
+ expected: _ve3,
1121
+ value: input.design
1122
+ }), undefined === input.constraints || ("object" === typeof input.constraints && null !== input.constraints && false === Array.isArray(input.constraints) || _report(_exceptionable, {
1123
+ path: _path + ".constraints",
1124
+ expected: "(Readonly<{ maxActionsPerStep?: number | undefined; minPrestigeIntervalSec?: number | undefined; }> | undefined)",
1125
+ value: input.constraints
1126
+ })) && _vo13(input.constraints, _path + ".constraints", true && _exceptionable) || _report(_exceptionable, {
1127
+ path: _path + ".constraints",
1128
+ expected: "(Readonly<{ maxActionsPerStep?: number | undefined; minPrestigeIntervalSec?: number | undefined; }> | undefined)",
1129
+ value: input.constraints
1130
+ }), undefined === input.analysis || ("object" === typeof input.analysis && null !== input.analysis && false === Array.isArray(input.analysis) || _report(_exceptionable, {
1131
+ path: _path + ".analysis",
1132
+ expected: _ve4,
1133
+ value: input.analysis
1134
+ })) && _vo14(input.analysis, _path + ".analysis", true && _exceptionable) || _report(_exceptionable, {
1135
+ path: _path + ".analysis",
1136
+ expected: _ve4,
1137
+ value: input.analysis
1138
+ }), undefined === input.monetization || ("object" === typeof input.monetization && null !== input.monetization && false === Array.isArray(input.monetization) || _report(_exceptionable, {
1139
+ path: _path + ".monetization",
1140
+ expected: _ve5,
1141
+ value: input.monetization
1142
+ })) && _vo19(input.monetization, _path + ".monetization", true && _exceptionable) || _report(_exceptionable, {
1143
+ path: _path + ".monetization",
1144
+ expected: _ve5,
1145
+ value: input.monetization
1146
+ }), undefined === input.sim || ("object" === typeof input.sim && null !== input.sim && false === Array.isArray(input.sim) || _report(_exceptionable, {
1147
+ path: _path + ".sim",
1148
+ expected: _ve6,
1149
+ value: input.sim
1150
+ })) && _vo27(input.sim, _path + ".sim", true && _exceptionable) || _report(_exceptionable, {
1151
+ path: _path + ".sim",
1152
+ expected: _ve6,
1153
+ value: input.sim
1154
+ }), undefined === input.outputs || ("object" === typeof input.outputs && null !== input.outputs && false === Array.isArray(input.outputs) || _report(_exceptionable, {
1155
+ path: _path + ".outputs",
1156
+ expected: _ve7,
1157
+ value: input.outputs
1158
+ })) && _vo34(input.outputs, _path + ".outputs", true && _exceptionable) || _report(_exceptionable, {
1159
+ path: _path + ".outputs",
1160
+ expected: _ve7,
1161
+ value: input.outputs
1162
+ })].every(flag => flag);
1163
+ const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.id || "string" === typeof input.id || _report(_exceptionable, {
1164
+ path: _path + ".id",
1165
+ expected: "(string | undefined)",
1166
+ value: input.id
1167
+ }), undefined === input.title || "string" === typeof input.title || _report(_exceptionable, {
1168
+ path: _path + ".title",
1169
+ expected: "(string | undefined)",
1170
+ value: input.title
1171
+ }), undefined === input.description || "string" === typeof input.description || _report(_exceptionable, {
1172
+ path: _path + ".description",
1173
+ expected: "(string | undefined)",
1174
+ value: input.description
1175
+ }), undefined === input.tags || (Array.isArray(input.tags) || _report(_exceptionable, {
1176
+ path: _path + ".tags",
1177
+ expected: "(Array<string> | undefined)",
1178
+ value: input.tags
1179
+ })) && input.tags.map((elem, _index7) => "string" === typeof elem || _report(_exceptionable, {
1180
+ path: _path + ".tags[" + _index7 + "]",
1181
+ expected: "string",
1182
+ value: elem
1183
+ })).every(flag => flag) || _report(_exceptionable, {
1184
+ path: _path + ".tags",
1185
+ expected: "(Array<string> | undefined)",
1186
+ value: input.tags
1187
+ })].every(flag => flag);
1188
+ const _vo10 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
1189
+ const _vo11 = (input, _path, _exceptionable = true) => [undefined === input.intent || "frequent-progression" === input.intent || "scale-fantasy" === input.intent || "strategic-optimization" === input.intent || _report(_exceptionable, {
1190
+ path: _path + ".intent",
1191
+ expected: "(\"frequent-progression\" | \"scale-fantasy\" | \"strategic-optimization\" | undefined)",
1192
+ value: input.intent
1193
+ }), undefined === input.sessionPattern || ("object" === typeof input.sessionPattern && null !== input.sessionPattern || _report(_exceptionable, {
1194
+ path: _path + ".sessionPattern",
1195
+ expected: _ve8,
1196
+ value: input.sessionPattern
1197
+ })) && _vo12(input.sessionPattern, _path + ".sessionPattern", true && _exceptionable) || _report(_exceptionable, {
1198
+ path: _path + ".sessionPattern",
1199
+ expected: _ve8,
1200
+ value: input.sessionPattern
1201
+ })].every(flag => flag);
1202
+ const _vo12 = (input, _path, _exceptionable = true) => ["always-on" === input.id || "offline-heavy" === input.id || "short-bursts" === input.id || "twice-daily" === input.id || "weekend-marathon" === input.id || _report(_exceptionable, {
1203
+ path: _path + ".id",
1204
+ expected: "(\"always-on\" | \"offline-heavy\" | \"short-bursts\" | \"twice-daily\" | \"weekend-marathon\")",
1205
+ value: input.id
1206
+ }), undefined === input.days || "number" === typeof input.days || _report(_exceptionable, {
1207
+ path: _path + ".days",
1208
+ expected: "(number | undefined)",
1209
+ value: input.days
1210
+ })].every(flag => flag);
1211
+ const _vo13 = (input, _path, _exceptionable = true) => [undefined === input.maxActionsPerStep || "number" === typeof input.maxActionsPerStep || _report(_exceptionable, {
1212
+ path: _path + ".maxActionsPerStep",
1213
+ expected: "(number | undefined)",
1214
+ value: input.maxActionsPerStep
1215
+ }), undefined === input.minPrestigeIntervalSec || "number" === typeof input.minPrestigeIntervalSec || _report(_exceptionable, {
1216
+ path: _path + ".minPrestigeIntervalSec",
1217
+ expected: "(number | undefined)",
1218
+ value: input.minPrestigeIntervalSec
1219
+ })].every(flag => flag);
1220
+ const _vo14 = (input, _path, _exceptionable = true) => [undefined === input.eta || ("object" === typeof input.eta && null !== input.eta && false === Array.isArray(input.eta) || _report(_exceptionable, {
1221
+ path: _path + ".eta",
1222
+ expected: "(Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined)",
1223
+ value: input.eta
1224
+ })) && _vo15(input.eta, _path + ".eta", true && _exceptionable) || _report(_exceptionable, {
1225
+ path: _path + ".eta",
1226
+ expected: "(Readonly<{ mode?: \"analytic\" | \"simulate\" | undefined; }> | undefined)",
1227
+ value: input.eta
1228
+ }), undefined === input.prestigeCycle || ("object" === typeof input.prestigeCycle && null !== input.prestigeCycle && false === Array.isArray(input.prestigeCycle) || _report(_exceptionable, {
1229
+ path: _path + ".prestigeCycle",
1230
+ expected: "(Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined)",
1231
+ value: input.prestigeCycle
1232
+ })) && _vo16(input.prestigeCycle, _path + ".prestigeCycle", true && _exceptionable) || _report(_exceptionable, {
1233
+ path: _path + ".prestigeCycle",
1234
+ expected: "(Readonly<{ scan?: string | undefined; stepSec?: number | undefined; cycles?: number | undefined; }> | undefined)",
1235
+ value: input.prestigeCycle
1236
+ }), undefined === input.growth || ("object" === typeof input.growth && null !== input.growth && false === Array.isArray(input.growth) || _report(_exceptionable, {
1237
+ path: _path + ".growth",
1238
+ expected: "(Readonly<{ windowSec?: number | undefined; }> | undefined)",
1239
+ value: input.growth
1240
+ })) && _vo17(input.growth, _path + ".growth", true && _exceptionable) || _report(_exceptionable, {
1241
+ path: _path + ".growth",
1242
+ expected: "(Readonly<{ windowSec?: number | undefined; }> | undefined)",
1243
+ value: input.growth
1244
+ }), undefined === input.experience || ("object" === typeof input.experience && null !== input.experience && false === Array.isArray(input.experience) || _report(_exceptionable, {
1245
+ path: _path + ".experience",
1246
+ expected: _ve9,
1247
+ value: input.experience
1248
+ })) && _vo18(input.experience, _path + ".experience", true && _exceptionable) || _report(_exceptionable, {
1249
+ path: _path + ".experience",
1250
+ expected: _ve9,
1251
+ value: input.experience
1252
+ })].every(flag => flag);
1253
+ const _vo15 = (input, _path, _exceptionable = true) => [undefined === input.mode || "analytic" === input.mode || "simulate" === input.mode || _report(_exceptionable, {
1254
+ path: _path + ".mode",
1255
+ expected: "(\"analytic\" | \"simulate\" | undefined)",
1256
+ value: input.mode
1257
+ })].every(flag => flag);
1258
+ const _vo16 = (input, _path, _exceptionable = true) => [undefined === input.scan || "string" === typeof input.scan || _report(_exceptionable, {
1259
+ path: _path + ".scan",
1260
+ expected: "(string | undefined)",
1261
+ value: input.scan
1262
+ }), undefined === input.stepSec || "number" === typeof input.stepSec || _report(_exceptionable, {
1263
+ path: _path + ".stepSec",
1264
+ expected: "(number | undefined)",
1265
+ value: input.stepSec
1266
+ }), undefined === input.cycles || "number" === typeof input.cycles || _report(_exceptionable, {
1267
+ path: _path + ".cycles",
1268
+ expected: "(number | undefined)",
1269
+ value: input.cycles
1270
+ })].every(flag => flag);
1271
+ const _vo17 = (input, _path, _exceptionable = true) => [undefined === input.windowSec || "number" === typeof input.windowSec || _report(_exceptionable, {
1272
+ path: _path + ".windowSec",
1273
+ expected: "(number | undefined)",
1274
+ value: input.windowSec
1275
+ })].every(flag => flag);
1276
+ const _vo18 = (input, _path, _exceptionable = true) => [undefined === input.series || "money" === input.series || "netWorth" === input.series || _report(_exceptionable, {
1277
+ path: _path + ".series",
1278
+ expected: "(\"money\" | \"netWorth\" | undefined)",
1279
+ value: input.series
1280
+ }), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable)].every(flag => flag);
1281
+ const _vo19 = (input, _path, _exceptionable = true) => [undefined === input.cohorts || ("object" === typeof input.cohorts && null !== input.cohorts && false === Array.isArray(input.cohorts) || _report(_exceptionable, {
1282
+ path: _path + ".cohorts",
1283
+ expected: "(Readonly<{ baseUsers?: number | undefined; }> | undefined)",
1284
+ value: input.cohorts
1285
+ })) && _vo20(input.cohorts, _path + ".cohorts", true && _exceptionable) || _report(_exceptionable, {
1286
+ path: _path + ".cohorts",
1287
+ expected: "(Readonly<{ baseUsers?: number | undefined; }> | undefined)",
1288
+ value: input.cohorts
1289
+ }), undefined === input.retention || ("object" === typeof input.retention && null !== input.retention && false === Array.isArray(input.retention) || _report(_exceptionable, {
1290
+ path: _path + ".retention",
1291
+ expected: _ve10,
1292
+ value: input.retention
1293
+ })) && _vo21(input.retention, _path + ".retention", true && _exceptionable) || _report(_exceptionable, {
1294
+ path: _path + ".retention",
1295
+ expected: _ve10,
1296
+ value: input.retention
1297
+ }), undefined === input.revenue || ("object" === typeof input.revenue && null !== input.revenue && false === Array.isArray(input.revenue) || _report(_exceptionable, {
1298
+ path: _path + ".revenue",
1299
+ expected: _ve11,
1300
+ value: input.revenue
1301
+ })) && _vo22(input.revenue, _path + ".revenue", true && _exceptionable) || _report(_exceptionable, {
1302
+ path: _path + ".revenue",
1303
+ expected: _ve11,
1304
+ value: input.revenue
1305
+ }), undefined === input.acquisition || ("object" === typeof input.acquisition && null !== input.acquisition && false === Array.isArray(input.acquisition) || _report(_exceptionable, {
1306
+ path: _path + ".acquisition",
1307
+ expected: "(Readonly<{ cpi?: number | undefined; }> | undefined)",
1308
+ value: input.acquisition
1309
+ })) && _vo23(input.acquisition, _path + ".acquisition", true && _exceptionable) || _report(_exceptionable, {
1310
+ path: _path + ".acquisition",
1311
+ expected: "(Readonly<{ cpi?: number | undefined; }> | undefined)",
1312
+ value: input.acquisition
1313
+ }), undefined === input.uncertainty || ("object" === typeof input.uncertainty && null !== input.uncertainty && false === Array.isArray(input.uncertainty) || _report(_exceptionable, {
1314
+ path: _path + ".uncertainty",
1315
+ expected: _ve12,
1316
+ value: input.uncertainty
1317
+ })) && _vo24(input.uncertainty, _path + ".uncertainty", true && _exceptionable) || _report(_exceptionable, {
1318
+ path: _path + ".uncertainty",
1319
+ expected: _ve12,
1320
+ value: input.uncertainty
1321
+ })].every(flag => flag);
1322
+ const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
1323
+ path: _path + ".name",
1324
+ expected: "string",
1325
+ value: input.name
1326
+ }), undefined === input.version || "string" === typeof input.version || _report(_exceptionable, {
1327
+ path: _path + ".version",
1328
+ expected: "(string | undefined)",
1329
+ value: input.version
1330
+ })].every(flag => flag);
1331
+ const _vo20 = (input, _path, _exceptionable = true) => [undefined === input.baseUsers || "number" === typeof input.baseUsers || _report(_exceptionable, {
1332
+ path: _path + ".baseUsers",
1333
+ expected: "(number | undefined)",
1334
+ value: input.baseUsers
1335
+ })].every(flag => flag);
1336
+ const _vo21 = (input, _path, _exceptionable = true) => [undefined === input.d1 || "number" === typeof input.d1 || _report(_exceptionable, {
1337
+ path: _path + ".d1",
1338
+ expected: "(number | undefined)",
1339
+ value: input.d1
1340
+ }), undefined === input.d7 || "number" === typeof input.d7 || _report(_exceptionable, {
1341
+ path: _path + ".d7",
1342
+ expected: "(number | undefined)",
1343
+ value: input.d7
1344
+ }), undefined === input.d30 || "number" === typeof input.d30 || _report(_exceptionable, {
1345
+ path: _path + ".d30",
1346
+ expected: "(number | undefined)",
1347
+ value: input.d30
1348
+ }), undefined === input.d90 || "number" === typeof input.d90 || _report(_exceptionable, {
1349
+ path: _path + ".d90",
1350
+ expected: "(number | undefined)",
1351
+ value: input.d90
1352
+ }), undefined === input.longTailDailyDecay || "number" === typeof input.longTailDailyDecay || _report(_exceptionable, {
1353
+ path: _path + ".longTailDailyDecay",
1354
+ expected: "(number | undefined)",
1355
+ value: input.longTailDailyDecay
1356
+ })].every(flag => flag);
1357
+ const _vo22 = (input, _path, _exceptionable = true) => [undefined === input.payerConversion || "number" === typeof input.payerConversion || _report(_exceptionable, {
1358
+ path: _path + ".payerConversion",
1359
+ expected: "(number | undefined)",
1360
+ value: input.payerConversion
1361
+ }), undefined === input.arppuDaily || "number" === typeof input.arppuDaily || _report(_exceptionable, {
1362
+ path: _path + ".arppuDaily",
1363
+ expected: "(number | undefined)",
1364
+ value: input.arppuDaily
1365
+ }), undefined === input.adArpDau || "number" === typeof input.adArpDau || _report(_exceptionable, {
1366
+ path: _path + ".adArpDau",
1367
+ expected: "(number | undefined)",
1368
+ value: input.adArpDau
1369
+ }), undefined === input.platformFeeRate || "number" === typeof input.platformFeeRate || _report(_exceptionable, {
1370
+ path: _path + ".platformFeeRate",
1371
+ expected: "(number | undefined)",
1372
+ value: input.platformFeeRate
1373
+ }), undefined === input.grossMarginRate || "number" === typeof input.grossMarginRate || _report(_exceptionable, {
1374
+ path: _path + ".grossMarginRate",
1375
+ expected: "(number | undefined)",
1376
+ value: input.grossMarginRate
1377
+ }), undefined === input.progressionRevenueLift || "number" === typeof input.progressionRevenueLift || _report(_exceptionable, {
1378
+ path: _path + ".progressionRevenueLift",
1379
+ expected: "(number | undefined)",
1380
+ value: input.progressionRevenueLift
1381
+ }), undefined === input.progressionLogSpan || "number" === typeof input.progressionLogSpan || _report(_exceptionable, {
1382
+ path: _path + ".progressionLogSpan",
1383
+ expected: "(number | undefined)",
1384
+ value: input.progressionLogSpan
1385
+ })].every(flag => flag);
1386
+ const _vo23 = (input, _path, _exceptionable = true) => [undefined === input.cpi || "number" === typeof input.cpi || _report(_exceptionable, {
1387
+ path: _path + ".cpi",
1388
+ expected: "(number | undefined)",
1389
+ value: input.cpi
1390
+ })].every(flag => flag);
1391
+ const _vo24 = (input, _path, _exceptionable = true) => [_vp4(input, _path, true && _exceptionable), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), undefined === input.seed || "number" === typeof input.seed || _report(_exceptionable, {
1392
+ path: _path + ".seed",
1393
+ expected: "(number | undefined)",
1394
+ value: input.seed
1395
+ }), undefined === input.sigma || ("object" === typeof input.sigma && null !== input.sigma && false === Array.isArray(input.sigma) || _report(_exceptionable, {
1396
+ path: _path + ".sigma",
1397
+ expected: _ve13,
1398
+ value: input.sigma
1399
+ })) && _vo25(input.sigma, _path + ".sigma", true && _exceptionable) || _report(_exceptionable, {
1400
+ path: _path + ".sigma",
1401
+ expected: _ve13,
1402
+ value: input.sigma
1403
+ }), undefined === input.correlation || ("object" === typeof input.correlation && null !== input.correlation && false === Array.isArray(input.correlation) || _report(_exceptionable, {
1404
+ path: _path + ".correlation",
1405
+ expected: _ve14,
1406
+ value: input.correlation
1407
+ })) && _vo26(input.correlation, _path + ".correlation", true && _exceptionable) || _report(_exceptionable, {
1408
+ path: _path + ".correlation",
1409
+ expected: _ve14,
1410
+ value: input.correlation
1411
+ })].every(flag => flag);
1412
+ const _vo25 = (input, _path, _exceptionable = true) => [undefined === input.retention || "number" === typeof input.retention || _report(_exceptionable, {
1413
+ path: _path + ".retention",
1414
+ expected: "(number | undefined)",
1415
+ value: input.retention
1416
+ }), undefined === input.conversion || "number" === typeof input.conversion || _report(_exceptionable, {
1417
+ path: _path + ".conversion",
1418
+ expected: "(number | undefined)",
1419
+ value: input.conversion
1420
+ }), undefined === input.arppu || "number" === typeof input.arppu || _report(_exceptionable, {
1421
+ path: _path + ".arppu",
1422
+ expected: "(number | undefined)",
1423
+ value: input.arppu
1424
+ }), undefined === input.ad || "number" === typeof input.ad || _report(_exceptionable, {
1425
+ path: _path + ".ad",
1426
+ expected: "(number | undefined)",
1427
+ value: input.ad
1428
+ })].every(flag => flag);
1429
+ const _vo26 = (input, _path, _exceptionable = true) => [undefined === input.retentionConversion || "number" === typeof input.retentionConversion || _report(_exceptionable, {
1430
+ path: _path + ".retentionConversion",
1431
+ expected: "(number | undefined)",
1432
+ value: input.retentionConversion
1433
+ }), undefined === input.retentionArppu || "number" === typeof input.retentionArppu || _report(_exceptionable, {
1434
+ path: _path + ".retentionArppu",
1435
+ expected: "(number | undefined)",
1436
+ value: input.retentionArppu
1437
+ }), undefined === input.retentionAd || "number" === typeof input.retentionAd || _report(_exceptionable, {
1438
+ path: _path + ".retentionAd",
1439
+ expected: "(number | undefined)",
1440
+ value: input.retentionAd
1441
+ }), undefined === input.conversionArppu || "number" === typeof input.conversionArppu || _report(_exceptionable, {
1442
+ path: _path + ".conversionArppu",
1443
+ expected: "(number | undefined)",
1444
+ value: input.conversionArppu
1445
+ }), undefined === input.conversionAd || "number" === typeof input.conversionAd || _report(_exceptionable, {
1446
+ path: _path + ".conversionAd",
1447
+ expected: "(number | undefined)",
1448
+ value: input.conversionAd
1449
+ }), undefined === input.arppuAd || "number" === typeof input.arppuAd || _report(_exceptionable, {
1450
+ path: _path + ".arppuAd",
1451
+ expected: "(number | undefined)",
1452
+ value: input.arppuAd
1453
+ })].every(flag => flag);
1454
+ const _vo27 = (input, _path, _exceptionable = true) => [undefined === input.fast || "boolean" === typeof input.fast || _report(_exceptionable, {
1455
+ path: _path + ".fast",
1456
+ expected: "(boolean | undefined)",
1457
+ value: input.fast
1458
+ }), undefined === input.eventLog || ("object" === typeof input.eventLog && null !== input.eventLog && false === Array.isArray(input.eventLog) || _report(_exceptionable, {
1459
+ path: _path + ".eventLog",
1460
+ expected: "(Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined)",
1461
+ value: input.eventLog
1462
+ })) && _vo28(input.eventLog, _path + ".eventLog", true && _exceptionable) || _report(_exceptionable, {
1463
+ path: _path + ".eventLog",
1464
+ expected: "(Readonly<{ enabled?: boolean | undefined; maxEvents?: number | undefined; }> | undefined)",
1465
+ value: input.eventLog
1466
+ }), undefined === input.offline || ("object" === typeof input.offline && null !== input.offline && false === Array.isArray(input.offline) || _report(_exceptionable, {
1467
+ path: _path + ".offline",
1468
+ expected: _ve15,
1469
+ value: input.offline
1470
+ })) && _vo29(input.offline, _path + ".offline", true && _exceptionable) || _report(_exceptionable, {
1471
+ path: _path + ".offline",
1472
+ expected: _ve15,
1473
+ value: input.offline
1474
+ })].every(flag => flag);
1475
+ const _vo28 = (input, _path, _exceptionable = true) => [_vp4(input, _path, true && _exceptionable), undefined === input.maxEvents || "number" === typeof input.maxEvents || _report(_exceptionable, {
1476
+ path: _path + ".maxEvents",
1477
+ expected: "(number | undefined)",
1478
+ value: input.maxEvents
1479
+ })].every(flag => flag);
1480
+ const _vo29 = (input, _path, _exceptionable = true) => [undefined === input.maxSec || "number" === typeof input.maxSec || _report(_exceptionable, {
1481
+ path: _path + ".maxSec",
1482
+ expected: "(number | undefined)",
1483
+ value: input.maxSec
1484
+ }), undefined === input.overflowPolicy || "clamp" === input.overflowPolicy || "reject" === input.overflowPolicy || _report(_exceptionable, {
1485
+ path: _path + ".overflowPolicy",
1486
+ expected: "(\"clamp\" | \"reject\" | undefined)",
1487
+ value: input.overflowPolicy
1488
+ }), undefined === input.decay || ("object" === typeof input.decay && null !== input.decay || _report(_exceptionable, {
1489
+ path: _path + ".decay",
1490
+ expected: "(Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined)",
1491
+ value: input.decay
1492
+ })) && _vo30(input.decay, _path + ".decay", true && _exceptionable) || _report(_exceptionable, {
1493
+ path: _path + ".decay",
1494
+ expected: "(Readonly<{ kind: \"linear\" | \"none\"; floorRatio?: number | undefined; }> | undefined)",
1495
+ value: input.decay
1496
+ }), undefined === input.actions || ("object" === typeof input.actions && null !== input.actions || _report(_exceptionable, {
1497
+ path: _path + ".actions",
1498
+ expected: _ve16,
1499
+ value: input.actions
1500
+ })) && _vu0(input.actions, _path + ".actions", true && _exceptionable) || _report(_exceptionable, {
1501
+ path: _path + ".actions",
1502
+ expected: _ve16,
1503
+ value: input.actions
1504
+ })].every(flag => flag);
1505
+ const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.code || _report(_exceptionable, {
1506
+ path: _path + ".code",
1507
+ expected: "string",
1508
+ value: input.code
1509
+ }), undefined === input.symbol || "string" === typeof input.symbol || _report(_exceptionable, {
1510
+ path: _path + ".symbol",
1511
+ expected: "(string | undefined)",
1512
+ value: input.symbol
1513
+ })].every(flag => flag);
1514
+ const _vo30 = (input, _path, _exceptionable = true) => ["linear" === input.kind || "none" === input.kind || _report(_exceptionable, {
1515
+ path: _path + ".kind",
1516
+ expected: "(\"linear\" | \"none\")",
1517
+ value: input.kind
1518
+ }), undefined === input.floorRatio || "number" === typeof input.floorRatio || _report(_exceptionable, {
1519
+ path: _path + ".floorRatio",
1520
+ expected: "(number | undefined)",
1521
+ value: input.floorRatio
1522
+ })].every(flag => flag);
1523
+ const _vo31 = (input, _path, _exceptionable = true) => ["legacy-all" === input.mode || _report(_exceptionable, {
1524
+ path: _path + ".mode",
1525
+ expected: "\"legacy-all\"",
1526
+ value: input.mode
1527
+ })].every(flag => flag);
1528
+ const _vo32 = (input, _path, _exceptionable = true) => ["none" === input.mode || _report(_exceptionable, {
1529
+ path: _path + ".mode",
1530
+ expected: "\"none\"",
1531
+ value: input.mode
1532
+ })].every(flag => flag);
1533
+ const _vo33 = (input, _path, _exceptionable = true) => ["allow" === input.mode || _report(_exceptionable, {
1534
+ path: _path + ".mode",
1535
+ expected: "\"allow\"",
1536
+ value: input.mode
1537
+ }), (Array.isArray(input.categories) || _report(_exceptionable, {
1538
+ path: _path + ".categories",
1539
+ expected: "ReadonlyArray<OfflineActionCategory>",
1540
+ value: input.categories
1541
+ })) && input.categories.map((elem, _index9) => "buy" === elem || "custom" === elem || "grant" === elem || "prestige" === elem || _report(_exceptionable, {
1542
+ path: _path + ".categories[" + _index9 + "]",
1543
+ expected: "(\"buy\" | \"custom\" | \"grant\" | \"prestige\")",
1544
+ value: elem
1545
+ })).every(flag => flag) || _report(_exceptionable, {
1546
+ path: _path + ".categories",
1547
+ expected: "ReadonlyArray<OfflineActionCategory>",
1548
+ value: input.categories
1549
+ }), undefined === input.actors || (Array.isArray(input.actors) || _report(_exceptionable, {
1550
+ path: _path + ".actors",
1551
+ expected: "(ReadonlyArray<OfflineActor> | undefined)",
1552
+ value: input.actors
1553
+ })) && input.actors.map((elem, _index10) => "automation" === elem || "player" === elem || _report(_exceptionable, {
1554
+ path: _path + ".actors[" + _index10 + "]",
1555
+ expected: "(\"automation\" | \"player\")",
1556
+ value: elem
1557
+ })).every(flag => flag) || _report(_exceptionable, {
1558
+ path: _path + ".actors",
1559
+ expected: "(ReadonlyArray<OfflineActor> | undefined)",
1560
+ value: input.actors
1561
+ })].every(flag => flag);
1562
+ const _vo34 = (input, _path, _exceptionable = true) => [undefined === input.format || "csv" === input.format || "json" === input.format || "md" === input.format || _report(_exceptionable, {
1563
+ path: _path + ".format",
1564
+ expected: "(\"csv\" | \"json\" | \"md\" | undefined)",
1565
+ value: input.format
1566
+ }), undefined === input.outPath || "string" === typeof input.outPath || _report(_exceptionable, {
1567
+ path: _path + ".outPath",
1568
+ expected: "(string | undefined)",
1569
+ value: input.outPath
1570
+ }), undefined === input.report || ("object" === typeof input.report && null !== input.report && false === Array.isArray(input.report) || _report(_exceptionable, {
1571
+ path: _path + ".report",
1572
+ expected: _ve17,
1573
+ value: input.report
1574
+ })) && _vo35(input.report, _path + ".report", true && _exceptionable) || _report(_exceptionable, {
1575
+ path: _path + ".report",
1576
+ expected: _ve17,
1577
+ value: input.report
1578
+ }), undefined === input.assertions || (Array.isArray(input.assertions) || _report(_exceptionable, {
1579
+ path: _path + ".assertions",
1580
+ expected: "(readonly { expr: string; severity?: \"error\" | \"warn\" | undefined; }[] | undefined)",
1581
+ value: input.assertions
1582
+ })) && input.assertions.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1583
+ path: _path + ".assertions[" + _index11 + "]",
1584
+ expected: "{ expr: string; severity?: \"error\" | \"warn\" | undefined; }",
1585
+ value: elem
1586
+ })) && _vo36(elem, _path + ".assertions[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1587
+ path: _path + ".assertions[" + _index11 + "]",
1588
+ expected: "{ expr: string; severity?: \"error\" | \"warn\" | undefined; }",
1589
+ value: elem
1590
+ })).every(flag => flag) || _report(_exceptionable, {
1591
+ path: _path + ".assertions",
1592
+ expected: "(readonly { expr: string; severity?: \"error\" | \"warn\" | undefined; }[] | undefined)",
1593
+ value: input.assertions
1594
+ })].every(flag => flag);
1595
+ const _vo35 = (input, _path, _exceptionable = true) => [undefined === input.checkpointsSec || (Array.isArray(input.checkpointsSec) || _report(_exceptionable, {
1596
+ path: _path + ".checkpointsSec",
1597
+ expected: "(Array<number> | undefined)",
1598
+ value: input.checkpointsSec
1599
+ })) && input.checkpointsSec.map((elem, _index12) => "number" === typeof elem || _report(_exceptionable, {
1600
+ path: _path + ".checkpointsSec[" + _index12 + "]",
1601
+ expected: "number",
1602
+ value: elem
1603
+ })).every(flag => flag) || _report(_exceptionable, {
1604
+ path: _path + ".checkpointsSec",
1605
+ expected: "(Array<number> | undefined)",
1606
+ value: input.checkpointsSec
1607
+ }), undefined === input.includeTrace || "boolean" === typeof input.includeTrace || _report(_exceptionable, {
1608
+ path: _path + ".includeTrace",
1609
+ expected: "(boolean | undefined)",
1610
+ value: input.includeTrace
1611
+ }), undefined === input.traceEverySteps || "number" === typeof input.traceEverySteps || _report(_exceptionable, {
1612
+ path: _path + ".traceEverySteps",
1613
+ expected: "(number | undefined)",
1614
+ value: input.traceEverySteps
1615
+ }), undefined === input.includeGrowth || "boolean" === typeof input.includeGrowth || _report(_exceptionable, {
1616
+ path: _path + ".includeGrowth",
1617
+ expected: "(boolean | undefined)",
1618
+ value: input.includeGrowth
1619
+ }), undefined === input.includeUX || "boolean" === typeof input.includeUX || _report(_exceptionable, {
1620
+ path: _path + ".includeUX",
1621
+ expected: "(boolean | undefined)",
1622
+ value: input.includeUX
1623
+ })].every(flag => flag);
1624
+ const _vo36 = (input, _path, _exceptionable = true) => ["string" === typeof input.expr || _report(_exceptionable, {
1625
+ path: _path + ".expr",
1626
+ expected: "string",
1627
+ value: input.expr
1628
+ }), undefined === input.severity || "error" === input.severity || "warn" === input.severity || _report(_exceptionable, {
1629
+ path: _path + ".severity",
1630
+ expected: "(\"error\" | \"warn\" | undefined)",
1631
+ value: input.severity
1632
+ })].every(flag => flag);
1633
+ const _vo4 = (input, _path, _exceptionable = true) => ["accumulate" === input.mode || "drop" === input.mode || _report(_exceptionable, {
1634
+ path: _path + ".mode",
1635
+ expected: "(\"accumulate\" | \"drop\")",
1636
+ value: input.mode
1637
+ }), undefined === input.maxLogGap || "number" === typeof input.maxLogGap || _report(_exceptionable, {
1638
+ path: _path + ".maxLogGap",
1639
+ expected: "(number | undefined)",
1640
+ value: input.maxLogGap
1641
+ })].every(flag => flag);
1642
+ const _vo5 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), "number" === typeof input.version || _report(_exceptionable, {
1643
+ path: _path + ".version",
1644
+ expected: "number",
1645
+ value: input.version
1646
+ }), _vp1(input, _path, true && _exceptionable)].every(flag => flag);
1647
+ const _vo6 = (input, _path, _exceptionable = true) => [undefined === input.t || "number" === typeof input.t || _report(_exceptionable, {
1648
+ path: _path + ".t",
1649
+ expected: "(number | undefined)",
1650
+ value: input.t
1651
+ }), ("object" === typeof input.wallet && null !== input.wallet || _report(_exceptionable, {
1652
+ path: _path + ".wallet",
1653
+ expected: "Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>",
1654
+ value: input.wallet
1655
+ })) && _vo7(input.wallet, _path + ".wallet", true && _exceptionable) || _report(_exceptionable, {
1656
+ path: _path + ".wallet",
1657
+ expected: "Readonly<{ unit: string; amount: string; bucket?: string | undefined; }>",
1658
+ value: input.wallet
1659
+ }), undefined === input.maxMoneyEver || "string" === typeof input.maxMoneyEver || _report(_exceptionable, {
1660
+ path: _path + ".maxMoneyEver",
1661
+ expected: "(string | undefined)",
1662
+ value: input.maxMoneyEver
1663
+ }), undefined === input.prestige || ("object" === typeof input.prestige && null !== input.prestige && false === Array.isArray(input.prestige) || _report(_exceptionable, {
1664
+ path: _path + ".prestige",
1665
+ expected: "(Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined)",
1666
+ value: input.prestige
1667
+ })) && _vo8(input.prestige, _path + ".prestige", true && _exceptionable) || _report(_exceptionable, {
1668
+ path: _path + ".prestige",
1669
+ expected: "(Readonly<{ count?: number | undefined; points?: string | undefined; multiplier?: string | undefined; }> | undefined)",
1670
+ value: input.prestige
1671
+ }), true].every(flag => flag);
1672
+ const _vo7 = (input, _path, _exceptionable = true) => ["string" === typeof input.unit || _report(_exceptionable, {
1673
+ path: _path + ".unit",
1674
+ expected: "string",
1675
+ value: input.unit
1676
+ }), "string" === typeof input.amount || _report(_exceptionable, {
1677
+ path: _path + ".amount",
1678
+ expected: "string",
1679
+ value: input.amount
1680
+ }), undefined === input.bucket || "string" === typeof input.bucket || _report(_exceptionable, {
1681
+ path: _path + ".bucket",
1682
+ expected: "(string | undefined)",
1683
+ value: input.bucket
1684
+ })].every(flag => flag);
1685
+ const _vo8 = (input, _path, _exceptionable = true) => [undefined === input.count || "number" === typeof input.count || _report(_exceptionable, {
1686
+ path: _path + ".count",
1687
+ expected: "(number | undefined)",
1688
+ value: input.count
1689
+ }), undefined === input.points || "string" === typeof input.points || _report(_exceptionable, {
1690
+ path: _path + ".points",
1691
+ expected: "(string | undefined)",
1692
+ value: input.points
1693
+ }), undefined === input.multiplier || "string" === typeof input.multiplier || _report(_exceptionable, {
1694
+ path: _path + ".multiplier",
1695
+ expected: "(string | undefined)",
1696
+ value: input.multiplier
1697
+ })].every(flag => flag);
1698
+ const _vo9 = (input, _path, _exceptionable = true) => ["number" === typeof input.stepSec || _report(_exceptionable, {
1699
+ path: _path + ".stepSec",
1700
+ expected: "number",
1701
+ value: input.stepSec
1702
+ }), undefined === input.durationSec || "number" === typeof input.durationSec || _report(_exceptionable, {
1703
+ path: _path + ".durationSec",
1704
+ expected: "(number | undefined)",
1705
+ value: input.durationSec
1706
+ }), undefined === input.untilExpr || "string" === typeof input.untilExpr || _report(_exceptionable, {
1707
+ path: _path + ".untilExpr",
1708
+ expected: "(string | undefined)",
1709
+ value: input.untilExpr
1710
+ })].every(flag => flag);
1711
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
1712
+ if ("none" === input.mode)
1713
+ return _vo32(input, _path, true && _exceptionable);
1714
+ else if ("legacy-all" === input.mode)
1715
+ return _vo31(input, _path, true && _exceptionable);
1716
+ else if ("allow" === input.mode)
1717
+ return _vo33(input, _path, true && _exceptionable);
1718
+ else
1719
+ return _report(_exceptionable, {
1720
+ path: _path,
1721
+ expected: _ve18,
1722
+ value: input
1723
+ });
1724
+ })();
1725
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
1726
+ let errors;
1727
+ let _report;
1728
+ const __validate = input => {
1729
+ if (false === __is(input)) {
1730
+ errors = [];
1731
+ _report = _validateReport_1._validateReport(errors);
1732
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1733
+ path: _path + "",
1734
+ expected: _ve0,
1735
+ value: input
1736
+ })) && _vo0(input, _path + "", true) || _report(true, {
1737
+ path: _path + "",
1738
+ expected: _ve0,
1739
+ value: input
1740
+ }))(input, "$input", true);
1741
+ const success = 0 === errors.length;
1742
+ return success ? {
1743
+ success,
1744
+ data: input
1745
+ } : {
1746
+ success,
1747
+ errors,
1748
+ data: input
1749
+ };
1750
+ }
1751
+ return {
1752
+ success: true,
1753
+ data: input
1754
+ };
1755
+ };
1756
+ return input => __validate(JSON.parse(input));
1757
+ })()(input);
1758
+ }
1759
+ let scenarioJsonSchemaUnit;
1760
+ function buildScenarioJsonSchema() {
1761
+ return {
1762
+ components: {
1763
+ schemas: {
1764
+ "ReadonlyschemaVersion1metaReadonlyidstringundefinedtitlestringundefineddescriptionstringundefinedtagsstringundefinedundefinedengineReadonly---undefined---11more---outputsReadonly---undefined": {
1765
+ type: "object",
1766
+ properties: {
1767
+ schemaVersion: {
1768
+ "const": 1
1769
+ },
1770
+ meta: {
1771
+ $ref: "#/components/schemas/Readonlyidstringundefinedtitlestringundefineddescriptionstringundefinedtagsstringundefined"
1772
+ },
1773
+ engine: {
1774
+ $ref: "#/components/schemas/Readonlynamestringversionstringundefined"
1775
+ },
1776
+ unit: {
1777
+ $ref: "#/components/schemas/Readonlycodestringsymbolstringundefined"
1778
+ },
1779
+ policy: {
1780
+ $ref: "#/components/schemas/ReadonlymodeaccumulatedropmaxLogGapnumberundefined"
1781
+ },
1782
+ model: {
1783
+ $ref: "#/components/schemas/Readonlyidstringversionnumberparamsunknown"
1784
+ },
1785
+ initial: {
1786
+ $ref: "#/components/schemas/ReadonlytnumberundefinedwalletReadonlyunitstringamountstringbucketstringundefinedmaxMoneyEverstringundefinedprestigeReadonlycountnumberundefinedpointsstringundefinedmultiplierstringundefinedundefinedvarsunknown"
1787
+ },
1788
+ clock: {
1789
+ $ref: "#/components/schemas/ReadonlystepSecnumberdurationSecnumberundefineduntilExprstringundefined"
1790
+ },
1791
+ strategy: {
1792
+ $ref: "#/components/schemas/Readonlyidstringparamsunknown"
1793
+ },
1794
+ design: {
1795
+ $ref: "#/components/schemas/Readonlyintentfrequent-progressionscale-fantasystrategic-optimizationundefinedsessionPatternReadonlyidalways-onoffline-heavyshort-burststwice-dailyweekend-marathondaysnumberundefinedundefined"
1796
+ },
1797
+ constraints: {
1798
+ $ref: "#/components/schemas/ReadonlymaxActionsPerStepnumberundefinedminPrestigeIntervalSecnumberundefined"
1799
+ },
1800
+ analysis: {
1801
+ $ref: "#/components/schemas/ReadonlyetaReadonlymodeanalyticsimulateundefinedundefinedprestigeCycleReadonlyscanstringundefinedstepSecnumberundefinedcyclesnumberundefinedundefinedgrowthReadonly---undefinedexperienceReadonly---undefined"
1802
+ },
1803
+ monetization: {
1804
+ $ref: "#/components/schemas/ReadonlycohortsReadonlybaseUsersnumberundefinedundefinedretentionReadonlyd1numberundefinedd7numberundefinedd30numberundefinedd90numberundefinedlongTailDailyDecaynumberundefinedundefinedrevenueReadonly---undefinedacquisitionRead---"
1805
+ },
1806
+ sim: {
1807
+ $ref: "#/components/schemas/ReadonlyfastbooleanundefinedeventLogReadonlyenabledbooleanundefinedmaxEventsnumberundefinedundefinedofflineReadonlymaxSecnumberundefinedoverflowPolicyclamp---1more---undefineddecayReadonly---undefinedactionsOfflineActionPolicyundef---"
1808
+ },
1809
+ outputs: {
1810
+ $ref: "#/components/schemas/ReadonlyformatcsvjsonmdundefinedoutPathstringundefinedreportReadonlycheckpointsSecnumberundefinedincludeTracebooleanundefinedtraceEveryStepsnumberundefinedincludeGrowthbooleanundefinedincludeUXbooleanundefinedundefinedassertions---"
1811
+ }
1812
+ },
1813
+ required: [
1814
+ "schemaVersion",
1815
+ "unit",
1816
+ "policy",
1817
+ "model",
1818
+ "initial",
1819
+ "clock"
1820
+ ],
1821
+ additionalProperties: false
1822
+ },
1823
+ Readonlyidstringundefinedtitlestringundefineddescriptionstringundefinedtagsstringundefined: {
1824
+ type: "object",
1825
+ properties: {
1826
+ id: {
1827
+ type: "string"
1828
+ },
1829
+ title: {
1830
+ type: "string"
1831
+ },
1832
+ description: {
1833
+ type: "string"
1834
+ },
1835
+ tags: {
1836
+ type: "array",
1837
+ items: {
1838
+ type: "string"
1839
+ }
1840
+ }
1841
+ },
1842
+ required: [],
1843
+ additionalProperties: false
1844
+ },
1845
+ Readonlynamestringversionstringundefined: {
1846
+ type: "object",
1847
+ properties: {
1848
+ name: {
1849
+ type: "string"
1850
+ },
1851
+ version: {
1852
+ type: "string"
1853
+ }
1854
+ },
1855
+ required: [
1856
+ "name"
1857
+ ],
1858
+ additionalProperties: false
1859
+ },
1860
+ Readonlycodestringsymbolstringundefined: {
1861
+ type: "object",
1862
+ properties: {
1863
+ code: {
1864
+ type: "string"
1865
+ },
1866
+ symbol: {
1867
+ type: "string"
1868
+ }
1869
+ },
1870
+ required: [
1871
+ "code"
1872
+ ],
1873
+ additionalProperties: false
1874
+ },
1875
+ ReadonlymodeaccumulatedropmaxLogGapnumberundefined: {
1876
+ type: "object",
1877
+ properties: {
1878
+ mode: {
1879
+ oneOf: [
1880
+ {
1881
+ "const": "accumulate"
1882
+ },
1883
+ {
1884
+ "const": "drop"
1885
+ }
1886
+ ]
1887
+ },
1888
+ maxLogGap: {
1889
+ type: "number"
1890
+ }
1891
+ },
1892
+ required: [
1893
+ "mode"
1894
+ ],
1895
+ additionalProperties: false
1896
+ },
1897
+ Readonlyidstringversionnumberparamsunknown: {
1898
+ type: "object",
1899
+ properties: {
1900
+ id: {
1901
+ type: "string"
1902
+ },
1903
+ version: {
1904
+ type: "number"
1905
+ },
1906
+ params: {}
1907
+ },
1908
+ required: [
1909
+ "id",
1910
+ "version"
1911
+ ],
1912
+ additionalProperties: false
1913
+ },
1914
+ ReadonlytnumberundefinedwalletReadonlyunitstringamountstringbucketstringundefinedmaxMoneyEverstringundefinedprestigeReadonlycountnumberundefinedpointsstringundefinedmultiplierstringundefinedundefinedvarsunknown: {
1915
+ type: "object",
1916
+ properties: {
1917
+ t: {
1918
+ type: "number"
1919
+ },
1920
+ wallet: {
1921
+ $ref: "#/components/schemas/Readonlyunitstringamountstringbucketstringundefined"
1922
+ },
1923
+ maxMoneyEver: {
1924
+ type: "string"
1925
+ },
1926
+ prestige: {
1927
+ $ref: "#/components/schemas/Readonlycountnumberundefinedpointsstringundefinedmultiplierstringundefined"
1928
+ },
1929
+ vars: {}
1930
+ },
1931
+ required: [
1932
+ "wallet"
1933
+ ],
1934
+ additionalProperties: false
1935
+ },
1936
+ Readonlyunitstringamountstringbucketstringundefined: {
1937
+ type: "object",
1938
+ properties: {
1939
+ unit: {
1940
+ type: "string"
1941
+ },
1942
+ amount: {
1943
+ type: "string"
1944
+ },
1945
+ bucket: {
1946
+ type: "string"
1947
+ }
1948
+ },
1949
+ required: [
1950
+ "unit",
1951
+ "amount"
1952
+ ],
1953
+ additionalProperties: false
1954
+ },
1955
+ Readonlycountnumberundefinedpointsstringundefinedmultiplierstringundefined: {
1956
+ type: "object",
1957
+ properties: {
1958
+ count: {
1959
+ type: "number"
1960
+ },
1961
+ points: {
1962
+ type: "string"
1963
+ },
1964
+ multiplier: {
1965
+ type: "string"
1966
+ }
1967
+ },
1968
+ required: [],
1969
+ additionalProperties: false
1970
+ },
1971
+ ReadonlystepSecnumberdurationSecnumberundefineduntilExprstringundefined: {
1972
+ type: "object",
1973
+ properties: {
1974
+ stepSec: {
1975
+ type: "number"
1976
+ },
1977
+ durationSec: {
1978
+ type: "number"
1979
+ },
1980
+ untilExpr: {
1981
+ type: "string"
1982
+ }
1983
+ },
1984
+ required: [
1985
+ "stepSec"
1986
+ ],
1987
+ additionalProperties: false
1988
+ },
1989
+ Readonlyidstringparamsunknown: {
1990
+ type: "object",
1991
+ properties: {
1992
+ id: {
1993
+ type: "string"
1994
+ },
1995
+ params: {}
1996
+ },
1997
+ required: [
1998
+ "id"
1999
+ ],
2000
+ additionalProperties: false
2001
+ },
2002
+ "Readonlyintentfrequent-progressionscale-fantasystrategic-optimizationundefinedsessionPatternReadonlyidalways-onoffline-heavyshort-burststwice-dailyweekend-marathondaysnumberundefinedundefined": {
2003
+ type: "object",
2004
+ properties: {
2005
+ intent: {
2006
+ oneOf: [
2007
+ {
2008
+ "const": "frequent-progression"
2009
+ },
2010
+ {
2011
+ "const": "scale-fantasy"
2012
+ },
2013
+ {
2014
+ "const": "strategic-optimization"
2015
+ }
2016
+ ]
2017
+ },
2018
+ sessionPattern: {
2019
+ $ref: "#/components/schemas/Readonlyidalways-onoffline-heavyshort-burststwice-dailyweekend-marathondaysnumberundefined"
2020
+ }
2021
+ },
2022
+ required: [],
2023
+ additionalProperties: false
2024
+ },
2025
+ "Readonlyidalways-onoffline-heavyshort-burststwice-dailyweekend-marathondaysnumberundefined": {
2026
+ type: "object",
2027
+ properties: {
2028
+ id: {
2029
+ oneOf: [
2030
+ {
2031
+ "const": "always-on"
2032
+ },
2033
+ {
2034
+ "const": "offline-heavy"
2035
+ },
2036
+ {
2037
+ "const": "short-bursts"
2038
+ },
2039
+ {
2040
+ "const": "twice-daily"
2041
+ },
2042
+ {
2043
+ "const": "weekend-marathon"
2044
+ }
2045
+ ]
2046
+ },
2047
+ days: {
2048
+ type: "number"
2049
+ }
2050
+ },
2051
+ required: [
2052
+ "id"
2053
+ ],
2054
+ additionalProperties: false
2055
+ },
2056
+ ReadonlymaxActionsPerStepnumberundefinedminPrestigeIntervalSecnumberundefined: {
2057
+ type: "object",
2058
+ properties: {
2059
+ maxActionsPerStep: {
2060
+ type: "number"
2061
+ },
2062
+ minPrestigeIntervalSec: {
2063
+ type: "number"
2064
+ }
2065
+ },
2066
+ required: [],
2067
+ additionalProperties: false
2068
+ },
2069
+ "ReadonlyetaReadonlymodeanalyticsimulateundefinedundefinedprestigeCycleReadonlyscanstringundefinedstepSecnumberundefinedcyclesnumberundefinedundefinedgrowthReadonly---undefinedexperienceReadonly---undefined": {
2070
+ type: "object",
2071
+ properties: {
2072
+ eta: {
2073
+ $ref: "#/components/schemas/Readonlymodeanalyticsimulateundefined"
2074
+ },
2075
+ prestigeCycle: {
2076
+ $ref: "#/components/schemas/ReadonlyscanstringundefinedstepSecnumberundefinedcyclesnumberundefined"
2077
+ },
2078
+ growth: {
2079
+ $ref: "#/components/schemas/ReadonlywindowSecnumberundefined"
2080
+ },
2081
+ experience: {
2082
+ $ref: "#/components/schemas/ReadonlyseriesmoneynetWorthundefineddrawsnumberundefinedquantilesnumberundefined"
2083
+ }
2084
+ },
2085
+ required: [],
2086
+ additionalProperties: false
2087
+ },
2088
+ Readonlymodeanalyticsimulateundefined: {
2089
+ type: "object",
2090
+ properties: {
2091
+ mode: {
2092
+ oneOf: [
2093
+ {
2094
+ "const": "analytic"
2095
+ },
2096
+ {
2097
+ "const": "simulate"
2098
+ }
2099
+ ]
2100
+ }
2101
+ },
2102
+ required: [],
2103
+ additionalProperties: false
2104
+ },
2105
+ ReadonlyscanstringundefinedstepSecnumberundefinedcyclesnumberundefined: {
2106
+ type: "object",
2107
+ properties: {
2108
+ scan: {
2109
+ type: "string"
2110
+ },
2111
+ stepSec: {
2112
+ type: "number"
2113
+ },
2114
+ cycles: {
2115
+ type: "number"
2116
+ }
2117
+ },
2118
+ required: [],
2119
+ additionalProperties: false
2120
+ },
2121
+ ReadonlywindowSecnumberundefined: {
2122
+ type: "object",
2123
+ properties: {
2124
+ windowSec: {
2125
+ type: "number"
2126
+ }
2127
+ },
2128
+ required: [],
2129
+ additionalProperties: false
2130
+ },
2131
+ ReadonlyseriesmoneynetWorthundefineddrawsnumberundefinedquantilesnumberundefined: {
2132
+ type: "object",
2133
+ properties: {
2134
+ series: {
2135
+ oneOf: [
2136
+ {
2137
+ "const": "money"
2138
+ },
2139
+ {
2140
+ "const": "netWorth"
2141
+ }
2142
+ ]
2143
+ },
2144
+ draws: {
2145
+ type: "number"
2146
+ },
2147
+ quantiles: {
2148
+ type: "array",
2149
+ items: {
2150
+ type: "number"
2151
+ }
2152
+ }
2153
+ },
2154
+ required: [],
2155
+ additionalProperties: false
2156
+ },
2157
+ "ReadonlycohortsReadonlybaseUsersnumberundefinedundefinedretentionReadonlyd1numberundefinedd7numberundefinedd30numberundefinedd90numberundefinedlongTailDailyDecaynumberundefinedundefinedrevenueReadonly---undefinedacquisitionRead---": {
2158
+ type: "object",
2159
+ properties: {
2160
+ cohorts: {
2161
+ $ref: "#/components/schemas/ReadonlybaseUsersnumberundefined"
2162
+ },
2163
+ retention: {
2164
+ $ref: "#/components/schemas/Readonlyd1numberundefinedd7numberundefinedd30numberundefinedd90numberundefinedlongTailDailyDecaynumberundefined"
2165
+ },
2166
+ revenue: {
2167
+ $ref: "#/components/schemas/ReadonlypayerConversionnumberundefinedarppuDailynumberundefinedadArpDaunumberundefinedplatformFeeRatenumberundefinedgrossMarginRatenumberundefinedprogressionRevenueLiftnumberundefinedprogressionLogSpannumberundefined"
2168
+ },
2169
+ acquisition: {
2170
+ $ref: "#/components/schemas/Readonlycpinumberundefined"
2171
+ },
2172
+ uncertainty: {
2173
+ $ref: "#/components/schemas/ReadonlyenabledbooleanundefineddrawsnumberundefinedquantilesnumberundefinedseednumberundefinedsigmaReadonlyretentionnumberundefinedconversionnumberundefinedarppunumberundefinedadnumberundefinedundefinedcorrelationReadonly---und---"
2174
+ }
2175
+ },
2176
+ required: [],
2177
+ additionalProperties: false
2178
+ },
2179
+ ReadonlybaseUsersnumberundefined: {
2180
+ type: "object",
2181
+ properties: {
2182
+ baseUsers: {
2183
+ type: "number"
2184
+ }
2185
+ },
2186
+ required: [],
2187
+ additionalProperties: false
2188
+ },
2189
+ Readonlyd1numberundefinedd7numberundefinedd30numberundefinedd90numberundefinedlongTailDailyDecaynumberundefined: {
2190
+ type: "object",
2191
+ properties: {
2192
+ d1: {
2193
+ type: "number"
2194
+ },
2195
+ d7: {
2196
+ type: "number"
2197
+ },
2198
+ d30: {
2199
+ type: "number"
2200
+ },
2201
+ d90: {
2202
+ type: "number"
2203
+ },
2204
+ longTailDailyDecay: {
2205
+ type: "number"
2206
+ }
2207
+ },
2208
+ required: [],
2209
+ additionalProperties: false
2210
+ },
2211
+ ReadonlypayerConversionnumberundefinedarppuDailynumberundefinedadArpDaunumberundefinedplatformFeeRatenumberundefinedgrossMarginRatenumberundefinedprogressionRevenueLiftnumberundefinedprogressionLogSpannumberundefined: {
2212
+ type: "object",
2213
+ properties: {
2214
+ payerConversion: {
2215
+ type: "number"
2216
+ },
2217
+ arppuDaily: {
2218
+ type: "number"
2219
+ },
2220
+ adArpDau: {
2221
+ type: "number"
2222
+ },
2223
+ platformFeeRate: {
2224
+ type: "number"
2225
+ },
2226
+ grossMarginRate: {
2227
+ type: "number"
2228
+ },
2229
+ progressionRevenueLift: {
2230
+ type: "number"
2231
+ },
2232
+ progressionLogSpan: {
2233
+ type: "number"
2234
+ }
2235
+ },
2236
+ required: [],
2237
+ additionalProperties: false
2238
+ },
2239
+ Readonlycpinumberundefined: {
2240
+ type: "object",
2241
+ properties: {
2242
+ cpi: {
2243
+ type: "number"
2244
+ }
2245
+ },
2246
+ required: [],
2247
+ additionalProperties: false
2248
+ },
2249
+ "ReadonlyenabledbooleanundefineddrawsnumberundefinedquantilesnumberundefinedseednumberundefinedsigmaReadonlyretentionnumberundefinedconversionnumberundefinedarppunumberundefinedadnumberundefinedundefinedcorrelationReadonly---und---": {
2250
+ type: "object",
2251
+ properties: {
2252
+ enabled: {
2253
+ type: "boolean"
2254
+ },
2255
+ draws: {
2256
+ type: "number"
2257
+ },
2258
+ quantiles: {
2259
+ type: "array",
2260
+ items: {
2261
+ type: "number"
2262
+ }
2263
+ },
2264
+ seed: {
2265
+ type: "number"
2266
+ },
2267
+ sigma: {
2268
+ $ref: "#/components/schemas/Readonlyretentionnumberundefinedconversionnumberundefinedarppunumberundefinedadnumberundefined"
2269
+ },
2270
+ correlation: {
2271
+ $ref: "#/components/schemas/ReadonlyretentionConversionnumberundefinedretentionArppunumberundefinedretentionAdnumberundefinedconversionArppunumberundefinedconversionAdnumberundefinedarppuAdnumberundefined"
2272
+ }
2273
+ },
2274
+ required: [],
2275
+ additionalProperties: false
2276
+ },
2277
+ Readonlyretentionnumberundefinedconversionnumberundefinedarppunumberundefinedadnumberundefined: {
2278
+ type: "object",
2279
+ properties: {
2280
+ retention: {
2281
+ type: "number"
2282
+ },
2283
+ conversion: {
2284
+ type: "number"
2285
+ },
2286
+ arppu: {
2287
+ type: "number"
2288
+ },
2289
+ ad: {
2290
+ type: "number"
2291
+ }
2292
+ },
2293
+ required: [],
2294
+ additionalProperties: false
2295
+ },
2296
+ ReadonlyretentionConversionnumberundefinedretentionArppunumberundefinedretentionAdnumberundefinedconversionArppunumberundefinedconversionAdnumberundefinedarppuAdnumberundefined: {
2297
+ type: "object",
2298
+ properties: {
2299
+ retentionConversion: {
2300
+ type: "number"
2301
+ },
2302
+ retentionArppu: {
2303
+ type: "number"
2304
+ },
2305
+ retentionAd: {
2306
+ type: "number"
2307
+ },
2308
+ conversionArppu: {
2309
+ type: "number"
2310
+ },
2311
+ conversionAd: {
2312
+ type: "number"
2313
+ },
2314
+ arppuAd: {
2315
+ type: "number"
2316
+ }
2317
+ },
2318
+ required: [],
2319
+ additionalProperties: false
2320
+ },
2321
+ "ReadonlyfastbooleanundefinedeventLogReadonlyenabledbooleanundefinedmaxEventsnumberundefinedundefinedofflineReadonlymaxSecnumberundefinedoverflowPolicyclamp---1more---undefineddecayReadonly---undefinedactionsOfflineActionPolicyundef---": {
2322
+ type: "object",
2323
+ properties: {
2324
+ fast: {
2325
+ type: "boolean"
2326
+ },
2327
+ eventLog: {
2328
+ $ref: "#/components/schemas/ReadonlyenabledbooleanundefinedmaxEventsnumberundefined"
2329
+ },
2330
+ offline: {
2331
+ $ref: "#/components/schemas/ReadonlymaxSecnumberundefinedoverflowPolicyclamprejectundefineddecayReadonlykindlinearnonefloorRationumberundefinedundefinedactionsOfflineActionPolicyundefined"
2332
+ }
2333
+ },
2334
+ required: [],
2335
+ additionalProperties: false
2336
+ },
2337
+ ReadonlyenabledbooleanundefinedmaxEventsnumberundefined: {
2338
+ type: "object",
2339
+ properties: {
2340
+ enabled: {
2341
+ type: "boolean"
2342
+ },
2343
+ maxEvents: {
2344
+ type: "number"
2345
+ }
2346
+ },
2347
+ required: [],
2348
+ additionalProperties: false
2349
+ },
2350
+ ReadonlymaxSecnumberundefinedoverflowPolicyclamprejectundefineddecayReadonlykindlinearnonefloorRationumberundefinedundefinedactionsOfflineActionPolicyundefined: {
2351
+ type: "object",
2352
+ properties: {
2353
+ maxSec: {
2354
+ type: "number"
2355
+ },
2356
+ overflowPolicy: {
2357
+ oneOf: [
2358
+ {
2359
+ "const": "clamp"
2360
+ },
2361
+ {
2362
+ "const": "reject"
2363
+ }
2364
+ ]
2365
+ },
2366
+ decay: {
2367
+ $ref: "#/components/schemas/ReadonlykindlinearnonefloorRationumberundefined"
2368
+ },
2369
+ actions: {
2370
+ oneOf: [
2371
+ {
2372
+ $ref: "#/components/schemas/Readonlymodelegacy-all"
2373
+ },
2374
+ {
2375
+ $ref: "#/components/schemas/Readonlymodenone"
2376
+ },
2377
+ {
2378
+ $ref: "#/components/schemas/ReadonlymodeallowcategoriesreadonlyOfflineActionCategoryactorsreadonlyOfflineActorundefined"
2379
+ }
2380
+ ],
2381
+ discriminator: {
2382
+ mapping: {
2383
+ allow: "#/components/schemas/ReadonlymodeallowcategoriesreadonlyOfflineActionCategoryactorsreadonlyOfflineActorundefined",
2384
+ "legacy-all": "#/components/schemas/Readonlymodelegacy-all",
2385
+ none: "#/components/schemas/Readonlymodenone"
2386
+ },
2387
+ propertyName: "mode"
2388
+ }
2389
+ }
2390
+ },
2391
+ required: [],
2392
+ additionalProperties: false
2393
+ },
2394
+ ReadonlykindlinearnonefloorRationumberundefined: {
2395
+ type: "object",
2396
+ properties: {
2397
+ kind: {
2398
+ oneOf: [
2399
+ {
2400
+ "const": "linear"
2401
+ },
2402
+ {
2403
+ "const": "none"
2404
+ }
2405
+ ]
2406
+ },
2407
+ floorRatio: {
2408
+ type: "number",
2409
+ description: "Only used when kind is linear. 0..1"
2410
+ }
2411
+ },
2412
+ required: [
2413
+ "kind"
2414
+ ],
2415
+ additionalProperties: false
2416
+ },
2417
+ "Readonlymodelegacy-all": {
2418
+ type: "object",
2419
+ properties: {
2420
+ mode: {
2421
+ "const": "legacy-all"
2422
+ }
2423
+ },
2424
+ required: [
2425
+ "mode"
2426
+ ],
2427
+ additionalProperties: false
2428
+ },
2429
+ Readonlymodenone: {
2430
+ type: "object",
2431
+ properties: {
2432
+ mode: {
2433
+ "const": "none"
2434
+ }
2435
+ },
2436
+ required: [
2437
+ "mode"
2438
+ ],
2439
+ additionalProperties: false
2440
+ },
2441
+ ReadonlymodeallowcategoriesreadonlyOfflineActionCategoryactorsreadonlyOfflineActorundefined: {
2442
+ type: "object",
2443
+ properties: {
2444
+ mode: {
2445
+ "const": "allow"
2446
+ },
2447
+ categories: {
2448
+ type: "array",
2449
+ items: {
2450
+ $ref: "#/components/schemas/OfflineActionCategory"
2451
+ }
2452
+ },
2453
+ actors: {
2454
+ type: "array",
2455
+ items: {
2456
+ $ref: "#/components/schemas/OfflineActor"
2457
+ }
2458
+ }
2459
+ },
2460
+ required: [
2461
+ "mode",
2462
+ "categories"
2463
+ ],
2464
+ additionalProperties: false
2465
+ },
2466
+ OfflineActionCategory: {
2467
+ oneOf: [
2468
+ {
2469
+ "const": "buy"
2470
+ },
2471
+ {
2472
+ "const": "custom"
2473
+ },
2474
+ {
2475
+ "const": "grant"
2476
+ },
2477
+ {
2478
+ "const": "prestige"
2479
+ }
2480
+ ]
2481
+ },
2482
+ OfflineActor: {
2483
+ oneOf: [
2484
+ {
2485
+ "const": "automation"
2486
+ },
2487
+ {
2488
+ "const": "player"
2489
+ }
2490
+ ]
2491
+ },
2492
+ "ReadonlyformatcsvjsonmdundefinedoutPathstringundefinedreportReadonlycheckpointsSecnumberundefinedincludeTracebooleanundefinedtraceEveryStepsnumberundefinedincludeGrowthbooleanundefinedincludeUXbooleanundefinedundefinedassertions---": {
2493
+ type: "object",
2494
+ properties: {
2495
+ format: {
2496
+ oneOf: [
2497
+ {
2498
+ "const": "csv"
2499
+ },
2500
+ {
2501
+ "const": "json"
2502
+ },
2503
+ {
2504
+ "const": "md"
2505
+ }
2506
+ ]
2507
+ },
2508
+ outPath: {
2509
+ type: "string"
2510
+ },
2511
+ report: {
2512
+ $ref: "#/components/schemas/ReadonlycheckpointsSecnumberundefinedincludeTracebooleanundefinedtraceEveryStepsnumberundefinedincludeGrowthbooleanundefinedincludeUXbooleanundefined"
2513
+ },
2514
+ assertions: {
2515
+ type: "array",
2516
+ items: {
2517
+ type: "object",
2518
+ properties: {
2519
+ expr: {
2520
+ type: "string"
2521
+ },
2522
+ severity: {
2523
+ oneOf: [
2524
+ {
2525
+ "const": "error"
2526
+ },
2527
+ {
2528
+ "const": "warn"
2529
+ }
2530
+ ]
2531
+ }
2532
+ },
2533
+ required: [
2534
+ "expr"
2535
+ ],
2536
+ additionalProperties: false
2537
+ }
2538
+ }
2539
+ },
2540
+ required: [],
2541
+ additionalProperties: false
2542
+ },
2543
+ ReadonlycheckpointsSecnumberundefinedincludeTracebooleanundefinedtraceEveryStepsnumberundefinedincludeGrowthbooleanundefinedincludeUXbooleanundefined: {
2544
+ type: "object",
2545
+ properties: {
2546
+ checkpointsSec: {
2547
+ type: "array",
2548
+ items: {
2549
+ type: "number"
2550
+ }
2551
+ },
2552
+ includeTrace: {
2553
+ type: "boolean"
2554
+ },
2555
+ traceEverySteps: {
2556
+ type: "number"
2557
+ },
2558
+ includeGrowth: {
2559
+ type: "boolean"
2560
+ },
2561
+ includeUX: {
2562
+ type: "boolean"
2563
+ }
2564
+ },
2565
+ required: [],
2566
+ additionalProperties: false
2567
+ }
2568
+ }
2569
+ },
2570
+ schema: {
2571
+ type: "object",
2572
+ properties: {
2573
+ schemaVersion: {
2574
+ "const": 1
2575
+ },
2576
+ meta: {
2577
+ $ref: "#/components/schemas/Readonlyidstringundefinedtitlestringundefineddescriptionstringundefinedtagsstringundefined"
2578
+ },
2579
+ engine: {
2580
+ $ref: "#/components/schemas/Readonlynamestringversionstringundefined"
2581
+ },
2582
+ unit: {
2583
+ $ref: "#/components/schemas/Readonlycodestringsymbolstringundefined"
2584
+ },
2585
+ policy: {
2586
+ $ref: "#/components/schemas/ReadonlymodeaccumulatedropmaxLogGapnumberundefined"
2587
+ },
2588
+ model: {
2589
+ $ref: "#/components/schemas/Readonlyidstringversionnumberparamsunknown"
2590
+ },
2591
+ initial: {
2592
+ $ref: "#/components/schemas/ReadonlytnumberundefinedwalletReadonlyunitstringamountstringbucketstringundefinedmaxMoneyEverstringundefinedprestigeReadonlycountnumberundefinedpointsstringundefinedmultiplierstringundefinedundefinedvarsunknown"
2593
+ },
2594
+ clock: {
2595
+ $ref: "#/components/schemas/ReadonlystepSecnumberdurationSecnumberundefineduntilExprstringundefined"
2596
+ },
2597
+ strategy: {
2598
+ $ref: "#/components/schemas/Readonlyidstringparamsunknown"
2599
+ },
2600
+ design: {
2601
+ $ref: "#/components/schemas/Readonlyintentfrequent-progressionscale-fantasystrategic-optimizationundefinedsessionPatternReadonlyidalways-onoffline-heavyshort-burststwice-dailyweekend-marathondaysnumberundefinedundefined"
2602
+ },
2603
+ constraints: {
2604
+ $ref: "#/components/schemas/ReadonlymaxActionsPerStepnumberundefinedminPrestigeIntervalSecnumberundefined"
2605
+ },
2606
+ analysis: {
2607
+ $ref: "#/components/schemas/ReadonlyetaReadonlymodeanalyticsimulateundefinedundefinedprestigeCycleReadonlyscanstringundefinedstepSecnumberundefinedcyclesnumberundefinedundefinedgrowthReadonly---undefinedexperienceReadonly---undefined"
2608
+ },
2609
+ monetization: {
2610
+ $ref: "#/components/schemas/ReadonlycohortsReadonlybaseUsersnumberundefinedundefinedretentionReadonlyd1numberundefinedd7numberundefinedd30numberundefinedd90numberundefinedlongTailDailyDecaynumberundefinedundefinedrevenueReadonly---undefinedacquisitionRead---"
2611
+ },
2612
+ sim: {
2613
+ $ref: "#/components/schemas/ReadonlyfastbooleanundefinedeventLogReadonlyenabledbooleanundefinedmaxEventsnumberundefinedundefinedofflineReadonlymaxSecnumberundefinedoverflowPolicyclamp---1more---undefineddecayReadonly---undefinedactionsOfflineActionPolicyundef---"
2614
+ },
2615
+ outputs: {
2616
+ $ref: "#/components/schemas/ReadonlyformatcsvjsonmdundefinedoutPathstringundefinedreportReadonlycheckpointsSecnumberundefinedincludeTracebooleanundefinedtraceEveryStepsnumberundefinedincludeGrowthbooleanundefinedincludeUXbooleanundefinedundefinedassertions---"
2617
+ }
2618
+ },
2619
+ required: [
2620
+ "schemaVersion",
2621
+ "unit",
2622
+ "policy",
2623
+ "model",
2624
+ "initial",
2625
+ "clock"
2626
+ ],
2627
+ additionalProperties: false
2628
+ },
2629
+ version: "3.1"
2630
+ };
2631
+ }
2632
+ function scenarioJsonSchema() {
2633
+ scenarioJsonSchemaUnit ??= buildScenarioJsonSchema();
2634
+ return scenarioJsonSchemaUnit;
2635
+ }
2636
+ export function registeredContracts() {
2637
+ return contractRegistry;
2638
+ }
2639
+ const SEMANTIC_NOT_GENERATED = [
2640
+ "cross-field stop condition",
2641
+ "positive step",
2642
+ "empty amount string",
2643
+ "model registry membership",
2644
+ "big-number parser",
2645
+ "safe expression",
2646
+ ];
2647
+ const JSON_SCHEMA_META = "https://json-schema.org/draft/2020-12/schema";
2648
+ export function rootSchemaDocument(id, unit, contract) {
2649
+ const root = unit.schema && typeof unit.schema === "object" && !Array.isArray(unit.schema)
2650
+ ? unit.schema
2651
+ : {};
2652
+ return {
2653
+ ...root,
2654
+ $schema: JSON_SCHEMA_META,
2655
+ $id: id,
2656
+ components: unit.components,
2657
+ idlekitContract: contract,
2658
+ };
2659
+ }
2660
+ /**
2661
+ * Hash source text with LF line endings, so a CRLF checkout digests the same bytes.
2662
+ */
2663
+ export function sourceTextDigest(text) {
2664
+ return sha256Text(text.replace(/\r\n/g, "\n"));
2665
+ }
2666
+ export function canonicalJson(value) {
2667
+ return renderCanonical(value, new Set());
2668
+ }
2669
+ export function sha256Text(value) {
2670
+ return createHash("sha256").update(value).digest("hex");
2671
+ }
2672
+ function renderCanonical(value, seen) {
2673
+ if (value === null || typeof value !== "object") {
2674
+ return JSON.stringify(value) ?? "null";
2675
+ }
2676
+ if (seen.has(value))
2677
+ return '"[circular]"';
2678
+ seen.add(value);
2679
+ try {
2680
+ if (Array.isArray(value)) {
2681
+ // Array.from visits holes, so a sparse slot renders as null like JSON.stringify.
2682
+ return `[${Array.from(value, (entry) => renderCanonical(entry ?? null, seen)).join(",")}]`;
2683
+ }
2684
+ const entries = Object.entries(value).filter(([key, entry]) => key !== "__type" && entry !== undefined);
2685
+ entries.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0));
2686
+ return `{${entries
2687
+ .map(([key, entry]) => `${JSON.stringify(key)}:${renderCanonical(entry, seen)}`)
2688
+ .join(",")}}`;
2689
+ }
2690
+ finally {
2691
+ seen.delete(value);
2692
+ }
2693
+ }
2694
+ function orderedSources(sources) {
2695
+ return [...sources].sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0));
2696
+ }
2697
+ export function contractSourceHash(sources) {
2698
+ const ordered = orderedSources(sources);
2699
+ return sha256Text(canonicalJson({
2700
+ dialect: JSON_SCHEMA_DIALECT,
2701
+ exportApi: JSON_SCHEMA_EXPORT,
2702
+ generator: CONTRACT_GENERATOR,
2703
+ generatorVersion: CONTRACT_GENERATOR_VERSION,
2704
+ registrations: contractRegistry,
2705
+ sources: ordered,
2706
+ typia: TYPIA_VERSION,
2707
+ }));
2708
+ }
2709
+ export function buildContractDocument(sources) {
2710
+ const ordered = orderedSources(sources);
2711
+ const unit = scenarioJsonSchema();
2712
+ return rootSchemaDocument(SCENARIO_SCHEMA_ID, unit, {
2713
+ generator: CONTRACT_GENERATOR,
2714
+ generatorVersion: CONTRACT_GENERATOR_VERSION,
2715
+ exportApi: JSON_SCHEMA_EXPORT,
2716
+ dialect: JSON_SCHEMA_DIALECT,
2717
+ typia: TYPIA_VERSION,
2718
+ schemaId: SCENARIO_SCHEMA_ID,
2719
+ unknownFieldPolicy: "runtime-allow",
2720
+ jsonSchemaAdditionalProperties: false,
2721
+ runtimeValidator: semanticValidationRetained,
2722
+ semanticNotGenerated: SEMANTIC_NOT_GENERATED,
2723
+ registrations: contractRegistry,
2724
+ sourceHash: contractSourceHash(ordered),
2725
+ sources: ordered,
2726
+ });
2727
+ }
2728
+ export function structuralFieldMetadata(unit) {
2729
+ const components = unit.components && typeof unit.components === "object" && !Array.isArray(unit.components)
2730
+ ? unit.components
2731
+ : {};
2732
+ const schemas = components.schemas && typeof components.schemas === "object" && !Array.isArray(components.schemas)
2733
+ ? components.schemas
2734
+ : {};
2735
+ const properties = [];
2736
+ const enums = {};
2737
+ const comments = {};
2738
+ // Ancestors only. A component referenced at several paths is read at each path,
2739
+ // and only a ref cycle on the current path stops the walk.
2740
+ const ancestors = new Set();
2741
+ function walk(node, path) {
2742
+ if (!node || typeof node !== "object")
2743
+ return;
2744
+ if (ancestors.has(node))
2745
+ return;
2746
+ ancestors.add(node);
2747
+ try {
2748
+ visit(node, path);
2749
+ }
2750
+ finally {
2751
+ ancestors.delete(node);
2752
+ }
2753
+ }
2754
+ function visit(record, path) {
2755
+ if (typeof record.$ref === "string") {
2756
+ const name = record.$ref.startsWith("#/components/schemas/")
2757
+ ? record.$ref.slice("#/components/schemas/".length)
2758
+ : "";
2759
+ if (name)
2760
+ walk(schemas[name], path);
2761
+ return;
2762
+ }
2763
+ if (typeof record.description === "string" && path.length > 0 && comments[path] === undefined) {
2764
+ comments[path] = record.description;
2765
+ }
2766
+ if (Array.isArray(record.enum) && path.length > 0 && enums[path] === undefined) {
2767
+ const values = record.enum.filter((item) => typeof item === "string");
2768
+ if (values.length > 0)
2769
+ enums[path] = values;
2770
+ }
2771
+ // A string const is one legal value at its path. Union branches, inline or behind a ref, each
2772
+ // reach this path, so their constants accumulate in branch order.
2773
+ if (typeof record.const === "string" && path.length > 0) {
2774
+ const values = (enums[path] ??= []);
2775
+ if (!values.includes(record.const))
2776
+ values.push(record.const);
2777
+ }
2778
+ const props = record.properties;
2779
+ if (props && typeof props === "object" && !Array.isArray(props)) {
2780
+ for (const key of Object.keys(props).sort()) {
2781
+ const next = path.length > 0 ? `${path}.${key}` : key;
2782
+ if (!properties.includes(next))
2783
+ properties.push(next);
2784
+ walk(props[key], next);
2785
+ }
2786
+ }
2787
+ if (record.items)
2788
+ walk(record.items, path.length > 0 ? `${path}[]` : "[]");
2789
+ for (const key of ["oneOf", "anyOf", "allOf"]) {
2790
+ const list = record[key];
2791
+ if (Array.isArray(list)) {
2792
+ for (const entry of list)
2793
+ walk(entry, path);
2794
+ }
2795
+ }
2796
+ }
2797
+ walk(unit.schema, "");
2798
+ properties.sort();
2799
+ return { properties, enums, comments };
2800
+ }
2801
+ export function buildFieldMetadata(sources) {
2802
+ const fields = structuralFieldMetadata(scenarioJsonSchema());
2803
+ return {
2804
+ idlekitContract: {
2805
+ kind: "structural-metadata",
2806
+ schemaId: SCENARIO_SCHEMA_ID,
2807
+ sourceHash: contractSourceHash(sources),
2808
+ note: "Names, enum values, and schema descriptions only. No design intent, example balances, or translations.",
2809
+ },
2810
+ properties: fields.properties,
2811
+ enums: fields.enums,
2812
+ comments: fields.comments,
2813
+ };
2814
+ }
2815
+ //# sourceMappingURL=scenarioContract.js.map