nexus-agents 2.92.5 → 2.93.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 (119) hide show
  1. package/dist/{child-mcp-config-PIDVHWJ7.js → child-mcp-config-WNISXFYD.js} +2 -2
  2. package/dist/{chunk-SIICMKBA.js → chunk-2IBJC2EP.js} +2 -2
  3. package/dist/chunk-2IBJC2EP.js.map +1 -0
  4. package/dist/{chunk-WXEMTPML.js → chunk-2T4NV6QT.js} +2 -2
  5. package/dist/{chunk-PIDABDFE.js → chunk-4A4WPM75.js} +10 -126
  6. package/dist/chunk-4A4WPM75.js.map +1 -0
  7. package/dist/{chunk-U4RLBLNO.js → chunk-57OH2O2U.js} +2 -2
  8. package/dist/{chunk-3XC5LFWH.js → chunk-5BTRDVWC.js} +5 -5
  9. package/dist/{chunk-QQMYKFG7.js → chunk-AZP66FIA.js} +3 -3
  10. package/dist/{chunk-DNSBKQ7I.js → chunk-BHA6V7GK.js} +4 -4
  11. package/dist/{chunk-TOQJ3UN5.js → chunk-BNHBZRU7.js} +3 -3
  12. package/dist/{chunk-YQAS2EGR.js → chunk-CPH6LKXO.js} +2 -2
  13. package/dist/{chunk-VBIAMMZZ.js → chunk-DTFMYM3V.js} +2 -2
  14. package/dist/{chunk-QADQ4LN4.js → chunk-E3QWWP67.js} +2 -2
  15. package/dist/{chunk-FL3AXIUL.js → chunk-FTCU55O6.js} +4 -4
  16. package/dist/{chunk-BG4WK4UP.js → chunk-G5IDRWWI.js} +15 -6
  17. package/dist/chunk-G5IDRWWI.js.map +1 -0
  18. package/dist/{chunk-L5BXCSMP.js → chunk-HKISF2E7.js} +183 -10
  19. package/dist/chunk-HKISF2E7.js.map +1 -0
  20. package/dist/{chunk-KTJUMU2A.js → chunk-IJ2AZZVH.js} +66 -48
  21. package/dist/chunk-IJ2AZZVH.js.map +1 -0
  22. package/dist/{chunk-OXLXVSN3.js → chunk-JCETWDU7.js} +2 -2
  23. package/dist/{chunk-DSERRMPX.js → chunk-JEBWSHSU.js} +2 -2
  24. package/dist/{chunk-VU54VB6K.js → chunk-K7VGX37L.js} +3 -3
  25. package/dist/{chunk-NYWZI46K.js → chunk-LJMO5P6O.js} +38 -128
  26. package/dist/chunk-LJMO5P6O.js.map +1 -0
  27. package/dist/chunk-NESW2TTD.js +134 -0
  28. package/dist/chunk-NESW2TTD.js.map +1 -0
  29. package/dist/{chunk-MBK6P4VV.js → chunk-RTUZSR4R.js} +2 -2
  30. package/dist/{chunk-QXGLZETS.js → chunk-SHSKW5ML.js} +7 -7
  31. package/dist/{chunk-YJUHVQSG.js → chunk-SMGH2B3A.js} +2 -2
  32. package/dist/{chunk-ZYYU26YH.js → chunk-SORBJPRA.js} +2 -2
  33. package/dist/{chunk-EI2E43HI.js → chunk-T73G67GT.js} +3 -3
  34. package/dist/{chunk-2QJJYCPD.js → chunk-ULBKFMVO.js} +2 -2
  35. package/dist/{chunk-3TU3RJNK.js → chunk-VSG6RSE6.js} +3 -3
  36. package/dist/{chunk-DQEREDUW.js → chunk-WU3SUA35.js} +2 -2
  37. package/dist/{chunk-G55LVPNH.js → chunk-XVY3I7JT.js} +7 -7
  38. package/dist/{chunk-P646QQYW.js → chunk-ZOAU7RE4.js} +6 -4
  39. package/dist/chunk-ZOAU7RE4.js.map +1 -0
  40. package/dist/{chunk-GKFFRRS4.js → chunk-ZYHHDPFW.js} +4 -4
  41. package/dist/{cli-circuit-breaker-HFSOBCPK.js → cli-circuit-breaker-6E4E2IU7.js} +4 -4
  42. package/dist/cli.js +109 -38
  43. package/dist/cli.js.map +1 -1
  44. package/dist/{composite-router-T2XYCQOU.js → composite-router-MQOPXLVV.js} +2 -2
  45. package/dist/{consensus-vote-IDHQVKX2.js → consensus-vote-ZRADOLXH.js} +13 -12
  46. package/dist/{context-retriever-5BJYPAX7.js → context-retriever-TZGIETJO.js} +6 -6
  47. package/dist/{doctor-deep-OVGRBG3Z.js → doctor-deep-OU2WC55V.js} +3 -3
  48. package/dist/{expert-bridge-JPTHFWPW.js → expert-bridge-WP5ZWXFY.js} +4 -4
  49. package/dist/{factory-NE7SNW7V.js → factory-2TN2VZTR.js} +5 -5
  50. package/dist/{factory-734UWF4C.js → factory-RJTRVII5.js} +5 -5
  51. package/dist/index.d.ts +52 -9
  52. package/dist/index.js +199 -55
  53. package/dist/index.js.map +1 -1
  54. package/dist/{init-opencode-2ZBDJILW.js → init-opencode-AYMNMWU7.js} +5 -5
  55. package/dist/{issue-triage-AGGTH767.js → issue-triage-QIVZN3PJ.js} +5 -5
  56. package/dist/{pr-reviewer-helpers-WGPLUXPU.js → pr-reviewer-helpers-P24OBKVM.js} +4 -4
  57. package/dist/{registry-command-CZZM5SF2.js → registry-command-KWWOKJ5C.js} +2 -2
  58. package/dist/{repo-security-plan-X42KXHT2.js → repo-security-plan-KZNEXDCI.js} +3 -3
  59. package/dist/{research-helpers-synthesize-C7YGRQI6.js → research-helpers-synthesize-DH5PPX7A.js} +4 -3
  60. package/dist/{routing-memory-2FYZDQUC.js → routing-memory-AGHJQTRH.js} +2 -2
  61. package/dist/{session-memory-53NZRZB6.js → session-memory-O24IVZAW.js} +3 -3
  62. package/dist/{setup-command-ZV6VZLP4.js → setup-command-NBXZ4NGV.js} +12 -11
  63. package/dist/{setup-config-CYRK4UFF.js → setup-config-Y4JA5QWO.js} +3 -3
  64. package/dist/{setup-custom-api-GXHPYLDR.js → setup-custom-api-UNX4OJEX.js} +5 -4
  65. package/dist/{setup-custom-api-GXHPYLDR.js.map → setup-custom-api-UNX4OJEX.js.map} +1 -1
  66. package/dist/{tool-memory-AX5G67J6.js → tool-memory-UEQNXIGC.js} +5 -5
  67. package/dist/{weather-report-AUMNGHYZ.js → weather-report-S5YXRY7G.js} +2 -2
  68. package/package.json +1 -1
  69. package/dist/chunk-BG4WK4UP.js.map +0 -1
  70. package/dist/chunk-KTJUMU2A.js.map +0 -1
  71. package/dist/chunk-L5BXCSMP.js.map +0 -1
  72. package/dist/chunk-NYWZI46K.js.map +0 -1
  73. package/dist/chunk-P646QQYW.js.map +0 -1
  74. package/dist/chunk-PIDABDFE.js.map +0 -1
  75. package/dist/chunk-SIICMKBA.js.map +0 -1
  76. /package/dist/{child-mcp-config-PIDVHWJ7.js.map → child-mcp-config-WNISXFYD.js.map} +0 -0
  77. /package/dist/{chunk-WXEMTPML.js.map → chunk-2T4NV6QT.js.map} +0 -0
  78. /package/dist/{chunk-U4RLBLNO.js.map → chunk-57OH2O2U.js.map} +0 -0
  79. /package/dist/{chunk-3XC5LFWH.js.map → chunk-5BTRDVWC.js.map} +0 -0
  80. /package/dist/{chunk-QQMYKFG7.js.map → chunk-AZP66FIA.js.map} +0 -0
  81. /package/dist/{chunk-DNSBKQ7I.js.map → chunk-BHA6V7GK.js.map} +0 -0
  82. /package/dist/{chunk-TOQJ3UN5.js.map → chunk-BNHBZRU7.js.map} +0 -0
  83. /package/dist/{chunk-YQAS2EGR.js.map → chunk-CPH6LKXO.js.map} +0 -0
  84. /package/dist/{chunk-VBIAMMZZ.js.map → chunk-DTFMYM3V.js.map} +0 -0
  85. /package/dist/{chunk-QADQ4LN4.js.map → chunk-E3QWWP67.js.map} +0 -0
  86. /package/dist/{chunk-FL3AXIUL.js.map → chunk-FTCU55O6.js.map} +0 -0
  87. /package/dist/{chunk-OXLXVSN3.js.map → chunk-JCETWDU7.js.map} +0 -0
  88. /package/dist/{chunk-DSERRMPX.js.map → chunk-JEBWSHSU.js.map} +0 -0
  89. /package/dist/{chunk-VU54VB6K.js.map → chunk-K7VGX37L.js.map} +0 -0
  90. /package/dist/{chunk-MBK6P4VV.js.map → chunk-RTUZSR4R.js.map} +0 -0
  91. /package/dist/{chunk-QXGLZETS.js.map → chunk-SHSKW5ML.js.map} +0 -0
  92. /package/dist/{chunk-YJUHVQSG.js.map → chunk-SMGH2B3A.js.map} +0 -0
  93. /package/dist/{chunk-ZYYU26YH.js.map → chunk-SORBJPRA.js.map} +0 -0
  94. /package/dist/{chunk-EI2E43HI.js.map → chunk-T73G67GT.js.map} +0 -0
  95. /package/dist/{chunk-2QJJYCPD.js.map → chunk-ULBKFMVO.js.map} +0 -0
  96. /package/dist/{chunk-3TU3RJNK.js.map → chunk-VSG6RSE6.js.map} +0 -0
  97. /package/dist/{chunk-DQEREDUW.js.map → chunk-WU3SUA35.js.map} +0 -0
  98. /package/dist/{chunk-G55LVPNH.js.map → chunk-XVY3I7JT.js.map} +0 -0
  99. /package/dist/{chunk-GKFFRRS4.js.map → chunk-ZYHHDPFW.js.map} +0 -0
  100. /package/dist/{cli-circuit-breaker-HFSOBCPK.js.map → cli-circuit-breaker-6E4E2IU7.js.map} +0 -0
  101. /package/dist/{composite-router-T2XYCQOU.js.map → composite-router-MQOPXLVV.js.map} +0 -0
  102. /package/dist/{consensus-vote-IDHQVKX2.js.map → consensus-vote-ZRADOLXH.js.map} +0 -0
  103. /package/dist/{context-retriever-5BJYPAX7.js.map → context-retriever-TZGIETJO.js.map} +0 -0
  104. /package/dist/{doctor-deep-OVGRBG3Z.js.map → doctor-deep-OU2WC55V.js.map} +0 -0
  105. /package/dist/{expert-bridge-JPTHFWPW.js.map → expert-bridge-WP5ZWXFY.js.map} +0 -0
  106. /package/dist/{factory-734UWF4C.js.map → factory-2TN2VZTR.js.map} +0 -0
  107. /package/dist/{factory-NE7SNW7V.js.map → factory-RJTRVII5.js.map} +0 -0
  108. /package/dist/{init-opencode-2ZBDJILW.js.map → init-opencode-AYMNMWU7.js.map} +0 -0
  109. /package/dist/{issue-triage-AGGTH767.js.map → issue-triage-QIVZN3PJ.js.map} +0 -0
  110. /package/dist/{pr-reviewer-helpers-WGPLUXPU.js.map → pr-reviewer-helpers-P24OBKVM.js.map} +0 -0
  111. /package/dist/{registry-command-CZZM5SF2.js.map → registry-command-KWWOKJ5C.js.map} +0 -0
  112. /package/dist/{repo-security-plan-X42KXHT2.js.map → repo-security-plan-KZNEXDCI.js.map} +0 -0
  113. /package/dist/{research-helpers-synthesize-C7YGRQI6.js.map → research-helpers-synthesize-DH5PPX7A.js.map} +0 -0
  114. /package/dist/{routing-memory-2FYZDQUC.js.map → routing-memory-AGHJQTRH.js.map} +0 -0
  115. /package/dist/{session-memory-53NZRZB6.js.map → session-memory-O24IVZAW.js.map} +0 -0
  116. /package/dist/{setup-command-ZV6VZLP4.js.map → setup-command-NBXZ4NGV.js.map} +0 -0
  117. /package/dist/{setup-config-CYRK4UFF.js.map → setup-config-Y4JA5QWO.js.map} +0 -0
  118. /package/dist/{tool-memory-AX5G67J6.js.map → tool-memory-UEQNXIGC.js.map} +0 -0
  119. /package/dist/{weather-report-AUMNGHYZ.js.map → weather-report-S5YXRY7G.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  CliCircuitBreakerIntegration,
3
3
  createCliCircuitBreakerIntegration
4
- } from "./chunk-EI2E43HI.js";
5
- import "./chunk-MBK6P4VV.js";
6
- import "./chunk-L5BXCSMP.js";
4
+ } from "./chunk-T73G67GT.js";
5
+ import "./chunk-RTUZSR4R.js";
6
+ import "./chunk-HKISF2E7.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-HFSOBCPK.js.map
13
+ //# sourceMappingURL=cli-circuit-breaker-6E4E2IU7.js.map
package/dist/cli.js CHANGED
@@ -13,19 +13,19 @@ import {
13
13
  generateSummary,
14
14
  parseFindings,
15
15
  sumFindings
16
- } from "./chunk-3TU3RJNK.js";
17
- import "./chunk-QADQ4LN4.js";
16
+ } from "./chunk-VSG6RSE6.js";
17
+ import "./chunk-E3QWWP67.js";
18
18
  import {
19
19
  buildOpenAICompatAdapters,
20
20
  loadUsageEvents,
21
21
  readOpenAICompatEnv,
22
22
  rollupByModel
23
- } from "./chunk-QQMYKFG7.js";
23
+ } from "./chunk-AZP66FIA.js";
24
24
  import {
25
25
  setupCommandAsync,
26
26
  verifyCommand
27
- } from "./chunk-3XC5LFWH.js";
28
- import "./chunk-WXEMTPML.js";
27
+ } from "./chunk-5BTRDVWC.js";
28
+ import "./chunk-2T4NV6QT.js";
29
29
  import {
30
30
  AuthHandler,
31
31
  DEFAULT_EXPERTS,
@@ -164,19 +164,19 @@ import {
164
164
  validateCommand,
165
165
  validateWorkflow,
166
166
  wrapInMarkdownFence
167
- } from "./chunk-KTJUMU2A.js";
167
+ } from "./chunk-IJ2AZZVH.js";
168
168
  import {
169
169
  resolveToken
170
- } from "./chunk-DQEREDUW.js";
170
+ } from "./chunk-WU3SUA35.js";
171
171
  import {
172
172
  CATEGORY_DISPLAY_NAMES,
173
173
  DEFAULT_PR_REVIEW_CONFIG
174
174
  } from "./chunk-OK6U5N5Y.js";
