nexus-agents 8.83.0 → 8.84.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.
Files changed (30) hide show
  1. package/dist/{chunk-CEPKZE3M.js → chunk-3VZCDTK5.js} +9 -9
  2. package/dist/{chunk-VRTZSUMG.js → chunk-6YQTQYKD.js} +3 -3
  3. package/dist/{chunk-NXMETLX7.js → chunk-7WJIC7H6.js} +2 -2
  4. package/dist/{chunk-3EFOVHKF.js → chunk-H4X7QDTB.js} +140 -5
  5. package/dist/chunk-H4X7QDTB.js.map +1 -0
  6. package/dist/{chunk-ZUWF76BV.js → chunk-JM7Z4XKP.js} +3 -3
  7. package/dist/{chunk-CPJWPHUX.js → chunk-OY27GVJ4.js} +2 -2
  8. package/dist/{chunk-HA2U5XJ2.js → chunk-QOJS3KCM.js} +2 -2
  9. package/dist/cli.js +17 -13
  10. package/dist/cli.js.map +1 -1
  11. package/dist/{consensus-vote-4VBUZ5NH.js → consensus-vote-TV7NW6HD.js} +4 -4
  12. package/dist/{improvement-review-RSKJAU4A.js → improvement-review-6D6LV5H5.js} +4 -4
  13. package/dist/index.d.ts +124 -68
  14. package/dist/index.js +7 -7
  15. package/dist/{issue-triage-TS4WXIQ2.js → issue-triage-XG2AISLY.js} +2 -2
  16. package/dist/model-registry.generated.json +7269 -3654
  17. package/dist/models-dev-snapshot.json +98 -2
  18. package/dist/{setup-data-dir-OFOKYKTI.js → setup-data-dir-Y6FMGFGP.js} +3 -3
  19. package/package.json +4 -4
  20. package/dist/chunk-3EFOVHKF.js.map +0 -1
  21. /package/dist/{chunk-CEPKZE3M.js.map → chunk-3VZCDTK5.js.map} +0 -0
  22. /package/dist/{chunk-VRTZSUMG.js.map → chunk-6YQTQYKD.js.map} +0 -0
  23. /package/dist/{chunk-NXMETLX7.js.map → chunk-7WJIC7H6.js.map} +0 -0
  24. /package/dist/{chunk-ZUWF76BV.js.map → chunk-JM7Z4XKP.js.map} +0 -0
  25. /package/dist/{chunk-CPJWPHUX.js.map → chunk-OY27GVJ4.js.map} +0 -0
  26. /package/dist/{chunk-HA2U5XJ2.js.map → chunk-QOJS3KCM.js.map} +0 -0
  27. /package/dist/{consensus-vote-4VBUZ5NH.js.map → consensus-vote-TV7NW6HD.js.map} +0 -0
  28. /package/dist/{improvement-review-RSKJAU4A.js.map → improvement-review-6D6LV5H5.js.map} +0 -0
  29. /package/dist/{issue-triage-TS4WXIQ2.js.map → issue-triage-XG2AISLY.js.map} +0 -0
  30. /package/dist/{setup-data-dir-OFOKYKTI.js.map → setup-data-dir-Y6FMGFGP.js.map} +0 -0
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-VRTZSUMG.js";
24
+ } from "./chunk-6YQTQYKD.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-3NPRFOSH.js";
@@ -72,7 +72,7 @@ import {
72
72
  updateStage,
73
73
  withWarnings,
74
74
  writeJobCancelled
75
- } from "./chunk-ZUWF76BV.js";
75
+ } from "./chunk-JM7Z4XKP.js";
76
76
  import {
77
77
  allOf,
78
78
  anyOf
@@ -89,13 +89,13 @@ import {
89
89
  createGraphAuditBridge,
90
90
  emitPipelinePolicyEvent,
91
91
  readActionRefusal
92
- } from "./chunk-3EFOVHKF.js";
92
+ } from "./chunk-H4X7QDTB.js";
93
93
  import {
94
94
  sanitizeInput
95
95
  } from "./chunk-U53CKPED.js";
