nexus-agents 2.93.0 → 2.95.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 (117) hide show
  1. package/dist/{child-mcp-config-WNISXFYD.js → child-mcp-config-NW7JMSDK.js} +2 -2
  2. package/dist/{chunk-XVY3I7JT.js → chunk-2X24T4ZD.js} +9 -12
  3. package/dist/chunk-2X24T4ZD.js.map +1 -0
  4. package/dist/{chunk-BHA6V7GK.js → chunk-3H6Q3RZM.js} +4 -4
  5. package/dist/{chunk-T73G67GT.js → chunk-3HXWI34V.js} +3 -3
  6. package/dist/{chunk-RTUZSR4R.js → chunk-47Z3YPOK.js} +2 -2
  7. package/dist/{chunk-G5IDRWWI.js → chunk-4NVYN2MB.js} +4 -4
  8. package/dist/{chunk-5BTRDVWC.js → chunk-55G7KQ7F.js} +5 -5
  9. package/dist/{chunk-WU3SUA35.js → chunk-5HBDXW44.js} +2 -2
  10. package/dist/{chunk-JCETWDU7.js → chunk-6IWPN5UB.js} +2 -2
  11. package/dist/{chunk-4A4WPM75.js → chunk-7GUP6KQQ.js} +8 -10
  12. package/dist/{chunk-4A4WPM75.js.map → chunk-7GUP6KQQ.js.map} +1 -1
  13. package/dist/{chunk-ULBKFMVO.js → chunk-BSHDI4BH.js} +2 -2
  14. package/dist/{chunk-JEBWSHSU.js → chunk-D3JSXVX3.js} +2 -2
  15. package/dist/{chunk-HKISF2E7.js → chunk-ECBH5INZ.js} +259 -8
  16. package/dist/chunk-ECBH5INZ.js.map +1 -0
  17. package/dist/{chunk-ZOAU7RE4.js → chunk-ECZW5FXN.js} +4 -6
  18. package/dist/{chunk-ZOAU7RE4.js.map → chunk-ECZW5FXN.js.map} +1 -1
  19. package/dist/{chunk-ZYHHDPFW.js → chunk-FTDVA33Z.js} +4 -4
  20. package/dist/{chunk-2T4NV6QT.js → chunk-FXVJLJUF.js} +2 -2
  21. package/dist/{chunk-IJ2AZZVH.js → chunk-FYGZ4MEQ.js} +141 -28
  22. package/dist/chunk-FYGZ4MEQ.js.map +1 -0
  23. package/dist/{chunk-SORBJPRA.js → chunk-G42N55ZR.js} +2 -2
  24. package/dist/{chunk-SHSKW5ML.js → chunk-GC5FH2IA.js} +7 -7
  25. package/dist/{chunk-FTCU55O6.js → chunk-KHZGMF2W.js} +4 -4
  26. package/dist/{chunk-2IBJC2EP.js → chunk-LXROEQAO.js} +2 -2
  27. package/dist/{chunk-CPH6LKXO.js → chunk-LZOTH2GI.js} +2 -2
  28. package/dist/{chunk-DTFMYM3V.js → chunk-O4LVC4MQ.js} +2 -2
  29. package/dist/{chunk-AZP66FIA.js → chunk-PFOY5ML6.js} +3 -3
  30. package/dist/{chunk-SMGH2B3A.js → chunk-QUPPV6UO.js} +20 -3
  31. package/dist/chunk-QUPPV6UO.js.map +1 -0
  32. package/dist/{chunk-K7VGX37L.js → chunk-TEKWQNQ2.js} +3 -3
  33. package/dist/{chunk-LJMO5P6O.js → chunk-VTMQND6B.js} +23 -13
  34. package/dist/chunk-VTMQND6B.js.map +1 -0
  35. package/dist/{chunk-BNHBZRU7.js → chunk-WGA4VGIR.js} +3 -3
  36. package/dist/{chunk-57OH2O2U.js → chunk-Y3OOHHKQ.js} +2 -2
  37. package/dist/{chunk-VSG6RSE6.js → chunk-YYXJ6RTO.js} +3 -3
  38. package/dist/{chunk-E3QWWP67.js → chunk-ZICVVBDW.js} +2 -2
  39. package/dist/{cli-circuit-breaker-6E4E2IU7.js → cli-circuit-breaker-LNU5DQSB.js} +4 -4
  40. package/dist/cli.js +131 -54
  41. package/dist/cli.js.map +1 -1
  42. package/dist/{composite-router-MQOPXLVV.js → composite-router-DJ54ND5X.js} +2 -2
  43. package/dist/{consensus-vote-ZRADOLXH.js → consensus-vote-XLEQFVE7.js} +12 -13
  44. package/dist/{context-retriever-TZGIETJO.js → context-retriever-6O6TREXH.js} +6 -6
  45. package/dist/{doctor-deep-OU2WC55V.js → doctor-deep-PSNJPELP.js} +3 -3
  46. package/dist/{expert-bridge-WP5ZWXFY.js → expert-bridge-Q3OWPD4L.js} +4 -4
  47. package/dist/{factory-RJTRVII5.js → factory-43RVPRT5.js} +5 -5
  48. package/dist/{factory-2TN2VZTR.js → factory-PSMTMC7V.js} +5 -5
  49. package/dist/index.d.ts +215 -207
  50. package/dist/index.js +26 -27
  51. package/dist/index.js.map +1 -1
  52. package/dist/{init-opencode-AYMNMWU7.js → init-opencode-25AUARJH.js} +5 -5
  53. package/dist/{issue-triage-QIVZN3PJ.js → issue-triage-KZTENUDH.js} +5 -5
  54. package/dist/{pr-reviewer-helpers-P24OBKVM.js → pr-reviewer-helpers-XENJ4E2T.js} +4 -4
  55. package/dist/{registry-command-KWWOKJ5C.js → registry-command-X3O34FAK.js} +2 -2
  56. package/dist/{repo-security-plan-KZNEXDCI.js → repo-security-plan-XCX7EFJR.js} +3 -3
  57. package/dist/{research-helpers-synthesize-DH5PPX7A.js → research-helpers-synthesize-CGVR6M4S.js} +3 -4
  58. package/dist/{routing-memory-AGHJQTRH.js → routing-memory-YZRYGXQC.js} +2 -2
  59. package/dist/{session-memory-O24IVZAW.js → session-memory-SXQAA2EN.js} +3 -3
  60. package/dist/{setup-command-NBXZ4NGV.js → setup-command-VG7JZI6O.js} +11 -12
  61. package/dist/{setup-config-Y4JA5QWO.js → setup-config-VJAK6AA2.js} +3 -3
  62. package/dist/{setup-custom-api-UNX4OJEX.js → setup-custom-api-KSF2JMTS.js} +4 -5
  63. package/dist/{setup-custom-api-UNX4OJEX.js.map → setup-custom-api-KSF2JMTS.js.map} +1 -1
  64. package/dist/{tool-memory-UEQNXIGC.js → tool-memory-L7SDFSF5.js} +5 -5
  65. package/dist/{weather-report-S5YXRY7G.js → weather-report-D6HFOK7S.js} +2 -2
  66. package/package.json +1 -1
  67. package/dist/chunk-HKISF2E7.js.map +0 -1
  68. package/dist/chunk-IJ2AZZVH.js.map +0 -1
  69. package/dist/chunk-LJMO5P6O.js.map +0 -1
  70. package/dist/chunk-NESW2TTD.js +0 -134
  71. package/dist/chunk-NESW2TTD.js.map +0 -1
  72. package/dist/chunk-SMGH2B3A.js.map +0 -1
  73. package/dist/chunk-XVY3I7JT.js.map +0 -1
  74. /package/dist/{child-mcp-config-WNISXFYD.js.map → child-mcp-config-NW7JMSDK.js.map} +0 -0
  75. /package/dist/{chunk-BHA6V7GK.js.map → chunk-3H6Q3RZM.js.map} +0 -0
  76. /package/dist/{chunk-T73G67GT.js.map → chunk-3HXWI34V.js.map} +0 -0
  77. /package/dist/{chunk-RTUZSR4R.js.map → chunk-47Z3YPOK.js.map} +0 -0
  78. /package/dist/{chunk-G5IDRWWI.js.map → chunk-4NVYN2MB.js.map} +0 -0
  79. /package/dist/{chunk-5BTRDVWC.js.map → chunk-55G7KQ7F.js.map} +0 -0
  80. /package/dist/{chunk-WU3SUA35.js.map → chunk-5HBDXW44.js.map} +0 -0
  81. /package/dist/{chunk-JCETWDU7.js.map → chunk-6IWPN5UB.js.map} +0 -0
  82. /package/dist/{chunk-ULBKFMVO.js.map → chunk-BSHDI4BH.js.map} +0 -0
  83. /package/dist/{chunk-JEBWSHSU.js.map → chunk-D3JSXVX3.js.map} +0 -0
  84. /package/dist/{chunk-ZYHHDPFW.js.map → chunk-FTDVA33Z.js.map} +0 -0
  85. /package/dist/{chunk-2T4NV6QT.js.map → chunk-FXVJLJUF.js.map} +0 -0
  86. /package/dist/{chunk-SORBJPRA.js.map → chunk-G42N55ZR.js.map} +0 -0
  87. /package/dist/{chunk-SHSKW5ML.js.map → chunk-GC5FH2IA.js.map} +0 -0
  88. /package/dist/{chunk-FTCU55O6.js.map → chunk-KHZGMF2W.js.map} +0 -0
  89. /package/dist/{chunk-2IBJC2EP.js.map → chunk-LXROEQAO.js.map} +0 -0
  90. /package/dist/{chunk-CPH6LKXO.js.map → chunk-LZOTH2GI.js.map} +0 -0
  91. /package/dist/{chunk-DTFMYM3V.js.map → chunk-O4LVC4MQ.js.map} +0 -0
  92. /package/dist/{chunk-AZP66FIA.js.map → chunk-PFOY5ML6.js.map} +0 -0
  93. /package/dist/{chunk-K7VGX37L.js.map → chunk-TEKWQNQ2.js.map} +0 -0
  94. /package/dist/{chunk-BNHBZRU7.js.map → chunk-WGA4VGIR.js.map} +0 -0
  95. /package/dist/{chunk-57OH2O2U.js.map → chunk-Y3OOHHKQ.js.map} +0 -0
  96. /package/dist/{chunk-VSG6RSE6.js.map → chunk-YYXJ6RTO.js.map} +0 -0
  97. /package/dist/{chunk-E3QWWP67.js.map → chunk-ZICVVBDW.js.map} +0 -0
  98. /package/dist/{cli-circuit-breaker-6E4E2IU7.js.map → cli-circuit-breaker-LNU5DQSB.js.map} +0 -0
  99. /package/dist/{composite-router-MQOPXLVV.js.map → composite-router-DJ54ND5X.js.map} +0 -0
  100. /package/dist/{consensus-vote-ZRADOLXH.js.map → consensus-vote-XLEQFVE7.js.map} +0 -0
  101. /package/dist/{context-retriever-TZGIETJO.js.map → context-retriever-6O6TREXH.js.map} +0 -0
  102. /package/dist/{doctor-deep-OU2WC55V.js.map → doctor-deep-PSNJPELP.js.map} +0 -0
  103. /package/dist/{expert-bridge-WP5ZWXFY.js.map → expert-bridge-Q3OWPD4L.js.map} +0 -0
  104. /package/dist/{factory-2TN2VZTR.js.map → factory-43RVPRT5.js.map} +0 -0
  105. /package/dist/{factory-RJTRVII5.js.map → factory-PSMTMC7V.js.map} +0 -0
  106. /package/dist/{init-opencode-AYMNMWU7.js.map → init-opencode-25AUARJH.js.map} +0 -0
  107. /package/dist/{issue-triage-QIVZN3PJ.js.map → issue-triage-KZTENUDH.js.map} +0 -0
  108. /package/dist/{pr-reviewer-helpers-P24OBKVM.js.map → pr-reviewer-helpers-XENJ4E2T.js.map} +0 -0
  109. /package/dist/{registry-command-KWWOKJ5C.js.map → registry-command-X3O34FAK.js.map} +0 -0
  110. /package/dist/{repo-security-plan-KZNEXDCI.js.map → repo-security-plan-XCX7EFJR.js.map} +0 -0
  111. /package/dist/{research-helpers-synthesize-DH5PPX7A.js.map → research-helpers-synthesize-CGVR6M4S.js.map} +0 -0
  112. /package/dist/{routing-memory-AGHJQTRH.js.map → routing-memory-YZRYGXQC.js.map} +0 -0
  113. /package/dist/{session-memory-O24IVZAW.js.map → session-memory-SXQAA2EN.js.map} +0 -0
  114. /package/dist/{setup-command-NBXZ4NGV.js.map → setup-command-VG7JZI6O.js.map} +0 -0
  115. /package/dist/{setup-config-Y4JA5QWO.js.map → setup-config-VJAK6AA2.js.map} +0 -0
  116. /package/dist/{tool-memory-UEQNXIGC.js.map → tool-memory-L7SDFSF5.js.map} +0 -0
  117. /package/dist/{weather-report-S5YXRY7G.js.map → weather-report-D6HFOK7S.js.map} +0 -0
