nexus-agents 8.89.2 → 8.89.3

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-JRZEB4OQ.js";
3
+ } from "./chunk-QX42N7TE.js";
4
4
  import {
5
5
  sanitizeErrorDetails
6
6
  } from "./chunk-2NDA4DHW.js";
@@ -2342,4 +2342,4 @@ export {
2342
2342
  DEFAULT_CONSENSUS_CONFIG,
2343
2343
  ConsensusMetricsSchema
2344
2344
  };
2345
- //# sourceMappingURL=chunk-GYQIIAVM.js.map
2345
+ //# sourceMappingURL=chunk-KSCQRZJZ.js.map
@@ -25,10 +25,10 @@ import {
25
25
  toolSuccessStructured,
26
26
  withProgressHeartbeat,
27
27
  wrapToolWithTimeout
28
- } from "./chunk-GYQIIAVM.js";
28
+ } from "./chunk-KSCQRZJZ.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-JRZEB4OQ.js";
31
+ } from "./chunk-QX42N7TE.js";
32
32
  import {
33
33
  UNRESOLVED_MODEL_ID,
34
34
  assessPanelIndependence,
@@ -9703,4 +9703,4 @@ export {
9703
9703
  CONSENSUS_VOTE_TOOL_SCHEMA,
9704
9704
  registerConsensusVoteTool
9705
9705
  };
9706
- //# sourceMappingURL=chunk-GXBXZCY7.js.map
9706
+ //# sourceMappingURL=chunk-MS5VFQE3.js.map
@@ -12,7 +12,7 @@ import {
12
12
  NODE_ENGINE_RANGE,
13
13
  VERSION,
14
14
  isNodeVersionSupported
15
- } from "./chunk-JRZEB4OQ.js";
15
+ } from "./chunk-QX42N7TE.js";
16
16
  import {
17
17
  claimGlobalRegistry
18
18
  } from "./chunk-TLFZPJOY.js";
