nexus-agents 2.106.0 → 2.109.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 (115) hide show
  1. package/dist/{child-mcp-config-KP2XBOIB.js → child-mcp-config-VF736CNG.js} +2 -2
  2. package/dist/{chunk-DLFJQ6W6.js → chunk-3NON6THG.js} +2 -2
  3. package/dist/{chunk-KZWJ52HH.js → chunk-4QH4IHCY.js} +2 -2
  4. package/dist/{chunk-75NKH2VD.js → chunk-5H3YYSMY.js} +4 -4
  5. package/dist/{chunk-R2VTDJO5.js → chunk-6R5IEZGJ.js} +5 -5
  6. package/dist/{chunk-CNIRLXNH.js → chunk-7PW7DTAV.js} +3 -3
  7. package/dist/{chunk-E3JGMUGY.js → chunk-AESMMLSZ.js} +4 -4
  8. package/dist/{chunk-CUX775NF.js → chunk-C5OTCDF6.js} +4 -4
  9. package/dist/{chunk-BJQA6DSN.js → chunk-DLWY7U6K.js} +2 -2
  10. package/dist/{chunk-EBJJGYOQ.js → chunk-EAQLDAKX.js} +3 -3
  11. package/dist/{chunk-PRPHNXUM.js → chunk-H47QJVMR.js} +3 -3
  12. package/dist/{chunk-KMASI7UC.js → chunk-H6Q3EPQG.js} +2 -2
  13. package/dist/{chunk-3YWBA5GE.js → chunk-HBPDYYIT.js} +7 -7
  14. package/dist/{chunk-RWAI74H6.js → chunk-HL22AVD4.js} +7 -7
  15. package/dist/{chunk-HNBA265P.js → chunk-ICOKYKLH.js} +31 -31
  16. package/dist/{chunk-M6JRWJZW.js → chunk-IJZGHD7O.js} +2 -2
  17. package/dist/{chunk-BEWKRRNZ.js → chunk-K3UILZ5X.js} +21 -3
  18. package/dist/chunk-K3UILZ5X.js.map +1 -0
  19. package/dist/{chunk-OP4VPTQZ.js → chunk-LLM3HY54.js} +3 -3
  20. package/dist/{chunk-U3Y6AWG5.js → chunk-LQLFZEOP.js} +2 -2
  21. package/dist/{chunk-GMHCPEHS.js → chunk-N5I4PC3P.js} +105 -27
  22. package/dist/chunk-N5I4PC3P.js.map +1 -0
  23. package/dist/{chunk-YL7SS6JZ.js → chunk-PFZNK25E.js} +2 -2
  24. package/dist/{chunk-GRHCGUBQ.js → chunk-RCN76RFJ.js} +157 -17
  25. package/dist/chunk-RCN76RFJ.js.map +1 -0
  26. package/dist/{chunk-MYXT7VPF.js → chunk-RMTFEDQV.js} +2 -2
  27. package/dist/{chunk-SFIGDPAE.js → chunk-RROQMZW2.js} +3 -3
  28. package/dist/{chunk-WPF7G56I.js → chunk-SXI5ZFBR.js} +2 -2
  29. package/dist/{chunk-5UU6BQJ3.js → chunk-TJUGEDQI.js} +2 -2
  30. package/dist/{chunk-VHIRBRZF.js → chunk-UIFDDBIG.js} +2 -2
  31. package/dist/{chunk-2J6HSR6X.js → chunk-V5UOHHOD.js} +2 -2
  32. package/dist/{chunk-2DHISFDY.js → chunk-VO7FEIXD.js} +5 -4
  33. package/dist/{chunk-2DHISFDY.js.map → chunk-VO7FEIXD.js.map} +1 -1
  34. package/dist/{chunk-VIXH6P3Y.js → chunk-YDPEK6NQ.js} +3 -3
  35. package/dist/{chunk-DOIOSEDU.js → chunk-ZFDG2CDY.js} +2 -2
  36. package/dist/{cli-circuit-breaker-PE3AYA56.js → cli-circuit-breaker-X4DTCCLH.js} +4 -4
  37. package/dist/cli.js +37 -37
  38. package/dist/{composite-router-GXLSZZQU.js → composite-router-QJRU2JU5.js} +2 -2
  39. package/dist/{consensus-vote-ZS4IDC5T.js → consensus-vote-HK5G3DYU.js} +12 -12
  40. package/dist/{context-retriever-52RLYDVE.js → context-retriever-3N7NVP57.js} +6 -6
  41. package/dist/{doctor-deep-3463IMLO.js → doctor-deep-6DKSM74K.js} +3 -3
  42. package/dist/{expert-bridge-OBOSFIHR.js → expert-bridge-N7PLXYBV.js} +4 -4
  43. package/dist/{factory-VXD4XO7R.js → factory-U23DIWPS.js} +5 -5
  44. package/dist/factory-UVXXFLOI.js +21 -0
  45. package/dist/{improvement-review-Y4DSR2AF.js → improvement-review-5DRHKSXV.js} +4 -4
  46. package/dist/index.d.ts +13 -4
  47. package/dist/index.js +38 -39
  48. package/dist/index.js.map +1 -1
  49. package/dist/{init-opencode-3FW2TAOR.js → init-opencode-YAYDQ36A.js} +5 -5
  50. package/dist/{issue-triage-KAVEQE5V.js → issue-triage-L3MTN6RS.js} +5 -5
  51. package/dist/{pr-reviewer-helpers-KORDKN6O.js → pr-reviewer-helpers-H4R57FMV.js} +4 -4
  52. package/dist/{registry-command-WZK7PYVZ.js → registry-command-7TVGPC43.js} +2 -2
  53. package/dist/{repo-security-plan-EO5R3S7C.js → repo-security-plan-543K7VCE.js} +3 -3
  54. package/dist/{research-helpers-synthesize-6HFD32XJ.js → research-helpers-synthesize-4BQHGJ3O.js} +3 -3
  55. package/dist/{routing-memory-XPJT3Y6Z.js → routing-memory-QN3PS4SS.js} +2 -2
  56. package/dist/{session-memory-TTE5YPV4.js → session-memory-Q3MMU45M.js} +3 -3
  57. package/dist/{setup-command-VVHIWCD4.js → setup-command-BDBPSHZD.js} +11 -11
  58. package/dist/{setup-config-NEM4KPUA.js → setup-config-D6WCNU6M.js} +3 -3
  59. package/dist/{setup-custom-api-GMMHEJJ5.js → setup-custom-api-SMLJ27IY.js} +3 -3
  60. package/dist/{tool-memory-TTLQ7MHZ.js → tool-memory-H6W6KNR3.js} +5 -5
  61. package/dist/{weather-report-KGAHUQFF.js → weather-report-R3KUDV4W.js} +2 -2
  62. package/package.json +1 -1
  63. package/dist/chunk-BEWKRRNZ.js.map +0 -1
  64. package/dist/chunk-GMHCPEHS.js.map +0 -1
  65. package/dist/chunk-GRHCGUBQ.js.map +0 -1
  66. package/dist/factory-SM7AIAFL.js +0 -21
  67. /package/dist/{child-mcp-config-KP2XBOIB.js.map → child-mcp-config-VF736CNG.js.map} +0 -0
  68. /package/dist/{chunk-DLFJQ6W6.js.map → chunk-3NON6THG.js.map} +0 -0
  69. /package/dist/{chunk-KZWJ52HH.js.map → chunk-4QH4IHCY.js.map} +0 -0
  70. /package/dist/{chunk-75NKH2VD.js.map → chunk-5H3YYSMY.js.map} +0 -0
  71. /package/dist/{chunk-R2VTDJO5.js.map → chunk-6R5IEZGJ.js.map} +0 -0
  72. /package/dist/{chunk-CNIRLXNH.js.map → chunk-7PW7DTAV.js.map} +0 -0
  73. /package/dist/{chunk-E3JGMUGY.js.map → chunk-AESMMLSZ.js.map} +0 -0
  74. /package/dist/{chunk-CUX775NF.js.map → chunk-C5OTCDF6.js.map} +0 -0
  75. /package/dist/{chunk-BJQA6DSN.js.map → chunk-DLWY7U6K.js.map} +0 -0
  76. /package/dist/{chunk-EBJJGYOQ.js.map → chunk-EAQLDAKX.js.map} +0 -0
  77. /package/dist/{chunk-PRPHNXUM.js.map → chunk-H47QJVMR.js.map} +0 -0
  78. /package/dist/{chunk-KMASI7UC.js.map → chunk-H6Q3EPQG.js.map} +0 -0
  79. /package/dist/{chunk-3YWBA5GE.js.map → chunk-HBPDYYIT.js.map} +0 -0
  80. /package/dist/{chunk-RWAI74H6.js.map → chunk-HL22AVD4.js.map} +0 -0
  81. /package/dist/{chunk-HNBA265P.js.map → chunk-ICOKYKLH.js.map} +0 -0
  82. /package/dist/{chunk-M6JRWJZW.js.map → chunk-IJZGHD7O.js.map} +0 -0
  83. /package/dist/{chunk-OP4VPTQZ.js.map → chunk-LLM3HY54.js.map} +0 -0
  84. /package/dist/{chunk-U3Y6AWG5.js.map → chunk-LQLFZEOP.js.map} +0 -0
  85. /package/dist/{chunk-YL7SS6JZ.js.map → chunk-PFZNK25E.js.map} +0 -0
  86. /package/dist/{chunk-MYXT7VPF.js.map → chunk-RMTFEDQV.js.map} +0 -0
  87. /package/dist/{chunk-SFIGDPAE.js.map → chunk-RROQMZW2.js.map} +0 -0
  88. /package/dist/{chunk-WPF7G56I.js.map → chunk-SXI5ZFBR.js.map} +0 -0
  89. /package/dist/{chunk-5UU6BQJ3.js.map → chunk-TJUGEDQI.js.map} +0 -0
  90. /package/dist/{chunk-VHIRBRZF.js.map → chunk-UIFDDBIG.js.map} +0 -0
  91. /package/dist/{chunk-2J6HSR6X.js.map → chunk-V5UOHHOD.js.map} +0 -0
  92. /package/dist/{chunk-VIXH6P3Y.js.map → chunk-YDPEK6NQ.js.map} +0 -0
  93. /package/dist/{chunk-DOIOSEDU.js.map → chunk-ZFDG2CDY.js.map} +0 -0
  94. /package/dist/{cli-circuit-breaker-PE3AYA56.js.map → cli-circuit-breaker-X4DTCCLH.js.map} +0 -0
  95. /package/dist/{composite-router-GXLSZZQU.js.map → composite-router-QJRU2JU5.js.map} +0 -0
  96. /package/dist/{consensus-vote-ZS4IDC5T.js.map → consensus-vote-HK5G3DYU.js.map} +0 -0
  97. /package/dist/{context-retriever-52RLYDVE.js.map → context-retriever-3N7NVP57.js.map} +0 -0
  98. /package/dist/{doctor-deep-3463IMLO.js.map → doctor-deep-6DKSM74K.js.map} +0 -0
  99. /package/dist/{expert-bridge-OBOSFIHR.js.map → expert-bridge-N7PLXYBV.js.map} +0 -0
  100. /package/dist/{factory-SM7AIAFL.js.map → factory-U23DIWPS.js.map} +0 -0
  101. /package/dist/{factory-VXD4XO7R.js.map → factory-UVXXFLOI.js.map} +0 -0
  102. /package/dist/{improvement-review-Y4DSR2AF.js.map → improvement-review-5DRHKSXV.js.map} +0 -0
  103. /package/dist/{init-opencode-3FW2TAOR.js.map → init-opencode-YAYDQ36A.js.map} +0 -0
  104. /package/dist/{issue-triage-KAVEQE5V.js.map → issue-triage-L3MTN6RS.js.map} +0 -0
  105. /package/dist/{pr-reviewer-helpers-KORDKN6O.js.map → pr-reviewer-helpers-H4R57FMV.js.map} +0 -0
  106. /package/dist/{registry-command-WZK7PYVZ.js.map → registry-command-7TVGPC43.js.map} +0 -0
  107. /package/dist/{repo-security-plan-EO5R3S7C.js.map → repo-security-plan-543K7VCE.js.map} +0 -0
  108. /package/dist/{research-helpers-synthesize-6HFD32XJ.js.map → research-helpers-synthesize-4BQHGJ3O.js.map} +0 -0
  109. /package/dist/{routing-memory-XPJT3Y6Z.js.map → routing-memory-QN3PS4SS.js.map} +0 -0
  110. /package/dist/{session-memory-TTE5YPV4.js.map → session-memory-Q3MMU45M.js.map} +0 -0
  111. /package/dist/{setup-command-VVHIWCD4.js.map → setup-command-BDBPSHZD.js.map} +0 -0
  112. /package/dist/{setup-config-NEM4KPUA.js.map → setup-config-D6WCNU6M.js.map} +0 -0
  113. /package/dist/{setup-custom-api-GMMHEJJ5.js.map → setup-custom-api-SMLJ27IY.js.map} +0 -0
  114. /package/dist/{tool-memory-TTLQ7MHZ.js.map → tool-memory-H6W6KNR3.js.map} +0 -0
  115. /package/dist/{weather-report-KGAHUQFF.js.map → weather-report-R3KUDV4W.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  TASK_CATEGORIES,
3
3
  getAdaptiveBonus,
4
4
  getOutcomeStore
5
- } from "./chunk-2DHISFDY.js";
5
+ } from "./chunk-VO7FEIXD.js";
6
6
 
