nexus-agents 2.92.2 → 2.92.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.
Files changed (31) hide show
  1. package/dist/{chunk-NR4NSTJH.js → chunk-27CNQPQ4.js} +21 -5
  2. package/dist/chunk-27CNQPQ4.js.map +1 -0
  3. package/dist/{chunk-F47QKVPH.js → chunk-4LEUIAYB.js} +26 -174
  4. package/dist/chunk-4LEUIAYB.js.map +1 -0
  5. package/dist/{chunk-L6JZCAFH.js → chunk-IHPYT6WU.js} +168 -4
  6. package/dist/chunk-IHPYT6WU.js.map +1 -0
  7. package/dist/{chunk-UYOHV3EG.js → chunk-JCYCITBK.js} +45 -24
  8. package/dist/chunk-JCYCITBK.js.map +1 -0
  9. package/dist/{chunk-3HVSXLPL.js → chunk-MZFWRU6E.js} +3 -3
  10. package/dist/{chunk-XNBPE6WG.js → chunk-VUVCSWMC.js} +2 -2
  11. package/dist/{chunk-G5XKEUAP.js → chunk-VYNNVUY6.js} +2 -2
  12. package/dist/cli.js +8 -8
  13. package/dist/{consensus-vote-VSRNSZ5J.js → consensus-vote-4RIUUEZQ.js} +2 -2
  14. package/dist/index.d.ts +171 -157
  15. package/dist/index.js +54 -37
  16. package/dist/index.js.map +1 -1
  17. package/dist/{issue-triage-FVZOVIRX.js → issue-triage-VB5CVE43.js} +3 -3
  18. package/dist/{pr-reviewer-helpers-RBUEJI6V.js → pr-reviewer-helpers-CI72F4XM.js} +3 -3
  19. package/dist/{setup-command-BMELLUUX.js → setup-command-E35O56BN.js} +3 -3
  20. package/package.json +1 -1
  21. package/dist/chunk-F47QKVPH.js.map +0 -1
  22. package/dist/chunk-L6JZCAFH.js.map +0 -1
  23. package/dist/chunk-NR4NSTJH.js.map +0 -1
  24. package/dist/chunk-UYOHV3EG.js.map +0 -1
  25. /package/dist/{chunk-3HVSXLPL.js.map → chunk-MZFWRU6E.js.map} +0 -0
  26. /package/dist/{chunk-XNBPE6WG.js.map → chunk-VUVCSWMC.js.map} +0 -0
  27. /package/dist/{chunk-G5XKEUAP.js.map → chunk-VYNNVUY6.js.map} +0 -0
  28. /package/dist/{consensus-vote-VSRNSZ5J.js.map → consensus-vote-4RIUUEZQ.js.map} +0 -0
  29. /package/dist/{issue-triage-FVZOVIRX.js.map → issue-triage-VB5CVE43.js.map} +0 -0
  30. /package/dist/{pr-reviewer-helpers-RBUEJI6V.js.map → pr-reviewer-helpers-CI72F4XM.js.map} +0 -0
  31. /package/dist/{setup-command-BMELLUUX.js.map → setup-command-E35O56BN.js.map} +0 -0
@@ -3667,6 +3667,15 @@ function wrapResilientWithFallback(inner, options = {}) {
3667
3667
  }
3668
3668
 
3669
3669
  // src/adapters/unified-registry.ts
