nexus-agents 8.3.1 → 8.3.2

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.
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-TSZWXRF7.js";
10
+ } from "./chunk-VULYVX6X.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-AQF22T74.js.map
2162
+ //# sourceMappingURL=chunk-3OU7XMEP.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-OQB3XC5O.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-2OS7HTUM.js";
9
+ } from "./chunk-LZBARHPR.js";
10
10
  import {
11
11
  capitalize
12
12
  } from "./chunk-6T3EPABN.js";
@@ -1201,7 +1201,7 @@ async function runDoctorFix(result) {
1201
1201
  writeLine2("\u2500".repeat(40));
1202
1202
  let fixCount = 0;
1203
1203
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1204
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-Y4F4R2BJ.js");
1204
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-HJCC6U4N.js");
1205
1205
  const outcome = describeDataDirFix2(initDataDirectories2());
1206
1206
  writeLine2(outcome.line);
1207
1207
  if (outcome.counted) fixCount++;
@@ -1303,4 +1303,4 @@ export {
1303
1303
  startStdioServer,
1304
1304
  closeServer
1305
1305
  };
1306
- //# sourceMappingURL=chunk-LW6FPSPN.js.map
1306
+ //# sourceMappingURL=chunk-3RMLDTUF.js.map
@@ -23,7 +23,7 @@ import {
23
23
  toolSuccessStructured,
24
24
  withProgressHeartbeat,
25
25
  wrapToolWithTimeout
26
- } from "./chunk-TSZWXRF7.js";
26
+ } from "./chunk-VULYVX6X.js";
27
27
  import {
28
28
  assessPanelIndependence,
29
29
  countDistinctModels,
@@ -6892,4 +6892,4 @@ export {
6892
6892
  CONSENSUS_VOTE_TOOL_SCHEMA,
6893
6893
  registerConsensusVoteTool
6894
6894
  };
6895
- //# sourceMappingURL=chunk-6SPKOLVU.js.map
6895
+ //# sourceMappingURL=chunk-44I4XVRU.js.map
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var VERSION = true ? "8.3.2" : "dev";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-LZBARHPR.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-LW6FPSPN.js";
24
+ } from "./chunk-3RMLDTUF.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-CCRTVIXF.js";
@@ -47,7 +47,7 @@ import {
47
47
  simulationDeniedResult,
48
48
  toJobSummary,
49
49
  writeJobCancelled
50
- } from "./chunk-6SPKOLVU.js";
50
+ } from "./chunk-44I4XVRU.js";
51
51
  import {
52
52
  allOf
53
53
  } from "./chunk-OQB3XC5O.js";
@@ -64,7 +64,7 @@ import {
64
64
  } from "./chunk-PGUZPMT4.js";