7
7
  // src/cli/doctor-deep.ts
8
8
  var CLI_NAMES = ["claude", "gemini", "codex", "opencode"];
@@ -106,4 +106,4 @@ export {
106
106
  runDeepDiagnostics,
107
107
  formatDeepDiagnostics
108
108
  };
109
- //# sourceMappingURL=chunk-YL7SS6JZ.js.map
109
+ //# sourceMappingURL=chunk-PFZNK25E.js.map
@@ -9,17 +9,20 @@ import {
9
9
  toolSuccess,
10
10
  withProgressHeartbeat,
11
11
  wrapToolWithTimeout
12
- } from "./chunk-KZWJ52HH.js";
12
+ } from "./chunk-4QH4IHCY.js";
13
13
  import {
14
14
  getToolMemory
15
- } from "./chunk-75NKH2VD.js";
15
+ } from "./chunk-5H3YYSMY.js";
16
16
  import {
17
17
  authRemediation,
18
18
  createAutoAdapter,
19
19
  delay,
20
20
  getAvailableClis,
21
21
  withTimeout
22
- } from "./chunk-GMHCPEHS.js";
22
+ } from "./chunk-N5I4PC3P.js";
23
+ import {
24
+ mapModelErrorToCategory
25
+ } from "./chunk-K3UILZ5X.js";
23
26
  import {
24
27
  AgentError,
25
28
  CLI_NAMES,
@@ -54,7 +57,7 @@ import {
54
57
  registerPersistentOutcomeStoreFactory,
55
58
  resolveVoteTimeout,
56
59
  toRateLimitError
57
- } from "./chunk-2DHISFDY.js";
60
+ } from "./chunk-VO7FEIXD.js";
58
61
  import {
59
62
  ensureLearningDir,
60
63
  getOutcomesFile,
@@ -438,17 +441,20 @@ var ResilientAdapter = class {
438
441
  return err(new ModelError("No model adapter available"));
439
442
  }
440
443
  const result = await adapter.complete(request);
441
- if (!result.ok && isRateLimitLikeError(result.error)) {
442
- const rlError = toRateLimitError(result.error, adapter.providerId);
443
- recordRateLimitEvent({
444
- provider: adapter.providerId,
445
- timestamp: getTimeProvider().now(),
446
- retryAfterMs: rlError.retryAfterMs
447
- });
448
- this.logger.warn("Rate limit detected", {
449
- provider: adapter.providerId,
450
- retryAfterMs: rlError.retryAfterMs
451
- });
444
+ if (!result.ok) {
445
+ if (isRateLimitLikeError(result.error)) {
446
+ const rlError = toRateLimitError(result.error, adapter.providerId);
447
+ recordRateLimitEvent({
448
+ provider: adapter.providerId,
449
+ timestamp: getTimeProvider().now(),
450
+ retryAfterMs: rlError.retryAfterMs
451
+ });
452
+ this.logger.warn("Rate limit detected", {
453
+ provider: adapter.providerId,
454
+ retryAfterMs: rlError.retryAfterMs
455
+ });
456
+ }
457
+ this.recordBreakerFailure(adapter, result.error);
452
458
  }
453
459
  return result;
454
460
  }
@@ -572,6 +578,37 @@ var ResilientAdapter = class {
572
578
  this.emitFailover();
573
579
  }
574
580
  }
