nexus-agents 3.1.1 → 3.2.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 (29) hide show
  1. package/dist/{chunk-5UFRDLQT.js → chunk-5NRFPUNP.js} +39 -4
  2. package/dist/chunk-5NRFPUNP.js.map +1 -0
  3. package/dist/{chunk-LHOMRQTU.js → chunk-NFFGQZQ2.js} +2 -2
  4. package/dist/{chunk-NSIPB65X.js → chunk-OJVNSOZZ.js} +3 -3
  5. package/dist/{chunk-QZINUMKA.js → chunk-PE35GMXD.js} +10 -2
  6. package/dist/chunk-PE35GMXD.js.map +1 -0
  7. package/dist/{chunk-DITV4B6I.js → chunk-TE37WUAC.js} +6 -6
  8. package/dist/cli.d.ts +1 -1
  9. package/dist/cli.js +6 -6
  10. package/dist/{consensus-vote-6GL7NIDU.js → consensus-vote-PPZUA3EN.js} +2 -2
  11. package/dist/{consensus-vote-types-DusDu6pM.d.ts → consensus-vote-types-C7kiyyqD.d.ts} +10 -0
  12. package/dist/{dist-GR7PQU7T.js → dist-CYRF4S6L.js} +3105 -2284
  13. package/dist/dist-CYRF4S6L.js.map +1 -0
  14. package/dist/index.d.ts +14 -3
  15. package/dist/index.js +7 -5
  16. package/dist/index.js.map +1 -1
  17. package/dist/{issue-triage-3YWM3P2C.js → issue-triage-Q7SYODHT.js} +2 -2
  18. package/dist/model-registry.generated.json +2046 -1418
  19. package/dist/{setup-command-5BQNBFMK.js → setup-command-T6OHZYMY.js} +3 -3
  20. package/package.json +9 -9
  21. package/dist/chunk-5UFRDLQT.js.map +0 -1
  22. package/dist/chunk-QZINUMKA.js.map +0 -1
  23. package/dist/dist-GR7PQU7T.js.map +0 -1
  24. /package/dist/{chunk-LHOMRQTU.js.map → chunk-NFFGQZQ2.js.map} +0 -0
  25. /package/dist/{chunk-NSIPB65X.js.map → chunk-OJVNSOZZ.js.map} +0 -0
  26. /package/dist/{chunk-DITV4B6I.js.map → chunk-TE37WUAC.js.map} +0 -0
  27. /package/dist/{consensus-vote-6GL7NIDU.js.map → consensus-vote-PPZUA3EN.js.map} +0 -0
  28. /package/dist/{issue-triage-3YWM3P2C.js.map → issue-triage-Q7SYODHT.js.map} +0 -0
  29. /package/dist/{setup-command-5BQNBFMK.js.map → setup-command-T6OHZYMY.js.map} +0 -0
@@ -4591,6 +4591,12 @@ var VoteRecordCountsSchema = z7.object({
4591
4591
  abstain: z7.number().int().nonnegative(),
4592
4592
  total: z7.number().int().nonnegative()
4593
4593
  }).strict();