@@ -3,14 +3,14 @@ import {
3
3
  createStream,
4
4
  requireApiKey,
5
5
  validateApiKeyPresence
6
- } from "./chunk-JEBWSHSU.js";
6
+ } from "./chunk-D3JSXVX3.js";
7
7
  import {
8
8
  ModelCapability,
9
9
  err,
10
10
  getCliModelName,
11
11
  getTokenEstimator,
12
12
  ok
13
- } from "./chunk-HKISF2E7.js";
13
+ } from "./chunk-ECBH5INZ.js";
14
14
 
15
15
  // src/adapters/openai-types.ts
16
16
  var OPENAI_MODELS = {
@@ -553,4 +553,4 @@ export {
553
553
  OpenAIAdapter,
554
554
  createOpenAIAdapter
555
555
  };
556
- //# sourceMappingURL=chunk-BNHBZRU7.js.map
556
+ //# sourceMappingURL=chunk-WGA4VGIR.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLogger
3
- } from "./chunk-HKISF2E7.js";
3
+ } from "./chunk-ECBH5INZ.js";
4
4
 
5
5
  // src/config/available-models-cache.ts
6
6
  var logger = createLogger({ component: "available-models-cache" });
@@ -150,4 +150,4 @@ export {
150
150
  getDefaultAvailableModelsCache,
151
151
  setDefaultAvailableModelsCache
152
152
  };
