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.
- package/dist/{chunk-NEB2FSBW.js → chunk-5XMXBSPY.js} +3 -3
- package/dist/{chunk-2B55IL7S.js → chunk-AAE7F4CB.js} +7 -4
- package/dist/chunk-AAE7F4CB.js.map +1 -0
- package/dist/{chunk-QGXA3QXW.js → chunk-CGKENW3F.js} +93 -75
- package/dist/chunk-CGKENW3F.js.map +1 -0
- package/dist/{chunk-DFAT7RB7.js → chunk-FB4ZIOYS.js} +11 -12
- package/dist/chunk-FB4ZIOYS.js.map +1 -0
- package/dist/{chunk-ETJY6TMK.js → chunk-RWWPMTJK.js} +2 -2
- package/dist/{chunk-45AUQYWF.js → chunk-UETCXCAS.js} +193 -144
- package/dist/{chunk-45AUQYWF.js.map → chunk-UETCXCAS.js.map} +1 -1
- package/dist/cli.js +7 -7
- package/dist/cli.js.map +1 -1
- package/dist/{consensus-vote-K4SNLVKO.js → consensus-vote-6ISHSQ73.js} +4 -4
- package/dist/{improvement-review-UYDDYXIB.js → improvement-review-S65JP2NY.js} +4 -4
- package/dist/index.d.ts +3 -26
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-IYJGONN3.js → setup-data-dir-EVVWRHY2.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-2B55IL7S.js.map +0 -1
- package/dist/chunk-DFAT7RB7.js.map +0 -1
- package/dist/chunk-QGXA3QXW.js.map +0 -1
- /package/dist/{chunk-NEB2FSBW.js.map → chunk-5XMXBSPY.js.map} +0 -0
- /package/dist/{chunk-ETJY6TMK.js.map → chunk-RWWPMTJK.js.map} +0 -0
- /package/dist/{consensus-vote-K4SNLVKO.js.map → consensus-vote-6ISHSQ73.js.map} +0 -0
- /package/dist/{improvement-review-UYDDYXIB.js.map → improvement-review-S65JP2NY.js.map} +0 -0
- /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-
|
|
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
|
|
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 =
|
|
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 =
|
|
2144
|
-
var ProposalStatusSchema =
|
|
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 =
|
|
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 =
|
|
2163
|
-
summary:
|
|
2164
|
-
location:
|
|
2165
|
-
severity:
|
|
2166
|
-
gate:
|
|
2167
|
-
reread_cited_line:
|
|
2168
|
-
traced_call_path:
|
|
2169
|
-
named_assertion:
|
|
2170
|
-
ruled_out_language_non_issue:
|
|
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:
|
|
2188
|
+
claim: z4.string().min(1).max(2e3)
|
|
2173
2189
|
});
|
|
2174
|
-
var VoteSchema =
|
|
2190
|
+
var VoteSchema = z4.object({
|
|
2175
2191
|
decision: VoteDecisionSchema,
|
|
2176
|
-
reasoning:
|
|
2177
|
-
confidence:
|
|
2178
|
-
conditions:
|
|
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:
|
|
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:
|
|
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:
|
|
2189
|
-
timestamp:
|
|
2204
|
+
selectedOption: z4.string().optional().describe("Chosen option when the proposal declares options"),
|
|
2205
|
+
timestamp: z4.iso.datetime().optional()
|
|
2190
2206
|
});
|
|
2191
|
-
var ProposalSchema =
|
|
2192
|
-
id:
|
|
2193
|
-
title:
|
|
2194
|
-
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:
|
|
2197
|
-
requiredVoters:
|
|
2198
|
-
metadata:
|
|
2199
|
-
createdAt:
|
|
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 =
|
|
2202
|
-
proposalId:
|
|
2217
|
+
var ConsensusResultSchema = z4.object({
|
|
2218
|
+
proposalId: z4.string(),
|
|
2203
2219
|
proposal: ProposalSchema,
|
|
2204
2220
|
outcome: ProposalStatusSchema,
|
|
2205
|
-
votes:
|
|
2206
|
-
voteCounts:
|
|
2207
|
-
approve:
|
|
2208
|
-
reject:
|
|
2209
|
-
abstain:
|
|
2210
|
-
total:
|
|
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:
|
|
2213
|
-
approve:
|
|
2214
|
-
reject:
|
|
2215
|
-
abstain:
|
|
2216
|
-
totalWeight:
|
|
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:
|
|
2219
|
-
quorumReached:
|
|
2220
|
-
startedAt:
|
|
2221
|
-
closedAt:
|
|
2222
|
-
durationMs:
|
|
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 =
|
|
2225
|
-
agentId:
|
|
2226
|
-
totalVotes:
|
|
2227
|
-
correctVotes:
|
|
2228
|
-
successRate:
|
|
2229
|
-
lastUpdated:
|
|
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 =
|
|
2239
|
-
enabled:
|
|
2240
|
-
ttlMs:
|
|
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:
|
|
2258
|
+
maxEntries: z4.number().int().positive().default(500)
|
|
2243
2259
|
});
|
|
2244
|
-
var ConsensusEngineConfigSchema =
|
|
2245
|
-
defaultTimeout:
|
|
2260
|
+
var ConsensusEngineConfigSchema = z4.object({
|
|
2261
|
+
defaultTimeout: z4.number().int().positive().default(3e5),
|
|
2246
2262
|
// 5 minutes
|
|
2247
|
-
minVotersForQuorum:
|
|
2248
|
-
maxActiveProposals:
|
|
2249
|
-
enablePerformanceTracking:
|
|
2250
|
-
maxClosedProposals:
|
|
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 =
|
|
2266
|
-
totalProposals:
|
|
2267
|
-
approvedProposals:
|
|
2268
|
-
rejectedProposals:
|
|
2269
|
-
timedOutProposals:
|
|
2270
|
-
averageDurationMs:
|
|
2271
|
-
averageVotesPerProposal:
|
|
2272
|
-
algorithmUsage:
|
|
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-
|
|
2356
|
+
//# sourceMappingURL=chunk-CGKENW3F.js.map
|