3670
+ function withDefaultOnRetirement(enabled, options, logger11) {
3671
+ if (!enabled) return options;
3672
+ return {
3673
+ ...options,
3674
+ onRetirement: options?.onRetirement ?? ((info) => {
3675
+ logger11.warn("Model retired via not-found fallback", { retirement: info });
3676
+ })
3677
+ };
3678
+ }
3670
3679
  var UnifiedAdapterRegistry = class {
3671
3680
  logger;
3672
3681
  defaultCliTimeoutMs;
@@ -3682,7 +3691,11 @@ var UnifiedAdapterRegistry = class {
3682
3691
  this.logger = config?.logger ?? createLogger({ component: "unified-registry" });
3683
3692
  this.defaultCliTimeoutMs = config?.defaultCliTimeoutMs;
3684
3693
  this.enableMissingModelFallback = config?.enableMissingModelFallback ?? false;
3685
- this.missingModelFallbackOptions = config?.missingModelFallbackOptions;
3694
+ this.missingModelFallbackOptions = withDefaultOnRetirement(
3695
+ this.enableMissingModelFallback,
3696
+ config?.missingModelFallbackOptions,
3697
+ this.logger
3698
+ );
3686
3699
  this.taskRouting = this.buildTaskRouting();
3687
3700
  this.logger.info("UnifiedAdapterRegistry initialized", {
3688
3701
  categories: this.taskRouting.size,
@@ -5147,11 +5160,12 @@ function buildReasoning(decision, effectiveVotes, downweightedAgents, method) {
5147
5160
  // src/consensus/higher-order-voting.ts
5148
5161
  var logger2 = createLogger({ component: "higher-order-voting" });
5149
5162
  var OWVoting = class {
5150
- algorithm = "simple_majority";
5163
+ algorithm;
5151
5164
  config;
5152
5165
  constructor(options = {}) {
5153
5166
  this.config = { ...DEFAULT_HIGHER_ORDER_CONFIG, ...options.config };
5154
- logger2.info("OWVoting initialized", { config: this.config });
5167
+ this.algorithm = options.algorithm ?? "simple_majority";
5168
+ logger2.info("OWVoting initialized", { config: this.config, algorithm: this.algorithm });
5155
5169
  }
5156
5170
  /** IVotingStrategy implementation for integration with ConsensusEngine. */
5157
5171
  calculateOutcome(votes, _weights) {
@@ -5296,9 +5310,8 @@ function createOWVoting(options) {
5296
5310
  return new OWVoting(options);
5297
5311
  }
5298
5312
  var HigherOrderVotingStrategy = class extends OWVoting {
5299
- algorithm = "opinion_wise";
5300
5313
  constructor(options = {}) {
5301
- super(options);
5314
+ super({ ...options, algorithm: options.algorithm ?? "opinion_wise" });
5302
5315
  }
5303
5316
  };
5304
5317
  function createHigherOrderVotingStrategy(options) {
@@ -7895,7 +7908,9 @@ var ErrorPolicySchema = z9.enum(["reduce_denominator", "count_as_abstain", "fail
7895
7908
  var VoteThresholdSchema = z9.enum(["majority", "supermajority", "unanimous"]);
7896
7909
  var ERROR_FLOOR_FRACTION = 0.5;
7897
7910
  function getDefaultErrorPolicy(strategy) {
7898
- if (strategy === "unanimous" || strategy === "higher_order") return "fail_closed";
7911
+ if (strategy === "unanimous" || strategy === "higher_order" || strategy === "opinion_wise") {
7912
+ return "fail_closed";
7913
+ }
7899
7914
  return "reduce_denominator";
7900
7915
  }
7901
7916
  var ConsensusVoteInputSchema = z9.object({
@@ -7907,7 +7922,7 @@ var ConsensusVoteInputSchema = z9.object({
7907
7922
  "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order (Bayesian-optimal)"
7908
7923
  ),
7909
7924
  errorPolicy: ErrorPolicySchema.optional().describe(
7910
- "How to treat voters that errored or timed out (#2630). Default: fail_closed for unanimous/higher_order, reduce_denominator otherwise. Regardless of policy, errors > 50% always fails."
7925
+ "How to treat voters that errored or timed out (#2630). Default: fail_closed for unanimous/higher_order/opinion_wise, reduce_denominator otherwise. Regardless of policy, errors > 50% always fails."
7911
7926
  ),
7912
7927
  quickMode: z9.boolean().optional().default(false).describe("Use 3 agents instead of 5 for faster execution"),
7913
7928
  simulateVotes: z9.boolean().optional().default(false).describe(
@@ -9061,20 +9076,23 @@ function runHigherOrderVoting(strategy, voteMap, logger11) {
9061
9076
  });
9062
9077
  return result;
9063
9078
  }
9064
- function recordVotesToTracker(votes, voteMap, outcome, logger11) {
9065
- const allVotesReal = votes.every((v) => v.source === "llm");
9066
- if (!allVotesReal) {
9067
- logger11.warn("Skipping correlation recording due to non-LLM votes", {
9068
- count: votes.filter((v) => v.source !== "llm").length
9079
+ function recordVotesToTracker(votes, outcome, logger11) {
9080
+ const llmVotes = votes.filter((v) => v.source === "llm");
9081
+ if (llmVotes.length < votes.length) {
9082
+ logger11.warn("Recording only LLM votes to correlation tracker; excluding non-LLM votes", {
9083
+ recorded: llmVotes.length,
9084
+ excluded: votes.length - llmVotes.length
9069
9085
  });
9070
- return;
9071
9086
  }
9087
+ if (llmVotes.length === 0) return;
9088
+ const llmVoteMap = /* @__PURE__ */ new Map();
9089
+ for (const v of llmVotes) llmVoteMap.set(v.role, v.vote);
9072
9090
  const tracker = getOrCreateCorrelationTracker();
9073
9091
  const id = `consensus-${String(getTimeProvider().now())}-${getRandomProvider().random().toString(36).slice(2, 9)}`;
9074
- tracker.recordProposalVotes(id, voteMap, outcome);
9092
+ tracker.recordProposalVotes(id, llmVoteMap, outcome);
9075
9093
  logger11.debug("Recorded votes to tracker", { proposalId: id, outcome });
9076
9094
  try {
9077
- const persisted = createPersistedProposal(id, voteMap, outcome);
9095
+ const persisted = createPersistedProposal(id, llmVoteMap, outcome);
9078
9096
  const saveResult = saveCorrelationData([persisted]);
9079
9097
  if (!saveResult.ok) {
9080
9098
  logger11.warn("Failed to persist correlation data", { error: saveResult.error.message });
@@ -9200,14 +9218,17 @@ async function executeVoting(input, logger11, opts) {
9200
9218
  logger: logger11
9201
9219
  });
9202
9220
  }
9203
- const { engineResult, voteMap, higherOrderResult, outcome, cascaded } = await processVotesWithCascade(policyDecision.engineVotes, {
9204
- totalRoles: roles.length,
9205
- proposal: input.proposal,
9206
- algorithm,
9207
- strategy,
9208
- log: logger11
9209
- });
9210
- recordVotesToTracker(votes, voteMap, outcome, logger11);
9221
+ const { engineResult, higherOrderResult, outcome, cascaded } = await processVotesWithCascade(
9222
+ policyDecision.engineVotes,
9223
+ {
9224
+ totalRoles: roles.length,
9225
+ proposal: input.proposal,
9226
+ algorithm,
9227
+ strategy,
9228
+ log: logger11
9229
+ }
9230
+ );
9231
+ recordVotesToTracker(votes, outcome, logger11);
9211
9232
  const escalated = await maybeEscalateContrarian(input, outcome, logger11, opts);
9212
9233
  if (escalated !== void 0) return escalated;
9213
9234
  return finalizeVotingResult({
@@ -9625,4 +9646,4 @@ export {
9625
9646
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
9626
9647
  registerConsensusVoteTool
9627
9648
  };
9628
- //# sourceMappingURL=chunk-UYOHV3EG.js.map
9649
+ //# sourceMappingURL=chunk-JCYCITBK.js.map