175
- import "./chunk-TOQJ3UN5.js";
176
- import "./chunk-EI2E43HI.js";
175
+ import "./chunk-BNHBZRU7.js";
176
+ import "./chunk-T73G67GT.js";
177
177
  import {
178
178
  shutdownExpertBridge
179
- } from "./chunk-G55LVPNH.js";
179
+ } from "./chunk-XVY3I7JT.js";
180
180
  import {
181
181
  DEFAULT_VOTE_TIMEOUT_MS,
182
182
  ErrorPolicySchema,
@@ -194,34 +194,34 @@ import {
194
194
  toolSuccessStructured,
195
195
  warnIfSimulatedOutsideTests,
196
196
  wrapToolWithTimeout
197
- } from "./chunk-NYWZI46K.js";
198
- import "./chunk-DSERRMPX.js";
199
- import "./chunk-SIICMKBA.js";
197
+ } from "./chunk-LJMO5P6O.js";
198
+ import "./chunk-JEBWSHSU.js";
199
+ import "./chunk-2IBJC2EP.js";
200
200
  import {
201
201
  loadPapersRegistry,
202
202
  loadTechniquesRegistry,
203
203
  savePapersRegistry,
204
204
  synthesizeResearch
205
- } from "./chunk-P646QQYW.js";
205
+ } from "./chunk-ZOAU7RE4.js";
206
206
  import {
207
207
  classifyTrust,
208
208
  createFullGitHubProvider,
209
209
  evaluatePolicy,
210
210
  parsePRUrl
211
- } from "./chunk-BG4WK4UP.js";
212
- import "./chunk-YQAS2EGR.js";
211
+ } from "./chunk-G5IDRWWI.js";
212
+ import "./chunk-CPH6LKXO.js";
213
213
  import {
214
214
  ReputationCache,
215
215
  sanitizeInput
216
- } from "./chunk-VBIAMMZZ.js";
217
- import "./chunk-2QJJYCPD.js";
216
+ } from "./chunk-DTFMYM3V.js";
217
+ import "./chunk-ULBKFMVO.js";
218
218
  import "./chunk-HFOQKCD2.js";