4594
+ var VoteRecordOptionCountSchema = z7.object({
4595
+ /** The option label as declared in the proposal (e.g. 'A'). */
4596
+ option: z7.string().min(1),
4597
+ /** How many voters selected it. */
4598
+ count: z7.number().int().nonnegative()
4599
+ }).strict();
4594
4600
  var VoteRecordSchema = z7.object({
4595
4601
  /**
4596
4602
  * Schema version. '1.1' marked the chain→record-set+sequence model (#3927);
@@ -4599,7 +4605,7 @@ var VoteRecordSchema = z7.object({
4599
4605
  * `ratifies` is folded into the self-hash ONLY when present (see
4600
4606
  * {@link computeVoteRecordHash}).
4601
4607
  */
4602
- version: z7.enum(["1.1", "1.2"]),
4608
+ version: z7.enum(["1.1", "1.2", "1.3"]),
4603
4609
  /** Unique record id (also usable as a `ratificationVoteRef`). */
4604
4610
  id: z7.string().min(1),
4605
4611
  /**
@@ -4639,6 +4645,20 @@ var VoteRecordSchema = z7.object({
4639
4645
  voters: z7.array(VoterSummarySchema),
4640
4646
  /** Optional correlation/decision id linking to the cost rollup / trace. */
4641
4647
  correlationId: z7.string().min(1).optional(),
4648
+ /**
4649
+ * Per-option distribution for a multi-option proposal (#4452, schema 1.3).
4650
+ *
4651
+ * Present only when the vote declared `options`. Absent on an ordinary
4652
+ * yes/no vote, and absent on every 1.1/1.2 record — which is why it is
4653
+ * folded into the self-hash ONLY when present (see
4654
+ * {@link computeVoteRecordHash}), exactly as `ratifies` was.
4655
+ *
4656
+ * Without this, a 6-1 or 5-2 option split is recorded as `approve: 7` and
4657
+ * reads as unanimous. Threshold semantics invert too: `unanimous` becomes
4658
+ * the EASIEST bar to clear, because every engaged voter approves while
4659
+ * choosing different things.
4660
+ */
4661
+ optionTally: z7.array(VoteRecordOptionCountSchema).min(1).optional(),
4642
4662
  /**
4643
4663
  * The loop/strategy subject this vote RATIFIES (#3927 item 1). Present only on
4644
4664
  * a ratification vote; set at vote time and bound into the self-hash (so it is
@@ -4684,8 +4704,12 @@ function computeVoteRecordHash(payload) {
4684
4704
  })),
4685
4705
  correlationId: payload.correlationId ?? null
4686
4706
  };
4707
+ const withTally = payload.optionTally !== void 0 ? {
4708
+ ...base,
4709
+ optionTally: payload.optionTally.map((o) => ({ option: o.option, count: o.count }))
4710
+ } : base;
4687
4711
  const canonical = JSON.stringify(
4688
- payload.ratifies !== void 0 ? { ...base, ratifies: payload.ratifies } : base
4712
+ payload.ratifies !== void 0 ? { ...withTally, ratifies: payload.ratifies } : withTally
4689
4713
  );
4690
4714
  return crypto.createHash("sha256").update(canonical).digest("hex");
4691
4715
  }
@@ -4717,10 +4741,20 @@ function toVoterSummaries(votes) {
4717
4741
  }
4718
4742
  return summaries;
4719
4743
  }
4744
+ function tallySelectedOptions(votes) {
4745
+ const counts = /* @__PURE__ */ new Map();
4746
+ for (const v of votes) {
4747
+ if (v.selectedOption === void 0) continue;
4748
+ counts.set(v.selectedOption, (counts.get(v.selectedOption) ?? 0) + 1);
4749
+ }
4750
+ if (counts.size === 0) return void 0;
4751
+ return [...counts.entries()].map(([option, count]) => ({ option, count })).sort((a, b) => b.count !== a.count ? b.count - a.count : a.option.localeCompare(b.option));
4752
+ }
4720
4753
  function buildVoteRecord(input) {
4721
4754
  const proposalTruncated = input.proposal.length > MAX_PROPOSAL_RECORD_CHARS ? input.proposal.slice(0, MAX_PROPOSAL_RECORD_CHARS) + "..." : input.proposal;
4755
+ const optionTally = tallySelectedOptions(input.votes);
4722
4756
  const payload = {
4723
- version: "1.2",
4757
+ version: optionTally !== void 0 ? "1.3" : "1.2",
4724
4758
  id: input.id,
4725
4759
  sequence: input.sequence ?? 0,
4726
4760
  recordedAt: input.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -4738,6 +4772,7 @@ function buildVoteRecord(input) {
4738
4772
  voters: toVoterSummaries(input.votes),
4739
4773
  ...input.correlationId !== void 0 ? { correlationId: input.correlationId } : {},
4740
4774
  ...input.ratifies !== void 0 ? { ratifies: input.ratifies } : {},
4775
+ ...optionTally !== void 0 ? { optionTally } : {},
4741
4776
  ...input.previousHash !== void 0 ? { previousHash: input.previousHash } : {}
4742
4777
  };
4743
4778
  return { ...payload, hash: computeVoteRecordHash(payload) };
@@ -6468,4 +6503,4 @@ export {
6468
6503
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
6469
6504
  registerConsensusVoteTool
6470
6505
  };
6471
- //# sourceMappingURL=chunk-5UFRDLQT.js.map
6506
+ //# sourceMappingURL=chunk-5NRFPUNP.js.map