nexus-agents 8.28.8 → 8.28.9

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-IKGRS6I3.js";
24
+ } from "./chunk-LFQPDMW4.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-LE5GD6MT.js";
@@ -55,7 +55,7 @@ import {
55
55
  toJobSummary,
56
56
  updateStage,
57
57
  writeJobCancelled
58
- } from "./chunk-RQXTL7D7.js";
58
+ } from "./chunk-MU374IAT.js";
59
59
  import {
60
60
  allOf,
61
61
  anyOf
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-J5DOKTMY.js";
76
76
  import {
77
77
  withPrerequisite
78
- } from "./chunk-6QRX5DXU.js";
78
+ } from "./chunk-J42YVGO6.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-IXAPDTFG.js";
103
+ } from "./chunk-OQCVMQVW.js";
104
104
  import {
105
105
  createAuditTrail,
106
106
  createGraphAuditBridge,
@@ -45695,7 +45695,7 @@ function buildVotingInput(plan, config) {
45695
45695
  }
45696
45696
  async function executeSingleVote(plan, config, log) {
45697
45697
  try {
45698
- const { executeVoting } = await import("./consensus-vote-ZIRXZ27E.js");
45698
+ const { executeVoting } = await import("./consensus-vote-WRR62CRC.js");
45699
45699
  const input = buildVotingInput(plan, config);
45700
45700
  const result = await executeVoting(input, log);
45701
45701
  return parseVotingResult(result);
@@ -47487,7 +47487,7 @@ ${contextBlock}`;
47487
47487
  const strategy = config.votingStrategy ?? "higher_order";
47488
47488
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47489
47489
  try {
47490
- const { executeVoting } = await import("./consensus-vote-ZIRXZ27E.js");
47490
+ const { executeVoting } = await import("./consensus-vote-WRR62CRC.js");
47491
47491
  const votingResult = await executeVoting(
47492
47492
  {
47493
47493
  proposal: buildVoteProposal(plan, research),
@@ -56207,4 +56207,4 @@ export {
56207
56207
  shutdownFeedbackSubscriber,
56208
56208
  createEventBusBridge
56209
56209
  };
56210
- //# sourceMappingURL=chunk-T4NMCY3E.js.map
56210
+ //# sourceMappingURL=chunk-F2OVYZWF.js.map
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-IXAPDTFG.js";
10
+ } from "./chunk-OQCVMQVW.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -2159,4 +2159,4 @@ export {
2159
2159
  runImprovementReview,
2160
2160
  registerImprovementReviewTool
2161
2161
  };
2162
- //# sourceMappingURL=chunk-6QRX5DXU.js.map
2162
+ //# sourceMappingURL=chunk-J42YVGO6.js.map
@@ -8,7 +8,7 @@ import {
8
8
  NODE_ENGINE_RANGE,
9
9
  VERSION,
10
10
  isNodeVersionSupported
11
- } from "./chunk-THQTN3P7.js";
11
+ } from "./chunk-QIWQU3CB.js";
12
12
  import {
13
13
  capitalize
14
14
  } from "./chunk-7LP6VJRP.js";
@@ -1228,7 +1228,7 @@ async function runDoctorFix(result) {
1228
1228
  writeLine2("\u2500".repeat(40));
1229
1229
  let fixCount = 0;
1230
1230
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1231
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-43IEDUU2.js");
1231
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-AED6VSRL.js");
1232
1232
  const outcome = describeDataDirFix2(initDataDirectories2());
1233
1233
  writeLine2(outcome.line);
1234
1234
  if (outcome.counted) fixCount++;
@@ -1330,4 +1330,4 @@ export {
1330
1330
  startStdioServer,
1331
1331
  closeServer
1332
1332
  };
1333
- //# sourceMappingURL=chunk-IKGRS6I3.js.map
1333
+ //# sourceMappingURL=chunk-LFQPDMW4.js.map
@@ -23,10 +23,10 @@ import {
23
23
  toolSuccessStructured,
24
24
  withProgressHeartbeat,
25
25
  wrapToolWithTimeout
26
- } from "./chunk-IXAPDTFG.js";
26
+ } from "./chunk-OQCVMQVW.js";
27
27
  import {
28
28
  VERSION
29
- } from "./chunk-THQTN3P7.js";
29
+ } from "./chunk-QIWQU3CB.js";
30
30
  import {
31
31
  assessPanelIndependence,
32
32
  countDistinctModels,
@@ -7683,4 +7683,4 @@ export {
7683
7683
  CONSENSUS_VOTE_TOOL_SCHEMA,
7684
7684
  registerConsensusVoteTool
7685
7685
  };
7686
- //# sourceMappingURL=chunk-RQXTL7D7.js.map
7686
+ //# sourceMappingURL=chunk-MU374IAT.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-THQTN3P7.js";
3
+ } from "./chunk-QIWQU3CB.js";
4
4
  import {
5
5
  emitClawGuardViolation
6
6
  } from "./chunk-JANMYVKT.js";
@@ -651,6 +651,37 @@ function measuredTrustTier(context) {
651
651
  return derivable ? context.trustTier : void 0;
652
652
  }
653
653
 
654
+ // src/mcp/middleware/secure-handler-rate-limit.ts
655
+ function rateLimitError(nextTokenMs) {
656
+ return toolStructuredError({
657
+ errorCategory: "transient",
658
+ message: `Rate limit exceeded. Try again in ${String(nextTokenMs)}ms.`
659
+ });
660
+ }
661
+ function checkRateLimit(rateLimiter, logger) {
662
+ const acquired = rateLimiter.tryAcquire();
663
+ if (!acquired) {
664
+ const state = rateLimiter.getState();
665
+ logger.warn("Rate limit exceeded");
666
+ return { error: rateLimitError(state.nextTokenMs), state };
667
+ }
668
+ return null;
669
+ }
670
+ function emitRateLimitAudit(auditLogger, toolName, ctx, state) {
671
+ const actor = actorFromContext(ctx);
672
+ auditLogger.logRateLimitViolation({
673
+ toolName,
674
+ actor,
675
+ // The bucket is empty at denial time, so the tokens spent out of it are
676
+ // `capacity - tokens`. Both numbers are measured from the limiter that
677
+ // denied this call; they were hard-coded to 0/0 before #5577, which made
678
+ // every durable record read "Rate limit exceeded: 0/0 requests".
679
+ currentRate: Math.round(state.capacity - state.tokens),
680
+ limitRate: state.capacity,
681
+ requestId: ctx.requestId
682
+ });
683
+ }
684
+
654
685
  // src/mcp/middleware/tool-input-sanitizer.ts
655
686
  var XML_INJECTION_PATTERN = /<\/?(system|human|assistant|instructions|user|prompt|context|tool_use|tool_result)\b[^>]*>/gi;
656
687
  var INJECTION_DETECTORS = [
@@ -864,12 +895,6 @@ function setSecureHandlerAuditLogger(logger, auditLogger) {
864
895
  if (auditLogger === void 0) registrationAuditLoggers.delete(logger);
865
896
  else registrationAuditLoggers.set(logger, auditLogger);
866
897
  }
867
- function rateLimitError(nextTokenMs) {
868
- return toolStructuredError({
869
- errorCategory: "transient",
870
- message: `Rate limit exceeded. Try again in ${String(nextTokenMs)}ms.`
871
- });
872
- }
873
898
  function policyDeniedError(reason, requestId) {
874
899
  return toolStructuredError({
875
900
  errorCategory: "permission",
@@ -923,15 +948,6 @@ function checkInputSize(args, logger, requestId) {
923
948
  }
924
949
  return null;
925
950
  }
926
- function checkRateLimit(rateLimiter, logger) {
927
- const acquired = rateLimiter.tryAcquire();
928
- if (!acquired) {
929
- const state = rateLimiter.getState();
930
- logger.warn("Rate limit exceeded");
931
- return rateLimitError(state.nextTokenMs);
932
- }
933
- return null;
934
- }
935
951
  function checkPolicy(opts) {
936
952
  const ctxOpts = {
937
953
  mode: opts.mode,
@@ -1009,16 +1025,6 @@ function emitToolAudit({
1009
1025
  ...nearMiss ? { policyDecision: "would_deny" } : {}
1010
1026
  });
1011
1027
  }
1012
- function emitRateLimitAudit(auditLogger, toolName, ctx) {
1013
- const actor = actorFromContext(ctx);
1014
- auditLogger.logRateLimitViolation({
1015
- toolName,
1016
- actor,
1017
- currentRate: 0,
1018
- limitRate: 0,
1019
- requestId: ctx.requestId
1020
- });
1021
- }
1022
1028
  function checkSecurityTier(config, sanitizeResult, logger) {
1023
1029
  const tier = config.securityTier ?? "standard";
1024
1030
  if (tier === "standard" || sanitizeResult.detectedPatterns.length === 0) {
@@ -1054,11 +1060,11 @@ function runPreChecks(config, args, mode, requestContext, logger) {
1054
1060
  const tierError = checkSecurityTier(config, sanitizeResult, logger);
1055
1061
  if (tierError !== null) return { error: tierError, sanitizedArgs, nearMiss: false, sanitization };
1056
1062
  if (config.rateLimiter) {
1057
- const rlResult = checkRateLimit(config.rateLimiter, logger);
1058
- if (rlResult) {
1063
+ const denial = checkRateLimit(config.rateLimiter, logger);
1064
+ if (denial) {
1059
1065
  if (config.auditLogger)
1060
- emitRateLimitAudit(config.auditLogger, config.toolName, requestContext);
1061
- return { error: rlResult, sanitizedArgs, nearMiss: false, sanitization };
1066
+ emitRateLimitAudit(config.auditLogger, config.toolName, requestContext, denial.state);
1067
+ return { error: denial.error, sanitizedArgs, nearMiss: false, sanitization };
1062
1068
  }
1063
1069
  }
1064
1070
  const policy = runPolicyCheck(config, sanitizedArgs, mode, logger, requestContext);
@@ -2217,13 +2223,13 @@ export {
2217
2223
  logToolInvocationAudit,
2218
2224
  logPolicyAudit,
2219
2225
  logRateLimitAudit,
2220
- sanitizeToolInput,
2221
2226
  defaultRetryable,
2222
2227
  coarsenFailureCategory,
2223
2228
  toolSuccess,
2224
2229
  toolSuccessStructured,
2225
2230
  toolStructuredError,
2226
2231
  toolError,
2232
+ sanitizeToolInput,
2227
2233
  setGlobalPolicyFirewall,
2228
2234
  stagePolicyFirewallForRollout,
2229
2235
  setSecureHandlerAuditLogger,
@@ -2255,4 +2261,4 @@ export {
2255
2261
  VOTING_THRESHOLDS,
2256
2262
  ConsensusMetricsSchema
2257
2263
  };
2258
- //# sourceMappingURL=chunk-IXAPDTFG.js.map
2264
+ //# sourceMappingURL=chunk-OQCVMQVW.js.map