65
65
  import {
66
66
  withPrerequisite
67
- } from "./chunk-AQF22T74.js";
67
+ } from "./chunk-3OU7XMEP.js";
68
68
  import {
69
69
  NOOP_NOTIFIER,
70
70
  RateLimiter,
@@ -89,7 +89,7 @@ import {
89
89
  withAuditTrail,
90
90
  withProgressHeartbeat,
91
91
  wrapToolWithTimeout
92
- } from "./chunk-TSZWXRF7.js";
92
+ } from "./chunk-VULYVX6X.js";
93
93
  import {
94
94
  createAuditTrail,
95
95
  createGraphAuditBridge,
@@ -47529,7 +47529,7 @@ ${contextBlock}`;
47529
47529
  const strategy = config.votingStrategy ?? "higher_order";
47530
47530
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47531
47531
  try {
47532
- const { executeVoting } = await import("./consensus-vote-44WT45UN.js");
47532
+ const { executeVoting } = await import("./consensus-vote-H67IAMI2.js");
47533
47533
  const votingResult = await executeVoting(
47534
47534
  {
47535
47535
  proposal: buildVoteProposal(plan, research),
@@ -48068,10 +48068,6 @@ function createAuditStageRegistry() {
48068
48068
  ]);
48069
48069
  }
48070
48070
 
48071
- // src/mcp/tools/pr-review-tool.ts
48072
- import { z as z102 } from "zod";
48073
- import { randomUUID as randomUUID13 } from "node:crypto";
48074
-
48075
48071
  // src/mcp/tools/pr-review-findings.ts
48076
48072
  import { parse as parseYaml3 } from "yaml";
48077
48073
  function isFindingVerified(gate) {
@@ -48152,6 +48148,73 @@ var FINDINGS_FORMAT_INSTRUCTIONS = `If you have one or more findings (claims tha
48152
48148
 
48153
48149
  A finding only triggers request_changes if ALL FOUR gate checks are 'passed' AND named_assertion is substantive (>10 chars, naming a concrete failure). Findings missing any of those surface as informational only \u2014 they do not block the merge. This is the #2225 verification gate; the 2026-04-25 audit found a 100% false-positive rate when this gate was not enforced.`;
48154
48150
 
48151
+ // src/mcp/tools/pr-review-proposal.ts
48152
+ function buildPrReviewProposal(input, removedBeforeThisCall = 0) {
48153
+ const sanitizeResult = sanitizeToolInput({
48154
+ prTitle: input.prTitle,
48155
+ prDescription: input.prDescription,
48156
+ prDiff: input.prDiff,
48157
+ repoContext: input.repoContext
48158
+ });
48159
+ const safe = sanitizeResult.sanitized;
48160
+ const parts = [];
48161
+ parts.push(`# Pull Request Review
48162
+ `);
48163
+ const totalRemoved = sanitizeResult.commentsRemoved + removedBeforeThisCall;
48164
+ if (totalRemoved > 0) {
48165
+ parts.push(
48166
+ `> **Note:** ${String(totalRemoved)} HTML comment(s) were removed from the untrusted fields below before you saw them (#5258). Comments are invisible in rendered markdown, so they are stripped rather than trusted. This is routine \u2014 GitHub's default PR template contains one \u2014 and is not by itself evidence of an attack.
48167
+ `
48168
+ );
48169
+ }
48170
+ parts.push(`**Title:** ${safe.prTitle}
48171
+ `);
48172
+ if (input.baseRef !== void 0 && input.headRef !== void 0) {
48173
+ parts.push(`**Branches:** ${input.headRef} \u2192 ${input.baseRef}
48174
+ `);
48175
+ }
48176
+ if (safe.repoContext !== void 0 && safe.repoContext !== "") {
48177
+ parts.push(`
48178
+ **Repo context:**
48179
+ ${safe.repoContext}
48180
+ `);
48181
+ }
48182
+ if (safe.prDescription !== void 0 && safe.prDescription !== "") {
48183
+ parts.push(`
48184
+ **Description:**
48185
+ ${safe.prDescription}
48186
+ `);
48187
+ }
48188
+ parts.push(`
48189
+ ## Diff
48190
+
48191
+ \`\`\`diff
48192
+ ${safe.prDiff}
48193
+ \`\`\`
48194
+ `);
48195
+ parts.push(`
48196
+ ## Your task
48197
+ `);
48198
+ parts.push(`Review this PR from your role's perspective. Decide: should it be merged as-is?
48199
+ `);
48200
+ parts.push(`- **APPROVE** if the diff is correct, complete, and aligned with your role.
48201
+ `);
48202
+ parts.push(
48203
+ `- **REJECT** (= "request changes") if there is at least one concrete defect, missing requirement, or violation that justifies blocking the merge.
48204
+ `
48205
+ );
48206
+ parts.push(`- **ABSTAIN** if the diff is outside your role's concerns.
48207
+ `);
48208
+ parts.push(`
48209
+ ${FINDINGS_FORMAT_INSTRUCTIONS}
48210
+ `);
48211
+ return parts.join("");
48212
+ }
48213
+
48214
+ // src/mcp/tools/pr-review-tool.ts
48215
+ import { z as z102 } from "zod";
48216
+ import { randomUUID as randomUUID13 } from "node:crypto";
48217
+
48155
48218
  // src/audit/reviewed-diff-hash.ts
48156
48219
  import * as crypto2 from "node:crypto";
48157
48220
  var MAX_REVIEWED_DIFF_BYTES = 5e4;
@@ -48833,66 +48896,6 @@ function absoluteQuorumApprove(reviews, valid) {
48833
48896
  }
48834
48897
  return { decision: "approve", verified: true };
48835
48898
  }
48836
- function buildPrReviewProposal(input) {
48837
- const sanitizeResult = sanitizeToolInput({
48838
- prTitle: input.prTitle,
48839
- prDescription: input.prDescription,
48840
- prDiff: input.prDiff,
48841
- repoContext: input.repoContext
48842
- });
48843
- const safe = sanitizeResult.sanitized;
48844
- const parts = [];
48845
- parts.push(`# Pull Request Review
48846
- `);
48847
- if (sanitizeResult.commentsRemoved > 0) {
48848
- parts.push(
48849
- `> **Note:** ${String(sanitizeResult.commentsRemoved)} HTML comment(s) were removed from the untrusted fields below before you saw them (#5258). Comments are invisible in rendered markdown, so they are stripped rather than trusted. This is routine \u2014 GitHub's default PR template contains one \u2014 and is not by itself evidence of an attack.
48850
- `
48851
- );
48852
- }
48853
- parts.push(`**Title:** ${safe.prTitle}
48854
- `);
48855
- if (input.baseRef !== void 0 && input.headRef !== void 0) {
48856
- parts.push(`**Branches:** ${input.headRef} \u2192 ${input.baseRef}
48857
- `);
48858
- }
48859
- if (safe.repoContext !== void 0 && safe.repoContext !== "") {
48860
- parts.push(`
48861
- **Repo context:**
48862
- ${safe.repoContext}
48863
- `);
48864
- }
48865
- if (safe.prDescription !== void 0 && safe.prDescription !== "") {
48866
- parts.push(`
48867
- **Description:**
48868
- ${safe.prDescription}
48869
- `);
48870
- }
48871
- parts.push(`
48872
- ## Diff
48873
-
48874
- \`\`\`diff
48875
- ${safe.prDiff}
48876
- \`\`\`
48877
- `);
48878
- parts.push(`
48879
- ## Your task
48880
- `);
48881
- parts.push(`Review this PR from your role's perspective. Decide: should it be merged as-is?
48882
- `);
48883
- parts.push(`- **APPROVE** if the diff is correct, complete, and aligned with your role.
48884
- `);
48885
- parts.push(
48886
- `- **REJECT** (= "request changes") if there is at least one concrete defect, missing requirement, or violation that justifies blocking the merge.
48887
- `
48888
- );
48889
- parts.push(`- **ABSTAIN** if the diff is outside your role's concerns.
48890
- `);
48891
- parts.push(`
48892
- ${FINDINGS_FORMAT_INSTRUCTIONS}
48893
- `);
48894
- return parts.join("");
48895
- }
48896
48899
  function resolveAggregate(reviews, input, errorCount, coverage, logger58) {
48897
48900
  const preGate = aggregatePrDecisions(reviews, input.errorPolicy);
48898
48901
  if (preGate.reason !== void 0) {
@@ -48910,7 +48913,7 @@ function resolveAggregate(reviews, input, errorCount, coverage, logger58) {
48910
48913
  }
48911
48914
  return aggregate;
48912
48915
  }
48913
- function preparePanelProposal(input, logger58) {
48916
+ function preparePanelProposal(input, logger58, removedBeforeThisCall = 0) {
48914
48917
  const { coverage, packedDiff, note } = packDiffForReview(input.prDiff, MAX_DIFF_LENGTH);
48915
48918
  const body = coverage === void 0 ? input : { ...input, prDiff: packedDiff };
48916
48919
  if (coverage?.partial === true) {
@@ -48918,24 +48921,11 @@ function preparePanelProposal(input, logger58) {
48918
48921
  `pr_review diff over budget \u2014 reviewed ${String(coverage.reviewedFiles)} of ${String(coverage.totalFiles)} files, dropped ${String(coverage.droppedFiles.length)}`
48919
48922
  );
48920
48923
  }
48921
- return { proposal: note + buildPrReviewProposal(body), coverage };
48924
+ return { proposal: note + buildPrReviewProposal(body, removedBeforeThisCall), coverage };
48922
48925
  }
48923
- async function executePrReviewBody(input, logger58, gatewayAdapters) {
48924
- const start = Date.now();
48925
- const { proposal, coverage } = preparePanelProposal(input, logger58);
48926
- const voteResults = await collectRealVotes({
48927
- roles: PR_REVIEW_ROLES,
48928
- proposal,
48929
- simulate: input.simulate,
48930
- logger: logger58,
48931
- ...gatewayAdapters !== void 0 && { gatewayAdapters }
48932
- });
48933
- const reviews = voteResults.map(toPrReviewVote);
48934
- const counts = summarizeReviews(reviews);
48935
- const aggregate = resolveAggregate(reviews, input, counts.errorCount, coverage, logger58);
48936
- let costSummary;
48926
+ function rollUpDecisionCost(voteResults, logger58) {
48937
48927
  try {
48938
- costSummary = recordDecisionCost({
48928
+ return recordDecisionCost({
48939
48929
  decisionId: `pr-${randomUUID13().slice(0, 8)}`,
48940
48930
  gate: "pr_review",
48941
48931
  votes: voteResults
@@ -48944,7 +48934,24 @@ async function executePrReviewBody(input, logger58, gatewayAdapters) {
48944
48934
  logger58.warn("Per-decision cost rollup failed (non-fatal)", {
48945
48935
  error: getErrorMessage(costError)
48946
48936
  });
48937
+ return void 0;
48947
48938
  }
48939
+ }
48940
+ async function executePrReviewBody(input, logger58, opts = {}) {
48941
+ const start = Date.now();
48942
+ const { gatewayAdapters: adapters, removedBeforeThisCall: removed = 0 } = opts;
48943
+ const { proposal, coverage } = preparePanelProposal(input, logger58, removed);
48944
+ const voteResults = await collectRealVotes({
48945
+ roles: PR_REVIEW_ROLES,
48946
+ proposal,
48947
+ simulate: input.simulate,
48948
+ logger: logger58,
48949
+ ...adapters !== void 0 && { gatewayAdapters: adapters }
48950
+ });
48951
+ const reviews = voteResults.map(toPrReviewVote);
48952
+ const counts = summarizeReviews(reviews);
48953
+ const aggregate = resolveAggregate(reviews, input, counts.errorCount, coverage, logger58);
48954
+ const costSummary = rollUpDecisionCost(voteResults, logger58);
48948
48955
  const recordOutcome3 = persistReviewRecord({
48949
48956
  // #4459: `input.prDiff` is opaque MCP input — it passed the unified-diff
48950
48957
  // shape gate (#4451), but nothing here establishes it is the PR's real diff.
@@ -48969,6 +48976,7 @@ async function executePrReviewBody(input, logger58, gatewayAdapters) {
48969
48976
  return toolSuccess(JSON.stringify(response, null, 2));
48970
48977
  }
48971
48978
  function makePrReviewHandler(gatewayAdapters) {
48979
+ const adapterOpt = gatewayAdapters !== void 0 ? { gatewayAdapters } : {};
48972
48980
  return async function prReviewHandler(args, ctx) {
48973
48981
  const parsed = PrReviewInputSchema.safeParse(args);
48974
48982
  if (!parsed.success) {
@@ -48988,11 +48996,17 @@ function makePrReviewHandler(gatewayAdapters) {
48988
48996
  toolName: "pr_review",
48989
48997
  input,
48990
48998
  freshJobId: () => `pr-${randomUUID13()}`,
48991
- run: () => executePrReviewBody(input, ctx.logger, gatewayAdapters),
48999
+ run: () => executePrReviewBody(input, ctx.logger, {
49000
+ ...adapterOpt,
49001
+ removedBeforeThisCall: ctx.sanitization.commentsRemoved
49002
+ }),
48992
49003
  logger: ctx.logger
48993
49004
  });
48994
49005
  }
48995
- return await executePrReviewBody(input, ctx.logger, gatewayAdapters);
49006
+ return await executePrReviewBody(input, ctx.logger, {
49007
+ ...adapterOpt,
49008
+ removedBeforeThisCall: ctx.sanitization.commentsRemoved
49009
+ });
48996
49010
  } catch (error) {
48997
49011
  return toolStructuredError({
48998
49012
  errorCategory: "internal",
@@ -56129,12 +56143,12 @@ export {
56129
56143
  registerPipelineTool,
56130
56144
  registerRunTool,
56131
56145
  registerListAvailableModelsTool,
56146
+ buildPrReviewProposal,
56132
56147
  PR_REVIEW_ROLES,
56133
56148
  MAX_DIFF_LENGTH,
56134
56149
  PrReviewInputSchema,
56135
56150
  mapVoteDecisionToPrDecision,
56136
56151
  aggregatePrDecisions,
56137
- buildPrReviewProposal,
56138
56152
  registerPrReviewTool,
56139
56153
  registerSupplyChainTradeoffPanelTool,
56140
56154
  createAnnotationsProxy,
@@ -56172,4 +56186,4 @@ export {
56172
56186
  shutdownFeedbackSubscriber,
56173
56187
  createEventBusBridge
56174
56188
  };
56175
- //# sourceMappingURL=chunk-OFUJNXH3.js.map
56189
+ //# sourceMappingURL=chunk-ONSYYUB4.js.map