nexus-agents 8.131.1 → 8.131.3

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 (26) hide show
  1. package/dist/{chunk-NEB2FSBW.js → chunk-5XMXBSPY.js} +3 -3
  2. package/dist/{chunk-2B55IL7S.js → chunk-AAE7F4CB.js} +7 -4
  3. package/dist/chunk-AAE7F4CB.js.map +1 -0
  4. package/dist/{chunk-QGXA3QXW.js → chunk-CGKENW3F.js} +93 -75
  5. package/dist/chunk-CGKENW3F.js.map +1 -0
  6. package/dist/{chunk-DFAT7RB7.js → chunk-FB4ZIOYS.js} +11 -12
  7. package/dist/chunk-FB4ZIOYS.js.map +1 -0
  8. package/dist/{chunk-ETJY6TMK.js → chunk-RWWPMTJK.js} +2 -2
  9. package/dist/{chunk-45AUQYWF.js → chunk-UETCXCAS.js} +193 -144
  10. package/dist/{chunk-45AUQYWF.js.map → chunk-UETCXCAS.js.map} +1 -1
  11. package/dist/cli.js +7 -7
  12. package/dist/cli.js.map +1 -1
  13. package/dist/{consensus-vote-K4SNLVKO.js → consensus-vote-6ISHSQ73.js} +4 -4
  14. package/dist/{improvement-review-UYDDYXIB.js → improvement-review-S65JP2NY.js} +4 -4
  15. package/dist/index.d.ts +3 -26
  16. package/dist/index.js +6 -6
  17. package/dist/{setup-data-dir-IYJGONN3.js → setup-data-dir-EVVWRHY2.js} +3 -3
  18. package/package.json +1 -1
  19. package/dist/chunk-2B55IL7S.js.map +0 -1
  20. package/dist/chunk-DFAT7RB7.js.map +0 -1
  21. package/dist/chunk-QGXA3QXW.js.map +0 -1
  22. /package/dist/{chunk-NEB2FSBW.js.map → chunk-5XMXBSPY.js.map} +0 -0
  23. /package/dist/{chunk-ETJY6TMK.js.map → chunk-RWWPMTJK.js.map} +0 -0
  24. /package/dist/{consensus-vote-K4SNLVKO.js.map → consensus-vote-6ISHSQ73.js.map} +0 -0
  25. /package/dist/{improvement-review-UYDDYXIB.js.map → improvement-review-S65JP2NY.js.map} +0 -0
  26. /package/dist/{setup-data-dir-IYJGONN3.js.map → setup-data-dir-EVVWRHY2.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  getCurrentRequestContext,
6
6
  runWithRequestContext,
7
7
  serverCallerInfo
8
- } from "./chunk-ETJY6TMK.js";
8
+ } from "./chunk-RWWPMTJK.js";
9
9
  import {
10
10
  DEFAULT_EXECUTION_MODE
11
11
  } from "./chunk-ECJ52NSK.js";
@@ -676,6 +676,9 @@ function logRateLimitAudit(opts) {
676
676
  });
677
677
  }
678
678
 
679
+ // src/mcp/tools/tool-result.ts
680
+ import { z as z3 } from "zod";
681
+
679
682
  // src/mcp/error-envelope.ts
680
683
  import { z as z2 } from "zod";