581
+ /**
582
+ * Record a direct-API failure to the circuit breaker so API adapters get the
583
+ * same degradation/failover learning that CLI subprocess failures get (#3423).
584
+ *
585
+ * The breaker key is `currentSelection.name` — distinct from the `api:<vendor>`
586
+ * arm key used by the ModelToCliAdapter path (#3422), so the two paths never
587
+ * double-count the same failure.
588
+ *
589
+ * Rate-limit failures are deliberately skipped here: they are already recorded
590
+ * by the `recordRateLimitEvent` telemetry branch in `complete()`, and the
591
+ * breaker counts rate limits as failures by default
592
+ * (`countRateLimitsAsFailures`), so recording them again would double-count.
593
+ *
594
+ * Security (#3422 constraint): the logged payload carries only `provider` and
595
+ * `category` — never `error.message`, the request, or the ModelError object,
596
+ * any of which could embed credentials.
597
+ */
598
+ recordBreakerFailure(adapter, error) {
599
+ if (this.circuitBreakerRegistry === void 0 || this.currentSelection === void 0) {
600
+ return;
601
+ }
602
+ const category = mapModelErrorToCategory(error);
603
+ if (category === "rate_limit" || isRateLimitLikeError(error)) {
604
+ return;
605
+ }
606
+ this.circuitBreakerRegistry.getBreaker(this.currentSelection.name).recordFailure(category);
607
+ this.logger.warn("API failure recorded to circuit breaker", {
608
+ provider: adapter.providerId,
609
+ category
610
+ });
611
+ }
575
612
  handleCircuitStateChange(event) {
576
613
  if (event.newState !== "open") return;
577
614
  const currentSource = this.currentSelection?.name;
@@ -1300,6 +1337,103 @@ var VoteResponseSchema = z.object({
1300
1337
  * Replaces the YAML-in-reasoning encoding that proved lossy. */
1301
1338
  findings: z.array(RawFindingSchema).optional().describe("Structured findings (PR review only)")
1302
1339
  });
1340
+ var VOTE_JSON_SCHEMA = {
1341
+ type: "object",
1342
+ additionalProperties: false,
1343
+ required: ["decision", "reasoning", "confidence"],
1344
+ properties: {
1345
+ decision: {
1346
+ type: "string",
1347
+ enum: ["approve", "reject", "abstain"],
1348
+ description: "Your vote decision"
1349
+ },
1350
+ reasoning: {
1351
+ type: "string",
1352
+ minLength: 10,
1353
+ maxLength: 4e3,
1354
+ description: "Explanation for your vote (10-4000 chars)"
1355
+ },
1356
+ confidence: {
1357
+ type: "number",
1358
+ minimum: 0,
1359
+ maximum: 1,
1360
+ description: "Confidence level 0-1"
1361
+ },
1362
+ conditions: {
1363
+ type: "array",
1364
+ items: { type: "string" },
1365
+ description: "Optional conditions for approval"
1366
+ },
1367
+ rejectionCategories: {
1368
+ type: "array",
1369
+ items: {
1370
+ type: "string",
1371
+ enum: [
1372
+ "YAGNI",
1373
+ "DRY_VIOLATION",
1374
+ "OVER_ENGINEERING",
1375
+ "SCOPE_CREEP",
1376
+ "SECURITY_RISK",
1377
+ "MISALIGNED",
1378
+ "INSUFFICIENT_EVIDENCE"
1379
+ ]
1380
+ },
1381
+ description: "Rejection reason categories when decision is reject"
1382
+ },
1383
+ findings: {
1384
+ type: "array",
1385
+ description: "Structured findings (PR review only)",
1386
+ items: {
1387
+ type: "object",
1388
+ additionalProperties: false,
1389
+ required: ["summary", "location", "severity", "gate", "claim"],
1390
+ properties: {
1391
+ summary: {
1392
+ type: "string",
1393
+ minLength: 1,
1394
+ maxLength: 500,
1395
+ description: "One-line summary of the issue"
1396
+ },
1397
+ location: {
1398
+ type: "string",
1399
+ minLength: 1,
1400
+ maxLength: 200,
1401
+ description: "path/file.ext:line"
1402
+ },
1403
+ severity: { type: "string", enum: ["critical", "high", "medium", "low"] },
1404
+ gate: {
1405
+ type: "object",
1406
+ additionalProperties: false,
1407
+ required: [
1408
+ "reread_cited_line",
1409
+ "traced_call_path",
1410
+ "named_assertion",
1411
+ "ruled_out_language_non_issue"
1412
+ ],
1413
+ properties: {
1414
+ reread_cited_line: { type: "string", enum: ["passed", "failed", "skipped"] },
1415
+ traced_call_path: { type: "string", enum: ["passed", "failed", "skipped"] },
1416
+ named_assertion: {
1417
+ type: "string",
1418
+ description: "Concrete failing assertion \u2014 substantive, not a rubber-stamp word"
1419
+ },
1420
+ ruled_out_language_non_issue: {
1421
+ type: "string",
1422
+ enum: ["passed", "failed", "skipped"]
1423
+ }
1424
+ }
1425
+ },
1426
+ claim: {
1427
+ type: "string",
1428
+ minLength: 1,
1429
+ maxLength: 2e3,
1430
+ description: "What is wrong and why it justifies blocking"
1431
+ }
1432
+ }
1433
+ }
1434
+ }
1435
+ }
1436
+ };
1303
1437
  var VOTE_PROMPT_EXAMPLES = `Example approve response:
1304
1438
  {
1305
1439
  "decision": "approve",
@@ -1537,6 +1671,12 @@ async function executeSingleVoteAttempt(role, proposal, adapter, timeoutMs) {
1537
1671
  maxTokens: 2e3,
1538
1672
  temperature: 0.3,
1539
1673
  // Low temperature for consistent evaluations
1674
+ // #3433: request native structured output (Claude tool_use / OpenAI+Gemini
1675
+ // json mode) so the vote arrives as a schema-valid JSON object instead of
1676
+ // prose-wrapped JSON. Adapters that don't honor responseFormat ignore it and
1677
+ // the existing extractTextFromResponse + parseVoteResponse regex/Zod path
1678
+ // below is the fallback — no behavior change for those backends.
1679
+ responseFormat: { type: "json_schema", schema: VOTE_JSON_SCHEMA },
1540
1680
  // Thread the vote's budget into the adapter so its shorter standard CLI
1541
1681
  // timeout doesn't fire first and surface as an MCP -32001 on slow voters
1542
1682
  // (e.g. the Security role on complex proposals) (#3304).
@@ -5987,7 +6127,7 @@ async function processVotesWithCascade(engineVotes, opts) {
5987
6127
  var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
5988
6128
  async function runContrarianCheck(proposal, log) {
5989
6129
  try {
5990
- const { executeExpert } = await import("./expert-bridge-OBOSFIHR.js");
6130
+ const { executeExpert } = await import("./expert-bridge-N7PLXYBV.js");
5991
6131
  const prompt = [
5992
6132
  "You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
5993
6133
  "Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
@@ -6471,4 +6611,4 @@ export {
6471
6611
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
6472
6612
  registerConsensusVoteTool
6473
6613
  };
6474
- //# sourceMappingURL=chunk-GRHCGUBQ.js.map
6614
+ //# sourceMappingURL=chunk-RCN76RFJ.js.map