nexus-agents 6.3.3 → 6.3.5
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/{child-mcp-config-6UXFBHW5.js → child-mcp-config-HGD32ADZ.js} +2 -2
- package/dist/{chunk-DZQWHHGI.js → chunk-3FPHHCY5.js} +4 -4
- package/dist/{chunk-UONHQ3Q3.js → chunk-5FHJAPIR.js} +2 -2
- package/dist/{chunk-CZWJAVFX.js → chunk-6B7IGVVI.js} +3 -3
- package/dist/chunk-7JBGVOO7.js +7 -0
- package/dist/{chunk-2TP7YLBC.js → chunk-BE6FQ7XI.js} +2 -2
- package/dist/{chunk-XJ76EMQV.js → chunk-CLIZCXWB.js} +5 -5
- package/dist/{chunk-MFORQ7FO.js → chunk-E6LGFJQE.js} +2 -2
- package/dist/{chunk-IFAISNVZ.js → chunk-ECHZGAZO.js} +2 -2
- package/dist/{chunk-47TTP5PC.js → chunk-FQQYGPMC.js} +2 -2
- package/dist/{chunk-5LREI4NO.js → chunk-GRLN6WL5.js} +3 -3
- package/dist/{chunk-LX4DUS4M.js → chunk-ITB2NBB7.js} +6 -6
- package/dist/{chunk-C7ZOYMT2.js → chunk-JLA2YAGY.js} +5 -5
- package/dist/{chunk-T7NTJNCG.js → chunk-JLE24ZSP.js} +2 -2
- package/dist/{chunk-XWKL7QDH.js → chunk-KNBIEADY.js} +2 -2
- package/dist/{chunk-GGRKSSAC.js → chunk-KXQYRZ3X.js} +558 -468
- package/dist/{chunk-GGRKSSAC.js.map → chunk-KXQYRZ3X.js.map} +1 -1
- package/dist/{chunk-QOF5S5Z5.js → chunk-KYHZYRMR.js} +2 -2
- package/dist/{chunk-5F36KKHM.js → chunk-LB4UH4FF.js} +25 -4
- package/dist/chunk-LB4UH4FF.js.map +1 -0
- package/dist/{chunk-ZT6RBA7L.js → chunk-LMIR62SG.js} +2 -2
- package/dist/{chunk-QEZ5CS5H.js → chunk-LPBGCX6H.js} +2 -2
- package/dist/{chunk-JYTDEFY6.js → chunk-NQ2CC67G.js} +2 -2
- package/dist/{chunk-ZCNB6YJ3.js → chunk-NXHPOKIO.js} +4 -4
- package/dist/{chunk-LH3XZRMY.js → chunk-PPCIJBHY.js} +7 -7
- package/dist/{chunk-M2TFLYPC.js → chunk-Q3DEXAOB.js} +7 -7
- package/dist/{chunk-7LGTPUZB.js → chunk-QBBQA57Z.js} +4 -4
- package/dist/{chunk-LM5ZSWYB.js → chunk-QZJR42BR.js} +4 -4
- package/dist/{chunk-5YZF5DUW.js → chunk-R6YU33TY.js} +8 -8
- package/dist/{chunk-YQGLXYMT.js → chunk-SADUKKC7.js} +8 -8
- package/dist/{chunk-VE6ZMLCT.js → chunk-SPRQFHVR.js} +2 -2
- package/dist/{chunk-W3VI2AAJ.js → chunk-TOQVL64J.js} +3 -3
- package/dist/{chunk-KFKI2M4X.js → chunk-UCW7IIX6.js} +2 -2
- package/dist/{chunk-YZDCUGPS.js → chunk-Y5ATK7BS.js} +2 -2
- package/dist/{chunk-EPIRYAU3.js → chunk-Z2EUE6E6.js} +2 -2
- package/dist/{chunk-64LODBD3.js → chunk-ZNPUVXMB.js} +2 -2
- package/dist/{cli-circuit-breaker-U2CTVGQ7.js → cli-circuit-breaker-NPISC6Q4.js} +3 -3
- package/dist/cli.js +41 -41
- package/dist/{composite-router-GQOZMVH7.js → composite-router-ULU3C7ZA.js} +2 -2
- package/dist/{consensus-vote-HH74S3A4.js → consensus-vote-XICKVHZF.js} +17 -17
- package/dist/{context-retriever-FHHESJMM.js → context-retriever-UDMXESPP.js} +8 -8
- package/dist/{doctor-deep-Y65MN57O.js → doctor-deep-E2UHOIOS.js} +3 -3
- package/dist/{doctor-live-SWFNSL5Y.js → doctor-live-52MCZLBK.js} +9 -9
- package/dist/{expert-bridge-Y75TQIEO.js → expert-bridge-KMJQGVUM.js} +4 -4
- package/dist/{factory-7BW4S6PR.js → factory-LCKPBDL2.js} +5 -5
- package/dist/{factory-EBM7Z7MP.js → factory-RPWJNOET.js} +9 -9
- package/dist/{improvement-review-3ITUHAUA.js → improvement-review-WVYRTOQI.js} +6 -6
- package/dist/index.js +31 -31
- package/dist/{init-opencode-QHVNX5YH.js → init-opencode-AFES5ZQD.js} +6 -6
- package/dist/issue-triage-VVEGWHXP.js +17 -0
- package/dist/{pr-reviewer-helpers-245UWBYB.js → pr-reviewer-helpers-EJIWNM3Z.js} +4 -4
- package/dist/{registry-command-TPLFFKVI.js → registry-command-45SBK736.js} +2 -2
- package/dist/{repo-security-plan-C4JE7ZKQ.js → repo-security-plan-Z25BUZGY.js} +3 -3
- package/dist/{research-helpers-synthesize-ZZRDEX7R.js → research-helpers-synthesize-ILCLFNSL.js} +4 -4
- package/dist/{routing-memory-MLMNEIZD.js → routing-memory-SE3MTQSU.js} +2 -2
- package/dist/{session-memory-43TLUGSP.js → session-memory-JOJ5SHVX.js} +3 -3
- package/dist/{setup-config-LZWSAEL7.js → setup-config-IVLUCSF2.js} +3 -3
- package/dist/{setup-custom-api-UIIB2OYQ.js → setup-custom-api-G24JS2HB.js} +4 -4
- package/dist/setup-data-dir-IULEPUZC.js +29 -0
- package/dist/{tool-memory-6HM6HC2C.js → tool-memory-O4XK27UO.js} +5 -5
- package/dist/{unified-registry-YYHYITVO.js → unified-registry-DPOXBGFQ.js} +10 -10
- package/dist/{weather-report-WCWQRH3K.js → weather-report-5SMT3RHJ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-3FIUZBQC.js +0 -7
- package/dist/chunk-5F36KKHM.js.map +0 -1
- package/dist/issue-triage-HQQ2TR4C.js +0 -17
- package/dist/setup-data-dir-FNGGTBPG.js +0 -29
- /package/dist/{child-mcp-config-6UXFBHW5.js.map → child-mcp-config-HGD32ADZ.js.map} +0 -0
- /package/dist/{chunk-DZQWHHGI.js.map → chunk-3FPHHCY5.js.map} +0 -0
- /package/dist/{chunk-UONHQ3Q3.js.map → chunk-5FHJAPIR.js.map} +0 -0
- /package/dist/{chunk-CZWJAVFX.js.map → chunk-6B7IGVVI.js.map} +0 -0
- /package/dist/{chunk-3FIUZBQC.js.map → chunk-7JBGVOO7.js.map} +0 -0
- /package/dist/{chunk-2TP7YLBC.js.map → chunk-BE6FQ7XI.js.map} +0 -0
- /package/dist/{chunk-XJ76EMQV.js.map → chunk-CLIZCXWB.js.map} +0 -0
- /package/dist/{chunk-MFORQ7FO.js.map → chunk-E6LGFJQE.js.map} +0 -0
- /package/dist/{chunk-IFAISNVZ.js.map → chunk-ECHZGAZO.js.map} +0 -0
- /package/dist/{chunk-47TTP5PC.js.map → chunk-FQQYGPMC.js.map} +0 -0
- /package/dist/{chunk-5LREI4NO.js.map → chunk-GRLN6WL5.js.map} +0 -0
- /package/dist/{chunk-LX4DUS4M.js.map → chunk-ITB2NBB7.js.map} +0 -0
- /package/dist/{chunk-C7ZOYMT2.js.map → chunk-JLA2YAGY.js.map} +0 -0
- /package/dist/{chunk-T7NTJNCG.js.map → chunk-JLE24ZSP.js.map} +0 -0
- /package/dist/{chunk-XWKL7QDH.js.map → chunk-KNBIEADY.js.map} +0 -0
- /package/dist/{chunk-QOF5S5Z5.js.map → chunk-KYHZYRMR.js.map} +0 -0
- /package/dist/{chunk-ZT6RBA7L.js.map → chunk-LMIR62SG.js.map} +0 -0
- /package/dist/{chunk-QEZ5CS5H.js.map → chunk-LPBGCX6H.js.map} +0 -0
- /package/dist/{chunk-JYTDEFY6.js.map → chunk-NQ2CC67G.js.map} +0 -0
- /package/dist/{chunk-ZCNB6YJ3.js.map → chunk-NXHPOKIO.js.map} +0 -0
- /package/dist/{chunk-LH3XZRMY.js.map → chunk-PPCIJBHY.js.map} +0 -0
- /package/dist/{chunk-M2TFLYPC.js.map → chunk-Q3DEXAOB.js.map} +0 -0
- /package/dist/{chunk-7LGTPUZB.js.map → chunk-QBBQA57Z.js.map} +0 -0
- /package/dist/{chunk-LM5ZSWYB.js.map → chunk-QZJR42BR.js.map} +0 -0
- /package/dist/{chunk-5YZF5DUW.js.map → chunk-R6YU33TY.js.map} +0 -0
- /package/dist/{chunk-YQGLXYMT.js.map → chunk-SADUKKC7.js.map} +0 -0
- /package/dist/{chunk-VE6ZMLCT.js.map → chunk-SPRQFHVR.js.map} +0 -0
- /package/dist/{chunk-W3VI2AAJ.js.map → chunk-TOQVL64J.js.map} +0 -0
- /package/dist/{chunk-KFKI2M4X.js.map → chunk-UCW7IIX6.js.map} +0 -0
- /package/dist/{chunk-YZDCUGPS.js.map → chunk-Y5ATK7BS.js.map} +0 -0
- /package/dist/{chunk-EPIRYAU3.js.map → chunk-Z2EUE6E6.js.map} +0 -0
- /package/dist/{chunk-64LODBD3.js.map → chunk-ZNPUVXMB.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-U2CTVGQ7.js.map → cli-circuit-breaker-NPISC6Q4.js.map} +0 -0
- /package/dist/{composite-router-GQOZMVH7.js.map → composite-router-ULU3C7ZA.js.map} +0 -0
- /package/dist/{consensus-vote-HH74S3A4.js.map → consensus-vote-XICKVHZF.js.map} +0 -0
- /package/dist/{context-retriever-FHHESJMM.js.map → context-retriever-UDMXESPP.js.map} +0 -0
- /package/dist/{doctor-deep-Y65MN57O.js.map → doctor-deep-E2UHOIOS.js.map} +0 -0
- /package/dist/{doctor-live-SWFNSL5Y.js.map → doctor-live-52MCZLBK.js.map} +0 -0
- /package/dist/{expert-bridge-Y75TQIEO.js.map → expert-bridge-KMJQGVUM.js.map} +0 -0
- /package/dist/{factory-7BW4S6PR.js.map → factory-LCKPBDL2.js.map} +0 -0
- /package/dist/{factory-EBM7Z7MP.js.map → factory-RPWJNOET.js.map} +0 -0
- /package/dist/{improvement-review-3ITUHAUA.js.map → improvement-review-WVYRTOQI.js.map} +0 -0
- /package/dist/{init-opencode-QHVNX5YH.js.map → init-opencode-AFES5ZQD.js.map} +0 -0
- /package/dist/{issue-triage-HQQ2TR4C.js.map → issue-triage-VVEGWHXP.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-245UWBYB.js.map → pr-reviewer-helpers-EJIWNM3Z.js.map} +0 -0
- /package/dist/{registry-command-TPLFFKVI.js.map → registry-command-45SBK736.js.map} +0 -0
- /package/dist/{repo-security-plan-C4JE7ZKQ.js.map → repo-security-plan-Z25BUZGY.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-ZZRDEX7R.js.map → research-helpers-synthesize-ILCLFNSL.js.map} +0 -0
- /package/dist/{routing-memory-MLMNEIZD.js.map → routing-memory-SE3MTQSU.js.map} +0 -0
- /package/dist/{session-memory-43TLUGSP.js.map → session-memory-JOJ5SHVX.js.map} +0 -0
- /package/dist/{setup-config-LZWSAEL7.js.map → setup-config-IVLUCSF2.js.map} +0 -0
- /package/dist/{setup-custom-api-UIIB2OYQ.js.map → setup-custom-api-G24JS2HB.js.map} +0 -0
- /package/dist/{setup-data-dir-FNGGTBPG.js.map → setup-data-dir-IULEPUZC.js.map} +0 -0
- /package/dist/{tool-memory-6HM6HC2C.js.map → tool-memory-O4XK27UO.js.map} +0 -0
- /package/dist/{unified-registry-YYHYITVO.js.map → unified-registry-DPOXBGFQ.js.map} +0 -0
- /package/dist/{weather-report-WCWQRH3K.js.map → weather-report-5SMT3RHJ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FQQYGPMC.js";
|
|
4
4
|
import {
|
|
5
5
|
analyzeGitHubRepo
|
|
6
6
|
} from "./chunk-HFOQKCD2.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
clampTaskTtl
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PPCIJBHY.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Q3DEXAOB.js";
|
|
28
28
|
import {
|
|
29
29
|
JobStatusSchema,
|
|
30
30
|
VOTER_ROLES,
|
|
@@ -47,24 +47,24 @@ import {
|
|
|
47
47
|
simulationDeniedResult,
|
|
48
48
|
toJobSummary,
|
|
49
49
|
writeJobCancelled
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-SADUKKC7.js";
|
|
51
51
|
import {
|
|
52
52
|
allOf
|
|
53
53
|
} from "./chunk-OQB3XC5O.js";
|
|
54
54
|
import {
|
|
55
55
|
normalizeTopicToCanonical,
|
|
56
56
|
synthesizeResearch
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-GRLN6WL5.js";
|
|
58
58
|
import {
|
|
59
59
|
IssueTriage
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ITB2NBB7.js";
|
|
61
61
|
import {
|
|
62
62
|
resolveEnvMode,
|
|
63
63
|
sanitizeInput
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-NQ2CC67G.js";
|
|
65
65
|
import {
|
|
66
66
|
withPrerequisite
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-6B7IGVVI.js";
|
|
68
68
|
import {
|
|
69
69
|
NOOP_NOTIFIER,
|
|
70
70
|
RateLimiter,
|
|
@@ -88,18 +88,18 @@ import {
|
|
|
88
88
|
withAuditTrail,
|
|
89
89
|
withProgressHeartbeat,
|
|
90
90
|
wrapToolWithTimeout
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-QBBQA57Z.js";
|
|
92
92
|
import {
|
|
93
93
|
createAuditTrail,
|
|
94
94
|
createGraphAuditBridge,
|
|
95
95
|
emitPipelinePolicyEvent
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-KYHZYRMR.js";
|
|
97
97
|
import {
|
|
98
98
|
EventTopics,
|
|
99
99
|
createEvent,
|
|
100
100
|
getGlobalEventBus,
|
|
101
101
|
getGlobalRegistry
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-3FPHHCY5.js";
|
|
103
103
|
import {
|
|
104
104
|
IDENTIFIER_RE,
|
|
105
105
|
LANG_VALUES,
|
|
@@ -132,29 +132,29 @@ import {
|
|
|
132
132
|
parseRegistry,
|
|
133
133
|
sourceExistsInRegistry,
|
|
134
134
|
summarizeContextForPrompt
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-CLIZCXWB.js";
|
|
136
136
|
import {
|
|
137
137
|
loadPapersRegistry,
|
|
138
138
|
loadTechniquesRegistry,
|
|
139
139
|
resolveInsideRoot
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-BE6FQ7XI.js";
|
|
141
141
|
import {
|
|
142
142
|
getTokenEnvVars,
|
|
143
143
|
resolveToken
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-Y5ATK7BS.js";
|
|
145
145
|
import {
|
|
146
146
|
DEFAULT_RELEVANCE_CONFIG,
|
|
147
147
|
MemoryImportance,
|
|
148
148
|
calculateTextJaccardSimilarity,
|
|
149
149
|
getToolMemory
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-NXHPOKIO.js";
|
|
151
151
|
import {
|
|
152
152
|
STOPWORDS,
|
|
153
153
|
truncateWithInfo
|
|
154
154
|
} from "./chunk-6T3EPABN.js";
|
|
155
155
|
import {
|
|
156
156
|
createSessionMemory
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-E6LGFJQE.js";
|
|
158
158
|
import {
|
|
159
159
|
BUILT_IN_EXPERTS,
|
|
160
160
|
BuiltInExpertTypeSchema,
|
|
@@ -172,25 +172,25 @@ import {
|
|
|
172
172
|
getAvailableClis,
|
|
173
173
|
sleep,
|
|
174
174
|
withTimeout
|
|
175
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-R6YU33TY.js";
|
|
176
176
|
import {
|
|
177
177
|
BaseAdapter,
|
|
178
178
|
createStream,
|
|
179
179
|
requireApiKey,
|
|
180
180
|
validateApiKeyPresence
|
|
181
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-5FHJAPIR.js";
|
|
182
182
|
import {
|
|
183
183
|
DEFAULTS
|
|
184
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-LPBGCX6H.js";
|
|
185
185
|
import {
|
|
186
186
|
getAvailabilityCache,
|
|
187
187
|
getCliForModelId,
|
|
188
188
|
resolveFallback
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-KNBIEADY.js";
|
|
190
190
|
import {
|
|
191
191
|
generateHyphenId,
|
|
192
192
|
generateUUID
|
|
193
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-JLE24ZSP.js";
|
|
194
194
|
import {
|
|
195
195
|
AGENT_ROUTER_TIMEOUTS,
|
|
196
196
|
API_TIMEOUTS,
|
|
@@ -296,7 +296,7 @@ import {
|
|
|
296
296
|
selectStrategyByManifest,
|
|
297
297
|
toExpertTaskAnalysisResult,
|
|
298
298
|
withStep
|
|
299
|
-
} from "./chunk-
|
|
299
|
+
} from "./chunk-LB4UH4FF.js";
|
|
300
300
|
import {
|
|
301
301
|
ensureLearningDir,
|
|
302
302
|
getMetaOutcomesFile,
|
|
@@ -27003,10 +27003,10 @@ function calculateZStatistic(params) {
|
|
|
27003
27003
|
function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
|
|
27004
27004
|
const difference = p1 - p2;
|
|
27005
27005
|
const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
|
|
27006
|
-
const
|
|
27006
|
+
const z127 = getZScore(confidence);
|
|
27007
27007
|
return {
|
|
27008
|
-
lower: difference -
|
|
27009
|
-
upper: difference +
|
|
27008
|
+
lower: difference - z127 * seDiff,
|
|
27009
|
+
upper: difference + z127 * seDiff,
|
|
27010
27010
|
estimate: difference,
|
|
27011
27011
|
confidence,
|
|
27012
27012
|
n: total1 + total2,
|
|
@@ -27029,11 +27029,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
|
|
|
27029
27029
|
standardError: 0
|
|
27030
27030
|
};
|
|
27031
27031
|
}
|
|
27032
|
-
const
|
|
27033
|
-
const z210 =
|
|
27032
|
+
const z127 = getZScore(opts.confidence);
|
|
27033
|
+
const z210 = z127 * z127;
|
|
27034
27034
|
const denominator = 1 + z210 / n;
|
|
27035
27035
|
const center = (p + z210 / (2 * n)) / denominator;
|
|
27036
|
-
const margin =
|
|
27036
|
+
const margin = z127 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
27037
27037
|
const lower = Math.max(0, center - margin);
|
|
27038
27038
|
const upper = Math.min(1, center + margin);
|
|
27039
27039
|
const standardError = Math.sqrt(p * (1 - p) / n);
|
|
@@ -27063,8 +27063,8 @@ function meanConfidenceInterval(values, options = {}) {
|
|
|
27063
27063
|
const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
|
|
27064
27064
|
const stdDev = Math.sqrt(variance);
|
|
27065
27065
|
const standardError = stdDev / Math.sqrt(n);
|
|
27066
|
-
const
|
|
27067
|
-
const margin =
|
|
27066
|
+
const z127 = getZScore(opts.confidence);
|
|
27067
|
+
const margin = z127 * standardError;
|
|
27068
27068
|
return {
|
|
27069
27069
|
lower: mean - margin,
|
|
27070
27070
|
upper: mean + margin,
|
|
@@ -29692,7 +29692,7 @@ function execIdFields(executionId) {
|
|
|
29692
29692
|
async function populateUnifiedContextOnState(state, options) {
|
|
29693
29693
|
const taskCandidate = state["task"];
|
|
29694
29694
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
29695
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
29695
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-UDMXESPP.js");
|
|
29696
29696
|
const category = inferTaskCategory2(taskCandidate);
|
|
29697
29697
|
const executionId = options?.executionId;
|
|
29698
29698
|
const execFields = execIdFields(executionId);
|
|
@@ -45529,7 +45529,7 @@ async function tryIssueTriage(task) {
|
|
|
45529
45529
|
try {
|
|
45530
45530
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
45531
45531
|
if (issueMatch === null) return null;
|
|
45532
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
45532
|
+
const { createIssueTriage } = await import("./issue-triage-VVEGWHXP.js");
|
|
45533
45533
|
const triage = createIssueTriage();
|
|
45534
45534
|
const owner = issueMatch[1] ?? "";
|
|
45535
45535
|
const num = issueMatch[2] ?? "";
|
|
@@ -45557,7 +45557,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
45557
45557
|
]);
|
|
45558
45558
|
async function classifyWithLLM(task) {
|
|
45559
45559
|
try {
|
|
45560
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
45560
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-KMJQGVUM.js");
|
|
45561
45561
|
const prompt = [
|
|
45562
45562
|
"Classify this task into exactly one pipeline template.",
|
|
45563
45563
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -46407,31 +46407,94 @@ Verdict: PASS/NEEDS_WORK/REJECT`;
|
|
|
46407
46407
|
}
|
|
46408
46408
|
|
|
46409
46409
|
// src/security/sarif-parser.ts
|
|
46410
|
-
|
|
46410
|
+
import { z as z99 } from "zod";
|
|
46411
|
+
var SarifLocationSchema = z99.object({
|
|
46412
|
+
physicalLocation: z99.object({
|
|
46413
|
+
artifactLocation: z99.object({ uri: z99.string().min(1).optional() }).optional(),
|
|
46414
|
+
region: z99.object({
|
|
46415
|
+
startLine: z99.number().int().min(1).optional(),
|
|
46416
|
+
endLine: z99.number().int().min(1).optional(),
|
|
46417
|
+
snippet: z99.object({ text: z99.string().optional() }).optional()
|
|
46418
|
+
}).optional()
|
|
46419
|
+
}).optional()
|
|
46420
|
+
});
|
|
46421
|
+
var SarifResultSchema = z99.object({
|
|
46422
|
+
ruleId: z99.string().nullish(),
|
|
46423
|
+
level: z99.string().nullish(),
|
|
46424
|
+
message: z99.object({ text: z99.string().optional() }).nullish(),
|
|
46425
|
+
locations: z99.array(SarifLocationSchema).nullish()
|
|
46426
|
+
});
|
|
46427
|
+
var SarifRuleSchema = z99.object({
|
|
46428
|
+
id: z99.string(),
|
|
46429
|
+
shortDescription: z99.object({ text: z99.string().optional() }).optional(),
|
|
46430
|
+
defaultConfiguration: z99.object({ level: z99.string().optional() }).optional(),
|
|
46431
|
+
properties: z99.object({
|
|
46432
|
+
precision: z99.string().optional(),
|
|
46433
|
+
tags: z99.array(z99.string()).optional(),
|
|
46434
|
+
"security-severity": z99.string().optional()
|
|
46435
|
+
}).optional(),
|
|
46436
|
+
helpUri: z99.string().optional(),
|
|
46437
|
+
help: z99.object({ markdown: z99.string().optional() }).optional()
|
|
46438
|
+
});
|
|
46439
|
+
var SarifRunSchema = z99.object({
|
|
46440
|
+
tool: z99.object({
|
|
46441
|
+
driver: z99.object({
|
|
46442
|
+
name: z99.string().optional(),
|
|
46443
|
+
rules: z99.array(z99.unknown()).optional()
|
|
46444
|
+
}).optional()
|
|
46445
|
+
}).optional(),
|
|
46446
|
+
results: z99.array(z99.unknown()).nullish()
|
|
46447
|
+
});
|
|
46448
|
+
var SarifLogSchema = z99.object({
|
|
46449
|
+
version: z99.string().optional(),
|
|
46450
|
+
runs: z99.array(z99.unknown()).optional()
|
|
46451
|
+
});
|
|
46452
|
+
var UNMAPPED_LEVEL_SEVERITY = "high";
|
|
46453
|
+
var MAX_MESSAGE_LENGTH = 2e3;
|
|
46454
|
+
function parseEnvelope(json) {
|
|
46455
|
+
let raw;
|
|
46411
46456
|
try {
|
|
46412
|
-
|
|
46457
|
+
raw = JSON.parse(json);
|
|
46413
46458
|
} catch {
|
|
46414
|
-
return
|
|
46459
|
+
return { ok: false, error: "Invalid JSON" };
|
|
46460
|
+
}
|
|
46461
|
+
const parsed = SarifLogSchema.safeParse(raw);
|
|
46462
|
+
if (!parsed.success) {
|
|
46463
|
+
return { ok: false, error: `Malformed SARIF log: ${describeZodError(parsed.error)}` };
|
|
46415
46464
|
}
|
|
46465
|
+
return { ok: true, log: parsed.data };
|
|
46466
|
+
}
|
|
46467
|
+
function describeZodError(error) {
|
|
46468
|
+
return error.issues.slice(0, 3).map((issue) => {
|
|
46469
|
+
const path12 = issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
46470
|
+
return `${path12}: ${issue.message}`;
|
|
46471
|
+
}).join("; ");
|
|
46416
46472
|
}
|
|
46417
46473
|
function parseSarif(sarifJson, maxFindings = 100) {
|
|
46418
46474
|
const errors = [];
|
|
46419
|
-
const
|
|
46420
|
-
if (
|
|
46421
|
-
return { scanner: "unknown", totalFindings: 0, findings: [], errors: [
|
|
46475
|
+
const envelope = parseEnvelope(sarifJson);
|
|
46476
|
+
if (!envelope.ok) {
|
|
46477
|
+
return { scanner: "unknown", totalFindings: 0, findings: [], errors: [envelope.error] };
|
|
46422
46478
|
}
|
|
46423
|
-
return parseLog(log, maxFindings, errors);
|
|
46479
|
+
return parseLog(envelope.log, maxFindings, errors);
|
|
46480
|
+
}
|
|
46481
|
+
function describeDriver(run) {
|
|
46482
|
+
const driver = run.tool?.driver;
|
|
46483
|
+
return { scanner: driver?.name ?? "unknown", rules: driver?.rules ?? [] };
|
|
46484
|
+
}
|
|
46485
|
+
function emptyResult(error) {
|
|
46486
|
+
return { scanner: "unknown", totalFindings: 0, findings: [], errors: [error] };
|
|
46424
46487
|
}
|
|
46425
46488
|
function parseLog(log, maxFindings, errors) {
|
|
46426
46489
|
const runs = log.runs;
|
|
46427
|
-
if (runs === void 0 || runs.length === 0)
|
|
46428
|
-
|
|
46490
|
+
if (runs === void 0 || runs.length === 0) return emptyResult("No runs in SARIF");
|
|
46491
|
+
const parsedRun = SarifRunSchema.safeParse(runs[0]);
|
|
46492
|
+
if (!parsedRun.success) {
|
|
46493
|
+
return emptyResult(`Malformed SARIF run: ${describeZodError(parsedRun.error)}`);
|
|
46429
46494
|
}
|
|
46430
|
-
const
|
|
46431
|
-
const
|
|
46432
|
-
const
|
|
46433
|
-
const results = run.results ?? [];
|
|
46434
|
-
const findings = collectFindings(results, scanner, ruleMap, errors);
|
|
46495
|
+
const { scanner, rules } = describeDriver(parsedRun.data);
|
|
46496
|
+
const ruleMap = buildRuleMap(rules, errors);
|
|
46497
|
+
const findings = collectFindings(parsedRun.data.results ?? [], scanner, ruleMap, errors);
|
|
46435
46498
|
return {
|
|
46436
46499
|
scanner,
|
|
46437
46500
|
totalFindings: findings.length,
|
|
@@ -46441,17 +46504,27 @@ function parseLog(log, maxFindings, errors) {
|
|
|
46441
46504
|
}
|
|
46442
46505
|
function collectFindings(results, scanner, ruleMap, errors) {
|
|
46443
46506
|
const findings = [];
|
|
46444
|
-
for (const
|
|
46445
|
-
const
|
|
46507
|
+
for (const [index, raw] of results.entries()) {
|
|
46508
|
+
const parsed = SarifResultSchema.safeParse(raw);
|
|
46509
|
+
if (!parsed.success) {
|
|
46510
|
+
errors.push(`Skipped result ${String(index)}: ${describeZodError(parsed.error)}`);
|
|
46511
|
+
continue;
|
|
46512
|
+
}
|
|
46513
|
+
const finding = parseResult(parsed.data, scanner, ruleMap, errors);
|
|
46446
46514
|
if (finding !== null) findings.push(finding);
|
|
46447
46515
|
}
|
|
46448
46516
|
findings.sort((a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]);
|
|
46449
46517
|
return findings;
|
|
46450
46518
|
}
|
|
46451
|
-
function buildRuleMap(rules) {
|
|
46519
|
+
function buildRuleMap(rules, errors) {
|
|
46452
46520
|
const map = /* @__PURE__ */ new Map();
|
|
46453
|
-
for (const
|
|
46454
|
-
|
|
46521
|
+
for (const [index, raw] of rules.entries()) {
|
|
46522
|
+
const parsed = SarifRuleSchema.safeParse(raw);
|
|
46523
|
+
if (!parsed.success) {
|
|
46524
|
+
errors.push(`Skipped rule ${String(index)}: ${describeZodError(parsed.error)}`);
|
|
46525
|
+
continue;
|
|
46526
|
+
}
|
|
46527
|
+
map.set(parsed.data.id, parsed.data);
|
|
46455
46528
|
}
|
|
46456
46529
|
return map;
|
|
46457
46530
|
}
|
|
@@ -46459,6 +46532,7 @@ function getFirstPhysicalLocation(result) {
|
|
|
46459
46532
|
const locations = result.locations;
|
|
46460
46533
|
if (locations === void 0 || locations === null || locations.length === 0) return null;
|
|
46461
46534
|
const first = locations[0];
|
|
46535
|
+
if (first === void 0) return null;
|
|
46462
46536
|
return first.physicalLocation ?? null;
|
|
46463
46537
|
}
|
|
46464
46538
|
function buildLocation(file, startLine, phys) {
|
|
@@ -46477,6 +46551,15 @@ function extractLocation(result) {
|
|
|
46477
46551
|
if (file === void 0 || file === "" || startLine === void 0) return null;
|
|
46478
46552
|
return buildLocation(file, startLine, phys);
|
|
46479
46553
|
}
|
|
46554
|
+
function severityWithDisclosure(result, rule, ruleId, errors) {
|
|
46555
|
+
const { severity, unmappedLevel } = resolveSeverity(result.level ?? void 0, rule);
|
|
46556
|
+
if (unmappedLevel !== void 0) {
|
|
46557
|
+
errors.push(
|
|
46558
|
+
`Finding ${ruleId}: SARIF level '${unmappedLevel}' is not defined by the spec; severity recorded as '${severity}' (fail-closed), not measured`
|
|
46559
|
+
);
|
|
46560
|
+
}
|
|
46561
|
+
return severity;
|
|
46562
|
+
}
|
|
46480
46563
|
function parseResult(result, scanner, ruleMap, errors) {
|
|
46481
46564
|
const ruleId = result.ruleId ?? "unknown";
|
|
46482
46565
|
const rule = ruleMap.get(ruleId);
|
|
@@ -46485,12 +46568,14 @@ function parseResult(result, scanner, ruleMap, errors) {
|
|
|
46485
46568
|
errors.push(`Skipped finding ${ruleId}: missing location`);
|
|
46486
46569
|
return null;
|
|
46487
46570
|
}
|
|
46488
|
-
const
|
|
46571
|
+
const rawMessage = result.message?.text ?? rule?.shortDescription?.text ?? ruleId;
|
|
46572
|
+
const message = rawMessage.slice(0, MAX_MESSAGE_LENGTH);
|
|
46573
|
+
const severity = severityWithDisclosure(result, rule, ruleId, errors);
|
|
46489
46574
|
return {
|
|
46490
46575
|
id: `${scanner}:${ruleId}:${loc.file}:${String(loc.startLine)}`,
|
|
46491
46576
|
scanner,
|
|
46492
46577
|
rule: ruleId,
|
|
46493
|
-
severity
|
|
46578
|
+
severity,
|
|
46494
46579
|
message,
|
|
46495
46580
|
file: loc.file,
|
|
46496
46581
|
startLine: loc.startLine,
|
|
@@ -46509,11 +46594,16 @@ function scoreToSeverity(score) {
|
|
|
46509
46594
|
}
|
|
46510
46595
|
function resolveSeverity(level, rule) {
|
|
46511
46596
|
const fromScore = resolveSeverityFromScore(rule);
|
|
46512
|
-
if (fromScore !== null) return fromScore;
|
|
46513
|
-
if (level !== void 0) return
|
|
46597
|
+
if (fromScore !== null) return { severity: fromScore };
|
|
46598
|
+
if (level !== void 0) return mapLevel(level);
|
|
46514
46599
|
const ruleLevel = rule?.defaultConfiguration?.level;
|
|
46515
|
-
if (ruleLevel !== void 0) return
|
|
46516
|
-
return "medium";
|
|
46600
|
+
if (ruleLevel !== void 0) return mapLevel(ruleLevel);
|
|
46601
|
+
return { severity: "medium" };
|
|
46602
|
+
}
|
|
46603
|
+
function mapLevel(level) {
|
|
46604
|
+
const mapped = SARIF_LEVEL_MAP[level];
|
|
46605
|
+
if (mapped !== void 0) return { severity: mapped };
|
|
46606
|
+
return { severity: UNMAPPED_LEVEL_SEVERITY, unmappedLevel: level };
|
|
46517
46607
|
}
|
|
46518
46608
|
function resolveSeverityFromScore(rule) {
|
|
46519
46609
|
if (rule === void 0) return null;
|
|
@@ -46612,18 +46702,18 @@ async function executeSecurityScan(input) {
|
|
|
46612
46702
|
}
|
|
46613
46703
|
|
|
46614
46704
|
// src/security/osv-lookup.ts
|
|
46615
|
-
import { z as
|
|
46705
|
+
import { z as z100 } from "zod";
|
|
46616
46706
|
var logger44 = createLogger({ component: "osv-lookup" });
|
|
46617
46707
|
var OSV_API_URL = "https://api.osv.dev/v1/query";
|
|
46618
46708
|
var DEFAULT_TIMEOUT_MS4 = NETWORK_FETCH_TIMEOUT_MS;
|
|
46619
|
-
var OsvVulnerabilitySchema =
|
|
46620
|
-
id:
|
|
46621
|
-
summary:
|
|
46622
|
-
severity:
|
|
46623
|
-
aliases:
|
|
46624
|
-
affectedVersions:
|
|
46625
|
-
fixedVersion:
|
|
46626
|
-
url:
|
|
46709
|
+
var OsvVulnerabilitySchema = z100.object({
|
|
46710
|
+
id: z100.string(),
|
|
46711
|
+
summary: z100.string().optional(),
|
|
46712
|
+
severity: z100.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
|
|
46713
|
+
aliases: z100.array(z100.string()).default([]),
|
|
46714
|
+
affectedVersions: z100.string().optional(),
|
|
46715
|
+
fixedVersion: z100.string().optional(),
|
|
46716
|
+
url: z100.string().optional()
|
|
46627
46717
|
});
|
|
46628
46718
|
var DEFAULT_OSV_CONFIG = {
|
|
46629
46719
|
timeoutMs: DEFAULT_TIMEOUT_MS4
|
|
@@ -47136,7 +47226,7 @@ var memoryInitPromise = null;
|
|
|
47136
47226
|
async function initPipelineMemory() {
|
|
47137
47227
|
if (cachedMemory !== null) return cachedMemory;
|
|
47138
47228
|
try {
|
|
47139
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
47229
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-JOJ5SHVX.js");
|
|
47140
47230
|
const { getLearningDir } = await import("./learning-persistence-7O5QYDM7.js");
|
|
47141
47231
|
const mem = createSessionMemory2(getLearningDir());
|
|
47142
47232
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
@@ -47198,7 +47288,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
|
|
|
47198
47288
|
callRecord(routingMemoryCache);
|
|
47199
47289
|
return;
|
|
47200
47290
|
}
|
|
47201
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
47291
|
+
routingMemoryInitPromise ??= import("./routing-memory-SE3MTQSU.js").then(({ createRoutingMemory }) => {
|
|
47202
47292
|
routingMemoryCache ??= createRoutingMemory();
|
|
47203
47293
|
return routingMemoryCache;
|
|
47204
47294
|
}).catch((error) => {
|
|
@@ -47232,7 +47322,7 @@ ${text}` : "";
|
|
|
47232
47322
|
}
|
|
47233
47323
|
async function getWeatherContext() {
|
|
47234
47324
|
try {
|
|
47235
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
47325
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-5SMT3RHJ.js");
|
|
47236
47326
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
47237
47327
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
47238
47328
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -47250,7 +47340,7 @@ ${lines}
|
|
|
47250
47340
|
}
|
|
47251
47341
|
async function getMemoryContext(task) {
|
|
47252
47342
|
try {
|
|
47253
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
47343
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-JOJ5SHVX.js");
|
|
47254
47344
|
const { getLearningDir } = await import("./learning-persistence-7O5QYDM7.js");
|
|
47255
47345
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
47256
47346
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -47369,7 +47459,7 @@ ${contextBlock}`;
|
|
|
47369
47459
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47370
47460
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47371
47461
|
try {
|
|
47372
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47462
|
+
const { executeVoting } = await import("./consensus-vote-XICKVHZF.js");
|
|
47373
47463
|
const votingResult = await executeVoting(
|
|
47374
47464
|
{
|
|
47375
47465
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -47798,7 +47888,7 @@ async function searchCodebaseForTask(task) {
|
|
|
47798
47888
|
}
|
|
47799
47889
|
async function queryResearchRegistry(task) {
|
|
47800
47890
|
try {
|
|
47801
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
47891
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-ILCLFNSL.js");
|
|
47802
47892
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
47803
47893
|
if (topic === void 0) return null;
|
|
47804
47894
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -47869,7 +47959,7 @@ function createScanStageWrapper() {
|
|
|
47869
47959
|
try {
|
|
47870
47960
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
47871
47961
|
if (slug !== void 0) {
|
|
47872
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
47962
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-Z25BUZGY.js");
|
|
47873
47963
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
47874
47964
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
47875
47965
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -47909,7 +47999,7 @@ function createAuditStageRegistry() {
|
|
|
47909
47999
|
}
|
|
47910
48000
|
|
|
47911
48001
|
// src/mcp/tools/pr-review-tool.ts
|
|
47912
|
-
import { z as
|
|
48002
|
+
import { z as z102 } from "zod";
|
|
47913
48003
|
import { randomUUID as randomUUID13 } from "crypto";
|
|
47914
48004
|
|
|
47915
48005
|
// src/mcp/tools/pr-review-findings.ts
|
|
@@ -48025,17 +48115,17 @@ import { dirname as dirname4, isAbsolute, join as join11, resolve as resolve15 }
|
|
|
48025
48115
|
|
|
48026
48116
|
// src/audit/pr-review-record.ts
|
|
48027
48117
|
import * as crypto3 from "crypto";
|
|
48028
|
-
import { z as
|
|
48029
|
-
var PrReviewVerdictSchema =
|
|
48030
|
-
var PrReviewVoteCountsSchema =
|
|
48031
|
-
approve:
|
|
48032
|
-
request_changes:
|
|
48033
|
-
abstain:
|
|
48034
|
-
error:
|
|
48035
|
-
total:
|
|
48118
|
+
import { z as z101 } from "zod";
|
|
48119
|
+
var PrReviewVerdictSchema = z101.enum(["approve", "request_changes", "abstain"]);
|
|
48120
|
+
var PrReviewVoteCountsSchema = z101.object({
|
|
48121
|
+
approve: z101.number().int().nonnegative(),
|
|
48122
|
+
request_changes: z101.number().int().nonnegative(),
|
|
48123
|
+
abstain: z101.number().int().nonnegative(),
|
|
48124
|
+
error: z101.number().int().nonnegative(),
|
|
48125
|
+
total: z101.number().int().nonnegative()
|
|
48036
48126
|
}).strict();
|
|
48037
|
-
var PrReviewDiffSourceSchema =
|
|
48038
|
-
var PrReviewDiffProvenanceSchema =
|
|
48127
|
+
var PrReviewDiffSourceSchema = z101.enum(["canonical-git", "caller-supplied"]);
|
|
48128
|
+
var PrReviewDiffProvenanceSchema = z101.object({
|
|
48039
48129
|
/** How the reviewed diff was obtained. */
|
|
48040
48130
|
source: PrReviewDiffSourceSchema,
|
|
48041
48131
|
/**
|
|
@@ -48047,9 +48137,9 @@ var PrReviewDiffProvenanceSchema = z100.object({
|
|
|
48047
48137
|
* per-file attribution is unavailable. `false` means "a diff, but the packer
|
|
48048
48138
|
* saw it as one undifferentiated blob".
|
|
48049
48139
|
*/
|
|
48050
|
-
fileBoundaries:
|
|
48140
|
+
fileBoundaries: z101.boolean()
|
|
48051
48141
|
}).strict();
|
|
48052
|
-
var PrReviewRecordSchema =
|
|
48142
|
+
var PrReviewRecordSchema = z101.object({
|
|
48053
48143
|
/**
|
|
48054
48144
|
* Schema version. '1.1' was the Option-C binding (#3831): the record binds to
|
|
48055
48145
|
* `{prNumber, baseSha, reviewedDiffHash}` instead of the rejected `headSha`.
|
|
@@ -48061,22 +48151,22 @@ var PrReviewRecordSchema = z100.object({
|
|
|
48061
48151
|
* records at the time of this bump), so there is no data to migrate and no
|
|
48062
48152
|
* reason to keep a tolerant version union.
|
|
48063
48153
|
*/
|
|
48064
|
-
version:
|
|
48154
|
+
version: z101.literal("1.2"),
|
|
48065
48155
|
/**
|
|
48066
48156
|
* Monotonic sequence number (integer ≥ 0). Assigned as (max existing
|
|
48067
48157
|
* sequence)+1 at write time. Sorted, the set of sequences must cover
|
|
48068
48158
|
* 0..maxSeq with no gap (omission detection); DUPLICATE sequences are a
|
|
48069
48159
|
* benign concurrent-fork signal, not tampering.
|
|
48070
48160
|
*/
|
|
48071
|
-
sequence:
|
|
48161
|
+
sequence: z101.number().int().nonnegative(),
|
|
48072
48162
|
/** The PR number the review covers. */
|
|
48073
|
-
prNumber:
|
|
48163
|
+
prNumber: z101.number().int().positive(),
|
|
48074
48164
|
/**
|
|
48075
48165
|
* The 40-hex BASE commit SHA the reviewed diff was computed against (the
|
|
48076
48166
|
* `<base>..<head>` range base). Part of the Option-C binding so the gate knows
|
|
48077
48167
|
* which range to recompute {@link reviewedDiffHash} over.
|
|
48078
48168
|
*/
|
|
48079
|
-
baseSha:
|
|
48169
|
+
baseSha: z101.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha"),
|
|
48080
48170
|
/**
|
|
48081
48171
|
* DIFF-BINDING (Option-C, #3831): sha256 of the canonical reviewed diff bytes
|
|
48082
48172
|
* (see `audit/reviewed-diff-hash.ts` — pinned `git diff` invocation + 50k
|
|
@@ -48085,9 +48175,9 @@ var PrReviewRecordSchema = z100.object({
|
|
|
48085
48175
|
* byte-identical to what the voters saw. Covered by the self-hash below, so it
|
|
48086
48176
|
* cannot be edited to claim a different reviewed diff.
|
|
48087
48177
|
*/
|
|
48088
|
-
reviewedDiffHash:
|
|
48178
|
+
reviewedDiffHash: z101.string().length(64),
|
|
48089
48179
|
/** ISO-8601 timestamp the review was recorded. */
|
|
48090
|
-
recordedAt:
|
|
48180
|
+
recordedAt: z101.string().min(1),
|
|
48091
48181
|
/** The resolved aggregate verdict. */
|
|
48092
48182
|
verdict: PrReviewVerdictSchema,
|
|
48093
48183
|
/**
|
|
@@ -48095,13 +48185,13 @@ var PrReviewRecordSchema = z100.object({
|
|
|
48095
48185
|
* `request_changes` with `verified: true` is a strict blocker; covered by the
|
|
48096
48186
|
* hash so it cannot be flipped without detection.
|
|
48097
48187
|
*/
|
|
48098
|
-
verified:
|
|
48188
|
+
verified: z101.boolean(),
|
|
48099
48189
|
/** Per-decision voter tally from the pr_review aggregate. */
|
|
48100
48190
|
voteCounts: PrReviewVoteCountsSchema,
|
|
48101
48191
|
/** Truncated human-readable review summary for the reviewer record. */
|
|
48102
|
-
summary:
|
|
48192
|
+
summary: z101.string(),
|
|
48103
48193
|
/** Optional correlation/decision id linking to the cost rollup / trace. */
|
|
48104
|
-
correlationId:
|
|
48194
|
+
correlationId: z101.string().min(1).optional(),
|
|
48105
48195
|
/**
|
|
48106
48196
|
* What this record was DERIVED FROM (#4459). OPTIONAL by necessity: the
|
|
48107
48197
|
* schema is `.strict()`, so a required field would reject every record
|
|
@@ -48114,9 +48204,9 @@ var PrReviewRecordSchema = z100.object({
|
|
|
48114
48204
|
* Retained for audit texture but NOT covered by `hash` and NOT verified —
|
|
48115
48205
|
* the record-set model is position-independent (mirrors #3927).
|
|
48116
48206
|
*/
|
|
48117
|
-
previousHash:
|
|
48207
|
+
previousHash: z101.string().length(64).optional(),
|
|
48118
48208
|
/** SHA-256 over every field above EXCEPT `previousHash` (and except `hash`). */
|
|
48119
|
-
hash:
|
|
48209
|
+
hash: z101.string().length(64)
|
|
48120
48210
|
}).strict();
|
|
48121
48211
|
function computePrReviewRecordHash(payload) {
|
|
48122
48212
|
const canonical = JSON.stringify({
|
|
@@ -48571,19 +48661,19 @@ var MAX_DIFF_INPUT_LENGTH = 2e6;
|
|
|
48571
48661
|
var MAX_REPO_CONTEXT_LENGTH = 2e3;
|
|
48572
48662
|
var MAX_DESCRIPTION_LENGTH = 1e4;
|
|
48573
48663
|
var PR_REVIEW_ASYNC_HINT = "A pr_review run fans out to 5 live LLM voters and can exceed the synchronous MCP request timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
|
|
48574
|
-
var PrReviewInputSchema =
|
|
48575
|
-
prTitle:
|
|
48576
|
-
prDescription:
|
|
48577
|
-
prDiff:
|
|
48664
|
+
var PrReviewInputSchema = z102.object({
|
|
48665
|
+
prTitle: z102.string().min(1).max(500).describe("PR title"),
|
|
48666
|
+
prDescription: z102.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
|
|
48667
|
+
prDiff: z102.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
|
|
48578
48668
|
message: "prDiff must be a unified diff (expected a `diff --git`, `---`/`+++`, or `@@ \u2026 @@` line). Prose descriptions of a change are rejected: a review of a summary is not a review of the code, and would be recorded as though it were (#4451)."
|
|
48579
48669
|
}).describe(
|
|
48580
48670
|
`Unified diff text (max ${String(MAX_DIFF_INPUT_LENGTH)} chars). REQUIRED SHAPE (#4451): must contain a \`diff --git\` header, an \`@@ \u2026 @@\` hunk header backed by +/- lines, or a \`---\`/\`+++\` header pair \u2014 a prose summary of the change is REJECTED, because reviewing a summary is not reviewing the code and would be recorded as though it were. (Stated here because Zod refinements do not survive JSON-schema generation, so this constraint is otherwise invisible to clients.) No need to truncate before calling: diffs over ${String(MAX_DIFF_LENGTH)} chars are security-prioritized and PARTIALLY reviewed (lowest-priority whole files dropped; coverage reported on the response, and a partial review can block but never verified-approve).`
|
|
48581
48671
|
),
|
|
48582
|
-
repoContext:
|
|
48672
|
+
repoContext: z102.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
|
|
48583
48673
|
`Optional one-paragraph repo context (architecture, conventions; max ${String(MAX_REPO_CONTEXT_LENGTH)} chars; trim before calling)`
|
|
48584
48674
|
),
|
|
48585
|
-
baseRef:
|
|
48586
|
-
headRef:
|
|
48675
|
+
baseRef: z102.string().max(200).optional().describe("Base branch ref (e.g. main)"),
|
|
48676
|
+
headRef: z102.string().max(200).optional().describe("Head branch ref"),
|
|
48587
48677
|
/**
|
|
48588
48678
|
* Option-C audit binding (#4031). When BOTH `prNumber` and `baseSha` are
|
|
48589
48679
|
* supplied AND the review is live (not simulated), pr_review persists an
|
|
@@ -48595,14 +48685,14 @@ var PrReviewInputSchema = z101.object({
|
|
|
48595
48685
|
* canonical `git diff <baseSha>..<headSha>` the gate recomputes (the hash
|
|
48596
48686
|
* truncates at that byte cap) — pass the canonical diff, not a reordered one.
|
|
48597
48687
|
*/
|
|
48598
|
-
prNumber:
|
|
48599
|
-
baseSha:
|
|
48688
|
+
prNumber: z102.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
|
|
48689
|
+
baseSha: z102.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
|
|
48600
48690
|
"40-hex base commit sha the reviewed diff was computed from (Option-C binding, #4031)"
|
|
48601
48691
|
),
|
|
48602
|
-
repoPath:
|
|
48692
|
+
repoPath: z102.string().max(1024).optional().describe(
|
|
48603
48693
|
"Repo root path for persisting the governance pr-review record (overrides cwd auto-detection). Must contain a .git ancestor \u2014 relative paths are resolved against cwd; ignored (falls back to cwd auto-detection) if it is not a real repo root. Env NEXUS_PR_REVIEW_RECORDS_PATH still takes precedence and is unrestricted."
|
|
48604
48694
|
),
|
|
48605
|
-
simulate:
|
|
48695
|
+
simulate: z102.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
|
|
48606
48696
|
/**
|
|
48607
48697
|
* Error policy (#4132). `standard` (default) keeps the pre-#4132 aggregation:
|
|
48608
48698
|
* an errored voter is simply excluded from the panel. `absolute_quorum` gates
|
|
@@ -48614,7 +48704,7 @@ var PrReviewInputSchema = z101.object({
|
|
|
48614
48704
|
* verified approve. A genuine `request_changes` blocker still wins (Tiers 1-2
|
|
48615
48705
|
* run first).
|
|
48616
48706
|
*/
|
|
48617
|
-
errorPolicy:
|
|
48707
|
+
errorPolicy: z102.enum(["standard", "absolute_quorum"]).default("standard").describe(
|
|
48618
48708
|
"Error policy (#4132). 'standard' (default): errored voters excluded. 'absolute_quorum': any errored voter \u2014 esp. the contrarian \u2014 degrades a would-be approve to a recoverable abstain (verified:false); never manufactures a verified approve from an induced error."
|
|
48619
48709
|
),
|
|
48620
48710
|
/**
|
|
@@ -48624,7 +48714,7 @@ var PrReviewInputSchema = z101.object({
|
|
|
48624
48714
|
* runs the panel in the background; poll `get_job_result({ jobId })` for the
|
|
48625
48715
|
* result.
|
|
48626
48716
|
*/
|
|
48627
|
-
dispatch:
|
|
48717
|
+
dispatch: z102.enum(["sync", "async"]).default("sync").describe(
|
|
48628
48718
|
"Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
|
|
48629
48719
|
)
|
|
48630
48720
|
});
|
|
@@ -48859,27 +48949,27 @@ function registerPrReviewTool(server, deps) {
|
|
|
48859
48949
|
}
|
|
48860
48950
|
|
|
48861
48951
|
// src/mcp/tools/survey-oss-landscape.ts
|
|
48862
|
-
import { z as
|
|
48863
|
-
var SurveyOssLandscapeInputSchema =
|
|
48864
|
-
query:
|
|
48865
|
-
maxResults:
|
|
48866
|
-
minStars:
|
|
48867
|
-
language:
|
|
48868
|
-
});
|
|
48869
|
-
var GitHubRepoSchema =
|
|
48870
|
-
full_name:
|
|
48871
|
-
html_url:
|
|
48872
|
-
description:
|
|
48873
|
-
stargazers_count:
|
|
48874
|
-
pushed_at:
|
|
48875
|
-
language:
|
|
48876
|
-
license:
|
|
48877
|
-
spdx_id:
|
|
48952
|
+
import { z as z103 } from "zod";
|
|
48953
|
+
var SurveyOssLandscapeInputSchema = z103.object({
|
|
48954
|
+
query: z103.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
|
|
48955
|
+
maxResults: z103.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
|
|
48956
|
+
minStars: z103.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
|
|
48957
|
+
language: z103.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
|
|
48958
|
+
});
|
|
48959
|
+
var GitHubRepoSchema = z103.object({
|
|
48960
|
+
full_name: z103.string().optional(),
|
|
48961
|
+
html_url: z103.string().optional(),
|
|
48962
|
+
description: z103.string().nullable().optional(),
|
|
48963
|
+
stargazers_count: z103.number().optional(),
|
|
48964
|
+
pushed_at: z103.string().nullable().optional(),
|
|
48965
|
+
language: z103.string().nullable().optional(),
|
|
48966
|
+
license: z103.object({
|
|
48967
|
+
spdx_id: z103.string().nullable().optional()
|
|
48878
48968
|
}).nullable().optional()
|
|
48879
48969
|
});
|
|
48880
|
-
var GitHubSearchResponseSchema =
|
|
48881
|
-
total_count:
|
|
48882
|
-
items:
|
|
48970
|
+
var GitHubSearchResponseSchema = z103.object({
|
|
48971
|
+
total_count: z103.number().optional(),
|
|
48972
|
+
items: z103.array(GitHubRepoSchema).optional()
|
|
48883
48973
|
});
|
|
48884
48974
|
var GITHUB_SEARCH_BASE = "https://api.github.com/search/repositories";
|
|
48885
48975
|
function buildGithubQuery(input) {
|
|
@@ -49006,11 +49096,11 @@ function createSurveyHandler(deps) {
|
|
|
49006
49096
|
};
|
|
49007
49097
|
}
|
|
49008
49098
|
var SURVEY_OUTPUT_SCHEMA = {
|
|
49009
|
-
query:
|
|
49010
|
-
totalFound:
|
|
49011
|
-
candidates:
|
|
49012
|
-
sourcesQueried:
|
|
49013
|
-
sourcesFailed:
|
|
49099
|
+
query: z103.string(),
|
|
49100
|
+
totalFound: z103.number(),
|
|
49101
|
+
candidates: z103.array(z103.unknown()),
|
|
49102
|
+
sourcesQueried: z103.array(z103.string()),
|
|
49103
|
+
sourcesFailed: z103.array(z103.string())
|
|
49014
49104
|
};
|
|
49015
49105
|
var SURVEY_DESCRIPTION = 'Transient OSS project search. Returns a ranked list of GitHub repositories with license, last-commit, star-count, and one-line description. Does NOT persist to the research registry \u2014 use `research_add_source` for that. Best for one-off engineering decisions like "what tools exist in this space?".';
|
|
49016
49106
|
function registerSurveyOssLandscapeTool(server, deps) {
|
|
@@ -49039,7 +49129,7 @@ function registerSurveyOssLandscapeTool(server, deps) {
|
|
|
49039
49129
|
}
|
|
49040
49130
|
|
|
49041
49131
|
// src/mcp/tools/vendor-publishing-audit.ts
|
|
49042
|
-
import { z as
|
|
49132
|
+
import { z as z104 } from "zod";
|
|
49043
49133
|
|
|
49044
49134
|
// src/mcp/tools/vendor-publishing-seed.ts
|
|
49045
49135
|
var VENDOR_PUBLISHING_SEED = {
|
|
@@ -49112,8 +49202,8 @@ function listKnownVendors() {
|
|
|
49112
49202
|
}
|
|
49113
49203
|
|
|
49114
49204
|
// src/mcp/tools/vendor-publishing-audit.ts
|
|
49115
|
-
var VendorPublishingAuditInputSchema =
|
|
49116
|
-
vendor:
|
|
49205
|
+
var VendorPublishingAuditInputSchema = z104.object({
|
|
49206
|
+
vendor: z104.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
|
|
49117
49207
|
});
|
|
49118
49208
|
function lookupVendor(vendor) {
|
|
49119
49209
|
if (isKnownVendor(vendor)) {
|
|
@@ -49145,20 +49235,20 @@ function createVendorPublishingAuditHandler(deps) {
|
|
|
49145
49235
|
};
|
|
49146
49236
|
}
|
|
49147
49237
|
var VENDOR_PUBLISHING_OUTPUT_SCHEMA = {
|
|
49148
|
-
vendor:
|
|
49149
|
-
known:
|
|
49238
|
+
vendor: z104.string(),
|
|
49239
|
+
known: z104.boolean(),
|
|
49150
49240
|
// Fields below populate when known=true; permissive optional for known=false.
|
|
49151
|
-
sha256SumsUrlPattern:
|
|
49152
|
-
sha256SumsSignatureUrlPattern:
|
|
49153
|
-
signaturePattern:
|
|
49154
|
-
gpgKeys:
|
|
49155
|
-
releaseCadence:
|
|
49156
|
-
keyRotationNotes:
|
|
49157
|
-
vendorDocUrl:
|
|
49158
|
-
citedAt:
|
|
49241
|
+
sha256SumsUrlPattern: z104.string().optional(),
|
|
49242
|
+
sha256SumsSignatureUrlPattern: z104.string().optional(),
|
|
49243
|
+
signaturePattern: z104.string().optional(),
|
|
49244
|
+
gpgKeys: z104.array(z104.unknown()).optional(),
|
|
49245
|
+
releaseCadence: z104.string().optional(),
|
|
49246
|
+
keyRotationNotes: z104.string().optional(),
|
|
49247
|
+
vendorDocUrl: z104.string().optional(),
|
|
49248
|
+
citedAt: z104.string().optional(),
|
|
49159
49249
|
// Fields below populate when known=false.
|
|
49160
|
-
message:
|
|
49161
|
-
knownVendors:
|
|
49250
|
+
message: z104.string().optional(),
|
|
49251
|
+
knownVendors: z104.array(z104.string()).optional()
|
|
49162
49252
|
};
|
|
49163
49253
|
var VENDOR_PUBLISHING_DESCRIPTION = "Look up a vendor's published-artifact signing infrastructure: GPG key fingerprints, SHA256SUMS URL pattern, signature shape (clearsigned / detached / detached-on-iso), release cadence, key rotation notes, and the vendor doc citation. Static lookup against a curated seed dataset; the vendor doc URL is the authoritative source. Returns `{known: false, knownVendors: [...]}` for vendors without a seed entry. v1 covers ubuntu, debian, fedora.";
|
|
49164
49254
|
function registerVendorPublishingAuditTool(server, deps) {
|
|
@@ -49187,17 +49277,17 @@ function registerVendorPublishingAuditTool(server, deps) {
|
|
|
49187
49277
|
}
|
|
49188
49278
|
|
|
49189
49279
|
// src/mcp/tools/compare-data-feeds.ts
|
|
49190
|
-
import { z as
|
|
49280
|
+
import { z as z105 } from "zod";
|
|
49191
49281
|
import * as path7 from "path";
|
|
49192
49282
|
import * as fs8 from "fs";
|
|
49193
49283
|
import * as yaml4 from "yaml";
|
|
49194
|
-
var CompareDataFeedsInputSchema =
|
|
49195
|
-
feedAPath:
|
|
49196
|
-
feedBPath:
|
|
49197
|
-
keyPath:
|
|
49284
|
+
var CompareDataFeedsInputSchema = z105.object({
|
|
49285
|
+
feedAPath: z105.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
|
|
49286
|
+
feedBPath: z105.string().min(1).max(1e3).describe("Filesystem path to feed B"),
|
|
49287
|
+
keyPath: z105.string().min(1).max(200).describe(
|
|
49198
49288
|
'Dotted path to the entry key, e.g. "id" or "name". Each entry must have this field.'
|
|
49199
49289
|
),
|
|
49200
|
-
compareFields:
|
|
49290
|
+
compareFields: z105.array(z105.string().min(1).max(200)).max(20).optional().describe(
|
|
49201
49291
|
'Optional dotted field paths to compare across matched entries (e.g. ["license", "sha256"])'
|
|
49202
49292
|
)
|
|
49203
49293
|
});
|
|
@@ -49381,24 +49471,24 @@ function createCompareDataFeedsHandler(deps) {
|
|
|
49381
49471
|
};
|
|
49382
49472
|
}
|
|
49383
49473
|
var COMPARE_OUTPUT_SCHEMA = {
|
|
49384
|
-
feedAPath:
|
|
49385
|
-
feedBPath:
|
|
49386
|
-
keyPath:
|
|
49387
|
-
counts:
|
|
49388
|
-
entriesInA:
|
|
49389
|
-
entriesInB:
|
|
49390
|
-
onlyInA:
|
|
49391
|
-
onlyInB:
|
|
49392
|
-
inBoth:
|
|
49393
|
-
fieldDifferences:
|
|
49474
|
+
feedAPath: z105.string(),
|
|
49475
|
+
feedBPath: z105.string(),
|
|
49476
|
+
keyPath: z105.string(),
|
|
49477
|
+
counts: z105.object({
|
|
49478
|
+
entriesInA: z105.number(),
|
|
49479
|
+
entriesInB: z105.number(),
|
|
49480
|
+
onlyInA: z105.number(),
|
|
49481
|
+
onlyInB: z105.number(),
|
|
49482
|
+
inBoth: z105.number(),
|
|
49483
|
+
fieldDifferences: z105.number()
|
|
49394
49484
|
}),
|
|
49395
|
-
coverage:
|
|
49396
|
-
onlyInA:
|
|
49397
|
-
onlyInB:
|
|
49398
|
-
inBoth:
|
|
49485
|
+
coverage: z105.object({
|
|
49486
|
+
onlyInA: z105.array(z105.string()),
|
|
49487
|
+
onlyInB: z105.array(z105.string()),
|
|
49488
|
+
inBoth: z105.array(z105.string())
|
|
49399
49489
|
}),
|
|
49400
|
-
fieldDifferences:
|
|
49401
|
-
summary:
|
|
49490
|
+
fieldDifferences: z105.array(z105.unknown()),
|
|
49491
|
+
summary: z105.string()
|
|
49402
49492
|
};
|
|
49403
49493
|
var COMPARE_DESCRIPTION = "Diff two upstream data feeds (YAML or JSON files) along coverage and per-field axes. Returns which entries exist in A, B, both, plus optional field-level diffs across matched entries. v1 takes file paths only (no URL fetch \u2014 that needs an SSRF design pass). Both feeds must be a top-level array OR a top-level object with exactly one array field.";
|
|
49404
49494
|
function registerCompareDataFeedsTool(server, deps) {
|
|
@@ -49427,9 +49517,9 @@ function registerCompareDataFeedsTool(server, deps) {
|
|
|
49427
49517
|
}
|
|
49428
49518
|
|
|
49429
49519
|
// src/mcp/tools/query-task-state-tool.ts
|
|
49430
|
-
import { z as
|
|
49431
|
-
var QueryTaskStateInputSchema =
|
|
49432
|
-
taskId:
|
|
49520
|
+
import { z as z106 } from "zod";
|
|
49521
|
+
var QueryTaskStateInputSchema = z106.object({
|
|
49522
|
+
taskId: z106.string().min(1).max(128).describe("Task ID whose structured state log should be read")
|
|
49433
49523
|
});
|
|
49434
49524
|
function queryTaskStateHandler(args, ctx) {
|
|
49435
49525
|
const parsed = QueryTaskStateInputSchema.safeParse(args);
|
|
@@ -49464,7 +49554,7 @@ function queryTaskStateHandler(args, ctx) {
|
|
|
49464
49554
|
function registerQueryTaskStateTool(server, deps) {
|
|
49465
49555
|
const logger58 = deps.logger ?? createLogger({ tool: "query_task_state" });
|
|
49466
49556
|
const toolSchema = {
|
|
49467
|
-
taskId:
|
|
49557
|
+
taskId: z106.string().min(1).max(128).describe("Task ID whose structured state log should be read")
|
|
49468
49558
|
};
|
|
49469
49559
|
const description = "Read the structured state log for a task ID and return the current snapshot. Includes Magentic-One Task Ledger (facts/guesses/openQuestions) and Progress Ledger (per-step reflections with suggestedAction) when orchestrators have written them. Structured state is only written when NEXUS_TASK_STATE_ENABLED=1 was set during the orchestrate invocation.";
|
|
49470
49560
|
const secureHandler = createSecureHandler(queryTaskStateHandler, {
|
|
@@ -49486,28 +49576,28 @@ function registerQueryTaskStateTool(server, deps) {
|
|
|
49486
49576
|
}
|
|
49487
49577
|
|
|
49488
49578
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
49489
|
-
import { z as
|
|
49579
|
+
import { z as z109 } from "zod";
|
|
49490
49580
|
|
|
49491
49581
|
// src/mcp/tools/ci-health-log.ts
|
|
49492
49582
|
import { appendFileSync as appendFileSync5, existsSync as existsSync13, readFileSync as readFileSync11, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
49493
|
-
import { z as
|
|
49583
|
+
import { z as z108 } from "zod";
|
|
49494
49584
|
|
|
49495
49585
|
// src/mcp/tools/ci-health-types.ts
|
|
49496
|
-
import { z as
|
|
49497
|
-
var CiHealthStatusSchema =
|
|
49586
|
+
import { z as z107 } from "zod";
|
|
49587
|
+
var CiHealthStatusSchema = z107.enum(["healthy", "degraded", "outage", "unknown"]);
|
|
49498
49588
|
|
|
49499
49589
|
// src/mcp/tools/ci-health-log.ts
|
|
49500
49590
|
var logger47 = createLogger({ component: "ci-health-log" });
|
|
49501
|
-
var CiHealthEventSchema =
|
|
49502
|
-
v:
|
|
49503
|
-
ts:
|
|
49591
|
+
var CiHealthEventSchema = z108.object({
|
|
49592
|
+
v: z108.literal(1),
|
|
49593
|
+
ts: z108.iso.datetime(),
|
|
49504
49594
|
status: CiHealthStatusSchema,
|
|
49505
|
-
repo:
|
|
49506
|
-
signals:
|
|
49507
|
-
|
|
49508
|
-
source:
|
|
49595
|
+
repo: z108.string().optional(),
|
|
49596
|
+
signals: z108.array(
|
|
49597
|
+
z108.object({
|
|
49598
|
+
source: z108.enum(["github-status", "repo-activity-window"]),
|
|
49509
49599
|
status: CiHealthStatusSchema,
|
|
49510
|
-
evidence:
|
|
49600
|
+
evidence: z108.string()
|
|
49511
49601
|
})
|
|
49512
49602
|
)
|
|
49513
49603
|
});
|
|
@@ -49587,17 +49677,17 @@ function eventFromCheck(params) {
|
|
|
49587
49677
|
}
|
|
49588
49678
|
|
|
49589
49679
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
49590
|
-
var CiHealthCheckInputSchema =
|
|
49680
|
+
var CiHealthCheckInputSchema = z109.object({
|
|
49591
49681
|
/**
|
|
49592
49682
|
* Repo to check for the recent-runs activity signal (in `owner/repo` form).
|
|
49593
49683
|
* Optional — when omitted, only the status-page signal is consulted.
|
|
49594
49684
|
*/
|
|
49595
|
-
repo:
|
|
49685
|
+
repo: z109.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
|
|
49596
49686
|
/**
|
|
49597
49687
|
* How far back to look for recent-runs activity (minutes). Default 30 —
|
|
49598
49688
|
* matches the typical wedge-detection window from the #3070 / #3076 outages.
|
|
49599
49689
|
*/
|
|
49600
|
-
activityWindowMinutes:
|
|
49690
|
+
activityWindowMinutes: z109.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
49601
49691
|
});
|
|
49602
49692
|
var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
|
|
49603
49693
|
function mapStatusPageStatus(raw) {
|
|
@@ -49730,8 +49820,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
|
|
|
49730
49820
|
function registerCiHealthCheckTool(server, deps) {
|
|
49731
49821
|
const logger58 = deps.logger ?? createLogger({ tool: "ci_health_check" });
|
|
49732
49822
|
const toolSchema = {
|
|
49733
|
-
repo:
|
|
49734
|
-
activityWindowMinutes:
|
|
49823
|
+
repo: z109.string().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/, "Must be owner/repo form").optional().describe("GitHub repo (owner/repo) to check for recent CI activity. Optional."),
|
|
49824
|
+
activityWindowMinutes: z109.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
49735
49825
|
};
|
|
49736
49826
|
const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger58), {
|
|
49737
49827
|
toolName: "ci_health_check",
|
|
@@ -49757,18 +49847,18 @@ function registerCiHealthCheckTool(server, deps) {
|
|
|
49757
49847
|
|
|
49758
49848
|
// src/mcp/tools/quality-gate-tool.ts
|
|
49759
49849
|
import { statSync as statSync3 } from "fs";
|
|
49760
|
-
import { z as
|
|
49761
|
-
var QualityCheckSchema =
|
|
49850
|
+
import { z as z110 } from "zod";
|
|
49851
|
+
var QualityCheckSchema = z110.enum(["typecheck", "lint", "tests", "build", "security"]);
|
|
49762
49852
|
var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
|
|
49763
|
-
var RunQualityGateInputSchema =
|
|
49853
|
+
var RunQualityGateInputSchema = z110.object({
|
|
49764
49854
|
/** Project directory to run checks against. Must resolve inside the repo/cwd root. */
|
|
49765
|
-
projectDir:
|
|
49855
|
+
projectDir: z110.string().optional().describe(
|
|
49766
49856
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
49767
49857
|
),
|
|
49768
49858
|
/** Which allowlisted checks to run. */
|
|
49769
|
-
checks:
|
|
49859
|
+
checks: z110.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
49770
49860
|
/** 1-based iteration counter, forwarded to the engine for feedback context. */
|
|
49771
|
-
iteration:
|
|
49861
|
+
iteration: z110.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
|
|
49772
49862
|
});
|
|
49773
49863
|
function validateProjectDir(raw) {
|
|
49774
49864
|
const candidate = raw ?? process.cwd();
|
|
@@ -49843,11 +49933,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
|
|
|
49843
49933
|
function registerRunQualityGateTool(server, deps) {
|
|
49844
49934
|
const logger58 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
|
|
49845
49935
|
const toolSchema = {
|
|
49846
|
-
projectDir:
|
|
49936
|
+
projectDir: z110.string().optional().describe(
|
|
49847
49937
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
49848
49938
|
),
|
|
49849
|
-
checks:
|
|
49850
|
-
iteration:
|
|
49939
|
+
checks: z110.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
49940
|
+
iteration: z110.number().int().min(1).optional().describe("1-based iteration number (default 1).")
|
|
49851
49941
|
};
|
|
49852
49942
|
const secureHandler = createSecureHandler(
|
|
49853
49943
|
(args) => runQualityGateHandler(args, logger58),
|
|
@@ -49877,9 +49967,9 @@ function registerRunQualityGateTool(server, deps) {
|
|
|
49877
49967
|
// src/mcp/tools/verify-audit-chain-tool.ts
|
|
49878
49968
|
import * as fs9 from "fs/promises";
|
|
49879
49969
|
import * as path8 from "path";
|
|
49880
|
-
import { z as
|
|
49881
|
-
var VerifyAuditChainInputSchema =
|
|
49882
|
-
logDir:
|
|
49970
|
+
import { z as z111 } from "zod";
|
|
49971
|
+
var VerifyAuditChainInputSchema = z111.object({
|
|
49972
|
+
logDir: z111.string().min(1).max(512).describe(
|
|
49883
49973
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
|
|
49884
49974
|
)
|
|
49885
49975
|
});
|
|
@@ -49969,7 +50059,7 @@ async function handler2(args, ctx) {
|
|
|
49969
50059
|
function registerVerifyAuditChainTool(server, deps) {
|
|
49970
50060
|
const logger58 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
|
|
49971
50061
|
const toolSchema = {
|
|
49972
|
-
logDir:
|
|
50062
|
+
logDir: z111.string().min(1).max(512).describe(
|
|
49973
50063
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
|
|
49974
50064
|
)
|
|
49975
50065
|
};
|
|
@@ -49993,7 +50083,7 @@ function registerVerifyAuditChainTool(server, deps) {
|
|
|
49993
50083
|
}
|
|
49994
50084
|
|
|
49995
50085
|
// src/mcp/tools/suggest-research-tasks-tool.ts
|
|
49996
|
-
import { z as
|
|
50086
|
+
import { z as z112 } from "zod";
|
|
49997
50087
|
var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
|
|
49998
50088
|
var RESEARCH_BUDGET_MS = 2e4;
|
|
49999
50089
|
var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
|
|
@@ -50010,11 +50100,11 @@ async function withResearchBudget(p, ms) {
|
|
|
50010
50100
|
if (timer !== void 0) clearTimeout(timer);
|
|
50011
50101
|
}
|
|
50012
50102
|
}
|
|
50013
|
-
var SuggestResearchTasksInputSchema =
|
|
50014
|
-
topic:
|
|
50015
|
-
qualityThreshold:
|
|
50016
|
-
maxTriggers:
|
|
50017
|
-
existingTaskIds:
|
|
50103
|
+
var SuggestResearchTasksInputSchema = z112.object({
|
|
50104
|
+
topic: z112.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
50105
|
+
qualityThreshold: z112.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
50106
|
+
maxTriggers: z112.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
50107
|
+
existingTaskIds: z112.array(z112.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
50018
50108
|
});
|
|
50019
50109
|
function toTriggerConfig(input) {
|
|
50020
50110
|
return {
|
|
@@ -50071,10 +50161,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
|
|
|
50071
50161
|
function registerSuggestResearchTasksTool(server, deps) {
|
|
50072
50162
|
const logger58 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
|
|
50073
50163
|
const toolSchema = {
|
|
50074
|
-
topic:
|
|
50075
|
-
qualityThreshold:
|
|
50076
|
-
maxTriggers:
|
|
50077
|
-
existingTaskIds:
|
|
50164
|
+
topic: z112.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
50165
|
+
qualityThreshold: z112.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
50166
|
+
maxTriggers: z112.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
50167
|
+
existingTaskIds: z112.array(z112.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
50078
50168
|
};
|
|
50079
50169
|
const secureHandler = createSecureHandler(
|
|
50080
50170
|
(args) => suggestResearchTasksHandler(args, logger58),
|
|
@@ -50102,7 +50192,7 @@ function registerSuggestResearchTasksTool(server, deps) {
|
|
|
50102
50192
|
}
|
|
50103
50193
|
|
|
50104
50194
|
// src/mcp/tools/run-tool.ts
|
|
50105
|
-
import { z as
|
|
50195
|
+
import { z as z116 } from "zod";
|
|
50106
50196
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
50107
50197
|
|
|
50108
50198
|
// src/orchestration/meta-dispatcher.ts
|
|
@@ -50497,7 +50587,7 @@ function createMetaOrchestrator(options) {
|
|
|
50497
50587
|
|
|
50498
50588
|
// src/orchestration/meta-shadow-selector.ts
|
|
50499
50589
|
import { appendFileSync as appendFileSync6, existsSync as existsSync14, readFileSync as readFileSync12 } from "fs";
|
|
50500
|
-
import { z as
|
|
50590
|
+
import { z as z113 } from "zod";
|
|
50501
50591
|
var SHADOW_STRATEGY_ARMS = [
|
|
50502
50592
|
"single-shot",
|
|
50503
50593
|
"dev-pipeline",
|
|
@@ -50584,19 +50674,19 @@ function createHydratableSelector() {
|
|
|
50584
50674
|
var META_OUTCOME_SCHEMA_VERSION = 1;
|
|
50585
50675
|
var HYDRATE_LOOKBACK_DAYS = 30;
|
|
50586
50676
|
var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
|
|
50587
|
-
var PersistedContextSchema =
|
|
50588
|
-
taskComplexity:
|
|
50589
|
-
contextLengthNormalized:
|
|
50590
|
-
isCodeTask:
|
|
50591
|
-
isReasoningTask:
|
|
50592
|
-
budgetUtilization:
|
|
50593
|
-
timePressure:
|
|
50594
|
-
});
|
|
50595
|
-
var PersistedMetaOutcomeSchema =
|
|
50596
|
-
schema:
|
|
50597
|
-
timestamp:
|
|
50598
|
-
strategy:
|
|
50599
|
-
success:
|
|
50677
|
+
var PersistedContextSchema = z113.object({
|
|
50678
|
+
taskComplexity: z113.number(),
|
|
50679
|
+
contextLengthNormalized: z113.number(),
|
|
50680
|
+
isCodeTask: z113.number(),
|
|
50681
|
+
isReasoningTask: z113.number(),
|
|
50682
|
+
budgetUtilization: z113.number(),
|
|
50683
|
+
timePressure: z113.number()
|
|
50684
|
+
});
|
|
50685
|
+
var PersistedMetaOutcomeSchema = z113.object({
|
|
50686
|
+
schema: z113.literal(META_OUTCOME_SCHEMA_VERSION),
|
|
50687
|
+
timestamp: z113.string(),
|
|
50688
|
+
strategy: z113.enum(SHADOW_STRATEGY_ARMS),
|
|
50689
|
+
success: z113.boolean(),
|
|
50600
50690
|
context: PersistedContextSchema
|
|
50601
50691
|
});
|
|
50602
50692
|
var persistLogger = createLogger({ component: "MetaShadowSelector" });
|
|
@@ -50989,7 +51079,7 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
|
|
|
50989
51079
|
}
|
|
50990
51080
|
|
|
50991
51081
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
50992
|
-
import { z as
|
|
51082
|
+
import { z as z114 } from "zod";
|
|
50993
51083
|
import * as fs11 from "fs";
|
|
50994
51084
|
import * as path10 from "path";
|
|
50995
51085
|
import { randomUUID as randomUUID15 } from "crypto";
|
|
@@ -51013,7 +51103,7 @@ var GitHubTaskTracker = class {
|
|
|
51013
51103
|
cachedProvider = null;
|
|
51014
51104
|
async getProvider() {
|
|
51015
51105
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
51016
|
-
const { createScmProvider } = await import("./factory-
|
|
51106
|
+
const { createScmProvider } = await import("./factory-LCKPBDL2.js");
|
|
51017
51107
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
51018
51108
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
51019
51109
|
this.cachedProvider = result.value;
|
|
@@ -51142,36 +51232,36 @@ var DEV_PIPELINE_DRY_RUN_NOTE = "This was a dry run (plan+vote), which always ru
|
|
|
51142
51232
|
function dispatchNoteFor(dryRun) {
|
|
51143
51233
|
return dryRun ? DEV_PIPELINE_DRY_RUN_NOTE : DEV_PIPELINE_ASYNC_HINT;
|
|
51144
51234
|
}
|
|
51145
|
-
var DevPipelineInputSchema =
|
|
51235
|
+
var DevPipelineInputSchema = z114.object({
|
|
51146
51236
|
/** Direct task instructions. */
|
|
51147
|
-
task:
|
|
51237
|
+
task: z114.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
|
|
51148
51238
|
/** Path to a plan file (.md, .yaml, .txt) to use as input. */
|
|
51149
|
-
planFile:
|
|
51239
|
+
planFile: z114.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
|
|
51150
51240
|
/** Whether to run in dry-run mode (plan+vote only, no implementation). */
|
|
51151
|
-
dryRun:
|
|
51241
|
+
dryRun: z114.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
|
|
51152
51242
|
/** Maximum vote iterations before proceeding (default: 3). */
|
|
51153
|
-
maxVoteIterations:
|
|
51243
|
+
maxVoteIterations: z114.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
|
|
51154
51244
|
/** Maximum QA iterations per task (default: 3). */
|
|
51155
|
-
maxQaIterations:
|
|
51245
|
+
maxQaIterations: z114.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
|
|
51156
51246
|
/** Working directory for the pipeline (default: cwd). Used for security scan and context. */
|
|
51157
|
-
workingDir:
|
|
51247
|
+
workingDir: z114.string().max(500).optional().describe("Working directory (default: cwd)"),
|
|
51158
51248
|
/** GitHub issue number to track progress on. Updates posted as comments. */
|
|
51159
|
-
issueNumber:
|
|
51249
|
+
issueNumber: z114.number().int().positive().optional().describe("GitHub issue to post progress to"),
|
|
51160
51250
|
/** GitHub repo (owner/name) for issue tracking. */
|
|
51161
|
-
repo:
|
|
51251
|
+
repo: z114.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
|
|
51162
51252
|
/** Task tracking backend: github, gitlab, or json (default: json). */
|
|
51163
|
-
trackerBackend:
|
|
51253
|
+
trackerBackend: z114.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
|
|
51164
51254
|
/** Labels to apply to created issues. */
|
|
51165
|
-
labels:
|
|
51255
|
+
labels: z114.array(z114.string()).optional().describe("Labels for created issues"),
|
|
51166
51256
|
/** Session ID for checkpoint/resume. Enables crash recovery. */
|
|
51167
|
-
sessionId:
|
|
51257
|
+
sessionId: z114.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
|
|
51168
51258
|
/**
|
|
51169
51259
|
* TESTS ONLY — when true, voters return random decisions. Must not be used as
|
|
51170
51260
|
* a fallback when adapters are unavailable; configure an adapter instead. (#2319)
|
|
51171
51261
|
*/
|
|
51172
|
-
simulateVotes:
|
|
51262
|
+
simulateVotes: z114.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
|
|
51173
51263
|
/** Voting strategy for consensus stages. */
|
|
51174
|
-
votingStrategy:
|
|
51264
|
+
votingStrategy: z114.enum([
|
|
51175
51265
|
"simple_majority",
|
|
51176
51266
|
"supermajority",
|
|
51177
51267
|
"unanimous",
|
|
@@ -51180,11 +51270,11 @@ var DevPipelineInputSchema = z113.object({
|
|
|
51180
51270
|
"opinion_wise"
|
|
51181
51271
|
]).optional().describe("Voting strategy for plan approval (default: higher_order)"),
|
|
51182
51272
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
51183
|
-
quickMode:
|
|
51273
|
+
quickMode: z114.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
51184
51274
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
51185
|
-
timeoutMs:
|
|
51275
|
+
timeoutMs: z114.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
51186
51276
|
/** Pipeline execution mode. */
|
|
51187
|
-
mode:
|
|
51277
|
+
mode: z114.enum(["autonomous", "harness"]).default("autonomous").describe(
|
|
51188
51278
|
"'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement."
|
|
51189
51279
|
),
|
|
51190
51280
|
/**
|
|
@@ -51195,15 +51285,15 @@ var DevPipelineInputSchema = z113.object({
|
|
|
51195
51285
|
* `get_job_result({ jobId })` for the result. Ignored when `dryRun` is
|
|
51196
51286
|
* true (plan+vote completes fast, so dry runs always stay sync).
|
|
51197
51287
|
*/
|
|
51198
|
-
dispatch:
|
|
51288
|
+
dispatch: z114.enum(["sync", "async"]).default("sync").describe(
|
|
51199
51289
|
"Dispatch mode (#3726). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
|
|
51200
51290
|
),
|
|
51201
51291
|
/** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
|
|
51202
|
-
qualityGate:
|
|
51292
|
+
qualityGate: z114.enum(["off", "advisory", "blocking"]).default("off").describe(
|
|
51203
51293
|
"Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
|
|
51204
51294
|
),
|
|
51205
51295
|
/** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
|
|
51206
|
-
maxBudgetTokens:
|
|
51296
|
+
maxBudgetTokens: z114.number().int().positive().optional().describe(
|
|
51207
51297
|
"Per-run token ceiling (#3395). When set, expert calls stop (returning failures) once cumulative usage crosses it \u2014 a hard-stop safety cap for unattended/multi-day runs. Omit to disable (default)."
|
|
51208
51298
|
)
|
|
51209
51299
|
});
|
|
@@ -51402,20 +51492,20 @@ function registerDevPipelineTool(server, deps) {
|
|
|
51402
51492
|
}
|
|
51403
51493
|
|
|
51404
51494
|
// src/mcp/tools/pipeline-tool.ts
|
|
51405
|
-
import { z as
|
|
51495
|
+
import { z as z115 } from "zod";
|
|
51406
51496
|
import * as fs12 from "fs";
|
|
51407
51497
|
import * as path11 from "path";
|
|
51408
51498
|
import { randomUUID as randomUUID16 } from "crypto";
|
|
51409
51499
|
var PIPELINE_ASYNC_HINT = "A full run_pipeline run can exceed the synchronous MCP request timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
|
|
51410
|
-
var PipelineInputSchema =
|
|
51500
|
+
var PipelineInputSchema = z115.object({
|
|
51411
51501
|
/** The task to execute. */
|
|
51412
|
-
task:
|
|
51502
|
+
task: z115.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
|
|
51413
51503
|
/** Path to a spec file (.md, .yaml) to use as task input. */
|
|
51414
|
-
specFile:
|
|
51504
|
+
specFile: z115.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
|
|
51415
51505
|
/** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
|
|
51416
|
-
template:
|
|
51506
|
+
template: z115.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
|
|
51417
51507
|
/** Voting strategy for consensus stages. */
|
|
51418
|
-
votingStrategy:
|
|
51508
|
+
votingStrategy: z115.enum([
|
|
51419
51509
|
"simple_majority",
|
|
51420
51510
|
"supermajority",
|
|
51421
51511
|
"unanimous",
|
|
@@ -51426,11 +51516,11 @@ var PipelineInputSchema = z114.object({
|
|
|
51426
51516
|
"Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
|
|
51427
51517
|
),
|
|
51428
51518
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
51429
|
-
quickMode:
|
|
51519
|
+
quickMode: z115.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
51430
51520
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
51431
|
-
timeoutMs:
|
|
51521
|
+
timeoutMs: z115.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
51432
51522
|
/** Stop after planning/voting (no implementation). */
|
|
51433
|
-
dryRun:
|
|
51523
|
+
dryRun: z115.boolean().default(false).describe("Stop after vote stage (no implementation)"),
|
|
51434
51524
|
/**
|
|
51435
51525
|
* Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
|
|
51436
51526
|
* returns the result — but a real multi-stage adaptive run can exceed the
|
|
@@ -51439,11 +51529,11 @@ var PipelineInputSchema = z114.object({
|
|
|
51439
51529
|
* `get_job_result({ jobId })` for the result. Ignored when `dryRun` is true
|
|
51440
51530
|
* (plan+vote completes fast, so dry runs always stay sync).
|
|
51441
51531
|
*/
|
|
51442
|
-
dispatch:
|
|
51532
|
+
dispatch: z115.enum(["sync", "async"]).default("sync").describe(
|
|
51443
51533
|
"Dispatch mode (#3730). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
|
|
51444
51534
|
),
|
|
51445
51535
|
/** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
|
|
51446
|
-
simulateVotes:
|
|
51536
|
+
simulateVotes: z115.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
|
|
51447
51537
|
});
|
|
51448
51538
|
function buildOutput3(result, simulated) {
|
|
51449
51539
|
return {
|
|
@@ -51608,9 +51698,9 @@ function registerPipelineTool(server, deps) {
|
|
|
51608
51698
|
}
|
|
51609
51699
|
|
|
51610
51700
|
// src/mcp/tools/run-tool.ts
|
|
51611
|
-
var RunInputSchema =
|
|
51612
|
-
goal:
|
|
51613
|
-
forceStrategy:
|
|
51701
|
+
var RunInputSchema = z116.object({
|
|
51702
|
+
goal: z116.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
|
|
51703
|
+
forceStrategy: z116.enum([
|
|
51614
51704
|
"single-shot",
|
|
51615
51705
|
"dev-pipeline",
|
|
51616
51706
|
"pipeline",
|
|
@@ -51622,10 +51712,10 @@ var RunInputSchema = z115.object({
|
|
|
51622
51712
|
]).optional().describe(
|
|
51623
51713
|
"Power-user override: force a specific strategy instead of letting the router choose."
|
|
51624
51714
|
),
|
|
51625
|
-
requiresConsensus:
|
|
51626
|
-
dependencyStructure:
|
|
51627
|
-
isNovel:
|
|
51628
|
-
execute:
|
|
51715
|
+
requiresConsensus: z116.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
|
|
51716
|
+
dependencyStructure: z116.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
|
|
51717
|
+
isNovel: z116.boolean().optional().describe("Hint: this kind of task has not been seen before."),
|
|
51718
|
+
execute: z116.boolean().optional().describe(
|
|
51629
51719
|
"When true, actually run the selected strategy (if an executor is wired) and return its result; otherwise return the routing decision only (default false, read-only)."
|
|
51630
51720
|
),
|
|
51631
51721
|
/**
|
|
@@ -51640,7 +51730,7 @@ var RunInputSchema = z115.object({
|
|
|
51640
51730
|
* other, the call is REFUSED rather than executed: silently ignoring a
|
|
51641
51731
|
* do-not-act flag is the one outcome a governance substrate cannot allow.
|
|
51642
51732
|
*/
|
|
51643
|
-
dryRun:
|
|
51733
|
+
dryRun: z116.boolean().optional().describe(
|
|
51644
51734
|
"Plan and vote only, no implementation (#4806). Requires the dev-pipeline strategy \u2014 refused (never silently executed) when the router selects another."
|
|
51645
51735
|
),
|
|
51646
51736
|
/**
|
|
@@ -51651,7 +51741,7 @@ var RunInputSchema = z115.object({
|
|
|
51651
51741
|
* envelope immediately and runs in the background; poll
|
|
51652
51742
|
* `get_job_result({ jobId })`. Ignored for read-only routing (execute:false).
|
|
51653
51743
|
*/
|
|
51654
|
-
dispatch:
|
|
51744
|
+
dispatch: z116.enum(["sync", "async"]).optional().describe(
|
|
51655
51745
|
"Dispatch mode (#3732). 'sync' (default): run inline. 'async' (only with execute:true): return a jobId immediately + run in background (poll get_job_result)."
|
|
51656
51746
|
)
|
|
51657
51747
|
});
|
|
@@ -51889,12 +51979,12 @@ function registerRunTool(server, deps) {
|
|
|
51889
51979
|
}
|
|
51890
51980
|
|
|
51891
51981
|
// src/mcp/tools/list-available-models-tool.ts
|
|
51892
|
-
import { z as
|
|
51982
|
+
import { z as z117 } from "zod";
|
|
51893
51983
|
var DESCRIPTION5 = "Probe every model-discovery transport (OpenRouter API + opencode/claude/codex/gemini CLIs) and report a per-transport health summary: probe ok/failed, model count, and a sample of ids. Use it to validate the CLIs and APIs are wired and reachable. Read-only; does not change routing.";
|
|
51894
51984
|
var PROBE_TIMEOUT_MS = 12e3;
|
|
51895
|
-
var ListAvailableModelsInputSchema =
|
|
51896
|
-
includeModelIds:
|
|
51897
|
-
includeOpenRouter:
|
|
51985
|
+
var ListAvailableModelsInputSchema = z117.object({
|
|
51986
|
+
includeModelIds: z117.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
51987
|
+
includeOpenRouter: z117.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
51898
51988
|
});
|
|
51899
51989
|
async function probeSource(source, includeModelIds) {
|
|
51900
51990
|
let timer;
|
|
@@ -51928,7 +52018,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
51928
52018
|
}
|
|
51929
52019
|
}
|
|
51930
52020
|
async function defaultSources(includeOpenRouter) {
|
|
51931
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
52021
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-RPWJNOET.js");
|
|
51932
52022
|
const adapters = createAllAdapters2();
|
|
51933
52023
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
51934
52024
|
}
|
|
@@ -51961,8 +52051,8 @@ async function listAvailableModelsHandler(args, deps, logger58) {
|
|
|
51961
52051
|
function registerListAvailableModelsTool(server, deps) {
|
|
51962
52052
|
const logger58 = deps.logger ?? createLogger({ tool: "list_available_models" });
|
|
51963
52053
|
const toolSchema = {
|
|
51964
|
-
includeModelIds:
|
|
51965
|
-
includeOpenRouter:
|
|
52054
|
+
includeModelIds: z117.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
52055
|
+
includeOpenRouter: z117.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
51966
52056
|
};
|
|
51967
52057
|
const secureHandler = createSecureHandler(
|
|
51968
52058
|
(args) => listAvailableModelsHandler(args, deps, logger58),
|
|
@@ -51986,7 +52076,7 @@ function registerListAvailableModelsTool(server, deps) {
|
|
|
51986
52076
|
}
|
|
51987
52077
|
|
|
51988
52078
|
// src/mcp/tools/pr-review-eval-types.ts
|
|
51989
|
-
import { z as
|
|
52079
|
+
import { z as z118 } from "zod";
|
|
51990
52080
|
var PR_REVIEW_EVAL_ROLES = [
|
|
51991
52081
|
"architect",
|
|
51992
52082
|
"security",
|
|
@@ -51994,43 +52084,43 @@ var PR_REVIEW_EVAL_ROLES = [
|
|
|
51994
52084
|
"catfish",
|
|
51995
52085
|
"scope_steward"
|
|
51996
52086
|
];
|
|
51997
|
-
var PrReviewEvalRoleSchema =
|
|
51998
|
-
var PrReviewCaseClassSchema =
|
|
51999
|
-
var VoterEvalVerdictSchema =
|
|
52087
|
+
var PrReviewEvalRoleSchema = z118.enum(PR_REVIEW_EVAL_ROLES);
|
|
52088
|
+
var PrReviewCaseClassSchema = z118.enum(["buggy", "clean", "borderline"]);
|
|
52089
|
+
var VoterEvalVerdictSchema = z118.object({
|
|
52000
52090
|
/** Stable record id (e.g. `${runId}:${caseNumber}:${role}`). */
|
|
52001
|
-
id:
|
|
52091
|
+
id: z118.string().min(1).max(160),
|
|
52002
52092
|
/** The pr_review run / batch this verdict belongs to. */
|
|
52003
|
-
runId:
|
|
52093
|
+
runId: z118.string().min(1).max(64),
|
|
52004
52094
|
/** Dataset case identifier (the dataset's `number` field). */
|
|
52005
|
-
caseNumber:
|
|
52095
|
+
caseNumber: z118.string().min(1).max(80),
|
|
52006
52096
|
/** Rubric class of the case (ground-truth label). */
|
|
52007
52097
|
caseClass: PrReviewCaseClassSchema,
|
|
52008
52098
|
/** The voter role being scored. */
|
|
52009
52099
|
role: PrReviewEvalRoleSchema,
|
|
52010
52100
|
/** Verified findings that matched a known bug. */
|
|
52011
|
-
truePositives:
|
|
52101
|
+
truePositives: z118.number().int().nonnegative(),
|
|
52012
52102
|
/** Verified findings on clean code that matched no known bug. */
|
|
52013
|
-
falsePositives:
|
|
52103
|
+
falsePositives: z118.number().int().nonnegative(),
|
|
52014
52104
|
/** Known bugs this voter failed to flag. */
|
|
52015
|
-
falseNegatives:
|
|
52105
|
+
falseNegatives: z118.number().int().nonnegative(),
|
|
52016
52106
|
/** Rubric version the ground truth was adjudicated under. */
|
|
52017
|
-
rubricVersion:
|
|
52107
|
+
rubricVersion: z118.string().min(1).max(32),
|
|
52018
52108
|
/** ISO-8601 timestamp the verdict was recorded. */
|
|
52019
|
-
timestamp:
|
|
52109
|
+
timestamp: z118.string().min(1).max(40)
|
|
52020
52110
|
});
|
|
52021
|
-
var VoterEvalVerdictQuerySchema =
|
|
52111
|
+
var VoterEvalVerdictQuerySchema = z118.object({
|
|
52022
52112
|
role: PrReviewEvalRoleSchema.optional(),
|
|
52023
|
-
runId:
|
|
52113
|
+
runId: z118.string().min(1).max(64).optional(),
|
|
52024
52114
|
caseClass: PrReviewCaseClassSchema.optional(),
|
|
52025
|
-
rubricVersion:
|
|
52115
|
+
rubricVersion: z118.string().min(1).max(32).optional(),
|
|
52026
52116
|
/** ISO-8601 lower bound (inclusive) on `timestamp`. */
|
|
52027
|
-
since:
|
|
52117
|
+
since: z118.string().optional(),
|
|
52028
52118
|
/** Most-recent-N cap. */
|
|
52029
|
-
limit:
|
|
52119
|
+
limit: z118.number().int().positive().optional()
|
|
52030
52120
|
});
|
|
52031
52121
|
|
|
52032
52122
|
// src/mcp/tools/supply-chain-tradeoff-panel.ts
|
|
52033
|
-
import { z as
|
|
52123
|
+
import { z as z119 } from "zod";
|
|
52034
52124
|
import { randomUUID as randomUUID18 } from "crypto";
|
|
52035
52125
|
var DEFAULT_AXES = [
|
|
52036
52126
|
"build_time_determinism",
|
|
@@ -52052,16 +52142,16 @@ var FULL_PANEL = [
|
|
|
52052
52142
|
"scope_steward"
|
|
52053
52143
|
];
|
|
52054
52144
|
var QUICK_PANEL = ["architect", "security", "scope_steward"];
|
|
52055
|
-
var SupplyChainTradeoffPanelInputSchema =
|
|
52056
|
-
proposal:
|
|
52057
|
-
axes:
|
|
52145
|
+
var SupplyChainTradeoffPanelInputSchema = z119.object({
|
|
52146
|
+
proposal: z119.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
|
|
52147
|
+
axes: z119.array(z119.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
|
|
52058
52148
|
`Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
|
|
52059
52149
|
),
|
|
52060
|
-
context:
|
|
52150
|
+
context: z119.string().max(MAX_CONTEXT_LENGTH).optional().describe(
|
|
52061
52151
|
"Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
|
|
52062
52152
|
),
|
|
52063
|
-
quickMode:
|
|
52064
|
-
simulate:
|
|
52153
|
+
quickMode: z119.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
|
|
52154
|
+
simulate: z119.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
|
|
52065
52155
|
/**
|
|
52066
52156
|
* Dispatch mode (#3731). `sync` (default) runs the panel inline and returns
|
|
52067
52157
|
* the result — but a live fan-out (up to 7 voters) can exceed the MCP request
|
|
@@ -52069,7 +52159,7 @@ var SupplyChainTradeoffPanelInputSchema = z118.object({
|
|
|
52069
52159
|
* immediately and runs the panel in the background; poll
|
|
52070
52160
|
* `get_job_result({ jobId })` for the result.
|
|
52071
52161
|
*/
|
|
52072
|
-
dispatch:
|
|
52162
|
+
dispatch: z119.enum(["sync", "async"]).default("sync").describe(
|
|
52073
52163
|
"Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
|
|
52074
52164
|
)
|
|
52075
52165
|
});
|
|
@@ -52547,40 +52637,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
|
|
|
52547
52637
|
})(RiskLevel || {});
|
|
52548
52638
|
|
|
52549
52639
|
// src/mcp/safety/stpa-schemas.ts
|
|
52550
|
-
import { z as
|
|
52551
|
-
var HazardCategorySchema =
|
|
52552
|
-
var HazardSeveritySchema =
|
|
52553
|
-
var ConstraintPrioritySchema =
|
|
52554
|
-
var RiskLevelSchema =
|
|
52555
|
-
var TriggerPatternSchema =
|
|
52556
|
-
parameter:
|
|
52557
|
-
matchType:
|
|
52558
|
-
pattern:
|
|
52559
|
-
reason:
|
|
52560
|
-
});
|
|
52561
|
-
var HazardSchema =
|
|
52562
|
-
id:
|
|
52563
|
-
description:
|
|
52640
|
+
import { z as z120 } from "zod";
|
|
52641
|
+
var HazardCategorySchema = z120.enum(HazardCategory);
|
|
52642
|
+
var HazardSeveritySchema = z120.enum(HazardSeverity);
|
|
52643
|
+
var ConstraintPrioritySchema = z120.enum(ConstraintPriority);
|
|
52644
|
+
var RiskLevelSchema = z120.enum(RiskLevel);
|
|
52645
|
+
var TriggerPatternSchema = z120.object({
|
|
52646
|
+
parameter: z120.string().min(1),
|
|
52647
|
+
matchType: z120.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
|
|
52648
|
+
pattern: z120.string(),
|
|
52649
|
+
reason: z120.string()
|
|
52650
|
+
});
|
|
52651
|
+
var HazardSchema = z120.object({
|
|
52652
|
+
id: z120.string().min(1),
|
|
52653
|
+
description: z120.string(),
|
|
52564
52654
|
category: HazardCategorySchema,
|
|
52565
52655
|
severity: HazardSeveritySchema,
|
|
52566
|
-
likelihood:
|
|
52567
|
-
triggerConditions:
|
|
52568
|
-
consequences:
|
|
52569
|
-
});
|
|
52570
|
-
var UnsafeControlActionSchema =
|
|
52571
|
-
id:
|
|
52572
|
-
toolName:
|
|
52573
|
-
type:
|
|
52574
|
-
description:
|
|
52575
|
-
unsafeContext:
|
|
52576
|
-
relatedHazards:
|
|
52577
|
-
triggerPatterns:
|
|
52578
|
-
});
|
|
52579
|
-
var SafetyConstraintSchema =
|
|
52580
|
-
id:
|
|
52581
|
-
description:
|
|
52582
|
-
mitigates:
|
|
52583
|
-
enforcement:
|
|
52656
|
+
likelihood: z120.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
|
|
52657
|
+
triggerConditions: z120.array(z120.string()),
|
|
52658
|
+
consequences: z120.array(z120.string())
|
|
52659
|
+
});
|
|
52660
|
+
var UnsafeControlActionSchema = z120.object({
|
|
52661
|
+
id: z120.string().min(1),
|
|
52662
|
+
toolName: z120.string().min(1),
|
|
52663
|
+
type: z120.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
|
|
52664
|
+
description: z120.string(),
|
|
52665
|
+
unsafeContext: z120.string(),
|
|
52666
|
+
relatedHazards: z120.array(z120.string()),
|
|
52667
|
+
triggerPatterns: z120.array(TriggerPatternSchema).optional()
|
|
52668
|
+
});
|
|
52669
|
+
var SafetyConstraintSchema = z120.object({
|
|
52670
|
+
id: z120.string().min(1),
|
|
52671
|
+
description: z120.string(),
|
|
52672
|
+
mitigates: z120.array(z120.string()),
|
|
52673
|
+
enforcement: z120.enum([
|
|
52584
52674
|
"prevent",
|
|
52585
52675
|
"require_confirmation",
|
|
52586
52676
|
"alert",
|
|
@@ -52588,52 +52678,52 @@ var SafetyConstraintSchema = z119.object({
|
|
|
52588
52678
|
"rate_limit",
|
|
52589
52679
|
"require_privilege"
|
|
52590
52680
|
]),
|
|
52591
|
-
validationFunction:
|
|
52681
|
+
validationFunction: z120.string().optional(),
|
|
52592
52682
|
priority: ConstraintPrioritySchema
|
|
52593
52683
|
});
|
|
52594
|
-
var PropertySchemaSchema =
|
|
52595
|
-
type:
|
|
52596
|
-
description:
|
|
52597
|
-
enum:
|
|
52598
|
-
pattern:
|
|
52599
|
-
minimum:
|
|
52600
|
-
maximum:
|
|
52601
|
-
});
|
|
52602
|
-
var ToolInputSchemaSchema =
|
|
52603
|
-
type:
|
|
52604
|
-
properties:
|
|
52605
|
-
required:
|
|
52606
|
-
additionalProperties:
|
|
52607
|
-
});
|
|
52608
|
-
var ToolDefinitionSchema =
|
|
52609
|
-
name:
|
|
52610
|
-
description:
|
|
52684
|
+
var PropertySchemaSchema = z120.object({
|
|
52685
|
+
type: z120.string(),
|
|
52686
|
+
description: z120.string().optional(),
|
|
52687
|
+
enum: z120.array(z120.unknown()).optional(),
|
|
52688
|
+
pattern: z120.string().optional(),
|
|
52689
|
+
minimum: z120.number().optional(),
|
|
52690
|
+
maximum: z120.number().optional()
|
|
52691
|
+
});
|
|
52692
|
+
var ToolInputSchemaSchema = z120.object({
|
|
52693
|
+
type: z120.string(),
|
|
52694
|
+
properties: z120.record(z120.string(), PropertySchemaSchema).optional(),
|
|
52695
|
+
required: z120.array(z120.string()).optional(),
|
|
52696
|
+
additionalProperties: z120.boolean().optional()
|
|
52697
|
+
});
|
|
52698
|
+
var ToolDefinitionSchema = z120.object({
|
|
52699
|
+
name: z120.string().min(1),
|
|
52700
|
+
description: z120.string(),
|
|
52611
52701
|
inputSchema: ToolInputSchemaSchema
|
|
52612
52702
|
});
|
|
52613
|
-
var AnalysisConfigurationSchema =
|
|
52614
|
-
includeLowSeverity:
|
|
52615
|
-
generateAllConstraints:
|
|
52616
|
-
checkInteractions:
|
|
52617
|
-
maxHazardsPerTool:
|
|
52618
|
-
categories:
|
|
52703
|
+
var AnalysisConfigurationSchema = z120.object({
|
|
52704
|
+
includeLowSeverity: z120.boolean().default(true),
|
|
52705
|
+
generateAllConstraints: z120.boolean().default(true),
|
|
52706
|
+
checkInteractions: z120.boolean().default(true),
|
|
52707
|
+
maxHazardsPerTool: z120.number().int().min(1).max(100).default(50),
|
|
52708
|
+
categories: z120.array(HazardCategorySchema).default([])
|
|
52619
52709
|
});
|
|
52620
|
-
var ConstraintViolationSchema =
|
|
52621
|
-
constraintId:
|
|
52622
|
-
constraintDescription:
|
|
52710
|
+
var ConstraintViolationSchema = z120.object({
|
|
52711
|
+
constraintId: z120.string().min(1),
|
|
52712
|
+
constraintDescription: z120.string(),
|
|
52623
52713
|
severity: HazardSeveritySchema,
|
|
52624
|
-
details:
|
|
52625
|
-
remediation:
|
|
52626
|
-
});
|
|
52627
|
-
var ValidationWarningSchema =
|
|
52628
|
-
code:
|
|
52629
|
-
message:
|
|
52630
|
-
affected:
|
|
52631
|
-
});
|
|
52632
|
-
var ValidationResultSchema =
|
|
52633
|
-
valid:
|
|
52634
|
-
toolName:
|
|
52635
|
-
violations:
|
|
52636
|
-
passed:
|
|
52714
|
+
details: z120.string(),
|
|
52715
|
+
remediation: z120.string()
|
|
52716
|
+
});
|
|
52717
|
+
var ValidationWarningSchema = z120.object({
|
|
52718
|
+
code: z120.string().min(1),
|
|
52719
|
+
message: z120.string(),
|
|
52720
|
+
affected: z120.string()
|
|
52721
|
+
});
|
|
52722
|
+
var ValidationResultSchema = z120.object({
|
|
52723
|
+
valid: z120.boolean(),
|
|
52724
|
+
toolName: z120.string().min(1),
|
|
52725
|
+
violations: z120.array(ConstraintViolationSchema),
|
|
52726
|
+
passed: z120.array(z120.string()),
|
|
52637
52727
|
// Optional rather than required, deliberately. `ValidationResult` declares
|
|
52638
52728
|
// both fields required because every result this package produces has them;
|
|
52639
52729
|
// the schema is the lenient inbound edge for a result that arrived from
|
|
@@ -52644,10 +52734,10 @@ var ValidationResultSchema = z119.object({
|
|
|
52644
52734
|
// "nothing was evaluated". The strict/lenient split is safe because nothing
|
|
52645
52735
|
// bridges the two with `z.infer`: a parsed result will not typecheck as a
|
|
52646
52736
|
// `ValidationResult` without handling the absent fields.
|
|
52647
|
-
evaluated:
|
|
52648
|
-
notApplicable:
|
|
52649
|
-
warnings:
|
|
52650
|
-
validatedAt:
|
|
52737
|
+
evaluated: z120.array(z120.string()).optional(),
|
|
52738
|
+
notApplicable: z120.array(z120.string()).optional(),
|
|
52739
|
+
warnings: z120.array(ValidationWarningSchema),
|
|
52740
|
+
validatedAt: z120.date()
|
|
52651
52741
|
});
|
|
52652
52742
|
|
|
52653
52743
|
// src/mcp/safety/stpa-types.ts
|
|
@@ -53732,42 +53822,42 @@ var GeminiResponseParser = class {
|
|
|
53732
53822
|
};
|
|
53733
53823
|
|
|
53734
53824
|
// src/cli-adapters/router-types.ts
|
|
53735
|
-
import { z as
|
|
53736
|
-
var RouterConfigSchema =
|
|
53737
|
-
preferCostEfficient:
|
|
53738
|
-
maxDecisionTimeMs:
|
|
53825
|
+
import { z as z121 } from "zod";
|
|
53826
|
+
var RouterConfigSchema = z121.object({
|
|
53827
|
+
preferCostEfficient: z121.boolean().default(false),
|
|
53828
|
+
maxDecisionTimeMs: z121.number().min(1).max(1e3).default(100)
|
|
53739
53829
|
});
|
|
53740
53830
|
|
|
53741
53831
|
// src/cli-adapters/agreement-cascade-types.ts
|
|
53742
|
-
import { z as
|
|
53743
|
-
var AgreementCascadeConfigSchema =
|
|
53744
|
-
agreementThreshold:
|
|
53745
|
-
maxStages:
|
|
53746
|
-
modelTimeoutMs:
|
|
53832
|
+
import { z as z122 } from "zod";
|
|
53833
|
+
var AgreementCascadeConfigSchema = z122.object({
|
|
53834
|
+
agreementThreshold: z122.number().min(0.5).max(1).default(0.7),
|
|
53835
|
+
maxStages: z122.number().int().min(1).max(5).default(3),
|
|
53836
|
+
modelTimeoutMs: z122.number().int().min(1e3).max(3e5).default(6e4)
|
|
53747
53837
|
});
|
|
53748
53838
|
|
|
53749
53839
|
// src/cli-adapters/agreement-cascade-router.ts
|
|
53750
53840
|
var logger50 = createLogger({ component: "agreement-cascade-router" });
|
|
53751
53841
|
|
|
53752
53842
|
// src/cli-adapters/task-classifier.ts
|
|
53753
|
-
import { z as
|
|
53754
|
-
var ClassificationPatternsSchema =
|
|
53755
|
-
code:
|
|
53756
|
-
research:
|
|
53757
|
-
documentation:
|
|
53758
|
-
analysis:
|
|
53843
|
+
import { z as z123 } from "zod";
|
|
53844
|
+
var ClassificationPatternsSchema = z123.object({
|
|
53845
|
+
code: z123.array(z123.string()).readonly(),
|
|
53846
|
+
research: z123.array(z123.string()).readonly(),
|
|
53847
|
+
documentation: z123.array(z123.string()).readonly(),
|
|
53848
|
+
analysis: z123.array(z123.string()).readonly()
|
|
53759
53849
|
});
|
|
53760
53850
|
|
|
53761
53851
|
// src/cli-adapters/response-cache-types.ts
|
|
53762
|
-
import { z as
|
|
53763
|
-
var ResponseCacheConfigSchema =
|
|
53764
|
-
defaultTTL:
|
|
53852
|
+
import { z as z124 } from "zod";
|
|
53853
|
+
var ResponseCacheConfigSchema = z124.object({
|
|
53854
|
+
defaultTTL: z124.number().min(1e3).max(36e5).default(3e5),
|
|
53765
53855
|
// 5 minutes
|
|
53766
|
-
maxEntries:
|
|
53767
|
-
maxMemoryMB:
|
|
53768
|
-
cleanupInterval:
|
|
53856
|
+
maxEntries: z124.number().min(10).max(1e5).default(1e3),
|
|
53857
|
+
maxMemoryMB: z124.number().min(1).max(1e3).default(50),
|
|
53858
|
+
cleanupInterval: z124.number().min(1e3).max(6e5).default(6e4),
|
|
53769
53859
|
// 1 minute
|
|
53770
|
-
enableLogging:
|
|
53860
|
+
enableLogging: z124.boolean().default(false)
|
|
53771
53861
|
});
|
|
53772
53862
|
|
|
53773
53863
|
// src/cli-adapters/response-cache-utils.ts
|
|
@@ -53775,12 +53865,12 @@ import { createHash as createHash6 } from "crypto";
|
|
|
53775
53865
|
var logger51 = createLogger({ component: "ResponseCacheUtils" });
|
|
53776
53866
|
|
|
53777
53867
|
// src/cli-adapters/unified-routing-types.ts
|
|
53778
|
-
import { z as
|
|
53779
|
-
var UnifiedRoutingDecisionSchema =
|
|
53780
|
-
selectedCli:
|
|
53781
|
-
confidence:
|
|
53782
|
-
reason:
|
|
53783
|
-
strategy:
|
|
53868
|
+
import { z as z125 } from "zod";
|
|
53869
|
+
var UnifiedRoutingDecisionSchema = z125.object({
|
|
53870
|
+
selectedCli: z125.string(),
|
|
53871
|
+
confidence: z125.number().min(0).max(1),
|
|
53872
|
+
reason: z125.string(),
|
|
53873
|
+
strategy: z125.enum([
|
|
53784
53874
|
"composite",
|
|
53785
53875
|
"quality",
|
|
53786
53876
|
"budget",
|
|
@@ -53792,57 +53882,57 @@ var UnifiedRoutingDecisionSchema = z124.object({
|
|
|
53792
53882
|
"linucb",
|
|
53793
53883
|
"direct"
|
|
53794
53884
|
]),
|
|
53795
|
-
decisionTimeMs:
|
|
53796
|
-
alternatives:
|
|
53797
|
-
stagesExecuted:
|
|
53798
|
-
withinBudget:
|
|
53799
|
-
estimatedComplexity:
|
|
53800
|
-
estimatedTokens:
|
|
53801
|
-
topsisScore:
|
|
53802
|
-
ucbScore:
|
|
53803
|
-
resolvedAtStage:
|
|
53804
|
-
consensusReached:
|
|
53805
|
-
agreementScore:
|
|
53806
|
-
metadata:
|
|
53885
|
+
decisionTimeMs: z125.number().nonnegative(),
|
|
53886
|
+
alternatives: z125.array(z125.string()).readonly(),
|
|
53887
|
+
stagesExecuted: z125.array(z125.string()).readonly(),
|
|
53888
|
+
withinBudget: z125.boolean().optional(),
|
|
53889
|
+
estimatedComplexity: z125.enum(["simple", "moderate", "complex", "expert"]).optional(),
|
|
53890
|
+
estimatedTokens: z125.number().int().positive().optional(),
|
|
53891
|
+
topsisScore: z125.number().optional(),
|
|
53892
|
+
ucbScore: z125.number().optional(),
|
|
53893
|
+
resolvedAtStage: z125.number().int().nonnegative().optional(),
|
|
53894
|
+
consensusReached: z125.boolean().optional(),
|
|
53895
|
+
agreementScore: z125.number().min(0).max(1).optional(),
|
|
53896
|
+
metadata: z125.record(z125.string(), z125.unknown()).optional()
|
|
53807
53897
|
});
|
|
53808
53898
|
|
|
53809
53899
|
// src/learning/outcome-feedback-types.ts
|
|
53810
|
-
import { z as
|
|
53811
|
-
var QualitySignalsSchema =
|
|
53812
|
-
testsPass:
|
|
53813
|
-
lintErrors:
|
|
53814
|
-
userApproved:
|
|
53815
|
-
retryCount:
|
|
53816
|
-
completionRatio:
|
|
53817
|
-
validStructure:
|
|
53818
|
-
coherenceScore:
|
|
53819
|
-
});
|
|
53820
|
-
var RoutingDecisionSchema =
|
|
53821
|
-
id:
|
|
53822
|
-
timestamp:
|
|
53823
|
-
query:
|
|
53824
|
-
routerType:
|
|
53825
|
-
selectedModel:
|
|
53826
|
-
selectedTier:
|
|
53827
|
-
armIndex:
|
|
53828
|
-
banditContext:
|
|
53829
|
-
queryFeatures:
|
|
53830
|
-
ucbScore:
|
|
53831
|
-
confidence:
|
|
53832
|
-
traceId:
|
|
53833
|
-
domain:
|
|
53834
|
-
});
|
|
53835
|
-
var TaskOutcomeSchema =
|
|
53836
|
-
routingDecisionId:
|
|
53837
|
-
timestamp:
|
|
53838
|
-
outcomeClass:
|
|
53839
|
-
success:
|
|
53840
|
-
qualityScore:
|
|
53841
|
-
durationMs:
|
|
53842
|
-
tokenUsage:
|
|
53843
|
-
errorMessage:
|
|
53900
|
+
import { z as z126 } from "zod";
|
|
53901
|
+
var QualitySignalsSchema = z126.object({
|
|
53902
|
+
testsPass: z126.boolean().optional(),
|
|
53903
|
+
lintErrors: z126.number().int().min(0).optional(),
|
|
53904
|
+
userApproved: z126.boolean().optional(),
|
|
53905
|
+
retryCount: z126.number().int().min(0).default(0),
|
|
53906
|
+
completionRatio: z126.number().min(0).max(1).default(1),
|
|
53907
|
+
validStructure: z126.boolean().optional(),
|
|
53908
|
+
coherenceScore: z126.number().min(0).max(1).optional()
|
|
53909
|
+
});
|
|
53910
|
+
var RoutingDecisionSchema = z126.object({
|
|
53911
|
+
id: z126.uuid(),
|
|
53912
|
+
timestamp: z126.iso.datetime(),
|
|
53913
|
+
query: z126.string(),
|
|
53914
|
+
routerType: z126.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
|
|
53915
|
+
selectedModel: z126.string(),
|
|
53916
|
+
selectedTier: z126.enum(["strong", "weak"]).optional(),
|
|
53917
|
+
armIndex: z126.number().int().min(0).optional(),
|
|
53918
|
+
banditContext: z126.record(z126.string(), z126.unknown()).optional(),
|
|
53919
|
+
queryFeatures: z126.record(z126.string(), z126.unknown()).optional(),
|
|
53920
|
+
ucbScore: z126.number().optional(),
|
|
53921
|
+
confidence: z126.number().min(0).max(1).optional(),
|
|
53922
|
+
traceId: z126.string(),
|
|
53923
|
+
domain: z126.string().optional()
|
|
53924
|
+
});
|
|
53925
|
+
var TaskOutcomeSchema = z126.object({
|
|
53926
|
+
routingDecisionId: z126.uuid(),
|
|
53927
|
+
timestamp: z126.iso.datetime(),
|
|
53928
|
+
outcomeClass: z126.enum(["success", "partial", "failure", "timeout", "error"]),
|
|
53929
|
+
success: z126.boolean(),
|
|
53930
|
+
qualityScore: z126.number().min(0).max(1),
|
|
53931
|
+
durationMs: z126.number().min(0),
|
|
53932
|
+
tokenUsage: z126.number().int().min(0),
|
|
53933
|
+
errorMessage: z126.string().optional(),
|
|
53844
53934
|
qualitySignals: QualitySignalsSchema,
|
|
53845
|
-
traceId:
|
|
53935
|
+
traceId: z126.string()
|
|
53846
53936
|
});
|
|
53847
53937
|
var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
53848
53938
|
maxPendingDecisions: 1e3,
|
|
@@ -53857,17 +53947,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
|
53857
53947
|
targetTokenUsage: 2e3,
|
|
53858
53948
|
maxHistorySize: 1e4
|
|
53859
53949
|
};
|
|
53860
|
-
var FeedbackCollectorConfigSchema =
|
|
53861
|
-
maxPendingDecisions:
|
|
53862
|
-
pendingTimeoutMs:
|
|
53863
|
-
enableAutoReward:
|
|
53864
|
-
qualityWeight:
|
|
53865
|
-
speedWeight:
|
|
53866
|
-
efficiencyWeight:
|
|
53867
|
-
retryPenalty:
|
|
53868
|
-
targetDurationMs:
|
|
53869
|
-
targetTokenUsage:
|
|
53870
|
-
maxHistorySize:
|
|
53950
|
+
var FeedbackCollectorConfigSchema = z126.object({
|
|
53951
|
+
maxPendingDecisions: z126.number().int().positive().default(1e3),
|
|
53952
|
+
pendingTimeoutMs: z126.number().positive().default(3e5),
|
|
53953
|
+
enableAutoReward: z126.boolean().default(true),
|
|
53954
|
+
qualityWeight: z126.number().min(0).max(1).default(0.5),
|
|
53955
|
+
speedWeight: z126.number().min(0).max(1).default(0.2),
|
|
53956
|
+
efficiencyWeight: z126.number().min(0).max(1).default(0.2),
|
|
53957
|
+
retryPenalty: z126.number().min(0).max(1).default(0.1),
|
|
53958
|
+
targetDurationMs: z126.number().positive().default(5e3),
|
|
53959
|
+
targetTokenUsage: z126.number().positive().default(2e3),
|
|
53960
|
+
maxHistorySize: z126.number().int().positive().default(1e4)
|
|
53871
53961
|
});
|
|
53872
53962
|
|
|
53873
53963
|
// src/learning/outcome-feedback-helpers.ts
|
|
@@ -56000,4 +56090,4 @@ export {
|
|
|
56000
56090
|
shutdownFeedbackSubscriber,
|
|
56001
56091
|
createEventBusBridge
|
|
56002
56092
|
};
|
|
56003
|
-
//# sourceMappingURL=chunk-
|
|
56093
|
+
//# sourceMappingURL=chunk-KXQYRZ3X.js.map
|