nexus-agents 2.129.1 → 2.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{child-mcp-config-TQIZEHVP.js → child-mcp-config-F7R7BFEF.js} +2 -2
- package/dist/{chunk-U7HHO4UI.js → chunk-2ECAJTUP.js} +2 -2
- package/dist/{chunk-JQHZS7GU.js → chunk-4SDY75WA.js} +4 -4
- package/dist/{chunk-6RXWD3HT.js → chunk-6BF3BRJ3.js} +2 -2
- package/dist/{chunk-RAAMLWMY.js → chunk-AZFHCHYX.js} +7 -7
- package/dist/{chunk-BKZ5YD66.js → chunk-BPGSM6U5.js} +2 -2
- package/dist/{chunk-4FFWDTUE.js → chunk-CFXL5LJC.js} +2 -2
- package/dist/{chunk-EORN73QB.js → chunk-CXGIRMHT.js} +7 -7
- package/dist/{chunk-V2E74WBI.js → chunk-F6Y2CE24.js} +2 -2
- package/dist/{chunk-JAKYPFLI.js → chunk-FYECPZKQ.js} +3 -3
- package/dist/{chunk-NKAPCKHN.js → chunk-GIKZBQY7.js} +4 -4
- package/dist/{chunk-GO7JE2MA.js → chunk-GMC6DYG7.js} +2 -2
- package/dist/{chunk-YVJFUOHY.js → chunk-JDHCHN7U.js} +3 -3
- package/dist/{chunk-GZFECWWZ.js → chunk-KBX2Q3DG.js} +2 -2
- package/dist/{chunk-24HQWWJ7.js → chunk-KOICNQMN.js} +361 -395
- package/dist/{chunk-24HQWWJ7.js.map → chunk-KOICNQMN.js.map} +1 -1
- package/dist/{chunk-QJ52FRQX.js → chunk-L4ETHMN6.js} +2 -2
- package/dist/{chunk-U3FNIYWH.js → chunk-LICM3H4J.js} +2 -2
- package/dist/{chunk-VBAGMX5I.js → chunk-MII2DHXL.js} +119 -10
- package/dist/chunk-MII2DHXL.js.map +1 -0
- package/dist/{chunk-GZTPQMD5.js → chunk-MJTTQCJS.js} +3 -3
- package/dist/{chunk-KYLVH42N.js → chunk-P5TYSLNS.js} +2 -2
- package/dist/{chunk-XMQ3EC2B.js → chunk-PLVZ64OM.js} +2 -2
- package/dist/{chunk-47M2C4SO.js → chunk-PP724WVD.js} +5 -5
- package/dist/{chunk-TP3VZUQL.js → chunk-QENZCLR2.js} +3 -3
- package/dist/{chunk-VLL4L5TK.js → chunk-R3ZNBC2O.js} +2 -2
- package/dist/{chunk-ZJPKYTH5.js → chunk-RBPGEUHT.js} +3 -3
- package/dist/{chunk-5QJTUA7Y.js → chunk-RDJMBYZ2.js} +3 -3
- package/dist/{chunk-FJREQSFG.js → chunk-SUJFJVAM.js} +2 -2
- package/dist/{chunk-IASJVOVO.js → chunk-SWKSR5R7.js} +2 -2
- package/dist/{chunk-4IBBMLNR.js → chunk-TT7DZ6XW.js} +4 -4
- package/dist/{chunk-HMOPW3XC.js → chunk-TULQAVRC.js} +7 -7
- package/dist/{chunk-RFXBV3A2.js → chunk-UXTCUMJM.js} +4 -4
- package/dist/{chunk-4EAXZOIG.js → chunk-V5EI2KEG.js} +5 -5
- package/dist/{chunk-IIMTGMOE.js → chunk-W4PM3PLE.js} +7 -7
- package/dist/{cli-circuit-breaker-3CWRA7DZ.js → cli-circuit-breaker-VXHOHBE6.js} +4 -4
- package/dist/cli.js +39 -39
- package/dist/{composite-router-MN6W5CEQ.js → composite-router-NJZMYTXG.js} +2 -2
- package/dist/{consensus-vote-3EMLBZ25.js → consensus-vote-SH5CKJQR.js} +13 -13
- package/dist/{context-retriever-OLWFVOJG.js → context-retriever-LVW25GWO.js} +8 -8
- package/dist/{doctor-deep-W3QB24SM.js → doctor-deep-HCT3LW5G.js} +3 -3
- package/dist/{expert-bridge-LAB2W5ET.js → expert-bridge-FBYWLGB3.js} +4 -4
- package/dist/factory-5IYTNTA2.js +21 -0
- package/dist/{factory-7ZKKQDCI.js → factory-GP5SJCTQ.js} +5 -5
- package/dist/{improvement-review-ATYDIHSF.js → improvement-review-OUGGPW4A.js} +4 -4
- package/dist/index.d.ts +3030 -2943
- package/dist/index.js +28 -28
- package/dist/{init-opencode-4O2R5S72.js → init-opencode-6PZVSSZY.js} +5 -5
- package/dist/{issue-triage-G2AKATE4.js → issue-triage-TPPWEE5N.js} +5 -5
- package/dist/{pr-reviewer-helpers-Y6LEGX2P.js → pr-reviewer-helpers-MMVZFL2P.js} +4 -4
- package/dist/{registry-command-X6A27TNG.js → registry-command-IDC5G3EZ.js} +2 -2
- package/dist/{repo-security-plan-356NFHOZ.js → repo-security-plan-XL3LTBPN.js} +3 -3
- package/dist/{research-helpers-synthesize-7XWIAM5D.js → research-helpers-synthesize-6ROTFLGO.js} +4 -4
- package/dist/{routing-memory-YTLUUXXX.js → routing-memory-YAW2AIRX.js} +2 -2
- package/dist/{session-memory-IHQCJWBK.js → session-memory-VR3BJMWL.js} +3 -3
- package/dist/{setup-command-GVOUKFJT.js → setup-command-SMJX3TES.js} +11 -11
- package/dist/{setup-config-UA4M5OQ4.js → setup-config-IXZAAYYH.js} +3 -3
- package/dist/{setup-custom-api-UXFN75SS.js → setup-custom-api-6ZBOVWEU.js} +3 -3
- package/dist/{tool-memory-SJ57ZJ5F.js → tool-memory-ZKMPHKG5.js} +5 -5
- package/dist/{unified-registry-WMJQUA43.js → unified-registry-WP4XC656.js} +9 -9
- package/dist/{weather-report-WSATZR44.js → weather-report-CETWTNE5.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-VBAGMX5I.js.map +0 -1
- package/dist/factory-JNLNQ67U.js +0 -21
- /package/dist/{child-mcp-config-TQIZEHVP.js.map → child-mcp-config-F7R7BFEF.js.map} +0 -0
- /package/dist/{chunk-U7HHO4UI.js.map → chunk-2ECAJTUP.js.map} +0 -0
- /package/dist/{chunk-JQHZS7GU.js.map → chunk-4SDY75WA.js.map} +0 -0
- /package/dist/{chunk-6RXWD3HT.js.map → chunk-6BF3BRJ3.js.map} +0 -0
- /package/dist/{chunk-RAAMLWMY.js.map → chunk-AZFHCHYX.js.map} +0 -0
- /package/dist/{chunk-BKZ5YD66.js.map → chunk-BPGSM6U5.js.map} +0 -0
- /package/dist/{chunk-4FFWDTUE.js.map → chunk-CFXL5LJC.js.map} +0 -0
- /package/dist/{chunk-EORN73QB.js.map → chunk-CXGIRMHT.js.map} +0 -0
- /package/dist/{chunk-V2E74WBI.js.map → chunk-F6Y2CE24.js.map} +0 -0
- /package/dist/{chunk-JAKYPFLI.js.map → chunk-FYECPZKQ.js.map} +0 -0
- /package/dist/{chunk-NKAPCKHN.js.map → chunk-GIKZBQY7.js.map} +0 -0
- /package/dist/{chunk-GO7JE2MA.js.map → chunk-GMC6DYG7.js.map} +0 -0
- /package/dist/{chunk-YVJFUOHY.js.map → chunk-JDHCHN7U.js.map} +0 -0
- /package/dist/{chunk-GZFECWWZ.js.map → chunk-KBX2Q3DG.js.map} +0 -0
- /package/dist/{chunk-QJ52FRQX.js.map → chunk-L4ETHMN6.js.map} +0 -0
- /package/dist/{chunk-U3FNIYWH.js.map → chunk-LICM3H4J.js.map} +0 -0
- /package/dist/{chunk-GZTPQMD5.js.map → chunk-MJTTQCJS.js.map} +0 -0
- /package/dist/{chunk-KYLVH42N.js.map → chunk-P5TYSLNS.js.map} +0 -0
- /package/dist/{chunk-XMQ3EC2B.js.map → chunk-PLVZ64OM.js.map} +0 -0
- /package/dist/{chunk-47M2C4SO.js.map → chunk-PP724WVD.js.map} +0 -0
- /package/dist/{chunk-TP3VZUQL.js.map → chunk-QENZCLR2.js.map} +0 -0
- /package/dist/{chunk-VLL4L5TK.js.map → chunk-R3ZNBC2O.js.map} +0 -0
- /package/dist/{chunk-ZJPKYTH5.js.map → chunk-RBPGEUHT.js.map} +0 -0
- /package/dist/{chunk-5QJTUA7Y.js.map → chunk-RDJMBYZ2.js.map} +0 -0
- /package/dist/{chunk-FJREQSFG.js.map → chunk-SUJFJVAM.js.map} +0 -0
- /package/dist/{chunk-IASJVOVO.js.map → chunk-SWKSR5R7.js.map} +0 -0
- /package/dist/{chunk-4IBBMLNR.js.map → chunk-TT7DZ6XW.js.map} +0 -0
- /package/dist/{chunk-HMOPW3XC.js.map → chunk-TULQAVRC.js.map} +0 -0
- /package/dist/{chunk-RFXBV3A2.js.map → chunk-UXTCUMJM.js.map} +0 -0
- /package/dist/{chunk-4EAXZOIG.js.map → chunk-V5EI2KEG.js.map} +0 -0
- /package/dist/{chunk-IIMTGMOE.js.map → chunk-W4PM3PLE.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-3CWRA7DZ.js.map → cli-circuit-breaker-VXHOHBE6.js.map} +0 -0
- /package/dist/{composite-router-MN6W5CEQ.js.map → composite-router-NJZMYTXG.js.map} +0 -0
- /package/dist/{consensus-vote-3EMLBZ25.js.map → consensus-vote-SH5CKJQR.js.map} +0 -0
- /package/dist/{context-retriever-OLWFVOJG.js.map → context-retriever-LVW25GWO.js.map} +0 -0
- /package/dist/{doctor-deep-W3QB24SM.js.map → doctor-deep-HCT3LW5G.js.map} +0 -0
- /package/dist/{expert-bridge-LAB2W5ET.js.map → expert-bridge-FBYWLGB3.js.map} +0 -0
- /package/dist/{factory-7ZKKQDCI.js.map → factory-5IYTNTA2.js.map} +0 -0
- /package/dist/{factory-JNLNQ67U.js.map → factory-GP5SJCTQ.js.map} +0 -0
- /package/dist/{improvement-review-ATYDIHSF.js.map → improvement-review-OUGGPW4A.js.map} +0 -0
- /package/dist/{init-opencode-4O2R5S72.js.map → init-opencode-6PZVSSZY.js.map} +0 -0
- /package/dist/{issue-triage-G2AKATE4.js.map → issue-triage-TPPWEE5N.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-Y6LEGX2P.js.map → pr-reviewer-helpers-MMVZFL2P.js.map} +0 -0
- /package/dist/{registry-command-X6A27TNG.js.map → registry-command-IDC5G3EZ.js.map} +0 -0
- /package/dist/{repo-security-plan-356NFHOZ.js.map → repo-security-plan-XL3LTBPN.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-7XWIAM5D.js.map → research-helpers-synthesize-6ROTFLGO.js.map} +0 -0
- /package/dist/{routing-memory-YTLUUXXX.js.map → routing-memory-YAW2AIRX.js.map} +0 -0
- /package/dist/{session-memory-IHQCJWBK.js.map → session-memory-VR3BJMWL.js.map} +0 -0
- /package/dist/{setup-command-GVOUKFJT.js.map → setup-command-SMJX3TES.js.map} +0 -0
- /package/dist/{setup-config-UA4M5OQ4.js.map → setup-config-IXZAAYYH.js.map} +0 -0
- /package/dist/{setup-custom-api-UXFN75SS.js.map → setup-custom-api-6ZBOVWEU.js.map} +0 -0
- /package/dist/{tool-memory-SJ57ZJ5F.js.map → tool-memory-ZKMPHKG5.js.map} +0 -0
- /package/dist/{unified-registry-WMJQUA43.js.map → unified-registry-WP4XC656.js.map} +0 -0
- /package/dist/{weather-report-WSATZR44.js.map → weather-report-CETWTNE5.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GMC6DYG7.js";
|
|
4
4
|
import {
|
|
5
5
|
CodebaseIndex,
|
|
6
6
|
extractSymbolIndex,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-WAYGXUSM.js";
|
|
14
14
|
import {
|
|
15
15
|
executeExpert
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AZFHCHYX.js";
|
|
17
17
|
import {
|
|
18
18
|
JobStatusSchema,
|
|
19
19
|
collectRealVotes,
|
|
@@ -31,24 +31,24 @@ import {
|
|
|
31
31
|
toJobSummary,
|
|
32
32
|
warnIfSimulatedOutsideTests,
|
|
33
33
|
writeJobCancelled
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-TULQAVRC.js";
|
|
35
35
|
import {
|
|
36
36
|
normalizeTopicToCanonical,
|
|
37
37
|
synthesizeResearch
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-RBPGEUHT.js";
|
|
39
39
|
import {
|
|
40
40
|
IssueTriage,
|
|
41
41
|
createAuditTrail,
|
|
42
42
|
createGraphAuditBridge,
|
|
43
43
|
emitPipelinePolicyEvent
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UXTCUMJM.js";
|
|
45
45
|
import {
|
|
46
46
|
resolveEnvMode,
|
|
47
47
|
sanitizeInput
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-CFXL5LJC.js";
|
|
49
49
|
import {
|
|
50
50
|
withPrerequisite
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-FYECPZKQ.js";
|
|
52
52
|
import {
|
|
53
53
|
NOOP_NOTIFIER,
|
|
54
54
|
RateLimiter,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
withAccessPolicy,
|
|
71
71
|
withProgressHeartbeat,
|
|
72
72
|
wrapToolWithTimeout
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-BPGSM6U5.js";
|
|
74
74
|
import {
|
|
75
75
|
analyzeGitHubRepo
|
|
76
76
|
} from "./chunk-HFOQKCD2.js";
|
|
@@ -101,29 +101,29 @@ import {
|
|
|
101
101
|
parseRegistry,
|
|
102
102
|
sourceExistsInRegistry,
|
|
103
103
|
summarizeContextForPrompt
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-PP724WVD.js";
|
|
105
105
|
import {
|
|
106
106
|
getTokenEnvVars,
|
|
107
107
|
resolveToken
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-PLVZ64OM.js";
|
|
109
109
|
import {
|
|
110
110
|
loadPapersRegistry,
|
|
111
111
|
loadTechniquesRegistry
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-LICM3H4J.js";
|
|
113
113
|
import {
|
|
114
114
|
DEFAULT_RELEVANCE_CONFIG,
|
|
115
115
|
MemoryImportance,
|
|
116
116
|
calculateTextJaccardSimilarity,
|
|
117
117
|
getToolMemory
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-4SDY75WA.js";
|
|
119
119
|
import {
|
|
120
120
|
createSessionMemory
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-L4ETHMN6.js";
|
|
122
122
|
import {
|
|
123
123
|
DEFAULT_TASK_TTL_MS,
|
|
124
124
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
125
125
|
clampTaskTtl
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-W4PM3PLE.js";
|
|
127
127
|
import {
|
|
128
128
|
resolveInsideRoot
|
|
129
129
|
} from "./chunk-NUBSJGQZ.js";
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
createEvent,
|
|
146
146
|
getGlobalEventBus,
|
|
147
147
|
getGlobalRegistry
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-GIKZBQY7.js";
|
|
149
149
|
import {
|
|
150
150
|
CliDetectionCache,
|
|
151
151
|
asRecord,
|
|
@@ -153,19 +153,19 @@ import {
|
|
|
153
153
|
getAvailableClis,
|
|
154
154
|
sleep,
|
|
155
155
|
withTimeout
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-CXGIRMHT.js";
|
|
157
157
|
import {
|
|
158
158
|
DEFAULTS
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-KBX2Q3DG.js";
|
|
160
160
|
import {
|
|
161
161
|
getAvailabilityCache,
|
|
162
162
|
getCliForModelId,
|
|
163
163
|
resolveFallback
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-SUJFJVAM.js";
|
|
165
165
|
import {
|
|
166
166
|
generateHyphenId,
|
|
167
167
|
generateUUID
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-P5TYSLNS.js";
|
|
169
169
|
import {
|
|
170
170
|
AGENT_ROUTER_TIMEOUTS,
|
|
171
171
|
API_TIMEOUTS,
|
|
@@ -204,6 +204,7 @@ import {
|
|
|
204
204
|
WorkflowError,
|
|
205
205
|
buildCapabilityProfiles,
|
|
206
206
|
buildDefaultModelSources,
|
|
207
|
+
buildResearchContext,
|
|
207
208
|
categorizeOutcomeError,
|
|
208
209
|
categorizeOutcomeErrorMessage,
|
|
209
210
|
clamp,
|
|
@@ -212,6 +213,7 @@ import {
|
|
|
212
213
|
createLogger,
|
|
213
214
|
createSharedTaskAnalyzer,
|
|
214
215
|
deriveEntry,
|
|
216
|
+
deriveResearchMaturity,
|
|
215
217
|
detectCapabilityGaps,
|
|
216
218
|
detectTaskCategory,
|
|
217
219
|
detectTrend,
|
|
@@ -245,12 +247,13 @@ import {
|
|
|
245
247
|
modelSupportsAll,
|
|
246
248
|
ok,
|
|
247
249
|
recordRoutingGaps,
|
|
250
|
+
researchContextFromText,
|
|
248
251
|
resolveModelIdentity,
|
|
249
252
|
resolveModelIdentitySync,
|
|
250
253
|
routingArmDisplaySlot,
|
|
251
254
|
toExpertTaskAnalysisResult,
|
|
252
255
|
withStep
|
|
253
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-MII2DHXL.js";
|
|
254
257
|
import {
|
|
255
258
|
ensureLearningDir,
|
|
256
259
|
getMetaOutcomesFile,
|
|
@@ -23615,10 +23618,10 @@ function calculateZStatistic(params) {
|
|
|
23615
23618
|
function calculateDifferenceCI(p1, p2, total1, total2, confidence) {
|
|
23616
23619
|
const difference = p1 - p2;
|
|
23617
23620
|
const seDiff = Math.sqrt(p1 * (1 - p1) / (total1 || 1) + p2 * (1 - p2) / (total2 || 1));
|
|
23618
|
-
const
|
|
23621
|
+
const z114 = getZScore(confidence);
|
|
23619
23622
|
return {
|
|
23620
|
-
lower: difference -
|
|
23621
|
-
upper: difference +
|
|
23623
|
+
lower: difference - z114 * seDiff,
|
|
23624
|
+
upper: difference + z114 * seDiff,
|
|
23622
23625
|
estimate: difference,
|
|
23623
23626
|
confidence,
|
|
23624
23627
|
n: total1 + total2,
|
|
@@ -23641,11 +23644,11 @@ function proportionConfidenceInterval(successes, total, options = {}) {
|
|
|
23641
23644
|
standardError: 0
|
|
23642
23645
|
};
|
|
23643
23646
|
}
|
|
23644
|
-
const
|
|
23645
|
-
const z210 =
|
|
23647
|
+
const z114 = getZScore(opts.confidence);
|
|
23648
|
+
const z210 = z114 * z114;
|
|
23646
23649
|
const denominator = 1 + z210 / n;
|
|
23647
23650
|
const center = (p + z210 / (2 * n)) / denominator;
|
|
23648
|
-
const margin =
|
|
23651
|
+
const margin = z114 / denominator * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
23649
23652
|
const lower = Math.max(0, center - margin);
|
|
23650
23653
|
const upper = Math.min(1, center + margin);
|
|
23651
23654
|
const standardError = Math.sqrt(p * (1 - p) / n);
|
|
@@ -23675,8 +23678,8 @@ function meanConfidenceInterval(values, options = {}) {
|
|
|
23675
23678
|
const variance = values.reduce((sum, v) => sum + (v - mean) ** 2, 0) / (n - 1 || 1);
|
|
23676
23679
|
const stdDev = Math.sqrt(variance);
|
|
23677
23680
|
const standardError = stdDev / Math.sqrt(n);
|
|
23678
|
-
const
|
|
23679
|
-
const margin =
|
|
23681
|
+
const z114 = getZScore(opts.confidence);
|
|
23682
|
+
const margin = z114 * standardError;
|
|
23680
23683
|
return {
|
|
23681
23684
|
lower: mean - margin,
|
|
23682
23685
|
upper: mean + margin,
|
|
@@ -26278,7 +26281,7 @@ function execIdFields(executionId) {
|
|
|
26278
26281
|
async function populateUnifiedContextOnState(state, options) {
|
|
26279
26282
|
const taskCandidate = state["task"];
|
|
26280
26283
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
26281
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
26284
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-LVW25GWO.js");
|
|
26282
26285
|
const category = inferTaskCategory2(taskCandidate);
|
|
26283
26286
|
const executionId = options?.executionId;
|
|
26284
26287
|
const execFields = execIdFields(executionId);
|
|
@@ -41177,7 +41180,7 @@ async function tryIssueTriage(task) {
|
|
|
41177
41180
|
try {
|
|
41178
41181
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
41179
41182
|
if (issueMatch === null) return null;
|
|
41180
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
41183
|
+
const { createIssueTriage } = await import("./issue-triage-TPPWEE5N.js");
|
|
41181
41184
|
const triage = createIssueTriage();
|
|
41182
41185
|
const owner = issueMatch[1] ?? "";
|
|
41183
41186
|
const num = issueMatch[2] ?? "";
|
|
@@ -41205,7 +41208,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
41205
41208
|
]);
|
|
41206
41209
|
async function classifyWithLLM(task) {
|
|
41207
41210
|
try {
|
|
41208
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
41211
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-FBYWLGB3.js");
|
|
41209
41212
|
const prompt = [
|
|
41210
41213
|
"Classify this task into exactly one pipeline template.",
|
|
41211
41214
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -41669,7 +41672,7 @@ async function runDevPipeline(task, stages, options) {
|
|
|
41669
41672
|
}
|
|
41670
41673
|
async function runDevPipelineInner(task, stages, options, sid, prior) {
|
|
41671
41674
|
const { beliefMemory: bm, auditLogger, trustTier } = options ?? {};
|
|
41672
|
-
const { planResult } = await runPlanningPhase(task, stages, prior, options);
|
|
41675
|
+
const { planResult, researchMaturity } = await runPlanningPhase(task, stages, prior, options);
|
|
41673
41676
|
if (options?.dryRun === true) {
|
|
41674
41677
|
logger39.info("Dry run \u2014 stopping after plan+vote");
|
|
41675
41678
|
return buildDryRunResult(planResult);
|
|
@@ -41678,7 +41681,8 @@ async function runDevPipelineInner(task, stages, options, sid, prior) {
|
|
|
41678
41681
|
const tasks = await runOrResumeDecompose(prior, planResult.plan, stages, {
|
|
41679
41682
|
conditional: planResult.conditional,
|
|
41680
41683
|
conditions: planResult.conditions,
|
|
41681
|
-
caveats: planResult.caveats
|
|
41684
|
+
caveats: planResult.caveats,
|
|
41685
|
+
researchMaturity
|
|
41682
41686
|
});
|
|
41683
41687
|
if (sid !== void 0) saveStageCheckpoint(sid, "decompose", { type: "decompose", tasks });
|
|
41684
41688
|
if (options?.mode === "harness") {
|
|
@@ -41874,31 +41878,33 @@ function buildDryRunResult(planResult) {
|
|
|
41874
41878
|
};
|
|
41875
41879
|
}
|
|
41876
41880
|
async function resolveResearch(prior, task, stages, options) {
|
|
41877
|
-
|
|
41878
|
-
|
|
41879
|
-
|
|
41880
|
-
|
|
41881
|
-
|
|
41882
|
-
|
|
41883
|
-
|
|
41884
|
-
|
|
41885
|
-
|
|
41886
|
-
|
|
41887
|
-
|
|
41888
|
-
|
|
41889
|
-
|
|
41890
|
-
|
|
41891
|
-
|
|
41892
|
-
|
|
41893
|
-
)
|
|
41881
|
+
if (prior?.research !== void 0) {
|
|
41882
|
+
logger39.info("Resuming from checkpoint", { stage: "research" });
|
|
41883
|
+
return researchContextFromText(prior.research);
|
|
41884
|
+
}
|
|
41885
|
+
const override = options?.researchOverride;
|
|
41886
|
+
if (override !== void 0) {
|
|
41887
|
+
return researchContextFromText(override);
|
|
41888
|
+
}
|
|
41889
|
+
options?.untrustedInputGuard?.();
|
|
41890
|
+
return withStep(
|
|
41891
|
+
{ name: "research", kind: "pipeline.stage", attrs: { task: task.slice(0, 100) } },
|
|
41892
|
+
async (ctx) => {
|
|
41893
|
+
const rc = await stages.research(task);
|
|
41894
|
+
ctx.setSummary(`${String(rc.text.length)} chars`);
|
|
41895
|
+
return rc;
|
|
41896
|
+
}
|
|
41894
41897
|
);
|
|
41895
41898
|
}
|
|
41896
41899
|
async function runPlanningPhase(task, stages, prior, options) {
|
|
41897
41900
|
const sid = options?.sessionId;
|
|
41898
41901
|
const bm = options?.beliefMemory;
|
|
41899
41902
|
const research = await resolveResearch(prior, task, stages, options);
|
|
41900
|
-
|
|
41901
|
-
|
|
41903
|
+
const researchMaturity = deriveResearchMaturity(research.metadata);
|
|
41904
|
+
if (sid !== void 0) {
|
|
41905
|
+
saveStageCheckpoint(sid, "research", { type: "research", text: research.text });
|
|
41906
|
+
}
|
|
41907
|
+
const planContext = await assemblePlanContext(research.text, task, sid, bm);
|
|
41902
41908
|
const planResult = await runPlanOrResume(prior, task, planContext, stages, sid);
|
|
41903
41909
|
if (sid !== void 0) {
|
|
41904
41910
|
saveStageCheckpoint(sid, "plan", {
|
|
@@ -41915,7 +41921,7 @@ async function runPlanningPhase(task, stages, prior, options) {
|
|
|
41915
41921
|
iterations: planResult.iterations
|
|
41916
41922
|
});
|
|
41917
41923
|
}
|
|
41918
|
-
return { planResult };
|
|
41924
|
+
return { planResult, researchMaturity };
|
|
41919
41925
|
}
|
|
41920
41926
|
function buildHarnessResult(planResult, tasks) {
|
|
41921
41927
|
return {
|
|
@@ -41983,13 +41989,6 @@ async function runQualityGateStage(stages, mode) {
|
|
|
41983
41989
|
}
|
|
41984
41990
|
);
|
|
41985
41991
|
}
|
|
41986
|
-
async function runOrResume(prior, stage, run) {
|
|
41987
|
-
if (prior?.research !== void 0 && stage === "research") {
|
|
41988
|
-
logger39.info("Resuming from checkpoint", { stage });
|
|
41989
|
-
return prior.research;
|
|
41990
|
-
}
|
|
41991
|
-
return run();
|
|
41992
|
-
}
|
|
41993
41992
|
async function runPlanOrResume(prior, task, research, stages, sessionId) {
|
|
41994
41993
|
if (prior?.plan !== void 0) {
|
|
41995
41994
|
logger39.info("Resuming from checkpoint", { stage: "plan", sessionId });
|
|
@@ -42013,14 +42012,11 @@ async function runOrResumeDecompose(prior, plan, stages, meta) {
|
|
|
42013
42012
|
ctx.setSummary(`${String(r.length)} tasks`);
|
|
42014
42013
|
return r;
|
|
42015
42014
|
});
|
|
42016
|
-
|
|
42017
|
-
|
|
42018
|
-
|
|
42019
|
-
|
|
42020
|
-
|
|
42021
|
-
}));
|
|
42022
|
-
}
|
|
42023
|
-
return tasks;
|
|
42015
|
+
return tasks.map((t) => ({
|
|
42016
|
+
...t,
|
|
42017
|
+
...meta.conditional ? { conditions: meta.conditions, caveats: meta.caveats } : {},
|
|
42018
|
+
...meta.researchMaturity !== void 0 ? { researchMaturity: meta.researchMaturity } : {}
|
|
42019
|
+
}));
|
|
42024
42020
|
}
|
|
42025
42021
|
function extractConditionalMeta(vote) {
|
|
42026
42022
|
if (vote.kind === "conditional_go") {
|
|
@@ -42077,7 +42073,9 @@ async function implementSingleTask(task, stages) {
|
|
|
42077
42073
|
description: task.description,
|
|
42078
42074
|
assignedTo: task.assignedTo,
|
|
42079
42075
|
status: "rejected",
|
|
42080
|
-
feedback
|
|
42076
|
+
feedback,
|
|
42077
|
+
// #3234: preserve research-maturity across the rejection reconstruction.
|
|
42078
|
+
researchMaturity: task.researchMaturity
|
|
42081
42079
|
};
|
|
42082
42080
|
}
|
|
42083
42081
|
return stages.implement(currentTask);
|
|
@@ -42095,7 +42093,9 @@ async function implementSingleTask(task, stages) {
|
|
|
42095
42093
|
assignedTo: task.assignedTo,
|
|
42096
42094
|
status: qaResult.approved ? "done" : "rejected",
|
|
42097
42095
|
implementation: qaResult.output,
|
|
42098
|
-
feedback: qaResult.feedback
|
|
42096
|
+
feedback: qaResult.feedback,
|
|
42097
|
+
// #3234: preserve research-maturity through to the final task.
|
|
42098
|
+
researchMaturity: task.researchMaturity
|
|
42099
42099
|
};
|
|
42100
42100
|
return { iterations: qaResult.iterations, task: finalTask };
|
|
42101
42101
|
}
|
|
@@ -42838,57 +42838,6 @@ async function runQualityGate(stage, checks, iteration = 1) {
|
|
|
42838
42838
|
};
|
|
42839
42839
|
}
|
|
42840
42840
|
|
|
42841
|
-
// src/pipeline/research-context.ts
|
|
42842
|
-
var MAX_RENDERED_ITEMS = 8;
|
|
42843
|
-
function sanitizeExternal(value, maxLen = 160) {
|
|
42844
|
-
const collapsed = value.replace(/`/g, "").replace(/[-]/g, " ").replace(/\s+/g, " ").trim();
|
|
42845
|
-
return collapsed.length > maxLen ? `${collapsed.slice(0, maxLen - 1)}\u2026` : collapsed;
|
|
42846
|
-
}
|
|
42847
|
-
function buildResearchContextMetadata(discover, analyze) {
|
|
42848
|
-
const discoveredItems = discover.items.map((item) => ({
|
|
42849
|
-
title: item.title,
|
|
42850
|
-
url: item.url,
|
|
42851
|
-
...item.relevanceScore !== void 0 ? { relevanceScore: item.relevanceScore } : {},
|
|
42852
|
-
alreadyInRegistry: item.alreadyInRegistry
|
|
42853
|
-
})).sort((a, b) => (b.relevanceScore ?? 0) - (a.relevanceScore ?? 0));
|
|
42854
|
-
return {
|
|
42855
|
-
discoveredItems,
|
|
42856
|
-
recommendations: analyze?.recommendations ?? [],
|
|
42857
|
-
qualitySignals: {
|
|
42858
|
-
totalFound: discover.totalFound,
|
|
42859
|
-
newItems: discover.newItems,
|
|
42860
|
-
alreadyInRegistry: discover.alreadyInRegistry
|
|
42861
|
-
}
|
|
42862
|
-
};
|
|
42863
|
-
}
|
|
42864
|
-
function renderResearchText(metadata, topic) {
|
|
42865
|
-
const { discoveredItems, recommendations, qualitySignals } = metadata;
|
|
42866
|
-
const lines = [];
|
|
42867
|
-
lines.push(`[Research] ${sanitizeExternal(topic, 120)}`);
|
|
42868
|
-
lines.push(
|
|
42869
|
-
`Maturity: ${String(qualitySignals.totalFound)} found, ${String(qualitySignals.newItems)} new, ${String(qualitySignals.alreadyInRegistry)} already in registry.`
|
|
42870
|
-
);
|
|
42871
|
-
if (discoveredItems.length > 0) {
|
|
42872
|
-
lines.push("Top discoveries (by relevance):");
|
|
42873
|
-
for (const item of discoveredItems.slice(0, MAX_RENDERED_ITEMS)) {
|
|
42874
|
-
const score = item.relevanceScore !== void 0 ? item.relevanceScore.toFixed(2) : "n/a";
|
|
42875
|
-
const known = item.alreadyInRegistry ? " [in registry]" : "";
|
|
42876
|
-
lines.push(`- ${sanitizeExternal(item.title)} (relevance ${score})${known}`);
|
|
42877
|
-
}
|
|
42878
|
-
} else {
|
|
42879
|
-
lines.push("Top discoveries (by relevance): none.");
|
|
42880
|
-
}
|
|
42881
|
-
if (recommendations.length > 0) {
|
|
42882
|
-
lines.push("Gap recommendations:");
|
|
42883
|
-
for (const rec of recommendations) lines.push(`- ${sanitizeExternal(rec)}`);
|
|
42884
|
-
}
|
|
42885
|
-
return lines.join("\n");
|
|
42886
|
-
}
|
|
42887
|
-
function buildResearchContext(discover, analyze, topic = discover.topic) {
|
|
42888
|
-
const metadata = buildResearchContextMetadata(discover, analyze);
|
|
42889
|
-
return { text: renderResearchText(metadata, topic), metadata };
|
|
42890
|
-
}
|
|
42891
|
-
|
|
42892
42841
|
// src/pipeline/budget-guard.ts
|
|
42893
42842
|
var BudgetGuard = class {
|
|
42894
42843
|
breaker;
|
|
@@ -43018,7 +42967,7 @@ var memoryInitPromise = null;
|
|
|
43018
42967
|
async function initPipelineMemory() {
|
|
43019
42968
|
if (cachedMemory !== null) return cachedMemory;
|
|
43020
42969
|
try {
|
|
43021
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
42970
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-VR3BJMWL.js");
|
|
43022
42971
|
const { getLearningDir } = await import("./learning-persistence-C737Q6EP.js");
|
|
43023
42972
|
const mem = createSessionMemory2(getLearningDir());
|
|
43024
42973
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
@@ -43066,8 +43015,13 @@ function flushPipelineMemory() {
|
|
|
43066
43015
|
}
|
|
43067
43016
|
var routingMemoryCache = null;
|
|
43068
43017
|
var routingMemoryInitPromise = null;
|
|
43069
|
-
function recordRoutingExperience(category, success, durationMs, tokensUsed = 0) {
|
|
43070
|
-
const metrics = {
|
|
43018
|
+
function recordRoutingExperience(category, success, durationMs, tokensUsed = 0, researchMaturity) {
|
|
43019
|
+
const metrics = {
|
|
43020
|
+
durationMs,
|
|
43021
|
+
tokensUsed,
|
|
43022
|
+
// #3234: record the run's research-maturity (RECORD + measure; #3815 gates use).
|
|
43023
|
+
...researchMaturity !== void 0 ? { researchMaturity } : {}
|
|
43024
|
+
};
|
|
43071
43025
|
const callRecord = (rm) => {
|
|
43072
43026
|
rm.recordExperience(category, ["claude"], success, metrics);
|
|
43073
43027
|
};
|
|
@@ -43075,7 +43029,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0)
|
|
|
43075
43029
|
callRecord(routingMemoryCache);
|
|
43076
43030
|
return;
|
|
43077
43031
|
}
|
|
43078
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
43032
|
+
routingMemoryInitPromise ??= import("./routing-memory-YAW2AIRX.js").then(({ createRoutingMemory }) => {
|
|
43079
43033
|
routingMemoryCache ??= createRoutingMemory();
|
|
43080
43034
|
return routingMemoryCache;
|
|
43081
43035
|
}).catch((error) => {
|
|
@@ -43109,7 +43063,7 @@ ${text}` : "";
|
|
|
43109
43063
|
}
|
|
43110
43064
|
async function getWeatherContext() {
|
|
43111
43065
|
try {
|
|
43112
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
43066
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-CETWTNE5.js");
|
|
43113
43067
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
43114
43068
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
43115
43069
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -43127,7 +43081,7 @@ ${lines}
|
|
|
43127
43081
|
}
|
|
43128
43082
|
async function getMemoryContext(task) {
|
|
43129
43083
|
try {
|
|
43130
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
43084
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-VR3BJMWL.js");
|
|
43131
43085
|
const { getLearningDir } = await import("./learning-persistence-C737Q6EP.js");
|
|
43132
43086
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
43133
43087
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -43192,14 +43146,15 @@ function createAgentStages(config = {}) {
|
|
|
43192
43146
|
"Research",
|
|
43193
43147
|
`Done (${String(ctx.metadata.discoveredItems.length)} items, ${String(durationMs)}ms)`
|
|
43194
43148
|
);
|
|
43195
|
-
|
|
43149
|
+
const text = memoryCtx ? `${ctx.text}${memoryCtx}` : ctx.text;
|
|
43150
|
+
return { text, metadata: ctx.metadata };
|
|
43196
43151
|
} catch (error) {
|
|
43197
43152
|
const durationMs = getTimeProvider().now() - start;
|
|
43198
43153
|
emitStageEvent2("research", "failed", { durationMs });
|
|
43199
43154
|
logger44.debug("Research stage failed; continuing with minimal context", {
|
|
43200
43155
|
error: error instanceof Error ? error.message : String(error)
|
|
43201
43156
|
});
|
|
43202
|
-
return `[Research failed] ${task.slice(0, 500)}
|
|
43157
|
+
return researchContextFromText(`[Research failed] ${task.slice(0, 500)}`);
|
|
43203
43158
|
}
|
|
43204
43159
|
},
|
|
43205
43160
|
plan: async (task, research, feedback) => {
|
|
@@ -43238,7 +43193,7 @@ ${contextBlock}`;
|
|
|
43238
43193
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
43239
43194
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
43240
43195
|
try {
|
|
43241
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
43196
|
+
const { executeVoting } = await import("./consensus-vote-SH5CKJQR.js");
|
|
43242
43197
|
const votingResult = await executeVoting(
|
|
43243
43198
|
{
|
|
43244
43199
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -43335,7 +43290,13 @@ ${task.description}${fb}`,
|
|
|
43335
43290
|
success: r.success,
|
|
43336
43291
|
durationMs: r.durationMs
|
|
43337
43292
|
});
|
|
43338
|
-
recordRoutingExperience(
|
|
43293
|
+
recordRoutingExperience(
|
|
43294
|
+
"code_generation",
|
|
43295
|
+
r.success,
|
|
43296
|
+
r.durationMs,
|
|
43297
|
+
r.tokensUsed,
|
|
43298
|
+
task.researchMaturity
|
|
43299
|
+
);
|
|
43339
43300
|
await postProgress(config, `Code [${task.id}]`, `Done (${r.durationMs}ms)`);
|
|
43340
43301
|
return r.text || `[Implementation failed: ${r.error}]`;
|
|
43341
43302
|
},
|
|
@@ -43512,7 +43473,7 @@ ${codeContext}`;
|
|
|
43512
43473
|
${enrichedTask}`;
|
|
43513
43474
|
}
|
|
43514
43475
|
const result = await stages.research(enrichedTask);
|
|
43515
|
-
return output(PIPELINE_STATE_KEYS.RESEARCH, result, getTimeProvider().now() - start, true);
|
|
43476
|
+
return output(PIPELINE_STATE_KEYS.RESEARCH, result.text, getTimeProvider().now() - start, true);
|
|
43516
43477
|
} catch (e) {
|
|
43517
43478
|
return failOutput(PIPELINE_STATE_KEYS.RESEARCH, getErrorMessage(e), getTimeProvider().now() - start);
|
|
43518
43479
|
}
|
|
@@ -43669,7 +43630,7 @@ async function searchCodebaseForTask(task) {
|
|
|
43669
43630
|
}
|
|
43670
43631
|
async function queryResearchRegistry(task) {
|
|
43671
43632
|
try {
|
|
43672
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
43633
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-6ROTFLGO.js");
|
|
43673
43634
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
43674
43635
|
if (topic === void 0) return null;
|
|
43675
43636
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -43740,7 +43701,7 @@ function createScanStageWrapper() {
|
|
|
43740
43701
|
try {
|
|
43741
43702
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
43742
43703
|
if (slug !== void 0) {
|
|
43743
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
43704
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-XL3LTBPN.js");
|
|
43744
43705
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
43745
43706
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
43746
43707
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -44696,22 +44657,28 @@ function registerQueryTaskStateTool(server, deps) {
|
|
|
44696
44657
|
}
|
|
44697
44658
|
|
|
44698
44659
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
44699
|
-
import { z as
|
|
44660
|
+
import { z as z97 } from "zod";
|
|
44700
44661
|
|
|
44701
44662
|
// src/mcp/tools/ci-health-log.ts
|
|
44702
44663
|
import { appendFileSync as appendFileSync4, existsSync as existsSync10, readFileSync as readFileSync8, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
44664
|
+
import { z as z96 } from "zod";
|
|
44665
|
+
|
|
44666
|
+
// src/mcp/tools/ci-health-types.ts
|
|
44703
44667
|
import { z as z95 } from "zod";
|
|
44668
|
+
var CiHealthStatusSchema = z95.enum(["healthy", "degraded", "outage", "unknown"]);
|
|
44669
|
+
|
|
44670
|
+
// src/mcp/tools/ci-health-log.ts
|
|
44704
44671
|
var logger45 = createLogger({ component: "ci-health-log" });
|
|
44705
|
-
var CiHealthEventSchema =
|
|
44706
|
-
v:
|
|
44707
|
-
ts:
|
|
44672
|
+
var CiHealthEventSchema = z96.object({
|
|
44673
|
+
v: z96.literal(1),
|
|
44674
|
+
ts: z96.iso.datetime(),
|
|
44708
44675
|
status: CiHealthStatusSchema,
|
|
44709
|
-
repo:
|
|
44710
|
-
signals:
|
|
44711
|
-
|
|
44712
|
-
source:
|
|
44676
|
+
repo: z96.string().optional(),
|
|
44677
|
+
signals: z96.array(
|
|
44678
|
+
z96.object({
|
|
44679
|
+
source: z96.enum(["github-status", "repo-activity-window"]),
|
|
44713
44680
|
status: CiHealthStatusSchema,
|
|
44714
|
-
evidence:
|
|
44681
|
+
evidence: z96.string()
|
|
44715
44682
|
})
|
|
44716
44683
|
)
|
|
44717
44684
|
});
|
|
@@ -44791,18 +44758,17 @@ function eventFromCheck(params) {
|
|
|
44791
44758
|
}
|
|
44792
44759
|
|
|
44793
44760
|
// src/mcp/tools/ci-health-check-tool.ts
|
|
44794
|
-
var
|
|
44795
|
-
var CiHealthCheckInputSchema = z96.object({
|
|
44761
|
+
var CiHealthCheckInputSchema = z97.object({
|
|
44796
44762
|
/**
|
|
44797
44763
|
* Repo to check for the recent-runs activity signal (in `owner/repo` form).
|
|
44798
44764
|
* Optional — when omitted, only the status-page signal is consulted.
|
|
44799
44765
|
*/
|
|
44800
|
-
repo:
|
|
44766
|
+
repo: z97.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."),
|
|
44801
44767
|
/**
|
|
44802
44768
|
* How far back to look for recent-runs activity (minutes). Default 30 —
|
|
44803
44769
|
* matches the typical wedge-detection window from the #3070 / #3076 outages.
|
|
44804
44770
|
*/
|
|
44805
|
-
activityWindowMinutes:
|
|
44771
|
+
activityWindowMinutes: z97.number().int().min(5).max(180).default(30).describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
44806
44772
|
});
|
|
44807
44773
|
var STATUS_PAGE_URL = "https://www.githubstatus.com/api/v2/components.json";
|
|
44808
44774
|
function mapStatusPageStatus(raw) {
|
|
@@ -44935,8 +44901,8 @@ var DESCRIPTION = "Check CI infrastructure health before triggering / polling ru
|
|
|
44935
44901
|
function registerCiHealthCheckTool(server, deps) {
|
|
44936
44902
|
const logger57 = deps.logger ?? createLogger({ tool: "ci_health_check" });
|
|
44937
44903
|
const toolSchema = {
|
|
44938
|
-
repo:
|
|
44939
|
-
activityWindowMinutes:
|
|
44904
|
+
repo: z97.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."),
|
|
44905
|
+
activityWindowMinutes: z97.number().int().min(5).max(180).optional().describe("Recent-runs lookback window in minutes (5-180; default 30).")
|
|
44940
44906
|
};
|
|
44941
44907
|
const secureHandler = createSecureHandler((args) => ciHealthCheckHandler(args, logger57), {
|
|
44942
44908
|
toolName: "ci_health_check",
|
|
@@ -44962,18 +44928,18 @@ function registerCiHealthCheckTool(server, deps) {
|
|
|
44962
44928
|
|
|
44963
44929
|
// src/mcp/tools/quality-gate-tool.ts
|
|
44964
44930
|
import { statSync as statSync3 } from "fs";
|
|
44965
|
-
import { z as
|
|
44966
|
-
var QualityCheckSchema =
|
|
44931
|
+
import { z as z98 } from "zod";
|
|
44932
|
+
var QualityCheckSchema = z98.enum(["typecheck", "lint", "tests", "build", "security"]);
|
|
44967
44933
|
var DEFAULT_CHECKS = ["typecheck", "lint", "tests"];
|
|
44968
|
-
var RunQualityGateInputSchema =
|
|
44934
|
+
var RunQualityGateInputSchema = z98.object({
|
|
44969
44935
|
/** Project directory to run checks against. Must resolve inside the repo/cwd root. */
|
|
44970
|
-
projectDir:
|
|
44936
|
+
projectDir: z98.string().optional().describe(
|
|
44971
44937
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
44972
44938
|
),
|
|
44973
44939
|
/** Which allowlisted checks to run. */
|
|
44974
|
-
checks:
|
|
44940
|
+
checks: z98.array(QualityCheckSchema).nonempty().default([...DEFAULT_CHECKS]).describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
44975
44941
|
/** 1-based iteration counter, forwarded to the engine for feedback context. */
|
|
44976
|
-
iteration:
|
|
44942
|
+
iteration: z98.number().int().min(1).default(1).describe("1-based iteration number (default 1).")
|
|
44977
44943
|
});
|
|
44978
44944
|
function validateProjectDir(raw) {
|
|
44979
44945
|
const candidate = raw ?? process.cwd();
|
|
@@ -45048,11 +45014,11 @@ var DESCRIPTION2 = "Run the QA quality gate (#1684 engine) against a project dir
|
|
|
45048
45014
|
function registerRunQualityGateTool(server, deps) {
|
|
45049
45015
|
const logger57 = deps.logger ?? createLogger({ tool: "run_quality_gate" });
|
|
45050
45016
|
const toolSchema = {
|
|
45051
|
-
projectDir:
|
|
45017
|
+
projectDir: z98.string().optional().describe(
|
|
45052
45018
|
"Project directory to run checks against (default: cwd). Must stay inside the repo root."
|
|
45053
45019
|
),
|
|
45054
|
-
checks:
|
|
45055
|
-
iteration:
|
|
45020
|
+
checks: z98.array(QualityCheckSchema).nonempty().optional().describe("Allowlisted checks to run (default: ['typecheck','lint','tests'])."),
|
|
45021
|
+
iteration: z98.number().int().min(1).optional().describe("1-based iteration number (default 1).")
|
|
45056
45022
|
};
|
|
45057
45023
|
const secureHandler = createSecureHandler(
|
|
45058
45024
|
(args) => runQualityGateHandler(args, logger57),
|
|
@@ -45082,9 +45048,9 @@ function registerRunQualityGateTool(server, deps) {
|
|
|
45082
45048
|
// src/mcp/tools/verify-audit-chain-tool.ts
|
|
45083
45049
|
import * as fs9 from "fs/promises";
|
|
45084
45050
|
import * as path8 from "path";
|
|
45085
|
-
import { z as
|
|
45086
|
-
var VerifyAuditChainInputSchema =
|
|
45087
|
-
logDir:
|
|
45051
|
+
import { z as z99 } from "zod";
|
|
45052
|
+
var VerifyAuditChainInputSchema = z99.object({
|
|
45053
|
+
logDir: z99.string().min(1).max(512).describe(
|
|
45088
45054
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files in lexicographic order and verifies the combined chain."
|
|
45089
45055
|
)
|
|
45090
45056
|
});
|
|
@@ -45161,7 +45127,7 @@ async function handler2(args, ctx) {
|
|
|
45161
45127
|
function registerVerifyAuditChainTool(server, deps) {
|
|
45162
45128
|
const logger57 = deps.logger ?? createLogger({ tool: "verify_audit_chain" });
|
|
45163
45129
|
const toolSchema = {
|
|
45164
|
-
logDir:
|
|
45130
|
+
logDir: z99.string().min(1).max(512).describe(
|
|
45165
45131
|
"Filesystem path to the FileAuditStorage log directory. Tool reads all `audit-*.jsonl` files and verifies the combined hash chain."
|
|
45166
45132
|
)
|
|
45167
45133
|
};
|
|
@@ -45185,7 +45151,7 @@ function registerVerifyAuditChainTool(server, deps) {
|
|
|
45185
45151
|
}
|
|
45186
45152
|
|
|
45187
45153
|
// src/mcp/tools/suggest-research-tasks-tool.ts
|
|
45188
|
-
import { z as
|
|
45154
|
+
import { z as z100 } from "zod";
|
|
45189
45155
|
var SUGGEST_RESEARCH_TASKS_NOTE = "Suggestions derived from external research (untrusted); review before acting \u2014 nothing was executed or filed.";
|
|
45190
45156
|
var RESEARCH_BUDGET_MS = 2e4;
|
|
45191
45157
|
var RESEARCH_TIMED_OUT = /* @__PURE__ */ Symbol("research-budget-exceeded");
|
|
@@ -45202,11 +45168,11 @@ async function withResearchBudget(p, ms) {
|
|
|
45202
45168
|
if (timer !== void 0) clearTimeout(timer);
|
|
45203
45169
|
}
|
|
45204
45170
|
}
|
|
45205
|
-
var SuggestResearchTasksInputSchema =
|
|
45206
|
-
topic:
|
|
45207
|
-
qualityThreshold:
|
|
45208
|
-
maxTriggers:
|
|
45209
|
-
existingTaskIds:
|
|
45171
|
+
var SuggestResearchTasksInputSchema = z100.object({
|
|
45172
|
+
topic: z100.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
45173
|
+
qualityThreshold: z100.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
45174
|
+
maxTriggers: z100.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
45175
|
+
existingTaskIds: z100.array(z100.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
45210
45176
|
});
|
|
45211
45177
|
function toTriggerConfig(input) {
|
|
45212
45178
|
return {
|
|
@@ -45263,10 +45229,10 @@ var DESCRIPTION3 = "SUGGEST-ONLY: surface candidate pipeline tasks for human/orc
|
|
|
45263
45229
|
function registerSuggestResearchTasksTool(server, deps) {
|
|
45264
45230
|
const logger57 = deps.logger ?? createLogger({ tool: "suggest_research_tasks" });
|
|
45265
45231
|
const toolSchema = {
|
|
45266
|
-
topic:
|
|
45267
|
-
qualityThreshold:
|
|
45268
|
-
maxTriggers:
|
|
45269
|
-
existingTaskIds:
|
|
45232
|
+
topic: z100.string().optional().describe("Topic filter passed to research_discover. Optional."),
|
|
45233
|
+
qualityThreshold: z100.number().min(0).max(10).optional().describe("Minimum quality score (0-10) a discovery must meet to be suggested. Optional."),
|
|
45234
|
+
maxTriggers: z100.number().int().min(1).optional().describe("Max number of candidate tasks to return (>=1). Optional."),
|
|
45235
|
+
existingTaskIds: z100.array(z100.string()).optional().describe("Known task IDs to skip (dedup). Optional.")
|
|
45270
45236
|
};
|
|
45271
45237
|
const secureHandler = createSecureHandler(
|
|
45272
45238
|
(args) => suggestResearchTasksHandler(args, logger57),
|
|
@@ -45294,7 +45260,7 @@ function registerSuggestResearchTasksTool(server, deps) {
|
|
|
45294
45260
|
}
|
|
45295
45261
|
|
|
45296
45262
|
// src/mcp/tools/run-tool.ts
|
|
45297
|
-
import { z as
|
|
45263
|
+
import { z as z104 } from "zod";
|
|
45298
45264
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
45299
45265
|
|
|
45300
45266
|
// src/orchestration/meta-orchestrator.ts
|
|
@@ -45499,7 +45465,7 @@ function createMetaOrchestrator(options) {
|
|
|
45499
45465
|
|
|
45500
45466
|
// src/orchestration/meta-shadow-selector.ts
|
|
45501
45467
|
import { appendFileSync as appendFileSync5, existsSync as existsSync11, readFileSync as readFileSync9 } from "fs";
|
|
45502
|
-
import { z as
|
|
45468
|
+
import { z as z101 } from "zod";
|
|
45503
45469
|
var SHADOW_STRATEGY_ARMS = [
|
|
45504
45470
|
"single-shot",
|
|
45505
45471
|
"dev-pipeline",
|
|
@@ -45580,19 +45546,19 @@ function createHydratableSelector() {
|
|
|
45580
45546
|
var META_OUTCOME_SCHEMA_VERSION = 1;
|
|
45581
45547
|
var HYDRATE_LOOKBACK_DAYS = 30;
|
|
45582
45548
|
var HYDRATE_LOOKBACK_MS = HYDRATE_LOOKBACK_DAYS * 24 * 60 * 60 * 1e3;
|
|
45583
|
-
var PersistedContextSchema =
|
|
45584
|
-
taskComplexity:
|
|
45585
|
-
contextLengthNormalized:
|
|
45586
|
-
isCodeTask:
|
|
45587
|
-
isReasoningTask:
|
|
45588
|
-
budgetUtilization:
|
|
45589
|
-
timePressure:
|
|
45549
|
+
var PersistedContextSchema = z101.object({
|
|
45550
|
+
taskComplexity: z101.number(),
|
|
45551
|
+
contextLengthNormalized: z101.number(),
|
|
45552
|
+
isCodeTask: z101.number(),
|
|
45553
|
+
isReasoningTask: z101.number(),
|
|
45554
|
+
budgetUtilization: z101.number(),
|
|
45555
|
+
timePressure: z101.number()
|
|
45590
45556
|
});
|
|
45591
|
-
var PersistedMetaOutcomeSchema =
|
|
45592
|
-
schema:
|
|
45593
|
-
timestamp:
|
|
45594
|
-
strategy:
|
|
45595
|
-
success:
|
|
45557
|
+
var PersistedMetaOutcomeSchema = z101.object({
|
|
45558
|
+
schema: z101.literal(META_OUTCOME_SCHEMA_VERSION),
|
|
45559
|
+
timestamp: z101.string(),
|
|
45560
|
+
strategy: z101.enum(SHADOW_STRATEGY_ARMS),
|
|
45561
|
+
success: z101.boolean(),
|
|
45596
45562
|
context: PersistedContextSchema
|
|
45597
45563
|
});
|
|
45598
45564
|
var persistLogger = createLogger({ component: "MetaShadowSelector" });
|
|
@@ -45763,7 +45729,7 @@ function createMetaDispatcher(options) {
|
|
|
45763
45729
|
}
|
|
45764
45730
|
|
|
45765
45731
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
45766
|
-
import { z as
|
|
45732
|
+
import { z as z102 } from "zod";
|
|
45767
45733
|
import * as fs11 from "fs";
|
|
45768
45734
|
import * as path10 from "path";
|
|
45769
45735
|
import { randomUUID as randomUUID15 } from "crypto";
|
|
@@ -45786,7 +45752,7 @@ var GitHubTaskTracker = class {
|
|
|
45786
45752
|
cachedProvider = null;
|
|
45787
45753
|
async getProvider() {
|
|
45788
45754
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
45789
|
-
const { createScmProvider } = await import("./factory-
|
|
45755
|
+
const { createScmProvider } = await import("./factory-GP5SJCTQ.js");
|
|
45790
45756
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
45791
45757
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
45792
45758
|
this.cachedProvider = result.value;
|
|
@@ -45910,36 +45876,36 @@ function createTaskTracker(config) {
|
|
|
45910
45876
|
|
|
45911
45877
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
45912
45878
|
var DEV_PIPELINE_ASYNC_HINT = "A full run_dev_pipeline run can exceed the 900s synchronous MCP timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
|
|
45913
|
-
var DevPipelineInputSchema =
|
|
45879
|
+
var DevPipelineInputSchema = z102.object({
|
|
45914
45880
|
/** Direct task instructions. */
|
|
45915
|
-
task:
|
|
45881
|
+
task: z102.string().max(1e4).optional().describe("Direct task instructions (what to build)"),
|
|
45916
45882
|
/** Path to a plan file (.md, .yaml, .txt) to use as input. */
|
|
45917
|
-
planFile:
|
|
45883
|
+
planFile: z102.string().max(500).optional().describe("Path to a plan/spec file to use as input"),
|
|
45918
45884
|
/** Whether to run in dry-run mode (plan+vote only, no implementation). */
|
|
45919
|
-
dryRun:
|
|
45885
|
+
dryRun: z102.boolean().default(false).describe("If true, stop after plan+vote (no implementation)"),
|
|
45920
45886
|
/** Maximum vote iterations before proceeding (default: 3). */
|
|
45921
|
-
maxVoteIterations:
|
|
45887
|
+
maxVoteIterations: z102.number().int().min(1).max(5).default(3).describe("Max plan\u2192vote iterations"),
|
|
45922
45888
|
/** Maximum QA iterations per task (default: 3). */
|
|
45923
|
-
maxQaIterations:
|
|
45889
|
+
maxQaIterations: z102.number().int().min(1).max(5).default(3).describe("Max QA review iterations per task"),
|
|
45924
45890
|
/** Working directory for the pipeline (default: cwd). Used for security scan and context. */
|
|
45925
|
-
workingDir:
|
|
45891
|
+
workingDir: z102.string().max(500).optional().describe("Working directory (default: cwd)"),
|
|
45926
45892
|
/** GitHub issue number to track progress on. Updates posted as comments. */
|
|
45927
|
-
issueNumber:
|
|
45893
|
+
issueNumber: z102.number().int().positive().optional().describe("GitHub issue to post progress to"),
|
|
45928
45894
|
/** GitHub repo (owner/name) for issue tracking. */
|
|
45929
|
-
repo:
|
|
45895
|
+
repo: z102.string().max(200).optional().describe("GitHub repo for issue tracking (e.g., owner/repo)"),
|
|
45930
45896
|
/** Task tracking backend: github, gitlab, or json (default: json). */
|
|
45931
|
-
trackerBackend:
|
|
45897
|
+
trackerBackend: z102.enum(["github", "gitlab", "json"]).default("json").describe("Task tracking backend for issue creation"),
|
|
45932
45898
|
/** Labels to apply to created issues. */
|
|
45933
|
-
labels:
|
|
45899
|
+
labels: z102.array(z102.string()).optional().describe("Labels for created issues"),
|
|
45934
45900
|
/** Session ID for checkpoint/resume. Enables crash recovery. */
|
|
45935
|
-
sessionId:
|
|
45901
|
+
sessionId: z102.string().max(128).regex(/^[a-zA-Z0-9_-]+$/).optional().describe("Session ID for checkpoint/resume (crash recovery)"),
|
|
45936
45902
|
/**
|
|
45937
45903
|
* TESTS ONLY — when true, voters return random decisions. Must not be used as
|
|
45938
45904
|
* a fallback when adapters are unavailable; configure an adapter instead. (#2319)
|
|
45939
45905
|
*/
|
|
45940
|
-
simulateVotes:
|
|
45906
|
+
simulateVotes: z102.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)"),
|
|
45941
45907
|
/** Voting strategy for consensus stages. */
|
|
45942
|
-
votingStrategy:
|
|
45908
|
+
votingStrategy: z102.enum([
|
|
45943
45909
|
"simple_majority",
|
|
45944
45910
|
"supermajority",
|
|
45945
45911
|
"unanimous",
|
|
@@ -45948,11 +45914,11 @@ var DevPipelineInputSchema = z101.object({
|
|
|
45948
45914
|
"opinion_wise"
|
|
45949
45915
|
]).optional().describe("Voting strategy for plan approval (default: higher_order)"),
|
|
45950
45916
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
45951
|
-
quickMode:
|
|
45917
|
+
quickMode: z102.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
45952
45918
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
45953
|
-
timeoutMs:
|
|
45919
|
+
timeoutMs: z102.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
45954
45920
|
/** Pipeline execution mode. */
|
|
45955
|
-
mode:
|
|
45921
|
+
mode: z102.enum(["autonomous", "harness"]).default("autonomous").describe(
|
|
45956
45922
|
"'autonomous': full pipeline. 'harness': stops after decompose, returns tasks for caller to implement."
|
|
45957
45923
|
),
|
|
45958
45924
|
/**
|
|
@@ -45963,15 +45929,15 @@ var DevPipelineInputSchema = z101.object({
|
|
|
45963
45929
|
* `get_job_result({ jobId })` for the result. Ignored when `dryRun` is
|
|
45964
45930
|
* true (plan+vote completes fast, so dry runs always stay sync).
|
|
45965
45931
|
*/
|
|
45966
|
-
dispatch:
|
|
45932
|
+
dispatch: z102.enum(["sync", "async"]).default("sync").describe(
|
|
45967
45933
|
"Dispatch mode (#3726). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
|
|
45968
45934
|
),
|
|
45969
45935
|
/** Local pre-ship quality gate (typecheck/lint/tests) mode (#3356). */
|
|
45970
|
-
qualityGate:
|
|
45936
|
+
qualityGate: z102.enum(["off", "advisory", "blocking"]).default("off").describe(
|
|
45971
45937
|
"Pre-ship local quality gate. 'off' (default): skip. 'advisory': run + record feedback, never fail. 'blocking': a red gate fails the pipeline."
|
|
45972
45938
|
),
|
|
45973
45939
|
/** Opt-in per-run token budget — a safety cap for unattended runs (#3395). */
|
|
45974
|
-
maxBudgetTokens:
|
|
45940
|
+
maxBudgetTokens: z102.number().int().positive().optional().describe(
|
|
45975
45941
|
"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)."
|
|
45976
45942
|
)
|
|
45977
45943
|
});
|
|
@@ -46136,20 +46102,20 @@ function registerDevPipelineTool(server, deps) {
|
|
|
46136
46102
|
}
|
|
46137
46103
|
|
|
46138
46104
|
// src/mcp/tools/pipeline-tool.ts
|
|
46139
|
-
import { z as
|
|
46105
|
+
import { z as z103 } from "zod";
|
|
46140
46106
|
import * as fs12 from "fs";
|
|
46141
46107
|
import * as path11 from "path";
|
|
46142
46108
|
import { randomUUID as randomUUID16 } from "crypto";
|
|
46143
46109
|
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.";
|
|
46144
|
-
var PipelineInputSchema =
|
|
46110
|
+
var PipelineInputSchema = z103.object({
|
|
46145
46111
|
/** The task to execute. */
|
|
46146
|
-
task:
|
|
46112
|
+
task: z103.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
|
|
46147
46113
|
/** Path to a spec file (.md, .yaml) to use as task input. */
|
|
46148
|
-
specFile:
|
|
46114
|
+
specFile: z103.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
|
|
46149
46115
|
/** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
|
|
46150
|
-
template:
|
|
46116
|
+
template: z103.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
|
|
46151
46117
|
/** Voting strategy for consensus stages. */
|
|
46152
|
-
votingStrategy:
|
|
46118
|
+
votingStrategy: z103.enum([
|
|
46153
46119
|
"simple_majority",
|
|
46154
46120
|
"supermajority",
|
|
46155
46121
|
"unanimous",
|
|
@@ -46160,11 +46126,11 @@ var PipelineInputSchema = z102.object({
|
|
|
46160
46126
|
"Voting strategy for plan approval. simple_majority (default), supermajority (67%), unanimous, higher_order (Bayesian), proof_of_learning, opinion_wise"
|
|
46161
46127
|
),
|
|
46162
46128
|
/** Use 3 agents instead of 6 for faster voting. */
|
|
46163
|
-
quickMode:
|
|
46129
|
+
quickMode: z103.boolean().default(false).describe("Use 3 agents instead of 6 for faster consensus voting"),
|
|
46164
46130
|
/** Maximum execution time per stage in milliseconds (min 30s, max 600s). */
|
|
46165
|
-
timeoutMs:
|
|
46131
|
+
timeoutMs: z103.number().int().min(3e4).max(6e5).optional().describe("Max time per stage in ms (30000-600000). Default: varies by stage complexity"),
|
|
46166
46132
|
/** Stop after planning/voting (no implementation). */
|
|
46167
|
-
dryRun:
|
|
46133
|
+
dryRun: z103.boolean().default(false).describe("Stop after vote stage (no implementation)"),
|
|
46168
46134
|
/**
|
|
46169
46135
|
* Dispatch mode (#3730). `sync` (default) runs the pipeline inline and
|
|
46170
46136
|
* returns the result — but a real multi-stage adaptive run can exceed the
|
|
@@ -46173,11 +46139,11 @@ var PipelineInputSchema = z102.object({
|
|
|
46173
46139
|
* `get_job_result({ jobId })` for the result. Ignored when `dryRun` is true
|
|
46174
46140
|
* (plan+vote completes fast, so dry runs always stay sync).
|
|
46175
46141
|
*/
|
|
46176
|
-
dispatch:
|
|
46142
|
+
dispatch: z103.enum(["sync", "async"]).default("sync").describe(
|
|
46177
46143
|
"Dispatch mode (#3730). 'sync' (default): run inline. 'async': return a jobId immediately + run in background (poll get_job_result). Ignored for dryRun."
|
|
46178
46144
|
),
|
|
46179
46145
|
/** TESTS ONLY — random output, must not be used for real decisions. (#2319) */
|
|
46180
|
-
simulateVotes:
|
|
46146
|
+
simulateVotes: z103.boolean().default(false).describe("TESTS ONLY \u2014 random output, must not be used for real decisions (#2319)")
|
|
46181
46147
|
});
|
|
46182
46148
|
function buildOutput2(result) {
|
|
46183
46149
|
return {
|
|
@@ -46333,9 +46299,9 @@ var STRATEGY_ENTRYPOINT_TOOL = {
|
|
|
46333
46299
|
spec: "execute_spec",
|
|
46334
46300
|
research: "run_pipeline"
|
|
46335
46301
|
};
|
|
46336
|
-
var RunInputSchema =
|
|
46337
|
-
goal:
|
|
46338
|
-
forceStrategy:
|
|
46302
|
+
var RunInputSchema = z104.object({
|
|
46303
|
+
goal: z104.string().min(1).describe("Natural-language goal. nexus-agents selects how to execute it."),
|
|
46304
|
+
forceStrategy: z104.enum([
|
|
46339
46305
|
"single-shot",
|
|
46340
46306
|
"dev-pipeline",
|
|
46341
46307
|
"pipeline",
|
|
@@ -46347,10 +46313,10 @@ var RunInputSchema = z103.object({
|
|
|
46347
46313
|
]).optional().describe(
|
|
46348
46314
|
"Power-user override: force a specific strategy instead of letting the router choose."
|
|
46349
46315
|
),
|
|
46350
|
-
requiresConsensus:
|
|
46351
|
-
dependencyStructure:
|
|
46352
|
-
isNovel:
|
|
46353
|
-
execute:
|
|
46316
|
+
requiresConsensus: z104.boolean().optional().describe("Hint: the task needs a multi-perspective consensus decision."),
|
|
46317
|
+
dependencyStructure: z104.enum(["linear", "dag", "independent", "unknown"]).optional().describe("Hint: the dependency structure of the work."),
|
|
46318
|
+
isNovel: z104.boolean().optional().describe("Hint: this kind of task has not been seen before."),
|
|
46319
|
+
execute: z104.boolean().optional().describe(
|
|
46354
46320
|
"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)."
|
|
46355
46321
|
),
|
|
46356
46322
|
/**
|
|
@@ -46361,7 +46327,7 @@ var RunInputSchema = z103.object({
|
|
|
46361
46327
|
* envelope immediately and runs in the background; poll
|
|
46362
46328
|
* `get_job_result({ jobId })`. Ignored for read-only routing (execute:false).
|
|
46363
46329
|
*/
|
|
46364
|
-
dispatch:
|
|
46330
|
+
dispatch: z104.enum(["sync", "async"]).optional().describe(
|
|
46365
46331
|
"Dispatch mode (#3732). 'sync' (default): run inline. 'async' (only with execute:true): return a jobId immediately + run in background (poll get_job_result)."
|
|
46366
46332
|
)
|
|
46367
46333
|
});
|
|
@@ -46521,12 +46487,12 @@ function registerRunTool(server, deps) {
|
|
|
46521
46487
|
}
|
|
46522
46488
|
|
|
46523
46489
|
// src/mcp/tools/list-available-models-tool.ts
|
|
46524
|
-
import { z as
|
|
46490
|
+
import { z as z105 } from "zod";
|
|
46525
46491
|
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.";
|
|
46526
46492
|
var PROBE_TIMEOUT_MS = 12e3;
|
|
46527
|
-
var ListAvailableModelsInputSchema =
|
|
46528
|
-
includeModelIds:
|
|
46529
|
-
includeOpenRouter:
|
|
46493
|
+
var ListAvailableModelsInputSchema = z105.object({
|
|
46494
|
+
includeModelIds: z105.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
46495
|
+
includeOpenRouter: z105.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
46530
46496
|
});
|
|
46531
46497
|
async function probeSource(source, includeModelIds) {
|
|
46532
46498
|
let timer;
|
|
@@ -46558,7 +46524,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
46558
46524
|
}
|
|
46559
46525
|
}
|
|
46560
46526
|
async function defaultSources(includeOpenRouter) {
|
|
46561
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
46527
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-5IYTNTA2.js");
|
|
46562
46528
|
const adapters = createAllAdapters2();
|
|
46563
46529
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
46564
46530
|
}
|
|
@@ -46590,8 +46556,8 @@ async function listAvailableModelsHandler(args, deps, logger57) {
|
|
|
46590
46556
|
function registerListAvailableModelsTool(server, deps) {
|
|
46591
46557
|
const logger57 = deps.logger ?? createLogger({ tool: "list_available_models" });
|
|
46592
46558
|
const toolSchema = {
|
|
46593
|
-
includeModelIds:
|
|
46594
|
-
includeOpenRouter:
|
|
46559
|
+
includeModelIds: z105.boolean().optional().describe("Include the full model-id list per transport (default false \u2192 sample of 5 only)."),
|
|
46560
|
+
includeOpenRouter: z105.boolean().optional().describe("Probe the OpenRouter live catalog (default true).")
|
|
46595
46561
|
};
|
|
46596
46562
|
const secureHandler = createSecureHandler(
|
|
46597
46563
|
(args) => listAvailableModelsHandler(args, deps, logger57),
|
|
@@ -46615,7 +46581,7 @@ function registerListAvailableModelsTool(server, deps) {
|
|
|
46615
46581
|
}
|
|
46616
46582
|
|
|
46617
46583
|
// src/mcp/tools/supply-chain-tradeoff-panel.ts
|
|
46618
|
-
import { z as
|
|
46584
|
+
import { z as z106 } from "zod";
|
|
46619
46585
|
import { randomUUID as randomUUID18 } from "crypto";
|
|
46620
46586
|
var DEFAULT_AXES = [
|
|
46621
46587
|
"build_time_determinism",
|
|
@@ -46637,16 +46603,16 @@ var FULL_PANEL = [
|
|
|
46637
46603
|
"scope_steward"
|
|
46638
46604
|
];
|
|
46639
46605
|
var QUICK_PANEL = ["architect", "security", "scope_steward"];
|
|
46640
|
-
var SupplyChainTradeoffPanelInputSchema =
|
|
46641
|
-
proposal:
|
|
46642
|
-
axes:
|
|
46606
|
+
var SupplyChainTradeoffPanelInputSchema = z106.object({
|
|
46607
|
+
proposal: z106.string().min(1).max(MAX_PROPOSAL_LENGTH).describe('The proposal under tradeoff review (e.g. "Should aegis-boot adopt cargo-nextest?")'),
|
|
46608
|
+
axes: z106.array(z106.string().min(1).max(MAX_AXIS_NAME_LENGTH)).min(1).max(MAX_AXES).optional().describe(
|
|
46643
46609
|
`Tradeoff axes to evaluate. Default: ${DEFAULT_AXES.join(", ")}. Custom axes accepted; max ${String(MAX_AXES)}.`
|
|
46644
46610
|
),
|
|
46645
|
-
context:
|
|
46611
|
+
context: z106.string().max(MAX_CONTEXT_LENGTH).optional().describe(
|
|
46646
46612
|
"Optional context: relevant repo state, dependency tree, vendor publishing patterns, etc."
|
|
46647
46613
|
),
|
|
46648
|
-
quickMode:
|
|
46649
|
-
simulate:
|
|
46614
|
+
quickMode: z106.boolean().optional().default(false).describe("Use 3 voters (architect, security, scope_steward) instead of 7"),
|
|
46615
|
+
simulate: z106.boolean().optional().default(false).describe("Use simulated voters (testing only)"),
|
|
46650
46616
|
/**
|
|
46651
46617
|
* Dispatch mode (#3731). `sync` (default) runs the panel inline and returns
|
|
46652
46618
|
* the result — but a live fan-out (up to 7 voters) can exceed the MCP request
|
|
@@ -46654,7 +46620,7 @@ var SupplyChainTradeoffPanelInputSchema = z105.object({
|
|
|
46654
46620
|
* immediately and runs the panel in the background; poll
|
|
46655
46621
|
* `get_job_result({ jobId })` for the result.
|
|
46656
46622
|
*/
|
|
46657
|
-
dispatch:
|
|
46623
|
+
dispatch: z106.enum(["sync", "async"]).default("sync").describe(
|
|
46658
46624
|
"Dispatch mode (#3731). 'sync' (default): run inline. 'async': return a jobId immediately + run the panel in background (poll get_job_result)."
|
|
46659
46625
|
)
|
|
46660
46626
|
});
|
|
@@ -47121,40 +47087,40 @@ var RiskLevel = /* @__PURE__ */ ((RiskLevel2) => {
|
|
|
47121
47087
|
})(RiskLevel || {});
|
|
47122
47088
|
|
|
47123
47089
|
// src/mcp/safety/stpa-schemas.ts
|
|
47124
|
-
import { z as
|
|
47125
|
-
var HazardCategorySchema =
|
|
47126
|
-
var HazardSeveritySchema =
|
|
47127
|
-
var ConstraintPrioritySchema =
|
|
47128
|
-
var RiskLevelSchema =
|
|
47129
|
-
var TriggerPatternSchema =
|
|
47130
|
-
parameter:
|
|
47131
|
-
matchType:
|
|
47132
|
-
pattern:
|
|
47133
|
-
reason:
|
|
47090
|
+
import { z as z107 } from "zod";
|
|
47091
|
+
var HazardCategorySchema = z107.enum(HazardCategory);
|
|
47092
|
+
var HazardSeveritySchema = z107.enum(HazardSeverity);
|
|
47093
|
+
var ConstraintPrioritySchema = z107.enum(ConstraintPriority);
|
|
47094
|
+
var RiskLevelSchema = z107.enum(RiskLevel);
|
|
47095
|
+
var TriggerPatternSchema = z107.object({
|
|
47096
|
+
parameter: z107.string().min(1),
|
|
47097
|
+
matchType: z107.enum(["contains", "regex", "equals", "startsWith", "endsWith"]),
|
|
47098
|
+
pattern: z107.string(),
|
|
47099
|
+
reason: z107.string()
|
|
47134
47100
|
});
|
|
47135
|
-
var HazardSchema =
|
|
47136
|
-
id:
|
|
47137
|
-
description:
|
|
47101
|
+
var HazardSchema = z107.object({
|
|
47102
|
+
id: z107.string().min(1),
|
|
47103
|
+
description: z107.string(),
|
|
47138
47104
|
category: HazardCategorySchema,
|
|
47139
47105
|
severity: HazardSeveritySchema,
|
|
47140
|
-
likelihood:
|
|
47141
|
-
triggerConditions:
|
|
47142
|
-
consequences:
|
|
47106
|
+
likelihood: z107.enum(["almost_certain", "likely", "possible", "unlikely", "rare"]),
|
|
47107
|
+
triggerConditions: z107.array(z107.string()),
|
|
47108
|
+
consequences: z107.array(z107.string())
|
|
47143
47109
|
});
|
|
47144
|
-
var UnsafeControlActionSchema =
|
|
47145
|
-
id:
|
|
47146
|
-
toolName:
|
|
47147
|
-
type:
|
|
47148
|
-
description:
|
|
47149
|
-
unsafeContext:
|
|
47150
|
-
relatedHazards:
|
|
47151
|
-
triggerPatterns:
|
|
47110
|
+
var UnsafeControlActionSchema = z107.object({
|
|
47111
|
+
id: z107.string().min(1),
|
|
47112
|
+
toolName: z107.string().min(1),
|
|
47113
|
+
type: z107.enum(["not_provided", "provided_causes_hazard", "wrong_timing", "wrong_duration"]),
|
|
47114
|
+
description: z107.string(),
|
|
47115
|
+
unsafeContext: z107.string(),
|
|
47116
|
+
relatedHazards: z107.array(z107.string()),
|
|
47117
|
+
triggerPatterns: z107.array(TriggerPatternSchema).optional()
|
|
47152
47118
|
});
|
|
47153
|
-
var SafetyConstraintSchema =
|
|
47154
|
-
id:
|
|
47155
|
-
description:
|
|
47156
|
-
mitigates:
|
|
47157
|
-
enforcement:
|
|
47119
|
+
var SafetyConstraintSchema = z107.object({
|
|
47120
|
+
id: z107.string().min(1),
|
|
47121
|
+
description: z107.string(),
|
|
47122
|
+
mitigates: z107.array(z107.string()),
|
|
47123
|
+
enforcement: z107.enum([
|
|
47158
47124
|
"prevent",
|
|
47159
47125
|
"require_confirmation",
|
|
47160
47126
|
"alert",
|
|
@@ -47162,54 +47128,54 @@ var SafetyConstraintSchema = z106.object({
|
|
|
47162
47128
|
"rate_limit",
|
|
47163
47129
|
"require_privilege"
|
|
47164
47130
|
]),
|
|
47165
|
-
validationFunction:
|
|
47131
|
+
validationFunction: z107.string().optional(),
|
|
47166
47132
|
priority: ConstraintPrioritySchema
|
|
47167
47133
|
});
|
|
47168
|
-
var PropertySchemaSchema =
|
|
47169
|
-
type:
|
|
47170
|
-
description:
|
|
47171
|
-
enum:
|
|
47172
|
-
pattern:
|
|
47173
|
-
minimum:
|
|
47174
|
-
maximum:
|
|
47134
|
+
var PropertySchemaSchema = z107.object({
|
|
47135
|
+
type: z107.string(),
|
|
47136
|
+
description: z107.string().optional(),
|
|
47137
|
+
enum: z107.array(z107.unknown()).optional(),
|
|
47138
|
+
pattern: z107.string().optional(),
|
|
47139
|
+
minimum: z107.number().optional(),
|
|
47140
|
+
maximum: z107.number().optional()
|
|
47175
47141
|
});
|
|
47176
|
-
var ToolInputSchemaSchema =
|
|
47177
|
-
type:
|
|
47178
|
-
properties:
|
|
47179
|
-
required:
|
|
47180
|
-
additionalProperties:
|
|
47142
|
+
var ToolInputSchemaSchema = z107.object({
|
|
47143
|
+
type: z107.string(),
|
|
47144
|
+
properties: z107.record(z107.string(), PropertySchemaSchema).optional(),
|
|
47145
|
+
required: z107.array(z107.string()).optional(),
|
|
47146
|
+
additionalProperties: z107.boolean().optional()
|
|
47181
47147
|
});
|
|
47182
|
-
var ToolDefinitionSchema =
|
|
47183
|
-
name:
|
|
47184
|
-
description:
|
|
47148
|
+
var ToolDefinitionSchema = z107.object({
|
|
47149
|
+
name: z107.string().min(1),
|
|
47150
|
+
description: z107.string(),
|
|
47185
47151
|
inputSchema: ToolInputSchemaSchema
|
|
47186
47152
|
});
|
|
47187
|
-
var AnalysisConfigurationSchema =
|
|
47188
|
-
includeLowSeverity:
|
|
47189
|
-
generateAllConstraints:
|
|
47190
|
-
checkInteractions:
|
|
47191
|
-
maxHazardsPerTool:
|
|
47192
|
-
categories:
|
|
47153
|
+
var AnalysisConfigurationSchema = z107.object({
|
|
47154
|
+
includeLowSeverity: z107.boolean().default(true),
|
|
47155
|
+
generateAllConstraints: z107.boolean().default(true),
|
|
47156
|
+
checkInteractions: z107.boolean().default(true),
|
|
47157
|
+
maxHazardsPerTool: z107.number().int().min(1).max(100).default(50),
|
|
47158
|
+
categories: z107.array(HazardCategorySchema).default([])
|
|
47193
47159
|
});
|
|
47194
|
-
var ConstraintViolationSchema =
|
|
47195
|
-
constraintId:
|
|
47196
|
-
constraintDescription:
|
|
47160
|
+
var ConstraintViolationSchema = z107.object({
|
|
47161
|
+
constraintId: z107.string().min(1),
|
|
47162
|
+
constraintDescription: z107.string(),
|
|
47197
47163
|
severity: HazardSeveritySchema,
|
|
47198
|
-
details:
|
|
47199
|
-
remediation:
|
|
47164
|
+
details: z107.string(),
|
|
47165
|
+
remediation: z107.string()
|
|
47200
47166
|
});
|
|
47201
|
-
var ValidationWarningSchema =
|
|
47202
|
-
code:
|
|
47203
|
-
message:
|
|
47204
|
-
affected:
|
|
47167
|
+
var ValidationWarningSchema = z107.object({
|
|
47168
|
+
code: z107.string().min(1),
|
|
47169
|
+
message: z107.string(),
|
|
47170
|
+
affected: z107.string()
|
|
47205
47171
|
});
|
|
47206
|
-
var ValidationResultSchema =
|
|
47207
|
-
valid:
|
|
47208
|
-
toolName:
|
|
47209
|
-
violations:
|
|
47210
|
-
passed:
|
|
47211
|
-
warnings:
|
|
47212
|
-
validatedAt:
|
|
47172
|
+
var ValidationResultSchema = z107.object({
|
|
47173
|
+
valid: z107.boolean(),
|
|
47174
|
+
toolName: z107.string().min(1),
|
|
47175
|
+
violations: z107.array(ConstraintViolationSchema),
|
|
47176
|
+
passed: z107.array(z107.string()),
|
|
47177
|
+
warnings: z107.array(ValidationWarningSchema),
|
|
47178
|
+
validatedAt: z107.date()
|
|
47213
47179
|
});
|
|
47214
47180
|
|
|
47215
47181
|
// src/mcp/safety/stpa-types.ts
|
|
@@ -48294,43 +48260,43 @@ var GeminiResponseParser = class {
|
|
|
48294
48260
|
};
|
|
48295
48261
|
|
|
48296
48262
|
// src/cli-adapters/router-types.ts
|
|
48297
|
-
import { z as
|
|
48298
|
-
var RouterConfigSchema =
|
|
48299
|
-
minCapacityThreshold:
|
|
48300
|
-
preferCostEfficient:
|
|
48301
|
-
maxDecisionTimeMs:
|
|
48263
|
+
import { z as z108 } from "zod";
|
|
48264
|
+
var RouterConfigSchema = z108.object({
|
|
48265
|
+
minCapacityThreshold: z108.number().min(0).max(1).default(0.1),
|
|
48266
|
+
preferCostEfficient: z108.boolean().default(false),
|
|
48267
|
+
maxDecisionTimeMs: z108.number().min(1).max(1e3).default(100)
|
|
48302
48268
|
});
|
|
48303
48269
|
|
|
48304
48270
|
// src/cli-adapters/agreement-cascade-types.ts
|
|
48305
|
-
import { z as
|
|
48306
|
-
var AgreementCascadeConfigSchema =
|
|
48307
|
-
agreementThreshold:
|
|
48308
|
-
maxStages:
|
|
48309
|
-
modelTimeoutMs:
|
|
48271
|
+
import { z as z109 } from "zod";
|
|
48272
|
+
var AgreementCascadeConfigSchema = z109.object({
|
|
48273
|
+
agreementThreshold: z109.number().min(0.5).max(1).default(0.7),
|
|
48274
|
+
maxStages: z109.number().int().min(1).max(5).default(3),
|
|
48275
|
+
modelTimeoutMs: z109.number().int().min(1e3).max(3e5).default(6e4)
|
|
48310
48276
|
});
|
|
48311
48277
|
|
|
48312
48278
|
// src/cli-adapters/agreement-cascade-router.ts
|
|
48313
48279
|
var logger48 = createLogger({ component: "agreement-cascade-router" });
|
|
48314
48280
|
|
|
48315
48281
|
// src/cli-adapters/task-classifier.ts
|
|
48316
|
-
import { z as
|
|
48317
|
-
var ClassificationPatternsSchema =
|
|
48318
|
-
code:
|
|
48319
|
-
research:
|
|
48320
|
-
documentation:
|
|
48321
|
-
analysis:
|
|
48282
|
+
import { z as z110 } from "zod";
|
|
48283
|
+
var ClassificationPatternsSchema = z110.object({
|
|
48284
|
+
code: z110.array(z110.string()).readonly(),
|
|
48285
|
+
research: z110.array(z110.string()).readonly(),
|
|
48286
|
+
documentation: z110.array(z110.string()).readonly(),
|
|
48287
|
+
analysis: z110.array(z110.string()).readonly()
|
|
48322
48288
|
});
|
|
48323
48289
|
|
|
48324
48290
|
// src/cli-adapters/response-cache-types.ts
|
|
48325
|
-
import { z as
|
|
48326
|
-
var ResponseCacheConfigSchema =
|
|
48327
|
-
defaultTTL:
|
|
48291
|
+
import { z as z111 } from "zod";
|
|
48292
|
+
var ResponseCacheConfigSchema = z111.object({
|
|
48293
|
+
defaultTTL: z111.number().min(1e3).max(36e5).default(3e5),
|
|
48328
48294
|
// 5 minutes
|
|
48329
|
-
maxEntries:
|
|
48330
|
-
maxMemoryMB:
|
|
48331
|
-
cleanupInterval:
|
|
48295
|
+
maxEntries: z111.number().min(10).max(1e5).default(1e3),
|
|
48296
|
+
maxMemoryMB: z111.number().min(1).max(1e3).default(50),
|
|
48297
|
+
cleanupInterval: z111.number().min(1e3).max(6e5).default(6e4),
|
|
48332
48298
|
// 1 minute
|
|
48333
|
-
enableLogging:
|
|
48299
|
+
enableLogging: z111.boolean().default(false)
|
|
48334
48300
|
});
|
|
48335
48301
|
|
|
48336
48302
|
// src/cli-adapters/response-cache-utils.ts
|
|
@@ -48338,12 +48304,12 @@ import { createHash as createHash4 } from "crypto";
|
|
|
48338
48304
|
var logger49 = createLogger({ component: "ResponseCacheUtils" });
|
|
48339
48305
|
|
|
48340
48306
|
// src/cli-adapters/unified-routing-types.ts
|
|
48341
|
-
import { z as
|
|
48342
|
-
var UnifiedRoutingDecisionSchema =
|
|
48343
|
-
selectedCli:
|
|
48344
|
-
confidence:
|
|
48345
|
-
reason:
|
|
48346
|
-
strategy:
|
|
48307
|
+
import { z as z112 } from "zod";
|
|
48308
|
+
var UnifiedRoutingDecisionSchema = z112.object({
|
|
48309
|
+
selectedCli: z112.string(),
|
|
48310
|
+
confidence: z112.number().min(0).max(1),
|
|
48311
|
+
reason: z112.string(),
|
|
48312
|
+
strategy: z112.enum([
|
|
48347
48313
|
"composite",
|
|
48348
48314
|
"quality",
|
|
48349
48315
|
"budget",
|
|
@@ -48355,57 +48321,57 @@ var UnifiedRoutingDecisionSchema = z111.object({
|
|
|
48355
48321
|
"linucb",
|
|
48356
48322
|
"direct"
|
|
48357
48323
|
]),
|
|
48358
|
-
decisionTimeMs:
|
|
48359
|
-
alternatives:
|
|
48360
|
-
stagesExecuted:
|
|
48361
|
-
withinBudget:
|
|
48362
|
-
estimatedComplexity:
|
|
48363
|
-
estimatedTokens:
|
|
48364
|
-
topsisScore:
|
|
48365
|
-
ucbScore:
|
|
48366
|
-
resolvedAtStage:
|
|
48367
|
-
consensusReached:
|
|
48368
|
-
agreementScore:
|
|
48369
|
-
metadata:
|
|
48324
|
+
decisionTimeMs: z112.number().nonnegative(),
|
|
48325
|
+
alternatives: z112.array(z112.string()).readonly(),
|
|
48326
|
+
stagesExecuted: z112.array(z112.string()).readonly(),
|
|
48327
|
+
withinBudget: z112.boolean().optional(),
|
|
48328
|
+
estimatedComplexity: z112.enum(["simple", "moderate", "complex", "expert"]).optional(),
|
|
48329
|
+
estimatedTokens: z112.number().int().positive().optional(),
|
|
48330
|
+
topsisScore: z112.number().optional(),
|
|
48331
|
+
ucbScore: z112.number().optional(),
|
|
48332
|
+
resolvedAtStage: z112.number().int().nonnegative().optional(),
|
|
48333
|
+
consensusReached: z112.boolean().optional(),
|
|
48334
|
+
agreementScore: z112.number().min(0).max(1).optional(),
|
|
48335
|
+
metadata: z112.record(z112.string(), z112.unknown()).optional()
|
|
48370
48336
|
});
|
|
48371
48337
|
|
|
48372
48338
|
// src/learning/outcome-feedback-types.ts
|
|
48373
|
-
import { z as
|
|
48374
|
-
var QualitySignalsSchema =
|
|
48375
|
-
testsPass:
|
|
48376
|
-
lintErrors:
|
|
48377
|
-
userApproved:
|
|
48378
|
-
retryCount:
|
|
48379
|
-
completionRatio:
|
|
48380
|
-
validStructure:
|
|
48381
|
-
coherenceScore:
|
|
48339
|
+
import { z as z113 } from "zod";
|
|
48340
|
+
var QualitySignalsSchema = z113.object({
|
|
48341
|
+
testsPass: z113.boolean().optional(),
|
|
48342
|
+
lintErrors: z113.number().int().min(0).optional(),
|
|
48343
|
+
userApproved: z113.boolean().optional(),
|
|
48344
|
+
retryCount: z113.number().int().min(0).default(0),
|
|
48345
|
+
completionRatio: z113.number().min(0).max(1).default(1),
|
|
48346
|
+
validStructure: z113.boolean().optional(),
|
|
48347
|
+
coherenceScore: z113.number().min(0).max(1).optional()
|
|
48382
48348
|
});
|
|
48383
|
-
var RoutingDecisionSchema =
|
|
48384
|
-
id:
|
|
48385
|
-
timestamp:
|
|
48386
|
-
query:
|
|
48387
|
-
routerType:
|
|
48388
|
-
selectedModel:
|
|
48389
|
-
selectedTier:
|
|
48390
|
-
armIndex:
|
|
48391
|
-
banditContext:
|
|
48392
|
-
queryFeatures:
|
|
48393
|
-
ucbScore:
|
|
48394
|
-
confidence:
|
|
48395
|
-
traceId:
|
|
48396
|
-
domain:
|
|
48349
|
+
var RoutingDecisionSchema = z113.object({
|
|
48350
|
+
id: z113.uuid(),
|
|
48351
|
+
timestamp: z113.iso.datetime(),
|
|
48352
|
+
query: z113.string(),
|
|
48353
|
+
routerType: z113.enum(["linucb", "preference", "quality", "cascade", "topsis"]),
|
|
48354
|
+
selectedModel: z113.string(),
|
|
48355
|
+
selectedTier: z113.enum(["strong", "weak"]).optional(),
|
|
48356
|
+
armIndex: z113.number().int().min(0).optional(),
|
|
48357
|
+
banditContext: z113.record(z113.string(), z113.unknown()).optional(),
|
|
48358
|
+
queryFeatures: z113.record(z113.string(), z113.unknown()).optional(),
|
|
48359
|
+
ucbScore: z113.number().optional(),
|
|
48360
|
+
confidence: z113.number().min(0).max(1).optional(),
|
|
48361
|
+
traceId: z113.string(),
|
|
48362
|
+
domain: z113.string().optional()
|
|
48397
48363
|
});
|
|
48398
|
-
var TaskOutcomeSchema =
|
|
48399
|
-
routingDecisionId:
|
|
48400
|
-
timestamp:
|
|
48401
|
-
outcomeClass:
|
|
48402
|
-
success:
|
|
48403
|
-
qualityScore:
|
|
48404
|
-
durationMs:
|
|
48405
|
-
tokenUsage:
|
|
48406
|
-
errorMessage:
|
|
48364
|
+
var TaskOutcomeSchema = z113.object({
|
|
48365
|
+
routingDecisionId: z113.uuid(),
|
|
48366
|
+
timestamp: z113.iso.datetime(),
|
|
48367
|
+
outcomeClass: z113.enum(["success", "partial", "failure", "timeout", "error"]),
|
|
48368
|
+
success: z113.boolean(),
|
|
48369
|
+
qualityScore: z113.number().min(0).max(1),
|
|
48370
|
+
durationMs: z113.number().min(0),
|
|
48371
|
+
tokenUsage: z113.number().int().min(0),
|
|
48372
|
+
errorMessage: z113.string().optional(),
|
|
48407
48373
|
qualitySignals: QualitySignalsSchema,
|
|
48408
|
-
traceId:
|
|
48374
|
+
traceId: z113.string()
|
|
48409
48375
|
});
|
|
48410
48376
|
var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
48411
48377
|
maxPendingDecisions: 1e3,
|
|
@@ -48420,17 +48386,17 @@ var DEFAULT_FEEDBACK_COLLECTOR_CONFIG = {
|
|
|
48420
48386
|
targetTokenUsage: 2e3,
|
|
48421
48387
|
maxHistorySize: 1e4
|
|
48422
48388
|
};
|
|
48423
|
-
var FeedbackCollectorConfigSchema =
|
|
48424
|
-
maxPendingDecisions:
|
|
48425
|
-
pendingTimeoutMs:
|
|
48426
|
-
enableAutoReward:
|
|
48427
|
-
qualityWeight:
|
|
48428
|
-
speedWeight:
|
|
48429
|
-
efficiencyWeight:
|
|
48430
|
-
retryPenalty:
|
|
48431
|
-
targetDurationMs:
|
|
48432
|
-
targetTokenUsage:
|
|
48433
|
-
maxHistorySize:
|
|
48389
|
+
var FeedbackCollectorConfigSchema = z113.object({
|
|
48390
|
+
maxPendingDecisions: z113.number().int().positive().default(1e3),
|
|
48391
|
+
pendingTimeoutMs: z113.number().positive().default(3e5),
|
|
48392
|
+
enableAutoReward: z113.boolean().default(true),
|
|
48393
|
+
qualityWeight: z113.number().min(0).max(1).default(0.5),
|
|
48394
|
+
speedWeight: z113.number().min(0).max(1).default(0.2),
|
|
48395
|
+
efficiencyWeight: z113.number().min(0).max(1).default(0.2),
|
|
48396
|
+
retryPenalty: z113.number().min(0).max(1).default(0.1),
|
|
48397
|
+
targetDurationMs: z113.number().positive().default(5e3),
|
|
48398
|
+
targetTokenUsage: z113.number().positive().default(2e3),
|
|
48399
|
+
maxHistorySize: z113.number().int().positive().default(1e4)
|
|
48434
48400
|
});
|
|
48435
48401
|
|
|
48436
48402
|
// src/learning/outcome-feedback-helpers.ts
|
|
@@ -50577,4 +50543,4 @@ export {
|
|
|
50577
50543
|
shutdownFeedbackSubscriber,
|
|
50578
50544
|
createEventBusBridge
|
|
50579
50545
|
};
|
|
50580
|
-
//# sourceMappingURL=chunk-
|
|
50546
|
+
//# sourceMappingURL=chunk-KOICNQMN.js.map
|