153
- //# sourceMappingURL=chunk-57OH2O2U.js.map
153
+ //# sourceMappingURL=chunk-Y3OOHHKQ.js.map
@@ -9,11 +9,11 @@ import {
9
9
  gateWithReputation,
10
10
  resolveReputationGatingMode,
11
11
  sanitizeInput
12
- } from "./chunk-DTFMYM3V.js";
12
+ } from "./chunk-O4LVC4MQ.js";
13
13
  import {
14
14
  createLogger,
15
15
  getTimeProvider
16
- } from "./chunk-HKISF2E7.js";
16
+ } from "./chunk-ECBH5INZ.js";
17
17
 
18
18
  // src/dogfooding/pr-reviewer-helpers.ts
19
19
  import { randomUUID } from "crypto";
@@ -288,4 +288,4 @@ export {
288
288
  formatReviewComment,
289
289
  createFailedReview
290
290
  };
291
- //# sourceMappingURL=chunk-VSG6RSE6.js.map
291
+ //# sourceMappingURL=chunk-YYXJ6RTO.js.map
@@ -2,7 +2,7 @@ import {
2
2
  TASK_CATEGORIES,
3
3
  getAdaptiveBonus,
4
4
  getOutcomeStore
5
- } from "./chunk-HKISF2E7.js";
5
+ } from "./chunk-ECBH5INZ.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-E3QWWP67.js.map
109
+ //# sourceMappingURL=chunk-ZICVVBDW.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  CliCircuitBreakerIntegration,
3
3
  createCliCircuitBreakerIntegration
