nexus-agents 8.95.0 → 8.97.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/{ast-rule-runner-AENX35DI.js → ast-rule-runner-QQIRWXJ4.js} +3 -3
- package/dist/{child-mcp-config-R4CEMSF5.js → child-mcp-config-JTOIFT6B.js} +2 -2
- package/dist/{chunk-R4RWVV7T.js → chunk-2A52CTLB.js} +2 -2
- package/dist/{chunk-PD5P5IR5.js → chunk-3CNLLCDQ.js} +2 -2
- package/dist/{chunk-AMHNHLNI.js → chunk-5I2I5G4U.js} +4 -4
- package/dist/{chunk-HUEJZRXL.js → chunk-6562BJ3L.js} +2 -2
- package/dist/{chunk-HPU3GX6X.js → chunk-6I6JETP7.js} +2 -2
- package/dist/{chunk-YGK46JA6.js → chunk-7TXK4ZU3.js} +3 -3
- package/dist/{chunk-CP7VDW32.js → chunk-A7LUQRS4.js} +2 -2
- package/dist/{chunk-EHZF662J.js → chunk-AVGO46BN.js} +10 -9
- package/dist/{chunk-SN7KDZHF.js → chunk-BGW4CHYZ.js} +2 -2
- package/dist/{chunk-KJHAS2RE.js → chunk-CYP33W2C.js} +2 -2
- package/dist/{chunk-4YBPGLGV.js → chunk-DGWVJ6HB.js} +7 -5
- package/dist/chunk-DGWVJ6HB.js.map +1 -0
- package/dist/{chunk-WEWAWST6.js → chunk-E3DEDHRY.js} +3 -3
- package/dist/{chunk-AR2F5M3C.js → chunk-F7CB7C3P.js} +4 -4
- package/dist/{chunk-5LFNZUTP.js → chunk-FUU6LXIA.js} +7 -7
- package/dist/{chunk-PVPRFL6X.js → chunk-GUEUV3ND.js} +300 -163
- package/dist/chunk-GUEUV3ND.js.map +1 -0
- package/dist/{chunk-SREIKKHG.js → chunk-HKTZFZSM.js} +5 -5
- package/dist/{chunk-2VGSZ2T5.js → chunk-IR25EHPP.js} +3 -3
- package/dist/{chunk-SOTVN3IX.js → chunk-KB7VXRC4.js} +2 -2
- package/dist/{chunk-4PC3BFNK.js → chunk-LFGVIWQ7.js} +10 -10
- package/dist/{chunk-EK36EMZU.js → chunk-LFZUQNUH.js} +2 -2
- package/dist/{chunk-CVNCK2YK.js → chunk-MEBD2TMO.js} +2 -2
- package/dist/{chunk-KHV2EWL5.js → chunk-NJ7ZYOFR.js} +2 -2
- package/dist/{chunk-JL2LSRRP.js → chunk-OADHASVD.js} +8 -8
- package/dist/{chunk-ALQ2OHTL.js → chunk-ON4YR4KS.js} +2 -2
- package/dist/{chunk-XHUX3CLV.js → chunk-OVE3YJSE.js} +2 -2
- package/dist/{chunk-ZLQEIDFO.js → chunk-R6EP6UNC.js} +5 -5
- package/dist/{chunk-4MH2FQEJ.js → chunk-S2FT4YA6.js} +181 -20
- package/dist/chunk-S2FT4YA6.js.map +1 -0
- package/dist/{chunk-BBR3VDSF.js → chunk-UDWF2XCA.js} +14 -11
- package/dist/chunk-UDWF2XCA.js.map +1 -0
- package/dist/{chunk-S2FFTO7K.js → chunk-UKU5ZBZF.js} +3 -3
- package/dist/{chunk-5H4GLB67.js → chunk-UVPFSWB3.js} +2 -2
- package/dist/{chunk-VBSN75LH.js → chunk-YKTA5UBL.js} +2 -2
- package/dist/{chunk-PLVRFU7J.js → chunk-YUYYMYPU.js} +2 -2
- package/dist/{chunk-LBCBCICW.js → chunk-ZQJORAPU.js} +2 -2
- package/dist/{cli-circuit-breaker-UTKN7IKF.js → cli-circuit-breaker-AWZO2BAC.js} +3 -3
- package/dist/cli.js +42 -42
- package/dist/{composite-router-NCXFGGT6.js → composite-router-BLVJAOFR.js} +2 -2
- package/dist/{consensus-vote-EYDJ6EFC.js → consensus-vote-44KYPBV4.js} +16 -16
- package/dist/{context-retriever-KVOGKRD2.js → context-retriever-QI63DBJI.js} +8 -8
- package/dist/{doctor-deep-67VQ3IT4.js → doctor-deep-VJVT7H2S.js} +3 -3
- package/dist/{doctor-live-LOD5TY3Y.js → doctor-live-PNVKASBK.js} +10 -10
- package/dist/{expert-bridge-ZYT3I52N.js → expert-bridge-WP7PJDNV.js} +4 -4
- package/dist/{factory-O3WTM3TT.js → factory-H7WD46ZF.js} +5 -5
- package/dist/{factory-NVXLC7NL.js → factory-QJVIUHGU.js} +9 -9
- package/dist/{improvement-review-XWXYS5RY.js → improvement-review-7JZHY2EK.js} +5 -5
- package/dist/index.d.ts +47 -0
- package/dist/index.js +30 -30
- package/dist/{init-opencode-UEGHUL5J.js → init-opencode-3FT4RSEY.js} +11 -6
- package/dist/init-opencode-3FT4RSEY.js.map +1 -0
- package/dist/issue-triage-DP27HRIY.js +16 -0
- package/dist/{pr-reviewer-helpers-JKPZDSZ2.js → pr-reviewer-helpers-BLDZ3ZQ7.js} +4 -4
- package/dist/{registry-command-HXWPVL24.js → registry-command-CABQPLN4.js} +2 -2
- package/dist/{repo-security-plan-N5EEG556.js → repo-security-plan-5GNN6EQ2.js} +3 -3
- package/dist/{research-helpers-synthesize-KNRPZHXP.js → research-helpers-synthesize-MOJKZLS5.js} +4 -4
- package/dist/{routing-memory-UTI3VDJU.js → routing-memory-FRZ3EZBT.js} +2 -2
- package/dist/{session-memory-I37N6GRO.js → session-memory-K63UQWAN.js} +3 -3
- package/dist/{setup-config-YHM7UVFM.js → setup-config-54EYGCDL.js} +3 -3
- package/dist/{setup-custom-api-W7CBEC5J.js → setup-custom-api-YWOZHDPK.js} +4 -4
- package/dist/setup-data-dir-RUJUERZQ.js +32 -0
- package/dist/{tool-memory-QELGZV5V.js → tool-memory-ZXN6EYVO.js} +5 -5
- package/dist/{unified-registry-WTBAP3LM.js → unified-registry-BEYNDSAX.js} +10 -10
- package/dist/{weather-report-DLANNJI6.js → weather-report-YZIE7PAH.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-4MH2FQEJ.js.map +0 -1
- package/dist/chunk-4YBPGLGV.js.map +0 -1
- package/dist/chunk-BBR3VDSF.js.map +0 -1
- package/dist/chunk-PVPRFL6X.js.map +0 -1
- package/dist/init-opencode-UEGHUL5J.js.map +0 -1
- package/dist/issue-triage-33JX6N33.js +0 -16
- package/dist/setup-data-dir-MIVWE2JT.js +0 -32
- /package/dist/{ast-rule-runner-AENX35DI.js.map → ast-rule-runner-QQIRWXJ4.js.map} +0 -0
- /package/dist/{child-mcp-config-R4CEMSF5.js.map → child-mcp-config-JTOIFT6B.js.map} +0 -0
- /package/dist/{chunk-R4RWVV7T.js.map → chunk-2A52CTLB.js.map} +0 -0
- /package/dist/{chunk-PD5P5IR5.js.map → chunk-3CNLLCDQ.js.map} +0 -0
- /package/dist/{chunk-AMHNHLNI.js.map → chunk-5I2I5G4U.js.map} +0 -0
- /package/dist/{chunk-HUEJZRXL.js.map → chunk-6562BJ3L.js.map} +0 -0
- /package/dist/{chunk-HPU3GX6X.js.map → chunk-6I6JETP7.js.map} +0 -0
- /package/dist/{chunk-YGK46JA6.js.map → chunk-7TXK4ZU3.js.map} +0 -0
- /package/dist/{chunk-CP7VDW32.js.map → chunk-A7LUQRS4.js.map} +0 -0
- /package/dist/{chunk-EHZF662J.js.map → chunk-AVGO46BN.js.map} +0 -0
- /package/dist/{chunk-SN7KDZHF.js.map → chunk-BGW4CHYZ.js.map} +0 -0
- /package/dist/{chunk-KJHAS2RE.js.map → chunk-CYP33W2C.js.map} +0 -0
- /package/dist/{chunk-WEWAWST6.js.map → chunk-E3DEDHRY.js.map} +0 -0
- /package/dist/{chunk-AR2F5M3C.js.map → chunk-F7CB7C3P.js.map} +0 -0
- /package/dist/{chunk-5LFNZUTP.js.map → chunk-FUU6LXIA.js.map} +0 -0
- /package/dist/{chunk-SREIKKHG.js.map → chunk-HKTZFZSM.js.map} +0 -0
- /package/dist/{chunk-2VGSZ2T5.js.map → chunk-IR25EHPP.js.map} +0 -0
- /package/dist/{chunk-SOTVN3IX.js.map → chunk-KB7VXRC4.js.map} +0 -0
- /package/dist/{chunk-4PC3BFNK.js.map → chunk-LFGVIWQ7.js.map} +0 -0
- /package/dist/{chunk-EK36EMZU.js.map → chunk-LFZUQNUH.js.map} +0 -0
- /package/dist/{chunk-CVNCK2YK.js.map → chunk-MEBD2TMO.js.map} +0 -0
- /package/dist/{chunk-KHV2EWL5.js.map → chunk-NJ7ZYOFR.js.map} +0 -0
- /package/dist/{chunk-JL2LSRRP.js.map → chunk-OADHASVD.js.map} +0 -0
- /package/dist/{chunk-ALQ2OHTL.js.map → chunk-ON4YR4KS.js.map} +0 -0
- /package/dist/{chunk-XHUX3CLV.js.map → chunk-OVE3YJSE.js.map} +0 -0
- /package/dist/{chunk-ZLQEIDFO.js.map → chunk-R6EP6UNC.js.map} +0 -0
- /package/dist/{chunk-S2FFTO7K.js.map → chunk-UKU5ZBZF.js.map} +0 -0
- /package/dist/{chunk-5H4GLB67.js.map → chunk-UVPFSWB3.js.map} +0 -0
- /package/dist/{chunk-VBSN75LH.js.map → chunk-YKTA5UBL.js.map} +0 -0
- /package/dist/{chunk-PLVRFU7J.js.map → chunk-YUYYMYPU.js.map} +0 -0
- /package/dist/{chunk-LBCBCICW.js.map → chunk-ZQJORAPU.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-UTKN7IKF.js.map → cli-circuit-breaker-AWZO2BAC.js.map} +0 -0
- /package/dist/{composite-router-NCXFGGT6.js.map → composite-router-BLVJAOFR.js.map} +0 -0
- /package/dist/{consensus-vote-EYDJ6EFC.js.map → consensus-vote-44KYPBV4.js.map} +0 -0
- /package/dist/{context-retriever-KVOGKRD2.js.map → context-retriever-QI63DBJI.js.map} +0 -0
- /package/dist/{doctor-deep-67VQ3IT4.js.map → doctor-deep-VJVT7H2S.js.map} +0 -0
- /package/dist/{doctor-live-LOD5TY3Y.js.map → doctor-live-PNVKASBK.js.map} +0 -0
- /package/dist/{expert-bridge-ZYT3I52N.js.map → expert-bridge-WP7PJDNV.js.map} +0 -0
- /package/dist/{factory-NVXLC7NL.js.map → factory-H7WD46ZF.js.map} +0 -0
- /package/dist/{factory-O3WTM3TT.js.map → factory-QJVIUHGU.js.map} +0 -0
- /package/dist/{improvement-review-XWXYS5RY.js.map → improvement-review-7JZHY2EK.js.map} +0 -0
- /package/dist/{issue-triage-33JX6N33.js.map → issue-triage-DP27HRIY.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-JKPZDSZ2.js.map → pr-reviewer-helpers-BLDZ3ZQ7.js.map} +0 -0
- /package/dist/{registry-command-HXWPVL24.js.map → registry-command-CABQPLN4.js.map} +0 -0
- /package/dist/{repo-security-plan-N5EEG556.js.map → repo-security-plan-5GNN6EQ2.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-KNRPZHXP.js.map → research-helpers-synthesize-MOJKZLS5.js.map} +0 -0
- /package/dist/{routing-memory-UTI3VDJU.js.map → routing-memory-FRZ3EZBT.js.map} +0 -0
- /package/dist/{session-memory-I37N6GRO.js.map → session-memory-K63UQWAN.js.map} +0 -0
- /package/dist/{setup-config-YHM7UVFM.js.map → setup-config-54EYGCDL.js.map} +0 -0
- /package/dist/{setup-custom-api-W7CBEC5J.js.map → setup-custom-api-YWOZHDPK.js.map} +0 -0
- /package/dist/{setup-data-dir-MIVWE2JT.js.map → setup-data-dir-RUJUERZQ.js.map} +0 -0
- /package/dist/{tool-memory-QELGZV5V.js.map → tool-memory-ZXN6EYVO.js.map} +0 -0
- /package/dist/{unified-registry-WTBAP3LM.js.map → unified-registry-BEYNDSAX.js.map} +0 -0
- /package/dist/{weather-report-DLANNJI6.js.map → weather-report-YZIE7PAH.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateSecurityPlan
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MEBD2TMO.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-LFGVIWQ7.js";
|
|
25
25
|
import {
|
|
26
26
|
executeExpert
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-FUU6LXIA.js";
|
|
28
28
|
import {
|
|
29
29
|
DEPRECATED_MODE_ALIAS_INPUT,
|
|
30
30
|
JobStatusSchema,
|
|
@@ -70,9 +70,10 @@ import {
|
|
|
70
70
|
simulationDeniedResult,
|
|
71
71
|
toJobSummary,
|
|
72
72
|
updateStage,
|
|
73
|
+
withFileLock,
|
|
73
74
|
withWarnings,
|
|
74
75
|
writeJobCancelled
|
|
75
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-AVGO46BN.js";
|
|
76
77
|
import {
|
|
77
78
|
allOf,
|
|
78
79
|
anyOf
|
|
@@ -80,7 +81,7 @@ import {
|
|
|
80
81
|
import {
|
|
81
82
|
normalizeTopicToCanonical,
|
|
82
83
|
synthesizeResearch
|
|
83
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-E3DEDHRY.js";
|
|
84
85
|
import {
|
|
85
86
|
IssueTriage,
|
|
86
87
|
createAuditTrail,
|
|
@@ -89,13 +90,13 @@ import {
|
|
|
89
90
|
createGraphAuditBridge,
|
|
90
91
|
emitPipelinePolicyEvent,
|
|
91
92
|
readActionRefusal
|
|
92
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-R6EP6UNC.js";
|
|
93
94
|
import {
|
|
94
95
|
sanitizeInput
|
|
95
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-CYP33W2C.js";
|
|
96
97
|
import {
|
|
97
98
|
withPrerequisite
|
|
98
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-7TXK4ZU3.js";
|
|
99
100
|
import {
|
|
100
101
|
NOOP_NOTIFIER,
|
|
101
102
|
RateLimiter,
|
|
@@ -123,17 +124,17 @@ import {
|
|
|
123
124
|
toolSuccessStructured,
|
|
124
125
|
withProgressHeartbeat,
|
|
125
126
|
wrapToolWithTimeout
|
|
126
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-IR25EHPP.js";
|
|
127
128
|
import {
|
|
128
129
|
VERSION
|
|
129
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-6I6JETP7.js";
|
|
130
131
|
import {
|
|
131
132
|
EventTopics,
|
|
132
133
|
UNRESOLVED_MODEL_ID,
|
|
133
134
|
createEvent,
|
|
134
135
|
getGlobalEventBus,
|
|
135
136
|
getGlobalRegistry
|
|
136
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-DGWVJ6HB.js";
|
|
137
138
|
import {
|
|
138
139
|
IDENTIFIER_RE,
|
|
139
140
|
LANG_VALUES,
|
|
@@ -166,7 +167,7 @@ import {
|
|
|
166
167
|
parseRegistry,
|
|
167
168
|
sourceExistsInRegistry,
|
|
168
169
|
summarizeContextForPrompt
|
|
169
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-HKTZFZSM.js";
|
|
170
171
|
import {
|
|
171
172
|
REGISTRY_PATH,
|
|
172
173
|
getProjectRoot,
|
|
@@ -174,25 +175,25 @@ import {
|
|
|
174
175
|
loadTechniquesRegistry,
|
|
175
176
|
resolveInsideRoot,
|
|
176
177
|
resolveRegistryRoot
|
|
177
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-UVPFSWB3.js";
|
|
178
179
|
import {
|
|
179
180
|
getTokenEnvVars,
|
|
180
181
|
resolveToken
|
|
181
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-ON4YR4KS.js";
|
|
182
183
|
import {
|
|
183
184
|
DEFAULT_RELEVANCE_CONFIG,
|
|
184
185
|
MemoryImportance,
|
|
185
186
|
MemoryType,
|
|
186
187
|
calculateTextJaccardSimilarity,
|
|
187
188
|
getToolMemory
|
|
188
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-F7CB7C3P.js";
|
|
189
190
|
import {
|
|
190
191
|
STOPWORDS,
|
|
191
192
|
truncateWithInfo
|
|
192
193
|
} from "./chunk-7LP6VJRP.js";
|
|
193
194
|
import {
|
|
194
195
|
createSessionMemory
|
|
195
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-6562BJ3L.js";
|
|
196
197
|
import {
|
|
197
198
|
BUILT_IN_EXPERTS,
|
|
198
199
|
BuiltInExpertTypeSchema,
|
|
@@ -211,24 +212,24 @@ import {
|
|
|
211
212
|
isCliDisabled,
|
|
212
213
|
sleep,
|
|
213
214
|
withTimeout
|
|
214
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-OADHASVD.js";
|
|
215
216
|
import {
|
|
216
217
|
BaseAdapter,
|
|
217
218
|
createStream,
|
|
218
219
|
requireApiKey,
|
|
219
220
|
validateApiKeyPresence
|
|
220
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-YKTA5UBL.js";
|
|
221
222
|
import {
|
|
222
223
|
DEFAULTS
|
|
223
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-2A52CTLB.js";
|
|
224
225
|
import {
|
|
225
226
|
resolveGatewayEnv
|
|
226
|
-
} from "./chunk-
|
|
227
|
+
} from "./chunk-3CNLLCDQ.js";
|
|
227
228
|
import {
|
|
228
229
|
getAvailabilityCache,
|
|
229
230
|
getCliForModelId,
|
|
230
231
|
resolveFallback
|
|
231
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-YUYYMYPU.js";
|
|
232
233
|
import {
|
|
233
234
|
sanitizeErrorDetails
|
|
234
235
|
} from "./chunk-2NDA4DHW.js";
|
|
@@ -240,7 +241,7 @@ import {
|
|
|
240
241
|
import {
|
|
241
242
|
generateHyphenId,
|
|
242
243
|
generateUUID
|
|
243
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-LFZUQNUH.js";
|
|
244
245
|
import {
|
|
245
246
|
AGENT_ROUTER_TIMEOUTS,
|
|
246
247
|
API_TIMEOUTS,
|
|
@@ -358,7 +359,7 @@ import {
|
|
|
358
359
|
selectStrategyByManifest,
|
|
359
360
|
toExpertTaskAnalysisResult,
|
|
360
361
|
withStep
|
|
361
|
-
} from "./chunk-
|
|
362
|
+
} from "./chunk-UDWF2XCA.js";
|
|
362
363
|
import {
|
|
363
364
|
ensureLearningDir,
|
|
364
365
|
getMetaOutcomesFile,
|
|
@@ -1070,6 +1071,9 @@ var NexusEnvSchema = z10.object({
|
|
|
1070
1071
|
if (reason !== void 0) ctx.addIssue({ code: "custom", message: reason });
|
|
1071
1072
|
}).optional(),
|
|
1072
1073
|
NEXUS_OPENAI_COMPAT_KEY: z10.string().optional(),
|
|
1074
|
+
// #6600: gateway model-id allowlist (OPENAI_COMPAT_MODELS_ENV), applied
|
|
1075
|
+
// before the per-gateway adapter cap. Comma-separated; `*` is a wildcard.
|
|
1076
|
+
NEXUS_OPENAI_COMPAT_MODELS: z10.string().optional(),
|
|
1073
1077
|
NEXUS_OPENAI_COMPAT_URL: z10.string().optional(),
|
|
1074
1078
|
NEXUS_OPENCODE_CONFIG: z10.string().optional(),
|
|
1075
1079
|
NEXUS_PR_REVIEW_RECORDS_PATH: z10.string().optional(),
|
|
@@ -17401,7 +17405,7 @@ function wouldCreateCycle(from, to, getNode) {
|
|
|
17401
17405
|
return canReach(to, from, /* @__PURE__ */ new Set(), getNode);
|
|
17402
17406
|
}
|
|
17403
17407
|
function findCyclePath(from, to, getNode) {
|
|
17404
|
-
const
|
|
17408
|
+
const path12 = [from, to];
|
|
17405
17409
|
const visited = /* @__PURE__ */ new Set([from]);
|
|
17406
17410
|
const findPath = (current) => {
|
|
17407
17411
|
if (current === from) return true;
|
|
@@ -17410,9 +17414,9 @@ function findCyclePath(from, to, getNode) {
|
|
|
17410
17414
|
for (const depId of node.dependencies.keys()) {
|
|
17411
17415
|
if (!visited.has(depId)) {
|
|
17412
17416
|
visited.add(depId);
|
|
17413
|
-
|
|
17417
|
+
path12.push(depId);
|
|
17414
17418
|
if (findPath(depId)) return true;
|
|
17415
|
-
|
|
17419
|
+
path12.pop();
|
|
17416
17420
|
} else if (depId === from) {
|
|
17417
17421
|
return true;
|
|
17418
17422
|
}
|
|
@@ -17420,7 +17424,7 @@ function findCyclePath(from, to, getNode) {
|
|
|
17420
17424
|
return false;
|
|
17421
17425
|
};
|
|
17422
17426
|
findPath(to);
|
|
17423
|
-
return
|
|
17427
|
+
return path12;
|
|
17424
17428
|
}
|
|
17425
17429
|
function detectCycleDFS(nodeId, visited, stack, getNode) {
|
|
17426
17430
|
visited.add(nodeId);
|
|
@@ -17439,29 +17443,29 @@ function detectCycleDFS(nodeId, visited, stack, getNode) {
|
|
|
17439
17443
|
return false;
|
|
17440
17444
|
}
|
|
17441
17445
|
function findCycleFromNode(startId, getNode) {
|
|
17442
|
-
const
|
|
17446
|
+
const path12 = [];
|
|
17443
17447
|
const visited = /* @__PURE__ */ new Set();
|
|
17444
17448
|
const dfs = (nodeId) => {
|
|
17445
|
-
if (
|
|
17446
|
-
const cycleStart =
|
|
17447
|
-
|
|
17448
|
-
|
|
17449
|
+
if (path12.includes(nodeId)) {
|
|
17450
|
+
const cycleStart = path12.indexOf(nodeId);
|
|
17451
|
+
path12.splice(0, cycleStart);
|
|
17452
|
+
path12.push(nodeId);
|
|
17449
17453
|
return true;
|
|
17450
17454
|
}
|
|
17451
17455
|
if (visited.has(nodeId)) return false;
|
|
17452
17456
|
visited.add(nodeId);
|
|
17453
|
-
|
|
17457
|
+
path12.push(nodeId);
|
|
17454
17458
|
const node = getNode(nodeId);
|
|
17455
17459
|
if (node) {
|
|
17456
17460
|
for (const depId of node.dependencies.keys()) {
|
|
17457
17461
|
if (dfs(depId)) return true;
|
|
17458
17462
|
}
|
|
17459
17463
|
}
|
|
17460
|
-
|
|
17464
|
+
path12.pop();
|
|
17461
17465
|
return false;
|
|
17462
17466
|
};
|
|
17463
17467
|
dfs(startId);
|
|
17464
|
-
return
|
|
17468
|
+
return path12;
|
|
17465
17469
|
}
|
|
17466
17470
|
|
|
17467
17471
|
// src/agents/skills/skill-dependency-graph.ts
|
|
@@ -22444,18 +22448,18 @@ var DependencyGraph = class {
|
|
|
22444
22448
|
}
|
|
22445
22449
|
const startNode = firstNode;
|
|
22446
22450
|
const visited = /* @__PURE__ */ new Set();
|
|
22447
|
-
const
|
|
22451
|
+
const path12 = [];
|
|
22448
22452
|
const dfs = (nodeId) => {
|
|
22449
|
-
if (
|
|
22450
|
-
const cycleStart =
|
|
22451
|
-
|
|
22453
|
+
if (path12.includes(nodeId)) {
|
|
22454
|
+
const cycleStart = path12.indexOf(nodeId);
|
|
22455
|
+
path12.splice(0, cycleStart);
|
|
22452
22456
|
return true;
|
|
22453
22457
|
}
|
|
22454
22458
|
if (visited.has(nodeId)) {
|
|
22455
22459
|
return false;
|
|
22456
22460
|
}
|
|
22457
22461
|
visited.add(nodeId);
|
|
22458
|
-
|
|
22462
|
+
path12.push(nodeId);
|
|
22459
22463
|
const node = this.nodes.get(nodeId);
|
|
22460
22464
|
if (node) {
|
|
22461
22465
|
for (const depId of node.dependencies) {
|
|
@@ -22466,11 +22470,11 @@ var DependencyGraph = class {
|
|
|
22466
22470
|
}
|
|
22467
22471
|
}
|
|
22468
22472
|
}
|
|
22469
|
-
|
|
22473
|
+
path12.pop();
|
|
22470
22474
|
return false;
|
|
22471
22475
|
};
|
|
22472
22476
|
dfs(startNode);
|
|
22473
|
-
return
|
|
22477
|
+
return path12.length > 0 ? path12 : cycleNodes.slice(0, 3);
|
|
22474
22478
|
}
|
|
22475
22479
|
/**
|
|
22476
22480
|
* Gets the execution order (topologically sorted step IDs).
|
|
@@ -23325,9 +23329,9 @@ function getBuiltInTemplatesPath() {
|
|
|
23325
23329
|
join3(dirname(currentDir), "workflows", "templates"),
|
|
23326
23330
|
join3(dirname(currentDir), "dist", "workflows", "templates")
|
|
23327
23331
|
];
|
|
23328
|
-
for (const
|
|
23329
|
-
if (existsSync3(
|
|
23330
|
-
return
|
|
23332
|
+
for (const path12 of possiblePaths) {
|
|
23333
|
+
if (existsSync3(path12)) {
|
|
23334
|
+
return path12;
|
|
23331
23335
|
}
|
|
23332
23336
|
}
|
|
23333
23337
|
return join3(currentDir, "templates");
|
|
@@ -23868,9 +23872,9 @@ function validateRequiredInputs(inputs, required) {
|
|
|
23868
23872
|
}
|
|
23869
23873
|
|
|
23870
23874
|
// src/workflows/expression-resolver-helpers.ts
|
|
23871
|
-
function getNestedValue(obj,
|
|
23875
|
+
function getNestedValue(obj, path12) {
|
|
23872
23876
|
let current = obj;
|
|
23873
|
-
for (const key of
|
|
23877
|
+
for (const key of path12) {
|
|
23874
23878
|
if (current === null || current === void 0) {
|
|
23875
23879
|
return void 0;
|
|
23876
23880
|
}
|
|
@@ -23881,24 +23885,24 @@ function getNestedValue(obj, path11) {
|
|
|
23881
23885
|
}
|
|
23882
23886
|
return current;
|
|
23883
23887
|
}
|
|
23884
|
-
function resolveInputs(
|
|
23885
|
-
const value = getNestedValue(context.inputs,
|
|
23888
|
+
function resolveInputs(path12, context) {
|
|
23889
|
+
const value = getNestedValue(context.inputs, path12);
|
|
23886
23890
|
if (value === void 0) {
|
|
23887
23891
|
return {
|
|
23888
23892
|
success: false,
|
|
23889
|
-
error: `Input '${
|
|
23893
|
+
error: `Input '${path12.join(".")}' not found`
|
|
23890
23894
|
};
|
|
23891
23895
|
}
|
|
23892
23896
|
return { success: true, value };
|
|
23893
23897
|
}
|
|
23894
|
-
function validateStepPath(
|
|
23895
|
-
if (
|
|
23898
|
+
function validateStepPath(path12) {
|
|
23899
|
+
if (path12.length < 2) {
|
|
23896
23900
|
return {
|
|
23897
23901
|
success: false,
|
|
23898
23902
|
error: "Steps expression requires at least stepId and output"
|
|
23899
23903
|
};
|
|
23900
23904
|
}
|
|
23901
|
-
if (
|
|
23905
|
+
if (path12[0] === void 0 || path12[1] === void 0) {
|
|
23902
23906
|
return {
|
|
23903
23907
|
success: false,
|
|
23904
23908
|
error: "Steps expression requires stepId and output"
|
|
@@ -23924,12 +23928,12 @@ function validateStepResult(stepId, outputKey, stepResult) {
|
|
|
23924
23928
|
}
|
|
23925
23929
|
return null;
|
|
23926
23930
|
}
|
|
23927
|
-
function resolveSteps(
|
|
23928
|
-
const pathError = validateStepPath(
|
|
23931
|
+
function resolveSteps(path12, context) {
|
|
23932
|
+
const pathError = validateStepPath(path12);
|
|
23929
23933
|
if (pathError !== null) return pathError;
|
|
23930
|
-
const stepId =
|
|
23931
|
-
const outputKey =
|
|
23932
|
-
const rest =
|
|
23934
|
+
const stepId = path12[0] ?? "";
|
|
23935
|
+
const outputKey = path12[1] ?? "";
|
|
23936
|
+
const rest = path12.slice(2);
|
|
23933
23937
|
const stepResult = context.stepResults.get(stepId);
|
|
23934
23938
|
const earlyReturn = validateStepResult(stepId, outputKey, stepResult);
|
|
23935
23939
|
if (earlyReturn !== null) return earlyReturn;
|
|
@@ -23945,15 +23949,15 @@ function resolveSteps(path11, context) {
|
|
|
23945
23949
|
}
|
|
23946
23950
|
return { success: true, value };
|
|
23947
23951
|
}
|
|
23948
|
-
function resolveVariables(
|
|
23949
|
-
if (
|
|
23952
|
+
function resolveVariables(path12, context) {
|
|
23953
|
+
if (path12.length === 0) {
|
|
23950
23954
|
return {
|
|
23951
23955
|
success: false,
|
|
23952
23956
|
error: "Variables expression requires a variable name"
|
|
23953
23957
|
};
|
|
23954
23958
|
}
|
|
23955
|
-
const varName =
|
|
23956
|
-
const rest =
|
|
23959
|
+
const varName = path12[0];
|
|
23960
|
+
const rest = path12.slice(1);
|
|
23957
23961
|
if (varName === void 0) {
|
|
23958
23962
|
return {
|
|
23959
23963
|
success: false,
|
|
@@ -24997,8 +25001,8 @@ var WorkflowEngine = class {
|
|
|
24997
25001
|
this.config = resolveConfig2(config);
|
|
24998
25002
|
}
|
|
24999
25003
|
/** Load workflow template from file. */
|
|
25000
|
-
async loadTemplate(
|
|
25001
|
-
return this.deps.loadWorkflowFile(
|
|
25004
|
+
async loadTemplate(path12) {
|
|
25005
|
+
return this.deps.loadWorkflowFile(path12);
|
|
25002
25006
|
}
|
|
25003
25007
|
/**
|
|
25004
25008
|
* Execute a workflow with inputs.
|
|
@@ -25127,8 +25131,8 @@ var WorkflowEngine = class {
|
|
|
25127
25131
|
}
|
|
25128
25132
|
return Promise.resolve(templates);
|
|
25129
25133
|
}
|
|
25130
|
-
createTemplate(workflow,
|
|
25131
|
-
const t = { name: workflow.name, version: workflow.version, path:
|
|
25134
|
+
createTemplate(workflow, path12, category) {
|
|
25135
|
+
const t = { name: workflow.name, version: workflow.version, path: path12, category };
|
|
25132
25136
|
if (workflow.description !== void 0) t.description = workflow.description;
|
|
25133
25137
|
return t;
|
|
25134
25138
|
}
|
|
@@ -25435,8 +25439,8 @@ function createParseWorkflow() {
|
|
|
25435
25439
|
};
|
|
25436
25440
|
}
|
|
25437
25441
|
function createLoadWorkflowFile() {
|
|
25438
|
-
return async (
|
|
25439
|
-
const result = await loadWorkflowFile(
|
|
25442
|
+
return async (path12) => {
|
|
25443
|
+
const result = await loadWorkflowFile(path12);
|
|
25440
25444
|
if (!result.ok) {
|
|
25441
25445
|
if (result.error instanceof ParseError) {
|
|
25442
25446
|
return result;
|
|
@@ -30356,7 +30360,7 @@ function execIdFields(executionId) {
|
|
|
30356
30360
|
async function populateUnifiedContextOnState(state, options) {
|
|
30357
30361
|
const taskCandidate = state["task"];
|
|
30358
30362
|
if (typeof taskCandidate !== "string" || taskCandidate === "") return;
|
|
30359
|
-
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-
|
|
30363
|
+
const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-QI63DBJI.js");
|
|
30360
30364
|
const category = inferTaskCategory2(taskCandidate);
|
|
30361
30365
|
const executionId = options?.executionId;
|
|
30362
30366
|
const execFields = execIdFields(executionId);
|
|
@@ -31013,31 +31017,31 @@ var GraphBuilder = class {
|
|
|
31013
31017
|
}
|
|
31014
31018
|
const visited = /* @__PURE__ */ new Set();
|
|
31015
31019
|
const stack = /* @__PURE__ */ new Set();
|
|
31016
|
-
const
|
|
31020
|
+
const path12 = [];
|
|
31017
31021
|
for (const nodeId of this.nodes.keys()) {
|
|
31018
|
-
const cycle = this.dfs(nodeId, adj, visited, stack,
|
|
31022
|
+
const cycle = this.dfs(nodeId, adj, visited, stack, path12);
|
|
31019
31023
|
if (cycle !== void 0) return cycle;
|
|
31020
31024
|
}
|
|
31021
31025
|
return void 0;
|
|
31022
31026
|
}
|
|
31023
|
-
dfs(nodeId, adj, visited, stack,
|
|
31027
|
+
dfs(nodeId, adj, visited, stack, path12) {
|
|
31024
31028
|
if (stack.has(nodeId)) {
|
|
31025
|
-
const cycleStart =
|
|
31026
|
-
const cyclePath =
|
|
31029
|
+
const cycleStart = path12.indexOf(nodeId);
|
|
31030
|
+
const cyclePath = path12.slice(cycleStart);
|
|
31027
31031
|
cyclePath.push(nodeId);
|
|
31028
31032
|
return { type: "cycle_detected", path: cyclePath };
|
|
31029
31033
|
}
|
|
31030
31034
|
if (visited.has(nodeId)) return void 0;
|
|
31031
31035
|
visited.add(nodeId);
|
|
31032
31036
|
stack.add(nodeId);
|
|
31033
|
-
|
|
31037
|
+
path12.push(nodeId);
|
|
31034
31038
|
const neighbors = adj.get(nodeId) ?? [];
|
|
31035
31039
|
for (const neighbor of neighbors) {
|
|
31036
|
-
const cycle = this.dfs(neighbor, adj, visited, stack,
|
|
31040
|
+
const cycle = this.dfs(neighbor, adj, visited, stack, path12);
|
|
31037
31041
|
if (cycle !== void 0) return cycle;
|
|
31038
31042
|
}
|
|
31039
31043
|
stack.delete(nodeId);
|
|
31040
|
-
|
|
31044
|
+
path12.pop();
|
|
31041
31045
|
return void 0;
|
|
31042
31046
|
}
|
|
31043
31047
|
checkReachability() {
|
|
@@ -32005,8 +32009,8 @@ function extractModelAttribution(event) {
|
|
|
32005
32009
|
};
|
|
32006
32010
|
}
|
|
32007
32011
|
function extractRoutingAttribution(event) {
|
|
32008
|
-
const
|
|
32009
|
-
return { modelId: event.selectedModel, reasoning: event.reasoning, decisionPath:
|
|
32012
|
+
const path12 = event.decisionPath !== void 0 ? [...event.decisionPath] : void 0;
|
|
32013
|
+
return { modelId: event.selectedModel, reasoning: event.reasoning, decisionPath: path12 };
|
|
32010
32014
|
}
|
|
32011
32015
|
function extractPipelineAttribution(event) {
|
|
32012
32016
|
if (event.type === "pipeline.completed") {
|
|
@@ -41758,12 +41762,12 @@ function extractFileReferences(markdown) {
|
|
|
41758
41762
|
let match;
|
|
41759
41763
|
FILE_REF_PATTERN.lastIndex = 0;
|
|
41760
41764
|
while ((match = FILE_REF_PATTERN.exec(markdown)) !== null) {
|
|
41761
|
-
const
|
|
41762
|
-
if (
|
|
41763
|
-
seen.add(
|
|
41765
|
+
const path12 = match[1];
|
|
41766
|
+
if (path12 === void 0 || seen.has(path12)) continue;
|
|
41767
|
+
seen.add(path12);
|
|
41764
41768
|
const lineStr = match[2];
|
|
41765
41769
|
const line = lineStr !== void 0 ? parseInt(lineStr, 10) : void 0;
|
|
41766
|
-
refs.push(line !== void 0 ? { path:
|
|
41770
|
+
refs.push(line !== void 0 ? { path: path12, line } : { path: path12 });
|
|
41767
41771
|
}
|
|
41768
41772
|
return refs;
|
|
41769
41773
|
}
|
|
@@ -44506,11 +44510,54 @@ var InMemoryAuditStorage = class {
|
|
|
44506
44510
|
// src/audit/audit-storage.ts
|
|
44507
44511
|
import * as fs5 from "node:fs";
|
|
44508
44512
|
import * as os from "node:os";
|
|
44513
|
+
import * as path4 from "node:path";
|
|
44514
|
+
|
|
44515
|
+
// src/audit/audit-chain-tail.ts
|
|
44516
|
+
import { open } from "node:fs/promises";
|
|
44509
44517
|
import * as path3 from "node:path";
|
|
44518
|
+
var TAIL_CHUNK_BYTES = 64 * 1024;
|
|
44519
|
+
async function lastEventIn(filePath) {
|
|
44520
|
+
const handle = await open(filePath, "r");
|
|
44521
|
+
try {
|
|
44522
|
+
const { size } = await handle.stat();
|
|
44523
|
+
for (let window = TAIL_CHUNK_BYTES; ; window *= 2) {
|
|
44524
|
+
const start = Math.max(0, size - window);
|
|
44525
|
+
const buffer = Buffer.alloc(size - start);
|
|
44526
|
+
await handle.read(buffer, 0, buffer.length, start);
|
|
44527
|
+
const lines = buffer.toString("utf-8").split("\n");
|
|
44528
|
+
const whole = start === 0 ? lines : lines.slice(1);
|
|
44529
|
+
for (let i = whole.length - 1; i >= 0; i--) {
|
|
44530
|
+
const event = parseEvent(whole[i] ?? "");
|
|
44531
|
+
if (event !== null) return event;
|
|
44532
|
+
}
|
|
44533
|
+
if (start === 0) return null;
|
|
44534
|
+
}
|
|
44535
|
+
} finally {
|
|
44536
|
+
await handle.close();
|
|
44537
|
+
}
|
|
44538
|
+
}
|
|
44539
|
+
function parseEvent(line) {
|
|
44540
|
+
if (line.trim().length === 0) return null;
|
|
44541
|
+
try {
|
|
44542
|
+
const parsed = AuditEventSchema.safeParse(JSON.parse(line));
|
|
44543
|
+
return parsed.success ? { hash: parsed.data.hash } : null;
|
|
44544
|
+
} catch {
|
|
44545
|
+
return null;
|
|
44546
|
+
}
|
|
44547
|
+
}
|
|
44548
|
+
async function readChainTailHash(logDir, fileNamesNewestFirst) {
|
|
44549
|
+
for (const name of fileNamesNewestFirst) {
|
|
44550
|
+
const last = await lastEventIn(path3.join(logDir, name));
|
|
44551
|
+
if (last !== null) return last.hash;
|
|
44552
|
+
}
|
|
44553
|
+
return void 0;
|
|
44554
|
+
}
|
|
44555
|
+
|
|
44556
|
+
// src/audit/audit-storage.ts
|
|
44510
44557
|
function validateLogDir(logDir, allowedRoot) {
|
|
44511
|
-
const resolvedRoot =
|
|
44512
|
-
const resolvedLogDir =
|
|
44513
|
-
if (!resolvedLogDir.startsWith(resolvedRoot +
|
|
44558
|
+
const resolvedRoot = path4.resolve(allowedRoot);
|
|
44559
|
+
const resolvedLogDir = path4.resolve(allowedRoot, logDir);
|
|
44560
|
+
if (!resolvedLogDir.startsWith(resolvedRoot + path4.sep) && resolvedLogDir !== resolvedRoot) {
|
|
44514
44561
|
return {
|
|
44515
44562
|
ok: false,
|
|
44516
44563
|
error: new SecurityError("Path traversal detected: logDir escapes allowed root directory", {
|
|
@@ -44533,8 +44580,8 @@ function validateLogDirBasic(logDir) {
|
|
|
44533
44580
|
};
|
|
44534
44581
|
}
|
|
44535
44582
|
}
|
|
44536
|
-
const resolved =
|
|
44537
|
-
if (isRefusedSystemPath(resolved,
|
|
44583
|
+
const resolved = path4.resolve(logDir);
|
|
44584
|
+
if (isRefusedSystemPath(resolved, path4.resolve(os.homedir()))) {
|
|
44538
44585
|
return {
|
|
44539
44586
|
ok: false,
|
|
44540
44587
|
error: new SecurityError("logDir cannot be a system directory", {
|
|
@@ -44547,12 +44594,12 @@ function validateLogDirBasic(logDir) {
|
|
|
44547
44594
|
var ALWAYS_REFUSED_DIRS = ["/etc", "/usr", "/bin", "/sbin", "/proc", "/sys"];
|
|
44548
44595
|
var REFUSED_OUTSIDE_HOME_DIRS = ["/root", "/var"];
|
|
44549
44596
|
function isWithin(child, parent) {
|
|
44550
|
-
const rel =
|
|
44551
|
-
return rel === "" || rel !== ".." && !rel.startsWith(".." +
|
|
44597
|
+
const rel = path4.relative(parent, child);
|
|
44598
|
+
return rel === "" || rel !== ".." && !rel.startsWith(".." + path4.sep) && !path4.isAbsolute(rel);
|
|
44552
44599
|
}
|
|
44553
44600
|
function isRefusedSystemPath(resolved, home) {
|
|
44554
44601
|
if (ALWAYS_REFUSED_DIRS.some((dir) => isWithin(resolved, dir))) return true;
|
|
44555
|
-
const homeGrants = home !==
|
|
44602
|
+
const homeGrants = home !== path4.parse(home).root && isWithin(resolved, home);
|
|
44556
44603
|
return REFUSED_OUTSIDE_HOME_DIRS.some((dir) => isWithin(resolved, dir)) && !homeGrants;
|
|
44557
44604
|
}
|
|
44558
44605
|
var FileAuditStorage = class _FileAuditStorage {
|
|
@@ -44633,7 +44680,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
44633
44680
|
const existingFiles = this.getExistingLogFiles();
|
|
44634
44681
|
const latestFileName = existingFiles[0];
|
|
44635
44682
|
if (existingFiles.length > 0 && latestFileName !== void 0) {
|
|
44636
|
-
const latestFile =
|
|
44683
|
+
const latestFile = path4.join(this.logDir, latestFileName);
|
|
44637
44684
|
const stats = fs5.statSync(latestFile);
|
|
44638
44685
|
if (stats.size < this.maxFileSizeBytes) {
|
|
44639
44686
|
this.currentFile = latestFile;
|
|
@@ -44656,8 +44703,9 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
44656
44703
|
this.writeStream.end();
|
|
44657
44704
|
this.writeStream = null;
|
|
44658
44705
|
}
|
|
44659
|
-
this.currentFile =
|
|
44706
|
+
this.currentFile = path4.join(this.logDir, this.generateFileName());
|
|
44660
44707
|
this.currentFileSize = 0;
|
|
44708
|
+
fs5.closeSync(fs5.openSync(this.currentFile, "a"));
|
|
44661
44709
|
this.openWriteStream();
|
|
44662
44710
|
this.logger.debug("Rotated audit log file", { file: this.currentFile });
|
|
44663
44711
|
this.pruneOldFiles();
|
|
@@ -44667,7 +44715,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
44667
44715
|
if (files.length > this.maxFiles) {
|
|
44668
44716
|
const filesToDelete = files.slice(this.maxFiles);
|
|
44669
44717
|
for (const file of filesToDelete) {
|
|
44670
|
-
const filePath =
|
|
44718
|
+
const filePath = path4.join(this.logDir, file);
|
|
44671
44719
|
fs5.unlinkSync(filePath);
|
|
44672
44720
|
this.logger.info("Pruned old audit log", { file });
|
|
44673
44721
|
}
|
|
@@ -44699,6 +44747,60 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
44699
44747
|
});
|
|
44700
44748
|
});
|
|
44701
44749
|
}
|
|
44750
|
+
/**
|
|
44751
|
+
* Append a chained batch under the cross-process lock (#6546). The tail
|
|
44752
|
+
* read, the seal and the flush to disk all happen while the lock is held,
|
|
44753
|
+
* so two processes can neither both chain from the same tail (a fork) nor
|
|
44754
|
+
* interleave lines between another process's read and write.
|
|
44755
|
+
*/
|
|
44756
|
+
async appendChained(seal) {
|
|
44757
|
+
await withFileLock(path4.join(this.logDir, `${this.filePrefix}.lock`), async () => {
|
|
44758
|
+
this.adoptLatestFile();
|
|
44759
|
+
this.terminateTornLine();
|
|
44760
|
+
const tailHash = await readChainTailHash(this.logDir, this.getExistingLogFiles());
|
|
44761
|
+
for (const event of seal(tailHash)) await this.write(event);
|
|
44762
|
+
await this.flush();
|
|
44763
|
+
});
|
|
44764
|
+
}
|
|
44765
|
+
/**
|
|
44766
|
+
* Under the append lock, follow whichever file is newest now: another
|
|
44767
|
+
* process may have rotated or appended since this one last wrote. Appending
|
|
44768
|
+
* to an older file would place this batch BEFORE events it chains after.
|
|
44769
|
+
*/
|
|
44770
|
+
adoptLatestFile() {
|
|
44771
|
+
const latest = this.getExistingLogFiles()[0];
|
|
44772
|
+
if (latest === void 0) {
|
|
44773
|
+
this.rotateFile();
|
|
44774
|
+
return;
|
|
44775
|
+
}
|
|
44776
|
+
const latestPath = path4.join(this.logDir, latest);
|
|
44777
|
+
if (latestPath !== this.currentFile) {
|
|
44778
|
+
this.writeStream?.end();
|
|
44779
|
+
this.writeStream = null;
|
|
44780
|
+
this.currentFile = latestPath;
|
|
44781
|
+
this.openWriteStream();
|
|
44782
|
+
}
|
|
44783
|
+
this.currentFileSize = fs5.statSync(latestPath).size;
|
|
44784
|
+
}
|
|
44785
|
+
/**
|
|
44786
|
+
* Under the append lock: if a writer crashed mid-line, end that line before
|
|
44787
|
+
* appending, or the next event would be glued onto it and lost with it. The
|
|
44788
|
+
* torn line itself is left in place — the verifier still counts it as
|
|
44789
|
+
* skipped — and the tail read links the new batch past it.
|
|
44790
|
+
*/
|
|
44791
|
+
terminateTornLine() {
|
|
44792
|
+
if (this.currentFile === null || this.currentFileSize === 0) return;
|
|
44793
|
+
const last = Buffer.alloc(1);
|
|
44794
|
+
const fd = fs5.openSync(this.currentFile, "r");
|
|
44795
|
+
try {
|
|
44796
|
+
fs5.readSync(fd, last, 0, 1, this.currentFileSize - 1);
|
|
44797
|
+
} finally {
|
|
44798
|
+
fs5.closeSync(fd);
|
|
44799
|
+
}
|
|
44800
|
+
if (last[0] === 10) return;
|
|
44801
|
+
fs5.appendFileSync(this.currentFile, "\n");
|
|
44802
|
+
this.currentFileSize += 1;
|
|
44803
|
+
}
|
|
44702
44804
|
async close() {
|
|
44703
44805
|
await this.flush();
|
|
44704
44806
|
return new Promise((resolve19) => {
|
|
@@ -44721,7 +44823,7 @@ var FileAuditStorage = class _FileAuditStorage {
|
|
|
44721
44823
|
let skipped = 0;
|
|
44722
44824
|
for (const file of files) {
|
|
44723
44825
|
if (results.length >= limit) break;
|
|
44724
|
-
const filePath =
|
|
44826
|
+
const filePath = path4.join(this.logDir, file);
|
|
44725
44827
|
const events = await readAuditFile({
|
|
44726
44828
|
filePath,
|
|
44727
44829
|
criteria,
|
|
@@ -44977,14 +45079,30 @@ var AuditLogger = class {
|
|
|
44977
45079
|
policyName: input.policyName,
|
|
44978
45080
|
policyDecision: input.policyDecision,
|
|
44979
45081
|
violationType: input.violationType,
|
|
44980
|
-
|
|
45082
|
+
// Linked at flush time by sealChain (#6546), not here.
|
|
45083
|
+
previousHash: void 0
|
|
44981
45084
|
};
|
|
44982
45085
|
if (hasTierTransitionPayload(event)) event.hashVersion = AUDIT_HASH_VERSION_TIER_TRANSITION;
|
|
44983
|
-
|
|
45086
|
+
return JSON.parse(JSON.stringify(event));
|
|
45087
|
+
}
|
|
45088
|
+
/**
|
|
45089
|
+
* Link `events` onto the chain whose head is `tailHash` (#6546).
|
|
45090
|
+
*
|
|
45091
|
+
* Runs at flush time, not at log() time: the head of a shared log is only
|
|
45092
|
+
* known under the storage's cross-process lock, after reading the last
|
|
45093
|
+
* persisted event. `tailHash` undefined is the empty case — a fresh log —
|
|
45094
|
+
* and the first event is then a genesis event with no `previousHash`.
|
|
45095
|
+
*/
|
|
45096
|
+
sealChain(events, tailHash) {
|
|
45097
|
+
if (!this.enableHashChain) return events;
|
|
45098
|
+
let prior = tailHash;
|
|
45099
|
+
for (const event of events) {
|
|
45100
|
+
event.previousHash = prior;
|
|
44984
45101
|
event.hash = computeEventHash(event);
|
|
44985
|
-
|
|
45102
|
+
prior = event.hash;
|
|
44986
45103
|
}
|
|
44987
|
-
|
|
45104
|
+
this.lastHash = prior ?? null;
|
|
45105
|
+
return events;
|
|
44988
45106
|
}
|
|
44989
45107
|
log(input) {
|
|
44990
45108
|
if (this.closed) {
|
|
@@ -44992,7 +45110,13 @@ var AuditLogger = class {
|
|
|
44992
45110
|
return;
|
|
44993
45111
|
}
|
|
44994
45112
|
if (!this.shouldLog(input)) return;
|
|
44995
|
-
|
|
45113
|
+
let event;
|
|
45114
|
+
try {
|
|
45115
|
+
event = this.createEvent(input);
|
|
45116
|
+
} catch (err2) {
|
|
45117
|
+
this.recordPersistFailure(err2);
|
|
45118
|
+
return;
|
|
45119
|
+
}
|
|
44996
45120
|
this.eventQueue.push(event);
|
|
44997
45121
|
if (this.eventQueue.length > this.maxQueueDepth) {
|
|
44998
45122
|
const dropCount = this.eventQueue.length - this.maxQueueDepth;
|
|
@@ -45193,7 +45317,20 @@ var AuditLogger = class {
|
|
|
45193
45317
|
async drainAndFlushOnce() {
|
|
45194
45318
|
if (this.eventQueue.length > 0) {
|
|
45195
45319
|
const events = this.eventQueue.splice(0, this.eventQueue.length);
|
|
45196
|
-
|
|
45320
|
+
if (this.storage.appendChained !== void 0) {
|
|
45321
|
+
const progress = { sealed: false };
|
|
45322
|
+
try {
|
|
45323
|
+
await this.storage.appendChained((tailHash) => {
|
|
45324
|
+
progress.sealed = true;
|
|
45325
|
+
return this.sealChain(events, tailHash);
|
|
45326
|
+
});
|
|
45327
|
+
} catch (err2) {
|
|
45328
|
+
if (!progress.sealed) this.eventQueue.unshift(...events);
|
|
45329
|
+
throw err2;
|
|
45330
|
+
}
|
|
45331
|
+
return;
|
|
45332
|
+
}
|
|
45333
|
+
for (const event of this.sealChain(events, this.lastHash ?? void 0)) {
|
|
45197
45334
|
await this.storage.write(event);
|
|
45198
45335
|
}
|
|
45199
45336
|
}
|
|
@@ -45532,8 +45669,8 @@ function computePrReviewRecordHash(payload) {
|
|
|
45532
45669
|
}
|
|
45533
45670
|
|
|
45534
45671
|
// src/audit/pr-review-record-store.ts
|
|
45535
|
-
import { appendFileSync as
|
|
45536
|
-
import { dirname as dirname3, isAbsolute as isAbsolute2, join as
|
|
45672
|
+
import { appendFileSync as appendFileSync3, existsSync as existsSync7, mkdirSync as mkdirSync5, readFileSync as readFileSync6 } from "node:fs";
|
|
45673
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join10, resolve as resolve11 } from "node:path";
|
|
45537
45674
|
var PR_REVIEW_RECORDS_REL_PATH = "governance/pr-review-records.jsonl";
|
|
45538
45675
|
var PR_REVIEW_RECORDS_PATH_ENV = "NEXUS_PR_REVIEW_RECORDS_PATH";
|
|
45539
45676
|
var MAX_SUMMARY_RECORD_CHARS = 500;
|
|
@@ -45572,11 +45709,11 @@ function resolvePrReviewRecordsPath(repoPathOverride) {
|
|
|
45572
45709
|
}
|
|
45573
45710
|
if (repoPathOverride !== void 0 && repoPathOverride.trim() !== "") {
|
|
45574
45711
|
const overrideRoot = findRepoRoot(repoPathOverride);
|
|
45575
|
-
if (overrideRoot !== null) return
|
|
45712
|
+
if (overrideRoot !== null) return join10(overrideRoot, PR_REVIEW_RECORDS_REL_PATH);
|
|
45576
45713
|
}
|
|
45577
45714
|
const root = findRepoRoot(process.cwd());
|
|
45578
45715
|
if (root === null) return void 0;
|
|
45579
|
-
return
|
|
45716
|
+
return join10(root, PR_REVIEW_RECORDS_REL_PATH);
|
|
45580
45717
|
}
|
|
45581
45718
|
function readPrReviewRecords(filePath) {
|
|
45582
45719
|
const records = [];
|
|
@@ -45628,7 +45765,7 @@ function persistPrReviewRecord(opts) {
|
|
|
45628
45765
|
sequence: maxSequence + 1,
|
|
45629
45766
|
previousHash: lastHash
|
|
45630
45767
|
});
|
|
45631
|
-
|
|
45768
|
+
appendFileSync3(
|
|
45632
45769
|
filePath,
|
|
45633
45770
|
serializeValidatedRecord(PrReviewRecordSchema, record, "pr-review"),
|
|
45634
45771
|
"utf-8"
|
|
@@ -46194,7 +46331,7 @@ async function tryIssueTriage(task) {
|
|
|
46194
46331
|
try {
|
|
46195
46332
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
46196
46333
|
if (issueMatch === null) return null;
|
|
46197
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
46334
|
+
const { createIssueTriage } = await import("./issue-triage-DP27HRIY.js");
|
|
46198
46335
|
const triage = createIssueTriage();
|
|
46199
46336
|
const owner = issueMatch[1] ?? "";
|
|
46200
46337
|
const num2 = issueMatch[2] ?? "";
|
|
@@ -46222,7 +46359,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
46222
46359
|
]);
|
|
46223
46360
|
async function classifyWithLLM(task) {
|
|
46224
46361
|
try {
|
|
46225
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
46362
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-WP7PJDNV.js");
|
|
46226
46363
|
const prompt = [
|
|
46227
46364
|
"Classify this task into exactly one pipeline template.",
|
|
46228
46365
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -46329,7 +46466,7 @@ function ensureRunnableTemplate(template, stages) {
|
|
|
46329
46466
|
|
|
46330
46467
|
// src/pipeline/pipeline-checkpoint.ts
|
|
46331
46468
|
import * as fs6 from "node:fs";
|
|
46332
|
-
import * as
|
|
46469
|
+
import * as path5 from "node:path";
|
|
46333
46470
|
import { z as z99 } from "zod";
|
|
46334
46471
|
var logger39 = createLogger({ component: "pipeline-checkpoint" });
|
|
46335
46472
|
var SESSION_ID_REGEX = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
@@ -46342,7 +46479,7 @@ function getCheckpointPath(sessionId, customDir) {
|
|
|
46342
46479
|
logger39.warn("Checkpoint directory unavailable", { error: dirResult.error.message });
|
|
46343
46480
|
return null;
|
|
46344
46481
|
}
|
|
46345
|
-
return
|
|
46482
|
+
return path5.join(dirResult.value, `pipeline-${sessionId}.jsonl`);
|
|
46346
46483
|
}
|
|
46347
46484
|
function saveStageCheckpoint(sessionId, stage, data, customDir) {
|
|
46348
46485
|
if (!validateSessionId(sessionId)) {
|
|
@@ -46596,7 +46733,7 @@ function buildVotingInput(plan, config) {
|
|
|
46596
46733
|
}
|
|
46597
46734
|
async function executeSingleVote(plan, config, log) {
|
|
46598
46735
|
try {
|
|
46599
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
46736
|
+
const { executeVoting } = await import("./consensus-vote-44KYPBV4.js");
|
|
46600
46737
|
const input = buildVotingInput(plan, config);
|
|
46601
46738
|
const result = await executeVoting(input, log);
|
|
46602
46739
|
return parseVotingResult(result);
|
|
@@ -47329,7 +47466,7 @@ var memoryInitPromise = null;
|
|
|
47329
47466
|
async function initPipelineMemory() {
|
|
47330
47467
|
if (cachedMemory !== null) return cachedMemory;
|
|
47331
47468
|
try {
|
|
47332
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
47469
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-K63UQWAN.js");
|
|
47333
47470
|
const { getLearningDir } = await import("./learning-persistence-FB4U5AX2.js");
|
|
47334
47471
|
const mem = createSessionMemory2(getLearningDir());
|
|
47335
47472
|
mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
|
|
@@ -47391,7 +47528,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0,
|
|
|
47391
47528
|
callRecord(routingMemoryCache);
|
|
47392
47529
|
return;
|
|
47393
47530
|
}
|
|
47394
|
-
routingMemoryInitPromise ??= import("./routing-memory-
|
|
47531
|
+
routingMemoryInitPromise ??= import("./routing-memory-FRZ3EZBT.js").then(({ createRoutingMemory }) => {
|
|
47395
47532
|
routingMemoryCache ??= createRoutingMemory();
|
|
47396
47533
|
return routingMemoryCache;
|
|
47397
47534
|
}).catch((error) => {
|
|
@@ -47562,7 +47699,7 @@ function createVoteStage({ config, startStage }) {
|
|
|
47562
47699
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
47563
47700
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
47564
47701
|
try {
|
|
47565
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
47702
|
+
const { executeVoting } = await import("./consensus-vote-44KYPBV4.js");
|
|
47566
47703
|
const votingResult = await executeVoting(
|
|
47567
47704
|
{
|
|
47568
47705
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -47685,8 +47822,8 @@ function parseEnvelope(json) {
|
|
|
47685
47822
|
}
|
|
47686
47823
|
function describeZodError(error) {
|
|
47687
47824
|
return error.issues.slice(0, 3).map((issue) => {
|
|
47688
|
-
const
|
|
47689
|
-
return `${
|
|
47825
|
+
const path12 = issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
47826
|
+
return `${path12}: ${issue.message}`;
|
|
47690
47827
|
}).join("; ");
|
|
47691
47828
|
}
|
|
47692
47829
|
function parseSarif(sarifJson, maxFindings = 100) {
|
|
@@ -47865,7 +48002,7 @@ function resolveConfidence(rule) {
|
|
|
47865
48002
|
}
|
|
47866
48003
|
|
|
47867
48004
|
// src/mcp/tools/security-scan.ts
|
|
47868
|
-
import * as
|
|
48005
|
+
import * as path6 from "node:path";
|
|
47869
48006
|
var logger46 = createLogger({ component: "security-scan" });
|
|
47870
48007
|
var SCAN_TIMEOUT_MS = 3e5;
|
|
47871
48008
|
async function isSemgrepAvailable() {
|
|
@@ -47892,9 +48029,9 @@ async function runSemgrep(targetDir, rulesets) {
|
|
|
47892
48029
|
return stdout;
|
|
47893
48030
|
}
|
|
47894
48031
|
function validateTargetPath(target) {
|
|
47895
|
-
const root =
|
|
47896
|
-
const resolved =
|
|
47897
|
-
if (resolved !== root && !resolved.startsWith(root +
|
|
48032
|
+
const root = path6.resolve(process.cwd());
|
|
48033
|
+
const resolved = path6.resolve(root, target);
|
|
48034
|
+
if (resolved !== root && !resolved.startsWith(root + path6.sep)) {
|
|
47898
48035
|
throw new Error(`Invalid target path: must resolve inside ${root} (got ${resolved})`);
|
|
47899
48036
|
}
|
|
47900
48037
|
return resolved;
|
|
@@ -48095,8 +48232,8 @@ async function runOsvCheck(targetDir, enabled) {
|
|
|
48095
48232
|
if (!enabled) return OSV_EMPTY;
|
|
48096
48233
|
try {
|
|
48097
48234
|
const fs12 = await import("node:fs");
|
|
48098
|
-
const
|
|
48099
|
-
const pkgPath =
|
|
48235
|
+
const path12 = await import("node:path");
|
|
48236
|
+
const pkgPath = path12.join(targetDir, "package.json");
|
|
48100
48237
|
if (!fs12.existsSync(pkgPath)) return OSV_EMPTY;
|
|
48101
48238
|
const pkg = JSON.parse(fs12.readFileSync(pkgPath, "utf-8"));
|
|
48102
48239
|
const declared = Object.keys(pkg.dependencies ?? {}).length;
|
|
@@ -48155,7 +48292,7 @@ function buildScanSummary(total, blocking, osvCount, osv, sarifParseErrors = 0)
|
|
|
48155
48292
|
|
|
48156
48293
|
// src/security/quality-gate-commands.ts
|
|
48157
48294
|
import { existsSync as existsSync9, readFileSync as readFileSync8 } from "node:fs";
|
|
48158
|
-
import { join as
|
|
48295
|
+
import { join as join12 } from "node:path";
|
|
48159
48296
|
var LOCKFILES = [
|
|
48160
48297
|
{ file: "pnpm-lock.yaml", manager: "pnpm" },
|
|
48161
48298
|
{ file: "yarn.lock", manager: "yarn" },
|
|
@@ -48170,12 +48307,12 @@ var SCRIPT_CANDIDATES = {
|
|
|
48170
48307
|
};
|
|
48171
48308
|
function detectPackageManager(projectDir) {
|
|
48172
48309
|
for (const { file, manager } of LOCKFILES) {
|
|
48173
|
-
if (existsSync9(
|
|
48310
|
+
if (existsSync9(join12(projectDir, file))) return manager;
|
|
48174
48311
|
}
|
|
48175
48312
|
return "npm";
|
|
48176
48313
|
}
|
|
48177
48314
|
function readScripts(projectDir) {
|
|
48178
|
-
const manifest =
|
|
48315
|
+
const manifest = join12(projectDir, "package.json");
|
|
48179
48316
|
if (!existsSync9(manifest)) return void 0;
|
|
48180
48317
|
try {
|
|
48181
48318
|
const parsed = JSON.parse(readFileSync8(manifest, "utf-8"));
|
|
@@ -48322,7 +48459,7 @@ ${text}` : "";
|
|
|
48322
48459
|
}
|
|
48323
48460
|
async function getWeatherContext() {
|
|
48324
48461
|
try {
|
|
48325
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
48462
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-YZIE7PAH.js");
|
|
48326
48463
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
48327
48464
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
48328
48465
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -48340,7 +48477,7 @@ ${lines}
|
|
|
48340
48477
|
}
|
|
48341
48478
|
async function getMemoryContext(task) {
|
|
48342
48479
|
try {
|
|
48343
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
48480
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-K63UQWAN.js");
|
|
48344
48481
|
const { getLearningDir } = await import("./learning-persistence-FB4U5AX2.js");
|
|
48345
48482
|
const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
|
|
48346
48483
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -48905,7 +49042,7 @@ async function searchCodebaseForTask(task) {
|
|
|
48905
49042
|
}
|
|
48906
49043
|
async function queryResearchRegistry(task) {
|
|
48907
49044
|
try {
|
|
48908
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
49045
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-MOJKZLS5.js");
|
|
48909
49046
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
48910
49047
|
if (topic === void 0) return null;
|
|
48911
49048
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -48976,7 +49113,7 @@ function createScanStageWrapper() {
|
|
|
48976
49113
|
try {
|
|
48977
49114
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
48978
49115
|
if (slug !== void 0) {
|
|
48979
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
49116
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-5GNN6EQ2.js");
|
|
48980
49117
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
48981
49118
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
48982
49119
|
return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
|
|
@@ -49242,8 +49379,8 @@ var SENSITIVE_PATH_PATTERNS = Object.freeze([
|
|
|
49242
49379
|
"permission",
|
|
49243
49380
|
"sql"
|
|
49244
49381
|
]);
|
|
49245
|
-
function isSensitivePath(
|
|
49246
|
-
const lower =
|
|
49382
|
+
function isSensitivePath(path12) {
|
|
49383
|
+
const lower = path12.toLowerCase();
|
|
49247
49384
|
return SENSITIVE_PATH_PATTERNS.some((p) => lower.includes(p));
|
|
49248
49385
|
}
|
|
49249
49386
|
function byteLen(text) {
|
|
@@ -50388,7 +50525,7 @@ function registerVendorPublishingAuditTool(server, deps) {
|
|
|
50388
50525
|
|
|
50389
50526
|
// src/mcp/tools/compare-data-feeds.ts
|
|
50390
50527
|
import { z as z105 } from "zod";
|
|
50391
|
-
import * as
|
|
50528
|
+
import * as path7 from "node:path";
|
|
50392
50529
|
import * as fs7 from "node:fs";
|
|
50393
50530
|
import * as yaml4 from "yaml";
|
|
50394
50531
|
var CompareDataFeedsInputSchema = z105.object({
|
|
@@ -50412,7 +50549,7 @@ function readDottedPath(obj, dottedPath) {
|
|
|
50412
50549
|
return cursor;
|
|
50413
50550
|
}
|
|
50414
50551
|
function parseFeedContent(content, sourcePath) {
|
|
50415
|
-
const ext =
|
|
50552
|
+
const ext = path7.extname(sourcePath).toLowerCase();
|
|
50416
50553
|
if (ext === ".json") {
|
|
50417
50554
|
return JSON.parse(content);
|
|
50418
50555
|
}
|
|
@@ -50519,9 +50656,9 @@ function buildSummary(feedAPath, feedBPath, diff, fieldDiffs, fields) {
|
|
|
50519
50656
|
return lines.join("\n");
|
|
50520
50657
|
}
|
|
50521
50658
|
function loadFeed(feedPath) {
|
|
50522
|
-
const resolved =
|
|
50523
|
-
const cwdRoot =
|
|
50524
|
-
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot +
|
|
50659
|
+
const resolved = path7.resolve(feedPath);
|
|
50660
|
+
const cwdRoot = path7.resolve(".");
|
|
50661
|
+
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot + path7.sep)) {
|
|
50525
50662
|
throw new Error(`Path traversal denied: ${feedPath} must be within ${cwdRoot}`);
|
|
50526
50663
|
}
|
|
50527
50664
|
if (!fs7.existsSync(resolved)) {
|
|
@@ -50689,7 +50826,7 @@ function registerQueryTaskStateTool(server, deps) {
|
|
|
50689
50826
|
import { z as z109 } from "zod";
|
|
50690
50827
|
|
|
50691
50828
|
// src/mcp/tools/ci-health-log.ts
|
|
50692
|
-
import { appendFileSync as
|
|
50829
|
+
import { appendFileSync as appendFileSync5, existsSync as existsSync11, readFileSync as readFileSync10, statSync as statSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
50693
50830
|
import { z as z108 } from "zod";
|
|
50694
50831
|
|
|
50695
50832
|
// src/mcp/tools/ci-health-types.ts
|
|
@@ -50721,17 +50858,17 @@ function maxLogBytes() {
|
|
|
50721
50858
|
const n = Number.parseInt(raw, 10);
|
|
50722
50859
|
return Number.isFinite(n) && n > 0 ? n : DEFAULT_CI_HEALTH_MAX_BYTES;
|
|
50723
50860
|
}
|
|
50724
|
-
function capLogSize(
|
|
50861
|
+
function capLogSize(path12) {
|
|
50725
50862
|
const max = maxLogBytes();
|
|
50726
50863
|
let size;
|
|
50727
50864
|
try {
|
|
50728
|
-
size = statSync2(
|
|
50865
|
+
size = statSync2(path12).size;
|
|
50729
50866
|
} catch {
|
|
50730
50867
|
return;
|
|
50731
50868
|
}
|
|
50732
50869
|
if (size <= max) return;
|
|
50733
50870
|
try {
|
|
50734
|
-
const lines = readFileSync10(
|
|
50871
|
+
const lines = readFileSync10(path12, "utf-8").split("\n").filter((l) => l !== "");
|
|
50735
50872
|
const kept = [];
|
|
50736
50873
|
let bytes2 = 0;
|
|
50737
50874
|
for (let i = lines.length - 1; i >= 0; i--) {
|
|
@@ -50743,7 +50880,7 @@ function capLogSize(path11) {
|
|
|
50743
50880
|
bytes2 += lineBytes;
|
|
50744
50881
|
}
|
|
50745
50882
|
kept.reverse();
|
|
50746
|
-
writeFileSync3(
|
|
50883
|
+
writeFileSync3(path12, kept.length > 0 ? `${kept.join("\n")}
|
|
50747
50884
|
` : "");
|
|
50748
50885
|
logger51.warn("ci-health log exceeded size cap \u2014 dropped oldest events", {
|
|
50749
50886
|
maxBytes: max,
|
|
@@ -50764,10 +50901,10 @@ function appendCiHealthEvent(event) {
|
|
|
50764
50901
|
...event
|
|
50765
50902
|
};
|
|
50766
50903
|
try {
|
|
50767
|
-
const
|
|
50768
|
-
|
|
50904
|
+
const path12 = logFilePath();
|
|
50905
|
+
appendFileSync5(path12, `${JSON.stringify(record)}
|
|
50769
50906
|
`);
|
|
50770
|
-
capLogSize(
|
|
50907
|
+
capLogSize(path12);
|
|
50771
50908
|
} catch (err2) {
|
|
50772
50909
|
logger51.warn("Failed to append ci-health event", {
|
|
50773
50910
|
error: err2 instanceof Error ? err2.message : String(err2)
|
|
@@ -51076,7 +51213,7 @@ function registerRunQualityGateTool(server, deps) {
|
|
|
51076
51213
|
|
|
51077
51214
|
// src/mcp/tools/verify-audit-chain-tool.ts
|
|
51078
51215
|
import * as fs8 from "node:fs/promises";
|
|
51079
|
-
import * as
|
|
51216
|
+
import * as path8 from "node:path";
|
|
51080
51217
|
import { z as z111 } from "zod";
|
|
51081
51218
|
|
|
51082
51219
|
// src/cli-server-auth.ts
|
|
@@ -51292,7 +51429,7 @@ async function loadAuditEvents(dir, logger60, filePrefix = DEFAULT_AUDIT_FILE_PR
|
|
|
51292
51429
|
let skippedLines = 0;
|
|
51293
51430
|
let unreadableFiles = 0;
|
|
51294
51431
|
for (const filename of auditFiles) {
|
|
51295
|
-
const fullPath =
|
|
51432
|
+
const fullPath = path8.join(dir, filename);
|
|
51296
51433
|
let content;
|
|
51297
51434
|
try {
|
|
51298
51435
|
content = await fs8.readFile(fullPath, "utf-8");
|
|
@@ -51316,7 +51453,7 @@ async function handler2(args, ctx) {
|
|
|
51316
51453
|
message: `Validation error: ${formatZodError(parsed.error)}`
|
|
51317
51454
|
});
|
|
51318
51455
|
}
|
|
51319
|
-
const resolvedDir =
|
|
51456
|
+
const resolvedDir = path8.resolve(parsed.data.logDir);
|
|
51320
51457
|
let dirStats;
|
|
51321
51458
|
try {
|
|
51322
51459
|
dirStats = await fs8.stat(resolvedDir);
|
|
@@ -51972,7 +52109,7 @@ function createMetaOrchestrator(options) {
|
|
|
51972
52109
|
}
|
|
51973
52110
|
|
|
51974
52111
|
// src/orchestration/meta-shadow-selector.ts
|
|
51975
|
-
import { appendFileSync as
|
|
52112
|
+
import { appendFileSync as appendFileSync6, existsSync as existsSync12, readFileSync as readFileSync11 } from "node:fs";
|
|
51976
52113
|
import { z as z113 } from "zod";
|
|
51977
52114
|
var SHADOW_STRATEGY_ARMS = [
|
|
51978
52115
|
"single-shot",
|
|
@@ -52088,7 +52225,7 @@ function persistMetaOutcome(strategy, decision, success) {
|
|
|
52088
52225
|
};
|
|
52089
52226
|
try {
|
|
52090
52227
|
ensureLearningDir();
|
|
52091
|
-
|
|
52228
|
+
appendFileSync6(getMetaOutcomesFile(), JSON.stringify(record) + "\n", "utf-8");
|
|
52092
52229
|
} catch (err2) {
|
|
52093
52230
|
persistLogger.warn("Failed to persist meta-outcome (ignored)", {
|
|
52094
52231
|
error: getErrorMessage(err2)
|
|
@@ -52469,12 +52606,12 @@ function evaluateMetaStrategyReadiness(result, config = DEFAULT_META_STRATEGY_RE
|
|
|
52469
52606
|
// src/mcp/tools/dev-pipeline-tool.ts
|
|
52470
52607
|
import { z as z114 } from "zod";
|
|
52471
52608
|
import * as fs10 from "node:fs";
|
|
52472
|
-
import * as
|
|
52609
|
+
import * as path10 from "node:path";
|
|
52473
52610
|
import { randomUUID as randomUUID15 } from "node:crypto";
|
|
52474
52611
|
|
|
52475
52612
|
// src/pipeline/task-tracker.ts
|
|
52476
52613
|
import * as fs9 from "node:fs";
|
|
52477
|
-
import * as
|
|
52614
|
+
import * as path9 from "node:path";
|
|
52478
52615
|
var logger52 = createLogger({ component: "task-tracker" });
|
|
52479
52616
|
async function exec(cmd, args, timeout = 15e3) {
|
|
52480
52617
|
const { execFile: execFile2 } = await import("node:child_process");
|
|
@@ -52491,7 +52628,7 @@ var GitHubTaskTracker = class {
|
|
|
52491
52628
|
cachedProvider = null;
|
|
52492
52629
|
async getProvider() {
|
|
52493
52630
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
52494
|
-
const { createScmProvider } = await import("./factory-
|
|
52631
|
+
const { createScmProvider } = await import("./factory-H7WD46ZF.js");
|
|
52495
52632
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
52496
52633
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
52497
52634
|
this.cachedProvider = result.value;
|
|
@@ -52554,8 +52691,8 @@ var JsonTaskTracker = class {
|
|
|
52554
52691
|
outputPath;
|
|
52555
52692
|
constructor(config) {
|
|
52556
52693
|
const dir = config.outputDir ?? nexusDataPath("pipeline");
|
|
52557
|
-
this.outputPath =
|
|
52558
|
-
fs9.mkdirSync(
|
|
52694
|
+
this.outputPath = path9.resolve(dir, "tasks.json");
|
|
52695
|
+
fs9.mkdirSync(path9.dirname(this.outputPath), { recursive: true });
|
|
52559
52696
|
}
|
|
52560
52697
|
async createTask(title, body) {
|
|
52561
52698
|
const id = String(this.nextId++);
|
|
@@ -52707,9 +52844,9 @@ async function resolveTaskInput(input) {
|
|
|
52707
52844
|
return input.task;
|
|
52708
52845
|
}
|
|
52709
52846
|
if (input.planFile !== void 0) {
|
|
52710
|
-
const resolved =
|
|
52711
|
-
const cwdRoot =
|
|
52712
|
-
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot +
|
|
52847
|
+
const resolved = path10.resolve(input.planFile);
|
|
52848
|
+
const cwdRoot = path10.resolve(".");
|
|
52849
|
+
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot + path10.sep)) {
|
|
52713
52850
|
throw new Error(`Path traversal denied: planFile must be within ${cwdRoot}`);
|
|
52714
52851
|
}
|
|
52715
52852
|
try {
|
|
@@ -52940,7 +53077,7 @@ function registerDevPipelineTool(server, deps) {
|
|
|
52940
53077
|
// src/mcp/tools/pipeline-tool.ts
|
|
52941
53078
|
import { z as z115 } from "zod";
|
|
52942
53079
|
import * as fs11 from "node:fs";
|
|
52943
|
-
import * as
|
|
53080
|
+
import * as path11 from "node:path";
|
|
52944
53081
|
import { randomUUID as randomUUID16 } from "node:crypto";
|
|
52945
53082
|
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.";
|
|
52946
53083
|
var PipelineInputSchema = z115.object({
|
|
@@ -53003,9 +53140,9 @@ function buildOutput3(result, simulated) {
|
|
|
53003
53140
|
}
|
|
53004
53141
|
async function resolveTask(task, specFile) {
|
|
53005
53142
|
if (specFile === void 0) return task;
|
|
53006
|
-
const resolved =
|
|
53007
|
-
const cwdRoot =
|
|
53008
|
-
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot +
|
|
53143
|
+
const resolved = path11.resolve(specFile);
|
|
53144
|
+
const cwdRoot = path11.resolve(".");
|
|
53145
|
+
if (resolved !== cwdRoot && !resolved.startsWith(cwdRoot + path11.sep)) {
|
|
53009
53146
|
throw new Error(`Path traversal denied: specFile must be within ${cwdRoot}`);
|
|
53010
53147
|
}
|
|
53011
53148
|
try {
|
|
@@ -53463,7 +53600,7 @@ async function probeSource(source, includeModelIds) {
|
|
|
53463
53600
|
}
|
|
53464
53601
|
}
|
|
53465
53602
|
async function defaultSources(includeOpenRouter) {
|
|
53466
|
-
const { createAllAdapters: createAllAdapters2 } = await import("./factory-
|
|
53603
|
+
const { createAllAdapters: createAllAdapters2 } = await import("./factory-QJVIUHGU.js");
|
|
53467
53604
|
const adapters = createAllAdapters2();
|
|
53468
53605
|
return buildDefaultModelSources(adapters, { includeOpenRouter });
|
|
53469
53606
|
}
|
|
@@ -56795,4 +56932,4 @@ export {
|
|
|
56795
56932
|
startPipelineEventBridge,
|
|
56796
56933
|
shutdownPipelineEventBridge
|
|
56797
56934
|
};
|
|
56798
|
-
//# sourceMappingURL=chunk-
|
|
56935
|
+
//# sourceMappingURL=chunk-GUEUV3ND.js.map
|