nexus-agents 11.5.6 → 11.5.7

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.
@@ -58,7 +58,7 @@ import {
58
58
  updateStage,
59
59
  withFileLock,
60
60
  writeJobCancelled
61
- } from "./chunk-PSHG65FT.js";
61
+ } from "./chunk-IEUSEZK7.js";
62
62
  import {
63
63
  normalizeTopicToCanonical,
64
64
  synthesizeResearch
@@ -77,7 +77,7 @@ import {
77
77
  } from "./chunk-773AZVR3.js";
78
78
  import {
79
79
  withPrerequisite
80
- } from "./chunk-LTH76W6C.js";
80
+ } from "./chunk-QWLNNOYX.js";
81
81
  import {
82
82
  NOOP_NOTIFIER,
83
83
  RateLimiter,
@@ -105,7 +105,7 @@ import {
105
105
  toolSuccess,
106
106
  withProgressHeartbeat,
107
107
  wrapToolWithTimeout
108
- } from "./chunk-NJZSAXXK.js";
108
+ } from "./chunk-CWLHWDRU.js";
109
109
  import {
110
110
  generateSecurityPlan
111
111
  } from "./chunk-6ZTMMN2N.js";
@@ -187,7 +187,7 @@ import {
187
187
  import {
188
188
  DEFAULT_TASK_TTL_MS,
189
189
  clampTaskTtl
190
- } from "./chunk-SKSR4Q3L.js";
190
+ } from "./chunk-APLXNO7U.js";
191
191
  import {
192
192
  allOf,
193
193
  anyOf
@@ -196,7 +196,7 @@ import {
196
196
  VERSION,
197
197
  createRequestContext,
198
198
  measuredTrustTier
199
- } from "./chunk-HHB2Z7LX.js";
199
+ } from "./chunk-R6P5JIXG.js";
200
200
  import {
201
201
  BWRAP_READ_ONLY_ARGS,
202
202
  CliDetectionCache,
@@ -46682,7 +46682,7 @@ function buildVotingInput(plan, config) {
46682
46682
  }
46683
46683
  async function executeSingleVote(plan, config, log) {
46684
46684
  try {
46685
- const { executeVoting } = await import("./consensus-vote-YQS6ALNB.js");
46685
+ const { executeVoting } = await import("./consensus-vote-PEGKNDMD.js");
46686
46686
  const input = buildVotingInput(plan, config);
46687
46687
  const result = await executeVoting(input, log);
46688
46688
  return parseVotingResult(result);
@@ -48583,7 +48583,7 @@ function createVoteStage({ config, startStage }) {
48583
48583
  const strategy = config.votingStrategy ?? "higher_order";
48584
48584
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
48585
48585
  try {
48586
- const { executeVoting } = await import("./consensus-vote-YQS6ALNB.js");
48586
+ const { executeVoting } = await import("./consensus-vote-PEGKNDMD.js");
48587
48587
  const proposal = buildVoteProposal(plan, research);
48588
48588
  const votingResult = await executeVoting(
48589
48589
  {
@@ -49077,7 +49077,7 @@ import { readFile as readFile5, realpath as realpath2, writeFile as writeFile2 }
49077
49077
  import { delimiter as delimiter2, isAbsolute as isAbsolute6, join as join14, parse as parse4, resolve as resolve9 } from "node:path";
49078
49078
  var logger47 = createLogger({ component: "security-scan" });
49079
49079
  var SCAN_TIMEOUT_MS = 3e5;
49080
- async function isSemgrepAvailable(signal, env, wrapper, binary = "semgrep", cwd) {
49080
+ async function probeSemgrepVersion(signal, env, wrapper, binary = "semgrep", cwd) {
49081
49081
  try {
49082
49082
  const { stdout } = await execFileTree(binary, ["--version"], {
49083
49083
  timeoutMs: 1e4,
@@ -49086,10 +49086,35 @@ async function isSemgrepAvailable(signal, env, wrapper, binary = "semgrep", cwd)
49086
49086
  wrapper,
49087
49087
  cwd
49088
49088
  });
49089
- return stdout.trim() || void 0;
49090
- } catch {
49091
- return void 0;
49089
+ const version = stdout.trim();
49090
+ return version === "" ? { error: "semgrep version probe returned empty output" } : version;
49091
+ } catch (error) {
49092
+ if (failureCode(error) === "ENOENT" && wrapper === void 0 && await isSemgrepExecutableMissing(binary, env, cwd)) {
49093
+ return { error: "semgrep is not installed. Install with: pip install semgrep" };
49094
+ }
49095
+ const message = error instanceof Error ? error.message : String(error);
49096
+ return {
49097
+ error: `semgrep version probe failed (exit ${String(failureCode(error))}): ${message}`
49098
+ };
49099
+ }
49100
+ }
49101
+ function probeExecutableCandidates(binary, env, cwd) {
49102
+ const root = cwd ?? process.cwd();
49103
+ const searchPath = (env ?? process.env)["PATH"];
49104
+ return isAbsolute6(binary) || /[/\\]/.test(binary) ? [resolve9(root, binary)] : process.platform === "win32" ? void 0 : searchPath?.split(delimiter2).map((directory) => resolve9(root, directory, binary));
49105
+ }
49106
+ async function isSemgrepExecutableMissing(binary, env, cwd) {
49107
+ const candidates = probeExecutableCandidates(binary, env, cwd);
49108
+ if (candidates === void 0 || candidates.length === 0) return false;
49109
+ for (const candidate of candidates) {
49110
+ try {
49111
+ await access(candidate);
49112
+ return false;
49113
+ } catch (error) {
49114
+ if (failureCode(error) !== "ENOENT" && failureCode(error) !== "ENOTDIR") return false;
49115
+ }
49092
49116
  }
49117
+ return true;
49093
49118
  }
49094
49119
  async function runSemgrep(targetDir, rulesets, signal, env, options) {
49095
49120
  const prepared = options.preparedScan;
@@ -49175,7 +49200,7 @@ function unwrapRuleset(text) {
49175
49200
  return text;
49176
49201
  }
49177
49202
  async function measureScannerVersion(options, targetDir) {
49178
- const version = await isSemgrepAvailable(
49203
+ const version = await probeSemgrepVersion(
49179
49204
  options.signal,
49180
49205
  options.env,
49181
49206
  options.wrapper,
@@ -49183,8 +49208,7 @@ async function measureScannerVersion(options, targetDir) {
49183
49208
  parse4(targetDir).root
49184
49209
  );
49185
49210
  if (options.signal?.aborted === true) return { error: "Scan aborted before semgrep ran" };
49186
- if (version === void 0)
49187
- return { error: "semgrep is not installed. Install with: pip install semgrep" };
49211
+ if (typeof version !== "string") return version;
49188
49212
  if (options.preparedScan !== void 0 && options.preparedScan.version !== version) {
49189
49213
  return {
49190
49214
  error: `Scanner version changed: expected ${options.preparedScan.version}, got ${version}`
@@ -49196,14 +49220,14 @@ async function prepareSecurityScan(rulesets, options) {
49196
49220
  try {
49197
49221
  if (rulesets.length === 0) throw new Error("No security rulesets configured");
49198
49222
  const binary = await resolveSemgrep(options.env ?? process.env);
49199
- const version = await isSemgrepAvailable(
49223
+ const version = await probeSemgrepVersion(
49200
49224
  options.signal,
49201
49225
  options.env,
49202
49226
  options.wrapper,
49203
49227
  binary,
49204
49228
  parse4(resolve9(options.directory)).root
49205
49229
  );
49206
- if (version === void 0) throw new Error("Cannot measure semgrep version");
49230
+ if (typeof version !== "string") throw new Error(version.error);
49207
49231
  const configs = [];
49208
49232
  for (const [index, ruleset] of rulesets.entries()) {
49209
49233
  const contents = await readRuleset(ruleset, options.signal);
@@ -59481,4 +59505,4 @@ export {
59481
59505
  initializeSandbox,
59482
59506
  getSandboxMode
59483
59507
  };
59484
- //# sourceMappingURL=chunk-6EW6KXEW.js.map
59508
+ //# sourceMappingURL=chunk-AAHTCFE4.js.map