4
- } from "./chunk-T73G67GT.js";
5
- import "./chunk-RTUZSR4R.js";
6
- import "./chunk-HKISF2E7.js";
4
+ } from "./chunk-3HXWI34V.js";
5
+ import "./chunk-47Z3YPOK.js";
6
+ import "./chunk-ECBH5INZ.js";
7
7
  import "./chunk-CH7QIDHQ.js";
8
8
  import "./chunk-PR4QN5HX.js";
9
9
  export {
10
10
  CliCircuitBreakerIntegration,
11
11
  createCliCircuitBreakerIntegration
12
12
  };
13
- //# sourceMappingURL=cli-circuit-breaker-6E4E2IU7.js.map
13
+ //# sourceMappingURL=cli-circuit-breaker-LNU5DQSB.js.map
package/dist/cli.js CHANGED
@@ -13,19 +13,19 @@ import {
13
13
  generateSummary,
14
14
  parseFindings,
15
15
  sumFindings
16
- } from "./chunk-VSG6RSE6.js";
17
- import "./chunk-E3QWWP67.js";
16
+ } from "./chunk-YYXJ6RTO.js";
17
+ import "./chunk-ZICVVBDW.js";
18
18
  import {
19
19
  buildOpenAICompatAdapters,
20
20
  loadUsageEvents,
21
21
  readOpenAICompatEnv,
22
22
  rollupByModel
23
- } from "./chunk-AZP66FIA.js";
23
+ } from "./chunk-PFOY5ML6.js";
24
24
  import {
25
25
  setupCommandAsync,
26
26
  verifyCommand
27
- } from "./chunk-5BTRDVWC.js";
28
- import "./chunk-2T4NV6QT.js";
27
+ } from "./chunk-55G7KQ7F.js";
28
+ import "./chunk-FXVJLJUF.js";
29
29
  import {
30
30
  AuthHandler,
31
31
  DEFAULT_EXPERTS,
@@ -158,25 +158,29 @@ import {
158
158
  runImprovementReview,
159
159
  saveSourcesRegistry,
160
160
  setGlobalToolRateLimiterFactory,
161
+ shutdownFailoverSignals,
161
162
  shutdownFeedbackSubscriber,
163
+ shutdownSwarmHealthSignals,
164
+ startFailoverSignals,
162
165
  startFeedbackSubscriber,
166
+ startSwarmHealthSignals,
163
167
  validateArgs,
164
168
  validateCommand,
165
169
  validateWorkflow,
166
170
  wrapInMarkdownFence
167
- } from "./chunk-IJ2AZZVH.js";
171
+ } from "./chunk-FYGZ4MEQ.js";
168
172
  import {
169
173
  resolveToken
170
- } from "./chunk-WU3SUA35.js";
174
+ } from "./chunk-5HBDXW44.js";
171
175
  import {
172
176
  CATEGORY_DISPLAY_NAMES,
173
177
  DEFAULT_PR_REVIEW_CONFIG
174
178
  } from "./chunk-OK6U5N5Y.js";
