@agent-e/core 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/index.d.mts +0 -777
- package/dist/index.d.ts +0 -777
package/dist/index.js
CHANGED
|
@@ -817,7 +817,7 @@ var P3_BootstrapCapitalCoversFirstTransaction = {
|
|
|
817
817
|
category: "supply_chain",
|
|
818
818
|
description: "A new producer must be able to afford their first transaction without selling anything first. Producer starting with low currency but needing more to accept raw material hand-off blocks the entire supply chain from tick 1.",
|
|
819
819
|
check(metrics, _thresholds) {
|
|
820
|
-
const { populationByRole, supplyByResource, prices
|
|
820
|
+
const { populationByRole, supplyByResource, prices } = metrics;
|
|
821
821
|
const totalProducers = Object.values(populationByRole).reduce((s, v) => s + v, 0);
|
|
822
822
|
if (totalProducers > 0) {
|
|
823
823
|
for (const [resource, supply] of Object.entries(supplyByResource)) {
|
|
@@ -2556,7 +2556,7 @@ var P34_ExtractionRatio = {
|
|
|
2556
2556
|
description: "If >65% of participants are net extractors (taking value out without putting it in), the economy needs external subsidy (new user influx) to survive. Above 65%, any slowdown in new users collapses the economy.",
|
|
2557
2557
|
check(metrics, thresholds) {
|
|
2558
2558
|
const { extractionRatio } = metrics;
|
|
2559
|
-
if (isNaN(extractionRatio)) return { violated: false };
|
|
2559
|
+
if (Number.isNaN(extractionRatio)) return { violated: false };
|
|
2560
2560
|
if (extractionRatio > thresholds.extractionRatioRed) {
|
|
2561
2561
|
return {
|
|
2562
2562
|
violated: true,
|
|
@@ -2599,7 +2599,7 @@ var P47_SmokeTest = {
|
|
|
2599
2599
|
description: "intrinsic_utility_value / total_market_value < 0.3 = economy is >70% speculation. If utility value drops below 10%, a single bad week can collapse the entire market. Real utility (resources in the economy serve distinct utility functions) must anchor value.",
|
|
2600
2600
|
check(metrics, thresholds) {
|
|
2601
2601
|
const { smokeTestRatio } = metrics;
|
|
2602
|
-
if (isNaN(smokeTestRatio)) return { violated: false };
|
|
2602
|
+
if (Number.isNaN(smokeTestRatio)) return { violated: false };
|
|
2603
2603
|
if (smokeTestRatio < thresholds.smokeTestCritical) {
|
|
2604
2604
|
return {
|
|
2605
2605
|
violated: true,
|
|
@@ -2640,7 +2640,7 @@ var P48_CurrencyInsulation = {
|
|
|
2640
2640
|
description: "Gameplay economy correlation with external markets > 0.5 = insulation failure. When your native currency price correlates with external asset, external market crashes destroy internal economies. Good design insulates the two.",
|
|
2641
2641
|
check(metrics, thresholds) {
|
|
2642
2642
|
const { currencyInsulation } = metrics;
|
|
2643
|
-
if (isNaN(currencyInsulation)) return { violated: false };
|
|
2643
|
+
if (Number.isNaN(currencyInsulation)) return { violated: false };
|
|
2644
2644
|
if (currencyInsulation > thresholds.currencyInsulationMax) {
|
|
2645
2645
|
return {
|
|
2646
2646
|
violated: true,
|
|
@@ -2727,7 +2727,7 @@ var P52_EndowmentEffect = {
|
|
|
2727
2727
|
check(metrics, _thresholds) {
|
|
2728
2728
|
const { avgSatisfaction, churnRate } = metrics;
|
|
2729
2729
|
const { eventCompletionRate } = metrics;
|
|
2730
|
-
if (isNaN(eventCompletionRate)) return { violated: false };
|
|
2730
|
+
if (Number.isNaN(eventCompletionRate)) return { violated: false };
|
|
2731
2731
|
if (eventCompletionRate > 0.9 && avgSatisfaction < 60) {
|
|
2732
2732
|
return {
|
|
2733
2733
|
violated: true,
|
|
@@ -2753,7 +2753,7 @@ var P53_EventCompletionRate = {
|
|
|
2753
2753
|
description: "Free completion at 60-80% is the sweet spot. <40% = predatory design. >80% = no monetization pressure. 100% free = zero reason to ever spend.",
|
|
2754
2754
|
check(metrics, thresholds) {
|
|
2755
2755
|
const { eventCompletionRate } = metrics;
|
|
2756
|
-
if (isNaN(eventCompletionRate)) return { violated: false };
|
|
2756
|
+
if (Number.isNaN(eventCompletionRate)) return { violated: false };
|
|
2757
2757
|
if (eventCompletionRate < thresholds.eventCompletionMin) {
|
|
2758
2758
|
return {
|
|
2759
2759
|
violated: true,
|
|
@@ -3084,7 +3084,7 @@ var Simulator = class {
|
|
|
3084
3084
|
if (outcomes.length === 0) return emptyMetrics();
|
|
3085
3085
|
const base = { ...outcomes[0] };
|
|
3086
3086
|
const avg = (key) => {
|
|
3087
|
-
const vals = outcomes.map((o) => o[key]).filter((v) => typeof v === "number" && !isNaN(v));
|
|
3087
|
+
const vals = outcomes.map((o) => o[key]).filter((v) => typeof v === "number" && !Number.isNaN(v));
|
|
3088
3088
|
return vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
|
|
3089
3089
|
};
|
|
3090
3090
|
const avgRecord = (key) => {
|
|
@@ -3097,7 +3097,7 @@ var Simulator = class {
|
|
|
3097
3097
|
}
|
|
3098
3098
|
const result = {};
|
|
3099
3099
|
for (const k of allKeys) {
|
|
3100
|
-
const vals = outcomes.map((o) => o[key]?.[k]).filter((v) => typeof v === "number" && !isNaN(v));
|
|
3100
|
+
const vals = outcomes.map((o) => o[key]?.[k]).filter((v) => typeof v === "number" && !Number.isNaN(v));
|
|
3101
3101
|
result[k] = vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
|
|
3102
3102
|
}
|
|
3103
3103
|
return result;
|
|
@@ -3582,7 +3582,7 @@ var MetricStore = class {
|
|
|
3582
3582
|
if (snapshots.length === 0) return emptyMetrics();
|
|
3583
3583
|
const last = snapshots[snapshots.length - 1];
|
|
3584
3584
|
const avg = (key) => {
|
|
3585
|
-
const vals = snapshots.map((s) => s[key]).filter((v) => !isNaN(v));
|
|
3585
|
+
const vals = snapshots.map((s) => s[key]).filter((v) => !Number.isNaN(v));
|
|
3586
3586
|
return vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
|
|
3587
3587
|
};
|
|
3588
3588
|
const avgRecord = (key) => {
|
|
@@ -3595,7 +3595,7 @@ var MetricStore = class {
|
|
|
3595
3595
|
}
|
|
3596
3596
|
const result = {};
|
|
3597
3597
|
for (const k of allKeys) {
|
|
3598
|
-
const vals = snapshots.map((s) => s[key]?.[k]).filter((v) => typeof v === "number" && !isNaN(v));
|
|
3598
|
+
const vals = snapshots.map((s) => s[key]?.[k]).filter((v) => typeof v === "number" && !Number.isNaN(v));
|
|
3599
3599
|
result[k] = vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
|
|
3600
3600
|
}
|
|
3601
3601
|
return result;
|