219
219
  import "./chunk-3ACDP4E6.js";
220
- import "./chunk-VU54VB6K.js";
220
+ import "./chunk-K7VGX37L.js";
221
221
  import {
222
222
  MemoryError,
223
223
  shutdownToolMemory
224
- } from "./chunk-FL3AXIUL.js";
224
+ } from "./chunk-FTCU55O6.js";
225
225
  import {
226
226
  CustomExpertDefinitionSchema,
227
227
  DATA_SUBDIRECTORIES,
@@ -240,13 +240,16 @@ import {
240
240
  loadConfig,
241
241
  runDoctor,
242
242
  validateNexusEnv
243
- } from "./chunk-QXGLZETS.js";
244
- import "./chunk-YJUHVQSG.js";
245
- import "./chunk-U4RLBLNO.js";
243
+ } from "./chunk-SHSKW5ML.js";
244
+ import "./chunk-SMGH2B3A.js";
245
+ import "./chunk-57OH2O2U.js";
246
246
  import {
247
247
  DEFAULTS
248
- } from "./chunk-PIDABDFE.js";
248
+ } from "./chunk-4A4WPM75.js";
249
249
  import "./chunk-NUBSJGQZ.js";
250
+ import {
251
+ parseBoolEnv
252
+ } from "./chunk-NESW2TTD.js";
250
253
  import {
251
254
  capitalize,
252
255
  capitalizeKebab,
@@ -257,12 +260,12 @@ import {
257
260
  getAvailableClis,
258
261
  isRecord,
259
262
  probeAllClis
260
- } from "./chunk-DNSBKQ7I.js";
261
- import "./chunk-MBK6P4VV.js";
262
- import "./chunk-ZYYU26YH.js";
263
+ } from "./chunk-BHA6V7GK.js";
264
+ import "./chunk-RTUZSR4R.js";
265
+ import "./chunk-SORBJPRA.js";
263
266
  import "./chunk-ZM4O442V.js";