175
- import "./chunk-BNHBZRU7.js";
176
- import "./chunk-T73G67GT.js";
179
+ import "./chunk-WGA4VGIR.js";
180
+ import "./chunk-3HXWI34V.js";
177
181
  import {
178
182
  shutdownExpertBridge
179
- } from "./chunk-XVY3I7JT.js";
183
+ } from "./chunk-2X24T4ZD.js";
180
184
  import {
181
185
  DEFAULT_VOTE_TIMEOUT_MS,
182
186
  ErrorPolicySchema,
@@ -194,34 +198,34 @@ import {
194
198
  toolSuccessStructured,
195
199
  warnIfSimulatedOutsideTests,
196
200
  wrapToolWithTimeout
197
- } from "./chunk-LJMO5P6O.js";
198
- import "./chunk-JEBWSHSU.js";
199
- import "./chunk-2IBJC2EP.js";
201
+ } from "./chunk-VTMQND6B.js";
202
+ import "./chunk-D3JSXVX3.js";
203
+ import "./chunk-LXROEQAO.js";
200
204
  import {
201
205
  loadPapersRegistry,
202
206
  loadTechniquesRegistry,
203
207
  savePapersRegistry,
204
208
  synthesizeResearch
205
- } from "./chunk-ZOAU7RE4.js";
209
+ } from "./chunk-ECZW5FXN.js";
206
210
  import {
207
211
  classifyTrust,
208
212
  createFullGitHubProvider,
209
213
  evaluatePolicy,
210
214
  parsePRUrl
211
- } from "./chunk-G5IDRWWI.js";
212
- import "./chunk-CPH6LKXO.js";
215
+ } from "./chunk-4NVYN2MB.js";
216
+ import "./chunk-LZOTH2GI.js";
213
217
  import {
214
218
  ReputationCache,
215
219
  sanitizeInput
216
- } from "./chunk-DTFMYM3V.js";
217
- import "./chunk-ULBKFMVO.js";
220
+ } from "./chunk-O4LVC4MQ.js";
221
+ import "./chunk-BSHDI4BH.js";
218
222
  import "./chunk-HFOQKCD2.js";
219
223
  import "./chunk-3ACDP4E6.js";
220
- import "./chunk-K7VGX37L.js";
224
+ import "./chunk-TEKWQNQ2.js";
221
225
  import {
222
226
  MemoryError,
223
227
  shutdownToolMemory
224
- } from "./chunk-FTCU55O6.js";
228
+ } from "./chunk-KHZGMF2W.js";
225
229
  import {
226
230
  CustomExpertDefinitionSchema,
227
231
  DATA_SUBDIRECTORIES,
@@ -240,16 +244,13 @@ import {
240
244
  loadConfig,
241
245
  runDoctor,
242
246
  validateNexusEnv
243
- } from "./chunk-SHSKW5ML.js";
244
- import "./chunk-SMGH2B3A.js";
245
- import "./chunk-57OH2O2U.js";
247
+ } from "./chunk-GC5FH2IA.js";
248
+ import "./chunk-QUPPV6UO.js";
249
+ import "./chunk-Y3OOHHKQ.js";
246
250
  import {
247
251
  DEFAULTS
248
- } from "./chunk-4A4WPM75.js";
252
+ } from "./chunk-7GUP6KQQ.js";
249
253
  import "./chunk-NUBSJGQZ.js";
250
- import {
251
- parseBoolEnv
252
- } from "./chunk-NESW2TTD.js";
253
254
  import {
254
255
  capitalize,
255
256
  capitalizeKebab,
@@ -260,12 +261,12 @@ import {
260
261
  getAvailableClis,
261
262
  isRecord,
262
263
  probeAllClis
263
- } from "./chunk-BHA6V7GK.js";
264
- import "./chunk-RTUZSR4R.js";
265
- import "./chunk-SORBJPRA.js";
264
+ } from "./chunk-3H6Q3RZM.js";
265
+ import "./chunk-47Z3YPOK.js";
266
+ import "./chunk-G42N55ZR.js";
266
267
  import "./chunk-ZM4O442V.js";
267
268
  import "./chunk-PQHVC4BD.js";
268
- import "./chunk-JCETWDU7.js";
269
+ import "./chunk-6IWPN5UB.js";
269
270
  import {
270
271
  API_TIMEOUTS,
271
272
  AgentCapability,
@@ -317,9 +318,11 @@ import {
317
318
  getPipelineEventBus,
318
319
  getRandomProvider,
319
320
  getTimeProvider,
321
+ getTuneAdjustmentStore,
320
322
  logger,
321
323
  lookupInTreeCapability,
322
324
  ok,
325
+ parseBoolEnv,
323
326
  parseTierOverrides,
324
327
  resetOutcomeStore,
325
328
  runWarmUp,
@@ -333,7 +336,7 @@ import {
333
336
  validateTimeout,
334
337
  writeEmptyLine,
335
338
  writeLine
336
- } from "./chunk-HKISF2E7.js";
339
+ } from "./chunk-ECBH5INZ.js";
337
340
  import {
338
341
  applyPortableMode,
339
342
  detectSandbox,
@@ -3112,7 +3115,7 @@ ${file.patch}
3112
3115
  violations: policyResult.violations
3113
3116
  });
3114
3117
  }
