nexus-agents 8.63.0 → 8.63.2
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/{ast-rule-runner-BJYXY6R7.js → ast-rule-runner-OVEWJ4VI.js} +5 -5
- package/dist/{child-mcp-config-SPLQ6PUA.js → child-mcp-config-PCZKX4SI.js} +5 -5
- package/dist/{chunk-NFM6UHLJ.js → chunk-3X7U2LTF.js} +7 -7
- package/dist/{chunk-MTYJPPIG.js → chunk-4UHDDCRB.js} +2 -2
- package/dist/{chunk-YA7LV26Z.js → chunk-53HQP5UY.js} +2 -2
- package/dist/{chunk-IT7QW2UK.js → chunk-666BO45M.js} +10 -10
- package/dist/{chunk-ED3NOBP4.js → chunk-6RTJNYWK.js} +4 -4
- package/dist/{chunk-4ZXXHD34.js → chunk-6ZTPCRTD.js} +6 -6
- package/dist/{chunk-IGERXSCP.js → chunk-ACYV6HIF.js} +2 -2
- package/dist/{chunk-HVX5KC47.js → chunk-AD6FWKAO.js} +2 -2
- package/dist/{chunk-T6AREZER.js → chunk-AFBIOXNN.js} +5 -5
- package/dist/{chunk-QH53RCQ6.js → chunk-AFJXMJCJ.js} +3 -3
- package/dist/{chunk-4D5WBVZF.js → chunk-BPUYQPXF.js} +11 -11
- package/dist/{chunk-2U4GUQZQ.js → chunk-DZPAS2KT.js} +4 -4
- package/dist/{chunk-PNNJT6HR.js → chunk-G3WPIB2G.js} +2 -2
- package/dist/{chunk-T46RV7Y7.js → chunk-HERI7LXN.js} +2 -2
- package/dist/{chunk-Y367HRJV.js → chunk-HILODAJL.js} +3 -7
- package/dist/chunk-HILODAJL.js.map +1 -0
- package/dist/{chunk-6A6XOOYD.js → chunk-IKCULJYU.js} +3 -3
- package/dist/{chunk-AW6RARII.js → chunk-JRRAM2VZ.js} +2 -2
- package/dist/{chunk-JLIACIKN.js → chunk-L6F6N72F.js} +3 -3
- package/dist/{chunk-QPNOKY7U.js → chunk-OF4P5LQP.js} +2 -2
- package/dist/{chunk-DFEWV5HW.js → chunk-OFE2AQ4I.js} +5 -5
- package/dist/{chunk-PFSMPJKU.js → chunk-PEZRHADK.js} +2 -2
- package/dist/{chunk-F4OGKWX2.js → chunk-PQW42FX7.js} +2 -2
- package/dist/{chunk-2TJUC7OA.js → chunk-QLQUJLG3.js} +2 -2
- package/dist/{chunk-L5F67JWD.js → chunk-QTQKNZEP.js} +4 -4
- package/dist/{chunk-YKRMWZCX.js → chunk-QUWE3DRV.js} +2 -2
- package/dist/{chunk-D6ZN3IUC.js → chunk-R22LXCDU.js} +2 -2
- package/dist/{chunk-HBG5RYZ6.js → chunk-RK4YSKMS.js} +2 -2
- package/dist/{chunk-M26JTGBL.js → chunk-RKLT2TOT.js} +2 -2
- package/dist/{chunk-BTYRPZON.js → chunk-RNDHNRSX.js} +1 -33
- package/dist/chunk-RNDHNRSX.js.map +1 -0
- package/dist/{chunk-GGJRBO2C.js → chunk-SIAO7EFE.js} +6 -6
- package/dist/{chunk-A4JMZPCE.js → chunk-SYBTBLHP.js} +3 -3
- package/dist/{chunk-AJ7P4SID.js → chunk-TGYLZFU5.js} +4 -4
- package/dist/{chunk-ZOOM6I4A.js → chunk-TLYEHGIR.js} +7 -7
- package/dist/{chunk-VSVEWA7S.js → chunk-TZKXFJSF.js} +1093 -956
- package/dist/chunk-TZKXFJSF.js.map +1 -0
- package/dist/{chunk-XC3ZVY6S.js → chunk-U5KCGQ2Q.js} +2 -2
- package/dist/{chunk-E7JSXW5T.js → chunk-UJ5GVU2H.js} +2 -2
- package/dist/{chunk-VXZ4GHO6.js → chunk-VAMOJV55.js} +2 -2
- package/dist/{chunk-Q2ZBQQGY.js → chunk-Y466OQB2.js} +12 -12
- package/dist/{cli-circuit-breaker-DFRIRUQR.js → cli-circuit-breaker-T45NKZ35.js} +5 -5
- package/dist/cli.js +47 -47
- package/dist/{composite-router-66ZX2IG2.js → composite-router-7ARVOZRF.js} +4 -4
- package/dist/{consensus-vote-MYFV4X75.js → consensus-vote-OL7DLZNL.js} +20 -20
- package/dist/{context-retriever-WT67DEQE.js → context-retriever-BITYWLA2.js} +11 -11
- package/dist/doctor-deep-YNKNSQDO.js +13 -0
- package/dist/{doctor-live-HP2F44US.js → doctor-live-O5HUL4CE.js} +13 -13
- package/dist/{expert-bridge-WS4DCMUU.js → expert-bridge-25V5Z5NH.js} +6 -6
- package/dist/factory-AKKNZQRC.js +15 -0
- package/dist/factory-KKA2PEK4.js +25 -0
- package/dist/{improvement-review-2M2PL57A.js → improvement-review-UZ4MFHY6.js} +7 -7
- package/dist/index.js +35 -35
- package/dist/{init-opencode-E3235NXT.js → init-opencode-RLWDLWUC.js} +8 -8
- package/dist/issue-triage-LOTZZAOQ.js +16 -0
- package/dist/{learning-persistence-TQJVPLDN.js → learning-persistence-DDCQTBPS.js} +3 -3
- package/dist/{pr-reviewer-helpers-WXTZ5KRF.js → pr-reviewer-helpers-MDMJY3AJ.js} +6 -6
- package/dist/{registry-command-ODE62JQ6.js → registry-command-BDXLCM4D.js} +4 -4
- package/dist/{repo-security-plan-DF5MQUT7.js → repo-security-plan-55ZTF2TY.js} +5 -5
- package/dist/research-helpers-synthesize-L2HNQK7U.js +14 -0
- package/dist/{routing-memory-S4VNNGX2.js → routing-memory-LDELNOBJ.js} +4 -4
- package/dist/{session-memory-NZEGTYE7.js → session-memory-FW3BL34A.js} +5 -5
- package/dist/setup-config-ZTACUOJK.js +11 -0
- package/dist/{setup-custom-api-VW3ARY6H.js → setup-custom-api-E3IK7DZH.js} +6 -6
- package/dist/setup-data-dir-MYGXBT4E.js +31 -0
- package/dist/{tool-memory-HXLN4JH4.js → tool-memory-SOAZGLTG.js} +8 -8
- package/dist/{tool-memory-registry-adapters-ATMDGO4D.js → tool-memory-registry-adapters-IAYV4SBV.js} +3 -3
- package/dist/unified-registry-GPWSJDGN.js +28 -0
- package/dist/{weather-report-ZDHE4KN5.js → weather-report-BIJSJ5WH.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-BTYRPZON.js.map +0 -1
- package/dist/chunk-VSVEWA7S.js.map +0 -1
- package/dist/chunk-Y367HRJV.js.map +0 -1
- package/dist/doctor-deep-GMEIKBEF.js +0 -13
- package/dist/factory-LCNX522I.js +0 -25
- package/dist/factory-NMBGSHSQ.js +0 -15
- package/dist/issue-triage-M26H4XSG.js +0 -16
- package/dist/research-helpers-synthesize-DNEQZ56K.js +0 -14
- package/dist/setup-config-OOS7USYV.js +0 -11
- package/dist/setup-data-dir-TODDUZIO.js +0 -31
- package/dist/unified-registry-UYD65GIO.js +0 -28
- /package/dist/{ast-rule-runner-BJYXY6R7.js.map → ast-rule-runner-OVEWJ4VI.js.map} +0 -0
- /package/dist/{child-mcp-config-SPLQ6PUA.js.map → child-mcp-config-PCZKX4SI.js.map} +0 -0
- /package/dist/{chunk-NFM6UHLJ.js.map → chunk-3X7U2LTF.js.map} +0 -0
- /package/dist/{chunk-MTYJPPIG.js.map → chunk-4UHDDCRB.js.map} +0 -0
- /package/dist/{chunk-YA7LV26Z.js.map → chunk-53HQP5UY.js.map} +0 -0
- /package/dist/{chunk-IT7QW2UK.js.map → chunk-666BO45M.js.map} +0 -0
- /package/dist/{chunk-ED3NOBP4.js.map → chunk-6RTJNYWK.js.map} +0 -0
- /package/dist/{chunk-4ZXXHD34.js.map → chunk-6ZTPCRTD.js.map} +0 -0
- /package/dist/{chunk-IGERXSCP.js.map → chunk-ACYV6HIF.js.map} +0 -0
- /package/dist/{chunk-HVX5KC47.js.map → chunk-AD6FWKAO.js.map} +0 -0
- /package/dist/{chunk-T6AREZER.js.map → chunk-AFBIOXNN.js.map} +0 -0
- /package/dist/{chunk-QH53RCQ6.js.map → chunk-AFJXMJCJ.js.map} +0 -0
- /package/dist/{chunk-4D5WBVZF.js.map → chunk-BPUYQPXF.js.map} +0 -0
- /package/dist/{chunk-2U4GUQZQ.js.map → chunk-DZPAS2KT.js.map} +0 -0
- /package/dist/{chunk-PNNJT6HR.js.map → chunk-G3WPIB2G.js.map} +0 -0
- /package/dist/{chunk-T46RV7Y7.js.map → chunk-HERI7LXN.js.map} +0 -0
- /package/dist/{chunk-6A6XOOYD.js.map → chunk-IKCULJYU.js.map} +0 -0
- /package/dist/{chunk-AW6RARII.js.map → chunk-JRRAM2VZ.js.map} +0 -0
- /package/dist/{chunk-JLIACIKN.js.map → chunk-L6F6N72F.js.map} +0 -0
- /package/dist/{chunk-QPNOKY7U.js.map → chunk-OF4P5LQP.js.map} +0 -0
- /package/dist/{chunk-DFEWV5HW.js.map → chunk-OFE2AQ4I.js.map} +0 -0
- /package/dist/{chunk-PFSMPJKU.js.map → chunk-PEZRHADK.js.map} +0 -0
- /package/dist/{chunk-F4OGKWX2.js.map → chunk-PQW42FX7.js.map} +0 -0
- /package/dist/{chunk-2TJUC7OA.js.map → chunk-QLQUJLG3.js.map} +0 -0
- /package/dist/{chunk-L5F67JWD.js.map → chunk-QTQKNZEP.js.map} +0 -0
- /package/dist/{chunk-YKRMWZCX.js.map → chunk-QUWE3DRV.js.map} +0 -0
- /package/dist/{chunk-D6ZN3IUC.js.map → chunk-R22LXCDU.js.map} +0 -0
- /package/dist/{chunk-HBG5RYZ6.js.map → chunk-RK4YSKMS.js.map} +0 -0
- /package/dist/{chunk-M26JTGBL.js.map → chunk-RKLT2TOT.js.map} +0 -0
- /package/dist/{chunk-GGJRBO2C.js.map → chunk-SIAO7EFE.js.map} +0 -0
- /package/dist/{chunk-A4JMZPCE.js.map → chunk-SYBTBLHP.js.map} +0 -0
- /package/dist/{chunk-AJ7P4SID.js.map → chunk-TGYLZFU5.js.map} +0 -0
- /package/dist/{chunk-ZOOM6I4A.js.map → chunk-TLYEHGIR.js.map} +0 -0
- /package/dist/{chunk-XC3ZVY6S.js.map → chunk-U5KCGQ2Q.js.map} +0 -0
- /package/dist/{chunk-E7JSXW5T.js.map → chunk-UJ5GVU2H.js.map} +0 -0
- /package/dist/{chunk-VXZ4GHO6.js.map → chunk-VAMOJV55.js.map} +0 -0
- /package/dist/{chunk-Q2ZBQQGY.js.map → chunk-Y466OQB2.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-DFRIRUQR.js.map → cli-circuit-breaker-T45NKZ35.js.map} +0 -0
- /package/dist/{composite-router-66ZX2IG2.js.map → composite-router-7ARVOZRF.js.map} +0 -0
- /package/dist/{consensus-vote-MYFV4X75.js.map → consensus-vote-OL7DLZNL.js.map} +0 -0
- /package/dist/{context-retriever-WT67DEQE.js.map → context-retriever-BITYWLA2.js.map} +0 -0
- /package/dist/{doctor-deep-GMEIKBEF.js.map → doctor-deep-YNKNSQDO.js.map} +0 -0
- /package/dist/{doctor-live-HP2F44US.js.map → doctor-live-O5HUL4CE.js.map} +0 -0
- /package/dist/{expert-bridge-WS4DCMUU.js.map → expert-bridge-25V5Z5NH.js.map} +0 -0
- /package/dist/{factory-LCNX522I.js.map → factory-AKKNZQRC.js.map} +0 -0
- /package/dist/{factory-NMBGSHSQ.js.map → factory-KKA2PEK4.js.map} +0 -0
- /package/dist/{improvement-review-2M2PL57A.js.map → improvement-review-UZ4MFHY6.js.map} +0 -0
- /package/dist/{init-opencode-E3235NXT.js.map → init-opencode-RLWDLWUC.js.map} +0 -0
- /package/dist/{issue-triage-M26H4XSG.js.map → issue-triage-LOTZZAOQ.js.map} +0 -0
- /package/dist/{learning-persistence-TQJVPLDN.js.map → learning-persistence-DDCQTBPS.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-WXTZ5KRF.js.map → pr-reviewer-helpers-MDMJY3AJ.js.map} +0 -0
- /package/dist/{registry-command-ODE62JQ6.js.map → registry-command-BDXLCM4D.js.map} +0 -0
- /package/dist/{repo-security-plan-DF5MQUT7.js.map → repo-security-plan-55ZTF2TY.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-DNEQZ56K.js.map → research-helpers-synthesize-L2HNQK7U.js.map} +0 -0
- /package/dist/{routing-memory-S4VNNGX2.js.map → routing-memory-LDELNOBJ.js.map} +0 -0
- /package/dist/{session-memory-NZEGTYE7.js.map → session-memory-FW3BL34A.js.map} +0 -0
- /package/dist/{setup-config-OOS7USYV.js.map → setup-config-ZTACUOJK.js.map} +0 -0
- /package/dist/{setup-custom-api-VW3ARY6H.js.map → setup-custom-api-E3IK7DZH.js.map} +0 -0
- /package/dist/{setup-data-dir-TODDUZIO.js.map → setup-data-dir-MYGXBT4E.js.map} +0 -0
- /package/dist/{tool-memory-HXLN4JH4.js.map → tool-memory-SOAZGLTG.js.map} +0 -0
- /package/dist/{tool-memory-registry-adapters-ATMDGO4D.js.map → tool-memory-registry-adapters-IAYV4SBV.js.map} +0 -0
- /package/dist/{unified-registry-UYD65GIO.js.map → unified-registry-GPWSJDGN.js.map} +0 -0
- /package/dist/{weather-report-ZDHE4KN5.js.map → weather-report-BIJSJ5WH.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UJ5GVU2H.js";
|
|
4
4
|
import {
|
|
5
5
|
analyzeGitHubRepo
|
|
6
6
|
} from "./chunk-4GDMHCKX.js";
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
clampTaskTtl
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Y466OQB2.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3X7U2LTF.js";
|
|
28
28
|
import {
|
|
29
29
|
DEPRECATED_MODE_ALIAS_INPUT,
|
|
30
30
|
JobStatusSchema,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
updateStage,
|
|
72
72
|
withWarnings,
|
|
73
73
|
writeJobCancelled
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-BPUYQPXF.js";
|
|
75
75
|
import {
|
|
76
76
|
allOf,
|
|
77
77
|
anyOf
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
import {
|
|
80
80
|
normalizeTopicToCanonical,
|
|
81
81
|
synthesizeResearch
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-IKCULJYU.js";
|
|
83
83
|
import {
|
|
84
84
|
IssueTriage,
|
|
85
85
|
createAuditTrail,
|
|
@@ -87,13 +87,13 @@ import {
|
|
|
87
87
|
createDurableAuditTrail,
|
|
88
88
|
createGraphAuditBridge,
|
|
89
89
|
emitPipelinePolicyEvent
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-OFE2AQ4I.js";
|
|
91
91
|
import {
|
|
92
92
|
sanitizeInput
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-PEZRHADK.js";
|
|
94
94
|
import {
|
|
95
95
|
withPrerequisite
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-DZPAS2KT.js";
|
|
97
97
|
import {
|
|
98
98
|
NOOP_NOTIFIER,
|
|
99
99
|
RateLimiter,
|
|
@@ -116,14 +116,14 @@ import {
|
|
|
116
116
|
toolSuccessStructured,
|
|
117
117
|
withProgressHeartbeat,
|
|
118
118
|
wrapToolWithTimeout
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-6RTJNYWK.js";
|
|
120
120
|
import {
|
|
121
121
|
EventTopics,
|
|
122
122
|
UNRESOLVED_MODEL_ID,
|
|
123
123
|
createEvent,
|
|
124
124
|
getGlobalEventBus,
|
|
125
125
|
getGlobalRegistry
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-TGYLZFU5.js";
|
|
127
127
|
import {
|
|
128
128
|
IDENTIFIER_RE,
|
|
129
129
|
LANG_VALUES,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
parseRegistry,
|
|
157
157
|
sourceExistsInRegistry,
|
|
158
158
|
summarizeContextForPrompt
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-TLYEHGIR.js";
|
|
160
160
|
import {
|
|
161
161
|
REGISTRY_PATH,
|
|
162
162
|
getProjectRoot,
|
|
@@ -164,25 +164,25 @@ import {
|
|
|
164
164
|
loadTechniquesRegistry,
|
|
165
165
|
resolveInsideRoot,
|
|
166
166
|
resolveRegistryRoot
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-L6F6N72F.js";
|
|
168
168
|
import {
|
|
169
169
|
getTokenEnvVars,
|
|
170
170
|
resolveToken
|
|
171
|
-
} from "./chunk-
|
|
171
|
+
} from "./chunk-VAMOJV55.js";
|
|
172
172
|
import {
|
|
173
173
|
DEFAULT_RELEVANCE_CONFIG,
|
|
174
174
|
MemoryImportance,
|
|
175
175
|
MemoryType,
|
|
176
176
|
calculateTextJaccardSimilarity,
|
|
177
177
|
getToolMemory
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-SIAO7EFE.js";
|
|
179
179
|
import {
|
|
180
180
|
STOPWORDS,
|
|
181
181
|
truncateWithInfo
|
|
182
182
|
} from "./chunk-7LP6VJRP.js";
|
|
183
183
|
import {
|
|
184
184
|
createSessionMemory
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-AD6FWKAO.js";
|
|
186
186
|
import {
|
|
187
187
|
BUILT_IN_EXPERTS,
|
|
188
188
|
BuiltInExpertTypeSchema,
|
|
@@ -200,25 +200,25 @@ import {
|
|
|
200
200
|
getAvailableClis,
|
|
201
201
|
sleep,
|
|
202
202
|
withTimeout
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-666BO45M.js";
|
|
204
204
|
import {
|
|
205
205
|
BaseAdapter,
|
|
206
206
|
createStream,
|
|
207
207
|
requireApiKey,
|
|
208
208
|
validateApiKeyPresence
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-QLQUJLG3.js";
|
|
210
210
|
import {
|
|
211
211
|
DEFAULTS
|
|
212
|
-
} from "./chunk-
|
|
212
|
+
} from "./chunk-HILODAJL.js";
|
|
213
213
|
import {
|
|
214
214
|
getAvailabilityCache,
|
|
215
215
|
getCliForModelId,
|
|
216
216
|
resolveFallback
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-JRRAM2VZ.js";
|
|
218
218
|
import {
|
|
219
219
|
generateHyphenId,
|
|
220
220
|
generateUUID
|
|
221
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-53HQP5UY.js";
|
|
222
222
|
import {
|
|
223
223
|
AGENT_ROUTER_TIMEOUTS,
|
|
224
224
|
API_TIMEOUTS,
|
|
@@ -329,19 +329,19 @@ import {
|
|
|
329
329
|
selectStrategyByManifest,
|
|
330
330
|
toExpertTaskAnalysisResult,
|
|
331
331
|
withStep
|
|
332
|
-
} from "./chunk-
|
|
332
|
+
} from "./chunk-6ZTPCRTD.js";
|
|
333
333
|
import {
|
|
334
334
|
ensureLearningDir,
|
|
335
335
|
getMetaOutcomesFile,
|
|
336
336
|
isPersistenceEnabled
|
|
337
|
-
} from "./chunk-
|
|
337
|
+
} from "./chunk-4UHDDCRB.js";
|
|
338
338
|
import {
|
|
339
339
|
findRepoRoot,
|
|
340
340
|
getNexusDataDir,
|
|
341
341
|
nexusDataPath,
|
|
342
342
|
nexusDataPathEnsure,
|
|
343
343
|
parseBoolEnv
|
|
344
|
-
} from "./chunk-
|
|
344
|
+
} from "./chunk-RNDHNRSX.js";
|
|
345
345
|
|
|
346
346
|
// src/config/schemas-core.ts
|
|
347
347
|
import { z } from "zod";
|
|
@@ -961,14 +961,15 @@ var boolLooseStr = z11.string().refine((v) => ["true", "1", "false", "0"].includ
|
|
|
961
961
|
});
|
|
962
962
|
var NexusEnvSchema = z11.object({
|
|
963
963
|
// --- Timeouts ---
|
|
964
|
-
NEXUS_TIMEOUT_CLI: positiveIntStr.optional(),
|
|
965
964
|
// NEXUS_TIMEOUT_CLISIMPLE + NEXUS_TIMEOUT_CLICOMPLEX removed in #4180 — silent
|
|
966
965
|
// no-ops (#2977 class). Their only possible reader, getTimeout('cliSimpleMs' /
|
|
967
966
|
// 'cliComplexMs'), had zero production call sites; per-complexity CLI timeouts
|
|
968
967
|
// flow through getTimeoutForCli/TIMEOUT_PROFILES instead.
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
// NEXUS_TIMEOUT_CLI / _API / _WORKFLOW / _MCP removed in #4939 — the rest of
|
|
969
|
+
// that getter's family. getTimeout() itself had zero production callers, and
|
|
970
|
+
// config-manager echoed the four back as `Source: (env)` for values nothing
|
|
971
|
+
// consumed. The real knobs are NEXUS_TIMEOUT_CLASS_*_MS and the *_TIMEOUT_MS
|
|
972
|
+
// names below.
|
|
972
973
|
NEXUS_VOTE_TIMEOUT_MS: positiveIntStr.optional(),
|
|
973
974
|
NEXUS_MCP_TIMEOUT_MS: positiveIntStr.optional(),
|
|
974
975
|
NEXUS_WORKFLOW_TIMEOUT_MS: positiveIntStr.optional(),
|
|
@@ -1450,13 +1451,7 @@ function validateValue(value, expectedType) {
|
|
|
1450
1451
|
if (typeof expectedType === "string") return StringValueSchema.safeParse(value).success;
|
|
1451
1452
|
return false;
|
|
1452
1453
|
}
|
|
1453
|
-
var ENV_VAR_MAP = {
|
|
1454
|
-
"TIMEOUT_DEFAULTS.cliMs": "NEXUS_TIMEOUT_CLI",
|
|
1455
|
-
"TIMEOUT_DEFAULTS.apiMs": "NEXUS_TIMEOUT_API",
|
|
1456
|
-
"TIMEOUT_DEFAULTS.workflowMs": "NEXUS_TIMEOUT_WORKFLOW",
|
|
1457
|
-
"TIMEOUT_DEFAULTS.mcpMs": "NEXUS_TIMEOUT_MCP"
|
|
1458
|
-
// WORKER_DEFAULTS.* mappings removed in #2977 — zero production consumers.
|
|
1459
|
-
};
|
|
1454
|
+
var ENV_VAR_MAP = {};
|
|
1460
1455
|
function parseEnvValue(envValue, defaultValue) {
|
|
1461
1456
|
if (typeof defaultValue === "number") {
|
|
1462
1457
|
const parsed = Number(envValue);
|
|
@@ -27328,10 +27323,10 @@ function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
|
|
|
27328
27323
|
const difference = p1 - p2;
|
|
27329
27324
|
const measured = total1 > 0 && total2 > 0;
|
|
27330
27325
|
const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
|
|
27331
|
-
const
|
|
27326
|
+
const z128 = getZScore(confidence);
|
|
27332
27327
|
return {
|
|
27333
|
-
lower: difference -
|
|
27334
|
-
upper: difference +
|
|
27328
|
+
lower: difference - z128 * seDiff,
|
|
27329
|
+
upper: difference + z128 * seDiff,
|
|
27335
27330
|
estimate: difference,
|
|
27336
27331
|
confidence,
|
|
27337
27332
|
n: total1 + total2,
|
|
@@ -27359,11 +27354,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
|
|
|
27359
27354
|
measured: false
|
|
27360
27355
|
};
|
|
27361
27356
|
}
|
|
27362
|
-
const
|
|
27363
|
-
const z210 =
|
|
27357
|
+
const z128 = getZScore(opts.confidence);
|
|
27358
|
+
const z210 = z128 * z128;
|
|
27364
27359
|
const denominator = 1 + z210 / n;
|
|
27365
27360
|
const center = (p + z210 / (2 * n)) / denominator;
|
|
27366
|
-
const margin =
|
|
27361
|
+
const margin = z128 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
27367
27362
|
const lower = Math.max(0, center - margin);
|
|
27368
27363
|
const upper = Math.min(1, center + margin);
|
|
27369
27364
|
const standardError = Math.sqrt(p * (1 - p) / n);
|
|
@@ -27401,8 +27396,8 @@ function meanConfidenceInterval(values, options = {}) {
|
|
|
27401
27396
|
const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
|
|
27402
27397
|
const stdDev = Math.sqrt(variance);
|
|
27403
27398
|
const standardError = stdDev / Math.sqrt(n);
|
|
27404
|
-
const
|
|
27405
|
-
const margin =
|
|
27399
|
+
const z128 = getZScore(opts.confidence);
|
|
27400
|
+
const margin = z128 * standardError;
|
|
27406
27401
|
return {
|
|
27407
27402
|
lower: mean - margin,
|
|
27408
27403
|
upper: mean + margin,
|
|
@@ -30059,7 +30054,7 @@ function execIdFields(executionId) {
|
|
|
30059
30054
|
async function populateUnifiedContextOnState(state, options) {
|
|
30060
30055
|
const taskCandidate = state["task"];
|
|
30061
30056
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
30062
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
30057
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-BITYWLA2.js");
|
|
30063
30058
|
const category = inferTaskCategory2(taskCandidate);
|
|
30064
30059
|
const executionId = options?.executionId;
|
|
30065
30060
|
const execFields = execIdFields(executionId);
|
|
@@ -34528,11 +34523,96 @@ async function maybeRetryAfterTriage(opts) {
|
|
|
34528
34523
|
return { ...retryResult, triageAction: triage.action, wasRetried: true };
|
|
34529
34524
|
}
|
|
34530
34525
|
|
|
34526
|
+
// src/orchestration/aorchestra/context-distillation.ts
|
|
34527
|
+
import { z as z63 } from "zod";
|
|
34528
|
+
var PhaseDistillationSchema = z63.object({
|
|
34529
|
+
/** Key decisions made during this phase */
|
|
34530
|
+
decisions: z63.array(z63.string()),
|
|
34531
|
+
/** Artifacts produced (file paths, URLs, IDs) */
|
|
34532
|
+
artifacts: z63.array(z63.string()),
|
|
34533
|
+
/** Important findings or observations */
|
|
34534
|
+
findings: z63.array(z63.string()),
|
|
34535
|
+
/** Errors encountered (if any) */
|
|
34536
|
+
errors: z63.array(z63.string()),
|
|
34537
|
+
/** One-sentence summary of the phase outcome */
|
|
34538
|
+
summary: z63.string()
|
|
34539
|
+
});
|
|
34540
|
+
var DECISION_PATTERNS = [
|
|
34541
|
+
/(?:decided|chosen|selected|using|went with|picked|adopted|approved)\s+(.{10,100})/gi,
|
|
34542
|
+
/(?:will|should|must)\s+(use|implement|create|add|remove|change)\s+(.{10,80})/gi
|
|
34543
|
+
];
|
|
34544
|
+
var ARTIFACT_PATTERNS = [
|
|
34545
|
+
/(?:created?|wrote|generated|built|saved|output)\s+(?:file|module|component|test|schema)?\s*[`"]?([/\w.-]+\.\w{1,6})[`"]?/gi,
|
|
34546
|
+
/(?:commit|push|deploy|publish)(?:ed|ing)?\s+(.{10,60})/gi
|
|
34547
|
+
];
|
|
34548
|
+
var ERROR_PATTERNS = [
|
|
34549
|
+
/(?:error|failed|failure|exception|crash|timeout|rejected):\s*(.{10,100})/gi,
|
|
34550
|
+
/(?:could not|unable to|cannot)\s+(.{10,80})/gi
|
|
34551
|
+
];
|
|
34552
|
+
var FINDING_PATTERNS = [
|
|
34553
|
+
/(?:found|discovered|detected|noticed|identified|observed)\s+(.{10,100})/gi,
|
|
34554
|
+
/(?:vulnerability|issue|bug|problem|concern|risk):\s*(.{10,100})/gi
|
|
34555
|
+
];
|
|
34556
|
+
function extractMatches(text, patterns, maxItems) {
|
|
34557
|
+
const seen = /* @__PURE__ */ new Set();
|
|
34558
|
+
const results = [];
|
|
34559
|
+
for (const pattern of patterns) {
|
|
34560
|
+
pattern.lastIndex = 0;
|
|
34561
|
+
let match = pattern.exec(text);
|
|
34562
|
+
while (match !== null && results.length < maxItems) {
|
|
34563
|
+
const value = (match[match.length - 1] ?? match[0]).trim();
|
|
34564
|
+
const normalized = value.toLowerCase();
|
|
34565
|
+
if (value.length > 5 && !seen.has(normalized)) {
|
|
34566
|
+
seen.add(normalized);
|
|
34567
|
+
results.push(value);
|
|
34568
|
+
}
|
|
34569
|
+
match = pattern.exec(text);
|
|
34570
|
+
}
|
|
34571
|
+
}
|
|
34572
|
+
return results;
|
|
34573
|
+
}
|
|
34574
|
+
function distillPhaseOutput(phaseOutput, maxItemsPerCategory = 5) {
|
|
34575
|
+
const decisions = extractMatches(phaseOutput, DECISION_PATTERNS, maxItemsPerCategory);
|
|
34576
|
+
const artifacts = extractMatches(phaseOutput, ARTIFACT_PATTERNS, maxItemsPerCategory);
|
|
34577
|
+
const findings = extractMatches(phaseOutput, FINDING_PATTERNS, maxItemsPerCategory);
|
|
34578
|
+
const errors = extractMatches(phaseOutput, ERROR_PATTERNS, maxItemsPerCategory);
|
|
34579
|
+
const firstSentence = phaseOutput.match(/^[^.!?\n]{10,200}[.!?]/);
|
|
34580
|
+
const summary = firstSentence ? firstSentence[0].trim() : phaseOutput.slice(0, 200).trim() + (phaseOutput.length > 200 ? "..." : "");
|
|
34581
|
+
return { decisions, artifacts, findings, errors, summary };
|
|
34582
|
+
}
|
|
34583
|
+
function formatSection(lines, heading, items) {
|
|
34584
|
+
if (items.length === 0) return;
|
|
34585
|
+
lines.push("");
|
|
34586
|
+
lines.push(`### ${heading}`);
|
|
34587
|
+
for (const item of items) {
|
|
34588
|
+
lines.push(`- ${item}`);
|
|
34589
|
+
}
|
|
34590
|
+
}
|
|
34591
|
+
function formatDistillation(distillation, phaseLabel) {
|
|
34592
|
+
const lines = [];
|
|
34593
|
+
const heading = phaseLabel !== void 0 && phaseLabel !== "" ? `## ${phaseLabel} Summary` : "## Prior Phase Summary";
|
|
34594
|
+
lines.push(heading);
|
|
34595
|
+
lines.push("");
|
|
34596
|
+
lines.push(distillation.summary);
|
|
34597
|
+
formatSection(lines, "Decisions", distillation.decisions);
|
|
34598
|
+
formatSection(lines, "Artifacts", distillation.artifacts);
|
|
34599
|
+
formatSection(lines, "Findings", distillation.findings);
|
|
34600
|
+
formatSection(lines, "Errors", distillation.errors);
|
|
34601
|
+
return lines.join("\n");
|
|
34602
|
+
}
|
|
34603
|
+
function compressionRatio(originalLength, distilledLength) {
|
|
34604
|
+
if (originalLength === 0) return 1;
|
|
34605
|
+
return distilledLength / originalLength;
|
|
34606
|
+
}
|
|
34607
|
+
|
|
34531
34608
|
// src/orchestration/aorchestra/cross-wave-context.ts
|
|
34532
34609
|
var logger29 = createLogger({ component: "cross-wave-context" });
|
|
34533
34610
|
var MAX_CHARS_PER_WORKER = 1500;
|
|
34534
34611
|
var MAX_NAMED_OMITTED_ROLES = 8;
|
|
34535
34612
|
var MAX_PRIOR_CONTEXT_CHARS = 6e3;
|
|
34613
|
+
var TRUNCATED_MARKER = " [truncated]";
|
|
34614
|
+
var DISTILLATION_SHADOW_LOG_MESSAGE = "Prior-wave distillation shadow (#5974)";
|
|
34615
|
+
var PRIOR_WAVE_HEADER = "## Prior Wave Context\n\nThe following results were produced by prior wave workers. Use this context to inform your work.\n";
|
|
34536
34616
|
var INJECTION_PATTERNS2 = [
|
|
34537
34617
|
/<\/?(?:system|human|assistant|instructions)(?:\s[^>]*)?>[\s\S]*?(?:<\/(?:system|human|assistant|instructions)>|$)/gi,
|
|
34538
34618
|
/<img\b[^>]*>/gi,
|
|
@@ -34590,15 +34670,14 @@ function buildPriorWaveContextBlock(results) {
|
|
|
34590
34670
|
}
|
|
34591
34671
|
return "";
|
|
34592
34672
|
}
|
|
34593
|
-
|
|
34594
|
-
let totalChars = header.length;
|
|
34673
|
+
let totalChars = PRIOR_WAVE_HEADER.length;
|
|
34595
34674
|
const entries = [];
|
|
34596
34675
|
const omittedRoles = [];
|
|
34676
|
+
const shadowInputs = [];
|
|
34597
34677
|
for (const result of successResults) {
|
|
34598
34678
|
const sanitized = sanitizeWorkerOutput(result.output);
|
|
34599
|
-
|
|
34600
|
-
const entry =
|
|
34601
|
-
${truncated}`;
|
|
34679
|
+
shadowInputs.push({ role: result.role, sanitized });
|
|
34680
|
+
const entry = formatEntry(result.role, truncateWorkerOutput(sanitized));
|
|
34602
34681
|
if (totalChars + entry.length > MAX_PRIOR_CONTEXT_CHARS) {
|
|
34603
34682
|
omittedRoles.push(result.role);
|
|
34604
34683
|
continue;
|
|
@@ -34606,10 +34685,68 @@ ${truncated}`;
|
|
|
34606
34685
|
entries.push(entry);
|
|
34607
34686
|
totalChars += entry.length;
|
|
34608
34687
|
}
|
|
34688
|
+
logger29.info(DISTILLATION_SHADOW_LOG_MESSAGE, { ...shadowDistillPriorWave(shadowInputs) });
|
|
34609
34689
|
if (entries.length === 0) return "";
|
|
34610
34690
|
const failures = buildFailureSummary(results, MAX_PRIOR_CONTEXT_CHARS - totalChars);
|
|
34611
34691
|
const omitted = [...omittedRoles, ...failures.omittedRoles];
|
|
34612
|
-
return
|
|
34692
|
+
return PRIOR_WAVE_HEADER + "\n" + entries.join("\n\n") + failures.text + buildOmissionNotice(omitted);
|
|
34693
|
+
}
|
|
34694
|
+
function truncateWorkerOutput(sanitized) {
|
|
34695
|
+
return sanitized.length > MAX_CHARS_PER_WORKER ? sanitized.slice(0, MAX_CHARS_PER_WORKER) + TRUNCATED_MARKER : sanitized;
|
|
34696
|
+
}
|
|
34697
|
+
function formatEntry(role, body) {
|
|
34698
|
+
return `### ${role} (success)
|
|
34699
|
+
${body}`;
|
|
34700
|
+
}
|
|
34701
|
+
function shadowDistillPriorWave(inputs, budgetChars = MAX_PRIOR_CONTEXT_CHARS) {
|
|
34702
|
+
const workers = inputs.map((input) => measureWorker(input));
|
|
34703
|
+
return {
|
|
34704
|
+
workers,
|
|
34705
|
+
budgetChars,
|
|
34706
|
+
truncationKept: countKeptUnderBudget(workers, (w) => w.truncatedChars, budgetChars),
|
|
34707
|
+
distillationWouldKeep: countKeptUnderBudget(workers, (w) => w.candidateChars, budgetChars),
|
|
34708
|
+
degenerateCount: workers.filter((w) => !w.matchedAnyPattern).length,
|
|
34709
|
+
totalSanitizedChars: workers.reduce((n, w) => n + w.sanitizedChars, 0),
|
|
34710
|
+
totalTruncatedChars: workers.reduce((n, w) => n + w.truncatedChars, 0),
|
|
34711
|
+
totalCandidateChars: workers.reduce((n, w) => n + w.candidateChars, 0)
|
|
34712
|
+
};
|
|
34713
|
+
}
|
|
34714
|
+
function measureWorker(input) {
|
|
34715
|
+
const { role, sanitized } = input;
|
|
34716
|
+
const truncatedChars = truncateWorkerOutput(sanitized).length;
|
|
34717
|
+
const distillation = distillPhaseOutput(sanitized);
|
|
34718
|
+
const distilledChars = formatDistillation(distillation, role).length;
|
|
34719
|
+
const patternHits = {
|
|
34720
|
+
decisions: distillation.decisions.length,
|
|
34721
|
+
artifacts: distillation.artifacts.length,
|
|
34722
|
+
findings: distillation.findings.length,
|
|
34723
|
+
errors: distillation.errors.length
|
|
34724
|
+
};
|
|
34725
|
+
const matchedAnyPattern = patternHits.decisions + patternHits.artifacts + patternHits.findings + patternHits.errors > 0;
|
|
34726
|
+
const fellBackToTruncation = !matchedAnyPattern;
|
|
34727
|
+
return {
|
|
34728
|
+
role,
|
|
34729
|
+
sanitizedChars: sanitized.length,
|
|
34730
|
+
truncatedChars,
|
|
34731
|
+
distilledChars,
|
|
34732
|
+
candidateChars: fellBackToTruncation ? truncatedChars : distilledChars,
|
|
34733
|
+
truncationRatio: compressionRatio(sanitized.length, truncatedChars),
|
|
34734
|
+
distillationRatio: compressionRatio(sanitized.length, distilledChars),
|
|
34735
|
+
patternHits,
|
|
34736
|
+
matchedAnyPattern,
|
|
34737
|
+
fellBackToTruncation
|
|
34738
|
+
};
|
|
34739
|
+
}
|
|
34740
|
+
function countKeptUnderBudget(workers, sizeOf, budgetChars) {
|
|
34741
|
+
let total = PRIOR_WAVE_HEADER.length;
|
|
34742
|
+
let kept = 0;
|
|
34743
|
+
for (const w of workers) {
|
|
34744
|
+
const entryChars = formatEntry(w.role, "").length + sizeOf(w);
|
|
34745
|
+
if (total + entryChars > budgetChars) continue;
|
|
34746
|
+
total += entryChars;
|
|
34747
|
+
kept += 1;
|
|
34748
|
+
}
|
|
34749
|
+
return kept;
|
|
34613
34750
|
}
|
|
34614
34751
|
var MAX_ERROR_SNIPPET_CHARS = 100;
|
|
34615
34752
|
function buildOmissionNotice(omittedRoles) {
|
|
@@ -35764,14 +35901,14 @@ function mergeRefinedResults(original, refined) {
|
|
|
35764
35901
|
}
|
|
35765
35902
|
|
|
35766
35903
|
// src/mcp/tools/reflective-retriever.ts
|
|
35767
|
-
import { z as
|
|
35904
|
+
import { z as z64 } from "zod";
|
|
35768
35905
|
var REFLECTION_TIMEOUT_MS = REFLECTIVE_TIMEOUTS.reflectionMs;
|
|
35769
35906
|
var MAX_CACHE_ENTRIES = 50;
|
|
35770
35907
|
var CACHE_TTL_MS = REFLECTIVE_TIMEOUTS.cacheTtlMs;
|
|
35771
35908
|
var REFLECTION_MAX_TOKENS = 100;
|
|
35772
|
-
var ReflectionCriteriaSchema =
|
|
35773
|
-
keywords:
|
|
35774
|
-
context:
|
|
35909
|
+
var ReflectionCriteriaSchema = z64.object({
|
|
35910
|
+
keywords: z64.array(z64.string()).min(1).max(10).describe("Expanded keywords for memory search"),
|
|
35911
|
+
context: z64.string().max(200).describe("Brief context about what memories would be useful")
|
|
35775
35912
|
});
|
|
35776
35913
|
var ReflectionCache = class {
|
|
35777
35914
|
entries = /* @__PURE__ */ new Map();
|
|
@@ -36913,42 +37050,42 @@ function registerOrchestrateTool(server, deps) {
|
|
|
36913
37050
|
}
|
|
36914
37051
|
|
|
36915
37052
|
// src/mcp/tools/delegate-to-model-types.ts
|
|
36916
|
-
import { z as
|
|
37053
|
+
import { z as z65 } from "zod";
|
|
36917
37054
|
var MODEL_CAPABILITIES2 = buildCapabilityProfiles();
|
|
36918
|
-
var DelegateInputSchema =
|
|
36919
|
-
task:
|
|
36920
|
-
preferred_capability:
|
|
36921
|
-
model_hint:
|
|
37055
|
+
var DelegateInputSchema = z65.object({
|
|
37056
|
+
task: z65.string().min(1).max(5e4).describe("Task to execute or analyze"),
|
|
37057
|
+
preferred_capability: z65.enum(["reasoning", "context", "speed", "code"]).optional().describe("Preferred capability for routing: reasoning, context, speed, or code"),
|
|
37058
|
+
model_hint: z65.string().max(100).optional().describe("Explicit model preference (e.g., claude-opus, gemini-pro)"),
|
|
36922
37059
|
// estimate_tokens flag removed (#2723). The field was declared in two schemas
|
|
36923
37060
|
// (here and in TOOL_SCHEMA below) but never read by any consumer — calling
|
|
36924
37061
|
// `delegate_to_model { estimate_tokens: true }` returned the full routing
|
|
36925
37062
|
// decision identical to omitting the flag. The output already carries
|
|
36926
37063
|
// `estimated_tokens` so the use case the flag advertised is satisfied
|
|
36927
37064
|
// without the flag.
|
|
36928
|
-
billing_mode:
|
|
37065
|
+
billing_mode: z65.enum(["plan", "api"]).optional().describe("Billing mode: plan (monthly subscription, ignore cost) or api (pay-per-token)")
|
|
36929
37066
|
});
|
|
36930
|
-
var DelegateOutputSchema =
|
|
36931
|
-
recommended_model:
|
|
36932
|
-
reasoning:
|
|
36933
|
-
capabilities:
|
|
36934
|
-
reasoning:
|
|
36935
|
-
contextWindow:
|
|
36936
|
-
codeGeneration:
|
|
36937
|
-
speed:
|
|
36938
|
-
cost:
|
|
37067
|
+
var DelegateOutputSchema = z65.object({
|
|
37068
|
+
recommended_model: z65.string().max(100).describe("The model recommended for this task"),
|
|
37069
|
+
reasoning: z65.string().max(2e3).describe("Why this model was selected"),
|
|
37070
|
+
capabilities: z65.object({
|
|
37071
|
+
reasoning: z65.number(),
|
|
37072
|
+
contextWindow: z65.number(),
|
|
37073
|
+
codeGeneration: z65.number(),
|
|
37074
|
+
speed: z65.number(),
|
|
37075
|
+
cost: z65.number()
|
|
36939
37076
|
}),
|
|
36940
|
-
estimated_tokens:
|
|
36941
|
-
alternatives:
|
|
36942
|
-
|
|
36943
|
-
model:
|
|
36944
|
-
score:
|
|
36945
|
-
tradeoff:
|
|
37077
|
+
estimated_tokens: z65.number().describe("Estimated tokens for task"),
|
|
37078
|
+
alternatives: z65.array(
|
|
37079
|
+
z65.object({
|
|
37080
|
+
model: z65.string().max(100),
|
|
37081
|
+
score: z65.number(),
|
|
37082
|
+
tradeoff: z65.string().max(500)
|
|
36946
37083
|
})
|
|
36947
37084
|
).max(10).describe("Alternative model options with tradeoffs"),
|
|
36948
|
-
governance:
|
|
36949
|
-
domain:
|
|
36950
|
-
votingThreshold:
|
|
36951
|
-
promotionReason:
|
|
37085
|
+
governance: z65.object({
|
|
37086
|
+
domain: z65.string().max(100).describe("Governance domain (e.g., security, architecture)"),
|
|
37087
|
+
votingThreshold: z65.string().max(50).describe("Required voting threshold (e.g., supermajority)"),
|
|
37088
|
+
promotionReason: z65.string().max(500).describe("Why governance was promoted")
|
|
36952
37089
|
}).optional().describe("Present when task triggers governance promotion")
|
|
36953
37090
|
});
|
|
36954
37091
|
var REASONING_KEYWORDS = [
|
|
@@ -37025,11 +37162,11 @@ var EXPLORATION_KEYWORDS = [
|
|
|
37025
37162
|
"navigate"
|
|
37026
37163
|
];
|
|
37027
37164
|
var TOOL_SCHEMA = {
|
|
37028
|
-
task:
|
|
37029
|
-
preferred_capability:
|
|
37030
|
-
model_hint:
|
|
37165
|
+
task: z65.string().min(1).max(5e4).describe("Task to execute or analyze"),
|
|
37166
|
+
preferred_capability: z65.enum(["reasoning", "context", "speed", "code"]).optional().describe("Preferred capability for routing"),
|
|
37167
|
+
model_hint: z65.string().max(100).optional().describe("Explicit model preference"),
|
|
37031
37168
|
// estimate_tokens removed (#2723) — see comment above on DelegateInputSchema.
|
|
37032
|
-
billing_mode:
|
|
37169
|
+
billing_mode: z65.enum(["plan", "api"]).optional().describe("Billing mode for cost handling")
|
|
37033
37170
|
};
|
|
37034
37171
|
|
|
37035
37172
|
// src/mcp/tools/delegate-to-model-helpers.ts
|
|
@@ -38453,9 +38590,9 @@ function standardReportHandler(state) {
|
|
|
38453
38590
|
}
|
|
38454
38591
|
|
|
38455
38592
|
// src/mcp/tools/list-experts.ts
|
|
38456
|
-
import { z as
|
|
38457
|
-
var ListExpertsInputSchema =
|
|
38458
|
-
format:
|
|
38593
|
+
import { z as z66 } from "zod";
|
|
38594
|
+
var ListExpertsInputSchema = z66.object({
|
|
38595
|
+
format: z66.enum(["full", "names"]).optional().default("full").describe("Output format: full (with details) or names (just role names)")
|
|
38459
38596
|
});
|
|
38460
38597
|
var EXPERT_TYPE_TO_ROLE2 = {
|
|
38461
38598
|
code: "code_expert",
|
|
@@ -38526,7 +38663,7 @@ function listExpertsHandler(args, ctx) {
|
|
|
38526
38663
|
function registerListExpertsTool(server, deps) {
|
|
38527
38664
|
const logger57 = deps.logger ?? createLogger({ tool: "list_experts" });
|
|
38528
38665
|
const toolSchema = {
|
|
38529
|
-
format:
|
|
38666
|
+
format: z66.enum(["full", "names"]).optional().describe("Output format: full (with details) or names (just role names)")
|
|
38530
38667
|
};
|
|
38531
38668
|
const description = "Inventory of expert ROLES available to `create_expert` (architect, security, devex, etc.). Use this BEFORE create_expert to pick a role; returns role name and capability summary.";
|
|
38532
38669
|
const secureHandler = createSecureHandler(listExpertsHandler, {
|
|
@@ -38537,15 +38674,15 @@ function registerListExpertsTool(server, deps) {
|
|
|
38537
38674
|
const timeoutMs = getToolTimeout("list_experts", deps.security);
|
|
38538
38675
|
const wrappedHandler = wrapToolWithTimeout("list_experts", secureHandler, { timeoutMs, logger: logger57 });
|
|
38539
38676
|
const outputSchema = {
|
|
38540
|
-
experts:
|
|
38541
|
-
|
|
38542
|
-
role:
|
|
38543
|
-
name:
|
|
38544
|
-
description:
|
|
38545
|
-
capabilities:
|
|
38677
|
+
experts: z66.array(
|
|
38678
|
+
z66.object({
|
|
38679
|
+
role: z66.string(),
|
|
38680
|
+
name: z66.string(),
|
|
38681
|
+
description: z66.string(),
|
|
38682
|
+
capabilities: z66.array(z66.string())
|
|
38546
38683
|
})
|
|
38547
38684
|
),
|
|
38548
|
-
count:
|
|
38685
|
+
count: z66.number()
|
|
38549
38686
|
};
|
|
38550
38687
|
server.registerTool(
|
|
38551
38688
|
"list_experts",
|
|
@@ -38561,10 +38698,10 @@ function registerListExpertsTool(server, deps) {
|
|
|
38561
38698
|
}
|
|
38562
38699
|
|
|
38563
38700
|
// src/mcp/tools/list-workflows.ts
|
|
38564
|
-
import { z as
|
|
38565
|
-
var ListWorkflowsInputSchema =
|
|
38566
|
-
category:
|
|
38567
|
-
format:
|
|
38701
|
+
import { z as z67 } from "zod";
|
|
38702
|
+
var ListWorkflowsInputSchema = z67.object({
|
|
38703
|
+
category: z67.string().optional().describe("Filter by category (e.g., development, security)"),
|
|
38704
|
+
format: z67.enum(["full", "names"]).optional().default("full").describe("Output format: full (with details) or names (just template names)")
|
|
38568
38705
|
});
|
|
38569
38706
|
async function handleListWorkflows(workflowEngine, args) {
|
|
38570
38707
|
const templates = await workflowEngine.listTemplates();
|
|
@@ -38618,8 +38755,8 @@ function createListWorkflowsHandler(workflowEngine) {
|
|
|
38618
38755
|
function registerListWorkflowsTool(server, deps) {
|
|
38619
38756
|
const logger57 = deps.logger ?? createLogger({ tool: "list_workflows" });
|
|
38620
38757
|
const toolSchema = {
|
|
38621
|
-
category:
|
|
38622
|
-
format:
|
|
38758
|
+
category: z67.string().optional().describe("Filter by category (e.g., development, security)"),
|
|
38759
|
+
format: z67.enum(["full", "names"]).optional().describe("Output format: full (with details) or names (just template names)")
|
|
38623
38760
|
};
|
|
38624
38761
|
const description = "Inventory of multi-step TEMPLATES available to `run_workflow` (code-review, security-audit, etc.). Use this BEFORE run_workflow to pick a template; returns template name, version, description, and category.";
|
|
38625
38762
|
const secureHandler = createSecureHandler(createListWorkflowsHandler(deps.workflowEngine), {
|
|
@@ -38634,16 +38771,16 @@ function registerListWorkflowsTool(server, deps) {
|
|
|
38634
38771
|
timeoutMs !== void 0 ? { timeoutMs, logger: logger57 } : { logger: logger57 }
|
|
38635
38772
|
);
|
|
38636
38773
|
const outputSchema = {
|
|
38637
|
-
workflows:
|
|
38638
|
-
|
|
38639
|
-
name:
|
|
38640
|
-
version:
|
|
38641
|
-
description:
|
|
38642
|
-
category:
|
|
38774
|
+
workflows: z67.array(
|
|
38775
|
+
z67.object({
|
|
38776
|
+
name: z67.string(),
|
|
38777
|
+
version: z67.string(),
|
|
38778
|
+
description: z67.string().optional(),
|
|
38779
|
+
category: z67.string().optional()
|
|
38643
38780
|
})
|
|
38644
38781
|
),
|
|
38645
|
-
count:
|
|
38646
|
-
categories:
|
|
38782
|
+
count: z67.number(),
|
|
38783
|
+
categories: z67.array(z67.string()).optional()
|
|
38647
38784
|
};
|
|
38648
38785
|
server.registerTool(
|
|
38649
38786
|
"list_workflows",
|
|
@@ -38659,7 +38796,7 @@ function registerListWorkflowsTool(server, deps) {
|
|
|
38659
38796
|
}
|
|
38660
38797
|
|
|
38661
38798
|
// src/mcp/tools/execute-expert.ts
|
|
38662
|
-
import { z as
|
|
38799
|
+
import { z as z69 } from "zod";
|
|
38663
38800
|
|
|
38664
38801
|
// src/mcp/tools/execute-expert-recording.ts
|
|
38665
38802
|
var ROLE_TO_CATEGORY = {
|
|
@@ -38854,12 +38991,12 @@ function observeExpertContext(observation, logger57, threshold = resolveContextW
|
|
|
38854
38991
|
}
|
|
38855
38992
|
|
|
38856
38993
|
// src/mcp/tools/execute-expert-task-handler.ts
|
|
38857
|
-
import { z as
|
|
38994
|
+
import { z as z68 } from "zod";
|
|
38858
38995
|
var EXECUTE_EXPERT_TOOL_SCHEMA = {
|
|
38859
|
-
expertId:
|
|
38860
|
-
task:
|
|
38861
|
-
context:
|
|
38862
|
-
timeoutMs:
|
|
38996
|
+
expertId: z68.string().min(1).describe("Expert ID from create_expert tool"),
|
|
38997
|
+
task: z68.string().min(1).max(5e4).describe("Task description for the expert to execute"),
|
|
38998
|
+
context: z68.record(z68.string(), z68.unknown()).optional().describe("Additional context metadata for the task"),
|
|
38999
|
+
timeoutMs: z68.number().int().min(EXPERT_TIMEOUTS.executeFloorMs).max(EXPERT_TIMEOUTS.maxMs).optional().describe("Optional timeout in ms (120s-900s). Overrides auto-detected timeout.")
|
|
38863
39000
|
};
|
|
38864
39001
|
function createTaskHandler(deps, logger57, executor) {
|
|
38865
39002
|
const notifier = deps.notifier ?? NOOP_NOTIFIER;
|
|
@@ -38954,12 +39091,12 @@ async function runBackgroundExpertTask(opts) {
|
|
|
38954
39091
|
|
|
38955
39092
|
// src/mcp/tools/execute-expert.ts
|
|
38956
39093
|
var EXPERT_TIMEOUT_FLOOR_MS = EXPERT_TIMEOUTS.executeFloorMs;
|
|
38957
|
-
var ExecuteExpertInputSchema =
|
|
38958
|
-
expertId:
|
|
38959
|
-
task:
|
|
38960
|
-
context:
|
|
38961
|
-
timeoutMs:
|
|
38962
|
-
previousExpertSummary:
|
|
39094
|
+
var ExecuteExpertInputSchema = z69.object({
|
|
39095
|
+
expertId: z69.string().min(1).describe("Expert ID from create_expert tool"),
|
|
39096
|
+
task: z69.string().min(1).max(5e4).describe("Task description for the expert to execute"),
|
|
39097
|
+
context: z69.record(z69.string(), z69.unknown()).optional().describe("Additional context metadata for the task"),
|
|
39098
|
+
timeoutMs: z69.number().int().min(EXPERT_TIMEOUT_FLOOR_MS).max(EXPERT_TIMEOUTS.maxMs).optional().describe("Optional timeout in ms (120s-900s). Overrides auto-detected timeout."),
|
|
39099
|
+
previousExpertSummary: z69.string().max(2e3).optional().describe(
|
|
38963
39100
|
"Summary from a previous expert in the chain. Injected into prompt for context continuity."
|
|
38964
39101
|
)
|
|
38965
39102
|
});
|
|
@@ -39293,25 +39430,25 @@ function registerExecuteExpertTool(server, deps) {
|
|
|
39293
39430
|
}
|
|
39294
39431
|
|
|
39295
39432
|
// src/mcp/tools/research-query.ts
|
|
39296
|
-
import { z as
|
|
39433
|
+
import { z as z71 } from "zod";
|
|
39297
39434
|
import { join as join6 } from "node:path";
|
|
39298
39435
|
|
|
39299
39436
|
// src/research/negative-results.ts
|
|
39300
39437
|
import { readFileSync as readFileSync5 } from "node:fs";
|
|
39301
39438
|
import { join as join5 } from "node:path";
|
|
39302
39439
|
import yaml3 from "yaml";
|
|
39303
|
-
import { z as
|
|
39440
|
+
import { z as z70 } from "zod";
|
|
39304
39441
|
var logger33 = createLogger({ component: "negative-results" });
|
|
39305
|
-
var NegativeResultSchema =
|
|
39306
|
-
name:
|
|
39307
|
-
paper:
|
|
39308
|
-
rejection_date:
|
|
39309
|
-
failure_mode:
|
|
39310
|
-
lessons_learned:
|
|
39311
|
-
reopen_conditions:
|
|
39442
|
+
var NegativeResultSchema = z70.object({
|
|
39443
|
+
name: z70.string(),
|
|
39444
|
+
paper: z70.string(),
|
|
39445
|
+
rejection_date: z70.string(),
|
|
39446
|
+
failure_mode: z70.string(),
|
|
39447
|
+
lessons_learned: z70.array(z70.string()),
|
|
39448
|
+
reopen_conditions: z70.array(z70.string())
|
|
39312
39449
|
});
|
|
39313
|
-
var NegativeResultsRegistrySchema =
|
|
39314
|
-
negative_results:
|
|
39450
|
+
var NegativeResultsRegistrySchema = z70.object({
|
|
39451
|
+
negative_results: z70.record(z70.string(), NegativeResultSchema)
|
|
39315
39452
|
});
|
|
39316
39453
|
var NEGATIVE_RESULTS_FILE = "negative-results.yaml";
|
|
39317
39454
|
function negativeResultsPath() {
|
|
@@ -39365,23 +39502,23 @@ function formatRejectionWarning(id, result) {
|
|
|
39365
39502
|
}
|
|
39366
39503
|
|
|
39367
39504
|
// src/mcp/tools/research-query.ts
|
|
39368
|
-
var ResearchQueryInputSchema =
|
|
39369
|
-
action:
|
|
39505
|
+
var ResearchQueryInputSchema = z71.object({
|
|
39506
|
+
action: z71.enum(["status", "overlap", "stats", "search"]).describe(
|
|
39370
39507
|
"Query action: status (technique status), overlap (find related techniques), stats (registry statistics), search (text search)"
|
|
39371
39508
|
),
|
|
39372
|
-
techniqueId:
|
|
39373
|
-
query:
|
|
39374
|
-
status:
|
|
39375
|
-
threshold:
|
|
39509
|
+
techniqueId: z71.string().optional().describe("Technique ID for status/overlap queries"),
|
|
39510
|
+
query: z71.string().optional().describe("Search query string for search action"),
|
|
39511
|
+
status: z71.enum(["implemented", "planned", "not-started", "rejected", "all"]).optional().default("all").describe("Filter by technique status (for status action)"),
|
|
39512
|
+
threshold: z71.number().min(0).max(1).optional().default(0.3).describe("Overlap threshold (0-1) for overlap action")
|
|
39376
39513
|
});
|
|
39377
39514
|
var ResearchQueryOutputSchema = {
|
|
39378
|
-
action:
|
|
39379
|
-
success:
|
|
39380
|
-
data:
|
|
39381
|
-
rejectionNotice:
|
|
39382
|
-
negativeResults:
|
|
39383
|
-
status:
|
|
39384
|
-
reason:
|
|
39515
|
+
action: z71.string(),
|
|
39516
|
+
success: z71.boolean(),
|
|
39517
|
+
data: z71.unknown(),
|
|
39518
|
+
rejectionNotice: z71.string().optional(),
|
|
39519
|
+
negativeResults: z71.object({
|
|
39520
|
+
status: z71.literal("unavailable"),
|
|
39521
|
+
reason: z71.string()
|
|
39385
39522
|
}).optional()
|
|
39386
39523
|
};
|
|
39387
39524
|
function rejectionMetadataFor(techniqueId) {
|
|
@@ -39519,11 +39656,11 @@ function createResearchQueryHandler(deps) {
|
|
|
39519
39656
|
function registerResearchQueryTool(server, deps) {
|
|
39520
39657
|
const logger57 = deps.logger ?? createLogger({ tool: "research_query" });
|
|
39521
39658
|
const toolSchema = {
|
|
39522
|
-
action:
|
|
39523
|
-
techniqueId:
|
|
39524
|
-
query:
|
|
39525
|
-
status:
|
|
39526
|
-
threshold:
|
|
39659
|
+
action: z71.enum(["status", "overlap", "stats", "search"]).describe("Query action: status, overlap, stats, or search"),
|
|
39660
|
+
techniqueId: z71.string().optional().describe("Technique ID for status/overlap queries"),
|
|
39661
|
+
query: z71.string().optional().describe("Search query string for search action"),
|
|
39662
|
+
status: z71.enum(["implemented", "planned", "not-started", "rejected", "all"]).optional().describe("Filter by technique status"),
|
|
39663
|
+
threshold: z71.number().min(0).max(1).optional().describe("Overlap threshold (0-1) for overlap action")
|
|
39527
39664
|
};
|
|
39528
39665
|
const description = "Query the research registry for technique status, overlaps, statistics, or text search. Provides read-only access to the research tracking system.";
|
|
39529
39666
|
const secureHandler = createSecureHandler(createResearchQueryHandler(deps), {
|
|
@@ -39550,12 +39687,12 @@ function registerResearchQueryTool(server, deps) {
|
|
|
39550
39687
|
}
|
|
39551
39688
|
|
|
39552
39689
|
// src/mcp/tools/research-add.ts
|
|
39553
|
-
import { z as
|
|
39554
|
-
var ResearchAddInputSchema =
|
|
39555
|
-
arxivId:
|
|
39556
|
-
topic:
|
|
39557
|
-
priority:
|
|
39558
|
-
dryRun:
|
|
39690
|
+
import { z as z72 } from "zod";
|
|
39691
|
+
var ResearchAddInputSchema = z72.object({
|
|
39692
|
+
arxivId: z72.string().regex(/^\d{4}\.\d{4,5}$/, "Invalid arXiv ID format (expected XXXX.XXXXX)").describe('arXiv paper ID (e.g., "2401.12345")'),
|
|
39693
|
+
topic: z72.string().optional().describe("Research topic to categorize the paper under"),
|
|
39694
|
+
priority: z72.enum(["P1", "P2", "P3", "P4"]).optional().describe("Priority level for the paper"),
|
|
39695
|
+
dryRun: z72.boolean().optional().default(false).describe("Preview what would be added without persisting")
|
|
39559
39696
|
});
|
|
39560
39697
|
async function executeResearchAdd(input, logger57) {
|
|
39561
39698
|
const exists = await paperExists(input.arxivId);
|
|
@@ -39623,10 +39760,10 @@ function createResearchAddHandler(deps) {
|
|
|
39623
39760
|
function registerResearchAddTool(server, deps) {
|
|
39624
39761
|
const logger57 = deps.logger ?? createLogger({ tool: "research_add" });
|
|
39625
39762
|
const toolSchema = {
|
|
39626
|
-
arxivId:
|
|
39627
|
-
topic:
|
|
39628
|
-
priority:
|
|
39629
|
-
dryRun:
|
|
39763
|
+
arxivId: z72.string().regex(/^\d{4}\.\d{4,5}$/).describe('arXiv paper ID (e.g., "2401.12345")'),
|
|
39764
|
+
topic: z72.string().optional().describe("Research topic to categorize the paper under"),
|
|
39765
|
+
priority: z72.enum(["P1", "P2", "P3", "P4"]).optional().describe("Priority level"),
|
|
39766
|
+
dryRun: z72.boolean().optional().default(false).describe("Preview without persisting")
|
|
39630
39767
|
};
|
|
39631
39768
|
const description = "PAPER-only: add an arXiv preprint to the research registry by arXiv ID. Fetches metadata from arxiv.org and persists to the registry. For non-paper sources (GitHub repos, tools, blogs) use `research_add_source` instead. Use dryRun=true to preview without saving.";
|
|
39632
39769
|
const secureHandler = createSecureHandler(createResearchAddHandler(deps), {
|
|
@@ -39640,11 +39777,11 @@ function registerResearchAddTool(server, deps) {
|
|
|
39640
39777
|
logger: logger57
|
|
39641
39778
|
});
|
|
39642
39779
|
const outputSchema = {
|
|
39643
|
-
success:
|
|
39644
|
-
paperId:
|
|
39645
|
-
title:
|
|
39646
|
-
message:
|
|
39647
|
-
dryRun:
|
|
39780
|
+
success: z72.boolean(),
|
|
39781
|
+
paperId: z72.string().optional(),
|
|
39782
|
+
title: z72.string().optional(),
|
|
39783
|
+
message: z72.string(),
|
|
39784
|
+
dryRun: z72.boolean().optional()
|
|
39648
39785
|
};
|
|
39649
39786
|
server.registerTool(
|
|
39650
39787
|
"research_add",
|
|
@@ -39660,33 +39797,33 @@ function registerResearchAddTool(server, deps) {
|
|
|
39660
39797
|
}
|
|
39661
39798
|
|
|
39662
39799
|
// src/mcp/tools/research-add-source.ts
|
|
39663
|
-
import { z as
|
|
39664
|
-
var SourceTypeEnum =
|
|
39800
|
+
import { z as z73 } from "zod";
|
|
39801
|
+
var SourceTypeEnum = z73.enum([
|
|
39665
39802
|
"product_docs",
|
|
39666
39803
|
"specification",
|
|
39667
39804
|
"research_blog",
|
|
39668
39805
|
"code_analysis",
|
|
39669
39806
|
"open_source_repo"
|
|
39670
39807
|
]);
|
|
39671
|
-
var VerdictEnum =
|
|
39672
|
-
var ResearchAddSourceInputSchema =
|
|
39673
|
-
url:
|
|
39674
|
-
name:
|
|
39808
|
+
var VerdictEnum = z73.enum(["adopted", "partially_adopted", "rejected", "monitoring", "planned"]);
|
|
39809
|
+
var ResearchAddSourceInputSchema = z73.object({
|
|
39810
|
+
url: z73.string().min(1).max(500).describe("Source URL (GitHub repo, docs page, blog post)"),
|
|
39811
|
+
name: z73.string().min(1).max(200).describe("Display name for the source"),
|
|
39675
39812
|
type: SourceTypeEnum.describe("Source type classification"),
|
|
39676
|
-
vendor:
|
|
39677
|
-
topics:
|
|
39678
|
-
tags:
|
|
39679
|
-
quality_signals:
|
|
39680
|
-
stars_at_review:
|
|
39681
|
-
language:
|
|
39682
|
-
has_tests:
|
|
39683
|
-
has_docs:
|
|
39684
|
-
has_paper:
|
|
39813
|
+
vendor: z73.string().max(100).optional().describe("Vendor or organization"),
|
|
39814
|
+
topics: z73.array(z73.string().max(50)).max(5).optional().describe("Research topics (max 5)"),
|
|
39815
|
+
tags: z73.array(z73.string().max(50)).max(10).optional().describe("Searchable tags (max 10)"),
|
|
39816
|
+
quality_signals: z73.object({
|
|
39817
|
+
stars_at_review: z73.number().nonnegative().optional(),
|
|
39818
|
+
language: z73.string().max(50).optional(),
|
|
39819
|
+
has_tests: z73.boolean().optional(),
|
|
39820
|
+
has_docs: z73.boolean().optional(),
|
|
39821
|
+
has_paper: z73.boolean().optional()
|
|
39685
39822
|
}).optional().describe("Quality signals used to compute quality_score; provide explicitly \u2014 no GitHub metadata is fetched"),
|
|
39686
|
-
techniques_extracted:
|
|
39823
|
+
techniques_extracted: z73.array(z73.string().max(100)).max(5).optional().describe("Techniques identified in this source (max 5)"),
|
|
39687
39824
|
verdict: VerdictEnum.optional().describe("Adoption verdict"),
|
|
39688
|
-
verdict_notes:
|
|
39689
|
-
dryRun:
|
|
39825
|
+
verdict_notes: z73.string().max(500).optional().describe("Notes explaining the verdict"),
|
|
39826
|
+
dryRun: z73.boolean().optional().default(false).describe("Preview without persisting")
|
|
39690
39827
|
});
|
|
39691
39828
|
function generateSourceId(url) {
|
|
39692
39829
|
const match = /github\.com\/([^/]+)\/([^/]+)/.exec(url);
|
|
@@ -39826,23 +39963,23 @@ function createResearchAddSourceHandler(deps) {
|
|
|
39826
39963
|
function registerResearchAddSourceTool(server, deps) {
|
|
39827
39964
|
const logger57 = deps.logger ?? createLogger({ tool: "research_add_source" });
|
|
39828
39965
|
const toolSchema = {
|
|
39829
|
-
url:
|
|
39830
|
-
name:
|
|
39966
|
+
url: z73.string().min(1).describe("Source URL"),
|
|
39967
|
+
name: z73.string().min(1).describe("Display name"),
|
|
39831
39968
|
type: SourceTypeEnum.describe("Source type"),
|
|
39832
|
-
vendor:
|
|
39833
|
-
topics:
|
|
39834
|
-
tags:
|
|
39835
|
-
quality_signals:
|
|
39836
|
-
stars_at_review:
|
|
39837
|
-
language:
|
|
39838
|
-
has_tests:
|
|
39839
|
-
has_docs:
|
|
39840
|
-
has_paper:
|
|
39969
|
+
vendor: z73.string().optional().describe("Vendor"),
|
|
39970
|
+
topics: z73.array(z73.string()).max(5).optional().describe("Topics"),
|
|
39971
|
+
tags: z73.array(z73.string()).max(10).optional().describe("Tags"),
|
|
39972
|
+
quality_signals: z73.object({
|
|
39973
|
+
stars_at_review: z73.number().optional(),
|
|
39974
|
+
language: z73.string().optional(),
|
|
39975
|
+
has_tests: z73.boolean().optional(),
|
|
39976
|
+
has_docs: z73.boolean().optional(),
|
|
39977
|
+
has_paper: z73.boolean().optional()
|
|
39841
39978
|
}).optional().describe("Quality signals"),
|
|
39842
|
-
techniques_extracted:
|
|
39979
|
+
techniques_extracted: z73.array(z73.string()).max(5).optional().describe("Techniques"),
|
|
39843
39980
|
verdict: VerdictEnum.optional().describe("Adoption verdict"),
|
|
39844
|
-
verdict_notes:
|
|
39845
|
-
dryRun:
|
|
39981
|
+
verdict_notes: z73.string().max(500).optional().describe("Verdict notes"),
|
|
39982
|
+
dryRun: z73.boolean().optional().default(false).describe("Preview only")
|
|
39846
39983
|
};
|
|
39847
39984
|
const description = "NON-PAPER source: add a GitHub repo / tool / blog URL to the research registry. Auto-computes quality_score from provided quality_signals. For arXiv papers use `research_add` instead. Use dryRun=true to preview without saving.";
|
|
39848
39985
|
const secureHandler = createSecureHandler(createResearchAddSourceHandler(deps), {
|
|
@@ -39868,22 +40005,22 @@ function registerResearchAddSourceTool(server, deps) {
|
|
|
39868
40005
|
);
|
|
39869
40006
|
}
|
|
39870
40007
|
var RESEARCH_ADD_SOURCE_OUTPUT_SCHEMA = {
|
|
39871
|
-
success:
|
|
39872
|
-
sourceId:
|
|
39873
|
-
name:
|
|
39874
|
-
quality_score:
|
|
39875
|
-
evidence_tier:
|
|
39876
|
-
message:
|
|
39877
|
-
dryRun:
|
|
40008
|
+
success: z73.boolean(),
|
|
40009
|
+
sourceId: z73.string().optional(),
|
|
40010
|
+
name: z73.string().optional(),
|
|
40011
|
+
quality_score: z73.number().optional(),
|
|
40012
|
+
evidence_tier: z73.string().optional(),
|
|
40013
|
+
message: z73.string().optional(),
|
|
40014
|
+
dryRun: z73.boolean().optional()
|
|
39878
40015
|
};
|
|
39879
40016
|
|
|
39880
40017
|
// src/mcp/tools/research-discover.ts
|
|
39881
|
-
import { z as
|
|
40018
|
+
import { z as z74 } from "zod";
|
|
39882
40019
|
var MAX_RESULTS_PER_SOURCE = 20;
|
|
39883
40020
|
var DEFAULT_RELEVANCE_THRESHOLD = 0.3;
|
|
39884
|
-
var ResearchDiscoverInputSchema =
|
|
39885
|
-
topic:
|
|
39886
|
-
source:
|
|
40021
|
+
var ResearchDiscoverInputSchema = z74.object({
|
|
40022
|
+
topic: z74.string().min(1).max(200).describe('Research topic to search for (e.g., "multi-agent orchestration")'),
|
|
40023
|
+
source: z74.enum([
|
|
39887
40024
|
"arxiv",
|
|
39888
40025
|
"github",
|
|
39889
40026
|
"google_ai",
|
|
@@ -39897,9 +40034,9 @@ var ResearchDiscoverInputSchema = z73.object({
|
|
|
39897
40034
|
]).optional().default("all").describe(
|
|
39898
40035
|
"Source to search: arxiv, github, google_ai, meta_fair, microsoft, deepmind, semantic_scholar, papers_with_code, openalex, or all"
|
|
39899
40036
|
),
|
|
39900
|
-
maxResults:
|
|
39901
|
-
sinceDate:
|
|
39902
|
-
relevanceThreshold:
|
|
40037
|
+
maxResults: z74.number().min(1).max(MAX_RESULTS_PER_SOURCE).optional().default(10).describe("Maximum results to return"),
|
|
40038
|
+
sinceDate: z74.string().optional().describe("Only return results after this date (YYYY-MM-DD format)"),
|
|
40039
|
+
relevanceThreshold: z74.number().min(0).max(1).optional().default(DEFAULT_RELEVANCE_THRESHOLD).describe(
|
|
39903
40040
|
"Minimum relevance score (0-1) to include in results. Higher values filter more aggressively."
|
|
39904
40041
|
)
|
|
39905
40042
|
});
|
|
@@ -40174,8 +40311,8 @@ function createResearchDiscoverHandler(deps) {
|
|
|
40174
40311
|
function registerResearchDiscoverTool(server, deps) {
|
|
40175
40312
|
const logger57 = deps.logger ?? createLogger({ tool: "research_discover" });
|
|
40176
40313
|
const toolSchema = {
|
|
40177
|
-
topic:
|
|
40178
|
-
source:
|
|
40314
|
+
topic: z74.string().min(1).max(200).describe("Research topic to search for"),
|
|
40315
|
+
source: z74.enum([
|
|
40179
40316
|
"arxiv",
|
|
40180
40317
|
"github",
|
|
40181
40318
|
"google_ai",
|
|
@@ -40187,9 +40324,9 @@ function registerResearchDiscoverTool(server, deps) {
|
|
|
40187
40324
|
"openalex",
|
|
40188
40325
|
"all"
|
|
40189
40326
|
]).optional().describe("Source to search"),
|
|
40190
|
-
maxResults:
|
|
40191
|
-
sinceDate:
|
|
40192
|
-
relevanceThreshold:
|
|
40327
|
+
maxResults: z74.number().min(1).max(MAX_RESULTS_PER_SOURCE).optional().describe("Max results"),
|
|
40328
|
+
sinceDate: z74.string().optional().describe("Only results after this date (YYYY-MM-DD)"),
|
|
40329
|
+
relevanceThreshold: z74.number().min(0).max(1).optional().describe("Minimum relevance score (0-1) to include results. Higher = stricter filtering.")
|
|
40193
40330
|
};
|
|
40194
40331
|
const description = "Discover new research papers and repositories from external sources. Searches arXiv, GitHub, and other sources. Filters out items already in the registry.";
|
|
40195
40332
|
const secureHandler = createSecureHandler(createResearchDiscoverHandler(deps), {
|
|
@@ -40215,24 +40352,24 @@ function registerResearchDiscoverTool(server, deps) {
|
|
|
40215
40352
|
logger57.info("Registered research_discover tool with secure handler and timeout protection");
|
|
40216
40353
|
}
|
|
40217
40354
|
var RESEARCH_DISCOVER_OUTPUT_SCHEMA = {
|
|
40218
|
-
topic:
|
|
40219
|
-
sourcesQueried:
|
|
40220
|
-
failedSources:
|
|
40221
|
-
items:
|
|
40222
|
-
totalFound:
|
|
40223
|
-
alreadyInRegistry:
|
|
40224
|
-
registryConsulted:
|
|
40225
|
-
newItems:
|
|
40226
|
-
filteredByRelevance:
|
|
40355
|
+
topic: z74.string().optional(),
|
|
40356
|
+
sourcesQueried: z74.array(z74.string()).optional(),
|
|
40357
|
+
failedSources: z74.array(z74.string()).optional(),
|
|
40358
|
+
items: z74.array(z74.unknown()).optional(),
|
|
40359
|
+
totalFound: z74.number().optional(),
|
|
40360
|
+
alreadyInRegistry: z74.number().optional(),
|
|
40361
|
+
registryConsulted: z74.boolean().optional(),
|
|
40362
|
+
newItems: z74.number().optional(),
|
|
40363
|
+
filteredByRelevance: z74.number().optional()
|
|
40227
40364
|
};
|
|
40228
40365
|
|
|
40229
40366
|
// src/mcp/tools/research-analyze.ts
|
|
40230
|
-
import { z as
|
|
40231
|
-
var ResearchAnalyzeInputSchema =
|
|
40232
|
-
focus:
|
|
40367
|
+
import { z as z75 } from "zod";
|
|
40368
|
+
var ResearchAnalyzeInputSchema = z75.object({
|
|
40369
|
+
focus: z75.enum(["gaps", "trends", "priorities", "stale", "coverage"]).describe(
|
|
40233
40370
|
"Analysis focus: gaps (missing coverage), trends (topic distribution), priorities (P1/P2 backlog), stale (outdated entries), coverage (implementation status)"
|
|
40234
40371
|
),
|
|
40235
|
-
topic:
|
|
40372
|
+
topic: z75.string().optional().describe("Optional topic filter to narrow analysis")
|
|
40236
40373
|
});
|
|
40237
40374
|
function failureResponse(focus, registry = "techniques") {
|
|
40238
40375
|
return {
|
|
@@ -40478,8 +40615,8 @@ function createResearchAnalyzeHandler(deps) {
|
|
|
40478
40615
|
function registerResearchAnalyzeTool(server, deps) {
|
|
40479
40616
|
const logger57 = deps.logger ?? createLogger({ tool: "research_analyze" });
|
|
40480
40617
|
const toolSchema = {
|
|
40481
|
-
focus:
|
|
40482
|
-
topic:
|
|
40618
|
+
focus: z75.enum(["gaps", "trends", "priorities", "stale", "coverage"]).describe("Analysis focus area"),
|
|
40619
|
+
topic: z75.string().optional().describe("Optional topic filter")
|
|
40483
40620
|
};
|
|
40484
40621
|
const description = "Analyze the research registry for gaps, trends, priorities, stale entries, or coverage. Returns structured analysis with recommendations.";
|
|
40485
40622
|
const secureHandler = createSecureHandler(createResearchAnalyzeHandler(deps), {
|
|
@@ -40493,10 +40630,10 @@ function registerResearchAnalyzeTool(server, deps) {
|
|
|
40493
40630
|
logger: logger57
|
|
40494
40631
|
});
|
|
40495
40632
|
const outputSchema = {
|
|
40496
|
-
focus:
|
|
40497
|
-
success:
|
|
40498
|
-
analysis:
|
|
40499
|
-
recommendations:
|
|
40633
|
+
focus: z75.string().optional(),
|
|
40634
|
+
success: z75.boolean().optional(),
|
|
40635
|
+
analysis: z75.unknown().optional(),
|
|
40636
|
+
recommendations: z75.array(z75.string()).optional()
|
|
40500
40637
|
};
|
|
40501
40638
|
server.registerTool(
|
|
40502
40639
|
"research_analyze",
|
|
@@ -40512,14 +40649,14 @@ function registerResearchAnalyzeTool(server, deps) {
|
|
|
40512
40649
|
}
|
|
40513
40650
|
|
|
40514
40651
|
// src/mcp/tools/research-catalog-review.ts
|
|
40515
|
-
import { z as
|
|
40516
|
-
var ResearchCatalogReviewInputSchema =
|
|
40517
|
-
action:
|
|
40652
|
+
import { z as z76 } from "zod";
|
|
40653
|
+
var ResearchCatalogReviewInputSchema = z76.object({
|
|
40654
|
+
action: z76.enum(["list", "approve", "dismiss", "flush"]).describe(
|
|
40518
40655
|
"Action: list (show pending), approve (add to registry), dismiss (remove), flush (clear all)"
|
|
40519
40656
|
),
|
|
40520
|
-
identifier:
|
|
40521
|
-
topic:
|
|
40522
|
-
createIssue:
|
|
40657
|
+
identifier: z76.string().optional().describe("Reference identifier for approve/dismiss actions (arXiv ID or GitHub URL)"),
|
|
40658
|
+
topic: z76.string().optional().describe("Topic to assign when approving an arXiv paper"),
|
|
40659
|
+
createIssue: z76.boolean().optional().default(false).describe("When approving, also create a GitHub issue for the paper")
|
|
40523
40660
|
});
|
|
40524
40661
|
function handleList() {
|
|
40525
40662
|
const catalog = getAutoCatalog();
|
|
@@ -40651,10 +40788,10 @@ function createCatalogReviewHandler(deps) {
|
|
|
40651
40788
|
function registerResearchCatalogReviewTool(server, deps) {
|
|
40652
40789
|
const logger57 = deps.logger ?? createLogger({ tool: "research_catalog_review" });
|
|
40653
40790
|
const toolSchema = {
|
|
40654
|
-
action:
|
|
40655
|
-
identifier:
|
|
40656
|
-
topic:
|
|
40657
|
-
createIssue:
|
|
40791
|
+
action: z76.enum(["list", "approve", "dismiss", "flush"]).describe("Action to perform on cataloged references"),
|
|
40792
|
+
identifier: z76.string().optional().describe("Reference identifier for approve/dismiss"),
|
|
40793
|
+
topic: z76.string().optional().describe("Topic for approved papers"),
|
|
40794
|
+
createIssue: z76.boolean().optional().describe("Create GitHub issue when approving")
|
|
40658
40795
|
};
|
|
40659
40796
|
const description = "Review auto-cataloged research references found during tool execution. List pending references, approve them for registry addition (optionally filing a GitHub issue), dismiss, or clear all.";
|
|
40660
40797
|
const secureHandler = createSecureHandler(createCatalogReviewHandler(deps), {
|
|
@@ -40668,10 +40805,10 @@ function registerResearchCatalogReviewTool(server, deps) {
|
|
|
40668
40805
|
logger: logger57
|
|
40669
40806
|
});
|
|
40670
40807
|
const outputSchema = {
|
|
40671
|
-
action:
|
|
40672
|
-
success:
|
|
40673
|
-
message:
|
|
40674
|
-
data:
|
|
40808
|
+
action: z76.string().optional(),
|
|
40809
|
+
success: z76.boolean().optional(),
|
|
40810
|
+
message: z76.string().optional(),
|
|
40811
|
+
data: z76.unknown().optional()
|
|
40675
40812
|
};
|
|
40676
40813
|
server.registerTool(
|
|
40677
40814
|
"research_catalog_review",
|
|
@@ -40687,9 +40824,9 @@ function registerResearchCatalogReviewTool(server, deps) {
|
|
|
40687
40824
|
}
|
|
40688
40825
|
|
|
40689
40826
|
// src/mcp/tools/research-synthesize.ts
|
|
40690
|
-
import { z as
|
|
40691
|
-
var ResearchSynthesizeInputSchema =
|
|
40692
|
-
topic:
|
|
40827
|
+
import { z as z77 } from "zod";
|
|
40828
|
+
var ResearchSynthesizeInputSchema = z77.object({
|
|
40829
|
+
topic: z77.string().optional().describe("Optional topic to filter synthesis to a single cluster")
|
|
40693
40830
|
});
|
|
40694
40831
|
function createResearchSynthesizeHandler(deps) {
|
|
40695
40832
|
return async (args, _ctx) => {
|
|
@@ -40716,7 +40853,7 @@ function createResearchSynthesizeHandler(deps) {
|
|
|
40716
40853
|
function registerResearchSynthesizeTool(server, deps) {
|
|
40717
40854
|
const logger57 = deps.logger ?? createLogger({ tool: "research_synthesize" });
|
|
40718
40855
|
const toolSchema = {
|
|
40719
|
-
topic:
|
|
40856
|
+
topic: z77.string().optional().describe("Optional topic filter for single-cluster synthesis")
|
|
40720
40857
|
};
|
|
40721
40858
|
const description = "Synthesize the research registry by grouping papers into topic clusters. Returns structured summaries with common themes, key insights, techniques, implementation opportunities, and cross-cutting themes across clusters.";
|
|
40722
40859
|
const secureHandler = createSecureHandler(createResearchSynthesizeHandler(deps), {
|
|
@@ -40730,12 +40867,12 @@ function registerResearchSynthesizeTool(server, deps) {
|
|
|
40730
40867
|
logger: logger57
|
|
40731
40868
|
});
|
|
40732
40869
|
const outputSchema = {
|
|
40733
|
-
clusters:
|
|
40734
|
-
totalPapers:
|
|
40735
|
-
topicCount:
|
|
40736
|
-
crossCuttingThemes:
|
|
40737
|
-
alignmentSummary:
|
|
40738
|
-
featureGates:
|
|
40870
|
+
clusters: z77.array(z77.unknown()).optional(),
|
|
40871
|
+
totalPapers: z77.number().optional(),
|
|
40872
|
+
topicCount: z77.number().optional(),
|
|
40873
|
+
crossCuttingThemes: z77.array(z77.unknown()).optional(),
|
|
40874
|
+
alignmentSummary: z77.unknown().optional(),
|
|
40875
|
+
featureGates: z77.array(z77.unknown()).optional()
|
|
40739
40876
|
};
|
|
40740
40877
|
server.registerTool(
|
|
40741
40878
|
"research_synthesize",
|
|
@@ -40751,10 +40888,10 @@ function registerResearchSynthesizeTool(server, deps) {
|
|
|
40751
40888
|
}
|
|
40752
40889
|
|
|
40753
40890
|
// src/mcp/tools/issue-triage-tool.ts
|
|
40754
|
-
import { z as
|
|
40755
|
-
var IssueTriageInputSchema =
|
|
40756
|
-
issueUrl:
|
|
40757
|
-
dryRun:
|
|
40891
|
+
import { z as z78 } from "zod";
|
|
40892
|
+
var IssueTriageInputSchema = z78.object({
|
|
40893
|
+
issueUrl: z78.string().min(1).refine((v) => /^https?:\/\//i.test(v), "Only HTTP/HTTPS URLs are allowed").describe("GitHub issue URL (e.g., https://github.com/owner/repo/issues/123)"),
|
|
40894
|
+
dryRun: z78.boolean().optional().default(true).describe("Read-only mode (default: true). When false, may apply labels.")
|
|
40758
40895
|
});
|
|
40759
40896
|
function buildTriageResponse(value) {
|
|
40760
40897
|
return {
|
|
@@ -40809,8 +40946,8 @@ function createIssueTriageHandler(_deps) {
|
|
|
40809
40946
|
function registerIssueTriageTool(server, deps) {
|
|
40810
40947
|
const logger57 = deps.logger ?? createLogger({ tool: "issue_triage" });
|
|
40811
40948
|
const toolSchema = {
|
|
40812
|
-
issueUrl:
|
|
40813
|
-
dryRun:
|
|
40949
|
+
issueUrl: z78.string().min(1).describe("GitHub issue URL (e.g., https://github.com/owner/repo/issues/123)"),
|
|
40950
|
+
dryRun: z78.boolean().optional().default(true).describe("Read-only mode (default: true)")
|
|
40814
40951
|
};
|
|
40815
40952
|
const description = "Triage a GitHub issue using the full security pipeline. Classifies the issue, assesses author trust and reputation, proposes labels and actions, and validates all outputs through policy gate and corroboration checks. Read-only by default. Requires GITHUB_TOKEN or GH_TOKEN environment variable, or gh CLI auth.";
|
|
40816
40953
|
const secureHandler = createSecureHandler(createIssueTriageHandler(deps), {
|
|
@@ -40889,7 +41026,7 @@ function recordTriageOutcome(success, durationMs, errorMsg) {
|
|
|
40889
41026
|
}
|
|
40890
41027
|
|
|
40891
41028
|
// src/mcp/tools/run-graph-workflow.ts
|
|
40892
|
-
import { z as
|
|
41029
|
+
import { z as z79 } from "zod";
|
|
40893
41030
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
40894
41031
|
|
|
40895
41032
|
// src/mcp/tools/run-graph-workflow-events.ts
|
|
@@ -40941,11 +41078,11 @@ function formatDetail(event) {
|
|
|
40941
41078
|
}
|
|
40942
41079
|
|
|
40943
41080
|
// src/mcp/tools/run-graph-workflow.ts
|
|
40944
|
-
var RunGraphWorkflowInputSchema =
|
|
40945
|
-
workflow:
|
|
40946
|
-
inputs:
|
|
40947
|
-
enableCheckpointing:
|
|
40948
|
-
enableAuditTrail:
|
|
41081
|
+
var RunGraphWorkflowInputSchema = z79.object({
|
|
41082
|
+
workflow: z79.string().min(1).max(100).describe("Name of the predefined graph workflow to execute"),
|
|
41083
|
+
inputs: z79.record(z79.string(), z79.unknown()).optional().default({}).describe("Input values for the workflow"),
|
|
41084
|
+
enableCheckpointing: z79.boolean().optional().default(true).describe("Enable checkpoint saving between steps"),
|
|
41085
|
+
enableAuditTrail: z79.boolean().optional().default(false).describe("Enable audit trail event logging"),
|
|
40949
41086
|
/**
|
|
40950
41087
|
* Dispatch mode (#3732). `sync` (default) runs the graph workflow inline and
|
|
40951
41088
|
* returns the result — but a workflow of up to ~100 expert nodes can exceed
|
|
@@ -41043,12 +41180,12 @@ async function handleRunGraphWorkflow(input, logger57, auditLogger, signal) {
|
|
|
41043
41180
|
}
|
|
41044
41181
|
var GRAPH_WORKFLOW_DESCRIPTION = "Run a DAG-shaped workflow with per-node checkpoints, event streaming, and an audit trail. Checkpoints drive the executor in-process recovery (crash-resume + selective node retry) and inspection \u2014 the MCP call is fire-and-forget with NO caller resume input, and the checkpoint store is in-memory (not durable across process restarts). For straight linear templates, use `run_workflow` instead. Supports dispatch: 'async' \u2014 returns a jobId immediately; poll get_job_result.";
|
|
41045
41182
|
var GRAPH_WORKFLOW_SCHEMA = {
|
|
41046
|
-
workflow:
|
|
41183
|
+
workflow: z79.string().min(1).max(100).describe(
|
|
41047
41184
|
'Workflow name: echo, pipeline, code-review, security-scan. Use "list" for available workflows.'
|
|
41048
41185
|
),
|
|
41049
|
-
inputs:
|
|
41050
|
-
enableCheckpointing:
|
|
41051
|
-
enableAuditTrail:
|
|
41186
|
+
inputs: z79.record(z79.string(), z79.unknown()).optional().describe("Input values for the workflow"),
|
|
41187
|
+
enableCheckpointing: z79.boolean().optional().describe("Enable checkpoint saving"),
|
|
41188
|
+
enableAuditTrail: z79.boolean().optional().describe("Enable audit trail logging"),
|
|
41052
41189
|
// #4968: the same fragment the internal schema composes — the advertised
|
|
41053
41190
|
// shape is what the SDK parses, so the wrong-key trap must be here too.
|
|
41054
41191
|
...asyncDispatchInput("Ignored for the `list` sentinel.")
|
|
@@ -41656,11 +41793,11 @@ function suggestImprovement(criterion) {
|
|
|
41656
41793
|
}
|
|
41657
41794
|
|
|
41658
41795
|
// src/mcp/tools/execute-spec-tool.ts
|
|
41659
|
-
import { z as
|
|
41796
|
+
import { z as z80 } from "zod";
|
|
41660
41797
|
import { randomUUID as randomUUID12 } from "node:crypto";
|
|
41661
|
-
var ExecuteSpecInputSchema =
|
|
41662
|
-
spec:
|
|
41663
|
-
dryRun:
|
|
41798
|
+
var ExecuteSpecInputSchema = z80.object({
|
|
41799
|
+
spec: z80.string().min(1).max(5e4).describe("Markdown specification to execute"),
|
|
41800
|
+
dryRun: z80.boolean().optional().default(false).describe("Parse and decompose only"),
|
|
41664
41801
|
/**
|
|
41665
41802
|
* Dispatch mode (#3732). `sync` (default) runs the full DAG pipeline inline
|
|
41666
41803
|
* and returns the result — but a real parse→decompose→compile→execute→
|
|
@@ -41772,10 +41909,10 @@ function registerExecuteSpecTool(server, deps) {
|
|
|
41772
41909
|
const timeoutMs = getToolTimeout("execute_spec", deps.security);
|
|
41773
41910
|
const wrapped = wrapToolWithTimeout("execute_spec", secureHandler, { timeoutMs, logger: logger57 });
|
|
41774
41911
|
const toolSchema = {
|
|
41775
|
-
spec:
|
|
41912
|
+
spec: z80.string().min(1).max(5e4).describe(
|
|
41776
41913
|
'Markdown specification to execute. Must contain "## Requirements" and "## Acceptance Criteria" sections.'
|
|
41777
41914
|
),
|
|
41778
|
-
dryRun:
|
|
41915
|
+
dryRun: z80.boolean().optional().describe("Parse and decompose only (no execution)"),
|
|
41779
41916
|
// #4968: the same fragment the internal schema composes — the advertised
|
|
41780
41917
|
// shape is what the SDK parses, so the wrong-key trap must be here too.
|
|
41781
41918
|
...asyncDispatchInput("Ignored for dryRun.")
|
|
@@ -41846,11 +41983,11 @@ function recordSpecOutcome(success, durationMs, stage) {
|
|
|
41846
41983
|
}
|
|
41847
41984
|
|
|
41848
41985
|
// src/mcp/tools/memory-query.ts
|
|
41849
|
-
import { z as
|
|
41850
|
-
var MemoryQueryInputSchema =
|
|
41851
|
-
query:
|
|
41852
|
-
limit:
|
|
41853
|
-
source:
|
|
41986
|
+
import { z as z81 } from "zod";
|
|
41987
|
+
var MemoryQueryInputSchema = z81.object({
|
|
41988
|
+
query: z81.string().min(1).max(500).describe("Search query to match against memory contents"),
|
|
41989
|
+
limit: z81.number().int().min(1).max(50).optional().default(10).describe("Maximum results to return (default: 10, max: 50)"),
|
|
41990
|
+
source: z81.enum(["session", "belief", "agentic", "typed", "adaptive", "all"]).optional().default("all").describe("Filter by memory source (default: all)")
|
|
41854
41991
|
});
|
|
41855
41992
|
function describeBackendCoverage(memory, source) {
|
|
41856
41993
|
const optional = [
|
|
@@ -41957,9 +42094,9 @@ async function memoryQueryHandler(args, ctx) {
|
|
|
41957
42094
|
function registerMemoryQueryTool(server, deps) {
|
|
41958
42095
|
const logger57 = deps.logger ?? createLogger({ tool: "memory_query" });
|
|
41959
42096
|
const toolSchema = {
|
|
41960
|
-
query:
|
|
41961
|
-
limit:
|
|
41962
|
-
source:
|
|
42097
|
+
query: z81.string().min(1).max(500).describe("Search query to match against memory contents"),
|
|
42098
|
+
limit: z81.number().int().min(1).max(50).optional().describe("Maximum results to return (default: 10, max: 50)"),
|
|
42099
|
+
source: z81.enum(["session", "belief", "agentic", "typed", "adaptive", "all"]).optional().describe("Filter by memory source (default: all)")
|
|
41963
42100
|
};
|
|
41964
42101
|
const description = "Query across all memory backends (session, belief, agentic, adaptive, typed) with unified results. Returns memories matching the query with source attribution and relevance scores.";
|
|
41965
42102
|
const secureHandler = createSecureHandler(memoryQueryHandler, {
|
|
@@ -41970,19 +42107,19 @@ function registerMemoryQueryTool(server, deps) {
|
|
|
41970
42107
|
const timeoutMs = getToolTimeout("memory_query", deps.security);
|
|
41971
42108
|
const wrappedHandler = wrapToolWithTimeout("memory_query", secureHandler, { timeoutMs, logger: logger57 });
|
|
41972
42109
|
const outputSchema = {
|
|
41973
|
-
query:
|
|
41974
|
-
expandedQuery:
|
|
41975
|
-
results:
|
|
41976
|
-
count:
|
|
41977
|
-
source:
|
|
42110
|
+
query: z81.string(),
|
|
42111
|
+
expandedQuery: z81.string().optional(),
|
|
42112
|
+
results: z81.array(z81.unknown()),
|
|
42113
|
+
count: z81.number(),
|
|
42114
|
+
source: z81.string(),
|
|
41978
42115
|
// #4999: the SDK validates structured content against this schema with
|
|
41979
42116
|
// `additionalProperties: false`, so a field added to the response and not
|
|
41980
42117
|
// declared here makes EVERY call fail with -32602 rather than merely going
|
|
41981
42118
|
// unreported. The integration test caught that; the unit tests could not,
|
|
41982
42119
|
// because they call the handler directly and never cross the protocol.
|
|
41983
|
-
searched:
|
|
41984
|
-
unavailable:
|
|
41985
|
-
errored:
|
|
42120
|
+
searched: z81.array(z81.string()),
|
|
42121
|
+
unavailable: z81.array(z81.string()),
|
|
42122
|
+
errored: z81.array(z81.string())
|
|
41986
42123
|
};
|
|
41987
42124
|
server.registerTool(
|
|
41988
42125
|
"memory_query",
|
|
@@ -41998,9 +42135,9 @@ function registerMemoryQueryTool(server, deps) {
|
|
|
41998
42135
|
}
|
|
41999
42136
|
|
|
42000
42137
|
// src/mcp/tools/memory-stats.ts
|
|
42001
|
-
import { z as
|
|
42002
|
-
var MemoryStatsInputSchema =
|
|
42003
|
-
includeDecay:
|
|
42138
|
+
import { z as z82 } from "zod";
|
|
42139
|
+
var MemoryStatsInputSchema = z82.object({
|
|
42140
|
+
includeDecay: z82.boolean().optional().default(true).describe("Include decay statistics (default: true)")
|
|
42004
42141
|
});
|
|
42005
42142
|
function collectSessionStats(toolMemory) {
|
|
42006
42143
|
const counts = toolMemory.getSessionCounts();
|
|
@@ -42117,7 +42254,7 @@ async function memoryStatsHandler(args, ctx) {
|
|
|
42117
42254
|
function registerMemoryStatsTool(server, deps) {
|
|
42118
42255
|
const logger57 = deps.logger ?? createLogger({ tool: "memory_stats" });
|
|
42119
42256
|
const toolSchema = {
|
|
42120
|
-
includeDecay:
|
|
42257
|
+
includeDecay: z82.boolean().optional().describe("Include decay statistics (default: true)")
|
|
42121
42258
|
};
|
|
42122
42259
|
const description = "Get memory system statistics dashboard. Shows backend availability, entry counts, and decay stats across all 7 memory backends.";
|
|
42123
42260
|
const secureHandler = createSecureHandler(memoryStatsHandler, {
|
|
@@ -42128,14 +42265,14 @@ function registerMemoryStatsTool(server, deps) {
|
|
|
42128
42265
|
const timeoutMs = getToolTimeout("memory_stats", deps.security);
|
|
42129
42266
|
const wrappedHandler = wrapToolWithTimeout("memory_stats", secureHandler, { timeoutMs, logger: logger57 });
|
|
42130
42267
|
const outputSchema = {
|
|
42131
|
-
backends:
|
|
42132
|
-
session:
|
|
42133
|
-
belief:
|
|
42134
|
-
typed:
|
|
42135
|
-
mobimem:
|
|
42136
|
-
decay:
|
|
42137
|
-
registry:
|
|
42138
|
-
collectedAt:
|
|
42268
|
+
backends: z82.unknown(),
|
|
42269
|
+
session: z82.unknown().optional(),
|
|
42270
|
+
belief: z82.unknown().optional(),
|
|
42271
|
+
typed: z82.unknown().optional(),
|
|
42272
|
+
mobimem: z82.unknown().optional(),
|
|
42273
|
+
decay: z82.unknown().optional(),
|
|
42274
|
+
registry: z82.array(z82.unknown()).optional(),
|
|
42275
|
+
collectedAt: z82.string().optional()
|
|
42139
42276
|
};
|
|
42140
42277
|
server.registerTool(
|
|
42141
42278
|
"memory_stats",
|
|
@@ -42151,15 +42288,15 @@ function registerMemoryStatsTool(server, deps) {
|
|
|
42151
42288
|
}
|
|
42152
42289
|
|
|
42153
42290
|
// src/mcp/tools/memory-write.ts
|
|
42154
|
-
import { z as
|
|
42155
|
-
var MemoryWriteInputSchema =
|
|
42156
|
-
key:
|
|
42157
|
-
content:
|
|
42158
|
-
backend:
|
|
42291
|
+
import { z as z83 } from "zod";
|
|
42292
|
+
var MemoryWriteInputSchema = z83.object({
|
|
42293
|
+
key: z83.string().min(1).max(200).describe("Memory identifier or subject"),
|
|
42294
|
+
content: z83.string().min(1).max(5e3).describe("Memory content to store"),
|
|
42295
|
+
backend: z83.enum(["session", "belief", "agentic", "adaptive", "typed"]).describe(
|
|
42159
42296
|
"Target memory backend: session (learnings), belief (triples), agentic (knowledge), adaptive (priority-scored), typed (MIRIX-style semantic)"
|
|
42160
42297
|
),
|
|
42161
|
-
confidence:
|
|
42162
|
-
metadata:
|
|
42298
|
+
confidence: z83.enum(["high", "medium", "low"]).optional().default("medium").describe("Confidence level (default: medium)"),
|
|
42299
|
+
metadata: z83.record(z83.string().max(100), z83.string().max(500)).optional().describe("Optional key-value metadata tags")
|
|
42163
42300
|
});
|
|
42164
42301
|
function writeToSession(key, content, confidence) {
|
|
42165
42302
|
const toolMemory = getToolMemory();
|
|
@@ -42312,13 +42449,13 @@ async function memoryWriteHandler(args, ctx) {
|
|
|
42312
42449
|
function registerMemoryWriteTool(server, deps) {
|
|
42313
42450
|
const logger57 = deps.logger ?? createLogger({ tool: "memory_write" });
|
|
42314
42451
|
const toolSchema = {
|
|
42315
|
-
key:
|
|
42316
|
-
content:
|
|
42317
|
-
backend:
|
|
42452
|
+
key: z83.string().min(1).max(200).describe("Memory identifier or subject"),
|
|
42453
|
+
content: z83.string().min(1).max(5e3).describe("Memory content to store"),
|
|
42454
|
+
backend: z83.enum(["session", "belief", "agentic", "adaptive", "typed"]).describe(
|
|
42318
42455
|
"Target memory backend: session (learnings), belief (triples), agentic (knowledge), adaptive (priority-scored), typed (MIRIX-style semantic)"
|
|
42319
42456
|
),
|
|
42320
|
-
confidence:
|
|
42321
|
-
metadata:
|
|
42457
|
+
confidence: z83.enum(["high", "medium", "low"]).optional().describe("Confidence level (default: medium)"),
|
|
42458
|
+
metadata: z83.record(z83.string().max(100), z83.string().max(500)).optional().describe("Optional key-value metadata tags")
|
|
42322
42459
|
};
|
|
42323
42460
|
const description = "Write a memory entry to a specific backend. Supports session (learnings), belief assertions (subject + object; predicate fixed as `has_knowledge`), agentic (knowledge with attributes), adaptive (priority-scored), and typed (MIRIX-style semantic) backends.";
|
|
42324
42461
|
const secureHandler = createSecureHandler(memoryWriteHandler, {
|
|
@@ -42330,11 +42467,11 @@ function registerMemoryWriteTool(server, deps) {
|
|
|
42330
42467
|
const timeoutMs = getToolTimeout("memory_write", deps.security);
|
|
42331
42468
|
const wrappedHandler = wrapToolWithTimeout("memory_write", guardedHandler, { timeoutMs, logger: logger57 });
|
|
42332
42469
|
const outputSchema = {
|
|
42333
|
-
success:
|
|
42334
|
-
backend:
|
|
42335
|
-
key:
|
|
42336
|
-
deduplicated:
|
|
42337
|
-
error:
|
|
42470
|
+
success: z83.boolean(),
|
|
42471
|
+
backend: z83.string(),
|
|
42472
|
+
key: z83.string(),
|
|
42473
|
+
deduplicated: z83.boolean().optional(),
|
|
42474
|
+
error: z83.string().optional()
|
|
42338
42475
|
};
|
|
42339
42476
|
server.registerTool(
|
|
42340
42477
|
"memory_write",
|
|
@@ -42350,7 +42487,7 @@ function registerMemoryWriteTool(server, deps) {
|
|
|
42350
42487
|
}
|
|
42351
42488
|
|
|
42352
42489
|
// src/mcp/tools/weather-report-tool.ts
|
|
42353
|
-
import { z as
|
|
42490
|
+
import { z as z84 } from "zod";
|
|
42354
42491
|
function serializeReport(report) {
|
|
42355
42492
|
return {
|
|
42356
42493
|
...report,
|
|
@@ -42401,8 +42538,8 @@ function weatherReportHandler(args, ctx) {
|
|
|
42401
42538
|
function registerWeatherReportTool(server, deps) {
|
|
42402
42539
|
const logger57 = deps.logger ?? createLogger({ tool: "weather_report" });
|
|
42403
42540
|
const toolSchema = {
|
|
42404
|
-
cli:
|
|
42405
|
-
category:
|
|
42541
|
+
cli: z84.enum(["claude", "gemini", "codex", "opencode"]).optional().describe("Filter by CLI"),
|
|
42542
|
+
category: z84.enum([
|
|
42406
42543
|
"architecture",
|
|
42407
42544
|
"code_generation",
|
|
42408
42545
|
"code_review",
|
|
@@ -42414,7 +42551,7 @@ function registerWeatherReportTool(server, deps) {
|
|
|
42414
42551
|
"devops",
|
|
42415
42552
|
"exploration"
|
|
42416
42553
|
]).optional().describe("Filter by task category"),
|
|
42417
|
-
includeAdaptive:
|
|
42554
|
+
includeAdaptive: z84.boolean().optional().describe("Include adaptive routing bonuses (default: true)")
|
|
42418
42555
|
};
|
|
42419
42556
|
const description = "Get multi-CLI performance weather report. Shows per-CLI success rates, per-category breakdowns, and adaptive routing bonus recommendations based on observed task outcomes.";
|
|
42420
42557
|
const secureHandler = createSecureHandler(weatherReportHandler, {
|
|
@@ -42436,18 +42573,18 @@ function registerWeatherReportTool(server, deps) {
|
|
|
42436
42573
|
}
|
|
42437
42574
|
|
|
42438
42575
|
// src/mcp/tools/registry-import-types.ts
|
|
42439
|
-
import { z as
|
|
42440
|
-
var RegistryImportInputSchema =
|
|
42576
|
+
import { z as z85 } from "zod";
|
|
42577
|
+
var RegistryImportInputSchema = z85.object({
|
|
42441
42578
|
/** Model provider. */
|
|
42442
|
-
provider:
|
|
42579
|
+
provider: z85.enum(["anthropic", "google", "openai"]).describe("Model provider (anthropic, google, openai)"),
|
|
42443
42580
|
/** Model identifier from the provider (e.g., "claude-4-opus-20260201"). */
|
|
42444
|
-
modelId:
|
|
42581
|
+
modelId: z85.string().min(1).describe("Provider model identifier"),
|
|
42445
42582
|
/** No-op flag echoed back in the response; the tool never persists regardless. */
|
|
42446
|
-
dryRun:
|
|
42583
|
+
dryRun: z85.boolean().optional().default(true).describe("No-op flag echoed back in the response; the tool never persists regardless")
|
|
42447
42584
|
});
|
|
42448
42585
|
|
|
42449
42586
|
// src/mcp/tools/registry-import-tool.ts
|
|
42450
|
-
import { z as
|
|
42587
|
+
import { z as z86 } from "zod";
|
|
42451
42588
|
|
|
42452
42589
|
// src/mcp/tools/registry-import.ts
|
|
42453
42590
|
var PROVIDER_CLI_MAP = {
|
|
@@ -42557,9 +42694,9 @@ function registryImportHandler(args, ctx) {
|
|
|
42557
42694
|
function registerRegistryImportTool(server, deps) {
|
|
42558
42695
|
const logger57 = deps.logger ?? createLogger({ tool: "registry_import" });
|
|
42559
42696
|
const toolSchema = {
|
|
42560
|
-
provider:
|
|
42561
|
-
modelId:
|
|
42562
|
-
dryRun:
|
|
42697
|
+
provider: z86.enum(["anthropic", "google", "openai"]).describe("Model provider (anthropic, google, openai)"),
|
|
42698
|
+
modelId: z86.string().min(1).describe("Provider model identifier"),
|
|
42699
|
+
dryRun: z86.boolean().optional().describe("No-op flag echoed back in the response; the tool never persists regardless")
|
|
42563
42700
|
};
|
|
42564
42701
|
const description = "Draft a registry ENTRY for a NEW model so routing can consider it later. Generates a ModelCapability YAML with conservative quality scores (5/10) for human review. Always returns a draft entry for human review (never persists). For picking among ALREADY-registered models, use `delegate_to_model`.";
|
|
42565
42702
|
const secureHandler = createSecureHandler(registryImportHandler, {
|
|
@@ -42582,10 +42719,10 @@ function registerRegistryImportTool(server, deps) {
|
|
|
42582
42719
|
}
|
|
42583
42720
|
|
|
42584
42721
|
// src/mcp/tools/repo-analyze-types.ts
|
|
42585
|
-
import { z as
|
|
42586
|
-
var RepoAnalyzeInputSchema =
|
|
42722
|
+
import { z as z87 } from "zod";
|
|
42723
|
+
var RepoAnalyzeInputSchema = z87.object({
|
|
42587
42724
|
/** GitHub repository in "owner/name" format or full URL. */
|
|
42588
|
-
repo:
|
|
42725
|
+
repo: z87.string().min(1).refine(
|
|
42589
42726
|
(v) => !v.includes("://") || /^https?:\/\//i.test(v),
|
|
42590
42727
|
"Only HTTP/HTTPS URLs are allowed"
|
|
42591
42728
|
).describe('GitHub repository in "owner/name" format (e.g., "cloudfoundry/korifi") or full URL'),
|
|
@@ -42594,13 +42731,13 @@ var RepoAnalyzeInputSchema = z86.object({
|
|
|
42594
42731
|
* analysis. Both values resolve to identical behavior; retained for input-shape
|
|
42595
42732
|
* stability until a distinct shallow path is implemented.
|
|
42596
42733
|
*/
|
|
42597
|
-
depth:
|
|
42734
|
+
depth: z87.enum(["shallow", "deep"]).optional().default("shallow").describe(
|
|
42598
42735
|
"Currently a no-op \u2014 the handler always runs the full analysis (both values identical)"
|
|
42599
42736
|
)
|
|
42600
42737
|
});
|
|
42601
42738
|
|
|
42602
42739
|
// src/mcp/tools/repo-analyze-tool.ts
|
|
42603
|
-
import { z as
|
|
42740
|
+
import { z as z88 } from "zod";
|
|
42604
42741
|
async function repoAnalyzeHandler(args, ctx) {
|
|
42605
42742
|
const parsed = RepoAnalyzeInputSchema.safeParse(args);
|
|
42606
42743
|
if (!parsed.success) {
|
|
@@ -42619,8 +42756,8 @@ async function repoAnalyzeHandler(args, ctx) {
|
|
|
42619
42756
|
function registerRepoAnalyzeTool(server, deps) {
|
|
42620
42757
|
const logger57 = deps.logger ?? createLogger({ tool: "repo_analyze" });
|
|
42621
42758
|
const toolSchema = {
|
|
42622
|
-
repo:
|
|
42623
|
-
depth:
|
|
42759
|
+
repo: z88.string().min(1).describe('GitHub repository in "owner/name" format or full URL'),
|
|
42760
|
+
depth: z88.enum(["shallow", "deep"]).optional().describe("Currently a no-op \u2014 the handler always runs the full analysis (both values identical)")
|
|
42624
42761
|
};
|
|
42625
42762
|
const description = "Analyze a GitHub repository structure. Returns language, framework, package manager, CI provider, security tooling, Dockerfile/Helm/Makefile detection, and gap identification. Replaces multi-step manual inspection with a single structured query.";
|
|
42626
42763
|
const secureHandler = createSecureHandler(repoAnalyzeHandler, {
|
|
@@ -42642,18 +42779,18 @@ function registerRepoAnalyzeTool(server, deps) {
|
|
|
42642
42779
|
}
|
|
42643
42780
|
|
|
42644
42781
|
// src/mcp/tools/repo-security-plan-types.ts
|
|
42645
|
-
import { z as
|
|
42646
|
-
var RepoSecurityPlanInputSchema =
|
|
42782
|
+
import { z as z89 } from "zod";
|
|
42783
|
+
var RepoSecurityPlanInputSchema = z89.object({
|
|
42647
42784
|
/** GitHub repository in "owner/name" format or full URL. */
|
|
42648
|
-
repo:
|
|
42785
|
+
repo: z89.string().min(1).describe('GitHub repository in "owner/name" format or full URL'),
|
|
42649
42786
|
/** Filter to specific scanner categories. */
|
|
42650
|
-
categories:
|
|
42787
|
+
categories: z89.array(z89.string()).optional().describe('Filter to specific categories (e.g., ["sast", "sca", "secrets"])'),
|
|
42651
42788
|
/** Maximum number of scanners to recommend. */
|
|
42652
|
-
maxScanners:
|
|
42789
|
+
maxScanners: z89.number().min(1).max(20).optional().default(10).describe("Maximum scanners to recommend (default: 10)")
|
|
42653
42790
|
});
|
|
42654
42791
|
|
|
42655
42792
|
// src/mcp/tools/repo-security-plan-tool.ts
|
|
42656
|
-
import { z as
|
|
42793
|
+
import { z as z90 } from "zod";
|
|
42657
42794
|
async function handler(args, ctx) {
|
|
42658
42795
|
const parsed = RepoSecurityPlanInputSchema.safeParse(args);
|
|
42659
42796
|
if (!parsed.success) {
|
|
@@ -42672,9 +42809,9 @@ async function handler(args, ctx) {
|
|
|
42672
42809
|
function registerRepoSecurityPlanTool(server, deps) {
|
|
42673
42810
|
const logger57 = deps.logger ?? createLogger({ tool: "repo_security_plan" });
|
|
42674
42811
|
const toolSchema = {
|
|
42675
|
-
repo:
|
|
42676
|
-
categories:
|
|
42677
|
-
maxScanners:
|
|
42812
|
+
repo: z90.string().min(1).describe('GitHub repository in "owner/name" format or full URL'),
|
|
42813
|
+
categories: z90.array(z90.string().max(50)).max(10).optional().describe('Filter to specific categories (e.g., ["sast", "sca", "secrets"])'),
|
|
42814
|
+
maxScanners: z90.number().min(1).max(20).optional().describe("Maximum scanners to recommend (default: 10)")
|
|
42678
42815
|
};
|
|
42679
42816
|
const description = "Generate a security scanning pipeline recommendation for a GitHub repository. Analyzes repo structure, detects languages/frameworks, and recommends specific vulnerability scanners with CI config snippets. Powered by the vulnerability scanner registry with provenance-tracked metrics.";
|
|
42680
42817
|
const secureHandler = createSecureHandler(handler, {
|
|
@@ -42697,13 +42834,13 @@ function registerRepoSecurityPlanTool(server, deps) {
|
|
|
42697
42834
|
|
|
42698
42835
|
// src/mcp/tools/search-codebase-tool.ts
|
|
42699
42836
|
import { resolve as resolve6, sep as sep3 } from "node:path";
|
|
42700
|
-
import { z as
|
|
42701
|
-
var SearchCodebaseInputSchema =
|
|
42702
|
-
query:
|
|
42703
|
-
directory:
|
|
42704
|
-
limit:
|
|
42705
|
-
mode:
|
|
42706
|
-
maxDepth:
|
|
42837
|
+
import { z as z91 } from "zod";
|
|
42838
|
+
var SearchCodebaseInputSchema = z91.object({
|
|
42839
|
+
query: z91.string().min(1).max(200).describe("Search query (symbol name, keyword, or pattern)"),
|
|
42840
|
+
directory: z91.string().min(1).max(500).optional().describe("Directory to search (default: current working directory)"),
|
|
42841
|
+
limit: z91.number().min(1).max(50).optional().describe("Max results (default: 20)"),
|
|
42842
|
+
mode: z91.enum(["search", "summary", "list"]).optional().describe("search: find symbols. summary: file overview. list: list indexed files."),
|
|
42843
|
+
maxDepth: z91.number().int().min(1).max(MAX_INDEX_MAX_DEPTH).optional().describe(
|
|
42707
42844
|
`Max directory depth to index below "directory" (default: ${String(DEFAULT_INDEX_MAX_DEPTH)}, clamped to ${String(MAX_INDEX_MAX_DEPTH)}). Raise this if results seem incomplete for a deeply nested tree.`
|
|
42708
42845
|
)
|
|
42709
42846
|
});
|
|
@@ -42833,11 +42970,11 @@ async function searchCodebaseHandler(args, ctx) {
|
|
|
42833
42970
|
function registerSearchCodebaseTool(server, deps) {
|
|
42834
42971
|
const logger57 = deps.logger ?? createLogger({ tool: "search_codebase" });
|
|
42835
42972
|
const toolSchema = {
|
|
42836
|
-
query:
|
|
42837
|
-
directory:
|
|
42838
|
-
limit:
|
|
42839
|
-
mode:
|
|
42840
|
-
maxDepth:
|
|
42973
|
+
query: z91.string().min(1).max(200).describe("Search query or file path"),
|
|
42974
|
+
directory: z91.string().max(500).optional().describe("Directory to index"),
|
|
42975
|
+
limit: z91.number().min(1).max(50).optional().describe("Max results"),
|
|
42976
|
+
mode: z91.enum(["search", "summary", "list"]).optional().describe("search/summary/list"),
|
|
42977
|
+
maxDepth: z91.number().int().min(1).max(MAX_INDEX_MAX_DEPTH).optional().describe(
|
|
42841
42978
|
`Max directory depth to index (default: ${String(DEFAULT_INDEX_MAX_DEPTH)}, clamped to ${String(MAX_INDEX_MAX_DEPTH)})`
|
|
42842
42979
|
)
|
|
42843
42980
|
};
|
|
@@ -42859,7 +42996,7 @@ function registerSearchCodebaseTool(server, deps) {
|
|
|
42859
42996
|
|
|
42860
42997
|
// src/mcp/tools/extract-symbols-tool.ts
|
|
42861
42998
|
import { extname as extname3, resolve as resolve7, sep as sep4 } from "node:path";
|
|
42862
|
-
import { z as
|
|
42999
|
+
import { z as z92 } from "zod";
|
|
42863
43000
|
|
|
42864
43001
|
// src/core/task-analysis/tool-refusal-gap.ts
|
|
42865
43002
|
function toolRefusalGapName(tool, capability) {
|
|
@@ -42885,13 +43022,13 @@ function recordToolRefusal(refusal, context, ledger = getGapLedger()) {
|
|
|
42885
43022
|
// src/mcp/tools/extract-symbols-tool.ts
|
|
42886
43023
|
var DEFAULT_EXTRACT_MAX_CHARS = 2e4;
|
|
42887
43024
|
var DEFAULT_EXTRACT_MAX_SYMBOLS = 200;
|
|
42888
|
-
var ExtractSymbolsInputSchema =
|
|
42889
|
-
filePath:
|
|
42890
|
-
mode:
|
|
42891
|
-
maxChars:
|
|
43025
|
+
var ExtractSymbolsInputSchema = z92.object({
|
|
43026
|
+
filePath: z92.string().min(1).max(500).describe("Path to TypeScript/JavaScript file to extract symbols from"),
|
|
43027
|
+
mode: z92.enum(["index", "full"]).optional().describe("index: names+lines only (minimal tokens). full: includes source text."),
|
|
43028
|
+
maxChars: z92.number().int().positive().max(1e6).optional().describe(
|
|
42892
43029
|
`full mode only: cap on total emitted symbol source chars (default ${String(DEFAULT_EXTRACT_MAX_CHARS)}). Excess is truncated and reported, never silently dropped.`
|
|
42893
43030
|
),
|
|
42894
|
-
maxSymbols:
|
|
43031
|
+
maxSymbols: z92.number().int().positive().max(1e4).optional().describe(
|
|
42895
43032
|
`full mode only: cap on number of symbols emitted (default ${String(DEFAULT_EXTRACT_MAX_SYMBOLS)}).`
|
|
42896
43033
|
)
|
|
42897
43034
|
});
|
|
@@ -43035,12 +43172,12 @@ function emptyIndexMessage(reason, filePath) {
|
|
|
43035
43172
|
function registerExtractSymbolsTool(server, deps) {
|
|
43036
43173
|
const logger57 = deps.logger ?? createLogger({ tool: "extract_symbols" });
|
|
43037
43174
|
const toolSchema = {
|
|
43038
|
-
filePath:
|
|
43039
|
-
mode:
|
|
43040
|
-
maxChars:
|
|
43175
|
+
filePath: z92.string().min(1).max(500).describe("Path to TypeScript/JavaScript file"),
|
|
43176
|
+
mode: z92.enum(["index", "full"]).optional().describe("index (default): names+lines. full: includes source text"),
|
|
43177
|
+
maxChars: z92.number().int().positive().max(1e6).optional().describe(
|
|
43041
43178
|
`full mode only: cap on total emitted symbol source chars (default ${String(DEFAULT_EXTRACT_MAX_CHARS)})`
|
|
43042
43179
|
),
|
|
43043
|
-
maxSymbols:
|
|
43180
|
+
maxSymbols: z92.number().int().positive().max(1e4).optional().describe(
|
|
43044
43181
|
`full mode only: cap on number of symbols emitted (default ${String(DEFAULT_EXTRACT_MAX_SYMBOLS)})`
|
|
43045
43182
|
)
|
|
43046
43183
|
};
|
|
@@ -43066,23 +43203,23 @@ function registerExtractSymbolsTool(server, deps) {
|
|
|
43066
43203
|
// src/mcp/tools/search-usages-tool.ts
|
|
43067
43204
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
43068
43205
|
import { relative, resolve as resolve8, sep as sep5 } from "node:path";
|
|
43069
|
-
import { z as
|
|
43206
|
+
import { z as z93 } from "zod";
|
|
43070
43207
|
var DEFAULT_USAGES_LIMIT = 50;
|
|
43071
43208
|
var MAX_USAGES_LIMIT = 500;
|
|
43072
43209
|
var DEFAULT_USAGES_MAX_DEPTH = 24;
|
|
43073
43210
|
var MAX_USAGES_MAX_DEPTH = 64;
|
|
43074
43211
|
var MAX_FILES_SCANNED = 5e3;
|
|
43075
|
-
var SearchUsagesInputSchema =
|
|
43076
|
-
symbol:
|
|
43077
|
-
path:
|
|
43078
|
-
dir:
|
|
43079
|
-
lang:
|
|
43212
|
+
var SearchUsagesInputSchema = z93.object({
|
|
43213
|
+
symbol: z93.string().min(1).max(200).regex(IDENTIFIER_RE, "symbol must be a single JS identifier (letters, digits, _ or $)").describe("Identifier to find usages/call-sites of (a single JS identifier)"),
|
|
43214
|
+
path: z93.string().min(1).max(500).optional().describe("Restrict to a single source file (takes precedence over dir)"),
|
|
43215
|
+
dir: z93.string().min(1).max(500).optional().describe("Directory to search recursively (default: current working directory)"),
|
|
43216
|
+
lang: z93.enum(LANG_VALUES).optional().describe(
|
|
43080
43217
|
"Language override (default: inferred from each file extension, fallback typescript)"
|
|
43081
43218
|
),
|
|
43082
|
-
limit:
|
|
43219
|
+
limit: z93.number().int().min(1).max(MAX_USAGES_LIMIT).optional().describe(
|
|
43083
43220
|
`Max usage matches emitted (default ${String(DEFAULT_USAGES_LIMIT)}). Excess is reported.`
|
|
43084
43221
|
),
|
|
43085
|
-
maxDepth:
|
|
43222
|
+
maxDepth: z93.number().int().min(1).max(MAX_USAGES_MAX_DEPTH).optional().describe(`Directory walk depth for dir scope (default ${String(DEFAULT_USAGES_MAX_DEPTH)}).`)
|
|
43086
43223
|
});
|
|
43087
43224
|
function resolveWithinCwd(target) {
|
|
43088
43225
|
const resolved = resolve8(target);
|
|
@@ -43201,12 +43338,12 @@ async function searchUsagesHandler(args, ctx) {
|
|
|
43201
43338
|
function registerSearchUsagesTool(server, deps) {
|
|
43202
43339
|
const logger57 = deps.logger ?? createLogger({ tool: "search_usages" });
|
|
43203
43340
|
const toolSchema = {
|
|
43204
|
-
symbol:
|
|
43205
|
-
path:
|
|
43206
|
-
dir:
|
|
43207
|
-
lang:
|
|
43208
|
-
limit:
|
|
43209
|
-
maxDepth:
|
|
43341
|
+
symbol: z93.string().min(1).max(200).regex(IDENTIFIER_RE, "symbol must be a single JS identifier").describe("Identifier to find usages/call-sites of"),
|
|
43342
|
+
path: z93.string().min(1).max(500).optional().describe("Restrict to a single source file"),
|
|
43343
|
+
dir: z93.string().min(1).max(500).optional().describe("Directory to search (default: cwd)"),
|
|
43344
|
+
lang: z93.enum(LANG_VALUES).optional().describe("Language override (default: infer from ext)"),
|
|
43345
|
+
limit: z93.number().int().min(1).max(MAX_USAGES_LIMIT).optional().describe(`Max matches (default ${String(DEFAULT_USAGES_LIMIT)})`),
|
|
43346
|
+
maxDepth: z93.number().int().min(1).max(MAX_USAGES_MAX_DEPTH).optional().describe(`Directory walk depth (default ${String(DEFAULT_USAGES_MAX_DEPTH)})`)
|
|
43210
43347
|
};
|
|
43211
43348
|
const description = `Structural USAGE / call-site search for a symbol via ast-grep (tree-sitter). Answers "where is X used or called" \u2014 finds calls (foo()), member calls (obj.foo()), new expressions (new Foo()), imports, and bare references, with file:line:column + snippet. This is the gap \`search_codebase\` CANNOT fill: that indexes declared symbol NAMES only, not usages. Excludes the declaration itself (use \`search_codebase\` for declarations). Syntactic, not type-aware (a same-named member on an unrelated object may match). Read-only. Results capped at ${String(DEFAULT_USAGES_LIMIT)} by default (override via limit up to ${String(MAX_USAGES_LIMIT)}); overflow is reported, never silent.`;
|
|
43212
43349
|
const secureHandler = createSecureHandler(searchUsagesHandler, {
|
|
@@ -43227,11 +43364,11 @@ function registerSearchUsagesTool(server, deps) {
|
|
|
43227
43364
|
// src/mcp/tools/query-trace-tool.ts
|
|
43228
43365
|
import { readFile as readFile4, stat as stat3 } from "node:fs/promises";
|
|
43229
43366
|
import { join as join7, resolve as resolve9, sep as sep6 } from "node:path";
|
|
43230
|
-
import { z as
|
|
43231
|
-
var QueryTraceInputSchema =
|
|
43232
|
-
runId:
|
|
43233
|
-
eventType:
|
|
43234
|
-
limit:
|
|
43367
|
+
import { z as z94 } from "zod";
|
|
43368
|
+
var QueryTraceInputSchema = z94.object({
|
|
43369
|
+
runId: z94.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/, "runId must be alphanumeric, hyphens, or underscores").describe("Run ID to query traces for"),
|
|
43370
|
+
eventType: z94.string().max(100).regex(/^[a-zA-Z0-9._-]+$/, "eventType must be alphanumeric with dots, hyphens, or underscores").optional().describe("Filter by event type"),
|
|
43371
|
+
limit: z94.number().min(1).max(500).optional().describe("Max events to return (default: 100)")
|
|
43235
43372
|
});
|
|
43236
43373
|
var MAX_TRACE_FILE_BYTES = 100 * 1024 * 1024;
|
|
43237
43374
|
var traceLogger = createLogger({ component: "query-trace" });
|
|
@@ -43355,9 +43492,9 @@ function queryTraceHandler(args, ctx) {
|
|
|
43355
43492
|
function registerQueryTraceTool(server, deps) {
|
|
43356
43493
|
const logger57 = deps.logger ?? createLogger({ tool: "query_trace" });
|
|
43357
43494
|
const toolSchema = {
|
|
43358
|
-
runId:
|
|
43359
|
-
eventType:
|
|
43360
|
-
limit:
|
|
43495
|
+
runId: z94.string().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/, "runId must be alphanumeric, hyphens, or underscores").describe("Run ID to query traces for"),
|
|
43496
|
+
eventType: z94.string().max(100).regex(/^[a-zA-Z0-9._-]+$/).optional().describe("Filter by event type (e.g., model.called)"),
|
|
43497
|
+
limit: z94.number().min(1).max(500).optional().describe("Max events to return (default: 100)")
|
|
43361
43498
|
};
|
|
43362
43499
|
const description = "Query execution traces by run ID. Returns agent and model attribution for pipeline runs including decision paths, error taxonomy, and timing data.";
|
|
43363
43500
|
const secureHandler = createSecureHandler(queryTraceHandler, {
|
|
@@ -43376,7 +43513,7 @@ function registerQueryTraceTool(server, deps) {
|
|
|
43376
43513
|
}
|
|
43377
43514
|
|
|
43378
43515
|
// src/mcp/tools/get-job-result-tool.ts
|
|
43379
|
-
import { z as
|
|
43516
|
+
import { z as z95 } from "zod";
|
|
43380
43517
|
|
|
43381
43518
|
// src/mcp/jobs/task-state-source.ts
|
|
43382
43519
|
var logger34 = createLogger({ component: "task-state-source" });
|
|
@@ -43499,8 +43636,8 @@ function resolveJobListing(customDir) {
|
|
|
43499
43636
|
}
|
|
43500
43637
|
|
|
43501
43638
|
// src/mcp/tools/get-job-result-tool.ts
|
|
43502
|
-
var GetJobResultInputSchema =
|
|
43503
|
-
jobId:
|
|
43639
|
+
var GetJobResultInputSchema = z95.object({
|
|
43640
|
+
jobId: z95.string().min(1).max(128).describe('Job ID returned by any tool called with dispatch: "async" (e.g. orchestrate)')
|
|
43504
43641
|
});
|
|
43505
43642
|
function getJobResultHandler(args) {
|
|
43506
43643
|
const parsed = GetJobResultInputSchema.safeParse(args);
|
|
@@ -43539,7 +43676,7 @@ function getJobResultHandler(args) {
|
|
|
43539
43676
|
function registerGetJobResultTool(server, deps) {
|
|
43540
43677
|
const logger57 = deps.logger ?? createLogger({ tool: "get_job_result" });
|
|
43541
43678
|
const toolSchema = {
|
|
43542
|
-
jobId:
|
|
43679
|
+
jobId: z95.string().min(1).max(128).describe('Job ID returned by any tool called with dispatch: "async" (e.g. orchestrate)')
|
|
43543
43680
|
};
|
|
43544
43681
|
const description = `Read the result of an async-mode tool invocation by jobId. Returns the structured record (status, result | error, timestamps, producerVersion) plus producerVersionMeasured \u2014 false when the producer was a dev build or the record predates the field, so its version must not be compared to this server's _meta build stamp \u2014 and producerVersionSource (sidecar | task_state; a task_state record never carries a version). Poll until status !== "pending". Stage-1 of epic #2631 \u2014 Stage 2 will fold this into query_task_state once StructuredTaskState gains the result field.`;
|
|
43545
43682
|
const secureHandler = createSecureHandler(getJobResultHandler, {
|
|
@@ -43561,14 +43698,14 @@ function registerGetJobResultTool(server, deps) {
|
|
|
43561
43698
|
}
|
|
43562
43699
|
|
|
43563
43700
|
// src/mcp/tools/list-jobs-tool.ts
|
|
43564
|
-
import { z as
|
|
43701
|
+
import { z as z96 } from "zod";
|
|
43565
43702
|
var MAX_LIST_JOBS_RESULTS = 200;
|
|
43566
|
-
var ListJobsInputSchema =
|
|
43703
|
+
var ListJobsInputSchema = z96.object({
|
|
43567
43704
|
/**
|
|
43568
43705
|
* Filter to jobs from a specific tool (exact match — e.g. `'orchestrate'`).
|
|
43569
43706
|
* Omit to list every tool's jobs.
|
|
43570
43707
|
*/
|
|
43571
|
-
toolName:
|
|
43708
|
+
toolName: z96.string().min(1).max(128).optional().describe("Filter to one tool (exact match)."),
|
|
43572
43709
|
/**
|
|
43573
43710
|
* Filter to jobs in a specific lifecycle state.
|
|
43574
43711
|
* Omit to list every state.
|
|
@@ -43581,7 +43718,7 @@ var ListJobsInputSchema = z95.object({
|
|
|
43581
43718
|
* Newest jobs are returned first, so a smaller limit shows the most
|
|
43582
43719
|
* recent activity.
|
|
43583
43720
|
*/
|
|
43584
|
-
limit:
|
|
43721
|
+
limit: z96.number().int().min(1).max(MAX_LIST_JOBS_RESULTS).optional().describe(`Max summaries to return (1-${String(MAX_LIST_JOBS_RESULTS)}, newest first).`)
|
|
43585
43722
|
});
|
|
43586
43723
|
function listJobsHandler(args) {
|
|
43587
43724
|
const parsed = ListJobsInputSchema.safeParse(args);
|
|
@@ -43622,11 +43759,11 @@ function listJobsHandler(args) {
|
|
|
43622
43759
|
function registerListJobsTool(server, deps) {
|
|
43623
43760
|
const logger57 = deps.logger ?? createLogger({ tool: "list_jobs" });
|
|
43624
43761
|
const toolSchema = {
|
|
43625
|
-
toolName:
|
|
43762
|
+
toolName: z96.string().min(1).max(128).optional().describe("Filter to one tool (exact match)."),
|
|
43626
43763
|
status: JobStatusSchema.optional().describe(
|
|
43627
43764
|
"Filter to pending | complete | failed | cancelled. Omit for all."
|
|
43628
43765
|
),
|
|
43629
|
-
limit:
|
|
43766
|
+
limit: z96.number().int().min(1).max(MAX_LIST_JOBS_RESULTS).optional().describe(`Max summaries to return (1-${String(MAX_LIST_JOBS_RESULTS)}, newest first).`)
|
|
43630
43767
|
};
|
|
43631
43768
|
const description = "List async-mode jobs (cross-session discovery). Returns summaries \u2014 jobId, toolName, status, timestamps \u2014 newest first. Filter by toolName / status / limit. Result payloads excluded; fetch via get_job_result(jobId). Stage 5 of epic #2631.";
|
|
43632
43769
|
const secureHandler = createSecureHandler(listJobsHandler, {
|
|
@@ -43648,11 +43785,11 @@ function registerListJobsTool(server, deps) {
|
|
|
43648
43785
|
}
|
|
43649
43786
|
|
|
43650
43787
|
// src/mcp/tools/cancel-job-tool.ts
|
|
43651
|
-
import { z as
|
|
43788
|
+
import { z as z97 } from "zod";
|
|
43652
43789
|
var defaultLogger3 = createLogger({ tool: "cancel_job" });
|
|
43653
|
-
var CancelJobInputSchema =
|
|
43654
|
-
jobId:
|
|
43655
|
-
reason:
|
|
43790
|
+
var CancelJobInputSchema = z97.object({
|
|
43791
|
+
jobId: z97.string().min(1).max(128).describe("Job ID returned by orchestrate / run_workflow / consensus_vote in async mode"),
|
|
43792
|
+
reason: z97.string().max(1e3).optional().describe('Optional human-readable note (e.g. "user clicked cancel").')
|
|
43656
43793
|
});
|
|
43657
43794
|
function cancelJobHandler(args, logger57 = defaultLogger3) {
|
|
43658
43795
|
const parsed = CancelJobInputSchema.safeParse(args);
|
|
@@ -43721,8 +43858,8 @@ function cancelPendingJob(jobId, toolName, logger57, reason) {
|
|
|
43721
43858
|
function registerCancelJobTool(server, deps) {
|
|
43722
43859
|
const logger57 = deps.logger ?? defaultLogger3;
|
|
43723
43860
|
const toolSchema = {
|
|
43724
|
-
jobId:
|
|
43725
|
-
reason:
|
|
43861
|
+
jobId: z97.string().min(1).max(128).describe("Job ID returned by orchestrate / run_workflow / consensus_vote in async mode"),
|
|
43862
|
+
reason: z97.string().max(1e3).optional().describe('Optional human-readable note (e.g. "user clicked cancel").')
|
|
43726
43863
|
};
|
|
43727
43864
|
const description = "Mark an async-mode job as cancelled (#3042 Stage 1b / epic #2631). Same-process dispatcher unwinds via AbortSignal (#3035/#3038); cross-process workers observe via get_job_result. Idempotent \u2014 cancel-after-complete is a no-op (preserves the terminal record); second cancel returns already_cancelled.";
|
|
43728
43865
|
const secureHandler = createSecureHandler((args) => cancelJobHandler(args, logger57), {
|
|
@@ -43744,7 +43881,7 @@ function registerCancelJobTool(server, deps) {
|
|
|
43744
43881
|
}
|
|
43745
43882
|
|
|
43746
43883
|
// src/audit/audit-types.ts
|
|
43747
|
-
import { z as
|
|
43884
|
+
import { z as z98 } from "zod";
|
|
43748
43885
|
var AuditError = class extends Error {
|
|
43749
43886
|
code = "AUDIT_ERROR";
|
|
43750
43887
|
context;
|
|
@@ -43756,7 +43893,7 @@ var AuditError = class extends Error {
|
|
|
43756
43893
|
this.context = options?.context;
|
|
43757
43894
|
}
|
|
43758
43895
|
};
|
|
43759
|
-
var AuditCategorySchema =
|
|
43896
|
+
var AuditCategorySchema = z98.enum([
|
|
43760
43897
|
"authentication",
|
|
43761
43898
|
// Login, logout, token refresh
|
|
43762
43899
|
"authorization",
|
|
@@ -43776,28 +43913,28 @@ var AuditCategorySchema = z97.enum([
|
|
|
43776
43913
|
"governance"
|
|
43777
43914
|
// Authority-tier transitions, ratification (Epic D, #3842)
|
|
43778
43915
|
]);
|
|
43779
|
-
var TierTransitionKindSchema =
|
|
43780
|
-
var TierTransitionTierSchema =
|
|
43781
|
-
var TierTransitionPayloadSchema =
|
|
43916
|
+
var TierTransitionKindSchema = z98.enum(["promotion", "demotion"]);
|
|
43917
|
+
var TierTransitionTierSchema = z98.enum(["observe", "suggest", "advisory", "enforce"]);
|
|
43918
|
+
var TierTransitionPayloadSchema = z98.object({
|
|
43782
43919
|
/** Whether the loop moved up (`promotion`) or down (`demotion`) the ladder. */
|
|
43783
43920
|
kind: TierTransitionKindSchema,
|
|
43784
43921
|
/** The loop/strategy whose tier changed (manifest `id` or loop identifier). */
|
|
43785
|
-
subject:
|
|
43922
|
+
subject: z98.string().min(1),
|
|
43786
43923
|
/** Tier before the transition. */
|
|
43787
43924
|
fromTier: TierTransitionTierSchema,
|
|
43788
43925
|
/** Tier after the transition. */
|
|
43789
43926
|
toTier: TierTransitionTierSchema,
|
|
43790
43927
|
/** Ref to the promotion-evidence record this transition was earned against. */
|
|
43791
|
-
evidenceRef:
|
|
43928
|
+
evidenceRef: z98.string().min(1),
|
|
43792
43929
|
/**
|
|
43793
43930
|
* Ref to the recorded `consensus_vote` that ratified a PROMOTION. Required
|
|
43794
43931
|
* by the ratification gate for `kind: 'promotion'`; legitimately absent for
|
|
43795
43932
|
* `kind: 'demotion'` (automatic, ADR-0017 §"Demotion is automatic").
|
|
43796
43933
|
*/
|
|
43797
|
-
ratificationVoteRef:
|
|
43934
|
+
ratificationVoteRef: z98.string().min(1).optional()
|
|
43798
43935
|
}).strict();
|
|
43799
43936
|
var TIER_TRANSITION_METADATA_KEY = "tierTransition";
|
|
43800
|
-
var AuditSeveritySchema =
|
|
43937
|
+
var AuditSeveritySchema = z98.enum([
|
|
43801
43938
|
"info",
|
|
43802
43939
|
// Normal operations
|
|
43803
43940
|
"warning",
|
|
@@ -43805,7 +43942,7 @@ var AuditSeveritySchema = z97.enum([
|
|
|
43805
43942
|
"critical"
|
|
43806
43943
|
// Security violations, failures
|
|
43807
43944
|
]);
|
|
43808
|
-
var AuditOutcomeSchema =
|
|
43945
|
+
var AuditOutcomeSchema = z98.enum([
|
|
43809
43946
|
"success",
|
|
43810
43947
|
// Operation completed successfully
|
|
43811
43948
|
"failure",
|
|
@@ -43815,56 +43952,56 @@ var AuditOutcomeSchema = z97.enum([
|
|
|
43815
43952
|
"error"
|
|
43816
43953
|
// Unexpected error occurred
|
|
43817
43954
|
]);
|
|
43818
|
-
var AuditActorSchema =
|
|
43819
|
-
type:
|
|
43820
|
-
id:
|
|
43821
|
-
name:
|
|
43822
|
-
ip:
|
|
43823
|
-
userAgent:
|
|
43955
|
+
var AuditActorSchema = z98.object({
|
|
43956
|
+
type: z98.enum(["user", "agent", "system", "external"]),
|
|
43957
|
+
id: z98.string().min(1),
|
|
43958
|
+
name: z98.string().optional(),
|
|
43959
|
+
ip: z98.string().optional(),
|
|
43960
|
+
userAgent: z98.string().optional()
|
|
43824
43961
|
});
|
|
43825
|
-
var AuditResourceSchema =
|
|
43826
|
-
type:
|
|
43962
|
+
var AuditResourceSchema = z98.object({
|
|
43963
|
+
type: z98.string().min(1),
|
|
43827
43964
|
// e.g., 'file', 'tool', 'config', 'agent'
|
|
43828
|
-
id:
|
|
43829
|
-
name:
|
|
43830
|
-
path:
|
|
43965
|
+
id: z98.string().min(1),
|
|
43966
|
+
name: z98.string().optional(),
|
|
43967
|
+
path: z98.string().optional()
|
|
43831
43968
|
});
|
|
43832
|
-
var AuditEventSchema =
|
|
43969
|
+
var AuditEventSchema = z98.object({
|
|
43833
43970
|
// Identity
|
|
43834
|
-
id:
|
|
43971
|
+
id: z98.string().min(1),
|
|
43835
43972
|
// Unique event ID
|
|
43836
|
-
version:
|
|
43973
|
+
version: z98.literal("1.0"),
|
|
43837
43974
|
// Schema version for migrations
|
|
43838
43975
|
// Timing
|
|
43839
|
-
timestamp:
|
|
43976
|
+
timestamp: z98.string(),
|
|
43840
43977
|
// ISO 8601 format
|
|
43841
|
-
timestampMs:
|
|
43978
|
+
timestampMs: z98.number(),
|
|
43842
43979
|
// Unix epoch milliseconds
|
|
43843
43980
|
// Classification
|
|
43844
43981
|
category: AuditCategorySchema,
|
|
43845
43982
|
severity: AuditSeveritySchema,
|
|
43846
43983
|
outcome: AuditOutcomeSchema,
|
|
43847
43984
|
// Event details
|
|
43848
|
-
action:
|
|
43985
|
+
action: z98.string().min(1),
|
|
43849
43986
|
// e.g., 'tool.invoke', 'policy.evaluate'
|
|
43850
|
-
description:
|
|
43987
|
+
description: z98.string().optional(),
|
|
43851
43988
|
// Actors and resources
|
|
43852
43989
|
actor: AuditActorSchema,
|
|
43853
43990
|
resource: AuditResourceSchema.optional(),
|
|
43854
43991
|
// Correlation
|
|
43855
|
-
requestId:
|
|
43992
|
+
requestId: z98.string().optional(),
|
|
43856
43993
|
// Request correlation ID
|
|
43857
|
-
traceId:
|
|
43994
|
+
traceId: z98.string().optional(),
|
|
43858
43995
|
// Distributed trace ID
|
|
43859
|
-
sessionId:
|
|
43996
|
+
sessionId: z98.string().optional(),
|
|
43860
43997
|
// Session correlation ID
|
|
43861
43998
|
// Context
|
|
43862
|
-
toolName:
|
|
43863
|
-
durationMs:
|
|
43864
|
-
metadata:
|
|
43999
|
+
toolName: z98.string().optional(),
|
|
44000
|
+
durationMs: z98.number().optional(),
|
|
44001
|
+
metadata: z98.record(z98.string(), z98.unknown()).optional(),
|
|
43865
44002
|
// Policy and security
|
|
43866
|
-
policyName:
|
|
43867
|
-
policyDecision:
|
|
44003
|
+
policyName: z98.string().optional(),
|
|
44004
|
+
policyDecision: z98.string().optional(),
|
|
43868
44005
|
/**
|
|
43869
44006
|
* Which occurrence of this `{tool, rule}` near-miss the record represents
|
|
43870
44007
|
* (#5228 review). Present only on a sampled `would_deny`.
|
|
@@ -43881,12 +44018,12 @@ var AuditEventSchema = z97.object({
|
|
|
43881
44018
|
* Absent means "not sampled" — every occurrence was recorded — which is
|
|
43882
44019
|
* distinct from `1`.
|
|
43883
44020
|
*/
|
|
43884
|
-
policyOccurrence:
|
|
43885
|
-
violationType:
|
|
44021
|
+
policyOccurrence: z98.number().int().min(1).optional(),
|
|
44022
|
+
violationType: z98.string().optional(),
|
|
43886
44023
|
// Integrity (for tamper-evidence)
|
|
43887
|
-
previousHash:
|
|
44024
|
+
previousHash: z98.string().optional(),
|
|
43888
44025
|
// Hash of previous event (chain)
|
|
43889
|
-
hash:
|
|
44026
|
+
hash: z98.string().optional(),
|
|
43890
44027
|
// Hash of this event
|
|
43891
44028
|
/**
|
|
43892
44029
|
* Hash-projection version (#3921). ABSENT/`1` = the legacy projection
|
|
@@ -43896,62 +44033,62 @@ var AuditEventSchema = z97.object({
|
|
|
43896
44033
|
* Versioned so pre-existing v1 chains keep verifying under their own
|
|
43897
44034
|
* projection (see {@link AUDIT_HASH_VERSION_TIER_TRANSITION}).
|
|
43898
44035
|
*/
|
|
43899
|
-
hashVersion:
|
|
44036
|
+
hashVersion: z98.number().int().positive().optional()
|
|
43900
44037
|
});
|
|
43901
44038
|
var AUDIT_HASH_VERSION_TIER_TRANSITION = 2;
|
|
43902
|
-
var AuditEventInputSchema =
|
|
44039
|
+
var AuditEventInputSchema = z98.object({
|
|
43903
44040
|
category: AuditCategorySchema,
|
|
43904
44041
|
severity: AuditSeveritySchema.optional().default("info"),
|
|
43905
44042
|
outcome: AuditOutcomeSchema,
|
|
43906
|
-
action:
|
|
43907
|
-
description:
|
|
44043
|
+
action: z98.string().min(1),
|
|
44044
|
+
description: z98.string().optional(),
|
|
43908
44045
|
actor: AuditActorSchema,
|
|
43909
44046
|
resource: AuditResourceSchema.optional(),
|
|
43910
|
-
requestId:
|
|
43911
|
-
traceId:
|
|
43912
|
-
sessionId:
|
|
43913
|
-
toolName:
|
|
43914
|
-
durationMs:
|
|
43915
|
-
metadata:
|
|
43916
|
-
policyName:
|
|
43917
|
-
policyDecision:
|
|
44047
|
+
requestId: z98.string().optional(),
|
|
44048
|
+
traceId: z98.string().optional(),
|
|
44049
|
+
sessionId: z98.string().optional(),
|
|
44050
|
+
toolName: z98.string().optional(),
|
|
44051
|
+
durationMs: z98.number().optional(),
|
|
44052
|
+
metadata: z98.record(z98.string(), z98.unknown()).optional(),
|
|
44053
|
+
policyName: z98.string().optional(),
|
|
44054
|
+
policyDecision: z98.string().optional(),
|
|
43918
44055
|
/** @see AuditEventSchema.policyOccurrence (#5228 review). */
|
|
43919
|
-
policyOccurrence:
|
|
43920
|
-
violationType:
|
|
44056
|
+
policyOccurrence: z98.number().int().min(1).optional(),
|
|
44057
|
+
violationType: z98.string().optional()
|
|
43921
44058
|
});
|
|
43922
|
-
var AuditLogConfigSchema =
|
|
44059
|
+
var AuditLogConfigSchema = z98.object({
|
|
43923
44060
|
// Storage
|
|
43924
|
-
logDir:
|
|
43925
|
-
filePrefix:
|
|
43926
|
-
maxFileSizeBytes:
|
|
44061
|
+
logDir: z98.string().min(1),
|
|
44062
|
+
filePrefix: z98.string().optional().default("audit"),
|
|
44063
|
+
maxFileSizeBytes: z98.number().positive().optional().default(10 * 1024 * 1024),
|
|
43927
44064
|
// 10MB
|
|
43928
|
-
maxFiles:
|
|
44065
|
+
maxFiles: z98.number().positive().optional().default(10),
|
|
43929
44066
|
// Features
|
|
43930
|
-
enableHashChain:
|
|
43931
|
-
enableCompression:
|
|
43932
|
-
flushIntervalMs:
|
|
44067
|
+
enableHashChain: z98.boolean().optional().default(true),
|
|
44068
|
+
enableCompression: z98.boolean().optional().default(false),
|
|
44069
|
+
flushIntervalMs: z98.number().positive().optional().default(1e3),
|
|
43933
44070
|
/**
|
|
43934
44071
|
* Maximum in-memory event queue depth before drop-oldest backpressure
|
|
43935
44072
|
* engages. Bounds memory under load when storage.write is slow or the flush
|
|
43936
44073
|
* timer is overlapping; see #2979.
|
|
43937
44074
|
*/
|
|
43938
|
-
maxQueueDepth:
|
|
44075
|
+
maxQueueDepth: z98.number().positive().optional().default(1e4),
|
|
43939
44076
|
// Filtering
|
|
43940
44077
|
minSeverity: AuditSeveritySchema.optional().default("info"),
|
|
43941
|
-
categories:
|
|
44078
|
+
categories: z98.array(AuditCategorySchema).optional()
|
|
43942
44079
|
});
|
|
43943
|
-
var AuditQueryCriteriaSchema =
|
|
43944
|
-
startTime:
|
|
43945
|
-
endTime:
|
|
43946
|
-
categories:
|
|
43947
|
-
severities:
|
|
43948
|
-
outcomes:
|
|
43949
|
-
actorId:
|
|
43950
|
-
resourceId:
|
|
43951
|
-
requestId:
|
|
43952
|
-
traceId:
|
|
43953
|
-
limit:
|
|
43954
|
-
offset:
|
|
44080
|
+
var AuditQueryCriteriaSchema = z98.object({
|
|
44081
|
+
startTime: z98.date().optional(),
|
|
44082
|
+
endTime: z98.date().optional(),
|
|
44083
|
+
categories: z98.array(AuditCategorySchema).optional(),
|
|
44084
|
+
severities: z98.array(AuditSeveritySchema).optional(),
|
|
44085
|
+
outcomes: z98.array(AuditOutcomeSchema).optional(),
|
|
44086
|
+
actorId: z98.string().optional(),
|
|
44087
|
+
resourceId: z98.string().optional(),
|
|
44088
|
+
requestId: z98.string().optional(),
|
|
44089
|
+
traceId: z98.string().optional(),
|
|
44090
|
+
limit: z98.number().positive().optional().default(100),
|
|
44091
|
+
offset: z98.number().nonnegative().optional().default(0)
|
|
43955
44092
|
});
|
|
43956
44093
|
|
|
43957
44094
|
// src/audit/audit-storage-queries.ts
|
|
@@ -45300,7 +45437,7 @@ async function tryIssueTriage(task) {
|
|
|
45300
45437
|
try {
|
|
45301
45438
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
45302
45439
|
if (issueMatch === null) return null;
|
|
45303
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
45440
|
+
const { createIssueTriage } = await import("./issue-triage-LOTZZAOQ.js");
|
|
45304
45441
|
const triage = createIssueTriage();
|
|
45305
45442
|
const owner = issueMatch[1] ?? "";
|
|
45306
45443
|
const num2 = issueMatch[2] ?? "";
|
|
@@ -45328,7 +45465,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
45328
45465
|
]);
|
|
45329
45466
|
async function classifyWithLLM(task) {
|
|
45330
45467
|
try {
|
|
45331
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
45468
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-25V5Z5NH.js");
|
|
45332
45469
|
const prompt = [
|
|
45333
45470
|
"Classify this task into exactly one pipeline template.",
|
|
45334
45471
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -45436,7 +45573,7 @@ function ensureRunnableTemplate(template, stages) {
|
|
|
45436
45573
|
// src/pipeline/pipeline-checkpoint.ts
|
|
45437
45574
|
import * as fs6 from "node:fs";
|
|
45438
45575
|
import * as path4 from "node:path";
|
|
45439
|
-
import { z as
|
|
45576
|
+
import { z as z99 } from "zod";
|
|
45440
45577
|
var logger39 = createLogger({ component: "pipeline-checkpoint" });
|
|
45441
45578
|
var SESSION_ID_REGEX = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
45442
45579
|
function validateSessionId(sessionId) {
|
|
@@ -45484,7 +45621,7 @@ function loadCheckpointState(sessionId, customDir) {
|
|
|
45484
45621
|
return null;
|
|
45485
45622
|
}
|
|
45486
45623
|
}
|
|
45487
|
-
var PipelineStageSchema =
|
|
45624
|
+
var PipelineStageSchema = z99.enum([
|
|
45488
45625
|
"research",
|
|
45489
45626
|
"plan",
|
|
45490
45627
|
"vote",
|
|
@@ -45492,27 +45629,27 @@ var PipelineStageSchema = z98.enum([
|
|
|
45492
45629
|
"implement",
|
|
45493
45630
|
"security"
|
|
45494
45631
|
]);
|
|
45495
|
-
var PipelineStageDataSchema =
|
|
45496
|
-
|
|
45497
|
-
|
|
45498
|
-
|
|
45499
|
-
type:
|
|
45500
|
-
approved:
|
|
45501
|
-
conditional:
|
|
45502
|
-
conditions:
|
|
45503
|
-
caveats:
|
|
45504
|
-
iterations:
|
|
45632
|
+
var PipelineStageDataSchema = z99.discriminatedUnion("type", [
|
|
45633
|
+
z99.object({ type: z99.literal("research"), text: z99.string() }),
|
|
45634
|
+
z99.object({ type: z99.literal("plan"), text: z99.string(), iterations: z99.number() }),
|
|
45635
|
+
z99.object({
|
|
45636
|
+
type: z99.literal("vote"),
|
|
45637
|
+
approved: z99.boolean(),
|
|
45638
|
+
conditional: z99.boolean(),
|
|
45639
|
+
conditions: z99.array(z99.string()).optional(),
|
|
45640
|
+
caveats: z99.array(z99.string()).optional(),
|
|
45641
|
+
iterations: z99.number()
|
|
45505
45642
|
}),
|
|
45506
45643
|
// PipelineTask shape is loose at the persistence layer — capture as
|
|
45507
45644
|
// `z.unknown()` and trust the downstream consumer's narrower validation.
|
|
45508
|
-
|
|
45509
|
-
|
|
45510
|
-
|
|
45645
|
+
z99.object({ type: z99.literal("decompose"), tasks: z99.array(z99.unknown()) }),
|
|
45646
|
+
z99.object({ type: z99.literal("implement"), tasks: z99.array(z99.unknown()) }),
|
|
45647
|
+
z99.object({ type: z99.literal("security"), passed: z99.boolean() })
|
|
45511
45648
|
]);
|
|
45512
|
-
var PipelineCheckpointEntrySchema =
|
|
45513
|
-
sessionId:
|
|
45649
|
+
var PipelineCheckpointEntrySchema = z99.object({
|
|
45650
|
+
sessionId: z99.string(),
|
|
45514
45651
|
stage: PipelineStageSchema,
|
|
45515
|
-
timestamp:
|
|
45652
|
+
timestamp: z99.string(),
|
|
45516
45653
|
data: PipelineStageDataSchema
|
|
45517
45654
|
});
|
|
45518
45655
|
function rebuildState(lines) {
|
|
@@ -45702,7 +45839,7 @@ function buildVotingInput(plan, config) {
|
|
|
45702
45839
|
}
|
|
45703
45840
|
async function executeSingleVote(plan, config, log) {
|
|
45704
45841
|
try {
|
|
45705
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
45842
|
+
const { executeVoting } = await import("./consensus-vote-OL7DLZNL.js");
|
|
45706
45843
|
const input = buildVotingInput(plan, config);
|
|
45707
45844
|
const result = await executeVoting(input, log);
|
|
45708
45845
|
return parseVotingResult(result);
|
|
@@ -46426,49 +46563,49 @@ Verdict: PASS/NEEDS_WORK/REJECT`;
|
|
|
46426
46563
|
}
|
|
46427
46564
|
|
|
46428
46565
|
// src/security/sarif-parser.ts
|
|
46429
|
-
import { z as
|
|
46430
|
-
var SarifLocationSchema =
|
|
46431
|
-
physicalLocation:
|
|
46432
|
-
artifactLocation:
|
|
46433
|
-
region:
|
|
46434
|
-
startLine:
|
|
46435
|
-
endLine:
|
|
46436
|
-
snippet:
|
|
46566
|
+
import { z as z100 } from "zod";
|
|
46567
|
+
var SarifLocationSchema = z100.object({
|
|
46568
|
+
physicalLocation: z100.object({
|
|
46569
|
+
artifactLocation: z100.object({ uri: z100.string().optional().catch(void 0) }).optional(),
|
|
46570
|
+
region: z100.object({
|
|
46571
|
+
startLine: z100.number().optional().catch(void 0),
|
|
46572
|
+
endLine: z100.number().int().min(1).optional().catch(void 0),
|
|
46573
|
+
snippet: z100.object({ text: z100.string().optional().catch(void 0) }).optional().catch(void 0)
|
|
46437
46574
|
}).optional()
|
|
46438
46575
|
}).optional()
|
|
46439
46576
|
});
|
|
46440
|
-
var SarifResultSchema =
|
|
46441
|
-
ruleId:
|
|
46442
|
-
level:
|
|
46443
|
-
message:
|
|
46444
|
-
locations:
|
|
46577
|
+
var SarifResultSchema = z100.object({
|
|
46578
|
+
ruleId: z100.string().nullish(),
|
|
46579
|
+
level: z100.string().nullish(),
|
|
46580
|
+
message: z100.object({ text: z100.string().optional() }).nullish(),
|
|
46581
|
+
locations: z100.array(SarifLocationSchema).nullish()
|
|
46445
46582
|
});
|
|
46446
|
-
var SarifRuleSchema =
|
|
46447
|
-
id:
|
|
46448
|
-
shortDescription:
|
|
46449
|
-
defaultConfiguration:
|
|
46450
|
-
properties:
|
|
46451
|
-
precision:
|
|
46452
|
-
tags:
|
|
46583
|
+
var SarifRuleSchema = z100.object({
|
|
46584
|
+
id: z100.string(),
|
|
46585
|
+
shortDescription: z100.object({ text: z100.string().optional().catch(void 0) }).optional(),
|
|
46586
|
+
defaultConfiguration: z100.object({ level: z100.string().optional().catch(void 0) }).optional(),
|
|
46587
|
+
properties: z100.object({
|
|
46588
|
+
precision: z100.string().optional().catch(void 0),
|
|
46589
|
+
tags: z100.array(z100.string()).optional().catch(void 0),
|
|
46453
46590
|
// Accept the number form and normalize; `resolveSeverityFromScore`
|
|
46454
46591
|
// parses it either way.
|
|
46455
|
-
"security-severity":
|
|
46592
|
+
"security-severity": z100.union([z100.string(), z100.number()]).optional().catch(void 0)
|
|
46456
46593
|
}).optional().catch(void 0),
|
|
46457
|
-
helpUri:
|
|
46458
|
-
help:
|
|
46594
|
+
helpUri: z100.string().optional().catch(void 0),
|
|
46595
|
+
help: z100.object({ markdown: z100.string().optional().catch(void 0) }).optional()
|
|
46459
46596
|
});
|
|
46460
|
-
var SarifRunSchema =
|
|
46461
|
-
tool:
|
|
46462
|
-
driver:
|
|
46463
|
-
name:
|
|
46464
|
-
rules:
|
|
46597
|
+
var SarifRunSchema = z100.object({
|
|
46598
|
+
tool: z100.object({
|
|
46599
|
+
driver: z100.object({
|
|
46600
|
+
name: z100.string().optional(),
|
|
46601
|
+
rules: z100.array(z100.unknown()).optional()
|
|
46465
46602
|
}).optional()
|
|
46466
46603
|
}).optional(),
|
|
46467
|
-
results:
|
|
46604
|
+
results: z100.array(z100.unknown()).nullish()
|
|
46468
46605
|
});
|
|
46469
|
-
var SarifLogSchema =
|
|
46470
|
-
version:
|
|
46471
|
-
runs:
|
|
46606
|
+
var SarifLogSchema = z100.object({
|
|
46607
|
+
version: z100.string().optional(),
|
|
46608
|
+
runs: z100.array(z100.unknown()).optional()
|
|
46472
46609
|
});
|
|
46473
46610
|
var UNMAPPED_LEVEL_SEVERITY = "high";
|
|
46474
46611
|
var MAX_MESSAGE_LENGTH = 2e3;
|
|
@@ -46736,18 +46873,18 @@ async function executeSecurityScan(input) {
|
|
|
46736
46873
|
}
|
|
46737
46874
|
|
|
46738
46875
|
// src/security/osv-lookup.ts
|
|
46739
|
-
import { z as
|
|
46876
|
+
import { z as z101 } from "zod";
|
|
46740
46877
|
var logger44 = createLogger({ component: "osv-lookup" });
|
|
46741
46878
|
var OSV_API_URL = "https://api.osv.dev/v1/query";
|
|
46742
46879
|
var DEFAULT_TIMEOUT_MS4 = NETWORK_FETCH_TIMEOUT_MS;
|
|
46743
|
-
var OsvVulnerabilitySchema =
|
|
46744
|
-
id:
|
|
46745
|
-
summary:
|
|
46746
|
-
severity:
|
|
46747
|
-
aliases:
|
|
46748
|
-
affectedVersions:
|
|
46749
|
-
fixedVersion:
|
|
46750
|
-
url:
|
|
46880
|
+
var OsvVulnerabilitySchema = z101.object({
|
|
46881
|
+
id: z101.string(),
|
|
46882
|
+
summary: z101.string().optional(),
|
|
46883
|
+
severity: z101.enum(["CRITICAL", "HIGH", "MODERATE", "LOW", "UNKNOWN"]).optional(),
|
|
46884
|
+
aliases: z101.array(z101.string()).default([]),
|
|
46885
|
+
affectedVersions: z101.string().optional(),
|
|
46886
|
+
fixedVersion: z101.string().optional(),
|
|
46887
|
+
url: z101.string().optional()
|
|
46751
46888
|
});
|
|
46752
46889
|
var DEFAULT_OSV_CONFIG = {
|
|
46753
46890
|
timeoutMs: DEFAULT_TIMEOUT_MS4
|
|
@@ -47267,8 +47404,8 @@ var memoryInitPromise = null;
|
|
|
47267
47404
|
async function initPipelineMemory() {
|
|
47268
47405
|
if (cachedMemory !== null) return cachedMemory;
|
|
47269
47406
|
try {
|
|
47270
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
47271
|
-
const { getLearningDir } = await import("./learning-persistence-
|
|
47407
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-FW3BL34A.js");
|
|
47408
|
+
const { getLearningDir } = await import("./learning-persistence-DDCQTBPS.js");
|
|
47272
47409
|
const mem = createSessionMemory2(getLearningDir());
|
|
47273
47410
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
47274
47411
|
cachedMemory = {
|
|
@@ -47329,7 +47466,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
|
|
|
47329
47466
|
callRecord(routingMemoryCache);
|
|
47330
47467
|
return;
|
|
47331
47468
|
}
|
|
47332
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
47469
|
+
routingMemoryInitPromise ??= import("./routing-memory-LDELNOBJ.js").then(({ createRoutingMemory }) => {
|
|
47333
47470
|
routingMemoryCache ??= createRoutingMemory();
|
|
47334
47471
|
return routingMemoryCache;
|
|
47335
47472
|
}).catch((error) => {
|
|
@@ -47363,7 +47500,7 @@ ${text}` : "";
|
|
|
47363
47500
|
}
|
|
47364
47501
|
async function getWeatherContext() {
|
|
47365
47502
|
try {
|
|
47366
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
47503
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-BIJSJ5WH.js");
|
|
47367
47504
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
47368
47505
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
47369
47506
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -47381,8 +47518,8 @@ ${lines}
|
|
|
47381
47518
|
}
|
|
47382
47519
|
async function getMemoryContext(task) {
|
|
47383
47520
|
try {
|
|
47384
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
47385
|
-
const { getLearningDir } = await import("./learning-persistence-
|
|
47521
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-FW3BL34A.js");
|
|
47522
|
+
const { getLearningDir } = await import("./learning-persistence-DDCQTBPS.js");
|
|
47386
47523
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
47387
47524
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
47388
47525
|
if (learnings.length === 0) return "";
|
|
@@ -47500,7 +47637,7 @@ ${contextBlock}`;
|
|
|
47500
47637
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47501
47638
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47502
47639
|
try {
|
|
47503
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47640
|
+
const { executeVoting } = await import("./consensus-vote-OL7DLZNL.js");
|
|
47504
47641
|
const votingResult = await executeVoting(
|
|
47505
47642
|
{
|
|
47506
47643
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -47931,7 +48068,7 @@ async function searchCodebaseForTask(task) {
|
|
|
47931
48068
|
}
|
|
47932
48069
|
async function queryResearchRegistry(task) {
|
|
47933
48070
|
try {
|
|
47934
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
48071
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-L2HNQK7U.js");
|
|
47935
48072
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
47936
48073
|
if (topic === void 0) return null;
|
|
47937
48074
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -48002,7 +48139,7 @@ function createScanStageWrapper() {
|
|
|
48002
48139
|
try {
|
|
48003
48140
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
48004
48141
|
if (slug !== void 0) {
|
|
48005
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
48142
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-55ZTF2TY.js");
|
|
48006
48143
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
48007
48144
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
48008
48145
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -48209,7 +48346,7 @@ ${FINDINGS_FORMAT_INSTRUCTIONS}
|
|
|
48209
48346
|
}
|
|
48210
48347
|
|
|
48211
48348
|
// src/mcp/tools/pr-review-tool.ts
|
|
48212
|
-
import { z as
|
|
48349
|
+
import { z as z103 } from "zod";
|
|
48213
48350
|
import { randomUUID as randomUUID13 } from "node:crypto";
|
|
48214
48351
|
|
|
48215
48352
|
// src/audit/reviewed-diff-hash.ts
|
|
@@ -48245,17 +48382,17 @@ import { dirname as dirname3, isAbsolute, join as join11, resolve as resolve12 }
|
|
|
48245
48382
|
|
|
48246
48383
|
// src/audit/pr-review-record.ts
|
|
48247
48384
|
import * as crypto3 from "node:crypto";
|
|
48248
|
-
import { z as
|
|
48249
|
-
var PrReviewVerdictSchema =
|
|
48250
|
-
var PrReviewVoteCountsSchema =
|
|
48251
|
-
approve:
|
|
48252
|
-
request_changes:
|
|
48253
|
-
abstain:
|
|
48254
|
-
error:
|
|
48255
|
-
total:
|
|
48385
|
+
import { z as z102 } from "zod";
|
|
48386
|
+
var PrReviewVerdictSchema = z102.enum(["approve", "request_changes", "abstain"]);
|
|
48387
|
+
var PrReviewVoteCountsSchema = z102.object({
|
|
48388
|
+
approve: z102.number().int().nonnegative(),
|
|
48389
|
+
request_changes: z102.number().int().nonnegative(),
|
|
48390
|
+
abstain: z102.number().int().nonnegative(),
|
|
48391
|
+
error: z102.number().int().nonnegative(),
|
|
48392
|
+
total: z102.number().int().nonnegative()
|
|
48256
48393
|
}).strict();
|
|
48257
|
-
var PrReviewDiffSourceSchema =
|
|
48258
|
-
var PrReviewDiffProvenanceSchema =
|
|
48394
|
+
var PrReviewDiffSourceSchema = z102.enum(["canonical-git", "caller-supplied"]);
|
|
48395
|
+
var PrReviewDiffProvenanceSchema = z102.object({
|
|
48259
48396
|
/** How the reviewed diff was obtained. */
|
|
48260
48397
|
source: PrReviewDiffSourceSchema,
|
|
48261
48398
|
/**
|
|
@@ -48267,9 +48404,9 @@ var PrReviewDiffProvenanceSchema = z101.object({
|
|
|
48267
48404
|
* per-file attribution is unavailable. `false` means "a diff, but the packer
|
|
48268
48405
|
* saw it as one undifferentiated blob".
|
|
48269
48406
|
*/
|
|
48270
|
-
fileBoundaries:
|
|
48407
|
+
fileBoundaries: z102.boolean()
|
|
48271
48408
|
}).strict();
|
|
48272
|
-
var PrReviewSanitizationSchema =
|
|
48409
|
+
var PrReviewSanitizationSchema = z102.object({
|
|
48273
48410
|
/**
|
|
48274
48411
|
* The canonical hash (same {@link computeReviewedDiffHash} form) of the
|
|
48275
48412
|
* once-sanitized FULL diff. Equal to the record's `reviewedDiffHash` exactly
|
|
@@ -48287,14 +48424,14 @@ var PrReviewSanitizationSchema = z101.object({
|
|
|
48287
48424
|
* not tell an auditor WHICH one moved it. This field isolates the
|
|
48288
48425
|
* sanitization gap, which is the one `reviewedDiffHash` alone cannot show.
|
|
48289
48426
|
*/
|
|
48290
|
-
sanitizedDiffHash:
|
|
48427
|
+
sanitizedDiffHash: z102.string().length(64),
|
|
48291
48428
|
/**
|
|
48292
48429
|
* HTML comments the middleware stripped before dispatch. Non-zero with an
|
|
48293
48430
|
* EQUAL `sanitizedDiffHash` is not a contradiction: the counter is over the
|
|
48294
48431
|
* whole args object, the hash only over `prDiff`, so a comment stripped from
|
|
48295
48432
|
* a sibling field increments one without moving the other.
|
|
48296
48433
|
*/
|
|
48297
|
-
commentsRemoved:
|
|
48434
|
+
commentsRemoved: z102.number().int().nonnegative(),
|
|
48298
48435
|
/**
|
|
48299
48436
|
* How many FIELDS the sanitizer changed at all.
|
|
48300
48437
|
*
|
|
@@ -48309,7 +48446,7 @@ var PrReviewSanitizationSchema = z101.object({
|
|
|
48309
48446
|
* `fieldsModified === 0` is therefore the ONLY state that licenses "the
|
|
48310
48447
|
* sanitizer removed nothing".
|
|
48311
48448
|
*/
|
|
48312
|
-
fieldsModified:
|
|
48449
|
+
fieldsModified: z102.number().int().nonnegative(),
|
|
48313
48450
|
/**
|
|
48314
48451
|
* XML-like conversation-structure tags the sanitizer removed.
|
|
48315
48452
|
*
|
|
@@ -48320,38 +48457,38 @@ var PrReviewSanitizationSchema = z101.object({
|
|
|
48320
48457
|
* removal was routine. That is the reassurance an attacker wants, and it
|
|
48321
48458
|
* costs them only an HTML comment.
|
|
48322
48459
|
*/
|
|
48323
|
-
tagsRemoved:
|
|
48460
|
+
tagsRemoved: z102.number().int().nonnegative()
|
|
48324
48461
|
}).strict();
|
|
48325
|
-
var PrReviewBudgetSourceSchema =
|
|
48326
|
-
var PrReviewPanelCoverageSchema =
|
|
48462
|
+
var PrReviewBudgetSourceSchema = z102.enum(["registry", "binding-cap-fallback"]);
|
|
48463
|
+
var PrReviewPanelCoverageSchema = z102.object({
|
|
48327
48464
|
/** `'full'` — the panel was sent the whole diff; `'partial'` — a packed subset. */
|
|
48328
|
-
panelRead:
|
|
48465
|
+
panelRead: z102.enum(["full", "partial"]),
|
|
48329
48466
|
/** Files whose full diff the panel actually reviewed. */
|
|
48330
|
-
reviewedFiles:
|
|
48467
|
+
reviewedFiles: z102.number().int().nonnegative(),
|
|
48331
48468
|
/** Files in the original diff. */
|
|
48332
|
-
totalFiles:
|
|
48469
|
+
totalFiles: z102.number().int().nonnegative(),
|
|
48333
48470
|
/**
|
|
48334
48471
|
* EVERY path the panel did not fully review — the complete list, never a
|
|
48335
48472
|
* prefix of it. The summary stamp lists at most a few of these and says
|
|
48336
48473
|
* `N dropped (k listed)`; this field is where the rest live.
|
|
48337
48474
|
*/
|
|
48338
|
-
droppedFiles:
|
|
48475
|
+
droppedFiles: z102.array(z102.string()),
|
|
48339
48476
|
/** UTF-8 bytes of the diff text the panel actually read. */
|
|
48340
|
-
reviewedBytes:
|
|
48477
|
+
reviewedBytes: z102.number().int().nonnegative(),
|
|
48341
48478
|
/** UTF-8 bytes of the input diff. */
|
|
48342
|
-
totalBytes:
|
|
48479
|
+
totalBytes: z102.number().int().nonnegative(),
|
|
48343
48480
|
/** Where the panel-read budget came from. */
|
|
48344
48481
|
budgetSource: PrReviewBudgetSourceSchema,
|
|
48345
48482
|
/** The budget derivation (registry) or the fallback reason, verbatim. */
|
|
48346
|
-
budgetDetail:
|
|
48483
|
+
budgetDetail: z102.string()
|
|
48347
48484
|
}).strict();
|
|
48348
|
-
var PrReviewBindingBoundsSchema =
|
|
48485
|
+
var PrReviewBindingBoundsSchema = z102.object({
|
|
48349
48486
|
/** `'full'` — the hash covers every byte; `'prefix'` — only the first `boundBytes`. */
|
|
48350
|
-
kind:
|
|
48487
|
+
kind: z102.enum(["full", "prefix"]),
|
|
48351
48488
|
/** UTF-8 bytes the hash binds: `min(totalBytes, MAX_REVIEWED_DIFF_BYTES)`. */
|
|
48352
|
-
boundBytes:
|
|
48489
|
+
boundBytes: z102.number().int().nonnegative()
|
|
48353
48490
|
}).strict();
|
|
48354
|
-
var PrReviewRecordSchema =
|
|
48491
|
+
var PrReviewRecordSchema = z102.object({
|
|
48355
48492
|
/**
|
|
48356
48493
|
* Schema version. '1.1' was the Option-C binding (#3831): the record binds to
|
|
48357
48494
|
* `{prNumber, baseSha, reviewedDiffHash}` instead of the rejected `headSha`.
|
|
@@ -48379,22 +48516,22 @@ var PrReviewRecordSchema = z101.object({
|
|
|
48379
48516
|
* in which fields it CAN carry, and reading it as 1.4 is safe because its
|
|
48380
48517
|
* hash binds the same raw bytes. Tiers are labels; nothing orders them.
|
|
48381
48518
|
*/
|
|
48382
|
-
version:
|
|
48519
|
+
version: z102.enum(["1.3", "1.4"]),
|
|
48383
48520
|
/**
|
|
48384
48521
|
* Monotonic sequence number (integer ≥ 0). Assigned as (max existing
|
|
48385
48522
|
* sequence)+1 at write time. Sorted, the set of sequences must cover
|
|
48386
48523
|
* 0..maxSeq with no gap (omission detection); DUPLICATE sequences are a
|
|
48387
48524
|
* benign concurrent-fork signal, not tampering.
|
|
48388
48525
|
*/
|
|
48389
|
-
sequence:
|
|
48526
|
+
sequence: z102.number().int().nonnegative(),
|
|
48390
48527
|
/** The PR number the review covers. */
|
|
48391
|
-
prNumber:
|
|
48528
|
+
prNumber: z102.number().int().positive(),
|
|
48392
48529
|
/**
|
|
48393
48530
|
* The 40-hex BASE commit SHA the reviewed diff was computed against (the
|
|
48394
48531
|
* `<base>..<head>` range base). Part of the Option-C binding so the gate knows
|
|
48395
48532
|
* which range to recompute {@link reviewedDiffHash} over.
|
|
48396
48533
|
*/
|
|
48397
|
-
baseSha:
|
|
48534
|
+
baseSha: z102.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha"),
|
|
48398
48535
|
/**
|
|
48399
48536
|
* DIFF-BINDING (Option-C, #3831): sha256 of the canonical reviewed diff bytes
|
|
48400
48537
|
* (see `audit/reviewed-diff-hash.ts` — pinned `git diff` invocation + 50k
|
|
@@ -48403,9 +48540,9 @@ var PrReviewRecordSchema = z101.object({
|
|
|
48403
48540
|
* byte-identical to what the voters saw. Covered by the self-hash below, so it
|
|
48404
48541
|
* cannot be edited to claim a different reviewed diff.
|
|
48405
48542
|
*/
|
|
48406
|
-
reviewedDiffHash:
|
|
48543
|
+
reviewedDiffHash: z102.string().length(64),
|
|
48407
48544
|
/** ISO-8601 timestamp the review was recorded. */
|
|
48408
|
-
recordedAt:
|
|
48545
|
+
recordedAt: z102.string().min(1),
|
|
48409
48546
|
/** The resolved aggregate verdict. */
|
|
48410
48547
|
verdict: PrReviewVerdictSchema,
|
|
48411
48548
|
/**
|
|
@@ -48413,13 +48550,13 @@ var PrReviewRecordSchema = z101.object({
|
|
|
48413
48550
|
* `request_changes` with `verified: true` is a strict blocker; covered by the
|
|
48414
48551
|
* hash so it cannot be flipped without detection.
|
|
48415
48552
|
*/
|
|
48416
|
-
verified:
|
|
48553
|
+
verified: z102.boolean(),
|
|
48417
48554
|
/** Per-decision voter tally from the pr_review aggregate. */
|
|
48418
48555
|
voteCounts: PrReviewVoteCountsSchema,
|
|
48419
48556
|
/** Truncated human-readable review summary for the reviewer record. */
|
|
48420
|
-
summary:
|
|
48557
|
+
summary: z102.string(),
|
|
48421
48558
|
/** Optional correlation/decision id linking to the cost rollup / trace. */
|
|
48422
|
-
correlationId:
|
|
48559
|
+
correlationId: z102.string().min(1).optional(),
|
|
48423
48560
|
/**
|
|
48424
48561
|
* What this record was DERIVED FROM (#4459). OPTIONAL by necessity: the
|
|
48425
48562
|
* schema is `.strict()`, so a required field would reject every record
|
|
@@ -48454,9 +48591,9 @@ var PrReviewRecordSchema = z101.object({
|
|
|
48454
48591
|
* Retained for audit texture but NOT covered by `hash` and NOT verified —
|
|
48455
48592
|
* the record-set model is position-independent (mirrors #3927).
|
|
48456
48593
|
*/
|
|
48457
|
-
previousHash:
|
|
48594
|
+
previousHash: z102.string().length(64).optional(),
|
|
48458
48595
|
/** SHA-256 over every field above EXCEPT `previousHash` (and except `hash`). */
|
|
48459
|
-
hash:
|
|
48596
|
+
hash: z102.string().length(64)
|
|
48460
48597
|
}).strict();
|
|
48461
48598
|
function projectPanelCoverage(c) {
|
|
48462
48599
|
return {
|
|
@@ -49206,19 +49343,19 @@ var MAX_REPO_CONTEXT_LENGTH = 2e3;
|
|
|
49206
49343
|
var MAX_TITLE_LENGTH = 500;
|
|
49207
49344
|
var MAX_DESCRIPTION_LENGTH = 1e4;
|
|
49208
49345
|
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.";
|
|
49209
|
-
var PrReviewInputSchema =
|
|
49210
|
-
prTitle:
|
|
49211
|
-
prDescription:
|
|
49212
|
-
prDiff:
|
|
49346
|
+
var PrReviewInputSchema = z103.object({
|
|
49347
|
+
prTitle: z103.string().min(1).max(MAX_TITLE_LENGTH).describe("PR title"),
|
|
49348
|
+
prDescription: z103.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
|
|
49349
|
+
prDiff: z103.string().min(1).max(MAX_DIFF_INPUT_LENGTH).refine(looksLikeUnifiedDiff, {
|
|
49213
49350
|
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)."
|
|
49214
49351
|
}).describe(
|
|
49215
49352
|
`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: the panel reads the whole diff whenever it fits the voters' context windows (#6003); a diff larger than that is security-prioritized and PARTIALLY reviewed (lowest-priority whole files dropped; a partial panel read can block but never verified-approve). Separately, the audit record's hash binds only the first ${String(MAX_DIFF_LENGTH)} UTF-8 bytes; the response \`coverage\` and the record summary state both what the panel read and what the hash binds.`
|
|
49216
49353
|
),
|
|
49217
|
-
repoContext:
|
|
49354
|
+
repoContext: z103.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
|
|
49218
49355
|
`Optional one-paragraph repo context (architecture, conventions; max ${String(MAX_REPO_CONTEXT_LENGTH)} chars; trim before calling)`
|
|
49219
49356
|
),
|
|
49220
|
-
baseRef:
|
|
49221
|
-
headRef:
|
|
49357
|
+
baseRef: z103.string().max(200).optional().describe("Base branch ref (e.g. main)"),
|
|
49358
|
+
headRef: z103.string().max(200).optional().describe("Head branch ref"),
|
|
49222
49359
|
/**
|
|
49223
49360
|
* Option-C audit binding (#4031). When BOTH `prNumber` and `baseSha` are
|
|
49224
49361
|
* supplied AND the review is live (not simulated), pr_review persists an
|
|
@@ -49234,14 +49371,14 @@ var PrReviewInputSchema = z102.object({
|
|
|
49234
49371
|
* the PR opened and drifts as main advances), so pass the merge-base as
|
|
49235
49372
|
* `baseSha` or the record will not match on an aged branch (#5692).
|
|
49236
49373
|
*/
|
|
49237
|
-
prNumber:
|
|
49238
|
-
baseSha:
|
|
49374
|
+
prNumber: z103.number().int().positive().optional().describe("PR number \u2014 with baseSha, enables Option-C audit-record persistence (#4031)"),
|
|
49375
|
+
baseSha: z103.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
|
|
49239
49376
|
"40-hex base commit sha the reviewed diff was computed from \u2014 pass `git merge-base origin/<base> <head>`, the base the gate recomputes (Option-C binding, #4031, #5692)"
|
|
49240
49377
|
),
|
|
49241
|
-
repoPath:
|
|
49378
|
+
repoPath: z103.string().max(1024).optional().describe(
|
|
49242
49379
|
"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."
|
|
49243
49380
|
),
|
|
49244
|
-
simulate:
|
|
49381
|
+
simulate: z103.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
|
|
49245
49382
|
/**
|
|
49246
49383
|
* Error policy (#4132). `standard` (default) keeps the pre-#4132 aggregation:
|
|
49247
49384
|
* an errored voter is simply excluded from the panel. `absolute_quorum` gates
|
|
@@ -49253,7 +49390,7 @@ var PrReviewInputSchema = z102.object({
|
|
|
49253
49390
|
* verified approve. A genuine `request_changes` blocker still wins (Tiers 1-2
|
|
49254
49391
|
* run first).
|
|
49255
49392
|
*/
|
|
49256
|
-
errorPolicy:
|
|
49393
|
+
errorPolicy: z103.enum(["standard", "absolute_quorum"]).default("standard").describe(
|
|
49257
49394
|
"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."
|
|
49258
49395
|
),
|
|
49259
49396
|
// #6123: same field as consensus_vote — the panel judges the caller's project.
|
|
@@ -49478,27 +49615,27 @@ function registerPrReviewTool(server, deps) {
|
|
|
49478
49615
|
}
|
|
49479
49616
|
|
|
49480
49617
|
// src/mcp/tools/survey-oss-landscape.ts
|
|
49481
|
-
import { z as
|
|
49482
|
-
var SurveyOssLandscapeInputSchema =
|
|
49483
|
-
query:
|
|
49484
|
-
maxResults:
|
|
49485
|
-
minStars:
|
|
49486
|
-
language:
|
|
49618
|
+
import { z as z104 } from "zod";
|
|
49619
|
+
var SurveyOssLandscapeInputSchema = z104.object({
|
|
49620
|
+
query: z104.string().min(1).max(200).describe('Free-text search query, e.g. "cargo nextest replacement" or "OSS SBOM tools"'),
|
|
49621
|
+
maxResults: z104.number().int().min(1).max(50).optional().default(10).describe("Maximum candidates to return (1-50; default 10)"),
|
|
49622
|
+
minStars: z104.number().int().min(0).optional().default(0).describe("Minimum star count to include (default 0; useful for filtering noise)"),
|
|
49623
|
+
language: z104.string().max(50).optional().describe('GitHub language filter, e.g. "rust" or "typescript"')
|
|
49487
49624
|
});
|
|
49488
|
-
var GitHubRepoSchema =
|
|
49489
|
-
full_name:
|
|
49490
|
-
html_url:
|
|
49491
|
-
description:
|
|
49492
|
-
stargazers_count:
|
|
49493
|
-
pushed_at:
|
|
49494
|
-
language:
|
|
49495
|
-
license:
|
|
49496
|
-
spdx_id:
|
|
49625
|
+
var GitHubRepoSchema = z104.object({
|
|
49626
|
+
full_name: z104.string().optional(),
|
|
49627
|
+
html_url: z104.string().optional(),
|
|
49628
|
+
description: z104.string().nullable().optional(),
|
|
49629
|
+
stargazers_count: z104.number().optional(),
|
|
49630
|
+
pushed_at: z104.string().nullable().optional(),
|
|
49631
|
+
language: z104.string().nullable().optional(),
|
|
49632
|
+
license: z104.object({
|
|
49633
|
+
spdx_id: z104.string().nullable().optional()
|
|
49497
49634
|
}).nullable().optional()
|
|
49498
49635
|
});
|
|
49499
|
-
var GitHubSearchResponseSchema =
|
|
49500
|
-
total_count:
|
|
49501
|
-
items:
|
|
49636
|
+
var GitHubSearchResponseSchema = z104.object({
|
|
49637
|
+
total_count: z104.number().optional(),
|
|
49638
|
+
items: z104.array(GitHubRepoSchema).optional()
|
|
49502
49639
|
});
|
|
49503
49640
|
var GITHUB_SEARCH_BASE = "https://api.github.com/search/repositories";
|
|
49504
49641
|
function buildGithubQuery(input) {
|
|
@@ -49625,11 +49762,11 @@ function createSurveyHandler(deps) {
|
|
|
49625
49762
|
};
|
|
49626
49763
|
}
|
|
49627
49764
|
var SURVEY_OUTPUT_SCHEMA = {
|
|
49628
|
-
query:
|
|
49629
|
-
totalFound:
|
|
49630
|
-
candidates:
|
|
49631
|
-
sourcesQueried:
|
|
49632
|
-
sourcesFailed:
|
|
49765
|
+
query: z104.string(),
|
|
49766
|
+
totalFound: z104.number(),
|
|
49767
|
+
candidates: z104.array(z104.unknown()),
|
|
49768
|
+
sourcesQueried: z104.array(z104.string()),
|
|
49769
|
+
sourcesFailed: z104.array(z104.string())
|
|
49633
49770
|
};
|
|
49634
49771
|
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?".';
|
|
49635
49772
|
function registerSurveyOssLandscapeTool(server, deps) {
|
|
@@ -49658,7 +49795,7 @@ function registerSurveyOssLandscapeTool(server, deps) {
|
|
|
49658
49795
|
}
|
|
49659
49796
|
|
|
49660
49797
|
// src/mcp/tools/vendor-publishing-audit.ts
|
|
49661
|
-
import { z as
|
|
49798
|
+
import { z as z105 } from "zod";
|
|
49662
49799
|
|
|
49663
49800
|
// src/mcp/tools/vendor-publishing-seed.ts
|
|
49664
49801
|
var VENDOR_PUBLISHING_SEED = {
|
|
@@ -49731,8 +49868,8 @@ function listKnownVendors() {
|
|
|
49731
49868
|
}
|
|
49732
49869
|
|
|
49733
49870
|
// src/mcp/tools/vendor-publishing-audit.ts
|
|
49734
|
-
var VendorPublishingAuditInputSchema =
|
|
49735
|
-
vendor:
|
|
49871
|
+
var VendorPublishingAuditInputSchema = z105.object({
|
|
49872
|
+
vendor: z105.string().min(1).max(50).toLowerCase().describe('Vendor identifier, lowercase. e.g. "ubuntu", "debian", "fedora"')
|
|
49736
49873
|
});
|
|
49737
49874
|
function lookupVendor(vendor) {
|
|
49738
49875
|
if (isKnownVendor(vendor)) {
|
|
@@ -49764,20 +49901,20 @@ function createVendorPublishingAuditHandler(deps) {
|
|
|
49764
49901
|
};
|
|
49765
49902
|
}
|
|
49766
49903
|
var VENDOR_PUBLISHING_OUTPUT_SCHEMA = {
|
|
49767
|
-
vendor:
|
|
49768
|
-
known:
|
|
49904
|
+
vendor: z105.string(),
|
|
49905
|
+
known: z105.boolean(),
|
|
49769
49906
|
// Fields below populate when known=true; permissive optional for known=false.
|
|
49770
|
-
sha256SumsUrlPattern:
|
|
49771
|
-
sha256SumsSignatureUrlPattern:
|
|
49772
|
-
signaturePattern:
|
|
49773
|
-
gpgKeys:
|
|
49774
|
-
releaseCadence:
|
|
49775
|
-
keyRotationNotes:
|
|
49776
|
-
vendorDocUrl:
|
|
49777
|
-
citedAt:
|
|
49907
|
+
sha256SumsUrlPattern: z105.string().optional(),
|
|
49908
|
+
sha256SumsSignatureUrlPattern: z105.string().optional(),
|
|
49909
|
+
signaturePattern: z105.string().optional(),
|
|
49910
|
+
gpgKeys: z105.array(z105.unknown()).optional(),
|
|
49911
|
+
releaseCadence: z105.string().optional(),
|
|
49912
|
+
keyRotationNotes: z105.string().optional(),
|
|
49913
|
+
vendorDocUrl: z105.string().optional(),
|
|
49914
|
+
citedAt: z105.string().optional(),
|
|
49778
49915
|
// Fields below populate when known=false.
|
|
49779
|
-
message:
|
|
49780
|
-
knownVendors:
|
|
49916
|
+
message: z105.string().optional(),
|
|
49917
|
+
knownVendors: z105.array(z105.string()).optional()
|
|
49781
49918
|
};
|
|
49782
49919
|
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.";
|
|
49783
49920
|
function registerVendorPublishingAuditTool(server, deps) {
|
|
@@ -49806,17 +49943,17 @@ function registerVendorPublishingAuditTool(server, deps) {
|
|
|
49806
49943
|
}
|
|
49807
49944
|
|
|
49808
49945
|
// src/mcp/tools/compare-data-feeds.ts
|
|
49809
|
-
import { z as
|
|
49946
|
+
import { z as z106 } from "zod";
|
|
49810
49947
|
import * as path6 from "node:path";
|
|
49811
49948
|
import * as fs7 from "node:fs";
|
|
49812
49949
|
import * as yaml4 from "yaml";
|
|
49813
|
-
var CompareDataFeedsInputSchema =
|
|
49814
|
-
feedAPath:
|
|
49815
|
-
feedBPath:
|
|
49816
|
-
keyPath:
|
|
49950
|
+
var CompareDataFeedsInputSchema = z106.object({
|
|
49951
|
+
feedAPath: z106.string().min(1).max(1e3).describe("Filesystem path to feed A (YAML or JSON, auto-detected by extension)"),
|
|
49952
|
+
feedBPath: z106.string().min(1).max(1e3).describe("Filesystem path to feed B"),
|
|
49953
|
+
keyPath: z106.string().min(1).max(200).describe(
|
|
49817
49954
|
'Dotted path to the entry key, e.g. "id" or "name". Each entry must have this field.'
|
|
49818
49955
|
),
|
|
49819
|
-
compareFields:
|
|
49956
|
+
compareFields: z106.array(z106.string().min(1).max(200)).max(20).optional().describe(
|
|
49820
49957
|
'Optional dotted field paths to compare across matched entries (e.g. ["license", "sha256"])'
|
|
49821
49958
|
)
|
|
49822
49959
|
});
|
|
@@ -50000,24 +50137,24 @@ function createCompareDataFeedsHandler(deps) {
|
|
|
50000
50137
|
};
|
|
50001
50138
|
}
|
|
50002
50139
|
var COMPARE_OUTPUT_SCHEMA = {
|
|
50003
|
-
feedAPath:
|
|
50004
|
-
feedBPath:
|
|
50005
|
-
keyPath:
|
|
50006
|
-
counts:
|
|
50007
|
-
entriesInA:
|
|
50008
|
-
entriesInB:
|
|
50009
|
-
onlyInA:
|
|
50010
|
-
onlyInB:
|
|
50011
|
-
inBoth:
|
|
50012
|
-
fieldDifferences:
|
|
50140
|
+
feedAPath: z106.string(),
|
|
50141
|
+
feedBPath: z106.string(),
|
|
50142
|
+
keyPath: z106.string(),
|
|
50143
|
+
counts: z106.object({
|
|
50144
|
+
entriesInA: z106.number(),
|
|
50145
|
+
entriesInB: z106.number(),
|
|
50146
|
+
onlyInA: z106.number(),
|
|
50147
|
+
onlyInB: z106.number(),
|
|
50148
|
+
inBoth: z106.number(),
|
|
50149
|
+
fieldDifferences: z106.number()
|
|
50013
50150
|
}),
|
|
50014
|
-
coverage:
|
|
50015
|
-
onlyInA:
|
|
50016
|
-
onlyInB:
|
|
50017
|
-
inBoth:
|
|
50151
|
+
coverage: z106.object({
|
|
50152
|
+
onlyInA: z106.array(z106.string()),
|
|
50153
|
+
onlyInB: z106.array(z106.string()),
|
|
50154
|
+
inBoth: z106.array(z106.string())
|
|
50018
50155
|
}),
|
|
50019
|
-
fieldDifferences:
|
|
50020
|
-
summary:
|
|
50156
|
+
fieldDifferences: z106.array(z106.unknown()),
|
|
50157
|
+
summary: z106.string()
|
|
50021
50158
|
};
|
|
50022
50159
|
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.";
|
|
50023
50160
|
function registerCompareDataFeedsTool(server, deps) {
|
|
@@ -50046,9 +50183,9 @@ function registerCompareDataFeedsTool(server, deps) {
|
|
|
50046
50183
|
}
|
|
50047
50184
|
|
|
50048
50185
|
// src/mcp/tools/query-task-state-tool.ts
|
|
50049
|
-
import { z as
|
|
50050
|
-
var QueryTaskStateInputSchema =
|
|
50051
|
-
taskId:
|
|
50186
|
+
import { z as z107 } from "zod";
|
|
50187
|
+
var QueryTaskStateInputSchema = z107.object({
|
|
50188
|
+
taskId: z107.string().min(1).max(128).describe("Task ID whose structured state log should be read")
|
|
50052
50189
|
});
|
|
50053
50190
|
function queryTaskStateHandler(args, ctx) {
|
|
50054
50191
|
const parsed = QueryTaskStateInputSchema.safeParse(args);
|
|
@@ -50083,7 +50220,7 @@ function queryTaskStateHandler(args, ctx) {
|
|
|
50083
50220
|
function registerQueryTaskStateTool(server, deps) {
|
|
50084
50221
|
const logger57 = deps.logger ?? createLogger({ tool: "query_task_state" });
|
|
50085
50222
|
const toolSchema = {
|
|
50086
|
-
taskId:
|
|
50223
|
+
taskId: z107.string().min(1).max(128).describe("Task ID whose structured state log should be read")
|
|
50087
50224
|
};
|
|
50088
50225
|
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.";
|
|
50089
50226
|
const secureHandler = createSecureHandler(queryTaskStateHandler, {
|
|
@@ -50105,28 +50242,28 @@ function registerQueryTaskStateTool(server, deps) {
|
|
|
50105
50242
|
}
|
|
50106
50243
|
|
|
50107
50244
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
50108
|
-
import { z as
|
|
50245
|
+
import { z as z110 } from "zod";
|
|
50109
50246
|
|
|
50110
50247
|
// src/mcp/tools/ci-health-log.ts
|
|
50111
50248
|
import { appendFileSync as appendFileSync4, existsSync as existsSync11, readFileSync as readFileSync10, statSync as statSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
50112
|
-
import { z as
|
|
50249
|
+
import { z as z109 } from "zod";
|
|
50113
50250
|
|
|
50114
50251
|
// src/mcp/tools/ci-health-types.ts
|
|
50115
|
-
import { z as
|
|
50116
|
-
var CiHealthStatusSchema =
|
|
50252
|
+
import { z as z108 } from "zod";
|
|
50253
|
+
var CiHealthStatusSchema = z108.enum(["healthy", "degraded", "outage", "unknown"]);
|
|
50117
50254
|
|
|
50118
50255
|
// src/mcp/tools/ci-health-log.ts
|
|
50119
50256
|
var logger47 = createLogger({ component: "ci-health-log" });
|
|
50120
|
-
var CiHealthEventSchema =
|
|
50121
|
-
v:
|
|
50122
|
-
ts:
|
|
50257
|
+
var CiHealthEventSchema = z109.object({
|
|
50258
|
+
v: z109.literal(1),
|
|
50259
|
+
ts: z109.iso.datetime(),
|
|
50123
50260
|
status: CiHealthStatusSchema,
|
|
50124
|
-
repo:
|
|
50125
|
-
signals:
|
|
50126
|
-
|
|
50127
|
-
source:
|
|
50261
|
+
repo: z109.string().optional(),
|
|
50262
|
+
signals: z109.array(
|
|
50263
|
+
z109.object({
|
|
50264
|
+
source: z109.enum(["github-status", "repo-activity-window"]),
|
|
50128
50265
|
status: CiHealthStatusSchema,
|
|
50129
|
-
evidence:
|
|
50266
|
+
evidence: z109.string()
|
|
50130
50267
|
})
|
|
50131
50268
|
)
|
|
50132
50269
|
});
|
|
@@ -50206,17 +50343,17 @@ function eventFromCheck(params) {
|
|
|
50206
50343
|
}
|
|
50207
50344
|
|
|
50208
50345
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
50209
|
-
var CiHealthCheckInputSchema =
|
|
50346
|
+
var CiHealthCheckInputSchema = z110.object({
|
|
50210
50347
|
/**
|
|
50211
50348
|
* Repo to check for the recent-runs activity signal (in `owner/repo` form).
|
|
50212
50349
|
* Optional — when omitted, only the status-page signal is consulted.
|
|
50213
50350
|
*/
|
|
50214
|
-
repo:
|
|
50351
|
+
repo: z110.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."),
|
|
50215
50352
|
/**
|
|
50216
50353
|
* How far back to look for recent-runs activity (minutes). Default 30 —
|
|
50217
50354
|
* matches the typical wedge-detection window from the #3070 / #3076 outages.
|
|
50218
50355
|
*/
|
|
50219
|
-
activityWindowMinutes:
|
|
50356
|
+
activityWindowMinutes: z110.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
50220
50357
|
});
|
|
50221
50358
|
var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
|
|
50222
50359
|
function mapStatusPageStatus(raw) {
|
|
@@ -50349,8 +50486,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
|
|
|
50349
50486
|
function registerCiHealthCheckTool(server, deps) {
|
|
50350
50487
|
const logger57 = deps.logger ?? createLogger({ tool: "ci_health_check" });
|
|
50351
50488
|
const toolSchema = {
|
|
50352
|
-
repo:
|
|
50353
|
-
activityWindowMinutes:
|
|
50489
|
+
repo: z110.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."),
|
|
50490
|
+
activityWindowMinutes: z110.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
50354
50491
|
};
|
|
50355
50492
|
const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger57), {
|
|
50356
50493
|
toolName: "ci_health_check",
|
|
@@ -50376,18 +50513,18 @@ function registerCiHealthCheckTool(server, deps) {
|
|
|
50376
50513
|
|
|
50377
50514
|
// src/mcp/tools/quality-gate-tool.ts
|
|
50378
50515
|
import { statSync as statSync3 } from "node:fs";
|
|
50379
|
-
import { z as
|
|
50380
|
-
var QualityCheckSchema =
|
|
50516
|
+
import { z as z111 } from "zod";
|
|
50517
|
+
var QualityCheckSchema = z111.enum(["typecheck", "lint", "tests", "build", "security"]);
|
|
50381
50518
|
var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
|
|
50382
|
-
var RunQualityGateInputSchema =
|
|
50519
|
+
var RunQualityGateInputSchema = z111.object({
|
|
50383
50520
|
/** Project directory to run checks against. Must resolve inside the repo/cwd root. */
|
|
50384
|
-
projectDir:
|
|
50521
|
+
projectDir: z111.string().optional().describe(
|
|
50385
50522
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
50386
50523
|
),
|
|
50387
50524
|
/** Which allowlisted checks to run. */
|
|
50388
|
-
checks:
|
|
50525
|
+
checks: z111.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
50389
50526
|
/** 1-based iteration counter, forwarded to the engine for feedback context. */
|
|
50390
|
-
iteration:
|
|
50527
|
+
iteration: z111.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
|
|
50391
50528
|
});
|
|
50392
50529
|
function validateProjectDir(raw) {
|
|
50393
50530
|
const candidate = raw ?? process.cwd();
|
|
@@ -50462,11 +50599,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
|
|
|
50462
50599
|
function registerRunQualityGateTool(server, deps) {
|
|
50463
50600
|
const logger57 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
|
|
50464
50601
|
const toolSchema = {
|
|
50465
|
-
projectDir:
|
|
50602
|
+
projectDir: z111.string().optional().describe(
|
|
50466
50603
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
50467
50604
|
),
|
|
50468
|
-
checks:
|
|
50469
|
-
iteration:
|
|
50605
|
+
checks: z111.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
50606
|
+
iteration: z111.number().int().min(1).optional().describe("1-based iteration number (default 1).")
|
|
50470
50607
|
};
|
|
50471
50608
|
const secureHandler = createSecureHandler(
|
|
50472
50609
|
(args) => runQualityGateHandler(args, logger57),
|
|
@@ -50496,9 +50633,9 @@ function registerRunQualityGateTool(server, deps) {
|
|
|
50496
50633
|
// src/mcp/tools/verify-audit-chain-tool.ts
|
|
50497
50634
|
import * as fs8 from "node:fs/promises";
|
|
50498
50635
|
import * as path7 from "node:path";
|
|
50499
|
-
import { z as
|
|
50500
|
-
var VerifyAuditChainInputSchema =
|
|
50501
|
-
logDir:
|
|
50636
|
+
import { z as z112 } from "zod";
|
|
50637
|
+
var VerifyAuditChainInputSchema = z112.object({
|
|
50638
|
+
logDir: z112.string().min(1).max(512).describe(
|
|
50502
50639
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
|
|
50503
50640
|
)
|
|
50504
50641
|
});
|
|
@@ -50588,7 +50725,7 @@ async function handler2(args, ctx) {
|
|
|
50588
50725
|
function registerVerifyAuditChainTool(server, deps) {
|
|
50589
50726
|
const logger57 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
|
|
50590
50727
|
const toolSchema = {
|
|
50591
|
-
logDir:
|
|
50728
|
+
logDir: z112.string().min(1).max(512).describe(
|
|
50592
50729
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
|
|
50593
50730
|
)
|
|
50594
50731
|
};
|
|
@@ -50612,7 +50749,7 @@ function registerVerifyAuditChainTool(server, deps) {
|
|
|
50612
50749
|
}
|
|
50613
50750
|
|
|
50614
50751
|
// src/mcp/tools/suggest-research-tasks-tool.ts
|
|
50615
|
-
import { z as
|
|
50752
|
+
import { z as z113 } from "zod";
|
|
50616
50753
|
var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
|
|
50617
50754
|
var RESEARCH_BUDGET_MS = 2e4;
|
|
50618
50755
|
var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
|
|
@@ -50629,11 +50766,11 @@ async function withResearchBudget(p, ms) {
|
|
|
50629
50766
|
if (timer !== void 0) clearTimeout(timer);
|
|
50630
50767
|
}
|
|
50631
50768
|
}
|
|
50632
|
-
var SuggestResearchTasksInputSchema =
|
|
50633
|
-
topic:
|
|
50634
|
-
qualityThreshold:
|
|
50635
|
-
maxTriggers:
|
|
50636
|
-
existingTaskIds:
|
|
50769
|
+
var SuggestResearchTasksInputSchema = z113.object({
|
|
50770
|
+
topic: z113.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
50771
|
+
qualityThreshold: z113.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
50772
|
+
maxTriggers: z113.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
50773
|
+
existingTaskIds: z113.array(z113.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
50637
50774
|
});
|
|
50638
50775
|
function toTriggerConfig(input) {
|
|
50639
50776
|
return {
|
|
@@ -50690,10 +50827,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
|
|
|
50690
50827
|
function registerSuggestResearchTasksTool(server, deps) {
|
|
50691
50828
|
const logger57 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
|
|
50692
50829
|
const toolSchema = {
|
|
50693
|
-
topic:
|
|
50694
|
-
qualityThreshold:
|
|
50695
|
-
maxTriggers:
|
|
50696
|
-
existingTaskIds:
|
|
50830
|
+
topic: z113.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
50831
|
+
qualityThreshold: z113.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
50832
|
+
maxTriggers: z113.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
50833
|
+
existingTaskIds: z113.array(z113.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
50697
50834
|
};
|
|
50698
50835
|
const secureHandler = createSecureHandler(
|
|
50699
50836
|
(args) => suggestResearchTasksHandler(args, logger57),
|
|
@@ -50721,7 +50858,7 @@ function registerSuggestResearchTasksTool(server, deps) {
|
|
|
50721
50858
|
}
|
|
50722
50859
|
|
|
50723
50860
|
// src/mcp/tools/run-tool.ts
|
|
50724
|
-
import { z as
|
|
50861
|
+
import { z as z117 } from "zod";
|
|
50725
50862
|
import { randomUUID as randomUUID17 } from "node:crypto";
|
|
50726
50863
|
|
|
50727
50864
|
// src/orchestration/meta-dispatcher.ts
|
|
@@ -51181,7 +51318,7 @@ function createMetaOrchestrator(options) {
|
|
|
51181
51318
|
|
|
51182
51319
|
// src/orchestration/meta-shadow-selector.ts
|
|
51183
51320
|
import { appendFileSync as appendFileSync5, existsSync as existsSync12, readFileSync as readFileSync11 } from "node:fs";
|
|
51184
|
-
import { z as
|
|
51321
|
+
import { z as z114 } from "zod";
|
|
51185
51322
|
var SHADOW_STRATEGY_ARMS = [
|
|
51186
51323
|
"single-shot",
|
|
51187
51324
|
"dev-pipeline",
|
|
@@ -51268,19 +51405,19 @@ function createHydratableSelector() {
|
|
|
51268
51405
|
var META_OUTCOME_SCHEMA_VERSION = 1;
|
|
51269
51406
|
var HYDRATE_LOOKBACK_DAYS = 30;
|
|
51270
51407
|
var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
|
|
51271
|
-
var PersistedContextSchema =
|
|
51272
|
-
taskComplexity:
|
|
51273
|
-
contextLengthNormalized:
|
|
51274
|
-
isCodeTask:
|
|
51275
|
-
isReasoningTask:
|
|
51276
|
-
budgetUtilization:
|
|
51277
|
-
timePressure:
|
|
51408
|
+
var PersistedContextSchema = z114.object({
|
|
51409
|
+
taskComplexity: z114.number(),
|
|
51410
|
+
contextLengthNormalized: z114.number(),
|
|
51411
|
+
isCodeTask: z114.number(),
|
|
51412
|
+
isReasoningTask: z114.number(),
|
|
51413
|
+
budgetUtilization: z114.number(),
|
|
51414
|
+
timePressure: z114.number()
|
|
51278
51415
|
});
|
|
51279
|
-
var PersistedMetaOutcomeSchema =
|
|
51280
|
-
schema:
|
|
51281
|
-
timestamp:
|
|
51282
|
-
strategy:
|
|
51283
|
-
success:
|
|
51416
|
+
var PersistedMetaOutcomeSchema = z114.object({
|
|
51417
|
+
schema: z114.literal(META_OUTCOME_SCHEMA_VERSION),
|
|
51418
|
+
timestamp: z114.string(),
|
|
51419
|
+
strategy: z114.enum(SHADOW_STRATEGY_ARMS),
|
|
51420
|
+
success: z114.boolean(),
|
|
51284
51421
|
context: PersistedContextSchema
|
|
51285
51422
|
});
|
|
51286
51423
|
var persistLogger = createLogger({ component: "MetaShadowSelector" });
|
|
@@ -51673,7 +51810,7 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
|
|
|
51673
51810
|
}
|
|
51674
51811
|
|
|
51675
51812
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
51676
|
-
import { z as
|
|
51813
|
+
import { z as z115 } from "zod";
|
|
51677
51814
|
import * as fs10 from "node:fs";
|
|
51678
51815
|
import * as path9 from "node:path";
|
|
51679
51816
|
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
@@ -51697,7 +51834,7 @@ var GitHubTaskTracker = class {
|
|
|
51697
51834
|
cachedProvider = null;
|
|
51698
51835
|
async getProvider() {
|
|
51699
51836
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
51700
|
-
const { createScmProvider } = await import("./factory-
|
|
51837
|
+
const { createScmProvider } = await import("./factory-AKKNZQRC.js");
|
|
51701
51838
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
51702
51839
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
51703
51840
|
this.cachedProvider = result.value;
|
|
@@ -51826,36 +51963,36 @@ var DEV_PIPELINE_DRY_RUN_NOTE = "This was a dry run (plan+vote), which always ru
|
|
|
51826
51963
|
function dispatchNoteFor(dryRun) {
|
|
51827
51964
|
return dryRun ? DEV_PIPELINE_DRY_RUN_NOTE : DEV_PIPELINE_ASYNC_HINT;
|
|
51828
51965
|
}
|
|
51829
|
-
var DevPipelineInputSchema =
|
|
51966
|
+
var DevPipelineInputSchema = z115.object({
|
|
51830
51967
|
/** Direct task instructions. */
|
|
51831
|
-
task:
|
|
51968
|
+
task: z115.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
|
|
51832
51969
|
/** Path to a plan file (.md, .yaml, .txt) to use as input. */
|
|
51833
|
-
planFile:
|
|
51970
|
+
planFile: z115.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
|
|
51834
51971
|
/** Whether to run in dry-run mode (plan+vote only, no implementation). */
|
|
51835
|
-
dryRun:
|
|
51972
|
+
dryRun: z115.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
|
|
51836
51973
|
/** Maximum vote iterations before proceeding (default: 3). */
|
|
51837
|
-
maxVoteIterations:
|
|
51974
|
+
maxVoteIterations: z115.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
|
|
51838
51975
|
/** Maximum QA iterations per task (default: 3). */
|
|
51839
|
-
maxQaIterations:
|
|
51976
|
+
maxQaIterations: z115.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
|
|
51840
51977
|
/** Working directory for the pipeline (default: cwd). Used for security scan and context. */
|
|
51841
|
-
workingDir:
|
|
51978
|
+
workingDir: z115.string().max(500).optional().describe("Working directory (default: cwd)"),
|
|
51842
51979
|
/** GitHub issue number to track progress on. Updates posted as comments. */
|
|
51843
|
-
issueNumber:
|
|
51980
|
+
issueNumber: z115.number().int().positive().optional().describe("GitHub issue to post progress to"),
|
|
51844
51981
|
/** GitHub repo (owner/name) for issue tracking. */
|
|
51845
|
-
repo:
|
|
51982
|
+
repo: z115.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
|
|
51846
51983
|
/** Task tracking backend: github, gitlab, or json (default: json). */
|
|
51847
|
-
trackerBackend:
|
|
51984
|
+
trackerBackend: z115.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
|
|
51848
51985
|
/** Labels to apply to created issues. */
|
|
51849
|
-
labels:
|
|
51986
|
+
labels: z115.array(z115.string()).optional().describe("Labels for created issues"),
|
|
51850
51987
|
/** Session ID for checkpoint/resume. Enables crash recovery. */
|
|
51851
|
-
sessionId:
|
|
51988
|
+
sessionId: z115.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
|
|
51852
51989
|
/**
|
|
51853
51990
|
* TESTS ONLY — when true, voters return random decisions. Must not be used as
|
|
51854
51991
|
* a fallback when adapters are unavailable; configure an adapter instead. (#2319)
|
|
51855
51992
|
*/
|
|
51856
|
-
simulateVotes:
|
|
51993
|
+
simulateVotes: z115.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
|
|
51857
51994
|
/** Voting strategy for consensus stages. */
|
|
51858
|
-
votingStrategy:
|
|
51995
|
+
votingStrategy: z115.enum([
|
|
51859
51996
|
"simple_majority",
|
|
51860
51997
|
"supermajority",
|
|
51861
51998
|
"unanimous",
|
|
@@ -51864,15 +52001,15 @@ var DevPipelineInputSchema = z114.object({
|
|
|
51864
52001
|
"opinion_wise"
|
|
51865
52002
|
]).optional().describe("Voting strategy for plan approval (default: higher_order)"),
|
|
51866
52003
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
51867
|
-
quickMode:
|
|
52004
|
+
quickMode: z115.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
51868
52005
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
51869
|
-
timeoutMs:
|
|
52006
|
+
timeoutMs: z115.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
51870
52007
|
/**
|
|
51871
52008
|
* Pipeline execution mode — a REAL field on this tool, unrelated to async
|
|
51872
52009
|
* dispatch. A caller who learned `mode: 'async'` elsewhere gets an error
|
|
51873
52010
|
* naming `dispatch` rather than the bare enum message (#4968).
|
|
51874
52011
|
*/
|
|
51875
|
-
mode:
|
|
52012
|
+
mode: z115.enum(["autonomous", "harness"], { error: modeEnumErrorNamingDispatch }).default("autonomous").describe(
|
|
51876
52013
|
"'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement. (Not the async switch \u2014 that is `dispatch`.)"
|
|
51877
52014
|
),
|
|
51878
52015
|
/**
|
|
@@ -51886,11 +52023,11 @@ var DevPipelineInputSchema = z114.object({
|
|
|
51886
52023
|
*/
|
|
51887
52024
|
dispatch: dispatchFieldDefaultSync("Ignored for dryRun."),
|
|
51888
52025
|
/** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
|
|
51889
|
-
qualityGate:
|
|
52026
|
+
qualityGate: z115.enum(["off", "advisory", "blocking"]).default("off").describe(
|
|
51890
52027
|
"Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
|
|
51891
52028
|
),
|
|
51892
52029
|
/** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
|
|
51893
|
-
maxBudgetTokens:
|
|
52030
|
+
maxBudgetTokens: z115.number().int().positive().optional().describe(
|
|
51894
52031
|
"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)."
|
|
51895
52032
|
)
|
|
51896
52033
|
});
|
|
@@ -52118,20 +52255,20 @@ function registerDevPipelineTool(server, deps) {
|
|
|
52118
52255
|
}
|
|
52119
52256
|
|
|
52120
52257
|
// src/mcp/tools/pipeline-tool.ts
|
|
52121
|
-
import { z as
|
|
52258
|
+
import { z as z116 } from "zod";
|
|
52122
52259
|
import * as fs11 from "node:fs";
|
|
52123
52260
|
import * as path10 from "node:path";
|
|
52124
52261
|
import { randomUUID as randomUUID16 } from "node:crypto";
|
|
52125
52262
|
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.";
|
|
52126
|
-
var PipelineInputSchema =
|
|
52263
|
+
var PipelineInputSchema = z116.object({
|
|
52127
52264
|
/** The task to execute. */
|
|
52128
|
-
task:
|
|
52265
|
+
task: z116.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
|
|
52129
52266
|
/** Path to a spec file (.md, .yaml) to use as task input. */
|
|
52130
|
-
specFile:
|
|
52267
|
+
specFile: z116.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
|
|
52131
52268
|
/** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
|
|
52132
|
-
template:
|
|
52269
|
+
template: z116.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
|
|
52133
52270
|
/** Voting strategy for consensus stages. */
|
|
52134
|
-
votingStrategy:
|
|
52271
|
+
votingStrategy: z116.enum([
|
|
52135
52272
|
"simple_majority",
|
|
52136
52273
|
"supermajority",
|
|
52137
52274
|
"unanimous",
|
|
@@ -52142,11 +52279,11 @@ var PipelineInputSchema = z115.object({
|
|
|
52142
52279
|
"Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
|
|
52143
52280
|
),
|
|
52144
52281
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
52145
|
-
quickMode:
|
|
52282
|
+
quickMode: z116.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
52146
52283
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
52147
|
-
timeoutMs:
|
|
52284
|
+
timeoutMs: z116.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
52148
52285
|
/** Stop after planning/voting (no implementation). */
|
|
52149
|
-
dryRun:
|
|
52286
|
+
dryRun: z116.boolean().default(false).describe("Stop after vote stage (no implementation)"),
|
|
52150
52287
|
/**
|
|
52151
52288
|
* Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
|
|
52152
52289
|
* returns the result — but a real multi-stage adaptive run can exceed the
|
|
@@ -52157,7 +52294,7 @@ var PipelineInputSchema = z115.object({
|
|
|
52157
52294
|
*/
|
|
52158
52295
|
...asyncDispatchInputDefaultSync("Ignored for dryRun."),
|
|
52159
52296
|
/** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
|
|
52160
|
-
simulateVotes:
|
|
52297
|
+
simulateVotes: z116.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
|
|
52161
52298
|
});
|
|
52162
52299
|
function buildOutput3(result, simulated) {
|
|
52163
52300
|
return {
|
|
@@ -52331,9 +52468,9 @@ function registerPipelineTool(server, deps) {
|
|
|
52331
52468
|
}
|
|
52332
52469
|
|
|
52333
52470
|
// src/mcp/tools/run-tool.ts
|
|
52334
|
-
var RunInputSchema =
|
|
52335
|
-
goal:
|
|
52336
|
-
forceStrategy:
|
|
52471
|
+
var RunInputSchema = z117.object({
|
|
52472
|
+
goal: z117.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
|
|
52473
|
+
forceStrategy: z117.enum([
|
|
52337
52474
|
"single-shot",
|
|
52338
52475
|
"dev-pipeline",
|
|
52339
52476
|
"pipeline",
|
|
@@ -52345,10 +52482,10 @@ var RunInputSchema = z116.object({
|
|
|
52345
52482
|
]).optional().describe(
|
|
52346
52483
|
"Power-user override: force a specific strategy instead of letting the router choose."
|
|
52347
52484
|
),
|
|
52348
|
-
requiresConsensus:
|
|
52349
|
-
dependencyStructure:
|
|
52350
|
-
isNovel:
|
|
52351
|
-
execute:
|
|
52485
|
+
requiresConsensus: z117.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
|
|
52486
|
+
dependencyStructure: z117.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
|
|
52487
|
+
isNovel: z117.boolean().optional().describe("Hint: this kind of task has not been seen before."),
|
|
52488
|
+
execute: z117.boolean().optional().describe(
|
|
52352
52489
|
"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)."
|
|
52353
52490
|
),
|
|
52354
52491
|
/**
|
|
@@ -52363,7 +52500,7 @@ var RunInputSchema = z116.object({
|
|
|
52363
52500
|
* other, the call is REFUSED rather than executed: silently ignoring a
|
|
52364
52501
|
* do-not-act flag is the one outcome a governance substrate cannot allow.
|
|
52365
52502
|
*/
|
|
52366
|
-
dryRun:
|
|
52503
|
+
dryRun: z117.boolean().optional().describe(
|
|
52367
52504
|
"Plan and vote only, no implementation (#4806). Requires the dev-pipeline strategy \u2014 refused (never silently executed) when the router selects another."
|
|
52368
52505
|
),
|
|
52369
52506
|
/**
|
|
@@ -52598,12 +52735,12 @@ function registerRunTool(server, deps) {
|
|
|
52598
52735
|
}
|
|
52599
52736
|
|
|
52600
52737
|
// src/mcp/tools/list-available-models-tool.ts
|
|
52601
|
-
import { z as
|
|
52738
|
+
import { z as z118 } from "zod";
|
|
52602
52739
|
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.";
|
|
52603
52740
|
var PROBE_TIMEOUT_MS = 12e3;
|
|
52604
|
-
var ListAvailableModelsInputSchema =
|
|
52605
|
-
includeModelIds:
|
|
52606
|
-
includeOpenRouter:
|
|
52741
|
+
var ListAvailableModelsInputSchema = z118.object({
|
|
52742
|
+
includeModelIds: z118.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
52743
|
+
includeOpenRouter: z118.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
52607
52744
|
});
|
|
52608
52745
|
async function probeSource(source, includeModelIds) {
|
|
52609
52746
|
let timer;
|
|
@@ -52637,7 +52774,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
52637
52774
|
}
|
|
52638
52775
|
}
|
|
52639
52776
|
async function defaultSources(includeOpenRouter) {
|
|
52640
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
52777
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-KKA2PEK4.js");
|
|
52641
52778
|
const adapters = createAllAdapters2();
|
|
52642
52779
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
52643
52780
|
}
|
|
@@ -52670,8 +52807,8 @@ async function listAvailableModelsHandler(args, deps, logger57) {
|
|
|
52670
52807
|
function registerListAvailableModelsTool(server, deps) {
|
|
52671
52808
|
const logger57 = deps.logger ?? createLogger({ tool: "list_available_models" });
|
|
52672
52809
|
const toolSchema = {
|
|
52673
|
-
includeModelIds:
|
|
52674
|
-
includeOpenRouter:
|
|
52810
|
+
includeModelIds: z118.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
52811
|
+
includeOpenRouter: z118.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
52675
52812
|
};
|
|
52676
52813
|
const secureHandler = createSecureHandler(
|
|
52677
52814
|
(args) => listAvailableModelsHandler(args, deps, logger57),
|
|
@@ -52695,7 +52832,7 @@ function registerListAvailableModelsTool(server, deps) {
|
|
|
52695
52832
|
}
|
|
52696
52833
|
|
|
52697
52834
|
// src/mcp/tools/pr-review-eval-types.ts
|
|
52698
|
-
import { z as
|
|
52835
|
+
import { z as z119 } from "zod";
|
|
52699
52836
|
var PR_REVIEW_EVAL_ROLES = [
|
|
52700
52837
|
"architect",
|
|
52701
52838
|
"security",
|
|
@@ -52703,43 +52840,43 @@ var PR_REVIEW_EVAL_ROLES = [
|
|
|
52703
52840
|
"catfish",
|
|
52704
52841
|
"scope_steward"
|
|
52705
52842
|
];
|
|
52706
|
-
var PrReviewEvalRoleSchema =
|
|
52707
|
-
var PrReviewCaseClassSchema =
|
|
52708
|
-
var VoterEvalVerdictSchema =
|
|
52843
|
+
var PrReviewEvalRoleSchema = z119.enum(PR_REVIEW_EVAL_ROLES);
|
|
52844
|
+
var PrReviewCaseClassSchema = z119.enum(["buggy", "clean", "borderline"]);
|
|
52845
|
+
var VoterEvalVerdictSchema = z119.object({
|
|
52709
52846
|
/** Stable record id (e.g. `${runId}:${caseNumber}:${role}`). */
|
|
52710
|
-
id:
|
|
52847
|
+
id: z119.string().min(1).max(160),
|
|
52711
52848
|
/** The pr_review run / batch this verdict belongs to. */
|
|
52712
|
-
runId:
|
|
52849
|
+
runId: z119.string().min(1).max(64),
|
|
52713
52850
|
/** Dataset case identifier (the dataset's `number` field). */
|
|
52714
|
-
caseNumber:
|
|
52851
|
+
caseNumber: z119.string().min(1).max(80),
|
|
52715
52852
|
/** Rubric class of the case (ground-truth label). */
|
|
52716
52853
|
caseClass: PrReviewCaseClassSchema,
|
|
52717
52854
|
/** The voter role being scored. */
|
|
52718
52855
|
role: PrReviewEvalRoleSchema,
|
|
52719
52856
|
/** Verified findings that matched a known bug. */
|
|
52720
|
-
truePositives:
|
|
52857
|
+
truePositives: z119.number().int().nonnegative(),
|
|
52721
52858
|
/** Verified findings on clean code that matched no known bug. */
|
|
52722
|
-
falsePositives:
|
|
52859
|
+
falsePositives: z119.number().int().nonnegative(),
|
|
52723
52860
|
/** Known bugs this voter failed to flag. */
|
|
52724
|
-
falseNegatives:
|
|
52861
|
+
falseNegatives: z119.number().int().nonnegative(),
|
|
52725
52862
|
/** Rubric version the ground truth was adjudicated under. */
|
|
52726
|
-
rubricVersion:
|
|
52863
|
+
rubricVersion: z119.string().min(1).max(32),
|
|
52727
52864
|
/** ISO-8601 timestamp the verdict was recorded. */
|
|
52728
|
-
timestamp:
|
|
52865
|
+
timestamp: z119.string().min(1).max(40)
|
|
52729
52866
|
});
|
|
52730
|
-
var VoterEvalVerdictQuerySchema =
|
|
52867
|
+
var VoterEvalVerdictQuerySchema = z119.object({
|
|
52731
52868
|
role: PrReviewEvalRoleSchema.optional(),
|
|
52732
|
-
runId:
|
|
52869
|
+
runId: z119.string().min(1).max(64).optional(),
|
|
52733
52870
|
caseClass: PrReviewCaseClassSchema.optional(),
|
|
52734
|
-
rubricVersion:
|
|
52871
|
+
rubricVersion: z119.string().min(1).max(32).optional(),
|
|
52735
52872
|
/** ISO-8601 lower bound (inclusive) on `timestamp`. */
|
|
52736
|
-
since:
|
|
52873
|
+
since: z119.string().optional(),
|
|
52737
52874
|
/** Most-recent-N cap. */
|
|
52738
|
-
limit:
|
|
52875
|
+
limit: z119.number().int().positive().optional()
|
|
52739
52876
|
});
|
|
52740
52877
|
|
|
52741
52878
|
// src/mcp/tools/supply-chain-tradeoff-panel.ts
|
|
52742
|
-
import { z as
|
|
52879
|
+
import { z as z120 } from "zod";
|
|
52743
52880
|
import { randomUUID as randomUUID18 } from "node:crypto";
|
|
52744
52881
|
var DEFAULT_AXES = [
|
|
52745
52882
|
"build_time_determinism",
|
|
@@ -52761,16 +52898,16 @@ var FULL_PANEL = [
|
|
|
52761
52898
|
"scope_steward"
|
|
52762
52899
|
];
|
|
52763
52900
|
var QUICK_PANEL = ["architect", "security", "scope_steward"];
|
|
52764
|
-
var SupplyChainTradeoffPanelInputSchema =
|
|
52765
|
-
proposal:
|
|
52766
|
-
axes:
|
|
52901
|
+
var SupplyChainTradeoffPanelInputSchema = z120.object({
|
|
52902
|
+
proposal: z120.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
|
|
52903
|
+
axes: z120.array(z120.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
|
|
52767
52904
|
`Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
|
|
52768
52905
|
),
|
|
52769
|
-
context:
|
|
52906
|
+
context: z120.string().max(MAX_CONTEXT_LENGTH).optional().describe(
|
|
52770
52907
|
"Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
|
|
52771
52908
|
),
|
|
52772
|
-
quickMode:
|
|
52773
|
-
simulate:
|
|
52909
|
+
quickMode: z120.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
|
|
52910
|
+
simulate: z120.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
|
|
52774
52911
|
// #6123: same field as consensus_vote — the panel judges the caller's project.
|
|
52775
52912
|
project: VoterProjectInputSchema,
|
|
52776
52913
|
/**
|
|
@@ -53263,40 +53400,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
|
|
|
53263
53400
|
})(RiskLevel || {});
|
|
53264
53401
|
|
|
53265
53402
|
// src/mcp/safety/stpa-schemas.ts
|
|
53266
|
-
import { z as
|
|
53267
|
-
var HazardCategorySchema =
|
|
53268
|
-
var HazardSeveritySchema =
|
|
53269
|
-
var ConstraintPrioritySchema =
|
|
53270
|
-
var RiskLevelSchema =
|
|
53271
|
-
var TriggerPatternSchema =
|
|
53272
|
-
parameter:
|
|
53273
|
-
matchType:
|
|
53274
|
-
pattern:
|
|
53275
|
-
reason:
|
|
53403
|
+
import { z as z121 } from "zod";
|
|
53404
|
+
var HazardCategorySchema = z121.enum(HazardCategory);
|
|
53405
|
+
var HazardSeveritySchema = z121.enum(HazardSeverity);
|
|
53406
|
+
var ConstraintPrioritySchema = z121.enum(ConstraintPriority);
|
|
53407
|
+
var RiskLevelSchema = z121.enum(RiskLevel);
|
|
53408
|
+
var TriggerPatternSchema = z121.object({
|
|
53409
|
+
parameter: z121.string().min(1),
|
|
53410
|
+
matchType: z121.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
|
|
53411
|
+
pattern: z121.string(),
|
|
53412
|
+
reason: z121.string()
|
|
53276
53413
|
});
|
|
53277
|
-
var HazardSchema =
|
|
53278
|
-
id:
|
|
53279
|
-
description:
|
|
53414
|
+
var HazardSchema = z121.object({
|
|
53415
|
+
id: z121.string().min(1),
|
|
53416
|
+
description: z121.string(),
|
|
53280
53417
|
category: HazardCategorySchema,
|
|
53281
53418
|
severity: HazardSeveritySchema,
|
|
53282
|
-
likelihood:
|
|
53283
|
-
triggerConditions:
|
|
53284
|
-
consequences:
|
|
53419
|
+
likelihood: z121.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
|
|
53420
|
+
triggerConditions: z121.array(z121.string()),
|
|
53421
|
+
consequences: z121.array(z121.string())
|
|
53285
53422
|
});
|
|
53286
|
-
var UnsafeControlActionSchema =
|
|
53287
|
-
id:
|
|
53288
|
-
toolName:
|
|
53289
|
-
type:
|
|
53290
|
-
description:
|
|
53291
|
-
unsafeContext:
|
|
53292
|
-
relatedHazards:
|
|
53293
|
-
triggerPatterns:
|
|
53423
|
+
var UnsafeControlActionSchema = z121.object({
|
|
53424
|
+
id: z121.string().min(1),
|
|
53425
|
+
toolName: z121.string().min(1),
|
|
53426
|
+
type: z121.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
|
|
53427
|
+
description: z121.string(),
|
|
53428
|
+
unsafeContext: z121.string(),
|
|
53429
|
+
relatedHazards: z121.array(z121.string()),
|
|
53430
|
+
triggerPatterns: z121.array(TriggerPatternSchema).optional()
|
|
53294
53431
|
});
|
|
53295
|
-
var SafetyConstraintSchema =
|
|
53296
|
-
id:
|
|
53297
|
-
description:
|
|
53298
|
-
mitigates:
|
|
53299
|
-
enforcement:
|
|
53432
|
+
var SafetyConstraintSchema = z121.object({
|
|
53433
|
+
id: z121.string().min(1),
|
|
53434
|
+
description: z121.string(),
|
|
53435
|
+
mitigates: z121.array(z121.string()),
|
|
53436
|
+
enforcement: z121.enum([
|
|
53300
53437
|
"prevent",
|
|
53301
53438
|
"require_confirmation",
|
|
53302
53439
|
"alert",
|
|
@@ -53304,52 +53441,52 @@ var SafetyConstraintSchema = z120.object({
|
|
|
53304
53441
|
"rate_limit",
|
|
53305
53442
|
"require_privilege"
|
|
53306
53443
|
]),
|
|
53307
|
-
validationFunction:
|
|
53444
|
+
validationFunction: z121.string().optional(),
|
|
53308
53445
|
priority: ConstraintPrioritySchema
|
|
53309
53446
|
});
|
|
53310
|
-
var PropertySchemaSchema =
|
|
53311
|
-
type:
|
|
53312
|
-
description:
|
|
53313
|
-
enum:
|
|
53314
|
-
pattern:
|
|
53315
|
-
minimum:
|
|
53316
|
-
maximum:
|
|
53447
|
+
var PropertySchemaSchema = z121.object({
|
|
53448
|
+
type: z121.string(),
|
|
53449
|
+
description: z121.string().optional(),
|
|
53450
|
+
enum: z121.array(z121.unknown()).optional(),
|
|
53451
|
+
pattern: z121.string().optional(),
|
|
53452
|
+
minimum: z121.number().optional(),
|
|
53453
|
+
maximum: z121.number().optional()
|
|
53317
53454
|
});
|
|
53318
|
-
var ToolInputSchemaSchema =
|
|
53319
|
-
type:
|
|
53320
|
-
properties:
|
|
53321
|
-
required:
|
|
53322
|
-
additionalProperties:
|
|
53455
|
+
var ToolInputSchemaSchema = z121.object({
|
|
53456
|
+
type: z121.string(),
|
|
53457
|
+
properties: z121.record(z121.string(), PropertySchemaSchema).optional(),
|
|
53458
|
+
required: z121.array(z121.string()).optional(),
|
|
53459
|
+
additionalProperties: z121.boolean().optional()
|
|
53323
53460
|
});
|
|
53324
|
-
var ToolDefinitionSchema =
|
|
53325
|
-
name:
|
|
53326
|
-
description:
|
|
53461
|
+
var ToolDefinitionSchema = z121.object({
|
|
53462
|
+
name: z121.string().min(1),
|
|
53463
|
+
description: z121.string(),
|
|
53327
53464
|
inputSchema: ToolInputSchemaSchema
|
|
53328
53465
|
});
|
|
53329
|
-
var AnalysisConfigurationSchema =
|
|
53330
|
-
includeLowSeverity:
|
|
53331
|
-
generateAllConstraints:
|
|
53332
|
-
checkInteractions:
|
|
53333
|
-
maxHazardsPerTool:
|
|
53334
|
-
categories:
|
|
53466
|
+
var AnalysisConfigurationSchema = z121.object({
|
|
53467
|
+
includeLowSeverity: z121.boolean().default(true),
|
|
53468
|
+
generateAllConstraints: z121.boolean().default(true),
|
|
53469
|
+
checkInteractions: z121.boolean().default(true),
|
|
53470
|
+
maxHazardsPerTool: z121.number().int().min(1).max(100).default(50),
|
|
53471
|
+
categories: z121.array(HazardCategorySchema).default([])
|
|
53335
53472
|
});
|
|
53336
|
-
var ConstraintViolationSchema =
|
|
53337
|
-
constraintId:
|
|
53338
|
-
constraintDescription:
|
|
53473
|
+
var ConstraintViolationSchema = z121.object({
|
|
53474
|
+
constraintId: z121.string().min(1),
|
|
53475
|
+
constraintDescription: z121.string(),
|
|
53339
53476
|
severity: HazardSeveritySchema,
|
|
53340
|
-
details:
|
|
53341
|
-
remediation:
|
|
53477
|
+
details: z121.string(),
|
|
53478
|
+
remediation: z121.string()
|
|
53342
53479
|
});
|
|
53343
|
-
var ValidationWarningSchema =
|
|
53344
|
-
code:
|
|
53345
|
-
message:
|
|
53346
|
-
affected:
|
|
53480
|
+
var ValidationWarningSchema = z121.object({
|
|
53481
|
+
code: z121.string().min(1),
|
|
53482
|
+
message: z121.string(),
|
|
53483
|
+
affected: z121.string()
|
|
53347
53484
|
});
|
|
53348
|
-
var ValidationResultSchema =
|
|
53349
|
-
valid:
|
|
53350
|
-
toolName:
|
|
53351
|
-
violations:
|
|
53352
|
-
passed:
|
|
53485
|
+
var ValidationResultSchema = z121.object({
|
|
53486
|
+
valid: z121.boolean(),
|
|
53487
|
+
toolName: z121.string().min(1),
|
|
53488
|
+
violations: z121.array(ConstraintViolationSchema),
|
|
53489
|
+
passed: z121.array(z121.string()),
|
|
53353
53490
|
// Optional rather than required, deliberately. `ValidationResult` declares
|
|
53354
53491
|
// both fields required because every result this package produces has them;
|
|
53355
53492
|
// the schema is the lenient inbound edge for a result that arrived from
|
|
@@ -53360,10 +53497,10 @@ var ValidationResultSchema = z120.object({
|
|
|
53360
53497
|
// "nothing was evaluated". The strict/lenient split is safe because nothing
|
|
53361
53498
|
// bridges the two with `z.infer`: a parsed result will not typecheck as a
|
|
53362
53499
|
// `ValidationResult` without handling the absent fields.
|
|
53363
|
-
evaluated:
|
|
53364
|
-
notApplicable:
|
|
53365
|
-
warnings:
|
|
53366
|
-
validatedAt:
|
|
53500
|
+
evaluated: z121.array(z121.string()).optional(),
|
|
53501
|
+
notApplicable: z121.array(z121.string()).optional(),
|
|
53502
|
+
warnings: z121.array(ValidationWarningSchema),
|
|
53503
|
+
validatedAt: z121.date()
|
|
53367
53504
|
});
|
|
53368
53505
|
|
|
53369
53506
|
// src/mcp/safety/stpa-types.ts
|
|
@@ -54448,9 +54585,9 @@ var GeminiResponseParser = class {
|
|
|
54448
54585
|
};
|
|
54449
54586
|
|
|
54450
54587
|
// src/cli-adapters/router-types.ts
|
|
54451
|
-
import { z as
|
|
54452
|
-
var RouterConfigSchema =
|
|
54453
|
-
preferCostEfficient:
|
|
54588
|
+
import { z as z122 } from "zod";
|
|
54589
|
+
var RouterConfigSchema = z122.object({
|
|
54590
|
+
preferCostEfficient: z122.boolean().default(false),
|
|
54454
54591
|
/**
|
|
54455
54592
|
* @deprecated Declared but NEVER ENFORCED — nothing on the routing path
|
|
54456
54593
|
* compares anything to it, and `composite-router.ts` measures
|
|
@@ -54459,51 +54596,51 @@ var RouterConfigSchema = z121.object({
|
|
|
54459
54596
|
* because of this. Scheduled for removal in the next major (#5963); the
|
|
54460
54597
|
* default is 50 here and in every other declaration since #5918.
|
|
54461
54598
|
*/
|
|
54462
|
-
maxDecisionTimeMs:
|
|
54599
|
+
maxDecisionTimeMs: z122.number().min(1).max(1e3).default(50)
|
|
54463
54600
|
});
|
|
54464
54601
|
|
|
54465
54602
|
// src/cli-adapters/agreement-cascade-types.ts
|
|
54466
|
-
import { z as
|
|
54467
|
-
var AgreementCascadeConfigSchema =
|
|
54468
|
-
agreementThreshold:
|
|
54469
|
-
maxStages:
|
|
54470
|
-
modelTimeoutMs:
|
|
54603
|
+
import { z as z123 } from "zod";
|
|
54604
|
+
var AgreementCascadeConfigSchema = z123.object({
|
|
54605
|
+
agreementThreshold: z123.number().min(0.5).max(1).default(0.7),
|
|
54606
|
+
maxStages: z123.number().int().min(1).max(5).default(3),
|
|
54607
|
+
modelTimeoutMs: z123.number().int().min(1e3).max(3e5).default(6e4)
|
|
54471
54608
|
});
|
|
54472
54609
|
|
|
54473
54610
|
// src/cli-adapters/agreement-cascade-router.ts
|
|
54474
54611
|
var logger50 = createLogger({ component: "agreement-cascade-router" });
|
|
54475
54612
|
|
|
54476
54613
|
// src/cli-adapters/task-classifier.ts
|
|
54477
|
-
import { z as
|
|
54478
|
-
var ClassificationPatternsSchema =
|
|
54479
|
-
code:
|
|
54480
|
-
research:
|
|
54481
|
-
documentation:
|
|
54482
|
-
analysis:
|
|
54614
|
+
import { z as z124 } from "zod";
|
|
54615
|
+
var ClassificationPatternsSchema = z124.object({
|
|
54616
|
+
code: z124.array(z124.string()).readonly(),
|
|
54617
|
+
research: z124.array(z124.string()).readonly(),
|
|
54618
|
+
documentation: z124.array(z124.string()).readonly(),
|
|
54619
|
+
analysis: z124.array(z124.string()).readonly()
|
|
54483
54620
|
});
|
|
54484
54621
|
|
|
54485
54622
|
// src/cli-adapters/response-cache-types.ts
|
|
54486
|
-
import { z as
|
|
54487
|
-
var ResponseCacheConfigSchema =
|
|
54488
|
-
defaultTTL:
|
|
54623
|
+
import { z as z125 } from "zod";
|
|
54624
|
+
var ResponseCacheConfigSchema = z125.object({
|
|
54625
|
+
defaultTTL: z125.number().min(1e3).max(36e5).default(3e5),
|
|
54489
54626
|
// 5 minutes
|
|
54490
|
-
maxEntries:
|
|
54491
|
-
maxMemoryMB:
|
|
54492
|
-
cleanupInterval:
|
|
54627
|
+
maxEntries: z125.number().min(10).max(1e5).default(1e3),
|
|
54628
|
+
maxMemoryMB: z125.number().min(1).max(1e3).default(50),
|
|
54629
|
+
cleanupInterval: z125.number().min(1e3).max(6e5).default(6e4),
|
|
54493
54630
|
// 1 minute
|
|
54494
|
-
enableLogging:
|
|
54631
|
+
enableLogging: z125.boolean().default(false)
|
|
54495
54632
|
});
|
|
54496
54633
|
|
|
54497
54634
|
// src/cli-adapters/response-cache-utils.ts
|
|
54498
54635
|
var logger51 = createLogger({ component: "ResponseCacheUtils" });
|
|
54499
54636
|
|
|
54500
54637
|
// src/cli-adapters/unified-routing-types.ts
|
|
54501
|
-
import { z as
|
|
54502
|
-
var UnifiedRoutingDecisionSchema =
|
|
54503
|
-
selectedCli:
|
|
54504
|
-
confidence:
|
|
54505
|
-
reason:
|
|
54506
|
-
strategy:
|
|
54638
|
+
import { z as z126 } from "zod";
|
|
54639
|
+
var UnifiedRoutingDecisionSchema = z126.object({
|
|
54640
|
+
selectedCli: z126.string(),
|
|
54641
|
+
confidence: z126.number().min(0).max(1),
|
|
54642
|
+
reason: z126.string(),
|
|
54643
|
+
strategy: z126.enum([
|
|
54507
54644
|
"composite",
|
|
54508
54645
|
"quality",
|
|
54509
54646
|
"budget",
|
|
@@ -54515,60 +54652,60 @@ var UnifiedRoutingDecisionSchema = z125.object({
|
|
|
54515
54652
|
"linucb",
|
|
54516
54653
|
"direct"
|
|
54517
54654
|
]),
|
|
54518
|
-
decisionTimeMs:
|
|
54519
|
-
alternatives:
|
|
54520
|
-
stagesExecuted:
|
|
54521
|
-
withinBudget:
|
|
54522
|
-
estimatedComplexity:
|
|
54523
|
-
estimatedTokens:
|
|
54524
|
-
topsisScore:
|
|
54525
|
-
ucbScore:
|
|
54526
|
-
resolvedAtStage:
|
|
54527
|
-
consensusReached:
|
|
54528
|
-
agreementScore:
|
|
54529
|
-
metadata:
|
|
54655
|
+
decisionTimeMs: z126.number().nonnegative(),
|
|
54656
|
+
alternatives: z126.array(z126.string()).readonly(),
|
|
54657
|
+
stagesExecuted: z126.array(z126.string()).readonly(),
|
|
54658
|
+
withinBudget: z126.boolean().optional(),
|
|
54659
|
+
estimatedComplexity: z126.enum(["simple", "moderate", "complex", "expert"]).optional(),
|
|
54660
|
+
estimatedTokens: z126.number().int().positive().optional(),
|
|
54661
|
+
topsisScore: z126.number().optional(),
|
|
54662
|
+
ucbScore: z126.number().optional(),
|
|
54663
|
+
resolvedAtStage: z126.number().int().nonnegative().optional(),
|
|
54664
|
+
consensusReached: z126.boolean().optional(),
|
|
54665
|
+
agreementScore: z126.number().min(0).max(1).optional(),
|
|
54666
|
+
metadata: z126.record(z126.string(), z126.unknown()).optional()
|
|
54530
54667
|
});
|
|
54531
54668
|
|
|
54532
54669
|
// src/learning/outcome-feedback-types.ts
|
|
54533
|
-
import { z as
|
|
54534
|
-
var QualitySignalsSchema =
|
|
54535
|
-
testsPass:
|
|
54536
|
-
lintErrors:
|
|
54537
|
-
userApproved:
|
|
54538
|
-
retryCount:
|
|
54539
|
-
completionRatio:
|
|
54540
|
-
validStructure:
|
|
54541
|
-
coherenceScore:
|
|
54670
|
+
import { z as z127 } from "zod";
|
|
54671
|
+
var QualitySignalsSchema = z127.object({
|
|
54672
|
+
testsPass: z127.boolean().optional(),
|
|
54673
|
+
lintErrors: z127.number().int().min(0).optional(),
|
|
54674
|
+
userApproved: z127.boolean().optional(),
|
|
54675
|
+
retryCount: z127.number().int().min(0).default(0),
|
|
54676
|
+
completionRatio: z127.number().min(0).max(1).default(1),
|
|
54677
|
+
validStructure: z127.boolean().optional(),
|
|
54678
|
+
coherenceScore: z127.number().min(0).max(1).optional()
|
|
54542
54679
|
});
|
|
54543
|
-
var RoutingDecisionSchema =
|
|
54544
|
-
id:
|
|
54545
|
-
timestamp:
|
|
54546
|
-
query:
|
|
54547
|
-
routerType:
|
|
54680
|
+
var RoutingDecisionSchema = z127.object({
|
|
54681
|
+
id: z127.uuid(),
|
|
54682
|
+
timestamp: z127.iso.datetime(),
|
|
54683
|
+
query: z127.string(),
|
|
54684
|
+
routerType: z127.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
|
|
54548
54685
|
// Optional so a row persisted before #5812 still parses. Absence is read as
|
|
54549
54686
|
// unmeasured by `isRouterTypeMeasured`, never as measured.
|
|
54550
|
-
routerTypeMeasured:
|
|
54551
|
-
selectedModel:
|
|
54552
|
-
selectedTier:
|
|
54553
|
-
armIndex:
|
|
54554
|
-
banditContext:
|
|
54555
|
-
queryFeatures:
|
|
54556
|
-
ucbScore:
|
|
54557
|
-
confidence:
|
|
54558
|
-
traceId:
|
|
54559
|
-
domain:
|
|
54687
|
+
routerTypeMeasured: z127.boolean().optional(),
|
|
54688
|
+
selectedModel: z127.string(),
|
|
54689
|
+
selectedTier: z127.enum(["strong", "weak"]).optional(),
|
|
54690
|
+
armIndex: z127.number().int().min(0).optional(),
|
|
54691
|
+
banditContext: z127.record(z127.string(), z127.unknown()).optional(),
|
|
54692
|
+
queryFeatures: z127.record(z127.string(), z127.unknown()).optional(),
|
|
54693
|
+
ucbScore: z127.number().optional(),
|
|
54694
|
+
confidence: z127.number().min(0).max(1).optional(),
|
|
54695
|
+
traceId: z127.string(),
|
|
54696
|
+
domain: z127.string().optional()
|
|
54560
54697
|
});
|
|
54561
|
-
var TaskOutcomeSchema =
|
|
54562
|
-
routingDecisionId:
|
|
54563
|
-
timestamp:
|
|
54564
|
-
outcomeClass:
|
|
54565
|
-
success:
|
|
54566
|
-
qualityScore:
|
|
54567
|
-
durationMs:
|
|
54568
|
-
tokenUsage:
|
|
54569
|
-
errorMessage:
|
|
54698
|
+
var TaskOutcomeSchema = z127.object({
|
|
54699
|
+
routingDecisionId: z127.uuid(),
|
|
54700
|
+
timestamp: z127.iso.datetime(),
|
|
54701
|
+
outcomeClass: z127.enum(["success", "partial", "failure", "timeout", "error"]),
|
|
54702
|
+
success: z127.boolean(),
|
|
54703
|
+
qualityScore: z127.number().min(0).max(1),
|
|
54704
|
+
durationMs: z127.number().min(0),
|
|
54705
|
+
tokenUsage: z127.number().int().min(0),
|
|
54706
|
+
errorMessage: z127.string().optional(),
|
|
54570
54707
|
qualitySignals: QualitySignalsSchema,
|
|
54571
|
-
traceId:
|
|
54708
|
+
traceId: z127.string()
|
|
54572
54709
|
});
|
|
54573
54710
|
var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
54574
54711
|
maxPendingDecisions: 1e3,
|
|
@@ -54583,17 +54720,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
|
54583
54720
|
targetTokenUsage: 2e3,
|
|
54584
54721
|
maxHistorySize: 1e4
|
|
54585
54722
|
};
|
|
54586
|
-
var FeedbackCollectorConfigSchema =
|
|
54587
|
-
maxPendingDecisions:
|
|
54588
|
-
pendingTimeoutMs:
|
|
54589
|
-
enableAutoReward:
|
|
54590
|
-
qualityWeight:
|
|
54591
|
-
speedWeight:
|
|
54592
|
-
efficiencyWeight:
|
|
54593
|
-
retryPenalty:
|
|
54594
|
-
targetDurationMs:
|
|
54595
|
-
targetTokenUsage:
|
|
54596
|
-
maxHistorySize:
|
|
54723
|
+
var FeedbackCollectorConfigSchema = z127.object({
|
|
54724
|
+
maxPendingDecisions: z127.number().int().positive().default(1e3),
|
|
54725
|
+
pendingTimeoutMs: z127.number().positive().default(3e5),
|
|
54726
|
+
enableAutoReward: z127.boolean().default(true),
|
|
54727
|
+
qualityWeight: z127.number().min(0).max(1).default(0.5),
|
|
54728
|
+
speedWeight: z127.number().min(0).max(1).default(0.2),
|
|
54729
|
+
efficiencyWeight: z127.number().min(0).max(1).default(0.2),
|
|
54730
|
+
retryPenalty: z127.number().min(0).max(1).default(0.1),
|
|
54731
|
+
targetDurationMs: z127.number().positive().default(5e3),
|
|
54732
|
+
targetTokenUsage: z127.number().positive().default(2e3),
|
|
54733
|
+
maxHistorySize: z127.number().int().positive().default(1e4)
|
|
54597
54734
|
});
|
|
54598
54735
|
|
|
54599
54736
|
// src/learning/outcome-feedback-helpers.ts
|
|
@@ -56713,4 +56850,4 @@ export {
|
|
|
56713
56850
|
startPipelineEventBridge,
|
|
56714
56851
|
shutdownPipelineEventBridge
|
|
56715
56852
|
};
|
|
56716
|
-
//# sourceMappingURL=chunk-
|
|
56853
|
+
//# sourceMappingURL=chunk-TZKXFJSF.js.map
|