nexus-agents 4.18.5 → 4.20.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.
@@ -5461,7 +5461,23 @@ var JobResultSchema = z8.object({
5461
5461
  * Failure message when `status === 'failed'`. Cannot be paired with
5462
5462
  * `result` — the discriminator is `status`.
5463
5463
  */
5464
- error: z8.string().optional()
5464
+ error: z8.string().optional(),
5465
+ /**
5466
+ * Whether the tool's `run` callback accepts `runAsJob`'s `AbortSignal`
5467
+ * (#4972).
5468
+ *
5469
+ * `cancel_job` writes a `cancelled` record whether or not the tool can act
5470
+ * on the signal — as `cancel-job-tool.ts` says, "a tool that IGNORES the
5471
+ * signal still runs to completion… but its record stays `cancelled`". A
5472
+ * reader of that record could not tell the two apart, so `cancelled` claimed
5473
+ * more than was known.
5474
+ *
5475
+ * This is a STRUCTURAL fact — the callback's arity — not a behavioural one.
5476
+ * A tool may accept the signal and never await on it, so `true` means
5477
+ * "cancellation can reach this tool", not "the work stopped". Absent means
5478
+ * the writer did not report it, which is not the same as `false`.
5479
+ */
5480
+ signalAccepted: z8.boolean().optional()
5465
5481
  });
5466
5482
  function jobResultPath(jobId) {
5467
5483
  return nexusDataPathEnsure("jobs", `result-${jobId}.json`);
@@ -5470,7 +5486,7 @@ function persistJobRecord(path, record) {
5470
5486
  writeFileSync3(path, JSON.stringify(record, null, 2), { mode: 384 });
5471
5487
  chmodSync(path, 384);
5472
5488
  }
5473
- function writeJobPending(jobId, toolName) {
5489
+ function writeJobPending(jobId, toolName, signalAccepted) {
5474
5490
  const path = jobResultPath(jobId);
5475
5491
  if (existsSync4(path)) {
5476
5492
  logger7.debug("Job result file already exists \u2014 leaving in place", { jobId });
@@ -5481,10 +5497,11 @@ function writeJobPending(jobId, toolName) {
5481
5497
  jobId,
5482
5498
  toolName,
5483
5499
  status: "pending",
5484
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
5500
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5501
+ ...signalAccepted !== void 0 ? { signalAccepted } : {}
5485
5502
  };
5486
5503
  persistJobRecord(path, record);
5487
- logger7.debug("Wrote pending job record", { jobId, toolName });
5504
+ logger7.debug("Wrote pending job record", { jobId, toolName, signalAccepted });
5488
5505
  }
5489
5506
  function writeJobComplete(jobId, toolName, result) {
5490
5507
  const existing = readJobResult(jobId);
@@ -5936,7 +5953,7 @@ function runAsJob(params) {
5936
5953
  return env.busy(suggestRetryAfterMs(params.toolName), params.toolName);
5937
5954
  }
5938
5955
  const jobId = idempotency.jobId;
5939
- writeJobPending(jobId, params.toolName);
5956
+ writeJobPending(jobId, params.toolName, params.run.length >= 3);
5940
5957
  if (params.idempotencyKey !== void 0 && params.idempotencyKey !== "") {
5941
5958
  registerIdempotentJob({
5942
5959
  tool: params.toolName,
@@ -6601,24 +6618,7 @@ var CONSENSUS_VOTE_OUTPUT_SCHEMA = {
6601
6618
  vetoReason: z10.string().max(400).optional()
6602
6619
  }).optional()
6603
6620
  };
6604
- var CONSENSUS_VOTE_TOOL_SCHEMA = {
6605
- proposal: z10.string().min(1).max(MAX_PROPOSAL_LENGTH).describe("Proposal text to vote on"),
6606
- options: z10.array(z10.string().min(1).max(200)).min(2).max(10).optional().describe(
6607
- "Named alternatives for a multi-option proposal (#4472). When present, the threshold must ALSO be cleared by the leading option: `unanimous` requires every approver to have chosen the SAME option, and `supermajority`/`majority` measure the leading option's share of approvers. An approving voter whose selection is absent or matches no declared option stays in the denominator and credits no option, so a degraded response can only lower the leading share, never raise it. Omit for an ordinary yes/no vote."
6608
- ),
6609
- threshold: z10.enum(["majority", "supermajority", "unanimous"]).optional().describe("Voting threshold (legacy). Use strategy instead."),
6610
- strategy: VotingStrategySchema.optional().describe(
6611
- "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order"
6612
- ),
6613
- errorPolicy: ErrorPolicySchema.optional().describe(
6614
- "How to treat errored/timed-out voters (#2630): reduce_denominator (default non-strict) | count_as_abstain | fail_closed (default unanimous) | absolute_quorum (#4132 opt-in \u2014 an errored voter, esp. the contrarian, degrades the verdict to no_quorum instead of being dropped; never manufactures approved/rejected from an induced error). Errors > 50% always fails."
6615
- ),
6616
- quickMode: z10.boolean().optional().default(false).describe("Use 3 agents instead of 7"),
6617
- simulateVotes: z10.boolean().optional().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
6618
- ratifies: z10.string().min(1).max(256).optional().describe(
6619
- "Authority-tier ratification subject (#4004) \u2014 the loop/strategy id this vote ratifies for an authority-ladder promotion. Bound into the authentic vote record so the promotion gate can verify it. Omit for ordinary votes."
6620
- )
6621
- };
6621
+ var CONSENSUS_VOTE_TOOL_SCHEMA = ConsensusVoteInputSchema.shape;
6622
6622
  var CONSENSUS_VOTE_DESCRIPTION = "Execute multi-model consensus voting on a proposal. Uses 7 roles by default (architect, security, devex, ai_ml, pm, catfish, scope_steward) or 3 with quickMode (architect, security, scope_steward), voting with configurable strategies. higher_order does NOT decide the verdict by correlation-aware aggregation (#4701): approve/reject is a simple tally of the panel, so correlated voters each carry full independent weight. The Bayesian correlation analysis is computed and feeds contrarian escalation only. Choose it for the escalation behaviour, not for a weighted verdict. Supports async mode (mode: 'async') \u2014 returns a jobId to poll via get_job_result. Pass ratifies=<subject> to bind an authority-ladder ratification vote into its authentic record. If your proposal asks voters to choose among named alternatives, you MUST pass them in `options` (#4472) \u2014 the threshold is then measured over WHICH option won, and the record carries the per-option tally plus selection coverage. WITHOUT `options` the tally is approve/reject/abstain only, so every voter who engages returns `approve` and a 6-1 split on which option persists as 7-0, 100% (#4452).";
6623
6623
  function registerConsensusVoteTool(server, deps) {
6624
6624
  const logger10 = deps.logger ?? createLogger({ tool: "consensus_vote" });
@@ -6729,4 +6729,4 @@ export {
6729
6729
  CONSENSUS_VOTE_TOOL_SCHEMA,
6730
6730
  registerConsensusVoteTool
6731
6731
  };
6732
- //# sourceMappingURL=chunk-MYYPOVLV.js.map
6732
+ //# sourceMappingURL=chunk-LTS4MLEO.js.map