3115
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-P24OBKVM.js");
3118
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-XENJ4E2T.js");
3116
3119
  const body = formatReviewComment2(result);
3117
3120
  const postResult = await provider.createReview(pr.prNumber, body, result.decision);
3118
3121
  if (!postResult.ok) {
@@ -17430,6 +17433,9 @@ function runStpaSafetyAnalysis(logger18, failOnHighSeverity) {
17430
17433
 
17431
17434
  // src/pipeline/tune-stage.ts
17432
17435
  var defaultLogger = createLogger({ component: "TuneStage" });
17436
+ var TUNE_ENFORCE_ENV = "NEXUS_TUNE_ENFORCE";
17437
+ var TUNE_ENFORCE_DEMOTION = 0.15;
17438
+ var AUDIT_REASON_MAX = 512;
17433
17439
  var TUNE_SIGNAL_TYPES = [
17434
17440
  "signal.fitness_declined",
17435
17441
  "signal.swarm_unhealthy",
@@ -17459,20 +17465,70 @@ function intendedActionFor(event) {
17459
17465
  return void 0;
17460
17466
  }
17461
17467
  }
17468
+ function auditDemotion(auditLogger, agentId, adjustment, log) {
17469
+ if (auditLogger === void 0 || adjustment === void 0) return;
17470
+ const reason = adjustment.reason.length > AUDIT_REASON_MAX ? adjustment.reason.slice(0, AUDIT_REASON_MAX) : adjustment.reason;
17471
+ try {
17472
+ auditLogger.log({
17473
+ category: "configuration",
17474
+ severity: "warning",
17475
+ outcome: "success",
17476
+ action: "tune.demote",
17477
+ actor: { type: "system", id: "tune-stage" },
17478
+ description: `Bounded routing demotion applied to ${agentId} (swarm_unhealthy)`,
17479
+ metadata: {
17480
+ cli: agentId,
17481
+ magnitude: TUNE_ENFORCE_DEMOTION,
17482
+ multiplier: adjustment.multiplier,
17483
+ reason,
17484
+ provenance: "signal.swarm_unhealthy",
17485
+ appliedAt: adjustment.appliedAt
17486
+ }
17487
+ });
17488
+ } catch (auditError) {
17489
+ log.warn("TuneStage \u2014 audit log failed (demotion still applied)", {
17490
+ error: getErrorMessage(auditError)
17491
+ });
17492
+ }
17493
+ }
17494
+ function enforceSwarmDemotion(event, action, auditLogger, log) {
17495
+ const adjustment = getTuneAdjustmentStore().demote(
17496
+ event.agentId,
17497
+ TUNE_ENFORCE_DEMOTION,
17498
+ `swarm_unhealthy: ${event.reason}`
17499
+ );
17500
+ log.info("TuneStage (enforce) \u2014 applied bounded routing demotion", {
17501
+ kind: action.kind,
17502
+ signal: action.signal,
17503
+ agentId: event.agentId,
17504
+ reason: event.reason,
17505
+ multiplier: adjustment?.multiplier
17506
+ });
17507
+ auditDemotion(auditLogger, event.agentId, adjustment, log);
17508
+ }
17462
17509
  function createTuneStage(bus, options = {}) {
17463
17510
  const enabled = options.enabled ?? false;
17464
17511
  const log = options.logger ?? defaultLogger;
17512
+ const auditLogger = options.auditLogger;
17465
17513
  return bus.subscribe({ type: [...TUNE_SIGNAL_TYPES] }, (event) => {
17466
17514
  try {
17467
17515
  const action = intendedActionFor(event);
17468
17516
  if (action === void 0) return;
17469
17517
  if (enabled) {
17470
- log.warn("TuneStage enabled but bounded mutation is not implemented yet; no-op", {
17518
+ if (event.type === "signal.swarm_unhealthy") {
17519
+ enforceSwarmDemotion(event, action, auditLogger, log);
17520
+ return;
17521
+ }
17522
+ log.info("TuneStage (enforce) \u2014 non-routing action, shadow-only", {
17471
17523
  kind: action.kind,
17472
- signal: action.signal
17524
+ signal: action.signal,
17525
+ detail: action.detail
17473
17526
  });
17474
17527
  return;
17475
17528
  }
17529
+ if (event.type === "signal.swarm_unhealthy") {
17530
+ getTuneAdjustmentStore().recordIntended(event.agentId, `swarm_unhealthy: ${event.reason}`);
17531
+ }
17476
17532
  log.info("TuneStage (shadow) \u2014 intended action", {
17477
17533
  kind: action.kind,
17478
17534
  signal: action.signal,
@@ -17486,7 +17542,8 @@ function createTuneStage(bus, options = {}) {
17486
17542
  var cachedTuneUnsubscribe = null;
17487
17543
  function startTuneStage(bus, options) {
17488
17544
  if (cachedTuneUnsubscribe !== null) return;
17489
- cachedTuneUnsubscribe = createTuneStage(bus, options);
17545
+ const enabled = options?.enabled ?? parseBoolEnv(TUNE_ENFORCE_ENV, false);
17546
+ cachedTuneUnsubscribe = createTuneStage(bus, { ...options, enabled });
17490
17547
  }
17491
17548
  function shutdownTuneStage() {
17492
17549
  if (cachedTuneUnsubscribe !== null) {
@@ -18015,12 +18072,14 @@ function registerToolCategories(ctx) {
18015
18072
  if (allowed(tool.name)) tool.register(ctx.server, buildStandardDeps(ctx, tool.name));
18016
18073
  }
18017
18074
  }
18018
- function initV2PipelineSubsystems(logger18) {
18075
+ function initV2PipelineSubsystems(logger18, auditLogger) {
18019
18076
  const pluginRegistry = getPipelinePluginRegistry();
18020
18077
  const pipelineEventBus = getPipelineEventBus();
18021
18078
  const bridge = createEventBusBridge({ source: pipelineEventBus });
18022
18079
  startFeedbackSubscriber(pipelineEventBus, getOutcomeStore());
18023
- startTuneStage(pipelineEventBus);
18080
+ startTuneStage(pipelineEventBus, auditLogger !== void 0 ? { auditLogger } : void 0);
18081
+ startSwarmHealthSignals(getSwarmObserver(), pipelineEventBus);
18082
+ startFailoverSignals({ pipelineBus: pipelineEventBus });
18024
18083
  const policyEngine = createDefaultPolicyEngine();
18025
18084
  const v2Config = resolveV2Config();
18026
18085
  logger18.info("V2 Pipeline OS initialized", {
@@ -18055,7 +18114,7 @@ function registerMcpTools(options) {
18055
18114
  logger: toolInfra.logger
18056
18115
  });
18057
18116
  setGlobalToolRateLimiterFactory(rateLimiterFactory);
18058
- initV2PipelineSubsystems(logger18);
18117
+ initV2PipelineSubsystems(logger18, options.auditLogger);
18059
18118
  const gatewayOptions = { ...options, server: observableServer };
18060
18119
  const ctx = createToolContext(gatewayOptions, toolInfra, rateLimiterFactory);
18061
18120
  registerToolCategories(ctx);
@@ -19346,7 +19405,7 @@ function adaptConfigToLibrary(config) {
19346
19405
  }
19347
19406
  function createBeliefPromoter() {
19348
19407
  return async (event) => {
19349
- const { getToolMemory } = await import("./tool-memory-UEQNXIGC.js");
19408
+ const { getToolMemory } = await import("./tool-memory-L7SDFSF5.js");
19350
19409
  const tm = getToolMemory();
19351
19410
  await tm.recordBelief(
19352
19411
  `skill:${event.name}`,
@@ -19661,6 +19720,8 @@ function createShutdownCleanup(options) {
19661
19720
  await shutdownExpertBridge();
19662
19721
  shutdownFeedbackSubscriber();
19663
19722
  shutdownTuneStage();
19723
+ shutdownSwarmHealthSignals();
19724
+ shutdownFailoverSignals();
19664
19725
  const closeResult = await closeServer(server, serverLogger);
19665
19726
  if (!closeResult.ok) {
19666
19727
  throw new Error(closeResult.error.message);
@@ -19716,7 +19777,8 @@ function buildGatewayConfig(config, logger18) {
19716
19777
  ...tierOverrides !== void 0 && { tierOverrides }
19717
19778
  };
19718
19779
  }
19719
- async function initializeAndRegisterTools(server, logger18, policyFirewall, config, feedbackIntegration) {
19780
+ async function initializeAndRegisterTools(server, logger18, policyFirewall, config, deps) {
19781
+ const { feedbackIntegration, auditLogger } = deps ?? {};
19720
19782
  logger18.info("Loading built-in workflow templates");
19721
19783
  const builtInTemplates = await initializeBuiltInTemplates();
19722
19784
  logger18.info("Loaded built-in templates", { count: builtInTemplates.size });
@@ -19739,7 +19801,8 @@ async function initializeAndRegisterTools(server, logger18, policyFirewall, conf
19739
19801
  ...allowedPaths !== void 0 && { allowedPaths },
19740
19802
  ...securityConfig !== void 0 && { securityConfig },
19741
19803
  ...workflowConfig !== void 0 && { workflowConfig },
19742
- ...feedbackIntegration !== void 0 && { feedbackIntegration }
19804
+ ...feedbackIntegration !== void 0 && { feedbackIntegration },
19805
+ ...auditLogger !== null && auditLogger !== void 0 && { auditLogger }
19743
19806
  };
19744
19807
  registerMcpTools(toolsOptions);
19745
19808
  }
@@ -19790,13 +19853,10 @@ async function initializeSubsystems(config, logger18) {
19790
19853
  const policyFirewall = logSecurityConfig(serverLogger, config);
19791
19854
  const auditLogger = initializeAuditLogger(config.security, serverLogger);
19792
19855
  initializeAuth(config, serverLogger);
19793
- await initializeAndRegisterTools(
19794
- server,
19795
- serverLogger,
19796
- policyFirewall,
19797
- config,
19798
- feedbackResult.feedbackIntegration
19799
- );
19856
+ await initializeAndRegisterTools(server, serverLogger, policyFirewall, config, {
19857
+ feedbackIntegration: feedbackResult.feedbackIntegration,
19858
+ auditLogger
19859
+ });
19800
19860
  return { server, serverLogger, observer, eventBusBridge, auditLogger };
19801
19861
  }
19802
19862
  var SERVER_STARTUP_TIMEOUT_MS = 3e4;
@@ -20210,7 +20270,7 @@ async function handleResearchCommand(args) {
20210
20270
  }
20211
20271
  }
20212
20272
  async function handleRegistryCommand(args) {
20213
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-KWWOKJ5C.js");
20273
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-X3O34FAK.js");
20214
20274
  const subcommand = args.subcommand;
20215
20275
  if (!isValidRegistrySubcommand(subcommand)) {
20216
20276
  process.stdout.write(`${formatRegistryUsage()}
@@ -20258,7 +20318,7 @@ async function handleVerifyCommand(args) {
20258
20318
  async function handleDoctorCommand(args) {
20259
20319
  const exitCode = await doctorCommand({ fix: args.options.fix });
20260
20320
  if (args.options.deep) {
20261
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-OU2WC55V.js");
20321
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-PSNJPELP.js");
20262
20322
  const diag = runDeepDiagnostics2();
20263
20323
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
20264
20324
  }
@@ -20302,7 +20362,7 @@ async function handleInitCommand(args) {
20302
20362
  process.exit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20303
20363
  }
20304
20364
  async function runInitOpencodeFlow(args) {
20305
- const { runInitOpencode } = await import("./init-opencode-AYMNMWU7.js");
20365
+ const { runInitOpencode } = await import("./init-opencode-25AUARJH.js");
20306
20366
  const opencodePath = args.options.opencode;
20307
20367
  if (opencodePath === void 0 || opencodePath === "") {
20308
20368
  process.stderr.write("Error: --opencode requires a path argument.\n");
@@ -20329,7 +20389,7 @@ async function runInitOpencodeFlow(args) {
20329
20389
  process.exit(EXIT_CODES.SUCCESS);
20330
20390
  }
20331
20391
  async function renderOpencodeValidate(opencodePath) {
20332
- const { runOpencodeValidate } = await import("./init-opencode-AYMNMWU7.js");
20392
+ const { runOpencodeValidate } = await import("./init-opencode-25AUARJH.js");
20333
20393
  const result = await runOpencodeValidate(opencodePath);
20334
20394
  if (!result.ok) {
20335
20395
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -20369,7 +20429,7 @@ async function handleSetupCommandAsync(args) {
20369
20429
  process.exit(exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20370
20430
  }
20371
20431
  async function runCustomApiSetup(args) {
20372
- const { configureCustomApi } = await import("./setup-custom-api-UNX4OJEX.js");
20432
+ const { configureCustomApi } = await import("./setup-custom-api-KSF2JMTS.js");
20373
20433
  const baseUrl = args.options.customApi;
20374
20434
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
20375
20435
  const input = {
@@ -22345,6 +22405,7 @@ function collectHealth() {
22345
22405
  failureBreakdown: report.failureBreakdown ?? [],
22346
22406
  cliCount: report.cliWeather.length,
22347
22407
  cliHealth: report.cliWeather.map(toCliSummary),
22408
+ tuneAdjustments: getTuneAdjustmentStore().demotionStats(),
22348
22409
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
22349
22410
  };
22350
22411
  }
@@ -22460,6 +22521,22 @@ ${c.bold}nexus-agents${c.reset}`);
22460
22521
  `);
22461
22522
  }
22462
22523
  renderFailureBreakdown(w, health.failureBreakdown);
22524
+ renderTuneAdjustments(w, health.tuneAdjustments);
22525
+ }
22526
+ function renderTuneAdjustments(w, stats) {
22527
+ if (stats.length === 0) return;
22528
+ const c = colors;
22529
+ w(
22530
+ ` ${c.bold}Self-Tuning Demotions${c.reset} ${c.dim}(applied = enforced, intended = shadow)${c.reset}
22531
+ `
22532
+ );
22533
+ for (const stat2 of stats) {
22534
+ w(
22535
+ ` ${stat2.cli.padEnd(10)} applied: ${c.cyan}${String(stat2.applied)}${c.reset} intended: ${c.cyan}${String(stat2.intended)}${c.reset} ${c.dim}${stat2.lastReason}${c.reset}
22536
+ `
22537
+ );
22538
+ }
22539
+ w("\n");
22463
22540
  }
22464
22541
  function renderJson2(health) {
22465
22542
  process.stdout.write(JSON.stringify(health, null, 2) + "\n");