@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.mjs CHANGED
@@ -701,7 +701,7 @@ var P3_BootstrapCapitalCoversFirstTransaction = {
701
701
  category: "supply_chain",
702
702
  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.",
703
703
  check(metrics, _thresholds) {
704
- const { populationByRole, supplyByResource, prices, totalAgents } = metrics;
704
+ const { populationByRole, supplyByResource, prices } = metrics;
705
705
  const totalProducers = Object.values(populationByRole).reduce((s, v) => s + v, 0);
706
706
  if (totalProducers > 0) {
707
707
  for (const [resource, supply] of Object.entries(supplyByResource)) {
@@ -2440,7 +2440,7 @@ var P34_ExtractionRatio = {
2440
2440
  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.",
2441
2441
  check(metrics, thresholds) {
2442
2442
  const { extractionRatio } = metrics;
2443
- if (isNaN(extractionRatio)) return { violated: false };
2443
+ if (Number.isNaN(extractionRatio)) return { violated: false };
2444
2444
  if (extractionRatio > thresholds.extractionRatioRed) {
2445
2445
  return {
2446
2446
  violated: true,
@@ -2483,7 +2483,7 @@ var P47_SmokeTest = {
2483
2483
  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.",
2484
2484
  check(metrics, thresholds) {
2485
2485
  const { smokeTestRatio } = metrics;
2486
- if (isNaN(smokeTestRatio)) return { violated: false };
2486
+ if (Number.isNaN(smokeTestRatio)) return { violated: false };
2487
2487
  if (smokeTestRatio < thresholds.smokeTestCritical) {
2488
2488
  return {
2489
2489
  violated: true,
@@ -2524,7 +2524,7 @@ var P48_CurrencyInsulation = {
2524
2524
  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.",
2525
2525
  check(metrics, thresholds) {
2526
2526
  const { currencyInsulation } = metrics;
2527
- if (isNaN(currencyInsulation)) return { violated: false };
2527
+ if (Number.isNaN(currencyInsulation)) return { violated: false };
2528
2528
  if (currencyInsulation > thresholds.currencyInsulationMax) {
2529
2529
  return {
2530
2530
  violated: true,
@@ -2611,7 +2611,7 @@ var P52_EndowmentEffect = {
2611
2611
  check(metrics, _thresholds) {
2612
2612
  const { avgSatisfaction, churnRate } = metrics;
2613
2613
  const { eventCompletionRate } = metrics;
2614
- if (isNaN(eventCompletionRate)) return { violated: false };
2614
+ if (Number.isNaN(eventCompletionRate)) return { violated: false };
2615
2615
  if (eventCompletionRate > 0.9 && avgSatisfaction < 60) {
2616
2616
  return {
2617
2617
  violated: true,
@@ -2637,7 +2637,7 @@ var P53_EventCompletionRate = {
2637
2637
  description: "Free completion at 60-80% is the sweet spot. <40% = predatory design. >80% = no monetization pressure. 100% free = zero reason to ever spend.",
2638
2638
  check(metrics, thresholds) {
2639
2639
  const { eventCompletionRate } = metrics;
2640
- if (isNaN(eventCompletionRate)) return { violated: false };
2640
+ if (Number.isNaN(eventCompletionRate)) return { violated: false };
2641
2641
  if (eventCompletionRate < thresholds.eventCompletionMin) {
2642
2642
  return {
2643
2643
  violated: true,
@@ -2968,7 +2968,7 @@ var Simulator = class {
2968
2968
  if (outcomes.length === 0) return emptyMetrics();
2969
2969
  const base = { ...outcomes[0] };
2970
2970
  const avg = (key) => {
2971
- const vals = outcomes.map((o) => o[key]).filter((v) => typeof v === "number" && !isNaN(v));
2971
+ const vals = outcomes.map((o) => o[key]).filter((v) => typeof v === "number" && !Number.isNaN(v));
2972
2972
  return vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
2973
2973
  };
2974
2974
  const avgRecord = (key) => {
@@ -2981,7 +2981,7 @@ var Simulator = class {
2981
2981
  }
2982
2982
  const result = {};
2983
2983
  for (const k of allKeys) {
2984
- const vals = outcomes.map((o) => o[key]?.[k]).filter((v) => typeof v === "number" && !isNaN(v));
2984
+ const vals = outcomes.map((o) => o[key]?.[k]).filter((v) => typeof v === "number" && !Number.isNaN(v));
2985
2985
  result[k] = vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
2986
2986
  }
2987
2987
  return result;
@@ -3466,7 +3466,7 @@ var MetricStore = class {
3466
3466
  if (snapshots.length === 0) return emptyMetrics();
3467
3467
  const last = snapshots[snapshots.length - 1];
3468
3468
  const avg = (key) => {
3469
- const vals = snapshots.map((s) => s[key]).filter((v) => !isNaN(v));
3469
+ const vals = snapshots.map((s) => s[key]).filter((v) => !Number.isNaN(v));
3470
3470
  return vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
3471
3471
  };
3472
3472
  const avgRecord = (key) => {
@@ -3479,7 +3479,7 @@ var MetricStore = class {
3479
3479
  }
3480
3480
  const result = {};
3481
3481
  for (const k of allKeys) {
3482
- const vals = snapshots.map((s) => s[key]?.[k]).filter((v) => typeof v === "number" && !isNaN(v));
3482
+ const vals = snapshots.map((s) => s[key]?.[k]).filter((v) => typeof v === "number" && !Number.isNaN(v));
3483
3483
  result[k] = vals.length > 0 ? vals.reduce((a, b) => a + b, 0) / vals.length : 0;
3484
3484
  }
3485
3485
  return result;