nexus-agents 8.38.4 → 8.39.1

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-TPDDQOF6.js";
3
+ } from "./chunk-UJ2JLVT7.js";
4
4
  import {
5
5
  emitClawGuardViolation
6
6
  } from "./chunk-CXKSY4C4.js";
@@ -2306,4 +2306,4 @@ export {
2306
2306
  VOTING_THRESHOLDS,
2307
2307
  ConsensusMetricsSchema
2308
2308
  };
2309
- //# sourceMappingURL=chunk-7AIHIPH5.js.map
2309
+ //# sourceMappingURL=chunk-42FR7BSB.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-AWIWDIZJ.js";
24
+ } from "./chunk-SM3HL65L.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-YJJTXGHE.js";
@@ -55,7 +55,7 @@ import {
55
55
  toJobSummary,
56
56
  updateStage,
57
57
  writeJobCancelled
58
- } from "./chunk-X2QKPZ32.js";
58
+ } from "./chunk-QA2ZHP2U.js";
59
59
  import {
60
60
  allOf,
61
61
  anyOf
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-IURDLL5M.js";
76
76
  import {
77
77
  withPrerequisite
78
- } from "./chunk-A4BZHDPS.js";
78
+ } from "./chunk-JVSZDH6T.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-7AIHIPH5.js";
103
+ } from "./chunk-42FR7BSB.js";
104
104
  import {
105
105
  createAuditTrail,
106
106
  createGraphAuditBridge,
@@ -43337,12 +43337,17 @@ async function resolveFileScope(input) {
43337
43337
  if (input.path !== void 0) {
43338
43338
  const guard2 = resolveWithinCwd(input.path);
43339
43339
  if ("error" in guard2) return guard2;
43340
- return { files: [guard2.resolved], root: resolve8(".") };
43340
+ return { files: [guard2.resolved], root: resolve8("."), skippedDirs: 0, omittedFiles: 0 };
43341
43341
  }
43342
43342
  const guard = resolveWithinCwd(input.dir ?? process.cwd());
43343
43343
  if ("error" in guard) return guard;
43344
43344
  const walk = await findSourceFiles(guard.resolved, input.maxDepth ?? DEFAULT_USAGES_MAX_DEPTH);
43345
- return { files: walk.files.slice(0, MAX_FILES_SCANNED), root: guard.resolved };
43345
+ return {
43346
+ files: walk.files.slice(0, MAX_FILES_SCANNED),
43347
+ root: guard.resolved,
43348
+ skippedDirs: walk.skippedDirs,
43349
+ omittedFiles: walk.files.length > MAX_FILES_SCANNED ? walk.files.length - MAX_FILES_SCANNED : 0
43350
+ };
43346
43351
  }
43347
43352
  async function collectUsages(input, scope, limit, ctx) {
43348
43353
  const results = [];
@@ -43364,6 +43369,25 @@ async function collectUsages(input, scope, limit, ctx) {
43364
43369
  }
43365
43370
  return { results, total };
43366
43371
  }
43372
+ function applyScopeTruncation(payload, scope) {
43373
+ if (scope.skippedDirs === 0 && scope.omittedFiles === 0) return;
43374
+ const reasons = [];
43375
+ if (scope.skippedDirs > 0) {
43376
+ payload["skippedDirs"] = scope.skippedDirs;
43377
+ const plural = scope.skippedDirs === 1 ? "y was" : "ies were";
43378
+ reasons.push(
43379
+ `${String(scope.skippedDirs)} subdirector${plural} not walked because maxDepth was exhausted`
43380
+ );
43381
+ }
43382
+ if (scope.omittedFiles > 0) {
43383
+ payload["omittedFiles"] = scope.omittedFiles;
43384
+ reasons.push(
43385
+ `${String(scope.omittedFiles)} file(s) past the ${String(MAX_FILES_SCANNED)}-file cap were not read`
43386
+ );
43387
+ }
43388
+ payload["scopeTruncated"] = true;
43389
+ payload["scopeNote"] = `The scan did not cover the whole scope: ${reasons.join("; ")}. Absence of matches here is not absence of usages.`;
43390
+ }
43367
43391
  function buildOutput2(input, scope, limit, collected) {
43368
43392
  const payload = {
43369
43393
  symbol: input.symbol,
@@ -43378,6 +43402,7 @@ function buildOutput2(input, scope, limit, collected) {
43378
43402
  payload["omittedMatches"] = collected.total - collected.results.length;
43379
43403
  payload["limit"] = limit;
43380
43404
  }
43405
+ applyScopeTruncation(payload, scope);
43381
43406
  return JSON.stringify(payload, null, 2);
43382
43407
  }
43383
43408
  async function searchUsagesHandler(args, ctx) {
@@ -43465,13 +43490,16 @@ function userFacingTraceError(err2, runId) {
43465
43490
  }
43466
43491
  }
43467
43492
  function parseJsonlLines(content) {
43468
- return content.trim().split("\n").filter(Boolean).flatMap((line) => {
43493
+ const events = [];
43494
+ let skippedLines = 0;
43495
+ for (const line of content.trim().split("\n").filter(Boolean)) {
43469
43496
  try {
43470
- return [JSON.parse(line)];
43497
+ events.push(JSON.parse(line));
43471
43498
  } catch {
43472
- return [];
43499
+ skippedLines++;
43473
43500
  }
43474
- });
43501
+ }
43502
+ return { events, skippedLines };
43475
43503
  }
43476
43504
  var EMPTY_RESPONSE = {
43477
43505
  events: [],
@@ -43479,6 +43507,33 @@ var EMPTY_RESPONSE = {
43479
43507
  truncated: false,
43480
43508
  source: "not_found"
43481
43509
  };
43510
+ function overSizeResponse(runId, sizeBytes) {
43511
+ return {
43512
+ runId,
43513
+ events: [],
43514
+ totalEvents: 0,
43515
+ truncated: true,
43516
+ source: "disk",
43517
+ errorCategory: "too_large",
43518
+ errorMessage: `Trace for runId '${runId}' is ${String(sizeBytes)} bytes, over the ${String(MAX_TRACE_FILE_BYTES)}-byte read cap; no events were read`
43519
+ };
43520
+ }
43521
+ function readTraceResponse(input, read) {
43522
+ const limit = input.limit ?? 100;
43523
+ const parsed = input.eventType !== void 0 ? read.events.filter((e) => e["eventType"] === input.eventType) : read.events;
43524
+ return {
43525
+ runId: input.runId,
43526
+ events: parsed.slice(0, limit),
43527
+ totalEvents: parsed.length,
43528
+ truncated: parsed.length > limit,
43529
+ source: "disk",
43530
+ ...read.skippedLines > 0 ? {
43531
+ skippedLines: read.skippedLines,
43532
+ errorCategory: "parse_error",
43533
+ errorMessage: `${String(read.skippedLines)} line(s) in the trace for runId '${input.runId}' could not be parsed; the events returned are what survived`
43534
+ } : {}
43535
+ };
43536
+ }
43482
43537
  async function queryTraceFromDisk(input, runsDir) {
43483
43538
  const dir = runsDir ?? getDefaultRunsDir();
43484
43539
  const tracePath = join7(dir, input.runId, "trace.jsonl");
@@ -43490,21 +43545,10 @@ async function queryTraceFromDisk(input, runsDir) {
43490
43545
  try {
43491
43546
  const fileStat = await stat3(tracePath);
43492
43547
  if (fileStat.size > MAX_TRACE_FILE_BYTES) {
43493
- return { runId: input.runId, ...EMPTY_RESPONSE, truncated: true };
43548
+ return overSizeResponse(input.runId, fileStat.size);
43494
43549
  }
43495
43550
  const content = await readFile4(tracePath, "utf-8");
43496
- let parsed = parseJsonlLines(content);
43497
- const limit = input.limit ?? 100;
43498
- if (input.eventType !== void 0) {
43499
- parsed = parsed.filter((e) => e["eventType"] === input.eventType);
43500
- }
43501
- return {
43502
- runId: input.runId,
43503
- events: parsed.slice(0, limit),
43504
- totalEvents: parsed.length,
43505
- truncated: parsed.length > limit,
43506
- source: "disk"
43507
- };
43551
+ return readTraceResponse(input, parseJsonlLines(content));
43508
43552
  } catch (err2) {
43509
43553
  const category = classifyTraceError(err2);
43510
43554
  const message = userFacingTraceError(err2, input.runId);
@@ -45855,7 +45899,7 @@ function buildVotingInput(plan, config) {
45855
45899
  }
45856
45900
  async function executeSingleVote(plan, config, log) {
45857
45901
  try {
45858
- const { executeVoting } = await import("./consensus-vote-6AZZL4L3.js");
45902
+ const { executeVoting } = await import("./consensus-vote-VUGMM45O.js");
45859
45903
  const input = buildVotingInput(plan, config);
45860
45904
  const result = await executeVoting(input, log);
45861
45905
  return parseVotingResult(result);
@@ -47647,7 +47691,7 @@ ${contextBlock}`;
47647
47691
  const strategy = config.votingStrategy ?? "higher_order";
47648
47692
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47649
47693
  try {
47650
- const { executeVoting } = await import("./consensus-vote-6AZZL4L3.js");
47694
+ const { executeVoting } = await import("./consensus-vote-VUGMM45O.js");
47651
47695
  const votingResult = await executeVoting(
47652
47696
  {
47653
47697
  proposal: buildVoteProposal(plan, research),
@@ -56328,4 +56372,4 @@ export {
56328
56372
  startPipelineEventBridge,
56329
56373
  shutdownPipelineEventBridge
56330
56374
  };
56331
- //# sourceMappingURL=chunk-CAZBSUVO.js.map
56375
+ //# sourceMappingURL=chunk-4PPFJXWR.js.map