@@ -1401,7 +1401,7 @@ async function runDoctorFix(result) {
1401
1401
  writeLine2("\u2500".repeat(40));
1402
1402
  let fixCount = 0;
1403
1403
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1404
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-UNM34FGW.js");
1404
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-XJWO2WOU.js");
1405
1405
  const outcome = describeDataDirFix2(initDataDirectories2());
1406
1406
  writeLine2(outcome.line);
1407
1407
  if (outcome.counted) fixCount++;
@@ -1503,4 +1503,4 @@ export {
1503
1503
  startStdioServer,
1504
1504
  closeServer
1505
1505
  };
1506
- //# sourceMappingURL=chunk-5XZCL7QT.js.map
1506
+ //# sourceMappingURL=chunk-MYZGLD7Y.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-5XZCL7QT.js";
24
+ } from "./chunk-MYZGLD7Y.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-EKZ6V7SE.js";
@@ -72,7 +72,7 @@ import {
72
72
  updateStage,
73
73
  withWarnings,
74
74
  writeJobCancelled
75
- } from "./chunk-GXBXZCY7.js";
75
+ } from "./chunk-MS5VFQE3.js";
76
76
  import {
77
77
  allOf,
78
78
  anyOf
@@ -95,7 +95,7 @@ import {
95
95
  } from "./chunk-5GZ4UN5F.js";
96
96
  import {
97
97
  withPrerequisite
98
- } from "./chunk-HLXXP3CS.js";
98
+ } from "./chunk-V76TXFRC.js";
99
99
  import {
100
100
  NOOP_NOTIFIER,
101
101
  RateLimiter,
@@ -120,7 +120,7 @@ import {
120
120
  toolSuccessStructured,
121
121
  withProgressHeartbeat,
122
122
  wrapToolWithTimeout
123
- } from "./chunk-GYQIIAVM.js";
123
+ } from "./chunk-KSCQRZJZ.js";
124
124
  import {
125
125
  EventTopics,
126
126
  UNRESOLVED_MODEL_ID,
@@ -46154,7 +46154,7 @@ function buildVotingInput(plan, config) {
46154
46154
  }
46155
46155
  async function executeSingleVote(plan, config, log) {
46156
46156
  try {
46157
- const { executeVoting } = await import("./consensus-vote-UHNEKOO7.js");
46157
+ const { executeVoting } = await import("./consensus-vote-EIV5TDPY.js");
46158
46158
  const input = buildVotingInput(plan, config);
46159
46159
  const result = await executeVoting(input, log);
46160
46160
  return parseVotingResult(result);
@@ -47091,7 +47091,7 @@ function createVoteStage({ config, startStage }) {
47091
47091
  const strategy = config.votingStrategy ?? "higher_order";
47092
47092
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47093
47093
  try {
47094
- const { executeVoting } = await import("./consensus-vote-UHNEKOO7.js");
47094
+ const { executeVoting } = await import("./consensus-vote-EIV5TDPY.js");
47095
47095
  const votingResult = await executeVoting(
47096
47096
  {
47097
47097
  proposal: buildVoteProposal(plan, research),
@@ -56541,4 +56541,4 @@ export {
56541
56541
  startPipelineEventBridge,
56542
56542
  shutdownPipelineEventBridge
56543
56543
  };
56544
- //# sourceMappingURL=chunk-E6AJH4F4.js.map
56544
+ //# sourceMappingURL=chunk-NNHRMVZU.js.map
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  import semver from "semver";
3
- var VERSION = true ? "8.89.2" : "dev";
3
+ var VERSION = true ? "8.89.3" : "dev";
4
4
  var NODE_ENGINE_RANGE = ">=22.5.0";
5
5
  function isNodeVersionSupported(version) {
6
6
  return semver.satisfies(version, NODE_ENGINE_RANGE);
@@ -11,4 +11,4 @@ export {
11
11
  NODE_ENGINE_RANGE,
12
12
  isNodeVersionSupported
13
13
  };
14
- //# sourceMappingURL=chunk-JRZEB4OQ.js.map
14
+ //# sourceMappingURL=chunk-QX42N7TE.js.map
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-GYQIIAVM.js";
10
+ } from "./chunk-KSCQRZJZ.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -2282,4 +2282,4 @@ export {
2282
2282
  runImprovementReview,
2283
2283
  registerImprovementReviewTool
2284
2284
  };
2285
- //# sourceMappingURL=chunk-HLXXP3CS.js.map
2285
+ //# sourceMappingURL=chunk-V76TXFRC.js.map
package/dist/cli.js CHANGED
@@ -155,7 +155,7 @@ import {
155
155
  validateNexusEnv,
156
156
  validateWorkflow,
157
157
  wrapInMarkdownFence
158
- } from "./chunk-E6AJH4F4.js";
158
+ } from "./chunk-NNHRMVZU.js";
159
159
  import "./chunk-3IBALX36.js";
160
160
  import "./chunk-4GDMHCKX.js";
161
161
  import "./chunk-7ETWTSTB.js";
@@ -175,7 +175,7 @@ import {
175
175
  doctorCommand,
176
176
  initDataDirectories,
177
177
  runDoctor
178
- } from "./chunk-5XZCL7QT.js";
178
+ } from "./chunk-MYZGLD7Y.js";
179
179
  import "./chunk-TRCYUQ4M.js";
180
180
  import {
181
181
  shutdownExpertBridge
@@ -197,7 +197,7 @@ import {
197
197
  registerConsensusVoteTool,
198
198
  seatFallbacks,
199
199
  toRecordDecision
200
- } from "./chunk-GXBXZCY7.js";
200
+ } from "./chunk-MS5VFQE3.js";
201
201
  import {
202
202
  buildOpenAICompatAdapters,
203
203
  readOpenAICompatEndpoint,
@@ -239,7 +239,7 @@ import {
239
239
  registerImprovementReviewTool,
240
240
  runImprovementReview,
241
241
  scanForSecrets
242
- } from "./chunk-HLXXP3CS.js";
242
+ } from "./chunk-V76TXFRC.js";
243
243
  import {
244
244
  createDefaultPolicyFirewall,
245
245
  formatPolicyRolloutMode,
@@ -249,12 +249,12 @@ import {
249
249
  setGlobalPolicyFirewall,
250
250
  setSecureHandlerAuditLogger,
251
251
  stagePolicyFirewallForRollout
252
- } from "./chunk-GYQIIAVM.js";
252
+ } from "./chunk-KSCQRZJZ.js";
253
253
  import {
254
254
  NODE_ENGINE_RANGE,
255
255
  VERSION,
256
256
  isNodeVersionSupported
257
- } from "./chunk-JRZEB4OQ.js";
257
+ } from "./chunk-QX42N7TE.js";
258
258
  import {
259
259
  claimGlobalRegistry,
260
260
  createUnifiedRegistry,
@@ -19877,7 +19877,7 @@ function startImprovementReviewScheduler(options) {
19877
19877
  let running = false;
19878
19878
  const runOnce = async () => {
19879
19879
  try {
19880
- const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-N36SVUDG.js");
19880
+ const { runImprovementReview: runImprovementReview2, ImprovementReviewInputSchema: ImprovementReviewInputSchema2 } = await import("./improvement-review-CUBUAU2D.js");
19881
19881
  const input = ImprovementReviewInputSchema2.parse({ fileIssues });
19882
19882
  const result = await runImprovementReview2(input, { logger: logger23 });
19883
19883
  logger23.info("Scheduled improvement_review complete", {
@@ -20771,12 +20771,53 @@ function logFinalEventBusStats(logger23) {
20771
20771
  errorCount: finalStats.errorCount
20772
20772
  });
20773
20773
  }
20774
- function watchParentProcess(logger23) {
20775
- const monitor = getStdinLifecycleMonitor();
20774
+ var SHUTDOWN_CLEANUP_TIMEOUT_MS = 12e3;
20775
+ function createGracefulShutdown(options) {
20776
+ const { cleanup, logger: logger23 } = options;
20777
+ const exit = options.exit ?? ((code) => process.exit(code));
20778
+ const timeoutMs = options.timeoutMs ?? SHUTDOWN_CLEANUP_TIMEOUT_MS;
20779
+ let isShuttingDown = false;
20780
+ return async (reason) => {
20781
+ if (isShuttingDown) {
20782
+ logger23.debug("Shutdown already in progress, ignoring signal", { signal: reason });
20783
+ return;
20784
+ }
20785
+ isShuttingDown = true;
20786
+ logger23.info("Received shutdown signal", { signal: reason });
20787
+ let timer;
20788
+ const timedOut = new Promise((resolve16) => {
20789
+ timer = setTimeout(() => {
20790
+ resolve16("timeout");
20791
+ }, timeoutMs);
20792
+ });
20793
+ try {
20794
+ const outcome = await Promise.race([cleanup().then(() => "done"), timedOut]);
20795
+ if (outcome === "timeout") {
20796
+ logger23.error(
20797
+ "Shutdown cleanup timed out; exiting without completing it",
20798
+ new Error(`shutdown cleanup exceeded ${String(timeoutMs)}ms (trigger: ${reason})`)
20799
+ );
20800
+ exit(EXIT_CODES.SHUTDOWN_ERROR);
20801
+ return;
20802
+ }
20803
+ logger23.info("Shutdown complete");
20804
+ exit(EXIT_CODES.SUCCESS);
20805
+ } catch (error) {
20806
+ logger23.error(
20807
+ "Error during shutdown",
20808
+ error instanceof Error ? error : new Error(String(error))
20809
+ );
20810
+ exit(EXIT_CODES.SHUTDOWN_ERROR);
20811
+ } finally {
20812
+ clearTimeout(timer);
20813
+ }
20814
+ };
20815
+ }
20816
+ function watchParentProcess(logger23, requestShutdown, monitor = getStdinLifecycleMonitor()) {
20776
20817
  monitor.start();
20777
20818
  monitor.onClose(() => {
20778
20819
  logger23.warn("Parent process closed stdin, shutting down");
20779
- process.exit(0);
20820
+ return requestShutdown("parent-gone");
20780
20821
  });
20781
20822
  }
20782
20823
 
@@ -22394,26 +22435,7 @@ function logSecurityConfig(logger23, config) {
22394
22435
 
22395
22436
  // src/cli-server.ts
22396
22437
  function setupShutdownHandlers(cleanup, logger23) {
22397
- let isShuttingDown = false;
22398
- const handleShutdown = async (signal) => {
22399
- if (isShuttingDown) {
22400
- logger23.debug("Shutdown already in progress, ignoring signal", { signal });
22401
- return;
22402
- }
22403
- isShuttingDown = true;
22404
- logger23.info("Received shutdown signal", { signal });
22405
- try {
22406
- await cleanup();
22407
- logger23.info("Shutdown complete");
22408
- process.exit(EXIT_CODES.SUCCESS);
22409
- } catch (error) {
22410
- logger23.error(
22411
- "Error during shutdown",
22412
- error instanceof Error ? error : new Error(String(error))
22413
- );
22414
- process.exit(EXIT_CODES.SHUTDOWN_ERROR);
22415
- }
22416
- };
22438
+ const handleShutdown = createGracefulShutdown({ cleanup, logger: logger23 });
22417
22439
  const onSignal = (signal) => () => {
22418
22440
  handleShutdown(signal).catch((err2) => {
22419
22441
  logger23.error("Shutdown handler crashed", err2 instanceof Error ? err2 : new Error(String(err2)));
@@ -22431,6 +22453,7 @@ function setupShutdownHandlers(cleanup, logger23) {
22431
22453
  logger23.error("Unhandled rejection", error);
22432
22454
  process.exit(EXIT_CODES.SERVER_START_FAILED);
22433
22455
  });
22456
+ return handleShutdown;
22434
22457
  }
22435
22458
  function logStartupInfo(logger23, detectionResult, verbose) {
22436
22459
  logger23.info("Starting Nexus Agents", {
@@ -22659,7 +22682,6 @@ async function startServer(verbose, mode, modeWasExplicit = false, orchestratorO
22659
22682
  const { server, serverLogger, observer, eventBusBridge, auditLogger } = await initializeSubsystems(configResult.config, logger23);
22660
22683
  await connectToStdioTransport(server, logger23, serverLogger);
22661
22684
  const eventContext = recordServerStartup(observer);
22662
- watchParentProcess(logger23);
22663
22685
  const cleanup = createShutdownCleanup({
22664
22686
  eventBusBridge,
22665
22687
  observer,
@@ -22669,7 +22691,8 @@ async function startServer(verbose, mode, modeWasExplicit = false, orchestratorO
22669
22691
  logger: logger23,
22670
22692
  auditLogger
22671
22693
  });
22672
- setupShutdownHandlers(cleanup, logger23);
22694
+ const requestShutdown = setupShutdownHandlers(cleanup, logger23);
22695
+ watchParentProcess(logger23, requestShutdown);
22673
22696
  clearTimeout(startupWatchdog);
22674
22697
  recordStartupComplete(auditLogger, mode);
22675
22698
  logger23.debug("Server running, waiting for requests...");