264
267
  import "./chunk-PQHVC4BD.js";
265
- import "./chunk-OXLXVSN3.js";
268
+ import "./chunk-JCETWDU7.js";
266
269
  import {
267
270
  API_TIMEOUTS,
268
271
  AgentCapability,
@@ -330,7 +333,7 @@ import {
330
333
  validateTimeout,
331
334
  writeEmptyLine,
332
335
  writeLine
333
- } from "./chunk-L5BXCSMP.js";
336
+ } from "./chunk-HKISF2E7.js";
334
337
  import {
335
338
  applyPortableMode,
336
339
  detectSandbox,
@@ -3109,7 +3112,7 @@ ${file.patch}
3109
3112
  violations: policyResult.violations
3110
3113
  });
3111
3114
  }
3112
- const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-WGPLUXPU.js");
3115
+ const { formatReviewComment: formatReviewComment2 } = await import("./pr-reviewer-helpers-P24OBKVM.js");
3113
3116
  const body = formatReviewComment2(result);
3114
3117
  const postResult = await provider.createReview(pr.prNumber, body, result.decision);
3115
3118
  if (!postResult.ok) {
@@ -12419,8 +12422,7 @@ var HookEnvVars = {
12419
12422
  NEXUS_DISABLE_METRICS: "NEXUS_DISABLE_METRICS"
12420
12423
  };
12421
12424
  function isFeatureDisabled(envVar) {
12422
- const value = process.env[envVar];
12423
- return value === "1" || value === "true";
12425
+ return parseBoolEnv(envVar, false);
12424
12426
  }
12425
12427
  function getDbPathFromEnv() {
12426
12428
  return process.env[HookEnvVars.NEXUS_SESSIONS_DB] ?? getDefaultDbPath2();
@@ -17426,6 +17428,73 @@ function runStpaSafetyAnalysis(logger18, failOnHighSeverity) {
17426
17428
  }
17427
17429
  }
17428
17430
 
17431
+ // src/pipeline/tune-stage.ts
17432
+ var defaultLogger = createLogger({ component: "TuneStage" });
17433
+ var TUNE_SIGNAL_TYPES = [
17434
+ "signal.fitness_declined",
17435
+ "signal.swarm_unhealthy",
17436
+ "signal.vote_rejected"
17437
+ ];
17438
+ function intendedActionFor(event) {
17439
+ switch (event.type) {
17440
+ case "signal.fitness_declined":
17441
+ return {
17442
+ kind: "flag_tech_debt",
17443
+ detail: `fitness ${String(event.score)} below floor ${String(event.floor)}${event.dimension !== void 0 ? ` (dimension: ${event.dimension})` : ""} \u2014 would surface a tech-debt remediation signal`,
17444
+ signal: event.type
17445
+ };
17446
+ case "signal.swarm_unhealthy":
17447
+ return {
17448
+ kind: "downweight_agent",
17449
+ detail: `agent ${event.agentId} unhealthy (${event.reason}) \u2014 would downweight it for routing (bounded, never zeroed)`,
17450
+ signal: event.type
17451
+ };
17452
+ case "signal.vote_rejected":
17453
+ return {
17454
+ kind: "record_rejection",
17455
+ detail: `proposal ${event.proposalId} rejected at ${String(event.approvalPercentage)}% \u2014 would record a rejection signal for review`,
17456
+ signal: event.type
17457
+ };
17458
+ default:
17459
+ return void 0;
17460
+ }
17461
+ }
17462
+ function createTuneStage(bus, options = {}) {
17463
+ const enabled = options.enabled ?? false;
17464
+ const log = options.logger ?? defaultLogger;
17465
+ return bus.subscribe({ type: [...TUNE_SIGNAL_TYPES] }, (event) => {
17466
+ try {
17467
+ const action = intendedActionFor(event);
17468
+ if (action === void 0) return;
17469
+ if (enabled) {
17470
+ log.warn("TuneStage enabled but bounded mutation is not implemented yet; no-op", {
17471
+ kind: action.kind,
17472
+ signal: action.signal
17473
+ });
17474
+ return;
17475
+ }
17476
+ log.info("TuneStage (shadow) \u2014 intended action", {
17477
+ kind: action.kind,
17478
+ signal: action.signal,
17479
+ detail: action.detail
17480
+ });
17481
+ } catch (e) {
17482
+ log.warn("TuneStage handler error", { error: getErrorMessage(e) });
17483
+ }
17484
+ });
17485
+ }
17486
+ var cachedTuneUnsubscribe = null;
17487
+ function startTuneStage(bus, options) {
17488
+ if (cachedTuneUnsubscribe !== null) return;
17489
+ cachedTuneUnsubscribe = createTuneStage(bus, options);
17490
+ }
17491
+ function shutdownTuneStage() {
17492
+ if (cachedTuneUnsubscribe !== null) {
17493
+ cachedTuneUnsubscribe();
17494
+ cachedTuneUnsubscribe = null;
17495
+ }
17496
+ }
17497
+
17429
17498
  // src/mcp/gateway/upstream-client.ts
17430
17499
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
17431
17500
  import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
@@ -17951,6 +18020,7 @@ function initV2PipelineSubsystems(logger18) {
17951
18020
  const pipelineEventBus = getPipelineEventBus();
17952
18021
  const bridge = createEventBusBridge({ source: pipelineEventBus });
17953
18022
  startFeedbackSubscriber(pipelineEventBus, getOutcomeStore());
18023
+ startTuneStage(pipelineEventBus);
17954
18024
  const policyEngine = createDefaultPolicyEngine();
17955
18025
  const v2Config = resolveV2Config();
17956
18026
  logger18.info("V2 Pipeline OS initialized", {
@@ -19276,7 +19346,7 @@ function adaptConfigToLibrary(config) {
19276
19346
  }
19277
19347
  function createBeliefPromoter() {
19278
19348
  return async (event) => {
19279
- const { getToolMemory } = await import("./tool-memory-AX5G67J6.js");
19349
+ const { getToolMemory } = await import("./tool-memory-UEQNXIGC.js");
19280
19350
  const tm = getToolMemory();
19281
19351
  await tm.recordBelief(
19282
19352
  `skill:${event.name}`,
@@ -19590,6 +19660,7 @@ function createShutdownCleanup(options) {
19590
19660
  shutdownToolMemory();
19591
19661
  await shutdownExpertBridge();
19592
19662
  shutdownFeedbackSubscriber();
19663
+ shutdownTuneStage();
19593
19664
  const closeResult = await closeServer(server, serverLogger);
19594
19665
  if (!closeResult.ok) {
19595
19666
  throw new Error(closeResult.error.message);
@@ -20139,7 +20210,7 @@ async function handleResearchCommand(args) {
20139
20210
  }
20140
20211
  }
20141
20212
  async function handleRegistryCommand(args) {
20142
- const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-CZZM5SF2.js");
20213
+ const { registryCommand, isValidRegistrySubcommand, formatRegistryUsage } = await import("./registry-command-KWWOKJ5C.js");
20143
20214
  const subcommand = args.subcommand;
20144
20215
  if (!isValidRegistrySubcommand(subcommand)) {
20145
20216
  process.stdout.write(`${formatRegistryUsage()}
@@ -20187,7 +20258,7 @@ async function handleVerifyCommand(args) {
20187
20258
  async function handleDoctorCommand(args) {
20188
20259
  const exitCode = await doctorCommand({ fix: args.options.fix });
20189
20260
  if (args.options.deep) {
20190
- const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-OVGRBG3Z.js");
20261
+ const { runDeepDiagnostics: runDeepDiagnostics2, formatDeepDiagnostics: formatDeepDiagnostics2 } = await import("./doctor-deep-OU2WC55V.js");
20191
20262
  const diag = runDeepDiagnostics2();
20192
20263
  process.stdout.write(formatDeepDiagnostics2(diag) + "\n");
20193
20264
  }
@@ -20231,7 +20302,7 @@ async function handleInitCommand(args) {
20231
20302
  process.exit(result.success ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20232
20303
  }
20233
20304
  async function runInitOpencodeFlow(args) {
20234
- const { runInitOpencode } = await import("./init-opencode-2ZBDJILW.js");
20305
+ const { runInitOpencode } = await import("./init-opencode-AYMNMWU7.js");
20235
20306
  const opencodePath = args.options.opencode;
20236
20307
  if (opencodePath === void 0 || opencodePath === "") {
20237
20308
  process.stderr.write("Error: --opencode requires a path argument.\n");
@@ -20258,7 +20329,7 @@ async function runInitOpencodeFlow(args) {
20258
20329
  process.exit(EXIT_CODES.SUCCESS);
20259
20330
  }
20260
20331
  async function renderOpencodeValidate(opencodePath) {
20261
- const { runOpencodeValidate } = await import("./init-opencode-2ZBDJILW.js");
20332
+ const { runOpencodeValidate } = await import("./init-opencode-AYMNMWU7.js");
20262
20333
  const result = await runOpencodeValidate(opencodePath);
20263
20334
  if (!result.ok) {
20264
20335
  process.stderr.write(`init --opencode --validate: ${result.reason ?? "failed"}
@@ -20298,7 +20369,7 @@ async function handleSetupCommandAsync(args) {
20298
20369
  process.exit(exitCode === 0 ? EXIT_CODES.SUCCESS : EXIT_CODES.SERVER_START_FAILED);
20299
20370
  }
20300
20371
  async function runCustomApiSetup(args) {
20301
- const { configureCustomApi } = await import("./setup-custom-api-GXHPYLDR.js");
20372
+ const { configureCustomApi } = await import("./setup-custom-api-UNX4OJEX.js");
20302
20373
  const baseUrl = args.options.customApi;
20303
20374
  if (baseUrl === void 0) return EXIT_CODES.SERVER_START_FAILED;
20304
20375
  const input = {