681
684
  var ErrorCategorySchema = z2.enum([
@@ -725,6 +728,12 @@ function toolSuccess(text) {
725
728
  content: [{ type: "text", text }]
726
729
  };
727
730
  }
731
+ function structuredToolSuccess(_schema, data) {
732
+ return {
733
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
734
+ structuredContent: data
735
+ };
736
+ }
728
737
  function toolSuccessStructured(data) {
729
738
  return {
730
739
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
@@ -747,6 +756,13 @@ function toolStructuredError(input) {
747
756
  function toolError(message) {
748
757
  return toolStructuredError({ errorCategory: "internal", message });
749
758
  }
759
+ function registerStructuredTool(server, name, config, callback) {
760
+ return server.registerTool(
761
+ name,
762
+ { ...config, outputSchema: z3.strictObject(config.outputSchema) },
763
+ callback
764
+ );
765
+ }
750
766
 
751
767
  // src/mcp/middleware/secure-handler-rate-limit.ts
752
768
  function rateLimitError(nextTokenMs) {
@@ -2123,7 +2139,7 @@ var VOTING_THRESHOLDS = {
2123
2139
  var ERROR_FLOOR_FRACTION = 0.5;
2124
2140
 
2125
2141
  // src/consensus/types-core.ts
2126
- import { z as z3 } from "zod";
2142
+ import { z as z4 } from "zod";
2127
2143
 
2128
2144
  // src/consensus/decision/quorum.ts
2129
2145
  var DEFAULT_MIN_VOTERS_FOR_QUORUM = 2;
@@ -2132,7 +2148,7 @@ function isQuorumReached(voteCount, minVotersForQuorum) {
2132
2148
  }
2133
2149
 
2134
2150
  // src/consensus/types-core.ts
2135
- var ConsensusAlgorithmSchema = z3.enum([
2151
+ var ConsensusAlgorithmSchema = z4.enum([
2136
2152
  "simple_majority",
2137
2153
  "supermajority",
2138
2154
  "unanimous",
@@ -2140,8 +2156,8 @@ var ConsensusAlgorithmSchema = z3.enum([
2140
2156
  "opinion_wise",
2141
2157
  "higher_order"
2142
2158
  ]);
2143
- var VoteDecisionSchema = z3.enum(["approve", "reject", "abstain"]);
2144
- var ProposalStatusSchema = z3.enum([
2159
+ var VoteDecisionSchema = z4.enum(["approve", "reject", "abstain"]);
2160
+ var ProposalStatusSchema = z4.enum([
2145
2161
  "pending",
2146
2162
  "voting",
2147
2163
  "approved",
@@ -2149,7 +2165,7 @@ var ProposalStatusSchema = z3.enum([
2149
2165
  "timeout",
2150
2166
  "closed"
2151
2167
  ]);
2152
- var RejectionCategorySchema = z3.enum([
2168
+ var RejectionCategorySchema = z4.enum([
2153
2169
  "YAGNI",
2154
2170
  "DRY_VIOLATION",
2155
2171
  "OVER_ENGINEERING",
@@ -2159,74 +2175,74 @@ var RejectionCategorySchema = z3.enum([
2159
2175
  "INSUFFICIENT_EVIDENCE"
2160
2176
  ]);
2161
2177
  var REJECTION_CATEGORIES = RejectionCategorySchema.options;
2162
- var FindingShapeSchema = z3.object({
2163
- summary: z3.string().min(1).max(500),
2164
- location: z3.string().min(1).max(200),
2165
- severity: z3.enum(["critical", "high", "medium", "low", "info"]).default("medium"),
2166
- gate: z3.object({
2167
- reread_cited_line: z3.enum(["passed", "failed", "skipped"]).default("skipped"),
2168
- traced_call_path: z3.enum(["passed", "failed", "skipped"]).default("skipped"),
2169
- named_assertion: z3.string().default(""),
2170
- ruled_out_language_non_issue: z3.enum(["passed", "failed", "skipped"]).default("skipped")
2178
+ var FindingShapeSchema = z4.object({
2179
+ summary: z4.string().min(1).max(500),
2180
+ location: z4.string().min(1).max(200),
2181
+ severity: z4.enum(["critical", "high", "medium", "low", "info"]).default("medium"),
2182
+ gate: z4.object({
2183
+ reread_cited_line: z4.enum(["passed", "failed", "skipped"]).default("skipped"),
2184
+ traced_call_path: z4.enum(["passed", "failed", "skipped"]).default("skipped"),
2185
+ named_assertion: z4.string().default(""),
2186
+ ruled_out_language_non_issue: z4.enum(["passed", "failed", "skipped"]).default("skipped")
2171
2187
  }),
2172
- claim: z3.string().min(1).max(2e3)
2188
+ claim: z4.string().min(1).max(2e3)
2173
2189
  });
2174
- var VoteSchema = z3.object({
2190
+ var VoteSchema = z4.object({
2175
2191
  decision: VoteDecisionSchema,
2176
- reasoning: z3.string().min(1).describe("Explanation for the vote"),
2177
- confidence: z3.number().min(0).max(1).describe("Confidence level 0-1"),
2178
- conditions: z3.array(z3.string()).optional().describe("Conditions for approval"),
2192
+ reasoning: z4.string().min(1).describe("Explanation for the vote"),
2193
+ confidence: z4.number().min(0).max(1).describe("Confidence level 0-1"),
2194
+ conditions: z4.array(z4.string()).optional().describe("Conditions for approval"),
2179
2195
  /** Structured rejection categories for reject→refine→re-vote loops (Issue #1213). */
2180
- rejectionCategories: z3.array(RejectionCategorySchema).optional().describe("Rejection reason categories when decision is reject"),
2196
+ rejectionCategories: z4.array(RejectionCategorySchema).optional().describe("Rejection reason categories when decision is reject"),
2181
2197
  /** Pre-verified PR-review findings (#2245 v4 follow-up). Optional;
2182
2198
  * populated only when the voter emits the structured top-level array. */
2183
- findings: z3.array(FindingShapeSchema).optional().describe("PR-review findings (pre-verified)"),
2199
+ findings: z4.array(FindingShapeSchema).optional().describe("PR-review findings (pre-verified)"),
2184
2200
  /** Which declared option this voter chose, when the proposal declared
2185
2201
  * `options` (#4472). Absent when the proposal declared none, or when the
2186
2202
  * voter's selection matched no declared option — an unmatched selection is
2187
2203
  * recorded as absent, never coerced onto a default. */
2188
- selectedOption: z3.string().optional().describe("Chosen option when the proposal declares options"),
2189
- timestamp: z3.iso.datetime().optional()
2204
+ selectedOption: z4.string().optional().describe("Chosen option when the proposal declares options"),
2205
+ timestamp: z4.iso.datetime().optional()
2190
2206
  });
2191
- var ProposalSchema = z3.object({
2192
- id: z3.string().optional().describe("Auto-generated if not provided"),
2193
- title: z3.string().min(1).max(200).describe("Short proposal title"),
2194
- description: z3.string().min(1).describe("Detailed proposal description"),
2207
+ var ProposalSchema = z4.object({
2208
+ id: z4.string().optional().describe("Auto-generated if not provided"),
2209
+ title: z4.string().min(1).max(200).describe("Short proposal title"),
2210
+ description: z4.string().min(1).describe("Detailed proposal description"),
2195
2211
  algorithm: ConsensusAlgorithmSchema,
2196
- timeout: z3.number().int().positive().optional().describe("Timeout in milliseconds"),
2197
- requiredVoters: z3.array(z3.string()).optional().describe("Agent IDs that must vote"),
2198
- metadata: z3.record(z3.string(), z3.unknown()).optional().describe("Additional context"),
2199
- createdAt: z3.iso.datetime().optional()
2212
+ timeout: z4.number().int().positive().optional().describe("Timeout in milliseconds"),
2213
+ requiredVoters: z4.array(z4.string()).optional().describe("Agent IDs that must vote"),
2214
+ metadata: z4.record(z4.string(), z4.unknown()).optional().describe("Additional context"),
2215
+ createdAt: z4.iso.datetime().optional()
2200
2216
  });
2201
- var ConsensusResultSchema = z3.object({
2202
- proposalId: z3.string(),
2217
+ var ConsensusResultSchema = z4.object({
2218
+ proposalId: z4.string(),
2203
2219
  proposal: ProposalSchema,
2204
2220
  outcome: ProposalStatusSchema,
2205
- votes: z3.map(z3.string(), VoteSchema),
2206
- voteCounts: z3.object({
2207
- approve: z3.number().int().nonnegative(),
2208
- reject: z3.number().int().nonnegative(),
2209
- abstain: z3.number().int().nonnegative(),
2210
- total: z3.number().int().nonnegative()
2221
+ votes: z4.map(z4.string(), VoteSchema),
2222
+ voteCounts: z4.object({
2223
+ approve: z4.number().int().nonnegative(),
2224
+ reject: z4.number().int().nonnegative(),
2225
+ abstain: z4.number().int().nonnegative(),
2226
+ total: z4.number().int().nonnegative()
2211
2227
  }),
2212
- weightedCounts: z3.object({
2213
- approve: z3.number().nonnegative(),
2214
- reject: z3.number().nonnegative(),
2215
- abstain: z3.number().nonnegative(),
2216
- totalWeight: z3.number().nonnegative()
2228
+ weightedCounts: z4.object({
2229
+ approve: z4.number().nonnegative(),
2230
+ reject: z4.number().nonnegative(),
2231
+ abstain: z4.number().nonnegative(),
2232
+ totalWeight: z4.number().nonnegative()
2217
2233
  }).optional(),
2218
- approvalPercentage: z3.number().min(0).max(100),
2219
- quorumReached: z3.boolean(),
2220
- startedAt: z3.iso.datetime(),
2221
- closedAt: z3.iso.datetime(),
2222
- durationMs: z3.number().int().nonnegative()
2234
+ approvalPercentage: z4.number().min(0).max(100),
2235
+ quorumReached: z4.boolean(),
2236
+ startedAt: z4.iso.datetime(),
2237
+ closedAt: z4.iso.datetime(),
2238
+ durationMs: z4.number().int().nonnegative()
2223
2239
  });
2224
- var AgentPerformanceSchema = z3.object({
2225
- agentId: z3.string(),
2226
- totalVotes: z3.number().int().nonnegative(),
2227
- correctVotes: z3.number().int().nonnegative(),
2228
- successRate: z3.number().min(0).max(1),
2229
- lastUpdated: z3.iso.datetime()
2240
+ var AgentPerformanceSchema = z4.object({
2241
+ agentId: z4.string(),
2242
+ totalVotes: z4.number().int().nonnegative(),
2243
+ correctVotes: z4.number().int().nonnegative(),
2244
+ successRate: z4.number().min(0).max(1),
2245
+ lastUpdated: z4.iso.datetime()
2230
2246
  });
2231
2247
  var DEFAULT_INCREMENTAL_QUORUM_CONFIG = {
2232
2248
  enabled: false,
@@ -2235,19 +2251,19 @@ var DEFAULT_INCREMENTAL_QUORUM_CONFIG = {
2235
2251
  confidenceThreshold: 0.6,
2236
2252
  ambiguityBand: 0.15
2237
2253
  };
2238
- var ProposalCacheConfigSchema = z3.object({
2239
- enabled: z3.boolean().default(false),
2240
- ttlMs: z3.number().int().positive().default(36e5),
2254
+ var ProposalCacheConfigSchema = z4.object({
2255
+ enabled: z4.boolean().default(false),
2256
+ ttlMs: z4.number().int().positive().default(36e5),
2241
2257
  // 1 hour
2242
- maxEntries: z3.number().int().positive().default(500)
2258
+ maxEntries: z4.number().int().positive().default(500)
2243
2259
  });
2244
- var ConsensusEngineConfigSchema = z3.object({
2245
- defaultTimeout: z3.number().int().positive().default(3e5),
2260
+ var ConsensusEngineConfigSchema = z4.object({
2261
+ defaultTimeout: z4.number().int().positive().default(3e5),
2246
2262
  // 5 minutes
2247
- minVotersForQuorum: z3.number().int().positive().default(DEFAULT_MIN_VOTERS_FOR_QUORUM),
2248
- maxActiveProposals: z3.number().int().positive().default(100),
2249
- enablePerformanceTracking: z3.boolean().default(true),
2250
- maxClosedProposals: z3.number().int().positive().default(1e3),
2263
+ minVotersForQuorum: z4.number().int().positive().default(DEFAULT_MIN_VOTERS_FOR_QUORUM),
2264
+ maxActiveProposals: z4.number().int().positive().default(100),
2265
+ enablePerformanceTracking: z4.boolean().default(true),
2266
+ maxClosedProposals: z4.number().int().positive().default(1e3),
2251
2267
  // Issue #549
2252
2268
  proposalCache: ProposalCacheConfigSchema.optional()
2253
2269
  // Issue #589
@@ -2262,14 +2278,14 @@ var DEFAULT_CONSENSUS_CONFIG = {
2262
2278
  maxClosedProposals: 1e3
2263
2279
  // Issue #549: Prevent unbounded memory growth
2264
2280
  };
2265
- var ConsensusMetricsSchema = z3.object({
2266
- totalProposals: z3.number().int().nonnegative(),
2267
- approvedProposals: z3.number().int().nonnegative(),
2268
- rejectedProposals: z3.number().int().nonnegative(),
2269
- timedOutProposals: z3.number().int().nonnegative(),
2270
- averageDurationMs: z3.number().nonnegative(),
2271
- averageVotesPerProposal: z3.number().nonnegative(),
2272
- algorithmUsage: z3.record(ConsensusAlgorithmSchema, z3.number().int().nonnegative())
2281
+ var ConsensusMetricsSchema = z4.object({
2282
+ totalProposals: z4.number().int().nonnegative(),
2283
+ approvedProposals: z4.number().int().nonnegative(),
2284
+ rejectedProposals: z4.number().int().nonnegative(),
2285
+ timedOutProposals: z4.number().int().nonnegative(),
2286
+ averageDurationMs: z4.number().nonnegative(),
2287
+ averageVotesPerProposal: z4.number().nonnegative(),
2288
+ algorithmUsage: z4.record(ConsensusAlgorithmSchema, z4.number().int().nonnegative())
2273
2289
  });
2274
2290
 
2275
2291
  export {
@@ -2295,9 +2311,11 @@ export {
2295
2311
  defaultRetryable,
2296
2312
  coarsenFailureCategory,
2297
2313
  toolSuccess,
2314
+ structuredToolSuccess,
2298
2315
  toolSuccessStructured,
2299
2316
  toolStructuredError,
2300
2317
  toolError,
2318
+ registerStructuredTool,
2301
2319
  sanitizeToolInput,
2302
2320
  setGlobalPolicyFirewall,
2303
2321
  getGlobalExecutionMode,
@@ -2335,4 +2353,4 @@ export {
2335
2353
  DEFAULT_CONSENSUS_CONFIG,
2336
2354
  ConsensusMetricsSchema
2337
2355
  };
2338
- //# sourceMappingURL=chunk-QGXA3QXW.js.map
2356
+ //# sourceMappingURL=chunk-CGKENW3F.js.map