nexus-agents 8.43.0 → 8.44.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.
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-GWVEY32A.js";
24
+ } from "./chunk-K2A6LRLL.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-B5R7KEZR.js";
@@ -55,7 +55,7 @@ import {
55
55
  toJobSummary,
56
56
  updateStage,
57
57
  writeJobCancelled
58
- } from "./chunk-4NWC7WSP.js";
58
+ } from "./chunk-UDZBMHCX.js";
59
59
  import {
60
60
  allOf,
61
61
  anyOf
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-ZSMK7RFK.js";
76
76
  import {
77
77
  withPrerequisite
78
- } from "./chunk-HMDFOPJY.js";
78
+ } from "./chunk-VOEKVO4Z.js";
79
79
  import {
80
80
  NOOP_NOTIFIER,
81
81
  RateLimiter,
@@ -100,7 +100,7 @@ import {
100
100
  withAuditTrail,
101
101
  withProgressHeartbeat,
102
102
  wrapToolWithTimeout
103
- } from "./chunk-AJFJYLUF.js";
103
+ } from "./chunk-QHBW7AS7.js";
104
104
  import {
105
105
  createAuditTrail,
106
106
  createGraphAuditBridge,
@@ -2314,13 +2314,38 @@ function mergeConfig(config) {
2314
2314
  jitterFactor: config.jitterFactor ?? DEFAULT_RETRY_CONFIG.jitterFactor
2315
2315
  };
2316
2316
  }
2317
+ function alreadyAborted(signal) {
2318
+ if (signal?.aborted !== true) return void 0;
2319
+ return new RetryExhaustedError(0, signal.reason);
2320
+ }
2321
+ function notifyRetry(onRetry, info) {
2322
+ if (onRetry !== void 0) onRetry(info);
2323
+ }
2324
+ function sleepUnlessAborted(ms, signal) {
2325
+ if (signal === void 0) return sleep(ms).then(() => true);
2326
+ if (signal.aborted) return Promise.resolve(false);
2327
+ return new Promise((resolve19) => {
2328
+ const onAbort = () => {
2329
+ clearTimeout(timer);
2330
+ resolve19(false);
2331
+ };
2332
+ const timer = setTimeout(() => {
2333
+ signal.removeEventListener("abort", onAbort);
2334
+ resolve19(true);
2335
+ }, ms);
2336
+ signal.addEventListener("abort", onAbort, { once: true });
2337
+ });
2338
+ }
2317
2339
  async function withRetry(operation, options = {}) {
2318
2340
  const config = mergeConfig(options.config ?? {});
2319
2341
  const isRetryable = options.isRetryable ?? isRetryableError;
2320
2342
  const onRetry = options.onRetry;
2343
+ const signal = options.signal;
2321
2344
  const maxAttempts = config.maxRetries + 1;
2322
2345
  let lastError;
2323
2346
  let attemptsMade = 0;
2347
+ const preAborted = alreadyAborted(signal);
2348
+ if (preAborted !== void 0) return err(preAborted);
2324
2349
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
2325
2350
  attemptsMade = attempt + 1;
2326
2351
  try {
@@ -2333,15 +2358,9 @@ async function withRetry(operation, options = {}) {
2333
2358
  break;
2334
2359
  }
2335
2360
  const delayMs = calculateDelay(attempt, config);
2336
- if (onRetry) {
2337
- onRetry({
2338
- attempt: attempt + 1,
2339
- maxAttempts,
2340
- delayMs,
2341
- error
2342
- });
2343
- }
2344
- await sleep(delayMs);
2361
+ notifyRetry(onRetry, { attempt: attempt + 1, maxAttempts, delayMs, error });
2362
+ const waited = await sleepUnlessAborted(delayMs, signal);
2363
+ if (!waited) break;
2345
2364
  }
2346
2365
  }
2347
2366
  return err(new RetryExhaustedError(attemptsMade, lastError));
@@ -45993,7 +46012,7 @@ function buildVotingInput(plan, config) {
45993
46012
  }
45994
46013
  async function executeSingleVote(plan, config, log) {
45995
46014
  try {
45996
- const { executeVoting } = await import("./consensus-vote-EM2FBZJC.js");
46015
+ const { executeVoting } = await import("./consensus-vote-GFIIMQW4.js");
45997
46016
  const input = buildVotingInput(plan, config);
45998
46017
  const result = await executeVoting(input, log);
45999
46018
  return parseVotingResult(result);
@@ -47788,7 +47807,7 @@ ${contextBlock}`;
47788
47807
  const strategy = config.votingStrategy ?? "higher_order";
47789
47808
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47790
47809
  try {
47791
- const { executeVoting } = await import("./consensus-vote-EM2FBZJC.js");
47810
+ const { executeVoting } = await import("./consensus-vote-GFIIMQW4.js");
47792
47811
  const votingResult = await executeVoting(
47793
47812
  {
47794
47813
  proposal: buildVoteProposal(plan, research),
@@ -56515,4 +56534,4 @@ export {
56515
56534
  startPipelineEventBridge,
56516
56535
  shutdownPipelineEventBridge
56517
56536
  };
56518
- //# sourceMappingURL=chunk-LLJPMZKI.js.map
56537
+ //# sourceMappingURL=chunk-2U2CTX4Q.js.map