nexus-agents 2.142.0 → 2.143.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.
@@ -1468,9 +1468,12 @@ var logger = createLogger({ component: "higher-order-voting" });
1468
1468
  var OWVoting = class {
1469
1469
  algorithm;
1470
1470
  config;
1471
+ /** #3173: tracker used when `aggregate` is called without a per-call one. */
1472
+ injectedTracker;
1471
1473
  constructor(options = {}) {
1472
1474
  this.config = { ...DEFAULT_HIGHER_ORDER_CONFIG, ...options.config };
1473
1475
  this.algorithm = options.algorithm ?? "simple_majority";
1476
+ this.injectedTracker = options.tracker;
1474
1477
  logger.info("OWVoting initialized", { config: this.config, algorithm: this.algorithm });
1475
1478
  }
1476
1479
  /** IVotingStrategy implementation for integration with ConsensusEngine. */
@@ -1562,6 +1565,16 @@ var OWVoting = class {
1562
1565
  return result;
1563
1566
  }
1564
1567
  aggregate(votes, tracker) {
1568
+ const effectiveTracker = tracker ?? this.injectedTracker;
1569
+ if (effectiveTracker === void 0) {
1570
+ throw new Error(
1571
+ "OWVoting.aggregate requires an ICorrelationTracker \u2014 pass it as an argument or inject one via OWVotingOptions.tracker (#3173)."
1572
+ );
1573
+ }
1574
+ return this.aggregateWith(votes, effectiveTracker);
1575
+ }
1576
+ /** Core aggregation against a resolved tracker (#3173 — extracted from aggregate). */
1577
+ aggregateWith(votes, tracker) {
1565
1578
  const agentIds = Array.from(votes.keys());
1566
1579
  if (!tracker.hasSufficientData(agentIds)) {
1567
1580
  if (this.config.fallbackToSimpleVoting) {
@@ -6180,4 +6193,4 @@ export {
6180
6193
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
6181
6194
  registerConsensusVoteTool
6182
6195
  };
6183
- //# sourceMappingURL=chunk-FPIAD37H.js.map
6196
+ //# sourceMappingURL=chunk-P75OHXX5.js.map