96
96
  import {
97
97
  withPrerequisite
98
- } from "./chunk-HA2U5XJ2.js";
98
+ } from "./chunk-QOJS3KCM.js";
99
99
  import {
100
100
  NOOP_NOTIFIER,
101
101
  RateLimiter,
@@ -120,7 +120,7 @@ import {
120
120
  toolSuccessStructured,
121
121
  withProgressHeartbeat,
122
122
  wrapToolWithTimeout
123
- } from "./chunk-CPJWPHUX.js";
123
+ } from "./chunk-OY27GVJ4.js";
124
124
  import {
125
125
  EventTopics,
126
126
  UNRESOLVED_MODEL_ID,
@@ -45461,7 +45461,7 @@ async function tryIssueTriage(task) {
45461
45461
  try {
45462
45462
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
45463
45463
  if (issueMatch === null) return null;
45464
- const { createIssueTriage } = await import("./issue-triage-TS4WXIQ2.js");
45464
+ const { createIssueTriage } = await import("./issue-triage-XG2AISLY.js");
45465
45465
  const triage = createIssueTriage();
45466
45466
  const owner = issueMatch[1] ?? "";
45467
45467
  const num2 = issueMatch[2] ?? "";
@@ -45863,7 +45863,7 @@ function buildVotingInput(plan, config) {
45863
45863
  }
45864
45864
  async function executeSingleVote(plan, config, log) {
45865
45865
  try {
45866
- const { executeVoting } = await import("./consensus-vote-4VBUZ5NH.js");
45866
+ const { executeVoting } = await import("./consensus-vote-TV7NW6HD.js");
45867
45867
  const input = buildVotingInput(plan, config);
45868
45868
  const result = await executeVoting(input, log);
45869
45869
  return parseVotingResult(result);
@@ -46830,7 +46830,7 @@ function createVoteStage({ config, startStage }) {
46830
46830
  const strategy = config.votingStrategy ?? "higher_order";
46831
46831
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
46832
46832
  try {
46833
- const { executeVoting } = await import("./consensus-vote-4VBUZ5NH.js");
46833
+ const { executeVoting } = await import("./consensus-vote-TV7NW6HD.js");
46834
46834
  const votingResult = await executeVoting(
46835
46835
  {
46836
46836
  proposal: buildVoteProposal(plan, research),
@@ -56292,4 +56292,4 @@ export {
56292
56292
  startPipelineEventBridge,
56293
56293
  shutdownPipelineEventBridge
56294
56294
  };
56295
- //# sourceMappingURL=chunk-CEPKZE3M.js.map
56295
+ //# sourceMappingURL=chunk-3VZCDTK5.js.map
@@ -12,7 +12,7 @@ import {
12
12
  NODE_ENGINE_RANGE,
13
13
  VERSION,
14
14
  isNodeVersionSupported
15
- } from "./chunk-NXMETLX7.js";
15
+ } from "./chunk-7WJIC7H6.js";
16
16
  import {
17
17
  claimGlobalRegistry
18
18
  } from "./chunk-YWEZ7W4K.js";
@@ -1372,7 +1372,7 @@ async function runDoctorFix(result) {
1372
1372
  writeLine2("\u2500".repeat(40));
1373
1373
  let fixCount = 0;
1374
1374
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1375
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-OFOKYKTI.js");
1375
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-Y6FMGFGP.js");
1376
1376
  const outcome = describeDataDirFix2(initDataDirectories2());
1377
1377
  writeLine2(outcome.line);
1378
1378
  if (outcome.counted) fixCount++;
@@ -1474,4 +1474,4 @@ export {
1474
1474
  startStdioServer,
1475
1475
  closeServer
1476
1476
  };
1477
- //# sourceMappingURL=chunk-VRTZSUMG.js.map
1477
+ //# sourceMappingURL=chunk-6YQTQYKD.js.map
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  import semver from "semver";
3
- var VERSION = true ? "8.83.0" : "dev";
3
+ var VERSION = true ? "8.84.0" : "dev";
4
4
  var NODE_ENGINE_RANGE = ">=22.5.0";
5
5
  function isNodeVersionSupported(version) {
6
6
  return semver.satisfies(version, NODE_ENGINE_RANGE);
@@ -11,4 +11,4 @@ export {
11
11
  NODE_ENGINE_RANGE,
12
12
  isNodeVersionSupported
13
13
  };
14
- //# sourceMappingURL=chunk-NXMETLX7.js.map
14
+ //# sourceMappingURL=chunk-7WJIC7H6.js.map
@@ -1012,6 +1012,55 @@ function policyRefusal(policy, policyMode, user, effectiveTrustTier) {
1012
1012
  violations: blocking
1013
1013
  };
1014
1014
  }
1015
+ function executeActionPolicy(action, options, config) {
1016
+ const context = options.context ?? config.defaultContext;
1017
+ const actionContext = buildActionContext(options.effectiveTrustTier, context, options);
1018
+ const evaluation = evaluateFirewallPolicy(
1019
+ actionContext,
1020
+ action,
1021
+ config.auditStage ? config.auditTrail : void 0
1022
+ );
1023
+ const blocking = blockingViolations(evaluation);
1024
+ if (blocking.length > 0) {
1025
+ logger2.warn("Firewall surfaced blocking policy violations", {
1026
+ user: options.user,
1027
+ effectiveTrustTier: options.effectiveTrustTier,
1028
+ scope: evaluation.scope,
1029
+ rules: blocking.map((v) => v.rule)
1030
+ });
1031
+ }
1032
+ const refusal = policyRefusal(
1033
+ evaluation,
1034
+ config.policyMode,
1035
+ options.user,
1036
+ options.effectiveTrustTier
1037
+ );
1038
+ if (refusal !== void 0) return err(refusal);
1039
+ return ok({
1040
+ evaluated: true,
1041
+ policy: evaluation,
1042
+ effectiveTrustTier: options.effectiveTrustTier,
1043
+ policyMode: config.policyMode,
1044
+ wouldRefuse: blocking.length > 0 && config.policyMode === "audit"
1045
+ });
1046
+ }
1047
+ function evaluateActionPolicy(action, options, config) {
1048
+ if (options.user.trim() === "") {
1049
+ return err({
1050
+ code: "EXTRACTION_FAILED",
1051
+ message: "Author username is required",
1052
+ stage: "extraction"
1053
+ });
1054
+ }
1055
+ if (!config.policyEnforcementStage) {
1056
+ return ok({
1057
+ evaluated: false,
1058
+ reason: "policy-stage-disabled",
1059
+ policyMode: config.policyMode
1060
+ });
1061
+ }
1062
+ return executeActionPolicy(action, options, config);
1063
+ }
1015
1064
 
1016
1065
  // src/security/corroboration-validator.ts
1017
1066
  function hasCIPass(sources) {
@@ -1244,10 +1293,31 @@ var HostileInputFirewall = class {
1244
1293
  reputationGate,
1245
1294
  atl,
1246
1295
  policy,
1247
- start
1296
+ start,
1297
+ user: meta.username,
1298
+ context
1248
1299
  })
1249
1300
  );
1250
1301
  }
1302
+ /**
1303
+ * Action-shaped re-entry that evaluates policy for one action against an
1304
+ * already-enforced trust tier (#6310).
1305
+ *
1306
+ * Unlike {@link process}, this does NOT re-run input extraction, sanitization,
1307
+ * trust classification, or reputation gating, and does NOT re-emit the
1308
+ * input-level audit events (`sanitization`, `reputation`, `trust_classification`).
1309
+ * It evaluates the policy stage against the provided tier and context,
1310
+ * recording only the `policy_gate` event to the audit trail.
1311
+ */
1312
+ evaluateAction(action, options) {
1313
+ return evaluateActionPolicy(action, options, {
1314
+ defaultContext: this.context,
1315
+ policyMode: this.policyMode,
1316
+ policyEnforcementStage: this.stages.policyEnforcement,
1317
+ auditTrail: this.auditTrail,
1318
+ auditStage: this.stages.audit
1319
+ });
1320
+ }
1251
1321
  /**
1252
1322
  * Runs the policy checks the call's facts allow — see
1253
1323
  * {@link evaluateFirewallPolicy} (#5380; Rule-of-Two-only since #3198). The
@@ -1299,7 +1369,13 @@ var HostileInputFirewall = class {
1299
1369
  wouldRefuse: blocking && this.policyMode === "audit",
1300
1370
  auditEvents: this.auditTrail.query().map((e) => ({ id: e.id, type: e.type })),
1301
1371
  auditSink: this.auditSink,
1302
- durationMs: Date.now() - parts.start
1372
+ durationMs: Date.now() - parts.start,
1373
+ evaluateAction: (action, evalOptions) => this.evaluateAction(action, {
1374
+ user: parts.user,
1375
+ effectiveTrustTier: parts.effectiveTrustTier,
1376
+ context: evalOptions?.context ?? parts.context,
1377
+ existingLabels: evalOptions?.existingLabels
1378
+ })
1303
1379
  };
1304
1380
  }
1305
1381
  /**
@@ -1581,7 +1657,60 @@ function runUntrustedInputFirewall(input, options) {
1581
1657
  if (!result.ok) return err(asError(result.error));
1582
1658
  return ok(result.value);
1583
1659
  }
1584
- function evaluateActionThroughFirewall(input, options) {
1660
+ function isActionHandleInput(input) {
1661
+ return "evaluateAction" in input && typeof input.evaluateAction === "function";
1662
+ }
1663
+ function logAuditRefusal(actionType, result) {
1664
+ const { policy, effectiveTrustTier } = result;
1665
+ logger4.warn("Untrusted-input firewall would refuse under enforce (audit mode)", {
1666
+ actionType,
1667
+ trustTier: effectiveTrustTier,
1668
+ scope: policy.scope,
1669
+ rules: policy.violations.filter((v) => v.severity === "block").map((v) => v.rule),
1670
+ unmeasured: policy.unmeasured
1671
+ });
1672
+ }
1673
+ function evaluateActionViaHandle(input, options) {
1674
+ const actionResult = input.evaluateAction(options.action, {
1675
+ context: options.context,
1676
+ existingLabels: options.existingLabels
1677
+ });
1678
+ if (!actionResult.ok) {
1679
+ const { code, stage, violations } = actionResult.error;
1680
+ if (code !== "POLICY_REFUSED" || stage !== "policy") return err(asError(actionResult.error));
1681
+ if (violations === void 0 || violations.length === 0)
1682
+ return err(asError(actionResult.error));
1683
+ return ok({ refused: true, allowed: false, violations, policyMode: "enforce" });
1684
+ }
1685
+ if (!actionResult.value.evaluated) {
1686
+ return err(
1687
+ new Error(
1688
+ `Untrusted-input firewall did not evaluate policy for action ${options.action.type} (the policy stage is disabled)`
1689
+ )
1690
+ );
1691
+ }
1692
+ const { policy, policyMode, wouldRefuse, effectiveTrustTier } = actionResult.value;
1693
+ if (effectiveTrustTier !== options.enforcedTier) {
1694
+ return err(
1695
+ new Error(
1696
+ `Untrusted-input firewall enforced tier ${effectiveTrustTier} for action ${options.action.type} but tier ${options.enforcedTier} for the classification`
1697
+ )
1698
+ );
1699
+ }
1700
+ if (wouldRefuse) {
1701
+ logAuditRefusal(options.action.type, actionResult.value);
1702
+ }
1703
+ return ok({
1704
+ refused: false,
1705
+ allowed: policy.allowed,
1706
+ requiresApproval: policy.requiresApproval,
1707
+ violations: policy.violations,
1708
+ effectiveTrustTier,
1709
+ policyMode,
1710
+ wouldRefuse
1711
+ });
1712
+ }
1713
+ function evaluateActionViaProcess(input, options) {
1585
1714
  const { enforcedTier, ...processOptions } = options;
1586
1715
  const result = processAndLog(input, processOptions);
1587
1716
  if (!result.ok) {
@@ -1616,6 +1745,12 @@ function evaluateActionThroughFirewall(input, options) {
1616
1745
  wouldRefuse
1617
1746
  });
1618
1747
  }
1748
+ function evaluateActionThroughFirewall(input, options) {
1749
+ if (isActionHandleInput(input)) {
1750
+ return evaluateActionViaHandle(input, options);
1751
+ }
1752
+ return evaluateActionViaProcess(input, options);
1753
+ }
1619
1754
  function validateActionCorroboration(action) {
1620
1755
  const result = getUntrustedInputFirewall().validateAction(action);
1621
1756
  if (!result.ok) {
@@ -2207,7 +2342,7 @@ var IssueTriage = class {
2207
2342
  const actions = this.generateActions(safeTitle, safeBody, issueResult, enforced);
2208
2343
  const withEscalation = applySafetyActions(actions, gateDecision, reputation, issueResult);
2209
2344
  const validatedActions = validateActionsThroughFirewall(
2210
- firewallInputFor("issue", issueResult),
2345
+ firewall.value,
2211
2346
  { ...this.firewallOptions(reputation), enforcedTier: gateDecision.enforcedTier },
2212
2347
  withEscalation,
2213
2348
  existingLabels
@@ -2515,4 +2650,4 @@ export {
2515
2650
  IssueTriage,
2516
2651
  createIssueTriage
2517
2652
  };
2518
- //# sourceMappingURL=chunk-3EFOVHKF.js.map
2653
+ //# sourceMappingURL=chunk-H4X7QDTB.js.map